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