@hpcc-js/marshaller 2.25.49 → 2.25.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es6.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Result, Workunit, createConnection, Query } from '@hpcc-js/comms';
2
2
  export { hookSend } from '@hpcc-js/comms';
3
- import { PropertyExt, publish, tsvParse, csvParse, nest, min, max, mean, median, variance, deviation, sum, Utility, descending, ascending, ToggleButton, Spacer, EntityRectList, Database, publishProxy, Widget, select, Button, SelectionButton, SelectionBar } from '@hpcc-js/common';
3
+ import { PropertyExt, publish, tsvParse, csvParse, nest, min, max, mean, median, variance, deviation, sum, Utility, descending, ascending, ToggleButton, Spacer, EntityRectList, publishProxy, Database, Widget, select, Button, SelectionButton, SelectionBar } from '@hpcc-js/common';
4
4
  import { hashSum, update, isArray, debounce, AsyncOrderedQueue, compare, find, scopedLogger, classID2Meta } from '@hpcc-js/util';
5
5
  import { Area, Bubble, Bar, Column, Contour, HexBin, Line, Pie, Radar, RadialBar, Scatter, Step, WordCloud } from '@hpcc-js/chart';
6
6
  import { Table, DatasourceTable } from '@hpcc-js/dgrid';
@@ -13,8 +13,8 @@ import { JSONEditor, JSEditor } from '@hpcc-js/codemirror';
13
13
  import { PropertyEditor } from '@hpcc-js/other';
14
14
 
15
15
  var PKG_NAME$1 = "@hpcc-js/marshaller";
16
- var PKG_VERSION$1 = "2.25.49";
17
- var BUILD_VERSION = "2.105.10";
16
+ var PKG_VERSION$1 = "2.25.51";
17
+ var BUILD_VERSION = "2.105.12";
18
18
 
19
19
  /******************************************************************************
20
20
  Copyright (c) Microsoft Corporation.
@@ -2346,7 +2346,7 @@ function _mergeNamespaces(n, m) {
2346
2346
  }
2347
2347
 
2348
2348
  var PKG_NAME = "@hpcc-js/ddl-shim";
2349
- var PKG_VERSION = "2.20.6";
2349
+ var PKG_VERSION = "2.20.7";
2350
2350
 
2351
2351
  function isWorkunitDatasource(ref) {
2352
2352
  return ref.WUID !== undefined;
@@ -2413,17 +2413,17 @@ var VisibilitySet = ["normal", "flyout"];
2413
2413
 
2414
2414
  var v2$1 = /*#__PURE__*/Object.freeze({
2415
2415
  __proto__: null,
2416
+ VisibilitySet: VisibilitySet,
2416
2417
  isDatabombRef: isDatabombRef,
2417
- isWUResultRef: isWUResultRef,
2418
- isRoxieServiceRef: isRoxieServiceRef,
2419
- isIFilterCondition: isIFilterCondition,
2420
2418
  isFilterActivity: isFilterActivity,
2421
- isProjectActivity: isProjectActivity,
2422
- isMappingsActivity: isMappingsActivity,
2423
2419
  isGroupByActivity: isGroupByActivity,
2424
- isSortActivity: isSortActivity,
2420
+ isIFilterCondition: isIFilterCondition,
2425
2421
  isLimitActivity: isLimitActivity,
2426
- VisibilitySet: VisibilitySet
2422
+ isMappingsActivity: isMappingsActivity,
2423
+ isProjectActivity: isProjectActivity,
2424
+ isRoxieServiceRef: isRoxieServiceRef,
2425
+ isSortActivity: isSortActivity,
2426
+ isWUResultRef: isWUResultRef
2427
2427
  });
2428
2428
 
2429
2429
  /******************************************************************************
@@ -2440,6 +2440,8 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
2440
2440
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
2441
2441
  PERFORMANCE OF THIS SOFTWARE.
2442
2442
  ***************************************************************************** */
2443
+ /* global Reflect, Promise, SuppressedError, Symbol */
2444
+
2443
2445
 
2444
2446
  var __assign = function() {
2445
2447
  __assign = Object.assign || function __assign(t) {
@@ -2453,7 +2455,7 @@ var __assign = function() {
2453
2455
  };
2454
2456
 
2455
2457
  function __spreadArray(to, from, pack) {
2456
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
2458
+ for (var i = 0, l = from.length, ar; i < l; i++) {
2457
2459
  if (ar || !(i in from)) {
2458
2460
  if (!ar) ar = Array.prototype.slice.call(from, 0, i);
2459
2461
  ar[i] = from[i];
@@ -2911,7 +2913,7 @@ var DDLUpgrade = /** @class */ (function () {
2911
2913
  this._ddl2DataviewActivities[viz.id].project.transformations = projectTransformations;
2912
2914
  }
2913
2915
  if (aggrFields.length) {
2914
- this._ddl2DataviewActivities[viz.id].groupBy.groupByIDs = __spreadArray([], groupByColumns, true);
2916
+ this._ddl2DataviewActivities[viz.id].groupBy.groupByIDs = __spreadArray([], groupByColumns);
2915
2917
  this._ddl2DataviewActivities[viz.id].groupBy.aggregates = aggrFields;
2916
2918
  }
2917
2919
  }
@@ -3382,7 +3384,6 @@ var DDLUpgrade = /** @class */ (function () {
3382
3384
  return DDLUpgrade;
3383
3385
  }());
3384
3386
  function upgrade(ddl, baseUrl, wuid, toLowerCase, dermatologyJson) {
3385
- if (toLowerCase === void 0) { toLowerCase = true; }
3386
3387
  if (dermatologyJson === void 0) { dermatologyJson = {}; }
3387
3388
  var ddlUp = new DDLUpgrade(ddl, baseUrl, wuid, toLowerCase);
3388
3389
  var retVal = ddlUp.write();
@@ -3392,159 +3393,162 @@ function upgrade(ddl, baseUrl, wuid, toLowerCase, dermatologyJson) {
3392
3393
 
3393
3394
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
3394
3395
 
3396
+ function getDefaultExportFromCjs (x) {
3397
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
3398
+ }
3399
+
3395
3400
  var uri_all = {exports: {}};
3396
3401
 
3397
3402
  /** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */
3398
3403
 
3399
3404
  (function (module, exports) {
3400
- (function (global, factory) {
3401
- factory(exports) ;
3402
- }(commonjsGlobal, (function (exports) {
3403
- function merge() {
3404
- for (var _len = arguments.length, sets = Array(_len), _key = 0; _key < _len; _key++) {
3405
- sets[_key] = arguments[_key];
3406
- }
3407
-
3408
- if (sets.length > 1) {
3409
- sets[0] = sets[0].slice(0, -1);
3410
- var xl = sets.length - 1;
3411
- for (var x = 1; x < xl; ++x) {
3412
- sets[x] = sets[x].slice(1, -1);
3413
- }
3414
- sets[xl] = sets[xl].slice(1);
3415
- return sets.join('');
3416
- } else {
3417
- return sets[0];
3418
- }
3419
- }
3420
- function subexp(str) {
3421
- return "(?:" + str + ")";
3422
- }
3423
- function typeOf(o) {
3424
- return o === undefined ? "undefined" : o === null ? "null" : Object.prototype.toString.call(o).split(" ").pop().split("]").shift().toLowerCase();
3425
- }
3426
- function toUpperCase(str) {
3427
- return str.toUpperCase();
3428
- }
3429
- function toArray(obj) {
3430
- return obj !== undefined && obj !== null ? obj instanceof Array ? obj : typeof obj.length !== "number" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj) : [];
3431
- }
3432
- function assign(target, source) {
3433
- var obj = target;
3434
- if (source) {
3435
- for (var key in source) {
3436
- obj[key] = source[key];
3437
- }
3438
- }
3439
- return obj;
3440
- }
3441
-
3442
- function buildExps(isIRI) {
3443
- var ALPHA$$ = "[A-Za-z]",
3444
- DIGIT$$ = "[0-9]",
3445
- HEXDIG$$ = merge(DIGIT$$, "[A-Fa-f]"),
3446
- PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)),
3447
- //expanded
3448
- GEN_DELIMS$$ = "[\\:\\/\\?\\#\\[\\]\\@]",
3449
- SUB_DELIMS$$ = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",
3450
- RESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$),
3451
- UCSCHAR$$ = isIRI ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]",
3452
- //subset, excludes bidi control characters
3453
- IPRIVATE$$ = isIRI ? "[\\uE000-\\uF8FF]" : "[]",
3454
- //subset
3455
- UNRESERVED$$ = merge(ALPHA$$, DIGIT$$, "[\\-\\.\\_\\~]", UCSCHAR$$);
3456
- subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, "[\\+\\-\\.]") + "*");
3457
- subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]")) + "*");
3458
- var 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$$),
3459
- //relaxed parsing rules
3460
- IPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$),
3461
- H16$ = subexp(HEXDIG$$ + "{1,4}"),
3462
- LS32$ = subexp(subexp(H16$ + "\\:" + H16$) + "|" + IPV4ADDRESS$),
3463
- IPV6ADDRESS1$ = subexp(subexp(H16$ + "\\:") + "{6}" + LS32$),
3464
- // 6( h16 ":" ) ls32
3465
- IPV6ADDRESS2$ = subexp("\\:\\:" + subexp(H16$ + "\\:") + "{5}" + LS32$),
3466
- // "::" 5( h16 ":" ) ls32
3467
- IPV6ADDRESS3$ = subexp(subexp(H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{4}" + LS32$),
3468
- //[ h16 ] "::" 4( h16 ":" ) ls32
3469
- IPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,1}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{3}" + LS32$),
3470
- //[ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32
3471
- IPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,2}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{2}" + LS32$),
3472
- //[ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32
3473
- IPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,3}" + H16$) + "?\\:\\:" + H16$ + "\\:" + LS32$),
3474
- //[ *3( h16 ":" ) h16 ] "::" h16 ":" ls32
3475
- IPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,4}" + H16$) + "?\\:\\:" + LS32$),
3476
- //[ *4( h16 ":" ) h16 ] "::" ls32
3477
- IPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,5}" + H16$) + "?\\:\\:" + H16$),
3478
- //[ *5( h16 ":" ) h16 ] "::" h16
3479
- IPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,6}" + H16$) + "?\\:\\:"),
3480
- //[ *6( h16 ":" ) h16 ] "::"
3481
- IPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join("|")),
3482
- ZONEID$ = subexp(subexp(UNRESERVED$$ + "|" + PCT_ENCODED$) + "+");
3483
- //RFC 6874, with relaxed parsing rules
3484
- subexp("[vV]" + HEXDIG$$ + "+\\." + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]") + "+");
3485
- //RFC 6874
3486
- subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$)) + "*");
3487
- var PCHAR$ = subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@]"));
3488
- subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\@]")) + "+");
3489
- subexp(subexp(PCHAR$ + "|" + merge("[\\/\\?]", IPRIVATE$$)) + "*");
3490
- return {
3491
- NOT_SCHEME: new RegExp(merge("[^]", ALPHA$$, DIGIT$$, "[\\+\\-\\.]"), "g"),
3492
- NOT_USERINFO: new RegExp(merge("[^\\%\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"),
3493
- NOT_HOST: new RegExp(merge("[^\\%\\[\\]\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"),
3494
- NOT_PATH: new RegExp(merge("[^\\%\\/\\:\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"),
3495
- NOT_PATH_NOSCHEME: new RegExp(merge("[^\\%\\/\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"),
3496
- NOT_QUERY: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]", IPRIVATE$$), "g"),
3497
- NOT_FRAGMENT: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]"), "g"),
3498
- ESCAPE: new RegExp(merge("[^]", UNRESERVED$$, SUB_DELIMS$$), "g"),
3499
- UNRESERVED: new RegExp(UNRESERVED$$, "g"),
3500
- OTHER_CHARS: new RegExp(merge("[^\\%]", UNRESERVED$$, RESERVED$$), "g"),
3501
- PCT_ENCODED: new RegExp(PCT_ENCODED$, "g"),
3502
- IPV4ADDRESS: new RegExp("^(" + IPV4ADDRESS$ + ")$"),
3503
- IPV6ADDRESS: new RegExp("^\\[?(" + IPV6ADDRESS$ + ")" + subexp(subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + "(" + ZONEID$ + ")") + "?\\]?$") //RFC 6874, with relaxed parsing rules
3504
- };
3505
- }
3506
- var URI_PROTOCOL = buildExps(false);
3405
+ (function (global, factory) {
3406
+ factory(exports) ;
3407
+ }(commonjsGlobal, (function (exports) {
3408
+ function merge() {
3409
+ for (var _len = arguments.length, sets = Array(_len), _key = 0; _key < _len; _key++) {
3410
+ sets[_key] = arguments[_key];
3411
+ }
3412
+
3413
+ if (sets.length > 1) {
3414
+ sets[0] = sets[0].slice(0, -1);
3415
+ var xl = sets.length - 1;
3416
+ for (var x = 1; x < xl; ++x) {
3417
+ sets[x] = sets[x].slice(1, -1);
3418
+ }
3419
+ sets[xl] = sets[xl].slice(1);
3420
+ return sets.join('');
3421
+ } else {
3422
+ return sets[0];
3423
+ }
3424
+ }
3425
+ function subexp(str) {
3426
+ return "(?:" + str + ")";
3427
+ }
3428
+ function typeOf(o) {
3429
+ return o === undefined ? "undefined" : o === null ? "null" : Object.prototype.toString.call(o).split(" ").pop().split("]").shift().toLowerCase();
3430
+ }
3431
+ function toUpperCase(str) {
3432
+ return str.toUpperCase();
3433
+ }
3434
+ function toArray(obj) {
3435
+ return obj !== undefined && obj !== null ? obj instanceof Array ? obj : typeof obj.length !== "number" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj) : [];
3436
+ }
3437
+ function assign(target, source) {
3438
+ var obj = target;
3439
+ if (source) {
3440
+ for (var key in source) {
3441
+ obj[key] = source[key];
3442
+ }
3443
+ }
3444
+ return obj;
3445
+ }
3507
3446
 
3508
- var IRI_PROTOCOL = buildExps(true);
3447
+ function buildExps(isIRI) {
3448
+ var ALPHA$$ = "[A-Za-z]",
3449
+ DIGIT$$ = "[0-9]",
3450
+ HEXDIG$$ = merge(DIGIT$$, "[A-Fa-f]"),
3451
+ PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)),
3452
+ //expanded
3453
+ GEN_DELIMS$$ = "[\\:\\/\\?\\#\\[\\]\\@]",
3454
+ SUB_DELIMS$$ = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",
3455
+ RESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$),
3456
+ UCSCHAR$$ = isIRI ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]",
3457
+ //subset, excludes bidi control characters
3458
+ IPRIVATE$$ = isIRI ? "[\\uE000-\\uF8FF]" : "[]",
3459
+ //subset
3460
+ UNRESERVED$$ = merge(ALPHA$$, DIGIT$$, "[\\-\\.\\_\\~]", UCSCHAR$$);
3461
+ subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, "[\\+\\-\\.]") + "*");
3462
+ subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]")) + "*");
3463
+ var 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$$),
3464
+ //relaxed parsing rules
3465
+ IPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$),
3466
+ H16$ = subexp(HEXDIG$$ + "{1,4}"),
3467
+ LS32$ = subexp(subexp(H16$ + "\\:" + H16$) + "|" + IPV4ADDRESS$),
3468
+ IPV6ADDRESS1$ = subexp(subexp(H16$ + "\\:") + "{6}" + LS32$),
3469
+ // 6( h16 ":" ) ls32
3470
+ IPV6ADDRESS2$ = subexp("\\:\\:" + subexp(H16$ + "\\:") + "{5}" + LS32$),
3471
+ // "::" 5( h16 ":" ) ls32
3472
+ IPV6ADDRESS3$ = subexp(subexp(H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{4}" + LS32$),
3473
+ //[ h16 ] "::" 4( h16 ":" ) ls32
3474
+ IPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,1}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{3}" + LS32$),
3475
+ //[ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32
3476
+ IPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,2}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{2}" + LS32$),
3477
+ //[ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32
3478
+ IPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,3}" + H16$) + "?\\:\\:" + H16$ + "\\:" + LS32$),
3479
+ //[ *3( h16 ":" ) h16 ] "::" h16 ":" ls32
3480
+ IPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,4}" + H16$) + "?\\:\\:" + LS32$),
3481
+ //[ *4( h16 ":" ) h16 ] "::" ls32
3482
+ IPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,5}" + H16$) + "?\\:\\:" + H16$),
3483
+ //[ *5( h16 ":" ) h16 ] "::" h16
3484
+ IPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,6}" + H16$) + "?\\:\\:"),
3485
+ //[ *6( h16 ":" ) h16 ] "::"
3486
+ IPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join("|")),
3487
+ ZONEID$ = subexp(subexp(UNRESERVED$$ + "|" + PCT_ENCODED$) + "+");
3488
+ //RFC 6874, with relaxed parsing rules
3489
+ subexp("[vV]" + HEXDIG$$ + "+\\." + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]") + "+");
3490
+ //RFC 6874
3491
+ subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$)) + "*");
3492
+ var PCHAR$ = subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@]"));
3493
+ subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\@]")) + "+");
3494
+ subexp(subexp(PCHAR$ + "|" + merge("[\\/\\?]", IPRIVATE$$)) + "*");
3495
+ return {
3496
+ NOT_SCHEME: new RegExp(merge("[^]", ALPHA$$, DIGIT$$, "[\\+\\-\\.]"), "g"),
3497
+ NOT_USERINFO: new RegExp(merge("[^\\%\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"),
3498
+ NOT_HOST: new RegExp(merge("[^\\%\\[\\]\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"),
3499
+ NOT_PATH: new RegExp(merge("[^\\%\\/\\:\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"),
3500
+ NOT_PATH_NOSCHEME: new RegExp(merge("[^\\%\\/\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"),
3501
+ NOT_QUERY: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]", IPRIVATE$$), "g"),
3502
+ NOT_FRAGMENT: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]"), "g"),
3503
+ ESCAPE: new RegExp(merge("[^]", UNRESERVED$$, SUB_DELIMS$$), "g"),
3504
+ UNRESERVED: new RegExp(UNRESERVED$$, "g"),
3505
+ OTHER_CHARS: new RegExp(merge("[^\\%]", UNRESERVED$$, RESERVED$$), "g"),
3506
+ PCT_ENCODED: new RegExp(PCT_ENCODED$, "g"),
3507
+ IPV4ADDRESS: new RegExp("^(" + IPV4ADDRESS$ + ")$"),
3508
+ IPV6ADDRESS: new RegExp("^\\[?(" + IPV6ADDRESS$ + ")" + subexp(subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + "(" + ZONEID$ + ")") + "?\\]?$") //RFC 6874, with relaxed parsing rules
3509
+ };
3510
+ }
3511
+ var URI_PROTOCOL = buildExps(false);
3509
3512
 
3510
- var slicedToArray = function () {
3511
- function sliceIterator(arr, i) {
3512
- var _arr = [];
3513
- var _n = true;
3514
- var _d = false;
3515
- var _e = undefined;
3513
+ var IRI_PROTOCOL = buildExps(true);
3516
3514
 
3517
- try {
3518
- for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
3519
- _arr.push(_s.value);
3515
+ var slicedToArray = function () {
3516
+ function sliceIterator(arr, i) {
3517
+ var _arr = [];
3518
+ var _n = true;
3519
+ var _d = false;
3520
+ var _e = undefined;
3520
3521
 
3521
- if (i && _arr.length === i) break;
3522
- }
3523
- } catch (err) {
3524
- _d = true;
3525
- _e = err;
3526
- } finally {
3527
- try {
3528
- if (!_n && _i["return"]) _i["return"]();
3529
- } finally {
3530
- if (_d) throw _e;
3531
- }
3532
- }
3522
+ try {
3523
+ for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
3524
+ _arr.push(_s.value);
3533
3525
 
3534
- return _arr;
3535
- }
3526
+ if (i && _arr.length === i) break;
3527
+ }
3528
+ } catch (err) {
3529
+ _d = true;
3530
+ _e = err;
3531
+ } finally {
3532
+ try {
3533
+ if (!_n && _i["return"]) _i["return"]();
3534
+ } finally {
3535
+ if (_d) throw _e;
3536
+ }
3537
+ }
3536
3538
 
3537
- return function (arr, i) {
3538
- if (Array.isArray(arr)) {
3539
- return arr;
3540
- } else if (Symbol.iterator in Object(arr)) {
3541
- return sliceIterator(arr, i);
3542
- } else {
3543
- throw new TypeError("Invalid attempt to destructure non-iterable instance");
3544
- }
3545
- };
3546
- }();
3539
+ return _arr;
3540
+ }
3547
3541
 
