@itcenteratunihelsinki/huds-lib 0.8.41 → 0.8.42

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 (557) hide show
  1. package/dist/cjs/color-box_8.cjs.entry.js +13 -36
  2. package/dist/cjs/color-box_8.cjs.entry.js.map +1 -0
  3. package/dist/cjs/{globalScript-6b592153.js → globalScript-45ad6d41.js} +3 -1
  4. package/dist/cjs/globalScript-45ad6d41.js.map +1 -0
  5. package/dist/cjs/huds-lib.cjs.js +12 -3
  6. package/dist/cjs/huds-lib.cjs.js.map +1 -0
  7. package/dist/cjs/hy-accordion-container_83.cjs.entry.js +365 -157
  8. package/dist/cjs/hy-accordion-container_83.cjs.entry.js.map +1 -0
  9. package/dist/cjs/hy-event-item.cjs.entry.js +7 -2
  10. package/dist/cjs/hy-event-item.cjs.entry.js.map +1 -0
  11. package/dist/cjs/hy-events.cjs.entry.js +6 -2
  12. package/dist/cjs/hy-events.cjs.entry.js.map +1 -0
  13. package/dist/cjs/{index-dfc917d9.js → index-25bd964b.js} +692 -287
  14. package/dist/cjs/index-25bd964b.js.map +1 -0
  15. package/dist/cjs/index.cjs.js +2 -0
  16. package/dist/cjs/index.cjs.js.map +1 -0
  17. package/dist/cjs/loader.cjs.js +6 -3
  18. package/dist/cjs/loader.cjs.js.map +1 -0
  19. package/dist/cjs/utils-14d5aa6f.js +2 -0
  20. package/dist/cjs/utils-14d5aa6f.js.map +1 -0
  21. package/dist/collection/collection-manifest.json +2 -2
  22. package/dist/collection/components/accordion-container/accordion-container.js +37 -30
  23. package/dist/collection/components/accordion-container/accordion-container.js.map +1 -0
  24. package/dist/collection/components/accordion-item/accordion-item.js +116 -114
  25. package/dist/collection/components/accordion-item/accordion-item.js.map +1 -0
  26. package/dist/collection/components/adjacent-image-text/adjacent-image-text.js +277 -275
  27. package/dist/collection/components/adjacent-image-text/adjacent-image-text.js.map +1 -0
  28. package/dist/collection/components/baseline/baseline.js +35 -32
  29. package/dist/collection/components/baseline/baseline.js.map +1 -0
  30. package/dist/collection/components/button/button.js +226 -257
  31. package/dist/collection/components/button/button.js.map +1 -0
  32. package/dist/collection/components/color-box/color-box.js +13 -9
  33. package/dist/collection/components/color-box/color-box.js.map +1 -0
  34. package/dist/collection/components/courses/hy-content-list/hy-content-list.js +154 -148
  35. package/dist/collection/components/courses/hy-content-list/hy-content-list.js.map +1 -0
  36. package/dist/collection/components/courses/hy-content-list-item/hy-content-list-item.css +2 -2
  37. package/dist/collection/components/courses/hy-content-list-item/hy-content-list-item.js +335 -331
  38. package/dist/collection/components/courses/hy-content-list-item/hy-content-list-item.js.map +1 -0
  39. package/dist/collection/components/cta-button/cta-button.js +141 -138
  40. package/dist/collection/components/cta-button/cta-button.js.map +1 -0
  41. package/dist/collection/components/cta-link/cta-link.js +107 -103
  42. package/dist/collection/components/cta-link/cta-link.js.map +1 -0
  43. package/dist/collection/components/docs-container/docs-container.js +13 -9
  44. package/dist/collection/components/docs-container/docs-container.js.map +1 -0
  45. package/dist/collection/components/footer/hy-footer/hy-footer.js +13 -9
  46. package/dist/collection/components/footer/hy-footer/hy-footer.js.map +1 -0
  47. package/dist/collection/components/footer/hy-footer-action/hy-footer-action.js +63 -55
  48. package/dist/collection/components/footer/hy-footer-action/hy-footer-action.js.map +1 -0
  49. package/dist/collection/components/footer/hy-footer-base/hy-footer-base.js +183 -187
  50. package/dist/collection/components/footer/hy-footer-base/hy-footer-base.js.map +1 -0
  51. package/dist/collection/components/footer/hy-footer-info/hy-footer-info.js +278 -270
  52. package/dist/collection/components/footer/hy-footer-info/hy-footer-info.js.map +1 -0
  53. package/dist/collection/components/footer/hy-footer-link-item/hy-footer-link-item.js +191 -190
  54. package/dist/collection/components/footer/hy-footer-link-item/hy-footer-link-item.js.map +1 -0
  55. package/dist/collection/components/global-workers/globals.worker.js +1 -0
  56. package/dist/collection/components/global-workers/globals.worker.js.map +1 -0
  57. package/dist/collection/components/grid-container/grid-container.js +13 -9
  58. package/dist/collection/components/grid-container/grid-container.js.map +1 -0
  59. package/dist/collection/components/grid-item/grid-item.css +0 -23
  60. package/dist/collection/components/grid-item/grid-item.js +102 -96
  61. package/dist/collection/components/grid-item/grid-item.js.map +1 -0
  62. package/dist/collection/components/grid-row/grid-row.js +13 -9
  63. package/dist/collection/components/grid-row/grid-row.js.map +1 -0
  64. package/dist/collection/components/heading/heading-fw.css +17 -17
  65. package/dist/collection/components/heading/heading.css +17 -17
  66. package/dist/collection/components/heading/heading.js +142 -146
  67. package/dist/collection/components/heading/heading.js.map +1 -0
  68. package/dist/collection/components/hy-anchor-link-list/hy-anchor-link-list.js +105 -99
  69. package/dist/collection/components/hy-anchor-link-list/hy-anchor-link-list.js.map +1 -0
  70. package/dist/collection/components/hy-badge/hy-badge.js +35 -30
  71. package/dist/collection/components/hy-badge/hy-badge.js.map +1 -0
  72. package/dist/collection/components/hy-banner/hy-banner.js +137 -135
  73. package/dist/collection/components/hy-banner/hy-banner.js.map +1 -0
  74. package/dist/collection/components/hy-box/hy-box.js +323 -318
  75. package/dist/collection/components/hy-box/hy-box.js.map +1 -0
  76. package/dist/collection/components/hy-box-container/hy-box-container.js +53 -54
  77. package/dist/collection/components/hy-box-container/hy-box-container.js.map +1 -0
  78. package/dist/collection/components/hy-breadcrumbs/hy-breadcrumbs.js +89 -82
  79. package/dist/collection/components/hy-breadcrumbs/hy-breadcrumbs.js.map +1 -0
  80. package/dist/collection/components/hy-checkbox/hy-checkbox.js +108 -114
  81. package/dist/collection/components/hy-checkbox/hy-checkbox.js.map +1 -0
  82. package/dist/collection/components/hy-collaboration/hy-collaboration.js +105 -99
  83. package/dist/collection/components/hy-collaboration/hy-collaboration.js.map +1 -0
  84. package/dist/collection/components/hy-crisis-banner/hy-crisis-banner.js +88 -85
  85. package/dist/collection/components/hy-crisis-banner/hy-crisis-banner.js.map +1 -0
  86. package/dist/collection/components/hy-dropdown/hy-dropdown.js +153 -147
  87. package/dist/collection/components/hy-dropdown/hy-dropdown.js.map +1 -0
  88. package/dist/collection/components/hy-dropdown/hy-dropdown.panel.item.js +76 -74
  89. package/dist/collection/components/hy-dropdown/hy-dropdown.panel.item.js.map +1 -0
  90. package/dist/collection/components/hy-dropdown/hy-dropdown.panel.js +27 -22
  91. package/dist/collection/components/hy-dropdown/hy-dropdown.panel.js.map +1 -0
  92. package/dist/collection/components/hy-event-item/hy-event-item.js +184 -192
  93. package/dist/collection/components/hy-event-item/hy-event-item.js.map +1 -0
  94. package/dist/collection/components/hy-events/hy-events.js +131 -127
  95. package/dist/collection/components/hy-events/hy-events.js.map +1 -0
  96. package/dist/collection/components/hy-filter-group/hy-filter-group.item.js +44 -41
  97. package/dist/collection/components/hy-filter-group/hy-filter-group.item.js.map +1 -0
  98. package/dist/collection/components/hy-filter-group/hy-filter-group.js +64 -54
  99. package/dist/collection/components/hy-filter-group/hy-filter-group.js.map +1 -0
  100. package/dist/collection/components/hy-filter-list-type/hy-filter-list-type.js +62 -56
  101. package/dist/collection/components/hy-filter-list-type/hy-filter-list-type.js.map +1 -0
  102. package/dist/collection/components/hy-filter-visibility-tool/hy-filter-visibility-tool.js +38 -30
  103. package/dist/collection/components/hy-filter-visibility-tool/hy-filter-visibility-tool.js.map +1 -0
  104. package/dist/collection/components/hy-filter-visibility-tool/hy-filter-visibility-tool.reset.js +3 -4
  105. package/dist/collection/components/hy-filter-visibility-tool/hy-filter-visibility-tool.reset.js.map +1 -0
  106. package/dist/collection/components/hy-filter-visibility-tool/hy-filter-visibility-tool.reset.toggle.js +3 -8
  107. package/dist/collection/components/hy-filter-visibility-tool/hy-filter-visibility-tool.reset.toggle.js.map +1 -0
  108. package/dist/collection/components/hy-general-list/hy-general-list.js +123 -113
  109. package/dist/collection/components/hy-general-list/hy-general-list.js.map +1 -0
  110. package/dist/collection/components/hy-general-list-item/hy-general-list-item.js +256 -258
  111. package/dist/collection/components/hy-general-list-item/hy-general-list-item.js.map +1 -0
  112. package/dist/collection/components/hy-hero/hy-hero.css +2 -2
  113. package/dist/collection/components/hy-hero/hy-hero.js +296 -308
  114. package/dist/collection/components/hy-hero/hy-hero.js.map +1 -0
  115. package/dist/collection/components/hy-introduction/hy-introduction.js +248 -250
  116. package/dist/collection/components/hy-introduction/hy-introduction.js.map +1 -0
  117. package/dist/collection/components/hy-key-figure/hy-key-figure.js +73 -66
  118. package/dist/collection/components/hy-key-figure/hy-key-figure.js.map +1 -0
  119. package/dist/collection/components/hy-key-figure-group/hy-key-figure-group.css +1 -1
  120. package/dist/collection/components/hy-key-figure-group/hy-key-figure-group.js +67 -65
  121. package/dist/collection/components/hy-key-figure-group/hy-key-figure-group.js.map +1 -0
  122. package/dist/collection/components/hy-key-highlight/hy-key-highlight.js +73 -67
  123. package/dist/collection/components/hy-key-highlight/hy-key-highlight.js.map +1 -0
  124. package/dist/collection/components/hy-key-highlight-group/hy-key-highlight-group.css +2 -2
  125. package/dist/collection/components/hy-key-highlight-group/hy-key-highlight-group.js +79 -71
  126. package/dist/collection/components/hy-key-highlight-group/hy-key-highlight-group.js.map +1 -0
  127. package/dist/collection/components/hy-large-process-flow/hy-large-process-flow.css +6 -6
  128. package/dist/collection/components/hy-large-process-flow/hy-large-process-flow.js +55 -46
  129. package/dist/collection/components/hy-large-process-flow/hy-large-process-flow.js.map +1 -0
  130. package/dist/collection/components/hy-large-process-flow-phase/hy-large-process-flow-phase.css +3 -3
  131. package/dist/collection/components/hy-large-process-flow-phase/hy-large-process-flow-phase.js +41 -37
  132. package/dist/collection/components/hy-large-process-flow-phase/hy-large-process-flow-phase.js.map +1 -0
  133. package/dist/collection/components/hy-link-list/hy-link-list.js +107 -100
  134. package/dist/collection/components/hy-link-list/hy-link-list.js.map +1 -0
  135. package/dist/collection/components/hy-list-item/hy-list-item.js +429 -451
  136. package/dist/collection/components/hy-list-item/hy-list-item.js.map +1 -0
  137. package/dist/collection/components/hy-logo-grid/hy-logo-grid.item.js +54 -47
  138. package/dist/collection/components/hy-logo-grid/hy-logo-grid.item.js.map +1 -0
  139. package/dist/collection/components/hy-logo-grid/hy-logo-grid.js +54 -46
  140. package/dist/collection/components/hy-logo-grid/hy-logo-grid.js.map +1 -0
  141. package/dist/collection/components/hy-main/hy-main.js +35 -29
  142. package/dist/collection/components/hy-main/hy-main.js.map +1 -0
  143. package/dist/collection/components/hy-main-content-wrapper/hy-main-content-wrapper.js +13 -10
  144. package/dist/collection/components/hy-main-content-wrapper/hy-main-content-wrapper.js.map +1 -0
  145. package/dist/collection/components/hy-opening-hours/hy-opening-hours.css +2 -2
  146. package/dist/collection/components/hy-opening-hours/hy-opening-hours.js +305 -308
  147. package/dist/collection/components/hy-opening-hours/hy-opening-hours.js.map +1 -0
  148. package/dist/collection/components/hy-opening-hours-content/hy-opening-hours-content.css +2 -2
  149. package/dist/collection/components/hy-opening-hours-content/hy-opening-hours-content.js +108 -107
  150. package/dist/collection/components/hy-opening-hours-content/hy-opening-hours-content.js.map +1 -0
  151. package/dist/collection/components/hy-person-card/hy-person-card.js +423 -438
  152. package/dist/collection/components/hy-person-card/hy-person-card.js.map +1 -0
  153. package/dist/collection/components/hy-prominent-image/hy-prominent-image.js +107 -100
  154. package/dist/collection/components/hy-prominent-image/hy-prominent-image.js.map +1 -0
  155. package/dist/collection/components/hy-quote/hy-quote.js +52 -51
  156. package/dist/collection/components/hy-quote/hy-quote.js.map +1 -0
  157. package/dist/collection/components/hy-search-field/hy-search-field.js +167 -167
  158. package/dist/collection/components/hy-search-field/hy-search-field.js.map +1 -0
  159. package/dist/collection/components/hy-shortcuts/hy-shortcuts.css +1 -1
  160. package/dist/collection/components/hy-shortcuts/hy-shortcuts.js +90 -87
  161. package/dist/collection/components/hy-shortcuts/hy-shortcuts.js.map +1 -0
  162. package/dist/collection/components/hy-table-container/hy-table-container.css +6 -6
  163. package/dist/collection/components/hy-table-container/hy-table-container.js +13 -10
  164. package/dist/collection/components/hy-table-container/hy-table-container.js.map +1 -0
  165. package/dist/collection/components/hy-tabs/hy-tabs.js +116 -111
  166. package/dist/collection/components/hy-tabs/hy-tabs.js.map +1 -0
  167. package/dist/collection/components/hy-tabs-item/hy-tabs-item.js +37 -28
  168. package/dist/collection/components/hy-tabs-item/hy-tabs-item.js.map +1 -0
  169. package/dist/collection/components/hy-tag/hy-tag.js +13 -11
  170. package/dist/collection/components/hy-tag/hy-tag.js.map +1 -0
  171. package/dist/collection/components/hy-twitter-feed/hy-twitter-feed.js +108 -128
  172. package/dist/collection/components/hy-twitter-feed/hy-twitter-feed.js.map +1 -0
  173. package/dist/collection/components/hy-two-columns/hy-two-columns.js +35 -33
  174. package/dist/collection/components/hy-two-columns/hy-two-columns.js.map +1 -0
  175. package/dist/collection/components/hy-user-login-form/hy-user-login-form.js +54 -46
  176. package/dist/collection/components/hy-user-login-form/hy-user-login-form.js.map +1 -0
  177. package/dist/collection/components/hy-video/hy-video.css +1 -1
  178. package/dist/collection/components/hy-video/hy-video.js +463 -500
  179. package/dist/collection/components/hy-video/hy-video.js.map +1 -0
  180. package/dist/collection/components/icon/AddToTodoList.js +2 -2
  181. package/dist/collection/components/icon/AddToTodoList.js.map +1 -0
  182. package/dist/collection/components/icon/Alert.js +2 -3
  183. package/dist/collection/components/icon/Alert.js.map +1 -0
  184. package/dist/collection/components/icon/Archive.js +2 -5
  185. package/dist/collection/components/icon/Archive.js.map +1 -0
  186. package/dist/collection/components/icon/Arrow.js +2 -2
  187. package/dist/collection/components/icon/Arrow.js.map +1 -0
  188. package/dist/collection/components/icon/ArrowDown.js +2 -2
  189. package/dist/collection/components/icon/ArrowDown.js.map +1 -0
  190. package/dist/collection/components/icon/ArrowRight.js +2 -7
  191. package/dist/collection/components/icon/ArrowRight.js.map +1 -0
  192. package/dist/collection/components/icon/ArrowUp.js +2 -2
  193. package/dist/collection/components/icon/ArrowUp.js.map +1 -0
  194. package/dist/collection/components/icon/Avatar.js +2 -2
  195. package/dist/collection/components/icon/Avatar.js.map +1 -0
  196. package/dist/collection/components/icon/AvatarGroup.js +2 -2
  197. package/dist/collection/components/icon/AvatarGroup.js.map +1 -0
  198. package/dist/collection/components/icon/Bachelor.js +2 -2
  199. package/dist/collection/components/icon/Bachelor.js.map +1 -0
  200. package/dist/collection/components/icon/BulletList.js +2 -2
  201. package/dist/collection/components/icon/BulletList.js.map +1 -0
  202. package/dist/collection/components/icon/Camera.js +2 -2
  203. package/dist/collection/components/icon/Camera.js.map +1 -0
  204. package/dist/collection/components/icon/CaretDown.js +2 -2
  205. package/dist/collection/components/icon/CaretDown.js.map +1 -0
  206. package/dist/collection/components/icon/CaretLeft.js +2 -2
  207. package/dist/collection/components/icon/CaretLeft.js.map +1 -0
  208. package/dist/collection/components/icon/CaretRight.js +2 -2
  209. package/dist/collection/components/icon/CaretRight.js.map +1 -0
  210. package/dist/collection/components/icon/CaretUp.js +2 -2
  211. package/dist/collection/components/icon/CaretUp.js.map +1 -0
  212. package/dist/collection/components/icon/Chat.js +2 -2
  213. package/dist/collection/components/icon/Chat.js.map +1 -0
  214. package/dist/collection/components/icon/CodeFork.js +2 -2
  215. package/dist/collection/components/icon/CodeFork.js.map +1 -0
  216. package/dist/collection/components/icon/Cogs.js +2 -2
  217. package/dist/collection/components/icon/Cogs.js.map +1 -0
  218. package/dist/collection/components/icon/Contentlink.js +2 -2
  219. package/dist/collection/components/icon/Contentlink.js.map +1 -0
  220. package/dist/collection/components/icon/Customlink.js +2 -2
  221. package/dist/collection/components/icon/Customlink.js.map +1 -0
  222. package/dist/collection/components/icon/Date.js +2 -2
  223. package/dist/collection/components/icon/Date.js.map +1 -0
  224. package/dist/collection/components/icon/Discover.js +2 -2
  225. package/dist/collection/components/icon/Discover.js.map +1 -0
  226. package/dist/collection/components/icon/Done.js +2 -2
  227. package/dist/collection/components/icon/Done.js.map +1 -0
  228. package/dist/collection/components/icon/Dot.js +2 -2
  229. package/dist/collection/components/icon/Dot.js.map +1 -0
  230. package/dist/collection/components/icon/DotArrowRight.js +2 -6
  231. package/dist/collection/components/icon/DotArrowRight.js.map +1 -0
  232. package/dist/collection/components/icon/Download.js +2 -2
  233. package/dist/collection/components/icon/Download.js.map +1 -0
  234. package/dist/collection/components/icon/Drag.js +2 -2
  235. package/dist/collection/components/icon/Drag.js.map +1 -0
  236. package/dist/collection/components/icon/Dragbutton.js +2 -2
  237. package/dist/collection/components/icon/Dragbutton.js.map +1 -0
  238. package/dist/collection/components/icon/DropDown.js +2 -2
  239. package/dist/collection/components/icon/DropDown.js.map +1 -0
  240. package/dist/collection/components/icon/Edit.js +2 -2
  241. package/dist/collection/components/icon/Edit.js.map +1 -0
  242. package/dist/collection/components/icon/EditEvent.js +2 -2
  243. package/dist/collection/components/icon/EditEvent.js.map +1 -0
  244. package/dist/collection/components/icon/Embed.js +2 -2
  245. package/dist/collection/components/icon/Embed.js.map +1 -0
  246. package/dist/collection/components/icon/Euro.js +2 -2
  247. package/dist/collection/components/icon/Euro.js.map +1 -0
  248. package/dist/collection/components/icon/Events.js +2 -2
  249. package/dist/collection/components/icon/Events.js.map +1 -0
  250. package/dist/collection/components/icon/ExternalLink.js +2 -2
  251. package/dist/collection/components/icon/ExternalLink.js.map +1 -0
  252. package/dist/collection/components/icon/EyeSlash.js +2 -2
  253. package/dist/collection/components/icon/EyeSlash.js.map +1 -0
  254. package/dist/collection/components/icon/Facebook.js +2 -2
  255. package/dist/collection/components/icon/Facebook.js.map +1 -0
  256. package/dist/collection/components/icon/Favorites.js +2 -2
  257. package/dist/collection/components/icon/Favorites.js.map +1 -0
  258. package/dist/collection/components/icon/Feed.js +2 -2
  259. package/dist/collection/components/icon/Feed.js.map +1 -0
  260. package/dist/collection/components/icon/FileText.js +2 -2
  261. package/dist/collection/components/icon/FileText.js.map +1 -0
  262. package/dist/collection/components/icon/FullScreen.js +2 -2
  263. package/dist/collection/components/icon/FullScreen.js.map +1 -0
  264. package/dist/collection/components/icon/Globe.js +2 -2
  265. package/dist/collection/components/icon/Globe.js.map +1 -0
  266. package/dist/collection/components/icon/GooglePlus.js +2 -2
  267. package/dist/collection/components/icon/GooglePlus.js.map +1 -0
  268. package/dist/collection/components/icon/Grid.js +2 -2
  269. package/dist/collection/components/icon/Grid.js.map +1 -0
  270. package/dist/collection/components/icon/Hamburger.js +2 -2
  271. package/dist/collection/components/icon/Hamburger.js.map +1 -0
  272. package/dist/collection/components/icon/Heart.js +2 -2
  273. package/dist/collection/components/icon/Heart.js.map +1 -0
  274. package/dist/collection/components/icon/HeartSupport.js +2 -2
  275. package/dist/collection/components/icon/HeartSupport.js.map +1 -0
  276. package/dist/collection/components/icon/Helsinginyliopisto.js +2 -2
  277. package/dist/collection/components/icon/Helsinginyliopisto.js.map +1 -0
  278. package/dist/collection/components/icon/Home.js +2 -2
  279. package/dist/collection/components/icon/Home.js.map +1 -0
  280. package/dist/collection/components/icon/HorizontalResize.js +2 -2
  281. package/dist/collection/components/icon/HorizontalResize.js.map +1 -0
  282. package/dist/collection/components/icon/HyLogo.js +2 -2
  283. package/dist/collection/components/icon/HyLogo.js.map +1 -0
  284. package/dist/collection/components/icon/IdNumber.js +2 -2
  285. package/dist/collection/components/icon/IdNumber.js.map +1 -0
  286. package/dist/collection/components/icon/Image.js +2 -2
  287. package/dist/collection/components/icon/Image.js.map +1 -0
  288. package/dist/collection/components/icon/ImageGallery.js +2 -2
  289. package/dist/collection/components/icon/ImageGallery.js.map +1 -0
  290. package/dist/collection/components/icon/Images.js +2 -2
  291. package/dist/collection/components/icon/Images.js.map +1 -0
  292. package/dist/collection/components/icon/Info.js +2 -2
  293. package/dist/collection/components/icon/Info.js.map +1 -0
  294. package/dist/collection/components/icon/InfoStroke.js +2 -2
  295. package/dist/collection/components/icon/InfoStroke.js.map +1 -0
  296. package/dist/collection/components/icon/Instagram.js +2 -2
  297. package/dist/collection/components/icon/Instagram.js.map +1 -0
  298. package/dist/collection/components/icon/LeikiList.js +2 -2
  299. package/dist/collection/components/icon/LeikiList.js.map +1 -0
  300. package/dist/collection/components/icon/LinkArrow.js +2 -2
  301. package/dist/collection/components/icon/LinkArrow.js.map +1 -0
  302. package/dist/collection/components/icon/LinkArrow1.js +2 -2
  303. package/dist/collection/components/icon/LinkArrow1.js.map +1 -0
  304. package/dist/collection/components/icon/LinkArrowDown.js +2 -2
  305. package/dist/collection/components/icon/LinkArrowDown.js.map +1 -0
  306. package/dist/collection/components/icon/LinkArrowLeft.js +2 -2
  307. package/dist/collection/components/icon/LinkArrowLeft.js.map +1 -0
  308. package/dist/collection/components/icon/LinkArrowOffsite.js +2 -2
  309. package/dist/collection/components/icon/LinkArrowOffsite.js.map +1 -0
  310. package/dist/collection/components/icon/LinkArrowUp.js +2 -2
  311. package/dist/collection/components/icon/LinkArrowUp.js.map +1 -0
  312. package/dist/collection/components/icon/Linkedin.js +2 -2
  313. package/dist/collection/components/icon/Linkedin.js.map +1 -0
  314. package/dist/collection/components/icon/List.js +2 -2
  315. package/dist/collection/components/icon/List.js.map +1 -0
  316. package/dist/collection/components/icon/ListAsBlocks.js +2 -2
  317. package/dist/collection/components/icon/ListAsBlocks.js.map +1 -0
  318. package/dist/collection/components/icon/ListStyleGrid.js +2 -10
  319. package/dist/collection/components/icon/ListStyleGrid.js.map +1 -0
  320. package/dist/collection/components/icon/ListStyleList.js +2 -5
  321. package/dist/collection/components/icon/ListStyleList.js.map +1 -0
  322. package/dist/collection/components/icon/Listoflinks.js +2 -2
  323. package/dist/collection/components/icon/Listoflinks.js.map +1 -0
  324. package/dist/collection/components/icon/Location.js +2 -2
  325. package/dist/collection/components/icon/Location.js.map +1 -0
  326. package/dist/collection/components/icon/Log.js +2 -2
  327. package/dist/collection/components/icon/Log.js.map +1 -0
  328. package/dist/collection/components/icon/Login.js +2 -2
  329. package/dist/collection/components/icon/Login.js.map +1 -0
  330. package/dist/collection/components/icon/Logout.js +2 -2
  331. package/dist/collection/components/icon/Logout.js.map +1 -0
  332. package/dist/collection/components/icon/MagnifyMinus.js +2 -2
  333. package/dist/collection/components/icon/MagnifyMinus.js.map +1 -0
  334. package/dist/collection/components/icon/MagnifyPlus.js +2 -2
  335. package/dist/collection/components/icon/MagnifyPlus.js.map +1 -0
  336. package/dist/collection/components/icon/Mail.js +2 -2
  337. package/dist/collection/components/icon/Mail.js.map +1 -0
  338. package/dist/collection/components/icon/Master.js +2 -2
  339. package/dist/collection/components/icon/Master.js.map +1 -0
  340. package/dist/collection/components/icon/Minus.js +2 -2
  341. package/dist/collection/components/icon/Minus.js.map +1 -0
  342. package/dist/collection/components/icon/Mobile.js +2 -2
  343. package/dist/collection/components/icon/Mobile.js.map +1 -0
  344. package/dist/collection/components/icon/Modify.js +2 -2
  345. package/dist/collection/components/icon/Modify.js.map +1 -0
  346. package/dist/collection/components/icon/NaviTriangle.js +2 -2
  347. package/dist/collection/components/icon/NaviTriangle.js.map +1 -0
  348. package/dist/collection/components/icon/NewGroup.js +2 -2
  349. package/dist/collection/components/icon/NewGroup.js.map +1 -0
  350. package/dist/collection/components/icon/NewPerson.js +2 -2
  351. package/dist/collection/components/icon/NewPerson.js.map +1 -0
  352. package/dist/collection/components/icon/Notification.js +2 -2
  353. package/dist/collection/components/icon/Notification.js.map +1 -0
  354. package/dist/collection/components/icon/OpinderLogo.js +2 -2
  355. package/dist/collection/components/icon/OpinderLogo.js.map +1 -0
  356. package/dist/collection/components/icon/OpinderLogoNew.js +2 -2
  357. package/dist/collection/components/icon/OpinderLogoNew.js.map +1 -0
  358. package/dist/collection/components/icon/Pdf.js +2 -2
  359. package/dist/collection/components/icon/Pdf.js.map +1 -0
  360. package/dist/collection/components/icon/People.js +2 -2
  361. package/dist/collection/components/icon/People.js.map +1 -0
  362. package/dist/collection/components/icon/PermissionAll.js +2 -2
  363. package/dist/collection/components/icon/PermissionAll.js.map +1 -0
  364. package/dist/collection/components/icon/PermissionGroup.js +2 -2
  365. package/dist/collection/components/icon/PermissionGroup.js.map +1 -0
  366. package/dist/collection/components/icon/PermissionPrivate.js +2 -2
  367. package/dist/collection/components/icon/PermissionPrivate.js.map +1 -0
  368. package/dist/collection/components/icon/Person.js +2 -2
  369. package/dist/collection/components/icon/Person.js.map +1 -0
  370. package/dist/collection/components/icon/PersonOutline.js +2 -2
  371. package/dist/collection/components/icon/PersonOutline.js.map +1 -0
  372. package/dist/collection/components/icon/Phone.js +2 -2
  373. package/dist/collection/components/icon/Phone.js.map +1 -0
  374. package/dist/collection/components/icon/Play.js +2 -2
  375. package/dist/collection/components/icon/Play.js.map +1 -0
  376. package/dist/collection/components/icon/Plus.js +2 -2
  377. package/dist/collection/components/icon/Plus.js.map +1 -0
  378. package/dist/collection/components/icon/Preview.js +2 -2
  379. package/dist/collection/components/icon/Preview.js.map +1 -0
  380. package/dist/collection/components/icon/Profile.js +2 -2
  381. package/dist/collection/components/icon/Profile.js.map +1 -0
  382. package/dist/collection/components/icon/Question.js +2 -2
  383. package/dist/collection/components/icon/Question.js.map +1 -0
  384. package/dist/collection/components/icon/Remove.js +2 -2
  385. package/dist/collection/components/icon/Remove.js.map +1 -0
  386. package/dist/collection/components/icon/Retweet.js +2 -2
  387. package/dist/collection/components/icon/Retweet.js.map +1 -0
  388. package/dist/collection/components/icon/RotateLeft.js +2 -2
  389. package/dist/collection/components/icon/RotateLeft.js.map +1 -0
  390. package/dist/collection/components/icon/RotateRight.js +2 -2
  391. package/dist/collection/components/icon/RotateRight.js.map +1 -0
  392. package/dist/collection/components/icon/Search.js +2 -2
  393. package/dist/collection/components/icon/Search.js.map +1 -0
  394. package/dist/collection/components/icon/Share.js +2 -2
  395. package/dist/collection/components/icon/Share.js.map +1 -0
  396. package/dist/collection/components/icon/SlimHamburgerMenu.js +2 -2
  397. package/dist/collection/components/icon/SlimHamburgerMenu.js.map +1 -0
  398. package/dist/collection/components/icon/SocialMedia.js +2 -2
  399. package/dist/collection/components/icon/SocialMedia.js.map +1 -0
  400. package/dist/collection/components/icon/SomeFacebook.js +2 -2
  401. package/dist/collection/components/icon/SomeFacebook.js.map +1 -0
  402. package/dist/collection/components/icon/SomeInstagram.js +2 -4
  403. package/dist/collection/components/icon/SomeInstagram.js.map +1 -0
  404. package/dist/collection/components/icon/SomeLinkedin.js +2 -2
  405. package/dist/collection/components/icon/SomeLinkedin.js.map +1 -0
  406. package/dist/collection/components/icon/SomeTwitter.js +2 -2
  407. package/dist/collection/components/icon/SomeTwitter.js.map +1 -0
  408. package/dist/collection/components/icon/SomeYoutube.js +2 -2
  409. package/dist/collection/components/icon/SomeYoutube.js.map +1 -0
  410. package/dist/collection/components/icon/Spinner.js +2 -2
  411. package/dist/collection/components/icon/Spinner.js.map +1 -0
  412. package/dist/collection/components/icon/Square.js +2 -2
  413. package/dist/collection/components/icon/Square.js.map +1 -0
  414. package/dist/collection/components/icon/SquareChecked.js +2 -2
  415. package/dist/collection/components/icon/SquareChecked.js.map +1 -0
  416. package/dist/collection/components/icon/Time.js +2 -2
  417. package/dist/collection/components/icon/Time.js.map +1 -0
  418. package/dist/collection/components/icon/TodoList.js +2 -2
  419. package/dist/collection/components/icon/TodoList.js.map +1 -0
  420. package/dist/collection/components/icon/Tour.js +2 -2
  421. package/dist/collection/components/icon/Tour.js.map +1 -0
  422. package/dist/collection/components/icon/Twitter.js +2 -2
  423. package/dist/collection/components/icon/Twitter.js.map +1 -0
  424. package/dist/collection/components/icon/TwitterLike.js +2 -2
  425. package/dist/collection/components/icon/TwitterLike.js.map +1 -0
  426. package/dist/collection/components/icon/UnitsAndFaculties.js +2 -2
  427. package/dist/collection/components/icon/UnitsAndFaculties.js.map +1 -0
  428. package/dist/collection/components/icon/Url.js +2 -2
  429. package/dist/collection/components/icon/Url.js.map +1 -0
  430. package/dist/collection/components/icon/Video.js +2 -2
  431. package/dist/collection/components/icon/Video.js.map +1 -0
  432. package/dist/collection/components/icon/Warning.js +2 -2
  433. package/dist/collection/components/icon/Warning.js.map +1 -0
  434. package/dist/collection/components/icon/Wrench.js +2 -2
  435. package/dist/collection/components/icon/Wrench.js.map +1 -0
  436. package/dist/collection/components/icon/Youtube.js +2 -2
  437. package/dist/collection/components/icon/Youtube.js.map +1 -0
  438. package/dist/collection/components/icon/allIcons.js +1 -0
  439. package/dist/collection/components/icon/allIcons.js.map +1 -0
  440. package/dist/collection/components/icon/icon.js +68 -60
  441. package/dist/collection/components/icon/icon.js.map +1 -0
  442. package/dist/collection/components/icon/icons.js +5 -8
  443. package/dist/collection/components/icon/icons.js.map +1 -0
  444. package/dist/collection/components/image/image.js +148 -141
  445. package/dist/collection/components/image/image.js.map +1 -0
  446. package/dist/collection/components/ingress/ingress.js +35 -30
  447. package/dist/collection/components/ingress/ingress.js.map +1 -0
  448. package/dist/collection/components/link/link.js +107 -99
  449. package/dist/collection/components/link/link.js.map +1 -0
  450. package/dist/collection/components/link-box/link-box.css +0 -1
  451. package/dist/collection/components/link-box/link-box.js +271 -272
  452. package/dist/collection/components/link-box/link-box.js.map +1 -0
  453. package/dist/collection/components/link-box-list/link-box-list.js +96 -89
  454. package/dist/collection/components/link-box-list/link-box-list.js.map +1 -0
  455. package/dist/collection/components/navigation/hy-menu-main-group/hy-menu-main-group.js +286 -290
  456. package/dist/collection/components/navigation/hy-menu-main-group/hy-menu-main-group.js.map +1 -0
  457. package/dist/collection/components/navigation/menu-language/menu-language.js +148 -138
  458. package/dist/collection/components/navigation/menu-language/menu-language.js.map +1 -0
  459. package/dist/collection/components/navigation/menu-language-item/menu-language-item.js +124 -114
  460. package/dist/collection/components/navigation/menu-language-item/menu-language-item.js.map +1 -0
  461. package/dist/collection/components/pagination/hy-pager/hy-pager.js +13 -9
  462. package/dist/collection/components/pagination/hy-pager/hy-pager.js.map +1 -0
  463. package/dist/collection/components/pagination/hy-pager-item/hy-pager-item.js +93 -95
  464. package/dist/collection/components/pagination/hy-pager-item/hy-pager-item.js.map +1 -0
  465. package/dist/collection/components/paragraph-text/paragraph-text-content.css +14 -14
  466. package/dist/collection/components/paragraph-text/paragraph-text-landing.css +8 -8
  467. package/dist/collection/components/paragraph-text/paragraph-text.css +22 -22
  468. package/dist/collection/components/paragraph-text/paragraph-text.js +73 -67
  469. package/dist/collection/components/paragraph-text/paragraph-text.js.map +1 -0
  470. package/dist/collection/components/person-profile/person-profile-listing/person-profile-listing.css +1 -1
  471. package/dist/collection/components/person-profile/person-profile-listing/person-profile.listing.js +128 -126
  472. package/dist/collection/components/person-profile/person-profile-listing/person-profile.listing.js.map +1 -0
  473. package/dist/collection/components/person-profile/person-profile.css +4 -4
  474. package/dist/collection/components/person-profile/person-profile.js +139 -182
  475. package/dist/collection/components/person-profile/person-profile.js.map +1 -0
  476. package/dist/collection/components/process/process.js +72 -62
  477. package/dist/collection/components/process/process.js.map +1 -0
  478. package/dist/collection/components/process-flow-box/process-flow-box.js +145 -148
  479. package/dist/collection/components/process-flow-box/process-flow-box.js.map +1 -0
  480. package/dist/collection/components/row/row.js +69 -72
  481. package/dist/collection/components/row/row.js.map +1 -0
  482. package/dist/collection/components/section-container/section-container.js +13 -9
  483. package/dist/collection/components/section-container/section-container.js.map +1 -0
  484. package/dist/collection/components/site-header/site-header.css +1 -1
  485. package/dist/collection/components/site-header/site-header.js +541 -560
  486. package/dist/collection/components/site-header/site-header.js.map +1 -0
  487. package/dist/collection/components/site-header/site-logo/site-logo.js +149 -148
  488. package/dist/collection/components/site-header/site-logo/site-logo.js.map +1 -0
  489. package/dist/collection/components/site-header/site-search/site-search.js +298 -312
  490. package/dist/collection/components/site-header/site-search/site-search.js.map +1 -0
  491. package/dist/collection/components/tiny-text/tiny-text.js +13 -9
  492. package/dist/collection/components/tiny-text/tiny-text.js.map +1 -0
  493. package/dist/collection/global/colors.js +1 -0
  494. package/dist/collection/global/colors.js.map +1 -0
  495. package/dist/collection/global/globalScript.js +1 -0
  496. package/dist/collection/global/globalScript.js.map +1 -0
  497. package/dist/collection/global/typography.js +1 -0
  498. package/dist/collection/global/typography.js.map +1 -0
  499. package/dist/collection/index.js +1 -0
  500. package/dist/collection/index.js.map +1 -0
  501. package/dist/collection/utils/utils.js +1 -0
  502. package/dist/collection/utils/utils.js.map +1 -0
  503. package/dist/esm/color-box_8.entry.js +14 -37
  504. package/dist/esm/color-box_8.entry.js.map +1 -0
  505. package/dist/esm/{globalScript-9d045b36.js → globalScript-4ad40215.js} +3 -1
  506. package/dist/esm/globalScript-4ad40215.js.map +1 -0
  507. package/dist/esm/huds-lib.js +9 -3
  508. package/dist/esm/huds-lib.js.map +1 -0
  509. package/dist/esm/hy-accordion-container_83.entry.js +366 -158
  510. package/dist/esm/hy-accordion-container_83.entry.js.map +1 -0
  511. package/dist/esm/hy-event-item.entry.js +7 -2
  512. package/dist/esm/hy-event-item.entry.js.map +1 -0
  513. package/dist/esm/hy-events.entry.js +7 -3
  514. package/dist/esm/hy-events.entry.js.map +1 -0
  515. package/dist/esm/{index-daaf0985.js → index-3a66d87e.js} +692 -288
  516. package/dist/esm/index-3a66d87e.js.map +1 -0
  517. package/dist/esm/index.js +2 -0
  518. package/dist/esm/index.js.map +1 -0
  519. package/dist/esm/loader.js +6 -3
  520. package/dist/esm/loader.js.map +1 -0
  521. package/dist/esm/polyfills/css-shim.js +1 -1
  522. package/dist/esm/{utils-7731bbdf.js → utils-43c56d92.js} +3 -1
  523. package/dist/esm/utils-43c56d92.js.map +1 -0
  524. package/dist/huds-lib/huds-lib.esm.js +2 -1
  525. package/dist/huds-lib/huds-lib.esm.js.map +1 -0
  526. package/dist/huds-lib/index.esm.js +2 -0
  527. package/dist/huds-lib/index.esm.js.map +1 -0
  528. package/dist/huds-lib/p-1aeae669.entry.js +2 -0
  529. package/dist/huds-lib/p-1aeae669.entry.js.map +1 -0
  530. package/dist/huds-lib/p-30e3190a.entry.js +88 -0
  531. package/dist/huds-lib/p-30e3190a.entry.js.map +1 -0
  532. package/dist/huds-lib/p-63584350.js +2 -0
  533. package/dist/huds-lib/p-63584350.js.map +1 -0
  534. package/dist/huds-lib/p-7b75f0ea.entry.js +2 -0
  535. package/dist/huds-lib/p-7b75f0ea.entry.js.map +1 -0
  536. package/dist/huds-lib/p-b02e49ad.js +2 -0
  537. package/dist/huds-lib/p-b02e49ad.js.map +1 -0
  538. package/dist/huds-lib/p-c8ed784d.entry.js +2 -0
  539. package/dist/huds-lib/p-c8ed784d.entry.js.map +1 -0
  540. package/dist/huds-lib/p-ff975a68.js +3 -0
  541. package/dist/huds-lib/p-ff975a68.js.map +1 -0
  542. package/dist/types/components/person-profile/person-profile-listing/person-profile.listing.d.ts +1 -1
  543. package/dist/types/components.d.ts +66 -20
  544. package/dist/types/stencil-public-runtime.d.ts +92 -19
  545. package/dist/types/utils/utils.d.ts +4 -4
  546. package/loader/index.d.ts +11 -12
  547. package/loader/index.es2017.js +1 -0
  548. package/loader/index.js +2 -11
  549. package/loader/package.json +2 -1
  550. package/package.json +12 -11
  551. package/dist/huds-lib/p-0370da7d.entry.js +0 -87
  552. package/dist/huds-lib/p-04dcccdc.js +0 -1
  553. package/dist/huds-lib/p-0ea3ec9a.js +0 -1
  554. package/dist/huds-lib/p-2244fcda.entry.js +0 -1
  555. package/dist/huds-lib/p-aba9f82a.entry.js +0 -1
  556. package/dist/huds-lib/p-c68c36c3.entry.js +0 -1
  557. package/dist/huds-lib/p-f8697bf9.js +0 -1
