genesys-spark-chart-components 4.155.0 → 4.156.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 (54) hide show
  1. package/dist/cjs/color-palette-DguVB2fN.js +96 -0
  2. package/dist/cjs/genesys-chart-webcomponents.cjs.js +7 -8
  3. package/dist/cjs/gux-chart-column-beta.cjs.entry.js +4 -7
  4. package/dist/cjs/gux-chart-donut-beta.cjs.entry.js +5 -8
  5. package/dist/cjs/gux-chart-line-beta.cjs.entry.js +5 -8
  6. package/dist/cjs/gux-chart-pie-beta.cjs.entry.js +5 -8
  7. package/dist/cjs/gux-chart-scatter-plot-beta.cjs.entry.js +5 -8
  8. package/dist/cjs/gux-visualization-beta.cjs.entry.js +45549 -40654
  9. package/dist/cjs/{index-e390a39a.js → index-D32B1d05.js} +390 -304
  10. package/dist/cjs/loader.cjs.js +3 -6
  11. package/dist/collection/collection-manifest.json +1 -1
  12. package/dist/collection/components/beta/gux-chart-column/gux-chart-column.js +13 -10
  13. package/dist/collection/components/beta/gux-chart-donut/gux-chart-donut.js +19 -16
  14. package/dist/collection/components/beta/gux-chart-line/gux-chart-line.js +16 -14
  15. package/dist/collection/components/beta/gux-chart-pie/gux-chart-pie.js +9 -7
  16. package/dist/collection/components/beta/gux-chart-scatter-plot/gux-chart-scatter-plot.js +14 -12
  17. package/dist/collection/components/beta/gux-visualization/gux-visualization.js +2 -0
  18. package/dist/esm/color-palette-C3ohlwPT.js +91 -0
  19. package/dist/esm/genesys-chart-webcomponents.js +5 -5
  20. package/dist/esm/gux-chart-column-beta.entry.js +4 -5
  21. package/dist/esm/gux-chart-donut-beta.entry.js +5 -6
  22. package/dist/esm/gux-chart-line-beta.entry.js +5 -6
  23. package/dist/esm/gux-chart-pie-beta.entry.js +5 -6
  24. package/dist/esm/gux-chart-scatter-plot-beta.entry.js +5 -6
  25. package/dist/esm/gux-visualization-beta.entry.js +45550 -40653
  26. package/dist/esm/{index-eabc38b4.js → index-7ILyl2XS.js} +387 -300
  27. package/dist/esm/loader.js +3 -4
  28. package/dist/genesys-chart-webcomponents/genesys-chart-webcomponents.esm.js +1 -1
  29. package/dist/genesys-chart-webcomponents/p-49ac1324.entry.js +1 -0
  30. package/dist/genesys-chart-webcomponents/p-711e444a.entry.js +1 -0
  31. package/dist/genesys-chart-webcomponents/p-7352f717.entry.js +11 -0
  32. package/dist/genesys-chart-webcomponents/p-7ILyl2XS.js +2 -0
  33. package/dist/genesys-chart-webcomponents/{p-19d6feca.entry.js → p-97d9c60c.entry.js} +1 -1
  34. package/dist/genesys-chart-webcomponents/p-C3ohlwPT.js +1 -0
  35. package/dist/genesys-chart-webcomponents/{p-4d99a574.entry.js → p-af84a21b.entry.js} +1 -1
  36. package/dist/genesys-chart-webcomponents/p-d9b0ef63.entry.js +1 -0
  37. package/dist/types/components.d.ts +48 -0
  38. package/dist/types/stencil-public-runtime.d.ts +23 -1
  39. package/package.json +13 -17
  40. package/dist/cjs/app-globals-3a1e7e63.js +0 -5
  41. package/dist/cjs/color-palette-d3da8bf7.js +0 -223
  42. package/dist/esm/app-globals-0f993ce5.js +0 -3
  43. package/dist/esm/color-palette-a79b1aac.js +0 -218
  44. package/dist/genesys-chart-webcomponents/p-22c066a2.js +0 -1
  45. package/dist/genesys-chart-webcomponents/p-3c039745.entry.js +0 -1
  46. package/dist/genesys-chart-webcomponents/p-7e5fa729.entry.js +0 -11
  47. package/dist/genesys-chart-webcomponents/p-9617a5da.entry.js +0 -1
  48. package/dist/genesys-chart-webcomponents/p-977a4087.js +0 -2
  49. package/dist/genesys-chart-webcomponents/p-e1255160.js +0 -1
  50. package/dist/genesys-chart-webcomponents/p-ec37c345.entry.js +0 -1
  51. package/dist/loader/package.json +0 -11
  52. /package/dist/cjs/{log-error-8f448752.js → log-error-BMPVm36Q.js} +0 -0
  53. /package/dist/esm/{log-error-fbbfc3ab.js → log-error-nsqlWzyl.js} +0 -0
  54. /package/dist/genesys-chart-webcomponents/{p-23610106.js → p-nsqlWzyl.js} +0 -0
@@ -1,8 +1,11 @@
1
1
  const NAMESPACE = 'genesys-chart-webcomponents';
2
- const BUILD = /* genesys-chart-webcomponents */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: false, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: true, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: false, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: true, hydratedClass: false, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, modernPropertyDecls: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: false, propNumber: true, propString: true, reflect: false, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: false, slotChildNodesFix: false, slotRelocation: false, state: false, style: true, svg: false, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: true, vdomListener: false, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: false, vdomText: false, vdomXlink: false, watchCallback: true };
2
+ const BUILD = /* genesys-chart-webcomponents */ { hydratedSelectorName: "hydrated", lazyLoad: true, updatable: true};
3
+
4
+ const globalScripts = () => {};
5
+ const globalStyles = "";
3
6
 
