@everymatrix/casino-tournament-duration 1.16.1

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