@scenid/react-formulator 2.1.0 → 2.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -11,8 +11,6 @@ var styles = require('@mui/styles');
11
11
  var iconsMaterial = require('@mui/icons-material');
12
12
  var Autocomplete = require('@mui/material/Autocomplete');
13
13
  var path$3 = require('path');
14
- var proc = require('process');
15
- var url = require('url');
16
14
  var styles$1 = require('@mui/material/styles');
17
15
 
18
16
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
@@ -23,7 +21,6 @@ var makeStyles__default = /*#__PURE__*/_interopDefaultLegacy(makeStyles);
23
21
  var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
24
22
  var Autocomplete__default = /*#__PURE__*/_interopDefaultLegacy(Autocomplete);
25
23
  var path__default = /*#__PURE__*/_interopDefaultLegacy(path$3);
26
- var proc__default = /*#__PURE__*/_interopDefaultLegacy(proc);
27
24
 
28
25
  function _classCallCheck(instance, Constructor) {
29
26
  if (!(instance instanceof Constructor)) {
@@ -1530,9 +1527,9 @@ var engineUserAgent = getBuiltIn$K('navigator', 'userAgent') || '';
1530
1527
  var global$Y = global$_;
1531
1528
  var userAgent$7 = engineUserAgent;
1532
1529
 
1533
- var process$5 = global$Y.process;
1530
+ var process$6 = global$Y.process;
1534
1531
  var Deno$1 = global$Y.Deno;
1535
- var versions = process$5 && process$5.versions || Deno$1 && Deno$1.version;
1532
+ var versions = process$6 && process$6.versions || Deno$1 && Deno$1.version;
1536
1533
  var v8 = versions && versions.v8;
1537
1534
  var match$1, version$1;
1538
1535
 
@@ -1688,13 +1685,13 @@ var toObject$B = function (argument) {
1688
1685
  var uncurryThis$1p = functionUncurryThis;
1689
1686
  var toObject$A = toObject$B;
1690
1687
 
1691
- var hasOwnProperty$2 = uncurryThis$1p({}.hasOwnProperty);
1688
+ var hasOwnProperty$3 = uncurryThis$1p({}.hasOwnProperty);
1692
1689
 
1693
1690
  // `HasOwnProperty` abstract operation
1694
1691
  // https://tc39.es/ecma262/#sec-hasownproperty
1695
1692
  // eslint-disable-next-line es-x/no-object-hasown -- safe
1696
1693
  var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
1697
- return hasOwnProperty$2(toObject$A(it), key);
1694
+ return hasOwnProperty$3(toObject$A(it), key);
1698
1695
  };
1699
1696
 
1700
1697
  var uncurryThis$1o = functionUncurryThis;
@@ -8269,7 +8266,7 @@ var IS_NODE$5 = engineIsNode;
8269
8266
 
8270
8267
  var set$1 = global$A.setImmediate;
8271
8268
  var clear = global$A.clearImmediate;
8272
- var process$4 = global$A.process;
8269
+ var process$5 = global$A.process;
8273
8270
  var Dispatch = global$A.Dispatch;
8274
8271
  var Function$2 = global$A.Function;
8275
8272
  var MessageChannel = global$A.MessageChannel;
@@ -8325,7 +8322,7 @@ if (!set$1 || !clear) {
8325
8322
  // Node.js 0.8-
8326
8323
  if (IS_NODE$5) {
8327
8324
  defer = function (id) {
8328
- process$4.nextTick(runner(id));
8325
+ process$5.nextTick(runner(id));
8329
8326
  };
8330
8327
  // Sphere (JS game engine) Dispatch API
8331
8328
  } else if (Dispatch && Dispatch.now) {
@@ -8391,7 +8388,7 @@ var IS_NODE$4 = engineIsNode;
8391
8388
 
8392
8389
  var MutationObserver = global$y.MutationObserver || global$y.WebKitMutationObserver;
8393
8390
  var document$4 = global$y.document;
8394
- var process$3 = global$y.process;
8391
+ var process$4 = global$y.process;
8395
8392
  var Promise$4 = global$y.Promise;
8396
8393
  // Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`
8397
8394
  var queueMicrotaskDescriptor = getOwnPropertyDescriptor$5(global$y, 'queueMicrotask');
@@ -8403,7 +8400,7 @@ var flush, head, last, notify$1, toggle, node, promise, then;
8403
8400
  if (!queueMicrotask) {
8404
8401
  flush = function () {
8405
8402
  var parent, fn;
8406
- if (IS_NODE$4 && (parent = process$3.domain)) parent.exit();
8403
+ if (IS_NODE$4 && (parent = process$4.domain)) parent.exit();
8407
8404
  while (head) {
8408
8405
  fn = head.fn;
8409
8406
  head = head.next;
@@ -8440,7 +8437,7 @@ if (!queueMicrotask) {
8440
8437
  // Node.js without promises
8441
8438
  } else if (IS_NODE$4) {
8442
8439
  notify$1 = function () {
8443
- process$3.nextTick(flush);
8440
+ process$4.nextTick(flush);
8444
8441
  };
8445
8442
  // for other environments - macrotask based on:
8446
8443
  // - setImmediate
@@ -8612,7 +8609,7 @@ var PromiseConstructor = NativePromiseConstructor$3;
8612
8609
  var PromisePrototype = NativePromisePrototype$2;
8613
8610
  var TypeError$4 = global$u.TypeError;
8614
8611
  var document$3 = global$u.document;
8615
- var process$2 = global$u.process;
8612
+ var process$3 = global$u.process;
8616
8613
  var newPromiseCapability$1 = newPromiseCapabilityModule$6.f;
8617
8614
  var newGenericPromiseCapability = newPromiseCapability$1;
8618
8615
 
@@ -8704,7 +8701,7 @@ var onUnhandled = function (state) {
8704
8701
  if (IS_UNHANDLED) {
8705
8702
  result = perform$5(function () {
8706
8703
  if (IS_NODE$3) {
8707
- process$2.emit('unhandledRejection', value, promise);
8704
+ process$3.emit('unhandledRejection', value, promise);
8708
8705
  } else dispatchEvent(UNHANDLED_REJECTION, promise, value);
8709
8706
  });
8710
8707
  // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
@@ -8722,7 +8719,7 @@ var onHandleUnhandled = function (state) {
8722
8719
  call$T(task, global$u, function () {
8723
8720
  var promise = state.facade;
8724
8721
  if (IS_NODE$3) {
8725
- process$2.emit('rejectionHandled', promise);
8722
+ process$3.emit('rejectionHandled', promise);
8726
8723
  } else dispatchEvent(REJECTION_HANDLED, promise, state.value);
8727
8724
  });
8728
8725
  };
@@ -8810,7 +8807,7 @@ if (FORCED_PROMISE_CONSTRUCTOR$4) {
8810
8807
  state.parent = true;
8811
8808
  reaction.ok = isCallable$f(onFulfilled) ? onFulfilled : true;
8812
8809
  reaction.fail = isCallable$f(onRejected) && onRejected;
8813
- reaction.domain = IS_NODE$3 ? process$2.domain : undefined;
8810
+ reaction.domain = IS_NODE$3 ? process$3.domain : undefined;
8814
8811
  if (state.state == PENDING) state.reactions.add(reaction);
8815
8812
  else microtask$1(function () {
8816
8813
  callReaction(reaction, state);
@@ -17082,7 +17079,7 @@ var aCallable = aCallable$Y;
17082
17079
  var validateArgumentsLength$4 = validateArgumentsLength$8;
17083
17080
  var IS_NODE$1 = engineIsNode;
17084
17081
 
17085
- var process$1 = global$7.process;
17082
+ var process$2 = global$7.process;
17086
17083
 
17087
17084
  // `queueMicrotask` method
17088
17085
  // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-queuemicrotask
@@ -17090,7 +17087,7 @@ $$6({ global: true, enumerable: true, dontCallGetSet: true }, {
17090
17087
  queueMicrotask: function queueMicrotask(fn) {
17091
17088
  validateArgumentsLength$4(arguments.length, 1);
17092
17089
  aCallable(fn);
17093
- var domain = IS_NODE$1 && process$1.domain;
17090
+ var domain = IS_NODE$1 && process$2.domain;
17094
17091
  microtask(domain ? domain.bind(fn) : fn);
17095
17092
  }
17096
17093
  });
@@ -17757,7 +17754,7 @@ var adapt = function (delta, numPoints, firstTime) {
17757
17754
  * Converts a string of Unicode symbols (e.g. a domain name label) to a
17758
17755
  * Punycode string of ASCII-only symbols.
17759
17756
  */
17760
- var encode$2 = function (input) {
17757
+ var encode$3 = function (input) {
17761
17758
  var output = [];
17762
17759
 
17763
17760
  // Convert the input in UCS-2 to an array of Unicode code points.
@@ -17846,7 +17843,7 @@ var stringPunycodeToAscii = function (input) {
17846
17843
  var i, label;
17847
17844
  for (i = 0; i < labels.length; i++) {
17848
17845
  label = labels[i];
17849
- push$3(encoded, exec$1(regexNonASCII, label) ? 'xn--' + encode$2(label) : label);
17846
+ push$3(encoded, exec$1(regexNonASCII, label) ? 'xn--' + encode$3(label) : label);
17850
17847
  }
17851
17848
  return join$2(encoded, '.');
17852
17849
  };
@@ -17903,7 +17900,7 @@ var RequestPrototype = NativeRequest && NativeRequest.prototype;
17903
17900
  var HeadersPrototype = Headers && Headers.prototype;
17904
17901
  var RegExp$1 = global$2.RegExp;
17905
17902
  var TypeError$2 = global$2.TypeError;
17906
- var decodeURIComponent = global$2.decodeURIComponent;
17903
+ var decodeURIComponent$1 = global$2.decodeURIComponent;
17907
17904
  var encodeURIComponent$1 = global$2.encodeURIComponent;
17908
17905
  var charAt$1 = uncurryThis$1(''.charAt);
17909
17906
  var join$1 = uncurryThis$1([].join);
@@ -17923,7 +17920,7 @@ var percentSequence = function (bytes) {
17923
17920
 
17924
17921
  var percentDecode = function (sequence) {
17925
17922
  try {
17926
- return decodeURIComponent(sequence);
17923
+ return decodeURIComponent$1(sequence);
17927
17924
  } catch (error) {
17928
17925
  return sequence;
17929
17926
  }
@@ -17933,7 +17930,7 @@ var deserialize = function (it) {
17933
17930
  var result = replace$2(it, plus, ' ');
17934
17931
  var bytes = 4;
17935
17932
  try {
17936
- return decodeURIComponent(result);
17933
+ return decodeURIComponent$1(result);
17937
17934
  } catch (error) {
17938
17935
  while (bytes) {
17939
17936
  result = replace$2(result, percentSequence(bytes--), percentDecode);
@@ -29841,6 +29838,7 @@ FormText.propTypes = {
29841
29838
  onChange: PropTypes__default["default"].func
29842
29839
  };
29843
29840
 
29841
+ // eslint-disable-next-line import/prefer-default-export
29844
29842
  var castToNumber = function castToNumber(value, step) {
29845
29843
  if (value === undefined || Number.isNaN(value) || value === '') {
29846
29844
  return '';
@@ -29877,7 +29875,8 @@ var FormNumber = function FormNumber(_ref) {
29877
29875
  value: castToNumber(e.target.value, step)
29878
29876
  }
29879
29877
  });
29880
- }
29878
+ } // eslint-disable-next-line react/jsx-props-no-spreading
29879
+
29881
29880
  }, props));
29882
29881
  };
29883
29882
 
@@ -30200,7 +30199,7 @@ function pick(obj, keys) {
30200
30199
  }, {});
30201
30200
  }
30202
30201
 
30203
- function hasOwnProperty$1(obj, prop) {
30202
+ function hasOwnProperty$2(obj, prop) {
30204
30203
  return Object.prototype.hasOwnProperty.call(obj, prop);
30205
30204
  }
30206
30205
 
@@ -30368,7 +30367,7 @@ function asNumber(value) {
30368
30367
  function normalizeObject(obj, normalizer) {
30369
30368
  const normalized = {};
30370
30369
  for (const u in obj) {
30371
- if (hasOwnProperty$1(obj, u)) {
30370
+ if (hasOwnProperty$2(obj, u)) {
30372
30371
  const v = obj[u];
30373
30372
  if (v === undefined || v === null) continue;
30374
30373
  normalized[normalizer(u)] = asNumber(v);
@@ -32937,7 +32936,7 @@ class Duration {
32937
32936
  result = {};
32938
32937
 
32939
32938
  for (const k of orderedUnits$1) {
32940
- if (hasOwnProperty$1(dur.values, k) || hasOwnProperty$1(this.values, k)) {
32939
+ if (hasOwnProperty$2(dur.values, k) || hasOwnProperty$2(this.values, k)) {
32941
32940
  result[k] = dur.get(k) + this.get(k);
32942
32941
  }
32943
32942
  }
@@ -34422,7 +34421,7 @@ function match(input, regex, handlers) {
34422
34421
  const all = {};
34423
34422
  let matchIndex = 1;
34424
34423
  for (const i in handlers) {
34425
- if (hasOwnProperty$1(handlers, i)) {
34424
+ if (hasOwnProperty$2(handlers, i)) {
34426
34425
  const h = handlers[i],
34427
34426
  groups = h.groups ? h.groups + 1 : 1;
34428
34427
  if (!h.literal && h.token) {
@@ -34572,7 +34571,7 @@ function explainFromTokens(locale, input, format) {
34572
34571
  [result, zone, specificOffset] = matches
34573
34572
  ? dateTimeFromMatches(matches)
34574
34573
  : [null, null, undefined];
34575
- if (hasOwnProperty$1(matches, "a") && hasOwnProperty$1(matches, "H")) {
34574
+ if (hasOwnProperty$2(matches, "a") && hasOwnProperty$2(matches, "H")) {
34576
34575
  throw new ConflictingSpecificationError(
34577
34576
  "Can't include meridiem when specifying 24-hour format"
34578
34577
  );
@@ -37959,6 +37958,1369 @@ VFileMessage$1.prototype.source = null;
37959
37958
  VFileMessage$1.prototype.ruleId = null;
37960
37959
  VFileMessage$1.prototype.position = null;
37961
37960
 
37961
+ // for now just expose the builtin process global from node.js
37962
+ var process$1 = commonjsGlobal.process;
37963
+
37964
+ var url = {};
37965
+
37966
+ var punycode$1 = {exports: {}};
37967
+
37968
+ /*! https://mths.be/punycode v1.3.2 by @mathias */
37969
+
37970
+ (function (module, exports) {
37971
+ (function(root) {
37972
+
37973
+ /** Detect free variables */
37974
+ var freeExports = exports &&
37975
+ !exports.nodeType && exports;
37976
+ var freeModule = module &&
37977
+ !module.nodeType && module;
37978
+ var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal;
37979
+ if (
37980
+ freeGlobal.global === freeGlobal ||
37981
+ freeGlobal.window === freeGlobal ||
37982
+ freeGlobal.self === freeGlobal
37983
+ ) {
37984
+ root = freeGlobal;
37985
+ }
37986
+
37987
+ /**
37988
+ * The `punycode` object.
37989
+ * @name punycode
37990
+ * @type Object
37991
+ */
37992
+ var punycode,
37993
+
37994
+ /** Highest positive signed 32-bit float value */
37995
+ maxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1
37996
+
37997
+ /** Bootstring parameters */
37998
+ base = 36,
37999
+ tMin = 1,
38000
+ tMax = 26,
38001
+ skew = 38,
38002
+ damp = 700,
38003
+ initialBias = 72,
38004
+ initialN = 128, // 0x80
38005
+ delimiter = '-', // '\x2D'
38006
+
38007
+ /** Regular expressions */
38008
+ regexPunycode = /^xn--/,
38009
+ regexNonASCII = /[^\x20-\x7E]/, // unprintable ASCII chars + non-ASCII chars
38010
+ regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, // RFC 3490 separators
38011
+
38012
+ /** Error messages */
38013
+ errors = {
38014
+ 'overflow': 'Overflow: input needs wider integers to process',
38015
+ 'not-basic': 'Illegal input >= 0x80 (not a basic code point)',
38016
+ 'invalid-input': 'Invalid input'
38017
+ },
38018
+
38019
+ /** Convenience shortcuts */
38020
+ baseMinusTMin = base - tMin,
38021
+ floor = Math.floor,
38022
+ stringFromCharCode = String.fromCharCode,
38023
+
38024
+ /** Temporary variable */
38025
+ key;
38026
+
38027
+ /*--------------------------------------------------------------------------*/
38028
+
38029
+ /**
38030
+ * A generic error utility function.
38031
+ * @private
38032
+ * @param {String} type The error type.
38033
+ * @returns {Error} Throws a `RangeError` with the applicable error message.
38034
+ */
38035
+ function error(type) {
38036
+ throw RangeError(errors[type]);
38037
+ }
38038
+
38039
+ /**
38040
+ * A generic `Array#map` utility function.
38041
+ * @private
38042
+ * @param {Array} array The array to iterate over.
38043
+ * @param {Function} callback The function that gets called for every array
38044
+ * item.
38045
+ * @returns {Array} A new array of values returned by the callback function.
38046
+ */
38047
+ function map(array, fn) {
38048
+ var length = array.length;
38049
+ var result = [];
38050
+ while (length--) {
38051
+ result[length] = fn(array[length]);
38052
+ }
38053
+ return result;
38054
+ }
38055
+
38056
+ /**
38057
+ * A simple `Array#map`-like wrapper to work with domain name strings or email
38058
+ * addresses.
38059
+ * @private
38060
+ * @param {String} domain The domain name or email address.
38061
+ * @param {Function} callback The function that gets called for every
38062
+ * character.
38063
+ * @returns {Array} A new string of characters returned by the callback
38064
+ * function.
38065
+ */
38066
+ function mapDomain(string, fn) {
38067
+ var parts = string.split('@');
38068
+ var result = '';
38069
+ if (parts.length > 1) {
38070
+ // In email addresses, only the domain name should be punycoded. Leave
38071
+ // the local part (i.e. everything up to `@`) intact.
38072
+ result = parts[0] + '@';
38073
+ string = parts[1];
38074
+ }
38075
+ // Avoid `split(regex)` for IE8 compatibility. See #17.
38076
+ string = string.replace(regexSeparators, '\x2E');
38077
+ var labels = string.split('.');
38078
+ var encoded = map(labels, fn).join('.');
38079
+ return result + encoded;
38080
+ }
38081
+
38082
+ /**
38083
+ * Creates an array containing the numeric code points of each Unicode
38084
+ * character in the string. While JavaScript uses UCS-2 internally,
38085
+ * this function will convert a pair of surrogate halves (each of which
38086
+ * UCS-2 exposes as separate characters) into a single code point,
38087
+ * matching UTF-16.
38088
+ * @see `punycode.ucs2.encode`
38089
+ * @see <https://mathiasbynens.be/notes/javascript-encoding>
38090
+ * @memberOf punycode.ucs2
38091
+ * @name decode
38092
+ * @param {String} string The Unicode input string (UCS-2).
38093
+ * @returns {Array} The new array of code points.
38094
+ */
38095
+ function ucs2decode(string) {
38096
+ var output = [],
38097
+ counter = 0,
38098
+ length = string.length,
38099
+ value,
38100
+ extra;
38101
+ while (counter < length) {
38102
+ value = string.charCodeAt(counter++);
38103
+ if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
38104
+ // high surrogate, and there is a next character
38105
+ extra = string.charCodeAt(counter++);
38106
+ if ((extra & 0xFC00) == 0xDC00) { // low surrogate
38107
+ output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
38108
+ } else {
38109
+ // unmatched surrogate; only append this code unit, in case the next
38110
+ // code unit is the high surrogate of a surrogate pair
38111
+ output.push(value);
38112
+ counter--;
38113
+ }
38114
+ } else {
38115
+ output.push(value);
38116
+ }
38117
+ }
38118
+ return output;
38119
+ }
38120
+
38121
+ /**
38122
+ * Creates a string based on an array of numeric code points.
38123
+ * @see `punycode.ucs2.decode`
38124
+ * @memberOf punycode.ucs2
38125
+ * @name encode
38126
+ * @param {Array} codePoints The array of numeric code points.
38127
+ * @returns {String} The new Unicode string (UCS-2).
38128
+ */
38129
+ function ucs2encode(array) {
38130
+ return map(array, function(value) {
38131
+ var output = '';
38132
+ if (value > 0xFFFF) {
38133
+ value -= 0x10000;
38134
+ output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);
38135
+ value = 0xDC00 | value & 0x3FF;
38136
+ }
38137
+ output += stringFromCharCode(value);
38138
+ return output;
38139
+ }).join('');
38140
+ }
38141
+
38142
+ /**
38143
+ * Converts a basic code point into a digit/integer.
38144
+ * @see `digitToBasic()`
38145
+ * @private
38146
+ * @param {Number} codePoint The basic numeric code point value.
38147
+ * @returns {Number} The numeric value of a basic code point (for use in
38148
+ * representing integers) in the range `0` to `base - 1`, or `base` if
38149
+ * the code point does not represent a value.
38150
+ */
38151
+ function basicToDigit(codePoint) {
38152
+ if (codePoint - 48 < 10) {
38153
+ return codePoint - 22;
38154
+ }
38155
+ if (codePoint - 65 < 26) {
38156
+ return codePoint - 65;
38157
+ }
38158
+ if (codePoint - 97 < 26) {
38159
+ return codePoint - 97;
38160
+ }
38161
+ return base;
38162
+ }
38163
+
38164
+ /**
38165
+ * Converts a digit/integer into a basic code point.
38166
+ * @see `basicToDigit()`
38167
+ * @private
38168
+ * @param {Number} digit The numeric value of a basic code point.
38169
+ * @returns {Number} The basic code point whose value (when used for
38170
+ * representing integers) is `digit`, which needs to be in the range
38171
+ * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is
38172
+ * used; else, the lowercase form is used. The behavior is undefined
38173
+ * if `flag` is non-zero and `digit` has no uppercase form.
38174
+ */
38175
+ function digitToBasic(digit, flag) {
38176
+ // 0..25 map to ASCII a..z or A..Z
38177
+ // 26..35 map to ASCII 0..9
38178
+ return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
38179
+ }
38180
+
38181
+ /**
38182
+ * Bias adaptation function as per section 3.4 of RFC 3492.
38183
+ * http://tools.ietf.org/html/rfc3492#section-3.4
38184
+ * @private
38185
+ */
38186
+ function adapt(delta, numPoints, firstTime) {
38187
+ var k = 0;
38188
+ delta = firstTime ? floor(delta / damp) : delta >> 1;
38189
+ delta += floor(delta / numPoints);
38190
+ for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {
38191
+ delta = floor(delta / baseMinusTMin);
38192
+ }
38193
+ return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
38194
+ }
38195
+
38196
+ /**
38197
+ * Converts a Punycode string of ASCII-only symbols to a string of Unicode
38198
+ * symbols.
38199
+ * @memberOf punycode
38200
+ * @param {String} input The Punycode string of ASCII-only symbols.
38201
+ * @returns {String} The resulting string of Unicode symbols.
38202
+ */
38203
+ function decode(input) {
38204
+ // Don't use UCS-2
38205
+ var output = [],
38206
+ inputLength = input.length,
38207
+ out,
38208
+ i = 0,
38209
+ n = initialN,
38210
+ bias = initialBias,
38211
+ basic,
38212
+ j,
38213
+ index,
38214
+ oldi,
38215
+ w,
38216
+ k,
38217
+ digit,
38218
+ t,
38219
+ /** Cached calculation results */
38220
+ baseMinusT;
38221
+
38222
+ // Handle the basic code points: let `basic` be the number of input code
38223
+ // points before the last delimiter, or `0` if there is none, then copy
38224
+ // the first basic code points to the output.
38225
+
38226
+ basic = input.lastIndexOf(delimiter);
38227
+ if (basic < 0) {
38228
+ basic = 0;
38229
+ }
38230
+
38231
+ for (j = 0; j < basic; ++j) {
38232
+ // if it's not a basic code point
38233
+ if (input.charCodeAt(j) >= 0x80) {
38234
+ error('not-basic');
38235
+ }
38236
+ output.push(input.charCodeAt(j));
38237
+ }
38238
+
38239
+ // Main decoding loop: start just after the last delimiter if any basic code
38240
+ // points were copied; start at the beginning otherwise.
38241
+
38242
+ for (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {
38243
+
38244
+ // `index` is the index of the next character to be consumed.
38245
+ // Decode a generalized variable-length integer into `delta`,
38246
+ // which gets added to `i`. The overflow checking is easier
38247
+ // if we increase `i` as we go, then subtract off its starting
38248
+ // value at the end to obtain `delta`.
38249
+ for (oldi = i, w = 1, k = base; /* no condition */; k += base) {
38250
+
38251
+ if (index >= inputLength) {
38252
+ error('invalid-input');
38253
+ }
38254
+
38255
+ digit = basicToDigit(input.charCodeAt(index++));
38256
+
38257
+ if (digit >= base || digit > floor((maxInt - i) / w)) {
38258
+ error('overflow');
38259
+ }
38260
+
38261
+ i += digit * w;
38262
+ t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
38263
+
38264
+ if (digit < t) {
38265
+ break;
38266
+ }
38267
+
38268
+ baseMinusT = base - t;
38269
+ if (w > floor(maxInt / baseMinusT)) {
38270
+ error('overflow');
38271
+ }
38272
+
38273
+ w *= baseMinusT;
38274
+
38275
+ }
38276
+
38277
+ out = output.length + 1;
38278
+ bias = adapt(i - oldi, out, oldi == 0);
38279
+
38280
+ // `i` was supposed to wrap around from `out` to `0`,
38281
+ // incrementing `n` each time, so we'll fix that now:
38282
+ if (floor(i / out) > maxInt - n) {
38283
+ error('overflow');
38284
+ }
38285
+
38286
+ n += floor(i / out);
38287
+ i %= out;
38288
+
38289
+ // Insert `n` at position `i` of the output
38290
+ output.splice(i++, 0, n);
38291
+
38292
+ }
38293
+
38294
+ return ucs2encode(output);
38295
+ }
38296
+
38297
+ /**
38298
+ * Converts a string of Unicode symbols (e.g. a domain name label) to a
38299
+ * Punycode string of ASCII-only symbols.
38300
+ * @memberOf punycode
38301
+ * @param {String} input The string of Unicode symbols.
38302
+ * @returns {String} The resulting Punycode string of ASCII-only symbols.
38303
+ */
38304
+ function encode(input) {
38305
+ var n,
38306
+ delta,
38307
+ handledCPCount,
38308
+ basicLength,
38309
+ bias,
38310
+ j,
38311
+ m,
38312
+ q,
38313
+ k,
38314
+ t,
38315
+ currentValue,
38316
+ output = [],
38317
+ /** `inputLength` will hold the number of code points in `input`. */
38318
+ inputLength,
38319
+ /** Cached calculation results */
38320
+ handledCPCountPlusOne,
38321
+ baseMinusT,
38322
+ qMinusT;
38323
+
38324
+ // Convert the input in UCS-2 to Unicode
38325
+ input = ucs2decode(input);
38326
+
38327
+ // Cache the length
38328
+ inputLength = input.length;
38329
+
38330
+ // Initialize the state
38331
+ n = initialN;
38332
+ delta = 0;
38333
+ bias = initialBias;
38334
+
38335
+ // Handle the basic code points
38336
+ for (j = 0; j < inputLength; ++j) {
38337
+ currentValue = input[j];
38338
+ if (currentValue < 0x80) {
38339
+ output.push(stringFromCharCode(currentValue));
38340
+ }
38341
+ }
38342
+
38343
+ handledCPCount = basicLength = output.length;
38344
+
38345
+ // `handledCPCount` is the number of code points that have been handled;
38346
+ // `basicLength` is the number of basic code points.
38347
+
38348
+ // Finish the basic string - if it is not empty - with a delimiter
38349
+ if (basicLength) {
38350
+ output.push(delimiter);
38351
+ }
38352
+
38353
+ // Main encoding loop:
38354
+ while (handledCPCount < inputLength) {
38355
+
38356
+ // All non-basic code points < n have been handled already. Find the next
38357
+ // larger one:
38358
+ for (m = maxInt, j = 0; j < inputLength; ++j) {
38359
+ currentValue = input[j];
38360
+ if (currentValue >= n && currentValue < m) {
38361
+ m = currentValue;
38362
+ }
38363
+ }
38364
+
38365
+ // Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,
38366
+ // but guard against overflow
38367
+ handledCPCountPlusOne = handledCPCount + 1;
38368
+ if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
38369
+ error('overflow');
38370
+ }
38371
+
38372
+ delta += (m - n) * handledCPCountPlusOne;
38373
+ n = m;
38374
+
38375
+ for (j = 0; j < inputLength; ++j) {
38376
+ currentValue = input[j];
38377
+
38378
+ if (currentValue < n && ++delta > maxInt) {
38379
+ error('overflow');
38380
+ }
38381
+
38382
+ if (currentValue == n) {
38383
+ // Represent delta as a generalized variable-length integer
38384
+ for (q = delta, k = base; /* no condition */; k += base) {
38385
+ t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
38386
+ if (q < t) {
38387
+ break;
38388
+ }
38389
+ qMinusT = q - t;
38390
+ baseMinusT = base - t;
38391
+ output.push(
38392
+ stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))
38393
+ );
38394
+ q = floor(qMinusT / baseMinusT);
38395
+ }
38396
+
38397
+ output.push(stringFromCharCode(digitToBasic(q, 0)));
38398
+ bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
38399
+ delta = 0;
38400
+ ++handledCPCount;
38401
+ }
38402
+ }
38403
+
38404
+ ++delta;
38405
+ ++n;
38406
+
38407
+ }
38408
+ return output.join('');
38409
+ }
38410
+
38411
+ /**
38412
+ * Converts a Punycode string representing a domain name or an email address
38413
+ * to Unicode. Only the Punycoded parts of the input will be converted, i.e.
38414
+ * it doesn't matter if you call it on a string that has already been
38415
+ * converted to Unicode.
38416
+ * @memberOf punycode
38417
+ * @param {String} input The Punycoded domain name or email address to
38418
+ * convert to Unicode.
38419
+ * @returns {String} The Unicode representation of the given Punycode
38420
+ * string.
38421
+ */
38422
+ function toUnicode(input) {
38423
+ return mapDomain(input, function(string) {
38424
+ return regexPunycode.test(string)
38425
+ ? decode(string.slice(4).toLowerCase())
38426
+ : string;
38427
+ });
38428
+ }
38429
+
38430
+ /**
38431
+ * Converts a Unicode string representing a domain name or an email address to
38432
+ * Punycode. Only the non-ASCII parts of the domain name will be converted,
38433
+ * i.e. it doesn't matter if you call it with a domain that's already in
38434
+ * ASCII.
38435
+ * @memberOf punycode
38436
+ * @param {String} input The domain name or email address to convert, as a
38437
+ * Unicode string.
38438
+ * @returns {String} The Punycode representation of the given domain name or
38439
+ * email address.
38440
+ */
38441
+ function toASCII(input) {
38442
+ return mapDomain(input, function(string) {
38443
+ return regexNonASCII.test(string)
38444
+ ? 'xn--' + encode(string)
38445
+ : string;
38446
+ });
38447
+ }
38448
+
38449
+ /*--------------------------------------------------------------------------*/
38450
+
38451
+ /** Define the public API */
38452
+ punycode = {
38453
+ /**
38454
+ * A string representing the current Punycode.js version number.
38455
+ * @memberOf punycode
38456
+ * @type String
38457
+ */
38458
+ 'version': '1.3.2',
38459
+ /**
38460
+ * An object of methods to convert from JavaScript's internal character
38461
+ * representation (UCS-2) to Unicode code points, and back.
38462
+ * @see <https://mathiasbynens.be/notes/javascript-encoding>
38463
+ * @memberOf punycode
38464
+ * @type Object
38465
+ */
38466
+ 'ucs2': {
38467
+ 'decode': ucs2decode,
38468
+ 'encode': ucs2encode
38469
+ },
38470
+ 'decode': decode,
38471
+ 'encode': encode,
38472
+ 'toASCII': toASCII,
38473
+ 'toUnicode': toUnicode
38474
+ };
38475
+
38476
+ /** Expose `punycode` */
38477
+ // Some AMD build optimizers, like r.js, check for specific condition patterns
38478
+ // like the following:
38479
+ if (freeExports && freeModule) {
38480
+ if (module.exports == freeExports) { // in Node.js or RingoJS v0.8.0+
38481
+ freeModule.exports = punycode;
38482
+ } else { // in Narwhal or RingoJS v0.7.0-
38483
+ for (key in punycode) {
38484
+ punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]);
38485
+ }
38486
+ }
38487
+ } else { // in Rhino or a web browser
38488
+ root.punycode = punycode;
38489
+ }
38490
+
38491
+ }(commonjsGlobal));
38492
+ } (punycode$1, punycode$1.exports));
38493
+
38494
+ var util$1 = {
38495
+ isString: function(arg) {
38496
+ return typeof(arg) === 'string';
38497
+ },
38498
+ isObject: function(arg) {
38499
+ return typeof(arg) === 'object' && arg !== null;
38500
+ },
38501
+ isNull: function(arg) {
38502
+ return arg === null;
38503
+ },
38504
+ isNullOrUndefined: function(arg) {
38505
+ return arg == null;
38506
+ }
38507
+ };
38508
+
38509
+ var querystring$1 = {};
38510
+
38511
+ // If obj.hasOwnProperty has been overridden, then calling
38512
+ // obj.hasOwnProperty(prop) will break.
38513
+ // See: https://github.com/joyent/node/issues/1707
38514
+ function hasOwnProperty$1(obj, prop) {
38515
+ return Object.prototype.hasOwnProperty.call(obj, prop);
38516
+ }
38517
+
38518
+ var decode$1 = function(qs, sep, eq, options) {
38519
+ sep = sep || '&';
38520
+ eq = eq || '=';
38521
+ var obj = {};
38522
+
38523
+ if (typeof qs !== 'string' || qs.length === 0) {
38524
+ return obj;
38525
+ }
38526
+
38527
+ var regexp = /\+/g;
38528
+ qs = qs.split(sep);
38529
+
38530
+ var maxKeys = 1000;
38531
+ if (options && typeof options.maxKeys === 'number') {
38532
+ maxKeys = options.maxKeys;
38533
+ }
38534
+
38535
+ var len = qs.length;
38536
+ // maxKeys <= 0 means that we should not limit keys count
38537
+ if (maxKeys > 0 && len > maxKeys) {
38538
+ len = maxKeys;
38539
+ }
38540
+
38541
+ for (var i = 0; i < len; ++i) {
38542
+ var x = qs[i].replace(regexp, '%20'),
38543
+ idx = x.indexOf(eq),
38544
+ kstr, vstr, k, v;
38545
+
38546
+ if (idx >= 0) {
38547
+ kstr = x.substr(0, idx);
38548
+ vstr = x.substr(idx + 1);
38549
+ } else {
38550
+ kstr = x;
38551
+ vstr = '';
38552
+ }
38553
+
38554
+ k = decodeURIComponent(kstr);
38555
+ v = decodeURIComponent(vstr);
38556
+
38557
+ if (!hasOwnProperty$1(obj, k)) {
38558
+ obj[k] = v;
38559
+ } else if (Array.isArray(obj[k])) {
38560
+ obj[k].push(v);
38561
+ } else {
38562
+ obj[k] = [obj[k], v];
38563
+ }
38564
+ }
38565
+
38566
+ return obj;
38567
+ };
38568
+
38569
+ var stringifyPrimitive = function(v) {
38570
+ switch (typeof v) {
38571
+ case 'string':
38572
+ return v;
38573
+
38574
+ case 'boolean':
38575
+ return v ? 'true' : 'false';
38576
+
38577
+ case 'number':
38578
+ return isFinite(v) ? v : '';
38579
+
38580
+ default:
38581
+ return '';
38582
+ }
38583
+ };
38584
+
38585
+ var encode$2 = function(obj, sep, eq, name) {
38586
+ sep = sep || '&';
38587
+ eq = eq || '=';
38588
+ if (obj === null) {
38589
+ obj = undefined;
38590
+ }
38591
+
38592
+ if (typeof obj === 'object') {
38593
+ return Object.keys(obj).map(function(k) {
38594
+ var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;
38595
+ if (Array.isArray(obj[k])) {
38596
+ return obj[k].map(function(v) {
38597
+ return ks + encodeURIComponent(stringifyPrimitive(v));
38598
+ }).join(sep);
38599
+ } else {
38600
+ return ks + encodeURIComponent(stringifyPrimitive(obj[k]));
38601
+ }
38602
+ }).join(sep);
38603
+
38604
+ }
38605
+
38606
+ if (!name) return '';
38607
+ return encodeURIComponent(stringifyPrimitive(name)) + eq +
38608
+ encodeURIComponent(stringifyPrimitive(obj));
38609
+ };
38610
+
38611
+ querystring$1.decode = querystring$1.parse = decode$1;
38612
+ querystring$1.encode = querystring$1.stringify = encode$2;
38613
+
38614
+ var punycode = punycode$1.exports;
38615
+ var util = util$1;
38616
+
38617
+ url.parse = urlParse;
38618
+ url.resolve = urlResolve;
38619
+ url.resolveObject = urlResolveObject;
38620
+ url.format = urlFormat;
38621
+
38622
+ url.Url = Url;
38623
+
38624
+ function Url() {
38625
+ this.protocol = null;
38626
+ this.slashes = null;
38627
+ this.auth = null;
38628
+ this.host = null;
38629
+ this.port = null;
38630
+ this.hostname = null;
38631
+ this.hash = null;
38632
+ this.search = null;
38633
+ this.query = null;
38634
+ this.pathname = null;
38635
+ this.path = null;
38636
+ this.href = null;
38637
+ }
38638
+
38639
+ // Reference: RFC 3986, RFC 1808, RFC 2396
38640
+
38641
+ // define these here so at least they only have to be
38642
+ // compiled once on the first module load.
38643
+ var protocolPattern = /^([a-z0-9.+-]+:)/i,
38644
+ portPattern = /:[0-9]*$/,
38645
+
38646
+ // Special case for a simple path URL
38647
+ simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,
38648
+
38649
+ // RFC 2396: characters reserved for delimiting URLs.
38650
+ // We actually just auto-escape these.
38651
+ delims = ['<', '>', '"', '`', ' ', '\r', '\n', '\t'],
38652
+
38653
+ // RFC 2396: characters not allowed for various reasons.
38654
+ unwise = ['{', '}', '|', '\\', '^', '`'].concat(delims),
38655
+
38656
+ // Allowed by RFCs, but cause of XSS attacks. Always escape these.
38657
+ autoEscape = ['\''].concat(unwise),
38658
+ // Characters that are never ever allowed in a hostname.
38659
+ // Note that any invalid chars are also handled, but these
38660
+ // are the ones that are *expected* to be seen, so we fast-path
38661
+ // them.
38662
+ nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape),
38663
+ hostEndingChars = ['/', '?', '#'],
38664
+ hostnameMaxLen = 255,
38665
+ hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/,
38666
+ hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,
38667
+ // protocols that can allow "unsafe" and "unwise" chars.
38668
+ unsafeProtocol = {
38669
+ 'javascript': true,
38670
+ 'javascript:': true
38671
+ },
38672
+ // protocols that never have a hostname.
38673
+ hostlessProtocol = {
38674
+ 'javascript': true,
38675
+ 'javascript:': true
38676
+ },
38677
+ // protocols that always contain a // bit.
38678
+ slashedProtocol = {
38679
+ 'http': true,
38680
+ 'https': true,
38681
+ 'ftp': true,
38682
+ 'gopher': true,
38683
+ 'file': true,
38684
+ 'http:': true,
38685
+ 'https:': true,
38686
+ 'ftp:': true,
38687
+ 'gopher:': true,
38688
+ 'file:': true
38689
+ },
38690
+ querystring = querystring$1;
38691
+
38692
+ function urlParse(url, parseQueryString, slashesDenoteHost) {
38693
+ if (url && util.isObject(url) && url instanceof Url) return url;
38694
+
38695
+ var u = new Url;
38696
+ u.parse(url, parseQueryString, slashesDenoteHost);
38697
+ return u;
38698
+ }
38699
+
38700
+ Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {
38701
+ if (!util.isString(url)) {
38702
+ throw new TypeError("Parameter 'url' must be a string, not " + typeof url);
38703
+ }
38704
+
38705
+ // Copy chrome, IE, opera backslash-handling behavior.
38706
+ // Back slashes before the query string get converted to forward slashes
38707
+ // See: https://code.google.com/p/chromium/issues/detail?id=25916
38708
+ var queryIndex = url.indexOf('?'),
38709
+ splitter =
38710
+ (queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#',
38711
+ uSplit = url.split(splitter),
38712
+ slashRegex = /\\/g;
38713
+ uSplit[0] = uSplit[0].replace(slashRegex, '/');
38714
+ url = uSplit.join(splitter);
38715
+
38716
+ var rest = url;
38717
+
38718
+ // trim before proceeding.
38719
+ // This is to support parse stuff like " http://foo.com \n"
38720
+ rest = rest.trim();
38721
+
38722
+ if (!slashesDenoteHost && url.split('#').length === 1) {
38723
+ // Try fast path regexp
38724
+ var simplePath = simplePathPattern.exec(rest);
38725
+ if (simplePath) {
38726
+ this.path = rest;
38727
+ this.href = rest;
38728
+ this.pathname = simplePath[1];
38729
+ if (simplePath[2]) {
38730
+ this.search = simplePath[2];
38731
+ if (parseQueryString) {
38732
+ this.query = querystring.parse(this.search.substr(1));
38733
+ } else {
38734
+ this.query = this.search.substr(1);
38735
+ }
38736
+ } else if (parseQueryString) {
38737
+ this.search = '';
38738
+ this.query = {};
38739
+ }
38740
+ return this;
38741
+ }
38742
+ }
38743
+
38744
+ var proto = protocolPattern.exec(rest);
38745
+ if (proto) {
38746
+ proto = proto[0];
38747
+ var lowerProto = proto.toLowerCase();
38748
+ this.protocol = lowerProto;
38749
+ rest = rest.substr(proto.length);
38750
+ }
38751
+
38752
+ // figure out if it's got a host
38753
+ // user@server is *always* interpreted as a hostname, and url
38754
+ // resolution will treat //foo/bar as host=foo,path=bar because that's
38755
+ // how the browser resolves relative URLs.
38756
+ if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) {
38757
+ var slashes = rest.substr(0, 2) === '//';
38758
+ if (slashes && !(proto && hostlessProtocol[proto])) {
38759
+ rest = rest.substr(2);
38760
+ this.slashes = true;
38761
+ }
38762
+ }
38763
+
38764
+ if (!hostlessProtocol[proto] &&
38765
+ (slashes || (proto && !slashedProtocol[proto]))) {
38766
+
38767
+ // there's a hostname.
38768
+ // the first instance of /, ?, ;, or # ends the host.
38769
+ //
38770
+ // If there is an @ in the hostname, then non-host chars *are* allowed
38771
+ // to the left of the last @ sign, unless some host-ending character
38772
+ // comes *before* the @-sign.
38773
+ // URLs are obnoxious.
38774
+ //
38775
+ // ex:
38776
+ // http://a@b@c/ => user:a@b host:c
38777
+ // http://a@b?@c => user:a host:c path:/?@c
38778
+
38779
+ // v0.12 TODO(isaacs): This is not quite how Chrome does things.
38780
+ // Review our test case against browsers more comprehensively.
38781
+
38782
+ // find the first instance of any hostEndingChars
38783
+ var hostEnd = -1;
38784
+ for (var i = 0; i < hostEndingChars.length; i++) {
38785
+ var hec = rest.indexOf(hostEndingChars[i]);
38786
+ if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))
38787
+ hostEnd = hec;
38788
+ }
38789
+
38790
+ // at this point, either we have an explicit point where the
38791
+ // auth portion cannot go past, or the last @ char is the decider.
38792
+ var auth, atSign;
38793
+ if (hostEnd === -1) {
38794
+ // atSign can be anywhere.
38795
+ atSign = rest.lastIndexOf('@');
38796
+ } else {
38797
+ // atSign must be in auth portion.
38798
+ // http://a@b/c@d => host:b auth:a path:/c@d
38799
+ atSign = rest.lastIndexOf('@', hostEnd);
38800
+ }
38801
+
38802
+ // Now we have a portion which is definitely the auth.
38803
+ // Pull that off.
38804
+ if (atSign !== -1) {
38805
+ auth = rest.slice(0, atSign);
38806
+ rest = rest.slice(atSign + 1);
38807
+ this.auth = decodeURIComponent(auth);
38808
+ }
38809
+
38810
+ // the host is the remaining to the left of the first non-host char
38811
+ hostEnd = -1;
38812
+ for (var i = 0; i < nonHostChars.length; i++) {
38813
+ var hec = rest.indexOf(nonHostChars[i]);
38814
+ if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))
38815
+ hostEnd = hec;
38816
+ }
38817
+ // if we still have not hit it, then the entire thing is a host.
38818
+ if (hostEnd === -1)
38819
+ hostEnd = rest.length;
38820
+
38821
+ this.host = rest.slice(0, hostEnd);
38822
+ rest = rest.slice(hostEnd);
38823
+
38824
+ // pull out port.
38825
+ this.parseHost();
38826
+
38827
+ // we've indicated that there is a hostname,
38828
+ // so even if it's empty, it has to be present.
38829
+ this.hostname = this.hostname || '';
38830
+
38831
+ // if hostname begins with [ and ends with ]
38832
+ // assume that it's an IPv6 address.
38833
+ var ipv6Hostname = this.hostname[0] === '[' &&
38834
+ this.hostname[this.hostname.length - 1] === ']';
38835
+
38836
+ // validate a little.
38837
+ if (!ipv6Hostname) {
38838
+ var hostparts = this.hostname.split(/\./);
38839
+ for (var i = 0, l = hostparts.length; i < l; i++) {
38840
+ var part = hostparts[i];
38841
+ if (!part) continue;
38842
+ if (!part.match(hostnamePartPattern)) {
38843
+ var newpart = '';
38844
+ for (var j = 0, k = part.length; j < k; j++) {
38845
+ if (part.charCodeAt(j) > 127) {
38846
+ // we replace non-ASCII char with a temporary placeholder
38847
+ // we need this to make sure size of hostname is not
38848
+ // broken by replacing non-ASCII by nothing
38849
+ newpart += 'x';
38850
+ } else {
38851
+ newpart += part[j];
38852
+ }
38853
+ }
38854
+ // we test again with ASCII char only
38855
+ if (!newpart.match(hostnamePartPattern)) {
38856
+ var validParts = hostparts.slice(0, i);
38857
+ var notHost = hostparts.slice(i + 1);
38858
+ var bit = part.match(hostnamePartStart);
38859
+ if (bit) {
38860
+ validParts.push(bit[1]);
38861
+ notHost.unshift(bit[2]);
38862
+ }
38863
+ if (notHost.length) {
38864
+ rest = '/' + notHost.join('.') + rest;
38865
+ }
38866
+ this.hostname = validParts.join('.');
38867
+ break;
38868
+ }
38869
+ }
38870
+ }
38871
+ }
38872
+
38873
+ if (this.hostname.length > hostnameMaxLen) {
38874
+ this.hostname = '';
38875
+ } else {
38876
+ // hostnames are always lower case.
38877
+ this.hostname = this.hostname.toLowerCase();
38878
+ }
38879
+
38880
+ if (!ipv6Hostname) {
38881
+ // IDNA Support: Returns a punycoded representation of "domain".
38882
+ // It only converts parts of the domain name that
38883
+ // have non-ASCII characters, i.e. it doesn't matter if
38884
+ // you call it with a domain that already is ASCII-only.
38885
+ this.hostname = punycode.toASCII(this.hostname);
38886
+ }
38887
+
38888
+ var p = this.port ? ':' + this.port : '';
38889
+ var h = this.hostname || '';
38890
+ this.host = h + p;
38891
+ this.href += this.host;
38892
+
38893
+ // strip [ and ] from the hostname
38894
+ // the host field still retains them, though
38895
+ if (ipv6Hostname) {
38896
+ this.hostname = this.hostname.substr(1, this.hostname.length - 2);
38897
+ if (rest[0] !== '/') {
38898
+ rest = '/' + rest;
38899
+ }
38900
+ }
38901
+ }
38902
+
38903
+ // now rest is set to the post-host stuff.
38904
+ // chop off any delim chars.
38905
+ if (!unsafeProtocol[lowerProto]) {
38906
+
38907
+ // First, make 100% sure that any "autoEscape" chars get
38908
+ // escaped, even if encodeURIComponent doesn't think they
38909
+ // need to be.
38910
+ for (var i = 0, l = autoEscape.length; i < l; i++) {
38911
+ var ae = autoEscape[i];
38912
+ if (rest.indexOf(ae) === -1)
38913
+ continue;
38914
+ var esc = encodeURIComponent(ae);
38915
+ if (esc === ae) {
38916
+ esc = escape(ae);
38917
+ }
38918
+ rest = rest.split(ae).join(esc);
38919
+ }
38920
+ }
38921
+
38922
+
38923
+ // chop off from the tail first.
38924
+ var hash = rest.indexOf('#');
38925
+ if (hash !== -1) {
38926
+ // got a fragment string.
38927
+ this.hash = rest.substr(hash);
38928
+ rest = rest.slice(0, hash);
38929
+ }
38930
+ var qm = rest.indexOf('?');
38931
+ if (qm !== -1) {
38932
+ this.search = rest.substr(qm);
38933
+ this.query = rest.substr(qm + 1);
38934
+ if (parseQueryString) {
38935
+ this.query = querystring.parse(this.query);
38936
+ }
38937
+ rest = rest.slice(0, qm);
38938
+ } else if (parseQueryString) {
38939
+ // no query string, but parseQueryString still requested
38940
+ this.search = '';
38941
+ this.query = {};
38942
+ }
38943
+ if (rest) this.pathname = rest;
38944
+ if (slashedProtocol[lowerProto] &&
38945
+ this.hostname && !this.pathname) {
38946
+ this.pathname = '/';
38947
+ }
38948
+
38949
+ //to support http.request
38950
+ if (this.pathname || this.search) {
38951
+ var p = this.pathname || '';
38952
+ var s = this.search || '';
38953
+ this.path = p + s;
38954
+ }
38955
+
38956
+ // finally, reconstruct the href based on what has been validated.
38957
+ this.href = this.format();
38958
+ return this;
38959
+ };
38960
+
38961
+ // format a parsed object into a url string
38962
+ function urlFormat(obj) {
38963
+ // ensure it's an object, and not a string url.
38964
+ // If it's an obj, this is a no-op.
38965
+ // this way, you can call url_format() on strings
38966
+ // to clean up potentially wonky urls.
38967
+ if (util.isString(obj)) obj = urlParse(obj);
38968
+ if (!(obj instanceof Url)) return Url.prototype.format.call(obj);
38969
+ return obj.format();
38970
+ }
38971
+
38972
+ Url.prototype.format = function() {
38973
+ var auth = this.auth || '';
38974
+ if (auth) {
38975
+ auth = encodeURIComponent(auth);
38976
+ auth = auth.replace(/%3A/i, ':');
38977
+ auth += '@';
38978
+ }
38979
+
38980
+ var protocol = this.protocol || '',
38981
+ pathname = this.pathname || '',
38982
+ hash = this.hash || '',
38983
+ host = false,
38984
+ query = '';
38985
+
38986
+ if (this.host) {
38987
+ host = auth + this.host;
38988
+ } else if (this.hostname) {
38989
+ host = auth + (this.hostname.indexOf(':') === -1 ?
38990
+ this.hostname :
38991
+ '[' + this.hostname + ']');
38992
+ if (this.port) {
38993
+ host += ':' + this.port;
38994
+ }
38995
+ }
38996
+
38997
+ if (this.query &&
38998
+ util.isObject(this.query) &&
38999
+ Object.keys(this.query).length) {
39000
+ query = querystring.stringify(this.query);
39001
+ }
39002
+
39003
+ var search = this.search || (query && ('?' + query)) || '';
39004
+
39005
+ if (protocol && protocol.substr(-1) !== ':') protocol += ':';
39006
+
39007
+ // only the slashedProtocols get the //. Not mailto:, xmpp:, etc.
39008
+ // unless they had them to begin with.
39009
+ if (this.slashes ||
39010
+ (!protocol || slashedProtocol[protocol]) && host !== false) {
39011
+ host = '//' + (host || '');
39012
+ if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname;
39013
+ } else if (!host) {
39014
+ host = '';
39015
+ }
39016
+
39017
+ if (hash && hash.charAt(0) !== '#') hash = '#' + hash;
39018
+ if (search && search.charAt(0) !== '?') search = '?' + search;
39019
+
39020
+ pathname = pathname.replace(/[?#]/g, function(match) {
39021
+ return encodeURIComponent(match);
39022
+ });
39023
+ search = search.replace('#', '%23');
39024
+
39025
+ return protocol + host + pathname + search + hash;
39026
+ };
39027
+
39028
+ function urlResolve(source, relative) {
39029
+ return urlParse(source, false, true).resolve(relative);
39030
+ }
39031
+
39032
+ Url.prototype.resolve = function(relative) {
39033
+ return this.resolveObject(urlParse(relative, false, true)).format();
39034
+ };
39035
+
39036
+ function urlResolveObject(source, relative) {
39037
+ if (!source) return relative;
39038
+ return urlParse(source, false, true).resolveObject(relative);
39039
+ }
39040
+
39041
+ Url.prototype.resolveObject = function(relative) {
39042
+ if (util.isString(relative)) {
39043
+ var rel = new Url();
39044
+ rel.parse(relative, false, true);
39045
+ relative = rel;
39046
+ }
39047
+
39048
+ var result = new Url();
39049
+ var tkeys = Object.keys(this);
39050
+ for (var tk = 0; tk < tkeys.length; tk++) {
39051
+ var tkey = tkeys[tk];
39052
+ result[tkey] = this[tkey];
39053
+ }
39054
+
39055
+ // hash is always overridden, no matter what.
39056
+ // even href="" will remove it.
39057
+ result.hash = relative.hash;
39058
+
39059
+ // if the relative url is empty, then there's nothing left to do here.
39060
+ if (relative.href === '') {
39061
+ result.href = result.format();
39062
+ return result;
39063
+ }
39064
+
39065
+ // hrefs like //foo/bar always cut to the protocol.
39066
+ if (relative.slashes && !relative.protocol) {
39067
+ // take everything except the protocol from relative
39068
+ var rkeys = Object.keys(relative);
39069
+ for (var rk = 0; rk < rkeys.length; rk++) {
39070
+ var rkey = rkeys[rk];
39071
+ if (rkey !== 'protocol')
39072
+ result[rkey] = relative[rkey];
39073
+ }
39074
+
39075
+ //urlParse appends trailing / to urls like http://www.example.com
39076
+ if (slashedProtocol[result.protocol] &&
39077
+ result.hostname && !result.pathname) {
39078
+ result.path = result.pathname = '/';
39079
+ }
39080
+
39081
+ result.href = result.format();
39082
+ return result;
39083
+ }
39084
+
39085
+ if (relative.protocol && relative.protocol !== result.protocol) {
39086
+ // if it's a known url protocol, then changing
39087
+ // the protocol does weird things
39088
+ // first, if it's not file:, then we MUST have a host,
39089
+ // and if there was a path
39090
+ // to begin with, then we MUST have a path.
39091
+ // if it is file:, then the host is dropped,
39092
+ // because that's known to be hostless.
39093
+ // anything else is assumed to be absolute.
39094
+ if (!slashedProtocol[relative.protocol]) {
39095
+ var keys = Object.keys(relative);
39096
+ for (var v = 0; v < keys.length; v++) {
39097
+ var k = keys[v];
39098
+ result[k] = relative[k];
39099
+ }
39100
+ result.href = result.format();
39101
+ return result;
39102
+ }
39103
+
39104
+ result.protocol = relative.protocol;
39105
+ if (!relative.host && !hostlessProtocol[relative.protocol]) {
39106
+ var relPath = (relative.pathname || '').split('/');
39107
+ while (relPath.length && !(relative.host = relPath.shift()));
39108
+ if (!relative.host) relative.host = '';
39109
+ if (!relative.hostname) relative.hostname = '';
39110
+ if (relPath[0] !== '') relPath.unshift('');
39111
+ if (relPath.length < 2) relPath.unshift('');
39112
+ result.pathname = relPath.join('/');
39113
+ } else {
39114
+ result.pathname = relative.pathname;
39115
+ }
39116
+ result.search = relative.search;
39117
+ result.query = relative.query;
39118
+ result.host = relative.host || '';
39119
+ result.auth = relative.auth;
39120
+ result.hostname = relative.hostname || relative.host;
39121
+ result.port = relative.port;
39122
+ // to support http.request
39123
+ if (result.pathname || result.search) {
39124
+ var p = result.pathname || '';
39125
+ var s = result.search || '';
39126
+ result.path = p + s;
39127
+ }
39128
+ result.slashes = result.slashes || relative.slashes;
39129
+ result.href = result.format();
39130
+ return result;
39131
+ }
39132
+
39133
+ var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'),
39134
+ isRelAbs = (
39135
+ relative.host ||
39136
+ relative.pathname && relative.pathname.charAt(0) === '/'
39137
+ ),
39138
+ mustEndAbs = (isRelAbs || isSourceAbs ||
39139
+ (result.host && relative.pathname)),
39140
+ removeAllDots = mustEndAbs,
39141
+ srcPath = result.pathname && result.pathname.split('/') || [],
39142
+ relPath = relative.pathname && relative.pathname.split('/') || [],
39143
+ psychotic = result.protocol && !slashedProtocol[result.protocol];
39144
+
39145
+ // if the url is a non-slashed url, then relative
39146
+ // links like ../.. should be able
39147
+ // to crawl up to the hostname, as well. This is strange.
39148
+ // result.protocol has already been set by now.
39149
+ // Later on, put the first path part into the host field.
39150
+ if (psychotic) {
39151
+ result.hostname = '';
39152
+ result.port = null;
39153
+ if (result.host) {
39154
+ if (srcPath[0] === '') srcPath[0] = result.host;
39155
+ else srcPath.unshift(result.host);
39156
+ }
39157
+ result.host = '';
39158
+ if (relative.protocol) {
39159
+ relative.hostname = null;
39160
+ relative.port = null;
39161
+ if (relative.host) {
39162
+ if (relPath[0] === '') relPath[0] = relative.host;
39163
+ else relPath.unshift(relative.host);
39164
+ }
39165
+ relative.host = null;
39166
+ }
39167
+ mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === '');
39168
+ }
39169
+
39170
+ if (isRelAbs) {
39171
+ // it's absolute.
39172
+ result.host = (relative.host || relative.host === '') ?
39173
+ relative.host : result.host;
39174
+ result.hostname = (relative.hostname || relative.hostname === '') ?
39175
+ relative.hostname : result.hostname;
39176
+ result.search = relative.search;
39177
+ result.query = relative.query;
39178
+ srcPath = relPath;
39179
+ // fall through to the dot-handling below.
39180
+ } else if (relPath.length) {
39181
+ // it's relative
39182
+ // throw away the existing file, and take the new path instead.
39183
+ if (!srcPath) srcPath = [];
39184
+ srcPath.pop();
39185
+ srcPath = srcPath.concat(relPath);
39186
+ result.search = relative.search;
39187
+ result.query = relative.query;
39188
+ } else if (!util.isNullOrUndefined(relative.search)) {
39189
+ // just pull out the search.
39190
+ // like href='?foo'.
39191
+ // Put this after the other two cases because it simplifies the booleans
39192
+ if (psychotic) {
39193
+ result.hostname = result.host = srcPath.shift();
39194
+ //occationaly the auth can get stuck only in host
39195
+ //this especially happens in cases like
39196
+ //url.resolveObject('mailto:local1@domain1', 'local2@domain2')
39197
+ var authInHost = result.host && result.host.indexOf('@') > 0 ?
39198
+ result.host.split('@') : false;
39199
+ if (authInHost) {
39200
+ result.auth = authInHost.shift();
39201
+ result.host = result.hostname = authInHost.shift();
39202
+ }
39203
+ }
39204
+ result.search = relative.search;
39205
+ result.query = relative.query;
39206
+ //to support http.request
39207
+ if (!util.isNull(result.pathname) || !util.isNull(result.search)) {
39208
+ result.path = (result.pathname ? result.pathname : '') +
39209
+ (result.search ? result.search : '');
39210
+ }
39211
+ result.href = result.format();
39212
+ return result;
39213
+ }
39214
+
39215
+ if (!srcPath.length) {
39216
+ // no path at all. easy.
39217
+ // we've already handled the other stuff above.
39218
+ result.pathname = null;
39219
+ //to support http.request
39220
+ if (result.search) {
39221
+ result.path = '/' + result.search;
39222
+ } else {
39223
+ result.path = null;
39224
+ }
39225
+ result.href = result.format();
39226
+ return result;
39227
+ }
39228
+
39229
+ // if a url ENDs in . or .., then it must get a trailing slash.
39230
+ // however, if it ends in anything else non-slashy,
39231
+ // then it must NOT get a trailing slash.
39232
+ var last = srcPath.slice(-1)[0];
39233
+ var hasTrailingSlash = (
39234
+ (result.host || relative.host || srcPath.length > 1) &&
39235
+ (last === '.' || last === '..') || last === '');
39236
+
39237
+ // strip single dots, resolve double dots to parent dir
39238
+ // if the path tries to go above the root, `up` ends up > 0
39239
+ var up = 0;
39240
+ for (var i = srcPath.length; i >= 0; i--) {
39241
+ last = srcPath[i];
39242
+ if (last === '.') {
39243
+ srcPath.splice(i, 1);
39244
+ } else if (last === '..') {
39245
+ srcPath.splice(i, 1);
39246
+ up++;
39247
+ } else if (up) {
39248
+ srcPath.splice(i, 1);
39249
+ up--;
39250
+ }
39251
+ }
39252
+
39253
+ // if the path is allowed to go above the root, restore leading ..s
39254
+ if (!mustEndAbs && !removeAllDots) {
39255
+ for (; up--; up) {
39256
+ srcPath.unshift('..');
39257
+ }
39258
+ }
39259
+
39260
+ if (mustEndAbs && srcPath[0] !== '' &&
39261
+ (!srcPath[0] || srcPath[0].charAt(0) !== '/')) {
39262
+ srcPath.unshift('');
39263
+ }
39264
+
39265
+ if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) {
39266
+ srcPath.push('');
39267
+ }
39268
+
39269
+ var isAbsolute = srcPath[0] === '' ||
39270
+ (srcPath[0] && srcPath[0].charAt(0) === '/');
39271
+
39272
+ // put the host back
39273
+ if (psychotic) {
39274
+ result.hostname = result.host = isAbsolute ? '' :
39275
+ srcPath.length ? srcPath.shift() : '';
39276
+ //occationaly the auth can get stuck only in host
39277
+ //this especially happens in cases like
39278
+ //url.resolveObject('mailto:local1@domain1', 'local2@domain2')
39279
+ var authInHost = result.host && result.host.indexOf('@') > 0 ?
39280
+ result.host.split('@') : false;
39281
+ if (authInHost) {
39282
+ result.auth = authInHost.shift();
39283
+ result.host = result.hostname = authInHost.shift();
39284
+ }
39285
+ }
39286
+
39287
+ mustEndAbs = mustEndAbs || (result.host && srcPath.length);
39288
+
39289
+ if (mustEndAbs && !isAbsolute) {
39290
+ srcPath.unshift('');
39291
+ }
39292
+
39293
+ if (!srcPath.length) {
39294
+ result.pathname = null;
39295
+ result.path = null;
39296
+ } else {
39297
+ result.pathname = srcPath.join('/');
39298
+ }
39299
+
39300
+ //to support request.http
39301
+ if (!util.isNull(result.pathname) || !util.isNull(result.search)) {
39302
+ result.path = (result.pathname ? result.pathname : '') +
39303
+ (result.search ? result.search : '');
39304
+ }
39305
+ result.auth = relative.auth || result.auth;
39306
+ result.slashes = result.slashes || relative.slashes;
39307
+ result.href = result.format();
39308
+ return result;
39309
+ };
39310
+
39311
+ Url.prototype.parseHost = function() {
39312
+ var host = this.host;
39313
+ var port = portPattern.exec(host);
39314
+ if (port) {
39315
+ port = port[0];
39316
+ if (port !== ':') {
39317
+ this.port = port.substr(1);
39318
+ }
39319
+ host = host.substr(0, host.length - port.length);
39320
+ }
39321
+ if (host) this.hostname = host;
39322
+ };
39323
+
37962
39324
  /**
37963
39325
  * @typedef URL
37964
39326
  * @property {string} hash
@@ -38104,7 +39466,7 @@ class VFile$1 {
38104
39466
  * Defaults to `process.cwd()` (`/` in browsers).
38105
39467
  * @type {string}
38106
39468
  */
38107
- this.cwd = proc__default["default"].cwd();
39469
+ this.cwd = process$1.cwd();
38108
39470
 
38109
39471
  /* eslint-disable no-unused-expressions */
38110
39472
  /**
@@ -38982,7 +40344,7 @@ class VFile {
38982
40344
  * Defaults to `process.cwd()` (`/` in browsers).
38983
40345
  * @type {string}
38984
40346
  */
38985
- this.cwd = proc__default["default"].cwd();
40347
+ this.cwd = process$1.cwd();
38986
40348
 
38987
40349
  /* eslint-disable no-unused-expressions */
38988
40350
  /**
@@ -73323,7 +74685,7 @@ https://highlightjs.org/
73323
74685
  */
73324
74686
 
73325
74687
 
73326
- const escape = escapeHTML;
74688
+ const escape$1 = escapeHTML;
73327
74689
  const inherit = inherit$1;
73328
74690
  const NO_MATCH = Symbol("nomatch");
73329
74691
  const MAX_KEYWORD_HITS = 7;
@@ -73883,7 +75245,7 @@ const HLJS = function(hljs) {
73883
75245
  if (err.message && err.message.includes('Illegal')) {
73884
75246
  return {
73885
75247
  language: languageName,
73886
- value: escape(codeToHighlight),
75248
+ value: escape$1(codeToHighlight),
73887
75249
  illegal: true,
73888
75250
  relevance: 0,
73889
75251
  _illegalBy: {
@@ -73898,7 +75260,7 @@ const HLJS = function(hljs) {
73898
75260
  } else if (SAFE_MODE) {
73899
75261
  return {
73900
75262
  language: languageName,
73901
- value: escape(codeToHighlight),
75263
+ value: escape$1(codeToHighlight),
73902
75264
  illegal: false,
73903
75265
  relevance: 0,
73904
75266
  errorRaised: err,
@@ -73920,7 +75282,7 @@ const HLJS = function(hljs) {
73920
75282
  */
73921
75283
  function justTextHighlightResult(code) {
73922
75284
  const result = {
73923
- value: escape(code),
75285
+ value: escape$1(code),
73924
75286
  illegal: false,
73925
75287
  relevance: 0,
73926
75288
  _top: PLAINTEXT_LANGUAGE,
@@ -75884,10 +77246,9 @@ function language(node) {
75884
77246
  var FormReadOnlyMarkdown = function FormReadOnlyMarkdown(_ref) {
75885
77247
  var content = _ref.content;
75886
77248
  return /*#__PURE__*/React__default["default"].createElement(ReactMarkdown, {
75887
- children: content,
75888
77249
  remarkPlugins: [remarkGfm],
75889
77250
  rehypePlugins: [rehypeHighlight]
75890
- });
77251
+ }, content);
75891
77252
  };
75892
77253
 
75893
77254
  FormReadOnlyMarkdown.propTypes = {