@lwrjs/client-modules 0.5.13 → 0.5.14

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.
@@ -25,7 +25,7 @@ const {
25
25
  slice: ArrayProtoSlice,
26
26
  some: ArrayProtoSome
27
27
  } = Array.prototype;
28
- const emptyArray$1 = [];
28
+ const emptyArray = [];
29
29
  const ArrayCtor = Array;
30
30
  const {
31
31
  from: ArrayFrom,
@@ -68,7 +68,7 @@ function ArrayJoin(arr, ...args) {
68
68
  }
69
69
 
70
70
  function ArrayPop(arr) {
71
- return ReflectApply$3(ArrayProtoPop, arr, emptyArray$1);
71
+ return ReflectApply$3(ArrayProtoPop, arr, emptyArray);
72
72
  }
73
73
 
74
74
  function ArrayPush(arr, ...args) {
@@ -155,7 +155,7 @@ const {
155
155
  __lookupGetter__: ObjectProto__lookupGetter__$1,
156
156
  // eslint-disable-next-line @typescript-eslint/naming-convention
157
157
  __lookupSetter__: ObjectProto__lookupSetter__,
158
- hasOwnProperty: ObjectProtoHasOwnProperty$1
158
+ hasOwnProperty: ObjectProtoHasOwnProperty
159
159
  } = Object.prototype;
160
160
  const {
161
161
  assign: ObjectAssign$3,
@@ -174,11 +174,11 @@ const {
174
174
  } = Object;
175
175
 
176
176
  function ObjectHasOwnProperty(obj, key) {
177
- return obj !== null && obj !== undefined && ReflectApply$3(ObjectProtoHasOwnProperty$1, obj, [key]);
177
+ return obj !== null && obj !== undefined && ReflectApply$3(ObjectProtoHasOwnProperty, obj, [key]);
178
178
  }
179
179
 
180
- function ObjectLookupOwnGetter$1(obj, key) {
181
- if (obj === null || obj === undefined || !ReflectApply$3(ObjectProtoHasOwnProperty$1, obj, [key])) {
180
+ function ObjectLookupOwnGetter(obj, key) {
181
+ if (obj === null || obj === undefined || !ReflectApply$3(ObjectProtoHasOwnProperty, obj, [key])) {
182
182
  return undefined;
183
183
  }
184
184
 
@@ -186,7 +186,7 @@ function ObjectLookupOwnGetter$1(obj, key) {
186
186
  }
187
187
 
188
188
  function ObjectLookupOwnSetter(obj, key) {
189
- if (obj === null || obj === undefined || !ReflectApply$3(ObjectProtoHasOwnProperty$1, obj, [key])) {
189
+ if (obj === null || obj === undefined || !ReflectApply$3(ObjectProtoHasOwnProperty, obj, [key])) {
190
190
  return undefined;
191
191
  }
192
192
 
@@ -194,7 +194,7 @@ function ObjectLookupOwnSetter(obj, key) {
194
194
  }
195
195
 
196
196
  function ObjectLookupOwnValue(obj, key) {
197
- if (obj === null || obj === undefined || !ReflectApply$3(ObjectProtoHasOwnProperty$1, obj, [key])) {
197
+ if (obj === null || obj === undefined || !ReflectApply$3(ObjectProtoHasOwnProperty, obj, [key])) {
198
198
  return undefined;
199
199
  }
200
200
 
@@ -309,7 +309,7 @@ const {
309
309
  const MapCtor = Map;
310
310
 
311
311
  function MapEntries(map) {
312
- return ReflectApply$3(MapProtoEntries, map, emptyArray$1);
312
+ return ReflectApply$3(MapProtoEntries, map, emptyArray);
313
313
  }
314
314
 
315
315
  function MapForEach(map, iteratee) {
@@ -434,7 +434,7 @@ function sanitizeArguments(args, sanitizers) {
434
434
  const {
435
435
  add: SetProtoAdd,
436
436
  delete: SetProtoDelete,
437
- has: SetProtoHas$1
437
+ has: SetProtoHas
438
438
  } = Set.prototype;
439
439
  const SetCtor = Set;
440
440
 
@@ -447,7 +447,7 @@ function SetDelete(set, value) {
447
447
  }
448
448
 
449
449
  function SetHas(set, value) {
450
- return ReflectApply$3(SetProtoHas$1, set, [value]);
450
+ return ReflectApply$3(SetProtoHas, set, [value]);
451
451
  }
452
452
 
453
453
  const {
@@ -463,33 +463,33 @@ function WeakMapGet(weakMap, key) {
463
463
  function WeakMapSet(weakMap, key, value) {
464
464
  return ReflectApply$3(WeakMapProtoSet$1, weakMap, [key, value]);
465
465
  }
466
- /*! version: 0.14.26 */
466
+ /*! version: 0.14.28 */
467
467
 
468
468
  /*!
469
469
  * Copyright (C) 2019 salesforce.com, inc.
470
470
  */
471
- const AttrProtoNameGetter = ObjectLookupOwnGetter$1(Attr.prototype, 'name');
472
- const AttrProtoNamespaceURIGetter = ObjectLookupOwnGetter$1(Attr.prototype, 'namespaceURI');
473
- const AttrProtoOwnerElementGetter = ObjectLookupOwnGetter$1(Attr.prototype, 'ownerElement');
471
+ const AttrProtoNameGetter = ObjectLookupOwnGetter(Attr.prototype, 'name');
472
+ const AttrProtoNamespaceURIGetter = ObjectLookupOwnGetter(Attr.prototype, 'namespaceURI');
473
+ const AttrProtoOwnerElementGetter = ObjectLookupOwnGetter(Attr.prototype, 'ownerElement');
474
474
  const {
475
475
  get: AttrProtoValueGetter,
476
476
  set: AttrProtoValueSetter
477
477
  } = ReflectGetOwnPropertyDescriptor$1(Attr.prototype, 'value');
478
478
 
479
479
  function AttrNameGetter(attr) {
480
- return ReflectApply$3(AttrProtoNameGetter, attr, emptyArray$1);
480
+ return ReflectApply$3(AttrProtoNameGetter, attr, emptyArray);
481
481
  }
482
482
 
483
483
  function AttrNamespaceURIGetter(attr) {
484
- return ReflectApply$3(AttrProtoNamespaceURIGetter, attr, emptyArray$1);
484
+ return ReflectApply$3(AttrProtoNamespaceURIGetter, attr, emptyArray);
485
485
  }
486
486
 
487
487
  function AttrOwnerElementGetter(attr) {
488
- return ReflectApply$3(AttrProtoOwnerElementGetter, attr, emptyArray$1);
488
+ return ReflectApply$3(AttrProtoOwnerElementGetter, attr, emptyArray);
489
489
  }
490
490
 
491
491
  function AttrValueGetter(attr) {
492
- return ReflectApply$3(AttrProtoValueGetter, attr, emptyArray$1);
492
+ return ReflectApply$3(AttrProtoValueGetter, attr, emptyArray);
493
493
  }
494
494
 
495
495
  function AttrValueSetter(attr, value) {
@@ -534,20 +534,20 @@ const {
534
534
  createElementNS: DocumentProtoCreateElementNS,
535
535
  getElementById: DocumentProtoGetElementById
536
536
  } = Document.prototype;
537
- const DocumentProtoBodyGetter$1 = ObjectLookupOwnGetter$1(Document.prototype, 'body');
538
- const DocumentProtoDocumentElementGetter = ObjectLookupOwnGetter$1(Document.prototype, 'documentElement');
539
- const DocumentProtoHeadGetter = ObjectLookupOwnGetter$1(Document.prototype, 'head');
540
- const DocumentProtoImplementationGetter = ObjectLookupOwnGetter$1(Document.prototype, 'implementation');
537
+ const DocumentProtoBodyGetter$1 = ObjectLookupOwnGetter(Document.prototype, 'body');
538
+ const DocumentProtoDocumentElementGetter = ObjectLookupOwnGetter(Document.prototype, 'documentElement');
539
+ const DocumentProtoHeadGetter = ObjectLookupOwnGetter(Document.prototype, 'head');
540
+ const DocumentProtoImplementationGetter = ObjectLookupOwnGetter(Document.prototype, 'implementation');
541
541
  const {
542
542
  execCommand: DocumentProtoExecCommand
543
543
  } = Document.prototype;
544
544
 
545
545
  function DocumentBodyGetter(doc) {
546
- return ReflectApply$3(DocumentProtoBodyGetter$1, doc, emptyArray$1);
546
+ return ReflectApply$3(DocumentProtoBodyGetter$1, doc, emptyArray);
547
547
  }
548
548
 
549
549
  function DocumentCookieGetter(doc) {
550
- return ReflectApply$3(DocumentProtoCookieGetter, doc, emptyArray$1);
550
+ return ReflectApply$3(DocumentProtoCookieGetter, doc, emptyArray);
551
551
  }
552
552
 
553
553
  function DocumentCookieSetter(doc, newCookie) {
@@ -555,7 +555,7 @@ function DocumentCookieSetter(doc, newCookie) {
555
555
  }
556
556
 
557
557
  function DocumentImplementation(doc) {
558
- return ReflectApply$3(DocumentProtoImplementationGetter, doc, emptyArray$1);
558
+ return ReflectApply$3(DocumentProtoImplementationGetter, doc, emptyArray);
559
559
  }
560
560
 
561
561
  function DocumentCreateComment(doc, data = '') {
@@ -571,7 +571,7 @@ function DocumentCreateElementNS(doc, ...args) {
571
571
  }
572
572
 
573
573
  function DocumentDocumentElementGetter(doc) {
574
- return ReflectApply$3(DocumentProtoDocumentElementGetter, doc, emptyArray$1);
574
+ return ReflectApply$3(DocumentProtoDocumentElementGetter, doc, emptyArray);
575
575
  }
576
576
 
577
577
  function DocumentGetElementById(doc, id) {
@@ -579,7 +579,7 @@ function DocumentGetElementById(doc, id) {
579
579
  }
580
580
 
581
581
  function DocumentHeadGetter(doc) {
582
- return ReflectApply$3(DocumentProtoHeadGetter, doc, emptyArray$1);
582
+ return ReflectApply$3(DocumentProtoHeadGetter, doc, emptyArray);
583
583
  }
584
584
 
585
585
  function nsCookieKey(key, ns) {
@@ -613,15 +613,15 @@ const {
613
613
  get: ElementProtoOuterHTMLGetter,
614
614
  set: ElementProtoOuterHTMLSetter
615
615
  } = ReflectGetOwnPropertyDescriptor$1(Element.prototype, 'outerHTML');
616
- const ElementProtoAttributesGetter = ObjectLookupOwnGetter$1(Element.prototype, 'attributes');
617
- const ElementProtoGetNamespaceURI = ObjectLookupOwnGetter$1(Element.prototype, 'namespaceURI');
616
+ const ElementProtoAttributesGetter = ObjectLookupOwnGetter(Element.prototype, 'attributes');
617
+ const ElementProtoGetNamespaceURI = ObjectLookupOwnGetter(Element.prototype, 'namespaceURI');
618
618
 
619
619
  function ElementClosest(el, selectors) {
620
620
  return ReflectApply$3(ElementProtoClosest, el, [selectors]);
621
621
  }
622
622
 
623
623
  function ElementInnerHTMLGetter(el) {
624
- return ReflectApply$3(ElementProtoInnerHTMLGetter, el, emptyArray$1);
624
+ return ReflectApply$3(ElementProtoInnerHTMLGetter, el, emptyArray);
625
625
  }
626
626
 
627
627
  function ElementInnerHTMLSetter(el, html) {
@@ -629,7 +629,7 @@ function ElementInnerHTMLSetter(el, html) {
629
629
  }
630
630
 
631
631
  function ElementOuterHTMLGetter(el) {
632
- return ReflectApply$3(ElementProtoOuterHTMLGetter, el, emptyArray$1);
632
+ return ReflectApply$3(ElementProtoOuterHTMLGetter, el, emptyArray);
633
633
  }
634
634
 
635
635
  function ElementOuterHTMLSetter(el, html) {
@@ -641,7 +641,7 @@ function ElementQuerySelector(el, selectors) {
641
641
  }
642
642
 
643
643
  function ElementAttributesGetter(el) {
644
- return ReflectApply$3(ElementProtoAttributesGetter, el, emptyArray$1);
644
+ return ReflectApply$3(ElementProtoAttributesGetter, el, emptyArray);
645
645
  }
646
646
 
647
647
  function ElementGetAttributeNode(el, attrName) {
@@ -653,7 +653,7 @@ function ElementGetAttributeNodeNS(el, namespace, nodeName) {
653
653
  }
654
654
 
655
655
  function ElementRemove$1(el) {
656
- return ReflectApply$3(ElementProtoRemove$1, el, emptyArray$1);
656
+ return ReflectApply$3(ElementProtoRemove$1, el, emptyArray);
657
657
  }
658
658
 
659
659
  function ElementRemoveAttributeNode(el, attrNode) {
@@ -677,13 +677,13 @@ function ElementSetAttributeNS(el, namespace, name, value) {
677
677
  }
678
678
 
679
679
  function ElementGetNamespaceURI(el) {
680
- return ReflectApply$3(ElementProtoGetNamespaceURI, el, emptyArray$1);
680
+ return ReflectApply$3(ElementProtoGetNamespaceURI, el, emptyArray);
681
681
  }
682
682
 
683
- const HTMLTemplateElementProtoContentGetter = ObjectLookupOwnGetter$1(HTMLTemplateElement.prototype, 'content');
683
+ const HTMLTemplateElementProtoContentGetter = ObjectLookupOwnGetter(HTMLTemplateElement.prototype, 'content');
684
684
 
685
685
  function HTMLTemplateElementContentGetter(template) {
686
- return ReflectApply$3(HTMLTemplateElementProtoContentGetter, template, emptyArray$1);
686
+ return ReflectApply$3(HTMLTemplateElementProtoContentGetter, template, emptyArray);
687
687
  }
688
688
 
689
689
  const {
@@ -691,11 +691,11 @@ const {
691
691
  cloneNode: NodeProtoCloneNode,
692
692
  isEqualNode: NodeProtoIsEqualNode
693
693
  } = Node.prototype;
694
- const NodeProtoChildNodesGetter = ObjectLookupOwnGetter$1(Node.prototype, 'childNodes');
695
- const NodeProtoFirstChildGetter = ObjectLookupOwnGetter$1(Node.prototype, 'firstChild');
696
- const NodeProtoLastChildGetter$1 = ObjectLookupOwnGetter$1(Node.prototype, 'lastChild');
697
- const NodeProtoNodeNameGetter = ObjectLookupOwnGetter$1(Node.prototype, 'nodeName');
698
- const NodeProtoOwnerDocumentGetter = ObjectLookupOwnGetter$1(Node.prototype, 'ownerDocument');
694
+ const NodeProtoChildNodesGetter = ObjectLookupOwnGetter(Node.prototype, 'childNodes');
695
+ const NodeProtoFirstChildGetter = ObjectLookupOwnGetter(Node.prototype, 'firstChild');
696
+ const NodeProtoLastChildGetter$1 = ObjectLookupOwnGetter(Node.prototype, 'lastChild');
697
+ const NodeProtoNodeNameGetter = ObjectLookupOwnGetter(Node.prototype, 'nodeName');
698
+ const NodeProtoOwnerDocumentGetter = ObjectLookupOwnGetter(Node.prototype, 'ownerDocument');
699
699
  const NodeProtoTextContentSetter = ObjectLookupOwnSetter(Node.prototype, 'textContent');
700
700
 
701
701
  function NodeAppendChild$1(node, childNode) {
@@ -703,7 +703,7 @@ function NodeAppendChild$1(node, childNode) {
703
703
  }
704
704
 
705
705
  function NodeChildNodesGetter(node) {
706
- return ReflectApply$3(NodeProtoChildNodesGetter, node, emptyArray$1);
706
+ return ReflectApply$3(NodeProtoChildNodesGetter, node, emptyArray);
707
707
  }
708
708
 
709
709
  function NodeClone(node, deep = false) {
@@ -711,7 +711,7 @@ function NodeClone(node, deep = false) {
711
711
  }
712
712
 
713
713
  function NodeFirstChildGetter(node) {
714
- return ReflectApply$3(NodeProtoFirstChildGetter, node, emptyArray$1);
714
+ return ReflectApply$3(NodeProtoFirstChildGetter, node, emptyArray);
715
715
  }
716
716
 
717
717
  function NodeIsEqualNode(node, otherNode) {
@@ -719,17 +719,17 @@ function NodeIsEqualNode(node, otherNode) {
719
719
  }
720
720
 
721
721
  function NodeLastChildGetter(node) {
722
- return ReflectApply$3(NodeProtoLastChildGetter$1, node, emptyArray$1);
722
+ return ReflectApply$3(NodeProtoLastChildGetter$1, node, emptyArray);
723
723
  }
724
724
 
725
725
  function NodeNameGetter(node) {
726
726
  // Normalize nodeName to upper case.
727
727
  // See https://johnresig.com/blog/nodename-case-sensitivity/.
728
- return StringToUpperCase(ReflectApply$3(NodeProtoNodeNameGetter, node, emptyArray$1));
728
+ return StringToUpperCase(ReflectApply$3(NodeProtoNodeNameGetter, node, emptyArray));
729
729
  }
730
730
 
731
731
  function NodeOwnerDocumentGetter(node) {
732
- return ReflectApply$3(NodeProtoOwnerDocumentGetter, node, emptyArray$1);
732
+ return ReflectApply$3(NodeProtoOwnerDocumentGetter, node, emptyArray);
733
733
  }
734
734
 
735
735
  function NodeTextContentSetter(node, textContent) {
@@ -825,15 +825,15 @@ function JSONClone(value) {
825
825
  return JSONParse(JSONStringify(value));
826
826
  }
827
827
 
828
- const BlobProtoSizeGetter = ObjectLookupOwnGetter$1(Blob.prototype, 'size');
828
+ const BlobProtoSizeGetter = ObjectLookupOwnGetter(Blob.prototype, 'size');
829
829
  const {
830
830
  slice: BlobProtoSlice
831
831
  } = Blob.prototype;
832
- const BlobProtoTypeGetter = ObjectLookupOwnGetter$1(Blob.prototype, 'type');
832
+ const BlobProtoTypeGetter = ObjectLookupOwnGetter(Blob.prototype, 'type');
833
833
  const BlobCtor = Blob;
834
834
 
835
835
  function BlobSizeGetter(blob) {
836
- return ReflectApply$3(BlobProtoSizeGetter, blob, emptyArray$1);
836
+ return ReflectApply$3(BlobProtoSizeGetter, blob, emptyArray);
837
837
  }
838
838
 
839
839
  function BlobSlice(blob, ...args) {
@@ -841,7 +841,7 @@ function BlobSlice(blob, ...args) {
841
841
  }
842
842
 
843
843
  function BlobTypeGetter(blob) {
844
- return StringToLowerCase(ReflectApply$3(BlobProtoTypeGetter, blob, emptyArray$1));
844
+ return StringToLowerCase(ReflectApply$3(BlobProtoTypeGetter, blob, emptyArray));
845
845
  }
846
846
 
847
847
  const CookieStoreProto = typeof CookieStore === 'undefined' ? undefined :
@@ -880,19 +880,19 @@ function DOMImplementationCreateDocument(domImplementation, ...args) {
880
880
  const {
881
881
  parseFromString: DOMParserProtoParseFromString
882
882
  } = DOMParser.prototype;
883
- const DOMTokenListProtoValueGetter = ObjectLookupOwnGetter$1(DOMTokenList.prototype, 'value');
883
+ const DOMTokenListProtoValueGetter = ObjectLookupOwnGetter(DOMTokenList.prototype, 'value');
884
884
 
885
885
  function DOMTokenListValueGetter(tokenList) {
886
- return ReflectApply$3(DOMTokenListProtoValueGetter, tokenList, emptyArray$1);
886
+ return ReflectApply$3(DOMTokenListProtoValueGetter, tokenList, emptyArray);
887
887
  }
888
888
 
889
889
  const {
890
890
  composedPath: EventProtoComposedPath
891
891
  } = Event.prototype;
892
- const EventProtoCurrentTargetGetter = ObjectLookupOwnGetter$1(Event.prototype, 'currentTarget');
892
+ const EventProtoCurrentTargetGetter = ObjectLookupOwnGetter(Event.prototype, 'currentTarget');
893
893
 
894
894
  function EventCurrentTargetGetter(event) {
895
- return ReflectApply$3(EventProtoCurrentTargetGetter, event, emptyArray$1);
895
+ return ReflectApply$3(EventProtoCurrentTargetGetter, event, emptyArray);
896
896
  }
897
897
 
898
898
  const {
@@ -903,20 +903,20 @@ function EventTargetAddEventListener(target, ...args) {
903
903
  return ReflectApply$3(EventTargetProtoAddEventListener, target, args);
904
904
  }
905
905
 
906
- const HTMLAnchorElementProtoHostnameGetter = ObjectLookupOwnGetter$1(HTMLAnchorElement.prototype, 'hostname');
906
+ const HTMLAnchorElementProtoHostnameGetter = ObjectLookupOwnGetter(HTMLAnchorElement.prototype, 'hostname');
907
907
  const {
908
908
  get: HTMLAnchorElementProtoHrefGetter,
909
909
  set: HTMLAnchorElementProtoHrefSetter
910
910
  } = ReflectGetOwnPropertyDescriptor$1(HTMLAnchorElement.prototype, 'href');
911
- const HTMLAnchorElementProtoPathnameGetter = ObjectLookupOwnGetter$1(HTMLAnchorElement.prototype, 'pathname');
912
- const HTMLAnchorElementProtoProtocolGetter = ObjectLookupOwnGetter$1(HTMLAnchorElement.prototype, 'protocol');
911
+ const HTMLAnchorElementProtoPathnameGetter = ObjectLookupOwnGetter(HTMLAnchorElement.prototype, 'pathname');
912
+ const HTMLAnchorElementProtoProtocolGetter = ObjectLookupOwnGetter(HTMLAnchorElement.prototype, 'protocol');
913
913
 
914
914
  function HTMLAnchorElementHostnameGetter(anchor) {
915
- return ReflectApply$3(HTMLAnchorElementProtoHostnameGetter, anchor, emptyArray$1);
915
+ return ReflectApply$3(HTMLAnchorElementProtoHostnameGetter, anchor, emptyArray);
916
916
  }
917
917
 
918
918
  function HTMLAnchorElementHrefGetter(anchor) {
919
- return ReflectApply$3(HTMLAnchorElementProtoHrefGetter, anchor, emptyArray$1);
919
+ return ReflectApply$3(HTMLAnchorElementProtoHrefGetter, anchor, emptyArray);
920
920
  }
921
921
 
922
922
  function HTMLAnchorElementHrefSetter(anchor, href) {
@@ -924,21 +924,21 @@ function HTMLAnchorElementHrefSetter(anchor, href) {
924
924
  }
925
925
 
926
926
  function HTMLAnchorElementPathnameGetter(anchor) {
927
- return ReflectApply$3(HTMLAnchorElementProtoPathnameGetter, anchor, emptyArray$1);
927
+ return ReflectApply$3(HTMLAnchorElementProtoPathnameGetter, anchor, emptyArray);
928
928
  }
929
929
 
930
930
  function HTMLAnchorElementProtocolGetter(anchor) {
931
- return ReflectApply$3(HTMLAnchorElementProtoProtocolGetter, anchor, emptyArray$1);
931
+ return ReflectApply$3(HTMLAnchorElementProtoProtocolGetter, anchor, emptyArray);
932
932
  } // The innerText and outerText setters may be undefined.
933
933
 
934
934
 
935
935
  const HTMLElementProtoInnerTextSetter = ObjectLookupOwnSetter(HTMLElement.prototype, 'innerText');
936
936
  const HTMLElementProtoOuterTextSetter = ObjectLookupOwnSetter(HTMLElement.prototype, 'outerText');
937
- const HTMLElementProtoDatasetGetter = ObjectLookupOwnGetter$1(HTMLElement.prototype, 'dataset');
938
- const HTMLElementProtoStyleGetter$1 = ObjectLookupOwnGetter$1(HTMLElement.prototype, 'style');
937
+ const HTMLElementProtoDatasetGetter = ObjectLookupOwnGetter(HTMLElement.prototype, 'dataset');
938
+ const HTMLElementProtoStyleGetter$1 = ObjectLookupOwnGetter(HTMLElement.prototype, 'style');
939
939
 
940
940
  function HTMLElementDatasetGetter(el) {
941
- return ReflectApply$3(HTMLElementProtoDatasetGetter, el, emptyArray$1);
941
+ return ReflectApply$3(HTMLElementProtoDatasetGetter, el, emptyArray);
942
942
  }
943
943
 
944
944
  const HTMLElementInnerTextSetter = HTMLElementProtoInnerTextSetter ? function HTMLElementInnerTextSetter(el, text) {
@@ -953,30 +953,30 @@ const HTMLElementOuterTextSetter = HTMLElementProtoOuterTextSetter ? function HT
953
953
  function HTMLElementOuterTextSetter(_el, _text) {};
954
954
 
955
955
  function HTMLElementStyleGetter$1(el) {
956
- return ReflectApply$3(HTMLElementProtoStyleGetter$1, el, emptyArray$1);
956
+ return ReflectApply$3(HTMLElementProtoStyleGetter$1, el, emptyArray);
957
957
  }
958
958
 
959
- const HTMLFrameElementProtoContentDocumentGetter = ObjectLookupOwnGetter$1(HTMLFrameElement.prototype, 'contentDocument');
960
- const HTMLFrameElementProtoContentWindowGetter = ObjectLookupOwnGetter$1(HTMLFrameElement.prototype, 'contentWindow');
959
+ const HTMLFrameElementProtoContentDocumentGetter = ObjectLookupOwnGetter(HTMLFrameElement.prototype, 'contentDocument');
960
+ const HTMLFrameElementProtoContentWindowGetter = ObjectLookupOwnGetter(HTMLFrameElement.prototype, 'contentWindow');
961
961
 
962
962
  function HTMLFrameElementContentDocumentGetter(frame) {
963
- return ReflectApply$3(HTMLFrameElementProtoContentDocumentGetter, frame, emptyArray$1);
963
+ return ReflectApply$3(HTMLFrameElementProtoContentDocumentGetter, frame, emptyArray);
964
964
  }
965
965
 
966
966
  function HTMLFrameElementContentWindowGetter(frame) {
967
- return ReflectApply$3(HTMLFrameElementProtoContentWindowGetter, frame, emptyArray$1);
967
+ return ReflectApply$3(HTMLFrameElementProtoContentWindowGetter, frame, emptyArray);
968
968
  }
969
969
 
970
- const HTMLIFrameElementProtoContentDocumentGetter = ObjectLookupOwnGetter$1(HTMLIFrameElement.prototype, 'contentDocument');
971
- const HTMLIFrameElementProtoContentWindowGetter$1 = ObjectLookupOwnGetter$1(HTMLIFrameElement.prototype, 'contentWindow');
970
+ const HTMLIFrameElementProtoContentDocumentGetter = ObjectLookupOwnGetter(HTMLIFrameElement.prototype, 'contentDocument');
971
+ const HTMLIFrameElementProtoContentWindowGetter$1 = ObjectLookupOwnGetter(HTMLIFrameElement.prototype, 'contentWindow');
972
972
  const HTMLIFrameElementProtoSrcSetter = ObjectLookupOwnSetter(HTMLIFrameElement.prototype, 'src');
973
973
 
974
974
  function HTMLIFrameElementContentDocumentGetter(iframe) {
975
- return ReflectApply$3(HTMLIFrameElementProtoContentDocumentGetter, iframe, emptyArray$1);
975
+ return ReflectApply$3(HTMLIFrameElementProtoContentDocumentGetter, iframe, emptyArray);
976
976
  }
977
977
 
978
978
  function HTMLIFrameElementContentWindowGetter$1(iframe) {
979
- return ReflectApply$3(HTMLIFrameElementProtoContentWindowGetter$1, iframe, emptyArray$1);
979
+ return ReflectApply$3(HTMLIFrameElementProtoContentWindowGetter$1, iframe, emptyArray);
980
980
  }
981
981
 
982
982
  function HTMLIFrameElementSrcSetter(iframe, src) {
@@ -994,17 +994,17 @@ function HTMLLinkElementRelListSetter(link, relList) {
994
994
  ReflectApply$3(HTMLLinkElementProtoRelListSetter, link, [relList]);
995
995
  }
996
996
 
997
- const HTMLObjectProtoContentDocumentGetter = ObjectLookupOwnGetter$1(HTMLObjectElement.prototype, 'contentDocument');
998
- const HTMLObjectElementProtoContentWindowGetter = ObjectLookupOwnGetter$1(HTMLObjectElement.prototype, 'contentWindow');
997
+ const HTMLObjectProtoContentDocumentGetter = ObjectLookupOwnGetter(HTMLObjectElement.prototype, 'contentDocument');
998
+ const HTMLObjectElementProtoContentWindowGetter = ObjectLookupOwnGetter(HTMLObjectElement.prototype, 'contentWindow');
999
999
 
1000
1000
  function HTMLObjectElementContentDocumentGetter(objectEl) {
1001
- return ReflectApply$3(HTMLObjectProtoContentDocumentGetter, objectEl, emptyArray$1);
1001
+ return ReflectApply$3(HTMLObjectProtoContentDocumentGetter, objectEl, emptyArray);
1002
1002
  } // contentWindow is not supported on object elements in iOS < 13.
1003
1003
  // https://caniuse.com/mdn-api_htmlobjectelement_contentwindow
1004
1004
 
1005
1005
 
1006
1006
  const HTMLObjectElementContentWindowGetter = HTMLObjectElementProtoContentWindowGetter ? function HTMLObjectElementContentWindowGetter(objectEl) {
1007
- return ReflectApply$3(HTMLObjectElementProtoContentWindowGetter, objectEl, emptyArray$1);
1007
+ return ReflectApply$3(HTMLObjectElementProtoContentWindowGetter, objectEl, emptyArray);
1008
1008
  } :
1009
1009
  /* istanbul ignore next: safely ignorable fallback */
1010
1010
  function HTMLObjectElementContentWindowGetter(_objectEl) {
@@ -1014,10 +1014,10 @@ const {
1014
1014
  get: HTMLScriptElementProtoSrcGetter,
1015
1015
  set: HTMLScriptElementProtoSrcSetter
1016
1016
  } = ReflectGetOwnPropertyDescriptor$1(HTMLScriptElement.prototype, 'src');
1017
- const MessageEventProtoSourceGetter = ObjectLookupOwnGetter$1(MessageEvent.prototype, 'source');
1017
+ const MessageEventProtoSourceGetter = ObjectLookupOwnGetter(MessageEvent.prototype, 'source');
1018
1018
 
1019
1019
  function MessageEventSourceGetter(messageEvent) {
1020
- return ReflectApply$3(MessageEventProtoSourceGetter, messageEvent, emptyArray$1);
1020
+ return ReflectApply$3(MessageEventProtoSourceGetter, messageEvent, emptyArray);
1021
1021
  }
1022
1022
  const NAMESPACE_DEFAULT = 'default';
1023
1023
  const NAMESPACE_SVG = 'http://www.w3.org/2000/svg';
@@ -1026,12 +1026,12 @@ const NAMESPACE_XLINK = 'http://www.w3.org/1999/xlink';
1026
1026
  const {
1027
1027
  createContextualFragment: RangeProtoCreateContextualFragment
1028
1028
  } = Range.prototype;
1029
- const RequestProtoURLGetter = ObjectLookupOwnGetter$1(Request.prototype, 'url'); // This has to be done 1-by-1 because putting a full file ignore in this file will result in
1029
+ const RequestProtoURLGetter = ObjectLookupOwnGetter(Request.prototype, 'url'); // This has to be done 1-by-1 because putting a full file ignore in this file will result in
1030
1030
  // dist/index.js containing the directive and subsequently being ignored.
1031
1031
  // istanbul ignore next
1032
1032
 
1033
1033
  function RequestURLGetter(request) {
1034
- return ReflectApply$3(RequestProtoURLGetter, request, emptyArray$1);
1034
+ return ReflectApply$3(RequestProtoURLGetter, request, emptyArray);
1035
1035
  }
1036
1036
 
1037
1037
  const {
@@ -1071,10 +1071,10 @@ const HAS_BREAKABLE_CSS_STYLE_DECLARATION_MAGIC_OBJECT = (() => {
1071
1071
  return div.getAttribute('style') === '';
1072
1072
  })();
1073
1073
 
1074
- const SVGElementProtoDatasetGetter = ObjectLookupOwnGetter$1(SVGElement.prototype, 'dataset');
1074
+ const SVGElementProtoDatasetGetter = ObjectLookupOwnGetter(SVGElement.prototype, 'dataset');
1075
1075
 
1076
1076
  function SVGElementDatasetGetter(svg) {
1077
- return ReflectApply$3(SVGElementProtoDatasetGetter, svg, emptyArray$1);
1077
+ return ReflectApply$3(SVGElementProtoDatasetGetter, svg, emptyArray);
1078
1078
  }
1079
1079
 
1080
1080
  const {
@@ -1084,32 +1084,11 @@ const {
1084
1084
  const ALLOW_LIST_PATCHED = ['opener', 'parent'];
1085
1085
  const ALLOW_LIST_RAW = ['close', 'closed', 'focus'];
1086
1086
  const DEFAULT_OVERWRITTEN_VALUE = {};
1087
- const {
1088
- clearInterval: WindowStaticClearInterval
1089
- } = window;
1090
- const WindowStaticLengthGetter = ObjectLookupOwnGetter$1(window, 'length');
1091
- const WindowStaticOpenerGetter = ObjectLookupOwnGetter$1(window, 'opener');
1092
- const WindowStaticParentGetter = ObjectLookupOwnGetter$1(window, 'parent');
1093
- const WindowStaticPostMessageValue = ObjectLookupOwnValue(window, 'postMessage');
1094
- const WindowStaticSelfGetter = ObjectLookupOwnGetter$1(window, 'self');
1095
- const patchedWindowMap = new WeakMapCtor(); // NOTE: Currently, only used for "postMessage" to unwrap plain objects and primitives.
1096
- // This is a temporary fix that would remove classes, functions, callbacks, etc.
1097
-
1098
- function patchedWindowPostMessageValue(...args) {
1099
- const message = args.length ? args[0] : undefined;
1100
-
1101
- if (isObject(message)) {
1102
- try {
1103
- args[0] = JSONClone(message);
1104
- } catch (_unused) {
1105
- // eslint-disable-next-line @typescript-eslint/no-throw-literal
1106
- throw new DOMException('The object could not be cloned.');
1107
- }
1108
- }
1109
-
1110
- return ReflectApply$3(WindowStaticPostMessageValue, this, args);
1111
- } // istanbul ignore next
1112
-
1087
+ const WindowStaticLengthGetter = ObjectLookupOwnGetter(window, 'length');
1088
+ const WindowStaticOpenerGetter = ObjectLookupOwnGetter(window, 'opener');
1089
+ const WindowStaticParentGetter = ObjectLookupOwnGetter(window, 'parent');
1090
+ const WindowStaticSelfGetter = ObjectLookupOwnGetter(window, 'self');
1091
+ const patchedWindowMap = new WeakMapCtor(); // istanbul ignore next
1113
1092
 
1114
1093
  function createPatchedWindow(rawWindow) {
1115
1094
  const patchedWindow = {};
@@ -1142,7 +1121,7 @@ function createPatchedWindow(rawWindow) {
1142
1121
 
1143
1122
  if (typeof getter === 'function') {
1144
1123
  safeDesc.get = function get() {
1145
- return overwrittenValue === DEFAULT_OVERWRITTEN_VALUE ? ReflectApply$3(getter, rawWindow, emptyArray$1) : overwrittenValue;
1124
+ return overwrittenValue === DEFAULT_OVERWRITTEN_VALUE ? ReflectApply$3(getter, rawWindow, emptyArray) : overwrittenValue;
1146
1125
  };
1147
1126
  }
1148
1127
 
@@ -1172,7 +1151,7 @@ function createPatchedWindow(rawWindow) {
1172
1151
  if (typeof getter === 'function') {
1173
1152
  safeDesc.get = function get() {
1174
1153
  if (overwrittenValue === DEFAULT_OVERWRITTEN_VALUE) {
1175
- return getPatchedWindow(ReflectApply$3(getter, rawWindow, emptyArray$1));
1154
+ return getPatchedWindow(ReflectApply$3(getter, rawWindow, emptyArray));
1176
1155
  }
1177
1156
 
1178
1157
  return overwrittenValue;
@@ -1194,24 +1173,40 @@ function createPatchedWindow(rawWindow) {
1194
1173
  if (unsafePostMessageDesc) {
1195
1174
  const safeDesc = toSafeDescriptor(unsafePostMessageDesc);
1196
1175
  const {
1197
- value: originalValue
1176
+ value: originalPostMessage
1198
1177
  } = safeDesc;
1199
1178
 
1200
- if (typeof originalValue === 'function') {
1201
- safeDesc.value = function postMessage(...args) {
1202
- return ReflectApply$3(patchedWindowPostMessageValue, rawWindow, args);
1203
- };
1179
+ if (typeof originalPostMessage === 'function') {
1180
+ safeDesc.value = getPatchedPostMessage(originalPostMessage, rawWindow);
1204
1181
  }
1205
1182
 
1206
1183
  ReflectDefineProperty(patchedWindow, 'postMessage', safeDesc);
1207
1184
  }
1208
1185
 
1209
1186
  return patchedWindow;
1187
+ }
1188
+
1189
+ function getPatchedPostMessage(originalValue, rawWindow) {
1190
+ return function postMessage(...args) {
1191
+ const message = args.length ? args[0] : undefined;
1192
+
1193
+ if (isObject(message)) {
1194
+ try {
1195
+ args[0] = JSONClone(message);
1196
+ } catch (_unused) {
1197
+ // eslint-disable-next-line @typescript-eslint/no-throw-literal
1198
+ throw new DOMException('The object could not be cloned.');
1199
+ }
1200
+ }
1201
+
1202
+ return ReflectApply$3(originalValue, rawWindow, args);
1203
+ };
1210
1204
  } // setInterval and clearInterval are part of WindowOrGlobalScope mixin, they are
1211
1205
  // not on Window.prototype. See https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope.
1212
1206
 
1213
1207
 
1214
1208
  const {
1209
+ clearInterval: WindowStaticClearInterval,
1215
1210
  decodeURIComponent: WindowStaticDecodeURIComponent,
1216
1211
  encodeURIComponent: WindowStaticEncodeURIComponent,
1217
1212
  fetch: WindowStaticFetch,
@@ -1264,19 +1259,19 @@ function WindowClearInterval(win, intervalID) {
1264
1259
  }
1265
1260
 
1266
1261
  function WindowLengthGetter(win) {
1267
- return ReflectApply$3(WindowStaticLengthGetter, win, emptyArray$1);
1262
+ return ReflectApply$3(WindowStaticLengthGetter, win, emptyArray);
1268
1263
  }
1269
1264
 
1270
1265
  function WindowOpenerGetter(win) {
1271
- return ReflectApply$3(WindowStaticOpenerGetter, win, emptyArray$1);
1266
+ return ReflectApply$3(WindowStaticOpenerGetter, win, emptyArray);
1272
1267
  }
1273
1268
 
1274
1269
  function WindowParentGetter(win) {
1275
- return ReflectApply$3(WindowStaticParentGetter, win, emptyArray$1);
1270
+ return ReflectApply$3(WindowStaticParentGetter, win, emptyArray);
1276
1271
  }
1277
1272
 
1278
1273
  function WindowSelfGetter(win) {
1279
- return ReflectApply$3(WindowStaticSelfGetter, win, emptyArray$1);
1274
+ return ReflectApply$3(WindowStaticSelfGetter, win, emptyArray);
1280
1275
  }
1281
1276
 
1282
1277
  function WindowSetInterval(win, ...args) {
@@ -1291,8 +1286,8 @@ const XhrProto = XhrCtor.prototype;
1291
1286
  const {
1292
1287
  send: XhrProtoSend
1293
1288
  } = XhrProto;
1294
- const XhrProtoResponseTextGetter = ObjectLookupOwnGetter$1(XhrProto, 'responseText');
1295
- const XhrProtoStatusGetter = ObjectLookupOwnGetter$1(XhrProto, 'status');
1289
+ const XhrProtoResponseTextGetter = ObjectLookupOwnGetter(XhrProto, 'responseText');
1290
+ const XhrProtoStatusGetter = ObjectLookupOwnGetter(XhrProto, 'status');
1296
1291
  const XhrProtoWithCredentialsSetter = ObjectLookupOwnSetter(XhrProto, 'withCredentials'); // istanbul ignore next
1297
1292
 
1298
1293
  const {
@@ -1305,24 +1300,24 @@ function XhrOpen(xhr, requestMethod, url, async = true) {
1305
1300
 
1306
1301
 
1307
1302
  function XhrResponseTextGetter(xhr) {
1308
- return ReflectApply$3(XhrProtoResponseTextGetter, xhr, emptyArray$1);
1303
+ return ReflectApply$3(XhrProtoResponseTextGetter, xhr, emptyArray);
1309
1304
  } // istanbul ignore next
1310
1305
 
1311
1306
 
1312
1307
  function XhrSend(xhr) {
1313
- return ReflectApply$3(XhrProtoSend, xhr, emptyArray$1);
1308
+ return ReflectApply$3(XhrProtoSend, xhr, emptyArray);
1314
1309
  } // istanbul ignore next
1315
1310
 
1316
1311
 
1317
1312
  function XhrStatusGetter(xhr) {
1318
- return ReflectApply$3(XhrProtoStatusGetter, xhr, emptyArray$1);
1313
+ return ReflectApply$3(XhrProtoStatusGetter, xhr, emptyArray);
1319
1314
  } // istanbul ignore next
1320
1315
 
1321
1316
 
1322
1317
  function XhrWithCredentialsSetter(xhr, bool) {
1323
1318
  ReflectApply$3(XhrProtoWithCredentialsSetter, xhr, [bool]);
1324
1319
  }
1325
- /*! version: 0.14.26 */
1320
+ /*! version: 0.14.28 */
1326
1321
 
1327
1322
  /*!
1328
1323
  * Copyright (C) 2019 salesforce.com, inc.
@@ -1360,7 +1355,7 @@ function sanitizeURLForElement(url) {
1360
1355
  function sanitizeURLString(urlString) {
1361
1356
  return urlString === '' ? urlString : StringReplace(urlString, REMOVE_URL_CHARS_REGEXP, '');
1362
1357
  }
1363
- /*! version: 0.14.26 */
1358
+ /*! version: 0.14.28 */
1364
1359
 
1365
1360
  /*! @license DOMPurify | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.2.2/LICENSE */
1366
1361
 
@@ -2967,7 +2962,7 @@ function allowCustomTagHook(node, data, _config) {
2967
2962
  allowedTags[tagName] = true;
2968
2963
  }
2969
2964
  }
2970
- /*! version: 0.14.26 */
2965
+ /*! version: 0.14.28 */
2971
2966
 
2972
2967
  /*!
2973
2968
  * Copyright (C) 2019 salesforce.com, inc.
@@ -3112,7 +3107,7 @@ function abstractFactoryValueThrower(proto, propName) {
3112
3107
 
3113
3108
  function abstractFactoryGetThrower(proto, propName) {
3114
3109
  return function getThrowerDistortionFactory(_globalObject) {
3115
- const originalGet = ObjectLookupOwnGetter$1(proto, propName);
3110
+ const originalGet = ObjectLookupOwnGetter(proto, propName);
3116
3111
 
3117
3112
  function get() {
3118
3113
  throw new LockerSecurityError(`Cannot access ${propName}.`);
@@ -3539,11 +3534,57 @@ function distortionCookieStoreGetAll(globalObject, options) {
3539
3534
  };
3540
3535
 
3541
3536
  return [originalGetAll, getAll];
3537
+ } // @ts-ignore: TS doesn't like null as a EventTargetRestrictionRegistry.
3538
+
3539
+
3540
+ const restrictionsBySandboxKey = {
3541
+ __proto__: null
3542
+ };
3543
+
3544
+ function isEventTargetRestricted(eventTarget, eventName, options) {
3545
+ const {
3546
+ key
3547
+ } = options;
3548
+ const bySandboxKey = restrictionsBySandboxKey[key];
3549
+
3550
+ if (!bySandboxKey || !bySandboxKey[eventName]) {
3551
+ return false;
3552
+ }
3553
+
3554
+ const {
3555
+ constructor
3556
+ } = eventTarget; // @ts-ignore: TS says Argument of type 'RestrictionEntryByEventName' is not assignable to parameter of type 'Set<any>'.
3557
+ // ...But it is.
3558
+
3559
+ return SetHas(bySandboxKey[eventName], constructor);
3560
+ }
3561
+
3562
+ function registerEventTargetRestriction(EventTargetCtor, eventName, options) {
3563
+ const {
3564
+ prototype: EventTargetProto
3565
+ } = EventTargetCtor;
3566
+
3567
+ if (!isEventTargetRestricted(EventTargetProto, eventName, options)) {
3568
+ var _restrictionsBySandbo;
3569
+
3570
+ const {
3571
+ key
3572
+ } = options;
3573
+ const bySandboxKey = (_restrictionsBySandbo = restrictionsBySandboxKey[key]) !== null && _restrictionsBySandbo !== void 0 ? _restrictionsBySandbo : {
3574
+ __proto__: null
3575
+ };
3576
+ const byEventName = bySandboxKey[eventName] || new SetCtor(); // @ts-ignore: Argument of type 'RestrictionEntryByEventName' is not assignable to parameter of type 'Set<any>'
3577
+ // ...But it is.
3578
+
3579
+ SetAdd(byEventName, EventTargetCtor);
3580
+ bySandboxKey[eventName] = byEventName;
3581
+ restrictionsBySandboxKey[key] = bySandboxKey;
3582
+ }
3542
3583
  }
3543
3584
  /* istanbul ignore next: only available in secure context */
3544
3585
 
3545
3586
 
3546
- function distortionCookieStoreOnChange(globalObject, _options) {
3587
+ function distortionCookieStoreOnChange(globalObject, options) {
3547
3588
  const {
3548
3589
  CookieStore
3549
3590
  } = globalObject;
@@ -3562,6 +3603,7 @@ function distortionCookieStoreOnChange(globalObject, _options) {
3562
3603
  throw new LockerSecurityError('Cannot set cookieStore.onchange.');
3563
3604
  }
3564
3605
 
3606
+ registerEventTargetRestriction(CookieStore, 'change', options);
3565
3607
  return [originalOnChangeSetter, onchange];
3566
3608
  }
3567
3609
  /* istanbul ignore next: only available in secure context */
@@ -3647,7 +3689,7 @@ function distortionDocumentCookieGetter(globalObject, options) {
3647
3689
  const {
3648
3690
  key
3649
3691
  } = options;
3650
- const originalCookieGetter = ObjectLookupOwnGetter$1(Document.prototype, 'cookie');
3692
+ const originalCookieGetter = ObjectLookupOwnGetter(Document.prototype, 'cookie');
3651
3693
 
3652
3694
  function get() {
3653
3695
  const documentCookieValue = DocumentCookieGetter(this);
@@ -3974,7 +4016,7 @@ function distortionElementAttributesGetter(globalObject) {
3974
4016
  const {
3975
4017
  Element
3976
4018
  } = globalObject;
3977
- const originalAttributesGetter = ObjectLookupOwnGetter$1(Element.prototype, 'attributes');
4019
+ const originalAttributesGetter = ObjectLookupOwnGetter(Element.prototype, 'attributes');
3978
4020
 
3979
4021
  function attributes() {
3980
4022
  const attrs = ElementAttributesGetter(this);
@@ -4170,7 +4212,7 @@ function distortionElementRemove(globalObject) {
4170
4212
  throw new LockerSecurityError(`Cannot remove ${this.nodeName}.`);
4171
4213
  }
4172
4214
 
4173
- ReflectApply$3(originalRemove, this, emptyArray$1);
4215
+ ReflectApply$3(originalRemove, this, emptyArray);
4174
4216
  }
4175
4217
 
4176
4218
  return [originalRemove, remove];
@@ -4449,7 +4491,7 @@ function distortionElementShadowRootGetter(globalObject) {
4449
4491
  const {
4450
4492
  Element
4451
4493
  } = globalObject;
4452
- const originalShadowRootGetter = ObjectLookupOwnGetter$1(Element.prototype, 'shadowRoot');
4494
+ const originalShadowRootGetter = ObjectLookupOwnGetter(Element.prototype, 'shadowRoot');
4453
4495
 
4454
4496
  function shadowRoot() {
4455
4497
  return null;
@@ -4460,7 +4502,7 @@ function distortionElementShadowRootGetter(globalObject) {
4460
4502
 
4461
4503
  function createDistortedComposedPath(event) {
4462
4504
  const currentTarget = EventCurrentTargetGetter(event);
4463
- const rawComposedPath = ReflectApply$3(EventProtoComposedPath, event, emptyArray$1);
4505
+ const rawComposedPath = ReflectApply$3(EventProtoComposedPath, event, emptyArray);
4464
4506
  const indexOfcurrentTarget = ArrayIndexOf(rawComposedPath, currentTarget);
4465
4507
  let distortedComposedPath = rawComposedPath;
4466
4508
 
@@ -4498,7 +4540,7 @@ function distortionEventPathGetter(globalObject) {
4498
4540
  const {
4499
4541
  Event
4500
4542
  } = globalObject;
4501
- const originalPathGetter = ObjectLookupOwnGetter$1(Event.prototype, 'path');
4543
+ const originalPathGetter = ObjectLookupOwnGetter(Event.prototype, 'path');
4502
4544
 
4503
4545
  if (!originalPathGetter) {
4504
4546
  return null;
@@ -4511,21 +4553,44 @@ function distortionEventPathGetter(globalObject) {
4511
4553
  return [originalPathGetter, path];
4512
4554
  }
4513
4555
 
4514
- function distortionEventTargetAddEventListener(globalObject) {
4556
+ function distortionEventTargetAddEventListener(globalObject, options) {
4515
4557
  const {
4516
- EventTarget,
4517
- CookieStore
4558
+ EventTarget
4518
4559
  } = globalObject;
4560
+ const {
4561
+ addEventListener: originalAddEventListener
4562
+ } = EventTarget.prototype;
4519
4563
 
4520
- if (CookieStore === undefined) {
4521
- return null;
4522
- }
4564
+ function addEventListener(...args) {
4565
+ const {
4566
+ length
4567
+ } = args; // Ensure that we always fall back to the default platform behavior
4568
+ // Which should fail if less than 2 arguments are provided.
4523
4569
 
4524
- const originalAddEventListener = ObjectLookupOwnValue(EventTarget.prototype, 'addEventListener');
4570
+ if (length > 1) {
4571
+ const {
4572
+ 0: eventName
4573
+ } = args;
4525
4574
 
4526
- function addEventListener(...args) {
4527
- if (this instanceof CookieStore) {
4528
- throw new LockerSecurityError('Cannot call cookieStore.addEventListener.');
4575
+ if (isEventTargetRestricted(this, eventName, options)) {
4576
+ var _safeDesc$value, _safeDesc;
4577
+
4578
+ const unsafeDesc = ReflectGetOwnPropertyDescriptor$1(this.constructor, 'name');
4579
+ let safeDesc;
4580
+
4581
+ if (unsafeDesc) {
4582
+ safeDesc = toSafeDescriptor(unsafeDesc);
4583
+ }
4584
+
4585
+ const name = toString$1((_safeDesc$value = (_safeDesc = safeDesc) === null || _safeDesc === void 0 ? void 0 : _safeDesc.value) !== null && _safeDesc$value !== void 0 ? _safeDesc$value : '');
4586
+ let exceptionMessage = `Cannot add '${eventName}' event listener`;
4587
+
4588
+ if (name) {
4589
+ exceptionMessage += ` to ${name} object`;
4590
+ }
4591
+
4592
+ throw new LockerSecurityError(`${exceptionMessage}.`);
4593
+ }
4529
4594
  }
4530
4595
 
4531
4596
  return ReflectApply$3(originalAddEventListener, this, args);
@@ -4538,7 +4603,7 @@ function distortionHTMLElementDatasetGetter(globalObject) {
4538
4603
  const {
4539
4604
  HTMLElement
4540
4605
  } = globalObject;
4541
- const originalDatasetGetter = ObjectLookupOwnGetter$1(HTMLElement.prototype, 'dataset');
4606
+ const originalDatasetGetter = ObjectLookupOwnGetter(HTMLElement.prototype, 'dataset');
4542
4607
 
4543
4608
  function dataset() {
4544
4609
  return liveObjectFromGetter(originalDatasetGetter, this);
@@ -4602,7 +4667,7 @@ function distortionHTMLElementStyleGetter(globalObject) {
4602
4667
  const {
4603
4668
  HTMLElement
4604
4669
  } = globalObject;
4605
- const originalStyleGetter = ObjectLookupOwnGetter$1(HTMLElement.prototype, 'style');
4670
+ const originalStyleGetter = ObjectLookupOwnGetter(HTMLElement.prototype, 'style');
4606
4671
 
4607
4672
  function style() {
4608
4673
  const styleObject = HTMLElementStyleGetter$1(this);
@@ -4626,7 +4691,7 @@ function distortionHTMLFrameElementContentDocumentGetter(globalObject) {
4626
4691
  const {
4627
4692
  HTMLFrameElement
4628
4693
  } = globalObject;
4629
- const originalContentDocumentGetter = ObjectLookupOwnGetter$1(HTMLFrameElement.prototype, 'contentDocument');
4694
+ const originalContentDocumentGetter = ObjectLookupOwnGetter(HTMLFrameElement.prototype, 'contentDocument');
4630
4695
 
4631
4696
  function contentDocument() {
4632
4697
  // Intentionally ignoring the returned value from the original to
@@ -4642,7 +4707,7 @@ function distortionHTMLFrameElemenentContentWindowGetter(globalObject) {
4642
4707
  const {
4643
4708
  HTMLFrameElement
4644
4709
  } = globalObject;
4645
- const originalContentWindowGetter = ObjectLookupOwnGetter$1(HTMLFrameElement.prototype, 'contentWindow');
4710
+ const originalContentWindowGetter = ObjectLookupOwnGetter(HTMLFrameElement.prototype, 'contentWindow');
4646
4711
 
4647
4712
  function contentWindow() {
4648
4713
  const rawContentWindow = HTMLFrameElementContentWindowGetter(this);
@@ -4656,7 +4721,7 @@ function distortionHTMLIFrameElementContentDocumentGetter(globalObject) {
4656
4721
  const {
4657
4722
  HTMLIFrameElement
4658
4723
  } = globalObject;
4659
- const originalContentDocumentGetter = ObjectLookupOwnGetter$1(HTMLIFrameElement.prototype, 'contentDocument');
4724
+ const originalContentDocumentGetter = ObjectLookupOwnGetter(HTMLIFrameElement.prototype, 'contentDocument');
4660
4725
 
4661
4726
  function contentDocument() {
4662
4727
  // Intentionally ignoring the returned value from the original to
@@ -4672,7 +4737,7 @@ function distortionHTMLIFrameElementContentWindowGetter(globalObject) {
4672
4737
  const {
4673
4738
  HTMLIFrameElement
4674
4739
  } = globalObject;
4675
- const originalContentWindowGetter = ObjectLookupOwnGetter$1(HTMLIFrameElement.prototype, 'contentWindow');
4740
+ const originalContentWindowGetter = ObjectLookupOwnGetter(HTMLIFrameElement.prototype, 'contentWindow');
4676
4741
 
4677
4742
  function contentWindow() {
4678
4743
  const rawContentWindow = HTMLIFrameElementContentWindowGetter$1(this);
@@ -4767,7 +4832,7 @@ function distortionHTMLObjectElementContentDocumentGetter(globalObject) {
4767
4832
  const {
4768
4833
  HTMLObjectElement
4769
4834
  } = globalObject;
4770
- const originalContentDocumentGetter = ObjectLookupOwnGetter$1(HTMLObjectElement.prototype, 'contentDocument');
4835
+ const originalContentDocumentGetter = ObjectLookupOwnGetter(HTMLObjectElement.prototype, 'contentDocument');
4771
4836
 
4772
4837
  function contentDocument() {
4773
4838
  // Intentionally ignoring the returned value from the original to
@@ -4783,7 +4848,7 @@ function distortionHTMLObjectElementContentWindowGetter(globalObject) {
4783
4848
  const {
4784
4849
  HTMLObjectElement
4785
4850
  } = globalObject;
4786
- const originalContentWindowGetter = ObjectLookupOwnGetter$1(HTMLObjectElement.prototype, 'contentWindow'); // contentWindow is not supported on object elements in iOS < 13.
4851
+ const originalContentWindowGetter = ObjectLookupOwnGetter(HTMLObjectElement.prototype, 'contentWindow'); // contentWindow is not supported on object elements in iOS < 13.
4787
4852
  // https://caniuse.com/mdn-api_htmlobjectelement_contentwindow
4788
4853
 
4789
4854
  if (!originalContentWindowGetter) {
@@ -4808,10 +4873,10 @@ function distortionHTMLScriptElementSrcGetter(globalObject) {
4808
4873
  const {
4809
4874
  HTMLScriptElement
4810
4875
  } = globalObject;
4811
- const originalSrcGetter = ObjectLookupOwnGetter$1(HTMLScriptElement.prototype, 'src');
4876
+ const originalSrcGetter = ObjectLookupOwnGetter(HTMLScriptElement.prototype, 'src');
4812
4877
 
4813
4878
  function src() {
4814
- return getDatasetSrcValue(this) || ReflectApply$3(HTMLScriptElementProtoSrcGetter, this, emptyArray$1);
4879
+ return getDatasetSrcValue(this) || ReflectApply$3(HTMLScriptElementProtoSrcGetter, this, emptyArray);
4815
4880
  }
4816
4881
 
4817
4882
  return [originalSrcGetter, src];
@@ -4835,7 +4900,7 @@ function distortionMessageEventSourceGetter(globalObject) {
4835
4900
  const {
4836
4901
  MessageEvent
4837
4902
  } = globalObject;
4838
- const originalSourceGetter = ObjectLookupOwnGetter$1(MessageEvent.prototype, 'source');
4903
+ const originalSourceGetter = ObjectLookupOwnGetter(MessageEvent.prototype, 'source');
4839
4904
 
4840
4905
  function source() {
4841
4906
  const rawSource = MessageEventSourceGetter(this);
@@ -4879,7 +4944,7 @@ function distortionNavigatorServiceWorkerGetter(globalObject) {
4879
4944
  const {
4880
4945
  Navigator
4881
4946
  } = globalObject;
4882
- const originalServiceWorkerGetter = ObjectLookupOwnGetter$1(Navigator.prototype, 'serviceWorker');
4947
+ const originalServiceWorkerGetter = ObjectLookupOwnGetter(Navigator.prototype, 'serviceWorker');
4883
4948
 
4884
4949
  if (!originalServiceWorkerGetter) {
4885
4950
  return null;
@@ -4968,7 +5033,7 @@ function distortionShadowRootModeGetter(globalObject) {
4968
5033
  const {
4969
5034
  ShadowRoot
4970
5035
  } = globalObject;
4971
- const originalModeGetter = ObjectLookupOwnGetter$1(ShadowRoot.prototype, 'mode');
5036
+ const originalModeGetter = ObjectLookupOwnGetter(ShadowRoot.prototype, 'mode');
4972
5037
 
4973
5038
  function mode() {
4974
5039
  return 'closed';
@@ -5304,7 +5369,7 @@ const {
5304
5369
  removeItem: patchedStorageProtoRemoveItem,
5305
5370
  setItem: patchedStorageProtoSetItem
5306
5371
  } = PatchedStorage.prototype;
5307
- const patchedStorageProtoLengthGetter = ObjectLookupOwnGetter$1(PatchedStorage.prototype, 'length');
5372
+ const patchedStorageProtoLengthGetter = ObjectLookupOwnGetter(PatchedStorage.prototype, 'length');
5308
5373
 
5309
5374
  function createDistortionStorageFactory(storageName) {
5310
5375
  return function distortionStorageFactory(globalObject, options) {
@@ -5329,7 +5394,7 @@ function distortionStorageLength(globalObject) {
5329
5394
  const {
5330
5395
  Storage
5331
5396
  } = globalObject;
5332
- const originalLengthGetter = ObjectLookupOwnGetter$1(Storage.prototype, 'length');
5397
+ const originalLengthGetter = ObjectLookupOwnGetter(Storage.prototype, 'length');
5333
5398
  return [originalLengthGetter, patchedStorageProtoLengthGetter];
5334
5399
  }
5335
5400
 
@@ -5397,7 +5462,7 @@ function distortionSVGElementDatasetGetter(globalObject) {
5397
5462
  const {
5398
5463
  SVGElement
5399
5464
  } = globalObject;
5400
- const originalDatasetGetter = ObjectLookupOwnGetter$1(SVGElement.prototype, 'dataset');
5465
+ const originalDatasetGetter = ObjectLookupOwnGetter(SVGElement.prototype, 'dataset');
5401
5466
 
5402
5467
  function dataset() {
5403
5468
  return liveObjectFromGetter(originalDatasetGetter, this);
@@ -5572,7 +5637,7 @@ function distortionWindowFetch(globalObject, options) {
5572
5637
 
5573
5638
 
5574
5639
  function distortionWindowFramesGetter(globalObject) {
5575
- const originalWindowFramesGetter = ObjectLookupOwnGetter$1(globalObject, 'frames');
5640
+ const originalWindowFramesGetter = ObjectLookupOwnGetter(globalObject, 'frames');
5576
5641
 
5577
5642
  if (originalWindowFramesGetter === undefined) {
5578
5643
  return null;
@@ -5809,7 +5874,7 @@ function distortionWindowFramesGetter(globalObject) {
5809
5874
  }
5810
5875
 
5811
5876
  function distortionWindowLengthGetter(globalObject) {
5812
- const originalLengthGetter = ObjectLookupOwnGetter$1(globalObject, 'length');
5877
+ const originalLengthGetter = ObjectLookupOwnGetter(globalObject, 'length');
5813
5878
 
5814
5879
  if (originalLengthGetter === undefined) {
5815
5880
  return null;
@@ -5822,6 +5887,24 @@ function distortionWindowLengthGetter(globalObject) {
5822
5887
  return [originalLengthGetter, length];
5823
5888
  }
5824
5889
 
5890
+ function distortionWindowOnstorage(globalObject, options) {
5891
+ const {
5892
+ Window
5893
+ } = globalObject;
5894
+ const originalOnstorageSetter = ObjectLookupOwnSetter(globalObject, 'onstorage');
5895
+
5896
+ if (typeof originalOnstorageSetter !== 'function') {
5897
+ return null;
5898
+ }
5899
+
5900
+ const onstorage = function onstorage() {
5901
+ throw new LockerSecurityError('Cannot set window.onstorage.');
5902
+ };
5903
+
5904
+ registerEventTargetRestriction(Window, 'storage', options);
5905
+ return [originalOnstorageSetter, onstorage];
5906
+ }
5907
+
5825
5908
  function distortionWindowOpen(globalObject) {
5826
5909
  const {
5827
5910
  open: originalOpenValue
@@ -5837,7 +5920,7 @@ function distortionWindowOpen(globalObject) {
5837
5920
  }
5838
5921
 
5839
5922
  function distortionWindowOpenerGetter(globalObject) {
5840
- const originalOpenerGetter = ObjectLookupOwnGetter$1(globalObject, 'opener');
5923
+ const originalOpenerGetter = ObjectLookupOwnGetter(globalObject, 'opener');
5841
5924
 
5842
5925
  if (originalOpenerGetter === undefined) {
5843
5926
  return null;
@@ -5852,7 +5935,7 @@ function distortionWindowOpenerGetter(globalObject) {
5852
5935
  }
5853
5936
 
5854
5937
  function distortionWindowParentGetter(globalObject) {
5855
- const originalParentGetter = ObjectLookupOwnGetter$1(globalObject, 'parent');
5938
+ const originalParentGetter = ObjectLookupOwnGetter(globalObject, 'parent');
5856
5939
 
5857
5940
  if (originalParentGetter === undefined) {
5858
5941
  return null;
@@ -5867,13 +5950,11 @@ function distortionWindowParentGetter(globalObject) {
5867
5950
  }
5868
5951
 
5869
5952
  function distortionWindowPostMessage(globalObject) {
5870
- const originalPostMessageValue = ObjectLookupOwnValue(globalObject, 'postMessage');
5871
-
5872
- function postMessage(...args) {
5873
- return ReflectApply$3(patchedWindowPostMessageValue, this, args);
5874
- }
5875
-
5876
- return [originalPostMessageValue, postMessage];
5953
+ const {
5954
+ postMessage: originalPostMessage
5955
+ } = globalObject;
5956
+ const postMessage = getPatchedPostMessage(originalPostMessage, globalObject);
5957
+ return [originalPostMessage, postMessage];
5877
5958
  }
5878
5959
 
5879
5960
  function distortionWindowSetInterval(globalObject, options) {
@@ -5998,10 +6079,10 @@ function distortionXMLHttpRequestResponseGetter(globalObject) {
5998
6079
  Document,
5999
6080
  XMLHttpRequest
6000
6081
  } = globalObject;
6001
- const originalResponseGetter = ObjectLookupOwnGetter$1(XMLHttpRequest.prototype, 'response');
6082
+ const originalResponseGetter = ObjectLookupOwnGetter(XMLHttpRequest.prototype, 'response');
6002
6083
 
6003
6084
  function response() {
6004
- const responseValue = ReflectApply$3(originalResponseGetter, this, emptyArray$1);
6085
+ const responseValue = ReflectApply$3(originalResponseGetter, this, emptyArray);
6005
6086
  return response instanceof Document ? sanitizeDocument(responseValue) : responseValue;
6006
6087
  }
6007
6088
 
@@ -6012,10 +6093,10 @@ function distortionXMLHttpRequestResponseXMLGetter(globalObject) {
6012
6093
  const {
6013
6094
  XMLHttpRequest
6014
6095
  } = globalObject;
6015
- const originalResponseXMLGetter = ObjectLookupOwnGetter$1(XMLHttpRequest.prototype, 'responseXML');
6096
+ const originalResponseXMLGetter = ObjectLookupOwnGetter(XMLHttpRequest.prototype, 'responseXML');
6016
6097
 
6017
6098
  function responseXML() {
6018
- const responseValue = ReflectApply$3(originalResponseXMLGetter, this, emptyArray$1);
6099
+ const responseValue = ReflectApply$3(originalResponseXMLGetter, this, emptyArray);
6019
6100
  return sanitizeDocument(responseValue);
6020
6101
  }
6021
6102
 
@@ -6055,7 +6136,7 @@ distortionStorageLength, distortionStorageGetItem, distortionStorageSetItem, dis
6055
6136
  distortionSVGElementDatasetGetter, // SVGUseElement
6056
6137
  distortionSVGUseElementHrefAttribute, distortionSVGUseElementXlinkHrefAttribute, // URL
6057
6138
  distortionURLCreateObjectURL, // Window
6058
- distortionWindowFetch, distortionWindowFramesGetter, distortionWindowLengthGetter, distortionWindowOpen, distortionWindowOpenerGetter, distortionWindowParentGetter, distortionWindowPostMessage, // Worker
6139
+ distortionWindowFetch, distortionWindowFramesGetter, distortionWindowLengthGetter, distortionWindowOnstorage, distortionWindowOpen, distortionWindowOpenerGetter, distortionWindowParentGetter, distortionWindowPostMessage, // Worker
6059
6140
  distortionWorkerCtor, distortionWorkerProto, // XHR
6060
6141
  distortionXMLHttpRequestOpen, distortionXMLHttpRequestResponseGetter, distortionXMLHttpRequestResponseXMLGetter];
6061
6142
  const fundamentalKeyedDistortionFactories = [// Aura
@@ -6222,7 +6303,7 @@ function createInternalDistortionEntries(globalObject, key, evaluator, config) {
6222
6303
  ReflectApply$3(ArrayProtoPush, entries, makeElementDistortionsForSandboxKey(key));
6223
6304
  return entries;
6224
6305
  }
6225
- /*! version: 0.14.26 */
6306
+ /*! version: 0.14.28 */
6226
6307
 
6227
6308
  /*!
6228
6309
  * Copyright (C) 2021 salesforce.com, inc.
@@ -6383,7 +6464,7 @@ class DefaultInstrumentation {
6383
6464
 
6384
6465
 
6385
6466
  const defaultInstrumentation = new DefaultInstrumentation();
6386
- /*! version: 0.14.26 */
6467
+ /*! version: 0.14.28 */
6387
6468
 
6388
6469
  /*!
6389
6470
  * Copyright (C) 2019 salesforce.com, inc.
@@ -6423,21 +6504,41 @@ var SupportFlagsEnum;
6423
6504
  ReflectSetPrototypeOf(SupportFlagsEnum, null); // istanbul ignore next
6424
6505
 
6425
6506
  function createMembraneMarshall() {
6507
+ // This package is bundled by third-parties that have their own build time
6508
+ // replacement logic. Instead of customizing each build system to be aware of
6509
+ // this package we perform a small runtime check to determine whether our
6510
+ // code is minified or in DEBUG_MODE.
6511
+ // https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.debug_mode_enable
6512
+ const DEBUG_MODE = `${() =>
6513
+ /**/
6514
+ 1}`.includes('*');
6515
+ const LOCKER_LIVE_MARKER_SYMBOL = Symbol.for('@@lockerLiveValue');
6516
+ const LOCKER_MAGIC_MARKER_SYMBOL = Symbol.for('@@lockerMagicValue');
6517
+ const {
6518
+ toStringTag: TO_STRING_TAG_SYMBOL
6519
+ } = Symbol;
6520
+ const UNDEFINED_SYMBOL = Symbol.for('@@membraneUndefinedValue');
6426
6521
  const ArrayCtor = Array;
6427
6522
  const {
6428
6523
  isArray: isArrayOrNotOrThrowForRevoked
6429
- } = Array;
6524
+ } = ArrayCtor;
6525
+ const {
6526
+ isView: ArrayBufferIsView
6527
+ } = ArrayBuffer;
6528
+ const ObjectCtor = Object;
6430
6529
  const {
6431
6530
  defineProperties: ObjectDefineProperties,
6432
6531
  freeze: ObjectFreeze,
6532
+ getOwnPropertyDescriptors: ObjectGetOwnPropertyDescriptors,
6433
6533
  isFrozen: ObjectIsFrozen,
6434
6534
  isSealed: ObjectIsSealed,
6535
+ prototype: ObjectProto,
6435
6536
  seal: ObjectSeal
6436
- } = Object;
6537
+ } = ObjectCtor;
6437
6538
  const {
6438
6539
  hasOwnProperty: ObjectProtoHasOwnProperty,
6439
6540
  toString: ObjectProtoToString
6440
- } = Object.prototype;
6541
+ } = ObjectProto;
6441
6542
  const {
6442
6543
  revocable: ProxyRevocable
6443
6544
  } = Proxy;
@@ -6465,6 +6566,11 @@ function createMembraneMarshall() {
6465
6566
  get: WeakMapProtoGet,
6466
6567
  set: WeakMapProtoSet
6467
6568
  } = WeakMap.prototype;
6569
+ const consoleRef = console;
6570
+ const {
6571
+ warn: consoleWarn
6572
+ } = consoleRef;
6573
+ const localEval = eval;
6468
6574
  const globalThisRef = typeof globalThis !== 'undefined' && globalThis || // This is for environments like Android emulators running Chrome 69.
6469
6575
  // eslint-disable-next-line no-restricted-globals
6470
6576
  typeof self !== 'undefined' && self || ( // See https://mathiasbynens.be/notes/globalthis for more details.
@@ -6481,16 +6587,7 @@ function createMembraneMarshall() {
6481
6587
  return this || self;
6482
6588
  }
6483
6589
 
6484
- }), globalThis);
6485
- const {
6486
- eval: cachedLocalEval
6487
- } = globalThisRef;
6488
- const LOCKER_LIVE_MARKER_SYMBOL = Symbol.for('@@lockerLiveValue');
6489
- const LOCKER_MAGIC_MARKER_SYMBOL = Symbol.for('@@lockerMagicValue');
6490
- const {
6491
- toStringTag: TO_STRING_TAG_SYMBOL
6492
- } = Symbol;
6493
- const UNDEFINED_SYMBOL = Symbol.for('@@membraneUndefinedValue'); // eslint-disable-next-line no-shadow
6590
+ }), globalThis); // eslint-disable-next-line no-shadow
6494
6591
 
6495
6592
  let MarshallSupportFlagsField;
6496
6593
 
@@ -6508,7 +6605,7 @@ function createMembraneMarshall() {
6508
6605
  TargetIntegrityTraits[TargetIntegrityTraits["IsNotExtensible"] = 1] = "IsNotExtensible";
6509
6606
  TargetIntegrityTraits[TargetIntegrityTraits["IsSealed"] = 2] = "IsSealed";
6510
6607
  TargetIntegrityTraits[TargetIntegrityTraits["IsFrozen"] = 4] = "IsFrozen";
6511
- TargetIntegrityTraits[TargetIntegrityTraits["Revoked"] = 16] = "Revoked";
6608
+ TargetIntegrityTraits[TargetIntegrityTraits["Revoked"] = 8] = "Revoked";
6512
6609
  })(TargetIntegrityTraits || (TargetIntegrityTraits = {}));
6513
6610
 
6514
6611
  ReflectSetPrototypeOf(TargetIntegrityTraits, null); // eslint-disable-next-line no-shadow
@@ -6519,13 +6616,14 @@ function createMembraneMarshall() {
6519
6616
  TargetTraits[TargetTraits["None"] = 0] = "None";
6520
6617
  TargetTraits[TargetTraits["IsArray"] = 1] = "IsArray";
6521
6618
  TargetTraits[TargetTraits["IsFunction"] = 2] = "IsFunction";
6522
- TargetTraits[TargetTraits["IsObject"] = 4] = "IsObject";
6523
- TargetTraits[TargetTraits["IsArrowFunction"] = 8] = "IsArrowFunction";
6619
+ TargetTraits[TargetTraits["IsArrowFunction"] = 4] = "IsArrowFunction";
6620
+ TargetTraits[TargetTraits["IsObject"] = 8] = "IsObject";
6524
6621
  TargetTraits[TargetTraits["Revoked"] = 16] = "Revoked";
6525
6622
  })(TargetTraits || (TargetTraits = {}));
6526
6623
 
6527
6624
  ReflectSetPrototypeOf(TargetTraits, null);
6528
- return function createHooksCallback(color, trapMutations, supportFlags = SupportFlagsEnum.None, foreignCallableHooksCallback, options) {
6625
+ return function createHooksCallback(color, trapMutations, // eslint-disable-next-line @typescript-eslint/default-param-last
6626
+ supportFlags = SupportFlagsEnum.None, foreignCallableHooksCallback, options) {
6529
6627
  const {
6530
6628
  distortionCallback = o => o,
6531
6629
  instrumentation
@@ -6548,35 +6646,33 @@ function createMembraneMarshall() {
6548
6646
  let foreignCallablePreventExtensions;
6549
6647
  let foreignCallableSet;
6550
6648
  let foreignCallableSetPrototypeOf;
6649
+ let foreignCallableGetOwnPropertyDescriptors;
6551
6650
  let foreignCallableGetTargetIntegrityTraits;
6552
6651
  let foreignCallableGetUnbrandedTag;
6553
6652
  let foreignCallableHasOwnProperty;
6653
+ let foreignCallableIsLiveTarget;
6654
+ let foreignCallableWarn;
6554
6655
  let selectedTarget;
6555
6656
 
6556
6657
  function copyForeignDescriptorsIntoShadowTarget(shadowTarget, foreignTargetPointer) {
6557
- let keys = [];
6558
- foreignCallableOwnKeys(foreignTargetPointer, (...args) => {
6559
- keys = args;
6658
+ foreignCallableGetOwnPropertyDescriptors(foreignTargetPointer, (...descriptorTuples) => {
6659
+ const descriptors = {};
6660
+
6661
+ for (let i = 0, len = descriptorTuples.length; i < len; i += 7) {
6662
+ const key = descriptorTuples[i];
6663
+ descriptors[key] = createDescriptorFromMeta(descriptorTuples[i + 1], // configurable
6664
+ descriptorTuples[i + 2], // enumerable
6665
+ descriptorTuples[i + 3], // writable
6666
+ descriptorTuples[i + 4], // valuePointer
6667
+ descriptorTuples[i + 5], // getPointer
6668
+ descriptorTuples[i + 6] // setPointer
6669
+ );
6670
+ } // Use `ObjectDefineProperties` instead of individual
6671
+ // `ReflectDefineProperty` calls for better performance.
6672
+
6673
+
6674
+ ObjectDefineProperties(shadowTarget, descriptors);
6560
6675
  });
6561
- const descriptors = {};
6562
- let safeDesc;
6563
-
6564
- const callbackWithDescriptor = (configurable, enumerable, writable, valuePointer, getPointer, setPointer) => {
6565
- safeDesc = createDescriptorFromMeta(configurable, enumerable, writable, valuePointer, getPointer, setPointer);
6566
- };
6567
-
6568
- for (let i = 0, len = keys.length; i < len; i += 1) {
6569
- const key = keys[i];
6570
- foreignCallableGetOwnPropertyDescriptor(foreignTargetPointer, key, callbackWithDescriptor);
6571
-
6572
- if (safeDesc) {
6573
- descriptors[key] = safeDesc;
6574
- }
6575
- } // Use `ObjectDefineProperties` instead of individual
6576
- // `ReflectDefineProperty` calls for better performance.
6577
-
6578
-
6579
- ObjectDefineProperties(shadowTarget, descriptors);
6580
6676
  } // metadata is the transferable descriptor definition
6581
6677
 
6582
6678
 
@@ -6620,11 +6716,12 @@ function createMembraneMarshall() {
6620
6716
  selectedTarget = originalTarget;
6621
6717
  };
6622
6718
 
6623
- {
6719
+ if (DEBUG_MODE) {
6624
6720
  // In case debugging is needed, the following lines can help:
6625
6721
  pointer['[[OriginalTarget]]'] = originalTarget;
6626
6722
  pointer['[[Color]]'] = color;
6627
6723
  }
6724
+
6628
6725
  return pointer;
6629
6726
  }
6630
6727
 
@@ -6639,7 +6736,8 @@ function createMembraneMarshall() {
6639
6736
  // istanbul ignore next
6640
6737
  shadowTarget = // eslint-disable-next-line func-names
6641
6738
  targetTraits & TargetTraits.IsArrowFunction ? () => {} : function () {};
6642
- {
6739
+
6740
+ if (DEBUG_MODE) {
6643
6741
  // This is only really needed for debugging,
6644
6742
  // it helps to identify the proxy by name
6645
6743
  ReflectDefineProperty(shadowTarget, 'name', {
@@ -6657,9 +6755,9 @@ function createMembraneMarshall() {
6657
6755
  }
6658
6756
 
6659
6757
  return shadowTarget;
6660
- } // this is needed even when using ShadowRealm, because the errors are not going
6661
- // to cross the callable boundary in a try/catch, instead, they need to be ported
6662
- // via the membrane artifacts.
6758
+ } // This is needed even when using ShadowRealm, because the errors are
6759
+ // not going to cross the callable boundary in a try/catch, instead,
6760
+ // they need to be ported via the membrane artifacts.
6663
6761
 
6664
6762
 
6665
6763
  function foreignErrorControl(foreignFn) {
@@ -6669,11 +6767,11 @@ function createMembraneMarshall() {
6669
6767
  } catch (e) {
6670
6768
  const pushedError = getSelectedTarget();
6671
6769
 
6672
- if (pushedError) {
6673
- throw pushedError;
6770
+ if (pushedError === undefined) {
6771
+ throw new TypeErrorCtor(e == null ? void 0 : e.message);
6674
6772
  }
6675
6773
 
6676
- throw new TypeErrorCtor(e == null ? void 0 : e.message);
6774
+ throw pushedError;
6677
6775
  }
6678
6776
  };
6679
6777
  }
@@ -6888,19 +6986,36 @@ function createMembraneMarshall() {
6888
6986
 
6889
6987
  return fn;
6890
6988
  }
6891
- /**
6892
- * An object is marked as a "live" object when it has a
6893
- * LOCKER_LIVE_MARKER_SYMBOL property. Live objects have their
6894
- * defineProperty, deleteProperty, preventExtensions, set, and
6895
- * setPrototypeOf proxy traps as "live" variations meaning that when
6896
- * mutation occurs instead of maintaining a separate object graph of
6897
- * changes the mutations are performed directly on the foreign target.
6898
- *
6899
- */
6900
6989
 
6990
+ function isLiveTarget(target) {
6991
+ if (target === ObjectProto) {
6992
+ return false;
6993
+ }
6994
+
6995
+ if (typeof target === 'object') {
6996
+ if ( // We only check for typed arrays here since arrays are
6997
+ // marked as live in the BoundaryProxyHandler constructor.
6998
+ ArrayBufferIsView(target)) {
6999
+ return true;
7000
+ }
7001
+
7002
+ const {
7003
+ constructor
7004
+ } = target;
7005
+
7006
+ if (constructor === ObjectCtor) {
7007
+ // If the constructor, own or inherited, points to `Object`
7008
+ // then `value` is not likely a prototype object.
7009
+ return true;
7010
+ }
6901
7011
 
6902
- function isForeignTargetMarkedLive(foreignTargetPointer) {
6903
- return foreignCallableHasOwnProperty(foreignTargetPointer, LOCKER_LIVE_MARKER_SYMBOL);
7012
+ if (ReflectGetPrototypeOf(target) === null) {
7013
+ // Ensure `value` is not an `Object.prototype` from an iframe.
7014
+ return typeof constructor !== 'function' || constructor.prototype !== target;
7015
+ }
7016
+ }
7017
+
7018
+ return ReflectApply(ObjectProtoHasOwnProperty, target, [LOCKER_LIVE_MARKER_SYMBOL]);
6904
7019
  }
6905
7020
  /**
6906
7021
  * An object is marked as a "magic" object when it has a
@@ -7140,7 +7255,7 @@ function createMembraneMarshall() {
7140
7255
  }
7141
7256
 
7142
7257
  function liveSetPrototypeOf(foreignTargetPointer, proto) {
7143
- const transferableProto = getTransferableValue(proto);
7258
+ const transferableProto = proto ? getTransferablePointer(proto) : proto;
7144
7259
  return foreignCallableSetPrototypeOf(foreignTargetPointer, transferableProto);
7145
7260
  }
7146
7261
 
@@ -7154,10 +7269,10 @@ function createMembraneMarshall() {
7154
7269
  }
7155
7270
 
7156
7271
  function pushErrorAcrossBoundary(e) {
7157
- const transferableError = getTransferableValue(e);
7272
+ const foreignErrorPointer = getTransferableValue(e);
7158
7273
 
7159
- if (typeof transferableError === 'function') {
7160
- transferableError();
7274
+ if (typeof foreignErrorPointer === 'function') {
7275
+ foreignErrorPointer();
7161
7276
  }
7162
7277
 
7163
7278
  return e;
@@ -7270,6 +7385,8 @@ function createMembraneMarshall() {
7270
7385
  // because it is not expecting to change in the future.
7271
7386
  // future optimization: hoping that proxies with frozen handlers can be faster
7272
7387
  ObjectFreeze(this);
7388
+ } else if (foreignTargetTraits & TargetTraits.IsArray) {
7389
+ this.makeProxyLive();
7273
7390
  }
7274
7391
  } // internal utilities
7275
7392
 
@@ -7292,6 +7409,13 @@ function createMembraneMarshall() {
7292
7409
  const {
7293
7410
  foreignTargetPointer
7294
7411
  } = this;
7412
+
7413
+ if (DEBUG_MODE) {
7414
+ try {
7415
+ foreignCallableWarn('Mutations on the membrane of an object originating ' + 'outside of the sandbox will not be reflected on ' + 'the object itself:', foreignTargetPointer); // eslint-disable-next-line no-empty
7416
+ } catch (_unused5) {}
7417
+ }
7418
+
7295
7419
  const targetIntegrityTraits = foreignCallableGetTargetIntegrityTraits(foreignTargetPointer);
7296
7420
 
7297
7421
  if (targetIntegrityTraits & TargetIntegrityTraits.Revoked) {
@@ -7307,7 +7431,7 @@ function createMembraneMarshall() {
7307
7431
  // can break the membrane, therefore we need protection
7308
7432
  const proto = liveGetPrototypeOf(foreignTargetPointer);
7309
7433
  ReflectSetPrototypeOf(shadowTarget, proto);
7310
- } catch (_unused5) {
7434
+ } catch (_unused6) {
7311
7435
  // TODO: is revoke the right action here? maybe just setting
7312
7436
  // proto to null instead?
7313
7437
  this.revoke();
@@ -7346,7 +7470,7 @@ function createMembraneMarshall() {
7346
7470
 
7347
7471
  makeProxyUnambiguous(shadowTarget) {
7348
7472
  // assert: trapMutations must be true
7349
- if (isForeignTargetMarkedLive(this.foreignTargetPointer)) {
7473
+ if (foreignCallableIsLiveTarget(this.foreignTargetPointer)) {
7350
7474
  this.makeProxyLive();
7351
7475
  } else {
7352
7476
  this.makeProxyStatic(shadowTarget);
@@ -7556,7 +7680,7 @@ function createMembraneMarshall() {
7556
7680
  }, // callableEvaluate
7557
7681
  sourceText => {
7558
7682
  try {
7559
- return getTransferableValue(cachedLocalEval(sourceText));
7683
+ return getTransferableValue(localEval(sourceText));
7560
7684
  } catch (e) {
7561
7685
  throw pushErrorAcrossBoundary(e);
7562
7686
  }
@@ -7581,17 +7705,39 @@ function createMembraneMarshall() {
7581
7705
  ReflectApply(WeakMapProtoSet, proxyTargetToPointerMap, [proxy, foreignTargetPointer]);
7582
7706
  return createPointer(proxy);
7583
7707
  }, // callableApply
7584
- instrumentCallableWrapper((targetPointer, thisArgPointerOrValue, ...listOfValuesOrPointers) => {
7585
- targetPointer();
7586
- const fn = getSelectedTarget();
7587
- const thisArg = getLocalValue(thisArgPointerOrValue);
7708
+ instrumentCallableWrapper((targetPointer, thisArgPointerOrPrimitive, ...listOfPointersOrPrimitives) => {
7709
+ targetPointer(); // Inline getSelectedTarget().
7710
+
7711
+ const fn = selectedTarget;
7712
+ selectedTarget = undefined; // Inline getLocalValue().
7713
+
7714
+ let thisArg = thisArgPointerOrPrimitive;
7715
+
7716
+ if (typeof thisArgPointerOrPrimitive === 'function') {
7717
+ thisArgPointerOrPrimitive(); // Inline getSelectedTarget().
7718
+
7719
+ thisArg = selectedTarget;
7720
+ selectedTarget = undefined;
7721
+ }
7722
+
7588
7723
  const {
7589
7724
  length: argsLen
7590
- } = listOfValuesOrPointers;
7725
+ } = listOfPointersOrPrimitives;
7591
7726
  const args = new ArrayCtor(argsLen);
7592
7727
 
7593
7728
  for (let i = 0, len = argsLen; i < len; i += 1) {
7594
- args[i] = getLocalValue(listOfValuesOrPointers[i]);
7729
+ const pointerOrPrimitive = listOfPointersOrPrimitives[i]; // Inline getLocalValue().
7730
+
7731
+ let localValue = pointerOrPrimitive;
7732
+
7733
+ if (typeof pointerOrPrimitive === 'function') {
7734
+ pointerOrPrimitive(); // Inline getSelectedTarget().
7735
+
7736
+ localValue = selectedTarget;
7737
+ selectedTarget = undefined;
7738
+ }
7739
+
7740
+ args[i] = localValue;
7595
7741
  }
7596
7742
 
7597
7743
  let value;
@@ -7600,21 +7746,51 @@ function createMembraneMarshall() {
7600
7746
  value = ReflectApply(fn, thisArg, args);
7601
7747
  } catch (e) {
7602
7748
  throw pushErrorAcrossBoundary(e);
7749
+ } // Inline getTransferableValue().
7750
+
7751
+
7752
+ if (typeof value === 'undefined') {
7753
+ return undefined;
7603
7754
  }
7604
7755
 
7605
- return getTransferableValue(value);
7756
+ if (value === null || typeof value !== 'function' && typeof value !== 'object') {
7757
+ return value;
7758
+ }
7759
+
7760
+ return getTransferablePointer(value);
7606
7761
  }, 'callableApply', INBOUND_INSTRUMENTATION_LABEL), // callableConstruct
7607
- instrumentCallableWrapper((targetPointer, newTargetPointerOrValue, ...listOfValuesOrPointers) => {
7608
- targetPointer();
7609
- const constructor = getSelectedTarget();
7610
- const newTarget = getLocalValue(newTargetPointerOrValue);
7762
+ instrumentCallableWrapper((targetPointer, newTargetPointerOrValue, ...listOfPointersOrPrimitives) => {
7763
+ targetPointer(); // Inline getSelectedTarget().
7764
+
7765
+ const constructor = selectedTarget; // Inline getLocalValue().
7766
+
7767
+ let newTarget = newTargetPointerOrValue;
7768
+
7769
+ if (typeof newTargetPointerOrValue === 'function') {
7770
+ newTargetPointerOrValue(); // Inline getSelectedTarget().
7771
+
7772
+ newTarget = selectedTarget;
7773
+ selectedTarget = undefined;
7774
+ }
7775
+
7611
7776
  const {
7612
7777
  length: argsLen
7613
- } = listOfValuesOrPointers;
7778
+ } = listOfPointersOrPrimitives;
7614
7779
  const args = new ArrayCtor(argsLen);
7615
7780
 
7616
7781
  for (let i = 0, len = argsLen; i < len; i += 1) {
7617
- args[i] = getLocalValue(listOfValuesOrPointers[i]);
7782
+ const pointerOrPrimitive = listOfPointersOrPrimitives[i]; // Inline getLocalValue().
7783
+
7784
+ let localValue = pointerOrPrimitive;
7785
+
7786
+ if (typeof pointerOrPrimitive === 'function') {
7787
+ pointerOrPrimitive(); // Inline getSelectedTarget().
7788
+
7789
+ localValue = selectedTarget;
7790
+ selectedTarget = undefined;
7791
+ }
7792
+
7793
+ args[i] = localValue;
7618
7794
  }
7619
7795
 
7620
7796
  let value;
@@ -7623,9 +7799,18 @@ function createMembraneMarshall() {
7623
7799
  value = ReflectConstruct(constructor, args, newTarget);
7624
7800
  } catch (e) {
7625
7801
  throw pushErrorAcrossBoundary(e);
7802
+ } // Inline getTransferableValue().
7803
+
7804
+
7805
+ if (typeof value === 'undefined') {
7806
+ return undefined;
7807
+ }
7808
+
7809
+ if (value === null || typeof value !== 'function' && typeof value !== 'object') {
7810
+ return value;
7626
7811
  }
7627
7812
 
7628
- return getTransferableValue(value);
7813
+ return getTransferablePointer(value);
7629
7814
  }, 'callableConstruct', INBOUND_INSTRUMENTATION_LABEL), // callableDefineProperty
7630
7815
  instrumentCallableWrapper((targetPointer, key, configurable, enumerable, writable, valuePointer, getPointer, setPointer) => {
7631
7816
  targetPointer();
@@ -7680,7 +7865,7 @@ function createMembraneMarshall() {
7680
7865
  throw pushErrorAcrossBoundary(e);
7681
7866
  }
7682
7867
 
7683
- return getTransferableValue(proto);
7868
+ return proto ? getTransferablePointer(proto) : proto;
7684
7869
  }, 'callableGetPrototypeOf', INBOUND_INSTRUMENTATION_LABEL), // callableIsExtensible
7685
7870
  instrumentCallableWrapper(targetPointer => {
7686
7871
  targetPointer();
@@ -7735,7 +7920,47 @@ function createMembraneMarshall() {
7735
7920
  } catch (e) {
7736
7921
  throw pushErrorAcrossBoundary(e);
7737
7922
  }
7738
- }, 'callableSetPrototypeOf', INBOUND_INSTRUMENTATION_LABEL), // callableGetTargetIntegrityTraits
7923
+ }, 'callableSetPrototypeOf', INBOUND_INSTRUMENTATION_LABEL), // callableGetOwnPropertyDescriptors
7924
+ instrumentCallableWrapper((targetPointer, foreignCallableDescriptorsCallback) => {
7925
+ targetPointer();
7926
+ const target = getSelectedTarget();
7927
+ let unsafeDescMap;
7928
+
7929
+ try {
7930
+ unsafeDescMap = ObjectGetOwnPropertyDescriptors(target);
7931
+ } catch (e) {
7932
+ throw pushErrorAcrossBoundary(e);
7933
+ }
7934
+
7935
+ const keys = ReflectOwnKeys(unsafeDescMap);
7936
+ const {
7937
+ length: keysLen
7938
+ } = keys;
7939
+ const descriptorTuples = new ArrayCtor(keysLen * 7); // prettier-ignore
7940
+
7941
+ for (let i = 0, j = 0, len = keysLen; i < len; i += 1, j += 7) {
7942
+ const key = keys[i];
7943
+ const unsafeDesc = unsafeDescMap[key];
7944
+ const safeDesc = toSafeDescriptor(unsafeDesc);
7945
+ const {
7946
+ configurable,
7947
+ enumerable,
7948
+ writable,
7949
+ value,
7950
+ get,
7951
+ set
7952
+ } = safeDesc;
7953
+ descriptorTuples[j] = key;
7954
+ descriptorTuples[j + 1] = 'configurable' in safeDesc ? configurable : UNDEFINED_SYMBOL;
7955
+ descriptorTuples[j + 2] = 'enumerable' in safeDesc ? enumerable : UNDEFINED_SYMBOL;
7956
+ descriptorTuples[j + 3] = 'writable' in safeDesc ? writable : UNDEFINED_SYMBOL;
7957
+ descriptorTuples[j + 4] = 'value' in safeDesc ? getTransferableValue(value) : UNDEFINED_SYMBOL;
7958
+ descriptorTuples[j + 5] = 'get' in safeDesc ? getTransferableValue(get) : UNDEFINED_SYMBOL;
7959
+ descriptorTuples[j + 6] = 'set' in safeDesc ? getTransferableValue(set) : UNDEFINED_SYMBOL;
7960
+ }
7961
+
7962
+ ReflectApply(foreignCallableDescriptorsCallback, undefined, descriptorTuples);
7963
+ }, 'callableGetOwnPropertyDescriptors', INBOUND_INSTRUMENTATION_LABEL), // callableGetTargetIntegrityTraits
7739
7964
  instrumentCallableWrapper(targetPointer => {
7740
7965
  targetPointer();
7741
7966
  const target = getSelectedTarget();
@@ -7754,7 +7979,7 @@ function createMembraneMarshall() {
7754
7979
  return ReflectApply(StringProtoSlice, toStringValue, [8, -1]);
7755
7980
  } // eslint-disable-next-line no-empty
7756
7981
 
7757
- } catch (_unused6) {}
7982
+ } catch (_unused7) {}
7758
7983
 
7759
7984
  return undefined;
7760
7985
  }, 'callableGetUnbrandedTag', INBOUND_INSTRUMENTATION_LABEL), // callableHasOwnProperty
@@ -7767,7 +7992,28 @@ function createMembraneMarshall() {
7767
7992
  } catch (e) {
7768
7993
  throw pushErrorAcrossBoundary(e);
7769
7994
  }
7770
- }, 'callableHasOwnProperty', INBOUND_INSTRUMENTATION_LABEL));
7995
+ }, 'callableHasOwnProperty', INBOUND_INSTRUMENTATION_LABEL), // callableIsLiveTarget
7996
+ instrumentCallableWrapper(targetPointer => {
7997
+ targetPointer();
7998
+ const target = getSelectedTarget();
7999
+
8000
+ try {
8001
+ return isLiveTarget(target);
8002
+ } catch (e) {
8003
+ throw pushErrorAcrossBoundary(e);
8004
+ }
8005
+ }, 'callableIsLiveTarget', INBOUND_INSTRUMENTATION_LABEL), // callableWarn
8006
+ instrumentCallableWrapper((...args) => {
8007
+ for (let i = 0, len = args.length; i < len; i += 1) {
8008
+ args[i] = getLocalValue(args[i]);
8009
+ }
8010
+
8011
+ try {
8012
+ ReflectApply(consoleWarn, consoleRef, args);
8013
+ } catch (e) {
8014
+ throw pushErrorAcrossBoundary(e);
8015
+ }
8016
+ }, 'callableWarn', INBOUND_INSTRUMENTATION_LABEL));
7771
8017
  return (...hooks) => {
7772
8018
  const {
7773
8019
  // 0: globalThisPointer,
@@ -7788,9 +8034,12 @@ function createMembraneMarshall() {
7788
8034
  15: callablePreventExtensions,
7789
8035
  16: callableSet,
7790
8036
  17: callableSetPrototypeOf,
7791
- 18: callableGetTargetIntegrityTraits,
7792
- 19: callableGetUnbrandedTag,
7793
- 20: callableHasOwnProperty
8037
+ 18: callableGetOwnPropertyDescriptors,
8038
+ 19: callableGetTargetIntegrityTraits,
8039
+ 20: callableGetUnbrandedTag,
8040
+ 21: callableHasOwnProperty,
8041
+ 22: callableIsLiveTarget,
8042
+ 23: callableWarn
7794
8043
  } = hooks;
7795
8044
  foreignCallablePushTarget = callablePushTarget; // traps utilities
7796
8045
 
@@ -7805,9 +8054,12 @@ function createMembraneMarshall() {
7805
8054
  foreignCallablePreventExtensions = foreignErrorControl(instrumentCallableWrapper(callablePreventExtensions, 'callablePreventExtensions', OUTBOUND_INSTRUMENTATION_LABEL));
7806
8055
  foreignCallableSet = foreignErrorControl(instrumentCallableWrapper(callableSet, 'callableSet', OUTBOUND_INSTRUMENTATION_LABEL));
7807
8056
  foreignCallableSetPrototypeOf = foreignErrorControl(instrumentCallableWrapper(callableSetPrototypeOf, 'callableSetPrototypeOf', OUTBOUND_INSTRUMENTATION_LABEL));
8057
+ foreignCallableGetOwnPropertyDescriptors = foreignErrorControl(instrumentCallableWrapper(callableGetOwnPropertyDescriptors, 'callableGetOwnPropertyDescriptors', OUTBOUND_INSTRUMENTATION_LABEL));
7808
8058
  foreignCallableGetTargetIntegrityTraits = foreignErrorControl(instrumentCallableWrapper(callableGetTargetIntegrityTraits, 'callableGetTargetIntegrityTraits', OUTBOUND_INSTRUMENTATION_LABEL));
7809
8059
  foreignCallableGetUnbrandedTag = foreignErrorControl(instrumentCallableWrapper(callableGetUnbrandedTag, 'callableGetUnbrandedTag', OUTBOUND_INSTRUMENTATION_LABEL));
7810
8060
  foreignCallableHasOwnProperty = foreignErrorControl(instrumentCallableWrapper(callableHasOwnProperty, 'callableHasOwnProperty', OUTBOUND_INSTRUMENTATION_LABEL));
8061
+ foreignCallableIsLiveTarget = foreignErrorControl(instrumentCallableWrapper(callableIsLiveTarget, 'callableIsLiveTarget', OUTBOUND_INSTRUMENTATION_LABEL));
8062
+ foreignCallableWarn = foreignErrorControl(instrumentCallableWrapper(callableWarn, 'callableWarn', OUTBOUND_INSTRUMENTATION_LABEL));
7811
8063
  };
7812
8064
  };
7813
8065
  }
@@ -7818,10 +8070,124 @@ const marshallSourceTextInStrictMode = `
7818
8070
  (function(){
7819
8071
  'use strict';
7820
8072
  (${function initializeShadowRealm() {
7821
- if (typeof Error.stackTraceLimit === 'number') {
7822
- // The default stack trace limit is 10.
7823
- // Increasing to 20 as a baby step.
7824
- Error.stackTraceLimit *= 2;
8073
+ // Hook into V8 stack trace API
8074
+ // https://v8.dev/docs/stack-trace-api
8075
+ if (typeof Error.prepareStackTrace !== 'function') {
8076
+ const CallSite = (() => {
8077
+ var _callSites$;
8078
+
8079
+ Error.prepareStackTrace = (_error, callSites) => callSites;
8080
+
8081
+ const callSites = new Error().stack;
8082
+ delete Error.prepareStackTrace;
8083
+ return Array.isArray(callSites) && callSites.length > 0 ? (_callSites$ = callSites[0]) == null ? void 0 : _callSites$.constructor : undefined;
8084
+ })();
8085
+
8086
+ if (typeof CallSite === 'function') {
8087
+ // This package is bundled by third-parties that have their own
8088
+ // build time replacement logic. Instead of customizing each
8089
+ // build system to be aware of this package we perform a small
8090
+ // runtime check to determine whether our code is minified or in
8091
+ // DEBUG_MODE.
8092
+ // https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.debug_mode_enable
8093
+ const DEBUG_MODE = `${() =>
8094
+ /**/
8095
+ 1}`.includes('*');
8096
+ const ZERO_WIDTH_JOINER = '\u200D';
8097
+ const LOCKER_IDENTIFIER_MARKER = `$LWS${ZERO_WIDTH_JOINER}`;
8098
+ const {
8099
+ toString: ErrorProtoToString
8100
+ } = Error.prototype;
8101
+ const {
8102
+ apply: ReflectApply,
8103
+ defineProperty: ReflectDefineProperty
8104
+ } = Reflect;
8105
+ const {
8106
+ endsWith: StringProtoEndsWith,
8107
+ includes: StringProtoIncludes
8108
+ } = String.prototype;
8109
+ const {
8110
+ getEvalOrigin: CallSiteProtoGetEvalOrigin,
8111
+ getFunctionName: CallSiteProtoGetFunctionName,
8112
+ toString: CallSiteProtoToString
8113
+ } = CallSite.prototype;
8114
+
8115
+ const formatStackTrace = function formatStackTrace(error, callSites) {
8116
+ // Based on V8's default stack trace formatting:
8117
+ // https://chromium.googlesource.com/v8/v8.git/+/refs/heads/main/src/execution/messages.cc#371
8118
+ let stackTrace = '';
8119
+
8120
+ try {
8121
+ stackTrace = ReflectApply(ErrorProtoToString, error, []);
8122
+ } catch (_unused8) {
8123
+ stackTrace = '<error>';
8124
+ }
8125
+
8126
+ let consecutive = false;
8127
+
8128
+ for (let i = 0, {
8129
+ length
8130
+ } = callSites; i < length; i += 1) {
8131
+ const callSite = callSites[i];
8132
+ const funcName = ReflectApply(CallSiteProtoGetFunctionName, callSite, []);
8133
+ let isMarked = false;
8134
+
8135
+ if (typeof funcName === 'string' && funcName !== 'eval' && ReflectApply(StringProtoEndsWith, funcName, [LOCKER_IDENTIFIER_MARKER])) {
8136
+ isMarked = true;
8137
+ }
8138
+
8139
+ if (!isMarked) {
8140
+ const evalOrigin = ReflectApply(CallSiteProtoGetEvalOrigin, callSite, []);
8141
+
8142
+ if (typeof evalOrigin === 'string' && ReflectApply(StringProtoIncludes, evalOrigin, [LOCKER_IDENTIFIER_MARKER])) {
8143
+ isMarked = true;
8144
+ }
8145
+ } // Only write a single LWS entry per consecutive LWS stacks.
8146
+
8147
+
8148
+ if (isMarked) {
8149
+ if (!consecutive) {
8150
+ consecutive = true;
8151
+ stackTrace += '\n at LWS';
8152
+ }
8153
+
8154
+ continue;
8155
+ } else {
8156
+ consecutive = false;
8157
+ }
8158
+
8159
+ try {
8160
+ stackTrace += `\n at ${ReflectApply(CallSiteProtoToString, callSite, [])}`; // eslint-disable-next-line no-empty
8161
+ } catch (_unused9) {}
8162
+ }
8163
+
8164
+ return stackTrace;
8165
+ }; // Make Error.prepareStackTrace non-configurable and non-writable.
8166
+
8167
+
8168
+ ReflectDefineProperty(Error, 'prepareStackTrace', {
8169
+ // @ts-ignore: TS doesn't like __proto__ on property descriptors.
8170
+ __proto__: null,
8171
+ enumerable: true,
8172
+ // Error.prepareStackTrace cannot be a bound or proxy wrapped
8173
+ // function, so to obscure its source we wrap the call to
8174
+ // formatStackTrace().
8175
+ value: function prepareStackTrace(error, callSites) {
8176
+ return formatStackTrace(error, callSites);
8177
+ }
8178
+ }); // Make Error.stackTraceLimit configurable and writable in DEBUG_MODE.
8179
+
8180
+ ReflectDefineProperty(Error, 'stackTraceLimit', {
8181
+ // @ts-ignore: TS doesn't like __proto__ on property descriptors.
8182
+ __proto__: null,
8183
+ configurable: DEBUG_MODE,
8184
+ enumerable: true,
8185
+ // The default stack trace limit is 10.
8186
+ // Increasing to 20 for wiggle room of filtered results.
8187
+ value: 20,
8188
+ writable: DEBUG_MODE
8189
+ });
8190
+ }
7825
8191
  }
7826
8192
  }.toString()})();
7827
8193
  return (${createMembraneMarshall.toString()})
@@ -7871,7 +8237,7 @@ function capitalizeFirstChar(string) {
7871
8237
  class VirtualEnvironment {
7872
8238
  constructor(options) {
7873
8239
  if (options === undefined) {
7874
- throw new ErrorCtor(`Missing VirtualEnvironmentOptions options bag.`);
8240
+ throw new ErrorCtor('Missing VirtualEnvironmentOptions options bag.');
7875
8241
  }
7876
8242
 
7877
8243
  const {
@@ -7886,7 +8252,9 @@ class VirtualEnvironment {
7886
8252
  let supportFlags = SupportFlagsEnum.None;
7887
8253
  const supportKeys = support ? ObjectKeys(support) : [];
7888
8254
 
7889
- for (let i = 0, len = supportKeys.length; i < len; i += 1) {
8255
+ for (let i = 0, {
8256
+ length
8257
+ } = supportKeys; i < length; i += 1) {
7890
8258
  const enumKey = capitalizeFirstChar(supportKeys[i]);
7891
8259
  supportFlags |= SupportFlagsEnum[enumKey];
7892
8260
  }
@@ -7953,14 +8321,14 @@ class VirtualEnvironment {
7953
8321
 
7954
8322
  evaluate(sourceText) {
7955
8323
  try {
7956
- const pointerOrPrimitiveValue = this.redCallableEvaluate(sourceText);
8324
+ const bluePointerOrPrimitiveValue = this.redCallableEvaluate(sourceText);
7957
8325
 
7958
- if (typeof pointerOrPrimitiveValue === 'function') {
7959
- pointerOrPrimitiveValue();
8326
+ if (typeof bluePointerOrPrimitiveValue === 'function') {
8327
+ bluePointerOrPrimitiveValue();
7960
8328
  return this.blueGetSelectedTarget();
7961
8329
  }
7962
8330
 
7963
- return pointerOrPrimitiveValue;
8331
+ return bluePointerOrPrimitiveValue;
7964
8332
  } catch (e) {
7965
8333
  const pushedError = this.blueGetSelectedTarget();
7966
8334
 
@@ -7976,7 +8344,9 @@ class VirtualEnvironment {
7976
8344
  let bluePointer = this.blueGlobalThisPointer;
7977
8345
  let redPointer = this.redGlobalThisPointer;
7978
8346
 
7979
- for (let i = 0, len = keys.length; i < len; i += 1) {
8347
+ for (let i = 0, {
8348
+ length
8349
+ } = keys; i < length; i += 1) {
7980
8350
  const key = keys[i];
7981
8351
  bluePointer = this.blueCallableGetPropertyValuePointer(bluePointer, key);
7982
8352
  redPointer = this.redCallableGetPropertyValuePointer(redPointer, key);
@@ -7986,27 +8356,31 @@ class VirtualEnvironment {
7986
8356
  this.blueCallableLinkPointers(bluePointer, redPointer);
7987
8357
  }
7988
8358
 
7989
- remap(target, blueDescriptors) {
7990
- const keys = ReflectOwnKeys$1(blueDescriptors);
8359
+ remap(target, unsafeBlueDescMap) {
8360
+ const ownKeys = ReflectOwnKeys$1(unsafeBlueDescMap);
7991
8361
  const targetPointer = this.blueGetTransferableValue(target); // prettier-ignore
7992
8362
 
7993
- for (let i = 0, len = keys.length; i < len; i += 1) {
7994
- const key = keys[i];
7995
- const unsafeBlueDesc = blueDescriptors[key]; // Avoid poisoning by only installing own properties from blueDescriptors
8363
+ for (let i = 0, {
8364
+ length
8365
+ } = ownKeys; i < length; i += 1) {
8366
+ const ownKey = ownKeys[i];
8367
+ const unsafeBlueDesc = unsafeBlueDescMap[ownKey]; // Avoid poisoning by only installing own properties from unsafeBlueDescMap.
8368
+ // We don't use a toSafeDescriptor() style helper since that mutates
8369
+ // the unsafeBlueDesc.
7996
8370
  // eslint-disable-next-line prefer-object-spread
7997
8371
 
7998
8372
  const safeBlueDesc = ObjectAssign$2({
7999
8373
  __proto__: null
8000
8374
  }, unsafeBlueDesc); // Install descriptor into the red side.
8001
8375
 
8002
- this.redCallableDefineProperty(targetPointer, key, 'configurable' in safeBlueDesc ? !!safeBlueDesc.configurable : UNDEFINED_SYMBOL, 'enumerable' in safeBlueDesc ? !!safeBlueDesc.enumerable : UNDEFINED_SYMBOL, 'writable' in safeBlueDesc ? !!safeBlueDesc.writable : UNDEFINED_SYMBOL, 'value' in safeBlueDesc ? this.blueGetTransferableValue(safeBlueDesc.value) : UNDEFINED_SYMBOL, 'get' in safeBlueDesc ? this.blueGetTransferableValue(safeBlueDesc.get) : UNDEFINED_SYMBOL, 'set' in safeBlueDesc ? this.blueGetTransferableValue(safeBlueDesc.set) : UNDEFINED_SYMBOL);
8376
+ this.redCallableDefineProperty(targetPointer, ownKey, 'configurable' in safeBlueDesc ? !!safeBlueDesc.configurable : UNDEFINED_SYMBOL, 'enumerable' in safeBlueDesc ? !!safeBlueDesc.enumerable : UNDEFINED_SYMBOL, 'writable' in safeBlueDesc ? !!safeBlueDesc.writable : UNDEFINED_SYMBOL, 'value' in safeBlueDesc ? this.blueGetTransferableValue(safeBlueDesc.value) : UNDEFINED_SYMBOL, 'get' in safeBlueDesc ? this.blueGetTransferableValue(safeBlueDesc.get) : UNDEFINED_SYMBOL, 'set' in safeBlueDesc ? this.blueGetTransferableValue(safeBlueDesc.set) : UNDEFINED_SYMBOL);
8003
8377
  }
8004
8378
  }
8005
8379
 
8006
8380
  remapProto(target, proto) {
8007
- const targetPointer = this.blueGetTransferableValue(target);
8008
- const pointerOrNull = this.blueGetTransferableValue(proto);
8009
- this.redCallableSetPrototypeOf(targetPointer, pointerOrNull);
8381
+ const foreignTargetPointer = this.blueGetTransferableValue(target);
8382
+ const transferableProto = proto ? this.blueGetTransferableValue(proto) : proto;
8383
+ this.redCallableSetPrototypeOf(foreignTargetPointer, transferableProto);
8010
8384
  }
8011
8385
 
8012
8386
  }
@@ -8014,9 +8388,6 @@ class VirtualEnvironment {
8014
8388
  const {
8015
8389
  includes: ArrayProtoIncludes
8016
8390
  } = Array.prototype;
8017
- const {
8018
- has: SetProtoHas
8019
- } = Set.prototype;
8020
8391
  const {
8021
8392
  apply: ReflectApply$2,
8022
8393
  getOwnPropertyDescriptor: ReflectGetOwnPropertyDescriptor,
@@ -8042,40 +8413,69 @@ const {
8042
8413
  * can be considered equivalents (without identity discontinuity).
8043
8414
  */
8044
8415
 
8045
- const ESGlobalKeys = new Set([// *** 19.1 Value Properties of the Global Object
8416
+ const ESGlobalKeys = [// *** 19.1 Value Properties of the Global Object
8046
8417
  'globalThis', 'Infinity', 'NaN', 'undefined', // *** 19.2 Function Properties of the Global Object
8047
- 'eval', 'isFinite', 'isNaN', 'parseFloat', 'parseInt', 'decodeURI', 'decodeURIComponent', 'encodeURI', 'encodeURIComponent', // *** 19.3 Constructor Properties of the Global Object
8048
- 'AggregateError', 'Array', 'ArrayBuffer', 'BigInt', 'BigInt64Array', 'BigUint64Array', 'Boolean', 'DataView', // 'Date', // Unstable & Remapped
8049
- 'Error', 'EvalError', 'FinalizationRegistry', 'Float32Array', 'Float64Array', 'Function', 'Int8Array', 'Int16Array', 'Int32Array', // 'Map', // Remapped
8050
- 'Number', 'Object', // Allow Blue `Promise` constructor to overwrite the Red one so that promises
8418
+ // 'eval', // dangerous & Reflective
8419
+ 'isFinite', 'isNaN', 'parseFloat', 'parseInt', 'decodeURI', 'decodeURIComponent', 'encodeURI', 'encodeURIComponent', // *** 19.3 Constructor Properties of the Global Object
8420
+ // 'AggregateError', // Reflective
8421
+ // 'Array', // Reflective
8422
+ // 'ArrayBuffer', // Remapped
8423
+ 'BigInt', // 'BigInt64Array', // Remapped
8424
+ // 'BigUint64Array', // Remapped
8425
+ 'Boolean', // 'DataView', // Remapped
8426
+ // 'Date', // Remapped
8427
+ // 'Error', // Reflective
8428
+ // 'EvalError', // Reflective
8429
+ 'FinalizationRegistry', // 'Float32Array', // Remapped
8430
+ // 'Float64Array', // Remapped
8431
+ // 'Function', // dangerous & Reflective
8432
+ // 'Int8Array', // Remapped
8433
+ // 'Int16Array', // Remapped
8434
+ // 'Int32Array', // Remapped
8435
+ // 'Map', // Remapped
8436
+ 'Number', // 'Object', // Reflective
8437
+ // Allow Blue `Promise` constructor to overwrite the Red one so that promises
8051
8438
  // created by the `Promise` constructor or APIs like `fetch` will work.
8052
8439
  // 'Promise', // Remapped
8053
- 'Proxy', 'RangeError', 'ReferenceError', 'RegExp', // 'Set', // Remapped
8054
- 'SharedArrayBuffer', 'String', 'Symbol', 'SyntaxError', 'TypeError', 'Uint8Array', 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'URIError', // 'WeakMap', // Remapped
8440
+ // 'Proxy', // Reflective
8441
+ // 'RangeError', // Reflective
8442
+ // 'ReferenceError', // Reflective
8443
+ 'RegExp', // 'Set', // Remapped
8444
+ // 'SharedArrayBuffer', // Remapped
8445
+ 'String', 'Symbol', // 'SyntaxError', // Reflective
8446
+ // 'TypeError', // Reflective
8447
+ // 'Uint8Array', // Remapped
8448
+ // 'Uint8ClampedArray', // Remapped
8449
+ // 'Uint16Array', // Remapped
8450
+ // 'Uint32Array', // Remapped
8451
+ // 'URIError', // Reflective
8452
+ // 'WeakMap', // Remapped
8055
8453
  // 'WeakSet', // Remapped
8056
8454
  'WeakRef', // *** 18.4 Other Properties of the Global Object
8057
- 'Atomics', 'JSON', 'Math', 'Reflect', // *** Annex B
8455
+ // 'Atomics', // Remapped
8456
+ 'JSON', 'Math', 'Reflect', // *** Annex B
8058
8457
  'escape', 'unescape' // *** ECMA-402
8059
- // 'Intl', // Unstable & Remapped
8060
- ]); // These are foundational things that should never be wrapped but are equivalent
8458
+ // 'Intl', // Remapped
8459
+ ]; // These are foundational things that should never be wrapped but are equivalent
8061
8460
  // TODO: revisit this list.
8062
8461
 
8063
8462
  const ReflectiveIntrinsicObjectNames = ['AggregateError', 'Array', 'Error', 'EvalError', 'Function', 'Object', 'Proxy', 'RangeError', 'ReferenceError', 'SyntaxError', 'TypeError', 'URIError', 'eval'];
8463
+ const ESGlobalsAndReflectiveIntrinsicObjectNames = [...ESGlobalKeys, ...ReflectiveIntrinsicObjectNames];
8064
8464
 
8065
8465
  function assignFilteredGlobalObjectShapeDescriptors(descriptorMap, source) {
8066
- const keys = ReflectOwnKeys(source);
8466
+ const ownKeys = ReflectOwnKeys(source);
8067
8467
 
8068
- for (let i = 0, len = keys.length; i < len; i += 1) {
8069
- // forcing to string here because of TypeScript's PropertyDescriptorMap
8070
- // definition, which doesn't support symbols as entries.
8071
- const key = keys[i]; // avoid overriding ECMAScript global names that correspond
8468
+ for (let i = 0, {
8469
+ length
8470
+ } = ownKeys; i < length; i += 1) {
8471
+ const ownKey = ownKeys[i]; // Avoid overriding ECMAScript global names that correspond
8072
8472
  // to global intrinsics. This guarantee that those entries
8073
8473
  // will be ignored if present in the endowments object.
8074
8474
  // TODO: what if the intent is to polyfill one of those
8075
8475
  // intrinsics?
8076
8476
 
8077
- if (!ReflectApply$2(SetProtoHas, ESGlobalKeys, [key]) && !ReflectApply$2(ArrayProtoIncludes, ReflectiveIntrinsicObjectNames, [key])) {
8078
- const unsafeDesc = ReflectGetOwnPropertyDescriptor(source, key); // Safari 14.0.x (macOS) and 14.2 (iOS) have a bug where 'showModalDialog'
8477
+ if (!ReflectApply$2(ArrayProtoIncludes, ESGlobalsAndReflectiveIntrinsicObjectNames, [ownKey])) {
8478
+ const unsafeDesc = ReflectGetOwnPropertyDescriptor(source, ownKey); // Safari 14.0.x (macOS) and 14.2 (iOS) have a bug where 'showModalDialog'
8079
8479
  // is returned in the list of own keys produces by ReflectOwnKeys(iframeWindow),
8080
8480
  // however 'showModalDialog' is not an own property and produces
8081
8481
  // undefined at ReflectGetOwnPropertyDescriptor(window, key);
@@ -8087,7 +8487,7 @@ function assignFilteredGlobalObjectShapeDescriptors(descriptorMap, source) {
8087
8487
  // ignore the entry and continue.
8088
8488
 
8089
8489
  if (unsafeDesc) {
8090
- descriptorMap[key] = unsafeDesc;
8490
+ descriptorMap[ownKey] = unsafeDesc;
8091
8491
  }
8092
8492
  }
8093
8493
  }
@@ -8095,9 +8495,27 @@ function assignFilteredGlobalObjectShapeDescriptors(descriptorMap, source) {
8095
8495
  return descriptorMap;
8096
8496
  }
8097
8497
 
8498
+ function getResolvedShapeDescriptors(...sources) {
8499
+ const unsafeDescMap = {};
8500
+
8501
+ for (let i = 0, {
8502
+ length
8503
+ } = sources; i < length; i += 1) {
8504
+ const source = sources[i];
8505
+
8506
+ if (source) {
8507
+ assignFilteredGlobalObjectShapeDescriptors(unsafeDescMap, source);
8508
+ }
8509
+ }
8510
+
8511
+ return unsafeDescMap;
8512
+ }
8513
+
8098
8514
  function linkIntrinsics(env, globalObjectVirtualizationTarget) {
8099
- // remapping intrinsics that are realm's agnostic
8100
- for (let i = 0, len = ReflectiveIntrinsicObjectNames.length; i < len; i += 1) {
8515
+ // remapping intrinsics that are realm agnostic
8516
+ for (let i = 0, {
8517
+ length
8518
+ } = ReflectiveIntrinsicObjectNames; i < length; i += 1) {
8101
8519
  const globalName = ReflectiveIntrinsicObjectNames[i];
8102
8520
  const reflectiveValue = globalObjectVirtualizationTarget[globalName];
8103
8521
 
@@ -8111,20 +8529,6 @@ function linkIntrinsics(env, globalObjectVirtualizationTarget) {
8111
8529
  }
8112
8530
  }
8113
8531
 
8114
- function getResolvedShapeDescriptors(...sources) {
8115
- const descriptors = {};
8116
-
8117
- for (let i = 0, len = sources.length; i < len; i += 1) {
8118
- const source = sources[i];
8119
-
8120
- if (source) {
8121
- assignFilteredGlobalObjectShapeDescriptors(descriptors, source);
8122
- }
8123
- }
8124
-
8125
- return descriptors;
8126
- }
8127
-
8128
8532
  const TypeErrorCtor = TypeError;
8129
8533
 
8130
8534
  function validateRequiredGlobalShapeAndVirtualizationObjects(globalObjectShape, globalObjectVirtualizationTarget) {
@@ -8221,22 +8625,16 @@ getCachedBlueReferences(window);
8221
8625
  */
8222
8626
 
8223
8627
  function filterWindowDescriptors(endowmentsDescriptors) {
8224
- const to = {}; // endowments descriptors will overrule any default descriptor inferred
8628
+ const to = {}; // Endowments descriptors will overrule any default descriptor inferred
8225
8629
  // from the detached iframe. note that they are already filtered, not need
8226
8630
  // to check against intrinsics again.
8227
8631
 
8228
- ObjectAssign$1(to, endowmentsDescriptors); // removing unforgeable descriptors that cannot be installed
8632
+ ObjectAssign$1(to, endowmentsDescriptors); // Removing unforgeable descriptors that cannot be installed
8229
8633
 
8230
8634
  delete to.document;
8231
8635
  delete to.location;
8232
8636
  delete to.top;
8233
- delete to.window; // Some DOM APIs do brand checks for TypeArrays and others objects,
8234
- // in this case, if the API is not dangerous, and works in a detached
8235
- // iframe, we can let the sandbox to use the iframe's api directly,
8236
- // instead of remapping it to the blue realm.
8237
- // TODO [issue #67]: review this list
8238
-
8239
- delete to.crypto; // others browser specific undeniable globals
8637
+ delete to.window; // Other browser specific undeniable globals
8240
8638
 
8241
8639
  delete to.chrome;
8242
8640
  return to;
@@ -8288,7 +8686,6 @@ function linkUnforgeables(env, blueGlobalThis) {
8288
8686
  }
8289
8687
 
8290
8688
  const IFRAME_SANDBOX_ATTRIBUTE_VALUE = 'allow-same-origin allow-scripts';
8291
- const emptyArray = [];
8292
8689
  const {
8293
8690
  close: DocumentProtoClose,
8294
8691
  createElement: DocumentProtoCreateElement,
@@ -8303,42 +8700,26 @@ const {
8303
8700
  } = Node.prototype;
8304
8701
  const {
8305
8702
  assign: ObjectAssign
8306
- } = Object;
8703
+ } = Object; // eslint-disable-next-line @typescript-eslint/naming-convention
8704
+
8307
8705
  const {
8308
- // eslint-disable-next-line @typescript-eslint/naming-convention
8309
- __lookupGetter__: ObjectProto__lookupGetter__,
8310
- hasOwnProperty: ObjectProtoHasOwnProperty
8706
+ __lookupGetter__: ObjectProto__lookupGetter__
8311
8707
  } = Object.prototype;
8312
8708
  const {
8313
8709
  apply: ReflectApply
8314
8710
  } = Reflect;
8315
-
8316
- function ObjectLookupOwnGetter(obj, key) {
8317
- // Since this function is only used internally, and would not otherwise be
8318
- // reachable by user code, istanbul can ignore test coverage for the
8319
- // following condition.
8320
- // istanbul ignore next
8321
- // eslint-disable-next-line @typescript-eslint/no-use-before-define
8322
- if (obj === null || obj === undefined || !ReflectApply(ObjectProtoHasOwnProperty, obj, [key])) {
8323
- return undefined;
8324
- } // eslint-disable-next-line @typescript-eslint/no-use-before-define
8325
-
8326
-
8327
- return ReflectApply(ObjectProto__lookupGetter__, obj, [key]);
8328
- }
8329
-
8330
- const DocumentProtoBodyGetter = ObjectLookupOwnGetter(Document.prototype, 'body');
8331
- const HTMLElementProtoStyleGetter = ObjectLookupOwnGetter(HTMLElement.prototype, 'style');
8332
- const HTMLIFrameElementProtoContentWindowGetter = ObjectLookupOwnGetter(HTMLIFrameElement.prototype, 'contentWindow');
8333
- const NodeProtoIsConnectedGetter = ObjectLookupOwnGetter(Node.prototype, 'isConnected');
8334
- const NodeProtoLastChildGetter = ObjectLookupOwnGetter(Node.prototype, 'lastChild');
8711
+ const DocumentProtoBodyGetter = ReflectApply(ObjectProto__lookupGetter__, Document.prototype, ['body']);
8712
+ const HTMLElementProtoStyleGetter = ReflectApply(ObjectProto__lookupGetter__, HTMLElement.prototype, ['style']);
8713
+ const HTMLIFrameElementProtoContentWindowGetter = ReflectApply(ObjectProto__lookupGetter__, HTMLIFrameElement.prototype, ['contentWindow']);
8714
+ const NodeProtoIsConnectedGetter = ReflectApply(ObjectProto__lookupGetter__, Node.prototype, ['isConnected']);
8715
+ const NodeProtoLastChildGetter = ReflectApply(ObjectProto__lookupGetter__, Node.prototype, ['lastChild']);
8335
8716
 
8336
8717
  function DocumentBody(doc) {
8337
- return ReflectApply(DocumentProtoBodyGetter, doc, emptyArray);
8718
+ return ReflectApply(DocumentProtoBodyGetter, doc, []);
8338
8719
  }
8339
8720
 
8340
8721
  function DocumentClose(doc) {
8341
- return ReflectApply(DocumentProtoClose, doc, emptyArray);
8722
+ return ReflectApply(DocumentProtoClose, doc, []);
8342
8723
  }
8343
8724
 
8344
8725
  function DocumentCreateElement(doc, tagName) {
@@ -8346,7 +8727,7 @@ function DocumentCreateElement(doc, tagName) {
8346
8727
  }
8347
8728
 
8348
8729
  function DocumentOpen(doc) {
8349
- return ReflectApply(DocumentProtoOpen, doc, emptyArray);
8730
+ return ReflectApply(DocumentProtoOpen, doc, []);
8350
8731
  }
8351
8732
 
8352
8733
  function ElementSetAttribute(el, name, value) {
@@ -8354,15 +8735,15 @@ function ElementSetAttribute(el, name, value) {
8354
8735
  }
8355
8736
 
8356
8737
  function ElementRemove(element) {
8357
- return ReflectApply(ElementProtoRemove, element, emptyArray);
8738
+ return ReflectApply(ElementProtoRemove, element, []);
8358
8739
  }
8359
8740
 
8360
8741
  function HTMLElementStyleGetter(el) {
8361
- return ReflectApply(HTMLElementProtoStyleGetter, el, emptyArray);
8742
+ return ReflectApply(HTMLElementProtoStyleGetter, el, []);
8362
8743
  }
8363
8744
 
8364
8745
  function HTMLIFrameElementContentWindowGetter(iframe) {
8365
- return ReflectApply(HTMLIFrameElementProtoContentWindowGetter, iframe, emptyArray);
8746
+ return ReflectApply(HTMLIFrameElementProtoContentWindowGetter, iframe, []);
8366
8747
  }
8367
8748
 
8368
8749
  function NodeAppendChild(parent, child) {
@@ -8375,11 +8756,11 @@ function NodeAppendChild(parent, child) {
8375
8756
 
8376
8757
 
8377
8758
  function NodeLastChild(node) {
8378
- return ReflectApply(NodeProtoLastChildGetter, node, emptyArray);
8759
+ return ReflectApply(NodeProtoLastChildGetter, node, []);
8379
8760
  }
8380
8761
 
8381
8762
  function NodeIsConnected(node) {
8382
- return ReflectApply(NodeProtoIsConnectedGetter, node, emptyArray);
8763
+ return ReflectApply(NodeProtoIsConnectedGetter, node, []);
8383
8764
  }
8384
8765
 
8385
8766
  function createDetachableIframe$1() {
@@ -9033,6 +9414,6 @@ function evaluateInCoreSandbox(_key, source, context, endowments, instrumentatio
9033
9414
  activityEvaluateInCoreSandbox.stop();
9034
9415
  return result;
9035
9416
  }
9036
- /*! version: 0.14.26 */
9417
+ /*! version: 0.14.28 */
9037
9418
 
9038
9419
  export { CORE_SANDBOX_KEY, evaluateInCoreSandbox, evaluateInSandbox };