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
@@ -301,7 +301,7 @@
301
301
  CACHED_PROPERTY_ATTRIBUTE_MAPPING.set(propName, attributeName);
302
302
  return attributeName;
303
303
  }
304
- /** version: 2.6.2 */
304
+ /** version: 2.7.3 */
305
305
 
306
306
  /*
307
307
  * Copyright (c) 2018, salesforce.com, inc.
@@ -415,7 +415,6 @@
415
415
  ENABLE_NODE_LIST_PATCH: null,
416
416
  ENABLE_HTML_COLLECTIONS_PATCH: null,
417
417
  ENABLE_NODE_PATCH: null,
418
- ENABLE_MIXED_SHADOW_MODE: null,
419
418
  ENABLE_WIRE_SYNC_EMIT: null
420
419
  };
421
420
 
@@ -472,7 +471,7 @@
472
471
 
473
472
  function setFeatureFlagForTest(name, value) {
474
473
  }
475
- /** version: 2.6.2 */
474
+ /** version: 2.7.3 */
476
475
 
477
476
  /* proxy-compat-disable */
478
477
 
@@ -515,6 +514,243 @@
515
514
 
516
515
  return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();
517
516
  } // Borrowed from Vue template compiler.
517
+ // Primitives
518
+ //
519
+
520
+
521
+ let ssr$1;
522
+
523
+ function setSsr(ssrImpl) {
524
+ ssr$1 = ssrImpl;
525
+ }
526
+
527
+ let isNativeShadowDefined$1;
528
+
529
+ function setIsNativeShadowDefined(isNativeShadowDefinedImpl) {
530
+ isNativeShadowDefined$1 = isNativeShadowDefinedImpl;
531
+ }
532
+
533
+ let isSyntheticShadowDefined$1;
534
+
535
+ function setIsSyntheticShadowDefined(isSyntheticShadowDefinedImpl) {
536
+ isSyntheticShadowDefined$1 = isSyntheticShadowDefinedImpl;
537
+ }
538
+
539
+ let HTMLElementExported$1;
540
+
541
+ function setHTMLElement(HTMLElementImpl) {
542
+ HTMLElementExported$1 = HTMLElementImpl;
543
+ }
544
+
545
+ let isHydrating$1;
546
+
547
+ function setIsHydrating$1(isHydratingImpl) {
548
+ isHydrating$1 = isHydratingImpl;
549
+ }
550
+
551
+ let insert$1;
552
+
553
+ function setInsert(insertImpl) {
554
+ insert$1 = insertImpl;
555
+ }
556
+
557
+ let remove$1;
558
+
559
+ function setRemove(removeImpl) {
560
+ remove$1 = removeImpl;
561
+ }
562
+
563
+ let createElement$2;
564
+
565
+ function setCreateElement(createElementImpl) {
566
+ createElement$2 = createElementImpl;
567
+ }
568
+
569
+ let createText$1;
570
+
571
+ function setCreateText(createTextImpl) {
572
+ createText$1 = createTextImpl;
573
+ }
574
+
575
+ let createComment$1;
576
+
577
+ function setCreateComment(createCommentImpl) {
578
+ createComment$1 = createCommentImpl;
579
+ }
580
+
581
+ let nextSibling$1;
582
+
583
+ function setNextSibling(nextSiblingImpl) {
584
+ nextSibling$1 = nextSiblingImpl;
585
+ }
586
+
587
+ let attachShadow$1;
588
+
589
+ function setAttachShadow(attachShadowImpl) {
590
+ attachShadow$1 = attachShadowImpl;
591
+ }
592
+
593
+ let getProperty$1;
594
+
595
+ function setGetProperty(getPropertyImpl) {
596
+ getProperty$1 = getPropertyImpl;
597
+ }
598
+
599
+ let setProperty$1;
600
+
601
+ function setSetProperty(setPropertyImpl) {
602
+ setProperty$1 = setPropertyImpl;
603
+ }
604
+
605
+ let setText$1;
606
+
607
+ function setSetText(setTextImpl) {
608
+ setText$1 = setTextImpl;
609
+ }
610
+
611
+ let getAttribute$1;
612
+
613
+ function setGetAttribute(getAttributeImpl) {
614
+ getAttribute$1 = getAttributeImpl;
615
+ }
616
+
617
+ let setAttribute$1;
618
+
619
+ function setSetAttribute(setAttributeImpl) {
620
+ setAttribute$1 = setAttributeImpl;
621
+ }
622
+
623
+ let removeAttribute$1;
624
+
625
+ function setRemoveAttribute(removeAttributeImpl) {
626
+ removeAttribute$1 = removeAttributeImpl;
627
+ }
628
+
629
+ let addEventListener$1;
630
+
631
+ function setAddEventListener(addEventListenerImpl) {
632
+ addEventListener$1 = addEventListenerImpl;
633
+ }
634
+
635
+ let removeEventListener$1;
636
+
637
+ function setRemoveEventListener(removeEventListenerImpl) {
638
+ removeEventListener$1 = removeEventListenerImpl;
639
+ }
640
+
641
+ let dispatchEvent$1;
642
+
643
+ function setDispatchEvent(dispatchEventImpl) {
644
+ dispatchEvent$1 = dispatchEventImpl;
645
+ }
646
+
647
+ let getClassList$1;
648
+
649
+ function setGetClassList(getClassListImpl) {
650
+ getClassList$1 = getClassListImpl;
651
+ }
652
+
653
+ let setCSSStyleProperty$1;
654
+
655
+ function setSetCSSStyleProperty(setCSSStylePropertyImpl) {
656
+ setCSSStyleProperty$1 = setCSSStylePropertyImpl;
657
+ }
658
+
659
+ let getBoundingClientRect$1;
660
+
661
+ function setGetBoundingClientRect(getBoundingClientRectImpl) {
662
+ getBoundingClientRect$1 = getBoundingClientRectImpl;
663
+ }
664
+
665
+ let querySelector$1;
666
+
667
+ function setQuerySelector(querySelectorImpl) {
668
+ querySelector$1 = querySelectorImpl;
669
+ }
670
+
671
+ let querySelectorAll$1;
672
+
673
+ function setQuerySelectorAll(querySelectorAllImpl) {
674
+ querySelectorAll$1 = querySelectorAllImpl;
675
+ }
676
+
677
+ let getElementsByTagName$1;
678
+
679
+ function setGetElementsByTagName(getElementsByTagNameImpl) {
680
+ getElementsByTagName$1 = getElementsByTagNameImpl;
681
+ }
682
+
683
+ let getElementsByClassName$1;
684
+
685
+ function setGetElementsByClassName(getElementsByClassNameImpl) {
686
+ getElementsByClassName$1 = getElementsByClassNameImpl;
687
+ }
688
+
689
+ let getChildren$1;
690
+
691
+ function setGetChildren(getChildrenImpl) {
692
+ getChildren$1 = getChildrenImpl;
693
+ }
694
+
695
+ let getChildNodes$1;
696
+
697
+ function setGetChildNodes(getChildNodesImpl) {
698
+ getChildNodes$1 = getChildNodesImpl;
699
+ }
700
+
701
+ let getFirstChild$1;
702
+
703
+ function setGetFirstChild(getFirstChildImpl) {
704
+ getFirstChild$1 = getFirstChildImpl;
705
+ }
706
+
707
+ let getFirstElementChild$1;
708
+
709
+ function setGetFirstElementChild(getFirstElementChildImpl) {
710
+ getFirstElementChild$1 = getFirstElementChildImpl;
711
+ }
712
+
713
+ let getLastChild$1;
714
+
715
+ function setGetLastChild(getLastChildImpl) {
716
+ getLastChild$1 = getLastChildImpl;
717
+ }
718
+
719
+ let getLastElementChild$1;
720
+
721
+ function setGetLastElementChild(getLastElementChildImpl) {
722
+ getLastElementChild$1 = getLastElementChildImpl;
723
+ }
724
+
725
+ let isConnected$1;
726
+
727
+ function setIsConnected(isConnectedImpl) {
728
+ isConnected$1 = isConnectedImpl;
729
+ }
730
+
731
+ let insertGlobalStylesheet$1;
732
+
733
+ function setInsertGlobalStylesheet(insertGlobalStylesheetImpl) {
734
+ insertGlobalStylesheet$1 = insertGlobalStylesheetImpl;
735
+ }
736
+
737
+ let insertStylesheet$1;
738
+
739
+ function setInsertStylesheet(insertStylesheetImpl) {
740
+ insertStylesheet$1 = insertStylesheetImpl;
741
+ }
742
+
743
+ let defineCustomElement$1;
744
+
745
+ function setDefineCustomElement(defineCustomElementImpl) {
746
+ defineCustomElement$1 = defineCustomElementImpl;
747
+ }
748
+
749
+ let getCustomElement$1;
750
+
751
+ function setGetCustomElement(getCustomElementImpl) {
752
+ getCustomElement$1 = getCustomElementImpl;
753
+ }
518
754
  /*
519
755
  * Copyright (c) 2019, salesforce.com, inc.
520
756
  * All rights reserved.
@@ -633,492 +869,8 @@
633
869
 
634
870
  ArrayPush$1.call(this.listeners, reactiveObservers);
635
871
  }
636
-
637
- }
638
- /*
639
- * Copyright (c) 2018, salesforce.com, inc.
640
- * All rights reserved.
641
- * SPDX-License-Identifier: MIT
642
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
643
- */
644
-
645
-
646
- function componentValueMutated(vm, key) {
647
- valueMutated(vm.component, key);
648
- }
649
-
650
- function componentValueObserved(vm, key) {
651
- valueObserved(vm.component, key);
652
- }
653
- /*
654
- * Copyright (c) 2018, salesforce.com, inc.
655
- * All rights reserved.
656
- * SPDX-License-Identifier: MIT
657
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
658
- */
659
-
660
-
661
- function getComponentTag(vm) {
662
- return `<${StringToLowerCase.call(vm.tagName)}>`;
663
- } // TODO [#1695]: Unify getComponentStack and getErrorComponentStack
664
-
665
-
666
- function getComponentStack(vm) {
667
- const stack = [];
668
- let prefix = '';
669
-
670
- while (!isNull(vm.owner)) {
671
- ArrayPush$1.call(stack, prefix + getComponentTag(vm));
672
- vm = vm.owner;
673
- prefix += '\t';
674
- }
675
-
676
- return ArrayJoin.call(stack, '\n');
677
- }
678
-
679
- function getErrorComponentStack(vm) {
680
- const wcStack = [];
681
- let currentVm = vm;
682
-
683
- while (!isNull(currentVm)) {
684
- ArrayPush$1.call(wcStack, getComponentTag(currentVm));
685
- currentVm = currentVm.owner;
686
- }
687
-
688
- return wcStack.reverse().join('\n\t');
689
- }
690
- /*
691
- * Copyright (c) 2018, salesforce.com, inc.
692
- * All rights reserved.
693
- * SPDX-License-Identifier: MIT
694
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
695
- */
696
-
697
-
698
- function log(method, message, vm) {
699
- let msg = `[LWC ${method}]: ${message}`;
700
-
701
- if (!isUndefined$1(vm)) {
702
- msg = `${msg}\n${getComponentStack(vm)}`;
703
- }
704
-
705
- try {
706
- throw new Error(msg);
707
- } catch (e) {
708
- /* eslint-disable-next-line no-console */
709
- console[method](e);
710
- }
711
- }
712
-
713
- function logWarn(message, vm) {
714
- log('warn', message, vm);
715
- }
716
- /*
717
- * Copyright (c) 2018, salesforce.com, inc.
718
- * All rights reserved.
719
- * SPDX-License-Identifier: MIT
720
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
721
- */
722
-
723
-
724
- function handleEvent(event, vnode) {
725
- const {
726
- type
727
- } = event;
728
- const {
729
- data: {
730
- on
731
- }
732
- } = vnode;
733
- const handler = on && on[type]; // call event handler if exists
734
-
735
- if (handler) {
736
- handler.call(undefined, event);
737
- }
738
- }
739
-
740
- function createListener() {
741
- return function handler(event) {
742
- handleEvent(event, handler.vnode);
743
- };
744
- }
745
-
746
- function updateAllEventListeners(oldVnode, vnode) {
747
- if (isUndefined$1(oldVnode.listener)) {
748
- createAllEventListeners(vnode);
749
- } else {
750
- vnode.listener = oldVnode.listener;
751
- vnode.listener.vnode = vnode;
752
- }
753
- }
754
-
755
- function createAllEventListeners(vnode) {
756
- const {
757
- elm,
758
- data: {
759
- on
760
- },
761
- owner: {
762
- renderer
763
- }
764
- } = vnode;
765
-
766
- if (isUndefined$1(on)) {
767
- return;
768
- }
769
-
770
- const listener = vnode.listener = createListener();
771
- listener.vnode = vnode;
772
- let name;
773
-
774
- for (name in on) {
775
- renderer.addEventListener(elm, name, listener);
776
- }
777
- }
778
-
779
- var modEvents = {
780
- update: updateAllEventListeners,
781
- create: createAllEventListeners
782
- };
783
- /*
784
- * Copyright (c) 2018, salesforce.com, inc.
785
- * All rights reserved.
786
- * SPDX-License-Identifier: MIT
787
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
788
- */
789
-
790
- const defaultDefHTMLPropertyNames = ['accessKey', 'dir', 'draggable', 'hidden', 'id', 'lang', 'spellcheck', 'tabIndex', 'title'];
791
-
792
- function offsetPropertyErrorMessage(name) {
793
- 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.`;
794
- } // Global HTML Attributes & Properties
795
- // https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes
796
- // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement
797
-
798
-
799
- assign(create(null), {
800
- accessKey: {
801
- attribute: 'accesskey'
802
- },
803
- accessKeyLabel: {
804
- readOnly: true
805
- },
806
- className: {
807
- attribute: 'class',
808
- 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.'
809
- },
810
- contentEditable: {
811
- attribute: 'contenteditable'
812
- },
813
- dataset: {
814
- readOnly: true,
815
- 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."
816
- },
817
- dir: {
818
- attribute: 'dir'
819
- },
820
- draggable: {
821
- attribute: 'draggable'
822
- },
823
- dropzone: {
824
- attribute: 'dropzone',
825
- readOnly: true
826
- },
827
- hidden: {
828
- attribute: 'hidden'
829
- },
830
- id: {
831
- attribute: 'id'
832
- },
833
- inputMode: {
834
- attribute: 'inputmode'
835
- },
836
- lang: {
837
- attribute: 'lang'
838
- },
839
- slot: {
840
- attribute: 'slot',
841
- error: 'Using the `slot` property is an anti-pattern.'
842
- },
843
- spellcheck: {
844
- attribute: 'spellcheck'
845
- },
846
- style: {
847
- attribute: 'style'
848
- },
849
- tabIndex: {
850
- attribute: 'tabindex'
851
- },
852
- title: {
853
- attribute: 'title'
854
- },
855
- translate: {
856
- attribute: 'translate'
857
- },
858
- // additional "global attributes" that are not present in the link above.
859
- isContentEditable: {
860
- readOnly: true
861
- },
862
- offsetHeight: {
863
- readOnly: true,
864
- error: offsetPropertyErrorMessage('offsetHeight')
865
- },
866
- offsetLeft: {
867
- readOnly: true,
868
- error: offsetPropertyErrorMessage('offsetLeft')
869
- },
870
- offsetParent: {
871
- readOnly: true
872
- },
873
- offsetTop: {
874
- readOnly: true,
875
- error: offsetPropertyErrorMessage('offsetTop')
876
- },
877
- offsetWidth: {
878
- readOnly: true,
879
- error: offsetPropertyErrorMessage('offsetWidth')
880
- },
881
- role: {
882
- attribute: 'role'
883
- }
884
- });
885
- let controlledElement = null;
886
- let controlledAttributeName;
887
-
888
- function isAttributeLocked(elm, attrName) {
889
- return elm !== controlledElement || attrName !== controlledAttributeName;
890
- }
891
-
892
- function lockAttribute(_elm, _key) {
893
- controlledElement = null;
894
- controlledAttributeName = undefined;
895
- }
896
-
897
- function unlockAttribute(elm, key) {
898
- controlledElement = elm;
899
- controlledAttributeName = key;
900
- }
901
- /*
902
- * Copyright (c) 2018, salesforce.com, inc.
903
- * All rights reserved.
904
- * SPDX-License-Identifier: MIT
905
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
906
- */
907
-
908
-
909
- const xlinkNS = 'http://www.w3.org/1999/xlink';
910
- const xmlNS = 'http://www.w3.org/XML/1998/namespace';
911
- const ColonCharCode = 58;
912
-
913
- function updateAttrs(oldVnode, vnode) {
914
- const {
915
- data: {
916
- attrs
917
- },
918
- owner: {
919
- renderer
920
- }
921
- } = vnode;
922
-
923
- if (isUndefined$1(attrs)) {
924
- return;
925
- }
926
-
927
- let {
928
- data: {
929
- attrs: oldAttrs
930
- }
931
- } = oldVnode;
932
-
933
- if (oldAttrs === attrs) {
934
- return;
935
- }
936
-
937
- const elm = vnode.elm;
938
- const {
939
- setAttribute,
940
- removeAttribute
941
- } = renderer;
942
- let key;
943
- oldAttrs = isUndefined$1(oldAttrs) ? EmptyObject : oldAttrs; // update modified attributes, add new attributes
944
- // this routine is only useful for data-* attributes in all kind of elements
945
- // and aria-* in standard elements (custom elements will use props for these)
946
-
947
- for (key in attrs) {
948
- const cur = attrs[key];
949
- const old = oldAttrs[key];
950
-
951
- if (old !== cur) {
952
- unlockAttribute(elm, key);
953
-
954
- if (StringCharCodeAt.call(key, 3) === ColonCharCode) {
955
- // Assume xml namespace
956
- setAttribute(elm, key, cur, xmlNS);
957
- } else if (StringCharCodeAt.call(key, 5) === ColonCharCode) {
958
- // Assume xlink namespace
959
- setAttribute(elm, key, cur, xlinkNS);
960
- } else if (isNull(cur)) {
961
- removeAttribute(elm, key);
962
- } else {
963
- setAttribute(elm, key, cur);
964
- }
965
-
966
- lockAttribute();
967
- }
968
- }
969
- }
970
-
971
- const emptyVNode$3 = {
972
- data: {}
973
- };
974
- var modAttrs = {
975
- create: vnode => updateAttrs(emptyVNode$3, vnode),
976
- update: updateAttrs
977
- };
978
- /*
979
- * Copyright (c) 2018, salesforce.com, inc.
980
- * All rights reserved.
981
- * SPDX-License-Identifier: MIT
982
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
983
- */
984
-
985
- function isLiveBindingProp(sel, key) {
986
- // For properties with live bindings, we read values from the DOM element
987
- // instead of relying on internally tracked values.
988
- return sel === 'input' && (key === 'value' || key === 'checked');
989
- }
990
-
991
- function update(oldVnode, vnode) {
992
- const props = vnode.data.props;
993
-
994
- if (isUndefined$1(props)) {
995
- return;
996
- }
997
-
998
- const oldProps = oldVnode.data.props;
999
-
1000
- if (oldProps === props) {
1001
- return;
1002
- }
1003
-
1004
- const isFirstPatch = isUndefined$1(oldProps);
1005
- const {
1006
- elm,
1007
- sel,
1008
- owner: {
1009
- renderer
1010
- }
1011
- } = vnode;
1012
-
1013
- for (const key in props) {
1014
- const cur = props[key]; // if it is the first time this element is patched, or the current value is different to the previous value...
1015
-
1016
- if (isFirstPatch || cur !== (isLiveBindingProp(sel, key) ? renderer.getProperty(elm, key) : oldProps[key])) {
1017
- renderer.setProperty(elm, key, cur);
1018
- }
1019
- }
1020
- }
1021
-
1022
- const emptyVNode$2 = {
1023
- data: {}
1024
- };
1025
- var modProps = {
1026
- create: vnode => update(emptyVNode$2, vnode),
1027
- update
1028
- };
1029
- /*
1030
- * Copyright (c) 2018, salesforce.com, inc.
1031
- * All rights reserved.
1032
- * SPDX-License-Identifier: MIT
1033
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
1034
- */
1035
-
1036
- const classNameToClassMap = create(null);
1037
-
1038
- function getMapFromClassName(className) {
1039
- // Intentionally using == to match undefined and null values from computed style attribute
1040
- if (className == null) {
1041
- return EmptyObject;
1042
- } // computed class names must be string
1043
-
1044
-
1045
- className = isString(className) ? className : className + '';
1046
- let map = classNameToClassMap[className];
1047
-
1048
- if (map) {
1049
- return map;
1050
- }
1051
-
1052
- map = create(null);
1053
- let start = 0;
1054
- let o;
1055
- const len = className.length;
1056
-
1057
- for (o = 0; o < len; o++) {
1058
- if (StringCharCodeAt.call(className, o) === SPACE_CHAR) {
1059
- if (o > start) {
1060
- map[StringSlice.call(className, start, o)] = true;
1061
- }
1062
-
1063
- start = o + 1;
1064
- }
1065
- }
1066
-
1067
- if (o > start) {
1068
- map[StringSlice.call(className, start, o)] = true;
1069
- }
1070
-
1071
- classNameToClassMap[className] = map;
1072
-
1073
- return map;
1074
- }
1075
-
1076
- function updateClassAttribute(oldVnode, vnode) {
1077
- const {
1078
- elm,
1079
- data: {
1080
- className: newClass
1081
- },
1082
- owner: {
1083
- renderer
1084
- }
1085
- } = vnode;
1086
- const {
1087
- data: {
1088
- className: oldClass
1089
- }
1090
- } = oldVnode;
1091
-
1092
- if (oldClass === newClass) {
1093
- return;
1094
- }
1095
-
1096
- const classList = renderer.getClassList(elm);
1097
- const newClassMap = getMapFromClassName(newClass);
1098
- const oldClassMap = getMapFromClassName(oldClass);
1099
- let name;
1100
-
1101
- for (name in oldClassMap) {
1102
- // remove only if it is not in the new class collection and it is not set from within the instance
1103
- if (isUndefined$1(newClassMap[name])) {
1104
- classList.remove(name);
1105
- }
1106
- }
1107
-
1108
- for (name in newClassMap) {
1109
- if (isUndefined$1(oldClassMap[name])) {
1110
- classList.add(name);
1111
- }
1112
- }
1113
- }
1114
-
1115
- const emptyVNode$1 = {
1116
- data: {}
1117
- };
1118
- var modComputedClassName = {
1119
- create: vnode => updateClassAttribute(emptyVNode$1, vnode),
1120
- update: updateClassAttribute
1121
- };
872
+
873
+ }
1122
874
  /*
1123
875
  * Copyright (c) 2018, salesforce.com, inc.
1124
876
  * All rights reserved.
@@ -1126,106 +878,77 @@
1126
878
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
1127
879
  */
1128
880
 
1129
- function updateStyleAttribute(oldVnode, vnode) {
1130
- const {
1131
- elm,
1132
- data: {
1133
- style: newStyle
1134
- },
1135
- owner: {
1136
- renderer
1137
- }
1138
- } = vnode;
1139
- const {
1140
- setAttribute,
1141
- removeAttribute
1142
- } = renderer;
1143
-
1144
- if (oldVnode.data.style === newStyle) {
1145
- return;
1146
- }
1147
881
 
1148
- if (!isString(newStyle) || newStyle === '') {
1149
- removeAttribute(elm, 'style');
1150
- } else {
1151
- setAttribute(elm, 'style', newStyle);
1152
- }
882
+ function componentValueMutated(vm, key) {
883
+ valueMutated(vm.component, key);
1153
884
  }
1154
885
 
1155
- const emptyVNode = {
1156
- data: {}
1157
- };
1158
- var modComputedStyle = {
1159
- create: vnode => updateStyleAttribute(emptyVNode, vnode),
1160
- update: updateStyleAttribute
1161
- };
886
+ function componentValueObserved(vm, key) {
887
+ valueObserved(vm.component, key);
888
+ }
1162
889
  /*
1163
890
  * Copyright (c) 2018, salesforce.com, inc.
1164
891
  * All rights reserved.
1165
892
  * SPDX-License-Identifier: MIT
1166
893
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
1167
894
  */
1168
- // The compiler takes care of transforming the inline classnames into an object. It's faster to set the
1169
- // different classnames properties individually instead of via a string.
1170
895
 
1171
- function createClassAttribute(vnode) {
1172
- const {
1173
- elm,
1174
- data: {
1175
- classMap
1176
- },
1177
- owner: {
1178
- renderer
1179
- }
1180
- } = vnode;
1181
896
 
1182
- if (isUndefined$1(classMap)) {
1183
- return;
1184
- }
897
+ function getComponentTag(vm) {
898
+ return `<${StringToLowerCase.call(vm.tagName)}>`;
899
+ } // TODO [#1695]: Unify getComponentStack and getErrorComponentStack
1185
900
 
1186
- const classList = renderer.getClassList(elm);
1187
901
 
1188
- for (const name in classMap) {
1189
- classList.add(name);
902
+ function getComponentStack(vm) {
903
+ const stack = [];
904
+ let prefix = '';
905
+
906
+ while (!isNull(vm.owner)) {
907
+ ArrayPush$1.call(stack, prefix + getComponentTag(vm));
908
+ vm = vm.owner;
909
+ prefix += '\t';
1190
910
  }
911
+
912
+ return ArrayJoin.call(stack, '\n');
1191
913
  }
1192
914
 
1193
- var modStaticClassName = {
1194
- create: createClassAttribute
1195
- };
915
+ function getErrorComponentStack(vm) {
916
+ const wcStack = [];
917
+ let currentVm = vm;
918
+
919
+ while (!isNull(currentVm)) {
920
+ ArrayPush$1.call(wcStack, getComponentTag(currentVm));
921
+ currentVm = currentVm.owner;
922
+ }
923
+
924
+ return wcStack.reverse().join('\n\t');
925
+ }
1196
926
  /*
1197
927
  * Copyright (c) 2018, salesforce.com, inc.
1198
928
  * All rights reserved.
1199
929
  * SPDX-License-Identifier: MIT
1200
930
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
1201
931
  */
1202
- // The compiler takes care of transforming the inline style into an object. It's faster to set the
1203
- // different style properties individually instead of via a string.
1204
932
 
1205
- function createStyleAttribute(vnode) {
1206
- const {
1207
- elm,
1208
- data: {
1209
- styleDecls
1210
- },
1211
- owner: {
1212
- renderer
1213
- }
1214
- } = vnode;
1215
933
 
1216
- if (isUndefined$1(styleDecls)) {
1217
- return;
934
+ function log(method, message, vm) {
935
+ let msg = `[LWC ${method}]: ${message}`;
936
+
937
+ if (!isUndefined$1(vm)) {
938
+ msg = `${msg}\n${getComponentStack(vm)}`;
1218
939
  }
1219
940
 
1220
- for (let i = 0; i < styleDecls.length; i++) {
1221
- const [prop, value, important] = styleDecls[i];
1222
- renderer.setCSSStyleProperty(elm, prop, value, important);
941
+ try {
942
+ throw new Error(msg);
943
+ } catch (e) {
944
+ /* eslint-disable-next-line no-console */
945
+ console[method](e);
1223
946
  }
1224
947
  }
1225
948
 
1226
- var modStaticStyle = {
1227
- create: createStyleAttribute
1228
- };
949
+ function logWarn(message, vm) {
950
+ log('warn', message, vm);
951
+ }
1229
952
  /*
1230
953
  * Copyright (c) 2018, salesforce.com, inc.
1231
954
  * All rights reserved.
@@ -1233,14 +956,6 @@
1233
956
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
1234
957
  */
1235
958
 
1236
- /**
1237
- @license
1238
- Copyright (c) 2015 Simon Friis Vindum.
1239
- This code may only be used under the MIT License found at
1240
- https://github.com/snabbdom/snabbdom/blob/master/LICENSE
1241
- Code distributed by Snabbdom as part of the Snabbdom project at
1242
- https://github.com/snabbdom/snabbdom/
1243
- */
1244
959
 
1245
960
  function isUndef(s) {
1246
961
  return s === undefined;
@@ -1329,7 +1044,7 @@
1329
1044
  } else if (sameVnode(oldStartVnode, newEndVnode)) {
1330
1045
  // Vnode moved right
1331
1046
  patchVnode(oldStartVnode, newEndVnode);
1332
- newEndVnode.hook.move(oldStartVnode, parentElm, oldEndVnode.owner.renderer.nextSibling(oldEndVnode.elm));
1047
+ newEndVnode.hook.move(oldStartVnode, parentElm, nextSibling$1(oldEndVnode.elm));
1333
1048
  oldStartVnode = oldCh[++oldStartIdx];
1334
1049
  newEndVnode = newCh[--newEndIdx];
1335
1050
  } else if (sameVnode(oldEndVnode, newStartVnode)) {
@@ -1442,7 +1157,126 @@
1442
1157
  }
1443
1158
  }
1444
1159
  /*
1445
- * Copyright (c) 2020, salesforce.com, inc.
1160
+ * Copyright (c) 2018, salesforce.com, inc.
1161
+ * All rights reserved.
1162
+ * SPDX-License-Identifier: MIT
1163
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
1164
+ */
1165
+
1166
+
1167
+ const defaultDefHTMLPropertyNames = ['accessKey', 'dir', 'draggable', 'hidden', 'id', 'lang', 'spellcheck', 'tabIndex', 'title'];
1168
+
1169
+ function offsetPropertyErrorMessage(name) {
1170
+ 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.`;
1171
+ } // Global HTML Attributes & Properties
1172
+ // https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes
1173
+ // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement
1174
+
1175
+
1176
+ assign(create(null), {
1177
+ accessKey: {
1178
+ attribute: 'accesskey'
1179
+ },
1180
+ accessKeyLabel: {
1181
+ readOnly: true
1182
+ },
1183
+ className: {
1184
+ attribute: 'class',
1185
+ 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.'
1186
+ },
1187
+ contentEditable: {
1188
+ attribute: 'contenteditable'
1189
+ },
1190
+ dataset: {
1191
+ readOnly: true,
1192
+ 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."
1193
+ },
1194
+ dir: {
1195
+ attribute: 'dir'
1196
+ },
1197
+ draggable: {
1198
+ attribute: 'draggable'
1199
+ },
1200
+ dropzone: {
1201
+ attribute: 'dropzone',
1202
+ readOnly: true
1203
+ },
1204
+ hidden: {
1205
+ attribute: 'hidden'
1206
+ },
1207
+ id: {
1208
+ attribute: 'id'
1209
+ },
1210
+ inputMode: {
1211
+ attribute: 'inputmode'
1212
+ },
1213
+ lang: {
1214
+ attribute: 'lang'
1215
+ },
1216
+ slot: {
1217
+ attribute: 'slot',
1218
+ error: 'Using the `slot` property is an anti-pattern.'
1219
+ },
1220
+ spellcheck: {
1221
+ attribute: 'spellcheck'
1222
+ },
1223
+ style: {
1224
+ attribute: 'style'
1225
+ },
1226
+ tabIndex: {
1227
+ attribute: 'tabindex'
1228
+ },
1229
+ title: {
1230
+ attribute: 'title'
1231
+ },
1232
+ translate: {
1233
+ attribute: 'translate'
1234
+ },
1235
+ // additional "global attributes" that are not present in the link above.
1236
+ isContentEditable: {
1237
+ readOnly: true
1238
+ },
1239
+ offsetHeight: {
1240
+ readOnly: true,
1241
+ error: offsetPropertyErrorMessage('offsetHeight')
1242
+ },
1243
+ offsetLeft: {
1244
+ readOnly: true,
1245
+ error: offsetPropertyErrorMessage('offsetLeft')
1246
+ },
1247
+ offsetParent: {
1248
+ readOnly: true
1249
+ },
1250
+ offsetTop: {
1251
+ readOnly: true,
1252
+ error: offsetPropertyErrorMessage('offsetTop')
1253
+ },
1254
+ offsetWidth: {
1255
+ readOnly: true,
1256
+ error: offsetPropertyErrorMessage('offsetWidth')
1257
+ },
1258
+ role: {
1259
+ attribute: 'role'
1260
+ }
1261
+ });
1262
+ let controlledElement = null;
1263
+ let controlledAttributeName;
1264
+
1265
+ function isAttributeLocked(elm, attrName) {
1266
+ return elm !== controlledElement || attrName !== controlledAttributeName;
1267
+ }
1268
+
1269
+ function lockAttribute(_elm, _key) {
1270
+ controlledElement = null;
1271
+ controlledAttributeName = undefined;
1272
+ }
1273
+
1274
+ function unlockAttribute(elm, key) {
1275
+ controlledElement = elm;
1276
+ controlledAttributeName = key;
1277
+ }
1278
+ /*
1279
+ * Copyright (c) 2018, salesforce.com, inc.
1446
1280
  * All rights reserved.
1447
1281
  * SPDX-License-Identifier: MIT
1448
1282
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
@@ -2186,8 +2020,7 @@
2186
2020
 
2187
2021
 
2188
2022
  const LightningElement = function () {
2189
-
2190
-
2023
+ // This should be as performant as possible, while any initialization should be done lazily
2191
2024
  if (isNull(vmBeingConstructed)) {
2192
2025
  throw new ReferenceError('Illegal constructor');
2193
2026
  }
@@ -2195,8 +2028,7 @@
2195
2028
  const vm = vmBeingConstructed;
2196
2029
  const {
2197
2030
  def,
2198
- elm,
2199
- renderer
2031
+ elm
2200
2032
  } = vm;
2201
2033
  const {
2202
2034
  bridge
@@ -2229,23 +2061,22 @@
2229
2061
  if (vm.renderMode === 1
2230
2062
  /* Shadow */