4
7
  /*
5
- Stencil Client Platform v4.23.2 | MIT Licensed | https://stenciljs.com
8
+ Stencil Client Platform v4.35.1 | MIT Licensed | https://stenciljs.com
6
9
  */
7
10
  var __defProp = Object.defineProperty;
8
11
  var __export = (target, all) => {
@@ -11,10 +14,15 @@ var __export = (target, all) => {
11
14
  };
12
15
 
13
16
  // src/client/client-host-ref.ts
14
- var hostRefs = /* @__PURE__ */ new WeakMap();
15
- var getHostRef = (ref) => hostRefs.get(ref);
17
+ var getHostRef = (ref) => {
18
+ if (ref.__stencil__getHostRef) {
19
+ return ref.__stencil__getHostRef();
20
+ }
21
+ return void 0;
22
+ };
16
23
  var registerInstance = (lazyInstance, hostRef) => {
17
- hostRefs.set(hostRef.$lazyInstance$ = lazyInstance, hostRef);
24
+ lazyInstance.__stencil__getHostRef = () => hostRef;
25
+ hostRef.$lazyInstance$ = lazyInstance;
18
26
  };
19
27
  var registerHost = (hostElement, cmpMeta) => {
20
28
  const hostRef = {
@@ -28,7 +36,8 @@ var registerHost = (hostElement, cmpMeta) => {
28
36
  hostElement["s-p"] = [];
29
37
  hostElement["s-rc"] = [];
30
38
  }
31
- const ref = hostRefs.set(hostElement, hostRef);
39
+ const ref = hostRef;
40
+ hostElement.__stencil__getHostRef = () => ref;
32
41
  return ref;
33
42
  };
34
43
  var isMemberInElement = (elm, memberName) => memberName in elm;
@@ -86,21 +95,24 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
86
95
  /* webpackExclude: /\.system\.entry\.js$/ */
87
96
  /* webpackMode: "lazy" */
88
97
  `./${bundleId}.entry.js${""}`
89
- ).then((importedModule) => {
90
- {
91
- cmpModules.set(bundleId, importedModule);
98
+ ).then(
99
+ (importedModule) => {
100
+ {
101
+ cmpModules.set(bundleId, importedModule);
102
+ }
103
+ return importedModule[exportName];
104
+ },
105
+ (e) => {
106
+ consoleError(e, hostRef.$hostElement$);
92
107
  }
93
- return importedModule[exportName];
94
- }, consoleError);
108
+ );
95
109
  };
96
110
 
97
111
  // src/client/client-style.ts
98
112
  var styles = /* @__PURE__ */ new Map();
99
- var HYDRATED_STYLE_ID = "sty-id";
100
113
  var HYDRATED_CSS = "{visibility:hidden}[hydrated]{visibility:inherit}";
101
114
  var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
102
115
  var win = typeof window !== "undefined" ? window : {};
