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
@@ -304,9 +304,9 @@
304
304
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
305
305
  */
306
306
  // Increment whenever the LWC template compiler changes
307
- const LWC_VERSION = "2.11.0";
307
+ const LWC_VERSION = "2.11.4";
308
308
  const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
309
- /** version: 2.11.0 */
309
+ /** version: 2.11.4 */
310
310
 
311
311
  /*
312
312
  * Copyright (c) 2018, salesforce.com, inc.
@@ -459,7 +459,7 @@
459
459
  setFeatureFlag(name, value);
460
460
  }
461
461
  }
462
- /** version: 2.11.0 */
462
+ /** version: 2.11.4 */
463
463
 
464
464
  /* proxy-compat-disable */
465
465
 
@@ -2764,6 +2764,12 @@
2764
2764
  }
2765
2765
  }
2766
2766
 
2767
+ /*
2768
+ * Copyright (c) 2018, salesforce.com, inc.
2769
+ * All rights reserved.
2770
+ * SPDX-License-Identifier: MIT
2771
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
2772
+ */
2767
2773
  const signedTemplateSet = new Set();
2768
2774
  function defaultEmptyTemplate() {
2769
2775
  return [];
@@ -2781,6 +2787,30 @@
2781
2787
  checkVersionMismatch(tpl, 'template');
2782
2788
  }
2783
2789
  signedTemplateSet.add(tpl);
2790
+ // FIXME[@W-10950976]: the template object should be frozen, and it should not be possible to set
2791
+ // the stylesheets or stylesheetToken(s). For backwards compat, though, we shim stylesheetTokens
2792
+ // on top of stylesheetToken for anyone who is accessing the old internal API.
2793
+ // Details: https://salesforce.quip.com/v1rmAFu2cKAr
2794
+ defineProperty(tpl, 'stylesheetTokens', {
2795
+ get() {
2796
+ const { stylesheetToken } = this;
2797
+ if (isUndefined$1(stylesheetToken)) {
2798
+ return stylesheetToken;
2799
+ }
2800
+ // Shim for the old `stylesheetTokens` property
2801
+ // See https://github.com/salesforce/lwc/pull/2332/files#diff-7901555acef29969adaa6583185b3e9bce475cdc6f23e799a54e0018cb18abaa
2802
+ return {
2803
+ hostAttribute: `${stylesheetToken}-host`,
2804
+ shadowAttribute: stylesheetToken,
2805
+ };
2806
+ },
2807
+ set(value) {
2808
+ // If the value is null or some other exotic object, you would be broken anyway in the past
2809
+ // because the engine would try to access hostAttribute/shadowAttribute, which would throw an error.
2810
+ // However it may be undefined in newer versions of LWC, so we need to guard against that case.
2811
+ this.stylesheetToken = isUndefined$1(value) ? undefined : value.shadowAttribute;
2812
+ },
2813
+ });
2784
2814
  // chaining this method as a way to wrap existing
2785
2815
  // assignment of templates easily, without too much transformation
2786
2816
  return tpl;
@@ -5162,11 +5192,15 @@
5162
5192
  * INTERNAL: This function can only be invoked by compiled code. The compiler
5163
5193
  * will prevent this function from being imported by userland code.
5164
5194
  */
