lwc 2.5.2 → 2.5.6

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 (41) hide show
  1. package/dist/engine-dom/esm/es2017/engine-dom.js +181 -101
  2. package/dist/engine-dom/iife/es2017/engine-dom.js +183 -101
  3. package/dist/engine-dom/iife/es2017/engine-dom.min.js +2 -2
  4. package/dist/engine-dom/iife/es2017/engine-dom_debug.js +163 -82
  5. package/dist/engine-dom/iife/es5/engine-dom.js +211 -108
  6. package/dist/engine-dom/iife/es5/engine-dom.min.js +2 -2
  7. package/dist/engine-dom/iife/es5/engine-dom_debug.js +189 -87
  8. package/dist/engine-dom/umd/es2017/engine-dom.js +184 -102
  9. package/dist/engine-dom/umd/es2017/engine-dom.min.js +2 -2
  10. package/dist/engine-dom/umd/es2017/engine-dom_debug.js +164 -83
  11. package/dist/engine-dom/umd/es5/engine-dom.js +212 -109
  12. package/dist/engine-dom/umd/es5/engine-dom.min.js +2 -2
  13. package/dist/engine-dom/umd/es5/engine-dom_debug.js +190 -88
  14. package/dist/engine-server/commonjs/es2017/engine-server.js +174 -99
  15. package/dist/engine-server/commonjs/es2017/engine-server.min.js +2 -2
  16. package/dist/engine-server/esm/es2017/engine-server.js +173 -100
  17. package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +46 -40
  18. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +47 -41
  19. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +2 -2
  20. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +46 -40
  21. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +47 -41
  22. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +2 -2
  23. package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +46 -40
  24. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +48 -42
  25. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +2 -2
  26. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +47 -41
  27. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +48 -42
  28. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +2 -2
  29. package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +47 -41
  30. package/dist/wire-service/esm/es2017/wire-service.js +2 -2
  31. package/dist/wire-service/iife/es2017/wire-service.js +3 -3
  32. package/dist/wire-service/iife/es2017/wire-service_debug.js +3 -3
  33. package/dist/wire-service/iife/es5/wire-service.js +3 -3
  34. package/dist/wire-service/iife/es5/wire-service.min.js +1 -1
  35. package/dist/wire-service/iife/es5/wire-service_debug.js +3 -3
  36. package/dist/wire-service/umd/es2017/wire-service.js +4 -4
  37. package/dist/wire-service/umd/es2017/wire-service_debug.js +4 -4
  38. package/dist/wire-service/umd/es5/wire-service.js +4 -4
  39. package/dist/wire-service/umd/es5/wire-service.min.js +1 -1
  40. package/dist/wire-service/umd/es5/wire-service_debug.js +4 -4
  41. package/package.json +8 -8
