@everymatrix/lottery-game-page 0.0.6 → 0.0.7

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