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
@@ -305,7 +305,7 @@
305
305
  CACHED_PROPERTY_ATTRIBUTE_MAPPING.set(propName, attributeName);
306
306
  return attributeName;
307
307
  }
308
- /** version: 2.6.2 */
308
+ /** version: 2.7.3 */
309
309
 
310
310
  /*
311
311
  * Copyright (c) 2018, salesforce.com, inc.
@@ -419,7 +419,6 @@
419
419
  ENABLE_NODE_LIST_PATCH: null,
420
420
  ENABLE_HTML_COLLECTIONS_PATCH: null,
421
421
  ENABLE_NODE_PATCH: null,
422
- ENABLE_MIXED_SHADOW_MODE: null,
423
422
  ENABLE_WIRE_SYNC_EMIT: null
424
423
  };
425
424
 
@@ -484,7 +483,7 @@
484
483
  setFeatureFlag(name, value);
485
484
  }
486
485
  }
487
- /** version: 2.6.2 */
486
+ /** version: 2.7.3 */
488
487
 
489
488
  /* proxy-compat-disable */
490
489
 
@@ -558,6 +557,249 @@
558
557
  }
559
558
 
560
559
  return styleMap;
560
+ } //
561
+ // Primitives
562
+ //
563
+
564
+
565
+ let ssr$1;
566
+
567
+ function setSsr(ssrImpl) {
568
+ ssr$1 = ssrImpl;
569
+ }
570
+
571
+ let isNativeShadowDefined$1;
572
+
573
+ function setIsNativeShadowDefined(isNativeShadowDefinedImpl) {
574
+ isNativeShadowDefined$1 = isNativeShadowDefinedImpl;
575
+ }
576
+
577
+ let isSyntheticShadowDefined$1;
578
+
579
+ function setIsSyntheticShadowDefined(isSyntheticShadowDefinedImpl) {
580
+ isSyntheticShadowDefined$1 = isSyntheticShadowDefinedImpl;
581
+ }
582
+
583
+ let HTMLElementExported$1;
584
+
585
+ function setHTMLElement(HTMLElementImpl) {
586
+ HTMLElementExported$1 = HTMLElementImpl;
587
+ }
588
+
589
+ let isHydrating$1;
590
+
591
+ function setIsHydrating$1(isHydratingImpl) {
592
+ isHydrating$1 = isHydratingImpl;
593
+ }
594
+
595
+ let insert$1;
596
+
597
+ function setInsert(insertImpl) {
598
+ insert$1 = insertImpl;
599
+ }
600
+
601
+ let remove$1;
602
+
603
+ function setRemove(removeImpl) {
604
+ remove$1 = removeImpl;
605
+ }
606
+
607
+ let createElement$2;
608
+
609
+ function setCreateElement(createElementImpl) {
610
+ createElement$2 = createElementImpl;
611
+ }
612
+
613
+ let createText$1;
614
+
615
+ function setCreateText(createTextImpl) {
616
+ createText$1 = createTextImpl;
617
+ }
618
+
619
+ let createComment$1;
620
+
621
+ function setCreateComment(createCommentImpl) {
622
+ createComment$1 = createCommentImpl;
623
+ }
624
+
625
+ let nextSibling$1;
626
+
627
+ function setNextSibling(nextSiblingImpl) {
628
+ nextSibling$1 = nextSiblingImpl;
629
+ }
630
+
631
+ let attachShadow$1;
632
+
633
+ function setAttachShadow(attachShadowImpl) {
634
+ attachShadow$1 = attachShadowImpl;
635
+ }
636
+
637
+ let getProperty$1;
638
+
639
+ function setGetProperty(getPropertyImpl) {
640
+ getProperty$1 = getPropertyImpl;
641
+ }
642
+
643
+ let setProperty$1;
644
+
645
+ function setSetProperty(setPropertyImpl) {
646
+ setProperty$1 = setPropertyImpl;
647
+ }
648
+
649
+ let setText$1;
650
+
651
+ function setSetText(setTextImpl) {
652
+ setText$1 = setTextImpl;
653
+ }
654
+
655
+ let getAttribute$1;
656
+
657
+ function setGetAttribute(getAttributeImpl) {
658
+ getAttribute$1 = getAttributeImpl;
659
+ }
660
+
661
+ let setAttribute$1;
662
+
663
+ function setSetAttribute(setAttributeImpl) {
664
+ setAttribute$1 = setAttributeImpl;
665
+ }
666
+
667
+ let removeAttribute$1;
668
+
669
+ function setRemoveAttribute(removeAttributeImpl) {
670
+ removeAttribute$1 = removeAttributeImpl;
671
+ }
672
+
673
+ let addEventListener$1;
674
+
675
+ function setAddEventListener(addEventListenerImpl) {
676
+ addEventListener$1 = addEventListenerImpl;
677
+ }
678
+
679
+ let removeEventListener$1;
680
+
681
+ function setRemoveEventListener(removeEventListenerImpl) {
682
+ removeEventListener$1 = removeEventListenerImpl;
683
+ }
684
+
685
+ let dispatchEvent$1;
686
+
687
+ function setDispatchEvent(dispatchEventImpl) {
688
+ dispatchEvent$1 = dispatchEventImpl;
689
+ }
690
+
691
+ let getClassList$1;
692
+
693
+ function setGetClassList(getClassListImpl) {
694
+ getClassList$1 = getClassListImpl;
695
+ }
696
+
697
+ let setCSSStyleProperty$1;
698
+
699
+ function setSetCSSStyleProperty(setCSSStylePropertyImpl) {
700
+ setCSSStyleProperty$1 = setCSSStylePropertyImpl;
701
+ }
702
+
703
+ let getBoundingClientRect$1;
704
+
705
+ function setGetBoundingClientRect(getBoundingClientRectImpl) {
706
+ getBoundingClientRect$1 = getBoundingClientRectImpl;
707
+ }
708
+
709
+ let querySelector$1;
710
+
711
+ function setQuerySelector(querySelectorImpl) {
712
+ querySelector$1 = querySelectorImpl;
713
+ }
714
+
715
+ let querySelectorAll$1;
716
+
717
+ function setQuerySelectorAll(querySelectorAllImpl) {
718
+ querySelectorAll$1 = querySelectorAllImpl;
719
+ }
720
+
721
+ let getElementsByTagName$1;
722
+
723
+ function setGetElementsByTagName(getElementsByTagNameImpl) {
724
+ getElementsByTagName$1 = getElementsByTagNameImpl;
725
+ }
726
+
727
+ let getElementsByClassName$1;
728
+
729
+ function setGetElementsByClassName(getElementsByClassNameImpl) {
730
+ getElementsByClassName$1 = getElementsByClassNameImpl;
731
+ }
732
+
733
+ let getChildren$1;
734
+
735
+ function setGetChildren(getChildrenImpl) {
736
+ getChildren$1 = getChildrenImpl;
737
+ }
738
+
739
+ let getChildNodes$1;
740
+
741
+ function setGetChildNodes(getChildNodesImpl) {
742
+ getChildNodes$1 = getChildNodesImpl;
743
+ }
744
+
745
+ let getFirstChild$1;
746
+
747
+ function setGetFirstChild(getFirstChildImpl) {
748
+ getFirstChild$1 = getFirstChildImpl;
749
+ }
750
+
751
+ let getFirstElementChild$1;
752
+
753
+ function setGetFirstElementChild(getFirstElementChildImpl) {
754
+ getFirstElementChild$1 = getFirstElementChildImpl;
755
+ }
756
+
757
+ let getLastChild$1;
758
+
759
+ function setGetLastChild(getLastChildImpl) {
760
+ getLastChild$1 = getLastChildImpl;
761
+ }
762
+
763
+ let getLastElementChild$1;
764
+
765
+ function setGetLastElementChild(getLastElementChildImpl) {
766
+ getLastElementChild$1 = getLastElementChildImpl;
767
+ }
768
+
769
+ let isConnected$1;
770
+
771
+ function setIsConnected(isConnectedImpl) {
772
+ isConnected$1 = isConnectedImpl;
773
+ }
774
+
775
+ let insertGlobalStylesheet$1;
776
+
777
+ function setInsertGlobalStylesheet(insertGlobalStylesheetImpl) {
778
+ insertGlobalStylesheet$1 = insertGlobalStylesheetImpl;
779
+ }
780
+
781
+ let insertStylesheet$1;
782
+
783
+ function setInsertStylesheet(insertStylesheetImpl) {
784
+ insertStylesheet$1 = insertStylesheetImpl;
785
+ }
786
+
787
+ let assertInstanceOfHTMLElement$1;
788
+
789
+ function setAssertInstanceOfHTMLElement(assertInstanceOfHTMLElementImpl) {
790
+ assertInstanceOfHTMLElement$1 = assertInstanceOfHTMLElementImpl;
791
+ }
792
+
793
+ let defineCustomElement$1;
794
+
795
+ function setDefineCustomElement(defineCustomElementImpl) {
796
+ defineCustomElement$1 = defineCustomElementImpl;
797
+ }
798
+
799
+ let getCustomElement$1;
800
+
801
+ function setGetCustomElement(getCustomElementImpl) {
802
+ getCustomElement$1 = getCustomElementImpl;
561
803
  }