@@ -1,5 +1,13 @@
1
1
  const NAMESPACE = 'huds-lib';
2
2
 
3
+ /**
4
+ * Virtual DOM patching algorithm based on Snabbdom by
5
+ * Simon Friis Vindum (@paldepind)
6
+ * Licensed under the MIT License
7
+ * https://github.com/snabbdom/snabbdom/blob/master/LICENSE
8
+ *
9
+ * Modified for Stencil's renderer and slot projection
10
+ */
3
11
  let scopeId;
4
12
  let contentRef;
5
13
  let hostTagName;
@@ -9,65 +17,6 @@ let checkSlotRelocate = false;
9
17
  let isSvgMode = false;
10
18
  let queueCongestion = 0;
11
19
  let queuePending = false;
12
- const win = typeof window !== 'undefined' ? window : {};
13
- const doc = win.document || { head: {} };
14
- const plt = {
15
- $flags$: 0,
16
- $resourcesUrl$: '',
17
- jmp: (h) => h(),
18
- raf: (h) => requestAnimationFrame(h),
19
- ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
20
- rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
21
- ce: (eventName, opts) => new CustomEvent(eventName, opts),
22
- };
23
- const promiseResolve = (v) => Promise.resolve(v);
24
- const supportsConstructibleStylesheets = /*@__PURE__*/ (() => {
25
- try {
26
- new CSSStyleSheet();
27
- return typeof new CSSStyleSheet().replace === 'function';
28
- }
29
- catch (e) { }
30
- return false;
31
- })()
32
- ;
33
- const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
34
- if (listeners) {
35
- listeners.map(([flags, name, method]) => {
36
- const target = getHostListenerTarget(elm, flags) ;
37
- const handler = hostListenerProxy(hostRef, method);
38
- const opts = hostListenerOpts(flags);
39
- plt.ael(target, name, handler, opts);
40
- (hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
41
- });
42
- }
43
- };
44
- const hostListenerProxy = (hostRef, methodName) => (ev) => {
45
- try {
46
- {
47
- if (hostRef.$flags$ & 256 /* isListenReady */) {
48
- // instance is ready, let's call it's member method for this event
49
- hostRef.$lazyInstance$[methodName](ev);
50
- }
51
- else {
52
- (hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
53
- }
54
- }
55
- }
56
- catch (e) {
57
- consoleError(e);
58
- }
59
- };
60
- const getHostListenerTarget = (elm, flags) => {
61
- if (flags & 4 /* TargetDocument */)
62
- return doc;
63
- if (flags & 8 /* TargetWindow */)
64
- return win;
65
- return elm;
66
- };
67
- // prettier-ignore
68
- const hostListenerOpts = (flags) => (flags & 2 /* Capture */) !== 0;
69
- const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
70
- const XLINK_NS = 'http://www.w3.org/1999/xlink';
71
20
  const createTime = (fnName, tagName = '') => {
72
21
  {
73
22
  return () => {
@@ -82,75 +31,8 @@ const uniqueTime = (key, measureText) => {
82
31
  };
83
32
  }
84
33
  };
85
- const rootAppliedStyles = new WeakMap();
86
- const registerStyle = (scopeId, cssText, allowCS) => {
87
- let style = styles.get(scopeId);
88
- if (supportsConstructibleStylesheets && allowCS) {
89
- style = (style || new CSSStyleSheet());
90
- style.replace(cssText);
91
- }
92
- else {
93
- style = cssText;
94
- }
95
- styles.set(scopeId, style);
96
- };
97
- const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
98
- let scopeId = getScopeId(cmpMeta, mode);
99
- let style = styles.get(scopeId);
100
- // if an element is NOT connected then getRootNode() will return the wrong root node
101
- // so the fallback is to always use the document for the root node in those cases
102
- styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
103
- if (style) {
104
- if (typeof style === 'string') {
105
- styleContainerNode = styleContainerNode.head || styleContainerNode;
106
- let appliedStyles = rootAppliedStyles.get(styleContainerNode);
107
- let styleElm;
108
- if (!appliedStyles) {
109
- rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
110
- }
111
- if (!appliedStyles.has(scopeId)) {
112
- {
113
- {
114
- styleElm = doc.createElement('style');
115
- styleElm.innerHTML = style;
116
- }
117
- styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
118
- }
119
- if (appliedStyles) {
120
- appliedStyles.add(scopeId);
121
- }
122
- }
123
- }
124
- else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
125
- styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
126
- }
127
- }
128
- return scopeId;
129
- };
130
- const attachStyles = (hostRef) => {
131
- const cmpMeta = hostRef.$cmpMeta$;
132
- const elm = hostRef.$hostElement$;
133
- const flags = cmpMeta.$flags$;
134
- const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
135
- const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta, hostRef.$modeName$);
136
- if (flags & 10 /* needsScopedEncapsulation */) {
137
- // only required when we're NOT using native shadow dom (slot)
138
- // or this browser doesn't support native shadow dom
139
- // and this host element was NOT created with SSR
140
- // let's pick out the inner content for slot projection
141
- // create a node to represent where the original
142
- // content was first placed, which is useful later on
143
- // DOM WRITE!!
144
- elm['s-sc'] = scopeId;
145
- elm.classList.add(scopeId + '-h');
146
- }
147
- endAttachStyles();
148
- };
149
- const getScopeId = (cmp, mode) => 'sc-' + (mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + '-' + mode : cmp.$tagName$);
150
- // Private
151
- const computeMode = (elm) => modeResolutionChain.map((h) => h(elm)).find((m) => !!m);
152
- // Public
153
- const setMode = (handler) => modeResolutionChain.push(handler);
34
+ const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
35
+ const XLINK_NS = 'http://www.w3.org/1999/xlink';
154
36
  /**
155
37
  * Default style mode id
156
38
  */
