@atmgrupomaggioli/iris-button 0.2.0-dev.7 → 0.2.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 (73) hide show
  1. package/dist/cjs/app-globals-V2Kpy_OQ.js +8 -0
  2. package/dist/cjs/app-globals-V2Kpy_OQ.js.map +1 -0
  3. package/dist/cjs/{index-f786c569.js → index-CHCvKTZA.js} +163 -116
  4. package/dist/cjs/index-CHCvKTZA.js.map +1 -0
  5. package/dist/cjs/index.cjs.js +1 -7
  6. package/dist/cjs/index.cjs.js.map +1 -1
  7. package/dist/cjs/iris-button.cjs.entry.js +18 -20
  8. package/dist/cjs/iris-button.cjs.entry.js.map +1 -1
  9. package/dist/cjs/iris-button.cjs.js +8 -7
  10. package/dist/cjs/iris-button.cjs.js.map +1 -1
  11. package/dist/cjs/iris-button.entry.cjs.js.map +1 -0
  12. package/dist/cjs/loader.cjs.js +4 -5
  13. package/dist/cjs/loader.cjs.js.map +1 -1
  14. package/dist/collection/collection-manifest.json +1 -1
  15. package/dist/collection/components/iris-button/iris-button.css +85 -13
  16. package/dist/collection/components/iris-button/iris-button.js +36 -16
  17. package/dist/collection/components/iris-button/iris-button.js.map +1 -1
  18. package/dist/collection/index.js +1 -10
  19. package/dist/collection/index.js.map +1 -1
  20. package/dist/components/index.js +1098 -4
  21. package/dist/components/index.js.map +1 -1
  22. package/dist/components/iris-button.js +23 -21
  23. package/dist/components/iris-button.js.map +1 -1
  24. package/dist/esm/app-globals-DQuL1Twl.js +6 -0
  25. package/dist/esm/app-globals-DQuL1Twl.js.map +1 -0
  26. package/dist/esm/{index-45a8db1c.js → index-CqbIY27k.js} +161 -94
  27. package/dist/esm/index-CqbIY27k.js.map +1 -0
  28. package/dist/esm/index.js +1 -4
  29. package/dist/esm/index.js.map +1 -1
  30. package/dist/esm/iris-button.entry.js +18 -18
  31. package/dist/esm/iris-button.entry.js.map +1 -1
  32. package/dist/esm/iris-button.js +7 -5
  33. package/dist/esm/iris-button.js.map +1 -1
  34. package/dist/esm/loader.js +5 -4
  35. package/dist/esm/loader.js.map +1 -1
  36. package/dist/iris-button/index.esm.js +1 -1
  37. package/dist/iris-button/index.esm.js.map +1 -1
  38. package/dist/iris-button/iris-button.css +1 -1
  39. package/dist/iris-button/iris-button.entry.esm.js.map +1 -0
  40. package/dist/iris-button/iris-button.esm.js +1 -1
  41. package/dist/iris-button/iris-button.esm.js.map +1 -1
  42. package/dist/iris-button/loader.esm.js.map +1 -0
  43. package/dist/iris-button/p-6aaee13d.entry.js +2 -0
  44. package/dist/iris-button/p-6aaee13d.entry.js.map +1 -0
  45. package/dist/iris-button/p-CqbIY27k.js +3 -0
  46. package/dist/iris-button/p-CqbIY27k.js.map +1 -0
  47. package/dist/iris-button/p-DQuL1Twl.js +2 -0
  48. package/dist/iris-button/p-DQuL1Twl.js.map +1 -0
  49. package/dist/types/components/iris-button/iris-button.d.ts +8 -2
  50. package/dist/types/components.d.ts +8 -0
  51. package/dist/types/index.d.ts +1 -1
  52. package/dist/types/stencil-public-runtime.d.ts +1 -0
  53. package/package.json +9 -5
  54. package/readme.md +0 -1
  55. package/LICENSE +0 -21
  56. package/dist/cjs/app-globals-3a1e7e63.js +0 -7
  57. package/dist/cjs/app-globals-3a1e7e63.js.map +0 -1
  58. package/dist/cjs/index-f786c569.js.map +0 -1
  59. package/dist/collection/utils/utils.js +0 -4
  60. package/dist/collection/utils/utils.js.map +0 -1
  61. package/dist/components/p-913b636c.js +0 -1063
  62. package/dist/components/p-913b636c.js.map +0 -1
  63. package/dist/esm/app-globals-0f993ce5.js +0 -5
  64. package/dist/esm/app-globals-0f993ce5.js.map +0 -1
  65. package/dist/esm/index-45a8db1c.js.map +0 -1
  66. package/dist/iris-button/p-705a656b.js +0 -3
  67. package/dist/iris-button/p-705a656b.js.map +0 -1
  68. package/dist/iris-button/p-cbf16ce7.entry.js +0 -2
  69. package/dist/iris-button/p-cbf16ce7.entry.js.map +0 -1
  70. package/dist/iris-button/p-e1255160.js +0 -2
  71. package/dist/iris-button/p-e1255160.js.map +0 -1
  72. package/dist/types/utils/utils.d.ts +0 -1
  73. package/loader/package.json +0 -11
@@ -1,9 +1,1103 @@
1
- export { getAssetPath, setAssetPath, setNonce, setPlatformOptions } from '@stencil/core/internal/client';
1
+ const NAMESPACE = 'iris-button';
2
+ const BUILD = /* iris-button */ { hydratedSelectorName: "hydrated", lazyLoad: false, updatable: true, watchCallback: false };
2
3
 
