@watermarkinsights/ripple 5.3.0-0 → 5.3.0-2

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 (363) hide show
  1. package/dist/cjs/{chartFunctions-9075d687.js → chartFunctions-246529c5.js} +3 -3
  2. package/dist/cjs/{functions-b73604c3.js → functions-be4156cf.js} +7 -104
  3. package/dist/{esm/app-globals-0c592c57.js → cjs/global-6b1a23e9.js} +2 -7
  4. package/dist/cjs/index-f8ef86de.js +2582 -0
  5. package/dist/cjs/{intl-b20d5420.js → intl-a13884e8.js} +1 -1
  6. package/dist/cjs/loader.cjs.js +3 -4
  7. package/dist/cjs/priv-calendar.cjs.entry.js +5 -6
  8. package/dist/cjs/priv-chart-popover.cjs.entry.js +5 -6
  9. package/dist/cjs/priv-navigator-button.cjs.entry.js +3 -4
  10. package/dist/cjs/priv-navigator-item.cjs.entry.js +3 -4
  11. package/dist/cjs/ripple.cjs.js +11 -12
  12. package/dist/cjs/wm-action-menu_2.cjs.entry.js +6 -8
  13. package/dist/cjs/wm-button.cjs.entry.js +4 -5
  14. package/dist/cjs/wm-chart-slice.cjs.entry.js +1 -1
  15. package/dist/cjs/wm-chart.cjs.entry.js +6 -7
  16. package/dist/cjs/wm-date-range.cjs.entry.js +7 -8
  17. package/dist/cjs/wm-datepicker.cjs.entry.js +7 -8
  18. package/dist/cjs/wm-file-list.cjs.entry.js +3 -4
  19. package/dist/cjs/wm-file.cjs.entry.js +4 -5
  20. package/dist/cjs/wm-input.cjs.entry.js +5 -6
  21. package/dist/cjs/wm-line-chart.cjs.entry.js +14 -15
  22. package/dist/cjs/wm-modal-footer.cjs.entry.js +3 -4
  23. package/dist/cjs/wm-modal-header.cjs.entry.js +5 -6
  24. package/dist/cjs/wm-modal.cjs.entry.js +5 -6
  25. package/dist/cjs/wm-navigation_3.cjs.entry.js +10 -13
  26. package/dist/cjs/wm-navigator.cjs.entry.js +3 -4
  27. package/dist/cjs/wm-option_2.cjs.entry.js +8 -10
  28. package/dist/cjs/wm-pagination.cjs.entry.js +4 -5
  29. package/dist/cjs/wm-progress-indicator_3.cjs.entry.js +7 -9
  30. package/dist/cjs/wm-search.cjs.entry.js +6 -7
  31. package/dist/cjs/wm-snackbar.cjs.entry.js +69 -35
  32. package/dist/cjs/wm-tab-item_3.cjs.entry.js +8 -11
  33. package/dist/cjs/wm-tag-input.cjs.entry.js +7 -8
  34. package/dist/cjs/wm-tag-option.cjs.entry.js +2 -2
  35. package/dist/cjs/wm-textarea.cjs.entry.js +5 -6
  36. package/dist/cjs/wm-timepicker.cjs.entry.js +5 -6
  37. package/dist/cjs/wm-toggletip.cjs.entry.js +5 -6
  38. package/dist/cjs/wm-uploader.cjs.entry.js +6 -7
  39. package/dist/cjs/wm-wrapper.cjs.entry.js +1 -1
  40. package/dist/collection/collection-manifest.json +2 -2
  41. package/dist/collection/components/charts/chartFunctions.js +1 -1
  42. package/dist/collection/components/charts/chartFunctions.spec.js +16 -0
  43. package/dist/collection/components/charts/priv-chart-popover/priv-chart-popover.e2e.js +81 -0
  44. package/dist/collection/components/charts/priv-chart-popover/priv-chart-popover.js +2 -2
  45. package/dist/collection/components/charts/screenshots.e2e.js +96 -0
  46. package/dist/collection/components/charts/wm-chart/wm-chart.e2e.js +213 -0
  47. package/dist/collection/components/charts/wm-chart/wm-chart.js +1 -1
  48. package/dist/collection/components/charts/wm-chart/wm-chart.spec.js +37 -0
  49. package/dist/collection/components/charts/wm-line-chart/wm-line-chart.e2e.js +176 -0
  50. package/dist/collection/components/charts/wm-line-chart/wm-line-chart.js +9 -9
  51. package/dist/collection/components/charts/wm-line-chart/wm-line-chart.spec.js +163 -0
  52. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-indicator.js +1 -1
  53. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.e2e.js +69 -0
  54. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.js +1 -1
  55. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.spec.js +79 -0
  56. package/dist/collection/components/datepickers/priv-calendar/priv-calendar.js +2 -2
  57. package/dist/collection/components/datepickers/priv-calendar/priv-calendar.spec.js +89 -0
  58. package/dist/collection/components/datepickers/wm-date-range.e2e.js +443 -0
  59. package/dist/collection/components/datepickers/wm-date-range.js +12 -16
  60. package/dist/collection/components/datepickers/wm-date-range.spec.js +22 -0
  61. package/dist/collection/components/datepickers/wm-datepicker.e2e.js +382 -0
  62. package/dist/collection/components/datepickers/wm-datepicker.js +12 -16
  63. package/dist/collection/components/datepickers/wm-datepicker.spec.js +21 -0
  64. package/dist/collection/components/wm-action-menu/wm-action-menu.e2e.js +200 -0
  65. package/dist/collection/components/wm-action-menu/wm-action-menu.js +1 -1
  66. package/dist/collection/components/wm-action-menu/wm-action-menu.spec.js +48 -0
  67. package/dist/collection/components/wm-button/wm-button.e2e.js +55 -0
  68. package/dist/collection/components/wm-button/wm-button.js +1 -1
  69. package/dist/collection/components/wm-button/wm-button.spec.js +74 -0
  70. package/dist/collection/components/wm-file/wm-file.js +1 -1
  71. package/dist/collection/components/wm-file/wm-file.spec.js +194 -0
  72. package/dist/collection/components/wm-file-list/wm-file-list.js +1 -1
  73. package/dist/collection/components/wm-file-list/wm-file-list.spec.js +69 -0
  74. package/dist/collection/components/wm-input/wm-input.e2e.js +32 -0
  75. package/dist/collection/components/wm-input/wm-input.js +1 -1
  76. package/dist/collection/components/wm-input/wm-input.spec.js +173 -0
  77. package/dist/collection/components/wm-menuitem/wm-menuitem.e2e.js +23 -0
  78. package/dist/collection/components/wm-menuitem/wm-menuitem.js +1 -1
  79. package/dist/collection/components/wm-menuitem/wm-menuitem.spec.js +54 -0
  80. package/dist/collection/components/wm-modal/wm-modal-footer.js +1 -1
  81. package/dist/collection/components/wm-modal/wm-modal-footer.spec.js +11 -0
  82. package/dist/collection/components/wm-modal/wm-modal-header.js +1 -1
  83. package/dist/collection/components/wm-modal/wm-modal-header.spec.js +8 -0
  84. package/dist/collection/components/wm-modal/wm-modal.e2e.js +104 -0
  85. package/dist/collection/components/wm-modal/wm-modal.js +2 -2
  86. package/dist/collection/components/wm-modal/wm-modal.spec.js +30 -0
  87. package/dist/collection/components/wm-navigation/wm-navigation-hamburger.js +1 -1
  88. package/dist/collection/components/wm-navigation/wm-navigation-item.js +1 -1
  89. package/dist/collection/components/wm-navigation/wm-navigation.e2e.js +102 -0
  90. package/dist/collection/components/wm-navigation/wm-navigation.js +2 -2
  91. package/dist/collection/components/wm-navigation/wm-navigation.spec.js +91 -0
  92. package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.e2e.js +50 -0
  93. package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.js +1 -1
  94. package/dist/collection/components/wm-navigator/priv-navigator-item/priv-navigator-item.js +1 -1
  95. package/dist/collection/components/wm-navigator/wm-navigator.e2e.js +209 -0
  96. package/dist/collection/components/wm-navigator/wm-navigator.spec.js +177 -0
  97. package/dist/collection/components/wm-option/wm-option.e2e.js +22 -0
  98. package/dist/collection/components/wm-option/wm-option.js +1 -1
  99. package/dist/collection/components/wm-option/wm-option.spec.js +63 -0
  100. package/dist/collection/components/wm-pagination/wm-pagination.e2e.js +312 -0
  101. package/dist/collection/components/wm-pagination/wm-pagination.js +1 -1
  102. package/dist/collection/components/wm-search/wm-search.e2e.js +76 -0
  103. package/dist/collection/components/wm-search/wm-search.js +4 -5
  104. package/dist/collection/components/wm-search/wm-search.spec.js +71 -0
  105. package/dist/collection/components/wm-select/wm-select.e2e.js +521 -0
  106. package/dist/collection/components/wm-select/wm-select.js +2 -2
  107. package/dist/collection/components/wm-select/wm-select.spec.js +271 -0
  108. package/dist/collection/components/wm-snackbar/wm-snackbar.css +69 -46
  109. package/dist/collection/components/wm-snackbar/wm-snackbar.e2e.js +112 -0
  110. package/dist/collection/components/wm-snackbar/wm-snackbar.js +66 -31
  111. package/dist/collection/components/wm-snackbar/wm-snackbar.spec.js +9 -0
  112. package/dist/collection/components/wm-tabs/wm-tab-item/wm-tab-item.js +1 -1
  113. package/dist/collection/components/wm-tabs/wm-tab-list/wm-tab-list.js +1 -1
  114. package/dist/collection/components/wm-tabs/wm-tab-panel/wm-tab-panel.js +1 -1
  115. package/dist/collection/components/wm-tabs/wm-tabs.e2e.js +91 -0
  116. package/dist/collection/components/wm-tabs/wm-tabs.spec.js +12 -0
  117. package/dist/collection/components/wm-tag-input/wm-tag-input.e2e.js +204 -0
  118. package/dist/collection/components/wm-tag-input/wm-tag-input.js +3 -3
  119. package/dist/collection/components/wm-tag-input/wm-tag-input.spec.js +195 -0
  120. package/dist/collection/components/wm-textarea/wm-textarea.e2e.js +41 -0
  121. package/dist/collection/components/wm-textarea/wm-textarea.js +1 -1
  122. package/dist/collection/components/wm-textarea/wm-textarea.spec.js +79 -0
  123. package/dist/collection/components/wm-timepicker/wm-timepicker.e2e.js +163 -0
  124. package/dist/collection/components/wm-timepicker/wm-timepicker.js +8 -11
  125. package/dist/collection/components/wm-timepicker/wm-timepicker.spec.js +147 -0
  126. package/dist/collection/components/wm-toggletip/wm-toggletip.e2e.js +69 -0
  127. package/dist/collection/components/wm-toggletip/wm-toggletip.js +2 -2
  128. package/dist/collection/components/wm-toggletip/wm-toggletip.spec.js +21 -0
  129. package/dist/collection/components/wm-uploader/wm-uploader.e2e.js +70 -0
  130. package/dist/collection/components/wm-uploader/wm-uploader.js +2 -2
  131. package/dist/collection/components/wm-uploader/wm-uploader.spec.js +234 -0
  132. package/dist/collection/dev/snackbar.js +48 -32
  133. package/dist/collection/global/functions.spec.js +126 -0
  134. package/dist/collection/lang/lang.spec.js +20 -0
  135. package/dist/esm/{chartFunctions-730742b7.js → chartFunctions-e2554a36.js} +3 -3
  136. package/dist/esm/{functions-eda88c5f.js → functions-f65dbb96.js} +8 -105
  137. package/dist/{cjs/app-globals-7025eb63.js → esm/global-b3bbb95e.js} +1 -10
  138. package/dist/esm/index-f164fbca.js +2552 -0
  139. package/dist/esm/{intl-de8432e2.js → intl-f7f77de7.js} +1 -1
  140. package/dist/esm/loader.js +4 -5
  141. package/dist/esm/polyfills/core-js.js +0 -0
  142. package/dist/esm/polyfills/dom.js +0 -0
  143. package/dist/esm/polyfills/es5-html-element.js +0 -0
  144. package/dist/esm/polyfills/index.js +0 -0
  145. package/dist/esm/polyfills/system.js +0 -0
  146. package/dist/esm/priv-calendar.entry.js +5 -6
  147. package/dist/esm/priv-chart-popover.entry.js +5 -6
  148. package/dist/esm/priv-navigator-button.entry.js +3 -4
  149. package/dist/esm/priv-navigator-item.entry.js +3 -4
  150. package/dist/esm/ripple.js +12 -13
  151. package/dist/esm/wm-action-menu_2.entry.js +6 -8
  152. package/dist/esm/wm-button.entry.js +4 -5
  153. package/dist/esm/wm-chart-slice.entry.js +1 -1
  154. package/dist/esm/wm-chart.entry.js +6 -7
  155. package/dist/esm/wm-date-range.entry.js +7 -8
  156. package/dist/esm/wm-datepicker.entry.js +7 -8
  157. package/dist/esm/wm-file-list.entry.js +3 -4
  158. package/dist/esm/wm-file.entry.js +4 -5
  159. package/dist/esm/wm-input.entry.js +5 -6
  160. package/dist/esm/wm-line-chart.entry.js +14 -15
  161. package/dist/esm/wm-modal-footer.entry.js +3 -4
  162. package/dist/esm/wm-modal-header.entry.js +5 -6
  163. package/dist/esm/wm-modal.entry.js +5 -6
  164. package/dist/esm/wm-navigation_3.entry.js +10 -13
  165. package/dist/esm/wm-navigator.entry.js +3 -4
  166. package/dist/esm/wm-option_2.entry.js +8 -10
  167. package/dist/esm/wm-pagination.entry.js +4 -5
  168. package/dist/esm/wm-progress-indicator_3.entry.js +7 -9
  169. package/dist/esm/wm-search.entry.js +6 -7
  170. package/dist/esm/wm-snackbar.entry.js +69 -35
  171. package/dist/esm/wm-tab-item_3.entry.js +8 -11
  172. package/dist/esm/wm-tag-input.entry.js +7 -8
  173. package/dist/esm/wm-tag-option.entry.js +2 -2
  174. package/dist/esm/wm-textarea.entry.js +5 -6
  175. package/dist/esm/wm-timepicker.entry.js +5 -6
  176. package/dist/esm/wm-toggletip.entry.js +5 -6
  177. package/dist/esm/wm-uploader.entry.js +6 -7
  178. package/dist/esm/wm-wrapper.entry.js +1 -1
  179. package/dist/esm-es5/{chartFunctions-730742b7.js → chartFunctions-e2554a36.js} +1 -1
  180. package/dist/esm-es5/functions-f65dbb96.js +1 -0
  181. package/dist/esm-es5/global-b3bbb95e.js +1 -0
  182. package/dist/esm-es5/index-f164fbca.js +1 -0
  183. package/dist/esm-es5/{intl-de8432e2.js → intl-f7f77de7.js} +1 -1
  184. package/dist/esm-es5/loader.js +1 -1
  185. package/dist/esm-es5/priv-calendar.entry.js +1 -1
  186. package/dist/esm-es5/priv-chart-popover.entry.js +1 -1
  187. package/dist/esm-es5/priv-navigator-button.entry.js +1 -1
  188. package/dist/esm-es5/priv-navigator-item.entry.js +1 -1
  189. package/dist/esm-es5/ripple.js +1 -1
  190. package/dist/esm-es5/wm-action-menu_2.entry.js +1 -1
  191. package/dist/esm-es5/wm-button.entry.js +1 -1
  192. package/dist/esm-es5/wm-chart-slice.entry.js +1 -1
  193. package/dist/esm-es5/wm-chart.entry.js +1 -1
  194. package/dist/esm-es5/wm-date-range.entry.js +1 -1
  195. package/dist/esm-es5/wm-datepicker.entry.js +1 -1
  196. package/dist/esm-es5/wm-file-list.entry.js +1 -1
  197. package/dist/esm-es5/wm-file.entry.js +1 -1
  198. package/dist/esm-es5/wm-input.entry.js +1 -1
  199. package/dist/esm-es5/wm-line-chart.entry.js +1 -1
  200. package/dist/esm-es5/wm-modal-footer.entry.js +1 -1
  201. package/dist/esm-es5/wm-modal-header.entry.js +1 -1
  202. package/dist/esm-es5/wm-modal.entry.js +1 -1
  203. package/dist/esm-es5/wm-navigation_3.entry.js +1 -1
  204. package/dist/esm-es5/wm-navigator.entry.js +1 -1
  205. package/dist/esm-es5/wm-option_2.entry.js +1 -1
  206. package/dist/esm-es5/wm-pagination.entry.js +1 -1
  207. package/dist/esm-es5/wm-progress-indicator_3.entry.js +1 -1
  208. package/dist/esm-es5/wm-search.entry.js +1 -1
  209. package/dist/esm-es5/wm-snackbar.entry.js +1 -1
  210. package/dist/esm-es5/wm-tab-item_3.entry.js +1 -1
  211. package/dist/esm-es5/wm-tag-input.entry.js +1 -1
  212. package/dist/esm-es5/wm-tag-option.entry.js +1 -1
  213. package/dist/esm-es5/wm-textarea.entry.js +1 -1
  214. package/dist/esm-es5/wm-timepicker.entry.js +1 -1
  215. package/dist/esm-es5/wm-toggletip.entry.js +1 -1
  216. package/dist/esm-es5/wm-uploader.entry.js +1 -1
  217. package/dist/esm-es5/wm-wrapper.entry.js +1 -1
  218. package/dist/loader/cdn.js +2 -1
  219. package/dist/loader/index.cjs.js +2 -1
  220. package/dist/loader/index.d.ts +0 -3
  221. package/dist/loader/index.es2017.js +2 -1
  222. package/dist/loader/index.js +2 -1
  223. package/dist/ripple/p-04bf6c89.entry.js +1 -0
  224. package/dist/ripple/{p-98e77431.entry.js → p-0b77b2a1.entry.js} +1 -1
  225. package/dist/ripple/p-0fe97e85.system.js +2 -0
  226. package/dist/ripple/p-109684b1.entry.js +1 -0
  227. package/dist/ripple/p-11383396.system.entry.js +1 -0
  228. package/dist/ripple/{p-7b5ac088.entry.js → p-19dec591.entry.js} +1 -1
  229. package/dist/ripple/p-1cb6b37e.entry.js +1 -0
  230. package/dist/ripple/p-2197287c.entry.js +1 -0
  231. package/dist/ripple/{p-5ab8174c.entry.js → p-22e6104e.entry.js} +1 -1
  232. package/dist/ripple/p-24d88d8d.system.entry.js +1 -0
  233. package/dist/ripple/{p-ff095cec.entry.js → p-25446670.entry.js} +1 -1
  234. package/dist/ripple/p-2bac4b4e.system.entry.js +1 -0
  235. package/dist/ripple/p-30a9ba6e.entry.js +1 -0
  236. package/dist/ripple/p-32cf6907.system.entry.js +1 -0
  237. package/dist/ripple/p-379fe53e.entry.js +1 -0
  238. package/dist/ripple/{p-4aae5688.entry.js → p-3a070f35.entry.js} +1 -1
  239. package/dist/ripple/{p-181068af.system.entry.js → p-3db9e0d8.system.entry.js} +1 -1
  240. package/dist/ripple/p-41e8a079.entry.js +1 -0
  241. package/dist/ripple/p-4272aa37.system.js +1 -0
  242. package/dist/ripple/p-45126063.system.entry.js +1 -0
  243. package/dist/ripple/{p-fd34619f.system.entry.js → p-48a6acfa.system.entry.js} +1 -1
  244. package/dist/ripple/p-4de51706.js +2 -0
  245. package/dist/ripple/{p-245f0080.entry.js → p-4e616347.entry.js} +1 -1
  246. package/dist/ripple/p-577ea283.system.entry.js +1 -0
  247. package/dist/ripple/p-5a04c222.entry.js +1 -0
  248. package/dist/ripple/{p-3036a712.js → p-5b2c1bd1.js} +1 -1
  249. package/dist/ripple/{p-e0929c38.system.js → p-5bbf7fdc.system.js} +1 -1
  250. package/dist/ripple/p-5dbad2ff.entry.js +1 -0
  251. package/dist/ripple/p-625aeeec.system.entry.js +1 -0
  252. package/dist/ripple/p-635f40b1.entry.js +1 -0
  253. package/dist/ripple/p-63fabfed.entry.js +1 -0
  254. package/dist/ripple/p-6dc3ee86.system.js +1 -0
  255. package/dist/ripple/p-7144d185.system.entry.js +1 -0
  256. package/dist/ripple/p-720b6ab0.entry.js +1 -0
  257. package/dist/ripple/p-7573a2fa.entry.js +1 -0
  258. package/dist/ripple/p-76d2dada.entry.js +1 -0
  259. package/dist/ripple/{p-0f117524.system.entry.js → p-780d4673.system.entry.js} +1 -1
  260. package/dist/ripple/p-79af9baf.entry.js +1 -0
  261. package/dist/ripple/{p-b6dcc6d8.system.entry.js → p-7a9ffbcb.system.entry.js} +1 -1
  262. package/dist/ripple/{p-f170963b.system.entry.js → p-7e56da2e.system.entry.js} +1 -1
  263. package/dist/ripple/p-7f4b4071.system.entry.js +1 -0
  264. package/dist/ripple/{p-a36f5e7d.system.entry.js → p-8081f931.system.entry.js} +1 -1
  265. package/dist/ripple/p-84926b89.system.entry.js +1 -0
  266. package/dist/ripple/p-88406560.system.entry.js +1 -0
  267. package/dist/ripple/{p-f95bc54b.entry.js → p-8f38dc86.entry.js} +1 -1
  268. package/dist/ripple/p-92c1ff36.system.entry.js +1 -0
  269. package/dist/ripple/{p-0e1523db.entry.js → p-98120733.entry.js} +1 -1
  270. package/dist/ripple/p-9c6d6b26.system.entry.js +1 -0
  271. package/dist/ripple/{p-e3a15de3.system.entry.js → p-9d8c2a52.system.entry.js} +1 -1
  272. package/dist/ripple/{p-47d993b9.system.entry.js → p-a99b05de.system.entry.js} +1 -1
  273. package/dist/ripple/{p-ce028b38.system.js → p-ae32eb8d.system.js} +1 -1
  274. package/dist/ripple/p-ae8ad491.entry.js +1 -0
  275. package/dist/ripple/p-b0579a2a.system.entry.js +1 -0
  276. package/dist/ripple/p-b0f14557.system.entry.js +1 -0
  277. package/dist/ripple/p-ba751ca4.js +1 -0
  278. package/dist/ripple/{p-39f4fca0.system.entry.js → p-bd27ded2.system.entry.js} +1 -1
  279. package/dist/ripple/p-c38f2a00.system.entry.js +1 -0
  280. package/dist/ripple/p-c51293e2.entry.js +1 -0
  281. package/dist/ripple/p-c717d895.entry.js +1 -0
  282. package/dist/ripple/p-c8873e0c.system.entry.js +1 -0
  283. package/dist/ripple/p-ca9d9447.system.entry.js +1 -0
  284. package/dist/ripple/p-cda6c77e.entry.js +1 -0
  285. package/dist/ripple/{p-ecd26b33.system.entry.js → p-ce5455a3.system.entry.js} +1 -1
  286. package/dist/ripple/p-d265a41e.entry.js +1 -0
  287. package/dist/ripple/p-d325a37b.entry.js +1 -0
  288. package/dist/ripple/p-d7c47dc0.system.entry.js +1 -0
  289. package/dist/ripple/p-d88d806e.js +1 -0
  290. package/dist/ripple/p-dcfdbd30.entry.js +1 -0
  291. package/dist/ripple/p-eb649319.system.js +1 -0
  292. package/dist/ripple/p-ef3fe609.system.entry.js +1 -0
  293. package/dist/ripple/p-f6f29a56.entry.js +1 -0
  294. package/dist/ripple/{p-96cc3c63.js → p-f79a6e32.js} +1 -1
  295. package/dist/ripple/p-f93858ad.system.entry.js +1 -0
  296. package/dist/ripple/p-fc7e5296.entry.js +1 -0
  297. package/dist/ripple/p-ff80aadd.system.entry.js +1 -0
  298. package/dist/ripple/ripple.esm.js +1 -1
  299. package/dist/ripple/ripple.js +1 -1
  300. package/dist/types/components/wm-snackbar/wm-snackbar.d.ts +6 -3
  301. package/dist/types/global/interfaces.d.ts +3 -0
  302. package/dist/types/stencil-public-runtime.d.ts +10 -3
  303. package/package.json +1 -1
  304. package/dist/cjs/index-3c3d6c9f.js +0 -1810
  305. package/dist/esm/index-0ed3ed7d.js +0 -1780
  306. package/dist/esm-es5/app-globals-0c592c57.js +0 -1
  307. package/dist/esm-es5/functions-eda88c5f.js +0 -1
  308. package/dist/esm-es5/index-0ed3ed7d.js +0 -1
  309. package/dist/ripple/p-0096e233.system.entry.js +0 -1
  310. package/dist/ripple/p-0ad27de3.system.entry.js +0 -1
  311. package/dist/ripple/p-0ccf9f96.entry.js +0 -1
  312. package/dist/ripple/p-0f7a85f4.entry.js +0 -1
  313. package/dist/ripple/p-13760c2c.entry.js +0 -1
  314. package/dist/ripple/p-14bab3fa.system.entry.js +0 -1
  315. package/dist/ripple/p-1e536698.js +0 -1
  316. package/dist/ripple/p-2c18b6d1.system.entry.js +0 -1
  317. package/dist/ripple/p-340b18ea.entry.js +0 -1
  318. package/dist/ripple/p-37c39a40.system.entry.js +0 -1
  319. package/dist/ripple/p-3f5e94e3.system.js +0 -1
  320. package/dist/ripple/p-48beea19.system.js +0 -1
  321. package/dist/ripple/p-4ea963f3.system.entry.js +0 -1
  322. package/dist/ripple/p-501d3115.entry.js +0 -1
  323. package/dist/ripple/p-527581c5.entry.js +0 -1
  324. package/dist/ripple/p-563b5820.entry.js +0 -1
  325. package/dist/ripple/p-57695dba.js +0 -2
  326. package/dist/ripple/p-5c6c325e.system.entry.js +0 -1
  327. package/dist/ripple/p-5f4c8d63.system.entry.js +0 -1
  328. package/dist/ripple/p-68e3e7c0.entry.js +0 -1
  329. package/dist/ripple/p-68fec757.system.entry.js +0 -1
  330. package/dist/ripple/p-6982bc34.entry.js +0 -1
  331. package/dist/ripple/p-6a793c40.system.entry.js +0 -1
  332. package/dist/ripple/p-6c31f0ad.system.entry.js +0 -1
  333. package/dist/ripple/p-6daf1bd3.system.entry.js +0 -1
  334. package/dist/ripple/p-6e406e8b.entry.js +0 -1
  335. package/dist/ripple/p-77210f26.entry.js +0 -1
  336. package/dist/ripple/p-7a844f5d.system.js +0 -2
  337. package/dist/ripple/p-7d5aaa73.system.entry.js +0 -1
  338. package/dist/ripple/p-80c92919.system.entry.js +0 -1
  339. package/dist/ripple/p-81fd2ed5.system.entry.js +0 -1
  340. package/dist/ripple/p-84d294d1.system.js +0 -1
  341. package/dist/ripple/p-85178a0d.entry.js +0 -1
  342. package/dist/ripple/p-8768ba4d.system.entry.js +0 -1
  343. package/dist/ripple/p-8af21b69.entry.js +0 -1
  344. package/dist/ripple/p-a30eef53.entry.js +0 -1
  345. package/dist/ripple/p-ad6c979f.entry.js +0 -1
  346. package/dist/ripple/p-af8c1cfa.entry.js +0 -1
  347. package/dist/ripple/p-b19be746.entry.js +0 -1
  348. package/dist/ripple/p-b483ec14.entry.js +0 -1
  349. package/dist/ripple/p-b4a34241.entry.js +0 -1
  350. package/dist/ripple/p-be28a95e.system.entry.js +0 -1
  351. package/dist/ripple/p-c6d970a4.entry.js +0 -1
  352. package/dist/ripple/p-dba63006.system.entry.js +0 -1
  353. package/dist/ripple/p-dbb37269.system.entry.js +0 -1
  354. package/dist/ripple/p-e19f8c43.js +0 -1
  355. package/dist/ripple/p-e3d66797.entry.js +0 -1
  356. package/dist/ripple/p-e64276f2.entry.js +0 -1
  357. package/dist/ripple/p-e9978b2f.entry.js +0 -1
  358. package/dist/ripple/p-ecbd3ea9.system.entry.js +0 -1
  359. package/dist/ripple/p-ee49cb03.entry.js +0 -1
  360. package/dist/ripple/p-f0fbb86b.system.entry.js +0 -1
  361. package/dist/ripple/p-f4f3bf9f.system.entry.js +0 -1
  362. package/dist/types/components/datepickers/priv-calendar/priv-calendar.d.ts +0 -72
  363. package/dist/types/components/datepickers/wm-date-range.d.ts +0 -68
