lwc 2.13.0 → 2.13.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 (43) hide show
  1. package/dist/engine-dom/esm/es2017/engine-dom.js +155 -145
  2. package/dist/engine-dom/iife/es2017/engine-dom.js +155 -145
  3. package/dist/engine-dom/iife/es2017/engine-dom.min.js +2 -2
  4. package/dist/engine-dom/iife/es2017/engine-dom_debug.js +143 -133
  5. package/dist/engine-dom/iife/es5/engine-dom.js +162 -142
  6. package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
  7. package/dist/engine-dom/iife/es5/engine-dom_debug.js +144 -124
  8. package/dist/engine-dom/umd/es2017/engine-dom.js +155 -145
  9. package/dist/engine-dom/umd/es2017/engine-dom.min.js +2 -2
  10. package/dist/engine-dom/umd/es2017/engine-dom_debug.js +143 -133
  11. package/dist/engine-dom/umd/es5/engine-dom.js +162 -142
  12. package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
  13. package/dist/engine-dom/umd/es5/engine-dom_debug.js +144 -124
  14. package/dist/engine-server/commonjs/es2017/engine-server.js +132 -124
  15. package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
  16. package/dist/engine-server/esm/es2017/engine-server.js +132 -124
  17. package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +693 -693
  18. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +693 -693
  19. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +2 -2
  20. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +681 -681
  21. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +686 -686
  22. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +1 -1
  23. package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +697 -697
  24. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +693 -693
  25. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +2 -2
  26. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +681 -681
  27. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +686 -686
  28. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +1 -1
  29. package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +697 -697
  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.min.js +1 -1
  33. package/dist/wire-service/iife/es2017/wire-service_debug.js +2 -2
  34. package/dist/wire-service/iife/es5/wire-service.js +5 -5
  35. package/dist/wire-service/iife/es5/wire-service.min.js +1 -1
  36. package/dist/wire-service/iife/es5/wire-service_debug.js +5 -5
  37. package/dist/wire-service/umd/es2017/wire-service.js +2 -2
  38. package/dist/wire-service/umd/es2017/wire-service.min.js +1 -1
  39. package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
  40. package/dist/wire-service/umd/es5/wire-service.js +5 -5
  41. package/dist/wire-service/umd/es5/wire-service.min.js +1 -1
  42. package/dist/wire-service/umd/es5/wire-service_debug.js +5 -5
  43. package/package.json +7 -7
@@ -37,7 +37,7 @@
37
37
  return false;
38
38
  }
39
39
  }