@@ -165,11 +47,30 @@ const EMPTY_OBJ = {};
165
47
  const SVG_NS = 'http://www.w3.org/2000/svg';
166
48
  const HTML_NS = 'http://www.w3.org/1999/xhtml';
167
49
  const isDef = (v) => v != null;
50
+ /**
51
+ * Check whether a value is a 'complex type', defined here as an object or a
52
+ * function.
53
+ *
54
+ * @param o the value to check
55
+ * @returns whether it's a complex type or not
56
+ */
168
57
  const isComplexType = (o) => {
169
58
  // https://jsperf.com/typeof-fn-object/5
170
59
  o = typeof o;
171
60
  return o === 'object' || o === 'function';
172
61
  };
62
+ /**
63
+ * Helper method for querying a `meta` tag that contains a nonce value
64
+ * out of a DOM's head.
65
+ *
66
+ * @param doc The DOM containing the `head` to query against
67
+ * @returns The content of the meta tag representing the nonce value, or `undefined` if no tag
68
+ * exists or the tag has no content.
69
+ */
70
+ function queryNonceMetaTagContent(doc) {
71
+ var _a, _b, _c;
72
+ 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;
73
+ }
173
74
  /**
174
75
  * Production h() function based on Preact by
175
76
  * Jason Miller (@developit)
@@ -178,7 +79,6 @@ const isComplexType = (o) => {
178
79
  *
179
80
  * Modified for Stencil's compiler and vdom
180
81
  */
