@swisspost/design-system-components 10.0.0-next.47 → 10.0.0-next.49

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 (317) hide show
  1. package/dist/cjs/{event-from-AKK8RQrn.js → event-from-C6kpQwhw.js} +2 -2
  2. package/dist/cjs/index-CpDyH7Ww.js +4 -4
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/{package-wsZ6ig4j.js → package-CR0YynRY.js} +1 -1
  5. package/dist/cjs/post-accordion_2.cjs.entry.js +6 -6
  6. package/dist/cjs/post-avatar.cjs.entry.js +107 -80
  7. package/dist/cjs/post-back-to-top.cjs.entry.js +2 -2
  8. package/dist/cjs/post-banner.cjs.entry.js +3 -3
  9. package/dist/cjs/post-breadcrumb-item_2.cjs.entry.js +3 -3
  10. package/dist/cjs/post-breadcrumbs.cjs.entry.js +4 -4
  11. package/dist/cjs/post-card-control.cjs.entry.js +4 -4
  12. package/dist/cjs/post-closebutton_15.cjs.entry.js +133 -74
  13. package/dist/cjs/post-collapsible_2.cjs.entry.js +4 -4
  14. package/dist/cjs/post-components.cjs.js +1 -1
  15. package/dist/cjs/post-footer.cjs.entry.js +3 -3
  16. package/dist/cjs/post-linkarea.cjs.entry.js +19 -8
  17. package/dist/cjs/post-popover.cjs.entry.js +3 -3
  18. package/dist/cjs/post-rating.cjs.entry.js +3 -3
  19. package/dist/cjs/post-tab-header.cjs.entry.js +3 -3
  20. package/dist/cjs/post-tab-panel.cjs.entry.js +2 -2
  21. package/dist/cjs/post-tabs.cjs.entry.js +2 -2
  22. package/dist/cjs/post-tooltip-trigger.cjs.entry.js +2 -2
  23. package/dist/cjs/post-tooltip.cjs.entry.js +3 -3
  24. package/dist/collection/animations/pop-in.js +14 -0
  25. package/dist/collection/components/post-accordion/post-accordion.css +1 -1
  26. package/dist/collection/components/post-accordion-item/post-accordion-item.css +1 -1
  27. package/dist/collection/components/post-accordion-item/post-accordion-item.js +5 -5
  28. package/dist/collection/components/post-avatar/avatar-utils.js +16 -0
  29. package/dist/collection/components/post-avatar/post-avatar.css +1 -1
  30. package/dist/collection/components/post-avatar/post-avatar.js +119 -82
  31. package/dist/collection/components/post-back-to-top/post-back-to-top.js +1 -1
  32. package/dist/collection/components/post-banner/post-banner.js +2 -2
  33. package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.js +1 -1
  34. package/dist/collection/components/post-breadcrumbs/post-breadcrumbs.css +1 -1
  35. package/dist/collection/components/post-breadcrumbs/post-breadcrumbs.js +2 -2
  36. package/dist/collection/components/post-card-control/post-card-control.css +1 -1
  37. package/dist/collection/components/post-card-control/post-card-control.js +2 -2
  38. package/dist/collection/components/post-closebutton/post-closebutton.js +1 -19
  39. package/dist/collection/components/post-collapsible/post-collapsible.js +1 -1
  40. package/dist/collection/components/post-collapsible-trigger/post-collapsible-trigger.js +1 -1
  41. package/dist/collection/components/post-footer/post-footer.css +1 -1
  42. package/dist/collection/components/post-footer/post-footer.js +1 -1
  43. package/dist/collection/components/post-header/post-header.css +1 -1
  44. package/dist/collection/components/post-header/post-header.js +11 -2
  45. package/dist/collection/components/post-icon/post-icon.js +39 -33
  46. package/dist/collection/components/post-language-option/post-language-option.css +1 -1
  47. package/dist/collection/components/post-language-option/post-language-option.js +1 -2
  48. package/dist/collection/components/post-language-switch/post-language-switch.js +1 -2
  49. package/dist/collection/components/post-linkarea/post-linkarea.css +1 -1
  50. package/dist/collection/components/post-linkarea/post-linkarea.js +24 -6
  51. package/dist/collection/components/post-list/post-list.css +1 -1
  52. package/dist/collection/components/post-list/post-list.js +1 -1
  53. package/dist/collection/components/post-list-item/post-list-item.js +1 -1
  54. package/dist/collection/components/post-logo/post-logo.js +1 -1
  55. package/dist/collection/components/post-mainnavigation/post-mainnavigation.css +1 -1
  56. package/dist/collection/components/post-mainnavigation/post-mainnavigation.js +1 -1
  57. package/dist/collection/components/post-megadropdown/post-megadropdown.css +1 -1
  58. package/dist/collection/components/post-megadropdown/post-megadropdown.js +12 -2
  59. package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.js +1 -1
  60. package/dist/collection/components/post-menu/post-menu.css +1 -1
  61. package/dist/collection/components/post-menu/post-menu.js +41 -5
  62. package/dist/collection/components/post-menu-item/post-menu-item.js +1 -1
  63. package/dist/collection/components/post-menu-trigger/post-menu-trigger.js +1 -1
  64. package/dist/collection/components/post-popover/post-popover.css +1 -1
  65. package/dist/collection/components/post-popover/post-popover.js +1 -1
  66. package/dist/collection/components/post-popovercontainer/post-popovercontainer.css +1 -1
  67. package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +18 -7
  68. package/dist/collection/components/post-rating/post-rating.css +1 -1
  69. package/dist/collection/components/post-rating/post-rating.js +1 -1
  70. package/dist/collection/components/post-tab-header/post-tab-header.css +1 -1
  71. package/dist/collection/components/post-tab-header/post-tab-header.js +1 -1
  72. package/dist/collection/components/post-tab-panel/post-tab-panel.js +1 -1
  73. package/dist/collection/components/post-tabs/post-tabs.js +3 -3
  74. package/dist/collection/components/post-togglebutton/post-togglebutton.js +1 -1
  75. package/dist/collection/components/post-tooltip/post-tooltip.js +2 -2
  76. package/dist/collection/components/post-tooltip-trigger/post-tooltip-trigger.js +1 -1
  77. package/dist/collection/utils/event-from.js +2 -2
  78. package/dist/component-names.json +39 -0
  79. package/dist/{esm/event-from-8U5GFtQP.js → components/event-from.js} +2 -2
  80. package/dist/components/get-root.js +15 -0
  81. package/dist/components/index.d.ts +73 -0
  82. package/dist/components/index.js +36 -2315
  83. package/dist/components/package.js +3 -0
  84. package/dist/components/post-accordion-item.js +1 -1
  85. package/dist/components/post-accordion-item2.js +113 -0
  86. package/dist/components/post-accordion.js +1 -1
  87. package/dist/components/post-accordion2.js +138 -0
  88. package/dist/components/post-avatar.js +117 -88
  89. package/dist/components/post-back-to-top.js +7 -8
  90. package/dist/components/post-banner.js +10 -11
  91. package/dist/components/post-breadcrumb-item.js +1 -1
  92. package/dist/components/post-breadcrumb-item2.js +79 -0
  93. package/dist/components/post-breadcrumbs.js +16 -17
  94. package/dist/components/post-card-control.js +11 -12
  95. package/dist/components/post-closebutton.js +5 -7
  96. package/dist/components/post-collapsible-trigger.js +1 -1
  97. package/dist/components/post-collapsible-trigger2.js +135 -0
  98. package/dist/components/post-collapsible.js +1 -1
  99. package/dist/components/post-collapsible2.js +110 -0
  100. package/dist/components/post-footer.js +12 -13
  101. package/dist/components/post-header.js +18 -10
  102. package/dist/components/post-icon.js +1 -1
  103. package/dist/components/post-icon2.js +159 -0
  104. package/dist/components/post-language-option.js +10 -12
  105. package/dist/components/post-language-switch.js +13 -15
  106. package/dist/components/post-linkarea.js +24 -12
  107. package/dist/components/post-list-item.js +4 -5
  108. package/dist/components/post-list.js +6 -7
  109. package/dist/components/post-logo.js +6 -7
  110. package/dist/components/post-mainnavigation.js +6 -7
  111. package/dist/components/post-megadropdown-trigger.js +7 -8
  112. package/dist/components/post-megadropdown.js +20 -11
  113. package/dist/components/post-menu-item.js +1 -1
  114. package/dist/components/post-menu-item2.js +30 -0
  115. package/dist/components/post-menu-trigger.js +1 -1
  116. package/dist/components/post-menu-trigger2.js +110 -0
  117. package/dist/components/post-menu.js +1 -1
  118. package/dist/components/post-menu2.js +237 -0
  119. package/dist/components/post-popover.js +8 -9
  120. package/dist/components/post-popovercontainer.js +1 -1
  121. package/dist/components/post-popovercontainer2.js +3043 -0
  122. package/dist/components/post-rating.js +10 -11
  123. package/dist/components/post-tab-header.js +8 -9
  124. package/dist/components/post-tab-panel.js +7 -8
  125. package/dist/components/post-tabs.js +7 -8
  126. package/dist/components/post-togglebutton.js +4 -5
  127. package/dist/components/post-tooltip-trigger.js +7 -8
  128. package/dist/components/post-tooltip.js +8 -9
  129. package/dist/components/react/index.d.ts +33 -0
  130. package/dist/components/react/index.js +2315 -0
  131. package/dist/components/{p-Cxrx7SXz.js → react/p-Amg0f2Yo.js} +40 -34
  132. package/dist/components/{p-C0H2ohSv.js → react/p-B6vPT8S3.js} +3 -3
  133. package/dist/components/{p-336Lbkey.js → react/p-BDs0pvkX.js} +2 -2
  134. package/dist/components/react/p-BLchVpF6.js +14 -0
  135. package/dist/components/{p-BM8mtEfS.js → react/p-BMdFdJWl.js} +2 -2
  136. package/dist/components/{p-DP5pj8mq.js → react/p-BS0ZqwA-.js} +31 -6
  137. package/dist/components/react/p-C35MCWIp.js +35 -0
  138. package/dist/components/react/p-CJ80BZ06.js +178 -0
  139. package/dist/{esm/index-BWC0gtGU.js → components/react/p-CV7fm1rW.js} +1 -1
  140. package/dist/components/react/p-C_2k3G1c.js +264 -0
  141. package/dist/components/{p-DVGX_JCp.js → react/p-D1oOccKr.js} +3 -3
  142. package/dist/components/{p-pHxypsHK.js → react/p-D50E7y6E.js} +24 -9
  143. package/dist/components/react/p-DO48NanC.js +3 -0
  144. package/dist/components/{p-i0-mizzM.js → react/p-DOo9tmN-.js} +2 -2
  145. package/dist/components/{p-DEi5TIMq.js → react/p-Do9awHW7.js} +3 -3
  146. package/dist/components/react/p-SbIC4aZX.js +11 -0
  147. package/dist/components/{p-8U5GFtQP.js → react/p-kraHE1r3.js} +2 -2
  148. package/dist/components/react/p-r4txK0AC.js +3 -0
  149. package/dist/components/{p-BSvy4uym.js → react/p-xelWyg_P.js} +8 -8
  150. package/dist/components/react/post-accordion-item.d.ts +11 -0
  151. package/dist/components/react/post-accordion-item.js +6 -0
  152. package/dist/components/react/post-accordion.d.ts +11 -0
  153. package/dist/components/react/post-accordion.js +6 -0
  154. package/dist/components/react/post-avatar.d.ts +11 -0
  155. package/dist/components/react/post-avatar.js +218 -0
  156. package/dist/components/react/post-back-to-top.d.ts +11 -0
  157. package/dist/components/react/post-back-to-top.js +145 -0
  158. package/dist/components/react/post-banner.d.ts +11 -0
  159. package/dist/components/react/post-banner.js +99 -0
  160. package/dist/components/react/post-breadcrumb-item.d.ts +11 -0
  161. package/dist/components/react/post-breadcrumb-item.js +6 -0
  162. package/dist/components/react/post-breadcrumbs.d.ts +11 -0
  163. package/dist/components/react/post-breadcrumbs.js +187 -0
  164. package/dist/components/react/post-card-control.d.ts +11 -0
  165. package/dist/components/react/post-card-control.js +327 -0
  166. package/dist/components/react/post-closebutton.d.ts +11 -0
  167. package/dist/components/react/post-closebutton.js +50 -0
  168. package/dist/components/react/post-collapsible-trigger.d.ts +11 -0
  169. package/dist/components/react/post-collapsible-trigger.js +6 -0
  170. package/dist/components/react/post-collapsible.d.ts +11 -0
  171. package/dist/components/react/post-collapsible.js +6 -0
  172. package/dist/components/react/post-footer.d.ts +11 -0
  173. package/dist/components/react/post-footer.js +117 -0
  174. package/dist/components/react/post-header.d.ts +11 -0
  175. package/dist/components/react/post-header.js +342 -0
  176. package/dist/components/react/post-icon.d.ts +11 -0
  177. package/dist/components/react/post-icon.js +6 -0
  178. package/dist/components/react/post-language-option.d.ts +11 -0
  179. package/dist/components/react/post-language-option.js +100 -0
  180. package/dist/components/react/post-language-switch.d.ts +11 -0
  181. package/dist/components/react/post-language-switch.js +158 -0
  182. package/dist/components/react/post-linkarea.d.ts +11 -0
  183. package/dist/components/react/post-linkarea.js +59 -0
  184. package/dist/components/react/post-list-item.d.ts +11 -0
  185. package/dist/components/react/post-list-item.js +39 -0
  186. package/dist/components/react/post-list.d.ts +11 -0
  187. package/dist/components/react/post-list.js +62 -0
  188. package/dist/components/react/post-logo.d.ts +11 -0
  189. package/dist/components/react/post-logo.js +59 -0
  190. package/dist/components/react/post-mainnavigation.d.ts +11 -0
  191. package/dist/components/react/post-mainnavigation.js +181 -0
  192. package/dist/components/react/post-megadropdown-trigger.d.ts +11 -0
  193. package/dist/components/react/post-megadropdown-trigger.js +137 -0
  194. package/dist/components/react/post-megadropdown.d.ts +11 -0
  195. package/dist/components/react/post-megadropdown.js +207 -0
  196. package/dist/components/react/post-menu-item.d.ts +11 -0
  197. package/dist/components/react/post-menu-item.js +6 -0
  198. package/dist/components/react/post-menu-trigger.d.ts +11 -0
  199. package/dist/components/react/post-menu-trigger.js +6 -0
  200. package/dist/components/react/post-menu.d.ts +11 -0
  201. package/dist/components/react/post-menu.js +6 -0
  202. package/dist/components/react/post-popover.d.ts +11 -0
  203. package/dist/components/react/post-popover.js +189 -0
  204. package/dist/components/react/post-popovercontainer.d.ts +11 -0
  205. package/dist/components/react/post-popovercontainer.js +6 -0
  206. package/dist/components/react/post-rating.d.ts +11 -0
  207. package/dist/components/react/post-rating.js +153 -0
  208. package/dist/components/react/post-tab-header.d.ts +11 -0
  209. package/dist/components/react/post-tab-header.js +53 -0
  210. package/dist/components/react/post-tab-panel.d.ts +11 -0
  211. package/dist/components/react/post-tab-panel.js +55 -0
  212. package/dist/components/react/post-tabs.d.ts +11 -0
  213. package/dist/components/react/post-tabs.js +197 -0
  214. package/dist/components/react/post-togglebutton.d.ts +11 -0
  215. package/dist/components/react/post-togglebutton.js +57 -0
  216. package/dist/components/react/post-tooltip-trigger.d.ts +11 -0
  217. package/dist/components/react/post-tooltip-trigger.js +5223 -0
  218. package/dist/components/react/post-tooltip.d.ts +11 -0
  219. package/dist/components/react/post-tooltip.js +115 -0
  220. package/dist/components/switch-variants.js +3 -0
  221. package/dist/docs.json +71 -35
  222. package/dist/esm/event-from-kraHE1r3.js +105 -0
  223. package/dist/esm/index-C8a0ddDa.js +4 -4
  224. package/dist/esm/index-VmK3ABCB.js +88 -0
  225. package/dist/esm/loader.js +1 -1
  226. package/dist/esm/package-DO48NanC.js +3 -0
  227. package/dist/esm/post-accordion_2.entry.js +7 -7
  228. package/dist/esm/post-avatar.entry.js +108 -81
  229. package/dist/esm/post-back-to-top.entry.js +3 -3
  230. package/dist/esm/post-banner.entry.js +4 -4
  231. package/dist/esm/post-breadcrumb-item_2.entry.js +4 -4
  232. package/dist/esm/post-breadcrumbs.entry.js +5 -5
  233. package/dist/esm/post-card-control.entry.js +5 -5
  234. package/dist/esm/post-closebutton_15.entry.js +135 -76
  235. package/dist/esm/post-collapsible_2.entry.js +5 -5
  236. package/dist/esm/post-components.js +1 -1
  237. package/dist/esm/post-footer.entry.js +4 -4
  238. package/dist/esm/post-linkarea.entry.js +19 -8
  239. package/dist/esm/post-popover.entry.js +4 -4
  240. package/dist/esm/post-rating.entry.js +4 -4
  241. package/dist/esm/post-tab-header.entry.js +4 -4
  242. package/dist/esm/post-tab-panel.entry.js +3 -3
  243. package/dist/esm/post-tabs.entry.js +2 -2
  244. package/dist/esm/post-tooltip-trigger.entry.js +3 -3
  245. package/dist/esm/post-tooltip.entry.js +4 -4
  246. package/dist/loader/cdn.js +1 -0
  247. package/dist/loader/index.cjs.js +1 -0
  248. package/{loader → dist/loader}/index.d.ts +1 -1
  249. package/dist/loader/index.es2017.js +1 -0
  250. package/{loader → dist/loader}/index.js +1 -1
  251. package/dist/post-components/p-01bc39c2.entry.js +1 -0
  252. package/dist/post-components/p-0dc1e940.entry.js +1 -0
  253. package/dist/post-components/p-16da91bc.entry.js +1 -0
  254. package/dist/post-components/p-26a04741.entry.js +1 -0
  255. package/dist/post-components/p-2f2f9b22.entry.js +1 -0
  256. package/dist/post-components/{p-45007aac.entry.js → p-33008981.entry.js} +1 -1
  257. package/dist/post-components/p-36358cd4.entry.js +1 -0
  258. package/dist/post-components/p-71c48d48.entry.js +1 -0
  259. package/dist/post-components/{p-e9802b56.entry.js → p-84395e1d.entry.js} +1 -1
  260. package/dist/post-components/p-848c10ac.entry.js +1 -0
  261. package/dist/post-components/{p-ab8017bb.entry.js → p-8d2e5814.entry.js} +1 -1
  262. package/dist/post-components/{p-a2fa5ce4.entry.js → p-9dbe6595.entry.js} +1 -1
  263. package/dist/post-components/p-DO48NanC.js +1 -0
  264. package/dist/post-components/{p-BWC0gtGU.js → p-VmK3ABCB.js} +1 -1
  265. package/dist/post-components/p-a982458f.entry.js +1 -0
  266. package/dist/post-components/{p-f67b616a.entry.js → p-b0aaa058.entry.js} +1 -1
  267. package/dist/post-components/{p-bbe02ba3.entry.js → p-bdeef760.entry.js} +1 -1
  268. package/dist/post-components/{p-2f698af4.entry.js → p-d221395c.entry.js} +1 -1
  269. package/dist/post-components/{p-57703aee.entry.js → p-e49aa78e.entry.js} +1 -1
  270. package/dist/post-components/p-eb405167.entry.js +1 -0
  271. package/dist/post-components/p-kraHE1r3.js +1 -0
  272. package/dist/post-components/post-components.esm.js +1 -1
  273. package/dist/types/animations/pop-in.d.ts +1 -0
  274. package/dist/types/components/post-accordion-item/post-accordion-item.d.ts +3 -3
  275. package/dist/types/components/post-avatar/avatar-utils.d.ts +3 -0
  276. package/dist/types/components/post-avatar/post-avatar.d.ts +17 -13
  277. package/dist/types/components/post-closebutton/post-closebutton.d.ts +0 -6
  278. package/dist/types/components/post-header/post-header.d.ts +2 -0
  279. package/dist/types/components/post-icon/post-icon.d.ts +11 -0
  280. package/dist/types/components/post-linkarea/post-linkarea.d.ts +6 -0
  281. package/dist/types/components/post-megadropdown/post-megadropdown.d.ts +2 -1
  282. package/dist/types/components/post-menu/post-menu.d.ts +7 -0
  283. package/dist/types/components/post-popovercontainer/post-popovercontainer.d.ts +6 -2
  284. package/dist/types/components/post-tabs/post-tabs.d.ts +2 -2
  285. package/dist/types/components.d.ts +19 -22
  286. package/dist/types/utils/component-on-ready.d.ts +2 -2
  287. package/hydrate/index.js +308 -201
  288. package/hydrate/index.mjs +308 -201
  289. package/package.json +24 -12
  290. package/dist/components/p-Z01QMrov.js +0 -3
  291. package/dist/esm/package-Z01QMrov.js +0 -3
  292. package/dist/post-components/p-031f7489.entry.js +0 -1
  293. package/dist/post-components/p-1e6a068a.entry.js +0 -1
  294. package/dist/post-components/p-2ca196d6.entry.js +0 -1
  295. package/dist/post-components/p-3adbdda7.entry.js +0 -1
  296. package/dist/post-components/p-7b8ab026.entry.js +0 -1
  297. package/dist/post-components/p-8U5GFtQP.js +0 -1
  298. package/dist/post-components/p-9428231b.entry.js +0 -1
  299. package/dist/post-components/p-Z01QMrov.js +0 -1
  300. package/dist/post-components/p-ac73ab00.entry.js +0 -1
  301. package/dist/post-components/p-c1cf39cb.entry.js +0 -1
  302. package/dist/post-components/p-d0d92071.entry.js +0 -1
  303. package/dist/post-components/p-e96239c4.entry.js +0 -1
  304. package/dist/prebuild.js +0 -26
  305. package/dist/types/home/runner/work/design-system/design-system/packages/components/.stencil/prebuild.d.ts +0 -1
  306. package/loader/cdn.js +0 -1
  307. package/loader/index.cjs.js +0 -1
  308. package/loader/index.es2017.js +0 -1
  309. /package/dist/components/{p-CJ80BZ06.js → breakpoints.js} +0 -0
  310. /package/dist/components/{p-SbIC4aZX.js → fade.js} +0 -0
  311. /package/dist/components/{p-C35MCWIp.js → get-focusable-children.js} +0 -0
  312. /package/dist/components/{p-r4txK0AC.js → heading-levels.js} +0 -0
  313. /package/dist/components/{p-BLchVpF6.js → index.browser.js} +0 -0
  314. /package/dist/components/{p-CV7fm1rW.js → index2.js} +0 -0
  315. /package/dist/components/{p-C_2k3G1c.js → long-press-event.js} +0 -0
  316. /package/dist/components/{p-CBFgkSgY.js → react/p-CBFgkSgY.js} +0 -0
  317. /package/dist/components/{p-DjIHLduJ.js → react/p-DjIHLduJ.js} +0 -0
