@stencil/core 4.18.3 → 4.19.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 (47) hide show
  1. package/cli/index.cjs +43 -16
  2. package/cli/index.js +43 -16
  3. package/cli/package.json +1 -1
  4. package/compiler/package.json +1 -1
  5. package/compiler/stencil.js +175 -72
  6. package/dev-server/client/index.js +1 -1
  7. package/dev-server/client/package.json +1 -1
  8. package/dev-server/connector.html +3 -3
  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/dev-server/ws.js +1 -1
  13. package/internal/app-data/package.json +1 -1
  14. package/internal/client/index.js +534 -507
  15. package/internal/client/package.json +3 -1
  16. package/internal/client/patch-browser.js +1 -1
  17. package/internal/hydrate/index.js +108 -50
  18. package/internal/hydrate/package.json +1 -1
  19. package/internal/hydrate/runner.d.ts +29 -11
  20. package/internal/hydrate/runner.js +239 -260
  21. package/internal/package.json +1 -1
  22. package/internal/stencil-private.d.ts +39 -14
  23. package/internal/stencil-public-compiler.d.ts +21 -0
  24. package/internal/stencil-public-runtime.d.ts +0 -2
  25. package/internal/testing/index.js +439 -407
  26. package/internal/testing/package.json +1 -1
  27. package/mock-doc/index.cjs +137 -131
  28. package/mock-doc/index.d.ts +18 -4
  29. package/mock-doc/index.js +137 -131
  30. package/mock-doc/package.json +1 -1
  31. package/package.json +34 -6
  32. package/screenshot/index.js +1 -1
  33. package/screenshot/package.json +1 -1
  34. package/screenshot/pixel-match.js +1 -1
  35. package/sys/node/index.js +10 -10
  36. package/sys/node/package.json +1 -1
  37. package/sys/node/worker.js +1 -1
  38. package/testing/index.js +95 -16
  39. package/testing/jest/jest-27-and-under/matchers/events.d.ts +4 -0
  40. package/testing/jest/jest-27-and-under/matchers/index.d.ts +2 -1
  41. package/testing/jest/jest-28/matchers/events.d.ts +4 -0
  42. package/testing/jest/jest-28/matchers/index.d.ts +2 -1
  43. package/testing/jest/jest-29/matchers/events.d.ts +4 -0
  44. package/testing/jest/jest-29/matchers/index.d.ts +2 -1
  45. package/testing/mocks.d.ts +9 -9
  46. package/testing/package.json +1 -1
  47. package/testing/puppeteer/puppeteer-declarations.d.ts +11 -0
@@ -1,5 +1,5 @@
1
1
  /*
2
- Stencil Client Platform v4.18.3 | MIT Licensed | https://stenciljs.com
2
+ Stencil Client Platform v4.19.0 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  var __defProp = Object.defineProperty;
5
5
  var __export = (target, all) => {
@@ -17,7 +17,225 @@ var Build = {
17
17
  };
18
18
 
19
19
  // src/client/client-host-ref.ts
20
- import { BUILD as BUILD22 } from "@stencil/core/internal/app-data";
20
+ import { BUILD as BUILD2 } from "@stencil/core/internal/app-data";
21
+ var hostRefs = BUILD2.hotModuleReplacement ? window.__STENCIL_HOSTREFS__ || (window.__STENCIL_HOSTREFS__ = /* @__PURE__ */ new WeakMap()) : /* @__PURE__ */ new WeakMap();
22
+ var getHostRef = (ref) => hostRefs.get(ref);
23
+ var registerInstance = (lazyInstance, hostRef) => hostRefs.set(hostRef.$lazyInstance$ = lazyInstance, hostRef);
24
+ var registerHost = (hostElement, cmpMeta) => {
25
+ const hostRef = {
26
+ $flags$: 0,
27
+ $hostElement$: hostElement,
28
+ $cmpMeta$: cmpMeta,
29
+ $instanceValues$: /* @__PURE__ */ new Map()
30
+ };
31
+ if (BUILD2.isDev) {
32
+ hostRef.$renderCount$ = 0;
33
+ }
34
+ if (BUILD2.method && BUILD2.lazyLoad) {
35
+ hostRef.$onInstancePromise$ = new Promise((r) => hostRef.$onInstanceResolve$ = r);
36
+ }
37
+ if (BUILD2.asyncLoading) {
38
+ hostRef.$onReadyPromise$ = new Promise((r) => hostRef.$onReadyResolve$ = r);
39
+ hostElement["s-p"] = [];
40
+ hostElement["s-rc"] = [];
41
+ }
42
+ return hostRefs.set(hostElement, hostRef);
43
+ };
44
+ var isMemberInElement = (elm, memberName) => memberName in elm;
45
+
46
+ // src/client/client-load-module.ts
47
+ import { BUILD as BUILD4 } from "@stencil/core/internal/app-data";
48
+
49
+ // src/client/client-log.ts
50
+ import { BUILD as BUILD3 } from "@stencil/core/internal/app-data";
51
+ var customError;
52
+ var consoleError = (e, el) => (customError || console.error)(e, el);
53
+ var STENCIL_DEV_MODE = BUILD3.isTesting ? ["STENCIL:"] : [
54
+ "%cstencil",
55
+ "color: white;background:#4c47ff;font-weight: bold; font-size:10px; padding:2px 6px; border-radius: 5px"
56
+ ];
57
+ var consoleDevError = (...m) => console.error(...STENCIL_DEV_MODE, ...m);
58
+ var consoleDevWarn = (...m) => console.warn(...STENCIL_DEV_MODE, ...m);
59
+ var consoleDevInfo = (...m) => console.info(...STENCIL_DEV_MODE, ...m);
60
+ var setErrorHandler = (handler) => customError = handler;
61
+
62
+ // src/client/client-load-module.ts
63
+ var cmpModules = /* @__PURE__ */ new Map();
64
+ var MODULE_IMPORT_PREFIX = "./";
65
+ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
66
+ const exportName = cmpMeta.$tagName$.replace(/-/g, "_");
67
+ const bundleId = cmpMeta.$lazyBundleId$;
68
+ if (BUILD4.isDev && typeof bundleId !== "string") {
69
+ consoleDevError(
70
+ `Trying to lazily load component <${cmpMeta.$tagName$}> with style mode "${hostRef.$modeName$}", but it does not exist.`
71
+ );
72
+ return void 0;
73
+ } else if (!bundleId) {
74
+ return void 0;
75
+ }
76
+ const module = !BUILD4.hotModuleReplacement ? cmpModules.get(bundleId) : false;
77
+ if (module) {
78
+ return module[exportName];
79
+ }
80
+ /*!__STENCIL_STATIC_IMPORT_SWITCH__*/
81
+ return import(
82
+ /* @vite-ignore */
83
+ /* webpackInclude: /\.entry\.js$/ */
84
+ /* webpackExclude: /\.system\.entry\.js$/ */
85
+ /* webpackMode: "lazy" */
86
+ `./${bundleId}.entry.js${BUILD4.hotModuleReplacement && hmrVersionId ? "?s-hmr=" + hmrVersionId : ""}`
87
+ ).then((importedModule) => {
88
+ if (!BUILD4.hotModuleReplacement) {
89
+ cmpModules.set(bundleId, importedModule);
90
+ }
91
+ return importedModule[exportName];
92
+ }, consoleError);
93
+ };
94
+
95
+ // src/client/client-style.ts
96
+ var styles = /* @__PURE__ */ new Map();
97
+ var modeResolutionChain = [];
98
+
99
+ // src/client/client-task-queue.ts
100
+ import { BUILD as BUILD6 } from "@stencil/core/internal/app-data";
101
+
102
+ // src/runtime/runtime-constants.ts
103
+ var CONTENT_REF_ID = "r";
104
+ var ORG_LOCATION_ID = "o";
105
+ var SLOT_NODE_ID = "s";
106
+ var TEXT_NODE_ID = "t";
107
+ var HYDRATE_ID = "s-id";
108
+ var HYDRATED_STYLE_ID = "sty-id";
109
+ var HYDRATE_CHILD_ID = "c-id";
110
+ var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
111
+ var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
112
+ var XLINK_NS = "http://www.w3.org/1999/xlink";
113
+ var FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS = [
114
+ "formAssociatedCallback",
115
+ "formResetCallback",
116
+ "formDisabledCallback",
117
+ "formStateRestoreCallback"
118
+ ];
119
+
120
+ // src/client/client-window.ts
121
+ import { BUILD as BUILD5 } from "@stencil/core/internal/app-data";
122
+ var win = typeof window !== "undefined" ? window : {};
123
+ var doc = win.document || { head: {} };
124
+ var H = win.HTMLElement || class {
125
+ };
126
+ var plt = {
127
+ $flags$: 0,
128
+ $resourcesUrl$: "",
129
+ jmp: (h2) => h2(),
130
+ raf: (h2) => requestAnimationFrame(h2),
131
+ ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
132
+ rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
133
+ ce: (eventName, opts) => new CustomEvent(eventName, opts)
134
+ };
135
+ var setPlatformHelpers = (helpers) => {
136
+ Object.assign(plt, helpers);
137
+ };
138
+ var supportsShadow = BUILD5.shadowDom;
139
+ var supportsListenerOptions = /* @__PURE__ */ (() => {
140
+ let supportsListenerOptions2 = false;
141
+ try {
142
+ doc.addEventListener(
143
+ "e",
144
+ null,
145
+ Object.defineProperty({}, "passive", {
146
+ get() {
147
+ supportsListenerOptions2 = true;
148
+ }
149
+ })
150
+ );
151
+ } catch (e) {
152
+ }
153
+ return supportsListenerOptions2;
154
+ })();
155
+ var promiseResolve = (v) => Promise.resolve(v);
156
+ var supportsConstructableStylesheets = BUILD5.constructableCSS ? /* @__PURE__ */ (() => {
157
+ try {
158
+ new CSSStyleSheet();
159
+ return typeof new CSSStyleSheet().replaceSync === "function";
160
+ } catch (e) {
161
+ }
162
+ return false;
163
+ })() : false;
164
+
165
+ // src/client/client-task-queue.ts
166
+ var queueCongestion = 0;
167
+ var queuePending = false;
168
+ var queueDomReads = [];
169
+ var queueDomWrites = [];
170
+ var queueDomWritesLow = [];
171
+ var queueTask = (queue, write) => (cb) => {
172
+ queue.push(cb);
173
+ if (!queuePending) {
174
+ queuePending = true;
175
+ if (write && plt.$flags$ & 4 /* queueSync */) {
176
+ nextTick(flush);
177
+ } else {
178
+ plt.raf(flush);
179
+ }
180
+ }
181
+ };
182
+ var consume = (queue) => {
183
+ for (let i2 = 0; i2 < queue.length; i2++) {
184
+ try {
185
+ queue[i2](performance.now());
186
+ } catch (e) {
187
+ consoleError(e);
188
+ }
189
+ }
190
+ queue.length = 0;
191
+ };
192
+ var consumeTimeout = (queue, timeout) => {
193
+ let i2 = 0;
194
+ let ts = 0;
195
+ while (i2 < queue.length && (ts = performance.now()) < timeout) {
196
+ try {
197
+ queue[i2++](ts);
198
+ } catch (e) {
199
+ consoleError(e);
200
+ }
201
+ }
202
+ if (i2 === queue.length) {
203
+ queue.length = 0;
204
+ } else if (i2 !== 0) {
205
+ queue.splice(0, i2);
206
+ }
207
+ };
208
+ var flush = () => {
209
+ if (BUILD6.asyncQueue) {
210
+ queueCongestion++;
211
+ }
212
+ consume(queueDomReads);
213
+ if (BUILD6.asyncQueue) {
214
+ const timeout = (plt.$flags$ & 6 /* queueMask */) === 2 /* appLoaded */ ? performance.now() + 14 * Math.ceil(queueCongestion * (1 / 10)) : Infinity;
215
+ consumeTimeout(queueDomWrites, timeout);
216
+ consumeTimeout(queueDomWritesLow, timeout);
217
+ if (queueDomWrites.length > 0) {
218
+ queueDomWritesLow.push(...queueDomWrites);
219
+ queueDomWrites.length = 0;
220
+ }
221
+ if (queuePending = queueDomReads.length + queueDomWrites.length + queueDomWritesLow.length > 0) {
222
+ plt.raf(flush);
223
+ } else {
224
+ queueCongestion = 0;
225
+ }
226
+ } else {
227
+ consume(queueDomWrites);
228
+ if (queuePending = queueDomReads.length > 0) {
229
+ plt.raf(flush);
230
+ }
231
+ }
232
+ };
233
+ var nextTick = (cb) => promiseResolve().then(cb);
234
+ var readTask = /* @__PURE__ */ queueTask(queueDomReads, false);
235
+ var writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);
236
+
237
+ // src/client/index.ts
238
+ import { BUILD as BUILD27, Env, NAMESPACE as NAMESPACE2 } from "@stencil/core/internal/app-data";
21
239
 
22
240
  // src/runtime/asset-path.ts