181
- // const stack: any[] = [];
182
82
  // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode;
183
83
  // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
184
84
  const h = (nodeName, vnodeData, ...children) => {
@@ -187,7 +87,7 @@ const h = (nodeName, vnodeData, ...children) => {
187
87
  let slotName = null;
188
88
  let simple = false;
189
89
  let lastSimple = false;
190
- let vNodeChildren = [];
90
+ const vNodeChildren = [];
191
91
  const walk = (c) => {
192
92
  for (let i = 0; i < c.length; i++) {
193
93
  child = c[i];
@@ -248,6 +148,14 @@ const h = (nodeName, vnodeData, ...children) => {
248
148
  }
249
149
  return vnode;
250
150
  };
151
+ /**
152
+ * A utility function for creating a virtual DOM node from a tag and some
153
+ * possible text content.
154
+ *
155
+ * @param tag the tag for this element
156
+ * @param text possible text content for the node
157
+ * @returns a newly-minted virtual DOM node
158
+ */
251
159
  const newVNode = (tag, text) => {
252
160
  const vnode = {
253
161
  $flags$: 0,
@@ -268,11 +176,31 @@ const newVNode = (tag, text) => {
268
176
  return vnode;
269
177
  };
270
178
  const Host = {};
179
+ /**
180
+ * Check whether a given node is a Host node or not
181
+ *
182
+ * @param node the virtual DOM node to check
183
+ * @returns whether it's a Host node or not
184
+ */
271
185
  const isHost = (node) => node && node.$tag$ === Host;
186
+ /**
187
+ * Implementation of {@link d.FunctionalUtilities} for Stencil's VDom.
188
+ *
189
+ * Note that these functions convert from {@link d.VNode} to
190
+ * {@link d.ChildNode} to give functional component developers a friendly
191
+ * interface.
192
+ */
272
193
  const vdomFnUtils = {
273
194
  forEach: (children, cb) => children.map(convertToPublic).forEach(cb),
274
195
  map: (children, cb) => children.map(convertToPublic).map(cb).map(convertToPrivate),
275
196
  };
197
+ /**
198
+ * Convert a {@link d.VNode} to a {@link d.ChildNode} in order to present a
199
+ * friendlier public interface (hence, 'convertToPublic').
200
+ *
201
+ * @param node the virtual DOM node to convert
202
+ * @returns a converted child node
203
+ */
276
204
  const convertToPublic = (node) => ({
277
205
  vattrs: node.$attrs$,
278
206
  vchildren: node.$children$,
@@ -281,6 +209,15 @@ const convertToPublic = (node) => ({
281
209
  vtag: node.$tag$,
282
210
  vtext: node.$text$,
283
211
  });
212
+ /**
213
+ * Convert a {@link d.ChildNode} back to an equivalent {@link d.VNode} in
214
+ * order to use the resulting object in the virtual DOM. The initial object was
215
+ * likely created as part of presenting a public API, so converting it back
216
+ * involved making it 'private' again (hence, `convertToPrivate`).
217
+ *
218
+ * @param node the child node to convert
219
+ * @returns a converted virtual DOM node
220
+ */
284
221
  const convertToPrivate = (node) => {
285
222
  if (typeof node.vtag === 'function') {
286
223
  const vnodeData = Object.assign({}, node.vattrs);
@@ -299,6 +236,161 @@ const convertToPrivate = (node) => {
299
236
  vnode.$name$ = node.vname;
300
237
  return vnode;
301
238
  };
239
+ // Private
240
+ const computeMode = (elm) => modeResolutionChain.map((h) => h(elm)).find((m) => !!m);
241
+ // Public
242
+ const setMode = (handler) => modeResolutionChain.push(handler);
243
+ /**
244
+ * Parse a new property value for a given property type.
245
+ *
246
+ * While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
247
+ * it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
248
+ * 1. `any`, the type given to `propValue` in the function signature
249
+ * 2. the type stored from `propType`.
250
+ *
251
+ * This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
252
+ *
253
+ * Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
254
+ * a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
255
+ * based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
256
+ * ```tsx
257
+ * <my-cmp prop-val={0}></my-cmp>
258
+ * ```
259
+ *
260
+ * HTML prop values on the other hand, will always a string
261
+ *
262
+ * @param propValue the new value to coerce to some type
263
+ * @param propType the type of the prop, expressed as a binary number
264
+ * @returns the parsed/coerced value
265
+ */
266
+ const parsePropertyValue = (propValue, propType) => {
267
+ // ensure this value is of the correct prop type
268
+ if (propValue != null && !isComplexType(propValue)) {
269
+ if (propType & 4 /* MEMBER_FLAGS.Boolean */) {
270
+ // per the HTML spec, any string value means it is a boolean true value
271
+ // but we'll cheat here and say that the string "false" is the boolean false
272
+ return propValue === 'false' ? false : propValue === '' || !!propValue;
273
+ }
274
+ if (propType & 2 /* MEMBER_FLAGS.Number */) {
275
+ // force it to be a number
276
+ return parseFloat(propValue);
277
+ }
278
+ if (propType & 1 /* MEMBER_FLAGS.String */) {
279
+ // could have been passed as a number or boolean
280
+ // but we still want it as a string
281
+ return String(propValue);
282
+ }
283
+ // redundant return here for better minification
284
+ return propValue;
285
+ }
286
+ // not sure exactly what type we want
287
+ // so no need to change to a different type
288
+ return propValue;
289
+ };
290
+ const getElement = (ref) => (getHostRef(ref).$hostElement$ );
291
+ const createEvent = (ref, name, flags) => {
292
+ const elm = getElement(ref);
293
+ return {
294
+ emit: (detail) => {
295
+ return emitEvent(elm, name, {
296
+ bubbles: !!(flags & 4 /* EVENT_FLAGS.Bubbles */),
297
+ composed: !!(flags & 2 /* EVENT_FLAGS.Composed */),
298
+ cancelable: !!(flags & 1 /* EVENT_FLAGS.Cancellable */),
299
+ detail,
300
+ });
301
+ },
302
+ };
303
+ };
304
+ /**
305
+ * Helper function to create & dispatch a custom Event on a provided target
306
+ * @param elm the target of the Event
307
+ * @param name the name to give the custom Event
308
+ * @param opts options for configuring a custom Event
309
+ * @returns the custom Event
310
+ */
311
+ const emitEvent = (elm, name, opts) => {
312
+ const ev = plt.ce(name, opts);
313
+ elm.dispatchEvent(ev);
314
+ return ev;
315
+ };
316
+ const rootAppliedStyles = /*@__PURE__*/ new WeakMap();
317
+ const registerStyle = (scopeId, cssText, allowCS) => {
318
+ let style = styles.get(scopeId);
319
+ if (supportsConstructableStylesheets && allowCS) {
320
+ style = (style || new CSSStyleSheet());
321
+ if (typeof style === 'string') {
322
+ style = cssText;
323
+ }
324
+ else {
325
+ style.replaceSync(cssText);
326
+ }
327
+ }
328
+ else {
329
+ style = cssText;
330
+ }
331
+ styles.set(scopeId, style);
332
+ };
333
+ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
334
+ var _a;
335
+ let scopeId = getScopeId(cmpMeta, mode);
336
+ const style = styles.get(scopeId);
337
+ // if an element is NOT connected then getRootNode() will return the wrong root node
338
+ // so the fallback is to always use the document for the root node in those cases
339
+ styleContainerNode = styleContainerNode.nodeType === 11 /* NODE_TYPE.DocumentFragment */ ? styleContainerNode : doc;
340
+ if (style) {
341
+ if (typeof style === 'string') {
342
+ styleContainerNode = styleContainerNode.head || styleContainerNode;
343
+ let appliedStyles = rootAppliedStyles.get(styleContainerNode);
344
+ let styleElm;
345
+ if (!appliedStyles) {
346
+ rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
347
+ }
348
+ if (!appliedStyles.has(scopeId)) {
349
+ {
350
+ // TODO(STENCIL-659): Remove code implementing the CSS variable shim
351
+ {
352
+ styleElm = doc.createElement('style');
353
+ styleElm.innerHTML = style;
354
+ }
355
+ // Apply CSP nonce to the style tag if it exists
356
+ const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
357
+ if (nonce != null) {
358
+ styleElm.setAttribute('nonce', nonce);
359
+ }
360
+ styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
361
+ }
362
+ if (appliedStyles) {
363
+ appliedStyles.add(scopeId);
364
+ }
365
+ }
366
+ }
367
+ else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
368
+ styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
369
+ }
370
+ }
371
+ return scopeId;
372
+ };
373
+ const attachStyles = (hostRef) => {
374
+ const cmpMeta = hostRef.$cmpMeta$;
375
+ const elm = hostRef.$hostElement$;
376
+ const flags = cmpMeta.$flags$;
377
+ const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
378
+ const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta, hostRef.$modeName$);
379
+ // TODO(STENCIL-662): Remove code related to deprecated shadowDomShim field
380
+ if (flags & 10 /* CMP_FLAGS.needsScopedEncapsulation */) {
381
+ // only required when we're NOT using native shadow dom (slot)
382
+ // or this browser doesn't support native shadow dom
383
+ // and this host element was NOT created with SSR
384
+ // let's pick out the inner content for slot projection
385
+ // create a node to represent where the original
386
+ // content was first placed, which is useful later on
387
+ // DOM WRITE!!
388
+ elm['s-sc'] = scopeId;
389
+ elm.classList.add(scopeId + '-h');
390
+ }
391
+ endAttachStyles();
392
+ };
393
+ const getScopeId = (cmp, mode) => 'sc-' + (mode && cmp.$flags$ & 32 /* CMP_FLAGS.hasMode */ ? cmp.$tagName$ + '-' + mode : cmp.$tagName$);
302
394
  /**
303
395
  * Production setAccessor() function based on Preact by
304
396
  * Jason Miller (@developit)
@@ -396,7 +488,7 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
396
488
  if ((isProp || (isComplex && newValue !== null)) && !isSvg) {
397
489
  try {
398
490
  if (!elm.tagName.includes('-')) {
399
- let n = newValue == null ? '' : newValue;
491
+ const n = newValue == null ? '' : newValue;
400
492
  // Workaround for Safari, moving the <input> caret when re-assigning the same valued
401
493
  if (memberName === 'list') {
402
494
  isProp = false;
@@ -435,7 +527,7 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
435
527
  }
436
528
  }
437
529
  }
438
- else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
530
+ else if ((!isProp || flags & 4 /* VNODE_FLAGS.isHost */ || isSvg) && !isComplex) {
439
531
  newValue = newValue === true ? '' : newValue;
440
532
  if (xlink) {
441
533
  elm.setAttributeNS(XLINK_NS, memberName, newValue);
@@ -453,7 +545,7 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
453
545
  // if the element passed in is a shadow root, which is a document fragment
454
546
  // then we want to be adding attrs/props to the shadow root's "host" element
455
547
  // if it's not a shadow root, then we add attrs/props to the same element
456
- const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host
548
+ const elm = newVnode.$elm$.nodeType === 11 /* NODE_TYPE.DocumentFragment */ && newVnode.$elm$.host
457
549
  ? newVnode.$elm$.host
458
550
  : newVnode.$elm$;
459
551
  const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
@@ -471,9 +563,19 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
471
563
  setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
472
564
  }
473
565
  };
566
+ /**
567
+ * Create a DOM Node corresponding to one of the children of a given VNode.
568
+ *
569
+ * @param oldParentVNode the parent VNode from the previous render
570
+ * @param newParentVNode the parent VNode from the current render
571
+ * @param childIndex the index of the VNode, in the _new_ parent node's
572
+ * children, for which we will create a new DOM node
573
+ * @param parentElm the parent DOM node which our new node will be a child of
574
+ * @returns the newly created node
575
+ */
474
576
  const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
475
577
  // tslint:disable-next-line: prefer-const
476
- let newVNode = newParentVNode.$children$[childIndex];
578
+ const newVNode = newParentVNode.$children$[childIndex];
477
579
  let i = 0;
478
580
  let elm;
479
581
  let childNode;
@@ -488,16 +590,16 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
488
590
  }
489
591
  newVNode.$flags$ |= newVNode.$children$
490
592
  ? // slot element has fallback content
491
- 2 /* isSlotFallback */
593
+ 2 /* VNODE_FLAGS.isSlotFallback */
492
594
  : // slot element does not have fallback content
493
- 1 /* isSlotReference */;
595
+ 1 /* VNODE_FLAGS.isSlotReference */;
494
596
  }
495
597
  }
496
598
  if (newVNode.$text$ !== null) {
497
599
  // create text node
498
600
  elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
499
601
  }
500
- else if (newVNode.$flags$ & 1 /* isSlotReference */) {
602
+ else if (newVNode.$flags$ & 1 /* VNODE_FLAGS.isSlotReference */) {
501
603
  // create a slot reference node
502
604
  elm = newVNode.$elm$ =
503
605
  doc.createTextNode('');
@@ -507,7 +609,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
507
609
  isSvgMode = newVNode.$tag$ === 'svg';
508
610
  }
509
611
  // create element
510
- elm = newVNode.$elm$ = (doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, newVNode.$flags$ & 2 /* isSlotFallback */
612
+ elm = newVNode.$elm$ = (doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, newVNode.$flags$ & 2 /* VNODE_FLAGS.isSlotFallback */
511
613
  ? 'slot-fb'
512
614
  : newVNode.$tag$)
513
615
  );
@@ -547,7 +649,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
547
649
  }
548
650
  {
549
651
  elm['s-hn'] = hostTagName;
550
- if (newVNode.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
652
+ if (newVNode.$flags$ & (2 /* VNODE_FLAGS.isSlotFallback */ | 1 /* VNODE_FLAGS.isSlotReference */)) {
551
653
  // remember the content reference comment
552
654
  elm['s-sr'] = true;
553
655
  // remember the content reference comment
@@ -566,7 +668,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
566
668
  return elm;
567
669
  };
568
670
  const putBackInOriginalLocation = (parentElm, recursive) => {
569
- plt.$flags$ |= 1 /* isTmpDisconnected */;
671
+ plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
570
672
  const oldSlotChildNodes = parentElm.childNodes;
571
673
  for (let i = oldSlotChildNodes.length - 1; i >= 0; i--) {
572
674
  const childNode = oldSlotChildNodes[i];
@@ -587,8 +689,23 @@ const putBackInOriginalLocation = (parentElm, recursive) => {
587
689
  putBackInOriginalLocation(childNode, recursive);
588
690
  }
589
691
  }
590
- plt.$flags$ &= ~1 /* isTmpDisconnected */;
692
+ plt.$flags$ &= ~1 /* PLATFORM_FLAGS.isTmpDisconnected */;
591
693
  };
694
+ /**
695
+ * Create DOM nodes corresponding to a list of {@link d.Vnode} objects and
696
+ * add them to the DOM in the appropriate place.
697
+ *
698
+ * @param parentElm the DOM node which should be used as a parent for the new
699
+ * DOM nodes
700
+ * @param before a child of the `parentElm` which the new children should be
701
+ * inserted before (optional)
702
+ * @param parentVNode the parent virtual DOM node
703
+ * @param vnodes the new child virtual DOM nodes to produce DOM nodes for
704
+ * @param startIdx the index in the child virtual DOM nodes at which to start
705
+ * creating DOM nodes (inclusive)
706
+ * @param endIdx the index in the child virtual DOM nodes at which to stop
707
+ * creating DOM nodes (inclusive)
708
+ */
592
709
  const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
593
710
  let containerElm = ((parentElm['s-cr'] && parentElm['s-cr'].parentNode) || parentElm);
594
711
  let childNode;
@@ -605,30 +722,112 @@ const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) =>
605
722
  }
606
723
  }
