@stencil/core 4.22.3-dev.1732597307.7bdf128 → 4.22.3-dev.1732770122.a15bc5d

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.
@@ -1,5 +1,5 @@
1
1
  /*
2
- Stencil Client Platform v4.22.3-dev.1732597307.7bdf128 | MIT Licensed | https://stenciljs.com
2
+ Stencil Client Platform v4.22.3-dev.1732770122.a15bc5d | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  var __defProp = Object.defineProperty;
5
5
  var __export = (target, all) => {
@@ -1162,8 +1162,12 @@ var relocateToHostRoot = (parentElm) => {
1162
1162
  plt.$flags$ |= 1 /* isTmpDisconnected */;
1163
1163
  const host = parentElm.closest(hostTagName.toLowerCase());
1164
1164
  if (host != null) {
1165
- const contentRefNode = Array.from(host.childNodes).find((ref) => ref["s-cr"]);
1166
- const childNodeArray = Array.from(parentElm.childNodes);
1165
+ const contentRefNode = Array.from(host.__childNodes || host.childNodes).find(
1166
+ (ref) => ref["s-cr"]
1167
+ );
1168
+ const childNodeArray = Array.from(
1169
+ parentElm.__childNodes || parentElm.childNodes
1170
+ );
1167
1171
  for (const childNode of contentRefNode ? childNodeArray.reverse() : childNodeArray) {
1168
1172
  if (childNode["s-sh"] != null) {
1169
1173
  insertBefore(host, childNode, contentRefNode != null ? contentRefNode : null);
@@ -1176,7 +1180,7 @@ var relocateToHostRoot = (parentElm) => {
1176
1180
  };
1177
1181
  var putBackInOriginalLocation = (parentElm, recursive) => {
1178
1182
  plt.$flags$ |= 1 /* isTmpDisconnected */;
1179
- const oldSlotChildNodes = Array.from(parentElm.childNodes);
1183
+ const oldSlotChildNodes = Array.from(parentElm.__childNodes || parentElm.childNodes);
1180
1184
  if (parentElm["s-sr"] && BUILD16.experimentalSlotFixes) {
1181
1185
  let node = parentElm;
1182
1186
  while (node = node.nextSibling) {
@@ -1397,7 +1401,7 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
1397
1401
  }
1398
1402
  };
1399
1403
  var updateFallbackSlotVisibility = (elm) => {
1400
- const childNodes = elm.childNodes;
1404
+ const childNodes = elm.__childNodes || elm.childNodes;
1401
1405
  for (const childNode of childNodes) {
1402
1406
  if (childNode.nodeType === 1 /* ElementNode */) {
1403
1407
  if (childNode["s-sr"]) {
@@ -1428,9 +1432,10 @@ var markSlotContentForRelocation = (elm) => {
1428
1432
  let node;
1429
1433
  let hostContentNodes;
1430
1434
  let j;
1431
- for (const childNode of elm.childNodes) {
1435
+ const children = elm.__childNodes || elm.childNodes;
1436
+ for (const childNode of children) {
1432
1437
  if (childNode["s-sr"] && (node = childNode["s-cr"]) && node.parentNode) {
1433
- hostContentNodes = node.parentNode.childNodes;
1438
+ hostContentNodes = node.parentNode.__childNodes || node.parentNode.childNodes;
1434
1439
  const slotName = childNode["s-sn"];
1435
1440
  for (j = hostContentNodes.length - 1; j >= 0; j--) {
1436
1441
  node = hostContentNodes[j];
@@ -1519,7 +1524,7 @@ var updateElementScopeIds = (element, parent, iterateChildNodes = false) => {
1519
1524
  if (scopeIds.size) {
1520
1525
  (_a = element.classList) == null ? void 0 : _a.add(...element["s-scs"] = Array.from(scopeIds));
1521
1526
  if (element["s-ol"] || iterateChildNodes) {
1522
- for (const childNode of Array.from(element.childNodes)) {
1527
+ for (const childNode of Array.from(element.__childNodes || element.childNodes)) {
1523
1528
  updateElementScopeIds(childNode, element, true);
1524
1529
  }
1525
1530
  }
@@ -1637,7 +1642,8 @@ render() {
1637
1642
  relocateNodes.length = 0;
1638
1643
  }
1639
1644
  if (BUILD16.experimentalScopedSlotChanges && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
1640
- for (const childNode of rootVnode.$elm$.childNodes) {
1645
+ const children = rootVnode.$elm$.__childNodes || rootVnode.$elm$.childNodes;
1646
+ for (const childNode of children) {
1641
1647
  if (childNode["s-hn"] !== hostTagName && !childNode["s-sh"]) {
1642
1648
  if (isInitialLoad && childNode["s-ih"] == null) {
1643
1649
  childNode["s-ih"] = (_e = childNode.hidden) != null ? _e : false;
@@ -2029,31 +2035,77 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
2029
2035
  const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
2030
2036
  members.map(([memberName, [memberFlags]]) => {
2031
2037
  if ((BUILD19.prop || BUILD19.state) && (memberFlags & 31 /* Prop */ || (!BUILD19.lazyLoad || flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
2032
- Object.defineProperty(prototype, memberName, {
2033
- get() {
2034
- return getValue(this, memberName);
2035
- },
2036
- set(newValue) {
2037
- if (BUILD19.isDev) {
2038
- const ref = getHostRef(this);
2039
- if (
2040
- // we are proxying the instance (not element)
2041
- (flags & 1 /* isElementConstructor */) === 0 && // the element is not constructing
2042
- (ref && ref.$flags$ & 8 /* isConstructingInstance */) === 0 && // the member is a prop
2043
- (memberFlags & 31 /* Prop */) !== 0 && // the member is not mutable
2044
- (memberFlags & 1024 /* Mutable */) === 0
2045
- ) {
2046
- consoleDevWarn(
2047
- `@Prop() "${memberName}" on <${cmpMeta.$tagName$}> is immutable but was modified from within the component.
2038
+ if ((memberFlags & 2048 /* Getter */) === 0) {
2039
+ Object.defineProperty(prototype, memberName, {
2040
+ get() {
2041
+ return getValue(this, memberName);
2042
+ },
2043
+ set(newValue) {
2044
+ if (BUILD19.isDev) {
2045
+ const ref = getHostRef(this);
2046
+ if (
2047
+ // we are proxying the instance (not element)
2048
+ (flags & 1 /* isElementConstructor */) === 0 && // the element is not constructing
2049
+ (ref && ref.$flags$ & 8 /* isConstructingInstance */) === 0 && // the member is a prop
2050
+ (memberFlags & 31 /* Prop */) !== 0 && // the member is not mutable
2051
+ (memberFlags & 1024 /* Mutable */) === 0
2052
+ ) {
2053
+ consoleDevWarn(
2054
+ `@Prop() "${memberName}" on <${cmpMeta.$tagName$}> is immutable but was modified from within the component.
2048
2055
  More information: https://stenciljs.com/docs/properties#prop-mutability`
2049
- );
2056
+ );
2057
+ }
2050
2058
  }
2051
- }
2052
- setValue(this, memberName, newValue, cmpMeta);
2053
- },
2054
- configurable: true,
2055
- enumerable: true
2056
- });
2059
+ setValue(this, memberName, newValue, cmpMeta);
2060
+ },
2061
+ configurable: true,
2062
+ enumerable: true
2063
+ });
2064
+ } else if (flags & 1 /* isElementConstructor */ && memberFlags & 2048 /* Getter */) {
2065
+ if (BUILD19.lazyLoad) {
2066
+ Object.defineProperty(prototype, memberName, {
2067
+ get() {
2068
+ const ref = getHostRef(this);
2069
+ const instance = BUILD19.lazyLoad && ref ? ref.$lazyInstance$ : prototype;
2070
+ if (!instance) return;
2071
+ return instance[memberName];
2072
+ },
2073
+ configurable: true,
2074
+ enumerable: true
2075
+ });
2076
+ }
2077
+ if (memberFlags & 4096 /* Setter */) {
2078
+ const origSetter = Object.getOwnPropertyDescriptor(prototype, memberName).set;
2079
+ Object.defineProperty(prototype, memberName, {
2080
+ set(newValue) {
2081
+ const ref = getHostRef(this);
2082
+ if (origSetter) {
2083
+ const currentValue = ref.$hostElement$[memberName];
2084
+ if (!ref.$instanceValues$.get(memberName) && currentValue) {
2085
+ ref.$instanceValues$.set(memberName, currentValue);
2086
+ }
2087
+ origSetter.apply(this, [parsePropertyValue(newValue, cmpMeta.$members$[memberName][0])]);
2088
+ setValue(this, memberName, ref.$hostElement$[memberName], cmpMeta);
2089
+ return;
2090
+ }
2091
+ if (!ref) return;
2092
+ const setterSetVal = () => {
2093
+ const currentValue = ref.$lazyInstance$[memberName];
2094
+ if (!ref.$instanceValues$.get(memberName) && currentValue) {
2095
+ ref.$instanceValues$.set(memberName, currentValue);
2096
+ }
2097
+ ref.$lazyInstance$[memberName] = parsePropertyValue(newValue, cmpMeta.$members$[memberName][0]);
2098
+ setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
2099
+ };
2100
+ if (ref.$lazyInstance$) {
2101
+ setterSetVal();
2102
+ } else {
2103
+ ref.$onReadyPromise$.then(() => setterSetVal());
2104
+ }
2105
+ }
2106
+ });
2107
+ }
2108
+ }
2057
2109
  } else if (BUILD19.lazyLoad && BUILD19.method && flags & 1 /* isElementConstructor */ && memberFlags & 64 /* Method */) {
2058
2110
  Object.defineProperty(prototype, memberName, {
2059
2111
  value(...args) {
@@ -2094,7 +2146,10 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
2094
2146
  }
2095
2147
  return;
2096
2148
  }
2097
- this[propName] = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
2149
+ const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
2150
+ if (!propDesc.get || !!propDesc.set) {
2151
+ this[propName] = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
2152
+ }
2098
2153
  });
2099
2154
  };
2100
2155
  Cstr.observedAttributes = Array.from(
@@ -2306,7 +2361,7 @@ var disconnectedCallback = async (elm) => {
2306
2361
 
2307
2362
  // src/runtime/dom-extras.ts
2308
2363
  import { BUILD as BUILD23 } from "@stencil/core/internal/app-data";
2309
- var patchPseudoShadowDom = (hostElementPrototype, descriptorPrototype) => {
2364
+ var patchPseudoShadowDom = (hostElementPrototype) => {
2310
2365
  patchCloneNode(hostElementPrototype);
2311
2366
  patchSlotAppendChild(hostElementPrototype);
2312
2367
  patchSlotAppend(hostElementPrototype);
@@ -2315,7 +2370,7 @@ var patchPseudoShadowDom = (hostElementPrototype, descriptorPrototype) => {
2315
2370
  patchSlotInsertAdjacentHTML(hostElementPrototype);
2316
2371
  patchSlotInsertAdjacentText(hostElementPrototype);
2317
2372
  patchTextContent(hostElementPrototype);
2318
- patchChildSlotNodes(hostElementPrototype, descriptorPrototype);
2373
+ patchChildSlotNodes(hostElementPrototype);
2319
2374
  patchSlotRemoveChild(hostElementPrototype);
2320
2375
  };
2321
2376
  var patchCloneNode = (HostElementPrototype) => {
@@ -2344,9 +2399,10 @@ var patchCloneNode = (HostElementPrototype) => {
2344
2399
  "s-rf",
2345
2400
  "s-scs"
2346
2401
  ];
2347
- for (; i2 < srcNode.childNodes.length; i2++) {
2348
- slotted = srcNode.childNodes[i2]["s-nr"];
2349
- nonStencilNode = stencilPrivates.every((privateField) => !srcNode.childNodes[i2][privateField]);
2402
+ const childNodes = this.__childNodes || this.childNodes;
2403
+ for (; i2 < childNodes.length; i2++) {
2404
+ slotted = childNodes[i2]["s-nr"];
2405
+ nonStencilNode = stencilPrivates.every((privateField) => !childNodes[i2][privateField]);
2350
2406
  if (slotted) {
2351
2407
  if (BUILD23.appendChildSlotFix && clonedNode.__appendChild) {
2352
2408
  clonedNode.__appendChild(slotted.cloneNode(true));
@@ -2355,7 +2411,7 @@ var patchCloneNode = (HostElementPrototype) => {
2355
2411
  }
2356
2412
  }
2357
2413
  if (nonStencilNode) {
2358
- clonedNode.appendChild(srcNode.childNodes[i2].cloneNode(true));
2414
+ clonedNode.appendChild(childNodes[i2].cloneNode(true));
2359
2415
  }
2360
2416
  }
2361
2417
  }
@@ -2366,13 +2422,9 @@ var patchSlotAppendChild = (HostElementPrototype) => {
2366
2422
  HostElementPrototype.__appendChild = HostElementPrototype.appendChild;
2367
2423
  HostElementPrototype.appendChild = function(newChild) {
2368
2424
  const slotName = newChild["s-sn"] = getSlotName(newChild);
2369
- const slotNode = getHostSlotNode(this.childNodes, slotName, this.tagName);
2425
+ const slotNode = getHostSlotNode(this.__childNodes || this.childNodes, slotName, this.tagName);
2370
2426
  if (slotNode) {
2371
- const slotPlaceholder = document.createTextNode("");
2372
- slotPlaceholder["s-nr"] = newChild;
2373
- slotNode["s-cr"].parentNode.__appendChild(slotPlaceholder);
2374
- newChild["s-ol"] = slotPlaceholder;
2375
- newChild["s-sh"] = slotNode["s-hn"];
2427
+ addSlotRelocateNode(newChild, slotNode);
2376
2428
  const slotChildNodes = getHostSlotChildNodes(slotNode, slotName);
2377
2429
  const appendAfter = slotChildNodes[slotChildNodes.length - 1];
2378
2430
  const insertedNode = insertBefore(appendAfter.parentNode, newChild, appendAfter.nextSibling);
@@ -2386,35 +2438,29 @@ var patchSlotRemoveChild = (ElementPrototype) => {
2386
2438
  ElementPrototype.__removeChild = ElementPrototype.removeChild;
2387
2439
  ElementPrototype.removeChild = function(toRemove) {
2388
2440
  if (toRemove && typeof toRemove["s-sn"] !== "undefined") {
2389
- const slotNode = getHostSlotNode(this.childNodes, toRemove["s-sn"], this.tagName);
2390
- if (slotNode) {
2391
- const slotChildNodes = getHostSlotChildNodes(slotNode, toRemove["s-sn"]);
2392
- const existingNode = slotChildNodes.find((n) => n === toRemove);
2393
- if (existingNode) {
2394
- existingNode.remove();
2395
- updateFallbackSlotVisibility(this);
2396
- return;
2397
- }
2441
+ const childNodes = this.__childNodes || this.childNodes;
2442
+ const slotNode = getHostSlotNode(childNodes, toRemove["s-sn"], this.tagName);
2443
+ if (slotNode && toRemove.isConnected) {
2444
+ toRemove.remove();
2445
+ updateFallbackSlotVisibility(this);
2446
+ return;
2398
2447
  }
2399
2448
  }
2400
2449
  return this.__removeChild(toRemove);
2401
2450
  };
2402
2451
  };
2403
2452
  var patchSlotPrepend = (HostElementPrototype) => {
2404
- const originalPrepend = HostElementPrototype.prepend;
2453
+ HostElementPrototype.__prepend = HostElementPrototype.prepend;
2405
2454
  HostElementPrototype.prepend = function(...newChildren) {
2406
2455
  newChildren.forEach((newChild) => {
2407
2456
  if (typeof newChild === "string") {
2408
2457
  newChild = this.ownerDocument.createTextNode(newChild);
2409
2458
  }
2410
2459
  const slotName = newChild["s-sn"] = getSlotName(newChild);
2411
- const slotNode = getHostSlotNode(this.childNodes, slotName, this.tagName);
2460
+ const childNodes = this.__childNodes || this.childNodes;
2461
+ const slotNode = getHostSlotNode(childNodes, slotName, this.tagName);
2412
2462
  if (slotNode) {
2413
- const slotPlaceholder = document.createTextNode("");
2414
- slotPlaceholder["s-nr"] = newChild;
2415
- slotNode["s-cr"].parentNode.__appendChild(slotPlaceholder);
2416
- newChild["s-ol"] = slotPlaceholder;
2417
- newChild["s-sh"] = slotNode["s-hn"];
2463
+ addSlotRelocateNode(newChild, slotNode, true);
2418
2464
  const slotChildNodes = getHostSlotChildNodes(slotNode, slotName);
2419
2465
  const appendAfter = slotChildNodes[0];
2420
2466
  return insertBefore(appendAfter.parentNode, newChild, appendAfter.nextSibling);
@@ -2422,11 +2468,12 @@ var patchSlotPrepend = (HostElementPrototype) => {
2422
2468
  if (newChild.nodeType === 1 && !!newChild.getAttribute("slot")) {
2423
2469
  newChild.hidden = true;
2424
2470
  }
2425
- return originalPrepend.call(this, newChild);
2471
+ return HostElementPrototype.__prepend(newChild);
2426
2472
  });
2427
2473
  };
2428
2474
  };
2429
2475
  var patchSlotAppend = (HostElementPrototype) => {
2476
+ HostElementPrototype.__append = HostElementPrototype.append;
2430
2477
  HostElementPrototype.append = function(...newChildren) {
2431
2478
  newChildren.forEach((newChild) => {
2432
2479
  if (typeof newChild === "string") {
@@ -2478,126 +2525,86 @@ var patchSlotInsertAdjacentElement = (HostElementPrototype) => {
2478
2525
  };
2479
2526
  };
2480
2527
  var patchTextContent = (hostElementPrototype) => {
2481
- const descriptor = Object.getOwnPropertyDescriptor(Node.prototype, "textContent");
2482
- Object.defineProperty(hostElementPrototype, "__textContent", descriptor);
2483
- if (BUILD23.experimentalScopedSlotChanges) {
2484
- Object.defineProperty(hostElementPrototype, "textContent", {
2485
- // To mimic shadow root behavior, we need to return the text content of all
2486
- // nodes in a slot reference node
2487
- get() {
2488
- const slotRefNodes = getAllChildSlotNodes(this.childNodes);
2489
- const textContent = slotRefNodes.map((node) => {
2490
- var _a, _b;
2491
- const text = [];
2492
- let slotContent = node.nextSibling;
2493
- while (slotContent && slotContent["s-sn"] === node["s-sn"]) {
2494
- if (slotContent.nodeType === 3 /* TEXT_NODE */ || slotContent.nodeType === 1 /* ELEMENT_NODE */) {
2495
- text.push((_b = (_a = slotContent.textContent) == null ? void 0 : _a.trim()) != null ? _b : "");
2496
- }
2497
- slotContent = slotContent.nextSibling;
2498
- }
2499
- return text.filter((ref) => ref !== "").join(" ");
2500
- }).filter((text) => text !== "").join(" ");
2501
- return " " + textContent + " ";
2502
- },
2503
- // To mimic shadow root behavior, we need to overwrite all nodes in a slot
2504
- // reference node. If a default slot reference node exists, the text content will be
2505
- // placed there. Otherwise, the new text node will be hidden
2506
- set(value) {
2507
- const slotRefNodes = getAllChildSlotNodes(this.childNodes);
2508
- slotRefNodes.forEach((node) => {
2509
- let slotContent = node.nextSibling;
2510
- while (slotContent && slotContent["s-sn"] === node["s-sn"]) {
2511
- const tmp = slotContent;
2512
- slotContent = slotContent.nextSibling;
2513
- tmp.remove();
2514
- }
2515
- if (node["s-sn"] === "") {
2516
- const textNode = this.ownerDocument.createTextNode(value);
2517
- textNode["s-sn"] = "";
2518
- insertBefore(node.parentElement, textNode, node.nextSibling);
2519
- } else {
2520
- node.remove();
2521
- }
2522
- });
2523
- }
2524
- });
2525
- } else {
2526
- Object.defineProperty(hostElementPrototype, "textContent", {
2527
- get() {
2528
- var _a;
2529
- const slotNode = getHostSlotNode(this.childNodes, "", this.tagName);
2530
- if (((_a = slotNode == null ? void 0 : slotNode.nextSibling) == null ? void 0 : _a.nodeType) === 3 /* TEXT_NODE */) {
2531
- return slotNode.nextSibling.textContent;
2532
- } else if (slotNode) {
2533
- return slotNode.textContent;
2534
- } else {
2535
- return this.__textContent;
2536
- }
2537
- },
2538
- set(value) {
2539
- var _a;
2540
- const slotNode = getHostSlotNode(this.childNodes, "", this.tagName);
2541
- if (((_a = slotNode == null ? void 0 : slotNode.nextSibling) == null ? void 0 : _a.nodeType) === 3 /* TEXT_NODE */) {
2542
- slotNode.nextSibling.textContent = value;
2543
- } else if (slotNode) {
2544
- slotNode.textContent = value;
2545
- } else {
2546
- this.__textContent = value;
2547
- const contentRefElm = this["s-cr"];
2548
- if (contentRefElm) {
2549
- insertBefore(this, contentRefElm, this.firstChild);
2550
- }
2551
- }
2552
- }
2553
- });
2554
- }
2528
+ let descriptor = Object.getOwnPropertyDescriptor(Node.prototype, "textContent");
2529
+ if (!descriptor) {
2530
+ descriptor = Object.getOwnPropertyDescriptor(hostElementPrototype, "textContent");
2531
+ }
2532
+ if (descriptor) Object.defineProperty(hostElementPrototype, "__textContent", descriptor);
2533
+ Object.defineProperty(hostElementPrototype, "textContent", {
2534
+ get: function() {
2535
+ let text = "";
2536
+ const childNodes = this.__childNodes ? this.childNodes : getSlottedChildNodes(this.childNodes);
2537
+ childNodes.forEach((node) => text += node.textContent || "");
2538
+ return text;
2539
+ },
2540
+ set: function(value) {
2541
+ const childNodes = this.__childNodes ? this.childNodes : getSlottedChildNodes(this.childNodes);
2542
+ childNodes.forEach((node) => {
2543
+ if (node["s-ol"]) node["s-ol"].remove();
2544
+ node.remove();
2545
+ });
2546
+ this.insertAdjacentHTML("beforeend", value);
2547
+ }
2548
+ });
2555
2549
  };
2556
- var patchChildSlotNodes = (elm, cmpMeta) => {
2550
+ var patchChildSlotNodes = (elm) => {
2557
2551
  class FakeNodeList extends Array {
2558
2552
  item(n) {
2559
2553
  return this[n];
2560
2554
  }
2561
2555
  }
2562
- if (cmpMeta.$flags$ & 8 /* needsShadowDomShim */) {
2563
- const childNodesFn = elm.__lookupGetter__("childNodes");
2564
- Object.defineProperty(elm, "children", {
2565
- get() {
2566
- return this.childNodes.map((n) => n.nodeType === 1);
2567
- }
2568
- });
2569
- Object.defineProperty(elm, "childElementCount", {
2570
- get() {
2571
- return elm.children.length;
2572
- }
2573
- });
2574
- Object.defineProperty(elm, "childNodes", {
2575
- get() {
2576
- const childNodes = childNodesFn.call(this);
2577
- if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0 && getHostRef(this).$flags$ & 2 /* hasRendered */) {
2578
- const result = new FakeNodeList();
2579
- for (let i2 = 0; i2 < childNodes.length; i2++) {
2580
- const slot = childNodes[i2]["s-nr"];
2581
- if (slot) {
2582
- result.push(slot);
2583
- }
2584
- }
2585
- return result;
2586
- }
2587
- return FakeNodeList.from(childNodes);
2588
- }
2589
- });
2556
+ let childNodesFn = Object.getOwnPropertyDescriptor(Node.prototype, "childNodes");
2557
+ if (!childNodesFn) {
2558
+ childNodesFn = Object.getOwnPropertyDescriptor(elm, "childNodes");
2559
+ }
2560
+ if (childNodesFn) Object.defineProperty(elm, "__childNodes", childNodesFn);
2561
+ Object.defineProperty(elm, "children", {
2562
+ get() {
2563
+ return this.childNodes.filter((n) => n.nodeType === 1);
2564
+ }
2565
+ });
2566
+ Object.defineProperty(elm, "childElementCount", {
2567
+ get() {
2568
+ return this.children.length;
2569
+ }
2570
+ });
2571
+ if (!childNodesFn) return;
2572
+ Object.defineProperty(elm, "childNodes", {
2573
+ get() {
2574
+ var _a, _b;
2575
+ if (!plt.$flags$ || !((_a = getHostRef(this)) == null ? void 0 : _a.$flags$) || (plt.$flags$ & 1 /* isTmpDisconnected */) === 0 && ((_b = getHostRef(this)) == null ? void 0 : _b.$flags$) & 2 /* hasRendered */) {
2576
+ const result = new FakeNodeList();
2577
+ const nodes = getSlottedChildNodes(this.__childNodes);
2578
+ result.push(...nodes);
2579
+ return result;
2580
+ }
2581
+ return FakeNodeList.from(this.__childNodes);
2582
+ }
2583
+ });
2584
+ };
2585
+ var addSlotRelocateNode = (newChild, slotNode, prepend) => {
2586
+ let slottedNodeLocation;
2587
+ if (newChild["s-ol"] && newChild["s-ol"].isConnected) {
2588
+ slottedNodeLocation = newChild["s-ol"];
2589
+ } else {
2590
+ slottedNodeLocation = document.createTextNode("");
2591
+ slottedNodeLocation["s-nr"] = newChild;
2590
2592
  }
2593
+ const parent = slotNode["s-cr"].parentNode;
2594
+ const appendMethod = prepend ? parent.__prepend : parent.__appendChild;
2595
+ newChild["s-ol"] = slottedNodeLocation;
2596
+ newChild["s-sh"] = slotNode["s-hn"];
2597
+ appendMethod.call(parent, slottedNodeLocation);
2591
2598
  };
2592
- var getAllChildSlotNodes = (childNodes) => {
2593
- const slotRefNodes = [];
2594
- for (const childNode of Array.from(childNodes)) {
2595
- if (childNode["s-sr"]) {
2596
- slotRefNodes.push(childNode);
2599
+ var getSlottedChildNodes = (childNodes) => {
2600
+ const result = [];
2601
+ for (let i2 = 0; i2 < childNodes.length; i2++) {
2602
+ const slottedNode = childNodes[i2]["s-nr"];
2603
+ if (slottedNode && slottedNode.isConnected) {
2604
+ result.push(slottedNode);
2597
2605
  }
2598
- slotRefNodes.push(...getAllChildSlotNodes(childNode.childNodes));
2599
2606
  }
2600
- return slotRefNodes;
2607
+ return result;
2601
2608
  };
2602
2609
  var getSlotName = (node) => node["s-sn"] || node.nodeType === 1 && node.getAttribute("slot") || "";
2603
2610
  var getHostSlotNode = (childNodes, slotName, hostName) => {
@@ -2649,11 +2656,11 @@ var proxyCustomElement = (Cstr, compactMeta) => {
2649
2656
  }
2650
2657
  if (BUILD24.experimentalSlotFixes) {
2651
2658
  if (BUILD24.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
2652
- patchPseudoShadowDom(Cstr.prototype, cmpMeta);
2659
+ patchPseudoShadowDom(Cstr.prototype);
2653
2660
  }
2654
2661
  } else {
2655
2662
  if (BUILD24.slotChildNodesFix) {
2656
- patchChildSlotNodes(Cstr.prototype, cmpMeta);
2663
+ patchChildSlotNodes(Cstr.prototype);
2657
2664
  }
2658
2665
  if (BUILD24.cloneNodeFix) {
2659
2666
  patchCloneNode(Cstr.prototype);
@@ -2859,11 +2866,11 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
2859
2866
  };
2860
2867
  if (BUILD25.experimentalSlotFixes) {
2861
2868
  if (BUILD25.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
2862
- patchPseudoShadowDom(HostElement.prototype, cmpMeta);
2869
+ patchPseudoShadowDom(HostElement.prototype);
2863
2870
  }
2864
2871
  } else {
2865
2872
  if (BUILD25.slotChildNodesFix) {
2866
- patchChildSlotNodes(HostElement.prototype, cmpMeta);
2873
+ patchChildSlotNodes(HostElement.prototype);
2867
2874
  }
2868
2875
  if (BUILD25.cloneNodeFix) {
2869
2876
  patchCloneNode(HostElement.prototype);
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/internal/client",
3
- "version": "4.22.3-dev.1732597307.7bdf128",
3
+ "version": "4.22.3-dev.1732770122.a15bc5d",
4
4
  "description": "Stencil internal client platform to be imported by the Stencil Compiler and internal runtime. Breaking changes can and will happen at any time.",
5
5
  "main": "./index.js",
6
6
  "exports": "./index.js",
@@ -1,5 +1,5 @@
1
1
  /*
2
- Stencil Client Patch Browser v4.22.3-dev.1732597307.7bdf128 | MIT Licensed | https://stenciljs.com
2
+ Stencil Client Patch Browser v4.22.3-dev.1732770122.a15bc5d | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
 
5
5
  // src/client/client-patch-browser.ts