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