607
724
  };
608
- const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
609
- for (; startIdx <= endIdx; ++startIdx) {
610
- if ((vnode = vnodes[startIdx])) {
611
- elm = vnode.$elm$;
612
- callNodeRefs(vnode);
613
- {
614
- // we're removing this element
615
- // so it's possible we need to show slot fallback content now
616
- checkSlotFallbackVisibility = true;
617
- if (elm['s-ol']) {
618
- // remove the original location comment
619
- elm['s-ol'].remove();
620
- }
621
- else {
622
- // it's possible that child nodes of the node
623
- // that's being removed are slot nodes
624
- putBackInOriginalLocation(elm, true);
725
+ /**
726
+ * Remove the DOM elements corresponding to a list of {@link d.VNode} objects.
727
+ * This can be used to, for instance, clean up after a list of children which
728
+ * should no longer be shown.
729
+ *
730
+ * This function also handles some of Stencil's slot relocation logic.
731
+ *
732
+ * @param vnodes a list of virtual DOM nodes to remove
733
+ * @param startIdx the index at which to start removing nodes (inclusive)
734
+ * @param endIdx the index at which to stop removing nodes (inclusive)
735
+ */
736
+ const removeVnodes = (vnodes, startIdx, endIdx) => {
737
+ for (let index = startIdx; index <= endIdx; ++index) {
738
+ const vnode = vnodes[index];
739
+ if (vnode) {
740
+ const elm = vnode.$elm$;
741
+ nullifyVNodeRefs(vnode);
742
+ if (elm) {
743
+ {
744
+ // we're removing this element
745
+ // so it's possible we need to show slot fallback content now
746
+ checkSlotFallbackVisibility = true;
747
+ if (elm['s-ol']) {
748
+ // remove the original location comment
749
+ elm['s-ol'].remove();
750
+ }
751
+ else {
752
+ // it's possible that child nodes of the node
753
+ // that's being removed are slot nodes
754
+ putBackInOriginalLocation(elm, true);
755
+ }
625
756
  }
757
+ // remove the vnode's element from the dom
758
+ elm.remove();
626
759
  }
627
- // remove the vnode's element from the dom
628
- elm.remove();
629
760
  }
630
761
  }
631
762
  };
763
+ /**
764
+ * Reconcile the children of a new VNode with the children of an old VNode by
765
+ * traversing the two collections of children, identifying nodes that are
766
+ * conserved or changed, calling out to `patch` to make any necessary
767
+ * updates to the DOM, and rearranging DOM nodes as needed.
768
+ *
769
+ * The algorithm for reconciling children works by analyzing two 'windows' onto
770
+ * the two arrays of children (`oldCh` and `newCh`). We keep track of the
771
+ * 'windows' by storing start and end indices and references to the
772
+ * corresponding array entries. Initially the two 'windows' are basically equal
773
+ * to the entire array, but we progressively narrow the windows until there are
774
+ * no children left to update by doing the following:
775
+ *
776
+ * 1. Skip any `null` entries at the beginning or end of the two arrays, so
777
+ * that if we have an initial array like the following we'll end up dealing
778
+ * only with a window bounded by the highlighted elements:
779
+ *
780
+ * [null, null, VNode1 , ... , VNode2, null, null]
781
+ * ^^^^^^ ^^^^^^
782
+ *
783
+ * 2. Check to see if the elements at the head and tail positions are equal
784
+ * across the windows. This will basically detect elements which haven't
785
+ * been added, removed, or changed position, i.e. if you had the following
786
+ * VNode elements (represented as HTML):
787
+ *
788
+ * oldVNode: `<div><p><span>HEY</span></p></div>`
789
+ * newVNode: `<div><p><span>THERE</span></p></div>`
790
+ *
791
+ * Then when comparing the children of the `<div>` tag we check the equality
792
+ * of the VNodes corresponding to the `<p>` tags and, since they are the
793
+ * same tag in the same position, we'd be able to avoid completely
794
+ * re-rendering the subtree under them with a new DOM element and would just
795
+ * call out to `patch` to handle reconciling their children and so on.
796
+ *
797
+ * 3. Check, for both windows, to see if the element at the beginning of the
798
+ * window corresponds to the element at the end of the other window. This is
799
+ * a heuristic which will let us identify _some_ situations in which
800
+ * elements have changed position, for instance it _should_ detect that the
801
+ * children nodes themselves have not changed but merely moved in the
802
+ * following example:
803
+ *
804
+ * oldVNode: `<div><element-one /><element-two /></div>`
805
+ * newVNode: `<div><element-two /><element-one /></div>`
806
+ *
807
+ * If we find cases like this then we also need to move the concrete DOM
808
+ * elements corresponding to the moved children to write the re-order to the
809
+ * DOM.
810
+ *
811
+ * 4. Finally, if VNodes have the `key` attribute set on them we check for any
812
+ * nodes in the old children which have the same key as the first element in
813
+ * our window on the new children. If we find such a node we handle calling
814
+ * out to `patch`, moving relevant DOM nodes, and so on, in accordance with
815
+ * what we find.
816
+ *
817
+ * Finally, once we've narrowed our 'windows' to the point that either of them
818
+ * collapse (i.e. they have length 0) we then handle any remaining VNode
819
+ * insertion or deletion that needs to happen to get a DOM state that correctly
820
+ * reflects the new child VNodes. If, for instance, after our window on the old
821
+ * children has collapsed we still have more nodes on the new children that
822
+ * we haven't dealt with yet then we need to add them, or if the new children
823
+ * collapse but we still have unhandled _old_ children then we need to make
824
+ * sure the corresponding DOM nodes are removed.
825
+ *
826
+ * @param parentElm the node into which the parent VNode is rendered
827
+ * @param oldCh the old children of the parent node
828
+ * @param newVNode the new VNode which will replace the parent
829
+ * @param newCh the new children of the parent node
830
+ */
632
831
  const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
633
832
  let oldStartIdx = 0;
634
833
  let newStartIdx = 0;
@@ -644,7 +843,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
644
843
  let elmToMove;
645
844
  while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
646
845
  if (oldStartVnode == null) {
647
- // Vnode might have been moved left
846
+ // VNode might have been moved left
648
847
  oldStartVnode = oldCh[++oldStartIdx];
649
848
  }
650
849
  else if (oldEndVnode == null) {
@@ -657,37 +856,100 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
657
856
  newEndVnode = newCh[--newEndIdx];
658
857
  }
659
858
  else if (isSameVnode(oldStartVnode, newStartVnode)) {
859
+ // if the start nodes are the same then we should patch the new VNode
860
+ // onto the old one, and increment our `newStartIdx` and `oldStartIdx`
861
+ // indices to reflect that. We don't need to move any DOM Nodes around
862
+ // since things are matched up in order.
660
863
  patch(oldStartVnode, newStartVnode);
661
864
  oldStartVnode = oldCh[++oldStartIdx];
662
865
  newStartVnode = newCh[++newStartIdx];
663
866
  }
664
867
  else if (isSameVnode(oldEndVnode, newEndVnode)) {
868
+ // likewise, if the end nodes are the same we patch new onto old and
869
+ // decrement our end indices, and also likewise in this case we don't
870
+ // need to move any DOM Nodes.
665
871
  patch(oldEndVnode, newEndVnode);
666
872
  oldEndVnode = oldCh[--oldEndIdx];
667
873
  newEndVnode = newCh[--newEndIdx];
668
874
  }
669
875
  else if (isSameVnode(oldStartVnode, newEndVnode)) {
670
- // Vnode moved right
876
+ // case: "Vnode moved right"
877
+ //
878
+ // We've found that the last node in our window on the new children is
879
+ // the same VNode as the _first_ node in our window on the old children
880
+ // we're dealing with now. Visually, this is the layout of these two
881
+ // nodes:
882
+ //
883
+ // newCh: [..., newStartVnode , ... , newEndVnode , ...]
884
+ // ^^^^^^^^^^^
885
+ // oldCh: [..., oldStartVnode , ... , oldEndVnode , ...]
886
+ // ^^^^^^^^^^^^^
887
+ //
888
+ // In this situation we need to patch `newEndVnode` onto `oldStartVnode`
889
+ // and move the DOM element for `oldStartVnode`.
671
890
  if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
672
891
  putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
673
892
  }
674
893
  patch(oldStartVnode, newEndVnode);
894
+ // We need to move the element for `oldStartVnode` into a position which
895
+ // will be appropriate for `newEndVnode`. For this we can use
896
+ // `.insertBefore` and `oldEndVnode.$elm$.nextSibling`. If there is a
897
+ // sibling for `oldEndVnode.$elm$` then we want to move the DOM node for
898
+ // `oldStartVnode` between `oldEndVnode` and it's sibling, like so:
899
+ //
900
+ // <old-start-node />
901
+ // <some-intervening-node />
902
+ // <old-end-node />
903
+ // <!-- -> <-- `oldStartVnode.$elm$` should be inserted here
904
+ // <next-sibling />
905
+ //
906
+ // If instead `oldEndVnode.$elm$` has no sibling then we just want to put
907
+ // the node for `oldStartVnode` at the end of the children of
908
+ // `parentElm`. Luckily, `Node.nextSibling` will return `null` if there
909
+ // aren't any siblings, and passing `null` to `Node.insertBefore` will
910
+ // append it to the children of the parent element.
675
911
  parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
676
912
  oldStartVnode = oldCh[++oldStartIdx];
677
913
  newEndVnode = newCh[--newEndIdx];
678
914
  }
679
915
  else if (isSameVnode(oldEndVnode, newStartVnode)) {
680
- // Vnode moved left
916
+ // case: "Vnode moved left"
917
+ //
918
+ // We've found that the first node in our window on the new children is
919
+ // the same VNode as the _last_ node in our window on the old children.
920
+ // Visually, this is the layout of these two nodes:
921
+ //
922
+ // newCh: [..., newStartVnode , ... , newEndVnode , ...]
923
+ // ^^^^^^^^^^^^^
924
+ // oldCh: [..., oldStartVnode , ... , oldEndVnode , ...]
925
+ // ^^^^^^^^^^^
926
+ //
927
+ // In this situation we need to patch `newStartVnode` onto `oldEndVnode`
928
+ // (which will handle updating any changed attributes, reconciling their
929
+ // children etc) but we also need to move the DOM node to which
930
+ // `oldEndVnode` corresponds.
681
931
  if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
682
932
  putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
683
933
  }
684
934
  patch(oldEndVnode, newStartVnode);
935
+ // We've already checked above if `oldStartVnode` and `newStartVnode` are
936
+ // the same node, so since we're here we know that they are not. Thus we
937
+ // can move the element for `oldEndVnode` _before_ the element for
938
+ // `oldStartVnode`, leaving `oldStartVnode` to be reconciled in the
939
+ // future.
685
940
  parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
686
941
  oldEndVnode = oldCh[--oldEndIdx];
687
942
  newStartVnode = newCh[++newStartIdx];
688
943
  }
689
944
  else {
690
- // createKeyToOldIdx
945
+ // Here we do some checks to match up old and new nodes based on the
946
+ // `$key$` attribute, which is set by putting a `key="my-key"` attribute
947
+ // in the JSX for a DOM element in the implementation of a Stencil
948
+ // component.
949
+ //
950
+ // First we check to see if there are any nodes in the array of old
951
+ // children which have the same key as the first node in the new
952
+ // children.
691
953
  idxInOld = -1;
692
954
  {
693
955
  for (i = oldStartIdx; i <= oldEndIdx; ++i) {
@@ -698,23 +960,32 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
698
960
  }
699
961
  }
700
962
  if (idxInOld >= 0) {
963
+ // We found a node in the old children which matches up with the first
964
+ // node in the new children! So let's deal with that
701
965
  elmToMove = oldCh[idxInOld];
702
966
  if (elmToMove.$tag$ !== newStartVnode.$tag$) {
967
+ // the tag doesn't match so we'll need a new DOM element
703
968
  node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld, parentElm);
704
969
  }
705
970
  else {
706
971
  patch(elmToMove, newStartVnode);
972
+ // invalidate the matching old node so that we won't try to update it
973
+ // again later on
707
974
  oldCh[idxInOld] = undefined;
708
975
  node = elmToMove.$elm$;
709
976
  }
710
977
  newStartVnode = newCh[++newStartIdx];
711
978
  }
712
979
  else {
713
- // new element
980
+ // We either didn't find an element in the old children that matches
981
+ // the key of the first new child OR the build is not using `key`
982
+ // attributes at all. In either case we need to create a new element
983
+ // for the new node.
714
984
  node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx, parentElm);
715
985
  newStartVnode = newCh[++newStartIdx];
716
986
  }
717
987
  if (node) {
988
+ // if we created a new node then handle inserting it to the DOM
718
989
  {
719
990
  parentReferenceNode(oldStartVnode.$elm$).insertBefore(node, referenceNode(oldStartVnode.$elm$));
720
991
  }
@@ -722,21 +993,44 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
722
993
  }
723
994
  }