5165
- function registerComponent(Ctor, { tmpl }) {
5166
- if (process.env.NODE_ENV !== 'production') {
5167
- checkVersionMismatch(Ctor, 'component');
5195
+ function registerComponent(
5196
+ // We typically expect a LightningElementConstructor, but technically you can call this with anything
5197
+ Ctor, { tmpl }) {
5198
+ if (isFunction$1(Ctor)) {
5199
+ if (process.env.NODE_ENV !== 'production') {
5200
+ checkVersionMismatch(Ctor, 'component');
5201
+ }
5202
+ signedTemplateMap.set(Ctor, tmpl);
5168
5203
  }
5169
- signedTemplateMap.set(Ctor, tmpl);
5170
5204
  // chaining this method as a way to wrap existing assignment of component constructor easily,
5171
5205
  // without too much transformation
5172
5206
  return Ctor;
@@ -5255,236 +5289,6 @@
5255
5289
  }
5256
5290
  }
5257
5291
 
5258
- /*
5259
- * Copyright (c) 2022, salesforce.com, inc.
5260
- * All rights reserved.
5261
- * SPDX-License-Identifier: MIT
5262
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
5263
- */
5264
- function hydrate(vnode, node) {
5265
- switch (vnode.type) {
5266
- case 0 /* Text */:
5267
- hydrateText(vnode, node);
5268
- break;
5269
- case 1 /* Comment */:
5270
- hydrateComment(vnode, node);
5271
- break;
5272
- case 2 /* Element */:
5273
- hydrateElement(vnode, node);
5274
- break;
5275
- case 3 /* CustomElement */:
5276
- hydrateCustomElement(vnode, node);
5277
- break;
5278
- }
5279
- }
5280
- function hydrateText(vnode, node) {
5281
- var _a;
5282
- if (process.env.NODE_ENV !== 'production') {
5283
- validateNodeType(vnode, node, 3 /* TEXT */);
5284
- const nodeValue = getProperty$1(node, 'nodeValue');
5285
- if (nodeValue !== vnode.text && !(nodeValue === '\u200D' && vnode.text === '')) {
5286
- logWarn('Hydration mismatch: text values do not match, will recover from the difference', vnode.owner);
5287
- }
5288
- }
5289
- // always set the text value to the one from the vnode.
5290
- setText$1(node, (_a = vnode.text) !== null && _a !== void 0 ? _a : null);
5291
- vnode.elm = node;
5292
- }
5293
- function hydrateComment(vnode, node) {
5294
- var _a;
5295
- if (process.env.NODE_ENV !== 'production') {
5296
- validateNodeType(vnode, node, 8 /* COMMENT */);
5297
- if (getProperty$1(node, 'nodeValue') !== vnode.text) {
5298
- logWarn('Hydration mismatch: comment values do not match, will recover from the difference', vnode.owner);
5299
- }
5300
- }
5301
- // always set the text value to the one from the vnode.
5302
- setProperty$1(node, 'nodeValue', (_a = vnode.text) !== null && _a !== void 0 ? _a : null);
5303
- vnode.elm = node;
5304
- }
5305
- function hydrateElement(vnode, node) {
5306
- if (process.env.NODE_ENV !== 'production') {
5307
- validateNodeType(vnode, node, 1 /* ELEMENT */);
5308
- validateElement(vnode, node);
5309
- }
5310
- const elm = node;
5311
- vnode.elm = elm;
5312
- const { context } = vnode.data;
5313
- const isDomManual = Boolean(!isUndefined$1(context) && !isUndefined$1(context.lwc) && context.lwc.dom === "manual" /* Manual */);
5314
- if (isDomManual) {
5315
- // it may be that this element has lwc:inner-html, we need to diff and in case are the same,
5316
- // remove the innerHTML from props so it reuses the existing dom elements.
5317
- const { props } = vnode.data;
5318
- if (!isUndefined$1(props) && !isUndefined$1(props.innerHTML)) {
5319
- if (getProperty$1(elm, 'innerHTML') === props.innerHTML) {
5320
- // Do a shallow clone since VNodeData may be shared across VNodes due to hoist optimization
5321
- vnode.data = Object.assign(Object.assign({}, vnode.data), { props: cloneAndOmitKey(props, 'innerHTML') });
5322
- }
5323
- else {
5324
- logWarn(`Mismatch hydrating element <${getProperty$1(elm, 'tagName').toLowerCase()}>: innerHTML values do not match for element, will recover from the difference`, vnode.owner);
5325
- }
5326
- }
5327
- }
5328
- patchElementPropsAndAttrs(vnode);
5329
- if (!isDomManual) {
5330
- hydrateChildren(getChildNodes$1(vnode.elm), vnode.children, vnode.owner);
5331
- }
5332
- }
5333
- function hydrateCustomElement(vnode, node) {
5334
- if (process.env.NODE_ENV !== 'production') {
5335
- validateNodeType(vnode, node, 1 /* ELEMENT */);
5336
- validateElement(vnode, node);
5337
- }
5338
- const elm = node;
5339
- const { sel, mode, ctor, owner } = vnode;
5340
- const vm = createVM(elm, ctor, {
5341
- mode,
5342
- owner,
5343
- tagName: sel,
5344
- });
5345
- vnode.elm = elm;
5346
- vnode.vm = vm;
5347
- allocateChildren(vnode, vm);
5348
- patchElementPropsAndAttrs(vnode);
5349
- // Insert hook section:
5350
- if (process.env.NODE_ENV !== 'production') {
5351
- assert.isTrue(vm.state === 0 /* created */, `${vm} cannot be recycled.`);
5352
- }
5353
- runConnectedCallback(vm);
5354
- if (vm.renderMode !== 0 /* Light */) {
5355
- // VM is not rendering in Light DOM, we can proceed and hydrate the slotted content.
5356
- // Note: for Light DOM, this is handled while hydrating the VM
5357
- hydrateChildren(getChildNodes$1(vnode.elm), vnode.children, vm);
5358
- }
5359
- hydrateVM(vm);
5360
- }
5361
- function hydrateChildren(elmChildren, children, vm) {
5362
- if (process.env.NODE_ENV !== 'production') {
5363
- const filteredVNodes = ArrayFilter.call(children, (vnode) => !!vnode);
5364
- if (elmChildren.length !== filteredVNodes.length) {
5365
- logError(`Hydration mismatch: incorrect number of rendered nodes, expected ${filteredVNodes.length} but found ${elmChildren.length}.`, vm);
5366
- throwHydrationError();
5367
- }
5368
- }
5369
- let childNodeIndex = 0;
5370
- for (let i = 0; i < children.length; i++) {
5371
- const childVnode = children[i];
5372
- if (!isNull(childVnode)) {
5373
- const childNode = elmChildren[childNodeIndex];
5374
- hydrate(childVnode, childNode);
5375
- childNodeIndex++;
5376
- }
5377
- }
5378
- }
5379
- function patchElementPropsAndAttrs(vnode) {
5380
- applyEventListeners(vnode);
5381
- patchProps(null, vnode);
5382
- }
5383
- function throwHydrationError() {
5384
- assert.fail('Server rendered elements do not match client side generated elements');
5385
- }
5386
- function validateNodeType(vnode, node, nodeType) {
5387
- if (getProperty$1(node, 'nodeType') !== nodeType) {
5388
- logError('Hydration mismatch: incorrect node type received', vnode.owner);
5389
- assert.fail('Hydration mismatch: incorrect node type received.');
5390
- }
5391
- }
5392
- function validateElement(vnode, elm) {
5393
- if (vnode.sel.toLowerCase() !== getProperty$1(elm, 'tagName').toLowerCase()) {
5394
- logError(`Hydration mismatch: expecting element with tag "${vnode.sel.toLowerCase()}" but found "${getProperty$1(elm, 'tagName').toLowerCase()}".`, vnode.owner);
5395
- throwHydrationError();
5396
- }
5397
- const hasIncompatibleAttrs = validateAttrs(vnode, elm);
5398
- const hasIncompatibleClass = validateClassAttr(vnode, elm);
5399
- const hasIncompatibleStyle = validateStyleAttr(vnode, elm);
5400
- const isVNodeAndElementCompatible = hasIncompatibleAttrs && hasIncompatibleClass && hasIncompatibleStyle;
5401
- if (!isVNodeAndElementCompatible) {
5402
- throwHydrationError();
5403
- }
5404
- }
5405
- function validateAttrs(vnode, elm) {
5406
- const { data: { attrs = {} }, } = vnode;
5407
- let nodesAreCompatible = true;
5408
- // Validate attributes, though we could always recovery from those by running the update mods.
5409
- // Note: intentionally ONLY matching vnodes.attrs to elm.attrs, in case SSR is adding extra attributes.
5410
- for (const [attrName, attrValue] of Object.entries(attrs)) {
5411
- const elmAttrValue = getAttribute$1(elm, attrName);
5412
- if (String(attrValue) !== elmAttrValue) {
5413
- logError(`Mismatch hydrating element <${getProperty$1(elm, 'tagName').toLowerCase()}>: attribute "${attrName}" has different values, expected "${attrValue}" but found "${elmAttrValue}"`, vnode.owner);
5414
- nodesAreCompatible = false;
5415
- }
5416
- }
5417
- return nodesAreCompatible;
5418
- }
5419
- function validateClassAttr(vnode, elm) {
5420
- const { data: { className, classMap }, } = vnode;
5421
- let nodesAreCompatible = true;
5422
- let vnodeClassName;
5423
- if (!isUndefined$1(className) && String(className) !== getProperty$1(elm, 'className')) {
5424
- // className is used when class is bound to an expr.
5425
- nodesAreCompatible = false;
5426
- vnodeClassName = className;
5427
- }
5428
- else if (!isUndefined$1(classMap)) {
5429
- // classMap is used when class is set to static value.
5430
- const classList = getClassList$1(elm);
5431
- let computedClassName = '';
5432
- // all classes from the vnode should be in the element.classList
5433
- for (const name in classMap) {
5434
- computedClassName += ' ' + name;
5435
- if (!classList.contains(name)) {
5436
- nodesAreCompatible = false;
5437
- }
5438
- }
5439
- vnodeClassName = computedClassName.trim();
5440
- if (classList.length > keys(classMap).length) {
5441
- nodesAreCompatible = false;
5442
- }
5443
- }
5444
- if (!nodesAreCompatible) {
5445
- logError(`Mismatch hydrating element <${getProperty$1(elm, 'tagName').toLowerCase()}>: attribute "class" has different values, expected "${vnodeClassName}" but found "${getProperty$1(elm, 'className')}"`, vnode.owner);
5446
- }
5447
- return nodesAreCompatible;
5448
- }
5449
- function validateStyleAttr(vnode, elm) {
5450
- const { data: { style, styleDecls }, } = vnode;
5451
- const elmStyle = getAttribute$1(elm, 'style') || '';
5452
- let vnodeStyle;
5453
- let nodesAreCompatible = true;
5454
- if (!isUndefined$1(style) && style !== elmStyle) {
5455
- nodesAreCompatible = false;
5456
- vnodeStyle = style;
5457
- }
5458
- else if (!isUndefined$1(styleDecls)) {
5459
- const parsedVnodeStyle = parseStyleText(elmStyle);
5460
- const expectedStyle = [];
5461
- // styleMap is used when style is set to static value.
5462
- for (let i = 0, n = styleDecls.length; i < n; i++) {
5463
- const [prop, value, important] = styleDecls[i];
5464
- expectedStyle.push(`${prop}: ${value + (important ? ' important!' : '')}`);
5465
- const parsedPropValue = parsedVnodeStyle[prop];
5466
- if (isUndefined$1(parsedPropValue)) {
5467
- nodesAreCompatible = false;
5468
- }
5469
- else if (!parsedPropValue.startsWith(value)) {
5470
- nodesAreCompatible = false;
5471
- }
5472
- else if (important && !parsedPropValue.endsWith('!important')) {
5473
- nodesAreCompatible = false;
5474
- }
5475
- }
5476
- if (keys(parsedVnodeStyle).length > styleDecls.length) {
5477
- nodesAreCompatible = false;
5478
- }
5479
- vnodeStyle = ArrayJoin.call(expectedStyle, ';');
5480
- }
5481
- if (!nodesAreCompatible) {
5482
- // style is used when class is bound to an expr.
5483
- logError(`Mismatch hydrating element <${getProperty$1(elm, 'tagName').toLowerCase()}>: attribute "style" has different values, expected "${vnodeStyle}" but found "${elmStyle}".`, vnode.owner);
5484
- }
5485
- return nodesAreCompatible;
5486
- }
5487
-
5488
5292
  /*
5489
5293
  * Copyright (c) 2018, salesforce.com, inc.
5490
5294
  * All rights reserved.
@@ -5530,32 +5334,12 @@
5530
5334
  /* GlobalHydrate */
5531
5335
  , vm);
