lwc 2.11.0 → 2.11.4

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 (35) hide show
  1. package/dist/engine-dom/esm/es2017/engine-dom.js +339 -263
  2. package/dist/engine-dom/iife/es2017/engine-dom.js +339 -263
  3. package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
  4. package/dist/engine-dom/iife/es2017/engine-dom_debug.js +294 -126
  5. package/dist/engine-dom/iife/es5/engine-dom.js +1137 -1047
  6. package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
  7. package/dist/engine-dom/iife/es5/engine-dom_debug.js +425 -182
  8. package/dist/engine-dom/umd/es2017/engine-dom.js +339 -263
  9. package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
  10. package/dist/engine-dom/umd/es2017/engine-dom_debug.js +294 -126
  11. package/dist/engine-dom/umd/es5/engine-dom.js +1137 -1047
  12. package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
  13. package/dist/engine-dom/umd/es5/engine-dom_debug.js +425 -182
  14. package/dist/engine-server/commonjs/es2017/engine-server.js +44 -11
  15. package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
  16. package/dist/engine-server/esm/es2017/engine-server.js +44 -11
  17. package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +3 -3
  18. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +3 -3
  19. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +3 -3
  20. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +3 -3
  21. package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +3 -3
  22. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +3 -3
  23. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +3 -3
  24. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +3 -3
  25. package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +3 -3
  26. package/dist/wire-service/esm/es2017/wire-service.js +2 -2
  27. package/dist/wire-service/iife/es2017/wire-service.js +2 -2
  28. package/dist/wire-service/iife/es2017/wire-service_debug.js +2 -2
  29. package/dist/wire-service/iife/es5/wire-service.js +2 -2
  30. package/dist/wire-service/iife/es5/wire-service_debug.js +2 -2
  31. package/dist/wire-service/umd/es2017/wire-service.js +2 -2
  32. package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
  33. package/dist/wire-service/umd/es5/wire-service.js +2 -2
  34. package/dist/wire-service/umd/es5/wire-service_debug.js +2 -2
  35. package/package.json +8 -9
@@ -52,6 +52,8 @@
52
52
 
53
53
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
54
54
 
55
+ 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; } } }; }
56
+
55
57
  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); }
56
58
 
57
59
  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; }
@@ -348,7 +350,7 @@
348
350
  var XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace';
349
351
  var SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
350
352
  var XLINK_NAMESPACE = 'http://www.w3.org/1999/xlink';
351
- /** version: 2.11.0 */
353
+ /** version: 2.11.4 */
352
354
 
353
355
  /*
354
356
  * Copyright (c) 2018, salesforce.com, inc.
@@ -518,7 +520,7 @@
518
520
 
519
521
  function setFeatureFlagForTest(name, value) {
520
522
  }
521
- /** version: 2.11.0 */
523
+ /** version: 2.11.4 */
522
524
 
523
525
  /* proxy-compat-disable */
524
526
 
@@ -561,6 +563,42 @@
561
563
 
562
564
  return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();
563
565
  } // Borrowed from Vue template compiler.
566
+ // https://github.com/vuejs/vue/blob/531371b818b0e31a989a06df43789728f23dc4e8/src/platforms/web/util/style.js#L5-L16
567
+
568
+
569
+ var DECLARATION_DELIMITER = /;(?![^(]*\))/g;
570
+ var PROPERTY_DELIMITER = /:(.+)/;
571
+
572
+ function parseStyleText(cssText) {
573
+ var styleMap = {};
574
+ var declarations = cssText.split(DECLARATION_DELIMITER);
575
+
576
+ var _iterator = _createForOfIteratorHelper(declarations),
577
+ _step;
578
+
579
+ try {
580
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
581
+ var declaration = _step.value;
582
+
583
+ if (declaration) {
584
+ var _declaration$split = declaration.split(PROPERTY_DELIMITER),
585
+ _declaration$split2 = _slicedToArray(_declaration$split, 2),
586
+ prop = _declaration$split2[0],
587
+ value = _declaration$split2[1];
588
+
589
+ if (prop !== undefined && value !== undefined) {
590
+ styleMap[prop.trim()] = value.trim();
591
+ }
592
+ }
593
+ }
594
+ } catch (err) {
595
+ _iterator.e(err);
596
+ } finally {
597
+ _iterator.f();
598
+ }
599
+
600
+ return styleMap;
601
+ } // Make a shallow copy of an object but omit the given key
564
602
 
