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
@@ -24,7 +24,7 @@
24
24
 
25
25
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
26
26
 
27
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } Object.defineProperty(subClass, "prototype", { value: Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }), writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
27
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
28
28
 
29
29
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
30
30
 
@@ -351,7 +351,7 @@
351
351
  CACHED_PROPERTY_ATTRIBUTE_MAPPING.set(propName, attributeName);
352
352
  return attributeName;
353
353
  }
354
- /** version: 2.6.2 */
354
+ /** version: 2.7.3 */
355
355
 
356
356
  /*
357
357
  * Copyright (c) 2018, salesforce.com, inc.
@@ -463,7 +463,6 @@
463
463
  ENABLE_NODE_LIST_PATCH: null,
464
464
  ENABLE_HTML_COLLECTIONS_PATCH: null,
465
465
  ENABLE_NODE_PATCH: null,
466
- ENABLE_MIXED_SHADOW_MODE: null,
467
466
  ENABLE_WIRE_SYNC_EMIT: null
468
467
  };
469
468
 
@@ -530,7 +529,7 @@
530
529
  setFeatureFlag(name, value);
531
530
  }
532
531
  }
533
- /** version: 2.6.2 */
532
+ /** version: 2.7.3 */
534
533
 
535
534
  /* proxy-compat-disable */
536
535
 
@@ -618,609 +617,377 @@
618
617
  }
619
618
 
620
619
  return styleMap;
621
- }
622
- /*
623
- * Copyright (c) 2019, salesforce.com, inc.
624
- * All rights reserved.
625
- * SPDX-License-Identifier: MIT
626
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
627
- */
620
+ } //
621
+ // Primitives
622
+ //
628
623
 
629
624
 
630
- var TargetToReactiveRecordMap = new WeakMap();
625
+ var ssr$1;
631
626
 
