lwc 2.6.2 → 2.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/engine-dom/esm/es2017/engine-dom.js +1114 -1054
  2. package/dist/engine-dom/iife/es2017/engine-dom.js +1114 -1054
  3. package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -9
  4. package/dist/engine-dom/iife/es2017/engine-dom_debug.js +1084 -1018
  5. package/dist/engine-dom/iife/es5/engine-dom.js +1166 -999
  6. package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -9
  7. package/dist/engine-dom/iife/es5/engine-dom_debug.js +1181 -1014
  8. package/dist/engine-dom/umd/es2017/engine-dom.js +1114 -1054
  9. package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -9
  10. package/dist/engine-dom/umd/es2017/engine-dom_debug.js +1084 -1018
  11. package/dist/engine-dom/umd/es5/engine-dom.js +1166 -999
  12. package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -9
  13. package/dist/engine-dom/umd/es5/engine-dom_debug.js +1181 -1014
  14. package/dist/engine-server/commonjs/es2017/engine-server.js +1286 -1227
  15. package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -9
  16. package/dist/engine-server/esm/es2017/engine-server.js +1286 -1227
  17. package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +74 -9
  18. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +74 -9
  19. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +2 -2
  20. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +74 -9
  21. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +78 -9
  22. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +2 -2
  23. package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +78 -9
  24. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +74 -9
  25. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +2 -2
  26. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +74 -9
  27. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +78 -9
  28. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +2 -2
  29. package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +78 -9
  30. package/dist/wire-service/esm/es2017/wire-service.js +2 -2
  31. package/dist/wire-service/iife/es2017/wire-service.js +2 -2
  32. package/dist/wire-service/iife/es2017/wire-service_debug.js +2 -2
  33. package/dist/wire-service/iife/es5/wire-service.js +3 -3
  34. package/dist/wire-service/iife/es5/wire-service.min.js +1 -1
  35. package/dist/wire-service/iife/es5/wire-service_debug.js +3 -3
  36. package/dist/wire-service/umd/es2017/wire-service.js +2 -2
  37. package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
  38. package/dist/wire-service/umd/es5/wire-service.js +3 -3
  39. package/dist/wire-service/umd/es5/wire-service.min.js +1 -1
  40. package/dist/wire-service/umd/es5/wire-service_debug.js +3 -3
  41. package/package.json +8 -8
@@ -299,7 +299,7 @@ function htmlPropertyToAttribute(propName) {
299
299
  CACHED_PROPERTY_ATTRIBUTE_MAPPING.set(propName, attributeName);
300
300
  return attributeName;
301
301
  }
302
- /** version: 2.6.2 */
302
+ /** version: 2.7.3 */
303
303
 
304
304
  /*
305
305
  * Copyright (c) 2018, salesforce.com, inc.
@@ -413,7 +413,6 @@ const features = {
413
413
  ENABLE_NODE_LIST_PATCH: null,
414
414
  ENABLE_HTML_COLLECTIONS_PATCH: null,
415
415
  ENABLE_NODE_PATCH: null,
416
- ENABLE_MIXED_SHADOW_MODE: null,
417
416
  ENABLE_WIRE_SYNC_EMIT: null
418
417
  };
419
418
 
@@ -478,7 +477,7 @@ function setFeatureFlagForTest(name, value) {
478
477
  setFeatureFlag(name, value);
479
478
  }
480
479
  }
481
- /** version: 2.6.2 */
480
+ /** version: 2.7.3 */
482
481
 
483
482
  /* proxy-compat-disable */
484
483
 
@@ -552,6 +551,249 @@ function parseStyleText(cssText) {
552
551
  }
553
552
 
554
553
  return styleMap;
554
+ } //
555
+ // Primitives
556
+ //
557
+
558
+
559
+ let ssr$1;
560
+
561
+ function setSsr(ssrImpl) {
562
+ ssr$1 = ssrImpl;
563
+ }
564
+
565
+ let isNativeShadowDefined$1;
566
+
567
+ function setIsNativeShadowDefined(isNativeShadowDefinedImpl) {
568
+ isNativeShadowDefined$1 = isNativeShadowDefinedImpl;
569
+ }
570
+
571
+ let isSyntheticShadowDefined$1;
572
+
573
+ function setIsSyntheticShadowDefined(isSyntheticShadowDefinedImpl) {
574
+ isSyntheticShadowDefined$1 = isSyntheticShadowDefinedImpl;
575
+ }
576
+
577
+ let HTMLElementExported$1;
578
+
579
+ function setHTMLElement(HTMLElementImpl) {
580
+ HTMLElementExported$1 = HTMLElementImpl;
581
+ }
582
+
583
+ let isHydrating$1;
584
+
585
+ function setIsHydrating$1(isHydratingImpl) {
586
+ isHydrating$1 = isHydratingImpl;
587
+ }
588
+
589
+ let insert$1;
590
+
591
+ function setInsert(insertImpl) {
592
+ insert$1 = insertImpl;
593
+ }
594
+
595
+ let remove$1;
596
+
597
+ function setRemove(removeImpl) {
598
+ remove$1 = removeImpl;
599
+ }
600
+
601
+ let createElement$2;
602
+
603
+ function setCreateElement(createElementImpl) {
604
+ createElement$2 = createElementImpl;
605
+ }
606
+
607
+ let createText$1;
608
+
609
+ function setCreateText(createTextImpl) {
610
+ createText$1 = createTextImpl;
611
+ }
612
+
613
+ let createComment$1;
614
+
615
+ function setCreateComment(createCommentImpl) {
616
+ createComment$1 = createCommentImpl;
617
+ }
618
+
619
+ let nextSibling$1;
620
+
621
+ function setNextSibling(nextSiblingImpl) {
622
+ nextSibling$1 = nextSiblingImpl;
623
+ }
624
+
625
+ let attachShadow$1;
626
+
627
+ function setAttachShadow(attachShadowImpl) {
628
+ attachShadow$1 = attachShadowImpl;
629
+ }
630
+
631
+ let getProperty$1;
632
+
633
+ function setGetProperty(getPropertyImpl) {
634
+ getProperty$1 = getPropertyImpl;
635
+ }
636
+
637
+ let setProperty$1;
638
+
639
+ function setSetProperty(setPropertyImpl) {
640
+ setProperty$1 = setPropertyImpl;
641
+ }
642
+
643
+ let setText$1;
644
+
645
+ function setSetText(setTextImpl) {
646
+ setText$1 = setTextImpl;
647
+ }
648
+
649
+ let getAttribute$1;
650
+
651
+ function setGetAttribute(getAttributeImpl) {
652
+ getAttribute$1 = getAttributeImpl;
653
+ }
654
+
655
+ let setAttribute$1;
656
+
657
+ function setSetAttribute(setAttributeImpl) {
658
+ setAttribute$1 = setAttributeImpl;
659
+ }
660
+
661
+ let removeAttribute$1;
662
+
663
+ function setRemoveAttribute(removeAttributeImpl) {
664
+ removeAttribute$1 = removeAttributeImpl;
665
+ }
666
+
667
+ let addEventListener$1;
668
+
669
+ function setAddEventListener(addEventListenerImpl) {
670
+ addEventListener$1 = addEventListenerImpl;
671
+ }
672
+
673
+ let removeEventListener$1;
674
+
675
+ function setRemoveEventListener(removeEventListenerImpl) {
676
+ removeEventListener$1 = removeEventListenerImpl;
677
+ }
678
+
679
+ let dispatchEvent$1;
680
+
681
+ function setDispatchEvent(dispatchEventImpl) {
682
+ dispatchEvent$1 = dispatchEventImpl;
683
+ }
684
+
685
+ let getClassList$1;
686
+
687
+ function setGetClassList(getClassListImpl) {
688
+ getClassList$1 = getClassListImpl;
689
+ }
690
+
691
+ let setCSSStyleProperty$1;
692
+
693
+ function setSetCSSStyleProperty(setCSSStylePropertyImpl) {
694
+ setCSSStyleProperty$1 = setCSSStylePropertyImpl;
695
+ }
696
+
697
+ let getBoundingClientRect$1;
698
+
699
+ function setGetBoundingClientRect(getBoundingClientRectImpl) {
700
+ getBoundingClientRect$1 = getBoundingClientRectImpl;
701
+ }
702
+
703
+ let querySelector$1;
704
+
705
+ function setQuerySelector(querySelectorImpl) {
706
+ querySelector$1 = querySelectorImpl;
707
+ }
708
+
709
+ let querySelectorAll$1;
710
+
711
+ function setQuerySelectorAll(querySelectorAllImpl) {
712
+ querySelectorAll$1 = querySelectorAllImpl;
713
+ }
714
+
715
+ let getElementsByTagName$1;
716
+
717
+ function setGetElementsByTagName(getElementsByTagNameImpl) {
718
+ getElementsByTagName$1 = getElementsByTagNameImpl;
719
+ }
720
+
721
+ let getElementsByClassName$1;
722
+
723
+ function setGetElementsByClassName(getElementsByClassNameImpl) {
724
+ getElementsByClassName$1 = getElementsByClassNameImpl;
725
+ }
726
+
727
+ let getChildren$1;
728
+
729
+ function setGetChildren(getChildrenImpl) {
730
+ getChildren$1 = getChildrenImpl;
731
+ }
732
+
733
+ let getChildNodes$1;
734
+
735
+ function setGetChildNodes(getChildNodesImpl) {
736
+ getChildNodes$1 = getChildNodesImpl;
737
+ }
738
+
739
+ let getFirstChild$1;
740
+
741
+ function setGetFirstChild(getFirstChildImpl) {
742
+ getFirstChild$1 = getFirstChildImpl;
743
+ }
744
+
745
+ let getFirstElementChild$1;
746
+
747
+ function setGetFirstElementChild(getFirstElementChildImpl) {
748
+ getFirstElementChild$1 = getFirstElementChildImpl;
749
+ }
750
+
751
+ let getLastChild$1;
752
+
753
+ function setGetLastChild(getLastChildImpl) {
754
+ getLastChild$1 = getLastChildImpl;
755
+ }
756
+
757
+ let getLastElementChild$1;
758
+
759
+ function setGetLastElementChild(getLastElementChildImpl) {
760
+ getLastElementChild$1 = getLastElementChildImpl;
761
+ }
762
+
763
+ let isConnected$1;
764
+
765
+ function setIsConnected(isConnectedImpl) {
766
+ isConnected$1 = isConnectedImpl;
767
+ }
768
+
769
+ let insertGlobalStylesheet$1;
770
+
771
+ function setInsertGlobalStylesheet(insertGlobalStylesheetImpl) {
772
+ insertGlobalStylesheet$1 = insertGlobalStylesheetImpl;
773
+ }
774
+
775
+ let insertStylesheet$1;
776
+
777
+ function setInsertStylesheet(insertStylesheetImpl) {
778
+ insertStylesheet$1 = insertStylesheetImpl;
779
+ }
780
+
781
+ let assertInstanceOfHTMLElement$1;
782
+
783
+ function setAssertInstanceOfHTMLElement(assertInstanceOfHTMLElementImpl) {
784
+ assertInstanceOfHTMLElement$1 = assertInstanceOfHTMLElementImpl;
785
+ }
786
+
787
+ let defineCustomElement$1;
788
+
789
+ function setDefineCustomElement(defineCustomElementImpl) {
790
+ defineCustomElement$1 = defineCustomElementImpl;
791
+ }
792
+
793
+ let getCustomElement$1;
794
+
795
+ function setGetCustomElement(getCustomElementImpl) {
796
+ getCustomElement$1 = getCustomElementImpl;
555
797
  }
