@stencil/core 4.35.1-dev.1751432601.f018c73 → 4.35.1

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 (38) hide show
  1. package/cli/index.cjs +1 -1
  2. package/cli/index.js +1 -1
  3. package/cli/package.json +1 -1
  4. package/compiler/package.json +1 -1
  5. package/compiler/stencil.js +7 -7
  6. package/dev-server/client/index.js +1 -1
  7. package/dev-server/client/package.json +1 -1
  8. package/dev-server/connector.html +2 -2
  9. package/dev-server/index.js +1 -1
  10. package/dev-server/package.json +1 -1
  11. package/dev-server/server-process.js +2 -2
  12. package/internal/app-data/package.json +1 -1
  13. package/internal/app-globals/package.json +1 -1
  14. package/internal/client/index.js +180 -216
  15. package/internal/client/package.json +1 -1
  16. package/internal/client/patch-browser.js +1 -1
  17. package/internal/hydrate/index.js +180 -216
  18. package/internal/hydrate/package.json +1 -1
  19. package/internal/hydrate/runner.js +13 -43
  20. package/internal/package.json +1 -1
  21. package/internal/stencil-public-compiler.d.ts +0 -1
  22. package/internal/stencil-public-runtime.d.ts +5 -5
  23. package/internal/testing/index.js +179 -213
  24. package/internal/testing/package.json +1 -1
  25. package/mock-doc/index.cjs +5 -35
  26. package/mock-doc/index.d.ts +0 -16
  27. package/mock-doc/index.js +5 -35
  28. package/mock-doc/package.json +1 -1
  29. package/package.json +1 -1
  30. package/screenshot/index.js +1 -1
  31. package/screenshot/package.json +1 -1
  32. package/screenshot/pixel-match.js +1 -1
  33. package/sys/node/index.js +26 -26
  34. package/sys/node/package.json +1 -1
  35. package/sys/node/worker.js +1 -1
  36. package/testing/index.js +5 -5
  37. package/testing/package.json +1 -1
  38. package/testing/puppeteer/puppeteer-browser.d.ts +5 -5
@@ -592,24 +592,17 @@ var globalStyles = (
592
592
  ""
593
593
  );
594
594
 
595
- // src/utils/style.ts
596
- function createStyleSheetIfNeededAndSupported(styles2) {
597
- if (!styles2 || !supportsConstructableStylesheets) return void 0;
598
- const sheet = new CSSStyleSheet();
599
- sheet.replaceSync(styles2);
600
- return sheet;
601
- }
602
-
603
595
  // src/utils/shadow-root.ts
604
- var globalStyleSheet;
605
596
  function createShadowRoot(cmpMeta) {
606
- var _a;
607
597
  const shadowRoot = import_app_data.BUILD.shadowDelegatesFocus ? this.attachShadow({
608
598
  mode: "open",
609
599
  delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */)
610
600
  }) : this.attachShadow({ mode: "open" });
611
- if (globalStyleSheet === void 0) globalStyleSheet = (_a = createStyleSheetIfNeededAndSupported(globalStyles)) != null ? _a : null;
612
- if (globalStyleSheet) shadowRoot.adoptedStyleSheets.push(globalStyleSheet);
601
+ if (supportsConstructableStylesheets) {
602
+ const sheet = new CSSStyleSheet();
603
+ sheet.replaceSync(globalStyles);
604
+ shadowRoot.adoptedStyleSheets.push(sheet);
605
+ }
613
606
  }
614
607
 
615
608
  // src/utils/util.ts
@@ -630,7 +623,7 @@ var isJsFile = lowerPathParam((p) => p.endsWith(".js") || p.endsWith(".mjs") ||
630
623
  var import_app_data18 = require("@stencil/core/internal/app-data");
631
624
 
632
625
  // src/runtime/client-hydrate.ts
633
- var import_app_data7 = require("@stencil/core/internal/app-data");
626
+ var import_app_data6 = require("@stencil/core/internal/app-data");
634
627
 
635
628
  // src/runtime/dom-extras.ts
636
629
  var import_app_data3 = require("@stencil/core/internal/app-data");
@@ -1264,125 +1257,8 @@ var installDevTools = () => {
1264
1257
  }
1265
1258
  };
1266
1259
 