3542
+ return function (arr, i) {
3543
+ if (Array.isArray(arr)) {
3544
+ return arr;
3545
+ } else if (Symbol.iterator in Object(arr)) {
3546
+ return sliceIterator(arr, i);
3547
+ } else {
3548
+ throw new TypeError("Invalid attempt to destructure non-iterable instance");
3549
+ }
3550
+ };
3551
+ }();
3548
3552
 
3549
3553
 
3550
3554
 
@@ -3557,1248 +3561,1251 @@ var slicedToArray = function () {
3557
3561
 
3558
3562
 
3559
3563
 
3560
- var toConsumableArray = function (arr) {
3561
- if (Array.isArray(arr)) {
3562
- for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
3563
3564
 
3564
- return arr2;
3565
- } else {
3566
- return Array.from(arr);
3567
- }
3568
- };
3565
+ var toConsumableArray = function (arr) {
3566
+ if (Array.isArray(arr)) {
3567
+ for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
3569
3568
 
3570
- /** Highest positive signed 32-bit float value */
3571
-
3572
- var maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1
3573
-
3574
- /** Bootstring parameters */
3575
- var base = 36;
3576
- var tMin = 1;
3577
- var tMax = 26;
3578
- var skew = 38;
3579
- var damp = 700;
3580
- var initialBias = 72;
3581
- var initialN = 128; // 0x80
3582
- var delimiter = '-'; // '\x2D'
3583
-
3584
- /** Regular expressions */
3585
- var regexPunycode = /^xn--/;
3586
- var regexNonASCII = /[^\0-\x7E]/; // non-ASCII chars
3587
- var regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators
3588
-
3589
- /** Error messages */
3590
- var errors = {
3591
- 'overflow': 'Overflow: input needs wider integers to process',
3592
- 'not-basic': 'Illegal input >= 0x80 (not a basic code point)',
3593
- 'invalid-input': 'Invalid input'
3594
- };
3569
+ return arr2;
3570
+ } else {
3571
+ return Array.from(arr);
3572
+ }
3573
+ };
3595
3574
 
3596
- /** Convenience shortcuts */
3597
- var baseMinusTMin = base - tMin;
3598
- var floor = Math.floor;
3599
- var stringFromCharCode = String.fromCharCode;
3575
+ /** Highest positive signed 32-bit float value */
3600
3576
 
3601
- /*--------------------------------------------------------------------------*/
3577
+ var maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1
3602
3578
 
3603
- /**
3604
- * A generic error utility function.
3605
- * @private
3606
- * @param {String} type The error type.
3607
- * @returns {Error} Throws a `RangeError` with the applicable error message.
3608
- */
3609
- function error$1(type) {
3610
- throw new RangeError(errors[type]);
3611
- }
3579
+ /** Bootstring parameters */
3580
+ var base = 36;
3581
+ var tMin = 1;
3582
+ var tMax = 26;
3583
+ var skew = 38;
3584
+ var damp = 700;
3585
+ var initialBias = 72;
3586
+ var initialN = 128; // 0x80
3587
+ var delimiter = '-'; // '\x2D'
3612
3588
 
3613
- /**
3614
- * A generic `Array#map` utility function.
3615
- * @private
3616
- * @param {Array} array The array to iterate over.
3617
- * @param {Function} callback The function that gets called for every array
3618
- * item.
3619
- * @returns {Array} A new array of values returned by the callback function.
3620
- */
3621
- function map(array, fn) {
3622
- var result = [];
3623
- var length = array.length;
3624
- while (length--) {
3625
- result[length] = fn(array[length]);
3626
- }
3627
- return result;
3628
- }
3589
+ /** Regular expressions */
3590
+ var regexPunycode = /^xn--/;
3591
+ var regexNonASCII = /[^\0-\x7E]/; // non-ASCII chars
3592
+ var regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators
3629
3593
 
3630
- /**
3631
- * A simple `Array#map`-like wrapper to work with domain name strings or email
3632
- * addresses.
3633
- * @private
3634
- * @param {String} domain The domain name or email address.
3635
- * @param {Function} callback The function that gets called for every
3636
- * character.
3637
- * @returns {Array} A new string of characters returned by the callback
3638
- * function.
3639
- */
3640
- function mapDomain(string, fn) {
3641
- var parts = string.split('@');
3642
- var result = '';
3643
- if (parts.length > 1) {
3644
- // In email addresses, only the domain name should be punycoded. Leave
3645
- // the local part (i.e. everything up to `@`) intact.
3646
- result = parts[0] + '@';
3647
- string = parts[1];
3648
- }
3649
- // Avoid `split(regex)` for IE8 compatibility. See #17.
3650
- string = string.replace(regexSeparators, '\x2E');
3651
- var labels = string.split('.');
3652
- var encoded = map(labels, fn).join('.');
3653
- return result + encoded;
3654
- }
3594
+ /** Error messages */
3595
+ var errors = {
3596
+ 'overflow': 'Overflow: input needs wider integers to process',
3597
+ 'not-basic': 'Illegal input >= 0x80 (not a basic code point)',
3598
+ 'invalid-input': 'Invalid input'
3599
+ };
3655
3600
 
3656
- /**
3657
- * Creates an array containing the numeric code points of each Unicode
3658
- * character in the string. While JavaScript uses UCS-2 internally,
3659
- * this function will convert a pair of surrogate halves (each of which
3660
- * UCS-2 exposes as separate characters) into a single code point,
3661
- * matching UTF-16.
3662
- * @see `punycode.ucs2.encode`
3663
- * @see <https://mathiasbynens.be/notes/javascript-encoding>
3664
- * @memberOf punycode.ucs2
3665
- * @name decode
3666
- * @param {String} string The Unicode input string (UCS-2).
3667
- * @returns {Array} The new array of code points.
3668
- */
3669
- function ucs2decode(string) {
3670
- var output = [];
3671
- var counter = 0;
3672
- var length = string.length;
3673
- while (counter < length) {
3674
- var value = string.charCodeAt(counter++);
3675
- if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
3676
- // It's a high surrogate, and there is a next character.
3677
- var extra = string.charCodeAt(counter++);
3678
- if ((extra & 0xFC00) == 0xDC00) {
3679
- // Low surrogate.
3680
- output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
3681
- } else {
3682
- // It's an unmatched surrogate; only append this code unit, in case the
3683
- // next code unit is the high surrogate of a surrogate pair.
3684
- output.push(value);
3685
- counter--;
3686
- }
3687
- } else {
3688
- output.push(value);
3689
- }
3690
- }
3691
- return output;
3692
- }
3601
+ /** Convenience shortcuts */
3602
+ var baseMinusTMin = base - tMin;
3603
+ var floor = Math.floor;
3604
+ var stringFromCharCode = String.fromCharCode;
3693
3605
 
3694
- /**
3695
- * Creates a string based on an array of numeric code points.
3696
- * @see `punycode.ucs2.decode`
3697
- * @memberOf punycode.ucs2
3698
- * @name encode
3699
- * @param {Array} codePoints The array of numeric code points.
3700
- * @returns {String} The new Unicode string (UCS-2).
3701
- */
3702
- var ucs2encode = function ucs2encode(array) {
3703
- return String.fromCodePoint.apply(String, toConsumableArray(array));
3704
- };
3606
+ /*--------------------------------------------------------------------------*/
3705
3607
 