565
603
 
566
604
  function cloneAndOmitKey(object, keyToOmit) {
@@ -1033,8 +1071,8 @@
1033
1071
  }
1034
1072
  }
1035
1073
 
1036
- function logWarn(message, vm) {
1037
- log('warn', message, vm);
1074
+ function logError(message, vm) {
1075
+ log('error', message, vm);
1038
1076
  }
1039
1077
  /*
1040
1078
  * Copyright (c) 2018, salesforce.com, inc.
@@ -2594,6 +2632,13 @@
2594
2632
  var meta = signedDecoratorToMetaMap.get(Ctor);
2595
2633
  return isUndefined$1(meta) ? defaultMeta : meta;
2596
2634
  }
2635
+ /*
2636
+ * Copyright (c) 2018, salesforce.com, inc.
2637
+ * All rights reserved.
2638
+ * SPDX-License-Identifier: MIT
2639
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
2640
+ */
2641
+
2597
2642
 
2598
2643
  var signedTemplateSet = new Set();
2599
2644
 
@@ -2614,7 +2659,33 @@
2614
2659
 
2615
2660
  function registerTemplate(tpl) {
2616
2661
 
2617
- signedTemplateSet.add(tpl); // chaining this method as a way to wrap existing
2662
+ signedTemplateSet.add(tpl); // FIXME[@W-10950976]: the template object should be frozen, and it should not be possible to set
2663
+ // the stylesheets or stylesheetToken(s). For backwards compat, though, we shim stylesheetTokens
2664
+ // on top of stylesheetToken for anyone who is accessing the old internal API.
2665
+ // Details: https://salesforce.quip.com/v1rmAFu2cKAr
2666
+
2667
+ defineProperty(tpl, 'stylesheetTokens', {
2668
+ get: function get() {
2669
+ var stylesheetToken = this.stylesheetToken;
2670
+
2671
+ if (isUndefined$1(stylesheetToken)) {
2672
+ return stylesheetToken;
2673
+ } // Shim for the old `stylesheetTokens` property
2674
+ // See https://github.com/salesforce/lwc/pull/2332/files#diff-7901555acef29969adaa6583185b3e9bce475cdc6f23e799a54e0018cb18abaa
2675
+
2676
+
2677
+ return {
2678
+ hostAttribute: "".concat(stylesheetToken, "-host"),
2679
+ shadowAttribute: stylesheetToken
2680
+ };
2681
+ },
2682
+ set: function set(value) {
2683
+ // If the value is null or some other exotic object, you would be broken anyway in the past
2684
+ // because the engine would try to access hostAttribute/shadowAttribute, which would throw an error.
2685
+ // However it may be undefined in newer versions of LWC, so we need to guard against that case.
2686
+ this.stylesheetToken = isUndefined$1(value) ? undefined : value.shadowAttribute;
2687
+ }
2688
+ }); // chaining this method as a way to wrap existing
2618
2689
  // assignment of templates easily, without too much transformation
2619
2690
 
2620
2691
  return tpl;
@@ -4952,12 +5023,17 @@
4952
5023
  * will prevent this function from being imported by userland code.
4953
5024
  */
4954
5025
 
4955
- function registerComponent(Ctor, _ref2) {
5026
+ function registerComponent( // We typically expect a LightningElementConstructor, but technically you can call this with anything
5027
+ Ctor, _ref2) {
4956
5028
  var tmpl = _ref2.tmpl;
4957
5029
 
4958
- signedTemplateMap.set(Ctor, tmpl); // chaining this method as a way to wrap existing assignment of component constructor easily,
5030
+ if (isFunction$1(Ctor)) {
5031
+
5032
+ signedTemplateMap.set(Ctor, tmpl);
5033
+ } // chaining this method as a way to wrap existing assignment of component constructor easily,
4959
5034
  // without too much transformation
4960
5035
 
5036
+
4961
5037
  return Ctor;
4962
5038
  }
4963
5039
 
@@ -5052,140 +5128,6 @@
5052
5128
  cbs[_i22].call(undefined, component, {}, def, context);
5053
5129
  }
5054
5130
  }
5055
- /*
5056
- * Copyright (c) 2022, salesforce.com, inc.
5057
- * All rights reserved.
5058
- * SPDX-License-Identifier: MIT
5059
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
5060
- */
5061
-
5062
-
5063
- function hydrate(vnode, node) {
5064
- switch (vnode.type) {
5065
- case 0
5066
- /* Text */
5067
- :
5068
- hydrateText(vnode, node);
5069
- break;
5070
-
5071
- case 1
5072
- /* Comment */
5073
- :
5074
- hydrateComment(vnode, node);
5075
- break;
5076
-
5077
- case 2
5078
- /* Element */
5079
- :
5080
- hydrateElement(vnode, node);
5081
- break;
5082
-
5083
- case 3
5084
- /* CustomElement */
5085
- :
5086
- hydrateCustomElement(vnode, node);
5087
- break;
5088
- }
5089
- }
5090
-
5091
- function hydrateText(vnode, node) {
5092
- var _a;
5093
-
5094
-
5095
- setText$1(node, (_a = vnode.text) !== null && _a !== void 0 ? _a : null);
5096
- vnode.elm = node;
5097
- }
5098
-
5099
- function hydrateComment(vnode, node) {
5100
- var _a;
5101
-
5102
-
5103
- setProperty$1(node, 'nodeValue', (_a = vnode.text) !== null && _a !== void 0 ? _a : null);
5104
- vnode.elm = node;
5105
- }
5106
-
5107
- function hydrateElement(vnode, node) {
5108
-
5109
- var elm = node;
5110
- vnode.elm = elm;
5111
- var context = vnode.data.context;
5112
- var isDomManual = Boolean(!isUndefined$1(context) && !isUndefined$1(context.lwc) && context.lwc.dom === "manual"
5113
- /* Manual */
5114
- );
5115
-
5116
- if (isDomManual) {
5117
- // it may be that this element has lwc:inner-html, we need to diff and in case are the same,
5118
- // remove the innerHTML from props so it reuses the existing dom elements.
5119
- var props = vnode.data.props;
5120
-
5121
- if (!isUndefined$1(props) && !isUndefined$1(props.innerHTML)) {
5122
- if (getProperty$1(elm, 'innerHTML') === props.innerHTML) {
5123
- // Do a shallow clone since VNodeData may be shared across VNodes due to hoist optimization
5124
- vnode.data = Object.assign(Object.assign({}, vnode.data), {
5125
- props: cloneAndOmitKey(props, 'innerHTML')
5126
- });
5127
- } else {
5128
- logWarn("Mismatch hydrating element <".concat(getProperty$1(elm, 'tagName').toLowerCase(), ">: innerHTML values do not match for element, will recover from the difference"), vnode.owner);
5129
- }
5130
- }
5131
- }
5132
-
5133
- patchElementPropsAndAttrs(vnode);
5134
-
5135
- if (!isDomManual) {
5136
- hydrateChildren(getChildNodes$1(vnode.elm), vnode.children, vnode.owner);
5137
- }
5138
- }
5139
-
5140
- function hydrateCustomElement(vnode, node) {
5141
-
5142
- var elm = node;
5143
- var sel = vnode.sel,
5144
- mode = vnode.mode,
5145
- ctor = vnode.ctor,
5146
- owner = vnode.owner;
5147
- var vm = createVM(elm, ctor, {
5148
- mode: mode,
5149
- owner: owner,
5150
- tagName: sel
5151
- });
5152
- vnode.elm = elm;
5153
- vnode.vm = vm;
5154
- allocateChildren(vnode, vm);
5155
- patchElementPropsAndAttrs(vnode); // Insert hook section:
5156
-
5157
- runConnectedCallback(vm);
5158
-
5159
- if (vm.renderMode !== 0
5160
- /* Light */
5161
- ) {
5162
- // VM is not rendering in Light DOM, we can proceed and hydrate the slotted content.
5163
- // Note: for Light DOM, this is handled while hydrating the VM
5164
- hydrateChildren(getChildNodes$1(vnode.elm), vnode.children);
5165
- }
5166
-
5167
- hydrateVM(vm);
5168
- }
5169
-
5170
- function hydrateChildren(elmChildren, children, vm) {
5171
-
5172
- var childNodeIndex = 0;
5173
-
5174
- for (var _i23 = 0; _i23 < children.length; _i23++) {
5175
- var childVnode = children[_i23];
5176
-
5177
- if (!isNull(childVnode)) {
5178
- var childNode = elmChildren[childNodeIndex];
5179
- hydrate(childVnode, childNode);
5180
- childNodeIndex++;
5181
- }
5182
- }
5183
- }
5184
-
5185
- function patchElementPropsAndAttrs(vnode) {
5186
- applyEventListeners(vnode);
5187
- patchProps(null, vnode);
5188
- }
5189
5131
  /*
5190
5132
  * Copyright (c) 2018, salesforce.com, inc.
5191
5133
  * All rights reserved.
@@ -5236,12 +5178,6 @@
5236
5178
  , vm);
5237
5179
  }
5238
5180
 
5239
- function hydrateRootElement(elm) {
5240
- var vm = getAssociatedVM(elm);
5241
- runConnectedCallback(vm);
5242
- hydrateVM(vm);
5243
- }
5244
-
5245
5181
  function disconnectRootElement(elm) {
5246
5182
  var vm = getAssociatedVM(elm);
5247
5183
  resetComponentStateWhenRemoved(vm);
@@ -5249,22 +5185,6 @@
5249
5185
 
5250
5186
  function appendVM(vm) {
5251
5187
  rehydrate(vm);
5252
- }
5253
-
5254
- function hydrateVM(vm) {
5255
- if (isTrue(vm.isDirty)) {
5256
- // manually diffing/patching here.
5257
- // This routine is:
5258
- // patchShadowRoot(vm, children);
5259
- // -> addVnodes.
5260
- var children = renderComponent(vm);
5261
- vm.children = children;
5262
- var vmChildren = vm.renderMode === 0
5263
- /* Light */
5264
- ? getChildNodes$1(vm.elm) : getChildNodes$1(vm.elm.shadowRoot);
5265
- hydrateChildren(vmChildren, children);
5266
- runRenderedCallback(vm);
5267
- }
5268
5188
  } // just in case the component comes back, with this we guarantee re-rendering it