562
804
  /*
563
805
  * Copyright (c) 2019, salesforce.com, inc.
@@ -680,619 +922,93 @@
680
922
 
681
923
  }
682
924
  /*
683
- * Copyright (c) 2018, salesforce.com, inc.
684
- * All rights reserved.
685
- * SPDX-License-Identifier: MIT
686
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
687
- */
688
-
689
-
690
- function componentValueMutated(vm, key) {
691
- valueMutated(vm.component, key);
692
- }
693
-
694
- function componentValueObserved(vm, key) {
695
- valueObserved(vm.component, key);
696
- }
697
- /*
698
- * Copyright (c) 2018, salesforce.com, inc.
699
- * All rights reserved.
700
- * SPDX-License-Identifier: MIT
701
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
702
- */
703
-
704
-
705
- function getComponentTag(vm) {
706
- return `<${StringToLowerCase.call(vm.tagName)}>`;
707
- } // TODO [#1695]: Unify getComponentStack and getErrorComponentStack
708
-
709
-
710
- function getComponentStack(vm) {
711
- const stack = [];
712
- let prefix = '';
713
-
714
- while (!isNull(vm.owner)) {
715
- ArrayPush$1.call(stack, prefix + getComponentTag(vm));
716
- vm = vm.owner;
717
- prefix += '\t';
718
- }
719
-
720
- return ArrayJoin.call(stack, '\n');
721
- }
722
-
723
- function getErrorComponentStack(vm) {
724
- const wcStack = [];
725
- let currentVm = vm;
726
-
727
- while (!isNull(currentVm)) {
728
- ArrayPush$1.call(wcStack, getComponentTag(currentVm));
729
- currentVm = currentVm.owner;
730
- }
731
-
732
- return wcStack.reverse().join('\n\t');
733
- }
734
- /*
735
- * Copyright (c) 2018, salesforce.com, inc.
736
- * All rights reserved.
737
- * SPDX-License-Identifier: MIT
738
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
739
- */
740
-
741
-
742
- function log(method, message, vm) {
743
- let msg = `[LWC ${method}]: ${message}`;
744
-
745
- if (!isUndefined$1(vm)) {
746
- msg = `${msg}\n${getComponentStack(vm)}`;
747
- }
748
-
749
- if (process.env.NODE_ENV === 'test') {
750
- /* eslint-disable-next-line no-console */
751
- console[method](msg);
752
- return;
753
- }
754
-
755
- try {
756
- throw new Error(msg);
757
- } catch (e) {
758
- /* eslint-disable-next-line no-console */
759
- console[method](e);
760
- }
761
- }
762
-
763
- function logError(message, vm) {
764
- log('error', message, vm);
765
- }
766
-
767
- function logWarn(message, vm) {
768
- log('warn', message, vm);
769
- }
770
- /*
771
- * Copyright (c) 2018, salesforce.com, inc.
772
- * All rights reserved.
773
- * SPDX-License-Identifier: MIT
774
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
775
- */
776
-
777
-
778
- function handleEvent(event, vnode) {
779
- const {
780
- type
781
- } = event;
782
- const {
783
- data: {
784
- on
785
- }
786
- } = vnode;
787
- const handler = on && on[type]; // call event handler if exists
788
-
789
- if (handler) {
790
- handler.call(undefined, event);
791
- }
792
- }
793
-
794
- function createListener() {
795
- return function handler(event) {
796
- handleEvent(event, handler.vnode);
797
- };
798
- }
799
-
800
- function updateAllEventListeners(oldVnode, vnode) {
801
- if (isUndefined$1(oldVnode.listener)) {
802
- createAllEventListeners(vnode);
803
- } else {
804
- vnode.listener = oldVnode.listener;
805
- vnode.listener.vnode = vnode;
806
- }
807
- }
808
-
809
- function createAllEventListeners(vnode) {
810
- const {
811
- elm,
812
- data: {
813
- on
814
- },
815
- owner: {
816
- renderer
817
- }
818
- } = vnode;
819
-
820
- if (isUndefined$1(on)) {
821
- return;
822
- }
823
-
824
- const listener = vnode.listener = createListener();
825
- listener.vnode = vnode;
826
- let name;
827
-
828
- for (name in on) {
829
- renderer.addEventListener(elm, name, listener);
830
- }
831
- }
832
-
833
- var modEvents = {
834
- update: updateAllEventListeners,
835
- create: createAllEventListeners
836
- };
837
- /*
838
- * Copyright (c) 2018, salesforce.com, inc.
839
- * All rights reserved.
840
- * SPDX-License-Identifier: MIT
841
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
842
- */
843
-
844
- const defaultDefHTMLPropertyNames = ['accessKey', 'dir', 'draggable', 'hidden', 'id', 'lang', 'spellcheck', 'tabIndex', 'title'];
845
-
846
- function offsetPropertyErrorMessage(name) {
847
- 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.`;
848
- } // Global HTML Attributes & Properties
849
- // https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes
850
- // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement
851
-
852
-
853
- const globalHTMLProperties = assign(create(null), {
854
- accessKey: {
855
- attribute: 'accesskey'
856
- },
857
- accessKeyLabel: {
858
- readOnly: true
859
- },
860
- className: {
861
- attribute: 'class',
862
- 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.'
863
- },
864
- contentEditable: {
865
- attribute: 'contenteditable'
866
- },
867
- dataset: {
868
- readOnly: true,
869
- 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."
870
- },
871
- dir: {
872
- attribute: 'dir'
873
- },
874
- draggable: {
875
- attribute: 'draggable'
876
- },
877
- dropzone: {
878
- attribute: 'dropzone',
879
- readOnly: true
880
- },
881
- hidden: {
882
- attribute: 'hidden'
883
- },
884
- id: {
885
- attribute: 'id'
886
- },
887
- inputMode: {
888
- attribute: 'inputmode'
889
- },
890
- lang: {
891
- attribute: 'lang'
892
- },
893
- slot: {
894
- attribute: 'slot',
895
- error: 'Using the `slot` property is an anti-pattern.'
896
- },
897
- spellcheck: {
898
- attribute: 'spellcheck'
899
- },
900
- style: {
901
- attribute: 'style'
902
- },
903
- tabIndex: {
904
- attribute: 'tabindex'
905
- },
906
- title: {
907
- attribute: 'title'
908
- },
909
- translate: {
910
- attribute: 'translate'
911
- },
912
- // additional "global attributes" that are not present in the link above.
913
- isContentEditable: {
914
- readOnly: true
915
- },
916
- offsetHeight: {
917
- readOnly: true,
918
- error: offsetPropertyErrorMessage('offsetHeight')
919
- },
920
- offsetLeft: {
921
- readOnly: true,
922
- error: offsetPropertyErrorMessage('offsetLeft')
923
- },
924
- offsetParent: {
925
- readOnly: true
926
- },
927
- offsetTop: {
928
- readOnly: true,
929
- error: offsetPropertyErrorMessage('offsetTop')
930
- },
931
- offsetWidth: {
932
- readOnly: true,
933
- error: offsetPropertyErrorMessage('offsetWidth')
934
- },
935
- role: {
936
- attribute: 'role'
937
- }
938
- });
939
- let controlledElement = null;
940
- let controlledAttributeName;
941
-
942
- function isAttributeLocked(elm, attrName) {
943
- return elm !== controlledElement || attrName !== controlledAttributeName;
944
- }
945
-
946
- function lockAttribute(_elm, _key) {
947
- controlledElement = null;
948
- controlledAttributeName = undefined;
949
- }
950
-
951
- function unlockAttribute(elm, key) {
952
- controlledElement = elm;
953
- controlledAttributeName = key;
954
- }
955
- /*
956
- * Copyright (c) 2018, salesforce.com, inc.
957
- * All rights reserved.
958
- * SPDX-License-Identifier: MIT
959
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
960
- */
961
-
962
-
963
- const xlinkNS = 'http://www.w3.org/1999/xlink';
964
- const xmlNS = 'http://www.w3.org/XML/1998/namespace';
965
- const ColonCharCode = 58;
966
-
967
- function updateAttrs(oldVnode, vnode) {
968
- const {
969
- data: {
970
- attrs
971
- },
972
- owner: {
973
- renderer
974
- }
975
- } = vnode;
976
-
977
- if (isUndefined$1(attrs)) {
978
- return;
979
- }
980
-
981
- let {
982
- data: {
983
- attrs: oldAttrs
984
- }
985
- } = oldVnode;
986
-
987
- if (oldAttrs === attrs) {
988
- return;
989
- }
990
-
991
- if (process.env.NODE_ENV !== 'production') {
992
- assert.invariant(isUndefined$1(oldAttrs) || keys(oldAttrs).join(',') === keys(attrs).join(','), `vnode.data.attrs cannot change shape.`);
993
- }
994
-
995
- const elm = vnode.elm;
996
- const {
997
- setAttribute,
998
- removeAttribute
999
- } = renderer;
1000
- let key;
1001
- oldAttrs = isUndefined$1(oldAttrs) ? EmptyObject : oldAttrs; // update modified attributes, add new attributes
1002
- // this routine is only useful for data-* attributes in all kind of elements
1003
- // and aria-* in standard elements (custom elements will use props for these)
1004
-
1005
- for (key in attrs) {
1006
- const cur = attrs[key];
1007
- const old = oldAttrs[key];
1008
-
1009
- if (old !== cur) {
1010
- unlockAttribute(elm, key);
1011
-
1012
- if (StringCharCodeAt.call(key, 3) === ColonCharCode) {
1013
- // Assume xml namespace
1014
- setAttribute(elm, key, cur, xmlNS);
1015
- } else if (StringCharCodeAt.call(key, 5) === ColonCharCode) {
1016
- // Assume xlink namespace
1017
- setAttribute(elm, key, cur, xlinkNS);
1018
- } else if (isNull(cur)) {
1019
- removeAttribute(elm, key);
1020
- } else {
1021
- setAttribute(elm, key, cur);
1022
- }
1023
-
1024
- lockAttribute();
1025
- }
1026
- }
1027
- }
1028
-
1029
- const emptyVNode$3 = {
1030
- data: {}
1031
- };
1032
- var modAttrs = {
1033
- create: vnode => updateAttrs(emptyVNode$3, vnode),
1034
- update: updateAttrs
1035
- };
1036
- /*
1037
- * Copyright (c) 2018, salesforce.com, inc.
1038
- * All rights reserved.
1039
- * SPDX-License-Identifier: MIT
1040
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
1041
- */
1042
-
1043
- function isLiveBindingProp(sel, key) {
1044
- // For properties with live bindings, we read values from the DOM element
1045
- // instead of relying on internally tracked values.
1046
- return sel === 'input' && (key === 'value' || key === 'checked');
1047
- }
1048
-
1049
- function update(oldVnode, vnode) {
1050
- const props = vnode.data.props;
1051
-
1052
- if (isUndefined$1(props)) {
1053
- return;
1054
- }
1055
-
1056
- const oldProps = oldVnode.data.props;
1057
-
1058
- if (oldProps === props) {
1059
- return;
1060
- }
1061
-
1062
- if (process.env.NODE_ENV !== 'production') {
1063
- assert.invariant(isUndefined$1(oldProps) || keys(oldProps).join(',') === keys(props).join(','), 'vnode.data.props cannot change shape.');
1064
- }
1065
-
1066
- const isFirstPatch = isUndefined$1(oldProps);
1067
- const {
1068
- elm,
1069
- sel,
1070
- owner: {
1071
- renderer
1072
- }
1073
- } = vnode;
1074
-
1075
- for (const key in props) {
1076
- const cur = props[key]; // if it is the first time this element is patched, or the current value is different to the previous value...
1077
-
1078
- if (isFirstPatch || cur !== (isLiveBindingProp(sel, key) ? renderer.getProperty(elm, key) : oldProps[key])) {
1079
- renderer.setProperty(elm, key, cur);
1080
- }
1081
- }
1082
- }
1083
-
1084
- const emptyVNode$2 = {
1085
- data: {}
1086
- };
1087
- var modProps = {
1088
- create: vnode => update(emptyVNode$2, vnode),
1089
- update
1090
- };
1091
- /*
1092
- * Copyright (c) 2018, salesforce.com, inc.
1093
- * All rights reserved.
1094
- * SPDX-License-Identifier: MIT
1095
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
1096
- */
1097
-
1098
- const classNameToClassMap = create(null);
1099
-
1100
- function getMapFromClassName(className) {
1101
- // Intentionally using == to match undefined and null values from computed style attribute
1102
- if (className == null) {
1103
- return EmptyObject;
1104
- } // computed class names must be string
1105
-
1106
-
1107
- className = isString(className) ? className : className + '';
1108
- let map = classNameToClassMap[className];
1109
-
1110
- if (map) {
1111
- return map;
1112
- }
1113
-
1114
- map = create(null);
1115
- let start = 0;
1116
- let o;
1117
- const len = className.length;
1118
-
1119
- for (o = 0; o < len; o++) {
1120
- if (StringCharCodeAt.call(className, o) === SPACE_CHAR) {
1121
- if (o > start) {
1122
- map[StringSlice.call(className, start, o)] = true;
1123
- }
1124
-
1125
- start = o + 1;
1126
- }
1127
- }
1128
-
1129
- if (o > start) {
1130
- map[StringSlice.call(className, start, o)] = true;
1131
- }
1132
-
1133
- classNameToClassMap[className] = map;
1134
-
1135
- if (process.env.NODE_ENV !== 'production') {
1136
- // just to make sure that this object never changes as part of the diffing algo
1137
- freeze(map);
1138
- }
1139
-
1140
- return map;
1141
- }
1142
-
1143
- function updateClassAttribute(oldVnode, vnode) {
1144
- const {
1145
- elm,
1146
- data: {
1147
- className: newClass
1148
- },
1149
- owner: {
1150
- renderer
1151
- }
1152
- } = vnode;
1153
- const {
1154
- data: {
1155
- className: oldClass
1156
- }
1157
- } = oldVnode;
1158
-
1159
- if (oldClass === newClass) {
1160
- return;
1161
- }
1162
-
1163
- const classList = renderer.getClassList(elm);
1164
- const newClassMap = getMapFromClassName(newClass);
1165
- const oldClassMap = getMapFromClassName(oldClass);
1166
- let name;
1167
-
1168
- for (name in oldClassMap) {
1169
- // remove only if it is not in the new class collection and it is not set from within the instance
1170
- if (isUndefined$1(newClassMap[name])) {
1171
- classList.remove(name);
1172
- }
1173
- }
1174
-
1175
- for (name in newClassMap) {
1176
- if (isUndefined$1(oldClassMap[name])) {
1177
- classList.add(name);
1178
- }
1179
- }
1180
- }
1181
-
1182
- const emptyVNode$1 = {
1183
- data: {}
1184
- };
1185
- var modComputedClassName = {
1186
- create: vnode => updateClassAttribute(emptyVNode$1, vnode),
1187
- update: updateClassAttribute
1188
- };
1189
- /*
1190
- * Copyright (c) 2018, salesforce.com, inc.
1191
- * All rights reserved.
1192
- * SPDX-License-Identifier: MIT
1193
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
1194
- */
1195
-
1196
- function updateStyleAttribute(oldVnode, vnode) {
1197
- const {
1198
- elm,
1199
- data: {
1200
- style: newStyle
1201
- },
1202
- owner: {
1203
- renderer
1204
- }
1205
- } = vnode;
1206
- const {
1207
- setAttribute,
1208
- removeAttribute
1209
- } = renderer;
925
+ * Copyright (c) 2018, salesforce.com, inc.
926
+ * All rights reserved.
927
+ * SPDX-License-Identifier: MIT
928
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
929
+ */
1210
930
 
1211
- if (oldVnode.data.style === newStyle) {
1212
- return;
1213
- }
1214
931
 
1215
- if (!isString(newStyle) || newStyle === '') {
1216
- removeAttribute(elm, 'style');
1217
- } else {
1218
- setAttribute(elm, 'style', newStyle);
1219
- }
932
+ function componentValueMutated(vm, key) {
933
+ valueMutated(vm.component, key);
1220
934
  }
1221
935
 
1222
- const emptyVNode = {
1223
- data: {}
1224
- };
1225
- var modComputedStyle = {
1226
- create: vnode => updateStyleAttribute(emptyVNode, vnode),
1227
- update: updateStyleAttribute
1228
- };
936
+ function componentValueObserved(vm, key) {
937
+ valueObserved(vm.component, key);
938
+ }
1229
939
  /*
1230
940
  * Copyright (c) 2018, salesforce.com, inc.
1231
941
  * All rights reserved.
1232
942
  * SPDX-License-Identifier: MIT
1233
943
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
1234
944
  */
1235
- // The compiler takes care of transforming the inline classnames into an object. It's faster to set the
1236
- // different classnames properties individually instead of via a string.
1237
945
 
1238
- function createClassAttribute(vnode) {
1239
- const {
1240
- elm,
1241
- data: {
1242
- classMap
1243
- },
1244
- owner: {
1245
- renderer
1246
- }
1247
- } = vnode;
1248
946
 
1249
- if (isUndefined$1(classMap)) {
1250
- return;
1251
- }
947
+ function getComponentTag(vm) {
948
+ return `<${StringToLowerCase.call(vm.tagName)}>`;
949
+ } // TODO [#1695]: Unify getComponentStack and getErrorComponentStack
1252
950
 
1253
- const classList = renderer.getClassList(elm);
1254
951
 
1255
- for (const name in classMap) {
1256
- classList.add(name);
952
+ function getComponentStack(vm) {
953
+ const stack = [];
954
+ let prefix = '';
955
+
956
+ while (!isNull(vm.owner)) {
957
+ ArrayPush$1.call(stack, prefix + getComponentTag(vm));
958
+ vm = vm.owner;
959
+ prefix += '\t';
1257
960
  }
961
+
962
+ return ArrayJoin.call(stack, '\n');
1258
963
  }
1259
964
 
1260
- var modStaticClassName = {
1261
- create: createClassAttribute
1262
- };
965
+ function getErrorComponentStack(vm) {
966
+ const wcStack = [];
967
+ let currentVm = vm;
968
+
969
+ while (!isNull(currentVm)) {
970
+ ArrayPush$1.call(wcStack, getComponentTag(currentVm));
971
+ currentVm = currentVm.owner;
972
+ }
973
+
974
+ return wcStack.reverse().join('\n\t');
975
+ }
1263
976
  /*
1264
977
  * Copyright (c) 2018, salesforce.com, inc.
1265
978
  * All rights reserved.
1266
979
  * SPDX-License-Identifier: MIT
1267
980
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
1268
981
  */
1269
- // The compiler takes care of transforming the inline style into an object. It's faster to set the
1270
- // different style properties individually instead of via a string.
1271
982
 
1272
- function createStyleAttribute(vnode) {
1273
- const {
1274
- elm,
1275
- data: {
1276
- styleDecls
1277
- },
1278
- owner: {
1279
- renderer
1280
- }
1281
- } = vnode;
1282
983
 
1283
- if (isUndefined$1(styleDecls)) {
984
+ function log(method, message, vm) {
985
+ let msg = `[LWC ${method}]: ${message}`;
986
+
987
+ if (!isUndefined$1(vm)) {
988
+ msg = `${msg}\n${getComponentStack(vm)}`;
989
+ }
990
+
991
+ if (process.env.NODE_ENV === 'test') {
992
+ /* eslint-disable-next-line no-console */
993
+ console[method](msg);
1284
994
  return;
1285
995
  }
1286
996
 
1287
- for (let i = 0; i < styleDecls.length; i++) {
1288
- const [prop, value, important] = styleDecls[i];
1289
- renderer.setCSSStyleProperty(elm, prop, value, important);
997
+ try {
998
+ throw new Error(msg);
999
+ } catch (e) {
1000
+ /* eslint-disable-next-line no-console */
1001
+ console[method](e);
1290
1002
  }
1291
1003
  }
1292
1004
 
1293
- var modStaticStyle = {
1294
- create: createStyleAttribute
1295
- };
1005
+ function logError(message, vm) {
1006
+ log('error', message, vm);
1007
+ }
1008
+
1009
+ function logWarn(message, vm) {
1010
+ log('warn', message, vm);
1011
+ }
1296
1012
  /*
1297
1013
  * Copyright (c) 2018, salesforce.com, inc.
1298
1014
  * All rights reserved.
@@ -1300,14 +1016,6 @@
1300
1016
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
1301
1017
  */
1302
1018
 
1303
- /**
1304
- @license
1305
- Copyright (c) 2015 Simon Friis Vindum.
1306
- This code may only be used under the MIT License found at
1307
- https://github.com/snabbdom/snabbdom/blob/master/LICENSE
1308
- Code distributed by Snabbdom as part of the Snabbdom project at
1309
- https://github.com/snabbdom/snabbdom/
1310
- */
1311
1019
 
1312
1020
  function isUndef(s) {
1313
1021
  return s === undefined;
@@ -1396,7 +1104,7 @@
1396
1104
  } else if (sameVnode(oldStartVnode, newEndVnode)) {
1397
1105
  // Vnode moved right
1398
1106
  patchVnode(oldStartVnode, newEndVnode);
1399
- newEndVnode.hook.move(oldStartVnode, parentElm, oldEndVnode.owner.renderer.nextSibling(oldEndVnode.elm));
1107
+ newEndVnode.hook.move(oldStartVnode, parentElm, nextSibling$1(oldEndVnode.elm));
1400
1108
  oldStartVnode = oldCh[++oldStartIdx];
1401
1109
  newEndVnode = newCh[--newEndIdx];
1402
1110
  } else if (sameVnode(oldEndVnode, newStartVnode)) {
@@ -1516,6 +1224,125 @@
1516
1224
  */
1517
1225
 
1518
1226
 
1227
+ const defaultDefHTMLPropertyNames = ['accessKey', 'dir', 'draggable', 'hidden', 'id', 'lang', 'spellcheck', 'tabIndex', 'title'];
1228
+
1229
+ function offsetPropertyErrorMessage(name) {
1230
+ 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.`;
1231
+ } // Global HTML Attributes & Properties
1232
+ // https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes
1233
+ // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement
1234
+
1235
+
1236
+ const globalHTMLProperties = assign(create(null), {
1237
+ accessKey: {
1238
+ attribute: 'accesskey'
1239
+ },
1240
+ accessKeyLabel: {
1241
+ readOnly: true
1242
+ },
1243
+ className: {
1244
+ attribute: 'class',
1245
+ 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.'
1246
+ },
1247
+ contentEditable: {
1248
+ attribute: 'contenteditable'
1249
+ },
1250
+ dataset: {
1251
+ readOnly: true,
1252
+ 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."
1253
+ },
1254
+ dir: {
1255
+ attribute: 'dir'
1256
+ },
1257
+ draggable: {
1258
+ attribute: 'draggable'
1259
+ },
1260
+ dropzone: {
1261
+ attribute: 'dropzone',
1262
+ readOnly: true
1263
+ },
1264
+ hidden: {
1265
+ attribute: 'hidden'
1266
+ },
1267
+ id: {
1268
+ attribute: 'id'
1269
+ },
1270
+ inputMode: {
1271
+ attribute: 'inputmode'
1272
+ },
1273
+ lang: {
1274
+ attribute: 'lang'
1275
+ },
1276
+ slot: {
1277
+ attribute: 'slot',
1278
+ error: 'Using the `slot` property is an anti-pattern.'
1279
+ },
1280
+ spellcheck: {
1281
+ attribute: 'spellcheck'
1282
+ },
1283
+ style: {
1284
+ attribute: 'style'
1285
+ },
1286
+ tabIndex: {
1287
+ attribute: 'tabindex'
1288
+ },
1289
+ title: {
1290
+ attribute: 'title'
1291
+ },
1292
+ translate: {
1293
+ attribute: 'translate'
1294
+ },
1295
+ // additional "global attributes" that are not present in the link above.
1296
+ isContentEditable: {
1297
+ readOnly: true
1298
+ },
1299
+ offsetHeight: {
1300
+ readOnly: true,
1301
+ error: offsetPropertyErrorMessage('offsetHeight')
1302
+ },
1303
+ offsetLeft: {
1304
+ readOnly: true,
1305
+ error: offsetPropertyErrorMessage('offsetLeft')
1306
+ },
1307
+ offsetParent: {
1308
+ readOnly: true
1309
+ },
1310
+ offsetTop: {
1311
+ readOnly: true,
1312
+ error: offsetPropertyErrorMessage('offsetTop')
1313
+ },
1314
+ offsetWidth: {
1315
+ readOnly: true,
1316
+ error: offsetPropertyErrorMessage('offsetWidth')
1317
+ },
1318
+ role: {
1319
+ attribute: 'role'
1320
+ }
1321
+ });
1322
+ let controlledElement = null;
1323
+ let controlledAttributeName;
1324
+
1325
+ function isAttributeLocked(elm, attrName) {
1326
+ return elm !== controlledElement || attrName !== controlledAttributeName;
1327
+ }
1328
+
1329
+ function lockAttribute(_elm, _key) {
1330
+ controlledElement = null;
1331
+ controlledAttributeName = undefined;
1332
+ }
1333
+
1334
+ function unlockAttribute(elm, key) {
1335
+ controlledElement = elm;
1336
+ controlledAttributeName = key;
1337
+ }
1338
+ /*
1339
+ * Copyright (c) 2018, salesforce.com, inc.
1340
+ * All rights reserved.
1341
+ * SPDX-License-Identifier: MIT
1342
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
1343
+ */
1344
+
1345
+
1519
1346
  function generateDataDescriptor(options) {
1520
1347
  return assign({
1521
1348
  configurable: true,
@@ -1878,7 +1705,7 @@
1878
1705
  defineProperties(proto, getLightningElementPrototypeRestrictionsDescriptors(proto));
1879
1706
  }
1880
1707
  /*
1881
- * Copyright (c) 2020, salesforce.com, inc.
1708
+ * Copyright (c) 2018, salesforce.com, inc.
1882
1709
  * All rights reserved.
1883
1710
  * SPDX-License-Identifier: MIT
1884
1711
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
@@ -2798,9 +2625,7 @@
2798
2625
 
2799
2626
 
2800
2627
  const LightningElement = function () {
2801
- var _a; // This should be as performant as possible, while any initialization should be done lazily
2802
-
2803
-
2628
+ // This should be as performant as possible, while any initialization should be done lazily
2804
2629
  if (isNull(vmBeingConstructed)) {
2805
2630
  throw new ReferenceError('Illegal constructor');
2806
2631
  }
@@ -2808,15 +2633,14 @@
2808
2633
  const vm = vmBeingConstructed;
2809
2634
  const {
2810
2635
  def,
2811
- elm,
2812
- renderer
2636
+ elm
2813
2637
  } = vm;
2814
2638
  const {
2815
2639
  bridge
2816
2640
  } = def;
2817
2641
 
2818
2642
  if (process.env.NODE_ENV !== 'production') {
2819
- (_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}.`);
2643
+ assertInstanceOfHTMLElement$1(vm.elm, `Component creation requires a DOM element to be associated to ${vm}.`);
2820
2644
  }
2821
2645
 
2822
2646
  const component = this;
@@ -2846,7 +2670,7 @@
2846
2670
  if (vm.renderMode === 1
2847
2671
  /* Shadow */
2848
2672
  ) {
2849
- attachShadow(vm);
2673
+ doAttachShadow(vm);
2850
2674
  } // Adding extra guard rails in DEV mode.
2851
2675
 
2852
2676
 
@@ -2858,17 +2682,16 @@
2858
2682
  return this;
2859
2683
  };