2231
2063
  ) {
2232
- attachShadow(vm);
2064
+ doAttachShadow(vm);
2233
2065
  } // Adding extra guard rails in DEV mode.
2234
2066
 
2235
2067
  return this;
2236
2068
  };
2237
2069
 
2238
- function attachShadow(vm) {
2070
+ function doAttachShadow(vm) {
2239
2071
  const {
2240
2072
  elm,
2241
2073
  mode,
2242
- renderer,
2243
2074
  shadowMode,
2244
2075
  def: {
2245
2076
  ctor
2246
2077
  }
2247
2078
  } = vm;
2248
- const cmpRoot = renderer.attachShadow(elm, {
2079
+ const cmpRoot = attachShadow$1(elm, {
2249
2080
  [KEY__SYNTHETIC_MODE]: shadowMode === 1
2250
2081
  /* Synthetic */
2251
2082
  ,
@@ -2262,163 +2093,121 @@
2262
2093
 
2263
2094
  dispatchEvent(event) {
2264
2095
  const {
2265
- elm,
2266
- renderer: {
2267
- dispatchEvent
2268
- }
2096
+ elm
2269
2097
  } = getAssociatedVM(this);
2270
- return dispatchEvent(elm, event);
2098
+ return dispatchEvent$1(elm, event);
2271
2099
  },
2272
2100
 
2273
2101
  addEventListener(type, listener, options) {
2274
2102
  const vm = getAssociatedVM(this);
2275
2103
  const {
2276
- elm,
2277
- renderer: {
2278
- addEventListener
2279
- }
2104
+ elm
2280
2105
  } = vm;
2281
2106
 
2282
2107
  const wrappedListener = getWrappedComponentsListener(vm, listener);
2283
- addEventListener(elm, type, wrappedListener, options);
2108
+ addEventListener$1(elm, type, wrappedListener, options);
2284
2109
  },
2285
2110
 
2286
2111
  removeEventListener(type, listener, options) {
2287
2112
  const vm = getAssociatedVM(this);
2288
2113
  const {
2289
- elm,
2290
- renderer: {
2291
- removeEventListener
2292
- }
2114
+ elm
2293
2115
  } = vm;
2294
2116
  const wrappedListener = getWrappedComponentsListener(vm, listener);
2295
- removeEventListener(elm, type, wrappedListener, options);
2117
+ removeEventListener$1(elm, type, wrappedListener, options);
2296
2118
  },
2297
2119
 
2298
2120
  hasAttribute(name) {
2299
2121
  const {
2300
- elm,
2301
- renderer: {
2302
- getAttribute
2303
- }
2122
+ elm
2304
2123
  } = getAssociatedVM(this);
2305
- return !isNull(getAttribute(elm, name));
2124
+ return !isNull(getAttribute$1(elm, name));
2306
2125
  },
2307
2126
 
2308
2127
  hasAttributeNS(namespace, name) {
2309
2128
  const {
2310
- elm,
2311
- renderer: {
2312
- getAttribute
2313
- }
2129
+ elm
2314
2130
  } = getAssociatedVM(this);
2315
- return !isNull(getAttribute(elm, name, namespace));
2131
+ return !isNull(getAttribute$1(elm, name, namespace));
2316
2132
  },
2317
2133
 
2318
2134
  removeAttribute(name) {
2319
2135
  const {
2320
- elm,
2321
- renderer: {
2322
- removeAttribute
2323
- }
2136
+ elm
2324
2137
  } = getAssociatedVM(this);
2325
2138
  unlockAttribute(elm, name);
2326
- removeAttribute(elm, name);
2139
+ removeAttribute$1(elm, name);
2327
2140
  lockAttribute();
2328
2141
  },
2329
2142
 
2330
2143
  removeAttributeNS(namespace, name) {
2331
2144
  const {
2332
- elm,
2333
- renderer: {
2334
- removeAttribute
2335
- }
2145
+ elm
2336
2146
  } = getAssociatedVM(this);
2337
2147
  unlockAttribute(elm, name);
2338
- removeAttribute(elm, name, namespace);
2148
+ removeAttribute$1(elm, name, namespace);
2339
2149
  lockAttribute();
2340
2150
  },
2341
2151
 
2342
2152
  getAttribute(name) {
2343
2153
  const {
2344
- elm,
2345
- renderer: {
2346
- getAttribute
2347
- }
2154
+ elm
2348
2155
  } = getAssociatedVM(this);
2349
- return getAttribute(elm, name);
2156
+ return getAttribute$1(elm, name);
2350
2157
  },
2351
2158
 
2352
2159
  getAttributeNS(namespace, name) {
2353
2160
  const {
2354
- elm,
2355
- renderer: {
2356
- getAttribute
2357
- }
2161
+ elm
2358
2162
  } = getAssociatedVM(this);
2359
- return getAttribute(elm, name, namespace);
2163
+ return getAttribute$1(elm, name, namespace);
2360
2164
  },
2361
2165
 
2362
2166
  setAttribute(name, value) {
2363
2167
  const vm = getAssociatedVM(this);
2364
2168
  const {
2365
- elm,
2366
- renderer: {
2367
- setAttribute
2368
- }
2169
+ elm
2369
2170
  } = vm;
2370
2171
 
2371
2172
  unlockAttribute(elm, name);
2372
- setAttribute(elm, name, value);
2173
+ setAttribute$1(elm, name, value);
2373
2174
  lockAttribute();
2374
2175
  },
2375
2176
 
2376
2177
  setAttributeNS(namespace, name, value) {
2377
2178
  const vm = getAssociatedVM(this);
2378
2179
  const {
2379
- elm,
2380
- renderer: {
2381
- setAttribute
2382
- }
2180
+ elm
2383
2181
  } = vm;
2384
2182
 
2385
2183
  unlockAttribute(elm, name);
2386
- setAttribute(elm, name, value, namespace);
2184
+ setAttribute$1(elm, name, value, namespace);
2387
2185
  lockAttribute();
2388
2186
  },
2389
2187
 
2390
2188
  getBoundingClientRect() {
2391
2189
  const vm = getAssociatedVM(this);
2392
2190
  const {
2393
- elm,
2394
- renderer: {
2395
- getBoundingClientRect
2396
- }
2191
+ elm
2397
2192
  } = vm;
2398
2193
 
2399
- return getBoundingClientRect(elm);
2194
+ return getBoundingClientRect$1(elm);
2400
2195
  },
2401
2196
 
2402
2197
  get isConnected() {
2403
2198
  const {
2404
- elm,
2405
- renderer: {
2406
- isConnected
2407
- }
2199
+ elm
2408
2200
  } = getAssociatedVM(this);
2409
- return isConnected(elm);
2201
+ return isConnected$1(elm);
2410
2202
  },
2411
2203
 
2412
2204
  get classList() {
2413
2205
  const vm = getAssociatedVM(this);
2414
2206
  const {
2415
- elm,
2416
- renderer: {
2417
- getClassList
2418
- }
2207
+ elm
2419
2208
  } = vm;
2420
2209
 
2421
- return getClassList(elm);
2210
+ return getClassList$1(elm);
2422
2211
  },
2423
2212
 
2424
2213
  get template() {
@@ -2438,25 +2227,50 @@
2438
2227
  return vm.def.template;
2439
2228
  },
2440
2229
 
2441
- toString() {
2442
- const vm = getAssociatedVM(this);
2443
- return `[object ${vm.def.name}]`;
2230
+ toString() {
2231
+ const vm = getAssociatedVM(this);
2232
+ return `[object ${vm.def.name}]`;
2233
+ }
2234
+
2235
+ };
2236
+ const queryAndChildGetterDescriptors = create(null); // The reason we don't just call `import * as renderer from '../renderer'` here is that the bundle size
2237
+ // is smaller if we reference each function individually. Otherwise Rollup will create one big frozen
2238
+ // object representing the renderer, with a lot of methods we don't actually need.
2239
+
2240
+ const childGetters = ['children', 'childNodes', 'firstChild', 'firstElementChild', 'lastChild', 'lastElementChild'];
2241
+
2242
+ function getChildGetter(methodName) {
2243
+ switch (methodName) {
2244
+ case 'children':
2245
+ return getChildren$1;
2246
+
2247
+ case 'childNodes':
2248
+ return getChildNodes$1;
2249
+
2250
+ case 'firstChild':
2251
+ return getFirstChild$1;
2252
+
2253
+ case 'firstElementChild':
2254
+ return getFirstElementChild$1;
2255
+
2256
+ case 'lastChild':
2257
+ return getLastChild$1;
2258
+
2259
+ case 'lastElementChild':
2260
+ return getLastElementChild$1;
2444
2261
  }
2262
+ } // Generic passthrough for child getters on HTMLElement to the relevant Renderer APIs
2445
2263
 
2446
- };
2447
- const queryAndChildGetterDescriptors = create(null);
2448
- 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
2449
2264
 
2450
- for (const [elementProp, rendererMethod] of childGetters) {
2451
- queryAndChildGetterDescriptors[elementProp] = {
2265
+ for (const childGetter of childGetters) {
2266
+ queryAndChildGetterDescriptors[childGetter] = {
2452
2267
  get() {
2453
2268
  const vm = getAssociatedVM(this);
2454
2269
  const {
2455
- elm,
2456
- renderer
2270
+ elm
2457
2271
  } = vm;
2458
2272
 
2459
- return renderer[rendererMethod](elm);
2273
+ return getChildGetter(childGetter)(elm);
2460
2274
  },
2461
2275
 
2462
2276
  configurable: true,
@@ -2464,18 +2278,34 @@
2464
2278
  };
2465
2279
  }
2466
2280
 
2467
- const queryMethods = ['getElementsByClassName', 'getElementsByTagName', 'querySelector', 'querySelectorAll']; // Generic passthrough for query APIs on HTMLElement to the relevant Renderer APIs
2281
+ const queryMethods = ['getElementsByClassName', 'getElementsByTagName', 'querySelector', 'querySelectorAll'];
2282
+
2283
+ function getQueryMethod(methodName) {
2284
+ switch (methodName) {
2285
+ case 'getElementsByClassName':
2286
+ return getElementsByClassName$1;
2287
+
2288
+ case 'getElementsByTagName':
2289
+ return getElementsByTagName$1;
2290
+
2291
+ case 'querySelector':
2292
+ return querySelector$1;
2293
+
2294
+ case 'querySelectorAll':
2295
+ return querySelectorAll$1;
2296
+ }
2297
+ } // Generic passthrough for query APIs on HTMLElement to the relevant Renderer APIs
2298
+
2468
2299
 
2469
2300
  for (const queryMethod of queryMethods) {
2470
2301
  queryAndChildGetterDescriptors[queryMethod] = {
2471
2302
  value(arg) {
2472
2303
  const vm = getAssociatedVM(this);
2473
2304
  const {
2474
- elm,
2475
- renderer
2305
+ elm
2476
2306
  } = vm;
2477
2307
 
2478
- return renderer[queryMethod](elm, arg);
2308
+ return getQueryMethod(queryMethod)(elm, arg);
2479
2309
  },
2480
2310
 
2481
2311
  configurable: true,
@@ -3372,17 +3202,301 @@
3372
3202
 
3373
3203
  const publicMethods = {};
3374
3204
 
3375
- for (const key in methods) {
3376
- // avoid leaking the reference to the public method descriptors
3377
- publicMethods[key] = methods[key].value;
3205
+ for (const key in methods) {
3206
+ // avoid leaking the reference to the public method descriptors
3207
+ publicMethods[key] = methods[key].value;
3208
+ }
3209
+
3210
+ return {
3211
+ ctor,
3212
+ name,
3213
+ props: publicProps,
3214
+ methods: publicMethods
3215
+ };
3216
+ }
3217
+ /*
3218
+ * Copyright (c) 2018, salesforce.com, inc.
3219
+ * All rights reserved.
3220
+ * SPDX-License-Identifier: MIT
3221
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
3222
+ */
3223
+
3224
+
3225
+ const xlinkNS = 'http://www.w3.org/1999/xlink';
3226
+ const xmlNS = 'http://www.w3.org/XML/1998/namespace';
3227
+ const ColonCharCode = 58;
3228
+
3229
+ function patchAttributes(oldVnode, vnode) {
3230
+ const {
3231
+ attrs
3232
+ } = vnode.data;
3233
+
3234
+ if (isUndefined$1(attrs)) {
3235
+ return;
3236
+ }
3237
+
3238
+ const oldAttrs = isNull(oldVnode) ? EmptyObject : oldVnode.data.attrs;
3239
+
3240
+ if (oldAttrs === attrs) {
3241
+ return;
3242
+ }
3243
+
3244
+ const {
3245
+ elm
3246
+ } = vnode;
3247
+
3248
+ for (const key in attrs) {
3249
+ const cur = attrs[key];
3250
+ const old = oldAttrs[key];
3251
+
3252
+ if (old !== cur) {
3253
+ unlockAttribute(elm, key);
3254
+
3255
+ if (StringCharCodeAt.call(key, 3) === ColonCharCode) {
3256
+ // Assume xml namespace
3257
+ setAttribute$1(elm, key, cur, xmlNS);
3258
+ } else if (StringCharCodeAt.call(key, 5) === ColonCharCode) {
3259
+ // Assume xlink namespace
3260
+ setAttribute$1(elm, key, cur, xlinkNS);
3261
+ } else if (isNull(cur) || isUndefined$1(cur)) {
3262
+ removeAttribute$1(elm, key);
3263
+ } else {
3264
+ setAttribute$1(elm, key, cur);
3265
+ }
3266
+
3267
+ lockAttribute();
3268
+ }
3269
+ }
3270
+ }
3271
+ /*
3272
+ * Copyright (c) 2018, salesforce.com, inc.
3273
+ * All rights reserved.
3274
+ * SPDX-License-Identifier: MIT
3275
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
3276
+ */
3277
+
3278
+
3279
+ function isLiveBindingProp(sel, key) {
3280
+ // For properties with live bindings, we read values from the DOM element
3281
+ // instead of relying on internally tracked values.
3282
+ return sel === 'input' && (key === 'value' || key === 'checked');
3283
+ }
3284
+
3285
+ function patchProps(oldVnode, vnode) {
3286
+ const {
3287
+ props
3288
+ } = vnode.data;
3289
+
3290
+ if (isUndefined$1(props)) {
3291
+ return;
3292
+ }
3293
+
3294
+ const oldProps = isNull(oldVnode) ? EmptyObject : oldVnode.data.props;
3295
+
3296
+ if (oldProps === props) {
3297
+ return;
3298
+ }
3299
+
3300
+ const isFirstPatch = isNull(oldVnode);
3301
+ const {
3302
+ elm,
3303
+ sel
3304
+ } = vnode;
3305
+
3306
+ for (const key in props) {
3307
+ const cur = props[key]; // Set the property if it's the first time is is patched or if the previous property is
3308
+ // different than the one previously set.
3309
+
3310
+ if (isFirstPatch || cur !== (isLiveBindingProp(sel, key) ? getProperty$1(elm, key) : oldProps[key])) {
3311
+ setProperty$1(elm, key, cur);
3312
+ }
3313
+ }
3314
+ }
3315
+ /*
3316
+ * Copyright (c) 2018, salesforce.com, inc.
3317
+ * All rights reserved.
3318
+ * SPDX-License-Identifier: MIT
3319
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
3320
+ */
3321
+
3322
+
3323
+ const classNameToClassMap = create(null);
3324
+
3325
+ function getMapFromClassName(className) {
3326
+ // Intentionally using == to match undefined and null values from computed style attribute
3327
+ if (className == null) {
3328
+ return EmptyObject;
3329
+ } // computed class names must be string
3330
+
3331
+
3332
+ className = isString(className) ? className : className + '';
3333
+ let map = classNameToClassMap[className];
3334
+
3335
+ if (map) {
3336
+ return map;
3337
+ }
3338
+
3339
+ map = create(null);
3340
+ let start = 0;
3341
+ let o;
3342
+ const len = className.length;
3343
+
3344
+ for (o = 0; o < len; o++) {
3345
+ if (StringCharCodeAt.call(className, o) === SPACE_CHAR) {
3346
+ if (o > start) {
3347
+ map[StringSlice.call(className, start, o)] = true;
3348
+ }
3349
+
3350
+ start = o + 1;
3351
+ }
3352
+ }
3353
+
3354
+ if (o > start) {
3355
+ map[StringSlice.call(className, start, o)] = true;
3356
+ }
3357
+
3358
+ classNameToClassMap[className] = map;
3359
+
3360
+ return map;
3361
+ }
3362
+
3363
+ function patchClassAttribute(oldVnode, vnode) {
3364
+ const {
3365
+ elm,
3366
+ data: {
3367
+ className: newClass
3368
+ }
3369
+ } = vnode;
3370
+ const oldClass = isNull(oldVnode) ? undefined : oldVnode.data.className;
3371
+
3372
+ if (oldClass === newClass) {
3373
+ return;
3374
+ }
3375
+
3376
+ const classList = getClassList$1(elm);
3377
+ const newClassMap = getMapFromClassName(newClass);
3378
+ const oldClassMap = getMapFromClassName(oldClass);
3379
+ let name;
3380
+
3381
+ for (name in oldClassMap) {
3382
+ // remove only if it is not in the new class collection and it is not set from within the instance
3383
+ if (isUndefined$1(newClassMap[name])) {
3384
+ classList.remove(name);
3385
+ }
3386
+ }
3387
+
3388
+ for (name in newClassMap) {
3389
+ if (isUndefined$1(oldClassMap[name])) {
3390
+ classList.add(name);
3391
+ }
3392
+ }
3393
+ }
3394
+ /*
3395
+ * Copyright (c) 2018, salesforce.com, inc.
3396
+ * All rights reserved.
3397
+ * SPDX-License-Identifier: MIT
3398
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
3399
+ */
3400
+
3401
+
3402
+ function patchStyleAttribute(oldVnode, vnode) {
3403
+ const {
3404
+ elm,
3405
+ data: {
3406
+ style: newStyle
3407
+ }
3408
+ } = vnode;
3409
+ const oldStyle = isNull(oldVnode) ? undefined : oldVnode.data.style;
3410
+
3411
+ if (oldStyle === newStyle) {
3412
+ return;
3413
+ }
3414
+
3415
+ if (!isString(newStyle) || newStyle === '') {
3416
+ removeAttribute$1(elm, 'style');
3417
+ } else {
3418
+ setAttribute$1(elm, 'style', newStyle);
3419
+ }
3420
+ }
3421
+ /*
3422
+ * Copyright (c) 2018, salesforce.com, inc.
3423
+ * All rights reserved.
3424
+ * SPDX-License-Identifier: MIT
3425
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
3426
+ */
3427
+
3428
+
3429
+ function applyEventListeners(vnode) {
3430
+ const {
3431
+ elm,
3432
+ data: {
3433
+ on
3434
+ }
3435
+ } = vnode;
3436
+
3437
+ if (isUndefined$1(on)) {
3438
+ return;
3439
+ }
3440
+
3441
+ for (const name in on) {
3442
+ const handler = on[name];
3443
+ addEventListener$1(elm, name, handler);
3444
+ }
3445
+ }
3446
+ /*
3447
+ * Copyright (c) 2018, salesforce.com, inc.
3448
+ * All rights reserved.
3449
+ * SPDX-License-Identifier: MIT
3450
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
3451
+ */
3452
+ // The compiler takes care of transforming the inline classnames into an object. It's faster to set the
3453
+ // different classnames properties individually instead of via a string.
3454
+
3455
+
3456
+ function applyStaticClassAttribute(vnode) {
3457
+ const {
3458
+ elm,
3459
+ data: {
3460
+ classMap
3461
+ }
3462
+ } = vnode;
3463
+
3464
+ if (isUndefined$1(classMap)) {
3465
+ return;
3466
+ }
3467
+
3468
+ const classList = getClassList$1(elm);
3469
+
3470
+ for (const name in classMap) {
3471
+ classList.add(name);
3472
+ }
3473
+ }
3474
+ /*
3475
+ * Copyright (c) 2018, salesforce.com, inc.
3476
+ * All rights reserved.
3477
+ * SPDX-License-Identifier: MIT
3478
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
3479
+ */
3480
+ // The compiler takes care of transforming the inline style into an object. It's faster to set the
3481
+ // different style properties individually instead of via a string.
3482
+
3483
+
3484
+ function applyStaticStyleAttribute(vnode) {
3485
+ const {
3486
+ elm,
3487
+ data: {
3488
+ styleDecls
3489
+ }
3490
+ } = vnode;
3491
+
3492
+ if (isUndefined$1(styleDecls)) {
3493
+ return;
3378
3494
  }
3379
3495
 
3380
- return {
3381
- ctor,
3382
- name,
3383
- props: publicProps,
3384
- methods: publicMethods
3385
- };
3496
+ for (let i = 0; i < styleDecls.length; i++) {
3497
+ const [prop, value, important] = styleDecls[i];
3498
+ setCSSStyleProperty$1(elm, prop, value, important);
3499
+ }
3386
3500
  }
3387
3501
  /*
3388
3502
  * Copyright (c) 2018, salesforce.com, inc.
@@ -3409,63 +3523,50 @@
3409
3523
  const token = cmpTemplate === null || cmpTemplate === void 0 ? void 0 : cmpTemplate.stylesheetToken;
3410
3524
 
3411
3525
  if (!isUndefined$1(token) && context.hasScopedStyles) {
3412
- owner.renderer.getClassList(elm).add(token);
3526
+ getClassList$1(elm).add(token);
3413
3527
  }
3414
3528
  }
3415
3529
 
3416
3530
  function updateNodeHook(oldVnode, vnode) {
3417
3531
  const {
3418
3532
  elm,
3419
- text,
3420
- owner: {
3421
- renderer
3422
- }
3533
+ text
3423
3534
  } = vnode;
3424
3535
 
3425
3536
  if (oldVnode.text !== text) {
3426
3537
 
3427
- renderer.setText(elm, text);
3538
+ setText$1(elm, text);
3428
3539
  }
3429
3540
  }
3430
3541
 
3431
3542
  function insertNodeHook(vnode, parentNode, referenceNode) {
3432
- const {
3433
- renderer
3434
- } = vnode.owner;
3435
3543
 
3436
- renderer.insert(vnode.elm, parentNode, referenceNode);
3544
+ insert$1(vnode.elm, parentNode, referenceNode);
3437
3545
  }
3438
3546
 
3439
3547
  function removeNodeHook(vnode, parentNode) {
3440
- const {
3441
- renderer
3442
- } = vnode.owner;
3443
3548
 
3444
- renderer.remove(vnode.elm, parentNode);
3549
+ remove$1(vnode.elm, parentNode);
3445
3550
  }
3446
3551
 
3447
- function createElmHook(vnode) {
3448
- modEvents.create(vnode); // Attrs need to be applied to element before props
3449
- // IE11 will wipe out value on radio inputs if value
3450
- // is set before type=radio.
3552
+ function patchElementPropsAndAttrs(oldVnode, vnode) {
3553
+ if (isNull(oldVnode)) {
3554
+ applyEventListeners(vnode);
3555
+ applyStaticClassAttribute(vnode);
3556
+ applyStaticStyleAttribute(vnode);
3557
+ } // Attrs need to be applied to element before props IE11 will wipe out value on radio inputs if
3558
+ // value is set before type=radio.
3451
3559
 
3452
- modAttrs.create(vnode);
3453
- modProps.create(vnode);
3454
- modStaticClassName.create(vnode);
3455
- modStaticStyle.create(vnode);
3456
- modComputedClassName.create(vnode);
3457
- modComputedStyle.create(vnode);
3560
+
3561
+ patchClassAttribute(oldVnode, vnode);
3562
+ patchStyleAttribute(oldVnode, vnode);
3563
+ patchAttributes(oldVnode, vnode);
3564
+ patchProps(oldVnode, vnode);
3458
3565
  }
3459
3566
 
3460
3567
  function hydrateElmHook(vnode) {
3461
- modEvents.create(vnode); // Attrs are already on the element.
3462
- // modAttrs.create(vnode);
3463
-
3464
- modProps.create(vnode); // Already set.
3465
- // modStaticClassName.create(vnode);
3466
- // modStaticStyle.create(vnode);
3467
- // modComputedClassName.create(vnode);
3468
- // modComputedStyle.create(vnode);
3568
+ applyEventListeners(vnode);
3569
+ patchProps(null, vnode);
3469
3570
  }
3470
3571
 
3471
3572
  function fallbackElmHook(elm, vnode) {
@@ -3499,26 +3600,11 @@
3499
3600
  }
3500
3601
  }
3501
3602
 
3502
- function updateElmHook(oldVnode, vnode) {
3503
- // Attrs need to be applied to element before props
3504
- // IE11 will wipe out value on radio inputs if value
3505
- // is set before type=radio.
3506
- modAttrs.update(oldVnode, vnode);
3507
- modProps.update(oldVnode, vnode);
3508
- modComputedClassName.update(oldVnode, vnode);
3509
- modComputedStyle.update(oldVnode, vnode);
3510
- }
3511
-
3512
- function updateChildrenHook(oldVnode, vnode) {
3513
- const {
3514
- elm,
3515
- children
3516
- } = vnode;
3517
-
3518
- if (hasDynamicChildren(children)) {
3519
- updateDynamicChildren(elm, oldVnode.children, children);
3603
+ function patchChildren(parent, oldCh, newCh) {
3604
+ if (hasDynamicChildren(newCh)) {
3605
+ updateDynamicChildren(parent, oldCh, newCh);
3520
3606
  } else {
3521
- updateStaticChildren(elm, oldVnode.children, children);
3607
+ updateStaticChildren(parent, oldCh, newCh);
3522
3608
  }
3523
3609
  }
3524
3610
 
@@ -3585,24 +3671,10 @@
3585
3671
  createVM(elm, def, {
3586
3672
  mode,
3587
3673
  owner,
3588
- tagName: sel,
3589
- renderer: owner.renderer
3674
+ tagName: sel
3590
3675
  });
3591
3676
  }
3592
3677
 
3593
- function createCustomElmHook(vnode) {
3594
- modEvents.create(vnode); // Attrs need to be applied to element before props
3595
- // IE11 will wipe out value on radio inputs if value
3596
- // is set before type=radio.
3597
-
3598
- modAttrs.create(vnode);
3599
- modProps.create(vnode);
3600
- modStaticClassName.create(vnode);
3601
- modStaticStyle.create(vnode);
3602
- modComputedClassName.create(vnode);
3603
- modComputedStyle.create(vnode);
3604
- }
3605
-
3606
3678
  function createChildrenHook(vnode) {
3607
3679
  const {
3608
3680
  elm,
@@ -3635,16 +3707,6 @@
3635
3707
  }
3636
3708
  }
3637
3709
 
3638
- function updateCustomElmHook(oldVnode, vnode) {
3639
- // Attrs need to be applied to element before props
3640
- // IE11 will wipe out value on radio inputs if value
3641
- // is set before type=radio.
3642
- modAttrs.update(oldVnode, vnode);
3643
- modProps.update(oldVnode, vnode);
3644
- modComputedClassName.update(oldVnode, vnode);
3645
- modComputedStyle.update(oldVnode, vnode);
3646
- }
3647
-
3648
3710
  function removeElmHook(vnode) {
3649
3711
  // this method only needs to search on child vnodes from template
3650
3712
  // to trigger the remove hook just in case some of those children
@@ -3661,6 +3723,66 @@
3661
3723
  ch.hook.remove(ch, elm);
3662
3724
  }
3663
3725
  }
3726
+ }
3727
+
3728
+ function allocateInSlot(vm, children) {
3729
+ const {
3730
+ cmpSlots: oldSlots
3731
+ } = vm;
3732
+ const cmpSlots = vm.cmpSlots = create(null);
3733
+
3734
+ for (let i = 0, len = children.length; i < len; i += 1) {
3735
+ const vnode = children[i];
3736
+
3737
+ if (isNull(vnode)) {
3738
+ continue;
3739
+ }
3740
+
3741
+ const {
3742
+ data
3743
+ } = vnode;
3744
+ const slotName = data.attrs && data.attrs.slot || '';
3745
+ const vnodes = cmpSlots[slotName] = cmpSlots[slotName] || []; // re-keying the vnodes is necessary to avoid conflicts with default content for the slot
3746
+ // which might have similar keys. Each vnode will always have a key that
3747
+ // starts with a numeric character from compiler. In this case, we add a unique
3748
+ // notation for slotted vnodes keys, e.g.: `@foo:1:1`
3749
+
3750
+ if (!isUndefined$1(vnode.key)) {
3751
+ vnode.key = `@${slotName}:${vnode.key}`;
3752
+ }
3753
+
3754
+ ArrayPush$1.call(vnodes, vnode);
3755
+ }
3756
+
3757
+ if (isFalse(vm.isDirty)) {
3758
+ // We need to determine if the old allocation is really different from the new one
3759
+ // and mark the vm as dirty
3760
+ const oldKeys = keys(oldSlots);
3761
+
3762
+ if (oldKeys.length !== keys(cmpSlots).length) {
3763
+ markComponentAsDirty(vm);
3764
+ return;
3765
+ }
3766
+
3767
+ for (let i = 0, len = oldKeys.length; i < len; i += 1) {
3768
+ const key = oldKeys[i];
3769
+
3770
+ if (isUndefined$1(cmpSlots[key]) || oldSlots[key].length !== cmpSlots[key].length) {
3771
+ markComponentAsDirty(vm);
3772
+ return;
3773
+ }
3774
+
3775
+ const oldVNodes = oldSlots[key];
3776
+ const vnodes = cmpSlots[key];
3777
+
3778
+ for (let j = 0, a = cmpSlots[key].length; j < a; j += 1) {
3779
+ if (oldVNodes[j] !== vnodes[j]) {
3780
+ markComponentAsDirty(vm);
3781
+ return;
3782
+ }
3783
+ }
3784
+ }
3785
+ }
3664
3786
  } // Using a WeakMap instead of a WeakSet because this one works in IE11 :(
3665
3787
 
3666
3788
 
@@ -3682,12 +3804,12 @@
3682
3804
  */
3683
3805
 
3684
3806
 
3685
- function getUpgradableConstructor(tagName, renderer) {
3807
+ function getUpgradableConstructor(tagName) {
3686
3808
  // Should never get a tag with upper case letter at this point, the compiler should
3687
3809
  // produce only tags with lowercase letters
3688
3810
  // But, for backwards compatibility, we will lower case the tagName
3689
3811
  tagName = tagName.toLowerCase();
3690
- let CE = renderer.getCustomElement(tagName);
3812
+ let CE = getCustomElement$1(tagName);
3691
3813
 
3692
3814
  if (!isUndefined$1(CE)) {
3693
3815
  return CE;
@@ -3698,7 +3820,7 @@
3698
3820
  */
3699
3821
 
3700
3822
 
3701
- CE = class LWCUpgradableElement extends renderer.HTMLElement {
3823
+ CE = class LWCUpgradableElement extends HTMLElementExported$1 {
3702
3824
  constructor(upgradeCallback) {
3703
3825
  super();
3704
3826
 
@@ -3708,7 +3830,7 @@
3708
3830
  }
3709
3831
 
3710
3832
  };
3711
- renderer.defineCustomElement(tagName, CE);
3833
+ defineCustomElement$1(tagName, CE);
3712
3834
  return CE;
3713
3835
  }
3714
3836
  /*
@@ -3726,10 +3848,7 @@
3726
3848
  const {
3727
3849
  owner
3728
3850
  } = vnode;
3729
- const {
3730
- renderer
3731
- } = owner;
3732
- const elm = renderer.createText(vnode.text);
3851
+ const elm = createText$1(vnode.text);
3733
3852
  linkNodeToShadow(elm, owner);
3734
3853
  vnode.elm = elm;
3735
3854
  },
@@ -3751,10 +3870,7 @@
3751
3870
  owner,
3752
3871
  text
3753
3872
  } = vnode;
3754
- const {
3755
- renderer
3756
- } = owner;
3757
- const elm = renderer.createComment(text);
3873
+ const elm = createComment$1(text);
3758
3874
  linkNodeToShadow(elm, owner);
3759
3875
  vnode.elm = elm;
3760
3876
  },
@@ -3784,19 +3900,16 @@
3784
3900
  svg
3785
3901
  }
3786
3902
  } = vnode;
3787
- const {
3788
- renderer
3789
- } = owner;
3790
3903
  const namespace = isTrue(svg) ? SVG_NAMESPACE : undefined;
3791
- const elm = renderer.createElement(sel, namespace);
3904
+ const elm = createElement$2(sel, namespace);
3792
3905
  linkNodeToShadow(elm, owner);
3793
3906
  fallbackElmHook(elm, vnode);
3794
3907
  vnode.elm = elm;
3795
- createElmHook(vnode);
3908
+ patchElementPropsAndAttrs(null, vnode);
3796
3909
  },
3797
3910
  update: (oldVnode, vnode) => {
3798
- updateElmHook(oldVnode, vnode);
3799
- updateChildrenHook(oldVnode, vnode);
3911
+ patchElementPropsAndAttrs(oldVnode, vnode);
3912
+ patchChildren(vnode.elm, oldVnode.children, vnode.children);
3800
3913
  },
3801
3914
  insert: (vnode, parentNode, referenceNode) => {
3802
3915
  insertNodeHook(vnode, parentNode, referenceNode);
@@ -3848,10 +3961,7 @@
3848
3961
  sel,
3849
3962
  owner
3850
3963
  } = vnode;
3851
- const {
3852
- renderer
3853
- } = owner;
3854
- const UpgradableConstructor = getUpgradableConstructor(sel, renderer);
3964
+ const UpgradableConstructor = getUpgradableConstructor(sel);
3855
3965
  /**
3856
3966
  * Note: if the upgradable constructor does not expect, or throw when we new it
3857
3967
  * with a callback as the first argument, we could implement a more advanced
@@ -3873,10 +3983,10 @@
3873
3983
  throw new TypeError(`Incorrect Component Constructor`);
3874
3984
  }
3875
3985
 
3876
- createCustomElmHook(vnode);
3986
+ patchElementPropsAndAttrs(null, vnode);
3877
3987
  },
3878
3988
  update: (oldVnode, vnode) => {
3879
- updateCustomElmHook(oldVnode, vnode);
3989
+ patchElementPropsAndAttrs(oldVnode, vnode);
3880
3990
  const vm = getAssociatedVMIfPresent(vnode.elm);
3881
3991
 
3882
3992
  if (vm) {
@@ -3887,7 +3997,7 @@
3887
3997
  // will happen, but in native, it does allocate the light dom
3888
3998
 
3889
3999
 
3890
- updateChildrenHook(oldVnode, vnode);
4000
+ patchChildren(vnode.elm, oldVnode.children, vnode.children);
3891
4001
 
3892
4002
  if (vm) {
3893
4003
  // this is important to preserve the top to bottom synchronous rendering phase.
@@ -3936,8 +4046,7 @@
3936
4046
  createVM(elm, def, {
3937
4047
  mode,
3938
4048
  owner,
3939
- tagName: sel,
3940
- renderer: owner.renderer
4049
+ tagName: sel
3941
4050
  });
3942
4051
  vnode.elm = elm;
3943
4052
  const vm = getAssociatedVM(elm);
@@ -3960,12 +4069,11 @@
3960
4069
 
3961
4070
  function linkNodeToShadow(elm, owner) {
3962
4071
  const {
3963
- renderer,
3964
4072
  renderMode,
3965
4073
  shadowMode
3966
4074
  } = owner; // TODO [#1164]: this should eventually be done by the polyfill directly
3967
4075
 
3968
- if (renderer.isSyntheticShadowDefined) {
4076
+ if (isSyntheticShadowDefined$1) {
3969
4077
  if (shadowMode === 1
3970
4078
  /* Synthetic */
3971
4079
  || renderMode === 0
@@ -4373,7 +4481,6 @@
4373
4481
  const {
4374
4482
  elm,
4375
4483
  context,
4376
- renderer,
4377
4484
  renderMode,
4378
4485
  shadowMode
4379
4486
  } = vm;
@@ -4400,11 +4507,11 @@
4400
4507
  } = context;
4401
4508
 
4402
4509
  if (oldHasTokenInClass) {
4403
- renderer.getClassList(elm).remove(makeHostToken(oldToken));
4510
+ getClassList$1(elm).remove(makeHostToken(oldToken));
4404
4511
  }
4405
4512
 
4406
4513
  if (oldHasTokenInAttribute) {
4407
- renderer.removeAttribute(elm, makeHostToken(oldToken));
4514
+ removeAttribute$1(elm, makeHostToken(oldToken));
4408
4515
  } // Apply the new template styling token to the host element, if the new template has any
4409
4516
  // associated stylesheets. In the case of light DOM, also ensure there is at least one scoped stylesheet.
4410
4517
 
@@ -4416,12 +4523,12 @@
4416
4523
 
4417
4524
  if (!isUndefined$1(newToken)) {
4418
4525
  if (hasScopedStyles) {
4419
- renderer.getClassList(elm).add(makeHostToken(newToken));
4526
+ getClassList$1(elm).add(makeHostToken(newToken));
4420
4527
  newHasTokenInClass = true;
4421
4528
  }
4422
4529
 
4423
4530
  if (isSyntheticShadow) {
4424
- renderer.setAttribute(elm, makeHostToken(newToken), '');
4531
+ setAttribute$1(elm, makeHostToken(newToken), '');
4425
4532
  newHasTokenInAttribute = true;
4426
4533
  }
4427
4534
  } // Update the styling tokens present on the context object.
@@ -4536,7 +4643,6 @@
4536
4643
 
4537
4644
  function createStylesheet(vm, stylesheets) {
4538
4645
  const {
4539
- renderer,
4540
4646
  renderMode,
4541
4647
  shadowMode
4542
4648
  } = vm;
@@ -4547,9 +4653,9 @@
4547
4653
  /* Synthetic */
4548
4654
  ) {
4549
4655
  for (let i = 0; i < stylesheets.length; i++) {
4550
- renderer.insertGlobalStylesheet(stylesheets[i]);
4656
+ insertGlobalStylesheet$1(stylesheets[i]);
4551
4657
  }
4552
- } else if (renderer.ssr || renderer.isHydrating()) {
4658
+ } else if (ssr$1 || isHydrating$1()) {
4553
4659
  // Note: We need to ensure that during hydration, the stylesheets method is the same as those in ssr.
4554
4660
  // This works in the client, because the stylesheets are created, and cached in the VM
4555
4661
  // the first time the VM renders.
@@ -4563,10 +4669,10 @@
4563
4669
 
4564
4670
  for (let i = 0; i < stylesheets.length; i++) {
4565
4671
  if (isGlobal) {
4566
- renderer.insertGlobalStylesheet(stylesheets[i]);
4672
+ insertGlobalStylesheet$1(stylesheets[i]);
4567
4673
  } else {
4568
4674
  // local level
4569
- renderer.insertStylesheet(stylesheets[i], root.cmpRoot);
4675
+ insertStylesheet$1(stylesheets[i], root.cmpRoot);
4570
4676
  }
4571
4677
  }
4572
4678
  }
@@ -5121,7 +5227,6 @@
5121
5227
  const {
5122
5228
  mode,
5123
5229
  owner,
5124
- renderer,
5125
5230
  tagName
5126
5231
  } = options;
5127
5232
  const vm = {
@@ -5136,7 +5241,6 @@
5136
5241
  tagName,
5137
5242
  mode,
5138
5243
  owner,
5139
- renderer,
5140
5244
  children: EmptyArray,
5141
5245
  aChildren: EmptyArray,
5142
5246
  velements: EmptyArray,
@@ -5179,16 +5283,11 @@
5179
5283
 
5180
5284
  function computeShadowMode(vm) {
5181
5285
  const {
5182
- def,
5183
- renderer
5286
+ def
5184
5287
  } = vm;
5185
- const {
5186
- isNativeShadowDefined,
5187
- isSyntheticShadowDefined
5188
- } = renderer;
5189
5288
  let shadowMode;
5190
5289
 
5191
- if (isSyntheticShadowDefined) {
5290
+ if (isSyntheticShadowDefined$1) {
5192
5291
  if (def.renderMode === 0
5193
5292
  /* Light */
5194
5293
  ) {
@@ -5197,7 +5296,7 @@
5197
5296
  shadowMode = 0
5198
5297
  /* Native */
5199
5298
  ;
5200
- } else if (isNativeShadowDefined) {
5299
+ } else if (isNativeShadowDefined$1) {
5201
5300
  if (def.shadowSupportMode === "any"
5202
5301
  /* Any */
5203
5302
  ) {
@@ -5289,7 +5388,6 @@
5289
5388
  // patch function mutates vnodes by adding the element reference,
5290
5389
  // however, if patching fails it contains partial changes.
5291
5390
  if (oldCh !== newCh) {
5292
- const fn = hasDynamicChildren(newCh) ? updateDynamicChildren : updateStaticChildren;
5293
5391
  runWithBoundaryProtection(vm, vm, () => {
5294
5392
  // pre
5295
5393
  logOperationStart(2
@@ -5297,8 +5395,8 @@
5297
5395
  , vm);
5298
5396
  }, () => {
5299
5397
  // job
5300
- const elementToRenderTo = getRenderRoot(vm);
5301
- fn(elementToRenderTo, oldCh, newCh);
5398
+ const renderRoot = getRenderRoot(vm);
5399
+ patchChildren(renderRoot, oldCh, newCh);
5302
5400
  }, () => {
5303
5401
  // post
5304
5402
  logOperationEnd(2
@@ -5321,13 +5419,12 @@
5321
5419
 
5322
5420
  function runRenderedCallback(vm) {
5323
5421
  const {
5324
- renderer,
5325
5422
  def: {
5326
5423
  renderedCallback
5327
5424
  }
5328
5425
  } = vm;
5329
5426
 
5330
- if (isTrue(renderer.ssr)) {
5427
+ if (isTrue(ssr$1)) {
5331
5428
  return;
5332
5429
  }
5333
5430
 
@@ -5544,8 +5641,7 @@
5544
5641
 
5545
5642
  function resetComponentRoot(vm) {
5546
5643
  const {
5547
- children,
5548
- renderer
5644
+ children
5549
5645
  } = vm;
5550
5646
  const rootNode = getRenderRoot(vm);
5551
5647
 
@@ -5553,7 +5649,7 @@
5553
5649
  const child = children[i];
5554
5650
 
5555
5651
  if (!isNull(child) && !isUndefined$1(child.elm)) {
5556
- renderer.remove(child.elm, rootNode);
5652
+ remove$1(child.elm, rootNode);
5557
5653
  }
5558
5654
  }
5559
5655
 
@@ -5563,7 +5659,7 @@
5563
5659
  }
5564
5660
 
5565
5661
  function scheduleRehydration(vm) {
5566
- if (isTrue(vm.renderer.ssr) || isTrue(vm.isScheduled)) {
5662
+ if (isTrue(ssr$1) || isTrue(vm.isScheduled)) {
5567
5663
  return;
5568
5664
  }
5569
5665
 
@@ -5586,69 +5682,6 @@
5586
5682
 
5587
5683
  currentVm = currentVm.owner;
5588
5684
  }
5589
- } // slow path routine
5590
- // NOTE: we should probably more this routine to the synthetic shadow folder
5591
- // and get the allocation to be cached by in the elm instead of in the VM
5592
-
5593
-
5594
- function allocateInSlot(vm, children) {
5595
- const {
5596
- cmpSlots: oldSlots
5597
- } = vm;
5598
- const cmpSlots = vm.cmpSlots = create(null);
5599
-
5600
- for (let i = 0, len = children.length; i < len; i += 1) {
5601
- const vnode = children[i];
5602
-
5603
- if (isNull(vnode)) {
5604
- continue;
5605
- }
5606
-
5607
- const {
5608
- data
5609
- } = vnode;
5610
- const slotName = data.attrs && data.attrs.slot || '';
5611
- const vnodes = cmpSlots[slotName] = cmpSlots[slotName] || []; // re-keying the vnodes is necessary to avoid conflicts with default content for the slot
5612
- // which might have similar keys. Each vnode will always have a key that
5613
- // starts with a numeric character from compiler. In this case, we add a unique
5614
- // notation for slotted vnodes keys, e.g.: `@foo:1:1`
5615
-
5616
- if (!isUndefined$1(vnode.key)) {
5617
- vnode.key = `@${slotName}:${vnode.key}`;
5618
- }
5619
-
5620
- ArrayPush$1.call(vnodes, vnode);
5621
- }
5622
-
5623
- if (isFalse(vm.isDirty)) {
5624
- // We need to determine if the old allocation is really different from the new one
5625
- // and mark the vm as dirty
5626
- const oldKeys = keys(oldSlots);
5627
-
5628
- if (oldKeys.length !== keys(cmpSlots).length) {
5629
- markComponentAsDirty(vm);
5630
- return;
5631
- }
5632
-
5633
- for (let i = 0, len = oldKeys.length; i < len; i += 1) {
5634
- const key = oldKeys[i];
5635
-
5636
- if (isUndefined$1(cmpSlots[key]) || oldSlots[key].length !== cmpSlots[key].length) {
5637
- markComponentAsDirty(vm);
5638
- return;
5639
- }
5640
-
5641
- const oldVNodes = oldSlots[key];
5642
- const vnodes = cmpSlots[key];
5643
-
5644
- for (let j = 0, a = cmpSlots[key].length; j < a; j += 1) {
5645
- if (oldVNodes[j] !== vnodes[j]) {
5646
- markComponentAsDirty(vm);
5647
- return;
5648
- }
5649
- }
5650
- }
5651
- }
5652
5685
  }
5653
5686
 
5654
5687
  function runWithBoundaryProtection(vm, owner, pre, job, post) {
@@ -5790,7 +5823,6 @@
5790
5823
 
5791
5824
  const {
5792
5825
  elm,
5793
- renderer,
5794
5826
  context: {
5795
5827
  wiredConnecting,
5796
5828
  wiredDisconnecting
@@ -5817,7 +5849,7 @@
5817
5849
  }
5818
5850
 
5819
5851
  });
5820
- renderer.dispatchEvent(elm, contextRegistrationEvent);
5852
+ dispatchEvent$1(elm, contextRegistrationEvent);
5821
5853
  });
5822
5854
  }
5823
5855
 
@@ -6072,7 +6104,7 @@
6072
6104
  hooksAreSet = true;
6073
6105
  setSanitizeHtmlContentHook(hooks.sanitizeHtmlContent);
6074
6106
  }
6075
- /* version: 2.6.2 */
6107
+ /* version: 2.7.3 */
6076
6108
 
6077
6109
  /*
6078
6110
  * Copyright (c) 2018, salesforce.com, inc.
@@ -6092,7 +6124,9 @@
6092
6124
  const styleElements = create(null);
6093
6125
  const styleSheets = create(null);
6094
6126
  const nodesToStyleSheets = new WeakMap();
6095
- let getCustomElement, defineCustomElement, HTMLElementConstructor;
6127
+ let getCustomElement;
6128
+ let defineCustomElement;
6129
+ let HTMLElementConstructor;
6096
6130
 
6097
6131
  function isCustomElementRegistryAvailable() {
6098
6132
  if (typeof customElements === 'undefined') {
@@ -6207,182 +6241,213 @@
6207
6241
  HTMLElementConstructor.prototype = HTMLElement.prototype;
6208
6242
  }
6209
6243
 
6210
- let isHydrating = false;
6244
+ let hydrating = false;
6211
6245
 
6212
- function setIsHydrating(v) {
6213
- isHydrating = v;
6246
+ function setIsHydrating(value) {
6247
+ hydrating = value;
6214
6248
  }
6215
6249
 
6216
- const renderer = {
6217
- ssr: false,
6250
+ const ssr = false;
6218
6251
 
6219
- isHydrating() {
6220
- return isHydrating;
6221
- },
6222
-
6223
- isNativeShadowDefined: _globalThis[KEY__IS_NATIVE_SHADOW_ROOT_DEFINED],
6224
- isSyntheticShadowDefined: hasOwnProperty$1.call(Element.prototype, KEY__SHADOW_TOKEN),
6225
-
6226
- createElement(tagName, namespace) {
6227
- return isUndefined$1(namespace) ? document.createElement(tagName) : document.createElementNS(namespace, tagName);
6228
- },
6252
+ function isHydrating() {
6253
+ return hydrating;
6254
+ }
6229
6255
 
6230
- createText(content) {
6231
- return document.createTextNode(content);
6232
- },
6256
+ const isNativeShadowDefined = _globalThis[KEY__IS_NATIVE_SHADOW_ROOT_DEFINED];
6257
+ const isSyntheticShadowDefined = hasOwnProperty$1.call(Element.prototype, KEY__SHADOW_TOKEN);
6233
6258
 
6234
- createComment(content) {
6235
- return document.createComment(content);
6236
- },
6259
+ function createElement$1(tagName, namespace) {
6260
+ return isUndefined$1(namespace) ? document.createElement(tagName) : document.createElementNS(namespace, tagName);
6261
+ }
6237
6262
 
6238
- insert(node, parent, anchor) {
6239
- parent.insertBefore(node, anchor);
6240
- },
6263
+ function createText(content) {
6264
+ return document.createTextNode(content);
6265
+ }
6241
6266
 
6242
- remove(node, parent) {
6243
- parent.removeChild(node);
6244
- },
6267
+ function createComment(content) {
6268
+ return document.createComment(content);
6269
+ }
6245
6270
 
6246
- nextSibling(node) {
6247
- return node.nextSibling;
6248
- },
6271
+ function insert(node, parent, anchor) {
6272
+ parent.insertBefore(node, anchor);
6273
+ }
6249
6274
 
6250
- attachShadow(element, options) {
6251
- if (isHydrating) {
6252
- return element.shadowRoot;
6253
- }
6275
+ function remove(node, parent) {
6276
+ parent.removeChild(node);
6277
+ }
6254
6278
 
6255
- return element.attachShadow(options);
6256
- },
6279
+ function nextSibling(node) {
6280
+ return node.nextSibling;
6281
+ }
6257
6282
 
6258
- setText(node, content) {
6259
- node.nodeValue = content;
6260
- },
6283
+ function attachShadow(element, options) {
6284
+ if (hydrating) {
6285
+ return element.shadowRoot;
6286
+ }
6261
6287
 
6262
- getProperty(node, key) {
6263
- return node[key];
6264
- },
6288
+ return element.attachShadow(options);
6289
+ }
6265
6290
 
6266
- setProperty(node, key, value) {
6291
+ function setText(node, content) {
6292
+ node.nodeValue = content;
6293
+ }
6267
6294
 
6268
- node[key] = value;
6269
- },
6295
+ function getProperty(node, key) {
6296
+ return node[key];
6297
+ }
6270
6298
 
6271
- getAttribute(element, name, namespace) {
6272
- return isUndefined$1(namespace) ? element.getAttribute(name) : element.getAttributeNS(namespace, name);
6273
- },
6299
+ function setProperty(node, key, value) {
6274
6300
 
6275
- setAttribute(element, name, value, namespace) {
6276
- return isUndefined$1(namespace) ? element.setAttribute(name, value) : element.setAttributeNS(namespace, name, value);
6277
- },
6301
+ node[key] = value;
6302
+ }
6278
6303
 
6279
- removeAttribute(element, name, namespace) {
6280
- if (isUndefined$1(namespace)) {
6281
- element.removeAttribute(name);
6282
- } else {
6283
- element.removeAttributeNS(namespace, name);
6284
- }
6285
- },
6304
+ function getAttribute(element, name, namespace) {
6305
+ return isUndefined$1(namespace) ? element.getAttribute(name) : element.getAttributeNS(namespace, name);
6306
+ }
6286
6307
 
6287
- addEventListener(target, type, callback, options) {
6288
- target.addEventListener(type, callback, options);
6289
- },
6308
+ function setAttribute(element, name, value, namespace) {
6309
+ return isUndefined$1(namespace) ? element.setAttribute(name, value) : element.setAttributeNS(namespace, name, value);
6310
+ }
6290
6311
 
6291
- removeEventListener(target, type, callback, options) {
6292
- target.removeEventListener(type, callback, options);
6293
- },
6312
+ function removeAttribute(element, name, namespace) {
6313
+ if (isUndefined$1(namespace)) {
6314
+ element.removeAttribute(name);
6315
+ } else {
6316
+ element.removeAttributeNS(namespace, name);
6317
+ }
6318
+ }
6294
6319
 
6295
- dispatchEvent(target, event) {
6296
- return target.dispatchEvent(event);
6297
- },
6320
+ function addEventListener(target, type, callback, options) {
6321
+ target.addEventListener(type, callback, options);
6322
+ }
6298
6323
 
6299
- getClassList(element) {
6300
- return element.classList;
6301
- },
6324
+ function removeEventListener(target, type, callback, options) {
6325
+ target.removeEventListener(type, callback, options);
6326
+ }
6302
6327
 
6303
- setCSSStyleProperty(element, name, value, important) {
6304
- // TODO [#0]: How to avoid this type casting? Shall we use a different type interface to
6305
- // represent elements in the engine?
6306
- element.style.setProperty(name, value, important ? 'important' : '');
6307
- },
6328
+ function dispatchEvent(target, event) {
6329
+ return target.dispatchEvent(event);
6330
+ }
6308
6331
 
6309
- getBoundingClientRect(element) {
6310
- return element.getBoundingClientRect();
6311
- },
6332
+ function getClassList(element) {
6333
+ return element.classList;
6334
+ }
6312
6335
 
6313
- querySelector(element, selectors) {
6314
- return element.querySelector(selectors);
6315
- },
6336
+ function setCSSStyleProperty(element, name, value, important) {
6337
+ // TODO [#0]: How to avoid this type casting? Shall we use a different type interface to
6338
+ // represent elements in the engine?
6339
+ element.style.setProperty(name, value, important ? 'important' : '');
6340
+ }
6316
6341
 
6317
- querySelectorAll(element, selectors) {
6318
- return element.querySelectorAll(selectors);
6319
- },
6342
+ function getBoundingClientRect(element) {
6343
+ return element.getBoundingClientRect();
6344
+ }
6320
6345
 
6321
- getElementsByTagName(element, tagNameOrWildCard) {
6322
- return element.getElementsByTagName(tagNameOrWildCard);
6323
- },
6346
+ function querySelector(element, selectors) {
6347
+ return element.querySelector(selectors);
6348
+ }
6324
6349
 
6325
- getElementsByClassName(element, names) {
6326
- return element.getElementsByClassName(names);
6327
- },
6350
+ function querySelectorAll(element, selectors) {
6351
+ return element.querySelectorAll(selectors);
6352
+ }
6328
6353
 
6329
- getChildren(element) {
6330
- return element.children;
6331
- },
6354
+ function getElementsByTagName(element, tagNameOrWildCard) {
6355
+ return element.getElementsByTagName(tagNameOrWildCard);
6356
+ }
6332
6357
 
6333
- getChildNodes(element) {
6334
- return element.childNodes;
6335
- },
6358
+ function getElementsByClassName(element, names) {
6359
+ return element.getElementsByClassName(names);
6360
+ }
6336
6361
 
6337
- getFirstChild(element) {
6338
- return element.firstChild;
6339
- },
6362
+ function getChildren(element) {
6363
+ return element.children;
6364
+ }
6340
6365
 
6341
- getFirstElementChild(element) {
6342
- return element.firstElementChild;
6343
- },
6366
+ function getChildNodes(element) {
6367
+ return element.childNodes;
6368
+ }
6344
6369
 
6345
- getLastChild(element) {
6346
- return element.lastChild;
6347
- },
6370
+ function getFirstChild(element) {
6371
+ return element.firstChild;
6372
+ }
6348
6373
 
6349
- getLastElementChild(element) {
6350
- return element.lastElementChild;
6351
- },
6374
+ function getFirstElementChild(element) {
6375
+ return element.firstElementChild;
6376
+ }
6352
6377
 
6353
- isConnected(node) {
6354
- return node.isConnected;
6355
- },
6378
+ function getLastChild(element) {
6379
+ return element.lastChild;
6380
+ }
6356
6381
 
6357
- insertGlobalStylesheet(content) {
6358
- if (!isUndefined$1(globalStylesheets[content])) {
6359
- return;
6360
- }
6382
+ function getLastElementChild(element) {
6383
+ return element.lastElementChild;
6384
+ }
6361
6385
 
6362
- globalStylesheets[content] = true;
6363
- const elm = document.createElement('style');
6364
- elm.type = 'text/css';
6365
- elm.textContent = content;
6366
- globalStylesheetsParentElement.appendChild(elm);
6367
- },
6386
+ function isConnected(node) {
6387
+ return node.isConnected;
6388
+ }
6368
6389
 
6369
- insertStylesheet(content, target) {
6370
- if (supportsConstructableStyleSheets) {
6371
- insertConstructableStyleSheet(content, target);
6372
- } else {
6373
- // Fall back to <style> element
6374
- insertStyleElement(content, target);
6375
- }
6376
- },
6390
+ function insertGlobalStylesheet(content) {
6391
+ if (!isUndefined$1(globalStylesheets[content])) {
6392
+ return;
6393
+ }
6377
6394
 
6378
- assertInstanceOfHTMLElement(elm, msg) {
6379
- assert.invariant(elm instanceof HTMLElement, msg);
6380
- },
6395
+ globalStylesheets[content] = true;
6396
+ const elm = document.createElement('style');
6397
+ elm.type = 'text/css';
6398
+ elm.textContent = content;
6399
+ globalStylesheetsParentElement.appendChild(elm);
6400
+ }
6381
6401
 
6382
- defineCustomElement,
6383
- getCustomElement,
6384
- HTMLElement: HTMLElementConstructor
6385
- };
6402
+ function insertStylesheet(content, target) {
6403
+ if (supportsConstructableStyleSheets) {
6404
+ insertConstructableStyleSheet(content, target);
6405
+ } else {
6406
+ // Fall back to <style> element
6407
+ insertStyleElement(content, target);
6408
+ }
6409
+ }
6410
+
6411
+ const HTMLElementExported = HTMLElementConstructor;
6412
+ setAttachShadow(attachShadow);
6413
+ setCreateComment(createComment);
6414
+ setCreateElement(createElement$1);
6415
+ setCreateText(createText);
6416
+ setDefineCustomElement(defineCustomElement);
6417
+ setDispatchEvent(dispatchEvent);
6418
+ setGetAttribute(getAttribute);
6419
+ setGetBoundingClientRect(getBoundingClientRect);
6420
+ setGetChildNodes(getChildNodes);
6421
+ setGetChildren(getChildren);
6422
+ setGetClassList(getClassList);
6423
+ setGetCustomElement(getCustomElement);
6424
+ setGetElementsByClassName(getElementsByClassName);
6425
+ setGetElementsByTagName(getElementsByTagName);
6426
+ setGetFirstChild(getFirstChild);
6427
+ setGetFirstElementChild(getFirstElementChild);
6428
+ setGetLastChild(getLastChild);
6429
+ setGetLastElementChild(getLastElementChild);
6430
+ setGetProperty(getProperty);
6431
+ setHTMLElement(HTMLElementExported);
6432
+ setInsert(insert);
6433
+ setInsertGlobalStylesheet(insertGlobalStylesheet);
6434
+ setInsertStylesheet(insertStylesheet);
6435
+ setIsConnected(isConnected);
6436
+ setIsHydrating$1(isHydrating);
6437
+ setIsNativeShadowDefined(isNativeShadowDefined);
6438
+ setIsSyntheticShadowDefined(isSyntheticShadowDefined);
6439
+ setNextSibling(nextSibling);
6440
+ setQuerySelector(querySelector);
6441
+ setQuerySelectorAll(querySelectorAll);
6442
+ setRemove(remove);
6443
+ setRemoveAttribute(removeAttribute);
6444
+ setRemoveEventListener(removeEventListener);
6445
+ setSetAttribute(setAttribute);
6446
+ setSetCSSStyleProperty(setCSSStyleProperty);
6447
+ setSetProperty(setProperty);
6448
+ setSetText(setText);
6449
+ setSsr(ssr);
6450
+ setAddEventListener(addEventListener);
6386
6451
  /*
6387
6452
  * Copyright (c) 2018, salesforce.com, inc.
6388
6453
  * All rights reserved.
@@ -6462,7 +6527,7 @@
6462
6527
  throw new TypeError(`"createElement" function expects an "is" option with a valid component constructor.`);
6463
6528
  }
6464
6529
 
6465
- const UpgradableConstructor = getUpgradableConstructor(sel, renderer);
6530
+ const UpgradableConstructor = getUpgradableConstructor(sel);
6466
6531
  let wasComponentUpgraded = false; // the custom element from the registry is expecting an upgrade callback
6467
6532
 
6468
6533
  /**
@@ -6477,8 +6542,7 @@
6477
6542
  createVM(elm, def, {
6478
6543
  tagName: sel,
6479
6544
  mode: options.mode !== 'closed' ? 'open' : 'closed',
6480
- owner: null,
6481
- renderer
6545
+ owner: null
6482
6546
  });
6483
6547
  ConnectingSlot.set(elm, connectRootElement);
6484
6548
  DisconnectingSlot.set(elm, disconnectRootElement);
@@ -6501,6 +6565,10 @@
6501
6565
 
6502
6566
 
6503
6567
  function hydrateComponent(element, Ctor, props = {}) {
6568
+ if (!(element instanceof Element)) {
6569
+ throw new TypeError(`"hydrateComponent" expects a valid DOM element as the first parameter but instead received ${element}.`);
6570
+ }
6571
+
6504
6572
  if (!isFunction$1(Ctor)) {
6505
6573
  throw new TypeError(`"hydrateComponent" expects a valid component constructor as the second parameter but instead received ${Ctor}.`);
6506
6574
  }
@@ -6518,7 +6586,6 @@
6518
6586
  createVM(element, def, {
6519
6587
  mode: 'open',
6520
6588
  owner: null,
6521
- renderer,
6522
6589
  tagName: element.tagName.toLowerCase()
6523
6590
  });
6524
6591
 
@@ -6585,8 +6652,7 @@
6585
6652
  createVM(this, def, {
6586
6653
  mode: 'open',
6587
6654
  owner: null,
6588
- tagName: this.tagName,
6589
- renderer
6655
+ tagName: this.tagName
6590
6656
  });
6591
6657
  }
6592
6658
 
@@ -6653,7 +6719,7 @@
6653
6719
  return false;
6654
6720
  }
6655
6721
 
6656
- if (renderer.isSyntheticShadowDefined) {
6722
+ if (isSyntheticShadowDefined) {
6657
6723
  // TODO [#1252]: old behavior that is still used by some pieces of the platform,
6658
6724
  // specifically, nodes inserted manually on places where `lwc:dom="manual"` directive is not
6659
6725
  // used, will be considered global elements.
@@ -6706,7 +6772,7 @@
6706
6772
  });
6707
6773
  freeze(LightningElement);
6708
6774
  seal(LightningElement.prototype);
6709
- /* version: 2.6.2 */
6775
+ /* version: 2.7.3 */
6710
6776
 
6711
6777
  exports.LightningElement = LightningElement;
6712
6778
  exports.__unstable__ProfilerControl = profilerControl;