lwc 2.35.0 → 2.35.2

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 (39) hide show
  1. package/dist/engine-dom/esm/es2017/engine-dom.js +61 -134
  2. package/dist/engine-dom/iife/es2017/engine-dom.js +61 -134
  3. package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
  4. package/dist/engine-dom/iife/es2017/engine-dom_debug.js +100 -74
  5. package/dist/engine-dom/iife/es5/engine-dom.js +249 -327
  6. package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
  7. package/dist/engine-dom/iife/es5/engine-dom_debug.js +266 -244
  8. package/dist/engine-dom/umd/es2017/engine-dom.js +61 -134
  9. package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
  10. package/dist/engine-dom/umd/es2017/engine-dom_debug.js +100 -74
  11. package/dist/engine-dom/umd/es5/engine-dom.js +249 -327
  12. package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
  13. package/dist/engine-dom/umd/es5/engine-dom_debug.js +266 -244
  14. package/dist/engine-server/commonjs/es2017/engine-server.js +47 -136
  15. package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
  16. package/dist/engine-server/esm/es2017/engine-server.js +47 -136
  17. package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +11 -42
  18. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +11 -42
  19. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +2 -2
  20. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +8 -38
  21. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +15 -44
  22. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +2 -2
  23. package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +12 -40
  24. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +11 -42
  25. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +2 -2
  26. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +8 -38
  27. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +15 -44
  28. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +2 -2
  29. package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +12 -40
  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 +2 -2
  34. package/dist/wire-service/iife/es5/wire-service_debug.js +2 -2
  35. package/dist/wire-service/umd/es2017/wire-service.js +2 -2
  36. package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
  37. package/dist/wire-service/umd/es5/wire-service.js +2 -2
  38. package/dist/wire-service/umd/es5/wire-service_debug.js +2 -2
  39. package/package.json +7 -7
