wapi-client 0.9.0 → 0.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/dist/api/base-client.browser.cjs +12 -0
  2. package/dist/api/base-client.browser.js +13 -4
  3. package/dist/api/base-client.cjs +12 -0
  4. package/dist/api/base-client.d.ts +8 -0
  5. package/dist/api/base-client.js +13 -4
  6. package/dist/api/ws-client.cjs +1 -1
  7. package/dist/api/ws-client.d.ts +0 -1
  8. package/dist/api/ws-client.js +1 -1
  9. package/dist/client.browser.cjs +27 -0
  10. package/dist/client.browser.js +27 -0
  11. package/dist/client.cjs +28 -1
  12. package/dist/client.d.ts +26 -0
  13. package/dist/client.js +28 -1
  14. package/dist/fns/healthcheck/healthcheck.browser.cjs +56 -0
  15. package/dist/fns/healthcheck/healthcheck.browser.js +38 -0
  16. package/dist/fns/healthcheck/healthcheck.cjs +60 -0
  17. package/dist/fns/healthcheck/healthcheck.d.ts +9 -0
  18. package/dist/fns/healthcheck/healthcheck.enums.browser.cjs +17 -0
  19. package/dist/fns/healthcheck/healthcheck.enums.browser.js +0 -0
  20. package/dist/fns/healthcheck/healthcheck.enums.cjs +17 -0
  21. package/dist/fns/healthcheck/healthcheck.enums.d.ts +20 -0
  22. package/dist/fns/healthcheck/healthcheck.enums.js +0 -0
  23. package/dist/fns/healthcheck/healthcheck.guards.browser.cjs +36 -0
  24. package/dist/fns/healthcheck/healthcheck.guards.browser.js +16 -0
  25. package/dist/fns/healthcheck/healthcheck.guards.cjs +41 -0
  26. package/dist/fns/healthcheck/healthcheck.guards.d.ts +4 -0
  27. package/dist/fns/healthcheck/healthcheck.guards.js +16 -0
  28. package/dist/fns/healthcheck/healthcheck.js +38 -0
  29. package/dist/fns/healthcheck/healthcheck.schema.input.json +25 -0
  30. package/dist/fns/healthcheck/healthcheck.schema.output.json +8 -0
  31. package/dist/fns/import-data/import-data.cjs +22 -0
  32. package/dist/fns/import-data/import-data.js +22 -0
  33. package/dist/fns/import-data/import-data.node.browser.cjs +22 -0
  34. package/dist/fns/import-data/import-data.node.browser.js +22 -0
  35. package/dist/fns/import-data/import-data.node.cjs +22 -0
  36. package/dist/fns/import-data/import-data.node.js +22 -0
  37. package/dist/fns/index.browser.cjs +9 -0
  38. package/dist/fns/index.browser.js +9 -0
  39. package/dist/fns/index.cjs +12 -0
  40. package/dist/fns/index.d.ts +7 -1
  41. package/dist/fns/index.js +9 -0
  42. package/dist/lib/errors.d.ts +1 -1
  43. package/dist/lib/isomorphic/node/fetch.cjs +20 -17
  44. package/dist/lib/isomorphic/node/fetch.js +20 -17
  45. package/dist/lib/isomorphic/node/streams.d.ts +0 -2
  46. package/dist/lib/validator.browser.cjs +651 -960
  47. package/dist/lib/validator.browser.js +651 -960
  48. package/dist/lib/validator.cjs +41 -1
  49. package/dist/lib/validator.d.ts +5 -1
  50. package/dist/lib/validator.js +41 -1
  51. package/dist/lib/ws-types.d.ts +0 -1
  52. package/dist/txs/healthcheck/healthcheck.enums.browser.cjs +17 -0
  53. package/dist/txs/healthcheck/healthcheck.enums.browser.js +0 -0
  54. package/dist/txs/healthcheck/healthcheck.enums.cjs +17 -0
  55. package/dist/txs/healthcheck/healthcheck.enums.d.ts +22 -0
  56. package/dist/txs/healthcheck/healthcheck.enums.js +0 -0
  57. package/dist/txs/healthcheck/healthcheck.schema.input.json +23 -0
  58. package/dist/txs/healthcheck/healthcheck.schema.output.json +32 -0
  59. package/dist/txs/index.browser.cjs +7 -0
  60. package/dist/txs/index.browser.js +7 -0
  61. package/dist/txs/index.cjs +9 -0
  62. package/dist/txs/index.d.ts +5 -0
  63. package/dist/txs/index.js +7 -0
  64. package/dist/types/index.d.ts +119 -6
  65. package/dist/wapi-client-web.iife.js +6 -11
  66. package/dist/wapi-client.iife.js +6 -11
  67. package/package.json +7 -7
@@ -3131,1020 +3131,676 @@ var require_data = __commonJS({
3131
3131
  }
3132
3132
  });
3133
3133
 
