@everymatrix/blog-article-details 1.31.2 → 1.32.4

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