40
- function _construct(Parent, args, Class) {
40
+ function _construct(Parent1, args1, Class1) {
41
41
  if (isNativeReflectConstruct()) {
42
42
  _construct = Reflect.construct;
43
43
  } else {
@@ -55,8 +55,8 @@
55
55
  return _construct.apply(null, arguments);
56
56
  }
57
57
  function _defineProperties(target, props) {
58
- for(var i1 = 0; i1 < props.length; i1++){
59
- var descriptor = props[i1];
58
+ for(var i2 = 0; i2 < props.length; i2++){
59
+ var descriptor = props[i2];
60
60
  descriptor.enumerable = descriptor.enumerable || false;
61
61
  descriptor.configurable = true;
62
62
  if ("value" in descriptor) descriptor.writable = true;
@@ -81,7 +81,7 @@
81
81
  }
82
82
  return obj;
83
83
  }
84
- function _get(target, property, receiver) {
84
+ function _get(target1, property1, receiver1) {
85
85
  if (typeof Reflect !== "undefined" && Reflect.get) {
86
86
  _get = Reflect.get;
87
87
  } else {
@@ -95,13 +95,13 @@
95
95
  return desc.value;
96
96
  };
97
97
  }
98
- return _get(target, property, receiver || target);
98
+ return _get(target1, property1, receiver1 || target1);
99
99
  }
100
- function _getPrototypeOf(o) {
100
+ function _getPrototypeOf(o1) {
101
101
  _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
102
102
  return o.__proto__ || Object.getPrototypeOf(o);
103
103
  };
104
- return _getPrototypeOf(o);
104
+ return _getPrototypeOf(o1);
105
105
  }
106
106
  function _inherits(subClass, superClass) {
107
107
  if (typeof superClass !== "function" && superClass !== null) {
@@ -129,7 +129,7 @@
129
129
  function _iterableToArray(iter) {
130
130
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
131
131
  }
132
- function _iterableToArrayLimit(arr, i1) {
132
+ function _iterableToArrayLimit(arr, i3) {
133
133
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
134
134
  if (_i == null) return;
135
135
  var _arr = [];
@@ -139,7 +139,7 @@
139
139
  try {
140
140
  for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
141
141
  _arr.push(_s.value);
142
- if (i1 && _arr.length === i1) break;
142
+ if (i3 && _arr.length === i3) break;
143
143
  }
144
144
  } catch (err) {
145
145
  _d = true;
@@ -165,15 +165,15 @@
165
165
  }
166
166
  return _assertThisInitialized(self);
167
167
  }
168
- function _setPrototypeOf(o, p) {
168
+ function _setPrototypeOf(o2, p1) {
169
169
  _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
170
170
  o.__proto__ = p;
171
171
  return o;
172
172
  };
173
- return _setPrototypeOf(o, p);
173
+ return _setPrototypeOf(o2, p1);
174
174
  }
175
- function _slicedToArray(arr, i1) {
176
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i1) || _unsupportedIterableToArray(arr, i1) || _nonIterableRest();
175
+ function _slicedToArray(arr, i4) {
176
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i4) || _unsupportedIterableToArray(arr, i4) || _nonIterableRest();
177
177
  }
178
178
  function _superPropBase(object, property) {
179
179
  while(!Object.prototype.hasOwnProperty.call(object, property)){
@@ -197,7 +197,7 @@
197
197
  if (n === "Map" || n === "Set") return Array.from(n);
198
198
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
199
199
  }
200
- function _wrapNativeSuper(Class) {
200
+ function _wrapNativeSuper(Class2) {
201
201
  var _cache = typeof Map === "function" ? new Map() : undefined;
202
202
  _wrapNativeSuper = function _wrapNativeSuper(Class) {
203
203
  if (Class === null || !_isNativeFunction(Class)) return Class;
@@ -221,7 +221,7 @@
221
221
  });
222
222
  return _setPrototypeOf(Wrapper, Class);
223
223
  };
224
- return _wrapNativeSuper(Class);
224
+ return _wrapNativeSuper(Class2);
225
225
  }
226
226
  function _isNativeReflectConstruct() {
227
227
  if (typeof Reflect === "undefined" || !Reflect.construct) return false;
@@ -576,9 +576,9 @@
576
576
  * SPDX-License-Identifier: MIT
577
577
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
578
578
  */ // Increment whenever the LWC template compiler changes
579
- var LWC_VERSION = "2.13.0";
579
+ var LWC_VERSION = "2.13.3";
580
580
  var LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
581
- /** version: 2.13.0 */ /*
581
+ /** version: 2.13.3 */ /*
582
582
  * Copyright (c) 2018, salesforce.com, inc.
583
583
  * All rights reserved.
584
584
  * SPDX-License-Identifier: MIT
@@ -719,7 +719,7 @@
719
719
  setFeatureFlag(name, value);
720
720
  }
721
721
  }
722
- /** version: 2.13.0 */ /* proxy-compat-disable */ /*
722
+ /** version: 2.13.3 */ /* proxy-compat-disable */ /*
723
723
  * Copyright (c) 2018, salesforce.com, inc.
724
724
  * All rights reserved.
725
725
  * SPDX-License-Identifier: MIT
@@ -753,7 +753,7 @@
753
753
  }
754
754
  function guid() {
755
755
  var s4 = function s4() {
756
- return Math.floor((1 + Math.random()) * 65536).toString(16).substring(1);
756
+ return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);
757
757
  };
758
758
  return s4() + s4() + "-" + s4() + "-" + s4() + "-" + s4() + "-" + s4() + s4() + s4();
759
759
  }
@@ -1198,6 +1198,18 @@
1198
1198
  function logWarn(message, vm10) {
1199
1199
  log("warn", message, vm10);
1200
1200
  }
1201
+ /*
1202
+ * Copyright (c) 2020, salesforce.com, inc.
1203
+ * All rights reserved.
1204
+ * SPDX-License-Identifier: MIT
1205
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
1206
+ */ function resolveCircularModuleDependency(fn) {
1207
+ var module = fn();
1208
+ return (module === null || module === void 0 ? void 0 : module.__esModule) ? module.default : module;
1209
+ }
1210
+ function isCircularModuleDependency(obj) {
1211
+ return isFunction$1(obj) && hasOwnProperty$1.call(obj, "__circular__");
1212
+ }
1201
1213
  /*
1202
1214
  * Copyright (c) 2018, salesforce.com, inc.
1203
1215
  * All rights reserved.
@@ -2679,59 +2691,7 @@
2679
2691
  if (process.env.NODE_ENV !== "production") {
2680
2692
  patchLightningElementPrototypeWithRestrictions(LightningElement.prototype);
2681
2693
  }
2682
- /*
2683
- * Copyright (c) 2018, salesforce.com, inc.
2684
- * All rights reserved.
2685
- * SPDX-License-Identifier: MIT
2686
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
2687
- */ /**
2688
- * @wire decorator to wire fields and methods to a wire adapter in
2689
- * LWC Components. This function implements the internals of this
2690
- * decorator.
2691
- */ function wire(_adapter, _config) {
2692
- if (process.env.NODE_ENV !== "production") {
2693
- assert.fail("@wire(adapter, config?) may only be used as a decorator.");
2694
- }
2695
- throw new Error();
2696
- }
2697
- function internalWireFieldDecorator(key) {
2698
- return {
2699
- get: function get1() {
2700
- var vm = getAssociatedVM(this);
2701
- componentValueObserved(vm, key);
2702
- return vm.cmpFields[key];
2703
- },
2704
- set: function set1(value) {
2705
- var vm = getAssociatedVM(this);
2706
- /**
2707
- * Reactivity for wired fields is provided in wiring.
2708
- * We intentionally add reactivity here since this is just
2709
- * letting the author to do the wrong thing, but it will keep our
2710
- * system to be backward compatible.
2711
- */ if (value !== vm.cmpFields[key]) {
2712
- vm.cmpFields[key] = value;
2713
- componentValueMutated(vm, key);
2714
- }
2715
- },
2716
- enumerable: true,
2717
- configurable: true
2718
- };
2719
- }
2720
- /*
2721
- * Copyright (c) 2018, salesforce.com, inc.
2722
- * All rights reserved.
2723
- * SPDX-License-Identifier: MIT
2724
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
2725
- */ function track(target) {
2726
- if (arguments.length === 1) {
2727
- return reactiveMembrane.getProxy(target);
2728
- }
2729
- if (process.env.NODE_ENV !== "production") {
2730
- assert.fail("@track decorator can only be used with one argument to return a trackable object, or as a decorator function.");
2731
- }
2732
- throw new Error();
2733
- }
2734
- function internalTrackDecorator(key) {
2694
+ function createObservedFieldPropertyDescriptor(key) {
2735
2695
  return {
2736
2696
  get: function get1() {
2737
2697
  var vm = getAssociatedVM(this);
@@ -2740,14 +2700,8 @@
2740
2700
  },
2741
2701
  set: function set1(newValue) {
2742
2702
  var vm = getAssociatedVM(this);
2743
- if (process.env.NODE_ENV !== "production") {
2744
- var vmBeingRendered3 = getVMBeingRendered();
2745
- assert.invariant(!isInvokingRender, "".concat(vmBeingRendered3, ".render() method has side effects on the state of ").concat(vm, ".").concat(toString$1(key)));
2746
- assert.invariant(!isUpdatingTemplate, "Updating the template of ".concat(vmBeingRendered3, " has side effects on the state of ").concat(vm, ".").concat(toString$1(key)));
2747
- }
2748
- var reactiveOrAnyValue = reactiveMembrane.getProxy(newValue);
2749
- if (reactiveOrAnyValue !== vm.cmpFields[key]) {
2750
- vm.cmpFields[key] = reactiveOrAnyValue;
2703
+ if (newValue !== vm.cmpFields[key]) {
2704
+ vm.cmpFields[key] = newValue;
2751
2705
  componentValueMutated(vm, key);
2752
2706
  }
2753
2707
  },
@@ -2782,9 +2736,9 @@
2782
2736
  set: function set1(newValue) {
2783
2737
  var vm = getAssociatedVM(this);
2784
2738
  if (process.env.NODE_ENV !== "production") {
2785
- var vmBeingRendered4 = getVMBeingRendered();
2786
- assert.invariant(!isInvokingRender, "".concat(vmBeingRendered4, ".render() method has side effects on the state of ").concat(vm, ".").concat(toString$1(key)));
2787
- assert.invariant(!isUpdatingTemplate, "Updating the template of ".concat(vmBeingRendered4, " has side effects on the state of ").concat(vm, ".").concat(toString$1(key)));
2739
+ var vmBeingRendered3 = getVMBeingRendered();
2740
+ assert.invariant(!isInvokingRender, "".concat(vmBeingRendered3, ".render() method has side effects on the state of ").concat(vm, ".").concat(toString$1(key)));
2741
+ assert.invariant(!isUpdatingTemplate, "Updating the template of ".concat(vmBeingRendered3, " has side effects on the state of ").concat(vm, ".").concat(toString$1(key)));
2788
2742
  }
2789
2743
  vm.cmpProps[key] = newValue;
2790
2744
  componentValueMutated(vm, key);
@@ -2856,9 +2810,9 @@
2856
2810
  set: function set1(newValue) {
2857
2811
  var vm = getAssociatedVM(this);
2858
2812
  if (process.env.NODE_ENV !== "production") {
2859
- var vmBeingRendered5 = getVMBeingRendered();
2860
- assert.invariant(!isInvokingRender, "".concat(vmBeingRendered5, ".render() method has side effects on the state of ").concat(vm, ".").concat(toString$1(key)));
2861
- assert.invariant(!isUpdatingTemplate, "Updating the template of ".concat(vmBeingRendered5, " has side effects on the state of ").concat(vm, ".").concat(toString$1(key)));
2813
+ var vmBeingRendered4 = getVMBeingRendered();
2814
+ assert.invariant(!isInvokingRender, "".concat(vmBeingRendered4, ".render() method has side effects on the state of ").concat(vm, ".").concat(toString$1(key)));
2815
+ assert.invariant(!isUpdatingTemplate, "Updating the template of ".concat(vmBeingRendered4, " has side effects on the state of ").concat(vm, ".").concat(toString$1(key)));
2862
2816
  }
2863
2817
  if (set) {
2864
2818
  if (runtimeFlags.ENABLE_REACTIVE_SETTER) {
@@ -2885,7 +2839,21 @@
2885
2839
  configurable: configurable
2886
2840
  };
2887
2841
  }
2888
- function createObservedFieldPropertyDescriptor(key) {
2842
+ /*
2843
+ * Copyright (c) 2018, salesforce.com, inc.
2844
+ * All rights reserved.
2845
+ * SPDX-License-Identifier: MIT
2846
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
2847
+ */ function track(target) {
2848
+ if (arguments.length === 1) {
2849
+ return reactiveMembrane.getProxy(target);
2850
+ }
2851
+ if (process.env.NODE_ENV !== "production") {
2852
+ assert.fail("@track decorator can only be used with one argument to return a trackable object, or as a decorator function.");
2853
+ }
2854
+ throw new Error();
2855
+ }
2856
+ function internalTrackDecorator(key) {
2889
2857
  return {
2890
2858
  get: function get1() {
2891
2859
  var vm = getAssociatedVM(this);
@@ -2894,8 +2862,52 @@
2894
2862
  },
2895
2863
  set: function set1(newValue) {
2896
2864
  var vm = getAssociatedVM(this);
2897
- if (newValue !== vm.cmpFields[key]) {
2898
- vm.cmpFields[key] = newValue;
2865
+ if (process.env.NODE_ENV !== "production") {
2866
+ var vmBeingRendered5 = getVMBeingRendered();
2867
+ assert.invariant(!isInvokingRender, "".concat(vmBeingRendered5, ".render() method has side effects on the state of ").concat(vm, ".").concat(toString$1(key)));
2868
+ assert.invariant(!isUpdatingTemplate, "Updating the template of ".concat(vmBeingRendered5, " has side effects on the state of ").concat(vm, ".").concat(toString$1(key)));
2869
+ }
2870
+ var reactiveOrAnyValue = reactiveMembrane.getProxy(newValue);
2871
+ if (reactiveOrAnyValue !== vm.cmpFields[key]) {
2872
+ vm.cmpFields[key] = reactiveOrAnyValue;
2873
+ componentValueMutated(vm, key);
2874
+ }
2875
+ },
2876
+ enumerable: true,
2877
+ configurable: true
2878
+ };
2879
+ }
2880
+ /*
2881
+ * Copyright (c) 2018, salesforce.com, inc.
2882
+ * All rights reserved.
2883
+ * SPDX-License-Identifier: MIT
2884
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
2885
+ */ /**
2886
+ * @wire decorator to wire fields and methods to a wire adapter in
2887
+ * LWC Components. This function implements the internals of this
2888
+ * decorator.
2889
+ */ function wire(_adapter, _config) {
2890
+ if (process.env.NODE_ENV !== "production") {
2891
+ assert.fail("@wire(adapter, config?) may only be used as a decorator.");
2892
+ }
2893
+ throw new Error();
2894
+ }
2895
+ function internalWireFieldDecorator(key) {
2896
+ return {
2897
+ get: function get1() {
2898
+ var vm = getAssociatedVM(this);
2899
+ componentValueObserved(vm, key);
2900
+ return vm.cmpFields[key];
2901
+ },
2902
+ set: function set1(value) {
2903
+ var vm = getAssociatedVM(this);
2904
+ /**
2905
+ * Reactivity for wired fields is provided in wiring.
2906
+ * We intentionally add reactivity here since this is just
2907
+ * letting the author to do the wrong thing, but it will keep our
2908
+ * system to be backward compatible.
2909
+ */ if (value !== vm.cmpFields[key]) {
2910
+ vm.cmpFields[key] = value;
2899
2911
  componentValueMutated(vm, key);
2900
2912
  }
2901
2913
  },
@@ -3135,7 +3147,12 @@
3135
3147
  }
3136
3148
  }
3137
3149
  }
3138
- var signedTemplateSet = new Set();
3150
+ /*
3151
+ * Copyright (c) 2018, salesforce.com, inc.
3152
+ * All rights reserved.
3153
+ * SPDX-License-Identifier: MIT
3154
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
3155
+ */ var signedTemplateSet = new Set();
3139
3156
  function defaultEmptyTemplate() {
3140
3157
  return [];
3141
3158
  }
@@ -3151,6 +3168,30 @@
3151
3168
  checkVersionMismatch(tpl, "template");
3152
3169
  }
3153
3170
  signedTemplateSet.add(tpl);
3171
+ // FIXME[@W-10950976]: the template object should be frozen, and it should not be possible to set
3172
+ // the stylesheets or stylesheetToken(s). For backwards compat, though, we shim stylesheetTokens
3173
+ // on top of stylesheetToken for anyone who is accessing the old internal API.
3174
+ // Details: https://salesforce.quip.com/v1rmAFu2cKAr
3175
+ defineProperty(tpl, "stylesheetTokens", {
3176
+ get: function get1() {
3177
+ var stylesheetToken = this.stylesheetToken;
3178
+ if (isUndefined$1(stylesheetToken)) {
3179
+ return stylesheetToken;
3180
+ }
3181
+ // Shim for the old `stylesheetTokens` property
3182
+ // See https://github.com/salesforce/lwc/pull/2332/files#diff-7901555acef29969adaa6583185b3e9bce475cdc6f23e799a54e0018cb18abaa
3183
+ return {
3184
+ hostAttribute: "".concat(stylesheetToken, "-host"),
3185
+ shadowAttribute: stylesheetToken
3186
+ };
3187
+ },
3188
+ set: function set1(value) {
3189
+ // If the value is null or some other exotic object, you would be broken anyway in the past
3190
+ // because the engine would try to access hostAttribute/shadowAttribute, which would throw an error.
3191
+ // However it may be undefined in newer versions of LWC, so we need to guard against that case.
3192
+ this.stylesheetToken = isUndefined$1(value) ? undefined : value.shadowAttribute;
3193
+ }
3194
+ });
3154
3195
  // chaining this method as a way to wrap existing
3155
3196
  // assignment of templates easily, without too much transformation
3156
3197
  return tpl;
@@ -3314,18 +3355,6 @@
3314
3355
  var BaseBridgeElement = HTMLBridgeElementFactory(HTMLElementConstructor$1, getOwnPropertyNames$1(HTMLElementOriginalDescriptors), []);
3315
3356
  freeze(BaseBridgeElement);
3316
3357
  seal(BaseBridgeElement.prototype);
3317
- /*
3318
- * Copyright (c) 2020, salesforce.com, inc.
3319
- * All rights reserved.
3320
- * SPDX-License-Identifier: MIT
3321
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
3322
- */ function resolveCircularModuleDependency(fn) {
3323
- var module = fn();
3324
- return (module === null || module === void 0 ? void 0 : module.__esModule) ? module.default : module;
3325
- }
3326
- function isCircularModuleDependency(obj) {
3327
- return isFunction$1(obj) && hasOwnProperty$1.call(obj, "__circular__");
3328
- }
3329
3358
  /*
3330
3359
  * Copyright (c) 2020, salesforce.com, inc.
3331
3360
  * All rights reserved.
@@ -5546,14 +5575,8 @@
5546
5575
  }
5547
5576
  resetComponentStateWhenRemoved(vm);
5548
5577
  }
5549
- function getNearestShadowAncestor(vm) {
5550
- var ancestor = vm.owner;
5551
- while(!isNull(ancestor) && ancestor.renderMode === 0){
5552
- ancestor = ancestor.owner;
5553
- }
5554
- return ancestor;
5555
- }
5556
5578
  function createVM(elm, ctor, options) {
5579
+ var _a;
5557
5580
  var mode = options.mode, owner = options.owner, tagName = options.tagName;
5558
5581
  var def = getComponentInternalDef(ctor);
5559
5582
  var vm = {
@@ -5575,6 +5598,8 @@
5575
5598
  oar: create(null),
5576
5599
  cmpTemplate: null,
5577
5600
  renderMode: def.renderMode,
5601
+ shadowMode: computeShadowMode(def, owner),
5602
+ nearestShadowMode: (owner === null || owner === void 0 ? void 0 : owner.shadowRoot) ? owner.shadowMode : (_a = owner === null || owner === void 0 ? void 0 : owner.nearestShadowMode) !== null && _a !== void 0 ? _a : null,
5578
5603
  context: {
5579
5604
  stylesheetToken: undefined,
5580
5605
  hasTokenInClass: undefined,
@@ -5587,7 +5612,6 @@
5587
5612
  },
5588
5613
  // Properties set right after VM creation.
5589
5614
  tro: null,
5590
- shadowMode: null,
5591
5615
  // Properties set by the LightningElement constructor.
5592
5616
  component: null,
5593
5617
  shadowRoot: null,
@@ -5596,7 +5620,6 @@
5596
5620
  setHook: setHook,
5597
5621
  getHook: getHook
5598
5622
  };
5599
- vm.shadowMode = computeShadowMode(vm);
5600
5623
  vm.tro = getTemplateReactiveObserver(vm);
5601
5624
  if (process.env.NODE_ENV !== "production") {
5602
5625
  vm.toString = function() {
@@ -5612,8 +5635,8 @@
5612
5635
  }
5613
5636
  return vm;
5614
5637
  }
5615
- function computeShadowMode(vm) {
5616
- var def = vm.def;
5638
+ function computeShadowMode(def, owner) {
5639
+ var _a;
5617
5640
  var shadowMode;
5618
5641
  if (isSyntheticShadowDefined$1) {
5619
5642
  if (def.renderMode === 0) {
@@ -5627,16 +5650,11 @@
5627
5650
  if (def.shadowSupportMode === "any") {
5628
5651
  shadowMode = 0 /* Native */ ;
5629
5652
  } else {
5630
- var shadowAncestor = getNearestShadowAncestor(vm);
5631
- if (!isNull(shadowAncestor) && shadowAncestor.shadowMode === 0) {
5632
- // Transitive support for native Shadow DOM. A component in native mode
5633
- // transitively opts all of its descendants into native.
5634
- shadowMode = 0 /* Native */ ;
5635
- } else {
5636
- // Synthetic if neither this component nor any of its ancestors are configured
5637
- // to be native.
5638
- shadowMode = 1 /* Synthetic */ ;
5639
- }
5653
+ // Transitive support for native Shadow DOM. A component in native mode
5654
+ // transitively opts all of its descendants into native.
5655
+ // Synthetic if neither this component nor any of its ancestors are configured
5656
+ // to be native.
5657
+ shadowMode = (_a = owner === null || owner === void 0 ? void 0 : owner.nearestShadowMode) !== null && _a !== void 0 ? _a : 1 /* Synthetic */ ;
5640
5658
  }
5641
5659
  } else {
5642
5660
  shadowMode = 1 /* Synthetic */ ;
@@ -6527,7 +6545,27 @@
6527
6545
  hooksAreSet = true;
6528
6546
  setSanitizeHtmlContentHook(hooks1.sanitizeHtmlContent);
6529
6547
  }
6530
- /* version: 2.13.0 */ /*
6548
+ /*
6549
+ * Copyright (c) 2018, salesforce.com, inc.
6550
+ * All rights reserved.
6551
+ * SPDX-License-Identifier: MIT
6552
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
6553
+ */ /**
6554
+ * EXPERIMENTAL: This function provides access to the component constructor, given an HTMLElement.
6555
+ * This API is subject to change or being removed.
6556
+ */ function getComponentConstructor(elm) {
6557
+ var ctor = null;
6558
+ // intentionally checking for undefined due to some funky libraries patching weakmap.get
6559
+ // to throw when undefined.
6560
+ if (!isUndefined$1(elm)) {
6561
+ var vm = getAssociatedVMIfPresent(elm);
6562
+ if (!isUndefined$1(vm)) {
6563
+ ctor = vm.def.ctor;
6564
+ }
6565
+ }
6566
+ return ctor;
6567
+ }
6568
+ /* version: 2.13.3 */ /*
6531
6569
  * Copyright (c) 2018, salesforce.com, inc.
6532
6570
  * All rights reserved.
6533
6571
  * SPDX-License-Identifier: MIT
@@ -7100,24 +7138,6 @@
7100
7138
  }
7101
7139
  return element;
7102
7140
  }
7103
- /*
7104
- * Copyright (c) 2018, salesforce.com, inc.
7105
- * All rights reserved.
7106
- * SPDX-License-Identifier: MIT
7107
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
7108
- */ /**
7109
- * EXPERIMENTAL: This function provides access to the component constructor, given an HTMLElement.
7110
- * This API is subject to change or being removed.
7111
- */ function getComponentConstructor(elm) {
7112
- var ctor = null;
7113
- if (_instanceof(elm, HTMLElement)) {
7114
- var vm = getAssociatedVMIfPresent(elm);
7115
- if (!isUndefined$1(vm)) {
7116
- ctor = vm.def.ctor;
7117
- }
7118
- }
7119
- return ctor;
7120
- }
7121
7141
  /*
7122
7142
  * Copyright (c) 2018, salesforce.com, inc.
7123
7143
  * All rights reserved.