lwc 2.37.2 → 2.38.0

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 (85) hide show
  1. package/dist/engine-dom/esm/es2017/engine-dom.js +241 -125
  2. package/dist/engine-dom/esm/es2017/engine-dom.js.map +1 -0
  3. package/dist/engine-dom/iife/es2017/engine-dom.js +241 -125
  4. package/dist/engine-dom/iife/es2017/engine-dom.js.map +1 -0
  5. package/dist/engine-dom/iife/es2017/engine-dom.min.js +2 -1
  6. package/dist/engine-dom/iife/es2017/engine-dom.min.js.map +1 -0
  7. package/dist/engine-dom/iife/es2017/engine-dom_debug.js +178 -112
  8. package/dist/engine-dom/iife/es2017/engine-dom_debug.js.map +1 -0
  9. package/dist/engine-dom/iife/es5/engine-dom.js +274 -153
  10. package/dist/engine-dom/iife/es5/engine-dom.js.map +1 -0
  11. package/dist/engine-dom/iife/es5/engine-dom.min.js +2 -1
  12. package/dist/engine-dom/iife/es5/engine-dom.min.js.map +1 -0
  13. package/dist/engine-dom/iife/es5/engine-dom_debug.js +208 -140
  14. package/dist/engine-dom/iife/es5/engine-dom_debug.js.map +1 -0
  15. package/dist/engine-dom/umd/es2017/engine-dom.js +241 -125
  16. package/dist/engine-dom/umd/es2017/engine-dom.js.map +1 -0
  17. package/dist/engine-dom/umd/es2017/engine-dom.min.js +2 -1
  18. package/dist/engine-dom/umd/es2017/engine-dom.min.js.map +1 -0
  19. package/dist/engine-dom/umd/es2017/engine-dom_debug.js +178 -112
  20. package/dist/engine-dom/umd/es2017/engine-dom_debug.js.map +1 -0
  21. package/dist/engine-dom/umd/es5/engine-dom.js +274 -153
  22. package/dist/engine-dom/umd/es5/engine-dom.js.map +1 -0
  23. package/dist/engine-dom/umd/es5/engine-dom.min.js +2 -1
  24. package/dist/engine-dom/umd/es5/engine-dom.min.js.map +1 -0
  25. package/dist/engine-dom/umd/es5/engine-dom_debug.js +208 -140
  26. package/dist/engine-dom/umd/es5/engine-dom_debug.js.map +1 -0
  27. package/dist/engine-server/commonjs/es2017/engine-server.js +161 -122
  28. package/dist/engine-server/commonjs/es2017/engine-server.js.map +1 -0
  29. package/dist/engine-server/commonjs/es2017/engine-server.min.js +2 -1
  30. package/dist/engine-server/commonjs/es2017/engine-server.min.js.map +1 -0
  31. package/dist/engine-server/esm/es2017/engine-server.js +161 -122
  32. package/dist/engine-server/esm/es2017/engine-server.js.map +1 -0
  33. package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +12 -5
  34. package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js.map +1 -0
  35. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +12 -5
  36. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js.map +1 -0
  37. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +2 -1
  38. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js.map +1 -0
  39. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +12 -5
  40. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js.map +1 -0
  41. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +8 -5
  42. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js.map +1 -0
  43. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +2 -1
  44. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js.map +1 -0
  45. package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +8 -5
  46. package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js.map +1 -0
  47. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +12 -5
  48. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js.map +1 -0
  49. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +3 -2
  50. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js.map +1 -0
  51. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +12 -5
  52. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js.map +1 -0
  53. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +8 -5
  54. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js.map +1 -0
  55. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +2 -1
  56. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js.map +1 -0
  57. package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +8 -5
  58. package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js.map +1 -0
  59. package/dist/wire-service/esm/es2017/wire-service.js +3 -2
  60. package/dist/wire-service/esm/es2017/wire-service.js.map +1 -0
  61. package/dist/wire-service/iife/es2017/wire-service.js +3 -2
  62. package/dist/wire-service/iife/es2017/wire-service.js.map +1 -0
  63. package/dist/wire-service/iife/es2017/wire-service.min.js +1 -0
  64. package/dist/wire-service/iife/es2017/wire-service.min.js.map +1 -0
  65. package/dist/wire-service/iife/es2017/wire-service_debug.js +3 -2
  66. package/dist/wire-service/iife/es2017/wire-service_debug.js.map +1 -0
  67. package/dist/wire-service/iife/es5/wire-service.js +3 -2
  68. package/dist/wire-service/iife/es5/wire-service.js.map +1 -0
  69. package/dist/wire-service/iife/es5/wire-service.min.js +1 -0
  70. package/dist/wire-service/iife/es5/wire-service.min.js.map +1 -0
  71. package/dist/wire-service/iife/es5/wire-service_debug.js +3 -2
  72. package/dist/wire-service/iife/es5/wire-service_debug.js.map +1 -0
  73. package/dist/wire-service/umd/es2017/wire-service.js +3 -2
  74. package/dist/wire-service/umd/es2017/wire-service.js.map +1 -0
  75. package/dist/wire-service/umd/es2017/wire-service.min.js +1 -0
  76. package/dist/wire-service/umd/es2017/wire-service.min.js.map +1 -0
  77. package/dist/wire-service/umd/es2017/wire-service_debug.js +3 -2
  78. package/dist/wire-service/umd/es2017/wire-service_debug.js.map +1 -0
  79. package/dist/wire-service/umd/es5/wire-service.js +3 -2
  80. package/dist/wire-service/umd/es5/wire-service.js.map +1 -0
  81. package/dist/wire-service/umd/es5/wire-service.min.js +1 -0
  82. package/dist/wire-service/umd/es5/wire-service.min.js.map +1 -0
  83. package/dist/wire-service/umd/es5/wire-service_debug.js +3 -2
  84. package/dist/wire-service/umd/es5/wire-service_debug.js.map +1 -0
  85. package/package.json +7 -7
