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