@dotcms/react 0.0.1-beta.4 → 0.0.1-beta.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/README.md +539 -80
  2. package/index.esm.js +49 -2169
  3. package/next.esm.js +1037 -236
  4. package/package.json +10 -5
  5. package/src/lib/deprecated/components/BlockEditorRenderer/blocks/Contentlet.d.ts +1 -1
  6. package/src/lib/deprecated/components/DotEditableText/DotEditableText.d.ts +1 -0
  7. package/src/lib/deprecated/components/DotcmsLayout/DotcmsLayout.d.ts +1 -0
  8. package/src/lib/deprecated/mocks/mockPageContext.d.ts +1 -0
  9. package/src/lib/next/__test__/mock.d.ts +2 -1
  10. package/src/lib/next/components/Column/Column.d.ts +1 -1
  11. package/src/lib/next/components/Container/Container.d.ts +1 -1
  12. package/src/lib/next/components/Container/{ContainerFallbakcs.d.ts → ContainerFallbacks.d.ts} +2 -2
  13. package/src/lib/next/components/Contentlet/Contentlet.d.ts +2 -2
  14. package/src/lib/next/components/DotCMSBlockEditorRenderer/DotCMSBlockEditorRenderer.d.ts +27 -0
  15. package/src/lib/next/components/DotCMSBlockEditorRenderer/components/BlockEditorBlock.d.ts +15 -0
  16. package/src/lib/next/components/DotCMSBlockEditorRenderer/components/blocks/Code.d.ts +24 -0
  17. package/src/lib/next/components/DotCMSBlockEditorRenderer/components/blocks/DotContent.d.ts +14 -0
  18. package/src/lib/next/components/DotCMSBlockEditorRenderer/components/blocks/Image.d.ts +10 -0
  19. package/src/lib/next/components/DotCMSBlockEditorRenderer/components/blocks/Lists.d.ts +26 -0
  20. package/src/lib/next/components/DotCMSBlockEditorRenderer/components/blocks/NoComponentProvided.d.ts +3 -0
  21. package/src/lib/next/components/DotCMSBlockEditorRenderer/components/blocks/Table.d.ts +16 -0
  22. package/src/lib/next/components/DotCMSBlockEditorRenderer/components/blocks/Texts.d.ts +81 -0
  23. package/src/lib/next/components/DotCMSBlockEditorRenderer/components/blocks/Video.d.ts +10 -0
  24. package/src/lib/next/components/DotCMSEditableText/DotCMSEditableText.d.ts +32 -0
  25. package/src/lib/next/components/DotCMSEditableText/utils.d.ts +36 -0
  26. package/src/lib/next/components/DotCMSLayoutBody/DotCMSLayoutBody.d.ts +5 -4
  27. package/src/lib/next/components/DotCMSLayoutBody/components/ErrorMessage.d.ts +1 -4
  28. package/src/lib/next/components/DotCMSShow/DotCMSShow.d.ts +49 -0
  29. package/src/lib/next/components/FallbackComponent/FallbackComponent.d.ts +6 -6
  30. package/src/lib/next/components/Row/Row.d.ts +1 -1
  31. package/src/lib/next/contexts/DotCMSPageContext.d.ts +2 -3
  32. package/src/lib/next/hooks/useDotCMSShowWhen.d.ts +31 -0
  33. package/src/lib/next/hooks/useEditableDotCMSPage.d.ts +90 -0
  34. package/src/lib/next/hooks/useIsDevMode.d.ts +2 -5
  35. package/src/next.d.ts +5 -0
  36. package/web.url-search-params.size.esm.js +4216 -0
  37. package/es.regexp.to-string.esm.js +0 -1878
  38. package/src/lib/next/types.d.ts +0 -421
  39. package/src/lib/next/utils/index.d.ts +0 -136
package/index.esm.js CHANGED
@@ -1,11 +1,11 @@
1
+ import { s as styleInject, i as iteratorCreateProxy, a as anObject$1, f as functionCall, c as callWithSafeIterationClosing$1, _ as _export, b as aCallable$1, g as getIteratorDirect$1, d as isPure } from './web.url-search-params.size.esm.js';
1
2
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
2
- import { s as styleInject, f as functionUncurryThis, t as toString$4, r as requireObjectCoercible$1, a as toIntegerOrInfinity$1, i as iteratorDefine, b as internalState, c as createIterResultObject$2, d as fails$2, w as wellKnownSymbol$4, e as descriptors, g as classofRaw$1, h as aCallable$2, j as functionBindNative, m as makeBuiltInExports, o as objectDefineProperty, k as objectIsPrototypeOf, l as functionCall, n as anObject$4, p as getMethod$2, q as iterators, u as getBuiltIn$1, v as isCallable$2, x as classof$3, y as inspectSource$1, z as createPropertyDescriptor$2, A as isNullOrUndefined$1, B as tryToString$1, C as toObject$1, D as lengthOfArrayLike$1, E as global$3, F as defineBuiltIn$5, G as arraySlice$2, _ as _export, H as setToStringTag$2, I as iteratorCreateConstructor, J as isObject$1, K as objectCreate, L as hasOwnProperty_1, M as objectAssign } from './es.regexp.to-string.esm.js';
3
3
  import { useState, useEffect, createContext, useRef, useContext, createElement, forwardRef } from 'react';
4
- import { isInsideEditor, initEditor, updateNavigation, destroyEditor, DotCmsClient, postMessageToEditor, CLIENT_ACTIONS, NOTIFY_CLIENT, initInlineEditing } from '@dotcms/client';
4
+ import { isInsideEditor, initEditor, updateNavigation, destroyEditor, postMessageToEditor, CLIENT_ACTIONS, DotCmsClient, NOTIFY_CLIENT, initInlineEditing } from '@dotcms/client';
5
+ import { UVEEventType } from '@dotcms/types';
6
+ import { createUVESubscription } from '@dotcms/uve';
5
7
  import { Editor } from '@tinymce/tinymce-react';
6
8
 
7
- var isPure = false;
8
-
9
9
  /**
10
10
  * Custom Hook to handle the DotCMS editor interaction with the page.
11
11
  *
@@ -49,12 +49,13 @@ const useDotcmsEditor = ({
49
49
  */
50
50
  useEffect(() => {
51
51
  const insideEditor = isInsideEditor();
52
- const client = DotCmsClient.instance;
53
52
  if (!insideEditor || !onReload) {
54
53
  return;
55
54
  }
56
- client.editor.on('changes', () => onReload == null ? void 0 : onReload());
57
- return () => client.editor.off('changes');
55
+ const {
56
+ unsubscribe
57
+ } = createUVESubscription(UVEEventType.CONTENT_CHANGES, () => onReload());
58
+ return () => unsubscribe();
58
59
  }, [onReload]);
59
60
  /**
60
61
  * Sends a message to the editor when the client is ready.
@@ -69,20 +70,21 @@ const useDotcmsEditor = ({
69
70
  });
70
71
  }, [pathname, editor]);
71
72
  /**
72
- * Updates the page asset when changes are made in the editor.
73
+ * Old
73
74
  */
74
75
  useEffect(() => {
75
76
  if (!isInsideEditor()) {
76
77
  return;
77
78
  }
78
- const client = DotCmsClient.instance;
79
- client.editor.on('changes', data => {
79
+ const {
80
+ unsubscribe
81
+ } = createUVESubscription(UVEEventType.CONTENT_CHANGES, data => {
80
82
  const pageAsset = data;
81
83
  setState(state => Object.assign({}, state, {
82
84
  pageAsset
83
85
  }));
84
86
  });
85
- return () => client.editor.off('changes');
87
+ return () => unsubscribe();
86
88
  }, []);
87
89
  return state;
88
90
  };
@@ -121,6 +123,41 @@ var css_248z = ".Column-module_col-start-1__pAqyF {\n grid-column-start: 1;\n
121
123
  var styles = {"col-start-1":"Column-module_col-start-1__pAqyF","col-start-2":"Column-module_col-start-2__WwVhl","col-start-3":"Column-module_col-start-3__DAtqM","col-start-4":"Column-module_col-start-4__KAXJl","col-start-5":"Column-module_col-start-5__9yg8H","col-start-6":"Column-module_col-start-6__L9Fl1","col-start-7":"Column-module_col-start-7__7GWMg","col-start-8":"Column-module_col-start-8__VPNje","col-start-9":"Column-module_col-start-9__TQinR","col-start-10":"Column-module_col-start-10__WuD2n","col-start-11":"Column-module_col-start-11__ZYzHu","col-start-12":"Column-module_col-start-12__XupQX","col-end-1":"Column-module_col-end-1__thNVg","col-end-2":"Column-module_col-end-2__7vCsE","col-end-3":"Column-module_col-end-3__TiQJe","col-end-4":"Column-module_col-end-4__66z6K","col-end-5":"Column-module_col-end-5__MLwPh","col-end-6":"Column-module_col-end-6__dz6-q","col-end-7":"Column-module_col-end-7__Loe0Q","col-end-8":"Column-module_col-end-8__NePGi","col-end-9":"Column-module_col-end-9__V0-is","col-end-10":"Column-module_col-end-10__b-1ia","col-end-11":"Column-module_col-end-11__QroWM","col-end-12":"Column-module_col-end-12__j-YYw","col-end-13":"Column-module_col-end-13__khBAA"};
122
124
  styleInject(css_248z);
123
125
 
126
+ var $ = _export;
127
+ var call = functionCall;
128
+ var aCallable = aCallable$1;
129
+ var anObject = anObject$1;
130
+ var getIteratorDirect = getIteratorDirect$1;
131
+ var createIteratorProxy = iteratorCreateProxy;
132
+ var callWithSafeIterationClosing = callWithSafeIterationClosing$1;
133
+ var IS_PURE = isPure;
134
+
135
+ var IteratorProxy = createIteratorProxy(function () {
136
+ var iterator = this.iterator;
137
+ var predicate = this.predicate;
138
+ var next = this.next;
139
+ var result, done, value;
140
+ while (true) {
141
+ result = anObject(call(next, iterator));
142
+ done = this.done = !!result.done;
143
+ if (done) return;
144
+ value = result.value;
145
+ if (callWithSafeIterationClosing(iterator, predicate, [value, this.counter++], true)) return value;
146
+ }
147
+ });
148
+
149
+ // `Iterator.prototype.filter` method
150
+ // https://github.com/tc39/proposal-iterator-helpers
151
+ $({ target: 'Iterator', proto: true, real: true, forced: IS_PURE }, {
152
+ filter: function filter(predicate) {
153
+ anObject(this);
154
+ aCallable(predicate);
155
+ return new IteratorProxy(getIteratorDirect(this), {
156
+ predicate: predicate
157
+ });
158
+ }
159
+ });
160
+
124
161
  const endClassMap = {
125
162
  1: 'col-end-1',
126
163
  2: 'col-end-2',
@@ -475,2163 +512,6 @@ function DotcmsLayout(dotPageProps) {
475
512
  });
476
513
  }
477
514
 