@@ -347,7 +347,7 @@ var LWC = (function (exports) {
347
347
  CACHED_PROPERTY_ATTRIBUTE_MAPPING.set(propName, attributeName);
348
348
  return attributeName;
349
349
  }
350
- /** version: 2.5.2 */
350
+ /** version: 2.5.6 */
351
351
 
352
352
  /*
353
353
  * Copyright (c) 2018, salesforce.com, inc.
@@ -455,6 +455,7 @@ var LWC = (function (exports) {
455
455
  ENABLE_HMR: null,
456
456
  ENABLE_INNER_OUTER_TEXT_PATCH: null,
457
457
  ENABLE_ELEMENT_PATCH: null,
458
+ ENABLE_FORCE_NATIVE_SHADOW_MODE_FOR_TEST: null,
458
459
  ENABLE_NODE_LIST_PATCH: null,
459
460
  ENABLE_HTML_COLLECTIONS_PATCH: null,
460
461
  ENABLE_NODE_PATCH: null,
@@ -526,7 +527,7 @@ var LWC = (function (exports) {
526
527
  setFeatureFlag(name, value);
527
528
  }
528
529
  }
529
- /** version: 2.5.2 */
530
+ /** version: 2.5.6 */
530
531
 
531
532
  /* proxy-compat-disable */
532
533
 
@@ -2821,9 +2822,9 @@ var LWC = (function (exports) {
2821
2822
  }
2822
2823
  }
2823
2824
 
2824
- function warnIfInvokedDuringConstruction(vm, methodName) {
2825
+ function warnIfInvokedDuringConstruction(vm, methodOrPropName) {
2825
2826
  if (isBeingConstructed(vm)) {
2826
- logError("this.".concat(methodName, "() should not be called during the construction of the custom element for ").concat(getComponentTag(vm), " because the element is not yet in the DOM or has no children yet."));
2827
+ logError("this.".concat(methodOrPropName, " should not be called during the construction of the custom element for ").concat(getComponentTag(vm), " because the element is not yet in the DOM or has no children yet."));
2827
2828
  }
2828
2829
  } // @ts-ignore
2829
2830
 
@@ -2938,55 +2939,11 @@ var LWC = (function (exports) {
2938
2939
  getBoundingClientRect = vm.renderer.getBoundingClientRect;
2939
2940
 
2940
2941
  if (process.env.NODE_ENV !== 'production') {
2941
- warnIfInvokedDuringConstruction(vm, 'getBoundingClientRect');
2942
+ warnIfInvokedDuringConstruction(vm, 'getBoundingClientRect()');
2942
2943
  }
2943
2944
 
2944
2945
  return getBoundingClientRect(elm);
2945
2946
  },
2946
- querySelector: function querySelector(selectors) {
2947
- var vm = getAssociatedVM(this);
2948
- var elm = vm.elm,
2949
- querySelector = vm.renderer.querySelector;
2950
-
2951
- if (process.env.NODE_ENV !== 'production') {
2952
- warnIfInvokedDuringConstruction(vm, 'querySelector');
2953
- }
2954
-
2955
- return querySelector(elm, selectors);
2956
- },
2957
- querySelectorAll: function querySelectorAll(selectors) {
2958
- var vm = getAssociatedVM(this);
2959
- var elm = vm.elm,
2960
- querySelectorAll = vm.renderer.querySelectorAll;
2961
-
2962
- if (process.env.NODE_ENV !== 'production') {
2963
- warnIfInvokedDuringConstruction(vm, 'querySelectorAll');
2964
- }
2965
-
2966
- return querySelectorAll(elm, selectors);
2967
- },
2968
- getElementsByTagName: function getElementsByTagName(tagNameOrWildCard) {
2969
- var vm = getAssociatedVM(this);
2970
- var elm = vm.elm,
2971
- getElementsByTagName = vm.renderer.getElementsByTagName;
2972
-
2973
- if (process.env.NODE_ENV !== 'production') {
2974
- warnIfInvokedDuringConstruction(vm, 'getElementsByTagName');
2975
- }
2976
-
2977
- return getElementsByTagName(elm, tagNameOrWildCard);
2978
- },
2979
- getElementsByClassName: function getElementsByClassName(names) {
2980
- var vm = getAssociatedVM(this);
2981
- var elm = vm.elm,
2982
- getElementsByClassName = vm.renderer.getElementsByClassName;
2983
-
2984
- if (process.env.NODE_ENV !== 'production') {
2985
- warnIfInvokedDuringConstruction(vm, 'getElementsByClassName');
2986
- }
2987
-
2988
- return getElementsByClassName(elm, names);
2989
- },
2990
2947
 
2991
2948
  get isConnected() {
2992
2949
  var _getAssociatedVM8 = getAssociatedVM(this),
@@ -3039,6 +2996,57 @@ var LWC = (function (exports) {
3039
2996
  return "[object ".concat(vm.def.name, "]");
3040
2997
  }
3041
2998
  };
2999
+ var queryAndChildGetterDescriptors = create(null);
3000
+ var childGetters = [['children', 'getChildren'], ['childNodes', 'getChildNodes'], ['firstChild', 'getFirstChild'], ['firstElementChild', 'getFirstElementChild'], ['lastChild', 'getLastChild'], ['lastElementChild', 'getLastElementChild']]; // Generic passthrough for child getters on HTMLElement to the relevant Renderer APIs
3001
+
3002
+ var _loop = function _loop() {
3003
+ var _childGetters$_i = _slicedToArray(_childGetters[_i9], 2),
3004
+ elementProp = _childGetters$_i[0],
3005
+ rendererMethod = _childGetters$_i[1];
3006
+
3007
+ queryAndChildGetterDescriptors[elementProp] = {
3008
+ get: function get() {
3009
+ var vm = getAssociatedVM(this);
3010
+ var elm = vm.elm,
3011
+ renderer = vm.renderer;
3012
+
3013
+ if (process.env.NODE_ENV !== 'production') {
3014
+ warnIfInvokedDuringConstruction(vm, elementProp);
3015
+ }
3016
+
3017
+ return renderer[rendererMethod](elm);
3018
+ }
3019
+ };
3020
+ };
3021
+
3022
+ for (var _i9 = 0, _childGetters = childGetters; _i9 < _childGetters.length; _i9++) {
3023
+ _loop();
3024
+ }
3025
+
3026
+ var queryMethods = ['getElementsByClassName', 'getElementsByTagName', 'querySelector', 'querySelectorAll']; // Generic passthrough for query APIs on HTMLElement to the relevant Renderer APIs
3027
+
3028
+ var _loop2 = function _loop2() {
3029
+ var queryMethod = _queryMethods[_i10];
3030
+ queryAndChildGetterDescriptors[queryMethod] = {
3031
+ value: function value(arg) {
3032
+ var vm = getAssociatedVM(this);
3033
+ var elm = vm.elm,
3034
+ renderer = vm.renderer;
3035
+
3036
+ if (process.env.NODE_ENV !== 'production') {
3037
+ warnIfInvokedDuringConstruction(vm, "".concat(queryMethod, "()"));
3038
+ }
3039
+
3040
+ return renderer[queryMethod](elm, arg);
3041
+ }
3042
+ };
3043
+ };
3044
+
3045
+ for (var _i10 = 0, _queryMethods = queryMethods; _i10 < _queryMethods.length; _i10++) {
3046
+ _loop2();
3047
+ }
3048
+
3049
+ defineProperties(LightningElement.prototype, queryAndChildGetterDescriptors);
3042
3050
  var lightningBasedDescriptors = create(null);
3043
3051
 
3044
3052
  for (var _propName in HTMLElementOriginalDescriptors) {
@@ -3557,8 +3565,8 @@ var LWC = (function (exports) {
3557
3565
  }
3558
3566
 
3559
3567
  if (!isUndefined$1(fields)) {
3560
- for (var _i9 = 0, n = fields.length; _i9 < n; _i9++) {
3561
- var _fieldName2 = fields[_i9];
3568
+ for (var _i11 = 0, n = fields.length; _i11 < n; _i11++) {
3569
+ var _fieldName2 = fields[_i11];
3562
3570
  descriptor = getOwnPropertyDescriptor$1(proto, _fieldName2);
3563
3571
 
3564
3572
  if (process.env.NODE_ENV !== 'production') {
@@ -3631,15 +3639,14 @@ var LWC = (function (exports) {
3631
3639
  return tpl;
3632
3640
  }
3633
3641
  /**
3634
- * EXPERIMENTAL: This function acts like a hook for Lightning Locker
3635
- * Service and other similar libraries to sanitize vulnerable attributes.
3636
- * This API is subject to change or being removed.
3642
+ * EXPERIMENTAL: This function acts like a hook for Lightning Locker Service and other similar
3643
+ * libraries to sanitize vulnerable attributes.
3637
3644
  */
3638
3645
 
3639
3646
 
3640
3647
  function sanitizeAttribute(tagName, namespaceUri, attrName, attrValue) {
3641
- // locker-service patches this function during runtime to sanitize vulnerable attributes.
3642
- // when ran off-core this function becomes a noop and returns the user authored value.
3648
+ // locker-service patches this function during runtime to sanitize vulnerable attributes. When
3649
+ // ran off-core this function becomes a noop and returns the user authored value.
3643
3650
  return attrValue;
3644
3651
  }
3645
3652
  /*
@@ -3780,8 +3787,8 @@ var LWC = (function (exports) {
3780
3787
  superObservedAttributes = _SuperClass$observedA === void 0 ? [] : _SuperClass$observedA;
3781
3788
  var descriptors = create(null); // expose getters and setters for each public props on the new Element Bridge
3782
3789
 
3783
- for (var _i10 = 0, _len3 = props.length; _i10 < _len3; _i10 += 1) {
3784
- var _propName2 = props[_i10];
3790
+ for (var _i12 = 0, _len3 = props.length; _i12 < _len3; _i12 += 1) {
3791
+ var _propName2 = props[_i12];
3785
3792
  attributeToPropMap[htmlPropertyToAttribute(_propName2)] = _propName2;
3786
3793
  descriptors[_propName2] = {
3787
3794
  get: createGetter(_propName2),
@@ -3792,8 +3799,8 @@ var LWC = (function (exports) {
3792
3799
  } // expose public methods as props on the new Element Bridge
3793
3800
 
3794
3801
 
3795
- for (var _i11 = 0, _len4 = methods.length; _i11 < _len4; _i11 += 1) {
3796
- var methodName = methods[_i11];
3802
+ for (var _i13 = 0, _len4 = methods.length; _i13 < _len4; _i13 += 1) {
3803
+ var methodName = methods[_i13];
3797
3804
  descriptors[methodName] = {
3798
3805
  value: createMethodCaller(methodName),
3799
3806
  writable: true,
@@ -4741,6 +4748,38 @@ var LWC = (function (exports) {
4741
4748
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
4742
4749
  */
4743
4750
 
4751
+ /**
4752
+ * EXPERIMENTAL: This function acts like a hook for Lightning Locker Service and other similar
4753
+ * libraries to sanitize HTML content. This hook process the content passed via the template to
4754
+ * lwc:inner-html directive.
4755
+ * It is meant to be overridden with setSanitizeHtmlContentHook
4756
+ */
4757
+
4758
+
4759
+ var sanitizeHtmlContentHook = function sanitizeHtmlContentHook() {
4760
+ // locker-service patches this function during runtime to sanitize HTML content.
4761
+ throw new Error('sanitizeHtmlContent hook must be implemented.');
4762
+ };
4763
+ /**
4764
+ * Sets the sanitizeHtmlContentHook.
4765
+ *
4766
+ * @param newHookImpl
4767
+ * @returns oldHookImplementation.
4768
+ */
4769
+
4770
+
4771
+ function setSanitizeHtmlContentHook(newHookImpl) {
4772
+ var currentHook = sanitizeHtmlContentHook;
4773
+ sanitizeHtmlContentHook = newHookImpl;
4774
+ return currentHook;
4775
+ }
4776
+ /*
4777
+ * Copyright (c) 2018, salesforce.com, inc.
4778
+ * All rights reserved.
4779
+ * SPDX-License-Identifier: MIT
4780
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
4781
+ */
4782
+
4744
4783
 
4745
4784
  var SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
4746
4785
  var SymbolIterator = Symbol.iterator;
@@ -5090,7 +5129,7 @@ var LWC = (function (exports) {
5090
5129
  next = iterator.next();
5091
5130
  last = next.done; // template factory logic based on the previous collected value
5092
5131
 
5093
- var vnode = factory(value, j, j === 0, last);
5132
+ var vnode = factory(value, j, j === 0, last === true);
5094
5133
 
5095
5134
  if (isArray$1(vnode)) {
5096
5135
  ArrayPush$1.apply(list, vnode);
@@ -5352,25 +5391,29 @@ var LWC = (function (exports) {
5352
5391
 
5353
5392
  markAsDynamicChildren(vnodes);
5354
5393
  return vnodes;
5394
+ } // [s]anitize [h]tml [c]ontent
5395
+
5396
+
5397
+ function shc(content) {
5398
+ return sanitizeHtmlContentHook(content);
5355
5399
  }
5356
5400
 
5357
- var api = /*#__PURE__*/Object.freeze({
5358
- __proto__: null,
5359
- h: h,
5360
- ti: ti,
5401
+ var api = freeze({
5361
5402
  s: s,
5403
+ h: h,
5362
5404
  c: c,
5363
5405
  i: i,
5364
5406
  f: f,
5365
5407
  t: t,
5366
- co: co,
5367
5408
  d: d,
5368
5409
  b: b,
5369
5410
  k: k,
5411
+ co: co,
5412
+ dc: dc,
5413
+ ti: ti,
5370
5414
  gid: gid,
5371
5415
  fid: fid,
5372
- dc: dc,
5373
- sc: sc
5416
+ shc: shc
5374
5417
  });
5375
5418
  /*
5376
5419
  * Copyright (c) 2018, salesforce.com, inc.
@@ -5384,12 +5427,12 @@ var LWC = (function (exports) {
5384
5427
  }
5385
5428
 
5386
5429
  function createInlineStyleVNode(content) {
5387
- return h('style', {
5430
+ return api.h('style', {
5388
5431
  key: 'style',
5389
5432
  attrs: {
5390
5433
  type: 'text/css'
5391
5434
  }
5392
- }, [t(content)]);
5435
+ }, [api.t(content)]);
5393
5436
  }
5394
5437
 
5395
5438
  function updateStylesheetToken(vm, template) {
@@ -5450,8 +5493,8 @@ var LWC = (function (exports) {
5450
5493
  function evaluateStylesheetsContent(stylesheets, stylesheetToken, vm) {
5451
5494
  var content = [];
5452
5495
 
5453
- for (var _i12 = 0; _i12 < stylesheets.length; _i12++) {
5454
- var stylesheet = stylesheets[_i12];
5496
+ for (var _i14 = 0; _i14 < stylesheets.length; _i14++) {
5497
+ var stylesheet = stylesheets[_i14];
5455
5498
 
5456
5499
  if (isArray$1(stylesheet)) {
5457
5500
  ArrayPush$1.apply(content, evaluateStylesheetsContent(stylesheet, stylesheetToken, vm));
@@ -5527,8 +5570,8 @@ var LWC = (function (exports) {
5527
5570
  && shadowMode === 1
5528
5571
  /* Synthetic */
5529
5572
  ) {
5530
- for (var _i13 = 0; _i13 < stylesheets.length; _i13++) {
5531
- renderer.insertGlobalStylesheet(stylesheets[_i13]);
5573
+ for (var _i15 = 0; _i15 < stylesheets.length; _i15++) {
5574
+ renderer.insertGlobalStylesheet(stylesheets[_i15]);
5532
5575
  }
5533
5576
  } else if (renderer.ssr) {
5534
5577
  // native shadow or light DOM, SSR
@@ -5539,12 +5582,12 @@ var LWC = (function (exports) {
5539
5582
  var root = getNearestNativeShadowComponent(vm);
5540
5583
  var isGlobal = isNull(root);
5541
5584
 
5542
- for (var _i14 = 0; _i14 < stylesheets.length; _i14++) {
5585
+ for (var _i16 = 0; _i16 < stylesheets.length; _i16++) {
5543
5586
  if (isGlobal) {
5544
- renderer.insertGlobalStylesheet(stylesheets[_i14]);
5587
+ renderer.insertGlobalStylesheet(stylesheets[_i16]);
5545
5588
  } else {
5546
5589
  // local level
5547
- renderer.insertStylesheet(stylesheets[_i14], root.cmpRoot);
5590
+ renderer.insertStylesheet(stylesheets[_i16], root.cmpRoot);
5548
5591
  }
5549
5592
  }
5550
5593
  }
@@ -5821,8 +5864,8 @@ var LWC = (function (exports) {
5821
5864
  var stylesheets = template.stylesheets;
5822
5865
 
5823
5866
  if (!isUndefined$1(stylesheets)) {
5824
- for (var _i15 = 0; _i15 < stylesheets.length; _i15++) {
5825
- if (isTrue(stylesheets[_i15][KEY__SCOPED_CSS])) {
5867
+ for (var _i17 = 0; _i17 < stylesheets.length; _i17++) {
5868
+ if (isTrue(stylesheets[_i17][KEY__SCOPED_CSS])) {
5826
5869
  return true;
5827
5870
  }
5828
5871
  }
@@ -6052,8 +6095,8 @@ var LWC = (function (exports) {
6052
6095
  assert.isTrue(isObject(service), "Invalid service declaration, ".concat(service, ": service must be an object"));
6053
6096
  }
6054
6097
 
6055
- for (var _i16 = 0; _i16 < hooks.length; ++_i16) {
6056
- var hookName = hooks[_i16];
6098
+ for (var _i18 = 0; _i18 < hooks.length; ++_i18) {
6099
+ var hookName = hooks[_i18];
6057
6100
 
6058
6101
  if (hookName in service) {
6059
6102
  var l = Services[hookName];
@@ -6076,8 +6119,8 @@ var LWC = (function (exports) {
6076
6119
  def = vm.def,
6077
6120
  context = vm.context;
6078
6121
 
6079
- for (var _i17 = 0, _len6 = cbs.length; _i17 < _len6; ++_i17) {
6080
- cbs[_i17].call(undefined, component, {}, def, context);
6122
+ for (var _i19 = 0, _len6 = cbs.length; _i19 < _len6; ++_i19) {
6123
+ cbs[_i19].call(undefined, component, {}, def, context);
6081
6124
  }
6082
6125
  }
6083
6126
  /*
@@ -6245,6 +6288,12 @@ var LWC = (function (exports) {
6245
6288
  vm.toString = function () {
6246
6289
  return "[object:vm ".concat(def.name, " (").concat(vm.idx, ")]");
6247
6290
  };
6291
+
6292
+ if (runtimeFlags.ENABLE_FORCE_NATIVE_SHADOW_MODE_FOR_TEST) {
6293
+ vm.shadowMode = 0
6294
+ /* Native */
6295
+ ;
6296
+ }
6248
6297
  } // Create component instance associated to the vm and the element.
6249
6298
 
6250
6299
 
@@ -6434,19 +6483,19 @@ var LWC = (function (exports) {
6434
6483
  });
6435
6484
  rehydrateQueue = []; // reset to a new queue
6436
6485
 
6437
- for (var _i18 = 0, _len7 = vms.length; _i18 < _len7; _i18 += 1) {
6438
- var vm = vms[_i18];
6486
+ for (var _i20 = 0, _len7 = vms.length; _i20 < _len7; _i20 += 1) {
6487
+ var vm = vms[_i20];
6439
6488
 
6440
6489
  try {
6441
6490
  rehydrate(vm);
6442
6491
  } catch (error) {
6443
- if (_i18 + 1 < _len7) {
6492
+ if (_i20 + 1 < _len7) {
6444
6493
  // pieces of the queue are still pending to be rehydrated, those should have priority
6445
6494
  if (rehydrateQueue.length === 0) {
6446
6495
  addCallbackToNextTick(flushRehydrationQueue);
6447
6496
  }
6448
6497
 
6449
- ArrayUnshift.apply(rehydrateQueue, ArraySlice.call(vms, _i18 + 1));
6498
+ ArrayUnshift.apply(rehydrateQueue, ArraySlice.call(vms, _i20 + 1));
6450
6499
  } // we need to end the measure before throwing.
6451
6500
 
6452
6501
 
@@ -6550,8 +6599,8 @@ var LWC = (function (exports) {
6550
6599
  var vCustomElementCollection = vm.velements; // Reporting disconnection for every child in inverse order since they are
6551
6600
  // inserted in reserved order.
6552
6601
 
6553
- for (var _i19 = vCustomElementCollection.length - 1; _i19 >= 0; _i19 -= 1) {
6554
- var elm = vCustomElementCollection[_i19].elm; // There are two cases where the element could be undefined:
6602
+ for (var _i21 = vCustomElementCollection.length - 1; _i21 >= 0; _i21 -= 1) {
6603
+ var elm = vCustomElementCollection[_i21].elm; // There are two cases where the element could be undefined:
6555
6604
  // * when there is an error during the construction phase, and an error
6556
6605
  // boundary picks it, there is a possibility that the VCustomElement
6557
6606
  // is not properly initialized, and therefore is should be ignored.
@@ -6585,8 +6634,8 @@ var LWC = (function (exports) {
6585
6634
 
6586
6635
 
6587
6636
  function recursivelyDisconnectChildren(vnodes) {
6588
- for (var _i20 = 0, _len8 = vnodes.length; _i20 < _len8; _i20 += 1) {
6589
- var vnode = vnodes[_i20];
6637
+ for (var _i22 = 0, _len8 = vnodes.length; _i22 < _len8; _i22 += 1) {
6638
+ var vnode = vnodes[_i22];
6590
6639
 
6591
6640
  if (!isNull(vnode) && isArray$1(vnode.children) && !isUndefined$1(vnode.elm)) {
6592
6641
  // vnode is a VElement with children
@@ -6610,8 +6659,8 @@ var LWC = (function (exports) {
6610
6659
  renderer = vm.renderer;
6611
6660
  var rootNode = getRenderRoot(vm);
6612
6661
 
6613
- for (var _i21 = 0, _len9 = children.length; _i21 < _len9; _i21++) {
6614
- var child = children[_i21];
6662
+ for (var _i23 = 0, _len9 = children.length; _i23 < _len9; _i23++) {
6663
+ var child = children[_i23];
6615
6664
 
6616
6665
  if (!isNull(child) && !isUndefined$1(child.elm)) {
6617
6666
  renderer.remove(child.elm, rootNode);
@@ -6656,8 +6705,8 @@ var LWC = (function (exports) {
6656
6705
  var oldSlots = vm.cmpSlots;
6657
6706
  var cmpSlots = vm.cmpSlots = create(null);
6658
6707
 
6659
- for (var _i22 = 0, _len10 = children.length; _i22 < _len10; _i22 += 1) {
6660
- var vnode = children[_i22];
6708
+ for (var _i24 = 0, _len10 = children.length; _i24 < _len10; _i24 += 1) {
6709
+ var vnode = children[_i24];
6661
6710
 
6662
6711
  if (isNull(vnode)) {
6663
6712
  continue;
@@ -6687,8 +6736,8 @@ var LWC = (function (exports) {
6687
6736
  return;
6688
6737
  }
6689
6738
 
6690
- for (var _i23 = 0, _len11 = oldKeys.length; _i23 < _len11; _i23 += 1) {
6691
- var key = oldKeys[_i23];
6739
+ for (var _i25 = 0, _len11 = oldKeys.length; _i25 < _len11; _i25 += 1) {
6740
+ var key = oldKeys[_i25];
6692
6741
 
6693
6742
  if (isUndefined$1(cmpSlots[key]) || oldSlots[key].length !== cmpSlots[key].length) {
6694
6743
  markComponentAsDirty(vm);
@@ -7051,8 +7100,8 @@ var LWC = (function (exports) {
7051
7100
  function connectWireAdapters(vm) {
7052
7101
  var wiredConnecting = vm.context.wiredConnecting;
7053
7102
 
7054
- for (var _i24 = 0, _len12 = wiredConnecting.length; _i24 < _len12; _i24 += 1) {
7055
- wiredConnecting[_i24]();
7103
+ for (var _i26 = 0, _len12 = wiredConnecting.length; _i26 < _len12; _i26 += 1) {
7104
+ wiredConnecting[_i26]();
7056
7105
  }
7057
7106
  }
7058
7107
 
@@ -7060,8 +7109,8 @@ var LWC = (function (exports) {
7060
7109
  var wiredDisconnecting = vm.context.wiredDisconnecting;
7061
7110
  runWithBoundaryProtection(vm, vm, noop, function () {
7062
7111
  // job
7063
- for (var _i25 = 0, _len13 = wiredDisconnecting.length; _i25 < _len13; _i25 += 1) {
7064
- wiredDisconnecting[_i25]();
7112
+ for (var _i27 = 0, _len13 = wiredDisconnecting.length; _i27 < _len13; _i27 += 1) {
7113
+ wiredDisconnecting[_i27]();
7065
7114
  }
7066
7115
  }, noop);
7067
7116
  }
@@ -7136,7 +7185,38 @@ var LWC = (function (exports) {
7136
7185
 
7137
7186
  return reactiveMembrane.getReadOnlyProxy(obj);
7138
7187
  }
7139
- /* version: 2.5.2 */
7188
+ /*
7189
+ * Copyright (c) 2018, salesforce.com, inc.
7190
+ * All rights reserved.
7191
+ * SPDX-License-Identifier: MIT
7192
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
7193
+ */
7194
+
7195
+
7196
+ var hooksAreSet = false;
7197
+
7198
+ function overrideHooks(hooks) {
7199
+ var oldHooks = {};
7200
+
7201
+ if (!isUndefined$1(hooks.sanitizeHtmlContent)) {
7202
+ oldHooks.sanitizeHtmlContent = setSanitizeHtmlContentHook(hooks.sanitizeHtmlContent);
7203
+ }
7204
+
7205
+ return oldHooks;
7206
+ }
7207
+
7208
+ function setHooks(hooks) {
7209
+ assert.isFalse(hooksAreSet, 'Hooks are already overridden, only one definition is allowed.');
7210
+ overrideHooks(hooks);
7211
+ hooksAreSet = true;
7212
+ }
7213
+
7214
+ function setHooksForTest(hooks) {
7215
+ if (process.env.NODE_ENV !== 'production') {
7216
+ return overrideHooks(hooks);
7217
+ }
7218
+ }
7219
+ /* version: 2.5.6 */
7140
7220
 
7141
7221
  /*
7142
7222
  * Copyright (c) 2018, salesforce.com, inc.
@@ -7151,15 +7231,18 @@ var LWC = (function (exports) {
7151
7231
  if (process.env.NODE_ENV === 'development') {
7152
7232
  // @ts-ignore
7153
7233
  window.__lwcResetGlobalStylesheets = function () {
7154
- for (var _i26 = 0, _Object$keys = Object.keys(globalStylesheets); _i26 < _Object$keys.length; _i26++) {
7155
- var key = _Object$keys[_i26];
7234
+ for (var _i28 = 0, _Object$keys = Object.keys(globalStylesheets); _i28 < _Object$keys.length; _i28++) {
7235
+ var key = _Object$keys[_i28];
7156
7236
  delete globalStylesheets[key];
7157
7237
  }
7158
7238
  };
7159
7239
  }
7160
7240
 
7161
- var globalStylesheetsParentElement = document.head || document.body || document;
7162
- var supportsConstructableStyleSheets = isFunction$1(CSSStyleSheet.prototype.replaceSync);
7241
+ var globalStylesheetsParentElement = document.head || document.body || document; // This check for constructable stylesheets is similar to Fast's:
7242
+ // https://github.com/microsoft/fast/blob/d49d1ec/packages/web-components/fast-element/src/dom.ts#L51-L53
7243
+ // See also: https://github.com/whatwg/webidl/issues/1027#issuecomment-934510070
7244
+
7245
+ var supportsConstructableStyleSheets = isFunction$1(CSSStyleSheet.prototype.replaceSync) && isArray$1(document.adoptedStyleSheets);
7163
7246
  var styleElements = create(null);
7164
7247
  var styleSheets = create(null);
7165
7248
  var nodesToStyleSheets = new WeakMap();
@@ -7374,6 +7457,24 @@ var LWC = (function (exports) {
7374
7457
  getElementsByClassName: function getElementsByClassName(element, names) {
7375
7458
  return element.getElementsByClassName(names);
7376
7459
  },
7460
+ getChildren: function getChildren(element) {
7461
+ return element.children;
7462
+ },
7463
+ getChildNodes: function getChildNodes(element) {
7464
+ return element.childNodes;
7465
+ },
7466
+ getFirstChild: function getFirstChild(element) {
7467
+ return element.firstChild;
7468
+ },
7469
+ getFirstElementChild: function getFirstElementChild(element) {
7470
+ return element.firstElementChild;
7471
+ },
7472
+ getLastChild: function getLastChild(element) {
7473
+ return element.lastChild;
7474
+ },
7475
+ getLastElementChild: function getLastElementChild(element) {
7476
+ return element.lastElementChild;
7477
+ },
7377
7478
  isConnected: function isConnected(node) {
7378
7479
  return node.isConnected;
7379
7480
  },
@@ -7689,7 +7790,7 @@ var LWC = (function (exports) {
7689
7790
  });
7690
7791
  freeze(LightningElement);
7691
7792
  seal(LightningElement.prototype);
7692
- /* version: 2.5.2 */
7793
+ /* version: 2.5.6 */
7693
7794
 
7694
7795
  exports.LightningElement = LightningElement;
7695
7796
  exports.__unstable__ProfilerControl = profilerControl;
@@ -7709,6 +7810,8 @@ var LWC = (function (exports) {
7709
7810
  exports.sanitizeAttribute = sanitizeAttribute;
7710
7811
  exports.setFeatureFlag = setFeatureFlag;
7711
7812
  exports.setFeatureFlagForTest = setFeatureFlagForTest;
7813
+ exports.setHooks = setHooks;
7814
+ exports.setHooksForTest = setHooksForTest;
7712
7815
  exports.swapComponent = swapComponent;
7713
7816
  exports.swapStyle = swapStyle;
7714
7817
  exports.swapTemplate = swapTemplate;
@@ -7720,4 +7823,4 @@ var LWC = (function (exports) {
7720
7823
 
7721
7824
  return exports;
7722
7825
 
7723
- }({}));
7826
+ })({});