2860
2684
 
2861
- function attachShadow(vm) {
2685
+ function doAttachShadow(vm) {
2862
2686
  const {
2863
2687
  elm,
2864
2688
  mode,
2865
- renderer,
2866
2689
  shadowMode,
2867
2690
  def: {
2868
2691
  ctor
2869
2692
  }
2870
2693
  } = vm;
2871
- const cmpRoot = renderer.attachShadow(elm, {
2694
+ const cmpRoot = attachShadow$1(elm, {
2872
2695
  [KEY__SYNTHETIC_MODE]: shadowMode === 1
2873
2696
  /* Synthetic */
2874
2697
  ,
@@ -2895,21 +2718,15 @@
2895
2718
 
2896
2719
  dispatchEvent(event) {
2897
2720
  const {
2898
- elm,
2899
- renderer: {
2900
- dispatchEvent
2901
- }
2721
+ elm
2902
2722
  } = getAssociatedVM(this);
2903
- return dispatchEvent(elm, event);
2723
+ return dispatchEvent$1(elm, event);
2904
2724
  },
2905
2725
 
2906
2726
  addEventListener(type, listener, options) {
2907
2727
  const vm = getAssociatedVM(this);
2908
2728
  const {
2909
- elm,
2910
- renderer: {
2911
- addEventListener
2912
- }
2729
+ elm
2913
2730
  } = vm;
2914
2731
 
2915
2732
  if (process.env.NODE_ENV !== 'production') {
@@ -2920,92 +2737,68 @@
2920
2737
  }
2921
2738
 
2922
2739
  const wrappedListener = getWrappedComponentsListener(vm, listener);
2923
- addEventListener(elm, type, wrappedListener, options);
2740
+ addEventListener$1(elm, type, wrappedListener, options);
2924
2741
  },
2925
2742
 
2926
2743
  removeEventListener(type, listener, options) {
2927
2744
  const vm = getAssociatedVM(this);
2928
2745
  const {
2929
- elm,
2930
- renderer: {
2931
- removeEventListener
2932
- }
2746
+ elm
2933
2747
  } = vm;
2934
2748
  const wrappedListener = getWrappedComponentsListener(vm, listener);
2935
- removeEventListener(elm, type, wrappedListener, options);
2749
+ removeEventListener$1(elm, type, wrappedListener, options);
2936
2750
  },
2937
2751
 
2938
2752
  hasAttribute(name) {
2939
2753
  const {
2940
- elm,
2941
- renderer: {
2942
- getAttribute
2943
- }
2754
+ elm
2944
2755
  } = getAssociatedVM(this);
2945
- return !isNull(getAttribute(elm, name));
2756
+ return !isNull(getAttribute$1(elm, name));
2946
2757
  },
2947
2758
 
2948
2759
  hasAttributeNS(namespace, name) {
2949
2760
  const {
2950
- elm,
2951
- renderer: {
2952
- getAttribute
2953
- }
2761
+ elm
2954
2762
  } = getAssociatedVM(this);
2955
- return !isNull(getAttribute(elm, name, namespace));
2763
+ return !isNull(getAttribute$1(elm, name, namespace));
2956
2764
  },
2957
2765
 
2958
2766
  removeAttribute(name) {
2959
2767
  const {
2960
- elm,
2961
- renderer: {
2962
- removeAttribute
2963
- }
2768
+ elm
2964
2769
  } = getAssociatedVM(this);
2965
2770
  unlockAttribute(elm, name);
2966
- removeAttribute(elm, name);
2771
+ removeAttribute$1(elm, name);
2967
2772
  lockAttribute();
2968
2773
  },
2969
2774
 
2970
2775
  removeAttributeNS(namespace, name) {
2971
2776
  const {
2972
- elm,
2973
- renderer: {
2974
- removeAttribute
2975
- }
2777
+ elm
2976
2778
  } = getAssociatedVM(this);
2977
2779
  unlockAttribute(elm, name);
2978
- removeAttribute(elm, name, namespace);
2780
+ removeAttribute$1(elm, name, namespace);
2979
2781
  lockAttribute();
2980
2782
  },
2981
2783
 
2982
2784
  getAttribute(name) {
2983
2785
  const {
2984
- elm,
2985
- renderer: {
2986
- getAttribute
2987
- }
2786
+ elm
2988
2787
  } = getAssociatedVM(this);
2989
- return getAttribute(elm, name);
2788
+ return getAttribute$1(elm, name);
2990
2789
  },
2991
2790
 
2992
2791
  getAttributeNS(namespace, name) {
2993
2792
  const {
2994
- elm,
2995
- renderer: {
2996
- getAttribute
2997
- }
2793
+ elm
2998
2794
  } = getAssociatedVM(this);
2999
- return getAttribute(elm, name, namespace);
2795
+ return getAttribute$1(elm, name, namespace);
3000
2796
  },
3001
2797
 
3002
2798
  setAttribute(name, value) {
3003
2799
  const vm = getAssociatedVM(this);
3004
2800
  const {
3005
- elm,
3006
- renderer: {
3007
- setAttribute
3008
- }
2801
+ elm
3009
2802
  } = vm;
3010
2803
 
3011
2804
  if (process.env.NODE_ENV !== 'production') {
@@ -3013,17 +2806,14 @@
3013
2806
  }
3014
2807
 
3015
2808
  unlockAttribute(elm, name);
3016
- setAttribute(elm, name, value);
2809
+ setAttribute$1(elm, name, value);
3017
2810
  lockAttribute();
3018
2811
  },
3019
2812
 
3020
2813
  setAttributeNS(namespace, name, value) {
3021
2814
  const vm = getAssociatedVM(this);
3022
2815
  const {
3023
- elm,
3024
- renderer: {
3025
- setAttribute
3026
- }
2816
+ elm
3027
2817
  } = vm;
3028
2818
 
3029
2819
  if (process.env.NODE_ENV !== 'production') {
@@ -3031,43 +2821,34 @@
3031
2821
  }
3032
2822
 
3033
2823
  unlockAttribute(elm, name);
3034
- setAttribute(elm, name, value, namespace);
2824
+ setAttribute$1(elm, name, value, namespace);
3035
2825
  lockAttribute();
3036
2826
  },
3037
2827
 
3038
2828
  getBoundingClientRect() {
3039
2829
  const vm = getAssociatedVM(this);
3040
2830
  const {
3041
- elm,
3042
- renderer: {
3043
- getBoundingClientRect
3044
- }
2831
+ elm
3045
2832
  } = vm;
3046
2833
 
3047
2834
  if (process.env.NODE_ENV !== 'production') {
3048
2835
  warnIfInvokedDuringConstruction(vm, 'getBoundingClientRect()');
3049
2836
  }
3050
2837
 
3051
- return getBoundingClientRect(elm);
2838
+ return getBoundingClientRect$1(elm);
3052
2839
  },
3053
2840
 
3054
2841
  get isConnected() {
3055
2842
  const {
3056
- elm,
3057
- renderer: {
3058
- isConnected
3059
- }
2843
+ elm
3060
2844
  } = getAssociatedVM(this);
3061
- return isConnected(elm);
2845
+ return isConnected$1(elm);
3062
2846
  },
3063
2847
 
3064
2848
  get classList() {
3065
2849
  const vm = getAssociatedVM(this);
3066
2850
  const {
3067
- elm,
3068
- renderer: {
3069
- getClassList
3070
- }
2851
+ elm
3071
2852
  } = vm;
3072
2853
 
3073
2854
  if (process.env.NODE_ENV !== 'production') {
@@ -3076,7 +2857,7 @@
3076
2857
  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.`);
3077
2858
  }
3078
2859
 
3079
- return getClassList(elm);
2860
+ return getClassList$1(elm);
3080
2861
  },
3081
2862
 
3082
2863
  get template() {
@@ -3110,23 +2891,48 @@
3110
2891
  }
3111
2892
 
3112
2893
  };
3113
- const queryAndChildGetterDescriptors = create(null);
3114
- 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
2894
+ const queryAndChildGetterDescriptors = create(null); // The reason we don't just call `import * as renderer from '../renderer'` here is that the bundle size
2895
+ // is smaller if we reference each function individually. Otherwise Rollup will create one big frozen
2896
+ // object representing the renderer, with a lot of methods we don't actually need.
2897
+
2898
+ const childGetters = ['children', 'childNodes', 'firstChild', 'firstElementChild', 'lastChild', 'lastElementChild'];
2899
+
2900
+ function getChildGetter(methodName) {
2901
+ switch (methodName) {
2902
+ case 'children':
2903
+ return getChildren$1;
2904
+
2905
+ case 'childNodes':
2906
+ return getChildNodes$1;
3115
2907
 
3116
- for (const [elementProp, rendererMethod] of childGetters) {
3117
- queryAndChildGetterDescriptors[elementProp] = {
2908
+ case 'firstChild':
2909
+ return getFirstChild$1;
2910
+
2911
+ case 'firstElementChild':
2912
+ return getFirstElementChild$1;
2913
+
2914
+ case 'lastChild':
2915
+ return getLastChild$1;
2916
+
2917
+ case 'lastElementChild':
2918
+ return getLastElementChild$1;
2919
+ }
2920
+ } // Generic passthrough for child getters on HTMLElement to the relevant Renderer APIs
2921
+
2922
+
2923
+ for (const childGetter of childGetters) {
2924
+ queryAndChildGetterDescriptors[childGetter] = {
3118
2925
  get() {
3119
2926
  const vm = getAssociatedVM(this);
3120
2927
  const {
3121
- elm,
3122
- renderer
2928
+ elm
3123
2929
  } = vm;
3124
2930
 
3125
2931
  if (process.env.NODE_ENV !== 'production') {
3126
- warnIfInvokedDuringConstruction(vm, elementProp);
2932
+ warnIfInvokedDuringConstruction(vm, childGetter);
3127
2933
  }
3128
2934
 
3129
- return renderer[rendererMethod](elm);
2935
+ return getChildGetter(childGetter)(elm);
3130
2936
  },
3131
2937
 
3132
2938
  configurable: true,
@@ -3134,22 +2940,38 @@
3134
2940
  };
3135
2941
  }
3136
2942
 
3137
- const queryMethods = ['getElementsByClassName', 'getElementsByTagName', 'querySelector', 'querySelectorAll']; // Generic passthrough for query APIs on HTMLElement to the relevant Renderer APIs
2943
+ const queryMethods = ['getElementsByClassName', 'getElementsByTagName', 'querySelector', 'querySelectorAll'];
2944
+
2945
+ function getQueryMethod(methodName) {
2946
+ switch (methodName) {
2947
+ case 'getElementsByClassName':
2948
+ return getElementsByClassName$1;
2949
+
2950
+ case 'getElementsByTagName':
2951
+ return getElementsByTagName$1;
2952
+
2953
+ case 'querySelector':
2954
+ return querySelector$1;
2955
+
2956
+ case 'querySelectorAll':
2957
+ return querySelectorAll$1;
2958
+ }
2959
+ } // Generic passthrough for query APIs on HTMLElement to the relevant Renderer APIs
2960
+
3138
2961
 
3139
2962
  for (const queryMethod of queryMethods) {
3140
2963
  queryAndChildGetterDescriptors[queryMethod] = {
3141
2964
  value(arg) {
3142
2965
  const vm = getAssociatedVM(this);
3143
2966
  const {
3144
- elm,
3145
- renderer
2967
+ elm
3146
2968
  } = vm;
3147
2969
 
3148
2970
  if (process.env.NODE_ENV !== 'production') {
3149
2971
  warnIfInvokedDuringConstruction(vm, `${queryMethod}()`);
3150
2972
  }
3151
2973
 
3152
- return renderer[queryMethod](elm, arg);
2974
+ return getQueryMethod(queryMethod)(elm, arg);
3153
2975
  },
3154
2976
 
3155
2977
  configurable: true,
@@ -4305,10 +4127,6 @@
4305
4127
 
4306
4128
  assert.isTrue(Ctor.constructor, `Missing ${ctorName}.constructor, ${ctorName} should have a "constructor" property.`);
4307
4129
 
4308
- if (!runtimeFlags.ENABLE_MIXED_SHADOW_MODE) {
4309
- assert.isFalse('shadowSupportMode' in Ctor, `${ctorName || 'Anonymous class'} is an invalid LWC component. The shadowSupportMode static property is not available in this environment.`);
4310
- }
4311
-
4312
4130
  if (!isUndefined$1(ctorShadowSupportMode)) {
4313
4131
  assert.invariant(ctorShadowSupportMode === "any"
4314
4132
  /* Any */
@@ -4535,6 +4353,295 @@
4535
4353
  */
4536
4354
 
4537
4355
 
4356
+ const xlinkNS = 'http://www.w3.org/1999/xlink';
4357
+ const xmlNS = 'http://www.w3.org/XML/1998/namespace';
4358
+ const ColonCharCode = 58;
4359
+
4360
+ function patchAttributes(oldVnode, vnode) {
4361
+ const {
4362
+ attrs
4363
+ } = vnode.data;
4364
+
4365
+ if (isUndefined$1(attrs)) {
4366
+ return;
4367
+ }
4368
+
4369
+ const oldAttrs = isNull(oldVnode) ? EmptyObject : oldVnode.data.attrs;
4370
+
4371
+ if (oldAttrs === attrs) {
4372
+ return;
4373
+ }
4374
+
4375
+ const {
4376
+ elm
4377
+ } = vnode;
4378
+
4379
+ for (const key in attrs) {
4380
+ const cur = attrs[key];
4381
+ const old = oldAttrs[key];
4382
+
4383
+ if (old !== cur) {
4384
+ unlockAttribute(elm, key);
4385
+
4386
+ if (StringCharCodeAt.call(key, 3) === ColonCharCode) {
4387
+ // Assume xml namespace
4388
+ setAttribute$1(elm, key, cur, xmlNS);
4389
+ } else if (StringCharCodeAt.call(key, 5) === ColonCharCode) {
4390
+ // Assume xlink namespace
4391
+ setAttribute$1(elm, key, cur, xlinkNS);
4392
+ } else if (isNull(cur) || isUndefined$1(cur)) {
4393
+ removeAttribute$1(elm, key);
4394
+ } else {
4395
+ setAttribute$1(elm, key, cur);
4396
+ }
4397
+
4398
+ lockAttribute();
4399
+ }
4400
+ }
4401
+ }
4402
+ /*
4403
+ * Copyright (c) 2018, salesforce.com, inc.
4404
+ * All rights reserved.
4405
+ * SPDX-License-Identifier: MIT
4406
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
4407
+ */
4408
+
4409
+
4410
+ function isLiveBindingProp(sel, key) {
4411
+ // For properties with live bindings, we read values from the DOM element
4412
+ // instead of relying on internally tracked values.
4413
+ return sel === 'input' && (key === 'value' || key === 'checked');
4414
+ }
4415
+
4416
+ function patchProps(oldVnode, vnode) {
4417
+ const {
4418
+ props
4419
+ } = vnode.data;
4420
+
4421
+ if (isUndefined$1(props)) {
4422
+ return;
4423
+ }
4424
+
4425
+ const oldProps = isNull(oldVnode) ? EmptyObject : oldVnode.data.props;
4426
+
4427
+ if (oldProps === props) {
4428
+ return;
4429
+ }
4430
+
4431
+ const isFirstPatch = isNull(oldVnode);
4432
+ const {
4433
+ elm,
4434
+ sel
4435
+ } = vnode;
4436
+
4437
+ for (const key in props) {
4438
+ const cur = props[key]; // Set the property if it's the first time is is patched or if the previous property is
4439
+ // different than the one previously set.
4440
+
4441
+ if (isFirstPatch || cur !== (isLiveBindingProp(sel, key) ? getProperty$1(elm, key) : oldProps[key])) {
4442
+ setProperty$1(elm, key, cur);
4443
+ }
4444
+ }
4445
+ }
4446
+ /*
4447
+ * Copyright (c) 2018, salesforce.com, inc.
4448
+ * All rights reserved.
4449
+ * SPDX-License-Identifier: MIT
4450
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
4451
+ */
4452
+
4453
+
4454
+ const classNameToClassMap = create(null);
4455
+
4456
+ function getMapFromClassName(className) {
4457
+ // Intentionally using == to match undefined and null values from computed style attribute
4458
+ if (className == null) {
4459
+ return EmptyObject;
4460
+ } // computed class names must be string
4461
+
4462
+
4463
+ className = isString(className) ? className : className + '';
4464
+ let map = classNameToClassMap[className];
4465
+
4466
+ if (map) {
4467
+ return map;
4468
+ }
4469
+
4470
+ map = create(null);
4471
+ let start = 0;
4472
+ let o;
4473
+ const len = className.length;
4474
+
4475
+ for (o = 0; o < len; o++) {
4476
+ if (StringCharCodeAt.call(className, o) === SPACE_CHAR) {
4477
+ if (o > start) {
4478
+ map[StringSlice.call(className, start, o)] = true;
4479
+ }
4480
+
4481
+ start = o + 1;
4482
+ }
4483
+ }
4484
+
4485
+ if (o > start) {
4486
+ map[StringSlice.call(className, start, o)] = true;
4487
+ }
4488
+
4489
+ classNameToClassMap[className] = map;
4490
+
4491
+ if (process.env.NODE_ENV !== 'production') {
4492
+ // just to make sure that this object never changes as part of the diffing algo
4493
+ freeze(map);
4494
+ }
4495
+
4496
+ return map;
4497
+ }
4498
+
4499
+ function patchClassAttribute(oldVnode, vnode) {
4500
+ const {
4501
+ elm,
4502
+ data: {
4503
+ className: newClass
4504
+ }
4505
+ } = vnode;
4506
+ const oldClass = isNull(oldVnode) ? undefined : oldVnode.data.className;
4507
+
4508
+ if (oldClass === newClass) {
4509
+ return;
4510
+ }
4511
+
4512
+ const classList = getClassList$1(elm);
4513
+ const newClassMap = getMapFromClassName(newClass);
4514
+ const oldClassMap = getMapFromClassName(oldClass);
4515
+ let name;
4516
+
4517
+ for (name in oldClassMap) {
4518
+ // remove only if it is not in the new class collection and it is not set from within the instance
4519
+ if (isUndefined$1(newClassMap[name])) {
4520
+ classList.remove(name);
4521
+ }
4522
+ }
4523
+
4524
+ for (name in newClassMap) {
4525
+ if (isUndefined$1(oldClassMap[name])) {
4526
+ classList.add(name);
4527
+ }
4528
+ }
4529
+ }
4530
+ /*
4531
+ * Copyright (c) 2018, salesforce.com, inc.
4532
+ * All rights reserved.
4533
+ * SPDX-License-Identifier: MIT
4534
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
4535
+ */
4536
+
4537
+
4538
+ function patchStyleAttribute(oldVnode, vnode) {
4539
+ const {
4540
+ elm,
4541
+ data: {
4542
+ style: newStyle
4543
+ }
4544
+ } = vnode;
4545
+ const oldStyle = isNull(oldVnode) ? undefined : oldVnode.data.style;
4546
+
4547
+ if (oldStyle === newStyle) {
4548
+ return;
4549
+ }
4550
+
4551
+ if (!isString(newStyle) || newStyle === '') {
4552
+ removeAttribute$1(elm, 'style');
4553
+ } else {
4554
+ setAttribute$1(elm, 'style', newStyle);
4555
+ }
4556
+ }
4557
+ /*
4558
+ * Copyright (c) 2018, salesforce.com, inc.
4559
+ * All rights reserved.
4560
+ * SPDX-License-Identifier: MIT
4561
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
4562
+ */
4563
+
4564
+
4565
+ function applyEventListeners(vnode) {
4566
+ const {
4567
+ elm,
4568
+ data: {
4569
+ on
4570
+ }
4571
+ } = vnode;
4572
+
4573
+ if (isUndefined$1(on)) {
4574
+ return;
4575
+ }
4576
+
4577
+ for (const name in on) {
4578
+ const handler = on[name];
4579
+ addEventListener$1(elm, name, handler);
4580
+ }
4581
+ }
4582
+ /*
4583
+ * Copyright (c) 2018, salesforce.com, inc.
4584
+ * All rights reserved.
4585
+ * SPDX-License-Identifier: MIT
4586
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
4587
+ */
4588
+ // The compiler takes care of transforming the inline classnames into an object. It's faster to set the
4589
+ // different classnames properties individually instead of via a string.
4590
+
4591
+
4592
+ function applyStaticClassAttribute(vnode) {
4593
+ const {
4594
+ elm,
4595
+ data: {
4596
+ classMap
4597
+ }
4598
+ } = vnode;
4599
+
4600
+ if (isUndefined$1(classMap)) {
4601
+ return;
4602
+ }
4603
+
4604
+ const classList = getClassList$1(elm);
4605
+
4606
+ for (const name in classMap) {
4607
+ classList.add(name);
4608
+ }
4609
+ }
4610
+ /*
4611
+ * Copyright (c) 2018, salesforce.com, inc.
4612
+ * All rights reserved.
4613
+ * SPDX-License-Identifier: MIT
4614
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
4615
+ */
4616
+ // The compiler takes care of transforming the inline style into an object. It's faster to set the
4617
+ // different style properties individually instead of via a string.
4618
+
4619
+
4620
+ function applyStaticStyleAttribute(vnode) {
4621
+ const {
4622
+ elm,
4623
+ data: {
4624
+ styleDecls
4625
+ }
4626
+ } = vnode;
4627
+
4628
+ if (isUndefined$1(styleDecls)) {
4629
+ return;
4630
+ }
4631
+
4632
+ for (let i = 0; i < styleDecls.length; i++) {
4633
+ const [prop, value, important] = styleDecls[i];
4634
+ setCSSStyleProperty$1(elm, prop, value, important);
4635
+ }
4636
+ }
4637
+ /*
4638
+ * Copyright (c) 2018, salesforce.com, inc.
4639
+ * All rights reserved.
4640
+ * SPDX-License-Identifier: MIT
4641
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
4642
+ */
4643
+
4644
+
4538
4645
  function observeElementChildNodes(elm) {
4539
4646
  elm.$domManual$ = true;
4540
4647
  }
@@ -4552,17 +4659,14 @@
4552
4659
  const token = cmpTemplate === null || cmpTemplate === void 0 ? void 0 : cmpTemplate.stylesheetToken;
4553
4660
 
4554
4661
  if (!isUndefined$1(token) && context.hasScopedStyles) {
4555
- owner.renderer.getClassList(elm).add(token);
4662
+ getClassList$1(elm).add(token);
4556
4663
  }
4557
4664
  }
4558
4665
 
4559
4666
  function updateNodeHook(oldVnode, vnode) {
4560
4667
  const {
4561
4668
  elm,
4562
- text,
4563
- owner: {
4564
- renderer
4565
- }
4669
+ text
4566
4670
  } = vnode;
4567
4671
 
4568
4672
  if (oldVnode.text !== text) {
@@ -4570,7 +4674,7 @@
4570
4674
  unlockDomMutation();
4571
4675
  }
4572
4676
 
4573
- renderer.setText(elm, text);
4677
+ setText$1(elm, text);
4574
4678
 
4575
4679
  if (process.env.NODE_ENV !== 'production') {
4576
4680
  lockDomMutation();
@@ -4579,15 +4683,11 @@
4579
4683
  }
4580
4684
 
4581
4685
  function insertNodeHook(vnode, parentNode, referenceNode) {
4582
- const {
4583
- renderer
4584
- } = vnode.owner;
4585
-
4586
4686
  if (process.env.NODE_ENV !== 'production') {
4587
4687
  unlockDomMutation();
4588
4688
  }
4589
4689
 
4590
- renderer.insert(vnode.elm, parentNode, referenceNode);
4690
+ insert$1(vnode.elm, parentNode, referenceNode);
4591
4691
 
4592
4692
  if (process.env.NODE_ENV !== 'production') {
4593
4693
  lockDomMutation();
@@ -4595,43 +4695,35 @@
4595
4695
  }
4596
4696
 
4597
4697
  function removeNodeHook(vnode, parentNode) {
4598
- const {
4599
- renderer
4600
- } = vnode.owner;
4601
-
4602
4698
  if (process.env.NODE_ENV !== 'production') {
4603
4699
  unlockDomMutation();
4604
4700
  }
4605
4701
 
4606
- renderer.remove(vnode.elm, parentNode);
4702
+ remove$1(vnode.elm, parentNode);
4607
4703
 
4608
4704
  if (process.env.NODE_ENV !== 'production') {
4609
4705
  lockDomMutation();
4610
4706
  }
4611
4707
  }
4612
4708
 
4613
- function createElmHook(vnode) {
4614
- modEvents.create(vnode); // Attrs need to be applied to element before props
4615
- // IE11 will wipe out value on radio inputs if value
4616
- // is set before type=radio.
4709
+ function patchElementPropsAndAttrs(oldVnode, vnode) {
4710
+ if (isNull(oldVnode)) {
4711
+ applyEventListeners(vnode);
4712
+ applyStaticClassAttribute(vnode);
4713
+ applyStaticStyleAttribute(vnode);
4714
+ } // Attrs need to be applied to element before props IE11 will wipe out value on radio inputs if
4715
+ // value is set before type=radio.
4716
+
4617
4717
 
4618
- modAttrs.create(vnode);
4619
- modProps.create(vnode);
4620
- modStaticClassName.create(vnode);
4621
- modStaticStyle.create(vnode);
4622
- modComputedClassName.create(vnode);
4623
- modComputedStyle.create(vnode);
4718
+ patchClassAttribute(oldVnode, vnode);
4719
+ patchStyleAttribute(oldVnode, vnode);
4720
+ patchAttributes(oldVnode, vnode);
4721
+ patchProps(oldVnode, vnode);
4624
4722
  }
4625
4723
 
4626
4724
  function hydrateElmHook(vnode) {
4627
- modEvents.create(vnode); // Attrs are already on the element.
4628
- // modAttrs.create(vnode);
4629
-
4630
- modProps.create(vnode); // Already set.
4631
- // modStaticClassName.create(vnode);
4632
- // modStaticStyle.create(vnode);
4633
- // modComputedClassName.create(vnode);
4634
- // modComputedStyle.create(vnode);
4725
+ applyEventListeners(vnode);
4726
+ patchProps(null, vnode);
4635
4727
  }
4636
4728
 
4637
4729
  function fallbackElmHook(elm, vnode) {
@@ -4683,26 +4775,11 @@
4683
4775
  }
4684
4776
  }
4685
4777
 
4686
- function updateElmHook(oldVnode, vnode) {
4687
- // Attrs need to be applied to element before props
4688
- // IE11 will wipe out value on radio inputs if value
4689
- // is set before type=radio.
4690
- modAttrs.update(oldVnode, vnode);
4691
- modProps.update(oldVnode, vnode);
4692
- modComputedClassName.update(oldVnode, vnode);
4693
- modComputedStyle.update(oldVnode, vnode);
4694
- }
4695
-
4696
- function updateChildrenHook(oldVnode, vnode) {
4697
- const {
4698
- elm,
4699
- children
4700
- } = vnode;
4701
-
4702
- if (hasDynamicChildren(children)) {
4703
- updateDynamicChildren(elm, oldVnode.children, children);
4778
+ function patchChildren(parent, oldCh, newCh) {
4779
+ if (hasDynamicChildren(newCh)) {
4780
+ updateDynamicChildren(parent, oldCh, newCh);
4704
4781
  } else {
4705
- updateStaticChildren(elm, oldVnode.children, children);
4782
+ updateStaticChildren(parent, oldCh, newCh);
4706
4783
  }
4707
4784
  }
4708
4785
 
@@ -4769,8 +4846,7 @@
4769
4846
  createVM(elm, def, {
4770
4847
  mode,
4771
4848
  owner,
4772
- tagName: sel,
4773
- renderer: owner.renderer
4849
+ tagName: sel
4774
4850
  });
4775
4851
 
4776
4852
  if (process.env.NODE_ENV !== 'production') {
@@ -4778,19 +4854,6 @@
4778
4854
  }
4779
4855
  }
4780
4856
 
4781
- function createCustomElmHook(vnode) {
4782
- modEvents.create(vnode); // Attrs need to be applied to element before props
4783
- // IE11 will wipe out value on radio inputs if value
4784
- // is set before type=radio.
4785
-
4786
- modAttrs.create(vnode);
4787
- modProps.create(vnode);
4788
- modStaticClassName.create(vnode);
4789
- modStaticStyle.create(vnode);
4790
- modComputedClassName.create(vnode);
4791
- modComputedStyle.create(vnode);
4792
- }
4793
-
4794
4857
  function createChildrenHook(vnode) {
4795
4858
  const {
4796
4859
  elm,
@@ -4816,16 +4879,13 @@
4816
4879
  const {
4817
4880
  data: {
4818
4881
  attrs = {}
4819
- },
4820
- owner: {
4821
- renderer
4822
4882
  }
4823
4883
  } = vnode;
4824
4884
  let nodesAreCompatible = true; // Validate attributes, though we could always recovery from those by running the update mods.
4825
4885
  // Note: intentionally ONLY matching vnodes.attrs to elm.attrs, in case SSR is adding extra attributes.
4826
4886
 
4827
4887
  for (const [attrName, attrValue] of Object.entries(attrs)) {
4828
- const elmAttrValue = renderer.getAttribute(elm, attrName);
4888
+ const elmAttrValue = getAttribute$1(elm, attrName);
4829
4889
 
4830
4890
  if (String(attrValue) !== elmAttrValue) {
4831
4891
  logError(`Mismatch hydrating element <${elm.tagName.toLowerCase()}>: attribute "${attrName}" has different values, expected "${attrValue}" but found "${elmAttrValue}"`, vnode.owner);
@@ -4841,9 +4901,6 @@
4841
4901
  data: {
4842
4902
  className,
4843
4903
  classMap
4844
- },
4845
- owner: {
4846
- renderer
4847
4904
  }
4848
4905
  } = vnode;
4849
4906
  let nodesAreCompatible = true;
@@ -4855,7 +4912,7 @@
4855
4912
  vnodeClassName = className;
4856
4913
  } else if (!isUndefined$1(classMap)) {
4857
4914
  // classMap is used when class is set to static value.
4858
- const classList = renderer.getClassList(elm);
4915
+ const classList = getClassList$1(elm);
4859
4916
  let computedClassName = ''; // all classes from the vnode should be in the element.classList
4860
4917
 
4861
4918
  for (const name in classMap) {
@@ -4885,12 +4942,9 @@
4885
4942
  data: {
4886
4943
  style,
4887
4944
  styleDecls
4888
- },
4889
- owner: {
4890
- renderer
4891
4945
  }
4892
4946
  } = vnode;
4893
- const elmStyle = renderer.getAttribute(elm, 'style') || '';
4947
+ const elmStyle = getAttribute$1(elm, 'style') || '';
4894
4948
  let vnodeStyle;
4895
4949
  let nodesAreCompatible = true;
4896
4950
 
@@ -4980,16 +5034,6 @@
4980
5034
  }
4981
5035
  }
4982
5036
 
4983
- function updateCustomElmHook(oldVnode, vnode) {
4984
- // Attrs need to be applied to element before props
4985
- // IE11 will wipe out value on radio inputs if value
4986
- // is set before type=radio.
4987
- modAttrs.update(oldVnode, vnode);
4988
- modProps.update(oldVnode, vnode);
4989
- modComputedClassName.update(oldVnode, vnode);
4990
- modComputedStyle.update(oldVnode, vnode);
4991
- }
4992
-
4993
5037
  function removeElmHook(vnode) {
4994
5038
  // this method only needs to search on child vnodes from template
4995
5039
  // to trigger the remove hook just in case some of those children
@@ -5006,6 +5050,66 @@
5006
5050
  ch.hook.remove(ch, elm);
5007
5051
  }
5008
5052
  }
5053
+ }
5054
+
5055
+ function allocateInSlot(vm, children) {
5056
+ const {
5057
+ cmpSlots: oldSlots
5058
+ } = vm;
5059
+ const cmpSlots = vm.cmpSlots = create(null);
5060
+
5061
+ for (let i = 0, len = children.length; i < len; i += 1) {
5062
+ const vnode = children[i];
5063
+
5064
+ if (isNull(vnode)) {
5065
+ continue;
5066
+ }
5067
+
5068
+ const {
5069
+ data
5070
+ } = vnode;
5071
+ const slotName = data.attrs && data.attrs.slot || '';
5072
+ const vnodes = cmpSlots[slotName] = cmpSlots[slotName] || []; // re-keying the vnodes is necessary to avoid conflicts with default content for the slot
5073
+ // which might have similar keys. Each vnode will always have a key that
5074
+ // starts with a numeric character from compiler. In this case, we add a unique
5075
+ // notation for slotted vnodes keys, e.g.: `@foo:1:1`
5076
+
5077
+ if (!isUndefined$1(vnode.key)) {
5078
+ vnode.key = `@${slotName}:${vnode.key}`;
5079
+ }
5080
+
5081
+ ArrayPush$1.call(vnodes, vnode);
5082
+ }
5083
+
5084
+ if (isFalse(vm.isDirty)) {
5085
+ // We need to determine if the old allocation is really different from the new one
5086
+ // and mark the vm as dirty
5087
+ const oldKeys = keys(oldSlots);
5088
+
5089
+ if (oldKeys.length !== keys(cmpSlots).length) {
5090
+ markComponentAsDirty(vm);
5091
+ return;
5092
+ }
5093
+
5094
+ for (let i = 0, len = oldKeys.length; i < len; i += 1) {
5095
+ const key = oldKeys[i];
5096
+
5097
+ if (isUndefined$1(cmpSlots[key]) || oldSlots[key].length !== cmpSlots[key].length) {
5098
+ markComponentAsDirty(vm);
5099
+ return;
5100
+ }
5101
+
5102
+ const oldVNodes = oldSlots[key];
5103
+ const vnodes = cmpSlots[key];
5104
+
5105
+ for (let j = 0, a = cmpSlots[key].length; j < a; j += 1) {
5106
+ if (oldVNodes[j] !== vnodes[j]) {
5107
+ markComponentAsDirty(vm);
5108
+ return;
5109
+ }
5110
+ }
5111
+ }
5112
+ }
5009
5113
  } // Using a WeakMap instead of a WeakSet because this one works in IE11 :(
5010
5114
 
5011
5115
 
@@ -5027,12 +5131,12 @@
5027
5131
  */
5028
5132
 
5029
5133
 
5030
- function getUpgradableConstructor(tagName, renderer) {
5134
+ function getUpgradableConstructor(tagName) {
5031
5135
  // Should never get a tag with upper case letter at this point, the compiler should
5032
5136
  // produce only tags with lowercase letters
5033
5137
  // But, for backwards compatibility, we will lower case the tagName
5034
5138
  tagName = tagName.toLowerCase();
5035
- let CE = renderer.getCustomElement(tagName);
5139
+ let CE = getCustomElement$1(tagName);
5036
5140
 
5037
5141
  if (!isUndefined$1(CE)) {
5038
5142
  return CE;
@@ -5043,7 +5147,7 @@
5043
5147
  */
5044
5148
 
5045
5149
 
5046
- CE = class LWCUpgradableElement extends renderer.HTMLElement {
5150
+ CE = class LWCUpgradableElement extends HTMLElementExported$1 {
5047
5151
  constructor(upgradeCallback) {
5048
5152
  super();
5049
5153
 
@@ -5053,7 +5157,7 @@
5053
5157
  }
5054
5158
 
5055
5159
  };
5056
- renderer.defineCustomElement(tagName, CE);
5160
+ defineCustomElement$1(tagName, CE);
5057
5161
  return CE;
5058
5162
  }
5059
5163
  /*
@@ -5071,10 +5175,7 @@
5071
5175
  const {
5072
5176
  owner
5073
5177
  } = vnode;
5074
- const {
5075
- renderer
5076
- } = owner;
5077
- const elm = renderer.createText(vnode.text);
5178
+ const elm = createText$1(vnode.text);
5078
5179
  linkNodeToShadow(elm, owner);
5079
5180
  vnode.elm = elm;
5080
5181
  },
@@ -5108,10 +5209,7 @@
5108
5209
  owner,
5109
5210
  text
5110
5211
  } = vnode;
5111
- const {
5112
- renderer
5113
- } = owner;
5114
- const elm = renderer.createComment(text);
5212
+ const elm = createComment$1(text);
5115
5213
  linkNodeToShadow(elm, owner);
5116
5214
  vnode.elm = elm;
5117
5215
  },
@@ -5153,19 +5251,16 @@
5153
5251
  svg
5154
5252
  }
5155
5253
  } = vnode;
5156
- const {
5157
- renderer
5158
- } = owner;
5159
5254
  const namespace = isTrue(svg) ? SVG_NAMESPACE : undefined;
5160
- const elm = renderer.createElement(sel, namespace);
5255
+ const elm = createElement$2(sel, namespace);
5161
5256
  linkNodeToShadow(elm, owner);
5162
5257
  fallbackElmHook(elm, vnode);
5163
5258
  vnode.elm = elm;
5164
- createElmHook(vnode);
5259
+ patchElementPropsAndAttrs(null, vnode);
5165
5260
  },
5166
5261
  update: (oldVnode, vnode) => {
5167
- updateElmHook(oldVnode, vnode);
5168
- updateChildrenHook(oldVnode, vnode);
5262
+ patchElementPropsAndAttrs(oldVnode, vnode);
5263
+ patchChildren(vnode.elm, oldVnode.children, vnode.children);
5169
5264
  },
5170
5265
  insert: (vnode, parentNode, referenceNode) => {
5171
5266
  insertNodeHook(vnode, parentNode, referenceNode);
@@ -5217,10 +5312,7 @@
5217
5312
  sel,
5218
5313
  owner
5219
5314
  } = vnode;
5220
- const {
5221
- renderer
5222
- } = owner;
5223
- const UpgradableConstructor = getUpgradableConstructor(sel, renderer);
5315
+ const UpgradableConstructor = getUpgradableConstructor(sel);
5224
5316
  /**
5225
5317
  * Note: if the upgradable constructor does not expect, or throw when we new it
5226
5318
  * with a callback as the first argument, we could implement a more advanced
@@ -5242,10 +5334,10 @@
5242
5334
  throw new TypeError(`Incorrect Component Constructor`);
5243
5335
  }
5244
5336
 
5245
- createCustomElmHook(vnode);
5337
+ patchElementPropsAndAttrs(null, vnode);
5246
5338
  },
5247
5339
  update: (oldVnode, vnode) => {
5248
- updateCustomElmHook(oldVnode, vnode);
5340
+ patchElementPropsAndAttrs(oldVnode, vnode);
5249
5341
  const vm = getAssociatedVMIfPresent(vnode.elm);
5250
5342
 
5251
5343
  if (vm) {
@@ -5256,7 +5348,7 @@
5256
5348
  // will happen, but in native, it does allocate the light dom
5257
5349
 
5258
5350
 
5259
- updateChildrenHook(oldVnode, vnode);
5351
+ patchChildren(vnode.elm, oldVnode.children, vnode.children);
5260
5352
 
5261
5353
  if (vm) {
5262
5354
  if (process.env.NODE_ENV !== 'production') {
@@ -5313,8 +5405,7 @@
5313
5405
  createVM(elm, def, {
5314
5406
  mode,
5315
5407
  owner,
5316
- tagName: sel,
5317
- renderer: owner.renderer
5408
+ tagName: sel
5318
5409
  });
5319
5410
  vnode.elm = elm;
5320
5411
  const vm = getAssociatedVM(elm);
@@ -5343,12 +5434,11 @@
5343
5434
 
5344
5435
  function linkNodeToShadow(elm, owner) {
5345
5436
  const {
5346
- renderer,
5347
5437
  renderMode,
5348
5438
  shadowMode
5349
5439
  } = owner; // TODO [#1164]: this should eventually be done by the polyfill directly
5350
5440
 
5351
- if (renderer.isSyntheticShadowDefined) {
5441
+ if (isSyntheticShadowDefined$1) {
5352
5442
  if (shadowMode === 1
5353
5443
  /* Synthetic */
5354
5444
  || renderMode === 0
@@ -5880,7 +5970,6 @@
5880
5970
  const {
5881
5971
  elm,
5882
5972
  context,
5883
- renderer,
5884
5973
  renderMode,
5885
5974
  shadowMode
5886
5975
  } = vm;
@@ -5907,11 +5996,11 @@
5907
5996
  } = context;
5908
5997
 
5909
5998
  if (oldHasTokenInClass) {
5910
- renderer.getClassList(elm).remove(makeHostToken(oldToken));
5999
+ getClassList$1(elm).remove(makeHostToken(oldToken));
5911
6000
  }
5912
6001
 
5913
6002
  if (oldHasTokenInAttribute) {
5914
- renderer.removeAttribute(elm, makeHostToken(oldToken));
6003
+ removeAttribute$1(elm, makeHostToken(oldToken));
5915
6004
  } // Apply the new template styling token to the host element, if the new template has any
5916
6005
  // associated stylesheets. In the case of light DOM, also ensure there is at least one scoped stylesheet.
5917
6006
 
@@ -5923,12 +6012,12 @@
5923
6012
 
5924
6013
  if (!isUndefined$1(newToken)) {
5925
6014
  if (hasScopedStyles) {
5926
- renderer.getClassList(elm).add(makeHostToken(newToken));
6015
+ getClassList$1(elm).add(makeHostToken(newToken));
5927
6016
  newHasTokenInClass = true;
5928
6017
  }
5929
6018
 
5930
6019
  if (isSyntheticShadow) {
5931
- renderer.setAttribute(elm, makeHostToken(newToken), '');
6020
+ setAttribute$1(elm, makeHostToken(newToken), '');
5932
6021
  newHasTokenInAttribute = true;
5933
6022
  }
5934
6023
  } // Update the styling tokens present on the context object.
@@ -6049,7 +6138,6 @@
6049
6138
 
6050
6139
  function createStylesheet(vm, stylesheets) {
6051
6140
  const {
6052
- renderer,
6053
6141
  renderMode,
6054
6142
  shadowMode
6055
6143
  } = vm;
@@ -6060,9 +6148,9 @@
6060
6148
  /* Synthetic */
6061
6149
  ) {
6062
6150
  for (let i = 0; i < stylesheets.length; i++) {
6063
- renderer.insertGlobalStylesheet(stylesheets[i]);
6151
+ insertGlobalStylesheet$1(stylesheets[i]);
6064
6152
  }
6065
- } else if (renderer.ssr || renderer.isHydrating()) {
6153
+ } else if (ssr$1 || isHydrating$1()) {
6066
6154
  // Note: We need to ensure that during hydration, the stylesheets method is the same as those in ssr.
6067
6155
  // This works in the client, because the stylesheets are created, and cached in the VM
6068
6156
  // the first time the VM renders.
@@ -6076,10 +6164,10 @@
6076
6164
 
6077
6165
  for (let i = 0; i < stylesheets.length; i++) {
6078
6166
  if (isGlobal) {
6079
- renderer.insertGlobalStylesheet(stylesheets[i]);
6167
+ insertGlobalStylesheet$1(stylesheets[i]);
6080
6168
  } else {
6081
6169
  // local level
6082
- renderer.insertStylesheet(stylesheets[i], root.cmpRoot);
6170
+ insertStylesheet$1(stylesheets[i], root.cmpRoot);
6083
6171
  }
6084
6172
  }
6085
6173
  }
@@ -6771,7 +6859,6 @@
6771
6859
  const {
6772
6860
  mode,
6773
6861
  owner,
6774
- renderer,
6775
6862
  tagName
6776
6863
  } = options;
6777
6864
  const vm = {
@@ -6786,7 +6873,6 @@
6786
6873
  tagName,
6787
6874
  mode,
6788
6875
  owner,
6789
- renderer,
6790
6876
  children: EmptyArray,
6791
6877
  aChildren: EmptyArray,
6792
6878
  velements: EmptyArray,
@@ -6841,16 +6927,11 @@
6841
6927
 
6842
6928
  function computeShadowMode(vm) {
6843
6929
  const {
6844
- def,
6845
- renderer
6930
+ def
6846
6931
  } = vm;
6847
- const {
6848
- isNativeShadowDefined,
6849
- isSyntheticShadowDefined
6850
- } = renderer;
6851
6932
  let shadowMode;
6852
6933
 
6853
- if (isSyntheticShadowDefined) {
6934
+ if (isSyntheticShadowDefined$1) {
6854
6935
  if (def.renderMode === 0
6855
6936
  /* Light */
6856
6937
  ) {
@@ -6859,7 +6940,7 @@
6859
6940
  shadowMode = 0
6860
6941
  /* Native */
6861
6942
  ;
6862
- } else if (isNativeShadowDefined) {
6943
+ } else if (isNativeShadowDefined$1) {
6863
6944
  if (def.shadowSupportMode === "any"
6864
6945
  /* Any */
6865
6946
  ) {
@@ -6967,7 +7048,6 @@
6967
7048
  // patch function mutates vnodes by adding the element reference,
6968
7049
  // however, if patching fails it contains partial changes.
6969
7050
  if (oldCh !== newCh) {
6970
- const fn = hasDynamicChildren(newCh) ? updateDynamicChildren : updateStaticChildren;
6971
7051
  runWithBoundaryProtection(vm, vm, () => {
6972
7052
  // pre
6973
7053
  logOperationStart(2
@@ -6975,8 +7055,8 @@
6975
7055
  , vm);
6976
7056
  }, () => {
6977
7057
  // job
6978
- const elementToRenderTo = getRenderRoot(vm);
6979
- fn(elementToRenderTo, oldCh, newCh);
7058
+ const renderRoot = getRenderRoot(vm);
7059
+ patchChildren(renderRoot, oldCh, newCh);
6980
7060
  }, () => {
6981
7061
  // post
6982
7062
  logOperationEnd(2
@@ -6999,13 +7079,12 @@
6999
7079
 
7000
7080
  function runRenderedCallback(vm) {
7001
7081
  const {
7002
- renderer,
7003
7082
  def: {
7004
7083
  renderedCallback
7005
7084
  }
7006
7085
  } = vm;
7007
7086
 
7008
- if (isTrue(renderer.ssr)) {
7087
+ if (isTrue(ssr$1)) {
7009
7088
  return;
7010
7089
  }
7011
7090
 
@@ -7231,8 +7310,7 @@
7231
7310
 
7232
7311
  function resetComponentRoot(vm) {
7233
7312
  const {
7234
- children,
7235
- renderer
7313
+ children
7236
7314
  } = vm;
7237
7315
  const rootNode = getRenderRoot(vm);
7238
7316
 
@@ -7240,7 +7318,7 @@
7240
7318
  const child = children[i];
7241
7319
 
7242
7320
  if (!isNull(child) && !isUndefined$1(child.elm)) {
7243
- renderer.remove(child.elm, rootNode);
7321
+ remove$1(child.elm, rootNode);
7244
7322
  }
7245
7323
  }
7246
7324
 
@@ -7250,7 +7328,7 @@
7250
7328
  }
7251
7329
 
7252
7330
  function scheduleRehydration(vm) {
7253
- if (isTrue(vm.renderer.ssr) || isTrue(vm.isScheduled)) {
7331
+ if (isTrue(ssr$1) || isTrue(vm.isScheduled)) {
7254
7332
  return;
7255
7333
  }
7256
7334
 
@@ -7273,69 +7351,6 @@
7273
7351
 
7274
7352
  currentVm = currentVm.owner;
7275
7353
  }
7276
- } // slow path routine
7277
- // NOTE: we should probably more this routine to the synthetic shadow folder
7278
- // and get the allocation to be cached by in the elm instead of in the VM
7279
-
7280
-
7281
- function allocateInSlot(vm, children) {
7282
- const {
7283
- cmpSlots: oldSlots
7284
- } = vm;
7285
- const cmpSlots = vm.cmpSlots = create(null);
7286
-
7287
- for (let i = 0, len = children.length; i < len; i += 1) {
7288
- const vnode = children[i];
7289
-
7290
- if (isNull(vnode)) {
7291
- continue;
7292
- }
7293
-
7294
- const {
7295
- data
7296
- } = vnode;
7297
- const slotName = data.attrs && data.attrs.slot || '';
7298
- const vnodes = cmpSlots[slotName] = cmpSlots[slotName] || []; // re-keying the vnodes is necessary to avoid conflicts with default content for the slot
7299
- // which might have similar keys. Each vnode will always have a key that
7300
- // starts with a numeric character from compiler. In this case, we add a unique
7301
- // notation for slotted vnodes keys, e.g.: `@foo:1:1`
7302
-
7303
- if (!isUndefined$1(vnode.key)) {
7304
- vnode.key = `@${slotName}:${vnode.key}`;
7305
- }
7306
-
7307
- ArrayPush$1.call(vnodes, vnode);
7308
- }
7309
-
7310
- if (isFalse(vm.isDirty)) {
7311
- // We need to determine if the old allocation is really different from the new one
7312
- // and mark the vm as dirty
7313
- const oldKeys = keys(oldSlots);
7314
-
7315
- if (oldKeys.length !== keys(cmpSlots).length) {
7316
- markComponentAsDirty(vm);
7317
- return;
7318
- }
7319
-
7320
- for (let i = 0, len = oldKeys.length; i < len; i += 1) {
7321
- const key = oldKeys[i];
7322
-
7323
- if (isUndefined$1(cmpSlots[key]) || oldSlots[key].length !== cmpSlots[key].length) {
7324
- markComponentAsDirty(vm);
7325
- return;
7326
- }
7327
-
7328
- const oldVNodes = oldSlots[key];
7329
- const vnodes = cmpSlots[key];
7330
-
7331
- for (let j = 0, a = cmpSlots[key].length; j < a; j += 1) {
7332
- if (oldVNodes[j] !== vnodes[j]) {
7333
- markComponentAsDirty(vm);
7334
- return;
7335
- }
7336
- }
7337
- }
7338
- }
7339
7354
  }
7340
7355
 
7341
7356
  function runWithBoundaryProtection(vm, owner, pre, job, post) {
@@ -7495,7 +7510,6 @@
7495
7510
 
7496
7511
  const {
7497
7512
  elm,
7498
- renderer,
7499
7513
  context: {
7500
7514
  wiredConnecting,
7501
7515
  wiredDisconnecting
@@ -7522,7 +7536,7 @@
7522
7536
  }
7523
7537
 
7524
7538
  });
7525
- renderer.dispatchEvent(elm, contextRegistrationEvent);
7539
+ dispatchEvent$1(elm, contextRegistrationEvent);
7526
7540
  });
7527
7541
  }
7528
7542
 
@@ -7787,7 +7801,7 @@
7787
7801
  hooksAreSet = true;
7788
7802
  setSanitizeHtmlContentHook(hooks.sanitizeHtmlContent);
7789
7803
  }
7790
- /* version: 2.6.2 */
7804
+ /* version: 2.7.3 */
7791
7805
 
7792
7806
  /*
7793
7807
  * Copyright (c) 2018, salesforce.com, inc.
@@ -7816,7 +7830,9 @@
7816
7830
  const styleElements = create(null);
7817
7831
  const styleSheets = create(null);
7818
7832
  const nodesToStyleSheets = new WeakMap();
7819
- let getCustomElement, defineCustomElement, HTMLElementConstructor;
7833
+ let getCustomElement;
7834
+ let defineCustomElement;
7835
+ let HTMLElementConstructor;
7820
7836
 
7821
7837
  function isCustomElementRegistryAvailable() {
7822
7838
  if (typeof customElements === 'undefined') {
@@ -7931,188 +7947,231 @@
7931
7947
  HTMLElementConstructor.prototype = HTMLElement.prototype;
7932
7948
  }
7933
7949
 
7934
- let isHydrating = false;
7950
+ let hydrating = false;
7935
7951
 
7936
- function setIsHydrating(v) {
7937
- isHydrating = v;
7952
+ function setIsHydrating(value) {
7953
+ hydrating = value;
7938
7954
  }
7939
7955
 
7940
- const renderer = {
7941
- ssr: false,
7956
+ const ssr = false;
7942
7957
 
7943
- isHydrating() {
7944
- return isHydrating;
7945
- },
7958
+ function isHydrating() {
7959
+ return hydrating;
7960
+ }
7946
7961
 
7947
- isNativeShadowDefined: _globalThis[KEY__IS_NATIVE_SHADOW_ROOT_DEFINED],
7948
- isSyntheticShadowDefined: hasOwnProperty$1.call(Element.prototype, KEY__SHADOW_TOKEN),
7962
+ const isNativeShadowDefined = _globalThis[KEY__IS_NATIVE_SHADOW_ROOT_DEFINED];
7963
+ const isSyntheticShadowDefined = hasOwnProperty$1.call(Element.prototype, KEY__SHADOW_TOKEN);
7949
7964
 
7950
- createElement(tagName, namespace) {
7951
- return isUndefined$1(namespace) ? document.createElement(tagName) : document.createElementNS(namespace, tagName);
7952
- },
7965
+ function createElement$1(tagName, namespace) {
7966
+ return isUndefined$1(namespace) ? document.createElement(tagName) : document.createElementNS(namespace, tagName);
7967
+ }
7953
7968
 
7954
- createText(content) {
7955
- return document.createTextNode(content);
7956
- },
7969
+ function createText(content) {
7970
+ return document.createTextNode(content);
7971
+ }
7957
7972
 
7958
- createComment(content) {
7959
- return document.createComment(content);
7960
- },
7973
+ function createComment(content) {
7974
+ return document.createComment(content);
7975
+ }
7961
7976
 
7962
- insert(node, parent, anchor) {
7963
- parent.insertBefore(node, anchor);
7964
- },
7977
+ function insert(node, parent, anchor) {
7978
+ parent.insertBefore(node, anchor);
7979
+ }
7965
7980
 
7966
- remove(node, parent) {
7967
- parent.removeChild(node);
7968
- },
7981
+ function remove(node, parent) {
7982
+ parent.removeChild(node);
7983
+ }
7969
7984
 
7970
- nextSibling(node) {
7971
- return node.nextSibling;
7972
- },
7985
+ function nextSibling(node) {
7986
+ return node.nextSibling;
7987
+ }
7973
7988
 
7974
- attachShadow(element, options) {
7975
- if (isHydrating) {
7976
- return element.shadowRoot;
7977
- }
7989
+ function attachShadow(element, options) {
7990
+ if (hydrating) {
7991
+ return element.shadowRoot;
7992
+ }
7978
7993
 
7979
- return element.attachShadow(options);
7980
- },
7994
+ return element.attachShadow(options);
7995
+ }
7981
7996
 
7982
- setText(node, content) {
7983
- node.nodeValue = content;
7984
- },
7997
+ function setText(node, content) {
7998
+ node.nodeValue = content;
7999
+ }
7985
8000
 
7986
- getProperty(node, key) {
7987
- return node[key];
7988
- },
8001
+ function getProperty(node, key) {
8002
+ return node[key];
8003
+ }
7989
8004
 
7990
- setProperty(node, key, value) {
7991
- if (process.env.NODE_ENV !== 'production') {
7992
- if (node instanceof Element && !(key in node)) {
7993
- // TODO [#1297]: Move this validation to the compiler
7994
- assert.fail(`Unknown public property "${key}" of element <${node.tagName}>. This is likely a typo on the corresponding attribute "${htmlPropertyToAttribute(key)}".`);
7995
- }
8005
+ function setProperty(node, key, value) {
8006
+ if (process.env.NODE_ENV !== 'production') {
8007
+ if (node instanceof Element && !(key in node)) {
8008
+ // TODO [#1297]: Move this validation to the compiler
8009
+ assert.fail(`Unknown public property "${key}" of element <${node.tagName}>. This is likely a typo on the corresponding attribute "${htmlPropertyToAttribute(key)}".`);
7996
8010
  }
8011
+ }
7997
8012
 
7998
- node[key] = value;
7999
- },
8013
+ node[key] = value;
8014
+ }
8000
8015
 
8001
- getAttribute(element, name, namespace) {
8002
- return isUndefined$1(namespace) ? element.getAttribute(name) : element.getAttributeNS(namespace, name);
8003
- },
8016
+ function getAttribute(element, name, namespace) {
8017
+ return isUndefined$1(namespace) ? element.getAttribute(name) : element.getAttributeNS(namespace, name);
8018
+ }
8004
8019
 
8005
- setAttribute(element, name, value, namespace) {
8006
- return isUndefined$1(namespace) ? element.setAttribute(name, value) : element.setAttributeNS(namespace, name, value);
8007
- },
8020
+ function setAttribute(element, name, value, namespace) {
8021
+ return isUndefined$1(namespace) ? element.setAttribute(name, value) : element.setAttributeNS(namespace, name, value);
8022
+ }
8008
8023
 
8009
- removeAttribute(element, name, namespace) {
8010
- if (isUndefined$1(namespace)) {
8011
- element.removeAttribute(name);
8012
- } else {
8013
- element.removeAttributeNS(namespace, name);
8014
- }
8015
- },
8024
+ function removeAttribute(element, name, namespace) {
8025
+ if (isUndefined$1(namespace)) {
8026
+ element.removeAttribute(name);
8027
+ } else {
8028
+ element.removeAttributeNS(namespace, name);
8029
+ }
8030
+ }
8016
8031
 
8017
- addEventListener(target, type, callback, options) {
8018
- target.addEventListener(type, callback, options);
8019
- },
8032
+ function addEventListener(target, type, callback, options) {
8033
+ target.addEventListener(type, callback, options);
8034
+ }
8020
8035
 
8021
- removeEventListener(target, type, callback, options) {
8022
- target.removeEventListener(type, callback, options);
8023
- },
8036
+ function removeEventListener(target, type, callback, options) {
8037
+ target.removeEventListener(type, callback, options);
8038
+ }
8024
8039
 
8025
- dispatchEvent(target, event) {
8026
- return target.dispatchEvent(event);
8027
- },
8040
+ function dispatchEvent(target, event) {
8041
+ return target.dispatchEvent(event);
8042
+ }
8028
8043
 
8029
- getClassList(element) {
8030
- return element.classList;
8031
- },
8044
+ function getClassList(element) {
8045
+ return element.classList;
8046
+ }
8032
8047
 
8033
- setCSSStyleProperty(element, name, value, important) {
8034
- // TODO [#0]: How to avoid this type casting? Shall we use a different type interface to
8035
- // represent elements in the engine?
8036
- element.style.setProperty(name, value, important ? 'important' : '');
8037
- },
8048
+ function setCSSStyleProperty(element, name, value, important) {
8049
+ // TODO [#0]: How to avoid this type casting? Shall we use a different type interface to
8050
+ // represent elements in the engine?
8051
+ element.style.setProperty(name, value, important ? 'important' : '');
8052
+ }
8038
8053
 
8039
- getBoundingClientRect(element) {
8040
- return element.getBoundingClientRect();
8041
- },
8054
+ function getBoundingClientRect(element) {
8055
+ return element.getBoundingClientRect();
8056
+ }
8042
8057
 
8043
- querySelector(element, selectors) {
8044
- return element.querySelector(selectors);
8045
- },
8058
+ function querySelector(element, selectors) {
8059
+ return element.querySelector(selectors);
8060
+ }
8046
8061
 
8047
- querySelectorAll(element, selectors) {
8048
- return element.querySelectorAll(selectors);
8049
- },
8062
+ function querySelectorAll(element, selectors) {
8063
+ return element.querySelectorAll(selectors);
8064
+ }
8050
8065
 
8051
- getElementsByTagName(element, tagNameOrWildCard) {
8052
- return element.getElementsByTagName(tagNameOrWildCard);
8053
- },
8066
+ function getElementsByTagName(element, tagNameOrWildCard) {
8067
+ return element.getElementsByTagName(tagNameOrWildCard);
8068
+ }
8054
8069
 
8055
- getElementsByClassName(element, names) {
8056
- return element.getElementsByClassName(names);
8057
- },
8070
+ function getElementsByClassName(element, names) {
8071
+ return element.getElementsByClassName(names);
8072
+ }
8058
8073
 
8059
- getChildren(element) {
8060
- return element.children;
8061
- },
8074
+ function getChildren(element) {
8075
+ return element.children;
8076
+ }
8062
8077
 
8063
- getChildNodes(element) {
8064
- return element.childNodes;
8065
- },
8078
+ function getChildNodes(element) {
8079
+ return element.childNodes;
8080
+ }
8066
8081
 
8067
- getFirstChild(element) {
8068
- return element.firstChild;
8069
- },
8082
+ function getFirstChild(element) {
8083
+ return element.firstChild;
8084
+ }
8070
8085
 
8071
- getFirstElementChild(element) {
8072
- return element.firstElementChild;
8073
- },
8086
+ function getFirstElementChild(element) {
8087
+ return element.firstElementChild;
8088
+ }
8074
8089
 
8075
- getLastChild(element) {
8076
- return element.lastChild;
8077
- },
8090
+ function getLastChild(element) {
8091
+ return element.lastChild;
8092
+ }
8078
8093
 
8079
- getLastElementChild(element) {
8080
- return element.lastElementChild;
8081
- },
8094
+ function getLastElementChild(element) {
8095
+ return element.lastElementChild;
8096
+ }
8082
8097
 
8083
- isConnected(node) {
8084
- return node.isConnected;
8085
- },
8098
+ function isConnected(node) {
8099
+ return node.isConnected;
8100
+ }
8086
8101
 
8087
- insertGlobalStylesheet(content) {
8088
- if (!isUndefined$1(globalStylesheets[content])) {
8089
- return;
8090
- }
8102
+ function insertGlobalStylesheet(content) {
8103
+ if (!isUndefined$1(globalStylesheets[content])) {
8104
+ return;
8105
+ }
8091
8106
 
8092
- globalStylesheets[content] = true;
8093
- const elm = document.createElement('style');
8094
- elm.type = 'text/css';
8095
- elm.textContent = content;
8096
- globalStylesheetsParentElement.appendChild(elm);
8097
- },
8107
+ globalStylesheets[content] = true;
8108
+ const elm = document.createElement('style');
8109
+ elm.type = 'text/css';
8110
+ elm.textContent = content;
8111
+ globalStylesheetsParentElement.appendChild(elm);
8112
+ }
8098
8113
 
8099
- insertStylesheet(content, target) {
8100
- if (supportsConstructableStyleSheets) {
8101
- insertConstructableStyleSheet(content, target);
8102
- } else {
8103
- // Fall back to <style> element
8104
- insertStyleElement(content, target);
8105
- }
8106
- },
8114
+ function insertStylesheet(content, target) {
8115
+ if (supportsConstructableStyleSheets) {
8116
+ insertConstructableStyleSheet(content, target);
8117
+ } else {
8118
+ // Fall back to <style> element
8119
+ insertStyleElement(content, target);
8120
+ }
8121
+ }
8107
8122
 
8108
- assertInstanceOfHTMLElement(elm, msg) {
8109
- assert.invariant(elm instanceof HTMLElement, msg);
8110
- },
8123
+ function assertInstanceOfHTMLElement(elm, msg) {
8124
+ assert.invariant(elm instanceof HTMLElement, msg);
8125
+ }
8111
8126
 
8112
- defineCustomElement,
8113
- getCustomElement,
8114
- HTMLElement: HTMLElementConstructor
8115
- };
8127
+ const HTMLElementExported = HTMLElementConstructor;
8128
+ /*
8129
+ * Copyright (c) 2020, salesforce.com, inc.
8130
+ * All rights reserved.
8131
+ * SPDX-License-Identifier: MIT
8132
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
8133
+ */
8134
+
8135
+ setAssertInstanceOfHTMLElement(assertInstanceOfHTMLElement);
8136
+ setAttachShadow(attachShadow);
8137
+ setCreateComment(createComment);
8138
+ setCreateElement(createElement$1);
8139
+ setCreateText(createText);
8140
+ setDefineCustomElement(defineCustomElement);
8141
+ setDispatchEvent(dispatchEvent);
8142
+ setGetAttribute(getAttribute);
8143
+ setGetBoundingClientRect(getBoundingClientRect);
8144
+ setGetChildNodes(getChildNodes);
8145
+ setGetChildren(getChildren);
8146
+ setGetClassList(getClassList);
8147
+ setGetCustomElement(getCustomElement);
8148
+ setGetElementsByClassName(getElementsByClassName);
8149
+ setGetElementsByTagName(getElementsByTagName);
8150
+ setGetFirstChild(getFirstChild);
8151
+ setGetFirstElementChild(getFirstElementChild);
8152
+ setGetLastChild(getLastChild);
8153
+ setGetLastElementChild(getLastElementChild);
8154
+ setGetProperty(getProperty);
8155
+ setHTMLElement(HTMLElementExported);
8156
+ setInsert(insert);
8157
+ setInsertGlobalStylesheet(insertGlobalStylesheet);
8158
+ setInsertStylesheet(insertStylesheet);
8159
+ setIsConnected(isConnected);
8160
+ setIsHydrating$1(isHydrating);
8161
+ setIsNativeShadowDefined(isNativeShadowDefined);
8162
+ setIsSyntheticShadowDefined(isSyntheticShadowDefined);
8163
+ setNextSibling(nextSibling);
8164
+ setQuerySelector(querySelector);
8165
+ setQuerySelectorAll(querySelectorAll);
8166
+ setRemove(remove);
8167
+ setRemoveAttribute(removeAttribute);
8168
+ setRemoveEventListener(removeEventListener);
8169
+ setSetAttribute(setAttribute);
8170
+ setSetCSSStyleProperty(setCSSStyleProperty);
8171
+ setSetProperty(setProperty);
8172
+ setSetText(setText);
8173
+ setSsr(ssr);
8174
+ setAddEventListener(addEventListener);
8116
8175
  /*
8117
8176
  * Copyright (c) 2018, salesforce.com, inc.
8118
8177
  * All rights reserved.
@@ -8195,7 +8254,7 @@
8195
8254
  throw new TypeError(`"createElement" function expects an "is" option with a valid component constructor.`);
8196
8255
  }
8197
8256
 
8198
- const UpgradableConstructor = getUpgradableConstructor(sel, renderer);
8257
+ const UpgradableConstructor = getUpgradableConstructor(sel);
8199
8258
  let wasComponentUpgraded = false; // the custom element from the registry is expecting an upgrade callback
8200
8259
 
8201
8260
  /**
@@ -8210,8 +8269,7 @@
8210
8269
  createVM(elm, def, {
8211
8270
  tagName: sel,
8212
8271
  mode: options.mode !== 'closed' ? 'open' : 'closed',
8213
- owner: null,
8214
- renderer
8272
+ owner: null
8215
8273
  });
8216
8274
  ConnectingSlot.set(elm, connectRootElement);
8217
8275
  DisconnectingSlot.set(elm, disconnectRootElement);
@@ -8234,6 +8292,10 @@
8234
8292
 
8235
8293
 
8236
8294
  function hydrateComponent(element, Ctor, props = {}) {
8295
+ if (!(element instanceof Element)) {
8296
+ throw new TypeError(`"hydrateComponent" expects a valid DOM element as the first parameter but instead received ${element}.`);
8297
+ }
8298
+
8237
8299
  if (!isFunction$1(Ctor)) {
8238
8300
  throw new TypeError(`"hydrateComponent" expects a valid component constructor as the second parameter but instead received ${Ctor}.`);
8239
8301
  }
@@ -8251,7 +8313,6 @@
8251
8313
  createVM(element, def, {
8252
8314
  mode: 'open',
8253
8315
  owner: null,
8254
- renderer,
8255
8316
  tagName: element.tagName.toLowerCase()
8256
8317
  });
8257
8318
 
@@ -8322,8 +8383,7 @@
8322
8383
  createVM(this, def, {
8323
8384
  mode: 'open',
8324
8385
  owner: null,
8325
- tagName: this.tagName,
8326
- renderer
8386
+ tagName: this.tagName
8327
8387
  });
8328
8388
  }
8329
8389
 
@@ -8390,7 +8450,7 @@
8390
8450
  return false;
8391
8451
  }
8392
8452
 
8393
- if (renderer.isSyntheticShadowDefined) {
8453
+ if (isSyntheticShadowDefined) {
8394
8454
  // TODO [#1252]: old behavior that is still used by some pieces of the platform,
8395
8455
  // specifically, nodes inserted manually on places where `lwc:dom="manual"` directive is not
8396
8456
  // used, will be considered global elements.
@@ -8443,7 +8503,7 @@
8443
8503
  });
8444
8504
  freeze(LightningElement);
8445
8505
  seal(LightningElement.prototype);
8446
- /* version: 2.6.2 */
8506
+ /* version: 2.7.3 */
8447
8507
 
8448
8508
  exports.LightningElement = LightningElement;
8449
8509
  exports.__unstable__ProfilerControl = profilerControl;