478
- var uncurryThis$9 = functionUncurryThis;
479
- var toIntegerOrInfinity = toIntegerOrInfinity$1;
480
- var toString$3 = toString$4;
481
- var requireObjectCoercible = requireObjectCoercible$1;
482
-
483
- var charAt$3 = uncurryThis$9(''.charAt);
484
- var charCodeAt$1 = uncurryThis$9(''.charCodeAt);
485
- var stringSlice$2 = uncurryThis$9(''.slice);
486
-
487
- var createMethod = function (CONVERT_TO_STRING) {
488
- return function ($this, pos) {
489
- var S = toString$3(requireObjectCoercible($this));
490
- var position = toIntegerOrInfinity(pos);
491
- var size = S.length;
492
- var first, second;
493
- if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
494
- first = charCodeAt$1(S, position);
495
- return first < 0xD800 || first > 0xDBFF || position + 1 === size
496
- || (second = charCodeAt$1(S, position + 1)) < 0xDC00 || second > 0xDFFF
497
- ? CONVERT_TO_STRING
498
- ? charAt$3(S, position)
499
- : first
500
- : CONVERT_TO_STRING
501
- ? stringSlice$2(S, position, position + 2)
502
- : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
503
- };
504
- };
505
-
506
- var stringMultibyte = {
507
- // `String.prototype.codePointAt` method
508
- // https://tc39.es/ecma262/#sec-string.prototype.codepointat
509
- codeAt: createMethod(false),
510
- // `String.prototype.at` method
511
- // https://github.com/mathiasbynens/String.prototype.at
512
- charAt: createMethod(true)
513
- };
514
-
515
- var charAt$2 = stringMultibyte.charAt;
516
- var toString$2 = toString$4;
517
- var InternalStateModule$2 = internalState;
518
- var defineIterator = iteratorDefine;
519
- var createIterResultObject$1 = createIterResultObject$2;
520
-
521
- var STRING_ITERATOR = 'String Iterator';
522
- var setInternalState$2 = InternalStateModule$2.set;
523
- var getInternalState = InternalStateModule$2.getterFor(STRING_ITERATOR);
524
-
525
- // `String.prototype[@@iterator]` method
526
- // https://tc39.es/ecma262/#sec-string.prototype-@@iterator
527
- defineIterator(String, 'String', function (iterated) {
528
- setInternalState$2(this, {
529
- type: STRING_ITERATOR,
530
- string: toString$2(iterated),
531
- index: 0
532
- });
533
- // `%StringIteratorPrototype%.next` method
534
- // https://tc39.es/ecma262/#sec-%stringiteratorprototype%.next
535
- }, function next() {
536
- var state = getInternalState(this);
537
- var string = state.string;
538
- var index = state.index;
539
- var point;
540
- if (index >= string.length) return createIterResultObject$1(undefined, true);
541
- point = charAt$2(string, index);
542
- state.index += point.length;
543
- return createIterResultObject$1(point, false);
544
- });
545
-
546
- var fails$1 = fails$2;
547
- var wellKnownSymbol$3 = wellKnownSymbol$4;
548
- var DESCRIPTORS$5 = descriptors;
549
- var IS_PURE = isPure;
550
-
551
- var ITERATOR$3 = wellKnownSymbol$3('iterator');
552
-
553
- var urlConstructorDetection = !fails$1(function () {
554
- // eslint-disable-next-line unicorn/relative-url-style -- required for testing
555
- var url = new URL('b?a=1&b=2&c=3', 'http://a');
556
- var params = url.searchParams;
557
- var params2 = new URLSearchParams('a=1&a=2&b=3');
558
- var result = '';
559
- url.pathname = 'c%20d';
560
- params.forEach(function (value, key) {
561
- params['delete']('b');
562
- result += key + value;
563
- });
564
- params2['delete']('a', 2);
565
- // `undefined` case is a Chromium 117 bug
566
- // https://bugs.chromium.org/p/v8/issues/detail?id=14222
567
- params2['delete']('b', undefined);
568
- return (IS_PURE && (!url.toJSON || !params2.has('a', 1) || params2.has('a', 2) || !params2.has('a', undefined) || params2.has('b')))
569
- || (!params.size && (IS_PURE || !DESCRIPTORS$5))
570
- || !params.sort
571
- || url.href !== 'http://a/c%20d?a=1&c=3'
572
- || params.get('c') !== '3'
573
- || String(new URLSearchParams('?a=1')) !== 'a=1'
574
- || !params[ITERATOR$3]
575
- // throws in Edge
576
- || new URL('https://a@b').username !== 'a'
577
- || new URLSearchParams(new URLSearchParams('a=b')).get('a') !== 'b'
578
- // not punycoded in Edge
579
- || new URL('http://тест').host !== 'xn--e1aybc'
580
- // not escaped in Chrome 62-
581
- || new URL('http://a#б').hash !== '#%D0%B1'
582
- // fails in Chrome 66-
583
- || result !== 'a1c3'
584
- // throws in Safari
585
- || new URL('http://x', undefined).host !== 'x';
586
- });
587
-
588
- var classofRaw = classofRaw$1;
589
- var uncurryThis$8 = functionUncurryThis;
590
-
591
- var functionUncurryThisClause = function (fn) {
592
- // Nashorn bug:
593
- // https://github.com/zloirock/core-js/issues/1128
594
- // https://github.com/zloirock/core-js/issues/1130
595
- if (classofRaw(fn) === 'Function') return uncurryThis$8(fn);
596
- };
597
-
598
- var uncurryThis$7 = functionUncurryThisClause;
599
- var aCallable$1 = aCallable$2;
600
- var NATIVE_BIND = functionBindNative;
601
-
602
- var bind$3 = uncurryThis$7(uncurryThis$7.bind);
603
-
604
- // optional / simple context binding
605
- var functionBindContext = function (fn, that) {
606
- aCallable$1(fn);
607
- return that === undefined ? fn : NATIVE_BIND ? bind$3(fn, that) : function (/* ...args */) {
608
- return fn.apply(that, arguments);
609
- };
610
- };
611
-
612
- var makeBuiltIn = makeBuiltInExports;
613
- var defineProperty = objectDefineProperty;
614
-
615
- var defineBuiltInAccessor$3 = function (target, name, descriptor) {
616
- if (descriptor.get) makeBuiltIn(descriptor.get, name, { getter: true });
617
- if (descriptor.set) makeBuiltIn(descriptor.set, name, { setter: true });
618
- return defineProperty.f(target, name, descriptor);
619
- };
620
-
621
- var isPrototypeOf = objectIsPrototypeOf;
622
-
623
- var $TypeError$2 = TypeError;
624
-
625
- var anInstance$2 = function (it, Prototype) {
626
- if (isPrototypeOf(Prototype, it)) return it;
627
- throw new $TypeError$2('Incorrect invocation');
628
- };
629
-
630
- var call$4 = functionCall;
631
- var anObject$3 = anObject$4;
632
- var getMethod$1 = getMethod$2;
633
-
634
- var iteratorClose$1 = function (iterator, kind, value) {
635
- var innerResult, innerError;
636
- anObject$3(iterator);
637
- try {
638
- innerResult = getMethod$1(iterator, 'return');
639
- if (!innerResult) {
640
- if (kind === 'throw') throw value;
641
- return value;
642
- }
643
- innerResult = call$4(innerResult, iterator);
644
- } catch (error) {
645
- innerError = true;
646
- innerResult = error;
647
- }
648
- if (kind === 'throw') throw value;
649
- if (innerError) throw innerResult;
650
- anObject$3(innerResult);
651
- return value;
652
- };
653
-
654
- var anObject$2 = anObject$4;
655
- var iteratorClose = iteratorClose$1;
656
-
657
- // call something on iterator step with safe closing on error
658
- var callWithSafeIterationClosing$1 = function (iterator, fn, value, ENTRIES) {
659
- try {
660
- return ENTRIES ? fn(anObject$2(value)[0], value[1]) : fn(value);
661
- } catch (error) {
662
- iteratorClose(iterator, 'throw', error);
663
- }
664
- };
665
-
666
- var wellKnownSymbol$2 = wellKnownSymbol$4;
667
- var Iterators$1 = iterators;
668
-
669
- var ITERATOR$2 = wellKnownSymbol$2('iterator');
670
- var ArrayPrototype = Array.prototype;
671
-
672
- // check on default Array iterator
673
- var isArrayIteratorMethod$1 = function (it) {
674
- return it !== undefined && (Iterators$1.Array === it || ArrayPrototype[ITERATOR$2] === it);
675
- };
676
-
677
- var uncurryThis$6 = functionUncurryThis;
678
- var fails = fails$2;
679
- var isCallable$1 = isCallable$2;
680
- var classof$2 = classof$3;
681
- var getBuiltIn = getBuiltIn$1;
682
- var inspectSource = inspectSource$1;
683
-
684
- var noop = function () { /* empty */ };
685
- var construct = getBuiltIn('Reflect', 'construct');
686
- var constructorRegExp = /^\s*(?:class|function)\b/;
687
- var exec$2 = uncurryThis$6(constructorRegExp.exec);
688
- var INCORRECT_TO_STRING = !constructorRegExp.test(noop);
689
-
690
- var isConstructorModern = function isConstructor(argument) {
691
- if (!isCallable$1(argument)) return false;
692
- try {
693
- construct(noop, [], argument);
694
- return true;
695
- } catch (error) {
696
- return false;
697
- }
698
- };
699
-
700
- var isConstructorLegacy = function isConstructor(argument) {
701
- if (!isCallable$1(argument)) return false;
702
- switch (classof$2(argument)) {
703
- case 'AsyncFunction':
704
- case 'GeneratorFunction':
705
- case 'AsyncGeneratorFunction': return false;
706
- }
707
- try {
708
- // we can't check .prototype since constructors produced by .bind haven't it
709
- // `Function#toString` throws on some built-it function in some legacy engines
710
- // (for example, `DOMQuad` and similar in FF41-)
711
- return INCORRECT_TO_STRING || !!exec$2(constructorRegExp, inspectSource(argument));
712
- } catch (error) {
713
- return true;
714
- }
715
- };
716
-
717
- isConstructorLegacy.sham = true;
718
-
719
- // `IsConstructor` abstract operation
720
- // https://tc39.es/ecma262/#sec-isconstructor
721
- var isConstructor$1 = !construct || fails(function () {
722
- var called;
723
- return isConstructorModern(isConstructorModern.call)
724
- || !isConstructorModern(Object)
725
- || !isConstructorModern(function () { called = true; })
726
- || called;
727
- }) ? isConstructorLegacy : isConstructorModern;
728
-
729
- var DESCRIPTORS$4 = descriptors;
730
- var definePropertyModule = objectDefineProperty;
731
- var createPropertyDescriptor$1 = createPropertyDescriptor$2;
732
-
733
- var createProperty$1 = function (object, key, value) {
734
- if (DESCRIPTORS$4) definePropertyModule.f(object, key, createPropertyDescriptor$1(0, value));
735
- else object[key] = value;
736
- };
737
-
738
- var classof$1 = classof$3;
739
- var getMethod = getMethod$2;
740
- var isNullOrUndefined = isNullOrUndefined$1;
741
- var Iterators = iterators;
742
- var wellKnownSymbol$1 = wellKnownSymbol$4;
743
-
744
- var ITERATOR$1 = wellKnownSymbol$1('iterator');
745
-
746
- var getIteratorMethod$3 = function (it) {
747
- if (!isNullOrUndefined(it)) return getMethod(it, ITERATOR$1)
748
- || getMethod(it, '@@iterator')
749
- || Iterators[classof$1(it)];
750
- };
751
-
752
- var call$3 = functionCall;
753
- var aCallable = aCallable$2;
754
- var anObject$1 = anObject$4;
755
- var tryToString = tryToString$1;
756
- var getIteratorMethod$2 = getIteratorMethod$3;
757
-
758
- var $TypeError$1 = TypeError;
759
-
760
- var getIterator$2 = function (argument, usingIterator) {
761
- var iteratorMethod = arguments.length < 2 ? getIteratorMethod$2(argument) : usingIterator;
762
- if (aCallable(iteratorMethod)) return anObject$1(call$3(iteratorMethod, argument));
763
- throw new $TypeError$1(tryToString(argument) + ' is not iterable');
764
- };
765
-
766
- var bind$2 = functionBindContext;
767
- var call$2 = functionCall;
768
- var toObject = toObject$1;
769
- var callWithSafeIterationClosing = callWithSafeIterationClosing$1;
770
- var isArrayIteratorMethod = isArrayIteratorMethod$1;
771
- var isConstructor = isConstructor$1;
772
- var lengthOfArrayLike = lengthOfArrayLike$1;
773
- var createProperty = createProperty$1;
774
- var getIterator$1 = getIterator$2;
775
- var getIteratorMethod$1 = getIteratorMethod$3;
776
-
777
- var $Array = Array;
778
-
779
- // `Array.from` method implementation
780
- // https://tc39.es/ecma262/#sec-array.from
781
- var arrayFrom$1 = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
782
- var O = toObject(arrayLike);
783
- var IS_CONSTRUCTOR = isConstructor(this);
784
- var argumentsLength = arguments.length;
785
- var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
786
- var mapping = mapfn !== undefined;
787
- if (mapping) mapfn = bind$2(mapfn, argumentsLength > 2 ? arguments[2] : undefined);
788
- var iteratorMethod = getIteratorMethod$1(O);
789
- var index = 0;
790
- var length, result, step, iterator, next, value;
791
- // if the target is not iterable or it's an array with the default iterator - use a simple case
792
- if (iteratorMethod && !(this === $Array && isArrayIteratorMethod(iteratorMethod))) {
793
- result = IS_CONSTRUCTOR ? new this() : [];
794
- iterator = getIterator$1(O, iteratorMethod);
795
- next = iterator.next;
796
- for (;!(step = call$2(next, iterator)).done; index++) {
797
- value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;
798
- createProperty(result, index, value);
799
- }
800
- } else {
801
- length = lengthOfArrayLike(O);
802
- result = IS_CONSTRUCTOR ? new this(length) : $Array(length);
803
- for (;length > index; index++) {
804
- value = mapping ? mapfn(O[index], index) : O[index];
805
- createProperty(result, index, value);
806
- }
807
- }
808
- result.length = index;
809
- return result;
810
- };
811
-
812
- // based on https://github.com/bestiejs/punycode.js/blob/master/punycode.js
813
- var uncurryThis$5 = functionUncurryThis;
814
-
815
- var maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1
816
- var base = 36;
817
- var tMin = 1;
818
- var tMax = 26;
819
- var skew = 38;
820
- var damp = 700;
821
- var initialBias = 72;
822
- var initialN = 128; // 0x80
823
- var delimiter = '-'; // '\x2D'
824
- var regexNonASCII = /[^\0-\u007E]/; // non-ASCII chars
825
- var regexSeparators = /[.\u3002\uFF0E\uFF61]/g; // RFC 3490 separators
826
- var OVERFLOW_ERROR = 'Overflow: input needs wider integers to process';
827
- var baseMinusTMin = base - tMin;
828
-
829
- var $RangeError = RangeError;
830
- var exec$1 = uncurryThis$5(regexSeparators.exec);
831
- var floor$2 = Math.floor;
832
- var fromCharCode = String.fromCharCode;
833
- var charCodeAt = uncurryThis$5(''.charCodeAt);
834
- var join$2 = uncurryThis$5([].join);
835
- var push$3 = uncurryThis$5([].push);
836
- var replace$2 = uncurryThis$5(''.replace);
837
- var split$2 = uncurryThis$5(''.split);
838
- var toLowerCase$1 = uncurryThis$5(''.toLowerCase);
839
-
840
- /**
841
- * Creates an array containing the numeric code points of each Unicode
842
- * character in the string. While JavaScript uses UCS-2 internally,
843
- * this function will convert a pair of surrogate halves (each of which
844
- * UCS-2 exposes as separate characters) into a single code point,
845
- * matching UTF-16.
846
- */
847
- var ucs2decode = function (string) {
848
- var output = [];
849
- var counter = 0;
850
- var length = string.length;
851
- while (counter < length) {
852
- var value = charCodeAt(string, counter++);
853
- if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
854
- // It's a high surrogate, and there is a next character.
855
- var extra = charCodeAt(string, counter++);
856
- if ((extra & 0xFC00) === 0xDC00) { // Low surrogate.
857
- push$3(output, ((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
858
- } else {
859
- // It's an unmatched surrogate; only append this code unit, in case the
860
- // next code unit is the high surrogate of a surrogate pair.
861
- push$3(output, value);
862
- counter--;
863
- }
864
- } else {
865
- push$3(output, value);
866
- }
867
- }
868
- return output;
869
- };
870
-
871
- /**
872
- * Converts a digit/integer into a basic code point.
873
- */
874
- var digitToBasic = function (digit) {
875
- // 0..25 map to ASCII a..z or A..Z
876
- // 26..35 map to ASCII 0..9
877
- return digit + 22 + 75 * (digit < 26);
878
- };
879
-
880
- /**
881
- * Bias adaptation function as per section 3.4 of RFC 3492.
882
- * https://tools.ietf.org/html/rfc3492#section-3.4
883
- */
884
- var adapt = function (delta, numPoints, firstTime) {
885
- var k = 0;
886
- delta = firstTime ? floor$2(delta / damp) : delta >> 1;
887
- delta += floor$2(delta / numPoints);
888
- while (delta > baseMinusTMin * tMax >> 1) {
889
- delta = floor$2(delta / baseMinusTMin);
890
- k += base;
891
- }
892
- return floor$2(k + (baseMinusTMin + 1) * delta / (delta + skew));
893
- };
894
-
895
- /**
896
- * Converts a string of Unicode symbols (e.g. a domain name label) to a
897
- * Punycode string of ASCII-only symbols.
898
- */
899
- var encode = function (input) {
900
- var output = [];
901
-
902
- // Convert the input in UCS-2 to an array of Unicode code points.
903
- input = ucs2decode(input);
904
-
905
- // Cache the length.
906
- var inputLength = input.length;
907
-
908
- // Initialize the state.
909
- var n = initialN;
910
- var delta = 0;
911
- var bias = initialBias;
912
- var i, currentValue;
913
-
914
- // Handle the basic code points.
915
- for (i = 0; i < input.length; i++) {
916
- currentValue = input[i];
917
- if (currentValue < 0x80) {
918
- push$3(output, fromCharCode(currentValue));
919
- }
920
- }
921
-
922
- var basicLength = output.length; // number of basic code points.
923
- var handledCPCount = basicLength; // number of code points that have been handled;
924
-
925
- // Finish the basic string with a delimiter unless it's empty.
926
- if (basicLength) {
927
- push$3(output, delimiter);
928
- }
929
-
930
- // Main encoding loop:
931
- while (handledCPCount < inputLength) {
932
- // All non-basic code points < n have been handled already. Find the next larger one:
933
- var m = maxInt;
934
- for (i = 0; i < input.length; i++) {
935
- currentValue = input[i];
936
- if (currentValue >= n && currentValue < m) {
937
- m = currentValue;
938
- }
939
- }
940
-
941
- // Increase `delta` enough to advance the decoder's <n,i> state to <m,0>, but guard against overflow.
942
- var handledCPCountPlusOne = handledCPCount + 1;
943
- if (m - n > floor$2((maxInt - delta) / handledCPCountPlusOne)) {
944
- throw new $RangeError(OVERFLOW_ERROR);
945
- }
946
-
947
- delta += (m - n) * handledCPCountPlusOne;
948
- n = m;
949
-
950
- for (i = 0; i < input.length; i++) {
951
- currentValue = input[i];
952
- if (currentValue < n && ++delta > maxInt) {
953
- throw new $RangeError(OVERFLOW_ERROR);
954
- }
955
- if (currentValue === n) {
956
- // Represent delta as a generalized variable-length integer.
957
- var q = delta;
958
- var k = base;
959
- while (true) {
960
- var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
961
- if (q < t) break;
962
- var qMinusT = q - t;
963
- var baseMinusT = base - t;
964
- push$3(output, fromCharCode(digitToBasic(t + qMinusT % baseMinusT)));
965
- q = floor$2(qMinusT / baseMinusT);
966
- k += base;
967
- }
968
-
969
- push$3(output, fromCharCode(digitToBasic(q)));
970
- bias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength);
971
- delta = 0;
972
- handledCPCount++;
973
- }
974
- }
975
-
976
- delta++;
977
- n++;
978
- }
979
- return join$2(output, '');
980
- };
981
-
982
- var stringPunycodeToAscii = function (input) {
983
- var encoded = [];
984
- var labels = split$2(replace$2(toLowerCase$1(input), regexSeparators, '\u002E'), '.');
985
- var i, label;
986
- for (i = 0; i < labels.length; i++) {
987
- label = labels[i];
988
- push$3(encoded, exec$1(regexNonASCII, label) ? 'xn--' + encode(label) : label);
989
- }
990
- return join$2(encoded, '.');
991
- };
992
-
993
- var $TypeError = TypeError;
994
-
995
- var validateArgumentsLength$4 = function (passed, required) {
996
- if (passed < required) throw new $TypeError('Not enough arguments');
997
- return passed;
998
- };
999
-
1000
- var global$2 = global$3;
1001
- var DESCRIPTORS$3 = descriptors;
1002
-
1003
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1004
- var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
1005
-
1006
- // Avoid NodeJS experimental warning
1007
- var safeGetBuiltIn$1 = function (name) {
1008
- if (!DESCRIPTORS$3) return global$2[name];
1009
- var descriptor = getOwnPropertyDescriptor(global$2, name);
1010
- return descriptor && descriptor.value;
1011
- };
1012
-
1013
- var defineBuiltIn$4 = defineBuiltIn$5;
1014
-
1015
- var defineBuiltIns$1 = function (target, src, options) {
1016
- for (var key in src) defineBuiltIn$4(target, key, src[key], options);
1017
- return target;
1018
- };
1019
-
1020
- var arraySlice$1 = arraySlice$2;
1021
-
1022
- var floor$1 = Math.floor;
1023
-
1024
- var sort = function (array, comparefn) {
1025
- var length = array.length;
1026
-
1027
- if (length < 8) {
1028
- // insertion sort
1029
- var i = 1;
1030
- var element, j;
1031
-
1032
- while (i < length) {
1033
- j = i;
1034
- element = array[i];
1035
- while (j && comparefn(array[j - 1], element) > 0) {
1036
- array[j] = array[--j];
1037
- }
1038
- if (j !== i++) array[j] = element;
1039
- }
1040
- } else {
1041
- // merge sort
1042
- var middle = floor$1(length / 2);
1043
- var left = sort(arraySlice$1(array, 0, middle), comparefn);
1044
- var right = sort(arraySlice$1(array, middle), comparefn);
1045
- var llength = left.length;
1046
- var rlength = right.length;
1047
- var lindex = 0;
1048
- var rindex = 0;
1049
-
1050
- while (lindex < llength || rindex < rlength) {
1051
- array[lindex + rindex] = (lindex < llength && rindex < rlength)
1052
- ? comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++]
1053
- : lindex < llength ? left[lindex++] : right[rindex++];
1054
- }
1055
- }
1056
-
1057
- return array;
1058
- };
1059
-
1060
- var arraySort$1 = sort;
1061
-
1062
- // TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env`
1063
-
1064
- var $$2 = _export;
1065
- var global$1 = global$3;
1066
- var safeGetBuiltIn = safeGetBuiltIn$1;
1067
- var call$1 = functionCall;
1068
- var uncurryThis$4 = functionUncurryThis;
1069
- var DESCRIPTORS$2 = descriptors;
1070
- var USE_NATIVE_URL$1 = urlConstructorDetection;
1071
- var defineBuiltIn$3 = defineBuiltIn$5;
1072
- var defineBuiltInAccessor$2 = defineBuiltInAccessor$3;
1073
- var defineBuiltIns = defineBuiltIns$1;
1074
- var setToStringTag$1 = setToStringTag$2;
1075
- var createIteratorConstructor = iteratorCreateConstructor;
1076
- var InternalStateModule$1 = internalState;
1077
- var anInstance$1 = anInstance$2;
1078
- var isCallable = isCallable$2;
1079
- var hasOwn$1 = hasOwnProperty_1;
1080
- var bind$1 = functionBindContext;
1081
- var classof = classof$3;
1082
- var anObject = anObject$4;
1083
- var isObject = isObject$1;
1084
- var $toString$1 = toString$4;
1085
- var create = objectCreate;
1086
- var createPropertyDescriptor = createPropertyDescriptor$2;
1087
- var getIterator = getIterator$2;
1088
- var getIteratorMethod = getIteratorMethod$3;
1089
- var createIterResultObject = createIterResultObject$2;
1090
- var validateArgumentsLength$3 = validateArgumentsLength$4;
1091
- var wellKnownSymbol = wellKnownSymbol$4;
1092
- var arraySort = arraySort$1;
1093
-
1094
- var ITERATOR = wellKnownSymbol('iterator');
1095
- var URL_SEARCH_PARAMS = 'URLSearchParams';
1096
- var URL_SEARCH_PARAMS_ITERATOR = URL_SEARCH_PARAMS + 'Iterator';
1097
- var setInternalState$1 = InternalStateModule$1.set;
1098
- var getInternalParamsState = InternalStateModule$1.getterFor(URL_SEARCH_PARAMS);
1099
- var getInternalIteratorState = InternalStateModule$1.getterFor(URL_SEARCH_PARAMS_ITERATOR);
1100
-
1101
- var nativeFetch = safeGetBuiltIn('fetch');
1102
- var NativeRequest = safeGetBuiltIn('Request');
1103
- var Headers = safeGetBuiltIn('Headers');
1104
- var RequestPrototype = NativeRequest && NativeRequest.prototype;
1105
- var HeadersPrototype = Headers && Headers.prototype;
1106
- var RegExp$1 = global$1.RegExp;
1107
- var TypeError$2 = global$1.TypeError;
1108
- var decodeURIComponent = global$1.decodeURIComponent;
1109
- var encodeURIComponent$1 = global$1.encodeURIComponent;
1110
- var charAt$1 = uncurryThis$4(''.charAt);
1111
- var join$1 = uncurryThis$4([].join);
1112
- var push$2 = uncurryThis$4([].push);
1113
- var replace$1 = uncurryThis$4(''.replace);
1114
- var shift$1 = uncurryThis$4([].shift);
1115
- var splice = uncurryThis$4([].splice);
1116
- var split$1 = uncurryThis$4(''.split);
1117
- var stringSlice$1 = uncurryThis$4(''.slice);
1118
-
1119
- var plus = /\+/g;
1120
- var sequences = Array(4);
1121
-
1122
- var percentSequence = function (bytes) {
1123
- return sequences[bytes - 1] || (sequences[bytes - 1] = RegExp$1('((?:%[\\da-f]{2}){' + bytes + '})', 'gi'));
1124
- };
1125
-
1126
- var percentDecode = function (sequence) {
1127
- try {
1128
- return decodeURIComponent(sequence);
1129
- } catch (error) {
1130
- return sequence;
1131
- }
1132
- };
1133
-
1134
- var deserialize = function (it) {
1135
- var result = replace$1(it, plus, ' ');
1136
- var bytes = 4;
1137
- try {
1138
- return decodeURIComponent(result);
1139
- } catch (error) {
1140
- while (bytes) {
1141
- result = replace$1(result, percentSequence(bytes--), percentDecode);
1142
- }
1143
- return result;
1144
- }
1145
- };
1146
-
1147
- var find = /[!'()~]|%20/g;
1148
-
1149
- var replacements = {
1150
- '!': '%21',
1151
- "'": '%27',
1152
- '(': '%28',
1153
- ')': '%29',
1154
- '~': '%7E',
1155
- '%20': '+'
1156
- };
1157
-
1158
- var replacer = function (match) {
1159
- return replacements[match];
1160
- };
1161
-
1162
- var serialize = function (it) {
1163
- return replace$1(encodeURIComponent$1(it), find, replacer);
1164
- };
1165
-
1166
- var URLSearchParamsIterator = createIteratorConstructor(function Iterator(params, kind) {
1167
- setInternalState$1(this, {
1168
- type: URL_SEARCH_PARAMS_ITERATOR,
1169
- target: getInternalParamsState(params).entries,
1170
- index: 0,
1171
- kind: kind
1172
- });
1173
- }, URL_SEARCH_PARAMS, function next() {
1174
- var state = getInternalIteratorState(this);
1175
- var target = state.target;
1176
- var index = state.index++;
1177
- if (!target || index >= target.length) {
1178
- state.target = undefined;
1179
- return createIterResultObject(undefined, true);
1180
- }
1181
- var entry = target[index];
1182
- switch (state.kind) {
1183
- case 'keys': return createIterResultObject(entry.key, false);
1184
- case 'values': return createIterResultObject(entry.value, false);
1185
- } return createIterResultObject([entry.key, entry.value], false);
1186
- }, true);
1187
-
1188
- var URLSearchParamsState = function (init) {
1189
- this.entries = [];
1190
- this.url = null;
1191
-
1192
- if (init !== undefined) {
1193
- if (isObject(init)) this.parseObject(init);
1194
- else this.parseQuery(typeof init == 'string' ? charAt$1(init, 0) === '?' ? stringSlice$1(init, 1) : init : $toString$1(init));
1195
- }
1196
- };
1197
-
1198
- URLSearchParamsState.prototype = {
1199
- type: URL_SEARCH_PARAMS,
1200
- bindURL: function (url) {
1201
- this.url = url;
1202
- this.update();
1203
- },
1204
- parseObject: function (object) {
1205
- var entries = this.entries;
1206
- var iteratorMethod = getIteratorMethod(object);
1207
- var iterator, next, step, entryIterator, entryNext, first, second;
1208
-
1209
- if (iteratorMethod) {
1210
- iterator = getIterator(object, iteratorMethod);
1211
- next = iterator.next;
1212
- while (!(step = call$1(next, iterator)).done) {
1213
- entryIterator = getIterator(anObject(step.value));
1214
- entryNext = entryIterator.next;
1215
- if (
1216
- (first = call$1(entryNext, entryIterator)).done ||
1217
- (second = call$1(entryNext, entryIterator)).done ||
1218
- !call$1(entryNext, entryIterator).done
1219
- ) throw new TypeError$2('Expected sequence with length 2');
1220
- push$2(entries, { key: $toString$1(first.value), value: $toString$1(second.value) });
1221
- }
1222
- } else for (var key in object) if (hasOwn$1(object, key)) {
1223
- push$2(entries, { key: key, value: $toString$1(object[key]) });
1224
- }
1225
- },
1226
- parseQuery: function (query) {
1227
- if (query) {
1228
- var entries = this.entries;
1229
- var attributes = split$1(query, '&');
1230
- var index = 0;
1231
- var attribute, entry;
1232
- while (index < attributes.length) {
1233
- attribute = attributes[index++];
1234
- if (attribute.length) {
1235
- entry = split$1(attribute, '=');
1236
- push$2(entries, {
1237
- key: deserialize(shift$1(entry)),
1238
- value: deserialize(join$1(entry, '='))
1239
- });
1240
- }
1241
- }
1242
- }
1243
- },
1244
- serialize: function () {
1245
- var entries = this.entries;
1246
- var result = [];
1247
- var index = 0;
1248
- var entry;
1249
- while (index < entries.length) {
1250
- entry = entries[index++];
1251
- push$2(result, serialize(entry.key) + '=' + serialize(entry.value));
1252
- } return join$1(result, '&');
1253
- },
1254
- update: function () {
1255
- this.entries.length = 0;
1256
- this.parseQuery(this.url.query);
1257
- },
1258
- updateURL: function () {
1259
- if (this.url) this.url.update();
1260
- }
1261
- };
1262
-
1263
- // `URLSearchParams` constructor
1264
- // https://url.spec.whatwg.org/#interface-urlsearchparams
1265
- var URLSearchParamsConstructor = function URLSearchParams(/* init */) {
1266
- anInstance$1(this, URLSearchParamsPrototype$3);
1267
- var init = arguments.length > 0 ? arguments[0] : undefined;
1268
- var state = setInternalState$1(this, new URLSearchParamsState(init));
1269
- if (!DESCRIPTORS$2) this.size = state.entries.length;
1270
- };
1271
-
1272
- var URLSearchParamsPrototype$3 = URLSearchParamsConstructor.prototype;
1273
-
1274
- defineBuiltIns(URLSearchParamsPrototype$3, {
1275
- // `URLSearchParams.prototype.append` method
1276
- // https://url.spec.whatwg.org/#dom-urlsearchparams-append
1277
- append: function append(name, value) {
1278
- var state = getInternalParamsState(this);
1279
- validateArgumentsLength$3(arguments.length, 2);
1280
- push$2(state.entries, { key: $toString$1(name), value: $toString$1(value) });
1281
- if (!DESCRIPTORS$2) this.length++;
1282
- state.updateURL();
1283
- },
1284
- // `URLSearchParams.prototype.delete` method
1285
- // https://url.spec.whatwg.org/#dom-urlsearchparams-delete
1286
- 'delete': function (name /* , value */) {
1287
- var state = getInternalParamsState(this);
1288
- var length = validateArgumentsLength$3(arguments.length, 1);
1289
- var entries = state.entries;
1290
- var key = $toString$1(name);
1291
- var $value = length < 2 ? undefined : arguments[1];
1292
- var value = $value === undefined ? $value : $toString$1($value);
1293
- var index = 0;
1294
- while (index < entries.length) {
1295
- var entry = entries[index];
1296
- if (entry.key === key && (value === undefined || entry.value === value)) {
1297
- splice(entries, index, 1);
1298
- if (value !== undefined) break;
1299
- } else index++;
1300
- }
1301
- if (!DESCRIPTORS$2) this.size = entries.length;
1302
- state.updateURL();
1303
- },
1304
- // `URLSearchParams.prototype.get` method
1305
- // https://url.spec.whatwg.org/#dom-urlsearchparams-get
1306
- get: function get(name) {
1307
- var entries = getInternalParamsState(this).entries;
1308
- validateArgumentsLength$3(arguments.length, 1);
1309
- var key = $toString$1(name);
1310
- var index = 0;
1311
- for (; index < entries.length; index++) {
1312
- if (entries[index].key === key) return entries[index].value;
1313
- }
1314
- return null;
1315
- },
1316
- // `URLSearchParams.prototype.getAll` method
1317
- // https://url.spec.whatwg.org/#dom-urlsearchparams-getall
1318
- getAll: function getAll(name) {
1319
- var entries = getInternalParamsState(this).entries;
1320
- validateArgumentsLength$3(arguments.length, 1);
1321
- var key = $toString$1(name);
1322
- var result = [];
1323
- var index = 0;
1324
- for (; index < entries.length; index++) {
1325
- if (entries[index].key === key) push$2(result, entries[index].value);
1326
- }
1327
- return result;
1328
- },
1329
- // `URLSearchParams.prototype.has` method
1330
- // https://url.spec.whatwg.org/#dom-urlsearchparams-has
1331
- has: function has(name /* , value */) {
1332
- var entries = getInternalParamsState(this).entries;
1333
- var length = validateArgumentsLength$3(arguments.length, 1);
1334
- var key = $toString$1(name);
1335
- var $value = length < 2 ? undefined : arguments[1];
1336
- var value = $value === undefined ? $value : $toString$1($value);
1337
- var index = 0;
1338
- while (index < entries.length) {
1339
- var entry = entries[index++];
1340
- if (entry.key === key && (value === undefined || entry.value === value)) return true;
1341
- }
1342
- return false;
1343
- },
1344
- // `URLSearchParams.prototype.set` method
1345
- // https://url.spec.whatwg.org/#dom-urlsearchparams-set
1346
- set: function set(name, value) {
1347
- var state = getInternalParamsState(this);
1348
- validateArgumentsLength$3(arguments.length, 1);
1349
- var entries = state.entries;
1350
- var found = false;
1351
- var key = $toString$1(name);
1352
- var val = $toString$1(value);
1353
- var index = 0;
1354
- var entry;
1355
- for (; index < entries.length; index++) {
1356
- entry = entries[index];
1357
- if (entry.key === key) {
1358
- if (found) splice(entries, index--, 1);
1359
- else {
1360
- found = true;
1361
- entry.value = val;
1362
- }
1363
- }
1364
- }
1365
- if (!found) push$2(entries, { key: key, value: val });
1366
- if (!DESCRIPTORS$2) this.size = entries.length;
1367
- state.updateURL();
1368
- },
1369
- // `URLSearchParams.prototype.sort` method
1370
- // https://url.spec.whatwg.org/#dom-urlsearchparams-sort
1371
- sort: function sort() {
1372
- var state = getInternalParamsState(this);
1373
- arraySort(state.entries, function (a, b) {
1374
- return a.key > b.key ? 1 : -1;
1375
- });
1376
- state.updateURL();
1377
- },
1378
- // `URLSearchParams.prototype.forEach` method
1379
- forEach: function forEach(callback /* , thisArg */) {
1380
- var entries = getInternalParamsState(this).entries;
1381
- var boundFunction = bind$1(callback, arguments.length > 1 ? arguments[1] : undefined);
1382
- var index = 0;
1383
- var entry;
1384
- while (index < entries.length) {
1385
- entry = entries[index++];
1386
- boundFunction(entry.value, entry.key, this);
1387
- }
1388
- },
1389
- // `URLSearchParams.prototype.keys` method
1390
- keys: function keys() {
1391
- return new URLSearchParamsIterator(this, 'keys');
1392
- },
1393
- // `URLSearchParams.prototype.values` method
1394
- values: function values() {
1395
- return new URLSearchParamsIterator(this, 'values');
1396
- },
1397
- // `URLSearchParams.prototype.entries` method
1398
- entries: function entries() {
1399
- return new URLSearchParamsIterator(this, 'entries');
1400
- }
1401
- }, { enumerable: true });
1402
-
1403
- // `URLSearchParams.prototype[@@iterator]` method
1404
- defineBuiltIn$3(URLSearchParamsPrototype$3, ITERATOR, URLSearchParamsPrototype$3.entries, { name: 'entries' });
1405
-
1406
- // `URLSearchParams.prototype.toString` method
1407
- // https://url.spec.whatwg.org/#urlsearchparams-stringification-behavior
1408
- defineBuiltIn$3(URLSearchParamsPrototype$3, 'toString', function toString() {
1409
- return getInternalParamsState(this).serialize();
1410
- }, { enumerable: true });
1411
-
1412
- // `URLSearchParams.prototype.size` getter
1413
- // https://github.com/whatwg/url/pull/734
1414
- if (DESCRIPTORS$2) defineBuiltInAccessor$2(URLSearchParamsPrototype$3, 'size', {
1415
- get: function size() {
1416
- return getInternalParamsState(this).entries.length;
1417
- },
1418
- configurable: true,
1419
- enumerable: true
1420
- });
1421
-
1422
- setToStringTag$1(URLSearchParamsConstructor, URL_SEARCH_PARAMS);
1423
-
1424
- $$2({ global: true, constructor: true, forced: !USE_NATIVE_URL$1 }, {
1425
- URLSearchParams: URLSearchParamsConstructor
1426
- });
1427
-
1428
- // Wrap `fetch` and `Request` for correct work with polyfilled `URLSearchParams`
1429
- if (!USE_NATIVE_URL$1 && isCallable(Headers)) {
1430
- var headersHas = uncurryThis$4(HeadersPrototype.has);
1431
- var headersSet = uncurryThis$4(HeadersPrototype.set);
1432
-
1433
- var wrapRequestOptions = function (init) {
1434
- if (isObject(init)) {
1435
- var body = init.body;
1436
- var headers;
1437
- if (classof(body) === URL_SEARCH_PARAMS) {
1438
- headers = init.headers ? new Headers(init.headers) : new Headers();
1439
- if (!headersHas(headers, 'content-type')) {
1440
- headersSet(headers, 'content-type', 'application/x-www-form-urlencoded;charset=UTF-8');
1441
- }
1442
- return create(init, {
1443
- body: createPropertyDescriptor(0, $toString$1(body)),
1444
- headers: createPropertyDescriptor(0, headers)
1445
- });
1446
- }
1447
- } return init;
1448
- };
1449
-
1450
- if (isCallable(nativeFetch)) {
1451
- $$2({ global: true, enumerable: true, dontCallGetSet: true, forced: true }, {
1452
- fetch: function fetch(input /* , init */) {
1453
- return nativeFetch(input, arguments.length > 1 ? wrapRequestOptions(arguments[1]) : {});
1454
- }
1455
- });
1456
- }
1457
-
1458
- if (isCallable(NativeRequest)) {
1459
- var RequestConstructor = function Request(input /* , init */) {
1460
- anInstance$1(this, RequestPrototype);
1461
- return new NativeRequest(input, arguments.length > 1 ? wrapRequestOptions(arguments[1]) : {});
1462
- };
1463
-
1464
- RequestPrototype.constructor = RequestConstructor;
1465
- RequestConstructor.prototype = RequestPrototype;
1466
-
1467
- $$2({ global: true, constructor: true, dontCallGetSet: true, forced: true }, {
1468
- Request: RequestConstructor
1469
- });
1470
- }
1471
- }
1472
-
1473
- var web_urlSearchParams_constructor = {
1474
- URLSearchParams: URLSearchParamsConstructor,
1475
- getState: getInternalParamsState
1476
- };
1477
-
1478
- // TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env`
1479
-
1480
- var $$1 = _export;
1481
- var DESCRIPTORS$1 = descriptors;
1482
- var USE_NATIVE_URL = urlConstructorDetection;
1483
- var global = global$3;
1484
- var bind = functionBindContext;
1485
- var uncurryThis$3 = functionUncurryThis;
1486
- var defineBuiltIn$2 = defineBuiltIn$5;
1487
- var defineBuiltInAccessor$1 = defineBuiltInAccessor$3;
1488
- var anInstance = anInstance$2;
1489
- var hasOwn = hasOwnProperty_1;
1490
- var assign = objectAssign;
1491
- var arrayFrom = arrayFrom$1;
1492
- var arraySlice = arraySlice$2;
1493
- var codeAt = stringMultibyte.codeAt;
1494
- var toASCII = stringPunycodeToAscii;
1495
- var $toString = toString$4;
1496
- var setToStringTag = setToStringTag$2;
1497
- var validateArgumentsLength$2 = validateArgumentsLength$4;
1498
- var URLSearchParamsModule = web_urlSearchParams_constructor;
1499
- var InternalStateModule = internalState;
1500
-
1501
- var setInternalState = InternalStateModule.set;
1502
- var getInternalURLState = InternalStateModule.getterFor('URL');
1503
- var URLSearchParams$1 = URLSearchParamsModule.URLSearchParams;
1504
- var getInternalSearchParamsState = URLSearchParamsModule.getState;
1505
-
1506
- var NativeURL = global.URL;
1507
- var TypeError$1 = global.TypeError;
1508
- var parseInt = global.parseInt;
1509
- var floor = Math.floor;
1510
- var pow = Math.pow;
1511
- var charAt = uncurryThis$3(''.charAt);
1512
- var exec = uncurryThis$3(/./.exec);
1513
- var join = uncurryThis$3([].join);
1514
- var numberToString = uncurryThis$3(1.0.toString);
1515
- var pop = uncurryThis$3([].pop);
1516
- var push$1 = uncurryThis$3([].push);
1517
- var replace = uncurryThis$3(''.replace);
1518
- var shift = uncurryThis$3([].shift);
1519
- var split = uncurryThis$3(''.split);
1520
- var stringSlice = uncurryThis$3(''.slice);
1521
- var toLowerCase = uncurryThis$3(''.toLowerCase);
1522
- var unshift = uncurryThis$3([].unshift);
1523
-
1524
- var INVALID_AUTHORITY = 'Invalid authority';
1525
- var INVALID_SCHEME = 'Invalid scheme';
1526
- var INVALID_HOST = 'Invalid host';
1527
- var INVALID_PORT = 'Invalid port';
1528
-
1529
- var ALPHA = /[a-z]/i;
1530
- // eslint-disable-next-line regexp/no-obscure-range -- safe
1531
- var ALPHANUMERIC = /[\d+-.a-z]/i;
1532
- var DIGIT = /\d/;
1533
- var HEX_START = /^0x/i;
1534
- var OCT = /^[0-7]+$/;
1535
- var DEC = /^\d+$/;
1536
- var HEX = /^[\da-f]+$/i;
1537
- /* eslint-disable regexp/no-control-character -- safe */
1538
- var FORBIDDEN_HOST_CODE_POINT = /[\0\t\n\r #%/:<>?@[\\\]^|]/;
1539
- var FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT = /[\0\t\n\r #/:<>?@[\\\]^|]/;
1540
- var LEADING_C0_CONTROL_OR_SPACE = /^[\u0000-\u0020]+/;
1541
- var TRAILING_C0_CONTROL_OR_SPACE = /(^|[^\u0000-\u0020])[\u0000-\u0020]+$/;
1542
- var TAB_AND_NEW_LINE = /[\t\n\r]/g;
1543
- /* eslint-enable regexp/no-control-character -- safe */
1544
- var EOF;
1545
-
1546
- // https://url.spec.whatwg.org/#ipv4-number-parser
1547
- var parseIPv4 = function (input) {
1548
- var parts = split(input, '.');
1549
- var partsLength, numbers, index, part, radix, number, ipv4;
1550
- if (parts.length && parts[parts.length - 1] === '') {
1551
- parts.length--;
1552
- }
1553
- partsLength = parts.length;
1554
- if (partsLength > 4) return input;
1555
- numbers = [];
1556
- for (index = 0; index < partsLength; index++) {
1557
- part = parts[index];
1558
- if (part === '') return input;
1559
- radix = 10;
1560
- if (part.length > 1 && charAt(part, 0) === '0') {
1561
- radix = exec(HEX_START, part) ? 16 : 8;
1562
- part = stringSlice(part, radix === 8 ? 1 : 2);
1563
- }
1564
- if (part === '') {
1565
- number = 0;
1566
- } else {
1567
- if (!exec(radix === 10 ? DEC : radix === 8 ? OCT : HEX, part)) return input;
1568
- number = parseInt(part, radix);
1569
- }
1570
- push$1(numbers, number);
1571
- }
1572
- for (index = 0; index < partsLength; index++) {
1573
- number = numbers[index];
1574
- if (index === partsLength - 1) {
1575
- if (number >= pow(256, 5 - partsLength)) return null;
1576
- } else if (number > 255) return null;
1577
- }
1578
- ipv4 = pop(numbers);
1579
- for (index = 0; index < numbers.length; index++) {
1580
- ipv4 += numbers[index] * pow(256, 3 - index);
1581
- }
1582
- return ipv4;
1583
- };
1584
-
1585
- // https://url.spec.whatwg.org/#concept-ipv6-parser
1586
- // eslint-disable-next-line max-statements -- TODO
1587
- var parseIPv6 = function (input) {
1588
- var address = [0, 0, 0, 0, 0, 0, 0, 0];
1589
- var pieceIndex = 0;
1590
- var compress = null;
1591
- var pointer = 0;
1592
- var value, length, numbersSeen, ipv4Piece, number, swaps, swap;
1593
-
1594
- var chr = function () {
1595
- return charAt(input, pointer);
1596
- };
1597
-
1598
- if (chr() === ':') {
1599
- if (charAt(input, 1) !== ':') return;
1600
- pointer += 2;
1601
- pieceIndex++;
1602
- compress = pieceIndex;
1603
- }
1604
- while (chr()) {
1605
- if (pieceIndex === 8) return;
1606
- if (chr() === ':') {
1607
- if (compress !== null) return;
1608
- pointer++;
1609
- pieceIndex++;
1610
- compress = pieceIndex;
1611
- continue;
1612
- }
1613
- value = length = 0;
1614
- while (length < 4 && exec(HEX, chr())) {
1615
- value = value * 16 + parseInt(chr(), 16);
1616
- pointer++;
1617
- length++;
1618
- }
1619
- if (chr() === '.') {
1620
- if (length === 0) return;
1621
- pointer -= length;
1622
- if (pieceIndex > 6) return;
1623
- numbersSeen = 0;
1624
- while (chr()) {
1625
- ipv4Piece = null;
1626
- if (numbersSeen > 0) {
1627
- if (chr() === '.' && numbersSeen < 4) pointer++;
1628
- else return;
1629
- }
1630
- if (!exec(DIGIT, chr())) return;
1631
- while (exec(DIGIT, chr())) {
1632
- number = parseInt(chr(), 10);
1633
- if (ipv4Piece === null) ipv4Piece = number;
1634
- else if (ipv4Piece === 0) return;
1635
- else ipv4Piece = ipv4Piece * 10 + number;
1636
- if (ipv4Piece > 255) return;
1637
- pointer++;
1638
- }
1639
- address[pieceIndex] = address[pieceIndex] * 256 + ipv4Piece;
1640
- numbersSeen++;
1641
- if (numbersSeen === 2 || numbersSeen === 4) pieceIndex++;
1642
- }
1643
- if (numbersSeen !== 4) return;
1644
- break;
1645
- } else if (chr() === ':') {
1646
- pointer++;
1647
- if (!chr()) return;
1648
- } else if (chr()) return;
1649
- address[pieceIndex++] = value;
1650
- }
1651
- if (compress !== null) {
1652
- swaps = pieceIndex - compress;
1653
- pieceIndex = 7;
1654
- while (pieceIndex !== 0 && swaps > 0) {
1655
- swap = address[pieceIndex];
1656
- address[pieceIndex--] = address[compress + swaps - 1];
1657
- address[compress + --swaps] = swap;
1658
- }
1659
- } else if (pieceIndex !== 8) return;
1660
- return address;
1661
- };
1662
-
1663
- var findLongestZeroSequence = function (ipv6) {
1664
- var maxIndex = null;
1665
- var maxLength = 1;
1666
- var currStart = null;
1667
- var currLength = 0;
1668
- var index = 0;
1669
- for (; index < 8; index++) {
1670
- if (ipv6[index] !== 0) {
1671
- if (currLength > maxLength) {
1672
- maxIndex = currStart;
1673
- maxLength = currLength;
1674
- }
1675
- currStart = null;
1676
- currLength = 0;
1677
- } else {
1678
- if (currStart === null) currStart = index;
1679
- ++currLength;
1680
- }
1681
- }
1682
- if (currLength > maxLength) {
1683
- maxIndex = currStart;
1684
- maxLength = currLength;
1685
- }
1686
- return maxIndex;
1687
- };
1688
-
1689
- // https://url.spec.whatwg.org/#host-serializing
1690
- var serializeHost = function (host) {
1691
- var result, index, compress, ignore0;
1692
- // ipv4
1693
- if (typeof host == 'number') {
1694
- result = [];
1695
- for (index = 0; index < 4; index++) {
1696
- unshift(result, host % 256);
1697
- host = floor(host / 256);
1698
- } return join(result, '.');
1699
- // ipv6
1700
- } else if (typeof host == 'object') {
1701
- result = '';
1702
- compress = findLongestZeroSequence(host);
1703
- for (index = 0; index < 8; index++) {
1704
- if (ignore0 && host[index] === 0) continue;
1705
- if (ignore0) ignore0 = false;
1706
- if (compress === index) {
1707
- result += index ? ':' : '::';
1708
- ignore0 = true;
1709
- } else {
1710
- result += numberToString(host[index], 16);
1711
- if (index < 7) result += ':';
1712
- }
1713
- }
1714
- return '[' + result + ']';
1715
- } return host;
1716
- };
1717
-
1718
- var C0ControlPercentEncodeSet = {};
1719
- var fragmentPercentEncodeSet = assign({}, C0ControlPercentEncodeSet, {
1720
- ' ': 1, '"': 1, '<': 1, '>': 1, '`': 1
1721
- });
1722
- var pathPercentEncodeSet = assign({}, fragmentPercentEncodeSet, {
1723
- '#': 1, '?': 1, '{': 1, '}': 1
1724
- });
1725
- var userinfoPercentEncodeSet = assign({}, pathPercentEncodeSet, {
1726
- '/': 1, ':': 1, ';': 1, '=': 1, '@': 1, '[': 1, '\\': 1, ']': 1, '^': 1, '|': 1
1727
- });
1728
-
1729
- var percentEncode = function (chr, set) {
1730
- var code = codeAt(chr, 0);
1731
- return code > 0x20 && code < 0x7F && !hasOwn(set, chr) ? chr : encodeURIComponent(chr);
1732
- };
1733
-
1734
- // https://url.spec.whatwg.org/#special-scheme
1735
- var specialSchemes = {
1736
- ftp: 21,
1737
- file: null,
1738
- http: 80,
1739
- https: 443,
1740
- ws: 80,
1741
- wss: 443
1742
- };
1743
-
1744
- // https://url.spec.whatwg.org/#windows-drive-letter
1745
- var isWindowsDriveLetter = function (string, normalized) {
1746
- var second;
1747
- return string.length === 2 && exec(ALPHA, charAt(string, 0))
1748
- && ((second = charAt(string, 1)) === ':' || (!normalized && second === '|'));
1749
- };
1750
-
1751
- // https://url.spec.whatwg.org/#start-with-a-windows-drive-letter
1752
- var startsWithWindowsDriveLetter = function (string) {
1753
- var third;
1754
- return string.length > 1 && isWindowsDriveLetter(stringSlice(string, 0, 2)) && (
1755
- string.length === 2 ||
1756
- ((third = charAt(string, 2)) === '/' || third === '\\' || third === '?' || third === '#')
1757
- );
1758
- };
1759
-
1760
- // https://url.spec.whatwg.org/#single-dot-path-segment
1761
- var isSingleDot = function (segment) {
1762
- return segment === '.' || toLowerCase(segment) === '%2e';
1763
- };
1764
-
1765
- // https://url.spec.whatwg.org/#double-dot-path-segment
1766
- var isDoubleDot = function (segment) {
1767
- segment = toLowerCase(segment);
1768
- return segment === '..' || segment === '%2e.' || segment === '.%2e' || segment === '%2e%2e';
1769
- };
1770
-
1771
- // States:
1772
- var SCHEME_START = {};
1773
- var SCHEME = {};
1774
- var NO_SCHEME = {};
1775
- var SPECIAL_RELATIVE_OR_AUTHORITY = {};
1776
- var PATH_OR_AUTHORITY = {};
1777
- var RELATIVE = {};
1778
- var RELATIVE_SLASH = {};
1779
- var SPECIAL_AUTHORITY_SLASHES = {};
1780
- var SPECIAL_AUTHORITY_IGNORE_SLASHES = {};
1781
- var AUTHORITY = {};
1782
- var HOST = {};
1783
- var HOSTNAME = {};
1784
- var PORT = {};
1785
- var FILE = {};
1786
- var FILE_SLASH = {};
1787
- var FILE_HOST = {};
1788
- var PATH_START = {};
1789
- var PATH = {};
1790
- var CANNOT_BE_A_BASE_URL_PATH = {};
1791
- var QUERY = {};
1792
- var FRAGMENT = {};
1793
-
1794
- var URLState = function (url, isBase, base) {
1795
- var urlString = $toString(url);
1796
- var baseState, failure, searchParams;
1797
- if (isBase) {
1798
- failure = this.parse(urlString);
1799
- if (failure) throw new TypeError$1(failure);
1800
- this.searchParams = null;
1801
- } else {
1802
- if (base !== undefined) baseState = new URLState(base, true);
1803
- failure = this.parse(urlString, null, baseState);
1804
- if (failure) throw new TypeError$1(failure);
1805
- searchParams = getInternalSearchParamsState(new URLSearchParams$1());
1806
- searchParams.bindURL(this);
1807
- this.searchParams = searchParams;
1808
- }
1809
- };
1810
-
1811
- URLState.prototype = {
1812
- type: 'URL',
1813
- // https://url.spec.whatwg.org/#url-parsing
1814
- // eslint-disable-next-line max-statements -- TODO
1815
- parse: function (input, stateOverride, base) {
1816
- var url = this;
1817
- var state = stateOverride || SCHEME_START;
1818
- var pointer = 0;
1819
- var buffer = '';
1820
- var seenAt = false;
1821
- var seenBracket = false;
1822
- var seenPasswordToken = false;
1823
- var codePoints, chr, bufferCodePoints, failure;
1824
-
1825
- input = $toString(input);
1826
-
1827
- if (!stateOverride) {
1828
- url.scheme = '';
1829
- url.username = '';
1830
- url.password = '';
1831
- url.host = null;
1832
- url.port = null;
1833
- url.path = [];
1834
- url.query = null;
1835
- url.fragment = null;
1836
- url.cannotBeABaseURL = false;
1837
- input = replace(input, LEADING_C0_CONTROL_OR_SPACE, '');
1838
- input = replace(input, TRAILING_C0_CONTROL_OR_SPACE, '$1');
1839
- }
1840
-
1841
- input = replace(input, TAB_AND_NEW_LINE, '');
1842
-
1843
- codePoints = arrayFrom(input);
1844
-
1845
- while (pointer <= codePoints.length) {
1846
- chr = codePoints[pointer];
1847
- switch (state) {
1848
- case SCHEME_START:
1849
- if (chr && exec(ALPHA, chr)) {
1850
- buffer += toLowerCase(chr);
1851
- state = SCHEME;
1852
- } else if (!stateOverride) {
1853
- state = NO_SCHEME;
1854
- continue;
1855
- } else return INVALID_SCHEME;
1856
- break;
1857
-
1858
- case SCHEME:
1859
- if (chr && (exec(ALPHANUMERIC, chr) || chr === '+' || chr === '-' || chr === '.')) {
1860
- buffer += toLowerCase(chr);
1861
- } else if (chr === ':') {
1862
- if (stateOverride && (
1863
- (url.isSpecial() !== hasOwn(specialSchemes, buffer)) ||
1864
- (buffer === 'file' && (url.includesCredentials() || url.port !== null)) ||
1865
- (url.scheme === 'file' && !url.host)
1866
- )) return;
1867
- url.scheme = buffer;
1868
- if (stateOverride) {
1869
- if (url.isSpecial() && specialSchemes[url.scheme] === url.port) url.port = null;
1870
- return;
1871
- }
1872
- buffer = '';
1873
- if (url.scheme === 'file') {
1874
- state = FILE;
1875
- } else if (url.isSpecial() && base && base.scheme === url.scheme) {
1876
- state = SPECIAL_RELATIVE_OR_AUTHORITY;
1877
- } else if (url.isSpecial()) {
1878
- state = SPECIAL_AUTHORITY_SLASHES;
1879
- } else if (codePoints[pointer + 1] === '/') {
1880
- state = PATH_OR_AUTHORITY;
1881
- pointer++;
1882
- } else {
1883
- url.cannotBeABaseURL = true;
1884
- push$1(url.path, '');
1885
- state = CANNOT_BE_A_BASE_URL_PATH;
1886
- }
1887
- } else if (!stateOverride) {
1888
- buffer = '';
1889
- state = NO_SCHEME;
1890
- pointer = 0;
1891
- continue;
1892
- } else return INVALID_SCHEME;
1893
- break;
1894
-
1895
- case NO_SCHEME:
1896
- if (!base || (base.cannotBeABaseURL && chr !== '#')) return INVALID_SCHEME;
1897
- if (base.cannotBeABaseURL && chr === '#') {
1898
- url.scheme = base.scheme;
1899
- url.path = arraySlice(base.path);
1900
- url.query = base.query;
1901
- url.fragment = '';
1902
- url.cannotBeABaseURL = true;
1903
- state = FRAGMENT;
1904
- break;
1905
- }
1906
- state = base.scheme === 'file' ? FILE : RELATIVE;
1907
- continue;
1908
-
1909
- case SPECIAL_RELATIVE_OR_AUTHORITY:
1910
- if (chr === '/' && codePoints[pointer + 1] === '/') {
1911
- state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
1912
- pointer++;
1913
- } else {
1914
- state = RELATIVE;
1915
- continue;
1916
- } break;
1917
-
1918
- case PATH_OR_AUTHORITY:
1919
- if (chr === '/') {
1920
- state = AUTHORITY;
1921
- break;
1922
- } else {
1923
- state = PATH;
1924
- continue;
1925
- }
1926
-
1927
- case RELATIVE:
1928
- url.scheme = base.scheme;
1929
- if (chr === EOF) {
1930
- url.username = base.username;
1931
- url.password = base.password;
1932
- url.host = base.host;
1933
- url.port = base.port;
1934
- url.path = arraySlice(base.path);
1935
- url.query = base.query;
1936
- } else if (chr === '/' || (chr === '\\' && url.isSpecial())) {
1937
- state = RELATIVE_SLASH;
1938
- } else if (chr === '?') {
1939
- url.username = base.username;
1940
- url.password = base.password;
1941
- url.host = base.host;
1942
- url.port = base.port;
1943
- url.path = arraySlice(base.path);
1944
- url.query = '';
1945
- state = QUERY;
1946
- } else if (chr === '#') {
1947
- url.username = base.username;
1948
- url.password = base.password;
1949
- url.host = base.host;
1950
- url.port = base.port;
1951
- url.path = arraySlice(base.path);
1952
- url.query = base.query;
1953
- url.fragment = '';
1954
- state = FRAGMENT;
1955
- } else {
1956
- url.username = base.username;
1957
- url.password = base.password;
1958
- url.host = base.host;
1959
- url.port = base.port;
1960
- url.path = arraySlice(base.path);
1961
- url.path.length--;
1962
- state = PATH;
1963
- continue;
1964
- } break;
1965
-
1966
- case RELATIVE_SLASH:
1967
- if (url.isSpecial() && (chr === '/' || chr === '\\')) {
1968
- state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
1969
- } else if (chr === '/') {
1970
- state = AUTHORITY;
1971
- } else {
1972
- url.username = base.username;
1973
- url.password = base.password;
1974
- url.host = base.host;
1975
- url.port = base.port;
1976
- state = PATH;
1977
- continue;
1978
- } break;
1979
-
1980
- case SPECIAL_AUTHORITY_SLASHES:
1981
- state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
1982
- if (chr !== '/' || charAt(buffer, pointer + 1) !== '/') continue;
1983
- pointer++;
1984
- break;
1985
-
1986
- case SPECIAL_AUTHORITY_IGNORE_SLASHES:
1987
- if (chr !== '/' && chr !== '\\') {
1988
- state = AUTHORITY;
1989
- continue;
1990
- } break;
1991
-
1992
- case AUTHORITY:
1993
- if (chr === '@') {
1994
- if (seenAt) buffer = '%40' + buffer;
1995
- seenAt = true;
1996
- bufferCodePoints = arrayFrom(buffer);
1997
- for (var i = 0; i < bufferCodePoints.length; i++) {
1998
- var codePoint = bufferCodePoints[i];
1999
- if (codePoint === ':' && !seenPasswordToken) {
2000
- seenPasswordToken = true;
2001
- continue;
2002
- }
2003
- var encodedCodePoints = percentEncode(codePoint, userinfoPercentEncodeSet);
2004
- if (seenPasswordToken) url.password += encodedCodePoints;
2005
- else url.username += encodedCodePoints;
2006
- }
2007
- buffer = '';
2008
- } else if (
2009
- chr === EOF || chr === '/' || chr === '?' || chr === '#' ||
2010
- (chr === '\\' && url.isSpecial())
2011
- ) {
2012
- if (seenAt && buffer === '') return INVALID_AUTHORITY;
2013
- pointer -= arrayFrom(buffer).length + 1;
2014
- buffer = '';
2015
- state = HOST;
2016
- } else buffer += chr;
2017
- break;
2018
-
2019
- case HOST:
2020
- case HOSTNAME:
2021
- if (stateOverride && url.scheme === 'file') {
2022
- state = FILE_HOST;
2023
- continue;
2024
- } else if (chr === ':' && !seenBracket) {
2025
- if (buffer === '') return INVALID_HOST;
2026
- failure = url.parseHost(buffer);
2027
- if (failure) return failure;
2028
- buffer = '';
2029
- state = PORT;
2030
- if (stateOverride === HOSTNAME) return;
2031
- } else if (
2032
- chr === EOF || chr === '/' || chr === '?' || chr === '#' ||
2033
- (chr === '\\' && url.isSpecial())
2034
- ) {
2035
- if (url.isSpecial() && buffer === '') return INVALID_HOST;
2036
- if (stateOverride && buffer === '' && (url.includesCredentials() || url.port !== null)) return;
2037
- failure = url.parseHost(buffer);
2038
- if (failure) return failure;
2039
- buffer = '';
2040
- state = PATH_START;
2041
- if (stateOverride) return;
2042
- continue;
2043
- } else {
2044
- if (chr === '[') seenBracket = true;
2045
- else if (chr === ']') seenBracket = false;
2046
- buffer += chr;
2047
- } break;
2048
-
2049
- case PORT:
2050
- if (exec(DIGIT, chr)) {
2051
- buffer += chr;
2052
- } else if (
2053
- chr === EOF || chr === '/' || chr === '?' || chr === '#' ||
2054
- (chr === '\\' && url.isSpecial()) ||
2055
- stateOverride
2056
- ) {
2057
- if (buffer !== '') {
2058
- var port = parseInt(buffer, 10);
2059
- if (port > 0xFFFF) return INVALID_PORT;
2060
- url.port = (url.isSpecial() && port === specialSchemes[url.scheme]) ? null : port;
2061
- buffer = '';
2062
- }
2063
- if (stateOverride) return;
2064
- state = PATH_START;
2065
- continue;
2066
- } else return INVALID_PORT;
2067
- break;
2068
-
2069
- case FILE:
2070
- url.scheme = 'file';
2071
- if (chr === '/' || chr === '\\') state = FILE_SLASH;
2072
- else if (base && base.scheme === 'file') {
2073
- switch (chr) {
2074
- case EOF:
2075
- url.host = base.host;
2076
- url.path = arraySlice(base.path);
2077
- url.query = base.query;
2078
- break;
2079
- case '?':
2080
- url.host = base.host;
2081
- url.path = arraySlice(base.path);
2082
- url.query = '';
2083
- state = QUERY;
2084
- break;
2085
- case '#':
2086
- url.host = base.host;
2087
- url.path = arraySlice(base.path);
2088
- url.query = base.query;
2089
- url.fragment = '';
2090
- state = FRAGMENT;
2091
- break;
2092
- default:
2093
- if (!startsWithWindowsDriveLetter(join(arraySlice(codePoints, pointer), ''))) {
2094
- url.host = base.host;
2095
- url.path = arraySlice(base.path);
2096
- url.shortenPath();
2097
- }
2098
- state = PATH;
2099
- continue;
2100
- }
2101
- } else {
2102
- state = PATH;
2103
- continue;
2104
- } break;
2105
-
2106
- case FILE_SLASH:
2107
- if (chr === '/' || chr === '\\') {
2108
- state = FILE_HOST;
2109
- break;
2110
- }
2111
- if (base && base.scheme === 'file' && !startsWithWindowsDriveLetter(join(arraySlice(codePoints, pointer), ''))) {
2112
- if (isWindowsDriveLetter(base.path[0], true)) push$1(url.path, base.path[0]);
2113
- else url.host = base.host;
2114
- }
2115
- state = PATH;
2116
- continue;
2117
-
2118
- case FILE_HOST:
2119
- if (chr === EOF || chr === '/' || chr === '\\' || chr === '?' || chr === '#') {
2120
- if (!stateOverride && isWindowsDriveLetter(buffer)) {
2121
- state = PATH;
2122
- } else if (buffer === '') {
2123
- url.host = '';
2124
- if (stateOverride) return;
2125
- state = PATH_START;
2126
- } else {
2127
- failure = url.parseHost(buffer);
2128
- if (failure) return failure;
2129
- if (url.host === 'localhost') url.host = '';
2130
- if (stateOverride) return;
2131
- buffer = '';
2132
- state = PATH_START;
2133
- } continue;
2134
- } else buffer += chr;
2135
- break;
2136
-
2137
- case PATH_START:
2138
- if (url.isSpecial()) {
2139
- state = PATH;
2140
- if (chr !== '/' && chr !== '\\') continue;
2141
- } else if (!stateOverride && chr === '?') {
2142
- url.query = '';
2143
- state = QUERY;
2144
- } else if (!stateOverride && chr === '#') {
2145
- url.fragment = '';
2146
- state = FRAGMENT;
2147
- } else if (chr !== EOF) {
2148
- state = PATH;
2149
- if (chr !== '/') continue;
2150
- } break;
2151
-
2152
- case PATH:
2153
- if (
2154
- chr === EOF || chr === '/' ||
2155
- (chr === '\\' && url.isSpecial()) ||
2156
- (!stateOverride && (chr === '?' || chr === '#'))
2157
- ) {
2158
- if (isDoubleDot(buffer)) {
2159
- url.shortenPath();
2160
- if (chr !== '/' && !(chr === '\\' && url.isSpecial())) {
2161
- push$1(url.path, '');
2162
- }
2163
- } else if (isSingleDot(buffer)) {
2164
- if (chr !== '/' && !(chr === '\\' && url.isSpecial())) {
2165
- push$1(url.path, '');
2166
- }
2167
- } else {
2168
- if (url.scheme === 'file' && !url.path.length && isWindowsDriveLetter(buffer)) {
2169
- if (url.host) url.host = '';
2170
- buffer = charAt(buffer, 0) + ':'; // normalize windows drive letter
2171
- }
2172
- push$1(url.path, buffer);
2173
- }
2174
- buffer = '';
2175
- if (url.scheme === 'file' && (chr === EOF || chr === '?' || chr === '#')) {
2176
- while (url.path.length > 1 && url.path[0] === '') {
2177
- shift(url.path);
2178
- }
2179
- }
2180
- if (chr === '?') {
2181
- url.query = '';
2182
- state = QUERY;
2183
- } else if (chr === '#') {
2184
- url.fragment = '';
2185
- state = FRAGMENT;
2186
- }
2187
- } else {
2188
- buffer += percentEncode(chr, pathPercentEncodeSet);
2189
- } break;
2190
-
2191
- case CANNOT_BE_A_BASE_URL_PATH:
2192
- if (chr === '?') {
2193
- url.query = '';
2194
- state = QUERY;
2195
- } else if (chr === '#') {
2196
- url.fragment = '';
2197
- state = FRAGMENT;
2198
- } else if (chr !== EOF) {
2199
- url.path[0] += percentEncode(chr, C0ControlPercentEncodeSet);
2200
- } break;
2201
-
2202
- case QUERY:
2203
- if (!stateOverride && chr === '#') {
2204
- url.fragment = '';
2205
- state = FRAGMENT;
2206
- } else if (chr !== EOF) {
2207
- if (chr === "'" && url.isSpecial()) url.query += '%27';
2208
- else if (chr === '#') url.query += '%23';
2209
- else url.query += percentEncode(chr, C0ControlPercentEncodeSet);
2210
- } break;
2211
-
2212
- case FRAGMENT:
2213
- if (chr !== EOF) url.fragment += percentEncode(chr, fragmentPercentEncodeSet);
2214
- break;
2215
- }
2216
-
2217
- pointer++;
2218
- }
2219
- },
2220
- // https://url.spec.whatwg.org/#host-parsing
2221
- parseHost: function (input) {
2222
- var result, codePoints, index;
2223
- if (charAt(input, 0) === '[') {
2224
- if (charAt(input, input.length - 1) !== ']') return INVALID_HOST;
2225
- result = parseIPv6(stringSlice(input, 1, -1));
2226
- if (!result) return INVALID_HOST;
2227
- this.host = result;
2228
- // opaque host
2229
- } else if (!this.isSpecial()) {
2230
- if (exec(FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT, input)) return INVALID_HOST;
2231
- result = '';
2232
- codePoints = arrayFrom(input);
2233
- for (index = 0; index < codePoints.length; index++) {
2234
- result += percentEncode(codePoints[index], C0ControlPercentEncodeSet);
2235
- }
2236
- this.host = result;
2237
- } else {
2238
- input = toASCII(input);
2239
- if (exec(FORBIDDEN_HOST_CODE_POINT, input)) return INVALID_HOST;
2240
- result = parseIPv4(input);
2241
- if (result === null) return INVALID_HOST;
2242
- this.host = result;
2243
- }
2244
- },
2245
- // https://url.spec.whatwg.org/#cannot-have-a-username-password-port
2246
- cannotHaveUsernamePasswordPort: function () {
2247
- return !this.host || this.cannotBeABaseURL || this.scheme === 'file';
2248
- },
2249
- // https://url.spec.whatwg.org/#include-credentials
2250
- includesCredentials: function () {
2251
- return this.username !== '' || this.password !== '';
2252
- },
2253
- // https://url.spec.whatwg.org/#is-special
2254
- isSpecial: function () {
2255
- return hasOwn(specialSchemes, this.scheme);
2256
- },
2257
- // https://url.spec.whatwg.org/#shorten-a-urls-path
2258
- shortenPath: function () {
2259
- var path = this.path;
2260
- var pathSize = path.length;
2261
- if (pathSize && (this.scheme !== 'file' || pathSize !== 1 || !isWindowsDriveLetter(path[0], true))) {
2262
- path.length--;
2263
- }
2264
- },
2265
- // https://url.spec.whatwg.org/#concept-url-serializer
2266
- serialize: function () {
2267
- var url = this;
2268
- var scheme = url.scheme;
2269
- var username = url.username;
2270
- var password = url.password;
2271
- var host = url.host;
2272
- var port = url.port;
2273
- var path = url.path;
2274
- var query = url.query;
2275
- var fragment = url.fragment;
2276
- var output = scheme + ':';
2277
- if (host !== null) {
2278
- output += '//';
2279
- if (url.includesCredentials()) {
2280
- output += username + (password ? ':' + password : '') + '@';
2281
- }
2282
- output += serializeHost(host);
2283
- if (port !== null) output += ':' + port;
2284
- } else if (scheme === 'file') output += '//';
2285
- output += url.cannotBeABaseURL ? path[0] : path.length ? '/' + join(path, '/') : '';
2286
- if (query !== null) output += '?' + query;
2287
- if (fragment !== null) output += '#' + fragment;
2288
- return output;
2289
- },
2290
- // https://url.spec.whatwg.org/#dom-url-href
2291
- setHref: function (href) {
2292
- var failure = this.parse(href);
2293
- if (failure) throw new TypeError$1(failure);
2294
- this.searchParams.update();
2295
- },
2296
- // https://url.spec.whatwg.org/#dom-url-origin
2297
- getOrigin: function () {
2298
- var scheme = this.scheme;
2299
- var port = this.port;
2300
- if (scheme === 'blob') try {
2301
- return new URLConstructor(scheme.path[0]).origin;
2302
- } catch (error) {
2303
- return 'null';
2304
- }
2305
- if (scheme === 'file' || !this.isSpecial()) return 'null';
2306
- return scheme + '://' + serializeHost(this.host) + (port !== null ? ':' + port : '');
2307
- },
2308
- // https://url.spec.whatwg.org/#dom-url-protocol
2309
- getProtocol: function () {
2310
- return this.scheme + ':';
2311
- },
2312
- setProtocol: function (protocol) {
2313
- this.parse($toString(protocol) + ':', SCHEME_START);
2314
- },
2315
- // https://url.spec.whatwg.org/#dom-url-username
2316
- getUsername: function () {
2317
- return this.username;
2318
- },
2319
- setUsername: function (username) {
2320
- var codePoints = arrayFrom($toString(username));
2321
- if (this.cannotHaveUsernamePasswordPort()) return;
2322
- this.username = '';
2323
- for (var i = 0; i < codePoints.length; i++) {
2324
- this.username += percentEncode(codePoints[i], userinfoPercentEncodeSet);
2325
- }
2326
- },
2327
- // https://url.spec.whatwg.org/#dom-url-password
2328
- getPassword: function () {
2329
- return this.password;
2330
- },
2331
- setPassword: function (password) {
2332
- var codePoints = arrayFrom($toString(password));
2333
- if (this.cannotHaveUsernamePasswordPort()) return;
2334
- this.password = '';
2335
- for (var i = 0; i < codePoints.length; i++) {
2336
- this.password += percentEncode(codePoints[i], userinfoPercentEncodeSet);
2337
- }
2338
- },
2339
- // https://url.spec.whatwg.org/#dom-url-host
2340
- getHost: function () {
2341
- var host = this.host;
2342
- var port = this.port;
2343
- return host === null ? ''
2344
- : port === null ? serializeHost(host)
2345
- : serializeHost(host) + ':' + port;
2346
- },
2347
- setHost: function (host) {
2348
- if (this.cannotBeABaseURL) return;
2349
- this.parse(host, HOST);
2350
- },
2351
- // https://url.spec.whatwg.org/#dom-url-hostname
2352
- getHostname: function () {
2353
- var host = this.host;
2354
- return host === null ? '' : serializeHost(host);
2355
- },
2356
- setHostname: function (hostname) {
2357
- if (this.cannotBeABaseURL) return;
2358
- this.parse(hostname, HOSTNAME);
2359
- },
2360
- // https://url.spec.whatwg.org/#dom-url-port
2361
- getPort: function () {
2362
- var port = this.port;
2363
- return port === null ? '' : $toString(port);
2364
- },
2365
- setPort: function (port) {
2366
- if (this.cannotHaveUsernamePasswordPort()) return;
2367
- port = $toString(port);
2368
- if (port === '') this.port = null;
2369
- else this.parse(port, PORT);
2370
- },
2371
- // https://url.spec.whatwg.org/#dom-url-pathname
2372
- getPathname: function () {
2373
- var path = this.path;
2374
- return this.cannotBeABaseURL ? path[0] : path.length ? '/' + join(path, '/') : '';
2375
- },
2376
- setPathname: function (pathname) {
2377
- if (this.cannotBeABaseURL) return;
2378
- this.path = [];
2379
- this.parse(pathname, PATH_START);
2380
- },
2381
- // https://url.spec.whatwg.org/#dom-url-search
2382
- getSearch: function () {
2383
- var query = this.query;
2384
- return query ? '?' + query : '';
2385
- },
2386
- setSearch: function (search) {
2387
- search = $toString(search);
2388
- if (search === '') {
2389
- this.query = null;
2390
- } else {
2391
- if (charAt(search, 0) === '?') search = stringSlice(search, 1);
2392
- this.query = '';
2393
- this.parse(search, QUERY);
2394
- }
2395
- this.searchParams.update();
2396
- },
2397
- // https://url.spec.whatwg.org/#dom-url-searchparams
2398
- getSearchParams: function () {
2399
- return this.searchParams.facade;
2400
- },
2401
- // https://url.spec.whatwg.org/#dom-url-hash
2402
- getHash: function () {
2403
- var fragment = this.fragment;
2404
- return fragment ? '#' + fragment : '';
2405
- },
2406
- setHash: function (hash) {
2407
- hash = $toString(hash);
2408
- if (hash === '') {
2409
- this.fragment = null;
2410
- return;
2411
- }
2412
- if (charAt(hash, 0) === '#') hash = stringSlice(hash, 1);
2413
- this.fragment = '';
2414
- this.parse(hash, FRAGMENT);
2415
- },
2416
- update: function () {
2417
- this.query = this.searchParams.serialize() || null;
2418
- }
2419
- };
2420
-
2421
- // `URL` constructor
2422
- // https://url.spec.whatwg.org/#url-class
2423
- var URLConstructor = function URL(url /* , base */) {
2424
- var that = anInstance(this, URLPrototype);
2425
- var base = validateArgumentsLength$2(arguments.length, 1) > 1 ? arguments[1] : undefined;
2426
- var state = setInternalState(that, new URLState(url, false, base));
2427
- if (!DESCRIPTORS$1) {
2428
- that.href = state.serialize();
2429
- that.origin = state.getOrigin();
2430
- that.protocol = state.getProtocol();
2431
- that.username = state.getUsername();
2432
- that.password = state.getPassword();
2433
- that.host = state.getHost();
2434
- that.hostname = state.getHostname();
2435
- that.port = state.getPort();
2436
- that.pathname = state.getPathname();
2437
- that.search = state.getSearch();
2438
- that.searchParams = state.getSearchParams();
2439
- that.hash = state.getHash();
2440
- }
2441
- };
2442
-
2443
- var URLPrototype = URLConstructor.prototype;
2444
-
2445
- var accessorDescriptor = function (getter, setter) {
2446
- return {
2447
- get: function () {
2448
- return getInternalURLState(this)[getter]();
2449
- },
2450
- set: setter && function (value) {
2451
- return getInternalURLState(this)[setter](value);
2452
- },
2453
- configurable: true,
2454
- enumerable: true
2455
- };
2456
- };
2457
-
2458
- if (DESCRIPTORS$1) {
2459
- // `URL.prototype.href` accessors pair
2460
- // https://url.spec.whatwg.org/#dom-url-href
2461
- defineBuiltInAccessor$1(URLPrototype, 'href', accessorDescriptor('serialize', 'setHref'));
2462
- // `URL.prototype.origin` getter
2463
- // https://url.spec.whatwg.org/#dom-url-origin
2464
- defineBuiltInAccessor$1(URLPrototype, 'origin', accessorDescriptor('getOrigin'));
2465
- // `URL.prototype.protocol` accessors pair
2466
- // https://url.spec.whatwg.org/#dom-url-protocol
2467
- defineBuiltInAccessor$1(URLPrototype, 'protocol', accessorDescriptor('getProtocol', 'setProtocol'));
2468
- // `URL.prototype.username` accessors pair
2469
- // https://url.spec.whatwg.org/#dom-url-username
2470
- defineBuiltInAccessor$1(URLPrototype, 'username', accessorDescriptor('getUsername', 'setUsername'));
2471
- // `URL.prototype.password` accessors pair
2472
- // https://url.spec.whatwg.org/#dom-url-password
2473
- defineBuiltInAccessor$1(URLPrototype, 'password', accessorDescriptor('getPassword', 'setPassword'));
2474
- // `URL.prototype.host` accessors pair
2475
- // https://url.spec.whatwg.org/#dom-url-host
2476
- defineBuiltInAccessor$1(URLPrototype, 'host', accessorDescriptor('getHost', 'setHost'));
2477
- // `URL.prototype.hostname` accessors pair
2478
- // https://url.spec.whatwg.org/#dom-url-hostname
2479
- defineBuiltInAccessor$1(URLPrototype, 'hostname', accessorDescriptor('getHostname', 'setHostname'));
2480
- // `URL.prototype.port` accessors pair
2481
- // https://url.spec.whatwg.org/#dom-url-port
2482
- defineBuiltInAccessor$1(URLPrototype, 'port', accessorDescriptor('getPort', 'setPort'));
2483
- // `URL.prototype.pathname` accessors pair
2484
- // https://url.spec.whatwg.org/#dom-url-pathname
2485
- defineBuiltInAccessor$1(URLPrototype, 'pathname', accessorDescriptor('getPathname', 'setPathname'));
2486
- // `URL.prototype.search` accessors pair
2487
- // https://url.spec.whatwg.org/#dom-url-search
2488
- defineBuiltInAccessor$1(URLPrototype, 'search', accessorDescriptor('getSearch', 'setSearch'));
2489
- // `URL.prototype.searchParams` getter
2490
- // https://url.spec.whatwg.org/#dom-url-searchparams
2491
- defineBuiltInAccessor$1(URLPrototype, 'searchParams', accessorDescriptor('getSearchParams'));
2492
- // `URL.prototype.hash` accessors pair
2493
- // https://url.spec.whatwg.org/#dom-url-hash
2494
- defineBuiltInAccessor$1(URLPrototype, 'hash', accessorDescriptor('getHash', 'setHash'));
2495
- }
2496
-
2497
- // `URL.prototype.toJSON` method
2498
- // https://url.spec.whatwg.org/#dom-url-tojson
2499
- defineBuiltIn$2(URLPrototype, 'toJSON', function toJSON() {
2500
- return getInternalURLState(this).serialize();
2501
- }, { enumerable: true });
2502
-
2503
- // `URL.prototype.toString` method
2504
- // https://url.spec.whatwg.org/#URL-stringification-behavior
2505
- defineBuiltIn$2(URLPrototype, 'toString', function toString() {
2506
- return getInternalURLState(this).serialize();
2507
- }, { enumerable: true });
2508
-
2509
- if (NativeURL) {
2510
- var nativeCreateObjectURL = NativeURL.createObjectURL;
2511
- var nativeRevokeObjectURL = NativeURL.revokeObjectURL;
2512
- // `URL.createObjectURL` method
2513
- // https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL
2514
- if (nativeCreateObjectURL) defineBuiltIn$2(URLConstructor, 'createObjectURL', bind(nativeCreateObjectURL, NativeURL));
2515
- // `URL.revokeObjectURL` method
2516
- // https://developer.mozilla.org/en-US/docs/Web/API/URL/revokeObjectURL
2517
- if (nativeRevokeObjectURL) defineBuiltIn$2(URLConstructor, 'revokeObjectURL', bind(nativeRevokeObjectURL, NativeURL));
2518
- }
2519
-
2520
- setToStringTag(URLConstructor, 'URL');
2521
-
2522
- $$1({ global: true, constructor: true, forced: !USE_NATIVE_URL, sham: !DESCRIPTORS$1 }, {
2523
- URL: URLConstructor
2524
- });
2525
-
2526
- var $ = _export;
2527
- var call = functionCall;
2528
-
2529
- // `URL.prototype.toJSON` method
2530
- // https://url.spec.whatwg.org/#dom-url-tojson
2531
- $({ target: 'URL', proto: true, enumerable: true }, {
2532
- toJSON: function toJSON() {
2533
- return call(URL.prototype.toString, this);
2534
- }
2535
- });
2536
-
2537
- var defineBuiltIn$1 = defineBuiltIn$5;
2538
- var uncurryThis$2 = functionUncurryThis;
2539
- var toString$1 = toString$4;
2540
- var validateArgumentsLength$1 = validateArgumentsLength$4;
2541
-
2542
- var $URLSearchParams$1 = URLSearchParams;
2543
- var URLSearchParamsPrototype$2 = $URLSearchParams$1.prototype;
2544
- var append = uncurryThis$2(URLSearchParamsPrototype$2.append);
2545
- var $delete = uncurryThis$2(URLSearchParamsPrototype$2['delete']);
2546
- var forEach$1 = uncurryThis$2(URLSearchParamsPrototype$2.forEach);
2547
- var push = uncurryThis$2([].push);
2548
- var params$1 = new $URLSearchParams$1('a=1&a=2&b=3');
2549
-
2550
- params$1['delete']('a', 1);
2551
- // `undefined` case is a Chromium 117 bug
2552
- // https://bugs.chromium.org/p/v8/issues/detail?id=14222
2553
- params$1['delete']('b', undefined);
2554
-
2555
- if (params$1 + '' !== 'a=2') {
2556
- defineBuiltIn$1(URLSearchParamsPrototype$2, 'delete', function (name /* , value */) {
2557
- var length = arguments.length;
2558
- var $value = length < 2 ? undefined : arguments[1];
2559
- if (length && $value === undefined) return $delete(this, name);
2560
- var entries = [];
2561
- forEach$1(this, function (v, k) { // also validates `this`
2562
- push(entries, { key: k, value: v });
2563
- });
2564
- validateArgumentsLength$1(length, 1);
2565
- var key = toString$1(name);
2566
- var value = toString$1($value);
2567
- var index = 0;
2568
- var dindex = 0;
2569
- var found = false;
2570
- var entriesLength = entries.length;
2571
- var entry;
2572
- while (index < entriesLength) {
2573
- entry = entries[index++];
2574
- if (found || entry.key === key) {
2575
- found = true;
2576
- $delete(this, entry.key);
2577
- } else dindex++;
2578
- }
2579
- while (dindex < entriesLength) {
2580
- entry = entries[dindex++];
2581
- if (!(entry.key === key && entry.value === value)) append(this, entry.key, entry.value);
2582
- }
2583
- }, { enumerable: true, unsafe: true });
2584
- }
2585
-
2586
- var defineBuiltIn = defineBuiltIn$5;
2587
- var uncurryThis$1 = functionUncurryThis;
2588
- var toString = toString$4;
2589
- var validateArgumentsLength = validateArgumentsLength$4;
2590
-
2591
- var $URLSearchParams = URLSearchParams;
2592
- var URLSearchParamsPrototype$1 = $URLSearchParams.prototype;
2593
- var getAll = uncurryThis$1(URLSearchParamsPrototype$1.getAll);
2594
- var $has = uncurryThis$1(URLSearchParamsPrototype$1.has);
2595
- var params = new $URLSearchParams('a=1');
2596
-
2597
- // `undefined` case is a Chromium 117 bug
2598
- // https://bugs.chromium.org/p/v8/issues/detail?id=14222
2599
- if (params.has('a', 2) || !params.has('a', undefined)) {
2600
- defineBuiltIn(URLSearchParamsPrototype$1, 'has', function has(name /* , value */) {
2601
- var length = arguments.length;
2602
- var $value = length < 2 ? undefined : arguments[1];
2603
- if (length && $value === undefined) return $has(this, name);
2604
- var values = getAll(this, name); // also validates `this`
2605
- validateArgumentsLength(length, 1);
2606
- var value = toString($value);
2607
- var index = 0;
2608
- while (index < values.length) {
2609
- if (values[index++] === value) return true;
2610
- } return false;
2611
- }, { enumerable: true, unsafe: true });
2612
- }
2613
-
2614
- var DESCRIPTORS = descriptors;
2615
- var uncurryThis = functionUncurryThis;
2616
- var defineBuiltInAccessor = defineBuiltInAccessor$3;
2617
-
2618
- var URLSearchParamsPrototype = URLSearchParams.prototype;
2619
- var forEach = uncurryThis(URLSearchParamsPrototype.forEach);
2620
-
2621
- // `URLSearchParams.prototype.size` getter
2622
- // https://github.com/whatwg/url/pull/734
2623
- if (DESCRIPTORS && !('size' in URLSearchParamsPrototype)) {
2624
- defineBuiltInAccessor(URLSearchParamsPrototype, 'size', {
2625
- get: function size() {
2626
- var count = 0;
2627
- forEach(this, function () { count++; });
2628
- return count;
2629
- },
2630
- configurable: true,
2631
- enumerable: true
2632
- });
2633
- }
2634
-
2635
515
  const DEFAULT_TINYMCE_CONFIG = {
2636
516
  inline: true,
2637
517
  menubar: false,
@@ -2916,7 +796,7 @@ function _objectWithoutPropertiesLoose(r, e) {
2916
796
  if (null == r) return {};
2917
797
  var t = {};
2918
798
  for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
2919
- if (e.includes(n)) continue;
799
+ if (-1 !== e.indexOf(n)) continue;
2920
800
  t[n] = r[n];
2921
801
  }
2922
802
  return t;