@everymatrix/helper-accordion 0.1.24 → 1.0.69

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