724
995
  if (oldStartIdx > oldEndIdx) {
996
+ // we have some more new nodes to add which don't match up with old nodes
725
997
  addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
726
998
  }
727
999
  else if (newStartIdx > newEndIdx) {
1000
+ // there are nodes in the `oldCh` array which no longer correspond to nodes
1001
+ // in the new array, so lets remove them (which entails cleaning up the
1002
+ // relevant DOM nodes)
728
1003
  removeVnodes(oldCh, oldStartIdx, oldEndIdx);
729
1004
  }
730
1005
  };
731
- const isSameVnode = (vnode1, vnode2) => {
1006
+ /**
1007
+ * Compare two VNodes to determine if they are the same
1008
+ *
1009
+ * **NB**: This function is an equality _heuristic_ based on the available
1010
+ * information set on the two VNodes and can be misleading under certain
1011
+ * circumstances. In particular, if the two nodes do not have `key` attrs
1012
+ * (available under `$key$` on VNodes) then the function falls back on merely
1013
+ * checking that they have the same tag.
1014
+ *
1015
+ * So, in other words, if `key` attrs are not set on VNodes which may be
1016
+ * changing order within a `children` array or something along those lines then
1017
+ * we could obtain a false negative and then have to do needless re-rendering
1018
+ * (i.e. we'd say two VNodes aren't equal when in fact they should be).
1019
+ *
1020
+ * @param leftVNode the first VNode to check
1021
+ * @param rightVNode the second VNode to check
1022
+ * @returns whether they're equal or not
1023
+ */
1024
+ const isSameVnode = (leftVNode, rightVNode) => {
732
1025
  // compare if two vnode to see if they're "technically" the same
733
1026
  // need to have the same element tag, and same key to be the same
734
- if (vnode1.$tag$ === vnode2.$tag$) {
735
- if (vnode1.$tag$ === 'slot') {
736
- return vnode1.$name$ === vnode2.$name$;
1027
+ if (leftVNode.$tag$ === rightVNode.$tag$) {
1028
+ if (leftVNode.$tag$ === 'slot') {
1029
+ return leftVNode.$name$ === rightVNode.$name$;
737
1030
  }
1031
+ // this will be set if components in the build have `key` attrs set on them
738
1032
  {
739
- return vnode1.$key$ === vnode2.$key$;
1033
+ return leftVNode.$key$ === rightVNode.$key$;
740
1034
  }
741
1035
  }
742
1036
  return false;
@@ -749,6 +1043,14 @@ const referenceNode = (node) => {
749
1043
  return (node && node['s-ol']) || node;
750
1044
  };
751
1045
  const parentReferenceNode = (node) => (node['s-ol'] ? node['s-ol'] : node).parentNode;
1046
+ /**
1047
+ * Handle reconciling an outdated VNode with a new one which corresponds to
1048
+ * it. This function handles flushing updates to the DOM and reconciling the
1049
+ * children of the two nodes (if any).
1050
+ *
1051
+ * @param oldVNode an old VNode whose DOM element and children we want to update
1052
+ * @param newVNode a new VNode representing an updated version of the old one
1053
+ */
752
1054
  const patch = (oldVNode, newVNode) => {
753
1055
  const elm = (newVNode.$elm$ = oldVNode.$elm$);
754
1056
  const oldChildren = oldVNode.$children$;
@@ -762,7 +1064,6 @@ const patch = (oldVNode, newVNode) => {
762
1064
  // only add this to the when the compiler sees we're using an svg somewhere
763
1065
  isSvgMode = tag === 'svg' ? true : tag === 'foreignObject' ? false : isSvgMode;
764
1066
  }
765
- // element node
766
1067
  {
767
1068
  if (tag === 'slot')
768
1069
  ;
@@ -775,6 +1076,7 @@ const patch = (oldVNode, newVNode) => {
775
1076
  }
776
1077
  if (oldChildren !== null && newChildren !== null) {
777
1078
  // looks like there's child vnodes for both the old and new vnodes
1079
+ // so we need to call `updateChildren` to reconcile them
778
1080
  updateChildren(elm, oldChildren, newVNode, newChildren);
779
1081
  }
780
1082
  else if (newChildren !== null) {
@@ -806,7 +1108,7 @@ const patch = (oldVNode, newVNode) => {
806
1108
  };
807
1109
  const updateFallbackSlotVisibility = (elm) => {
808
1110
  // tslint:disable-next-line: prefer-const
809
- let childNodes = elm.childNodes;
1111
+ const childNodes = elm.childNodes;
810
1112
  let childNode;
811
1113
  let i;
812
1114
  let ilen;
@@ -815,7 +1117,7 @@ const updateFallbackSlotVisibility = (elm) => {
815
1117
  let nodeType;
816
1118
  for (i = 0, ilen = childNodes.length; i < ilen; i++) {
817
1119
  childNode = childNodes[i];
818
- if (childNode.nodeType === 1 /* ElementNode */) {
1120
+ if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
819
1121
  if (childNode['s-sr']) {
820
1122
  // this is a slot fallback node
821
1123
  // get the slot name for this slot reference node
@@ -827,7 +1129,7 @@ const updateFallbackSlotVisibility = (elm) => {
827
1129
  nodeType = childNodes[j].nodeType;
828
1130
  if (childNodes[j]['s-hn'] !== childNode['s-hn'] || slotNameAttr !== '') {
829
1131
  // this sibling node is from a different component OR is a named fallback slot node
830
- if (nodeType === 1 /* ElementNode */ && slotNameAttr === childNodes[j].getAttribute('slot')) {
1132
+ if (nodeType === 1 /* NODE_TYPE.ElementNode */ && slotNameAttr === childNodes[j].getAttribute('slot')) {
831
1133
  childNode.hidden = true;
832
1134
  break;
833
1135
  }
@@ -836,8 +1138,8 @@ const updateFallbackSlotVisibility = (elm) => {
836
1138
  // this is a default fallback slot node
837
1139
  // any element or text node (with content)
838
1140
  // should hide the default fallback slot node
839
- if (nodeType === 1 /* ElementNode */ ||
840
- (nodeType === 3 /* TextNode */ && childNodes[j].textContent.trim() !== '')) {
1141
+ if (nodeType === 1 /* NODE_TYPE.ElementNode */ ||
1142
+ (nodeType === 3 /* NODE_TYPE.TextNode */ && childNodes[j].textContent.trim() !== '')) {
841
1143
  childNode.hidden = true;
842
1144
  break;
843
1145
  }
@@ -859,8 +1161,8 @@ const relocateSlotContent = (elm) => {
859
1161
  let relocateNodeData;
860
1162
  let j;
861
1163
  let i = 0;
862
- let childNodes = elm.childNodes;
863
- let ilen = childNodes.length;
1164
+ const childNodes = elm.childNodes;
1165
+ const ilen = childNodes.length;
864
1166
  for (; i < ilen; i++) {
865
1167
  childNode = childNodes[i];
866
1168
  if (childNode['s-sr'] && (node = childNode['s-cr']) && node.parentNode) {
@@ -915,13 +1217,13 @@ const relocateSlotContent = (elm) => {
915
1217
  }
916
1218
  }
917
1219
  }
918
- if (childNode.nodeType === 1 /* ElementNode */) {
1220
+ if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
919
1221
  relocateSlotContent(childNode);
920
1222
  }
921
1223
  }
922
1224
  };
923
1225
  const isNodeLocatedInSlot = (nodeToRelocate, slotNameAttr) => {
924
- if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
1226
+ if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
925
1227
  if (nodeToRelocate.getAttribute('slot') === null && slotNameAttr === '') {
926
1228
  return true;
927
1229
  }
@@ -935,12 +1237,31 @@ const isNodeLocatedInSlot = (nodeToRelocate, slotNameAttr) => {
935
1237
  }
936
1238
  return slotNameAttr === '';
937
1239
  };
938
- const callNodeRefs = (vNode) => {
1240
+ /**
1241
+ * 'Nullify' any VDom `ref` callbacks on a VDom node or its children by
1242
+ * calling them with `null`. This signals that the DOM element corresponding to
1243
+ * the VDom node has been removed from the DOM.
1244
+ *
1245
+ * @param vNode a virtual DOM node
1246
+ */
1247
+ const nullifyVNodeRefs = (vNode) => {
939
1248
  {
940
1249
  vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
941
- vNode.$children$ && vNode.$children$.map(callNodeRefs);
1250
+ vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
942
1251
  }
943
1252
  };
1253
+ /**
1254
+ * The main entry point for Stencil's virtual DOM-based rendering engine
1255
+ *
1256
+ * Given a {@link d.HostRef} container and some virtual DOM nodes, this
1257
+ * function will handle creating a virtual DOM tree with a single root, patching
1258
+ * the current virtual DOM tree onto an old one (if any), dealing with slot
1259
+ * relocation, and reflecting attributes.
1260
+ *
1261
+ * @param hostRef data needed to root and render the virtual DOM tree, such as
1262
+ * the DOM node into which it should be rendered.
1263
+ * @param renderFnResults the virtual DOM nodes to be rendered
1264
+ */
944
1265
  const renderVdom = (hostRef, renderFnResults) => {
945
1266
  const hostElm = hostRef.$hostElement$;
946
1267
  const cmpMeta = hostRef.$cmpMeta$;
@@ -952,7 +1273,7 @@ const renderVdom = (hostRef, renderFnResults) => {
952
1273
  cmpMeta.$attrsToReflect$.map(([propName, attribute]) => (rootVnode.$attrs$[attribute] = hostElm[propName]));
953
1274
  }
954
1275
  rootVnode.$tag$ = null;
955
- rootVnode.$flags$ |= 4 /* isHost */;
1276
+ rootVnode.$flags$ |= 4 /* VNODE_FLAGS.isHost */;
956
1277
  hostRef.$vnode$ = rootVnode;
957
1278
  rootVnode.$elm$ = oldVNode.$elm$ = (hostElm.shadowRoot || hostElm );
958
1279
  {
@@ -960,7 +1281,7 @@ const renderVdom = (hostRef, renderFnResults) => {
960
1281
  }
961
1282
  {
962
1283
  contentRef = hostElm['s-cr'];
963
- useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
1284
+ useNativeShadowDom = (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) !== 0;
964
1285
  // always reset
965
1286
  checkSlotFallbackVisibility = false;
966
1287
  }
@@ -969,7 +1290,7 @@ const renderVdom = (hostRef, renderFnResults) => {
969
1290
  {
970
1291
  // while we're moving nodes around existing nodes, temporarily disable
971
1292
  // the disconnectCallback from working
972
- plt.$flags$ |= 1 /* isTmpDisconnected */;
1293
+ plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
973
1294
  if (checkSlotRelocate) {
974
1295
  relocateSlotContent(rootVnode.$elm$);
975
1296
  let relocateData;
@@ -1027,7 +1348,7 @@ const renderVdom = (hostRef, renderFnResults) => {
1027
1348
  }
1028
1349
  else {
1029
1350
  // this node doesn't have a slot home to go to, so let's hide it
1030
- if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
1351
+ if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
1031
1352
  nodeToRelocate.hidden = true;
1032
1353
  }
1033
1354
  }
@@ -1038,37 +1359,11 @@ const renderVdom = (hostRef, renderFnResults) => {
1038
1359
  }
1039
1360
  // done moving nodes around
1040
1361
  // allow the disconnect callback to work again
1041
- plt.$flags$ &= ~1 /* isTmpDisconnected */;
1362
+ plt.$flags$ &= ~1 /* PLATFORM_FLAGS.isTmpDisconnected */;
1042
1363
  // always reset
1043
1364
  relocateNodes.length = 0;
1044
1365
  }
1045
1366
  };
1046
- const getElement = (ref) => (getHostRef(ref).$hostElement$ );
1047
- const createEvent = (ref, name, flags) => {
1048
- const elm = getElement(ref);
1049
- return {
1050
- emit: (detail) => {
1051
- return emitEvent(elm, name, {
1052
- bubbles: !!(flags & 4 /* Bubbles */),
1053
- composed: !!(flags & 2 /* Composed */),
1054
- cancelable: !!(flags & 1 /* Cancellable */),
1055
- detail,
1056
- });
1057
- },
1058
- };
1059
- };
1060
- /**
1061
- * Helper function to create & dispatch a custom Event on a provided target
1062
- * @param elm the target of the Event
1063
- * @param name the name to give the custom Event
1064
- * @param opts options for configuring a custom Event
1065
- * @returns the custom Event
1066
- */
1067
- const emitEvent = (elm, name, opts) => {
1068
- const ev = plt.ce(name, opts);
1069
- elm.dispatchEvent(ev);
1070
- return ev;
1071
- };
1072
1367
  const attachToAncestor = (hostRef, ancestorComponent) => {
1073
1368
  if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
1074
1369
  ancestorComponent['s-p'].push(new Promise((r) => (hostRef.$onRenderResolve$ = r)));
@@ -1076,10 +1371,10 @@ const attachToAncestor = (hostRef, ancestorComponent) => {
1076
1371
  };
1077
1372
  const scheduleUpdate = (hostRef, isInitialLoad) => {
1078
1373
  {
1079
- hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
1374
+ hostRef.$flags$ |= 16 /* HOST_FLAGS.isQueuedForUpdate */;
1080
1375
  }
1081
- if (hostRef.$flags$ & 4 /* isWaitingForChildren */) {
1082
- hostRef.$flags$ |= 512 /* needsRerender */;
1376
+ if (hostRef.$flags$ & 4 /* HOST_FLAGS.isWaitingForChildren */) {
1377
+ hostRef.$flags$ |= 512 /* HOST_FLAGS.needsRerender */;
1083
1378
  return;
1084
1379
  }
1085
1380
  attachToAncestor(hostRef, hostRef.$ancestorComponent$);
@@ -1089,35 +1384,83 @@ const scheduleUpdate = (hostRef, isInitialLoad) => {
1089
1384
  const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
1090
1385
  return writeTask(dispatch) ;
1091
1386
  };
1387
+ /**
1388
+ * Dispatch initial-render and update lifecycle hooks, enqueuing calls to
1389
+ * component lifecycle methods like `componentWillLoad` as well as
1390
+ * {@link updateComponent}, which will kick off the virtual DOM re-render.
1391
+ *
1392
+ * @param hostRef a reference to a host DOM node
1393
+ * @param isInitialLoad whether we're on the initial load or not
1394
+ * @returns an empty Promise which is used to enqueue a series of operations for
1395
+ * the component
1396
+ */
1092
1397
  const dispatchHooks = (hostRef, isInitialLoad) => {
1093
1398
  const endSchedule = createTime('scheduleUpdate', hostRef.$cmpMeta$.$tagName$);
1094
1399
  const instance = hostRef.$lazyInstance$ ;
1095
- let promise;
1400
+ // We're going to use this variable together with `enqueue` to implement a
1401
+ // little promise-based queue. We start out with it `undefined`. When we add
1402
+ // the first function to the queue we'll set this variable to be that
1403
+ // function's return value. When we attempt to add subsequent values to the
1404
+ // queue we'll check that value and, if it was a `Promise`, we'll then chain
1405
+ // the new function off of that `Promise` using `.then()`. This will give our
1406
+ // queue two nice properties:
1407
+ //
1408
+ // 1. If all functions added to the queue are synchronous they'll be called
1409
+ // synchronously right away.
1410
+ // 2. If all functions added to the queue are asynchronous they'll all be
1411
+ // called in order after `dispatchHooks` exits.
1412
+ let maybePromise;
1096
1413
  if (isInitialLoad) {
1097
1414
  {
1098
- hostRef.$flags$ |= 256 /* isListenReady */;
1415
+ hostRef.$flags$ |= 256 /* HOST_FLAGS.isListenReady */;
1099
1416
  if (hostRef.$queuedListeners$) {
1100
1417
  hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
1101
1418
  hostRef.$queuedListeners$ = null;
1102
1419
  }
1103
1420
  }
1104
1421
  {
1105
- promise = safeCall(instance, 'componentWillLoad');
1422
+ // If `componentWillLoad` returns a `Promise` then we want to wait on
1423
+ // whatever's going on in that `Promise` before we launch into
1424
+ // rendering the component, doing other lifecycle stuff, etc. So
1425
+ // in that case we assign the returned promise to the variable we
1426
+ // declared above to hold a possible 'queueing' Promise
1427
+ maybePromise = safeCall(instance, 'componentWillLoad');
1106
1428
  }
1107
1429
  }
1108
1430
  else {
1109
1431
  {
1110
- promise = safeCall(instance, 'componentWillUpdate');
1432
+ // Like `componentWillLoad` above, we allow Stencil component
1433
+ // authors to return a `Promise` from this lifecycle callback, and
1434
+ // we specify that our runtime will wait for that `Promise` to
1435
+ // resolve before the component re-renders. So if the method
1436
+ // returns a `Promise` we need to keep it around!
1437
+ maybePromise = safeCall(instance, 'componentWillUpdate');
1111
1438
  }
1112
1439
  }
1113
1440
  {
1114
- promise = then(promise, () => safeCall(instance, 'componentWillRender'));
1441
+ maybePromise = enqueue(maybePromise, () => safeCall(instance, 'componentWillRender'));
1115
1442
  }
1116
1443
  endSchedule();
1117
- return then(promise, () => updateComponent(hostRef, instance, isInitialLoad));
1444
+ return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
1118
1445
  };
1446
+ /**
1447
+ * This function uses a Promise to implement a simple first-in, first-out queue
1448
+ * of functions to be called.
1449
+ *
1450
+ * The queue is ordered on the basis of the first argument. If it's
1451
+ * `undefined`, then nothing is on the queue yet, so the provided function can
1452
+ * be called synchronously (although note that this function may return a
1453
+ * `Promise`). The idea is that then the return value of that enqueueing
1454
+ * operation is kept around, so that if it was a `Promise` then subsequent
1455
+ * functions can be enqueued by calling this function again with that `Promise`
1456
+ * as the first argument.
1457
+ *
1458
+ * @param maybePromise either a `Promise` which should resolve before the next function is called or an 'empty' sentinel
1459
+ * @param fn a function to enqueue
1460
+ * @returns either a `Promise` or the return value of the provided function
1461
+ */
1462
+ const enqueue = (maybePromise, fn) => maybePromise instanceof Promise ? maybePromise.then(fn) : fn();
1119
1463
  const updateComponent = async (hostRef, instance, isInitialLoad) => {
1120
- // updateComponent
1121
1464
  const elm = hostRef.$hostElement$;
1122
1465
  const endUpdate = createTime('update', hostRef.$cmpMeta$.$tagName$);
1123
1466
  const rc = elm['s-rc'];
@@ -1146,7 +1489,7 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
1146
1489
  }
1147
1490
  else {
1148
1491
  Promise.all(childrenPromises).then(postUpdate);
1149
- hostRef.$flags$ |= 4 /* isWaitingForChildren */;
1492
+ hostRef.$flags$ |= 4 /* HOST_FLAGS.isWaitingForChildren */;
1150
1493
  childrenPromises.length = 0;
1151
1494
  }
1152
1495
  }
@@ -1155,10 +1498,10 @@ const callRender = (hostRef, instance, elm) => {
1155
1498
  try {
1156
1499
  instance = instance.render() ;
1157
1500
  {
1158
- hostRef.$flags$ &= ~16 /* isQueuedForUpdate */;
1501
+ hostRef.$flags$ &= ~16 /* HOST_FLAGS.isQueuedForUpdate */;
1159
1502
  }
1160
1503
  {
1161
- hostRef.$flags$ |= 2 /* hasRendered */;
1504
+ hostRef.$flags$ |= 2 /* HOST_FLAGS.hasRendered */;
1162
1505
  }
1163
1506
  {
1164
1507
  {
@@ -1185,8 +1528,8 @@ const postUpdateComponent = (hostRef) => {
1185
1528
  {
1186
1529
  safeCall(instance, 'componentDidRender');
1187
1530
  }
1188
- if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
1189
- hostRef.$flags$ |= 64 /* hasLoadedComponent */;
1531
+ if (!(hostRef.$flags$ & 64 /* HOST_FLAGS.hasLoadedComponent */)) {
1532
+ hostRef.$flags$ |= 64 /* HOST_FLAGS.hasLoadedComponent */;
1190
1533
  {
1191
1534
  // DOM WRITE!
1192
1535
  addHydratedFlag(elm);
@@ -1212,10 +1555,10 @@ const postUpdateComponent = (hostRef) => {
1212
1555
  hostRef.$onRenderResolve$();
1213
1556
  hostRef.$onRenderResolve$ = undefined;
1214
1557
  }
1215
- if (hostRef.$flags$ & 512 /* needsRerender */) {
1558
+ if (hostRef.$flags$ & 512 /* HOST_FLAGS.needsRerender */) {
1216
1559
  nextTick(() => scheduleUpdate(hostRef, false));
1217
1560
  }
1218
- hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */);
1561
+ hostRef.$flags$ &= ~(4 /* HOST_FLAGS.isWaitingForChildren */ | 512 /* HOST_FLAGS.needsRerender */);
1219
1562
  }
1220
1563
  // ( •_•)
1221
1564
  // ( •_•)>⌐■-■
@@ -1228,7 +1571,7 @@ const appDidLoad = (who) => {
1228
1571
  addHydratedFlag(doc.documentElement);
1229
1572
  }
1230
1573
  {
1231
- plt.$flags$ |= 2 /* appLoaded */;
1574
+ plt.$flags$ |= 2 /* PLATFORM_FLAGS.appLoaded */;
1232
1575
  }
1233
1576
  nextTick(() => emitEvent(win, 'appload', { detail: { namespace: NAMESPACE } }));
1234
1577
  };
@@ -1243,35 +1586,8 @@ const safeCall = (instance, method, arg) => {
1243
1586
  }
1244
1587
  return undefined;
1245
1588
  };
1246
- const then = (promise, thenFn) => {
1247
- return promise && promise.then ? promise.then(thenFn) : thenFn();
1248
- };
1249
1589
  const addHydratedFlag = (elm) => elm.classList.add('hydrated')
1250
1590
  ;
1251
- const parsePropertyValue = (propValue, propType) => {
1252
- // ensure this value is of the correct prop type
1253
- if (propValue != null && !isComplexType(propValue)) {
1254
- if (propType & 4 /* Boolean */) {
1255
- // per the HTML spec, any string value means it is a boolean true value
1256
- // but we'll cheat here and say that the string "false" is the boolean false
1257
- return propValue === 'false' ? false : propValue === '' || !!propValue;
1258
- }
1259
- if (propType & 2 /* Number */) {
1260
- // force it to be a number
1261
- return parseFloat(propValue);
1262
- }
1263
- if (propType & 1 /* String */) {
1264
- // could have been passed as a number or boolean
1265
- // but we still want it as a string
1266
- return String(propValue);
1267
- }
1268
- // redundant return here for better minification
1269
- return propValue;
1270
- }
1271
- // not sure exactly what type we want
1272
- // so no need to change to a different type
1273
- return propValue;
1274
- };
1275
1591
  const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
1276
1592
  const setValue = (ref, propName, newVal, cmpMeta) => {
1277
1593
  // check our new property value against our internal value
@@ -1281,13 +1597,16 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
1281
1597
  const flags = hostRef.$flags$;
1282
1598
  const instance = hostRef.$lazyInstance$ ;
1283
1599
  newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
1284
- if ((!(flags & 8 /* isConstructingInstance */) || oldVal === undefined) && newVal !== oldVal) {
1600
+ // explicitly check for NaN on both sides, as `NaN === NaN` is always false
1601
+ const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
1602
+ const didValueChange = newVal !== oldVal && !areBothNaN;
1603
+ if ((!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) || oldVal === undefined) && didValueChange) {
1285
1604
  // gadzooks! the property's value has changed!!
1286
1605
  // set our new value!
1287
1606
  hostRef.$instanceValues$.set(propName, newVal);
1288
1607
  if (instance) {
1289
1608
  // get an array of method names of watch functions to call
1290
- if (cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
1609
+ if (cmpMeta.$watchers$ && flags & 128 /* HOST_FLAGS.isWatchReady */) {
1291
1610
  const watchMethods = cmpMeta.$watchers$[propName];
1292
1611
  if (watchMethods) {
1293
1612
  // this instance is watching for when this property changed
@@ -1302,7 +1621,7 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
1302
1621
  });
1303
1622
  }
1304
1623
  }
1305
- if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
1624
+ if ((flags & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
1306
1625
  // looks like this value actually changed, so we've got work to do!
1307
1626
  // but only if we've already rendered, otherwise just chill out
1308
1627
  // queue that we need to do an update, but don't worry about queuing
@@ -1312,6 +1631,16 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
1312
1631
  }
1313
1632
  }
1314
1633
  };
1634
+ /**
1635
+ * Attach a series of runtime constructs to a compiled Stencil component
1636
+ * constructor, including getters and setters for the `@Prop` and `@State`
1637
+ * decorators, callbacks for when attributes change, and so on.
1638
+ *
1639
+ * @param Cstr the constructor for a component that we need to process
1640
+ * @param cmpMeta metadata collected previously about the component
1641
+ * @param flags a number used to store a series of bit flags
1642
+ * @returns a reference to the same constructor passed in (but now mutated)
1643
+ */
1315
1644
  const proxyComponent = (Cstr, cmpMeta, flags) => {
1316
1645
  if (cmpMeta.$members$) {
1317
1646
  if (Cstr.watchers) {
@@ -1321,8 +1650,8 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1321
1650
  const members = Object.entries(cmpMeta.$members$);
1322
1651
  const prototype = Cstr.prototype;
1323
1652
  members.map(([memberName, [memberFlags]]) => {
1324
- if ((memberFlags & 31 /* Prop */ ||
1325
- ((flags & 2 /* proxyState */) && memberFlags & 32 /* State */))) {
1653
+ if ((memberFlags & 31 /* MEMBER_FLAGS.Prop */ ||
1654
+ ((flags & 2 /* PROXY_FLAGS.proxyState */) && memberFlags & 32 /* MEMBER_FLAGS.State */))) {
1326
1655
  // proxyComponent - prop
1327
1656
  Object.defineProperty(prototype, memberName, {
1328
1657
  get() {
@@ -1338,7 +1667,7 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1338
1667
  });
1339
1668
  }
1340
1669
  });
1341
- if ((flags & 1 /* isElementConstructor */)) {
1670
+ if ((flags & 1 /* PROXY_FLAGS.isElementConstructor */)) {
1342
1671
  const attrNameToPropName = new Map();
1343
1672
  prototype.attributeChangedCallback = function (attrName, _oldValue, newValue) {
1344
1673
  plt.jmp(() => {
@@ -1394,11 +1723,11 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1394
1723
  // create an array of attributes to observe
1395
1724
  // and also create a map of html attribute name to js property name
1396
1725
  Cstr.observedAttributes = members
1397
- .filter(([_, m]) => m[0] & 15 /* HasAttribute */) // filter to only keep props that should match attributes
1726
+ .filter(([_, m]) => m[0] & 15 /* MEMBER_FLAGS.HasAttribute */) // filter to only keep props that should match attributes
1398
1727
  .map(([propName, m]) => {
1399
1728
  const attrName = m[1] || propName;
1400
1729
  attrNameToPropName.set(attrName, propName);
1401
- if (m[0] & 512 /* ReflectAttr */) {
1730
+ if (m[0] & 512 /* MEMBER_FLAGS.ReflectAttr */) {
1402
1731
  cmpMeta.$attrsToReflect$.push([propName, attrName]);
1403
1732
  }
1404
1733
  return attrName;
@@ -1409,10 +1738,10 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1409
1738
  };
1410
1739
  const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
1411
1740
  // initializeComponent
1412
- if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
1741
+ if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
1742
+ // Let the runtime know that the component has been initialized
1743
+ hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
1413
1744
  {
1414
- // we haven't initialized this element yet
1415
- hostRef.$flags$ |= 32 /* hasInitializedComponent */;
1416
1745
  // lazy loaded components
1417
1746
  // request the component's implementation to be
1418
1747
  // wired up with the host element
@@ -1430,7 +1759,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
1430
1759
  {
1431
1760
  cmpMeta.$watchers$ = Cstr.watchers;
1432
1761
  }
1433
- proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
1762
+ proxyComponent(Cstr, cmpMeta, 2 /* PROXY_FLAGS.proxyState */);
1434
1763
  Cstr.isProxied = true;
1435
1764
  }
1436
1765
  const endNewInstance = createTime('createInstance', cmpMeta.$tagName$);
@@ -1438,7 +1767,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
1438
1767
  // but let's keep track of when we start and stop
1439
1768
  // so that the getters/setters don't incorrectly step on data
1440
1769
  {
1441
- hostRef.$flags$ |= 8 /* isConstructingInstance */;
1770
+ hostRef.$flags$ |= 8 /* HOST_FLAGS.isConstructingInstance */;
1442
1771
  }
1443
1772
  // construct the lazy-loaded component implementation
1444
1773
  // passing the hostRef is very important during
@@ -1451,10 +1780,10 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
1451
1780
  consoleError(e);
1452
1781
  }
1453
1782
  {
1454
- hostRef.$flags$ &= ~8 /* isConstructingInstance */;
1783
+ hostRef.$flags$ &= ~8 /* HOST_FLAGS.isConstructingInstance */;
1455
1784
  }
1456
1785
  {
1457
- hostRef.$flags$ |= 128 /* isWatchReady */;
1786
+ hostRef.$flags$ |= 128 /* HOST_FLAGS.isWatchReady */;
1458
1787
  }
1459
1788
  endNewInstance();
1460
1789
  }
@@ -1467,7 +1796,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
1467
1796
  const scopeId = getScopeId(cmpMeta, hostRef.$modeName$);
1468
1797
  if (!styles.has(scopeId)) {
1469
1798
  const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
1470
- registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
1799
+ registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */));
1471
1800
  endRegisterStyles();
1472
1801
  }
1473
1802
  }
@@ -1489,19 +1818,20 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
1489
1818
  }
1490
1819
  };
1491
1820
  const connectedCallback = (elm) => {
1492
- if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
1821
+ if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
1493
1822
  const hostRef = getHostRef(elm);
1494
1823
  const cmpMeta = hostRef.$cmpMeta$;
1495
1824
  const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
1496
- if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
1825
+ if (!(hostRef.$flags$ & 1 /* HOST_FLAGS.hasConnected */)) {
1497
1826
  // first time this component has connected
1498
- hostRef.$flags$ |= 1 /* hasConnected */;
1827
+ hostRef.$flags$ |= 1 /* HOST_FLAGS.hasConnected */;
1499
1828
  {
1500
1829
  // initUpdate
1501
1830
  // if the slot polyfill is required we'll need to put some nodes
1502
1831
  // in here to act as original content anchors as we move nodes around
1503
1832
  // host element has been connected to the DOM
1504
- if ((cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */))) {
1833
+ if ((// TODO(STENCIL-662): Remove code related to deprecated shadowDomShim field
1834
+ cmpMeta.$flags$ & (4 /* CMP_FLAGS.hasSlotRelocation */ | 8 /* CMP_FLAGS.needsShadowDomShim */))) {
1505
1835
  setContentReference(elm);
1506
1836
  }
1507
1837
  }
@@ -1524,7 +1854,7 @@ const connectedCallback = (elm) => {
1524
1854
  // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
1525
1855
  if (cmpMeta.$members$) {
1526
1856
  Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
1527
- if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
1857
+ if (memberFlags & 31 /* MEMBER_FLAGS.Prop */ && elm.hasOwnProperty(memberName)) {
1528
1858
  const value = elm[memberName];
1529
1859
  delete elm[memberName];
1530
1860
  elm[memberName] = value;
@@ -1556,7 +1886,7 @@ const setContentReference = (elm) => {
1556
1886
  elm.insertBefore(contentRefElm, elm.firstChild);
1557
1887
  };
1558
1888
  const disconnectedCallback = (elm) => {
1559
- if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
1889
+ if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
1560
1890
  const hostRef = getHostRef(elm);
1561
1891
  const instance = hostRef.$lazyInstance$ ;
1562
1892
  {
@@ -1571,6 +1901,7 @@ const disconnectedCallback = (elm) => {
1571
1901
  }
1572
1902
  };
1573
1903
  const bootstrapLazy = (lazyBundles, options = {}) => {
1904
+ var _a;
1574
1905
  const endBootstrap = createTime();
1575
1906
  const cmpTags = [];
1576
1907
  const exclude = options.exclude || [];
@@ -1585,7 +1916,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1585
1916
  plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
1586
1917
  {
1587
1918
  if (options.syncQueue) {
1588
- plt.$flags$ |= 4 /* queueSync */;
1919
+ plt.$flags$ |= 4 /* PLATFORM_FLAGS.queueSync */;
1589
1920
  }
1590
1921
  }
1591
1922
  lazyBundles.map((lazyBundle) => {
@@ -1616,7 +1947,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1616
1947
  super(self);
1617
1948
  self = this;
1618
1949
  registerHost(self, cmpMeta);
1619
- if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
1950
+ if (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
1620
1951
  // this component is using shadow dom
1621
1952
  // and this browser supports shadow dom
1622
1953
  // add the read-only property "shadowRoot" to the host element
@@ -1651,13 +1982,18 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1651
1982
  cmpMeta.$lazyBundleId$ = lazyBundle[0];
1652
1983
  if (!exclude.includes(tagName) && !customElements.get(tagName)) {
1653
1984
  cmpTags.push(tagName);
1654
- customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */));
1985
+ customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* PROXY_FLAGS.isElementConstructor */));
1655
1986
  }
1656
1987
  });
1657
1988
  });
1658
1989
  {
1659
1990
  visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;
1660
1991
  visibilityStyle.setAttribute('data-styles', '');
1992
+ // Apply CSP nonce to the style tag if it exists
1993
+ const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
1994
+ if (nonce != null) {
1995
+ visibilityStyle.setAttribute('nonce', nonce);
1996
+ }
1661
1997
  head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild);
1662
1998
  }
1663
1999
  // Process deferred connectedCallbacks now all components have been registered
@@ -1674,7 +2010,50 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1674
2010
  endBootstrap();
1675
2011
  };
1676
2012
  const Fragment = (_, children) => children;
1677
- const hostRefs = new WeakMap();
2013
+ const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
2014
+ if (listeners) {
2015
+ listeners.map(([flags, name, method]) => {
2016
+ const target = getHostListenerTarget(elm, flags) ;
2017
+ const handler = hostListenerProxy(hostRef, method);
2018
+ const opts = hostListenerOpts(flags);
2019
+ plt.ael(target, name, handler, opts);
2020
+ (hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
2021
+ });
2022
+ }
2023
+ };
2024
+ const hostListenerProxy = (hostRef, methodName) => (ev) => {
2025
+ try {
2026
+ {
2027
+ if (hostRef.$flags$ & 256 /* HOST_FLAGS.isListenReady */) {
2028
+ // instance is ready, let's call it's member method for this event
2029
+ hostRef.$lazyInstance$[methodName](ev);
2030
+ }
2031
+ else {
2032
+ (hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
2033
+ }
2034
+ }
2035
+ }
2036
+ catch (e) {
2037
+ consoleError(e);
2038
+ }
2039
+ };
2040
+ const getHostListenerTarget = (elm, flags) => {
2041
+ if (flags & 4 /* LISTENER_FLAGS.TargetDocument */)
2042
+ return doc;
2043
+ if (flags & 8 /* LISTENER_FLAGS.TargetWindow */)
2044
+ return win;
2045
+ return elm;
2046
+ };
2047
+ // prettier-ignore
2048
+ const hostListenerOpts = (flags) => (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0;
2049
+ /**
2050
+ * Assigns the given value to the nonce property on the runtime platform object.
2051
+ * During runtime, this value is used to set the nonce attribute on all dynamically created script and style tags.
2052
+ * @param nonce The value to be assigned to the platform nonce property.
2053
+ * @returns void
2054
+ */
2055
+ const setNonce = (nonce) => (plt.$nonce$ = nonce);
2056
+ const hostRefs = /*@__PURE__*/ new WeakMap();
1678
2057
  const getHostRef = (ref) => hostRefs.get(ref);
1679
2058
  const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
1680
2059
  const registerHost = (elm, cmpMeta) => {
@@ -1703,7 +2082,9 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
1703
2082
  if (module) {
1704
2083
  return module[exportName];
1705
2084
  }
2085
+ /*!__STENCIL_STATIC_IMPORT_SWITCH__*/
1706
2086
  return import(
2087
+ /* @vite-ignore */
1707
2088
  /* webpackInclude: /\.entry\.js$/ */
1708
2089
  /* webpackExclude: /\.system\.entry\.js$/ */
1709
2090
  /* webpackMode: "lazy" */
@@ -1714,8 +2095,29 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
1714
2095
  return importedModule[exportName];
1715
2096
  }, consoleError);
1716
2097
  };
1717
- const styles = new Map();
2098
+ const styles = /*@__PURE__*/ new Map();
1718
2099
  const modeResolutionChain = [];
2100
+ const win = typeof window !== 'undefined' ? window : {};
2101
+ const doc = win.document || { head: {} };
2102
+ const plt = {
2103
+ $flags$: 0,
2104
+ $resourcesUrl$: '',
2105
+ jmp: (h) => h(),
2106
+ raf: (h) => requestAnimationFrame(h),
2107
+ ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
2108
+ rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
2109
+ ce: (eventName, opts) => new CustomEvent(eventName, opts),
2110
+ };
2111
+ const promiseResolve = (v) => Promise.resolve(v);
2112
+ const supportsConstructableStylesheets = /*@__PURE__*/ (() => {
2113
+ try {
2114
+ new CSSStyleSheet();
2115
+ return typeof new CSSStyleSheet().replaceSync === 'function';
2116
+ }
2117
+ catch (e) { }
2118
+ return false;
2119
+ })()
2120
+ ;
1719
2121
  const queueDomReads = [];
1720
2122
  const queueDomWrites = [];
1721
2123
  const queueDomWritesLow = [];
@@ -1723,7 +2125,7 @@ const queueTask = (queue, write) => (cb) => {
1723
2125
  queue.push(cb);
1724
2126
  if (!queuePending) {
1725
2127
  queuePending = true;
1726
- if (write && plt.$flags$ & 4 /* queueSync */) {
2128
+ if (write && plt.$flags$ & 4 /* PLATFORM_FLAGS.queueSync */) {
1727
2129
  nextTick(flush);
1728
2130
  }
1729
2131
  else {
@@ -1770,7 +2172,7 @@ const flush = () => {
1770
2172
  consume(queueDomReads);
1771
2173
  // DOM WRITES!!!
1772
2174
  {
1773
- const timeout = (plt.$flags$ & 6 /* queueMask */) === 2 /* appLoaded */
2175
+ const timeout = (plt.$flags$ & 6 /* PLATFORM_FLAGS.queueMask */) === 2 /* PLATFORM_FLAGS.appLoaded */
1774
2176
  ? performance.now() + 14 * Math.ceil(queueCongestion * (1.0 / 10.0))
1775
2177
  : Infinity;
1776
2178
  consumeTimeout(queueDomWrites, timeout);
@@ -1792,4 +2194,6 @@ const flush = () => {
1792
2194
  const nextTick = /*@__PURE__*/ (cb) => promiseResolve().then(cb);
1793
2195
  const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
1794
2196
 
1795
- export { Fragment as F, Host as H, bootstrapLazy as b, createEvent as c, getElement as g, h, promiseResolve as p, registerInstance as r, setMode as s };
2197
+ export { Fragment as F, Host as H, setMode as a, bootstrapLazy as b, createEvent as c, getElement as g, h, promiseResolve as p, registerInstance as r, setNonce as s };
2198
+
2199
+ //# sourceMappingURL=index-3a66d87e.js.map