@everymatrix/bonus-pagination-nav 1.43.4 → 1.45.0

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