3
- function format(first, middle, last) {
4
- return (first || '') + (middle ? ` ${middle}` : '') + (last ? ` ${last}` : '');
4
+ /*
5
+ Stencil Client Platform v4.28.2 | MIT Licensed | https://stenciljs.com
6
+ */
7
+ var __defProp = Object.defineProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+
13
+ // src/utils/constants.ts
14
+ var SVG_NS = "http://www.w3.org/2000/svg";
15
+ var HTML_NS = "http://www.w3.org/1999/xhtml";
16
+
17
+ // src/client/client-host-ref.ts
18
+ var getHostRef = (ref) => {
19
+ if (ref.__stencil__getHostRef) {
20
+ return ref.__stencil__getHostRef();
21
+ }
22
+ return void 0;
23
+ };
24
+ var registerHost = (hostElement, cmpMeta) => {
25
+ const hostRef = {
26
+ $flags$: 0,
27
+ $hostElement$: hostElement,
28
+ $cmpMeta$: cmpMeta,
29
+ $instanceValues$: /* @__PURE__ */ new Map()
30
+ };
31
+ {
32
+ hostRef.$onReadyPromise$ = new Promise((r) => hostRef.$onReadyResolve$ = r);
33
+ hostElement["s-p"] = [];
34
+ hostElement["s-rc"] = [];
35
+ }
36
+ const ref = hostRef;
37
+ hostElement.__stencil__getHostRef = () => ref;
38
+ return ref;
39
+ };
40
+ var isMemberInElement = (elm, memberName) => memberName in elm;
41
+ var consoleError = (e, el) => (0, console.error)(e, el);
42
+
43
+ // src/client/client-style.ts
44
+ var styles = /* @__PURE__ */ new Map();
45
+ var HYDRATED_STYLE_ID = "sty-id";
46
+ var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
47
+ var win = typeof window !== "undefined" ? window : {};
48
+ var H = win.HTMLElement || class {
49
+ };
50
+ var plt = {
51
+ $flags$: 0,
52
+ $resourcesUrl$: "",
53
+ jmp: (h2) => h2(),
54
+ raf: (h2) => requestAnimationFrame(h2),
55
+ ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
56
+ rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
57
+ ce: (eventName, opts) => new CustomEvent(eventName, opts)
58
+ };
59
+ var promiseResolve = (v) => Promise.resolve(v);
60
+ var supportsConstructableStylesheets = /* @__PURE__ */ (() => {
61
+ try {
62
+ new CSSStyleSheet();
63
+ return typeof new CSSStyleSheet().replaceSync === "function";
64
+ } catch (e) {
65
+ }
66
+ return false;
67
+ })() ;
68
+ var queuePending = false;
69
+ var queueDomReads = [];
70
+ var queueDomWrites = [];
71
+ var queueTask = (queue, write) => (cb) => {
72
+ queue.push(cb);
73
+ if (!queuePending) {
74
+ queuePending = true;
75
+ if (write && plt.$flags$ & 4 /* queueSync */) {
76
+ nextTick(flush);
77
+ } else {
78
+ plt.raf(flush);
79
+ }
80
+ }
81
+ };
82
+ var consume = (queue) => {
83
+ for (let i2 = 0; i2 < queue.length; i2++) {
84
+ try {
85
+ queue[i2](performance.now());
86
+ } catch (e) {
87
+ consoleError(e);
88
+ }
89
+ }
90
+ queue.length = 0;
91
+ };
92
+ var flush = () => {
93
+ consume(queueDomReads);
94
+ {
95
+ consume(queueDomWrites);
96
+ if (queuePending = queueDomReads.length > 0) {
97
+ plt.raf(flush);
98
+ }
99
+ }
100
+ };
101
+ var nextTick = (cb) => promiseResolve().then(cb);
102
+ var writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);
103
+
104
+ // src/runtime/asset-path.ts
105
+ var getAssetPath = (path) => {
106
+ const assetUrl = new URL(path, plt.$resourcesUrl$);
107
+ return assetUrl.origin !== win.location.origin ? assetUrl.href : assetUrl.pathname;
108
+ };
109
+ var setAssetPath = (path) => plt.$resourcesUrl$ = path;
110
+ var isComplexType = (o) => {
111
+ o = typeof o;
112
+ return o === "object" || o === "function";
113
+ };
114
+
115
+ // src/utils/query-nonce-meta-tag-content.ts
116
+ function queryNonceMetaTagContent(doc) {
117
+ var _a, _b, _c;
118
+ 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;
5
119
  }
6
120
 