5269
5189
  // while preventing any attempt to rehydration until after reinsertion.
5270
5190
 
@@ -5530,19 +5450,19 @@
5530
5450
  });
5531
5451
  rehydrateQueue = []; // reset to a new queue
5532
5452
 
5533
- for (var _i26 = 0, _len8 = vms.length; _i26 < _len8; _i26 += 1) {
5534
- var vm = vms[_i26];
5453
+ for (var _i23 = 0, _len8 = vms.length; _i23 < _len8; _i23 += 1) {
5454
+ var vm = vms[_i23];
5535
5455
 
5536
5456
  try {
5537
5457
  rehydrate(vm);
5538
5458
  } catch (error) {
5539
- if (_i26 + 1 < _len8) {
5459
+ if (_i23 + 1 < _len8) {
5540
5460
  // pieces of the queue are still pending to be rehydrated, those should have priority
5541
5461
  if (rehydrateQueue.length === 0) {
5542
5462
  addCallbackToNextTick(flushRehydrationQueue);
5543
5463
  }
5544
5464
 
5545
- ArrayUnshift.apply(rehydrateQueue, ArraySlice.call(vms, _i26 + 1));
5465
+ ArrayUnshift.apply(rehydrateQueue, ArraySlice.call(vms, _i23 + 1));
5546
5466
  } // we need to end the measure before throwing.
5547
5467
 
5548
5468
 
@@ -5641,8 +5561,8 @@
5641
5561
  var vCustomElementCollection = vm.velements; // Reporting disconnection for every child in inverse order since they are
5642
5562
  // inserted in reserved order.
5643
5563
 
5644
- for (var _i27 = vCustomElementCollection.length - 1; _i27 >= 0; _i27 -= 1) {
5645
- var elm = vCustomElementCollection[_i27].elm; // There are two cases where the element could be undefined:
5564
+ for (var _i24 = vCustomElementCollection.length - 1; _i24 >= 0; _i24 -= 1) {
5565
+ var elm = vCustomElementCollection[_i24].elm; // There are two cases where the element could be undefined:
5646
5566
  // * when there is an error during the construction phase, and an error
5647
5567
  // boundary picks it, there is a possibility that the VCustomElement
5648
5568
  // is not properly initialized, and therefore is should be ignored.
@@ -5676,8 +5596,8 @@
5676
5596
 
5677
5597
 
5678
5598
  function recursivelyDisconnectChildren(vnodes) {
5679
- for (var _i28 = 0, _len9 = vnodes.length; _i28 < _len9; _i28 += 1) {
5680
- var vnode = vnodes[_i28];
5599
+ for (var _i25 = 0, _len9 = vnodes.length; _i25 < _len9; _i25 += 1) {
5600
+ var vnode = vnodes[_i25];
5681
5601
 
5682
5602
  if (!isNull(vnode) && !isUndefined$1(vnode.elm)) {
5683
5603
  switch (vnode.type) {
@@ -5708,8 +5628,8 @@
5708
5628
  var children = vm.children,
5709
5629
  renderRoot = vm.renderRoot;
5710
5630
 
5711
- for (var _i29 = 0, _len10 = children.length; _i29 < _len10; _i29++) {
5712
- var child = children[_i29];
5631
+ for (var _i26 = 0, _len10 = children.length; _i26 < _len10; _i26++) {
5632
+ var child = children[_i26];
5713
5633
 
5714
5634
  if (!isNull(child) && !isUndefined$1(child.elm)) {
5715
5635
  remove$1(child.elm, renderRoot);
@@ -6059,8 +5979,8 @@
6059
5979
  function connectWireAdapters(vm) {
6060
5980
  var wiredConnecting = vm.context.wiredConnecting;
6061
5981
 
6062
- for (var _i30 = 0, _len11 = wiredConnecting.length; _i30 < _len11; _i30 += 1) {
6063
- wiredConnecting[_i30]();
5982
+ for (var _i27 = 0, _len11 = wiredConnecting.length; _i27 < _len11; _i27 += 1) {
5983
+ wiredConnecting[_i27]();
6064
5984
  }
6065
5985
  }
6066
5986
 
@@ -6068,8 +5988,8 @@
6068
5988
  var wiredDisconnecting = vm.context.wiredDisconnecting;
6069
5989
  runWithBoundaryProtection(vm, vm, noop, function () {
6070
5990
  // job
6071
- for (var _i31 = 0, _len12 = wiredDisconnecting.length; _i31 < _len12; _i31 += 1) {
6072
- wiredDisconnecting[_i31]();
5991
+ for (var _i28 = 0, _len12 = wiredDisconnecting.length; _i28 < _len12; _i28 += 1) {
5992
+ wiredDisconnecting[_i28]();
6073
5993
  }
6074
5994
  }, noop);
6075
5995
  }
@@ -6139,6 +6059,327 @@
6139
6059
 
6140
6060
  return reactiveMembrane.getReadOnlyProxy(obj);
6141
6061
  }
6062
+ /*
6063
+ * Copyright (c) 2022, salesforce.com, inc.
6064
+ * All rights reserved.
6065
+ * SPDX-License-Identifier: MIT
6066
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
6067
+ */
6068
+ // flag indicating if the hydration recovered from the DOM mismatch
6069
+
6070
+
6071
+ var hasMismatch = false;
6072
+
6073
+ function hydrateRoot(vm) {
6074
+ hasMismatch = false;
6075
+ runConnectedCallback(vm);
6076
+ hydrateVM(vm);
6077
+
6078
+ if (hasMismatch) {
6079
+ logError('Hydration completed with errors.', vm);
6080
+ }
6081
+ }
6082
+
6083
+ function hydrateVM(vm) {
6084
+ var children = renderComponent(vm);
6085
+ vm.children = children;
6086
+ var parentNode = vm.renderRoot;
6087
+ hydrateChildren(getFirstChild$1(parentNode), children, parentNode);
6088
+ runRenderedCallback(vm);
6089
+ }
6090
+
6091
+ function hydrateNode(node, vnode) {
6092
+ var hydratedNode;
6093
+
6094
+ switch (vnode.type) {
6095
+ case 0
6096
+ /* Text */
6097
+ :
6098
+ hydratedNode = hydrateText(node, vnode);
6099
+ break;
6100
+
6101
+ case 1
6102
+ /* Comment */
6103
+ :
6104
+ hydratedNode = hydrateComment(node, vnode);
6105
+ break;
6106
+
6107
+ case 2
6108
+ /* Element */
6109
+ :
6110
+ hydratedNode = hydrateElement(node, vnode);
6111
+ break;
6112
+
6113
+ case 3
6114
+ /* CustomElement */
6115
+ :
6116
+ hydratedNode = hydrateCustomElement(node, vnode);
6117
+ break;
6118
+ }
6119
+
6120
+ return nextSibling$1(hydratedNode);
6121
+ }
6122
+
6123
+ function hydrateText(node, vnode) {
6124
+ var _a;
6125
+
6126
+ if (!hasCorrectNodeType(vnode, node, 3
6127
+ /* TEXT */
6128
+ )) {
6129
+ return handleMismatch(node, vnode);
6130
+ }
6131
+
6132
+ setText$1(node, (_a = vnode.text) !== null && _a !== void 0 ? _a : null);
6133
+ vnode.elm = node;
6134
+ return node;
6135
+ }
6136
+
6137
+ function hydrateComment(node, vnode) {
6138
+ var _a;
6139
+
6140
+ if (!hasCorrectNodeType(vnode, node, 8
6141
+ /* COMMENT */
6142
+ )) {
6143
+ return handleMismatch(node, vnode);
6144
+ }
6145
+
6146
+ setProperty$1(node, 'nodeValue', (_a = vnode.text) !== null && _a !== void 0 ? _a : null);
6147
+ vnode.elm = node;
6148
+ return node;
6149
+ }
6150
+
6151
+ function hydrateElement(elm, vnode) {
6152
+ if (!hasCorrectNodeType(vnode, elm, 1
6153
+ /* ELEMENT */
6154
+ ) || !isMatchingElement(vnode, elm)) {
6155
+ return handleMismatch(elm, vnode);
6156
+ }
6157
+
6158
+ vnode.elm = elm;
6159
+ var context = vnode.data.context;
6160
+ var isDomManual = Boolean(!isUndefined$1(context) && !isUndefined$1(context.lwc) && context.lwc.dom === "manual"
6161
+ /* Manual */
6162
+ );
6163
+
6164
+ if (isDomManual) {
6165
+ // it may be that this element has lwc:inner-html, we need to diff and in case are the same,
6166
+ // remove the innerHTML from props so it reuses the existing dom elements.
6167
+ var props = vnode.data.props;
6168
+
6169
+ if (!isUndefined$1(props) && !isUndefined$1(props.innerHTML)) {
6170
+ if (getProperty$1(elm, 'innerHTML') === props.innerHTML) {
6171
+ // Do a shallow clone since VNodeData may be shared across VNodes due to hoist optimization
6172
+ vnode.data = Object.assign(Object.assign({}, vnode.data), {
6173
+ props: cloneAndOmitKey(props, 'innerHTML')
6174
+ });
6175
+ }
6176
+ }
6177
+ }
6178
+
6179
+ patchElementPropsAndAttrs(vnode);
6180
+
6181
+ if (!isDomManual) {
6182
+ hydrateChildren(getFirstChild$1(elm), vnode.children, elm, vnode.owner);
6183
+ }
6184
+
6185
+ return elm;
6186
+ }
6187
+
6188
+ function hydrateCustomElement(elm, vnode) {
6189
+ if (!hasCorrectNodeType(vnode, elm, 1
6190
+ /* ELEMENT */
6191
+ ) || !isMatchingElement(vnode, elm)) {
6192
+ return handleMismatch(elm, vnode);
6193
+ }
6194
+
6195
+ var sel = vnode.sel,
6196
+ mode = vnode.mode,
6197
+ ctor = vnode.ctor,
6198
+ owner = vnode.owner;
6199
+ var vm = createVM(elm, ctor, {
6200
+ mode: mode,
6201
+ owner: owner,
6202
+ tagName: sel
6203
+ });
6204
+ vnode.elm = elm;
6205
+ vnode.vm = vm;
6206
+ allocateChildren(vnode, vm);
6207
+ patchElementPropsAndAttrs(vnode); // Insert hook section:
6208
+
6209
+ runConnectedCallback(vm);
6210
+
6211
+ if (vm.renderMode !== 0
6212
+ /* Light */
6213
+ ) {
6214
+ // VM is not rendering in Light DOM, we can proceed and hydrate the slotted content.
6215
+ // Note: for Light DOM, this is handled while hydrating the VM
6216
+ hydrateChildren(getFirstChild$1(elm), vnode.children, elm);
6217
+ }
6218
+
6219
+ hydrateVM(vm);
6220
+ return elm;
6221
+ }
6222
+
6223
+ function hydrateChildren(node, children, parentNode, owner) {
6224
+ var nextNode = node;
6225
+ var anchor = null;
6226
+
6227
+ for (var _i29 = 0; _i29 < children.length; _i29++) {
6228
+ var childVnode = children[_i29];
6229
+
6230
+ if (!isNull(childVnode)) {
6231
+ if (nextNode) {
6232
+ nextNode = hydrateNode(nextNode, childVnode);
6233
+ anchor = childVnode.elm;
6234
+ } else {
6235
+ hasMismatch = true;
6236
+
6237
+ mount(childVnode, parentNode, anchor);
6238
+ anchor = childVnode.elm;
6239
+ }
6240
+ }
6241
+ }
6242
+
6243
+ if (nextNode) {
6244
+ hasMismatch = true;
6245
+
6246
+ do {
6247
+ var current = nextNode;
6248
+ nextNode = nextSibling$1(nextNode);
6249
+ removeNode(current, parentNode);
6250
+ } while (nextNode);
6251
+ }
6252
+ }
6253
+
6254
+ function handleMismatch(node, vnode, msg) {
6255
+ hasMismatch = true;
6256
+
6257
+ var parentNode = getProperty$1(node, 'parentNode');
6258
+ mount(vnode, parentNode, node);
6259
+ removeNode(node, parentNode);
6260
+ return vnode.elm;
6261
+ }
6262
+
6263
+ function patchElementPropsAndAttrs(vnode) {
6264
+ applyEventListeners(vnode);
6265
+ patchProps(null, vnode);
6266
+ }
6267
+
6268
+ function hasCorrectNodeType(vnode, node, nodeType) {
6269
+ if (getProperty$1(node, 'nodeType') !== nodeType) {
6270
+
6271
+ return false;
6272
+ }
6273
+
6274
+ return true;
6275
+ }
6276
+
6277
+ function isMatchingElement(vnode, elm) {
6278
+ if (vnode.sel.toLowerCase() !== getProperty$1(elm, 'tagName').toLowerCase()) {
6279
+
6280
+ return false;
6281
+ }
6282
+
6283
+ var hasIncompatibleAttrs = validateAttrs(vnode, elm);
6284
+ var hasIncompatibleClass = validateClassAttr(vnode, elm);
6285
+ var hasIncompatibleStyle = validateStyleAttr(vnode, elm);
6286
+ return hasIncompatibleAttrs && hasIncompatibleClass && hasIncompatibleStyle;
6287
+ }
6288
+
6289
+ function validateAttrs(vnode, elm) {
6290
+ var _vnode$data$attrs = vnode.data.attrs,
6291
+ attrs = _vnode$data$attrs === void 0 ? {} : _vnode$data$attrs;
6292
+ var nodesAreCompatible = true; // Validate attributes, though we could always recovery from those by running the update mods.
6293
+ // Note: intentionally ONLY matching vnodes.attrs to elm.attrs, in case SSR is adding extra attributes.
6294
+
6295
+ for (var _i30 = 0, _Object$entries = Object.entries(attrs); _i30 < _Object$entries.length; _i30++) {
6296
+ var _Object$entries$_i = _slicedToArray(_Object$entries[_i30], 2),
6297
+ attrName = _Object$entries$_i[0],
6298
+ attrValue = _Object$entries$_i[1];
6299
+
6300
+ var elmAttrValue = getAttribute$1(elm, attrName);
6301
+
6302
+ if (String(attrValue) !== elmAttrValue) {
6303
+
6304
+ nodesAreCompatible = false;
6305
+ }
6306
+ }
6307
+
6308
+ return nodesAreCompatible;
6309
+ }
6310
+
6311
+ function validateClassAttr(vnode, elm) {
6312
+ var _vnode$data = vnode.data,
6313
+ className = _vnode$data.className,
6314
+ classMap = _vnode$data.classMap;
6315
+ var nodesAreCompatible = true;
6316
+
6317
+ if (!isUndefined$1(className) && String(className) !== getProperty$1(elm, 'className')) {
6318
+ // className is used when class is bound to an expr.
6319
+ nodesAreCompatible = false;
6320
+ } else if (!isUndefined$1(classMap)) {
6321
+ // classMap is used when class is set to static value.
6322
+ var classList = getClassList$1(elm);
6323
+ var computedClassName = ''; // all classes from the vnode should be in the element.classList
6324
+
6325
+ for (var name in classMap) {
6326
+ computedClassName += ' ' + name;
6327
+
6328
+ if (!classList.contains(name)) {
6329
+ nodesAreCompatible = false;
6330
+ }
6331
+ }
6332
+
6333
+ computedClassName.trim();
6334
+
6335
+ if (classList.length > keys(classMap).length) {
6336
+ nodesAreCompatible = false;
6337
+ }
6338
+ }
6339
+
6340
+ return nodesAreCompatible;
6341
+ }
6342
+
6343
+ function validateStyleAttr(vnode, elm) {
6344
+ var _vnode$data2 = vnode.data,
6345
+ style = _vnode$data2.style,
6346
+ styleDecls = _vnode$data2.styleDecls;
6347
+ var elmStyle = getAttribute$1(elm, 'style') || '';
6348
+ var nodesAreCompatible = true;
6349
+
6350
+ if (!isUndefined$1(style) && style !== elmStyle) {
6351
+ nodesAreCompatible = false;
6352
+ } else if (!isUndefined$1(styleDecls)) {
6353
+ var parsedVnodeStyle = parseStyleText(elmStyle);
6354
+ var expectedStyle = []; // styleMap is used when style is set to static value.
6355
+
6356
+ for (var _i31 = 0, n = styleDecls.length; _i31 < n; _i31++) {
6357
+ var _styleDecls$_i2 = _slicedToArray(styleDecls[_i31], 3),
6358
+ prop = _styleDecls$_i2[0],
6359
+ value = _styleDecls$_i2[1],
6360
+ important = _styleDecls$_i2[2];
6361
+
6362
+ expectedStyle.push("".concat(prop, ": ").concat(value + (important ? ' important!' : '')));
6363
+ var parsedPropValue = parsedVnodeStyle[prop];
6364
+
6365
+ if (isUndefined$1(parsedPropValue)) {
6366
+ nodesAreCompatible = false;
6367
+ } else if (!parsedPropValue.startsWith(value)) {
6368
+ nodesAreCompatible = false;
6369
+ } else if (important && !parsedPropValue.endsWith('!important')) {
6370
+ nodesAreCompatible = false;
6371
+ }
6372
+ }
6373
+
6374
+ if (keys(parsedVnodeStyle).length > styleDecls.length) {
6375
+ nodesAreCompatible = false;
6376
+ }
6377
+
6378
+ ArrayJoin.call(expectedStyle, ';');
6379
+ }
6380
+
6381
+ return nodesAreCompatible;
6382
+ }
6142
6383
  /*
6143
6384
  * Copyright (c) 2018, salesforce.com, inc.
6144
6385
  * All rights reserved.
@@ -6154,7 +6395,7 @@
6154
6395
  hooksAreSet = true;
6155
6396
  setSanitizeHtmlContentHook(hooks.sanitizeHtmlContent);
6156
6397
  }
6157
- /* version: 2.11.0 */
6398
+ /* version: 2.11.4 */
6158
6399
 
6159
6400
  /*
6160
6401
  * Copyright (c) 2018, salesforce.com, inc.
@@ -6541,7 +6782,7 @@
6541
6782
  }
6542
6783
 
6543
6784
  function createVMWithProps(element, Ctor, props) {
6544
- createVM(element, Ctor, {
6785
+ var vm = createVM(element, Ctor, {
6545
6786
  mode: 'open',
6546
6787
  owner: null,
6547
6788
  tagName: element.tagName.toLowerCase()
@@ -6554,6 +6795,8 @@
6554
6795
 
6555
6796
  element[key] = value;
6556
6797
  }
6798
+
6799
+ return vm;
6557
6800
  }
6558
6801
 
6559
6802
  function hydrateComponent(element, Ctor) {
@@ -6581,8 +6824,8 @@
6581
6824
  // Let the renderer know we are hydrating, so it does not replace the existing shadowRoot
6582
6825
  // and uses the same algo to create the stylesheets as in SSR.
6583
6826
  setIsHydrating(true);
6584
- createVMWithProps(element, Ctor, props);
6585
- hydrateRootElement(element); // set it back since now we finished hydration.
6827
+ var vm = createVMWithProps(element, Ctor, props);
6828
+ hydrateRoot(vm); // set it back since now we finished hydration.
6586
6829
 
6587
6830
  setIsHydrating(false);
6588
6831
  } catch (e) {
@@ -6897,7 +7140,7 @@
6897
7140
  });
6898
7141
  freeze(LightningElement);
6899
7142
  seal(LightningElement.prototype);
6900
- /* version: 2.11.0 */
7143
+ /* version: 2.11.4 */
6901
7144
 
6902
7145
  exports.LightningElement = LightningElement;
6903
7146
  exports.__unstable__ProfilerControl = profilerControl;