5532
5336
  }
5533
- function hydrateRootElement(elm) {
5534
- const vm = getAssociatedVM(elm);
5535
- runConnectedCallback(vm);
5536
- hydrateVM(vm);
5537
- }
5538
5337
  function disconnectRootElement(elm) {
5539
5338
  const vm = getAssociatedVM(elm);
5540
5339
  resetComponentStateWhenRemoved(vm);
5541
5340
  }
5542
5341
  function appendVM(vm) {
5543
5342
  rehydrate(vm);
5544
- }
5545
- function hydrateVM(vm) {
5546
- if (isTrue(vm.isDirty)) {
5547
- // manually diffing/patching here.
5548
- // This routine is:
5549
- // patchShadowRoot(vm, children);
5550
- // -> addVnodes.
5551
- const children = renderComponent(vm);
5552
- vm.children = children;
5553
- const vmChildren = vm.renderMode === 0
5554
- /* Light */
5555
- ? getChildNodes$1(vm.elm) : getChildNodes$1(vm.elm.shadowRoot);
5556
- hydrateChildren(vmChildren, children, vm);
5557
- runRenderedCallback(vm);
5558
- }
5559
5343
  } // just in case the component comes back, with this we guarantee re-rendering it
5560
5344
  // while preventing any attempt to rehydration until after reinsertion.