1267
- // src/runtime/styles.ts
1268
- var import_app_data5 = require("@stencil/core/internal/app-data");
1269
- var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
1270
- var registerStyle = (scopeId2, cssText, allowCS) => {
1271
- let style = styles.get(scopeId2);
1272
- if (supportsConstructableStylesheets && allowCS) {
1273
- style = style || new CSSStyleSheet();
1274
- if (typeof style === "string") {
1275
- style = cssText;
1276
- } else {
1277
- style.replaceSync(cssText);
1278
- }
1279
- } else {
1280
- style = cssText;
1281
- }
1282
- styles.set(scopeId2, style);
1283
- };
1284
- var addStyle = (styleContainerNode, cmpMeta, mode) => {
1285
- var _a;
1286
- const scopeId2 = getScopeId(cmpMeta, mode);
1287
- const style = styles.get(scopeId2);
1288
- if (!import_app_data5.BUILD.attachStyles || !win.document) {
1289
- return scopeId2;
1290
- }
1291
- styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : win.document;
1292
- if (style) {
1293
- if (typeof style === "string") {
1294
- styleContainerNode = styleContainerNode.head || styleContainerNode;
1295
- let appliedStyles = rootAppliedStyles.get(styleContainerNode);
1296
- let styleElm;
1297
- if (!appliedStyles) {
1298
- rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
1299
- }
1300
- if (!appliedStyles.has(scopeId2)) {
1301
- if (import_app_data5.BUILD.hydrateClientSide && styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
1302
- styleElm.innerHTML = style;
1303
- } else {
1304
- styleElm = win.document.createElement("style");
1305
- styleElm.innerHTML = style;
1306
- const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
1307
- if (nonce != null) {
1308
- styleElm.setAttribute("nonce", nonce);
1309
- }
1310
- if ((import_app_data5.BUILD.hydrateServerSide || import_app_data5.BUILD.hotModuleReplacement) && (cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */ || cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */)) {
1311
- styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);
1312
- }
1313
- if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
1314
- if (styleContainerNode.nodeName === "HEAD") {
1315
- const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
1316
- const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
1317
- styleContainerNode.insertBefore(
1318
- styleElm,
1319
- (referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
1320
- );
1321
- } else if ("host" in styleContainerNode) {
1322
- if (supportsConstructableStylesheets) {
1323
- const stylesheet = new CSSStyleSheet();
1324
- stylesheet.replaceSync(style);
1325
- styleContainerNode.adoptedStyleSheets.unshift(stylesheet);
1326
- } else {
1327
- const existingStyleContainer = styleContainerNode.querySelector("style");
1328
- if (existingStyleContainer) {
1329
- existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
1330
- } else {
1331
- styleContainerNode.prepend(styleElm);
1332
- }
1333
- }
1334
- } else {
1335
- styleContainerNode.append(styleElm);
1336
- }
1337
- }
1338
- if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
1339
- styleContainerNode.insertBefore(styleElm, null);
1340
- }
1341
- }
1342
- if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
1343
- styleElm.innerHTML += SLOT_FB_CSS;
1344
- }
1345
- if (appliedStyles) {
1346
- appliedStyles.add(scopeId2);
1347
- }
1348
- }
1349
- } else if (import_app_data5.BUILD.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {
1350
- styleContainerNode.adoptedStyleSheets.push(style);
1351
- }
1352
- }
1353
- return scopeId2;
1354
- };
1355
- var attachStyles = (hostRef) => {
1356
- const cmpMeta = hostRef.$cmpMeta$;
1357
- const elm = hostRef.$hostElement$;
1358
- const flags = cmpMeta.$flags$;
1359
- const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
1360
- const scopeId2 = addStyle(
1361
- import_app_data5.BUILD.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
1362
- cmpMeta,
1363
- hostRef.$modeName$
1364
- );
1365
- if ((import_app_data5.BUILD.shadowDom || import_app_data5.BUILD.scoped) && import_app_data5.BUILD.cssAnnotations && flags & 10 /* needsScopedEncapsulation */) {
1366
- elm["s-sc"] = scopeId2;
1367
- elm.classList.add(scopeId2 + "-h");
1368
- }
1369
- endAttachStyles();
1370
- };
1371
- var getScopeId = (cmp, mode) => "sc-" + (import_app_data5.BUILD.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
1372
- var convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, "$1{");
1373
- var hydrateScopedToShadow = () => {
1374
- if (!win.document) {
1375
- return;
1376
- }
1377
- const styles2 = win.document.querySelectorAll(`[${HYDRATED_STYLE_ID}]`);
1378
- let i2 = 0;
1379
- for (; i2 < styles2.length; i2++) {
1380
- registerStyle(styles2[i2].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles2[i2].innerHTML), true);
1381
- }
1382
- };
1383
-
1384
1260
  // src/runtime/vdom/h.ts