@@ -325,6 +325,24 @@ var LWC = (function (exports) {
325
325
  return propertyName;
326
326
  }
327
327
 
328
+ /*
329
+ * Copyright (c) 2020, salesforce.com, inc.
330
+ * All rights reserved.
331
+ * SPDX-License-Identifier: MIT
332
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
333
+ */
334
+ const ESCAPED_CHARS = {
335
+ '"': '"',
336
+ "'": ''',
337
+ '<': '&lt;',
338
+ '>': '&gt;',
339
+ '&': '&amp;',
340
+ };
341
+ function htmlEscape(str, attrMode = false) {
342
+ const searchValue = attrMode ? /["&]/g : /["'<>&]/g;
343
+ return str.replace(searchValue, (char) => ESCAPED_CHARS[char]);
344
+ }
345
+
328
346
  /*
329
347
  * Copyright (c) 2018, salesforce.com, inc.
330
348
  * All rights reserved.
@@ -332,9 +350,9 @@ var LWC = (function (exports) {
332
350
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
333
351
  */
334
352
  // Increment whenever the LWC template compiler changes
335
- const LWC_VERSION = "2.37.2";
353
+ const LWC_VERSION = "2.38.0";
336
354
  const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
337
- /** version: 2.37.2 */
355
+ /** version: 2.38.0 */
338
356
 
339
357
  /**
340
358
  * Copyright (C) 2018 salesforce.com, inc.
@@ -413,7 +431,7 @@ var LWC = (function (exports) {
413
431
  setFeatureFlag(name, value);
414
432
  }
415
433
  }
416
- /** version: 2.37.2 */
434
+ /** version: 2.38.0 */
417
435
 
418
436
  /**
419
437
  * Copyright (C) 2018 salesforce.com, inc.
@@ -477,7 +495,7 @@ var LWC = (function (exports) {
477
495
  }
478
496
  }
479
497
  }
480
- /** version: 2.37.2 */
498
+ /** version: 2.38.0 */
481
499
 
482
500
  /*
483
501
  * Copyright (c) 2018, salesforce.com, inc.
@@ -2275,6 +2293,14 @@ var LWC = (function (exports) {
2275
2293
  }
2276
2294
  return renderer.getLastElementChild(vm.elm);
2277
2295
  },
2296
+ get ownerDocument() {
2297
+ const vm = getAssociatedVM(this);
2298
+ const renderer = vm.renderer;
2299
+ if (process.env.NODE_ENV !== 'production') {
2300
+ warnIfInvokedDuringConstruction(vm, 'ownerDocument');
2301
+ }
2302
+ return renderer.ownerDocument(vm.elm);
2303
+ },
2278
2304
  render() {
2279
2305
  const vm = getAssociatedVM(this);
2280
2306
  return vm.def.template;
@@ -2350,31 +2376,84 @@ var LWC = (function (exports) {
2350
2376
  }
2351
2377
 
2352
2378
  /*
2353
- * Copyright (c) 2018, salesforce.com, inc.
2379
+ * Copyright (c) 2023, salesforce.com, inc.
2354
2380
  * All rights reserved.
2355
2381
  * SPDX-License-Identifier: MIT
2356
2382
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
2357
2383
  */
2358
- const DeprecatedWiredElementHost = '$$DeprecatedWiredElementHostKey$$';
2359
- const DeprecatedWiredParamsMeta = '$$DeprecatedWiredParamsMetaKey$$';
2360
- const WIRE_DEBUG_ENTRY = '@wire';
2361
- const WireMetaMap = new Map();
2362
- class WireContextRegistrationEvent extends CustomEvent {
2363
- constructor(adapterToken, { setNewContext, setDisconnectedCallback }) {
2364
- super(adapterToken, {
2365
- bubbles: true,
2366
- composed: true,
2384
+ const AdapterToTokenMap = new Map();
2385
+ function createContextProviderWithRegister(adapter, registerContextProvider) {
2386
+ let adapterContextToken = AdapterToTokenMap.get(adapter);
2387
+ if (!isUndefined$1(adapterContextToken)) {
2388
+ throw new Error(`Adapter already has a context provider.`);
2389
+ }
2390
+ adapterContextToken = guid();
2391
+ AdapterToTokenMap.set(adapter, adapterContextToken);
2392
+ const providers = new WeakSet();
2393
+ return (elmOrComponent, options) => {
2394
+ if (providers.has(elmOrComponent)) {
2395
+ throw new Error(`Adapter was already installed on ${elmOrComponent}.`);
2396
+ }
2397
+ providers.add(elmOrComponent);
2398
+ const { consumerConnectedCallback, consumerDisconnectedCallback } = options;
2399
+ registerContextProvider(elmOrComponent, adapterContextToken, (subscriptionPayload) => {
2400
+ const { setNewContext, setDisconnectedCallback } = subscriptionPayload;
2401
+ const consumer = {
2402
+ provide(newContext) {
2403
+ setNewContext(newContext);
2404
+ },
2405
+ };
2406
+ const disconnectCallback = () => {
2407
+ if (!isUndefined$1(consumerDisconnectedCallback)) {
2408
+ consumerDisconnectedCallback(consumer);
2409
+ }
2410
+ };
2411
+ setDisconnectedCallback(disconnectCallback);
2412
+ consumerConnectedCallback(consumer);
2367
2413
  });
2368
- defineProperties(this, {
2369
- setNewContext: {
2370
- value: setNewContext,
2414
+ };
2415
+ }
2416
+ function createContextWatcher(vm, wireDef, callbackWhenContextIsReady) {
2417
+ const { adapter } = wireDef;
2418
+ const adapterContextToken = AdapterToTokenMap.get(adapter);
2419
+ if (isUndefined$1(adapterContextToken)) {
2420
+ return; // no provider found, nothing to be done
2421
+ }
2422
+ const { elm, context: { wiredConnecting, wiredDisconnecting }, renderer: { registerContextConsumer }, } = vm;
2423
+ // waiting for the component to be connected to formally request the context via the token
2424
+ ArrayPush$1.call(wiredConnecting, () => {
2425
+ // This will attempt to connect the current element with one of its anscestors
2426
+ // that can provide context for the given wire adapter. This relationship is
2427
+ // keyed on the secret & internal value of `adapterContextToken`, which is unique
2428
+ // to a given wire adapter.
2429
+ //
2430
+ // Depending on the runtime environment, this connection is made using either DOM
2431
+ // events (in the browser) or a custom traversal (on the server).
2432
+ registerContextConsumer(elm, adapterContextToken, {
2433
+ setNewContext(newContext) {
2434
+ // eslint-disable-next-line @lwc/lwc-internal/no-invalid-todo
2435
+ // TODO: dev-mode validation of config based on the adapter.contextSchema
2436
+ callbackWhenContextIsReady(newContext);
2371
2437
  },
2372
- setDisconnectedCallback: {
2373
- value: setDisconnectedCallback,
2438
+ setDisconnectedCallback(disconnectCallback) {
2439
+ // adds this callback into the disconnect bucket so it gets disconnected from parent
2440
+ // the the element hosting the wire is disconnected
2441
+ ArrayPush$1.call(wiredDisconnecting, disconnectCallback);
2374
2442
  },
2375
2443
  });
2376
- }
2444
+ });
2377
2445
  }
2446
+
2447
+ /*
2448
+ * Copyright (c) 2023, salesforce.com, inc.
2449
+ * All rights reserved.
2450
+ * SPDX-License-Identifier: MIT
2451
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
2452
+ */
2453
+ const DeprecatedWiredElementHost = '$$DeprecatedWiredElementHostKey$$';
2454
+ const DeprecatedWiredParamsMeta = '$$DeprecatedWiredParamsMetaKey$$';
2455
+ const WIRE_DEBUG_ENTRY = '@wire';
2456
+ const WireMetaMap = new Map();
2378
2457
  function createFieldDataCallback(vm, name) {
2379
2458
  return (value) => {
2380
2459
  updateComponentValue(vm, name, value);
@@ -2418,35 +2497,6 @@ var LWC = (function (exports) {
2418
2497
  ro,
2419
2498
  };
2420
2499
  }
2421
- function createContextWatcher(vm, wireDef, callbackWhenContextIsReady) {
2422
- const { adapter } = wireDef;
2423
- const adapterContextToken = getAdapterToken(adapter);
2424
- if (isUndefined$1(adapterContextToken)) {
2425
- return; // no provider found, nothing to be done
2426
- }
2427
- const { elm, context: { wiredConnecting, wiredDisconnecting }, renderer: { dispatchEvent }, } = vm;
2428
- // waiting for the component to be connected to formally request the context via the token
2429
- ArrayPush$1.call(wiredConnecting, () => {
2430
- // This event is responsible for connecting the host element with another
2431
- // element in the composed path that is providing contextual data. The provider
2432
- // must be listening for a special dom event with the name corresponding to the value of
2433
- // `adapterContextToken`, which will remain secret and internal to this file only to
2434
- // guarantee that the linkage can be forged.
2435
- const contextRegistrationEvent = new WireContextRegistrationEvent(adapterContextToken, {
2436
- setNewContext(newContext) {
2437
- // eslint-disable-next-line @lwc/lwc-internal/no-invalid-todo
2438
- // TODO: dev-mode validation of config based on the adapter.contextSchema
2439
- callbackWhenContextIsReady(newContext);
2440
- },
2441
- setDisconnectedCallback(disconnectCallback) {
2442
- // adds this callback into the disconnect bucket so it gets disconnected from parent
2443
- // the the element hosting the wire is disconnected
2444
- ArrayPush$1.call(wiredDisconnecting, disconnectCallback);
2445
- },
2446
- });
2447
- dispatchEvent(elm, contextRegistrationEvent);
2448
- });
2449
- }
2450
2500
  function createConnector(vm, name, wireDef) {
2451
2501
  const { method, adapter, configCallback, dynamic } = wireDef;
2452
2502
  let debugInfo;
@@ -2521,13 +2571,6 @@ var LWC = (function (exports) {
2521
2571
  resetConfigWatcher: () => ro.reset(),
2522
2572
  };
2523
2573
  }
2524
- const AdapterToTokenMap = new Map();
2525
- function getAdapterToken(adapter) {
2526
- return AdapterToTokenMap.get(adapter);
2527
- }
2528
- function setAdapterToken(adapter, token) {
2529
- AdapterToTokenMap.set(adapter, token);
2530
- }
2531
2574
  function storeWiredMethodMeta(descriptor, adapter, configCallback, dynamic) {
2532
2575
  // support for callable adapters
2533
2576
  if (adapter.adapter) {
@@ -6336,6 +6379,10 @@ var LWC = (function (exports) {
6336
6379
  // Use the unpatched native getElementById/querySelectorAll rather than the synthetic one
6337
6380
  const getElementById = _globalThis[KEY__NATIVE_GET_ELEMENT_BY_ID];
6338
6381
  const querySelectorAll = _globalThis[KEY__NATIVE_QUERY_SELECTOR_ALL];
6382
+ // This is a "handoff" from synthetic-shadow to engine-core – we want to clean up after ourselves
6383
+ // so nobody else can misuse these global APIs.
6384
+ delete _globalThis[KEY__NATIVE_GET_ELEMENT_BY_ID];
6385
+ delete _globalThis[KEY__NATIVE_QUERY_SELECTOR_ALL];
6339
6386
  function isSyntheticShadowRootInstance(rootNode) {
6340
6387
  return rootNode !== document && isTrue(rootNode.synthetic);
6341
6388
  }
@@ -6583,67 +6630,6 @@ var LWC = (function (exports) {
6583
6630
  }
6584
6631
  }
6585
6632
 
6586
- /*
6587
- * Copyright (c) 2018, salesforce.com, inc.
6588
- * All rights reserved.
6589
- * SPDX-License-Identifier: MIT
6590
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
6591
- */
6592
- // this is lwc internal implementation
6593
- function createContextProvider(adapter) {
6594
- let adapterContextToken = getAdapterToken(adapter);
6595
- if (!isUndefined$1(adapterContextToken)) {
6596
- throw new Error(`Adapter already has a context provider.`);
6597
- }
6598
- adapterContextToken = guid();
6599
- setAdapterToken(adapter, adapterContextToken);
6600
- const providers = new WeakSet();
6601
- return (elm, options) => {
6602
- if (providers.has(elm)) {
6603
- throw new Error(`Adapter was already installed on ${elm}.`);
6604
- }
6605
- providers.add(elm);
6606
- const { consumerConnectedCallback, consumerDisconnectedCallback } = options;
6607
- elm.addEventListener(adapterContextToken, ((evt) => {
6608
- const { setNewContext, setDisconnectedCallback } = evt;
6609
- const consumer = {
6610
- provide(newContext) {
6611
- setNewContext(newContext);
6612
- },
6613
- };
6614
- const disconnectCallback = () => {
6615
- if (!isUndefined$1(consumerDisconnectedCallback)) {
6616
- consumerDisconnectedCallback(consumer);
6617
- }
6618
- };
6619
- setDisconnectedCallback(disconnectCallback);
6620
- consumerConnectedCallback(consumer);
6621
- evt.stopImmediatePropagation();
6622
- }));
6623
- };
6624
- }
6625
-
6626
- /*
6627
- * Copyright (c) 2018, salesforce.com, inc.
6628
- * All rights reserved.
6629
- * SPDX-License-Identifier: MIT
6630
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
6631
- */
6632
- /**
6633
- * EXPERIMENTAL: This function allows you to create a reactive readonly
6634
- * membrane around any object value. This API is subject to change or
6635
- * being removed.
6636
- */
6637
- function readonly(obj) {
6638
- if (process.env.NODE_ENV !== 'production') {
6639
- // TODO [#1292]: Remove the readonly decorator
6640
- if (arguments.length !== 1) {
6641
- assert.fail('@readonly cannot be used as a decorator just yet, use it as a function with one argument to produce a readonly version of the provided value.');
6642
- }
6643
- }
6644
- return getReadOnlyProxy(obj);
6645
- }
6646
-
6647
6633
  /*
6648
6634
  * Copyright (c) 2022, salesforce.com, inc.
6649
6635
  * All rights reserved.
@@ -6697,15 +6683,44 @@ var LWC = (function (exports) {
6697
6683
  return renderer.nextSibling(hydratedNode);
6698
6684
  }
6699
6685
  const NODE_VALUE_PROP = 'nodeValue';
6686
+ const PARENT_NODE_PROP = 'parentNode';
6687
+ const TAG_NAME_PROP = 'tagName';
6688
+ function textNodeContentsAreEqual(node, vnode, renderer) {
6689
+ const { getProperty } = renderer;
6690
+ const nodeValue = getProperty(node, NODE_VALUE_PROP);
6691
+ if (nodeValue === vnode.text) {
6692
+ return true;
6693
+ }
6694
+ // Special case for empty text nodes – these are serialized differently on the server
6695
+ // See https://github.com/salesforce/lwc/pull/2656
6696
+ if (nodeValue === '\u200D' && vnode.text === '') {
6697
+ return true;
6698
+ }
6699
+ // Special case for text nodes inside `<style>` tags – these are escaped when rendered server-size,
6700
+ // but not when generated by the engine client-side.
6701
+ const parentNode = getProperty(node, PARENT_NODE_PROP);
6702
+ // Should never be null, but just to be safe, we check.
6703
+ /* istanbul ignore else */
6704
+ if (!isNull(parentNode)) {
6705
+ const tagName = getProperty(parentNode, TAG_NAME_PROP);
6706
+ // If the tagName is STYLE, then the following condition should always be true.
6707
+ // The LWC compiler blocks using `<style>`s inside of templates, so it should be impossible
6708
+ // for component authors to render different `<style>` text content on the client and server.
6709
+ // But just to be safe, we check.
6710
+ /* istanbul ignore next */
6711
+ if (tagName === 'STYLE' && htmlEscape(vnode.text) === nodeValue) {
6712
+ return true;
6713
+ }
6714
+ }
6715
+ return false;
6716
+ }
6700
6717
  function hydrateText(node, vnode, renderer) {
6701
6718
  var _a;
6702
6719
  if (!hasCorrectNodeType(vnode, node, 3 /* EnvNodeTypes.TEXT */, renderer)) {
6703
6720
  return handleMismatch(node, vnode, renderer);
6704
6721
  }
6705
6722
  if (process.env.NODE_ENV !== 'production') {
6706
- const { getProperty } = renderer;
6707
- const nodeValue = getProperty(node, NODE_VALUE_PROP);
6708
- if (nodeValue !== vnode.text && !(nodeValue === '\u200D' && vnode.text === '')) {
6723
+ if (!textNodeContentsAreEqual(node, vnode, renderer)) {
6709
6724
  logWarn('Hydration mismatch: text values do not match, will recover from the difference', vnode.owner);
6710
6725
  }
6711
6726
  }
@@ -6885,6 +6900,19 @@ var LWC = (function (exports) {
6885
6900
  const hasIncompatibleStyle = validateStyleAttr(vnode, elm, renderer);
6886
6901
  return hasIncompatibleAttrs && hasIncompatibleClass && hasIncompatibleStyle;
6887
6902
  }
6903
+ function attributeValuesAreEqual(vnodeValue, value) {
6904
+ const vnodeValueAsString = String(vnodeValue);
6905
+ if (vnodeValueAsString === value) {
6906
+ return true;
6907
+ }
6908
+ // If the expected value is null, this means that the attribute does not exist. In that case,
6909
+ // we accept any nullish value (undefined or null).
6910
+ if (isNull(value) && (isUndefined$1(vnodeValue) || isNull(vnodeValue))) {
6911
+ return true;
6912
+ }
6913
+ // In all other cases, the two values are not considered equal
6914
+ return false;
6915
+ }
6888
6916
  function validateAttrs(vnode, elm, renderer) {
6889
6917
  const { data: { attrs = {} }, } = vnode;
6890
6918
  let nodesAreCompatible = true;
@@ -6894,10 +6922,10 @@ var LWC = (function (exports) {
6894
6922
  const { owner } = vnode;
6895
6923
  const { getAttribute } = renderer;
6896
6924
  const elmAttrValue = getAttribute(elm, attrName);
6897
- if (String(attrValue) !== elmAttrValue) {
6925
+ if (!attributeValuesAreEqual(attrValue, elmAttrValue)) {
6898
6926
  if (process.env.NODE_ENV !== 'production') {
6899
6927
  const { getProperty } = renderer;
6900
- logError(`Mismatch hydrating element <${getProperty(elm, 'tagName').toLowerCase()}>: attribute "${attrName}" has different values, expected "${attrValue}" but found "${elmAttrValue}"`, owner);
6928
+ logError(`Mismatch hydrating element <${getProperty(elm, 'tagName').toLowerCase()}>: attribute "${attrName}" has different values, expected "${attrValue}" but found ${isNull(elmAttrValue) ? 'null' : `"${elmAttrValue}"`}`, owner);
6901
6929
  }
6902
6930
  nodesAreCompatible = false;
6903
6931
  }
@@ -7291,7 +7319,28 @@ var LWC = (function (exports) {
7291
7319
  }
7292
7320
  return ctor;
7293
7321
  }
7294
- /* version: 2.37.2 */
7322
+
7323
+ /*
7324
+ * Copyright (c) 2018, salesforce.com, inc.
7325
+ * All rights reserved.
7326
+ * SPDX-License-Identifier: MIT
7327
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
7328
+ */
7329
+ /**
7330
+ * EXPERIMENTAL: This function allows you to create a reactive readonly
7331
+ * membrane around any object value. This API is subject to change or
7332
+ * being removed.
7333
+ */
7334
+ function readonly(obj) {
7335
+ if (process.env.NODE_ENV !== 'production') {
7336
+ // TODO [#1292]: Remove the readonly decorator
7337
+ if (arguments.length !== 1) {
7338
+ assert.fail('@readonly cannot be used as a decorator just yet, use it as a function with one argument to produce a readonly version of the provided value.');
7339
+ }
7340
+ }
7341
+ return getReadOnlyProxy(obj);
7342
+ }
7343
+ /* version: 2.38.0 */
7295
7344
 
7296
7345
  /*
7297
7346
  * Copyright (c) 2018, salesforce.com, inc.
@@ -7719,7 +7768,37 @@ var LWC = (function (exports) {
7719
7768
  function isNull(obj) {
7720
7769
  return obj === null;
7721
7770
  }
7722
- /** version: 2.37.2 */
7771
+ /** version: 2.38.0 */
7772
+
7773
+ /*
7774
+ * Copyright (c) 2023, salesforce.com, inc.
7775
+ * All rights reserved.
7776
+ * SPDX-License-Identifier: MIT
7777
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
7778
+ */
7779
+ class WireContextSubscriptionEvent extends CustomEvent {
7780
+ constructor(adapterToken, { setNewContext, setDisconnectedCallback }) {
7781
+ super(adapterToken, {
7782
+ bubbles: true,
7783
+ composed: true,
7784
+ });
7785
+ this.setNewContext = setNewContext;
7786
+ this.setDisconnectedCallback = setDisconnectedCallback;
7787
+ }
7788
+ }
7789
+ function registerContextConsumer(elm, adapterContextToken, subscriptionPayload) {
7790
+ dispatchEvent(elm, new WireContextSubscriptionEvent(adapterContextToken, subscriptionPayload));
7791
+ }
7792
+ function registerContextProvider(elm, adapterContextToken, onContextSubscription) {
7793
+ addEventListener(elm, adapterContextToken, ((evt) => {
7794
+ evt.stopImmediatePropagation();
7795
+ const { setNewContext, setDisconnectedCallback } = evt;
7796
+ onContextSubscription({
7797
+ setNewContext,
7798
+ setDisconnectedCallback,
7799
+ });
7800
+ }));
7801
+ }
7723
7802
 
7724
7803
  /*
7725
7804
  * Copyright (c) 2018, salesforce.com, inc.
@@ -7900,6 +7979,9 @@ var LWC = (function (exports) {
7900
7979
  function assertInstanceOfHTMLElement(elm, msg) {
7901
7980
  assert.invariant(elm instanceof HTMLElement, msg);
7902
7981
  }
7982
+ function ownerDocument(element) {
7983
+ return element.ownerDocument;
7984
+ }
7903
7985
 
7904
7986
  exports.addEventListener = addEventListener;
7905
7987
  exports.assertInstanceOfHTMLElement = assertInstanceOfHTMLElement;
@@ -7924,8 +8006,11 @@ var LWC = (function (exports) {
7924
8006
  exports.insert = insert;
7925
8007
  exports.isConnected = isConnected;
7926
8008
  exports.nextSibling = nextSibling;
8009
+ exports.ownerDocument = ownerDocument;
7927
8010
  exports.querySelector = querySelector;
7928
8011
  exports.querySelectorAll = querySelectorAll;
8012
+ exports.registerContextConsumer = registerContextConsumer;
8013
+ exports.registerContextProvider = registerContextProvider;
7929
8014
  exports.remove = remove;
7930
8015
  exports.removeAttribute = removeAttribute;
7931
8016
  exports.removeEventListener = removeEventListener;
@@ -8272,7 +8357,37 @@ var LWC = (function (exports) {
8272
8357
  });
8273
8358
  freeze(LightningElement);
8274
8359
  seal(LightningElement.prototype);
8275
- /* version: 2.37.2 */
8360
+
8361
+ /*
8362
+ * Copyright (c) 2018, salesforce.com, inc.
8363
+ * All rights reserved.
8364
+ * SPDX-License-Identifier: MIT
8365
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
8366
+ */
8367
+ function addEventListener(target, type, callback, options) {
8368
+ target.addEventListener(type, callback, options);
8369
+ }
8370
+
8371
+ /*
8372
+ * Copyright (c) 2023, salesforce.com, inc.
8373
+ * All rights reserved.
8374
+ * SPDX-License-Identifier: MIT
8375
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
8376
+ */
8377
+ function createContextProvider(adapter) {
8378
+ return createContextProviderWithRegister(adapter, registerContextProvider);
8379
+ }
8380
+ function registerContextProvider(elm, adapterContextToken, onContextSubscription) {
8381
+ addEventListener(elm, adapterContextToken, ((evt) => {
8382
+ evt.stopImmediatePropagation();
8383
+ const { setNewContext, setDisconnectedCallback } = evt;
8384
+ onContextSubscription({
8385
+ setNewContext,
8386
+ setDisconnectedCallback,
8387
+ });
8388
+ }));
8389
+ }
8390
+ /* version: 2.38.0 */
8276
8391
 
8277
8392
  exports.LightningElement = LightningElement;
8278
8393
  exports.__unstable__ProfilerControl = profilerControl;
@@ -8310,3 +8425,4 @@ var LWC = (function (exports) {
8310
8425
  return exports;
8311
8426
 
8312
8427
  })({});
8428
+ //# sourceMappingURL=engine-dom.js.map