3706
- /**
3707
- * Converts a basic code point into a digit/integer.
3708
- * @see `digitToBasic()`
3709
- * @private
3710
- * @param {Number} codePoint The basic numeric code point value.
3711
- * @returns {Number} The numeric value of a basic code point (for use in
3712
- * representing integers) in the range `0` to `base - 1`, or `base` if
3713
- * the code point does not represent a value.
3714
- */
3715
- var basicToDigit = function basicToDigit(codePoint) {
3716
- if (codePoint - 0x30 < 0x0A) {
3717
- return codePoint - 0x16;
3718
- }
3719
- if (codePoint - 0x41 < 0x1A) {
3720
- return codePoint - 0x41;
3721
- }
3722
- if (codePoint - 0x61 < 0x1A) {
3723
- return codePoint - 0x61;
3608
+ /**
3609
+ * A generic error utility function.
3610
+ * @private
3611
+ * @param {String} type The error type.
3612
+ * @returns {Error} Throws a `RangeError` with the applicable error message.
3613
+ */
3614
+ function error$1(type) {
3615
+ throw new RangeError(errors[type]);
3724
3616
  }
3725
- return base;
3726
- };
3727
-
3728
- /**
3729
- * Converts a digit/integer into a basic code point.
3730
- * @see `basicToDigit()`
3731
- * @private
3732
- * @param {Number} digit The numeric value of a basic code point.
3733
- * @returns {Number} The basic code point whose value (when used for
3734
- * representing integers) is `digit`, which needs to be in the range
3735
- * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is
3736
- * used; else, the lowercase form is used. The behavior is undefined
3737
- * if `flag` is non-zero and `digit` has no uppercase form.
3738
- */
3739
- var digitToBasic = function digitToBasic(digit, flag) {
3740
- // 0..25 map to ASCII a..z or A..Z
3741
- // 26..35 map to ASCII 0..9
3742
- return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
3743
- };
3744
3617
 
3745
- /**
3746
- * Bias adaptation function as per section 3.4 of RFC 3492.
3747
- * https://tools.ietf.org/html/rfc3492#section-3.4
3748
- * @private
3749
- */
3750
- var adapt = function adapt(delta, numPoints, firstTime) {
3751
- var k = 0;
3752
- delta = firstTime ? floor(delta / damp) : delta >> 1;
3753
- delta += floor(delta / numPoints);
3754
- for (; /* no initialization */delta > baseMinusTMin * tMax >> 1; k += base) {
3755
- delta = floor(delta / baseMinusTMin);
3618
+ /**
3619
+ * A generic `Array#map` utility function.
3620
+ * @private
3621
+ * @param {Array} array The array to iterate over.
3622
+ * @param {Function} callback The function that gets called for every array
3623
+ * item.
3624
+ * @returns {Array} A new array of values returned by the callback function.
3625
+ */
3626
+ function map(array, fn) {
3627
+ var result = [];
3628
+ var length = array.length;
3629
+ while (length--) {
3630
+ result[length] = fn(array[length]);
3631
+ }
3632
+ return result;
3756
3633
  }
3757
- return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
3758
- };
3759
3634
 
3760
- /**
3761
- * Converts a Punycode string of ASCII-only symbols to a string of Unicode
3762
- * symbols.
3763
- * @memberOf punycode
3764
- * @param {String} input The Punycode string of ASCII-only symbols.
3765
- * @returns {String} The resulting string of Unicode symbols.
3766
- */
3767
- var decode = function decode(input) {
3768
- // Don't use UCS-2.
3769
- var output = [];
3770
- var inputLength = input.length;
3771
- var i = 0;
3772
- var n = initialN;
3773
- var bias = initialBias;
3774
-
3775
- // Handle the basic code points: let `basic` be the number of input code
3776
- // points before the last delimiter, or `0` if there is none, then copy
3777
- // the first basic code points to the output.
3778
-
3779
- var basic = input.lastIndexOf(delimiter);
3780
- if (basic < 0) {
3781
- basic = 0;
3635
+ /**
3636
+ * A simple `Array#map`-like wrapper to work with domain name strings or email
3637
+ * addresses.
3638
+ * @private
3639
+ * @param {String} domain The domain name or email address.
3640
+ * @param {Function} callback The function that gets called for every
3641
+ * character.
3642
+ * @returns {Array} A new string of characters returned by the callback
3643
+ * function.
3644
+ */
3645
+ function mapDomain(string, fn) {
3646
+ var parts = string.split('@');
3647
+ var result = '';
3648
+ if (parts.length > 1) {
3649
+ // In email addresses, only the domain name should be punycoded. Leave
3650
+ // the local part (i.e. everything up to `@`) intact.
3651
+ result = parts[0] + '@';
3652
+ string = parts[1];
3653
+ }
3654
+ // Avoid `split(regex)` for IE8 compatibility. See #17.
3655
+ string = string.replace(regexSeparators, '\x2E');
3656
+ var labels = string.split('.');
3657
+ var encoded = map(labels, fn).join('.');
3658
+ return result + encoded;
3782
3659
  }
3783
3660
 
3784
- for (var j = 0; j < basic; ++j) {
3785
- // if it's not a basic code point
3786
- if (input.charCodeAt(j) >= 0x80) {
3787
- error$1('not-basic');
3661
+ /**
3662
+ * Creates an array containing the numeric code points of each Unicode
3663
+ * character in the string. While JavaScript uses UCS-2 internally,
3664
+ * this function will convert a pair of surrogate halves (each of which
3665
+ * UCS-2 exposes as separate characters) into a single code point,
3666
+ * matching UTF-16.
3667
+ * @see `punycode.ucs2.encode`
3668
+ * @see <https://mathiasbynens.be/notes/javascript-encoding>
3669
+ * @memberOf punycode.ucs2
3670
+ * @name decode
3671
+ * @param {String} string The Unicode input string (UCS-2).
3672
+ * @returns {Array} The new array of code points.
3673
+ */
3674
+ function ucs2decode(string) {
3675
+ var output = [];
3676
+ var counter = 0;
3677
+ var length = string.length;
3678
+ while (counter < length) {
3679
+ var value = string.charCodeAt(counter++);
3680
+ if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
3681
+ // It's a high surrogate, and there is a next character.
3682
+ var extra = string.charCodeAt(counter++);
3683
+ if ((extra & 0xFC00) == 0xDC00) {
3684
+ // Low surrogate.
3685
+ output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
3686
+ } else {
3687
+ // It's an unmatched surrogate; only append this code unit, in case the
3688
+ // next code unit is the high surrogate of a surrogate pair.
3689
+ output.push(value);
3690
+ counter--;
3691
+ }
3692
+ } else {
3693
+ output.push(value);
3694
+ }
3788
3695
  }
3789
- output.push(input.charCodeAt(j));
3696
+ return output;
3790
3697
  }
3791
3698
 
3792
- // Main decoding loop: start just after the last delimiter if any basic code
3793
- // points were copied; start at the beginning otherwise.
3794
-
3795
- for (var index = basic > 0 ? basic + 1 : 0; index < inputLength;) /* no final expression */{
3796
-
3797
- // `index` is the index of the next character to be consumed.
3798
- // Decode a generalized variable-length integer into `delta`,
3799
- // which gets added to `i`. The overflow checking is easier
3800
- // if we increase `i` as we go, then subtract off its starting
3801
- // value at the end to obtain `delta`.
3802
- var oldi = i;
3803
- for (var w = 1, k = base;; /* no condition */k += base) {
3804
-
3805
- if (index >= inputLength) {
3806
- error$1('invalid-input');
3807
- }
3699
+ /**
3700
+ * Creates a string based on an array of numeric code points.
3701
+ * @see `punycode.ucs2.decode`
3702
+ * @memberOf punycode.ucs2
3703
+ * @name encode
3704
+ * @param {Array} codePoints The array of numeric code points.
3705
+ * @returns {String} The new Unicode string (UCS-2).
3706
+ */
3707
+ var ucs2encode = function ucs2encode(array) {
3708
+ return String.fromCodePoint.apply(String, toConsumableArray(array));
3709
+ };
3808
3710
 
3809
- var digit = basicToDigit(input.charCodeAt(index++));
3711
+ /**
3712
+ * Converts a basic code point into a digit/integer.
3713
+ * @see `digitToBasic()`
3714
+ * @private
3715
+ * @param {Number} codePoint The basic numeric code point value.
3716
+ * @returns {Number} The numeric value of a basic code point (for use in
3717
+ * representing integers) in the range `0` to `base - 1`, or `base` if
3718
+ * the code point does not represent a value.
3719
+ */
3720
+ var basicToDigit = function basicToDigit(codePoint) {
3721
+ if (codePoint - 0x30 < 0x0A) {
3722
+ return codePoint - 0x16;
3723
+ }
3724
+ if (codePoint - 0x41 < 0x1A) {
3725
+ return codePoint - 0x41;
3726
+ }
3727
+ if (codePoint - 0x61 < 0x1A) {
3728
+ return codePoint - 0x61;
3729
+ }
3730
+ return base;
3731
+ };
3810
3732
 
3811
- if (digit >= base || digit > floor((maxInt - i) / w)) {
3812
- error$1('overflow');
3813
- }
3733
+ /**
3734
+ * Converts a digit/integer into a basic code point.
3735
+ * @see `basicToDigit()`
3736
+ * @private
3737
+ * @param {Number} digit The numeric value of a basic code point.
3738
+ * @returns {Number} The basic code point whose value (when used for
3739
+ * representing integers) is `digit`, which needs to be in the range
3740
+ * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is
3741
+ * used; else, the lowercase form is used. The behavior is undefined
3742
+ * if `flag` is non-zero and `digit` has no uppercase form.
3743
+ */
3744
+ var digitToBasic = function digitToBasic(digit, flag) {
3745
+ // 0..25 map to ASCII a..z or A..Z
3746
+ // 26..35 map to ASCII 0..9
3747
+ return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
3748
+ };
3814
3749
 
3815
- i += digit * w;
3816
- var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
3750
+ /**
3751
+ * Bias adaptation function as per section 3.4 of RFC 3492.
3752
+ * https://tools.ietf.org/html/rfc3492#section-3.4
3753
+ * @private
3754
+ */
3755
+ var adapt = function adapt(delta, numPoints, firstTime) {
3756
+ var k = 0;
3757
+ delta = firstTime ? floor(delta / damp) : delta >> 1;
3758
+ delta += floor(delta / numPoints);
3759
+ for (; /* no initialization */delta > baseMinusTMin * tMax >> 1; k += base) {
3760
+ delta = floor(delta / baseMinusTMin);
3761
+ }
3762
+ return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
3763
+ };
3817
3764
 
3818
- if (digit < t) {
3819
- break;
3820
- }
3765
+ /**
3766
+ * Converts a Punycode string of ASCII-only symbols to a string of Unicode
3767
+ * symbols.
3768
+ * @memberOf punycode
3769
+ * @param {String} input The Punycode string of ASCII-only symbols.
3770
+ * @returns {String} The resulting string of Unicode symbols.
3771
+ */
3772
+ var decode = function decode(input) {
3773
+ // Don't use UCS-2.
3774
+ var output = [];
3775
+ var inputLength = input.length;
3776
+ var i = 0;
3777
+ var n = initialN;
3778
+ var bias = initialBias;
3779
+
3780
+ // Handle the basic code points: let `basic` be the number of input code
3781
+ // points before the last delimiter, or `0` if there is none, then copy
3782
+ // the first basic code points to the output.
3783
+
3784
+ var basic = input.lastIndexOf(delimiter);
3785
+ if (basic < 0) {
3786
+ basic = 0;
3787
+ }
3821
3788
 
3822
- var baseMinusT = base - t;
3823
- if (w > floor(maxInt / baseMinusT)) {
3824
- error$1('overflow');
3789
+ for (var j = 0; j < basic; ++j) {
3790
+ // if it's not a basic code point
3791
+ if (input.charCodeAt(j) >= 0x80) {
3792
+ error$1('not-basic');
3825
3793
  }
3826
-
3827
- w *= baseMinusT;
3794
+ output.push(input.charCodeAt(j));
3828
3795
  }
3829
3796
 
3830
- var out = output.length + 1;
3831
- bias = adapt(i - oldi, out, oldi == 0);
3797
+ // Main decoding loop: start just after the last delimiter if any basic code
3798
+ // points were copied; start at the beginning otherwise.
3832
3799
 
3833
- // `i` was supposed to wrap around from `out` to `0`,
3834
- // incrementing `n` each time, so we'll fix that now:
3835
- if (floor(i / out) > maxInt - n) {
3836
- error$1('overflow');
3837
- }
3800
+ for (var index = basic > 0 ? basic + 1 : 0; index < inputLength;) /* no final expression */{
3838
3801
 
3839
- n += floor(i / out);
3840
- i %= out;
3802
+ // `index` is the index of the next character to be consumed.
3803
+ // Decode a generalized variable-length integer into `delta`,
3804
+ // which gets added to `i`. The overflow checking is easier
3805
+ // if we increase `i` as we go, then subtract off its starting
3806
+ // value at the end to obtain `delta`.
3807
+ var oldi = i;
3808
+ for (var w = 1, k = base;; /* no condition */k += base) {
3841
3809
 
3842
- // Insert `n` at position `i` of the output.
3843
- output.splice(i++, 0, n);
3844
- }
3810
+ if (index >= inputLength) {
3811
+ error$1('invalid-input');
3812
+ }
3845
3813
 
3846
- return String.fromCodePoint.apply(String, output);
3847
- };
3814
+ var digit = basicToDigit(input.charCodeAt(index++));
3848
3815
 
3849
- /**
3850
- * Converts a string of Unicode symbols (e.g. a domain name label) to a
3851
- * Punycode string of ASCII-only symbols.
3852
- * @memberOf punycode
3853
- * @param {String} input The string of Unicode symbols.
3854
- * @returns {String} The resulting Punycode string of ASCII-only symbols.
3855
- */
3856
- var encode = function encode(input) {
3857
- var output = [];
3816
+ if (digit >= base || digit > floor((maxInt - i) / w)) {
3817
+ error$1('overflow');
3818
+ }
3858
3819
 
3859
- // Convert the input in UCS-2 to an array of Unicode code points.
3860
- input = ucs2decode(input);
3820
+ i += digit * w;
3821
+ var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
3861
3822
 
3862
- // Cache the length.
3863
- var inputLength = input.length;
3823
+ if (digit < t) {
3824
+ break;
3825
+ }
3864
3826
 
3865
- // Initialize the state.
3866
- var n = initialN;
3867
- var delta = 0;
3868
- var bias = initialBias;
3827
+ var baseMinusT = base - t;
3828
+ if (w > floor(maxInt / baseMinusT)) {
3829
+ error$1('overflow');
3830
+ }
3869
3831
 
3870
- // Handle the basic code points.
3871
- var _iteratorNormalCompletion = true;
3872
- var _didIteratorError = false;
3873
- var _iteratorError = undefined;
3832
+ w *= baseMinusT;
3833
+ }
3874
3834
 
3875
- try {
3876
- for (var _iterator = input[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
3877
- var _currentValue2 = _step.value;
3835
+ var out = output.length + 1;
3836
+ bias = adapt(i - oldi, out, oldi == 0);
3878
3837
 
3879
- if (_currentValue2 < 0x80) {
3880
- output.push(stringFromCharCode(_currentValue2));
3881
- }
3882
- }
3883
- } catch (err) {
3884
- _didIteratorError = true;
3885
- _iteratorError = err;
3886
- } finally {
3887
- try {
3888
- if (!_iteratorNormalCompletion && _iterator.return) {
3889
- _iterator.return();
3890
- }
3891
- } finally {
3892
- if (_didIteratorError) {
3893
- throw _iteratorError;
3838
+ // `i` was supposed to wrap around from `out` to `0`,
3839
+ // incrementing `n` each time, so we'll fix that now:
3840
+ if (floor(i / out) > maxInt - n) {
3841
+ error$1('overflow');
3894
3842
  }
3895
- }
3896
- }
3897
-
3898
- var basicLength = output.length;
3899
- var handledCPCount = basicLength;
3900
3843
 
3901
- // `handledCPCount` is the number of code points that have been handled;
3902
- // `basicLength` is the number of basic code points.
3844
+ n += floor(i / out);
3845
+ i %= out;
3903
3846
 
3904
- // Finish the basic string with a delimiter unless it's empty.
3905
- if (basicLength) {
3906
- output.push(delimiter);
3907
- }
3847
+ // Insert `n` at position `i` of the output.
3848
+ output.splice(i++, 0, n);
3849
+ }
3908
3850
 
3909
- // Main encoding loop:
3910
- while (handledCPCount < inputLength) {
3851
+ return String.fromCodePoint.apply(String, output);
3852
+ };
3911
3853
 
3912
- // All non-basic code points < n have been handled already. Find the next
3913
- // larger one:
3914
- var m = maxInt;
3915
- var _iteratorNormalCompletion2 = true;
3916
- var _didIteratorError2 = false;
3917
- var _iteratorError2 = undefined;
3854
+ /**
3855
+ * Converts a string of Unicode symbols (e.g. a domain name label) to a
3856
+ * Punycode string of ASCII-only symbols.
3857
+ * @memberOf punycode
3858
+ * @param {String} input The string of Unicode symbols.
3859
+ * @returns {String} The resulting Punycode string of ASCII-only symbols.
3860
+ */
3861
+ var encode = function encode(input) {
3862
+ var output = [];
3863
+
3864
+ // Convert the input in UCS-2 to an array of Unicode code points.
3865
+ input = ucs2decode(input);
3866
+
3867
+ // Cache the length.
3868
+ var inputLength = input.length;
3869
+
3870
+ // Initialize the state.
3871
+ var n = initialN;
3872
+ var delta = 0;
3873
+ var bias = initialBias;
3874
+
3875
+ // Handle the basic code points.
3876
+ var _iteratorNormalCompletion = true;
3877
+ var _didIteratorError = false;
3878
+ var _iteratorError = undefined;
3918
3879
 
3919
3880
  try {
3920
- for (var _iterator2 = input[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
3921
- var currentValue = _step2.value;
3881
+ for (var _iterator = input[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
3882
+ var _currentValue2 = _step.value;
3922
3883
 
3923
- if (currentValue >= n && currentValue < m) {
3924
- m = currentValue;
3884
+ if (_currentValue2 < 0x80) {
3885
+ output.push(stringFromCharCode(_currentValue2));
3925
3886
  }
3926
3887
  }
3927
-
3928
- // Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,
3929
- // but guard against overflow.
3930
3888
  } catch (err) {
3931
- _didIteratorError2 = true;
3932
- _iteratorError2 = err;
3889
+ _didIteratorError = true;
3890
+ _iteratorError = err;
3933
3891
  } finally {
3934
3892
  try {
3935
- if (!_iteratorNormalCompletion2 && _iterator2.return) {
3936
- _iterator2.return();
3893
+ if (!_iteratorNormalCompletion && _iterator.return) {
3894
+ _iterator.return();
3937
3895
  }
3938
3896
  } finally {
3939
- if (_didIteratorError2) {
3940
- throw _iteratorError2;
3897
+ if (_didIteratorError) {
3898
+ throw _iteratorError;
3941
3899
  }
3942
3900
  }
3943
3901
  }
3944
3902
 
3945
- var handledCPCountPlusOne = handledCPCount + 1;
3946
- if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
3947
- error$1('overflow');
3948
- }
3903
+ var basicLength = output.length;
3904
+ var handledCPCount = basicLength;
3949
3905
 
3950
- delta += (m - n) * handledCPCountPlusOne;
3951
- n = m;
3906
+ // `handledCPCount` is the number of code points that have been handled;
3907
+ // `basicLength` is the number of basic code points.
3952
3908
 
3953
- var _iteratorNormalCompletion3 = true;
3954
- var _didIteratorError3 = false;
3955
- var _iteratorError3 = undefined;
3909
+ // Finish the basic string with a delimiter unless it's empty.
3910
+ if (basicLength) {
3911
+ output.push(delimiter);
3912
+ }
3956
3913
 
3957
- try {
3958
- for (var _iterator3 = input[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
3959
- var _currentValue = _step3.value;
3914
+ // Main encoding loop:
3915
+ while (handledCPCount < inputLength) {
3960
3916
 
3961
- if (_currentValue < n && ++delta > maxInt) {
3962
- error$1('overflow');
3963
- }
3964
- if (_currentValue == n) {
3965
- // Represent delta as a generalized variable-length integer.
3966
- var q = delta;
3967
- for (var k = base;; /* no condition */k += base) {
3968
- var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
3969
- if (q < t) {
3970
- break;
3971
- }
3972
- var qMinusT = q - t;
3973
- var baseMinusT = base - t;
3974
- output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)));
3975
- q = floor(qMinusT / baseMinusT);
3976
- }
3917
+ // All non-basic code points < n have been handled already. Find the next
3918
+ // larger one:
3919
+ var m = maxInt;
3920
+ var _iteratorNormalCompletion2 = true;
3921
+ var _didIteratorError2 = false;
3922
+ var _iteratorError2 = undefined;
3977
3923
 
3978
- output.push(stringFromCharCode(digitToBasic(q, 0)));
3979
- bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
3980
- delta = 0;
3981
- ++handledCPCount;
3982
- }
3983
- }
3984
- } catch (err) {
3985
- _didIteratorError3 = true;
3986
- _iteratorError3 = err;
3987
- } finally {
3988
3924
  try {
3989
- if (!_iteratorNormalCompletion3 && _iterator3.return) {
3990
- _iterator3.return();
3925
+ for (var _iterator2 = input[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
3926
+ var currentValue = _step2.value;
3927
+
3928
+ if (currentValue >= n && currentValue < m) {
3929
+ m = currentValue;
3930
+ }
3991
3931
  }
3932
+
3933
+ // Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,
3934
+ // but guard against overflow.
3935
+ } catch (err) {
3936
+ _didIteratorError2 = true;
3937
+ _iteratorError2 = err;
3992
3938
  } finally {
3993
- if (_didIteratorError3) {
3994
- throw _iteratorError3;
3939
+ try {
3940
+ if (!_iteratorNormalCompletion2 && _iterator2.return) {
3941
+ _iterator2.return();
3942
+ }
3943
+ } finally {
3944
+ if (_didIteratorError2) {
3945
+ throw _iteratorError2;
3946
+ }
3995
3947
  }
3996
3948
  }
3997
- }
3998
-
3999
- ++delta;
4000
- ++n;
4001
- }
4002
- return output.join('');
4003
- };
4004
3949
 
4005
- /**
4006
- * Converts a Punycode string representing a domain name or an email address
4007
- * to Unicode. Only the Punycoded parts of the input will be converted, i.e.
4008
- * it doesn't matter if you call it on a string that has already been
4009
- * converted to Unicode.
4010
- * @memberOf punycode
4011
- * @param {String} input The Punycoded domain name or email address to
4012
- * convert to Unicode.
4013
- * @returns {String} The Unicode representation of the given Punycode
4014
- * string.
4015
- */
4016
- var toUnicode = function toUnicode(input) {
4017
- return mapDomain(input, function (string) {
4018
- return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string;
4019
- });
4020
- };
4021
-
4022
- /**
4023
- * Converts a Unicode string representing a domain name or an email address to
4024
- * Punycode. Only the non-ASCII parts of the domain name will be converted,
4025
- * i.e. it doesn't matter if you call it with a domain that's already in
4026
- * ASCII.
4027
- * @memberOf punycode
4028
- * @param {String} input The domain name or email address to convert, as a
4029
- * Unicode string.
4030
- * @returns {String} The Punycode representation of the given domain name or
4031
- * email address.
4032
- */
4033
- var toASCII = function toASCII(input) {
4034
- return mapDomain(input, function (string) {
4035
- return regexNonASCII.test(string) ? 'xn--' + encode(string) : string;
4036
- });
4037
- };
4038
-
4039
- /*--------------------------------------------------------------------------*/
4040
-
4041
- /** Define the public API */
4042
- var punycode = {
4043
- /**
4044
- * A string representing the current Punycode.js version number.
4045
- * @memberOf punycode
4046
- * @type String
4047
- */
4048
- 'version': '2.1.0',
4049
- /**
4050
- * An object of methods to convert from JavaScript's internal character
4051
- * representation (UCS-2) to Unicode code points, and back.
4052
- * @see <https://mathiasbynens.be/notes/javascript-encoding>
4053
- * @memberOf punycode
4054
- * @type Object
4055
- */
4056
- 'ucs2': {
4057
- 'decode': ucs2decode,
4058
- 'encode': ucs2encode
4059
- },
4060
- 'decode': decode,
4061
- 'encode': encode,
4062
- 'toASCII': toASCII,
4063
- 'toUnicode': toUnicode
4064
- };
3950
+ var handledCPCountPlusOne = handledCPCount + 1;
3951
+ if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
3952
+ error$1('overflow');
3953
+ }
4065
3954
 
4066
- /**
4067
- * URI.js
4068
- *
4069
- * @fileoverview An RFC 3986 compliant, scheme extendable URI parsing/validating/resolving library for JavaScript.
4070
- * @author <a href="mailto:gary.court@gmail.com">Gary Court</a>
4071
- * @see http://github.com/garycourt/uri-js
4072
- */
4073
- /**
4074
- * Copyright 2011 Gary Court. All rights reserved.
4075
- *
4076
- * Redistribution and use in source and binary forms, with or without modification, are
4077
- * permitted provided that the following conditions are met:
4078
- *
4079
- * 1. Redistributions of source code must retain the above copyright notice, this list of
4080
- * conditions and the following disclaimer.
4081
- *
4082
- * 2. Redistributions in binary form must reproduce the above copyright notice, this list
4083
- * of conditions and the following disclaimer in the documentation and/or other materials
4084
- * provided with the distribution.
4085
- *
4086
- * THIS SOFTWARE IS PROVIDED BY GARY COURT ``AS IS'' AND ANY EXPRESS OR IMPLIED
4087
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
4088
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR
4089
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
4090
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
4091
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
4092
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
4093
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
4094
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4095
- *
4096
- * The views and conclusions contained in the software and documentation are those of the
4097
- * authors and should not be interpreted as representing official policies, either expressed
4098
- * or implied, of Gary Court.
4099
- */
4100
- var SCHEMES = {};
4101
- function pctEncChar(chr) {
4102
- var c = chr.charCodeAt(0);
4103
- var e = void 0;
4104
- if (c < 16) e = "%0" + c.toString(16).toUpperCase();else if (c < 128) e = "%" + c.toString(16).toUpperCase();else if (c < 2048) e = "%" + (c >> 6 | 192).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase();else e = "%" + (c >> 12 | 224).toString(16).toUpperCase() + "%" + (c >> 6 & 63 | 128).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase();
4105
- return e;
4106
- }
4107
- function pctDecChars(str) {
4108
- var newStr = "";
4109
- var i = 0;
4110
- var il = str.length;
4111
- while (i < il) {
4112
- var c = parseInt(str.substr(i + 1, 2), 16);
4113
- if (c < 128) {
4114
- newStr += String.fromCharCode(c);
4115
- i += 3;
4116
- } else if (c >= 194 && c < 224) {
4117
- if (il - i >= 6) {
4118
- var c2 = parseInt(str.substr(i + 4, 2), 16);
4119
- newStr += String.fromCharCode((c & 31) << 6 | c2 & 63);
4120
- } else {
4121
- newStr += str.substr(i, 6);
4122
- }
4123
- i += 6;
4124
- } else if (c >= 224) {
4125
- if (il - i >= 9) {
4126
- var _c = parseInt(str.substr(i + 4, 2), 16);
4127
- var c3 = parseInt(str.substr(i + 7, 2), 16);
4128
- newStr += String.fromCharCode((c & 15) << 12 | (_c & 63) << 6 | c3 & 63);
4129
- } else {
4130
- newStr += str.substr(i, 9);
4131
- }
4132
- i += 9;
4133
- } else {
4134
- newStr += str.substr(i, 3);
4135
- i += 3;
4136
- }
4137
- }
4138
- return newStr;
4139
- }
4140
- function _normalizeComponentEncoding(components, protocol) {
4141
- function decodeUnreserved(str) {
4142
- var decStr = pctDecChars(str);
4143
- return !decStr.match(protocol.UNRESERVED) ? str : decStr;
4144
- }
4145
- if (components.scheme) components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME, "");
4146
- if (components.userinfo !== undefined) components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
4147
- if (components.host !== undefined) components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
4148
- if (components.path !== undefined) components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
4149
- if (components.query !== undefined) components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
4150
- if (components.fragment !== undefined) components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
4151
- return components;
4152
- }
3955
+ delta += (m - n) * handledCPCountPlusOne;
3956
+ n = m;
4153
3957
 
4154
- function _stripLeadingZeros(str) {
4155
- return str.replace(/^0*(.*)/, "$1") || "0";
4156
- }
4157
- function _normalizeIPv4(host, protocol) {
4158
- var matches = host.match(protocol.IPV4ADDRESS) || [];
3958
+ var _iteratorNormalCompletion3 = true;
3959
+ var _didIteratorError3 = false;
3960
+ var _iteratorError3 = undefined;
4159
3961
 
4160
- var _matches = slicedToArray(matches, 2),
4161
- address = _matches[1];
3962
+ try {
3963
+ for (var _iterator3 = input[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
3964
+ var _currentValue = _step3.value;
4162
3965
 
4163
- if (address) {
4164
- return address.split(".").map(_stripLeadingZeros).join(".");
4165
- } else {
4166
- return host;
4167
- }
4168
- }
4169
- function _normalizeIPv6(host, protocol) {
4170
- var matches = host.match(protocol.IPV6ADDRESS) || [];
4171
-
4172
- var _matches2 = slicedToArray(matches, 3),
4173
- address = _matches2[1],
4174
- zone = _matches2[2];
4175
-
4176
- if (address) {
4177
- var _address$toLowerCase$ = address.toLowerCase().split('::').reverse(),
4178
- _address$toLowerCase$2 = slicedToArray(_address$toLowerCase$, 2),
4179
- last = _address$toLowerCase$2[0],
4180
- first = _address$toLowerCase$2[1];
4181
-
4182
- var firstFields = first ? first.split(":").map(_stripLeadingZeros) : [];
4183
- var lastFields = last.split(":").map(_stripLeadingZeros);
4184
- var isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]);
4185
- var fieldCount = isLastFieldIPv4Address ? 7 : 8;
4186
- var lastFieldsStart = lastFields.length - fieldCount;
4187
- var fields = Array(fieldCount);
4188
- for (var x = 0; x < fieldCount; ++x) {
4189
- fields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || '';
4190
- }
4191
- if (isLastFieldIPv4Address) {
4192
- fields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol);
4193
- }
4194
- var allZeroFields = fields.reduce(function (acc, field, index) {
4195
- if (!field || field === "0") {
4196
- var lastLongest = acc[acc.length - 1];
4197
- if (lastLongest && lastLongest.index + lastLongest.length === index) {
4198
- lastLongest.length++;
4199
- } else {
4200
- acc.push({ index: index, length: 1 });
4201
- }
4202
- }
4203
- return acc;
4204
- }, []);
4205
- var longestZeroFields = allZeroFields.sort(function (a, b) {
4206
- return b.length - a.length;
4207
- })[0];
4208
- var newHost = void 0;
4209
- if (longestZeroFields && longestZeroFields.length > 1) {
4210
- var newFirst = fields.slice(0, longestZeroFields.index);
4211
- var newLast = fields.slice(longestZeroFields.index + longestZeroFields.length);
4212
- newHost = newFirst.join(":") + "::" + newLast.join(":");
4213
- } else {
4214
- newHost = fields.join(":");
4215
- }
4216
- if (zone) {
4217
- newHost += "%" + zone;
4218
- }
4219
- return newHost;
4220
- } else {
4221
- return host;
4222
- }
4223
- }
4224
- var URI_PARSE = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i;
4225
- var NO_MATCH_IS_UNDEFINED = "".match(/(){0}/)[1] === undefined;
4226
- function parse(uriString) {
4227
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
4228
-
4229
- var components = {};
4230
- var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL;
4231
- if (options.reference === "suffix") uriString = (options.scheme ? options.scheme + ":" : "") + "//" + uriString;
4232
- var matches = uriString.match(URI_PARSE);
4233
- if (matches) {
4234
- if (NO_MATCH_IS_UNDEFINED) {
4235
- //store each component
4236
- components.scheme = matches[1];
4237
- components.userinfo = matches[3];
4238
- components.host = matches[4];
4239
- components.port = parseInt(matches[5], 10);
4240
- components.path = matches[6] || "";
4241
- components.query = matches[7];
4242
- components.fragment = matches[8];
4243
- //fix port number
4244
- if (isNaN(components.port)) {
4245
- components.port = matches[5];
4246
- }
4247
- } else {
4248
- //IE FIX for improper RegExp matching
4249
- //store each component
4250
- components.scheme = matches[1] || undefined;
4251
- components.userinfo = uriString.indexOf("@") !== -1 ? matches[3] : undefined;
4252
- components.host = uriString.indexOf("//") !== -1 ? matches[4] : undefined;
4253
- components.port = parseInt(matches[5], 10);
4254
- components.path = matches[6] || "";
4255
- components.query = uriString.indexOf("?") !== -1 ? matches[7] : undefined;
4256
- components.fragment = uriString.indexOf("#") !== -1 ? matches[8] : undefined;
4257
- //fix port number
4258
- if (isNaN(components.port)) {
4259
- components.port = uriString.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/) ? matches[4] : undefined;
4260
- }
4261
- }
4262
- if (components.host) {
4263
- //normalize IP hosts
4264
- components.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol);
4265
- }
4266
- //determine reference type
4267
- if (components.scheme === undefined && components.userinfo === undefined && components.host === undefined && components.port === undefined && !components.path && components.query === undefined) {
4268
- components.reference = "same-document";
4269
- } else if (components.scheme === undefined) {
4270
- components.reference = "relative";
4271
- } else if (components.fragment === undefined) {
4272
- components.reference = "absolute";
4273
- } else {
4274
- components.reference = "uri";
4275
- }
4276
- //check for reference errors
4277
- if (options.reference && options.reference !== "suffix" && options.reference !== components.reference) {
4278
- components.error = components.error || "URI is not a " + options.reference + " reference.";
4279
- }
4280
- //find scheme handler
4281
- var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()];
4282
- //check if scheme can't handle IRIs
4283
- if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {
4284
- //if host component is a domain name
4285
- if (components.host && (options.domainHost || schemeHandler && schemeHandler.domainHost)) {
4286
- //convert Unicode IDN -> ASCII IDN
4287
- try {
4288
- components.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase());
4289
- } catch (e) {
4290
- components.error = components.error || "Host's domain name can not be converted to ASCII via punycode: " + e;
4291
- }
4292
- }
4293
- //convert IRI -> URI
4294
- _normalizeComponentEncoding(components, URI_PROTOCOL);
4295
- } else {
4296
- //normalize encodings
4297
- _normalizeComponentEncoding(components, protocol);
4298
- }
4299
- //perform scheme specific parsing
4300
- if (schemeHandler && schemeHandler.parse) {
4301
- schemeHandler.parse(components, options);
4302
- }
4303
- } else {
4304
- components.error = components.error || "URI can not be parsed.";
4305
- }
4306
- return components;
4307
- }
3966
+ if (_currentValue < n && ++delta > maxInt) {
3967
+ error$1('overflow');
3968
+ }
3969
+ if (_currentValue == n) {
3970
+ // Represent delta as a generalized variable-length integer.
3971
+ var q = delta;
3972
+ for (var k = base;; /* no condition */k += base) {
3973
+ var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
3974
+ if (q < t) {
3975
+ break;
3976
+ }
3977
+ var qMinusT = q - t;
3978
+ var baseMinusT = base - t;
3979
+ output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)));
3980
+ q = floor(qMinusT / baseMinusT);
3981
+ }
4308
3982
 
4309
- function _recomposeAuthority(components, options) {
4310
- var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL;
4311
- var uriTokens = [];
4312
- if (components.userinfo !== undefined) {
4313
- uriTokens.push(components.userinfo);
4314
- uriTokens.push("@");
4315
- }
4316
- if (components.host !== undefined) {
4317
- //normalize IP hosts, add brackets and escape zone separator for IPv6
4318
- uriTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, function (_, $1, $2) {
4319
- return "[" + $1 + ($2 ? "%25" + $2 : "") + "]";
4320
- }));
4321
- }
4322
- if (typeof components.port === "number" || typeof components.port === "string") {
4323
- uriTokens.push(":");
4324
- uriTokens.push(String(components.port));
4325
- }
4326
- return uriTokens.length ? uriTokens.join("") : undefined;
4327
- }
3983
+ output.push(stringFromCharCode(digitToBasic(q, 0)));
3984
+ bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
3985
+ delta = 0;
3986
+ ++handledCPCount;
3987
+ }
3988
+ }
3989
+ } catch (err) {
3990
+ _didIteratorError3 = true;
3991
+ _iteratorError3 = err;
3992
+ } finally {
3993
+ try {
3994
+ if (!_iteratorNormalCompletion3 && _iterator3.return) {
3995
+ _iterator3.return();
3996
+ }
3997
+ } finally {
3998
+ if (_didIteratorError3) {
3999
+ throw _iteratorError3;
4000
+ }
4001
+ }
4002
+ }
4328
4003
 
4329
- var RDS1 = /^\.\.?\//;
4330
- var RDS2 = /^\/\.(\/|$)/;
4331
- var RDS3 = /^\/\.\.(\/|$)/;
4332
- var RDS5 = /^\/?(?:.|\n)*?(?=\/|$)/;
4333
- function removeDotSegments(input) {
4334
- var output = [];
4335
- while (input.length) {
4336
- if (input.match(RDS1)) {
4337
- input = input.replace(RDS1, "");
4338
- } else if (input.match(RDS2)) {
4339
- input = input.replace(RDS2, "/");
4340
- } else if (input.match(RDS3)) {
4341
- input = input.replace(RDS3, "/");
4342
- output.pop();
4343
- } else if (input === "." || input === "..") {
4344
- input = "";
4345
- } else {
4346
- var im = input.match(RDS5);
4347
- if (im) {
4348
- var s = im[0];
4349
- input = input.slice(s.length);
4350
- output.push(s);
4351
- } else {
4352
- throw new Error("Unexpected dot segment condition");
4353
- }
4354
- }
4355
- }
4356
- return output.join("");
4357
- }
4004
+ ++delta;
4005
+ ++n;
4006
+ }
4007
+ return output.join('');
4008
+ };
4358
4009
 
4359
- function serialize(components) {
4360
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
4361
-
4362
- var protocol = options.iri ? IRI_PROTOCOL : URI_PROTOCOL;
4363
- var uriTokens = [];
4364
- //find scheme handler
4365
- var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()];
4366
- //perform scheme specific serialization
4367
- if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(components, options);
4368
- if (components.host) {
4369
- //if host component is an IPv6 address
4370
- if (protocol.IPV6ADDRESS.test(components.host)) ;
4371
- //TODO: normalize IPv6 address as per RFC 5952
4372
-
4373
- //if host component is a domain name
4374
- else if (options.domainHost || schemeHandler && schemeHandler.domainHost) {
4375
- //convert IDN via punycode
4376
- try {
4377
- components.host = !options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host);
4378
- } catch (e) {
4379
- components.error = components.error || "Host's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e;
4380
- }
4381
- }
4382
- }
4383
- //normalize encoding
4384
- _normalizeComponentEncoding(components, protocol);
4385
- if (options.reference !== "suffix" && components.scheme) {
4386
- uriTokens.push(components.scheme);
4387
- uriTokens.push(":");
4388
- }
4389
- var authority = _recomposeAuthority(components, options);
4390
- if (authority !== undefined) {
4391
- if (options.reference !== "suffix") {
4392
- uriTokens.push("//");
4393
- }
4394
- uriTokens.push(authority);
4395
- if (components.path && components.path.charAt(0) !== "/") {
4396
- uriTokens.push("/");
4397
- }
4398
- }
4399
- if (components.path !== undefined) {
4400
- var s = components.path;
4401
- if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {
4402
- s = removeDotSegments(s);
4403
- }
4404
- if (authority === undefined) {
4405
- s = s.replace(/^\/\//, "/%2F"); //don't allow the path to start with "//"
4406
- }
4407
- uriTokens.push(s);
4408
- }
4409
- if (components.query !== undefined) {
4410
- uriTokens.push("?");
4411
- uriTokens.push(components.query);
4412
- }
4413
- if (components.fragment !== undefined) {
4414
- uriTokens.push("#");
4415
- uriTokens.push(components.fragment);
4416
- }
4417
- return uriTokens.join(""); //merge tokens into a string
4418
- }
4010
+ /**
4011
+ * Converts a Punycode string representing a domain name or an email address
4012
+ * to Unicode. Only the Punycoded parts of the input will be converted, i.e.
4013
+ * it doesn't matter if you call it on a string that has already been
4014
+ * converted to Unicode.
4015
+ * @memberOf punycode
4016
+ * @param {String} input The Punycoded domain name or email address to
4017
+ * convert to Unicode.
4018
+ * @returns {String} The Unicode representation of the given Punycode
4019
+ * string.
4020
+ */
4021
+ var toUnicode = function toUnicode(input) {
4022
+ return mapDomain(input, function (string) {
4023
+ return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string;
4024
+ });
4025
+ };
4419
4026
 