7
- export { format };
121
+ // src/utils/result.ts
122
+ var result_exports = {};
123
+ __export(result_exports, {
124
+ err: () => err,
125
+ map: () => map,
126
+ ok: () => ok,
127
+ unwrap: () => unwrap,
128
+ unwrapErr: () => unwrapErr
129
+ });
130
+ var ok = (value) => ({
131
+ isOk: true,
132
+ isErr: false,
133
+ value
134
+ });
135
+ var err = (value) => ({
136
+ isOk: false,
137
+ isErr: true,
138
+ value
139
+ });
140
+ function map(result, fn) {
141
+ if (result.isOk) {
142
+ const val = fn(result.value);
143
+ if (val instanceof Promise) {
144
+ return val.then((newVal) => ok(newVal));
145
+ } else {
146
+ return ok(val);
147
+ }
148
+ }
149
+ if (result.isErr) {
150
+ const value = result.value;
151
+ return err(value);
152
+ }
153
+ throw "should never get here";
154
+ }
155
+ var unwrap = (result) => {
156
+ if (result.isOk) {
157
+ return result.value;
158
+ } else {
159
+ throw result.value;
160
+ }
161
+ };
162
+ var unwrapErr = (result) => {
163
+ if (result.isErr) {
164
+ return result.value;
165
+ } else {
166
+ throw result.value;
167
+ }
168
+ };
169
+ var createTime = (fnName, tagName = "") => {
170
+ {
171
+ return () => {
172
+ return;
173
+ };
174
+ }
175
+ };
176
+ var h = (nodeName, vnodeData, ...children) => {
177
+ let child = null;
178
+ let simple = false;
179
+ let lastSimple = false;
180
+ const vNodeChildren = [];
181
+ const walk = (c) => {
182
+ for (let i2 = 0; i2 < c.length; i2++) {
183
+ child = c[i2];
184
+ if (Array.isArray(child)) {
185
+ walk(child);
186
+ } else if (child != null && typeof child !== "boolean") {
187
+ if (simple = typeof nodeName !== "function" && !isComplexType(child)) {
188
+ child = String(child);
189
+ }
190
+ if (simple && lastSimple) {
191
+ vNodeChildren[vNodeChildren.length - 1].$text$ += child;
192
+ } else {
193
+ vNodeChildren.push(simple ? newVNode(null, child) : child);
194
+ }
195
+ lastSimple = simple;
196
+ }
197
+ }
198
+ };
199
+ walk(children);
200
+ if (vnodeData) {
201
+ {
202
+ const classData = vnodeData.className || vnodeData.class;
203
+ if (classData) {
204
+ vnodeData.class = typeof classData !== "object" ? classData : Object.keys(classData).filter((k) => classData[k]).join(" ");
205
+ }
206
+ }
207
+ }
208
+ const vnode = newVNode(nodeName, null);
209
+ vnode.$attrs$ = vnodeData;
210
+ if (vNodeChildren.length > 0) {
211
+ vnode.$children$ = vNodeChildren;
212
+ }
213
+ return vnode;
214
+ };
215
+ var newVNode = (tag, text) => {
216
+ const vnode = {
217
+ $flags$: 0,
218
+ $tag$: tag,
219
+ $text$: text,
220
+ $elm$: null,
221
+ $children$: null
222
+ };
223
+ {
224
+ vnode.$attrs$ = null;
225
+ }
226
+ return vnode;
227
+ };
228
+ var Host = {};
229
+ var isHost = (node) => node && node.$tag$ === Host;
230
+ var parsePropertyValue = (propValue, propType) => {
231
+ if (propValue != null && !isComplexType(propValue)) {
232
+ if (propType & 4 /* Boolean */) {
233
+ return propValue === "false" ? false : propValue === "" || !!propValue;
234
+ }
235
+ if (propType & 1 /* String */) {
236
+ return String(propValue);
237
+ }
238
+ return propValue;
239
+ }
240
+ return propValue;
241
+ };
242
+ var getElement = (ref) => ref;
243
+
244
+ // src/runtime/event-emitter.ts
245
+ var createEvent = (ref, name, flags) => {
246
+ const elm = getElement(ref);
247
+ return {
248
+ emit: (detail) => {
249
+ return emitEvent(elm, name, {
250
+ bubbles: !!(flags & 4 /* Bubbles */),
251
+ composed: !!(flags & 2 /* Composed */),
252
+ cancelable: !!(flags & 1 /* Cancellable */),
253
+ detail
254
+ });
255
+ }
256
+ };
257
+ };
258
+ var emitEvent = (elm, name, opts) => {
259
+ const ev = plt.ce(name, opts);
260
+ elm.dispatchEvent(ev);
261
+ return ev;
262
+ };
263
+ var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
264
+ var registerStyle = (scopeId2, cssText, allowCS) => {
265
+ let style = styles.get(scopeId2);
266
+ if (supportsConstructableStylesheets && allowCS) {
267
+ style = style || new CSSStyleSheet();
268
+ if (typeof style === "string") {
269
+ style = cssText;
270
+ } else {
271
+ style.replaceSync(cssText);
272
+ }
273
+ } else {
274
+ style = cssText;
275
+ }
276
+ styles.set(scopeId2, style);
277
+ };
278
+ var addStyle = (styleContainerNode, cmpMeta, mode) => {
279
+ var _a;
280
+ const scopeId2 = getScopeId(cmpMeta);
281
+ const style = styles.get(scopeId2);
282
+ if (!win.document) {
283
+ return scopeId2;
284
+ }
285
+ styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : win.document;
286
+ if (style) {
287
+ if (typeof style === "string") {
288
+ styleContainerNode = styleContainerNode.head || styleContainerNode;
289
+ let appliedStyles = rootAppliedStyles.get(styleContainerNode);
290
+ let styleElm;
291
+ if (!appliedStyles) {
292
+ rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
293
+ }
294
+ if (!appliedStyles.has(scopeId2)) {
295
+ {
296
+ styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) || win.document.createElement("style");
297
+ styleElm.innerHTML = style;
298
+ const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
299
+ if (nonce != null) {
300
+ styleElm.setAttribute("nonce", nonce);
301
+ }
302
+ if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
303
+ if (styleContainerNode.nodeName === "HEAD") {
304
+ const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
305
+ const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
306
+ styleContainerNode.insertBefore(
307
+ styleElm,
308
+ (referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
309
+ );
310
+ } else if ("host" in styleContainerNode) {
311
+ if (supportsConstructableStylesheets) {
312
+ const stylesheet = new CSSStyleSheet();
313
+ stylesheet.replaceSync(style);
314
+ styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
315
+ } else {
316
+ const existingStyleContainer = styleContainerNode.querySelector("style");
317
+ if (existingStyleContainer) {
318
+ existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
319
+ } else {
320
+ styleContainerNode.prepend(styleElm);
321
+ }
322
+ }
323
+ } else {
324
+ styleContainerNode.append(styleElm);
325
+ }
326
+ }
327
+ if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
328
+ styleContainerNode.insertBefore(styleElm, null);
329
+ }
330
+ }
331
+ if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
332
+ styleElm.innerHTML += SLOT_FB_CSS;
333
+ }
334
+ if (appliedStyles) {
335
+ appliedStyles.add(scopeId2);
336
+ }
337
+ }
338
+ } else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
339
+ styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
340
+ }
341
+ }
342
+ return scopeId2;
343
+ };
344
+ var attachStyles = (hostRef) => {
345
+ const cmpMeta = hostRef.$cmpMeta$;
346
+ const elm = hostRef.$hostElement$;
347
+ const flags = cmpMeta.$flags$;
348
+ const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
349
+ const scopeId2 = addStyle(
350
+ elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
351
+ cmpMeta);
352
+ if ((flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */ || flags & 128 /* shadowNeedsScopedCss */)) {
353
+ elm["s-sc"] = scopeId2;
354
+ elm.classList.add(scopeId2 + "-h");
355
+ }
356
+ endAttachStyles();
357
+ };
358
+ var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
359
+ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRender) => {
360
+ if (oldValue === newValue) {
361
+ return;
362
+ }
363
+ let isProp = isMemberInElement(elm, memberName);
364
+ let ln = memberName.toLowerCase();
365
+ if (memberName === "class") {
366
+ const classList = elm.classList;
367
+ const oldClasses = parseClassList(oldValue);
368
+ let newClasses = parseClassList(newValue);
369
+ {
370
+ classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
371
+ classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
372
+ }
373
+ } else if (memberName === "ref") {
374
+ if (newValue) {
375
+ newValue(elm);
376
+ }
377
+ } else if ((!elm.__lookupSetter__(memberName)) && memberName[0] === "o" && memberName[1] === "n") {
378
+ if (memberName[2] === "-") {
379
+ memberName = memberName.slice(3);
380
+ } else if (isMemberInElement(win, ln)) {
381
+ memberName = ln.slice(2);
382
+ } else {
383
+ memberName = ln[2] + memberName.slice(3);
384
+ }
385
+ if (oldValue || newValue) {
386
+ const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
387
+ memberName = memberName.replace(CAPTURE_EVENT_REGEX, "");
388
+ if (oldValue) {
389
+ plt.rel(elm, memberName, oldValue, capture);
390
+ }
391
+ if (newValue) {
392
+ plt.ael(elm, memberName, newValue, capture);
393
+ }
394
+ }
395
+ } else {
396
+ const isComplex = isComplexType(newValue);
397
+ if ((isProp || isComplex && newValue !== null) && !isSvg) {
398
+ try {
399
+ if (!elm.tagName.includes("-")) {
400
+ const n = newValue == null ? "" : newValue;
401
+ if (memberName === "list") {
402
+ isProp = false;
403
+ } else if (oldValue == null || elm[memberName] != n) {
404
+ if (typeof elm.__lookupSetter__(memberName) === "function") {
405
+ elm[memberName] = n;
406
+ } else {
407
+ elm.setAttribute(memberName, n);
408
+ }
409
+ }
410
+ } else if (elm[memberName] !== newValue) {
411
+ elm[memberName] = newValue;
412
+ }
413
+ } catch (e) {
414
+ }
415
+ }
416
+ if (newValue == null || newValue === false) {
417
+ if (newValue !== false || elm.getAttribute(memberName) === "") {
418
+ {
419
+ elm.removeAttribute(memberName);
420
+ }
421
+ }
422
+ } else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex && elm.nodeType === 1 /* ElementNode */) {
423
+ newValue = newValue === true ? "" : newValue;
424
+ {
425
+ elm.setAttribute(memberName, newValue);
426
+ }
427
+ }
428
+ }
429
+ };
430
+ var parseClassListRegex = /\s/;
431
+ var parseClassList = (value) => {
432
+ if (typeof value === "object" && value && "baseVal" in value) {
433
+ value = value.baseVal;
434
+ }
435
+ if (!value || typeof value !== "string") {
436
+ return [];
437
+ }
438
+ return value.split(parseClassListRegex);
439
+ };
440
+ var CAPTURE_EVENT_SUFFIX = "Capture";
441
+ var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
442
+
443
+ // src/runtime/vdom/update-element.ts
444
+ var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
445
+ const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
446
+ const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || {};
447
+ const newVnodeAttrs = newVnode.$attrs$ || {};
448
+ {
449
+ for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
450
+ if (!(memberName in newVnodeAttrs)) {
451
+ setAccessor(
452
+ elm,
453
+ memberName,
454
+ oldVnodeAttrs[memberName],
455
+ void 0,
456
+ isSvgMode2,
457
+ newVnode.$flags$);
458
+ }
459
+ }
460
+ }
461
+ for (const memberName of sortedAttrNames(Object.keys(newVnodeAttrs))) {
462
+ setAccessor(
463
+ elm,
464
+ memberName,
465
+ oldVnodeAttrs[memberName],
466
+ newVnodeAttrs[memberName],
467
+ isSvgMode2,
468
+ newVnode.$flags$);
469
+ }
470
+ };
471
+ function sortedAttrNames(attrNames) {
472
+ return attrNames.includes("ref") ? (
473
+ // we need to sort these to ensure that `'ref'` is the last attr
474
+ [...attrNames.filter((attr) => attr !== "ref"), "ref"]
475
+ ) : (
476
+ // no need to sort, return the original array
477
+ attrNames
478
+ );
479
+ }
480
+ var hostTagName;
481
+ var isSvgMode = false;
482
+ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
483
+ const newVNode2 = newParentVNode.$children$[childIndex];
484
+ let i2 = 0;
485
+ let elm;
486
+ let childNode;
487
+ if (newVNode2.$text$ !== null) {
488
+ elm = newVNode2.$elm$ = win.document.createTextNode(newVNode2.$text$);
489
+ } else {
490
+ if (!isSvgMode) {
491
+ isSvgMode = newVNode2.$tag$ === "svg";
492
+ }
493
+ if (!win.document) {
494
+ throw new Error(
495
+ "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."
496
+ );
497
+ }
498
+ elm = newVNode2.$elm$ = win.document.createElementNS(
499
+ isSvgMode ? SVG_NS : HTML_NS,
500
+ newVNode2.$tag$
501
+ ) ;
502
+ if (isSvgMode && newVNode2.$tag$ === "foreignObject") {
503
+ isSvgMode = false;
504
+ }
505
+ {
506
+ updateElement(null, newVNode2, isSvgMode);
507
+ }
508
+ if (newVNode2.$children$) {
509
+ for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
510
+ childNode = createElm(oldParentVNode, newVNode2, i2);
511
+ if (childNode) {
512
+ elm.appendChild(childNode);
513
+ }
514
+ }
515
+ }
516
+ {
517
+ if (newVNode2.$tag$ === "svg") {
518
+ isSvgMode = false;
519
+ } else if (elm.tagName === "foreignObject") {
520
+ isSvgMode = true;
521
+ }
522
+ }
523
+ }
524
+ elm["s-hn"] = hostTagName;
525
+ return elm;
526
+ };
527
+ var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
528
+ let containerElm = parentElm;
529
+ let childNode;
530
+ if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
531
+ containerElm = containerElm.shadowRoot;
532
+ }
533
+ for (; startIdx <= endIdx; ++startIdx) {
534
+ if (vnodes[startIdx]) {
535
+ childNode = createElm(null, parentVNode, startIdx);
536
+ if (childNode) {
537
+ vnodes[startIdx].$elm$ = childNode;
538
+ insertBefore(containerElm, childNode, before);
539
+ }
540
+ }
541
+ }
542
+ };
543
+ var removeVnodes = (vnodes, startIdx, endIdx) => {
544
+ for (let index = startIdx; index <= endIdx; ++index) {
545
+ const vnode = vnodes[index];
546
+ if (vnode) {
547
+ const elm = vnode.$elm$;
548
+ nullifyVNodeRefs(vnode);
549
+ if (elm) {
550
+ elm.remove();
551
+ }
552
+ }
553
+ }
554
+ };
555
+ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = false) => {
556
+ let oldStartIdx = 0;
557
+ let newStartIdx = 0;
558
+ let oldEndIdx = oldCh.length - 1;
559
+ let oldStartVnode = oldCh[0];
560
+ let oldEndVnode = oldCh[oldEndIdx];
561
+ let newEndIdx = newCh.length - 1;
562
+ let newStartVnode = newCh[0];
563
+ let newEndVnode = newCh[newEndIdx];
564
+ let node;
565
+ while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
566
+ if (oldStartVnode == null) {
567
+ oldStartVnode = oldCh[++oldStartIdx];
568
+ } else if (oldEndVnode == null) {
569
+ oldEndVnode = oldCh[--oldEndIdx];
570
+ } else if (newStartVnode == null) {
571
+ newStartVnode = newCh[++newStartIdx];
572
+ } else if (newEndVnode == null) {
573
+ newEndVnode = newCh[--newEndIdx];
574
+ } else if (isSameVnode(oldStartVnode, newStartVnode, isInitialRender)) {
575
+ patch(oldStartVnode, newStartVnode, isInitialRender);
576
+ oldStartVnode = oldCh[++oldStartIdx];
577
+ newStartVnode = newCh[++newStartIdx];
578
+ } else if (isSameVnode(oldEndVnode, newEndVnode, isInitialRender)) {
579
+ patch(oldEndVnode, newEndVnode, isInitialRender);
580
+ oldEndVnode = oldCh[--oldEndIdx];
581
+ newEndVnode = newCh[--newEndIdx];
582
+ } else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
583
+ patch(oldStartVnode, newEndVnode, isInitialRender);
584
+ insertBefore(parentElm, oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
585
+ oldStartVnode = oldCh[++oldStartIdx];
586
+ newEndVnode = newCh[--newEndIdx];
587
+ } else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
588
+ patch(oldEndVnode, newStartVnode, isInitialRender);
589
+ insertBefore(parentElm, oldEndVnode.$elm$, oldStartVnode.$elm$);
590
+ oldEndVnode = oldCh[--oldEndIdx];
591
+ newStartVnode = newCh[++newStartIdx];
592
+ } else {
593
+ {
594
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx);
595
+ newStartVnode = newCh[++newStartIdx];
596
+ }
597
+ if (node) {
598
+ {
599
+ insertBefore(oldStartVnode.$elm$.parentNode, node, oldStartVnode.$elm$);
600
+ }
601
+ }
602
+ }
603
+ }
604
+ if (oldStartIdx > oldEndIdx) {
605
+ addVnodes(
606
+ parentElm,
607
+ newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$,
608
+ newVNode2,
609
+ newCh,
610
+ newStartIdx,
611
+ newEndIdx
612
+ );
613
+ } else if (newStartIdx > newEndIdx) {
614
+ removeVnodes(oldCh, oldStartIdx, oldEndIdx);
615
+ }
616
+ };
617
+ var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
618
+ if (leftVNode.$tag$ === rightVNode.$tag$) {
619
+ if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) {
620
+ leftVNode.$key$ = rightVNode.$key$;
621
+ }
622
+ return true;
623
+ }
624
+ return false;
625
+ };
626
+ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
627
+ const elm = newVNode2.$elm$ = oldVNode.$elm$;
628
+ const oldChildren = oldVNode.$children$;
629
+ const newChildren = newVNode2.$children$;
630
+ const tag = newVNode2.$tag$;
631
+ const text = newVNode2.$text$;
632
+ if (text === null) {
633
+ {
634
+ isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
635
+ }
636
+ {
637
+ updateElement(oldVNode, newVNode2, isSvgMode);
638
+ }
639
+ if (oldChildren !== null && newChildren !== null) {
640
+ updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
641
+ } else if (newChildren !== null) {
642
+ if (oldVNode.$text$ !== null) {
643
+ elm.textContent = "";
644
+ }
645
+ addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);
646
+ } else if (
647
+ // don't do this on initial render as it can cause non-hydrated content to be removed
648
+ !isInitialRender && BUILD.updatable && oldChildren !== null
649
+ ) {
650
+ removeVnodes(oldChildren, 0, oldChildren.length - 1);
651
+ }
652
+ if (isSvgMode && tag === "svg") {
653
+ isSvgMode = false;
654
+ }
655
+ } else if (oldVNode.$text$ !== text) {
656
+ elm.data = text;
657
+ }
658
+ };
659
+ var nullifyVNodeRefs = (vNode) => {
660
+ {
661
+ vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
662
+ vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
663
+ }
664
+ };
665
+ var insertBefore = (parent, newNode, reference) => {
666
+ {
667
+ return parent == null ? void 0 : parent.insertBefore(newNode, reference);
668
+ }
669
+ };
670
+ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
671
+ const hostElm = hostRef.$hostElement$;
672
+ const oldVNode = hostRef.$vnode$ || newVNode(null, null);
673
+ const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
674
+ hostTagName = hostElm.tagName;
675
+ if (isInitialLoad && rootVnode.$attrs$) {
676
+ for (const key of Object.keys(rootVnode.$attrs$)) {
677
+ if (hostElm.hasAttribute(key) && !["key", "ref", "style", "class"].includes(key)) {
678
+ rootVnode.$attrs$[key] = hostElm[key];
679
+ }
680
+ }
681
+ }
682
+ rootVnode.$tag$ = null;
683
+ rootVnode.$flags$ |= 4 /* isHost */;
684
+ hostRef.$vnode$ = rootVnode;
685
+ rootVnode.$elm$ = oldVNode.$elm$ = hostElm.shadowRoot || hostElm ;
686
+ patch(oldVNode, rootVnode, isInitialLoad);
687
+ };
688
+
689
+ // src/runtime/update-component.ts
690
+ var attachToAncestor = (hostRef, ancestorComponent) => {
691
+ if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
692
+ const index = ancestorComponent["s-p"].push(
693
+ new Promise(
694
+ (r) => hostRef.$onRenderResolve$ = () => {
695
+ ancestorComponent["s-p"].splice(index - 1, 1);
696
+ r();
697
+ }
698
+ )
699
+ );
700
+ }
701
+ };
702
+ var scheduleUpdate = (hostRef, isInitialLoad) => {
703
+ {
704
+ hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
705
+ }
706
+ if (hostRef.$flags$ & 4 /* isWaitingForChildren */) {
707
+ hostRef.$flags$ |= 512 /* needsRerender */;
708
+ return;
709
+ }
710
+ attachToAncestor(hostRef, hostRef.$ancestorComponent$);
711
+ const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
712
+ return writeTask(dispatch) ;
713
+ };
714
+ var dispatchHooks = (hostRef, isInitialLoad) => {
715
+ const elm = hostRef.$hostElement$;
716
+ const endSchedule = createTime("scheduleUpdate", hostRef.$cmpMeta$.$tagName$);
717
+ const instance = elm;
718
+ if (!instance) {
719
+ throw new Error(
720
+ `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`
721
+ );
722
+ }
723
+ let maybePromise;
724
+ if (isInitialLoad) {
725
+ maybePromise = safeCall(instance, "componentWillLoad", void 0, elm);
726
+ } else {
727
+ maybePromise = safeCall(instance, "componentWillUpdate", void 0, elm);
728
+ }
729
+ maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender", void 0, elm));
730
+ endSchedule();
731
+ return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
732
+ };
733
+ var enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then(fn).catch((err2) => {
734
+ console.error(err2);
735
+ fn();
736
+ }) : fn();
737
+ var isPromisey = (maybePromise) => maybePromise instanceof Promise || maybePromise && maybePromise.then && typeof maybePromise.then === "function";
738
+ var updateComponent = async (hostRef, instance, isInitialLoad) => {
739
+ var _a;
740
+ const elm = hostRef.$hostElement$;
741
+ const endUpdate = createTime("update", hostRef.$cmpMeta$.$tagName$);
742
+ const rc = elm["s-rc"];
743
+ if (isInitialLoad) {
744
+ attachStyles(hostRef);
745
+ }
746
+ const endRender = createTime("render", hostRef.$cmpMeta$.$tagName$);
747
+ {
748
+ callRender(hostRef, instance, elm, isInitialLoad);
749
+ }
750
+ if (rc) {
751
+ rc.map((cb) => cb());
752
+ elm["s-rc"] = void 0;
753
+ }
754
+ endRender();
755
+ endUpdate();
756
+ {
757
+ const childrenPromises = (_a = elm["s-p"]) != null ? _a : [];
758
+ const postUpdate = () => postUpdateComponent(hostRef);
759
+ if (childrenPromises.length === 0) {
760
+ postUpdate();
761
+ } else {
762
+ Promise.all(childrenPromises).then(postUpdate);
763
+ hostRef.$flags$ |= 4 /* isWaitingForChildren */;
764
+ childrenPromises.length = 0;
765
+ }
766
+ }
767
+ };
768
+ var callRender = (hostRef, instance, elm, isInitialLoad) => {
769
+ try {
770
+ instance = instance.render() ;
771
+ {
772
+ hostRef.$flags$ &= -17 /* isQueuedForUpdate */;
773
+ }
774
+ {
775
+ hostRef.$flags$ |= 2 /* hasRendered */;
776
+ }
777
+ {
778
+ {
779
+ {
780
+ renderVdom(hostRef, instance, isInitialLoad);
781
+ }
782
+ }
783
+ }
784
+ } catch (e) {
785
+ consoleError(e, hostRef.$hostElement$);
786
+ }
787
+ return null;
788
+ };
789
+ var postUpdateComponent = (hostRef) => {
790
+ const tagName = hostRef.$cmpMeta$.$tagName$;
791
+ const elm = hostRef.$hostElement$;
792
+ const endPostUpdate = createTime("postUpdate", tagName);
793
+ const instance = elm;
794
+ const ancestorComponent = hostRef.$ancestorComponent$;
795
+ safeCall(instance, "componentDidRender", void 0, elm);
796
+ if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
797
+ hostRef.$flags$ |= 64 /* hasLoadedComponent */;
798
+ {
799
+ addHydratedFlag(elm);
800
+ }
801
+ safeCall(instance, "componentDidLoad", void 0, elm);
802
+ endPostUpdate();
803
+ {
804
+ hostRef.$onReadyResolve$(elm);
805
+ if (!ancestorComponent) {
806
+ appDidLoad();
807
+ }
808
+ }
809
+ } else {
810
+ safeCall(instance, "componentDidUpdate", void 0, elm);
811
+ endPostUpdate();
812
+ }
813
+ {
814
+ if (hostRef.$onRenderResolve$) {
815
+ hostRef.$onRenderResolve$();
816
+ hostRef.$onRenderResolve$ = void 0;
817
+ }
818
+ if (hostRef.$flags$ & 512 /* needsRerender */) {
819
+ nextTick(() => scheduleUpdate(hostRef, false));
820
+ }
821
+ hostRef.$flags$ &= -517;
822
+ }
823
+ };
824
+ var appDidLoad = (who) => {
825
+ nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
826
+ };
827
+ var safeCall = (instance, method, arg, elm) => {
828
+ if (instance && instance[method]) {
829
+ try {
830
+ return instance[method](arg);
831
+ } catch (e) {
832
+ consoleError(e, elm);
833
+ }
834
+ }
835
+ return void 0;
836
+ };
837
+ var addHydratedFlag = (elm) => {
838
+ var _a;
839
+ return elm.classList.add((_a = BUILD.hydratedSelectorName) != null ? _a : "hydrated") ;
840
+ };
841
+
842
+ // src/runtime/set-value.ts
843
+ var getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
844
+ var setValue = (ref, propName, newVal, cmpMeta) => {
845
+ const hostRef = getHostRef(ref);
846
+ const elm = ref;
847
+ const oldVal = hostRef.$instanceValues$.get(propName);
848
+ const flags = hostRef.$flags$;
849
+ const instance = elm;
850
+ newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
851
+ const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
852
+ const didValueChange = newVal !== oldVal && !areBothNaN;
853
+ if (didValueChange) {
854
+ hostRef.$instanceValues$.set(propName, newVal);
855
+ {
856
+ if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
857
+ if (instance.componentShouldUpdate) {
858
+ if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
859
+ return;
860
+ }
861
+ }
862
+ scheduleUpdate(hostRef, false);
863
+ }
864
+ }
865
+ }
866
+ };
867
+
868
+ // src/runtime/proxy-component.ts
869
+ var proxyComponent = (Cstr, cmpMeta, flags) => {
870
+ var _a, _b;
871
+ const prototype = Cstr.prototype;
872
+ if (cmpMeta.$members$ || BUILD.watchCallback) {
873
+ const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
874
+ members.map(([memberName, [memberFlags]]) => {
875
+ if ((memberFlags & 31 /* Prop */ || memberFlags & 32 /* State */)) {
876
+ const { get: origGetter, set: origSetter } = Object.getOwnPropertyDescriptor(prototype, memberName) || {};
877
+ if (origGetter) cmpMeta.$members$[memberName][0] |= 2048 /* Getter */;
878
+ if (origSetter) cmpMeta.$members$[memberName][0] |= 4096 /* Setter */;
879
+ {
880
+ Object.defineProperty(prototype, memberName, {
881
+ get() {
882
+ {
883
+ return origGetter ? origGetter.apply(this) : getValue(this, memberName);
884
+ }
885
+ },
886
+ configurable: true,
887
+ enumerable: true
888
+ });
889
+ }
890
+ Object.defineProperty(prototype, memberName, {
891
+ set(newValue) {
892
+ const ref = getHostRef(this);
893
+ if (origSetter) {
894
+ const currentValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
895
+ if (typeof currentValue === "undefined" && ref.$instanceValues$.get(memberName)) {
896
+ newValue = ref.$instanceValues$.get(memberName);
897
+ } else if (!ref.$instanceValues$.get(memberName) && currentValue) {
898
+ ref.$instanceValues$.set(memberName, currentValue);
899
+ }
900
+ origSetter.apply(this, [parsePropertyValue(newValue, memberFlags)]);
901
+ newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
902
+ setValue(this, memberName, newValue, cmpMeta);
903
+ return;
904
+ }
905
+ {
906
+ setValue(this, memberName, newValue, cmpMeta);
907
+ return;
908
+ }
909
+ }
910
+ });
911
+ }
912
+ });
913
+ {
914
+ const attrNameToPropName = /* @__PURE__ */ new Map();
915
+ prototype.attributeChangedCallback = function(attrName, oldValue, newValue) {
916
+ plt.jmp(() => {
917
+ var _a2;
918
+ const propName = attrNameToPropName.get(attrName);
919
+ if (this.hasOwnProperty(propName) && BUILD.lazyLoad) ; else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
920
+ this[propName] == newValue) {
921
+ return;
922
+ } else if (propName == null) {
923
+ const hostRef = getHostRef(this);
924
+ const flags2 = hostRef == null ? void 0 : hostRef.$flags$;
925
+ if (flags2 && !(flags2 & 8 /* isConstructingInstance */) && flags2 & 128 /* isWatchReady */ && newValue !== oldValue) {
926
+ const elm = this;
927
+ const instance = elm;
928
+ const entry = (_a2 = cmpMeta.$watchers$) == null ? void 0 : _a2[attrName];
929
+ entry == null ? void 0 : entry.forEach((callbackName) => {
930
+ if (instance[callbackName] != null) {
931
+ instance[callbackName].call(instance, newValue, oldValue, attrName);
932
+ }
933
+ });
934
+ }
935
+ return;
936
+ }
937
+ const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
938
+ newValue = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
939
+ if (newValue !== this[propName] && (!propDesc.get || !!propDesc.set)) {
940
+ this[propName] = newValue;
941
+ }
942
+ });
943
+ };
944
+ Cstr.observedAttributes = Array.from(
945
+ /* @__PURE__ */ new Set([
946
+ ...Object.keys((_b = cmpMeta.$watchers$) != null ? _b : {}),
947
+ ...members.filter(([_, m]) => m[0] & 15 /* HasAttribute */).map(([propName, m]) => {
948
+ const attrName = m[1] || propName;
949
+ attrNameToPropName.set(attrName, propName);
950
+ return attrName;
951
+ })
952
+ ])
953
+ );
954
+ }
955
+ }
956
+ return Cstr;
957
+ };
958
+
959
+ // src/runtime/initialize-component.ts
960
+ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
961
+ let Cstr;
962
+ if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
963
+ hostRef.$flags$ |= 32 /* hasInitializedComponent */;
964
+ {
965
+ Cstr = elm.constructor;
966
+ const cmpTag = elm.localName;
967
+ customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
968
+ }
969
+ if (Cstr && Cstr.style) {
970
+ let style;
971
+ if (typeof Cstr.style === "string") {
972
+ style = Cstr.style;
973
+ }
974
+ const scopeId2 = getScopeId(cmpMeta);
975
+ if (!styles.has(scopeId2)) {
976
+ const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$);
977
+ registerStyle(scopeId2, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
978
+ endRegisterStyles();
979
+ }
980
+ }
981
+ }
982
+ const ancestorComponent = hostRef.$ancestorComponent$;
983
+ const schedule = () => scheduleUpdate(hostRef, true);
984
+ if (ancestorComponent && ancestorComponent["s-rc"]) {
985
+ ancestorComponent["s-rc"].push(schedule);
986
+ } else {
987
+ schedule();
988
+ }
989
+ };
990
+ var fireConnectedCallback = (instance, elm) => {
991
+ };
992
+
993
+ // src/runtime/connected-callback.ts
994
+ var connectedCallback = (elm) => {
995
+ if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
996
+ const hostRef = getHostRef(elm);
997
+ const cmpMeta = hostRef.$cmpMeta$;
998
+ const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
999
+ if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
1000
+ hostRef.$flags$ |= 1 /* hasConnected */;
1001
+ {
1002
+ let ancestorComponent = elm;
1003
+ while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
1004
+ if (ancestorComponent["s-p"]) {
1005
+ attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
1006
+ break;
1007
+ }
1008
+ }
1009
+ }
1010
+ if (cmpMeta.$members$) {
1011
+ Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
1012
+ if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
1013
+ const value = elm[memberName];
1014
+ delete elm[memberName];
1015
+ elm[memberName] = value;
1016
+ }
1017
+ });
1018
+ }
1019
+ if (BUILD.initializeNextTick) {
1020
+ nextTick(() => initializeComponent(elm, hostRef, cmpMeta));
1021
+ } else {
1022
+ initializeComponent(elm, hostRef, cmpMeta);
1023
+ }
1024
+ } else {
1025
+ if (hostRef == null ? void 0 : hostRef.$lazyInstance$) ; else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
1026
+ hostRef.$onReadyPromise$.then(() => fireConnectedCallback());
1027
+ }
1028
+ }
1029
+ endConnected();
1030
+ }
1031
+ };
1032
+ var disconnectedCallback = async (elm) => {
1033
+ if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
1034
+ getHostRef(elm);
1035
+ }
1036
+ if (rootAppliedStyles.has(elm)) {
1037
+ rootAppliedStyles.delete(elm);
1038
+ }
1039
+ if (elm.shadowRoot && rootAppliedStyles.has(elm.shadowRoot)) {
1040
+ rootAppliedStyles.delete(elm.shadowRoot);
1041
+ }
1042
+ };
1043
+ var proxyCustomElement = (Cstr, compactMeta) => {
1044
+ const cmpMeta = {
1045
+ $flags$: compactMeta[0],
1046
+ $tagName$: compactMeta[1]
1047
+ };
1048
+ {
1049
+ cmpMeta.$members$ = compactMeta[2];
1050
+ }
1051
+ const originalConnectedCallback = Cstr.prototype.connectedCallback;
1052
+ const originalDisconnectedCallback = Cstr.prototype.disconnectedCallback;
1053
+ Object.assign(Cstr.prototype, {
1054
+ __hasHostListenerAttached: false,
1055
+ __registerHost() {
1056
+ registerHost(this, cmpMeta);
1057
+ },
1058
+ connectedCallback() {
1059
+ if (!this.__hasHostListenerAttached) {
1060
+ getHostRef(this);
1061
+ this.__hasHostListenerAttached = true;
1062
+ }
1063
+ connectedCallback(this);
1064
+ if (originalConnectedCallback) {
1065
+ originalConnectedCallback.call(this);
1066
+ }
1067
+ },
1068
+ disconnectedCallback() {
1069
+ disconnectedCallback(this);
1070
+ if (originalDisconnectedCallback) {
1071
+ originalDisconnectedCallback.call(this);
1072
+ }
1073
+ },
1074
+ __attachShadow() {
1075
+ {
1076
+ if (!this.shadowRoot) {
1077
+ {
1078
+ this.attachShadow({ mode: "open" });
1079
+ }
1080
+ } else {
1081
+ if (this.shadowRoot.mode !== "open") {
1082
+ throw new Error(
1083
+ `Unable to re-use existing shadow root for ${cmpMeta.$tagName$}! Mode is set to ${this.shadowRoot.mode} but Stencil only supports open shadow roots.`
1084
+ );
1085
+ }
1086
+ }
1087
+ }
1088
+ }
1089
+ });
1090
+ Cstr.is = cmpMeta.$tagName$;
1091
+ return proxyComponent(Cstr, cmpMeta);
1092
+ };
1093
+
1094
+ // src/runtime/nonce.ts
1095
+ var setNonce = (nonce) => plt.$nonce$ = nonce;
1096
+
1097
+ // src/runtime/platform-options.ts
1098
+ var setPlatformOptions = (opts) => Object.assign(plt, opts);
1099
+
1100
+ export { H, createEvent as c, getAssetPath, h, proxyCustomElement as p, setAssetPath, setNonce, setPlatformOptions };
1101
+ //# sourceMappingURL=index.js.map
8
1102
 
9
1103
  //# sourceMappingURL=index.js.map