5561
5345
 
@@ -5860,7 +5644,6 @@
5860
5644
  , vm);
5861
5645
  }
5862
5646
  }
5863
-
5864
5647
  let rehydrateQueue = [];
5865
5648
 
5866
5649
  function flushRehydrationQueue() {
@@ -6517,6 +6300,298 @@
6517
6300
  return reactiveMembrane.getReadOnlyProxy(obj);
6518
6301
  }
6519
6302
 
6303
+ /*
6304
+ * Copyright (c) 2022, salesforce.com, inc.
6305
+ * All rights reserved.
6306
+ * SPDX-License-Identifier: MIT
6307
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
6308
+ */
6309
+ // flag indicating if the hydration recovered from the DOM mismatch
6310
+ let hasMismatch = false;
6311
+ function hydrateRoot(vm) {
6312
+ hasMismatch = false;
6313
+ runConnectedCallback(vm);
6314
+ hydrateVM(vm);
6315
+ if (hasMismatch) {
6316
+ logError('Hydration completed with errors.', vm);
6317
+ }
6318
+ }
6319
+ function hydrateVM(vm) {
6320
+ const children = renderComponent(vm);
6321
+ vm.children = children;
6322
+ const parentNode = vm.renderRoot;
6323
+ hydrateChildren(getFirstChild$1(parentNode), children, parentNode, vm);
6324
+ runRenderedCallback(vm);
6325
+ }
6326
+ function hydrateNode(node, vnode) {
6327
+ let hydratedNode;
6328
+ switch (vnode.type) {
6329
+ case 0 /* Text */:
6330
+ hydratedNode = hydrateText(node, vnode);
6331
+ break;
6332
+ case 1 /* Comment */:
6333
+ hydratedNode = hydrateComment(node, vnode);
6334
+ break;
6335
+ case 2 /* Element */:
6336
+ hydratedNode = hydrateElement(node, vnode);
6337
+ break;
6338
+ case 3 /* CustomElement */:
6339
+ hydratedNode = hydrateCustomElement(node, vnode);
6340
+ break;
6341
+ }
6342
+ return nextSibling$1(hydratedNode);
6343
+ }
6344
+ function hydrateText(node, vnode) {
6345
+ var _a;
6346
+ if (!hasCorrectNodeType(vnode, node, 3 /* TEXT */)) {
6347
+ return handleMismatch(node, vnode);
6348
+ }
6349
+ if (process.env.NODE_ENV !== 'production') {
6350
+ const nodeValue = getProperty$1(node, 'nodeValue');
6351
+ if (nodeValue !== vnode.text && !(nodeValue === '\u200D' && vnode.text === '')) {
6352
+ logWarn('Hydration mismatch: text values do not match, will recover from the difference', vnode.owner);
6353
+ }
6354
+ }
6355
+ setText$1(node, (_a = vnode.text) !== null && _a !== void 0 ? _a : null);
6356
+ vnode.elm = node;
6357
+ return node;
6358
+ }
6359
+ function hydrateComment(node, vnode) {
6360
+ var _a;
6361
+ if (!hasCorrectNodeType(vnode, node, 8 /* COMMENT */)) {
6362
+ return handleMismatch(node, vnode);
6363
+ }
6364
+ if (process.env.NODE_ENV !== 'production') {
6365
+ const nodeValue = getProperty$1(node, 'nodeValue');
6366
+ if (nodeValue !== vnode.text) {
6367
+ logWarn('Hydration mismatch: comment values do not match, will recover from the difference', vnode.owner);
6368
+ }
6369
+ }
6370
+ setProperty$1(node, 'nodeValue', (_a = vnode.text) !== null && _a !== void 0 ? _a : null);
6371
+ vnode.elm = node;
6372
+ return node;
6373
+ }
6374
+ function hydrateElement(elm, vnode) {
6375
+ if (!hasCorrectNodeType(vnode, elm, 1 /* ELEMENT */) ||
6376
+ !isMatchingElement(vnode, elm)) {
6377
+ return handleMismatch(elm, vnode);
6378
+ }
6379
+ vnode.elm = elm;
6380
+ const { context } = vnode.data;
6381
+ const isDomManual = Boolean(!isUndefined$1(context) && !isUndefined$1(context.lwc) && context.lwc.dom === "manual" /* Manual */);
6382
+ if (isDomManual) {
6383
+ // it may be that this element has lwc:inner-html, we need to diff and in case are the same,
6384
+ // remove the innerHTML from props so it reuses the existing dom elements.
6385
+ const { props } = vnode.data;
6386
+ if (!isUndefined$1(props) && !isUndefined$1(props.innerHTML)) {
6387
+ if (getProperty$1(elm, 'innerHTML') === props.innerHTML) {
6388
+ // Do a shallow clone since VNodeData may be shared across VNodes due to hoist optimization
6389
+ vnode.data = Object.assign(Object.assign({}, vnode.data), { props: cloneAndOmitKey(props, 'innerHTML') });
6390
+ }
6391
+ else {
6392
+ if (process.env.NODE_ENV !== 'production') {
6393
+ logWarn(`Mismatch hydrating element <${getProperty$1(elm, 'tagName').toLowerCase()}>: innerHTML values do not match for element, will recover from the difference`, vnode.owner);
6394
+ }
6395
+ }
6396
+ }
6397
+ }
6398
+ patchElementPropsAndAttrs(vnode);
6399
+ if (!isDomManual) {
6400
+ hydrateChildren(getFirstChild$1(elm), vnode.children, elm, vnode.owner);
6401
+ }
6402
+ return elm;
6403
+ }
6404
+ function hydrateCustomElement(elm, vnode) {
6405
+ if (!hasCorrectNodeType(vnode, elm, 1 /* ELEMENT */) ||
6406
+ !isMatchingElement(vnode, elm)) {
6407
+ return handleMismatch(elm, vnode);
6408
+ }
6409
+ const { sel, mode, ctor, owner } = vnode;
6410
+ const vm = createVM(elm, ctor, {
6411
+ mode,
6412
+ owner,
6413
+ tagName: sel,
6414
+ });
6415
+ vnode.elm = elm;
6416
+ vnode.vm = vm;
6417
+ allocateChildren(vnode, vm);
6418
+ patchElementPropsAndAttrs(vnode);
6419
+ // Insert hook section:
6420
+ if (process.env.NODE_ENV !== 'production') {
6421
+ assert.isTrue(vm.state === 0 /* created */, `${vm} cannot be recycled.`);
6422
+ }
6423
+ runConnectedCallback(vm);
6424
+ if (vm.renderMode !== 0 /* Light */) {
6425
+ // VM is not rendering in Light DOM, we can proceed and hydrate the slotted content.
6426
+ // Note: for Light DOM, this is handled while hydrating the VM
6427
+ hydrateChildren(getFirstChild$1(elm), vnode.children, elm, vm);
6428
+ }
6429
+ hydrateVM(vm);
6430
+ return elm;
6431
+ }
6432
+ function hydrateChildren(node, children, parentNode, owner) {
6433
+ let hasWarned = false;
6434
+ let nextNode = node;
6435
+ let anchor = null;
6436
+ for (let i = 0; i < children.length; i++) {
6437
+ const childVnode = children[i];
6438
+ if (!isNull(childVnode)) {
6439
+ if (nextNode) {
6440
+ nextNode = hydrateNode(nextNode, childVnode);
6441
+ anchor = childVnode.elm;
6442
+ }
6443
+ else {
6444
+ hasMismatch = true;
6445
+ if (process.env.NODE_ENV !== 'production') {
6446
+ if (!hasWarned) {
6447
+ hasWarned = true;
6448
+ logError(`Hydration mismatch: incorrect number of rendered nodes. Client produced more nodes than the server.`, owner);
6449
+ }
6450
+ }
6451
+ mount(childVnode, parentNode, anchor);
6452
+ anchor = childVnode.elm;
6453
+ }
6454
+ }
6455
+ }
6456
+ if (nextNode) {
6457
+ hasMismatch = true;
6458
+ if (process.env.NODE_ENV !== 'production') {
6459
+ if (!hasWarned) {
6460
+ logError(`Hydration mismatch: incorrect number of rendered nodes. Server rendered more nodes than the client.`, owner);
6461
+ }
6462
+ }
6463
+ do {
6464
+ const current = nextNode;
6465
+ nextNode = nextSibling$1(nextNode);
6466
+ removeNode(current, parentNode);
6467
+ } while (nextNode);
6468
+ }
6469
+ }
6470
+ function handleMismatch(node, vnode, msg) {
6471
+ hasMismatch = true;
6472
+ if (!isUndefined$1(msg)) {
6473
+ if (process.env.NODE_ENV !== 'production') {
6474
+ logError(msg, vnode.owner);
6475
+ }
6476
+ }
6477
+ const parentNode = getProperty$1(node, 'parentNode');
6478
+ mount(vnode, parentNode, node);
6479
+ removeNode(node, parentNode);
6480
+ return vnode.elm;
6481
+ }
6482
+ function patchElementPropsAndAttrs(vnode) {
6483
+ applyEventListeners(vnode);
6484
+ patchProps(null, vnode);
6485
+ }
6486
+ function hasCorrectNodeType(vnode, node, nodeType) {
6487
+ if (getProperty$1(node, 'nodeType') !== nodeType) {
6488
+ if (process.env.NODE_ENV !== 'production') {
6489
+ logError('Hydration mismatch: incorrect node type received', vnode.owner);
6490
+ }
6491
+ return false;
6492
+ }
6493
+ return true;
6494
+ }
6495
+ function isMatchingElement(vnode, elm) {
6496
+ if (vnode.sel.toLowerCase() !== getProperty$1(elm, 'tagName').toLowerCase()) {
6497
+ if (process.env.NODE_ENV !== 'production') {
6498
+ logError(`Hydration mismatch: expecting element with tag "${vnode.sel.toLowerCase()}" but found "${getProperty$1(elm, 'tagName').toLowerCase()}".`, vnode.owner);
6499
+ }
6500
+ return false;
6501
+ }
6502
+ const hasIncompatibleAttrs = validateAttrs(vnode, elm);
6503
+ const hasIncompatibleClass = validateClassAttr(vnode, elm);
6504
+ const hasIncompatibleStyle = validateStyleAttr(vnode, elm);
6505
+ return hasIncompatibleAttrs && hasIncompatibleClass && hasIncompatibleStyle;
6506
+ }
6507
+ function validateAttrs(vnode, elm) {
6508
+ const { data: { attrs = {} }, } = vnode;
6509
+ let nodesAreCompatible = true;
6510
+ // Validate attributes, though we could always recovery from those by running the update mods.
6511
+ // Note: intentionally ONLY matching vnodes.attrs to elm.attrs, in case SSR is adding extra attributes.
6512
+ for (const [attrName, attrValue] of Object.entries(attrs)) {
6513
+ const elmAttrValue = getAttribute$1(elm, attrName);
6514
+ if (String(attrValue) !== elmAttrValue) {
6515
+ if (process.env.NODE_ENV !== 'production') {
6516
+ logError(`Mismatch hydrating element <${getProperty$1(elm, 'tagName').toLowerCase()}>: attribute "${attrName}" has different values, expected "${attrValue}" but found "${elmAttrValue}"`, vnode.owner);
6517
+ }
6518
+ nodesAreCompatible = false;
6519
+ }
6520
+ }
6521
+ return nodesAreCompatible;
6522
+ }
6523
+ function validateClassAttr(vnode, elm) {
6524
+ const { data: { className, classMap }, } = vnode;
6525
+ let nodesAreCompatible = true;
6526
+ let vnodeClassName;
6527
+ if (!isUndefined$1(className) && String(className) !== getProperty$1(elm, 'className')) {
6528
+ // className is used when class is bound to an expr.
6529
+ nodesAreCompatible = false;
6530
+ vnodeClassName = className;
6531
+ }
6532
+ else if (!isUndefined$1(classMap)) {
6533
+ // classMap is used when class is set to static value.
6534
+ const classList = getClassList$1(elm);
6535
+ let computedClassName = '';
6536
+ // all classes from the vnode should be in the element.classList
6537
+ for (const name in classMap) {
6538
+ computedClassName += ' ' + name;
6539
+ if (!classList.contains(name)) {
6540
+ nodesAreCompatible = false;
6541
+ }
6542
+ }
6543
+ vnodeClassName = computedClassName.trim();
6544
+ if (classList.length > keys(classMap).length) {
6545
+ nodesAreCompatible = false;
6546
+ }
6547
+ }
6548
+ if (!nodesAreCompatible) {
6549
+ if (process.env.NODE_ENV !== 'production') {
6550
+ logError(`Mismatch hydrating element <${getProperty$1(elm, 'tagName').toLowerCase()}>: attribute "class" has different values, expected "${vnodeClassName}" but found "${getProperty$1(elm, 'className')}"`, vnode.owner);
6551
+ }
6552
+ }
6553
+ return nodesAreCompatible;
6554
+ }
6555
+ function validateStyleAttr(vnode, elm) {
6556
+ const { data: { style, styleDecls }, } = vnode;
6557
+ const elmStyle = getAttribute$1(elm, 'style') || '';
6558
+ let vnodeStyle;
6559
+ let nodesAreCompatible = true;
6560
+ if (!isUndefined$1(style) && style !== elmStyle) {
6561
+ nodesAreCompatible = false;
6562
+ vnodeStyle = style;
6563
+ }
6564
+ else if (!isUndefined$1(styleDecls)) {
6565
+ const parsedVnodeStyle = parseStyleText(elmStyle);
6566
+ const expectedStyle = [];
6567
+ // styleMap is used when style is set to static value.
6568
+ for (let i = 0, n = styleDecls.length; i < n; i++) {
6569
+ const [prop, value, important] = styleDecls[i];
6570
+ expectedStyle.push(`${prop}: ${value + (important ? ' important!' : '')}`);
6571
+ const parsedPropValue = parsedVnodeStyle[prop];
6572
+ if (isUndefined$1(parsedPropValue)) {
6573
+ nodesAreCompatible = false;
6574
+ }
6575
+ else if (!parsedPropValue.startsWith(value)) {
6576
+ nodesAreCompatible = false;
6577
+ }
6578
+ else if (important && !parsedPropValue.endsWith('!important')) {
6579
+ nodesAreCompatible = false;
6580
+ }
6581
+ }
6582
+ if (keys(parsedVnodeStyle).length > styleDecls.length) {
6583
+ nodesAreCompatible = false;
6584
+ }
6585
+ vnodeStyle = ArrayJoin.call(expectedStyle, ';');
6586
+ }
6587
+ if (!nodesAreCompatible) {
6588
+ if (process.env.NODE_ENV !== 'production') {
6589
+ logError(`Mismatch hydrating element <${getProperty$1(elm, 'tagName').toLowerCase()}>: attribute "style" has different values, expected "${vnodeStyle}" but found "${elmStyle}".`, vnode.owner);
6590
+ }
6591
+ }
6592
+ return nodesAreCompatible;
6593
+ }
6594
+
6520
6595
  /*
6521
6596
  * Copyright (c) 2018, salesforce.com, inc.
6522
6597
  * All rights reserved.
@@ -6529,7 +6604,7 @@
6529
6604
  hooksAreSet = true;
6530
6605
  setSanitizeHtmlContentHook(hooks.sanitizeHtmlContent);
6531
6606
  }
6532
- /* version: 2.11.0 */
6607
+ /* version: 2.11.4 */
6533
6608
 
