@everymatrix/casino-tournament-banner 1.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/dist/casino-tournament-banner/casino-tournament-banner.esm.js +1 -0
  2. package/dist/casino-tournament-banner/index.esm.js +0 -0
  3. package/dist/casino-tournament-banner/p-465ac284.js +1 -0
  4. package/dist/casino-tournament-banner/p-e8e3dadf.entry.js +9 -0
  5. package/dist/cjs/casino-tournament-banner.cjs.js +19 -0
  6. package/dist/cjs/casino-tournament-banner_2.cjs.entry.js +6603 -0
  7. package/dist/cjs/index-743ee8f8.js +1245 -0
  8. package/dist/cjs/index.cjs.js +2 -0
  9. package/dist/cjs/loader.cjs.js +21 -0
  10. package/dist/collection/collection-manifest.json +19 -0
  11. package/dist/collection/components/casino-tournament-banner/casino-tournament-banner.css +120 -0
  12. package/dist/collection/components/casino-tournament-banner/casino-tournament-banner.js +605 -0
  13. package/dist/collection/index.js +1 -0
  14. package/dist/collection/utils/locale.utils.js +315 -0
  15. package/dist/collection/utils/utils.js +13 -0
  16. package/dist/components/casino-tournament-banner.d.ts +11 -0
  17. package/dist/components/casino-tournament-banner.js +6168 -0
  18. package/dist/components/casino-tournament-buttons.js +6 -0
  19. package/dist/components/casino-tournament-buttons2.js +522 -0
  20. package/dist/components/index.d.ts +26 -0
  21. package/dist/components/index.js +1 -0
  22. package/dist/esm/casino-tournament-banner.js +17 -0
  23. package/dist/esm/casino-tournament-banner_2.entry.js +6598 -0
  24. package/dist/esm/index-c76b1548.js +1220 -0
  25. package/dist/esm/index.js +1 -0
  26. package/dist/esm/loader.js +17 -0
  27. package/dist/esm/polyfills/core-js.js +11 -0
  28. package/dist/esm/polyfills/css-shim.js +1 -0
  29. package/dist/esm/polyfills/dom.js +79 -0
  30. package/dist/esm/polyfills/es5-html-element.js +1 -0
  31. package/dist/esm/polyfills/index.js +34 -0
  32. package/dist/esm/polyfills/system.js +6 -0
  33. package/dist/index.cjs.js +1 -0
  34. package/dist/index.js +1 -0
  35. package/dist/stencil.config.js +22 -0
  36. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/casino-tournament-banner/.stencil/packages/casino-tournament-banner/stencil.config.d.ts +2 -0
  37. package/dist/types/components/casino-tournament-banner/casino-tournament-banner.d.ts +41 -0
  38. package/dist/types/components.d.ts +87 -0
  39. package/dist/types/index.d.ts +1 -0
  40. package/dist/types/stencil-public-runtime.d.ts +1565 -0
  41. package/dist/types/utils/locale.utils.d.ts +1 -0
  42. package/dist/types/utils/utils.d.ts +1 -0
  43. package/loader/cdn.js +3 -0
  44. package/loader/index.cjs.js +3 -0
  45. package/loader/index.d.ts +12 -0
  46. package/loader/index.es2017.js +3 -0
  47. package/loader/index.js +4 -0
  48. package/loader/package.json +10 -0
  49. package/package.json +19 -0
