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