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