@@ -1,2315 +1,36 @@
1
- const globalStyles = ":where(post-accordion,post-accordion-item,post-avatar,post-back-to-top,post-banner,post-breadcrumb-item,post-breadcrumbs,post-card-control,post-closebutton,post-collapsible,post-collapsible-trigger,post-footer,post-header,post-icon,post-language-option,post-language-switch,post-linkarea,post-list,post-list-item,post-logo,post-mainnavigation,post-megadropdown,post-megadropdown-trigger,post-menu,post-menu-item,post-menu-trigger,post-popover,post-popovercontainer,post-rating,post-tab-header,post-tab-panel,post-tabs,post-togglebutton,post-tooltip,post-tooltip-trigger):not([data-hydrated],:defined){visibility:hidden}";
2
-
3
- const NAMESPACE = 'post-components';
4
- const BUILD = /* post-components */ { hydratedSelectorName: "data-hydrated", lazyLoad: false, slotRelocation: true, updatable: true};
5
-
6
- /*
7
- Stencil Client Platform v4.35.0 | MIT Licensed | https://stenciljs.com
8
- */
9
- var __defProp = Object.defineProperty;
10
- var __export = (target, all) => {
11
- for (var name in all)
12
- __defProp(target, name, { get: all[name], enumerable: true });
13
- };
14
-
15
- // src/utils/constants.ts
16
- var SVG_NS = "http://www.w3.org/2000/svg";
17
- var HTML_NS = "http://www.w3.org/1999/xhtml";
18
- var PrimitiveType = /* @__PURE__ */ ((PrimitiveType2) => {
19
- PrimitiveType2["Undefined"] = "undefined";
20
- PrimitiveType2["Null"] = "null";
21
- PrimitiveType2["String"] = "string";
22
- PrimitiveType2["Number"] = "number";
23
- PrimitiveType2["SpecialNumber"] = "number";
24
- PrimitiveType2["Boolean"] = "boolean";
25
- PrimitiveType2["BigInt"] = "bigint";
26
- return PrimitiveType2;
27
- })(PrimitiveType || {});
28
- var NonPrimitiveType = /* @__PURE__ */ ((NonPrimitiveType2) => {
29
- NonPrimitiveType2["Array"] = "array";
30
- NonPrimitiveType2["Date"] = "date";
31
- NonPrimitiveType2["Map"] = "map";
32
- NonPrimitiveType2["Object"] = "object";
33
- NonPrimitiveType2["RegularExpression"] = "regexp";
34
- NonPrimitiveType2["Set"] = "set";
35
- NonPrimitiveType2["Channel"] = "channel";
36
- NonPrimitiveType2["Symbol"] = "symbol";
37
- return NonPrimitiveType2;
38
- })(NonPrimitiveType || {});
39
- var TYPE_CONSTANT = "type";
40
- var VALUE_CONSTANT = "value";
41
- var SERIALIZED_PREFIX = "serialized:";
42
-
43
- // src/client/client-host-ref.ts
44
- var getHostRef = (ref) => {
45
- if (ref.__stencil__getHostRef) {
46
- return ref.__stencil__getHostRef();
47
- }
48
- return void 0;
49
- };
50
- var registerHost = (hostElement, cmpMeta) => {
51
- const hostRef = {
52
- $flags$: 0,
53
- $hostElement$: hostElement,
54
- $cmpMeta$: cmpMeta,
55
- $instanceValues$: /* @__PURE__ */ new Map()
56
- };
57
- {
58
- hostRef.$onReadyPromise$ = new Promise((r) => hostRef.$onReadyResolve$ = r);
59
- hostElement["s-p"] = [];
60
- hostElement["s-rc"] = [];
61
- }
62
- const ref = hostRef;
63
- hostElement.__stencil__getHostRef = () => ref;
64
- return ref;
65
- };
66
- var isMemberInElement = (elm, memberName) => memberName in elm;
67
- var consoleError = (e, el) => (0, console.error)(e, el);
68
-
69
- // src/client/client-style.ts
70
- var styles = /* @__PURE__ */ new Map();
71
-
72
- // src/runtime/runtime-constants.ts
73
- var CONTENT_REF_ID = "r";
74
- var ORG_LOCATION_ID = "o";
75
- var SLOT_NODE_ID = "s";
76
- var TEXT_NODE_ID = "t";
77
- var COMMENT_NODE_ID = "c";
78
- var HYDRATE_ID = "s-id";
79
- var HYDRATED_STYLE_ID = "sty-id";
80
- var HYDRATE_CHILD_ID = "c-id";
81
- var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
82
- var XLINK_NS = "http://www.w3.org/1999/xlink";
83
- var FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS = [
84
- "formAssociatedCallback",
85
- "formResetCallback",
86
- "formDisabledCallback",
87
- "formStateRestoreCallback"
88
- ];
89
- var win = typeof window !== "undefined" ? window : {};
90
- var H = win.HTMLElement || class {
91
- };
92
- var plt = {
93
- $flags$: 0,
94
- $resourcesUrl$: "",
95
- jmp: (h2) => h2(),
96
- raf: (h2) => requestAnimationFrame(h2),
97
- ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
98
- rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
99
- ce: (eventName, opts) => new CustomEvent(eventName, opts)
100
- };
101
- var supportsListenerOptions = /* @__PURE__ */ (() => {
102
- var _a;
103
- let supportsListenerOptions2 = false;
104
- try {
105
- (_a = win.document) == null ? void 0 : _a.addEventListener(
106
- "e",
107
- null,
108
- Object.defineProperty({}, "passive", {
109
- get() {
110
- supportsListenerOptions2 = true;
111
- }
112
- })
113
- );
114
- } catch (e) {
115
- }
116
- return supportsListenerOptions2;
117
- })();
118
- var promiseResolve = (v) => Promise.resolve(v);
119
- var supportsConstructableStylesheets = /* @__PURE__ */ (() => {
120
- try {
121
- new CSSStyleSheet();
122
- return typeof new CSSStyleSheet().replaceSync === "function";
123
- } catch (e) {
124
- }
125
- return false;
126
- })() ;
127
- var queuePending = false;
128
- var queueDomReads = [];
129
- var queueDomWrites = [];
130
- var queueTask = (queue, write) => (cb) => {
131
- queue.push(cb);
132
- if (!queuePending) {
133
- queuePending = true;
134
- if (write && plt.$flags$ & 4 /* queueSync */) {
135
- nextTick(flush);
136
- } else {
137
- plt.raf(flush);
138
- }
139
- }
140
- };
141
- var consume = (queue) => {
142
- for (let i2 = 0; i2 < queue.length; i2++) {
143
- try {
144
- queue[i2](performance.now());
145
- } catch (e) {
146
- consoleError(e);
147
- }
148
- }
149
- queue.length = 0;
150
- };
151
- var flush = () => {
152
- consume(queueDomReads);
153
- {
154
- consume(queueDomWrites);
155
- if (queuePending = queueDomReads.length > 0) {
156
- plt.raf(flush);
157
- }
158
- }
159
- };
160
- var nextTick = (cb) => promiseResolve().then(cb);
161
- var writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);
162
-
163
- // src/runtime/asset-path.ts
164
- var getAssetPath = (path) => {
165
- const assetUrl = new URL(path, plt.$resourcesUrl$);
166
- return assetUrl.origin !== win.location.origin ? assetUrl.href : assetUrl.pathname;
167
- };
168
- var setAssetPath = (path) => plt.$resourcesUrl$ = path;
169
- var isComplexType = (o) => {
170
- o = typeof o;
171
- return o === "object" || o === "function";
172
- };
173
-
174
- // src/utils/query-nonce-meta-tag-content.ts
175
- function queryNonceMetaTagContent(doc) {
176
- var _a, _b, _c;
177
- return (_c = (_b = (_a = doc.head) == null ? void 0 : _a.querySelector('meta[name="csp-nonce"]')) == null ? void 0 : _b.getAttribute("content")) != null ? _c : void 0;
178
- }
179
-
180
- // src/utils/regular-expression.ts
181
- var escapeRegExpSpecialCharacters = (text) => {
182
- return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
183
- };
184
-
185
- // src/utils/remote-value.ts
186
- var RemoteValue = class _RemoteValue {
187
- /**
188
- * Deserializes a LocalValue serialized object back to its original JavaScript representation
189
- *
190
- * @param serialized The serialized LocalValue object
191
- * @returns The original JavaScript value/object
192
- */
193
- static fromLocalValue(serialized) {
194
- const type = serialized[TYPE_CONSTANT];
195
- const value = VALUE_CONSTANT in serialized ? serialized[VALUE_CONSTANT] : void 0;
196
- switch (type) {
197
- case "string" /* String */:
198
- return value;
199
- case "boolean" /* Boolean */:
200
- return value;
201
- case "bigint" /* BigInt */:
202
- return BigInt(value);
203
- case "undefined" /* Undefined */:
204
- return void 0;
205
- case "null" /* Null */:
206
- return null;
207
- case "number" /* Number */:
208
- if (value === "NaN") return NaN;
209
- if (value === "-0") return -0;
210
- if (value === "Infinity") return Infinity;
211
- if (value === "-Infinity") return -Infinity;
212
- return value;
213
- case "array" /* Array */:
214
- return value.map((item) => _RemoteValue.fromLocalValue(item));
215
- case "date" /* Date */:
216
- return new Date(value);
217
- case "map" /* Map */:
218
- const map2 = /* @__PURE__ */ new Map();
219
- for (const [key, val] of value) {
220
- const deserializedKey = typeof key === "object" && key !== null ? _RemoteValue.fromLocalValue(key) : key;
221
- const deserializedValue = _RemoteValue.fromLocalValue(val);
222
- map2.set(deserializedKey, deserializedValue);
223
- }
224
- return map2;
225
- case "object" /* Object */:
226
- const obj = {};
227
- for (const [key, val] of value) {
228
- obj[key] = _RemoteValue.fromLocalValue(val);
229
- }
230
- return obj;
231
- case "regexp" /* RegularExpression */:
232
- const { pattern, flags } = value;
233
- return new RegExp(pattern, flags);
234
- case "set" /* Set */:
235
- const set = /* @__PURE__ */ new Set();
236
- for (const item of value) {
237
- set.add(_RemoteValue.fromLocalValue(item));
238
- }
239
- return set;
240
- case "symbol" /* Symbol */:
241
- return Symbol(value);
242
- default:
243
- throw new Error(`Unsupported type: ${type}`);
244
- }
245
- }
246
- /**
247
- * Utility method to deserialize multiple LocalValues at once
248
- *
249
- * @param serializedValues Array of serialized LocalValue objects
250
- * @returns Array of deserialized JavaScript values
251
- */
252
- static fromLocalValueArray(serializedValues) {
253
- return serializedValues.map((value) => _RemoteValue.fromLocalValue(value));
254
- }
255
- /**
256
- * Verifies if the given object matches the structure of a serialized LocalValue
257
- *
258
- * @param obj Object to verify
259
- * @returns boolean indicating if the object has LocalValue structure
260
- */
261
- static isLocalValueObject(obj) {
262
- if (typeof obj !== "object" || obj === null) {
263
- return false;
264
- }
265
- if (!obj.hasOwnProperty(TYPE_CONSTANT)) {
266
- return false;
267
- }
268
- const type = obj[TYPE_CONSTANT];
269
- const hasTypeProperty = Object.values({ ...PrimitiveType, ...NonPrimitiveType }).includes(type);
270
- if (!hasTypeProperty) {
271
- return false;
272
- }
273
- if (type !== "null" /* Null */ && type !== "undefined" /* Undefined */) {
274
- return obj.hasOwnProperty(VALUE_CONSTANT);
275
- }
276
- return true;
277
- }
278
- };
279
-
280
- // src/utils/result.ts
281
- var result_exports = {};
282
- __export(result_exports, {
283
- err: () => err,
284
- map: () => map,
285
- ok: () => ok,
286
- unwrap: () => unwrap,
287
- unwrapErr: () => unwrapErr
288
- });
289
- var ok = (value) => ({
290
- isOk: true,
291
- isErr: false,
292
- value
293
- });
294
- var err = (value) => ({
295
- isOk: false,
296
- isErr: true,
297
- value
298
- });
299
- function map(result, fn) {
300
- if (result.isOk) {
301
- const val = fn(result.value);
302
- if (val instanceof Promise) {
303
- return val.then((newVal) => ok(newVal));
304
- } else {
305
- return ok(val);
306
- }
307
- }
308
- if (result.isErr) {
309
- const value = result.value;
310
- return err(value);
311
- }
312
- throw "should never get here";
313
- }
314
- var unwrap = (result) => {
315
- if (result.isOk) {
316
- return result.value;
317
- } else {
318
- throw result.value;
319
- }
320
- };
321
- var unwrapErr = (result) => {
322
- if (result.isErr) {
323
- return result.value;
324
- } else {
325
- throw result.value;
326
- }
327
- };
328
-
329
- // src/utils/serialize.ts
330
- function deserializeProperty(value) {
331
- if (typeof value !== "string" || !value.startsWith(SERIALIZED_PREFIX)) {
332
- return value;
333
- }
334
- return RemoteValue.fromLocalValue(JSON.parse(atob(value.slice(SERIALIZED_PREFIX.length))));
335
- }
336
- function createShadowRoot(cmpMeta) {
337
- const shadowRoot = this.attachShadow({ mode: "open" });
338
- if (supportsConstructableStylesheets) {
339
- const sheet = new CSSStyleSheet();
340
- sheet.replaceSync(globalStyles);
341
- shadowRoot.adoptedStyleSheets.push(sheet);
342
- }
343
- }
344
- var updateFallbackSlotVisibility = (elm) => {
345
- const childNodes = internalCall(elm, "childNodes");
346
- if (elm.tagName && elm.tagName.includes("-") && elm["s-cr"] && elm.tagName !== "SLOT-FB") {
347
- getHostSlotNodes(childNodes, elm.tagName).forEach((slotNode) => {
348
- if (slotNode.nodeType === 1 /* ElementNode */ && slotNode.tagName === "SLOT-FB") {
349
- if (getSlotChildSiblings(slotNode, getSlotName(slotNode), false).length) {
350
- slotNode.hidden = true;
351
- } else {
352
- slotNode.hidden = false;
353
- }
354
- }
355
- });
356
- }
357
- let i2 = 0;
358
- for (i2 = 0; i2 < childNodes.length; i2++) {
359
- const childNode = childNodes[i2];
360
- if (childNode.nodeType === 1 /* ElementNode */ && internalCall(childNode, "childNodes").length) {
361
- updateFallbackSlotVisibility(childNode);
362
- }
363
- }
364
- };
365
- var getSlottedChildNodes = (childNodes) => {
366
- const result = [];
367
- for (let i2 = 0; i2 < childNodes.length; i2++) {
368
- const slottedNode = childNodes[i2]["s-nr"] || void 0;
369
- if (slottedNode && slottedNode.isConnected) {
370
- result.push(slottedNode);
371
- }
372
- }
373
- return result;
374
- };
375
- function getHostSlotNodes(childNodes, hostName, slotName) {
376
- let i2 = 0;
377
- let slottedNodes = [];
378
- let childNode;
379
- for (; i2 < childNodes.length; i2++) {
380
- childNode = childNodes[i2];
381
- if (childNode["s-sr"] && (!hostName || childNode["s-hn"] === hostName) && (slotName === void 0)) {
382
- slottedNodes.push(childNode);
383
- }
384
- slottedNodes = [...slottedNodes, ...getHostSlotNodes(childNode.childNodes, hostName, slotName)];
385
- }
386
- return slottedNodes;
387
- }
388
- var getSlotChildSiblings = (slot, slotName, includeSlot = true) => {
389
- const childNodes = [];
390
- if (includeSlot && slot["s-sr"] || !slot["s-sr"]) childNodes.push(slot);
391
- let node = slot;
392
- while (node = node.nextSibling) {
393
- if (getSlotName(node) === slotName && (includeSlot || !node["s-sr"])) childNodes.push(node);
394
- }
395
- return childNodes;
396
- };
397
- var isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
398
- if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
399
- if (nodeToRelocate.getAttribute("slot") === null && slotName === "") {
400
- return true;
401
- }
402
- if (nodeToRelocate.getAttribute("slot") === slotName) {
403
- return true;
404
- }
405
- return false;
406
- }
407
- if (nodeToRelocate["s-sn"] === slotName) {
408
- return true;
409
- }
410
- return slotName === "";
411
- };
412
- var addSlotRelocateNode = (newChild, slotNode, prepend, position) => {
413
- if (newChild["s-ol"] && newChild["s-ol"].isConnected) {
414
- return;
415
- }
416
- const slottedNodeLocation = document.createTextNode("");
417
- slottedNodeLocation["s-nr"] = newChild;
418
- if (!slotNode["s-cr"] || !slotNode["s-cr"].parentNode) return;
419
- const parent = slotNode["s-cr"].parentNode;
420
- const appendMethod = internalCall(parent, "appendChild");
421
- if (typeof position !== "undefined") {
422
- slottedNodeLocation["s-oo"] = position;
423
- const childNodes = internalCall(parent, "childNodes");
424
- const slotRelocateNodes = [slottedNodeLocation];
425
- childNodes.forEach((n) => {
426
- if (n["s-nr"]) slotRelocateNodes.push(n);
427
- });
428
- slotRelocateNodes.sort((a, b) => {
429
- if (!a["s-oo"] || a["s-oo"] < (b["s-oo"] || 0)) return -1;
430
- else if (!b["s-oo"] || b["s-oo"] < a["s-oo"]) return 1;
431
- return 0;
432
- });
433
- slotRelocateNodes.forEach((n) => appendMethod.call(parent, n));
434
- } else {
435
- appendMethod.call(parent, slottedNodeLocation);
436
- }
437
- newChild["s-ol"] = slottedNodeLocation;
438
- newChild["s-sh"] = slotNode["s-hn"];
439
- };
440
- var getSlotName = (node) => typeof node["s-sn"] === "string" ? node["s-sn"] : node.nodeType === 1 && node.getAttribute("slot") || void 0;
441
- function patchSlotNode(node) {
442
- if (node.assignedElements || node.assignedNodes || !node["s-sr"]) return;
443
- const assignedFactory = (elementsOnly) => (function(opts) {
444
- const toReturn = [];
445
- const slotName = this["s-sn"];
446
- if (opts == null ? void 0 : opts.flatten) {
447
- console.error(`
448
- Flattening is not supported for Stencil non-shadow slots.
449
- You can use \`.childNodes\` to nested slot fallback content.
450
- If you have a particular use case, please open an issue on the Stencil repo.
451
- `);
452
- }
453
- const parent = this["s-cr"].parentElement;
454
- const slottedNodes = parent.__childNodes ? parent.childNodes : getSlottedChildNodes(parent.childNodes);
455
- slottedNodes.forEach((n) => {
456
- if (slotName === getSlotName(n)) {
457
- toReturn.push(n);
458
- }
459
- });
460
- if (elementsOnly) {
461
- return toReturn.filter((n) => n.nodeType === 1 /* ElementNode */);
462
- }
463
- return toReturn;
464
- }).bind(node);
465
- node.assignedElements = assignedFactory(true);
466
- node.assignedNodes = assignedFactory(false);
467
- }
468
- function internalCall(node, method) {
469
- if ("__" + method in node) {
470
- const toReturn = node["__" + method];
471
- if (typeof toReturn !== "function") return toReturn;
472
- return toReturn.bind(node);
473
- } else {
474
- if (typeof node[method] !== "function") return node[method];
475
- return node[method].bind(node);
476
- }
477
- }
478
- var createTime = (fnName, tagName = "") => {
479
- {
480
- return () => {
481
- return;
482
- };
483
- }
484
- };
485
- var h = (nodeName, vnodeData, ...children) => {
486
- let child = null;
487
- let key = null;
488
- let slotName = null;
489
- let simple = false;
490
- let lastSimple = false;
491
- const vNodeChildren = [];
492
- const walk = (c) => {
493
- for (let i2 = 0; i2 < c.length; i2++) {
494
- child = c[i2];
495
- if (Array.isArray(child)) {
496
- walk(child);
497
- } else if (child != null && typeof child !== "boolean") {
498
- if (simple = typeof nodeName !== "function" && !isComplexType(child)) {
499
- child = String(child);
500
- }
501
- if (simple && lastSimple) {
502
- vNodeChildren[vNodeChildren.length - 1].$text$ += child;
503
- } else {
504
- vNodeChildren.push(simple ? newVNode(null, child) : child);
505
- }
506
- lastSimple = simple;
507
- }
508
- }
509
- };
510
- walk(children);
511
- if (vnodeData) {
512
- if (vnodeData.key) {
513
- key = vnodeData.key;
514
- }
515
- if (vnodeData.name) {
516
- slotName = vnodeData.name;
517
- }
518
- {
519
- const classData = vnodeData.className || vnodeData.class;
520
- if (classData) {
521
- vnodeData.class = typeof classData !== "object" ? classData : Object.keys(classData).filter((k) => classData[k]).join(" ");
522
- }
523
- }
524
- }
525
- if (typeof nodeName === "function") {
526
- return nodeName(
527
- vnodeData === null ? {} : vnodeData,
528
- vNodeChildren,
529
- vdomFnUtils
530
- );
531
- }
532
- const vnode = newVNode(nodeName, null);
533
- vnode.$attrs$ = vnodeData;
534
- if (vNodeChildren.length > 0) {
535
- vnode.$children$ = vNodeChildren;
536
- }
537
- {
538
- vnode.$key$ = key;
539
- }
540
- {
541
- vnode.$name$ = slotName;
542
- }
543
- return vnode;
544
- };
545
- var newVNode = (tag, text) => {
546
- const vnode = {
547
- $flags$: 0,
548
- $tag$: tag,
549
- $text$: text,
550
- $elm$: null,
551
- $children$: null
552
- };
553
- {
554
- vnode.$attrs$ = null;
555
- }
556
- {
557
- vnode.$key$ = null;
558
- }
559
- {
560
- vnode.$name$ = null;
561
- }
562
- return vnode;
563
- };
564
- var Host = {};
565
- var isHost = (node) => node && node.$tag$ === Host;
566
- var vdomFnUtils = {
567
- forEach: (children, cb) => children.map(convertToPublic).forEach(cb),
568
- map: (children, cb) => children.map(convertToPublic).map(cb).map(convertToPrivate)
569
- };
570
- var convertToPublic = (node) => ({
571
- vattrs: node.$attrs$,
572
- vchildren: node.$children$,
573
- vkey: node.$key$,
574
- vname: node.$name$,
575
- vtag: node.$tag$,
576
- vtext: node.$text$
577
- });
578
- var convertToPrivate = (node) => {
579
- if (typeof node.vtag === "function") {
580
- const vnodeData = { ...node.vattrs };
581
- if (node.vkey) {
582
- vnodeData.key = node.vkey;
583
- }
584
- if (node.vname) {
585
- vnodeData.name = node.vname;
586
- }
587
- return h(node.vtag, vnodeData, ...node.vchildren || []);
588
- }
589
- const vnode = newVNode(node.vtag, node.vtext);
590
- vnode.$attrs$ = node.vattrs;
591
- vnode.$children$ = node.vchildren;
592
- vnode.$key$ = node.vkey;
593
- vnode.$name$ = node.vname;
594
- return vnode;
595
- };
596
-
597
- // src/runtime/client-hydrate.ts
598
- var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
599
- var _a;
600
- const endHydrate = createTime("hydrateClient", tagName);
601
- const shadowRoot = hostElm.shadowRoot;
602
- const childRenderNodes = [];
603
- const slotNodes = [];
604
- const slottedNodes = [];
605
- const shadowRootNodes = shadowRoot ? [] : null;
606
- const vnode = newVNode(tagName, null);
607
- vnode.$elm$ = hostElm;
608
- const members = Object.entries(((_a = hostRef.$cmpMeta$) == null ? void 0 : _a.$members$) || {});
609
- members.forEach(([memberName, [memberFlags, metaAttributeName]]) => {
610
- var _a2, _b;
611
- if (!(memberFlags & 31 /* Prop */)) {
612
- return;
613
- }
614
- const attributeName = metaAttributeName || memberName;
615
- const attrVal = hostElm.getAttribute(attributeName);
616
- if (attrVal !== null) {
617
- const attrPropVal = parsePropertyValue(
618
- attrVal,
619
- memberFlags,
620
- !!(((_a2 = hostRef.$cmpMeta$) == null ? void 0 : _a2.$flags$) & 64 /* formAssociated */)
621
- );
622
- (_b = hostRef == null ? void 0 : hostRef.$instanceValues$) == null ? void 0 : _b.set(memberName, attrPropVal);
623
- }
624
- });
625
- if (win.document && (!plt.$orgLocNodes$ || !plt.$orgLocNodes$.size)) {
626
- initializeDocumentHydrate(win.document.body, plt.$orgLocNodes$ = /* @__PURE__ */ new Map());
627
- }
628
- hostElm[HYDRATE_ID] = hostId;
629
- hostElm.removeAttribute(HYDRATE_ID);
630
- hostRef.$vnode$ = clientHydrate(
631
- vnode,
632
- childRenderNodes,
633
- slotNodes,
634
- shadowRootNodes,
635
- hostElm,
636
- hostElm,
637
- hostId,
638
- slottedNodes
639
- );
640
- let crIndex = 0;
641
- const crLength = childRenderNodes.length;
642
- let childRenderNode;
643
- for (crIndex; crIndex < crLength; crIndex++) {
644
- childRenderNode = childRenderNodes[crIndex];
645
- const orgLocationId = childRenderNode.$hostId$ + "." + childRenderNode.$nodeId$;
646
- const orgLocationNode = plt.$orgLocNodes$.get(orgLocationId);
647
- const node = childRenderNode.$elm$;
648
- if (!shadowRoot) {
649
- node["s-hn"] = tagName.toUpperCase();
650
- if (childRenderNode.$tag$ === "slot") {
651
- node["s-cr"] = hostElm["s-cr"];
652
- }
653
- }
654
- if (childRenderNode.$tag$ === "slot") {
655
- childRenderNode.$name$ = childRenderNode.$elm$["s-sn"] || childRenderNode.$elm$["name"] || null;
656
- if (childRenderNode.$children$) {
657
- childRenderNode.$flags$ |= 2 /* isSlotFallback */;
658
- if (!childRenderNode.$elm$.childNodes.length) {
659
- childRenderNode.$children$.forEach((c) => {
660
- childRenderNode.$elm$.appendChild(c.$elm$);
661
- });
662
- }
663
- } else {
664
- childRenderNode.$flags$ |= 1 /* isSlotReference */;
665
- }
666
- }
667
- if (orgLocationNode && orgLocationNode.isConnected) {
668
- if (shadowRoot && orgLocationNode["s-en"] === "") {
669
- orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
670
- }
671
- orgLocationNode.parentNode.removeChild(orgLocationNode);
672
- if (!shadowRoot) {
673
- node["s-oo"] = parseInt(childRenderNode.$nodeId$);
674
- }
675
- }
676
- plt.$orgLocNodes$.delete(orgLocationId);
677
- }
678
- const hosts = [];
679
- const snLen = slottedNodes.length;
680
- let snIndex = 0;
681
- let slotGroup;
682
- let snGroupIdx;
683
- let snGroupLen;
684
- let slottedItem;
685
- for (snIndex; snIndex < snLen; snIndex++) {
686
- slotGroup = slottedNodes[snIndex];
687
- if (!slotGroup || !slotGroup.length) continue;
688
- snGroupLen = slotGroup.length;
689
- snGroupIdx = 0;
690
- for (snGroupIdx; snGroupIdx < snGroupLen; snGroupIdx++) {
691
- slottedItem = slotGroup[snGroupIdx];
692
- if (!hosts[slottedItem.hostId]) {
693
- hosts[slottedItem.hostId] = plt.$orgLocNodes$.get(slottedItem.hostId);
694
- }
695
- if (!hosts[slottedItem.hostId]) continue;
696
- const hostEle = hosts[slottedItem.hostId];
697
- if (!hostEle.shadowRoot || !shadowRoot) {
698
- slottedItem.slot["s-cr"] = hostEle["s-cr"];
699
- if (!slottedItem.slot["s-cr"] && hostEle.shadowRoot) {
700
- slottedItem.slot["s-cr"] = hostEle;
701
- } else {
702
- slottedItem.slot["s-cr"] = (hostEle.__childNodes || hostEle.childNodes)[0];
703
- }
704
- addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node["s-oo"]);
705
- }
706
- if (hostEle.shadowRoot && slottedItem.node.parentElement !== hostEle) {
707
- hostEle.appendChild(slottedItem.node);
708
- }
709
- }
710
- }
711
- if (shadowRoot && !shadowRoot.childNodes.length) {
712
- let rnIdex = 0;
713
- const rnLen = shadowRootNodes.length;
714
- if (rnLen) {
715
- for (rnIdex; rnIdex < rnLen; rnIdex++) {
716
- shadowRoot.appendChild(shadowRootNodes[rnIdex]);
717
- }
718
- Array.from(hostElm.childNodes).forEach((node) => {
719
- if (typeof node["s-en"] !== "string" && typeof node["s-sn"] !== "string") {
720
- if (node.nodeType === 1 /* ElementNode */ && node.slot && node.hidden) {
721
- node.removeAttribute("hidden");
722
- } else if (node.nodeType === 8 /* CommentNode */ || node.nodeType === 3 /* TextNode */ && !node.wholeText.trim()) {
723
- node.parentNode.removeChild(node);
724
- }
725
- }
726
- });
727
- }
728
- }
729
- plt.$orgLocNodes$.delete(hostElm["s-id"]);
730
- hostRef.$hostElement$ = hostElm;
731
- endHydrate();
732
- };
733
- var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node, hostId, slottedNodes = []) => {
734
- let childNodeType;
735
- let childIdSplt;
736
- let childVNode;
737
- let i2;
738
- if (node.nodeType === 1 /* ElementNode */) {
739
- childNodeType = node.getAttribute(HYDRATE_CHILD_ID);
740
- if (childNodeType) {
741
- childIdSplt = childNodeType.split(".");
742
- if (childIdSplt[0] === hostId || childIdSplt[0] === "0") {
743
- childVNode = createSimpleVNode({
744
- $flags$: 0,
745
- $hostId$: childIdSplt[0],
746
- $nodeId$: childIdSplt[1],
747
- $depth$: childIdSplt[2],
748
- $index$: childIdSplt[3],
749
- $tag$: node.tagName.toLowerCase(),
750
- $elm$: node,
751
- // If we don't add the initial classes to the VNode, the first `vdom-render.ts` patch
752
- // won't try to reconcile them. Classes set on the node will be blown away.
753
- $attrs$: { class: node.className || "" }
754
- });
755
- childRenderNodes.push(childVNode);
756
- node.removeAttribute(HYDRATE_CHILD_ID);
757
- if (!parentVNode.$children$) {
758
- parentVNode.$children$ = [];
759
- }
760
- const slotName = childVNode.$elm$.getAttribute("s-sn");
761
- if (typeof slotName === "string") {
762
- if (childVNode.$tag$ === "slot-fb") {
763
- addSlot(
764
- slotName,
765
- childIdSplt[2],
766
- childVNode,
767
- node,
768
- parentVNode,
769
- childRenderNodes,
770
- slotNodes,
771
- shadowRootNodes,
772
- slottedNodes
773
- );
774
- }
775
- childVNode.$elm$["s-sn"] = slotName;
776
- childVNode.$elm$.removeAttribute("s-sn");
777
- }
778
- if (childVNode.$index$ !== void 0) {
779
- parentVNode.$children$[childVNode.$index$] = childVNode;
780
- }
781
- parentVNode = childVNode;
782
- if (shadowRootNodes && childVNode.$depth$ === "0") {
783
- shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
784
- }
785
- }
786
- }
787
- if (node.shadowRoot) {
788
- for (i2 = node.shadowRoot.childNodes.length - 1; i2 >= 0; i2--) {
789
- clientHydrate(
790
- parentVNode,
791
- childRenderNodes,
792
- slotNodes,
793
- shadowRootNodes,
794
- hostElm,
795
- node.shadowRoot.childNodes[i2],
796
- hostId,
797
- slottedNodes
798
- );
799
- }
800
- }
801
- const nonShadowNodes = node.__childNodes || node.childNodes;
802
- for (i2 = nonShadowNodes.length - 1; i2 >= 0; i2--) {
803
- clientHydrate(
804
- parentVNode,
805
- childRenderNodes,
806
- slotNodes,
807
- shadowRootNodes,
808
- hostElm,
809
- nonShadowNodes[i2],
810
- hostId,
811
- slottedNodes
812
- );
813
- }
814
- } else if (node.nodeType === 8 /* CommentNode */) {
815
- childIdSplt = node.nodeValue.split(".");
816
- if (childIdSplt[1] === hostId || childIdSplt[1] === "0") {
817
- childNodeType = childIdSplt[0];
818
- childVNode = createSimpleVNode({
819
- $hostId$: childIdSplt[1],
820
- $nodeId$: childIdSplt[2],
821
- $depth$: childIdSplt[3],
822
- $index$: childIdSplt[4] || "0",
823
- $elm$: node,
824
- $attrs$: null,
825
- $children$: null,
826
- $key$: null,
827
- $name$: null,
828
- $tag$: null,
829
- $text$: null
830
- });
831
- if (childNodeType === TEXT_NODE_ID) {
832
- childVNode.$elm$ = findCorrespondingNode(node, 3 /* TextNode */);
833
- if (childVNode.$elm$ && childVNode.$elm$.nodeType === 3 /* TextNode */) {
834
- childVNode.$text$ = childVNode.$elm$.textContent;
835
- childRenderNodes.push(childVNode);
836
- node.remove();
837
- if (hostId === childVNode.$hostId$) {
838
- if (!parentVNode.$children$) {
839
- parentVNode.$children$ = [];
840
- }
841
- parentVNode.$children$[childVNode.$index$] = childVNode;
842
- }
843
- if (shadowRootNodes && childVNode.$depth$ === "0") {
844
- shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
845
- }
846
- }
847
- } else if (childNodeType === COMMENT_NODE_ID) {
848
- childVNode.$elm$ = findCorrespondingNode(node, 8 /* CommentNode */);
849
- if (childVNode.$elm$ && childVNode.$elm$.nodeType === 8 /* CommentNode */) {
850
- childRenderNodes.push(childVNode);
851
- node.remove();
852
- }
853
- } else if (childVNode.$hostId$ === hostId) {
854
- if (childNodeType === SLOT_NODE_ID) {
855
- const slotName = node["s-sn"] = childIdSplt[5] || "";
856
- addSlot(
857
- slotName,
858
- childIdSplt[2],
859
- childVNode,
860
- node,
861
- parentVNode,
862
- childRenderNodes,
863
- slotNodes,
864
- shadowRootNodes,
865
- slottedNodes
866
- );
867
- } else if (childNodeType === CONTENT_REF_ID) {
868
- if (shadowRootNodes) {
869
- node.remove();
870
- } else {
871
- hostElm["s-cr"] = node;
872
- node["s-cn"] = true;
873
- }
874
- }
875
- }
876
- }
877
- } else if (parentVNode && parentVNode.$tag$ === "style") {
878
- const vnode = newVNode(null, node.textContent);
879
- vnode.$elm$ = node;
880
- vnode.$index$ = "0";
881
- parentVNode.$children$ = [vnode];
882
- } else {
883
- if (node.nodeType === 3 /* TextNode */ && !node.wholeText.trim()) {
884
- node.remove();
885
- }
886
- }
887
- return parentVNode;
888
- };
889
- var initializeDocumentHydrate = (node, orgLocNodes) => {
890
- if (node.nodeType === 1 /* ElementNode */) {
891
- const componentId = node[HYDRATE_ID] || node.getAttribute(HYDRATE_ID);
892
- if (componentId) {
893
- orgLocNodes.set(componentId, node);
894
- }
895
- let i2 = 0;
896
- if (node.shadowRoot) {
897
- for (; i2 < node.shadowRoot.childNodes.length; i2++) {
898
- initializeDocumentHydrate(node.shadowRoot.childNodes[i2], orgLocNodes);
899
- }
900
- }
901
- const nonShadowNodes = node.__childNodes || node.childNodes;
902
- for (i2 = 0; i2 < nonShadowNodes.length; i2++) {
903
- initializeDocumentHydrate(nonShadowNodes[i2], orgLocNodes);
904
- }
905
- } else if (node.nodeType === 8 /* CommentNode */) {
906
- const childIdSplt = node.nodeValue.split(".");
907
- if (childIdSplt[0] === ORG_LOCATION_ID) {
908
- orgLocNodes.set(childIdSplt[1] + "." + childIdSplt[2], node);
909
- node.nodeValue = "";
910
- node["s-en"] = childIdSplt[3];
911
- }
912
- }
913
- };
914
- var createSimpleVNode = (vnode) => {
915
- const defaultVNode = {
916
- $flags$: 0,
917
- $hostId$: null,
918
- $nodeId$: null,
919
- $depth$: null,
920
- $index$: "0",
921
- $elm$: null,
922
- $attrs$: null,
923
- $children$: null,
924
- $key$: null,
925
- $name$: null,
926
- $tag$: null,
927
- $text$: null
928
- };
929
- return { ...defaultVNode, ...vnode };
930
- };
931
- function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNodes, slotNodes, shadowRootNodes, slottedNodes) {
932
- node["s-sr"] = true;
933
- childVNode.$name$ = slotName || null;
934
- childVNode.$tag$ = "slot";
935
- const parentNodeId = (parentVNode == null ? void 0 : parentVNode.$elm$) ? parentVNode.$elm$["s-id"] || parentVNode.$elm$.getAttribute("s-id") : "";
936
- if (shadowRootNodes && win.document) {
937
- const slot = childVNode.$elm$ = win.document.createElement(childVNode.$tag$);
938
- if (childVNode.$name$) {
939
- childVNode.$elm$.setAttribute("name", slotName);
940
- }
941
- if (parentNodeId && parentNodeId !== childVNode.$hostId$) {
942
- parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
943
- } else {
944
- node.parentNode.insertBefore(childVNode.$elm$, node);
945
- }
946
- addSlottedNodes(slottedNodes, slotId, slotName, node, childVNode.$hostId$);
947
- node.remove();
948
- if (childVNode.$depth$ === "0") {
949
- shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
950
- }
951
- } else {
952
- const slot = childVNode.$elm$;
953
- const shouldMove = parentNodeId && parentNodeId !== childVNode.$hostId$ && parentVNode.$elm$.shadowRoot;
954
- addSlottedNodes(slottedNodes, slotId, slotName, node, shouldMove ? parentNodeId : childVNode.$hostId$);
955
- patchSlotNode(node);
956
- if (shouldMove) {
957
- parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
958
- }
959
- childRenderNodes.push(childVNode);
960
- }
961
- slotNodes.push(childVNode);
962
- if (!parentVNode.$children$) {
963
- parentVNode.$children$ = [];
964
- }
965
- parentVNode.$children$[childVNode.$index$] = childVNode;
966
- }
967
- var addSlottedNodes = (slottedNodes, slotNodeId, slotName, slotNode, hostId) => {
968
- let slottedNode = slotNode.nextSibling;
969
- slottedNodes[slotNodeId] = slottedNodes[slotNodeId] || [];
970
- while (slottedNode && ((slottedNode["getAttribute"] && slottedNode.getAttribute("slot") || slottedNode["s-sn"]) === slotName || slotName === "" && !slottedNode["s-sn"] && (slottedNode.nodeType === 8 /* CommentNode */ && slottedNode.nodeValue.indexOf(".") !== 1 || slottedNode.nodeType === 3 /* TextNode */))) {
971
- slottedNode["s-sn"] = slotName;
972
- slottedNodes[slotNodeId].push({ slot: slotNode, node: slottedNode, hostId });
973
- slottedNode = slottedNode.nextSibling;
974
- }
975
- };
976
- var findCorrespondingNode = (node, type) => {
977
- let sibling = node;
978
- do {
979
- sibling = sibling.nextSibling;
980
- } while (sibling && (sibling.nodeType !== type || !sibling.nodeValue));
981
- return sibling;
982
- };
983
- var createSupportsRuleRe = (selector) => {
984
- const safeSelector2 = escapeRegExpSpecialCharacters(selector);
985
- return new RegExp(
986
- // First capture group: match any context before the selector that's not inside @supports selector()
987
- // Using negative lookahead to avoid matching inside @supports selector(...) condition
988
- `(^|[^@]|@(?!supports\\s+selector\\s*\\([^{]*?${safeSelector2}))(${safeSelector2}\\b)`,
989
- "g"
990
- );
991
- };
992
- createSupportsRuleRe("::slotted");
993
- createSupportsRuleRe(":host");
994
- createSupportsRuleRe(":host-context");
995
- var parsePropertyValue = (propValue, propType, isFormAssociated) => {
996
- if (typeof propValue === "string" && (propValue.startsWith("{") && propValue.endsWith("}") || propValue.startsWith("[") && propValue.endsWith("]"))) {
997
- try {
998
- propValue = JSON.parse(propValue);
999
- return propValue;
1000
- } catch (e) {
1001
- }
1002
- }
1003
- if (typeof propValue === "string" && propValue.startsWith(SERIALIZED_PREFIX)) {
1004
- propValue = deserializeProperty(propValue);
1005
- return propValue;
1006
- }
1007
- if (propValue != null && !isComplexType(propValue)) {
1008
- if (propType & 4 /* Boolean */) {
1009
- if (isFormAssociated && typeof propValue === "string") {
1010
- return propValue === "" || !!propValue;
1011
- } else {
1012
- return propValue === "false" ? false : propValue === "" || !!propValue;
1013
- }
1014
- }
1015
- if (propType & 2 /* Number */) {
1016
- return typeof propValue === "string" ? parseFloat(propValue) : typeof propValue === "number" ? propValue : NaN;
1017
- }
1018
- if (propType & 1 /* String */) {
1019
- return String(propValue);
1020
- }
1021
- return propValue;
1022
- }
1023
- return propValue;
1024
- };
1025
- var getElement = (ref) => ref;
1026
-
1027
- // src/runtime/event-emitter.ts
1028
- var createEvent = (ref, name, flags) => {
1029
- const elm = getElement(ref);
1030
- return {
1031
- emit: (detail) => {
1032
- return emitEvent(elm, name, {
1033
- bubbles: true,
1034
- composed: true,
1035
- cancelable: true,
1036
- detail
1037
- });
1038
- }
1039
- };
1040
- };
1041
- var emitEvent = (elm, name, opts) => {
1042
- const ev = plt.ce(name, opts);
1043
- elm.dispatchEvent(ev);
1044
- return ev;
1045
- };
1046
- var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
1047
- var registerStyle = (scopeId2, cssText, allowCS) => {
1048
- let style = styles.get(scopeId2);
1049
- if (supportsConstructableStylesheets && allowCS) {
1050
- style = style || new CSSStyleSheet();
1051
- if (typeof style === "string") {
1052
- style = cssText;
1053
- } else {
1054
- style.replaceSync(cssText);
1055
- }
1056
- } else {
1057
- style = cssText;
1058
- }
1059
- styles.set(scopeId2, style);
1060
- };
1061
- var addStyle = (styleContainerNode, cmpMeta, mode) => {
1062
- var _a;
1063
- const scopeId2 = getScopeId(cmpMeta);
1064
- const style = styles.get(scopeId2);
1065
- if (!win.document) {
1066
- return scopeId2;
1067
- }
1068
- styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : win.document;
1069
- if (style) {
1070
- if (typeof style === "string") {
1071
- styleContainerNode = styleContainerNode.head || styleContainerNode;
1072
- let appliedStyles = rootAppliedStyles.get(styleContainerNode);
1073
- let styleElm;
1074
- if (!appliedStyles) {
1075
- rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
1076
- }
1077
- if (!appliedStyles.has(scopeId2)) {
1078
- if (styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
1079
- styleElm.innerHTML = style;
1080
- } else {
1081
- styleElm = win.document.createElement("style");
1082
- styleElm.innerHTML = style;
1083
- const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
1084
- if (nonce != null) {
1085
- styleElm.setAttribute("nonce", nonce);
1086
- }
1087
- if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
1088
- if (styleContainerNode.nodeName === "HEAD") {
1089
- const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
1090
- const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
1091
- styleContainerNode.insertBefore(
1092
- styleElm,
1093
- (referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
1094
- );
1095
- } else if ("host" in styleContainerNode) {
1096
- if (supportsConstructableStylesheets) {
1097
- const stylesheet = new CSSStyleSheet();
1098
- stylesheet.replaceSync(style);
1099
- styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
1100
- } else {
1101
- const existingStyleContainer = styleContainerNode.querySelector("style");
1102
- if (existingStyleContainer) {
1103
- existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
1104
- } else {
1105
- styleContainerNode.prepend(styleElm);
1106
- }
1107
- }
1108
- } else {
1109
- styleContainerNode.append(styleElm);
1110
- }
1111
- }
1112
- if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
1113
- styleContainerNode.insertBefore(styleElm, null);
1114
- }
1115
- }
1116
- if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
1117
- styleElm.innerHTML += SLOT_FB_CSS;
1118
- }
1119
- if (appliedStyles) {
1120
- appliedStyles.add(scopeId2);
1121
- }
1122
- }
1123
- } else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
1124
- styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
1125
- }
1126
- }
1127
- return scopeId2;
1128
- };
1129
- var attachStyles = (hostRef) => {
1130
- const cmpMeta = hostRef.$cmpMeta$;
1131
- const elm = hostRef.$hostElement$;
1132
- const flags = cmpMeta.$flags$;
1133
- const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
1134
- const scopeId2 = addStyle(
1135
- elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
1136
- cmpMeta);
1137
- if (flags & 10 /* needsScopedEncapsulation */) {
1138
- elm["s-sc"] = scopeId2;
1139
- elm.classList.add(scopeId2 + "-h");
1140
- }
1141
- endAttachStyles();
1142
- };
1143
- var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
1144
- var convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, "$1{");
1145
- var hydrateScopedToShadow = () => {
1146
- if (!win.document) {
1147
- return;
1148
- }
1149
- const styles2 = win.document.querySelectorAll(`[${HYDRATED_STYLE_ID}]`);
1150
- let i2 = 0;
1151
- for (; i2 < styles2.length; i2++) {
1152
- registerStyle(styles2[i2].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles2[i2].innerHTML), true);
1153
- }
1154
- };
1155
- var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRender) => {
1156
- if (oldValue === newValue) {
1157
- return;
1158
- }
1159
- let isProp = isMemberInElement(elm, memberName);
1160
- let ln = memberName.toLowerCase();
1161
- if (memberName === "class") {
1162
- const classList = elm.classList;
1163
- const oldClasses = parseClassList(oldValue);
1164
- let newClasses = parseClassList(newValue);
1165
- if (elm["s-si"] && initialRender) {
1166
- newClasses.push(elm["s-si"]);
1167
- oldClasses.forEach((c) => {
1168
- if (c.startsWith(elm["s-si"])) newClasses.push(c);
1169
- });
1170
- newClasses = [...new Set(newClasses)];
1171
- classList.add(...newClasses);
1172
- } else {
1173
- classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
1174
- classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
1175
- }
1176
- } else if (memberName === "style") {
1177
- {
1178
- for (const prop in oldValue) {
1179
- if (!newValue || newValue[prop] == null) {
1180
- if (prop.includes("-")) {
1181
- elm.style.removeProperty(prop);
1182
- } else {
1183
- elm.style[prop] = "";
1184
- }
1185
- }
1186
- }
1187
- }
1188
- for (const prop in newValue) {
1189
- if (!oldValue || newValue[prop] !== oldValue[prop]) {
1190
- if (prop.includes("-")) {
1191
- elm.style.setProperty(prop, newValue[prop]);
1192
- } else {
1193
- elm.style[prop] = newValue[prop];
1194
- }
1195
- }
1196
- }
1197
- } else if (memberName === "key") ; else if (memberName === "ref") {
1198
- if (newValue) {
1199
- newValue(elm);
1200
- }
1201
- } else if ((!elm.__lookupSetter__(memberName)) && memberName[0] === "o" && memberName[1] === "n") {
1202
- if (memberName[2] === "-") {
1203
- memberName = memberName.slice(3);
1204
- } else if (isMemberInElement(win, ln)) {
1205
- memberName = ln.slice(2);
1206
- } else {
1207
- memberName = ln[2] + memberName.slice(3);
1208
- }
1209
- if (oldValue || newValue) {
1210
- const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
1211
- memberName = memberName.replace(CAPTURE_EVENT_REGEX, "");
1212
- if (oldValue) {
1213
- plt.rel(elm, memberName, oldValue, capture);
1214
- }
1215
- if (newValue) {
1216
- plt.ael(elm, memberName, newValue, capture);
1217
- }
1218
- }
1219
- } else {
1220
- const isComplex = isComplexType(newValue);
1221
- if ((isProp || isComplex && newValue !== null) && !isSvg) {
1222
- try {
1223
- if (!elm.tagName.includes("-")) {
1224
- const n = newValue == null ? "" : newValue;
1225
- if (memberName === "list") {
1226
- isProp = false;
1227
- } else if (oldValue == null || elm[memberName] != n) {
1228
- if (typeof elm.__lookupSetter__(memberName) === "function") {
1229
- elm[memberName] = n;
1230
- } else {
1231
- elm.setAttribute(memberName, n);
1232
- }
1233
- }
1234
- } else if (elm[memberName] !== newValue) {
1235
- elm[memberName] = newValue;
1236
- }
1237
- } catch (e) {
1238
- }
1239
- }
1240
- let xlink = false;
1241
- {
1242
- if (ln !== (ln = ln.replace(/^xlink\:?/, ""))) {
1243
- memberName = ln;
1244
- xlink = true;
1245
- }
1246
- }
1247
- if (newValue == null || newValue === false) {
1248
- if (newValue !== false || elm.getAttribute(memberName) === "") {
1249
- if (xlink) {
1250
- elm.removeAttributeNS(XLINK_NS, memberName);
1251
- } else {
1252
- elm.removeAttribute(memberName);
1253
- }
1254
- }
1255
- } else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex && elm.nodeType === 1 /* ElementNode */) {
1256
- newValue = newValue === true ? "" : newValue;
1257
- if (xlink) {
1258
- elm.setAttributeNS(XLINK_NS, memberName, newValue);
1259
- } else {
1260
- elm.setAttribute(memberName, newValue);
1261
- }
1262
- }
1263
- }
1264
- };
1265
- var parseClassListRegex = /\s/;
1266
- var parseClassList = (value) => {
1267
- if (typeof value === "object" && value && "baseVal" in value) {
1268
- value = value.baseVal;
1269
- }
1270
- if (!value || typeof value !== "string") {
1271
- return [];
1272
- }
1273
- return value.split(parseClassListRegex);
1274
- };
1275
- var CAPTURE_EVENT_SUFFIX = "Capture";
1276
- var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
1277
-
1278
- // src/runtime/vdom/update-element.ts
1279
- var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
1280
- const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
1281
- const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || {};
1282
- const newVnodeAttrs = newVnode.$attrs$ || {};
1283
- {
1284
- for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
1285
- if (!(memberName in newVnodeAttrs)) {
1286
- setAccessor(
1287
- elm,
1288
- memberName,
1289
- oldVnodeAttrs[memberName],
1290
- void 0,
1291
- isSvgMode2,
1292
- newVnode.$flags$,
1293
- isInitialRender
1294
- );
1295
- }
1296
- }
1297
- }
1298
- for (const memberName of sortedAttrNames(Object.keys(newVnodeAttrs))) {
1299
- setAccessor(
1300
- elm,
1301
- memberName,
1302
- oldVnodeAttrs[memberName],
1303
- newVnodeAttrs[memberName],
1304
- isSvgMode2,
1305
- newVnode.$flags$,
1306
- isInitialRender
1307
- );
1308
- }
1309
- };
1310
- function sortedAttrNames(attrNames) {
1311
- return attrNames.includes("ref") ? (
1312
- // we need to sort these to ensure that `'ref'` is the last attr
1313
- [...attrNames.filter((attr) => attr !== "ref"), "ref"]
1314
- ) : (
1315
- // no need to sort, return the original array
1316
- attrNames
1317
- );
1318
- }
1319
- var contentRef;
1320
- var hostTagName;
1321
- var useNativeShadowDom = false;
1322
- var checkSlotFallbackVisibility = false;
1323
- var checkSlotRelocate = false;
1324
- var isSvgMode = false;
1325
- var createElm = (oldParentVNode, newParentVNode, childIndex) => {
1326
- var _a;
1327
- const newVNode2 = newParentVNode.$children$[childIndex];
1328
- let i2 = 0;
1329
- let elm;
1330
- let childNode;
1331
- let oldVNode;
1332
- if (!useNativeShadowDom) {
1333
- checkSlotRelocate = true;
1334
- if (newVNode2.$tag$ === "slot") {
1335
- newVNode2.$flags$ |= newVNode2.$children$ ? (
1336
- // slot element has fallback content
1337
- // still create an element that "mocks" the slot element
1338
- 2 /* isSlotFallback */
1339
- ) : (
1340
- // slot element does not have fallback content
1341
- // create an html comment we'll use to always reference
1342
- // where actual slot content should sit next to
1343
- 1 /* isSlotReference */
1344
- );
1345
- }
1346
- }
1347
- if (newVNode2.$text$ !== null) {
1348
- elm = newVNode2.$elm$ = win.document.createTextNode(newVNode2.$text$);
1349
- } else if (newVNode2.$flags$ & 1 /* isSlotReference */) {
1350
- elm = newVNode2.$elm$ = win.document.createTextNode("");
1351
- {
1352
- updateElement(null, newVNode2, isSvgMode);
1353
- }
1354
- } else {
1355
- if (!isSvgMode) {
1356
- isSvgMode = newVNode2.$tag$ === "svg";
1357
- }
1358
- if (!win.document) {
1359
- throw new Error(
1360
- "You are trying to render a Stencil component in an environment that doesn't support the DOM. Make sure to populate the [`window`](https://developer.mozilla.org/en-US/docs/Web/API/Window/window) object before rendering a component."
1361
- );
1362
- }
1363
- elm = newVNode2.$elm$ = win.document.createElementNS(
1364
- isSvgMode ? SVG_NS : HTML_NS,
1365
- !useNativeShadowDom && BUILD.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
1366
- ) ;
1367
- if (isSvgMode && newVNode2.$tag$ === "foreignObject") {
1368
- isSvgMode = false;
1369
- }
1370
- {
1371
- updateElement(null, newVNode2, isSvgMode);
1372
- }
1373
- if (newVNode2.$children$) {
1374
- for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
1375
- childNode = createElm(oldParentVNode, newVNode2, i2);
1376
- if (childNode) {
1377
- elm.appendChild(childNode);
1378
- }
1379
- }
1380
- }
1381
- {
1382
- if (newVNode2.$tag$ === "svg") {
1383
- isSvgMode = false;
1384
- } else if (elm.tagName === "foreignObject") {
1385
- isSvgMode = true;
1386
- }
1387
- }
1388
- }
1389
- elm["s-hn"] = hostTagName;
1390
- {
1391
- if (newVNode2.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
1392
- elm["s-sr"] = true;
1393
- elm["s-cr"] = contentRef;
1394
- elm["s-sn"] = newVNode2.$name$ || "";
1395
- elm["s-rf"] = (_a = newVNode2.$attrs$) == null ? void 0 : _a.ref;
1396
- patchSlotNode(elm);
1397
- oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
1398
- if (oldVNode && oldVNode.$tag$ === newVNode2.$tag$ && oldParentVNode.$elm$) {
1399
- {
1400
- putBackInOriginalLocation(oldParentVNode.$elm$, false);
1401
- }
1402
- }
1403
- }
1404
- }
1405
- return elm;
1406
- };
1407
- var putBackInOriginalLocation = (parentElm, recursive) => {
1408
- plt.$flags$ |= 1 /* isTmpDisconnected */;
1409
- const oldSlotChildNodes = Array.from(parentElm.__childNodes || parentElm.childNodes);
1410
- for (let i2 = oldSlotChildNodes.length - 1; i2 >= 0; i2--) {
1411
- const childNode = oldSlotChildNodes[i2];
1412
- if (childNode["s-hn"] !== hostTagName && childNode["s-ol"]) {
1413
- insertBefore(referenceNode(childNode).parentNode, childNode, referenceNode(childNode));
1414
- childNode["s-ol"].remove();
1415
- childNode["s-ol"] = void 0;
1416
- childNode["s-sh"] = void 0;
1417
- checkSlotRelocate = true;
1418
- }
1419
- if (recursive) {
1420
- putBackInOriginalLocation(childNode, recursive);
1421
- }
1422
- }
1423
- plt.$flags$ &= -2 /* isTmpDisconnected */;
1424
- };
1425
- var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
1426
- let containerElm = parentElm["s-cr"] && parentElm["s-cr"].parentNode || parentElm;
1427
- let childNode;
1428
- if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
1429
- containerElm = containerElm.shadowRoot;
1430
- }
1431
- for (; startIdx <= endIdx; ++startIdx) {
1432
- if (vnodes[startIdx]) {
1433
- childNode = createElm(null, parentVNode, startIdx);
1434
- if (childNode) {
1435
- vnodes[startIdx].$elm$ = childNode;
1436
- insertBefore(containerElm, childNode, referenceNode(before) );
1437
- }
1438
- }
1439
- }
1440
- };
1441
- var removeVnodes = (vnodes, startIdx, endIdx) => {
1442
- for (let index = startIdx; index <= endIdx; ++index) {
1443
- const vnode = vnodes[index];
1444
- if (vnode) {
1445
- const elm = vnode.$elm$;
1446
- nullifyVNodeRefs(vnode);
1447
- if (elm) {
1448
- {
1449
- checkSlotFallbackVisibility = true;
1450
- if (elm["s-ol"]) {
1451
- elm["s-ol"].remove();
1452
- } else {
1453
- putBackInOriginalLocation(elm, true);
1454
- }
1455
- }
1456
- elm.remove();
1457
- }
1458
- }
1459
- }
1460
- };
1461
- var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = false) => {
1462
- let oldStartIdx = 0;
1463
- let newStartIdx = 0;
1464
- let idxInOld = 0;
1465
- let i2 = 0;
1466
- let oldEndIdx = oldCh.length - 1;
1467
- let oldStartVnode = oldCh[0];
1468
- let oldEndVnode = oldCh[oldEndIdx];
1469
- let newEndIdx = newCh.length - 1;
1470
- let newStartVnode = newCh[0];
1471
- let newEndVnode = newCh[newEndIdx];
1472
- let node;
1473
- let elmToMove;
1474
- while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
1475
- if (oldStartVnode == null) {
1476
- oldStartVnode = oldCh[++oldStartIdx];
1477
- } else if (oldEndVnode == null) {
1478
- oldEndVnode = oldCh[--oldEndIdx];
1479
- } else if (newStartVnode == null) {
1480
- newStartVnode = newCh[++newStartIdx];
1481
- } else if (newEndVnode == null) {
1482
- newEndVnode = newCh[--newEndIdx];
1483
- } else if (isSameVnode(oldStartVnode, newStartVnode, isInitialRender)) {
1484
- patch(oldStartVnode, newStartVnode, isInitialRender);
1485
- oldStartVnode = oldCh[++oldStartIdx];
1486
- newStartVnode = newCh[++newStartIdx];
1487
- } else if (isSameVnode(oldEndVnode, newEndVnode, isInitialRender)) {
1488
- patch(oldEndVnode, newEndVnode, isInitialRender);
1489
- oldEndVnode = oldCh[--oldEndIdx];
1490
- newEndVnode = newCh[--newEndIdx];
1491
- } else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
1492
- if ((oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
1493
- putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
1494
- }
1495
- patch(oldStartVnode, newEndVnode, isInitialRender);
1496
- insertBefore(parentElm, oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
1497
- oldStartVnode = oldCh[++oldStartIdx];
1498
- newEndVnode = newCh[--newEndIdx];
1499
- } else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
1500
- if ((oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
1501
- putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
1502
- }
1503
- patch(oldEndVnode, newStartVnode, isInitialRender);
1504
- insertBefore(parentElm, oldEndVnode.$elm$, oldStartVnode.$elm$);
1505
- oldEndVnode = oldCh[--oldEndIdx];
1506
- newStartVnode = newCh[++newStartIdx];
1507
- } else {
1508
- idxInOld = -1;
1509
- {
1510
- for (i2 = oldStartIdx; i2 <= oldEndIdx; ++i2) {
1511
- if (oldCh[i2] && oldCh[i2].$key$ !== null && oldCh[i2].$key$ === newStartVnode.$key$) {
1512
- idxInOld = i2;
1513
- break;
1514
- }
1515
- }
1516
- }
1517
- if (idxInOld >= 0) {
1518
- elmToMove = oldCh[idxInOld];
1519
- if (elmToMove.$tag$ !== newStartVnode.$tag$) {
1520
- node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld);
1521
- } else {
1522
- patch(elmToMove, newStartVnode, isInitialRender);
1523
- oldCh[idxInOld] = void 0;
1524
- node = elmToMove.$elm$;
1525
- }
1526
- newStartVnode = newCh[++newStartIdx];
1527
- } else {
1528
- node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx);
1529
- newStartVnode = newCh[++newStartIdx];
1530
- }
1531
- if (node) {
1532
- {
1533
- insertBefore(
1534
- referenceNode(oldStartVnode.$elm$).parentNode,
1535
- node,
1536
- referenceNode(oldStartVnode.$elm$)
1537
- );
1538
- }
1539
- }
1540
- }
1541
- }
1542
- if (oldStartIdx > oldEndIdx) {
1543
- addVnodes(
1544
- parentElm,
1545
- newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$,
1546
- newVNode2,
1547
- newCh,
1548
- newStartIdx,
1549
- newEndIdx
1550
- );
1551
- } else if (newStartIdx > newEndIdx) {
1552
- removeVnodes(oldCh, oldStartIdx, oldEndIdx);
1553
- }
1554
- };
1555
- var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
1556
- if (leftVNode.$tag$ === rightVNode.$tag$) {
1557
- if (leftVNode.$tag$ === "slot") {
1558
- return leftVNode.$name$ === rightVNode.$name$;
1559
- }
1560
- if (!isInitialRender) {
1561
- return leftVNode.$key$ === rightVNode.$key$;
1562
- }
1563
- if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) {
1564
- leftVNode.$key$ = rightVNode.$key$;
1565
- }
1566
- return true;
1567
- }
1568
- return false;
1569
- };
1570
- var referenceNode = (node) => node && node["s-ol"] || node;
1571
- var patch = (oldVNode, newVNode2, isInitialRender = false) => {
1572
- const elm = newVNode2.$elm$ = oldVNode.$elm$;
1573
- const oldChildren = oldVNode.$children$;
1574
- const newChildren = newVNode2.$children$;
1575
- const tag = newVNode2.$tag$;
1576
- const text = newVNode2.$text$;
1577
- let defaultHolder;
1578
- if (text === null) {
1579
- {
1580
- isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
1581
- }
1582
- {
1583
- updateElement(oldVNode, newVNode2, isSvgMode, isInitialRender);
1584
- }
1585
- if (oldChildren !== null && newChildren !== null) {
1586
- updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
1587
- } else if (newChildren !== null) {
1588
- if (oldVNode.$text$ !== null) {
1589
- elm.textContent = "";
1590
- }
1591
- addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);
1592
- } else if (
1593
- // don't do this on initial render as it can cause non-hydrated content to be removed
1594
- !isInitialRender && BUILD.updatable && oldChildren !== null
1595
- ) {
1596
- removeVnodes(oldChildren, 0, oldChildren.length - 1);
1597
- }
1598
- if (isSvgMode && tag === "svg") {
1599
- isSvgMode = false;
1600
- }
1601
- } else if ((defaultHolder = elm["s-cr"])) {
1602
- defaultHolder.parentNode.textContent = text;
1603
- } else if (oldVNode.$text$ !== text) {
1604
- elm.data = text;
1605
- }
1606
- };
1607
- var relocateNodes = [];
1608
- var markSlotContentForRelocation = (elm) => {
1609
- let node;
1610
- let hostContentNodes;
1611
- let j;
1612
- const children = elm.__childNodes || elm.childNodes;
1613
- for (const childNode of children) {
1614
- if (childNode["s-sr"] && (node = childNode["s-cr"]) && node.parentNode) {
1615
- hostContentNodes = node.parentNode.__childNodes || node.parentNode.childNodes;
1616
- const slotName = childNode["s-sn"];
1617
- for (j = hostContentNodes.length - 1; j >= 0; j--) {
1618
- node = hostContentNodes[j];
1619
- if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (true)) {
1620
- if (isNodeLocatedInSlot(node, slotName)) {
1621
- let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
1622
- checkSlotFallbackVisibility = true;
1623
- node["s-sn"] = node["s-sn"] || slotName;
1624
- if (relocateNodeData) {
1625
- relocateNodeData.$nodeToRelocate$["s-sh"] = childNode["s-hn"];
1626
- relocateNodeData.$slotRefNode$ = childNode;
1627
- } else {
1628
- node["s-sh"] = childNode["s-hn"];
1629
- relocateNodes.push({
1630
- $slotRefNode$: childNode,
1631
- $nodeToRelocate$: node
1632
- });
1633
- }
1634
- if (node["s-sr"]) {
1635
- relocateNodes.map((relocateNode) => {
1636
- if (isNodeLocatedInSlot(relocateNode.$nodeToRelocate$, node["s-sn"])) {
1637
- relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
1638
- if (relocateNodeData && !relocateNode.$slotRefNode$) {
1639
- relocateNode.$slotRefNode$ = relocateNodeData.$slotRefNode$;
1640
- }
1641
- }
1642
- });
1643
- }
1644
- } else if (!relocateNodes.some((r) => r.$nodeToRelocate$ === node)) {
1645
- relocateNodes.push({
1646
- $nodeToRelocate$: node
1647
- });
1648
- }
1649
- }
1650
- }
1651
- }
1652
- if (childNode.nodeType === 1 /* ElementNode */) {
1653
- markSlotContentForRelocation(childNode);
1654
- }
1655
- }
1656
- };
1657
- var nullifyVNodeRefs = (vNode) => {
1658
- {
1659
- vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
1660
- vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
1661
- }
1662
- };
1663
- var insertBefore = (parent, newNode, reference) => {
1664
- {
1665
- return parent == null ? void 0 : parent.insertBefore(newNode, reference);
1666
- }
1667
- };
1668
- var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
1669
- var _a, _b, _c, _d;
1670
- const hostElm = hostRef.$hostElement$;
1671
- const cmpMeta = hostRef.$cmpMeta$;
1672
- const oldVNode = hostRef.$vnode$ || newVNode(null, null);
1673
- const isHostElement = isHost(renderFnResults);
1674
- const rootVnode = isHostElement ? renderFnResults : h(null, null, renderFnResults);
1675
- hostTagName = hostElm.tagName;
1676
- if (cmpMeta.$attrsToReflect$) {
1677
- rootVnode.$attrs$ = rootVnode.$attrs$ || {};
1678
- cmpMeta.$attrsToReflect$.map(
1679
- ([propName, attribute]) => rootVnode.$attrs$[attribute] = hostElm[propName]
1680
- );
1681
- }
1682
- if (isInitialLoad && rootVnode.$attrs$) {
1683
- for (const key of Object.keys(rootVnode.$attrs$)) {
1684
- if (hostElm.hasAttribute(key) && !["key", "ref", "style", "class"].includes(key)) {
1685
- rootVnode.$attrs$[key] = hostElm[key];
1686
- }
1687
- }
1688
- }
1689
- rootVnode.$tag$ = null;
1690
- rootVnode.$flags$ |= 4 /* isHost */;
1691
- hostRef.$vnode$ = rootVnode;
1692
- rootVnode.$elm$ = oldVNode.$elm$ = hostElm.shadowRoot || hostElm ;
1693
- useNativeShadowDom = !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) && !(cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */);
1694
- {
1695
- contentRef = hostElm["s-cr"];
1696
- checkSlotFallbackVisibility = false;
1697
- }
1698
- patch(oldVNode, rootVnode, isInitialLoad);
1699
- {
1700
- plt.$flags$ |= 1 /* isTmpDisconnected */;
1701
- if (checkSlotRelocate) {
1702
- markSlotContentForRelocation(rootVnode.$elm$);
1703
- for (const relocateData of relocateNodes) {
1704
- const nodeToRelocate = relocateData.$nodeToRelocate$;
1705
- if (!nodeToRelocate["s-ol"] && win.document) {
1706
- const orgLocationNode = win.document.createTextNode("");
1707
- orgLocationNode["s-nr"] = nodeToRelocate;
1708
- insertBefore(nodeToRelocate.parentNode, nodeToRelocate["s-ol"] = orgLocationNode, nodeToRelocate);
1709
- }
1710
- }
1711
- for (const relocateData of relocateNodes) {
1712
- const nodeToRelocate = relocateData.$nodeToRelocate$;
1713
- const slotRefNode = relocateData.$slotRefNode$;
1714
- if (slotRefNode) {
1715
- const parentNodeRef = slotRefNode.parentNode;
1716
- let insertBeforeNode = slotRefNode.nextSibling;
1717
- {
1718
- let orgLocationNode = (_a = nodeToRelocate["s-ol"]) == null ? void 0 : _a.previousSibling;
1719
- while (orgLocationNode) {
1720
- let refNode = (_b = orgLocationNode["s-nr"]) != null ? _b : null;
1721
- if (refNode && refNode["s-sn"] === nodeToRelocate["s-sn"] && parentNodeRef === (refNode.__parentNode || refNode.parentNode)) {
1722
- refNode = refNode.nextSibling;
1723
- while (refNode === nodeToRelocate || (refNode == null ? void 0 : refNode["s-sr"])) {
1724
- refNode = refNode == null ? void 0 : refNode.nextSibling;
1725
- }
1726
- if (!refNode || !refNode["s-nr"]) {
1727
- insertBeforeNode = refNode;
1728
- break;
1729
- }
1730
- }
1731
- orgLocationNode = orgLocationNode.previousSibling;
1732
- }
1733
- }
1734
- const parent = nodeToRelocate.__parentNode || nodeToRelocate.parentNode;
1735
- const nextSibling = nodeToRelocate.__nextSibling || nodeToRelocate.nextSibling;
1736
- if (!insertBeforeNode && parentNodeRef !== parent || nextSibling !== insertBeforeNode) {
1737
- if (nodeToRelocate !== insertBeforeNode) {
1738
- if (!nodeToRelocate["s-hn"] && nodeToRelocate["s-ol"]) {
1739
- nodeToRelocate["s-hn"] = nodeToRelocate["s-ol"].parentNode.nodeName;
1740
- }
1741
- insertBefore(parentNodeRef, nodeToRelocate, insertBeforeNode);
1742
- if (nodeToRelocate.nodeType === 1 /* ElementNode */ && nodeToRelocate.tagName !== "SLOT-FB") {
1743
- nodeToRelocate.hidden = (_c = nodeToRelocate["s-ih"]) != null ? _c : false;
1744
- }
1745
- }
1746
- }
1747
- nodeToRelocate && typeof slotRefNode["s-rf"] === "function" && slotRefNode["s-rf"](slotRefNode);
1748
- } else {
1749
- if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
1750
- if (isInitialLoad) {
1751
- nodeToRelocate["s-ih"] = (_d = nodeToRelocate.hidden) != null ? _d : false;
1752
- }
1753
- nodeToRelocate.hidden = true;
1754
- }
1755
- }
1756
- }
1757
- }
1758
- if (checkSlotFallbackVisibility) {
1759
- updateFallbackSlotVisibility(rootVnode.$elm$);
1760
- }
1761
- plt.$flags$ &= -2 /* isTmpDisconnected */;
1762
- relocateNodes.length = 0;
1763
- }
1764
- contentRef = void 0;
1765
- };
1766
-
1767
- // src/runtime/update-component.ts
1768
- var attachToAncestor = (hostRef, ancestorComponent) => {
1769
- if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
1770
- const index = ancestorComponent["s-p"].push(
1771
- new Promise(
1772
- (r) => hostRef.$onRenderResolve$ = () => {
1773
- ancestorComponent["s-p"].splice(index - 1, 1);
1774
- r();
1775
- }
1776
- )
1777
- );
1778
- }
1779
- };
1780
- var scheduleUpdate = (hostRef, isInitialLoad) => {
1781
- {
1782
- hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
1783
- }
1784
- if (hostRef.$flags$ & 4 /* isWaitingForChildren */) {
1785
- hostRef.$flags$ |= 512 /* needsRerender */;
1786
- return;
1787
- }
1788
- attachToAncestor(hostRef, hostRef.$ancestorComponent$);
1789
- const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
1790
- return writeTask(dispatch) ;
1791
- };
1792
- var dispatchHooks = (hostRef, isInitialLoad) => {
1793
- const elm = hostRef.$hostElement$;
1794
- const endSchedule = createTime("scheduleUpdate", hostRef.$cmpMeta$.$tagName$);
1795
- const instance = elm;
1796
- if (!instance) {
1797
- throw new Error(
1798
- `Can't render component <${elm.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`
1799
- );
1800
- }
1801
- let maybePromise;
1802
- if (isInitialLoad) {
1803
- maybePromise = safeCall(instance, "componentWillLoad", void 0, elm);
1804
- } else {
1805
- maybePromise = safeCall(instance, "componentWillUpdate", void 0, elm);
1806
- }
1807
- maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender", void 0, elm));
1808
- endSchedule();
1809
- return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
1810
- };
1811
- var enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then(fn).catch((err2) => {
1812
- console.error(err2);
1813
- fn();
1814
- }) : fn();
1815
- var isPromisey = (maybePromise) => maybePromise instanceof Promise || maybePromise && maybePromise.then && typeof maybePromise.then === "function";
1816
- var updateComponent = async (hostRef, instance, isInitialLoad) => {
1817
- var _a;
1818
- const elm = hostRef.$hostElement$;
1819
- const endUpdate = createTime("update", hostRef.$cmpMeta$.$tagName$);
1820
- const rc = elm["s-rc"];
1821
- if (isInitialLoad) {
1822
- attachStyles(hostRef);
1823
- }
1824
- const endRender = createTime("render", hostRef.$cmpMeta$.$tagName$);
1825
- {
1826
- callRender(hostRef, instance, elm, isInitialLoad);
1827
- }
1828
- if (rc) {
1829
- rc.map((cb) => cb());
1830
- elm["s-rc"] = void 0;
1831
- }
1832
- endRender();
1833
- endUpdate();
1834
- {
1835
- const childrenPromises = (_a = elm["s-p"]) != null ? _a : [];
1836
- const postUpdate = () => postUpdateComponent(hostRef);
1837
- if (childrenPromises.length === 0) {
1838
- postUpdate();
1839
- } else {
1840
- Promise.all(childrenPromises).then(postUpdate);
1841
- hostRef.$flags$ |= 4 /* isWaitingForChildren */;
1842
- childrenPromises.length = 0;
1843
- }
1844
- }
1845
- };
1846
- var callRender = (hostRef, instance, elm, isInitialLoad) => {
1847
- try {
1848
- instance = instance.render() ;
1849
- {
1850
- hostRef.$flags$ &= -17 /* isQueuedForUpdate */;
1851
- }
1852
- {
1853
- hostRef.$flags$ |= 2 /* hasRendered */;
1854
- }
1855
- {
1856
- {
1857
- {
1858
- renderVdom(hostRef, instance, isInitialLoad);
1859
- }
1860
- }
1861
- }
1862
- } catch (e) {
1863
- consoleError(e, hostRef.$hostElement$);
1864
- }
1865
- return null;
1866
- };
1867
- var postUpdateComponent = (hostRef) => {
1868
- const tagName = hostRef.$cmpMeta$.$tagName$;
1869
- const elm = hostRef.$hostElement$;
1870
- const endPostUpdate = createTime("postUpdate", tagName);
1871
- const instance = elm;
1872
- const ancestorComponent = hostRef.$ancestorComponent$;
1873
- safeCall(instance, "componentDidRender", void 0, elm);
1874
- if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
1875
- hostRef.$flags$ |= 64 /* hasLoadedComponent */;
1876
- {
1877
- addHydratedFlag(elm);
1878
- }
1879
- safeCall(instance, "componentDidLoad", void 0, elm);
1880
- endPostUpdate();
1881
- {
1882
- hostRef.$onReadyResolve$(elm);
1883
- if (!ancestorComponent) {
1884
- appDidLoad();
1885
- }
1886
- }
1887
- } else {
1888
- safeCall(instance, "componentDidUpdate", void 0, elm);
1889
- endPostUpdate();
1890
- }
1891
- {
1892
- if (hostRef.$onRenderResolve$) {
1893
- hostRef.$onRenderResolve$();
1894
- hostRef.$onRenderResolve$ = void 0;
1895
- }
1896
- if (hostRef.$flags$ & 512 /* needsRerender */) {
1897
- nextTick(() => scheduleUpdate(hostRef, false));
1898
- }
1899
- hostRef.$flags$ &= -517;
1900
- }
1901
- };
1902
- var appDidLoad = (who) => {
1903
- nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
1904
- };
1905
- var safeCall = (instance, method, arg, elm) => {
1906
- if (instance && instance[method]) {
1907
- try {
1908
- return instance[method](arg);
1909
- } catch (e) {
1910
- consoleError(e, elm);
1911
- }
1912
- }
1913
- return void 0;
1914
- };
1915
- var addHydratedFlag = (elm) => {
1916
- var _b;
1917
- return elm.setAttribute((_b = BUILD.hydratedSelectorName) != null ? _b : "hydrated", "") ;
1918
- };
1919
-
1920
- // src/runtime/set-value.ts
1921
- var getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
1922
- var setValue = (ref, propName, newVal, cmpMeta) => {
1923
- const hostRef = getHostRef(ref);
1924
- const elm = ref;
1925
- const oldVal = hostRef.$instanceValues$.get(propName);
1926
- const flags = hostRef.$flags$;
1927
- const instance = elm;
1928
- newVal = parsePropertyValue(
1929
- newVal,
1930
- cmpMeta.$members$[propName][0],
1931
- !!(cmpMeta.$flags$ & 64 /* formAssociated */)
1932
- );
1933
- const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
1934
- const didValueChange = newVal !== oldVal && !areBothNaN;
1935
- if (didValueChange) {
1936
- hostRef.$instanceValues$.set(propName, newVal);
1937
- {
1938
- if (cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
1939
- const watchMethods = cmpMeta.$watchers$[propName];
1940
- if (watchMethods) {
1941
- watchMethods.map((watchMethodName) => {
1942
- try {
1943
- instance[watchMethodName](newVal, oldVal, propName);
1944
- } catch (e) {
1945
- consoleError(e, elm);
1946
- }
1947
- });
1948
- }
1949
- }
1950
- if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
1951
- if (instance.componentShouldUpdate) {
1952
- if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
1953
- return;
1954
- }
1955
- }
1956
- scheduleUpdate(hostRef, false);
1957
- }
1958
- }
1959
- }
1960
- };
1961
-
1962
- // src/runtime/proxy-component.ts
1963
- var proxyComponent = (Cstr, cmpMeta, flags) => {
1964
- var _a, _b;
1965
- const prototype = Cstr.prototype;
1966
- if (cmpMeta.$flags$ & 64 /* formAssociated */ && flags & 1 /* isElementConstructor */) {
1967
- FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS.forEach((cbName) => {
1968
- const originalFormAssociatedCallback = prototype[cbName];
1969
- Object.defineProperty(prototype, cbName, {
1970
- value(...args) {
1971
- const hostRef = getHostRef(this);
1972
- const instance = this;
1973
- if (!instance) {
1974
- hostRef.$onReadyPromise$.then((asyncInstance) => {
1975
- const cb = asyncInstance[cbName];
1976
- typeof cb === "function" && cb.call(asyncInstance, ...args);
1977
- });
1978
- } else {
1979
- const cb = originalFormAssociatedCallback;
1980
- typeof cb === "function" && cb.call(instance, ...args);
1981
- }
1982
- }
1983
- });
1984
- });
1985
- }
1986
- if (cmpMeta.$members$ || (cmpMeta.$watchers$ || Cstr.watchers)) {
1987
- if (Cstr.watchers && !cmpMeta.$watchers$) {
1988
- cmpMeta.$watchers$ = Cstr.watchers;
1989
- }
1990
- const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
1991
- members.map(([memberName, [memberFlags]]) => {
1992
- if ((memberFlags & 31 /* Prop */ || memberFlags & 32 /* State */)) {
1993
- const { get: origGetter, set: origSetter } = Object.getOwnPropertyDescriptor(prototype, memberName) || {};
1994
- if (origGetter) cmpMeta.$members$[memberName][0] |= 2048 /* Getter */;
1995
- if (origSetter) cmpMeta.$members$[memberName][0] |= 4096 /* Setter */;
1996
- {
1997
- Object.defineProperty(prototype, memberName, {
1998
- get() {
1999
- {
2000
- return origGetter ? origGetter.apply(this) : getValue(this, memberName);
2001
- }
2002
- },
2003
- configurable: true,
2004
- enumerable: true
2005
- });
2006
- }
2007
- Object.defineProperty(prototype, memberName, {
2008
- set(newValue) {
2009
- const ref = getHostRef(this);
2010
- if (origSetter) {
2011
- const currentValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
2012
- if (typeof currentValue === "undefined" && ref.$instanceValues$.get(memberName)) {
2013
- newValue = ref.$instanceValues$.get(memberName);
2014
- } else if (!ref.$instanceValues$.get(memberName) && currentValue) {
2015
- ref.$instanceValues$.set(memberName, currentValue);
2016
- }
2017
- origSetter.apply(this, [
2018
- parsePropertyValue(
2019
- newValue,
2020
- memberFlags,
2021
- !!(cmpMeta.$flags$ & 64 /* formAssociated */)
2022
- )
2023
- ]);
2024
- newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
2025
- setValue(this, memberName, newValue, cmpMeta);
2026
- return;
2027
- }
2028
- {
2029
- setValue(this, memberName, newValue, cmpMeta);
2030
- return;
2031
- }
2032
- }
2033
- });
2034
- }
2035
- });
2036
- {
2037
- const attrNameToPropName = /* @__PURE__ */ new Map();
2038
- prototype.attributeChangedCallback = function(attrName, oldValue, newValue) {
2039
- plt.jmp(() => {
2040
- var _a2;
2041
- const propName = attrNameToPropName.get(attrName);
2042
- if (this.hasOwnProperty(propName) && BUILD.lazyLoad) ; else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
2043
- this[propName] == newValue) {
2044
- return;
2045
- } else if (propName == null) {
2046
- const hostRef = getHostRef(this);
2047
- const flags2 = hostRef == null ? void 0 : hostRef.$flags$;
2048
- if (flags2 && !(flags2 & 8 /* isConstructingInstance */) && flags2 & 128 /* isWatchReady */ && newValue !== oldValue) {
2049
- const elm = this;
2050
- const instance = elm;
2051
- const entry = (_a2 = cmpMeta.$watchers$) == null ? void 0 : _a2[attrName];
2052
- entry == null ? void 0 : entry.forEach((callbackName) => {
2053
- if (instance[callbackName] != null) {
2054
- instance[callbackName].call(instance, newValue, oldValue, attrName);
2055
- }
2056
- });
2057
- }
2058
- return;
2059
- }
2060
- const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
2061
- newValue = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
2062
- if (newValue !== this[propName] && (!propDesc.get || !!propDesc.set)) {
2063
- this[propName] = newValue;
2064
- }
2065
- });
2066
- };
2067
- Cstr.observedAttributes = Array.from(
2068
- /* @__PURE__ */ new Set([
2069
- ...Object.keys((_b = cmpMeta.$watchers$) != null ? _b : {}),
2070
- ...members.filter(([_, m]) => m[0] & 15 /* HasAttribute */).map(([propName, m]) => {
2071
- var _a2;
2072
- const attrName = m[1] || propName;
2073
- attrNameToPropName.set(attrName, propName);
2074
- if (m[0] & 512 /* ReflectAttr */) {
2075
- (_a2 = cmpMeta.$attrsToReflect$) == null ? void 0 : _a2.push([propName, attrName]);
2076
- }
2077
- return attrName;
2078
- })
2079
- ])
2080
- );
2081
- }
2082
- }
2083
- return Cstr;
2084
- };
2085
-
2086
- // src/runtime/initialize-component.ts
2087
- var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
2088
- let Cstr;
2089
- if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
2090
- hostRef.$flags$ |= 32 /* hasInitializedComponent */;
2091
- {
2092
- Cstr = elm.constructor;
2093
- const cmpTag = elm.localName;
2094
- customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
2095
- }
2096
- if (Cstr && Cstr.style) {
2097
- let style;
2098
- if (typeof Cstr.style === "string") {
2099
- style = Cstr.style;
2100
- }
2101
- const scopeId2 = getScopeId(cmpMeta);
2102
- if (!styles.has(scopeId2)) {
2103
- const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$);
2104
- registerStyle(scopeId2, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
2105
- endRegisterStyles();
2106
- }
2107
- }
2108
- }
2109
- const ancestorComponent = hostRef.$ancestorComponent$;
2110
- const schedule = () => scheduleUpdate(hostRef, true);
2111
- if (ancestorComponent && ancestorComponent["s-rc"]) {
2112
- ancestorComponent["s-rc"].push(schedule);
2113
- } else {
2114
- schedule();
2115
- }
2116
- };
2117
- var fireConnectedCallback = (instance, elm) => {
2118
- };
2119
-
2120
- // src/runtime/connected-callback.ts
2121
- var connectedCallback = (elm) => {
2122
- if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
2123
- const hostRef = getHostRef(elm);
2124
- const cmpMeta = hostRef.$cmpMeta$;
2125
- const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
2126
- if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
2127
- hostRef.$flags$ |= 1 /* hasConnected */;
2128
- let hostId;
2129
- {
2130
- hostId = elm.getAttribute(HYDRATE_ID);
2131
- if (hostId) {
2132
- if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2133
- const scopeId2 = addStyle(elm.shadowRoot, cmpMeta);
2134
- elm.classList.remove(scopeId2 + "-h", scopeId2 + "-s");
2135
- }
2136
- initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);
2137
- }
2138
- }
2139
- if (!hostId) {
2140
- if (// TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
2141
- cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */)) {
2142
- setContentReference(elm);
2143
- }
2144
- }
2145
- {
2146
- let ancestorComponent = elm;
2147
- while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
2148
- if (ancestorComponent.nodeType === 1 /* ElementNode */ && ancestorComponent.hasAttribute("s-id") && ancestorComponent["s-p"] || ancestorComponent["s-p"]) {
2149
- attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
2150
- break;
2151
- }
2152
- }
2153
- }
2154
- if (cmpMeta.$members$) {
2155
- Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
2156
- if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
2157
- const value = elm[memberName];
2158
- delete elm[memberName];
2159
- elm[memberName] = value;
2160
- }
2161
- });
2162
- }
2163
- if (BUILD.initializeNextTick) {
2164
- nextTick(() => initializeComponent(elm, hostRef, cmpMeta));
2165
- } else {
2166
- initializeComponent(elm, hostRef, cmpMeta);
2167
- }
2168
- } else {
2169
- addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
2170
- if (hostRef == null ? void 0 : hostRef.$lazyInstance$) ; else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
2171
- hostRef.$onReadyPromise$.then(() => fireConnectedCallback());
2172
- }
2173
- }
2174
- endConnected();
2175
- }
2176
- };
2177
- var setContentReference = (elm) => {
2178
- if (!win.document) {
2179
- return;
2180
- }
2181
- const contentRefElm = elm["s-cr"] = win.document.createComment(
2182
- ""
2183
- );
2184
- contentRefElm["s-cn"] = true;
2185
- insertBefore(elm, contentRefElm, elm.firstChild);
2186
- };
2187
- var disconnectedCallback = async (elm) => {
2188
- if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
2189
- const hostRef = getHostRef(elm);
2190
- {
2191
- if (hostRef.$rmListeners$) {
2192
- hostRef.$rmListeners$.map((rmListener) => rmListener());
2193
- hostRef.$rmListeners$ = void 0;
2194
- }
2195
- }
2196
- }
2197
- if (rootAppliedStyles.has(elm)) {
2198
- rootAppliedStyles.delete(elm);
2199
- }
2200
- if (elm.shadowRoot && rootAppliedStyles.has(elm.shadowRoot)) {
2201
- rootAppliedStyles.delete(elm.shadowRoot);
2202
- }
2203
- };
2204
- var proxyCustomElement = (Cstr, compactMeta) => {
2205
- const cmpMeta = {
2206
- $flags$: compactMeta[0],
2207
- $tagName$: compactMeta[1]
2208
- };
2209
- {
2210
- cmpMeta.$members$ = compactMeta[2];
2211
- }
2212
- {
2213
- cmpMeta.$listeners$ = compactMeta[3];
2214
- }
2215
- {
2216
- cmpMeta.$watchers$ = Cstr.$watchers$;
2217
- }
2218
- {
2219
- cmpMeta.$attrsToReflect$ = [];
2220
- }
2221
- {
2222
- hydrateScopedToShadow();
2223
- }
2224
- const originalConnectedCallback = Cstr.prototype.connectedCallback;
2225
- const originalDisconnectedCallback = Cstr.prototype.disconnectedCallback;
2226
- Object.assign(Cstr.prototype, {
2227
- __hasHostListenerAttached: false,
2228
- __registerHost() {
2229
- registerHost(this, cmpMeta);
2230
- },
2231
- connectedCallback() {
2232
- if (!this.__hasHostListenerAttached) {
2233
- const hostRef = getHostRef(this);
2234
- addHostEventListeners(this, hostRef, cmpMeta.$listeners$);
2235
- this.__hasHostListenerAttached = true;
2236
- }
2237
- connectedCallback(this);
2238
- if (originalConnectedCallback) {
2239
- originalConnectedCallback.call(this);
2240
- }
2241
- },
2242
- disconnectedCallback() {
2243
- disconnectedCallback(this);
2244
- if (originalDisconnectedCallback) {
2245
- originalDisconnectedCallback.call(this);
2246
- }
2247
- },
2248
- __attachShadow() {
2249
- {
2250
- if (!this.shadowRoot) {
2251
- createShadowRoot.call(this, cmpMeta);
2252
- } else {
2253
- if (this.shadowRoot.mode !== "open") {
2254
- throw new Error(
2255
- `Unable to re-use existing shadow root for ${cmpMeta.$tagName$}! Mode is set to ${this.shadowRoot.mode} but Stencil only supports open shadow roots.`
2256
- );
2257
- }
2258
- }
2259
- }
2260
- }
2261
- });
2262
- Cstr.is = cmpMeta.$tagName$;
2263
- return proxyComponent(Cstr, cmpMeta, 1 /* isElementConstructor */ | 2 /* proxyState */);
2264
- };
2265
- var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
2266
- if (listeners && win.document) {
2267
- listeners.map(([flags, name, method]) => {
2268
- const target = getHostListenerTarget(win.document, elm, flags) ;
2269
- const handler = hostListenerProxy(hostRef, method);
2270
- const opts = hostListenerOpts(flags);
2271
- plt.ael(target, name, handler, opts);
2272
- (hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
2273
- });
2274
- }
2275
- };
2276
- var hostListenerProxy = (hostRef, methodName) => (ev) => {
2277
- try {
2278
- {
2279
- hostRef.$hostElement$[methodName](ev);
2280
- }
2281
- } catch (e) {
2282
- consoleError(e, hostRef.$hostElement$);
2283
- }
2284
- };
2285
- var getHostListenerTarget = (doc, elm, flags) => {
2286
- if (flags & 8 /* TargetWindow */) {
2287
- return win;
2288
- }
2289
- return elm;
2290
- };
2291
- var hostListenerOpts = (flags) => supportsListenerOptions ? {
2292
- passive: (flags & 1 /* Passive */) !== 0,
2293
- capture: (flags & 2 /* Capture */) !== 0
2294
- } : (flags & 2 /* Capture */) !== 0;
2295
-
2296
- // src/runtime/nonce.ts
2297
- var setNonce = (nonce) => plt.$nonce$ = nonce;
2298
-
2299
- // src/runtime/platform-options.ts
2300
- var setPlatformOptions = (opts) => Object.assign(plt, opts);
2301
-
2302
- // src/runtime/render.ts
2303
- function render(vnode, container) {
2304
- const cmpMeta = {
2305
- $flags$: 0,
2306
- $tagName$: container.tagName
2307
- };
2308
- const ref = {
2309
- $cmpMeta$: cmpMeta,
2310
- $hostElement$: container
2311
- };
2312
- renderVdom(ref, vnode);
2313
- }
2314
-
2315
- export { H, Host as a, createEvent as c, getAssetPath, h, proxyCustomElement as p, render, setAssetPath, setNonce, setPlatformOptions };
1
+ export { getAssetPath, render, setAssetPath, setNonce, setPlatformOptions } from '@stencil/core/internal/client';
2
+ export { PostAccordion, defineCustomElement as defineCustomElementPostAccordion } from './post-accordion.js';
3
+ export { PostAccordionItem, defineCustomElement as defineCustomElementPostAccordionItem } from './post-accordion-item.js';
4
+ export { PostAvatar, defineCustomElement as defineCustomElementPostAvatar } from './post-avatar.js';
5
+ export { PostBackToTop, defineCustomElement as defineCustomElementPostBackToTop } from './post-back-to-top.js';
6
+ export { PostBanner, defineCustomElement as defineCustomElementPostBanner } from './post-banner.js';
7
+ export { PostBreadcrumbItem, defineCustomElement as defineCustomElementPostBreadcrumbItem } from './post-breadcrumb-item.js';
8
+ export { PostBreadcrumbs, defineCustomElement as defineCustomElementPostBreadcrumbs } from './post-breadcrumbs.js';
9
+ export { PostCardControl, defineCustomElement as defineCustomElementPostCardControl } from './post-card-control.js';
10
+ export { PostClosebutton, defineCustomElement as defineCustomElementPostClosebutton } from './post-closebutton.js';
11
+ export { PostCollapsible, defineCustomElement as defineCustomElementPostCollapsible } from './post-collapsible.js';
12
+ export { PostCollapsibleTrigger, defineCustomElement as defineCustomElementPostCollapsibleTrigger } from './post-collapsible-trigger.js';
13
+ export { PostFooter, defineCustomElement as defineCustomElementPostFooter } from './post-footer.js';
14
+ export { PostHeader, defineCustomElement as defineCustomElementPostHeader } from './post-header.js';
15
+ export { PostIcon, defineCustomElement as defineCustomElementPostIcon } from './post-icon.js';
16
+ export { PostLanguageOption, defineCustomElement as defineCustomElementPostLanguageOption } from './post-language-option.js';
17
+ export { PostLanguageSwitch, defineCustomElement as defineCustomElementPostLanguageSwitch } from './post-language-switch.js';
18
+ export { PostLinkarea, defineCustomElement as defineCustomElementPostLinkarea } from './post-linkarea.js';
19
+ export { PostList, defineCustomElement as defineCustomElementPostList } from './post-list.js';
20
+ export { PostListItem, defineCustomElement as defineCustomElementPostListItem } from './post-list-item.js';
21
+ export { PostLogo, defineCustomElement as defineCustomElementPostLogo } from './post-logo.js';
22
+ export { PostMainnavigation, defineCustomElement as defineCustomElementPostMainnavigation } from './post-mainnavigation.js';
23
+ export { PostMegadropdown, defineCustomElement as defineCustomElementPostMegadropdown } from './post-megadropdown.js';
24
+ export { PostMegadropdownTrigger, defineCustomElement as defineCustomElementPostMegadropdownTrigger } from './post-megadropdown-trigger.js';
25
+ export { PostMenu, defineCustomElement as defineCustomElementPostMenu } from './post-menu.js';
26
+ export { PostMenuItem, defineCustomElement as defineCustomElementPostMenuItem } from './post-menu-item.js';
27
+ export { PostMenuTrigger, defineCustomElement as defineCustomElementPostMenuTrigger } from './post-menu-trigger.js';
28
+ export { PostPopover, defineCustomElement as defineCustomElementPostPopover } from './post-popover.js';
29
+ export { PostPopovercontainer, defineCustomElement as defineCustomElementPostPopovercontainer } from './post-popovercontainer.js';
30
+ export { PostRating, defineCustomElement as defineCustomElementPostRating } from './post-rating.js';
31
+ export { PostTabHeader, defineCustomElement as defineCustomElementPostTabHeader } from './post-tab-header.js';
32
+ export { PostTabPanel, defineCustomElement as defineCustomElementPostTabPanel } from './post-tab-panel.js';
33
+ export { PostTabs, defineCustomElement as defineCustomElementPostTabs } from './post-tabs.js';
34
+ export { PostTogglebutton, defineCustomElement as defineCustomElementPostTogglebutton } from './post-togglebutton.js';
35
+ export { PostTooltip, defineCustomElement as defineCustomElementPostTooltip } from './post-tooltip.js';
36
+ export { PostTooltipTrigger, defineCustomElement as defineCustomElementPostTooltipTrigger } from './post-tooltip-trigger.js';