4420
- function resolveComponents(base, relative) {
4421
- var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
4422
- var skipNormalization = arguments[3];
4027
+ /**
4028
+ * Converts a Unicode string representing a domain name or an email address to
4029
+ * Punycode. Only the non-ASCII parts of the domain name will be converted,
4030
+ * i.e. it doesn't matter if you call it with a domain that's already in
4031
+ * ASCII.
4032
+ * @memberOf punycode
4033
+ * @param {String} input The domain name or email address to convert, as a
4034
+ * Unicode string.
4035
+ * @returns {String} The Punycode representation of the given domain name or
4036
+ * email address.
4037
+ */
4038
+ var toASCII = function toASCII(input) {
4039
+ return mapDomain(input, function (string) {
4040
+ return regexNonASCII.test(string) ? 'xn--' + encode(string) : string;
4041
+ });
4042
+ };
4043
+
4044
+ /*--------------------------------------------------------------------------*/
4045
+
4046
+ /** Define the public API */
4047
+ var punycode = {
4048
+ /**
4049
+ * A string representing the current Punycode.js version number.
4050
+ * @memberOf punycode
4051
+ * @type String
4052
+ */
4053
+ 'version': '2.1.0',
4054
+ /**
4055
+ * An object of methods to convert from JavaScript's internal character
4056
+ * representation (UCS-2) to Unicode code points, and back.
4057
+ * @see <https://mathiasbynens.be/notes/javascript-encoding>
4058
+ * @memberOf punycode
4059
+ * @type Object
4060
+ */
4061
+ 'ucs2': {
4062
+ 'decode': ucs2decode,
4063
+ 'encode': ucs2encode
4064
+ },
4065
+ 'decode': decode,
4066
+ 'encode': encode,
4067
+ 'toASCII': toASCII,
4068
+ 'toUnicode': toUnicode
4069
+ };
4423
4070
 
4424
- var target = {};
4425
- if (!skipNormalization) {
4426
- base = parse(serialize(base, options), options); //normalize base components
4427
- relative = parse(serialize(relative, options), options); //normalize relative components
4428
- }
4429
- options = options || {};
4430
- if (!options.tolerant && relative.scheme) {
4431
- target.scheme = relative.scheme;
4432
- //target.authority = relative.authority;
4433
- target.userinfo = relative.userinfo;
4434
- target.host = relative.host;
4435
- target.port = relative.port;
4436
- target.path = removeDotSegments(relative.path || "");
4437
- target.query = relative.query;
4438
- } else {
4439
- if (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) {
4440
- //target.authority = relative.authority;
4441
- target.userinfo = relative.userinfo;
4442
- target.host = relative.host;
4443
- target.port = relative.port;
4444
- target.path = removeDotSegments(relative.path || "");
4445
- target.query = relative.query;
4446
- } else {
4447
- if (!relative.path) {
4448
- target.path = base.path;
4449
- if (relative.query !== undefined) {
4450
- target.query = relative.query;
4451
- } else {
4452
- target.query = base.query;
4453
- }
4454
- } else {
4455
- if (relative.path.charAt(0) === "/") {
4456
- target.path = removeDotSegments(relative.path);
4457
- } else {
4458
- if ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) {
4459
- target.path = "/" + relative.path;
4460
- } else if (!base.path) {
4461
- target.path = relative.path;
4462
- } else {
4463
- target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path;
4464
- }
4465
- target.path = removeDotSegments(target.path);
4466
- }
4467
- target.query = relative.query;
4468
- }
4469
- //target.authority = base.authority;
4470
- target.userinfo = base.userinfo;
4471
- target.host = base.host;
4472
- target.port = base.port;
4473
- }
4474
- target.scheme = base.scheme;
4475
- }
4476
- target.fragment = relative.fragment;
4477
- return target;
4478
- }
4071
+ /**
4072
+ * URI.js
4073
+ *
4074
+ * @fileoverview An RFC 3986 compliant, scheme extendable URI parsing/validating/resolving library for JavaScript.
4075
+ * @author <a href="mailto:gary.court@gmail.com">Gary Court</a>
4076
+ * @see http://github.com/garycourt/uri-js
4077
+ */
4078
+ /**
4079
+ * Copyright 2011 Gary Court. All rights reserved.
4080
+ *
4081
+ * Redistribution and use in source and binary forms, with or without modification, are
4082
+ * permitted provided that the following conditions are met:
4083
+ *
4084
+ * 1. Redistributions of source code must retain the above copyright notice, this list of
4085
+ * conditions and the following disclaimer.
4086
+ *
4087
+ * 2. Redistributions in binary form must reproduce the above copyright notice, this list
4088
+ * of conditions and the following disclaimer in the documentation and/or other materials
4089
+ * provided with the distribution.
4090
+ *
4091
+ * THIS SOFTWARE IS PROVIDED BY GARY COURT ``AS IS'' AND ANY EXPRESS OR IMPLIED
4092
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
4093
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR
4094
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
4095
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
4096
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
4097
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
4098
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
4099
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4100
+ *
4101
+ * The views and conclusions contained in the software and documentation are those of the
4102
+ * authors and should not be interpreted as representing official policies, either expressed
4103
+ * or implied, of Gary Court.
4104
+ */
4105
+ var SCHEMES = {};
4106
+ function pctEncChar(chr) {
4107
+ var c = chr.charCodeAt(0);
4108
+ var e = void 0;
4109
+ if (c < 16) e = "%0" + c.toString(16).toUpperCase();else if (c < 128) e = "%" + c.toString(16).toUpperCase();else if (c < 2048) e = "%" + (c >> 6 | 192).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase();else e = "%" + (c >> 12 | 224).toString(16).toUpperCase() + "%" + (c >> 6 & 63 | 128).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase();
4110
+ return e;
4111
+ }
4112
+ function pctDecChars(str) {
4113
+ var newStr = "";
4114
+ var i = 0;
4115
+ var il = str.length;
4116
+ while (i < il) {
4117
+ var c = parseInt(str.substr(i + 1, 2), 16);
4118
+ if (c < 128) {
4119
+ newStr += String.fromCharCode(c);
4120
+ i += 3;
4121
+ } else if (c >= 194 && c < 224) {
4122
+ if (il - i >= 6) {
4123
+ var c2 = parseInt(str.substr(i + 4, 2), 16);
4124
+ newStr += String.fromCharCode((c & 31) << 6 | c2 & 63);
4125
+ } else {
4126
+ newStr += str.substr(i, 6);
4127
+ }
4128
+ i += 6;
4129
+ } else if (c >= 224) {
4130
+ if (il - i >= 9) {
4131
+ var _c = parseInt(str.substr(i + 4, 2), 16);
4132
+ var c3 = parseInt(str.substr(i + 7, 2), 16);
4133
+ newStr += String.fromCharCode((c & 15) << 12 | (_c & 63) << 6 | c3 & 63);
4134
+ } else {
4135
+ newStr += str.substr(i, 9);
4136
+ }
4137
+ i += 9;
4138
+ } else {
4139
+ newStr += str.substr(i, 3);
4140
+ i += 3;
4141
+ }
4142
+ }
4143
+ return newStr;
4144
+ }
4145
+ function _normalizeComponentEncoding(components, protocol) {
4146
+ function decodeUnreserved(str) {
4147
+ var decStr = pctDecChars(str);
4148
+ return !decStr.match(protocol.UNRESERVED) ? str : decStr;
4149
+ }
4150
+ if (components.scheme) components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME, "");
4151
+ if (components.userinfo !== undefined) components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
4152
+ if (components.host !== undefined) components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
4153
+ if (components.path !== undefined) components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
4154
+ if (components.query !== undefined) components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
4155
+ if (components.fragment !== undefined) components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
4156
+ return components;
4157
+ }
4479
4158
 