6534
6609
  /*
6535
6610
  * Copyright (c) 2018, salesforce.com, inc.
@@ -6874,7 +6949,7 @@
6874
6949
  }
6875
6950
  }
6876
6951
  function createVMWithProps(element, Ctor, props) {
6877
- createVM(element, Ctor, {
6952
+ const vm = createVM(element, Ctor, {
6878
6953
  mode: 'open',
6879
6954
  owner: null,
6880
6955
  tagName: element.tagName.toLowerCase(),
@@ -6882,6 +6957,7 @@
6882
6957
  for (const [key, value] of Object.entries(props)) {
6883
6958
  element[key] = value;
6884
6959
  }
6960
+ return vm;
6885
6961
  }
6886
6962
  function hydrateComponent(element, Ctor, props = {}) {
6887
6963
  if (!(element instanceof Element)) {
@@ -6902,8 +6978,8 @@
6902
6978
  // Let the renderer know we are hydrating, so it does not replace the existing shadowRoot
6903
6979
  // and uses the same algo to create the stylesheets as in SSR.
6904
6980
  setIsHydrating(true);
6905
- createVMWithProps(element, Ctor, props);
6906
- hydrateRootElement(element);
6981
+ const vm = createVMWithProps(element, Ctor, props);
6982
+ hydrateRoot(vm);
6907
6983
  // set it back since now we finished hydration.
6908
6984
  setIsHydrating(false);
6909
6985
  }
@@ -7168,7 +7244,7 @@
7168
7244
  });
7169
7245
  freeze(LightningElement);
7170
7246
  seal(LightningElement.prototype);
7171
- /* version: 2.11.0 */
7247
+ /* version: 2.11.4 */
7172
7248
 
7173
7249
  exports.LightningElement = LightningElement;
7174
7250
  exports.__unstable__ProfilerControl = profilerControl;