@everymatrix/casino-engagement-suite-bar 1.34.0

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