@@ -0,0 +1,2582 @@
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
+ const BUILD = /* ripple */ { allRenderFn: false, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: true, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: true, connectedCallback: false, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: false, element: false, event: true, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: true, hostListenerTarget: true, hostListenerTargetBody: false, hostListenerTargetDocument: true, hostListenerTargetParent: false, hostListenerTargetWindow: true, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: true, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: true, propNumber: true, propString: true, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: true, shadowDom: true, slot: true, slotChildNodesFix: false, slotRelocation: true, state: true, style: true, svg: true, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: true, watchCallback: true };
25
+
26
+ /**
27
+ * Virtual DOM patching algorithm based on Snabbdom by
28
+ * Simon Friis Vindum (@paldepind)
29
+ * Licensed under the MIT License
30
+ * https://github.com/snabbdom/snabbdom/blob/master/LICENSE
31
+ *
32
+ * Modified for Stencil's renderer and slot projection
33
+ */
34
+ let scopeId;
35
+ let contentRef;
36
+ let hostTagName;
37
+ let useNativeShadowDom = false;
38
+ let checkSlotFallbackVisibility = false;
39
+ let checkSlotRelocate = false;
40
+ let isSvgMode = false;
41
+ let queuePending = false;
42
+ const createTime = (fnName, tagName = '') => {
43
+ {
44
+ return () => {
45
+ return;
46
+ };
47
+ }
48
+ };
49
+ const uniqueTime = (key, measureText) => {
50
+ {
51
+ return () => {
52
+ return;
53
+ };
54
+ }
55
+ };
56
+ const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
57
+ /**
58
+ * Constant for styles to be globally applied to `slot-fb` elements for pseudo-slot behavior.
59
+ *
60
+ * Two cascading rules must be used instead of a `:not()` selector due to Stencil browser
61
+ * support as of Stencil v4.
62
+ */
63
+ const SLOT_FB_CSS = 'slot-fb{display:contents}slot-fb[hidden]{display:none}';
64
+ const XLINK_NS = 'http://www.w3.org/1999/xlink';
65
+ /**
66
+ * Default style mode id
67
+ */
68
+ /**
69
+ * Reusable empty obj/array
70
+ * Don't add values to these!!
71
+ */
72
+ const EMPTY_OBJ = {};
73
+ /**
74
+ * Namespaces
75
+ */
76
+ const SVG_NS = 'http://www.w3.org/2000/svg';
77
+ const HTML_NS = 'http://www.w3.org/1999/xhtml';
78
+ const isDef = (v) => v != null;
79
+ /**
80
+ * Check whether a value is a 'complex type', defined here as an object or a
81
+ * function.
82
+ *
83
+ * @param o the value to check
84
+ * @returns whether it's a complex type or not
85
+ */
86
+ const isComplexType = (o) => {
87
+ // https://jsperf.com/typeof-fn-object/5
88
+ o = typeof o;
89
+ return o === 'object' || o === 'function';
90
+ };
91
+ /**
92
+ * Helper method for querying a `meta` tag that contains a nonce value
93
+ * out of a DOM's head.
94
+ *
95
+ * @param doc The DOM containing the `head` to query against
96
+ * @returns The content of the meta tag representing the nonce value, or `undefined` if no tag
97
+ * exists or the tag has no content.
98
+ */
99
+ function queryNonceMetaTagContent(doc) {
100
+ var _a, _b, _c;
101
+ 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;
102
+ }
103
+ /**
104
+ * Production h() function based on Preact by
105
+ * Jason Miller (@developit)
106
+ * Licensed under the MIT License
107
+ * https://github.com/developit/preact/blob/master/LICENSE
108
+ *
109
+ * Modified for Stencil's compiler and vdom
110
+ */
111
+ // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode;
112
+ // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
113
+ const h = (nodeName, vnodeData, ...children) => {
114
+ let child = null;
115
+ let key = null;
116
+ let slotName = null;
117
+ let simple = false;
118
+ let lastSimple = false;
119
+ const vNodeChildren = [];
120
+ const walk = (c) => {
121
+ for (let i = 0; i < c.length; i++) {
122
+ child = c[i];
123
+ if (Array.isArray(child)) {
124
+ walk(child);
125
+ }
126
+ else if (child != null && typeof child !== 'boolean') {
127
+ if ((simple = typeof nodeName !== 'function' && !isComplexType(child))) {
128
+ child = String(child);
129
+ }
130
+ if (simple && lastSimple) {
131
+ // If the previous child was simple (string), we merge both
132
+ vNodeChildren[vNodeChildren.length - 1].$text$ += child;
133
+ }
134
+ else {
135
+ // Append a new vNode, if it's text, we create a text vNode
136
+ vNodeChildren.push(simple ? newVNode(null, child) : child);
137
+ }
138
+ lastSimple = simple;
139
+ }
140
+ }
141
+ };
142
+ walk(children);
143
+ if (vnodeData) {
144
+ if (vnodeData.key) {
145
+ key = vnodeData.key;
146
+ }
147
+ if (vnodeData.name) {
148
+ slotName = vnodeData.name;
149
+ }
150
+ // normalize class / className attributes
151
+ {
152
+ const classData = vnodeData.className || vnodeData.class;
153
+ if (classData) {
154
+ vnodeData.class =
155
+ typeof classData !== 'object'
156
+ ? classData
157
+ : Object.keys(classData)
158
+ .filter((k) => classData[k])
159
+ .join(' ');
160
+ }
161
+ }
162
+ }
163
+ const vnode = newVNode(nodeName, null);
164
+ vnode.$attrs$ = vnodeData;
165
+ if (vNodeChildren.length > 0) {
166
+ vnode.$children$ = vNodeChildren;
167
+ }
168
+ {
169
+ vnode.$key$ = key;
170
+ }
171
+ {
172
+ vnode.$name$ = slotName;
173
+ }
174
+ return vnode;
175
+ };
176
+ /**
177
+ * A utility function for creating a virtual DOM node from a tag and some
178
+ * possible text content.
179
+ *
180
+ * @param tag the tag for this element
181
+ * @param text possible text content for the node
182
+ * @returns a newly-minted virtual DOM node
183
+ */
184
+ const newVNode = (tag, text) => {
185
+ const vnode = {
186
+ $flags$: 0,
187
+ $tag$: tag,
188
+ $text$: text,
189
+ $elm$: null,
190
+ $children$: null,
191
+ };
192
+ {
193
+ vnode.$attrs$ = null;
194
+ }
195
+ {
196
+ vnode.$key$ = null;
197
+ }
198
+ {
199
+ vnode.$name$ = null;
200
+ }
201
+ return vnode;
202
+ };
203
+ const Host = {};
204
+ /**
205
+ * Check whether a given node is a Host node or not
206
+ *
207
+ * @param node the virtual DOM node to check
208
+ * @returns whether it's a Host node or not
209
+ */
210
+ const isHost = (node) => node && node.$tag$ === Host;
211
+ /**
212
+ * Parse a new property value for a given property type.
213
+ *
214
+ * While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
215
+ * it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
216
+ * 1. `any`, the type given to `propValue` in the function signature
217
+ * 2. the type stored from `propType`.
218
+ *
219
+ * This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
220
+ *
221
+ * Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
222
+ * a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
223
+ * based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
224
+ * ```tsx
225
+ * <my-cmp prop-val={0}></my-cmp>
226
+ * ```
227
+ *
228
+ * HTML prop values on the other hand, will always a string
229
+ *
230
+ * @param propValue the new value to coerce to some type
231
+ * @param propType the type of the prop, expressed as a binary number
232
+ * @returns the parsed/coerced value
233
+ */
234
+ const parsePropertyValue = (propValue, propType) => {
235
+ // ensure this value is of the correct prop type
236
+ if (propValue != null && !isComplexType(propValue)) {
237
+ if (propType & 4 /* MEMBER_FLAGS.Boolean */) {
238
+ // per the HTML spec, any string value means it is a boolean true value
239
+ // but we'll cheat here and say that the string "false" is the boolean false
240
+ return propValue === 'false' ? false : propValue === '' || !!propValue;
241
+ }
242
+ if (propType & 2 /* MEMBER_FLAGS.Number */) {
243
+ // force it to be a number
244
+ return parseFloat(propValue);
245
+ }
246
+ if (propType & 1 /* MEMBER_FLAGS.String */) {
247
+ // could have been passed as a number or boolean
248
+ // but we still want it as a string
249
+ return String(propValue);
250
+ }
251
+ // redundant return here for better minification
252
+ return propValue;
253
+ }
254
+ // not sure exactly what type we want
255
+ // so no need to change to a different type
256
+ return propValue;
257
+ };
258
+ const getElement = (ref) => (getHostRef(ref).$hostElement$ );
259
+ const createEvent = (ref, name, flags) => {
260
+ const elm = getElement(ref);
261
+ return {
262
+ emit: (detail) => {
263
+ return emitEvent(elm, name, {
264
+ bubbles: !!(flags & 4 /* EVENT_FLAGS.Bubbles */),
265
+ composed: !!(flags & 2 /* EVENT_FLAGS.Composed */),
266
+ cancelable: !!(flags & 1 /* EVENT_FLAGS.Cancellable */),
267
+ detail,
268
+ });
269
+ },
270
+ };
271
+ };
272
+ /**
273
+ * Helper function to create & dispatch a custom Event on a provided target
274
+ * @param elm the target of the Event
275
+ * @param name the name to give the custom Event
276
+ * @param opts options for configuring a custom Event
277
+ * @returns the custom Event
278
+ */
279
+ const emitEvent = (elm, name, opts) => {
280
+ const ev = plt.ce(name, opts);
281
+ elm.dispatchEvent(ev);
282
+ return ev;
283
+ };
284
+ const rootAppliedStyles = /*@__PURE__*/ new WeakMap();
285
+ const registerStyle = (scopeId, cssText, allowCS) => {
286
+ let style = styles.get(scopeId);
287
+ if (supportsConstructableStylesheets && allowCS) {
288
+ style = (style || new CSSStyleSheet());
289
+ if (typeof style === 'string') {
290
+ style = cssText;
291
+ }
292
+ else {
293
+ style.replaceSync(cssText);
294
+ }
295
+ }
296
+ else {
297
+ style = cssText;
298
+ }
299
+ styles.set(scopeId, style);
300
+ };
301
+ const addStyle = (styleContainerNode, cmpMeta, mode) => {
302
+ var _a;
303
+ const scopeId = getScopeId(cmpMeta);
304
+ const style = styles.get(scopeId);
305
+ // if an element is NOT connected then getRootNode() will return the wrong root node
306
+ // so the fallback is to always use the document for the root node in those cases
307
+ styleContainerNode = styleContainerNode.nodeType === 11 /* NODE_TYPE.DocumentFragment */ ? styleContainerNode : doc;
308
+ if (style) {
309
+ if (typeof style === 'string') {
310
+ styleContainerNode = styleContainerNode.head || styleContainerNode;
311
+ let appliedStyles = rootAppliedStyles.get(styleContainerNode);
312
+ let styleElm;
313
+ if (!appliedStyles) {
314
+ rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
315
+ }
316
+ if (!appliedStyles.has(scopeId)) {
317
+ {
318
+ styleElm = doc.createElement('style');
319
+ styleElm.innerHTML = style;
320
+ // Apply CSP nonce to the style tag if it exists
321
+ const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
322
+ if (nonce != null) {
323
+ styleElm.setAttribute('nonce', nonce);
324
+ }
325
+ styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
326
+ }
327
+ // Add styles for `slot-fb` elements if we're using slots outside the Shadow DOM
328
+ if (cmpMeta.$flags$ & 4 /* CMP_FLAGS.hasSlotRelocation */) {
329
+ styleElm.innerHTML += SLOT_FB_CSS;
330
+ }
331
+ if (appliedStyles) {
332
+ appliedStyles.add(scopeId);
333
+ }
334
+ }
335
+ }
336
+ else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
337
+ styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
338
+ }
339
+ }
340
+ return scopeId;
341
+ };
342
+ const attachStyles = (hostRef) => {
343
+ const cmpMeta = hostRef.$cmpMeta$;
344
+ const elm = hostRef.$hostElement$;
345
+ const flags = cmpMeta.$flags$;
346
+ const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
347
+ const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
348
+ if (flags & 10 /* CMP_FLAGS.needsScopedEncapsulation */) {
349
+ // only required when we're NOT using native shadow dom (slot)
350
+ // or this browser doesn't support native shadow dom
351
+ // and this host element was NOT created with SSR
352
+ // let's pick out the inner content for slot projection
353
+ // create a node to represent where the original
354
+ // content was first placed, which is useful later on
355
+ // DOM WRITE!!
356
+ elm['s-sc'] = scopeId;
357
+ elm.classList.add(scopeId + '-h');
358
+ }
359
+ endAttachStyles();
360
+ };
361
+ const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
362
+ /**
363
+ * Production setAccessor() function based on Preact by
364
+ * Jason Miller (@developit)
365
+ * Licensed under the MIT License
366
+ * https://github.com/developit/preact/blob/master/LICENSE
367
+ *
368
+ * Modified for Stencil's compiler and vdom
369
+ */
370
+ /**
371
+ * When running a VDom render set properties present on a VDom node onto the
372
+ * corresponding HTML element.
373
+ *
374
+ * Note that this function has special functionality for the `class`,
375
+ * `style`, `key`, and `ref` attributes, as well as event handlers (like
376
+ * `onClick`, etc). All others are just passed through as-is.
377
+ *
378
+ * @param elm the HTMLElement onto which attributes should be set
379
+ * @param memberName the name of the attribute to set
380
+ * @param oldValue the old value for the attribute
381
+ * @param newValue the new value for the attribute
382
+ * @param isSvg whether we're in an svg context or not
383
+ * @param flags bitflags for Vdom variables
384
+ */
385
+ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
386
+ if (oldValue !== newValue) {
387
+ let isProp = isMemberInElement(elm, memberName);
388
+ let ln = memberName.toLowerCase();
389
+ if (memberName === 'class') {
390
+ const classList = elm.classList;
391
+ const oldClasses = parseClassList(oldValue);
392
+ const newClasses = parseClassList(newValue);
393
+ classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
394
+ classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
395
+ }
396
+ else if (memberName === 'style') {
397
+ // update style attribute, css properties and values
398
+ {
399
+ for (const prop in oldValue) {
400
+ if (!newValue || newValue[prop] == null) {
401
+ if (prop.includes('-')) {
402
+ elm.style.removeProperty(prop);
403
+ }
404
+ else {
405
+ elm.style[prop] = '';
406
+ }
407
+ }
408
+ }
409
+ }
410
+ for (const prop in newValue) {
411
+ if (!oldValue || newValue[prop] !== oldValue[prop]) {
412
+ if (prop.includes('-')) {
413
+ elm.style.setProperty(prop, newValue[prop]);
414
+ }
415
+ else {
416
+ elm.style[prop] = newValue[prop];
417
+ }
418
+ }
419
+ }
420
+ }
421
+ else if (memberName === 'key')
422
+ ;
423
+ else if (memberName === 'ref') {
424
+ // minifier will clean this up
425
+ if (newValue) {
426
+ newValue(elm);
427
+ }
428
+ }
429
+ else if ((!isProp ) &&
430
+ memberName[0] === 'o' &&
431
+ memberName[1] === 'n') {
432
+ // Event Handlers
433
+ // so if the member name starts with "on" and the 3rd characters is
434
+ // a capital letter, and it's not already a member on the element,
435
+ // then we're assuming it's an event listener
436
+ if (memberName[2] === '-') {
437
+ // on- prefixed events
438
+ // allows to be explicit about the dom event to listen without any magic
439
+ // under the hood:
440
+ // <my-cmp on-click> // listens for "click"
441
+ // <my-cmp on-Click> // listens for "Click"
442
+ // <my-cmp on-ionChange> // listens for "ionChange"
443
+ // <my-cmp on-EVENTS> // listens for "EVENTS"
444
+ memberName = memberName.slice(3);
445
+ }
446
+ else if (isMemberInElement(win, ln)) {
447
+ // standard event
448
+ // the JSX attribute could have been "onMouseOver" and the
449
+ // member name "onmouseover" is on the window's prototype
450
+ // so let's add the listener "mouseover", which is all lowercased
451
+ memberName = ln.slice(2);
452
+ }
453
+ else {
454
+ // custom event
455
+ // the JSX attribute could have been "onMyCustomEvent"
456
+ // so let's trim off the "on" prefix and lowercase the first character
457
+ // and add the listener "myCustomEvent"
458
+ // except for the first character, we keep the event name case
459
+ memberName = ln[2] + memberName.slice(3);
460
+ }
461
+ if (oldValue || newValue) {
462
+ // Need to account for "capture" events.
463
+ // If the event name ends with "Capture", we'll update the name to remove
464
+ // the "Capture" suffix and make sure the event listener is setup to handle the capture event.
465
+ const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
466
+ // Make sure we only replace the last instance of "Capture"
467
+ memberName = memberName.replace(CAPTURE_EVENT_REGEX, '');
468
+ if (oldValue) {
469
+ plt.rel(elm, memberName, oldValue, capture);
470
+ }
471
+ if (newValue) {
472
+ plt.ael(elm, memberName, newValue, capture);
473
+ }
474
+ }
475
+ }
476
+ else {
477
+ // Set property if it exists and it's not a SVG
478
+ const isComplex = isComplexType(newValue);
479
+ if ((isProp || (isComplex && newValue !== null)) && !isSvg) {
480
+ try {
481
+ if (!elm.tagName.includes('-')) {
482
+ const n = newValue == null ? '' : newValue;
483
+ // Workaround for Safari, moving the <input> caret when re-assigning the same valued
484
+ if (memberName === 'list') {
485
+ isProp = false;
486
+ }
487
+ else if (oldValue == null || elm[memberName] != n) {
488
+ elm[memberName] = n;
489
+ }
490
+ }
491
+ else {
492
+ elm[memberName] = newValue;
493
+ }
494
+ }
495
+ catch (e) {
496
+ /**
497
+ * in case someone tries to set a read-only property, e.g. "namespaceURI", we just ignore it
498
+ */
499
+ }
500
+ }
501
+ /**
502
+ * Need to manually update attribute if:
503
+ * - memberName is not an attribute
504
+ * - if we are rendering the host element in order to reflect attribute
505
+ * - if it's a SVG, since properties might not work in <svg>
506
+ * - if the newValue is null/undefined or 'false'.
507
+ */
508
+ let xlink = false;
509
+ {
510
+ if (ln !== (ln = ln.replace(/^xlink\:?/, ''))) {
511
+ memberName = ln;
512
+ xlink = true;
513
+ }
514
+ }
515
+ if (newValue == null || newValue === false) {
516
+ if (newValue !== false || elm.getAttribute(memberName) === '') {
517
+ if (xlink) {
518
+ elm.removeAttributeNS(XLINK_NS, memberName);
519
+ }
520
+ else {
521
+ elm.removeAttribute(memberName);
522
+ }
523
+ }
524
+ }
525
+ else if ((!isProp || flags & 4 /* VNODE_FLAGS.isHost */ || isSvg) && !isComplex) {
526
+ newValue = newValue === true ? '' : newValue;
527
+ if (xlink) {
528
+ elm.setAttributeNS(XLINK_NS, memberName, newValue);
529
+ }
530
+ else {
531
+ elm.setAttribute(memberName, newValue);
532
+ }
533
+ }
534
+ }
535
+ }
536
+ };
537
+ const parseClassListRegex = /\s/;
538
+ /**
539
+ * Parsed a string of classnames into an array
540
+ * @param value className string, e.g. "foo bar baz"
541
+ * @returns list of classes, e.g. ["foo", "bar", "baz"]
542
+ */
543
+ const parseClassList = (value) => (!value ? [] : value.split(parseClassListRegex));
544
+ const CAPTURE_EVENT_SUFFIX = 'Capture';
545
+ const CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + '$');
546
+ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
547
+ // if the element passed in is a shadow root, which is a document fragment
548
+ // then we want to be adding attrs/props to the shadow root's "host" element
549
+ // if it's not a shadow root, then we add attrs/props to the same element
550
+ const elm = newVnode.$elm$.nodeType === 11 /* NODE_TYPE.DocumentFragment */ && newVnode.$elm$.host
551
+ ? newVnode.$elm$.host
552
+ : newVnode.$elm$;
553
+ const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
554
+ const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
555
+ {
556
+ // remove attributes no longer present on the vnode by setting them to undefined
557
+ for (memberName in oldVnodeAttrs) {
558
+ if (!(memberName in newVnodeAttrs)) {
559
+ setAccessor(elm, memberName, oldVnodeAttrs[memberName], undefined, isSvgMode, newVnode.$flags$);
560
+ }
561
+ }
562
+ }
563
+ // add new & update changed attributes
564
+ for (memberName in newVnodeAttrs) {
565
+ setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
566
+ }
567
+ };
568
+ /**
569
+ * Create a DOM Node corresponding to one of the children of a given VNode.
570
+ *
571
+ * @param oldParentVNode the parent VNode from the previous render
572
+ * @param newParentVNode the parent VNode from the current render
573
+ * @param childIndex the index of the VNode, in the _new_ parent node's
574
+ * children, for which we will create a new DOM node
575
+ * @param parentElm the parent DOM node which our new node will be a child of
576
+ * @returns the newly created node
577
+ */
578
+ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
579
+ var _a;
580
+ // tslint:disable-next-line: prefer-const
581
+ const newVNode = newParentVNode.$children$[childIndex];
582
+ let i = 0;
583
+ let elm;
584
+ let childNode;
585
+ let oldVNode;
586
+ if (!useNativeShadowDom) {
587
+ // remember for later we need to check to relocate nodes
588
+ checkSlotRelocate = true;
589
+ if (newVNode.$tag$ === 'slot') {
590
+ if (scopeId) {
591
+ // scoped css needs to add its scoped id to the parent element
592
+ parentElm.classList.add(scopeId + '-s');
593
+ }
594
+ newVNode.$flags$ |= newVNode.$children$
595
+ ? // slot element has fallback content
596
+ 2 /* VNODE_FLAGS.isSlotFallback */
597
+ : // slot element does not have fallback content
598
+ 1 /* VNODE_FLAGS.isSlotReference */;
599
+ }
600
+ }
601
+ if (newVNode.$text$ !== null) {
602
+ // create text node
603
+ elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
604
+ }
605
+ else if (newVNode.$flags$ & 1 /* VNODE_FLAGS.isSlotReference */) {
606
+ // create a slot reference node
607
+ elm = newVNode.$elm$ =
608
+ doc.createTextNode('');
609
+ }
610
+ else {
611
+ if (!isSvgMode) {
612
+ isSvgMode = newVNode.$tag$ === 'svg';
613
+ }
614
+ // create element
615
+ elm = newVNode.$elm$ = (doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, newVNode.$flags$ & 2 /* VNODE_FLAGS.isSlotFallback */
616
+ ? 'slot-fb'
617
+ : newVNode.$tag$)
618
+ );
619
+ if (isSvgMode && newVNode.$tag$ === 'foreignObject') {
620
+ isSvgMode = false;
621
+ }
622
+ // add css classes, attrs, props, listeners, etc.
623
+ {
624
+ updateElement(null, newVNode, isSvgMode);
625
+ }
626
+ if (isDef(scopeId) && elm['s-si'] !== scopeId) {
627
+ // if there is a scopeId and this is the initial render
628
+ // then let's add the scopeId as a css class
629
+ elm.classList.add((elm['s-si'] = scopeId));
630
+ }
631
+ if (newVNode.$children$) {
632
+ for (i = 0; i < newVNode.$children$.length; ++i) {
633
+ // create the node
634
+ childNode = createElm(oldParentVNode, newVNode, i, elm);
635
+ // return node could have been null
636
+ if (childNode) {
637
+ // append our new node
638
+ elm.appendChild(childNode);
639
+ }
640
+ }
641
+ }
642
+ {
643
+ if (newVNode.$tag$ === 'svg') {
644
+ // Only reset the SVG context when we're exiting <svg> element
645
+ isSvgMode = false;
646
+ }
647
+ else if (elm.tagName === 'foreignObject') {
648
+ // Reenter SVG context when we're exiting <foreignObject> element
649
+ isSvgMode = true;
650
+ }
651
+ }
652
+ }
653
+ // This needs to always happen so we can hide nodes that are projected
654
+ // to another component but don't end up in a slot
655
+ elm['s-hn'] = hostTagName;
656
+ {
657
+ if (newVNode.$flags$ & (2 /* VNODE_FLAGS.isSlotFallback */ | 1 /* VNODE_FLAGS.isSlotReference */)) {
658
+ // remember the content reference comment
659
+ elm['s-sr'] = true;
660
+ // Persist the name of the slot that this slot was going to be projected into.
661
+ elm['s-fs'] = (_a = newVNode.$attrs$) === null || _a === void 0 ? void 0 : _a.slot;
662
+ // remember the content reference comment
663
+ elm['s-cr'] = contentRef;
664
+ // remember the slot name, or empty string for default slot
665
+ elm['s-sn'] = newVNode.$name$ || '';
666
+ // check if we've got an old vnode for this slot
667
+ oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
668
+ if (oldVNode && oldVNode.$tag$ === newVNode.$tag$ && oldParentVNode.$elm$) {
669
+ {
670
+ // we've got an old slot vnode and the wrapper is being replaced
671
+ // so let's move the old slot content back to its original location
672
+ putBackInOriginalLocation(oldParentVNode.$elm$, false);
673
+ }
674
+ }
675
+ }
676
+ }
677
+ return elm;
678
+ };
679
+ const putBackInOriginalLocation = (parentElm, recursive) => {
680
+ var _a;
681
+ plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
682
+ const oldSlotChildNodes = parentElm.childNodes;
683
+ for (let i = oldSlotChildNodes.length - 1; i >= 0; i--) {
684
+ const childNode = oldSlotChildNodes[i];
685
+ if (childNode['s-hn'] !== hostTagName && childNode['s-ol']) {
686
+ // and relocate it back to it's original location
687
+ parentReferenceNode(childNode).insertBefore(childNode, referenceNode(childNode));
688
+ // remove the old original location comment entirely
689
+ // later on the patch function will know what to do
690
+ // and move this to the correct spot if need be
691
+ childNode['s-ol'].remove();
692
+ childNode['s-ol'] = undefined;
693
+ // Reset so we can correctly move the node around again.
694
+ childNode['s-sh'] = undefined;
695
+ // When putting an element node back in its original location,
696
+ // we need to reset the `slot` attribute back to the value it originally had
697
+ // so we can correctly relocate it again in the future
698
+ if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
699
+ childNode.setAttribute('slot', (_a = childNode['s-sn']) !== null && _a !== void 0 ? _a : '');
700
+ }
701
+ checkSlotRelocate = true;
702
+ }
703
+ if (recursive) {
704
+ putBackInOriginalLocation(childNode, recursive);
705
+ }
706
+ }
707
+ plt.$flags$ &= ~1 /* PLATFORM_FLAGS.isTmpDisconnected */;
708
+ };
709
+ /**
710
+ * Create DOM nodes corresponding to a list of {@link d.Vnode} objects and
711
+ * add them to the DOM in the appropriate place.
712
+ *
713
+ * @param parentElm the DOM node which should be used as a parent for the new
714
+ * DOM nodes
715
+ * @param before a child of the `parentElm` which the new children should be
716
+ * inserted before (optional)
717
+ * @param parentVNode the parent virtual DOM node
718
+ * @param vnodes the new child virtual DOM nodes to produce DOM nodes for
719
+ * @param startIdx the index in the child virtual DOM nodes at which to start
720
+ * creating DOM nodes (inclusive)
721
+ * @param endIdx the index in the child virtual DOM nodes at which to stop
722
+ * creating DOM nodes (inclusive)
723
+ */
724
+ const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
725
+ let containerElm = ((parentElm['s-cr'] && parentElm['s-cr'].parentNode) || parentElm);
726
+ let childNode;
727
+ if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
728
+ containerElm = containerElm.shadowRoot;
729
+ }
730
+ for (; startIdx <= endIdx; ++startIdx) {
731
+ if (vnodes[startIdx]) {
732
+ childNode = createElm(null, parentVNode, startIdx, parentElm);
733
+ if (childNode) {
734
+ vnodes[startIdx].$elm$ = childNode;
735
+ containerElm.insertBefore(childNode, referenceNode(before) );
736
+ }
737
+ }
738
+ }
739
+ };
740
+ /**
741
+ * Remove the DOM elements corresponding to a list of {@link d.VNode} objects.
742
+ * This can be used to, for instance, clean up after a list of children which
743
+ * should no longer be shown.
744
+ *
745
+ * This function also handles some of Stencil's slot relocation logic.
746
+ *
747
+ * @param vnodes a list of virtual DOM nodes to remove
748
+ * @param startIdx the index at which to start removing nodes (inclusive)
749
+ * @param endIdx the index at which to stop removing nodes (inclusive)
750
+ */
751
+ const removeVnodes = (vnodes, startIdx, endIdx) => {
752
+ for (let index = startIdx; index <= endIdx; ++index) {
753
+ const vnode = vnodes[index];
754
+ if (vnode) {
755
+ const elm = vnode.$elm$;
756
+ nullifyVNodeRefs(vnode);
757
+ if (elm) {
758
+ {
759
+ // we're removing this element
760
+ // so it's possible we need to show slot fallback content now
761
+ checkSlotFallbackVisibility = true;
762
+ if (elm['s-ol']) {
763
+ // remove the original location comment
764
+ elm['s-ol'].remove();
765
+ }
766
+ else {
767
+ // it's possible that child nodes of the node
768
+ // that's being removed are slot nodes
769
+ putBackInOriginalLocation(elm, true);
770
+ }
771
+ }
772
+ // remove the vnode's element from the dom
773
+ elm.remove();
774
+ }
775
+ }
776
+ }
777
+ };
778
+ /**
779
+ * Reconcile the children of a new VNode with the children of an old VNode by
780
+ * traversing the two collections of children, identifying nodes that are
781
+ * conserved or changed, calling out to `patch` to make any necessary
782
+ * updates to the DOM, and rearranging DOM nodes as needed.
783
+ *
784
+ * The algorithm for reconciling children works by analyzing two 'windows' onto
785
+ * the two arrays of children (`oldCh` and `newCh`). We keep track of the
786
+ * 'windows' by storing start and end indices and references to the
787
+ * corresponding array entries. Initially the two 'windows' are basically equal
788
+ * to the entire array, but we progressively narrow the windows until there are
789
+ * no children left to update by doing the following:
790
+ *
791
+ * 1. Skip any `null` entries at the beginning or end of the two arrays, so
792
+ * that if we have an initial array like the following we'll end up dealing
793
+ * only with a window bounded by the highlighted elements:
794
+ *
795
+ * [null, null, VNode1 , ... , VNode2, null, null]
796
+ * ^^^^^^ ^^^^^^
797
+ *
798
+ * 2. Check to see if the elements at the head and tail positions are equal
799
+ * across the windows. This will basically detect elements which haven't
800
+ * been added, removed, or changed position, i.e. if you had the following
801
+ * VNode elements (represented as HTML):
802
+ *
803
+ * oldVNode: `<div><p><span>HEY</span></p></div>`
804
+ * newVNode: `<div><p><span>THERE</span></p></div>`
805
+ *
806
+ * Then when comparing the children of the `<div>` tag we check the equality
807
+ * of the VNodes corresponding to the `<p>` tags and, since they are the
808
+ * same tag in the same position, we'd be able to avoid completely
809
+ * re-rendering the subtree under them with a new DOM element and would just
810
+ * call out to `patch` to handle reconciling their children and so on.
811
+ *
812
+ * 3. Check, for both windows, to see if the element at the beginning of the
813
+ * window corresponds to the element at the end of the other window. This is
814
+ * a heuristic which will let us identify _some_ situations in which
815
+ * elements have changed position, for instance it _should_ detect that the
816
+ * children nodes themselves have not changed but merely moved in the
817
+ * following example:
818
+ *
819
+ * oldVNode: `<div><element-one /><element-two /></div>`
820
+ * newVNode: `<div><element-two /><element-one /></div>`
821
+ *
822
+ * If we find cases like this then we also need to move the concrete DOM
823
+ * elements corresponding to the moved children to write the re-order to the
824
+ * DOM.
825
+ *
826
+ * 4. Finally, if VNodes have the `key` attribute set on them we check for any
827
+ * nodes in the old children which have the same key as the first element in
828
+ * our window on the new children. If we find such a node we handle calling
829
+ * out to `patch`, moving relevant DOM nodes, and so on, in accordance with
830
+ * what we find.
831
+ *
832
+ * Finally, once we've narrowed our 'windows' to the point that either of them
833
+ * collapse (i.e. they have length 0) we then handle any remaining VNode
834
+ * insertion or deletion that needs to happen to get a DOM state that correctly
835
+ * reflects the new child VNodes. If, for instance, after our window on the old
836
+ * children has collapsed we still have more nodes on the new children that
837
+ * we haven't dealt with yet then we need to add them, or if the new children
838
+ * collapse but we still have unhandled _old_ children then we need to make
839
+ * sure the corresponding DOM nodes are removed.
840
+ *
841
+ * @param parentElm the node into which the parent VNode is rendered
842
+ * @param oldCh the old children of the parent node
843
+ * @param newVNode the new VNode which will replace the parent
844
+ * @param newCh the new children of the parent node
845
+ */
846
+ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
847
+ let oldStartIdx = 0;
848
+ let newStartIdx = 0;
849
+ let idxInOld = 0;
850
+ let i = 0;
851
+ let oldEndIdx = oldCh.length - 1;
852
+ let oldStartVnode = oldCh[0];
853
+ let oldEndVnode = oldCh[oldEndIdx];
854
+ let newEndIdx = newCh.length - 1;
855
+ let newStartVnode = newCh[0];
856
+ let newEndVnode = newCh[newEndIdx];
857
+ let node;
858
+ let elmToMove;
859
+ while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
860
+ if (oldStartVnode == null) {
861
+ // VNode might have been moved left
862
+ oldStartVnode = oldCh[++oldStartIdx];
863
+ }
864
+ else if (oldEndVnode == null) {
865
+ oldEndVnode = oldCh[--oldEndIdx];
866
+ }
867
+ else if (newStartVnode == null) {
868
+ newStartVnode = newCh[++newStartIdx];
869
+ }
870
+ else if (newEndVnode == null) {
871
+ newEndVnode = newCh[--newEndIdx];
872
+ }
873
+ else if (isSameVnode(oldStartVnode, newStartVnode)) {
874
+ // if the start nodes are the same then we should patch the new VNode
875
+ // onto the old one, and increment our `newStartIdx` and `oldStartIdx`
876
+ // indices to reflect that. We don't need to move any DOM Nodes around
877
+ // since things are matched up in order.
878
+ patch(oldStartVnode, newStartVnode);
879
+ oldStartVnode = oldCh[++oldStartIdx];
880
+ newStartVnode = newCh[++newStartIdx];
881
+ }
882
+ else if (isSameVnode(oldEndVnode, newEndVnode)) {
883
+ // likewise, if the end nodes are the same we patch new onto old and
884
+ // decrement our end indices, and also likewise in this case we don't
885
+ // need to move any DOM Nodes.
886
+ patch(oldEndVnode, newEndVnode);
887
+ oldEndVnode = oldCh[--oldEndIdx];
888
+ newEndVnode = newCh[--newEndIdx];
889
+ }
890
+ else if (isSameVnode(oldStartVnode, newEndVnode)) {
891
+ // case: "Vnode moved right"
892
+ //
893
+ // We've found that the last node in our window on the new children is
894
+ // the same VNode as the _first_ node in our window on the old children
895
+ // we're dealing with now. Visually, this is the layout of these two
896
+ // nodes:
897
+ //
898
+ // newCh: [..., newStartVnode , ... , newEndVnode , ...]
899
+ // ^^^^^^^^^^^
900
+ // oldCh: [..., oldStartVnode , ... , oldEndVnode , ...]
901
+ // ^^^^^^^^^^^^^
902
+ //
903
+ // In this situation we need to patch `newEndVnode` onto `oldStartVnode`
904
+ // and move the DOM element for `oldStartVnode`.
905
+ if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
906
+ putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
907
+ }
908
+ patch(oldStartVnode, newEndVnode);
909
+ // We need to move the element for `oldStartVnode` into a position which
910
+ // will be appropriate for `newEndVnode`. For this we can use
911
+ // `.insertBefore` and `oldEndVnode.$elm$.nextSibling`. If there is a
912
+ // sibling for `oldEndVnode.$elm$` then we want to move the DOM node for
913
+ // `oldStartVnode` between `oldEndVnode` and it's sibling, like so:
914
+ //
915
+ // <old-start-node />
916
+ // <some-intervening-node />
917
+ // <old-end-node />
918
+ // <!-- -> <-- `oldStartVnode.$elm$` should be inserted here
919
+ // <next-sibling />
920
+ //
921
+ // If instead `oldEndVnode.$elm$` has no sibling then we just want to put
922
+ // the node for `oldStartVnode` at the end of the children of
923
+ // `parentElm`. Luckily, `Node.nextSibling` will return `null` if there
924
+ // aren't any siblings, and passing `null` to `Node.insertBefore` will
925
+ // append it to the children of the parent element.
926
+ parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
927
+ oldStartVnode = oldCh[++oldStartIdx];
928
+ newEndVnode = newCh[--newEndIdx];
929
+ }
930
+ else if (isSameVnode(oldEndVnode, newStartVnode)) {
931
+ // case: "Vnode moved left"
932
+ //
933
+ // We've found that the first node in our window on the new children is
934
+ // the same VNode as the _last_ node in our window on the old children.
935
+ // Visually, this is the layout of these two nodes:
936
+ //
937
+ // newCh: [..., newStartVnode , ... , newEndVnode , ...]
938
+ // ^^^^^^^^^^^^^
939
+ // oldCh: [..., oldStartVnode , ... , oldEndVnode , ...]
940
+ // ^^^^^^^^^^^
941
+ //
942
+ // In this situation we need to patch `newStartVnode` onto `oldEndVnode`
943
+ // (which will handle updating any changed attributes, reconciling their
944
+ // children etc) but we also need to move the DOM node to which
945
+ // `oldEndVnode` corresponds.
946
+ if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
947
+ putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
948
+ }
949
+ patch(oldEndVnode, newStartVnode);
950
+ // We've already checked above if `oldStartVnode` and `newStartVnode` are
951
+ // the same node, so since we're here we know that they are not. Thus we
952
+ // can move the element for `oldEndVnode` _before_ the element for
953
+ // `oldStartVnode`, leaving `oldStartVnode` to be reconciled in the
954
+ // future.
955
+ parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
956
+ oldEndVnode = oldCh[--oldEndIdx];
957
+ newStartVnode = newCh[++newStartIdx];
958
+ }
959
+ else {
960
+ // Here we do some checks to match up old and new nodes based on the
961
+ // `$key$` attribute, which is set by putting a `key="my-key"` attribute
962
+ // in the JSX for a DOM element in the implementation of a Stencil
963
+ // component.
964
+ //
965
+ // First we check to see if there are any nodes in the array of old
966
+ // children which have the same key as the first node in the new
967
+ // children.
968
+ idxInOld = -1;
969
+ {
970
+ for (i = oldStartIdx; i <= oldEndIdx; ++i) {
971
+ if (oldCh[i] && oldCh[i].$key$ !== null && oldCh[i].$key$ === newStartVnode.$key$) {
972
+ idxInOld = i;
973
+ break;
974
+ }
975
+ }
976
+ }
977
+ if (idxInOld >= 0) {
978
+ // We found a node in the old children which matches up with the first
979
+ // node in the new children! So let's deal with that
980
+ elmToMove = oldCh[idxInOld];
981
+ if (elmToMove.$tag$ !== newStartVnode.$tag$) {
982
+ // the tag doesn't match so we'll need a new DOM element
983
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld, parentElm);
984
+ }
985
+ else {
986
+ patch(elmToMove, newStartVnode);
987
+ // invalidate the matching old node so that we won't try to update it
988
+ // again later on
989
+ oldCh[idxInOld] = undefined;
990
+ node = elmToMove.$elm$;
991
+ }
992
+ newStartVnode = newCh[++newStartIdx];
993
+ }
994
+ else {
995
+ // We either didn't find an element in the old children that matches
996
+ // the key of the first new child OR the build is not using `key`
997
+ // attributes at all. In either case we need to create a new element
998
+ // for the new node.
999
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx, parentElm);
1000
+ newStartVnode = newCh[++newStartIdx];
1001
+ }
1002
+ if (node) {
1003
+ // if we created a new node then handle inserting it to the DOM
1004
+ {
1005
+ parentReferenceNode(oldStartVnode.$elm$).insertBefore(node, referenceNode(oldStartVnode.$elm$));
1006
+ }
1007
+ }
1008
+ }
1009
+ }
1010
+ if (oldStartIdx > oldEndIdx) {
1011
+ // we have some more new nodes to add which don't match up with old nodes
1012
+ addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
1013
+ }
1014
+ else if (newStartIdx > newEndIdx) {
1015
+ // there are nodes in the `oldCh` array which no longer correspond to nodes
1016
+ // in the new array, so lets remove them (which entails cleaning up the
1017
+ // relevant DOM nodes)
1018
+ removeVnodes(oldCh, oldStartIdx, oldEndIdx);
1019
+ }
1020
+ };
1021
+ /**
1022
+ * Compare two VNodes to determine if they are the same
1023
+ *
1024
+ * **NB**: This function is an equality _heuristic_ based on the available
1025
+ * information set on the two VNodes and can be misleading under certain
1026
+ * circumstances. In particular, if the two nodes do not have `key` attrs
1027
+ * (available under `$key$` on VNodes) then the function falls back on merely
1028
+ * checking that they have the same tag.
1029
+ *
1030
+ * So, in other words, if `key` attrs are not set on VNodes which may be
1031
+ * changing order within a `children` array or something along those lines then
1032
+ * we could obtain a false negative and then have to do needless re-rendering
1033
+ * (i.e. we'd say two VNodes aren't equal when in fact they should be).
1034
+ *
1035
+ * @param leftVNode the first VNode to check
1036
+ * @param rightVNode the second VNode to check
1037
+ * @returns whether they're equal or not
1038
+ */
1039
+ const isSameVnode = (leftVNode, rightVNode) => {
1040
+ // compare if two vnode to see if they're "technically" the same
1041
+ // need to have the same element tag, and same key to be the same
1042
+ if (leftVNode.$tag$ === rightVNode.$tag$) {
1043
+ if (leftVNode.$tag$ === 'slot') {
1044
+ return leftVNode.$name$ === rightVNode.$name$;
1045
+ }
1046
+ // this will be set if components in the build have `key` attrs set on them
1047
+ {
1048
+ return leftVNode.$key$ === rightVNode.$key$;
1049
+ }
1050
+ }
1051
+ return false;
1052
+ };
1053
+ const referenceNode = (node) => {
1054
+ // this node was relocated to a new location in the dom
1055
+ // because of some other component's slot
1056
+ // but we still have an html comment in place of where
1057
+ // it's original location was according to it's original vdom
1058
+ return (node && node['s-ol']) || node;
1059
+ };
1060
+ const parentReferenceNode = (node) => (node['s-ol'] ? node['s-ol'] : node).parentNode;
1061
+ /**
1062
+ * Handle reconciling an outdated VNode with a new one which corresponds to
1063
+ * it. This function handles flushing updates to the DOM and reconciling the
1064
+ * children of the two nodes (if any).
1065
+ *
1066
+ * @param oldVNode an old VNode whose DOM element and children we want to update
1067
+ * @param newVNode a new VNode representing an updated version of the old one
1068
+ */
1069
+ const patch = (oldVNode, newVNode) => {
1070
+ const elm = (newVNode.$elm$ = oldVNode.$elm$);
1071
+ const oldChildren = oldVNode.$children$;
1072
+ const newChildren = newVNode.$children$;
1073
+ const tag = newVNode.$tag$;
1074
+ const text = newVNode.$text$;
1075
+ let defaultHolder;
1076
+ if (text === null) {
1077
+ {
1078
+ // test if we're rendering an svg element, or still rendering nodes inside of one
1079
+ // only add this to the when the compiler sees we're using an svg somewhere
1080
+ isSvgMode = tag === 'svg' ? true : tag === 'foreignObject' ? false : isSvgMode;
1081
+ }
1082
+ {
1083
+ if (tag === 'slot')
1084
+ ;
1085
+ else {
1086
+ // either this is the first render of an element OR it's an update
1087
+ // AND we already know it's possible it could have changed
1088
+ // this updates the element's css classes, attrs, props, listeners, etc.
1089
+ updateElement(oldVNode, newVNode, isSvgMode);
1090
+ }
1091
+ }
1092
+ if (oldChildren !== null && newChildren !== null) {
1093
+ // looks like there's child vnodes for both the old and new vnodes
1094
+ // so we need to call `updateChildren` to reconcile them
1095
+ updateChildren(elm, oldChildren, newVNode, newChildren);
1096
+ }
1097
+ else if (newChildren !== null) {
1098
+ // no old child vnodes, but there are new child vnodes to add
1099
+ if (oldVNode.$text$ !== null) {
1100
+ // the old vnode was text, so be sure to clear it out
1101
+ elm.textContent = '';
1102
+ }
1103
+ // add the new vnode children
1104
+ addVnodes(elm, null, newVNode, newChildren, 0, newChildren.length - 1);
1105
+ }
1106
+ else if (oldChildren !== null) {
1107
+ // no new child vnodes, but there are old child vnodes to remove
1108
+ removeVnodes(oldChildren, 0, oldChildren.length - 1);
1109
+ }
1110
+ if (isSvgMode && tag === 'svg') {
1111
+ isSvgMode = false;
1112
+ }
1113
+ }
1114
+ else if ((defaultHolder = elm['s-cr'])) {
1115
+ // this element has slotted content
1116
+ defaultHolder.parentNode.textContent = text;
1117
+ }
1118
+ else if (oldVNode.$text$ !== text) {
1119
+ // update the text content for the text only vnode
1120
+ // and also only if the text is different than before
1121
+ elm.data = text;
1122
+ }
1123
+ };
1124
+ /**
1125
+ * Adjust the `.hidden` property as-needed on any nodes in a DOM subtree which
1126
+ * are slot fallbacks nodes.
1127
+ *
1128
+ * A slot fallback node should be visible by default. Then, it should be
1129
+ * conditionally hidden if:
1130
+ *
1131
+ * - it has a sibling with a `slot` property set to its slot name or if
1132
+ * - it is a default fallback slot node, in which case we hide if it has any
1133
+ * content
1134
+ *
1135
+ * @param elm the element of interest
1136
+ */
1137
+ const updateFallbackSlotVisibility = (elm) => {
1138
+ const childNodes = elm.childNodes;
1139
+ for (const childNode of childNodes) {
1140
+ if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
1141
+ if (childNode['s-sr']) {
1142
+ // this is a slot fallback node
1143
+ // get the slot name for this slot reference node
1144
+ const slotName = childNode['s-sn'];
1145
+ // by default always show a fallback slot node
1146
+ // then hide it if there are other slots in the light dom
1147
+ childNode.hidden = false;
1148
+ // we need to check all of its sibling nodes in order to see if
1149
+ // `childNode` should be hidden
1150
+ for (const siblingNode of childNodes) {
1151
+ // Don't check the node against itself
1152
+ if (siblingNode !== childNode) {
1153
+ if (siblingNode['s-hn'] !== childNode['s-hn'] || slotName !== '') {
1154
+ // this sibling node is from a different component OR is a named
1155
+ // fallback slot node
1156
+ if (siblingNode.nodeType === 1 /* NODE_TYPE.ElementNode */ &&
1157
+ (slotName === siblingNode.getAttribute('slot') || slotName === siblingNode['s-sn'])) {
1158
+ childNode.hidden = true;
1159
+ break;
1160
+ }
1161
+ }
1162
+ else {
1163
+ // this is a default fallback slot node
1164
+ // any element or text node (with content)
1165
+ // should hide the default fallback slot node
1166
+ if (siblingNode.nodeType === 1 /* NODE_TYPE.ElementNode */ ||
1167
+ (siblingNode.nodeType === 3 /* NODE_TYPE.TextNode */ && siblingNode.textContent.trim() !== '')) {
1168
+ childNode.hidden = true;
1169
+ break;
1170
+ }
1171
+ }
1172
+ }
1173
+ }
1174
+ }
1175
+ // keep drilling down
1176
+ updateFallbackSlotVisibility(childNode);
1177
+ }
1178
+ }
1179
+ };
1180
+ /**
1181
+ * Component-global information about nodes which are either currently being
1182
+ * relocated or will be shortly.
1183
+ */
1184
+ const relocateNodes = [];
1185
+ /**
1186
+ * Mark the contents of a slot for relocation via adding references to them to
1187
+ * the {@link relocateNodes} data structure. The actual work of relocating them
1188
+ * will then be handled in {@link renderVdom}.
1189
+ *
1190
+ * @param elm a render node whose child nodes need to be relocated
1191
+ */
1192
+ const markSlotContentForRelocation = (elm) => {
1193
+ // tslint:disable-next-line: prefer-const
1194
+ let node;
1195
+ let hostContentNodes;
1196
+ let j;
1197
+ for (const childNode of elm.childNodes) {
1198
+ // we need to find child nodes which are slot references so we can then try
1199
+ // to match them up with nodes that need to be relocated
1200
+ if (childNode['s-sr'] && (node = childNode['s-cr']) && node.parentNode) {
1201
+ // first get the content reference comment node ('s-cr'), then we get
1202
+ // its parent, which is where all the host content is now
1203
+ hostContentNodes = node.parentNode.childNodes;
1204
+ const slotName = childNode['s-sn'];
1205
+ // iterate through all the nodes under the location where the host was
1206
+ // originally rendered
1207
+ for (j = hostContentNodes.length - 1; j >= 0; j--) {
1208
+ node = hostContentNodes[j];
1209
+ // check that the node is not a content reference node or a node
1210
+ // reference and then check that the host name does not match that of
1211
+ // childNode.
1212
+ // In addition, check that the slot either has not already been relocated, or
1213
+ // that its current location's host is not childNode's host. This is essentially
1214
+ // a check so that we don't try to relocate (and then hide) a node that is already
1215
+ // where it should be.
1216
+ if (!node['s-cn'] &&
1217
+ !node['s-nr'] &&
1218
+ node['s-hn'] !== childNode['s-hn'] &&
1219
+ (!BUILD.experimentalSlotFixes )) {
1220
+ // if `node` is located in the slot that `childNode` refers to (via the
1221
+ // `'s-sn'` property) then we need to relocate it from it's current spot
1222
+ // (under the host element parent) to the right slot location
1223
+ if (isNodeLocatedInSlot(node, slotName)) {
1224
+ // it's possible we've already decided to relocate this node
1225
+ let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
1226
+ // made some changes to slots
1227
+ // let's make sure we also double check
1228
+ // fallbacks are correctly hidden or shown
1229
+ checkSlotFallbackVisibility = true;
1230
+ // ensure that the slot-name attr is correct
1231
+ node['s-sn'] = node['s-sn'] || slotName;
1232
+ if (relocateNodeData) {
1233
+ relocateNodeData.$nodeToRelocate$['s-sh'] = childNode['s-hn'];
1234
+ // we marked this node for relocation previously but didn't find
1235
+ // out the slot reference node to which it needs to be relocated
1236
+ // so write it down now!
1237
+ relocateNodeData.$slotRefNode$ = childNode;
1238
+ }
1239
+ else {
1240
+ node['s-sh'] = childNode['s-hn'];
1241
+ // add to our list of nodes to relocate
1242
+ relocateNodes.push({
1243
+ $slotRefNode$: childNode,
1244
+ $nodeToRelocate$: node,
1245
+ });
1246
+ }
1247
+ if (node['s-sr']) {
1248
+ relocateNodes.map((relocateNode) => {
1249
+ if (isNodeLocatedInSlot(relocateNode.$nodeToRelocate$, node['s-sn'])) {
1250
+ relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
1251
+ if (relocateNodeData && !relocateNode.$slotRefNode$) {
1252
+ relocateNode.$slotRefNode$ = relocateNodeData.$slotRefNode$;
1253
+ }
1254
+ }
1255
+ });
1256
+ }
1257
+ }
1258
+ else if (!relocateNodes.some((r) => r.$nodeToRelocate$ === node)) {
1259
+ // the node is not found within the slot (`childNode`) that we're
1260
+ // currently looking at, so we stick it into `relocateNodes` to
1261
+ // handle later. If we never find a home for this element then
1262
+ // we'll need to hide it
1263
+ relocateNodes.push({
1264
+ $nodeToRelocate$: node,
1265
+ });
1266
+ }
1267
+ }
1268
+ }
1269
+ }
1270
+ // if we're dealing with any type of element (capable of itself being a
1271
+ // slot reference or containing one) then we recur
1272
+ if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
1273
+ markSlotContentForRelocation(childNode);
1274
+ }
1275
+ }
1276
+ };
1277
+ /**
1278
+ * Check whether a node is located in a given named slot.
1279
+ *
1280
+ * @param nodeToRelocate the node of interest
1281
+ * @param slotName the slot name to check
1282
+ * @returns whether the node is located in the slot or not
1283
+ */
1284
+ const isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
1285
+ if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
1286
+ if (nodeToRelocate.getAttribute('slot') === null && slotName === '') {
1287
+ // if the node doesn't have a slot attribute, and the slot we're checking
1288
+ // is not a named slot, then we assume the node should be within the slot
1289
+ return true;
1290
+ }
1291
+ if (nodeToRelocate.getAttribute('slot') === slotName) {
1292
+ return true;
1293
+ }
1294
+ return false;
1295
+ }
1296
+ if (nodeToRelocate['s-sn'] === slotName) {
1297
+ return true;
1298
+ }
1299
+ return slotName === '';
1300
+ };
1301
+ /**
1302
+ * 'Nullify' any VDom `ref` callbacks on a VDom node or its children by calling
1303
+ * them with `null`. This signals that the DOM element corresponding to the VDom
1304
+ * node has been removed from the DOM.
1305
+ *
1306
+ * @param vNode a virtual DOM node
1307
+ */
1308
+ const nullifyVNodeRefs = (vNode) => {
1309
+ {
1310
+ vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
1311
+ vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
1312
+ }
1313
+ };
1314
+ /**
1315
+ * The main entry point for Stencil's virtual DOM-based rendering engine
1316
+ *
1317
+ * Given a {@link d.HostRef} container and some virtual DOM nodes, this
1318
+ * function will handle creating a virtual DOM tree with a single root, patching
1319
+ * the current virtual DOM tree onto an old one (if any), dealing with slot
1320
+ * relocation, and reflecting attributes.
1321
+ *
1322
+ * @param hostRef data needed to root and render the virtual DOM tree, such as
1323
+ * the DOM node into which it should be rendered.
1324
+ * @param renderFnResults the virtual DOM nodes to be rendered
1325
+ * @param isInitialLoad whether or not this is the first call after page load
1326
+ */
1327
+ const renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
1328
+ var _a, _b, _c, _d;
1329
+ const hostElm = hostRef.$hostElement$;
1330
+ const cmpMeta = hostRef.$cmpMeta$;
1331
+ const oldVNode = hostRef.$vnode$ || newVNode(null, null);
1332
+ // if `renderFnResults` is a Host node then we can use it directly. If not,
1333
+ // we need to call `h` again to wrap the children of our component in a
1334
+ // 'dummy' Host node (well, an empty vnode) since `renderVdom` assumes
1335
+ // implicitly that the top-level vdom node is 1) an only child and 2)
1336
+ // contains attrs that need to be set on the host element.
1337
+ const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
1338
+ hostTagName = hostElm.tagName;
1339
+ if (cmpMeta.$attrsToReflect$) {
1340
+ rootVnode.$attrs$ = rootVnode.$attrs$ || {};
1341
+ cmpMeta.$attrsToReflect$.map(([propName, attribute]) => (rootVnode.$attrs$[attribute] = hostElm[propName]));
1342
+ }
1343
+ // On the first render and *only* on the first render we want to check for
1344
+ // any attributes set on the host element which are also set on the vdom
1345
+ // node. If we find them, we override the value on the VDom node attrs with
1346
+ // the value from the host element, which allows developers building apps
1347
+ // with Stencil components to override e.g. the `role` attribute on a
1348
+ // component even if it's already set on the `Host`.
1349
+ if (isInitialLoad && rootVnode.$attrs$) {
1350
+ for (const key of Object.keys(rootVnode.$attrs$)) {
1351
+ // We have a special implementation in `setAccessor` for `style` and
1352
+ // `class` which reconciles values coming from the VDom with values
1353
+ // already present on the DOM element, so we don't want to override those
1354
+ // attributes on the VDom tree with values from the host element if they
1355
+ // are present.
1356
+ //
1357
+ // Likewise, `ref` and `key` are special internal values for the Stencil
1358
+ // runtime and we don't want to override those either.
1359
+ if (hostElm.hasAttribute(key) && !['key', 'ref', 'style', 'class'].includes(key)) {
1360
+ rootVnode.$attrs$[key] = hostElm[key];
1361
+ }
1362
+ }
1363
+ }
1364
+ rootVnode.$tag$ = null;
1365
+ rootVnode.$flags$ |= 4 /* VNODE_FLAGS.isHost */;
1366
+ hostRef.$vnode$ = rootVnode;
1367
+ rootVnode.$elm$ = oldVNode.$elm$ = (hostElm.shadowRoot || hostElm );
1368
+ {
1369
+ scopeId = hostElm['s-sc'];
1370
+ }
1371
+ {
1372
+ contentRef = hostElm['s-cr'];
1373
+ useNativeShadowDom = (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) !== 0;
1374
+ // always reset
1375
+ checkSlotFallbackVisibility = false;
1376
+ }
1377
+ // synchronous patch
1378
+ patch(oldVNode, rootVnode);
1379
+ {
1380
+ // while we're moving nodes around existing nodes, temporarily disable
1381
+ // the disconnectCallback from working
1382
+ plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
1383
+ if (checkSlotRelocate) {
1384
+ markSlotContentForRelocation(rootVnode.$elm$);
1385
+ for (const relocateData of relocateNodes) {
1386
+ const nodeToRelocate = relocateData.$nodeToRelocate$;
1387
+ if (!nodeToRelocate['s-ol']) {
1388
+ // add a reference node marking this node's original location
1389
+ // keep a reference to this node for later lookups
1390
+ const orgLocationNode = doc.createTextNode('');
1391
+ orgLocationNode['s-nr'] = nodeToRelocate;
1392
+ nodeToRelocate.parentNode.insertBefore((nodeToRelocate['s-ol'] = orgLocationNode), nodeToRelocate);
1393
+ }
1394
+ }
1395
+ for (const relocateData of relocateNodes) {
1396
+ const nodeToRelocate = relocateData.$nodeToRelocate$;
1397
+ const slotRefNode = relocateData.$slotRefNode$;
1398
+ if (slotRefNode) {
1399
+ const parentNodeRef = slotRefNode.parentNode;
1400
+ // When determining where to insert content, the most simple case would be
1401
+ // to relocate the node immediately following the slot reference node. We do this
1402
+ // by getting a reference to the node immediately following the slot reference node
1403
+ // since we will use `insertBefore` to manipulate the DOM.
1404
+ //
1405
+ // If there is no node immediately following the slot reference node, then we will just
1406
+ // end up appending the node as the last child of the parent.
1407
+ let insertBeforeNode = slotRefNode.nextSibling;
1408
+ // If the node we're currently planning on inserting the new node before is an element,
1409
+ // we need to do some additional checks to make sure we're inserting the node in the correct order.
1410
+ // The use case here would be that we have multiple nodes being relocated to the same slot. So, we want
1411
+ // to make sure they get inserted into their new how in the same order they were declared in their original location.
1412
+ //
1413
+ // TODO(STENCIL-914): Remove `experimentalSlotFixes` check
1414
+ {
1415
+ let orgLocationNode = (_a = nodeToRelocate['s-ol']) === null || _a === void 0 ? void 0 : _a.previousSibling;
1416
+ while (orgLocationNode) {
1417
+ let refNode = (_b = orgLocationNode['s-nr']) !== null && _b !== void 0 ? _b : null;
1418
+ if (refNode && refNode['s-sn'] === nodeToRelocate['s-sn'] && parentNodeRef === refNode.parentNode) {
1419
+ refNode = refNode.nextSibling;
1420
+ if (!refNode || !refNode['s-nr']) {
1421
+ insertBeforeNode = refNode;
1422
+ break;
1423
+ }
1424
+ }
1425
+ orgLocationNode = orgLocationNode.previousSibling;
1426
+ }
1427
+ }
1428
+ if ((!insertBeforeNode && parentNodeRef !== nodeToRelocate.parentNode) ||
1429
+ nodeToRelocate.nextSibling !== insertBeforeNode) {
1430
+ // we've checked that it's worth while to relocate
1431
+ // since that the node to relocate
1432
+ // has a different next sibling or parent relocated
1433
+ if (nodeToRelocate !== insertBeforeNode) {
1434
+ if (!nodeToRelocate['s-hn'] && nodeToRelocate['s-ol']) {
1435
+ // probably a component in the index.html that doesn't have its hostname set
1436
+ nodeToRelocate['s-hn'] = nodeToRelocate['s-ol'].parentNode.nodeName;
1437
+ }
1438
+ // Add it back to the dom but in its new home
1439
+ // If we get to this point and `insertBeforeNode` is `null`, that means
1440
+ // we're just going to append the node as the last child of the parent. Passing
1441
+ // `null` as the second arg here will trigger that behavior.
1442
+ parentNodeRef.insertBefore(nodeToRelocate, insertBeforeNode);
1443
+ // Reset the `hidden` value back to what it was defined as originally
1444
+ // This solves a problem where a `slot` is dynamically rendered and `hidden` may have
1445
+ // been set on content originally, but now it has a slot to go to so it should have
1446
+ // the value it was defined as having in the DOM, not what we overrode it to.
1447
+ if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
1448
+ nodeToRelocate.hidden = (_c = nodeToRelocate['s-ih']) !== null && _c !== void 0 ? _c : false;
1449
+ }
1450
+ }
1451
+ }
1452
+ }
1453
+ else {
1454
+ // this node doesn't have a slot home to go to, so let's hide it
1455
+ if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
1456
+ // Store the initial value of `hidden` so we can reset it later when
1457
+ // moving nodes around.
1458
+ if (isInitialLoad) {
1459
+ nodeToRelocate['s-ih'] = (_d = nodeToRelocate.hidden) !== null && _d !== void 0 ? _d : false;
1460
+ }
1461
+ nodeToRelocate.hidden = true;
1462
+ }
1463
+ }
1464
+ }
1465
+ }
1466
+ if (checkSlotFallbackVisibility) {
1467
+ updateFallbackSlotVisibility(rootVnode.$elm$);
1468
+ }
1469
+ // done moving nodes around
1470
+ // allow the disconnect callback to work again
1471
+ plt.$flags$ &= ~1 /* PLATFORM_FLAGS.isTmpDisconnected */;
1472
+ // always reset
1473
+ relocateNodes.length = 0;
1474
+ }
1475
+ };
1476
+ const attachToAncestor = (hostRef, ancestorComponent) => {
1477
+ if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
1478
+ ancestorComponent['s-p'].push(new Promise((r) => (hostRef.$onRenderResolve$ = r)));
1479
+ }
1480
+ };
1481
+ const scheduleUpdate = (hostRef, isInitialLoad) => {
1482
+ {
1483
+ hostRef.$flags$ |= 16 /* HOST_FLAGS.isQueuedForUpdate */;
1484
+ }
1485
+ if (hostRef.$flags$ & 4 /* HOST_FLAGS.isWaitingForChildren */) {
1486
+ hostRef.$flags$ |= 512 /* HOST_FLAGS.needsRerender */;
1487
+ return;
1488
+ }
1489
+ attachToAncestor(hostRef, hostRef.$ancestorComponent$);
1490
+ // there is no ancestor component or the ancestor component
1491
+ // has already fired off its lifecycle update then
1492
+ // fire off the initial update
1493
+ const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
1494
+ return writeTask(dispatch) ;
1495
+ };
1496
+ /**
1497
+ * Dispatch initial-render and update lifecycle hooks, enqueuing calls to
1498
+ * component lifecycle methods like `componentWillLoad` as well as
1499
+ * {@link updateComponent}, which will kick off the virtual DOM re-render.
1500
+ *
1501
+ * @param hostRef a reference to a host DOM node
1502
+ * @param isInitialLoad whether we're on the initial load or not
1503
+ * @returns an empty Promise which is used to enqueue a series of operations for
1504
+ * the component
1505
+ */
1506
+ const dispatchHooks = (hostRef, isInitialLoad) => {
1507
+ const endSchedule = createTime('scheduleUpdate', hostRef.$cmpMeta$.$tagName$);
1508
+ const instance = hostRef.$lazyInstance$ ;
1509
+ // We're going to use this variable together with `enqueue` to implement a
1510
+ // little promise-based queue. We start out with it `undefined`. When we add
1511
+ // the first function to the queue we'll set this variable to be that
1512
+ // function's return value. When we attempt to add subsequent values to the
1513
+ // queue we'll check that value and, if it was a `Promise`, we'll then chain
1514
+ // the new function off of that `Promise` using `.then()`. This will give our
1515
+ // queue two nice properties:
1516
+ //
1517
+ // 1. If all functions added to the queue are synchronous they'll be called
1518
+ // synchronously right away.
1519
+ // 2. If all functions added to the queue are asynchronous they'll all be
1520
+ // called in order after `dispatchHooks` exits.
1521
+ let maybePromise;
1522
+ if (isInitialLoad) {
1523
+ {
1524
+ hostRef.$flags$ |= 256 /* HOST_FLAGS.isListenReady */;
1525
+ if (hostRef.$queuedListeners$) {
1526
+ hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
1527
+ hostRef.$queuedListeners$ = undefined;
1528
+ }
1529
+ }
1530
+ {
1531
+ // If `componentWillLoad` returns a `Promise` then we want to wait on
1532
+ // whatever's going on in that `Promise` before we launch into
1533
+ // rendering the component, doing other lifecycle stuff, etc. So
1534
+ // in that case we assign the returned promise to the variable we
1535
+ // declared above to hold a possible 'queueing' Promise
1536
+ maybePromise = safeCall(instance, 'componentWillLoad');
1537
+ }
1538
+ }
1539
+ else {
1540
+ {
1541
+ // Like `componentWillLoad` above, we allow Stencil component
1542
+ // authors to return a `Promise` from this lifecycle callback, and
1543
+ // we specify that our runtime will wait for that `Promise` to
1544
+ // resolve before the component re-renders. So if the method
1545
+ // returns a `Promise` we need to keep it around!
1546
+ maybePromise = safeCall(instance, 'componentWillUpdate');
1547
+ }
1548
+ }
1549
+ endSchedule();
1550
+ return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
1551
+ };
1552
+ /**
1553
+ * This function uses a Promise to implement a simple first-in, first-out queue
1554
+ * of functions to be called.
1555
+ *
1556
+ * The queue is ordered on the basis of the first argument. If it's
1557
+ * `undefined`, then nothing is on the queue yet, so the provided function can
1558
+ * be called synchronously (although note that this function may return a
1559
+ * `Promise`). The idea is that then the return value of that enqueueing
1560
+ * operation is kept around, so that if it was a `Promise` then subsequent
1561
+ * functions can be enqueued by calling this function again with that `Promise`
1562
+ * as the first argument.
1563
+ *
1564
+ * @param maybePromise either a `Promise` which should resolve before the next function is called or an 'empty' sentinel
1565
+ * @param fn a function to enqueue
1566
+ * @returns either a `Promise` or the return value of the provided function
1567
+ */
1568
+ const enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then(fn) : fn();
1569
+ /**
1570
+ * Check that a value is a `Promise`. To check, we first see if the value is an
1571
+ * instance of the `Promise` global. In a few circumstances, in particular if
1572
+ * the global has been overwritten, this is could be misleading, so we also do
1573
+ * a little 'duck typing' check to see if the `.then` property of the value is
1574
+ * defined and a function.
1575
+ *
1576
+ * @param maybePromise it might be a promise!
1577
+ * @returns whether it is or not
1578
+ */
1579
+ const isPromisey = (maybePromise) => maybePromise instanceof Promise ||
1580
+ (maybePromise && maybePromise.then && typeof maybePromise.then === 'function');
1581
+ /**
1582
+ * Update a component given reference to its host elements and so on.
1583
+ *
1584
+ * @param hostRef an object containing references to the element's host node,
1585
+ * VDom nodes, and other metadata
1586
+ * @param instance a reference to the underlying host element where it will be
1587
+ * rendered
1588
+ * @param isInitialLoad whether or not this function is being called as part of
1589
+ * the first render cycle
1590
+ */
1591
+ const updateComponent = async (hostRef, instance, isInitialLoad) => {
1592
+ var _a;
1593
+ const elm = hostRef.$hostElement$;
1594
+ const endUpdate = createTime('update', hostRef.$cmpMeta$.$tagName$);
1595
+ const rc = elm['s-rc'];
1596
+ if (isInitialLoad) {
1597
+ // DOM WRITE!
1598
+ attachStyles(hostRef);
1599
+ }
1600
+ const endRender = createTime('render', hostRef.$cmpMeta$.$tagName$);
1601
+ {
1602
+ callRender(hostRef, instance, elm, isInitialLoad);
1603
+ }
1604
+ if (rc) {
1605
+ // ok, so turns out there are some child host elements
1606
+ // waiting on this parent element to load
1607
+ // let's fire off all update callbacks waiting
1608
+ rc.map((cb) => cb());
1609
+ elm['s-rc'] = undefined;
1610
+ }
1611
+ endRender();
1612
+ endUpdate();
1613
+ {
1614
+ const childrenPromises = (_a = elm['s-p']) !== null && _a !== void 0 ? _a : [];
1615
+ const postUpdate = () => postUpdateComponent(hostRef);
1616
+ if (childrenPromises.length === 0) {
1617
+ postUpdate();
1618
+ }
1619
+ else {
1620
+ Promise.all(childrenPromises).then(postUpdate);
1621
+ hostRef.$flags$ |= 4 /* HOST_FLAGS.isWaitingForChildren */;
1622
+ childrenPromises.length = 0;
1623
+ }
1624
+ }
1625
+ };
1626
+ /**
1627
+ * Handle making the call to the VDom renderer with the proper context given
1628
+ * various build variables
1629
+ *
1630
+ * @param hostRef an object containing references to the element's host node,
1631
+ * VDom nodes, and other metadata
1632
+ * @param instance a reference to the underlying host element where it will be
1633
+ * rendered
1634
+ * @param elm the Host element for the component
1635
+ * @param isInitialLoad whether or not this function is being called as part of
1636
+ * @returns an empty promise
1637
+ */
1638
+ const callRender = (hostRef, instance, elm, isInitialLoad) => {
1639
+ try {
1640
+ /**
1641
+ * minification optimization: `allRenderFn` is `true` if all components have a `render`
1642
+ * method, so we can call the method immediately. If not, check before calling it.
1643
+ */
1644
+ instance = instance.render && instance.render();
1645
+ {
1646
+ hostRef.$flags$ &= ~16 /* HOST_FLAGS.isQueuedForUpdate */;
1647
+ }
1648
+ {
1649
+ hostRef.$flags$ |= 2 /* HOST_FLAGS.hasRendered */;
1650
+ }
1651
+ {
1652
+ {
1653
+ // looks like we've got child nodes to render into this host element
1654
+ // or we need to update the css class/attrs on the host element
1655
+ // DOM WRITE!
1656
+ {
1657
+ renderVdom(hostRef, instance, isInitialLoad);
1658
+ }
1659
+ }
1660
+ }
1661
+ }
1662
+ catch (e) {
1663
+ consoleError(e, hostRef.$hostElement$);
1664
+ }
1665
+ return null;
1666
+ };
1667
+ const postUpdateComponent = (hostRef) => {
1668
+ const tagName = hostRef.$cmpMeta$.$tagName$;
1669
+ const elm = hostRef.$hostElement$;
1670
+ const endPostUpdate = createTime('postUpdate', tagName);
1671
+ const instance = hostRef.$lazyInstance$ ;
1672
+ const ancestorComponent = hostRef.$ancestorComponent$;
1673
+ {
1674
+ safeCall(instance, 'componentDidRender');
1675
+ }
1676
+ if (!(hostRef.$flags$ & 64 /* HOST_FLAGS.hasLoadedComponent */)) {
1677
+ hostRef.$flags$ |= 64 /* HOST_FLAGS.hasLoadedComponent */;
1678
+ {
1679
+ // DOM WRITE!
1680
+ addHydratedFlag(elm);
1681
+ }
1682
+ {
1683
+ safeCall(instance, 'componentDidLoad');
1684
+ }
1685
+ endPostUpdate();
1686
+ {
1687
+ hostRef.$onReadyResolve$(elm);
1688
+ if (!ancestorComponent) {
1689
+ appDidLoad();
1690
+ }
1691
+ }
1692
+ }
1693
+ else {
1694
+ {
1695
+ safeCall(instance, 'componentDidUpdate');
1696
+ }
1697
+ endPostUpdate();
1698
+ }
1699
+ {
1700
+ hostRef.$onInstanceResolve$(elm);
1701
+ }
1702
+ // load events fire from bottom to top
1703
+ // the deepest elements load first then bubbles up
1704
+ {
1705
+ if (hostRef.$onRenderResolve$) {
1706
+ hostRef.$onRenderResolve$();
1707
+ hostRef.$onRenderResolve$ = undefined;
1708
+ }
1709
+ if (hostRef.$flags$ & 512 /* HOST_FLAGS.needsRerender */) {
1710
+ nextTick(() => scheduleUpdate(hostRef, false));
1711
+ }
1712
+ hostRef.$flags$ &= ~(4 /* HOST_FLAGS.isWaitingForChildren */ | 512 /* HOST_FLAGS.needsRerender */);
1713
+ }
1714
+ // ( •_•)
1715
+ // ( •_•)>⌐■-■
1716
+ // (⌐■_■)
1717
+ };
1718
+ const forceUpdate = (ref) => {
1719
+ {
1720
+ const hostRef = getHostRef(ref);
1721
+ const isConnected = hostRef.$hostElement$.isConnected;
1722
+ if (isConnected &&
1723
+ (hostRef.$flags$ & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
1724
+ scheduleUpdate(hostRef, false);
1725
+ }
1726
+ // Returns "true" when the forced update was successfully scheduled
1727
+ return isConnected;
1728
+ }
1729
+ };
1730
+ const appDidLoad = (who) => {
1731
+ // on appload
1732
+ // we have finish the first big initial render
1733
+ {
1734
+ addHydratedFlag(doc.documentElement);
1735
+ }
1736
+ nextTick(() => emitEvent(win, 'appload', { detail: { namespace: NAMESPACE } }));
1737
+ };
1738
+ /**
1739
+ * Allows to safely call a method, e.g. `componentDidLoad`, on an instance,
1740
+ * e.g. custom element node. If a build figures out that e.g. no component
1741
+ * has a `componentDidLoad` method, the instance method gets removed from the
1742
+ * output bundle and this function returns `undefined`.
1743
+ * @param instance any object that may or may not contain methods
1744
+ * @param method method name
1745
+ * @param arg single arbitrary argument
1746
+ * @returns result of method call if it exists, otherwise `undefined`
1747
+ */
1748
+ const safeCall = (instance, method, arg) => {
1749
+ if (instance && instance[method]) {
1750
+ try {
1751
+ return instance[method](arg);
1752
+ }
1753
+ catch (e) {
1754
+ consoleError(e);
1755
+ }
1756
+ }
1757
+ return undefined;
1758
+ };
1759
+ const addHydratedFlag = (elm) => elm.classList.add('hydrated')
1760
+ ;
1761
+ const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
1762
+ const setValue = (ref, propName, newVal, cmpMeta) => {
1763
+ // check our new property value against our internal value
1764
+ const hostRef = getHostRef(ref);
1765
+ const elm = hostRef.$hostElement$ ;
1766
+ const oldVal = hostRef.$instanceValues$.get(propName);
1767
+ const flags = hostRef.$flags$;
1768
+ const instance = hostRef.$lazyInstance$ ;
1769
+ newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
1770
+ // explicitly check for NaN on both sides, as `NaN === NaN` is always false
1771
+ const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
1772
+ const didValueChange = newVal !== oldVal && !areBothNaN;
1773
+ if ((!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) || oldVal === undefined) && didValueChange) {
1774
+ // gadzooks! the property's value has changed!!
1775
+ // set our new value!
1776
+ hostRef.$instanceValues$.set(propName, newVal);
1777
+ if (instance) {
1778
+ // get an array of method names of watch functions to call
1779
+ if (cmpMeta.$watchers$ && flags & 128 /* HOST_FLAGS.isWatchReady */) {
1780
+ const watchMethods = cmpMeta.$watchers$[propName];
1781
+ if (watchMethods) {
1782
+ // this instance is watching for when this property changed
1783
+ watchMethods.map((watchMethodName) => {
1784
+ try {
1785
+ // fire off each of the watch methods that are watching this property
1786
+ instance[watchMethodName](newVal, oldVal, propName);
1787
+ }
1788
+ catch (e) {
1789
+ consoleError(e, elm);
1790
+ }
1791
+ });
1792
+ }
1793
+ }
1794
+ if ((flags & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
1795
+ // looks like this value actually changed, so we've got work to do!
1796
+ // but only if we've already rendered, otherwise just chill out
1797
+ // queue that we need to do an update, but don't worry about queuing
1798
+ // up millions cuz this function ensures it only runs once
1799
+ scheduleUpdate(hostRef, false);
1800
+ }
1801
+ }
1802
+ }
1803
+ };
1804
+ /**
1805
+ * Attach a series of runtime constructs to a compiled Stencil component
1806
+ * constructor, including getters and setters for the `@Prop` and `@State`
1807
+ * decorators, callbacks for when attributes change, and so on.
1808
+ *
1809
+ * @param Cstr the constructor for a component that we need to process
1810
+ * @param cmpMeta metadata collected previously about the component
1811
+ * @param flags a number used to store a series of bit flags
1812
+ * @returns a reference to the same constructor passed in (but now mutated)
1813
+ */
1814
+ const proxyComponent = (Cstr, cmpMeta, flags) => {
1815
+ var _a;
1816
+ const prototype = Cstr.prototype;
1817
+ if (cmpMeta.$members$) {
1818
+ if (Cstr.watchers) {
1819
+ cmpMeta.$watchers$ = Cstr.watchers;
1820
+ }
1821
+ // It's better to have a const than two Object.entries()
1822
+ const members = Object.entries(cmpMeta.$members$);
1823
+ members.map(([memberName, [memberFlags]]) => {
1824
+ if ((memberFlags & 31 /* MEMBER_FLAGS.Prop */ ||
1825
+ ((flags & 2 /* PROXY_FLAGS.proxyState */) && memberFlags & 32 /* MEMBER_FLAGS.State */))) {
1826
+ // proxyComponent - prop
1827
+ Object.defineProperty(prototype, memberName, {
1828
+ get() {
1829
+ // proxyComponent, get value
1830
+ return getValue(this, memberName);
1831
+ },
1832
+ set(newValue) {
1833
+ // proxyComponent, set value
1834
+ setValue(this, memberName, newValue, cmpMeta);
1835
+ },
1836
+ configurable: true,
1837
+ enumerable: true,
1838
+ });
1839
+ }
1840
+ else if (flags & 1 /* PROXY_FLAGS.isElementConstructor */ &&
1841
+ memberFlags & 64 /* MEMBER_FLAGS.Method */) {
1842
+ // proxyComponent - method
1843
+ Object.defineProperty(prototype, memberName, {
1844
+ value(...args) {
1845
+ var _a;
1846
+ const ref = getHostRef(this);
1847
+ return (_a = ref === null || ref === void 0 ? void 0 : ref.$onInstancePromise$) === null || _a === void 0 ? void 0 : _a.then(() => { var _a; return (_a = ref.$lazyInstance$) === null || _a === void 0 ? void 0 : _a[memberName](...args); });
1848
+ },
1849
+ });
1850
+ }
1851
+ });
1852
+ if ((flags & 1 /* PROXY_FLAGS.isElementConstructor */)) {
1853
+ const attrNameToPropName = new Map();
1854
+ prototype.attributeChangedCallback = function (attrName, oldValue, newValue) {
1855
+ plt.jmp(() => {
1856
+ var _a;
1857
+ const propName = attrNameToPropName.get(attrName);
1858
+ // In a web component lifecycle the attributeChangedCallback runs prior to connectedCallback
1859
+ // in the case where an attribute was set inline.
1860
+ // ```html
1861
+ // <my-component some-attribute="some-value"></my-component>
1862
+ // ```
1863
+ //
1864
+ // There is an edge case where a developer sets the attribute inline on a custom element and then
1865
+ // programmatically changes it before it has been upgraded as shown below:
1866
+ //
1867
+ // ```html
1868
+ // <!-- this component has _not_ been upgraded yet -->
1869
+ // <my-component id="test" some-attribute="some-value"></my-component>
1870
+ // <script>
1871
+ // // grab non-upgraded component
1872
+ // el = document.querySelector("#test");
1873
+ // el.someAttribute = "another-value";
1874
+ // // upgrade component
1875
+ // customElements.define('my-component', MyComponent);
1876
+ // </script>
1877
+ // ```
1878
+ // In this case if we do not un-shadow here and use the value of the shadowing property, attributeChangedCallback
1879
+ // will be called with `newValue = "some-value"` and will set the shadowed property (this.someAttribute = "another-value")
1880
+ // to the value that was set inline i.e. "some-value" from above example. When
1881
+ // the connectedCallback attempts to un-shadow it will use "some-value" as the initial value rather than "another-value"
1882
+ //
1883
+ // The case where the attribute was NOT set inline but was not set programmatically shall be handled/un-shadowed
1884
+ // by connectedCallback as this attributeChangedCallback will not fire.
1885
+ //
1886
+ // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
1887
+ //
1888
+ // TODO(STENCIL-16) we should think about whether or not we actually want to be reflecting the attributes to
1889
+ // properties here given that this goes against best practices outlined here
1890
+ // https://developers.google.com/web/fundamentals/web-components/best-practices#avoid-reentrancy
1891
+ if (this.hasOwnProperty(propName)) {
1892
+ newValue = this[propName];
1893
+ delete this[propName];
1894
+ }
1895
+ else if (prototype.hasOwnProperty(propName) &&
1896
+ typeof this[propName] === 'number' &&
1897
+ this[propName] == newValue) {
1898
+ // if the propName exists on the prototype of `Cstr`, this update may be a result of Stencil using native
1899
+ // APIs to reflect props as attributes. Calls to `setAttribute(someElement, propName)` will result in
1900
+ // `propName` to be converted to a `DOMString`, which may not be what we want for other primitive props.
1901
+ return;
1902
+ }
1903
+ else if (propName == null) {
1904
+ // At this point we should know this is not a "member", so we can treat it like watching an attribute
1905
+ // on a vanilla web component
1906
+ const hostRef = getHostRef(this);
1907
+ const flags = hostRef === null || hostRef === void 0 ? void 0 : hostRef.$flags$;
1908
+ // We only want to trigger the callback(s) if:
1909
+ // 1. The instance is ready
1910
+ // 2. The watchers are ready
1911
+ // 3. The value has changed
1912
+ if (flags &&
1913
+ !(flags & 8 /* HOST_FLAGS.isConstructingInstance */) &&
1914
+ flags & 128 /* HOST_FLAGS.isWatchReady */ &&
1915
+ newValue !== oldValue) {
1916
+ const instance = hostRef.$lazyInstance$ ;
1917
+ const entry = (_a = cmpMeta.$watchers$) === null || _a === void 0 ? void 0 : _a[attrName];
1918
+ entry === null || entry === void 0 ? void 0 : entry.forEach((callbackName) => {
1919
+ if (instance[callbackName] != null) {
1920
+ instance[callbackName].call(instance, newValue, oldValue, attrName);
1921
+ }
1922
+ });
1923
+ }
1924
+ return;
1925
+ }
1926
+ this[propName] = newValue === null && typeof this[propName] === 'boolean' ? false : newValue;
1927
+ });
1928
+ };
1929
+ // Create an array of attributes to observe
1930
+ // This list in comprised of all strings used within a `@Watch()` decorator
1931
+ // on a component as well as any Stencil-specific "members" (`@Prop()`s and `@State()`s).
1932
+ // As such, there is no way to guarantee type-safety here that a user hasn't entered
1933
+ // an invalid attribute.
1934
+ Cstr.observedAttributes = Array.from(new Set([
1935
+ ...Object.keys((_a = cmpMeta.$watchers$) !== null && _a !== void 0 ? _a : {}),
1936
+ ...members
1937
+ .filter(([_, m]) => m[0] & 15 /* MEMBER_FLAGS.HasAttribute */)
1938
+ .map(([propName, m]) => {
1939
+ var _a;
1940
+ const attrName = m[1] || propName;
1941
+ attrNameToPropName.set(attrName, propName);
1942
+ if (m[0] & 512 /* MEMBER_FLAGS.ReflectAttr */) {
1943
+ (_a = cmpMeta.$attrsToReflect$) === null || _a === void 0 ? void 0 : _a.push([propName, attrName]);
1944
+ }
1945
+ return attrName;
1946
+ }),
1947
+ ]));
1948
+ }
1949
+ }
1950
+ return Cstr;
1951
+ };
1952
+ /**
1953
+ * Initialize a Stencil component given a reference to its host element, its
1954
+ * runtime bookkeeping data structure, runtime metadata about the component,
1955
+ * and (optionally) an HMR version ID.
1956
+ *
1957
+ * @param elm a host element
1958
+ * @param hostRef the element's runtime bookkeeping object
1959
+ * @param cmpMeta runtime metadata for the Stencil component
1960
+ * @param hmrVersionId an (optional) HMR version ID
1961
+ */
1962
+ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1963
+ let Cstr;
1964
+ // initializeComponent
1965
+ if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
1966
+ // Let the runtime know that the component has been initialized
1967
+ hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
1968
+ {
1969
+ // lazy loaded components
1970
+ // request the component's implementation to be
1971
+ // wired up with the host element
1972
+ Cstr = loadModule(cmpMeta);
1973
+ if (Cstr.then) {
1974
+ // Await creates a micro-task avoid if possible
1975
+ const endLoad = uniqueTime();
1976
+ Cstr = await Cstr;
1977
+ endLoad();
1978
+ }
1979
+ if (!Cstr.isProxied) {
1980
+ // we've never proxied this Constructor before
1981
+ // let's add the getters/setters to its prototype before
1982
+ // the first time we create an instance of the implementation
1983
+ {
1984
+ cmpMeta.$watchers$ = Cstr.watchers;
1985
+ }
1986
+ proxyComponent(Cstr, cmpMeta, 2 /* PROXY_FLAGS.proxyState */);
1987
+ Cstr.isProxied = true;
1988
+ }
1989
+ const endNewInstance = createTime('createInstance', cmpMeta.$tagName$);
1990
+ // ok, time to construct the instance
1991
+ // but let's keep track of when we start and stop
1992
+ // so that the getters/setters don't incorrectly step on data
1993
+ {
1994
+ hostRef.$flags$ |= 8 /* HOST_FLAGS.isConstructingInstance */;
1995
+ }
1996
+ // construct the lazy-loaded component implementation
1997
+ // passing the hostRef is very important during
1998
+ // construction in order to directly wire together the
1999
+ // host element and the lazy-loaded instance
2000
+ try {
2001
+ new Cstr(hostRef);
2002
+ }
2003
+ catch (e) {
2004
+ consoleError(e);
2005
+ }
2006
+ {
2007
+ hostRef.$flags$ &= ~8 /* HOST_FLAGS.isConstructingInstance */;
2008
+ }
2009
+ {
2010
+ hostRef.$flags$ |= 128 /* HOST_FLAGS.isWatchReady */;
2011
+ }
2012
+ endNewInstance();
2013
+ }
2014
+ if (Cstr.style) {
2015
+ // this component has styles but we haven't registered them yet
2016
+ let style = Cstr.style;
2017
+ const scopeId = getScopeId(cmpMeta);
2018
+ if (!styles.has(scopeId)) {
2019
+ const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
2020
+ registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */));
2021
+ endRegisterStyles();
2022
+ }
2023
+ }
2024
+ }
2025
+ // we've successfully created a lazy instance
2026
+ const ancestorComponent = hostRef.$ancestorComponent$;
2027
+ const schedule = () => scheduleUpdate(hostRef, true);
2028
+ if (ancestorComponent && ancestorComponent['s-rc']) {
2029
+ // this is the initial load and this component it has an ancestor component
2030
+ // but the ancestor component has NOT fired its will update lifecycle yet
2031
+ // so let's just cool our jets and wait for the ancestor to continue first
2032
+ // this will get fired off when the ancestor component
2033
+ // finally gets around to rendering its lazy self
2034
+ // fire off the initial update
2035
+ ancestorComponent['s-rc'].push(schedule);
2036
+ }
2037
+ else {
2038
+ schedule();
2039
+ }
2040
+ };
2041
+ const fireConnectedCallback = (instance) => {
2042
+ };
2043
+ const connectedCallback = (elm) => {
2044
+ if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
2045
+ const hostRef = getHostRef(elm);
2046
+ const cmpMeta = hostRef.$cmpMeta$;
2047
+ const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
2048
+ if (!(hostRef.$flags$ & 1 /* HOST_FLAGS.hasConnected */)) {
2049
+ // first time this component has connected
2050
+ hostRef.$flags$ |= 1 /* HOST_FLAGS.hasConnected */;
2051
+ {
2052
+ // initUpdate
2053
+ // if the slot polyfill is required we'll need to put some nodes
2054
+ // in here to act as original content anchors as we move nodes around
2055
+ // host element has been connected to the DOM
2056
+ if ((// TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
2057
+ cmpMeta.$flags$ & (4 /* CMP_FLAGS.hasSlotRelocation */ | 8 /* CMP_FLAGS.needsShadowDomShim */))) {
2058
+ setContentReference(elm);
2059
+ }
2060
+ }
2061
+ {
2062
+ // find the first ancestor component (if there is one) and register
2063
+ // this component as one of the actively loading child components for its ancestor
2064
+ let ancestorComponent = elm;
2065
+ while ((ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host)) {
2066
+ // climb up the ancestors looking for the first
2067
+ // component that hasn't finished its lifecycle update yet
2068
+ if (ancestorComponent['s-p']) {
2069
+ // we found this components first ancestor component
2070
+ // keep a reference to this component's ancestor component
2071
+ attachToAncestor(hostRef, (hostRef.$ancestorComponent$ = ancestorComponent));
2072
+ break;
2073
+ }
2074
+ }
2075
+ }
2076
+ // Lazy properties
2077
+ // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
2078
+ if (cmpMeta.$members$) {
2079
+ Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
2080
+ if (memberFlags & 31 /* MEMBER_FLAGS.Prop */ && elm.hasOwnProperty(memberName)) {
2081
+ const value = elm[memberName];
2082
+ delete elm[memberName];
2083
+ elm[memberName] = value;
2084
+ }
2085
+ });
2086
+ }
2087
+ {
2088
+ initializeComponent(elm, hostRef, cmpMeta);
2089
+ }
2090
+ }
2091
+ else {
2092
+ // not the first time this has connected
2093
+ // reattach any event listeners to the host
2094
+ // since they would have been removed when disconnected
2095
+ addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
2096
+ // fire off connectedCallback() on component instance
2097
+ if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$) ;
2098
+ else if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$onReadyPromise$) {
2099
+ hostRef.$onReadyPromise$.then(() => fireConnectedCallback());
2100
+ }
2101
+ }
2102
+ endConnected();
2103
+ }
2104
+ };
2105
+ const setContentReference = (elm) => {
2106
+ // only required when we're NOT using native shadow dom (slot)
2107
+ // or this browser doesn't support native shadow dom
2108
+ // and this host element was NOT created with SSR
2109
+ // let's pick out the inner content for slot projection
2110
+ // create a node to represent where the original
2111
+ // content was first placed, which is useful later on
2112
+ const contentRefElm = (elm['s-cr'] = doc.createComment(''));
2113
+ contentRefElm['s-cn'] = true;
2114
+ elm.insertBefore(contentRefElm, elm.firstChild);
2115
+ };
2116
+ const disconnectInstance = (instance) => {
2117
+ };
2118
+ const disconnectedCallback = async (elm) => {
2119
+ if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
2120
+ const hostRef = getHostRef(elm);
2121
+ {
2122
+ if (hostRef.$rmListeners$) {
2123
+ hostRef.$rmListeners$.map((rmListener) => rmListener());
2124
+ hostRef.$rmListeners$ = undefined;
2125
+ }
2126
+ }
2127
+ if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$) ;
2128
+ else if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$onReadyPromise$) {
2129
+ hostRef.$onReadyPromise$.then(() => disconnectInstance());
2130
+ }
2131
+ }
2132
+ };
2133
+ const bootstrapLazy = (lazyBundles, options = {}) => {
2134
+ var _a;
2135
+ const endBootstrap = createTime();
2136
+ const cmpTags = [];
2137
+ const exclude = options.exclude || [];
2138
+ const customElements = win.customElements;
2139
+ const head = doc.head;
2140
+ const metaCharset = /*@__PURE__*/ head.querySelector('meta[charset]');
2141
+ const dataStyles = /*@__PURE__*/ doc.createElement('style');
2142
+ const deferredConnectedCallbacks = [];
2143
+ let appLoadFallback;
2144
+ let isBootstrapping = true;
2145
+ Object.assign(plt, options);
2146
+ plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
2147
+ let hasSlotRelocation = false;
2148
+ lazyBundles.map((lazyBundle) => {
2149
+ lazyBundle[1].map((compactMeta) => {
2150
+ var _a;
2151
+ const cmpMeta = {
2152
+ $flags$: compactMeta[0],
2153
+ $tagName$: compactMeta[1],
2154
+ $members$: compactMeta[2],
2155
+ $listeners$: compactMeta[3],
2156
+ };
2157
+ // Check if we are using slots outside the shadow DOM in this component.
2158
+ // We'll use this information later to add styles for `slot-fb` elements
2159
+ if (cmpMeta.$flags$ & 4 /* CMP_FLAGS.hasSlotRelocation */) {
2160
+ hasSlotRelocation = true;
2161
+ }
2162
+ {
2163
+ cmpMeta.$members$ = compactMeta[2];
2164
+ }
2165
+ {
2166
+ cmpMeta.$listeners$ = compactMeta[3];
2167
+ }
2168
+ {
2169
+ cmpMeta.$attrsToReflect$ = [];
2170
+ }
2171
+ {
2172
+ cmpMeta.$watchers$ = (_a = compactMeta[4]) !== null && _a !== void 0 ? _a : {};
2173
+ }
2174
+ const tagName = cmpMeta.$tagName$;
2175
+ const HostElement = class extends HTMLElement {
2176
+ // StencilLazyHost
2177
+ constructor(self) {
2178
+ // @ts-ignore
2179
+ super(self);
2180
+ self = this;
2181
+ registerHost(self, cmpMeta);
2182
+ if (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
2183
+ // this component is using shadow dom
2184
+ // and this browser supports shadow dom
2185
+ // add the read-only property "shadowRoot" to the host element
2186
+ // adding the shadow root build conditionals to minimize runtime
2187
+ {
2188
+ {
2189
+ self.attachShadow({
2190
+ mode: 'open',
2191
+ delegatesFocus: !!(cmpMeta.$flags$ & 16 /* CMP_FLAGS.shadowDelegatesFocus */),
2192
+ });
2193
+ }
2194
+ }
2195
+ }
2196
+ }
2197
+ connectedCallback() {
2198
+ if (appLoadFallback) {
2199
+ clearTimeout(appLoadFallback);
2200
+ appLoadFallback = null;
2201
+ }
2202
+ if (isBootstrapping) {
2203
+ // connectedCallback will be processed once all components have been registered
2204
+ deferredConnectedCallbacks.push(this);
2205
+ }
2206
+ else {
2207
+ plt.jmp(() => connectedCallback(this));
2208
+ }
2209
+ }
2210
+ disconnectedCallback() {
2211
+ plt.jmp(() => disconnectedCallback(this));
2212
+ }
2213
+ componentOnReady() {
2214
+ return getHostRef(this).$onReadyPromise$;
2215
+ }
2216
+ };
2217
+ cmpMeta.$lazyBundleId$ = lazyBundle[0];
2218
+ if (!exclude.includes(tagName) && !customElements.get(tagName)) {
2219
+ cmpTags.push(tagName);
2220
+ customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* PROXY_FLAGS.isElementConstructor */));
2221
+ }
2222
+ });
2223
+ });
2224
+ // Add styles for `slot-fb` elements if any of our components are using slots outside the Shadow DOM
2225
+ if (hasSlotRelocation) {
2226
+ dataStyles.innerHTML += SLOT_FB_CSS;
2227
+ }
2228
+ // Add hydration styles
2229
+ {
2230
+ dataStyles.innerHTML += cmpTags + HYDRATED_CSS;
2231
+ }
2232
+ // If we have styles, add them to the DOM
2233
+ if (dataStyles.innerHTML.length) {
2234
+ dataStyles.setAttribute('data-styles', '');
2235
+ // Apply CSP nonce to the style tag if it exists
2236
+ const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
2237
+ if (nonce != null) {
2238
+ dataStyles.setAttribute('nonce', nonce);
2239
+ }
2240
+ // Insert the styles into the document head
2241
+ // NOTE: this _needs_ to happen last so we can ensure the nonce (and other attributes) are applied
2242
+ head.insertBefore(dataStyles, metaCharset ? metaCharset.nextSibling : head.firstChild);
2243
+ }
2244
+ // Process deferred connectedCallbacks now all components have been registered
2245
+ isBootstrapping = false;
2246
+ if (deferredConnectedCallbacks.length) {
2247
+ deferredConnectedCallbacks.map((host) => host.connectedCallback());
2248
+ }
2249
+ else {
2250
+ {
2251
+ plt.jmp(() => (appLoadFallback = setTimeout(appDidLoad, 30)));
2252
+ }
2253
+ }
2254
+ // Fallback appLoad event
2255
+ endBootstrap();
2256
+ };
2257
+ const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
2258
+ if (listeners) {
2259
+ listeners.map(([flags, name, method]) => {
2260
+ const target = getHostListenerTarget(elm, flags) ;
2261
+ const handler = hostListenerProxy(hostRef, method);
2262
+ const opts = hostListenerOpts(flags);
2263
+ plt.ael(target, name, handler, opts);
2264
+ (hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
2265
+ });
2266
+ }
2267
+ };
2268
+ const hostListenerProxy = (hostRef, methodName) => (ev) => {
2269
+ try {
2270
+ {
2271
+ if (hostRef.$flags$ & 256 /* HOST_FLAGS.isListenReady */) {
2272
+ // instance is ready, let's call it's member method for this event
2273
+ hostRef.$lazyInstance$[methodName](ev);
2274
+ }
2275
+ else {
2276
+ (hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
2277
+ }
2278
+ }
2279
+ }
2280
+ catch (e) {
2281
+ consoleError(e);
2282
+ }
2283
+ };
2284
+ const getHostListenerTarget = (elm, flags) => {
2285
+ if (flags & 4 /* LISTENER_FLAGS.TargetDocument */)
2286
+ return doc;
2287
+ if (flags & 8 /* LISTENER_FLAGS.TargetWindow */)
2288
+ return win;
2289
+ return elm;
2290
+ };
2291
+ // prettier-ignore
2292
+ const hostListenerOpts = (flags) => (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0;
2293
+ /**
2294
+ * Assigns the given value to the nonce property on the runtime platform object.
2295
+ * During runtime, this value is used to set the nonce attribute on all dynamically created script and style tags.
2296
+ * @param nonce The value to be assigned to the platform nonce property.
2297
+ * @returns void
2298
+ */
2299
+ const setNonce = (nonce) => (plt.$nonce$ = nonce);
2300
+ /**
2301
+ * A WeakMap mapping runtime component references to their corresponding host reference
2302
+ * instances.
2303
+ */
2304
+ const hostRefs = /*@__PURE__*/ new WeakMap();
2305
+ /**
2306
+ * Given a {@link d.RuntimeRef} retrieve the corresponding {@link d.HostRef}
2307
+ *
2308
+ * @param ref the runtime ref of interest
2309
+ * @returns the Host reference (if found) or undefined
2310
+ */
2311
+ const getHostRef = (ref) => hostRefs.get(ref);
2312
+ /**
2313
+ * Register a lazy instance with the {@link hostRefs} object so it's
2314
+ * corresponding {@link d.HostRef} can be retrieved later.
2315
+ *
2316
+ * @param lazyInstance the lazy instance of interest
2317
+ * @param hostRef that instances `HostRef` object
2318
+ * @returns a reference to the host ref WeakMap
2319
+ */
2320
+ const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
2321
+ /**
2322
+ * Register a host element for a Stencil component, setting up various metadata
2323
+ * and callbacks based on {@link BUILD} flags as well as the component's runtime
2324
+ * metadata.
2325
+ *
2326
+ * @param hostElement the host element to register
2327
+ * @param cmpMeta runtime metadata for that component
2328
+ * @returns a reference to the host ref WeakMap
2329
+ */
2330
+ const registerHost = (hostElement, cmpMeta) => {
2331
+ const hostRef = {
2332
+ $flags$: 0,
2333
+ $hostElement$: hostElement,
2334
+ $cmpMeta$: cmpMeta,
2335
+ $instanceValues$: new Map(),
2336
+ };
2337
+ {
2338
+ hostRef.$onInstancePromise$ = new Promise((r) => (hostRef.$onInstanceResolve$ = r));
2339
+ }
2340
+ {
2341
+ hostRef.$onReadyPromise$ = new Promise((r) => (hostRef.$onReadyResolve$ = r));
2342
+ hostElement['s-p'] = [];
2343
+ hostElement['s-rc'] = [];
2344
+ }
2345
+ addHostEventListeners(hostElement, hostRef, cmpMeta.$listeners$);
2346
+ return hostRefs.set(hostElement, hostRef);
2347
+ };
2348
+ const isMemberInElement = (elm, memberName) => memberName in elm;
2349
+ const consoleError = (e, el) => (0, console.error)(e, el);
2350
+ const cmpModules = /*@__PURE__*/ new Map();
2351
+ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
2352
+ // loadModuleImport
2353
+ const exportName = cmpMeta.$tagName$.replace(/-/g, '_');
2354
+ const bundleId = cmpMeta.$lazyBundleId$;
2355
+ const module = cmpModules.get(bundleId) ;
2356
+ if (module) {
2357
+ return module[exportName];
2358
+ }
2359
+
2360
+ if (!hmrVersionId || !BUILD.hotModuleReplacement) {
2361
+ const processMod = importedModule => {
2362
+ cmpModules.set(bundleId, importedModule);
2363
+ return importedModule[exportName];
2364
+ }
2365
+ switch(bundleId) {
2366
+
2367
+ case 'wm-button.cjs':
2368
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2369
+ /* webpackMode: "lazy" */
2370
+ './wm-button.cjs.entry.js')); }).then(processMod, consoleError);
2371
+ case 'wm-chart.cjs':
2372
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2373
+ /* webpackMode: "lazy" */
2374
+ './wm-chart.cjs.entry.js')); }).then(processMod, consoleError);
2375
+ case 'wm-datepicker.cjs':
2376
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2377
+ /* webpackMode: "lazy" */
2378
+ './wm-datepicker.cjs.entry.js')); }).then(processMod, consoleError);
2379
+ case 'wm-file.cjs':
2380
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2381
+ /* webpackMode: "lazy" */
2382
+ './wm-file.cjs.entry.js')); }).then(processMod, consoleError);
2383
+ case 'wm-file-list.cjs':
2384
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2385
+ /* webpackMode: "lazy" */
2386
+ './wm-file-list.cjs.entry.js')); }).then(processMod, consoleError);
2387
+ case 'wm-input.cjs':
2388
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2389
+ /* webpackMode: "lazy" */
2390
+ './wm-input.cjs.entry.js')); }).then(processMod, consoleError);
2391
+ case 'wm-modal.cjs':
2392
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2393
+ /* webpackMode: "lazy" */
2394
+ './wm-modal.cjs.entry.js')); }).then(processMod, consoleError);
2395
+ case 'wm-navigator.cjs':
2396
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2397
+ /* webpackMode: "lazy" */
2398
+ './wm-navigator.cjs.entry.js')); }).then(processMod, consoleError);
2399
+ case 'wm-pagination.cjs':
2400
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2401
+ /* webpackMode: "lazy" */
2402
+ './wm-pagination.cjs.entry.js')); }).then(processMod, consoleError);
2403
+ case 'wm-search.cjs':
2404
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2405
+ /* webpackMode: "lazy" */
2406
+ './wm-search.cjs.entry.js')); }).then(processMod, consoleError);
2407
+ case 'wm-snackbar.cjs':
2408
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2409
+ /* webpackMode: "lazy" */
2410
+ './wm-snackbar.cjs.entry.js')); }).then(processMod, consoleError);
2411
+ case 'wm-timepicker.cjs':
2412
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2413
+ /* webpackMode: "lazy" */
2414
+ './wm-timepicker.cjs.entry.js')); }).then(processMod, consoleError);
2415
+ case 'wm-toggletip.cjs':
2416
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2417
+ /* webpackMode: "lazy" */
2418
+ './wm-toggletip.cjs.entry.js')); }).then(processMod, consoleError);
2419
+ case 'wm-tag-input.cjs':
2420
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2421
+ /* webpackMode: "lazy" */
2422
+ './wm-tag-input.cjs.entry.js')); }).then(processMod, consoleError);
2423
+ case 'wm-tag-option.cjs':
2424
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2425
+ /* webpackMode: "lazy" */
2426
+ './wm-tag-option.cjs.entry.js')); }).then(processMod, consoleError);
2427
+ case 'wm-textarea.cjs':
2428
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2429
+ /* webpackMode: "lazy" */
2430
+ './wm-textarea.cjs.entry.js')); }).then(processMod, consoleError);
2431
+ case 'wm-uploader.cjs':
2432
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2433
+ /* webpackMode: "lazy" */
2434
+ './wm-uploader.cjs.entry.js')); }).then(processMod, consoleError);
2435
+ case 'wm-wrapper.cjs':
2436
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2437
+ /* webpackMode: "lazy" */
2438
+ './wm-wrapper.cjs.entry.js')); }).then(processMod, consoleError);
2439
+ case 'wm-action-menu_2.cjs':
2440
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2441
+ /* webpackMode: "lazy" */
2442
+ './wm-action-menu_2.cjs.entry.js')); }).then(processMod, consoleError);
2443
+ case 'wm-option_2.cjs':
2444
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2445
+ /* webpackMode: "lazy" */
2446
+ './wm-option_2.cjs.entry.js')); }).then(processMod, consoleError);
2447
+ case 'wm-navigation_3.cjs':
2448
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2449
+ /* webpackMode: "lazy" */
2450
+ './wm-navigation_3.cjs.entry.js')); }).then(processMod, consoleError);
2451
+ case 'wm-progress-indicator_3.cjs':
2452
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2453
+ /* webpackMode: "lazy" */
2454
+ './wm-progress-indicator_3.cjs.entry.js')); }).then(processMod, consoleError);
2455
+ case 'wm-tab-item_3.cjs':
2456
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2457
+ /* webpackMode: "lazy" */
2458
+ './wm-tab-item_3.cjs.entry.js')); }).then(processMod, consoleError);
2459
+ case 'wm-chart-slice.cjs':
2460
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2461
+ /* webpackMode: "lazy" */
2462
+ './wm-chart-slice.cjs.entry.js')); }).then(processMod, consoleError);
2463
+ case 'wm-date-range.cjs':
2464
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2465
+ /* webpackMode: "lazy" */
2466
+ './wm-date-range.cjs.entry.js')); }).then(processMod, consoleError);
2467
+ case 'wm-line-chart.cjs':
2468
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2469
+ /* webpackMode: "lazy" */
2470
+ './wm-line-chart.cjs.entry.js')); }).then(processMod, consoleError);
2471
+ case 'wm-modal-footer.cjs':
2472
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2473
+ /* webpackMode: "lazy" */
2474
+ './wm-modal-footer.cjs.entry.js')); }).then(processMod, consoleError);
2475
+ case 'wm-modal-header.cjs':
2476
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2477
+ /* webpackMode: "lazy" */
2478
+ './wm-modal-header.cjs.entry.js')); }).then(processMod, consoleError);
2479
+ case 'priv-navigator-button.cjs':
2480
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2481
+ /* webpackMode: "lazy" */
2482
+ './priv-navigator-button.cjs.entry.js')); }).then(processMod, consoleError);
2483
+ case 'priv-navigator-item.cjs':
2484
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2485
+ /* webpackMode: "lazy" */
2486
+ './priv-navigator-item.cjs.entry.js')); }).then(processMod, consoleError);
2487
+ case 'priv-calendar.cjs':
2488
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2489
+ /* webpackMode: "lazy" */
2490
+ './priv-calendar.cjs.entry.js')); }).then(processMod, consoleError);
2491
+ case 'priv-chart-popover.cjs':
2492
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2493
+ /* webpackMode: "lazy" */
2494
+ './priv-chart-popover.cjs.entry.js')); }).then(processMod, consoleError);
2495
+ }
2496
+ }
2497
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2498
+ /* @vite-ignore */
2499
+ /* webpackInclude: /\.entry\.js$/ */
2500
+ /* webpackExclude: /\.system\.entry\.js$/ */
2501
+ /* webpackMode: "lazy" */
2502
+ `./${bundleId}.entry.js${''}`)); }).then((importedModule) => {
2503
+ {
2504
+ cmpModules.set(bundleId, importedModule);
2505
+ }
2506
+ return importedModule[exportName];
2507
+ }, consoleError);
2508
+ };
2509
+ const styles = /*@__PURE__*/ new Map();
2510
+ const win = typeof window !== 'undefined' ? window : {};
2511
+ const doc = win.document || { head: {} };
2512
+ const plt = {
2513
+ $flags$: 0,
2514
+ $resourcesUrl$: '',
2515
+ jmp: (h) => h(),
2516
+ raf: (h) => requestAnimationFrame(h),
2517
+ ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
2518
+ rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
2519
+ ce: (eventName, opts) => new CustomEvent(eventName, opts),
2520
+ };
2521
+ const promiseResolve = (v) => Promise.resolve(v);
2522
+ const supportsConstructableStylesheets = /*@__PURE__*/ (() => {
2523
+ try {
2524
+ new CSSStyleSheet();
2525
+ return typeof new CSSStyleSheet().replaceSync === 'function';
2526
+ }
2527
+ catch (e) { }
2528
+ return false;
2529
+ })()
2530
+ ;
2531
+ const queueDomReads = [];
2532
+ const queueDomWrites = [];
2533
+ const queueTask = (queue, write) => (cb) => {
2534
+ queue.push(cb);
2535
+ if (!queuePending) {
2536
+ queuePending = true;
2537
+ if (write && plt.$flags$ & 4 /* PLATFORM_FLAGS.queueSync */) {
2538
+ nextTick(flush);
2539
+ }
2540
+ else {
2541
+ plt.raf(flush);
2542
+ }
2543
+ }
2544
+ };
2545
+ const consume = (queue) => {
2546
+ for (let i = 0; i < queue.length; i++) {
2547
+ try {
2548
+ queue[i](performance.now());
2549
+ }
2550
+ catch (e) {
2551
+ consoleError(e);
2552
+ }
2553
+ }
2554
+ queue.length = 0;
2555
+ };
2556
+ const flush = () => {
2557
+ // always force a bunch of medium callbacks to run, but still have
2558
+ // a throttle on how many can run in a certain time
2559
+ // DOM READS!!!
2560
+ consume(queueDomReads);
2561
+ // DOM WRITES!!!
2562
+ {
2563
+ consume(queueDomWrites);
2564
+ if ((queuePending = queueDomReads.length > 0)) {
2565
+ // still more to do yet, but we've run out of time
2566
+ // let's let this thing cool off and try again in the next tick
2567
+ plt.raf(flush);
2568
+ }
2569
+ }
2570
+ };
2571
+ const nextTick = (cb) => promiseResolve().then(cb);
2572
+ const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
2573
+
2574
+ exports.Host = Host;
2575
+ exports.bootstrapLazy = bootstrapLazy;
2576
+ exports.createEvent = createEvent;
2577
+ exports.forceUpdate = forceUpdate;
2578
+ exports.getElement = getElement;
2579
+ exports.h = h;
2580
+ exports.promiseResolve = promiseResolve;
2581
+ exports.registerInstance = registerInstance;
2582
+ exports.setNonce = setNonce;