23
241
  var getAssetPath = (path) => {
@@ -27,7 +245,7 @@ var getAssetPath = (path) => {
27
245
  var setAssetPath = (path) => plt.$resourcesUrl$ = path;
28
246
 
29
247
  // src/runtime/bootstrap-custom-element.ts
30
- import { BUILD as BUILD19 } from "@stencil/core/internal/app-data";
248
+ import { BUILD as BUILD24 } from "@stencil/core/internal/app-data";
31
249
 
32
250
  // src/utils/constants.ts
33
251
  var EMPTY_OBJ = {};
@@ -97,16 +315,16 @@ var unwrapErr = (result) => {
97
315
  };
98
316
 
99
317
  // src/runtime/connected-callback.ts
100
- import { BUILD as BUILD16 } from "@stencil/core/internal/app-data";
318
+ import { BUILD as BUILD21 } from "@stencil/core/internal/app-data";
101
319
 
102
320
  // src/runtime/client-hydrate.ts
103
- import { BUILD as BUILD4 } from "@stencil/core/internal/app-data";
321
+ import { BUILD as BUILD9 } from "@stencil/core/internal/app-data";
104
322
 
105
323
  // src/runtime/profile.ts
106
- import { BUILD as BUILD2 } from "@stencil/core/internal/app-data";
324
+ import { BUILD as BUILD7 } from "@stencil/core/internal/app-data";
107
325
  var i = 0;
108
326
  var createTime = (fnName, tagName = "") => {
109
- if (BUILD2.profile && performance.mark) {
327
+ if (BUILD7.profile && performance.mark) {
110
328
  const key = `st:${fnName}:${tagName}:${i++}`;
111
329
  performance.mark(key);
112
330
  return () => performance.measure(`[Stencil] ${fnName}() <${tagName}>`, key);
@@ -117,7 +335,7 @@ var createTime = (fnName, tagName = "") => {
117
335
  }
118
336
  };
119
337
  var uniqueTime = (key, measureText) => {
120
- if (BUILD2.profile && performance.mark) {
338
+ if (BUILD7.profile && performance.mark) {
121
339
  if (performance.getEntriesByName(key, "mark").length === 0) {
122
340
  performance.mark(key);
123
341
  }
@@ -175,7 +393,7 @@ var inspect = (ref) => {
175
393
  };
176
394
  };
177
395
  var installDevTools = () => {
178
- if (BUILD2.devTools) {
396
+ if (BUILD7.devTools) {
179
397
  const stencil = win.stencil = win.stencil || {};
180
398
  const originalInspect = stencil.inspect;
181
399
  stencil.inspect = (ref) => {
@@ -188,26 +406,8 @@ var installDevTools = () => {
188
406
  }
189
407
  };
190
408
 
191
- // src/runtime/runtime-constants.ts
192
- var CONTENT_REF_ID = "r";
193
- var ORG_LOCATION_ID = "o";
194
- var SLOT_NODE_ID = "s";
195
- var TEXT_NODE_ID = "t";
196
- var HYDRATE_ID = "s-id";
197
- var HYDRATED_STYLE_ID = "sty-id";
198
- var HYDRATE_CHILD_ID = "c-id";
199
- var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
200
- var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
201
- var XLINK_NS = "http://www.w3.org/1999/xlink";
202
- var FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS = [
203
- "formAssociatedCallback",
204
- "formResetCallback",
205
- "formDisabledCallback",
206
- "formStateRestoreCallback"
207
- ];
208
-
209
409
  // src/runtime/vdom/h.ts
210
- import { BUILD as BUILD3 } from "@stencil/core/internal/app-data";
410
+ import { BUILD as BUILD8 } from "@stencil/core/internal/app-data";
211
411
  var h = (nodeName, vnodeData, ...children) => {
212
412
  let child = null;
213
413
  let key = null;
@@ -223,7 +423,7 @@ var h = (nodeName, vnodeData, ...children) => {
223
423
  } else if (child != null && typeof child !== "boolean") {
224
424
  if (simple = typeof nodeName !== "function" && !isComplexType(child)) {
225
425
  child = String(child);
226
- } else if (BUILD3.isDev && typeof nodeName !== "function" && child.$flags$ === void 0) {
426
+ } else if (BUILD8.isDev && typeof nodeName !== "function" && child.$flags$ === void 0) {
227
427
  consoleDevError(`vNode passed as children has unexpected type.
228
428
  Make sure it's using the correct h() function.
229
429
  Empty objects can also be the cause, look for JSX comments that became objects.`);
@@ -239,28 +439,28 @@ Empty objects can also be the cause, look for JSX comments that became objects.`
239
439
  };
240
440
  walk(children);
241
441
  if (vnodeData) {
242
- if (BUILD3.isDev && nodeName === "input") {
442
+ if (BUILD8.isDev && nodeName === "input") {
243
443
  validateInputProperties(vnodeData);
244
444
  }
245
- if (BUILD3.vdomKey && vnodeData.key) {
445
+ if (BUILD8.vdomKey && vnodeData.key) {
246
446
  key = vnodeData.key;
247
447
  }
248
- if (BUILD3.slotRelocation && vnodeData.name) {
448
+ if (BUILD8.slotRelocation && vnodeData.name) {
249
449
  slotName = vnodeData.name;
250
450
  }
251
- if (BUILD3.vdomClass) {
451
+ if (BUILD8.vdomClass) {
252
452
  const classData = vnodeData.className || vnodeData.class;
253
453
  if (classData) {
254
454
  vnodeData.class = typeof classData !== "object" ? classData : Object.keys(classData).filter((k) => classData[k]).join(" ");
255
455
  }
256
456
  }
257
457
  }
258
- if (BUILD3.isDev && vNodeChildren.some(isHost)) {
458
+ if (BUILD8.isDev && vNodeChildren.some(isHost)) {
259
459
  consoleDevError(`The <Host> must be the single root component. Make sure:
260
460
  - You are NOT using hostData() and <Host> in the same component.
261
461
  - <Host> is used once, and it's the single root component of the render() function.`);
262
462
  }
263
- if (BUILD3.vdomFunctional && typeof nodeName === "function") {
463
+ if (BUILD8.vdomFunctional && typeof nodeName === "function") {
264
464
  return nodeName(
265
465
  vnodeData === null ? {} : vnodeData,
266
466
  vNodeChildren,
@@ -272,10 +472,10 @@ Empty objects can also be the cause, look for JSX comments that became objects.`
272
472
  if (vNodeChildren.length > 0) {
273
473
  vnode.$children$ = vNodeChildren;
274
474
  }
275
- if (BUILD3.vdomKey) {
475
+ if (BUILD8.vdomKey) {
276
476
  vnode.$key$ = key;
277
477
  }
278
- if (BUILD3.slotRelocation) {
478
+ if (BUILD8.slotRelocation) {
279
479
  vnode.$name$ = slotName;
280
480
  }
281
481
  return vnode;
@@ -288,13 +488,13 @@ var newVNode = (tag, text) => {
288
488
  $elm$: null,
289
489
  $children$: null
290
490
  };
291
- if (BUILD3.vdomAttribute) {
491
+ if (BUILD8.vdomAttribute) {
292
492
  vnode.$attrs$ = null;
293
493
  }
294
- if (BUILD3.vdomKey) {
494
+ if (BUILD8.vdomKey) {
295
495
  vnode.$key$ = null;
296
496
  }
297
- if (BUILD3.slotRelocation) {
497
+ if (BUILD8.slotRelocation) {
298
498
  vnode.$name$ = null;
299
499
  }
300
500
  return vnode;
@@ -352,7 +552,7 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
352
552
  const shadowRoot = hostElm.shadowRoot;
353
553
  const childRenderNodes = [];
354
554
  const slotNodes = [];
355
- const shadowRootNodes = BUILD4.shadowDom && shadowRoot ? [] : null;
555
+ const shadowRootNodes = BUILD9.shadowDom && shadowRoot ? [] : null;
356
556
  const vnode = hostRef.$vnode$ = newVNode(tagName, null);
357
557
  if (!plt.$orgLocNodes$) {
358
558
  initializeDocumentHydrate(doc.body, plt.$orgLocNodes$ = /* @__PURE__ */ new Map());
@@ -376,7 +576,7 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
376
576
  }
377
577
  plt.$orgLocNodes$.delete(orgLocationId);
378
578
  });
379
- if (BUILD4.shadowDom && shadowRoot) {
579
+ if (BUILD9.shadowDom && shadowRoot) {
380
580
  shadowRootNodes.map((shadowRootNode) => {
381
581
  if (shadowRootNode) {
382
582
  shadowRoot.appendChild(shadowRootNode);
@@ -486,7 +686,7 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
486
686
  node["s-sn"] = "";
487
687
  }
488
688
  node["s-sr"] = true;
489
- if (BUILD4.shadowDom && shadowRootNodes) {
689
+ if (BUILD9.shadowDom && shadowRootNodes) {
490
690
  childVNode.$elm$ = doc.createElement(childVNode.$tag$);
491
691
  if (childVNode.$name$) {
492
692
  childVNode.$elm$.setAttribute("name", childVNode.$name$);
@@ -503,9 +703,9 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
503
703
  }
504
704
  parentVNode.$children$[childVNode.$index$] = childVNode;
505
705
  } else if (childNodeType === CONTENT_REF_ID) {
506
- if (BUILD4.shadowDom && shadowRootNodes) {
706
+ if (BUILD9.shadowDom && shadowRootNodes) {
507
707
  node.remove();
508
- } else if (BUILD4.slotRelocation) {
708
+ } else if (BUILD9.slotRelocation) {
509
709
  hostElm["s-cr"] = node;
510
710
  node["s-cn"] = true;
511
711
  }
@@ -541,7 +741,7 @@ var initializeDocumentHydrate = (node, orgLocNodes) => {
541
741
  };
542
742
 
543
743
  // src/runtime/initialize-component.ts
544
- import { BUILD as BUILD15 } from "@stencil/core/internal/app-data";
744
+ import { BUILD as BUILD20 } from "@stencil/core/internal/app-data";
545
745
 
546
746
  // src/runtime/mode.ts
547
747
  var computeMode = (elm) => modeResolutionChain.map((h2) => h2(elm)).find((m) => !!m);
@@ -549,22 +749,22 @@ var setMode = (handler) => modeResolutionChain.push(handler);
549
749
  var getMode = (ref) => getHostRef(ref).$modeName$;
550
750
 
551
751
  // src/runtime/proxy-component.ts
552
- import { BUILD as BUILD14 } from "@stencil/core/internal/app-data";
752
+ import { BUILD as BUILD19 } from "@stencil/core/internal/app-data";
553
753
 
554
754
  // src/runtime/set-value.ts
555
- import { BUILD as BUILD13 } from "@stencil/core/internal/app-data";
755
+ import { BUILD as BUILD18 } from "@stencil/core/internal/app-data";
556
756
 
557
757
  // src/runtime/parse-property-value.ts
558
- import { BUILD as BUILD5 } from "@stencil/core/internal/app-data";
758
+ import { BUILD as BUILD10 } from "@stencil/core/internal/app-data";
559
759
  var parsePropertyValue = (propValue, propType) => {
560
760
  if (propValue != null && !isComplexType(propValue)) {
561
- if (BUILD5.propBoolean && propType & 4 /* Boolean */) {
761
+ if (BUILD10.propBoolean && propType & 4 /* Boolean */) {
562
762
  return propValue === "false" ? false : propValue === "" || !!propValue;
563
763
  }
564
- if (BUILD5.propNumber && propType & 2 /* Number */) {
764
+ if (BUILD10.propNumber && propType & 2 /* Number */) {
565
765
  return parseFloat(propValue);
566
766
  }
567
- if (BUILD5.propString && propType & 1 /* String */) {
767
+ if (BUILD10.propString && propType & 1 /* String */) {
568
768
  return String(propValue);
569
769
  }
570
770
  return propValue;
@@ -573,21 +773,21 @@ var parsePropertyValue = (propValue, propType) => {
573
773
  };
574
774
 
575
775
  // src/runtime/update-component.ts
576
- import { BUILD as BUILD12, NAMESPACE } from "@stencil/core/internal/app-data";
776
+ import { BUILD as BUILD17, NAMESPACE } from "@stencil/core/internal/app-data";
577
777
 
578
778
  // src/runtime/event-emitter.ts
579
- import { BUILD as BUILD7 } from "@stencil/core/internal/app-data";
779
+ import { BUILD as BUILD12 } from "@stencil/core/internal/app-data";
580
780
 
581
781
  // src/runtime/element.ts
582
- import { BUILD as BUILD6 } from "@stencil/core/internal/app-data";
583
- var getElement = (ref) => BUILD6.lazyLoad ? getHostRef(ref).$hostElement$ : ref;
782
+ import { BUILD as BUILD11 } from "@stencil/core/internal/app-data";
783
+ var getElement = (ref) => BUILD11.lazyLoad ? getHostRef(ref).$hostElement$ : ref;
584
784
 
585
785
  // src/runtime/event-emitter.ts
586
786
  var createEvent = (ref, name, flags) => {
587
787
  const elm = getElement(ref);
588
788
  return {
589
789
  emit: (detail) => {
590
- if (BUILD7.isDev && !elm.isConnected) {
790
+ if (BUILD12.isDev && !elm.isConnected) {
591
791
  consoleDevWarn(`The "${name}" event was emitted, but the dispatcher node is no longer connected to the dom.`);
592
792
  }
593
793
  return emitEvent(elm, name, {
@@ -606,7 +806,7 @@ var emitEvent = (elm, name, opts) => {
606
806
  };
607
807
 
608
808
  // src/runtime/styles.ts
609
- import { BUILD as BUILD8 } from "@stencil/core/internal/app-data";
809
+ import { BUILD as BUILD13 } from "@stencil/core/internal/app-data";
610
810
  var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
611
811
  var registerStyle = (scopeId2, cssText, allowCS) => {
612
812
  let style = styles.get(scopeId2);
@@ -624,22 +824,24 @@ var registerStyle = (scopeId2, cssText, allowCS) => {
624
824
  };
625
825
  var addStyle = (styleContainerNode, cmpMeta, mode) => {
626
826
  var _a;
827
+ const styleContainerDocument = styleContainerNode;
828
+ const styleContainerShadowRoot = styleContainerNode;
627
829
  const scopeId2 = getScopeId(cmpMeta, mode);
628
830
  const style = styles.get(scopeId2);
629
- if (!BUILD8.attachStyles) {
831
+ if (!BUILD13.attachStyles) {
630
832
  return scopeId2;
631
833
  }
632
834
  styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
633
835
  if (style) {
634
836
  if (typeof style === "string") {
635
- styleContainerNode = styleContainerNode.head || styleContainerNode;
837
+ styleContainerNode = styleContainerDocument.head || styleContainerNode;
636
838
  let appliedStyles = rootAppliedStyles.get(styleContainerNode);
637
839
  let styleElm;
638
840
  if (!appliedStyles) {
639
841
  rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
640
842
  }
641
843
  if (!appliedStyles.has(scopeId2)) {
642
- if (BUILD8.hydrateClientSide && styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
844
+ if (BUILD13.hydrateClientSide && styleContainerShadowRoot.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
643
845
  styleElm.innerHTML = style;
644
846
  } else {
645
847
  styleElm = doc.createElement("style");
@@ -648,7 +850,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
648
850
  if (nonce != null) {
649
851
  styleElm.setAttribute("nonce", nonce);
650
852
  }
651
- if (BUILD8.hydrateServerSide || BUILD8.hotModuleReplacement) {
853
+ if (BUILD13.hydrateServerSide || BUILD13.hotModuleReplacement) {
652
854
  styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);
653
855
  }
654
856
  styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector("link"));
@@ -660,8 +862,8 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
660
862
  appliedStyles.add(scopeId2);
661
863
  }
662
864
  }
663
- } else if (BUILD8.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {
664
- styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
865
+ } else if (BUILD13.constructableCSS && !styleContainerDocument.adoptedStyleSheets.includes(style)) {
866
+ styleContainerDocument.adoptedStyleSheets = [...styleContainerDocument.adoptedStyleSheets, style];
665
867
  }
666
868
  }
667
869
  return scopeId2;
@@ -672,45 +874,45 @@ var attachStyles = (hostRef) => {
672
874
  const flags = cmpMeta.$flags$;
673
875
  const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
674
876
  const scopeId2 = addStyle(
675
- BUILD8.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
877
+ BUILD13.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
676
878
  cmpMeta,
677
879
  hostRef.$modeName$
678
880
  );
679
- if ((BUILD8.shadowDom || BUILD8.scoped) && BUILD8.cssAnnotations && flags & 10 /* needsScopedEncapsulation */) {
881
+ if ((BUILD13.shadowDom || BUILD13.scoped) && BUILD13.cssAnnotations && flags & 10 /* needsScopedEncapsulation */) {
680
882
  elm["s-sc"] = scopeId2;
681
883
  elm.classList.add(scopeId2 + "-h");
682
- if (BUILD8.scoped && flags & 2 /* scopedCssEncapsulation */) {
884
+ if (BUILD13.scoped && flags & 2 /* scopedCssEncapsulation */) {
683
885
  elm.classList.add(scopeId2 + "-s");
684
886
  }
685
887
  }
686
888
  endAttachStyles();
687
889
  };
688
- var getScopeId = (cmp, mode) => "sc-" + (BUILD8.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
890
+ var getScopeId = (cmp, mode) => "sc-" + (BUILD13.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
689
891
  var convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, "$1{");
690
892
 
691
893
  // src/runtime/vdom/vdom-render.ts
692
- import { BUILD as BUILD11 } from "@stencil/core/internal/app-data";
894
+ import { BUILD as BUILD16 } from "@stencil/core/internal/app-data";
693
895
 
694
896
  // src/runtime/vdom/update-element.ts
695
- import { BUILD as BUILD10 } from "@stencil/core/internal/app-data";
897
+ import { BUILD as BUILD15 } from "@stencil/core/internal/app-data";
696
898
 
697
899
  // src/runtime/vdom/set-accessor.ts
698
- import { BUILD as BUILD9 } from "@stencil/core/internal/app-data";
900
+ import { BUILD as BUILD14 } from "@stencil/core/internal/app-data";
699
901
  var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
700
902
  if (oldValue !== newValue) {
701
903
  let isProp = isMemberInElement(elm, memberName);
702
904
  let ln = memberName.toLowerCase();
703
- if (BUILD9.vdomClass && memberName === "class") {
905
+ if (BUILD14.vdomClass && memberName === "class") {
704
906
  const classList = elm.classList;
705
907
  const oldClasses = parseClassList(oldValue);
706
908
  const newClasses = parseClassList(newValue);
707
909
  classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
708
910
  classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
709
- } else if (BUILD9.vdomStyle && memberName === "style") {
710
- if (BUILD9.updatable) {
911
+ } else if (BUILD14.vdomStyle && memberName === "style") {
912
+ if (BUILD14.updatable) {
711
913
  for (const prop in oldValue) {
712
914
  if (!newValue || newValue[prop] == null) {
713
- if (!BUILD9.hydrateServerSide && prop.includes("-")) {
915
+ if (!BUILD14.hydrateServerSide && prop.includes("-")) {
714
916
  elm.style.removeProperty(prop);
715
917
  } else {
716
918
  elm.style[prop] = "";
@@ -720,19 +922,19 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
720
922
  }
721
923
  for (const prop in newValue) {
722
924
  if (!oldValue || newValue[prop] !== oldValue[prop]) {
723
- if (!BUILD9.hydrateServerSide && prop.includes("-")) {
925
+ if (!BUILD14.hydrateServerSide && prop.includes("-")) {
724
926
  elm.style.setProperty(prop, newValue[prop]);
725
927
  } else {
726
928
  elm.style[prop] = newValue[prop];
727
929
  }
728
930
  }
729
931
  }
730
- } else if (BUILD9.vdomKey && memberName === "key") {
731
- } else if (BUILD9.vdomRef && memberName === "ref") {
932
+ } else if (BUILD14.vdomKey && memberName === "key") {
933
+ } else if (BUILD14.vdomRef && memberName === "ref") {
732
934
  if (newValue) {
733
935
  newValue(elm);
734
936
  }
735
- } else if (BUILD9.vdomListener && (BUILD9.lazyLoad ? !isProp : !elm.__lookupSetter__(memberName)) && memberName[0] === "o" && memberName[1] === "n") {
937
+ } else if (BUILD14.vdomListener && (BUILD14.lazyLoad ? !isProp : !elm.__lookupSetter__(memberName)) && memberName[0] === "o" && memberName[1] === "n") {
736
938
  if (memberName[2] === "-") {
737
939
  memberName = memberName.slice(3);
738
940
  } else if (isMemberInElement(win, ln)) {
@@ -750,7 +952,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
750
952
  plt.ael(elm, memberName, newValue, capture);
751
953
  }
752
954
  }
753
- } else if (BUILD9.vdomPropOrAttr) {
955
+ } else if (BUILD14.vdomPropOrAttr) {
754
956
  const isComplex = isComplexType(newValue);
755
957
  if ((isProp || isComplex && newValue !== null) && !isSvg) {
756
958
  try {
@@ -768,7 +970,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
768
970
  }
769
971
  }
770
972
  let xlink = false;
771
- if (BUILD9.vdomXlink) {
973
+ if (BUILD14.vdomXlink) {
772
974
  if (ln !== (ln = ln.replace(/^xlink\:?/, ""))) {
773
975
  memberName = ln;
774
976
  xlink = true;
@@ -776,7 +978,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
776
978
  }
777
979
  if (newValue == null || newValue === false) {
778
980
  if (newValue !== false || elm.getAttribute(memberName) === "") {
779
- if (BUILD9.vdomXlink && xlink) {
981
+ if (BUILD14.vdomXlink && xlink) {
780
982
  elm.removeAttributeNS(XLINK_NS, memberName);
781
983
  } else {
782
984
  elm.removeAttribute(memberName);
@@ -784,7 +986,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
784
986
  }
785
987
  } else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
786
988
  newValue = newValue === true ? "" : newValue;
787
- if (BUILD9.vdomXlink && xlink) {
989
+ if (BUILD14.vdomXlink && xlink) {
788
990
  elm.setAttributeNS(XLINK_NS, memberName, newValue);
789
991
  } else {
790
992
  elm.setAttribute(memberName, newValue);
@@ -803,7 +1005,7 @@ var updateElement = (oldVnode, newVnode, isSvgMode2) => {
803
1005
  const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
804
1006
  const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || EMPTY_OBJ;
805
1007
  const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
806
- if (BUILD10.updatable) {
1008
+ if (BUILD15.updatable) {
807
1009
  for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
808
1010
  if (!(memberName in newVnodeAttrs)) {
809
1011
  setAccessor(elm, memberName, oldVnodeAttrs[memberName], void 0, isSvgMode2, newVnode.$flags$);
@@ -839,7 +1041,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
839
1041
  let elm;
840
1042
  let childNode;
841
1043
  let oldVNode;
842
- if (BUILD11.slotRelocation && !useNativeShadowDom) {
1044
+ if (BUILD16.slotRelocation && !useNativeShadowDom) {
843
1045
  checkSlotRelocate = true;
844
1046
  if (newVNode2.$tag$ === "slot") {
845
1047
  if (scopeId) {
@@ -857,35 +1059,35 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
857
1059
  );
858
1060
  }
859
1061
  }
860
- if (BUILD11.isDev && newVNode2.$elm$) {
1062
+ if (BUILD16.isDev && newVNode2.$elm$) {
861
1063
  consoleDevError(
862
1064
  `The JSX ${newVNode2.$text$ !== null ? `"${newVNode2.$text$}" text` : `"${newVNode2.$tag$}" element`} node should not be shared within the same renderer. The renderer caches element lookups in order to improve performance. However, a side effect from this is that the exact same JSX node should not be reused. For more information please see https://stenciljs.com/docs/templating-jsx#avoid-shared-jsx-nodes`
863
1065
  );
864
1066
  }
865
- if (BUILD11.vdomText && newVNode2.$text$ !== null) {
1067
+ if (BUILD16.vdomText && newVNode2.$text$ !== null) {
866
1068
  elm = newVNode2.$elm$ = doc.createTextNode(newVNode2.$text$);
867
- } else if (BUILD11.slotRelocation && newVNode2.$flags$ & 1 /* isSlotReference */) {
868
- elm = newVNode2.$elm$ = BUILD11.isDebug || BUILD11.hydrateServerSide ? slotReferenceDebugNode(newVNode2) : doc.createTextNode("");
1069
+ } else if (BUILD16.slotRelocation && newVNode2.$flags$ & 1 /* isSlotReference */) {
1070
+ elm = newVNode2.$elm$ = BUILD16.isDebug || BUILD16.hydrateServerSide ? slotReferenceDebugNode(newVNode2) : doc.createTextNode("");
869
1071
  } else {
870
- if (BUILD11.svg && !isSvgMode) {
1072
+ if (BUILD16.svg && !isSvgMode) {
871
1073
  isSvgMode = newVNode2.$tag$ === "svg";
872
1074
  }
873
- elm = newVNode2.$elm$ = BUILD11.svg ? doc.createElementNS(
1075
+ elm = newVNode2.$elm$ = BUILD16.svg ? doc.createElementNS(
874
1076
  isSvgMode ? SVG_NS : HTML_NS,
875
- BUILD11.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
1077
+ !useNativeShadowDom && BUILD16.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
876
1078
  ) : doc.createElement(
877
- BUILD11.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
1079
+ !useNativeShadowDom && BUILD16.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
878
1080
  );
879
- if (BUILD11.svg && isSvgMode && newVNode2.$tag$ === "foreignObject") {
1081
+ if (BUILD16.svg && isSvgMode && newVNode2.$tag$ === "foreignObject") {
880
1082
  isSvgMode = false;
881
1083
  }
882
- if (BUILD11.vdomAttribute) {
1084
+ if (BUILD16.vdomAttribute) {
883
1085
  updateElement(null, newVNode2, isSvgMode);
884
1086
  }
885
- if ((BUILD11.shadowDom || BUILD11.scoped) && isDef(scopeId) && elm["s-si"] !== scopeId) {
1087
+ if ((BUILD16.shadowDom || BUILD16.scoped) && isDef(scopeId) && elm["s-si"] !== scopeId) {
886
1088
  elm.classList.add(elm["s-si"] = scopeId);
887
1089
  }
888
- if (BUILD11.scoped) {
1090
+ if (BUILD16.scoped) {
889
1091
  updateElementScopeIds(elm, parentElm);
890
1092
  }
891
1093
  if (newVNode2.$children$) {
@@ -896,7 +1098,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
896
1098
  }
897
1099
  }
898
1100
  }
899
- if (BUILD11.svg) {
1101
+ if (BUILD16.svg) {
900
1102
  if (newVNode2.$tag$ === "svg") {
901
1103
  isSvgMode = false;
902
1104
  } else if (elm.tagName === "foreignObject") {
@@ -905,7 +1107,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
905
1107
  }
906
1108
  }
907
1109
  elm["s-hn"] = hostTagName;
908
- if (BUILD11.slotRelocation) {
1110
+ if (BUILD16.slotRelocation) {
909
1111
  if (newVNode2.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
910
1112
  elm["s-sr"] = true;
911
1113
  elm["s-cr"] = contentRef;
@@ -913,7 +1115,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
913
1115
  elm["s-rf"] = (_a = newVNode2.$attrs$) == null ? void 0 : _a.ref;
914
1116
  oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
915
1117
  if (oldVNode && oldVNode.$tag$ === newVNode2.$tag$ && oldParentVNode.$elm$) {
916
- if (BUILD11.experimentalSlotFixes) {
1118
+ if (BUILD16.experimentalSlotFixes) {
917
1119
  relocateToHostRoot(oldParentVNode.$elm$);
918
1120
  } else {
919
1121
  putBackInOriginalLocation(oldParentVNode.$elm$, false);
@@ -942,7 +1144,7 @@ var relocateToHostRoot = (parentElm) => {
942
1144
  var putBackInOriginalLocation = (parentElm, recursive) => {
943
1145
  plt.$flags$ |= 1 /* isTmpDisconnected */;
944
1146
  const oldSlotChildNodes = Array.from(parentElm.childNodes);
945
- if (parentElm["s-sr"] && BUILD11.experimentalSlotFixes) {
1147
+ if (parentElm["s-sr"] && BUILD16.experimentalSlotFixes) {
946
1148
  let node = parentElm;
947
1149
  while (node = node.nextSibling) {
948
1150
  if (node && node["s-sn"] === parentElm["s-sn"] && node["s-sh"] === hostTagName) {
@@ -966,9 +1168,9 @@ var putBackInOriginalLocation = (parentElm, recursive) => {
966
1168
  plt.$flags$ &= ~1 /* isTmpDisconnected */;
967
1169
  };
968
1170
  var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
969
- let containerElm = BUILD11.slotRelocation && parentElm["s-cr"] && parentElm["s-cr"].parentNode || parentElm;
1171
+ let containerElm = BUILD16.slotRelocation && parentElm["s-cr"] && parentElm["s-cr"].parentNode || parentElm;
970
1172
  let childNode;
971
- if (BUILD11.shadowDom && containerElm.shadowRoot && containerElm.tagName === hostTagName) {
1173
+ if (BUILD16.shadowDom && containerElm.shadowRoot && containerElm.tagName === hostTagName) {
972
1174
  containerElm = containerElm.shadowRoot;
973
1175
  }
974
1176
  for (; startIdx <= endIdx; ++startIdx) {
@@ -976,7 +1178,7 @@ var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
976
1178
  childNode = createElm(null, parentVNode, startIdx, parentElm);
977
1179
  if (childNode) {
978
1180
  vnodes[startIdx].$elm$ = childNode;
979
- insertBefore(containerElm, childNode, BUILD11.slotRelocation ? referenceNode(before) : before);
1181
+ insertBefore(containerElm, childNode, BUILD16.slotRelocation ? referenceNode(before) : before);
980
1182
  }
981
1183
  }
982
1184
  }
@@ -988,7 +1190,7 @@ var removeVnodes = (vnodes, startIdx, endIdx) => {
988
1190
  const elm = vnode.$elm$;
989
1191
  nullifyVNodeRefs(vnode);
990
1192
  if (elm) {
991
- if (BUILD11.slotRelocation) {
1193
+ if (BUILD16.slotRelocation) {
992
1194
  checkSlotFallbackVisibility = true;
993
1195
  if (elm["s-ol"]) {
994
1196
  elm["s-ol"].remove();
@@ -1032,7 +1234,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
1032
1234
  oldEndVnode = oldCh[--oldEndIdx];
1033
1235
  newEndVnode = newCh[--newEndIdx];
1034
1236
  } else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
1035
- if (BUILD11.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
1237
+ if (BUILD16.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
1036
1238
  putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
1037
1239
  }
1038
1240
  patch(oldStartVnode, newEndVnode, isInitialRender);
@@ -1040,7 +1242,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
1040
1242
  oldStartVnode = oldCh[++oldStartIdx];
1041
1243
  newEndVnode = newCh[--newEndIdx];
1042
1244
  } else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
1043
- if (BUILD11.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
1245
+ if (BUILD16.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
1044
1246
  putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
1045
1247
  }
1046
1248
  patch(oldEndVnode, newStartVnode, isInitialRender);
@@ -1049,7 +1251,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
1049
1251
  newStartVnode = newCh[++newStartIdx];
1050
1252
  } else {
1051
1253
  idxInOld = -1;
1052
- if (BUILD11.vdomKey) {
1254
+ if (BUILD16.vdomKey) {
1053
1255
  for (i2 = oldStartIdx; i2 <= oldEndIdx; ++i2) {
1054
1256
  if (oldCh[i2] && oldCh[i2].$key$ !== null && oldCh[i2].$key$ === newStartVnode.$key$) {
1055
1257
  idxInOld = i2;
@@ -1057,7 +1259,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
1057
1259
  }
1058
1260
  }
1059
1261
  }
1060
- if (BUILD11.vdomKey && idxInOld >= 0) {
1262
+ if (BUILD16.vdomKey && idxInOld >= 0) {
1061
1263
  elmToMove = oldCh[idxInOld];
1062
1264
  if (elmToMove.$tag$ !== newStartVnode.$tag$) {
1063
1265
  node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld, parentElm);
@@ -1072,7 +1274,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
1072
1274
  newStartVnode = newCh[++newStartIdx];
1073
1275
  }
1074
1276
  if (node) {
1075
- if (BUILD11.slotRelocation) {
1277
+ if (BUILD16.slotRelocation) {
1076
1278
  insertBefore(parentReferenceNode(oldStartVnode.$elm$), node, referenceNode(oldStartVnode.$elm$));
1077
1279
  } else {
1078
1280
  insertBefore(oldStartVnode.$elm$.parentNode, node, oldStartVnode.$elm$);
@@ -1089,16 +1291,16 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
1089
1291
  newStartIdx,
1090
1292
  newEndIdx
1091
1293
  );
1092
- } else if (BUILD11.updatable && newStartIdx > newEndIdx) {
1294
+ } else if (BUILD16.updatable && newStartIdx > newEndIdx) {
1093
1295
  removeVnodes(oldCh, oldStartIdx, oldEndIdx);
1094
1296
  }
1095
1297
  };
1096
1298
  var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
1097
1299
  if (leftVNode.$tag$ === rightVNode.$tag$) {
1098
- if (BUILD11.slotRelocation && leftVNode.$tag$ === "slot") {
1300
+ if (BUILD16.slotRelocation && leftVNode.$tag$ === "slot") {
1099
1301
  return leftVNode.$name$ === rightVNode.$name$;
1100
1302
  }
1101
- if (BUILD11.vdomKey && !isInitialRender) {
1303
+ if (BUILD16.vdomKey && !isInitialRender) {
1102
1304
  return leftVNode.$key$ === rightVNode.$key$;
1103
1305
  }
1104
1306
  return true;
@@ -1116,13 +1318,13 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
1116
1318
  const tag = newVNode2.$tag$;
1117
1319
  const text = newVNode2.$text$;
1118
1320
  let defaultHolder;
1119
- if (!BUILD11.vdomText || text === null) {
1120
- if (BUILD11.svg) {
1321
+ if (!BUILD16.vdomText || text === null) {
1322
+ if (BUILD16.svg) {
1121
1323
  isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
1122
1324
  }
1123
- if (BUILD11.vdomAttribute || BUILD11.reflect) {
1124
- if (BUILD11.slot && tag === "slot" && !useNativeShadowDom) {
1125
- if (BUILD11.experimentalSlotFixes && oldVNode.$name$ !== newVNode2.$name$) {
1325
+ if (BUILD16.vdomAttribute || BUILD16.reflect) {
1326
+ if (BUILD16.slot && tag === "slot" && !useNativeShadowDom) {
1327
+ if (BUILD16.experimentalSlotFixes && oldVNode.$name$ !== newVNode2.$name$) {
1126
1328
  newVNode2.$elm$["s-sn"] = newVNode2.$name$ || "";
1127
1329
  relocateToHostRoot(newVNode2.$elm$.parentElement);
1128
1330
  }
@@ -1130,22 +1332,22 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
1130
1332
  updateElement(oldVNode, newVNode2, isSvgMode);
1131
1333
  }
1132
1334
  }
1133
- if (BUILD11.updatable && oldChildren !== null && newChildren !== null) {
1335
+ if (BUILD16.updatable && oldChildren !== null && newChildren !== null) {
1134
1336
  updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
1135
1337
  } else if (newChildren !== null) {
1136
- if (BUILD11.updatable && BUILD11.vdomText && oldVNode.$text$ !== null) {
1338
+ if (BUILD16.updatable && BUILD16.vdomText && oldVNode.$text$ !== null) {
1137
1339
  elm.textContent = "";
1138
1340
  }
1139
1341
  addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);
1140
- } else if (BUILD11.updatable && oldChildren !== null) {
1342
+ } else if (BUILD16.updatable && oldChildren !== null) {
1141
1343
  removeVnodes(oldChildren, 0, oldChildren.length - 1);
1142
1344
  }
1143
- if (BUILD11.svg && isSvgMode && tag === "svg") {
1345
+ if (BUILD16.svg && isSvgMode && tag === "svg") {
1144
1346
  isSvgMode = false;
1145
1347
  }
1146
- } else if (BUILD11.vdomText && BUILD11.slotRelocation && (defaultHolder = elm["s-cr"])) {
1348
+ } else if (BUILD16.vdomText && BUILD16.slotRelocation && (defaultHolder = elm["s-cr"])) {
1147
1349
  defaultHolder.parentNode.textContent = text;
1148
- } else if (BUILD11.vdomText && oldVNode.$text$ !== text) {
1350
+ } else if (BUILD16.vdomText && oldVNode.$text$ !== text) {
1149
1351
  elm.data = text;
1150
1352
  }
1151
1353
  };
@@ -1187,7 +1389,7 @@ var markSlotContentForRelocation = (elm) => {
1187
1389
  const slotName = childNode["s-sn"];
1188
1390
  for (j = hostContentNodes.length - 1; j >= 0; j--) {
1189
1391
  node = hostContentNodes[j];
1190
- if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (!BUILD11.experimentalSlotFixes || !node["s-sh"] || node["s-sh"] !== childNode["s-hn"])) {
1392
+ if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (!BUILD16.experimentalSlotFixes || !node["s-sh"] || node["s-sh"] !== childNode["s-hn"])) {
1191
1393
  if (isNodeLocatedInSlot(node, slotName)) {
1192
1394
  let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
1193
1395
  checkSlotFallbackVisibility = true;
@@ -1241,14 +1443,14 @@ var isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
1241
1443
  return slotName === "";
1242
1444
  };
1243
1445
  var nullifyVNodeRefs = (vNode) => {
1244
- if (BUILD11.vdomRef) {
1446
+ if (BUILD16.vdomRef) {
1245
1447
  vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
1246
1448
  vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
1247
1449
  }
1248
1450
  };
1249
1451
  var insertBefore = (parent, newNode, reference) => {
1250
1452
  const inserted = parent == null ? void 0 : parent.insertBefore(newNode, reference);
1251
- if (BUILD11.scoped) {
1453
+ if (BUILD16.scoped) {
1252
1454
  updateElementScopeIds(newNode, parent);
1253
1455
  }
1254
1456
  return inserted;
@@ -1286,7 +1488,7 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
1286
1488
  const oldVNode = hostRef.$vnode$ || newVNode(null, null);
1287
1489
  const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
1288
1490
  hostTagName = hostElm.tagName;
1289
- if (BUILD11.isDev && Array.isArray(renderFnResults) && renderFnResults.some(isHost)) {
1491
+ if (BUILD16.isDev && Array.isArray(renderFnResults) && renderFnResults.some(isHost)) {
1290
1492
  throw new Error(`The <Host> must be the single root component.
1291
1493
  Looks like the render() function of "${hostTagName.toLowerCase()}" is returning an array that contains the <Host>.
1292
1494
 
@@ -1300,7 +1502,7 @@ render() {
1300
1502
  }
1301
1503
  `);
1302
1504
  }
1303
- if (BUILD11.reflect && cmpMeta.$attrsToReflect$) {
1505
+ if (BUILD16.reflect && cmpMeta.$attrsToReflect$) {
1304
1506
  rootVnode.$attrs$ = rootVnode.$attrs$ || {};
1305
1507
  cmpMeta.$attrsToReflect$.map(
1306
1508
  ([propName, attribute]) => rootVnode.$attrs$[attribute] = hostElm[propName]
@@ -1316,24 +1518,24 @@ render() {
1316
1518
  rootVnode.$tag$ = null;
1317
1519
  rootVnode.$flags$ |= 4 /* isHost */;
1318
1520
  hostRef.$vnode$ = rootVnode;
1319
- rootVnode.$elm$ = oldVNode.$elm$ = BUILD11.shadowDom ? hostElm.shadowRoot || hostElm : hostElm;
1320
- if (BUILD11.scoped || BUILD11.shadowDom) {
1521
+ rootVnode.$elm$ = oldVNode.$elm$ = BUILD16.shadowDom ? hostElm.shadowRoot || hostElm : hostElm;
1522
+ if (BUILD16.scoped || BUILD16.shadowDom) {
1321
1523
  scopeId = hostElm["s-sc"];
1322
1524
  }
1323
1525
  useNativeShadowDom = supportsShadow && (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
1324
- if (BUILD11.slotRelocation) {
1526
+ if (BUILD16.slotRelocation) {
1325
1527
  contentRef = hostElm["s-cr"];
1326
1528
  checkSlotFallbackVisibility = false;
1327
1529
  }
1328
1530
  patch(oldVNode, rootVnode, isInitialLoad);
1329
- if (BUILD11.slotRelocation) {
1531
+ if (BUILD16.slotRelocation) {
1330
1532
  plt.$flags$ |= 1 /* isTmpDisconnected */;
1331
1533
  if (checkSlotRelocate) {
1332
1534
  markSlotContentForRelocation(rootVnode.$elm$);
1333
1535
  for (const relocateData of relocateNodes) {
1334
1536
  const nodeToRelocate = relocateData.$nodeToRelocate$;
1335
1537
  if (!nodeToRelocate["s-ol"]) {
1336
- const orgLocationNode = BUILD11.isDebug || BUILD11.hydrateServerSide ? originalLocationDebugNode(nodeToRelocate) : doc.createTextNode("");
1538
+ const orgLocationNode = BUILD16.isDebug || BUILD16.hydrateServerSide ? originalLocationDebugNode(nodeToRelocate) : doc.createTextNode("");
1337
1539
  orgLocationNode["s-nr"] = nodeToRelocate;
1338
1540
  insertBefore(nodeToRelocate.parentNode, nodeToRelocate["s-ol"] = orgLocationNode, nodeToRelocate);
1339
1541
  }
@@ -1344,7 +1546,7 @@ render() {
1344
1546
  if (slotRefNode) {
1345
1547
  const parentNodeRef = slotRefNode.parentNode;
1346
1548
  let insertBeforeNode = slotRefNode.nextSibling;
1347
- if (!BUILD11.experimentalSlotFixes || insertBeforeNode && insertBeforeNode.nodeType === 1 /* ElementNode */) {
1549
+ if (!BUILD16.experimentalSlotFixes || insertBeforeNode && insertBeforeNode.nodeType === 1 /* ElementNode */) {
1348
1550
  let orgLocationNode = (_a = nodeToRelocate["s-ol"]) == null ? void 0 : _a.previousSibling;
1349
1551
  while (orgLocationNode) {
1350
1552
  let refNode = (_b = orgLocationNode["s-nr"]) != null ? _b : null;
@@ -1363,7 +1565,7 @@ render() {
1363
1565
  }
1364
1566
  if (!insertBeforeNode && parentNodeRef !== nodeToRelocate.parentNode || nodeToRelocate.nextSibling !== insertBeforeNode) {
1365
1567
  if (nodeToRelocate !== insertBeforeNode) {
1366
- if (!BUILD11.experimentalSlotFixes && !nodeToRelocate["s-hn"] && nodeToRelocate["s-ol"]) {
1568
+ if (!BUILD16.experimentalSlotFixes && !nodeToRelocate["s-hn"] && nodeToRelocate["s-ol"]) {
1367
1569
  nodeToRelocate["s-hn"] = nodeToRelocate["s-ol"].parentNode.nodeName;
1368
1570
  }
1369
1571
  insertBefore(parentNodeRef, nodeToRelocate, insertBeforeNode);
@@ -1389,7 +1591,7 @@ render() {
1389
1591
  plt.$flags$ &= ~1 /* isTmpDisconnected */;
1390
1592
  relocateNodes.length = 0;
1391
1593
  }
1392
- if (BUILD11.experimentalScopedSlotChanges && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
1594
+ if (BUILD16.experimentalScopedSlotChanges && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
1393
1595
  for (const childNode of rootVnode.$elm$.childNodes) {
1394
1596
  if (childNode["s-hn"] !== hostTagName && !childNode["s-sh"]) {
1395
1597
  if (isInitialLoad && childNode["s-ih"] == null) {
@@ -1410,26 +1612,26 @@ var originalLocationDebugNode = (nodeToRelocate) => doc.createComment(
1410
1612
 
1411
1613
  // src/runtime/update-component.ts
1412
1614
  var attachToAncestor = (hostRef, ancestorComponent) => {
1413
- if (BUILD12.asyncLoading && ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
1615
+ if (BUILD17.asyncLoading && ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
1414
1616
  ancestorComponent["s-p"].push(new Promise((r) => hostRef.$onRenderResolve$ = r));
1415
1617
  }
1416
1618
  };
1417
1619
  var scheduleUpdate = (hostRef, isInitialLoad) => {
1418
- if (BUILD12.taskQueue && BUILD12.updatable) {
1620
+ if (BUILD17.taskQueue && BUILD17.updatable) {
1419
1621
  hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
1420
1622
  }
1421
- if (BUILD12.asyncLoading && hostRef.$flags$ & 4 /* isWaitingForChildren */) {
1623
+ if (BUILD17.asyncLoading && hostRef.$flags$ & 4 /* isWaitingForChildren */) {
1422
1624
  hostRef.$flags$ |= 512 /* needsRerender */;
1423
1625
  return;
1424
1626
  }
1425
1627
  attachToAncestor(hostRef, hostRef.$ancestorComponent$);
1426
1628
  const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
1427
- return BUILD12.taskQueue ? writeTask(dispatch) : dispatch();
1629
+ return BUILD17.taskQueue ? writeTask(dispatch) : dispatch();
1428
1630
  };
1429
1631
  var dispatchHooks = (hostRef, isInitialLoad) => {
1430
1632
  const elm = hostRef.$hostElement$;
1431
1633
  const endSchedule = createTime("scheduleUpdate", hostRef.$cmpMeta$.$tagName$);
1432
- const instance = BUILD12.lazyLoad ? hostRef.$lazyInstance$ : elm;
1634
+ const instance = BUILD17.lazyLoad ? hostRef.$lazyInstance$ : elm;
1433
1635
  if (!instance) {
1434
1636
  throw new Error(
1435
1637
  `Can't render component <${elm.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`
@@ -1437,7 +1639,7 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
1437
1639
  }
1438
1640
  let maybePromise;
1439
1641
  if (isInitialLoad) {
1440
- if (BUILD12.lazyLoad && BUILD12.hostListener) {
1642
+ if (BUILD17.lazyLoad && BUILD17.hostListener) {
1441
1643
  hostRef.$flags$ |= 256 /* isListenReady */;
1442
1644
  if (hostRef.$queuedListeners$) {
1443
1645
  hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
@@ -1445,46 +1647,49 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
1445
1647
  }
1446
1648
  }
1447
1649
  emitLifecycleEvent(elm, "componentWillLoad");
1448
- if (BUILD12.cmpWillLoad) {
1650
+ if (BUILD17.cmpWillLoad) {
1449
1651
  maybePromise = safeCall(instance, "componentWillLoad");
1450
1652
  }
1451
1653
  } else {
1452
1654
  emitLifecycleEvent(elm, "componentWillUpdate");
1453
- if (BUILD12.cmpWillUpdate) {
1655
+ if (BUILD17.cmpWillUpdate) {
1454
1656
  maybePromise = safeCall(instance, "componentWillUpdate");
1455
1657
  }
1456
1658
  }
1457
1659
  emitLifecycleEvent(elm, "componentWillRender");
1458
- if (BUILD12.cmpWillRender) {
1660
+ if (BUILD17.cmpWillRender) {
1459
1661
  maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender"));
1460
1662
  }
1461
1663
  endSchedule();
1462
1664
  return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
1463
1665
  };
1464
- var enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then(fn) : fn();
1666
+ var enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then(fn).catch((err2) => {
1667
+ console.error(err2);
1668
+ fn();
1669
+ }) : fn();
1465
1670
  var isPromisey = (maybePromise) => maybePromise instanceof Promise || maybePromise && maybePromise.then && typeof maybePromise.then === "function";
1466
1671
  var updateComponent = async (hostRef, instance, isInitialLoad) => {
1467
1672
  var _a;
1468
1673
  const elm = hostRef.$hostElement$;
1469
1674
  const endUpdate = createTime("update", hostRef.$cmpMeta$.$tagName$);
1470
1675
  const rc = elm["s-rc"];
1471
- if (BUILD12.style && isInitialLoad) {
1676
+ if (BUILD17.style && isInitialLoad) {
1472
1677
  attachStyles(hostRef);
1473
1678
  }
1474
1679
  const endRender = createTime("render", hostRef.$cmpMeta$.$tagName$);
1475
- if (BUILD12.isDev) {
1680
+ if (BUILD17.isDev) {
1476
1681
  hostRef.$flags$ |= 1024 /* devOnRender */;
1477
1682
  }
1478
- if (BUILD12.hydrateServerSide) {
1683
+ if (BUILD17.hydrateServerSide) {
1479
1684
  await callRender(hostRef, instance, elm, isInitialLoad);
1480
1685
  } else {
1481
1686
  callRender(hostRef, instance, elm, isInitialLoad);
1482
1687
  }
1483
- if (BUILD12.isDev) {
1688
+ if (BUILD17.isDev) {
1484
1689
  hostRef.$renderCount$ = hostRef.$renderCount$ === void 0 ? 1 : hostRef.$renderCount$ + 1;
1485
1690
  hostRef.$flags$ &= ~1024 /* devOnRender */;
1486
1691
  }
1487
- if (BUILD12.hydrateServerSide) {
1692
+ if (BUILD17.hydrateServerSide) {
1488
1693
  try {
1489
1694
  serverSideConnected(elm);
1490
1695
  if (isInitialLoad) {
@@ -1498,13 +1703,13 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
1498
1703
  consoleError(e, elm);
1499
1704
  }
1500
1705
  }
1501
- if (BUILD12.asyncLoading && rc) {
1706
+ if (BUILD17.asyncLoading && rc) {
1502
1707
  rc.map((cb) => cb());
1503
1708
  elm["s-rc"] = void 0;
1504
1709
  }
1505
1710
  endRender();
1506
1711
  endUpdate();
1507
- if (BUILD12.asyncLoading) {
1712
+ if (BUILD17.asyncLoading) {
1508
1713
  const childrenPromises = (_a = elm["s-p"]) != null ? _a : [];
1509
1714
  const postUpdate = () => postUpdateComponent(hostRef);
1510
1715
  if (childrenPromises.length === 0) {
@@ -1520,10 +1725,10 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
1520
1725
  };
1521
1726
  var renderingRef = null;
1522
1727
  var callRender = (hostRef, instance, elm, isInitialLoad) => {
1523
- const allRenderFn = BUILD12.allRenderFn ? true : false;
1524
- const lazyLoad = BUILD12.lazyLoad ? true : false;
1525
- const taskQueue = BUILD12.taskQueue ? true : false;
1526
- const updatable = BUILD12.updatable ? true : false;
1728
+ const allRenderFn = BUILD17.allRenderFn ? true : false;
1729
+ const lazyLoad = BUILD17.lazyLoad ? true : false;
1730
+ const taskQueue = BUILD17.taskQueue ? true : false;
1731
+ const updatable = BUILD17.updatable ? true : false;
1527
1732
  try {
1528
1733
  renderingRef = instance;
1529
1734
  instance = allRenderFn ? instance.render() : instance.render && instance.render();
@@ -1533,9 +1738,9 @@ var callRender = (hostRef, instance, elm, isInitialLoad) => {
1533
1738
  if (updatable || lazyLoad) {
1534
1739
  hostRef.$flags$ |= 2 /* hasRendered */;
1535
1740
  }
1536
- if (BUILD12.hasRenderFn || BUILD12.reflect) {
1537
- if (BUILD12.vdomRender || BUILD12.reflect) {
1538
- if (BUILD12.hydrateServerSide) {
1741
+ if (BUILD17.hasRenderFn || BUILD17.reflect) {
1742
+ if (BUILD17.vdomRender || BUILD17.reflect) {
1743
+ if (BUILD17.hydrateServerSide) {
1539
1744
  return Promise.resolve(instance).then((value) => renderVdom(hostRef, value, isInitialLoad));
1540
1745
  } else {
1541
1746
  renderVdom(hostRef, instance, isInitialLoad);
@@ -1560,57 +1765,57 @@ var postUpdateComponent = (hostRef) => {
1560
1765
  const tagName = hostRef.$cmpMeta$.$tagName$;
1561
1766
  const elm = hostRef.$hostElement$;
1562
1767
  const endPostUpdate = createTime("postUpdate", tagName);
1563
- const instance = BUILD12.lazyLoad ? hostRef.$lazyInstance$ : elm;
1768
+ const instance = BUILD17.lazyLoad ? hostRef.$lazyInstance$ : elm;
1564
1769
  const ancestorComponent = hostRef.$ancestorComponent$;
1565
- if (BUILD12.cmpDidRender) {
1566
- if (BUILD12.isDev) {
1770
+ if (BUILD17.cmpDidRender) {
1771
+ if (BUILD17.isDev) {
1567
1772
  hostRef.$flags$ |= 1024 /* devOnRender */;
1568
1773
  }
1569
1774
  safeCall(instance, "componentDidRender");
1570
- if (BUILD12.isDev) {
1775
+ if (BUILD17.isDev) {
1571
1776
  hostRef.$flags$ &= ~1024 /* devOnRender */;
1572
1777
  }
1573
1778
  }
1574
1779
  emitLifecycleEvent(elm, "componentDidRender");
1575
1780
  if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
1576
1781
  hostRef.$flags$ |= 64 /* hasLoadedComponent */;
1577
- if (BUILD12.asyncLoading && BUILD12.cssAnnotations) {
1782
+ if (BUILD17.asyncLoading && BUILD17.cssAnnotations) {
1578
1783
  addHydratedFlag(elm);
1579
1784
  }
1580
- if (BUILD12.cmpDidLoad) {
1581
- if (BUILD12.isDev) {
1785
+ if (BUILD17.cmpDidLoad) {
1786
+ if (BUILD17.isDev) {
1582
1787
  hostRef.$flags$ |= 2048 /* devOnDidLoad */;
1583
1788
  }
1584
1789
  safeCall(instance, "componentDidLoad");
1585
- if (BUILD12.isDev) {
1790
+ if (BUILD17.isDev) {
1586
1791
  hostRef.$flags$ &= ~2048 /* devOnDidLoad */;
1587
1792
  }
1588
1793
  }
1589
1794
  emitLifecycleEvent(elm, "componentDidLoad");
1590
1795
  endPostUpdate();
1591
- if (BUILD12.asyncLoading) {
1796
+ if (BUILD17.asyncLoading) {
1592
1797
  hostRef.$onReadyResolve$(elm);
1593
1798
  if (!ancestorComponent) {
1594
1799
  appDidLoad(tagName);
1595
1800
  }
1596
1801
  }
1597
1802
  } else {
1598
- if (BUILD12.cmpDidUpdate) {
1599
- if (BUILD12.isDev) {
1803
+ if (BUILD17.cmpDidUpdate) {
1804
+ if (BUILD17.isDev) {
1600
1805
  hostRef.$flags$ |= 1024 /* devOnRender */;
1601
1806
  }
1602
1807
  safeCall(instance, "componentDidUpdate");
1603
- if (BUILD12.isDev) {
1808
+ if (BUILD17.isDev) {
1604
1809
  hostRef.$flags$ &= ~1024 /* devOnRender */;
1605
1810
  }
1606
1811
  }
1607
1812
  emitLifecycleEvent(elm, "componentDidUpdate");
1608
1813
  endPostUpdate();
1609
1814
  }
1610
- if (BUILD12.method && BUILD12.lazyLoad) {
1815
+ if (BUILD17.method && BUILD17.lazyLoad) {
1611
1816
  hostRef.$onInstanceResolve$(elm);
1612
1817
  }
1613
- if (BUILD12.asyncLoading) {
1818
+ if (BUILD17.asyncLoading) {
1614
1819
  if (hostRef.$onRenderResolve$) {
1615
1820
  hostRef.$onRenderResolve$();
1616
1821
  hostRef.$onRenderResolve$ = void 0;
@@ -1622,7 +1827,7 @@ var postUpdateComponent = (hostRef) => {
1622
1827
  }
1623
1828
  };
1624
1829
  var forceUpdate = (ref) => {
1625
- if (BUILD12.updatable && (Build.isBrowser || Build.isTesting)) {
1830
+ if (BUILD17.updatable && (Build.isBrowser || Build.isTesting)) {
1626
1831
  const hostRef = getHostRef(ref);
1627
1832
  const isConnected = hostRef.$hostElement$.isConnected;
1628
1833
  if (isConnected && (hostRef.$flags$ & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
@@ -1633,14 +1838,14 @@ var forceUpdate = (ref) => {
1633
1838
  return false;
1634
1839
  };
1635
1840
  var appDidLoad = (who) => {
1636
- if (BUILD12.cssAnnotations) {
1841
+ if (BUILD17.cssAnnotations) {
1637
1842
  addHydratedFlag(doc.documentElement);
1638
1843
  }
1639
- if (BUILD12.asyncQueue) {
1844
+ if (BUILD17.asyncQueue) {
1640
1845
  plt.$flags$ |= 2 /* appLoaded */;
1641
1846
  }
1642
1847
  nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
1643
- if (BUILD12.profile && performance.measure) {
1848
+ if (BUILD17.profile && performance.measure) {
1644
1849
  performance.measure(`[Stencil] ${NAMESPACE} initial load (by ${who})`, "st:app:start");
1645
1850
  }
1646
1851
  };
@@ -1655,7 +1860,7 @@ var safeCall = (instance, method, arg) => {
1655
1860
  return void 0;
1656
1861
  };
1657
1862
  var emitLifecycleEvent = (elm, lifecycleName) => {
1658
- if (BUILD12.lifecycleDOMEvents) {
1863
+ if (BUILD17.lifecycleDOMEvents) {
1659
1864
  emitEvent(elm, "stencil_" + lifecycleName, {
1660
1865
  bubbles: true,
1661
1866
  composed: true,
@@ -1667,7 +1872,7 @@ var emitLifecycleEvent = (elm, lifecycleName) => {
1667
1872
  };
1668
1873
  var addHydratedFlag = (elm) => {
1669
1874
  var _a, _b;
1670
- return BUILD12.hydratedClass ? elm.classList.add((_a = BUILD12.hydratedSelectorName) != null ? _a : "hydrated") : BUILD12.hydratedAttribute ? elm.setAttribute((_b = BUILD12.hydratedSelectorName) != null ? _b : "hydrated", "") : void 0;
1875
+ return BUILD17.hydratedClass ? elm.classList.add((_a = BUILD17.hydratedSelectorName) != null ? _a : "hydrated") : BUILD17.hydratedAttribute ? elm.setAttribute((_b = BUILD17.hydratedSelectorName) != null ? _b : "hydrated", "") : void 0;
1671
1876
  };
1672
1877
  var serverSideConnected = (elm) => {
1673
1878
  const children = elm.children;
@@ -1686,21 +1891,21 @@ var serverSideConnected = (elm) => {
1686
1891
  var getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
1687
1892
  var setValue = (ref, propName, newVal, cmpMeta) => {
1688
1893
  const hostRef = getHostRef(ref);
1689
- if (BUILD13.lazyLoad && !hostRef) {
1894
+ if (BUILD18.lazyLoad && !hostRef) {
1690
1895
  throw new Error(
1691
1896
  `Couldn't find host element for "${cmpMeta.$tagName$}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/ionic-team/stencil/issues/5457).`
1692
1897
  );
1693
1898
  }
1694
- const elm = BUILD13.lazyLoad ? hostRef.$hostElement$ : ref;
1899
+ const elm = BUILD18.lazyLoad ? hostRef.$hostElement$ : ref;
1695
1900
  const oldVal = hostRef.$instanceValues$.get(propName);
1696
1901
  const flags = hostRef.$flags$;
1697
- const instance = BUILD13.lazyLoad ? hostRef.$lazyInstance$ : elm;
1902
+ const instance = BUILD18.lazyLoad ? hostRef.$lazyInstance$ : elm;
1698
1903
  newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
1699
1904
  const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
1700
1905
  const didValueChange = newVal !== oldVal && !areBothNaN;
1701
- if ((!BUILD13.lazyLoad || !(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {
1906
+ if ((!BUILD18.lazyLoad || !(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {
1702
1907
  hostRef.$instanceValues$.set(propName, newVal);
1703
- if (BUILD13.isDev) {
1908
+ if (BUILD18.isDev) {
1704
1909
  if (hostRef.$flags$ & 1024 /* devOnRender */) {
1705
1910
  consoleDevWarn(
1706
1911
  `The state/prop "${propName}" changed during rendering. This can potentially lead to infinite-loops and other bugs.`,
@@ -1723,8 +1928,8 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
1723
1928
  );
1724
1929
  }
1725
1930
  }
1726
- if (!BUILD13.lazyLoad || instance) {
1727
- if (BUILD13.watchCallback && cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
1931
+ if (!BUILD18.lazyLoad || instance) {
1932
+ if (BUILD18.watchCallback && cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
1728
1933
  const watchMethods = cmpMeta.$watchers$[propName];
1729
1934
  if (watchMethods) {
1730
1935
  watchMethods.map((watchMethodName) => {
@@ -1736,8 +1941,8 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
1736
1941
  });
1737
1942
  }
1738
1943
  }
1739
- if (BUILD13.updatable && (flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
1740
- if (BUILD13.cmpShouldUpdate && instance.componentShouldUpdate) {
1944
+ if (BUILD18.updatable && (flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
1945
+ if (BUILD18.cmpShouldUpdate && instance.componentShouldUpdate) {
1741
1946
  if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
1742
1947
  return;
1743
1948
  }
@@ -1750,15 +1955,15 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
1750
1955
 
1751
1956
  // src/runtime/proxy-component.ts
1752
1957
  var proxyComponent = (Cstr, cmpMeta, flags) => {
1753
- var _a;
1958
+ var _a, _b;
1754
1959
  const prototype = Cstr.prototype;
1755
- if (BUILD14.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */ && flags & 1 /* isElementConstructor */) {
1960
+ if (BUILD19.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */ && flags & 1 /* isElementConstructor */) {
1756
1961
  FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS.forEach(
1757
1962
  (cbName) => Object.defineProperty(prototype, cbName, {
1758
1963
  value(...args) {
1759
1964
  const hostRef = getHostRef(this);
1760
- const elm = BUILD14.lazyLoad ? hostRef.$hostElement$ : this;
1761
- const instance = BUILD14.lazyLoad ? hostRef.$lazyInstance$ : elm;
1965
+ const elm = BUILD19.lazyLoad ? hostRef.$hostElement$ : this;
1966
+ const instance = BUILD19.lazyLoad ? hostRef.$lazyInstance$ : elm;
1762
1967
  if (!instance) {
1763
1968
  hostRef.$onReadyPromise$.then((instance2) => {
1764
1969
  const cb = instance2[cbName];
@@ -1772,19 +1977,19 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
1772
1977
  })
1773
1978
  );
1774
1979
  }
1775
- if (BUILD14.member && cmpMeta.$members$) {
1776
- if (BUILD14.watchCallback && Cstr.watchers) {
1980
+ if (BUILD19.member && cmpMeta.$members$ || BUILD19.watchCallback && (cmpMeta.$watchers$ || Cstr.watchers)) {
1981
+ if (BUILD19.watchCallback && Cstr.watchers && !cmpMeta.$watchers$) {
1777
1982
  cmpMeta.$watchers$ = Cstr.watchers;
1778
1983
  }
1779
- const members = Object.entries(cmpMeta.$members$);
1984
+ const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
1780
1985
  members.map(([memberName, [memberFlags]]) => {
1781
- if ((BUILD14.prop || BUILD14.state) && (memberFlags & 31 /* Prop */ || (!BUILD14.lazyLoad || flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
1986
+ if ((BUILD19.prop || BUILD19.state) && (memberFlags & 31 /* Prop */ || (!BUILD19.lazyLoad || flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
1782
1987
  Object.defineProperty(prototype, memberName, {
1783
1988
  get() {
1784
1989
  return getValue(this, memberName);
1785
1990
  },
1786
1991
  set(newValue) {
1787
- if (BUILD14.isDev) {
1992
+ if (BUILD19.isDev) {
1788
1993
  const ref = getHostRef(this);
1789
1994
  if (
1790
1995
  // we are proxying the instance (not element)
@@ -1804,7 +2009,7 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
1804
2009
  configurable: true,
1805
2010
  enumerable: true
1806
2011
  });
1807
- } else if (BUILD14.lazyLoad && BUILD14.method && flags & 1 /* isElementConstructor */ && memberFlags & 64 /* Method */) {
2012
+ } else if (BUILD19.lazyLoad && BUILD19.method && flags & 1 /* isElementConstructor */ && memberFlags & 64 /* Method */) {
1808
2013
  Object.defineProperty(prototype, memberName, {
1809
2014
  value(...args) {
1810
2015
  var _a2;
@@ -1817,7 +2022,7 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
1817
2022
  });
1818
2023
  }
1819
2024
  });
1820
- if (BUILD14.observeAttribute && (!BUILD14.lazyLoad || flags & 1 /* isElementConstructor */)) {
2025
+ if (BUILD19.observeAttribute && (!BUILD19.lazyLoad || flags & 1 /* isElementConstructor */)) {
1821
2026
  const attrNameToPropName = /* @__PURE__ */ new Map();
1822
2027
  prototype.attributeChangedCallback = function(attrName, oldValue, newValue) {
1823
2028
  plt.jmp(() => {
@@ -1832,8 +2037,8 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
1832
2037
  const hostRef = getHostRef(this);
1833
2038
  const flags2 = hostRef == null ? void 0 : hostRef.$flags$;
1834
2039
  if (flags2 && !(flags2 & 8 /* isConstructingInstance */) && flags2 & 128 /* isWatchReady */ && newValue !== oldValue) {
1835
- const elm = BUILD14.lazyLoad ? hostRef.$hostElement$ : this;
1836
- const instance = BUILD14.lazyLoad ? hostRef.$lazyInstance$ : elm;
2040
+ const elm = BUILD19.lazyLoad ? hostRef.$hostElement$ : this;
2041
+ const instance = BUILD19.lazyLoad ? hostRef.$lazyInstance$ : elm;
1837
2042
  const entry = (_a2 = cmpMeta.$watchers$) == null ? void 0 : _a2[attrName];
1838
2043
  entry == null ? void 0 : entry.forEach((callbackName) => {
1839
2044
  if (instance[callbackName] != null) {
@@ -1848,12 +2053,12 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
1848
2053
  };
1849
2054
  Cstr.observedAttributes = Array.from(
1850
2055
  /* @__PURE__ */ new Set([
1851
- ...Object.keys((_a = cmpMeta.$watchers$) != null ? _a : {}),
2056
+ ...Object.keys((_b = cmpMeta.$watchers$) != null ? _b : {}),
1852
2057
  ...members.filter(([_, m]) => m[0] & 15 /* HasAttribute */).map(([propName, m]) => {
1853
2058
  var _a2;
1854
2059
  const attrName = m[1] || propName;
1855
2060
  attrNameToPropName.set(attrName, propName);
1856
- if (BUILD14.reflect && m[0] & 512 /* ReflectAttr */) {
2061
+ if (BUILD19.reflect && m[0] & 512 /* ReflectAttr */) {
1857
2062
  (_a2 = cmpMeta.$attrsToReflect$) == null ? void 0 : _a2.push([propName, attrName]);
1858
2063
  }
1859
2064
  return attrName;
@@ -1871,7 +2076,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1871
2076
  if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
1872
2077
  hostRef.$flags$ |= 32 /* hasInitializedComponent */;
1873
2078
  const bundleId = cmpMeta.$lazyBundleId$;
1874
- if ((BUILD15.lazyLoad || BUILD15.hydrateClientSide) && bundleId) {
2079
+ if ((BUILD20.lazyLoad || BUILD20.hydrateClientSide) && bundleId) {
1875
2080
  const CstrImport = loadModule(cmpMeta, hostRef, hmrVersionId);
1876
2081
  if (CstrImport && "then" in CstrImport) {
1877
2082
  const endLoad = uniqueTime(
@@ -1886,15 +2091,15 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1886
2091
  if (!Cstr) {
1887
2092
  throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
1888
2093
  }
1889
- if (BUILD15.member && !Cstr.isProxied) {
1890
- if (BUILD15.watchCallback) {
2094
+ if (BUILD20.member && !Cstr.isProxied) {
2095
+ if (BUILD20.watchCallback) {
1891
2096
  cmpMeta.$watchers$ = Cstr.watchers;
1892
2097
  }
1893
2098
  proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
1894
2099
  Cstr.isProxied = true;
1895
2100
  }
1896
2101
  const endNewInstance = createTime("createInstance", cmpMeta.$tagName$);
1897
- if (BUILD15.member) {
2102
+ if (BUILD20.member) {
1898
2103
  hostRef.$flags$ |= 8 /* isConstructingInstance */;
1899
2104
  }
1900
2105
  try {
@@ -1902,10 +2107,10 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1902
2107
  } catch (e) {
1903
2108
  consoleError(e);
1904
2109
  }
1905
- if (BUILD15.member) {
2110
+ if (BUILD20.member) {
1906
2111
  hostRef.$flags$ &= ~8 /* isConstructingInstance */;
1907
2112
  }
1908
- if (BUILD15.watchCallback) {
2113
+ if (BUILD20.watchCallback) {
1909
2114
  hostRef.$flags$ |= 128 /* isWatchReady */;
1910
2115
  }
1911
2116
  endNewInstance();
@@ -1915,22 +2120,24 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1915
2120
  const cmpTag = elm.localName;
1916
2121
  customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
1917
2122
  }
1918
- if (BUILD15.style && Cstr && Cstr.style) {
1919
- let style = Cstr.style;
1920
- if (BUILD15.mode && typeof style !== "string") {
2123
+ if (BUILD20.style && Cstr && Cstr.style) {
2124
+ let style;
2125
+ if (typeof Cstr.style === "string") {
2126
+ style = Cstr.style;
2127
+ } else if (BUILD20.mode && typeof Cstr.style !== "string") {
1921
2128
  hostRef.$modeName$ = computeMode(elm);
1922
2129
  if (hostRef.$modeName$) {
1923
- style = style[hostRef.$modeName$];
2130
+ style = Cstr.style[hostRef.$modeName$];
1924
2131
  }
1925
- if (BUILD15.hydrateServerSide && hostRef.$modeName$) {
2132
+ if (BUILD20.hydrateServerSide && hostRef.$modeName$) {
1926
2133
  elm.setAttribute("s-mode", hostRef.$modeName$);
1927
2134
  }
1928
2135
  }
1929
2136
  const scopeId2 = getScopeId(cmpMeta, hostRef.$modeName$);
1930
2137
  if (!styles.has(scopeId2)) {
1931
2138
  const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$);
1932
- if (!BUILD15.hydrateServerSide && BUILD15.shadowDom && // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
1933
- BUILD15.shadowDomShim && cmpMeta.$flags$ & 8 /* needsShadowDomShim */) {
2139
+ if (!BUILD20.hydrateServerSide && BUILD20.shadowDom && // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
2140
+ BUILD20.shadowDomShim && cmpMeta.$flags$ & 8 /* needsShadowDomShim */) {
1934
2141
  style = await import("./shadow-css.js").then((m) => m.scopeCss(style, scopeId2, false));
1935
2142
  }
1936
2143
  registerStyle(scopeId2, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
@@ -1940,14 +2147,14 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1940
2147
  }
1941
2148
  const ancestorComponent = hostRef.$ancestorComponent$;
1942
2149
  const schedule = () => scheduleUpdate(hostRef, true);
1943
- if (BUILD15.asyncLoading && ancestorComponent && ancestorComponent["s-rc"]) {
2150
+ if (BUILD20.asyncLoading && ancestorComponent && ancestorComponent["s-rc"]) {
1944
2151
  ancestorComponent["s-rc"].push(schedule);
1945
2152
  } else {
1946
2153
  schedule();
1947
2154
  }
1948
2155
  };
1949
2156
  var fireConnectedCallback = (instance) => {
1950
- if (BUILD15.lazyLoad && BUILD15.connectedCallback) {
2157
+ if (BUILD20.lazyLoad && BUILD20.connectedCallback) {
1951
2158
  safeCall(instance, "connectedCallback");
1952
2159
  }
1953
2160
  };
@@ -1958,38 +2165,38 @@ var connectedCallback = (elm) => {
1958
2165
  const hostRef = getHostRef(elm);
1959
2166
  const cmpMeta = hostRef.$cmpMeta$;
1960
2167
  const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
1961
- if (BUILD16.hostListenerTargetParent) {
2168
+ if (BUILD21.hostListenerTargetParent) {
1962
2169
  addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, true);
1963
2170
  }
1964
2171
  if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
1965
2172
  hostRef.$flags$ |= 1 /* hasConnected */;
1966
2173
  let hostId;
1967
- if (BUILD16.hydrateClientSide) {
2174
+ if (BUILD21.hydrateClientSide) {
1968
2175
  hostId = elm.getAttribute(HYDRATE_ID);
1969
2176
  if (hostId) {
1970
- if (BUILD16.shadowDom && supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
1971
- const scopeId2 = BUILD16.mode ? addStyle(elm.shadowRoot, cmpMeta, elm.getAttribute("s-mode")) : addStyle(elm.shadowRoot, cmpMeta);
2177
+ if (BUILD21.shadowDom && supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2178
+ const scopeId2 = BUILD21.mode ? addStyle(elm.shadowRoot, cmpMeta, elm.getAttribute("s-mode")) : addStyle(elm.shadowRoot, cmpMeta);
1972
2179
  elm.classList.remove(scopeId2 + "-h", scopeId2 + "-s");
1973
2180
  }
1974
2181
  initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);
1975
2182
  }
1976
2183
  }
1977
- if (BUILD16.slotRelocation && !hostId) {
1978
- if (BUILD16.hydrateServerSide || (BUILD16.slot || BUILD16.shadowDom) && // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
2184
+ if (BUILD21.slotRelocation && !hostId) {
2185
+ if (BUILD21.hydrateServerSide || (BUILD21.slot || BUILD21.shadowDom) && // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
1979
2186
  cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */)) {
1980
2187
  setContentReference(elm);
1981
2188
  }
1982
2189
  }
1983
- if (BUILD16.asyncLoading) {
2190
+ if (BUILD21.asyncLoading) {
1984
2191
  let ancestorComponent = elm;
1985
2192
  while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
1986
- if (BUILD16.hydrateClientSide && ancestorComponent.nodeType === 1 /* ElementNode */ && ancestorComponent.hasAttribute("s-id") && ancestorComponent["s-p"] || ancestorComponent["s-p"]) {
2193
+ if (BUILD21.hydrateClientSide && ancestorComponent.nodeType === 1 /* ElementNode */ && ancestorComponent.hasAttribute("s-id") && ancestorComponent["s-p"] || ancestorComponent["s-p"]) {
1987
2194
  attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
1988
2195
  break;
1989
2196
  }
1990
2197
  }
1991
2198
  }
1992
- if (BUILD16.prop && !BUILD16.hydrateServerSide && cmpMeta.$members$) {
2199
+ if (BUILD21.prop && !BUILD21.hydrateServerSide && cmpMeta.$members$) {
1993
2200
  Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
1994
2201
  if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
1995
2202
  const value = elm[memberName];
@@ -1998,7 +2205,7 @@ var connectedCallback = (elm) => {
1998
2205
  }
1999
2206
  });
2000
2207
  }
2001
- if (BUILD16.initializeNextTick) {
2208
+ if (BUILD21.initializeNextTick) {
2002
2209
  nextTick(() => initializeComponent(elm, hostRef, cmpMeta));
2003
2210
  } else {
2004
2211
  initializeComponent(elm, hostRef, cmpMeta);
@@ -2016,32 +2223,32 @@ var connectedCallback = (elm) => {
2016
2223
  };
2017
2224
  var setContentReference = (elm) => {
2018
2225
  const contentRefElm = elm["s-cr"] = doc.createComment(
2019
- BUILD16.isDebug ? `content-ref (host=${elm.localName})` : ""
2226
+ BUILD21.isDebug ? `content-ref (host=${elm.localName})` : ""
2020
2227
  );
2021
2228
  contentRefElm["s-cn"] = true;
2022
2229
  insertBefore(elm, contentRefElm, elm.firstChild);
2023
2230
  };
2024
2231
 
2025
2232
  // src/runtime/disconnected-callback.ts
2026
- import { BUILD as BUILD17 } from "@stencil/core/internal/app-data";
2233
+ import { BUILD as BUILD22 } from "@stencil/core/internal/app-data";
2027
2234
  var disconnectInstance = (instance) => {
2028
- if (BUILD17.lazyLoad && BUILD17.disconnectedCallback) {
2235
+ if (BUILD22.lazyLoad && BUILD22.disconnectedCallback) {
2029
2236
  safeCall(instance, "disconnectedCallback");
2030
2237
  }
2031
- if (BUILD17.cmpDidUnload) {
2238
+ if (BUILD22.cmpDidUnload) {
2032
2239
  safeCall(instance, "componentDidUnload");
2033
2240
  }
2034
2241
  };
2035
2242
  var disconnectedCallback = async (elm) => {
2036
2243
  if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
2037
2244
  const hostRef = getHostRef(elm);
2038
- if (BUILD17.hostListener) {
2245
+ if (BUILD22.hostListener) {
2039
2246
  if (hostRef.$rmListeners$) {
2040
2247
  hostRef.$rmListeners$.map((rmListener) => rmListener());
2041
2248
  hostRef.$rmListeners$ = void 0;
2042
2249
  }
2043
2250
  }
2044
- if (!BUILD17.lazyLoad) {
2251
+ if (!BUILD22.lazyLoad) {
2045
2252
  disconnectInstance(elm);
2046
2253
  } else if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
2047
2254
  disconnectInstance(hostRef.$lazyInstance$);
@@ -2052,7 +2259,7 @@ var disconnectedCallback = async (elm) => {
2052
2259
  };
2053
2260
 
2054
2261
  // src/runtime/dom-extras.ts
2055
- import { BUILD as BUILD18 } from "@stencil/core/internal/app-data";
2262
+ import { BUILD as BUILD23 } from "@stencil/core/internal/app-data";
2056
2263
  var patchPseudoShadowDom = (hostElementPrototype, descriptorPrototype) => {
2057
2264
  patchCloneNode(hostElementPrototype);
2058
2265
  patchSlotAppendChild(hostElementPrototype);
@@ -2069,9 +2276,9 @@ var patchCloneNode = (HostElementPrototype) => {
2069
2276
  const orgCloneNode = HostElementPrototype.cloneNode;
2070
2277
  HostElementPrototype.cloneNode = function(deep) {
2071
2278
  const srcNode = this;
2072
- const isShadowDom = BUILD18.shadowDom ? srcNode.shadowRoot && supportsShadow : false;
2279
+ const isShadowDom = BUILD23.shadowDom ? srcNode.shadowRoot && supportsShadow : false;
2073
2280
  const clonedNode = orgCloneNode.call(srcNode, isShadowDom ? deep : false);
2074
- if (BUILD18.slot && !isShadowDom && deep) {
2281
+ if (BUILD23.slot && !isShadowDom && deep) {
2075
2282
  let i2 = 0;
2076
2283
  let slotted, nonStencilNode;
2077
2284
  const stencilPrivates = [
@@ -2095,7 +2302,7 @@ var patchCloneNode = (HostElementPrototype) => {
2095
2302
  slotted = srcNode.childNodes[i2]["s-nr"];
2096
2303
  nonStencilNode = stencilPrivates.every((privateField) => !srcNode.childNodes[i2][privateField]);
2097
2304
  if (slotted) {
2098
- if (BUILD18.appendChildSlotFix && clonedNode.__appendChild) {
2305
+ if (BUILD23.appendChildSlotFix && clonedNode.__appendChild) {
2099
2306
  clonedNode.__appendChild(slotted.cloneNode(true));
2100
2307
  } else {
2101
2308
  clonedNode.appendChild(slotted.cloneNode(true));
@@ -2221,7 +2428,7 @@ var patchSlotInsertAdjacentElement = (HostElementPrototype) => {
2221
2428
  var patchTextContent = (hostElementPrototype) => {
2222
2429
  const descriptor = Object.getOwnPropertyDescriptor(Node.prototype, "textContent");
2223
2430
  Object.defineProperty(hostElementPrototype, "__textContent", descriptor);
2224
- if (BUILD18.experimentalScopedSlotChanges) {
2431
+ if (BUILD23.experimentalScopedSlotChanges) {
2225
2432
  Object.defineProperty(hostElementPrototype, "textContent", {
2226
2433
  // To mimic shadow root behavior, we need to return the text content of all
2227
2434
  // nodes in a slot reference node
@@ -2373,36 +2580,36 @@ var proxyCustomElement = (Cstr, compactMeta) => {
2373
2580
  $flags$: compactMeta[0],
2374
2581
  $tagName$: compactMeta[1]
2375
2582
  };
2376
- if (BUILD19.member) {
2583
+ if (BUILD24.member) {
2377
2584
  cmpMeta.$members$ = compactMeta[2];
2378
2585
  }
2379
- if (BUILD19.hostListener) {
2586
+ if (BUILD24.hostListener) {
2380
2587
  cmpMeta.$listeners$ = compactMeta[3];
2381
2588
  }
2382
- if (BUILD19.watchCallback) {
2589
+ if (BUILD24.watchCallback) {
2383
2590
  cmpMeta.$watchers$ = Cstr.$watchers$;
2384
2591
  }
2385
- if (BUILD19.reflect) {
2592
+ if (BUILD24.reflect) {
2386
2593
  cmpMeta.$attrsToReflect$ = [];
2387
2594
  }
2388
- if (BUILD19.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2595
+ if (BUILD24.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2389
2596
  cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
2390
2597
  }
2391
- if (BUILD19.experimentalSlotFixes) {
2392
- if (BUILD19.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
2598
+ if (BUILD24.experimentalSlotFixes) {
2599
+ if (BUILD24.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
2393
2600
  patchPseudoShadowDom(Cstr.prototype, cmpMeta);
2394
2601
  }
2395
2602
  } else {
2396
- if (BUILD19.slotChildNodesFix) {
2603
+ if (BUILD24.slotChildNodesFix) {
2397
2604
  patchChildSlotNodes(Cstr.prototype, cmpMeta);
2398
2605
  }
2399
- if (BUILD19.cloneNodeFix) {
2606
+ if (BUILD24.cloneNodeFix) {
2400
2607
  patchCloneNode(Cstr.prototype);
2401
2608
  }
2402
- if (BUILD19.appendChildSlotFix) {
2609
+ if (BUILD24.appendChildSlotFix) {
2403
2610
  patchSlotAppendChild(Cstr.prototype);
2404
2611
  }
2405
- if (BUILD19.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
2612
+ if (BUILD24.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
2406
2613
  patchTextContent(Cstr.prototype);
2407
2614
  }
2408
2615
  }
@@ -2413,26 +2620,36 @@ var proxyCustomElement = (Cstr, compactMeta) => {
2413
2620
  registerHost(this, cmpMeta);
2414
2621
  },
2415
2622
  connectedCallback() {
2623
+ const hostRef = getHostRef(this);
2624
+ addHostEventListeners(this, hostRef, cmpMeta.$listeners$, false);
2416
2625
  connectedCallback(this);
2417
- if (BUILD19.connectedCallback && originalConnectedCallback) {
2626
+ if (BUILD24.connectedCallback && originalConnectedCallback) {
2418
2627
  originalConnectedCallback.call(this);
2419
2628
  }
2420
2629
  },
2421
2630
  disconnectedCallback() {
2422
2631
  disconnectedCallback(this);
2423
- if (BUILD19.disconnectedCallback && originalDisconnectedCallback) {
2632
+ if (BUILD24.disconnectedCallback && originalDisconnectedCallback) {
2424
2633
  originalDisconnectedCallback.call(this);
2425
2634
  }
2426
2635
  },
2427
2636
  __attachShadow() {
2428
2637
  if (supportsShadow) {
2429
- if (BUILD19.shadowDelegatesFocus) {
2430
- this.attachShadow({
2431
- mode: "open",
2432
- delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */)
2433
- });
2638
+ if (!this.shadowRoot) {
2639
+ if (BUILD24.shadowDelegatesFocus) {
2640
+ this.attachShadow({
2641
+ mode: "open",
2642
+ delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */)
2643
+ });
2644
+ } else {
2645
+ this.attachShadow({ mode: "open" });
2646
+ }
2434
2647
  } else {
2435
- this.attachShadow({ mode: "open" });
2648
+ if (this.shadowRoot.mode !== "open") {
2649
+ throw new Error(
2650
+ `Unable to re-use existing shadow root for ${cmpMeta.$tagName$}! Mode is set to ${this.shadowRoot.mode} but Stencil only supports open shadow roots.`
2651
+ );
2652
+ }
2436
2653
  }
2437
2654
  } else {
2438
2655
  this.shadowRoot = this;
@@ -2443,7 +2660,7 @@ var proxyCustomElement = (Cstr, compactMeta) => {
2443
2660
  return proxyComponent(Cstr, cmpMeta, 1 /* isElementConstructor */ | 2 /* proxyState */);
2444
2661
  };
2445
2662
  var forceModeUpdate = (elm) => {
2446
- if (BUILD19.style && BUILD19.mode && !BUILD19.lazyLoad) {
2663
+ if (BUILD24.style && BUILD24.mode && !BUILD24.lazyLoad) {
2447
2664
  const mode = computeMode(elm);
2448
2665
  const hostRef = getHostRef(elm);
2449
2666
  if (hostRef.$modeName$ !== mode) {
@@ -2466,7 +2683,7 @@ var forceModeUpdate = (elm) => {
2466
2683
  };
2467
2684
 
2468
2685
  // src/runtime/bootstrap-lazy.ts
2469
- import { BUILD as BUILD20 } from "@stencil/core/internal/app-data";
2686
+ import { BUILD as BUILD25 } from "@stencil/core/internal/app-data";
2470
2687
 
2471
2688
  // src/runtime/hmr-component.ts
2472
2689
  var hmrStart = (hostElement, cmpMeta, hmrVersionId) => {
@@ -2478,7 +2695,7 @@ var hmrStart = (hostElement, cmpMeta, hmrVersionId) => {
2478
2695
  // src/runtime/bootstrap-lazy.ts
2479
2696
  var bootstrapLazy = (lazyBundles, options = {}) => {
2480
2697
  var _a;
2481
- if (BUILD20.profile && performance.mark) {
2698
+ if (BUILD25.profile && performance.mark) {
2482
2699
  performance.mark("st:app:start");
2483
2700
  }
2484
2701
  installDevTools();
@@ -2496,15 +2713,15 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
2496
2713
  let i2 = 0;
2497
2714
  Object.assign(plt, options);
2498
2715
  plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./", doc.baseURI).href;
2499
- if (BUILD20.asyncQueue) {
2716
+ if (BUILD25.asyncQueue) {
2500
2717
  if (options.syncQueue) {
2501
2718
  plt.$flags$ |= 4 /* queueSync */;
2502
2719
  }
2503
2720
  }
2504
- if (BUILD20.hydrateClientSide) {
2721
+ if (BUILD25.hydrateClientSide) {
2505
2722
  plt.$flags$ |= 2 /* appLoaded */;
2506
2723
  }
2507
- if (BUILD20.hydrateClientSide && BUILD20.shadowDom) {
2724
+ if (BUILD25.hydrateClientSide && BUILD25.shadowDom) {
2508
2725
  for (; i2 < styles2.length; i2++) {
2509
2726
  registerStyle(styles2[i2].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles2[i2].innerHTML), true);
2510
2727
  }
@@ -2522,44 +2739,58 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
2522
2739
  if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
2523
2740
  hasSlotRelocation = true;
2524
2741
  }
2525
- if (BUILD20.member) {
2742
+ if (BUILD25.member) {
2526
2743
  cmpMeta.$members$ = compactMeta[2];
2527
2744
  }
2528
- if (BUILD20.hostListener) {
2745
+ if (BUILD25.hostListener) {
2529
2746
  cmpMeta.$listeners$ = compactMeta[3];
2530
2747
  }
2531
- if (BUILD20.reflect) {
2748
+ if (BUILD25.reflect) {
2532
2749
  cmpMeta.$attrsToReflect$ = [];
2533
2750
  }
2534
- if (BUILD20.watchCallback) {
2751
+ if (BUILD25.watchCallback) {
2535
2752
  cmpMeta.$watchers$ = (_a2 = compactMeta[4]) != null ? _a2 : {};
2536
2753
  }
2537
- if (BUILD20.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2754
+ if (BUILD25.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2538
2755
  cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
2539
2756
  }
2540
- const tagName = BUILD20.transformTagName && options.transformTagName ? options.transformTagName(cmpMeta.$tagName$) : cmpMeta.$tagName$;
2757
+ const tagName = BUILD25.transformTagName && options.transformTagName ? options.transformTagName(cmpMeta.$tagName$) : cmpMeta.$tagName$;
2541
2758
  const HostElement = class extends HTMLElement {
2542
2759
  // StencilLazyHost
2543
2760
  constructor(self) {
2544
2761
  super(self);
2762
+ this.hasRegisteredEventListeners = false;
2545
2763
  self = this;
2546
2764
  registerHost(self, cmpMeta);
2547
- if (BUILD20.shadowDom && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2765
+ if (BUILD25.shadowDom && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2548
2766
  if (supportsShadow) {
2549
- if (BUILD20.shadowDelegatesFocus) {
2550
- self.attachShadow({
2551
- mode: "open",
2552
- delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */)
2553
- });
2767
+ if (!self.shadowRoot) {
2768
+ if (BUILD25.shadowDelegatesFocus) {
2769
+ self.attachShadow({
2770
+ mode: "open",
2771
+ delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */)
2772
+ });
2773
+ } else {
2774
+ self.attachShadow({ mode: "open" });
2775
+ }
2554
2776
  } else {
2555
- self.attachShadow({ mode: "open" });
2777
+ if (self.shadowRoot.mode !== "open") {
2778
+ throw new Error(
2779
+ `Unable to re-use existing shadow root for ${cmpMeta.$tagName$}! Mode is set to ${self.shadowRoot.mode} but Stencil only supports open shadow roots.`
2780
+ );
2781
+ }
2556
2782
  }
2557
- } else if (!BUILD20.hydrateServerSide && !("shadowRoot" in self)) {
2783
+ } else if (!BUILD25.hydrateServerSide && !("shadowRoot" in self)) {
2558
2784
  self.shadowRoot = self;
2559
2785
  }
2560
2786
  }
2561
2787
  }
2562
2788
  connectedCallback() {
2789
+ const hostRef = getHostRef(this);
2790
+ if (!this.hasRegisteredEventListeners) {
2791
+ this.hasRegisteredEventListeners = true;
2792
+ addHostEventListeners(this, hostRef, cmpMeta.$listeners$, false);
2793
+ }
2563
2794
  if (appLoadFallback) {
2564
2795
  clearTimeout(appLoadFallback);
2565
2796
  appLoadFallback = null;
@@ -2577,28 +2808,28 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
2577
2808
  return getHostRef(this).$onReadyPromise$;
2578
2809
  }
2579
2810
  };
2580
- if (BUILD20.experimentalSlotFixes) {
2581
- if (BUILD20.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
2811
+ if (BUILD25.experimentalSlotFixes) {
2812
+ if (BUILD25.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
2582
2813
  patchPseudoShadowDom(HostElement.prototype, cmpMeta);
2583
2814
  }
2584
2815
  } else {
2585
- if (BUILD20.slotChildNodesFix) {
2816
+ if (BUILD25.slotChildNodesFix) {
2586
2817
  patchChildSlotNodes(HostElement.prototype, cmpMeta);
2587
2818
  }
2588
- if (BUILD20.cloneNodeFix) {
2819
+ if (BUILD25.cloneNodeFix) {
2589
2820
  patchCloneNode(HostElement.prototype);
2590
2821
  }
2591
- if (BUILD20.appendChildSlotFix) {
2822
+ if (BUILD25.appendChildSlotFix) {
2592
2823
  patchSlotAppendChild(HostElement.prototype);
2593
2824
  }
2594
- if (BUILD20.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
2825
+ if (BUILD25.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
2595
2826
  patchTextContent(HostElement.prototype);
2596
2827
  }
2597
2828
  }
2598
- if (BUILD20.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */) {
2829
+ if (BUILD25.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */) {
2599
2830
  HostElement.formAssociated = true;
2600
2831
  }
2601
- if (BUILD20.hotModuleReplacement) {
2832
+ if (BUILD25.hotModuleReplacement) {
2602
2833
  HostElement.prototype["s-hmr"] = function(hmrVersionId) {
2603
2834
  hmrStart(this, cmpMeta, hmrVersionId);
2604
2835
  };
@@ -2617,8 +2848,8 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
2617
2848
  if (hasSlotRelocation) {
2618
2849
  dataStyles.textContent += SLOT_FB_CSS;
2619
2850
  }
2620
- if (BUILD20.invisiblePrehydration && (BUILD20.hydratedClass || BUILD20.hydratedAttribute)) {
2621
- dataStyles.textContent += cmpTags + HYDRATED_CSS;
2851
+ if (BUILD25.invisiblePrehydration && (BUILD25.hydratedClass || BUILD25.hydratedAttribute)) {
2852
+ dataStyles.textContent += cmpTags.sort() + HYDRATED_CSS;
2622
2853
  }
2623
2854
  if (dataStyles.innerHTML.length) {
2624
2855
  dataStyles.setAttribute("data-styles", "");
@@ -2633,7 +2864,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
2633
2864
  if (deferredConnectedCallbacks.length) {
2634
2865
  deferredConnectedCallbacks.map((host) => host.connectedCallback());
2635
2866
  } else {
2636
- if (BUILD20.profile) {
2867
+ if (BUILD25.profile) {
2637
2868
  plt.jmp(() => appLoadFallback = setTimeout(appDidLoad, 30, "timeout"));
2638
2869
  } else {
2639
2870
  plt.jmp(() => appLoadFallback = setTimeout(appDidLoad, 30));
@@ -2646,10 +2877,10 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
2646
2877
  var Fragment = (_, children) => children;
2647
2878
 
2648
2879
  // src/runtime/host-listener.ts
2649
- import { BUILD as BUILD21 } from "@stencil/core/internal/app-data";
2880
+ import { BUILD as BUILD26 } from "@stencil/core/internal/app-data";
2650
2881
  var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
2651
- if (BUILD21.hostListener && listeners) {
2652
- if (BUILD21.hostListenerTargetParent) {
2882
+ if (BUILD26.hostListener && listeners) {
2883
+ if (BUILD26.hostListenerTargetParent) {
2653
2884
  if (attachParentListeners) {
2654
2885
  listeners = listeners.filter(([flags]) => flags & 32 /* TargetParent */);
2655
2886
  } else {
@@ -2657,7 +2888,7 @@ var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) =>
2657
2888
  }
2658
2889
  }
2659
2890
  listeners.map(([flags, name, method]) => {
2660
- const target = BUILD21.hostListenerTarget ? getHostListenerTarget(elm, flags) : elm;
2891
+ const target = BUILD26.hostListenerTarget ? getHostListenerTarget(elm, flags) : elm;
2661
2892
  const handler = hostListenerProxy(hostRef, method);
2662
2893
  const opts = hostListenerOpts(flags);
2663
2894
  plt.ael(target, name, handler, opts);
@@ -2668,7 +2899,7 @@ var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) =>
2668
2899
  var hostListenerProxy = (hostRef, methodName) => (ev) => {
2669
2900
  var _a;
2670
2901
  try {
2671
- if (BUILD21.lazyLoad) {
2902
+ if (BUILD26.lazyLoad) {
2672
2903
  if (hostRef.$flags$ & 256 /* isListenReady */) {
2673
2904
  (_a = hostRef.$lazyInstance$) == null ? void 0 : _a[methodName](ev);
2674
2905
  } else {
@@ -2682,10 +2913,10 @@ var hostListenerProxy = (hostRef, methodName) => (ev) => {
2682
2913
  }
2683
2914
  };
2684
2915
  var getHostListenerTarget = (elm, flags) => {
2685
- if (BUILD21.hostListenerTargetDocument && flags & 4 /* TargetDocument */) return doc;
2686
- if (BUILD21.hostListenerTargetWindow && flags & 8 /* TargetWindow */) return win;
2687
- if (BUILD21.hostListenerTargetBody && flags & 16 /* TargetBody */) return doc.body;
2688
- if (BUILD21.hostListenerTargetParent && flags & 32 /* TargetParent */ && elm.parentElement)
2916
+ if (BUILD26.hostListenerTargetDocument && flags & 4 /* TargetDocument */) return doc;
2917
+ if (BUILD26.hostListenerTargetWindow && flags & 8 /* TargetWindow */) return win;
2918
+ if (BUILD26.hostListenerTargetBody && flags & 16 /* TargetBody */) return doc.body;
2919
+ if (BUILD26.hostListenerTargetParent && flags & 32 /* TargetParent */ && elm.parentElement)
2689
2920
  return elm.parentElement;
2690
2921
  return elm;
2691
2922
  };
@@ -2752,6 +2983,7 @@ var insertVdomAnnotations = (doc2, staticComponents) => {
2752
2983
  }
2753
2984
  };
2754
2985
  var parseVNodeAnnotations = (doc2, node, docData, orgLocationNodes) => {
2986
+ var _a;
2755
2987
  if (node == null) {
2756
2988
  return;
2757
2989
  }
@@ -2759,7 +2991,8 @@ var parseVNodeAnnotations = (doc2, node, docData, orgLocationNodes) => {
2759
2991
  orgLocationNodes.push(node);
2760
2992
  }
2761
2993
  if (node.nodeType === 1 /* ElementNode */) {
2762
- node.childNodes.forEach((childNode) => {
2994
+ const childNodes = [...Array.from(node.childNodes), ...Array.from(((_a = node.shadowRoot) == null ? void 0 : _a.childNodes) || [])];
2995
+ childNodes.forEach((childNode) => {
2763
2996
  const hostRef = getHostRef(childNode);
2764
2997
  if (hostRef != null && !docData.staticComponents.has(childNode.nodeName.toLowerCase())) {
2765
2998
  const cmpData = {
@@ -2835,212 +3068,6 @@ var insertChildVNodeAnnotations = (doc2, vnodeChild, cmpData, hostId, depth, ind
2835
3068
  });
2836
3069
  }
2837
3070
  };
2838
-
2839
- // src/client/client-host-ref.ts
2840
- var hostRefs = BUILD22.hotModuleReplacement ? window.__STENCIL_HOSTREFS__ || (window.__STENCIL_HOSTREFS__ = /* @__PURE__ */ new WeakMap()) : /* @__PURE__ */ new WeakMap();
2841
- var getHostRef = (ref) => hostRefs.get(ref);
2842
- var registerInstance = (lazyInstance, hostRef) => hostRefs.set(hostRef.$lazyInstance$ = lazyInstance, hostRef);
2843
- var registerHost = (hostElement, cmpMeta) => {
2844
- const hostRef = {
2845
- $flags$: 0,
2846
- $hostElement$: hostElement,
2847
- $cmpMeta$: cmpMeta,
2848
- $instanceValues$: /* @__PURE__ */ new Map()
2849
- };
2850
- if (BUILD22.isDev) {
2851
- hostRef.$renderCount$ = 0;
2852
- }
2853
- if (BUILD22.method && BUILD22.lazyLoad) {
2854
- hostRef.$onInstancePromise$ = new Promise((r) => hostRef.$onInstanceResolve$ = r);
2855
- }
2856
- if (BUILD22.asyncLoading) {
2857
- hostRef.$onReadyPromise$ = new Promise((r) => hostRef.$onReadyResolve$ = r);
2858
- hostElement["s-p"] = [];
2859
- hostElement["s-rc"] = [];
2860
- }
2861
- addHostEventListeners(hostElement, hostRef, cmpMeta.$listeners$, false);
2862
- return hostRefs.set(hostElement, hostRef);
2863
- };
2864
- var isMemberInElement = (elm, memberName) => memberName in elm;
2865
-
2866
- // src/client/client-load-module.ts
2867
- import { BUILD as BUILD24 } from "@stencil/core/internal/app-data";
2868
-
2869
- // src/client/client-log.ts
2870
- import { BUILD as BUILD23 } from "@stencil/core/internal/app-data";
2871
- var customError;
2872
- var consoleError = (e, el) => (customError || console.error)(e, el);
2873
- var STENCIL_DEV_MODE = BUILD23.isTesting ? ["STENCIL:"] : [
2874
- "%cstencil",
2875
- "color: white;background:#4c47ff;font-weight: bold; font-size:10px; padding:2px 6px; border-radius: 5px"
2876
- ];
2877
- var consoleDevError = (...m) => console.error(...STENCIL_DEV_MODE, ...m);
2878
- var consoleDevWarn = (...m) => console.warn(...STENCIL_DEV_MODE, ...m);
2879
- var consoleDevInfo = (...m) => console.info(...STENCIL_DEV_MODE, ...m);
2880
- var setErrorHandler = (handler) => customError = handler;
2881
-
2882
- // src/client/client-load-module.ts
2883
- var cmpModules = /* @__PURE__ */ new Map();
2884
- var MODULE_IMPORT_PREFIX = "./";
2885
- var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
2886
- const exportName = cmpMeta.$tagName$.replace(/-/g, "_");
2887
- const bundleId = cmpMeta.$lazyBundleId$;
2888
- if (BUILD24.isDev && typeof bundleId !== "string") {
2889
- consoleDevError(
2890
- `Trying to lazily load component <${cmpMeta.$tagName$}> with style mode "${hostRef.$modeName$}", but it does not exist.`
2891
- );
2892
- return void 0;
2893
- } else if (!bundleId) {
2894
- return void 0;
2895
- }
2896
- const module = !BUILD24.hotModuleReplacement ? cmpModules.get(bundleId) : false;
2897
- if (module) {
2898
- return module[exportName];
2899
- }
2900
- /*!__STENCIL_STATIC_IMPORT_SWITCH__*/
2901
- return import(
2902
- /* @vite-ignore */
2903
- /* webpackInclude: /\.entry\.js$/ */
2904
- /* webpackExclude: /\.system\.entry\.js$/ */
2905
- /* webpackMode: "lazy" */
2906
- `./${bundleId}.entry.js${BUILD24.hotModuleReplacement && hmrVersionId ? "?s-hmr=" + hmrVersionId : ""}`
2907
- ).then((importedModule) => {
2908
- if (!BUILD24.hotModuleReplacement) {
2909
- cmpModules.set(bundleId, importedModule);
2910
- }
2911
- return importedModule[exportName];
2912
- }, consoleError);
2913
- };
2914
-
2915
- // src/client/client-style.ts
2916
- var styles = /* @__PURE__ */ new Map();
2917
- var modeResolutionChain = [];
2918
-
2919
- // src/client/client-task-queue.ts
2920
- import { BUILD as BUILD26 } from "@stencil/core/internal/app-data";
2921
-
2922
- // src/client/client-window.ts
2923
- import { BUILD as BUILD25 } from "@stencil/core/internal/app-data";
2924
- var win = typeof window !== "undefined" ? window : {};
2925
- var doc = win.document || { head: {} };
2926
- var H = win.HTMLElement || class {
2927
- };
2928
- var plt = {
2929
- $flags$: 0,
2930
- $resourcesUrl$: "",
2931
- jmp: (h2) => h2(),
2932
- raf: (h2) => requestAnimationFrame(h2),
2933
- ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
2934
- rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
2935
- ce: (eventName, opts) => new CustomEvent(eventName, opts)
2936
- };
2937
- var setPlatformHelpers = (helpers) => {
2938
- Object.assign(plt, helpers);
2939
- };
2940
- var supportsShadow = (
2941
- // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
2942
- BUILD25.shadowDomShim && BUILD25.shadowDom ? /* @__PURE__ */ (() => (doc.head.attachShadow + "").indexOf("[native") > -1)() : true
2943
- );
2944
- var supportsListenerOptions = /* @__PURE__ */ (() => {
2945
- let supportsListenerOptions2 = false;
2946
- try {
2947
- doc.addEventListener(
2948
- "e",
2949
- null,
2950
- Object.defineProperty({}, "passive", {
2951
- get() {
2952
- supportsListenerOptions2 = true;
2953
- }
2954
- })
2955
- );
2956
- } catch (e) {
2957
- }
2958
- return supportsListenerOptions2;
2959
- })();
2960
- var promiseResolve = (v) => Promise.resolve(v);
2961
- var supportsConstructableStylesheets = BUILD25.constructableCSS ? /* @__PURE__ */ (() => {
2962
- try {
2963
- new CSSStyleSheet();
2964
- return typeof new CSSStyleSheet().replaceSync === "function";
2965
- } catch (e) {
2966
- }
2967
- return false;
2968
- })() : false;
2969
-
2970
- // src/client/client-task-queue.ts
2971
- var queueCongestion = 0;
2972
- var queuePending = false;
2973
- var queueDomReads = [];
2974
- var queueDomWrites = [];
2975
- var queueDomWritesLow = [];
2976
- var queueTask = (queue, write) => (cb) => {
2977
- queue.push(cb);
2978
- if (!queuePending) {
2979
- queuePending = true;
2980
- if (write && plt.$flags$ & 4 /* queueSync */) {
2981
- nextTick(flush);
2982
- } else {
2983
- plt.raf(flush);
2984
- }
2985
- }
2986
- };
2987
- var consume = (queue) => {
2988
- for (let i2 = 0; i2 < queue.length; i2++) {
2989
- try {
2990
- queue[i2](performance.now());
2991
- } catch (e) {
2992
- consoleError(e);
2993
- }
2994
- }
2995
- queue.length = 0;
2996
- };
2997
- var consumeTimeout = (queue, timeout) => {
2998
- let i2 = 0;
2999
- let ts = 0;
3000
- while (i2 < queue.length && (ts = performance.now()) < timeout) {
3001
- try {
3002
- queue[i2++](ts);
3003
- } catch (e) {
3004
- consoleError(e);
3005
- }
3006
- }
3007
- if (i2 === queue.length) {
3008
- queue.length = 0;
3009
- } else if (i2 !== 0) {
3010
- queue.splice(0, i2);
3011
- }
3012
- };
3013
- var flush = () => {
3014
- if (BUILD26.asyncQueue) {
3015
- queueCongestion++;
3016
- }
3017
- consume(queueDomReads);
3018
- if (BUILD26.asyncQueue) {
3019
- const timeout = (plt.$flags$ & 6 /* queueMask */) === 2 /* appLoaded */ ? performance.now() + 14 * Math.ceil(queueCongestion * (1 / 10)) : Infinity;
3020
- consumeTimeout(queueDomWrites, timeout);
3021
- consumeTimeout(queueDomWritesLow, timeout);
3022
- if (queueDomWrites.length > 0) {
3023
- queueDomWritesLow.push(...queueDomWrites);
3024
- queueDomWrites.length = 0;
3025
- }
3026
- if (queuePending = queueDomReads.length + queueDomWrites.length + queueDomWritesLow.length > 0) {
3027
- plt.raf(flush);
3028
- } else {
3029
- queueCongestion = 0;
3030
- }
3031
- } else {
3032
- consume(queueDomWrites);
3033
- if (queuePending = queueDomReads.length > 0) {
3034
- plt.raf(flush);
3035
- }
3036
- }
3037
- };
3038
- var nextTick = (cb) => promiseResolve().then(cb);
3039
- var readTask = /* @__PURE__ */ queueTask(queueDomReads, false);
3040
- var writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);
3041
-
3042
- // src/client/index.ts
3043
- import { BUILD as BUILD27, Env, NAMESPACE as NAMESPACE2 } from "@stencil/core/internal/app-data";
3044
3071
  export {
3045
3072
  BUILD27 as BUILD,
3046
3073
  Build,