@swisspost/internet-header 1.5.0-beta.0

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