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