4480
- function resolve(baseURI, relativeURI, options) {
4481
- var schemelessOptions = assign({ scheme: 'null' }, options);
4482
- return serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions);
4483
- }
4159
+ function _stripLeadingZeros(str) {
4160
+ return str.replace(/^0*(.*)/, "$1") || "0";
4161
+ }
4162
+ function _normalizeIPv4(host, protocol) {
4163
+ var matches = host.match(protocol.IPV4ADDRESS) || [];
4484
4164
 
4485
- function normalize(uri, options) {
4486
- if (typeof uri === "string") {
4487
- uri = serialize(parse(uri, options), options);
4488
- } else if (typeOf(uri) === "object") {
4489
- uri = parse(serialize(uri, options), options);
4490
- }
4491
- return uri;
4492
- }
4165
+ var _matches = slicedToArray(matches, 2),
4166
+ address = _matches[1];
4493
4167
 
4494
- function equal(uriA, uriB, options) {
4495
- if (typeof uriA === "string") {
4496
- uriA = serialize(parse(uriA, options), options);
4497
- } else if (typeOf(uriA) === "object") {
4498
- uriA = serialize(uriA, options);
4499
- }
4500
- if (typeof uriB === "string") {
4501
- uriB = serialize(parse(uriB, options), options);
4502
- } else if (typeOf(uriB) === "object") {
4503
- uriB = serialize(uriB, options);
4504
- }
4505
- return uriA === uriB;
4506
- }
4168
+ if (address) {
4169
+ return address.split(".").map(_stripLeadingZeros).join(".");
4170
+ } else {
4171
+ return host;
4172
+ }
4173
+ }
4174
+ function _normalizeIPv6(host, protocol) {
4175
+ var matches = host.match(protocol.IPV6ADDRESS) || [];
4176
+
4177
+ var _matches2 = slicedToArray(matches, 3),
4178
+ address = _matches2[1],
4179
+ zone = _matches2[2];
4180
+
4181
+ if (address) {
4182
+ var _address$toLowerCase$ = address.toLowerCase().split('::').reverse(),
4183
+ _address$toLowerCase$2 = slicedToArray(_address$toLowerCase$, 2),
4184
+ last = _address$toLowerCase$2[0],
4185
+ first = _address$toLowerCase$2[1];
4186
+
4187
+ var firstFields = first ? first.split(":").map(_stripLeadingZeros) : [];
4188
+ var lastFields = last.split(":").map(_stripLeadingZeros);
4189
+ var isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]);
4190
+ var fieldCount = isLastFieldIPv4Address ? 7 : 8;
4191
+ var lastFieldsStart = lastFields.length - fieldCount;
4192
+ var fields = Array(fieldCount);
4193
+ for (var x = 0; x < fieldCount; ++x) {
4194
+ fields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || '';
4195
+ }
4196
+ if (isLastFieldIPv4Address) {
4197
+ fields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol);
4198
+ }
4199
+ var allZeroFields = fields.reduce(function (acc, field, index) {
4200
+ if (!field || field === "0") {
4201
+ var lastLongest = acc[acc.length - 1];
4202
+ if (lastLongest && lastLongest.index + lastLongest.length === index) {
4203
+ lastLongest.length++;
4204
+ } else {
4205
+ acc.push({ index: index, length: 1 });
4206
+ }
4207
+ }
4208
+ return acc;
4209
+ }, []);
4210
+ var longestZeroFields = allZeroFields.sort(function (a, b) {
4211
+ return b.length - a.length;
4212
+ })[0];
4213
+ var newHost = void 0;
4214
+ if (longestZeroFields && longestZeroFields.length > 1) {
4215
+ var newFirst = fields.slice(0, longestZeroFields.index);
4216
+ var newLast = fields.slice(longestZeroFields.index + longestZeroFields.length);
4217
+ newHost = newFirst.join(":") + "::" + newLast.join(":");
4218
+ } else {
4219
+ newHost = fields.join(":");
4220
+ }
4221
+ if (zone) {
4222
+ newHost += "%" + zone;
4223
+ }
4224
+ return newHost;
4225
+ } else {
4226
+ return host;
4227
+ }
4228
+ }
4229
+ var URI_PARSE = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i;
4230
+ var NO_MATCH_IS_UNDEFINED = "".match(/(){0}/)[1] === undefined;
4231
+ function parse(uriString) {
4232
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
4233
+
4234
+ var components = {};
4235
+ var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL;
4236
+ if (options.reference === "suffix") uriString = (options.scheme ? options.scheme + ":" : "") + "//" + uriString;
4237
+ var matches = uriString.match(URI_PARSE);
4238
+ if (matches) {
4239
+ if (NO_MATCH_IS_UNDEFINED) {
4240
+ //store each component
4241
+ components.scheme = matches[1];
4242
+ components.userinfo = matches[3];
4243
+ components.host = matches[4];
4244
+ components.port = parseInt(matches[5], 10);
4245
+ components.path = matches[6] || "";
4246
+ components.query = matches[7];
4247
+ components.fragment = matches[8];
4248
+ //fix port number
4249
+ if (isNaN(components.port)) {
4250
+ components.port = matches[5];
4251
+ }
4252
+ } else {
4253
+ //IE FIX for improper RegExp matching
4254
+ //store each component
4255
+ components.scheme = matches[1] || undefined;
4256
+ components.userinfo = uriString.indexOf("@") !== -1 ? matches[3] : undefined;
4257
+ components.host = uriString.indexOf("//") !== -1 ? matches[4] : undefined;
4258
+ components.port = parseInt(matches[5], 10);
4259
+ components.path = matches[6] || "";
4260
+ components.query = uriString.indexOf("?") !== -1 ? matches[7] : undefined;
4261
+ components.fragment = uriString.indexOf("#") !== -1 ? matches[8] : undefined;
4262
+ //fix port number
4263
+ if (isNaN(components.port)) {
4264
+ components.port = uriString.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/) ? matches[4] : undefined;
4265
+ }
4266
+ }
4267
+ if (components.host) {
4268
+ //normalize IP hosts
4269
+ components.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol);
4270
+ }
4271
+ //determine reference type
4272
+ if (components.scheme === undefined && components.userinfo === undefined && components.host === undefined && components.port === undefined && !components.path && components.query === undefined) {
4273
+ components.reference = "same-document";
4274
+ } else if (components.scheme === undefined) {
4275
+ components.reference = "relative";
4276
+ } else if (components.fragment === undefined) {
4277
+ components.reference = "absolute";
4278
+ } else {
4279
+ components.reference = "uri";
4280
+ }
4281
+ //check for reference errors
4282
+ if (options.reference && options.reference !== "suffix" && options.reference !== components.reference) {
4283
+ components.error = components.error || "URI is not a " + options.reference + " reference.";
4284
+ }
4285
+ //find scheme handler
4286
+ var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()];
4287
+ //check if scheme can't handle IRIs
4288
+ if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {
4289
+ //if host component is a domain name
4290
+ if (components.host && (options.domainHost || schemeHandler && schemeHandler.domainHost)) {
4291
+ //convert Unicode IDN -> ASCII IDN
4292
+ try {
4293
+ components.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase());
4294
+ } catch (e) {
4295
+ components.error = components.error || "Host's domain name can not be converted to ASCII via punycode: " + e;
4296
+ }
4297
+ }
4298
+ //convert IRI -> URI
4299
+ _normalizeComponentEncoding(components, URI_PROTOCOL);
4300
+ } else {
4301
+ //normalize encodings
4302
+ _normalizeComponentEncoding(components, protocol);
4303
+ }
4304
+ //perform scheme specific parsing
4305
+ if (schemeHandler && schemeHandler.parse) {
4306
+ schemeHandler.parse(components, options);
4307
+ }
4308
+ } else {
4309
+ components.error = components.error || "URI can not be parsed.";
4310
+ }
4311
+ return components;
4312
+ }
4507
4313
 