3134
- // node_modules/uri-js/dist/es5/uri.all.js
3135
- var require_uri_all = __commonJS({
3136
- "node_modules/uri-js/dist/es5/uri.all.js"(exports, module) {
3137
- (function(global, factory) {
3138
- typeof exports === "object" && typeof module !== "undefined" ? factory(exports) : typeof define === "function" && define.amd ? define(["exports"], factory) : factory(global.URI = global.URI || {});
3139
- })(exports, function(exports2) {
3140
- "use strict";
3141
- function merge() {
3142
- for (var _len = arguments.length, sets = Array(_len), _key = 0; _key < _len; _key++) {
3143
- sets[_key] = arguments[_key];
3144
- }
3145
- if (sets.length > 1) {
3146
- sets[0] = sets[0].slice(0, -1);
3147
- var xl = sets.length - 1;
3148
- for (var x = 1; x < xl; ++x) {
3149
- sets[x] = sets[x].slice(1, -1);
3150
- }
3151
- sets[xl] = sets[xl].slice(1);
3152
- return sets.join("");
3153
- } else {
3154
- return sets[0];
3155
- }
3156
- }
3157
- function subexp(str) {
3158
- return "(?:" + str + ")";
3159
- }
3160
- function typeOf(o) {
3161
- return o === void 0 ? "undefined" : o === null ? "null" : Object.prototype.toString.call(o).split(" ").pop().split("]").shift().toLowerCase();
3162
- }
3163
- function toUpperCase(str) {
3164
- return str.toUpperCase();
3165
- }
3166
- function toArray(obj) {
3167
- return obj !== void 0 && obj !== null ? obj instanceof Array ? obj : typeof obj.length !== "number" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj) : [];
3168
- }
3169
- function assign(target, source) {
3170
- var obj = target;
3171
- if (source) {
3172
- for (var key in source) {
3173
- obj[key] = source[key];
3174
- }
3175
- }
3176
- return obj;
3177
- }
3178
- function buildExps(isIRI2) {
3179
- var ALPHA$$ = "[A-Za-z]", CR$ = "[\\x0D]", DIGIT$$ = "[0-9]", DQUOTE$$ = "[\\x22]", HEXDIG$$2 = merge(DIGIT$$, "[A-Fa-f]"), LF$$ = "[\\x0A]", SP$$ = "[\\x20]", PCT_ENCODED$2 = subexp(subexp("%[EFef]" + HEXDIG$$2 + "%" + HEXDIG$$2 + HEXDIG$$2 + "%" + HEXDIG$$2 + HEXDIG$$2) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$2 + "%" + HEXDIG$$2 + HEXDIG$$2) + "|" + subexp("%" + HEXDIG$$2 + HEXDIG$$2)), GEN_DELIMS$$ = "[\\:\\/\\?\\#\\[\\]\\@]", SUB_DELIMS$$ = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]", RESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$), UCSCHAR$$ = isIRI2 ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]", IPRIVATE$$ = isIRI2 ? "[\\uE000-\\uF8FF]" : "[]", UNRESERVED$$2 = merge(ALPHA$$, DIGIT$$, "[\\-\\.\\_\\~]", UCSCHAR$$), SCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, "[\\+\\-\\.]") + "*"), USERINFO$ = subexp(subexp(PCT_ENCODED$2 + "|" + merge(UNRESERVED$$2, SUB_DELIMS$$, "[\\:]")) + "*"), DEC_OCTET$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("[1-9]" + DIGIT$$) + "|" + DIGIT$$), DEC_OCTET_RELAXED$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("0?[1-9]" + DIGIT$$) + "|0?0?" + DIGIT$$), IPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$), H16$ = subexp(HEXDIG$$2 + "{1,4}"), LS32$ = subexp(subexp(H16$ + "\\:" + H16$) + "|" + IPV4ADDRESS$), IPV6ADDRESS1$ = subexp(subexp(H16$ + "\\:") + "{6}" + LS32$), IPV6ADDRESS2$ = subexp("\\:\\:" + subexp(H16$ + "\\:") + "{5}" + LS32$), IPV6ADDRESS3$ = subexp(subexp(H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{4}" + LS32$), IPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,1}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{3}" + LS32$), IPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,2}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{2}" + LS32$), IPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,3}" + H16$) + "?\\:\\:" + H16$ + "\\:" + LS32$), IPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,4}" + H16$) + "?\\:\\:" + LS32$), IPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,5}" + H16$) + "?\\:\\:" + H16$), IPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,6}" + H16$) + "?\\:\\:"), IPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join("|")), ZONEID$ = subexp(subexp(UNRESERVED$$2 + "|" + PCT_ENCODED$2) + "+"), IPV6ADDRZ$ = subexp(IPV6ADDRESS$ + "\\%25" + ZONEID$), IPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp("\\%25|\\%(?!" + HEXDIG$$2 + "{2})") + ZONEID$), IPVFUTURE$ = subexp("[vV]" + HEXDIG$$2 + "+\\." + merge(UNRESERVED$$2, SUB_DELIMS$$, "[\\:]") + "+"), IP_LITERAL$ = subexp("\\[" + subexp(IPV6ADDRZ_RELAXED$ + "|" + IPV6ADDRESS$ + "|" + IPVFUTURE$) + "\\]"), REG_NAME$ = subexp(subexp(PCT_ENCODED$2 + "|" + merge(UNRESERVED$$2, SUB_DELIMS$$)) + "*"), HOST$ = subexp(IP_LITERAL$ + "|" + IPV4ADDRESS$ + "(?!" + REG_NAME$ + ")|" + REG_NAME$), PORT$ = subexp(DIGIT$$ + "*"), AUTHORITY$ = subexp(subexp(USERINFO$ + "@") + "?" + HOST$ + subexp("\\:" + PORT$) + "?"), PCHAR$ = subexp(PCT_ENCODED$2 + "|" + merge(UNRESERVED$$2, SUB_DELIMS$$, "[\\:\\@]")), SEGMENT$ = subexp(PCHAR$ + "*"), SEGMENT_NZ$ = subexp(PCHAR$ + "+"), SEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$2 + "|" + merge(UNRESERVED$$2, SUB_DELIMS$$, "[\\@]")) + "+"), PATH_ABEMPTY$ = subexp(subexp("\\/" + SEGMENT$) + "*"), PATH_ABSOLUTE$ = subexp("\\/" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + "?"), PATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$), PATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$), PATH_EMPTY$ = "(?!" + PCHAR$ + ")", PATH$ = subexp(PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), QUERY$ = subexp(subexp(PCHAR$ + "|" + merge("[\\/\\?]", IPRIVATE$$)) + "*"), FRAGMENT$ = subexp(subexp(PCHAR$ + "|[\\/\\?]") + "*"), HIER_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), RELATIVE_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$), RELATIVE$ = subexp(RELATIVE_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), URI_REFERENCE$ = subexp(URI$ + "|" + RELATIVE$), ABSOLUTE_URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?"), GENERIC_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", RELATIVE_REF$ = "^(){0}" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", ABSOLUTE_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?$", SAMEDOC_REF$ = "^" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", AUTHORITY_REF$ = "^" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?$";
3180
- return {
3181
- NOT_SCHEME: new RegExp(merge("[^]", ALPHA$$, DIGIT$$, "[\\+\\-\\.]"), "g"),
3182
- NOT_USERINFO: new RegExp(merge("[^\\%\\:]", UNRESERVED$$2, SUB_DELIMS$$), "g"),
3183
- NOT_HOST: new RegExp(merge("[^\\%\\[\\]\\:]", UNRESERVED$$2, SUB_DELIMS$$), "g"),
3184
- NOT_PATH: new RegExp(merge("[^\\%\\/\\:\\@]", UNRESERVED$$2, SUB_DELIMS$$), "g"),
3185
- NOT_PATH_NOSCHEME: new RegExp(merge("[^\\%\\/\\@]", UNRESERVED$$2, SUB_DELIMS$$), "g"),
3186
- NOT_QUERY: new RegExp(merge("[^\\%]", UNRESERVED$$2, SUB_DELIMS$$, "[\\:\\@\\/\\?]", IPRIVATE$$), "g"),
3187
- NOT_FRAGMENT: new RegExp(merge("[^\\%]", UNRESERVED$$2, SUB_DELIMS$$, "[\\:\\@\\/\\?]"), "g"),
3188
- ESCAPE: new RegExp(merge("[^]", UNRESERVED$$2, SUB_DELIMS$$), "g"),
3189
- UNRESERVED: new RegExp(UNRESERVED$$2, "g"),
3190
- OTHER_CHARS: new RegExp(merge("[^\\%]", UNRESERVED$$2, RESERVED$$), "g"),
3191
- PCT_ENCODED: new RegExp(PCT_ENCODED$2, "g"),
3192
- IPV4ADDRESS: new RegExp("^(" + IPV4ADDRESS$ + ")$"),
3193
- IPV6ADDRESS: new RegExp("^\\[?(" + IPV6ADDRESS$ + ")" + subexp(subexp("\\%25|\\%(?!" + HEXDIG$$2 + "{2})") + "(" + ZONEID$ + ")") + "?\\]?$")
3194
- //RFC 6874, with relaxed parsing rules
3195
- };
3196
- }
3197
- var URI_PROTOCOL = buildExps(false);
3198
- var IRI_PROTOCOL = buildExps(true);
3199
- var slicedToArray = /* @__PURE__ */ function() {
3200
- function sliceIterator(arr, i) {
3201
- var _arr = [];
3202
- var _n = true;
3203
- var _d = false;
3204
- var _e = void 0;
3205
- try {
3206
- for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
3207
- _arr.push(_s.value);
3208
- if (i && _arr.length === i) break;
3209
- }
3210
- } catch (err) {
3211
- _d = true;
3212
- _e = err;
3213
- } finally {
3214
- try {
3215
- if (!_n && _i["return"]) _i["return"]();
3216
- } finally {
3217
- if (_d) throw _e;
3218
- }
3219
- }
3220
- return _arr;
3221
- }
3222
- return function(arr, i) {
3223
- if (Array.isArray(arr)) {
3224
- return arr;
3225
- } else if (Symbol.iterator in Object(arr)) {
3226
- return sliceIterator(arr, i);
3227
- } else {
3228
- throw new TypeError("Invalid attempt to destructure non-iterable instance");
3229
- }
3230
- };
3231
- }();
3232
- var toConsumableArray = function(arr) {
3233
- if (Array.isArray(arr)) {
3234
- for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
3235
- return arr2;
3236
- } else {
3237
- return Array.from(arr);
3238
- }
3239
- };
3240
- var maxInt = 2147483647;
3241
- var base = 36;
3242
- var tMin = 1;
3243
- var tMax = 26;
3244
- var skew = 38;
3245
- var damp = 700;
3246
- var initialBias = 72;
3247
- var initialN = 128;
3248
- var delimiter = "-";
3249
- var regexPunycode = /^xn--/;
3250
- var regexNonASCII = /[^\0-\x7E]/;
3251
- var regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g;
3252
- var errors = {
3253
- "overflow": "Overflow: input needs wider integers to process",
3254
- "not-basic": "Illegal input >= 0x80 (not a basic code point)",
3255
- "invalid-input": "Invalid input"
3256
- };
3257
- var baseMinusTMin = base - tMin;
3258
- var floor = Math.floor;
3259
- var stringFromCharCode = String.fromCharCode;
3260
- function error$1(type) {
3261
- throw new RangeError(errors[type]);
3262
- }
3263
- function map(array, fn) {
3264
- var result = [];
3265
- var length = array.length;
3266
- while (length--) {
3267
- result[length] = fn(array[length]);
3268
- }
3269
- return result;
3270
- }
3271
- function mapDomain(string, fn) {
3272
- var parts = string.split("@");
3273
- var result = "";
3274
- if (parts.length > 1) {
3275
- result = parts[0] + "@";
3276
- string = parts[1];
3277
- }
3278
- string = string.replace(regexSeparators, ".");
3279
- var labels = string.split(".");
3280
- var encoded = map(labels, fn).join(".");
3281
- return result + encoded;
3282
- }
3283
- function ucs2decode(string) {
3284
- var output = [];
3285
- var counter = 0;
3286
- var length = string.length;
3287
- while (counter < length) {
3288
- var value = string.charCodeAt(counter++);
3289
- if (value >= 55296 && value <= 56319 && counter < length) {
3290
- var extra = string.charCodeAt(counter++);
3291
- if ((extra & 64512) == 56320) {
3292
- output.push(((value & 1023) << 10) + (extra & 1023) + 65536);
3134
+ // node_modules/fast-uri/lib/scopedChars.js
3135
+ var require_scopedChars = __commonJS({
3136
+ "node_modules/fast-uri/lib/scopedChars.js"(exports, module) {
3137
+ "use strict";
3138
+ var HEX = {
3139
+ 0: 0,
3140
+ 1: 1,
3141
+ 2: 2,
3142
+ 3: 3,
3143
+ 4: 4,
3144
+ 5: 5,
3145
+ 6: 6,
3146
+ 7: 7,
3147
+ 8: 8,
3148
+ 9: 9,
3149
+ a: 10,
3150
+ A: 10,
3151
+ b: 11,
3152
+ B: 11,
3153
+ c: 12,
3154
+ C: 12,
3155
+ d: 13,
3156
+ D: 13,
3157
+ e: 14,
3158
+ E: 14,
3159
+ f: 15,
3160
+ F: 15
3161
+ };
3162
+ module.exports = {
3163
+ HEX
3164
+ };
3165
+ }
3166
+ });
3167
+
3168
+ // node_modules/fast-uri/lib/utils.js
3169
+ var require_utils = __commonJS({
3170
+ "node_modules/fast-uri/lib/utils.js"(exports, module) {
3171
+ "use strict";
3172
+ var { HEX } = require_scopedChars();
3173
+ function normalizeIPv4(host) {
3174
+ if (findToken(host, ".") < 3) {
3175
+ return { host, isIPV4: false };
3176
+ }
3177
+ const matches = host.match(/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/u) || [];
3178
+ const [address] = matches;
3179
+ if (address) {
3180
+ return { host: stripLeadingZeros(address, "."), isIPV4: true };
3181
+ } else {
3182
+ return { host, isIPV4: false };
3183
+ }
3184
+ }
3185
+ function stringArrayToHexStripped(input, keepZero = false) {
3186
+ let acc = "";
3187
+ let strip = true;
3188
+ for (const c of input) {
3189
+ if (HEX[c] === void 0) return void 0;
3190
+ if (c !== "0" && strip === true) strip = false;
3191
+ if (!strip) acc += c;
3192
+ }
3193
+ if (keepZero && acc.length === 0) acc = "0";
3194
+ return acc;
3195
+ }
3196
+ function getIPV6(input) {
3197
+ let tokenCount = 0;
3198
+ const output = { error: false, address: "", zone: "" };
3199
+ const address = [];
3200
+ const buffer = [];
3201
+ let isZone = false;
3202
+ let endipv6Encountered = false;
3203
+ let endIpv6 = false;
3204
+ function consume() {
3205
+ if (buffer.length) {
3206
+ if (isZone === false) {
3207
+ const hex = stringArrayToHexStripped(buffer);
3208
+ if (hex !== void 0) {
3209
+ address.push(hex);
3293
3210
  } else {
3294
- output.push(value);
3295
- counter--;
3211
+ output.error = true;
3212
+ return false;
3296
3213
  }
3297
- } else {
3298
- output.push(value);
3299
3214
  }
3215
+ buffer.length = 0;
3300
3216
  }
3301
- return output;
3217
+ return true;
3302
3218
  }
3303
- var ucs2encode = function ucs2encode2(array) {
3304
- return String.fromCodePoint.apply(String, toConsumableArray(array));
3305
- };
3306
- var basicToDigit = function basicToDigit2(codePoint) {
3307
- if (codePoint - 48 < 10) {
3308
- return codePoint - 22;
3309
- }
3310
- if (codePoint - 65 < 26) {
3311
- return codePoint - 65;
3312
- }
3313
- if (codePoint - 97 < 26) {
3314
- return codePoint - 97;
3219
+ for (let i = 0; i < input.length; i++) {
3220
+ const cursor = input[i];
3221
+ if (cursor === "[" || cursor === "]") {
3222
+ continue;
3315
3223
  }
3316
- return base;
3317
- };
3318
- var digitToBasic = function digitToBasic2(digit, flag) {
3319
- return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
3320
- };
3321
- var adapt = function adapt2(delta, numPoints, firstTime) {
3322
- var k = 0;
3323
- delta = firstTime ? floor(delta / damp) : delta >> 1;
3324
- delta += floor(delta / numPoints);
3325
- for (
3326
- ;
3327
- /* no initialization */
3328
- delta > baseMinusTMin * tMax >> 1;
3329
- k += base
3330
- ) {
3331
- delta = floor(delta / baseMinusTMin);
3332
- }
3333
- return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
3334
- };
3335
- var decode = function decode2(input) {
3336
- var output = [];
3337
- var inputLength = input.length;
3338
- var i = 0;
3339
- var n = initialN;
3340
- var bias = initialBias;
3341
- var basic = input.lastIndexOf(delimiter);
3342
- if (basic < 0) {
3343
- basic = 0;
3344
- }
3345
- for (var j = 0; j < basic; ++j) {
3346
- if (input.charCodeAt(j) >= 128) {
3347
- error$1("not-basic");
3224
+ if (cursor === ":") {
3225
+ if (endipv6Encountered === true) {
3226
+ endIpv6 = true;
3348
3227
  }
3349
- output.push(input.charCodeAt(j));
3350
- }
3351
- for (var index = basic > 0 ? basic + 1 : 0; index < inputLength; ) {
3352
- var oldi = i;
3353
- for (
3354
- var w = 1, k = base;
3355
- ;
3356
- /* no condition */
3357
- k += base
3358
- ) {
3359
- if (index >= inputLength) {
3360
- error$1("invalid-input");
3361
- }
3362
- var digit = basicToDigit(input.charCodeAt(index++));
3363
- if (digit >= base || digit > floor((maxInt - i) / w)) {
3364
- error$1("overflow");
3365
- }
3366
- i += digit * w;
3367
- var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
3368
- if (digit < t) {
3369
- break;
3370
- }
3371
- var baseMinusT = base - t;
3372
- if (w > floor(maxInt / baseMinusT)) {
3373
- error$1("overflow");
3374
- }
3375
- w *= baseMinusT;
3228
+ if (!consume()) {
3229
+ break;
3376
3230
  }
3377
- var out = output.length + 1;
3378
- bias = adapt(i - oldi, out, oldi == 0);
3379
- if (floor(i / out) > maxInt - n) {
3380
- error$1("overflow");
3231
+ tokenCount++;
3232
+ address.push(":");
3233
+ if (tokenCount > 7) {
3234
+ output.error = true;
3235
+ break;
3381
3236
  }
3382
- n += floor(i / out);
3383
- i %= out;
3384
- output.splice(i++, 0, n);
3385
- }
3386
- return String.fromCodePoint.apply(String, output);
3387
- };
3388
- var encode = function encode2(input) {
3389
- var output = [];
3390
- input = ucs2decode(input);
3391
- var inputLength = input.length;
3392
- var n = initialN;
3393
- var delta = 0;
3394
- var bias = initialBias;
3395
- var _iteratorNormalCompletion = true;
3396
- var _didIteratorError = false;
3397
- var _iteratorError = void 0;
3398
- try {
3399
- for (var _iterator = input[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
3400
- var _currentValue2 = _step.value;
3401
- if (_currentValue2 < 128) {
3402
- output.push(stringFromCharCode(_currentValue2));
3403
- }
3237
+ if (i - 1 >= 0 && input[i - 1] === ":") {
3238
+ endipv6Encountered = true;
3404
3239
  }
3405
- } catch (err) {
3406
- _didIteratorError = true;
3407
- _iteratorError = err;
3408
- } finally {
3409
- try {
3410
- if (!_iteratorNormalCompletion && _iterator.return) {
3411
- _iterator.return();
3412
- }
3413
- } finally {
3414
- if (_didIteratorError) {
3415
- throw _iteratorError;
3416
- }
3240
+ continue;
3241
+ } else if (cursor === "%") {
3242
+ if (!consume()) {
3243
+ break;
3417
3244
  }
3245
+ isZone = true;
3246
+ } else {
3247
+ buffer.push(cursor);
3248
+ continue;
3418
3249
  }
3419
- var basicLength = output.length;
3420
- var handledCPCount = basicLength;
3421
- if (basicLength) {
3422
- output.push(delimiter);
3423
- }
3424
- while (handledCPCount < inputLength) {
3425
- var m = maxInt;
3426
- var _iteratorNormalCompletion2 = true;
3427
- var _didIteratorError2 = false;
3428
- var _iteratorError2 = void 0;
3429
- try {
3430
- for (var _iterator2 = input[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
3431
- var currentValue = _step2.value;
3432
- if (currentValue >= n && currentValue < m) {
3433
- m = currentValue;
3434
- }
3435
- }
3436
- } catch (err) {
3437
- _didIteratorError2 = true;
3438
- _iteratorError2 = err;
3439
- } finally {
3440
- try {
3441
- if (!_iteratorNormalCompletion2 && _iterator2.return) {
3442
- _iterator2.return();
3443
- }
3444
- } finally {
3445
- if (_didIteratorError2) {
3446
- throw _iteratorError2;
3447
- }
3448
- }
3449
- }
3450
- var handledCPCountPlusOne = handledCPCount + 1;
3451
- if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
3452
- error$1("overflow");
3453
- }
3454
- delta += (m - n) * handledCPCountPlusOne;
3455
- n = m;
3456
- var _iteratorNormalCompletion3 = true;
3457
- var _didIteratorError3 = false;
3458
- var _iteratorError3 = void 0;
3459
- try {
3460
- for (var _iterator3 = input[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
3461
- var _currentValue = _step3.value;
3462
- if (_currentValue < n && ++delta > maxInt) {
3463
- error$1("overflow");
3464
- }
3465
- if (_currentValue == n) {
3466
- var q = delta;
3467
- for (
3468
- var k = base;
3469
- ;
3470
- /* no condition */
3471
- k += base
3472
- ) {
3473
- var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
3474
- if (q < t) {
3475
- break;
3476
- }
3477
- var qMinusT = q - t;
3478
- var baseMinusT = base - t;
3479
- output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)));
3480
- q = floor(qMinusT / baseMinusT);
3481
- }
3482
- output.push(stringFromCharCode(digitToBasic(q, 0)));
3483
- bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
3484
- delta = 0;
3485
- ++handledCPCount;
3486
- }
3487
- }
3488
- } catch (err) {
3489
- _didIteratorError3 = true;
3490
- _iteratorError3 = err;
3491
- } finally {
3492
- try {
3493
- if (!_iteratorNormalCompletion3 && _iterator3.return) {
3494
- _iterator3.return();
3495
- }
3496
- } finally {
3497
- if (_didIteratorError3) {
3498
- throw _iteratorError3;
3499
- }
3500
- }
3501
- }
3502
- ++delta;
3503
- ++n;
3250
+ }
3251
+ if (buffer.length) {
3252
+ if (isZone) {
3253
+ output.zone = buffer.join("");
3254
+ } else if (endIpv6) {
3255
+ address.push(buffer.join(""));
3256
+ } else {
3257
+ address.push(stringArrayToHexStripped(buffer));
3504
3258
  }
3505
- return output.join("");
3506
- };
3507
- var toUnicode = function toUnicode2(input) {
3508
- return mapDomain(input, function(string) {
3509
- return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string;
3510
- });
3511
- };
3512
- var toASCII = function toASCII2(input) {
3513
- return mapDomain(input, function(string) {
3514
- return regexNonASCII.test(string) ? "xn--" + encode(string) : string;
3515
- });
3516
- };
3517
- var punycode = {
3518
- /**
3519
- * A string representing the current Punycode.js version number.
3520
- * @memberOf punycode
3521
- * @type String
3522
- */
3523
- "version": "2.1.0",
3524
- /**
3525
- * An object of methods to convert from JavaScript's internal character
3526
- * representation (UCS-2) to Unicode code points, and back.
3527
- * @see <https://mathiasbynens.be/notes/javascript-encoding>
3528
- * @memberOf punycode
3529
- * @type Object
3530
- */
3531
- "ucs2": {
3532
- "decode": ucs2decode,
3533
- "encode": ucs2encode
3534
- },
3535
- "decode": decode,
3536
- "encode": encode,
3537
- "toASCII": toASCII,
3538
- "toUnicode": toUnicode
3539
- };
3540
- var SCHEMES = {};
3541
- function pctEncChar(chr) {
3542
- var c = chr.charCodeAt(0);
3543
- var e = void 0;
3544
- if (c < 16) e = "%0" + c.toString(16).toUpperCase();
3545
- else if (c < 128) e = "%" + c.toString(16).toUpperCase();
3546
- else if (c < 2048) e = "%" + (c >> 6 | 192).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase();
3547
- else e = "%" + (c >> 12 | 224).toString(16).toUpperCase() + "%" + (c >> 6 & 63 | 128).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase();
3548
- return e;
3549
- }
3550
- function pctDecChars(str) {
3551
- var newStr = "";
3552
- var i = 0;
3553
- var il = str.length;
3554
- while (i < il) {
3555
- var c = parseInt(str.substr(i + 1, 2), 16);
3556
- if (c < 128) {
3557
- newStr += String.fromCharCode(c);
3558
- i += 3;
3559
- } else if (c >= 194 && c < 224) {
3560
- if (il - i >= 6) {
3561
- var c2 = parseInt(str.substr(i + 4, 2), 16);
3562
- newStr += String.fromCharCode((c & 31) << 6 | c2 & 63);
3563
- } else {
3564
- newStr += str.substr(i, 6);
3565
- }
3566
- i += 6;
3567
- } else if (c >= 224) {
3568
- if (il - i >= 9) {
3569
- var _c = parseInt(str.substr(i + 4, 2), 16);
3570
- var c3 = parseInt(str.substr(i + 7, 2), 16);
3571
- newStr += String.fromCharCode((c & 15) << 12 | (_c & 63) << 6 | c3 & 63);
3572
- } else {
3573
- newStr += str.substr(i, 9);
3574
- }
3575
- i += 9;
3576
- } else {
3577
- newStr += str.substr(i, 3);
3578
- i += 3;
3579
- }
3259
+ }
3260
+ output.address = address.join("");
3261
+ return output;
3262
+ }
3263
+ function normalizeIPv6(host, opts = {}) {
3264
+ if (findToken(host, ":") < 2) {
3265
+ return { host, isIPV6: false };
3266
+ }
3267
+ const ipv6 = getIPV6(host);
3268
+ if (!ipv6.error) {
3269
+ let newHost = ipv6.address;
3270
+ let escapedHost = ipv6.address;
3271
+ if (ipv6.zone) {
3272
+ newHost += "%" + ipv6.zone;
3273
+ escapedHost += "%25" + ipv6.zone;
3580
3274
  }
3581
- return newStr;
3582
- }
3583
- function _normalizeComponentEncoding(components, protocol) {
3584
- function decodeUnreserved2(str) {
3585
- var decStr = pctDecChars(str);
3586
- return !decStr.match(protocol.UNRESERVED) ? str : decStr;
3587
- }
3588
- if (components.scheme) components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved2).toLowerCase().replace(protocol.NOT_SCHEME, "");
3589
- if (components.userinfo !== void 0) components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved2).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
3590
- if (components.host !== void 0) components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved2).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
3591
- if (components.path !== void 0) components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved2).replace(components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
3592
- if (components.query !== void 0) components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved2).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
3593
- if (components.fragment !== void 0) components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved2).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
3594
- return components;
3595
- }
3596
- function _stripLeadingZeros(str) {
3597
- return str.replace(/^0*(.*)/, "$1") || "0";
3598
- }
3599
- function _normalizeIPv4(host, protocol) {
3600
- var matches = host.match(protocol.IPV4ADDRESS) || [];
3601
- var _matches = slicedToArray(matches, 2), address = _matches[1];
3602
- if (address) {
3603
- return address.split(".").map(_stripLeadingZeros).join(".");
3604
- } else {
3605
- return host;
3606
- }
3607
- }
3608
- function _normalizeIPv6(host, protocol) {
3609
- var matches = host.match(protocol.IPV6ADDRESS) || [];
3610
- var _matches2 = slicedToArray(matches, 3), address = _matches2[1], zone = _matches2[2];
3611
- if (address) {
3612
- var _address$toLowerCase$ = address.toLowerCase().split("::").reverse(), _address$toLowerCase$2 = slicedToArray(_address$toLowerCase$, 2), last = _address$toLowerCase$2[0], first = _address$toLowerCase$2[1];
3613
- var firstFields = first ? first.split(":").map(_stripLeadingZeros) : [];
3614
- var lastFields = last.split(":").map(_stripLeadingZeros);
3615
- var isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]);
3616
- var fieldCount = isLastFieldIPv4Address ? 7 : 8;
3617
- var lastFieldsStart = lastFields.length - fieldCount;
3618
- var fields = Array(fieldCount);
3619
- for (var x = 0; x < fieldCount; ++x) {
3620
- fields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || "";
3621
- }
3622
- if (isLastFieldIPv4Address) {
3623
- fields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol);
3624
- }
3625
- var allZeroFields = fields.reduce(function(acc, field, index) {
3626
- if (!field || field === "0") {
3627
- var lastLongest = acc[acc.length - 1];
3628
- if (lastLongest && lastLongest.index + lastLongest.length === index) {
3629
- lastLongest.length++;
3630
- } else {
3631
- acc.push({ index, length: 1 });
3632
- }
3633
- }
3634
- return acc;
3635
- }, []);
3636
- var longestZeroFields = allZeroFields.sort(function(a, b) {
3637
- return b.length - a.length;
3638
- })[0];
3639
- var newHost = void 0;
3640
- if (longestZeroFields && longestZeroFields.length > 1) {
3641
- var newFirst = fields.slice(0, longestZeroFields.index);
3642
- var newLast = fields.slice(longestZeroFields.index + longestZeroFields.length);
3643
- newHost = newFirst.join(":") + "::" + newLast.join(":");
3644
- } else {
3645
- newHost = fields.join(":");
3646
- }
3647
- if (zone) {
3648
- newHost += "%" + zone;
3275
+ return { host: newHost, escapedHost, isIPV6: true };
3276
+ } else {
3277
+ return { host, isIPV6: false };
3278
+ }
3279
+ }
3280
+ function stripLeadingZeros(str, token) {
3281
+ let out = "";
3282
+ let skip = true;
3283
+ const l = str.length;
3284
+ for (let i = 0; i < l; i++) {
3285
+ const c = str[i];
3286
+ if (c === "0" && skip) {
3287
+ if (i + 1 <= l && str[i + 1] === token || i + 1 === l) {
3288
+ out += c;
3289
+ skip = false;
3649
3290
  }
3650
- return newHost;
3651
3291
  } else {
3652
- return host;
3653
- }
3654
- }
3655
- var URI_PARSE = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i;
3656
- var NO_MATCH_IS_UNDEFINED = "".match(/(){0}/)[1] === void 0;
3657
- function parse(uriString) {
3658
- var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
3659
- var components = {};
3660
- var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL;
3661
- if (options.reference === "suffix") uriString = (options.scheme ? options.scheme + ":" : "") + "//" + uriString;
3662
- var matches = uriString.match(URI_PARSE);
3663
- if (matches) {
3664
- if (NO_MATCH_IS_UNDEFINED) {
3665
- components.scheme = matches[1];
3666
- components.userinfo = matches[3];
3667
- components.host = matches[4];
3668
- components.port = parseInt(matches[5], 10);
3669
- components.path = matches[6] || "";
3670
- components.query = matches[7];
3671
- components.fragment = matches[8];
3672
- if (isNaN(components.port)) {
3673
- components.port = matches[5];
3674
- }
3675
- } else {
3676
- components.scheme = matches[1] || void 0;
3677
- components.userinfo = uriString.indexOf("@") !== -1 ? matches[3] : void 0;
3678
- components.host = uriString.indexOf("//") !== -1 ? matches[4] : void 0;
3679
- components.port = parseInt(matches[5], 10);
3680
- components.path = matches[6] || "";
3681
- components.query = uriString.indexOf("?") !== -1 ? matches[7] : void 0;
3682
- components.fragment = uriString.indexOf("#") !== -1 ? matches[8] : void 0;
3683
- if (isNaN(components.port)) {
3684
- components.port = uriString.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/) ? matches[4] : void 0;
3685
- }
3686
- }
3687
- if (components.host) {
3688
- components.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol);
3689
- }
3690
- if (components.scheme === void 0 && components.userinfo === void 0 && components.host === void 0 && components.port === void 0 && !components.path && components.query === void 0) {
3691
- components.reference = "same-document";
3692
- } else if (components.scheme === void 0) {
3693
- components.reference = "relative";
3694
- } else if (components.fragment === void 0) {
3695
- components.reference = "absolute";
3696
- } else {
3697
- components.reference = "uri";
3698
- }
3699
- if (options.reference && options.reference !== "suffix" && options.reference !== components.reference) {
3700
- components.error = components.error || "URI is not a " + options.reference + " reference.";
3701
- }
3702
- var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()];
3703
- if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {
3704
- if (components.host && (options.domainHost || schemeHandler && schemeHandler.domainHost)) {
3705
- try {
3706
- components.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase());
3707
- } catch (e) {
3708
- components.error = components.error || "Host's domain name can not be converted to ASCII via punycode: " + e;
3709
- }
3710
- }
3711
- _normalizeComponentEncoding(components, URI_PROTOCOL);
3292
+ if (c === token) {
3293
+ skip = true;
3712
3294
  } else {
3713
- _normalizeComponentEncoding(components, protocol);
3714
- }
3715
- if (schemeHandler && schemeHandler.parse) {
3716
- schemeHandler.parse(components, options);
3295
+ skip = false;
3717
3296
  }
3297
+ out += c;
3298
+ }
3299
+ }
3300
+ return out;
3301
+ }
3302
+ function findToken(str, token) {
3303
+ let ind = 0;
3304
+ for (let i = 0; i < str.length; i++) {
3305
+ if (str[i] === token) ind++;
3306
+ }
3307
+ return ind;
3308
+ }
3309
+ var RDS1 = /^\.\.?\//u;
3310
+ var RDS2 = /^\/\.(?:\/|$)/u;
3311
+ var RDS3 = /^\/\.\.(?:\/|$)/u;
3312
+ var RDS5 = /^\/?(?:.|\n)*?(?=\/|$)/u;
3313
+ function removeDotSegments(input) {
3314
+ const output = [];
3315
+ while (input.length) {
3316
+ if (input.match(RDS1)) {
3317
+ input = input.replace(RDS1, "");
3318
+ } else if (input.match(RDS2)) {
3319
+ input = input.replace(RDS2, "/");
3320
+ } else if (input.match(RDS3)) {
3321
+ input = input.replace(RDS3, "/");
3322
+ output.pop();
3323
+ } else if (input === "." || input === "..") {
3324
+ input = "";
3718
3325
  } else {
3719
- components.error = components.error || "URI can not be parsed.";
3720
- }
3721
- return components;
3722
- }
3723
- function _recomposeAuthority(components, options) {
3724
- var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL;
3725
- var uriTokens = [];
3726
- if (components.userinfo !== void 0) {
3727
- uriTokens.push(components.userinfo);
3728
- uriTokens.push("@");
3729
- }
3730
- if (components.host !== void 0) {
3731
- uriTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, function(_, $1, $2) {
3732
- return "[" + $1 + ($2 ? "%25" + $2 : "") + "]";
3733
- }));
3734
- }
3735
- if (typeof components.port === "number" || typeof components.port === "string") {
3736
- uriTokens.push(":");
3737
- uriTokens.push(String(components.port));
3738
- }
3739
- return uriTokens.length ? uriTokens.join("") : void 0;
3740
- }
3741
- var RDS1 = /^\.\.?\//;
3742
- var RDS2 = /^\/\.(\/|$)/;
3743
- var RDS3 = /^\/\.\.(\/|$)/;
3744
- var RDS5 = /^\/?(?:.|\n)*?(?=\/|$)/;
3745
- function removeDotSegments(input) {
3746
- var output = [];
3747
- while (input.length) {
3748
- if (input.match(RDS1)) {
3749
- input = input.replace(RDS1, "");
3750
- } else if (input.match(RDS2)) {
3751
- input = input.replace(RDS2, "/");
3752
- } else if (input.match(RDS3)) {
3753
- input = input.replace(RDS3, "/");
3754
- output.pop();
3755
- } else if (input === "." || input === "..") {
3756
- input = "";
3326
+ const im = input.match(RDS5);
3327
+ if (im) {
3328
+ const s = im[0];
3329
+ input = input.slice(s.length);
3330
+ output.push(s);
3757
3331
  } else {
3758
- var im = input.match(RDS5);
3759
- if (im) {
3760
- var s = im[0];
3761
- input = input.slice(s.length);
3762
- output.push(s);
3763
- } else {
3764
- throw new Error("Unexpected dot segment condition");
3765
- }
3332
+ throw new Error("Unexpected dot segment condition");
3766
3333
  }
3767
3334
  }
3768
- return output.join("");
3769
- }
3770
- function serialize(components) {
3771
- var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
3772
- var protocol = options.iri ? IRI_PROTOCOL : URI_PROTOCOL;
3773
- var uriTokens = [];
3774
- var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()];
3775
- if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(components, options);
3776
- if (components.host) {
3777
- if (protocol.IPV6ADDRESS.test(components.host)) {
3778
- } else if (options.domainHost || schemeHandler && schemeHandler.domainHost) {
3779
- try {
3780
- components.host = !options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host);
3781
- } catch (e) {
3782
- components.error = components.error || "Host's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e;
3783
- }
3784
- }
3785
- }
3786
- _normalizeComponentEncoding(components, protocol);
3787
- if (options.reference !== "suffix" && components.scheme) {
3788
- uriTokens.push(components.scheme);
3789
- uriTokens.push(":");
3790
- }
3791
- var authority = _recomposeAuthority(components, options);
3792
- if (authority !== void 0) {
3793
- if (options.reference !== "suffix") {
3794
- uriTokens.push("//");
3795
- }
3796
- uriTokens.push(authority);
3797
- if (components.path && components.path.charAt(0) !== "/") {
3798
- uriTokens.push("/");
3799
- }
3800
- }
3801
- if (components.path !== void 0) {
3802
- var s = components.path;
3803
- if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {
3804
- s = removeDotSegments(s);
3805
- }
3806
- if (authority === void 0) {
3807
- s = s.replace(/^\/\//, "/%2F");
3335
+ }
3336
+ return output.join("");
3337
+ }
3338
+ function normalizeComponentEncoding(components, esc) {
3339
+ const func = esc !== true ? escape : unescape;
3340
+ if (components.scheme !== void 0) {
3341
+ components.scheme = func(components.scheme);
3342
+ }
3343
+ if (components.userinfo !== void 0) {
3344
+ components.userinfo = func(components.userinfo);
3345
+ }
3346
+ if (components.host !== void 0) {
3347
+ components.host = func(components.host);
3348
+ }
3349
+ if (components.path !== void 0) {
3350
+ components.path = func(components.path);
3351
+ }
3352
+ if (components.query !== void 0) {
3353
+ components.query = func(components.query);
3354
+ }
3355
+ if (components.fragment !== void 0) {
3356
+ components.fragment = func(components.fragment);
3357
+ }
3358
+ return components;
3359
+ }
3360
+ function recomposeAuthority(components, options) {
3361
+ const uriTokens = [];
3362
+ if (components.userinfo !== void 0) {
3363
+ uriTokens.push(components.userinfo);
3364
+ uriTokens.push("@");
3365
+ }
3366
+ if (components.host !== void 0) {
3367
+ let host = unescape(components.host);
3368
+ const ipV4res = normalizeIPv4(host);
3369
+ if (ipV4res.isIPV4) {
3370
+ host = ipV4res.host;
3371
+ } else {
3372
+ const ipV6res = normalizeIPv6(ipV4res.host, { isIPV4: false });
3373
+ if (ipV6res.isIPV6 === true) {
3374
+ host = `[${ipV6res.escapedHost}]`;
3375
+ } else {
3376
+ host = components.host;
3808
3377
  }
3809
- uriTokens.push(s);
3810
3378
  }
3811
- if (components.query !== void 0) {
3812
- uriTokens.push("?");
3813
- uriTokens.push(components.query);
3814
- }
3815
- if (components.fragment !== void 0) {
3816
- uriTokens.push("#");
3817
- uriTokens.push(components.fragment);
3818
- }
3819
- return uriTokens.join("");
3379
+ uriTokens.push(host);
3820
3380
  }
3821
- function resolveComponents(base2, relative) {
3822
- var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
3823
- var skipNormalization = arguments[3];
3824
- var target = {};
3825
- if (!skipNormalization) {
3826
- base2 = parse(serialize(base2, options), options);
3827
- relative = parse(serialize(relative, options), options);
3381
+ if (typeof components.port === "number" || typeof components.port === "string") {
3382
+ uriTokens.push(":");
3383
+ uriTokens.push(String(components.port));
3384
+ }
3385
+ return uriTokens.length ? uriTokens.join("") : void 0;
3386
+ }
3387
+ module.exports = {
3388
+ recomposeAuthority,
3389
+ normalizeComponentEncoding,
3390
+ removeDotSegments,
3391
+ normalizeIPv4,
3392
+ normalizeIPv6,
3393
+ stringArrayToHexStripped
3394
+ };
3395
+ }
3396
+ });
3397
+
3398
+ // node_modules/fast-uri/lib/schemes.js
3399
+ var require_schemes = __commonJS({
3400
+ "node_modules/fast-uri/lib/schemes.js"(exports, module) {
3401
+ "use strict";
3402
+ var UUID_REG = /^[\da-f]{8}\b-[\da-f]{4}\b-[\da-f]{4}\b-[\da-f]{4}\b-[\da-f]{12}$/iu;
3403
+ var URN_REG = /([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;
3404
+ function isSecure(wsComponents) {
3405
+ return typeof wsComponents.secure === "boolean" ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === "wss";
3406
+ }
3407
+ function httpParse(components) {
3408
+ if (!components.host) {
3409
+ components.error = components.error || "HTTP URIs must have a host.";
3410
+ }
3411
+ return components;
3412
+ }
3413
+ function httpSerialize(components) {
3414
+ const secure = String(components.scheme).toLowerCase() === "https";
3415
+ if (components.port === (secure ? 443 : 80) || components.port === "") {
3416
+ components.port = void 0;
3417
+ }
3418
+ if (!components.path) {
3419
+ components.path = "/";
3420
+ }
3421
+ return components;
3422
+ }
3423
+ function wsParse(wsComponents) {
3424
+ wsComponents.secure = isSecure(wsComponents);
3425
+ wsComponents.resourceName = (wsComponents.path || "/") + (wsComponents.query ? "?" + wsComponents.query : "");
3426
+ wsComponents.path = void 0;
3427
+ wsComponents.query = void 0;
3428
+ return wsComponents;
3429
+ }
3430
+ function wsSerialize(wsComponents) {
3431
+ if (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === "") {
3432
+ wsComponents.port = void 0;
3433
+ }
3434
+ if (typeof wsComponents.secure === "boolean") {
3435
+ wsComponents.scheme = wsComponents.secure ? "wss" : "ws";
3436
+ wsComponents.secure = void 0;
3437
+ }
3438
+ if (wsComponents.resourceName) {
3439
+ const [path, query] = wsComponents.resourceName.split("?");
3440
+ wsComponents.path = path && path !== "/" ? path : void 0;
3441
+ wsComponents.query = query;
3442
+ wsComponents.resourceName = void 0;
3443
+ }
3444
+ wsComponents.fragment = void 0;
3445
+ return wsComponents;
3446
+ }
3447
+ function urnParse(urnComponents, options) {
3448
+ if (!urnComponents.path) {
3449
+ urnComponents.error = "URN can not be parsed";
3450
+ return urnComponents;
3451
+ }
3452
+ const matches = urnComponents.path.match(URN_REG);
3453
+ if (matches) {
3454
+ const scheme = options.scheme || urnComponents.scheme || "urn";
3455
+ urnComponents.nid = matches[1].toLowerCase();
3456
+ urnComponents.nss = matches[2];
3457
+ const urnScheme = `${scheme}:${options.nid || urnComponents.nid}`;
3458
+ const schemeHandler = SCHEMES[urnScheme];
3459
+ urnComponents.path = void 0;
3460
+ if (schemeHandler) {
3461
+ urnComponents = schemeHandler.parse(urnComponents, options);
3828
3462
  }
3829
- options = options || {};
3830
- if (!options.tolerant && relative.scheme) {
3831
- target.scheme = relative.scheme;
3463
+ } else {
3464
+ urnComponents.error = urnComponents.error || "URN can not be parsed.";
3465
+ }
3466
+ return urnComponents;
3467
+ }
3468
+ function urnSerialize(urnComponents, options) {
3469
+ const scheme = options.scheme || urnComponents.scheme || "urn";
3470
+ const nid = urnComponents.nid.toLowerCase();
3471
+ const urnScheme = `${scheme}:${options.nid || nid}`;
3472
+ const schemeHandler = SCHEMES[urnScheme];
3473
+ if (schemeHandler) {
3474
+ urnComponents = schemeHandler.serialize(urnComponents, options);
3475
+ }
3476
+ const uriComponents = urnComponents;
3477
+ const nss = urnComponents.nss;
3478
+ uriComponents.path = `${nid || options.nid}:${nss}`;
3479
+ options.skipEscape = true;
3480
+ return uriComponents;
3481
+ }
3482
+ function urnuuidParse(urnComponents, options) {
3483
+ const uuidComponents = urnComponents;
3484
+ uuidComponents.uuid = uuidComponents.nss;
3485
+ uuidComponents.nss = void 0;
3486
+ if (!options.tolerant && (!uuidComponents.uuid || !UUID_REG.test(uuidComponents.uuid))) {
3487
+ uuidComponents.error = uuidComponents.error || "UUID is not valid.";
3488
+ }
3489
+ return uuidComponents;
3490
+ }
3491
+ function urnuuidSerialize(uuidComponents) {
3492
+ const urnComponents = uuidComponents;
3493
+ urnComponents.nss = (uuidComponents.uuid || "").toLowerCase();
3494
+ return urnComponents;
3495
+ }
3496
+ var http = {
3497
+ scheme: "http",
3498
+ domainHost: true,
3499
+ parse: httpParse,
3500
+ serialize: httpSerialize
3501
+ };
3502
+ var https = {
3503
+ scheme: "https",
3504
+ domainHost: http.domainHost,
3505
+ parse: httpParse,
3506
+ serialize: httpSerialize
3507
+ };
3508
+ var ws = {
3509
+ scheme: "ws",
3510
+ domainHost: true,
3511
+ parse: wsParse,
3512
+ serialize: wsSerialize
3513
+ };
3514
+ var wss = {
3515
+ scheme: "wss",
3516
+ domainHost: ws.domainHost,
3517
+ parse: ws.parse,
3518
+ serialize: ws.serialize
3519
+ };
3520
+ var urn = {
3521
+ scheme: "urn",
3522
+ parse: urnParse,
3523
+ serialize: urnSerialize,
3524
+ skipNormalize: true
3525
+ };
3526
+ var urnuuid = {
3527
+ scheme: "urn:uuid",
3528
+ parse: urnuuidParse,
3529
+ serialize: urnuuidSerialize,
3530
+ skipNormalize: true
3531
+ };
3532
+ var SCHEMES = {
3533
+ http,
3534
+ https,
3535
+ ws,
3536
+ wss,
3537
+ urn,
3538
+ "urn:uuid": urnuuid
3539
+ };
3540
+ module.exports = SCHEMES;
3541
+ }
3542
+ });
3543
+
3544
+ // node_modules/fast-uri/index.js
3545
+ var require_fast_uri = __commonJS({
3546
+ "node_modules/fast-uri/index.js"(exports, module) {
3547
+ "use strict";
3548
+ var { normalizeIPv6, normalizeIPv4, removeDotSegments, recomposeAuthority, normalizeComponentEncoding } = require_utils();
3549
+ var SCHEMES = require_schemes();
3550
+ function normalize(uri, options) {
3551
+ if (typeof uri === "string") {
3552
+ uri = serialize(parse(uri, options), options);
3553
+ } else if (typeof uri === "object") {
3554
+ uri = parse(serialize(uri, options), options);
3555
+ }
3556
+ return uri;
3557
+ }
3558
+ function resolve(baseURI, relativeURI, options) {
3559
+ const schemelessOptions = Object.assign({ scheme: "null" }, options);
3560
+ const resolved = resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true);
3561
+ return serialize(resolved, __spreadProps(__spreadValues({}, schemelessOptions), { skipEscape: true }));
3562
+ }
3563
+ function resolveComponents(base, relative, options, skipNormalization) {
3564
+ const target = {};
3565
+ if (!skipNormalization) {
3566
+ base = parse(serialize(base, options), options);
3567
+ relative = parse(serialize(relative, options), options);
3568
+ }
3569
+ options = options || {};
3570
+ if (!options.tolerant && relative.scheme) {
3571
+ target.scheme = relative.scheme;
3572
+ target.userinfo = relative.userinfo;
3573
+ target.host = relative.host;
3574
+ target.port = relative.port;
3575
+ target.path = removeDotSegments(relative.path || "");
3576
+ target.query = relative.query;
3577
+ } else {
3578
+ if (relative.userinfo !== void 0 || relative.host !== void 0 || relative.port !== void 0) {
3832
3579
  target.userinfo = relative.userinfo;
3833
3580
  target.host = relative.host;
3834
3581
  target.port = relative.port;
3835
3582
  target.path = removeDotSegments(relative.path || "");
3836
3583
  target.query = relative.query;
3837
3584
  } else {
3838
- if (relative.userinfo !== void 0 || relative.host !== void 0 || relative.port !== void 0) {
3839
- target.userinfo = relative.userinfo;
3840
- target.host = relative.host;
3841
- target.port = relative.port;
3842
- target.path = removeDotSegments(relative.path || "");
3843
- target.query = relative.query;
3585
+ if (!relative.path) {
3586
+ target.path = base.path;
3587
+ if (relative.query !== void 0) {
3588
+ target.query = relative.query;
3589
+ } else {
3590
+ target.query = base.query;
3591
+ }
3844
3592
  } else {
3845
- if (!relative.path) {
3846
- target.path = base2.path;
3847
- if (relative.query !== void 0) {
3848
- target.query = relative.query;
3849
- } else {
3850
- target.query = base2.query;
3851
- }
3593
+ if (relative.path.charAt(0) === "/") {
3594
+ target.path = removeDotSegments(relative.path);
3852
3595
  } else {
3853
- if (relative.path.charAt(0) === "/") {
3854
- target.path = removeDotSegments(relative.path);
3596
+ if ((base.userinfo !== void 0 || base.host !== void 0 || base.port !== void 0) && !base.path) {
3597
+ target.path = "/" + relative.path;
3598
+ } else if (!base.path) {
3599
+ target.path = relative.path;
3855
3600
  } else {
3856
- if ((base2.userinfo !== void 0 || base2.host !== void 0 || base2.port !== void 0) && !base2.path) {
3857
- target.path = "/" + relative.path;
3858
- } else if (!base2.path) {
3859
- target.path = relative.path;
3860
- } else {
3861
- target.path = base2.path.slice(0, base2.path.lastIndexOf("/") + 1) + relative.path;
3862
- }
3863
- target.path = removeDotSegments(target.path);
3601
+ target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path;
3864
3602
  }
3865
- target.query = relative.query;
3603
+ target.path = removeDotSegments(target.path);
3866
3604
  }
3867
- target.userinfo = base2.userinfo;
3868
- target.host = base2.host;
3869
- target.port = base2.port;
3605
+ target.query = relative.query;
3606
+ }
3607
+ target.userinfo = base.userinfo;
3608
+ target.host = base.host;
3609
+ target.port = base.port;
3610
+ }
3611
+ target.scheme = base.scheme;
3612
+ }
3613
+ target.fragment = relative.fragment;
3614
+ return target;
3615
+ }
3616
+ function equal(uriA, uriB, options) {
3617
+ if (typeof uriA === "string") {
3618
+ uriA = unescape(uriA);
3619
+ uriA = serialize(normalizeComponentEncoding(parse(uriA, options), true), __spreadProps(__spreadValues({}, options), { skipEscape: true }));
3620
+ } else if (typeof uriA === "object") {
3621
+ uriA = serialize(normalizeComponentEncoding(uriA, true), __spreadProps(__spreadValues({}, options), { skipEscape: true }));
3622
+ }
3623
+ if (typeof uriB === "string") {
3624
+ uriB = unescape(uriB);
3625
+ uriB = serialize(normalizeComponentEncoding(parse(uriB, options), true), __spreadProps(__spreadValues({}, options), { skipEscape: true }));
3626
+ } else if (typeof uriB === "object") {
3627
+ uriB = serialize(normalizeComponentEncoding(uriB, true), __spreadProps(__spreadValues({}, options), { skipEscape: true }));
3628
+ }
3629
+ return uriA.toLowerCase() === uriB.toLowerCase();
3630
+ }
3631
+ function serialize(cmpts, opts) {
3632
+ const components = {
3633
+ host: cmpts.host,
3634
+ scheme: cmpts.scheme,
3635
+ userinfo: cmpts.userinfo,
3636
+ port: cmpts.port,
3637
+ path: cmpts.path,
3638
+ query: cmpts.query,
3639
+ nid: cmpts.nid,
3640
+ nss: cmpts.nss,
3641
+ uuid: cmpts.uuid,
3642
+ fragment: cmpts.fragment,
3643
+ reference: cmpts.reference,
3644
+ resourceName: cmpts.resourceName,
3645
+ secure: cmpts.secure,
3646
+ error: ""
3647
+ };
3648
+ const options = Object.assign({}, opts);
3649
+ const uriTokens = [];
3650
+ const schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()];
3651
+ if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(components, options);
3652
+ if (components.path !== void 0) {
3653
+ if (!options.skipEscape) {
3654
+ components.path = escape(components.path);
3655
+ if (components.scheme !== void 0) {
3656
+ components.path = components.path.split("%3A").join(":");
3870
3657
  }
3871
- target.scheme = base2.scheme;
3658
+ } else {
3659
+ components.path = unescape(components.path);
3872
3660
  }
3873
- target.fragment = relative.fragment;
3874
- return target;
3875
3661
  }
3876
- function resolve(baseURI, relativeURI, options) {
3877
- var schemelessOptions = assign({ scheme: "null" }, options);
3878
- return serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions);
3662
+ if (options.reference !== "suffix" && components.scheme) {
3663
+ uriTokens.push(components.scheme);
3664
+ uriTokens.push(":");
3879
3665
  }
3880
- function normalize(uri, options) {
3881
- if (typeof uri === "string") {
3882
- uri = serialize(parse(uri, options), options);
3883
- } else if (typeOf(uri) === "object") {
3884
- uri = parse(serialize(uri, options), options);
3666
+ const authority = recomposeAuthority(components, options);
3667
+ if (authority !== void 0) {
3668
+ if (options.reference !== "suffix") {
3669
+ uriTokens.push("//");
3670
+ }
3671
+ uriTokens.push(authority);
3672
+ if (components.path && components.path.charAt(0) !== "/") {
3673
+ uriTokens.push("/");
3885
3674
  }
3886
- return uri;
3887
3675
  }
3888
- function equal(uriA, uriB, options) {
3889
- if (typeof uriA === "string") {
3890
- uriA = serialize(parse(uriA, options), options);
3891
- } else if (typeOf(uriA) === "object") {
3892
- uriA = serialize(uriA, options);
3676
+ if (components.path !== void 0) {
3677
+ let s = components.path;
3678
+ if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {
3679
+ s = removeDotSegments(s);
3893
3680
  }
3894
- if (typeof uriB === "string") {
3895
- uriB = serialize(parse(uriB, options), options);
3896
- } else if (typeOf(uriB) === "object") {
3897
- uriB = serialize(uriB, options);
3681
+ if (authority === void 0) {
3682
+ s = s.replace(/^\/\//u, "/%2F");
3898
3683
  }
3899
- return uriA === uriB;
3684
+ uriTokens.push(s);
3900
3685
  }
3901
- function escapeComponent(str, options) {
3902
- return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE, pctEncChar);
3686
+ if (components.query !== void 0) {
3687
+ uriTokens.push("?");
3688
+ uriTokens.push(components.query);
3903
3689
  }
3904
- function unescapeComponent(str, options) {
3905
- return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED, pctDecChars);
3690
+ if (components.fragment !== void 0) {
3691
+ uriTokens.push("#");
3692
+ uriTokens.push(components.fragment);
3906
3693
  }
3907
- var handler = {
3908
- scheme: "http",
3909
- domainHost: true,
3910
- parse: function parse2(components, options) {
3911
- if (!components.host) {
3912
- components.error = components.error || "HTTP URIs must have a host.";
3913
- }
3914
- return components;
3915
- },
3916
- serialize: function serialize2(components, options) {
3917
- var secure = String(components.scheme).toLowerCase() === "https";
3918
- if (components.port === (secure ? 443 : 80) || components.port === "") {
3919
- components.port = void 0;
3920
- }
3921
- if (!components.path) {
3922
- components.path = "/";
3923
- }
3924
- return components;
3694
+ return uriTokens.join("");
3695
+ }
3696
+ var hexLookUp = Array.from({ length: 127 }, (v, k) => /[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(k)));
3697
+ function nonSimpleDomain(value) {
3698
+ let code = 0;
3699
+ for (let i = 0, len = value.length; i < len; ++i) {
3700
+ code = value.charCodeAt(i);
3701
+ if (code > 126 || hexLookUp[code]) {
3702
+ return true;
3925
3703
  }
3704
+ }
3705
+ return false;
3706
+ }
3707
+ var URI_PARSE = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;
3708
+ function parse(uri, opts) {
3709
+ const options = Object.assign({}, opts);
3710
+ const parsed = {
3711
+ scheme: void 0,
3712
+ userinfo: void 0,
3713
+ host: "",
3714
+ port: void 0,
3715
+ path: "",
3716
+ query: void 0,
3717
+ fragment: void 0
3926
3718
  };
3927
- var handler$1 = {
3928
- scheme: "https",
3929
- domainHost: handler.domainHost,
3930
- parse: handler.parse,
3931
- serialize: handler.serialize
3932
- };
3933
- function isSecure(wsComponents) {
3934
- return typeof wsComponents.secure === "boolean" ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === "wss";
3935
- }
3936
- var handler$2 = {
3937
- scheme: "ws",
3938
- domainHost: true,
3939
- parse: function parse2(components, options) {
3940
- var wsComponents = components;
3941
- wsComponents.secure = isSecure(wsComponents);
3942
- wsComponents.resourceName = (wsComponents.path || "/") + (wsComponents.query ? "?" + wsComponents.query : "");
3943
- wsComponents.path = void 0;
3944
- wsComponents.query = void 0;
3945
- return wsComponents;
3946
- },
3947
- serialize: function serialize2(wsComponents, options) {
3948
- if (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === "") {
3949
- wsComponents.port = void 0;
3950
- }
3951
- if (typeof wsComponents.secure === "boolean") {
3952
- wsComponents.scheme = wsComponents.secure ? "wss" : "ws";
3953
- wsComponents.secure = void 0;
3954
- }
3955
- if (wsComponents.resourceName) {
3956
- var _wsComponents$resourc = wsComponents.resourceName.split("?"), _wsComponents$resourc2 = slicedToArray(_wsComponents$resourc, 2), path = _wsComponents$resourc2[0], query = _wsComponents$resourc2[1];
3957
- wsComponents.path = path && path !== "/" ? path : void 0;
3958
- wsComponents.query = query;
3959
- wsComponents.resourceName = void 0;
3719
+ const gotEncoding = uri.indexOf("%") !== -1;
3720
+ let isIP = false;
3721
+ if (options.reference === "suffix") uri = (options.scheme ? options.scheme + ":" : "") + "//" + uri;
3722
+ const matches = uri.match(URI_PARSE);
3723
+ if (matches) {
3724
+ parsed.scheme = matches[1];
3725
+ parsed.userinfo = matches[3];
3726
+ parsed.host = matches[4];
3727
+ parsed.port = parseInt(matches[5], 10);
3728
+ parsed.path = matches[6] || "";
3729
+ parsed.query = matches[7];
3730
+ parsed.fragment = matches[8];
3731
+ if (isNaN(parsed.port)) {
3732
+ parsed.port = matches[5];
3733
+ }
3734
+ if (parsed.host) {
3735
+ const ipv4result = normalizeIPv4(parsed.host);
3736
+ if (ipv4result.isIPV4 === false) {
3737
+ const ipv6result = normalizeIPv6(ipv4result.host, { isIPV4: false });
3738
+ parsed.host = ipv6result.host.toLowerCase();
3739
+ isIP = ipv6result.isIPV6;
3740
+ } else {
3741
+ parsed.host = ipv4result.host;
3742
+ isIP = true;
3960
3743
  }
3961
- wsComponents.fragment = void 0;
3962
- return wsComponents;
3963
3744
  }
3964
- };
3965
- var handler$3 = {
3966
- scheme: "wss",
3967
- domainHost: handler$2.domainHost,
3968
- parse: handler$2.parse,
3969
- serialize: handler$2.serialize
3970
- };
3971
- var O = {};
3972
- var isIRI = true;
3973
- var UNRESERVED$$ = "[A-Za-z0-9\\-\\.\\_\\~" + (isIRI ? "\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF" : "") + "]";
3974
- var HEXDIG$$ = "[0-9A-Fa-f]";
3975
- var PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$));
3976
- var ATEXT$$ = "[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]";
3977
- var QTEXT$$ = "[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]";
3978
- var VCHAR$$ = merge(QTEXT$$, '[\\"\\\\]');
3979
- var SOME_DELIMS$$ = "[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]";
3980
- var UNRESERVED = new RegExp(UNRESERVED$$, "g");
3981
- var PCT_ENCODED = new RegExp(PCT_ENCODED$, "g");
3982
- var NOT_LOCAL_PART = new RegExp(merge("[^]", ATEXT$$, "[\\.]", '[\\"]', VCHAR$$), "g");
3983
- var NOT_HFNAME = new RegExp(merge("[^]", UNRESERVED$$, SOME_DELIMS$$), "g");
3984
- var NOT_HFVALUE = NOT_HFNAME;
3985
- function decodeUnreserved(str) {
3986
- var decStr = pctDecChars(str);
3987
- return !decStr.match(UNRESERVED) ? str : decStr;
3988
- }
3989
- var handler$4 = {
3990
- scheme: "mailto",
3991
- parse: function parse$$1(components, options) {
3992
- var mailtoComponents = components;
3993
- var to = mailtoComponents.to = mailtoComponents.path ? mailtoComponents.path.split(",") : [];
3994
- mailtoComponents.path = void 0;
3995
- if (mailtoComponents.query) {
3996
- var unknownHeaders = false;
3997
- var headers = {};
3998
- var hfields = mailtoComponents.query.split("&");
3999
- for (var x = 0, xl = hfields.length; x < xl; ++x) {
4000
- var hfield = hfields[x].split("=");
4001
- switch (hfield[0]) {
4002
- case "to":
4003
- var toAddrs = hfield[1].split(",");
4004
- for (var _x = 0, _xl = toAddrs.length; _x < _xl; ++_x) {
4005
- to.push(toAddrs[_x]);
4006
- }
4007
- break;
4008
- case "subject":
4009
- mailtoComponents.subject = unescapeComponent(hfield[1], options);
4010
- break;
4011
- case "body":
4012
- mailtoComponents.body = unescapeComponent(hfield[1], options);
4013
- break;
4014
- default:
4015
- unknownHeaders = true;
4016
- headers[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options);
4017
- break;
4018
- }
4019
- }
4020
- if (unknownHeaders) mailtoComponents.headers = headers;
4021
- }
4022
- mailtoComponents.query = void 0;
4023
- for (var _x2 = 0, _xl2 = to.length; _x2 < _xl2; ++_x2) {
4024
- var addr = to[_x2].split("@");
4025
- addr[0] = unescapeComponent(addr[0]);
4026
- if (!options.unicodeSupport) {
4027
- try {
4028
- addr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase());
4029
- } catch (e) {
4030
- mailtoComponents.error = mailtoComponents.error || "Email address's domain name can not be converted to ASCII via punycode: " + e;
4031
- }
4032
- } else {
4033
- addr[1] = unescapeComponent(addr[1], options).toLowerCase();
3745
+ if (parsed.scheme === void 0 && parsed.userinfo === void 0 && parsed.host === void 0 && parsed.port === void 0 && !parsed.path && parsed.query === void 0) {
3746
+ parsed.reference = "same-document";
3747
+ } else if (parsed.scheme === void 0) {
3748
+ parsed.reference = "relative";
3749
+ } else if (parsed.fragment === void 0) {
3750
+ parsed.reference = "absolute";
3751
+ } else {
3752
+ parsed.reference = "uri";
3753
+ }
3754
+ if (options.reference && options.reference !== "suffix" && options.reference !== parsed.reference) {
3755
+ parsed.error = parsed.error || "URI is not a " + options.reference + " reference.";
3756
+ }
3757
+ const schemeHandler = SCHEMES[(options.scheme || parsed.scheme || "").toLowerCase()];
3758
+ if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {
3759
+ if (parsed.host && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === false && nonSimpleDomain(parsed.host)) {
3760
+ try {
3761
+ parsed.host = URL.domainToASCII(parsed.host.toLowerCase());
3762
+ } catch (e) {
3763
+ parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e;
4034
3764
  }
4035
- to[_x2] = addr.join("@");
4036
3765
  }
4037
- return mailtoComponents;
4038
- },
4039
- serialize: function serialize$$1(mailtoComponents, options) {
4040
- var components = mailtoComponents;
4041
- var to = toArray(mailtoComponents.to);
4042
- if (to) {
4043
- for (var x = 0, xl = to.length; x < xl; ++x) {
4044
- var toAddr = String(to[x]);
4045
- var atIdx = toAddr.lastIndexOf("@");
4046
- var localPart = toAddr.slice(0, atIdx).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar);
4047
- var domain = toAddr.slice(atIdx + 1);
4048
- try {
4049
- domain = !options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain);
4050
- } catch (e) {
4051
- components.error = components.error || "Email address's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e;
4052
- }
4053
- to[x] = localPart + "@" + domain;
4054
- }
4055
- components.path = to.join(",");
3766
+ }
3767
+ if (!schemeHandler || schemeHandler && !schemeHandler.skipNormalize) {
3768
+ if (gotEncoding && parsed.scheme !== void 0) {
3769
+ parsed.scheme = unescape(parsed.scheme);
4056
3770
  }
4057
- var headers = mailtoComponents.headers = mailtoComponents.headers || {};
4058
- if (mailtoComponents.subject) headers["subject"] = mailtoComponents.subject;
4059
- if (mailtoComponents.body) headers["body"] = mailtoComponents.body;
4060
- var fields = [];
4061
- for (var name in headers) {
4062
- if (headers[name] !== O[name]) {
4063
- fields.push(name.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) + "=" + headers[name].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar));
4064
- }
3771
+ if (gotEncoding && parsed.userinfo !== void 0) {
3772
+ parsed.userinfo = unescape(parsed.userinfo);
4065
3773
  }
4066
- if (fields.length) {
4067
- components.query = fields.join("&");
3774
+ if (gotEncoding && parsed.host !== void 0) {
3775
+ parsed.host = unescape(parsed.host);
4068
3776
  }
4069
- return components;
4070
- }
4071
- };
4072
- var URN_PARSE = /^([^\:]+)\:(.*)/;
4073
- var handler$5 = {
4074
- scheme: "urn",
4075
- parse: function parse$$1(components, options) {
4076
- var matches = components.path && components.path.match(URN_PARSE);
4077
- var urnComponents = components;
4078
- if (matches) {
4079
- var scheme = options.scheme || urnComponents.scheme || "urn";
4080
- var nid = matches[1].toLowerCase();
4081
- var nss = matches[2];
4082
- var urnScheme = scheme + ":" + (options.nid || nid);
4083
- var schemeHandler = SCHEMES[urnScheme];
4084
- urnComponents.nid = nid;
4085
- urnComponents.nss = nss;
4086
- urnComponents.path = void 0;
4087
- if (schemeHandler) {
4088
- urnComponents = schemeHandler.parse(urnComponents, options);
4089
- }
4090
- } else {
4091
- urnComponents.error = urnComponents.error || "URN can not be parsed.";
3777
+ if (parsed.path !== void 0 && parsed.path.length) {
3778
+ parsed.path = escape(unescape(parsed.path));
4092
3779
  }
4093
- return urnComponents;
4094
- },
4095
- serialize: function serialize$$1(urnComponents, options) {
4096
- var scheme = options.scheme || urnComponents.scheme || "urn";
4097
- var nid = urnComponents.nid;
4098
- var urnScheme = scheme + ":" + (options.nid || nid);
4099
- var schemeHandler = SCHEMES[urnScheme];
4100
- if (schemeHandler) {
4101
- urnComponents = schemeHandler.serialize(urnComponents, options);
3780
+ if (parsed.fragment !== void 0 && parsed.fragment.length) {
3781
+ parsed.fragment = encodeURI(decodeURIComponent(parsed.fragment));
4102
3782
  }
4103
- var uriComponents = urnComponents;
4104
- var nss = urnComponents.nss;
4105
- uriComponents.path = (nid || options.nid) + ":" + nss;
4106
- return uriComponents;
4107
3783
  }
4108
- };
4109
- var UUID = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/;
4110
- var handler$6 = {
4111
- scheme: "urn:uuid",
4112
- parse: function parse2(urnComponents, options) {
4113
- var uuidComponents = urnComponents;
4114
- uuidComponents.uuid = uuidComponents.nss;
4115
- uuidComponents.nss = void 0;
4116
- if (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) {
4117
- uuidComponents.error = uuidComponents.error || "UUID is not valid.";
4118
- }
4119
- return uuidComponents;
4120
- },
4121
- serialize: function serialize2(uuidComponents, options) {
4122
- var urnComponents = uuidComponents;
4123
- urnComponents.nss = (uuidComponents.uuid || "").toLowerCase();
4124
- return urnComponents;
3784
+ if (schemeHandler && schemeHandler.parse) {
3785
+ schemeHandler.parse(parsed, options);
4125
3786
  }
4126
- };
4127
- SCHEMES[handler.scheme] = handler;
4128
- SCHEMES[handler$1.scheme] = handler$1;
4129
- SCHEMES[handler$2.scheme] = handler$2;
4130
- SCHEMES[handler$3.scheme] = handler$3;
4131
- SCHEMES[handler$4.scheme] = handler$4;
4132
- SCHEMES[handler$5.scheme] = handler$5;
4133
- SCHEMES[handler$6.scheme] = handler$6;
4134
- exports2.SCHEMES = SCHEMES;
4135
- exports2.pctEncChar = pctEncChar;
4136
- exports2.pctDecChars = pctDecChars;
4137
- exports2.parse = parse;
4138
- exports2.removeDotSegments = removeDotSegments;
4139
- exports2.serialize = serialize;
4140
- exports2.resolveComponents = resolveComponents;
4141
- exports2.resolve = resolve;
4142
- exports2.normalize = normalize;
4143
- exports2.equal = equal;
4144
- exports2.escapeComponent = escapeComponent;
4145
- exports2.unescapeComponent = unescapeComponent;
4146
- Object.defineProperty(exports2, "__esModule", { value: true });
4147
- });
3787
+ } else {
3788
+ parsed.error = parsed.error || "URI can not be parsed.";
3789
+ }
3790
+ return parsed;
3791
+ }
3792
+ var fastUri = {
3793
+ SCHEMES,
3794
+ normalize,
3795
+ resolve,
3796
+ resolveComponents,
3797
+ equal,
3798
+ serialize,
3799
+ parse
3800
+ };
3801
+ module.exports = fastUri;
3802
+ module.exports.default = fastUri;
3803
+ module.exports.fastUri = fastUri;
4148
3804
  }
4149
3805
  });
4150
3806
 
@@ -4153,7 +3809,7 @@ var require_uri = __commonJS({
4153
3809
  "node_modules/ajv/dist/runtime/uri.js"(exports) {
4154
3810
  "use strict";
4155
3811
  Object.defineProperty(exports, "__esModule", { value: true });
4156
- var uri = require_uri_all();
3812
+ var uri = require_fast_uri();
4157
3813
  uri.code = 'require("ajv/dist/runtime/uri").default';
4158
3814
  exports.default = uri;
4159
3815
  }
@@ -6885,6 +6541,8 @@ import GetTransferGroupFnInputSchema from "../fns/get-transfer-group/get-transfe
6885
6541
  import GetTransferGroupFnOutputSchema from "../fns/get-transfer-group/get-transfer-group.schema.output.json";
6886
6542
  import GetWalletFnInputSchema from "../fns/get-wallet/get-wallet.schema.input.json";
6887
6543
  import GetWalletFnOutputSchema from "../fns/get-wallet/get-wallet.schema.output.json";
6544
+ import HealthcheckFnInputSchema from "../fns/healthcheck/healthcheck.schema.input.json";
6545
+ import HealthcheckFnOutputSchema from "../fns/healthcheck/healthcheck.schema.output.json";
6888
6546
  import ImportDataFnInputSchema from "../fns/import-data/import-data.schema.input.json";
6889
6547
  import ImportDataFnOutputSchema from "../fns/import-data/import-data.schema.output.json";
6890
6548
  import ReverseTransferFnInputSchema from "../fns/reverse-transfer/reverse-transfer.schema.input.json";
@@ -6969,6 +6627,8 @@ import GetWalletTxInputSchema from "../txs/get-wallet/get-wallet.schema.input.js
6969
6627
  import GetWalletTxOutputSchema from "../txs/get-wallet/get-wallet.schema.output.json";
6970
6628
  import GetWalletManyTxInputSchema from "../txs/get-wallet-many/get-wallet-many.schema.input.json";
6971
6629
  import GetWalletManyTxOutputSchema from "../txs/get-wallet-many/get-wallet-many.schema.output.json";
6630
+ import HealthcheckTxInputSchema from "../txs/healthcheck/healthcheck.schema.input.json";
6631
+ import HealthcheckTxOutputSchema from "../txs/healthcheck/healthcheck.schema.output.json";
6972
6632
  import ImportActionsTxInputSchema from "../txs/import-actions/import-actions.schema.input.json";
6973
6633
  import ImportActionsTxOutputSchema from "../txs/import-actions/import-actions.schema.output.json";
6974
6634
  import ImportDatabaseTxInputSchema from "../txs/import-database/import-database.schema.input.json";
@@ -7012,7 +6672,7 @@ var ajv = new import_ajv.default({
7012
6672
  coerceTypes: true,
7013
6673
  // Client side allows looser input, API will not
7014
6674
  formats: {
7015
- validkey: /^[A-Za-z_][A-Za-z0-9_-]+?$/
6675
+ validkey: /^(?!.*\.\.)[a-zA-Z_][a-zA-Z0-9_.-]*[a-zA-Z0-9_-]$/
7016
6676
  },
7017
6677
  strict: false
7018
6678
  });
@@ -7658,6 +7318,22 @@ ajv.addSchema(
7658
7318
  "/fns/get-wallet/get-wallet.schema.output.json"
7659
7319
  );
7660
7320
  Schemas.GetWalletFnOutput = GetWalletFnOutputSchema;
7321
+ ajv.addSchema(
7322
+ fixSelfRefs(
7323
+ HealthcheckFnInputSchema,
7324
+ "/fns/healthcheck/healthcheck.schema.input.json"
7325
+ ),
7326
+ "/fns/healthcheck/healthcheck.schema.input.json"
7327
+ );
7328
+ Schemas.HealthcheckFnInput = HealthcheckFnInputSchema;
7329
+ ajv.addSchema(
7330
+ fixSelfRefs(
7331
+ HealthcheckFnOutputSchema,
7332
+ "/fns/healthcheck/healthcheck.schema.output.json"
7333
+ ),
7334
+ "/fns/healthcheck/healthcheck.schema.output.json"
7335
+ );
7336
+ Schemas.HealthcheckFnOutput = HealthcheckFnOutputSchema;
7661
7337
  ajv.addSchema(
7662
7338
  fixSelfRefs(
7663
7339
  ImportDataFnInputSchema,
@@ -8348,6 +8024,22 @@ ajv.addSchema(
8348
8024
  "/txs/get-wallet-many/get-wallet-many.schema.output.json"
8349
8025
  );
8350
8026
  Schemas.GetWalletManyTxOutput = GetWalletManyTxOutputSchema;
8027
+ ajv.addSchema(
8028
+ fixSelfRefs(
8029
+ HealthcheckTxInputSchema,
8030
+ "/txs/healthcheck/healthcheck.schema.input.json"
8031
+ ),
8032
+ "/txs/healthcheck/healthcheck.schema.input.json"
8033
+ );
8034
+ Schemas.HealthcheckTxInput = HealthcheckTxInputSchema;
8035
+ ajv.addSchema(
8036
+ fixSelfRefs(
8037
+ HealthcheckTxOutputSchema,
8038
+ "/txs/healthcheck/healthcheck.schema.output.json"
8039
+ ),
8040
+ "/txs/healthcheck/healthcheck.schema.output.json"
8041
+ );
8042
+ Schemas.HealthcheckTxOutput = HealthcheckTxOutputSchema;
8351
8043
  ajv.addSchema(
8352
8044
  fixSelfRefs(
8353
8045
  ImportActionsTxInputSchema,
@@ -8728,6 +8420,8 @@ var SchemaNames = /* @__PURE__ */ ((SchemaNames2) => {
8728
8420
  SchemaNames2["GetTransferGroupFnOutput"] = "GetTransferGroupFnOutput";
8729
8421
  SchemaNames2["GetWalletFnInput"] = "GetWalletFnInput";
8730
8422
  SchemaNames2["GetWalletFnOutput"] = "GetWalletFnOutput";
8423
+ SchemaNames2["HealthcheckFnInput"] = "HealthcheckFnInput";
8424
+ SchemaNames2["HealthcheckFnOutput"] = "HealthcheckFnOutput";
8731
8425
  SchemaNames2["ImportDataFnInput"] = "ImportDataFnInput";
8732
8426
  SchemaNames2["ImportDataFnOptions"] = "ImportDataFnOptions";
8733
8427
  SchemaNames2["ImportDataFnStreamChunk"] = "ImportDataFnStreamChunk";
@@ -8814,6 +8508,8 @@ var SchemaNames = /* @__PURE__ */ ((SchemaNames2) => {
8814
8508
  SchemaNames2["GetWalletTxOutput"] = "GetWalletTxOutput";
8815
8509
  SchemaNames2["GetWalletManyTxInput"] = "GetWalletManyTxInput";
8816
8510
  SchemaNames2["GetWalletManyTxOutput"] = "GetWalletManyTxOutput";
8511
+ SchemaNames2["HealthcheckTxInput"] = "HealthcheckTxInput";
8512
+ SchemaNames2["HealthcheckTxOutput"] = "HealthcheckTxOutput";
8817
8513
  SchemaNames2["ImportActionsTxInput"] = "ImportActionsTxInput";
8818
8514
  SchemaNames2["ImportActionsTxOptions"] = "ImportActionsTxOptions";
8819
8515
  SchemaNames2["ImportActionsTxStreamChunk"] = "ImportActionsTxStreamChunk";
@@ -8903,8 +8599,3 @@ export {
8903
8599
  createValidator,
8904
8600
  getValidator
8905
8601
  };
8906
- /*! Bundled license information:
8907
-
8908
- uri-js/dist/es5/uri.all.js:
8909
- (** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js *)
8910
- */