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