lwc 2.23.0 → 2.23.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/engine-dom/esm/es2017/engine-dom.js +1208 -877
  2. package/dist/engine-dom/iife/es2017/engine-dom.js +1208 -876
  3. package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
  4. package/dist/engine-dom/iife/es2017/engine-dom_debug.js +1115 -812
  5. package/dist/engine-dom/iife/es5/engine-dom.js +473 -386
  6. package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
  7. package/dist/engine-dom/iife/es5/engine-dom_debug.js +424 -344
  8. package/dist/engine-dom/umd/es2017/engine-dom.js +1208 -876
  9. package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
  10. package/dist/engine-dom/umd/es2017/engine-dom_debug.js +1115 -812
  11. package/dist/engine-dom/umd/es5/engine-dom.js +473 -386
  12. package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
  13. package/dist/engine-dom/umd/es5/engine-dom_debug.js +424 -344
  14. package/dist/engine-server/commonjs/es2017/engine-server.js +803 -537
  15. package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
  16. package/dist/engine-server/esm/es2017/engine-server.js +803 -537
  17. package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +20 -20
  18. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +20 -20
  19. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +19 -19
  20. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +20 -20
  21. package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +19 -19
  22. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +20 -20
  23. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +19 -19
  24. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +20 -20
  25. package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +19 -19
  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 +17 -9