@@ -0,0 +1,1220 @@
1
+ const NAMESPACE = 'casino-tournament-banner';
2
+
3
+ let scopeId;
4
+ let hostTagName;
5
+ let isSvgMode = false;
6
+ let queuePending = false;
7
+ const win = typeof window !== 'undefined' ? window : {};
8
+ const doc = win.document || { head: {} };
9
+ const plt = {
10
+ $flags$: 0,
11
+ $resourcesUrl$: '',
12
+ jmp: (h) => h(),
13
+ raf: (h) => requestAnimationFrame(h),
14
+ ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
15
+ rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
16
+ ce: (eventName, opts) => new CustomEvent(eventName, opts),
17
+ };
18
+ const promiseResolve = (v) => Promise.resolve(v);
19
+ const supportsConstructibleStylesheets = /*@__PURE__*/ (() => {
20
+ try {
21
+ new CSSStyleSheet();
22
+ return typeof new CSSStyleSheet().replace === 'function';
23
+ }
24
+ catch (e) { }
25
+ return false;
26
+ })()
27
+ ;
28
+ const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
29
+ if (listeners) {
30
+ listeners.map(([flags, name, method]) => {
31
+ const target = getHostListenerTarget(elm, flags) ;
32
+ const handler = hostListenerProxy(hostRef, method);
33
+ const opts = hostListenerOpts(flags);
34
+ plt.ael(target, name, handler, opts);
35
+ (hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
36
+ });
37
+ }
38
+ };
39
+ const hostListenerProxy = (hostRef, methodName) => (ev) => {
40
+ try {
41
+ {
42
+ if (hostRef.$flags$ & 256 /* isListenReady */) {
43
+ // instance is ready, let's call it's member method for this event
44
+ hostRef.$lazyInstance$[methodName](ev);
45
+ }
46
+ else {
47
+ (hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
48
+ }
49
+ }
50
+ }
51
+ catch (e) {
52
+ consoleError(e);
53
+ }
54
+ };
55
+ const getHostListenerTarget = (elm, flags) => {
56
+ if (flags & 8 /* TargetWindow */)
57
+ return win;
58
+ return elm;
59
+ };
60
+ // prettier-ignore
61
+ const hostListenerOpts = (flags) => (flags & 2 /* Capture */) !== 0;
62
+ const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
63
+ const createTime = (fnName, tagName = '') => {
64
+ {
65
+ return () => {
66
+ return;
67
+ };
68
+ }
69
+ };
70
+ const uniqueTime = (key, measureText) => {
71
+ {
72
+ return () => {
73
+ return;
74
+ };
75
+ }
76
+ };
77
+ const rootAppliedStyles = new WeakMap();
78
+ const registerStyle = (scopeId, cssText, allowCS) => {
79
+ let style = styles.get(scopeId);
80
+ if (supportsConstructibleStylesheets && allowCS) {
81
+ style = (style || new CSSStyleSheet());
82
+ style.replace(cssText);
83
+ }
84
+ else {
85
+ style = cssText;
86
+ }
87
+ styles.set(scopeId, style);
88
+ };
89
+ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
90
+ let scopeId = getScopeId(cmpMeta);
91
+ let style = styles.get(scopeId);
92
+ // if an element is NOT connected then getRootNode() will return the wrong root node
93
+ // so the fallback is to always use the document for the root node in those cases
94
+ styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
95
+ if (style) {
96
+ if (typeof style === 'string') {
97
+ styleContainerNode = styleContainerNode.head || styleContainerNode;
98
+ let appliedStyles = rootAppliedStyles.get(styleContainerNode);
99
+ let styleElm;
100
+ if (!appliedStyles) {
101
+ rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
102
+ }
103
+ if (!appliedStyles.has(scopeId)) {
104
+ {
105
+ {
106
+ styleElm = doc.createElement('style');
107
+ styleElm.innerHTML = style;
108
+ }
109
+ styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
110
+ }
111
+ if (appliedStyles) {
112
+ appliedStyles.add(scopeId);
113
+ }
114
+ }
115
+ }
116
+ else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
117
+ styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
118
+ }
119
+ }
120
+ return scopeId;
121
+ };
122
+ const attachStyles = (hostRef) => {
123
+ const cmpMeta = hostRef.$cmpMeta$;
124
+ const elm = hostRef.$hostElement$;
125
+ const flags = cmpMeta.$flags$;
126
+ const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
127
+ const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
128
+ if (flags & 10 /* needsScopedEncapsulation */) {
129
+ // only required when we're NOT using native shadow dom (slot)
130
+ // or this browser doesn't support native shadow dom
131
+ // and this host element was NOT created with SSR
132
+ // let's pick out the inner content for slot projection
133
+ // create a node to represent where the original
134
+ // content was first placed, which is useful later on
135
+ // DOM WRITE!!
136
+ elm['s-sc'] = scopeId;
137
+ elm.classList.add(scopeId + '-h');
138
+ }
139
+ endAttachStyles();
140
+ };
141
+ const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
142
+ /**
143
+ * Default style mode id
144
+ */
145
+ /**
146
+ * Reusable empty obj/array
147
+ * Don't add values to these!!
148
+ */
149
+ const EMPTY_OBJ = {};
150
+ /**
151
+ * Namespaces
152
+ */
153
+ const SVG_NS = 'http://www.w3.org/2000/svg';
154
+ const HTML_NS = 'http://www.w3.org/1999/xhtml';
155
+ const isDef = (v) => v != null;
156
+ const isComplexType = (o) => {
157
+ // https://jsperf.com/typeof-fn-object/5
158
+ o = typeof o;
159
+ return o === 'object' || o === 'function';
160
+ };
161
+ /**
162
+ * Production h() function based on Preact by
163
+ * Jason Miller (@developit)
164
+ * Licensed under the MIT License
165
+ * https://github.com/developit/preact/blob/master/LICENSE
166
+ *
167
+ * Modified for Stencil's compiler and vdom
168
+ */
169
+ // const stack: any[] = [];
170
+ // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode;
171
+ // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
172
+ const h = (nodeName, vnodeData, ...children) => {
173
+ let child = null;
174
+ let simple = false;
175
+ let lastSimple = false;
176
+ let vNodeChildren = [];
177
+ const walk = (c) => {
178
+ for (let i = 0; i < c.length; i++) {
179
+ child = c[i];
180
+ if (Array.isArray(child)) {
181
+ walk(child);
182
+ }
183
+ else if (child != null && typeof child !== 'boolean') {
184
+ if ((simple = typeof nodeName !== 'function' && !isComplexType(child))) {
185
+ child = String(child);
186
+ }
187
+ if (simple && lastSimple) {
188
+ // If the previous child was simple (string), we merge both
189
+ vNodeChildren[vNodeChildren.length - 1].$text$ += child;
190
+ }
191
+ else {
192
+ // Append a new vNode, if it's text, we create a text vNode
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 =
205
+ typeof classData !== 'object'
206
+ ? classData
207
+ : Object.keys(classData)
208
+ .filter((k) => classData[k])
209
+ .join(' ');
210
+ }
211
+ }
212
+ }
213
+ const vnode = newVNode(nodeName, null);
214
+ vnode.$attrs$ = vnodeData;
215
+ if (vNodeChildren.length > 0) {
216
+ vnode.$children$ = vNodeChildren;
217
+ }
218
+ return vnode;
219
+ };
220
+ const newVNode = (tag, text) => {
221
+ const vnode = {
222
+ $flags$: 0,
223
+ $tag$: tag,
224
+ $text$: text,
225
+ $elm$: null,
226
+ $children$: null,
227
+ };
228
+ {
229
+ vnode.$attrs$ = null;
230
+ }
231
+ return vnode;
232
+ };
233
+ const Host = {};
234
+ const isHost = (node) => node && node.$tag$ === Host;
235
+ /**
236
+ * Production setAccessor() function based on Preact by
237
+ * Jason Miller (@developit)
238
+ * Licensed under the MIT License
239
+ * https://github.com/developit/preact/blob/master/LICENSE
240
+ *
241
+ * Modified for Stencil's compiler and vdom
242
+ */
243
+ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
244
+ if (oldValue !== newValue) {
245
+ let isProp = isMemberInElement(elm, memberName);
246
+ let ln = memberName.toLowerCase();
247
+ if (memberName === 'class') {
248
+ const classList = elm.classList;
249
+ const oldClasses = parseClassList(oldValue);
250
+ const newClasses = parseClassList(newValue);
251
+ classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
252
+ classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
253
+ }
254
+ else if (memberName === 'ref') {
255
+ // minifier will clean this up
256
+ if (newValue) {
257
+ newValue(elm);
258
+ }
259
+ }
260
+ else if ((!isProp ) &&
261
+ memberName[0] === 'o' &&
262
+ memberName[1] === 'n') {
263
+ // Event Handlers
264
+ // so if the member name starts with "on" and the 3rd characters is
265
+ // a capital letter, and it's not already a member on the element,
266
+ // then we're assuming it's an event listener
267
+ if (memberName[2] === '-') {
268
+ // on- prefixed events
269
+ // allows to be explicit about the dom event to listen without any magic
270
+ // under the hood:
271
+ // <my-cmp on-click> // listens for "click"
272
+ // <my-cmp on-Click> // listens for "Click"
273
+ // <my-cmp on-ionChange> // listens for "ionChange"
274
+ // <my-cmp on-EVENTS> // listens for "EVENTS"
275
+ memberName = memberName.slice(3);
276
+ }
277
+ else if (isMemberInElement(win, ln)) {
278
+ // standard event
279
+ // the JSX attribute could have been "onMouseOver" and the
280
+ // member name "onmouseover" is on the window's prototype
281
+ // so let's add the listener "mouseover", which is all lowercased
282
+ memberName = ln.slice(2);
283
+ }
284
+ else {
285
+ // custom event
286
+ // the JSX attribute could have been "onMyCustomEvent"
287
+ // so let's trim off the "on" prefix and lowercase the first character
288
+ // and add the listener "myCustomEvent"
289
+ // except for the first character, we keep the event name case
290
+ memberName = ln[2] + memberName.slice(3);
291
+ }
292
+ if (oldValue) {
293
+ plt.rel(elm, memberName, oldValue, false);
294
+ }
295
+ if (newValue) {
296
+ plt.ael(elm, memberName, newValue, false);
297
+ }
298
+ }
299
+ else {
300
+ // Set property if it exists and it's not a SVG
301
+ const isComplex = isComplexType(newValue);
302
+ if ((isProp || (isComplex && newValue !== null)) && !isSvg) {
303
+ try {
304
+ if (!elm.tagName.includes('-')) {
305
+ let n = newValue == null ? '' : newValue;
306
+ // Workaround for Safari, moving the <input> caret when re-assigning the same valued
307
+ if (memberName === 'list') {
308
+ isProp = false;
309
+ }
310
+ else if (oldValue == null || elm[memberName] != n) {
311
+ elm[memberName] = n;
312
+ }
313
+ }
314
+ else {
315
+ elm[memberName] = newValue;
316
+ }
317
+ }
318
+ catch (e) { }
319
+ }
320
+ if (newValue == null || newValue === false) {
321
+ if (newValue !== false || elm.getAttribute(memberName) === '') {
322
+ {
323
+ elm.removeAttribute(memberName);
324
+ }
325
+ }
326
+ }
327
+ else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
328
+ newValue = newValue === true ? '' : newValue;
329
+ {
330
+ elm.setAttribute(memberName, newValue);
331
+ }
332
+ }
333
+ }
334
+ }
335
+ };
336
+ const parseClassListRegex = /\s/;
337
+ const parseClassList = (value) => (!value ? [] : value.split(parseClassListRegex));
338
+ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
339
+ // if the element passed in is a shadow root, which is a document fragment
340
+ // then we want to be adding attrs/props to the shadow root's "host" element
341
+ // if it's not a shadow root, then we add attrs/props to the same element
342
+ const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host
343
+ ? newVnode.$elm$.host
344
+ : newVnode.$elm$;
345
+ const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
346
+ const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
347
+ {
348
+ // remove attributes no longer present on the vnode by setting them to undefined
349
+ for (memberName in oldVnodeAttrs) {
350
+ if (!(memberName in newVnodeAttrs)) {
351
+ setAccessor(elm, memberName, oldVnodeAttrs[memberName], undefined, isSvgMode, newVnode.$flags$);
352
+ }
353
+ }
354
+ }
355
+ // add new & update changed attributes
356
+ for (memberName in newVnodeAttrs) {
357
+ setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
358
+ }
359
+ };
360
+ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
361
+ // tslint:disable-next-line: prefer-const
362
+ let newVNode = newParentVNode.$children$[childIndex];
363
+ let i = 0;
364
+ let elm;
365
+ let childNode;
366
+ if (newVNode.$text$ !== null) {
367
+ // create text node
368
+ elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
369
+ }
370
+ else {
371
+ if (!isSvgMode) {
372
+ isSvgMode = newVNode.$tag$ === 'svg';
373
+ }
374
+ // create element
375
+ elm = newVNode.$elm$ = (doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, newVNode.$tag$)
376
+ );
377
+ if (isSvgMode && newVNode.$tag$ === 'foreignObject') {
378
+ isSvgMode = false;
379
+ }
380
+ // add css classes, attrs, props, listeners, etc.
381
+ {
382
+ updateElement(null, newVNode, isSvgMode);
383
+ }
384
+ if (isDef(scopeId) && elm['s-si'] !== scopeId) {
385
+ // if there is a scopeId and this is the initial render
386
+ // then let's add the scopeId as a css class
387
+ elm.classList.add((elm['s-si'] = scopeId));
388
+ }
389
+ if (newVNode.$children$) {
390
+ for (i = 0; i < newVNode.$children$.length; ++i) {
391
+ // create the node
392
+ childNode = createElm(oldParentVNode, newVNode, i);
393
+ // return node could have been null
394
+ if (childNode) {
395
+ // append our new node
396
+ elm.appendChild(childNode);
397
+ }
398
+ }
399
+ }
400
+ {
401
+ if (newVNode.$tag$ === 'svg') {
402
+ // Only reset the SVG context when we're exiting <svg> element
403
+ isSvgMode = false;
404
+ }
405
+ else if (elm.tagName === 'foreignObject') {
406
+ // Reenter SVG context when we're exiting <foreignObject> element
407
+ isSvgMode = true;
408
+ }
409
+ }
410
+ }
411
+ return elm;
412
+ };
413
+ const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
414
+ let containerElm = (parentElm);
415
+ let childNode;
416
+ if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
417
+ containerElm = containerElm.shadowRoot;
418
+ }
419
+ for (; startIdx <= endIdx; ++startIdx) {
420
+ if (vnodes[startIdx]) {
421
+ childNode = createElm(null, parentVNode, startIdx);
422
+ if (childNode) {
423
+ vnodes[startIdx].$elm$ = childNode;
424
+ containerElm.insertBefore(childNode, before);
425
+ }
426
+ }
427
+ }
428
+ };
429
+ const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
430
+ for (; startIdx <= endIdx; ++startIdx) {
431
+ if ((vnode = vnodes[startIdx])) {
432
+ elm = vnode.$elm$;
433
+ callNodeRefs(vnode);
434
+ // remove the vnode's element from the dom
435
+ elm.remove();
436
+ }
437
+ }
438
+ };
439
+ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
440
+ let oldStartIdx = 0;
441
+ let newStartIdx = 0;
442
+ let oldEndIdx = oldCh.length - 1;
443
+ let oldStartVnode = oldCh[0];
444
+ let oldEndVnode = oldCh[oldEndIdx];
445
+ let newEndIdx = newCh.length - 1;
446
+ let newStartVnode = newCh[0];
447
+ let newEndVnode = newCh[newEndIdx];
448
+ let node;
449
+ while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
450
+ if (oldStartVnode == null) {
451
+ // Vnode might have been moved left
452
+ oldStartVnode = oldCh[++oldStartIdx];
453
+ }
454
+ else if (oldEndVnode == null) {
455
+ oldEndVnode = oldCh[--oldEndIdx];
456
+ }
457
+ else if (newStartVnode == null) {
458
+ newStartVnode = newCh[++newStartIdx];
459
+ }
460
+ else if (newEndVnode == null) {
461
+ newEndVnode = newCh[--newEndIdx];
462
+ }
463
+ else if (isSameVnode(oldStartVnode, newStartVnode)) {
464
+ patch(oldStartVnode, newStartVnode);
465
+ oldStartVnode = oldCh[++oldStartIdx];
466
+ newStartVnode = newCh[++newStartIdx];
467
+ }
468
+ else if (isSameVnode(oldEndVnode, newEndVnode)) {
469
+ patch(oldEndVnode, newEndVnode);
470
+ oldEndVnode = oldCh[--oldEndIdx];
471
+ newEndVnode = newCh[--newEndIdx];
472
+ }
473
+ else if (isSameVnode(oldStartVnode, newEndVnode)) {
474
+ patch(oldStartVnode, newEndVnode);
475
+ parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
476
+ oldStartVnode = oldCh[++oldStartIdx];
477
+ newEndVnode = newCh[--newEndIdx];
478
+ }
479
+ else if (isSameVnode(oldEndVnode, newStartVnode)) {
480
+ patch(oldEndVnode, newStartVnode);
481
+ parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
482
+ oldEndVnode = oldCh[--oldEndIdx];
483
+ newStartVnode = newCh[++newStartIdx];
484
+ }
485
+ else {
486
+ {
487
+ // new element
488
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx);
489
+ newStartVnode = newCh[++newStartIdx];
490
+ }
491
+ if (node) {
492
+ {
493
+ oldStartVnode.$elm$.parentNode.insertBefore(node, oldStartVnode.$elm$);
494
+ }
495
+ }
496
+ }
497
+ }
498
+ if (oldStartIdx > oldEndIdx) {
499
+ addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
500
+ }
501
+ else if (newStartIdx > newEndIdx) {
502
+ removeVnodes(oldCh, oldStartIdx, oldEndIdx);
503
+ }
504
+ };
505
+ const isSameVnode = (vnode1, vnode2) => {
506
+ // compare if two vnode to see if they're "technically" the same
507
+ // need to have the same element tag, and same key to be the same
508
+ if (vnode1.$tag$ === vnode2.$tag$) {
509
+ return true;
510
+ }
511
+ return false;
512
+ };
513
+ const patch = (oldVNode, newVNode) => {
514
+ const elm = (newVNode.$elm$ = oldVNode.$elm$);
515
+ const oldChildren = oldVNode.$children$;
516
+ const newChildren = newVNode.$children$;
517
+ const tag = newVNode.$tag$;
518
+ const text = newVNode.$text$;
519
+ if (text === null) {
520
+ {
521
+ // test if we're rendering an svg element, or still rendering nodes inside of one
522
+ // only add this to the when the compiler sees we're using an svg somewhere
523
+ isSvgMode = tag === 'svg' ? true : tag === 'foreignObject' ? false : isSvgMode;
524
+ }
525
+ // element node
526
+ {
527
+ {
528
+ // either this is the first render of an element OR it's an update
529
+ // AND we already know it's possible it could have changed
530
+ // this updates the element's css classes, attrs, props, listeners, etc.
531
+ updateElement(oldVNode, newVNode, isSvgMode);
532
+ }
533
+ }
534
+ if (oldChildren !== null && newChildren !== null) {
535
+ // looks like there's child vnodes for both the old and new vnodes
536
+ updateChildren(elm, oldChildren, newVNode, newChildren);
537
+ }
538
+ else if (newChildren !== null) {
539
+ // no old child vnodes, but there are new child vnodes to add
540
+ if (oldVNode.$text$ !== null) {
541
+ // the old vnode was text, so be sure to clear it out
542
+ elm.textContent = '';
543
+ }
544
+ // add the new vnode children
545
+ addVnodes(elm, null, newVNode, newChildren, 0, newChildren.length - 1);
546
+ }
547
+ else if (oldChildren !== null) {
548
+ // no new child vnodes, but there are old child vnodes to remove
549
+ removeVnodes(oldChildren, 0, oldChildren.length - 1);
550
+ }
551
+ if (isSvgMode && tag === 'svg') {
552
+ isSvgMode = false;
553
+ }
554
+ }
555
+ else if (oldVNode.$text$ !== text) {
556
+ // update the text content for the text only vnode
557
+ // and also only if the text is different than before
558
+ elm.data = text;
559
+ }
560
+ };
561
+ const callNodeRefs = (vNode) => {
562
+ {
563
+ vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
564
+ vNode.$children$ && vNode.$children$.map(callNodeRefs);
565
+ }
566
+ };
567
+ const renderVdom = (hostRef, renderFnResults) => {
568
+ const hostElm = hostRef.$hostElement$;
569
+ const oldVNode = hostRef.$vnode$ || newVNode(null, null);
570
+ const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
571
+ hostTagName = hostElm.tagName;
572
+ rootVnode.$tag$ = null;
573
+ rootVnode.$flags$ |= 4 /* isHost */;
574
+ hostRef.$vnode$ = rootVnode;
575
+ rootVnode.$elm$ = oldVNode.$elm$ = (hostElm.shadowRoot || hostElm );
576
+ {
577
+ scopeId = hostElm['s-sc'];
578
+ }
579
+ // synchronous patch
580
+ patch(oldVNode, rootVnode);
581
+ };
582
+ /**
583
+ * Helper function to create & dispatch a custom Event on a provided target
584
+ * @param elm the target of the Event
585
+ * @param name the name to give the custom Event
586
+ * @param opts options for configuring a custom Event
587
+ * @returns the custom Event
588
+ */
589
+ const emitEvent = (elm, name, opts) => {
590
+ const ev = plt.ce(name, opts);
591
+ elm.dispatchEvent(ev);
592
+ return ev;
593
+ };
594
+ const attachToAncestor = (hostRef, ancestorComponent) => {
595
+ if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
596
+ ancestorComponent['s-p'].push(new Promise((r) => (hostRef.$onRenderResolve$ = r)));
597
+ }
598
+ };
599
+ const scheduleUpdate = (hostRef, isInitialLoad) => {
600
+ {
601
+ hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
602
+ }
603
+ if (hostRef.$flags$ & 4 /* isWaitingForChildren */) {
604
+ hostRef.$flags$ |= 512 /* needsRerender */;
605
+ return;
606
+ }
607
+ attachToAncestor(hostRef, hostRef.$ancestorComponent$);
608
+ // there is no ancestor component or the ancestor component
609
+ // has already fired off its lifecycle update then
610
+ // fire off the initial update
611
+ const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
612
+ return writeTask(dispatch) ;
613
+ };
614
+ const dispatchHooks = (hostRef, isInitialLoad) => {
615
+ const endSchedule = createTime('scheduleUpdate', hostRef.$cmpMeta$.$tagName$);
616
+ const instance = hostRef.$lazyInstance$ ;
617
+ let promise;
618
+ if (isInitialLoad) {
619
+ {
620
+ hostRef.$flags$ |= 256 /* isListenReady */;
621
+ if (hostRef.$queuedListeners$) {
622
+ hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
623
+ hostRef.$queuedListeners$ = null;
624
+ }
625
+ }
626
+ {
627
+ promise = safeCall(instance, 'componentWillLoad');
628
+ }
629
+ }
630
+ endSchedule();
631
+ return then(promise, () => updateComponent(hostRef, instance, isInitialLoad));
632
+ };
633
+ const updateComponent = async (hostRef, instance, isInitialLoad) => {
634
+ // updateComponent
635
+ const elm = hostRef.$hostElement$;
636
+ const endUpdate = createTime('update', hostRef.$cmpMeta$.$tagName$);
637
+ const rc = elm['s-rc'];
638
+ if (isInitialLoad) {
639
+ // DOM WRITE!
640
+ attachStyles(hostRef);
641
+ }
642
+ const endRender = createTime('render', hostRef.$cmpMeta$.$tagName$);
643
+ {
644
+ callRender(hostRef, instance);
645
+ }
646
+ if (rc) {
647
+ // ok, so turns out there are some child host elements
648
+ // waiting on this parent element to load
649
+ // let's fire off all update callbacks waiting
650
+ rc.map((cb) => cb());
651
+ elm['s-rc'] = undefined;
652
+ }
653
+ endRender();
654
+ endUpdate();
655
+ {
656
+ const childrenPromises = elm['s-p'];
657
+ const postUpdate = () => postUpdateComponent(hostRef);
658
+ if (childrenPromises.length === 0) {
659
+ postUpdate();
660
+ }
661
+ else {
662
+ Promise.all(childrenPromises).then(postUpdate);
663
+ hostRef.$flags$ |= 4 /* isWaitingForChildren */;
664
+ childrenPromises.length = 0;
665
+ }
666
+ }
667
+ };
668
+ const callRender = (hostRef, instance, elm) => {
669
+ try {
670
+ instance = instance.render() ;
671
+ {
672
+ hostRef.$flags$ &= ~16 /* isQueuedForUpdate */;
673
+ }
674
+ {
675
+ hostRef.$flags$ |= 2 /* hasRendered */;
676
+ }
677
+ {
678
+ {
679
+ // looks like we've got child nodes to render into this host element
680
+ // or we need to update the css class/attrs on the host element
681
+ // DOM WRITE!
682
+ {
683
+ renderVdom(hostRef, instance);
684
+ }
685
+ }
686
+ }
687
+ }
688
+ catch (e) {
689
+ consoleError(e, hostRef.$hostElement$);
690
+ }
691
+ return null;
692
+ };
693
+ const postUpdateComponent = (hostRef) => {
694
+ const tagName = hostRef.$cmpMeta$.$tagName$;
695
+ const elm = hostRef.$hostElement$;
696
+ const endPostUpdate = createTime('postUpdate', tagName);
697
+ const instance = hostRef.$lazyInstance$ ;
698
+ const ancestorComponent = hostRef.$ancestorComponent$;
699
+ {
700
+ safeCall(instance, 'componentDidRender');
701
+ }
702
+ if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
703
+ hostRef.$flags$ |= 64 /* hasLoadedComponent */;
704
+ {
705
+ // DOM WRITE!
706
+ addHydratedFlag(elm);
707
+ }
708
+ endPostUpdate();
709
+ {
710
+ hostRef.$onReadyResolve$(elm);
711
+ if (!ancestorComponent) {
712
+ appDidLoad();
713
+ }
714
+ }
715
+ }
716
+ else {
717
+ endPostUpdate();
718
+ }
719
+ // load events fire from bottom to top
720
+ // the deepest elements load first then bubbles up
721
+ {
722
+ if (hostRef.$onRenderResolve$) {
723
+ hostRef.$onRenderResolve$();
724
+ hostRef.$onRenderResolve$ = undefined;
725
+ }
726
+ if (hostRef.$flags$ & 512 /* needsRerender */) {
727
+ nextTick(() => scheduleUpdate(hostRef, false));
728
+ }
729
+ hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */);
730
+ }
731
+ // ( •_•)
732
+ // ( •_•)>⌐■-■
733
+ // (⌐■_■)
734
+ };
735
+ const appDidLoad = (who) => {
736
+ // on appload
737
+ // we have finish the first big initial render
738
+ {
739
+ addHydratedFlag(doc.documentElement);
740
+ }
741
+ nextTick(() => emitEvent(win, 'appload', { detail: { namespace: NAMESPACE } }));
742
+ };
743
+ const safeCall = (instance, method, arg) => {
744
+ if (instance && instance[method]) {
745
+ try {
746
+ return instance[method](arg);
747
+ }
748
+ catch (e) {
749
+ consoleError(e);
750
+ }
751
+ }
752
+ return undefined;
753
+ };
754
+ const then = (promise, thenFn) => {
755
+ return promise && promise.then ? promise.then(thenFn) : thenFn();
756
+ };
757
+ const addHydratedFlag = (elm) => elm.classList.add('hydrated')
758
+ ;
759
+ /**
760
+ * Parse a new property value for a given property type.
761
+ *
762
+ * While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
763
+ * it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
764
+ * 1. `any`, the type given to `propValue` in the function signature
765
+ * 2. the type stored from `propType`.
766
+ *
767
+ * This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
768
+ *
769
+ * Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
770
+ * a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
771
+ * based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
772
+ * ```tsx
773
+ * <my-cmp prop-val={0}></my-cmp>
774
+ * ```
775
+ *
776
+ * HTML prop values on the other hand, will always a string
777
+ *
778
+ * @param propValue the new value to coerce to some type
779
+ * @param propType the type of the prop, expressed as a binary number
780
+ * @returns the parsed/coerced value
781
+ */
782
+ const parsePropertyValue = (propValue, propType) => {
783
+ // ensure this value is of the correct prop type
784
+ if (propValue != null && !isComplexType(propValue)) {
785
+ if (propType & 4 /* Boolean */) {
786
+ // per the HTML spec, any string value means it is a boolean true value
787
+ // but we'll cheat here and say that the string "false" is the boolean false
788
+ return propValue === 'false' ? false : propValue === '' || !!propValue;
789
+ }
790
+ if (propType & 1 /* String */) {
791
+ // could have been passed as a number or boolean
792
+ // but we still want it as a string
793
+ return String(propValue);
794
+ }
795
+ // redundant return here for better minification
796
+ return propValue;
797
+ }
798
+ // not sure exactly what type we want
799
+ // so no need to change to a different type
800
+ return propValue;
801
+ };
802
+ const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
803
+ const setValue = (ref, propName, newVal, cmpMeta) => {
804
+ // check our new property value against our internal value
805
+ const hostRef = getHostRef(ref);
806
+ const oldVal = hostRef.$instanceValues$.get(propName);
807
+ const flags = hostRef.$flags$;
808
+ const instance = hostRef.$lazyInstance$ ;
809
+ newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
810
+ // explicitly check for NaN on both sides, as `NaN === NaN` is always false
811
+ const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
812
+ const didValueChange = newVal !== oldVal && !areBothNaN;
813
+ if ((!(flags & 8 /* isConstructingInstance */) || oldVal === undefined) && didValueChange) {
814
+ // gadzooks! the property's value has changed!!
815
+ // set our new value!
816
+ hostRef.$instanceValues$.set(propName, newVal);
817
+ if (instance) {
818
+ if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
819
+ // looks like this value actually changed, so we've got work to do!
820
+ // but only if we've already rendered, otherwise just chill out
821
+ // queue that we need to do an update, but don't worry about queuing
822
+ // up millions cuz this function ensures it only runs once
823
+ scheduleUpdate(hostRef, false);
824
+ }
825
+ }
826
+ }
827
+ };
828
+ const proxyComponent = (Cstr, cmpMeta, flags) => {
829
+ if (cmpMeta.$members$) {
830
+ // It's better to have a const than two Object.entries()
831
+ const members = Object.entries(cmpMeta.$members$);
832
+ const prototype = Cstr.prototype;
833
+ members.map(([memberName, [memberFlags]]) => {
834
+ if ((memberFlags & 31 /* Prop */ ||
835
+ ((flags & 2 /* proxyState */) && memberFlags & 32 /* State */))) {
836
+ // proxyComponent - prop
837
+ Object.defineProperty(prototype, memberName, {
838
+ get() {
839
+ // proxyComponent, get value
840
+ return getValue(this, memberName);
841
+ },
842
+ set(newValue) {
843
+ // proxyComponent, set value
844
+ setValue(this, memberName, newValue, cmpMeta);
845
+ },
846
+ configurable: true,
847
+ enumerable: true,
848
+ });
849
+ }
850
+ });
851
+ if ((flags & 1 /* isElementConstructor */)) {
852
+ const attrNameToPropName = new Map();
853
+ prototype.attributeChangedCallback = function (attrName, _oldValue, newValue) {
854
+ plt.jmp(() => {
855
+ const propName = attrNameToPropName.get(attrName);
856
+ // In a web component lifecycle the attributeChangedCallback runs prior to connectedCallback
857
+ // in the case where an attribute was set inline.
858
+ // ```html
859
+ // <my-component some-attribute="some-value"></my-component>
860
+ // ```
861
+ //
862
+ // There is an edge case where a developer sets the attribute inline on a custom element and then
863
+ // programmatically changes it before it has been upgraded as shown below:
864
+ //
865
+ // ```html
866
+ // <!-- this component has _not_ been upgraded yet -->
867
+ // <my-component id="test" some-attribute="some-value"></my-component>
868
+ // <script>
869
+ // // grab non-upgraded component
870
+ // el = document.querySelector("#test");
871
+ // el.someAttribute = "another-value";
872
+ // // upgrade component
873
+ // customElements.define('my-component', MyComponent);
874
+ // </script>
875
+ // ```
876
+ // In this case if we do not unshadow here and use the value of the shadowing property, attributeChangedCallback
877
+ // will be called with `newValue = "some-value"` and will set the shadowed property (this.someAttribute = "another-value")
878
+ // to the value that was set inline i.e. "some-value" from above example. When
879
+ // the connectedCallback attempts to unshadow it will use "some-value" as the initial value rather than "another-value"
880
+ //
881
+ // The case where the attribute was NOT set inline but was not set programmatically shall be handled/unshadowed
882
+ // by connectedCallback as this attributeChangedCallback will not fire.
883
+ //
884
+ // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
885
+ //
886
+ // TODO(STENCIL-16) we should think about whether or not we actually want to be reflecting the attributes to
887
+ // properties here given that this goes against best practices outlined here
888
+ // https://developers.google.com/web/fundamentals/web-components/best-practices#avoid-reentrancy
889
+ if (this.hasOwnProperty(propName)) {
890
+ newValue = this[propName];
891
+ delete this[propName];
892
+ }
893
+ else if (prototype.hasOwnProperty(propName) &&
894
+ typeof this[propName] === 'number' &&
895
+ this[propName] == newValue) {
896
+ // if the propName exists on the prototype of `Cstr`, this update may be a result of Stencil using native
897
+ // APIs to reflect props as attributes. Calls to `setAttribute(someElement, propName)` will result in
898
+ // `propName` to be converted to a `DOMString`, which may not be what we want for other primitive props.
899
+ return;
900
+ }
901
+ this[propName] = newValue === null && typeof this[propName] === 'boolean' ? false : newValue;
902
+ });
903
+ };
904
+ // create an array of attributes to observe
905
+ // and also create a map of html attribute name to js property name
906
+ Cstr.observedAttributes = members
907
+ .filter(([_, m]) => m[0] & 15 /* HasAttribute */) // filter to only keep props that should match attributes
908
+ .map(([propName, m]) => {
909
+ const attrName = m[1] || propName;
910
+ attrNameToPropName.set(attrName, propName);
911
+ return attrName;
912
+ });
913
+ }
914
+ }
915
+ return Cstr;
916
+ };
917
+ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
918
+ // initializeComponent
919
+ if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
920
+ {
921
+ // we haven't initialized this element yet
922
+ hostRef.$flags$ |= 32 /* hasInitializedComponent */;
923
+ // lazy loaded components
924
+ // request the component's implementation to be
925
+ // wired up with the host element
926
+ Cstr = loadModule(cmpMeta);
927
+ if (Cstr.then) {
928
+ // Await creates a micro-task avoid if possible
929
+ const endLoad = uniqueTime();
930
+ Cstr = await Cstr;
931
+ endLoad();
932
+ }
933
+ if (!Cstr.isProxied) {
934
+ proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
935
+ Cstr.isProxied = true;
936
+ }
937
+ const endNewInstance = createTime('createInstance', cmpMeta.$tagName$);
938
+ // ok, time to construct the instance
939
+ // but let's keep track of when we start and stop
940
+ // so that the getters/setters don't incorrectly step on data
941
+ {
942
+ hostRef.$flags$ |= 8 /* isConstructingInstance */;
943
+ }
944
+ // construct the lazy-loaded component implementation
945
+ // passing the hostRef is very important during
946
+ // construction in order to directly wire together the
947
+ // host element and the lazy-loaded instance
948
+ try {
949
+ new Cstr(hostRef);
950
+ }
951
+ catch (e) {
952
+ consoleError(e);
953
+ }
954
+ {
955
+ hostRef.$flags$ &= ~8 /* isConstructingInstance */;
956
+ }
957
+ endNewInstance();
958
+ }
959
+ if (Cstr.style) {
960
+ // this component has styles but we haven't registered them yet
961
+ let style = Cstr.style;
962
+ const scopeId = getScopeId(cmpMeta);
963
+ if (!styles.has(scopeId)) {
964
+ const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
965
+ registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
966
+ endRegisterStyles();
967
+ }
968
+ }
969
+ }
970
+ // we've successfully created a lazy instance
971
+ const ancestorComponent = hostRef.$ancestorComponent$;
972
+ const schedule = () => scheduleUpdate(hostRef, true);
973
+ if (ancestorComponent && ancestorComponent['s-rc']) {
974
+ // this is the initial load and this component it has an ancestor component
975
+ // but the ancestor component has NOT fired its will update lifecycle yet
976
+ // so let's just cool our jets and wait for the ancestor to continue first
977
+ // this will get fired off when the ancestor component
978
+ // finally gets around to rendering its lazy self
979
+ // fire off the initial update
980
+ ancestorComponent['s-rc'].push(schedule);
981
+ }
982
+ else {
983
+ schedule();
984
+ }
985
+ };
986
+ const connectedCallback = (elm) => {
987
+ if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
988
+ const hostRef = getHostRef(elm);
989
+ const cmpMeta = hostRef.$cmpMeta$;
990
+ const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
991
+ if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
992
+ // first time this component has connected
993
+ hostRef.$flags$ |= 1 /* hasConnected */;
994
+ {
995
+ // find the first ancestor component (if there is one) and register
996
+ // this component as one of the actively loading child components for its ancestor
997
+ let ancestorComponent = elm;
998
+ while ((ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host)) {
999
+ // climb up the ancestors looking for the first
1000
+ // component that hasn't finished its lifecycle update yet
1001
+ if (ancestorComponent['s-p']) {
1002
+ // we found this components first ancestor component
1003
+ // keep a reference to this component's ancestor component
1004
+ attachToAncestor(hostRef, (hostRef.$ancestorComponent$ = ancestorComponent));
1005
+ break;
1006
+ }
1007
+ }
1008
+ }
1009
+ // Lazy properties
1010
+ // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
1011
+ if (cmpMeta.$members$) {
1012
+ Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
1013
+ if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
1014
+ const value = elm[memberName];
1015
+ delete elm[memberName];
1016
+ elm[memberName] = value;
1017
+ }
1018
+ });
1019
+ }
1020
+ {
1021
+ initializeComponent(elm, hostRef, cmpMeta);
1022
+ }
1023
+ }
1024
+ else {
1025
+ // not the first time this has connected
1026
+ // reattach any event listeners to the host
1027
+ // since they would have been removed when disconnected
1028
+ addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
1029
+ }
1030
+ endConnected();
1031
+ }
1032
+ };
1033
+ const disconnectedCallback = (elm) => {
1034
+ if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
1035
+ const hostRef = getHostRef(elm);
1036
+ {
1037
+ if (hostRef.$rmListeners$) {
1038
+ hostRef.$rmListeners$.map((rmListener) => rmListener());
1039
+ hostRef.$rmListeners$ = undefined;
1040
+ }
1041
+ }
1042
+ }
1043
+ };
1044
+ const bootstrapLazy = (lazyBundles, options = {}) => {
1045
+ const endBootstrap = createTime();
1046
+ const cmpTags = [];
1047
+ const exclude = options.exclude || [];
1048
+ const customElements = win.customElements;
1049
+ const head = doc.head;
1050
+ const metaCharset = /*@__PURE__*/ head.querySelector('meta[charset]');
1051
+ const visibilityStyle = /*@__PURE__*/ doc.createElement('style');
1052
+ const deferredConnectedCallbacks = [];
1053
+ let appLoadFallback;
1054
+ let isBootstrapping = true;
1055
+ Object.assign(plt, options);
1056
+ plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
1057
+ lazyBundles.map((lazyBundle) => {
1058
+ lazyBundle[1].map((compactMeta) => {
1059
+ const cmpMeta = {
1060
+ $flags$: compactMeta[0],
1061
+ $tagName$: compactMeta[1],
1062
+ $members$: compactMeta[2],
1063
+ $listeners$: compactMeta[3],
1064
+ };
1065
+ {
1066
+ cmpMeta.$members$ = compactMeta[2];
1067
+ }
1068
+ {
1069
+ cmpMeta.$listeners$ = compactMeta[3];
1070
+ }
1071
+ const tagName = cmpMeta.$tagName$;
1072
+ const HostElement = class extends HTMLElement {
1073
+ // StencilLazyHost
1074
+ constructor(self) {
1075
+ // @ts-ignore
1076
+ super(self);
1077
+ self = this;
1078
+ registerHost(self, cmpMeta);
1079
+ if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
1080
+ // this component is using shadow dom
1081
+ // and this browser supports shadow dom
1082
+ // add the read-only property "shadowRoot" to the host element
1083
+ // adding the shadow root build conditionals to minimize runtime
1084
+ {
1085
+ {
1086
+ self.attachShadow({ mode: 'open' });
1087
+ }
1088
+ }
1089
+ }
1090
+ }
1091
+ connectedCallback() {
1092
+ if (appLoadFallback) {
1093
+ clearTimeout(appLoadFallback);
1094
+ appLoadFallback = null;
1095
+ }
1096
+ if (isBootstrapping) {
1097
+ // connectedCallback will be processed once all components have been registered
1098
+ deferredConnectedCallbacks.push(this);
1099
+ }
1100
+ else {
1101
+ plt.jmp(() => connectedCallback(this));
1102
+ }
1103
+ }
1104
+ disconnectedCallback() {
1105
+ plt.jmp(() => disconnectedCallback(this));
1106
+ }
1107
+ componentOnReady() {
1108
+ return getHostRef(this).$onReadyPromise$;
1109
+ }
1110
+ };
1111
+ cmpMeta.$lazyBundleId$ = lazyBundle[0];
1112
+ if (!exclude.includes(tagName) && !customElements.get(tagName)) {
1113
+ cmpTags.push(tagName);
1114
+ customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */));
1115
+ }
1116
+ });
1117
+ });
1118
+ {
1119
+ visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;
1120
+ visibilityStyle.setAttribute('data-styles', '');
1121
+ head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild);
1122
+ }
1123
+ // Process deferred connectedCallbacks now all components have been registered
1124
+ isBootstrapping = false;
1125
+ if (deferredConnectedCallbacks.length) {
1126
+ deferredConnectedCallbacks.map((host) => host.connectedCallback());
1127
+ }
1128
+ else {
1129
+ {
1130
+ plt.jmp(() => (appLoadFallback = setTimeout(appDidLoad, 30)));
1131
+ }
1132
+ }
1133
+ // Fallback appLoad event
1134
+ endBootstrap();
1135
+ };
1136
+ const hostRefs = new WeakMap();
1137
+ const getHostRef = (ref) => hostRefs.get(ref);
1138
+ const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
1139
+ const registerHost = (elm, cmpMeta) => {
1140
+ const hostRef = {
1141
+ $flags$: 0,
1142
+ $hostElement$: elm,
1143
+ $cmpMeta$: cmpMeta,
1144
+ $instanceValues$: new Map(),
1145
+ };
1146
+ {
1147
+ hostRef.$onReadyPromise$ = new Promise((r) => (hostRef.$onReadyResolve$ = r));
1148
+ elm['s-p'] = [];
1149
+ elm['s-rc'] = [];
1150
+ }
1151
+ addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
1152
+ return hostRefs.set(elm, hostRef);
1153
+ };
1154
+ const isMemberInElement = (elm, memberName) => memberName in elm;
1155
+ const consoleError = (e, el) => (0, console.error)(e, el);
1156
+ const cmpModules = /*@__PURE__*/ new Map();
1157
+ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
1158
+ // loadModuleImport
1159
+ const exportName = cmpMeta.$tagName$.replace(/-/g, '_');
1160
+ const bundleId = cmpMeta.$lazyBundleId$;
1161
+ const module = cmpModules.get(bundleId) ;
1162
+ if (module) {
1163
+ return module[exportName];
1164
+ }
1165
+ return import(
1166
+ /* webpackInclude: /\.entry\.js$/ */
1167
+ /* webpackExclude: /\.system\.entry\.js$/ */
1168
+ /* webpackMode: "lazy" */
1169
+ `./${bundleId}.entry.js${''}`).then((importedModule) => {
1170
+ {
1171
+ cmpModules.set(bundleId, importedModule);
1172
+ }
1173
+ return importedModule[exportName];
1174
+ }, consoleError);
1175
+ };
1176
+ const styles = new Map();
1177
+ const queueDomReads = [];
1178
+ const queueDomWrites = [];
1179
+ const queueTask = (queue, write) => (cb) => {
1180
+ queue.push(cb);
1181
+ if (!queuePending) {
1182
+ queuePending = true;
1183
+ if (write && plt.$flags$ & 4 /* queueSync */) {
1184
+ nextTick(flush);
1185
+ }
1186
+ else {
1187
+ plt.raf(flush);
1188
+ }
1189
+ }
1190
+ };
1191
+ const consume = (queue) => {
1192
+ for (let i = 0; i < queue.length; i++) {
1193
+ try {
1194
+ queue[i](performance.now());
1195
+ }
1196
+ catch (e) {
1197
+ consoleError(e);
1198
+ }
1199
+ }
1200
+ queue.length = 0;
1201
+ };
1202
+ const flush = () => {
1203
+ // always force a bunch of medium callbacks to run, but still have
1204
+ // a throttle on how many can run in a certain time
1205
+ // DOM READS!!!
1206
+ consume(queueDomReads);
1207
+ // DOM WRITES!!!
1208
+ {
1209
+ consume(queueDomWrites);
1210
+ if ((queuePending = queueDomReads.length > 0)) {
1211
+ // still more to do yet, but we've run out of time
1212
+ // let's let this thing cool off and try again in the next tick
1213
+ plt.raf(flush);
1214
+ }
1215
+ }
1216
+ };
1217
+ const nextTick = /*@__PURE__*/ (cb) => promiseResolve().then(cb);
1218
+ const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
1219
+
1220
+ export { bootstrapLazy as b, h, promiseResolve as p, registerInstance as r };