@magda/utils 3.0.1 → 3.0.2-alpha.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.
Files changed (3) hide show
  1. package/dist/index.d.ts +12 -0
  2. package/dist/index.js +2971 -217
  3. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -11,6 +11,9 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
11
11
  return require.apply(this, arguments);
12
12
  throw Error('Dynamic require of "' + x + '" is not supported');
13
13
  });
14
+ var __esm = (fn, res) => function __init() {
15
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
16
+ };
14
17
  var __commonJS = (cb, mod) => function __require2() {
15
18
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
16
19
  };
@@ -31,10 +34,23 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
31
34
  mod
32
35
  ));
33
36
 
37
+ // ../cjs-shim.js
38
+ import { createRequire } from "module";
39
+ import path from "path";
40
+ import url from "url";
41
+ var init_cjs_shim = __esm({
42
+ "../cjs-shim.js"() {
43
+ globalThis.require = createRequire(import.meta.url);
44
+ globalThis.__filename = url.fileURLToPath(import.meta.url);
45
+ globalThis.__dirname = path.dirname(__filename);
46
+ }
47
+ });
48
+
34
49
  // ../../node_modules/cross-fetch/node_modules/webidl-conversions/lib/index.js
35
50
  var require_lib = __commonJS({
36
51
  "../../node_modules/cross-fetch/node_modules/webidl-conversions/lib/index.js"(exports, module) {
37
52
  "use strict";
53
+ init_cjs_shim();
38
54
  var conversions = {};
39
55
  module.exports = conversions;
40
56
  function sign(x) {
@@ -192,6 +208,7 @@ var require_lib = __commonJS({
192
208
  var require_utils = __commonJS({
193
209
  "../../node_modules/cross-fetch/node_modules/whatwg-url/lib/utils.js"(exports, module) {
194
210
  "use strict";
211
+ init_cjs_shim();
195
212
  module.exports.mixin = function mixin(target, source) {
196
213
  const keys = Object.getOwnPropertyNames(source);
197
214
  for (let i = 0; i < keys.length; ++i) {
@@ -220,6 +237,7 @@ var require_mappingTable = __commonJS({
220
237
  var require_tr46 = __commonJS({
221
238
  "../../node_modules/cross-fetch/node_modules/tr46/index.js"(exports, module) {
222
239
  "use strict";
240
+ init_cjs_shim();
223
241
  var punycode = __require("punycode");
224
242
  var mappingTable = require_mappingTable();
225
243
  var PROCESSING_OPTIONS = {
@@ -382,6 +400,7 @@ var require_tr46 = __commonJS({
382
400
  var require_url_state_machine = __commonJS({
383
401
  "../../node_modules/cross-fetch/node_modules/whatwg-url/lib/url-state-machine.js"(exports, module) {
384
402
  "use strict";
403
+ init_cjs_shim();
385
404
  var punycode = __require("punycode");
386
405
  var tr46 = require_tr46();
387
406
  var specialSchemes = {
@@ -438,8 +457,8 @@ var require_url_state_machine = __commonJS({
438
457
  function isSpecialScheme(scheme) {
439
458
  return specialSchemes[scheme] !== void 0;
440
459
  }
441
- function isSpecial(url) {
442
- return isSpecialScheme(url.scheme);
460
+ function isSpecial(url2) {
461
+ return isSpecialScheme(url2.scheme);
443
462
  }
444
463
  function defaultPort(scheme) {
445
464
  return specialSchemes[scheme];
@@ -761,38 +780,38 @@ var require_url_state_machine = __commonJS({
761
780
  }
762
781
  return host;
763
782
  }
764
- function trimControlChars(url) {
765
- return url.replace(/^[\u0000-\u001F\u0020]+|[\u0000-\u001F\u0020]+$/g, "");
783
+ function trimControlChars(url2) {
784
+ return url2.replace(/^[\u0000-\u001F\u0020]+|[\u0000-\u001F\u0020]+$/g, "");
766
785
  }
767
- function trimTabAndNewline(url) {
768
- return url.replace(/\u0009|\u000A|\u000D/g, "");
786
+ function trimTabAndNewline(url2) {
787
+ return url2.replace(/\u0009|\u000A|\u000D/g, "");
769
788
  }
770
- function shortenPath(url) {
771
- const path = url.path;
772
- if (path.length === 0) {
789
+ function shortenPath(url2) {
790
+ const path2 = url2.path;
791
+ if (path2.length === 0) {
773
792
  return;
774
793
  }
775
- if (url.scheme === "file" && path.length === 1 && isNormalizedWindowsDriveLetter(path[0])) {
794
+ if (url2.scheme === "file" && path2.length === 1 && isNormalizedWindowsDriveLetter(path2[0])) {
776
795
  return;
777
796
  }
778
- path.pop();
797
+ path2.pop();
779
798
  }
780
- function includesCredentials(url) {
781
- return url.username !== "" || url.password !== "";
799
+ function includesCredentials(url2) {
800
+ return url2.username !== "" || url2.password !== "";
782
801
  }
783
- function cannotHaveAUsernamePasswordPort(url) {
784
- return url.host === null || url.host === "" || url.cannotBeABaseURL || url.scheme === "file";
802
+ function cannotHaveAUsernamePasswordPort(url2) {
803
+ return url2.host === null || url2.host === "" || url2.cannotBeABaseURL || url2.scheme === "file";
785
804
  }
786
805
  function isNormalizedWindowsDriveLetter(string) {
787
806
  return /^[A-Za-z]:$/.test(string);
788
807
  }
789
- function URLStateMachine(input, base, encodingOverride, url, stateOverride) {
808
+ function URLStateMachine(input, base, encodingOverride, url2, stateOverride) {
790
809
  this.pointer = 0;
791
810
  this.input = input;
792
811
  this.base = base || null;
793
812
  this.encodingOverride = encodingOverride || "utf-8";
794
813
  this.stateOverride = stateOverride;
795
- this.url = url;
814
+ this.url = url2;
796
815
  this.failure = false;
797
816
  this.parseError = false;
798
817
  if (!this.url) {
@@ -1345,36 +1364,36 @@ var require_url_state_machine = __commonJS({
1345
1364
  }
1346
1365
  return true;
1347
1366
  };
1348
- function serializeURL(url, excludeFragment) {
1349
- let output = url.scheme + ":";
1350
- if (url.host !== null) {
1367
+ function serializeURL(url2, excludeFragment) {
1368
+ let output = url2.scheme + ":";
1369
+ if (url2.host !== null) {
1351
1370
  output += "//";
1352
- if (url.username !== "" || url.password !== "") {
1353
- output += url.username;
1354
- if (url.password !== "") {
1355
- output += ":" + url.password;
1371
+ if (url2.username !== "" || url2.password !== "") {
1372
+ output += url2.username;
1373
+ if (url2.password !== "") {
1374
+ output += ":" + url2.password;
1356
1375
  }
1357
1376
  output += "@";
1358
1377
  }
1359
- output += serializeHost(url.host);
1360
- if (url.port !== null) {
1361
- output += ":" + url.port;
1378
+ output += serializeHost(url2.host);
1379
+ if (url2.port !== null) {
1380
+ output += ":" + url2.port;
1362
1381
  }
1363
- } else if (url.host === null && url.scheme === "file") {
1382
+ } else if (url2.host === null && url2.scheme === "file") {
1364
1383
  output += "//";
1365
1384
  }
1366
- if (url.cannotBeABaseURL) {
1367
- output += url.path[0];
1385
+ if (url2.cannotBeABaseURL) {
1386
+ output += url2.path[0];
1368
1387
  } else {
1369
- for (const string of url.path) {
1388
+ for (const string of url2.path) {
1370
1389
  output += "/" + string;
1371
1390
  }
1372
1391
  }
1373
- if (url.query !== null) {
1374
- output += "?" + url.query;
1392
+ if (url2.query !== null) {
1393
+ output += "?" + url2.query;
1375
1394
  }
1376
- if (!excludeFragment && url.fragment !== null) {
1377
- output += "#" + url.fragment;
1395
+ if (!excludeFragment && url2.fragment !== null) {
1396
+ output += "#" + url2.fragment;
1378
1397
  }
1379
1398
  return output;
1380
1399
  }
@@ -1387,11 +1406,11 @@ var require_url_state_machine = __commonJS({
1387
1406
  return result;
1388
1407
  }
1389
1408
  module.exports.serializeURL = serializeURL;
1390
- module.exports.serializeURLOrigin = function(url) {
1391
- switch (url.scheme) {
1409
+ module.exports.serializeURLOrigin = function(url2) {
1410
+ switch (url2.scheme) {
1392
1411
  case "blob":
1393
1412
  try {
1394
- return module.exports.serializeURLOrigin(module.exports.parseURL(url.path[0]));
1413
+ return module.exports.serializeURLOrigin(module.exports.parseURL(url2.path[0]));
1395
1414
  } catch (e) {
1396
1415
  return "null";
1397
1416
  }
@@ -1402,9 +1421,9 @@ var require_url_state_machine = __commonJS({
1402
1421
  case "ws":
1403
1422
  case "wss":
1404
1423
  return serializeOrigin({
1405
- scheme: url.scheme,
1406
- host: url.host,
1407
- port: url.port
1424
+ scheme: url2.scheme,
1425
+ host: url2.host,
1426
+ port: url2.port
1408
1427
  });
1409
1428
  case "file":
1410
1429
  return "file://";
@@ -1422,18 +1441,18 @@ var require_url_state_machine = __commonJS({
1422
1441
  }
1423
1442
  return usm.url;
1424
1443
  };
1425
- module.exports.setTheUsername = function(url, username) {
1426
- url.username = "";
1444
+ module.exports.setTheUsername = function(url2, username) {
1445
+ url2.username = "";
1427
1446
  const decoded = punycode.ucs2.decode(username);
1428
1447
  for (let i = 0; i < decoded.length; ++i) {
1429
- url.username += percentEncodeChar(decoded[i], isUserinfoPercentEncode);
1448
+ url2.username += percentEncodeChar(decoded[i], isUserinfoPercentEncode);
1430
1449
  }
1431
1450
  };
1432
- module.exports.setThePassword = function(url, password) {
1433
- url.password = "";
1451
+ module.exports.setThePassword = function(url2, password) {
1452
+ url2.password = "";
1434
1453
  const decoded = punycode.ucs2.decode(password);
1435
1454
  for (let i = 0; i < decoded.length; ++i) {
1436
- url.password += percentEncodeChar(decoded[i], isUserinfoPercentEncode);
1455
+ url2.password += percentEncodeChar(decoded[i], isUserinfoPercentEncode);
1437
1456
  }
1438
1457
  };
1439
1458
  module.exports.serializeHost = serializeHost;
@@ -1454,10 +1473,11 @@ var require_url_state_machine = __commonJS({
1454
1473
  var require_URL_impl = __commonJS({
1455
1474
  "../../node_modules/cross-fetch/node_modules/whatwg-url/lib/URL-impl.js"(exports) {
1456
1475
  "use strict";
1476
+ init_cjs_shim();
1457
1477
  var usm = require_url_state_machine();
1458
1478
  exports.implementation = class URLImpl {
1459
1479
  constructor(constructorArgs) {
1460
- const url = constructorArgs[0];
1480
+ const url2 = constructorArgs[0];
1461
1481
  const base = constructorArgs[1];
1462
1482
  let parsedBase = null;
1463
1483
  if (base !== void 0) {
@@ -1466,7 +1486,7 @@ var require_URL_impl = __commonJS({
1466
1486
  throw new TypeError("Invalid base URL");
1467
1487
  }
1468
1488
  }
1469
- const parsedURL = usm.basicURLParse(url, { baseURL: parsedBase });
1489
+ const parsedURL = usm.basicURLParse(url2, { baseURL: parsedBase });
1470
1490
  if (parsedURL === "failure") {
1471
1491
  throw new TypeError("Invalid URL");
1472
1492
  }
@@ -1510,14 +1530,14 @@ var require_URL_impl = __commonJS({
1510
1530
  usm.setThePassword(this._url, v);
1511
1531
  }
1512
1532
  get host() {
1513
- const url = this._url;
1514
- if (url.host === null) {
1533
+ const url2 = this._url;
1534
+ if (url2.host === null) {
1515
1535
  return "";
1516
1536
  }
1517
- if (url.port === null) {
1518
- return usm.serializeHost(url.host);
1537
+ if (url2.port === null) {
1538
+ return usm.serializeHost(url2.host);
1519
1539
  }
1520
- return usm.serializeHost(url.host) + ":" + usm.serializeInteger(url.port);
1540
+ return usm.serializeHost(url2.host) + ":" + usm.serializeInteger(url2.port);
1521
1541
  }
1522
1542
  set host(v) {
1523
1543
  if (this._url.cannotBeABaseURL) {
@@ -1576,14 +1596,14 @@ var require_URL_impl = __commonJS({
1576
1596
  return "?" + this._url.query;
1577
1597
  }
1578
1598
  set search(v) {
1579
- const url = this._url;
1599
+ const url2 = this._url;
1580
1600
  if (v === "") {
1581
- url.query = null;
1601
+ url2.query = null;
1582
1602
  return;
1583
1603
  }
1584
1604
  const input = v[0] === "?" ? v.substring(1) : v;
1585
- url.query = "";
1586
- usm.basicURLParse(input, { url, stateOverride: "query" });
1605
+ url2.query = "";
1606
+ usm.basicURLParse(input, { url: url2, stateOverride: "query" });
1587
1607
  }
1588
1608
  get hash() {
1589
1609
  if (this._url.fragment === null || this._url.fragment === "") {
@@ -1611,11 +1631,12 @@ var require_URL_impl = __commonJS({
1611
1631
  var require_URL = __commonJS({
1612
1632
  "../../node_modules/cross-fetch/node_modules/whatwg-url/lib/URL.js"(exports, module) {
1613
1633
  "use strict";
1634
+ init_cjs_shim();
1614
1635
  var conversions = require_lib();
1615
1636
  var utils = require_utils();
1616
1637
  var Impl = require_URL_impl();
1617
1638
  var impl = utils.implSymbol;
1618
- function URL(url) {
1639
+ function URL(url2) {
1619
1640
  if (!this || this[impl] || !(this instanceof URL)) {
1620
1641
  throw new TypeError("Failed to construct 'URL': Please use the 'new' operator, this DOM object constructor cannot be called as a function.");
1621
1642
  }
@@ -1794,6 +1815,7 @@ var require_URL = __commonJS({
1794
1815
  var require_public_api = __commonJS({
1795
1816
  "../../node_modules/cross-fetch/node_modules/whatwg-url/lib/public-api.js"(exports) {
1796
1817
  "use strict";
1818
+ init_cjs_shim();
1797
1819
  exports.URL = require_URL().interface;
1798
1820
  exports.serializeURL = require_url_state_machine().serializeURL;
1799
1821
  exports.serializeURLOrigin = require_url_state_machine().serializeURLOrigin;
@@ -1810,6 +1832,7 @@ var require_public_api = __commonJS({
1810
1832
  var require_safer = __commonJS({
1811
1833
  "../../node_modules/safer-buffer/safer.js"(exports, module) {
1812
1834
  "use strict";
1835
+ init_cjs_shim();
1813
1836
  var buffer = __require("buffer");
1814
1837
  var Buffer2 = buffer.Buffer;
1815
1838
  var safer = {};
@@ -1882,6 +1905,7 @@ var require_safer = __commonJS({
1882
1905
  var require_bom_handling = __commonJS({
1883
1906
  "../../node_modules/iconv-lite/lib/bom-handling.js"(exports) {
1884
1907
  "use strict";
1908
+ init_cjs_shim();
1885
1909
  var BOMChar = "\uFEFF";
1886
1910
  exports.PrependBOM = PrependBOMWrapper;
1887
1911
  function PrependBOMWrapper(encoder, options) {
@@ -1926,6 +1950,7 @@ var require_bom_handling = __commonJS({
1926
1950
  var require_internal = __commonJS({
1927
1951
  "../../node_modules/iconv-lite/encodings/internal.js"(exports, module) {
1928
1952
  "use strict";
1953
+ init_cjs_shim();
1929
1954
  var Buffer2 = require_safer().Buffer;
1930
1955
  module.exports = {
1931
1956
  // Encodings
@@ -2070,6 +2095,7 @@ var require_internal = __commonJS({
2070
2095
  var require_utf16 = __commonJS({
2071
2096
  "../../node_modules/iconv-lite/encodings/utf16.js"(exports) {
2072
2097
  "use strict";
2098
+ init_cjs_shim();
2073
2099
  var Buffer2 = require_safer().Buffer;
2074
2100
  exports.utf16be = Utf16BECodec;
2075
2101
  function Utf16BECodec() {
@@ -2188,6 +2214,7 @@ var require_utf16 = __commonJS({
2188
2214
  var require_utf7 = __commonJS({
2189
2215
  "../../node_modules/iconv-lite/encodings/utf7.js"(exports) {
2190
2216
  "use strict";
2217
+ init_cjs_shim();
2191
2218
  var Buffer2 = require_safer().Buffer;
2192
2219
  exports.utf7 = Utf7Codec;
2193
2220
  exports.unicode11utf7 = "utf7";
@@ -2389,6 +2416,7 @@ var require_utf7 = __commonJS({
2389
2416
  var require_sbcs_codec = __commonJS({
2390
2417
  "../../node_modules/iconv-lite/encodings/sbcs-codec.js"(exports) {
2391
2418
  "use strict";
2419
+ init_cjs_shim();
2392
2420
  var Buffer2 = require_safer().Buffer;
2393
2421
  exports._sbcs = SBCSCodec;
2394
2422
  function SBCSCodec(codecOptions, iconv) {
@@ -2445,6 +2473,7 @@ var require_sbcs_codec = __commonJS({
2445
2473
  var require_sbcs_data = __commonJS({
2446
2474
  "../../node_modules/iconv-lite/encodings/sbcs-data.js"(exports, module) {
2447
2475
  "use strict";
2476
+ init_cjs_shim();
2448
2477
  module.exports = {
2449
2478
  // Not supported by iconv, not sure why.
2450
2479
  "10029": "maccenteuro",
@@ -2594,6 +2623,7 @@ var require_sbcs_data = __commonJS({
2594
2623
  var require_sbcs_data_generated = __commonJS({
2595
2624
  "../../node_modules/iconv-lite/encodings/sbcs-data-generated.js"(exports, module) {
2596
2625
  "use strict";
2626
+ init_cjs_shim();
2597
2627
  module.exports = {
2598
2628
  "437": "cp437",
2599
2629
  "737": "cp737",
@@ -3049,6 +3079,7 @@ var require_sbcs_data_generated = __commonJS({
3049
3079
  var require_dbcs_codec = __commonJS({
3050
3080
  "../../node_modules/iconv-lite/encodings/dbcs-codec.js"(exports) {
3051
3081
  "use strict";
3082
+ init_cjs_shim();
3052
3083
  var Buffer2 = require_safer().Buffer;
3053
3084
  exports._dbcs = DBCSCodec;
3054
3085
  var UNASSIGNED = -1;
@@ -4681,6 +4712,7 @@ var require_big5_added = __commonJS({
4681
4712
  var require_dbcs_data = __commonJS({
4682
4713
  "../../node_modules/iconv-lite/encodings/dbcs-data.js"(exports, module) {
4683
4714
  "use strict";
4715
+ init_cjs_shim();
4684
4716
  module.exports = {
4685
4717
  // == Japanese/ShiftJIS ====================================================
4686
4718
  // All japanese encodings are based on JIS X set of standards:
@@ -4856,6 +4888,7 @@ var require_dbcs_data = __commonJS({
4856
4888
  var require_encodings = __commonJS({
4857
4889
  "../../node_modules/iconv-lite/encodings/index.js"(exports, module) {
4858
4890
  "use strict";
4891
+ init_cjs_shim();
4859
4892
  var modules = [
4860
4893
  require_internal(),
4861
4894
  require_utf16(),
@@ -4882,6 +4915,7 @@ var require_encodings = __commonJS({
4882
4915
  var require_streams = __commonJS({
4883
4916
  "../../node_modules/iconv-lite/lib/streams.js"(exports, module) {
4884
4917
  "use strict";
4918
+ init_cjs_shim();
4885
4919
  var Buffer2 = __require("buffer").Buffer;
4886
4920
  var Transform = __require("stream").Transform;
4887
4921
  module.exports = function(iconv) {
@@ -4987,6 +5021,7 @@ var require_streams = __commonJS({
4987
5021
  var require_extend_node = __commonJS({
4988
5022
  "../../node_modules/iconv-lite/lib/extend-node.js"(exports, module) {
4989
5023
  "use strict";
5024
+ init_cjs_shim();
4990
5025
  var Buffer2 = __require("buffer").Buffer;
4991
5026
  module.exports = function(iconv) {
4992
5027
  var original = void 0;
@@ -5156,6 +5191,7 @@ var require_extend_node = __commonJS({
5156
5191
  var require_lib2 = __commonJS({
5157
5192
  "../../node_modules/iconv-lite/lib/index.js"(exports, module) {
5158
5193
  "use strict";
5194
+ init_cjs_shim();
5159
5195
  var Buffer2 = require_safer().Buffer;
5160
5196
  var bomHandling = require_bom_handling();
5161
5197
  var iconv = module.exports;
@@ -5259,6 +5295,7 @@ var require_lib2 = __commonJS({
5259
5295
  var require_iconv_loader = __commonJS({
5260
5296
  "../../node_modules/encoding/lib/iconv-loader.js"(exports, module) {
5261
5297
  "use strict";
5298
+ init_cjs_shim();
5262
5299
  var iconv_package;
5263
5300
  var Iconv;
5264
5301
  try {
@@ -5274,6 +5311,7 @@ var require_iconv_loader = __commonJS({
5274
5311
  var require_encoding = __commonJS({
5275
5312
  "../../node_modules/encoding/lib/encoding.js"(exports, module) {
5276
5313
  "use strict";
5314
+ init_cjs_shim();
5277
5315
  var iconvLite = require_lib2();
5278
5316
  var Iconv = require_iconv_loader();
5279
5317
  module.exports.convert = convert;
@@ -5341,6 +5379,7 @@ var require_encoding = __commonJS({
5341
5379
  var require_lib3 = __commonJS({
5342
5380
  "../../node_modules/cross-fetch/node_modules/node-fetch/lib/index.js"(exports, module) {
5343
5381
  "use strict";
5382
+ init_cjs_shim();
5344
5383
  Object.defineProperty(exports, "__esModule", { value: true });
5345
5384
  function _interopDefault(ex) {
5346
5385
  return ex && typeof ex === "object" && "default" in ex ? ex["default"] : ex;
@@ -6336,13 +6375,13 @@ var require_lib3 = __commonJS({
6336
6375
  const dest = new URL$1(destination).protocol;
6337
6376
  return orig === dest;
6338
6377
  };
6339
- function fetch2(url, opts) {
6378
+ function fetch2(url2, opts) {
6340
6379
  if (!fetch2.Promise) {
6341
6380
  throw new Error("native promise missing, set fetch.Promise to your favorite alternative");
6342
6381
  }
6343
6382
  Body.Promise = fetch2.Promise;
6344
6383
  return new fetch2.Promise(function(resolve, reject) {
6345
- const request = new Request(url, opts);
6384
+ const request = new Request(url2, opts);
6346
6385
  const options = getNodeRequestOptions(request);
6347
6386
  const send = (options.protocol === "https:" ? https : http).request;
6348
6387
  const signal = request.signal;
@@ -6415,13 +6454,13 @@ var require_lib3 = __commonJS({
6415
6454
  clearTimeout(reqTimeout);
6416
6455
  const headers = createHeadersLenient(res.headers);
6417
6456
  if (fetch2.isRedirect(res.statusCode)) {
6418
- const location = headers.get("Location");
6457
+ const location2 = headers.get("Location");
6419
6458
  let locationURL = null;
6420
6459
  try {
6421
- locationURL = location === null ? null : new URL$1(location, request.url).toString();
6460
+ locationURL = location2 === null ? null : new URL$1(location2, request.url).toString();
6422
6461
  } catch (err) {
6423
6462
  if (request.redirect !== "manual") {
6424
- reject(new FetchError(`uri requested responds with an invalid redirect URL: ${location}`, "invalid-redirect"));
6463
+ reject(new FetchError(`uri requested responds with an invalid redirect URL: ${location2}`, "invalid-redirect"));
6425
6464
  finalize();
6426
6465
  return;
6427
6466
  }
@@ -6587,13 +6626,14 @@ var require_lib3 = __commonJS({
6587
6626
  // ../../node_modules/cross-fetch/dist/node-ponyfill.js
6588
6627
  var require_node_ponyfill = __commonJS({
6589
6628
  "../../node_modules/cross-fetch/dist/node-ponyfill.js"(exports, module) {
6629
+ init_cjs_shim();
6590
6630
  var nodeFetch = require_lib3();
6591
6631
  var realFetch = nodeFetch.default || nodeFetch;
6592
- var fetch2 = function(url, options) {
6593
- if (/^\/\//.test(url)) {
6594
- url = "https:" + url;
6632
+ var fetch2 = function(url2, options) {
6633
+ if (/^\/\//.test(url2)) {
6634
+ url2 = "https:" + url2;
6595
6635
  }
6596
- return realFetch.call(this, url, options);
6636
+ return realFetch.call(this, url2, options);
6597
6637
  };
6598
6638
  fetch2.ponyfill = true;
6599
6639
  module.exports = exports = fetch2;
@@ -6608,6 +6648,7 @@ var require_node_ponyfill = __commonJS({
6608
6648
  // ../../node_modules/lodash/_listCacheClear.js
6609
6649
  var require_listCacheClear = __commonJS({
6610
6650
  "../../node_modules/lodash/_listCacheClear.js"(exports, module) {
6651
+ init_cjs_shim();
6611
6652
  function listCacheClear() {
6612
6653
  this.__data__ = [];
6613
6654
  this.size = 0;
@@ -6619,6 +6660,7 @@ var require_listCacheClear = __commonJS({
6619
6660
  // ../../node_modules/lodash/eq.js
6620
6661
  var require_eq = __commonJS({
6621
6662
  "../../node_modules/lodash/eq.js"(exports, module) {
6663
+ init_cjs_shim();
6622
6664
  function eq2(value, other) {
6623
6665
  return value === other || value !== value && other !== other;
6624
6666
  }
@@ -6629,6 +6671,7 @@ var require_eq = __commonJS({
6629
6671
  // ../../node_modules/lodash/_assocIndexOf.js
6630
6672
  var require_assocIndexOf = __commonJS({
6631
6673
  "../../node_modules/lodash/_assocIndexOf.js"(exports, module) {
6674
+ init_cjs_shim();
6632
6675
  var eq2 = require_eq();
6633
6676
  function assocIndexOf(array, key) {
6634
6677
  var length = array.length;
@@ -6646,6 +6689,7 @@ var require_assocIndexOf = __commonJS({
6646
6689
  // ../../node_modules/lodash/_listCacheDelete.js
6647
6690
  var require_listCacheDelete = __commonJS({
6648
6691
  "../../node_modules/lodash/_listCacheDelete.js"(exports, module) {
6692
+ init_cjs_shim();
6649
6693
  var assocIndexOf = require_assocIndexOf();
6650
6694
  var arrayProto = Array.prototype;
6651
6695
  var splice = arrayProto.splice;
@@ -6670,6 +6714,7 @@ var require_listCacheDelete = __commonJS({
6670
6714
  // ../../node_modules/lodash/_listCacheGet.js
6671
6715
  var require_listCacheGet = __commonJS({
6672
6716
  "../../node_modules/lodash/_listCacheGet.js"(exports, module) {
6717
+ init_cjs_shim();
6673
6718
  var assocIndexOf = require_assocIndexOf();
6674
6719
  function listCacheGet(key) {
6675
6720
  var data = this.__data__, index = assocIndexOf(data, key);
@@ -6682,6 +6727,7 @@ var require_listCacheGet = __commonJS({
6682
6727
  // ../../node_modules/lodash/_listCacheHas.js
6683
6728
  var require_listCacheHas = __commonJS({
6684
6729
  "../../node_modules/lodash/_listCacheHas.js"(exports, module) {
6730
+ init_cjs_shim();
6685
6731
  var assocIndexOf = require_assocIndexOf();
6686
6732
  function listCacheHas(key) {
6687
6733
  return assocIndexOf(this.__data__, key) > -1;
@@ -6693,6 +6739,7 @@ var require_listCacheHas = __commonJS({
6693
6739
  // ../../node_modules/lodash/_listCacheSet.js
6694
6740
  var require_listCacheSet = __commonJS({
6695
6741
  "../../node_modules/lodash/_listCacheSet.js"(exports, module) {
6742
+ init_cjs_shim();
6696
6743
  var assocIndexOf = require_assocIndexOf();
6697
6744
  function listCacheSet(key, value) {
6698
6745
  var data = this.__data__, index = assocIndexOf(data, key);
@@ -6711,6 +6758,7 @@ var require_listCacheSet = __commonJS({
6711
6758
  // ../../node_modules/lodash/_ListCache.js
6712
6759
  var require_ListCache = __commonJS({
6713
6760
  "../../node_modules/lodash/_ListCache.js"(exports, module) {
6761
+ init_cjs_shim();
6714
6762
  var listCacheClear = require_listCacheClear();
6715
6763
  var listCacheDelete = require_listCacheDelete();
6716
6764
  var listCacheGet = require_listCacheGet();
@@ -6736,6 +6784,7 @@ var require_ListCache = __commonJS({
6736
6784
  // ../../node_modules/lodash/_stackClear.js
6737
6785
  var require_stackClear = __commonJS({
6738
6786
  "../../node_modules/lodash/_stackClear.js"(exports, module) {
6787
+ init_cjs_shim();
6739
6788
  var ListCache = require_ListCache();
6740
6789
  function stackClear() {
6741
6790
  this.__data__ = new ListCache();
@@ -6748,6 +6797,7 @@ var require_stackClear = __commonJS({
6748
6797
  // ../../node_modules/lodash/_stackDelete.js
6749
6798
  var require_stackDelete = __commonJS({
6750
6799
  "../../node_modules/lodash/_stackDelete.js"(exports, module) {
6800
+ init_cjs_shim();
6751
6801
  function stackDelete(key) {
6752
6802
  var data = this.__data__, result = data["delete"](key);
6753
6803
  this.size = data.size;
@@ -6760,6 +6810,7 @@ var require_stackDelete = __commonJS({
6760
6810
  // ../../node_modules/lodash/_stackGet.js
6761
6811
  var require_stackGet = __commonJS({
6762
6812
  "../../node_modules/lodash/_stackGet.js"(exports, module) {
6813
+ init_cjs_shim();
6763
6814
  function stackGet(key) {
6764
6815
  return this.__data__.get(key);
6765
6816
  }
@@ -6770,6 +6821,7 @@ var require_stackGet = __commonJS({
6770
6821
  // ../../node_modules/lodash/_stackHas.js
6771
6822
  var require_stackHas = __commonJS({
6772
6823
  "../../node_modules/lodash/_stackHas.js"(exports, module) {
6824
+ init_cjs_shim();
6773
6825
  function stackHas(key) {
6774
6826
  return this.__data__.has(key);
6775
6827
  }
@@ -6780,6 +6832,7 @@ var require_stackHas = __commonJS({
6780
6832
  // ../../node_modules/lodash/_freeGlobal.js
6781
6833
  var require_freeGlobal = __commonJS({
6782
6834
  "../../node_modules/lodash/_freeGlobal.js"(exports, module) {
6835
+ init_cjs_shim();
6783
6836
  var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
6784
6837
  module.exports = freeGlobal;
6785
6838
  }
@@ -6788,6 +6841,7 @@ var require_freeGlobal = __commonJS({
6788
6841
  // ../../node_modules/lodash/_root.js
6789
6842
  var require_root = __commonJS({
6790
6843
  "../../node_modules/lodash/_root.js"(exports, module) {
6844
+ init_cjs_shim();
6791
6845
  var freeGlobal = require_freeGlobal();
6792
6846
  var freeSelf = typeof self == "object" && self && self.Object === Object && self;
6793
6847
  var root = freeGlobal || freeSelf || Function("return this")();
@@ -6798,6 +6852,7 @@ var require_root = __commonJS({
6798
6852
  // ../../node_modules/lodash/_Symbol.js
6799
6853
  var require_Symbol = __commonJS({
6800
6854
  "../../node_modules/lodash/_Symbol.js"(exports, module) {
6855
+ init_cjs_shim();
6801
6856
  var root = require_root();
6802
6857
  var Symbol2 = root.Symbol;
6803
6858
  module.exports = Symbol2;
@@ -6807,6 +6862,7 @@ var require_Symbol = __commonJS({
6807
6862
  // ../../node_modules/lodash/_getRawTag.js
6808
6863
  var require_getRawTag = __commonJS({
6809
6864
  "../../node_modules/lodash/_getRawTag.js"(exports, module) {
6865
+ init_cjs_shim();
6810
6866
  var Symbol2 = require_Symbol();
6811
6867
  var objectProto = Object.prototype;
6812
6868
  var hasOwnProperty = objectProto.hasOwnProperty;
@@ -6836,6 +6892,7 @@ var require_getRawTag = __commonJS({
6836
6892
  // ../../node_modules/lodash/_objectToString.js
6837
6893
  var require_objectToString = __commonJS({
6838
6894
  "../../node_modules/lodash/_objectToString.js"(exports, module) {
6895
+ init_cjs_shim();
6839
6896
  var objectProto = Object.prototype;
6840
6897
  var nativeObjectToString = objectProto.toString;
6841
6898
  function objectToString(value) {
@@ -6848,6 +6905,7 @@ var require_objectToString = __commonJS({
6848
6905
  // ../../node_modules/lodash/_baseGetTag.js
6849
6906
  var require_baseGetTag = __commonJS({
6850
6907
  "../../node_modules/lodash/_baseGetTag.js"(exports, module) {
6908
+ init_cjs_shim();
6851
6909
  var Symbol2 = require_Symbol();
6852
6910
  var getRawTag = require_getRawTag();
6853
6911
  var objectToString = require_objectToString();
@@ -6867,6 +6925,7 @@ var require_baseGetTag = __commonJS({
6867
6925
  // ../../node_modules/lodash/isObject.js
6868
6926
  var require_isObject = __commonJS({
6869
6927
  "../../node_modules/lodash/isObject.js"(exports, module) {
6928
+ init_cjs_shim();
6870
6929
  function isObject(value) {
6871
6930
  var type = typeof value;
6872
6931
  return value != null && (type == "object" || type == "function");
@@ -6878,6 +6937,7 @@ var require_isObject = __commonJS({
6878
6937
  // ../../node_modules/lodash/isFunction.js
6879
6938
  var require_isFunction = __commonJS({
6880
6939
  "../../node_modules/lodash/isFunction.js"(exports, module) {
6940
+ init_cjs_shim();
6881
6941
  var baseGetTag = require_baseGetTag();
6882
6942
  var isObject = require_isObject();
6883
6943
  var asyncTag = "[object AsyncFunction]";
@@ -6898,6 +6958,7 @@ var require_isFunction = __commonJS({
6898
6958
  // ../../node_modules/lodash/_coreJsData.js
6899
6959
  var require_coreJsData = __commonJS({
6900
6960
  "../../node_modules/lodash/_coreJsData.js"(exports, module) {
6961
+ init_cjs_shim();
6901
6962
  var root = require_root();
6902
6963
  var coreJsData = root["__core-js_shared__"];
6903
6964
  module.exports = coreJsData;
@@ -6907,6 +6968,7 @@ var require_coreJsData = __commonJS({
6907
6968
  // ../../node_modules/lodash/_isMasked.js
6908
6969
  var require_isMasked = __commonJS({
6909
6970
  "../../node_modules/lodash/_isMasked.js"(exports, module) {
6971
+ init_cjs_shim();
6910
6972
  var coreJsData = require_coreJsData();
6911
6973
  var maskSrcKey = function() {
6912
6974
  var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
@@ -6922,6 +6984,7 @@ var require_isMasked = __commonJS({
6922
6984
  // ../../node_modules/lodash/_toSource.js
6923
6985
  var require_toSource = __commonJS({
6924
6986
  "../../node_modules/lodash/_toSource.js"(exports, module) {
6987
+ init_cjs_shim();
6925
6988
  var funcProto = Function.prototype;
6926
6989
  var funcToString = funcProto.toString;
6927
6990
  function toSource(func) {
@@ -6944,6 +7007,7 @@ var require_toSource = __commonJS({
6944
7007
  // ../../node_modules/lodash/_baseIsNative.js
6945
7008
  var require_baseIsNative = __commonJS({
6946
7009
  "../../node_modules/lodash/_baseIsNative.js"(exports, module) {
7010
+ init_cjs_shim();
6947
7011
  var isFunction = require_isFunction();
6948
7012
  var isMasked = require_isMasked();
6949
7013
  var isObject = require_isObject();
@@ -6971,6 +7035,7 @@ var require_baseIsNative = __commonJS({
6971
7035
  // ../../node_modules/lodash/_getValue.js
6972
7036
  var require_getValue = __commonJS({
6973
7037
  "../../node_modules/lodash/_getValue.js"(exports, module) {
7038
+ init_cjs_shim();
6974
7039
  function getValue(object, key) {
6975
7040
  return object == null ? void 0 : object[key];
6976
7041
  }
@@ -6981,6 +7046,7 @@ var require_getValue = __commonJS({
6981
7046
  // ../../node_modules/lodash/_getNative.js
6982
7047
  var require_getNative = __commonJS({
6983
7048
  "../../node_modules/lodash/_getNative.js"(exports, module) {
7049
+ init_cjs_shim();
6984
7050
  var baseIsNative = require_baseIsNative();
6985
7051
  var getValue = require_getValue();
6986
7052
  function getNative(object, key) {
@@ -6994,6 +7060,7 @@ var require_getNative = __commonJS({
6994
7060
  // ../../node_modules/lodash/_Map.js
6995
7061
  var require_Map = __commonJS({
6996
7062
  "../../node_modules/lodash/_Map.js"(exports, module) {
7063
+ init_cjs_shim();
6997
7064
  var getNative = require_getNative();
6998
7065
  var root = require_root();
6999
7066
  var Map2 = getNative(root, "Map");
@@ -7004,6 +7071,7 @@ var require_Map = __commonJS({
7004
7071
  // ../../node_modules/lodash/_nativeCreate.js
7005
7072
  var require_nativeCreate = __commonJS({
7006
7073
  "../../node_modules/lodash/_nativeCreate.js"(exports, module) {
7074
+ init_cjs_shim();
7007
7075
  var getNative = require_getNative();
7008
7076
  var nativeCreate = getNative(Object, "create");
7009
7077
  module.exports = nativeCreate;
@@ -7013,6 +7081,7 @@ var require_nativeCreate = __commonJS({
7013
7081
  // ../../node_modules/lodash/_hashClear.js
7014
7082
  var require_hashClear = __commonJS({
7015
7083
  "../../node_modules/lodash/_hashClear.js"(exports, module) {
7084
+ init_cjs_shim();
7016
7085
  var nativeCreate = require_nativeCreate();
7017
7086
  function hashClear() {
7018
7087
  this.__data__ = nativeCreate ? nativeCreate(null) : {};
@@ -7025,6 +7094,7 @@ var require_hashClear = __commonJS({
7025
7094
  // ../../node_modules/lodash/_hashDelete.js
7026
7095
  var require_hashDelete = __commonJS({
7027
7096
  "../../node_modules/lodash/_hashDelete.js"(exports, module) {
7097
+ init_cjs_shim();
7028
7098
  function hashDelete(key) {
7029
7099
  var result = this.has(key) && delete this.__data__[key];
7030
7100
  this.size -= result ? 1 : 0;
@@ -7037,6 +7107,7 @@ var require_hashDelete = __commonJS({
7037
7107
  // ../../node_modules/lodash/_hashGet.js
7038
7108
  var require_hashGet = __commonJS({
7039
7109
  "../../node_modules/lodash/_hashGet.js"(exports, module) {
7110
+ init_cjs_shim();
7040
7111
  var nativeCreate = require_nativeCreate();
7041
7112
  var HASH_UNDEFINED = "__lodash_hash_undefined__";
7042
7113
  var objectProto = Object.prototype;
@@ -7056,6 +7127,7 @@ var require_hashGet = __commonJS({
7056
7127
  // ../../node_modules/lodash/_hashHas.js
7057
7128
  var require_hashHas = __commonJS({
7058
7129
  "../../node_modules/lodash/_hashHas.js"(exports, module) {
7130
+ init_cjs_shim();
7059
7131
  var nativeCreate = require_nativeCreate();
7060
7132
  var objectProto = Object.prototype;
7061
7133
  var hasOwnProperty = objectProto.hasOwnProperty;
@@ -7070,6 +7142,7 @@ var require_hashHas = __commonJS({
7070
7142
  // ../../node_modules/lodash/_hashSet.js
7071
7143
  var require_hashSet = __commonJS({
7072
7144
  "../../node_modules/lodash/_hashSet.js"(exports, module) {
7145
+ init_cjs_shim();
7073
7146
  var nativeCreate = require_nativeCreate();
7074
7147
  var HASH_UNDEFINED = "__lodash_hash_undefined__";
7075
7148
  function hashSet(key, value) {
@@ -7085,6 +7158,7 @@ var require_hashSet = __commonJS({
7085
7158
  // ../../node_modules/lodash/_Hash.js
7086
7159
  var require_Hash = __commonJS({
7087
7160
  "../../node_modules/lodash/_Hash.js"(exports, module) {
7161
+ init_cjs_shim();
7088
7162
  var hashClear = require_hashClear();
7089
7163
  var hashDelete = require_hashDelete();
7090
7164
  var hashGet = require_hashGet();
@@ -7110,6 +7184,7 @@ var require_Hash = __commonJS({
7110
7184
  // ../../node_modules/lodash/_mapCacheClear.js
7111
7185
  var require_mapCacheClear = __commonJS({
7112
7186
  "../../node_modules/lodash/_mapCacheClear.js"(exports, module) {
7187
+ init_cjs_shim();
7113
7188
  var Hash = require_Hash();
7114
7189
  var ListCache = require_ListCache();
7115
7190
  var Map2 = require_Map();
@@ -7128,6 +7203,7 @@ var require_mapCacheClear = __commonJS({
7128
7203
  // ../../node_modules/lodash/_isKeyable.js
7129
7204
  var require_isKeyable = __commonJS({
7130
7205
  "../../node_modules/lodash/_isKeyable.js"(exports, module) {
7206
+ init_cjs_shim();
7131
7207
  function isKeyable(value) {
7132
7208
  var type = typeof value;
7133
7209
  return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
@@ -7139,6 +7215,7 @@ var require_isKeyable = __commonJS({
7139
7215
  // ../../node_modules/lodash/_getMapData.js
7140
7216
  var require_getMapData = __commonJS({
7141
7217
  "../../node_modules/lodash/_getMapData.js"(exports, module) {
7218
+ init_cjs_shim();
7142
7219
  var isKeyable = require_isKeyable();
7143
7220
  function getMapData(map, key) {
7144
7221
  var data = map.__data__;
@@ -7151,6 +7228,7 @@ var require_getMapData = __commonJS({
7151
7228
  // ../../node_modules/lodash/_mapCacheDelete.js
7152
7229
  var require_mapCacheDelete = __commonJS({
7153
7230
  "../../node_modules/lodash/_mapCacheDelete.js"(exports, module) {
7231
+ init_cjs_shim();
7154
7232
  var getMapData = require_getMapData();
7155
7233
  function mapCacheDelete(key) {
7156
7234
  var result = getMapData(this, key)["delete"](key);
@@ -7164,6 +7242,7 @@ var require_mapCacheDelete = __commonJS({
7164
7242
  // ../../node_modules/lodash/_mapCacheGet.js
7165
7243
  var require_mapCacheGet = __commonJS({
7166
7244
  "../../node_modules/lodash/_mapCacheGet.js"(exports, module) {
7245
+ init_cjs_shim();
7167
7246
  var getMapData = require_getMapData();
7168
7247
  function mapCacheGet(key) {
7169
7248
  return getMapData(this, key).get(key);
@@ -7175,6 +7254,7 @@ var require_mapCacheGet = __commonJS({
7175
7254
  // ../../node_modules/lodash/_mapCacheHas.js
7176
7255
  var require_mapCacheHas = __commonJS({
7177
7256
  "../../node_modules/lodash/_mapCacheHas.js"(exports, module) {
7257
+ init_cjs_shim();
7178
7258
  var getMapData = require_getMapData();
7179
7259
  function mapCacheHas(key) {
7180
7260
  return getMapData(this, key).has(key);
@@ -7186,6 +7266,7 @@ var require_mapCacheHas = __commonJS({
7186
7266
  // ../../node_modules/lodash/_mapCacheSet.js
7187
7267
  var require_mapCacheSet = __commonJS({
7188
7268
  "../../node_modules/lodash/_mapCacheSet.js"(exports, module) {
7269
+ init_cjs_shim();
7189
7270
  var getMapData = require_getMapData();
7190
7271
  function mapCacheSet(key, value) {
7191
7272
  var data = getMapData(this, key), size = data.size;
@@ -7200,6 +7281,7 @@ var require_mapCacheSet = __commonJS({
7200
7281
  // ../../node_modules/lodash/_MapCache.js
7201
7282
  var require_MapCache = __commonJS({
7202
7283
  "../../node_modules/lodash/_MapCache.js"(exports, module) {
7284
+ init_cjs_shim();
7203
7285
  var mapCacheClear = require_mapCacheClear();
7204
7286
  var mapCacheDelete = require_mapCacheDelete();
7205
7287
  var mapCacheGet = require_mapCacheGet();
@@ -7225,6 +7307,7 @@ var require_MapCache = __commonJS({
7225
7307
  // ../../node_modules/lodash/_stackSet.js
7226
7308
  var require_stackSet = __commonJS({
7227
7309
  "../../node_modules/lodash/_stackSet.js"(exports, module) {
7310
+ init_cjs_shim();
7228
7311
  var ListCache = require_ListCache();
7229
7312
  var Map2 = require_Map();
7230
7313
  var MapCache = require_MapCache();
@@ -7251,6 +7334,7 @@ var require_stackSet = __commonJS({
7251
7334
  // ../../node_modules/lodash/_Stack.js
7252
7335
  var require_Stack = __commonJS({
7253
7336
  "../../node_modules/lodash/_Stack.js"(exports, module) {
7337
+ init_cjs_shim();
7254
7338
  var ListCache = require_ListCache();
7255
7339
  var stackClear = require_stackClear();
7256
7340
  var stackDelete = require_stackDelete();
@@ -7273,6 +7357,7 @@ var require_Stack = __commonJS({
7273
7357
  // ../../node_modules/lodash/_defineProperty.js
7274
7358
  var require_defineProperty = __commonJS({
7275
7359
  "../../node_modules/lodash/_defineProperty.js"(exports, module) {
7360
+ init_cjs_shim();
7276
7361
  var getNative = require_getNative();
7277
7362
  var defineProperty = function() {
7278
7363
  try {
@@ -7289,6 +7374,7 @@ var require_defineProperty = __commonJS({
7289
7374
  // ../../node_modules/lodash/_baseAssignValue.js
7290
7375
  var require_baseAssignValue = __commonJS({
7291
7376
  "../../node_modules/lodash/_baseAssignValue.js"(exports, module) {
7377
+ init_cjs_shim();
7292
7378
  var defineProperty = require_defineProperty();
7293
7379
  function baseAssignValue(object, key, value) {
7294
7380
  if (key == "__proto__" && defineProperty) {
@@ -7309,6 +7395,7 @@ var require_baseAssignValue = __commonJS({
7309
7395
  // ../../node_modules/lodash/_assignMergeValue.js
7310
7396
  var require_assignMergeValue = __commonJS({
7311
7397
  "../../node_modules/lodash/_assignMergeValue.js"(exports, module) {
7398
+ init_cjs_shim();
7312
7399
  var baseAssignValue = require_baseAssignValue();
7313
7400
  var eq2 = require_eq();
7314
7401
  function assignMergeValue(object, key, value) {
@@ -7323,6 +7410,7 @@ var require_assignMergeValue = __commonJS({
7323
7410
  // ../../node_modules/lodash/_createBaseFor.js
7324
7411
  var require_createBaseFor = __commonJS({
7325
7412
  "../../node_modules/lodash/_createBaseFor.js"(exports, module) {
7413
+ init_cjs_shim();
7326
7414
  function createBaseFor(fromRight) {
7327
7415
  return function(object, iteratee, keysFunc) {
7328
7416
  var index = -1, iterable = Object(object), props = keysFunc(object), length = props.length;
@@ -7342,6 +7430,7 @@ var require_createBaseFor = __commonJS({
7342
7430
  // ../../node_modules/lodash/_baseFor.js
7343
7431
  var require_baseFor = __commonJS({
7344
7432
  "../../node_modules/lodash/_baseFor.js"(exports, module) {
7433
+ init_cjs_shim();
7345
7434
  var createBaseFor = require_createBaseFor();
7346
7435
  var baseFor = createBaseFor();
7347
7436
  module.exports = baseFor;
@@ -7351,6 +7440,7 @@ var require_baseFor = __commonJS({
7351
7440
  // ../../node_modules/lodash/_cloneBuffer.js
7352
7441
  var require_cloneBuffer = __commonJS({
7353
7442
  "../../node_modules/lodash/_cloneBuffer.js"(exports, module) {
7443
+ init_cjs_shim();
7354
7444
  var root = require_root();
7355
7445
  var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
7356
7446
  var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
@@ -7372,6 +7462,7 @@ var require_cloneBuffer = __commonJS({
7372
7462
  // ../../node_modules/lodash/_Uint8Array.js
7373
7463
  var require_Uint8Array = __commonJS({
7374
7464
  "../../node_modules/lodash/_Uint8Array.js"(exports, module) {
7465
+ init_cjs_shim();
7375
7466
  var root = require_root();
7376
7467
  var Uint8Array2 = root.Uint8Array;
7377
7468
  module.exports = Uint8Array2;
@@ -7381,6 +7472,7 @@ var require_Uint8Array = __commonJS({
7381
7472
  // ../../node_modules/lodash/_cloneArrayBuffer.js
7382
7473
  var require_cloneArrayBuffer = __commonJS({
7383
7474
  "../../node_modules/lodash/_cloneArrayBuffer.js"(exports, module) {
7475
+ init_cjs_shim();
7384
7476
  var Uint8Array2 = require_Uint8Array();
7385
7477
  function cloneArrayBuffer(arrayBuffer) {
7386
7478
  var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
@@ -7394,6 +7486,7 @@ var require_cloneArrayBuffer = __commonJS({
7394
7486
  // ../../node_modules/lodash/_cloneTypedArray.js
7395
7487
  var require_cloneTypedArray = __commonJS({
7396
7488
  "../../node_modules/lodash/_cloneTypedArray.js"(exports, module) {
7489
+ init_cjs_shim();
7397
7490
  var cloneArrayBuffer = require_cloneArrayBuffer();
7398
7491
  function cloneTypedArray(typedArray, isDeep) {
7399
7492
  var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
@@ -7406,6 +7499,7 @@ var require_cloneTypedArray = __commonJS({
7406
7499
  // ../../node_modules/lodash/_copyArray.js
7407
7500
  var require_copyArray = __commonJS({
7408
7501
  "../../node_modules/lodash/_copyArray.js"(exports, module) {
7502
+ init_cjs_shim();
7409
7503
  function copyArray(source, array) {
7410
7504
  var index = -1, length = source.length;
7411
7505
  array || (array = Array(length));
@@ -7421,6 +7515,7 @@ var require_copyArray = __commonJS({
7421
7515
  // ../../node_modules/lodash/_baseCreate.js
7422
7516
  var require_baseCreate = __commonJS({
7423
7517
  "../../node_modules/lodash/_baseCreate.js"(exports, module) {
7518
+ init_cjs_shim();
7424
7519
  var isObject = require_isObject();
7425
7520
  var objectCreate = Object.create;
7426
7521
  var baseCreate = /* @__PURE__ */ function() {
@@ -7446,6 +7541,7 @@ var require_baseCreate = __commonJS({
7446
7541
  // ../../node_modules/lodash/_overArg.js
7447
7542
  var require_overArg = __commonJS({
7448
7543
  "../../node_modules/lodash/_overArg.js"(exports, module) {
7544
+ init_cjs_shim();
7449
7545
  function overArg(func, transform) {
7450
7546
  return function(arg) {
7451
7547
  return func(transform(arg));
@@ -7458,6 +7554,7 @@ var require_overArg = __commonJS({
7458
7554
  // ../../node_modules/lodash/_getPrototype.js
7459
7555
  var require_getPrototype = __commonJS({
7460
7556
  "../../node_modules/lodash/_getPrototype.js"(exports, module) {
7557
+ init_cjs_shim();
7461
7558
  var overArg = require_overArg();
7462
7559
  var getPrototype = overArg(Object.getPrototypeOf, Object);
7463
7560
  module.exports = getPrototype;
@@ -7467,6 +7564,7 @@ var require_getPrototype = __commonJS({
7467
7564
  // ../../node_modules/lodash/_isPrototype.js
7468
7565
  var require_isPrototype = __commonJS({
7469
7566
  "../../node_modules/lodash/_isPrototype.js"(exports, module) {
7567
+ init_cjs_shim();
7470
7568
  var objectProto = Object.prototype;
7471
7569
  function isPrototype(value) {
7472
7570
  var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
@@ -7479,6 +7577,7 @@ var require_isPrototype = __commonJS({
7479
7577
  // ../../node_modules/lodash/_initCloneObject.js
7480
7578
  var require_initCloneObject = __commonJS({
7481
7579
  "../../node_modules/lodash/_initCloneObject.js"(exports, module) {
7580
+ init_cjs_shim();
7482
7581
  var baseCreate = require_baseCreate();
7483
7582
  var getPrototype = require_getPrototype();
7484
7583
  var isPrototype = require_isPrototype();
@@ -7492,6 +7591,7 @@ var require_initCloneObject = __commonJS({
7492
7591
  // ../../node_modules/lodash/isObjectLike.js
7493
7592
  var require_isObjectLike = __commonJS({
7494
7593
  "../../node_modules/lodash/isObjectLike.js"(exports, module) {
7594
+ init_cjs_shim();
7495
7595
  function isObjectLike(value) {
7496
7596
  return value != null && typeof value == "object";
7497
7597
  }
@@ -7502,6 +7602,7 @@ var require_isObjectLike = __commonJS({
7502
7602
  // ../../node_modules/lodash/_baseIsArguments.js
7503
7603
  var require_baseIsArguments = __commonJS({
7504
7604
  "../../node_modules/lodash/_baseIsArguments.js"(exports, module) {
7605
+ init_cjs_shim();
7505
7606
  var baseGetTag = require_baseGetTag();
7506
7607
  var isObjectLike = require_isObjectLike();
7507
7608
  var argsTag = "[object Arguments]";
@@ -7515,6 +7616,7 @@ var require_baseIsArguments = __commonJS({
7515
7616
  // ../../node_modules/lodash/isArguments.js
7516
7617
  var require_isArguments = __commonJS({
7517
7618
  "../../node_modules/lodash/isArguments.js"(exports, module) {
7619
+ init_cjs_shim();
7518
7620
  var baseIsArguments = require_baseIsArguments();
7519
7621
  var isObjectLike = require_isObjectLike();
7520
7622
  var objectProto = Object.prototype;
@@ -7532,6 +7634,7 @@ var require_isArguments = __commonJS({
7532
7634
  // ../../node_modules/lodash/isArray.js
7533
7635
  var require_isArray = __commonJS({
7534
7636
  "../../node_modules/lodash/isArray.js"(exports, module) {
7637
+ init_cjs_shim();
7535
7638
  var isArray = Array.isArray;
7536
7639
  module.exports = isArray;
7537
7640
  }
@@ -7540,6 +7643,7 @@ var require_isArray = __commonJS({
7540
7643
  // ../../node_modules/lodash/isLength.js
7541
7644
  var require_isLength = __commonJS({
7542
7645
  "../../node_modules/lodash/isLength.js"(exports, module) {
7646
+ init_cjs_shim();
7543
7647
  var MAX_SAFE_INTEGER = 9007199254740991;
7544
7648
  function isLength(value) {
7545
7649
  return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
@@ -7551,6 +7655,7 @@ var require_isLength = __commonJS({
7551
7655
  // ../../node_modules/lodash/isArrayLike.js
7552
7656
  var require_isArrayLike = __commonJS({
7553
7657
  "../../node_modules/lodash/isArrayLike.js"(exports, module) {
7658
+ init_cjs_shim();
7554
7659
  var isFunction = require_isFunction();
7555
7660
  var isLength = require_isLength();
7556
7661
  function isArrayLike(value) {
@@ -7563,6 +7668,7 @@ var require_isArrayLike = __commonJS({
7563
7668
  // ../../node_modules/lodash/isArrayLikeObject.js
7564
7669
  var require_isArrayLikeObject = __commonJS({
7565
7670
  "../../node_modules/lodash/isArrayLikeObject.js"(exports, module) {
7671
+ init_cjs_shim();
7566
7672
  var isArrayLike = require_isArrayLike();
7567
7673
  var isObjectLike = require_isObjectLike();
7568
7674
  function isArrayLikeObject(value) {
@@ -7575,6 +7681,7 @@ var require_isArrayLikeObject = __commonJS({
7575
7681
  // ../../node_modules/lodash/stubFalse.js
7576
7682
  var require_stubFalse = __commonJS({
7577
7683
  "../../node_modules/lodash/stubFalse.js"(exports, module) {
7684
+ init_cjs_shim();
7578
7685
  function stubFalse() {
7579
7686
  return false;
7580
7687
  }
@@ -7585,6 +7692,7 @@ var require_stubFalse = __commonJS({
7585
7692
  // ../../node_modules/lodash/isBuffer.js
7586
7693
  var require_isBuffer = __commonJS({
7587
7694
  "../../node_modules/lodash/isBuffer.js"(exports, module) {
7695
+ init_cjs_shim();
7588
7696
  var root = require_root();
7589
7697
  var stubFalse = require_stubFalse();
7590
7698
  var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
@@ -7600,6 +7708,7 @@ var require_isBuffer = __commonJS({
7600
7708
  // ../../node_modules/lodash/isPlainObject.js
7601
7709
  var require_isPlainObject = __commonJS({
7602
7710
  "../../node_modules/lodash/isPlainObject.js"(exports, module) {
7711
+ init_cjs_shim();
7603
7712
  var baseGetTag = require_baseGetTag();
7604
7713
  var getPrototype = require_getPrototype();
7605
7714
  var isObjectLike = require_isObjectLike();
@@ -7627,6 +7736,7 @@ var require_isPlainObject = __commonJS({
7627
7736
  // ../../node_modules/lodash/_baseIsTypedArray.js
7628
7737
  var require_baseIsTypedArray = __commonJS({
7629
7738
  "../../node_modules/lodash/_baseIsTypedArray.js"(exports, module) {
7739
+ init_cjs_shim();
7630
7740
  var baseGetTag = require_baseGetTag();
7631
7741
  var isLength = require_isLength();
7632
7742
  var isObjectLike = require_isObjectLike();
@@ -7667,6 +7777,7 @@ var require_baseIsTypedArray = __commonJS({
7667
7777
  // ../../node_modules/lodash/_baseUnary.js
7668
7778
  var require_baseUnary = __commonJS({
7669
7779
  "../../node_modules/lodash/_baseUnary.js"(exports, module) {
7780
+ init_cjs_shim();
7670
7781
  function baseUnary(func) {
7671
7782
  return function(value) {
7672
7783
  return func(value);
@@ -7679,6 +7790,7 @@ var require_baseUnary = __commonJS({
7679
7790
  // ../../node_modules/lodash/_nodeUtil.js
7680
7791
  var require_nodeUtil = __commonJS({
7681
7792
  "../../node_modules/lodash/_nodeUtil.js"(exports, module) {
7793
+ init_cjs_shim();
7682
7794
  var freeGlobal = require_freeGlobal();
7683
7795
  var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
7684
7796
  var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
@@ -7701,6 +7813,7 @@ var require_nodeUtil = __commonJS({
7701
7813
  // ../../node_modules/lodash/isTypedArray.js
7702
7814
  var require_isTypedArray = __commonJS({
7703
7815
  "../../node_modules/lodash/isTypedArray.js"(exports, module) {
7816
+ init_cjs_shim();
7704
7817
  var baseIsTypedArray = require_baseIsTypedArray();
7705
7818
  var baseUnary = require_baseUnary();
7706
7819
  var nodeUtil = require_nodeUtil();
@@ -7713,6 +7826,7 @@ var require_isTypedArray = __commonJS({
7713
7826
  // ../../node_modules/lodash/_safeGet.js
7714
7827
  var require_safeGet = __commonJS({
7715
7828
  "../../node_modules/lodash/_safeGet.js"(exports, module) {
7829
+ init_cjs_shim();
7716
7830
  function safeGet(object, key) {
7717
7831
  if (key === "constructor" && typeof object[key] === "function") {
7718
7832
  return;
@@ -7729,6 +7843,7 @@ var require_safeGet = __commonJS({
7729
7843
  // ../../node_modules/lodash/_assignValue.js
7730
7844
  var require_assignValue = __commonJS({
7731
7845
  "../../node_modules/lodash/_assignValue.js"(exports, module) {
7846
+ init_cjs_shim();
7732
7847
  var baseAssignValue = require_baseAssignValue();
7733
7848
  var eq2 = require_eq();
7734
7849
  var objectProto = Object.prototype;
@@ -7746,6 +7861,7 @@ var require_assignValue = __commonJS({
7746
7861
  // ../../node_modules/lodash/_copyObject.js
7747
7862
  var require_copyObject = __commonJS({
7748
7863
  "../../node_modules/lodash/_copyObject.js"(exports, module) {
7864
+ init_cjs_shim();
7749
7865
  var assignValue = require_assignValue();
7750
7866
  var baseAssignValue = require_baseAssignValue();
7751
7867
  function copyObject(source, props, object, customizer) {
@@ -7773,6 +7889,7 @@ var require_copyObject = __commonJS({
7773
7889
  // ../../node_modules/lodash/_baseTimes.js
7774
7890
  var require_baseTimes = __commonJS({
7775
7891
  "../../node_modules/lodash/_baseTimes.js"(exports, module) {
7892
+ init_cjs_shim();
7776
7893
  function baseTimes(n, iteratee) {
7777
7894
  var index = -1, result = Array(n);
7778
7895
  while (++index < n) {
@@ -7787,6 +7904,7 @@ var require_baseTimes = __commonJS({
7787
7904
  // ../../node_modules/lodash/_isIndex.js
7788
7905
  var require_isIndex = __commonJS({
7789
7906
  "../../node_modules/lodash/_isIndex.js"(exports, module) {
7907
+ init_cjs_shim();
7790
7908
  var MAX_SAFE_INTEGER = 9007199254740991;
7791
7909
  var reIsUint = /^(?:0|[1-9]\d*)$/;
7792
7910
  function isIndex(value, length) {
@@ -7801,6 +7919,7 @@ var require_isIndex = __commonJS({
7801
7919
  // ../../node_modules/lodash/_arrayLikeKeys.js
7802
7920
  var require_arrayLikeKeys = __commonJS({
7803
7921
  "../../node_modules/lodash/_arrayLikeKeys.js"(exports, module) {
7922
+ init_cjs_shim();
7804
7923
  var baseTimes = require_baseTimes();
7805
7924
  var isArguments = require_isArguments();
7806
7925
  var isArray = require_isArray();
@@ -7829,6 +7948,7 @@ var require_arrayLikeKeys = __commonJS({
7829
7948
  // ../../node_modules/lodash/_nativeKeysIn.js
7830
7949
  var require_nativeKeysIn = __commonJS({
7831
7950
  "../../node_modules/lodash/_nativeKeysIn.js"(exports, module) {
7951
+ init_cjs_shim();
7832
7952
  function nativeKeysIn(object) {
7833
7953
  var result = [];
7834
7954
  if (object != null) {
@@ -7845,6 +7965,7 @@ var require_nativeKeysIn = __commonJS({
7845
7965
  // ../../node_modules/lodash/_baseKeysIn.js
7846
7966
  var require_baseKeysIn = __commonJS({
7847
7967
  "../../node_modules/lodash/_baseKeysIn.js"(exports, module) {
7968
+ init_cjs_shim();
7848
7969
  var isObject = require_isObject();
7849
7970
  var isPrototype = require_isPrototype();
7850
7971
  var nativeKeysIn = require_nativeKeysIn();
@@ -7869,6 +7990,7 @@ var require_baseKeysIn = __commonJS({
7869
7990
  // ../../node_modules/lodash/keysIn.js
7870
7991
  var require_keysIn = __commonJS({
7871
7992
  "../../node_modules/lodash/keysIn.js"(exports, module) {
7993
+ init_cjs_shim();
7872
7994
  var arrayLikeKeys = require_arrayLikeKeys();
7873
7995
  var baseKeysIn = require_baseKeysIn();
7874
7996
  var isArrayLike = require_isArrayLike();
@@ -7882,6 +8004,7 @@ var require_keysIn = __commonJS({
7882
8004
  // ../../node_modules/lodash/toPlainObject.js
7883
8005
  var require_toPlainObject = __commonJS({
7884
8006
  "../../node_modules/lodash/toPlainObject.js"(exports, module) {
8007
+ init_cjs_shim();
7885
8008
  var copyObject = require_copyObject();
7886
8009
  var keysIn = require_keysIn();
7887
8010
  function toPlainObject(value) {
@@ -7894,6 +8017,7 @@ var require_toPlainObject = __commonJS({
7894
8017
  // ../../node_modules/lodash/_baseMergeDeep.js
7895
8018
  var require_baseMergeDeep = __commonJS({
7896
8019
  "../../node_modules/lodash/_baseMergeDeep.js"(exports, module) {
8020
+ init_cjs_shim();
7897
8021
  var assignMergeValue = require_assignMergeValue();
7898
8022
  var cloneBuffer = require_cloneBuffer();
7899
8023
  var cloneTypedArray = require_cloneTypedArray();
@@ -7959,6 +8083,7 @@ var require_baseMergeDeep = __commonJS({
7959
8083
  // ../../node_modules/lodash/_baseMerge.js
7960
8084
  var require_baseMerge = __commonJS({
7961
8085
  "../../node_modules/lodash/_baseMerge.js"(exports, module) {
8086
+ init_cjs_shim();
7962
8087
  var Stack = require_Stack();
7963
8088
  var assignMergeValue = require_assignMergeValue();
7964
8089
  var baseFor = require_baseFor();
@@ -7990,6 +8115,7 @@ var require_baseMerge = __commonJS({
7990
8115
  // ../../node_modules/lodash/identity.js
7991
8116
  var require_identity = __commonJS({
7992
8117
  "../../node_modules/lodash/identity.js"(exports, module) {
8118
+ init_cjs_shim();
7993
8119
  function identity(value) {
7994
8120
  return value;
7995
8121
  }
@@ -8000,6 +8126,7 @@ var require_identity = __commonJS({
8000
8126
  // ../../node_modules/lodash/_apply.js
8001
8127
  var require_apply = __commonJS({
8002
8128
  "../../node_modules/lodash/_apply.js"(exports, module) {
8129
+ init_cjs_shim();
8003
8130
  function apply(func, thisArg, args) {
8004
8131
  switch (args.length) {
8005
8132
  case 0:
@@ -8020,6 +8147,7 @@ var require_apply = __commonJS({
8020
8147
  // ../../node_modules/lodash/_overRest.js
8021
8148
  var require_overRest = __commonJS({
8022
8149
  "../../node_modules/lodash/_overRest.js"(exports, module) {
8150
+ init_cjs_shim();
8023
8151
  var apply = require_apply();
8024
8152
  var nativeMax = Math.max;
8025
8153
  function overRest(func, start, transform) {
@@ -8045,6 +8173,7 @@ var require_overRest = __commonJS({
8045
8173
  // ../../node_modules/lodash/constant.js
8046
8174
  var require_constant = __commonJS({
8047
8175
  "../../node_modules/lodash/constant.js"(exports, module) {
8176
+ init_cjs_shim();
8048
8177
  function constant(value) {
8049
8178
  return function() {
8050
8179
  return value;
@@ -8057,6 +8186,7 @@ var require_constant = __commonJS({
8057
8186
  // ../../node_modules/lodash/_baseSetToString.js
8058
8187
  var require_baseSetToString = __commonJS({
8059
8188
  "../../node_modules/lodash/_baseSetToString.js"(exports, module) {
8189
+ init_cjs_shim();
8060
8190
  var constant = require_constant();
8061
8191
  var defineProperty = require_defineProperty();
8062
8192
  var identity = require_identity();
@@ -8075,6 +8205,7 @@ var require_baseSetToString = __commonJS({
8075
8205
  // ../../node_modules/lodash/_shortOut.js
8076
8206
  var require_shortOut = __commonJS({
8077
8207
  "../../node_modules/lodash/_shortOut.js"(exports, module) {
8208
+ init_cjs_shim();
8078
8209
  var HOT_COUNT = 800;
8079
8210
  var HOT_SPAN = 16;
8080
8211
  var nativeNow = Date.now;
@@ -8100,6 +8231,7 @@ var require_shortOut = __commonJS({
8100
8231
  // ../../node_modules/lodash/_setToString.js
8101
8232
  var require_setToString = __commonJS({
8102
8233
  "../../node_modules/lodash/_setToString.js"(exports, module) {
8234
+ init_cjs_shim();
8103
8235
  var baseSetToString = require_baseSetToString();
8104
8236
  var shortOut = require_shortOut();
8105
8237
  var setToString = shortOut(baseSetToString);
@@ -8110,6 +8242,7 @@ var require_setToString = __commonJS({
8110
8242
  // ../../node_modules/lodash/_baseRest.js
8111
8243
  var require_baseRest = __commonJS({
8112
8244
  "../../node_modules/lodash/_baseRest.js"(exports, module) {
8245
+ init_cjs_shim();
8113
8246
  var identity = require_identity();
8114
8247
  var overRest = require_overRest();
8115
8248
  var setToString = require_setToString();
@@ -8123,6 +8256,7 @@ var require_baseRest = __commonJS({
8123
8256
  // ../../node_modules/lodash/_isIterateeCall.js
8124
8257
  var require_isIterateeCall = __commonJS({
8125
8258
  "../../node_modules/lodash/_isIterateeCall.js"(exports, module) {
8259
+ init_cjs_shim();
8126
8260
  var eq2 = require_eq();
8127
8261
  var isArrayLike = require_isArrayLike();
8128
8262
  var isIndex = require_isIndex();
@@ -8144,6 +8278,7 @@ var require_isIterateeCall = __commonJS({
8144
8278
  // ../../node_modules/lodash/_createAssigner.js
8145
8279
  var require_createAssigner = __commonJS({
8146
8280
  "../../node_modules/lodash/_createAssigner.js"(exports, module) {
8281
+ init_cjs_shim();
8147
8282
  var baseRest = require_baseRest();
8148
8283
  var isIterateeCall = require_isIterateeCall();
8149
8284
  function createAssigner(assigner) {
@@ -8171,6 +8306,7 @@ var require_createAssigner = __commonJS({
8171
8306
  // ../../node_modules/lodash/merge.js
8172
8307
  var require_merge = __commonJS({
8173
8308
  "../../node_modules/lodash/merge.js"(exports, module) {
8309
+ init_cjs_shim();
8174
8310
  var baseMerge = require_baseMerge();
8175
8311
  var createAssigner = require_createAssigner();
8176
8312
  var merge2 = createAssigner(function(object, source, srcIndex) {
@@ -8183,6 +8319,7 @@ var require_merge = __commonJS({
8183
8319
  // ../../node_modules/safe-buffer/index.js
8184
8320
  var require_safe_buffer = __commonJS({
8185
8321
  "../../node_modules/safe-buffer/index.js"(exports, module) {
8322
+ init_cjs_shim();
8186
8323
  var buffer = __require("buffer");
8187
8324
  var Buffer2 = buffer.Buffer;
8188
8325
  function copyProps(src, dst) {
@@ -8241,6 +8378,7 @@ var require_safe_buffer = __commonJS({
8241
8378
  // ../../node_modules/jws/lib/data-stream.js
8242
8379
  var require_data_stream = __commonJS({
8243
8380
  "../../node_modules/jws/lib/data-stream.js"(exports, module) {
8381
+ init_cjs_shim();
8244
8382
  var Buffer2 = require_safe_buffer().Buffer;
8245
8383
  var Stream = __require("stream");
8246
8384
  var util = __require("util");
@@ -8290,6 +8428,7 @@ var require_data_stream = __commonJS({
8290
8428
  var require_buffer_equal_constant_time = __commonJS({
8291
8429
  "../../node_modules/buffer-equal-constant-time/index.js"(exports, module) {
8292
8430
  "use strict";
8431
+ init_cjs_shim();
8293
8432
  var Buffer2 = __require("buffer").Buffer;
8294
8433
  var SlowBuffer = __require("buffer").SlowBuffer;
8295
8434
  module.exports = bufferEq;
@@ -8324,6 +8463,7 @@ var require_buffer_equal_constant_time = __commonJS({
8324
8463
  var require_param_bytes_for_alg = __commonJS({
8325
8464
  "../../node_modules/ecdsa-sig-formatter/src/param-bytes-for-alg.js"(exports, module) {
8326
8465
  "use strict";
8466
+ init_cjs_shim();
8327
8467
  function getParamSize(keySize) {
8328
8468
  var result = (keySize / 8 | 0) + (keySize % 8 === 0 ? 0 : 1);
8329
8469
  return result;
@@ -8348,6 +8488,7 @@ var require_param_bytes_for_alg = __commonJS({
8348
8488
  var require_ecdsa_sig_formatter = __commonJS({
8349
8489
  "../../node_modules/ecdsa-sig-formatter/src/ecdsa-sig-formatter.js"(exports, module) {
8350
8490
  "use strict";
8491
+ init_cjs_shim();
8351
8492
  var Buffer2 = require_safe_buffer().Buffer;
8352
8493
  var getParamBytesForAlg = require_param_bytes_for_alg();
8353
8494
  var MAX_OCTET = 128;
@@ -8487,6 +8628,7 @@ var require_ecdsa_sig_formatter = __commonJS({
8487
8628
  // ../../node_modules/jwa/index.js
8488
8629
  var require_jwa = __commonJS({
8489
8630
  "../../node_modules/jwa/index.js"(exports, module) {
8631
+ init_cjs_shim();
8490
8632
  var bufferEqual = require_buffer_equal_constant_time();
8491
8633
  var Buffer2 = require_safe_buffer().Buffer;
8492
8634
  var crypto = __require("crypto");
@@ -8700,6 +8842,7 @@ var require_jwa = __commonJS({
8700
8842
  // ../../node_modules/jws/lib/tostring.js
8701
8843
  var require_tostring = __commonJS({
8702
8844
  "../../node_modules/jws/lib/tostring.js"(exports, module) {
8845
+ init_cjs_shim();
8703
8846
  var Buffer2 = __require("buffer").Buffer;
8704
8847
  module.exports = function toString(obj) {
8705
8848
  if (typeof obj === "string")
@@ -8714,6 +8857,7 @@ var require_tostring = __commonJS({
8714
8857
  // ../../node_modules/jws/lib/sign-stream.js
8715
8858
  var require_sign_stream = __commonJS({
8716
8859
  "../../node_modules/jws/lib/sign-stream.js"(exports, module) {
8860
+ init_cjs_shim();
8717
8861
  var Buffer2 = require_safe_buffer().Buffer;
8718
8862
  var DataStream = require_data_stream();
8719
8863
  var jwa = require_jwa();
@@ -8784,6 +8928,7 @@ var require_sign_stream = __commonJS({
8784
8928
  // ../../node_modules/jws/lib/verify-stream.js
8785
8929
  var require_verify_stream = __commonJS({
8786
8930
  "../../node_modules/jws/lib/verify-stream.js"(exports, module) {
8931
+ init_cjs_shim();
8787
8932
  var Buffer2 = require_safe_buffer().Buffer;
8788
8933
  var DataStream = require_data_stream();
8789
8934
  var jwa = require_jwa();
@@ -8894,6 +9039,7 @@ var require_verify_stream = __commonJS({
8894
9039
  // ../../node_modules/jws/index.js
8895
9040
  var require_jws = __commonJS({
8896
9041
  "../../node_modules/jws/index.js"(exports) {
9042
+ init_cjs_shim();
8897
9043
  var SignStream = require_sign_stream();
8898
9044
  var VerifyStream = require_verify_stream();
8899
9045
  var ALGORITHMS = [
@@ -8927,6 +9073,7 @@ var require_jws = __commonJS({
8927
9073
  // ../../magda-typescript-common/node_modules/jsonwebtoken/decode.js
8928
9074
  var require_decode = __commonJS({
8929
9075
  "../../magda-typescript-common/node_modules/jsonwebtoken/decode.js"(exports, module) {
9076
+ init_cjs_shim();
8930
9077
  var jws = require_jws();
8931
9078
  module.exports = function(jwt2, options) {
8932
9079
  options = options || {};
@@ -8959,6 +9106,7 @@ var require_decode = __commonJS({
8959
9106
  // ../../magda-typescript-common/node_modules/jsonwebtoken/lib/JsonWebTokenError.js
8960
9107
  var require_JsonWebTokenError = __commonJS({
8961
9108
  "../../magda-typescript-common/node_modules/jsonwebtoken/lib/JsonWebTokenError.js"(exports, module) {
9109
+ init_cjs_shim();
8962
9110
  var JsonWebTokenError = function(message, error) {
8963
9111
  Error.call(this, message);
8964
9112
  if (Error.captureStackTrace) {
@@ -8978,6 +9126,7 @@ var require_JsonWebTokenError = __commonJS({
8978
9126
  // ../../magda-typescript-common/node_modules/jsonwebtoken/lib/NotBeforeError.js
8979
9127
  var require_NotBeforeError = __commonJS({
8980
9128
  "../../magda-typescript-common/node_modules/jsonwebtoken/lib/NotBeforeError.js"(exports, module) {
9129
+ init_cjs_shim();
8981
9130
  var JsonWebTokenError = require_JsonWebTokenError();
8982
9131
  var NotBeforeError = function(message, date) {
8983
9132
  JsonWebTokenError.call(this, message);
@@ -8993,6 +9142,7 @@ var require_NotBeforeError = __commonJS({
8993
9142
  // ../../magda-typescript-common/node_modules/jsonwebtoken/lib/TokenExpiredError.js
8994
9143
  var require_TokenExpiredError = __commonJS({
8995
9144
  "../../magda-typescript-common/node_modules/jsonwebtoken/lib/TokenExpiredError.js"(exports, module) {
9145
+ init_cjs_shim();
8996
9146
  var JsonWebTokenError = require_JsonWebTokenError();
8997
9147
  var TokenExpiredError = function(message, expiredAt) {
8998
9148
  JsonWebTokenError.call(this, message);
@@ -9008,6 +9158,7 @@ var require_TokenExpiredError = __commonJS({
9008
9158
  // ../../node_modules/ms/index.js
9009
9159
  var require_ms = __commonJS({
9010
9160
  "../../node_modules/ms/index.js"(exports, module) {
9161
+ init_cjs_shim();
9011
9162
  var s = 1e3;
9012
9163
  var m = s * 60;
9013
9164
  var h = m * 60;
@@ -9124,6 +9275,7 @@ var require_ms = __commonJS({
9124
9275
  // ../../magda-typescript-common/node_modules/jsonwebtoken/lib/timespan.js
9125
9276
  var require_timespan = __commonJS({
9126
9277
  "../../magda-typescript-common/node_modules/jsonwebtoken/lib/timespan.js"(exports, module) {
9278
+ init_cjs_shim();
9127
9279
  var ms = require_ms();
9128
9280
  module.exports = function(time, iat) {
9129
9281
  var timestamp = iat || Math.floor(Date.now() / 1e3);
@@ -9145,6 +9297,7 @@ var require_timespan = __commonJS({
9145
9297
  // ../../magda-typescript-common/node_modules/semver/internal/constants.js
9146
9298
  var require_constants = __commonJS({
9147
9299
  "../../magda-typescript-common/node_modules/semver/internal/constants.js"(exports, module) {
9300
+ init_cjs_shim();
9148
9301
  var SEMVER_SPEC_VERSION = "2.0.0";
9149
9302
  var MAX_LENGTH = 256;
9150
9303
  var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
@@ -9176,6 +9329,7 @@ var require_constants = __commonJS({
9176
9329
  // ../../magda-typescript-common/node_modules/semver/internal/debug.js
9177
9330
  var require_debug = __commonJS({
9178
9331
  "../../magda-typescript-common/node_modules/semver/internal/debug.js"(exports, module) {
9332
+ init_cjs_shim();
9179
9333
  var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
9180
9334
  };
9181
9335
  module.exports = debug;
@@ -9185,6 +9339,7 @@ var require_debug = __commonJS({
9185
9339
  // ../../magda-typescript-common/node_modules/semver/internal/re.js
9186
9340
  var require_re = __commonJS({
9187
9341
  "../../magda-typescript-common/node_modules/semver/internal/re.js"(exports, module) {
9342
+ init_cjs_shim();
9188
9343
  var {
9189
9344
  MAX_SAFE_COMPONENT_LENGTH,
9190
9345
  MAX_SAFE_BUILD_LENGTH,
@@ -9267,6 +9422,7 @@ var require_re = __commonJS({
9267
9422
  // ../../magda-typescript-common/node_modules/semver/internal/parse-options.js
9268
9423
  var require_parse_options = __commonJS({
9269
9424
  "../../magda-typescript-common/node_modules/semver/internal/parse-options.js"(exports, module) {
9425
+ init_cjs_shim();
9270
9426
  var looseOption = Object.freeze({ loose: true });
9271
9427
  var emptyOpts = Object.freeze({});
9272
9428
  var parseOptions = (options) => {
@@ -9285,6 +9441,7 @@ var require_parse_options = __commonJS({
9285
9441
  // ../../magda-typescript-common/node_modules/semver/internal/identifiers.js
9286
9442
  var require_identifiers = __commonJS({
9287
9443
  "../../magda-typescript-common/node_modules/semver/internal/identifiers.js"(exports, module) {
9444
+ init_cjs_shim();
9288
9445
  var numeric = /^[0-9]+$/;
9289
9446
  var compareIdentifiers = (a, b) => {
9290
9447
  const anum = numeric.test(a);
@@ -9306,6 +9463,7 @@ var require_identifiers = __commonJS({
9306
9463
  // ../../magda-typescript-common/node_modules/semver/classes/semver.js
9307
9464
  var require_semver = __commonJS({
9308
9465
  "../../magda-typescript-common/node_modules/semver/classes/semver.js"(exports, module) {
9466
+ init_cjs_shim();
9309
9467
  var debug = require_debug();
9310
9468
  var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
9311
9469
  var { safeRe: re, t } = require_re();
@@ -9548,6 +9706,7 @@ var require_semver = __commonJS({
9548
9706
  // ../../magda-typescript-common/node_modules/semver/functions/parse.js
9549
9707
  var require_parse = __commonJS({
9550
9708
  "../../magda-typescript-common/node_modules/semver/functions/parse.js"(exports, module) {
9709
+ init_cjs_shim();
9551
9710
  var SemVer = require_semver();
9552
9711
  var parse = (version, options, throwErrors = false) => {
9553
9712
  if (version instanceof SemVer) {
@@ -9569,6 +9728,7 @@ var require_parse = __commonJS({
9569
9728
  // ../../magda-typescript-common/node_modules/semver/functions/valid.js
9570
9729
  var require_valid = __commonJS({
9571
9730
  "../../magda-typescript-common/node_modules/semver/functions/valid.js"(exports, module) {
9731
+ init_cjs_shim();
9572
9732
  var parse = require_parse();
9573
9733
  var valid = (version, options) => {
9574
9734
  const v = parse(version, options);
@@ -9581,6 +9741,7 @@ var require_valid = __commonJS({
9581
9741
  // ../../magda-typescript-common/node_modules/semver/functions/clean.js
9582
9742
  var require_clean = __commonJS({
9583
9743
  "../../magda-typescript-common/node_modules/semver/functions/clean.js"(exports, module) {
9744
+ init_cjs_shim();
9584
9745
  var parse = require_parse();
9585
9746
  var clean = (version, options) => {
9586
9747
  const s = parse(version.trim().replace(/^[=v]+/, ""), options);
@@ -9593,6 +9754,7 @@ var require_clean = __commonJS({
9593
9754
  // ../../magda-typescript-common/node_modules/semver/functions/inc.js
9594
9755
  var require_inc = __commonJS({
9595
9756
  "../../magda-typescript-common/node_modules/semver/functions/inc.js"(exports, module) {
9757
+ init_cjs_shim();
9596
9758
  var SemVer = require_semver();
9597
9759
  var inc = (version, release, options, identifier, identifierBase) => {
9598
9760
  if (typeof options === "string") {
@@ -9616,6 +9778,7 @@ var require_inc = __commonJS({
9616
9778
  // ../../magda-typescript-common/node_modules/semver/functions/diff.js
9617
9779
  var require_diff = __commonJS({
9618
9780
  "../../magda-typescript-common/node_modules/semver/functions/diff.js"(exports, module) {
9781
+ init_cjs_shim();
9619
9782
  var parse = require_parse();
9620
9783
  var diff = (version1, version2) => {
9621
9784
  const v1 = parse(version1, null, true);
@@ -9660,6 +9823,7 @@ var require_diff = __commonJS({
9660
9823
  // ../../magda-typescript-common/node_modules/semver/functions/major.js
9661
9824
  var require_major = __commonJS({
9662
9825
  "../../magda-typescript-common/node_modules/semver/functions/major.js"(exports, module) {
9826
+ init_cjs_shim();
9663
9827
  var SemVer = require_semver();
9664
9828
  var major = (a, loose) => new SemVer(a, loose).major;
9665
9829
  module.exports = major;
@@ -9669,6 +9833,7 @@ var require_major = __commonJS({
9669
9833
  // ../../magda-typescript-common/node_modules/semver/functions/minor.js
9670
9834
  var require_minor = __commonJS({
9671
9835
  "../../magda-typescript-common/node_modules/semver/functions/minor.js"(exports, module) {
9836
+ init_cjs_shim();
9672
9837
  var SemVer = require_semver();
9673
9838
  var minor = (a, loose) => new SemVer(a, loose).minor;
9674
9839
  module.exports = minor;
@@ -9678,6 +9843,7 @@ var require_minor = __commonJS({
9678
9843
  // ../../magda-typescript-common/node_modules/semver/functions/patch.js
9679
9844
  var require_patch = __commonJS({
9680
9845
  "../../magda-typescript-common/node_modules/semver/functions/patch.js"(exports, module) {
9846
+ init_cjs_shim();
9681
9847
  var SemVer = require_semver();
9682
9848
  var patch = (a, loose) => new SemVer(a, loose).patch;
9683
9849
  module.exports = patch;
@@ -9687,6 +9853,7 @@ var require_patch = __commonJS({
9687
9853
  // ../../magda-typescript-common/node_modules/semver/functions/prerelease.js
9688
9854
  var require_prerelease = __commonJS({
9689
9855
  "../../magda-typescript-common/node_modules/semver/functions/prerelease.js"(exports, module) {
9856
+ init_cjs_shim();
9690
9857
  var parse = require_parse();
9691
9858
  var prerelease = (version, options) => {
9692
9859
  const parsed = parse(version, options);
@@ -9699,6 +9866,7 @@ var require_prerelease = __commonJS({
9699
9866
  // ../../magda-typescript-common/node_modules/semver/functions/compare.js
9700
9867
  var require_compare = __commonJS({
9701
9868
  "../../magda-typescript-common/node_modules/semver/functions/compare.js"(exports, module) {
9869
+ init_cjs_shim();
9702
9870
  var SemVer = require_semver();
9703
9871
  var compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
9704
9872
  module.exports = compare;
@@ -9708,6 +9876,7 @@ var require_compare = __commonJS({
9708
9876
  // ../../magda-typescript-common/node_modules/semver/functions/rcompare.js
9709
9877
  var require_rcompare = __commonJS({
9710
9878
  "../../magda-typescript-common/node_modules/semver/functions/rcompare.js"(exports, module) {
9879
+ init_cjs_shim();
9711
9880
  var compare = require_compare();
9712
9881
  var rcompare = (a, b, loose) => compare(b, a, loose);
9713
9882
  module.exports = rcompare;
@@ -9717,6 +9886,7 @@ var require_rcompare = __commonJS({
9717
9886
  // ../../magda-typescript-common/node_modules/semver/functions/compare-loose.js
9718
9887
  var require_compare_loose = __commonJS({
9719
9888
  "../../magda-typescript-common/node_modules/semver/functions/compare-loose.js"(exports, module) {
9889
+ init_cjs_shim();
9720
9890
  var compare = require_compare();
9721
9891
  var compareLoose = (a, b) => compare(a, b, true);
9722
9892
  module.exports = compareLoose;
@@ -9726,6 +9896,7 @@ var require_compare_loose = __commonJS({
9726
9896
  // ../../magda-typescript-common/node_modules/semver/functions/compare-build.js
9727
9897
  var require_compare_build = __commonJS({
9728
9898
  "../../magda-typescript-common/node_modules/semver/functions/compare-build.js"(exports, module) {
9899
+ init_cjs_shim();
9729
9900
  var SemVer = require_semver();
9730
9901
  var compareBuild = (a, b, loose) => {
9731
9902
  const versionA = new SemVer(a, loose);
@@ -9739,6 +9910,7 @@ var require_compare_build = __commonJS({
9739
9910
  // ../../magda-typescript-common/node_modules/semver/functions/sort.js
9740
9911
  var require_sort = __commonJS({
9741
9912
  "../../magda-typescript-common/node_modules/semver/functions/sort.js"(exports, module) {
9913
+ init_cjs_shim();
9742
9914
  var compareBuild = require_compare_build();
9743
9915
  var sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
9744
9916
  module.exports = sort;
@@ -9748,6 +9920,7 @@ var require_sort = __commonJS({
9748
9920
  // ../../magda-typescript-common/node_modules/semver/functions/rsort.js
9749
9921
  var require_rsort = __commonJS({
9750
9922
  "../../magda-typescript-common/node_modules/semver/functions/rsort.js"(exports, module) {
9923
+ init_cjs_shim();
9751
9924
  var compareBuild = require_compare_build();
9752
9925
  var rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
9753
9926
  module.exports = rsort;
@@ -9757,6 +9930,7 @@ var require_rsort = __commonJS({
9757
9930
  // ../../magda-typescript-common/node_modules/semver/functions/gt.js
9758
9931
  var require_gt = __commonJS({
9759
9932
  "../../magda-typescript-common/node_modules/semver/functions/gt.js"(exports, module) {
9933
+ init_cjs_shim();
9760
9934
  var compare = require_compare();
9761
9935
  var gt = (a, b, loose) => compare(a, b, loose) > 0;
9762
9936
  module.exports = gt;
@@ -9766,6 +9940,7 @@ var require_gt = __commonJS({
9766
9940
  // ../../magda-typescript-common/node_modules/semver/functions/lt.js
9767
9941
  var require_lt = __commonJS({
9768
9942
  "../../magda-typescript-common/node_modules/semver/functions/lt.js"(exports, module) {
9943
+ init_cjs_shim();
9769
9944
  var compare = require_compare();
9770
9945
  var lt = (a, b, loose) => compare(a, b, loose) < 0;
9771
9946
  module.exports = lt;
@@ -9775,6 +9950,7 @@ var require_lt = __commonJS({
9775
9950
  // ../../magda-typescript-common/node_modules/semver/functions/eq.js
9776
9951
  var require_eq2 = __commonJS({
9777
9952
  "../../magda-typescript-common/node_modules/semver/functions/eq.js"(exports, module) {
9953
+ init_cjs_shim();
9778
9954
  var compare = require_compare();
9779
9955
  var eq2 = (a, b, loose) => compare(a, b, loose) === 0;
9780
9956
  module.exports = eq2;
@@ -9784,6 +9960,7 @@ var require_eq2 = __commonJS({
9784
9960
  // ../../magda-typescript-common/node_modules/semver/functions/neq.js
9785
9961
  var require_neq = __commonJS({
9786
9962
  "../../magda-typescript-common/node_modules/semver/functions/neq.js"(exports, module) {
9963
+ init_cjs_shim();
9787
9964
  var compare = require_compare();
9788
9965
  var neq = (a, b, loose) => compare(a, b, loose) !== 0;
9789
9966
  module.exports = neq;
@@ -9793,6 +9970,7 @@ var require_neq = __commonJS({
9793
9970
  // ../../magda-typescript-common/node_modules/semver/functions/gte.js
9794
9971
  var require_gte = __commonJS({
9795
9972
  "../../magda-typescript-common/node_modules/semver/functions/gte.js"(exports, module) {
9973
+ init_cjs_shim();
9796
9974
  var compare = require_compare();
9797
9975
  var gte = (a, b, loose) => compare(a, b, loose) >= 0;
9798
9976
  module.exports = gte;
@@ -9802,6 +9980,7 @@ var require_gte = __commonJS({
9802
9980
  // ../../magda-typescript-common/node_modules/semver/functions/lte.js
9803
9981
  var require_lte = __commonJS({
9804
9982
  "../../magda-typescript-common/node_modules/semver/functions/lte.js"(exports, module) {
9983
+ init_cjs_shim();
9805
9984
  var compare = require_compare();
9806
9985
  var lte = (a, b, loose) => compare(a, b, loose) <= 0;
9807
9986
  module.exports = lte;
@@ -9811,6 +9990,7 @@ var require_lte = __commonJS({
9811
9990
  // ../../magda-typescript-common/node_modules/semver/functions/cmp.js
9812
9991
  var require_cmp = __commonJS({
9813
9992
  "../../magda-typescript-common/node_modules/semver/functions/cmp.js"(exports, module) {
9993
+ init_cjs_shim();
9814
9994
  var eq2 = require_eq2();
9815
9995
  var neq = require_neq();
9816
9996
  var gt = require_gt();
@@ -9860,6 +10040,7 @@ var require_cmp = __commonJS({
9860
10040
  // ../../magda-typescript-common/node_modules/semver/functions/coerce.js
9861
10041
  var require_coerce = __commonJS({
9862
10042
  "../../magda-typescript-common/node_modules/semver/functions/coerce.js"(exports, module) {
10043
+ init_cjs_shim();
9863
10044
  var SemVer = require_semver();
9864
10045
  var parse = require_parse();
9865
10046
  var { safeRe: re, t } = require_re();
@@ -9900,6 +10081,7 @@ var require_coerce = __commonJS({
9900
10081
  var require_iterator = __commonJS({
9901
10082
  "../../node_modules/yallist/iterator.js"(exports, module) {
9902
10083
  "use strict";
10084
+ init_cjs_shim();
9903
10085
  module.exports = function(Yallist) {
9904
10086
  Yallist.prototype[Symbol.iterator] = function* () {
9905
10087
  for (let walker = this.head; walker; walker = walker.next) {
@@ -9914,6 +10096,7 @@ var require_iterator = __commonJS({
9914
10096
  var require_yallist = __commonJS({
9915
10097
  "../../node_modules/yallist/yallist.js"(exports, module) {
9916
10098
  "use strict";
10099
+ init_cjs_shim();
9917
10100
  module.exports = Yallist;
9918
10101
  Yallist.Node = Node;
9919
10102
  Yallist.create = Yallist;
@@ -10283,6 +10466,7 @@ var require_yallist = __commonJS({
10283
10466
  var require_lru_cache = __commonJS({
10284
10467
  "../../node_modules/lru-cache/index.js"(exports, module) {
10285
10468
  "use strict";
10469
+ init_cjs_shim();
10286
10470
  var Yallist = require_yallist();
10287
10471
  var MAX = Symbol("max");
10288
10472
  var LENGTH = Symbol("length");
@@ -10552,6 +10736,7 @@ var require_lru_cache = __commonJS({
10552
10736
  // ../../magda-typescript-common/node_modules/semver/classes/range.js
10553
10737
  var require_range = __commonJS({
10554
10738
  "../../magda-typescript-common/node_modules/semver/classes/range.js"(exports, module) {
10739
+ init_cjs_shim();
10555
10740
  var Range = class _Range {
10556
10741
  constructor(range, options) {
10557
10742
  options = parseOptions(options);
@@ -10909,6 +11094,7 @@ var require_range = __commonJS({
10909
11094
  // ../../magda-typescript-common/node_modules/semver/classes/comparator.js
10910
11095
  var require_comparator = __commonJS({
10911
11096
  "../../magda-typescript-common/node_modules/semver/classes/comparator.js"(exports, module) {
11097
+ init_cjs_shim();
10912
11098
  var ANY = Symbol("SemVer ANY");
10913
11099
  var Comparator = class _Comparator {
10914
11100
  static get ANY() {
@@ -11021,6 +11207,7 @@ var require_comparator = __commonJS({
11021
11207
  // ../../magda-typescript-common/node_modules/semver/functions/satisfies.js
11022
11208
  var require_satisfies = __commonJS({
11023
11209
  "../../magda-typescript-common/node_modules/semver/functions/satisfies.js"(exports, module) {
11210
+ init_cjs_shim();
11024
11211
  var Range = require_range();
11025
11212
  var satisfies = (version, range, options) => {
11026
11213
  try {
@@ -11037,6 +11224,7 @@ var require_satisfies = __commonJS({
11037
11224
  // ../../magda-typescript-common/node_modules/semver/ranges/to-comparators.js
11038
11225
  var require_to_comparators = __commonJS({
11039
11226
  "../../magda-typescript-common/node_modules/semver/ranges/to-comparators.js"(exports, module) {
11227
+ init_cjs_shim();
11040
11228
  var Range = require_range();
11041
11229
  var toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
11042
11230
  module.exports = toComparators;
@@ -11046,6 +11234,7 @@ var require_to_comparators = __commonJS({
11046
11234
  // ../../magda-typescript-common/node_modules/semver/ranges/max-satisfying.js
11047
11235
  var require_max_satisfying = __commonJS({
11048
11236
  "../../magda-typescript-common/node_modules/semver/ranges/max-satisfying.js"(exports, module) {
11237
+ init_cjs_shim();
11049
11238
  var SemVer = require_semver();
11050
11239
  var Range = require_range();
11051
11240
  var maxSatisfying = (versions, range, options) => {
@@ -11074,6 +11263,7 @@ var require_max_satisfying = __commonJS({
11074
11263
  // ../../magda-typescript-common/node_modules/semver/ranges/min-satisfying.js
11075
11264
  var require_min_satisfying = __commonJS({
11076
11265
  "../../magda-typescript-common/node_modules/semver/ranges/min-satisfying.js"(exports, module) {
11266
+ init_cjs_shim();
11077
11267
  var SemVer = require_semver();
11078
11268
  var Range = require_range();
11079
11269
  var minSatisfying = (versions, range, options) => {
@@ -11102,6 +11292,7 @@ var require_min_satisfying = __commonJS({
11102
11292
  // ../../magda-typescript-common/node_modules/semver/ranges/min-version.js
11103
11293
  var require_min_version = __commonJS({
11104
11294
  "../../magda-typescript-common/node_modules/semver/ranges/min-version.js"(exports, module) {
11295
+ init_cjs_shim();
11105
11296
  var SemVer = require_semver();
11106
11297
  var Range = require_range();
11107
11298
  var gt = require_gt();
@@ -11158,6 +11349,7 @@ var require_min_version = __commonJS({
11158
11349
  // ../../magda-typescript-common/node_modules/semver/ranges/valid.js
11159
11350
  var require_valid2 = __commonJS({
11160
11351
  "../../magda-typescript-common/node_modules/semver/ranges/valid.js"(exports, module) {
11352
+ init_cjs_shim();
11161
11353
  var Range = require_range();
11162
11354
  var validRange = (range, options) => {
11163
11355
  try {
@@ -11173,6 +11365,7 @@ var require_valid2 = __commonJS({
11173
11365
  // ../../magda-typescript-common/node_modules/semver/ranges/outside.js
11174
11366
  var require_outside = __commonJS({
11175
11367
  "../../magda-typescript-common/node_modules/semver/ranges/outside.js"(exports, module) {
11368
+ init_cjs_shim();
11176
11369
  var SemVer = require_semver();
11177
11370
  var Comparator = require_comparator();
11178
11371
  var { ANY } = Comparator;
@@ -11241,6 +11434,7 @@ var require_outside = __commonJS({
11241
11434
  // ../../magda-typescript-common/node_modules/semver/ranges/gtr.js
11242
11435
  var require_gtr = __commonJS({
11243
11436
  "../../magda-typescript-common/node_modules/semver/ranges/gtr.js"(exports, module) {
11437
+ init_cjs_shim();
11244
11438
  var outside = require_outside();
11245
11439
  var gtr = (version, range, options) => outside(version, range, ">", options);
11246
11440
  module.exports = gtr;
@@ -11250,6 +11444,7 @@ var require_gtr = __commonJS({
11250
11444
  // ../../magda-typescript-common/node_modules/semver/ranges/ltr.js
11251
11445
  var require_ltr = __commonJS({
11252
11446
  "../../magda-typescript-common/node_modules/semver/ranges/ltr.js"(exports, module) {
11447
+ init_cjs_shim();
11253
11448
  var outside = require_outside();
11254
11449
  var ltr = (version, range, options) => outside(version, range, "<", options);
11255
11450
  module.exports = ltr;
@@ -11259,6 +11454,7 @@ var require_ltr = __commonJS({
11259
11454
  // ../../magda-typescript-common/node_modules/semver/ranges/intersects.js
11260
11455
  var require_intersects = __commonJS({
11261
11456
  "../../magda-typescript-common/node_modules/semver/ranges/intersects.js"(exports, module) {
11457
+ init_cjs_shim();
11262
11458
  var Range = require_range();
11263
11459
  var intersects = (r1, r2, options) => {
11264
11460
  r1 = new Range(r1, options);
@@ -11272,6 +11468,7 @@ var require_intersects = __commonJS({
11272
11468
  // ../../magda-typescript-common/node_modules/semver/ranges/simplify.js
11273
11469
  var require_simplify = __commonJS({
11274
11470
  "../../magda-typescript-common/node_modules/semver/ranges/simplify.js"(exports, module) {
11471
+ init_cjs_shim();
11275
11472
  var satisfies = require_satisfies();
11276
11473
  var compare = require_compare();
11277
11474
  module.exports = (versions, range, options) => {
@@ -11321,6 +11518,7 @@ var require_simplify = __commonJS({
11321
11518
  // ../../magda-typescript-common/node_modules/semver/ranges/subset.js
11322
11519
  var require_subset = __commonJS({
11323
11520
  "../../magda-typescript-common/node_modules/semver/ranges/subset.js"(exports, module) {
11521
+ init_cjs_shim();
11324
11522
  var Range = require_range();
11325
11523
  var Comparator = require_comparator();
11326
11524
  var { ANY } = Comparator;
@@ -11483,6 +11681,7 @@ var require_subset = __commonJS({
11483
11681
  // ../../magda-typescript-common/node_modules/semver/index.js
11484
11682
  var require_semver2 = __commonJS({
11485
11683
  "../../magda-typescript-common/node_modules/semver/index.js"(exports, module) {
11684
+ init_cjs_shim();
11486
11685
  var internalRe = require_re();
11487
11686
  var constants = require_constants();
11488
11687
  var SemVer = require_semver();
@@ -11577,6 +11776,7 @@ var require_semver2 = __commonJS({
11577
11776
  // ../../magda-typescript-common/node_modules/jsonwebtoken/lib/asymmetricKeyDetailsSupported.js
11578
11777
  var require_asymmetricKeyDetailsSupported = __commonJS({
11579
11778
  "../../magda-typescript-common/node_modules/jsonwebtoken/lib/asymmetricKeyDetailsSupported.js"(exports, module) {
11779
+ init_cjs_shim();
11580
11780
  var semver = require_semver2();
11581
11781
  module.exports = semver.satisfies(process.version, ">=15.7.0");
11582
11782
  }
@@ -11585,6 +11785,7 @@ var require_asymmetricKeyDetailsSupported = __commonJS({
11585
11785
  // ../../magda-typescript-common/node_modules/jsonwebtoken/lib/rsaPssKeyDetailsSupported.js
11586
11786
  var require_rsaPssKeyDetailsSupported = __commonJS({
11587
11787
  "../../magda-typescript-common/node_modules/jsonwebtoken/lib/rsaPssKeyDetailsSupported.js"(exports, module) {
11788
+ init_cjs_shim();
11588
11789
  var semver = require_semver2();
11589
11790
  module.exports = semver.satisfies(process.version, ">=16.9.0");
11590
11791
  }
@@ -11593,6 +11794,7 @@ var require_rsaPssKeyDetailsSupported = __commonJS({
11593
11794
  // ../../magda-typescript-common/node_modules/jsonwebtoken/lib/validateAsymmetricKey.js
11594
11795
  var require_validateAsymmetricKey = __commonJS({
11595
11796
  "../../magda-typescript-common/node_modules/jsonwebtoken/lib/validateAsymmetricKey.js"(exports, module) {
11797
+ init_cjs_shim();
11596
11798
  var ASYMMETRIC_KEY_DETAILS_SUPPORTED = require_asymmetricKeyDetailsSupported();
11597
11799
  var RSA_PSS_KEY_DETAILS_SUPPORTED = require_rsaPssKeyDetailsSupported();
11598
11800
  var allowedAlgorithmsForKeys = {
@@ -11648,6 +11850,7 @@ var require_validateAsymmetricKey = __commonJS({
11648
11850
  // ../../magda-typescript-common/node_modules/jsonwebtoken/lib/psSupported.js
11649
11851
  var require_psSupported = __commonJS({
11650
11852
  "../../magda-typescript-common/node_modules/jsonwebtoken/lib/psSupported.js"(exports, module) {
11853
+ init_cjs_shim();
11651
11854
  var semver = require_semver2();
11652
11855
  module.exports = semver.satisfies(process.version, "^6.12.0 || >=8.0.0");
11653
11856
  }
@@ -11656,6 +11859,7 @@ var require_psSupported = __commonJS({
11656
11859
  // ../../magda-typescript-common/node_modules/jsonwebtoken/verify.js
11657
11860
  var require_verify = __commonJS({
11658
11861
  "../../magda-typescript-common/node_modules/jsonwebtoken/verify.js"(exports, module) {
11862
+ init_cjs_shim();
11659
11863
  var JsonWebTokenError = require_JsonWebTokenError();
11660
11864
  var NotBeforeError = require_NotBeforeError();
11661
11865
  var TokenExpiredError = require_TokenExpiredError();
@@ -11872,6 +12076,7 @@ var require_verify = __commonJS({
11872
12076
  // ../../node_modules/lodash.includes/index.js
11873
12077
  var require_lodash = __commonJS({
11874
12078
  "../../node_modules/lodash.includes/index.js"(exports, module) {
12079
+ init_cjs_shim();
11875
12080
  var INFINITY = 1 / 0;
11876
12081
  var MAX_SAFE_INTEGER = 9007199254740991;
11877
12082
  var MAX_INTEGER = 17976931348623157e292;
@@ -12056,6 +12261,7 @@ var require_lodash = __commonJS({
12056
12261
  // ../../node_modules/lodash.isboolean/index.js
12057
12262
  var require_lodash2 = __commonJS({
12058
12263
  "../../node_modules/lodash.isboolean/index.js"(exports, module) {
12264
+ init_cjs_shim();
12059
12265
  var boolTag = "[object Boolean]";
12060
12266
  var objectProto = Object.prototype;
12061
12267
  var objectToString = objectProto.toString;
@@ -12072,6 +12278,7 @@ var require_lodash2 = __commonJS({
12072
12278
  // ../../node_modules/lodash.isinteger/index.js
12073
12279
  var require_lodash3 = __commonJS({
12074
12280
  "../../node_modules/lodash.isinteger/index.js"(exports, module) {
12281
+ init_cjs_shim();
12075
12282
  var INFINITY = 1 / 0;
12076
12283
  var MAX_INTEGER = 17976931348623157e292;
12077
12284
  var NAN = 0 / 0;
@@ -12136,6 +12343,7 @@ var require_lodash3 = __commonJS({
12136
12343
  // ../../node_modules/lodash.isnumber/index.js
12137
12344
  var require_lodash4 = __commonJS({
12138
12345
  "../../node_modules/lodash.isnumber/index.js"(exports, module) {
12346
+ init_cjs_shim();
12139
12347
  var numberTag = "[object Number]";
12140
12348
  var objectProto = Object.prototype;
12141
12349
  var objectToString = objectProto.toString;
@@ -12152,6 +12360,7 @@ var require_lodash4 = __commonJS({
12152
12360
  // ../../node_modules/lodash.isplainobject/index.js
12153
12361
  var require_lodash5 = __commonJS({
12154
12362
  "../../node_modules/lodash.isplainobject/index.js"(exports, module) {
12363
+ init_cjs_shim();
12155
12364
  var objectTag = "[object Object]";
12156
12365
  function isHostObject(value) {
12157
12366
  var result = false;
@@ -12196,6 +12405,7 @@ var require_lodash5 = __commonJS({
12196
12405
  // ../../node_modules/lodash.isstring/index.js
12197
12406
  var require_lodash6 = __commonJS({
12198
12407
  "../../node_modules/lodash.isstring/index.js"(exports, module) {
12408
+ init_cjs_shim();
12199
12409
  var stringTag = "[object String]";
12200
12410
  var objectProto = Object.prototype;
12201
12411
  var objectToString = objectProto.toString;
@@ -12213,6 +12423,7 @@ var require_lodash6 = __commonJS({
12213
12423
  // ../../node_modules/lodash.once/index.js
12214
12424
  var require_lodash7 = __commonJS({
12215
12425
  "../../node_modules/lodash.once/index.js"(exports, module) {
12426
+ init_cjs_shim();
12216
12427
  var FUNC_ERROR_TEXT = "Expected a function";
12217
12428
  var INFINITY = 1 / 0;
12218
12429
  var MAX_INTEGER = 17976931348623157e292;
@@ -12294,6 +12505,7 @@ var require_lodash7 = __commonJS({
12294
12505
  // ../../magda-typescript-common/node_modules/jsonwebtoken/sign.js
12295
12506
  var require_sign = __commonJS({
12296
12507
  "../../magda-typescript-common/node_modules/jsonwebtoken/sign.js"(exports, module) {
12508
+ init_cjs_shim();
12297
12509
  var timespan = require_timespan();
12298
12510
  var PS_SUPPORTED = require_psSupported();
12299
12511
  var validateAsymmetricKey = require_validateAsymmetricKey();
@@ -12519,6 +12731,7 @@ var require_sign = __commonJS({
12519
12731
  // ../../magda-typescript-common/node_modules/jsonwebtoken/index.js
12520
12732
  var require_jsonwebtoken = __commonJS({
12521
12733
  "../../magda-typescript-common/node_modules/jsonwebtoken/index.js"(exports, module) {
12734
+ init_cjs_shim();
12522
12735
  module.exports = {
12523
12736
  decode: require_decode(),
12524
12737
  verify: require_verify(),
@@ -12530,155 +12743,2604 @@ var require_jsonwebtoken = __commonJS({
12530
12743
  }
12531
12744
  });
12532
12745
 
12533
- // ../../node_modules/@magda/tsmonad/dist/monad.js
12534
- function eq(a, b) {
12535
- var idx = 0;
12536
- if (a === b) {
12537
- return true;
12538
- }
12539
- if (typeof a.equals === "function") {
12540
- return a.equals(b);
12541
- }
12542
- if (a.length > 0 && a.length === b.length) {
12543
- for (; idx < a.length; idx += 1) {
12544
- if (!eq(a[idx], b[idx])) {
12545
- return false;
12746
+ // ../../node_modules/urijs/src/punycode.js
12747
+ var require_punycode = __commonJS({
12748
+ "../../node_modules/urijs/src/punycode.js"(exports, module) {
12749
+ init_cjs_shim();
12750
+ (function(root) {
12751
+ var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
12752
+ var freeModule = typeof module == "object" && module && !module.nodeType && module;
12753
+ var freeGlobal = typeof global == "object" && global;
12754
+ if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal || freeGlobal.self === freeGlobal) {
12755
+ root = freeGlobal;
12546
12756
  }
12547
- }
12548
- return true;
12757
+ var punycode, maxInt = 2147483647, base = 36, tMin = 1, tMax = 26, skew = 38, damp = 700, initialBias = 72, initialN = 128, delimiter = "-", regexPunycode = /^xn--/, regexNonASCII = /[^\x20-\x7E]/, regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, errors = {
12758
+ "overflow": "Overflow: input needs wider integers to process",
12759
+ "not-basic": "Illegal input >= 0x80 (not a basic code point)",
12760
+ "invalid-input": "Invalid input"
12761
+ }, baseMinusTMin = base - tMin, floor = Math.floor, stringFromCharCode = String.fromCharCode, key;
12762
+ function error(type) {
12763
+ throw new RangeError(errors[type]);
12764
+ }
12765
+ function map(array, fn) {
12766
+ var length = array.length;
12767
+ var result = [];
12768
+ while (length--) {
12769
+ result[length] = fn(array[length]);
12770
+ }
12771
+ return result;
12772
+ }
12773
+ function mapDomain(string, fn) {
12774
+ var parts = string.split("@");
12775
+ var result = "";
12776
+ if (parts.length > 1) {
12777
+ result = parts[0] + "@";
12778
+ string = parts[1];
12779
+ }
12780
+ string = string.replace(regexSeparators, ".");
12781
+ var labels = string.split(".");
12782
+ var encoded = map(labels, fn).join(".");
12783
+ return result + encoded;
12784
+ }
12785
+ function ucs2decode(string) {
12786
+ var output = [], counter = 0, length = string.length, value, extra;
12787
+ while (counter < length) {
12788
+ value = string.charCodeAt(counter++);
12789
+ if (value >= 55296 && value <= 56319 && counter < length) {
12790
+ extra = string.charCodeAt(counter++);
12791
+ if ((extra & 64512) == 56320) {
12792
+ output.push(((value & 1023) << 10) + (extra & 1023) + 65536);
12793
+ } else {
12794
+ output.push(value);
12795
+ counter--;
12796
+ }
12797
+ } else {
12798
+ output.push(value);
12799
+ }
12800
+ }
12801
+ return output;
12802
+ }
12803
+ function ucs2encode(array) {
12804
+ return map(array, function(value) {
12805
+ var output = "";
12806
+ if (value > 65535) {
12807
+ value -= 65536;
12808
+ output += stringFromCharCode(value >>> 10 & 1023 | 55296);
12809
+ value = 56320 | value & 1023;
12810
+ }
12811
+ output += stringFromCharCode(value);
12812
+ return output;
12813
+ }).join("");
12814
+ }
12815
+ function basicToDigit(codePoint) {
12816
+ if (codePoint - 48 < 10) {
12817
+ return codePoint - 22;
12818
+ }
12819
+ if (codePoint - 65 < 26) {
12820
+ return codePoint - 65;
12821
+ }
12822
+ if (codePoint - 97 < 26) {
12823
+ return codePoint - 97;
12824
+ }
12825
+ return base;
12826
+ }
12827
+ function digitToBasic(digit, flag) {
12828
+ return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
12829
+ }
12830
+ function adapt(delta, numPoints, firstTime) {
12831
+ var k = 0;
12832
+ delta = firstTime ? floor(delta / damp) : delta >> 1;
12833
+ delta += floor(delta / numPoints);
12834
+ for (; delta > baseMinusTMin * tMax >> 1; k += base) {
12835
+ delta = floor(delta / baseMinusTMin);
12836
+ }
12837
+ return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
12838
+ }
12839
+ function decode(input) {
12840
+ var output = [], inputLength = input.length, out, i = 0, n = initialN, bias = initialBias, basic, j, index, oldi, w, k, digit, t, baseMinusT;
12841
+ basic = input.lastIndexOf(delimiter);
12842
+ if (basic < 0) {
12843
+ basic = 0;
12844
+ }
12845
+ for (j = 0; j < basic; ++j) {
12846
+ if (input.charCodeAt(j) >= 128) {
12847
+ error("not-basic");
12848
+ }
12849
+ output.push(input.charCodeAt(j));
12850
+ }
12851
+ for (index = basic > 0 ? basic + 1 : 0; index < inputLength; ) {
12852
+ for (oldi = i, w = 1, k = base; ; k += base) {
12853
+ if (index >= inputLength) {
12854
+ error("invalid-input");
12855
+ }
12856
+ digit = basicToDigit(input.charCodeAt(index++));
12857
+ if (digit >= base || digit > floor((maxInt - i) / w)) {
12858
+ error("overflow");
12859
+ }
12860
+ i += digit * w;
12861
+ t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
12862
+ if (digit < t) {
12863
+ break;
12864
+ }
12865
+ baseMinusT = base - t;
12866
+ if (w > floor(maxInt / baseMinusT)) {
12867
+ error("overflow");
12868
+ }
12869
+ w *= baseMinusT;
12870
+ }
12871
+ out = output.length + 1;
12872
+ bias = adapt(i - oldi, out, oldi == 0);
12873
+ if (floor(i / out) > maxInt - n) {
12874
+ error("overflow");
12875
+ }
12876
+ n += floor(i / out);
12877
+ i %= out;
12878
+ output.splice(i++, 0, n);
12879
+ }
12880
+ return ucs2encode(output);
12881
+ }
12882
+ function encode(input) {
12883
+ var n, delta, handledCPCount, basicLength, bias, j, m, q, k, t, currentValue, output = [], inputLength, handledCPCountPlusOne, baseMinusT, qMinusT;
12884
+ input = ucs2decode(input);
12885
+ inputLength = input.length;
12886
+ n = initialN;
12887
+ delta = 0;
12888
+ bias = initialBias;
12889
+ for (j = 0; j < inputLength; ++j) {
12890
+ currentValue = input[j];
12891
+ if (currentValue < 128) {
12892
+ output.push(stringFromCharCode(currentValue));
12893
+ }
12894
+ }
12895
+ handledCPCount = basicLength = output.length;
12896
+ if (basicLength) {
12897
+ output.push(delimiter);
12898
+ }
12899
+ while (handledCPCount < inputLength) {
12900
+ for (m = maxInt, j = 0; j < inputLength; ++j) {
12901
+ currentValue = input[j];
12902
+ if (currentValue >= n && currentValue < m) {
12903
+ m = currentValue;
12904
+ }
12905
+ }
12906
+ handledCPCountPlusOne = handledCPCount + 1;
12907
+ if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
12908
+ error("overflow");
12909
+ }
12910
+ delta += (m - n) * handledCPCountPlusOne;
12911
+ n = m;
12912
+ for (j = 0; j < inputLength; ++j) {
12913
+ currentValue = input[j];
12914
+ if (currentValue < n && ++delta > maxInt) {
12915
+ error("overflow");
12916
+ }
12917
+ if (currentValue == n) {
12918
+ for (q = delta, k = base; ; k += base) {
12919
+ t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
12920
+ if (q < t) {
12921
+ break;
12922
+ }
12923
+ qMinusT = q - t;
12924
+ baseMinusT = base - t;
12925
+ output.push(
12926
+ stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))
12927
+ );
12928
+ q = floor(qMinusT / baseMinusT);
12929
+ }
12930
+ output.push(stringFromCharCode(digitToBasic(q, 0)));
12931
+ bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
12932
+ delta = 0;
12933
+ ++handledCPCount;
12934
+ }
12935
+ }
12936
+ ++delta;
12937
+ ++n;
12938
+ }
12939
+ return output.join("");
12940
+ }
12941
+ function toUnicode(input) {
12942
+ return mapDomain(input, function(string) {
12943
+ return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string;
12944
+ });
12945
+ }
12946
+ function toASCII(input) {
12947
+ return mapDomain(input, function(string) {
12948
+ return regexNonASCII.test(string) ? "xn--" + encode(string) : string;
12949
+ });
12950
+ }
12951
+ punycode = {
12952
+ /**
12953
+ * A string representing the current Punycode.js version number.
12954
+ * @memberOf punycode
12955
+ * @type String
12956
+ */
12957
+ "version": "1.3.2",
12958
+ /**
12959
+ * An object of methods to convert from JavaScript's internal character
12960
+ * representation (UCS-2) to Unicode code points, and back.
12961
+ * @see <https://mathiasbynens.be/notes/javascript-encoding>
12962
+ * @memberOf punycode
12963
+ * @type Object
12964
+ */
12965
+ "ucs2": {
12966
+ "decode": ucs2decode,
12967
+ "encode": ucs2encode
12968
+ },
12969
+ "decode": decode,
12970
+ "encode": encode,
12971
+ "toASCII": toASCII,
12972
+ "toUnicode": toUnicode
12973
+ };
12974
+ if (typeof define == "function" && typeof define.amd == "object" && define.amd) {
12975
+ define("punycode", function() {
12976
+ return punycode;
12977
+ });
12978
+ } else if (freeExports && freeModule) {
12979
+ if (module.exports == freeExports) {
12980
+ freeModule.exports = punycode;
12981
+ } else {
12982
+ for (key in punycode) {
12983
+ punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]);
12984
+ }
12985
+ }
12986
+ } else {
12987
+ root.punycode = punycode;
12988
+ }
12989
+ })(exports);
12549
12990
  }
12550
- return false;
12551
- }
12552
-
12553
- // ../../node_modules/@magda/tsmonad/dist/either.js
12554
- var EitherType;
12555
- (function(EitherType2) {
12556
- EitherType2[EitherType2["Left"] = 0] = "Left";
12557
- EitherType2[EitherType2["Right"] = 1] = "Right";
12558
- })(EitherType || (EitherType = {}));
12991
+ });
12559
12992
 
12560
- // ../../node_modules/@magda/tsmonad/dist/maybe.js
12561
- var MaybeType;
12562
- (function(MaybeType2) {
12563
- MaybeType2[MaybeType2["Nothing"] = 0] = "Nothing";
12564
- MaybeType2[MaybeType2["Just"] = 1] = "Just";
12565
- })(MaybeType || (MaybeType = {}));
12566
- var Maybe = class _Maybe {
12567
- type;
12568
- value;
12569
- constructor(type, value) {
12570
- this.type = type;
12571
- this.value = value;
12572
- }
12573
- static sequence(t) {
12574
- if (Object.keys(t).filter((k2) => t[k2].type === MaybeType.Nothing).length) {
12575
- return _Maybe.nothing();
12576
- }
12577
- var result = {};
12578
- for (var k in t) {
12579
- if (t.hasOwnProperty(k)) {
12580
- result[k] = t[k].value;
12993
+ // ../../node_modules/urijs/src/IPv6.js
12994
+ var require_IPv6 = __commonJS({
12995
+ "../../node_modules/urijs/src/IPv6.js"(exports, module) {
12996
+ init_cjs_shim();
12997
+ (function(root, factory) {
12998
+ "use strict";
12999
+ if (typeof module === "object" && module.exports) {
13000
+ module.exports = factory();
13001
+ } else if (typeof define === "function" && define.amd) {
13002
+ define(factory);
13003
+ } else {
13004
+ root.IPv6 = factory(root);
13005
+ }
13006
+ })(exports, function(root) {
13007
+ "use strict";
13008
+ var _IPv6 = root && root.IPv6;
13009
+ function bestPresentation(address) {
13010
+ var _address = address.toLowerCase();
13011
+ var segments = _address.split(":");
13012
+ var length = segments.length;
13013
+ var total = 8;
13014
+ if (segments[0] === "" && segments[1] === "" && segments[2] === "") {
13015
+ segments.shift();
13016
+ segments.shift();
13017
+ } else if (segments[0] === "" && segments[1] === "") {
13018
+ segments.shift();
13019
+ } else if (segments[length - 1] === "" && segments[length - 2] === "") {
13020
+ segments.pop();
13021
+ }
13022
+ length = segments.length;
13023
+ if (segments[length - 1].indexOf(".") !== -1) {
13024
+ total = 7;
13025
+ }
13026
+ var pos;
13027
+ for (pos = 0; pos < length; pos++) {
13028
+ if (segments[pos] === "") {
13029
+ break;
13030
+ }
13031
+ }
13032
+ if (pos < total) {
13033
+ segments.splice(pos, 1, "0000");
13034
+ while (segments.length < total) {
13035
+ segments.splice(pos, 0, "0000");
13036
+ }
13037
+ }
13038
+ var _segments;
13039
+ for (var i = 0; i < total; i++) {
13040
+ _segments = segments[i].split("");
13041
+ for (var j = 0; j < 3; j++) {
13042
+ if (_segments[0] === "0" && _segments.length > 1) {
13043
+ _segments.splice(0, 1);
13044
+ } else {
13045
+ break;
13046
+ }
13047
+ }
13048
+ segments[i] = _segments.join("");
13049
+ }
13050
+ var best = -1;
13051
+ var _best = 0;
13052
+ var _current = 0;
13053
+ var current = -1;
13054
+ var inzeroes = false;
13055
+ for (i = 0; i < total; i++) {
13056
+ if (inzeroes) {
13057
+ if (segments[i] === "0") {
13058
+ _current += 1;
13059
+ } else {
13060
+ inzeroes = false;
13061
+ if (_current > _best) {
13062
+ best = current;
13063
+ _best = _current;
13064
+ }
13065
+ }
13066
+ } else {
13067
+ if (segments[i] === "0") {
13068
+ inzeroes = true;
13069
+ current = i;
13070
+ _current = 1;
13071
+ }
13072
+ }
13073
+ }
13074
+ if (_current > _best) {
13075
+ best = current;
13076
+ _best = _current;
13077
+ }
13078
+ if (_best > 1) {
13079
+ segments.splice(best, _best, "");
13080
+ }
13081
+ length = segments.length;
13082
+ var result = "";
13083
+ if (segments[0] === "") {
13084
+ result = ":";
13085
+ }
13086
+ for (i = 0; i < length; i++) {
13087
+ result += segments[i];
13088
+ if (i === length - 1) {
13089
+ break;
13090
+ }
13091
+ result += ":";
13092
+ }
13093
+ if (segments[length - 1] === "") {
13094
+ result += ":";
13095
+ }
13096
+ return result;
12581
13097
  }
12582
- }
12583
- return _Maybe.just(result);
12584
- }
12585
- static all = (t) => _Maybe.sequence(t);
12586
- static maybe(t) {
12587
- return t === null || t === void 0 ? new _Maybe(MaybeType.Nothing) : new _Maybe(MaybeType.Just, t);
12588
- }
12589
- static just(t) {
12590
- if (t === null || t === void 0) {
12591
- throw new TypeError("Cannot Maybe.just(null)");
12592
- }
12593
- return new _Maybe(MaybeType.Just, t);
12594
- }
12595
- static nothing() {
12596
- return new _Maybe(MaybeType.Nothing);
12597
- }
12598
- static isJust(t) {
12599
- return t.type === MaybeType.Just;
12600
- }
12601
- static isNothing(t) {
12602
- return t.type === MaybeType.Nothing;
12603
- }
12604
- unit(u) {
12605
- return _Maybe.maybe(u);
12606
- }
12607
- bind(f) {
12608
- return this.type === MaybeType.Just ? f(this.value) : _Maybe.nothing();
12609
- }
12610
- of = this.unit;
12611
- chain = this.bind;
12612
- fmap(f) {
12613
- return this.bind((v) => this.unit(f(v)));
12614
- }
12615
- lift = this.fmap;
12616
- map = this.fmap;
12617
- caseOf(patterns) {
12618
- return this.type === MaybeType.Just ? patterns.just(this.value) : patterns.nothing();
12619
- }
12620
- defaulting(defaultValue) {
12621
- return _Maybe.just(this.valueOr(defaultValue));
12622
- }
12623
- equals(other) {
12624
- return other.type === this.type && (this.type === MaybeType.Nothing || eq(other.value, this.value));
12625
- }
12626
- valueOr(defaultValue) {
12627
- return this.valueOrCompute(() => defaultValue);
12628
- }
12629
- valueOrCompute(defaultValueFunction) {
12630
- return this.type === MaybeType.Just ? this.value : defaultValueFunction();
12631
- }
12632
- valueOrThrow(error) {
12633
- if (this.type === MaybeType.Just) {
12634
- return this.value;
12635
- }
12636
- throw error || new Error("No value is available.");
12637
- }
12638
- do(patterns = {}) {
12639
- let noop_pattern = {
12640
- just: (t) => {
12641
- },
12642
- nothing: () => {
13098
+ function noConflict() {
13099
+ if (root.IPv6 === this) {
13100
+ root.IPv6 = _IPv6;
13101
+ }
13102
+ return this;
12643
13103
  }
12644
- };
12645
- let merged = Object.assign(noop_pattern, patterns);
12646
- this.caseOf(merged);
12647
- return this;
13104
+ return {
13105
+ best: bestPresentation,
13106
+ noConflict
13107
+ };
13108
+ });
12648
13109
  }
12649
- };
12650
-
12651
- // ../../magda-typescript-common/dist/util/arrayToMaybe.js
12652
- function arrayToMaybe(rows) {
12653
- return rows.length > 0 ? Maybe.just(rows[0]) : Maybe.nothing();
12654
- }
12655
-
12656
- // ../../magda-typescript-common/dist/util/getMinikubeIP.js
12657
- import * as childProcess from "child_process";
12658
- function getMinikubeIP() {
12659
- const minikubeProcess = childProcess.spawnSync("minikube", ["ip"]);
12660
- const ip = minikubeProcess.stdout.toString().trim();
12661
- return ip;
12662
- }
12663
-
12664
- // ../../magda-typescript-common/dist/util/isUuid.js
12665
- var uuidRegEx = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
12666
- var isUuid = (id) => typeof id === "string" && uuidRegEx.test(id);
12667
- var isUuid_default = isUuid;
13110
+ });
12668
13111
 
12669
- // ../../magda-typescript-common/dist/ServerError.js
12670
- var ServerError = class extends Error {
12671
- statusCode;
12672
- constructor(message = "Unknown Error", statusCode = 500) {
12673
- super(message);
12674
- this.statusCode = statusCode;
12675
- }
12676
- toData() {
12677
- return {
12678
- isError: true,
12679
- errorCode: this.statusCode,
12680
- errorMessage: this.message
12681
- };
13112
+ // ../../node_modules/urijs/src/SecondLevelDomains.js
13113
+ var require_SecondLevelDomains = __commonJS({
13114
+ "../../node_modules/urijs/src/SecondLevelDomains.js"(exports, module) {
13115
+ init_cjs_shim();
13116
+ (function(root, factory) {
13117
+ "use strict";
13118
+ if (typeof module === "object" && module.exports) {
13119
+ module.exports = factory();
13120
+ } else if (typeof define === "function" && define.amd) {
13121
+ define(factory);
13122
+ } else {
13123
+ root.SecondLevelDomains = factory(root);
13124
+ }
13125
+ })(exports, function(root) {
13126
+ "use strict";
13127
+ var _SecondLevelDomains = root && root.SecondLevelDomains;
13128
+ var SLD = {
13129
+ // list of known Second Level Domains
13130
+ // converted list of SLDs from https://github.com/gavingmiller/second-level-domains
13131
+ // ----
13132
+ // publicsuffix.org is more current and actually used by a couple of browsers internally.
13133
+ // downside is it also contains domains like "dyndns.org" - which is fine for the security
13134
+ // issues browser have to deal with (SOP for cookies, etc) - but is way overboard for URI.js
13135
+ // ----
13136
+ list: {
13137
+ "ac": " com gov mil net org ",
13138
+ "ae": " ac co gov mil name net org pro sch ",
13139
+ "af": " com edu gov net org ",
13140
+ "al": " com edu gov mil net org ",
13141
+ "ao": " co ed gv it og pb ",
13142
+ "ar": " com edu gob gov int mil net org tur ",
13143
+ "at": " ac co gv or ",
13144
+ "au": " asn com csiro edu gov id net org ",
13145
+ "ba": " co com edu gov mil net org rs unbi unmo unsa untz unze ",
13146
+ "bb": " biz co com edu gov info net org store tv ",
13147
+ "bh": " biz cc com edu gov info net org ",
13148
+ "bn": " com edu gov net org ",
13149
+ "bo": " com edu gob gov int mil net org tv ",
13150
+ "br": " adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ",
13151
+ "bs": " com edu gov net org ",
13152
+ "bz": " du et om ov rg ",
13153
+ "ca": " ab bc mb nb nf nl ns nt nu on pe qc sk yk ",
13154
+ "ck": " biz co edu gen gov info net org ",
13155
+ "cn": " ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ",
13156
+ "co": " com edu gov mil net nom org ",
13157
+ "cr": " ac c co ed fi go or sa ",
13158
+ "cy": " ac biz com ekloges gov ltd name net org parliament press pro tm ",
13159
+ "do": " art com edu gob gov mil net org sld web ",
13160
+ "dz": " art asso com edu gov net org pol ",
13161
+ "ec": " com edu fin gov info med mil net org pro ",
13162
+ "eg": " com edu eun gov mil name net org sci ",
13163
+ "er": " com edu gov ind mil net org rochest w ",
13164
+ "es": " com edu gob nom org ",
13165
+ "et": " biz com edu gov info name net org ",
13166
+ "fj": " ac biz com info mil name net org pro ",
13167
+ "fk": " ac co gov net nom org ",
13168
+ "fr": " asso com f gouv nom prd presse tm ",
13169
+ "gg": " co net org ",
13170
+ "gh": " com edu gov mil org ",
13171
+ "gn": " ac com gov net org ",
13172
+ "gr": " com edu gov mil net org ",
13173
+ "gt": " com edu gob ind mil net org ",
13174
+ "gu": " com edu gov net org ",
13175
+ "hk": " com edu gov idv net org ",
13176
+ "hu": " 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ",
13177
+ "id": " ac co go mil net or sch web ",
13178
+ "il": " ac co gov idf k12 muni net org ",
13179
+ "in": " ac co edu ernet firm gen gov i ind mil net nic org res ",
13180
+ "iq": " com edu gov i mil net org ",
13181
+ "ir": " ac co dnssec gov i id net org sch ",
13182
+ "it": " edu gov ",
13183
+ "je": " co net org ",
13184
+ "jo": " com edu gov mil name net org sch ",
13185
+ "jp": " ac ad co ed go gr lg ne or ",
13186
+ "ke": " ac co go info me mobi ne or sc ",
13187
+ "kh": " com edu gov mil net org per ",
13188
+ "ki": " biz com de edu gov info mob net org tel ",
13189
+ "km": " asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ",
13190
+ "kn": " edu gov net org ",
13191
+ "kr": " ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ",
13192
+ "kw": " com edu gov net org ",
13193
+ "ky": " com edu gov net org ",
13194
+ "kz": " com edu gov mil net org ",
13195
+ "lb": " com edu gov net org ",
13196
+ "lk": " assn com edu gov grp hotel int ltd net ngo org sch soc web ",
13197
+ "lr": " com edu gov net org ",
13198
+ "lv": " asn com conf edu gov id mil net org ",
13199
+ "ly": " com edu gov id med net org plc sch ",
13200
+ "ma": " ac co gov m net org press ",
13201
+ "mc": " asso tm ",
13202
+ "me": " ac co edu gov its net org priv ",
13203
+ "mg": " com edu gov mil nom org prd tm ",
13204
+ "mk": " com edu gov inf name net org pro ",
13205
+ "ml": " com edu gov net org presse ",
13206
+ "mn": " edu gov org ",
13207
+ "mo": " com edu gov net org ",
13208
+ "mt": " com edu gov net org ",
13209
+ "mv": " aero biz com coop edu gov info int mil museum name net org pro ",
13210
+ "mw": " ac co com coop edu gov int museum net org ",
13211
+ "mx": " com edu gob net org ",
13212
+ "my": " com edu gov mil name net org sch ",
13213
+ "nf": " arts com firm info net other per rec store web ",
13214
+ "ng": " biz com edu gov mil mobi name net org sch ",
13215
+ "ni": " ac co com edu gob mil net nom org ",
13216
+ "np": " com edu gov mil net org ",
13217
+ "nr": " biz com edu gov info net org ",
13218
+ "om": " ac biz co com edu gov med mil museum net org pro sch ",
13219
+ "pe": " com edu gob mil net nom org sld ",
13220
+ "ph": " com edu gov i mil net ngo org ",
13221
+ "pk": " biz com edu fam gob gok gon gop gos gov net org web ",
13222
+ "pl": " art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ",
13223
+ "pr": " ac biz com edu est gov info isla name net org pro prof ",
13224
+ "ps": " com edu gov net org plo sec ",
13225
+ "pw": " belau co ed go ne or ",
13226
+ "ro": " arts com firm info nom nt org rec store tm www ",
13227
+ "rs": " ac co edu gov in org ",
13228
+ "sb": " com edu gov net org ",
13229
+ "sc": " com edu gov net org ",
13230
+ "sh": " co com edu gov net nom org ",
13231
+ "sl": " com edu gov net org ",
13232
+ "st": " co com consulado edu embaixada gov mil net org principe saotome store ",
13233
+ "sv": " com edu gob org red ",
13234
+ "sz": " ac co org ",
13235
+ "tr": " av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ",
13236
+ "tt": " aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ",
13237
+ "tw": " club com ebiz edu game gov idv mil net org ",
13238
+ "mu": " ac co com gov net or org ",
13239
+ "mz": " ac co edu gov org ",
13240
+ "na": " co com ",
13241
+ "nz": " ac co cri geek gen govt health iwi maori mil net org parliament school ",
13242
+ "pa": " abo ac com edu gob ing med net nom org sld ",
13243
+ "pt": " com edu gov int net nome org publ ",
13244
+ "py": " com edu gov mil net org ",
13245
+ "qa": " com edu gov mil net org ",
13246
+ "re": " asso com nom ",
13247
+ "ru": " ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ",
13248
+ "rw": " ac co com edu gouv gov int mil net ",
13249
+ "sa": " com edu gov med net org pub sch ",
13250
+ "sd": " com edu gov info med net org tv ",
13251
+ "se": " a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ",
13252
+ "sg": " com edu gov idn net org per ",
13253
+ "sn": " art com edu gouv org perso univ ",
13254
+ "sy": " com edu gov mil net news org ",
13255
+ "th": " ac co go in mi net or ",
13256
+ "tj": " ac biz co com edu go gov info int mil name net nic org test web ",
13257
+ "tn": " agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ",
13258
+ "tz": " ac co go ne or ",
13259
+ "ua": " biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ",
13260
+ "ug": " ac co go ne or org sc ",
13261
+ "uk": " ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ",
13262
+ "us": " dni fed isa kids nsn ",
13263
+ "uy": " com edu gub mil net org ",
13264
+ "ve": " co com edu gob info mil net org web ",
13265
+ "vi": " co com k12 net org ",
13266
+ "vn": " ac biz com edu gov health info int name net org pro ",
13267
+ "ye": " co com gov ltd me net org plc ",
13268
+ "yu": " ac co edu gov org ",
13269
+ "za": " ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",
13270
+ "zm": " ac co com edu gov net org sch ",
13271
+ // https://en.wikipedia.org/wiki/CentralNic#Second-level_domains
13272
+ "com": "ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ",
13273
+ "net": "gb jp se uk ",
13274
+ "org": "ae",
13275
+ "de": "com "
13276
+ },
13277
+ // gorhill 2013-10-25: Using indexOf() instead Regexp(). Significant boost
13278
+ // in both performance and memory footprint. No initialization required.
13279
+ // http://jsperf.com/uri-js-sld-regex-vs-binary-search/4
13280
+ // Following methods use lastIndexOf() rather than array.split() in order
13281
+ // to avoid any memory allocations.
13282
+ has: function(domain) {
13283
+ var tldOffset = domain.lastIndexOf(".");
13284
+ if (tldOffset <= 0 || tldOffset >= domain.length - 1) {
13285
+ return false;
13286
+ }
13287
+ var sldOffset = domain.lastIndexOf(".", tldOffset - 1);
13288
+ if (sldOffset <= 0 || sldOffset >= tldOffset - 1) {
13289
+ return false;
13290
+ }
13291
+ var sldList = SLD.list[domain.slice(tldOffset + 1)];
13292
+ if (!sldList) {
13293
+ return false;
13294
+ }
13295
+ return sldList.indexOf(" " + domain.slice(sldOffset + 1, tldOffset) + " ") >= 0;
13296
+ },
13297
+ is: function(domain) {
13298
+ var tldOffset = domain.lastIndexOf(".");
13299
+ if (tldOffset <= 0 || tldOffset >= domain.length - 1) {
13300
+ return false;
13301
+ }
13302
+ var sldOffset = domain.lastIndexOf(".", tldOffset - 1);
13303
+ if (sldOffset >= 0) {
13304
+ return false;
13305
+ }
13306
+ var sldList = SLD.list[domain.slice(tldOffset + 1)];
13307
+ if (!sldList) {
13308
+ return false;
13309
+ }
13310
+ return sldList.indexOf(" " + domain.slice(0, tldOffset) + " ") >= 0;
13311
+ },
13312
+ get: function(domain) {
13313
+ var tldOffset = domain.lastIndexOf(".");
13314
+ if (tldOffset <= 0 || tldOffset >= domain.length - 1) {
13315
+ return null;
13316
+ }
13317
+ var sldOffset = domain.lastIndexOf(".", tldOffset - 1);
13318
+ if (sldOffset <= 0 || sldOffset >= tldOffset - 1) {
13319
+ return null;
13320
+ }
13321
+ var sldList = SLD.list[domain.slice(tldOffset + 1)];
13322
+ if (!sldList) {
13323
+ return null;
13324
+ }
13325
+ if (sldList.indexOf(" " + domain.slice(sldOffset + 1, tldOffset) + " ") < 0) {
13326
+ return null;
13327
+ }
13328
+ return domain.slice(sldOffset + 1);
13329
+ },
13330
+ noConflict: function() {
13331
+ if (root.SecondLevelDomains === this) {
13332
+ root.SecondLevelDomains = _SecondLevelDomains;
13333
+ }
13334
+ return this;
13335
+ }
13336
+ };
13337
+ return SLD;
13338
+ });
13339
+ }
13340
+ });
13341
+
13342
+ // ../../node_modules/urijs/src/URI.js
13343
+ var require_URI = __commonJS({
13344
+ "../../node_modules/urijs/src/URI.js"(exports, module) {
13345
+ init_cjs_shim();
13346
+ (function(root, factory) {
13347
+ "use strict";
13348
+ if (typeof module === "object" && module.exports) {
13349
+ module.exports = factory(require_punycode(), require_IPv6(), require_SecondLevelDomains());
13350
+ } else if (typeof define === "function" && define.amd) {
13351
+ define(["./punycode", "./IPv6", "./SecondLevelDomains"], factory);
13352
+ } else {
13353
+ root.URI = factory(root.punycode, root.IPv6, root.SecondLevelDomains, root);
13354
+ }
13355
+ })(exports, function(punycode, IPv6, SLD, root) {
13356
+ "use strict";
13357
+ var _URI = root && root.URI;
13358
+ function URI(url2, base) {
13359
+ var _urlSupplied = arguments.length >= 1;
13360
+ var _baseSupplied = arguments.length >= 2;
13361
+ if (!(this instanceof URI)) {
13362
+ if (_urlSupplied) {
13363
+ if (_baseSupplied) {
13364
+ return new URI(url2, base);
13365
+ }
13366
+ return new URI(url2);
13367
+ }
13368
+ return new URI();
13369
+ }
13370
+ if (url2 === void 0) {
13371
+ if (_urlSupplied) {
13372
+ throw new TypeError("undefined is not a valid argument for URI");
13373
+ }
13374
+ if (typeof location !== "undefined") {
13375
+ url2 = location.href + "";
13376
+ } else {
13377
+ url2 = "";
13378
+ }
13379
+ }
13380
+ if (url2 === null) {
13381
+ if (_urlSupplied) {
13382
+ throw new TypeError("null is not a valid argument for URI");
13383
+ }
13384
+ }
13385
+ this.href(url2);
13386
+ if (base !== void 0) {
13387
+ return this.absoluteTo(base);
13388
+ }
13389
+ return this;
13390
+ }
13391
+ function isInteger(value) {
13392
+ return /^[0-9]+$/.test(value);
13393
+ }
13394
+ URI.version = "1.19.11";
13395
+ var p = URI.prototype;
13396
+ var hasOwn = Object.prototype.hasOwnProperty;
13397
+ function escapeRegEx(string) {
13398
+ return string.replace(/([.*+?^=!:${}()|[\]\/\\])/g, "\\$1");
13399
+ }
13400
+ function getType(value) {
13401
+ if (value === void 0) {
13402
+ return "Undefined";
13403
+ }
13404
+ return String(Object.prototype.toString.call(value)).slice(8, -1);
13405
+ }
13406
+ function isArray(obj) {
13407
+ return getType(obj) === "Array";
13408
+ }
13409
+ function filterArrayValues(data, value) {
13410
+ var lookup = {};
13411
+ var i, length;
13412
+ if (getType(value) === "RegExp") {
13413
+ lookup = null;
13414
+ } else if (isArray(value)) {
13415
+ for (i = 0, length = value.length; i < length; i++) {
13416
+ lookup[value[i]] = true;
13417
+ }
13418
+ } else {
13419
+ lookup[value] = true;
13420
+ }
13421
+ for (i = 0, length = data.length; i < length; i++) {
13422
+ var _match = lookup && lookup[data[i]] !== void 0 || !lookup && value.test(data[i]);
13423
+ if (_match) {
13424
+ data.splice(i, 1);
13425
+ length--;
13426
+ i--;
13427
+ }
13428
+ }
13429
+ return data;
13430
+ }
13431
+ function arrayContains(list, value) {
13432
+ var i, length;
13433
+ if (isArray(value)) {
13434
+ for (i = 0, length = value.length; i < length; i++) {
13435
+ if (!arrayContains(list, value[i])) {
13436
+ return false;
13437
+ }
13438
+ }
13439
+ return true;
13440
+ }
13441
+ var _type = getType(value);
13442
+ for (i = 0, length = list.length; i < length; i++) {
13443
+ if (_type === "RegExp") {
13444
+ if (typeof list[i] === "string" && list[i].match(value)) {
13445
+ return true;
13446
+ }
13447
+ } else if (list[i] === value) {
13448
+ return true;
13449
+ }
13450
+ }
13451
+ return false;
13452
+ }
13453
+ function arraysEqual(one, two) {
13454
+ if (!isArray(one) || !isArray(two)) {
13455
+ return false;
13456
+ }
13457
+ if (one.length !== two.length) {
13458
+ return false;
13459
+ }
13460
+ one.sort();
13461
+ two.sort();
13462
+ for (var i = 0, l = one.length; i < l; i++) {
13463
+ if (one[i] !== two[i]) {
13464
+ return false;
13465
+ }
13466
+ }
13467
+ return true;
13468
+ }
13469
+ function trimSlashes(text) {
13470
+ var trim_expression = /^\/+|\/+$/g;
13471
+ return text.replace(trim_expression, "");
13472
+ }
13473
+ URI._parts = function() {
13474
+ return {
13475
+ protocol: null,
13476
+ username: null,
13477
+ password: null,
13478
+ hostname: null,
13479
+ urn: null,
13480
+ port: null,
13481
+ path: null,
13482
+ query: null,
13483
+ fragment: null,
13484
+ // state
13485
+ preventInvalidHostname: URI.preventInvalidHostname,
13486
+ duplicateQueryParameters: URI.duplicateQueryParameters,
13487
+ escapeQuerySpace: URI.escapeQuerySpace
13488
+ };
13489
+ };
13490
+ URI.preventInvalidHostname = false;
13491
+ URI.duplicateQueryParameters = false;
13492
+ URI.escapeQuerySpace = true;
13493
+ URI.protocol_expression = /^[a-z][a-z0-9.+-]*$/i;
13494
+ URI.idn_expression = /[^a-z0-9\._-]/i;
13495
+ URI.punycode_expression = /(xn--)/i;
13496
+ URI.ip4_expression = /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/;
13497
+ URI.ip6_expression = /^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/;
13498
+ URI.find_uri_expression = /\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/ig;
13499
+ URI.findUri = {
13500
+ // valid "scheme://" or "www."
13501
+ start: /\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,
13502
+ // everything up to the next whitespace
13503
+ end: /[\s\r\n]|$/,
13504
+ // trim trailing punctuation captured by end RegExp
13505
+ trim: /[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,
13506
+ // balanced parens inclusion (), [], {}, <>
13507
+ parens: /(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g
13508
+ };
13509
+ URI.leading_whitespace_expression = /^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/;
13510
+ URI.ascii_tab_whitespace = /[\u0009\u000A\u000D]+/g;
13511
+ URI.defaultPorts = {
13512
+ http: "80",
13513
+ https: "443",
13514
+ ftp: "21",
13515
+ gopher: "70",
13516
+ ws: "80",
13517
+ wss: "443"
13518
+ };
13519
+ URI.hostProtocols = [
13520
+ "http",
13521
+ "https"
13522
+ ];
13523
+ URI.invalid_hostname_characters = /[^a-zA-Z0-9\.\-:_]/;
13524
+ URI.domAttributes = {
13525
+ "a": "href",
13526
+ "blockquote": "cite",
13527
+ "link": "href",
13528
+ "base": "href",
13529
+ "script": "src",
13530
+ "form": "action",
13531
+ "img": "src",
13532
+ "area": "href",
13533
+ "iframe": "src",
13534
+ "embed": "src",
13535
+ "source": "src",
13536
+ "track": "src",
13537
+ "input": "src",
13538
+ // but only if type="image"
13539
+ "audio": "src",
13540
+ "video": "src"
13541
+ };
13542
+ URI.getDomAttribute = function(node) {
13543
+ if (!node || !node.nodeName) {
13544
+ return void 0;
13545
+ }
13546
+ var nodeName = node.nodeName.toLowerCase();
13547
+ if (nodeName === "input" && node.type !== "image") {
13548
+ return void 0;
13549
+ }
13550
+ return URI.domAttributes[nodeName];
13551
+ };
13552
+ function escapeForDumbFirefox36(value) {
13553
+ return escape(value);
13554
+ }
13555
+ function strictEncodeURIComponent(string) {
13556
+ return encodeURIComponent(string).replace(/[!'()*]/g, escapeForDumbFirefox36).replace(/\*/g, "%2A");
13557
+ }
13558
+ URI.encode = strictEncodeURIComponent;
13559
+ URI.decode = decodeURIComponent;
13560
+ URI.iso8859 = function() {
13561
+ URI.encode = escape;
13562
+ URI.decode = unescape;
13563
+ };
13564
+ URI.unicode = function() {
13565
+ URI.encode = strictEncodeURIComponent;
13566
+ URI.decode = decodeURIComponent;
13567
+ };
13568
+ URI.characters = {
13569
+ pathname: {
13570
+ encode: {
13571
+ // RFC3986 2.1: For consistency, URI producers and normalizers should
13572
+ // use uppercase hexadecimal digits for all percent-encodings.
13573
+ expression: /%(24|26|2B|2C|3B|3D|3A|40)/ig,
13574
+ map: {
13575
+ // -._~!'()*
13576
+ "%24": "$",
13577
+ "%26": "&",
13578
+ "%2B": "+",
13579
+ "%2C": ",",
13580
+ "%3B": ";",
13581
+ "%3D": "=",
13582
+ "%3A": ":",
13583
+ "%40": "@"
13584
+ }
13585
+ },
13586
+ decode: {
13587
+ expression: /[\/\?#]/g,
13588
+ map: {
13589
+ "/": "%2F",
13590
+ "?": "%3F",
13591
+ "#": "%23"
13592
+ }
13593
+ }
13594
+ },
13595
+ reserved: {
13596
+ encode: {
13597
+ // RFC3986 2.1: For consistency, URI producers and normalizers should
13598
+ // use uppercase hexadecimal digits for all percent-encodings.
13599
+ expression: /%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,
13600
+ map: {
13601
+ // gen-delims
13602
+ "%3A": ":",
13603
+ "%2F": "/",
13604
+ "%3F": "?",
13605
+ "%23": "#",
13606
+ "%5B": "[",
13607
+ "%5D": "]",
13608
+ "%40": "@",
13609
+ // sub-delims
13610
+ "%21": "!",
13611
+ "%24": "$",
13612
+ "%26": "&",
13613
+ "%27": "'",
13614
+ "%28": "(",
13615
+ "%29": ")",
13616
+ "%2A": "*",
13617
+ "%2B": "+",
13618
+ "%2C": ",",
13619
+ "%3B": ";",
13620
+ "%3D": "="
13621
+ }
13622
+ }
13623
+ },
13624
+ urnpath: {
13625
+ // The characters under `encode` are the characters called out by RFC 2141 as being acceptable
13626
+ // for usage in a URN. RFC2141 also calls out "-", ".", and "_" as acceptable characters, but
13627
+ // these aren't encoded by encodeURIComponent, so we don't have to call them out here. Also
13628
+ // note that the colon character is not featured in the encoding map; this is because URI.js
13629
+ // gives the colons in URNs semantic meaning as the delimiters of path segements, and so it
13630
+ // should not appear unencoded in a segment itself.
13631
+ // See also the note above about RFC3986 and capitalalized hex digits.
13632
+ encode: {
13633
+ expression: /%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,
13634
+ map: {
13635
+ "%21": "!",
13636
+ "%24": "$",
13637
+ "%27": "'",
13638
+ "%28": "(",
13639
+ "%29": ")",
13640
+ "%2A": "*",
13641
+ "%2B": "+",
13642
+ "%2C": ",",
13643
+ "%3B": ";",
13644
+ "%3D": "=",
13645
+ "%40": "@"
13646
+ }
13647
+ },
13648
+ // These characters are the characters called out by RFC2141 as "reserved" characters that
13649
+ // should never appear in a URN, plus the colon character (see note above).
13650
+ decode: {
13651
+ expression: /[\/\?#:]/g,
13652
+ map: {
13653
+ "/": "%2F",
13654
+ "?": "%3F",
13655
+ "#": "%23",
13656
+ ":": "%3A"
13657
+ }
13658
+ }
13659
+ }
13660
+ };
13661
+ URI.encodeQuery = function(string, escapeQuerySpace) {
13662
+ var escaped = URI.encode(string + "");
13663
+ if (escapeQuerySpace === void 0) {
13664
+ escapeQuerySpace = URI.escapeQuerySpace;
13665
+ }
13666
+ return escapeQuerySpace ? escaped.replace(/%20/g, "+") : escaped;
13667
+ };
13668
+ URI.decodeQuery = function(string, escapeQuerySpace) {
13669
+ string += "";
13670
+ if (escapeQuerySpace === void 0) {
13671
+ escapeQuerySpace = URI.escapeQuerySpace;
13672
+ }
13673
+ try {
13674
+ return URI.decode(escapeQuerySpace ? string.replace(/\+/g, "%20") : string);
13675
+ } catch (e) {
13676
+ return string;
13677
+ }
13678
+ };
13679
+ var _parts = { "encode": "encode", "decode": "decode" };
13680
+ var _part;
13681
+ var generateAccessor = function(_group, _part2) {
13682
+ return function(string) {
13683
+ try {
13684
+ return URI[_part2](string + "").replace(URI.characters[_group][_part2].expression, function(c) {
13685
+ return URI.characters[_group][_part2].map[c];
13686
+ });
13687
+ } catch (e) {
13688
+ return string;
13689
+ }
13690
+ };
13691
+ };
13692
+ for (_part in _parts) {
13693
+ URI[_part + "PathSegment"] = generateAccessor("pathname", _parts[_part]);
13694
+ URI[_part + "UrnPathSegment"] = generateAccessor("urnpath", _parts[_part]);
13695
+ }
13696
+ var generateSegmentedPathFunction = function(_sep, _codingFuncName, _innerCodingFuncName) {
13697
+ return function(string) {
13698
+ var actualCodingFunc;
13699
+ if (!_innerCodingFuncName) {
13700
+ actualCodingFunc = URI[_codingFuncName];
13701
+ } else {
13702
+ actualCodingFunc = function(string2) {
13703
+ return URI[_codingFuncName](URI[_innerCodingFuncName](string2));
13704
+ };
13705
+ }
13706
+ var segments = (string + "").split(_sep);
13707
+ for (var i = 0, length = segments.length; i < length; i++) {
13708
+ segments[i] = actualCodingFunc(segments[i]);
13709
+ }
13710
+ return segments.join(_sep);
13711
+ };
13712
+ };
13713
+ URI.decodePath = generateSegmentedPathFunction("/", "decodePathSegment");
13714
+ URI.decodeUrnPath = generateSegmentedPathFunction(":", "decodeUrnPathSegment");
13715
+ URI.recodePath = generateSegmentedPathFunction("/", "encodePathSegment", "decode");
13716
+ URI.recodeUrnPath = generateSegmentedPathFunction(":", "encodeUrnPathSegment", "decode");
13717
+ URI.encodeReserved = generateAccessor("reserved", "encode");
13718
+ URI.parse = function(string, parts) {
13719
+ var pos;
13720
+ if (!parts) {
13721
+ parts = {
13722
+ preventInvalidHostname: URI.preventInvalidHostname
13723
+ };
13724
+ }
13725
+ string = string.replace(URI.leading_whitespace_expression, "");
13726
+ string = string.replace(URI.ascii_tab_whitespace, "");
13727
+ pos = string.indexOf("#");
13728
+ if (pos > -1) {
13729
+ parts.fragment = string.substring(pos + 1) || null;
13730
+ string = string.substring(0, pos);
13731
+ }
13732
+ pos = string.indexOf("?");
13733
+ if (pos > -1) {
13734
+ parts.query = string.substring(pos + 1) || null;
13735
+ string = string.substring(0, pos);
13736
+ }
13737
+ string = string.replace(/^(https?|ftp|wss?)?:+[/\\]*/i, "$1://");
13738
+ string = string.replace(/^[/\\]{2,}/i, "//");
13739
+ if (string.substring(0, 2) === "//") {
13740
+ parts.protocol = null;
13741
+ string = string.substring(2);
13742
+ string = URI.parseAuthority(string, parts);
13743
+ } else {
13744
+ pos = string.indexOf(":");
13745
+ if (pos > -1) {
13746
+ parts.protocol = string.substring(0, pos) || null;
13747
+ if (parts.protocol && !parts.protocol.match(URI.protocol_expression)) {
13748
+ parts.protocol = void 0;
13749
+ } else if (string.substring(pos + 1, pos + 3).replace(/\\/g, "/") === "//") {
13750
+ string = string.substring(pos + 3);
13751
+ string = URI.parseAuthority(string, parts);
13752
+ } else {
13753
+ string = string.substring(pos + 1);
13754
+ parts.urn = true;
13755
+ }
13756
+ }
13757
+ }
13758
+ parts.path = string;
13759
+ return parts;
13760
+ };
13761
+ URI.parseHost = function(string, parts) {
13762
+ if (!string) {
13763
+ string = "";
13764
+ }
13765
+ string = string.replace(/\\/g, "/");
13766
+ var pos = string.indexOf("/");
13767
+ var bracketPos;
13768
+ var t;
13769
+ if (pos === -1) {
13770
+ pos = string.length;
13771
+ }
13772
+ if (string.charAt(0) === "[") {
13773
+ bracketPos = string.indexOf("]");
13774
+ parts.hostname = string.substring(1, bracketPos) || null;
13775
+ parts.port = string.substring(bracketPos + 2, pos) || null;
13776
+ if (parts.port === "/") {
13777
+ parts.port = null;
13778
+ }
13779
+ } else {
13780
+ var firstColon = string.indexOf(":");
13781
+ var firstSlash = string.indexOf("/");
13782
+ var nextColon = string.indexOf(":", firstColon + 1);
13783
+ if (nextColon !== -1 && (firstSlash === -1 || nextColon < firstSlash)) {
13784
+ parts.hostname = string.substring(0, pos) || null;
13785
+ parts.port = null;
13786
+ } else {
13787
+ t = string.substring(0, pos).split(":");
13788
+ parts.hostname = t[0] || null;
13789
+ parts.port = t[1] || null;
13790
+ }
13791
+ }
13792
+ if (parts.hostname && string.substring(pos).charAt(0) !== "/") {
13793
+ pos++;
13794
+ string = "/" + string;
13795
+ }
13796
+ if (parts.preventInvalidHostname) {
13797
+ URI.ensureValidHostname(parts.hostname, parts.protocol);
13798
+ }
13799
+ if (parts.port) {
13800
+ URI.ensureValidPort(parts.port);
13801
+ }
13802
+ return string.substring(pos) || "/";
13803
+ };
13804
+ URI.parseAuthority = function(string, parts) {
13805
+ string = URI.parseUserinfo(string, parts);
13806
+ return URI.parseHost(string, parts);
13807
+ };
13808
+ URI.parseUserinfo = function(string, parts) {
13809
+ var _string = string;
13810
+ var firstBackSlash = string.indexOf("\\");
13811
+ if (firstBackSlash !== -1) {
13812
+ string = string.replace(/\\/g, "/");
13813
+ }
13814
+ var firstSlash = string.indexOf("/");
13815
+ var pos = string.lastIndexOf("@", firstSlash > -1 ? firstSlash : string.length - 1);
13816
+ var t;
13817
+ if (pos > -1 && (firstSlash === -1 || pos < firstSlash)) {
13818
+ t = string.substring(0, pos).split(":");
13819
+ parts.username = t[0] ? URI.decode(t[0]) : null;
13820
+ t.shift();
13821
+ parts.password = t[0] ? URI.decode(t.join(":")) : null;
13822
+ string = _string.substring(pos + 1);
13823
+ } else {
13824
+ parts.username = null;
13825
+ parts.password = null;
13826
+ }
13827
+ return string;
13828
+ };
13829
+ URI.parseQuery = function(string, escapeQuerySpace) {
13830
+ if (!string) {
13831
+ return {};
13832
+ }
13833
+ string = string.replace(/&+/g, "&").replace(/^\?*&*|&+$/g, "");
13834
+ if (!string) {
13835
+ return {};
13836
+ }
13837
+ var items = {};
13838
+ var splits = string.split("&");
13839
+ var length = splits.length;
13840
+ var v, name, value;
13841
+ for (var i = 0; i < length; i++) {
13842
+ v = splits[i].split("=");
13843
+ name = URI.decodeQuery(v.shift(), escapeQuerySpace);
13844
+ value = v.length ? URI.decodeQuery(v.join("="), escapeQuerySpace) : null;
13845
+ if (name === "__proto__") {
13846
+ continue;
13847
+ } else if (hasOwn.call(items, name)) {
13848
+ if (typeof items[name] === "string" || items[name] === null) {
13849
+ items[name] = [items[name]];
13850
+ }
13851
+ items[name].push(value);
13852
+ } else {
13853
+ items[name] = value;
13854
+ }
13855
+ }
13856
+ return items;
13857
+ };
13858
+ URI.build = function(parts) {
13859
+ var t = "";
13860
+ var requireAbsolutePath = false;
13861
+ if (parts.protocol) {
13862
+ t += parts.protocol + ":";
13863
+ }
13864
+ if (!parts.urn && (t || parts.hostname)) {
13865
+ t += "//";
13866
+ requireAbsolutePath = true;
13867
+ }
13868
+ t += URI.buildAuthority(parts) || "";
13869
+ if (typeof parts.path === "string") {
13870
+ if (parts.path.charAt(0) !== "/" && requireAbsolutePath) {
13871
+ t += "/";
13872
+ }
13873
+ t += parts.path;
13874
+ }
13875
+ if (typeof parts.query === "string" && parts.query) {
13876
+ t += "?" + parts.query;
13877
+ }
13878
+ if (typeof parts.fragment === "string" && parts.fragment) {
13879
+ t += "#" + parts.fragment;
13880
+ }
13881
+ return t;
13882
+ };
13883
+ URI.buildHost = function(parts) {
13884
+ var t = "";
13885
+ if (!parts.hostname) {
13886
+ return "";
13887
+ } else if (URI.ip6_expression.test(parts.hostname)) {
13888
+ t += "[" + parts.hostname + "]";
13889
+ } else {
13890
+ t += parts.hostname;
13891
+ }
13892
+ if (parts.port) {
13893
+ t += ":" + parts.port;
13894
+ }
13895
+ return t;
13896
+ };
13897
+ URI.buildAuthority = function(parts) {
13898
+ return URI.buildUserinfo(parts) + URI.buildHost(parts);
13899
+ };
13900
+ URI.buildUserinfo = function(parts) {
13901
+ var t = "";
13902
+ if (parts.username) {
13903
+ t += URI.encode(parts.username);
13904
+ }
13905
+ if (parts.password) {
13906
+ t += ":" + URI.encode(parts.password);
13907
+ }
13908
+ if (t) {
13909
+ t += "@";
13910
+ }
13911
+ return t;
13912
+ };
13913
+ URI.buildQuery = function(data, duplicateQueryParameters, escapeQuerySpace) {
13914
+ var t = "";
13915
+ var unique, key, i, length;
13916
+ for (key in data) {
13917
+ if (key === "__proto__") {
13918
+ continue;
13919
+ } else if (hasOwn.call(data, key)) {
13920
+ if (isArray(data[key])) {
13921
+ unique = {};
13922
+ for (i = 0, length = data[key].length; i < length; i++) {
13923
+ if (data[key][i] !== void 0 && unique[data[key][i] + ""] === void 0) {
13924
+ t += "&" + URI.buildQueryParameter(key, data[key][i], escapeQuerySpace);
13925
+ if (duplicateQueryParameters !== true) {
13926
+ unique[data[key][i] + ""] = true;
13927
+ }
13928
+ }
13929
+ }
13930
+ } else if (data[key] !== void 0) {
13931
+ t += "&" + URI.buildQueryParameter(key, data[key], escapeQuerySpace);
13932
+ }
13933
+ }
13934
+ }
13935
+ return t.substring(1);
13936
+ };
13937
+ URI.buildQueryParameter = function(name, value, escapeQuerySpace) {
13938
+ return URI.encodeQuery(name, escapeQuerySpace) + (value !== null ? "=" + URI.encodeQuery(value, escapeQuerySpace) : "");
13939
+ };
13940
+ URI.addQuery = function(data, name, value) {
13941
+ if (typeof name === "object") {
13942
+ for (var key in name) {
13943
+ if (hasOwn.call(name, key)) {
13944
+ URI.addQuery(data, key, name[key]);
13945
+ }
13946
+ }
13947
+ } else if (typeof name === "string") {
13948
+ if (data[name] === void 0) {
13949
+ data[name] = value;
13950
+ return;
13951
+ } else if (typeof data[name] === "string") {
13952
+ data[name] = [data[name]];
13953
+ }
13954
+ if (!isArray(value)) {
13955
+ value = [value];
13956
+ }
13957
+ data[name] = (data[name] || []).concat(value);
13958
+ } else {
13959
+ throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");
13960
+ }
13961
+ };
13962
+ URI.setQuery = function(data, name, value) {
13963
+ if (typeof name === "object") {
13964
+ for (var key in name) {
13965
+ if (hasOwn.call(name, key)) {
13966
+ URI.setQuery(data, key, name[key]);
13967
+ }
13968
+ }
13969
+ } else if (typeof name === "string") {
13970
+ data[name] = value === void 0 ? null : value;
13971
+ } else {
13972
+ throw new TypeError("URI.setQuery() accepts an object, string as the name parameter");
13973
+ }
13974
+ };
13975
+ URI.removeQuery = function(data, name, value) {
13976
+ var i, length, key;
13977
+ if (isArray(name)) {
13978
+ for (i = 0, length = name.length; i < length; i++) {
13979
+ data[name[i]] = void 0;
13980
+ }
13981
+ } else if (getType(name) === "RegExp") {
13982
+ for (key in data) {
13983
+ if (name.test(key)) {
13984
+ data[key] = void 0;
13985
+ }
13986
+ }
13987
+ } else if (typeof name === "object") {
13988
+ for (key in name) {
13989
+ if (hasOwn.call(name, key)) {
13990
+ URI.removeQuery(data, key, name[key]);
13991
+ }
13992
+ }
13993
+ } else if (typeof name === "string") {
13994
+ if (value !== void 0) {
13995
+ if (getType(value) === "RegExp") {
13996
+ if (!isArray(data[name]) && value.test(data[name])) {
13997
+ data[name] = void 0;
13998
+ } else {
13999
+ data[name] = filterArrayValues(data[name], value);
14000
+ }
14001
+ } else if (data[name] === String(value) && (!isArray(value) || value.length === 1)) {
14002
+ data[name] = void 0;
14003
+ } else if (isArray(data[name])) {
14004
+ data[name] = filterArrayValues(data[name], value);
14005
+ }
14006
+ } else {
14007
+ data[name] = void 0;
14008
+ }
14009
+ } else {
14010
+ throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter");
14011
+ }
14012
+ };
14013
+ URI.hasQuery = function(data, name, value, withinArray) {
14014
+ switch (getType(name)) {
14015
+ case "String":
14016
+ break;
14017
+ case "RegExp":
14018
+ for (var key in data) {
14019
+ if (hasOwn.call(data, key)) {
14020
+ if (name.test(key) && (value === void 0 || URI.hasQuery(data, key, value))) {
14021
+ return true;
14022
+ }
14023
+ }
14024
+ }
14025
+ return false;
14026
+ case "Object":
14027
+ for (var _key in name) {
14028
+ if (hasOwn.call(name, _key)) {
14029
+ if (!URI.hasQuery(data, _key, name[_key])) {
14030
+ return false;
14031
+ }
14032
+ }
14033
+ }
14034
+ return true;
14035
+ default:
14036
+ throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter");
14037
+ }
14038
+ switch (getType(value)) {
14039
+ case "Undefined":
14040
+ return name in data;
14041
+ case "Boolean":
14042
+ var _booly = Boolean(isArray(data[name]) ? data[name].length : data[name]);
14043
+ return value === _booly;
14044
+ case "Function":
14045
+ return !!value(data[name], name, data);
14046
+ case "Array":
14047
+ if (!isArray(data[name])) {
14048
+ return false;
14049
+ }
14050
+ var op = withinArray ? arrayContains : arraysEqual;
14051
+ return op(data[name], value);
14052
+ case "RegExp":
14053
+ if (!isArray(data[name])) {
14054
+ return Boolean(data[name] && data[name].match(value));
14055
+ }
14056
+ if (!withinArray) {
14057
+ return false;
14058
+ }
14059
+ return arrayContains(data[name], value);
14060
+ case "Number":
14061
+ value = String(value);
14062
+ case "String":
14063
+ if (!isArray(data[name])) {
14064
+ return data[name] === value;
14065
+ }
14066
+ if (!withinArray) {
14067
+ return false;
14068
+ }
14069
+ return arrayContains(data[name], value);
14070
+ default:
14071
+ throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter");
14072
+ }
14073
+ };
14074
+ URI.joinPaths = function() {
14075
+ var input = [];
14076
+ var segments = [];
14077
+ var nonEmptySegments = 0;
14078
+ for (var i = 0; i < arguments.length; i++) {
14079
+ var url2 = new URI(arguments[i]);
14080
+ input.push(url2);
14081
+ var _segments = url2.segment();
14082
+ for (var s = 0; s < _segments.length; s++) {
14083
+ if (typeof _segments[s] === "string") {
14084
+ segments.push(_segments[s]);
14085
+ }
14086
+ if (_segments[s]) {
14087
+ nonEmptySegments++;
14088
+ }
14089
+ }
14090
+ }
14091
+ if (!segments.length || !nonEmptySegments) {
14092
+ return new URI("");
14093
+ }
14094
+ var uri = new URI("").segment(segments);
14095
+ if (input[0].path() === "" || input[0].path().slice(0, 1) === "/") {
14096
+ uri.path("/" + uri.path());
14097
+ }
14098
+ return uri.normalize();
14099
+ };
14100
+ URI.commonPath = function(one, two) {
14101
+ var length = Math.min(one.length, two.length);
14102
+ var pos;
14103
+ for (pos = 0; pos < length; pos++) {
14104
+ if (one.charAt(pos) !== two.charAt(pos)) {
14105
+ pos--;
14106
+ break;
14107
+ }
14108
+ }
14109
+ if (pos < 1) {
14110
+ return one.charAt(0) === two.charAt(0) && one.charAt(0) === "/" ? "/" : "";
14111
+ }
14112
+ if (one.charAt(pos) !== "/" || two.charAt(pos) !== "/") {
14113
+ pos = one.substring(0, pos).lastIndexOf("/");
14114
+ }
14115
+ return one.substring(0, pos + 1);
14116
+ };
14117
+ URI.withinString = function(string, callback, options) {
14118
+ options || (options = {});
14119
+ var _start = options.start || URI.findUri.start;
14120
+ var _end = options.end || URI.findUri.end;
14121
+ var _trim = options.trim || URI.findUri.trim;
14122
+ var _parens = options.parens || URI.findUri.parens;
14123
+ var _attributeOpen = /[a-z0-9-]=["']?$/i;
14124
+ _start.lastIndex = 0;
14125
+ while (true) {
14126
+ var match = _start.exec(string);
14127
+ if (!match) {
14128
+ break;
14129
+ }
14130
+ var start = match.index;
14131
+ if (options.ignoreHtml) {
14132
+ var attributeOpen = string.slice(Math.max(start - 3, 0), start);
14133
+ if (attributeOpen && _attributeOpen.test(attributeOpen)) {
14134
+ continue;
14135
+ }
14136
+ }
14137
+ var end = start + string.slice(start).search(_end);
14138
+ var slice = string.slice(start, end);
14139
+ var parensEnd = -1;
14140
+ while (true) {
14141
+ var parensMatch = _parens.exec(slice);
14142
+ if (!parensMatch) {
14143
+ break;
14144
+ }
14145
+ var parensMatchEnd = parensMatch.index + parensMatch[0].length;
14146
+ parensEnd = Math.max(parensEnd, parensMatchEnd);
14147
+ }
14148
+ if (parensEnd > -1) {
14149
+ slice = slice.slice(0, parensEnd) + slice.slice(parensEnd).replace(_trim, "");
14150
+ } else {
14151
+ slice = slice.replace(_trim, "");
14152
+ }
14153
+ if (slice.length <= match[0].length) {
14154
+ continue;
14155
+ }
14156
+ if (options.ignore && options.ignore.test(slice)) {
14157
+ continue;
14158
+ }
14159
+ end = start + slice.length;
14160
+ var result = callback(slice, start, end, string);
14161
+ if (result === void 0) {
14162
+ _start.lastIndex = end;
14163
+ continue;
14164
+ }
14165
+ result = String(result);
14166
+ string = string.slice(0, start) + result + string.slice(end);
14167
+ _start.lastIndex = start + result.length;
14168
+ }
14169
+ _start.lastIndex = 0;
14170
+ return string;
14171
+ };
14172
+ URI.ensureValidHostname = function(v, protocol) {
14173
+ var hasHostname = !!v;
14174
+ var hasProtocol = !!protocol;
14175
+ var rejectEmptyHostname = false;
14176
+ if (hasProtocol) {
14177
+ rejectEmptyHostname = arrayContains(URI.hostProtocols, protocol);
14178
+ }
14179
+ if (rejectEmptyHostname && !hasHostname) {
14180
+ throw new TypeError("Hostname cannot be empty, if protocol is " + protocol);
14181
+ } else if (v && v.match(URI.invalid_hostname_characters)) {
14182
+ if (!punycode) {
14183
+ throw new TypeError('Hostname "' + v + '" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');
14184
+ }
14185
+ if (punycode.toASCII(v).match(URI.invalid_hostname_characters)) {
14186
+ throw new TypeError('Hostname "' + v + '" contains characters other than [A-Z0-9.-:_]');
14187
+ }
14188
+ }
14189
+ };
14190
+ URI.ensureValidPort = function(v) {
14191
+ if (!v) {
14192
+ return;
14193
+ }
14194
+ var port = Number(v);
14195
+ if (isInteger(port) && port > 0 && port < 65536) {
14196
+ return;
14197
+ }
14198
+ throw new TypeError('Port "' + v + '" is not a valid port');
14199
+ };
14200
+ URI.noConflict = function(removeAll) {
14201
+ if (removeAll) {
14202
+ var unconflicted = {
14203
+ URI: this.noConflict()
14204
+ };
14205
+ if (root.URITemplate && typeof root.URITemplate.noConflict === "function") {
14206
+ unconflicted.URITemplate = root.URITemplate.noConflict();
14207
+ }
14208
+ if (root.IPv6 && typeof root.IPv6.noConflict === "function") {
14209
+ unconflicted.IPv6 = root.IPv6.noConflict();
14210
+ }
14211
+ if (root.SecondLevelDomains && typeof root.SecondLevelDomains.noConflict === "function") {
14212
+ unconflicted.SecondLevelDomains = root.SecondLevelDomains.noConflict();
14213
+ }
14214
+ return unconflicted;
14215
+ } else if (root.URI === this) {
14216
+ root.URI = _URI;
14217
+ }
14218
+ return this;
14219
+ };
14220
+ p.build = function(deferBuild) {
14221
+ if (deferBuild === true) {
14222
+ this._deferred_build = true;
14223
+ } else if (deferBuild === void 0 || this._deferred_build) {
14224
+ this._string = URI.build(this._parts);
14225
+ this._deferred_build = false;
14226
+ }
14227
+ return this;
14228
+ };
14229
+ p.clone = function() {
14230
+ return new URI(this);
14231
+ };
14232
+ p.valueOf = p.toString = function() {
14233
+ return this.build(false)._string;
14234
+ };
14235
+ function generateSimpleAccessor(_part2) {
14236
+ return function(v, build) {
14237
+ if (v === void 0) {
14238
+ return this._parts[_part2] || "";
14239
+ } else {
14240
+ this._parts[_part2] = v || null;
14241
+ this.build(!build);
14242
+ return this;
14243
+ }
14244
+ };
14245
+ }
14246
+ function generatePrefixAccessor(_part2, _key) {
14247
+ return function(v, build) {
14248
+ if (v === void 0) {
14249
+ return this._parts[_part2] || "";
14250
+ } else {
14251
+ if (v !== null) {
14252
+ v = v + "";
14253
+ if (v.charAt(0) === _key) {
14254
+ v = v.substring(1);
14255
+ }
14256
+ }
14257
+ this._parts[_part2] = v;
14258
+ this.build(!build);
14259
+ return this;
14260
+ }
14261
+ };
14262
+ }
14263
+ p.protocol = generateSimpleAccessor("protocol");
14264
+ p.username = generateSimpleAccessor("username");
14265
+ p.password = generateSimpleAccessor("password");
14266
+ p.hostname = generateSimpleAccessor("hostname");
14267
+ p.port = generateSimpleAccessor("port");
14268
+ p.query = generatePrefixAccessor("query", "?");
14269
+ p.fragment = generatePrefixAccessor("fragment", "#");
14270
+ p.search = function(v, build) {
14271
+ var t = this.query(v, build);
14272
+ return typeof t === "string" && t.length ? "?" + t : t;
14273
+ };
14274
+ p.hash = function(v, build) {
14275
+ var t = this.fragment(v, build);
14276
+ return typeof t === "string" && t.length ? "#" + t : t;
14277
+ };
14278
+ p.pathname = function(v, build) {
14279
+ if (v === void 0 || v === true) {
14280
+ var res = this._parts.path || (this._parts.hostname ? "/" : "");
14281
+ return v ? (this._parts.urn ? URI.decodeUrnPath : URI.decodePath)(res) : res;
14282
+ } else {
14283
+ if (this._parts.urn) {
14284
+ this._parts.path = v ? URI.recodeUrnPath(v) : "";
14285
+ } else {
14286
+ this._parts.path = v ? URI.recodePath(v) : "/";
14287
+ }
14288
+ this.build(!build);
14289
+ return this;
14290
+ }
14291
+ };
14292
+ p.path = p.pathname;
14293
+ p.href = function(href, build) {
14294
+ var key;
14295
+ if (href === void 0) {
14296
+ return this.toString();
14297
+ }
14298
+ this._string = "";
14299
+ this._parts = URI._parts();
14300
+ var _URI2 = href instanceof URI;
14301
+ var _object = typeof href === "object" && (href.hostname || href.path || href.pathname);
14302
+ if (href.nodeName) {
14303
+ var attribute = URI.getDomAttribute(href);
14304
+ href = href[attribute] || "";
14305
+ _object = false;
14306
+ }
14307
+ if (!_URI2 && _object && href.pathname !== void 0) {
14308
+ href = href.toString();
14309
+ }
14310
+ if (typeof href === "string" || href instanceof String) {
14311
+ this._parts = URI.parse(String(href), this._parts);
14312
+ } else if (_URI2 || _object) {
14313
+ var src = _URI2 ? href._parts : href;
14314
+ for (key in src) {
14315
+ if (key === "query") {
14316
+ continue;
14317
+ }
14318
+ if (hasOwn.call(this._parts, key)) {
14319
+ this._parts[key] = src[key];
14320
+ }
14321
+ }
14322
+ if (src.query) {
14323
+ this.query(src.query, false);
14324
+ }
14325
+ } else {
14326
+ throw new TypeError("invalid input");
14327
+ }
14328
+ this.build(!build);
14329
+ return this;
14330
+ };
14331
+ p.is = function(what) {
14332
+ var ip = false;
14333
+ var ip4 = false;
14334
+ var ip6 = false;
14335
+ var name = false;
14336
+ var sld = false;
14337
+ var idn = false;
14338
+ var punycode2 = false;
14339
+ var relative = !this._parts.urn;
14340
+ if (this._parts.hostname) {
14341
+ relative = false;
14342
+ ip4 = URI.ip4_expression.test(this._parts.hostname);
14343
+ ip6 = URI.ip6_expression.test(this._parts.hostname);
14344
+ ip = ip4 || ip6;
14345
+ name = !ip;
14346
+ sld = name && SLD && SLD.has(this._parts.hostname);
14347
+ idn = name && URI.idn_expression.test(this._parts.hostname);
14348
+ punycode2 = name && URI.punycode_expression.test(this._parts.hostname);
14349
+ }
14350
+ switch (what.toLowerCase()) {
14351
+ case "relative":
14352
+ return relative;
14353
+ case "absolute":
14354
+ return !relative;
14355
+ case "domain":
14356
+ case "name":
14357
+ return name;
14358
+ case "sld":
14359
+ return sld;
14360
+ case "ip":
14361
+ return ip;
14362
+ case "ip4":
14363
+ case "ipv4":
14364
+ case "inet4":
14365
+ return ip4;
14366
+ case "ip6":
14367
+ case "ipv6":
14368
+ case "inet6":
14369
+ return ip6;
14370
+ case "idn":
14371
+ return idn;
14372
+ case "url":
14373
+ return !this._parts.urn;
14374
+ case "urn":
14375
+ return !!this._parts.urn;
14376
+ case "punycode":
14377
+ return punycode2;
14378
+ }
14379
+ return null;
14380
+ };
14381
+ var _protocol = p.protocol;
14382
+ var _port = p.port;
14383
+ var _hostname = p.hostname;
14384
+ p.protocol = function(v, build) {
14385
+ if (v) {
14386
+ v = v.replace(/:(\/\/)?$/, "");
14387
+ if (!v.match(URI.protocol_expression)) {
14388
+ throw new TypeError('Protocol "' + v + `" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);
14389
+ }
14390
+ }
14391
+ return _protocol.call(this, v, build);
14392
+ };
14393
+ p.scheme = p.protocol;
14394
+ p.port = function(v, build) {
14395
+ if (this._parts.urn) {
14396
+ return v === void 0 ? "" : this;
14397
+ }
14398
+ if (v !== void 0) {
14399
+ if (v === 0) {
14400
+ v = null;
14401
+ }
14402
+ if (v) {
14403
+ v += "";
14404
+ if (v.charAt(0) === ":") {
14405
+ v = v.substring(1);
14406
+ }
14407
+ URI.ensureValidPort(v);
14408
+ }
14409
+ }
14410
+ return _port.call(this, v, build);
14411
+ };
14412
+ p.hostname = function(v, build) {
14413
+ if (this._parts.urn) {
14414
+ return v === void 0 ? "" : this;
14415
+ }
14416
+ if (v !== void 0) {
14417
+ var x = { preventInvalidHostname: this._parts.preventInvalidHostname };
14418
+ var res = URI.parseHost(v, x);
14419
+ if (res !== "/") {
14420
+ throw new TypeError('Hostname "' + v + '" contains characters other than [A-Z0-9.-]');
14421
+ }
14422
+ v = x.hostname;
14423
+ if (this._parts.preventInvalidHostname) {
14424
+ URI.ensureValidHostname(v, this._parts.protocol);
14425
+ }
14426
+ }
14427
+ return _hostname.call(this, v, build);
14428
+ };
14429
+ p.origin = function(v, build) {
14430
+ if (this._parts.urn) {
14431
+ return v === void 0 ? "" : this;
14432
+ }
14433
+ if (v === void 0) {
14434
+ var protocol = this.protocol();
14435
+ var authority = this.authority();
14436
+ if (!authority) {
14437
+ return "";
14438
+ }
14439
+ return (protocol ? protocol + "://" : "") + this.authority();
14440
+ } else {
14441
+ var origin = URI(v);
14442
+ this.protocol(origin.protocol()).authority(origin.authority()).build(!build);
14443
+ return this;
14444
+ }
14445
+ };
14446
+ p.host = function(v, build) {
14447
+ if (this._parts.urn) {
14448
+ return v === void 0 ? "" : this;
14449
+ }
14450
+ if (v === void 0) {
14451
+ return this._parts.hostname ? URI.buildHost(this._parts) : "";
14452
+ } else {
14453
+ var res = URI.parseHost(v, this._parts);
14454
+ if (res !== "/") {
14455
+ throw new TypeError('Hostname "' + v + '" contains characters other than [A-Z0-9.-]');
14456
+ }
14457
+ this.build(!build);
14458
+ return this;
14459
+ }
14460
+ };
14461
+ p.authority = function(v, build) {
14462
+ if (this._parts.urn) {
14463
+ return v === void 0 ? "" : this;
14464
+ }
14465
+ if (v === void 0) {
14466
+ return this._parts.hostname ? URI.buildAuthority(this._parts) : "";
14467
+ } else {
14468
+ var res = URI.parseAuthority(v, this._parts);
14469
+ if (res !== "/") {
14470
+ throw new TypeError('Hostname "' + v + '" contains characters other than [A-Z0-9.-]');
14471
+ }
14472
+ this.build(!build);
14473
+ return this;
14474
+ }
14475
+ };
14476
+ p.userinfo = function(v, build) {
14477
+ if (this._parts.urn) {
14478
+ return v === void 0 ? "" : this;
14479
+ }
14480
+ if (v === void 0) {
14481
+ var t = URI.buildUserinfo(this._parts);
14482
+ return t ? t.substring(0, t.length - 1) : t;
14483
+ } else {
14484
+ if (v[v.length - 1] !== "@") {
14485
+ v += "@";
14486
+ }
14487
+ URI.parseUserinfo(v, this._parts);
14488
+ this.build(!build);
14489
+ return this;
14490
+ }
14491
+ };
14492
+ p.resource = function(v, build) {
14493
+ var parts;
14494
+ if (v === void 0) {
14495
+ return this.path() + this.search() + this.hash();
14496
+ }
14497
+ parts = URI.parse(v);
14498
+ this._parts.path = parts.path;
14499
+ this._parts.query = parts.query;
14500
+ this._parts.fragment = parts.fragment;
14501
+ this.build(!build);
14502
+ return this;
14503
+ };
14504
+ p.subdomain = function(v, build) {
14505
+ if (this._parts.urn) {
14506
+ return v === void 0 ? "" : this;
14507
+ }
14508
+ if (v === void 0) {
14509
+ if (!this._parts.hostname || this.is("IP")) {
14510
+ return "";
14511
+ }
14512
+ var end = this._parts.hostname.length - this.domain().length - 1;
14513
+ return this._parts.hostname.substring(0, end) || "";
14514
+ } else {
14515
+ var e = this._parts.hostname.length - this.domain().length;
14516
+ var sub = this._parts.hostname.substring(0, e);
14517
+ var replace = new RegExp("^" + escapeRegEx(sub));
14518
+ if (v && v.charAt(v.length - 1) !== ".") {
14519
+ v += ".";
14520
+ }
14521
+ if (v.indexOf(":") !== -1) {
14522
+ throw new TypeError("Domains cannot contain colons");
14523
+ }
14524
+ if (v) {
14525
+ URI.ensureValidHostname(v, this._parts.protocol);
14526
+ }
14527
+ this._parts.hostname = this._parts.hostname.replace(replace, v);
14528
+ this.build(!build);
14529
+ return this;
14530
+ }
14531
+ };
14532
+ p.domain = function(v, build) {
14533
+ if (this._parts.urn) {
14534
+ return v === void 0 ? "" : this;
14535
+ }
14536
+ if (typeof v === "boolean") {
14537
+ build = v;
14538
+ v = void 0;
14539
+ }
14540
+ if (v === void 0) {
14541
+ if (!this._parts.hostname || this.is("IP")) {
14542
+ return "";
14543
+ }
14544
+ var t = this._parts.hostname.match(/\./g);
14545
+ if (t && t.length < 2) {
14546
+ return this._parts.hostname;
14547
+ }
14548
+ var end = this._parts.hostname.length - this.tld(build).length - 1;
14549
+ end = this._parts.hostname.lastIndexOf(".", end - 1) + 1;
14550
+ return this._parts.hostname.substring(end) || "";
14551
+ } else {
14552
+ if (!v) {
14553
+ throw new TypeError("cannot set domain empty");
14554
+ }
14555
+ if (v.indexOf(":") !== -1) {
14556
+ throw new TypeError("Domains cannot contain colons");
14557
+ }
14558
+ URI.ensureValidHostname(v, this._parts.protocol);
14559
+ if (!this._parts.hostname || this.is("IP")) {
14560
+ this._parts.hostname = v;
14561
+ } else {
14562
+ var replace = new RegExp(escapeRegEx(this.domain()) + "$");
14563
+ this._parts.hostname = this._parts.hostname.replace(replace, v);
14564
+ }
14565
+ this.build(!build);
14566
+ return this;
14567
+ }
14568
+ };
14569
+ p.tld = function(v, build) {
14570
+ if (this._parts.urn) {
14571
+ return v === void 0 ? "" : this;
14572
+ }
14573
+ if (typeof v === "boolean") {
14574
+ build = v;
14575
+ v = void 0;
14576
+ }
14577
+ if (v === void 0) {
14578
+ if (!this._parts.hostname || this.is("IP")) {
14579
+ return "";
14580
+ }
14581
+ var pos = this._parts.hostname.lastIndexOf(".");
14582
+ var tld = this._parts.hostname.substring(pos + 1);
14583
+ if (build !== true && SLD && SLD.list[tld.toLowerCase()]) {
14584
+ return SLD.get(this._parts.hostname) || tld;
14585
+ }
14586
+ return tld;
14587
+ } else {
14588
+ var replace;
14589
+ if (!v) {
14590
+ throw new TypeError("cannot set TLD empty");
14591
+ } else if (v.match(/[^a-zA-Z0-9-]/)) {
14592
+ if (SLD && SLD.is(v)) {
14593
+ replace = new RegExp(escapeRegEx(this.tld()) + "$");
14594
+ this._parts.hostname = this._parts.hostname.replace(replace, v);
14595
+ } else {
14596
+ throw new TypeError('TLD "' + v + '" contains characters other than [A-Z0-9]');
14597
+ }
14598
+ } else if (!this._parts.hostname || this.is("IP")) {
14599
+ throw new ReferenceError("cannot set TLD on non-domain host");
14600
+ } else {
14601
+ replace = new RegExp(escapeRegEx(this.tld()) + "$");
14602
+ this._parts.hostname = this._parts.hostname.replace(replace, v);
14603
+ }
14604
+ this.build(!build);
14605
+ return this;
14606
+ }
14607
+ };
14608
+ p.directory = function(v, build) {
14609
+ if (this._parts.urn) {
14610
+ return v === void 0 ? "" : this;
14611
+ }
14612
+ if (v === void 0 || v === true) {
14613
+ if (!this._parts.path && !this._parts.hostname) {
14614
+ return "";
14615
+ }
14616
+ if (this._parts.path === "/") {
14617
+ return "/";
14618
+ }
14619
+ var end = this._parts.path.length - this.filename().length - 1;
14620
+ var res = this._parts.path.substring(0, end) || (this._parts.hostname ? "/" : "");
14621
+ return v ? URI.decodePath(res) : res;
14622
+ } else {
14623
+ var e = this._parts.path.length - this.filename().length;
14624
+ var directory = this._parts.path.substring(0, e);
14625
+ var replace = new RegExp("^" + escapeRegEx(directory));
14626
+ if (!this.is("relative")) {
14627
+ if (!v) {
14628
+ v = "/";
14629
+ }
14630
+ if (v.charAt(0) !== "/") {
14631
+ v = "/" + v;
14632
+ }
14633
+ }
14634
+ if (v && v.charAt(v.length - 1) !== "/") {
14635
+ v += "/";
14636
+ }
14637
+ v = URI.recodePath(v);
14638
+ this._parts.path = this._parts.path.replace(replace, v);
14639
+ this.build(!build);
14640
+ return this;
14641
+ }
14642
+ };
14643
+ p.filename = function(v, build) {
14644
+ if (this._parts.urn) {
14645
+ return v === void 0 ? "" : this;
14646
+ }
14647
+ if (typeof v !== "string") {
14648
+ if (!this._parts.path || this._parts.path === "/") {
14649
+ return "";
14650
+ }
14651
+ var pos = this._parts.path.lastIndexOf("/");
14652
+ var res = this._parts.path.substring(pos + 1);
14653
+ return v ? URI.decodePathSegment(res) : res;
14654
+ } else {
14655
+ var mutatedDirectory = false;
14656
+ if (v.charAt(0) === "/") {
14657
+ v = v.substring(1);
14658
+ }
14659
+ if (v.match(/\.?\//)) {
14660
+ mutatedDirectory = true;
14661
+ }
14662
+ var replace = new RegExp(escapeRegEx(this.filename()) + "$");
14663
+ v = URI.recodePath(v);
14664
+ this._parts.path = this._parts.path.replace(replace, v);
14665
+ if (mutatedDirectory) {
14666
+ this.normalizePath(build);
14667
+ } else {
14668
+ this.build(!build);
14669
+ }
14670
+ return this;
14671
+ }
14672
+ };
14673
+ p.suffix = function(v, build) {
14674
+ if (this._parts.urn) {
14675
+ return v === void 0 ? "" : this;
14676
+ }
14677
+ if (v === void 0 || v === true) {
14678
+ if (!this._parts.path || this._parts.path === "/") {
14679
+ return "";
14680
+ }
14681
+ var filename = this.filename();
14682
+ var pos = filename.lastIndexOf(".");
14683
+ var s, res;
14684
+ if (pos === -1) {
14685
+ return "";
14686
+ }
14687
+ s = filename.substring(pos + 1);
14688
+ res = /^[a-z0-9%]+$/i.test(s) ? s : "";
14689
+ return v ? URI.decodePathSegment(res) : res;
14690
+ } else {
14691
+ if (v.charAt(0) === ".") {
14692
+ v = v.substring(1);
14693
+ }
14694
+ var suffix = this.suffix();
14695
+ var replace;
14696
+ if (!suffix) {
14697
+ if (!v) {
14698
+ return this;
14699
+ }
14700
+ this._parts.path += "." + URI.recodePath(v);
14701
+ } else if (!v) {
14702
+ replace = new RegExp(escapeRegEx("." + suffix) + "$");
14703
+ } else {
14704
+ replace = new RegExp(escapeRegEx(suffix) + "$");
14705
+ }
14706
+ if (replace) {
14707
+ v = URI.recodePath(v);
14708
+ this._parts.path = this._parts.path.replace(replace, v);
14709
+ }
14710
+ this.build(!build);
14711
+ return this;
14712
+ }
14713
+ };
14714
+ p.segment = function(segment, v, build) {
14715
+ var separator = this._parts.urn ? ":" : "/";
14716
+ var path2 = this.path();
14717
+ var absolute = path2.substring(0, 1) === "/";
14718
+ var segments = path2.split(separator);
14719
+ if (segment !== void 0 && typeof segment !== "number") {
14720
+ build = v;
14721
+ v = segment;
14722
+ segment = void 0;
14723
+ }
14724
+ if (segment !== void 0 && typeof segment !== "number") {
14725
+ throw new Error('Bad segment "' + segment + '", must be 0-based integer');
14726
+ }
14727
+ if (absolute) {
14728
+ segments.shift();
14729
+ }
14730
+ if (segment < 0) {
14731
+ segment = Math.max(segments.length + segment, 0);
14732
+ }
14733
+ if (v === void 0) {
14734
+ return segment === void 0 ? segments : segments[segment];
14735
+ } else if (segment === null || segments[segment] === void 0) {
14736
+ if (isArray(v)) {
14737
+ segments = [];
14738
+ for (var i = 0, l = v.length; i < l; i++) {
14739
+ if (!v[i].length && (!segments.length || !segments[segments.length - 1].length)) {
14740
+ continue;
14741
+ }
14742
+ if (segments.length && !segments[segments.length - 1].length) {
14743
+ segments.pop();
14744
+ }
14745
+ segments.push(trimSlashes(v[i]));
14746
+ }
14747
+ } else if (v || typeof v === "string") {
14748
+ v = trimSlashes(v);
14749
+ if (segments[segments.length - 1] === "") {
14750
+ segments[segments.length - 1] = v;
14751
+ } else {
14752
+ segments.push(v);
14753
+ }
14754
+ }
14755
+ } else {
14756
+ if (v) {
14757
+ segments[segment] = trimSlashes(v);
14758
+ } else {
14759
+ segments.splice(segment, 1);
14760
+ }
14761
+ }
14762
+ if (absolute) {
14763
+ segments.unshift("");
14764
+ }
14765
+ return this.path(segments.join(separator), build);
14766
+ };
14767
+ p.segmentCoded = function(segment, v, build) {
14768
+ var segments, i, l;
14769
+ if (typeof segment !== "number") {
14770
+ build = v;
14771
+ v = segment;
14772
+ segment = void 0;
14773
+ }
14774
+ if (v === void 0) {
14775
+ segments = this.segment(segment, v, build);
14776
+ if (!isArray(segments)) {
14777
+ segments = segments !== void 0 ? URI.decode(segments) : void 0;
14778
+ } else {
14779
+ for (i = 0, l = segments.length; i < l; i++) {
14780
+ segments[i] = URI.decode(segments[i]);
14781
+ }
14782
+ }
14783
+ return segments;
14784
+ }
14785
+ if (!isArray(v)) {
14786
+ v = typeof v === "string" || v instanceof String ? URI.encode(v) : v;
14787
+ } else {
14788
+ for (i = 0, l = v.length; i < l; i++) {
14789
+ v[i] = URI.encode(v[i]);
14790
+ }
14791
+ }
14792
+ return this.segment(segment, v, build);
14793
+ };
14794
+ var q = p.query;
14795
+ p.query = function(v, build) {
14796
+ if (v === true) {
14797
+ return URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);
14798
+ } else if (typeof v === "function") {
14799
+ var data = URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);
14800
+ var result = v.call(this, data);
14801
+ this._parts.query = URI.buildQuery(result || data, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace);
14802
+ this.build(!build);
14803
+ return this;
14804
+ } else if (v !== void 0 && typeof v !== "string") {
14805
+ this._parts.query = URI.buildQuery(v, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace);
14806
+ this.build(!build);
14807
+ return this;
14808
+ } else {
14809
+ return q.call(this, v, build);
14810
+ }
14811
+ };
14812
+ p.setQuery = function(name, value, build) {
14813
+ var data = URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);
14814
+ if (typeof name === "string" || name instanceof String) {
14815
+ data[name] = value !== void 0 ? value : null;
14816
+ } else if (typeof name === "object") {
14817
+ for (var key in name) {
14818
+ if (hasOwn.call(name, key)) {
14819
+ data[key] = name[key];
14820
+ }
14821
+ }
14822
+ } else {
14823
+ throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");
14824
+ }
14825
+ this._parts.query = URI.buildQuery(data, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace);
14826
+ if (typeof name !== "string") {
14827
+ build = value;
14828
+ }
14829
+ this.build(!build);
14830
+ return this;
14831
+ };
14832
+ p.addQuery = function(name, value, build) {
14833
+ var data = URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);
14834
+ URI.addQuery(data, name, value === void 0 ? null : value);
14835
+ this._parts.query = URI.buildQuery(data, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace);
14836
+ if (typeof name !== "string") {
14837
+ build = value;
14838
+ }
14839
+ this.build(!build);
14840
+ return this;
14841
+ };
14842
+ p.removeQuery = function(name, value, build) {
14843
+ var data = URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);
14844
+ URI.removeQuery(data, name, value);
14845
+ this._parts.query = URI.buildQuery(data, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace);
14846
+ if (typeof name !== "string") {
14847
+ build = value;
14848
+ }
14849
+ this.build(!build);
14850
+ return this;
14851
+ };
14852
+ p.hasQuery = function(name, value, withinArray) {
14853
+ var data = URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);
14854
+ return URI.hasQuery(data, name, value, withinArray);
14855
+ };
14856
+ p.setSearch = p.setQuery;
14857
+ p.addSearch = p.addQuery;
14858
+ p.removeSearch = p.removeQuery;
14859
+ p.hasSearch = p.hasQuery;
14860
+ p.normalize = function() {
14861
+ if (this._parts.urn) {
14862
+ return this.normalizeProtocol(false).normalizePath(false).normalizeQuery(false).normalizeFragment(false).build();
14863
+ }
14864
+ return this.normalizeProtocol(false).normalizeHostname(false).normalizePort(false).normalizePath(false).normalizeQuery(false).normalizeFragment(false).build();
14865
+ };
14866
+ p.normalizeProtocol = function(build) {
14867
+ if (typeof this._parts.protocol === "string") {
14868
+ this._parts.protocol = this._parts.protocol.toLowerCase();
14869
+ this.build(!build);
14870
+ }
14871
+ return this;
14872
+ };
14873
+ p.normalizeHostname = function(build) {
14874
+ if (this._parts.hostname) {
14875
+ if (this.is("IDN") && punycode) {
14876
+ this._parts.hostname = punycode.toASCII(this._parts.hostname);
14877
+ } else if (this.is("IPv6") && IPv6) {
14878
+ this._parts.hostname = IPv6.best(this._parts.hostname);
14879
+ }
14880
+ this._parts.hostname = this._parts.hostname.toLowerCase();
14881
+ this.build(!build);
14882
+ }
14883
+ return this;
14884
+ };
14885
+ p.normalizePort = function(build) {
14886
+ if (typeof this._parts.protocol === "string" && this._parts.port === URI.defaultPorts[this._parts.protocol]) {
14887
+ this._parts.port = null;
14888
+ this.build(!build);
14889
+ }
14890
+ return this;
14891
+ };
14892
+ p.normalizePath = function(build) {
14893
+ var _path = this._parts.path;
14894
+ if (!_path) {
14895
+ return this;
14896
+ }
14897
+ if (this._parts.urn) {
14898
+ this._parts.path = URI.recodeUrnPath(this._parts.path);
14899
+ this.build(!build);
14900
+ return this;
14901
+ }
14902
+ if (this._parts.path === "/") {
14903
+ return this;
14904
+ }
14905
+ _path = URI.recodePath(_path);
14906
+ var _was_relative;
14907
+ var _leadingParents = "";
14908
+ var _parent, _pos;
14909
+ if (_path.charAt(0) !== "/") {
14910
+ _was_relative = true;
14911
+ _path = "/" + _path;
14912
+ }
14913
+ if (_path.slice(-3) === "/.." || _path.slice(-2) === "/.") {
14914
+ _path += "/";
14915
+ }
14916
+ _path = _path.replace(/(\/(\.\/)+)|(\/\.$)/g, "/").replace(/\/{2,}/g, "/");
14917
+ if (_was_relative) {
14918
+ _leadingParents = _path.substring(1).match(/^(\.\.\/)+/) || "";
14919
+ if (_leadingParents) {
14920
+ _leadingParents = _leadingParents[0];
14921
+ }
14922
+ }
14923
+ while (true) {
14924
+ _parent = _path.search(/\/\.\.(\/|$)/);
14925
+ if (_parent === -1) {
14926
+ break;
14927
+ } else if (_parent === 0) {
14928
+ _path = _path.substring(3);
14929
+ continue;
14930
+ }
14931
+ _pos = _path.substring(0, _parent).lastIndexOf("/");
14932
+ if (_pos === -1) {
14933
+ _pos = _parent;
14934
+ }
14935
+ _path = _path.substring(0, _pos) + _path.substring(_parent + 3);
14936
+ }
14937
+ if (_was_relative && this.is("relative")) {
14938
+ _path = _leadingParents + _path.substring(1);
14939
+ }
14940
+ this._parts.path = _path;
14941
+ this.build(!build);
14942
+ return this;
14943
+ };
14944
+ p.normalizePathname = p.normalizePath;
14945
+ p.normalizeQuery = function(build) {
14946
+ if (typeof this._parts.query === "string") {
14947
+ if (!this._parts.query.length) {
14948
+ this._parts.query = null;
14949
+ } else {
14950
+ this.query(URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace));
14951
+ }
14952
+ this.build(!build);
14953
+ }
14954
+ return this;
14955
+ };
14956
+ p.normalizeFragment = function(build) {
14957
+ if (!this._parts.fragment) {
14958
+ this._parts.fragment = null;
14959
+ this.build(!build);
14960
+ }
14961
+ return this;
14962
+ };
14963
+ p.normalizeSearch = p.normalizeQuery;
14964
+ p.normalizeHash = p.normalizeFragment;
14965
+ p.iso8859 = function() {
14966
+ var e = URI.encode;
14967
+ var d = URI.decode;
14968
+ URI.encode = escape;
14969
+ URI.decode = decodeURIComponent;
14970
+ try {
14971
+ this.normalize();
14972
+ } finally {
14973
+ URI.encode = e;
14974
+ URI.decode = d;
14975
+ }
14976
+ return this;
14977
+ };
14978
+ p.unicode = function() {
14979
+ var e = URI.encode;
14980
+ var d = URI.decode;
14981
+ URI.encode = strictEncodeURIComponent;
14982
+ URI.decode = unescape;
14983
+ try {
14984
+ this.normalize();
14985
+ } finally {
14986
+ URI.encode = e;
14987
+ URI.decode = d;
14988
+ }
14989
+ return this;
14990
+ };
14991
+ p.readable = function() {
14992
+ var uri = this.clone();
14993
+ uri.username("").password("").normalize();
14994
+ var t = "";
14995
+ if (uri._parts.protocol) {
14996
+ t += uri._parts.protocol + "://";
14997
+ }
14998
+ if (uri._parts.hostname) {
14999
+ if (uri.is("punycode") && punycode) {
15000
+ t += punycode.toUnicode(uri._parts.hostname);
15001
+ if (uri._parts.port) {
15002
+ t += ":" + uri._parts.port;
15003
+ }
15004
+ } else {
15005
+ t += uri.host();
15006
+ }
15007
+ }
15008
+ if (uri._parts.hostname && uri._parts.path && uri._parts.path.charAt(0) !== "/") {
15009
+ t += "/";
15010
+ }
15011
+ t += uri.path(true);
15012
+ if (uri._parts.query) {
15013
+ var q2 = "";
15014
+ for (var i = 0, qp = uri._parts.query.split("&"), l = qp.length; i < l; i++) {
15015
+ var kv = (qp[i] || "").split("=");
15016
+ q2 += "&" + URI.decodeQuery(kv[0], this._parts.escapeQuerySpace).replace(/&/g, "%26");
15017
+ if (kv[1] !== void 0) {
15018
+ q2 += "=" + URI.decodeQuery(kv[1], this._parts.escapeQuerySpace).replace(/&/g, "%26");
15019
+ }
15020
+ }
15021
+ t += "?" + q2.substring(1);
15022
+ }
15023
+ t += URI.decodeQuery(uri.hash(), true);
15024
+ return t;
15025
+ };
15026
+ p.absoluteTo = function(base) {
15027
+ var resolved = this.clone();
15028
+ var properties = ["protocol", "username", "password", "hostname", "port"];
15029
+ var basedir, i, p2;
15030
+ if (this._parts.urn) {
15031
+ throw new Error("URNs do not have any generally defined hierarchical components");
15032
+ }
15033
+ if (!(base instanceof URI)) {
15034
+ base = new URI(base);
15035
+ }
15036
+ if (resolved._parts.protocol) {
15037
+ return resolved;
15038
+ } else {
15039
+ resolved._parts.protocol = base._parts.protocol;
15040
+ }
15041
+ if (this._parts.hostname) {
15042
+ return resolved;
15043
+ }
15044
+ for (i = 0; p2 = properties[i]; i++) {
15045
+ resolved._parts[p2] = base._parts[p2];
15046
+ }
15047
+ if (!resolved._parts.path) {
15048
+ resolved._parts.path = base._parts.path;
15049
+ if (!resolved._parts.query) {
15050
+ resolved._parts.query = base._parts.query;
15051
+ }
15052
+ } else {
15053
+ if (resolved._parts.path.substring(-2) === "..") {
15054
+ resolved._parts.path += "/";
15055
+ }
15056
+ if (resolved.path().charAt(0) !== "/") {
15057
+ basedir = base.directory();
15058
+ basedir = basedir ? basedir : base.path().indexOf("/") === 0 ? "/" : "";
15059
+ resolved._parts.path = (basedir ? basedir + "/" : "") + resolved._parts.path;
15060
+ resolved.normalizePath();
15061
+ }
15062
+ }
15063
+ resolved.build();
15064
+ return resolved;
15065
+ };
15066
+ p.relativeTo = function(base) {
15067
+ var relative = this.clone().normalize();
15068
+ var relativeParts, baseParts, common, relativePath, basePath;
15069
+ if (relative._parts.urn) {
15070
+ throw new Error("URNs do not have any generally defined hierarchical components");
15071
+ }
15072
+ base = new URI(base).normalize();
15073
+ relativeParts = relative._parts;
15074
+ baseParts = base._parts;
15075
+ relativePath = relative.path();
15076
+ basePath = base.path();
15077
+ if (relativePath.charAt(0) !== "/") {
15078
+ throw new Error("URI is already relative");
15079
+ }
15080
+ if (basePath.charAt(0) !== "/") {
15081
+ throw new Error("Cannot calculate a URI relative to another relative URI");
15082
+ }
15083
+ if (relativeParts.protocol === baseParts.protocol) {
15084
+ relativeParts.protocol = null;
15085
+ }
15086
+ if (relativeParts.username !== baseParts.username || relativeParts.password !== baseParts.password) {
15087
+ return relative.build();
15088
+ }
15089
+ if (relativeParts.protocol !== null || relativeParts.username !== null || relativeParts.password !== null) {
15090
+ return relative.build();
15091
+ }
15092
+ if (relativeParts.hostname === baseParts.hostname && relativeParts.port === baseParts.port) {
15093
+ relativeParts.hostname = null;
15094
+ relativeParts.port = null;
15095
+ } else {
15096
+ return relative.build();
15097
+ }
15098
+ if (relativePath === basePath) {
15099
+ relativeParts.path = "";
15100
+ return relative.build();
15101
+ }
15102
+ common = URI.commonPath(relativePath, basePath);
15103
+ if (!common) {
15104
+ return relative.build();
15105
+ }
15106
+ var parents = baseParts.path.substring(common.length).replace(/[^\/]*$/, "").replace(/.*?\//g, "../");
15107
+ relativeParts.path = parents + relativeParts.path.substring(common.length) || "./";
15108
+ return relative.build();
15109
+ };
15110
+ p.equals = function(uri) {
15111
+ var one = this.clone();
15112
+ var two = new URI(uri);
15113
+ var one_map = {};
15114
+ var two_map = {};
15115
+ var checked = {};
15116
+ var one_query, two_query, key;
15117
+ one.normalize();
15118
+ two.normalize();
15119
+ if (one.toString() === two.toString()) {
15120
+ return true;
15121
+ }
15122
+ one_query = one.query();
15123
+ two_query = two.query();
15124
+ one.query("");
15125
+ two.query("");
15126
+ if (one.toString() !== two.toString()) {
15127
+ return false;
15128
+ }
15129
+ if (one_query.length !== two_query.length) {
15130
+ return false;
15131
+ }
15132
+ one_map = URI.parseQuery(one_query, this._parts.escapeQuerySpace);
15133
+ two_map = URI.parseQuery(two_query, this._parts.escapeQuerySpace);
15134
+ for (key in one_map) {
15135
+ if (hasOwn.call(one_map, key)) {
15136
+ if (!isArray(one_map[key])) {
15137
+ if (one_map[key] !== two_map[key]) {
15138
+ return false;
15139
+ }
15140
+ } else if (!arraysEqual(one_map[key], two_map[key])) {
15141
+ return false;
15142
+ }
15143
+ checked[key] = true;
15144
+ }
15145
+ }
15146
+ for (key in two_map) {
15147
+ if (hasOwn.call(two_map, key)) {
15148
+ if (!checked[key]) {
15149
+ return false;
15150
+ }
15151
+ }
15152
+ }
15153
+ return true;
15154
+ };
15155
+ p.preventInvalidHostname = function(v) {
15156
+ this._parts.preventInvalidHostname = !!v;
15157
+ return this;
15158
+ };
15159
+ p.duplicateQueryParameters = function(v) {
15160
+ this._parts.duplicateQueryParameters = !!v;
15161
+ return this;
15162
+ };
15163
+ p.escapeQuerySpace = function(v) {
15164
+ this._parts.escapeQuerySpace = !!v;
15165
+ return this;
15166
+ };
15167
+ return URI;
15168
+ });
15169
+ }
15170
+ });
15171
+
15172
+ // src/index.ts
15173
+ init_cjs_shim();
15174
+
15175
+ // ../../magda-typescript-common/dist/util/arrayToMaybe.js
15176
+ init_cjs_shim();
15177
+
15178
+ // ../../node_modules/@magda/tsmonad/dist/index.js
15179
+ init_cjs_shim();
15180
+
15181
+ // ../../node_modules/@magda/tsmonad/dist/either.js
15182
+ init_cjs_shim();
15183
+
15184
+ // ../../node_modules/@magda/tsmonad/dist/monad.js
15185
+ init_cjs_shim();
15186
+ function eq(a, b) {
15187
+ var idx = 0;
15188
+ if (a === b) {
15189
+ return true;
15190
+ }
15191
+ if (typeof a.equals === "function") {
15192
+ return a.equals(b);
15193
+ }
15194
+ if (a.length > 0 && a.length === b.length) {
15195
+ for (; idx < a.length; idx += 1) {
15196
+ if (!eq(a[idx], b[idx])) {
15197
+ return false;
15198
+ }
15199
+ }
15200
+ return true;
15201
+ }
15202
+ return false;
15203
+ }
15204
+
15205
+ // ../../node_modules/@magda/tsmonad/dist/either.js
15206
+ var EitherType;
15207
+ (function(EitherType2) {
15208
+ EitherType2[EitherType2["Left"] = 0] = "Left";
15209
+ EitherType2[EitherType2["Right"] = 1] = "Right";
15210
+ })(EitherType || (EitherType = {}));
15211
+
15212
+ // ../../node_modules/@magda/tsmonad/dist/maybe.js
15213
+ init_cjs_shim();
15214
+ var MaybeType;
15215
+ (function(MaybeType2) {
15216
+ MaybeType2[MaybeType2["Nothing"] = 0] = "Nothing";
15217
+ MaybeType2[MaybeType2["Just"] = 1] = "Just";
15218
+ })(MaybeType || (MaybeType = {}));
15219
+ var Maybe = class _Maybe {
15220
+ type;
15221
+ value;
15222
+ constructor(type, value) {
15223
+ this.type = type;
15224
+ this.value = value;
15225
+ }
15226
+ static sequence(t) {
15227
+ if (Object.keys(t).filter((k2) => t[k2].type === MaybeType.Nothing).length) {
15228
+ return _Maybe.nothing();
15229
+ }
15230
+ var result = {};
15231
+ for (var k in t) {
15232
+ if (t.hasOwnProperty(k)) {
15233
+ result[k] = t[k].value;
15234
+ }
15235
+ }
15236
+ return _Maybe.just(result);
15237
+ }
15238
+ static all = (t) => _Maybe.sequence(t);
15239
+ static maybe(t) {
15240
+ return t === null || t === void 0 ? new _Maybe(MaybeType.Nothing) : new _Maybe(MaybeType.Just, t);
15241
+ }
15242
+ static just(t) {
15243
+ if (t === null || t === void 0) {
15244
+ throw new TypeError("Cannot Maybe.just(null)");
15245
+ }
15246
+ return new _Maybe(MaybeType.Just, t);
15247
+ }
15248
+ static nothing() {
15249
+ return new _Maybe(MaybeType.Nothing);
15250
+ }
15251
+ static isJust(t) {
15252
+ return t.type === MaybeType.Just;
15253
+ }
15254
+ static isNothing(t) {
15255
+ return t.type === MaybeType.Nothing;
15256
+ }
15257
+ unit(u) {
15258
+ return _Maybe.maybe(u);
15259
+ }
15260
+ bind(f) {
15261
+ return this.type === MaybeType.Just ? f(this.value) : _Maybe.nothing();
15262
+ }
15263
+ of = this.unit;
15264
+ chain = this.bind;
15265
+ fmap(f) {
15266
+ return this.bind((v) => this.unit(f(v)));
15267
+ }
15268
+ lift = this.fmap;
15269
+ map = this.fmap;
15270
+ caseOf(patterns) {
15271
+ return this.type === MaybeType.Just ? patterns.just(this.value) : patterns.nothing();
15272
+ }
15273
+ defaulting(defaultValue) {
15274
+ return _Maybe.just(this.valueOr(defaultValue));
15275
+ }
15276
+ equals(other) {
15277
+ return other.type === this.type && (this.type === MaybeType.Nothing || eq(other.value, this.value));
15278
+ }
15279
+ valueOr(defaultValue) {
15280
+ return this.valueOrCompute(() => defaultValue);
15281
+ }
15282
+ valueOrCompute(defaultValueFunction) {
15283
+ return this.type === MaybeType.Just ? this.value : defaultValueFunction();
15284
+ }
15285
+ valueOrThrow(error) {
15286
+ if (this.type === MaybeType.Just) {
15287
+ return this.value;
15288
+ }
15289
+ throw error || new Error("No value is available.");
15290
+ }
15291
+ do(patterns = {}) {
15292
+ let noop_pattern = {
15293
+ just: (t) => {
15294
+ },
15295
+ nothing: () => {
15296
+ }
15297
+ };
15298
+ let merged = Object.assign(noop_pattern, patterns);
15299
+ this.caseOf(merged);
15300
+ return this;
15301
+ }
15302
+ };
15303
+
15304
+ // ../../node_modules/@magda/tsmonad/dist/writer.js
15305
+ init_cjs_shim();
15306
+
15307
+ // ../../magda-typescript-common/dist/util/arrayToMaybe.js
15308
+ function arrayToMaybe(rows) {
15309
+ return rows.length > 0 ? Maybe.just(rows[0]) : Maybe.nothing();
15310
+ }
15311
+
15312
+ // ../../magda-typescript-common/dist/util/getMinikubeIP.js
15313
+ init_cjs_shim();
15314
+ import * as childProcess from "child_process";
15315
+ function getMinikubeIP() {
15316
+ const minikubeProcess = childProcess.spawnSync("minikube", ["ip"]);
15317
+ const ip = minikubeProcess.stdout.toString().trim();
15318
+ return ip;
15319
+ }
15320
+
15321
+ // ../../magda-typescript-common/dist/util/isUuid.js
15322
+ init_cjs_shim();
15323
+ var uuidRegEx = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
15324
+ var isUuid = (id) => typeof id === "string" && uuidRegEx.test(id);
15325
+ var isUuid_default = isUuid;
15326
+
15327
+ // ../../magda-typescript-common/dist/util/unionToThrowable.js
15328
+ init_cjs_shim();
15329
+
15330
+ // ../../magda-typescript-common/dist/ServerError.js
15331
+ init_cjs_shim();
15332
+ var ServerError = class extends Error {
15333
+ statusCode;
15334
+ constructor(message = "Unknown Error", statusCode = 500) {
15335
+ super(message);
15336
+ this.statusCode = statusCode;
15337
+ }
15338
+ toData() {
15339
+ return {
15340
+ isError: true,
15341
+ errorCode: this.statusCode,
15342
+ errorMessage: this.message
15343
+ };
12682
15344
  }
12683
15345
  };
12684
15346
 
@@ -12694,6 +15356,7 @@ function unionToThrowable(input) {
12694
15356
  }
12695
15357
 
12696
15358
  // ../../magda-typescript-common/dist/AsyncPage.js
15359
+ init_cjs_shim();
12697
15360
  var AsyncPage = class _AsyncPage {
12698
15361
  requestNextPage;
12699
15362
  data;
@@ -12803,6 +15466,7 @@ function asyncPageToArray(page) {
12803
15466
  }
12804
15467
 
12805
15468
  // ../../magda-typescript-common/dist/coerceJson.js
15469
+ init_cjs_shim();
12806
15470
  var coerceJson_default = (param) => (json) => {
12807
15471
  if (typeof json !== "string") {
12808
15472
  return json;
@@ -12815,6 +15479,7 @@ var coerceJson_default = (param) => (json) => {
12815
15479
  };
12816
15480
 
12817
15481
  // ../../magda-typescript-common/dist/fetchRequest.js
15482
+ init_cjs_shim();
12818
15483
  var import_cross_fetch = __toESM(require_node_ponyfill(), 1);
12819
15484
  var import_merge = __toESM(require_merge(), 1);
12820
15485
  var defaultRequestInitOptions = {};
@@ -12824,7 +15489,7 @@ function setDefaultRequestInitOptions(options) {
12824
15489
  function getDefaultRequestInitOptions() {
12825
15490
  return defaultRequestInitOptions;
12826
15491
  }
12827
- async function fetchRequest(method, url, body = void 0, contentType = "application/json", returnHeaders = false, extraRequestOptions = {}) {
15492
+ async function fetchRequest(method, url2, body = void 0, contentType = "application/json", returnHeaders = false, extraRequestOptions = {}) {
12828
15493
  const defaultOptions = {
12829
15494
  ...defaultRequestInitOptions ? defaultRequestInitOptions : {}
12830
15495
  };
@@ -12847,7 +15512,7 @@ async function fetchRequest(method, url, body = void 0, contentType = "applicati
12847
15512
  }
12848
15513
  }
12849
15514
  }
12850
- const response = await (0, import_cross_fetch.default)(url, fetchOptions);
15515
+ const response = await (0, import_cross_fetch.default)(url2, fetchOptions);
12851
15516
  if (response.status >= 200 && response.status < 300) {
12852
15517
  return returnHeaders ? [await response.json(), response.headers] : await response.json();
12853
15518
  }
@@ -12855,7 +15520,14 @@ async function fetchRequest(method, url, body = void 0, contentType = "applicati
12855
15520
  throw new ServerError(responseText, response.status);
12856
15521
  }
12857
15522
 
15523
+ // ../../magda-typescript-common/dist/getRequest.js
15524
+ init_cjs_shim();
15525
+
15526
+ // ../../magda-typescript-common/dist/getRequestNoCache.js
15527
+ init_cjs_shim();
15528
+
12858
15529
  // ../../magda-typescript-common/dist/createNoCacheFetchOptions.js
15530
+ init_cjs_shim();
12859
15531
  function createNoCacheFetchOptions(fetchOptions = {}) {
12860
15532
  const noCacheHeaders = {
12861
15533
  "Cache-Control": "no-cache, no-store, must-revalidate",
@@ -12873,20 +15545,24 @@ function createNoCacheFetchOptions(fetchOptions = {}) {
12873
15545
  }
12874
15546
 
12875
15547
  // ../../magda-typescript-common/dist/getRequestNoCache.js
12876
- async function getRequestNoCache(url, extraFetchOptions = {}) {
12877
- return await fetchRequest("get", url, void 0, void 0, void 0, createNoCacheFetchOptions(extraFetchOptions));
15548
+ async function getRequestNoCache(url2, extraFetchOptions = {}) {
15549
+ return await fetchRequest("get", url2, void 0, void 0, void 0, createNoCacheFetchOptions(extraFetchOptions));
12878
15550
  }
12879
15551
 
12880
15552
  // ../../magda-typescript-common/dist/getRequest.js
12881
- async function getRequest(url, noCache = false, extraFetchOptions = {}) {
15553
+ async function getRequest(url2, noCache = false, extraFetchOptions = {}) {
12882
15554
  if (noCache) {
12883
- return await getRequestNoCache(url, extraFetchOptions);
15555
+ return await getRequestNoCache(url2, extraFetchOptions);
12884
15556
  } else {
12885
- return await fetchRequest("GET", url, void 0, void 0, void 0, extraFetchOptions);
15557
+ return await fetchRequest("GET", url2, void 0, void 0, void 0, extraFetchOptions);
12886
15558
  }
12887
15559
  }
12888
15560
 
15561
+ // ../../magda-typescript-common/dist/retry.js
15562
+ init_cjs_shim();
15563
+
12889
15564
  // ../../magda-typescript-common/dist/runLater.js
15565
+ init_cjs_shim();
12890
15566
  function runLater(milliseconds = 0, functionToRunLater) {
12891
15567
  return new Promise((resolve, reject) => {
12892
15568
  setTimeout(() => {
@@ -12914,6 +15590,7 @@ function retry(op, delaySeconds, retries, onRetry, shouldRetry = () => true) {
12914
15590
  }
12915
15591
 
12916
15592
  // ../../magda-typescript-common/dist/retryBackoff.js
15593
+ init_cjs_shim();
12917
15594
  function retryBackoff(op, delaySeconds, retries, onRetry, easing = (delaySeconds2) => delaySeconds2 * 2) {
12918
15595
  return new Promise((resolve, reject) => {
12919
15596
  resolve(op().then((result) => result, (e) => {
@@ -12928,12 +15605,14 @@ function retryBackoff(op, delaySeconds, retries, onRetry, easing = (delaySeconds
12928
15605
  }
12929
15606
 
12930
15607
  // ../../magda-typescript-common/dist/session/buildJwt.js
15608
+ init_cjs_shim();
12931
15609
  var import_jsonwebtoken = __toESM(require_jsonwebtoken(), 1);
12932
15610
  function buildJwt(jwtSecret, userId, session = {}) {
12933
15611
  return import_jsonwebtoken.default.sign({ userId, session }, jwtSecret);
12934
15612
  }
12935
15613
 
12936
15614
  // ../../magda-typescript-common/dist/session/addJwtSecretFromEnvVar.js
15615
+ init_cjs_shim();
12937
15616
  function addJwtSecretFromEnvVar(argv, required = true) {
12938
15617
  const newArgv = Object.assign({}, argv, {
12939
15618
  jwtSecret: argv.jwtSecret || process.env.JWT_SECRET || process.env.npm_package_config_jwtSecret
@@ -12945,11 +15624,13 @@ function addJwtSecretFromEnvVar(argv, required = true) {
12945
15624
  }
12946
15625
 
12947
15626
  // ../../magda-typescript-common/dist/test/util.js
15627
+ init_cjs_shim();
12948
15628
  function encodeURIComponentWithApost(string) {
12949
15629
  return encodeURIComponent(string).replace(/'/g, "%27");
12950
15630
  }
12951
15631
 
12952
15632
  // ../../magda-typescript-common/dist/formatServiceError.js
15633
+ init_cjs_shim();
12953
15634
  function formatServiceError(baseMessage, e, retriesLeft) {
12954
15635
  let messageParts = [baseMessage];
12955
15636
  if (retriesLeft) {
@@ -12973,6 +15654,7 @@ ${JSON.stringify(e, null, " ")}`);
12973
15654
  }
12974
15655
 
12975
15656
  // ../../magda-typescript-common/dist/createServiceError.js
15657
+ init_cjs_shim();
12976
15658
  var ServiceError = class extends Error {
12977
15659
  e;
12978
15660
  constructor(message, e) {
@@ -13000,6 +15682,30 @@ function createServiceError(e) {
13000
15682
  return new ServiceError("An undefined service error occurred.", void 0);
13001
15683
  }
13002
15684
  }
15685
+
15686
+ // ../../magda-typescript-common/dist/getStorageApiResourceAccessUrl.js
15687
+ init_cjs_shim();
15688
+ var import_urijs = __toESM(require_URI(), 1);
15689
+ function getStorageApiResourceAccessUrl(resourceUrl, storageApiBaseUrl, datasetsBucket) {
15690
+ if (!resourceUrl) {
15691
+ return resourceUrl;
15692
+ }
15693
+ const uri = (0, import_urijs.default)(resourceUrl);
15694
+ if (uri.protocol() === "magda" && uri.hostname() === "storage-api") {
15695
+ const [datasetId, distributionId, fileName] = uri.segmentCoded();
15696
+ const accessUri = (0, import_urijs.default)(storageApiBaseUrl);
15697
+ const segments = [
15698
+ ...accessUri.segmentCoded(),
15699
+ datasetsBucket,
15700
+ datasetId,
15701
+ distributionId,
15702
+ fileName
15703
+ ];
15704
+ return accessUri.segmentCoded(segments).toString();
15705
+ } else {
15706
+ return resourceUrl;
15707
+ }
15708
+ }
13003
15709
  export {
13004
15710
  AsyncPage,
13005
15711
  BadRequestError,
@@ -13019,6 +15725,7 @@ export {
13019
15725
  getMinikubeIP,
13020
15726
  getRequest,
13021
15727
  getRequestNoCache,
15728
+ getStorageApiResourceAccessUrl,
13022
15729
  isUuid_default as isUuid,
13023
15730
  retry,
13024
15731
  retryBackoff,
@@ -13030,4 +15737,51 @@ export {
13030
15737
 
13031
15738
  safe-buffer/index.js:
13032
15739
  (*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
15740
+
15741
+ urijs/src/punycode.js:
15742
+ (*! https://mths.be/punycode v1.4.0 by @mathias *)
15743
+
15744
+ urijs/src/IPv6.js:
15745
+ (*!
15746
+ * URI.js - Mutating URLs
15747
+ * IPv6 Support
15748
+ *
15749
+ * Version: 1.19.11
15750
+ *
15751
+ * Author: Rodney Rehm
15752
+ * Web: http://medialize.github.io/URI.js/
15753
+ *
15754
+ * Licensed under
15755
+ * MIT License http://www.opensource.org/licenses/mit-license
15756
+ *
15757
+ *)
15758
+
15759
+ urijs/src/SecondLevelDomains.js:
15760
+ (*!
15761
+ * URI.js - Mutating URLs
15762
+ * Second Level Domain (SLD) Support
15763
+ *
15764
+ * Version: 1.19.11
15765
+ *
15766
+ * Author: Rodney Rehm
15767
+ * Web: http://medialize.github.io/URI.js/
15768
+ *
15769
+ * Licensed under
15770
+ * MIT License http://www.opensource.org/licenses/mit-license
15771
+ *
15772
+ *)
15773
+
15774
+ urijs/src/URI.js:
15775
+ (*!
15776
+ * URI.js - Mutating URLs
15777
+ *
15778
+ * Version: 1.19.11
15779
+ *
15780
+ * Author: Rodney Rehm
15781
+ * Web: http://medialize.github.io/URI.js/
15782
+ *
15783
+ * Licensed under
15784
+ * MIT License http://www.opensource.org/licenses/mit-license
15785
+ *
15786
+ *)
13033
15787
  */