@everymatrix/blog-article-details 1.10.6

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