556
798
  /*
557
799
  * Copyright (c) 2019, salesforce.com, inc.
@@ -674,619 +916,93 @@ class ReactiveObserver {
674
916
 
675
917
  }
676
918
  /*
677
- * Copyright (c) 2018, salesforce.com, inc.
678
- * All rights reserved.
679
- * SPDX-License-Identifier: MIT
680
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
681
- */
682
-
683
-
684
- function componentValueMutated(vm, key) {
685
- valueMutated(vm.component, key);
686
- }
687
-
688
- function componentValueObserved(vm, key) {
689
- valueObserved(vm.component, key);
690
- }
691
- /*
692
- * Copyright (c) 2018, salesforce.com, inc.
693
- * All rights reserved.
694
- * SPDX-License-Identifier: MIT
695
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
696
- */
697
-
698
-
699
- function getComponentTag(vm) {
700
- return `<${StringToLowerCase.call(vm.tagName)}>`;
701
- } // TODO [#1695]: Unify getComponentStack and getErrorComponentStack
702
-
703
-
704
- function getComponentStack(vm) {
705
- const stack = [];
706
- let prefix = '';
707
-
708
- while (!isNull(vm.owner)) {
709
- ArrayPush$1.call(stack, prefix + getComponentTag(vm));
710
- vm = vm.owner;
711
- prefix += '\t';
712
- }
713
-
714
- return ArrayJoin.call(stack, '\n');
715
- }
716
-
717
- function getErrorComponentStack(vm) {
718
- const wcStack = [];
719
- let currentVm = vm;
720
-
721
- while (!isNull(currentVm)) {
722
- ArrayPush$1.call(wcStack, getComponentTag(currentVm));
723
- currentVm = currentVm.owner;
724
- }
725
-
726
- return wcStack.reverse().join('\n\t');
727
- }
728
- /*
729
- * Copyright (c) 2018, salesforce.com, inc.
730
- * All rights reserved.
731
- * SPDX-License-Identifier: MIT
732
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
733
- */
734
-
735
-
736
- function log(method, message, vm) {
737
- let msg = `[LWC ${method}]: ${message}`;
738
-
739
- if (!isUndefined$1(vm)) {
740
- msg = `${msg}\n${getComponentStack(vm)}`;
741
- }
742
-
743
- if (process.env.NODE_ENV === 'test') {
744
- /* eslint-disable-next-line no-console */
745
- console[method](msg);
746
- return;
747
- }
748
-
749
- try {
750
- throw new Error(msg);
751
- } catch (e) {
752
- /* eslint-disable-next-line no-console */
753
- console[method](e);
754
- }
755
- }
756
-
757
- function logError(message, vm) {
758
- log('error', message, vm);
759
- }
760
-
761
- function logWarn(message, vm) {
762
- log('warn', message, vm);
763
- }
764
- /*
765
- * Copyright (c) 2018, salesforce.com, inc.
766
- * All rights reserved.
767
- * SPDX-License-Identifier: MIT
768
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
769
- */
770
-
771
-
772
- function handleEvent(event, vnode) {
773
- const {
774
- type
775
- } = event;
776
- const {
777
- data: {
778
- on
779
- }
780
- } = vnode;
781
- const handler = on && on[type]; // call event handler if exists
782
-
783
- if (handler) {
784
- handler.call(undefined, event);
785
- }
786
- }
787
-
788
- function createListener() {
789
- return function handler(event) {
790
- handleEvent(event, handler.vnode);
791
- };
792
- }
793
-
794
- function updateAllEventListeners(oldVnode, vnode) {
795
- if (isUndefined$1(oldVnode.listener)) {
796
- createAllEventListeners(vnode);
797
- } else {
798
- vnode.listener = oldVnode.listener;
799
- vnode.listener.vnode = vnode;
800
- }
801
- }
802
-
803
- function createAllEventListeners(vnode) {
804
- const {
805
- elm,
806
- data: {
807
- on
808
- },
809
- owner: {
810
- renderer
811
- }
812
- } = vnode;
813
-
814
- if (isUndefined$1(on)) {
815
- return;
816
- }
817
-
818
- const listener = vnode.listener = createListener();
819
- listener.vnode = vnode;
820
- let name;
821
-
822
- for (name in on) {
823
- renderer.addEventListener(elm, name, listener);
824
- }
825
- }
826
-
827
- var modEvents = {
828
- update: updateAllEventListeners,
829
- create: createAllEventListeners
830
- };
831
- /*
832
- * Copyright (c) 2018, salesforce.com, inc.
833
- * All rights reserved.
834
- * SPDX-License-Identifier: MIT
835
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
836
- */
837
-
838
- const defaultDefHTMLPropertyNames = ['accessKey', 'dir', 'draggable', 'hidden', 'id', 'lang', 'spellcheck', 'tabIndex', 'title'];
839
-
840
- function offsetPropertyErrorMessage(name) {
841
- return `Using the \`${name}\` property is an anti-pattern because it rounds the value to an integer. Instead, use the \`getBoundingClientRect\` method to obtain fractional values for the size of an element and its position relative to the viewport.`;
842
- } // Global HTML Attributes & Properties
843
- // https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes
844
- // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement
845
-
846
-
847
- const globalHTMLProperties = assign(create(null), {
848
- accessKey: {
849
- attribute: 'accesskey'
850
- },
851
- accessKeyLabel: {
852
- readOnly: true
853
- },
854
- className: {
855
- attribute: 'class',
856
- error: 'Using the `className` property is an anti-pattern because of slow runtime behavior and potential conflicts with classes provided by the owner element. Use the `classList` API instead.'
857
- },
858
- contentEditable: {
859
- attribute: 'contenteditable'
860
- },
861
- dataset: {
862
- readOnly: true,
863
- error: "Using the `dataset` property is an anti-pattern because it can't be statically analyzed. Expose each property individually using the `@api` decorator instead."
864
- },
865
- dir: {
866
- attribute: 'dir'
867
- },
868
- draggable: {
869
- attribute: 'draggable'
870
- },
871
- dropzone: {
872
- attribute: 'dropzone',
873
- readOnly: true
874
- },
875
- hidden: {
876
- attribute: 'hidden'
877
- },
878
- id: {
879
- attribute: 'id'
880
- },
881
- inputMode: {
882
- attribute: 'inputmode'
883
- },
884
- lang: {
885
- attribute: 'lang'
886
- },
887
- slot: {
888
- attribute: 'slot',
889
- error: 'Using the `slot` property is an anti-pattern.'
890
- },
891
- spellcheck: {
892
- attribute: 'spellcheck'
893
- },
894
- style: {
895
- attribute: 'style'
896
- },
897
- tabIndex: {
898
- attribute: 'tabindex'
899
- },
900
- title: {
901
- attribute: 'title'
902
- },
903
- translate: {
904
- attribute: 'translate'
905
- },
906
- // additional "global attributes" that are not present in the link above.
907
- isContentEditable: {
908
- readOnly: true
909
- },
910
- offsetHeight: {
911
- readOnly: true,
912
- error: offsetPropertyErrorMessage('offsetHeight')
913
- },
914
- offsetLeft: {
915
- readOnly: true,
916
- error: offsetPropertyErrorMessage('offsetLeft')
917
- },
918
- offsetParent: {
919
- readOnly: true
920
- },
921
- offsetTop: {
922
- readOnly: true,
923
- error: offsetPropertyErrorMessage('offsetTop')
924
- },
925
- offsetWidth: {
926
- readOnly: true,
927
- error: offsetPropertyErrorMessage('offsetWidth')
928
- },
929
- role: {
930
- attribute: 'role'
931
- }
932
- });
933
- let controlledElement = null;
934
- let controlledAttributeName;
935
-
936
- function isAttributeLocked(elm, attrName) {
937
- return elm !== controlledElement || attrName !== controlledAttributeName;
938
- }
939
-
940
- function lockAttribute(_elm, _key) {
941
- controlledElement = null;
942
- controlledAttributeName = undefined;
943
- }
944
-
945
- function unlockAttribute(elm, key) {
946
- controlledElement = elm;
947
- controlledAttributeName = key;
948
- }
949
- /*
950
- * Copyright (c) 2018, salesforce.com, inc.
951
- * All rights reserved.
952
- * SPDX-License-Identifier: MIT
953
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
954
- */
955
-
956
-
957
- const xlinkNS = 'http://www.w3.org/1999/xlink';
958
- const xmlNS = 'http://www.w3.org/XML/1998/namespace';
959
- const ColonCharCode = 58;
960
-
961
- function updateAttrs(oldVnode, vnode) {
962
- const {
963
- data: {
964
- attrs
965
- },
966
- owner: {
967
- renderer
968
- }
969
- } = vnode;
970
-
971
- if (isUndefined$1(attrs)) {
972
- return;
973
- }
974
-
975
- let {
976
- data: {
977
- attrs: oldAttrs
978
- }
979
- } = oldVnode;
980
-
981
- if (oldAttrs === attrs) {
982
- return;
983
- }
984
-
985
- if (process.env.NODE_ENV !== 'production') {
986
- assert.invariant(isUndefined$1(oldAttrs) || keys(oldAttrs).join(',') === keys(attrs).join(','), `vnode.data.attrs cannot change shape.`);
987
- }
988
-
989
- const elm = vnode.elm;
990
- const {
991
- setAttribute,
992
- removeAttribute
993
- } = renderer;
994
- let key;
995
- oldAttrs = isUndefined$1(oldAttrs) ? EmptyObject : oldAttrs; // update modified attributes, add new attributes
996
- // this routine is only useful for data-* attributes in all kind of elements
997
- // and aria-* in standard elements (custom elements will use props for these)
998
-
999
- for (key in attrs) {
1000
- const cur = attrs[key];
1001
- const old = oldAttrs[key];
1002
-
1003
- if (old !== cur) {
1004
- unlockAttribute(elm, key);
1005
-
1006
- if (StringCharCodeAt.call(key, 3) === ColonCharCode) {
1007
- // Assume xml namespace
1008
- setAttribute(elm, key, cur, xmlNS);
1009
- } else if (StringCharCodeAt.call(key, 5) === ColonCharCode) {
1010
- // Assume xlink namespace
1011
- setAttribute(elm, key, cur, xlinkNS);
1012
- } else if (isNull(cur)) {
1013
- removeAttribute(elm, key);
1014
- } else {
1015
- setAttribute(elm, key, cur);
1016
- }
1017
-
1018
- lockAttribute();
1019
- }
1020
- }
1021
- }
1022
-
1023
- const emptyVNode$3 = {
1024
- data: {}
1025
- };
1026
- var modAttrs = {
1027
- create: vnode => updateAttrs(emptyVNode$3, vnode),
1028
- update: updateAttrs
1029
- };
1030
- /*
1031
- * Copyright (c) 2018, salesforce.com, inc.
1032
- * All rights reserved.
1033
- * SPDX-License-Identifier: MIT
1034
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
1035
- */
1036
-
1037
- function isLiveBindingProp(sel, key) {
1038
- // For properties with live bindings, we read values from the DOM element
1039
- // instead of relying on internally tracked values.
1040
- return sel === 'input' && (key === 'value' || key === 'checked');
1041
- }
1042
-
1043
- function update(oldVnode, vnode) {
1044
- const props = vnode.data.props;
1045
-
1046
- if (isUndefined$1(props)) {
1047
- return;
1048
- }
1049
-
1050
- const oldProps = oldVnode.data.props;
1051
-
1052
- if (oldProps === props) {
1053
- return;
1054
- }
1055
-
1056
- if (process.env.NODE_ENV !== 'production') {
1057
- assert.invariant(isUndefined$1(oldProps) || keys(oldProps).join(',') === keys(props).join(','), 'vnode.data.props cannot change shape.');
1058
- }
1059
-
1060
- const isFirstPatch = isUndefined$1(oldProps);
1061
- const {
1062
- elm,
1063
- sel,
1064
- owner: {
1065
- renderer
1066
- }
1067
- } = vnode;
1068
-
1069
- for (const key in props) {
1070
- const cur = props[key]; // if it is the first time this element is patched, or the current value is different to the previous value...
1071
-
1072
- if (isFirstPatch || cur !== (isLiveBindingProp(sel, key) ? renderer.getProperty(elm, key) : oldProps[key])) {
1073
- renderer.setProperty(elm, key, cur);
1074
- }
1075
- }
1076
- }
1077
-
1078
- const emptyVNode$2 = {
1079
- data: {}
1080
- };
1081
- var modProps = {
1082
- create: vnode => update(emptyVNode$2, vnode),
1083
- update
1084
- };
1085
- /*
1086
- * Copyright (c) 2018, salesforce.com, inc.
1087
- * All rights reserved.
1088
- * SPDX-License-Identifier: MIT
1089
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
1090
- */
1091
-
1092
- const classNameToClassMap = create(null);
1093
-
1094
- function getMapFromClassName(className) {
1095
- // Intentionally using == to match undefined and null values from computed style attribute
1096
- if (className == null) {
1097
- return EmptyObject;
1098
- } // computed class names must be string
1099
-
1100
-
1101
- className = isString(className) ? className : className + '';
1102
- let map = classNameToClassMap[className];
1103
-
1104
- if (map) {
1105
- return map;
1106
- }
1107
-
1108
- map = create(null);
1109
- let start = 0;
1110
- let o;
1111
- const len = className.length;
1112
-
1113
- for (o = 0; o < len; o++) {
1114
- if (StringCharCodeAt.call(className, o) === SPACE_CHAR) {
1115
- if (o > start) {
1116
- map[StringSlice.call(className, start, o)] = true;
1117
- }
1118
-
1119
- start = o + 1;
1120
- }
1121
- }
1122
-
1123
- if (o > start) {
1124
- map[StringSlice.call(className, start, o)] = true;
1125
- }
1126
-
1127
- classNameToClassMap[className] = map;
1128
-
1129
- if (process.env.NODE_ENV !== 'production') {
1130
- // just to make sure that this object never changes as part of the diffing algo
1131
- freeze(map);
1132
- }
1133
-
1134
- return map;
1135
- }
1136
-
1137
- function updateClassAttribute(oldVnode, vnode) {
1138
- const {
1139
- elm,
1140
- data: {
1141
- className: newClass
1142
- },
1143
- owner: {
1144
- renderer
1145
- }
1146
- } = vnode;
1147
- const {
1148
- data: {
1149
- className: oldClass
1150
- }
1151
- } = oldVnode;
1152
-
1153
- if (oldClass === newClass) {
1154
- return;
1155
- }
1156
-
1157
- const classList = renderer.getClassList(elm);
1158
- const newClassMap = getMapFromClassName(newClass);
1159
- const oldClassMap = getMapFromClassName(oldClass);
1160
- let name;
1161
-
1162
- for (name in oldClassMap) {
1163
- // remove only if it is not in the new class collection and it is not set from within the instance
1164
- if (isUndefined$1(newClassMap[name])) {
1165
- classList.remove(name);
1166
- }
1167
- }
1168
-
1169
- for (name in newClassMap) {
1170
- if (isUndefined$1(oldClassMap[name])) {
1171
- classList.add(name);
1172
- }
1173
- }
1174
- }
1175
-
1176
- const emptyVNode$1 = {
1177
- data: {}
1178
- };
1179
- var modComputedClassName = {
1180
- create: vnode => updateClassAttribute(emptyVNode$1, vnode),
1181
- update: updateClassAttribute
1182
- };
1183
- /*
1184
- * Copyright (c) 2018, salesforce.com, inc.
1185
- * All rights reserved.
1186
- * SPDX-License-Identifier: MIT
1187
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
1188
- */
1189
-
1190
- function updateStyleAttribute(oldVnode, vnode) {
1191
- const {
1192
- elm,
1193
- data: {
1194
- style: newStyle
1195
- },
1196
- owner: {
1197
- renderer
1198
- }
1199
- } = vnode;
1200
- const {
1201
- setAttribute,
1202
- removeAttribute
1203
- } = renderer;
919
+ * Copyright (c) 2018, salesforce.com, inc.
920
+ * All rights reserved.
921
+ * SPDX-License-Identifier: MIT
922
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
923
+ */
1204
924
 
1205
- if (oldVnode.data.style === newStyle) {
1206
- return;
1207
- }
1208
925
 
1209
- if (!isString(newStyle) || newStyle === '') {
1210
- removeAttribute(elm, 'style');
1211
- } else {
1212
- setAttribute(elm, 'style', newStyle);
1213
- }
926
+ function componentValueMutated(vm, key) {
927
+ valueMutated(vm.component, key);
1214
928
  }
1215
929
 
1216
- const emptyVNode = {
1217
- data: {}
1218
- };
1219
- var modComputedStyle = {
1220
- create: vnode => updateStyleAttribute(emptyVNode, vnode),
1221
- update: updateStyleAttribute
1222
- };
930
+ function componentValueObserved(vm, key) {
931
+ valueObserved(vm.component, key);
932
+ }
1223
933
  /*
1224
934
  * Copyright (c) 2018, salesforce.com, inc.
1225
935
  * All rights reserved.
1226
936
  * SPDX-License-Identifier: MIT
1227
937
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
1228
938
  */
1229
- // The compiler takes care of transforming the inline classnames into an object. It's faster to set the
1230
- // different classnames properties individually instead of via a string.
1231
939
 
1232
- function createClassAttribute(vnode) {
1233
- const {
1234
- elm,
1235
- data: {
1236
- classMap
1237
- },
1238
- owner: {
1239
- renderer
1240
- }
1241
- } = vnode;
1242
940
 
1243
- if (isUndefined$1(classMap)) {
1244
- return;
1245
- }
941
+ function getComponentTag(vm) {
942
+ return `<${StringToLowerCase.call(vm.tagName)}>`;
943
+ } // TODO [#1695]: Unify getComponentStack and getErrorComponentStack
1246
944
 
1247
- const classList = renderer.getClassList(elm);
1248
945
 
1249
- for (const name in classMap) {
1250
- classList.add(name);
946
+ function getComponentStack(vm) {
947
+ const stack = [];
948
+ let prefix = '';
949
+
950
+ while (!isNull(vm.owner)) {
951
+ ArrayPush$1.call(stack, prefix + getComponentTag(vm));
952
+ vm = vm.owner;
953
+ prefix += '\t';
1251
954
  }
955
+
956
+ return ArrayJoin.call(stack, '\n');
1252
957
  }
1253
958
 
1254
- var modStaticClassName = {
1255
- create: createClassAttribute
1256
- };
959
+ function getErrorComponentStack(vm) {
960
+ const wcStack = [];
961
+ let currentVm = vm;
962
+
963
+ while (!isNull(currentVm)) {
964
+ ArrayPush$1.call(wcStack, getComponentTag(currentVm));
965
+ currentVm = currentVm.owner;
966
+ }
967
+
968
+ return wcStack.reverse().join('\n\t');
969
+ }
1257
970
  /*
1258
971
  * Copyright (c) 2018, salesforce.com, inc.
1259
972
  * All rights reserved.
1260
973
  * SPDX-License-Identifier: MIT
1261
974
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
1262
975
  */
1263
- // The compiler takes care of transforming the inline style into an object. It's faster to set the
1264
- // different style properties individually instead of via a string.
1265
976
 
1266
- function createStyleAttribute(vnode) {
1267
- const {
1268
- elm,
1269
- data: {
1270
- styleDecls
1271
- },
1272
- owner: {
1273
- renderer
1274
- }
1275
- } = vnode;
1276
977
 
1277
- if (isUndefined$1(styleDecls)) {
978
+ function log(method, message, vm) {
979
+ let msg = `[LWC ${method}]: ${message}`;
980
+
981
+ if (!isUndefined$1(vm)) {
982
+ msg = `${msg}\n${getComponentStack(vm)}`;
983
+ }
984
+
985
+ if (process.env.NODE_ENV === 'test') {
986
+ /* eslint-disable-next-line no-console */
987
+ console[method](msg);
1278
988
  return;
1279
989
  }
1280
990
 
1281
- for (let i = 0; i < styleDecls.length; i++) {
1282
- const [prop, value, important] = styleDecls[i];
1283
- renderer.setCSSStyleProperty(elm, prop, value, important);
991
+ try {
992
+ throw new Error(msg);
993
+ } catch (e) {
994
+ /* eslint-disable-next-line no-console */
995
+ console[method](e);
1284
996
  }
1285
997
  }
1286
998
 
1287
- var modStaticStyle = {
1288
- create: createStyleAttribute
1289
- };
999
+ function logError(message, vm) {
1000
+ log('error', message, vm);
1001
+ }
1002
+
1003
+ function logWarn(message, vm) {
1004
+ log('warn', message, vm);
1005
+ }
1290
1006
  /*
1291
1007
  * Copyright (c) 2018, salesforce.com, inc.
1292
1008
  * All rights reserved.
@@ -1294,14 +1010,6 @@ var modStaticStyle = {
1294
1010
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
1295
1011
  */
1296
1012
 
1297
- /**
1298
- @license
1299
- Copyright (c) 2015 Simon Friis Vindum.
1300
- This code may only be used under the MIT License found at
1301
- https://github.com/snabbdom/snabbdom/blob/master/LICENSE
1302
- Code distributed by Snabbdom as part of the Snabbdom project at
1303
- https://github.com/snabbdom/snabbdom/
1304
- */
1305
1013
 
1306
1014
  function isUndef(s) {
1307
1015
  return s === undefined;
@@ -1390,7 +1098,7 @@ function updateDynamicChildren(parentElm, oldCh, newCh) {
1390
1098
  } else if (sameVnode(oldStartVnode, newEndVnode)) {
1391
1099
  // Vnode moved right
1392
1100
  patchVnode(oldStartVnode, newEndVnode);
1393
- newEndVnode.hook.move(oldStartVnode, parentElm, oldEndVnode.owner.renderer.nextSibling(oldEndVnode.elm));
1101
+ newEndVnode.hook.move(oldStartVnode, parentElm, nextSibling$1(oldEndVnode.elm));
1394
1102
  oldStartVnode = oldCh[++oldStartIdx];
1395
1103
  newEndVnode = newCh[--newEndIdx];
1396
1104
  } else if (sameVnode(oldEndVnode, newStartVnode)) {
@@ -1510,6 +1218,125 @@ function patchVnode(oldVnode, vnode) {
1510
1218
  */
1511
1219
 
1512
1220
 
1221
+ const defaultDefHTMLPropertyNames = ['accessKey', 'dir', 'draggable', 'hidden', 'id', 'lang', 'spellcheck', 'tabIndex', 'title'];
1222
+
1223
+ function offsetPropertyErrorMessage(name) {
1224
+ return `Using the \`${name}\` property is an anti-pattern because it rounds the value to an integer. Instead, use the \`getBoundingClientRect\` method to obtain fractional values for the size of an element and its position relative to the viewport.`;
1225
+ } // Global HTML Attributes & Properties
1226
+ // https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes
1227
+ // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement
1228
+
1229
+
1230
+ const globalHTMLProperties = assign(create(null), {
1231
+ accessKey: {
1232
+ attribute: 'accesskey'
1233
+ },
1234
+ accessKeyLabel: {
1235
+ readOnly: true
1236
+ },
1237
+ className: {
1238
+ attribute: 'class',
1239
+ error: 'Using the `className` property is an anti-pattern because of slow runtime behavior and potential conflicts with classes provided by the owner element. Use the `classList` API instead.'
1240
+ },
1241
+ contentEditable: {
1242
+ attribute: 'contenteditable'
1243
+ },
1244
+ dataset: {
1245
+ readOnly: true,
1246
+ error: "Using the `dataset` property is an anti-pattern because it can't be statically analyzed. Expose each property individually using the `@api` decorator instead."
1247
+ },
1248
+ dir: {
1249
+ attribute: 'dir'
1250
+ },
1251
+ draggable: {
1252
+ attribute: 'draggable'
1253
+ },
1254
+ dropzone: {
1255
+ attribute: 'dropzone',
1256
+ readOnly: true
1257
+ },
1258
+ hidden: {
1259
+ attribute: 'hidden'
1260
+ },
1261
+ id: {
1262
+ attribute: 'id'
1263
+ },
1264
+ inputMode: {
1265
+ attribute: 'inputmode'
1266
+ },
1267
+ lang: {
1268
+ attribute: 'lang'
1269
+ },
1270
+ slot: {
1271
+ attribute: 'slot',
1272
+ error: 'Using the `slot` property is an anti-pattern.'
1273
+ },
1274
+ spellcheck: {
1275
+ attribute: 'spellcheck'
1276
+ },
1277
+ style: {
1278
+ attribute: 'style'
1279
+ },
1280
+ tabIndex: {
1281
+ attribute: 'tabindex'
1282
+ },
1283
+ title: {
1284
+ attribute: 'title'
1285
+ },
1286
+ translate: {
1287
+ attribute: 'translate'
1288
+ },
1289
+ // additional "global attributes" that are not present in the link above.
1290
+ isContentEditable: {
1291
+ readOnly: true
1292
+ },
1293
+ offsetHeight: {
1294
+ readOnly: true,
1295
+ error: offsetPropertyErrorMessage('offsetHeight')
1296
+ },
1297
+ offsetLeft: {
1298
+ readOnly: true,
1299
+ error: offsetPropertyErrorMessage('offsetLeft')
1300
+ },
1301
+ offsetParent: {
1302
+ readOnly: true
1303
+ },
1304
+ offsetTop: {
1305
+ readOnly: true,
1306
+ error: offsetPropertyErrorMessage('offsetTop')
1307
+ },
1308
+ offsetWidth: {
1309
+ readOnly: true,
1310
+ error: offsetPropertyErrorMessage('offsetWidth')
1311
+ },
1312
+ role: {
1313
+ attribute: 'role'
1314
+ }
1315
+ });
1316
+ let controlledElement = null;
1317
+ let controlledAttributeName;
1318
+
1319
+ function isAttributeLocked(elm, attrName) {
1320
+ return elm !== controlledElement || attrName !== controlledAttributeName;
1321
+ }
1322
+
1323
+ function lockAttribute(_elm, _key) {
1324
+ controlledElement = null;
1325
+ controlledAttributeName = undefined;
1326
+ }
1327
+
1328
+ function unlockAttribute(elm, key) {
1329
+ controlledElement = elm;
1330
+ controlledAttributeName = key;
1331
+ }
1332
+ /*
1333
+ * Copyright (c) 2018, salesforce.com, inc.
1334
+ * All rights reserved.
1335
+ * SPDX-License-Identifier: MIT
1336
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
1337
+ */
1338
+
1339
+
1513
1340
  function generateDataDescriptor(options) {
1514
1341
  return assign({
1515
1342
  configurable: true,
@@ -1872,7 +1699,7 @@ function patchLightningElementPrototypeWithRestrictions(proto) {
1872
1699
  defineProperties(proto, getLightningElementPrototypeRestrictionsDescriptors(proto));
1873
1700
  }
1874
1701
  /*
1875
- * Copyright (c) 2020, salesforce.com, inc.
1702
+ * Copyright (c) 2018, salesforce.com, inc.
1876
1703
  * All rights reserved.
1877
1704
  * SPDX-License-Identifier: MIT
1878
1705
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
@@ -2792,9 +2619,7 @@ function createBridgeToElementDescriptor(propName, descriptor) {
2792
2619
 
2793
2620
 
2794
2621
  const LightningElement = function () {
2795
- var _a; // This should be as performant as possible, while any initialization should be done lazily
2796
-
2797
-
2622
+ // This should be as performant as possible, while any initialization should be done lazily
2798
2623
  if (isNull(vmBeingConstructed)) {
2799
2624
  throw new ReferenceError('Illegal constructor');
2800
2625
  }
@@ -2802,15 +2627,14 @@ const LightningElement = function () {
2802
2627
  const vm = vmBeingConstructed;
2803
2628
  const {
2804
2629
  def,
2805
- elm,
2806
- renderer
2630
+ elm
2807
2631
  } = vm;
2808
2632
  const {
2809
2633
  bridge
2810
2634
  } = def;
2811
2635
 
2812
2636
  if (process.env.NODE_ENV !== 'production') {
2813
- (_a = renderer.assertInstanceOfHTMLElement) === null || _a === void 0 ? void 0 : _a.call(renderer, vm.elm, `Component creation requires a DOM element to be associated to ${vm}.`);
2637
+ assertInstanceOfHTMLElement$1(vm.elm, `Component creation requires a DOM element to be associated to ${vm}.`);
2814
2638
  }
2815
2639
 
2816
2640
  const component = this;
@@ -2840,7 +2664,7 @@ const LightningElement = function () {
2840
2664
  if (vm.renderMode === 1
2841
2665
  /* Shadow */
2842
2666
  ) {
2843
- attachShadow(vm);
2667
+ doAttachShadow(vm);
2844
2668
  } // Adding extra guard rails in DEV mode.
2845
2669
 
2846
2670
 
@@ -2852,17 +2676,16 @@ const LightningElement = function () {
2852
2676
  return this;
2853
2677
  };
2854
2678
 
2855
- function attachShadow(vm) {
2679
+ function doAttachShadow(vm) {
2856
2680
  const {
2857
2681
  elm,
2858
2682
  mode,
2859
- renderer,
2860
2683
  shadowMode,
2861
2684
  def: {
2862
2685
  ctor
2863
2686
  }
2864
2687
  } = vm;
2865
- const cmpRoot = renderer.attachShadow(elm, {
2688
+ const cmpRoot = attachShadow$1(elm, {
2866
2689
  [KEY__SYNTHETIC_MODE]: shadowMode === 1
2867
2690
  /* Synthetic */
2868
2691
  ,
@@ -2889,21 +2712,15 @@ LightningElement.prototype = {
2889
2712
 
2890
2713
  dispatchEvent(event) {
2891
2714
  const {
2892
- elm,
2893
- renderer: {
2894
- dispatchEvent
2895
- }
2715
+ elm
2896
2716
  } = getAssociatedVM(this);
2897
- return dispatchEvent(elm, event);
2717
+ return dispatchEvent$1(elm, event);
2898
2718
  },
2899
2719
 
2900
2720
  addEventListener(type, listener, options) {
2901
2721
  const vm = getAssociatedVM(this);
2902
2722
  const {
2903
- elm,
2904
- renderer: {
2905
- addEventListener
2906
- }
2723
+ elm
2907
2724
  } = vm;
2908
2725
 
2909
2726
  if (process.env.NODE_ENV !== 'production') {
@@ -2914,92 +2731,68 @@ LightningElement.prototype = {
2914
2731
  }
2915
2732
 
2916
2733
  const wrappedListener = getWrappedComponentsListener(vm, listener);
2917
- addEventListener(elm, type, wrappedListener, options);
2734
+ addEventListener$1(elm, type, wrappedListener, options);
2918
2735
  },
2919
2736
 
2920
2737
  removeEventListener(type, listener, options) {
2921
2738
  const vm = getAssociatedVM(this);
2922
2739
  const {
2923
- elm,
2924
- renderer: {
2925
- removeEventListener
2926
- }
2740
+ elm
2927
2741
  } = vm;
2928
2742
  const wrappedListener = getWrappedComponentsListener(vm, listener);
2929
- removeEventListener(elm, type, wrappedListener, options);
2743
+ removeEventListener$1(elm, type, wrappedListener, options);
2930
2744
  },
2931
2745
 
2932
2746
  hasAttribute(name) {
2933
2747
  const {
2934
- elm,
2935
- renderer: {
2936
- getAttribute
2937
- }
2748
+ elm
2938
2749
  } = getAssociatedVM(this);
2939
- return !isNull(getAttribute(elm, name));
2750
+ return !isNull(getAttribute$1(elm, name));
2940
2751
  },
2941
2752
 
2942
2753
  hasAttributeNS(namespace, name) {
2943
2754
  const {
2944
- elm,
2945
- renderer: {
2946
- getAttribute
2947
- }
2755
+ elm
2948
2756
  } = getAssociatedVM(this);
2949
- return !isNull(getAttribute(elm, name, namespace));
2757
+ return !isNull(getAttribute$1(elm, name, namespace));
2950
2758
  },
2951
2759
 
2952
2760
  removeAttribute(name) {
2953
2761
  const {
2954
- elm,
2955
- renderer: {
2956
- removeAttribute
2957
- }
2762
+ elm
2958
2763
  } = getAssociatedVM(this);
2959
2764
  unlockAttribute(elm, name);
2960
- removeAttribute(elm, name);
2765
+ removeAttribute$1(elm, name);
2961
2766
  lockAttribute();
2962
2767
  },
2963
2768
 
2964
2769
  removeAttributeNS(namespace, name) {
2965
2770
  const {
2966
- elm,
2967
- renderer: {
2968
- removeAttribute
2969
- }
2771
+ elm
2970
2772
  } = getAssociatedVM(this);
2971
2773
  unlockAttribute(elm, name);
2972
- removeAttribute(elm, name, namespace);
2774
+ removeAttribute$1(elm, name, namespace);
2973
2775
  lockAttribute();
2974
2776
  },
2975
2777
 
2976
2778
  getAttribute(name) {
2977
2779
  const {
2978
- elm,
2979
- renderer: {
2980
- getAttribute
2981
- }
2780
+ elm
2982
2781
  } = getAssociatedVM(this);
2983
- return getAttribute(elm, name);
2782
+ return getAttribute$1(elm, name);
2984
2783
  },
2985
2784
 
2986
2785
  getAttributeNS(namespace, name) {
2987
2786
  const {
2988
- elm,
2989
- renderer: {
2990
- getAttribute
2991
- }
2787
+ elm
2992
2788
  } = getAssociatedVM(this);
2993
- return getAttribute(elm, name, namespace);
2789
+ return getAttribute$1(elm, name, namespace);
2994
2790
  },
2995
2791
 
2996
2792
  setAttribute(name, value) {
2997
2793
  const vm = getAssociatedVM(this);
2998
2794
  const {
2999
- elm,
3000
- renderer: {
3001
- setAttribute
3002
- }
2795
+ elm
3003
2796
  } = vm;
3004
2797
 
3005
2798
  if (process.env.NODE_ENV !== 'production') {
@@ -3007,17 +2800,14 @@ LightningElement.prototype = {
3007
2800
  }
3008
2801
 
3009
2802
  unlockAttribute(elm, name);
3010
- setAttribute(elm, name, value);
2803
+ setAttribute$1(elm, name, value);
3011
2804
  lockAttribute();
3012
2805
  },
3013
2806
 
3014
2807
  setAttributeNS(namespace, name, value) {
3015
2808
  const vm = getAssociatedVM(this);
3016
2809
  const {
3017
- elm,
3018
- renderer: {
3019
- setAttribute
3020
- }
2810
+ elm
3021
2811
  } = vm;
3022
2812
 
3023
2813
  if (process.env.NODE_ENV !== 'production') {
@@ -3025,43 +2815,34 @@ LightningElement.prototype = {
3025
2815
  }
3026
2816
 
3027
2817
  unlockAttribute(elm, name);
3028
- setAttribute(elm, name, value, namespace);
2818
+ setAttribute$1(elm, name, value, namespace);
3029
2819
  lockAttribute();
3030
2820
  },
3031
2821
 
3032
2822
  getBoundingClientRect() {
3033
2823
  const vm = getAssociatedVM(this);
3034
2824
  const {
3035
- elm,
3036
- renderer: {
3037
- getBoundingClientRect
3038
- }
2825
+ elm
3039
2826
  } = vm;
3040
2827
 
3041
2828
  if (process.env.NODE_ENV !== 'production') {
3042
2829
  warnIfInvokedDuringConstruction(vm, 'getBoundingClientRect()');
3043
2830
  }
3044
2831
 
3045
- return getBoundingClientRect(elm);
2832
+ return getBoundingClientRect$1(elm);
3046
2833
  },
3047
2834
 
3048
2835
  get isConnected() {
3049
2836
  const {
3050
- elm,
3051
- renderer: {
3052
- isConnected
3053
- }
2837
+ elm
3054
2838
  } = getAssociatedVM(this);
3055
- return isConnected(elm);
2839
+ return isConnected$1(elm);
3056
2840
  },
3057
2841
 
3058
2842
  get classList() {
3059
2843
  const vm = getAssociatedVM(this);
3060
2844
  const {
3061
- elm,
3062
- renderer: {
3063
- getClassList
3064
- }
2845
+ elm
3065
2846
  } = vm;
3066
2847
 
3067
2848
  if (process.env.NODE_ENV !== 'production') {
@@ -3070,7 +2851,7 @@ LightningElement.prototype = {
3070
2851
  assert.isFalse(isBeingConstructed(vm), `Failed to construct ${vm}: The result must not have attributes. Adding or tampering with classname in constructor is not allowed in a web component, use connectedCallback() instead.`);
3071
2852
  }
3072
2853
 
3073
- return getClassList(elm);
2854
+ return getClassList$1(elm);
3074
2855
  },
3075
2856
 
3076
2857
  get template() {
@@ -3104,23 +2885,48 @@ LightningElement.prototype = {
3104
2885
  }
3105
2886
 
3106
2887
  };
3107
- const queryAndChildGetterDescriptors = create(null);
3108
- const childGetters = [['children', 'getChildren'], ['childNodes', 'getChildNodes'], ['firstChild', 'getFirstChild'], ['firstElementChild', 'getFirstElementChild'], ['lastChild', 'getLastChild'], ['lastElementChild', 'getLastElementChild']]; // Generic passthrough for child getters on HTMLElement to the relevant Renderer APIs
2888
+ const queryAndChildGetterDescriptors = create(null); // The reason we don't just call `import * as renderer from '../renderer'` here is that the bundle size
2889
+ // is smaller if we reference each function individually. Otherwise Rollup will create one big frozen
2890
+ // object representing the renderer, with a lot of methods we don't actually need.
2891
+
2892
+ const childGetters = ['children', 'childNodes', 'firstChild', 'firstElementChild', 'lastChild', 'lastElementChild'];
2893
+
2894
+ function getChildGetter(methodName) {
2895
+ switch (methodName) {
2896
+ case 'children':
2897
+ return getChildren$1;
2898
+
2899
+ case 'childNodes':
2900
+ return getChildNodes$1;
3109
2901
 
3110
- for (const [elementProp, rendererMethod] of childGetters) {
3111
- queryAndChildGetterDescriptors[elementProp] = {
2902
+ case 'firstChild':
2903
+ return getFirstChild$1;
2904
+
2905
+ case 'firstElementChild':
2906
+ return getFirstElementChild$1;
2907
+
2908
+ case 'lastChild':
2909
+ return getLastChild$1;
2910
+
2911
+ case 'lastElementChild':
2912
+ return getLastElementChild$1;
2913
+ }
2914
+ } // Generic passthrough for child getters on HTMLElement to the relevant Renderer APIs
2915
+
2916
+
2917
+ for (const childGetter of childGetters) {
2918
+ queryAndChildGetterDescriptors[childGetter] = {
3112
2919
  get() {
3113
2920
  const vm = getAssociatedVM(this);
3114
2921
  const {
3115
- elm,
3116
- renderer
2922
+ elm
3117
2923
  } = vm;
3118
2924
 
3119
2925
  if (process.env.NODE_ENV !== 'production') {
3120
- warnIfInvokedDuringConstruction(vm, elementProp);
2926
+ warnIfInvokedDuringConstruction(vm, childGetter);
3121
2927
  }
3122
2928
 
3123
- return renderer[rendererMethod](elm);
2929
+ return getChildGetter(childGetter)(elm);
3124
2930
  },
3125
2931
 
3126
2932
  configurable: true,
@@ -3128,22 +2934,38 @@ for (const [elementProp, rendererMethod] of childGetters) {
3128
2934
  };
3129
2935
  }
3130
2936
 
3131
- const queryMethods = ['getElementsByClassName', 'getElementsByTagName', 'querySelector', 'querySelectorAll']; // Generic passthrough for query APIs on HTMLElement to the relevant Renderer APIs
2937
+ const queryMethods = ['getElementsByClassName', 'getElementsByTagName', 'querySelector', 'querySelectorAll'];
2938
+
2939
+ function getQueryMethod(methodName) {
2940
+ switch (methodName) {
2941
+ case 'getElementsByClassName':
2942
+ return getElementsByClassName$1;
2943
+
2944
+ case 'getElementsByTagName':
2945
+ return getElementsByTagName$1;
2946
+
2947
+ case 'querySelector':
2948
+ return querySelector$1;
2949
+
2950
+ case 'querySelectorAll':
2951
+ return querySelectorAll$1;
2952
+ }
2953
+ } // Generic passthrough for query APIs on HTMLElement to the relevant Renderer APIs
2954
+
3132
2955
 
3133
2956
  for (const queryMethod of queryMethods) {
3134
2957
  queryAndChildGetterDescriptors[queryMethod] = {
3135
2958
  value(arg) {
3136
2959
  const vm = getAssociatedVM(this);
3137
2960
  const {
3138
- elm,
3139
- renderer
2961
+ elm
3140
2962
  } = vm;
3141
2963
 
3142
2964
  if (process.env.NODE_ENV !== 'production') {
3143
2965
  warnIfInvokedDuringConstruction(vm, `${queryMethod}()`);
3144
2966
  }
3145
2967
 
3146
- return renderer[queryMethod](elm, arg);
2968
+ return getQueryMethod(queryMethod)(elm, arg);
3147
2969
  },
3148
2970
 
3149
2971
  configurable: true,
@@ -4299,10 +4121,6 @@ function createComponentDef(Ctor) {
4299
4121
 
4300
4122
  assert.isTrue(Ctor.constructor, `Missing ${ctorName}.constructor, ${ctorName} should have a "constructor" property.`);
4301
4123
 
4302
- if (!runtimeFlags.ENABLE_MIXED_SHADOW_MODE) {
4303
- assert.isFalse('shadowSupportMode' in Ctor, `${ctorName || 'Anonymous class'} is an invalid LWC component. The shadowSupportMode static property is not available in this environment.`);
4304
- }
4305
-
4306
4124
  if (!isUndefined$1(ctorShadowSupportMode)) {
4307
4125
  assert.invariant(ctorShadowSupportMode === "any"
4308
4126
  /* Any */
@@ -4529,6 +4347,295 @@ function getComponentDef(Ctor) {
4529
4347
  */
4530
4348
 
4531
4349
 
4350
+ const xlinkNS = 'http://www.w3.org/1999/xlink';
4351
+ const xmlNS = 'http://www.w3.org/XML/1998/namespace';
4352
+ const ColonCharCode = 58;
4353
+
4354
+ function patchAttributes(oldVnode, vnode) {
4355
+ const {
4356
+ attrs
4357
+ } = vnode.data;
4358
+
4359
+ if (isUndefined$1(attrs)) {
4360
+ return;
4361
+ }
4362
+
4363
+ const oldAttrs = isNull(oldVnode) ? EmptyObject : oldVnode.data.attrs;
4364
+
4365
+ if (oldAttrs === attrs) {
4366
+ return;
4367
+ }
4368
+
4369
+ const {
4370
+ elm
4371
+ } = vnode;
4372
+
4373
+ for (const key in attrs) {
4374
+ const cur = attrs[key];
4375
+ const old = oldAttrs[key];
4376
+
4377
+ if (old !== cur) {
4378
+ unlockAttribute(elm, key);
4379
+
4380
+ if (StringCharCodeAt.call(key, 3) === ColonCharCode) {
4381
+ // Assume xml namespace
4382
+ setAttribute$1(elm, key, cur, xmlNS);
4383
+ } else if (StringCharCodeAt.call(key, 5) === ColonCharCode) {
4384
+ // Assume xlink namespace
4385
+ setAttribute$1(elm, key, cur, xlinkNS);
4386
+ } else if (isNull(cur) || isUndefined$1(cur)) {
4387
+ removeAttribute$1(elm, key);
4388
+ } else {
4389
+ setAttribute$1(elm, key, cur);
4390
+ }
4391
+
4392
+ lockAttribute();
4393
+ }
4394
+ }
4395
+ }
4396
+ /*
4397
+ * Copyright (c) 2018, salesforce.com, inc.
4398
+ * All rights reserved.
4399
+ * SPDX-License-Identifier: MIT
4400
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
4401
+ */
4402
+
4403
+
4404
+ function isLiveBindingProp(sel, key) {
4405
+ // For properties with live bindings, we read values from the DOM element
4406
+ // instead of relying on internally tracked values.
4407
+ return sel === 'input' && (key === 'value' || key === 'checked');
4408
+ }
4409
+
4410
+ function patchProps(oldVnode, vnode) {
4411
+ const {
4412
+ props
4413
+ } = vnode.data;
4414
+
4415
+ if (isUndefined$1(props)) {
4416
+ return;
4417
+ }
4418
+
4419
+ const oldProps = isNull(oldVnode) ? EmptyObject : oldVnode.data.props;
4420
+
4421
+ if (oldProps === props) {
4422
+ return;
4423
+ }
4424
+
4425
+ const isFirstPatch = isNull(oldVnode);
4426
+ const {
4427
+ elm,
4428
+ sel
4429
+ } = vnode;
4430
+
4431
+ for (const key in props) {
4432
+ const cur = props[key]; // Set the property if it's the first time is is patched or if the previous property is
4433
+ // different than the one previously set.
4434
+
4435
+ if (isFirstPatch || cur !== (isLiveBindingProp(sel, key) ? getProperty$1(elm, key) : oldProps[key])) {
4436
+ setProperty$1(elm, key, cur);
4437
+ }
4438
+ }
4439
+ }
4440
+ /*
4441
+ * Copyright (c) 2018, salesforce.com, inc.
4442
+ * All rights reserved.
4443
+ * SPDX-License-Identifier: MIT
4444
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
4445
+ */
4446
+
4447
+
4448
+ const classNameToClassMap = create(null);
4449
+
4450
+ function getMapFromClassName(className) {
4451
+ // Intentionally using == to match undefined and null values from computed style attribute
4452
+ if (className == null) {
4453
+ return EmptyObject;
4454
+ } // computed class names must be string
4455
+
4456
+
4457
+ className = isString(className) ? className : className + '';
4458
+ let map = classNameToClassMap[className];
4459
+
4460
+ if (map) {
4461
+ return map;
4462
+ }
4463
+
4464
+ map = create(null);
4465
+ let start = 0;
4466
+ let o;
4467
+ const len = className.length;
4468
+
4469
+ for (o = 0; o < len; o++) {
4470
+ if (StringCharCodeAt.call(className, o) === SPACE_CHAR) {
4471
+ if (o > start) {
4472
+ map[StringSlice.call(className, start, o)] = true;
4473
+ }
4474
+
4475
+ start = o + 1;
4476
+ }
4477
+ }
4478
+
4479
+ if (o > start) {
4480
+ map[StringSlice.call(className, start, o)] = true;
4481
+ }
4482
+
4483
+ classNameToClassMap[className] = map;
4484
+
4485
+ if (process.env.NODE_ENV !== 'production') {
4486
+ // just to make sure that this object never changes as part of the diffing algo
4487
+ freeze(map);
4488
+ }
4489
+
4490
+ return map;
4491
+ }
4492
+
4493
+ function patchClassAttribute(oldVnode, vnode) {
4494
+ const {
4495
+ elm,
4496
+ data: {
4497
+ className: newClass
4498
+ }
4499
+ } = vnode;
4500
+ const oldClass = isNull(oldVnode) ? undefined : oldVnode.data.className;
4501
+
4502
+ if (oldClass === newClass) {
4503
+ return;
4504
+ }
4505
+
4506
+ const classList = getClassList$1(elm);
4507
+ const newClassMap = getMapFromClassName(newClass);
4508
+ const oldClassMap = getMapFromClassName(oldClass);
4509
+ let name;
4510
+
4511
+ for (name in oldClassMap) {
4512
+ // remove only if it is not in the new class collection and it is not set from within the instance
4513
+ if (isUndefined$1(newClassMap[name])) {
4514
+ classList.remove(name);
4515
+ }
4516
+ }
4517
+
4518
+ for (name in newClassMap) {
4519
+ if (isUndefined$1(oldClassMap[name])) {
4520
+ classList.add(name);
4521
+ }
4522
+ }
4523
+ }
4524
+ /*
4525
+ * Copyright (c) 2018, salesforce.com, inc.
4526
+ * All rights reserved.
4527
+ * SPDX-License-Identifier: MIT
4528
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
4529
+ */
4530
+
4531
+
4532
+ function patchStyleAttribute(oldVnode, vnode) {
4533
+ const {
4534
+ elm,
4535
+ data: {
4536
+ style: newStyle
4537
+ }
4538
+ } = vnode;
4539
+ const oldStyle = isNull(oldVnode) ? undefined : oldVnode.data.style;
4540
+
4541
+ if (oldStyle === newStyle) {
4542
+ return;
4543
+ }
4544
+
4545
+ if (!isString(newStyle) || newStyle === '') {
4546
+ removeAttribute$1(elm, 'style');
4547
+ } else {
4548
+ setAttribute$1(elm, 'style', newStyle);
4549
+ }
4550
+ }
4551
+ /*
4552
+ * Copyright (c) 2018, salesforce.com, inc.
4553
+ * All rights reserved.
4554
+ * SPDX-License-Identifier: MIT
4555
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
4556
+ */
4557
+
4558
+
4559
+ function applyEventListeners(vnode) {
4560
+ const {
4561
+ elm,
4562
+ data: {
4563
+ on
4564
+ }
4565
+ } = vnode;
4566
+
4567
+ if (isUndefined$1(on)) {
4568
+ return;
4569
+ }
4570
+
4571
+ for (const name in on) {
4572
+ const handler = on[name];
4573
+ addEventListener$1(elm, name, handler);
4574
+ }
4575
+ }
4576
+ /*
4577
+ * Copyright (c) 2018, salesforce.com, inc.
4578
+ * All rights reserved.
4579
+ * SPDX-License-Identifier: MIT
4580
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
4581
+ */
4582
+ // The compiler takes care of transforming the inline classnames into an object. It's faster to set the
4583
+ // different classnames properties individually instead of via a string.
4584
+
4585
+
4586
+ function applyStaticClassAttribute(vnode) {
4587
+ const {
4588
+ elm,
4589
+ data: {
4590
+ classMap
4591
+ }
4592
+ } = vnode;
4593
+
4594
+ if (isUndefined$1(classMap)) {
4595
+ return;
4596
+ }
4597
+
4598
+ const classList = getClassList$1(elm);
4599
+
4600
+ for (const name in classMap) {
4601
+ classList.add(name);
4602
+ }
4603
+ }
4604
+ /*
4605
+ * Copyright (c) 2018, salesforce.com, inc.
4606
+ * All rights reserved.
4607
+ * SPDX-License-Identifier: MIT
4608
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
4609
+ */
4610
+ // The compiler takes care of transforming the inline style into an object. It's faster to set the
4611
+ // different style properties individually instead of via a string.
4612
+
4613
+
4614
+ function applyStaticStyleAttribute(vnode) {
4615
+ const {
4616
+ elm,
4617
+ data: {
4618
+ styleDecls
4619
+ }
4620
+ } = vnode;
4621
+
4622
+ if (isUndefined$1(styleDecls)) {
4623
+ return;
4624
+ }
4625
+
4626
+ for (let i = 0; i < styleDecls.length; i++) {
4627
+ const [prop, value, important] = styleDecls[i];
4628
+ setCSSStyleProperty$1(elm, prop, value, important);
4629
+ }
4630
+ }
4631
+ /*
4632
+ * Copyright (c) 2018, salesforce.com, inc.
4633
+ * All rights reserved.
4634
+ * SPDX-License-Identifier: MIT
4635
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
4636
+ */
4637
+
4638
+
4532
4639
  function observeElementChildNodes(elm) {
4533
4640
  elm.$domManual$ = true;
4534
4641
  }
@@ -4546,17 +4653,14 @@ function setScopeTokenClassIfNecessary(elm, owner) {
4546
4653
  const token = cmpTemplate === null || cmpTemplate === void 0 ? void 0 : cmpTemplate.stylesheetToken;
4547
4654
 
4548
4655
  if (!isUndefined$1(token) && context.hasScopedStyles) {
4549
- owner.renderer.getClassList(elm).add(token);
4656
+ getClassList$1(elm).add(token);
4550
4657
  }
4551
4658
  }
4552
4659
 
4553
4660
  function updateNodeHook(oldVnode, vnode) {
4554
4661
  const {
4555
4662
  elm,
4556
- text,
4557
- owner: {
4558
- renderer
4559
- }
4663
+ text
4560
4664
  } = vnode;
4561
4665
 
4562
4666
  if (oldVnode.text !== text) {
@@ -4564,7 +4668,7 @@ function updateNodeHook(oldVnode, vnode) {
4564
4668
  unlockDomMutation();
4565
4669
  }
4566
4670
 
4567
- renderer.setText(elm, text);
4671
+ setText$1(elm, text);
4568
4672
 
4569
4673
  if (process.env.NODE_ENV !== 'production') {
4570
4674
  lockDomMutation();
@@ -4573,15 +4677,11 @@ function updateNodeHook(oldVnode, vnode) {
4573
4677
  }
4574
4678
 
4575
4679
  function insertNodeHook(vnode, parentNode, referenceNode) {
4576
- const {
4577
- renderer
4578
- } = vnode.owner;
4579
-
4580
4680
  if (process.env.NODE_ENV !== 'production') {
4581
4681
  unlockDomMutation();
4582
4682
  }
4583
4683
 
4584
- renderer.insert(vnode.elm, parentNode, referenceNode);
4684
+ insert$1(vnode.elm, parentNode, referenceNode);
4585
4685
 
4586
4686
  if (process.env.NODE_ENV !== 'production') {
4587
4687
  lockDomMutation();
@@ -4589,43 +4689,35 @@ function insertNodeHook(vnode, parentNode, referenceNode) {
4589
4689
  }
4590
4690
 
4591
4691
  function removeNodeHook(vnode, parentNode) {
4592
- const {
4593
- renderer
4594
- } = vnode.owner;
4595
-
4596
4692
  if (process.env.NODE_ENV !== 'production') {
4597
4693
  unlockDomMutation();
4598
4694
  }
4599
4695
 
4600
- renderer.remove(vnode.elm, parentNode);
4696
+ remove$1(vnode.elm, parentNode);
4601
4697
 
4602
4698
  if (process.env.NODE_ENV !== 'production') {
4603
4699
  lockDomMutation();
4604
4700
  }
4605
4701
  }
4606
4702
 
4607
- function createElmHook(vnode) {
4608
- modEvents.create(vnode); // Attrs need to be applied to element before props
4609
- // IE11 will wipe out value on radio inputs if value
4610
- // is set before type=radio.
4703
+ function patchElementPropsAndAttrs(oldVnode, vnode) {
4704
+ if (isNull(oldVnode)) {
4705
+ applyEventListeners(vnode);
4706
+ applyStaticClassAttribute(vnode);
4707
+ applyStaticStyleAttribute(vnode);
4708
+ } // Attrs need to be applied to element before props IE11 will wipe out value on radio inputs if
4709
+ // value is set before type=radio.
4710
+
4611
4711
 
4612
- modAttrs.create(vnode);
4613
- modProps.create(vnode);
4614
- modStaticClassName.create(vnode);
4615
- modStaticStyle.create(vnode);
4616
- modComputedClassName.create(vnode);
4617
- modComputedStyle.create(vnode);
4712
+ patchClassAttribute(oldVnode, vnode);
4713
+ patchStyleAttribute(oldVnode, vnode);
4714
+ patchAttributes(oldVnode, vnode);
4715
+ patchProps(oldVnode, vnode);
4618
4716
  }
4619
4717
 
4620
4718
  function hydrateElmHook(vnode) {
4621
- modEvents.create(vnode); // Attrs are already on the element.
4622
- // modAttrs.create(vnode);
4623
-
4624
- modProps.create(vnode); // Already set.
4625
- // modStaticClassName.create(vnode);
4626
- // modStaticStyle.create(vnode);
4627
- // modComputedClassName.create(vnode);
4628
- // modComputedStyle.create(vnode);
4719
+ applyEventListeners(vnode);
4720
+ patchProps(null, vnode);
4629
4721
  }
4630
4722
 
4631
4723
  function fallbackElmHook(elm, vnode) {
@@ -4677,26 +4769,11 @@ function fallbackElmHook(elm, vnode) {
4677
4769
  }
4678
4770
  }
4679
4771
 
4680
- function updateElmHook(oldVnode, vnode) {
4681
- // Attrs need to be applied to element before props
4682
- // IE11 will wipe out value on radio inputs if value
4683
- // is set before type=radio.
4684
- modAttrs.update(oldVnode, vnode);
4685
- modProps.update(oldVnode, vnode);
4686
- modComputedClassName.update(oldVnode, vnode);
4687
- modComputedStyle.update(oldVnode, vnode);
4688
- }
4689
-
4690
- function updateChildrenHook(oldVnode, vnode) {
4691
- const {
4692
- elm,
4693
- children
4694
- } = vnode;
4695
-
4696
- if (hasDynamicChildren(children)) {
4697
- updateDynamicChildren(elm, oldVnode.children, children);
4772
+ function patchChildren(parent, oldCh, newCh) {
4773
+ if (hasDynamicChildren(newCh)) {
4774
+ updateDynamicChildren(parent, oldCh, newCh);
4698
4775
  } else {
4699
- updateStaticChildren(elm, oldVnode.children, children);
4776
+ updateStaticChildren(parent, oldCh, newCh);
4700
4777
  }
4701
4778
  }
4702
4779
 
@@ -4763,8 +4840,7 @@ function createViewModelHook(elm, vnode) {
4763
4840
  createVM(elm, def, {
4764
4841
  mode,
4765
4842
  owner,
4766
- tagName: sel,
4767
- renderer: owner.renderer
4843
+ tagName: sel
4768
4844
  });
4769
4845
 
4770
4846
  if (process.env.NODE_ENV !== 'production') {
@@ -4772,19 +4848,6 @@ function createViewModelHook(elm, vnode) {
4772
4848
  }
4773
4849
  }
4774
4850
 
4775
- function createCustomElmHook(vnode) {
4776
- modEvents.create(vnode); // Attrs need to be applied to element before props
4777
- // IE11 will wipe out value on radio inputs if value
4778
- // is set before type=radio.
4779
-
4780
- modAttrs.create(vnode);
4781
- modProps.create(vnode);
4782
- modStaticClassName.create(vnode);
4783
- modStaticStyle.create(vnode);
4784
- modComputedClassName.create(vnode);
4785
- modComputedStyle.create(vnode);
4786
- }
4787
-
4788
4851
  function createChildrenHook(vnode) {
4789
4852
  const {
4790
4853
  elm,
@@ -4810,16 +4873,13 @@ function vnodesAndElementHaveCompatibleAttrs(vnode, elm) {
4810
4873
  const {
4811
4874
  data: {
4812
4875
  attrs = {}
4813
- },
4814
- owner: {
4815
- renderer
4816
4876
  }
4817
4877
  } = vnode;
4818
4878
  let nodesAreCompatible = true; // Validate attributes, though we could always recovery from those by running the update mods.
4819
4879
  // Note: intentionally ONLY matching vnodes.attrs to elm.attrs, in case SSR is adding extra attributes.
4820
4880
 
4821
4881
  for (const [attrName, attrValue] of Object.entries(attrs)) {
4822
- const elmAttrValue = renderer.getAttribute(elm, attrName);
4882
+ const elmAttrValue = getAttribute$1(elm, attrName);
4823
4883
 
4824
4884
  if (String(attrValue) !== elmAttrValue) {
4825
4885
  logError(`Mismatch hydrating element <${elm.tagName.toLowerCase()}>: attribute "${attrName}" has different values, expected "${attrValue}" but found "${elmAttrValue}"`, vnode.owner);
@@ -4835,9 +4895,6 @@ function vnodesAndElementHaveCompatibleClass(vnode, elm) {
4835
4895
  data: {
4836
4896
  className,
4837
4897
  classMap
4838
- },
4839
- owner: {
4840
- renderer
4841
4898
  }
4842
4899
  } = vnode;
4843
4900
  let nodesAreCompatible = true;
@@ -4849,7 +4906,7 @@ function vnodesAndElementHaveCompatibleClass(vnode, elm) {
4849
4906
  vnodeClassName = className;
4850
4907
  } else if (!isUndefined$1(classMap)) {
4851
4908
  // classMap is used when class is set to static value.
4852
- const classList = renderer.getClassList(elm);
4909
+ const classList = getClassList$1(elm);
4853
4910
  let computedClassName = ''; // all classes from the vnode should be in the element.classList
4854
4911
 
4855
4912
  for (const name in classMap) {
@@ -4879,12 +4936,9 @@ function vnodesAndElementHaveCompatibleStyle(vnode, elm) {
4879
4936
  data: {
4880
4937
  style,
4881
4938
  styleDecls
4882
- },
4883
- owner: {
4884
- renderer
4885
4939
  }
4886
4940
  } = vnode;
4887
- const elmStyle = renderer.getAttribute(elm, 'style') || '';
4941
+ const elmStyle = getAttribute$1(elm, 'style') || '';
4888
4942
  let vnodeStyle;
4889
4943
  let nodesAreCompatible = true;
4890
4944
 
@@ -4974,16 +5028,6 @@ function hydrateChildrenHook(elmChildren, children, vm) {
4974
5028
  }
4975
5029
  }
4976
5030
 
4977
- function updateCustomElmHook(oldVnode, vnode) {
4978
- // Attrs need to be applied to element before props
4979
- // IE11 will wipe out value on radio inputs if value
4980
- // is set before type=radio.
4981
- modAttrs.update(oldVnode, vnode);
4982
- modProps.update(oldVnode, vnode);
4983
- modComputedClassName.update(oldVnode, vnode);
4984
- modComputedStyle.update(oldVnode, vnode);
4985
- }
4986
-
4987
5031
  function removeElmHook(vnode) {
4988
5032
  // this method only needs to search on child vnodes from template
4989
5033
  // to trigger the remove hook just in case some of those children
@@ -5000,6 +5044,66 @@ function removeElmHook(vnode) {
5000
5044
  ch.hook.remove(ch, elm);
5001
5045
  }
5002
5046
  }
5047
+ }
5048
+
5049
+ function allocateInSlot(vm, children) {
5050
+ const {
5051
+ cmpSlots: oldSlots
5052
+ } = vm;
5053
+ const cmpSlots = vm.cmpSlots = create(null);
5054
+
5055
+ for (let i = 0, len = children.length; i < len; i += 1) {
5056
+ const vnode = children[i];
5057
+
5058
+ if (isNull(vnode)) {
5059
+ continue;
5060
+ }
5061
+
5062
+ const {
5063
+ data
5064
+ } = vnode;
5065
+ const slotName = data.attrs && data.attrs.slot || '';
5066
+ const vnodes = cmpSlots[slotName] = cmpSlots[slotName] || []; // re-keying the vnodes is necessary to avoid conflicts with default content for the slot
5067
+ // which might have similar keys. Each vnode will always have a key that
5068
+ // starts with a numeric character from compiler. In this case, we add a unique
5069
+ // notation for slotted vnodes keys, e.g.: `@foo:1:1`
5070
+
5071
+ if (!isUndefined$1(vnode.key)) {
5072
+ vnode.key = `@${slotName}:${vnode.key}`;
5073
+ }
5074
+
5075
+ ArrayPush$1.call(vnodes, vnode);
5076
+ }
5077
+
5078
+ if (isFalse(vm.isDirty)) {
5079
+ // We need to determine if the old allocation is really different from the new one
5080
+ // and mark the vm as dirty
5081
+ const oldKeys = keys(oldSlots);
5082
+
5083
+ if (oldKeys.length !== keys(cmpSlots).length) {
5084
+ markComponentAsDirty(vm);
5085
+ return;
5086
+ }
5087
+
5088
+ for (let i = 0, len = oldKeys.length; i < len; i += 1) {
5089
+ const key = oldKeys[i];
5090
+
5091
+ if (isUndefined$1(cmpSlots[key]) || oldSlots[key].length !== cmpSlots[key].length) {
5092
+ markComponentAsDirty(vm);
5093
+ return;
5094
+ }
5095
+
5096
+ const oldVNodes = oldSlots[key];
5097
+ const vnodes = cmpSlots[key];
5098
+
5099
+ for (let j = 0, a = cmpSlots[key].length; j < a; j += 1) {
5100
+ if (oldVNodes[j] !== vnodes[j]) {
5101
+ markComponentAsDirty(vm);
5102
+ return;
5103
+ }
5104
+ }
5105
+ }
5106
+ }
5003
5107
  } // Using a WeakMap instead of a WeakSet because this one works in IE11 :(
5004
5108
 
5005
5109
 
@@ -5021,12 +5125,12 @@ function hasDynamicChildren(children) {
5021
5125
  */
5022
5126
 
5023
5127
 
5024
- function getUpgradableConstructor(tagName, renderer) {
5128
+ function getUpgradableConstructor(tagName) {
5025
5129
  // Should never get a tag with upper case letter at this point, the compiler should
5026
5130
  // produce only tags with lowercase letters
5027
5131
  // But, for backwards compatibility, we will lower case the tagName
5028
5132
  tagName = tagName.toLowerCase();
5029
- let CE = renderer.getCustomElement(tagName);
5133
+ let CE = getCustomElement$1(tagName);
5030
5134
 
5031
5135
  if (!isUndefined$1(CE)) {
5032
5136
  return CE;
@@ -5037,7 +5141,7 @@ function getUpgradableConstructor(tagName, renderer) {
5037
5141
  */
5038
5142
 
5039
5143
 
5040
- CE = class LWCUpgradableElement extends renderer.HTMLElement {
5144
+ CE = class LWCUpgradableElement extends HTMLElementExported$1 {
5041
5145
  constructor(upgradeCallback) {
5042
5146
  super();
5043
5147
 
@@ -5047,7 +5151,7 @@ function getUpgradableConstructor(tagName, renderer) {
5047
5151
  }
5048
5152
 
5049
5153
  };
5050
- renderer.defineCustomElement(tagName, CE);
5154
+ defineCustomElement$1(tagName, CE);
5051
5155
  return CE;
5052
5156
  }
5053
5157
  /*
@@ -5065,10 +5169,7 @@ const TextHook = {
5065
5169
  const {
5066
5170
  owner
5067
5171
  } = vnode;
5068
- const {
5069
- renderer
5070
- } = owner;
5071
- const elm = renderer.createText(vnode.text);
5172
+ const elm = createText$1(vnode.text);
5072
5173
  linkNodeToShadow(elm, owner);
5073
5174
  vnode.elm = elm;
5074
5175
  },
@@ -5102,10 +5203,7 @@ const CommentHook = {
5102
5203
  owner,
5103
5204
  text
5104
5205
  } = vnode;
5105
- const {
5106
- renderer
5107
- } = owner;
5108
- const elm = renderer.createComment(text);
5206
+ const elm = createComment$1(text);
5109
5207
  linkNodeToShadow(elm, owner);
5110
5208
  vnode.elm = elm;
5111
5209
  },
@@ -5147,19 +5245,16 @@ const ElementHook = {
5147
5245
  svg
5148
5246
  }
5149
5247
  } = vnode;
5150
- const {
5151
- renderer
5152
- } = owner;
5153
5248
  const namespace = isTrue(svg) ? SVG_NAMESPACE : undefined;
5154
- const elm = renderer.createElement(sel, namespace);
5249
+ const elm = createElement$2(sel, namespace);
5155
5250
  linkNodeToShadow(elm, owner);
5156
5251
  fallbackElmHook(elm, vnode);
5157
5252
  vnode.elm = elm;
5158
- createElmHook(vnode);
5253
+ patchElementPropsAndAttrs(null, vnode);
5159
5254
  },
5160
5255
  update: (oldVnode, vnode) => {
5161
- updateElmHook(oldVnode, vnode);
5162
- updateChildrenHook(oldVnode, vnode);
5256
+ patchElementPropsAndAttrs(oldVnode, vnode);
5257
+ patchChildren(vnode.elm, oldVnode.children, vnode.children);
5163
5258
  },
5164
5259
  insert: (vnode, parentNode, referenceNode) => {
5165
5260
  insertNodeHook(vnode, parentNode, referenceNode);
@@ -5211,10 +5306,7 @@ const CustomElementHook = {
5211
5306
  sel,
5212
5307
  owner
5213
5308
  } = vnode;
5214
- const {
5215
- renderer
5216
- } = owner;
5217
- const UpgradableConstructor = getUpgradableConstructor(sel, renderer);
5309
+ const UpgradableConstructor = getUpgradableConstructor(sel);
5218
5310
  /**
5219
5311
  * Note: if the upgradable constructor does not expect, or throw when we new it
5220
5312
  * with a callback as the first argument, we could implement a more advanced
@@ -5236,10 +5328,10 @@ const CustomElementHook = {
5236
5328
  throw new TypeError(`Incorrect Component Constructor`);
5237
5329
  }
5238
5330
 
5239
- createCustomElmHook(vnode);
5331
+ patchElementPropsAndAttrs(null, vnode);
5240
5332
  },
5241
5333
  update: (oldVnode, vnode) => {
5242
- updateCustomElmHook(oldVnode, vnode);
5334
+ patchElementPropsAndAttrs(oldVnode, vnode);
5243
5335
  const vm = getAssociatedVMIfPresent(vnode.elm);
5244
5336
 
5245
5337
  if (vm) {
@@ -5250,7 +5342,7 @@ const CustomElementHook = {
5250
5342
  // will happen, but in native, it does allocate the light dom
5251
5343
 
5252
5344
 
5253
- updateChildrenHook(oldVnode, vnode);
5345
+ patchChildren(vnode.elm, oldVnode.children, vnode.children);
5254
5346
 
5255
5347
  if (vm) {
5256
5348
  if (process.env.NODE_ENV !== 'production') {
@@ -5307,8 +5399,7 @@ const CustomElementHook = {
5307
5399
  createVM(elm, def, {
5308
5400
  mode,
5309
5401
  owner,
5310
- tagName: sel,
5311
- renderer: owner.renderer
5402
+ tagName: sel
5312
5403
  });
5313
5404
  vnode.elm = elm;
5314
5405
  const vm = getAssociatedVM(elm);
@@ -5337,12 +5428,11 @@ const CustomElementHook = {
5337
5428
 
5338
5429
  function linkNodeToShadow(elm, owner) {
5339
5430
  const {
5340
- renderer,
5341
5431
  renderMode,
5342
5432
  shadowMode
5343
5433
  } = owner; // TODO [#1164]: this should eventually be done by the polyfill directly
5344
5434
 
5345
- if (renderer.isSyntheticShadowDefined) {
5435
+ if (isSyntheticShadowDefined$1) {
5346
5436
  if (shadowMode === 1
5347
5437
  /* Synthetic */
5348
5438
  || renderMode === 0
@@ -5874,7 +5964,6 @@ function updateStylesheetToken(vm, template) {
5874
5964
  const {
5875
5965
  elm,
5876
5966
  context,
5877
- renderer,
5878
5967
  renderMode,
5879
5968
  shadowMode
5880
5969
  } = vm;
@@ -5901,11 +5990,11 @@ function updateStylesheetToken(vm, template) {
5901
5990
  } = context;
5902
5991
 
5903
5992
  if (oldHasTokenInClass) {
5904
- renderer.getClassList(elm).remove(makeHostToken(oldToken));
5993
+ getClassList$1(elm).remove(makeHostToken(oldToken));
5905
5994
  }
5906
5995
 
5907
5996
  if (oldHasTokenInAttribute) {
5908
- renderer.removeAttribute(elm, makeHostToken(oldToken));
5997
+ removeAttribute$1(elm, makeHostToken(oldToken));
5909
5998
  } // Apply the new template styling token to the host element, if the new template has any
5910
5999
  // associated stylesheets. In the case of light DOM, also ensure there is at least one scoped stylesheet.
5911
6000
 
@@ -5917,12 +6006,12 @@ function updateStylesheetToken(vm, template) {
5917
6006
 
5918
6007
  if (!isUndefined$1(newToken)) {
5919
6008
  if (hasScopedStyles) {
5920
- renderer.getClassList(elm).add(makeHostToken(newToken));
6009
+ getClassList$1(elm).add(makeHostToken(newToken));
5921
6010
  newHasTokenInClass = true;
5922
6011
  }
5923
6012
 
5924
6013
  if (isSyntheticShadow) {
5925
- renderer.setAttribute(elm, makeHostToken(newToken), '');
6014
+ setAttribute$1(elm, makeHostToken(newToken), '');
5926
6015
  newHasTokenInAttribute = true;
5927
6016
  }
5928
6017
  } // Update the styling tokens present on the context object.
@@ -6043,7 +6132,6 @@ function getNearestNativeShadowComponent(vm) {
6043
6132
 
6044
6133
  function createStylesheet(vm, stylesheets) {
6045
6134
  const {
6046
- renderer,
6047
6135
  renderMode,
6048
6136
  shadowMode
6049
6137
  } = vm;
@@ -6054,9 +6142,9 @@ function createStylesheet(vm, stylesheets) {
6054
6142
  /* Synthetic */
6055
6143
  ) {
6056
6144
  for (let i = 0; i < stylesheets.length; i++) {
6057
- renderer.insertGlobalStylesheet(stylesheets[i]);
6145
+ insertGlobalStylesheet$1(stylesheets[i]);
6058
6146
  }
6059
- } else if (renderer.ssr || renderer.isHydrating()) {
6147
+ } else if (ssr$1 || isHydrating$1()) {
6060
6148
  // Note: We need to ensure that during hydration, the stylesheets method is the same as those in ssr.
6061
6149
  // This works in the client, because the stylesheets are created, and cached in the VM
6062
6150
  // the first time the VM renders.
@@ -6070,10 +6158,10 @@ function createStylesheet(vm, stylesheets) {
6070
6158
 
6071
6159
  for (let i = 0; i < stylesheets.length; i++) {
6072
6160
  if (isGlobal) {
6073
- renderer.insertGlobalStylesheet(stylesheets[i]);
6161
+ insertGlobalStylesheet$1(stylesheets[i]);
6074
6162
  } else {
6075
6163
  // local level
6076
- renderer.insertStylesheet(stylesheets[i], root.cmpRoot);
6164
+ insertStylesheet$1(stylesheets[i], root.cmpRoot);
6077
6165
  }
6078
6166
  }
6079
6167
  }
@@ -6765,7 +6853,6 @@ function createVM(elm, def, options) {
6765
6853
  const {
6766
6854
  mode,
6767
6855
  owner,
6768
- renderer,
6769
6856
  tagName
6770
6857
  } = options;
6771
6858
  const vm = {
@@ -6780,7 +6867,6 @@ function createVM(elm, def, options) {
6780
6867
  tagName,
6781
6868
  mode,
6782
6869
  owner,
6783
- renderer,
6784
6870
  children: EmptyArray,
6785
6871
  aChildren: EmptyArray,
6786
6872
  velements: EmptyArray,
@@ -6835,16 +6921,11 @@ function createVM(elm, def, options) {
6835
6921
 
6836
6922
  function computeShadowMode(vm) {
6837
6923
  const {
6838
- def,
6839
- renderer
6924
+ def
6840
6925
  } = vm;
6841
- const {
6842
- isNativeShadowDefined,
6843
- isSyntheticShadowDefined
6844
- } = renderer;
6845
6926
  let shadowMode;
6846
6927
 
6847
- if (isSyntheticShadowDefined) {
6928
+ if (isSyntheticShadowDefined$1) {
6848
6929
  if (def.renderMode === 0
6849
6930
  /* Light */
6850
6931
  ) {
@@ -6853,7 +6934,7 @@ function computeShadowMode(vm) {
6853
6934
  shadowMode = 0
6854
6935
  /* Native */
6855
6936
  ;
6856
- } else if (isNativeShadowDefined) {
6937
+ } else if (isNativeShadowDefined$1) {
6857
6938
  if (def.shadowSupportMode === "any"
6858
6939
  /* Any */
6859
6940
  ) {
@@ -6961,7 +7042,6 @@ function patchShadowRoot(vm, newCh) {
6961
7042
  // patch function mutates vnodes by adding the element reference,
6962
7043
  // however, if patching fails it contains partial changes.
6963
7044
  if (oldCh !== newCh) {
6964
- const fn = hasDynamicChildren(newCh) ? updateDynamicChildren : updateStaticChildren;
6965
7045
  runWithBoundaryProtection(vm, vm, () => {
6966
7046
  // pre
6967
7047
  logOperationStart(2
@@ -6969,8 +7049,8 @@ function patchShadowRoot(vm, newCh) {
6969
7049
  , vm);
6970
7050
  }, () => {
6971
7051
  // job
6972
- const elementToRenderTo = getRenderRoot(vm);
6973
- fn(elementToRenderTo, oldCh, newCh);
7052
+ const renderRoot = getRenderRoot(vm);
7053
+ patchChildren(renderRoot, oldCh, newCh);
6974
7054
  }, () => {
6975
7055
  // post
6976
7056
  logOperationEnd(2
@@ -6993,13 +7073,12 @@ function patchShadowRoot(vm, newCh) {
6993
7073
 
6994
7074
  function runRenderedCallback(vm) {
6995
7075
  const {
6996
- renderer,
6997
7076
  def: {
6998
7077
  renderedCallback
6999
7078
  }
7000
7079
  } = vm;
7001
7080
 
7002
- if (isTrue(renderer.ssr)) {
7081
+ if (isTrue(ssr$1)) {
7003
7082
  return;
7004
7083
  }
7005
7084
 
@@ -7225,8 +7304,7 @@ function recursivelyDisconnectChildren(vnodes) {
7225
7304
 
7226
7305
  function resetComponentRoot(vm) {
7227
7306
  const {
7228
- children,
7229
- renderer
7307
+ children
7230
7308
  } = vm;
7231
7309
  const rootNode = getRenderRoot(vm);
7232
7310
 
@@ -7234,7 +7312,7 @@ function resetComponentRoot(vm) {
7234
7312
  const child = children[i];
7235
7313
 
7236
7314
  if (!isNull(child) && !isUndefined$1(child.elm)) {
7237
- renderer.remove(child.elm, rootNode);
7315
+ remove$1(child.elm, rootNode);
7238
7316
  }
7239
7317
  }
7240
7318
 
@@ -7244,7 +7322,7 @@ function resetComponentRoot(vm) {
7244
7322
  }
7245
7323
 
7246
7324
  function scheduleRehydration(vm) {
7247
- if (isTrue(vm.renderer.ssr) || isTrue(vm.isScheduled)) {
7325
+ if (isTrue(ssr$1) || isTrue(vm.isScheduled)) {
7248
7326
  return;
7249
7327
  }
7250
7328
 
@@ -7267,69 +7345,6 @@ function getErrorBoundaryVM(vm) {
7267
7345
 
7268
7346
  currentVm = currentVm.owner;
7269
7347
  }
7270
- } // slow path routine
7271
- // NOTE: we should probably more this routine to the synthetic shadow folder
7272
- // and get the allocation to be cached by in the elm instead of in the VM
7273
-
7274
-
7275
- function allocateInSlot(vm, children) {
7276
- const {
7277
- cmpSlots: oldSlots
7278
- } = vm;
7279
- const cmpSlots = vm.cmpSlots = create(null);
7280
-
7281
- for (let i = 0, len = children.length; i < len; i += 1) {
7282
- const vnode = children[i];
7283
-
7284
- if (isNull(vnode)) {
7285
- continue;
7286
- }
7287
-
7288
- const {
7289
- data
7290
- } = vnode;
7291
- const slotName = data.attrs && data.attrs.slot || '';
7292
- const vnodes = cmpSlots[slotName] = cmpSlots[slotName] || []; // re-keying the vnodes is necessary to avoid conflicts with default content for the slot
7293
- // which might have similar keys. Each vnode will always have a key that
7294
- // starts with a numeric character from compiler. In this case, we add a unique
7295
- // notation for slotted vnodes keys, e.g.: `@foo:1:1`
7296
-
7297
- if (!isUndefined$1(vnode.key)) {
7298
- vnode.key = `@${slotName}:${vnode.key}`;
7299
- }
7300
-
7301
- ArrayPush$1.call(vnodes, vnode);
7302
- }
7303
-
7304
- if (isFalse(vm.isDirty)) {
7305
- // We need to determine if the old allocation is really different from the new one
7306
- // and mark the vm as dirty
7307
- const oldKeys = keys(oldSlots);
7308
-
7309
- if (oldKeys.length !== keys(cmpSlots).length) {
7310
- markComponentAsDirty(vm);
7311
- return;
7312
- }
7313
-
7314
- for (let i = 0, len = oldKeys.length; i < len; i += 1) {
7315
- const key = oldKeys[i];
7316
-
7317
- if (isUndefined$1(cmpSlots[key]) || oldSlots[key].length !== cmpSlots[key].length) {
7318
- markComponentAsDirty(vm);
7319
- return;
7320
- }
7321
-
7322
- const oldVNodes = oldSlots[key];
7323
- const vnodes = cmpSlots[key];
7324
-
7325
- for (let j = 0, a = cmpSlots[key].length; j < a; j += 1) {
7326
- if (oldVNodes[j] !== vnodes[j]) {
7327
- markComponentAsDirty(vm);
7328
- return;
7329
- }
7330
- }
7331
- }
7332
- }
7333
7348
  }
7334
7349
 
7335
7350
  function runWithBoundaryProtection(vm, owner, pre, job, post) {
@@ -7489,7 +7504,6 @@ function createContextWatcher(vm, wireDef, callbackWhenContextIsReady) {
7489
7504
 
7490
7505
  const {
7491
7506
  elm,
7492
- renderer,
7493
7507
  context: {
7494
7508
  wiredConnecting,
7495
7509
  wiredDisconnecting
@@ -7516,7 +7530,7 @@ function createContextWatcher(vm, wireDef, callbackWhenContextIsReady) {
7516
7530
  }
7517
7531
 
7518
7532
  });
7519
- renderer.dispatchEvent(elm, contextRegistrationEvent);
7533
+ dispatchEvent$1(elm, contextRegistrationEvent);
7520
7534
  });
7521
7535
  }
7522
7536
 
@@ -7781,7 +7795,7 @@ function setHooks(hooks) {
7781
7795
  hooksAreSet = true;
7782
7796
  setSanitizeHtmlContentHook(hooks.sanitizeHtmlContent);
7783
7797
  }
7784
- /* version: 2.6.2 */
7798
+ /* version: 2.7.3 */
7785
7799
 
7786
7800
  /*
7787
7801
  * Copyright (c) 2018, salesforce.com, inc.
@@ -7810,7 +7824,9 @@ const supportsConstructableStyleSheets = isFunction$1(CSSStyleSheet.prototype.re
7810
7824
  const styleElements = create(null);
7811
7825
  const styleSheets = create(null);
7812
7826
  const nodesToStyleSheets = new WeakMap();
7813
- let getCustomElement, defineCustomElement, HTMLElementConstructor;
7827
+ let getCustomElement;
7828
+ let defineCustomElement;
7829
+ let HTMLElementConstructor;
7814
7830
 
7815
7831
  function isCustomElementRegistryAvailable() {
7816
7832
  if (typeof customElements === 'undefined') {
@@ -7925,188 +7941,231 @@ if (isCustomElementRegistryAvailable()) {
7925
7941
  HTMLElementConstructor.prototype = HTMLElement.prototype;
7926
7942
  }
7927
7943
 
7928
- let isHydrating = false;
7944
+ let hydrating = false;
7929
7945
 
7930
- function setIsHydrating(v) {
7931
- isHydrating = v;
7946
+ function setIsHydrating(value) {
7947
+ hydrating = value;
7932
7948
  }
7933
7949
 
7934
- const renderer = {
7935
- ssr: false,
7950
+ const ssr = false;
7936
7951
 
7937
- isHydrating() {
7938
- return isHydrating;
7939
- },
7952
+ function isHydrating() {
7953
+ return hydrating;
7954
+ }
7940
7955
 
7941
- isNativeShadowDefined: _globalThis[KEY__IS_NATIVE_SHADOW_ROOT_DEFINED],
7942
- isSyntheticShadowDefined: hasOwnProperty$1.call(Element.prototype, KEY__SHADOW_TOKEN),
7956
+ const isNativeShadowDefined = _globalThis[KEY__IS_NATIVE_SHADOW_ROOT_DEFINED];
7957
+ const isSyntheticShadowDefined = hasOwnProperty$1.call(Element.prototype, KEY__SHADOW_TOKEN);
7943
7958
 
7944
- createElement(tagName, namespace) {
7945
- return isUndefined$1(namespace) ? document.createElement(tagName) : document.createElementNS(namespace, tagName);
7946
- },
7959
+ function createElement$1(tagName, namespace) {
7960
+ return isUndefined$1(namespace) ? document.createElement(tagName) : document.createElementNS(namespace, tagName);
7961
+ }
7947
7962
 
7948
- createText(content) {
7949
- return document.createTextNode(content);
7950
- },
7963
+ function createText(content) {
7964
+ return document.createTextNode(content);
7965
+ }
7951
7966
 
7952
- createComment(content) {
7953
- return document.createComment(content);
7954
- },
7967
+ function createComment(content) {
7968
+ return document.createComment(content);
7969
+ }
7955
7970
 
7956
- insert(node, parent, anchor) {
7957
- parent.insertBefore(node, anchor);
7958
- },
7971
+ function insert(node, parent, anchor) {
7972
+ parent.insertBefore(node, anchor);
7973
+ }
7959
7974
 
7960
- remove(node, parent) {
7961
- parent.removeChild(node);
7962
- },
7975
+ function remove(node, parent) {
7976
+ parent.removeChild(node);
7977
+ }
7963
7978
 
7964
- nextSibling(node) {
7965
- return node.nextSibling;
7966
- },
7979
+ function nextSibling(node) {
7980
+ return node.nextSibling;
7981
+ }
7967
7982
 
7968
- attachShadow(element, options) {
7969
- if (isHydrating) {
7970
- return element.shadowRoot;
7971
- }
7983
+ function attachShadow(element, options) {
7984
+ if (hydrating) {
7985
+ return element.shadowRoot;
7986
+ }
7972
7987
 
7973
- return element.attachShadow(options);
7974
- },
7988
+ return element.attachShadow(options);
7989
+ }
7975
7990
 
7976
- setText(node, content) {
7977
- node.nodeValue = content;
7978
- },
7991
+ function setText(node, content) {
7992
+ node.nodeValue = content;
7993
+ }
7979
7994
 
7980
- getProperty(node, key) {
7981
- return node[key];
7982
- },
7995
+ function getProperty(node, key) {
7996
+ return node[key];
7997
+ }
7983
7998
 
7984
- setProperty(node, key, value) {
7985
- if (process.env.NODE_ENV !== 'production') {
7986
- if (node instanceof Element && !(key in node)) {
7987
- // TODO [#1297]: Move this validation to the compiler
7988
- assert.fail(`Unknown public property "${key}" of element <${node.tagName}>. This is likely a typo on the corresponding attribute "${htmlPropertyToAttribute(key)}".`);
7989
- }
7999
+ function setProperty(node, key, value) {
8000
+ if (process.env.NODE_ENV !== 'production') {
8001
+ if (node instanceof Element && !(key in node)) {
8002
+ // TODO [#1297]: Move this validation to the compiler
8003
+ assert.fail(`Unknown public property "${key}" of element <${node.tagName}>. This is likely a typo on the corresponding attribute "${htmlPropertyToAttribute(key)}".`);
7990
8004
  }
8005
+ }
7991
8006
 
7992
- node[key] = value;
7993
- },
8007
+ node[key] = value;
8008
+ }
7994
8009
 
7995
- getAttribute(element, name, namespace) {
7996
- return isUndefined$1(namespace) ? element.getAttribute(name) : element.getAttributeNS(namespace, name);
7997
- },
8010
+ function getAttribute(element, name, namespace) {
8011
+ return isUndefined$1(namespace) ? element.getAttribute(name) : element.getAttributeNS(namespace, name);
8012
+ }
7998
8013
 
7999
- setAttribute(element, name, value, namespace) {
8000
- return isUndefined$1(namespace) ? element.setAttribute(name, value) : element.setAttributeNS(namespace, name, value);
8001
- },
8014
+ function setAttribute(element, name, value, namespace) {
8015
+ return isUndefined$1(namespace) ? element.setAttribute(name, value) : element.setAttributeNS(namespace, name, value);
8016
+ }
8002
8017
 
8003
- removeAttribute(element, name, namespace) {
8004
- if (isUndefined$1(namespace)) {
8005
- element.removeAttribute(name);
8006
- } else {
8007
- element.removeAttributeNS(namespace, name);
8008
- }
8009
- },
8018
+ function removeAttribute(element, name, namespace) {
8019
+ if (isUndefined$1(namespace)) {
8020
+ element.removeAttribute(name);
8021
+ } else {
8022
+ element.removeAttributeNS(namespace, name);
8023
+ }
8024
+ }
8010
8025
 
8011
- addEventListener(target, type, callback, options) {
8012
- target.addEventListener(type, callback, options);
8013
- },
8026
+ function addEventListener(target, type, callback, options) {
8027
+ target.addEventListener(type, callback, options);
8028
+ }
8014
8029
 
8015
- removeEventListener(target, type, callback, options) {
8016
- target.removeEventListener(type, callback, options);
8017
- },
8030
+ function removeEventListener(target, type, callback, options) {
8031
+ target.removeEventListener(type, callback, options);
8032
+ }
8018
8033
 
8019
- dispatchEvent(target, event) {
8020
- return target.dispatchEvent(event);
8021
- },
8034
+ function dispatchEvent(target, event) {
8035
+ return target.dispatchEvent(event);
8036
+ }
8022
8037
 
8023
- getClassList(element) {
8024
- return element.classList;
8025
- },
8038
+ function getClassList(element) {
8039
+ return element.classList;
8040
+ }
8026
8041
 
8027
- setCSSStyleProperty(element, name, value, important) {
8028
- // TODO [#0]: How to avoid this type casting? Shall we use a different type interface to
8029
- // represent elements in the engine?
8030
- element.style.setProperty(name, value, important ? 'important' : '');
8031
- },
8042
+ function setCSSStyleProperty(element, name, value, important) {
8043
+ // TODO [#0]: How to avoid this type casting? Shall we use a different type interface to
8044
+ // represent elements in the engine?
8045
+ element.style.setProperty(name, value, important ? 'important' : '');
8046
+ }
8032
8047
 
8033
- getBoundingClientRect(element) {
8034
- return element.getBoundingClientRect();
8035
- },
8048
+ function getBoundingClientRect(element) {
8049
+ return element.getBoundingClientRect();
8050
+ }
8036
8051
 
8037
- querySelector(element, selectors) {
8038
- return element.querySelector(selectors);
8039
- },
8052
+ function querySelector(element, selectors) {
8053
+ return element.querySelector(selectors);
8054
+ }
8040
8055
 
8041
- querySelectorAll(element, selectors) {
8042
- return element.querySelectorAll(selectors);
8043
- },
8056
+ function querySelectorAll(element, selectors) {
8057
+ return element.querySelectorAll(selectors);
8058
+ }
8044
8059
 
8045
- getElementsByTagName(element, tagNameOrWildCard) {
8046
- return element.getElementsByTagName(tagNameOrWildCard);
8047
- },
8060
+ function getElementsByTagName(element, tagNameOrWildCard) {
8061
+ return element.getElementsByTagName(tagNameOrWildCard);
8062
+ }
8048
8063
 
8049
- getElementsByClassName(element, names) {
8050
- return element.getElementsByClassName(names);
8051
- },
8064
+ function getElementsByClassName(element, names) {
8065
+ return element.getElementsByClassName(names);
8066
+ }
8052
8067
 
8053
- getChildren(element) {
8054
- return element.children;
8055
- },
8068
+ function getChildren(element) {
8069
+ return element.children;
8070
+ }
8056
8071
 
8057
- getChildNodes(element) {
8058
- return element.childNodes;
8059
- },
8072
+ function getChildNodes(element) {
8073
+ return element.childNodes;
8074
+ }
8060
8075
 
8061
- getFirstChild(element) {
8062
- return element.firstChild;
8063
- },
8076
+ function getFirstChild(element) {
8077
+ return element.firstChild;
8078
+ }
8064
8079
 
8065
- getFirstElementChild(element) {
8066
- return element.firstElementChild;
8067
- },
8080
+ function getFirstElementChild(element) {
8081
+ return element.firstElementChild;
8082
+ }
8068
8083
 
8069
- getLastChild(element) {
8070
- return element.lastChild;
8071
- },
8084
+ function getLastChild(element) {
8085
+ return element.lastChild;
8086
+ }
8072
8087
 
8073
- getLastElementChild(element) {
8074
- return element.lastElementChild;
8075
- },
8088
+ function getLastElementChild(element) {
8089
+ return element.lastElementChild;
8090
+ }
8076
8091
 
8077
- isConnected(node) {
8078
- return node.isConnected;
8079
- },
8092
+ function isConnected(node) {
8093
+ return node.isConnected;
8094
+ }
8080
8095
 
8081
- insertGlobalStylesheet(content) {
8082
- if (!isUndefined$1(globalStylesheets[content])) {
8083
- return;
8084
- }
8096
+ function insertGlobalStylesheet(content) {
8097
+ if (!isUndefined$1(globalStylesheets[content])) {
8098
+ return;
8099
+ }
8085
8100
 
8086
- globalStylesheets[content] = true;
8087
- const elm = document.createElement('style');
8088
- elm.type = 'text/css';
8089
- elm.textContent = content;
8090
- globalStylesheetsParentElement.appendChild(elm);
8091
- },
8101
+ globalStylesheets[content] = true;
8102
+ const elm = document.createElement('style');
8103
+ elm.type = 'text/css';
8104
+ elm.textContent = content;
8105
+ globalStylesheetsParentElement.appendChild(elm);
8106
+ }
8092
8107
 
8093
- insertStylesheet(content, target) {
8094
- if (supportsConstructableStyleSheets) {
8095
- insertConstructableStyleSheet(content, target);
8096
- } else {
8097
- // Fall back to <style> element
8098
- insertStyleElement(content, target);
8099
- }
8100
- },
8108
+ function insertStylesheet(content, target) {
8109
+ if (supportsConstructableStyleSheets) {
8110
+ insertConstructableStyleSheet(content, target);
8111
+ } else {
8112
+ // Fall back to <style> element
8113
+ insertStyleElement(content, target);
8114
+ }
8115
+ }
8101
8116
 
8102
- assertInstanceOfHTMLElement(elm, msg) {
8103
- assert.invariant(elm instanceof HTMLElement, msg);
8104
- },
8117
+ function assertInstanceOfHTMLElement(elm, msg) {
8118
+ assert.invariant(elm instanceof HTMLElement, msg);
8119
+ }
8105
8120
 
8106
- defineCustomElement,
8107
- getCustomElement,
8108
- HTMLElement: HTMLElementConstructor
8109
- };
8121
+ const HTMLElementExported = HTMLElementConstructor;
8122
+ /*
8123
+ * Copyright (c) 2020, salesforce.com, inc.
8124
+ * All rights reserved.
8125
+ * SPDX-License-Identifier: MIT
8126
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
8127
+ */
8128
+
8129
+ setAssertInstanceOfHTMLElement(assertInstanceOfHTMLElement);
8130
+ setAttachShadow(attachShadow);
8131
+ setCreateComment(createComment);
8132
+ setCreateElement(createElement$1);
8133
+ setCreateText(createText);
8134
+ setDefineCustomElement(defineCustomElement);
8135
+ setDispatchEvent(dispatchEvent);
8136
+ setGetAttribute(getAttribute);
8137
+ setGetBoundingClientRect(getBoundingClientRect);
8138
+ setGetChildNodes(getChildNodes);
8139
+ setGetChildren(getChildren);
8140
+ setGetClassList(getClassList);
8141
+ setGetCustomElement(getCustomElement);
8142
+ setGetElementsByClassName(getElementsByClassName);
8143
+ setGetElementsByTagName(getElementsByTagName);
8144
+ setGetFirstChild(getFirstChild);
8145
+ setGetFirstElementChild(getFirstElementChild);
8146
+ setGetLastChild(getLastChild);
8147
+ setGetLastElementChild(getLastElementChild);
8148
+ setGetProperty(getProperty);
8149
+ setHTMLElement(HTMLElementExported);
8150
+ setInsert(insert);
8151
+ setInsertGlobalStylesheet(insertGlobalStylesheet);
8152
+ setInsertStylesheet(insertStylesheet);
8153
+ setIsConnected(isConnected);
8154
+ setIsHydrating$1(isHydrating);
8155
+ setIsNativeShadowDefined(isNativeShadowDefined);
8156
+ setIsSyntheticShadowDefined(isSyntheticShadowDefined);
8157
+ setNextSibling(nextSibling);
8158
+ setQuerySelector(querySelector);
8159
+ setQuerySelectorAll(querySelectorAll);
8160
+ setRemove(remove);
8161
+ setRemoveAttribute(removeAttribute);
8162
+ setRemoveEventListener(removeEventListener);
8163
+ setSetAttribute(setAttribute);
8164
+ setSetCSSStyleProperty(setCSSStyleProperty);
8165
+ setSetProperty(setProperty);
8166
+ setSetText(setText);
8167
+ setSsr(ssr);
8168
+ setAddEventListener(addEventListener);
8110
8169
  /*
8111
8170
  * Copyright (c) 2018, salesforce.com, inc.
8112
8171
  * All rights reserved.
@@ -8189,7 +8248,7 @@ function createElement(sel, options) {
8189
8248
  throw new TypeError(`"createElement" function expects an "is" option with a valid component constructor.`);
8190
8249
  }
8191
8250
 
8192
- const UpgradableConstructor = getUpgradableConstructor(sel, renderer);
8251
+ const UpgradableConstructor = getUpgradableConstructor(sel);
8193
8252
  let wasComponentUpgraded = false; // the custom element from the registry is expecting an upgrade callback
8194
8253
 
8195
8254
  /**
@@ -8204,8 +8263,7 @@ function createElement(sel, options) {
8204
8263
  createVM(elm, def, {
8205
8264
  tagName: sel,
8206
8265
  mode: options.mode !== 'closed' ? 'open' : 'closed',
8207
- owner: null,
8208
- renderer
8266
+ owner: null
8209
8267
  });
8210
8268
  ConnectingSlot.set(elm, connectRootElement);
8211
8269
  DisconnectingSlot.set(elm, disconnectRootElement);
@@ -8228,6 +8286,10 @@ function createElement(sel, options) {
8228
8286
 
8229
8287
 
8230
8288
  function hydrateComponent(element, Ctor, props = {}) {
8289
+ if (!(element instanceof Element)) {
8290
+ throw new TypeError(`"hydrateComponent" expects a valid DOM element as the first parameter but instead received ${element}.`);
8291
+ }
8292
+
8231
8293
  if (!isFunction$1(Ctor)) {
8232
8294
  throw new TypeError(`"hydrateComponent" expects a valid component constructor as the second parameter but instead received ${Ctor}.`);
8233
8295
  }
@@ -8245,7 +8307,6 @@ function hydrateComponent(element, Ctor, props = {}) {
8245
8307
  createVM(element, def, {
8246
8308
  mode: 'open',
8247
8309
  owner: null,
8248
- renderer,
8249
8310
  tagName: element.tagName.toLowerCase()
8250
8311
  });
8251
8312
 
@@ -8316,8 +8377,7 @@ function buildCustomElementConstructor(Ctor) {
8316
8377
  createVM(this, def, {
8317
8378
  mode: 'open',
8318
8379
  owner: null,
8319
- tagName: this.tagName,
8320
- renderer
8380
+ tagName: this.tagName
8321
8381
  });
8322
8382
  }
8323
8383
 
@@ -8384,7 +8444,7 @@ function isNodeFromTemplate(node) {
8384
8444
  return false;
8385
8445
  }
8386
8446
 
8387
- if (renderer.isSyntheticShadowDefined) {
8447
+ if (isSyntheticShadowDefined) {
8388
8448
  // TODO [#1252]: old behavior that is still used by some pieces of the platform,
8389
8449
  // specifically, nodes inserted manually on places where `lwc:dom="manual"` directive is not
8390
8450
  // used, will be considered global elements.
@@ -8437,6 +8497,6 @@ defineProperty(LightningElement, 'CustomElementConstructor', {
8437
8497
  });
8438
8498
  freeze(LightningElement);
8439
8499
  seal(LightningElement.prototype);
8440
- /* version: 2.6.2 */
8500
+ /* version: 2.7.3 */
8441
8501
 
8442
8502
  export { LightningElement, profilerControl as __unstable__ProfilerControl, api$1 as api, deprecatedBuildCustomElementConstructor as buildCustomElementConstructor, createContextProvider, createElement, getComponentConstructor, getComponentDef, hydrateComponent, isComponentConstructor, isNodeFromTemplate, readonly, register, registerComponent, registerDecorators, registerTemplate, sanitizeAttribute, setFeatureFlag, setFeatureFlagForTest, setHooks, swapComponent, swapStyle, swapTemplate, track, unwrap, wire };