4508
- function escapeComponent(str, options) {
4509
- return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE, pctEncChar);
4510
- }
4314
+ function _recomposeAuthority(components, options) {
4315
+ var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL;
4316
+ var uriTokens = [];
4317
+ if (components.userinfo !== undefined) {
4318
+ uriTokens.push(components.userinfo);
4319
+ uriTokens.push("@");
4320
+ }
4321
+ if (components.host !== undefined) {
4322
+ //normalize IP hosts, add brackets and escape zone separator for IPv6
4323
+ uriTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, function (_, $1, $2) {
4324
+ return "[" + $1 + ($2 ? "%25" + $2 : "") + "]";
4325
+ }));
4326
+ }
4327
+ if (typeof components.port === "number" || typeof components.port === "string") {
4328
+ uriTokens.push(":");
4329
+ uriTokens.push(String(components.port));
4330
+ }
4331
+ return uriTokens.length ? uriTokens.join("") : undefined;
4332
+ }
4511
4333
 
4512
- function unescapeComponent(str, options) {
4513
- return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED, pctDecChars);
4514
- }
4334
+ var RDS1 = /^\.\.?\//;
4335
+ var RDS2 = /^\/\.(\/|$)/;
4336
+ var RDS3 = /^\/\.\.(\/|$)/;
4337
+ var RDS5 = /^\/?(?:.|\n)*?(?=\/|$)/;
4338
+ function removeDotSegments(input) {
4339
+ var output = [];
4340
+ while (input.length) {
4341
+ if (input.match(RDS1)) {
4342
+ input = input.replace(RDS1, "");
4343
+ } else if (input.match(RDS2)) {
4344
+ input = input.replace(RDS2, "/");
4345
+ } else if (input.match(RDS3)) {
4346
+ input = input.replace(RDS3, "/");
4347
+ output.pop();
4348
+ } else if (input === "." || input === "..") {
4349
+ input = "";
4350
+ } else {
4351
+ var im = input.match(RDS5);
4352
+ if (im) {
4353
+ var s = im[0];
4354
+ input = input.slice(s.length);
4355
+ output.push(s);
4356
+ } else {
4357
+ throw new Error("Unexpected dot segment condition");
4358
+ }
4359
+ }
4360
+ }
4361
+ return output.join("");
4362
+ }
4515
4363
 
4516
- var handler = {
4517
- scheme: "http",
4518
- domainHost: true,
4519
- parse: function parse(components, options) {
4520
- //report missing host
4521
- if (!components.host) {
4522
- components.error = components.error || "HTTP URIs must have a host.";
4523
- }
4524
- return components;
4525
- },
4526
- serialize: function serialize(components, options) {
4527
- var secure = String(components.scheme).toLowerCase() === "https";
4528
- //normalize the default port
4529
- if (components.port === (secure ? 443 : 80) || components.port === "") {
4530
- components.port = undefined;
4531
- }
4532
- //normalize the empty path
4533
- if (!components.path) {
4534
- components.path = "/";
4535
- }
4536
- //NOTE: We do not parse query strings for HTTP URIs
4537
- //as WWW Form Url Encoded query strings are part of the HTML4+ spec,
4538
- //and not the HTTP spec.
4539
- return components;
4540
- }
4541
- };
4364
+ function serialize(components) {
4365
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
4366
+
4367
+ var protocol = options.iri ? IRI_PROTOCOL : URI_PROTOCOL;
4368
+ var uriTokens = [];
4369
+ //find scheme handler
4370
+ var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()];
4371
+ //perform scheme specific serialization
4372
+ if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(components, options);
4373
+ if (components.host) {
4374
+ //if host component is an IPv6 address
4375
+ if (protocol.IPV6ADDRESS.test(components.host)) ;
4376
+ //TODO: normalize IPv6 address as per RFC 5952
4377
+
4378
+ //if host component is a domain name
4379
+ else if (options.domainHost || schemeHandler && schemeHandler.domainHost) {
4380
+ //convert IDN via punycode
4381
+ try {
4382
+ components.host = !options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host);
4383
+ } catch (e) {
4384
+ components.error = components.error || "Host's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e;
4385
+ }
4386
+ }
4387
+ }
4388
+ //normalize encoding
4389
+ _normalizeComponentEncoding(components, protocol);
4390
+ if (options.reference !== "suffix" && components.scheme) {
4391
+ uriTokens.push(components.scheme);
4392
+ uriTokens.push(":");
4393
+ }
4394
+ var authority = _recomposeAuthority(components, options);
4395
+ if (authority !== undefined) {
4396
+ if (options.reference !== "suffix") {
4397
+ uriTokens.push("//");
4398
+ }
4399
+ uriTokens.push(authority);
4400
+ if (components.path && components.path.charAt(0) !== "/") {
4401
+ uriTokens.push("/");
4402
+ }
4403
+ }
4404
+ if (components.path !== undefined) {
4405
+ var s = components.path;
4406
+ if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {
4407
+ s = removeDotSegments(s);
4408
+ }
4409
+ if (authority === undefined) {
4410
+ s = s.replace(/^\/\//, "/%2F"); //don't allow the path to start with "//"
4411
+ }
4412
+ uriTokens.push(s);
4413
+ }
4414
+ if (components.query !== undefined) {
4415
+ uriTokens.push("?");
4416
+ uriTokens.push(components.query);
4417
+ }
4418
+ if (components.fragment !== undefined) {
4419
+ uriTokens.push("#");
4420
+ uriTokens.push(components.fragment);
4421
+ }
4422
+ return uriTokens.join(""); //merge tokens into a string
4423
+ }
4542
4424
 
4543
- var handler$1 = {
4544
- scheme: "https",
4545
- domainHost: handler.domainHost,
4546
- parse: handler.parse,
4547
- serialize: handler.serialize
4548
- };
4425
+ function resolveComponents(base, relative) {
4426
+ var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
4427
+ var skipNormalization = arguments[3];
4428
+
4429
+ var target = {};
4430
+ if (!skipNormalization) {
4431
+ base = parse(serialize(base, options), options); //normalize base components
4432
+ relative = parse(serialize(relative, options), options); //normalize relative components
4433
+ }
4434
+ options = options || {};
4435
+ if (!options.tolerant && relative.scheme) {
4436
+ target.scheme = relative.scheme;
4437
+ //target.authority = relative.authority;
4438
+ target.userinfo = relative.userinfo;
4439
+ target.host = relative.host;
4440
+ target.port = relative.port;
4441
+ target.path = removeDotSegments(relative.path || "");
4442
+ target.query = relative.query;
4443
+ } else {
4444
+ if (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) {
4445
+ //target.authority = relative.authority;
4446
+ target.userinfo = relative.userinfo;
4447
+ target.host = relative.host;
4448
+ target.port = relative.port;
4449
+ target.path = removeDotSegments(relative.path || "");
4450
+ target.query = relative.query;
4451
+ } else {
4452
+ if (!relative.path) {
4453
+ target.path = base.path;
4454
+ if (relative.query !== undefined) {
4455
+ target.query = relative.query;
4456
+ } else {
4457
+ target.query = base.query;
4458
+ }
4459
+ } else {
4460
+ if (relative.path.charAt(0) === "/") {
4461
+ target.path = removeDotSegments(relative.path);
4462
+ } else {
4463
+ if ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) {
4464
+ target.path = "/" + relative.path;
4465
+ } else if (!base.path) {
4466
+ target.path = relative.path;
4467
+ } else {
4468
+ target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path;
4469
+ }
4470
+ target.path = removeDotSegments(target.path);
4471
+ }
4472
+ target.query = relative.query;
4473
+ }
4474
+ //target.authority = base.authority;
4475
+ target.userinfo = base.userinfo;
4476
+ target.host = base.host;
4477
+ target.port = base.port;
4478
+ }
4479
+ target.scheme = base.scheme;
4480
+ }
4481
+ target.fragment = relative.fragment;
4482
+ return target;
4483
+ }
4549
4484
 