@@ -18,16 +18,16 @@ var LWC = (function (exports) {
18
18
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
19
19
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
20
20
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
21
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
21
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
22
22
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
23
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
24
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
25
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
23
26
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
24
27
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
25
28
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
26
29
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
27
30
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
28
- function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
29
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
30
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
31
31
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
32
32
  /* proxy-compat-disable */
33
33
  /**
@@ -59,10 +59,10 @@ var LWC = (function (exports) {
59
59
  }
60
60
  var assert = /*#__PURE__*/Object.freeze({
61
61
  __proto__: null,
62
+ fail: fail,
62
63
  invariant: invariant,
63
- isTrue: isTrue$1,
64
64
  isFalse: isFalse$1,
65
- fail: fail
65
+ isTrue: isTrue$1
66
66
  });
67
67
 
68
68
  /*
@@ -203,39 +203,11 @@ var LWC = (function (exports) {
203
203
  * SPDX-License-Identifier: MIT
204
204
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
205
205
  */
206
- // Inspired from: https://mathiasbynens.be/notes/globalthis
207
- var _globalThis = /*@__PURE__*/function () {
208
- // On recent browsers, `globalThis` is already defined. In this case return it directly.
209
- if ((typeof globalThis === "undefined" ? "undefined" : _typeof(globalThis)) === 'object') {
210
- return globalThis;
211
- }
212
- var _globalThis;
213
- try {
214
- // eslint-disable-next-line no-extend-native
215
- Object.defineProperty(Object.prototype, '__magic__', {
216
- get: function get() {
217
- return this;
218
- },
219
- configurable: true
220
- });
221
- // __magic__ is undefined in Safari 10 and IE10 and older.
222
- // @ts-ignore
223
- // eslint-disable-next-line no-undef
224
- _globalThis = __magic__;
225
- // @ts-ignore
226
- delete Object.prototype.__magic__;
227
- } catch (ex) {
228
- // In IE8, Object.defineProperty only works on DOM objects.
229
- } finally {
230
- // If the magic above fails for some reason we assume that we are in a legacy browser.
231
- // Assume `window` exists in this case.
232
- if (typeof _globalThis === 'undefined') {
233
- // @ts-ignore
234
- _globalThis = window;
235
- }
236
- }
237
- return _globalThis;
238
- }();
206
+ // See browser support for globalThis:
207
+ // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis#browser_compatibility
208
+ /* istanbul ignore next */
209
+ // @ts-ignore
210
+ var _globalThis = (typeof globalThis === "undefined" ? "undefined" : _typeof(globalThis)) === 'object' ? globalThis : window;
239
211
 
240
212
  /*
241
213
  * Copyright (c) 2018, salesforce.com, inc.
@@ -338,7 +310,7 @@ var LWC = (function (exports) {
338
310
  CACHED_ATTRIBUTE_PROPERTY_MAPPING.set(attrName, propertyName);
339
311
  return propertyName;
340
312
  }
341
- /** version: 2.35.0 */
313
+ /** version: 2.35.2 */
342
314
 
343
315
  /**
344
316
  * Copyright (C) 2018 salesforce.com, inc.
@@ -390,6 +362,7 @@ var LWC = (function (exports) {
390
362
  console.warn("Failed to set the value \"".concat(value, "\" for the runtime feature flag \"").concat(name, "\" because it is undefined. Available flags: ").concat(availableFlags, "."));
391
363
  return;
392
364
  }
365
+ // This may seem redundant, but `"production" === 'test-karma-lwc'` is replaced by Karma tests
393
366
  {
394
367
  // Disallow the same flag to be set more than once in production
395
368
  var runtimeValue = lwcRuntimeFlags[name];
@@ -409,7 +382,7 @@ var LWC = (function (exports) {
409
382
  */
410
383
  function setFeatureFlagForTest(name, value) {
411
384
  }
412
- /** version: 2.35.0 */
385
+ /** version: 2.35.2 */
413
386
 
414
387
  /**
415
388
  * Copyright (C) 2018 salesforce.com, inc.
@@ -473,7 +446,7 @@ var LWC = (function (exports) {
473
446
  }
474
447
  }
475
448
  }
476
- /** version: 2.35.0 */
449
+ /** version: 2.35.2 */
477
450
 
478
451
  /*
479
452
  * Copyright (c) 2018, salesforce.com, inc.
@@ -513,23 +486,15 @@ var LWC = (function (exports) {
513
486
  attachDispatcher: function attachDispatcher(dispatcher) {
514
487
  enabled$1 = true;
515
488
  currentDispatcher$1 = dispatcher;
516
- var _iterator = _createForOfIteratorHelper(onReportingEnabledCallbacks),
517
- _step;
518
- try {
519
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
520
- var callback = _step.value;
521
- try {
522
- callback();
523
- } catch (err) {
524
- // This should never happen. But if it does, we don't want one callback to cause another to fail
525
- // eslint-disable-next-line no-console
526
- console.error('Could not invoke callback', err);
527
- }
489
+ for (var _i3 = 0, _onReportingEnabledCa = onReportingEnabledCallbacks; _i3 < _onReportingEnabledCa.length; _i3++) {
490
+ var callback = _onReportingEnabledCa[_i3];
491
+ try {
492
+ callback();
493
+ } catch (err) {
494
+ // This should never happen. But if it does, we don't want one callback to cause another to fail
495
+ // eslint-disable-next-line no-console
496
+ console.error('Could not invoke callback', err);
528
497
  }
529
- } catch (err) {
530
- _iterator.e(err);
531
- } finally {
532
- _iterator.f();
533
498
  }
534
499
  onReportingEnabledCallbacks.length = 0; // clear the array
535
500
  },
@@ -664,8 +629,8 @@ var LWC = (function (exports) {
664
629
  if (!isUndefined$1(reactiveRecord)) {
665
630
  var reactiveObservers = reactiveRecord[key];
666
631
  if (!isUndefined$1(reactiveObservers)) {
667
- for (var _i3 = 0, len = reactiveObservers.length; _i3 < len; _i3 += 1) {
668
- var ro = reactiveObservers[_i3];
632
+ for (var _i4 = 0, len = reactiveObservers.length; _i4 < len; _i4 += 1) {
633
+ var ro = reactiveObservers[_i4];
669
634
  ro.notify();
670
635
  }
671
636
  }
@@ -724,9 +689,9 @@ var LWC = (function (exports) {
724
689
  var listeners = this.listeners;
725
690
  var len = listeners.length;
726
691
  if (len > 0) {
727
- for (var _i4 = 0; _i4 < len; _i4 += 1) {
728
- var set = listeners[_i4];
729
- var pos = ArrayIndexOf.call(listeners[_i4], this);
692
+ for (var _i5 = 0; _i5 < len; _i5 += 1) {
693
+ var set = listeners[_i5];
694
+ var pos = ArrayIndexOf.call(listeners[_i5], this);
730
695
  ArraySplice.call(set, pos, 1);
731
696
  }
732
697
  listeners.length = 0;
@@ -778,8 +743,8 @@ var LWC = (function (exports) {
778
743
  function flushCallbackQueue() {
779
744
  var callbacks = nextTickCallbackQueue;
780
745
  nextTickCallbackQueue = []; // reset to a new queue
781
- for (var _i5 = 0, len = callbacks.length; _i5 < len; _i5 += 1) {
782
- callbacks[_i5]();
746
+ for (var _i6 = 0, len = callbacks.length; _i6 < len; _i6 += 1) {
747
+ callbacks[_i6]();
783
748
  }
784
749
  }
785
750
  function addCallbackToNextTick(callback) {
@@ -801,11 +766,11 @@ var LWC = (function (exports) {
801
766
  function parseStyleText(cssText) {
802
767
  var styleMap = {};
803
768
  var declarations = cssText.split(DECLARATION_DELIMITER);
804
- var _iterator2 = _createForOfIteratorHelper(declarations),
805
- _step2;
769
+ var _iterator = _createForOfIteratorHelper(declarations),
770
+ _step;
806
771
  try {
807
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
808
- var declaration = _step2.value;
772
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
773
+ var declaration = _step.value;
809
774
  if (declaration) {
810
775
  var _declaration$split = declaration.split(PROPERTY_DELIMITER),
811
776
  _declaration$split2 = _slicedToArray(_declaration$split, 2),
@@ -817,17 +782,17 @@ var LWC = (function (exports) {
817
782
  }
818
783
  }
819
784
  } catch (err) {
820
- _iterator2.e(err);
785
+ _iterator.e(err);
821
786
  } finally {
822
- _iterator2.f();
787
+ _iterator.f();
823
788
  }
824
789
  return styleMap;
825
790
  }
826
791
  // Make a shallow copy of an object but omit the given key
827
792
  function cloneAndOmitKey(object, keyToOmit) {
828
793
  var result = {};
829
- for (var _i6 = 0, _Object$keys = Object.keys(object); _i6 < _Object$keys.length; _i6++) {
830
- var key = _Object$keys[_i6];
794
+ for (var _i7 = 0, _Object$keys = Object.keys(object); _i7 < _Object$keys.length; _i7++) {
795
+ var key = _Object$keys[_i7];
831
796
  if (key !== keyToOmit) {
832
797
  result[key] = object[key];
833
798
  }
@@ -836,11 +801,11 @@ var LWC = (function (exports) {
836
801
  }
837
802
  function flattenStylesheets(stylesheets) {
838
803
  var list = [];
839
- var _iterator3 = _createForOfIteratorHelper(stylesheets),
840
- _step3;
804
+ var _iterator2 = _createForOfIteratorHelper(stylesheets),
805
+ _step2;
841
806
  try {
842
- for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
843
- var stylesheet = _step3.value;
807
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
808
+ var stylesheet = _step2.value;
844
809
  if (!Array.isArray(stylesheet)) {
845
810
  list.push(stylesheet);
846
811
  } else {
@@ -848,9 +813,9 @@ var LWC = (function (exports) {
848
813
  }
849
814
  }
850
815
  } catch (err) {
851
- _iterator3.e(err);
816
+ _iterator2.e(err);
852
817
  } finally {
853
- _iterator3.f();
818
+ _iterator2.f();
854
819
  }
855
820
  return list;
856
821
  }
@@ -865,6 +830,14 @@ var LWC = (function (exports) {
865
830
  refVNodes[ref] = vnode;
866
831
  }
867
832
  }
833
+ // Throw an error if we're running in prod mode. Ensures code is truly removed from prod mode.
834
+ function assertNotProd() {
835
+ /* istanbul ignore if */
836
+ {
837
+ // this method should never leak to prod
838
+ throw new ReferenceError();
839
+ }
840
+ }
868
841
 
869
842
  /*
870
843
  * Copyright (c) 2020, salesforce.com, inc.
@@ -1562,7 +1535,6 @@ var LWC = (function (exports) {
1562
1535
  }
1563
1536
  };
1564
1537
  }
1565
- var EMPTY_REFS = freeze(create(null));
1566
1538
  var refsCache = new WeakMap();
1567
1539
  /**
1568
1540
  * This class is the base class for any LWC element.
@@ -1729,22 +1701,15 @@ var LWC = (function (exports) {
1729
1701
  // based on `this.refs.bar`.
1730
1702
  return;
1731
1703
  }
1732
- var refVNodes = vm.refVNodes,
1733
- hasRefVNodes = vm.hasRefVNodes;
1704
+ var refVNodes = vm.refVNodes;
1734
1705
  vm.cmpTemplate;
1735
1706
  // For backwards compatibility with component written before template refs
1736
1707
  // were introduced, we return undefined if the template has no refs defined
1737
1708
  // anywhere. This fixes components that may want to add an expando called `refs`
1738
1709
  // and are checking if it exists with `if (this.refs)` before adding it.
1739
- // Note it is not sufficient to just check if `refVNodes` is null or empty,
1740
- // because a template may have `lwc:ref` defined within a falsy `if:true` block.
1741
- if (!hasRefVNodes) {
1742
- return;
1743
- }
1744
- // For templates that are using `lwc:ref`, if there are no refs currently available
1745
- // (e.g. refs inside of a falsy `if:true` block), we return an empty object.
1710
+ // Note we use a null refVNodes to indicate that the template has no refs defined.
1746
1711
  if (isNull(refVNodes)) {
1747
- return EMPTY_REFS;
1712
+ return;
1748
1713
  }
1749
1714
  // The refNodes can be cached based on the refVNodes, since the refVNodes
1750
1715
  // are recreated from scratch every time the template is rendered.
@@ -1752,17 +1717,17 @@ var LWC = (function (exports) {
1752
1717
  var refs = refsCache.get(refVNodes);
1753
1718
  if (isUndefined$1(refs)) {
1754
1719
  refs = create(null);
1755
- var _iterator4 = _createForOfIteratorHelper(keys(refVNodes)),
1756
- _step4;
1720
+ var _iterator3 = _createForOfIteratorHelper(keys(refVNodes)),
1721
+ _step3;
1757
1722
  try {
1758
- for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
1759
- var key = _step4.value;
1723
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
1724
+ var key = _step3.value;
1760
1725
  refs[key] = refVNodes[key].elm;
1761
1726
  }
1762
1727
  } catch (err) {
1763
- _iterator4.e(err);
1728
+ _iterator3.e(err);
1764
1729
  } finally {
1765
- _iterator4.f();
1730
+ _iterator3.f();
1766
1731
  }
1767
1732
  freeze(refs);
1768
1733
  refsCache.set(refVNodes, refs);
@@ -1826,7 +1791,7 @@ var LWC = (function (exports) {
1826
1791
  var queryMethods = ['getElementsByClassName', 'getElementsByTagName', 'querySelector', 'querySelectorAll'];
1827
1792
  // Generic passthrough for query APIs on HTMLElement to the relevant Renderer APIs
1828
1793
  var _loop = function _loop() {
1829
- var queryMethod = _queryMethods[_i7];
1794
+ var queryMethod = _queryMethods[_i8];
1830
1795
  queryAndChildGetterDescriptors[queryMethod] = {
1831
1796
  value: function value(arg) {
1832
1797
  var vm = getAssociatedVM(this);
@@ -1839,7 +1804,7 @@ var LWC = (function (exports) {
1839
1804
  writable: true
1840
1805
  };
1841
1806
  };
1842
- for (var _i7 = 0, _queryMethods = queryMethods; _i7 < _queryMethods.length; _i7++) {
1807
+ for (var _i8 = 0, _queryMethods = queryMethods; _i8 < _queryMethods.length; _i8++) {
1843
1808
  _loop();
1844
1809
  }
1845
1810
  defineProperties(LightningElement.prototype, queryAndChildGetterDescriptors);
@@ -2094,46 +2059,47 @@ var LWC = (function (exports) {
2094
2059
  wire = vm.def.wire;
2095
2060
  var wiredConnecting = context.wiredConnecting = [];
2096
2061
  var wiredDisconnecting = context.wiredDisconnecting = [];
2097
- for (var fieldNameOrMethod in wire) {
2062
+ var _loop2 = function _loop2() {
2098
2063
  var descriptor = wire[fieldNameOrMethod];
2099
2064
  var wireDef = WireMetaMap.get(descriptor);
2100
2065
  if (!isUndefined$1(wireDef)) {
2101
- (function () {
2102
- var _createConnector = createConnector(vm, fieldNameOrMethod, wireDef),
2103
- connector = _createConnector.connector,
2104
- computeConfigAndUpdate = _createConnector.computeConfigAndUpdate,
2105
- resetConfigWatcher = _createConnector.resetConfigWatcher;
2106
- var hasDynamicParams = wireDef.dynamic.length > 0;
2107
- ArrayPush$1.call(wiredConnecting, function () {
2108
- connector.connect();
2109
- if (!lwcRuntimeFlags.ENABLE_WIRE_SYNC_EMIT) {
2110
- if (hasDynamicParams) {
2111
- Promise.resolve().then(computeConfigAndUpdate);
2112
- return;
2113
- }
2066
+ var _createConnector = createConnector(vm, fieldNameOrMethod, wireDef),
2067
+ connector = _createConnector.connector,
2068
+ computeConfigAndUpdate = _createConnector.computeConfigAndUpdate,
2069
+ resetConfigWatcher = _createConnector.resetConfigWatcher;
2070
+ var hasDynamicParams = wireDef.dynamic.length > 0;
2071
+ ArrayPush$1.call(wiredConnecting, function () {
2072
+ connector.connect();
2073
+ if (!lwcRuntimeFlags.ENABLE_WIRE_SYNC_EMIT) {
2074
+ if (hasDynamicParams) {
2075
+ Promise.resolve().then(computeConfigAndUpdate);
2076
+ return;
2114
2077
  }
2115
- computeConfigAndUpdate();
2116
- });
2117
- ArrayPush$1.call(wiredDisconnecting, function () {
2118
- connector.disconnect();
2119
- resetConfigWatcher();
2120
- });
2121
- })();
2078
+ }
2079
+ computeConfigAndUpdate();
2080
+ });
2081
+ ArrayPush$1.call(wiredDisconnecting, function () {
2082
+ connector.disconnect();
2083
+ resetConfigWatcher();
2084
+ });
2122
2085
  }
2086
+ };
2087
+ for (var fieldNameOrMethod in wire) {
2088
+ _loop2();
2123
2089
  }
2124
2090
  }
2125
2091
  function connectWireAdapters(vm) {
2126
2092
  var wiredConnecting = vm.context.wiredConnecting;
2127
- for (var _i8 = 0, len = wiredConnecting.length; _i8 < len; _i8 += 1) {
2128
- wiredConnecting[_i8]();
2093
+ for (var _i9 = 0, len = wiredConnecting.length; _i9 < len; _i9 += 1) {
2094
+ wiredConnecting[_i9]();
2129
2095
  }
2130
2096
  }
2131
2097
  function disconnectWireAdapters(vm) {
2132
2098
  var wiredDisconnecting = vm.context.wiredDisconnecting;
2133
2099
  runWithBoundaryProtection(vm, vm, noop, function () {
2134
2100
  // job
2135
- for (var _i9 = 0, len = wiredDisconnecting.length; _i9 < len; _i9 += 1) {
2136
- wiredDisconnecting[_i9]();
2101
+ for (var _i10 = 0, len = wiredDisconnecting.length; _i10 < len; _i10 += 1) {
2102
+ wiredDisconnecting[_i10]();
2137
2103
  }
2138
2104
  }, noop);
2139
2105
  }
@@ -2335,8 +2301,8 @@ var LWC = (function (exports) {
2335
2301
  }
2336
2302
  }
2337
2303
  if (!isUndefined$1(fields)) {
2338
- for (var _i10 = 0, n = fields.length; _i10 < n; _i10++) {
2339
- var _fieldName2 = fields[_i10];
2304
+ for (var _i11 = 0, n = fields.length; _i11 < n; _i11++) {
2305
+ var _fieldName2 = fields[_i11];
2340
2306
  descriptor = getOwnPropertyDescriptor$1(proto, _fieldName2);
2341
2307
  // [W-9927596] Only mark a field as observed whenever it isn't a duplicated public nor
2342
2308
  // tracked property. This is only here for backward compatibility purposes.
@@ -2517,8 +2483,8 @@ var LWC = (function (exports) {
2517
2483
  superObservedAttributes = _SuperClass$observedA === void 0 ? [] : _SuperClass$observedA;
2518
2484
  var descriptors = create(null);
2519
2485
  // expose getters and setters for each public props on the new Element Bridge
2520
- for (var _i11 = 0, len = props.length; _i11 < len; _i11 += 1) {
2521
- var _propName = props[_i11];
2486
+ for (var _i12 = 0, len = props.length; _i12 < len; _i12 += 1) {
2487
+ var _propName = props[_i12];
2522
2488
  attributeToPropMap[htmlPropertyToAttribute(_propName)] = _propName;
2523
2489
  descriptors[_propName] = {
2524
2490
  get: createGetter(_propName),
@@ -2528,8 +2494,8 @@ var LWC = (function (exports) {
2528
2494
  };
2529
2495
  }
2530
2496
  // expose public methods as props on the new Element Bridge
2531
- for (var _i12 = 0, _len = methods.length; _i12 < _len; _i12 += 1) {
2532
- var methodName = methods[_i12];
2497
+ for (var _i13 = 0, _len = methods.length; _i13 < _len; _i13 += 1) {
2498
+ var methodName = methods[_i13];
2533
2499
  descriptors[methodName] = {
2534
2500
  value: createMethodCaller(methodName),
2535
2501
  writable: true,
@@ -2570,10 +2536,60 @@ var LWC = (function (exports) {
2570
2536
  }
2571
2537
  freeze(BaseBridgeElement);
2572
2538
  seal(BaseBridgeElement.prototype);
2539
+ var swappedStyleMap = new WeakMap();
2540
+ var activeTemplates = new WeakMap();
2541
+ var activeComponents = new WeakMap();
2542
+ var activeStyles = new WeakMap();
2543
+ function getStyleOrSwappedStyle(style) {
2544
+ assertNotProd(); // this method should never leak to prod
2545
+ var visited = new Set();
2546
+ while (swappedStyleMap.has(style) && !visited.has(style)) {
2547
+ visited.add(style);
2548
+ style = swappedStyleMap.get(style);
2549
+ }
2550
+ return style;
2551
+ }
2573
2552
  function setActiveVM(vm) {
2574
- {
2575
- // this method should never leak to prod
2576
- throw new ReferenceError();
2553
+ assertNotProd(); // this method should never leak to prod
2554
+ // tracking active component
2555
+ var Ctor = vm.def.ctor;
2556
+ var componentVMs = activeComponents.get(Ctor);
2557
+ if (isUndefined$1(componentVMs)) {
2558
+ componentVMs = new Set();
2559
+ activeComponents.set(Ctor, componentVMs);
2560
+ }
2561
+ // this will allow us to keep track of the hot components
2562
+ componentVMs.add(vm);
2563
+ // tracking active template
2564
+ var tpl = vm.cmpTemplate;
2565
+ if (tpl) {
2566
+ var templateVMs = activeTemplates.get(tpl);
2567
+ if (isUndefined$1(templateVMs)) {
2568
+ templateVMs = new Set();
2569
+ activeTemplates.set(tpl, templateVMs);
2570
+ }
2571
+ // this will allow us to keep track of the templates that are
2572
+ // being used by a hot component
2573
+ templateVMs.add(vm);
2574
+ // tracking active styles associated to template
2575
+ var stylesheets = tpl.stylesheets;
2576
+ if (!isUndefined$1(stylesheets)) {
2577
+ flattenStylesheets(stylesheets).forEach(function (stylesheet) {
2578
+ // this is necessary because we don't hold the list of styles
2579
+ // in the vm, we only hold the selected (already swapped template)
2580
+ // but the styles attached to the template might not be the actual
2581
+ // active ones, but the swapped versions of those.
2582
+ stylesheet = getStyleOrSwappedStyle(stylesheet);
2583
+ var stylesheetVMs = activeStyles.get(stylesheet);
2584
+ if (isUndefined$1(stylesheetVMs)) {
2585
+ stylesheetVMs = new Set();
2586
+ activeStyles.set(stylesheet, stylesheetVMs);
2587
+ }
2588
+ // this will allow us to keep track of the stylesheet that are
2589
+ // being used by a hot component
2590
+ stylesheetVMs.add(vm);
2591
+ });
2592
+ }
2577
2593
  }
2578
2594
  }
2579
2595
  function swapTemplate(oldTpl, newTpl) {
@@ -2847,8 +2863,8 @@ var LWC = (function (exports) {
2847
2863
  function evaluateStylesheetsContent(stylesheets, stylesheetToken, vm) {
2848
2864
  var content = [];
2849
2865
  var root;
2850
- for (var _i13 = 0; _i13 < stylesheets.length; _i13++) {
2851
- var stylesheet = stylesheets[_i13];
2866
+ for (var _i14 = 0; _i14 < stylesheets.length; _i14++) {
2867
+ var stylesheet = stylesheets[_i14];
2852
2868
  if (isArray$1(stylesheet)) {
2853
2869
  ArrayPush$1.apply(content, evaluateStylesheetsContent(stylesheet, stylesheetToken, vm));
2854
2870
  } else {
@@ -2948,8 +2964,8 @@ var LWC = (function (exports) {
2948
2964
  shadowMode = vm.shadowMode,
2949
2965
  insertStylesheet = vm.renderer.insertStylesheet;
2950
2966
  if (renderMode === 1 /* RenderMode.Shadow */ && shadowMode === 1 /* ShadowMode.Synthetic */) {
2951
- for (var _i14 = 0; _i14 < stylesheets.length; _i14++) {
2952
- insertStylesheet(stylesheets[_i14]);
2967
+ for (var _i15 = 0; _i15 < stylesheets.length; _i15++) {
2968
+ insertStylesheet(stylesheets[_i15]);
2953
2969
  }
2954
2970
  } else if (vm.hydrated) {
2955
2971
  // Note: We need to ensure that during hydration, the stylesheets method is the same as those in ssr.
@@ -2962,8 +2978,8 @@ var LWC = (function (exports) {
2962
2978
  var root = getNearestNativeShadowComponent(vm);
2963
2979
  // null root means a global style
2964
2980
  var target = isNull(root) ? undefined : root.shadowRoot;
2965
- for (var _i15 = 0; _i15 < stylesheets.length; _i15++) {
2966
- insertStylesheet(stylesheets[_i15], target);
2981
+ for (var _i16 = 0; _i16 < stylesheets.length; _i16++) {
2982
+ insertStylesheet(stylesheets[_i16], target);
2967
2983
  }
2968
2984
  }
2969
2985
  return null;
@@ -3265,8 +3281,8 @@ var LWC = (function (exports) {
3265
3281
  return;
3266
3282
  }
3267
3283
  var setCSSStyleProperty = renderer.setCSSStyleProperty;
3268
- for (var _i16 = 0; _i16 < styleDecls.length; _i16++) {
3269
- var _styleDecls$_i = _slicedToArray(styleDecls[_i16], 3),
3284
+ for (var _i17 = 0; _i17 < styleDecls.length; _i17++) {
3285
+ var _styleDecls$_i = _slicedToArray(styleDecls[_i17], 3),
3270
3286
  prop = _styleDecls$_i[0],
3271
3287
  value = _styleDecls$_i[1],
3272
3288
  important = _styleDecls$_i[2];
@@ -3689,8 +3705,8 @@ var LWC = (function (exports) {
3689
3705
  // If no VFragment is found in children, we don't need to traverse anything or mark the children dynamic and can return early.
3690
3706
  var nodeStack = [];
3691
3707
  var fragmentFound = false;
3692
- for (var _i17 = children.length - 1; _i17 > -1; _i17 -= 1) {
3693
- var child = children[_i17];
3708
+ for (var _i18 = children.length - 1; _i18 > -1; _i18 -= 1) {
3709
+ var child = children[_i18];
3694
3710
  ArrayPush$1.call(nodeStack, child);
3695
3711
  fragmentFound = fragmentFound || !!(child && isVFragment(child));
3696
3712
  }
@@ -3702,8 +3718,8 @@ var LWC = (function (exports) {
3702
3718
  if (!isNull(currentNode) && isVFragment(currentNode)) {
3703
3719
  var fChildren = currentNode.children;
3704
3720
  // Ignore the start and end text node delimiters
3705
- for (var _i18 = fChildren.length - 2; _i18 > 0; _i18 -= 1) {
3706
- ArrayPush$1.call(nodeStack, fChildren[_i18]);
3721
+ for (var _i19 = fChildren.length - 2; _i19 > 0; _i19 -= 1) {
3722
+ ArrayPush$1.call(nodeStack, fChildren[_i19]);
3707
3723
  }
3708
3724
  } else {
3709
3725
  ArrayPush$1.call(flattenedChildren, currentNode);
@@ -3739,8 +3755,8 @@ var LWC = (function (exports) {
3739
3755
  var oldSlotsMapping = vm.cmpSlots.slotAssignments;
3740
3756
  var cmpSlotsMapping = create(null);
3741
3757
  // Collect all slots into cmpSlotsMapping
3742
- for (var _i19 = 0, len = children.length; _i19 < len; _i19 += 1) {
3743
- var vnode = children[_i19];
3758
+ for (var _i20 = 0, len = children.length; _i20 < len; _i20 += 1) {
3759
+ var vnode = children[_i20];
3744
3760
  if (isNull(vnode)) {
3745
3761
  continue;
3746
3762
  }
@@ -3765,8 +3781,8 @@ var LWC = (function (exports) {
3765
3781
  markComponentAsDirty(vm);
3766
3782
  return;
3767
3783
  }
3768
- for (var _i20 = 0, _len2 = oldKeys.length; _i20 < _len2; _i20 += 1) {
3769
- var key = oldKeys[_i20];
3784
+ for (var _i21 = 0, _len2 = oldKeys.length; _i21 < _len2; _i21 += 1) {
3785
+ var key = oldKeys[_i21];
3770
3786
  if (isUndefined$1(cmpSlotsMapping[key]) || oldSlotsMapping[key].length !== cmpSlotsMapping[key].length) {
3771
3787
  markComponentAsDirty(vm);
3772
3788
  return;
@@ -3889,11 +3905,11 @@ var LWC = (function (exports) {
3889
3905
  if (oldStartIdx > oldEndIdx) {
3890
3906
  // There's some cases in which the sub array of vnodes to be inserted is followed by null(s) and an
3891
3907
  // already processed vnode, in such cases the vnodes to be inserted should be before that processed vnode.
3892
- var _i21 = newEndIdx;
3908
+ var _i22 = newEndIdx;
3893
3909
  var n;
3894
3910
  do {
3895
- n = newCh[++_i21];
3896
- } while (!isVNode(n) && _i21 < newChEnd);
3911
+ n = newCh[++_i22];
3912
+ } while (!isVNode(n) && _i22 < newChEnd);
3897
3913
  before = isVNode(n) ? n.elm : null;
3898
3914
  mountVNodes(newCh, parent, renderer, before, newStartIdx, newEndIdx + 1);
3899
3915
  } else {
@@ -3918,9 +3934,9 @@ var LWC = (function (exports) {
3918
3934
  // if the old list is not empty, the new list MUST have the same
3919
3935
  // amount of nodes, that's why we call this static children
3920
3936
  var anchor = null;
3921
- for (var _i22 = c2Length - 1; _i22 >= 0; _i22 -= 1) {
3922
- var n1 = c1[_i22];
3923
- var n2 = c2[_i22];
3937
+ for (var _i23 = c2Length - 1; _i23 >= 0; _i23 -= 1) {
3938
+ var n1 = c1[_i23];
3939
+ var n2 = c2[_i23];
3924
3940
  if (n2 !== n1) {
3925
3941
  if (isVNode(n1)) {
3926
3942
  if (isVNode(n2)) {
@@ -4017,8 +4033,8 @@ var LWC = (function (exports) {
4017
4033
  if (!isUndefined$1(slotset) && !isUndefined$1(slotset.slotAssignments) && !isUndefined$1(slotset.slotAssignments[slotName]) && slotset.slotAssignments[slotName].length !== 0) {
4018
4034
  var newChildren = [];
4019
4035
  var slotAssignments = slotset.slotAssignments[slotName];
4020
- for (var _i23 = 0; _i23 < slotAssignments.length; _i23++) {
4021
- var vnode = slotAssignments[_i23];
4036
+ for (var _i24 = 0; _i24 < slotAssignments.length; _i24++) {
4037
+ var vnode = slotAssignments[_i24];
4022
4038
  if (!isNull(vnode)) {
4023
4039
  var assignedNodeIsScopedSlot = isVScopedSlotFragment(vnode);
4024
4040
  // The only sniff test for a scoped <slot> element is the presence of `slotData`
@@ -4353,9 +4369,18 @@ var LWC = (function (exports) {
4353
4369
  vmBeingRendered = vm;
4354
4370
  }
4355
4371
  function validateSlots(vm, html) {
4356
- {
4357
- // this method should never leak to prod
4358
- throw new ReferenceError();
4372
+ assertNotProd(); // this method should never leak to prod
4373
+ var cmpSlots = vm.cmpSlots;
4374
+ var _html$slots = html.slots,
4375
+ slots = _html$slots === void 0 ? EmptyArray : _html$slots;
4376
+ for (var slotName in cmpSlots.slotAssignments) {
4377
+ // eslint-disable-next-line @lwc/lwc-internal/no-production-assert
4378
+ assert.isTrue(isArray$1(cmpSlots.slotAssignments[slotName]), "Slots can only be set to an array, instead received ".concat(toString$1(cmpSlots.slotAssignments[slotName]), " for slot \"").concat(slotName, "\" in ").concat(vm, "."));
4379
+ if (slotName !== '' && ArrayIndexOf.call(slots, slotName) === -1) {
4380
+ // TODO [#1297]: this should never really happen because the compiler should always validate
4381
+ // eslint-disable-next-line @lwc/lwc-internal/no-production-assert
4382
+ logError("Ignoring unknown provided slot name \"".concat(slotName, "\" in ").concat(vm, ". Check for a typo on the slot attribute."), vm);
4383
+ }
4359
4384
  }
4360
4385
  }
4361
4386
  function validateLightDomTemplate(template, vm) {
@@ -4397,23 +4422,23 @@ var LWC = (function (exports) {
4397
4422
  var classAttrToken = hasScopedStyles && hasStyleToken ? " class=\"".concat(stylesheetToken, "\"") : '';
4398
4423
  var attrToken = hasStyleToken && isSyntheticShadow ? ' ' + stylesheetToken : '';
4399
4424
  var htmlFragment = '';
4400
- for (var _i24 = 0, n = keys.length; _i24 < n; _i24++) {
4401
- switch (keys[_i24]) {
4425
+ for (var _i25 = 0, n = keys.length; _i25 < n; _i25++) {
4426
+ switch (keys[_i25]) {
4402
4427
  case 0:
4403
4428
  // styleToken in existing class attr
4404
- htmlFragment += strings[_i24] + classToken;
4429
+ htmlFragment += strings[_i25] + classToken;
4405
4430
  break;
4406
4431
  case 1:
4407
4432
  // styleToken for added class attr
4408
- htmlFragment += strings[_i24] + classAttrToken;
4433
+ htmlFragment += strings[_i25] + classAttrToken;
4409
4434
  break;
4410
4435
  case 2:
4411
4436
  // styleToken as attr
4412
- htmlFragment += strings[_i24] + attrToken;
4437
+ htmlFragment += strings[_i25] + attrToken;
4413
4438
  break;
4414
4439
  case 3:
4415
4440
  // ${1}${2}
4416
- htmlFragment += strings[_i24] + classAttrToken + attrToken;
4441
+ htmlFragment += strings[_i25] + classAttrToken + attrToken;
4417
4442
  break;
4418
4443
  }
4419
4444
  }
@@ -4479,9 +4504,7 @@ var LWC = (function (exports) {
4479
4504
  }
4480
4505
  if ("production" !== 'production') ;
4481
4506
  // reset the refs; they will be set during the tmpl() instantiation
4482
- var hasRefVNodes = Boolean(html.hasRefs);
4483
- vm.hasRefVNodes = hasRefVNodes;
4484
- vm.refVNodes = hasRefVNodes ? create(null) : null;
4507
+ vm.refVNodes = html.hasRefs ? create(null) : null;
4485
4508
  // right before producing the vnodes, we clear up all internal references
4486
4509
  // to custom elements from the template.
4487
4510
  vm.velements = [];
@@ -4503,8 +4526,8 @@ var LWC = (function (exports) {
4503
4526
  }
4504
4527
  function computeHasScopedStylesInStylesheets(stylesheets) {
4505
4528
  if (hasStyles(stylesheets)) {
4506
- for (var _i25 = 0; _i25 < stylesheets.length; _i25++) {
4507
- if (isTrue(stylesheets[_i25][KEY__SCOPED_CSS])) {
4529
+ for (var _i26 = 0; _i26 < stylesheets.length; _i26++) {
4530
+ if (isTrue(stylesheets[_i26][KEY__SCOPED_CSS])) {
4508
4531
  return true;
4509
4532
  }
4510
4533
  }
@@ -4643,7 +4666,7 @@ var LWC = (function (exports) {
4643
4666
  var cmpEventListenerMap = new WeakMap();
4644
4667
  function getWrappedComponentsListener(vm, listener) {
4645
4668
  if (!isFunction$1(listener)) {
4646
- throw new TypeError(); // avoiding problems with non-valid listeners
4669
+ throw new TypeError('Expected an EventListener but received ' + _typeof(listener)); // avoiding problems with non-valid listeners
4647
4670
  }
4648
4671
 
4649
4672
  var wrappedListener = cmpEventListenerMap.get(listener);
@@ -4670,8 +4693,8 @@ var LWC = (function (exports) {
4670
4693
  * subject to change or being removed.
4671
4694
  */
4672
4695
  function register(service) {
4673
- for (var _i26 = 0; _i26 < hooks.length; ++_i26) {
4674
- var hookName = hooks[_i26];
4696
+ for (var _i27 = 0; _i27 < hooks.length; ++_i27) {
4697
+ var hookName = hooks[_i27];
4675
4698
  if (hookName in service) {
4676
4699
  var l = Services[hookName];
4677
4700
  if (isUndefined$1(l)) {
@@ -4685,8 +4708,8 @@ var LWC = (function (exports) {
4685
4708
  var component = vm.component,
4686
4709
  def = vm.def,
4687
4710
  context = vm.context;
4688
- for (var _i27 = 0, len = cbs.length; _i27 < len; ++_i27) {
4689
- cbs[_i27].call(undefined, component, {}, def, context);
4711
+ for (var _i28 = 0, len = cbs.length; _i28 < len; ++_i28) {
4712
+ cbs[_i28].call(undefined, component, {}, def, context);
4690
4713
  }
4691
4714
  }
4692
4715
 
@@ -4774,7 +4797,6 @@ var LWC = (function (exports) {
4774
4797
  mode: mode,
4775
4798
  owner: owner,
4776
4799
  refVNodes: null,
4777
- hasRefVNodes: false,
4778
4800
  children: EmptyArray,
4779
4801
  aChildren: EmptyArray,
4780
4802
  velements: EmptyArray,
@@ -4824,8 +4846,8 @@ var LWC = (function (exports) {
4824
4846
  var valid = true;
4825
4847
  var validate = function validate(arrayOrStylesheet) {
4826
4848
  if (isArray$1(arrayOrStylesheet)) {
4827
- for (var _i28 = 0; _i28 < arrayOrStylesheet.length; _i28++) {
4828
- validate(arrayOrStylesheet[_i28]);
4849
+ for (var _i29 = 0; _i29 < arrayOrStylesheet.length; _i29++) {
4850
+ validate(arrayOrStylesheet[_i29]);
4829
4851
  }
4830
4852
  } else if (!isFunction$1(arrayOrStylesheet)) {
4831
4853
  // function assumed to be a stylesheet factory
@@ -4960,17 +4982,17 @@ var LWC = (function (exports) {
4960
4982
  return a.idx - b.idx;
4961
4983
  });
4962
4984
  rehydrateQueue = []; // reset to a new queue
4963
- for (var _i29 = 0, len = vms.length; _i29 < len; _i29 += 1) {
4964
- var vm = vms[_i29];
4985
+ for (var _i30 = 0, len = vms.length; _i30 < len; _i30 += 1) {
4986
+ var vm = vms[_i30];
4965
4987
  try {
4966
4988
  rehydrate(vm);
4967
4989
  } catch (error) {
4968
- if (_i29 + 1 < len) {
4990
+ if (_i30 + 1 < len) {
4969
4991
  // pieces of the queue are still pending to be rehydrated, those should have priority
4970
4992
  if (rehydrateQueue.length === 0) {
4971
4993
  addCallbackToNextTick(flushRehydrationQueue);
4972
4994
  }
4973
- ArrayUnshift.apply(rehydrateQueue, ArraySlice.call(vms, _i29 + 1));
4995
+ ArrayUnshift.apply(rehydrateQueue, ArraySlice.call(vms, _i30 + 1));
4974
4996
  }
4975
4997
  // we need to end the measure before throwing.
4976
4998
  logGlobalOperationEnd(8 /* OperationId.GlobalRehydrate */);
@@ -5036,8 +5058,8 @@ var LWC = (function (exports) {
5036
5058
  var vCustomElementCollection = vm.velements;
5037
5059
  // Reporting disconnection for every child in inverse order since they are
5038
5060
  // inserted in reserved order.
5039
- for (var _i30 = vCustomElementCollection.length - 1; _i30 >= 0; _i30 -= 1) {
5040
- var elm = vCustomElementCollection[_i30].elm;
5061
+ for (var _i31 = vCustomElementCollection.length - 1; _i31 >= 0; _i31 -= 1) {
5062
+ var elm = vCustomElementCollection[_i31].elm;
5041
5063
  // There are two cases where the element could be undefined:
5042
5064
  // * when there is an error during the construction phase, and an error
5043
5065
  // boundary picks it, there is a possibility that the VCustomElement
@@ -5068,8 +5090,8 @@ var LWC = (function (exports) {
5068
5090
  * defined on its shadow.
5069
5091
  */
5070
5092
  function recursivelyDisconnectChildren(vnodes) {
5071
- for (var _i31 = 0, len = vnodes.length; _i31 < len; _i31 += 1) {
5072
- var vnode = vnodes[_i31];
5093
+ for (var _i32 = 0, len = vnodes.length; _i32 < len; _i32 += 1) {
5094
+ var vnode = vnodes[_i32];
5073
5095
  if (!isNull(vnode) && !isUndefined$1(vnode.elm)) {
5074
5096
  switch (vnode.type) {
5075
5097
  case 2 /* VNodeType.Element */:
@@ -5093,8 +5115,8 @@ var LWC = (function (exports) {
5093
5115
  var children = vm.children,
5094
5116
  renderRoot = vm.renderRoot,
5095
5117
  remove = vm.renderer.remove;
5096
- for (var _i32 = 0, len = children.length; _i32 < len; _i32++) {
5097
- var child = children[_i32];
5118
+ for (var _i33 = 0, len = children.length; _i33 < len; _i33++) {
5119
+ var child = children[_i33];
5098
5120
  if (!isNull(child) && !isUndefined$1(child.elm)) {
5099
5121
  remove(child.elm, renderRoot);
5100
5122
  }
@@ -5194,17 +5216,17 @@ var LWC = (function (exports) {
5194
5216
  // if our id is null or empty, nobody can reference us
5195
5217
  return;
5196
5218
  }
5197
- var _iterator5 = _createForOfIteratorHelper(ID_REFERENCING_ATTRIBUTES_SET),
5198
- _step5;
5219
+ var _iterator4 = _createForOfIteratorHelper(ID_REFERENCING_ATTRIBUTES_SET),
5220
+ _step4;
5199
5221
  try {
5200
- for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
5201
- var idRefAttrName = _step5.value;
5222
+ for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
5223
+ var idRefAttrName = _step4.value;
5202
5224
  // Query all global elements with this attribute. The attribute selector syntax `~=` is for values
5203
5225
  // that reference multiple IDs, separated by whitespace.
5204
5226
  var query = "[".concat(idRefAttrName, "~=\"").concat(CSS.escape(attrValue), "\"]");
5205
5227
  var sourceElements = querySelectorAll.call(document, query);
5206
- for (var _i33 = 0; _i33 < sourceElements.length; _i33++) {
5207
- var sourceElement = sourceElements[_i33];
5228
+ for (var _i34 = 0; _i34 < sourceElements.length; _i34++) {
5229
+ var sourceElement = sourceElements[_i34];
5208
5230
  var sourceRoot = sourceElement.getRootNode();
5209
5231
  if (sourceRoot !== root) {
5210
5232
  reportViolation(sourceElement, elm, idRefAttrName);
@@ -5213,18 +5235,18 @@ var LWC = (function (exports) {
5213
5235
  }
5214
5236
  }
5215
5237
  } catch (err) {
5216
- _iterator5.e(err);
5238
+ _iterator4.e(err);
5217
5239
  } finally {
5218
- _iterator5.f();
5240
+ _iterator4.f();
5219
5241
  }
5220
5242
  } else {
5221
5243
  // elm is the source, find the target
5222
5244
  var ids = parseIdRefAttributeValue(attrValue);
5223
- var _iterator6 = _createForOfIteratorHelper(ids),
5224
- _step6;
5245
+ var _iterator5 = _createForOfIteratorHelper(ids),
5246
+ _step5;
5225
5247
  try {
5226
- for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
5227
- var id = _step6.value;
5248
+ for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
5249
+ var id = _step5.value;
5228
5250
  var target = getElementById.call(document, id);
5229
5251
  if (!isNull(target)) {
5230
5252
  var targetRoot = target.getRootNode();
@@ -5235,9 +5257,9 @@ var LWC = (function (exports) {
5235
5257
  }
5236
5258
  }
5237
5259
  } catch (err) {
5238
- _iterator6.e(err);
5260
+ _iterator5.e(err);
5239
5261
  } finally {
5240
- _iterator6.f();
5262
+ _iterator5.f();
5241
5263
  }
5242
5264
  }
5243
5265
  }
@@ -5508,8 +5530,8 @@ var LWC = (function (exports) {
5508
5530
  var nextNode = node;
5509
5531
  var anchor = null;
5510
5532
  var renderer = owner.renderer;
5511
- for (var _i34 = 0; _i34 < children.length; _i34++) {
5512
- var childVnode = children[_i34];
5533
+ for (var _i35 = 0; _i35 < children.length; _i35++) {
5534
+ var childVnode = children[_i35];
5513
5535
  if (!isNull(childVnode)) {
5514
5536
  if (nextNode) {
5515
5537
  nextNode = hydrateNode(nextNode, childVnode, renderer);
@@ -5570,8 +5592,8 @@ var LWC = (function (exports) {
5570
5592
  var nodesAreCompatible = true;
5571
5593
  // Validate attributes, though we could always recovery from those by running the update mods.
5572
5594
  // Note: intentionally ONLY matching vnodes.attrs to elm.attrs, in case SSR is adding extra attributes.
5573
- for (var _i35 = 0, _Object$entries = Object.entries(attrs); _i35 < _Object$entries.length; _i35++) {
5574
- var _Object$entries$_i = _slicedToArray(_Object$entries[_i35], 2),
5595
+ for (var _i36 = 0, _Object$entries = Object.entries(attrs); _i36 < _Object$entries.length; _i36++) {
5596
+ var _Object$entries$_i = _slicedToArray(_Object$entries[_i36], 2),
5575
5597
  attrName = _Object$entries$_i[0],
5576
5598
  attrValue = _Object$entries$_i[1];
5577
5599
  vnode.owner;
@@ -5658,8 +5680,8 @@ var LWC = (function (exports) {
5658
5680
  var parsedVnodeStyle = parseStyleText(elmStyle);
5659
5681
  var expectedStyle = [];
5660
5682
  // styleMap is used when style is set to static value.
5661
- for (var _i36 = 0, n = styleDecls.length; _i36 < n; _i36++) {
5662
- var _styleDecls$_i2 = _slicedToArray(styleDecls[_i36], 3),
5683
+ for (var _i37 = 0, n = styleDecls.length; _i37 < n; _i37++) {
5684
+ var _styleDecls$_i2 = _slicedToArray(styleDecls[_i37], 3),
5663
5685
  prop = _styleDecls$_i2[0],
5664
5686
  value = _styleDecls$_i2[1],
5665
5687
  important = _styleDecls$_i2[2];
@@ -5733,8 +5755,8 @@ var LWC = (function (exports) {
5733
5755
  // Deep-traverse an array (of arrays) of stylesheet factory functions, and call the callback for every array/function
5734
5756
  function traverseStylesheets(stylesheets, callback) {
5735
5757
  callback(stylesheets);
5736
- for (var _i37 = 0; _i37 < stylesheets.length; _i37++) {
5737
- var stylesheet = stylesheets[_i37];
5758
+ for (var _i38 = 0; _i38 < stylesheets.length; _i38++) {
5759
+ var stylesheet = stylesheets[_i38];
5738
5760
  if (isArray$1(stylesheet)) {
5739
5761
  traverseStylesheets(stylesheet, callback);
5740
5762
  } else {
@@ -5988,7 +6010,7 @@ var LWC = (function (exports) {
5988
6010
  var cachedConstructors = new Map();
5989
6011
  var elementsUpgradedOutsideLWC = new WeakSet();
5990
6012
  var elementBeingUpgradedByLWC = false;
5991
- // Creates a constructor that is intended to be used as a vanilla custom element, except that the upgradeCallback is
6013
+ // Creates a constructor that is intended to be used directly as a custom element, except that the upgradeCallback is
5992
6014
  // passed in to the constructor so LWC can reuse the same custom element constructor for multiple components.
5993
6015
  // Another benefit is that only LWC can create components that actually do anything – if you do
5994
6016
  // `customElements.define('x-foo')`, then you don't have access to the upgradeCallback, so it's a dummy custom element.
@@ -6037,7 +6059,7 @@ var LWC = (function (exports) {
6037
6059
  }
6038
6060
  return UpgradableConstructor;
6039
6061
  };
6040
- var createCustomElementVanilla = function createCustomElementVanilla(tagName, upgradeCallback, connectedCallback, disconnectedCallback) {
6062
+ var createCustomElementUsingUpgradableConstructor = function createCustomElementUsingUpgradableConstructor(tagName, upgradeCallback, connectedCallback, disconnectedCallback) {
6041
6063
  // use global custom elements registry
6042
6064
  var UpgradableConstructor = cachedConstructors.get(tagName);
6043
6065
  if (isUndefined$1(UpgradableConstructor)) {
@@ -6064,7 +6086,7 @@ var LWC = (function (exports) {
6064
6086
  */
6065
6087
  /**
6066
6088
  * Create a scoped registry, i.e. a function that can create custom elements whose tag names
6067
- * do not conflict with vanilla custom elements having the same tag name.
6089
+ * do not conflict with third-party custom elements having the same tag name.
6068
6090
  */
6069
6091
  function createScopedRegistry() {
6070
6092
  if (!hasCustomElements) {
@@ -6395,17 +6417,17 @@ var LWC = (function (exports) {
6395
6417
  function flushPendingWhenDefinedCallbacks(tagName, ctor) {
6396
6418
  var resolvers = pendingWhenDefinedCallbacks.get(tagName);
6397
6419
  if (!isUndefined$1(resolvers)) {
6398
- var _iterator10 = _createForOfIteratorHelper(resolvers),
6399
- _step10;
6420
+ var _iterator9 = _createForOfIteratorHelper(resolvers),
6421
+ _step9;
6400
6422
  try {
6401
- for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
6402
- var resolver = _step10.value;
6423
+ for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
6424
+ var resolver = _step9.value;
6403
6425
  resolver(ctor);
6404
6426
  }
6405
6427
  } catch (err) {
6406
- _iterator10.e(err);
6428
+ _iterator9.e(err);
6407
6429
  } finally {
6408
- _iterator10.f();
6430
+ _iterator9.f();
6409
6431
  }
6410
6432
  }
6411
6433
  pendingWhenDefinedCallbacks.delete(tagName);
@@ -6455,11 +6477,11 @@ var LWC = (function (exports) {
6455
6477
  var awaiting = awaitingUpgrade.get(tagName);
6456
6478
  if (!isUndefined$1(awaiting)) {
6457
6479
  awaitingUpgrade.delete(tagName);
6458
- var _iterator11 = _createForOfIteratorHelper(awaiting),
6459
- _step11;
6480
+ var _iterator10 = _createForOfIteratorHelper(awaiting),
6481
+ _step10;
6460
6482
  try {
6461
- for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
6462
- var element = _step11.value;
6483
+ for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
6484
+ var element = _step10.value;
6463
6485
  var registeredDefinition = pendingRegistryForElement.get(element);
6464
6486
  // At this point, registeredDefinition should never be undefined because awaitingUpgrade
6465
6487
  // is only populated when we haven't run internalUpgrade yet, and we only populate
@@ -6471,9 +6493,9 @@ var LWC = (function (exports) {
6471
6493
  }
6472
6494
  }
6473
6495
  } catch (err) {
6474
- _iterator11.e(err);
6496
+ _iterator10.e(err);
6475
6497
  } finally {
6476
- _iterator11.f();
6498
+ _iterator10.f();
6477
6499
  }
6478
6500
  }
6479
6501
  // If anyone called customElements.whenDefined() and is still waiting for a promise resolution, resolve now
@@ -6670,10 +6692,10 @@ var LWC = (function (exports) {
6670
6692
  * We have three modes for creating custom elements:
6671
6693
  *
6672
6694
  * 1. Compat (legacy) browser support (e.g. IE11). Totally custom, doesn't rely on native browser APIs.
6673
- * 2. "Vanilla" custom elements registry. This system actually still allows us to have two LWC components with the
6674
- * same tag name, via a simple trick: every custom element constructor we define in the registry is basically
6675
- * the same. It's essentially a dummy `class extends HTMLElement` that accepts an `upgradeCallback` in its
6676
- * constructor, which allows us to have completely customized functionality for different components.
6695
+ * 2. "Upgradable constructor" custom element. This allows us to have two LWC components with the same tag name,
6696
+ * via a trick: every custom element constructor we define in the registry is basically the same. It's essentially
6697
+ * a dummy `class extends HTMLElement` that accepts an `upgradeCallback` in its constructor ("upgradable
6698
+ * constructor"), which allows us to have completely customized functionality for different components.
6677
6699
  * 3. "Scoped" (or "pivot") custom elements. This relies on a sophisticated system that emulates the "scoped custom
6678
6700
  * elements registry" proposal, with support for avoiding conflicts in tag names both between LWC components and
6679
6701
  * between LWC components and third-party elements. This uses a similar trick to #2, but is much more complex
@@ -6684,8 +6706,8 @@ var LWC = (function (exports) {
6684
6706
  if (lwcRuntimeFlags.ENABLE_SCOPED_CUSTOM_ELEMENT_REGISTRY) {
6685
6707
  createCustomElement = createCustomElementScoped;
6686
6708
  } else {
6687
- // use global custom elements registry (vanilla)
6688
- createCustomElement = createCustomElementVanilla;
6709
+ // use the global registry, with an upgradable constructor for the defined custom element
6710
+ createCustomElement = createCustomElementUsingUpgradableConstructor;
6689
6711
  }
6690
6712
  } else {
6691
6713
  // no registry available here
@@ -6739,10 +6761,10 @@ var LWC = (function (exports) {
6739
6761
  }
6740
6762
  var assert = /*#__PURE__*/Object.freeze({
6741
6763
  __proto__: null,
6764
+ fail: fail,
6742
6765
  invariant: invariant,
6743
- isTrue: isTrue$1,
6744
6766
  isFalse: isFalse$1,
6745
- fail: fail
6767
+ isTrue: isTrue$1
6746
6768
  });
6747
6769
  function isUndefined(obj) {
6748
6770
  return obj === undefined;
@@ -6750,7 +6772,7 @@ var LWC = (function (exports) {
6750
6772
  function isNull(obj) {
6751
6773
  return obj === null;
6752
6774
  }
6753
- /** version: 2.35.0 */
6775
+ /** version: 2.35.2 */
6754
6776
 
6755
6777
  /*
6756
6778
  * Copyright (c) 2018, salesforce.com, inc.
@@ -6809,17 +6831,17 @@ var LWC = (function (exports) {
6809
6831
  exports.createFragment = function (html) {
6810
6832
  var wrapperTags = topLevelWrappingMap[getTagName(html)];
6811
6833
  if (!isUndefined(wrapperTags)) {
6812
- var _iterator12 = _createForOfIteratorHelper(wrapperTags),
6813
- _step12;
6834
+ var _iterator11 = _createForOfIteratorHelper(wrapperTags),
6835
+ _step11;
6814
6836
  try {
6815
- for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {
6816
- var wrapperTag = _step12.value;
6837
+ for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
6838
+ var wrapperTag = _step11.value;
6817
6839
  html = "<".concat(wrapperTag, ">").concat(html, "</").concat(wrapperTag, ">");
6818
6840
  }
6819
6841
  } catch (err) {
6820
- _iterator12.e(err);
6842
+ _iterator11.e(err);
6821
6843
  } finally {
6822
- _iterator12.f();
6844
+ _iterator11.f();
6823
6845
  }
6824
6846
  }
6825
6847
  // For IE11, the document title must not be undefined, but it can be an empty string
@@ -6828,7 +6850,7 @@ var LWC = (function (exports) {
6828
6850
  doc.body.innerHTML = html;
6829
6851
  var content = doc.body;
6830
6852
  if (!isUndefined(wrapperTags)) {
6831
- for (var _i38 = 0; _i38 < wrapperTags.length; _i38++) {
6853
+ for (var _i39 = 0; _i39 < wrapperTags.length; _i39++) {
6832
6854
  content = content.firstChild;
6833
6855
  }
6834
6856
  }
@@ -7021,8 +7043,8 @@ var LWC = (function (exports) {
7021
7043
  tagName: element.tagName.toLowerCase(),
7022
7044
  hydrated: true
7023
7045
  });
7024
- for (var _i39 = 0, _Object$entries2 = Object.entries(props); _i39 < _Object$entries2.length; _i39++) {
7025
- var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i39], 2),
7046
+ for (var _i40 = 0, _Object$entries2 = Object.entries(props); _i40 < _Object$entries2.length; _i40++) {
7047
+ var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i40], 2),
7026
7048
  key = _Object$entries2$_i[0],
7027
7049
  value = _Object$entries2$_i[1];
7028
7050
  element[key] = value;
@@ -7309,7 +7331,7 @@ var LWC = (function (exports) {
7309
7331
  });
7310
7332
  freeze(LightningElement);
7311
7333
  seal(LightningElement.prototype);
7312
- /* version: 2.35.0 */
7334
+ /* version: 2.35.2 */
7313
7335
 
7314
7336
  exports.LightningElement = LightningElement;
7315
7337
  exports.__unstable__ProfilerControl = profilerControl;