@everymatrix/lottery-game-details 0.0.3

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 (45) hide show
  1. package/dist/cjs/index-94a620d7.js +763 -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-details.cjs.entry.js +21 -0
  5. package/dist/cjs/lottery-game-details.cjs.js +19 -0
  6. package/dist/collection/collection-manifest.json +12 -0
  7. package/dist/collection/components/lottery-game-details/lottery-game-details.css +3 -0
  8. package/dist/collection/components/lottery-game-details/lottery-game-details.js +19 -0
  9. package/dist/collection/index.js +1 -0
  10. package/dist/collection/utils/utils.js +3 -0
  11. package/dist/components/index.d.ts +22 -0
  12. package/dist/components/index.js +2 -0
  13. package/dist/components/lottery-game-details.d.ts +11 -0
  14. package/dist/components/lottery-game-details.js +35 -0
  15. package/dist/esm/index-215cc33d.js +738 -0
  16. package/dist/esm/index.js +1 -0
  17. package/dist/esm/loader.js +17 -0
  18. package/dist/esm/lottery-game-details.entry.js +17 -0
  19. package/dist/esm/lottery-game-details.js +17 -0
  20. package/dist/esm/polyfills/core-js.js +11 -0
  21. package/dist/esm/polyfills/css-shim.js +1 -0
  22. package/dist/esm/polyfills/dom.js +79 -0
  23. package/dist/esm/polyfills/es5-html-element.js +1 -0
  24. package/dist/esm/polyfills/index.js +34 -0
  25. package/dist/esm/polyfills/system.js +6 -0
  26. package/dist/index.cjs.js +1 -0
  27. package/dist/index.js +1 -0
  28. package/dist/lottery-game-details/index.esm.js +0 -0
  29. package/dist/lottery-game-details/lottery-game-details.esm.js +1 -0
  30. package/dist/lottery-game-details/p-3c694375.js +2 -0
  31. package/dist/lottery-game-details/p-9a006ef9.entry.js +1 -0
  32. package/dist/stencil.config.js +22 -0
  33. package/dist/types/Users/user/workspace/everymatrix/widgets-stencil/packages/lottery-game-details/.stencil/packages/lottery-game-details/stencil.config.d.ts +2 -0
  34. package/dist/types/components/lottery-game-details/lottery-game-details.d.ts +5 -0
  35. package/dist/types/components.d.ts +37 -0
  36. package/dist/types/index.d.ts +1 -0
  37. package/dist/types/stencil-public-runtime.d.ts +1565 -0
  38. package/dist/types/utils/utils.d.ts +1 -0
  39. package/loader/cdn.js +3 -0
  40. package/loader/index.cjs.js +3 -0
  41. package/loader/index.d.ts +12 -0
  42. package/loader/index.es2017.js +3 -0
  43. package/loader/index.js +4 -0
  44. package/loader/package.json +10 -0
  45. package/package.json +19 -0
