You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2987 lines
108 KiB

1 year ago
  1. (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
  2. module.exports = function (it) {
  3. if (typeof it != 'function') {
  4. throw TypeError(String(it) + ' is not a function');
  5. } return it;
  6. };
  7. },{}],2:[function(require,module,exports){
  8. var isObject = require('../internals/is-object');
  9. module.exports = function (it) {
  10. if (!isObject(it) && it !== null) {
  11. throw TypeError("Can't set " + String(it) + ' as a prototype');
  12. } return it;
  13. };
  14. },{"../internals/is-object":37}],3:[function(require,module,exports){
  15. var wellKnownSymbol = require('../internals/well-known-symbol');
  16. var create = require('../internals/object-create');
  17. var definePropertyModule = require('../internals/object-define-property');
  18. var UNSCOPABLES = wellKnownSymbol('unscopables');
  19. var ArrayPrototype = Array.prototype;
  20. // Array.prototype[@@unscopables]
  21. // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
  22. if (ArrayPrototype[UNSCOPABLES] == undefined) {
  23. definePropertyModule.f(ArrayPrototype, UNSCOPABLES, {
  24. configurable: true,
  25. value: create(null)
  26. });
  27. }
  28. // add a key to Array.prototype[@@unscopables]
  29. module.exports = function (key) {
  30. ArrayPrototype[UNSCOPABLES][key] = true;
  31. };
  32. },{"../internals/object-create":45,"../internals/object-define-property":47,"../internals/well-known-symbol":77}],4:[function(require,module,exports){
  33. module.exports = function (it, Constructor, name) {
  34. if (!(it instanceof Constructor)) {
  35. throw TypeError('Incorrect ' + (name ? name + ' ' : '') + 'invocation');
  36. } return it;
  37. };
  38. },{}],5:[function(require,module,exports){
  39. var isObject = require('../internals/is-object');
  40. module.exports = function (it) {
  41. if (!isObject(it)) {
  42. throw TypeError(String(it) + ' is not an object');
  43. } return it;
  44. };
  45. },{"../internals/is-object":37}],6:[function(require,module,exports){
  46. 'use strict';
  47. var bind = require('../internals/function-bind-context');
  48. var toObject = require('../internals/to-object');
  49. var callWithSafeIterationClosing = require('../internals/call-with-safe-iteration-closing');
  50. var isArrayIteratorMethod = require('../internals/is-array-iterator-method');
  51. var toLength = require('../internals/to-length');
  52. var createProperty = require('../internals/create-property');
  53. var getIteratorMethod = require('../internals/get-iterator-method');
  54. // `Array.from` method implementation
  55. // https://tc39.github.io/ecma262/#sec-array.from
  56. module.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
  57. var O = toObject(arrayLike);
  58. var C = typeof this == 'function' ? this : Array;
  59. var argumentsLength = arguments.length;
  60. var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
  61. var mapping = mapfn !== undefined;
  62. var iteratorMethod = getIteratorMethod(O);
  63. var index = 0;
  64. var length, result, step, iterator, next, value;
  65. if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined, 2);
  66. // if the target is not iterable or it's an array with the default iterator - use a simple case
  67. if (iteratorMethod != undefined && !(C == Array && isArrayIteratorMethod(iteratorMethod))) {
  68. iterator = iteratorMethod.call(O);
  69. next = iterator.next;
  70. result = new C();
  71. for (;!(step = next.call(iterator)).done; index++) {
  72. value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;
  73. createProperty(result, index, value);
  74. }
  75. } else {
  76. length = toLength(O.length);
  77. result = new C(length);
  78. for (;length > index; index++) {
  79. value = mapping ? mapfn(O[index], index) : O[index];
  80. createProperty(result, index, value);
  81. }
  82. }
  83. result.length = index;
  84. return result;
  85. };
  86. },{"../internals/call-with-safe-iteration-closing":8,"../internals/create-property":16,"../internals/function-bind-context":23,"../internals/get-iterator-method":25,"../internals/is-array-iterator-method":35,"../internals/to-length":71,"../internals/to-object":72}],7:[function(require,module,exports){
  87. var toIndexedObject = require('../internals/to-indexed-object');
  88. var toLength = require('../internals/to-length');
  89. var toAbsoluteIndex = require('../internals/to-absolute-index');
  90. // `Array.prototype.{ indexOf, includes }` methods implementation
  91. var createMethod = function (IS_INCLUDES) {
  92. return function ($this, el, fromIndex) {
  93. var O = toIndexedObject($this);
  94. var length = toLength(O.length);
  95. var index = toAbsoluteIndex(fromIndex, length);
  96. var value;
  97. // Array#includes uses SameValueZero equality algorithm
  98. // eslint-disable-next-line no-self-compare
  99. if (IS_INCLUDES && el != el) while (length > index) {
  100. value = O[index++];
  101. // eslint-disable-next-line no-self-compare
  102. if (value != value) return true;
  103. // Array#indexOf ignores holes, Array#includes - not
  104. } else for (;length > index; index++) {
  105. if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
  106. } return !IS_INCLUDES && -1;
  107. };
  108. };
  109. module.exports = {
  110. // `Array.prototype.includes` method
  111. // https://tc39.github.io/ecma262/#sec-array.prototype.includes
  112. includes: createMethod(true),
  113. // `Array.prototype.indexOf` method
  114. // https://tc39.github.io/ecma262/#sec-array.prototype.indexof
  115. indexOf: createMethod(false)
  116. };
  117. },{"../internals/to-absolute-index":68,"../internals/to-indexed-object":69,"../internals/to-length":71}],8:[function(require,module,exports){
  118. var anObject = require('../internals/an-object');
  119. // call something on iterator step with safe closing on error
  120. module.exports = function (iterator, fn, value, ENTRIES) {
  121. try {
  122. return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);
  123. // 7.4.6 IteratorClose(iterator, completion)
  124. } catch (error) {
  125. var returnMethod = iterator['return'];
  126. if (returnMethod !== undefined) anObject(returnMethod.call(iterator));
  127. throw error;
  128. }
  129. };
  130. },{"../internals/an-object":5}],9:[function(require,module,exports){
  131. var toString = {}.toString;
  132. module.exports = function (it) {
  133. return toString.call(it).slice(8, -1);
  134. };
  135. },{}],10:[function(require,module,exports){
  136. var TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support');
  137. var classofRaw = require('../internals/classof-raw');
  138. var wellKnownSymbol = require('../internals/well-known-symbol');
  139. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  140. // ES3 wrong here
  141. var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
  142. // fallback for IE11 Script Access Denied error
  143. var tryGet = function (it, key) {
  144. try {
  145. return it[key];
  146. } catch (error) { /* empty */ }
  147. };
  148. // getting tag from ES6+ `Object.prototype.toString`
  149. module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
  150. var O, tag, result;
  151. return it === undefined ? 'Undefined' : it === null ? 'Null'
  152. // @@toStringTag case
  153. : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == 'string' ? tag
  154. // builtinTag case
  155. : CORRECT_ARGUMENTS ? classofRaw(O)
  156. // ES3 arguments fallback
  157. : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;
  158. };
  159. },{"../internals/classof-raw":9,"../internals/to-string-tag-support":74,"../internals/well-known-symbol":77}],11:[function(require,module,exports){
  160. var has = require('../internals/has');
  161. var ownKeys = require('../internals/own-keys');
  162. var getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor');
  163. var definePropertyModule = require('../internals/object-define-property');
  164. module.exports = function (target, source) {
  165. var keys = ownKeys(source);
  166. var defineProperty = definePropertyModule.f;
  167. var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
  168. for (var i = 0; i < keys.length; i++) {
  169. var key = keys[i];
  170. if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
  171. }
  172. };
  173. },{"../internals/has":28,"../internals/object-define-property":47,"../internals/object-get-own-property-descriptor":48,"../internals/own-keys":56}],12:[function(require,module,exports){
  174. var fails = require('../internals/fails');
  175. module.exports = !fails(function () {
  176. function F() { /* empty */ }
  177. F.prototype.constructor = null;
  178. return Object.getPrototypeOf(new F()) !== F.prototype;
  179. });
  180. },{"../internals/fails":22}],13:[function(require,module,exports){
  181. 'use strict';
  182. var IteratorPrototype = require('../internals/iterators-core').IteratorPrototype;
  183. var create = require('../internals/object-create');
  184. var createPropertyDescriptor = require('../internals/create-property-descriptor');
  185. var setToStringTag = require('../internals/set-to-string-tag');
  186. var Iterators = require('../internals/iterators');
  187. var returnThis = function () { return this; };
  188. module.exports = function (IteratorConstructor, NAME, next) {
  189. var TO_STRING_TAG = NAME + ' Iterator';
  190. IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(1, next) });
  191. setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true);
  192. Iterators[TO_STRING_TAG] = returnThis;
  193. return IteratorConstructor;
  194. };
  195. },{"../internals/create-property-descriptor":15,"../internals/iterators":40,"../internals/iterators-core":39,"../internals/object-create":45,"../internals/set-to-string-tag":62}],14:[function(require,module,exports){
  196. var DESCRIPTORS = require('../internals/descriptors');
  197. var definePropertyModule = require('../internals/object-define-property');
  198. var createPropertyDescriptor = require('../internals/create-property-descriptor');
  199. module.exports = DESCRIPTORS ? function (object, key, value) {
  200. return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));
  201. } : function (object, key, value) {
  202. object[key] = value;
  203. return object;
  204. };
  205. },{"../internals/create-property-descriptor":15,"../internals/descriptors":18,"../internals/object-define-property":47}],15:[function(require,module,exports){
  206. module.exports = function (bitmap, value) {
  207. return {
  208. enumerable: !(bitmap & 1),
  209. configurable: !(bitmap & 2),
  210. writable: !(bitmap & 4),
  211. value: value
  212. };
  213. };
  214. },{}],16:[function(require,module,exports){
  215. 'use strict';
  216. var toPrimitive = require('../internals/to-primitive');
  217. var definePropertyModule = require('../internals/object-define-property');
  218. var createPropertyDescriptor = require('../internals/create-property-descriptor');
  219. module.exports = function (object, key, value) {
  220. var propertyKey = toPrimitive(key);
  221. if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));
  222. else object[propertyKey] = value;
  223. };
  224. },{"../internals/create-property-descriptor":15,"../internals/object-define-property":47,"../internals/to-primitive":73}],17:[function(require,module,exports){
  225. 'use strict';
  226. var $ = require('../internals/export');
  227. var createIteratorConstructor = require('../internals/create-iterator-constructor');
  228. var getPrototypeOf = require('../internals/object-get-prototype-of');
  229. var setPrototypeOf = require('../internals/object-set-prototype-of');
  230. var setToStringTag = require('../internals/set-to-string-tag');
  231. var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
  232. var redefine = require('../internals/redefine');
  233. var wellKnownSymbol = require('../internals/well-known-symbol');
  234. var IS_PURE = require('../internals/is-pure');
  235. var Iterators = require('../internals/iterators');
  236. var IteratorsCore = require('../internals/iterators-core');
  237. var IteratorPrototype = IteratorsCore.IteratorPrototype;
  238. var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
  239. var ITERATOR = wellKnownSymbol('iterator');
  240. var KEYS = 'keys';
  241. var VALUES = 'values';
  242. var ENTRIES = 'entries';
  243. var returnThis = function () { return this; };
  244. module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
  245. createIteratorConstructor(IteratorConstructor, NAME, next);
  246. var getIterationMethod = function (KIND) {
  247. if (KIND === DEFAULT && defaultIterator) return defaultIterator;
  248. if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];
  249. switch (KIND) {
  250. case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
  251. case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
  252. case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
  253. } return function () { return new IteratorConstructor(this); };
  254. };
  255. var TO_STRING_TAG = NAME + ' Iterator';
  256. var INCORRECT_VALUES_NAME = false;
  257. var IterablePrototype = Iterable.prototype;
  258. var nativeIterator = IterablePrototype[ITERATOR]
  259. || IterablePrototype['@@iterator']
  260. || DEFAULT && IterablePrototype[DEFAULT];
  261. var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
  262. var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
  263. var CurrentIteratorPrototype, methods, KEY;
  264. // fix native
  265. if (anyNativeIterator) {
  266. CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
  267. if (IteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
  268. if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
  269. if (setPrototypeOf) {
  270. setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
  271. } else if (typeof CurrentIteratorPrototype[ITERATOR] != 'function') {
  272. createNonEnumerableProperty(CurrentIteratorPrototype, ITERATOR, returnThis);
  273. }
  274. }
  275. // Set @@toStringTag to native iterators
  276. setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true);
  277. if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis;
  278. }
  279. }
  280. // fix Array#{values, @@iterator}.name in V8 / FF
  281. if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
  282. INCORRECT_VALUES_NAME = true;
  283. defaultIterator = function values() { return nativeIterator.call(this); };
  284. }
  285. // define iterator
  286. if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) {
  287. createNonEnumerableProperty(IterablePrototype, ITERATOR, defaultIterator);
  288. }
  289. Iterators[NAME] = defaultIterator;
  290. // export additional methods
  291. if (DEFAULT) {
  292. methods = {
  293. values: getIterationMethod(VALUES),
  294. keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
  295. entries: getIterationMethod(ENTRIES)
  296. };
  297. if (FORCED) for (KEY in methods) {
  298. if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
  299. redefine(IterablePrototype, KEY, methods[KEY]);
  300. }
  301. } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
  302. }
  303. return methods;
  304. };
  305. },{"../internals/create-iterator-constructor":13,"../internals/create-non-enumerable-property":14,"../internals/export":21,"../internals/is-pure":38,"../internals/iterators":40,"../internals/iterators-core":39,"../internals/object-get-prototype-of":51,"../internals/object-set-prototype-of":55,"../internals/redefine":59,"../internals/set-to-string-tag":62,"../internals/well-known-symbol":77}],18:[function(require,module,exports){
  306. var fails = require('../internals/fails');
  307. // Thank's IE8 for his funny defineProperty
  308. module.exports = !fails(function () {
  309. return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
  310. });
  311. },{"../internals/fails":22}],19:[function(require,module,exports){
  312. var global = require('../internals/global');
  313. var isObject = require('../internals/is-object');
  314. var document = global.document;
  315. // typeof document.createElement is 'object' in old IE
  316. var EXISTS = isObject(document) && isObject(document.createElement);
  317. module.exports = function (it) {
  318. return EXISTS ? document.createElement(it) : {};
  319. };
  320. },{"../internals/global":27,"../internals/is-object":37}],20:[function(require,module,exports){
  321. // IE8- don't enum bug keys
  322. module.exports = [
  323. 'constructor',
  324. 'hasOwnProperty',
  325. 'isPrototypeOf',
  326. 'propertyIsEnumerable',
  327. 'toLocaleString',
  328. 'toString',
  329. 'valueOf'
  330. ];
  331. },{}],21:[function(require,module,exports){
  332. var global = require('../internals/global');
  333. var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;
  334. var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
  335. var redefine = require('../internals/redefine');
  336. var setGlobal = require('../internals/set-global');
  337. var copyConstructorProperties = require('../internals/copy-constructor-properties');
  338. var isForced = require('../internals/is-forced');
  339. /*
  340. options.target - name of the target object
  341. options.global - target is the global object
  342. options.stat - export as static methods of target
  343. options.proto - export as prototype methods of target
  344. options.real - real prototype method for the `pure` version
  345. options.forced - export even if the native feature is available
  346. options.bind - bind methods to the target, required for the `pure` version
  347. options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
  348. options.unsafe - use the simple assignment of property instead of delete + defineProperty
  349. options.sham - add a flag to not completely full polyfills
  350. options.enumerable - export as enumerable property
  351. options.noTargetGet - prevent calling a getter on target
  352. */
  353. module.exports = function (options, source) {
  354. var TARGET = options.target;
  355. var GLOBAL = options.global;
  356. var STATIC = options.stat;
  357. var FORCED, target, key, targetProperty, sourceProperty, descriptor;
  358. if (GLOBAL) {
  359. target = global;
  360. } else if (STATIC) {
  361. target = global[TARGET] || setGlobal(TARGET, {});
  362. } else {
  363. target = (global[TARGET] || {}).prototype;
  364. }
  365. if (target) for (key in source) {
  366. sourceProperty = source[key];
  367. if (options.noTargetGet) {
  368. descriptor = getOwnPropertyDescriptor(target, key);
  369. targetProperty = descriptor && descriptor.value;
  370. } else targetProperty = target[key];
  371. FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
  372. // contained in target
  373. if (!FORCED && targetProperty !== undefined) {
  374. if (typeof sourceProperty === typeof targetProperty) continue;
  375. copyConstructorProperties(sourceProperty, targetProperty);
  376. }
  377. // add a flag to not completely full polyfills
  378. if (options.sham || (targetProperty && targetProperty.sham)) {
  379. createNonEnumerableProperty(sourceProperty, 'sham', true);
  380. }
  381. // extend global
  382. redefine(target, key, sourceProperty, options);
  383. }
  384. };
  385. },{"../internals/copy-constructor-properties":11,"../internals/create-non-enumerable-property":14,"../internals/global":27,"../internals/is-forced":36,"../internals/object-get-own-property-descriptor":48,"../internals/redefine":59,"../internals/set-global":61}],22:[function(require,module,exports){
  386. module.exports = function (exec) {
  387. try {
  388. return !!exec();
  389. } catch (error) {
  390. return true;
  391. }
  392. };
  393. },{}],23:[function(require,module,exports){
  394. var aFunction = require('../internals/a-function');
  395. // optional / simple context binding
  396. module.exports = function (fn, that, length) {
  397. aFunction(fn);
  398. if (that === undefined) return fn;
  399. switch (length) {
  400. case 0: return function () {
  401. return fn.call(that);
  402. };
  403. case 1: return function (a) {
  404. return fn.call(that, a);
  405. };
  406. case 2: return function (a, b) {
  407. return fn.call(that, a, b);
  408. };
  409. case 3: return function (a, b, c) {
  410. return fn.call(that, a, b, c);
  411. };
  412. }
  413. return function (/* ...args */) {
  414. return fn.apply(that, arguments);
  415. };
  416. };
  417. },{"../internals/a-function":1}],24:[function(require,module,exports){
  418. var path = require('../internals/path');
  419. var global = require('../internals/global');
  420. var aFunction = function (variable) {
  421. return typeof variable == 'function' ? variable : undefined;
  422. };
  423. module.exports = function (namespace, method) {
  424. return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace])
  425. : path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method];
  426. };
  427. },{"../internals/global":27,"../internals/path":57}],25:[function(require,module,exports){
  428. var classof = require('../internals/classof');
  429. var Iterators = require('../internals/iterators');
  430. var wellKnownSymbol = require('../internals/well-known-symbol');
  431. var ITERATOR = wellKnownSymbol('iterator');
  432. module.exports = function (it) {
  433. if (it != undefined) return it[ITERATOR]
  434. || it['@@iterator']
  435. || Iterators[classof(it)];
  436. };
  437. },{"../internals/classof":10,"../internals/iterators":40,"../internals/well-known-symbol":77}],26:[function(require,module,exports){
  438. var anObject = require('../internals/an-object');
  439. var getIteratorMethod = require('../internals/get-iterator-method');
  440. module.exports = function (it) {
  441. var iteratorMethod = getIteratorMethod(it);
  442. if (typeof iteratorMethod != 'function') {
  443. throw TypeError(String(it) + ' is not iterable');
  444. } return anObject(iteratorMethod.call(it));
  445. };
  446. },{"../internals/an-object":5,"../internals/get-iterator-method":25}],27:[function(require,module,exports){
  447. (function (global){
  448. var check = function (it) {
  449. return it && it.Math == Math && it;
  450. };
  451. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  452. module.exports =
  453. // eslint-disable-next-line no-undef
  454. check(typeof globalThis == 'object' && globalThis) ||
  455. check(typeof window == 'object' && window) ||
  456. check(typeof self == 'object' && self) ||
  457. check(typeof global == 'object' && global) ||
  458. // eslint-disable-next-line no-new-func
  459. Function('return this')();
  460. }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  461. },{}],28:[function(require,module,exports){
  462. var hasOwnProperty = {}.hasOwnProperty;
  463. module.exports = function (it, key) {
  464. return hasOwnProperty.call(it, key);
  465. };
  466. },{}],29:[function(require,module,exports){
  467. module.exports = {};
  468. },{}],30:[function(require,module,exports){
  469. var getBuiltIn = require('../internals/get-built-in');
  470. module.exports = getBuiltIn('document', 'documentElement');
  471. },{"../internals/get-built-in":24}],31:[function(require,module,exports){
  472. var DESCRIPTORS = require('../internals/descriptors');
  473. var fails = require('../internals/fails');
  474. var createElement = require('../internals/document-create-element');
  475. // Thank's IE8 for his funny defineProperty
  476. module.exports = !DESCRIPTORS && !fails(function () {
  477. return Object.defineProperty(createElement('div'), 'a', {
  478. get: function () { return 7; }
  479. }).a != 7;
  480. });
  481. },{"../internals/descriptors":18,"../internals/document-create-element":19,"../internals/fails":22}],32:[function(require,module,exports){
  482. var fails = require('../internals/fails');
  483. var classof = require('../internals/classof-raw');
  484. var split = ''.split;
  485. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  486. module.exports = fails(function () {
  487. // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
  488. // eslint-disable-next-line no-prototype-builtins
  489. return !Object('z').propertyIsEnumerable(0);
  490. }) ? function (it) {
  491. return classof(it) == 'String' ? split.call(it, '') : Object(it);
  492. } : Object;
  493. },{"../internals/classof-raw":9,"../internals/fails":22}],33:[function(require,module,exports){
  494. var store = require('../internals/shared-store');
  495. var functionToString = Function.toString;
  496. // this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper
  497. if (typeof store.inspectSource != 'function') {
  498. store.inspectSource = function (it) {
  499. return functionToString.call(it);
  500. };
  501. }
  502. module.exports = store.inspectSource;
  503. },{"../internals/shared-store":64}],34:[function(require,module,exports){
  504. var NATIVE_WEAK_MAP = require('../internals/native-weak-map');
  505. var global = require('../internals/global');
  506. var isObject = require('../internals/is-object');
  507. var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
  508. var objectHas = require('../internals/has');
  509. var sharedKey = require('../internals/shared-key');
  510. var hiddenKeys = require('../internals/hidden-keys');
  511. var WeakMap = global.WeakMap;
  512. var set, get, has;
  513. var enforce = function (it) {
  514. return has(it) ? get(it) : set(it, {});
  515. };
  516. var getterFor = function (TYPE) {
  517. return function (it) {
  518. var state;
  519. if (!isObject(it) || (state = get(it)).type !== TYPE) {
  520. throw TypeError('Incompatible receiver, ' + TYPE + ' required');
  521. } return state;
  522. };
  523. };
  524. if (NATIVE_WEAK_MAP) {
  525. var store = new WeakMap();
  526. var wmget = store.get;
  527. var wmhas = store.has;
  528. var wmset = store.set;
  529. set = function (it, metadata) {
  530. wmset.call(store, it, metadata);
  531. return metadata;
  532. };
  533. get = function (it) {
  534. return wmget.call(store, it) || {};
  535. };
  536. has = function (it) {
  537. return wmhas.call(store, it);
  538. };
  539. } else {
  540. var STATE = sharedKey('state');
  541. hiddenKeys[STATE] = true;
  542. set = function (it, metadata) {
  543. createNonEnumerableProperty(it, STATE, metadata);
  544. return metadata;
  545. };
  546. get = function (it) {
  547. return objectHas(it, STATE) ? it[STATE] : {};
  548. };
  549. has = function (it) {
  550. return objectHas(it, STATE);
  551. };
  552. }
  553. module.exports = {
  554. set: set,
  555. get: get,
  556. has: has,
  557. enforce: enforce,
  558. getterFor: getterFor
  559. };
  560. },{"../internals/create-non-enumerable-property":14,"../internals/global":27,"../internals/has":28,"../internals/hidden-keys":29,"../internals/is-object":37,"../internals/native-weak-map":43,"../internals/shared-key":63}],35:[function(require,module,exports){
  561. var wellKnownSymbol = require('../internals/well-known-symbol');
  562. var Iterators = require('../internals/iterators');
  563. var ITERATOR = wellKnownSymbol('iterator');
  564. var ArrayPrototype = Array.prototype;
  565. // check on default Array iterator
  566. module.exports = function (it) {
  567. return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);
  568. };
  569. },{"../internals/iterators":40,"../internals/well-known-symbol":77}],36:[function(require,module,exports){
  570. var fails = require('../internals/fails');
  571. var replacement = /#|\.prototype\./;
  572. var isForced = function (feature, detection) {
  573. var value = data[normalize(feature)];
  574. return value == POLYFILL ? true
  575. : value == NATIVE ? false
  576. : typeof detection == 'function' ? fails(detection)
  577. : !!detection;
  578. };
  579. var normalize = isForced.normalize = function (string) {
  580. return String(string).replace(replacement, '.').toLowerCase();
  581. };
  582. var data = isForced.data = {};
  583. var NATIVE = isForced.NATIVE = 'N';
  584. var POLYFILL = isForced.POLYFILL = 'P';
  585. module.exports = isForced;
  586. },{"../internals/fails":22}],37:[function(require,module,exports){
  587. module.exports = function (it) {
  588. return typeof it === 'object' ? it !== null : typeof it === 'function';
  589. };
  590. },{}],38:[function(require,module,exports){
  591. module.exports = false;
  592. },{}],39:[function(require,module,exports){
  593. 'use strict';
  594. var getPrototypeOf = require('../internals/object-get-prototype-of');
  595. var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
  596. var has = require('../internals/has');
  597. var wellKnownSymbol = require('../internals/well-known-symbol');
  598. var IS_PURE = require('../internals/is-pure');
  599. var ITERATOR = wellKnownSymbol('iterator');
  600. var BUGGY_SAFARI_ITERATORS = false;
  601. var returnThis = function () { return this; };
  602. // `%IteratorPrototype%` object
  603. // https://tc39.github.io/ecma262/#sec-%iteratorprototype%-object
  604. var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
  605. if ([].keys) {
  606. arrayIterator = [].keys();
  607. // Safari 8 has buggy iterators w/o `next`
  608. if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;
  609. else {
  610. PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));
  611. if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;
  612. }
  613. }
  614. if (IteratorPrototype == undefined) IteratorPrototype = {};
  615. // 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
  616. if (!IS_PURE && !has(IteratorPrototype, ITERATOR)) {
  617. createNonEnumerableProperty(IteratorPrototype, ITERATOR, returnThis);
  618. }
  619. module.exports = {
  620. IteratorPrototype: IteratorPrototype,
  621. BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS
  622. };
  623. },{"../internals/create-non-enumerable-property":14,"../internals/has":28,"../internals/is-pure":38,"../internals/object-get-prototype-of":51,"../internals/well-known-symbol":77}],40:[function(require,module,exports){
  624. arguments[4][29][0].apply(exports,arguments)
  625. },{"dup":29}],41:[function(require,module,exports){
  626. var fails = require('../internals/fails');
  627. module.exports = !!Object.getOwnPropertySymbols && !fails(function () {
  628. // Chrome 38 Symbol has incorrect toString conversion
  629. // eslint-disable-next-line no-undef
  630. return !String(Symbol());
  631. });
  632. },{"../internals/fails":22}],42:[function(require,module,exports){
  633. var fails = require('../internals/fails');
  634. var wellKnownSymbol = require('../internals/well-known-symbol');
  635. var IS_PURE = require('../internals/is-pure');
  636. var ITERATOR = wellKnownSymbol('iterator');
  637. module.exports = !fails(function () {
  638. var url = new URL('b?a=1&b=2&c=3', 'http://a');
  639. var searchParams = url.searchParams;
  640. var result = '';
  641. url.pathname = 'c%20d';
  642. searchParams.forEach(function (value, key) {
  643. searchParams['delete']('b');
  644. result += key + value;
  645. });
  646. return (IS_PURE && !url.toJSON)
  647. || !searchParams.sort
  648. || url.href !== 'http://a/c%20d?a=1&c=3'
  649. || searchParams.get('c') !== '3'
  650. || String(new URLSearchParams('?a=1')) !== 'a=1'
  651. || !searchParams[ITERATOR]
  652. // throws in Edge
  653. || new URL('https://a@b').username !== 'a'
  654. || new URLSearchParams(new URLSearchParams('a=b')).get('a') !== 'b'
  655. // not punycoded in Edge
  656. || new URL('http://тест').host !== 'xn--e1aybc'
  657. // not escaped in Chrome 62-
  658. || new URL('http://a#б').hash !== '#%D0%B1'
  659. // fails in Chrome 66-
  660. || result !== 'a1c3'
  661. // throws in Safari
  662. || new URL('http://x', undefined).host !== 'x';
  663. });
  664. },{"../internals/fails":22,"../internals/is-pure":38,"../internals/well-known-symbol":77}],43:[function(require,module,exports){
  665. var global = require('../internals/global');
  666. var inspectSource = require('../internals/inspect-source');
  667. var WeakMap = global.WeakMap;
  668. module.exports = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap));
  669. },{"../internals/global":27,"../internals/inspect-source":33}],44:[function(require,module,exports){
  670. 'use strict';
  671. var DESCRIPTORS = require('../internals/descriptors');
  672. var fails = require('../internals/fails');
  673. var objectKeys = require('../internals/object-keys');
  674. var getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols');
  675. var propertyIsEnumerableModule = require('../internals/object-property-is-enumerable');
  676. var toObject = require('../internals/to-object');
  677. var IndexedObject = require('../internals/indexed-object');
  678. var nativeAssign = Object.assign;
  679. var defineProperty = Object.defineProperty;
  680. // `Object.assign` method
  681. // https://tc39.github.io/ecma262/#sec-object.assign
  682. module.exports = !nativeAssign || fails(function () {
  683. // should have correct order of operations (Edge bug)
  684. if (DESCRIPTORS && nativeAssign({ b: 1 }, nativeAssign(defineProperty({}, 'a', {
  685. enumerable: true,
  686. get: function () {
  687. defineProperty(this, 'b', {
  688. value: 3,
  689. enumerable: false
  690. });
  691. }
  692. }), { b: 2 })).b !== 1) return true;
  693. // should work with symbols and should have deterministic property order (V8 bug)
  694. var A = {};
  695. var B = {};
  696. // eslint-disable-next-line no-undef
  697. var symbol = Symbol();
  698. var alphabet = 'abcdefghijklmnopqrst';
  699. A[symbol] = 7;
  700. alphabet.split('').forEach(function (chr) { B[chr] = chr; });
  701. return nativeAssign({}, A)[symbol] != 7 || objectKeys(nativeAssign({}, B)).join('') != alphabet;
  702. }) ? function assign(target, source) { // eslint-disable-line no-unused-vars
  703. var T = toObject(target);
  704. var argumentsLength = arguments.length;
  705. var index = 1;
  706. var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
  707. var propertyIsEnumerable = propertyIsEnumerableModule.f;
  708. while (argumentsLength > index) {
  709. var S = IndexedObject(arguments[index++]);
  710. var keys = getOwnPropertySymbols ? objectKeys(S).concat(getOwnPropertySymbols(S)) : objectKeys(S);
  711. var length = keys.length;
  712. var j = 0;
  713. var key;
  714. while (length > j) {
  715. key = keys[j++];
  716. if (!DESCRIPTORS || propertyIsEnumerable.call(S, key)) T[key] = S[key];
  717. }
  718. } return T;
  719. } : nativeAssign;
  720. },{"../internals/descriptors":18,"../internals/fails":22,"../internals/indexed-object":32,"../internals/object-get-own-property-symbols":50,"../internals/object-keys":53,"../internals/object-property-is-enumerable":54,"../internals/to-object":72}],45:[function(require,module,exports){
  721. var anObject = require('../internals/an-object');
  722. var defineProperties = require('../internals/object-define-properties');
  723. var enumBugKeys = require('../internals/enum-bug-keys');
  724. var hiddenKeys = require('../internals/hidden-keys');
  725. var html = require('../internals/html');
  726. var documentCreateElement = require('../internals/document-create-element');
  727. var sharedKey = require('../internals/shared-key');
  728. var GT = '>';
  729. var LT = '<';
  730. var PROTOTYPE = 'prototype';
  731. var SCRIPT = 'script';
  732. var IE_PROTO = sharedKey('IE_PROTO');
  733. var EmptyConstructor = function () { /* empty */ };
  734. var scriptTag = function (content) {
  735. return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
  736. };
  737. // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
  738. var NullProtoObjectViaActiveX = function (activeXDocument) {
  739. activeXDocument.write(scriptTag(''));
  740. activeXDocument.close();
  741. var temp = activeXDocument.parentWindow.Object;
  742. activeXDocument = null; // avoid memory leak
  743. return temp;
  744. };
  745. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  746. var NullProtoObjectViaIFrame = function () {
  747. // Thrash, waste and sodomy: IE GC bug
  748. var iframe = documentCreateElement('iframe');
  749. var JS = 'java' + SCRIPT + ':';
  750. var iframeDocument;
  751. iframe.style.display = 'none';
  752. html.appendChild(iframe);
  753. // https://github.com/zloirock/core-js/issues/475
  754. iframe.src = String(JS);
  755. iframeDocument = iframe.contentWindow.document;
  756. iframeDocument.open();
  757. iframeDocument.write(scriptTag('document.F=Object'));
  758. iframeDocument.close();
  759. return iframeDocument.F;
  760. };
  761. // Check for document.domain and active x support
  762. // No need to use active x approach when document.domain is not set
  763. // see https://github.com/es-shims/es5-shim/issues/150
  764. // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
  765. // avoid IE GC bug
  766. var activeXDocument;
  767. var NullProtoObject = function () {
  768. try {
  769. /* global ActiveXObject */
  770. activeXDocument = document.domain && new ActiveXObject('htmlfile');
  771. } catch (error) { /* ignore */ }
  772. NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();
  773. var length = enumBugKeys.length;
  774. while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
  775. return NullProtoObject();
  776. };
  777. hiddenKeys[IE_PROTO] = true;
  778. // `Object.create` method
  779. // https://tc39.github.io/ecma262/#sec-object.create
  780. module.exports = Object.create || function create(O, Properties) {
  781. var result;
  782. if (O !== null) {
  783. EmptyConstructor[PROTOTYPE] = anObject(O);
  784. result = new EmptyConstructor();
  785. EmptyConstructor[PROTOTYPE] = null;
  786. // add "__proto__" for Object.getPrototypeOf polyfill
  787. result[IE_PROTO] = O;
  788. } else result = NullProtoObject();
  789. return Properties === undefined ? result : defineProperties(result, Properties);
  790. };
  791. },{"../internals/an-object":5,"../internals/document-create-element":19,"../internals/enum-bug-keys":20,"../internals/hidden-keys":29,"../internals/html":30,"../internals/object-define-properties":46,"../internals/shared-key":63}],46:[function(require,module,exports){
  792. var DESCRIPTORS = require('../internals/descriptors');
  793. var definePropertyModule = require('../internals/object-define-property');
  794. var anObject = require('../internals/an-object');
  795. var objectKeys = require('../internals/object-keys');
  796. // `Object.defineProperties` method
  797. // https://tc39.github.io/ecma262/#sec-object.defineproperties
  798. module.exports = DESCRIPTORS ? Object.defineProperties : function defineProperties(O, Properties) {
  799. anObject(O);
  800. var keys = objectKeys(Properties);
  801. var length = keys.length;
  802. var index = 0;
  803. var key;
  804. while (length > index) definePropertyModule.f(O, key = keys[index++], Properties[key]);
  805. return O;
  806. };
  807. },{"../internals/an-object":5,"../internals/descriptors":18,"../internals/object-define-property":47,"../internals/object-keys":53}],47:[function(require,module,exports){
  808. var DESCRIPTORS = require('../internals/descriptors');
  809. var IE8_DOM_DEFINE = require('../internals/ie8-dom-define');
  810. var anObject = require('../internals/an-object');
  811. var toPrimitive = require('../internals/to-primitive');
  812. var nativeDefineProperty = Object.defineProperty;
  813. // `Object.defineProperty` method
  814. // https://tc39.github.io/ecma262/#sec-object.defineproperty
  815. exports.f = DESCRIPTORS ? nativeDefineProperty : function defineProperty(O, P, Attributes) {
  816. anObject(O);
  817. P = toPrimitive(P, true);
  818. anObject(Attributes);
  819. if (IE8_DOM_DEFINE) try {
  820. return nativeDefineProperty(O, P, Attributes);
  821. } catch (error) { /* empty */ }
  822. if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
  823. if ('value' in Attributes) O[P] = Attributes.value;
  824. return O;
  825. };
  826. },{"../internals/an-object":5,"../internals/descriptors":18,"../internals/ie8-dom-define":31,"../internals/to-primitive":73}],48:[function(require,module,exports){
  827. var DESCRIPTORS = require('../internals/descriptors');
  828. var propertyIsEnumerableModule = require('../internals/object-property-is-enumerable');
  829. var createPropertyDescriptor = require('../internals/create-property-descriptor');
  830. var toIndexedObject = require('../internals/to-indexed-object');
  831. var toPrimitive = require('../internals/to-primitive');
  832. var has = require('../internals/has');
  833. var IE8_DOM_DEFINE = require('../internals/ie8-dom-define');
  834. var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  835. // `Object.getOwnPropertyDescriptor` method
  836. // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor
  837. exports.f = DESCRIPTORS ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
  838. O = toIndexedObject(O);
  839. P = toPrimitive(P, true);
  840. if (IE8_DOM_DEFINE) try {
  841. return nativeGetOwnPropertyDescriptor(O, P);
  842. } catch (error) { /* empty */ }
  843. if (has(O, P)) return createPropertyDescriptor(!propertyIsEnumerableModule.f.call(O, P), O[P]);
  844. };
  845. },{"../internals/create-property-descriptor":15,"../internals/descriptors":18,"../internals/has":28,"../internals/ie8-dom-define":31,"../internals/object-property-is-enumerable":54,"../internals/to-indexed-object":69,"../internals/to-primitive":73}],49:[function(require,module,exports){
  846. var internalObjectKeys = require('../internals/object-keys-internal');
  847. var enumBugKeys = require('../internals/enum-bug-keys');
  848. var hiddenKeys = enumBugKeys.concat('length', 'prototype');
  849. // `Object.getOwnPropertyNames` method
  850. // https://tc39.github.io/ecma262/#sec-object.getownpropertynames
  851. exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  852. return internalObjectKeys(O, hiddenKeys);
  853. };
  854. },{"../internals/enum-bug-keys":20,"../internals/object-keys-internal":52}],50:[function(require,module,exports){
  855. exports.f = Object.getOwnPropertySymbols;
  856. },{}],51:[function(require,module,exports){
  857. var has = require('../internals/has');
  858. var toObject = require('../internals/to-object');
  859. var sharedKey = require('../internals/shared-key');
  860. var CORRECT_PROTOTYPE_GETTER = require('../internals/correct-prototype-getter');
  861. var IE_PROTO = sharedKey('IE_PROTO');
  862. var ObjectPrototype = Object.prototype;
  863. // `Object.getPrototypeOf` method
  864. // https://tc39.github.io/ecma262/#sec-object.getprototypeof
  865. module.exports = CORRECT_PROTOTYPE_GETTER ? Object.getPrototypeOf : function (O) {
  866. O = toObject(O);
  867. if (has(O, IE_PROTO)) return O[IE_PROTO];
  868. if (typeof O.constructor == 'function' && O instanceof O.constructor) {
  869. return O.constructor.prototype;
  870. } return O instanceof Object ? ObjectPrototype : null;
  871. };
  872. },{"../internals/correct-prototype-getter":12,"../internals/has":28,"../internals/shared-key":63,"../internals/to-object":72}],52:[function(require,module,exports){
  873. var has = require('../internals/has');
  874. var toIndexedObject = require('../internals/to-indexed-object');
  875. var indexOf = require('../internals/array-includes').indexOf;
  876. var hiddenKeys = require('../internals/hidden-keys');
  877. module.exports = function (object, names) {
  878. var O = toIndexedObject(object);
  879. var i = 0;
  880. var result = [];
  881. var key;
  882. for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);
  883. // Don't enum bug & hidden keys
  884. while (names.length > i) if (has(O, key = names[i++])) {
  885. ~indexOf(result, key) || result.push(key);
  886. }
  887. return result;
  888. };
  889. },{"../internals/array-includes":7,"../internals/has":28,"../internals/hidden-keys":29,"../internals/to-indexed-object":69}],53:[function(require,module,exports){
  890. var internalObjectKeys = require('../internals/object-keys-internal');
  891. var enumBugKeys = require('../internals/enum-bug-keys');
  892. // `Object.keys` method
  893. // https://tc39.github.io/ecma262/#sec-object.keys
  894. module.exports = Object.keys || function keys(O) {
  895. return internalObjectKeys(O, enumBugKeys);
  896. };
  897. },{"../internals/enum-bug-keys":20,"../internals/object-keys-internal":52}],54:[function(require,module,exports){
  898. 'use strict';
  899. var nativePropertyIsEnumerable = {}.propertyIsEnumerable;
  900. var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  901. // Nashorn ~ JDK8 bug
  902. var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);
  903. // `Object.prototype.propertyIsEnumerable` method implementation
  904. // https://tc39.github.io/ecma262/#sec-object.prototype.propertyisenumerable
  905. exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
  906. var descriptor = getOwnPropertyDescriptor(this, V);
  907. return !!descriptor && descriptor.enumerable;
  908. } : nativePropertyIsEnumerable;
  909. },{}],55:[function(require,module,exports){
  910. var anObject = require('../internals/an-object');
  911. var aPossiblePrototype = require('../internals/a-possible-prototype');
  912. // `Object.setPrototypeOf` method
  913. // https://tc39.github.io/ecma262/#sec-object.setprototypeof
  914. // Works with __proto__ only. Old v8 can't work with null proto objects.
  915. /* eslint-disable no-proto */
  916. module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {
  917. var CORRECT_SETTER = false;
  918. var test = {};
  919. var setter;
  920. try {
  921. setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set;
  922. setter.call(test, []);
  923. CORRECT_SETTER = test instanceof Array;
  924. } catch (error) { /* empty */ }
  925. return function setPrototypeOf(O, proto) {
  926. anObject(O);
  927. aPossiblePrototype(proto);
  928. if (CORRECT_SETTER) setter.call(O, proto);
  929. else O.__proto__ = proto;
  930. return O;
  931. };
  932. }() : undefined);
  933. },{"../internals/a-possible-prototype":2,"../internals/an-object":5}],56:[function(require,module,exports){
  934. var getBuiltIn = require('../internals/get-built-in');
  935. var getOwnPropertyNamesModule = require('../internals/object-get-own-property-names');
  936. var getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols');
  937. var anObject = require('../internals/an-object');
  938. // all object keys, includes non-enumerable and symbols
  939. module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
  940. var keys = getOwnPropertyNamesModule.f(anObject(it));
  941. var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
  942. return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
  943. };
  944. },{"../internals/an-object":5,"../internals/get-built-in":24,"../internals/object-get-own-property-names":49,"../internals/object-get-own-property-symbols":50}],57:[function(require,module,exports){
  945. var global = require('../internals/global');
  946. module.exports = global;
  947. },{"../internals/global":27}],58:[function(require,module,exports){
  948. var redefine = require('../internals/redefine');
  949. module.exports = function (target, src, options) {
  950. for (var key in src) redefine(target, key, src[key], options);
  951. return target;
  952. };
  953. },{"../internals/redefine":59}],59:[function(require,module,exports){
  954. var global = require('../internals/global');
  955. var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
  956. var has = require('../internals/has');
  957. var setGlobal = require('../internals/set-global');
  958. var inspectSource = require('../internals/inspect-source');
  959. var InternalStateModule = require('../internals/internal-state');
  960. var getInternalState = InternalStateModule.get;
  961. var enforceInternalState = InternalStateModule.enforce;
  962. var TEMPLATE = String(String).split('String');
  963. (module.exports = function (O, key, value, options) {
  964. var unsafe = options ? !!options.unsafe : false;
  965. var simple = options ? !!options.enumerable : false;
  966. var noTargetGet = options ? !!options.noTargetGet : false;
  967. if (typeof value == 'function') {
  968. if (typeof key == 'string' && !has(value, 'name')) createNonEnumerableProperty(value, 'name', key);
  969. enforceInternalState(value).source = TEMPLATE.join(typeof key == 'string' ? key : '');
  970. }
  971. if (O === global) {
  972. if (simple) O[key] = value;
  973. else setGlobal(key, value);
  974. return;
  975. } else if (!unsafe) {
  976. delete O[key];
  977. } else if (!noTargetGet && O[key]) {
  978. simple = true;
  979. }
  980. if (simple) O[key] = value;
  981. else createNonEnumerableProperty(O, key, value);
  982. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  983. })(Function.prototype, 'toString', function toString() {
  984. return typeof this == 'function' && getInternalState(this).source || inspectSource(this);
  985. });
  986. },{"../internals/create-non-enumerable-property":14,"../internals/global":27,"../internals/has":28,"../internals/inspect-source":33,"../internals/internal-state":34,"../internals/set-global":61}],60:[function(require,module,exports){
  987. // `RequireObjectCoercible` abstract operation
  988. // https://tc39.github.io/ecma262/#sec-requireobjectcoercible
  989. module.exports = function (it) {
  990. if (it == undefined) throw TypeError("Can't call method on " + it);
  991. return it;
  992. };
  993. },{}],61:[function(require,module,exports){
  994. var global = require('../internals/global');
  995. var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
  996. module.exports = function (key, value) {
  997. try {
  998. createNonEnumerableProperty(global, key, value);
  999. } catch (error) {
  1000. global[key] = value;
  1001. } return value;
  1002. };
  1003. },{"../internals/create-non-enumerable-property":14,"../internals/global":27}],62:[function(require,module,exports){
  1004. var defineProperty = require('../internals/object-define-property').f;
  1005. var has = require('../internals/has');
  1006. var wellKnownSymbol = require('../internals/well-known-symbol');
  1007. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  1008. module.exports = function (it, TAG, STATIC) {
  1009. if (it && !has(it = STATIC ? it : it.prototype, TO_STRING_TAG)) {
  1010. defineProperty(it, TO_STRING_TAG, { configurable: true, value: TAG });
  1011. }
  1012. };
  1013. },{"../internals/has":28,"../internals/object-define-property":47,"../internals/well-known-symbol":77}],63:[function(require,module,exports){
  1014. var shared = require('../internals/shared');
  1015. var uid = require('../internals/uid');
  1016. var keys = shared('keys');
  1017. module.exports = function (key) {
  1018. return keys[key] || (keys[key] = uid(key));
  1019. };
  1020. },{"../internals/shared":65,"../internals/uid":75}],64:[function(require,module,exports){
  1021. var global = require('../internals/global');
  1022. var setGlobal = require('../internals/set-global');
  1023. var SHARED = '__core-js_shared__';
  1024. var store = global[SHARED] || setGlobal(SHARED, {});
  1025. module.exports = store;
  1026. },{"../internals/global":27,"../internals/set-global":61}],65:[function(require,module,exports){
  1027. var IS_PURE = require('../internals/is-pure');
  1028. var store = require('../internals/shared-store');
  1029. (module.exports = function (key, value) {
  1030. return store[key] || (store[key] = value !== undefined ? value : {});
  1031. })('versions', []).push({
  1032. version: '3.6.4',
  1033. mode: IS_PURE ? 'pure' : 'global',
  1034. copyright: '© 2020 Denis Pushkarev (zloirock.ru)'
  1035. });
  1036. },{"../internals/is-pure":38,"../internals/shared-store":64}],66:[function(require,module,exports){
  1037. var toInteger = require('../internals/to-integer');
  1038. var requireObjectCoercible = require('../internals/require-object-coercible');
  1039. // `String.prototype.{ codePointAt, at }` methods implementation
  1040. var createMethod = function (CONVERT_TO_STRING) {
  1041. return function ($this, pos) {
  1042. var S = String(requireObjectCoercible($this));
  1043. var position = toInteger(pos);
  1044. var size = S.length;
  1045. var first, second;
  1046. if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
  1047. first = S.charCodeAt(position);
  1048. return first < 0xD800 || first > 0xDBFF || position + 1 === size
  1049. || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF
  1050. ? CONVERT_TO_STRING ? S.charAt(position) : first
  1051. : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
  1052. };
  1053. };
  1054. module.exports = {
  1055. // `String.prototype.codePointAt` method
  1056. // https://tc39.github.io/ecma262/#sec-string.prototype.codepointat
  1057. codeAt: createMethod(false),
  1058. // `String.prototype.at` method
  1059. // https://github.com/mathiasbynens/String.prototype.at
  1060. charAt: createMethod(true)
  1061. };
  1062. },{"../internals/require-object-coercible":60,"../internals/to-integer":70}],67:[function(require,module,exports){
  1063. 'use strict';
  1064. // based on https://github.com/bestiejs/punycode.js/blob/master/punycode.js
  1065. var maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1
  1066. var base = 36;
  1067. var tMin = 1;
  1068. var tMax = 26;
  1069. var skew = 38;
  1070. var damp = 700;
  1071. var initialBias = 72;
  1072. var initialN = 128; // 0x80
  1073. var delimiter = '-'; // '\x2D'
  1074. var regexNonASCII = /[^\0-\u007E]/; // non-ASCII chars
  1075. var regexSeparators = /[.\u3002\uFF0E\uFF61]/g; // RFC 3490 separators
  1076. var OVERFLOW_ERROR = 'Overflow: input needs wider integers to process';
  1077. var baseMinusTMin = base - tMin;
  1078. var floor = Math.floor;
  1079. var stringFromCharCode = String.fromCharCode;
  1080. /**
  1081. * Creates an array containing the numeric code points of each Unicode
  1082. * character in the string. While JavaScript uses UCS-2 internally,
  1083. * this function will convert a pair of surrogate halves (each of which
  1084. * UCS-2 exposes as separate characters) into a single code point,
  1085. * matching UTF-16.
  1086. */
  1087. var ucs2decode = function (string) {
  1088. var output = [];
  1089. var counter = 0;
  1090. var length = string.length;
  1091. while (counter < length) {
  1092. var value = string.charCodeAt(counter++);
  1093. if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
  1094. // It's a high surrogate, and there is a next character.
  1095. var extra = string.charCodeAt(counter++);
  1096. if ((extra & 0xFC00) == 0xDC00) { // Low surrogate.
  1097. output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
  1098. } else {
  1099. // It's an unmatched surrogate; only append this code unit, in case the
  1100. // next code unit is the high surrogate of a surrogate pair.
  1101. output.push(value);
  1102. counter--;
  1103. }
  1104. } else {
  1105. output.push(value);
  1106. }
  1107. }
  1108. return output;
  1109. };
  1110. /**
  1111. * Converts a digit/integer into a basic code point.
  1112. */
  1113. var digitToBasic = function (digit) {
  1114. // 0..25 map to ASCII a..z or A..Z
  1115. // 26..35 map to ASCII 0..9
  1116. return digit + 22 + 75 * (digit < 26);
  1117. };
  1118. /**
  1119. * Bias adaptation function as per section 3.4 of RFC 3492.
  1120. * https://tools.ietf.org/html/rfc3492#section-3.4
  1121. */
  1122. var adapt = function (delta, numPoints, firstTime) {
  1123. var k = 0;
  1124. delta = firstTime ? floor(delta / damp) : delta >> 1;
  1125. delta += floor(delta / numPoints);
  1126. for (; delta > baseMinusTMin * tMax >> 1; k += base) {
  1127. delta = floor(delta / baseMinusTMin);
  1128. }
  1129. return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
  1130. };
  1131. /**
  1132. * Converts a string of Unicode symbols (e.g. a domain name label) to a
  1133. * Punycode string of ASCII-only symbols.
  1134. */
  1135. // eslint-disable-next-line max-statements
  1136. var encode = function (input) {
  1137. var output = [];
  1138. // Convert the input in UCS-2 to an array of Unicode code points.
  1139. input = ucs2decode(input);
  1140. // Cache the length.
  1141. var inputLength = input.length;
  1142. // Initialize the state.
  1143. var n = initialN;
  1144. var delta = 0;
  1145. var bias = initialBias;
  1146. var i, currentValue;
  1147. // Handle the basic code points.
  1148. for (i = 0; i < input.length; i++) {
  1149. currentValue = input[i];
  1150. if (currentValue < 0x80) {
  1151. output.push(stringFromCharCode(currentValue));
  1152. }
  1153. }
  1154. var basicLength = output.length; // number of basic code points.
  1155. var handledCPCount = basicLength; // number of code points that have been handled;
  1156. // Finish the basic string with a delimiter unless it's empty.
  1157. if (basicLength) {
  1158. output.push(delimiter);
  1159. }
  1160. // Main encoding loop:
  1161. while (handledCPCount < inputLength) {
  1162. // All non-basic code points < n have been handled already. Find the next larger one:
  1163. var m = maxInt;
  1164. for (i = 0; i < input.length; i++) {
  1165. currentValue = input[i];
  1166. if (currentValue >= n && currentValue < m) {
  1167. m = currentValue;
  1168. }
  1169. }
  1170. // Increase `delta` enough to advance the decoder's <n,i> state to <m,0>, but guard against overflow.
  1171. var handledCPCountPlusOne = handledCPCount + 1;
  1172. if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
  1173. throw RangeError(OVERFLOW_ERROR);
  1174. }
  1175. delta += (m - n) * handledCPCountPlusOne;
  1176. n = m;
  1177. for (i = 0; i < input.length; i++) {
  1178. currentValue = input[i];
  1179. if (currentValue < n && ++delta > maxInt) {
  1180. throw RangeError(OVERFLOW_ERROR);
  1181. }
  1182. if (currentValue == n) {
  1183. // Represent delta as a generalized variable-length integer.
  1184. var q = delta;
  1185. for (var k = base; /* no condition */; k += base) {
  1186. var t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
  1187. if (q < t) break;
  1188. var qMinusT = q - t;
  1189. var baseMinusT = base - t;
  1190. output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT)));
  1191. q = floor(qMinusT / baseMinusT);
  1192. }
  1193. output.push(stringFromCharCode(digitToBasic(q)));
  1194. bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
  1195. delta = 0;
  1196. ++handledCPCount;
  1197. }
  1198. }
  1199. ++delta;
  1200. ++n;
  1201. }
  1202. return output.join('');
  1203. };
  1204. module.exports = function (input) {
  1205. var encoded = [];
  1206. var labels = input.toLowerCase().replace(regexSeparators, '\u002E').split('.');
  1207. var i, label;
  1208. for (i = 0; i < labels.length; i++) {
  1209. label = labels[i];
  1210. encoded.push(regexNonASCII.test(label) ? 'xn--' + encode(label) : label);
  1211. }
  1212. return encoded.join('.');
  1213. };
  1214. },{}],68:[function(require,module,exports){
  1215. var toInteger = require('../internals/to-integer');
  1216. var max = Math.max;
  1217. var min = Math.min;
  1218. // Helper for a popular repeating case of the spec:
  1219. // Let integer be ? ToInteger(index).
  1220. // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
  1221. module.exports = function (index, length) {
  1222. var integer = toInteger(index);
  1223. return integer < 0 ? max(integer + length, 0) : min(integer, length);
  1224. };
  1225. },{"../internals/to-integer":70}],69:[function(require,module,exports){
  1226. // toObject with fallback for non-array-like ES3 strings
  1227. var IndexedObject = require('../internals/indexed-object');
  1228. var requireObjectCoercible = require('../internals/require-object-coercible');
  1229. module.exports = function (it) {
  1230. return IndexedObject(requireObjectCoercible(it));
  1231. };
  1232. },{"../internals/indexed-object":32,"../internals/require-object-coercible":60}],70:[function(require,module,exports){
  1233. var ceil = Math.ceil;
  1234. var floor = Math.floor;
  1235. // `ToInteger` abstract operation
  1236. // https://tc39.github.io/ecma262/#sec-tointeger
  1237. module.exports = function (argument) {
  1238. return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
  1239. };
  1240. },{}],71:[function(require,module,exports){
  1241. var toInteger = require('../internals/to-integer');
  1242. var min = Math.min;
  1243. // `ToLength` abstract operation
  1244. // https://tc39.github.io/ecma262/#sec-tolength
  1245. module.exports = function (argument) {
  1246. return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
  1247. };
  1248. },{"../internals/to-integer":70}],72:[function(require,module,exports){
  1249. var requireObjectCoercible = require('../internals/require-object-coercible');
  1250. // `ToObject` abstract operation
  1251. // https://tc39.github.io/ecma262/#sec-toobject
  1252. module.exports = function (argument) {
  1253. return Object(requireObjectCoercible(argument));
  1254. };
  1255. },{"../internals/require-object-coercible":60}],73:[function(require,module,exports){
  1256. var isObject = require('../internals/is-object');
  1257. // `ToPrimitive` abstract operation
  1258. // https://tc39.github.io/ecma262/#sec-toprimitive
  1259. // instead of the ES6 spec version, we didn't implement @@toPrimitive case
  1260. // and the second argument - flag - preferred type is a string
  1261. module.exports = function (input, PREFERRED_STRING) {
  1262. if (!isObject(input)) return input;
  1263. var fn, val;
  1264. if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
  1265. if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;
  1266. if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
  1267. throw TypeError("Can't convert object to primitive value");
  1268. };
  1269. },{"../internals/is-object":37}],74:[function(require,module,exports){
  1270. var wellKnownSymbol = require('../internals/well-known-symbol');
  1271. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  1272. var test = {};
  1273. test[TO_STRING_TAG] = 'z';
  1274. module.exports = String(test) === '[object z]';
  1275. },{"../internals/well-known-symbol":77}],75:[function(require,module,exports){
  1276. var id = 0;
  1277. var postfix = Math.random();
  1278. module.exports = function (key) {
  1279. return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
  1280. };
  1281. },{}],76:[function(require,module,exports){
  1282. var NATIVE_SYMBOL = require('../internals/native-symbol');
  1283. module.exports = NATIVE_SYMBOL
  1284. // eslint-disable-next-line no-undef
  1285. && !Symbol.sham
  1286. // eslint-disable-next-line no-undef
  1287. && typeof Symbol.iterator == 'symbol';
  1288. },{"../internals/native-symbol":41}],77:[function(require,module,exports){
  1289. var global = require('../internals/global');
  1290. var shared = require('../internals/shared');
  1291. var has = require('../internals/has');
  1292. var uid = require('../internals/uid');
  1293. var NATIVE_SYMBOL = require('../internals/native-symbol');
  1294. var USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid');
  1295. var WellKnownSymbolsStore = shared('wks');
  1296. var Symbol = global.Symbol;
  1297. var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid;
  1298. module.exports = function (name) {
  1299. if (!has(WellKnownSymbolsStore, name)) {
  1300. if (NATIVE_SYMBOL && has(Symbol, name)) WellKnownSymbolsStore[name] = Symbol[name];
  1301. else WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
  1302. } return WellKnownSymbolsStore[name];
  1303. };
  1304. },{"../internals/global":27,"../internals/has":28,"../internals/native-symbol":41,"../internals/shared":65,"../internals/uid":75,"../internals/use-symbol-as-uid":76}],78:[function(require,module,exports){
  1305. 'use strict';
  1306. var toIndexedObject = require('../internals/to-indexed-object');
  1307. var addToUnscopables = require('../internals/add-to-unscopables');
  1308. var Iterators = require('../internals/iterators');
  1309. var InternalStateModule = require('../internals/internal-state');
  1310. var defineIterator = require('../internals/define-iterator');
  1311. var ARRAY_ITERATOR = 'Array Iterator';
  1312. var setInternalState = InternalStateModule.set;
  1313. var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);
  1314. // `Array.prototype.entries` method
  1315. // https://tc39.github.io/ecma262/#sec-array.prototype.entries
  1316. // `Array.prototype.keys` method
  1317. // https://tc39.github.io/ecma262/#sec-array.prototype.keys
  1318. // `Array.prototype.values` method
  1319. // https://tc39.github.io/ecma262/#sec-array.prototype.values
  1320. // `Array.prototype[@@iterator]` method
  1321. // https://tc39.github.io/ecma262/#sec-array.prototype-@@iterator
  1322. // `CreateArrayIterator` internal method
  1323. // https://tc39.github.io/ecma262/#sec-createarrayiterator
  1324. module.exports = defineIterator(Array, 'Array', function (iterated, kind) {
  1325. setInternalState(this, {
  1326. type: ARRAY_ITERATOR,
  1327. target: toIndexedObject(iterated), // target
  1328. index: 0, // next index
  1329. kind: kind // kind
  1330. });
  1331. // `%ArrayIteratorPrototype%.next` method
  1332. // https://tc39.github.io/ecma262/#sec-%arrayiteratorprototype%.next
  1333. }, function () {
  1334. var state = getInternalState(this);
  1335. var target = state.target;
  1336. var kind = state.kind;
  1337. var index = state.index++;
  1338. if (!target || index >= target.length) {
  1339. state.target = undefined;
  1340. return { value: undefined, done: true };
  1341. }
  1342. if (kind == 'keys') return { value: index, done: false };
  1343. if (kind == 'values') return { value: target[index], done: false };
  1344. return { value: [index, target[index]], done: false };
  1345. }, 'values');
  1346. // argumentsList[@@iterator] is %ArrayProto_values%
  1347. // https://tc39.github.io/ecma262/#sec-createunmappedargumentsobject
  1348. // https://tc39.github.io/ecma262/#sec-createmappedargumentsobject
  1349. Iterators.Arguments = Iterators.Array;
  1350. // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
  1351. addToUnscopables('keys');
  1352. addToUnscopables('values');
  1353. addToUnscopables('entries');
  1354. },{"../internals/add-to-unscopables":3,"../internals/define-iterator":17,"../internals/internal-state":34,"../internals/iterators":40,"../internals/to-indexed-object":69}],79:[function(require,module,exports){
  1355. 'use strict';
  1356. var charAt = require('../internals/string-multibyte').charAt;
  1357. var InternalStateModule = require('../internals/internal-state');
  1358. var defineIterator = require('../internals/define-iterator');
  1359. var STRING_ITERATOR = 'String Iterator';
  1360. var setInternalState = InternalStateModule.set;
  1361. var getInternalState = InternalStateModule.getterFor(STRING_ITERATOR);
  1362. // `String.prototype[@@iterator]` method
  1363. // https://tc39.github.io/ecma262/#sec-string.prototype-@@iterator
  1364. defineIterator(String, 'String', function (iterated) {
  1365. setInternalState(this, {
  1366. type: STRING_ITERATOR,
  1367. string: String(iterated),
  1368. index: 0
  1369. });
  1370. // `%StringIteratorPrototype%.next` method
  1371. // https://tc39.github.io/ecma262/#sec-%stringiteratorprototype%.next
  1372. }, function next() {
  1373. var state = getInternalState(this);
  1374. var string = state.string;
  1375. var index = state.index;
  1376. var point;
  1377. if (index >= string.length) return { value: undefined, done: true };
  1378. point = charAt(string, index);
  1379. state.index += point.length;
  1380. return { value: point, done: false };
  1381. });
  1382. },{"../internals/define-iterator":17,"../internals/internal-state":34,"../internals/string-multibyte":66}],80:[function(require,module,exports){
  1383. 'use strict';
  1384. // TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env`
  1385. require('../modules/es.array.iterator');
  1386. var $ = require('../internals/export');
  1387. var getBuiltIn = require('../internals/get-built-in');
  1388. var USE_NATIVE_URL = require('../internals/native-url');
  1389. var redefine = require('../internals/redefine');
  1390. var redefineAll = require('../internals/redefine-all');
  1391. var setToStringTag = require('../internals/set-to-string-tag');
  1392. var createIteratorConstructor = require('../internals/create-iterator-constructor');
  1393. var InternalStateModule = require('../internals/internal-state');
  1394. var anInstance = require('../internals/an-instance');
  1395. var hasOwn = require('../internals/has');
  1396. var bind = require('../internals/function-bind-context');
  1397. var classof = require('../internals/classof');
  1398. var anObject = require('../internals/an-object');
  1399. var isObject = require('../internals/is-object');
  1400. var create = require('../internals/object-create');
  1401. var createPropertyDescriptor = require('../internals/create-property-descriptor');
  1402. var getIterator = require('../internals/get-iterator');
  1403. var getIteratorMethod = require('../internals/get-iterator-method');
  1404. var wellKnownSymbol = require('../internals/well-known-symbol');
  1405. var $fetch = getBuiltIn('fetch');
  1406. var Headers = getBuiltIn('Headers');
  1407. var ITERATOR = wellKnownSymbol('iterator');
  1408. var URL_SEARCH_PARAMS = 'URLSearchParams';
  1409. var URL_SEARCH_PARAMS_ITERATOR = URL_SEARCH_PARAMS + 'Iterator';
  1410. var setInternalState = InternalStateModule.set;
  1411. var getInternalParamsState = InternalStateModule.getterFor(URL_SEARCH_PARAMS);
  1412. var getInternalIteratorState = InternalStateModule.getterFor(URL_SEARCH_PARAMS_ITERATOR);
  1413. var plus = /\+/g;
  1414. var sequences = Array(4);
  1415. var percentSequence = function (bytes) {
  1416. return sequences[bytes - 1] || (sequences[bytes - 1] = RegExp('((?:%[\\da-f]{2}){' + bytes + '})', 'gi'));
  1417. };
  1418. var percentDecode = function (sequence) {
  1419. try {
  1420. return decodeURIComponent(sequence);
  1421. } catch (error) {
  1422. return sequence;
  1423. }
  1424. };
  1425. var deserialize = function (it) {
  1426. var result = it.replace(plus, ' ');
  1427. var bytes = 4;
  1428. try {
  1429. return decodeURIComponent(result);
  1430. } catch (error) {
  1431. while (bytes) {
  1432. result = result.replace(percentSequence(bytes--), percentDecode);
  1433. }
  1434. return result;
  1435. }
  1436. };
  1437. var find = /[!'()~]|%20/g;
  1438. var replace = {
  1439. '!': '%21',
  1440. "'": '%27',
  1441. '(': '%28',
  1442. ')': '%29',
  1443. '~': '%7E',
  1444. '%20': '+'
  1445. };
  1446. var replacer = function (match) {
  1447. return replace[match];
  1448. };
  1449. var serialize = function (it) {
  1450. return encodeURIComponent(it).replace(find, replacer);
  1451. };
  1452. var parseSearchParams = function (result, query) {
  1453. if (query) {
  1454. var attributes = query.split('&');
  1455. var index = 0;
  1456. var attribute, entry;
  1457. while (index < attributes.length) {
  1458. attribute = attributes[index++];
  1459. if (attribute.length) {
  1460. entry = attribute.split('=');
  1461. result.push({
  1462. key: deserialize(entry.shift()),
  1463. value: deserialize(entry.join('='))
  1464. });
  1465. }
  1466. }
  1467. }
  1468. };
  1469. var updateSearchParams = function (query) {
  1470. this.entries.length = 0;
  1471. parseSearchParams(this.entries, query);
  1472. };
  1473. var validateArgumentsLength = function (passed, required) {
  1474. if (passed < required) throw TypeError('Not enough arguments');
  1475. };
  1476. var URLSearchParamsIterator = createIteratorConstructor(function Iterator(params, kind) {
  1477. setInternalState(this, {
  1478. type: URL_SEARCH_PARAMS_ITERATOR,
  1479. iterator: getIterator(getInternalParamsState(params).entries),
  1480. kind: kind
  1481. });
  1482. }, 'Iterator', function next() {
  1483. var state = getInternalIteratorState(this);
  1484. var kind = state.kind;
  1485. var step = state.iterator.next();
  1486. var entry = step.value;
  1487. if (!step.done) {
  1488. step.value = kind === 'keys' ? entry.key : kind === 'values' ? entry.value : [entry.key, entry.value];
  1489. } return step;
  1490. });
  1491. // `URLSearchParams` constructor
  1492. // https://url.spec.whatwg.org/#interface-urlsearchparams
  1493. var URLSearchParamsConstructor = function URLSearchParams(/* init */) {
  1494. anInstance(this, URLSearchParamsConstructor, URL_SEARCH_PARAMS);
  1495. var init = arguments.length > 0 ? arguments[0] : undefined;
  1496. var that = this;
  1497. var entries = [];
  1498. var iteratorMethod, iterator, next, step, entryIterator, entryNext, first, second, key;
  1499. setInternalState(that, {
  1500. type: URL_SEARCH_PARAMS,
  1501. entries: entries,
  1502. updateURL: function () { /* empty */ },
  1503. updateSearchParams: updateSearchParams
  1504. });
  1505. if (init !== undefined) {
  1506. if (isObject(init)) {
  1507. iteratorMethod = getIteratorMethod(init);
  1508. if (typeof iteratorMethod === 'function') {
  1509. iterator = iteratorMethod.call(init);
  1510. next = iterator.next;
  1511. while (!(step = next.call(iterator)).done) {
  1512. entryIterator = getIterator(anObject(step.value));
  1513. entryNext = entryIterator.next;
  1514. if (
  1515. (first = entryNext.call(entryIterator)).done ||
  1516. (second = entryNext.call(entryIterator)).done ||
  1517. !entryNext.call(entryIterator).done
  1518. ) throw TypeError('Expected sequence with length 2');
  1519. entries.push({ key: first.value + '', value: second.value + '' });
  1520. }
  1521. } else for (key in init) if (hasOwn(init, key)) entries.push({ key: key, value: init[key] + '' });
  1522. } else {
  1523. parseSearchParams(entries, typeof init === 'string' ? init.charAt(0) === '?' ? init.slice(1) : init : init + '');
  1524. }
  1525. }
  1526. };
  1527. var URLSearchParamsPrototype = URLSearchParamsConstructor.prototype;
  1528. redefineAll(URLSearchParamsPrototype, {
  1529. // `URLSearchParams.prototype.appent` method
  1530. // https://url.spec.whatwg.org/#dom-urlsearchparams-append
  1531. append: function append(name, value) {
  1532. validateArgumentsLength(arguments.length, 2);
  1533. var state = getInternalParamsState(this);
  1534. state.entries.push({ key: name + '', value: value + '' });
  1535. state.updateURL();
  1536. },
  1537. // `URLSearchParams.prototype.delete` method
  1538. // https://url.spec.whatwg.org/#dom-urlsearchparams-delete
  1539. 'delete': function (name) {
  1540. validateArgumentsLength(arguments.length, 1);
  1541. var state = getInternalParamsState(this);
  1542. var entries = state.entries;
  1543. var key = name + '';
  1544. var index = 0;
  1545. while (index < entries.length) {
  1546. if (entries[index].key === key) entries.splice(index, 1);
  1547. else index++;
  1548. }
  1549. state.updateURL();
  1550. },
  1551. // `URLSearchParams.prototype.get` method
  1552. // https://url.spec.whatwg.org/#dom-urlsearchparams-get
  1553. get: function get(name) {
  1554. validateArgumentsLength(arguments.length, 1);
  1555. var entries = getInternalParamsState(this).entries;
  1556. var key = name + '';
  1557. var index = 0;
  1558. for (; index < entries.length; index++) {
  1559. if (entries[index].key === key) return entries[index].value;
  1560. }
  1561. return null;
  1562. },
  1563. // `URLSearchParams.prototype.getAll` method
  1564. // https://url.spec.whatwg.org/#dom-urlsearchparams-getall
  1565. getAll: function getAll(name) {
  1566. validateArgumentsLength(arguments.length, 1);
  1567. var entries = getInternalParamsState(this).entries;
  1568. var key = name + '';
  1569. var result = [];
  1570. var index = 0;
  1571. for (; index < entries.length; index++) {
  1572. if (entries[index].key === key) result.push(entries[index].value);
  1573. }
  1574. return result;
  1575. },
  1576. // `URLSearchParams.prototype.has` method
  1577. // https://url.spec.whatwg.org/#dom-urlsearchparams-has
  1578. has: function has(name) {
  1579. validateArgumentsLength(arguments.length, 1);
  1580. var entries = getInternalParamsState(this).entries;
  1581. var key = name + '';
  1582. var index = 0;
  1583. while (index < entries.length) {
  1584. if (entries[index++].key === key) return true;
  1585. }
  1586. return false;
  1587. },
  1588. // `URLSearchParams.prototype.set` method
  1589. // https://url.spec.whatwg.org/#dom-urlsearchparams-set
  1590. set: function set(name, value) {
  1591. validateArgumentsLength(arguments.length, 1);
  1592. var state = getInternalParamsState(this);
  1593. var entries = state.entries;
  1594. var found = false;
  1595. var key = name + '';
  1596. var val = value + '';
  1597. var index = 0;
  1598. var entry;
  1599. for (; index < entries.length; index++) {
  1600. entry = entries[index];
  1601. if (entry.key === key) {
  1602. if (found) entries.splice(index--, 1);
  1603. else {
  1604. found = true;
  1605. entry.value = val;
  1606. }
  1607. }
  1608. }
  1609. if (!found) entries.push({ key: key, value: val });
  1610. state.updateURL();
  1611. },
  1612. // `URLSearchParams.prototype.sort` method
  1613. // https://url.spec.whatwg.org/#dom-urlsearchparams-sort
  1614. sort: function sort() {
  1615. var state = getInternalParamsState(this);
  1616. var entries = state.entries;
  1617. // Array#sort is not stable in some engines
  1618. var slice = entries.slice();
  1619. var entry, entriesIndex, sliceIndex;
  1620. entries.length = 0;
  1621. for (sliceIndex = 0; sliceIndex < slice.length; sliceIndex++) {
  1622. entry = slice[sliceIndex];
  1623. for (entriesIndex = 0; entriesIndex < sliceIndex; entriesIndex++) {
  1624. if (entries[entriesIndex].key > entry.key) {
  1625. entries.splice(entriesIndex, 0, entry);
  1626. break;
  1627. }
  1628. }
  1629. if (entriesIndex === sliceIndex) entries.push(entry);
  1630. }
  1631. state.updateURL();
  1632. },
  1633. // `URLSearchParams.prototype.forEach` method
  1634. forEach: function forEach(callback /* , thisArg */) {
  1635. var entries = getInternalParamsState(this).entries;
  1636. var boundFunction = bind(callback, arguments.length > 1 ? arguments[1] : undefined, 3);
  1637. var index = 0;
  1638. var entry;
  1639. while (index < entries.length) {
  1640. entry = entries[index++];
  1641. boundFunction(entry.value, entry.key, this);
  1642. }
  1643. },
  1644. // `URLSearchParams.prototype.keys` method
  1645. keys: function keys() {
  1646. return new URLSearchParamsIterator(this, 'keys');
  1647. },
  1648. // `URLSearchParams.prototype.values` method
  1649. values: function values() {
  1650. return new URLSearchParamsIterator(this, 'values');
  1651. },
  1652. // `URLSearchParams.prototype.entries` method
  1653. entries: function entries() {
  1654. return new URLSearchParamsIterator(this, 'entries');
  1655. }
  1656. }, { enumerable: true });
  1657. // `URLSearchParams.prototype[@@iterator]` method
  1658. redefine(URLSearchParamsPrototype, ITERATOR, URLSearchParamsPrototype.entries);
  1659. // `URLSearchParams.prototype.toString` method
  1660. // https://url.spec.whatwg.org/#urlsearchparams-stringification-behavior
  1661. redefine(URLSearchParamsPrototype, 'toString', function toString() {
  1662. var entries = getInternalParamsState(this).entries;
  1663. var result = [];
  1664. var index = 0;
  1665. var entry;
  1666. while (index < entries.length) {
  1667. entry = entries[index++];
  1668. result.push(serialize(entry.key) + '=' + serialize(entry.value));
  1669. } return result.join('&');
  1670. }, { enumerable: true });
  1671. setToStringTag(URLSearchParamsConstructor, URL_SEARCH_PARAMS);
  1672. $({ global: true, forced: !USE_NATIVE_URL }, {
  1673. URLSearchParams: URLSearchParamsConstructor
  1674. });
  1675. // Wrap `fetch` for correct work with polyfilled `URLSearchParams`
  1676. // https://github.com/zloirock/core-js/issues/674
  1677. if (!USE_NATIVE_URL && typeof $fetch == 'function' && typeof Headers == 'function') {
  1678. $({ global: true, enumerable: true, forced: true }, {
  1679. fetch: function fetch(input /* , init */) {
  1680. var args = [input];
  1681. var init, body, headers;
  1682. if (arguments.length > 1) {
  1683. init = arguments[1];
  1684. if (isObject(init)) {
  1685. body = init.body;
  1686. if (classof(body) === URL_SEARCH_PARAMS) {
  1687. headers = init.headers ? new Headers(init.headers) : new Headers();
  1688. if (!headers.has('content-type')) {
  1689. headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');
  1690. }
  1691. init = create(init, {
  1692. body: createPropertyDescriptor(0, String(body)),
  1693. headers: createPropertyDescriptor(0, headers)
  1694. });
  1695. }
  1696. }
  1697. args.push(init);
  1698. } return $fetch.apply(this, args);
  1699. }
  1700. });
  1701. }
  1702. module.exports = {
  1703. URLSearchParams: URLSearchParamsConstructor,
  1704. getState: getInternalParamsState
  1705. };
  1706. },{"../internals/an-instance":4,"../internals/an-object":5,"../internals/classof":10,"../internals/create-iterator-constructor":13,"../internals/create-property-descriptor":15,"../internals/export":21,"../internals/function-bind-context":23,"../internals/get-built-in":24,"../internals/get-iterator":26,"../internals/get-iterator-method":25,"../internals/has":28,"../internals/internal-state":34,"../internals/is-object":37,"../internals/native-url":42,"../internals/object-create":45,"../internals/redefine":59,"../internals/redefine-all":58,"../internals/set-to-string-tag":62,"../internals/well-known-symbol":77,"../modules/es.array.iterator":78}],81:[function(require,module,exports){
  1707. 'use strict';
  1708. // TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env`
  1709. require('../modules/es.string.iterator');
  1710. var $ = require('../internals/export');
  1711. var DESCRIPTORS = require('../internals/descriptors');
  1712. var USE_NATIVE_URL = require('../internals/native-url');
  1713. var global = require('../internals/global');
  1714. var defineProperties = require('../internals/object-define-properties');
  1715. var redefine = require('../internals/redefine');
  1716. var anInstance = require('../internals/an-instance');
  1717. var has = require('../internals/has');
  1718. var assign = require('../internals/object-assign');
  1719. var arrayFrom = require('../internals/array-from');
  1720. var codeAt = require('../internals/string-multibyte').codeAt;
  1721. var toASCII = require('../internals/string-punycode-to-ascii');
  1722. var setToStringTag = require('../internals/set-to-string-tag');
  1723. var URLSearchParamsModule = require('../modules/web.url-search-params');
  1724. var InternalStateModule = require('../internals/internal-state');
  1725. var NativeURL = global.URL;
  1726. var URLSearchParams = URLSearchParamsModule.URLSearchParams;
  1727. var getInternalSearchParamsState = URLSearchParamsModule.getState;
  1728. var setInternalState = InternalStateModule.set;
  1729. var getInternalURLState = InternalStateModule.getterFor('URL');
  1730. var floor = Math.floor;
  1731. var pow = Math.pow;
  1732. var INVALID_AUTHORITY = 'Invalid authority';
  1733. var INVALID_SCHEME = 'Invalid scheme';
  1734. var INVALID_HOST = 'Invalid host';
  1735. var INVALID_PORT = 'Invalid port';
  1736. var ALPHA = /[A-Za-z]/;
  1737. var ALPHANUMERIC = /[\d+\-.A-Za-z]/;
  1738. var DIGIT = /\d/;
  1739. var HEX_START = /^(0x|0X)/;
  1740. var OCT = /^[0-7]+$/;
  1741. var DEC = /^\d+$/;
  1742. var HEX = /^[\dA-Fa-f]+$/;
  1743. // eslint-disable-next-line no-control-regex
  1744. var FORBIDDEN_HOST_CODE_POINT = /[\u0000\u0009\u000A\u000D #%/:?@[\\]]/;
  1745. // eslint-disable-next-line no-control-regex
  1746. var FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT = /[\u0000\u0009\u000A\u000D #/:?@[\\]]/;
  1747. // eslint-disable-next-line no-control-regex
  1748. var LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE = /^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g;
  1749. // eslint-disable-next-line no-control-regex
  1750. var TAB_AND_NEW_LINE = /[\u0009\u000A\u000D]/g;
  1751. var EOF;
  1752. var parseHost = function (url, input) {
  1753. var result, codePoints, index;
  1754. if (input.charAt(0) == '[') {
  1755. if (input.charAt(input.length - 1) != ']') return INVALID_HOST;
  1756. result = parseIPv6(input.slice(1, -1));
  1757. if (!result) return INVALID_HOST;
  1758. url.host = result;
  1759. // opaque host
  1760. } else if (!isSpecial(url)) {
  1761. if (FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT.test(input)) return INVALID_HOST;
  1762. result = '';
  1763. codePoints = arrayFrom(input);
  1764. for (index = 0; index < codePoints.length; index++) {
  1765. result += percentEncode(codePoints[index], C0ControlPercentEncodeSet);
  1766. }
  1767. url.host = result;
  1768. } else {
  1769. input = toASCII(input);
  1770. if (FORBIDDEN_HOST_CODE_POINT.test(input)) return INVALID_HOST;
  1771. result = parseIPv4(input);
  1772. if (result === null) return INVALID_HOST;
  1773. url.host = result;
  1774. }
  1775. };
  1776. var parseIPv4 = function (input) {
  1777. var parts = input.split('.');
  1778. var partsLength, numbers, index, part, radix, number, ipv4;
  1779. if (parts.length && parts[parts.length - 1] == '') {
  1780. parts.pop();
  1781. }
  1782. partsLength = parts.length;
  1783. if (partsLength > 4) return input;
  1784. numbers = [];
  1785. for (index = 0; index < partsLength; index++) {
  1786. part = parts[index];
  1787. if (part == '') return input;
  1788. radix = 10;
  1789. if (part.length > 1 && part.charAt(0) == '0') {
  1790. radix = HEX_START.test(part) ? 16 : 8;
  1791. part = part.slice(radix == 8 ? 1 : 2);
  1792. }
  1793. if (part === '') {
  1794. number = 0;
  1795. } else {
  1796. if (!(radix == 10 ? DEC : radix == 8 ? OCT : HEX).test(part)) return input;
  1797. number = parseInt(part, radix);
  1798. }
  1799. numbers.push(number);
  1800. }
  1801. for (index = 0; index < partsLength; index++) {
  1802. number = numbers[index];
  1803. if (index == partsLength - 1) {
  1804. if (number >= pow(256, 5 - partsLength)) return null;
  1805. } else if (number > 255) return null;
  1806. }
  1807. ipv4 = numbers.pop();
  1808. for (index = 0; index < numbers.length; index++) {
  1809. ipv4 += numbers[index] * pow(256, 3 - index);
  1810. }
  1811. return ipv4;
  1812. };
  1813. // eslint-disable-next-line max-statements
  1814. var parseIPv6 = function (input) {
  1815. var address = [0, 0, 0, 0, 0, 0, 0, 0];
  1816. var pieceIndex = 0;
  1817. var compress = null;
  1818. var pointer = 0;
  1819. var value, length, numbersSeen, ipv4Piece, number, swaps, swap;
  1820. var char = function () {
  1821. return input.charAt(pointer);
  1822. };
  1823. if (char() == ':') {
  1824. if (input.charAt(1) != ':') return;
  1825. pointer += 2;
  1826. pieceIndex++;
  1827. compress = pieceIndex;
  1828. }
  1829. while (char()) {
  1830. if (pieceIndex == 8) return;
  1831. if (char() == ':') {
  1832. if (compress !== null) return;
  1833. pointer++;
  1834. pieceIndex++;
  1835. compress = pieceIndex;
  1836. continue;
  1837. }
  1838. value = length = 0;
  1839. while (length < 4 && HEX.test(char())) {
  1840. value = value * 16 + parseInt(char(), 16);
  1841. pointer++;
  1842. length++;
  1843. }
  1844. if (char() == '.') {
  1845. if (length == 0) return;
  1846. pointer -= length;
  1847. if (pieceIndex > 6) return;
  1848. numbersSeen = 0;
  1849. while (char()) {
  1850. ipv4Piece = null;
  1851. if (numbersSeen > 0) {
  1852. if (char() == '.' && numbersSeen < 4) pointer++;
  1853. else return;
  1854. }
  1855. if (!DIGIT.test(char())) return;
  1856. while (DIGIT.test(char())) {
  1857. number = parseInt(char(), 10);
  1858. if (ipv4Piece === null) ipv4Piece = number;
  1859. else if (ipv4Piece == 0) return;
  1860. else ipv4Piece = ipv4Piece * 10 + number;
  1861. if (ipv4Piece > 255) return;
  1862. pointer++;
  1863. }
  1864. address[pieceIndex] = address[pieceIndex] * 256 + ipv4Piece;
  1865. numbersSeen++;
  1866. if (numbersSeen == 2 || numbersSeen == 4) pieceIndex++;
  1867. }
  1868. if (numbersSeen != 4) return;
  1869. break;
  1870. } else if (char() == ':') {
  1871. pointer++;
  1872. if (!char()) return;
  1873. } else if (char()) return;
  1874. address[pieceIndex++] = value;
  1875. }
  1876. if (compress !== null) {
  1877. swaps = pieceIndex - compress;
  1878. pieceIndex = 7;
  1879. while (pieceIndex != 0 && swaps > 0) {
  1880. swap = address[pieceIndex];
  1881. address[pieceIndex--] = address[compress + swaps - 1];
  1882. address[compress + --swaps] = swap;
  1883. }
  1884. } else if (pieceIndex != 8) return;
  1885. return address;
  1886. };
  1887. var findLongestZeroSequence = function (ipv6) {
  1888. var maxIndex = null;
  1889. var maxLength = 1;
  1890. var currStart = null;
  1891. var currLength = 0;
  1892. var index = 0;
  1893. for (; index < 8; index++) {
  1894. if (ipv6[index] !== 0) {
  1895. if (currLength > maxLength) {
  1896. maxIndex = currStart;
  1897. maxLength = currLength;
  1898. }
  1899. currStart = null;
  1900. currLength = 0;
  1901. } else {
  1902. if (currStart === null) currStart = index;
  1903. ++currLength;
  1904. }
  1905. }
  1906. if (currLength > maxLength) {
  1907. maxIndex = currStart;
  1908. maxLength = currLength;
  1909. }
  1910. return maxIndex;
  1911. };
  1912. var serializeHost = function (host) {
  1913. var result, index, compress, ignore0;
  1914. // ipv4
  1915. if (typeof host == 'number') {
  1916. result = [];
  1917. for (index = 0; index < 4; index++) {
  1918. result.unshift(host % 256);
  1919. host = floor(host / 256);
  1920. } return result.join('.');
  1921. // ipv6
  1922. } else if (typeof host == 'object') {
  1923. result = '';
  1924. compress = findLongestZeroSequence(host);
  1925. for (index = 0; index < 8; index++) {
  1926. if (ignore0 && host[index] === 0) continue;
  1927. if (ignore0) ignore0 = false;
  1928. if (compress === index) {
  1929. result += index ? ':' : '::';
  1930. ignore0 = true;
  1931. } else {
  1932. result += host[index].toString(16);
  1933. if (index < 7) result += ':';
  1934. }
  1935. }
  1936. return '[' + result + ']';
  1937. } return host;
  1938. };
  1939. var C0ControlPercentEncodeSet = {};
  1940. var fragmentPercentEncodeSet = assign({}, C0ControlPercentEncodeSet, {
  1941. ' ': 1, '"': 1, '<': 1, '>': 1, '`': 1
  1942. });
  1943. var pathPercentEncodeSet = assign({}, fragmentPercentEncodeSet, {
  1944. '#': 1, '?': 1, '{': 1, '}': 1
  1945. });
  1946. var userinfoPercentEncodeSet = assign({}, pathPercentEncodeSet, {
  1947. '/': 1, ':': 1, ';': 1, '=': 1, '@': 1, '[': 1, '\\': 1, ']': 1, '^': 1, '|': 1
  1948. });
  1949. var percentEncode = function (char, set) {
  1950. var code = codeAt(char, 0);
  1951. return code > 0x20 && code < 0x7F && !has(set, char) ? char : encodeURIComponent(char);
  1952. };
  1953. var specialSchemes = {
  1954. ftp: 21,
  1955. file: null,
  1956. http: 80,
  1957. https: 443,
  1958. ws: 80,
  1959. wss: 443
  1960. };
  1961. var isSpecial = function (url) {
  1962. return has(specialSchemes, url.scheme);
  1963. };
  1964. var includesCredentials = function (url) {
  1965. return url.username != '' || url.password != '';
  1966. };
  1967. var cannotHaveUsernamePasswordPort = function (url) {
  1968. return !url.host || url.cannotBeABaseURL || url.scheme == 'file';
  1969. };
  1970. var isWindowsDriveLetter = function (string, normalized) {
  1971. var second;
  1972. return string.length == 2 && ALPHA.test(string.charAt(0))
  1973. && ((second = string.charAt(1)) == ':' || (!normalized && second == '|'));
  1974. };
  1975. var startsWithWindowsDriveLetter = function (string) {
  1976. var third;
  1977. return string.length > 1 && isWindowsDriveLetter(string.slice(0, 2)) && (
  1978. string.length == 2 ||
  1979. ((third = string.charAt(2)) === '/' || third === '\\' || third === '?' || third === '#')
  1980. );
  1981. };
  1982. var shortenURLsPath = function (url) {
  1983. var path = url.path;
  1984. var pathSize = path.length;
  1985. if (pathSize && (url.scheme != 'file' || pathSize != 1 || !isWindowsDriveLetter(path[0], true))) {
  1986. path.pop();
  1987. }
  1988. };
  1989. var isSingleDot = function (segment) {
  1990. return segment === '.' || segment.toLowerCase() === '%2e';
  1991. };
  1992. var isDoubleDot = function (segment) {
  1993. segment = segment.toLowerCase();
  1994. return segment === '..' || segment === '%2e.' || segment === '.%2e' || segment === '%2e%2e';
  1995. };
  1996. // States:
  1997. var SCHEME_START = {};
  1998. var SCHEME = {};
  1999. var NO_SCHEME = {};
  2000. var SPECIAL_RELATIVE_OR_AUTHORITY = {};
  2001. var PATH_OR_AUTHORITY = {};
  2002. var RELATIVE = {};
  2003. var RELATIVE_SLASH = {};
  2004. var SPECIAL_AUTHORITY_SLASHES = {};
  2005. var SPECIAL_AUTHORITY_IGNORE_SLASHES = {};
  2006. var AUTHORITY = {};
  2007. var HOST = {};
  2008. var HOSTNAME = {};
  2009. var PORT = {};
  2010. var FILE = {};
  2011. var FILE_SLASH = {};
  2012. var FILE_HOST = {};
  2013. var PATH_START = {};
  2014. var PATH = {};
  2015. var CANNOT_BE_A_BASE_URL_PATH = {};
  2016. var QUERY = {};
  2017. var FRAGMENT = {};
  2018. // eslint-disable-next-line max-statements
  2019. var parseURL = function (url, input, stateOverride, base) {
  2020. var state = stateOverride || SCHEME_START;
  2021. var pointer = 0;
  2022. var buffer = '';
  2023. var seenAt = false;
  2024. var seenBracket = false;
  2025. var seenPasswordToken = false;
  2026. var codePoints, char, bufferCodePoints, failure;
  2027. if (!stateOverride) {
  2028. url.scheme = '';
  2029. url.username = '';
  2030. url.password = '';
  2031. url.host = null;
  2032. url.port = null;
  2033. url.path = [];
  2034. url.query = null;
  2035. url.fragment = null;
  2036. url.cannotBeABaseURL = false;
  2037. input = input.replace(LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE, '');
  2038. }
  2039. input = input.replace(TAB_AND_NEW_LINE, '');
  2040. codePoints = arrayFrom(input);
  2041. while (pointer <= codePoints.length) {
  2042. char = codePoints[pointer];
  2043. switch (state) {
  2044. case SCHEME_START:
  2045. if (char && ALPHA.test(char)) {
  2046. buffer += char.toLowerCase();
  2047. state = SCHEME;
  2048. } else if (!stateOverride) {
  2049. state = NO_SCHEME;
  2050. continue;
  2051. } else return INVALID_SCHEME;
  2052. break;
  2053. case SCHEME:
  2054. if (char && (ALPHANUMERIC.test(char) || char == '+' || char == '-' || char == '.')) {
  2055. buffer += char.toLowerCase();
  2056. } else if (char == ':') {
  2057. if (stateOverride && (
  2058. (isSpecial(url) != has(specialSchemes, buffer)) ||
  2059. (buffer == 'file' && (includesCredentials(url) || url.port !== null)) ||
  2060. (url.scheme == 'file' && !url.host)
  2061. )) return;
  2062. url.scheme = buffer;
  2063. if (stateOverride) {
  2064. if (isSpecial(url) && specialSchemes[url.scheme] == url.port) url.port = null;
  2065. return;
  2066. }
  2067. buffer = '';
  2068. if (url.scheme == 'file') {
  2069. state = FILE;
  2070. } else if (isSpecial(url) && base && base.scheme == url.scheme) {
  2071. state = SPECIAL_RELATIVE_OR_AUTHORITY;
  2072. } else if (isSpecial(url)) {
  2073. state = SPECIAL_AUTHORITY_SLASHES;
  2074. } else if (codePoints[pointer + 1] == '/') {
  2075. state = PATH_OR_AUTHORITY;
  2076. pointer++;
  2077. } else {
  2078. url.cannotBeABaseURL = true;
  2079. url.path.push('');
  2080. state = CANNOT_BE_A_BASE_URL_PATH;
  2081. }
  2082. } else if (!stateOverride) {
  2083. buffer = '';
  2084. state = NO_SCHEME;
  2085. pointer = 0;
  2086. continue;
  2087. } else return INVALID_SCHEME;
  2088. break;
  2089. case NO_SCHEME:
  2090. if (!base || (base.cannotBeABaseURL && char != '#')) return INVALID_SCHEME;
  2091. if (base.cannotBeABaseURL && char == '#') {
  2092. url.scheme = base.scheme;
  2093. url.path = base.path.slice();
  2094. url.query = base.query;
  2095. url.fragment = '';
  2096. url.cannotBeABaseURL = true;
  2097. state = FRAGMENT;
  2098. break;
  2099. }
  2100. state = base.scheme == 'file' ? FILE : RELATIVE;
  2101. continue;
  2102. case SPECIAL_RELATIVE_OR_AUTHORITY:
  2103. if (char == '/' && codePoints[pointer + 1] == '/') {
  2104. state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
  2105. pointer++;
  2106. } else {
  2107. state = RELATIVE;
  2108. continue;
  2109. } break;
  2110. case PATH_OR_AUTHORITY:
  2111. if (char == '/') {
  2112. state = AUTHORITY;
  2113. break;
  2114. } else {
  2115. state = PATH;
  2116. continue;
  2117. }
  2118. case RELATIVE:
  2119. url.scheme = base.scheme;
  2120. if (char == EOF) {
  2121. url.username = base.username;
  2122. url.password = base.password;
  2123. url.host = base.host;
  2124. url.port = base.port;
  2125. url.path = base.path.slice();
  2126. url.query = base.query;
  2127. } else if (char == '/' || (char == '\\' && isSpecial(url))) {
  2128. state = RELATIVE_SLASH;
  2129. } else if (char == '?') {
  2130. url.username = base.username;
  2131. url.password = base.password;
  2132. url.host = base.host;
  2133. url.port = base.port;
  2134. url.path = base.path.slice();
  2135. url.query = '';
  2136. state = QUERY;
  2137. } else if (char == '#') {
  2138. url.username = base.username;
  2139. url.password = base.password;
  2140. url.host = base.host;
  2141. url.port = base.port;
  2142. url.path = base.path.slice();
  2143. url.query = base.query;
  2144. url.fragment = '';
  2145. state = FRAGMENT;
  2146. } else {
  2147. url.username = base.username;
  2148. url.password = base.password;
  2149. url.host = base.host;
  2150. url.port = base.port;
  2151. url.path = base.path.slice();
  2152. url.path.pop();
  2153. state = PATH;
  2154. continue;
  2155. } break;
  2156. case RELATIVE_SLASH:
  2157. if (isSpecial(url) && (char == '/' || char == '\\')) {
  2158. state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
  2159. } else if (char == '/') {
  2160. state = AUTHORITY;
  2161. } else {
  2162. url.username = base.username;
  2163. url.password = base.password;
  2164. url.host = base.host;
  2165. url.port = base.port;
  2166. state = PATH;
  2167. continue;
  2168. } break;
  2169. case SPECIAL_AUTHORITY_SLASHES:
  2170. state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
  2171. if (char != '/' || buffer.charAt(pointer + 1) != '/') continue;
  2172. pointer++;
  2173. break;
  2174. case SPECIAL_AUTHORITY_IGNORE_SLASHES:
  2175. if (char != '/' && char != '\\') {
  2176. state = AUTHORITY;
  2177. continue;
  2178. } break;
  2179. case AUTHORITY:
  2180. if (char == '@') {
  2181. if (seenAt) buffer = '%40' + buffer;
  2182. seenAt = true;
  2183. bufferCodePoints = arrayFrom(buffer);
  2184. for (var i = 0; i < bufferCodePoints.length; i++) {
  2185. var codePoint = bufferCodePoints[i];
  2186. if (codePoint == ':' && !seenPasswordToken) {
  2187. seenPasswordToken = true;
  2188. continue;
  2189. }
  2190. var encodedCodePoints = percentEncode(codePoint, userinfoPercentEncodeSet);
  2191. if (seenPasswordToken) url.password += encodedCodePoints;
  2192. else url.username += encodedCodePoints;
  2193. }
  2194. buffer = '';
  2195. } else if (
  2196. char == EOF || char == '/' || char == '?' || char == '#' ||
  2197. (char == '\\' && isSpecial(url))
  2198. ) {
  2199. if (seenAt && buffer == '') return INVALID_AUTHORITY;
  2200. pointer -= arrayFrom(buffer).length + 1;
  2201. buffer = '';
  2202. state = HOST;
  2203. } else buffer += char;
  2204. break;
  2205. case HOST:
  2206. case HOSTNAME:
  2207. if (stateOverride && url.scheme == 'file') {
  2208. state = FILE_HOST;
  2209. continue;
  2210. } else if (char == ':' && !seenBracket) {
  2211. if (buffer == '') return INVALID_HOST;
  2212. failure = parseHost(url, buffer);
  2213. if (failure) return failure;
  2214. buffer = '';
  2215. state = PORT;
  2216. if (stateOverride == HOSTNAME) return;
  2217. } else if (
  2218. char == EOF || char == '/' || char == '?' || char == '#' ||
  2219. (char == '\\' && isSpecial(url))
  2220. ) {
  2221. if (isSpecial(url) && buffer == '') return INVALID_HOST;
  2222. if (stateOverride && buffer == '' && (includesCredentials(url) || url.port !== null)) return;
  2223. failure = parseHost(url, buffer);
  2224. if (failure) return failure;
  2225. buffer = '';
  2226. state = PATH_START;
  2227. if (stateOverride) return;
  2228. continue;
  2229. } else {
  2230. if (char == '[') seenBracket = true;
  2231. else if (char == ']') seenBracket = false;
  2232. buffer += char;
  2233. } break;
  2234. case PORT:
  2235. if (DIGIT.test(char)) {
  2236. buffer += char;
  2237. } else if (
  2238. char == EOF || char == '/' || char == '?' || char == '#' ||
  2239. (char == '\\' && isSpecial(url)) ||
  2240. stateOverride
  2241. ) {
  2242. if (buffer != '') {
  2243. var port = parseInt(buffer, 10);
  2244. if (port > 0xFFFF) return INVALID_PORT;
  2245. url.port = (isSpecial(url) && port === specialSchemes[url.scheme]) ? null : port;
  2246. buffer = '';
  2247. }
  2248. if (stateOverride) return;
  2249. state = PATH_START;
  2250. continue;
  2251. } else return INVALID_PORT;
  2252. break;
  2253. case FILE:
  2254. url.scheme = 'file';
  2255. if (char == '/' || char == '\\') state = FILE_SLASH;
  2256. else if (base && base.scheme == 'file') {
  2257. if (char == EOF) {
  2258. url.host = base.host;
  2259. url.path = base.path.slice();
  2260. url.query = base.query;
  2261. } else if (char == '?') {
  2262. url.host = base.host;
  2263. url.path = base.path.slice();
  2264. url.query = '';
  2265. state = QUERY;
  2266. } else if (char == '#') {
  2267. url.host = base.host;
  2268. url.path = base.path.slice();
  2269. url.query = base.query;
  2270. url.fragment = '';
  2271. state = FRAGMENT;
  2272. } else {
  2273. if (!startsWithWindowsDriveLetter(codePoints.slice(pointer).join(''))) {
  2274. url.host = base.host;
  2275. url.path = base.path.slice();
  2276. shortenURLsPath(url);
  2277. }
  2278. state = PATH;
  2279. continue;
  2280. }
  2281. } else {
  2282. state = PATH;
  2283. continue;
  2284. } break;
  2285. case FILE_SLASH:
  2286. if (char == '/' || char == '\\') {
  2287. state = FILE_HOST;
  2288. break;
  2289. }
  2290. if (base && base.scheme == 'file' && !startsWithWindowsDriveLetter(codePoints.slice(pointer).join(''))) {
  2291. if (isWindowsDriveLetter(base.path[0], true)) url.path.push(base.path[0]);
  2292. else url.host = base.host;
  2293. }
  2294. state = PATH;
  2295. continue;
  2296. case FILE_HOST:
  2297. if (char == EOF || char == '/' || char == '\\' || char == '?' || char == '#') {
  2298. if (!stateOverride && isWindowsDriveLetter(buffer)) {
  2299. state = PATH;
  2300. } else if (buffer == '') {
  2301. url.host = '';
  2302. if (stateOverride) return;
  2303. state = PATH_START;
  2304. } else {
  2305. failure = parseHost(url, buffer);
  2306. if (failure) return failure;
  2307. if (url.host == 'localhost') url.host = '';
  2308. if (stateOverride) return;
  2309. buffer = '';
  2310. state = PATH_START;
  2311. } continue;
  2312. } else buffer += char;
  2313. break;
  2314. case PATH_START:
  2315. if (isSpecial(url)) {
  2316. state = PATH;
  2317. if (char != '/' && char != '\\') continue;
  2318. } else if (!stateOverride && char == '?') {
  2319. url.query = '';
  2320. state = QUERY;
  2321. } else if (!stateOverride && char == '#') {
  2322. url.fragment = '';
  2323. state = FRAGMENT;
  2324. } else if (char != EOF) {
  2325. state = PATH;
  2326. if (char != '/') continue;
  2327. } break;
  2328. case PATH:
  2329. if (
  2330. char == EOF || char == '/' ||
  2331. (char == '\\' && isSpecial(url)) ||
  2332. (!stateOverride && (char == '?' || char == '#'))
  2333. ) {
  2334. if (isDoubleDot(buffer)) {
  2335. shortenURLsPath(url);
  2336. if (char != '/' && !(char == '\\' && isSpecial(url))) {
  2337. url.path.push('');
  2338. }
  2339. } else if (isSingleDot(buffer)) {
  2340. if (char != '/' && !(char == '\\' && isSpecial(url))) {
  2341. url.path.push('');
  2342. }
  2343. } else {
  2344. if (url.scheme == 'file' && !url.path.length && isWindowsDriveLetter(buffer)) {
  2345. if (url.host) url.host = '';
  2346. buffer = buffer.charAt(0) + ':'; // normalize windows drive letter
  2347. }
  2348. url.path.push(buffer);
  2349. }
  2350. buffer = '';
  2351. if (url.scheme == 'file' && (char == EOF || char == '?' || char == '#')) {
  2352. while (url.path.length > 1 && url.path[0] === '') {
  2353. url.path.shift();
  2354. }
  2355. }
  2356. if (char == '?') {
  2357. url.query = '';
  2358. state = QUERY;
  2359. } else if (char == '#') {
  2360. url.fragment = '';
  2361. state = FRAGMENT;
  2362. }
  2363. } else {
  2364. buffer += percentEncode(char, pathPercentEncodeSet);
  2365. } break;
  2366. case CANNOT_BE_A_BASE_URL_PATH:
  2367. if (char == '?') {
  2368. url.query = '';
  2369. state = QUERY;
  2370. } else if (char == '#') {
  2371. url.fragment = '';
  2372. state = FRAGMENT;
  2373. } else if (char != EOF) {
  2374. url.path[0] += percentEncode(char, C0ControlPercentEncodeSet);
  2375. } break;
  2376. case QUERY:
  2377. if (!stateOverride && char == '#') {
  2378. url.fragment = '';
  2379. state = FRAGMENT;
  2380. } else if (char != EOF) {
  2381. if (char == "'" && isSpecial(url)) url.query += '%27';
  2382. else if (char == '#') url.query += '%23';
  2383. else url.query += percentEncode(char, C0ControlPercentEncodeSet);
  2384. } break;
  2385. case FRAGMENT:
  2386. if (char != EOF) url.fragment += percentEncode(char, fragmentPercentEncodeSet);
  2387. break;
  2388. }
  2389. pointer++;
  2390. }
  2391. };
  2392. // `URL` constructor
  2393. // https://url.spec.whatwg.org/#url-class
  2394. var URLConstructor = function URL(url /* , base */) {
  2395. var that = anInstance(this, URLConstructor, 'URL');
  2396. var base = arguments.length > 1 ? arguments[1] : undefined;
  2397. var urlString = String(url);
  2398. var state = setInternalState(that, { type: 'URL' });
  2399. var baseState, failure;
  2400. if (base !== undefined) {
  2401. if (base instanceof URLConstructor) baseState = getInternalURLState(base);
  2402. else {
  2403. failure = parseURL(baseState = {}, String(base));
  2404. if (failure) throw TypeError(failure);
  2405. }
  2406. }
  2407. failure = parseURL(state, urlString, null, baseState);
  2408. if (failure) throw TypeError(failure);
  2409. var searchParams = state.searchParams = new URLSearchParams();
  2410. var searchParamsState = getInternalSearchParamsState(searchParams);
  2411. searchParamsState.updateSearchParams(state.query);
  2412. searchParamsState.updateURL = function () {
  2413. state.query = String(searchParams) || null;
  2414. };
  2415. if (!DESCRIPTORS) {
  2416. that.href = serializeURL.call(that);
  2417. that.origin = getOrigin.call(that);
  2418. that.protocol = getProtocol.call(that);
  2419. that.username = getUsername.call(that);
  2420. that.password = getPassword.call(that);
  2421. that.host = getHost.call(that);
  2422. that.hostname = getHostname.call(that);
  2423. that.port = getPort.call(that);
  2424. that.pathname = getPathname.call(that);
  2425. that.search = getSearch.call(that);
  2426. that.searchParams = getSearchParams.call(that);
  2427. that.hash = getHash.call(that);
  2428. }
  2429. };
  2430. var URLPrototype = URLConstructor.prototype;
  2431. var serializeURL = function () {
  2432. var url = getInternalURLState(this);
  2433. var scheme = url.scheme;
  2434. var username = url.username;
  2435. var password = url.password;
  2436. var host = url.host;
  2437. var port = url.port;
  2438. var path = url.path;
  2439. var query = url.query;
  2440. var fragment = url.fragment;
  2441. var output = scheme + ':';
  2442. if (host !== null) {
  2443. output += '//';
  2444. if (includesCredentials(url)) {
  2445. output += username + (password ? ':' + password : '') + '@';
  2446. }
  2447. output += serializeHost(host);
  2448. if (port !== null) output += ':' + port;
  2449. } else if (scheme == 'file') output += '//';
  2450. output += url.cannotBeABaseURL ? path[0] : path.length ? '/' + path.join('/') : '';
  2451. if (query !== null) output += '?' + query;
  2452. if (fragment !== null) output += '#' + fragment;
  2453. return output;
  2454. };
  2455. var getOrigin = function () {
  2456. var url = getInternalURLState(this);
  2457. var scheme = url.scheme;
  2458. var port = url.port;
  2459. if (scheme == 'blob') try {
  2460. return new URL(scheme.path[0]).origin;
  2461. } catch (error) {
  2462. return 'null';
  2463. }
  2464. if (scheme == 'file' || !isSpecial(url)) return 'null';
  2465. return scheme + '://' + serializeHost(url.host) + (port !== null ? ':' + port : '');
  2466. };
  2467. var getProtocol = function () {
  2468. return getInternalURLState(this).scheme + ':';
  2469. };
  2470. var getUsername = function () {
  2471. return getInternalURLState(this).username;
  2472. };
  2473. var getPassword = function () {
  2474. return getInternalURLState(this).password;
  2475. };
  2476. var getHost = function () {
  2477. var url = getInternalURLState(this);
  2478. var host = url.host;
  2479. var port = url.port;
  2480. return host === null ? ''
  2481. : port === null ? serializeHost(host)
  2482. : serializeHost(host) + ':' + port;
  2483. };
  2484. var getHostname = function () {
  2485. var host = getInternalURLState(this).host;
  2486. return host === null ? '' : serializeHost(host);
  2487. };
  2488. var getPort = function () {
  2489. var port = getInternalURLState(this).port;
  2490. return port === null ? '' : String(port);
  2491. };
  2492. var getPathname = function () {
  2493. var url = getInternalURLState(this);
  2494. var path = url.path;
  2495. return url.cannotBeABaseURL ? path[0] : path.length ? '/' + path.join('/') : '';
  2496. };
  2497. var getSearch = function () {
  2498. var query = getInternalURLState(this).query;
  2499. return query ? '?' + query : '';
  2500. };
  2501. var getSearchParams = function () {
  2502. return getInternalURLState(this).searchParams;
  2503. };
  2504. var getHash = function () {
  2505. var fragment = getInternalURLState(this).fragment;
  2506. return fragment ? '#' + fragment : '';
  2507. };
  2508. var accessorDescriptor = function (getter, setter) {
  2509. return { get: getter, set: setter, configurable: true, enumerable: true };
  2510. };
  2511. if (DESCRIPTORS) {
  2512. defineProperties(URLPrototype, {
  2513. // `URL.prototype.href` accessors pair
  2514. // https://url.spec.whatwg.org/#dom-url-href
  2515. href: accessorDescriptor(serializeURL, function (href) {
  2516. var url = getInternalURLState(this);
  2517. var urlString = String(href);
  2518. var failure = parseURL(url, urlString);
  2519. if (failure) throw TypeError(failure);
  2520. getInternalSearchParamsState(url.searchParams).updateSearchParams(url.query);
  2521. }),
  2522. // `URL.prototype.origin` getter
  2523. // https://url.spec.whatwg.org/#dom-url-origin
  2524. origin: accessorDescriptor(getOrigin),
  2525. // `URL.prototype.protocol` accessors pair
  2526. // https://url.spec.whatwg.org/#dom-url-protocol
  2527. protocol: accessorDescriptor(getProtocol, function (protocol) {
  2528. var url = getInternalURLState(this);
  2529. parseURL(url, String(protocol) + ':', SCHEME_START);
  2530. }),
  2531. // `URL.prototype.username` accessors pair
  2532. // https://url.spec.whatwg.org/#dom-url-username
  2533. username: accessorDescriptor(getUsername, function (username) {
  2534. var url = getInternalURLState(this);
  2535. var codePoints = arrayFrom(String(username));
  2536. if (cannotHaveUsernamePasswordPort(url)) return;
  2537. url.username = '';
  2538. for (var i = 0; i < codePoints.length; i++) {
  2539. url.username += percentEncode(codePoints[i], userinfoPercentEncodeSet);
  2540. }
  2541. }),
  2542. // `URL.prototype.password` accessors pair
  2543. // https://url.spec.whatwg.org/#dom-url-password
  2544. password: accessorDescriptor(getPassword, function (password) {
  2545. var url = getInternalURLState(this);
  2546. var codePoints = arrayFrom(String(password));
  2547. if (cannotHaveUsernamePasswordPort(url)) return;
  2548. url.password = '';
  2549. for (var i = 0; i < codePoints.length; i++) {
  2550. url.password += percentEncode(codePoints[i], userinfoPercentEncodeSet);
  2551. }
  2552. }),
  2553. // `URL.prototype.host` accessors pair
  2554. // https://url.spec.whatwg.org/#dom-url-host
  2555. host: accessorDescriptor(getHost, function (host) {
  2556. var url = getInternalURLState(this);
  2557. if (url.cannotBeABaseURL) return;
  2558. parseURL(url, String(host), HOST);
  2559. }),
  2560. // `URL.prototype.hostname` accessors pair
  2561. // https://url.spec.whatwg.org/#dom-url-hostname
  2562. hostname: accessorDescriptor(getHostname, function (hostname) {
  2563. var url = getInternalURLState(this);
  2564. if (url.cannotBeABaseURL) return;
  2565. parseURL(url, String(hostname), HOSTNAME);
  2566. }),
  2567. // `URL.prototype.port` accessors pair
  2568. // https://url.spec.whatwg.org/#dom-url-port
  2569. port: accessorDescriptor(getPort, function (port) {
  2570. var url = getInternalURLState(this);
  2571. if (cannotHaveUsernamePasswordPort(url)) return;
  2572. port = String(port);
  2573. if (port == '') url.port = null;
  2574. else parseURL(url, port, PORT);
  2575. }),
  2576. // `URL.prototype.pathname` accessors pair
  2577. // https://url.spec.whatwg.org/#dom-url-pathname
  2578. pathname: accessorDescriptor(getPathname, function (pathname) {
  2579. var url = getInternalURLState(this);
  2580. if (url.cannotBeABaseURL) return;
  2581. url.path = [];
  2582. parseURL(url, pathname + '', PATH_START);
  2583. }),
  2584. // `URL.prototype.search` accessors pair
  2585. // https://url.spec.whatwg.org/#dom-url-search
  2586. search: accessorDescriptor(getSearch, function (search) {
  2587. var url = getInternalURLState(this);
  2588. search = String(search);
  2589. if (search == '') {
  2590. url.query = null;
  2591. } else {
  2592. if ('?' == search.charAt(0)) search = search.slice(1);
  2593. url.query = '';
  2594. parseURL(url, search, QUERY);
  2595. }
  2596. getInternalSearchParamsState(url.searchParams).updateSearchParams(url.query);
  2597. }),
  2598. // `URL.prototype.searchParams` getter
  2599. // https://url.spec.whatwg.org/#dom-url-searchparams
  2600. searchParams: accessorDescriptor(getSearchParams),
  2601. // `URL.prototype.hash` accessors pair
  2602. // https://url.spec.whatwg.org/#dom-url-hash
  2603. hash: accessorDescriptor(getHash, function (hash) {
  2604. var url = getInternalURLState(this);
  2605. hash = String(hash);
  2606. if (hash == '') {
  2607. url.fragment = null;
  2608. return;
  2609. }
  2610. if ('#' == hash.charAt(0)) hash = hash.slice(1);
  2611. url.fragment = '';
  2612. parseURL(url, hash, FRAGMENT);
  2613. })
  2614. });
  2615. }
  2616. // `URL.prototype.toJSON` method
  2617. // https://url.spec.whatwg.org/#dom-url-tojson
  2618. redefine(URLPrototype, 'toJSON', function toJSON() {
  2619. return serializeURL.call(this);
  2620. }, { enumerable: true });
  2621. // `URL.prototype.toString` method
  2622. // https://url.spec.whatwg.org/#URL-stringification-behavior
  2623. redefine(URLPrototype, 'toString', function toString() {
  2624. return serializeURL.call(this);
  2625. }, { enumerable: true });
  2626. if (NativeURL) {
  2627. var nativeCreateObjectURL = NativeURL.createObjectURL;
  2628. var nativeRevokeObjectURL = NativeURL.revokeObjectURL;
  2629. // `URL.createObjectURL` method
  2630. // https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL
  2631. // eslint-disable-next-line no-unused-vars
  2632. if (nativeCreateObjectURL) redefine(URLConstructor, 'createObjectURL', function createObjectURL(blob) {
  2633. return nativeCreateObjectURL.apply(NativeURL, arguments);
  2634. });
  2635. // `URL.revokeObjectURL` method
  2636. // https://developer.mozilla.org/en-US/docs/Web/API/URL/revokeObjectURL
  2637. // eslint-disable-next-line no-unused-vars
  2638. if (nativeRevokeObjectURL) redefine(URLConstructor, 'revokeObjectURL', function revokeObjectURL(url) {
  2639. return nativeRevokeObjectURL.apply(NativeURL, arguments);
  2640. });
  2641. }
  2642. setToStringTag(URLConstructor, 'URL');
  2643. $({ global: true, forced: !USE_NATIVE_URL, sham: !DESCRIPTORS }, {
  2644. URL: URLConstructor
  2645. });
  2646. },{"../internals/an-instance":4,"../internals/array-from":6,"../internals/descriptors":18,"../internals/export":21,"../internals/global":27,"../internals/has":28,"../internals/internal-state":34,"../internals/native-url":42,"../internals/object-assign":44,"../internals/object-define-properties":46,"../internals/redefine":59,"../internals/set-to-string-tag":62,"../internals/string-multibyte":66,"../internals/string-punycode-to-ascii":67,"../modules/es.string.iterator":79,"../modules/web.url-search-params":80}],82:[function(require,module,exports){
  2647. 'use strict';
  2648. var $ = require('../internals/export');
  2649. // `URL.prototype.toJSON` method
  2650. // https://url.spec.whatwg.org/#dom-url-tojson
  2651. $({ target: 'URL', proto: true, enumerable: true }, {
  2652. toJSON: function toJSON() {
  2653. return URL.prototype.toString.call(this);
  2654. }
  2655. });
  2656. },{"../internals/export":21}],83:[function(require,module,exports){
  2657. require('../modules/web.url');
  2658. require('../modules/web.url.to-json');
  2659. require('../modules/web.url-search-params');
  2660. var path = require('../internals/path');
  2661. module.exports = path.URL;
  2662. },{"../internals/path":57,"../modules/web.url":81,"../modules/web.url-search-params":80,"../modules/web.url.to-json":82}]},{},[83]);