pushfeedback 0.1.70 → 0.1.72

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/dist/cjs/canvas-editor_3.cjs.entry.js +1364 -0
  2. package/dist/cjs/index-9a8f4784.js +1584 -0
  3. package/dist/cjs/index.cjs.js +2 -0
  4. package/dist/cjs/loader.cjs.js +22 -0
  5. package/dist/cjs/pushfeedback.cjs.js +23 -0
  6. package/dist/collection/collection-manifest.json +14 -0
  7. package/dist/collection/components/canvas-editor/canvas-editor.css +404 -0
  8. package/dist/collection/components/canvas-editor/canvas-editor.js +1282 -0
  9. package/dist/collection/components/feedback-button/feedback-button.css +81 -0
  10. package/dist/collection/components/feedback-button/feedback-button.js +1149 -0
  11. package/dist/collection/components/feedback-modal/feedback-modal.css +547 -0
  12. package/dist/collection/components/feedback-modal/feedback-modal.js +1238 -0
  13. package/dist/collection/index.js +1 -0
  14. package/dist/components/canvas-editor.js +6 -0
  15. package/dist/{pushfeedback/canvas-editor.entry.js → components/canvas-editor2.js} +64 -7
  16. package/dist/{pushfeedback/feedback-button.entry.js → components/feedback-button.js} +112 -33
  17. package/dist/components/feedback-modal.js +6 -0
  18. package/dist/{pushfeedback/feedback-modal.entry.js → components/feedback-modal2.js} +106 -18
  19. package/dist/components/index.js +4 -0
  20. package/dist/esm/canvas-editor_3.entry.js +1358 -0
  21. package/dist/esm/index-f65e9124.js +1555 -0
  22. package/dist/esm/index.js +1 -0
  23. package/dist/esm/loader.js +18 -0
  24. package/dist/esm/polyfills/core-js.js +11 -0
  25. package/dist/esm/polyfills/css-shim.js +1 -0
  26. package/dist/esm/polyfills/dom.js +79 -0
  27. package/dist/esm/polyfills/es5-html-element.js +1 -0
  28. package/dist/esm/polyfills/index.js +34 -0
  29. package/dist/esm/polyfills/system.js +6 -0
  30. package/dist/esm/pushfeedback.js +18 -0
  31. package/dist/index.cjs.js +1 -0
  32. package/dist/index.js +1 -0
  33. package/dist/pushfeedback/index.esm.js +0 -1
  34. package/dist/pushfeedback/p-881a733a.entry.js +1 -0
  35. package/dist/pushfeedback/p-af2a1f7f.js +2 -0
  36. package/dist/pushfeedback/pushfeedback.css +1 -146
  37. package/dist/pushfeedback/pushfeedback.esm.js +1 -148
  38. package/dist/types/components/feedback-button/feedback-button.d.ts +16 -17
  39. package/dist/types/components/feedback-modal/feedback-modal.d.ts +8 -9
  40. package/dist/types/components.d.ts +28 -32
  41. package/package.json +1 -1
  42. package/dist/pushfeedback/app-globals-0f993ce5.js +0 -3
  43. package/dist/pushfeedback/css-shim-b7d3d95f.js +0 -4
  44. package/dist/pushfeedback/dom-64053c71.js +0 -73
  45. package/dist/pushfeedback/index-36434da0.js +0 -3371
  46. package/dist/pushfeedback/shadow-css-98135883.js +0 -387