632
- function getReactiveRecord(target) {
633
- var reactiveRecord = TargetToReactiveRecordMap.get(target);
627
+ function setSsr(ssrImpl) {
628
+ ssr$1 = ssrImpl;
629
+ }
634
630
 
635
- if (isUndefined$1(reactiveRecord)) {
636
- var newRecord = create(null);
637
- reactiveRecord = newRecord;
638
- TargetToReactiveRecordMap.set(target, newRecord);
639
- }
631
+ var isNativeShadowDefined$1;
640
632
 
641
- return reactiveRecord;
633
+ function setIsNativeShadowDefined(isNativeShadowDefinedImpl) {
634
+ isNativeShadowDefined$1 = isNativeShadowDefinedImpl;
642
635
  }
643
636
 
644
- var currentReactiveObserver = null;
637
+ var isSyntheticShadowDefined$1;
645
638
 
646
- function valueMutated(target, key) {
647
- var reactiveRecord = TargetToReactiveRecordMap.get(target);
639
+ function setIsSyntheticShadowDefined(isSyntheticShadowDefinedImpl) {
640
+ isSyntheticShadowDefined$1 = isSyntheticShadowDefinedImpl;
641
+ }
648
642
 
649
- if (!isUndefined$1(reactiveRecord)) {
650
- var reactiveObservers = reactiveRecord[key];
643
+ var HTMLElementExported$1;
651
644
 
652
- if (!isUndefined$1(reactiveObservers)) {
653
- for (var _i4 = 0, _len2 = reactiveObservers.length; _i4 < _len2; _i4 += 1) {
654
- var ro = reactiveObservers[_i4];
655
- ro.notify();
656
- }
657
- }
658
- }
645
+ function setHTMLElement(HTMLElementImpl) {
646
+ HTMLElementExported$1 = HTMLElementImpl;
659
647
  }
660
648
 
661
- function valueObserved(target, key) {
662
- // We should determine if an active Observing Record is present to track mutations.
663
- if (currentReactiveObserver === null) {
664
- return;
665
- }
649
+ var isHydrating$1;
666
650
 
667
- var ro = currentReactiveObserver;
668
- var reactiveRecord = getReactiveRecord(target);
669
- var reactiveObservers = reactiveRecord[key];
651
+ function setIsHydrating$1(isHydratingImpl) {
652
+ isHydrating$1 = isHydratingImpl;
653
+ }
670
654
 
671
- if (isUndefined$1(reactiveObservers)) {
672
- reactiveObservers = [];
673
- reactiveRecord[key] = reactiveObservers;
674
- } else if (reactiveObservers[0] === ro) {
675
- return; // perf optimization considering that most subscriptions will come from the same record
676
- }
655
+ var insert$1;
677
656
 
678
- if (ArrayIndexOf.call(reactiveObservers, ro) === -1) {
679
- ro.link(reactiveObservers);
680
- }
657
+ function setInsert(insertImpl) {
658
+ insert$1 = insertImpl;
681
659
  }
682
660
 
683
- var ReactiveObserver = /*#__PURE__*/function () {
684
- function ReactiveObserver(callback) {
685
- _classCallCheck(this, ReactiveObserver);
686
-
687
- this.listeners = [];
688
- this.callback = callback;
689
- }
661
+ var remove$1;
690
662
 
691
- _createClass(ReactiveObserver, [{
692
- key: "observe",
693
- value: function observe(job) {
694
- var inceptionReactiveRecord = currentReactiveObserver;
695
- currentReactiveObserver = this;
696
- var error;
663
+ function setRemove(removeImpl) {
664
+ remove$1 = removeImpl;
665
+ }
697
666
 
698
- try {
699
- job();
700
- } catch (e) {
701
- error = Object(e);
702
- } finally {
703
- currentReactiveObserver = inceptionReactiveRecord;
667
+ var createElement$2;
704
668
 
705
- if (error !== undefined) {
706
- throw error; // eslint-disable-line no-unsafe-finally
707
- }
708
- }
709
- }
710
- /**
711
- * This method is responsible for disconnecting the Reactive Observer
712
- * from any Reactive Record that has a reference to it, to prevent future
713
- * notifications about previously recorded access.
714
- */
669
+ function setCreateElement(createElementImpl) {
670
+ createElement$2 = createElementImpl;
671
+ }
715
672
 
716
- }, {
717
- key: "reset",
718
- value: function reset() {
719
- var listeners = this.listeners;
720
- var len = listeners.length;
673
+ var createText$1;
721
674
 
722
- if (len > 0) {
723
- for (var _i5 = 0; _i5 < len; _i5 += 1) {
724
- var set = listeners[_i5];
725
- var pos = ArrayIndexOf.call(listeners[_i5], this);
726
- ArraySplice.call(set, pos, 1);
727
- }
675
+ function setCreateText(createTextImpl) {
676
+ createText$1 = createTextImpl;
677
+ }
728
678
 
729
- listeners.length = 0;
730
- }
731
- } // friend methods
679
+ var createComment$1;
732
680
 
733
- }, {
734
- key: "notify",
735
- value: function notify() {
736
- this.callback.call(undefined, this);
737
- }
738
- }, {
739
- key: "link",
740
- value: function link(reactiveObservers) {
741
- ArrayPush$1.call(reactiveObservers, this); // we keep track of observing records where the observing record was added to so we can do some clean up later on
681
+ function setCreateComment(createCommentImpl) {
682
+ createComment$1 = createCommentImpl;
683
+ }
742
684
 
743
- ArrayPush$1.call(this.listeners, reactiveObservers);
744
- }
745
- }]);
685
+ var nextSibling$1;
746
686
 
747
- return ReactiveObserver;
748
- }();
749
- /*
750
- * Copyright (c) 2018, salesforce.com, inc.
751
- * All rights reserved.
752
- * SPDX-License-Identifier: MIT
753
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
754
- */
687
+ function setNextSibling(nextSiblingImpl) {
688
+ nextSibling$1 = nextSiblingImpl;
689
+ }
755
690
 
691
+ var attachShadow$1;
756
692
 
757
- function componentValueMutated(vm, key) {
758
- valueMutated(vm.component, key);
693
+ function setAttachShadow(attachShadowImpl) {
694
+ attachShadow$1 = attachShadowImpl;
759
695
  }
760
696
 
761
- function componentValueObserved(vm, key) {
762
- valueObserved(vm.component, key);
697
+ var getProperty$1;
698
+
699
+ function setGetProperty(getPropertyImpl) {
700
+ getProperty$1 = getPropertyImpl;
763
701
  }
764
- /*
765
- * Copyright (c) 2018, salesforce.com, inc.
766
- * All rights reserved.
767
- * SPDX-License-Identifier: MIT
768
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
769
- */
770
702
 
703
+ var setProperty$1;
771
704
 
772
- function getComponentTag(vm) {
773
- return "<".concat(StringToLowerCase.call(vm.tagName), ">");
774
- } // TODO [#1695]: Unify getComponentStack and getErrorComponentStack
705
+ function setSetProperty(setPropertyImpl) {
706
+ setProperty$1 = setPropertyImpl;
707
+ }
775
708
 
709
+ var setText$1;
776
710
 
777
- function getComponentStack(vm) {
778
- var stack = [];
779
- var prefix = '';
711
+ function setSetText(setTextImpl) {
712
+ setText$1 = setTextImpl;
713
+ }
780
714
 
781
- while (!isNull(vm.owner)) {
782
- ArrayPush$1.call(stack, prefix + getComponentTag(vm));
783
- vm = vm.owner;
784
- prefix += '\t';
785
- }
715
+ var getAttribute$1;
786
716
 
787
- return ArrayJoin.call(stack, '\n');
717
+ function setGetAttribute(getAttributeImpl) {
718
+ getAttribute$1 = getAttributeImpl;
788
719
  }
789
720
 
790
- function getErrorComponentStack(vm) {
791
- var wcStack = [];
792
- var currentVm = vm;
721
+ var setAttribute$1;
793
722
 
794
- while (!isNull(currentVm)) {
795
- ArrayPush$1.call(wcStack, getComponentTag(currentVm));
796
- currentVm = currentVm.owner;
797
- }
798
-
799
- return wcStack.reverse().join('\n\t');
723
+ function setSetAttribute(setAttributeImpl) {
724
+ setAttribute$1 = setAttributeImpl;
800
725
  }
801
- /*
802
- * Copyright (c) 2018, salesforce.com, inc.
803
- * All rights reserved.
804
- * SPDX-License-Identifier: MIT
805
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
806
- */
807
726
 
727
+ var removeAttribute$1;
808
728
 
809
- function log(method, message, vm) {
810
- var msg = "[LWC ".concat(method, "]: ").concat(message);
729
+ function setRemoveAttribute(removeAttributeImpl) {
730
+ removeAttribute$1 = removeAttributeImpl;
731
+ }
811
732
 
812
- if (!isUndefined$1(vm)) {
813
- msg = "".concat(msg, "\n").concat(getComponentStack(vm));
814
- }
733
+ var addEventListener$1;
815
734
 
816
- if (process.env.NODE_ENV === 'test') {
817
- /* eslint-disable-next-line no-console */
818
- console[method](msg);
819
- return;
820
- }
821
-
822
- try {
823
- throw new Error(msg);
824
- } catch (e) {
825
- /* eslint-disable-next-line no-console */
826
- console[method](e);
827
- }
735
+ function setAddEventListener(addEventListenerImpl) {
736
+ addEventListener$1 = addEventListenerImpl;
828
737
  }
829
738
 
830
- function logError(message, vm) {
831
- log('error', message, vm);
832
- }
739
+ var removeEventListener$1;
833
740
 
834
- function logWarn(message, vm) {
835
- log('warn', message, vm);
741
+ function setRemoveEventListener(removeEventListenerImpl) {
742
+ removeEventListener$1 = removeEventListenerImpl;
836
743
  }
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
744
 
745
+ var dispatchEvent$1;
844
746
 
845
- function handleEvent(event, vnode) {
846
- var type = event.type;
847
- var on = vnode.data.on;
848
- var handler = on && on[type]; // call event handler if exists
849
-
850
- if (handler) {
851
- handler.call(undefined, event);
852
- }
747
+ function setDispatchEvent(dispatchEventImpl) {
748
+ dispatchEvent$1 = dispatchEventImpl;
853
749
  }
854
750
 
855
- function createListener() {
856
- return function handler(event) {
857
- handleEvent(event, handler.vnode);
858
- };
859
- }
751
+ var getClassList$1;
860
752
 
861
- function updateAllEventListeners(oldVnode, vnode) {
862
- if (isUndefined$1(oldVnode.listener)) {
863
- createAllEventListeners(vnode);
864
- } else {
865
- vnode.listener = oldVnode.listener;
866
- vnode.listener.vnode = vnode;
867
- }
753
+ function setGetClassList(getClassListImpl) {
754
+ getClassList$1 = getClassListImpl;
868
755
  }
869
756
 
870
- function createAllEventListeners(vnode) {
871
- var elm = vnode.elm,
872
- on = vnode.data.on,
873
- renderer = vnode.owner.renderer;
757
+ var setCSSStyleProperty$1;
874
758
 
875
- if (isUndefined$1(on)) {
876
- return;
877
- }
759
+ function setSetCSSStyleProperty(setCSSStylePropertyImpl) {
760
+ setCSSStyleProperty$1 = setCSSStylePropertyImpl;
761
+ }
878
762
 
879
- var listener = vnode.listener = createListener();
880
- listener.vnode = vnode;
881
- var name;
763
+ var getBoundingClientRect$1;
882
764
 
883
- for (name in on) {
884
- renderer.addEventListener(elm, name, listener);
885
- }
765
+ function setGetBoundingClientRect(getBoundingClientRectImpl) {
766
+ getBoundingClientRect$1 = getBoundingClientRectImpl;
886
767
  }
887
768
 
888
- var modEvents = {
889
- update: updateAllEventListeners,
890
- create: createAllEventListeners
891
- };
892
- /*
893
- * Copyright (c) 2018, salesforce.com, inc.
894
- * All rights reserved.
895
- * SPDX-License-Identifier: MIT
896
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
897
- */
769
+ var querySelector$1;
898
770
 
899
- var defaultDefHTMLPropertyNames = ['accessKey', 'dir', 'draggable', 'hidden', 'id', 'lang', 'spellcheck', 'tabIndex', 'title'];
771
+ function setQuerySelector(querySelectorImpl) {
772
+ querySelector$1 = querySelectorImpl;
773
+ }
900
774
 
901
- function offsetPropertyErrorMessage(name) {
902
- return "Using the `".concat(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.");
903
- } // Global HTML Attributes & Properties
904
- // https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes
905
- // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement
775
+ var querySelectorAll$1;
906
776
 
777
+ function setQuerySelectorAll(querySelectorAllImpl) {
778
+ querySelectorAll$1 = querySelectorAllImpl;
779
+ }
907
780
 
908
- var globalHTMLProperties = assign(create(null), {
909
- accessKey: {
910
- attribute: 'accesskey'
911
- },
912
- accessKeyLabel: {
913
- readOnly: true
914
- },
915
- className: {
916
- attribute: 'class',
917
- 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.'
918
- },
919
- contentEditable: {
920
- attribute: 'contenteditable'
921
- },
922
- dataset: {
923
- readOnly: true,
924
- 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."
925
- },
926
- dir: {
927
- attribute: 'dir'
928
- },
929
- draggable: {
930
- attribute: 'draggable'
931
- },
932
- dropzone: {
933
- attribute: 'dropzone',
934
- readOnly: true
935
- },
936
- hidden: {
937
- attribute: 'hidden'
938
- },
939
- id: {
940
- attribute: 'id'
941
- },
942
- inputMode: {
943
- attribute: 'inputmode'
944
- },
945
- lang: {
946
- attribute: 'lang'
947
- },
948
- slot: {
949
- attribute: 'slot',
950
- error: 'Using the `slot` property is an anti-pattern.'
951
- },
952
- spellcheck: {
953
- attribute: 'spellcheck'
954
- },
955
- style: {
956
- attribute: 'style'
957
- },
958
- tabIndex: {
959
- attribute: 'tabindex'
960
- },
961
- title: {
962
- attribute: 'title'
963
- },
964
- translate: {
965
- attribute: 'translate'
966
- },
967
- // additional "global attributes" that are not present in the link above.
968
- isContentEditable: {
969
- readOnly: true
970
- },
971
- offsetHeight: {
972
- readOnly: true,
973
- error: offsetPropertyErrorMessage('offsetHeight')
974
- },
975
- offsetLeft: {
976
- readOnly: true,
977
- error: offsetPropertyErrorMessage('offsetLeft')
978
- },
979
- offsetParent: {
980
- readOnly: true
981
- },
982
- offsetTop: {
983
- readOnly: true,
984
- error: offsetPropertyErrorMessage('offsetTop')
985
- },
986
- offsetWidth: {
987
- readOnly: true,
988
- error: offsetPropertyErrorMessage('offsetWidth')
989
- },
990
- role: {
991
- attribute: 'role'
992
- }
993
- });
994
- var controlledElement = null;
995
- var controlledAttributeName;
781
+ var getElementsByTagName$1;
996
782
 
997
- function isAttributeLocked(elm, attrName) {
998
- return elm !== controlledElement || attrName !== controlledAttributeName;
783
+ function setGetElementsByTagName(getElementsByTagNameImpl) {
784
+ getElementsByTagName$1 = getElementsByTagNameImpl;
999
785
  }
1000
786
 
1001
- function lockAttribute(_elm, _key) {
1002
- controlledElement = null;
1003
- controlledAttributeName = undefined;
1004
- }
787
+ var getElementsByClassName$1;
1005
788
 
1006
- function unlockAttribute(elm, key) {
1007
- controlledElement = elm;
1008
- controlledAttributeName = key;
789
+ function setGetElementsByClassName(getElementsByClassNameImpl) {
790
+ getElementsByClassName$1 = getElementsByClassNameImpl;
1009
791
  }
1010
- /*
1011
- * Copyright (c) 2018, salesforce.com, inc.
1012
- * All rights reserved.
1013
- * SPDX-License-Identifier: MIT
1014
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
1015
- */
1016
792
 
793
+ var getChildren$1;
1017
794
 
1018
- var xlinkNS = 'http://www.w3.org/1999/xlink';
1019
- var xmlNS = 'http://www.w3.org/XML/1998/namespace';
1020
- var ColonCharCode = 58;
795
+ function setGetChildren(getChildrenImpl) {
796
+ getChildren$1 = getChildrenImpl;
797
+ }
1021
798
 
1022
- function updateAttrs(oldVnode, vnode) {
1023
- var attrs = vnode.data.attrs,
1024
- renderer = vnode.owner.renderer;
799
+ var getChildNodes$1;
1025
800
 
1026
- if (isUndefined$1(attrs)) {
1027
- return;
1028
- }
801
+ function setGetChildNodes(getChildNodesImpl) {
802
+ getChildNodes$1 = getChildNodesImpl;
803
+ }
1029
804
 
1030
- var oldAttrs = oldVnode.data.attrs;
805
+ var getFirstChild$1;
1031
806
 
1032
- if (oldAttrs === attrs) {
1033
- return;
1034
- }
807
+ function setGetFirstChild(getFirstChildImpl) {
808
+ getFirstChild$1 = getFirstChildImpl;
809
+ }
1035
810
 
1036
- if (process.env.NODE_ENV !== 'production') {
1037
- assert.invariant(isUndefined$1(oldAttrs) || keys(oldAttrs).join(',') === keys(attrs).join(','), "vnode.data.attrs cannot change shape.");
1038
- }
811
+ var getFirstElementChild$1;
1039
812
 
1040
- var elm = vnode.elm;
1041
- var setAttribute = renderer.setAttribute,
1042
- removeAttribute = renderer.removeAttribute;
1043
- var key;
1044
- oldAttrs = isUndefined$1(oldAttrs) ? EmptyObject : oldAttrs; // update modified attributes, add new attributes
1045
- // this routine is only useful for data-* attributes in all kind of elements
1046
- // and aria-* in standard elements (custom elements will use props for these)
1047
-
1048
- for (key in attrs) {
1049
- var cur = attrs[key];
1050
- var old = oldAttrs[key];
813
+ function setGetFirstElementChild(getFirstElementChildImpl) {
814
+ getFirstElementChild$1 = getFirstElementChildImpl;
815
+ }
1051
816
 
1052
- if (old !== cur) {
1053
- unlockAttribute(elm, key);
817
+ var getLastChild$1;
1054
818
 
1055
- if (StringCharCodeAt.call(key, 3) === ColonCharCode) {
1056
- // Assume xml namespace
1057
- setAttribute(elm, key, cur, xmlNS);
1058
- } else if (StringCharCodeAt.call(key, 5) === ColonCharCode) {
1059
- // Assume xlink namespace
1060
- setAttribute(elm, key, cur, xlinkNS);
1061
- } else if (isNull(cur)) {
1062
- removeAttribute(elm, key);
1063
- } else {
1064
- setAttribute(elm, key, cur);
1065
- }
819
+ function setGetLastChild(getLastChildImpl) {
820
+ getLastChild$1 = getLastChildImpl;
821
+ }
1066
822
 
1067
- lockAttribute();
1068
- }
1069
- }
823
+ var getLastElementChild$1;
824
+
825
+ function setGetLastElementChild(getLastElementChildImpl) {
826
+ getLastElementChild$1 = getLastElementChildImpl;
1070
827
  }
1071
828
 
1072
- var emptyVNode$3 = {
1073
- data: {}
1074
- };
1075
- var modAttrs = {
1076
- create: function create(vnode) {
1077
- return updateAttrs(emptyVNode$3, vnode);
1078
- },
1079
- update: updateAttrs
1080
- };
1081
- /*
1082
- * Copyright (c) 2018, salesforce.com, inc.
1083
- * All rights reserved.
1084
- * SPDX-License-Identifier: MIT
1085
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
1086
- */
829
+ var isConnected$1;
1087
830
 
1088
- function isLiveBindingProp(sel, key) {
1089
- // For properties with live bindings, we read values from the DOM element
1090
- // instead of relying on internally tracked values.
1091
- return sel === 'input' && (key === 'value' || key === 'checked');
831
+ function setIsConnected(isConnectedImpl) {
832
+ isConnected$1 = isConnectedImpl;
1092
833
  }
1093
834
 
1094
- function update(oldVnode, vnode) {
1095
- var props = vnode.data.props;
835
+ var insertGlobalStylesheet$1;
1096
836
 
1097
- if (isUndefined$1(props)) {
1098
- return;
1099
- }
837
+ function setInsertGlobalStylesheet(insertGlobalStylesheetImpl) {
838
+ insertGlobalStylesheet$1 = insertGlobalStylesheetImpl;
839
+ }
1100
840
 
1101
- var oldProps = oldVnode.data.props;
841
+ var insertStylesheet$1;
1102
842
 
1103
- if (oldProps === props) {
1104
- return;
1105
- }
843
+ function setInsertStylesheet(insertStylesheetImpl) {
844
+ insertStylesheet$1 = insertStylesheetImpl;
845
+ }
1106
846
 
1107
- if (process.env.NODE_ENV !== 'production') {
1108
- assert.invariant(isUndefined$1(oldProps) || keys(oldProps).join(',') === keys(props).join(','), 'vnode.data.props cannot change shape.');
1109
- }
847
+ var assertInstanceOfHTMLElement$1;
1110
848
 
1111
- var isFirstPatch = isUndefined$1(oldProps);
1112
- var elm = vnode.elm,
1113
- sel = vnode.sel,
1114
- renderer = vnode.owner.renderer;
849
+ function setAssertInstanceOfHTMLElement(assertInstanceOfHTMLElementImpl) {
850
+ assertInstanceOfHTMLElement$1 = assertInstanceOfHTMLElementImpl;
851
+ }
1115
852
 
1116
- for (var key in props) {
1117
- var cur = props[key]; // if it is the first time this element is patched, or the current value is different to the previous value...
853
+ var defineCustomElement$1;
1118
854
 
1119
- if (isFirstPatch || cur !== (isLiveBindingProp(sel, key) ? renderer.getProperty(elm, key) : oldProps[key])) {
1120
- renderer.setProperty(elm, key, cur);
1121
- }
1122
- }
855
+ function setDefineCustomElement(defineCustomElementImpl) {
856
+ defineCustomElement$1 = defineCustomElementImpl;
1123
857
  }
1124
858
 
1125
- var emptyVNode$2 = {
1126
- data: {}
1127
- };
1128
- var modProps = {
1129
- create: function create(vnode) {
1130
- return update(emptyVNode$2, vnode);
1131
- },
1132
- update: update
1133
- };
859
+ var getCustomElement$1;
860
+
861
+ function setGetCustomElement(getCustomElementImpl) {
862
+ getCustomElement$1 = getCustomElementImpl;
863
+ }
1134
864
  /*
1135
- * Copyright (c) 2018, salesforce.com, inc.
865
+ * Copyright (c) 2019, salesforce.com, inc.
1136
866
  * All rights reserved.
1137
867
  * SPDX-License-Identifier: MIT
1138
868
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
1139
869
  */
1140
870
 
1141
- var classNameToClassMap = create(null);
1142
-
1143
- function getMapFromClassName(className) {
1144
- // Intentionally using == to match undefined and null values from computed style attribute
1145
- if (className == null) {
1146
- return EmptyObject;
1147
- } // computed class names must be string
1148
871
 
872
+ var TargetToReactiveRecordMap = new WeakMap();
1149
873
 
1150
- className = isString(className) ? className : className + '';
1151
- var map = classNameToClassMap[className];
874
+ function getReactiveRecord(target) {
875
+ var reactiveRecord = TargetToReactiveRecordMap.get(target);
1152
876
 
1153
- if (map) {
1154
- return map;
877
+ if (isUndefined$1(reactiveRecord)) {
878
+ var newRecord = create(null);
879
+ reactiveRecord = newRecord;
880
+ TargetToReactiveRecordMap.set(target, newRecord);
1155
881
  }
1156
882
 
1157
- map = create(null);
1158
- var start = 0;
1159
- var o;
1160
- var len = className.length;
883
+ return reactiveRecord;
884
+ }
1161
885
 
1162
- for (o = 0; o < len; o++) {
1163
- if (StringCharCodeAt.call(className, o) === SPACE_CHAR) {
1164
- if (o > start) {
1165
- map[StringSlice.call(className, start, o)] = true;
1166
- }
886
+ var currentReactiveObserver = null;
1167
887
 
1168
- start = o + 1;
888
+ function valueMutated(target, key) {
889
+ var reactiveRecord = TargetToReactiveRecordMap.get(target);
890
+
891
+ if (!isUndefined$1(reactiveRecord)) {
892
+ var reactiveObservers = reactiveRecord[key];
893
+
894
+ if (!isUndefined$1(reactiveObservers)) {
895
+ for (var _i4 = 0, _len2 = reactiveObservers.length; _i4 < _len2; _i4 += 1) {
896
+ var ro = reactiveObservers[_i4];
897
+ ro.notify();
898
+ }
1169
899
  }
1170
900
  }
901
+ }
1171
902
 
1172
- if (o > start) {
1173
- map[StringSlice.call(className, start, o)] = true;
903
+ function valueObserved(target, key) {
904
+ // We should determine if an active Observing Record is present to track mutations.
905
+ if (currentReactiveObserver === null) {
906
+ return;
1174
907
  }
1175
908
 
1176
- classNameToClassMap[className] = map;
909
+ var ro = currentReactiveObserver;
910
+ var reactiveRecord = getReactiveRecord(target);
911
+ var reactiveObservers = reactiveRecord[key];
1177
912
 
1178
- if (process.env.NODE_ENV !== 'production') {
1179
- // just to make sure that this object never changes as part of the diffing algo
1180
- freeze(map);
913
+ if (isUndefined$1(reactiveObservers)) {
914
+ reactiveObservers = [];
915
+ reactiveRecord[key] = reactiveObservers;
916
+ } else if (reactiveObservers[0] === ro) {
917
+ return; // perf optimization considering that most subscriptions will come from the same record
1181
918
  }
1182
919
 
1183
- return map;
920
+ if (ArrayIndexOf.call(reactiveObservers, ro) === -1) {
921
+ ro.link(reactiveObservers);
922
+ }
1184
923
  }
1185
924
 
1186
- function updateClassAttribute(oldVnode, vnode) {
1187
- var elm = vnode.elm,
1188
- newClass = vnode.data.className,
1189
- renderer = vnode.owner.renderer;
1190
- var oldClass = oldVnode.data.className;
925
+ var ReactiveObserver = /*#__PURE__*/function () {
926
+ function ReactiveObserver(callback) {
927
+ _classCallCheck(this, ReactiveObserver);
928
+
929
+ this.listeners = [];
930
+ this.callback = callback;
931
+ }
932
+
933
+ _createClass(ReactiveObserver, [{
934
+ key: "observe",
935
+ value: function observe(job) {
936
+ var inceptionReactiveRecord = currentReactiveObserver;
937
+ currentReactiveObserver = this;
938
+ var error;
939
+
940
+ try {
941
+ job();
942
+ } catch (e) {
943
+ error = Object(e);
944
+ } finally {
945
+ currentReactiveObserver = inceptionReactiveRecord;
946
+
947
+ if (error !== undefined) {
948
+ throw error; // eslint-disable-line no-unsafe-finally
949
+ }
950
+ }
951
+ }
952
+ /**
953
+ * This method is responsible for disconnecting the Reactive Observer
954
+ * from any Reactive Record that has a reference to it, to prevent future
955
+ * notifications about previously recorded access.
956
+ */
1191
957
 
1192
- if (oldClass === newClass) {
1193
- return;
1194
- }
958
+ }, {
959
+ key: "reset",
960
+ value: function reset() {
961
+ var listeners = this.listeners;
962
+ var len = listeners.length;
1195
963
 
1196
- var classList = renderer.getClassList(elm);
1197
- var newClassMap = getMapFromClassName(newClass);
1198
- var oldClassMap = getMapFromClassName(oldClass);
1199
- var name;
964
+ if (len > 0) {
965
+ for (var _i5 = 0; _i5 < len; _i5 += 1) {
966
+ var set = listeners[_i5];
967
+ var pos = ArrayIndexOf.call(listeners[_i5], this);
968
+ ArraySplice.call(set, pos, 1);
969
+ }
1200
970
 
1201
- for (name in oldClassMap) {
1202
- // remove only if it is not in the new class collection and it is not set from within the instance
1203
- if (isUndefined$1(newClassMap[name])) {
1204
- classList.remove(name);
971
+ listeners.length = 0;
972
+ }
973
+ } // friend methods
974
+
975
+ }, {
976
+ key: "notify",
977
+ value: function notify() {
978
+ this.callback.call(undefined, this);
1205
979
  }
1206
- }
980
+ }, {
981
+ key: "link",
982
+ value: function link(reactiveObservers) {
983
+ ArrayPush$1.call(reactiveObservers, this); // we keep track of observing records where the observing record was added to so we can do some clean up later on
1207
984
 
1208
- for (name in newClassMap) {
1209
- if (isUndefined$1(oldClassMap[name])) {
1210
- classList.add(name);
985
+ ArrayPush$1.call(this.listeners, reactiveObservers);
1211
986
  }
1212
- }
1213
- }
987
+ }]);
1214
988
 
1215
- var emptyVNode$1 = {
1216
- data: {}
1217
- };
1218
- var modComputedClassName = {
1219
- create: function create(vnode) {
1220
- return updateClassAttribute(emptyVNode$1, vnode);
1221
- },
1222
- update: updateClassAttribute
1223
- };
989
+ return ReactiveObserver;
990
+ }();
1224
991
  /*
1225
992
  * Copyright (c) 2018, salesforce.com, inc.
1226
993
  * All rights reserved.
@@ -1228,92 +995,87 @@
1228
995
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
1229
996
  */
1230
997
 
1231
- function updateStyleAttribute(oldVnode, vnode) {
1232
- var elm = vnode.elm,
1233
- newStyle = vnode.data.style,
1234
- renderer = vnode.owner.renderer;
1235
- var setAttribute = renderer.setAttribute,
1236
- removeAttribute = renderer.removeAttribute;
1237
-
1238
- if (oldVnode.data.style === newStyle) {
1239
- return;
1240
- }
1241
998
 
1242
- if (!isString(newStyle) || newStyle === '') {
1243
- removeAttribute(elm, 'style');
1244
- } else {
1245
- setAttribute(elm, 'style', newStyle);
1246
- }
999
+ function componentValueMutated(vm, key) {
1000
+ valueMutated(vm.component, key);
1247
1001
  }
1248
1002
 
1249
- var emptyVNode = {
1250
- data: {}
1251
- };
1252
- var modComputedStyle = {
1253
- create: function create(vnode) {
1254
- return updateStyleAttribute(emptyVNode, vnode);
1255
- },
1256
- update: updateStyleAttribute
1257
- };
1003
+ function componentValueObserved(vm, key) {
1004
+ valueObserved(vm.component, key);
1005
+ }
1258
1006
  /*
1259
1007
  * Copyright (c) 2018, salesforce.com, inc.
1260
1008
  * All rights reserved.
1261
1009
  * SPDX-License-Identifier: MIT
1262
1010
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
1263
1011
  */
1264
- // The compiler takes care of transforming the inline classnames into an object. It's faster to set the
1265
- // different classnames properties individually instead of via a string.
1266
1012
 
1267
- function createClassAttribute(vnode) {
1268
- var elm = vnode.elm,
1269
- classMap = vnode.data.classMap,
1270
- renderer = vnode.owner.renderer;
1271
1013
 
1272
- if (isUndefined$1(classMap)) {
1273
- return;
1274
- }
1014
+ function getComponentTag(vm) {
1015
+ return "<".concat(StringToLowerCase.call(vm.tagName), ">");
1016
+ } // TODO [#1695]: Unify getComponentStack and getErrorComponentStack
1275
1017
 
1276
- var classList = renderer.getClassList(elm);
1277
1018
 
1278
- for (var name in classMap) {
1279
- classList.add(name);
1019
+ function getComponentStack(vm) {
1020
+ var stack = [];
1021
+ var prefix = '';
1022
+
1023
+ while (!isNull(vm.owner)) {
1024
+ ArrayPush$1.call(stack, prefix + getComponentTag(vm));
1025
+ vm = vm.owner;
1026
+ prefix += '\t';
1280
1027
  }
1028
+
1029
+ return ArrayJoin.call(stack, '\n');
1281
1030
  }
1282
1031
 
1283
- var modStaticClassName = {
1284
- create: createClassAttribute
1285
- };
1032
+ function getErrorComponentStack(vm) {
1033
+ var wcStack = [];
1034
+ var currentVm = vm;
1035
+
1036
+ while (!isNull(currentVm)) {
1037
+ ArrayPush$1.call(wcStack, getComponentTag(currentVm));
1038
+ currentVm = currentVm.owner;
1039
+ }
1040
+
1041
+ return wcStack.reverse().join('\n\t');
1042
+ }
1286
1043
  /*
1287
1044
  * Copyright (c) 2018, salesforce.com, inc.
1288
1045
  * All rights reserved.
1289
1046
  * SPDX-License-Identifier: MIT
1290
1047
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
1291
1048
  */
1292
- // The compiler takes care of transforming the inline style into an object. It's faster to set the
1293
- // different style properties individually instead of via a string.
1294
1049
 
1295
- function createStyleAttribute(vnode) {
1296
- var elm = vnode.elm,
1297
- styleDecls = vnode.data.styleDecls,
1298
- renderer = vnode.owner.renderer;
1299
1050
 
1300
- if (isUndefined$1(styleDecls)) {
1301
- return;
1051
+ function log(method, message, vm) {
1052
+ var msg = "[LWC ".concat(method, "]: ").concat(message);
1053
+
1054
+ if (!isUndefined$1(vm)) {
1055
+ msg = "".concat(msg, "\n").concat(getComponentStack(vm));
1302
1056
  }
1303
1057
 
1304
- for (var _i6 = 0; _i6 < styleDecls.length; _i6++) {
1305
- var _styleDecls$_i = _slicedToArray(styleDecls[_i6], 3),
1306
- prop = _styleDecls$_i[0],
1307
- value = _styleDecls$_i[1],
1308
- important = _styleDecls$_i[2];
1058
+ if (process.env.NODE_ENV === 'test') {
1059
+ /* eslint-disable-next-line no-console */
1060
+ console[method](msg);
1061
+ return;
1062
+ }
1309
1063
 
1310
- renderer.setCSSStyleProperty(elm, prop, value, important);
1064
+ try {
1065
+ throw new Error(msg);
1066
+ } catch (e) {
1067
+ /* eslint-disable-next-line no-console */
1068
+ console[method](e);
1311
1069
  }
1312
1070
  }
1313
1071
 
1314
- var modStaticStyle = {
1315
- create: createStyleAttribute
1316
- };
1072
+ function logError(message, vm) {
1073
+ log('error', message, vm);
1074
+ }
1075
+
1076
+ function logWarn(message, vm) {
1077
+ log('warn', message, vm);
1078
+ }
1317
1079
  /*
1318
1080
  * Copyright (c) 2018, salesforce.com, inc.
1319
1081
  * All rights reserved.
@@ -1321,14 +1083,6 @@
1321
1083
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
1322
1084
  */
1323
1085
 
1324
- /**
1325
- @license
1326
- Copyright (c) 2015 Simon Friis Vindum.
1327
- This code may only be used under the MIT License found at
1328
- https://github.com/snabbdom/snabbdom/blob/master/LICENSE
1329
- Code distributed by Snabbdom as part of the Snabbdom project at
1330
- https://github.com/snabbdom/snabbdom/
1331
- */
1332
1086
 
1333
1087
  function isUndef(s) {
1334
1088
  return s === undefined;
@@ -1417,7 +1171,7 @@
1417
1171
  } else if (sameVnode(oldStartVnode, newEndVnode)) {
1418
1172
  // Vnode moved right
1419
1173
  patchVnode(oldStartVnode, newEndVnode);
1420
- newEndVnode.hook.move(oldStartVnode, parentElm, oldEndVnode.owner.renderer.nextSibling(oldEndVnode.elm));
1174
+ newEndVnode.hook.move(oldStartVnode, parentElm, nextSibling$1(oldEndVnode.elm));
1421
1175
  oldStartVnode = oldCh[++oldStartIdx];
1422
1176
  newEndVnode = newCh[--newEndIdx];
1423
1177
  } else if (sameVnode(oldEndVnode, newStartVnode)) {
@@ -1462,12 +1216,12 @@
1462
1216
  if (oldStartIdx > oldEndIdx) {
1463
1217
  // There's some cases in which the sub array of vnodes to be inserted is followed by null(s) and an
1464
1218
  // already processed vnode, in such cases the vnodes to be inserted should be before that processed vnode.
1465
- var _i7 = newEndIdx;
1219
+ var _i6 = newEndIdx;
1466
1220
  var n;
1467
1221
 
1468
1222
  do {
1469
- n = newCh[++_i7];
1470
- } while (!isVNode(n) && _i7 < newChEnd);
1223
+ n = newCh[++_i6];
1224
+ } while (!isVNode(n) && _i6 < newChEnd);
1471
1225
 
1472
1226
  before = isVNode(n) ? n.elm : null;
1473
1227
  addVnodes(parentElm, before, newCh, newStartIdx, newEndIdx);
@@ -1498,9 +1252,9 @@
1498
1252
 
1499
1253
  var referenceElm = null;
1500
1254
 
1501
- for (var _i8 = newChLength - 1; _i8 >= 0; _i8 -= 1) {
1502
- var vnode = newCh[_i8];
1503
- var oldVNode = oldCh[_i8];
1255
+ for (var _i7 = newChLength - 1; _i7 >= 0; _i7 -= 1) {
1256
+ var vnode = newCh[_i7];
1257
+ var oldVNode = oldCh[_i7];
1504
1258
 
1505
1259
  if (vnode !== oldVNode) {
1506
1260
  if (isVNode(oldVNode)) {
@@ -1537,6 +1291,125 @@
1537
1291
  */
1538
1292
 
1539
1293
 
1294
+ var defaultDefHTMLPropertyNames = ['accessKey', 'dir', 'draggable', 'hidden', 'id', 'lang', 'spellcheck', 'tabIndex', 'title'];
1295
+
1296
+ function offsetPropertyErrorMessage(name) {
1297
+ return "Using the `".concat(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.");
1298
+ } // Global HTML Attributes & Properties
1299
+ // https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes
1300
+ // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement
1301
+
1302
+
1303
+ var globalHTMLProperties = assign(create(null), {
1304
+ accessKey: {
1305
+ attribute: 'accesskey'
1306
+ },
1307
+ accessKeyLabel: {
1308
+ readOnly: true
1309
+ },
1310
+ className: {
1311
+ attribute: 'class',
1312
+ 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.'
1313
+ },
1314
+ contentEditable: {
1315
+ attribute: 'contenteditable'
1316
+ },
1317
+ dataset: {
1318
+ readOnly: true,
1319
+ 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."
1320
+ },
1321
+ dir: {
1322
+ attribute: 'dir'
1323
+ },
1324
+ draggable: {
1325
+ attribute: 'draggable'
1326
+ },
1327
+ dropzone: {
1328
+ attribute: 'dropzone',
1329
+ readOnly: true
1330
+ },
1331
+ hidden: {
1332
+ attribute: 'hidden'
1333
+ },
1334
+ id: {
1335
+ attribute: 'id'
1336
+ },
1337
+ inputMode: {
1338
+ attribute: 'inputmode'
1339
+ },
1340
+ lang: {
1341
+ attribute: 'lang'
1342
+ },
1343
+ slot: {
1344
+ attribute: 'slot',
1345
+ error: 'Using the `slot` property is an anti-pattern.'
1346
+ },
1347
+ spellcheck: {
1348
+ attribute: 'spellcheck'
1349
+ },
1350
+ style: {
1351
+ attribute: 'style'
1352
+ },
1353
+ tabIndex: {
1354
+ attribute: 'tabindex'
1355
+ },
1356
+ title: {
1357
+ attribute: 'title'
1358
+ },
1359
+ translate: {
1360
+ attribute: 'translate'
1361
+ },
1362
+ // additional "global attributes" that are not present in the link above.
1363
+ isContentEditable: {
1364
+ readOnly: true
1365
+ },
1366
+ offsetHeight: {
1367
+ readOnly: true,
1368
+ error: offsetPropertyErrorMessage('offsetHeight')
1369
+ },
1370
+ offsetLeft: {
1371
+ readOnly: true,
1372
+ error: offsetPropertyErrorMessage('offsetLeft')
1373
+ },
1374
+ offsetParent: {
1375
+ readOnly: true
1376
+ },
1377
+ offsetTop: {
1378
+ readOnly: true,
1379
+ error: offsetPropertyErrorMessage('offsetTop')
1380
+ },
1381
+ offsetWidth: {
1382
+ readOnly: true,
1383
+ error: offsetPropertyErrorMessage('offsetWidth')
1384
+ },
1385
+ role: {
1386
+ attribute: 'role'
1387
+ }
1388
+ });
1389
+ var controlledElement = null;
1390
+ var controlledAttributeName;
1391
+
1392
+ function isAttributeLocked(elm, attrName) {
1393
+ return elm !== controlledElement || attrName !== controlledAttributeName;
1394
+ }
1395
+
1396
+ function lockAttribute(_elm, _key) {
1397
+ controlledElement = null;
1398
+ controlledAttributeName = undefined;
1399
+ }
1400
+
1401
+ function unlockAttribute(elm, key) {
1402
+ controlledElement = elm;
1403
+ controlledAttributeName = key;
1404
+ }
1405
+ /*
1406
+ * Copyright (c) 2018, salesforce.com, inc.
1407
+ * All rights reserved.
1408
+ * SPDX-License-Identifier: MIT
1409
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
1410
+ */
1411
+
1412
+
1540
1413
  function generateDataDescriptor(options) {
1541
1414
  return assign({
1542
1415
  configurable: true,
@@ -1864,7 +1737,7 @@
1864
1737
  defineProperties(proto, getLightningElementPrototypeRestrictionsDescriptors(proto));
1865
1738
  }
1866
1739
  /*
1867
- * Copyright (c) 2020, salesforce.com, inc.
1740
+ * Copyright (c) 2018, salesforce.com, inc.
1868
1741
  * All rights reserved.
1869
1742
  * SPDX-License-Identifier: MIT
1870
1743
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
@@ -2800,21 +2673,18 @@
2800
2673
 
2801
2674
 
2802
2675
  var LightningElement = function LightningElement() {
2803
- var _a; // This should be as performant as possible, while any initialization should be done lazily
2804
-
2805
-
2676
+ // This should be as performant as possible, while any initialization should be done lazily
2806
2677
  if (isNull(vmBeingConstructed)) {
2807
2678
  throw new ReferenceError('Illegal constructor');
2808
2679
  }
2809
2680
 
2810
2681
  var vm = vmBeingConstructed;
2811
2682
  var def = vm.def,
2812
- elm = vm.elm,
2813
- renderer = vm.renderer;
2683
+ elm = vm.elm;
2814
2684
  var bridge = def.bridge;
2815
2685
 
2816
2686
  if (process.env.NODE_ENV !== 'production') {
2817
- (_a = renderer.assertInstanceOfHTMLElement) === null || _a === void 0 ? void 0 : _a.call(renderer, vm.elm, "Component creation requires a DOM element to be associated to ".concat(vm, "."));
2687
+ assertInstanceOfHTMLElement$1(vm.elm, "Component creation requires a DOM element to be associated to ".concat(vm, "."));
2818
2688
  }
2819
2689
 
2820
2690
  var component = this;
@@ -2843,7 +2713,7 @@
2843
2713
  if (vm.renderMode === 1
2844
2714
  /* Shadow */
2845
2715
  ) {
2846
- attachShadow(vm);
2716
+ doAttachShadow(vm);
2847
2717
  } // Adding extra guard rails in DEV mode.
2848
2718
 
2849
2719
 
@@ -2855,15 +2725,14 @@
2855
2725
  return this;
2856
2726
  };
2857
2727
 
2858
- function attachShadow(vm) {
2859
- var _renderer$attachShado;
2728
+ function doAttachShadow(vm) {
2729
+ var _attachShadow$;
2860
2730
 
2861
2731
  var elm = vm.elm,
2862
2732
  mode = vm.mode,
2863
- renderer = vm.renderer,
2864
2733
  shadowMode = vm.shadowMode,
2865
2734
  ctor = vm.def.ctor;
2866
- var cmpRoot = renderer.attachShadow(elm, (_renderer$attachShado = {}, _defineProperty(_renderer$attachShado, KEY__SYNTHETIC_MODE, shadowMode === 1), _defineProperty(_renderer$attachShado, "delegatesFocus", Boolean(ctor.delegatesFocus)), _defineProperty(_renderer$attachShado, "mode", mode), _renderer$attachShado));
2735
+ var cmpRoot = attachShadow$1(elm, (_attachShadow$ = {}, _defineProperty(_attachShadow$, KEY__SYNTHETIC_MODE, shadowMode === 1), _defineProperty(_attachShadow$, "delegatesFocus", Boolean(ctor.delegatesFocus)), _defineProperty(_attachShadow$, "mode", mode), _attachShadow$));
2867
2736
  vm.cmpRoot = cmpRoot;
2868
2737
  associateVM(cmpRoot, vm);
2869
2738
 
@@ -2883,15 +2752,13 @@
2883
2752
  constructor: LightningElement,
2884
2753
  dispatchEvent: function dispatchEvent(event) {
2885
2754
  var _getAssociatedVM = getAssociatedVM(this),
2886
- elm = _getAssociatedVM.elm,
2887
- dispatchEvent = _getAssociatedVM.renderer.dispatchEvent;
2755
+ elm = _getAssociatedVM.elm;
2888
2756
 
2889
- return dispatchEvent(elm, event);
2757
+ return dispatchEvent$1(elm, event);
2890
2758
  },
2891
2759
  addEventListener: function addEventListener(type, listener, options) {
2892
2760
  var vm = getAssociatedVM(this);
2893
- var elm = vm.elm,
2894
- addEventListener = vm.renderer.addEventListener;
2761
+ var elm = vm.elm;
2895
2762
 
2896
2763
  if (process.env.NODE_ENV !== 'production') {
2897
2764
  var _vmBeingRendered2 = getVMBeingRendered();
@@ -2902,111 +2769,99 @@
2902
2769
  }
2903
2770
 
2904
2771
  var wrappedListener = getWrappedComponentsListener(vm, listener);
2905
- addEventListener(elm, type, wrappedListener, options);
2772
+ addEventListener$1(elm, type, wrappedListener, options);
2906
2773
  },
2907
2774
  removeEventListener: function removeEventListener(type, listener, options) {
2908
2775
  var vm = getAssociatedVM(this);
2909
- var elm = vm.elm,
2910
- removeEventListener = vm.renderer.removeEventListener;
2776
+ var elm = vm.elm;
2911
2777
  var wrappedListener = getWrappedComponentsListener(vm, listener);
2912
- removeEventListener(elm, type, wrappedListener, options);
2778
+ removeEventListener$1(elm, type, wrappedListener, options);
2913
2779
  },
2914
2780
  hasAttribute: function hasAttribute(name) {
2915
2781
  var _getAssociatedVM2 = getAssociatedVM(this),
2916
- elm = _getAssociatedVM2.elm,
2917
- getAttribute = _getAssociatedVM2.renderer.getAttribute;
2782
+ elm = _getAssociatedVM2.elm;
2918
2783
 
2919
- return !isNull(getAttribute(elm, name));
2784
+ return !isNull(getAttribute$1(elm, name));
2920
2785
  },
2921
2786
  hasAttributeNS: function hasAttributeNS(namespace, name) {
2922
2787
  var _getAssociatedVM3 = getAssociatedVM(this),
2923
- elm = _getAssociatedVM3.elm,
2924
- getAttribute = _getAssociatedVM3.renderer.getAttribute;
2788
+ elm = _getAssociatedVM3.elm;
2925
2789
 
2926
- return !isNull(getAttribute(elm, name, namespace));
2790
+ return !isNull(getAttribute$1(elm, name, namespace));
2927
2791
  },
2928
2792
  removeAttribute: function removeAttribute(name) {
2929
2793
  var _getAssociatedVM4 = getAssociatedVM(this),
2930
- elm = _getAssociatedVM4.elm,
2931
- removeAttribute = _getAssociatedVM4.renderer.removeAttribute;
2794
+ elm = _getAssociatedVM4.elm;
2932
2795
 
2933
2796
  unlockAttribute(elm, name);
2934
- removeAttribute(elm, name);
2797
+ removeAttribute$1(elm, name);
2935
2798
  lockAttribute();
2936
2799
  },
2937
2800
  removeAttributeNS: function removeAttributeNS(namespace, name) {
2938
2801
  var _getAssociatedVM5 = getAssociatedVM(this),
2939
- elm = _getAssociatedVM5.elm,
2940
- removeAttribute = _getAssociatedVM5.renderer.removeAttribute;
2802
+ elm = _getAssociatedVM5.elm;
2941
2803
 
2942
2804
  unlockAttribute(elm, name);
2943
- removeAttribute(elm, name, namespace);
2805
+ removeAttribute$1(elm, name, namespace);
2944
2806
  lockAttribute();
2945
2807
  },
2946
2808
  getAttribute: function getAttribute(name) {
2947
2809
  var _getAssociatedVM6 = getAssociatedVM(this),
2948
- elm = _getAssociatedVM6.elm,
2949
- getAttribute = _getAssociatedVM6.renderer.getAttribute;
2810
+ elm = _getAssociatedVM6.elm;
2950
2811
 
2951
- return getAttribute(elm, name);
2812
+ return getAttribute$1(elm, name);
2952
2813
  },
2953
2814
  getAttributeNS: function getAttributeNS(namespace, name) {
2954
2815
  var _getAssociatedVM7 = getAssociatedVM(this),
2955
- elm = _getAssociatedVM7.elm,
2956
- getAttribute = _getAssociatedVM7.renderer.getAttribute;
2816
+ elm = _getAssociatedVM7.elm;
2957
2817
 
2958
- return getAttribute(elm, name, namespace);
2818
+ return getAttribute$1(elm, name, namespace);
2959
2819
  },
2960
2820
  setAttribute: function setAttribute(name, value) {
2961
2821
  var vm = getAssociatedVM(this);
2962
- var elm = vm.elm,
2963
- setAttribute = vm.renderer.setAttribute;
2822
+ var elm = vm.elm;
2964
2823
 
2965
2824
  if (process.env.NODE_ENV !== 'production') {
2966
2825
  assert.isFalse(isBeingConstructed(vm), "Failed to construct '".concat(getComponentTag(vm), "': The result must not have attributes."));
2967
2826
  }
2968
2827
 
2969
2828
  unlockAttribute(elm, name);
2970
- setAttribute(elm, name, value);
2829
+ setAttribute$1(elm, name, value);
2971
2830
  lockAttribute();
2972
2831
  },
2973
2832
  setAttributeNS: function setAttributeNS(namespace, name, value) {
2974
2833
  var vm = getAssociatedVM(this);
2975
- var elm = vm.elm,
2976
- setAttribute = vm.renderer.setAttribute;
2834
+ var elm = vm.elm;
2977
2835
 
2978
2836
  if (process.env.NODE_ENV !== 'production') {
2979
2837
  assert.isFalse(isBeingConstructed(vm), "Failed to construct '".concat(getComponentTag(vm), "': The result must not have attributes."));
2980
2838
  }
2981
2839
 
2982
2840
  unlockAttribute(elm, name);
2983
- setAttribute(elm, name, value, namespace);
2841
+ setAttribute$1(elm, name, value, namespace);
2984
2842
  lockAttribute();
2985
2843
  },
2986
2844
  getBoundingClientRect: function getBoundingClientRect() {
2987
2845
  var vm = getAssociatedVM(this);
2988
- var elm = vm.elm,
2989
- getBoundingClientRect = vm.renderer.getBoundingClientRect;
2846
+ var elm = vm.elm;
2990
2847
 
2991
2848
  if (process.env.NODE_ENV !== 'production') {
2992
2849
  warnIfInvokedDuringConstruction(vm, 'getBoundingClientRect()');
2993
2850
  }
2994
2851
 
2995
- return getBoundingClientRect(elm);
2852
+ return getBoundingClientRect$1(elm);
2996
2853
  },
2997
2854
 
2998
2855
  get isConnected() {
2999
2856
  var _getAssociatedVM8 = getAssociatedVM(this),
3000
- elm = _getAssociatedVM8.elm,
3001
- isConnected = _getAssociatedVM8.renderer.isConnected;
2857
+ elm = _getAssociatedVM8.elm;
3002
2858
 
3003
- return isConnected(elm);
2859
+ return isConnected$1(elm);
3004
2860
  },
3005
2861
 
3006
2862
  get classList() {
3007
2863
  var vm = getAssociatedVM(this);
3008
- var elm = vm.elm,
3009
- getClassList = vm.renderer.getClassList;
2864
+ var elm = vm.elm;
3010
2865
 
3011
2866
  if (process.env.NODE_ENV !== 'production') {
3012
2867
  // TODO [#1290]: this still fails in dev but works in production, eventually, we should
@@ -3014,7 +2869,7 @@
3014
2869
  assert.isFalse(isBeingConstructed(vm), "Failed to construct ".concat(vm, ": The result must not have attributes. Adding or tampering with classname in constructor is not allowed in a web component, use connectedCallback() instead."));
3015
2870
  }
3016
2871
 
3017
- return getClassList(elm);
2872
+ return getClassList$1(elm);
3018
2873
  },
3019
2874
 
3020
2875
  get template() {
@@ -3046,50 +2901,88 @@
3046
2901
  return "[object ".concat(vm.def.name, "]");
3047
2902
  }
3048
2903
  };
3049
- var queryAndChildGetterDescriptors = create(null);
3050
- var 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
2904
+ var queryAndChildGetterDescriptors = create(null); // The reason we don't just call `import * as renderer from '../renderer'` here is that the bundle size
2905
+ // is smaller if we reference each function individually. Otherwise Rollup will create one big frozen
2906
+ // object representing the renderer, with a lot of methods we don't actually need.
3051
2907
 
3052
- var _loop = function _loop() {
3053
- var _childGetters$_i = _slicedToArray(_childGetters[_i9], 2),
3054
- elementProp = _childGetters$_i[0],
3055
- rendererMethod = _childGetters$_i[1];
2908
+ var childGetters = ['children', 'childNodes', 'firstChild', 'firstElementChild', 'lastChild', 'lastElementChild'];
2909
+
2910
+ function getChildGetter(methodName) {
2911
+ switch (methodName) {
2912
+ case 'children':
2913
+ return getChildren$1;
3056
2914
 
3057
- queryAndChildGetterDescriptors[elementProp] = {
2915
+ case 'childNodes':
2916
+ return getChildNodes$1;
2917
+
2918
+ case 'firstChild':
2919
+ return getFirstChild$1;
2920
+
2921
+ case 'firstElementChild':
2922
+ return getFirstElementChild$1;
2923
+
2924
+ case 'lastChild':
2925
+ return getLastChild$1;
2926
+
2927
+ case 'lastElementChild':
2928
+ return getLastElementChild$1;
2929
+ }
2930
+ } // Generic passthrough for child getters on HTMLElement to the relevant Renderer APIs
2931
+
2932
+
2933
+ var _loop = function _loop() {
2934
+ var childGetter = _childGetters[_i8];
2935
+ queryAndChildGetterDescriptors[childGetter] = {
3058
2936
  get: function get() {
3059
2937
  var vm = getAssociatedVM(this);
3060
- var elm = vm.elm,
3061
- renderer = vm.renderer;
2938
+ var elm = vm.elm;
3062
2939
 
3063
2940
  if (process.env.NODE_ENV !== 'production') {
3064
- warnIfInvokedDuringConstruction(vm, elementProp);
2941
+ warnIfInvokedDuringConstruction(vm, childGetter);
3065
2942
  }
3066
2943
 
3067
- return renderer[rendererMethod](elm);
2944
+ return getChildGetter(childGetter)(elm);
3068
2945
  },
3069
2946
  configurable: true,
3070
2947
  enumerable: true
3071
2948
  };
3072
2949
  };
3073
2950
 
3074
- for (var _i9 = 0, _childGetters = childGetters; _i9 < _childGetters.length; _i9++) {
2951
+ for (var _i8 = 0, _childGetters = childGetters; _i8 < _childGetters.length; _i8++) {
3075
2952
  _loop();
3076
2953
  }
3077
2954
 
3078
- var queryMethods = ['getElementsByClassName', 'getElementsByTagName', 'querySelector', 'querySelectorAll']; // Generic passthrough for query APIs on HTMLElement to the relevant Renderer APIs
2955
+ var queryMethods = ['getElementsByClassName', 'getElementsByTagName', 'querySelector', 'querySelectorAll'];
2956
+
2957
+ function getQueryMethod(methodName) {
2958
+ switch (methodName) {
2959
+ case 'getElementsByClassName':
2960
+ return getElementsByClassName$1;
2961
+
2962
+ case 'getElementsByTagName':
2963
+ return getElementsByTagName$1;
2964
+
2965
+ case 'querySelector':
2966
+ return querySelector$1;
2967
+
2968
+ case 'querySelectorAll':
2969
+ return querySelectorAll$1;
2970
+ }
2971
+ } // Generic passthrough for query APIs on HTMLElement to the relevant Renderer APIs
2972
+
3079
2973
 
3080
2974
  var _loop2 = function _loop2() {
3081
- var queryMethod = _queryMethods[_i10];
2975
+ var queryMethod = _queryMethods[_i9];
3082
2976
  queryAndChildGetterDescriptors[queryMethod] = {
3083
2977
  value: function value(arg) {
3084
2978
  var vm = getAssociatedVM(this);
3085
- var elm = vm.elm,
3086
- renderer = vm.renderer;
2979
+ var elm = vm.elm;
3087
2980
 
3088
2981
  if (process.env.NODE_ENV !== 'production') {
3089
2982
  warnIfInvokedDuringConstruction(vm, "".concat(queryMethod, "()"));
3090
2983
  }
3091
2984
 
3092
- return renderer[queryMethod](elm, arg);
2985
+ return getQueryMethod(queryMethod)(elm, arg);
3093
2986
  },
3094
2987
  configurable: true,
3095
2988
  enumerable: true,
@@ -3097,7 +2990,7 @@
3097
2990
  };
3098
2991
  };
3099
2992
 
3100
- for (var _i10 = 0, _queryMethods = queryMethods; _i10 < _queryMethods.length; _i10++) {
2993
+ for (var _i9 = 0, _queryMethods = queryMethods; _i9 < _queryMethods.length; _i9++) {
3101
2994
  _loop2();
3102
2995
  }
3103
2996
 
@@ -3620,8 +3513,8 @@
3620
3513
  }
3621
3514
 
3622
3515
  if (!isUndefined$1(fields)) {
3623
- for (var _i11 = 0, n = fields.length; _i11 < n; _i11++) {
3624
- var _fieldName2 = fields[_i11];
3516
+ for (var _i10 = 0, n = fields.length; _i10 < n; _i10++) {
3517
+ var _fieldName2 = fields[_i10];
3625
3518
  descriptor = getOwnPropertyDescriptor$1(proto, _fieldName2);
3626
3519
 
3627
3520
  if (process.env.NODE_ENV !== 'production') {
@@ -3842,8 +3735,8 @@
3842
3735
  superObservedAttributes = _SuperClass$observedA === void 0 ? [] : _SuperClass$observedA;
3843
3736
  var descriptors = create(null); // expose getters and setters for each public props on the new Element Bridge
3844
3737
 
3845
- for (var _i12 = 0, _len3 = props.length; _i12 < _len3; _i12 += 1) {
3846
- var _propName2 = props[_i12];
3738
+ for (var _i11 = 0, _len3 = props.length; _i11 < _len3; _i11 += 1) {
3739
+ var _propName2 = props[_i11];
3847
3740
  attributeToPropMap[htmlPropertyToAttribute(_propName2)] = _propName2;
3848
3741
  descriptors[_propName2] = {
3849
3742
  get: createGetter(_propName2),
@@ -3854,8 +3747,8 @@
3854
3747
  } // expose public methods as props on the new Element Bridge
3855
3748
 
3856
3749
 
3857
- for (var _i13 = 0, _len4 = methods.length; _i13 < _len4; _i13 += 1) {
3858
- var methodName = methods[_i13];
3750
+ for (var _i12 = 0, _len4 = methods.length; _i12 < _len4; _i12 += 1) {
3751
+ var methodName = methods[_i12];
3859
3752
  descriptors[methodName] = {
3860
3753
  value: createMethodCaller(methodName),
3861
3754
  writable: true,
@@ -4259,10 +4152,6 @@
4259
4152
 
4260
4153
  assert.isTrue(Ctor.constructor, "Missing ".concat(ctorName, ".constructor, ").concat(ctorName, " should have a \"constructor\" property."));
4261
4154
 
4262
- if (!runtimeFlags.ENABLE_MIXED_SHADOW_MODE) {
4263
- assert.isFalse('shadowSupportMode' in Ctor, "".concat(ctorName || 'Anonymous class', " is an invalid LWC component. The shadowSupportMode static property is not available in this environment."));
4264
- }
4265
-
4266
4155
  if (!isUndefined$1(ctorShadowSupportMode)) {
4267
4156
  assert.invariant(ctorShadowSupportMode === "any"
4268
4157
  /* Any */
@@ -4483,6 +4372,271 @@
4483
4372
  */
4484
4373
 
4485
4374
 
4375
+ var xlinkNS = 'http://www.w3.org/1999/xlink';
4376
+ var xmlNS = 'http://www.w3.org/XML/1998/namespace';
4377
+ var ColonCharCode = 58;
4378
+
4379
+ function patchAttributes(oldVnode, vnode) {
4380
+ var attrs = vnode.data.attrs;
4381
+
4382
+ if (isUndefined$1(attrs)) {
4383
+ return;
4384
+ }
4385
+
4386
+ var oldAttrs = isNull(oldVnode) ? EmptyObject : oldVnode.data.attrs;
4387
+
4388
+ if (oldAttrs === attrs) {
4389
+ return;
4390
+ }
4391
+
4392
+ var elm = vnode.elm;
4393
+
4394
+ for (var key in attrs) {
4395
+ var cur = attrs[key];
4396
+ var old = oldAttrs[key];
4397
+
4398
+ if (old !== cur) {
4399
+ unlockAttribute(elm, key);
4400
+
4401
+ if (StringCharCodeAt.call(key, 3) === ColonCharCode) {
4402
+ // Assume xml namespace
4403
+ setAttribute$1(elm, key, cur, xmlNS);
4404
+ } else if (StringCharCodeAt.call(key, 5) === ColonCharCode) {
4405
+ // Assume xlink namespace
4406
+ setAttribute$1(elm, key, cur, xlinkNS);
4407
+ } else if (isNull(cur) || isUndefined$1(cur)) {
4408
+ removeAttribute$1(elm, key);
4409
+ } else {
4410
+ setAttribute$1(elm, key, cur);
4411
+ }
4412
+
4413
+ lockAttribute();
4414
+ }
4415
+ }
4416
+ }
4417
+ /*
4418
+ * Copyright (c) 2018, salesforce.com, inc.
4419
+ * All rights reserved.
4420
+ * SPDX-License-Identifier: MIT
4421
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
4422
+ */
4423
+
4424
+
4425
+ function isLiveBindingProp(sel, key) {
4426
+ // For properties with live bindings, we read values from the DOM element
4427
+ // instead of relying on internally tracked values.
4428
+ return sel === 'input' && (key === 'value' || key === 'checked');
4429
+ }
4430
+
4431
+ function patchProps(oldVnode, vnode) {
4432
+ var props = vnode.data.props;
4433
+
4434
+ if (isUndefined$1(props)) {
4435
+ return;
4436
+ }
4437
+
4438
+ var oldProps = isNull(oldVnode) ? EmptyObject : oldVnode.data.props;
4439
+
4440
+ if (oldProps === props) {
4441
+ return;
4442
+ }
4443
+
4444
+ var isFirstPatch = isNull(oldVnode);
4445
+ var elm = vnode.elm,
4446
+ sel = vnode.sel;
4447
+
4448
+ for (var key in props) {
4449
+ var cur = props[key]; // Set the property if it's the first time is is patched or if the previous property is
4450
+ // different than the one previously set.
4451
+
4452
+ if (isFirstPatch || cur !== (isLiveBindingProp(sel, key) ? getProperty$1(elm, key) : oldProps[key])) {
4453
+ setProperty$1(elm, key, cur);
4454
+ }
4455
+ }
4456
+ }
4457
+ /*
4458
+ * Copyright (c) 2018, salesforce.com, inc.
4459
+ * All rights reserved.
4460
+ * SPDX-License-Identifier: MIT
4461
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
4462
+ */
4463
+
4464
+
4465
+ var classNameToClassMap = create(null);
4466
+
4467
+ function getMapFromClassName(className) {
4468
+ // Intentionally using == to match undefined and null values from computed style attribute
4469
+ if (className == null) {
4470
+ return EmptyObject;
4471
+ } // computed class names must be string
4472
+
4473
+
4474
+ className = isString(className) ? className : className + '';
4475
+ var map = classNameToClassMap[className];
4476
+
4477
+ if (map) {
4478
+ return map;
4479
+ }
4480
+
4481
+ map = create(null);
4482
+ var start = 0;
4483
+ var o;
4484
+ var len = className.length;
4485
+
4486
+ for (o = 0; o < len; o++) {
4487
+ if (StringCharCodeAt.call(className, o) === SPACE_CHAR) {
4488
+ if (o > start) {
4489
+ map[StringSlice.call(className, start, o)] = true;
4490
+ }
4491
+
4492
+ start = o + 1;
4493
+ }
4494
+ }
4495
+
4496
+ if (o > start) {
4497
+ map[StringSlice.call(className, start, o)] = true;
4498
+ }
4499
+
4500
+ classNameToClassMap[className] = map;
4501
+
4502
+ if (process.env.NODE_ENV !== 'production') {
4503
+ // just to make sure that this object never changes as part of the diffing algo
4504
+ freeze(map);
4505
+ }
4506
+
4507
+ return map;
4508
+ }
4509
+
4510
+ function patchClassAttribute(oldVnode, vnode) {
4511
+ var elm = vnode.elm,
4512
+ newClass = vnode.data.className;
4513
+ var oldClass = isNull(oldVnode) ? undefined : oldVnode.data.className;
4514
+
4515
+ if (oldClass === newClass) {
4516
+ return;
4517
+ }
4518
+
4519
+ var classList = getClassList$1(elm);
4520
+ var newClassMap = getMapFromClassName(newClass);
4521
+ var oldClassMap = getMapFromClassName(oldClass);
4522
+ var name;
4523
+
4524
+ for (name in oldClassMap) {
4525
+ // remove only if it is not in the new class collection and it is not set from within the instance
4526
+ if (isUndefined$1(newClassMap[name])) {
4527
+ classList.remove(name);
4528
+ }
4529
+ }
4530
+
4531
+ for (name in newClassMap) {
4532
+ if (isUndefined$1(oldClassMap[name])) {
4533
+ classList.add(name);
4534
+ }
4535
+ }
4536
+ }
4537
+ /*
4538
+ * Copyright (c) 2018, salesforce.com, inc.
4539
+ * All rights reserved.
4540
+ * SPDX-License-Identifier: MIT
4541
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
4542
+ */
4543
+
4544
+
4545
+ function patchStyleAttribute(oldVnode, vnode) {
4546
+ var elm = vnode.elm,
4547
+ newStyle = vnode.data.style;
4548
+ var oldStyle = isNull(oldVnode) ? undefined : oldVnode.data.style;
4549
+
4550
+ if (oldStyle === newStyle) {
4551
+ return;
4552
+ }
4553
+
4554
+ if (!isString(newStyle) || newStyle === '') {
4555
+ removeAttribute$1(elm, 'style');
4556
+ } else {
4557
+ setAttribute$1(elm, 'style', newStyle);
4558
+ }
4559
+ }
4560
+ /*
4561
+ * Copyright (c) 2018, salesforce.com, inc.
4562
+ * All rights reserved.
4563
+ * SPDX-License-Identifier: MIT
4564
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
4565
+ */
4566
+
4567
+
4568
+ function applyEventListeners(vnode) {
4569
+ var elm = vnode.elm,
4570
+ on = vnode.data.on;
4571
+
4572
+ if (isUndefined$1(on)) {
4573
+ return;
4574
+ }
4575
+
4576
+ for (var name in on) {
4577
+ var handler = on[name];
4578
+ addEventListener$1(elm, name, handler);
4579
+ }
4580
+ }
4581
+ /*
4582
+ * Copyright (c) 2018, salesforce.com, inc.
4583
+ * All rights reserved.
4584
+ * SPDX-License-Identifier: MIT
4585
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
4586
+ */
4587
+ // The compiler takes care of transforming the inline classnames into an object. It's faster to set the
4588
+ // different classnames properties individually instead of via a string.
4589
+
4590
+
4591
+ function applyStaticClassAttribute(vnode) {
4592
+ var elm = vnode.elm,
4593
+ classMap = vnode.data.classMap;
4594
+
4595
+ if (isUndefined$1(classMap)) {
4596
+ return;
4597
+ }
4598
+
4599
+ var classList = getClassList$1(elm);
4600
+
4601
+ for (var name in classMap) {
4602
+ classList.add(name);
4603
+ }
4604
+ }
4605
+ /*
4606
+ * Copyright (c) 2018, salesforce.com, inc.
4607
+ * All rights reserved.
4608
+ * SPDX-License-Identifier: MIT
4609
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
4610
+ */
4611
+ // The compiler takes care of transforming the inline style into an object. It's faster to set the
4612
+ // different style properties individually instead of via a string.
4613
+
4614
+
4615
+ function applyStaticStyleAttribute(vnode) {
4616
+ var elm = vnode.elm,
4617
+ styleDecls = vnode.data.styleDecls;
4618
+
4619
+ if (isUndefined$1(styleDecls)) {
4620
+ return;
4621
+ }
4622
+
4623
+ for (var _i13 = 0; _i13 < styleDecls.length; _i13++) {
4624
+ var _styleDecls$_i = _slicedToArray(styleDecls[_i13], 3),
4625
+ prop = _styleDecls$_i[0],
4626
+ value = _styleDecls$_i[1],
4627
+ important = _styleDecls$_i[2];
4628
+
4629
+ setCSSStyleProperty$1(elm, prop, value, important);
4630
+ }
4631
+ }
4632
+ /*
4633
+ * Copyright (c) 2018, salesforce.com, inc.
4634
+ * All rights reserved.
4635
+ * SPDX-License-Identifier: MIT
4636
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
4637
+ */
4638
+
4639
+
4486
4640
  function observeElementChildNodes(elm) {
4487
4641
  elm.$domManual$ = true;
4488
4642
  }
@@ -4498,21 +4652,20 @@
4498
4652
  var token = cmpTemplate === null || cmpTemplate === void 0 ? void 0 : cmpTemplate.stylesheetToken;
4499
4653
 
4500
4654
  if (!isUndefined$1(token) && context.hasScopedStyles) {
4501
- owner.renderer.getClassList(elm).add(token);
4655
+ getClassList$1(elm).add(token);
4502
4656
  }
4503
4657
  }
4504
4658
 
4505
4659
  function updateNodeHook(oldVnode, vnode) {
4506
4660
  var elm = vnode.elm,
4507
- text = vnode.text,
4508
- renderer = vnode.owner.renderer;
4661
+ text = vnode.text;
4509
4662
 
4510
4663
  if (oldVnode.text !== text) {
4511
4664
  if (process.env.NODE_ENV !== 'production') {
4512
4665
  unlockDomMutation();
4513
4666
  }
4514
4667
 
4515
- renderer.setText(elm, text);
4668
+ setText$1(elm, text);
4516
4669
 
4517
4670
  if (process.env.NODE_ENV !== 'production') {
4518
4671
  lockDomMutation();
@@ -4521,13 +4674,11 @@
4521
4674
  }
4522
4675
 
4523
4676
  function insertNodeHook(vnode, parentNode, referenceNode) {
4524
- var renderer = vnode.owner.renderer;
4525
-
4526
4677
  if (process.env.NODE_ENV !== 'production') {
4527
4678
  unlockDomMutation();
4528
4679
  }
4529
4680
 
4530
- renderer.insert(vnode.elm, parentNode, referenceNode);
4681
+ insert$1(vnode.elm, parentNode, referenceNode);
4531
4682
 
4532
4683
  if (process.env.NODE_ENV !== 'production') {
4533
4684
  lockDomMutation();
@@ -4535,41 +4686,35 @@
4535
4686
  }
4536
4687
 
4537
4688
  function removeNodeHook(vnode, parentNode) {
4538
- var renderer = vnode.owner.renderer;
4539
-
4540
4689
  if (process.env.NODE_ENV !== 'production') {
4541
4690
  unlockDomMutation();
4542
4691
  }
4543
4692
 
4544
- renderer.remove(vnode.elm, parentNode);
4693
+ remove$1(vnode.elm, parentNode);
4545
4694
 
4546
4695
  if (process.env.NODE_ENV !== 'production') {
4547
4696
  lockDomMutation();
4548
4697
  }
4549
4698
  }
4550
4699
 
4551
- function createElmHook(vnode) {
4552
- modEvents.create(vnode); // Attrs need to be applied to element before props
4553
- // IE11 will wipe out value on radio inputs if value
4554
- // is set before type=radio.
4700
+ function patchElementPropsAndAttrs(oldVnode, vnode) {
4701
+ if (isNull(oldVnode)) {
4702
+ applyEventListeners(vnode);
4703
+ applyStaticClassAttribute(vnode);
4704
+ applyStaticStyleAttribute(vnode);
4705
+ } // Attrs need to be applied to element before props IE11 will wipe out value on radio inputs if
4706
+ // value is set before type=radio.
4707
+
4555
4708
 
4556
- modAttrs.create(vnode);
4557
- modProps.create(vnode);
4558
- modStaticClassName.create(vnode);
4559
- modStaticStyle.create(vnode);
4560
- modComputedClassName.create(vnode);
4561
- modComputedStyle.create(vnode);
4709
+ patchClassAttribute(oldVnode, vnode);
4710
+ patchStyleAttribute(oldVnode, vnode);
4711
+ patchAttributes(oldVnode, vnode);
4712
+ patchProps(oldVnode, vnode);
4562
4713
  }
4563
4714
 
4564
4715
  function hydrateElmHook(vnode) {
4565
- modEvents.create(vnode); // Attrs are already on the element.
4566
- // modAttrs.create(vnode);
4567
-
4568
- modProps.create(vnode); // Already set.
4569
- // modStaticClassName.create(vnode);
4570
- // modStaticStyle.create(vnode);
4571
- // modComputedClassName.create(vnode);
4572
- // modComputedStyle.create(vnode);
4716
+ applyEventListeners(vnode);
4717
+ patchProps(null, vnode);
4573
4718
  }
4574
4719
 
4575
4720
  function fallbackElmHook(elm, vnode) {
@@ -4606,27 +4751,14 @@
4606
4751
  isPortal: isPortal,
4607
4752
  isLight: isLight
4608
4753
  });
4609
- }
4610
- }
4611
-
4612
- function updateElmHook(oldVnode, vnode) {
4613
- // Attrs need to be applied to element before props
4614
- // IE11 will wipe out value on radio inputs if value
4615
- // is set before type=radio.
4616
- modAttrs.update(oldVnode, vnode);
4617
- modProps.update(oldVnode, vnode);
4618
- modComputedClassName.update(oldVnode, vnode);
4619
- modComputedStyle.update(oldVnode, vnode);
4754
+ }
4620
4755
  }
4621
4756
 
4622
- function updateChildrenHook(oldVnode, vnode) {
4623
- var elm = vnode.elm,
4624
- children = vnode.children;
4625
-
4626
- if (hasDynamicChildren(children)) {
4627
- updateDynamicChildren(elm, oldVnode.children, children);
4757
+ function patchChildren(parent, oldCh, newCh) {
4758
+ if (hasDynamicChildren(newCh)) {
4759
+ updateDynamicChildren(parent, oldCh, newCh);
4628
4760
  } else {
4629
- updateStaticChildren(elm, oldVnode.children, children);
4761
+ updateStaticChildren(parent, oldCh, newCh);
4630
4762
  }
4631
4763
  }
4632
4764
 
@@ -4687,8 +4819,7 @@
4687
4819
  createVM(elm, def, {
4688
4820
  mode: mode,
4689
4821
  owner: owner,
4690
- tagName: sel,
4691
- renderer: owner.renderer
4822
+ tagName: sel
4692
4823
  });
4693
4824
 
4694
4825
  if (process.env.NODE_ENV !== 'production') {
@@ -4696,19 +4827,6 @@
4696
4827
  }
4697
4828
  }
4698
4829
 
4699
- function createCustomElmHook(vnode) {
4700
- modEvents.create(vnode); // Attrs need to be applied to element before props
4701
- // IE11 will wipe out value on radio inputs if value
4702
- // is set before type=radio.
4703
-
4704
- modAttrs.create(vnode);
4705
- modProps.create(vnode);
4706
- modStaticClassName.create(vnode);
4707
- modStaticStyle.create(vnode);
4708
- modComputedClassName.create(vnode);
4709
- modComputedStyle.create(vnode);
4710
- }
4711
-
4712
4830
  function createChildrenHook(vnode) {
4713
4831
  var elm = vnode.elm,
4714
4832
  children = vnode.children;
@@ -4730,8 +4848,7 @@
4730
4848
 
4731
4849
  function vnodesAndElementHaveCompatibleAttrs(vnode, elm) {
4732
4850
  var _vnode$data$attrs = vnode.data.attrs,
4733
- attrs = _vnode$data$attrs === void 0 ? {} : _vnode$data$attrs,
4734
- renderer = vnode.owner.renderer;
4851
+ attrs = _vnode$data$attrs === void 0 ? {} : _vnode$data$attrs;
4735
4852
  var nodesAreCompatible = true; // Validate attributes, though we could always recovery from those by running the update mods.
4736
4853
  // Note: intentionally ONLY matching vnodes.attrs to elm.attrs, in case SSR is adding extra attributes.
4737
4854
 
@@ -4740,7 +4857,7 @@
4740
4857
  attrName = _Object$entries$_i[0],
4741
4858
  attrValue = _Object$entries$_i[1];
4742
4859
 
4743
- var elmAttrValue = renderer.getAttribute(elm, attrName);
4860
+ var elmAttrValue = getAttribute$1(elm, attrName);
4744
4861
 
4745
4862
  if (String(attrValue) !== elmAttrValue) {
4746
4863
  logError("Mismatch hydrating element <".concat(elm.tagName.toLowerCase(), ">: attribute \"").concat(attrName, "\" has different values, expected \"").concat(attrValue, "\" but found \"").concat(elmAttrValue, "\""), vnode.owner);
@@ -4754,8 +4871,7 @@
4754
4871
  function vnodesAndElementHaveCompatibleClass(vnode, elm) {
4755
4872
  var _vnode$data = vnode.data,
4756
4873
  className = _vnode$data.className,
4757
- classMap = _vnode$data.classMap,
4758
- renderer = vnode.owner.renderer;
4874
+ classMap = _vnode$data.classMap;
4759
4875
  var nodesAreCompatible = true;
4760
4876
  var vnodeClassName;
4761
4877
 
@@ -4765,7 +4881,7 @@
4765
4881
  vnodeClassName = className;
4766
4882
  } else if (!isUndefined$1(classMap)) {
4767
4883
  // classMap is used when class is set to static value.
4768
- var classList = renderer.getClassList(elm);
4884
+ var classList = getClassList$1(elm);
4769
4885
  var computedClassName = ''; // all classes from the vnode should be in the element.classList
4770
4886
 
4771
4887
  for (var name in classMap) {
@@ -4793,9 +4909,8 @@
4793
4909
  function vnodesAndElementHaveCompatibleStyle(vnode, elm) {
4794
4910
  var _vnode$data2 = vnode.data,
4795
4911
  style = _vnode$data2.style,
4796
- styleDecls = _vnode$data2.styleDecls,
4797
- renderer = vnode.owner.renderer;
4798
- var elmStyle = renderer.getAttribute(elm, 'style') || '';
4912
+ styleDecls = _vnode$data2.styleDecls;
4913
+ var elmStyle = getAttribute$1(elm, 'style') || '';
4799
4914
  var vnodeStyle;
4800
4915
  var nodesAreCompatible = true;
4801
4916
 
@@ -4891,16 +5006,6 @@
4891
5006
  }
4892
5007
  }
4893
5008
 
4894
- function updateCustomElmHook(oldVnode, vnode) {
4895
- // Attrs need to be applied to element before props
4896
- // IE11 will wipe out value on radio inputs if value
4897
- // is set before type=radio.
4898
- modAttrs.update(oldVnode, vnode);
4899
- modProps.update(oldVnode, vnode);
4900
- modComputedClassName.update(oldVnode, vnode);
4901
- modComputedStyle.update(oldVnode, vnode);
4902
- }
4903
-
4904
5009
  function removeElmHook(vnode) {
4905
5010
  // this method only needs to search on child vnodes from template
4906
5011
  // to trigger the remove hook just in case some of those children
@@ -4915,6 +5020,62 @@
4915
5020
  ch.hook.remove(ch, elm);
4916
5021
  }
4917
5022
  }
5023
+ }
5024
+
5025
+ function allocateInSlot(vm, children) {
5026
+ var oldSlots = vm.cmpSlots;
5027
+ var cmpSlots = vm.cmpSlots = create(null);
5028
+
5029
+ for (var _i16 = 0, _len6 = children.length; _i16 < _len6; _i16 += 1) {
5030
+ var vnode = children[_i16];
5031
+
5032
+ if (isNull(vnode)) {
5033
+ continue;
5034
+ }
5035
+
5036
+ var data = vnode.data;
5037
+ var slotName = data.attrs && data.attrs.slot || '';
5038
+ var vnodes = cmpSlots[slotName] = cmpSlots[slotName] || []; // re-keying the vnodes is necessary to avoid conflicts with default content for the slot
5039
+ // which might have similar keys. Each vnode will always have a key that
5040
+ // starts with a numeric character from compiler. In this case, we add a unique
5041
+ // notation for slotted vnodes keys, e.g.: `@foo:1:1`
5042
+
5043
+ if (!isUndefined$1(vnode.key)) {
5044
+ vnode.key = "@".concat(slotName, ":").concat(vnode.key);
5045
+ }
5046
+
5047
+ ArrayPush$1.call(vnodes, vnode);
5048
+ }
5049
+
5050
+ if (isFalse(vm.isDirty)) {
5051
+ // We need to determine if the old allocation is really different from the new one
5052
+ // and mark the vm as dirty
5053
+ var oldKeys = keys(oldSlots);
5054
+
5055
+ if (oldKeys.length !== keys(cmpSlots).length) {
5056
+ markComponentAsDirty(vm);
5057
+ return;
5058
+ }
5059
+
5060
+ for (var _i17 = 0, _len7 = oldKeys.length; _i17 < _len7; _i17 += 1) {
5061
+ var key = oldKeys[_i17];
5062
+
5063
+ if (isUndefined$1(cmpSlots[key]) || oldSlots[key].length !== cmpSlots[key].length) {
5064
+ markComponentAsDirty(vm);
5065
+ return;
5066
+ }
5067
+
5068
+ var oldVNodes = oldSlots[key];
5069
+ var _vnodes = cmpSlots[key];
5070
+
5071
+ for (var j = 0, a = cmpSlots[key].length; j < a; j += 1) {
5072
+ if (oldVNodes[j] !== _vnodes[j]) {
5073
+ markComponentAsDirty(vm);
5074
+ return;
5075
+ }
5076
+ }
5077
+ }
5078
+ }
4918
5079
  } // Using a WeakMap instead of a WeakSet because this one works in IE11 :(
4919
5080
 
4920
5081
 
@@ -4936,12 +5097,12 @@
4936
5097
  */
4937
5098
 
4938
5099
 
4939
- function getUpgradableConstructor(tagName, renderer) {
5100
+ function getUpgradableConstructor(tagName) {
4940
5101
  // Should never get a tag with upper case letter at this point, the compiler should
4941
5102
  // produce only tags with lowercase letters
4942
5103
  // But, for backwards compatibility, we will lower case the tagName
4943
5104
  tagName = tagName.toLowerCase();
4944
- var CE = renderer.getCustomElement(tagName);
5105
+ var CE = getCustomElement$1(tagName);
4945
5106
 
4946
5107
  if (!isUndefined$1(CE)) {
4947
5108
  return CE;
@@ -4952,8 +5113,8 @@
4952
5113
  */
4953
5114
 
4954
5115
 
4955
- CE = /*#__PURE__*/function (_renderer$HTMLElement) {
4956
- _inherits(LWCUpgradableElement, _renderer$HTMLElement);
5116
+ CE = /*#__PURE__*/function (_HTMLElementExported$) {
5117
+ _inherits(LWCUpgradableElement, _HTMLElementExported$);
4957
5118
 
4958
5119
  var _super5 = _createSuper(LWCUpgradableElement);
4959
5120
 
@@ -4972,9 +5133,9 @@
4972
5133
  }
4973
5134
 
4974
5135
  return _createClass(LWCUpgradableElement);
4975
- }(renderer.HTMLElement);
5136
+ }(HTMLElementExported$1);
4976
5137
 
4977
- renderer.defineCustomElement(tagName, CE);
5138
+ defineCustomElement$1(tagName, CE);
4978
5139
  return CE;
4979
5140
  }
4980
5141
  /*
@@ -4990,8 +5151,7 @@
4990
5151
  var TextHook = {
4991
5152
  create: function create(vnode) {
4992
5153
  var owner = vnode.owner;
4993
- var renderer = owner.renderer;
4994
- var elm = renderer.createText(vnode.text);
5154
+ var elm = createText$1(vnode.text);
4995
5155
  linkNodeToShadow(elm, owner);
4996
5156
  vnode.elm = elm;
4997
5157
  },
@@ -5023,8 +5183,7 @@
5023
5183
  create: function create(vnode) {
5024
5184
  var owner = vnode.owner,
5025
5185
  text = vnode.text;
5026
- var renderer = owner.renderer;
5027
- var elm = renderer.createComment(text);
5186
+ var elm = createComment$1(text);
5028
5187
  linkNodeToShadow(elm, owner);
5029
5188
  vnode.elm = elm;
5030
5189
  },
@@ -5062,17 +5221,16 @@
5062
5221
  var sel = vnode.sel,
5063
5222
  owner = vnode.owner,
5064
5223
  svg = vnode.data.svg;
5065
- var renderer = owner.renderer;
5066
5224
  var namespace = isTrue(svg) ? SVG_NAMESPACE : undefined;
5067
- var elm = renderer.createElement(sel, namespace);
5225
+ var elm = createElement$2(sel, namespace);
5068
5226
  linkNodeToShadow(elm, owner);
5069
5227
  fallbackElmHook(elm, vnode);
5070
5228
  vnode.elm = elm;
5071
- createElmHook(vnode);
5229
+ patchElementPropsAndAttrs(null, vnode);
5072
5230
  },
5073
5231
  update: function update(oldVnode, vnode) {
5074
- updateElmHook(oldVnode, vnode);
5075
- updateChildrenHook(oldVnode, vnode);
5232
+ patchElementPropsAndAttrs(oldVnode, vnode);
5233
+ patchChildren(vnode.elm, oldVnode.children, vnode.children);
5076
5234
  },
5077
5235
  insert: function insert(vnode, parentNode, referenceNode) {
5078
5236
  insertNodeHook(vnode, parentNode, referenceNode);
@@ -5118,8 +5276,7 @@
5118
5276
  create: function create(vnode) {
5119
5277
  var sel = vnode.sel,
5120
5278
  owner = vnode.owner;
5121
- var renderer = owner.renderer;
5122
- var UpgradableConstructor = getUpgradableConstructor(sel, renderer);
5279
+ var UpgradableConstructor = getUpgradableConstructor(sel);
5123
5280
  /**
5124
5281
  * Note: if the upgradable constructor does not expect, or throw when we new it
5125
5282
  * with a callback as the first argument, we could implement a more advanced
@@ -5141,10 +5298,10 @@
5141
5298
  throw new TypeError("Incorrect Component Constructor");
5142
5299
  }
5143
5300
 
5144
- createCustomElmHook(vnode);
5301
+ patchElementPropsAndAttrs(null, vnode);
5145
5302
  },
5146
5303
  update: function update(oldVnode, vnode) {
5147
- updateCustomElmHook(oldVnode, vnode);
5304
+ patchElementPropsAndAttrs(oldVnode, vnode);
5148
5305
  var vm = getAssociatedVMIfPresent(vnode.elm);
5149
5306
 
5150
5307
  if (vm) {
@@ -5155,7 +5312,7 @@
5155
5312
  // will happen, but in native, it does allocate the light dom
5156
5313
 
5157
5314
 
5158
- updateChildrenHook(oldVnode, vnode);
5315
+ patchChildren(vnode.elm, oldVnode.children, vnode.children);
5159
5316
 
5160
5317
  if (vm) {
5161
5318
  if (process.env.NODE_ENV !== 'production') {
@@ -5210,8 +5367,7 @@
5210
5367
  createVM(elm, def, {
5211
5368
  mode: mode,
5212
5369
  owner: owner,
5213
- tagName: sel,
5214
- renderer: owner.renderer
5370
+ tagName: sel
5215
5371
  });
5216
5372
  vnode.elm = elm;
5217
5373
  var vm = getAssociatedVM(elm);
@@ -5239,11 +5395,10 @@
5239
5395
  };
5240
5396
 
5241
5397
  function linkNodeToShadow(elm, owner) {
5242
- var renderer = owner.renderer,
5243
- renderMode = owner.renderMode,
5398
+ var renderMode = owner.renderMode,
5244
5399
  shadowMode = owner.shadowMode; // TODO [#1164]: this should eventually be done by the polyfill directly
5245
5400
 
5246
- if (renderer.isSyntheticShadowDefined) {
5401
+ if (isSyntheticShadowDefined$1) {
5247
5402
  if (shadowMode === 1
5248
5403
  /* Synthetic */
5249
5404
  || renderMode === 0
@@ -5764,7 +5919,6 @@
5764
5919
  function updateStylesheetToken(vm, template) {
5765
5920
  var elm = vm.elm,
5766
5921
  context = vm.context,
5767
- renderer = vm.renderer,
5768
5922
  renderMode = vm.renderMode,
5769
5923
  shadowMode = vm.shadowMode;
5770
5924
  var newStylesheets = template.stylesheets,
@@ -5784,11 +5938,11 @@
5784
5938
  oldHasTokenInAttribute = context.hasTokenInAttribute;
5785
5939
 
5786
5940
  if (oldHasTokenInClass) {
5787
- renderer.getClassList(elm).remove(makeHostToken(oldToken));
5941
+ getClassList$1(elm).remove(makeHostToken(oldToken));
5788
5942
  }
5789
5943
 
5790
5944
  if (oldHasTokenInAttribute) {
5791
- renderer.removeAttribute(elm, makeHostToken(oldToken));
5945
+ removeAttribute$1(elm, makeHostToken(oldToken));
5792
5946
  } // Apply the new template styling token to the host element, if the new template has any
5793
5947
  // associated stylesheets. In the case of light DOM, also ensure there is at least one scoped stylesheet.
5794
5948
 
@@ -5800,12 +5954,12 @@
5800
5954
 
5801
5955
  if (!isUndefined$1(newToken)) {
5802
5956
  if (hasScopedStyles) {
5803
- renderer.getClassList(elm).add(makeHostToken(newToken));
5957
+ getClassList$1(elm).add(makeHostToken(newToken));
5804
5958
  newHasTokenInClass = true;
5805
5959
  }
5806
5960
 
5807
5961
  if (isSyntheticShadow) {
5808
- renderer.setAttribute(elm, makeHostToken(newToken), '');
5962
+ setAttribute$1(elm, makeHostToken(newToken), '');
5809
5963
  newHasTokenInAttribute = true;
5810
5964
  }
5811
5965
  } // Update the styling tokens present on the context object.
@@ -5820,8 +5974,8 @@
5820
5974
  var content = [];
5821
5975
  var root;
5822
5976
 
5823
- for (var _i16 = 0; _i16 < stylesheets.length; _i16++) {
5824
- var stylesheet = stylesheets[_i16];
5977
+ for (var _i18 = 0; _i18 < stylesheets.length; _i18++) {
5978
+ var stylesheet = stylesheets[_i18];
5825
5979
 
5826
5980
  if (isArray$1(stylesheet)) {
5827
5981
  ArrayPush$1.apply(content, evaluateStylesheetsContent(stylesheet, stylesheetToken, vm));
@@ -5923,8 +6077,7 @@
5923
6077
  }
5924
6078
 
5925
6079
  function createStylesheet(vm, stylesheets) {
5926
- var renderer = vm.renderer,
5927
- renderMode = vm.renderMode,
6080
+ var renderMode = vm.renderMode,
5928
6081
  shadowMode = vm.shadowMode;
5929
6082
 
5930
6083
  if (renderMode === 1
@@ -5932,10 +6085,10 @@
5932
6085
  && shadowMode === 1
5933
6086
  /* Synthetic */
5934
6087
  ) {
5935
- for (var _i17 = 0; _i17 < stylesheets.length; _i17++) {
5936
- renderer.insertGlobalStylesheet(stylesheets[_i17]);
6088
+ for (var _i19 = 0; _i19 < stylesheets.length; _i19++) {
6089
+ insertGlobalStylesheet$1(stylesheets[_i19]);
5937
6090
  }
5938
- } else if (renderer.ssr || renderer.isHydrating()) {
6091
+ } else if (ssr$1 || isHydrating$1()) {
5939
6092
  // Note: We need to ensure that during hydration, the stylesheets method is the same as those in ssr.
5940
6093
  // This works in the client, because the stylesheets are created, and cached in the VM
5941
6094
  // the first time the VM renders.
@@ -5947,12 +6100,12 @@
5947
6100
  var root = getNearestNativeShadowComponent(vm);
5948
6101
  var isGlobal = isNull(root);
5949
6102
 
5950
- for (var _i18 = 0; _i18 < stylesheets.length; _i18++) {
6103
+ for (var _i20 = 0; _i20 < stylesheets.length; _i20++) {
5951
6104
  if (isGlobal) {
5952
- renderer.insertGlobalStylesheet(stylesheets[_i18]);
6105
+ insertGlobalStylesheet$1(stylesheets[_i20]);
5953
6106
  } else {
5954
6107
  // local level
5955
- renderer.insertStylesheet(stylesheets[_i18], root.cmpRoot);
6108
+ insertStylesheet$1(stylesheets[_i20], root.cmpRoot);
5956
6109
  }
5957
6110
  }
5958
6111
  }
@@ -6229,8 +6382,8 @@
6229
6382
  var stylesheets = template.stylesheets;
6230
6383
 
6231
6384
  if (!isUndefined$1(stylesheets)) {
6232
- for (var _i19 = 0; _i19 < stylesheets.length; _i19++) {
6233
- if (isTrue(stylesheets[_i19][KEY__SCOPED_CSS])) {
6385
+ for (var _i21 = 0; _i21 < stylesheets.length; _i21++) {
6386
+ if (isTrue(stylesheets[_i21][KEY__SCOPED_CSS])) {
6234
6387
  return true;
6235
6388
  }
6236
6389
  }
@@ -6460,8 +6613,8 @@
6460
6613
  assert.isTrue(isObject(service), "Invalid service declaration, ".concat(service, ": service must be an object"));
6461
6614
  }
6462
6615
 
6463
- for (var _i20 = 0; _i20 < hooks.length; ++_i20) {
6464
- var hookName = hooks[_i20];
6616
+ for (var _i22 = 0; _i22 < hooks.length; ++_i22) {
6617
+ var hookName = hooks[_i22];
6465
6618
 
6466
6619
  if (hookName in service) {
6467
6620
  var l = Services[hookName];
@@ -6484,8 +6637,8 @@
6484
6637
  def = vm.def,
6485
6638
  context = vm.context;
6486
6639
 
6487
- for (var _i21 = 0, _len6 = cbs.length; _i21 < _len6; ++_i21) {
6488
- cbs[_i21].call(undefined, component, {}, def, context);
6640
+ for (var _i23 = 0, _len8 = cbs.length; _i23 < _len8; ++_i23) {
6641
+ cbs[_i23].call(undefined, component, {}, def, context);
6489
6642
  }
6490
6643
  }
6491
6644
  /*
@@ -6614,7 +6767,6 @@
6614
6767
  function createVM(elm, def, options) {
6615
6768
  var mode = options.mode,
6616
6769
  owner = options.owner,
6617
- renderer = options.renderer,
6618
6770
  tagName = options.tagName;
6619
6771
  var vm = {
6620
6772
  elm: elm,
@@ -6628,7 +6780,6 @@
6628
6780
  tagName: tagName,
6629
6781
  mode: mode,
6630
6782
  owner: owner,
6631
- renderer: renderer,
6632
6783
  children: EmptyArray,
6633
6784
  aChildren: EmptyArray,
6634
6785
  velements: EmptyArray,
@@ -6682,13 +6833,10 @@
6682
6833
  }
6683
6834
 
6684
6835
  function computeShadowMode(vm) {
6685
- var def = vm.def,
6686
- renderer = vm.renderer;
6687
- var isNativeShadowDefined = renderer.isNativeShadowDefined,
6688
- isSyntheticShadowDefined = renderer.isSyntheticShadowDefined;
6836
+ var def = vm.def;
6689
6837
  var shadowMode;
6690
6838
 
6691
- if (isSyntheticShadowDefined) {
6839
+ if (isSyntheticShadowDefined$1) {
6692
6840
  if (def.renderMode === 0
6693
6841
  /* Light */
6694
6842
  ) {
@@ -6697,7 +6845,7 @@
6697
6845
  shadowMode = 0
6698
6846
  /* Native */
6699
6847
  ;
6700
- } else if (isNativeShadowDefined) {
6848
+ } else if (isNativeShadowDefined$1) {
6701
6849
  if (def.shadowSupportMode === "any"
6702
6850
  /* Any */
6703
6851
  ) {
@@ -6803,7 +6951,6 @@
6803
6951
  // patch function mutates vnodes by adding the element reference,
6804
6952
  // however, if patching fails it contains partial changes.
6805
6953
  if (oldCh !== newCh) {
6806
- var fn = hasDynamicChildren(newCh) ? updateDynamicChildren : updateStaticChildren;
6807
6954
  runWithBoundaryProtection(vm, vm, function () {
6808
6955
  // pre
6809
6956
  logOperationStart(2
@@ -6811,8 +6958,8 @@
6811
6958
  , vm);
6812
6959
  }, function () {
6813
6960
  // job
6814
- var elementToRenderTo = getRenderRoot(vm);
6815
- fn(elementToRenderTo, oldCh, newCh);
6961
+ var renderRoot = getRenderRoot(vm);
6962
+ patchChildren(renderRoot, oldCh, newCh);
6816
6963
  }, function () {
6817
6964
  // post
6818
6965
  logOperationEnd(2
@@ -6834,10 +6981,9 @@
6834
6981
  }
6835
6982
 
6836
6983
  function runRenderedCallback(vm) {
6837
- var renderer = vm.renderer,
6838
- renderedCallback = vm.def.renderedCallback;
6984
+ var renderedCallback = vm.def.renderedCallback;
6839
6985
 
6840
- if (isTrue(renderer.ssr)) {
6986
+ if (isTrue(ssr$1)) {
6841
6987
  return;
6842
6988
  }
6843
6989
 
@@ -6874,19 +7020,19 @@
6874
7020
  });
6875
7021
  rehydrateQueue = []; // reset to a new queue
6876
7022
 
6877
- for (var _i22 = 0, _len7 = vms.length; _i22 < _len7; _i22 += 1) {
6878
- var vm = vms[_i22];
7023
+ for (var _i24 = 0, _len9 = vms.length; _i24 < _len9; _i24 += 1) {
7024
+ var vm = vms[_i24];
6879
7025
 
6880
7026
  try {
6881
7027
  rehydrate(vm);
6882
7028
  } catch (error) {
6883
- if (_i22 + 1 < _len7) {
7029
+ if (_i24 + 1 < _len9) {
6884
7030
  // pieces of the queue are still pending to be rehydrated, those should have priority
6885
7031
  if (rehydrateQueue.length === 0) {
6886
7032
  addCallbackToNextTick(flushRehydrationQueue);
6887
7033
  }
6888
7034
 
6889
- ArrayUnshift.apply(rehydrateQueue, ArraySlice.call(vms, _i22 + 1));
7035
+ ArrayUnshift.apply(rehydrateQueue, ArraySlice.call(vms, _i24 + 1));
6890
7036
  } // we need to end the measure before throwing.
6891
7037
 
6892
7038
 
@@ -6990,8 +7136,8 @@
6990
7136
  var vCustomElementCollection = vm.velements; // Reporting disconnection for every child in inverse order since they are
6991
7137
  // inserted in reserved order.
6992
7138
 
6993
- for (var _i23 = vCustomElementCollection.length - 1; _i23 >= 0; _i23 -= 1) {
6994
- var elm = vCustomElementCollection[_i23].elm; // There are two cases where the element could be undefined:
7139
+ for (var _i25 = vCustomElementCollection.length - 1; _i25 >= 0; _i25 -= 1) {
7140
+ var elm = vCustomElementCollection[_i25].elm; // There are two cases where the element could be undefined:
6995
7141
  // * when there is an error during the construction phase, and an error
6996
7142
  // boundary picks it, there is a possibility that the VCustomElement
6997
7143
  // is not properly initialized, and therefore is should be ignored.
@@ -7025,8 +7171,8 @@
7025
7171
 
7026
7172
 
7027
7173
  function recursivelyDisconnectChildren(vnodes) {
7028
- for (var _i24 = 0, _len8 = vnodes.length; _i24 < _len8; _i24 += 1) {
7029
- var vnode = vnodes[_i24];
7174
+ for (var _i26 = 0, _len10 = vnodes.length; _i26 < _len10; _i26 += 1) {
7175
+ var vnode = vnodes[_i26];
7030
7176
 
7031
7177
  if (!isNull(vnode) && isArray$1(vnode.children) && !isUndefined$1(vnode.elm)) {
7032
7178
  // vnode is a VElement with children
@@ -7046,15 +7192,14 @@
7046
7192
 
7047
7193
 
7048
7194
  function resetComponentRoot(vm) {
7049
- var children = vm.children,
7050
- renderer = vm.renderer;
7195
+ var children = vm.children;
7051
7196
  var rootNode = getRenderRoot(vm);
7052
7197
 
7053
- for (var _i25 = 0, _len9 = children.length; _i25 < _len9; _i25++) {
7054
- var child = children[_i25];
7198
+ for (var _i27 = 0, _len11 = children.length; _i27 < _len11; _i27++) {
7199
+ var child = children[_i27];
7055
7200
 
7056
7201
  if (!isNull(child) && !isUndefined$1(child.elm)) {
7057
- renderer.remove(child.elm, rootNode);
7202
+ remove$1(child.elm, rootNode);
7058
7203
  }
7059
7204
  }
7060
7205
 
@@ -7064,7 +7209,7 @@
7064
7209
  }
7065
7210
 
7066
7211
  function scheduleRehydration(vm) {
7067
- if (isTrue(vm.renderer.ssr) || isTrue(vm.isScheduled)) {
7212
+ if (isTrue(ssr$1) || isTrue(vm.isScheduled)) {
7068
7213
  return;
7069
7214
  }
7070
7215
 
@@ -7087,65 +7232,6 @@
7087
7232
 
7088
7233
  currentVm = currentVm.owner;
7089
7234
  }
7090
- } // slow path routine
7091
- // NOTE: we should probably more this routine to the synthetic shadow folder
7092
- // and get the allocation to be cached by in the elm instead of in the VM
7093
-
7094
-
7095
- function allocateInSlot(vm, children) {
7096
- var oldSlots = vm.cmpSlots;
7097
- var cmpSlots = vm.cmpSlots = create(null);
7098
-
7099
- for (var _i26 = 0, _len10 = children.length; _i26 < _len10; _i26 += 1) {
7100
- var vnode = children[_i26];
7101
-
7102
- if (isNull(vnode)) {
7103
- continue;
7104
- }
7105
-
7106
- var data = vnode.data;
7107
- var slotName = data.attrs && data.attrs.slot || '';
7108
- var vnodes = cmpSlots[slotName] = cmpSlots[slotName] || []; // re-keying the vnodes is necessary to avoid conflicts with default content for the slot
7109
- // which might have similar keys. Each vnode will always have a key that
7110
- // starts with a numeric character from compiler. In this case, we add a unique
7111
- // notation for slotted vnodes keys, e.g.: `@foo:1:1`
7112
-
7113
- if (!isUndefined$1(vnode.key)) {
7114
- vnode.key = "@".concat(slotName, ":").concat(vnode.key);
7115
- }
7116
-
7117
- ArrayPush$1.call(vnodes, vnode);
7118
- }
7119
-
7120
- if (isFalse(vm.isDirty)) {
7121
- // We need to determine if the old allocation is really different from the new one
7122
- // and mark the vm as dirty
7123
- var oldKeys = keys(oldSlots);
7124
-
7125
- if (oldKeys.length !== keys(cmpSlots).length) {
7126
- markComponentAsDirty(vm);
7127
- return;
7128
- }
7129
-
7130
- for (var _i27 = 0, _len11 = oldKeys.length; _i27 < _len11; _i27 += 1) {
7131
- var key = oldKeys[_i27];
7132
-
7133
- if (isUndefined$1(cmpSlots[key]) || oldSlots[key].length !== cmpSlots[key].length) {
7134
- markComponentAsDirty(vm);
7135
- return;
7136
- }
7137
-
7138
- var oldVNodes = oldSlots[key];
7139
- var _vnodes = cmpSlots[key];
7140
-
7141
- for (var j = 0, a = cmpSlots[key].length; j < a; j += 1) {
7142
- if (oldVNodes[j] !== _vnodes[j]) {
7143
- markComponentAsDirty(vm);
7144
- return;
7145
- }
7146
- }
7147
- }
7148
- }
7149
7235
  }
7150
7236
 
7151
7237
  function runWithBoundaryProtection(vm, owner, pre, job, post) {
@@ -7314,7 +7400,6 @@
7314
7400
  }
7315
7401
 
7316
7402
  var elm = vm.elm,
7317
- renderer = vm.renderer,
7318
7403
  _vm$context = vm.context,
7319
7404
  wiredConnecting = _vm$context.wiredConnecting,
7320
7405
  wiredDisconnecting = _vm$context.wiredDisconnecting; // waiting for the component to be connected to formally request the context via the token
@@ -7337,7 +7422,7 @@
7337
7422
  ArrayPush$1.call(wiredDisconnecting, disconnectCallback);
7338
7423
  }
7339
7424
  });
7340
- renderer.dispatchEvent(elm, contextRegistrationEvent);
7425
+ dispatchEvent$1(elm, contextRegistrationEvent);
7341
7426
  });
7342
7427
  }
7343
7428
 
@@ -7591,7 +7676,7 @@
7591
7676
  hooksAreSet = true;
7592
7677
  setSanitizeHtmlContentHook(hooks.sanitizeHtmlContent);
7593
7678
  }
7594
- /* version: 2.6.2 */
7679
+ /* version: 2.7.3 */
7595
7680
 
7596
7681
  /*
7597
7682
  * Copyright (c) 2018, salesforce.com, inc.
@@ -7621,7 +7706,9 @@
7621
7706
  var styleElements = create(null);
7622
7707
  var styleSheets = create(null);
7623
7708
  var nodesToStyleSheets = new WeakMap();
7624
- var getCustomElement, defineCustomElement, HTMLElementConstructor;
7709
+ var getCustomElement;
7710
+ var defineCustomElement;
7711
+ var HTMLElementConstructor;
7625
7712
 
7626
7713
  function isCustomElementRegistryAvailable() {
7627
7714
  if (typeof customElements === 'undefined') {
@@ -7746,152 +7833,231 @@
7746
7833
  HTMLElementConstructor.prototype = HTMLElement.prototype;
7747
7834
  }
7748
7835
 
7749
- var _isHydrating = false;
7836
+ var hydrating = false;
7750
7837
 
7751
- function setIsHydrating(v) {
7752
- _isHydrating = v;
7838
+ function setIsHydrating(value) {
7839
+ hydrating = value;
7753
7840
  }
7754
7841
 
7755
- var renderer = {
7756
- ssr: false,
7757
- isHydrating: function isHydrating() {
7758
- return _isHydrating;
7759
- },
7760
- isNativeShadowDefined: _globalThis[KEY__IS_NATIVE_SHADOW_ROOT_DEFINED],
7761
- isSyntheticShadowDefined: hasOwnProperty$1.call(Element.prototype, KEY__SHADOW_TOKEN),
7762
- createElement: function createElement(tagName, namespace) {
7763
- return isUndefined$1(namespace) ? document.createElement(tagName) : document.createElementNS(namespace, tagName);
7764
- },
7765
- createText: function createText(content) {
7766
- return document.createTextNode(content);
7767
- },
7768
- createComment: function createComment(content) {
7769
- return document.createComment(content);
7770
- },
7771
- insert: function insert(node, parent, anchor) {
7772
- parent.insertBefore(node, anchor);
7773
- },
7774
- remove: function remove(node, parent) {
7775
- parent.removeChild(node);
7776
- },
7777
- nextSibling: function nextSibling(node) {
7778
- return node.nextSibling;
7779
- },
7780
- attachShadow: function attachShadow(element, options) {
7781
- if (_isHydrating) {
7782
- return element.shadowRoot;
7783
- }
7842
+ var ssr = false;
7784
7843
 
7785
- return element.attachShadow(options);
7786
- },
7787
- setText: function setText(node, content) {
7788
- node.nodeValue = content;
7789
- },
7790
- getProperty: function getProperty(node, key) {
7791
- return node[key];
7792
- },
7793
- setProperty: function setProperty(node, key, value) {
7794
- if (process.env.NODE_ENV !== 'production') {
7795
- if (node instanceof Element && !(key in node)) {
7796
- // TODO [#1297]: Move this validation to the compiler
7797
- assert.fail("Unknown public property \"".concat(key, "\" of element <").concat(node.tagName, ">. This is likely a typo on the corresponding attribute \"").concat(htmlPropertyToAttribute(key), "\"."));
7798
- }
7799
- }
7844
+ function isHydrating() {
7845
+ return hydrating;
7846
+ }
7800
7847
 
7801
- node[key] = value;
7802
- },
7803
- getAttribute: function getAttribute(element, name, namespace) {
7804
- return isUndefined$1(namespace) ? element.getAttribute(name) : element.getAttributeNS(namespace, name);
7805
- },
7806
- setAttribute: function setAttribute(element, name, value, namespace) {
7807
- return isUndefined$1(namespace) ? element.setAttribute(name, value) : element.setAttributeNS(namespace, name, value);
7808
- },
7809
- removeAttribute: function removeAttribute(element, name, namespace) {
7810
- if (isUndefined$1(namespace)) {
7811
- element.removeAttribute(name);
7812
- } else {
7813
- element.removeAttributeNS(namespace, name);
7814
- }
7815
- },
7816
- addEventListener: function addEventListener(target, type, callback, options) {
7817
- target.addEventListener(type, callback, options);
7818
- },
7819
- removeEventListener: function removeEventListener(target, type, callback, options) {
7820
- target.removeEventListener(type, callback, options);
7821
- },
7822
- dispatchEvent: function dispatchEvent(target, event) {
7823
- return target.dispatchEvent(event);
7824
- },
7825
- getClassList: function getClassList(element) {
7826
- return element.classList;
7827
- },
7828
- setCSSStyleProperty: function setCSSStyleProperty(element, name, value, important) {
7829
- // TODO [#0]: How to avoid this type casting? Shall we use a different type interface to
7830
- // represent elements in the engine?
7831
- element.style.setProperty(name, value, important ? 'important' : '');
7832
- },
7833
- getBoundingClientRect: function getBoundingClientRect(element) {
7834
- return element.getBoundingClientRect();
7835
- },
7836
- querySelector: function querySelector(element, selectors) {
7837
- return element.querySelector(selectors);
7838
- },
7839
- querySelectorAll: function querySelectorAll(element, selectors) {
7840
- return element.querySelectorAll(selectors);
7841
- },
7842
- getElementsByTagName: function getElementsByTagName(element, tagNameOrWildCard) {
7843
- return element.getElementsByTagName(tagNameOrWildCard);
7844
- },
7845
- getElementsByClassName: function getElementsByClassName(element, names) {
7846
- return element.getElementsByClassName(names);
7847
- },
7848
- getChildren: function getChildren(element) {
7849
- return element.children;
7850
- },
7851
- getChildNodes: function getChildNodes(element) {
7852
- return element.childNodes;
7853
- },
7854
- getFirstChild: function getFirstChild(element) {
7855
- return element.firstChild;
7856
- },
7857
- getFirstElementChild: function getFirstElementChild(element) {
7858
- return element.firstElementChild;
7859
- },
7860
- getLastChild: function getLastChild(element) {
7861
- return element.lastChild;
7862
- },
7863
- getLastElementChild: function getLastElementChild(element) {
7864
- return element.lastElementChild;
7865
- },
7866
- isConnected: function isConnected(node) {
7867
- return node.isConnected;
7868
- },
7869
- insertGlobalStylesheet: function insertGlobalStylesheet(content) {
7870
- if (!isUndefined$1(globalStylesheets[content])) {
7871
- return;
7872
- }
7848
+ var isNativeShadowDefined = _globalThis[KEY__IS_NATIVE_SHADOW_ROOT_DEFINED];
7849
+ var isSyntheticShadowDefined = hasOwnProperty$1.call(Element.prototype, KEY__SHADOW_TOKEN);
7873
7850
 
7874
- globalStylesheets[content] = true;
7875
- var elm = document.createElement('style');
7876
- elm.type = 'text/css';
7877
- elm.textContent = content;
7878
- globalStylesheetsParentElement.appendChild(elm);
7879
- },
7880
- insertStylesheet: function insertStylesheet(content, target) {
7881
- if (supportsConstructableStyleSheets) {
7882
- insertConstructableStyleSheet(content, target);
7883
- } else {
7884
- // Fall back to <style> element
7885
- insertStyleElement(content, target);
7851
+ function createElement$1(tagName, namespace) {
7852
+ return isUndefined$1(namespace) ? document.createElement(tagName) : document.createElementNS(namespace, tagName);
7853
+ }
7854
+
7855
+ function createText(content) {
7856
+ return document.createTextNode(content);
7857
+ }
7858
+
7859
+ function createComment(content) {
7860
+ return document.createComment(content);
7861
+ }
7862
+
7863
+ function insert(node, parent, anchor) {
7864
+ parent.insertBefore(node, anchor);
7865
+ }
7866
+
7867
+ function remove(node, parent) {
7868
+ parent.removeChild(node);
7869
+ }
7870
+
7871
+ function nextSibling(node) {
7872
+ return node.nextSibling;
7873
+ }
7874
+
7875
+ function attachShadow(element, options) {
7876
+ if (hydrating) {
7877
+ return element.shadowRoot;
7878
+ }
7879
+
7880
+ return element.attachShadow(options);
7881
+ }
7882
+
7883
+ function setText(node, content) {
7884
+ node.nodeValue = content;
7885
+ }
7886
+
7887
+ function getProperty(node, key) {
7888
+ return node[key];
7889
+ }
7890
+
7891
+ function setProperty(node, key, value) {
7892
+ if (process.env.NODE_ENV !== 'production') {
7893
+ if (node instanceof Element && !(key in node)) {
7894
+ // TODO [#1297]: Move this validation to the compiler
7895
+ assert.fail("Unknown public property \"".concat(key, "\" of element <").concat(node.tagName, ">. This is likely a typo on the corresponding attribute \"").concat(htmlPropertyToAttribute(key), "\"."));
7886
7896
  }
7887
- },
7888
- assertInstanceOfHTMLElement: function assertInstanceOfHTMLElement(elm, msg) {
7889
- assert.invariant(elm instanceof HTMLElement, msg);
7890
- },
7891
- defineCustomElement: defineCustomElement,
7892
- getCustomElement: getCustomElement,
7893
- HTMLElement: HTMLElementConstructor
7894
- };
7897
+ }
7898
+
7899
+ node[key] = value;
7900
+ }
7901
+
7902
+ function getAttribute(element, name, namespace) {
7903
+ return isUndefined$1(namespace) ? element.getAttribute(name) : element.getAttributeNS(namespace, name);
7904
+ }
7905
+
7906
+ function setAttribute(element, name, value, namespace) {
7907
+ return isUndefined$1(namespace) ? element.setAttribute(name, value) : element.setAttributeNS(namespace, name, value);
7908
+ }
7909
+
7910
+ function removeAttribute(element, name, namespace) {
7911
+ if (isUndefined$1(namespace)) {
7912
+ element.removeAttribute(name);
7913
+ } else {
7914
+ element.removeAttributeNS(namespace, name);
7915
+ }
7916
+ }
7917
+
7918
+ function addEventListener(target, type, callback, options) {
7919
+ target.addEventListener(type, callback, options);
7920
+ }
7921
+
7922
+ function removeEventListener(target, type, callback, options) {
7923
+ target.removeEventListener(type, callback, options);
7924
+ }
7925
+
7926
+ function dispatchEvent(target, event) {
7927
+ return target.dispatchEvent(event);
7928
+ }
7929
+
7930
+ function getClassList(element) {
7931
+ return element.classList;
7932
+ }
7933
+
7934
+ function setCSSStyleProperty(element, name, value, important) {
7935
+ // TODO [#0]: How to avoid this type casting? Shall we use a different type interface to
7936
+ // represent elements in the engine?
7937
+ element.style.setProperty(name, value, important ? 'important' : '');
7938
+ }
7939
+
7940
+ function getBoundingClientRect(element) {
7941
+ return element.getBoundingClientRect();
7942
+ }
7943
+
7944
+ function querySelector(element, selectors) {
7945
+ return element.querySelector(selectors);
7946
+ }
7947
+
7948
+ function querySelectorAll(element, selectors) {
7949
+ return element.querySelectorAll(selectors);
7950
+ }
7951
+
7952
+ function getElementsByTagName(element, tagNameOrWildCard) {
7953
+ return element.getElementsByTagName(tagNameOrWildCard);
7954
+ }
7955
+
7956
+ function getElementsByClassName(element, names) {
7957
+ return element.getElementsByClassName(names);
7958
+ }
7959
+
7960
+ function getChildren(element) {
7961
+ return element.children;
7962
+ }
7963
+
7964
+ function getChildNodes(element) {
7965
+ return element.childNodes;
7966
+ }
7967
+
7968
+ function getFirstChild(element) {
7969
+ return element.firstChild;
7970
+ }
7971
+
7972
+ function getFirstElementChild(element) {
7973
+ return element.firstElementChild;
7974
+ }
7975
+
7976
+ function getLastChild(element) {
7977
+ return element.lastChild;
7978
+ }
7979
+
7980
+ function getLastElementChild(element) {
7981
+ return element.lastElementChild;
7982
+ }
7983
+
7984
+ function isConnected(node) {
7985
+ return node.isConnected;
7986
+ }
7987
+
7988
+ function insertGlobalStylesheet(content) {
7989
+ if (!isUndefined$1(globalStylesheets[content])) {
7990
+ return;
7991
+ }
7992
+
7993
+ globalStylesheets[content] = true;
7994
+ var elm = document.createElement('style');
7995
+ elm.type = 'text/css';
7996
+ elm.textContent = content;
7997
+ globalStylesheetsParentElement.appendChild(elm);
7998
+ }
7999
+
8000
+ function insertStylesheet(content, target) {
8001
+ if (supportsConstructableStyleSheets) {
8002
+ insertConstructableStyleSheet(content, target);
8003
+ } else {
8004
+ // Fall back to <style> element
8005
+ insertStyleElement(content, target);
8006
+ }
8007
+ }
8008
+
8009
+ function assertInstanceOfHTMLElement(elm, msg) {
8010
+ assert.invariant(elm instanceof HTMLElement, msg);
8011
+ }
8012
+
8013
+ var HTMLElementExported = HTMLElementConstructor;
8014
+ /*
8015
+ * Copyright (c) 2020, salesforce.com, inc.
8016
+ * All rights reserved.
8017
+ * SPDX-License-Identifier: MIT
8018
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
8019
+ */
8020
+
8021
+ setAssertInstanceOfHTMLElement(assertInstanceOfHTMLElement);
8022
+ setAttachShadow(attachShadow);
8023
+ setCreateComment(createComment);
8024
+ setCreateElement(createElement$1);
8025
+ setCreateText(createText);
8026
+ setDefineCustomElement(defineCustomElement);
8027
+ setDispatchEvent(dispatchEvent);
8028
+ setGetAttribute(getAttribute);
8029
+ setGetBoundingClientRect(getBoundingClientRect);
8030
+ setGetChildNodes(getChildNodes);
8031
+ setGetChildren(getChildren);
8032
+ setGetClassList(getClassList);
8033
+ setGetCustomElement(getCustomElement);
8034
+ setGetElementsByClassName(getElementsByClassName);
8035
+ setGetElementsByTagName(getElementsByTagName);
8036
+ setGetFirstChild(getFirstChild);
8037
+ setGetFirstElementChild(getFirstElementChild);
8038
+ setGetLastChild(getLastChild);
8039
+ setGetLastElementChild(getLastElementChild);
8040
+ setGetProperty(getProperty);
8041
+ setHTMLElement(HTMLElementExported);
8042
+ setInsert(insert);
8043
+ setInsertGlobalStylesheet(insertGlobalStylesheet);
8044
+ setInsertStylesheet(insertStylesheet);
8045
+ setIsConnected(isConnected);
8046
+ setIsHydrating$1(isHydrating);
8047
+ setIsNativeShadowDefined(isNativeShadowDefined);
8048
+ setIsSyntheticShadowDefined(isSyntheticShadowDefined);
8049
+ setNextSibling(nextSibling);
8050
+ setQuerySelector(querySelector);
8051
+ setQuerySelectorAll(querySelectorAll);
8052
+ setRemove(remove);
8053
+ setRemoveAttribute(removeAttribute);
8054
+ setRemoveEventListener(removeEventListener);
8055
+ setSetAttribute(setAttribute);
8056
+ setSetCSSStyleProperty(setCSSStyleProperty);
8057
+ setSetProperty(setProperty);
8058
+ setSetText(setText);
8059
+ setSsr(ssr);
8060
+ setAddEventListener(addEventListener);
7895
8061
  /*
7896
8062
  * Copyright (c) 2018, salesforce.com, inc.
7897
8063
  * All rights reserved.
@@ -7973,7 +8139,7 @@
7973
8139
  throw new TypeError("\"createElement\" function expects an \"is\" option with a valid component constructor.");
7974
8140
  }
7975
8141
 
7976
- var UpgradableConstructor = getUpgradableConstructor(sel, renderer);
8142
+ var UpgradableConstructor = getUpgradableConstructor(sel);
7977
8143
  var wasComponentUpgraded = false; // the custom element from the registry is expecting an upgrade callback
7978
8144
 
7979
8145
  /**
@@ -7988,8 +8154,7 @@
7988
8154
  createVM(elm, def, {
7989
8155
  tagName: sel,
7990
8156
  mode: options.mode !== 'closed' ? 'open' : 'closed',
7991
- owner: null,
7992
- renderer: renderer
8157
+ owner: null
7993
8158
  });
7994
8159
  ConnectingSlot.set(elm, connectRootElement);
7995
8160
  DisconnectingSlot.set(elm, disconnectRootElement);
@@ -8014,6 +8179,10 @@
8014
8179
  function hydrateComponent(element, Ctor) {
8015
8180
  var props = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
8016
8181
 
8182
+ if (!(element instanceof Element)) {
8183
+ throw new TypeError("\"hydrateComponent\" expects a valid DOM element as the first parameter but instead received ".concat(element, "."));
8184
+ }
8185
+
8017
8186
  if (!isFunction$1(Ctor)) {
8018
8187
  throw new TypeError("\"hydrateComponent\" expects a valid component constructor as the second parameter but instead received ".concat(Ctor, "."));
8019
8188
  }
@@ -8031,7 +8200,6 @@
8031
8200
  createVM(element, def, {
8032
8201
  mode: 'open',
8033
8202
  owner: null,
8034
- renderer: renderer,
8035
8203
  tagName: element.tagName.toLowerCase()
8036
8204
  });
8037
8205
 
@@ -8118,8 +8286,7 @@
8118
8286
  createVM(_assertThisInitialized(_this6), def, {
8119
8287
  mode: 'open',
8120
8288
  owner: null,
8121
- tagName: _this6.tagName,
8122
- renderer: renderer
8289
+ tagName: _this6.tagName
8123
8290
  });
8124
8291
  return _this6;
8125
8292
  }
@@ -8192,7 +8359,7 @@
8192
8359
  return false;
8193
8360
  }
8194
8361
 
8195
- if (renderer.isSyntheticShadowDefined) {
8362
+ if (isSyntheticShadowDefined) {
8196
8363
  // TODO [#1252]: old behavior that is still used by some pieces of the platform,
8197
8364
  // specifically, nodes inserted manually on places where `lwc:dom="manual"` directive is not
8198
8365
  // used, will be considered global elements.
@@ -8244,7 +8411,7 @@
8244
8411
  });
8245
8412
  freeze(LightningElement);
8246
8413
  seal(LightningElement.prototype);
8247
- /* version: 2.6.2 */
8414
+ /* version: 2.7.3 */
8248
8415
 
8249
8416
  exports.LightningElement = LightningElement;
8250
8417
  exports.__unstable__ProfilerControl = profilerControl;