4550
- function isSecure(wsComponents) {
4551
- return typeof wsComponents.secure === 'boolean' ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === "wss";
4552
- }
4553
- //RFC 6455
4554
- var handler$2 = {
4555
- scheme: "ws",
4556
- domainHost: true,
4557
- parse: function parse(components, options) {
4558
- var wsComponents = components;
4559
- //indicate if the secure flag is set
4560
- wsComponents.secure = isSecure(wsComponents);
4561
- //construct resouce name
4562
- wsComponents.resourceName = (wsComponents.path || '/') + (wsComponents.query ? '?' + wsComponents.query : '');
4563
- wsComponents.path = undefined;
4564
- wsComponents.query = undefined;
4565
- return wsComponents;
4566
- },
4567
- serialize: function serialize(wsComponents, options) {
4568
- //normalize the default port
4569
- if (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === "") {
4570
- wsComponents.port = undefined;
4571
- }
4572
- //ensure scheme matches secure flag
4573
- if (typeof wsComponents.secure === 'boolean') {
4574
- wsComponents.scheme = wsComponents.secure ? 'wss' : 'ws';
4575
- wsComponents.secure = undefined;
4576
- }
4577
- //reconstruct path from resource name
4578
- if (wsComponents.resourceName) {
4579
- var _wsComponents$resourc = wsComponents.resourceName.split('?'),
4580
- _wsComponents$resourc2 = slicedToArray(_wsComponents$resourc, 2),
4581
- path = _wsComponents$resourc2[0],
4582
- query = _wsComponents$resourc2[1];
4583
-
4584
- wsComponents.path = path && path !== '/' ? path : undefined;
4585
- wsComponents.query = query;
4586
- wsComponents.resourceName = undefined;
4587
- }
4588
- //forbid fragment component
4589
- wsComponents.fragment = undefined;
4590
- return wsComponents;
4591
- }
4592
- };
4485
+ function resolve(baseURI, relativeURI, options) {
4486
+ var schemelessOptions = assign({ scheme: 'null' }, options);
4487
+ return serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions);
4488
+ }
4593
4489
 
4594
- var handler$3 = {
4595
- scheme: "wss",
4596
- domainHost: handler$2.domainHost,
4597
- parse: handler$2.parse,
4598
- serialize: handler$2.serialize
4599
- };
4490
+ function normalize(uri, options) {
4491
+ if (typeof uri === "string") {
4492
+ uri = serialize(parse(uri, options), options);
4493
+ } else if (typeOf(uri) === "object") {
4494
+ uri = parse(serialize(uri, options), options);
4495
+ }
4496
+ return uri;
4497
+ }
4600
4498
 
4601
- var O = {};
4602
- //RFC 3986
4603
- var UNRESERVED$$ = "[A-Za-z0-9\\-\\.\\_\\~" + ("\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF" ) + "]";
4604
- var HEXDIG$$ = "[0-9A-Fa-f]"; //case-insensitive
4605
- var PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)); //expanded
4606
- //RFC 5322, except these symbols as per RFC 6068: @ : / ? # [ ] & ; =
4607
- //const ATEXT$$ = "[A-Za-z0-9\\!\\#\\$\\%\\&\\'\\*\\+\\-\\/\\=\\?\\^\\_\\`\\{\\|\\}\\~]";
4608
- //const WSP$$ = "[\\x20\\x09]";
4609
- //const OBS_QTEXT$$ = "[\\x01-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7F]"; //(%d1-8 / %d11-12 / %d14-31 / %d127)
4610
- //const QTEXT$$ = merge("[\\x21\\x23-\\x5B\\x5D-\\x7E]", OBS_QTEXT$$); //%d33 / %d35-91 / %d93-126 / obs-qtext
4611
- //const VCHAR$$ = "[\\x21-\\x7E]";
4612
- //const WSP$$ = "[\\x20\\x09]";
4613
- //const OBS_QP$ = subexp("\\\\" + merge("[\\x00\\x0D\\x0A]", OBS_QTEXT$$)); //%d0 / CR / LF / obs-qtext
4614
- //const FWS$ = subexp(subexp(WSP$$ + "*" + "\\x0D\\x0A") + "?" + WSP$$ + "+");
4615
- //const QUOTED_PAIR$ = subexp(subexp("\\\\" + subexp(VCHAR$$ + "|" + WSP$$)) + "|" + OBS_QP$);
4616
- //const QUOTED_STRING$ = subexp('\\"' + subexp(FWS$ + "?" + QCONTENT$) + "*" + FWS$ + "?" + '\\"');
4617
- var ATEXT$$ = "[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]";
4618
- var QTEXT$$ = "[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]";
4619
- var VCHAR$$ = merge(QTEXT$$, "[\\\"\\\\]");
4620
- var SOME_DELIMS$$ = "[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]";
4621
- var UNRESERVED = new RegExp(UNRESERVED$$, "g");
4622
- var PCT_ENCODED = new RegExp(PCT_ENCODED$, "g");
4623
- var NOT_LOCAL_PART = new RegExp(merge("[^]", ATEXT$$, "[\\.]", '[\\"]', VCHAR$$), "g");
4624
- var NOT_HFNAME = new RegExp(merge("[^]", UNRESERVED$$, SOME_DELIMS$$), "g");
4625
- var NOT_HFVALUE = NOT_HFNAME;
4626
- function decodeUnreserved(str) {
4627
- var decStr = pctDecChars(str);
4628
- return !decStr.match(UNRESERVED) ? str : decStr;
4629
- }
4630
- var handler$4 = {
4631
- scheme: "mailto",
4632
- parse: function parse$$1(components, options) {
4633
- var mailtoComponents = components;
4634
- var to = mailtoComponents.to = mailtoComponents.path ? mailtoComponents.path.split(",") : [];
4635
- mailtoComponents.path = undefined;
4636
- if (mailtoComponents.query) {
4637
- var unknownHeaders = false;
4638
- var headers = {};
4639
- var hfields = mailtoComponents.query.split("&");
4640
- for (var x = 0, xl = hfields.length; x < xl; ++x) {
4641
- var hfield = hfields[x].split("=");
4642
- switch (hfield[0]) {
4643
- case "to":
4644
- var toAddrs = hfield[1].split(",");
4645
- for (var _x = 0, _xl = toAddrs.length; _x < _xl; ++_x) {
4646
- to.push(toAddrs[_x]);
4647
- }
4648
- break;
4649
- case "subject":
4650
- mailtoComponents.subject = unescapeComponent(hfield[1], options);
4651
- break;
4652
- case "body":
4653
- mailtoComponents.body = unescapeComponent(hfield[1], options);
4654
- break;
4655
- default:
4656
- unknownHeaders = true;
4657
- headers[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options);
4658
- break;
4659
- }
4660
- }
4661
- if (unknownHeaders) mailtoComponents.headers = headers;
4662
- }
4663
- mailtoComponents.query = undefined;
4664
- for (var _x2 = 0, _xl2 = to.length; _x2 < _xl2; ++_x2) {
4665
- var addr = to[_x2].split("@");
4666
- addr[0] = unescapeComponent(addr[0]);
4667
- if (!options.unicodeSupport) {
4668
- //convert Unicode IDN -> ASCII IDN
4669
- try {
4670
- addr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase());
4671
- } catch (e) {
4672
- mailtoComponents.error = mailtoComponents.error || "Email address's domain name can not be converted to ASCII via punycode: " + e;
4673
- }
4674
- } else {
4675
- addr[1] = unescapeComponent(addr[1], options).toLowerCase();
4676
- }
4677
- to[_x2] = addr.join("@");
4678
- }
4679
- return mailtoComponents;
4680
- },
4681
- serialize: function serialize$$1(mailtoComponents, options) {
4682
- var components = mailtoComponents;
4683
- var to = toArray(mailtoComponents.to);
4684
- if (to) {
4685
- for (var x = 0, xl = to.length; x < xl; ++x) {
4686
- var toAddr = String(to[x]);
4687
- var atIdx = toAddr.lastIndexOf("@");
4688
- var localPart = toAddr.slice(0, atIdx).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar);
4689
- var domain = toAddr.slice(atIdx + 1);
4690
- //convert IDN via punycode
4691
- try {
4692
- domain = !options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain);
4693
- } catch (e) {
4694
- components.error = components.error || "Email address's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e;
4695
- }
4696
- to[x] = localPart + "@" + domain;
4697
- }
4698
- components.path = to.join(",");
4699
- }
4700
- var headers = mailtoComponents.headers = mailtoComponents.headers || {};
4701
- if (mailtoComponents.subject) headers["subject"] = mailtoComponents.subject;
4702
- if (mailtoComponents.body) headers["body"] = mailtoComponents.body;
4703
- var fields = [];
4704
- for (var name in headers) {
4705
- if (headers[name] !== O[name]) {
4706
- 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));
4707
- }
4708
- }
4709
- if (fields.length) {
4710
- components.query = fields.join("&");
4711
- }
4712
- return components;
4713
- }
4714
- };
4499
+ function equal(uriA, uriB, options) {
4500
+ if (typeof uriA === "string") {
4501
+ uriA = serialize(parse(uriA, options), options);
4502
+ } else if (typeOf(uriA) === "object") {
4503
+ uriA = serialize(uriA, options);
4504
+ }
4505
+ if (typeof uriB === "string") {
4506
+ uriB = serialize(parse(uriB, options), options);
4507
+ } else if (typeOf(uriB) === "object") {
4508
+ uriB = serialize(uriB, options);
4509
+ }
4510
+ return uriA === uriB;
4511
+ }
4715
4512
 
4716
- var URN_PARSE = /^([^\:]+)\:(.*)/;
4717
- //RFC 2141
4718
- var handler$5 = {
4719
- scheme: "urn",
4720
- parse: function parse$$1(components, options) {
4721
- var matches = components.path && components.path.match(URN_PARSE);
4722
- var urnComponents = components;
4723
- if (matches) {
4724
- var scheme = options.scheme || urnComponents.scheme || "urn";
4725
- var nid = matches[1].toLowerCase();
4726
- var nss = matches[2];
4727
- var urnScheme = scheme + ":" + (options.nid || nid);
4728
- var schemeHandler = SCHEMES[urnScheme];
4729
- urnComponents.nid = nid;
4730
- urnComponents.nss = nss;
4731
- urnComponents.path = undefined;
4732
- if (schemeHandler) {
4733
- urnComponents = schemeHandler.parse(urnComponents, options);
4734
- }
4735
- } else {
4736
- urnComponents.error = urnComponents.error || "URN can not be parsed.";
4737
- }
4738
- return urnComponents;
4739
- },
4740
- serialize: function serialize$$1(urnComponents, options) {
4741
- var scheme = options.scheme || urnComponents.scheme || "urn";
4742
- var nid = urnComponents.nid;
4743
- var urnScheme = scheme + ":" + (options.nid || nid);
4744
- var schemeHandler = SCHEMES[urnScheme];
4745
- if (schemeHandler) {
4746
- urnComponents = schemeHandler.serialize(urnComponents, options);
4747
- }
4748
- var uriComponents = urnComponents;
4749
- var nss = urnComponents.nss;
4750
- uriComponents.path = (nid || options.nid) + ":" + nss;
4751
- return uriComponents;
4752
- }
4753
- };
4513
+ function escapeComponent(str, options) {
4514
+ return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE, pctEncChar);
4515
+ }
4754
4516
 
4755
- var UUID = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/;
4756
- //RFC 4122
4757
- var handler$6 = {
4758
- scheme: "urn:uuid",
4759
- parse: function parse(urnComponents, options) {
4760
- var uuidComponents = urnComponents;
4761
- uuidComponents.uuid = uuidComponents.nss;
4762
- uuidComponents.nss = undefined;
4763
- if (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) {
4764
- uuidComponents.error = uuidComponents.error || "UUID is not valid.";
4765
- }
4766
- return uuidComponents;
4767
- },
4768
- serialize: function serialize(uuidComponents, options) {
4769
- var urnComponents = uuidComponents;
4770
- //normalize UUID
4771
- urnComponents.nss = (uuidComponents.uuid || "").toLowerCase();
4772
- return urnComponents;
4773
- }
4774
- };
4517
+ function unescapeComponent(str, options) {
4518
+ return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED, pctDecChars);
4519
+ }
4775
4520
 