@@ -0,0 +1,1584 @@
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 = 'pushfeedback';
24
+
25
+ /**
26
+ * Virtual DOM patching algorithm based on Snabbdom by
27
+ * Simon Friis Vindum (@paldepind)
28
+ * Licensed under the MIT License
29
+ * https://github.com/snabbdom/snabbdom/blob/master/LICENSE
30
+ *
31
+ * Modified for Stencil's renderer and slot projection
32
+ */
33
+ let scopeId;
34
+ let hostTagName;
35
+ let isSvgMode = false;
36
+ let queuePending = false;
37
+ const createTime = (fnName, tagName = '') => {
38
+ {
39
+ return () => {
40
+ return;
41
+ };
42
+ }
43
+ };
44
+ const uniqueTime = (key, measureText) => {
45
+ {
46
+ return () => {
47
+ return;
48
+ };
49
+ }
50
+ };
51
+ const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
52
+ /**
53
+ * Default style mode id
54
+ */
55
+ /**
56
+ * Reusable empty obj/array
57
+ * Don't add values to these!!
58
+ */
59
+ const EMPTY_OBJ = {};
60
+ /**
61
+ * Namespaces
62
+ */
63
+ const SVG_NS = 'http://www.w3.org/2000/svg';
64
+ const HTML_NS = 'http://www.w3.org/1999/xhtml';
65
+ const isDef = (v) => v != null;
66
+ const isComplexType = (o) => {
67
+ // https://jsperf.com/typeof-fn-object/5
68
+ o = typeof o;
69
+ return o === 'object' || o === 'function';
70
+ };
71
+ /**
72
+ * Helper method for querying a `meta` tag that contains a nonce value
73
+ * out of a DOM's head.
74
+ *
75
+ * @param doc The DOM containing the `head` to query against
76
+ * @returns The content of the meta tag representing the nonce value, or `undefined` if no tag
77
+ * exists or the tag has no content.
78
+ */
79
+ function queryNonceMetaTagContent(doc) {
80
+ var _a, _b, _c;
81
+ return (_c = (_b = (_a = doc.head) === null || _a === void 0 ? void 0 : _a.querySelector('meta[name="csp-nonce"]')) === null || _b === void 0 ? void 0 : _b.getAttribute('content')) !== null && _c !== void 0 ? _c : undefined;
82
+ }
83
+ /**
84
+ * Production h() function based on Preact by
85
+ * Jason Miller (@developit)
86
+ * Licensed under the MIT License
87
+ * https://github.com/developit/preact/blob/master/LICENSE
88
+ *
89
+ * Modified for Stencil's compiler and vdom
90
+ */
91
+ // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode;
92
+ // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
93
+ const h = (nodeName, vnodeData, ...children) => {
94
+ let child = null;
95
+ let key = null;
96
+ let simple = false;
97
+ let lastSimple = false;
98
+ const vNodeChildren = [];
99
+ const walk = (c) => {
100
+ for (let i = 0; i < c.length; i++) {
101
+ child = c[i];
102
+ if (Array.isArray(child)) {
103
+ walk(child);
104
+ }
105
+ else if (child != null && typeof child !== 'boolean') {
106
+ if ((simple = typeof nodeName !== 'function' && !isComplexType(child))) {
107
+ child = String(child);
108
+ }
109
+ if (simple && lastSimple) {
110
+ // If the previous child was simple (string), we merge both
111
+ vNodeChildren[vNodeChildren.length - 1].$text$ += child;
112
+ }
113
+ else {
114
+ // Append a new vNode, if it's text, we create a text vNode
115
+ vNodeChildren.push(simple ? newVNode(null, child) : child);
116
+ }
117
+ lastSimple = simple;
118
+ }
119
+ }
120
+ };
121
+ walk(children);
122
+ if (vnodeData) {
123
+ // normalize class / classname attributes
124
+ if (vnodeData.key) {
125
+ key = vnodeData.key;
126
+ }
127
+ {
128
+ const classData = vnodeData.className || vnodeData.class;
129
+ if (classData) {
130
+ vnodeData.class =
131
+ typeof classData !== 'object'
132
+ ? classData
133
+ : Object.keys(classData)
134
+ .filter((k) => classData[k])
135
+ .join(' ');
136
+ }
137
+ }
138
+ }
139
+ const vnode = newVNode(nodeName, null);
140
+ vnode.$attrs$ = vnodeData;
141
+ if (vNodeChildren.length > 0) {
142
+ vnode.$children$ = vNodeChildren;
143
+ }
144
+ {
145
+ vnode.$key$ = key;
146
+ }
147
+ return vnode;
148
+ };
149
+ /**
150
+ * A utility function for creating a virtual DOM node from a tag and some
151
+ * possible text content.
152
+ *
153
+ * @param tag the tag for this element
154
+ * @param text possible text content for the node
155
+ * @returns a newly-minted virtual DOM node
156
+ */
157
+ const newVNode = (tag, text) => {
158
+ const vnode = {
159
+ $flags$: 0,
160
+ $tag$: tag,
161
+ $text$: text,
162
+ $elm$: null,
163
+ $children$: null,
164
+ };
165
+ {
166
+ vnode.$attrs$ = null;
167
+ }
168
+ {
169
+ vnode.$key$ = null;
170
+ }
171
+ return vnode;
172
+ };
173
+ const Host = {};
174
+ /**
175
+ * Check whether a given node is a Host node or not
176
+ *
177
+ * @param node the virtual DOM node to check
178
+ * @returns whether it's a Host node or not
179
+ */
180
+ const isHost = (node) => node && node.$tag$ === Host;
181
+ /**
182
+ * Parse a new property value for a given property type.
183
+ *
184
+ * While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
185
+ * it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
186
+ * 1. `any`, the type given to `propValue` in the function signature
187
+ * 2. the type stored from `propType`.
188
+ *
189
+ * This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
190
+ *
191
+ * Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
192
+ * a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
193
+ * based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
194
+ * ```tsx
195
+ * <my-cmp prop-val={0}></my-cmp>
196
+ * ```
197
+ *
198
+ * HTML prop values on the other hand, will always a string
199
+ *
200
+ * @param propValue the new value to coerce to some type
201
+ * @param propType the type of the prop, expressed as a binary number
202
+ * @returns the parsed/coerced value
203
+ */
204
+ const parsePropertyValue = (propValue, propType) => {
205
+ // ensure this value is of the correct prop type
206
+ if (propValue != null && !isComplexType(propValue)) {
207
+ if (propType & 4 /* MEMBER_FLAGS.Boolean */) {
208
+ // per the HTML spec, any string value means it is a boolean true value
209
+ // but we'll cheat here and say that the string "false" is the boolean false
210
+ return propValue === 'false' ? false : propValue === '' || !!propValue;
211
+ }
212
+ if (propType & 2 /* MEMBER_FLAGS.Number */) {
213
+ // force it to be a number
214
+ return parseFloat(propValue);
215
+ }
216
+ if (propType & 1 /* MEMBER_FLAGS.String */) {
217
+ // could have been passed as a number or boolean
218
+ // but we still want it as a string
219
+ return String(propValue);
220
+ }
221
+ // redundant return here for better minification
222
+ return propValue;
223
+ }
224
+ // not sure exactly what type we want
225
+ // so no need to change to a different type
226
+ return propValue;
227
+ };
228
+ const getElement = (ref) => (getHostRef(ref).$hostElement$ );
229
+ const createEvent = (ref, name, flags) => {
230
+ const elm = getElement(ref);
231
+ return {
232
+ emit: (detail) => {
233
+ return emitEvent(elm, name, {
234
+ bubbles: !!(flags & 4 /* EVENT_FLAGS.Bubbles */),
235
+ composed: !!(flags & 2 /* EVENT_FLAGS.Composed */),
236
+ cancelable: !!(flags & 1 /* EVENT_FLAGS.Cancellable */),
237
+ detail,
238
+ });
239
+ },
240
+ };
241
+ };
242
+ /**
243
+ * Helper function to create & dispatch a custom Event on a provided target
244
+ * @param elm the target of the Event
245
+ * @param name the name to give the custom Event
246
+ * @param opts options for configuring a custom Event
247
+ * @returns the custom Event
248
+ */
249
+ const emitEvent = (elm, name, opts) => {
250
+ const ev = plt.ce(name, opts);
251
+ elm.dispatchEvent(ev);
252
+ return ev;
253
+ };
254
+ const rootAppliedStyles = /*@__PURE__*/ new WeakMap();
255
+ const registerStyle = (scopeId, cssText, allowCS) => {
256
+ let style = styles.get(scopeId);
257
+ if (supportsConstructableStylesheets && allowCS) {
258
+ style = (style || new CSSStyleSheet());
259
+ if (typeof style === 'string') {
260
+ style = cssText;
261
+ }
262
+ else {
263
+ style.replaceSync(cssText);
264
+ }
265
+ }
266
+ else {
267
+ style = cssText;
268
+ }
269
+ styles.set(scopeId, style);
270
+ };
271
+ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
272
+ var _a;
273
+ let scopeId = getScopeId(cmpMeta);
274
+ const style = styles.get(scopeId);
275
+ // if an element is NOT connected then getRootNode() will return the wrong root node
276
+ // so the fallback is to always use the document for the root node in those cases
277
+ styleContainerNode = styleContainerNode.nodeType === 11 /* NODE_TYPE.DocumentFragment */ ? styleContainerNode : doc;
278
+ if (style) {
279
+ if (typeof style === 'string') {
280
+ styleContainerNode = styleContainerNode.head || styleContainerNode;
281
+ let appliedStyles = rootAppliedStyles.get(styleContainerNode);
282
+ let styleElm;
283
+ if (!appliedStyles) {
284
+ rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
285
+ }
286
+ if (!appliedStyles.has(scopeId)) {
287
+ {
288
+ {
289
+ styleElm = doc.createElement('style');
290
+ styleElm.innerHTML = style;
291
+ }
292
+ // Apply CSP nonce to the style tag if it exists
293
+ const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
294
+ if (nonce != null) {
295
+ styleElm.setAttribute('nonce', nonce);
296
+ }
297
+ styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
298
+ }
299
+ if (appliedStyles) {
300
+ appliedStyles.add(scopeId);
301
+ }
302
+ }
303
+ }
304
+ else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
305
+ styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
306
+ }
307
+ }
308
+ return scopeId;
309
+ };
310
+ const attachStyles = (hostRef) => {
311
+ const cmpMeta = hostRef.$cmpMeta$;
312
+ const elm = hostRef.$hostElement$;
313
+ const flags = cmpMeta.$flags$;
314
+ const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
315
+ const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
316
+ if (flags & 10 /* CMP_FLAGS.needsScopedEncapsulation */) {
317
+ // only required when we're NOT using native shadow dom (slot)
318
+ // or this browser doesn't support native shadow dom
319
+ // and this host element was NOT created with SSR
320
+ // let's pick out the inner content for slot projection
321
+ // create a node to represent where the original
322
+ // content was first placed, which is useful later on
323
+ // DOM WRITE!!
324
+ elm['s-sc'] = scopeId;
325
+ elm.classList.add(scopeId + '-h');
326
+ }
327
+ endAttachStyles();
328
+ };
329
+ const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
330
+ /**
331
+ * Production setAccessor() function based on Preact by
332
+ * Jason Miller (@developit)
333
+ * Licensed under the MIT License
334
+ * https://github.com/developit/preact/blob/master/LICENSE
335
+ *
336
+ * Modified for Stencil's compiler and vdom
337
+ */
338
+ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
339
+ if (oldValue !== newValue) {
340
+ let isProp = isMemberInElement(elm, memberName);
341
+ let ln = memberName.toLowerCase();
342
+ if (memberName === 'class') {
343
+ const classList = elm.classList;
344
+ const oldClasses = parseClassList(oldValue);
345
+ const newClasses = parseClassList(newValue);
346
+ classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
347
+ classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
348
+ }
349
+ else if (memberName === 'style') {
350
+ // update style attribute, css properties and values
351
+ {
352
+ for (const prop in oldValue) {
353
+ if (!newValue || newValue[prop] == null) {
354
+ if (prop.includes('-')) {
355
+ elm.style.removeProperty(prop);
356
+ }
357
+ else {
358
+ elm.style[prop] = '';
359
+ }
360
+ }
361
+ }
362
+ }
363
+ for (const prop in newValue) {
364
+ if (!oldValue || newValue[prop] !== oldValue[prop]) {
365
+ if (prop.includes('-')) {
366
+ elm.style.setProperty(prop, newValue[prop]);
367
+ }
368
+ else {
369
+ elm.style[prop] = newValue[prop];
370
+ }
371
+ }
372
+ }
373
+ }
374
+ else if (memberName === 'key')
375
+ ;
376
+ else if (memberName === 'ref') {
377
+ // minifier will clean this up
378
+ if (newValue) {
379
+ newValue(elm);
380
+ }
381
+ }
382
+ else if ((!isProp ) &&
383
+ memberName[0] === 'o' &&
384
+ memberName[1] === 'n') {
385
+ // Event Handlers
386
+ // so if the member name starts with "on" and the 3rd characters is
387
+ // a capital letter, and it's not already a member on the element,
388
+ // then we're assuming it's an event listener
389
+ if (memberName[2] === '-') {
390
+ // on- prefixed events
391
+ // allows to be explicit about the dom event to listen without any magic
392
+ // under the hood:
393
+ // <my-cmp on-click> // listens for "click"
394
+ // <my-cmp on-Click> // listens for "Click"
395
+ // <my-cmp on-ionChange> // listens for "ionChange"
396
+ // <my-cmp on-EVENTS> // listens for "EVENTS"
397
+ memberName = memberName.slice(3);
398
+ }
399
+ else if (isMemberInElement(win, ln)) {
400
+ // standard event
401
+ // the JSX attribute could have been "onMouseOver" and the
402
+ // member name "onmouseover" is on the window's prototype
403
+ // so let's add the listener "mouseover", which is all lowercased
404
+ memberName = ln.slice(2);
405
+ }
406
+ else {
407
+ // custom event
408
+ // the JSX attribute could have been "onMyCustomEvent"
409
+ // so let's trim off the "on" prefix and lowercase the first character
410
+ // and add the listener "myCustomEvent"
411
+ // except for the first character, we keep the event name case
412
+ memberName = ln[2] + memberName.slice(3);
413
+ }
414
+ if (oldValue) {
415
+ plt.rel(elm, memberName, oldValue, false);
416
+ }
417
+ if (newValue) {
418
+ plt.ael(elm, memberName, newValue, false);
419
+ }
420
+ }
421
+ else {
422
+ // Set property if it exists and it's not a SVG
423
+ const isComplex = isComplexType(newValue);
424
+ if ((isProp || (isComplex && newValue !== null)) && !isSvg) {
425
+ try {
426
+ if (!elm.tagName.includes('-')) {
427
+ const n = newValue == null ? '' : newValue;
428
+ // Workaround for Safari, moving the <input> caret when re-assigning the same valued
429
+ if (memberName === 'list') {
430
+ isProp = false;
431
+ }
432
+ else if (oldValue == null || elm[memberName] != n) {
433
+ elm[memberName] = n;
434
+ }
435
+ }
436
+ else {
437
+ elm[memberName] = newValue;
438
+ }
439
+ }
440
+ catch (e) { }
441
+ }
442
+ if (newValue == null || newValue === false) {
443
+ if (newValue !== false || elm.getAttribute(memberName) === '') {
444
+ {
445
+ elm.removeAttribute(memberName);
446
+ }
447
+ }
448
+ }
449
+ else if ((!isProp || flags & 4 /* VNODE_FLAGS.isHost */ || isSvg) && !isComplex) {
450
+ newValue = newValue === true ? '' : newValue;
451
+ {
452
+ elm.setAttribute(memberName, newValue);
453
+ }
454
+ }
455
+ }
456
+ }
457
+ };
458
+ const parseClassListRegex = /\s/;
459
+ const parseClassList = (value) => (!value ? [] : value.split(parseClassListRegex));
460
+ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
461
+ // if the element passed in is a shadow root, which is a document fragment
462
+ // then we want to be adding attrs/props to the shadow root's "host" element
463
+ // if it's not a shadow root, then we add attrs/props to the same element
464
+ const elm = newVnode.$elm$.nodeType === 11 /* NODE_TYPE.DocumentFragment */ && newVnode.$elm$.host
465
+ ? newVnode.$elm$.host
466
+ : newVnode.$elm$;
467
+ const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
468
+ const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
469
+ {
470
+ // remove attributes no longer present on the vnode by setting them to undefined
471
+ for (memberName in oldVnodeAttrs) {
472
+ if (!(memberName in newVnodeAttrs)) {
473
+ setAccessor(elm, memberName, oldVnodeAttrs[memberName], undefined, isSvgMode, newVnode.$flags$);
474
+ }
475
+ }
476
+ }
477
+ // add new & update changed attributes
478
+ for (memberName in newVnodeAttrs) {
479
+ setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
480
+ }
481
+ };
482
+ /**
483
+ * Create a DOM Node corresponding to one of the children of a given VNode.
484
+ *
485
+ * @param oldParentVNode the parent VNode from the previous render
486
+ * @param newParentVNode the parent VNode from the current render
487
+ * @param childIndex the index of the VNode, in the _new_ parent node's
488
+ * children, for which we will create a new DOM node
489
+ * @param parentElm the parent DOM node which our new node will be a child of
490
+ * @returns the newly created node
491
+ */
492
+ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
493
+ // tslint:disable-next-line: prefer-const
494
+ const newVNode = newParentVNode.$children$[childIndex];
495
+ let i = 0;
496
+ let elm;
497
+ let childNode;
498
+ if (newVNode.$text$ !== null) {
499
+ // create text node
500
+ elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
501
+ }
502
+ else {
503
+ if (!isSvgMode) {
504
+ isSvgMode = newVNode.$tag$ === 'svg';
505
+ }
506
+ // create element
507
+ elm = newVNode.$elm$ = (doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, newVNode.$tag$)
508
+ );
509
+ if (isSvgMode && newVNode.$tag$ === 'foreignObject') {
510
+ isSvgMode = false;
511
+ }
512
+ // add css classes, attrs, props, listeners, etc.
513
+ {
514
+ updateElement(null, newVNode, isSvgMode);
515
+ }
516
+ if (isDef(scopeId) && elm['s-si'] !== scopeId) {
517
+ // if there is a scopeId and this is the initial render
518
+ // then let's add the scopeId as a css class
519
+ elm.classList.add((elm['s-si'] = scopeId));
520
+ }
521
+ if (newVNode.$children$) {
522
+ for (i = 0; i < newVNode.$children$.length; ++i) {
523
+ // create the node
524
+ childNode = createElm(oldParentVNode, newVNode, i);
525
+ // return node could have been null
526
+ if (childNode) {
527
+ // append our new node
528
+ elm.appendChild(childNode);
529
+ }
530
+ }
531
+ }
532
+ {
533
+ if (newVNode.$tag$ === 'svg') {
534
+ // Only reset the SVG context when we're exiting <svg> element
535
+ isSvgMode = false;
536
+ }
537
+ else if (elm.tagName === 'foreignObject') {
538
+ // Reenter SVG context when we're exiting <foreignObject> element
539
+ isSvgMode = true;
540
+ }
541
+ }
542
+ }
543
+ return elm;
544
+ };
545
+ /**
546
+ * Create DOM nodes corresponding to a list of {@link d.Vnode} objects and
547
+ * add them to the DOM in the appropriate place.
548
+ *
549
+ * @param parentElm the DOM node which should be used as a parent for the new
550
+ * DOM nodes
551
+ * @param before a child of the `parentElm` which the new children should be
552
+ * inserted before (optional)
553
+ * @param parentVNode the parent virtual DOM node
554
+ * @param vnodes the new child virtual DOM nodes to produce DOM nodes for
555
+ * @param startIdx the index in the child virtual DOM nodes at which to start
556
+ * creating DOM nodes (inclusive)
557
+ * @param endIdx the index in the child virtual DOM nodes at which to stop
558
+ * creating DOM nodes (inclusive)
559
+ */
560
+ const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
561
+ let containerElm = (parentElm);
562
+ let childNode;
563
+ if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
564
+ containerElm = containerElm.shadowRoot;
565
+ }
566
+ for (; startIdx <= endIdx; ++startIdx) {
567
+ if (vnodes[startIdx]) {
568
+ childNode = createElm(null, parentVNode, startIdx);
569
+ if (childNode) {
570
+ vnodes[startIdx].$elm$ = childNode;
571
+ containerElm.insertBefore(childNode, before);
572
+ }
573
+ }
574
+ }
575
+ };
576
+ /**
577
+ * Remove the DOM elements corresponding to a list of {@link d.VNode} objects.
578
+ * This can be used to, for instance, clean up after a list of children which
579
+ * should no longer be shown.
580
+ *
581
+ * This function also handles some of Stencil's slot relocation logic.
582
+ *
583
+ * @param vnodes a list of virtual DOM nodes to remove
584
+ * @param startIdx the index at which to start removing nodes (inclusive)
585
+ * @param endIdx the index at which to stop removing nodes (inclusive)
586
+ * @param vnode a VNode
587
+ * @param elm an element
588
+ */
589
+ const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
590
+ for (; startIdx <= endIdx; ++startIdx) {
591
+ if ((vnode = vnodes[startIdx])) {
592
+ elm = vnode.$elm$;
593
+ callNodeRefs(vnode);
594
+ // remove the vnode's element from the dom
595
+ elm.remove();
596
+ }
597
+ }
598
+ };
599
+ /**
600
+ * Reconcile the children of a new VNode with the children of an old VNode by
601
+ * traversing the two collections of children, identifying nodes that are
602
+ * conserved or changed, calling out to `patch` to make any necessary
603
+ * updates to the DOM, and rearranging DOM nodes as needed.
604
+ *
605
+ * The algorithm for reconciling children works by analyzing two 'windows' onto
606
+ * the two arrays of children (`oldCh` and `newCh`). We keep track of the
607
+ * 'windows' by storing start and end indices and references to the
608
+ * corresponding array entries. Initially the two 'windows' are basically equal
609
+ * to the entire array, but we progressively narrow the windows until there are
610
+ * no children left to update by doing the following:
611
+ *
612
+ * 1. Skip any `null` entries at the beginning or end of the two arrays, so
613
+ * that if we have an initial array like the following we'll end up dealing
614
+ * only with a window bounded by the highlighted elements:
615
+ *
616
+ * [null, null, VNode1 , ... , VNode2, null, null]
617
+ * ^^^^^^ ^^^^^^
618
+ *
619
+ * 2. Check to see if the elements at the head and tail positions are equal
620
+ * across the windows. This will basically detect elements which haven't
621
+ * been added, removed, or changed position, i.e. if you had the following
622
+ * VNode elements (represented as HTML):
623
+ *
624
+ * oldVNode: `<div><p><span>HEY</span></p></div>`
625
+ * newVNode: `<div><p><span>THERE</span></p></div>`
626
+ *
627
+ * Then when comparing the children of the `<div>` tag we check the equality
628
+ * of the VNodes corresponding to the `<p>` tags and, since they are the
629
+ * same tag in the same position, we'd be able to avoid completely
630
+ * re-rendering the subtree under them with a new DOM element and would just
631
+ * call out to `patch` to handle reconciling their children and so on.
632
+ *
633
+ * 3. Check, for both windows, to see if the element at the beginning of the
634
+ * window corresponds to the element at the end of the other window. This is
635
+ * a heuristic which will let us identify _some_ situations in which
636
+ * elements have changed position, for instance it _should_ detect that the
637
+ * children nodes themselves have not changed but merely moved in the
638
+ * following example:
639
+ *
640
+ * oldVNode: `<div><element-one /><element-two /></div>`
641
+ * newVNode: `<div><element-two /><element-one /></div>`
642
+ *
643
+ * If we find cases like this then we also need to move the concrete DOM
644
+ * elements corresponding to the moved children to write the re-order to the
645
+ * DOM.
646
+ *
647
+ * 4. Finally, if VNodes have the `key` attribute set on them we check for any
648
+ * nodes in the old children which have the same key as the first element in
649
+ * our window on the new children. If we find such a node we handle calling
650
+ * out to `patch`, moving relevant DOM nodes, and so on, in accordance with
651
+ * what we find.
652
+ *
653
+ * Finally, once we've narrowed our 'windows' to the point that either of them
654
+ * collapse (i.e. they have length 0) we then handle any remaining VNode
655
+ * insertion or deletion that needs to happen to get a DOM state that correctly
656
+ * reflects the new child VNodes. If, for instance, after our window on the old
657
+ * children has collapsed we still have more nodes on the new children that
658
+ * we haven't dealt with yet then we need to add them, or if the new children
659
+ * collapse but we still have unhandled _old_ children then we need to make
660
+ * sure the corresponding DOM nodes are removed.
661
+ *
662
+ * @param parentElm the node into which the parent VNode is rendered
663
+ * @param oldCh the old children of the parent node
664
+ * @param newVNode the new VNode which will replace the parent
665
+ * @param newCh the new children of the parent node
666
+ */
667
+ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
668
+ let oldStartIdx = 0;
669
+ let newStartIdx = 0;
670
+ let idxInOld = 0;
671
+ let i = 0;
672
+ let oldEndIdx = oldCh.length - 1;
673
+ let oldStartVnode = oldCh[0];
674
+ let oldEndVnode = oldCh[oldEndIdx];
675
+ let newEndIdx = newCh.length - 1;
676
+ let newStartVnode = newCh[0];
677
+ let newEndVnode = newCh[newEndIdx];
678
+ let node;
679
+ let elmToMove;
680
+ while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
681
+ if (oldStartVnode == null) {
682
+ // VNode might have been moved left
683
+ oldStartVnode = oldCh[++oldStartIdx];
684
+ }
685
+ else if (oldEndVnode == null) {
686
+ oldEndVnode = oldCh[--oldEndIdx];
687
+ }
688
+ else if (newStartVnode == null) {
689
+ newStartVnode = newCh[++newStartIdx];
690
+ }
691
+ else if (newEndVnode == null) {
692
+ newEndVnode = newCh[--newEndIdx];
693
+ }
694
+ else if (isSameVnode(oldStartVnode, newStartVnode)) {
695
+ // if the start nodes are the same then we should patch the new VNode
696
+ // onto the old one, and increment our `newStartIdx` and `oldStartIdx`
697
+ // indices to reflect that. We don't need to move any DOM Nodes around
698
+ // since things are matched up in order.
699
+ patch(oldStartVnode, newStartVnode);
700
+ oldStartVnode = oldCh[++oldStartIdx];
701
+ newStartVnode = newCh[++newStartIdx];
702
+ }
703
+ else if (isSameVnode(oldEndVnode, newEndVnode)) {
704
+ // likewise, if the end nodes are the same we patch new onto old and
705
+ // decrement our end indices, and also likewise in this case we don't
706
+ // need to move any DOM Nodes.
707
+ patch(oldEndVnode, newEndVnode);
708
+ oldEndVnode = oldCh[--oldEndIdx];
709
+ newEndVnode = newCh[--newEndIdx];
710
+ }
711
+ else if (isSameVnode(oldStartVnode, newEndVnode)) {
712
+ patch(oldStartVnode, newEndVnode);
713
+ // We need to move the element for `oldStartVnode` into a position which
714
+ // will be appropriate for `newEndVnode`. For this we can use
715
+ // `.insertBefore` and `oldEndVnode.$elm$.nextSibling`. If there is a
716
+ // sibling for `oldEndVnode.$elm$` then we want to move the DOM node for
717
+ // `oldStartVnode` between `oldEndVnode` and it's sibling, like so:
718
+ //
719
+ // <old-start-node />
720
+ // <some-intervening-node />
721
+ // <old-end-node />
722
+ // <!-- -> <-- `oldStartVnode.$elm$` should be inserted here
723
+ // <next-sibling />
724
+ //
725
+ // If instead `oldEndVnode.$elm$` has no sibling then we just want to put
726
+ // the node for `oldStartVnode` at the end of the children of
727
+ // `parentElm`. Luckily, `Node.nextSibling` will return `null` if there
728
+ // aren't any siblings, and passing `null` to `Node.insertBefore` will
729
+ // append it to the children of the parent element.
730
+ parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
731
+ oldStartVnode = oldCh[++oldStartIdx];
732
+ newEndVnode = newCh[--newEndIdx];
733
+ }
734
+ else if (isSameVnode(oldEndVnode, newStartVnode)) {
735
+ patch(oldEndVnode, newStartVnode);
736
+ // We've already checked above if `oldStartVnode` and `newStartVnode` are
737
+ // the same node, so since we're here we know that they are not. Thus we
738
+ // can move the element for `oldEndVnode` _before_ the element for
739
+ // `oldStartVnode`, leaving `oldStartVnode` to be reconciled in the
740
+ // future.
741
+ parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
742
+ oldEndVnode = oldCh[--oldEndIdx];
743
+ newStartVnode = newCh[++newStartIdx];
744
+ }
745
+ else {
746
+ // Here we do some checks to match up old and new nodes based on the
747
+ // `$key$` attribute, which is set by putting a `key="my-key"` attribute
748
+ // in the JSX for a DOM element in the implementation of a Stencil
749
+ // component.
750
+ //
751
+ // First we check to see if there are any nodes in the array of old
752
+ // children which have the same key as the first node in the new
753
+ // children.
754
+ idxInOld = -1;
755
+ {
756
+ for (i = oldStartIdx; i <= oldEndIdx; ++i) {
757
+ if (oldCh[i] && oldCh[i].$key$ !== null && oldCh[i].$key$ === newStartVnode.$key$) {
758
+ idxInOld = i;
759
+ break;
760
+ }
761
+ }
762
+ }
763
+ if (idxInOld >= 0) {
764
+ // We found a node in the old children which matches up with the first
765
+ // node in the new children! So let's deal with that
766
+ elmToMove = oldCh[idxInOld];
767
+ if (elmToMove.$tag$ !== newStartVnode.$tag$) {
768
+ // the tag doesn't match so we'll need a new DOM element
769
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld);
770
+ }
771
+ else {
772
+ patch(elmToMove, newStartVnode);
773
+ // invalidate the matching old node so that we won't try to update it
774
+ // again later on
775
+ oldCh[idxInOld] = undefined;
776
+ node = elmToMove.$elm$;
777
+ }
778
+ newStartVnode = newCh[++newStartIdx];
779
+ }
780
+ else {
781
+ // We either didn't find an element in the old children that matches
782
+ // the key of the first new child OR the build is not using `key`
783
+ // attributes at all. In either case we need to create a new element
784
+ // for the new node.
785
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx);
786
+ newStartVnode = newCh[++newStartIdx];
787
+ }
788
+ if (node) {
789
+ // if we created a new node then handle inserting it to the DOM
790
+ {
791
+ oldStartVnode.$elm$.parentNode.insertBefore(node, oldStartVnode.$elm$);
792
+ }
793
+ }
794
+ }
795
+ }
796
+ if (oldStartIdx > oldEndIdx) {
797
+ // we have some more new nodes to add which don't match up with old nodes
798
+ addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
799
+ }
800
+ else if (newStartIdx > newEndIdx) {
801
+ // there are nodes in the `oldCh` array which no longer correspond to nodes
802
+ // in the new array, so lets remove them (which entails cleaning up the
803
+ // relevant DOM nodes)
804
+ removeVnodes(oldCh, oldStartIdx, oldEndIdx);
805
+ }
806
+ };
807
+ /**
808
+ * Compare two VNodes to determine if they are the same
809
+ *
810
+ * **NB**: This function is an equality _heuristic_ based on the available
811
+ * information set on the two VNodes and can be misleading under certain
812
+ * circumstances. In particular, if the two nodes do not have `key` attrs
813
+ * (available under `$key$` on VNodes) then the function falls back on merely
814
+ * checking that they have the same tag.
815
+ *
816
+ * So, in other words, if `key` attrs are not set on VNodes which may be
817
+ * changing order within a `children` array or something along those lines then
818
+ * we could obtain a false negative and then have to do needless re-rendering
819
+ * (i.e. we'd say two VNodes aren't equal when in fact they should be).
820
+ *
821
+ * @param leftVNode the first VNode to check
822
+ * @param rightVNode the second VNode to check
823
+ * @returns whether they're equal or not
824
+ */
825
+ const isSameVnode = (leftVNode, rightVNode) => {
826
+ // compare if two vnode to see if they're "technically" the same
827
+ // need to have the same element tag, and same key to be the same
828
+ if (leftVNode.$tag$ === rightVNode.$tag$) {
829
+ // this will be set if components in the build have `key` attrs set on them
830
+ {
831
+ return leftVNode.$key$ === rightVNode.$key$;
832
+ }
833
+ }
834
+ return false;
835
+ };
836
+ /**
837
+ * Handle reconciling an outdated VNode with a new one which corresponds to
838
+ * it. This function handles flushing updates to the DOM and reconciling the
839
+ * children of the two nodes (if any).
840
+ *
841
+ * @param oldVNode an old VNode whose DOM element and children we want to update
842
+ * @param newVNode a new VNode representing an updated version of the old one
843
+ */
844
+ const patch = (oldVNode, newVNode) => {
845
+ const elm = (newVNode.$elm$ = oldVNode.$elm$);
846
+ const oldChildren = oldVNode.$children$;
847
+ const newChildren = newVNode.$children$;
848
+ const tag = newVNode.$tag$;
849
+ const text = newVNode.$text$;
850
+ if (text === null) {
851
+ {
852
+ // test if we're rendering an svg element, or still rendering nodes inside of one
853
+ // only add this to the when the compiler sees we're using an svg somewhere
854
+ isSvgMode = tag === 'svg' ? true : tag === 'foreignObject' ? false : isSvgMode;
855
+ }
856
+ {
857
+ if (tag === 'slot')
858
+ ;
859
+ else {
860
+ // either this is the first render of an element OR it's an update
861
+ // AND we already know it's possible it could have changed
862
+ // this updates the element's css classes, attrs, props, listeners, etc.
863
+ updateElement(oldVNode, newVNode, isSvgMode);
864
+ }
865
+ }
866
+ if (oldChildren !== null && newChildren !== null) {
867
+ // looks like there's child vnodes for both the old and new vnodes
868
+ // so we need to call `updateChildren` to reconcile them
869
+ updateChildren(elm, oldChildren, newVNode, newChildren);
870
+ }
871
+ else if (newChildren !== null) {
872
+ // no old child vnodes, but there are new child vnodes to add
873
+ if (oldVNode.$text$ !== null) {
874
+ // the old vnode was text, so be sure to clear it out
875
+ elm.textContent = '';
876
+ }
877
+ // add the new vnode children
878
+ addVnodes(elm, null, newVNode, newChildren, 0, newChildren.length - 1);
879
+ }
880
+ else if (oldChildren !== null) {
881
+ // no new child vnodes, but there are old child vnodes to remove
882
+ removeVnodes(oldChildren, 0, oldChildren.length - 1);
883
+ }
884
+ if (isSvgMode && tag === 'svg') {
885
+ isSvgMode = false;
886
+ }
887
+ }
888
+ else if (oldVNode.$text$ !== text) {
889
+ // update the text content for the text only vnode
890
+ // and also only if the text is different than before
891
+ elm.data = text;
892
+ }
893
+ };
894
+ const callNodeRefs = (vNode) => {
895
+ {
896
+ vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
897
+ vNode.$children$ && vNode.$children$.map(callNodeRefs);
898
+ }
899
+ };
900
+ /**
901
+ * The main entry point for Stencil's virtual DOM-based rendering engine
902
+ *
903
+ * Given a {@link d.HostRef} container and some virtual DOM nodes, this
904
+ * function will handle creating a virtual DOM tree with a single root, patching
905
+ * the current virtual DOM tree onto an old one (if any), dealing with slot
906
+ * relocation, and reflecting attributes.
907
+ *
908
+ * @param hostRef data needed to root and render the virtual DOM tree, such as
909
+ * the DOM node into which it should be rendered.
910
+ * @param renderFnResults the virtual DOM nodes to be rendered
911
+ */
912
+ const renderVdom = (hostRef, renderFnResults) => {
913
+ const hostElm = hostRef.$hostElement$;
914
+ const cmpMeta = hostRef.$cmpMeta$;
915
+ const oldVNode = hostRef.$vnode$ || newVNode(null, null);
916
+ const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
917
+ hostTagName = hostElm.tagName;
918
+ if (cmpMeta.$attrsToReflect$) {
919
+ rootVnode.$attrs$ = rootVnode.$attrs$ || {};
920
+ cmpMeta.$attrsToReflect$.map(([propName, attribute]) => (rootVnode.$attrs$[attribute] = hostElm[propName]));
921
+ }
922
+ rootVnode.$tag$ = null;
923
+ rootVnode.$flags$ |= 4 /* VNODE_FLAGS.isHost */;
924
+ hostRef.$vnode$ = rootVnode;
925
+ rootVnode.$elm$ = oldVNode.$elm$ = (hostElm.shadowRoot || hostElm );
926
+ {
927
+ scopeId = hostElm['s-sc'];
928
+ }
929
+ // synchronous patch
930
+ patch(oldVNode, rootVnode);
931
+ };
932
+ const attachToAncestor = (hostRef, ancestorComponent) => {
933
+ if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
934
+ ancestorComponent['s-p'].push(new Promise((r) => (hostRef.$onRenderResolve$ = r)));
935
+ }
936
+ };
937
+ const scheduleUpdate = (hostRef, isInitialLoad) => {
938
+ {
939
+ hostRef.$flags$ |= 16 /* HOST_FLAGS.isQueuedForUpdate */;
940
+ }
941
+ if (hostRef.$flags$ & 4 /* HOST_FLAGS.isWaitingForChildren */) {
942
+ hostRef.$flags$ |= 512 /* HOST_FLAGS.needsRerender */;
943
+ return;
944
+ }
945
+ attachToAncestor(hostRef, hostRef.$ancestorComponent$);
946
+ // there is no ancestor component or the ancestor component
947
+ // has already fired off its lifecycle update then
948
+ // fire off the initial update
949
+ const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
950
+ return writeTask(dispatch) ;
951
+ };
952
+ const dispatchHooks = (hostRef, isInitialLoad) => {
953
+ const endSchedule = createTime('scheduleUpdate', hostRef.$cmpMeta$.$tagName$);
954
+ const instance = hostRef.$lazyInstance$ ;
955
+ let promise;
956
+ if (isInitialLoad) {
957
+ {
958
+ promise = safeCall(instance, 'componentWillLoad');
959
+ }
960
+ }
961
+ endSchedule();
962
+ return then(promise, () => updateComponent(hostRef, instance, isInitialLoad));
963
+ };
964
+ const updateComponent = async (hostRef, instance, isInitialLoad) => {
965
+ // updateComponent
966
+ const elm = hostRef.$hostElement$;
967
+ const endUpdate = createTime('update', hostRef.$cmpMeta$.$tagName$);
968
+ const rc = elm['s-rc'];
969
+ if (isInitialLoad) {
970
+ // DOM WRITE!
971
+ attachStyles(hostRef);
972
+ }
973
+ const endRender = createTime('render', hostRef.$cmpMeta$.$tagName$);
974
+ {
975
+ callRender(hostRef, instance);
976
+ }
977
+ if (rc) {
978
+ // ok, so turns out there are some child host elements
979
+ // waiting on this parent element to load
980
+ // let's fire off all update callbacks waiting
981
+ rc.map((cb) => cb());
982
+ elm['s-rc'] = undefined;
983
+ }
984
+ endRender();
985
+ endUpdate();
986
+ {
987
+ const childrenPromises = elm['s-p'];
988
+ const postUpdate = () => postUpdateComponent(hostRef);
989
+ if (childrenPromises.length === 0) {
990
+ postUpdate();
991
+ }
992
+ else {
993
+ Promise.all(childrenPromises).then(postUpdate);
994
+ hostRef.$flags$ |= 4 /* HOST_FLAGS.isWaitingForChildren */;
995
+ childrenPromises.length = 0;
996
+ }
997
+ }
998
+ };
999
+ const callRender = (hostRef, instance, elm) => {
1000
+ try {
1001
+ instance = instance.render() ;
1002
+ {
1003
+ hostRef.$flags$ &= ~16 /* HOST_FLAGS.isQueuedForUpdate */;
1004
+ }
1005
+ {
1006
+ hostRef.$flags$ |= 2 /* HOST_FLAGS.hasRendered */;
1007
+ }
1008
+ {
1009
+ {
1010
+ // looks like we've got child nodes to render into this host element
1011
+ // or we need to update the css class/attrs on the host element
1012
+ // DOM WRITE!
1013
+ {
1014
+ renderVdom(hostRef, instance);
1015
+ }
1016
+ }
1017
+ }
1018
+ }
1019
+ catch (e) {
1020
+ consoleError(e, hostRef.$hostElement$);
1021
+ }
1022
+ return null;
1023
+ };
1024
+ const postUpdateComponent = (hostRef) => {
1025
+ const tagName = hostRef.$cmpMeta$.$tagName$;
1026
+ const elm = hostRef.$hostElement$;
1027
+ const endPostUpdate = createTime('postUpdate', tagName);
1028
+ const instance = hostRef.$lazyInstance$ ;
1029
+ const ancestorComponent = hostRef.$ancestorComponent$;
1030
+ {
1031
+ safeCall(instance, 'componentDidRender');
1032
+ }
1033
+ if (!(hostRef.$flags$ & 64 /* HOST_FLAGS.hasLoadedComponent */)) {
1034
+ hostRef.$flags$ |= 64 /* HOST_FLAGS.hasLoadedComponent */;
1035
+ {
1036
+ // DOM WRITE!
1037
+ addHydratedFlag(elm);
1038
+ }
1039
+ {
1040
+ safeCall(instance, 'componentDidLoad');
1041
+ }
1042
+ endPostUpdate();
1043
+ {
1044
+ hostRef.$onReadyResolve$(elm);
1045
+ if (!ancestorComponent) {
1046
+ appDidLoad();
1047
+ }
1048
+ }
1049
+ }
1050
+ else {
1051
+ endPostUpdate();
1052
+ }
1053
+ {
1054
+ hostRef.$onInstanceResolve$(elm);
1055
+ }
1056
+ // load events fire from bottom to top
1057
+ // the deepest elements load first then bubbles up
1058
+ {
1059
+ if (hostRef.$onRenderResolve$) {
1060
+ hostRef.$onRenderResolve$();
1061
+ hostRef.$onRenderResolve$ = undefined;
1062
+ }
1063
+ if (hostRef.$flags$ & 512 /* HOST_FLAGS.needsRerender */) {
1064
+ nextTick(() => scheduleUpdate(hostRef, false));
1065
+ }
1066
+ hostRef.$flags$ &= ~(4 /* HOST_FLAGS.isWaitingForChildren */ | 512 /* HOST_FLAGS.needsRerender */);
1067
+ }
1068
+ // ( •_•)
1069
+ // ( •_•)>⌐■-■
1070
+ // (⌐■_■)
1071
+ };
1072
+ const appDidLoad = (who) => {
1073
+ // on appload
1074
+ // we have finish the first big initial render
1075
+ {
1076
+ addHydratedFlag(doc.documentElement);
1077
+ }
1078
+ nextTick(() => emitEvent(win, 'appload', { detail: { namespace: NAMESPACE } }));
1079
+ };
1080
+ const safeCall = (instance, method, arg) => {
1081
+ if (instance && instance[method]) {
1082
+ try {
1083
+ return instance[method](arg);
1084
+ }
1085
+ catch (e) {
1086
+ consoleError(e);
1087
+ }
1088
+ }
1089
+ return undefined;
1090
+ };
1091
+ const then = (promise, thenFn) => {
1092
+ return promise && promise.then ? promise.then(thenFn) : thenFn();
1093
+ };
1094
+ const addHydratedFlag = (elm) => elm.classList.add('hydrated')
1095
+ ;
1096
+ const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
1097
+ const setValue = (ref, propName, newVal, cmpMeta) => {
1098
+ // check our new property value against our internal value
1099
+ const hostRef = getHostRef(ref);
1100
+ const oldVal = hostRef.$instanceValues$.get(propName);
1101
+ const flags = hostRef.$flags$;
1102
+ const instance = hostRef.$lazyInstance$ ;
1103
+ newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
1104
+ // explicitly check for NaN on both sides, as `NaN === NaN` is always false
1105
+ const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
1106
+ const didValueChange = newVal !== oldVal && !areBothNaN;
1107
+ if ((!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) || oldVal === undefined) && didValueChange) {
1108
+ // gadzooks! the property's value has changed!!
1109
+ // set our new value!
1110
+ hostRef.$instanceValues$.set(propName, newVal);
1111
+ if (instance) {
1112
+ if ((flags & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
1113
+ // looks like this value actually changed, so we've got work to do!
1114
+ // but only if we've already rendered, otherwise just chill out
1115
+ // queue that we need to do an update, but don't worry about queuing
1116
+ // up millions cuz this function ensures it only runs once
1117
+ scheduleUpdate(hostRef, false);
1118
+ }
1119
+ }
1120
+ }
1121
+ };
1122
+ /**
1123
+ * Attach a series of runtime constructs to a compiled Stencil component
1124
+ * constructor, including getters and setters for the `@Prop` and `@State`
1125
+ * decorators, callbacks for when attributes change, and so on.
1126
+ *
1127
+ * @param Cstr the constructor for a component that we need to process
1128
+ * @param cmpMeta metadata collected previously about the component
1129
+ * @param flags a number used to store a series of bit flags
1130
+ * @returns a reference to the same constructor passed in (but now mutated)
1131
+ */
1132
+ const proxyComponent = (Cstr, cmpMeta, flags) => {
1133
+ if (cmpMeta.$members$) {
1134
+ // It's better to have a const than two Object.entries()
1135
+ const members = Object.entries(cmpMeta.$members$);
1136
+ const prototype = Cstr.prototype;
1137
+ members.map(([memberName, [memberFlags]]) => {
1138
+ if ((memberFlags & 31 /* MEMBER_FLAGS.Prop */ ||
1139
+ ((flags & 2 /* PROXY_FLAGS.proxyState */) && memberFlags & 32 /* MEMBER_FLAGS.State */))) {
1140
+ // proxyComponent - prop
1141
+ Object.defineProperty(prototype, memberName, {
1142
+ get() {
1143
+ // proxyComponent, get value
1144
+ return getValue(this, memberName);
1145
+ },
1146
+ set(newValue) {
1147
+ // proxyComponent, set value
1148
+ setValue(this, memberName, newValue, cmpMeta);
1149
+ },
1150
+ configurable: true,
1151
+ enumerable: true,
1152
+ });
1153
+ }
1154
+ else if (flags & 1 /* PROXY_FLAGS.isElementConstructor */ &&
1155
+ memberFlags & 64 /* MEMBER_FLAGS.Method */) {
1156
+ // proxyComponent - method
1157
+ Object.defineProperty(prototype, memberName, {
1158
+ value(...args) {
1159
+ const ref = getHostRef(this);
1160
+ return ref.$onInstancePromise$.then(() => ref.$lazyInstance$[memberName](...args));
1161
+ },
1162
+ });
1163
+ }
1164
+ });
1165
+ if ((flags & 1 /* PROXY_FLAGS.isElementConstructor */)) {
1166
+ const attrNameToPropName = new Map();
1167
+ prototype.attributeChangedCallback = function (attrName, _oldValue, newValue) {
1168
+ plt.jmp(() => {
1169
+ const propName = attrNameToPropName.get(attrName);
1170
+ // In a web component lifecycle the attributeChangedCallback runs prior to connectedCallback
1171
+ // in the case where an attribute was set inline.
1172
+ // ```html
1173
+ // <my-component some-attribute="some-value"></my-component>
1174
+ // ```
1175
+ //
1176
+ // There is an edge case where a developer sets the attribute inline on a custom element and then
1177
+ // programmatically changes it before it has been upgraded as shown below:
1178
+ //
1179
+ // ```html
1180
+ // <!-- this component has _not_ been upgraded yet -->
1181
+ // <my-component id="test" some-attribute="some-value"></my-component>
1182
+ // <script>
1183
+ // // grab non-upgraded component
1184
+ // el = document.querySelector("#test");
1185
+ // el.someAttribute = "another-value";
1186
+ // // upgrade component
1187
+ // customElements.define('my-component', MyComponent);
1188
+ // </script>
1189
+ // ```
1190
+ // In this case if we do not unshadow here and use the value of the shadowing property, attributeChangedCallback
1191
+ // will be called with `newValue = "some-value"` and will set the shadowed property (this.someAttribute = "another-value")
1192
+ // to the value that was set inline i.e. "some-value" from above example. When
1193
+ // the connectedCallback attempts to unshadow it will use "some-value" as the initial value rather than "another-value"
1194
+ //
1195
+ // The case where the attribute was NOT set inline but was not set programmatically shall be handled/unshadowed
1196
+ // by connectedCallback as this attributeChangedCallback will not fire.
1197
+ //
1198
+ // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
1199
+ //
1200
+ // TODO(STENCIL-16) we should think about whether or not we actually want to be reflecting the attributes to
1201
+ // properties here given that this goes against best practices outlined here
1202
+ // https://developers.google.com/web/fundamentals/web-components/best-practices#avoid-reentrancy
1203
+ if (this.hasOwnProperty(propName)) {
1204
+ newValue = this[propName];
1205
+ delete this[propName];
1206
+ }
1207
+ else if (prototype.hasOwnProperty(propName) &&
1208
+ typeof this[propName] === 'number' &&
1209
+ this[propName] == newValue) {
1210
+ // if the propName exists on the prototype of `Cstr`, this update may be a result of Stencil using native
1211
+ // APIs to reflect props as attributes. Calls to `setAttribute(someElement, propName)` will result in
1212
+ // `propName` to be converted to a `DOMString`, which may not be what we want for other primitive props.
1213
+ return;
1214
+ }
1215
+ this[propName] = newValue === null && typeof this[propName] === 'boolean' ? false : newValue;
1216
+ });
1217
+ };
1218
+ // create an array of attributes to observe
1219
+ // and also create a map of html attribute name to js property name
1220
+ Cstr.observedAttributes = members
1221
+ .filter(([_, m]) => m[0] & 15 /* MEMBER_FLAGS.HasAttribute */) // filter to only keep props that should match attributes
1222
+ .map(([propName, m]) => {
1223
+ const attrName = m[1] || propName;
1224
+ attrNameToPropName.set(attrName, propName);
1225
+ if (m[0] & 512 /* MEMBER_FLAGS.ReflectAttr */) {
1226
+ cmpMeta.$attrsToReflect$.push([propName, attrName]);
1227
+ }
1228
+ return attrName;
1229
+ });
1230
+ }
1231
+ }
1232
+ return Cstr;
1233
+ };
1234
+ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
1235
+ // initializeComponent
1236
+ if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
1237
+ {
1238
+ // we haven't initialized this element yet
1239
+ hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
1240
+ // lazy loaded components
1241
+ // request the component's implementation to be
1242
+ // wired up with the host element
1243
+ Cstr = loadModule(cmpMeta);
1244
+ if (Cstr.then) {
1245
+ // Await creates a micro-task avoid if possible
1246
+ const endLoad = uniqueTime();
1247
+ Cstr = await Cstr;
1248
+ endLoad();
1249
+ }
1250
+ if (!Cstr.isProxied) {
1251
+ proxyComponent(Cstr, cmpMeta, 2 /* PROXY_FLAGS.proxyState */);
1252
+ Cstr.isProxied = true;
1253
+ }
1254
+ const endNewInstance = createTime('createInstance', cmpMeta.$tagName$);
1255
+ // ok, time to construct the instance
1256
+ // but let's keep track of when we start and stop
1257
+ // so that the getters/setters don't incorrectly step on data
1258
+ {
1259
+ hostRef.$flags$ |= 8 /* HOST_FLAGS.isConstructingInstance */;
1260
+ }
1261
+ // construct the lazy-loaded component implementation
1262
+ // passing the hostRef is very important during
1263
+ // construction in order to directly wire together the
1264
+ // host element and the lazy-loaded instance
1265
+ try {
1266
+ new Cstr(hostRef);
1267
+ }
1268
+ catch (e) {
1269
+ consoleError(e);
1270
+ }
1271
+ {
1272
+ hostRef.$flags$ &= ~8 /* HOST_FLAGS.isConstructingInstance */;
1273
+ }
1274
+ endNewInstance();
1275
+ fireConnectedCallback(hostRef.$lazyInstance$);
1276
+ }
1277
+ if (Cstr.style) {
1278
+ // this component has styles but we haven't registered them yet
1279
+ let style = Cstr.style;
1280
+ const scopeId = getScopeId(cmpMeta);
1281
+ if (!styles.has(scopeId)) {
1282
+ const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
1283
+ registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */));
1284
+ endRegisterStyles();
1285
+ }
1286
+ }
1287
+ }
1288
+ // we've successfully created a lazy instance
1289
+ const ancestorComponent = hostRef.$ancestorComponent$;
1290
+ const schedule = () => scheduleUpdate(hostRef, true);
1291
+ if (ancestorComponent && ancestorComponent['s-rc']) {
1292
+ // this is the initial load and this component it has an ancestor component
1293
+ // but the ancestor component has NOT fired its will update lifecycle yet
1294
+ // so let's just cool our jets and wait for the ancestor to continue first
1295
+ // this will get fired off when the ancestor component
1296
+ // finally gets around to rendering its lazy self
1297
+ // fire off the initial update
1298
+ ancestorComponent['s-rc'].push(schedule);
1299
+ }
1300
+ else {
1301
+ schedule();
1302
+ }
1303
+ };
1304
+ const fireConnectedCallback = (instance) => {
1305
+ {
1306
+ safeCall(instance, 'connectedCallback');
1307
+ }
1308
+ };
1309
+ const connectedCallback = (elm) => {
1310
+ if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
1311
+ const hostRef = getHostRef(elm);
1312
+ const cmpMeta = hostRef.$cmpMeta$;
1313
+ const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
1314
+ if (!(hostRef.$flags$ & 1 /* HOST_FLAGS.hasConnected */)) {
1315
+ // first time this component has connected
1316
+ hostRef.$flags$ |= 1 /* HOST_FLAGS.hasConnected */;
1317
+ {
1318
+ // find the first ancestor component (if there is one) and register
1319
+ // this component as one of the actively loading child components for its ancestor
1320
+ let ancestorComponent = elm;
1321
+ while ((ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host)) {
1322
+ // climb up the ancestors looking for the first
1323
+ // component that hasn't finished its lifecycle update yet
1324
+ if (ancestorComponent['s-p']) {
1325
+ // we found this components first ancestor component
1326
+ // keep a reference to this component's ancestor component
1327
+ attachToAncestor(hostRef, (hostRef.$ancestorComponent$ = ancestorComponent));
1328
+ break;
1329
+ }
1330
+ }
1331
+ }
1332
+ // Lazy properties
1333
+ // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
1334
+ if (cmpMeta.$members$) {
1335
+ Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
1336
+ if (memberFlags & 31 /* MEMBER_FLAGS.Prop */ && elm.hasOwnProperty(memberName)) {
1337
+ const value = elm[memberName];
1338
+ delete elm[memberName];
1339
+ elm[memberName] = value;
1340
+ }
1341
+ });
1342
+ }
1343
+ {
1344
+ initializeComponent(elm, hostRef, cmpMeta);
1345
+ }
1346
+ }
1347
+ else {
1348
+ // fire off connectedCallback() on component instance
1349
+ fireConnectedCallback(hostRef.$lazyInstance$);
1350
+ }
1351
+ endConnected();
1352
+ }
1353
+ };
1354
+ const disconnectedCallback = (elm) => {
1355
+ if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
1356
+ const hostRef = getHostRef(elm);
1357
+ const instance = hostRef.$lazyInstance$ ;
1358
+ {
1359
+ safeCall(instance, 'disconnectedCallback');
1360
+ }
1361
+ }
1362
+ };
1363
+ const bootstrapLazy = (lazyBundles, options = {}) => {
1364
+ var _a;
1365
+ const endBootstrap = createTime();
1366
+ const cmpTags = [];
1367
+ const exclude = options.exclude || [];
1368
+ const customElements = win.customElements;
1369
+ const head = doc.head;
1370
+ const metaCharset = /*@__PURE__*/ head.querySelector('meta[charset]');
1371
+ const visibilityStyle = /*@__PURE__*/ doc.createElement('style');
1372
+ const deferredConnectedCallbacks = [];
1373
+ let appLoadFallback;
1374
+ let isBootstrapping = true;
1375
+ Object.assign(plt, options);
1376
+ plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
1377
+ lazyBundles.map((lazyBundle) => {
1378
+ lazyBundle[1].map((compactMeta) => {
1379
+ const cmpMeta = {
1380
+ $flags$: compactMeta[0],
1381
+ $tagName$: compactMeta[1],
1382
+ $members$: compactMeta[2],
1383
+ $listeners$: compactMeta[3],
1384
+ };
1385
+ {
1386
+ cmpMeta.$members$ = compactMeta[2];
1387
+ }
1388
+ {
1389
+ cmpMeta.$attrsToReflect$ = [];
1390
+ }
1391
+ const tagName = cmpMeta.$tagName$;
1392
+ const HostElement = class extends HTMLElement {
1393
+ // StencilLazyHost
1394
+ constructor(self) {
1395
+ // @ts-ignore
1396
+ super(self);
1397
+ self = this;
1398
+ registerHost(self, cmpMeta);
1399
+ if (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
1400
+ // this component is using shadow dom
1401
+ // and this browser supports shadow dom
1402
+ // add the read-only property "shadowRoot" to the host element
1403
+ // adding the shadow root build conditionals to minimize runtime
1404
+ {
1405
+ {
1406
+ self.attachShadow({ mode: 'open' });
1407
+ }
1408
+ }
1409
+ }
1410
+ }
1411
+ connectedCallback() {
1412
+ if (appLoadFallback) {
1413
+ clearTimeout(appLoadFallback);
1414
+ appLoadFallback = null;
1415
+ }
1416
+ if (isBootstrapping) {
1417
+ // connectedCallback will be processed once all components have been registered
1418
+ deferredConnectedCallbacks.push(this);
1419
+ }
1420
+ else {
1421
+ plt.jmp(() => connectedCallback(this));
1422
+ }
1423
+ }
1424
+ disconnectedCallback() {
1425
+ plt.jmp(() => disconnectedCallback(this));
1426
+ }
1427
+ componentOnReady() {
1428
+ return getHostRef(this).$onReadyPromise$;
1429
+ }
1430
+ };
1431
+ cmpMeta.$lazyBundleId$ = lazyBundle[0];
1432
+ if (!exclude.includes(tagName) && !customElements.get(tagName)) {
1433
+ cmpTags.push(tagName);
1434
+ customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* PROXY_FLAGS.isElementConstructor */));
1435
+ }
1436
+ });
1437
+ });
1438
+ {
1439
+ visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;
1440
+ visibilityStyle.setAttribute('data-styles', '');
1441
+ // Apply CSP nonce to the style tag if it exists
1442
+ const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
1443
+ if (nonce != null) {
1444
+ visibilityStyle.setAttribute('nonce', nonce);
1445
+ }
1446
+ head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild);
1447
+ }
1448
+ // Process deferred connectedCallbacks now all components have been registered
1449
+ isBootstrapping = false;
1450
+ if (deferredConnectedCallbacks.length) {
1451
+ deferredConnectedCallbacks.map((host) => host.connectedCallback());
1452
+ }
1453
+ else {
1454
+ {
1455
+ plt.jmp(() => (appLoadFallback = setTimeout(appDidLoad, 30)));
1456
+ }
1457
+ }
1458
+ // Fallback appLoad event
1459
+ endBootstrap();
1460
+ };
1461
+ /**
1462
+ * Assigns the given value to the nonce property on the runtime platform object.
1463
+ * During runtime, this value is used to set the nonce attribute on all dynamically created script and style tags.
1464
+ * @param nonce The value to be assigned to the platform nonce property.
1465
+ * @returns void
1466
+ */
1467
+ const setNonce = (nonce) => (plt.$nonce$ = nonce);
1468
+ const hostRefs = /*@__PURE__*/ new WeakMap();
1469
+ const getHostRef = (ref) => hostRefs.get(ref);
1470
+ const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
1471
+ const registerHost = (elm, cmpMeta) => {
1472
+ const hostRef = {
1473
+ $flags$: 0,
1474
+ $hostElement$: elm,
1475
+ $cmpMeta$: cmpMeta,
1476
+ $instanceValues$: new Map(),
1477
+ };
1478
+ {
1479
+ hostRef.$onInstancePromise$ = new Promise((r) => (hostRef.$onInstanceResolve$ = r));
1480
+ }
1481
+ {
1482
+ hostRef.$onReadyPromise$ = new Promise((r) => (hostRef.$onReadyResolve$ = r));
1483
+ elm['s-p'] = [];
1484
+ elm['s-rc'] = [];
1485
+ }
1486
+ return hostRefs.set(elm, hostRef);
1487
+ };
1488
+ const isMemberInElement = (elm, memberName) => memberName in elm;
1489
+ const consoleError = (e, el) => (0, console.error)(e, el);
1490
+ const cmpModules = /*@__PURE__*/ new Map();
1491
+ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
1492
+ // loadModuleImport
1493
+ const exportName = cmpMeta.$tagName$.replace(/-/g, '_');
1494
+ const bundleId = cmpMeta.$lazyBundleId$;
1495
+ const module = cmpModules.get(bundleId) ;
1496
+ if (module) {
1497
+ return module[exportName];
1498
+ }
1499
+ /*!__STENCIL_STATIC_IMPORT_SWITCH__*/
1500
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
1501
+ /* @vite-ignore */
1502
+ /* webpackInclude: /\.entry\.js$/ */
1503
+ /* webpackExclude: /\.system\.entry\.js$/ */
1504
+ /* webpackMode: "lazy" */
1505
+ `./${bundleId}.entry.js${''}`)); }).then((importedModule) => {
1506
+ {
1507
+ cmpModules.set(bundleId, importedModule);
1508
+ }
1509
+ return importedModule[exportName];
1510
+ }, consoleError);
1511
+ };
1512
+ const styles = /*@__PURE__*/ new Map();
1513
+ const win = typeof window !== 'undefined' ? window : {};
1514
+ const doc = win.document || { head: {} };
1515
+ const plt = {
1516
+ $flags$: 0,
1517
+ $resourcesUrl$: '',
1518
+ jmp: (h) => h(),
1519
+ raf: (h) => requestAnimationFrame(h),
1520
+ ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
1521
+ rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
1522
+ ce: (eventName, opts) => new CustomEvent(eventName, opts),
1523
+ };
1524
+ const promiseResolve = (v) => Promise.resolve(v);
1525
+ const supportsConstructableStylesheets = /*@__PURE__*/ (() => {
1526
+ try {
1527
+ new CSSStyleSheet();
1528
+ return typeof new CSSStyleSheet().replaceSync === 'function';
1529
+ }
1530
+ catch (e) { }
1531
+ return false;
1532
+ })()
1533
+ ;
1534
+ const queueDomReads = [];
1535
+ const queueDomWrites = [];
1536
+ const queueTask = (queue, write) => (cb) => {
1537
+ queue.push(cb);
1538
+ if (!queuePending) {
1539
+ queuePending = true;
1540
+ if (write && plt.$flags$ & 4 /* PLATFORM_FLAGS.queueSync */) {
1541
+ nextTick(flush);
1542
+ }
1543
+ else {
1544
+ plt.raf(flush);
1545
+ }
1546
+ }
1547
+ };
1548
+ const consume = (queue) => {
1549
+ for (let i = 0; i < queue.length; i++) {
1550
+ try {
1551
+ queue[i](performance.now());
1552
+ }
1553
+ catch (e) {
1554
+ consoleError(e);
1555
+ }
1556
+ }
1557
+ queue.length = 0;
1558
+ };
1559
+ const flush = () => {
1560
+ // always force a bunch of medium callbacks to run, but still have
1561
+ // a throttle on how many can run in a certain time
1562
+ // DOM READS!!!
1563
+ consume(queueDomReads);
1564
+ // DOM WRITES!!!
1565
+ {
1566
+ consume(queueDomWrites);
1567
+ if ((queuePending = queueDomReads.length > 0)) {
1568
+ // still more to do yet, but we've run out of time
1569
+ // let's let this thing cool off and try again in the next tick
1570
+ plt.raf(flush);
1571
+ }
1572
+ }
1573
+ };
1574
+ const nextTick = /*@__PURE__*/ (cb) => promiseResolve().then(cb);
1575
+ const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
1576
+
1577
+ exports.Host = Host;
1578
+ exports.bootstrapLazy = bootstrapLazy;
1579
+ exports.createEvent = createEvent;
1580
+ exports.getElement = getElement;
1581
+ exports.h = h;
1582
+ exports.promiseResolve = promiseResolve;
1583
+ exports.registerInstance = registerInstance;
1584
+ exports.setNonce = setNonce;