@watermarkinsights/ripple 3.0.1-0 → 3.0.2-0

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