103
- var doc = win.document || { head: {} };
104
116
  var plt = {
105
117
  $flags$: 0,
106
118
  $resourcesUrl$: "",
@@ -160,11 +172,16 @@ var isComplexType = (o) => {
160
172
  };
161
173
 
162
174
  // src/utils/query-nonce-meta-tag-content.ts
163
- function queryNonceMetaTagContent(doc2) {
175
+ function queryNonceMetaTagContent(doc) {
164
176
  var _a, _b, _c;
165
- return (_c = (_b = (_a = doc2.head) == null ? void 0 : _a.querySelector('meta[name="csp-nonce"]')) == null ? void 0 : _b.getAttribute("content")) != null ? _c : void 0;
177
+ return (_c = (_b = (_a = doc.head) == null ? void 0 : _a.querySelector('meta[name="csp-nonce"]')) == null ? void 0 : _b.getAttribute("content")) != null ? _c : void 0;
166
178
  }
167
179
 
180
+ // src/utils/regular-expression.ts
181
+ var escapeRegExpSpecialCharacters = (text) => {
182
+ return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
183
+ };
184
+
168
185
  // src/utils/result.ts
169
186
  var result_exports = {};
170
187
  __export(result_exports, {
@@ -213,6 +230,28 @@ var unwrapErr = (result) => {
213
230
  throw result.value;
214
231
  }
215
232
  };
233
+ function createShadowRoot(cmpMeta) {
234
+ const shadowRoot = this.attachShadow({ mode: "open" });
235
+ if (supportsConstructableStylesheets) {
236
+ const sheet = new CSSStyleSheet();
237
+ sheet.replaceSync(globalStyles);
238
+ shadowRoot.adoptedStyleSheets.push(sheet);
239
+ }
240
+ }
241
+ var createTime = (fnName, tagName = "") => {
242
+ {
243
+ return () => {
244
+ return;
245
+ };
246
+ }
247
+ };
248
+ var uniqueTime = (key, measureText) => {
249
+ {
250
+ return () => {
251
+ return;
252
+ };
253
+ }
254
+ };
216
255
  var h = (nodeName, vnodeData, ...children) => {
217
256
  let child = null;
218
257
  let key = null;
@@ -277,91 +316,242 @@ var newVNode = (tag, text) => {
277
316
  };
278
317
  var Host = {};
279
318
  var isHost = (node) => node && node.$tag$ === Host;
280
- var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
281
- if (oldValue !== newValue) {
282
- let isProp = isMemberInElement(elm, memberName);
283
- memberName.toLowerCase();
284
- if (memberName === "class") {
285
- const classList = elm.classList;
286
- const oldClasses = parseClassList(oldValue);
287
- let newClasses = parseClassList(newValue);
288
- if (elm["s-si"]) {
289
- newClasses.push(elm["s-si"]);
290
- oldClasses.forEach((c) => {
291
- if (c.startsWith(elm["s-si"])) newClasses.push(c);
292
- });
293
- newClasses = [...new Set(newClasses)];
294
- classList.add(...newClasses);
295
- delete elm["s-si"];
296
- } else {
297
- classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
298
- classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
299
- }
300
- } else if (memberName === "key") ; else if (memberName === "ref") {
301
- if (newValue) {
302
- newValue(elm);
319
+ var createSupportsRuleRe = (selector) => {
320
+ const safeSelector2 = escapeRegExpSpecialCharacters(selector);
321
+ return new RegExp(
322
+ // First capture group: match any context before the selector that's not inside @supports selector()
323
+ // Using negative lookahead to avoid matching inside @supports selector(...) condition
324
+ `(^|[^@]|@(?!supports\\s+selector\\s*\\([^{]*?${safeSelector2}))(${safeSelector2}\\b)`,
325
+ "g"
326
+ );
327
+ };
328
+ createSupportsRuleRe("::slotted");
329
+ createSupportsRuleRe(":host");
330
+ createSupportsRuleRe(":host-context");
331
+ var parsePropertyValue = (propValue, propType, isFormAssociated) => {
332
+ if (propValue != null && !isComplexType(propValue)) {
333
+ if (propType & 4 /* Boolean */) {
334
+ {
335
+ return propValue === "false" ? false : propValue === "" || !!propValue;
303
336
  }
337
+ }
338
+ if (propType & 2 /* Number */) {
339
+ return typeof propValue === "string" ? parseFloat(propValue) : typeof propValue === "number" ? propValue : NaN;
340
+ }
341
+ if (propType & 1 /* String */) {
342
+ return String(propValue);
343
+ }
344
+ return propValue;
345
+ }
346
+ return propValue;
347
+ };
348
+ var getElement = (ref) => getHostRef(ref).$hostElement$ ;
349
+
350
+ // src/runtime/event-emitter.ts
351
+ var createEvent = (ref, name, flags) => {
352
+ const elm = getElement(ref);
353
+ return {
354
+ emit: (detail) => {
355
+ return emitEvent(elm, name, {
356
+ bubbles: true,
357
+ composed: true,
358
+ cancelable: true,
359
+ detail
360
+ });
361
+ }
362
+ };
363
+ };
364
+ var emitEvent = (elm, name, opts) => {
365
+ const ev = plt.ce(name, opts);
366
+ elm.dispatchEvent(ev);
367
+ return ev;
368
+ };
369
+ var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
370
+ var registerStyle = (scopeId2, cssText, allowCS) => {
371
+ let style = styles.get(scopeId2);
372
+ if (supportsConstructableStylesheets && allowCS) {
373
+ style = style || new CSSStyleSheet();
374
+ if (typeof style === "string") {
375
+ style = cssText;
304
376
  } else {
305
- const isComplex = isComplexType(newValue);
306
- if ((isProp || isComplex && newValue !== null) && !isSvg) {
307
- try {
308
- if (!elm.tagName.includes("-")) {
309
- const n = newValue == null ? "" : newValue;
310
- if (memberName === "list") {
311
- isProp = false;
312
- } else if (oldValue == null || elm[memberName] != n) {
313
- if (typeof elm.__lookupSetter__(memberName) === "function") {
314
- elm[memberName] = n;
377
+ style.replaceSync(cssText);
378
+ }
379
+ } else {
380
+ style = cssText;
381
+ }
382
+ styles.set(scopeId2, style);
383
+ };
384
+ var addStyle = (styleContainerNode, cmpMeta, mode) => {
385
+ var _a;
386
+ const scopeId2 = getScopeId(cmpMeta);
387
+ const style = styles.get(scopeId2);
388
+ if (!win.document) {
389
+ return scopeId2;
390
+ }
391
+ styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : win.document;
392
+ if (style) {
393
+ if (typeof style === "string") {
394
+ styleContainerNode = styleContainerNode.head || styleContainerNode;
395
+ let appliedStyles = rootAppliedStyles.get(styleContainerNode);
396
+ let styleElm;
397
+ if (!appliedStyles) {
398
+ rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
399
+ }
400
+ if (!appliedStyles.has(scopeId2)) {
401
+ {
402
+ styleElm = win.document.createElement("style");
403
+ styleElm.innerHTML = style;
404
+ const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
405
+ if (nonce != null) {
406
+ styleElm.setAttribute("nonce", nonce);
407
+ }
408
+ if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
409
+ if (styleContainerNode.nodeName === "HEAD") {
410
+ const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
411
+ const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
412
+ styleContainerNode.insertBefore(
413
+ styleElm,
414
+ (referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
415
+ );
416
+ } else if ("host" in styleContainerNode) {
417
+ if (supportsConstructableStylesheets) {
418
+ const stylesheet = new CSSStyleSheet();
419
+ stylesheet.replaceSync(style);
420
+ styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
315
421
  } else {
316
- elm.setAttribute(memberName, n);
422
+ const existingStyleContainer = styleContainerNode.querySelector("style");
423
+ if (existingStyleContainer) {
424
+ existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
425
+ } else {
426
+ styleContainerNode.prepend(styleElm);
427
+ }
317
428
  }
429
+ } else {
430
+ styleContainerNode.append(styleElm);
318
431
  }
319
- } else {
320
- elm[memberName] = newValue;
321
432
  }
322
- } catch (e) {
433
+ if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
434
+ styleContainerNode.insertBefore(styleElm, null);
435
+ }
436
+ }
437
+ if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
438
+ styleElm.innerHTML += SLOT_FB_CSS;
439
+ }
440
+ if (appliedStyles) {
441
+ appliedStyles.add(scopeId2);
323
442
  }
324
443
  }
325
- if (newValue == null || newValue === false) {
326
- if (newValue !== false || elm.getAttribute(memberName) === "") {
327
- {
328
- elm.removeAttribute(memberName);
444
+ } else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
445
+ styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
446
+ }
447
+ }
448
+ return scopeId2;
449
+ };
450
+ var attachStyles = (hostRef) => {
451
+ const cmpMeta = hostRef.$cmpMeta$;
452
+ const elm = hostRef.$hostElement$;
453
+ const flags = cmpMeta.$flags$;
454
+ const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
455
+ const scopeId2 = addStyle(
456
+ elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
457
+ cmpMeta);
458
+ if (flags & 10 /* needsScopedEncapsulation */) {
459
+ elm["s-sc"] = scopeId2;
460
+ elm.classList.add(scopeId2 + "-h");
461
+ }
462
+ endAttachStyles();
463
+ };
464
+ var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
465
+ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRender) => {
466
+ if (oldValue === newValue) {
467
+ return;
468
+ }
469
+ let isProp = isMemberInElement(elm, memberName);
470
+ memberName.toLowerCase();
471
+ if (memberName === "class") {
472
+ const classList = elm.classList;
473
+ const oldClasses = parseClassList(oldValue);
474
+ let newClasses = parseClassList(newValue);
475
+ {
476
+ classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
477
+ classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
478
+ }
479
+ } else if (memberName === "key") ; else if (memberName === "ref") {
480
+ if (newValue) {
481
+ newValue(elm);
482
+ }
483
+ } else {
484
+ const isComplex = isComplexType(newValue);
485
+ if ((isProp || isComplex && newValue !== null) && true) {
486
+ try {
487
+ if (!elm.tagName.includes("-")) {
488
+ const n = newValue == null ? "" : newValue;
489
+ if (memberName === "list") {
490
+ isProp = false;
491
+ } else if (oldValue == null || elm[memberName] != n) {
492
+ if (typeof elm.__lookupSetter__(memberName) === "function") {
493
+ elm[memberName] = n;
494
+ } else {
495
+ elm.setAttribute(memberName, n);
496
+ }
329
497
  }
498
+ } else if (elm[memberName] !== newValue) {
499
+ elm[memberName] = newValue;
330
500
  }
331
- } else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
332
- newValue = newValue === true ? "" : newValue;
501
+ } catch (e) {
502
+ }
503
+ }
504
+ if (newValue == null || newValue === false) {
505
+ if (newValue !== false || elm.getAttribute(memberName) === "") {
333
506
  {
334
- elm.setAttribute(memberName, newValue);
507
+ elm.removeAttribute(memberName);
335
508
  }
336
509
  }
510
+ } else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex && elm.nodeType === 1 /* ElementNode */) {
511
+ newValue = newValue === true ? "" : newValue;
512
+ {
513
+ elm.setAttribute(memberName, newValue);
514
+ }
337
515
  }
338
516
  }
339
517
  };
340
518
  var parseClassListRegex = /\s/;
341
519
  var parseClassList = (value) => {
342
- if (typeof value === "object" && "baseVal" in value) {
520
+ if (typeof value === "object" && value && "baseVal" in value) {
343
521
  value = value.baseVal;
344
522
  }
345
- if (!value) {
523
+ if (!value || typeof value !== "string") {
346
524
  return [];
347
525
  }
348
526
  return value.split(parseClassListRegex);
349
527
  };
350
528
 
351
529
  // src/runtime/vdom/update-element.ts
352
- var updateElement = (oldVnode, newVnode, isSvgMode2) => {
530
+ var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
353
531
  const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
354
532
  const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || {};
355
533
  const newVnodeAttrs = newVnode.$attrs$ || {};
356
534
  {
357
535
  for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
358
536
  if (!(memberName in newVnodeAttrs)) {
359
- setAccessor(elm, memberName, oldVnodeAttrs[memberName], void 0, isSvgMode2, newVnode.$flags$);
537
+ setAccessor(
538
+ elm,
539
+ memberName,
540
+ oldVnodeAttrs[memberName],
541
+ void 0,
542
+ isSvgMode2,
543
+ newVnode.$flags$);
360
544
  }
361
545
  }
362
546
  }
363
547
  for (const memberName of sortedAttrNames(Object.keys(newVnodeAttrs))) {
364
- setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode2, newVnode.$flags$);
548
+ setAccessor(
549
+ elm,
550
+ memberName,
551
+ oldVnodeAttrs[memberName],
552
+ newVnodeAttrs[memberName],
553
+ isSvgMode2,
554
+ newVnode.$flags$);
365
555
  }
366
556
  };
367
557
  function sortedAttrNames(attrNames) {
@@ -374,7 +564,6 @@ function sortedAttrNames(attrNames) {
374
564
  );
375
565
  }
376
566
  var hostTagName;
377
- var useNativeShadowDom = false;
378
567
  var isSvgMode = false;
379
568
  var createElm = (oldParentVNode, newParentVNode, childIndex) => {
380
569
  const newVNode2 = newParentVNode.$children$[childIndex];
@@ -382,8 +571,13 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
382
571
  let elm;
383
572
  let childNode;
384
573
  {
385
- elm = newVNode2.$elm$ = doc.createElement(
386
- !useNativeShadowDom && BUILD.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
574
+ if (!win.document) {
575
+ throw new Error(
576
+ "You are trying to render a Stencil component in an environment that doesn't support the DOM. Make sure to populate the [`window`](https://developer.mozilla.org/en-US/docs/Web/API/Window/window) object before rendering a component."
577
+ );
578
+ }
579
+ elm = newVNode2.$elm$ = win.document.createElement(
580
+ newVNode2.$tag$
387
581
  );
388
582
  {
389
583
  updateElement(null, newVNode2, isSvgMode);
@@ -530,9 +724,7 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
530
724
  const newChildren = newVNode2.$children$;
531
725
  {
532
726
  {
533
- {
534
- updateElement(oldVNode, newVNode2, isSvgMode);
535
- }
727
+ updateElement(oldVNode, newVNode2, isSvgMode);
536
728
  }
537
729
  if (oldChildren !== null && newChildren !== null) {
538
730
  updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
@@ -553,14 +745,15 @@ var nullifyVNodeRefs = (vNode) => {
553
745
  }
554
746
  };
555
747
  var insertBefore = (parent, newNode, reference) => {
556
- const inserted = parent == null ? void 0 : parent.insertBefore(newNode, reference);
557
- return inserted;
748
+ {
749
+ return parent == null ? void 0 : parent.insertBefore(newNode, reference);
750
+ }
558
751
  };
559
752
  var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
560
753
  const hostElm = hostRef.$hostElement$;
561
- const cmpMeta = hostRef.$cmpMeta$;
562
754
  const oldVNode = hostRef.$vnode$ || newVNode(null, null);
563
- const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
755
+ const isHostElement = isHost(renderFnResults);
756
+ const rootVnode = isHostElement ? renderFnResults : h(null, null, renderFnResults);
564
757
  hostTagName = hostElm.tagName;
565
758
  if (isInitialLoad && rootVnode.$attrs$) {
566
759
  for (const key of Object.keys(rootVnode.$attrs$)) {
@@ -573,154 +766,20 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
573
766
  rootVnode.$flags$ |= 4 /* isHost */;
574
767
  hostRef.$vnode$ = rootVnode;
575
768
  rootVnode.$elm$ = oldVNode.$elm$ = hostElm.shadowRoot || hostElm ;
576
- useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
577
769
  patch(oldVNode, rootVnode, isInitialLoad);
578
770
  };
579
- var createTime = (fnName, tagName = "") => {
580
- {
581
- return () => {
582
- return;
583
- };
584
- }
585
- };
586
- var uniqueTime = (key, measureText) => {
587
- {
588
- return () => {
589
- return;
590
- };
591
- }
592
- };
593
- var parsePropertyValue = (propValue, propType) => {
594
- if (propValue != null && !isComplexType(propValue)) {
595
- if (propType & 4 /* Boolean */) {
596
- return propValue === "false" ? false : propValue === "" || !!propValue;
597
- }
598
- if (propType & 2 /* Number */) {
599
- return parseFloat(propValue);
600
- }
601
- if (propType & 1 /* String */) {
602
- return String(propValue);
603
- }
604
- return propValue;
605
- }
606
- return propValue;
607
- };
608
- var getElement = (ref) => getHostRef(ref).$hostElement$ ;
609
-
610
- // src/runtime/event-emitter.ts
611
- var createEvent = (ref, name, flags) => {
612
- const elm = getElement(ref);
613
- return {
614
- emit: (detail) => {
615
- return emitEvent(elm, name, {
616
- bubbles: !!(flags & 4 /* Bubbles */),
617
- composed: !!(flags & 2 /* Composed */),
618
- cancelable: !!(flags & 1 /* Cancellable */),
619
- detail
620
- });
621
- }
622
- };
623
- };
624
- var emitEvent = (elm, name, opts) => {
625
- const ev = plt.ce(name, opts);
626
- elm.dispatchEvent(ev);
627
- return ev;
628
- };
629
- var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
630
- var registerStyle = (scopeId2, cssText, allowCS) => {
631
- let style = styles.get(scopeId2);
632
- if (supportsConstructableStylesheets && allowCS) {
633
- style = style || new CSSStyleSheet();
634
- if (typeof style === "string") {
635
- style = cssText;
636
- } else {
637
- style.replaceSync(cssText);
638
- }
639
- } else {
640
- style = cssText;
641
- }
642
- styles.set(scopeId2, style);
643
- };
644
- var addStyle = (styleContainerNode, cmpMeta, mode) => {
645
- var _a;
646
- const scopeId2 = getScopeId(cmpMeta);
647
- const style = styles.get(scopeId2);
648
- styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
649
- if (style) {
650
- if (typeof style === "string") {
651
- styleContainerNode = styleContainerNode.head || styleContainerNode;
652
- let appliedStyles = rootAppliedStyles.get(styleContainerNode);
653
- let styleElm;
654
- if (!appliedStyles) {
655
- rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
656
- }
657
- if (!appliedStyles.has(scopeId2)) {
658
- {
659
- styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) || doc.createElement("style");
660
- styleElm.innerHTML = style;
661
- const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(doc);
662
- if (nonce != null) {
663
- styleElm.setAttribute("nonce", nonce);
664
- }
665
- if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
666
- if (styleContainerNode.nodeName === "HEAD") {
667
- const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
668
- const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
669
- styleContainerNode.insertBefore(styleElm, referenceNode2);
670
- } else if ("host" in styleContainerNode) {
671
- if (supportsConstructableStylesheets) {
672
- const stylesheet = new CSSStyleSheet();
673
- stylesheet.replaceSync(style);
674
- styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
675
- } else {
676
- const existingStyleContainer = styleContainerNode.querySelector("style");
677
- if (existingStyleContainer) {
678
- existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
679
- } else {
680
- styleContainerNode.prepend(styleElm);
681
- }
682
- }
683
- } else {
684
- styleContainerNode.append(styleElm);
685
- }
686
- }
687
- if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */ && styleContainerNode.nodeName !== "HEAD") {
688
- styleContainerNode.insertBefore(styleElm, null);
689
- }
690
- }
691
- if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
692
- styleElm.innerHTML += SLOT_FB_CSS;
693
- }
694
- if (appliedStyles) {
695
- appliedStyles.add(scopeId2);
696
- }
697
- }
698
- } else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
699
- styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
700
- }
701
- }
702
- return scopeId2;
703
- };
704
- var attachStyles = (hostRef) => {
705
- const cmpMeta = hostRef.$cmpMeta$;
706
- const elm = hostRef.$hostElement$;
707
- const flags = cmpMeta.$flags$;
708
- const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
709
- const scopeId2 = addStyle(
710
- elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
711
- cmpMeta);
712
- if (flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */) {
713
- elm["s-sc"] = scopeId2;
714
- elm.classList.add(scopeId2 + "-h");
715
- }
716
- endAttachStyles();
717
- };
718
- var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
719
771
 
720
772
  // src/runtime/update-component.ts
721
773
  var attachToAncestor = (hostRef, ancestorComponent) => {
722
774
  if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
723
- ancestorComponent["s-p"].push(new Promise((r) => hostRef.$onRenderResolve$ = r));
775
+ const index = ancestorComponent["s-p"].push(
776
+ new Promise(
777
+ (r) => hostRef.$onRenderResolve$ = () => {
778
+ ancestorComponent["s-p"].splice(index - 1, 1);
779
+ r();
780
+ }
781
+ )
782
+ );
724
783
  }
725
784
  };
726
785
  var scheduleUpdate = (hostRef, isInitialLoad) => {
@@ -746,10 +805,11 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
746
805
  }
747
806
  let maybePromise;
748
807
  if (isInitialLoad) {
749
- {
750
- maybePromise = safeCall(instance, "componentWillLoad");
751
- }
808
+ maybePromise = safeCall(instance, "componentWillLoad", void 0, elm);
809
+ } else {
810
+ maybePromise = safeCall(instance, "componentWillUpdate", void 0, elm);
752
811
  }
812
+ maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender", void 0, elm));
753
813
  endSchedule();
754
814
  return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
755
815
  };
@@ -792,7 +852,7 @@ var callRender = (hostRef, instance, elm, isInitialLoad) => {
792
852
  try {
793
853
  instance = instance.render() ;
794
854
  {
795
- hostRef.$flags$ &= ~16 /* isQueuedForUpdate */;
855
+ hostRef.$flags$ &= -17 /* isQueuedForUpdate */;
796
856
  }
797
857
  {
798
858
  hostRef.$flags$ |= 2 /* hasRendered */;
@@ -815,17 +875,13 @@ var postUpdateComponent = (hostRef) => {
815
875
  const endPostUpdate = createTime("postUpdate", tagName);
816
876
  const instance = hostRef.$lazyInstance$ ;
817
877
  const ancestorComponent = hostRef.$ancestorComponent$;
818
- {
819
- safeCall(instance, "componentDidRender");
820
- }
878
+ safeCall(instance, "componentDidRender", void 0, elm);
821
879
  if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
822
880
  hostRef.$flags$ |= 64 /* hasLoadedComponent */;
823
881
  {
824
882
  addHydratedFlag(elm);
825
883
  }
826
- {
827
- safeCall(instance, "componentDidLoad");
828
- }
884
+ safeCall(instance, "componentDidLoad", void 0, elm);
829
885
  endPostUpdate();
830
886
  {
831
887
  hostRef.$onReadyResolve$(elm);
@@ -834,6 +890,7 @@ var postUpdateComponent = (hostRef) => {
834
890
  }
835
891
  }
836
892
  } else {
893
+ safeCall(instance, "componentDidUpdate", void 0, elm);
837
894
  endPostUpdate();
838
895
  }
839
896
  {
@@ -844,21 +901,18 @@ var postUpdateComponent = (hostRef) => {
844
901
  if (hostRef.$flags$ & 512 /* needsRerender */) {
845
902
  nextTick(() => scheduleUpdate(hostRef, false));
846
903
  }
847
- hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */);
904
+ hostRef.$flags$ &= -517;
848
905
  }
849
906
  };
850
907
  var appDidLoad = (who) => {
851
- {
852
- addHydratedFlag(doc.documentElement);
853
- }
854
908
  nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
855
909
  };
856
- var safeCall = (instance, method, arg) => {
910
+ var safeCall = (instance, method, arg, elm) => {
857
911
  if (instance && instance[method]) {
858
912
  try {
859
913
  return instance[method](arg);
860
914
  } catch (e) {
861
- consoleError(e);
915
+ consoleError(e, elm);
862
916
  }
863
917
  }
864
918
  return void 0;
@@ -874,14 +928,16 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
874
928
  const hostRef = getHostRef(ref);
875
929
  if (!hostRef) {
876
930
  throw new Error(
877
- `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).`
931
+ `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/stenciljs/core/issues/5457).`
878
932
  );
879
933
  }
880
934
  const elm = hostRef.$hostElement$ ;
881
935
  const oldVal = hostRef.$instanceValues$.get(propName);
882
936
  const flags = hostRef.$flags$;
883
937
  const instance = hostRef.$lazyInstance$ ;
884
- newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
938
+ newVal = parsePropertyValue(
939
+ newVal,
940
+ cmpMeta.$members$[propName][0]);
885
941
  const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
886
942
  const didValueChange = newVal !== oldVal && !areBothNaN;
887
943
  if ((!(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {
@@ -900,6 +956,11 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
900
956
  }
901
957
  }
902
958
  if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
959
+ if (instance.componentShouldUpdate) {
960
+ if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
961
+ return;
962
+ }
963
+ }
903
964
  scheduleUpdate(hostRef, false);
904
965
  }
905
966
  }
@@ -917,62 +978,75 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
917
978
  const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
918
979
  members.map(([memberName, [memberFlags]]) => {
919
980
  if ((memberFlags & 31 /* Prop */ || (flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
920
- if ((memberFlags & 2048 /* Getter */) === 0) {
981
+ const { get: origGetter, set: origSetter } = Object.getOwnPropertyDescriptor(prototype, memberName) || {};
982
+ if (origGetter) cmpMeta.$members$[memberName][0] |= 2048 /* Getter */;
983
+ if (origSetter) cmpMeta.$members$[memberName][0] |= 4096 /* Setter */;
984
+ if (flags & 1 /* isElementConstructor */ || !origGetter) {
921
985
  Object.defineProperty(prototype, memberName, {
922
986
  get() {
923
- return getValue(this, memberName);
924
- },
925
- set(newValue) {
926
- setValue(this, memberName, newValue, cmpMeta);
927
- },
928
- configurable: true,
929
- enumerable: true
930
- });
931
- } else if (flags & 1 /* isElementConstructor */ && memberFlags & 2048 /* Getter */) {
932
- {
933
- Object.defineProperty(prototype, memberName, {
934
- get() {
987
+ {
988
+ if ((cmpMeta.$members$[memberName][0] & 2048 /* Getter */) === 0) {
989
+ return getValue(this, memberName);
990
+ }
935
991
  const ref = getHostRef(this);
936
992
  const instance = ref ? ref.$lazyInstance$ : prototype;
937
993
  if (!instance) return;
938
994
  return instance[memberName];
939
- },
940
- configurable: true,
941
- enumerable: true
942
- });
943
- }
944
- if (memberFlags & 4096 /* Setter */) {
945
- const origSetter = Object.getOwnPropertyDescriptor(prototype, memberName).set;
946
- Object.defineProperty(prototype, memberName, {
947
- set(newValue) {
948
- const ref = getHostRef(this);
949
- if (origSetter) {
950
- const currentValue = ref.$hostElement$[memberName];
951
- if (!ref.$instanceValues$.get(memberName) && currentValue) {
952
- ref.$instanceValues$.set(memberName, currentValue);
953
- }
954
- origSetter.apply(this, [parsePropertyValue(newValue, cmpMeta.$members$[memberName][0])]);
955
- setValue(this, memberName, ref.$hostElement$[memberName], cmpMeta);
956
- return;
995
+ }
996
+ },
997
+ configurable: true,
998
+ enumerable: true
999
+ });
1000
+ }
1001
+ Object.defineProperty(prototype, memberName, {
1002
+ set(newValue) {
1003
+ const ref = getHostRef(this);
1004
+ if (origSetter) {
1005
+ const currentValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
1006
+ if (typeof currentValue === "undefined" && ref.$instanceValues$.get(memberName)) {
1007
+ newValue = ref.$instanceValues$.get(memberName);
1008
+ } else if (!ref.$instanceValues$.get(memberName) && currentValue) {
1009
+ ref.$instanceValues$.set(memberName, currentValue);
1010
+ }
1011
+ origSetter.apply(this, [
1012
+ parsePropertyValue(
1013
+ newValue,
1014
+ memberFlags)
1015
+ ]);
1016
+ newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
1017
+ setValue(this, memberName, newValue, cmpMeta);
1018
+ return;
1019
+ }
1020
+ {
1021
+ if ((flags & 1 /* isElementConstructor */) === 0 || (cmpMeta.$members$[memberName][0] & 4096 /* Setter */) === 0) {
1022
+ setValue(this, memberName, newValue, cmpMeta);
1023
+ if (flags & 1 /* isElementConstructor */ && !ref.$lazyInstance$) {
1024
+ ref.$onReadyPromise$.then(() => {
1025
+ if (cmpMeta.$members$[memberName][0] & 4096 /* Setter */ && ref.$lazyInstance$[memberName] !== ref.$instanceValues$.get(memberName)) {
1026
+ ref.$lazyInstance$[memberName] = newValue;
1027
+ }
1028
+ });
957
1029
  }
958
- if (!ref) return;
959
- const setterSetVal = () => {
960
- const currentValue = ref.$lazyInstance$[memberName];
961
- if (!ref.$instanceValues$.get(memberName) && currentValue) {
962
- ref.$instanceValues$.set(memberName, currentValue);
963
- }
964
- ref.$lazyInstance$[memberName] = parsePropertyValue(newValue, cmpMeta.$members$[memberName][0]);
965
- setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
966
- };
967
- if (ref.$lazyInstance$) {
968
- setterSetVal();
969
- } else {
970
- ref.$onReadyPromise$.then(() => setterSetVal());
1030
+ return;
1031
+ }
1032
+ const setterSetVal = () => {
1033
+ const currentValue = ref.$lazyInstance$[memberName];
1034
+ if (!ref.$instanceValues$.get(memberName) && currentValue) {
1035
+ ref.$instanceValues$.set(memberName, currentValue);
971
1036
  }
1037
+ ref.$lazyInstance$[memberName] = parsePropertyValue(
1038
+ newValue,
1039
+ memberFlags);
1040
+ setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
1041
+ };
1042
+ if (ref.$lazyInstance$) {
1043
+ setterSetVal();
1044
+ } else {
1045
+ ref.$onReadyPromise$.then(() => setterSetVal());
972
1046
  }
973
- });
1047
+ }
974
1048
  }
975
- }
1049
+ });
976
1050
  }
977
1051
  });
978
1052
  if ((flags & 1 /* isElementConstructor */)) {
@@ -1002,8 +1076,9 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
1002
1076
  return;
1003
1077
  }
1004
1078
  const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
1005
- if (!propDesc.get || !!propDesc.set) {
1006
- this[propName] = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
1079
+ newValue = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
1080
+ if (newValue !== this[propName] && (!propDesc.get || !!propDesc.set)) {
1081
+ this[propName] = newValue;
1007
1082
  }
1008
1083
  });
1009
1084
  };
@@ -1029,7 +1104,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1029
1104
  hostRef.$flags$ |= 32 /* hasInitializedComponent */;
1030
1105
  const bundleId = cmpMeta.$lazyBundleId$;
1031
1106
  if (bundleId) {
1032
- const CstrImport = loadModule(cmpMeta);
1107
+ const CstrImport = loadModule(cmpMeta, hostRef);
1033
1108
  if (CstrImport && "then" in CstrImport) {
1034
1109
  const endLoad = uniqueTime();
1035
1110
  Cstr = await CstrImport;
@@ -1054,15 +1129,16 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1054
1129
  try {
1055
1130
  new Cstr(hostRef);
1056
1131
  } catch (e) {
1057
- consoleError(e);
1132
+ consoleError(e, elm);
1058
1133
  }
1059
1134
  {
1060
- hostRef.$flags$ &= ~8 /* isConstructingInstance */;
1135
+ hostRef.$flags$ &= -9 /* isConstructingInstance */;
1061
1136
  }
1062
1137
  {
1063
1138
  hostRef.$flags$ |= 128 /* isWatchReady */;
1064
1139
  }
1065
1140
  endNewInstance();
1141
+ fireConnectedCallback(hostRef.$lazyInstance$, elm);
1066
1142
  } else {
1067
1143
  Cstr = elm.constructor;
1068
1144
  const cmpTag = elm.localName;
@@ -1089,7 +1165,10 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1089
1165
  schedule();
1090
1166
  }
1091
1167
  };
1092
- var fireConnectedCallback = (instance) => {
1168
+ var fireConnectedCallback = (instance, elm) => {
1169
+ {
1170
+ safeCall(instance, "connectedCallback", void 0, elm);
1171
+ }
1093
1172
  };
1094
1173
 
1095
1174
  // src/runtime/connected-callback.ts
@@ -1122,25 +1201,27 @@ var connectedCallback = (elm) => {
1122
1201
  initializeComponent(elm, hostRef, cmpMeta);
1123
1202
  }
1124
1203
  } else {
1125
- if (hostRef == null ? void 0 : hostRef.$lazyInstance$) ; else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
1126
- hostRef.$onReadyPromise$.then(() => fireConnectedCallback());
1204
+ if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
1205
+ fireConnectedCallback(hostRef.$lazyInstance$, elm);
1206
+ } else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
1207
+ hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$, elm));
1127
1208
  }
1128
1209
  }
1129
1210
  endConnected();
1130
1211
  }
1131
1212
  };
1132
- var disconnectInstance = (instance) => {
1213
+ var disconnectInstance = (instance, elm) => {
1133
1214
  {
1134
- safeCall(instance, "disconnectedCallback");
1215
+ safeCall(instance, "disconnectedCallback", void 0, elm || instance);
1135
1216
  }
1136
1217
  };
1137
1218
  var disconnectedCallback = async (elm) => {
1138
1219
  if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
1139
1220
  const hostRef = getHostRef(elm);
1140
1221
  if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
1141
- disconnectInstance(hostRef.$lazyInstance$);
1222
+ disconnectInstance(hostRef.$lazyInstance$, elm);
1142
1223
  } else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
1143
- hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$));
1224
+ hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$, elm));
1144
1225
  }
1145
1226
  }
1146
1227
  if (rootAppliedStyles.has(elm)) {
@@ -1154,18 +1235,22 @@ var disconnectedCallback = async (elm) => {
1154
1235
  // src/runtime/bootstrap-lazy.ts
1155
1236
  var bootstrapLazy = (lazyBundles, options = {}) => {
1156
1237
  var _a;
1238
+ if (!win.document) {
1239
+ console.warn("Stencil: No document found. Skipping bootstrapping lazy components.");
1240
+ return;
1241
+ }
1157
1242
  const endBootstrap = createTime();
1158
1243
  const cmpTags = [];
1159
1244
  const exclude = options.exclude || [];
1160
1245
  const customElements2 = win.customElements;
1161
- const head = doc.head;
1246
+ const head = win.document.head;
1162
1247
  const metaCharset = /* @__PURE__ */ head.querySelector("meta[charset]");
1163
- const dataStyles = /* @__PURE__ */ doc.createElement("style");
1248
+ const dataStyles = /* @__PURE__ */ win.document.createElement("style");
1164
1249
  const deferredConnectedCallbacks = [];
1165
1250
  let appLoadFallback;
1166
1251
  let isBootstrapping = true;
1167
1252
  Object.assign(plt, options);
1168
- plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./", doc.baseURI).href;
1253
+ plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./", win.document.baseURI).href;
1169
1254
  let hasSlotRelocation = false;
1170
1255
  lazyBundles.map((lazyBundle) => {
1171
1256
  lazyBundle[1].map((compactMeta) => {
@@ -1196,9 +1281,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
1196
1281
  if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
1197
1282
  {
1198
1283
  if (!self.shadowRoot) {
1199
- {
1200
- self.attachShadow({ mode: "open" });
1201
- }
1284
+ createShadowRoot.call(self, cmpMeta);
1202
1285
  } else {
1203
1286
  if (self.shadowRoot.mode !== "open") {
1204
1287
  throw new Error(
@@ -1229,6 +1312,10 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
1229
1312
  plt.raf(() => {
1230
1313
  var _a3;
1231
1314
  const hostRef = getHostRef(this);
1315
+ const i2 = deferredConnectedCallbacks.findIndex((host) => host === this);
1316
+ if (i2 > -1) {
1317
+ deferredConnectedCallbacks.splice(i2, 1);
1318
+ }
1232
1319
  if (((_a3 = hostRef == null ? void 0 : hostRef.$vnode$) == null ? void 0 : _a3.$elm$) instanceof Node && !hostRef.$vnode$.$elm$.isConnected) {
1233
1320
  delete hostRef.$vnode$.$elm$;
1234
1321
  }
@@ -1257,7 +1344,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
1257
1344
  }
1258
1345
  if (dataStyles.innerHTML.length) {
1259
1346
  dataStyles.setAttribute("data-styles", "");
1260
- const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(doc);
1347
+ const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
1261
1348
  if (nonce != null) {
1262
1349
  dataStyles.setAttribute("nonce", nonce);
1263
1350
  }
@@ -1278,4 +1365,4 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
1278
1365
  // src/runtime/nonce.ts
1279
1366
  var setNonce = (nonce) => plt.$nonce$ = nonce;
1280
1367
 
1281
- export { bootstrapLazy as b, createEvent as c, getElement as g, h, promiseResolve as p, registerInstance as r, setNonce as s };
1368
+ export { getElement as a, bootstrapLazy as b, createEvent as c, globalScripts as g, h, promiseResolve as p, registerInstance as r, setNonce as s };