@@ -365,9 +365,13 @@ var LWC = (function (exports) {
365
365
  // Increment whenever the LWC template compiler changes
366
366
 
367
367
 
368
- var LWC_VERSION = "2.23.0";
368
+ var LWC_VERSION = "2.23.3";
369
369
  var LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
370
- /** version: 2.23.0 */
370
+ /** version: 2.23.3 */
371
+
372
+ /**
373
+ * Copyright (C) 2018 salesforce.com, inc.
374
+ */
371
375
 
372
376
  /*
373
377
  * Copyright (c) 2018, salesforce.com, inc.
@@ -377,7 +381,7 @@ var LWC = (function (exports) {
377
381
  */
378
382
 
379
383
  function detect(propName) {
380
- return Object.getOwnPropertyDescriptor(Element.prototype, propName) === undefined;
384
+ return getOwnPropertyDescriptor$1(Element.prototype, propName) === undefined;
381
385
  }
382
386
  /*
383
387
  * Copyright (c) 2018, salesforce.com, inc.
@@ -457,6 +461,8 @@ var LWC = (function (exports) {
457
461
  patch$1(propName);
458
462
  }
459
463
  }
464
+ /** version: 2.23.3 */
465
+
460
466
  /**
461
467
  * Copyright (C) 2018 salesforce.com, inc.
462
468
  */
@@ -477,6 +483,7 @@ var LWC = (function (exports) {
477
483
  ENABLE_HTML_COLLECTIONS_PATCH: null,
478
484
  ENABLE_INNER_OUTER_TEXT_PATCH: null,
479
485
  ENABLE_MIXED_SHADOW_MODE: null,
486
+ ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE: null,
480
487
  ENABLE_NODE_LIST_PATCH: null,
481
488
  ENABLE_NODE_PATCH: null,
482
489
  ENABLE_REACTIVE_SETTER: null,
@@ -489,7 +496,7 @@ var LWC = (function (exports) {
489
496
  });
490
497
  }
491
498
 
492
- var runtimeFlags = _globalThis.lwcRuntimeFlags;
499
+ var lwcRuntimeFlags = _globalThis.lwcRuntimeFlags;
493
500
  /**
494
501
  * Set the value at runtime of a given feature flag. This method only be invoked once per feature
495
502
  * flag. It is meant to be used during the app initialization.
@@ -519,10 +526,10 @@ var LWC = (function (exports) {
519
526
 
520
527
  if (process.env.NODE_ENV !== 'production') {
521
528
  // Allow the same flag to be set more than once outside of production to enable testing
522
- runtimeFlags[name] = value;
529
+ lwcRuntimeFlags[name] = value;
523
530
  } else {
524
531
  // Disallow the same flag to be set more than once in production
525
- var runtimeValue = runtimeFlags[name];
532
+ var runtimeValue = lwcRuntimeFlags[name];
526
533
 
527
534
  if (!isUndefined$1(runtimeValue)) {
528
535
  // eslint-disable-next-line no-console
@@ -530,7 +537,7 @@ var LWC = (function (exports) {
530
537
  return;
531
538
  }
532
539
 
533
- defineProperty(runtimeFlags, name, {
540
+ defineProperty(lwcRuntimeFlags, name, {
534
541
  value: value
535
542
  });
536
543
  }
@@ -546,7 +553,7 @@ var LWC = (function (exports) {
546
553
  setFeatureFlag(name, value);
547
554
  }
548
555
  }
549
- /** version: 2.23.0 */
556
+ /** version: 2.23.3 */
550
557
 
551
558
  /*
552
559
  * Copyright (c) 2018, salesforce.com, inc.
@@ -561,7 +568,7 @@ var LWC = (function (exports) {
561
568
  window.addEventListener('test-dummy-flag', function () {
562
569
  var hasFlag = false;
563
570
 
564
- if (runtimeFlags.DUMMY_TEST_FLAG) {
571
+ if (lwcRuntimeFlags.DUMMY_TEST_FLAG) {
565
572
  hasFlag = true;
566
573
  }
567
574
 
@@ -588,7 +595,7 @@ var LWC = (function (exports) {
588
595
  window.addEventListener('test-dummy-flag', function () {
589
596
  var hasFlag = false;
590
597
 
591
- if (runtimeFlags.DUMMY_TEST_FLAG) {
598
+ if (lwcRuntimeFlags.DUMMY_TEST_FLAG) {
592
599
  hasFlag = true;
593
600
  }
594
601
 
@@ -988,8 +995,8 @@ var LWC = (function (exports) {
988
995
  // to inject at runtime.
989
996
 
990
997
 
991
- var HTMLElementConstructor$1 = typeof HTMLElement !== 'undefined' ? HTMLElement : function () {};
992
- var HTMLElementPrototype = HTMLElementConstructor$1.prototype;
998
+ var HTMLElementConstructor = typeof HTMLElement !== 'undefined' ? HTMLElement : function () {};
999
+ var HTMLElementPrototype = HTMLElementConstructor.prototype;
993
1000
  /*
994
1001
  * Copyright (c) 2018, salesforce.com, inc.
995
1002
  * All rights reserved.
@@ -1209,10 +1216,10 @@ var LWC = (function (exports) {
1209
1216
  }; // Apply extra restriction related to DOM manipulation if the element is not a portal.
1210
1217
 
1211
1218
  if (!options.isLight && !options.isPortal) {
1212
- var _appendChild = elm.appendChild,
1213
- _insertBefore = elm.insertBefore,
1214
- _removeChild = elm.removeChild,
1215
- _replaceChild = elm.replaceChild;
1219
+ var appendChild = elm.appendChild,
1220
+ insertBefore = elm.insertBefore,
1221
+ removeChild = elm.removeChild,
1222
+ replaceChild = elm.replaceChild;
1216
1223
  var originalNodeValueDescriptor = getPropertyDescriptor(elm, 'nodeValue');
1217
1224
  var originalInnerHTMLDescriptor = getPropertyDescriptor(elm, 'innerHTML');
1218
1225
  var originalTextContentDescriptor = getPropertyDescriptor(elm, 'textContent');
@@ -1220,7 +1227,7 @@ var LWC = (function (exports) {
1220
1227
  appendChild: generateDataDescriptor({
1221
1228
  value: function value(aChild) {
1222
1229
  logMissingPortalError('appendChild', 'method');
1223
- return _appendChild.call(this, aChild);
1230
+ return appendChild.call(this, aChild);
1224
1231
  }
1225
1232
  }),
1226
1233
  insertBefore: generateDataDescriptor({
@@ -1229,7 +1236,7 @@ var LWC = (function (exports) {
1229
1236
  logMissingPortalError('insertBefore', 'method');
1230
1237
  }
1231
1238
 
1232
- return _insertBefore.call(this, newNode, referenceNode);
1239
+ return insertBefore.call(this, newNode, referenceNode);
1233
1240
  }
1234
1241
  }),
1235
1242
  removeChild: generateDataDescriptor({
@@ -1238,13 +1245,13 @@ var LWC = (function (exports) {
1238
1245
  logMissingPortalError('removeChild', 'method');
1239
1246
  }
1240
1247
 
1241
- return _removeChild.call(this, aChild);
1248
+ return removeChild.call(this, aChild);
1242
1249
  }
1243
1250
  }),
1244
1251
  replaceChild: generateDataDescriptor({
1245
1252
  value: function value(newChild, oldChild) {
1246
1253
  logMissingPortalError('replaceChild', 'method');
1247
- return _replaceChild.call(this, newChild, oldChild);
1254
+ return replaceChild.call(this, newChild, oldChild);
1248
1255
  }
1249
1256
  }),
1250
1257
  nodeValue: generateAccessorDescriptor({
@@ -2405,9 +2412,8 @@ var LWC = (function (exports) {
2405
2412
  var bridge = def.bridge;
2406
2413
 
2407
2414
  if (process.env.NODE_ENV !== 'production') {
2408
- var _assertInstanceOfHTMLElement = vm.renderer.assertInstanceOfHTMLElement;
2409
-
2410
- _assertInstanceOfHTMLElement(vm.elm, "Component creation requires a DOM element to be associated to ".concat(vm, "."));
2415
+ var assertInstanceOfHTMLElement = vm.renderer.assertInstanceOfHTMLElement;
2416
+ assertInstanceOfHTMLElement(vm.elm, "Component creation requires a DOM element to be associated to ".concat(vm, "."));
2411
2417
  }
2412
2418
 
2413
2419
  var component = this;
@@ -2911,7 +2917,7 @@ var LWC = (function (exports) {
2911
2917
  }
2912
2918
 
2913
2919
  if (_set2) {
2914
- if (runtimeFlags.ENABLE_REACTIVE_SETTER) {
2920
+ if (lwcRuntimeFlags.ENABLE_REACTIVE_SETTER) {
2915
2921
  var ro = vm.oar[key];
2916
2922
 
2917
2923
  if (isUndefined$1(ro)) {
@@ -3584,7 +3590,7 @@ var LWC = (function (exports) {
3584
3590
  return HTMLBridgeElement;
3585
3591
  }
3586
3592
 
3587
- var BaseBridgeElement = HTMLBridgeElementFactory(HTMLElementConstructor$1, getOwnPropertyNames$1(HTMLElementOriginalDescriptors), []);
3593
+ var BaseBridgeElement = HTMLBridgeElementFactory(HTMLElementConstructor, getOwnPropertyNames$1(HTMLElementOriginalDescriptors), []);
3588
3594
  freeze(BaseBridgeElement);
3589
3595
  seal(BaseBridgeElement.prototype);
3590
3596
  /*
@@ -3676,7 +3682,7 @@ var LWC = (function (exports) {
3676
3682
  throw new ReferenceError();
3677
3683
  }
3678
3684
 
3679
- if (runtimeFlags.ENABLE_HMR) {
3685
+ if (lwcRuntimeFlags.ENABLE_HMR) {
3680
3686
  var visited = new Set();
3681
3687
 
3682
3688
  while (swappedTemplateMap.has(tpl) && !visited.has(tpl)) {
@@ -3694,7 +3700,7 @@ var LWC = (function (exports) {
3694
3700
  throw new ReferenceError();
3695
3701
  }
3696
3702
 
3697
- if (runtimeFlags.ENABLE_HMR) {
3703
+ if (lwcRuntimeFlags.ENABLE_HMR) {
3698
3704
  var visited = new Set();
3699
3705
 
3700
3706
  while (swappedComponentMap.has(Ctor) && !visited.has(Ctor)) {
@@ -3712,7 +3718,7 @@ var LWC = (function (exports) {
3712
3718
  throw new ReferenceError();
3713
3719
  }
3714
3720
 
3715
- if (runtimeFlags.ENABLE_HMR) {
3721
+ if (lwcRuntimeFlags.ENABLE_HMR) {
3716
3722
  var visited = new Set();
3717
3723
 
3718
3724
  while (swappedStyleMap.has(style) && !visited.has(style)) {
@@ -3730,7 +3736,7 @@ var LWC = (function (exports) {
3730
3736
  throw new ReferenceError();
3731
3737
  }
3732
3738
 
3733
- if (runtimeFlags.ENABLE_HMR) {
3739
+ if (lwcRuntimeFlags.ENABLE_HMR) {
3734
3740
  // tracking active component
3735
3741
  var Ctor = vm.def.ctor;
3736
3742
  var componentVMs = activeComponents.get(Ctor);
@@ -3788,7 +3794,7 @@ var LWC = (function (exports) {
3788
3794
  throw new ReferenceError();
3789
3795
  }
3790
3796
 
3791
- if (runtimeFlags.ENABLE_HMR) {
3797
+ if (lwcRuntimeFlags.ENABLE_HMR) {
3792
3798
  // tracking inactive component
3793
3799
  var Ctor = vm.def.ctor;
3794
3800
  var list = activeComponents.get(Ctor);
@@ -3836,7 +3842,7 @@ var LWC = (function (exports) {
3836
3842
  }
3837
3843
  }
3838
3844
 
3839
- if (!runtimeFlags.ENABLE_HMR) {
3845
+ if (!lwcRuntimeFlags.ENABLE_HMR) {
3840
3846
  throw new Error('HMR is not enabled');
3841
3847
  }
3842
3848
 
@@ -3853,7 +3859,7 @@ var LWC = (function (exports) {
3853
3859
  }
3854
3860
  }
3855
3861
 
3856
- if (!runtimeFlags.ENABLE_HMR) {
3862
+ if (!lwcRuntimeFlags.ENABLE_HMR) {
3857
3863
  throw new Error('HMR is not enabled');
3858
3864
  }
3859
3865
 
@@ -3868,7 +3874,7 @@ var LWC = (function (exports) {
3868
3874
  return rehydrateHotStyle(oldStyle);
3869
3875
  }
3870
3876
 
3871
- if (!runtimeFlags.ENABLE_HMR) {
3877
+ if (!lwcRuntimeFlags.ENABLE_HMR) {
3872
3878
  throw new Error('HMR is not enabled');
3873
3879
  }
3874
3880
 
@@ -4379,6 +4385,18 @@ var LWC = (function (exports) {
4379
4385
  */
4380
4386
 
4381
4387
 
4388
+ function checkHasVM(elm) {
4389
+ var hasVM = !isUndefined$1(getAssociatedVMIfPresent(elm));
4390
+
4391
+ if (process.env.NODE_ENV !== 'production' && !hasVM) {
4392
+ // Occurs when an element is manually created with the same tag name as an existing LWC component. In that case,
4393
+ // we skip calling the LWC connectedCallback/disconnectedCallback logic and log an error.
4394
+ logError("VM for tag name \"".concat(elm.tagName.toLowerCase(), "\" is undefined. ") + "This indicates that an element was created with this tag name, " + "which is already reserved by an LWC component. Use lwc.createElement " + "instead to create elements.");
4395
+ }
4396
+
4397
+ return hasVM;
4398
+ }
4399
+
4382
4400
  function getUpgradableConstructor(tagName, renderer) {
4383
4401
  var getCustomElement = renderer.getCustomElement,
4384
4402
  RendererHTMLElement = renderer.HTMLElementExported,
@@ -4420,6 +4438,20 @@ var LWC = (function (exports) {
4420
4438
  return _createClass(LWCUpgradableElement);
4421
4439
  }(RendererHTMLElement);
4422
4440
 
4441
+ if (lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
4442
+ CE.prototype.connectedCallback = function () {
4443
+ if (checkHasVM(this)) {
4444
+ connectRootElement(this);
4445
+ }
4446
+ };
4447
+
4448
+ CE.prototype.disconnectedCallback = function () {
4449
+ if (checkHasVM(this)) {
4450
+ disconnectRootElement(this);
4451
+ }
4452
+ };
4453
+ }
4454
+
4423
4455
  defineCustomElement(tagName, CE);
4424
4456
  return CE;
4425
4457
  }
@@ -4531,6 +4563,15 @@ var LWC = (function (exports) {
4531
4563
  // different than the one previously set.
4532
4564
 
4533
4565
  if (isFirstPatch || cur !== (isLiveBindingProp(sel, key) ? getProperty(elm, key) : oldProps[key])) {
4566
+ // Additional verification if properties are supported by the element
4567
+ // Validation relies on html properties and public properties being defined on the element,
4568
+ // SSR has its own custom validation.
4569
+ if (process.env.NODE_ENV !== 'production') {
4570
+ if (!(key in elm)) {
4571
+ logWarn("Unknown public property \"".concat(key, "\" of element <").concat(elm.tagName.toLowerCase(), ">. This is either a typo on the corresponding attribute \"").concat(htmlPropertyToAttribute(key), "\", or the attribute does not exist in this browser or DOM implementation."));
4572
+ }
4573
+ }
4574
+
4534
4575
  setProperty(elm, key, cur);
4535
4576
  }
4536
4577
  }
@@ -4943,13 +4984,19 @@ var LWC = (function (exports) {
4943
4984
  insertNode(elm, parent, anchor, renderer);
4944
4985
 
4945
4986
  if (vm) {
4946
- if (process.env.NODE_ENV !== 'production') {
4947
- assert.isTrue(vm.state === 0
4948
- /* VMState.created */
4949
- , "".concat(vm, " cannot be recycled."));
4950
- }
4987
+ {
4988
+ if (!lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
4989
+ if (process.env.NODE_ENV !== 'production') {
4990
+ // With synthetic lifecycle callbacks, it's possible for elements to be removed without the engine
4991
+ // noticing it (e.g. `appendChild` the same host element twice). This test ensures we don't regress.
4992
+ assert.isTrue(vm.state === 0
4993
+ /* VMState.created */
4994
+ , "".concat(vm, " cannot be recycled."));
4995
+ }
4951
4996
 
4952
- runConnectedCallback(vm);
4997
+ runConnectedCallback(vm);
4998
+ }
4999
+ }
4953
5000
  }
4954
5001
 
4955
5002
  mountVNodes(vnode.children, elm, renderer, null);
@@ -5139,10 +5186,10 @@ var LWC = (function (exports) {
5139
5186
  var scopeToken = getScopeTokenClass(owner);
5140
5187
 
5141
5188
  if (!isNull(scopeToken)) {
5142
- var _getClassList = renderer.getClassList; // TODO [#2762]: this dot notation with add is probably problematic
5189
+ var getClassList = renderer.getClassList; // TODO [#2762]: this dot notation with add is probably problematic
5143
5190
  // probably we should have a renderer api for just the add operation
5144
5191
 
5145
- _getClassList(elm).add(scopeToken);
5192
+ getClassList(elm).add(scopeToken);
5146
5193
  } // Set property element for synthetic shadow DOM style scoping.
5147
5194
 
5148
5195
 
@@ -6748,7 +6795,7 @@ var LWC = (function (exports) {
6748
6795
  return "[object:vm ".concat(def.name, " (").concat(vm.idx, ")]");
6749
6796
  };
6750
6797
 
6751
- if (runtimeFlags.ENABLE_FORCE_NATIVE_SHADOW_MODE_FOR_TEST) {
6798
+ if (lwcRuntimeFlags.ENABLE_FORCE_NATIVE_SHADOW_MODE_FOR_TEST) {
6752
6799
  vm.shadowMode = 0
6753
6800
  /* ShadowMode.Native */
6754
6801
  ;
@@ -6783,7 +6830,7 @@ var LWC = (function (exports) {
6783
6830
  } else if (isNativeShadowDefined) {
6784
6831
  // Not combined with above condition because @lwc/features only supports identifiers in
6785
6832
  // the if-condition.
6786
- if (runtimeFlags.ENABLE_MIXED_SHADOW_MODE) {
6833
+ if (lwcRuntimeFlags.ENABLE_MIXED_SHADOW_MODE) {
6787
6834
  if (def.shadowSupportMode === "any"
6788
6835
  /* ShadowSupportMode.Any */
6789
6836
  ) {
@@ -7477,7 +7524,7 @@ var LWC = (function (exports) {
7477
7524
  ArrayPush$1.call(wiredConnecting, function () {
7478
7525
  connector.connect();
7479
7526
 
7480
- if (!runtimeFlags.ENABLE_WIRE_SYNC_EMIT) {
7527
+ if (!lwcRuntimeFlags.ENABLE_WIRE_SYNC_EMIT) {
7481
7528
  if (hasDynamicParams) {
7482
7529
  Promise.resolve().then(computeConfigAndUpdate);
7483
7530
  return;
@@ -7657,6 +7704,8 @@ var LWC = (function (exports) {
7657
7704
  return renderer.nextSibling(hydratedNode);
7658
7705
  }
7659
7706
 
7707
+ var NODE_VALUE_PROP = 'nodeValue';
7708
+
7660
7709
  function hydrateText(node, vnode, renderer) {
7661
7710
  var _a;
7662
7711
 
@@ -7667,9 +7716,8 @@ var LWC = (function (exports) {
7667
7716
  }
7668
7717
 
7669
7718
  if (process.env.NODE_ENV !== 'production') {
7670
- var _getProperty = renderer.getProperty;
7671
-
7672
- var nodeValue = _getProperty(node, 'nodeValue');
7719
+ var getProperty = renderer.getProperty;
7720
+ var nodeValue = getProperty(node, NODE_VALUE_PROP);
7673
7721
 
7674
7722
  if (nodeValue !== vnode.text && !(nodeValue === "\u200D" && vnode.text === '')) {
7675
7723
  logWarn('Hydration mismatch: text values do not match, will recover from the difference', vnode.owner);
@@ -7692,9 +7740,8 @@ var LWC = (function (exports) {
7692
7740
  }
7693
7741
 
7694
7742
  if (process.env.NODE_ENV !== 'production') {
7695
- var _getProperty2 = renderer.getProperty;
7696
-
7697
- var nodeValue = _getProperty2(node, 'nodeValue');
7743
+ var getProperty = renderer.getProperty;
7744
+ var nodeValue = getProperty(node, NODE_VALUE_PROP);
7698
7745
 
7699
7746
  if (nodeValue !== vnode.text) {
7700
7747
  logWarn('Hydration mismatch: comment values do not match, will recover from the difference', vnode.owner);
@@ -7702,7 +7749,7 @@ var LWC = (function (exports) {
7702
7749
  }
7703
7750
 
7704
7751
  var setProperty = renderer.setProperty;
7705
- setProperty(node, 'nodeValue', (_a = vnode.text) !== null && _a !== void 0 ? _a : null);
7752
+ setProperty(node, NODE_VALUE_PROP, (_a = vnode.text) !== null && _a !== void 0 ? _a : null);
7706
7753
  vnode.elm = node;
7707
7754
  return node;
7708
7755
  }
@@ -7734,17 +7781,17 @@ var LWC = (function (exports) {
7734
7781
  // it may be that this element has lwc:inner-html, we need to diff and in case are the same,
7735
7782
  // remove the innerHTML from props so it reuses the existing dom elements.
7736
7783
  var props = vnode.data.props;
7737
- var _getProperty3 = renderer.getProperty;
7784
+ var getProperty = renderer.getProperty;
7738
7785
 
7739
7786
  if (!isUndefined$1(props) && !isUndefined$1(props.innerHTML)) {
7740
- if (_getProperty3(elm, 'innerHTML') === props.innerHTML) {
7787
+ if (getProperty(elm, 'innerHTML') === props.innerHTML) {
7741
7788
  // Do a shallow clone since VNodeData may be shared across VNodes due to hoist optimization
7742
7789
  vnode.data = Object.assign(Object.assign({}, vnode.data), {
7743
7790
  props: cloneAndOmitKey(props, 'innerHTML')
7744
7791
  });
7745
7792
  } else {
7746
7793
  if (process.env.NODE_ENV !== 'production') {
7747
- logWarn("Mismatch hydrating element <".concat(_getProperty3(elm, 'tagName').toLowerCase(), ">: innerHTML values do not match for element, will recover from the difference"), owner);
7794
+ logWarn("Mismatch hydrating element <".concat(getProperty(elm, 'tagName').toLowerCase(), ">: innerHTML values do not match for element, will recover from the difference"), owner);
7748
7795
  }
7749
7796
  }
7750
7797
  }
@@ -7753,8 +7800,8 @@ var LWC = (function (exports) {
7753
7800
  patchElementPropsAndAttrs(vnode, renderer);
7754
7801
 
7755
7802
  if (!isDomManual) {
7756
- var _getFirstChild = renderer.getFirstChild;
7757
- hydrateChildren(_getFirstChild(elm), vnode.children, elm, owner);
7803
+ var getFirstChild = renderer.getFirstChild;
7804
+ hydrateChildren(getFirstChild(elm), vnode.children, elm, owner);
7758
7805
  }
7759
7806
 
7760
7807
  return elm;
@@ -7793,10 +7840,10 @@ var LWC = (function (exports) {
7793
7840
  if (vm.renderMode !== 0
7794
7841
  /* RenderMode.Light */
7795
7842
  ) {
7796
- var _getFirstChild2 = renderer.getFirstChild; // VM is not rendering in Light DOM, we can proceed and hydrate the slotted content.
7843
+ var getFirstChild = renderer.getFirstChild; // VM is not rendering in Light DOM, we can proceed and hydrate the slotted content.
7797
7844
  // Note: for Light DOM, this is handled while hydrating the VM
7798
7845
 
7799
- hydrateChildren(_getFirstChild2(elm), vnode.children, elm, vm);
7846
+ hydrateChildren(getFirstChild(elm), vnode.children, elm, vm);
7800
7847
  }
7801
7848
 
7802
7849
  hydrateVM(vm);
@@ -7845,11 +7892,11 @@ var LWC = (function (exports) {
7845
7892
  // next node in the list to be hydrated.
7846
7893
 
7847
7894
 
7848
- var _nextSibling = renderer.nextSibling;
7895
+ var nextSibling = renderer.nextSibling;
7849
7896
 
7850
7897
  do {
7851
7898
  var current = nextNode;
7852
- nextNode = _nextSibling(nextNode);
7899
+ nextNode = nextSibling(nextNode);
7853
7900
  removeNode(current, parentNode, renderer);
7854
7901
  } while (nextNode);
7855
7902
  }
@@ -7912,14 +7959,13 @@ var LWC = (function (exports) {
7912
7959
  attrValue = _Object$entries$_i[1];
7913
7960
 
7914
7961
  var owner = vnode.owner;
7915
- var _getAttribute = renderer.getAttribute;
7916
-
7917
- var elmAttrValue = _getAttribute(elm, attrName);
7962
+ var getAttribute = renderer.getAttribute;
7963
+ var elmAttrValue = getAttribute(elm, attrName);
7918
7964
 
7919
7965
  if (String(attrValue) !== elmAttrValue) {
7920
7966
  if (process.env.NODE_ENV !== 'production') {
7921
- var _getProperty4 = renderer.getProperty;
7922
- logError("Mismatch hydrating element <".concat(_getProperty4(elm, 'tagName').toLowerCase(), ">: attribute \"").concat(attrName, "\" has different values, expected \"").concat(attrValue, "\" but found \"").concat(elmAttrValue, "\""), owner);
7967
+ var getProperty = renderer.getProperty;
7968
+ logError("Mismatch hydrating element <".concat(getProperty(elm, 'tagName').toLowerCase(), ">: attribute \"").concat(attrName, "\" has different values, expected \"").concat(attrValue, "\" but found \"").concat(elmAttrValue, "\""), owner);
7923
7969
  }
7924
7970
 
7925
7971
  nodesAreCompatible = false;
@@ -8030,8 +8076,8 @@ var LWC = (function (exports) {
8030
8076
 
8031
8077
  if (!nodesAreCompatible) {
8032
8078
  if (process.env.NODE_ENV !== 'production') {
8033
- var _getProperty5 = renderer.getProperty;
8034
- logError("Mismatch hydrating element <".concat(_getProperty5(elm, 'tagName').toLowerCase(), ">: attribute \"style\" has different values, expected \"").concat(vnodeStyle, "\" but found \"").concat(elmStyle, "\"."), vnode.owner);
8079
+ var getProperty = renderer.getProperty;
8080
+ logError("Mismatch hydrating element <".concat(getProperty(elm, 'tagName').toLowerCase(), ">: attribute \"style\" has different values, expected \"").concat(vnodeStyle, "\" but found \"").concat(elmStyle, "\"."), vnode.owner);
8035
8081
  }
8036
8082
  }
8037
8083
 
@@ -8051,7 +8097,7 @@ var LWC = (function (exports) {
8051
8097
  return false;
8052
8098
  }
8053
8099
 
8054
- return getProperty(client, 'nodeValue') === getProperty(ssr, 'nodeValue');
8100
+ return getProperty(client, NODE_VALUE_PROP) === getProperty(ssr, NODE_VALUE_PROP);
8055
8101
  }
8056
8102
 
8057
8103
  if (getProperty(client, 'nodeType') === 8
@@ -8063,7 +8109,7 @@ var LWC = (function (exports) {
8063
8109
  return false;
8064
8110
  }
8065
8111
 
8066
- return getProperty(client, 'nodeValue') === getProperty(ssr, 'nodeValue');
8112
+ return getProperty(client, NODE_VALUE_PROP) === getProperty(ssr, NODE_VALUE_PROP);
8067
8113
  }
8068
8114
 
8069
8115
  if (!hasCorrectNodeType(vnode, ssr, 1
@@ -8263,7 +8309,7 @@ var LWC = (function (exports) {
8263
8309
 
8264
8310
  return ctor;
8265
8311
  }
8266
- /* version: 2.23.0 */
8312
+ /* version: 2.23.3 */
8267
8313
 
8268
8314
  /*
8269
8315
  * Copyright (c) 2018, salesforce.com, inc.
@@ -8430,361 +8476,395 @@ var LWC = (function (exports) {
8430
8476
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
8431
8477
  */
8432
8478
 
8479
+ /**
8480
+ * A factory function that produces a renderer.
8481
+ * Renderer encapsulates operations that are required to render an LWC component into the underlying
8482
+ * runtime environment. In the case of @lwc/enigne-dom, it is meant to be used in a DOM environment.
8483
+ * Example usage:
8484
+ * import { renderer, rendererFactory } from 'lwc';
8485
+ * const customRenderer = rendererFactory(renderer);
8486
+ *
8487
+ * @param baseRenderer Either null or the base renderer imported from 'lwc'.
8488
+ */
8433
8489
 
8434
- var SUPPORTS_TEMPLATE = typeof HTMLTemplateElement === 'function';
8435
- var createFragment;
8436
8490
 
8437
- if (SUPPORTS_TEMPLATE) {
8438
- // Parse the fragment HTML string into DOM
8439
- createFragment = function createFragment(html) {
8440
- var template = document.createElement('template');
8441
- template.innerHTML = html;
8442
- return template.content.firstChild;
8443
- };
8444
- } else {
8445
- // In browsers that don't support <template> (e.g. IE11), we need to be careful to wrap elements like
8446
- // <td> in the proper container elements (e.g. <tbody>), because otherwise they will be parsed as null.
8447
- // Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L273-L280
8448
- // With other elements added from:
8449
- // https://github.com/sindresorhus/html-tags/blob/95dcdd5/index.js
8450
- // Using the test:
8451
- // document.createRange().createContextualFragment(`<${tag}></${tag}>`).firstChild === null
8452
- // And omitting <html>, <head>, and <body> as these are not practical in an LWC component.
8453
- var topLevelWrappingMap = {
8454
- caption: ['table'],
8455
- col: ['colgroup', 'table'],
8456
- colgroup: ['table'],
8457
- option: ['select'],
8458
- tbody: ['table'],
8459
- td: ['tr', 'tbody', 'table'],
8460
- th: ['tr', 'tbody', 'table'],
8461
- thead: ['table'],
8462
- tfoot: ['table'],
8463
- tr: ['tbody', 'table']
8464
- }; // Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L282-L288
8465
-
8466
- var getTagName = function getTagName(text) {
8467
- return (/<([a-z][^/\0>\x20\t\r\n\f]+)/i.exec(text) || ['', ''])[1].toLowerCase();
8468
- }; // Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L295-L320
8469
-
8470
-
8471
- createFragment = function createFragment(html) {
8472
- var wrapperTags = topLevelWrappingMap[getTagName(html)];
8473
-
8474
- if (!isUndefined$1(wrapperTags)) {
8475
- var _iterator5 = _createForOfIteratorHelper(wrapperTags),
8476
- _step5;
8491
+ function rendererFactory(baseRenderer) {
8492
+ // Util functions
8493
+ function assertInvariant(value, msg) {
8494
+ if (!value) {
8495
+ throw new Error("Invariant Violation: ".concat(msg));
8496
+ }
8497
+ }
8477
8498
 
8478
- try {
8479
- for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
8480
- var wrapperTag = _step5.value;
8481
- html = "<".concat(wrapperTag, ">").concat(html, "</").concat(wrapperTag, ">");
8482
- }
8483
- } catch (err) {
8484
- _iterator5.e(err);
8485
- } finally {
8486
- _iterator5.f();
8487
- }
8488
- } // For IE11, the document title must not be undefined, but it can be an empty string
8489
- // https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createHTMLDocument#browser_compatibility
8499
+ function isNull(obj) {
8500
+ return obj === null;
8501
+ }
8490
8502
 
8503
+ function isUndefined(obj) {
8504
+ return obj === undefined;
8505
+ }
8491
8506
 
8492
- var doc = document.implementation.createHTMLDocument('');
8493
- doc.body.innerHTML = html;
8494
- var content = doc.body;
8507
+ var getCustomElement;
8508
+ var defineCustomElement;
8509
+ var HTMLElementConstructor;
8495
8510
 
8496
- if (!isUndefined$1(wrapperTags)) {
8497
- for (var _i32 = 0; _i32 < wrapperTags.length; _i32++) {
8498
- content = content.firstChild;
8499
- }
8511
+ function isCustomElementRegistryAvailable() {
8512
+ if (typeof customElements === 'undefined') {
8513
+ return false;
8500
8514
  }
8501
8515
 
8502
- return content.firstChild;
8503
- };
8504
- }
8505
- /*
8506
- * Copyright (c) 2018, salesforce.com, inc.
8507
- * All rights reserved.
8508
- * SPDX-License-Identifier: MIT
8509
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
8510
- */
8516
+ try {
8517
+ // dereference HTMLElement global because babel wraps globals in compat mode with a
8518
+ // _wrapNativeSuper()
8519
+ // This is a problem because LWCUpgradableElement extends renderer.HTMLElementExported which does not
8520
+ // get wrapped by babel.
8521
+ var HTMLElementAlias = HTMLElement; // In case we use compat mode with a modern browser, the compat mode transformation
8522
+ // invokes the DOM api with an .apply() or .call() to initialize any DOM api sub-classing,
8523
+ // which are not equipped to be initialized that way.
8511
8524
 
8525
+ var clazz = /*#__PURE__*/function (_HTMLElementAlias) {
8526
+ _inherits(clazz, _HTMLElementAlias);
8512
8527
 
8513
- var getCustomElement;
8514
- var defineCustomElement;
8515
- var HTMLElementConstructor;
8528
+ var _super7 = _createSuper(clazz);
8516
8529
 
8517
- function isCustomElementRegistryAvailable() {
8518
- if (typeof customElements === 'undefined') {
8519
- return false;
8530
+ function clazz() {
8531
+ _classCallCheck(this, clazz);
8532
+
8533
+ return _super7.apply(this, arguments);
8534
+ }
8535
+
8536
+ return _createClass(clazz);
8537
+ }(HTMLElementAlias);
8538
+
8539
+ customElements.define('lwc-test-' + Math.floor(Math.random() * 1000000), clazz);
8540
+ new clazz();
8541
+ return true;
8542
+ } catch (_a) {
8543
+ return false;
8544
+ }
8520
8545
  }
8521
8546
 
8522
- try {
8523
- // dereference HTMLElement global because babel wraps globals in compat mode with a
8524
- // _wrapNativeSuper()
8525
- // This is a problem because LWCUpgradableElement extends renderer.HTMLElementExported which does not
8526
- // get wrapped by babel.
8527
- var HTMLElementAlias = HTMLElement; // In case we use compat mode with a modern browser, the compat mode transformation
8528
- // invokes the DOM api with an .apply() or .call() to initialize any DOM api sub-classing,
8529
- // which are not equipped to be initialized that way.
8547
+ if (isCustomElementRegistryAvailable()) {
8548
+ getCustomElement = customElements.get.bind(customElements);
8549
+ defineCustomElement = customElements.define.bind(customElements);
8550
+ HTMLElementConstructor = HTMLElement;
8551
+ } else {
8552
+ var registry = Object.create(null);
8553
+ var reverseRegistry = new WeakMap();
8554
+
8555
+ defineCustomElement = function define(name, ctor) {
8556
+ if (name !== String.prototype.toLowerCase.call(name) || registry[name]) {
8557
+ throw new TypeError("Invalid Registration");
8558
+ }
8559
+
8560
+ registry[name] = ctor;
8561
+ reverseRegistry.set(ctor, name);
8562
+ };
8530
8563
 
8531
- var clazz = /*#__PURE__*/function (_HTMLElementAlias) {
8532
- _inherits(clazz, _HTMLElementAlias);
8564
+ getCustomElement = function get(name) {
8565
+ return registry[name];
8566
+ };
8533
8567
 
8534
- var _super7 = _createSuper(clazz);
8568
+ HTMLElementConstructor = function HTMLElement() {
8569
+ if (!(this instanceof HTMLElement)) {
8570
+ throw new TypeError("Invalid Invocation");
8571
+ }
8535
8572
 
8536
- function clazz() {
8537
- _classCallCheck(this, clazz);
8573
+ var constructor = this.constructor;
8574
+ var name = reverseRegistry.get(constructor);
8538
8575
 
8539
- return _super7.apply(this, arguments);
8576
+ if (!name) {
8577
+ throw new TypeError("Invalid Construction");
8540
8578
  }
8541
8579
 
8542
- return _createClass(clazz);
8543
- }(HTMLElementAlias);
8580
+ var elm = document.createElement(name);
8581
+ Object.setPrototypeOf(elm, constructor.prototype);
8582
+ return elm;
8583
+ };
8544
8584
 
8545
- customElements.define('lwc-test-' + Math.floor(Math.random() * 1000000), clazz);
8546
- new clazz();
8547
- return true;
8548
- } catch (_a) {
8549
- return false;
8585
+ HTMLElementConstructor.prototype = HTMLElement.prototype;
8550
8586
  }
8551
- }
8552
8587
 
8553
- if (isCustomElementRegistryAvailable()) {
8554
- getCustomElement = customElements.get.bind(customElements);
8555
- defineCustomElement = customElements.define.bind(customElements);
8556
- HTMLElementConstructor = HTMLElement;
8557
- } else {
8558
- var registry = create(null);
8559
- var reverseRegistry = new WeakMap();
8588
+ function cloneNode(node, deep) {
8589
+ return node.cloneNode(deep);
8590
+ }
8560
8591
 
8561
- defineCustomElement = function define(name, ctor) {
8562
- if (name !== StringToLowerCase.call(name) || registry[name]) {
8563
- throw new TypeError("Invalid Registration");
8564
- }
8592
+ function createElement(tagName, namespace) {
8593
+ return isUndefined(namespace) ? document.createElement(tagName) : document.createElementNS(namespace, tagName);
8594
+ }
8565
8595
 
8566
- registry[name] = ctor;
8567
- reverseRegistry.set(ctor, name);
8568
- };
8596
+ function createText(content) {
8597
+ return document.createTextNode(content);
8598
+ }
8569
8599
 
8570
- getCustomElement = function get(name) {
8571
- return registry[name];
8572
- };
8600
+ function createComment(content) {
8601
+ return document.createComment(content);
8602
+ }
8573
8603
 
8574
- HTMLElementConstructor = function HTMLElement() {
8575
- if (!(this instanceof HTMLElement)) {
8576
- throw new TypeError("Invalid Invocation");
8577
- }
8604
+ var createFragment; // IE11 lacks support for this feature
8578
8605
 
8579
- var constructor = this.constructor;
8580
- var name = reverseRegistry.get(constructor);
8606
+ var SUPPORTS_TEMPLATE = typeof HTMLTemplateElement === 'function';
8581
8607
 
8582
- if (!name) {
8583
- throw new TypeError("Invalid Construction");
8584
- }
8608
+ if (SUPPORTS_TEMPLATE) {
8609
+ // Parse the fragment HTML string into DOM
8610
+ createFragment = function createFragment(html) {
8611
+ var template = document.createElement('template');
8612
+ template.innerHTML = html;
8613
+ return template.content.firstChild;
8614
+ };
8615
+ } else {
8616
+ // In browsers that don't support <template> (e.g. IE11), we need to be careful to wrap elements like
8617
+ // <td> in the proper container elements (e.g. <tbody>), because otherwise they will be parsed as null.
8618
+ // Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L273-L280
8619
+ // With other elements added from:
8620
+ // https://github.com/sindresorhus/html-tags/blob/95dcdd5/index.js
8621
+ // Using the test:
8622
+ // document.createRange().createContextualFragment(`<${tag}></${tag}>`).firstChild === null
8623
+ // And omitting <html>, <head>, and <body> as these are not practical in an LWC component.
8624
+ var topLevelWrappingMap = {
8625
+ caption: ['table'],
8626
+ col: ['colgroup', 'table'],
8627
+ colgroup: ['table'],
8628
+ option: ['select'],
8629
+ tbody: ['table'],
8630
+ td: ['tr', 'tbody', 'table'],
8631
+ th: ['tr', 'tbody', 'table'],
8632
+ thead: ['table'],
8633
+ tfoot: ['table'],
8634
+ tr: ['tbody', 'table']
8635
+ }; // Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L282-L288
8636
+
8637
+ var getTagName = function getTagName(text) {
8638
+ return (/<([a-z][^/\0>\x20\t\r\n\f]+)/i.exec(text) || ['', ''])[1].toLowerCase();
8639
+ }; // Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L295-L320
8640
+
8641
+
8642
+ createFragment = function createFragment(html) {
8643
+ var wrapperTags = topLevelWrappingMap[getTagName(html)];
8644
+
8645
+ if (!isUndefined(wrapperTags)) {
8646
+ var _iterator5 = _createForOfIteratorHelper(wrapperTags),
8647
+ _step5;
8648
+
8649
+ try {
8650
+ for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
8651
+ var wrapperTag = _step5.value;
8652
+ html = "<".concat(wrapperTag, ">").concat(html, "</").concat(wrapperTag, ">");
8653
+ }
8654
+ } catch (err) {
8655
+ _iterator5.e(err);
8656
+ } finally {
8657
+ _iterator5.f();
8658
+ }
8659
+ } // For IE11, the document title must not be undefined, but it can be an empty string
8660
+ // https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createHTMLDocument#browser_compatibility
8585
8661
 
8586
- var elm = document.createElement(name);
8587
- setPrototypeOf(elm, constructor.prototype);
8588
- return elm;
8589
- };
8590
8662
 
8591
- HTMLElementConstructor.prototype = HTMLElement.prototype;
8592
- }
8663
+ var doc = document.implementation.createHTMLDocument('');
8664
+ doc.body.innerHTML = html;
8665
+ var content = doc.body;
8593
8666
 
8594
- var isNativeShadowDefined = _globalThis[KEY__IS_NATIVE_SHADOW_ROOT_DEFINED];
8595
- var isSyntheticShadowDefined = hasOwnProperty$1.call(Element.prototype, KEY__SHADOW_TOKEN);
8667
+ if (!isUndefined(wrapperTags)) {
8668
+ for (var _i32 = 0; _i32 < wrapperTags.length; _i32++) {
8669
+ content = content.firstChild;
8670
+ }
8671
+ }
8596
8672
 
8597
- function cloneNode(node, deep) {
8598
- return node.cloneNode(deep);
8599
- }
8673
+ return content.firstChild;
8674
+ };
8675
+ }
8600
8676
 
8601
- function createElement$1(tagName, namespace) {
8602
- return isUndefined$1(namespace) ? document.createElement(tagName) : document.createElementNS(namespace, tagName);
8603
- }
8677
+ function insert(node, parent, anchor) {
8678
+ parent.insertBefore(node, anchor);
8679
+ }
8604
8680
 
8605
- function createText(content) {
8606
- return document.createTextNode(content);
8607
- }
8681
+ function remove(node, parent) {
8682
+ parent.removeChild(node);
8683
+ }
8608
8684
 
8609
- function createComment(content) {
8610
- return document.createComment(content);
8611
- }
8685
+ function nextSibling(node) {
8686
+ return node.nextSibling;
8687
+ }
8612
8688
 
8613
- function insert(node, parent, anchor) {
8614
- parent.insertBefore(node, anchor);
8615
- }
8689
+ function attachShadow(element, options) {
8690
+ // `shadowRoot` will be non-null in two cases:
8691
+ // 1. upon initial load with an SSR-generated DOM, while in Shadow render mode
8692
+ // 2. when a webapp author places <c-app> in their static HTML and mounts their
8693
+ // root component with customElement.define('c-app', Ctor)
8694
+ if (!isNull(element.shadowRoot)) {
8695
+ return element.shadowRoot;
8696
+ }
8616
8697
 
8617
- function remove(node, parent) {
8618
- parent.removeChild(node);
8619
- }
8698
+ return element.attachShadow(options);
8699
+ }
8620
8700
 
8621
- function nextSibling(node) {
8622
- return node.nextSibling;
8623
- }
8701
+ function setText(node, content) {
8702
+ node.nodeValue = content;
8703
+ }
8624
8704
 
8625
- function attachShadow(element, options) {
8626
- // `shadowRoot` will be non-null in two cases:
8627
- // 1. upon initial load with an SSR-generated DOM, while in Shadow render mode
8628
- // 2. when a webapp author places <c-app> in their static HTML and mounts their
8629
- // root component with customElement.define('c-app', Ctor)
8630
- if (!isNull(element.shadowRoot)) {
8631
- return element.shadowRoot;
8705
+ function getProperty(node, key) {
8706
+ return node[key];
8632
8707
  }
8633
8708
 
8634
- return element.attachShadow(options);
8635
- }
8709
+ function setProperty(node, key, value) {
8710
+ node[key] = value;
8711
+ }
8636
8712
 
8637
- function setText(node, content) {
8638
- node.nodeValue = content;
8639
- }
8713
+ function getAttribute(element, name, namespace) {
8714
+ return isUndefined(namespace) ? element.getAttribute(name) : element.getAttributeNS(namespace, name);
8715
+ }
8640
8716
 
8641
- function getProperty(node, key) {
8642
- return node[key];
8643
- }
8717
+ function setAttribute(element, name, value, namespace) {
8718
+ return isUndefined(namespace) ? element.setAttribute(name, value) : element.setAttributeNS(namespace, name, value);
8719
+ }
8644
8720
 
8645
- function setProperty(node, key, value) {
8646
- if (process.env.NODE_ENV !== 'production') {
8647
- if (node instanceof Element && !(key in node)) {
8648
- // TODO [#1297]: Move this validation to the compiler
8649
- assert.fail("Unknown public property \"".concat(key, "\" of element <").concat(node.tagName, ">. This is likely a typo on the corresponding attribute \"").concat(htmlPropertyToAttribute(key), "\"."));
8721
+ function removeAttribute(element, name, namespace) {
8722
+ if (isUndefined(namespace)) {
8723
+ element.removeAttribute(name);
8724
+ } else {
8725
+ element.removeAttributeNS(namespace, name);
8650
8726
  }
8651
8727
  }
8652
8728
 
8653
- node[key] = value;
8654
- }
8729
+ function addEventListener(target, type, callback, options) {
8730
+ target.addEventListener(type, callback, options);
8731
+ }
8655
8732
 
8656
- function getAttribute(element, name, namespace) {
8657
- return isUndefined$1(namespace) ? element.getAttribute(name) : element.getAttributeNS(namespace, name);
8658
- }
8733
+ function removeEventListener(target, type, callback, options) {
8734
+ target.removeEventListener(type, callback, options);
8735
+ }
8659
8736
 
8660
- function setAttribute(element, name, value, namespace) {
8661
- return isUndefined$1(namespace) ? element.setAttribute(name, value) : element.setAttributeNS(namespace, name, value);
8662
- }
8737
+ function dispatchEvent(target, event) {
8738
+ return target.dispatchEvent(event);
8739
+ }
8663
8740
 
8664
- function removeAttribute(element, name, namespace) {
8665
- if (isUndefined$1(namespace)) {
8666
- element.removeAttribute(name);
8667
- } else {
8668
- element.removeAttributeNS(namespace, name);
8741
+ function getClassList(element) {
8742
+ return element.classList;
8669
8743
  }
8670
- }
8671
8744
 
8672
- function addEventListener(target, type, callback, options) {
8673
- target.addEventListener(type, callback, options);
8674
- }
8745
+ function setCSSStyleProperty(element, name, value, important) {
8746
+ // TODO [#0]: How to avoid this type casting? Shall we use a different type interface to
8747
+ // represent elements in the engine?
8748
+ element.style.setProperty(name, value, important ? 'important' : '');
8749
+ }
8675
8750
 
8676
- function removeEventListener(target, type, callback, options) {
8677
- target.removeEventListener(type, callback, options);
8678
- }
8751
+ function getBoundingClientRect(element) {
8752
+ return element.getBoundingClientRect();
8753
+ }
8679
8754
 
8680
- function dispatchEvent(target, event) {
8681
- return target.dispatchEvent(event);
8682
- }
8755
+ function querySelector(element, selectors) {
8756
+ return element.querySelector(selectors);
8757
+ }
8683
8758
 
8684
- function getClassList(element) {
8685
- return element.classList;
8686
- }
8759
+ function querySelectorAll(element, selectors) {
8760
+ return element.querySelectorAll(selectors);
8761
+ }
8687
8762
 
8688
- function setCSSStyleProperty(element, name, value, important) {
8689
- // TODO [#0]: How to avoid this type casting? Shall we use a different type interface to
8690
- // represent elements in the engine?
8691
- element.style.setProperty(name, value, important ? 'important' : '');
8692
- }
8763
+ function getElementsByTagName(element, tagNameOrWildCard) {
8764
+ return element.getElementsByTagName(tagNameOrWildCard);
8765
+ }
8693
8766
 
8694
- function getBoundingClientRect(element) {
8695
- return element.getBoundingClientRect();
8696
- }
8767
+ function getElementsByClassName(element, names) {
8768
+ return element.getElementsByClassName(names);
8769
+ }
8697
8770
 
8698
- function querySelector(element, selectors) {
8699
- return element.querySelector(selectors);
8700
- }
8771
+ function getChildren(element) {
8772
+ return element.children;
8773
+ }
8701
8774
 
8702
- function querySelectorAll(element, selectors) {
8703
- return element.querySelectorAll(selectors);
8704
- }
8775
+ function getChildNodes(element) {
8776
+ return element.childNodes;
8777
+ }
8705
8778
 
8706
- function getElementsByTagName(element, tagNameOrWildCard) {
8707
- return element.getElementsByTagName(tagNameOrWildCard);
8708
- }
8779
+ function getFirstChild(element) {
8780
+ return element.firstChild;
8781
+ }
8709
8782
 
8710
- function getElementsByClassName(element, names) {
8711
- return element.getElementsByClassName(names);
8712
- }
8783
+ function getFirstElementChild(element) {
8784
+ return element.firstElementChild;
8785
+ }
8713
8786
 
8714
- function getChildren(element) {
8715
- return element.children;
8716
- }
8787
+ function getLastChild(element) {
8788
+ return element.lastChild;
8789
+ }
8717
8790
 
8718
- function getChildNodes(element) {
8719
- return element.childNodes;
8720
- }
8791
+ function getLastElementChild(element) {
8792
+ return element.lastElementChild;
8793
+ }
8721
8794
 
8722
- function getFirstChild(element) {
8723
- return element.firstChild;
8724
- }
8795
+ function isConnected(node) {
8796
+ return node.isConnected;
8797
+ }
8725
8798
 
8726
- function getFirstElementChild(element) {
8727
- return element.firstElementChild;
8728
- }
8799
+ function assertInstanceOfHTMLElement(elm, msg) {
8800
+ assertInvariant(elm instanceof HTMLElement, msg);
8801
+ }
8729
8802
 
8730
- function getLastChild(element) {
8731
- return element.lastChild;
8732
- }
8803
+ var HTMLElementExported = HTMLElementConstructor;
8804
+ var renderer = {
8805
+ HTMLElementExported: HTMLElementExported,
8806
+ insert: insert,
8807
+ remove: remove,
8808
+ cloneNode: cloneNode,
8809
+ createFragment: createFragment,
8810
+ createElement: createElement,
8811
+ createText: createText,
8812
+ createComment: createComment,
8813
+ nextSibling: nextSibling,
8814
+ attachShadow: attachShadow,
8815
+ getProperty: getProperty,
8816
+ setProperty: setProperty,
8817
+ setText: setText,
8818
+ getAttribute: getAttribute,
8819
+ setAttribute: setAttribute,
8820
+ removeAttribute: removeAttribute,
8821
+ addEventListener: addEventListener,
8822
+ removeEventListener: removeEventListener,
8823
+ dispatchEvent: dispatchEvent,
8824
+ getClassList: getClassList,
8825
+ setCSSStyleProperty: setCSSStyleProperty,
8826
+ getBoundingClientRect: getBoundingClientRect,
8827
+ querySelector: querySelector,
8828
+ querySelectorAll: querySelectorAll,
8829
+ getElementsByTagName: getElementsByTagName,
8830
+ getElementsByClassName: getElementsByClassName,
8831
+ getChildren: getChildren,
8832
+ getChildNodes: getChildNodes,
8833
+ getFirstChild: getFirstChild,
8834
+ getFirstElementChild: getFirstElementChild,
8835
+ getLastChild: getLastChild,
8836
+ getLastElementChild: getLastElementChild,
8837
+ isConnected: isConnected,
8838
+ assertInstanceOfHTMLElement: assertInstanceOfHTMLElement,
8839
+ defineCustomElement: defineCustomElement,
8840
+ getCustomElement: getCustomElement
8841
+ }; // Meant to inherit any properties passed via the base renderer as the argument to the factory.
8733
8842
 
8734
- function getLastElementChild(element) {
8735
- return element.lastElementChild;
8843
+ Object.setPrototypeOf(renderer, baseRenderer);
8844
+ return renderer;
8736
8845
  }
8846
+ /*
8847
+ * Copyright (c) 2018, salesforce.com, inc.
8848
+ * All rights reserved.
8849
+ * SPDX-License-Identifier: MIT
8850
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
8851
+ */
8737
8852
 
8738
- function isConnected(node) {
8739
- return node.isConnected;
8740
- }
8853
+ /**
8854
+ * The base renderer that will be used by engine-core.
8855
+ * This will be used for DOM operations when lwc is running in a browser environment.
8856
+ */
8741
8857
 
8742
- function assertInstanceOfHTMLElement(elm, msg) {
8743
- assert.invariant(elm instanceof HTMLElement, msg);
8744
- }
8745
8858
 
8746
- var HTMLElementExported = HTMLElementConstructor;
8747
- var renderer = {
8748
- isNativeShadowDefined: isNativeShadowDefined,
8749
- isSyntheticShadowDefined: isSyntheticShadowDefined,
8750
- HTMLElementExported: HTMLElementExported,
8751
- insert: insert,
8752
- remove: remove,
8753
- cloneNode: cloneNode,
8754
- createFragment: createFragment,
8755
- createElement: createElement$1,
8756
- createText: createText,
8757
- createComment: createComment,
8758
- nextSibling: nextSibling,
8759
- attachShadow: attachShadow,
8760
- getProperty: getProperty,
8761
- setProperty: setProperty,
8762
- setText: setText,
8763
- getAttribute: getAttribute,
8764
- setAttribute: setAttribute,
8765
- removeAttribute: removeAttribute,
8766
- addEventListener: addEventListener,
8767
- removeEventListener: removeEventListener,
8768
- dispatchEvent: dispatchEvent,
8769
- getClassList: getClassList,
8770
- setCSSStyleProperty: setCSSStyleProperty,
8771
- getBoundingClientRect: getBoundingClientRect,
8772
- querySelector: querySelector,
8773
- querySelectorAll: querySelectorAll,
8774
- getElementsByTagName: getElementsByTagName,
8775
- getElementsByClassName: getElementsByClassName,
8776
- getChildren: getChildren,
8777
- getChildNodes: getChildNodes,
8778
- getFirstChild: getFirstChild,
8779
- getFirstElementChild: getFirstElementChild,
8780
- getLastChild: getLastChild,
8781
- getLastElementChild: getLastElementChild,
8782
- isConnected: isConnected,
8859
+ var renderer = assign( // The base renderer will invoke the factory with null and assign additional properties that are
8860
+ // shared across renderers
8861
+ rendererFactory(null), // Properties that are either not required to be sandboxed or rely on a globally shared information
8862
+ {
8863
+ // insertStyleSheet implementation shares a global cache of stylesheet data
8783
8864
  insertStylesheet: insertStylesheet,
8784
- assertInstanceOfHTMLElement: assertInstanceOfHTMLElement,
8785
- defineCustomElement: defineCustomElement,
8786
- getCustomElement: getCustomElement
8787
- };
8865
+ isNativeShadowDefined: _globalThis[KEY__IS_NATIVE_SHADOW_ROOT_DEFINED],
8866
+ isSyntheticShadowDefined: hasOwnProperty$1.call(Element.prototype, KEY__SHADOW_TOKEN)
8867
+ });
8788
8868
  /*
8789
8869
  * Copyright (c) 2018, salesforce.com, inc.
8790
8870
  * All rights reserved.
@@ -8956,7 +9036,6 @@ var LWC = (function (exports) {
8956
9036
  * SPDX-License-Identifier: MIT
8957
9037
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
8958
9038
  */
8959
- // TODO [#2472]: Remove this workaround when appropriate.
8960
9039
  // eslint-disable-next-line @lwc/lwc-internal/no-global-node
8961
9040
 
8962
9041
 
@@ -8976,39 +9055,41 @@ var LWC = (function (exports) {
8976
9055
  }
8977
9056
 
8978
9057
  return node; // for convenience
8979
- } // Monkey patching Node methods to be able to detect the insertions and removal of root elements
8980
- // created via createElement.
8981
-
9058
+ }
8982
9059
 
8983
- var _Node$1$prototype = _Node$1.prototype,
8984
- _appendChild2 = _Node$1$prototype.appendChild,
8985
- _insertBefore2 = _Node$1$prototype.insertBefore,
8986
- _removeChild2 = _Node$1$prototype.removeChild,
8987
- _replaceChild2 = _Node$1$prototype.replaceChild;
8988
- assign(_Node$1.prototype, {
8989
- appendChild: function appendChild(newChild) {
8990
- var appendedNode = _appendChild2.call(this, newChild);
9060
+ if (!lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
9061
+ // Monkey patching Node methods to be able to detect the insertions and removal of root elements
9062
+ // created via createElement.
9063
+ var _Node$1$prototype = _Node$1.prototype,
9064
+ _appendChild = _Node$1$prototype.appendChild,
9065
+ _insertBefore = _Node$1$prototype.insertBefore,
9066
+ _removeChild = _Node$1$prototype.removeChild,
9067
+ _replaceChild = _Node$1$prototype.replaceChild;
9068
+ assign(_Node$1.prototype, {
9069
+ appendChild: function appendChild(newChild) {
9070
+ var appendedNode = _appendChild.call(this, newChild);
8991
9071
 
8992
- return callNodeSlot(appendedNode, ConnectingSlot);
8993
- },
8994
- insertBefore: function insertBefore(newChild, referenceNode) {
8995
- var insertedNode = _insertBefore2.call(this, newChild, referenceNode);
9072
+ return callNodeSlot(appendedNode, ConnectingSlot);
9073
+ },
9074
+ insertBefore: function insertBefore(newChild, referenceNode) {
9075
+ var insertedNode = _insertBefore.call(this, newChild, referenceNode);
8996
9076
 
8997
- return callNodeSlot(insertedNode, ConnectingSlot);
8998
- },
8999
- removeChild: function removeChild(oldChild) {
9000
- var removedNode = _removeChild2.call(this, oldChild);
9077
+ return callNodeSlot(insertedNode, ConnectingSlot);
9078
+ },
9079
+ removeChild: function removeChild(oldChild) {
9080
+ var removedNode = _removeChild.call(this, oldChild);
9001
9081
 
9002
- return callNodeSlot(removedNode, DisconnectingSlot);
9003
- },
9004
- replaceChild: function replaceChild(newChild, oldChild) {
9005
- var replacedNode = _replaceChild2.call(this, newChild, oldChild);
9082
+ return callNodeSlot(removedNode, DisconnectingSlot);
9083
+ },
9084
+ replaceChild: function replaceChild(newChild, oldChild) {
9085
+ var replacedNode = _replaceChild.call(this, newChild, oldChild);
9006
9086
 
9007
- callNodeSlot(replacedNode, DisconnectingSlot);
9008
- callNodeSlot(newChild, ConnectingSlot);
9009
- return replacedNode;
9010
- }
9011
- });
9087
+ callNodeSlot(replacedNode, DisconnectingSlot);
9088
+ callNodeSlot(newChild, ConnectingSlot);
9089
+ return replacedNode;
9090
+ }
9091
+ });
9092
+ }
9012
9093
  /**
9013
9094
  * EXPERIMENTAL: This function is almost identical to document.createElement with the slightly
9014
9095
  * difference that in the options, you can pass the `is` property set to a Constructor instead of
@@ -9021,6 +9102,7 @@ var LWC = (function (exports) {
9021
9102
  * ```
9022
9103
  */
9023
9104
 
9105
+
9024
9106
  function createElement(sel, options) {
9025
9107
  if (!isObject(options) || isNull(options)) {
9026
9108
  throw new TypeError("\"createElement\" function expects an object as second parameter but received \"".concat(toString$1(options), "\"."));
@@ -9048,8 +9130,12 @@ var LWC = (function (exports) {
9048
9130
  mode: options.mode !== 'closed' ? 'open' : 'closed',
9049
9131
  owner: null
9050
9132
  });
9051
- ConnectingSlot.set(elm, connectRootElement);
9052
- DisconnectingSlot.set(elm, disconnectRootElement);
9133
+
9134
+ if (!lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
9135
+ ConnectingSlot.set(elm, connectRootElement);
9136
+ DisconnectingSlot.set(elm, disconnectRootElement);
9137
+ }
9138
+
9053
9139
  wasComponentUpgraded = true;
9054
9140
  });
9055
9141
 
@@ -9096,7 +9182,7 @@ var LWC = (function (exports) {
9096
9182
  // inserted nodes without the `lwc:dom=manual` directive will be considered as global elements.
9097
9183
 
9098
9184
 
9099
- return isSyntheticShadowDefined && !isUndefined$1(node[KEY__SHADOW_RESOLVER]);
9185
+ return renderer.isSyntheticShadowDefined && !isUndefined$1(node[KEY__SHADOW_RESOLVER]);
9100
9186
  }
9101
9187
  /*
9102
9188
  * Copyright (c) 2018, salesforce.com, inc.
@@ -9140,7 +9226,7 @@ var LWC = (function (exports) {
9140
9226
  });
9141
9227
  freeze(LightningElement);
9142
9228
  seal(LightningElement.prototype);
9143
- /* version: 2.23.0 */
9229
+ /* version: 2.23.3 */
9144
9230
 
9145
9231
  exports.LightningElement = LightningElement;
9146
9232
  exports.__unstable__ProfilerControl = profilerControl;
@@ -9162,6 +9248,7 @@ var LWC = (function (exports) {
9162
9248
  exports.registerDecorators = registerDecorators;
9163
9249
  exports.registerTemplate = registerTemplate;
9164
9250
  exports.renderer = renderer;
9251
+ exports.rendererFactory = rendererFactory;
9165
9252
  exports.sanitizeAttribute = sanitizeAttribute;
9166
9253
  exports.setFeatureFlag = setFeatureFlag;
9167
9254
  exports.setFeatureFlagForTest = setFeatureFlagForTest;