1385
- var import_app_data6 = require("@stencil/core/internal/app-data");
1261
+ var import_app_data5 = require("@stencil/core/internal/app-data");
1386
1262
  var h = (nodeName, vnodeData, ...children) => {
1387
1263
  let child = null;
1388
1264
  let key = null;
@@ -1398,7 +1274,7 @@ var h = (nodeName, vnodeData, ...children) => {
1398
1274
  } else if (child != null && typeof child !== "boolean") {
1399
1275
  if (simple = typeof nodeName !== "function" && !isComplexType(child)) {
1400
1276
  child = String(child);
1401
- } else if (import_app_data6.BUILD.isDev && typeof nodeName !== "function" && child.$flags$ === void 0) {
1277
+ } else if (import_app_data5.BUILD.isDev && typeof nodeName !== "function" && child.$flags$ === void 0) {
1402
1278
  consoleDevError(`vNode passed as children has unexpected type.
1403
1279
  Make sure it's using the correct h() function.
1404
1280
  Empty objects can also be the cause, look for JSX comments that became objects.`);
@@ -1414,28 +1290,28 @@ Empty objects can also be the cause, look for JSX comments that became objects.`
1414
1290
  };
1415
1291
  walk(children);
1416
1292
  if (vnodeData) {
1417
- if (import_app_data6.BUILD.isDev && nodeName === "input") {
1293
+ if (import_app_data5.BUILD.isDev && nodeName === "input") {
1418
1294
  validateInputProperties(vnodeData);
1419
1295
  }
1420
- if (import_app_data6.BUILD.vdomKey && vnodeData.key) {
1296
+ if (import_app_data5.BUILD.vdomKey && vnodeData.key) {
1421
1297
  key = vnodeData.key;
1422
1298
  }
1423
- if (import_app_data6.BUILD.slotRelocation && vnodeData.name) {
1299
+ if (import_app_data5.BUILD.slotRelocation && vnodeData.name) {
1424
1300
  slotName = vnodeData.name;
1425
1301
  }
1426
- if (import_app_data6.BUILD.vdomClass) {
1302
+ if (import_app_data5.BUILD.vdomClass) {
1427
1303
  const classData = vnodeData.className || vnodeData.class;
1428
1304
  if (classData) {
1429
1305
  vnodeData.class = typeof classData !== "object" ? classData : Object.keys(classData).filter((k) => classData[k]).join(" ");
1430
1306
  }
1431
1307
  }
1432
1308
  }
1433
- if (import_app_data6.BUILD.isDev && vNodeChildren.some(isHost)) {
1309
+ if (import_app_data5.BUILD.isDev && vNodeChildren.some(isHost)) {
1434
1310
  consoleDevError(`The <Host> must be the single root component. Make sure:
1435
1311
  - You are NOT using hostData() and <Host> in the same component.
1436
1312
  - <Host> is used once, and it's the single root component of the render() function.`);
1437
1313
  }
1438
- if (import_app_data6.BUILD.vdomFunctional && typeof nodeName === "function") {
1314
+ if (import_app_data5.BUILD.vdomFunctional && typeof nodeName === "function") {
1439
1315
  return nodeName(
1440
1316
  vnodeData === null ? {} : vnodeData,
1441
1317
  vNodeChildren,
@@ -1447,10 +1323,10 @@ Empty objects can also be the cause, look for JSX comments that became objects.`
1447
1323
  if (vNodeChildren.length > 0) {
1448
1324
  vnode.$children$ = vNodeChildren;
1449
1325
  }
1450
- if (import_app_data6.BUILD.vdomKey) {
1326
+ if (import_app_data5.BUILD.vdomKey) {
1451
1327
  vnode.$key$ = key;
1452
1328
  }
1453
- if (import_app_data6.BUILD.slotRelocation) {
1329
+ if (import_app_data5.BUILD.slotRelocation) {
1454
1330
  vnode.$name$ = slotName;
1455
1331
  }
1456
1332
  return vnode;
@@ -1463,13 +1339,13 @@ var newVNode = (tag, text) => {
1463
1339
  $elm$: null,
1464
1340
  $children$: null
1465
1341
  };
1466
- if (import_app_data6.BUILD.vdomAttribute) {
1342
+ if (import_app_data5.BUILD.vdomAttribute) {
1467
1343
  vnode.$attrs$ = null;
1468
1344
  }
1469
- if (import_app_data6.BUILD.vdomKey) {
1345
+ if (import_app_data5.BUILD.vdomKey) {
1470
1346
  vnode.$key$ = null;
1471
1347
  }
1472
- if (import_app_data6.BUILD.slotRelocation) {
1348
+ if (import_app_data5.BUILD.slotRelocation) {
1473
1349
  vnode.$name$ = null;
1474
1350
  }
1475
1351
  return vnode;
@@ -1523,18 +1399,18 @@ var validateInputProperties = (inputElm) => {
1523
1399
 
1524
1400
  // src/runtime/client-hydrate.ts
1525
1401
  var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1526
- var _a, _b;
1402
+ var _a;
1527
1403
  const endHydrate = createTime("hydrateClient", tagName);
1528
1404
  const shadowRoot = hostElm.shadowRoot;
1529
1405
  const childRenderNodes = [];
1530
1406
  const slotNodes = [];
1531
1407
  const slottedNodes = [];
1532
- const shadowRootNodes = import_app_data7.BUILD.shadowDom && shadowRoot ? [] : null;
1408
+ const shadowRootNodes = import_app_data6.BUILD.shadowDom && shadowRoot ? [] : null;
1533
1409
  const vnode = newVNode(tagName, null);
1534
1410
  vnode.$elm$ = hostElm;
1535
1411
  const members = Object.entries(((_a = hostRef.$cmpMeta$) == null ? void 0 : _a.$members$) || {});
1536
1412
  members.forEach(([memberName, [memberFlags, metaAttributeName]]) => {
1537
- var _a2, _b2;
1413
+ var _a2, _b;
1538
1414
  if (!(memberFlags & 31 /* Prop */)) {
1539
1415
  return;
1540
1416
  }
@@ -1544,13 +1420,13 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1544
1420
  const attrPropVal = parsePropertyValue(
1545
1421
  attrVal,
1546
1422
  memberFlags,
1547
- import_app_data7.BUILD.formAssociated && !!(((_a2 = hostRef.$cmpMeta$) == null ? void 0 : _a2.$flags$) & 64 /* formAssociated */)
1423
+ import_app_data6.BUILD.formAssociated && !!(((_a2 = hostRef.$cmpMeta$) == null ? void 0 : _a2.$flags$) & 64 /* formAssociated */)
1548
1424
  );
1549
- (_b2 = hostRef == null ? void 0 : hostRef.$instanceValues$) == null ? void 0 : _b2.set(memberName, attrPropVal);
1425
+ (_b = hostRef == null ? void 0 : hostRef.$instanceValues$) == null ? void 0 : _b.set(memberName, attrPropVal);
1550
1426
  }
1551
1427
  });
1552
1428
  let scopeId2;
1553
- if (import_app_data7.BUILD.scoped) {
1429
+ if (import_app_data6.BUILD.scoped) {
1554
1430
  const cmpMeta = hostRef.$cmpMeta$;
1555
1431
  if (cmpMeta && cmpMeta.$flags$ & 10 /* needsScopedEncapsulation */ && hostElm["s-sc"]) {
1556
1432
  scopeId2 = hostElm["s-sc"];
@@ -1587,16 +1463,6 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1587
1463
  if (childRenderNode.$tag$ === "slot") {
1588
1464
  node["s-cr"] = hostElm["s-cr"];
1589
1465
  }
1590
- } else if (((_b = childRenderNode.$tag$) == null ? void 0 : _b.toString().includes("-")) && !childRenderNode.$elm$.shadowRoot) {
1591
- const cmpMeta = getHostRef(childRenderNode.$elm$);
1592
- const scopeId3 = getScopeId(
1593
- cmpMeta.$cmpMeta$,
1594
- import_app_data7.BUILD.mode ? childRenderNode.$elm$.getAttribute("s-mode") : void 0
1595
- );
1596
- const styleSheet = win.document.querySelector(`style[sty-id="${scopeId3}"]`);
1597
- if (styleSheet) {
1598
- hostElm.shadowRoot.append(styleSheet.cloneNode(true));
1599
- }
1600
1466
  }
1601
1467
  if (childRenderNode.$tag$ === "slot") {
1602
1468
  childRenderNode.$name$ = childRenderNode.$elm$["s-sn"] || childRenderNode.$elm$["name"] || null;
@@ -1612,7 +1478,7 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1612
1478
  }
1613
1479
  }
1614
1480
  if (orgLocationNode && orgLocationNode.isConnected) {
1615
- if (orgLocationNode.parentElement.shadowRoot && orgLocationNode["s-en"] === "") {
1481
+ if (shadowRoot && orgLocationNode["s-en"] === "") {
1616
1482
  orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
1617
1483
  }
1618
1484
  orgLocationNode.parentNode.removeChild(orgLocationNode);
@@ -1620,9 +1486,7 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1620
1486
  node["s-oo"] = parseInt(childRenderNode.$nodeId$);
1621
1487
  }
1622
1488
  }
1623
- if (orgLocationNode && !orgLocationNode["s-id"]) {
1624
- plt.$orgLocNodes$.delete(orgLocationId);
1625
- }
1489
+ plt.$orgLocNodes$.delete(orgLocationId);
1626
1490
  }
1627
1491
  const hosts = [];
1628
1492
  const snLen = slottedNodes.length;
@@ -1644,16 +1508,14 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1644
1508
  if (!hosts[slottedItem.hostId]) continue;
1645
1509
  const hostEle = hosts[slottedItem.hostId];
1646
1510
  if (!hostEle.shadowRoot || !shadowRoot) {
1647
- if (!slottedItem.slot["s-cr"]) {
1648
- slottedItem.slot["s-cr"] = hostEle["s-cr"];
1649
- if (!slottedItem.slot["s-cr"] && hostEle.shadowRoot) {
1650
- slottedItem.slot["s-cr"] = hostEle;
1651
- } else {
1652
- slottedItem.slot["s-cr"] = (hostEle.__childNodes || hostEle.childNodes)[0];
1653
- }
1511
+ slottedItem.slot["s-cr"] = hostEle["s-cr"];
1512
+ if (!slottedItem.slot["s-cr"] && hostEle.shadowRoot) {
1513
+ slottedItem.slot["s-cr"] = hostEle;
1514
+ } else {
1515
+ slottedItem.slot["s-cr"] = (hostEle.__childNodes || hostEle.childNodes)[0];
1654
1516
  }
1655
1517
  addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node["s-oo"]);
1656
- if (import_app_data7.BUILD.experimentalSlotFixes) {
1518
+ if (import_app_data6.BUILD.experimentalSlotFixes) {
1657
1519
  patchSlottedNode(slottedItem.node);
1658
1520
  }
1659
1521
  }
@@ -1662,12 +1524,12 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1662
1524
  }
1663
1525
  }
1664
1526
  }
1665
- if (import_app_data7.BUILD.scoped && scopeId2 && slotNodes.length) {
1527
+ if (import_app_data6.BUILD.scoped && scopeId2 && slotNodes.length) {
1666
1528
  slotNodes.forEach((slot) => {
1667
1529
  slot.$elm$.parentElement.classList.add(scopeId2 + "-s");
1668
1530
  });
1669
1531
  }
1670
- if (import_app_data7.BUILD.shadowDom && shadowRoot) {
1532
+ if (import_app_data6.BUILD.shadowDom && shadowRoot && !shadowRoot.childNodes.length) {
1671
1533
  let rnIdex = 0;
1672
1534
  const rnLen = shadowRootNodes.length;
1673
1535
  if (rnLen) {
@@ -1678,13 +1540,14 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1678
1540
  if (typeof node["s-en"] !== "string" && typeof node["s-sn"] !== "string") {
1679
1541
  if (node.nodeType === 1 /* ElementNode */ && node.slot && node.hidden) {
1680
1542
  node.removeAttribute("hidden");
1681
- } else if (node.nodeType === 8 /* CommentNode */ && !node.nodeValue || node.nodeType === 3 /* TextNode */ && !node.wholeText.trim()) {
1543
+ } else if (node.nodeType === 8 /* CommentNode */ || node.nodeType === 3 /* TextNode */ && !node.wholeText.trim()) {
1682
1544
  node.parentNode.removeChild(node);
1683
1545
  }
1684
1546
  }
1685
1547
  });
1686
1548
  }
1687
1549
  }
1550
+ plt.$orgLocNodes$.delete(hostElm["s-id"]);
1688
1551
  hostRef.$hostElement$ = hostElm;
1689
1552
  endHydrate();
1690
1553
  };
@@ -1716,7 +1579,7 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
1716
1579
  if (!parentVNode.$children$) {
1717
1580
  parentVNode.$children$ = [];
1718
1581
  }
1719
- if (import_app_data7.BUILD.scoped && scopeId2 && childIdSplt[0] === hostId) {
1582
+ if (import_app_data6.BUILD.scoped && scopeId2) {
1720
1583
  node["s-si"] = scopeId2;
1721
1584
  childVNode.$attrs$.class += " " + scopeId2;
1722
1585
  }
@@ -1734,7 +1597,7 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
1734
1597
  shadowRootNodes,
1735
1598
  slottedNodes
1736
1599
  );
1737
- if (import_app_data7.BUILD.scoped && scopeId2) {
1600
+ if (import_app_data6.BUILD.scoped && scopeId2) {
1738
1601
  node.classList.add(scopeId2);
1739
1602
  }
1740
1603
  }
@@ -1831,9 +1694,9 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
1831
1694
  slottedNodes
1832
1695
  );
1833
1696
  } else if (childNodeType === CONTENT_REF_ID) {
1834
- if (import_app_data7.BUILD.shadowDom && shadowRootNodes) {
1697
+ if (import_app_data6.BUILD.shadowDom && shadowRootNodes) {
1835
1698
  node.remove();
1836
- } else if (import_app_data7.BUILD.slotRelocation) {
1699
+ } else if (import_app_data6.BUILD.slotRelocation) {
1837
1700
  hostElm["s-cr"] = node;
1838
1701
  node["s-cn"] = true;
1839
1702
  }
@@ -1846,7 +1709,7 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
1846
1709
  vnode.$index$ = "0";
1847
1710
  parentVNode.$children$ = [vnode];
1848
1711
  } else {
1849
- if (node.nodeType === 3 /* TextNode */ && !node.wholeText.trim() && !node["s-nr"]) {
1712
+ if (node.nodeType === 3 /* TextNode */ && !node.wholeText.trim()) {
1850
1713
  node.remove();
1851
1714
  }
1852
1715
  }
@@ -1899,15 +1762,15 @@ function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNod
1899
1762
  childVNode.$name$ = slotName || null;
1900
1763
  childVNode.$tag$ = "slot";
1901
1764
  const parentNodeId = (parentVNode == null ? void 0 : parentVNode.$elm$) ? parentVNode.$elm$["s-id"] || parentVNode.$elm$.getAttribute("s-id") : "";
1902
- if (import_app_data7.BUILD.shadowDom && shadowRootNodes && win.document) {
1765
+ if (import_app_data6.BUILD.shadowDom && shadowRootNodes && win.document) {
1903
1766
  const slot = childVNode.$elm$ = win.document.createElement(childVNode.$tag$);
1904
1767
  if (childVNode.$name$) {
1905
1768
  childVNode.$elm$.setAttribute("name", slotName);
1906
1769
  }
1907
- if (parentVNode.$elm$.shadowRoot && parentNodeId && parentNodeId !== childVNode.$hostId$) {
1908
- internalCall(parentVNode.$elm$, "insertBefore")(slot, internalCall(parentVNode.$elm$, "children")[0]);
1770
+ if (parentNodeId && parentNodeId !== childVNode.$hostId$) {
1771
+ parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
1909
1772
  } else {
1910
- internalCall(internalCall(node, "parentNode"), "insertBefore")(slot, node);
1773
+ node.parentNode.insertBefore(slot, node);
1911
1774
  }
1912
1775
  addSlottedNodes(slottedNodes, slotId, slotName, node, childVNode.$hostId$);
1913
1776
  node.remove();
@@ -1933,7 +1796,7 @@ function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNod
1933
1796
  var addSlottedNodes = (slottedNodes, slotNodeId, slotName, slotNode, hostId) => {
1934
1797
  let slottedNode = slotNode.nextSibling;
1935
1798
  slottedNodes[slotNodeId] = slottedNodes[slotNodeId] || [];
1936
- while (slottedNode && ((slottedNode["getAttribute"] && slottedNode.getAttribute("slot") || slottedNode["s-sn"]) === slotName || slotName === "" && !slottedNode["s-sn"] && (slottedNode.nodeType === 8 /* CommentNode */ || slottedNode.nodeType === 3 /* TextNode */ || slottedNode.tagName === "SLOT"))) {
1799
+ while (slottedNode && ((slottedNode["getAttribute"] && slottedNode.getAttribute("slot") || slottedNode["s-sn"]) === slotName || slotName === "" && !slottedNode["s-sn"] && (slottedNode.nodeType === 8 /* CommentNode */ && slottedNode.nodeValue.indexOf(".") !== 1 || slottedNode.nodeType === 3 /* TextNode */))) {
1937
1800
  slottedNode["s-sn"] = slotName;
1938
1801
  slottedNodes[slotNodeId].push({ slot: slotNode, node: slottedNode, hostId });
1939
1802
  slottedNode = slottedNode.nextSibling;
@@ -2368,31 +2231,31 @@ var import_app_data16 = require("@stencil/core/internal/app-data");
2368
2231
  var import_app_data15 = require("@stencil/core/internal/app-data");
2369
2232
 
2370
2233
  // src/runtime/parse-property-value.ts
2371
- var import_app_data8 = require("@stencil/core/internal/app-data");
2234
+ var import_app_data7 = require("@stencil/core/internal/app-data");
2372
2235
  var parsePropertyValue = (propValue, propType, isFormAssociated) => {
2373
- if ((import_app_data8.BUILD.hydrateClientSide || import_app_data8.BUILD.hydrateServerSide) && typeof propValue === "string" && (propValue.startsWith("{") && propValue.endsWith("}") || propValue.startsWith("[") && propValue.endsWith("]"))) {
2236
+ if ((import_app_data7.BUILD.hydrateClientSide || import_app_data7.BUILD.hydrateServerSide) && typeof propValue === "string" && (propValue.startsWith("{") && propValue.endsWith("}") || propValue.startsWith("[") && propValue.endsWith("]"))) {
2374
2237
  try {
2375
2238
  propValue = JSON.parse(propValue);
2376
2239
  return propValue;
2377
2240
  } catch (e) {
2378
2241
  }
2379
2242
  }
2380
- if ((import_app_data8.BUILD.hydrateClientSide || import_app_data8.BUILD.hydrateServerSide) && typeof propValue === "string" && propValue.startsWith(SERIALIZED_PREFIX)) {
2243
+ if ((import_app_data7.BUILD.hydrateClientSide || import_app_data7.BUILD.hydrateServerSide) && typeof propValue === "string" && propValue.startsWith(SERIALIZED_PREFIX)) {
2381
2244
  propValue = deserializeProperty(propValue);
2382
2245
  return propValue;
2383
2246
  }
2384
2247
  if (propValue != null && !isComplexType(propValue)) {
2385
- if (import_app_data8.BUILD.propBoolean && propType & 4 /* Boolean */) {
2386
- if (import_app_data8.BUILD.formAssociated && isFormAssociated && typeof propValue === "string") {
2248
+ if (import_app_data7.BUILD.propBoolean && propType & 4 /* Boolean */) {
2249
+ if (import_app_data7.BUILD.formAssociated && isFormAssociated && typeof propValue === "string") {
2387
2250
  return propValue === "" || !!propValue;
2388
2251
  } else {
2389
2252
  return propValue === "false" ? false : propValue === "" || !!propValue;
2390
2253
  }
2391
2254
  }
2392
- if (import_app_data8.BUILD.propNumber && propType & 2 /* Number */) {
2255
+ if (import_app_data7.BUILD.propNumber && propType & 2 /* Number */) {
2393
2256
  return typeof propValue === "string" ? parseFloat(propValue) : typeof propValue === "number" ? propValue : NaN;
2394
2257
  }
2395
- if (import_app_data8.BUILD.propString && propType & 1 /* String */) {
2258
+ if (import_app_data7.BUILD.propString && propType & 1 /* String */) {
2396
2259
  return String(propValue);
2397
2260
  }
2398
2261
  return propValue;
@@ -2404,18 +2267,18 @@ var parsePropertyValue = (propValue, propType, isFormAssociated) => {
2404
2267
  var import_app_data14 = require("@stencil/core/internal/app-data");
2405
2268
 
2406
2269
  // src/runtime/event-emitter.ts
2407
- var import_app_data10 = require("@stencil/core/internal/app-data");
2270
+ var import_app_data9 = require("@stencil/core/internal/app-data");
2408
2271
 
2409
2272
  // src/runtime/element.ts
2410
- var import_app_data9 = require("@stencil/core/internal/app-data");
2411
- var getElement = (ref) => import_app_data9.BUILD.lazyLoad ? getHostRef(ref).$hostElement$ : ref;
2273
+ var import_app_data8 = require("@stencil/core/internal/app-data");
2274
+ var getElement = (ref) => import_app_data8.BUILD.lazyLoad ? getHostRef(ref).$hostElement$ : ref;
2412
2275
 
2413
2276
  // src/runtime/event-emitter.ts
2414
2277
  var createEvent = (ref, name, flags) => {
2415
2278
  const elm = getElement(ref);
2416
2279
  return {
2417
2280
  emit: (detail) => {
2418
- if (import_app_data10.BUILD.isDev && !elm.isConnected) {
2281
+ if (import_app_data9.BUILD.isDev && !elm.isConnected) {
2419
2282
  consoleDevWarn(`The "${name}" event was emitted, but the dispatcher node is no longer connected to the dom.`);
2420
2283
  }
2421
2284
  return emitEvent(elm, name, {
@@ -2433,6 +2296,123 @@ var emitEvent = (elm, name, opts) => {
2433
2296
  return ev;
2434
2297
  };
2435
2298
 
2299
+ // src/runtime/styles.ts
2300
+ var import_app_data10 = require("@stencil/core/internal/app-data");
2301
+ var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
2302
+ var registerStyle = (scopeId2, cssText, allowCS) => {
2303
+ let style = styles.get(scopeId2);
2304
+ if (supportsConstructableStylesheets && allowCS) {
2305
+ style = style || new CSSStyleSheet();
2306
+ if (typeof style === "string") {
2307
+ style = cssText;
2308
+ } else {
2309
+ style.replaceSync(cssText);
2310
+ }
2311
+ } else {
2312
+ style = cssText;
2313
+ }
2314
+ styles.set(scopeId2, style);
2315
+ };
2316
+ var addStyle = (styleContainerNode, cmpMeta, mode) => {
2317
+ var _a;
2318
+ const scopeId2 = getScopeId(cmpMeta, mode);
2319
+ const style = styles.get(scopeId2);
2320
+ if (!import_app_data10.BUILD.attachStyles || !win.document) {
2321
+ return scopeId2;
2322
+ }
2323
+ styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : win.document;
2324
+ if (style) {
2325
+ if (typeof style === "string") {
2326
+ styleContainerNode = styleContainerNode.head || styleContainerNode;
2327
+ let appliedStyles = rootAppliedStyles.get(styleContainerNode);
2328
+ let styleElm;
2329
+ if (!appliedStyles) {
2330
+ rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
2331
+ }
2332
+ if (!appliedStyles.has(scopeId2)) {
2333
+ if (import_app_data10.BUILD.hydrateClientSide && styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
2334
+ styleElm.innerHTML = style;
2335
+ } else {
2336
+ styleElm = win.document.createElement("style");
2337
+ styleElm.innerHTML = style;
2338
+ const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
2339
+ if (nonce != null) {
2340
+ styleElm.setAttribute("nonce", nonce);
2341
+ }
2342
+ if ((import_app_data10.BUILD.hydrateServerSide || import_app_data10.BUILD.hotModuleReplacement) && (cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */ || cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */)) {
2343
+ styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);
2344
+ }
2345
+ if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
2346
+ if (styleContainerNode.nodeName === "HEAD") {
2347
+ const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
2348
+ const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
2349
+ styleContainerNode.insertBefore(
2350
+ styleElm,
2351
+ (referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
2352
+ );
2353
+ } else if ("host" in styleContainerNode) {
2354
+ if (supportsConstructableStylesheets) {
2355
+ const stylesheet = new CSSStyleSheet();
2356
+ stylesheet.replaceSync(style);
2357
+ styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
2358
+ } else {
2359
+ const existingStyleContainer = styleContainerNode.querySelector("style");
2360
+ if (existingStyleContainer) {
2361
+ existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
2362
+ } else {
2363
+ styleContainerNode.prepend(styleElm);
2364
+ }
2365
+ }
2366
+ } else {
2367
+ styleContainerNode.append(styleElm);
2368
+ }
2369
+ }
2370
+ if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2371
+ styleContainerNode.insertBefore(styleElm, null);
2372
+ }
2373
+ }
2374
+ if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
2375
+ styleElm.innerHTML += SLOT_FB_CSS;
2376
+ }
2377
+ if (appliedStyles) {
2378
+ appliedStyles.add(scopeId2);
2379
+ }
2380
+ }
2381
+ } else if (import_app_data10.BUILD.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {
2382
+ styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
2383
+ }
2384
+ }
2385
+ return scopeId2;
2386
+ };
2387
+ var attachStyles = (hostRef) => {
2388
+ const cmpMeta = hostRef.$cmpMeta$;
2389
+ const elm = hostRef.$hostElement$;
2390
+ const flags = cmpMeta.$flags$;
2391
+ const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
2392
+ const scopeId2 = addStyle(
2393
+ import_app_data10.BUILD.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
2394
+ cmpMeta,
2395
+ hostRef.$modeName$
2396
+ );
2397
+ if ((import_app_data10.BUILD.shadowDom || import_app_data10.BUILD.scoped) && import_app_data10.BUILD.cssAnnotations && flags & 10 /* needsScopedEncapsulation */) {
2398
+ elm["s-sc"] = scopeId2;
2399
+ elm.classList.add(scopeId2 + "-h");
2400
+ }
2401
+ endAttachStyles();
2402
+ };
2403
+ var getScopeId = (cmp, mode) => "sc-" + (import_app_data10.BUILD.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
2404
+ var convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, "$1{");
2405
+ var hydrateScopedToShadow = () => {
2406
+ if (!win.document) {
2407
+ return;
2408
+ }
2409
+ const styles2 = win.document.querySelectorAll(`[${HYDRATED_STYLE_ID}]`);
2410
+ let i2 = 0;
2411
+ for (; i2 < styles2.length; i2++) {
2412
+ registerStyle(styles2[i2].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles2[i2].innerHTML), true);
2413
+ }
2414
+ };
2415
+
2436
2416
  // src/runtime/vdom/vdom-render.ts
2437
2417
  var import_app_data13 = require("@stencil/core/internal/app-data");
2438
2418
 
@@ -2451,13 +2431,12 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
2451
2431
  const classList = elm.classList;
2452
2432
  const oldClasses = parseClassList(oldValue);
2453
2433
  let newClasses = parseClassList(newValue);
2454
- if (import_app_data11.BUILD.hydrateClientSide && (elm["s-si"] || elm["s-sc"]) && initialRender) {
2455
- const scopeId2 = elm["s-sc"] || elm["s-si"];
2456
- newClasses.push(scopeId2);
2434
+ if (import_app_data11.BUILD.hydrateClientSide && elm["s-si"] && initialRender) {
2435
+ newClasses.push(elm["s-si"]);
2457
2436
  oldClasses.forEach((c) => {
2458
- if (c.startsWith(scopeId2)) newClasses.push(c);
2437
+ if (c.startsWith(elm["s-si"])) newClasses.push(c);
2459
2438
  });
2460
- newClasses = [...new Set(newClasses)].filter((c) => c);
2439
+ newClasses = [...new Set(newClasses)];
2461
2440
  classList.add(...newClasses);
2462
2441
  } else {
2463
2442
  classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
@@ -2939,8 +2918,6 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
2939
2918
  !isInitialRender && import_app_data13.BUILD.updatable && oldChildren !== null
2940
2919
  ) {
2941
2920
  removeVnodes(oldChildren, 0, oldChildren.length - 1);
2942
- } else if (import_app_data13.BUILD.hydrateClientSide && isInitialRender && import_app_data13.BUILD.updatable && oldChildren !== null && newChildren === null) {
2943
- newVNode2.$children$ = oldChildren;
2944
2921
  }
2945
2922
  if (import_app_data13.BUILD.svg && isSvgMode && tag === "svg") {
2946
2923
  isSvgMode = false;
@@ -3408,16 +3385,10 @@ var forceUpdate = (ref) => {
3408
3385
  return false;
3409
3386
  };
3410
3387
  var appDidLoad = (who) => {
3411
- var _a;
3412
3388
  if (import_app_data14.BUILD.asyncQueue) {
3413
3389
  plt.$flags$ |= 2 /* appLoaded */;
3414
3390
  }
3415
3391
  nextTick(() => emitEvent(win, "appload", { detail: { namespace: import_app_data14.NAMESPACE } }));
3416
- if (import_app_data14.BUILD.hydrateClientSide) {
3417
- if ((_a = plt.$orgLocNodes$) == null ? void 0 : _a.size) {
3418
- plt.$orgLocNodes$.clear();
3419
- }
3420
- }
3421
3392
  if (import_app_data14.BUILD.profile && performance.measure) {
3422
3393
  performance.measure(`[Stencil] ${import_app_data14.NAMESPACE} initial load (by ${who})`, "st:app:start");
3423
3394
  }
@@ -3849,11 +3820,6 @@ var connectedCallback = (elm) => {
3849
3820
  if (import_app_data18.BUILD.hydrateServerSide || (import_app_data18.BUILD.slot || import_app_data18.BUILD.shadowDom) && // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
3850
3821
  cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */)) {
3851
3822
  setContentReference(elm);
3852
- } else if (import_app_data18.BUILD.hydrateClientSide && !(cmpMeta.$flags$ & 4 /* hasSlotRelocation */)) {
3853
- const commendPlaceholder = elm.firstChild;
3854
- if ((commendPlaceholder == null ? void 0 : commendPlaceholder.nodeType) === 8 /* CommentNode */ && !commendPlaceholder["s-cn"] && !commendPlaceholder.nodeValue) {
3855
- elm.removeChild(commendPlaceholder);
3856
- }
3857
3823
  }
3858
3824
  }
3859
3825
  if (import_app_data18.BUILD.asyncLoading) {