4776
- SCHEMES[handler.scheme] = handler;
4777
- SCHEMES[handler$1.scheme] = handler$1;
4778
- SCHEMES[handler$2.scheme] = handler$2;
4779
- SCHEMES[handler$3.scheme] = handler$3;
4780
- SCHEMES[handler$4.scheme] = handler$4;
4781
- SCHEMES[handler$5.scheme] = handler$5;
4782
- SCHEMES[handler$6.scheme] = handler$6;
4783
-
4784
- exports.SCHEMES = SCHEMES;
4785
- exports.pctEncChar = pctEncChar;
4786
- exports.pctDecChars = pctDecChars;
4787
- exports.parse = parse;
4788
- exports.removeDotSegments = removeDotSegments;
4789
- exports.serialize = serialize;
4790
- exports.resolveComponents = resolveComponents;
4791
- exports.resolve = resolve;
4792
- exports.normalize = normalize;
4793
- exports.equal = equal;
4794
- exports.escapeComponent = escapeComponent;
4795
- exports.unescapeComponent = unescapeComponent;
4796
-
4797
- Object.defineProperty(exports, '__esModule', { value: true });
4798
-
4799
- })));
4800
-
4801
- }(uri_all, uri_all.exports));
4521
+ var handler = {
4522
+ scheme: "http",
4523
+ domainHost: true,
4524
+ parse: function parse(components, options) {
4525
+ //report missing host
4526
+ if (!components.host) {
4527
+ components.error = components.error || "HTTP URIs must have a host.";
4528
+ }
4529
+ return components;
4530
+ },
4531
+ serialize: function serialize(components, options) {
4532
+ var secure = String(components.scheme).toLowerCase() === "https";
4533
+ //normalize the default port
4534
+ if (components.port === (secure ? 443 : 80) || components.port === "") {
4535
+ components.port = undefined;
4536
+ }
4537
+ //normalize the empty path
4538
+ if (!components.path) {
4539
+ components.path = "/";
4540
+ }
4541
+ //NOTE: We do not parse query strings for HTTP URIs
4542
+ //as WWW Form Url Encoded query strings are part of the HTML4+ spec,
4543
+ //and not the HTTP spec.
4544
+ return components;
4545
+ }
4546
+ };
4547
+
4548
+ var handler$1 = {
4549
+ scheme: "https",
4550
+ domainHost: handler.domainHost,
4551
+ parse: handler.parse,
4552
+ serialize: handler.serialize
4553
+ };
4554
+
4555
+ function isSecure(wsComponents) {
4556
+ return typeof wsComponents.secure === 'boolean' ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === "wss";
4557
+ }
4558
+ //RFC 6455
4559
+ var handler$2 = {
4560
+ scheme: "ws",
4561
+ domainHost: true,
4562
+ parse: function parse(components, options) {
4563
+ var wsComponents = components;
4564
+ //indicate if the secure flag is set
4565
+ wsComponents.secure = isSecure(wsComponents);
4566
+ //construct resouce name
4567
+ wsComponents.resourceName = (wsComponents.path || '/') + (wsComponents.query ? '?' + wsComponents.query : '');
4568
+ wsComponents.path = undefined;
4569
+ wsComponents.query = undefined;
4570
+ return wsComponents;
4571
+ },
4572
+ serialize: function serialize(wsComponents, options) {
4573
+ //normalize the default port
4574
+ if (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === "") {
4575
+ wsComponents.port = undefined;
4576
+ }
4577
+ //ensure scheme matches secure flag
4578
+ if (typeof wsComponents.secure === 'boolean') {
4579
+ wsComponents.scheme = wsComponents.secure ? 'wss' : 'ws';
4580
+ wsComponents.secure = undefined;
4581
+ }
4582
+ //reconstruct path from resource name
4583
+ if (wsComponents.resourceName) {
4584
+ var _wsComponents$resourc = wsComponents.resourceName.split('?'),
4585
+ _wsComponents$resourc2 = slicedToArray(_wsComponents$resourc, 2),
4586
+ path = _wsComponents$resourc2[0],
4587
+ query = _wsComponents$resourc2[1];
4588
+
4589
+ wsComponents.path = path && path !== '/' ? path : undefined;
4590
+ wsComponents.query = query;
4591
+ wsComponents.resourceName = undefined;
4592
+ }
4593
+ //forbid fragment component
4594
+ wsComponents.fragment = undefined;
4595
+ return wsComponents;
4596
+ }
4597
+ };
4598
+
4599
+ var handler$3 = {
4600
+ scheme: "wss",
4601
+ domainHost: handler$2.domainHost,
4602
+ parse: handler$2.parse,
4603
+ serialize: handler$2.serialize
4604
+ };
4605
+
4606
+ var O = {};
4607
+ //RFC 3986
4608
+ var UNRESERVED$$ = "[A-Za-z0-9\\-\\.\\_\\~" + ("\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF" ) + "]";
4609
+ var HEXDIG$$ = "[0-9A-Fa-f]"; //case-insensitive
4610
+ var PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)); //expanded
4611
+ //RFC 5322, except these symbols as per RFC 6068: @ : / ? # [ ] & ; =
4612
+ //const ATEXT$$ = "[A-Za-z0-9\\!\\#\\$\\%\\&\\'\\*\\+\\-\\/\\=\\?\\^\\_\\`\\{\\|\\}\\~]";
4613
+ //const WSP$$ = "[\\x20\\x09]";
4614
+ //const OBS_QTEXT$$ = "[\\x01-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7F]"; //(%d1-8 / %d11-12 / %d14-31 / %d127)
4615
+ //const QTEXT$$ = merge("[\\x21\\x23-\\x5B\\x5D-\\x7E]", OBS_QTEXT$$); //%d33 / %d35-91 / %d93-126 / obs-qtext
4616
+ //const VCHAR$$ = "[\\x21-\\x7E]";
4617
+ //const WSP$$ = "[\\x20\\x09]";
4618
+ //const OBS_QP$ = subexp("\\\\" + merge("[\\x00\\x0D\\x0A]", OBS_QTEXT$$)); //%d0 / CR / LF / obs-qtext
4619
+ //const FWS$ = subexp(subexp(WSP$$ + "*" + "\\x0D\\x0A") + "?" + WSP$$ + "+");
4620
+ //const QUOTED_PAIR$ = subexp(subexp("\\\\" + subexp(VCHAR$$ + "|" + WSP$$)) + "|" + OBS_QP$);
4621
+ //const QUOTED_STRING$ = subexp('\\"' + subexp(FWS$ + "?" + QCONTENT$) + "*" + FWS$ + "?" + '\\"');
4622
+ var ATEXT$$ = "[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]";
4623
+ var QTEXT$$ = "[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]";
4624
+ var VCHAR$$ = merge(QTEXT$$, "[\\\"\\\\]");
4625
+ var SOME_DELIMS$$ = "[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]";
4626
+ var UNRESERVED = new RegExp(UNRESERVED$$, "g");
4627
+ var PCT_ENCODED = new RegExp(PCT_ENCODED$, "g");
4628
+ var NOT_LOCAL_PART = new RegExp(merge("[^]", ATEXT$$, "[\\.]", '[\\"]', VCHAR$$), "g");
4629
+ var NOT_HFNAME = new RegExp(merge("[^]", UNRESERVED$$, SOME_DELIMS$$), "g");
4630
+ var NOT_HFVALUE = NOT_HFNAME;
4631
+ function decodeUnreserved(str) {
4632
+ var decStr = pctDecChars(str);
4633
+ return !decStr.match(UNRESERVED) ? str : decStr;
4634
+ }
4635
+ var handler$4 = {
4636
+ scheme: "mailto",
4637
+ parse: function parse$$1(components, options) {
4638
+ var mailtoComponents = components;
4639
+ var to = mailtoComponents.to = mailtoComponents.path ? mailtoComponents.path.split(",") : [];
4640
+ mailtoComponents.path = undefined;
4641
+ if (mailtoComponents.query) {
4642
+ var unknownHeaders = false;
4643
+ var headers = {};
4644
+ var hfields = mailtoComponents.query.split("&");
4645
+ for (var x = 0, xl = hfields.length; x < xl; ++x) {
4646
+ var hfield = hfields[x].split("=");
4647
+ switch (hfield[0]) {
4648
+ case "to":
4649
+ var toAddrs = hfield[1].split(",");
4650
+ for (var _x = 0, _xl = toAddrs.length; _x < _xl; ++_x) {
4651
+ to.push(toAddrs[_x]);
4652
+ }
4653
+ break;
4654
+ case "subject":
4655
+ mailtoComponents.subject = unescapeComponent(hfield[1], options);
4656
+ break;
4657
+ case "body":
4658
+ mailtoComponents.body = unescapeComponent(hfield[1], options);
4659
+ break;
4660
+ default:
4661
+ unknownHeaders = true;
4662
+ headers[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options);
4663
+ break;
4664
+ }
4665
+ }
4666
+ if (unknownHeaders) mailtoComponents.headers = headers;
4667
+ }
4668
+ mailtoComponents.query = undefined;
4669
+ for (var _x2 = 0, _xl2 = to.length; _x2 < _xl2; ++_x2) {
4670
+ var addr = to[_x2].split("@");
4671
+ addr[0] = unescapeComponent(addr[0]);
4672
+ if (!options.unicodeSupport) {
4673
+ //convert Unicode IDN -> ASCII IDN
4674
+ try {
4675
+ addr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase());
4676
+ } catch (e) {
4677
+ mailtoComponents.error = mailtoComponents.error || "Email address's domain name can not be converted to ASCII via punycode: " + e;
4678
+ }
4679
+ } else {
4680
+ addr[1] = unescapeComponent(addr[1], options).toLowerCase();
4681
+ }
4682
+ to[_x2] = addr.join("@");
4683
+ }
4684
+ return mailtoComponents;
4685
+ },
4686
+ serialize: function serialize$$1(mailtoComponents, options) {
4687
+ var components = mailtoComponents;
4688
+ var to = toArray(mailtoComponents.to);
4689
+ if (to) {
4690
+ for (var x = 0, xl = to.length; x < xl; ++x) {
4691
+ var toAddr = String(to[x]);
4692
+ var atIdx = toAddr.lastIndexOf("@");
4693
+ var localPart = toAddr.slice(0, atIdx).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar);
4694
+ var domain = toAddr.slice(atIdx + 1);
4695
+ //convert IDN via punycode
4696
+ try {
4697
+ domain = !options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain);
4698
+ } catch (e) {
4699
+ components.error = components.error || "Email address's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e;
4700
+ }
4701
+ to[x] = localPart + "@" + domain;
4702
+ }
4703
+ components.path = to.join(",");
4704
+ }
4705
+ var headers = mailtoComponents.headers = mailtoComponents.headers || {};
4706
+ if (mailtoComponents.subject) headers["subject"] = mailtoComponents.subject;
4707
+ if (mailtoComponents.body) headers["body"] = mailtoComponents.body;
4708
+ var fields = [];
4709
+ for (var name in headers) {
4710
+ if (headers[name] !== O[name]) {
4711
+ 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));
4712
+ }
4713
+ }
4714
+ if (fields.length) {
4715
+ components.query = fields.join("&");
4716
+ }
4717
+ return components;
4718
+ }
4719
+ };
4720
+
4721
+ var URN_PARSE = /^([^\:]+)\:(.*)/;
4722
+ //RFC 2141
4723
+ var handler$5 = {
4724
+ scheme: "urn",
4725
+ parse: function parse$$1(components, options) {
4726
+ var matches = components.path && components.path.match(URN_PARSE);
4727
+ var urnComponents = components;
4728
+ if (matches) {
4729
+ var scheme = options.scheme || urnComponents.scheme || "urn";
4730
+ var nid = matches[1].toLowerCase();
4731
+ var nss = matches[2];
4732
+ var urnScheme = scheme + ":" + (options.nid || nid);
4733
+ var schemeHandler = SCHEMES[urnScheme];
4734
+ urnComponents.nid = nid;
4735
+ urnComponents.nss = nss;
4736
+ urnComponents.path = undefined;
4737
+ if (schemeHandler) {
4738
+ urnComponents = schemeHandler.parse(urnComponents, options);
4739
+ }
4740
+ } else {
4741
+ urnComponents.error = urnComponents.error || "URN can not be parsed.";
4742
+ }
4743
+ return urnComponents;
4744
+ },
4745
+ serialize: function serialize$$1(urnComponents, options) {
4746
+ var scheme = options.scheme || urnComponents.scheme || "urn";
4747
+ var nid = urnComponents.nid;
4748
+ var urnScheme = scheme + ":" + (options.nid || nid);
4749
+ var schemeHandler = SCHEMES[urnScheme];
4750
+ if (schemeHandler) {
4751
+ urnComponents = schemeHandler.serialize(urnComponents, options);
4752
+ }
4753
+ var uriComponents = urnComponents;
4754
+ var nss = urnComponents.nss;
4755
+ uriComponents.path = (nid || options.nid) + ":" + nss;
4756
+ return uriComponents;
4757
+ }
4758
+ };
4759
+
4760
+ var UUID = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/;
4761
+ //RFC 4122
4762
+ var handler$6 = {
4763
+ scheme: "urn:uuid",
4764
+ parse: function parse(urnComponents, options) {
4765
+ var uuidComponents = urnComponents;
4766
+ uuidComponents.uuid = uuidComponents.nss;
4767
+ uuidComponents.nss = undefined;
4768
+ if (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) {
4769
+ uuidComponents.error = uuidComponents.error || "UUID is not valid.";
4770
+ }
4771
+ return uuidComponents;
4772
+ },
4773
+ serialize: function serialize(uuidComponents, options) {
4774
+ var urnComponents = uuidComponents;
4775
+ //normalize UUID
4776
+ urnComponents.nss = (uuidComponents.uuid || "").toLowerCase();
4777
+ return urnComponents;
4778
+ }
4779
+ };
4780
+
4781
+ SCHEMES[handler.scheme] = handler;
4782
+ SCHEMES[handler$1.scheme] = handler$1;
4783
+ SCHEMES[handler$2.scheme] = handler$2;
4784
+ SCHEMES[handler$3.scheme] = handler$3;
4785
+ SCHEMES[handler$4.scheme] = handler$4;
4786
+ SCHEMES[handler$5.scheme] = handler$5;
4787
+ SCHEMES[handler$6.scheme] = handler$6;
4788
+
4789
+ exports.SCHEMES = SCHEMES;
4790
+ exports.pctEncChar = pctEncChar;
4791
+ exports.pctDecChars = pctDecChars;
4792
+ exports.parse = parse;
4793
+ exports.removeDotSegments = removeDotSegments;
4794
+ exports.serialize = serialize;
4795
+ exports.resolveComponents = resolveComponents;
4796
+ exports.resolve = resolve;
4797
+ exports.normalize = normalize;
4798
+ exports.equal = equal;
4799
+ exports.escapeComponent = escapeComponent;
4800
+ exports.unescapeComponent = unescapeComponent;
4801
+
4802
+ Object.defineProperty(exports, '__esModule', { value: true });
4803
+
4804
+ })));
4805
+
4806
+ } (uri_all, uri_all.exports));
4807
+
4808
+ var uri_allExports = uri_all.exports;
4802
4809
 
4803
4810
  // do not edit .js files directly - edit src/index.jst
4804
4811
 
@@ -5199,11 +5206,13 @@ function escapeJsonPtr(str) {
5199
5206
  return str.replace(/~/g, '~0').replace(/\//g, '~1');
5200
5207
  }
5201
5208
 
5202
- var URI$1 = uri_all.exports
5209
+ var jsonSchemaTraverseExports = jsonSchemaTraverse.exports;
5210
+
5211
+ var URI$1 = uri_allExports
5203
5212
  , equal$1 = fastDeepEqual
5204
5213
  , util$3 = util$5
5205
5214
  , SchemaObject$1 = schema_obj
5206
- , traverse = jsonSchemaTraverse.exports;
5215
+ , traverse = jsonSchemaTraverseExports;
5207
5216
 
5208
5217
  var resolve_1 = resolve$3;
5209
5218
 
@@ -6453,6 +6462,8 @@ Cache$1.prototype.clear = function Cache_clear() {
6453
6462
  this._cache = {};
6454
6463
  };
6455
6464
 
6465
+ var cacheExports = cache.exports;
6466
+
6456
6467
  var util$1 = util$5;
6457
6468
 
6458
6469
  var DATE = /^(\d\d\d\d)-(\d\d)-(\d\d)$/;
@@ -10019,7 +10030,7 @@ var require$$12 = {
10019
10030
 
10020
10031
  var compileSchema = compile_1
10021
10032
  , resolve = resolve_1
10022
- , Cache = cache.exports
10033
+ , Cache = cacheExports
10023
10034
  , SchemaObject = schema_obj
10024
10035
  , stableStringify = fastJsonStableStringify
10025
10036
  , formats = formats_1
@@ -10522,9 +10533,11 @@ function setLogger(self) {
10522
10533
 
10523
10534
  function noop() {}
10524
10535
 
10536
+ var ajv$1 = /*@__PURE__*/getDefaultExportFromCjs(ajv);
10537
+
10525
10538
  var _Ajv = /*#__PURE__*/_mergeNamespaces({
10526
10539
  __proto__: null,
10527
- 'default': ajv
10540
+ default: ajv$1
10528
10541
  }, [ajv]);
10529
10542
 
10530
10543
  var $ref = "#/definitions/Schema";
@@ -12107,11 +12120,11 @@ var _ddl2Schema = /*#__PURE__*/Object.freeze({
12107
12120
  __proto__: null,
12108
12121
  $ref: $ref,
12109
12122
  $schema: $schema,
12110
- definitions: definitions,
12111
- 'default': v2
12123
+ default: v2,
12124
+ definitions: definitions
12112
12125
  });
12113
12126
 
12114
- var Ajv = ajv || _Ajv;
12127
+ var Ajv = ajv$1 || _Ajv;
12115
12128
  var ddl2Schema = _ddl2Schema;
12116
12129
  var options = {
12117
12130
  allErrors: false,