@@ -0,0 +1,738 @@
1
+ const NAMESPACE = 'lottery-game-details';
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 HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
29
+ const createTime = (fnName, tagName = '') => {
30
+ {
31
+ return () => {
32
+ return;
33
+ };
34
+ }
35
+ };
36
+ const uniqueTime = (key, measureText) => {
37
+ {
38
+ return () => {
39
+ return;
40
+ };
41
+ }
42
+ };
43
+ const rootAppliedStyles = new WeakMap();
44
+ const registerStyle = (scopeId, cssText, allowCS) => {
45
+ let style = styles.get(scopeId);
46
+ if (supportsConstructibleStylesheets && allowCS) {
47
+ style = (style || new CSSStyleSheet());
48
+ style.replace(cssText);
49
+ }
50
+ else {
51
+ style = cssText;
52
+ }
53
+ styles.set(scopeId, style);
54
+ };
55
+ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
56
+ let scopeId = getScopeId(cmpMeta);
57
+ const style = styles.get(scopeId);
58
+ // if an element is NOT connected then getRootNode() will return the wrong root node
59
+ // so the fallback is to always use the document for the root node in those cases
60
+ styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
61
+ if (style) {
62
+ if (typeof style === 'string') {
63
+ styleContainerNode = styleContainerNode.head || styleContainerNode;
64
+ let appliedStyles = rootAppliedStyles.get(styleContainerNode);
65
+ let styleElm;
66
+ if (!appliedStyles) {
67
+ rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
68
+ }
69
+ if (!appliedStyles.has(scopeId)) {
70
+ {
71
+ {
72
+ styleElm = doc.createElement('style');
73
+ styleElm.innerHTML = style;
74
+ }
75
+ styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
76
+ }
77
+ if (appliedStyles) {
78
+ appliedStyles.add(scopeId);
79
+ }
80
+ }
81
+ }
82
+ else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
83
+ styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
84
+ }
85
+ }
86
+ return scopeId;
87
+ };
88
+ const attachStyles = (hostRef) => {
89
+ const cmpMeta = hostRef.$cmpMeta$;
90
+ const elm = hostRef.$hostElement$;
91
+ const flags = cmpMeta.$flags$;
92
+ const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
93
+ const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
94
+ if (flags & 10 /* needsScopedEncapsulation */) {
95
+ // only required when we're NOT using native shadow dom (slot)
96
+ // or this browser doesn't support native shadow dom
97
+ // and this host element was NOT created with SSR
98
+ // let's pick out the inner content for slot projection
99
+ // create a node to represent where the original
100
+ // content was first placed, which is useful later on
101
+ // DOM WRITE!!
102
+ elm['s-sc'] = scopeId;
103
+ elm.classList.add(scopeId + '-h');
104
+ }
105
+ endAttachStyles();
106
+ };
107
+ const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
108
+ /**
109
+ * Default style mode id
110
+ */
111
+ /**
112
+ * Reusable empty obj/array
113
+ * Don't add values to these!!
114
+ */
115
+ const EMPTY_OBJ = {};
116
+ const isDef = (v) => v != null;
117
+ const isComplexType = (o) => {
118
+ // https://jsperf.com/typeof-fn-object/5
119
+ o = typeof o;
120
+ return o === 'object' || o === 'function';
121
+ };
122
+ /**
123
+ * Production h() function based on Preact by
124
+ * Jason Miller (@developit)
125
+ * Licensed under the MIT License
126
+ * https://github.com/developit/preact/blob/master/LICENSE
127
+ *
128
+ * Modified for Stencil's compiler and vdom
129
+ */
130
+ // const stack: any[] = [];
131
+ // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode;
132
+ // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
133
+ const h = (nodeName, vnodeData, ...children) => {
134
+ let child = null;
135
+ let simple = false;
136
+ let lastSimple = false;
137
+ const vNodeChildren = [];
138
+ const walk = (c) => {
139
+ for (let i = 0; i < c.length; i++) {
140
+ child = c[i];
141
+ if (Array.isArray(child)) {
142
+ walk(child);
143
+ }
144
+ else if (child != null && typeof child !== 'boolean') {
145
+ if ((simple = typeof nodeName !== 'function' && !isComplexType(child))) {
146
+ child = String(child);
147
+ }
148
+ if (simple && lastSimple) {
149
+ // If the previous child was simple (string), we merge both
150
+ vNodeChildren[vNodeChildren.length - 1].$text$ += child;
151
+ }
152
+ else {
153
+ // Append a new vNode, if it's text, we create a text vNode
154
+ vNodeChildren.push(simple ? newVNode(null, child) : child);
155
+ }
156
+ lastSimple = simple;
157
+ }
158
+ }
159
+ };
160
+ walk(children);
161
+ const vnode = newVNode(nodeName, null);
162
+ vnode.$attrs$ = vnodeData;
163
+ if (vNodeChildren.length > 0) {
164
+ vnode.$children$ = vNodeChildren;
165
+ }
166
+ return vnode;
167
+ };
168
+ const newVNode = (tag, text) => {
169
+ const vnode = {
170
+ $flags$: 0,
171
+ $tag$: tag,
172
+ $text$: text,
173
+ $elm$: null,
174
+ $children$: null,
175
+ };
176
+ {
177
+ vnode.$attrs$ = null;
178
+ }
179
+ return vnode;
180
+ };
181
+ const Host = {};
182
+ const isHost = (node) => node && node.$tag$ === Host;
183
+ /**
184
+ * Production setAccessor() function based on Preact by
185
+ * Jason Miller (@developit)
186
+ * Licensed under the MIT License
187
+ * https://github.com/developit/preact/blob/master/LICENSE
188
+ *
189
+ * Modified for Stencil's compiler and vdom
190
+ */
191
+ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
192
+ if (oldValue !== newValue) {
193
+ let isProp = isMemberInElement(elm, memberName);
194
+ memberName.toLowerCase();
195
+ {
196
+ // Set property if it exists and it's not a SVG
197
+ const isComplex = isComplexType(newValue);
198
+ if ((isProp || (isComplex && newValue !== null)) && !isSvg) {
199
+ try {
200
+ if (!elm.tagName.includes('-')) {
201
+ const n = newValue == null ? '' : newValue;
202
+ // Workaround for Safari, moving the <input> caret when re-assigning the same valued
203
+ if (memberName === 'list') {
204
+ isProp = false;
205
+ }
206
+ else if (oldValue == null || elm[memberName] != n) {
207
+ elm[memberName] = n;
208
+ }
209
+ }
210
+ else {
211
+ elm[memberName] = newValue;
212
+ }
213
+ }
214
+ catch (e) { }
215
+ }
216
+ if (newValue == null || newValue === false) {
217
+ if (newValue !== false || elm.getAttribute(memberName) === '') {
218
+ {
219
+ elm.removeAttribute(memberName);
220
+ }
221
+ }
222
+ }
223
+ else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
224
+ newValue = newValue === true ? '' : newValue;
225
+ {
226
+ elm.setAttribute(memberName, newValue);
227
+ }
228
+ }
229
+ }
230
+ }
231
+ };
232
+ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
233
+ // if the element passed in is a shadow root, which is a document fragment
234
+ // then we want to be adding attrs/props to the shadow root's "host" element
235
+ // if it's not a shadow root, then we add attrs/props to the same element
236
+ const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host
237
+ ? newVnode.$elm$.host
238
+ : newVnode.$elm$;
239
+ const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
240
+ const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
241
+ // add new & update changed attributes
242
+ for (memberName in newVnodeAttrs) {
243
+ setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
244
+ }
245
+ };
246
+ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
247
+ // tslint:disable-next-line: prefer-const
248
+ const newVNode = newParentVNode.$children$[childIndex];
249
+ let i = 0;
250
+ let elm;
251
+ let childNode;
252
+ {
253
+ // create element
254
+ elm = newVNode.$elm$ = (doc.createElement(newVNode.$tag$));
255
+ // add css classes, attrs, props, listeners, etc.
256
+ {
257
+ updateElement(null, newVNode, isSvgMode);
258
+ }
259
+ if (isDef(scopeId) && elm['s-si'] !== scopeId) {
260
+ // if there is a scopeId and this is the initial render
261
+ // then let's add the scopeId as a css class
262
+ elm.classList.add((elm['s-si'] = scopeId));
263
+ }
264
+ if (newVNode.$children$) {
265
+ for (i = 0; i < newVNode.$children$.length; ++i) {
266
+ // create the node
267
+ childNode = createElm(oldParentVNode, newVNode, i);
268
+ // return node could have been null
269
+ if (childNode) {
270
+ // append our new node
271
+ elm.appendChild(childNode);
272
+ }
273
+ }
274
+ }
275
+ }
276
+ return elm;
277
+ };
278
+ const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
279
+ let containerElm = (parentElm);
280
+ let childNode;
281
+ if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
282
+ containerElm = containerElm.shadowRoot;
283
+ }
284
+ for (; startIdx <= endIdx; ++startIdx) {
285
+ if (vnodes[startIdx]) {
286
+ childNode = createElm(null, parentVNode, startIdx);
287
+ if (childNode) {
288
+ vnodes[startIdx].$elm$ = childNode;
289
+ containerElm.insertBefore(childNode, before);
290
+ }
291
+ }
292
+ }
293
+ };
294
+ const patch = (oldVNode, newVNode) => {
295
+ const elm = (newVNode.$elm$ = oldVNode.$elm$);
296
+ const newChildren = newVNode.$children$;
297
+ {
298
+ // element node
299
+ {
300
+ {
301
+ // either this is the first render of an element OR it's an update
302
+ // AND we already know it's possible it could have changed
303
+ // this updates the element's css classes, attrs, props, listeners, etc.
304
+ updateElement(oldVNode, newVNode, isSvgMode);
305
+ }
306
+ }
307
+ if (newChildren !== null) {
308
+ // add the new vnode children
309
+ addVnodes(elm, null, newVNode, newChildren, 0, newChildren.length - 1);
310
+ }
311
+ else ;
312
+ }
313
+ };
314
+ const renderVdom = (hostRef, renderFnResults) => {
315
+ const hostElm = hostRef.$hostElement$;
316
+ const oldVNode = hostRef.$vnode$ || newVNode(null, null);
317
+ const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
318
+ hostTagName = hostElm.tagName;
319
+ rootVnode.$tag$ = null;
320
+ rootVnode.$flags$ |= 4 /* isHost */;
321
+ hostRef.$vnode$ = rootVnode;
322
+ rootVnode.$elm$ = oldVNode.$elm$ = (hostElm.shadowRoot || hostElm );
323
+ {
324
+ scopeId = hostElm['s-sc'];
325
+ }
326
+ // synchronous patch
327
+ patch(oldVNode, rootVnode);
328
+ };
329
+ /**
330
+ * Helper function to create & dispatch a custom Event on a provided target
331
+ * @param elm the target of the Event
332
+ * @param name the name to give the custom Event
333
+ * @param opts options for configuring a custom Event
334
+ * @returns the custom Event
335
+ */
336
+ const emitEvent = (elm, name, opts) => {
337
+ const ev = plt.ce(name, opts);
338
+ elm.dispatchEvent(ev);
339
+ return ev;
340
+ };
341
+ const attachToAncestor = (hostRef, ancestorComponent) => {
342
+ if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
343
+ ancestorComponent['s-p'].push(new Promise((r) => (hostRef.$onRenderResolve$ = r)));
344
+ }
345
+ };
346
+ const scheduleUpdate = (hostRef, isInitialLoad) => {
347
+ if (hostRef.$flags$ & 4 /* isWaitingForChildren */) {
348
+ hostRef.$flags$ |= 512 /* needsRerender */;
349
+ return;
350
+ }
351
+ attachToAncestor(hostRef, hostRef.$ancestorComponent$);
352
+ // there is no ancestor component or the ancestor component
353
+ // has already fired off its lifecycle update then
354
+ // fire off the initial update
355
+ const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
356
+ return writeTask(dispatch) ;
357
+ };
358
+ const dispatchHooks = (hostRef, isInitialLoad) => {
359
+ const endSchedule = createTime('scheduleUpdate', hostRef.$cmpMeta$.$tagName$);
360
+ const instance = hostRef.$lazyInstance$ ;
361
+ let promise;
362
+ endSchedule();
363
+ return then(promise, () => updateComponent(hostRef, instance, isInitialLoad));
364
+ };
365
+ const updateComponent = async (hostRef, instance, isInitialLoad) => {
366
+ // updateComponent
367
+ const elm = hostRef.$hostElement$;
368
+ const endUpdate = createTime('update', hostRef.$cmpMeta$.$tagName$);
369
+ const rc = elm['s-rc'];
370
+ if (isInitialLoad) {
371
+ // DOM WRITE!
372
+ attachStyles(hostRef);
373
+ }
374
+ const endRender = createTime('render', hostRef.$cmpMeta$.$tagName$);
375
+ {
376
+ callRender(hostRef, instance);
377
+ }
378
+ if (rc) {
379
+ // ok, so turns out there are some child host elements
380
+ // waiting on this parent element to load
381
+ // let's fire off all update callbacks waiting
382
+ rc.map((cb) => cb());
383
+ elm['s-rc'] = undefined;
384
+ }
385
+ endRender();
386
+ endUpdate();
387
+ {
388
+ const childrenPromises = elm['s-p'];
389
+ const postUpdate = () => postUpdateComponent(hostRef);
390
+ if (childrenPromises.length === 0) {
391
+ postUpdate();
392
+ }
393
+ else {
394
+ Promise.all(childrenPromises).then(postUpdate);
395
+ hostRef.$flags$ |= 4 /* isWaitingForChildren */;
396
+ childrenPromises.length = 0;
397
+ }
398
+ }
399
+ };
400
+ const callRender = (hostRef, instance, elm) => {
401
+ try {
402
+ instance = instance.render() ;
403
+ {
404
+ hostRef.$flags$ |= 2 /* hasRendered */;
405
+ }
406
+ {
407
+ {
408
+ // looks like we've got child nodes to render into this host element
409
+ // or we need to update the css class/attrs on the host element
410
+ // DOM WRITE!
411
+ {
412
+ renderVdom(hostRef, instance);
413
+ }
414
+ }
415
+ }
416
+ }
417
+ catch (e) {
418
+ consoleError(e, hostRef.$hostElement$);
419
+ }
420
+ return null;
421
+ };
422
+ const postUpdateComponent = (hostRef) => {
423
+ const tagName = hostRef.$cmpMeta$.$tagName$;
424
+ const elm = hostRef.$hostElement$;
425
+ const endPostUpdate = createTime('postUpdate', tagName);
426
+ const ancestorComponent = hostRef.$ancestorComponent$;
427
+ if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
428
+ hostRef.$flags$ |= 64 /* hasLoadedComponent */;
429
+ {
430
+ // DOM WRITE!
431
+ addHydratedFlag(elm);
432
+ }
433
+ endPostUpdate();
434
+ {
435
+ hostRef.$onReadyResolve$(elm);
436
+ if (!ancestorComponent) {
437
+ appDidLoad();
438
+ }
439
+ }
440
+ }
441
+ else {
442
+ endPostUpdate();
443
+ }
444
+ // load events fire from bottom to top
445
+ // the deepest elements load first then bubbles up
446
+ {
447
+ if (hostRef.$onRenderResolve$) {
448
+ hostRef.$onRenderResolve$();
449
+ hostRef.$onRenderResolve$ = undefined;
450
+ }
451
+ if (hostRef.$flags$ & 512 /* needsRerender */) {
452
+ nextTick(() => scheduleUpdate(hostRef, false));
453
+ }
454
+ hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */);
455
+ }
456
+ // ( •_•)
457
+ // ( •_•)>⌐■-■
458
+ // (⌐■_■)
459
+ };
460
+ const appDidLoad = (who) => {
461
+ // on appload
462
+ // we have finish the first big initial render
463
+ {
464
+ addHydratedFlag(doc.documentElement);
465
+ }
466
+ nextTick(() => emitEvent(win, 'appload', { detail: { namespace: NAMESPACE } }));
467
+ };
468
+ const then = (promise, thenFn) => {
469
+ return promise && promise.then ? promise.then(thenFn) : thenFn();
470
+ };
471
+ const addHydratedFlag = (elm) => elm.classList.add('hydrated')
472
+ ;
473
+ const proxyComponent = (Cstr, cmpMeta, flags) => {
474
+ return Cstr;
475
+ };
476
+ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
477
+ // initializeComponent
478
+ if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
479
+ {
480
+ // we haven't initialized this element yet
481
+ hostRef.$flags$ |= 32 /* hasInitializedComponent */;
482
+ // lazy loaded components
483
+ // request the component's implementation to be
484
+ // wired up with the host element
485
+ Cstr = loadModule(cmpMeta);
486
+ if (Cstr.then) {
487
+ // Await creates a micro-task avoid if possible
488
+ const endLoad = uniqueTime();
489
+ Cstr = await Cstr;
490
+ endLoad();
491
+ }
492
+ const endNewInstance = createTime('createInstance', cmpMeta.$tagName$);
493
+ // construct the lazy-loaded component implementation
494
+ // passing the hostRef is very important during
495
+ // construction in order to directly wire together the
496
+ // host element and the lazy-loaded instance
497
+ try {
498
+ new Cstr(hostRef);
499
+ }
500
+ catch (e) {
501
+ consoleError(e);
502
+ }
503
+ endNewInstance();
504
+ }
505
+ if (Cstr.style) {
506
+ // this component has styles but we haven't registered them yet
507
+ let style = Cstr.style;
508
+ const scopeId = getScopeId(cmpMeta);
509
+ if (!styles.has(scopeId)) {
510
+ const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
511
+ registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
512
+ endRegisterStyles();
513
+ }
514
+ }
515
+ }
516
+ // we've successfully created a lazy instance
517
+ const ancestorComponent = hostRef.$ancestorComponent$;
518
+ const schedule = () => scheduleUpdate(hostRef, true);
519
+ if (ancestorComponent && ancestorComponent['s-rc']) {
520
+ // this is the initial load and this component it has an ancestor component
521
+ // but the ancestor component has NOT fired its will update lifecycle yet
522
+ // so let's just cool our jets and wait for the ancestor to continue first
523
+ // this will get fired off when the ancestor component
524
+ // finally gets around to rendering its lazy self
525
+ // fire off the initial update
526
+ ancestorComponent['s-rc'].push(schedule);
527
+ }
528
+ else {
529
+ schedule();
530
+ }
531
+ };
532
+ const connectedCallback = (elm) => {
533
+ if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
534
+ const hostRef = getHostRef(elm);
535
+ const cmpMeta = hostRef.$cmpMeta$;
536
+ const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
537
+ if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
538
+ // first time this component has connected
539
+ hostRef.$flags$ |= 1 /* hasConnected */;
540
+ {
541
+ // find the first ancestor component (if there is one) and register
542
+ // this component as one of the actively loading child components for its ancestor
543
+ let ancestorComponent = elm;
544
+ while ((ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host)) {
545
+ // climb up the ancestors looking for the first
546
+ // component that hasn't finished its lifecycle update yet
547
+ if (ancestorComponent['s-p']) {
548
+ // we found this components first ancestor component
549
+ // keep a reference to this component's ancestor component
550
+ attachToAncestor(hostRef, (hostRef.$ancestorComponent$ = ancestorComponent));
551
+ break;
552
+ }
553
+ }
554
+ }
555
+ {
556
+ initializeComponent(elm, hostRef, cmpMeta);
557
+ }
558
+ }
559
+ endConnected();
560
+ }
561
+ };
562
+ const disconnectedCallback = (elm) => {
563
+ if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
564
+ getHostRef(elm);
565
+ }
566
+ };
567
+ const bootstrapLazy = (lazyBundles, options = {}) => {
568
+ const endBootstrap = createTime();
569
+ const cmpTags = [];
570
+ const exclude = options.exclude || [];
571
+ const customElements = win.customElements;
572
+ const head = doc.head;
573
+ const metaCharset = /*@__PURE__*/ head.querySelector('meta[charset]');
574
+ const visibilityStyle = /*@__PURE__*/ doc.createElement('style');
575
+ const deferredConnectedCallbacks = [];
576
+ let appLoadFallback;
577
+ let isBootstrapping = true;
578
+ Object.assign(plt, options);
579
+ plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
580
+ lazyBundles.map((lazyBundle) => {
581
+ lazyBundle[1].map((compactMeta) => {
582
+ const cmpMeta = {
583
+ $flags$: compactMeta[0],
584
+ $tagName$: compactMeta[1],
585
+ $members$: compactMeta[2],
586
+ $listeners$: compactMeta[3],
587
+ };
588
+ const tagName = cmpMeta.$tagName$;
589
+ const HostElement = class extends HTMLElement {
590
+ // StencilLazyHost
591
+ constructor(self) {
592
+ // @ts-ignore
593
+ super(self);
594
+ self = this;
595
+ registerHost(self, cmpMeta);
596
+ if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
597
+ // this component is using shadow dom
598
+ // and this browser supports shadow dom
599
+ // add the read-only property "shadowRoot" to the host element
600
+ // adding the shadow root build conditionals to minimize runtime
601
+ {
602
+ {
603
+ self.attachShadow({ mode: 'open' });
604
+ }
605
+ }
606
+ }
607
+ }
608
+ connectedCallback() {
609
+ if (appLoadFallback) {
610
+ clearTimeout(appLoadFallback);
611
+ appLoadFallback = null;
612
+ }
613
+ if (isBootstrapping) {
614
+ // connectedCallback will be processed once all components have been registered
615
+ deferredConnectedCallbacks.push(this);
616
+ }
617
+ else {
618
+ plt.jmp(() => connectedCallback(this));
619
+ }
620
+ }
621
+ disconnectedCallback() {
622
+ plt.jmp(() => disconnectedCallback(this));
623
+ }
624
+ componentOnReady() {
625
+ return getHostRef(this).$onReadyPromise$;
626
+ }
627
+ };
628
+ cmpMeta.$lazyBundleId$ = lazyBundle[0];
629
+ if (!exclude.includes(tagName) && !customElements.get(tagName)) {
630
+ cmpTags.push(tagName);
631
+ customElements.define(tagName, proxyComponent(HostElement));
632
+ }
633
+ });
634
+ });
635
+ {
636
+ visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;
637
+ visibilityStyle.setAttribute('data-styles', '');
638
+ head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild);
639
+ }
640
+ // Process deferred connectedCallbacks now all components have been registered
641
+ isBootstrapping = false;
642
+ if (deferredConnectedCallbacks.length) {
643
+ deferredConnectedCallbacks.map((host) => host.connectedCallback());
644
+ }
645
+ else {
646
+ {
647
+ plt.jmp(() => (appLoadFallback = setTimeout(appDidLoad, 30)));
648
+ }
649
+ }
650
+ // Fallback appLoad event
651
+ endBootstrap();
652
+ };
653
+ const hostRefs = new WeakMap();
654
+ const getHostRef = (ref) => hostRefs.get(ref);
655
+ const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
656
+ const registerHost = (elm, cmpMeta) => {
657
+ const hostRef = {
658
+ $flags$: 0,
659
+ $hostElement$: elm,
660
+ $cmpMeta$: cmpMeta,
661
+ $instanceValues$: new Map(),
662
+ };
663
+ {
664
+ hostRef.$onReadyPromise$ = new Promise((r) => (hostRef.$onReadyResolve$ = r));
665
+ elm['s-p'] = [];
666
+ elm['s-rc'] = [];
667
+ }
668
+ return hostRefs.set(elm, hostRef);
669
+ };
670
+ const isMemberInElement = (elm, memberName) => memberName in elm;
671
+ const consoleError = (e, el) => (0, console.error)(e, el);
672
+ const cmpModules = /*@__PURE__*/ new Map();
673
+ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
674
+ // loadModuleImport
675
+ const exportName = cmpMeta.$tagName$.replace(/-/g, '_');
676
+ const bundleId = cmpMeta.$lazyBundleId$;
677
+ const module = cmpModules.get(bundleId) ;
678
+ if (module) {
679
+ return module[exportName];
680
+ }
681
+ /*!__STENCIL_STATIC_IMPORT_SWITCH__*/
682
+ return import(
683
+ /* @vite-ignore */
684
+ /* webpackInclude: /\.entry\.js$/ */
685
+ /* webpackExclude: /\.system\.entry\.js$/ */
686
+ /* webpackMode: "lazy" */
687
+ `./${bundleId}.entry.js${''}`).then((importedModule) => {
688
+ {
689
+ cmpModules.set(bundleId, importedModule);
690
+ }
691
+ return importedModule[exportName];
692
+ }, consoleError);
693
+ };
694
+ const styles = new Map();
695
+ const queueDomReads = [];
696
+ const queueDomWrites = [];
697
+ const queueTask = (queue, write) => (cb) => {
698
+ queue.push(cb);
699
+ if (!queuePending) {
700
+ queuePending = true;
701
+ if (write && plt.$flags$ & 4 /* queueSync */) {
702
+ nextTick(flush);
703
+ }
704
+ else {
705
+ plt.raf(flush);
706
+ }
707
+ }
708
+ };
709
+ const consume = (queue) => {
710
+ for (let i = 0; i < queue.length; i++) {
711
+ try {
712
+ queue[i](performance.now());
713
+ }
714
+ catch (e) {
715
+ consoleError(e);
716
+ }
717
+ }
718
+ queue.length = 0;
719
+ };
720
+ const flush = () => {
721
+ // always force a bunch of medium callbacks to run, but still have
722
+ // a throttle on how many can run in a certain time
723
+ // DOM READS!!!
724
+ consume(queueDomReads);
725
+ // DOM WRITES!!!
726
+ {
727
+ consume(queueDomWrites);
728
+ if ((queuePending = queueDomReads.length > 0)) {
729
+ // still more to do yet, but we've run out of time
730
+ // let's let this thing cool off and try again in the next tick
731
+ plt.raf(flush);
732
+ }
733
+ }
734
+ };
735
+ const nextTick = /*@__PURE__*/ (cb) => promiseResolve().then(cb);
736
+ const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
737
+
738
+ export { bootstrapLazy as b, h, promiseResolve as p, registerInstance as r };