@everymatrix/player-lugas-limit 1.10.6

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