@ionic/core 8.7.18-dev.11771020096.1ca03a6d → 8.7.18-dev.11772037614.10c71570

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 (351) hide show
  1. package/components/index.js +13 -14
  2. package/components/ion-accordion-group.js +3 -4
  3. package/components/ion-accordion.js +6 -7
  4. package/components/ion-action-sheet.js +1 -1
  5. package/components/ion-alert.js +1 -1
  6. package/components/ion-app.js +26 -22
  7. package/components/ion-avatar.js +3 -3
  8. package/components/ion-back-button.js +8 -9
  9. package/components/ion-backdrop.js +1 -1
  10. package/components/ion-badge.js +4 -4
  11. package/components/ion-breadcrumb.js +7 -7
  12. package/components/ion-breadcrumbs.js +4 -4
  13. package/components/ion-button.js +1 -1
  14. package/components/ion-buttons.js +1 -1
  15. package/components/ion-card-content.js +3 -3
  16. package/components/ion-card-header.js +4 -4
  17. package/components/ion-card-subtitle.js +4 -4
  18. package/components/ion-card-title.js +4 -4
  19. package/components/ion-card.js +6 -6
  20. package/components/ion-checkbox.js +1 -1
  21. package/components/ion-chip.js +5 -5
  22. package/components/ion-col.js +3 -3
  23. package/components/ion-content.js +1 -1
  24. package/components/ion-datetime-button.js +7 -8
  25. package/components/ion-datetime.js +26 -24
  26. package/components/ion-fab-button.js +8 -8
  27. package/components/ion-fab-list.js +13 -6
  28. package/components/ion-fab.js +3 -3
  29. package/components/ion-footer.js +6 -6
  30. package/components/ion-grid.js +3 -3
  31. package/components/ion-header.js +1 -1
  32. package/components/ion-icon.js +1 -1
  33. package/components/ion-img.js +15 -6
  34. package/components/ion-infinite-scroll-content.js +5 -6
  35. package/components/ion-infinite-scroll.js +4 -4
  36. package/components/ion-input-otp.js +6 -7
  37. package/components/ion-input-password-toggle.js +8 -9
  38. package/components/ion-input.js +13 -13
  39. package/components/ion-item-divider.js +6 -6
  40. package/components/ion-item-group.js +4 -4
  41. package/components/ion-item-option.js +7 -7
  42. package/components/ion-item-options.js +5 -5
  43. package/components/ion-item-sliding.js +8 -9
  44. package/components/ion-item.js +1 -1
  45. package/components/ion-label.js +1 -1
  46. package/components/ion-list-header.js +1 -1
  47. package/components/ion-list.js +1 -1
  48. package/components/ion-loading.js +13 -14
  49. package/components/ion-menu-button.js +12 -13
  50. package/components/ion-menu-toggle.js +7 -7
  51. package/components/ion-menu.js +14 -18
  52. package/components/ion-modal.js +1 -1
  53. package/components/ion-nav-link.js +3 -3
  54. package/components/ion-nav.js +9 -14
  55. package/components/ion-note.js +6 -6
  56. package/components/ion-picker-column-option.js +1 -1
  57. package/components/ion-picker-column.js +1 -1
  58. package/components/ion-picker-legacy-column.js +1 -1
  59. package/components/ion-picker-legacy.js +12 -13
  60. package/components/ion-picker.js +1 -1
  61. package/components/ion-popover.js +1 -1
  62. package/components/ion-progress-bar.js +6 -7
  63. package/components/ion-radio-group.js +1 -1
  64. package/components/ion-radio.js +1 -1
  65. package/components/ion-range.js +11 -12
  66. package/components/ion-refresher-content.js +9 -10
  67. package/components/ion-refresher.js +12 -13
  68. package/components/ion-reorder-group.js +8 -8
  69. package/components/ion-reorder.js +6 -6
  70. package/components/ion-ripple-effect.js +1 -1
  71. package/components/ion-route-redirect.js +2 -2
  72. package/components/ion-route.js +2 -2
  73. package/components/ion-router-link.js +6 -6
  74. package/components/ion-router-outlet.js +10 -11
  75. package/components/ion-router.js +3 -4
  76. package/components/ion-row.js +4 -4
  77. package/components/ion-searchbar.js +25 -15
  78. package/components/ion-segment-button.js +8 -9
  79. package/components/ion-segment-content.js +3 -3
  80. package/components/ion-segment-view.js +5 -5
  81. package/components/ion-segment.js +9 -9
  82. package/components/ion-select-modal.js +1 -1
  83. package/components/ion-select-option.js +4 -4
  84. package/components/ion-select-popover.js +1 -1
  85. package/components/ion-select.js +36 -37
  86. package/components/ion-skeleton-text.js +6 -7
  87. package/components/ion-spinner.js +1 -1
  88. package/components/ion-split-pane.js +5 -12
  89. package/components/ion-tab-bar.js +7 -7
  90. package/components/ion-tab-button.js +7 -8
  91. package/components/ion-tab.js +5 -14
  92. package/components/ion-tabs.js +3 -4
  93. package/components/ion-text.js +6 -6
  94. package/components/ion-textarea.js +13 -13
  95. package/components/ion-thumbnail.js +4 -4
  96. package/components/ion-title.js +1 -1
  97. package/components/ion-toast.js +17 -20
  98. package/components/ion-toggle.js +15 -16
  99. package/components/ion-toolbar.js +1 -1
  100. package/components/{list.js → p-B25GjpND.js} +3 -3
  101. package/components/{radio-group.js → p-BANeLH_G.js} +9 -9
  102. package/components/{buttons.js → p-BBFQmhcD.js} +3 -3
  103. package/components/{index5.js → p-BC-awmYt.js} +6 -6
  104. package/components/{picker.js → p-BHbOsu99.js} +3 -3
  105. package/components/{title.js → p-BTlwXR9e.js} +6 -6
  106. package/components/{alert.js → p-BcazQttQ.js} +12 -13
  107. package/components/{spinner.js → p-BdGshsIJ.js} +5 -6
  108. package/components/{input.utils.js → p-BfS7vSpC.js} +3 -3
  109. package/components/{ios.transition.js → p-BhRFCLuX.js} +2 -2
  110. package/components/{backdrop.js → p-Bhnhnzjz.js} +3 -3
  111. package/components/{notch-controller.js → p-BmcqD0EN.js} +2 -2
  112. package/components/{hardware-back-button.js → p-Boi6hecl.js} +2 -2
  113. package/components/{radio.js → p-Bt_moUyl.js} +8 -8
  114. package/components/{ionic-global.js → p-Bxl5etF4.js} +1 -2
  115. package/components/{picker-column-option.js → p-ByjmWt3s.js} +7 -7
  116. package/components/{md.transition.js → p-C04oPyjT.js} +2 -2
  117. package/components/{popover.js → p-C6dkQWq2.js} +13 -14
  118. package/components/{select-modal.js → p-CFZWrvIQ.js} +19 -19
  119. package/components/{capacitor.js → p-CIGNaXM1.js} +1 -1
  120. package/components/{config.js → p-CIJwkzL6.js} +1 -1
  121. package/components/{animation.js → p-CL12ApCQ.js} +2 -2
  122. package/components/{action-sheet.js → p-CXJR56Oq.js} +12 -12
  123. package/components/{label.js → p-Cdm3dKWf.js} +12 -7
  124. package/components/{index3.js → p-Cl0B-RWe.js} +1 -1
  125. package/components/{select-popover.js → p-CslsoGzv.js} +15 -15
  126. package/components/{keyboard-controller.js → p-CtWGkNnJ.js} +2 -2
  127. package/components/{index7.js → p-Cyd00tgZ.js} +2 -2
  128. package/components/{picker-column2.js → p-CzAJ3ArC.js} +9 -9
  129. package/components/{menu-toggle-util.js → p-CzW34QBh.js} +1 -1
  130. package/components/{refresher.utils.js → p-D0zXRwcr.js} +3 -3
  131. package/components/{keyboard2.js → p-D13Eaw-8.js} +1 -1
  132. package/components/{helpers.js → p-D5hF6rwn.js} +1 -1
  133. package/components/{keyboard.js → p-D6Ynv7Xh.js} +1 -1
  134. package/components/{button-active.js → p-D8eD2iBA.js} +3 -3
  135. package/components/{content.js → p-DGOrLIyS.js} +14 -10
  136. package/components/{button.js → p-DK2Bn1Mc.js} +6 -7
  137. package/components/{picker-column.js → p-DKRQWlK2.js} +7 -7
  138. package/components/{index8.js → p-DNDUsygf.js} +2 -2
  139. package/components/{index2.js → p-DTWZF6wg.js} +4 -5
  140. package/components/p-DWoUQeZ3.js +3012 -0
  141. package/components/{header.js → p-DX0w75a9.js} +6 -6
  142. package/components/{toolbar.js → p-Dt8zaCLQ.js} +6 -6
  143. package/components/{checkbox.js → p-DyFBFrV7.js} +7 -7
  144. package/components/{status-tap.js → p-DyHPCMyn.js} +3 -3
  145. package/components/{ripple-effect.js → p-LgLeKTkH.js} +4 -4
  146. package/components/{list-header.js → p-NhiRFRn9.js} +6 -6
  147. package/components/{input-shims.js → p-OuiHmXO5.js} +4 -4
  148. package/components/{icon.js → p-Wro9IPHE.js} +6 -6
  149. package/components/{item.js → p-aIWC4ZEV.js} +8 -8
  150. package/components/{overlays.js → p-c-XJ9XhZ.js} +7 -7
  151. package/components/{haptic.js → p-cyNmxje6.js} +1 -1
  152. package/components/{swipe-back.js → p-fVuFT3Wd.js} +3 -3
  153. package/components/{modal.js → p-iyo0Toaz.js} +22 -23
  154. package/components/{framework-delegate.js → p-l_lso3Zl.js} +1 -1
  155. package/components/{data.js → p-mQp4lwQD.js} +2 -2
  156. package/dist/cjs/ion-app_8.cjs.entry.js +27 -18
  157. package/dist/cjs/ion-avatar_3.cjs.entry.js +1 -1
  158. package/dist/cjs/ion-col_3.cjs.entry.js +1 -1
  159. package/dist/cjs/ion-datetime_3.cjs.entry.js +11 -8
  160. package/dist/cjs/ion-fab_3.cjs.entry.js +10 -3
  161. package/dist/cjs/ion-img.cjs.entry.js +11 -2
  162. package/dist/cjs/ion-item-option_3.cjs.entry.js +4 -4
  163. package/dist/cjs/ion-item_8.cjs.entry.js +17 -12
  164. package/dist/cjs/ion-loading.cjs.entry.js +2 -2
  165. package/dist/cjs/ion-menu_3.cjs.entry.js +6 -6
  166. package/dist/cjs/ion-modal.cjs.entry.js +4 -4
  167. package/dist/cjs/ion-nav_2.cjs.entry.js +2 -2
  168. package/dist/cjs/ion-picker-column-option.cjs.entry.js +2 -2
  169. package/dist/cjs/ion-popover.cjs.entry.js +2 -2
  170. package/dist/cjs/ion-progress-bar.cjs.entry.js +1 -1
  171. package/dist/cjs/ion-radio_2.cjs.entry.js +6 -6
  172. package/dist/cjs/ion-range.cjs.entry.js +3 -3
  173. package/dist/cjs/ion-refresher_2.cjs.entry.js +2 -2
  174. package/dist/cjs/ion-reorder_2.cjs.entry.js +2 -2
  175. package/dist/cjs/ion-ripple-effect.cjs.entry.js +1 -1
  176. package/dist/cjs/ion-route_4.cjs.entry.js +2 -2
  177. package/dist/cjs/ion-searchbar.cjs.entry.js +17 -6
  178. package/dist/cjs/ion-segment-content.cjs.entry.js +1 -1
  179. package/dist/cjs/ion-segment-view.cjs.entry.js +2 -2
  180. package/dist/cjs/ion-segment_2.cjs.entry.js +4 -4
  181. package/dist/cjs/ion-select-modal.cjs.entry.js +1 -1
  182. package/dist/cjs/ion-select_3.cjs.entry.js +4 -4
  183. package/dist/cjs/ion-spinner.cjs.entry.js +1 -1
  184. package/dist/cjs/ion-split-pane.cjs.entry.js +2 -2
  185. package/dist/cjs/ion-tab-bar_2.cjs.entry.js +4 -4
  186. package/dist/cjs/ion-tab_2.cjs.entry.js +3 -3
  187. package/dist/cjs/ion-text.cjs.entry.js +2 -2
  188. package/dist/cjs/ion-textarea.cjs.entry.js +2 -2
  189. package/dist/cjs/ion-toast.cjs.entry.js +2 -2
  190. package/dist/cjs/ion-toggle.cjs.entry.js +3 -3
  191. package/dist/collection/components/app/app.js +15 -10
  192. package/dist/collection/components/content/content.js +7 -3
  193. package/dist/collection/components/datetime/datetime.ios.css +2 -4
  194. package/dist/collection/components/datetime/datetime.js +6 -3
  195. package/dist/collection/components/fab-list/fab-list.js +10 -3
  196. package/dist/collection/components/img/img.js +11 -2
  197. package/dist/collection/components/item-divider/item-divider.js +2 -2
  198. package/dist/collection/components/item-group/item-group.js +1 -1
  199. package/dist/collection/components/item-option/item-option.js +2 -2
  200. package/dist/collection/components/item-options/item-options.js +1 -1
  201. package/dist/collection/components/item-sliding/item-sliding.js +1 -1
  202. package/dist/collection/components/label/label.js +8 -3
  203. package/dist/collection/components/list-header/list-header.js +2 -2
  204. package/dist/collection/components/loading/loading.js +2 -2
  205. package/dist/collection/components/menu/menu.js +2 -2
  206. package/dist/collection/components/menu-button/menu-button.js +2 -2
  207. package/dist/collection/components/menu-toggle/menu-toggle.js +2 -2
  208. package/dist/collection/components/modal/modal.js +4 -4
  209. package/dist/collection/components/nav/nav.js +1 -1
  210. package/dist/collection/components/nav-link/nav-link.js +1 -1
  211. package/dist/collection/components/note/note.js +2 -2
  212. package/dist/collection/components/picker-column-option/picker-column-option.js +2 -2
  213. package/dist/collection/components/picker-legacy/picker.js +2 -2
  214. package/dist/collection/components/picker-legacy-column/picker-column.js +2 -2
  215. package/dist/collection/components/popover/popover.js +2 -2
  216. package/dist/collection/components/progress-bar/progress-bar.js +1 -1
  217. package/dist/collection/components/radio/radio.js +3 -3
  218. package/dist/collection/components/radio-group/radio-group.ios.css +0 -4
  219. package/dist/collection/components/radio-group/radio-group.js +1 -1
  220. package/dist/collection/components/radio-group/radio-group.md.css +0 -4
  221. package/dist/collection/components/range/range.js +3 -3
  222. package/dist/collection/components/refresher/refresher.js +1 -1
  223. package/dist/collection/components/refresher-content/refresher-content.js +1 -1
  224. package/dist/collection/components/reorder/reorder.js +1 -1
  225. package/dist/collection/components/reorder-group/reorder-group.js +1 -1
  226. package/dist/collection/components/ripple-effect/ripple-effect.js +1 -1
  227. package/dist/collection/components/router-link/router-link.js +2 -2
  228. package/dist/collection/components/router-outlet/router-outlet.js +1 -1
  229. package/dist/collection/components/row/row.js +1 -1
  230. package/dist/collection/components/searchbar/searchbar.js +17 -6
  231. package/dist/collection/components/segment/segment.js +2 -2
  232. package/dist/collection/components/segment-button/segment-button.js +2 -2
  233. package/dist/collection/components/segment-content/segment-content.js +1 -1
  234. package/dist/collection/components/segment-view/segment-view.js +2 -2
  235. package/dist/collection/components/select/select.js +2 -2
  236. package/dist/collection/components/select-modal/select-modal.js +1 -1
  237. package/dist/collection/components/select-option/select-option.js +1 -1
  238. package/dist/collection/components/select-popover/select-popover.js +1 -1
  239. package/dist/collection/components/skeleton-text/skeleton-text.js +2 -2
  240. package/dist/collection/components/spinner/spinner.js +1 -1
  241. package/dist/collection/components/split-pane/split-pane.js +2 -2
  242. package/dist/collection/components/tab/tab.js +2 -2
  243. package/dist/collection/components/tab-bar/tab-bar.js +2 -2
  244. package/dist/collection/components/tab-button/tab-button.js +2 -2
  245. package/dist/collection/components/tabs/tabs.js +1 -1
  246. package/dist/collection/components/text/text.js +2 -2
  247. package/dist/collection/components/textarea/textarea.js +2 -2
  248. package/dist/collection/components/thumbnail/thumbnail.js +1 -1
  249. package/dist/collection/components/title/title.js +2 -2
  250. package/dist/collection/components/toast/toast.js +2 -2
  251. package/dist/collection/components/toggle/toggle.js +3 -3
  252. package/dist/collection/components/toolbar/toolbar.js +2 -2
  253. package/dist/docs.json +1 -1
  254. package/dist/esm/ion-app_8.entry.js +29 -20
  255. package/dist/esm/ion-avatar_3.entry.js +1 -1
  256. package/dist/esm/ion-col_3.entry.js +1 -1
  257. package/dist/esm/ion-datetime_3.entry.js +11 -8
  258. package/dist/esm/ion-fab_3.entry.js +10 -3
  259. package/dist/esm/ion-img.entry.js +11 -2
  260. package/dist/esm/ion-item-option_3.entry.js +4 -4
  261. package/dist/esm/ion-item_8.entry.js +17 -12
  262. package/dist/esm/ion-loading.entry.js +2 -2
  263. package/dist/esm/ion-menu_3.entry.js +6 -6
  264. package/dist/esm/ion-modal.entry.js +4 -4
  265. package/dist/esm/ion-nav_2.entry.js +2 -2
  266. package/dist/esm/ion-picker-column-option.entry.js +2 -2
  267. package/dist/esm/ion-popover.entry.js +2 -2
  268. package/dist/esm/ion-progress-bar.entry.js +1 -1
  269. package/dist/esm/ion-radio_2.entry.js +6 -6
  270. package/dist/esm/ion-range.entry.js +3 -3
  271. package/dist/esm/ion-refresher_2.entry.js +2 -2
  272. package/dist/esm/ion-reorder_2.entry.js +2 -2
  273. package/dist/esm/ion-ripple-effect.entry.js +1 -1
  274. package/dist/esm/ion-route_4.entry.js +2 -2
  275. package/dist/esm/ion-searchbar.entry.js +17 -6
  276. package/dist/esm/ion-segment-content.entry.js +1 -1
  277. package/dist/esm/ion-segment-view.entry.js +2 -2
  278. package/dist/esm/ion-segment_2.entry.js +4 -4
  279. package/dist/esm/ion-select-modal.entry.js +1 -1
  280. package/dist/esm/ion-select_3.entry.js +4 -4
  281. package/dist/esm/ion-spinner.entry.js +1 -1
  282. package/dist/esm/ion-split-pane.entry.js +2 -2
  283. package/dist/esm/ion-tab-bar_2.entry.js +4 -4
  284. package/dist/esm/ion-tab_2.entry.js +3 -3
  285. package/dist/esm/ion-text.entry.js +2 -2
  286. package/dist/esm/ion-textarea.entry.js +2 -2
  287. package/dist/esm/ion-toast.entry.js +2 -2
  288. package/dist/esm/ion-toggle.entry.js +3 -3
  289. package/dist/ionic/ionic.esm.js +1 -1
  290. package/dist/ionic/p-0ca0fe9c.entry.js +4 -0
  291. package/dist/ionic/{p-316c0420.entry.js → p-221a3d8c.entry.js} +1 -1
  292. package/dist/ionic/{p-3a6caca9.entry.js → p-2668188b.entry.js} +1 -1
  293. package/dist/ionic/{p-4e41ea20.entry.js → p-2ac254dc.entry.js} +1 -1
  294. package/dist/ionic/{p-d3014190.entry.js → p-2bd1ea35.entry.js} +1 -1
  295. package/dist/ionic/{p-a127bee2.entry.js → p-30333874.entry.js} +1 -1
  296. package/dist/ionic/{p-0e8c8a10.entry.js → p-31db96da.entry.js} +1 -1
  297. package/dist/ionic/{p-1647c46c.entry.js → p-363d1209.entry.js} +1 -1
  298. package/dist/ionic/{p-db82892c.entry.js → p-46a38cfd.entry.js} +1 -1
  299. package/dist/ionic/{p-eb024a5b.entry.js → p-4eec1a5e.entry.js} +1 -1
  300. package/dist/ionic/{p-0dfa5a37.entry.js → p-530fcd71.entry.js} +1 -1
  301. package/dist/ionic/{p-72c38b88.entry.js → p-5c8f7253.entry.js} +1 -1
  302. package/dist/ionic/{p-172a579f.entry.js → p-5d6fb6e3.entry.js} +1 -1
  303. package/dist/ionic/{p-dbbe606a.entry.js → p-652318c3.entry.js} +1 -1
  304. package/dist/ionic/{p-2a939845.entry.js → p-6f37536a.entry.js} +1 -1
  305. package/dist/ionic/p-7cad388a.entry.js +4 -0
  306. package/dist/ionic/p-7f98e710.entry.js +4 -0
  307. package/dist/ionic/{p-6d070558.entry.js → p-82d5bb3d.entry.js} +1 -1
  308. package/dist/ionic/p-906bb44d.entry.js +4 -0
  309. package/dist/ionic/{p-cc3446d5.entry.js → p-915b3e3d.entry.js} +1 -1
  310. package/dist/ionic/{p-2dbb90cb.entry.js → p-97eb0812.entry.js} +1 -1
  311. package/dist/ionic/p-9b6d46f2.entry.js +4 -0
  312. package/dist/ionic/{p-31f7095f.entry.js → p-a4a9f5ae.entry.js} +1 -1
  313. package/dist/ionic/{p-6241ce47.entry.js → p-b0ebf9f8.entry.js} +1 -1
  314. package/dist/ionic/{p-86f53961.entry.js → p-b8551510.entry.js} +1 -1
  315. package/dist/ionic/{p-d126e8d3.entry.js → p-bce86e56.entry.js} +1 -1
  316. package/dist/ionic/{p-02d76786.entry.js → p-be263062.entry.js} +1 -1
  317. package/dist/ionic/{p-639dd543.entry.js → p-c175d792.entry.js} +1 -1
  318. package/dist/ionic/{p-020af078.entry.js → p-cc2a9936.entry.js} +1 -1
  319. package/dist/ionic/p-e4c57008.entry.js +4 -0
  320. package/dist/ionic/{p-3e69999d.entry.js → p-e5d6d0f0.entry.js} +1 -1
  321. package/dist/ionic/p-f1dfee25.entry.js +4 -0
  322. package/dist/ionic/{p-6444c606.entry.js → p-f9f7b9db.entry.js} +1 -1
  323. package/dist/ionic/{p-f8f22cc0.entry.js → p-fb0271ae.entry.js} +1 -1
  324. package/dist/ionic/{p-370e4237.entry.js → p-fbb00634.entry.js} +1 -1
  325. package/dist/types/components/app/app.d.ts +3 -0
  326. package/dist/types/components/datetime/datetime.d.ts +1 -0
  327. package/dist/types/components/fab-list/fab-list.d.ts +2 -0
  328. package/dist/types/components/img/img.d.ts +2 -0
  329. package/dist/types/components/label/label.d.ts +2 -0
  330. package/dist/types/components/searchbar/searchbar.d.ts +3 -0
  331. package/hydrate/index.js +164 -112
  332. package/hydrate/index.mjs +164 -112
  333. package/package.json +1 -1
  334. package/components/index4.js +0 -121
  335. package/dist/ionic/p-074839fc.entry.js +0 -4
  336. package/dist/ionic/p-1ccd6829.entry.js +0 -4
  337. package/dist/ionic/p-46d74291.entry.js +0 -4
  338. package/dist/ionic/p-51a60e0f.entry.js +0 -4
  339. package/dist/ionic/p-94de5cfa.entry.js +0 -4
  340. package/dist/ionic/p-c19af093.entry.js +0 -4
  341. package/dist/ionic/p-dd1aef77.entry.js +0 -4
  342. /package/components/{lock-controller.js → p-B-hirT0v.js} +0 -0
  343. /package/components/{gesture-controller.js → p-BTEOs1at.js} +0 -0
  344. /package/components/{focus-visible.js → p-BmVRXR1y.js} +0 -0
  345. /package/components/{dir.js → p-C53feagD.js} +0 -0
  346. /package/components/{index6.js → p-CO7fmmxt.js} +0 -0
  347. /package/components/{validity.js → p-DJztqcrH.js} +0 -0
  348. /package/components/{theme.js → p-DiVJyqlX.js} +0 -0
  349. /package/components/{watch-options.js → p-Dtdm8lKC.js} +0 -0
  350. /package/components/{index9.js → p-ZjP4CjeZ.js} +0 -0
  351. /package/components/{cubic-bezier.js → p-hHmYLOfE.js} +0 -0
@@ -0,0 +1,3012 @@
1
+ /*!
2
+ * (C) Ionic http://ionicframework.com - MIT License
3
+ */
4
+ const NAMESPACE = 'ionic';
5
+ const BUILD = /* ionic */ { experimentalSlotFixes: true, hydratedSelectorName: "hydrated", lazyLoad: false, shadowDom: true, slotRelocation: true, updatable: true};
6
+
7
+ // TODO(FW-2832): types
8
+ class Config {
9
+ constructor() {
10
+ this.m = new Map();
11
+ }
12
+ reset(configObj) {
13
+ this.m = new Map(Object.entries(configObj));
14
+ }
15
+ get(key, fallback) {
16
+ const value = this.m.get(key);
17
+ return value !== undefined ? value : fallback;
18
+ }
19
+ getBoolean(key, fallback = false) {
20
+ const val = this.m.get(key);
21
+ if (val === undefined) {
22
+ return fallback;
23
+ }
24
+ if (typeof val === 'string') {
25
+ return val === 'true';
26
+ }
27
+ return !!val;
28
+ }
29
+ getNumber(key, fallback) {
30
+ const val = parseFloat(this.m.get(key));
31
+ return isNaN(val) ? (fallback !== undefined ? fallback : NaN) : val;
32
+ }
33
+ set(key, value) {
34
+ this.m.set(key, value);
35
+ }
36
+ }
37
+ const config = /*@__PURE__*/ new Config();
38
+ const configFromSession = (win) => {
39
+ try {
40
+ const configStr = win.sessionStorage.getItem(IONIC_SESSION_KEY);
41
+ return configStr !== null ? JSON.parse(configStr) : {};
42
+ }
43
+ catch (e) {
44
+ return {};
45
+ }
46
+ };
47
+ const saveConfig = (win, c) => {
48
+ try {
49
+ win.sessionStorage.setItem(IONIC_SESSION_KEY, JSON.stringify(c));
50
+ }
51
+ catch (e) {
52
+ return;
53
+ }
54
+ };
55
+ const configFromURL = (win) => {
56
+ const configObj = {};
57
+ win.location.search
58
+ .slice(1)
59
+ .split('&')
60
+ .map((entry) => entry.split('='))
61
+ .map(([key, value]) => {
62
+ try {
63
+ return [decodeURIComponent(key), decodeURIComponent(value)];
64
+ }
65
+ catch (e) {
66
+ return ['', ''];
67
+ }
68
+ })
69
+ .filter(([key]) => startsWith(key, IONIC_PREFIX))
70
+ .map(([key, value]) => [key.slice(IONIC_PREFIX.length), value])
71
+ .forEach(([key, value]) => {
72
+ configObj[key] = value;
73
+ });
74
+ return configObj;
75
+ };
76
+ const startsWith = (input, search) => {
77
+ return input.substr(0, search.length) === search;
78
+ };
79
+ const IONIC_PREFIX = 'ionic:';
80
+ const IONIC_SESSION_KEY = 'ionic-persist-config';
81
+
82
+ var LogLevel;
83
+ (function (LogLevel) {
84
+ LogLevel["OFF"] = "OFF";
85
+ LogLevel["ERROR"] = "ERROR";
86
+ LogLevel["WARN"] = "WARN";
87
+ })(LogLevel || (LogLevel = {}));
88
+ /**
89
+ * Logs a warning to the console with an Ionic prefix
90
+ * to indicate the library that is warning the developer.
91
+ *
92
+ * @param message - The string message to be logged to the console.
93
+ */
94
+ const printIonWarning = (message, ...params) => {
95
+ const logLevel = config.get('logLevel', LogLevel.WARN);
96
+ if ([LogLevel.WARN].includes(logLevel)) {
97
+ return console.warn(`[Ionic Warning]: ${message}`, ...params);
98
+ }
99
+ };
100
+ /**
101
+ * Logs an error to the console with an Ionic prefix
102
+ * to indicate the library that is warning the developer.
103
+ *
104
+ * @param message - The string message to be logged to the console.
105
+ * @param params - Additional arguments to supply to the console.error.
106
+ */
107
+ const printIonError = (message, ...params) => {
108
+ const logLevel = config.get('logLevel', LogLevel.ERROR);
109
+ if ([LogLevel.ERROR, LogLevel.WARN].includes(logLevel)) {
110
+ return console.error(`[Ionic Error]: ${message}`, ...params);
111
+ }
112
+ };
113
+ /**
114
+ * Prints an error informing developers that an implementation requires an element to be used
115
+ * within a specific selector.
116
+ *
117
+ * @param el The web component element this is requiring the element.
118
+ * @param targetSelectors The selector or selectors that were not found.
119
+ */
120
+ const printRequiredElementError = (el, ...targetSelectors) => {
121
+ return console.error(`<${el.tagName.toLowerCase()}> must be used inside ${targetSelectors.join(' or ')}.`);
122
+ };
123
+
124
+ /*
125
+ Stencil Client Platform v4.38.0 | MIT Licensed | https://stenciljs.com
126
+ */
127
+ var __defProp = Object.defineProperty;
128
+ var __export = (target, all) => {
129
+ for (var name in all)
130
+ __defProp(target, name, { get: all[name], enumerable: true });
131
+ };
132
+ var Build = {
133
+ isBrowser: true};
134
+
135
+ // src/utils/constants.ts
136
+ var SVG_NS = "http://www.w3.org/2000/svg";
137
+ var HTML_NS = "http://www.w3.org/1999/xhtml";
138
+ var PrimitiveType = /* @__PURE__ */ ((PrimitiveType2) => {
139
+ PrimitiveType2["Undefined"] = "undefined";
140
+ PrimitiveType2["Null"] = "null";
141
+ PrimitiveType2["String"] = "string";
142
+ PrimitiveType2["Number"] = "number";
143
+ PrimitiveType2["SpecialNumber"] = "number";
144
+ PrimitiveType2["Boolean"] = "boolean";
145
+ PrimitiveType2["BigInt"] = "bigint";
146
+ return PrimitiveType2;
147
+ })(PrimitiveType || {});
148
+ var NonPrimitiveType = /* @__PURE__ */ ((NonPrimitiveType2) => {
149
+ NonPrimitiveType2["Array"] = "array";
150
+ NonPrimitiveType2["Date"] = "date";
151
+ NonPrimitiveType2["Map"] = "map";
152
+ NonPrimitiveType2["Object"] = "object";
153
+ NonPrimitiveType2["RegularExpression"] = "regexp";
154
+ NonPrimitiveType2["Set"] = "set";
155
+ NonPrimitiveType2["Channel"] = "channel";
156
+ NonPrimitiveType2["Symbol"] = "symbol";
157
+ return NonPrimitiveType2;
158
+ })(NonPrimitiveType || {});
159
+ var TYPE_CONSTANT = "type";
160
+ var VALUE_CONSTANT = "value";
161
+ var SERIALIZED_PREFIX = "serialized:";
162
+
163
+ // src/client/client-host-ref.ts
164
+ var getHostRef = (ref) => {
165
+ if (ref.__stencil__getHostRef) {
166
+ return ref.__stencil__getHostRef();
167
+ }
168
+ return void 0;
169
+ };
170
+ var registerHost = (hostElement, cmpMeta) => {
171
+ const hostRef = {
172
+ $flags$: 0,
173
+ $hostElement$: hostElement,
174
+ $cmpMeta$: cmpMeta,
175
+ $instanceValues$: /* @__PURE__ */ new Map(),
176
+ $serializerValues$: /* @__PURE__ */ new Map()
177
+ };
178
+ {
179
+ hostRef.$onReadyPromise$ = new Promise((r) => hostRef.$onReadyResolve$ = r);
180
+ hostElement["s-p"] = [];
181
+ hostElement["s-rc"] = [];
182
+ }
183
+ const ref = hostRef;
184
+ hostElement.__stencil__getHostRef = () => ref;
185
+ return ref;
186
+ };
187
+ var isMemberInElement = (elm, memberName) => memberName in elm;
188
+ var consoleError = (e, el) => (0, console.error)(e, el);
189
+
190
+ // src/client/client-style.ts
191
+ var styles = /* @__PURE__ */ new Map();
192
+ var modeResolutionChain = [];
193
+
194
+ // src/runtime/runtime-constants.ts
195
+ var CONTENT_REF_ID = "r";
196
+ var ORG_LOCATION_ID = "o";
197
+ var SLOT_NODE_ID = "s";
198
+ var TEXT_NODE_ID = "t";
199
+ var COMMENT_NODE_ID = "c";
200
+ var HYDRATE_ID = "s-id";
201
+ var HYDRATED_STYLE_ID = "sty-id";
202
+ var HYDRATE_CHILD_ID = "c-id";
203
+ var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
204
+ var XLINK_NS = "http://www.w3.org/1999/xlink";
205
+ var win = typeof window !== "undefined" ? window : {};
206
+ var H = win.HTMLElement || class {
207
+ };
208
+ var plt = {
209
+ $flags$: 0,
210
+ $resourcesUrl$: "",
211
+ jmp: (h2) => h2(),
212
+ raf: (h2) => requestAnimationFrame(h2),
213
+ ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
214
+ rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
215
+ ce: (eventName, opts) => new CustomEvent(eventName, opts)
216
+ };
217
+ var supportsShadow = BUILD.shadowDom;
218
+ var supportsListenerOptions = /* @__PURE__ */ (() => {
219
+ var _a;
220
+ let supportsListenerOptions2 = false;
221
+ try {
222
+ (_a = win.document) == null ? void 0 : _a.addEventListener(
223
+ "e",
224
+ null,
225
+ Object.defineProperty({}, "passive", {
226
+ get() {
227
+ supportsListenerOptions2 = true;
228
+ }
229
+ })
230
+ );
231
+ } catch (e) {
232
+ }
233
+ return supportsListenerOptions2;
234
+ })();
235
+ var promiseResolve = (v) => Promise.resolve(v);
236
+ var supportsConstructableStylesheets = /* @__PURE__ */ (() => {
237
+ try {
238
+ new CSSStyleSheet();
239
+ return typeof new CSSStyleSheet().replaceSync === "function";
240
+ } catch (e) {
241
+ }
242
+ return false;
243
+ })() ;
244
+ var supportsMutableAdoptedStyleSheets = supportsConstructableStylesheets ? /* @__PURE__ */ (() => !!win.document && Object.getOwnPropertyDescriptor(win.document.adoptedStyleSheets, "length").writable)() : false;
245
+ var queuePending = false;
246
+ var queueDomReads = [];
247
+ var queueDomWrites = [];
248
+ var queueTask = (queue, write) => (cb) => {
249
+ queue.push(cb);
250
+ if (!queuePending) {
251
+ queuePending = true;
252
+ if (write && plt.$flags$ & 4 /* queueSync */) {
253
+ nextTick(flush);
254
+ } else {
255
+ plt.raf(flush);
256
+ }
257
+ }
258
+ };
259
+ var consume = (queue) => {
260
+ for (let i2 = 0; i2 < queue.length; i2++) {
261
+ try {
262
+ queue[i2](performance.now());
263
+ } catch (e) {
264
+ consoleError(e);
265
+ }
266
+ }
267
+ queue.length = 0;
268
+ };
269
+ var flush = () => {
270
+ consume(queueDomReads);
271
+ {
272
+ consume(queueDomWrites);
273
+ if (queuePending = queueDomReads.length > 0) {
274
+ plt.raf(flush);
275
+ }
276
+ }
277
+ };
278
+ var nextTick = (cb) => promiseResolve().then(cb);
279
+ var readTask = /* @__PURE__ */ queueTask(queueDomReads, false);
280
+ var writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);
281
+
282
+ // src/runtime/asset-path.ts
283
+ var getAssetPath = (path) => {
284
+ const assetUrl = new URL(path, plt.$resourcesUrl$);
285
+ return assetUrl.origin !== win.location.origin ? assetUrl.href : assetUrl.pathname;
286
+ };
287
+ var setAssetPath = (path) => plt.$resourcesUrl$ = path;
288
+
289
+ // src/utils/helpers.ts
290
+ var isDef = (v) => v != null && v !== void 0;
291
+ var isComplexType = (o) => {
292
+ o = typeof o;
293
+ return o === "object" || o === "function";
294
+ };
295
+
296
+ // src/utils/query-nonce-meta-tag-content.ts
297
+ function queryNonceMetaTagContent(doc) {
298
+ var _a, _b, _c;
299
+ 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;
300
+ }
301
+
302
+ // src/utils/regular-expression.ts
303
+ var escapeRegExpSpecialCharacters = (text) => {
304
+ return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
305
+ };
306
+
307
+ // src/utils/remote-value.ts
308
+ var RemoteValue = class _RemoteValue {
309
+ /**
310
+ * Deserializes a LocalValue serialized object back to its original JavaScript representation
311
+ *
312
+ * @param serialized The serialized LocalValue object
313
+ * @returns The original JavaScript value/object
314
+ */
315
+ static fromLocalValue(serialized) {
316
+ const type = serialized[TYPE_CONSTANT];
317
+ const value = VALUE_CONSTANT in serialized ? serialized[VALUE_CONSTANT] : void 0;
318
+ switch (type) {
319
+ case "string" /* String */:
320
+ return value;
321
+ case "boolean" /* Boolean */:
322
+ return value;
323
+ case "bigint" /* BigInt */:
324
+ return BigInt(value);
325
+ case "undefined" /* Undefined */:
326
+ return void 0;
327
+ case "null" /* Null */:
328
+ return null;
329
+ case "number" /* Number */:
330
+ if (value === "NaN") return NaN;
331
+ if (value === "-0") return -0;
332
+ if (value === "Infinity") return Infinity;
333
+ if (value === "-Infinity") return -Infinity;
334
+ return value;
335
+ case "array" /* Array */:
336
+ return value.map((item) => _RemoteValue.fromLocalValue(item));
337
+ case "date" /* Date */:
338
+ return new Date(value);
339
+ case "map" /* Map */:
340
+ const map2 = /* @__PURE__ */ new Map();
341
+ for (const [key, val] of value) {
342
+ const deserializedKey = typeof key === "object" && key !== null ? _RemoteValue.fromLocalValue(key) : key;
343
+ const deserializedValue = _RemoteValue.fromLocalValue(val);
344
+ map2.set(deserializedKey, deserializedValue);
345
+ }
346
+ return map2;
347
+ case "object" /* Object */:
348
+ const obj = {};
349
+ for (const [key, val] of value) {
350
+ obj[key] = _RemoteValue.fromLocalValue(val);
351
+ }
352
+ return obj;
353
+ case "regexp" /* RegularExpression */:
354
+ const { pattern, flags } = value;
355
+ return new RegExp(pattern, flags);
356
+ case "set" /* Set */:
357
+ const set = /* @__PURE__ */ new Set();
358
+ for (const item of value) {
359
+ set.add(_RemoteValue.fromLocalValue(item));
360
+ }
361
+ return set;
362
+ case "symbol" /* Symbol */:
363
+ return Symbol(value);
364
+ default:
365
+ throw new Error(`Unsupported type: ${type}`);
366
+ }
367
+ }
368
+ /**
369
+ * Utility method to deserialize multiple LocalValues at once
370
+ *
371
+ * @param serializedValues Array of serialized LocalValue objects
372
+ * @returns Array of deserialized JavaScript values
373
+ */
374
+ static fromLocalValueArray(serializedValues) {
375
+ return serializedValues.map((value) => _RemoteValue.fromLocalValue(value));
376
+ }
377
+ /**
378
+ * Verifies if the given object matches the structure of a serialized LocalValue
379
+ *
380
+ * @param obj Object to verify
381
+ * @returns boolean indicating if the object has LocalValue structure
382
+ */
383
+ static isLocalValueObject(obj) {
384
+ if (typeof obj !== "object" || obj === null) {
385
+ return false;
386
+ }
387
+ if (!obj.hasOwnProperty(TYPE_CONSTANT)) {
388
+ return false;
389
+ }
390
+ const type = obj[TYPE_CONSTANT];
391
+ const hasTypeProperty = Object.values({ ...PrimitiveType, ...NonPrimitiveType }).includes(type);
392
+ if (!hasTypeProperty) {
393
+ return false;
394
+ }
395
+ if (type !== "null" /* Null */ && type !== "undefined" /* Undefined */) {
396
+ return obj.hasOwnProperty(VALUE_CONSTANT);
397
+ }
398
+ return true;
399
+ }
400
+ };
401
+
402
+ // src/utils/result.ts
403
+ var result_exports = {};
404
+ __export(result_exports, {
405
+ err: () => err,
406
+ map: () => map,
407
+ ok: () => ok,
408
+ unwrap: () => unwrap,
409
+ unwrapErr: () => unwrapErr
410
+ });
411
+ var ok = (value) => ({
412
+ isOk: true,
413
+ isErr: false,
414
+ value
415
+ });
416
+ var err = (value) => ({
417
+ isOk: false,
418
+ isErr: true,
419
+ value
420
+ });
421
+ function map(result, fn) {
422
+ if (result.isOk) {
423
+ const val = fn(result.value);
424
+ if (val instanceof Promise) {
425
+ return val.then((newVal) => ok(newVal));
426
+ } else {
427
+ return ok(val);
428
+ }
429
+ }
430
+ if (result.isErr) {
431
+ const value = result.value;
432
+ return err(value);
433
+ }
434
+ throw "should never get here";
435
+ }
436
+ var unwrap = (result) => {
437
+ if (result.isOk) {
438
+ return result.value;
439
+ } else {
440
+ throw result.value;
441
+ }
442
+ };
443
+ var unwrapErr = (result) => {
444
+ if (result.isErr) {
445
+ return result.value;
446
+ } else {
447
+ throw result.value;
448
+ }
449
+ };
450
+
451
+ // src/utils/serialize.ts
452
+ function deserializeProperty(value) {
453
+ if (typeof value !== "string" || !value.startsWith(SERIALIZED_PREFIX)) {
454
+ return value;
455
+ }
456
+ return RemoteValue.fromLocalValue(JSON.parse(atob(value.slice(SERIALIZED_PREFIX.length))));
457
+ }
458
+
459
+ // src/utils/style.ts
460
+ function createStyleSheetIfNeededAndSupported(styles2) {
461
+ return void 0;
462
+ }
463
+
464
+ // src/utils/shadow-root.ts
465
+ var globalStyleSheet;
466
+ function createShadowRoot(cmpMeta) {
467
+ var _a;
468
+ const shadowRoot = this.attachShadow({
469
+ mode: "open",
470
+ delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */)
471
+ }) ;
472
+ if (globalStyleSheet === void 0) globalStyleSheet = (_a = createStyleSheetIfNeededAndSupported()) != null ? _a : null;
473
+ if (globalStyleSheet) {
474
+ if (supportsMutableAdoptedStyleSheets) {
475
+ shadowRoot.adoptedStyleSheets.push(globalStyleSheet);
476
+ } else {
477
+ shadowRoot.adoptedStyleSheets = [...shadowRoot.adoptedStyleSheets, globalStyleSheet];
478
+ }
479
+ }
480
+ }
481
+ var updateFallbackSlotVisibility = (elm) => {
482
+ const childNodes = internalCall(elm, "childNodes");
483
+ if (elm.tagName && elm.tagName.includes("-") && elm["s-cr"] && elm.tagName !== "SLOT-FB") {
484
+ getHostSlotNodes(childNodes, elm.tagName).forEach((slotNode) => {
485
+ if (slotNode.nodeType === 1 /* ElementNode */ && slotNode.tagName === "SLOT-FB") {
486
+ if (getSlotChildSiblings(slotNode, getSlotName(slotNode), false).length) {
487
+ slotNode.hidden = true;
488
+ } else {
489
+ slotNode.hidden = false;
490
+ }
491
+ }
492
+ });
493
+ }
494
+ let i2 = 0;
495
+ for (i2 = 0; i2 < childNodes.length; i2++) {
496
+ const childNode = childNodes[i2];
497
+ if (childNode.nodeType === 1 /* ElementNode */ && internalCall(childNode, "childNodes").length) {
498
+ updateFallbackSlotVisibility(childNode);
499
+ }
500
+ }
501
+ };
502
+ var getSlottedChildNodes = (childNodes) => {
503
+ const result = [];
504
+ for (let i2 = 0; i2 < childNodes.length; i2++) {
505
+ const slottedNode = childNodes[i2]["s-nr"] || void 0;
506
+ if (slottedNode && slottedNode.isConnected) {
507
+ result.push(slottedNode);
508
+ }
509
+ }
510
+ return result;
511
+ };
512
+ function getHostSlotNodes(childNodes, hostName, slotName) {
513
+ let i2 = 0;
514
+ let slottedNodes = [];
515
+ let childNode;
516
+ for (; i2 < childNodes.length; i2++) {
517
+ childNode = childNodes[i2];
518
+ if (childNode["s-sr"] && (!hostName || childNode["s-hn"] === hostName) && (slotName === void 0 || getSlotName(childNode) === slotName)) {
519
+ slottedNodes.push(childNode);
520
+ if (typeof slotName !== "undefined") return slottedNodes;
521
+ }
522
+ slottedNodes = [...slottedNodes, ...getHostSlotNodes(childNode.childNodes, hostName, slotName)];
523
+ }
524
+ return slottedNodes;
525
+ }
526
+ var getSlotChildSiblings = (slot, slotName, includeSlot = true) => {
527
+ const childNodes = [];
528
+ if (includeSlot && slot["s-sr"] || !slot["s-sr"]) childNodes.push(slot);
529
+ let node = slot;
530
+ while (node = node.nextSibling) {
531
+ if (getSlotName(node) === slotName && (includeSlot || !node["s-sr"])) childNodes.push(node);
532
+ }
533
+ return childNodes;
534
+ };
535
+ var isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
536
+ if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
537
+ if (nodeToRelocate.getAttribute("slot") === null && slotName === "") {
538
+ return true;
539
+ }
540
+ if (nodeToRelocate.getAttribute("slot") === slotName) {
541
+ return true;
542
+ }
543
+ return false;
544
+ }
545
+ if (nodeToRelocate["s-sn"] === slotName) {
546
+ return true;
547
+ }
548
+ return slotName === "";
549
+ };
550
+ var addSlotRelocateNode = (newChild, slotNode, prepend, position) => {
551
+ if (newChild["s-ol"] && newChild["s-ol"].isConnected) {
552
+ return;
553
+ }
554
+ const slottedNodeLocation = document.createTextNode("");
555
+ slottedNodeLocation["s-nr"] = newChild;
556
+ if (!slotNode["s-cr"] || !slotNode["s-cr"].parentNode) return;
557
+ const parent = slotNode["s-cr"].parentNode;
558
+ const appendMethod = prepend ? internalCall(parent, "prepend") : internalCall(parent, "appendChild");
559
+ if (typeof position !== "undefined") {
560
+ slottedNodeLocation["s-oo"] = position;
561
+ const childNodes = internalCall(parent, "childNodes");
562
+ const slotRelocateNodes = [slottedNodeLocation];
563
+ childNodes.forEach((n) => {
564
+ if (n["s-nr"]) slotRelocateNodes.push(n);
565
+ });
566
+ slotRelocateNodes.sort((a, b) => {
567
+ if (!a["s-oo"] || a["s-oo"] < (b["s-oo"] || 0)) return -1;
568
+ else if (!b["s-oo"] || b["s-oo"] < a["s-oo"]) return 1;
569
+ return 0;
570
+ });
571
+ slotRelocateNodes.forEach((n) => appendMethod.call(parent, n));
572
+ } else {
573
+ appendMethod.call(parent, slottedNodeLocation);
574
+ }
575
+ newChild["s-ol"] = slottedNodeLocation;
576
+ newChild["s-sh"] = slotNode["s-hn"];
577
+ };
578
+ var getSlotName = (node) => typeof node["s-sn"] === "string" ? node["s-sn"] : node.nodeType === 1 && node.getAttribute("slot") || void 0;
579
+ function patchSlotNode(node) {
580
+ if (node.assignedElements || node.assignedNodes || !node["s-sr"]) return;
581
+ const assignedFactory = (elementsOnly) => (function(opts) {
582
+ const toReturn = [];
583
+ const slotName = this["s-sn"];
584
+ if (opts == null ? void 0 : opts.flatten) {
585
+ console.error(`
586
+ Flattening is not supported for Stencil non-shadow slots.
587
+ You can use \`.childNodes\` to nested slot fallback content.
588
+ If you have a particular use case, please open an issue on the Stencil repo.
589
+ `);
590
+ }
591
+ const parent = this["s-cr"].parentElement;
592
+ const slottedNodes = parent.__childNodes ? parent.childNodes : getSlottedChildNodes(parent.childNodes);
593
+ slottedNodes.forEach((n) => {
594
+ if (slotName === getSlotName(n)) {
595
+ toReturn.push(n);
596
+ }
597
+ });
598
+ if (elementsOnly) {
599
+ return toReturn.filter((n) => n.nodeType === 1 /* ElementNode */);
600
+ }
601
+ return toReturn;
602
+ }).bind(node);
603
+ node.assignedElements = assignedFactory(true);
604
+ node.assignedNodes = assignedFactory(false);
605
+ }
606
+ function dispatchSlotChangeEvent(elm) {
607
+ elm.dispatchEvent(new CustomEvent("slotchange", { bubbles: false, cancelable: false, composed: false }));
608
+ }
609
+ function findSlotFromSlottedNode(slottedNode, parentHost) {
610
+ var _a;
611
+ parentHost = parentHost || ((_a = slottedNode["s-ol"]) == null ? void 0 : _a.parentElement);
612
+ if (!parentHost) return { slotNode: null, slotName: "" };
613
+ const slotName = slottedNode["s-sn"] = getSlotName(slottedNode) || "";
614
+ const childNodes = internalCall(parentHost, "childNodes");
615
+ const slotNode = getHostSlotNodes(childNodes, parentHost.tagName, slotName)[0];
616
+ return { slotNode, slotName };
617
+ }
618
+
619
+ // src/runtime/dom-extras.ts
620
+ var patchPseudoShadowDom = (hostElementPrototype) => {
621
+ patchCloneNode(hostElementPrototype);
622
+ patchSlotAppendChild(hostElementPrototype);
623
+ patchSlotAppend(hostElementPrototype);
624
+ patchSlotPrepend(hostElementPrototype);
625
+ patchSlotInsertAdjacentElement(hostElementPrototype);
626
+ patchSlotInsertAdjacentHTML(hostElementPrototype);
627
+ patchSlotInsertAdjacentText(hostElementPrototype);
628
+ patchInsertBefore(hostElementPrototype);
629
+ patchTextContent(hostElementPrototype);
630
+ patchChildSlotNodes(hostElementPrototype);
631
+ patchSlotRemoveChild(hostElementPrototype);
632
+ };
633
+ var patchCloneNode = (HostElementPrototype) => {
634
+ const orgCloneNode = HostElementPrototype.cloneNode;
635
+ HostElementPrototype.cloneNode = function(deep) {
636
+ const srcNode = this;
637
+ const isShadowDom = srcNode.shadowRoot && supportsShadow ;
638
+ const clonedNode = orgCloneNode.call(srcNode, isShadowDom ? deep : false);
639
+ if (!isShadowDom && deep) {
640
+ let i2 = 0;
641
+ let slotted, nonStencilNode;
642
+ const stencilPrivates = [
643
+ "s-id",
644
+ "s-cr",
645
+ "s-lr",
646
+ "s-rc",
647
+ "s-sc",
648
+ "s-p",
649
+ "s-cn",
650
+ "s-sr",
651
+ "s-sn",
652
+ "s-hn",
653
+ "s-ol",
654
+ "s-nr",
655
+ "s-si",
656
+ "s-rf",
657
+ "s-scs"
658
+ ];
659
+ const childNodes = this.__childNodes || this.childNodes;
660
+ for (; i2 < childNodes.length; i2++) {
661
+ slotted = childNodes[i2]["s-nr"];
662
+ nonStencilNode = stencilPrivates.every((privateField) => !childNodes[i2][privateField]);
663
+ if (slotted) {
664
+ if (clonedNode.__appendChild) {
665
+ clonedNode.__appendChild(slotted.cloneNode(true));
666
+ } else {
667
+ clonedNode.appendChild(slotted.cloneNode(true));
668
+ }
669
+ }
670
+ if (nonStencilNode) {
671
+ clonedNode.appendChild(childNodes[i2].cloneNode(true));
672
+ }
673
+ }
674
+ }
675
+ return clonedNode;
676
+ };
677
+ };
678
+ var patchSlotAppendChild = (HostElementPrototype) => {
679
+ HostElementPrototype.__appendChild = HostElementPrototype.appendChild;
680
+ HostElementPrototype.appendChild = function(newChild) {
681
+ const { slotName, slotNode } = findSlotFromSlottedNode(newChild, this);
682
+ if (slotNode) {
683
+ addSlotRelocateNode(newChild, slotNode);
684
+ const slotChildNodes = getSlotChildSiblings(slotNode, slotName);
685
+ const appendAfter = slotChildNodes[slotChildNodes.length - 1];
686
+ const parent = internalCall(appendAfter, "parentNode");
687
+ const insertedNode = internalCall(parent, "insertBefore")(newChild, appendAfter.nextSibling);
688
+ dispatchSlotChangeEvent(slotNode);
689
+ updateFallbackSlotVisibility(this);
690
+ return insertedNode;
691
+ }
692
+ return this.__appendChild(newChild);
693
+ };
694
+ };
695
+ var patchSlotRemoveChild = (ElementPrototype) => {
696
+ ElementPrototype.__removeChild = ElementPrototype.removeChild;
697
+ ElementPrototype.removeChild = function(toRemove) {
698
+ if (toRemove && typeof toRemove["s-sn"] !== "undefined") {
699
+ const childNodes = this.__childNodes || this.childNodes;
700
+ const slotNode = getHostSlotNodes(childNodes, this.tagName, toRemove["s-sn"]);
701
+ if (slotNode && toRemove.isConnected) {
702
+ toRemove.remove();
703
+ updateFallbackSlotVisibility(this);
704
+ return;
705
+ }
706
+ }
707
+ return this.__removeChild(toRemove);
708
+ };
709
+ };
710
+ var patchSlotPrepend = (HostElementPrototype) => {
711
+ HostElementPrototype.__prepend = HostElementPrototype.prepend;
712
+ HostElementPrototype.prepend = function(...newChildren) {
713
+ newChildren.forEach((newChild) => {
714
+ if (typeof newChild === "string") {
715
+ newChild = this.ownerDocument.createTextNode(newChild);
716
+ }
717
+ const slotName = (newChild["s-sn"] = getSlotName(newChild)) || "";
718
+ const childNodes = internalCall(this, "childNodes");
719
+ const slotNode = getHostSlotNodes(childNodes, this.tagName, slotName)[0];
720
+ if (slotNode) {
721
+ addSlotRelocateNode(newChild, slotNode, true);
722
+ const slotChildNodes = getSlotChildSiblings(slotNode, slotName);
723
+ const appendAfter = slotChildNodes[0];
724
+ const parent = internalCall(appendAfter, "parentNode");
725
+ const toReturn = internalCall(parent, "insertBefore")(newChild, internalCall(appendAfter, "nextSibling"));
726
+ dispatchSlotChangeEvent(slotNode);
727
+ return toReturn;
728
+ }
729
+ if (newChild.nodeType === 1 && !!newChild.getAttribute("slot")) {
730
+ newChild.hidden = true;
731
+ }
732
+ return HostElementPrototype.__prepend(newChild);
733
+ });
734
+ };
735
+ };
736
+ var patchSlotAppend = (HostElementPrototype) => {
737
+ HostElementPrototype.__append = HostElementPrototype.append;
738
+ HostElementPrototype.append = function(...newChildren) {
739
+ newChildren.forEach((newChild) => {
740
+ if (typeof newChild === "string") {
741
+ newChild = this.ownerDocument.createTextNode(newChild);
742
+ }
743
+ this.appendChild(newChild);
744
+ });
745
+ };
746
+ };
747
+ var patchSlotInsertAdjacentHTML = (HostElementPrototype) => {
748
+ const originalInsertAdjacentHtml = HostElementPrototype.insertAdjacentHTML;
749
+ HostElementPrototype.insertAdjacentHTML = function(position, text) {
750
+ if (position !== "afterbegin" && position !== "beforeend") {
751
+ return originalInsertAdjacentHtml.call(this, position, text);
752
+ }
753
+ const container = this.ownerDocument.createElement("_");
754
+ let node;
755
+ container.innerHTML = text;
756
+ if (position === "afterbegin") {
757
+ while (node = container.firstChild) {
758
+ this.prepend(node);
759
+ }
760
+ } else if (position === "beforeend") {
761
+ while (node = container.firstChild) {
762
+ this.append(node);
763
+ }
764
+ }
765
+ };
766
+ };
767
+ var patchSlotInsertAdjacentText = (HostElementPrototype) => {
768
+ HostElementPrototype.insertAdjacentText = function(position, text) {
769
+ this.insertAdjacentHTML(position, text);
770
+ };
771
+ };
772
+ var patchInsertBefore = (HostElementPrototype) => {
773
+ const eleProto = HostElementPrototype;
774
+ if (eleProto.__insertBefore) return;
775
+ eleProto.__insertBefore = HostElementPrototype.insertBefore;
776
+ HostElementPrototype.insertBefore = function(newChild, currentChild) {
777
+ const { slotName, slotNode } = findSlotFromSlottedNode(newChild, this);
778
+ const slottedNodes = this.__childNodes ? this.childNodes : getSlottedChildNodes(this.childNodes);
779
+ if (slotNode) {
780
+ let found = false;
781
+ slottedNodes.forEach((childNode) => {
782
+ if (childNode === currentChild || currentChild === null) {
783
+ found = true;
784
+ if (currentChild === null || slotName !== currentChild["s-sn"]) {
785
+ this.appendChild(newChild);
786
+ return;
787
+ }
788
+ if (slotName === currentChild["s-sn"]) {
789
+ addSlotRelocateNode(newChild, slotNode);
790
+ const parent = internalCall(currentChild, "parentNode");
791
+ internalCall(parent, "insertBefore")(newChild, currentChild);
792
+ dispatchSlotChangeEvent(slotNode);
793
+ }
794
+ return;
795
+ }
796
+ });
797
+ if (found) return newChild;
798
+ }
799
+ const parentNode = currentChild == null ? void 0 : currentChild.__parentNode;
800
+ if (parentNode && !this.isSameNode(parentNode)) {
801
+ return this.appendChild(newChild);
802
+ }
803
+ return this.__insertBefore(newChild, currentChild);
804
+ };
805
+ };
806
+ var patchSlotInsertAdjacentElement = (HostElementPrototype) => {
807
+ const originalInsertAdjacentElement = HostElementPrototype.insertAdjacentElement;
808
+ HostElementPrototype.insertAdjacentElement = function(position, element) {
809
+ if (position !== "afterbegin" && position !== "beforeend") {
810
+ return originalInsertAdjacentElement.call(this, position, element);
811
+ }
812
+ if (position === "afterbegin") {
813
+ this.prepend(element);
814
+ return element;
815
+ } else if (position === "beforeend") {
816
+ this.append(element);
817
+ return element;
818
+ }
819
+ return element;
820
+ };
821
+ };
822
+ var patchTextContent = (hostElementPrototype) => {
823
+ patchHostOriginalAccessor("textContent", hostElementPrototype);
824
+ Object.defineProperty(hostElementPrototype, "textContent", {
825
+ get: function() {
826
+ let text = "";
827
+ const childNodes = this.__childNodes ? this.childNodes : getSlottedChildNodes(this.childNodes);
828
+ childNodes.forEach((node) => text += node.textContent || "");
829
+ return text;
830
+ },
831
+ set: function(value) {
832
+ const childNodes = this.__childNodes ? this.childNodes : getSlottedChildNodes(this.childNodes);
833
+ childNodes.forEach((node) => {
834
+ if (node["s-ol"]) node["s-ol"].remove();
835
+ node.remove();
836
+ });
837
+ this.insertAdjacentHTML("beforeend", value);
838
+ }
839
+ });
840
+ };
841
+ var patchChildSlotNodes = (elm) => {
842
+ class FakeNodeList extends Array {
843
+ item(n) {
844
+ return this[n];
845
+ }
846
+ }
847
+ patchHostOriginalAccessor("children", elm);
848
+ Object.defineProperty(elm, "children", {
849
+ get() {
850
+ return this.childNodes.filter((n) => n.nodeType === 1);
851
+ }
852
+ });
853
+ Object.defineProperty(elm, "childElementCount", {
854
+ get() {
855
+ return this.children.length;
856
+ }
857
+ });
858
+ patchHostOriginalAccessor("firstChild", elm);
859
+ Object.defineProperty(elm, "firstChild", {
860
+ get() {
861
+ return this.childNodes[0];
862
+ }
863
+ });
864
+ patchHostOriginalAccessor("lastChild", elm);
865
+ Object.defineProperty(elm, "lastChild", {
866
+ get() {
867
+ return this.childNodes[this.childNodes.length - 1];
868
+ }
869
+ });
870
+ patchHostOriginalAccessor("childNodes", elm);
871
+ Object.defineProperty(elm, "childNodes", {
872
+ get() {
873
+ const result = new FakeNodeList();
874
+ result.push(...getSlottedChildNodes(this.__childNodes));
875
+ return result;
876
+ }
877
+ });
878
+ };
879
+ var patchSlottedNode = (node) => {
880
+ if (!node || node.__nextSibling !== void 0 || !globalThis.Node) return;
881
+ patchNextSibling(node);
882
+ patchPreviousSibling(node);
883
+ patchParentNode(node);
884
+ if (node.nodeType === Node.ELEMENT_NODE) {
885
+ patchNextElementSibling(node);
886
+ patchPreviousElementSibling(node);
887
+ }
888
+ };
889
+ var patchNextSibling = (node) => {
890
+ if (!node || node.__nextSibling) return;
891
+ patchHostOriginalAccessor("nextSibling", node);
892
+ Object.defineProperty(node, "nextSibling", {
893
+ get: function() {
894
+ var _a;
895
+ const parentNodes = (_a = this["s-ol"]) == null ? void 0 : _a.parentNode.childNodes;
896
+ const index = parentNodes == null ? void 0 : parentNodes.indexOf(this);
897
+ if (parentNodes && index > -1) {
898
+ return parentNodes[index + 1];
899
+ }
900
+ return this.__nextSibling;
901
+ }
902
+ });
903
+ };
904
+ var patchNextElementSibling = (element) => {
905
+ if (!element || element.__nextElementSibling) return;
906
+ patchHostOriginalAccessor("nextElementSibling", element);
907
+ Object.defineProperty(element, "nextElementSibling", {
908
+ get: function() {
909
+ var _a;
910
+ const parentEles = (_a = this["s-ol"]) == null ? void 0 : _a.parentNode.children;
911
+ const index = parentEles == null ? void 0 : parentEles.indexOf(this);
912
+ if (parentEles && index > -1) {
913
+ return parentEles[index + 1];
914
+ }
915
+ return this.__nextElementSibling;
916
+ }
917
+ });
918
+ };
919
+ var patchPreviousSibling = (node) => {
920
+ if (!node || node.__previousSibling) return;
921
+ patchHostOriginalAccessor("previousSibling", node);
922
+ Object.defineProperty(node, "previousSibling", {
923
+ get: function() {
924
+ var _a;
925
+ const parentNodes = (_a = this["s-ol"]) == null ? void 0 : _a.parentNode.childNodes;
926
+ const index = parentNodes == null ? void 0 : parentNodes.indexOf(this);
927
+ if (parentNodes && index > -1) {
928
+ return parentNodes[index - 1];
929
+ }
930
+ return this.__previousSibling;
931
+ }
932
+ });
933
+ };
934
+ var patchPreviousElementSibling = (element) => {
935
+ if (!element || element.__previousElementSibling) return;
936
+ patchHostOriginalAccessor("previousElementSibling", element);
937
+ Object.defineProperty(element, "previousElementSibling", {
938
+ get: function() {
939
+ var _a;
940
+ const parentNodes = (_a = this["s-ol"]) == null ? void 0 : _a.parentNode.children;
941
+ const index = parentNodes == null ? void 0 : parentNodes.indexOf(this);
942
+ if (parentNodes && index > -1) {
943
+ return parentNodes[index - 1];
944
+ }
945
+ return this.__previousElementSibling;
946
+ }
947
+ });
948
+ };
949
+ var patchParentNode = (node) => {
950
+ if (!node || node.__parentNode) return;
951
+ patchHostOriginalAccessor("parentNode", node);
952
+ Object.defineProperty(node, "parentNode", {
953
+ get: function() {
954
+ var _a;
955
+ return ((_a = this["s-ol"]) == null ? void 0 : _a.parentNode) || this.__parentNode;
956
+ },
957
+ set: function(value) {
958
+ this.__parentNode = value;
959
+ }
960
+ });
961
+ };
962
+ var validElementPatches = ["children", "nextElementSibling", "previousElementSibling"];
963
+ var validNodesPatches = [
964
+ "childNodes",
965
+ "firstChild",
966
+ "lastChild",
967
+ "nextSibling",
968
+ "previousSibling",
969
+ "textContent",
970
+ "parentNode"
971
+ ];
972
+ function patchHostOriginalAccessor(accessorName, node) {
973
+ if (!globalThis.Node || !globalThis.Element) {
974
+ return;
975
+ }
976
+ let accessor;
977
+ if (validElementPatches.includes(accessorName)) {
978
+ accessor = Object.getOwnPropertyDescriptor(Element.prototype, accessorName);
979
+ } else if (validNodesPatches.includes(accessorName)) {
980
+ accessor = Object.getOwnPropertyDescriptor(Node.prototype, accessorName);
981
+ }
982
+ if (!accessor) {
983
+ accessor = Object.getOwnPropertyDescriptor(node, accessorName);
984
+ }
985
+ if (accessor) Object.defineProperty(node, "__" + accessorName, accessor);
986
+ }
987
+ function internalCall(node, method) {
988
+ if ("__" + method in node) {
989
+ const toReturn = node["__" + method];
990
+ if (typeof toReturn !== "function") return toReturn;
991
+ return toReturn.bind(node);
992
+ } else {
993
+ if (typeof node[method] !== "function") return node[method];
994
+ return node[method].bind(node);
995
+ }
996
+ }
997
+ var createTime = (fnName, tagName = "") => {
998
+ {
999
+ return () => {
1000
+ return;
1001
+ };
1002
+ }
1003
+ };
1004
+ var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
1005
+ var registerStyle = (scopeId2, cssText, allowCS) => {
1006
+ let style = styles.get(scopeId2);
1007
+ if (supportsConstructableStylesheets && allowCS) {
1008
+ style = style || new CSSStyleSheet();
1009
+ if (typeof style === "string") {
1010
+ style = cssText;
1011
+ } else {
1012
+ style.replaceSync(cssText);
1013
+ }
1014
+ } else {
1015
+ style = cssText;
1016
+ }
1017
+ styles.set(scopeId2, style);
1018
+ };
1019
+ var addStyle = (styleContainerNode, cmpMeta, mode) => {
1020
+ var _a;
1021
+ const scopeId2 = getScopeId(cmpMeta, mode);
1022
+ const style = styles.get(scopeId2);
1023
+ if (!win.document) {
1024
+ return scopeId2;
1025
+ }
1026
+ styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : win.document;
1027
+ if (style) {
1028
+ if (typeof style === "string") {
1029
+ styleContainerNode = styleContainerNode.head || styleContainerNode;
1030
+ let appliedStyles = rootAppliedStyles.get(styleContainerNode);
1031
+ let styleElm;
1032
+ if (!appliedStyles) {
1033
+ rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
1034
+ }
1035
+ if (!appliedStyles.has(scopeId2)) {
1036
+ if (styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
1037
+ styleElm.innerHTML = style;
1038
+ } else {
1039
+ styleElm = win.document.createElement("style");
1040
+ styleElm.innerHTML = style;
1041
+ const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
1042
+ if (nonce != null) {
1043
+ styleElm.setAttribute("nonce", nonce);
1044
+ }
1045
+ if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
1046
+ if (styleContainerNode.nodeName === "HEAD") {
1047
+ const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
1048
+ const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
1049
+ styleContainerNode.insertBefore(
1050
+ styleElm,
1051
+ (referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
1052
+ );
1053
+ } else if ("host" in styleContainerNode) {
1054
+ if (supportsConstructableStylesheets) {
1055
+ const stylesheet = new CSSStyleSheet();
1056
+ stylesheet.replaceSync(style);
1057
+ if (supportsMutableAdoptedStyleSheets) {
1058
+ styleContainerNode.adoptedStyleSheets.unshift(stylesheet);
1059
+ } else {
1060
+ styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
1061
+ }
1062
+ } else {
1063
+ const existingStyleContainer = styleContainerNode.querySelector("style");
1064
+ if (existingStyleContainer) {
1065
+ existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
1066
+ } else {
1067
+ styleContainerNode.prepend(styleElm);
1068
+ }
1069
+ }
1070
+ } else {
1071
+ styleContainerNode.append(styleElm);
1072
+ }
1073
+ }
1074
+ if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
1075
+ styleContainerNode.insertBefore(styleElm, null);
1076
+ }
1077
+ }
1078
+ if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
1079
+ styleElm.innerHTML += SLOT_FB_CSS;
1080
+ }
1081
+ if (appliedStyles) {
1082
+ appliedStyles.add(scopeId2);
1083
+ }
1084
+ }
1085
+ } else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
1086
+ if (supportsMutableAdoptedStyleSheets) {
1087
+ styleContainerNode.adoptedStyleSheets.push(style);
1088
+ } else {
1089
+ styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
1090
+ }
1091
+ }
1092
+ }
1093
+ return scopeId2;
1094
+ };
1095
+ var attachStyles = (hostRef) => {
1096
+ const cmpMeta = hostRef.$cmpMeta$;
1097
+ const elm = hostRef.$hostElement$;
1098
+ const flags = cmpMeta.$flags$;
1099
+ const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
1100
+ const scopeId2 = addStyle(
1101
+ elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
1102
+ cmpMeta,
1103
+ hostRef.$modeName$
1104
+ );
1105
+ if (flags & 10 /* needsScopedEncapsulation */) {
1106
+ elm["s-sc"] = scopeId2;
1107
+ elm.classList.add(scopeId2 + "-h");
1108
+ }
1109
+ endAttachStyles();
1110
+ };
1111
+ var getScopeId = (cmp, mode) => "sc-" + (mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
1112
+ var convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, "$1{");
1113
+ var hydrateScopedToShadow = () => {
1114
+ if (!win.document) {
1115
+ return;
1116
+ }
1117
+ const styles2 = win.document.querySelectorAll(`[${HYDRATED_STYLE_ID}]`);
1118
+ let i2 = 0;
1119
+ for (; i2 < styles2.length; i2++) {
1120
+ registerStyle(styles2[i2].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles2[i2].innerHTML), true);
1121
+ }
1122
+ };
1123
+ var h = (nodeName, vnodeData, ...children) => {
1124
+ let child = null;
1125
+ let key = null;
1126
+ let slotName = null;
1127
+ let simple = false;
1128
+ let lastSimple = false;
1129
+ const vNodeChildren = [];
1130
+ const walk = (c) => {
1131
+ for (let i2 = 0; i2 < c.length; i2++) {
1132
+ child = c[i2];
1133
+ if (Array.isArray(child)) {
1134
+ walk(child);
1135
+ } else if (child != null && typeof child !== "boolean") {
1136
+ if (simple = typeof nodeName !== "function" && !isComplexType(child)) {
1137
+ child = String(child);
1138
+ }
1139
+ if (simple && lastSimple) {
1140
+ vNodeChildren[vNodeChildren.length - 1].$text$ += child;
1141
+ } else {
1142
+ vNodeChildren.push(simple ? newVNode(null, child) : child);
1143
+ }
1144
+ lastSimple = simple;
1145
+ }
1146
+ }
1147
+ };
1148
+ walk(children);
1149
+ if (vnodeData) {
1150
+ if (vnodeData.key) {
1151
+ key = vnodeData.key;
1152
+ }
1153
+ if (vnodeData.name) {
1154
+ slotName = vnodeData.name;
1155
+ }
1156
+ {
1157
+ const classData = vnodeData.className || vnodeData.class;
1158
+ if (classData) {
1159
+ vnodeData.class = typeof classData !== "object" ? classData : Object.keys(classData).filter((k) => classData[k]).join(" ");
1160
+ }
1161
+ }
1162
+ }
1163
+ if (typeof nodeName === "function") {
1164
+ return nodeName(
1165
+ vnodeData === null ? {} : vnodeData,
1166
+ vNodeChildren,
1167
+ vdomFnUtils
1168
+ );
1169
+ }
1170
+ const vnode = newVNode(nodeName, null);
1171
+ vnode.$attrs$ = vnodeData;
1172
+ if (vNodeChildren.length > 0) {
1173
+ vnode.$children$ = vNodeChildren;
1174
+ }
1175
+ {
1176
+ vnode.$key$ = key;
1177
+ }
1178
+ {
1179
+ vnode.$name$ = slotName;
1180
+ }
1181
+ return vnode;
1182
+ };
1183
+ var newVNode = (tag, text) => {
1184
+ const vnode = {
1185
+ $flags$: 0,
1186
+ $tag$: tag,
1187
+ $text$: text,
1188
+ $elm$: null,
1189
+ $children$: null
1190
+ };
1191
+ {
1192
+ vnode.$attrs$ = null;
1193
+ }
1194
+ {
1195
+ vnode.$key$ = null;
1196
+ }
1197
+ {
1198
+ vnode.$name$ = null;
1199
+ }
1200
+ return vnode;
1201
+ };
1202
+ var Host = {};
1203
+ var isHost = (node) => node && node.$tag$ === Host;
1204
+ var vdomFnUtils = {
1205
+ forEach: (children, cb) => children.map(convertToPublic).forEach(cb),
1206
+ map: (children, cb) => children.map(convertToPublic).map(cb).map(convertToPrivate)
1207
+ };
1208
+ var convertToPublic = (node) => ({
1209
+ vattrs: node.$attrs$,
1210
+ vchildren: node.$children$,
1211
+ vkey: node.$key$,
1212
+ vname: node.$name$,
1213
+ vtag: node.$tag$,
1214
+ vtext: node.$text$
1215
+ });
1216
+ var convertToPrivate = (node) => {
1217
+ if (typeof node.vtag === "function") {
1218
+ const vnodeData = { ...node.vattrs };
1219
+ if (node.vkey) {
1220
+ vnodeData.key = node.vkey;
1221
+ }
1222
+ if (node.vname) {
1223
+ vnodeData.name = node.vname;
1224
+ }
1225
+ return h(node.vtag, vnodeData, ...node.vchildren || []);
1226
+ }
1227
+ const vnode = newVNode(node.vtag, node.vtext);
1228
+ vnode.$attrs$ = node.vattrs;
1229
+ vnode.$children$ = node.vchildren;
1230
+ vnode.$key$ = node.vkey;
1231
+ vnode.$name$ = node.vname;
1232
+ return vnode;
1233
+ };
1234
+
1235
+ // src/runtime/client-hydrate.ts
1236
+ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1237
+ var _a, _b;
1238
+ const endHydrate = createTime("hydrateClient", tagName);
1239
+ const shadowRoot = hostElm.shadowRoot;
1240
+ const childRenderNodes = [];
1241
+ const slotNodes = [];
1242
+ const slottedNodes = [];
1243
+ const shadowRootNodes = shadowRoot ? [] : null;
1244
+ const vnode = newVNode(tagName, null);
1245
+ vnode.$elm$ = hostElm;
1246
+ let scopeId2;
1247
+ {
1248
+ const cmpMeta = hostRef.$cmpMeta$;
1249
+ if (cmpMeta && cmpMeta.$flags$ & 10 /* needsScopedEncapsulation */ && hostElm["s-sc"]) {
1250
+ scopeId2 = hostElm["s-sc"];
1251
+ hostElm.classList.add(scopeId2 + "-h");
1252
+ } else if (hostElm["s-sc"]) {
1253
+ delete hostElm["s-sc"];
1254
+ }
1255
+ }
1256
+ if (win.document && (!plt.$orgLocNodes$ || !plt.$orgLocNodes$.size)) {
1257
+ initializeDocumentHydrate(win.document.body, plt.$orgLocNodes$ = /* @__PURE__ */ new Map());
1258
+ }
1259
+ hostElm[HYDRATE_ID] = hostId;
1260
+ hostElm.removeAttribute(HYDRATE_ID);
1261
+ hostRef.$vnode$ = clientHydrate(
1262
+ vnode,
1263
+ childRenderNodes,
1264
+ slotNodes,
1265
+ shadowRootNodes,
1266
+ hostElm,
1267
+ hostElm,
1268
+ hostId,
1269
+ slottedNodes
1270
+ );
1271
+ let crIndex = 0;
1272
+ const crLength = childRenderNodes.length;
1273
+ let childRenderNode;
1274
+ for (crIndex; crIndex < crLength; crIndex++) {
1275
+ childRenderNode = childRenderNodes[crIndex];
1276
+ const orgLocationId = childRenderNode.$hostId$ + "." + childRenderNode.$nodeId$;
1277
+ const orgLocationNode = plt.$orgLocNodes$.get(orgLocationId);
1278
+ const node = childRenderNode.$elm$;
1279
+ if (!shadowRoot) {
1280
+ node["s-hn"] = tagName.toUpperCase();
1281
+ if (childRenderNode.$tag$ === "slot") {
1282
+ node["s-cr"] = hostElm["s-cr"];
1283
+ }
1284
+ } else if (((_a = childRenderNode.$tag$) == null ? void 0 : _a.toString().includes("-")) && childRenderNode.$tag$ !== "slot-fb" && !childRenderNode.$elm$.shadowRoot) {
1285
+ const cmpMeta = getHostRef(childRenderNode.$elm$);
1286
+ if (cmpMeta) {
1287
+ const scopeId3 = getScopeId(
1288
+ cmpMeta.$cmpMeta$,
1289
+ childRenderNode.$elm$.getAttribute("s-mode")
1290
+ );
1291
+ const styleSheet = win.document.querySelector(`style[sty-id="${scopeId3}"]`);
1292
+ if (styleSheet) {
1293
+ hostElm.shadowRoot.append(styleSheet.cloneNode(true));
1294
+ }
1295
+ }
1296
+ }
1297
+ if (childRenderNode.$tag$ === "slot") {
1298
+ childRenderNode.$name$ = childRenderNode.$elm$["s-sn"] || childRenderNode.$elm$["name"] || null;
1299
+ if (childRenderNode.$children$) {
1300
+ childRenderNode.$flags$ |= 2 /* isSlotFallback */;
1301
+ if (!childRenderNode.$elm$.childNodes.length) {
1302
+ childRenderNode.$children$.forEach((c) => {
1303
+ childRenderNode.$elm$.appendChild(c.$elm$);
1304
+ });
1305
+ }
1306
+ } else {
1307
+ childRenderNode.$flags$ |= 1 /* isSlotReference */;
1308
+ }
1309
+ }
1310
+ if (orgLocationNode && orgLocationNode.isConnected) {
1311
+ if (orgLocationNode.parentElement.shadowRoot && orgLocationNode["s-en"] === "") {
1312
+ orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
1313
+ }
1314
+ orgLocationNode.parentNode.removeChild(orgLocationNode);
1315
+ if (!shadowRoot) {
1316
+ node["s-oo"] = parseInt(childRenderNode.$nodeId$);
1317
+ }
1318
+ }
1319
+ if (orgLocationNode && !orgLocationNode["s-id"]) {
1320
+ plt.$orgLocNodes$.delete(orgLocationId);
1321
+ }
1322
+ }
1323
+ const hosts = [];
1324
+ const snLen = slottedNodes.length;
1325
+ let snIndex = 0;
1326
+ let slotGroup;
1327
+ let snGroupIdx;
1328
+ let snGroupLen;
1329
+ let slottedItem;
1330
+ for (snIndex; snIndex < snLen; snIndex++) {
1331
+ slotGroup = slottedNodes[snIndex];
1332
+ if (!slotGroup || !slotGroup.length) continue;
1333
+ snGroupLen = slotGroup.length;
1334
+ snGroupIdx = 0;
1335
+ for (snGroupIdx; snGroupIdx < snGroupLen; snGroupIdx++) {
1336
+ slottedItem = slotGroup[snGroupIdx];
1337
+ if (!hosts[slottedItem.hostId]) {
1338
+ hosts[slottedItem.hostId] = plt.$orgLocNodes$.get(slottedItem.hostId);
1339
+ }
1340
+ if (!hosts[slottedItem.hostId]) continue;
1341
+ const hostEle = hosts[slottedItem.hostId];
1342
+ if (hostEle.shadowRoot && slottedItem.node.parentElement !== hostEle) {
1343
+ hostEle.appendChild(slottedItem.node);
1344
+ }
1345
+ if (!hostEle.shadowRoot || !shadowRoot) {
1346
+ if (!slottedItem.slot["s-cr"]) {
1347
+ slottedItem.slot["s-cr"] = hostEle["s-cr"];
1348
+ if (!slottedItem.slot["s-cr"] && hostEle.shadowRoot) {
1349
+ slottedItem.slot["s-cr"] = hostEle;
1350
+ } else {
1351
+ slottedItem.slot["s-cr"] = (hostEle.__childNodes || hostEle.childNodes)[0];
1352
+ }
1353
+ }
1354
+ addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node["s-oo"]);
1355
+ if (((_b = slottedItem.node.parentElement) == null ? void 0 : _b.shadowRoot) && slottedItem.node["getAttribute"] && slottedItem.node.getAttribute("slot")) {
1356
+ slottedItem.node.removeAttribute("slot");
1357
+ }
1358
+ {
1359
+ patchSlottedNode(slottedItem.node);
1360
+ }
1361
+ }
1362
+ }
1363
+ }
1364
+ if (scopeId2 && slotNodes.length) {
1365
+ slotNodes.forEach((slot) => {
1366
+ slot.$elm$.parentElement.classList.add(scopeId2 + "-s");
1367
+ });
1368
+ }
1369
+ if (shadowRoot) {
1370
+ let rnIdex = 0;
1371
+ const rnLen = shadowRootNodes.length;
1372
+ if (rnLen) {
1373
+ for (rnIdex; rnIdex < rnLen; rnIdex++) {
1374
+ const node = shadowRootNodes[rnIdex];
1375
+ if (node) {
1376
+ shadowRoot.appendChild(node);
1377
+ }
1378
+ }
1379
+ Array.from(hostElm.childNodes).forEach((node) => {
1380
+ if (typeof node["s-en"] !== "string" && typeof node["s-sn"] !== "string") {
1381
+ if (node.nodeType === 1 /* ElementNode */ && node.slot && node.hidden) {
1382
+ node.removeAttribute("hidden");
1383
+ } else if (node.nodeType === 8 /* CommentNode */ && !node.nodeValue || node.nodeType === 3 /* TextNode */ && !node.wholeText.trim()) {
1384
+ node.parentNode.removeChild(node);
1385
+ }
1386
+ }
1387
+ });
1388
+ }
1389
+ }
1390
+ hostRef.$hostElement$ = hostElm;
1391
+ endHydrate();
1392
+ };
1393
+ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node, hostId, slottedNodes = []) => {
1394
+ let childNodeType;
1395
+ let childIdSplt;
1396
+ let childVNode;
1397
+ let i2;
1398
+ const scopeId2 = hostElm["s-sc"];
1399
+ if (node.nodeType === 1 /* ElementNode */) {
1400
+ childNodeType = node.getAttribute(HYDRATE_CHILD_ID);
1401
+ if (childNodeType) {
1402
+ childIdSplt = childNodeType.split(".");
1403
+ if (childIdSplt[0] === hostId || childIdSplt[0] === "0") {
1404
+ childVNode = createSimpleVNode({
1405
+ $flags$: 0,
1406
+ $hostId$: childIdSplt[0],
1407
+ $nodeId$: childIdSplt[1],
1408
+ $depth$: childIdSplt[2],
1409
+ $index$: childIdSplt[3],
1410
+ $tag$: node.tagName.toLowerCase(),
1411
+ $elm$: node,
1412
+ // If we don't add the initial classes to the VNode, the first `vdom-render.ts` patch
1413
+ // won't try to reconcile them. Classes set on the node will be blown away.
1414
+ $attrs$: { class: node.className || "" }
1415
+ });
1416
+ childRenderNodes.push(childVNode);
1417
+ node.removeAttribute(HYDRATE_CHILD_ID);
1418
+ if (!parentVNode.$children$) {
1419
+ parentVNode.$children$ = [];
1420
+ }
1421
+ if (scopeId2 && childIdSplt[0] === hostId) {
1422
+ node["s-si"] = scopeId2;
1423
+ childVNode.$attrs$.class += " " + scopeId2;
1424
+ }
1425
+ const slotName = childVNode.$elm$.getAttribute("s-sn");
1426
+ if (typeof slotName === "string") {
1427
+ if (childVNode.$tag$ === "slot-fb") {
1428
+ addSlot(
1429
+ slotName,
1430
+ childIdSplt[2],
1431
+ childVNode,
1432
+ node,
1433
+ parentVNode,
1434
+ childRenderNodes,
1435
+ slotNodes,
1436
+ shadowRootNodes,
1437
+ slottedNodes
1438
+ );
1439
+ if (scopeId2) {
1440
+ node.classList.add(scopeId2);
1441
+ }
1442
+ }
1443
+ childVNode.$elm$["s-sn"] = slotName;
1444
+ childVNode.$elm$.removeAttribute("s-sn");
1445
+ }
1446
+ if (childVNode.$index$ !== void 0) {
1447
+ parentVNode.$children$[childVNode.$index$] = childVNode;
1448
+ }
1449
+ parentVNode = childVNode;
1450
+ if (shadowRootNodes && childVNode.$depth$ === "0") {
1451
+ shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
1452
+ }
1453
+ }
1454
+ }
1455
+ if (node.shadowRoot) {
1456
+ for (i2 = node.shadowRoot.childNodes.length - 1; i2 >= 0; i2--) {
1457
+ clientHydrate(
1458
+ parentVNode,
1459
+ childRenderNodes,
1460
+ slotNodes,
1461
+ shadowRootNodes,
1462
+ hostElm,
1463
+ node.shadowRoot.childNodes[i2],
1464
+ hostId,
1465
+ slottedNodes
1466
+ );
1467
+ }
1468
+ }
1469
+ const nonShadowNodes = node.__childNodes || node.childNodes;
1470
+ for (i2 = nonShadowNodes.length - 1; i2 >= 0; i2--) {
1471
+ clientHydrate(
1472
+ parentVNode,
1473
+ childRenderNodes,
1474
+ slotNodes,
1475
+ shadowRootNodes,
1476
+ hostElm,
1477
+ nonShadowNodes[i2],
1478
+ hostId,
1479
+ slottedNodes
1480
+ );
1481
+ }
1482
+ } else if (node.nodeType === 8 /* CommentNode */) {
1483
+ childIdSplt = node.nodeValue.split(".");
1484
+ if (childIdSplt[1] === hostId || childIdSplt[1] === "0") {
1485
+ childNodeType = childIdSplt[0];
1486
+ childVNode = createSimpleVNode({
1487
+ $hostId$: childIdSplt[1],
1488
+ $nodeId$: childIdSplt[2],
1489
+ $depth$: childIdSplt[3],
1490
+ $index$: childIdSplt[4] || "0",
1491
+ $elm$: node,
1492
+ $attrs$: null,
1493
+ $children$: null,
1494
+ $key$: null,
1495
+ $name$: null,
1496
+ $tag$: null,
1497
+ $text$: null
1498
+ });
1499
+ if (childNodeType === TEXT_NODE_ID) {
1500
+ childVNode.$elm$ = findCorrespondingNode(node, 3 /* TextNode */);
1501
+ if (childVNode.$elm$ && childVNode.$elm$.nodeType === 3 /* TextNode */) {
1502
+ childVNode.$text$ = childVNode.$elm$.textContent;
1503
+ childRenderNodes.push(childVNode);
1504
+ node.remove();
1505
+ if (hostId === childVNode.$hostId$) {
1506
+ if (!parentVNode.$children$) {
1507
+ parentVNode.$children$ = [];
1508
+ }
1509
+ parentVNode.$children$[childVNode.$index$] = childVNode;
1510
+ }
1511
+ if (shadowRootNodes && childVNode.$depth$ === "0") {
1512
+ shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
1513
+ }
1514
+ }
1515
+ } else if (childNodeType === COMMENT_NODE_ID) {
1516
+ childVNode.$elm$ = findCorrespondingNode(node, 8 /* CommentNode */);
1517
+ if (childVNode.$elm$ && childVNode.$elm$.nodeType === 8 /* CommentNode */) {
1518
+ childRenderNodes.push(childVNode);
1519
+ node.remove();
1520
+ }
1521
+ } else if (childVNode.$hostId$ === hostId) {
1522
+ if (childNodeType === SLOT_NODE_ID) {
1523
+ const slotName = node["s-sn"] = childIdSplt[5] || "";
1524
+ addSlot(
1525
+ slotName,
1526
+ childIdSplt[2],
1527
+ childVNode,
1528
+ node,
1529
+ parentVNode,
1530
+ childRenderNodes,
1531
+ slotNodes,
1532
+ shadowRootNodes,
1533
+ slottedNodes
1534
+ );
1535
+ } else if (childNodeType === CONTENT_REF_ID) {
1536
+ if (shadowRootNodes) {
1537
+ node.remove();
1538
+ } else {
1539
+ hostElm["s-cr"] = node;
1540
+ node["s-cn"] = true;
1541
+ }
1542
+ }
1543
+ }
1544
+ }
1545
+ } else if (parentVNode && parentVNode.$tag$ === "style") {
1546
+ const vnode = newVNode(null, node.textContent);
1547
+ vnode.$elm$ = node;
1548
+ vnode.$index$ = "0";
1549
+ parentVNode.$children$ = [vnode];
1550
+ } else {
1551
+ if (node.nodeType === 3 /* TextNode */ && !node.wholeText.trim() && !node["s-nr"]) {
1552
+ node.remove();
1553
+ }
1554
+ }
1555
+ return parentVNode;
1556
+ };
1557
+ var initializeDocumentHydrate = (node, orgLocNodes) => {
1558
+ if (node.nodeType === 1 /* ElementNode */) {
1559
+ const componentId = node[HYDRATE_ID] || node.getAttribute(HYDRATE_ID);
1560
+ if (componentId) {
1561
+ orgLocNodes.set(componentId, node);
1562
+ }
1563
+ let i2 = 0;
1564
+ if (node.shadowRoot) {
1565
+ for (; i2 < node.shadowRoot.childNodes.length; i2++) {
1566
+ initializeDocumentHydrate(node.shadowRoot.childNodes[i2], orgLocNodes);
1567
+ }
1568
+ }
1569
+ const nonShadowNodes = node.__childNodes || node.childNodes;
1570
+ for (i2 = 0; i2 < nonShadowNodes.length; i2++) {
1571
+ initializeDocumentHydrate(nonShadowNodes[i2], orgLocNodes);
1572
+ }
1573
+ } else if (node.nodeType === 8 /* CommentNode */) {
1574
+ const childIdSplt = node.nodeValue.split(".");
1575
+ if (childIdSplt[0] === ORG_LOCATION_ID) {
1576
+ orgLocNodes.set(childIdSplt[1] + "." + childIdSplt[2], node);
1577
+ node.nodeValue = "";
1578
+ node["s-en"] = childIdSplt[3];
1579
+ }
1580
+ }
1581
+ };
1582
+ var createSimpleVNode = (vnode) => {
1583
+ const defaultVNode = {
1584
+ $flags$: 0,
1585
+ $hostId$: null,
1586
+ $nodeId$: null,
1587
+ $depth$: null,
1588
+ $index$: "0",
1589
+ $elm$: null,
1590
+ $attrs$: null,
1591
+ $children$: null,
1592
+ $key$: null,
1593
+ $name$: null,
1594
+ $tag$: null,
1595
+ $text$: null
1596
+ };
1597
+ return { ...defaultVNode, ...vnode };
1598
+ };
1599
+ function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNodes, slotNodes, shadowRootNodes, slottedNodes) {
1600
+ node["s-sr"] = true;
1601
+ childVNode.$name$ = slotName || null;
1602
+ childVNode.$tag$ = "slot";
1603
+ const parentNodeId = (parentVNode == null ? void 0 : parentVNode.$elm$) ? parentVNode.$elm$["s-id"] || parentVNode.$elm$.getAttribute("s-id") : "";
1604
+ if (shadowRootNodes && win.document) {
1605
+ const slot = childVNode.$elm$ = win.document.createElement(childVNode.$tag$);
1606
+ if (childVNode.$name$) {
1607
+ childVNode.$elm$.setAttribute("name", slotName);
1608
+ }
1609
+ if (parentVNode.$elm$.shadowRoot && parentNodeId && parentNodeId !== childVNode.$hostId$) {
1610
+ internalCall(parentVNode.$elm$, "insertBefore")(slot, internalCall(parentVNode.$elm$, "children")[0]);
1611
+ } else {
1612
+ internalCall(internalCall(node, "parentNode"), "insertBefore")(slot, node);
1613
+ }
1614
+ addSlottedNodes(slottedNodes, slotId, slotName, node, childVNode.$hostId$);
1615
+ node.remove();
1616
+ if (childVNode.$depth$ === "0") {
1617
+ shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
1618
+ }
1619
+ } else {
1620
+ const slot = childVNode.$elm$;
1621
+ const shouldMove = parentNodeId && parentNodeId !== childVNode.$hostId$ && parentVNode.$elm$.shadowRoot;
1622
+ addSlottedNodes(slottedNodes, slotId, slotName, node, shouldMove ? parentNodeId : childVNode.$hostId$);
1623
+ patchSlotNode(node);
1624
+ if (shouldMove) {
1625
+ parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
1626
+ }
1627
+ }
1628
+ childRenderNodes.push(childVNode);
1629
+ slotNodes.push(childVNode);
1630
+ if (!parentVNode.$children$) {
1631
+ parentVNode.$children$ = [];
1632
+ }
1633
+ parentVNode.$children$[childVNode.$index$] = childVNode;
1634
+ }
1635
+ var addSlottedNodes = (slottedNodes, slotNodeId, slotName, slotNode, hostId) => {
1636
+ var _a, _b;
1637
+ let slottedNode = slotNode.nextSibling;
1638
+ slottedNodes[slotNodeId] = slottedNodes[slotNodeId] || [];
1639
+ if (!slottedNode || ((_a = slottedNode.nodeValue) == null ? void 0 : _a.startsWith(SLOT_NODE_ID + "."))) return;
1640
+ do {
1641
+ if (slottedNode && ((slottedNode["getAttribute"] && slottedNode.getAttribute("slot") || slottedNode["s-sn"]) === slotName || slotName === "" && !slottedNode["s-sn"] && (!slottedNode["getAttribute"] || !slottedNode.getAttribute("slot")) && (slottedNode.nodeType === 8 /* CommentNode */ || slottedNode.nodeType === 3 /* TextNode */))) {
1642
+ slottedNode["s-sn"] = slotName;
1643
+ slottedNodes[slotNodeId].push({ slot: slotNode, node: slottedNode, hostId });
1644
+ }
1645
+ slottedNode = slottedNode == null ? void 0 : slottedNode.nextSibling;
1646
+ } while (slottedNode && !((_b = slottedNode.nodeValue) == null ? void 0 : _b.startsWith(SLOT_NODE_ID + ".")));
1647
+ };
1648
+ var findCorrespondingNode = (node, type) => {
1649
+ let sibling = node;
1650
+ do {
1651
+ sibling = sibling.nextSibling;
1652
+ } while (sibling && (sibling.nodeType !== type || !sibling.nodeValue));
1653
+ return sibling;
1654
+ };
1655
+ var createSupportsRuleRe = (selector) => {
1656
+ const safeSelector2 = escapeRegExpSpecialCharacters(selector);
1657
+ return new RegExp(
1658
+ // First capture group: match any context before the selector that's not inside @supports selector()
1659
+ // Using negative lookahead to avoid matching inside @supports selector(...) condition
1660
+ `(^|[^@]|@(?!supports\\s+selector\\s*\\([^{]*?${safeSelector2}))(${safeSelector2}\\b)`,
1661
+ "g"
1662
+ );
1663
+ };
1664
+ createSupportsRuleRe("::slotted");
1665
+ createSupportsRuleRe(":host");
1666
+ createSupportsRuleRe(":host-context");
1667
+
1668
+ // src/runtime/mode.ts
1669
+ var computeMode = (elm) => modeResolutionChain.map((h2) => h2(elm)).find((m) => !!m);
1670
+ var setMode = (handler) => modeResolutionChain.push(handler);
1671
+ var getMode = (ref) => {
1672
+ var _a;
1673
+ return (_a = getHostRef(ref)) == null ? void 0 : _a.$modeName$;
1674
+ };
1675
+ var parsePropertyValue = (propValue, propType, isFormAssociated) => {
1676
+ if (typeof propValue === "string" && propValue.startsWith(SERIALIZED_PREFIX)) {
1677
+ propValue = deserializeProperty(propValue);
1678
+ return propValue;
1679
+ }
1680
+ if (propValue != null && !isComplexType(propValue)) {
1681
+ if (propType & 4 /* Boolean */) {
1682
+ {
1683
+ return propValue === "false" ? false : propValue === "" || !!propValue;
1684
+ }
1685
+ }
1686
+ if (propType & 2 /* Number */) {
1687
+ return typeof propValue === "string" ? parseFloat(propValue) : typeof propValue === "number" ? propValue : NaN;
1688
+ }
1689
+ if (propType & 1 /* String */) {
1690
+ return String(propValue);
1691
+ }
1692
+ return propValue;
1693
+ }
1694
+ return propValue;
1695
+ };
1696
+ var getElement = (ref) => {
1697
+ return ref;
1698
+ };
1699
+
1700
+ // src/runtime/event-emitter.ts
1701
+ var createEvent = (ref, name, flags) => {
1702
+ const elm = getElement(ref);
1703
+ return {
1704
+ emit: (detail) => {
1705
+ return emitEvent(elm, name, {
1706
+ bubbles: !!(flags & 4 /* Bubbles */),
1707
+ composed: !!(flags & 2 /* Composed */),
1708
+ cancelable: !!(flags & 1 /* Cancellable */),
1709
+ detail
1710
+ });
1711
+ }
1712
+ };
1713
+ };
1714
+ var emitEvent = (elm, name, opts) => {
1715
+ const ev = plt.ce(name, opts);
1716
+ elm.dispatchEvent(ev);
1717
+ return ev;
1718
+ };
1719
+ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRender) => {
1720
+ if (oldValue === newValue) {
1721
+ return;
1722
+ }
1723
+ let isProp = isMemberInElement(elm, memberName);
1724
+ let ln = memberName.toLowerCase();
1725
+ if (memberName === "class") {
1726
+ const classList = elm.classList;
1727
+ const oldClasses = parseClassList(oldValue);
1728
+ let newClasses = parseClassList(newValue);
1729
+ if ((elm["s-si"] || elm["s-sc"]) && initialRender) {
1730
+ const scopeId2 = elm["s-sc"] || elm["s-si"];
1731
+ newClasses.push(scopeId2);
1732
+ oldClasses.forEach((c) => {
1733
+ if (c.startsWith(scopeId2)) newClasses.push(c);
1734
+ });
1735
+ newClasses = [...new Set(newClasses)].filter((c) => c);
1736
+ classList.add(...newClasses);
1737
+ } else {
1738
+ classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
1739
+ classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
1740
+ }
1741
+ } else if (memberName === "style") {
1742
+ {
1743
+ for (const prop in oldValue) {
1744
+ if (!newValue || newValue[prop] == null) {
1745
+ if (prop.includes("-")) {
1746
+ elm.style.removeProperty(prop);
1747
+ } else {
1748
+ elm.style[prop] = "";
1749
+ }
1750
+ }
1751
+ }
1752
+ }
1753
+ for (const prop in newValue) {
1754
+ if (!oldValue || newValue[prop] !== oldValue[prop]) {
1755
+ if (prop.includes("-")) {
1756
+ elm.style.setProperty(prop, newValue[prop]);
1757
+ } else {
1758
+ elm.style[prop] = newValue[prop];
1759
+ }
1760
+ }
1761
+ }
1762
+ } else if (memberName === "key") ; else if (memberName === "ref") {
1763
+ if (newValue) {
1764
+ newValue(elm);
1765
+ }
1766
+ } else if ((!elm.__lookupSetter__(memberName)) && memberName[0] === "o" && memberName[1] === "n") {
1767
+ if (memberName[2] === "-") {
1768
+ memberName = memberName.slice(3);
1769
+ } else if (isMemberInElement(win, ln)) {
1770
+ memberName = ln.slice(2);
1771
+ } else {
1772
+ memberName = ln[2] + memberName.slice(3);
1773
+ }
1774
+ if (oldValue || newValue) {
1775
+ const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
1776
+ memberName = memberName.replace(CAPTURE_EVENT_REGEX, "");
1777
+ if (oldValue) {
1778
+ plt.rel(elm, memberName, oldValue, capture);
1779
+ }
1780
+ if (newValue) {
1781
+ plt.ael(elm, memberName, newValue, capture);
1782
+ }
1783
+ }
1784
+ } else {
1785
+ const isComplex = isComplexType(newValue);
1786
+ if ((isProp || isComplex && newValue !== null) && !isSvg) {
1787
+ try {
1788
+ if (!elm.tagName.includes("-")) {
1789
+ const n = newValue == null ? "" : newValue;
1790
+ if (memberName === "list") {
1791
+ isProp = false;
1792
+ } else if (oldValue == null || elm[memberName] != n) {
1793
+ if (typeof elm.__lookupSetter__(memberName) === "function") {
1794
+ elm[memberName] = n;
1795
+ } else {
1796
+ elm.setAttribute(memberName, n);
1797
+ }
1798
+ }
1799
+ } else if (elm[memberName] !== newValue) {
1800
+ elm[memberName] = newValue;
1801
+ }
1802
+ } catch (e) {
1803
+ }
1804
+ }
1805
+ let xlink = false;
1806
+ {
1807
+ if (ln !== (ln = ln.replace(/^xlink\:?/, ""))) {
1808
+ memberName = ln;
1809
+ xlink = true;
1810
+ }
1811
+ }
1812
+ if (newValue == null || newValue === false) {
1813
+ if (newValue !== false || elm.getAttribute(memberName) === "") {
1814
+ if (xlink) {
1815
+ elm.removeAttributeNS(XLINK_NS, memberName);
1816
+ } else {
1817
+ elm.removeAttribute(memberName);
1818
+ }
1819
+ }
1820
+ } else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex && elm.nodeType === 1 /* ElementNode */) {
1821
+ newValue = newValue === true ? "" : newValue;
1822
+ if (xlink) {
1823
+ elm.setAttributeNS(XLINK_NS, memberName, newValue);
1824
+ } else {
1825
+ elm.setAttribute(memberName, newValue);
1826
+ }
1827
+ }
1828
+ }
1829
+ };
1830
+ var parseClassListRegex = /\s/;
1831
+ var parseClassList = (value) => {
1832
+ if (typeof value === "object" && value && "baseVal" in value) {
1833
+ value = value.baseVal;
1834
+ }
1835
+ if (!value || typeof value !== "string") {
1836
+ return [];
1837
+ }
1838
+ return value.split(parseClassListRegex);
1839
+ };
1840
+ var CAPTURE_EVENT_SUFFIX = "Capture";
1841
+ var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
1842
+
1843
+ // src/runtime/vdom/update-element.ts
1844
+ var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
1845
+ const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
1846
+ const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || {};
1847
+ const newVnodeAttrs = newVnode.$attrs$ || {};
1848
+ {
1849
+ for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
1850
+ if (!(memberName in newVnodeAttrs)) {
1851
+ setAccessor(
1852
+ elm,
1853
+ memberName,
1854
+ oldVnodeAttrs[memberName],
1855
+ void 0,
1856
+ isSvgMode2,
1857
+ newVnode.$flags$,
1858
+ isInitialRender
1859
+ );
1860
+ }
1861
+ }
1862
+ }
1863
+ for (const memberName of sortedAttrNames(Object.keys(newVnodeAttrs))) {
1864
+ setAccessor(
1865
+ elm,
1866
+ memberName,
1867
+ oldVnodeAttrs[memberName],
1868
+ newVnodeAttrs[memberName],
1869
+ isSvgMode2,
1870
+ newVnode.$flags$,
1871
+ isInitialRender
1872
+ );
1873
+ }
1874
+ };
1875
+ function sortedAttrNames(attrNames) {
1876
+ return attrNames.includes("ref") ? (
1877
+ // we need to sort these to ensure that `'ref'` is the last attr
1878
+ [...attrNames.filter((attr) => attr !== "ref"), "ref"]
1879
+ ) : (
1880
+ // no need to sort, return the original array
1881
+ attrNames
1882
+ );
1883
+ }
1884
+
1885
+ // src/runtime/vdom/vdom-render.ts
1886
+ var scopeId;
1887
+ var contentRef;
1888
+ var hostTagName;
1889
+ var useNativeShadowDom = false;
1890
+ var checkSlotFallbackVisibility = false;
1891
+ var checkSlotRelocate = false;
1892
+ var isSvgMode = false;
1893
+ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
1894
+ var _a;
1895
+ const newVNode2 = newParentVNode.$children$[childIndex];
1896
+ let i2 = 0;
1897
+ let elm;
1898
+ let childNode;
1899
+ let oldVNode;
1900
+ if (!useNativeShadowDom) {
1901
+ checkSlotRelocate = true;
1902
+ if (newVNode2.$tag$ === "slot") {
1903
+ newVNode2.$flags$ |= newVNode2.$children$ ? (
1904
+ // slot element has fallback content
1905
+ // still create an element that "mocks" the slot element
1906
+ 2 /* isSlotFallback */
1907
+ ) : (
1908
+ // slot element does not have fallback content
1909
+ // create an html comment we'll use to always reference
1910
+ // where actual slot content should sit next to
1911
+ 1 /* isSlotReference */
1912
+ );
1913
+ }
1914
+ }
1915
+ if (newVNode2.$text$ !== null) {
1916
+ elm = newVNode2.$elm$ = win.document.createTextNode(newVNode2.$text$);
1917
+ } else if (newVNode2.$flags$ & 1 /* isSlotReference */) {
1918
+ elm = newVNode2.$elm$ = win.document.createTextNode("");
1919
+ {
1920
+ updateElement(null, newVNode2, isSvgMode);
1921
+ }
1922
+ } else {
1923
+ if (!isSvgMode) {
1924
+ isSvgMode = newVNode2.$tag$ === "svg";
1925
+ }
1926
+ if (!win.document) {
1927
+ throw new Error(
1928
+ "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."
1929
+ );
1930
+ }
1931
+ elm = newVNode2.$elm$ = win.document.createElementNS(
1932
+ isSvgMode ? SVG_NS : HTML_NS,
1933
+ !useNativeShadowDom && BUILD.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
1934
+ ) ;
1935
+ if (isSvgMode && newVNode2.$tag$ === "foreignObject") {
1936
+ isSvgMode = false;
1937
+ }
1938
+ {
1939
+ updateElement(null, newVNode2, isSvgMode);
1940
+ }
1941
+ if (isDef(scopeId) && elm["s-si"] !== scopeId) {
1942
+ elm.classList.add(elm["s-si"] = scopeId);
1943
+ }
1944
+ if (newVNode2.$children$) {
1945
+ for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
1946
+ childNode = createElm(oldParentVNode, newVNode2, i2);
1947
+ if (childNode) {
1948
+ elm.appendChild(childNode);
1949
+ }
1950
+ }
1951
+ }
1952
+ {
1953
+ if (newVNode2.$tag$ === "svg") {
1954
+ isSvgMode = false;
1955
+ } else if (elm.tagName === "foreignObject") {
1956
+ isSvgMode = true;
1957
+ }
1958
+ }
1959
+ }
1960
+ elm["s-hn"] = hostTagName;
1961
+ {
1962
+ if (newVNode2.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
1963
+ elm["s-sr"] = true;
1964
+ elm["s-cr"] = contentRef;
1965
+ elm["s-sn"] = newVNode2.$name$ || "";
1966
+ elm["s-rf"] = (_a = newVNode2.$attrs$) == null ? void 0 : _a.ref;
1967
+ patchSlotNode(elm);
1968
+ oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
1969
+ if (oldVNode && oldVNode.$tag$ === newVNode2.$tag$ && oldParentVNode.$elm$) {
1970
+ {
1971
+ relocateToHostRoot(oldParentVNode.$elm$);
1972
+ }
1973
+ }
1974
+ {
1975
+ addRemoveSlotScopedClass(contentRef, elm, newParentVNode.$elm$, oldParentVNode == null ? void 0 : oldParentVNode.$elm$);
1976
+ }
1977
+ }
1978
+ }
1979
+ return elm;
1980
+ };
1981
+ var relocateToHostRoot = (parentElm) => {
1982
+ plt.$flags$ |= 1 /* isTmpDisconnected */;
1983
+ const host = parentElm.closest(hostTagName.toLowerCase());
1984
+ if (host != null) {
1985
+ const contentRefNode = Array.from(host.__childNodes || host.childNodes).find(
1986
+ (ref) => ref["s-cr"]
1987
+ );
1988
+ const childNodeArray = Array.from(
1989
+ parentElm.__childNodes || parentElm.childNodes
1990
+ );
1991
+ for (const childNode of contentRefNode ? childNodeArray.reverse() : childNodeArray) {
1992
+ if (childNode["s-sh"] != null) {
1993
+ insertBefore(host, childNode, contentRefNode != null ? contentRefNode : null);
1994
+ childNode["s-sh"] = void 0;
1995
+ checkSlotRelocate = true;
1996
+ }
1997
+ }
1998
+ }
1999
+ plt.$flags$ &= -2 /* isTmpDisconnected */;
2000
+ };
2001
+ var putBackInOriginalLocation = (parentElm, recursive) => {
2002
+ plt.$flags$ |= 1 /* isTmpDisconnected */;
2003
+ const oldSlotChildNodes = Array.from(parentElm.__childNodes || parentElm.childNodes);
2004
+ if (parentElm["s-sr"] && BUILD.experimentalSlotFixes) {
2005
+ let node = parentElm;
2006
+ while (node = node.nextSibling) {
2007
+ if (node && node["s-sn"] === parentElm["s-sn"] && node["s-sh"] === hostTagName) {
2008
+ oldSlotChildNodes.push(node);
2009
+ }
2010
+ }
2011
+ }
2012
+ for (let i2 = oldSlotChildNodes.length - 1; i2 >= 0; i2--) {
2013
+ const childNode = oldSlotChildNodes[i2];
2014
+ if (childNode["s-hn"] !== hostTagName && childNode["s-ol"]) {
2015
+ insertBefore(referenceNode(childNode).parentNode, childNode, referenceNode(childNode));
2016
+ childNode["s-ol"].remove();
2017
+ childNode["s-ol"] = void 0;
2018
+ childNode["s-sh"] = void 0;
2019
+ checkSlotRelocate = true;
2020
+ }
2021
+ if (recursive) {
2022
+ putBackInOriginalLocation(childNode, recursive);
2023
+ }
2024
+ }
2025
+ plt.$flags$ &= -2 /* isTmpDisconnected */;
2026
+ };
2027
+ var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
2028
+ let containerElm = parentElm["s-cr"] && parentElm["s-cr"].parentNode || parentElm;
2029
+ let childNode;
2030
+ if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
2031
+ containerElm = containerElm.shadowRoot;
2032
+ }
2033
+ for (; startIdx <= endIdx; ++startIdx) {
2034
+ if (vnodes[startIdx]) {
2035
+ childNode = createElm(null, parentVNode, startIdx);
2036
+ if (childNode) {
2037
+ vnodes[startIdx].$elm$ = childNode;
2038
+ insertBefore(containerElm, childNode, referenceNode(before) );
2039
+ }
2040
+ }
2041
+ }
2042
+ };
2043
+ var removeVnodes = (vnodes, startIdx, endIdx) => {
2044
+ for (let index = startIdx; index <= endIdx; ++index) {
2045
+ const vnode = vnodes[index];
2046
+ if (vnode) {
2047
+ const elm = vnode.$elm$;
2048
+ nullifyVNodeRefs(vnode);
2049
+ if (elm) {
2050
+ {
2051
+ checkSlotFallbackVisibility = true;
2052
+ if (elm["s-ol"]) {
2053
+ elm["s-ol"].remove();
2054
+ } else {
2055
+ putBackInOriginalLocation(elm, true);
2056
+ }
2057
+ }
2058
+ elm.remove();
2059
+ }
2060
+ }
2061
+ }
2062
+ };
2063
+ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = false) => {
2064
+ let oldStartIdx = 0;
2065
+ let newStartIdx = 0;
2066
+ let idxInOld = 0;
2067
+ let i2 = 0;
2068
+ let oldEndIdx = oldCh.length - 1;
2069
+ let oldStartVnode = oldCh[0];
2070
+ let oldEndVnode = oldCh[oldEndIdx];
2071
+ let newEndIdx = newCh.length - 1;
2072
+ let newStartVnode = newCh[0];
2073
+ let newEndVnode = newCh[newEndIdx];
2074
+ let node;
2075
+ let elmToMove;
2076
+ while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
2077
+ if (oldStartVnode == null) {
2078
+ oldStartVnode = oldCh[++oldStartIdx];
2079
+ } else if (oldEndVnode == null) {
2080
+ oldEndVnode = oldCh[--oldEndIdx];
2081
+ } else if (newStartVnode == null) {
2082
+ newStartVnode = newCh[++newStartIdx];
2083
+ } else if (newEndVnode == null) {
2084
+ newEndVnode = newCh[--newEndIdx];
2085
+ } else if (isSameVnode(oldStartVnode, newStartVnode, isInitialRender)) {
2086
+ patch(oldStartVnode, newStartVnode, isInitialRender);
2087
+ oldStartVnode = oldCh[++oldStartIdx];
2088
+ newStartVnode = newCh[++newStartIdx];
2089
+ } else if (isSameVnode(oldEndVnode, newEndVnode, isInitialRender)) {
2090
+ patch(oldEndVnode, newEndVnode, isInitialRender);
2091
+ oldEndVnode = oldCh[--oldEndIdx];
2092
+ newEndVnode = newCh[--newEndIdx];
2093
+ } else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
2094
+ if ((oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
2095
+ putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
2096
+ }
2097
+ patch(oldStartVnode, newEndVnode, isInitialRender);
2098
+ insertBefore(parentElm, oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
2099
+ oldStartVnode = oldCh[++oldStartIdx];
2100
+ newEndVnode = newCh[--newEndIdx];
2101
+ } else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
2102
+ if ((oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
2103
+ putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
2104
+ }
2105
+ patch(oldEndVnode, newStartVnode, isInitialRender);
2106
+ insertBefore(parentElm, oldEndVnode.$elm$, oldStartVnode.$elm$);
2107
+ oldEndVnode = oldCh[--oldEndIdx];
2108
+ newStartVnode = newCh[++newStartIdx];
2109
+ } else {
2110
+ idxInOld = -1;
2111
+ {
2112
+ for (i2 = oldStartIdx; i2 <= oldEndIdx; ++i2) {
2113
+ if (oldCh[i2] && oldCh[i2].$key$ !== null && oldCh[i2].$key$ === newStartVnode.$key$) {
2114
+ idxInOld = i2;
2115
+ break;
2116
+ }
2117
+ }
2118
+ }
2119
+ if (idxInOld >= 0) {
2120
+ elmToMove = oldCh[idxInOld];
2121
+ if (elmToMove.$tag$ !== newStartVnode.$tag$) {
2122
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld);
2123
+ } else {
2124
+ patch(elmToMove, newStartVnode, isInitialRender);
2125
+ oldCh[idxInOld] = void 0;
2126
+ node = elmToMove.$elm$;
2127
+ }
2128
+ newStartVnode = newCh[++newStartIdx];
2129
+ } else {
2130
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx);
2131
+ newStartVnode = newCh[++newStartIdx];
2132
+ }
2133
+ if (node) {
2134
+ {
2135
+ insertBefore(
2136
+ referenceNode(oldStartVnode.$elm$).parentNode,
2137
+ node,
2138
+ referenceNode(oldStartVnode.$elm$)
2139
+ );
2140
+ }
2141
+ }
2142
+ }
2143
+ }
2144
+ if (oldStartIdx > oldEndIdx) {
2145
+ addVnodes(
2146
+ parentElm,
2147
+ newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$,
2148
+ newVNode2,
2149
+ newCh,
2150
+ newStartIdx,
2151
+ newEndIdx
2152
+ );
2153
+ } else if (newStartIdx > newEndIdx) {
2154
+ removeVnodes(oldCh, oldStartIdx, oldEndIdx);
2155
+ }
2156
+ };
2157
+ var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
2158
+ if (leftVNode.$tag$ === rightVNode.$tag$) {
2159
+ if (leftVNode.$tag$ === "slot") {
2160
+ return leftVNode.$name$ === rightVNode.$name$;
2161
+ }
2162
+ if (!isInitialRender) {
2163
+ return leftVNode.$key$ === rightVNode.$key$;
2164
+ }
2165
+ if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) {
2166
+ leftVNode.$key$ = rightVNode.$key$;
2167
+ }
2168
+ return true;
2169
+ }
2170
+ return false;
2171
+ };
2172
+ var referenceNode = (node) => node && node["s-ol"] || node;
2173
+ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
2174
+ const elm = newVNode2.$elm$ = oldVNode.$elm$;
2175
+ const oldChildren = oldVNode.$children$;
2176
+ const newChildren = newVNode2.$children$;
2177
+ const tag = newVNode2.$tag$;
2178
+ const text = newVNode2.$text$;
2179
+ let defaultHolder;
2180
+ if (text === null) {
2181
+ {
2182
+ isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
2183
+ }
2184
+ {
2185
+ if (tag === "slot" && !useNativeShadowDom) {
2186
+ if (oldVNode.$name$ !== newVNode2.$name$) {
2187
+ newVNode2.$elm$["s-sn"] = newVNode2.$name$ || "";
2188
+ relocateToHostRoot(newVNode2.$elm$.parentElement);
2189
+ }
2190
+ }
2191
+ updateElement(oldVNode, newVNode2, isSvgMode, isInitialRender);
2192
+ }
2193
+ if (oldChildren !== null && newChildren !== null) {
2194
+ updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
2195
+ } else if (newChildren !== null) {
2196
+ if (oldVNode.$text$ !== null) {
2197
+ elm.textContent = "";
2198
+ }
2199
+ addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);
2200
+ } else if (
2201
+ // don't do this on initial render as it can cause non-hydrated content to be removed
2202
+ !isInitialRender && BUILD.updatable && oldChildren !== null
2203
+ ) {
2204
+ removeVnodes(oldChildren, 0, oldChildren.length - 1);
2205
+ } else if (isInitialRender && BUILD.updatable && oldChildren !== null && newChildren === null) {
2206
+ newVNode2.$children$ = oldChildren;
2207
+ }
2208
+ if (isSvgMode && tag === "svg") {
2209
+ isSvgMode = false;
2210
+ }
2211
+ } else if ((defaultHolder = elm["s-cr"])) {
2212
+ defaultHolder.parentNode.textContent = text;
2213
+ } else if (oldVNode.$text$ !== text) {
2214
+ elm.data = text;
2215
+ }
2216
+ };
2217
+ var relocateNodes = [];
2218
+ var markSlotContentForRelocation = (elm) => {
2219
+ let node;
2220
+ let hostContentNodes;
2221
+ let j;
2222
+ const children = elm.__childNodes || elm.childNodes;
2223
+ for (const childNode of children) {
2224
+ if (childNode["s-sr"] && (node = childNode["s-cr"]) && node.parentNode) {
2225
+ hostContentNodes = node.parentNode.__childNodes || node.parentNode.childNodes;
2226
+ const slotName = childNode["s-sn"];
2227
+ for (j = hostContentNodes.length - 1; j >= 0; j--) {
2228
+ node = hostContentNodes[j];
2229
+ if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (!node["s-sh"] || node["s-sh"] !== childNode["s-hn"])) {
2230
+ if (isNodeLocatedInSlot(node, slotName)) {
2231
+ let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
2232
+ checkSlotFallbackVisibility = true;
2233
+ node["s-sn"] = node["s-sn"] || slotName;
2234
+ if (relocateNodeData) {
2235
+ relocateNodeData.$nodeToRelocate$["s-sh"] = childNode["s-hn"];
2236
+ relocateNodeData.$slotRefNode$ = childNode;
2237
+ } else {
2238
+ node["s-sh"] = childNode["s-hn"];
2239
+ relocateNodes.push({
2240
+ $slotRefNode$: childNode,
2241
+ $nodeToRelocate$: node
2242
+ });
2243
+ }
2244
+ if (node["s-sr"]) {
2245
+ relocateNodes.map((relocateNode) => {
2246
+ if (isNodeLocatedInSlot(relocateNode.$nodeToRelocate$, node["s-sn"])) {
2247
+ relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
2248
+ if (relocateNodeData && !relocateNode.$slotRefNode$) {
2249
+ relocateNode.$slotRefNode$ = relocateNodeData.$slotRefNode$;
2250
+ }
2251
+ }
2252
+ });
2253
+ }
2254
+ } else if (!relocateNodes.some((r) => r.$nodeToRelocate$ === node)) {
2255
+ relocateNodes.push({
2256
+ $nodeToRelocate$: node
2257
+ });
2258
+ }
2259
+ }
2260
+ }
2261
+ }
2262
+ if (childNode.nodeType === 1 /* ElementNode */) {
2263
+ markSlotContentForRelocation(childNode);
2264
+ }
2265
+ }
2266
+ };
2267
+ var nullifyVNodeRefs = (vNode) => {
2268
+ {
2269
+ vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
2270
+ vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
2271
+ }
2272
+ };
2273
+ var insertBefore = (parent, newNode, reference) => {
2274
+ if (typeof newNode["s-sn"] === "string" && !!newNode["s-sr"] && !!newNode["s-cr"]) {
2275
+ addRemoveSlotScopedClass(newNode["s-cr"], newNode, parent, newNode.parentElement);
2276
+ } else if (typeof newNode["s-sn"] === "string") {
2277
+ if (parent.getRootNode().nodeType !== 11 /* DOCUMENT_FRAGMENT_NODE */) {
2278
+ patchParentNode(newNode);
2279
+ }
2280
+ parent.insertBefore(newNode, reference);
2281
+ const { slotNode } = findSlotFromSlottedNode(newNode);
2282
+ if (slotNode) dispatchSlotChangeEvent(slotNode);
2283
+ return newNode;
2284
+ }
2285
+ if (parent.__insertBefore) {
2286
+ return parent.__insertBefore(newNode, reference);
2287
+ } else {
2288
+ return parent == null ? void 0 : parent.insertBefore(newNode, reference);
2289
+ }
2290
+ };
2291
+ function addRemoveSlotScopedClass(reference, slotNode, newParent, oldParent) {
2292
+ var _a, _b;
2293
+ let scopeId2;
2294
+ if (reference && typeof slotNode["s-sn"] === "string" && !!slotNode["s-sr"] && reference.parentNode && reference.parentNode["s-sc"] && (scopeId2 = slotNode["s-si"] || reference.parentNode["s-sc"])) {
2295
+ const scopeName = slotNode["s-sn"];
2296
+ const hostName = slotNode["s-hn"];
2297
+ (_a = newParent.classList) == null ? void 0 : _a.add(scopeId2 + "-s");
2298
+ if (oldParent && ((_b = oldParent.classList) == null ? void 0 : _b.contains(scopeId2 + "-s"))) {
2299
+ let child = (oldParent.__childNodes || oldParent.childNodes)[0];
2300
+ let found = false;
2301
+ while (child) {
2302
+ if (child["s-sn"] !== scopeName && child["s-hn"] === hostName && !!child["s-sr"]) {
2303
+ found = true;
2304
+ break;
2305
+ }
2306
+ child = child.nextSibling;
2307
+ }
2308
+ if (!found) oldParent.classList.remove(scopeId2 + "-s");
2309
+ }
2310
+ }
2311
+ }
2312
+ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
2313
+ var _a, _b, _c, _d, _e;
2314
+ const hostElm = hostRef.$hostElement$;
2315
+ const cmpMeta = hostRef.$cmpMeta$;
2316
+ const oldVNode = hostRef.$vnode$ || newVNode(null, null);
2317
+ const isHostElement = isHost(renderFnResults);
2318
+ const rootVnode = isHostElement ? renderFnResults : h(null, null, renderFnResults);
2319
+ hostTagName = hostElm.tagName;
2320
+ if (cmpMeta.$attrsToReflect$) {
2321
+ rootVnode.$attrs$ = rootVnode.$attrs$ || {};
2322
+ cmpMeta.$attrsToReflect$.forEach(([propName, attribute]) => {
2323
+ {
2324
+ rootVnode.$attrs$[attribute] = hostElm[propName];
2325
+ }
2326
+ });
2327
+ }
2328
+ if (isInitialLoad && rootVnode.$attrs$) {
2329
+ for (const key of Object.keys(rootVnode.$attrs$)) {
2330
+ if (hostElm.hasAttribute(key) && !["key", "ref", "style", "class"].includes(key)) {
2331
+ rootVnode.$attrs$[key] = hostElm[key];
2332
+ }
2333
+ }
2334
+ }
2335
+ rootVnode.$tag$ = null;
2336
+ rootVnode.$flags$ |= 4 /* isHost */;
2337
+ hostRef.$vnode$ = rootVnode;
2338
+ rootVnode.$elm$ = oldVNode.$elm$ = hostElm.shadowRoot || hostElm ;
2339
+ {
2340
+ scopeId = hostElm["s-sc"];
2341
+ }
2342
+ useNativeShadowDom = !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) && !(cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */);
2343
+ {
2344
+ contentRef = hostElm["s-cr"];
2345
+ checkSlotFallbackVisibility = false;
2346
+ }
2347
+ patch(oldVNode, rootVnode, isInitialLoad);
2348
+ {
2349
+ plt.$flags$ |= 1 /* isTmpDisconnected */;
2350
+ if (checkSlotRelocate) {
2351
+ markSlotContentForRelocation(rootVnode.$elm$);
2352
+ for (const relocateData of relocateNodes) {
2353
+ const nodeToRelocate = relocateData.$nodeToRelocate$;
2354
+ if (!nodeToRelocate["s-ol"] && win.document) {
2355
+ const orgLocationNode = win.document.createTextNode("");
2356
+ orgLocationNode["s-nr"] = nodeToRelocate;
2357
+ insertBefore(nodeToRelocate.parentNode, nodeToRelocate["s-ol"] = orgLocationNode, nodeToRelocate);
2358
+ }
2359
+ }
2360
+ for (const relocateData of relocateNodes) {
2361
+ const nodeToRelocate = relocateData.$nodeToRelocate$;
2362
+ const slotRefNode = relocateData.$slotRefNode$;
2363
+ if (slotRefNode) {
2364
+ const parentNodeRef = slotRefNode.parentNode;
2365
+ let insertBeforeNode = slotRefNode.nextSibling;
2366
+ if ((insertBeforeNode && insertBeforeNode.nodeType === 1 /* ElementNode */)) {
2367
+ let orgLocationNode = (_a = nodeToRelocate["s-ol"]) == null ? void 0 : _a.previousSibling;
2368
+ while (orgLocationNode) {
2369
+ let refNode = (_b = orgLocationNode["s-nr"]) != null ? _b : null;
2370
+ if (refNode && refNode["s-sn"] === nodeToRelocate["s-sn"] && parentNodeRef === (refNode.__parentNode || refNode.parentNode)) {
2371
+ refNode = refNode.nextSibling;
2372
+ while (refNode === nodeToRelocate || (refNode == null ? void 0 : refNode["s-sr"])) {
2373
+ refNode = refNode == null ? void 0 : refNode.nextSibling;
2374
+ }
2375
+ if (!refNode || !refNode["s-nr"]) {
2376
+ insertBeforeNode = refNode;
2377
+ break;
2378
+ }
2379
+ }
2380
+ orgLocationNode = orgLocationNode.previousSibling;
2381
+ }
2382
+ }
2383
+ const parent = nodeToRelocate.__parentNode || nodeToRelocate.parentNode;
2384
+ const nextSibling = nodeToRelocate.__nextSibling || nodeToRelocate.nextSibling;
2385
+ if (!insertBeforeNode && parentNodeRef !== parent || nextSibling !== insertBeforeNode) {
2386
+ if (nodeToRelocate !== insertBeforeNode) {
2387
+ insertBefore(parentNodeRef, nodeToRelocate, insertBeforeNode);
2388
+ if (nodeToRelocate.nodeType === 1 /* ElementNode */ && nodeToRelocate.tagName !== "SLOT-FB") {
2389
+ nodeToRelocate.hidden = (_c = nodeToRelocate["s-ih"]) != null ? _c : false;
2390
+ }
2391
+ }
2392
+ }
2393
+ nodeToRelocate && typeof slotRefNode["s-rf"] === "function" && slotRefNode["s-rf"](slotRefNode);
2394
+ } else {
2395
+ if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
2396
+ if (isInitialLoad) {
2397
+ nodeToRelocate["s-ih"] = (_d = nodeToRelocate.hidden) != null ? _d : false;
2398
+ }
2399
+ nodeToRelocate.hidden = true;
2400
+ }
2401
+ }
2402
+ }
2403
+ }
2404
+ if (checkSlotFallbackVisibility) {
2405
+ updateFallbackSlotVisibility(rootVnode.$elm$);
2406
+ }
2407
+ plt.$flags$ &= -2 /* isTmpDisconnected */;
2408
+ relocateNodes.length = 0;
2409
+ }
2410
+ if (cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
2411
+ const children = rootVnode.$elm$.__childNodes || rootVnode.$elm$.childNodes;
2412
+ for (const childNode of children) {
2413
+ if (childNode["s-hn"] !== hostTagName && !childNode["s-sh"]) {
2414
+ if (isInitialLoad && childNode["s-ih"] == null) {
2415
+ childNode["s-ih"] = (_e = childNode.hidden) != null ? _e : false;
2416
+ }
2417
+ childNode.hidden = true;
2418
+ }
2419
+ }
2420
+ }
2421
+ contentRef = void 0;
2422
+ };
2423
+
2424
+ // src/runtime/update-component.ts
2425
+ var attachToAncestor = (hostRef, ancestorComponent) => {
2426
+ if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
2427
+ const index = ancestorComponent["s-p"].push(
2428
+ new Promise(
2429
+ (r) => hostRef.$onRenderResolve$ = () => {
2430
+ ancestorComponent["s-p"].splice(index - 1, 1);
2431
+ r();
2432
+ }
2433
+ )
2434
+ );
2435
+ }
2436
+ };
2437
+ var scheduleUpdate = (hostRef, isInitialLoad) => {
2438
+ {
2439
+ hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
2440
+ }
2441
+ if (hostRef.$flags$ & 4 /* isWaitingForChildren */) {
2442
+ hostRef.$flags$ |= 512 /* needsRerender */;
2443
+ return;
2444
+ }
2445
+ attachToAncestor(hostRef, hostRef.$ancestorComponent$);
2446
+ const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
2447
+ if (isInitialLoad) {
2448
+ queueMicrotask(() => {
2449
+ dispatch();
2450
+ });
2451
+ return;
2452
+ }
2453
+ return writeTask(dispatch) ;
2454
+ };
2455
+ var dispatchHooks = (hostRef, isInitialLoad) => {
2456
+ const elm = hostRef.$hostElement$;
2457
+ const endSchedule = createTime("scheduleUpdate", hostRef.$cmpMeta$.$tagName$);
2458
+ const instance = elm;
2459
+ if (!instance) {
2460
+ throw new Error(
2461
+ `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`
2462
+ );
2463
+ }
2464
+ let maybePromise;
2465
+ if (isInitialLoad) {
2466
+ maybePromise = safeCall(instance, "componentWillLoad", void 0, elm);
2467
+ } else {
2468
+ maybePromise = safeCall(instance, "componentWillUpdate", void 0, elm);
2469
+ }
2470
+ maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender", void 0, elm));
2471
+ endSchedule();
2472
+ return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
2473
+ };
2474
+ var enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then(fn).catch((err2) => {
2475
+ console.error(err2);
2476
+ fn();
2477
+ }) : fn();
2478
+ var isPromisey = (maybePromise) => maybePromise instanceof Promise || maybePromise && maybePromise.then && typeof maybePromise.then === "function";
2479
+ var updateComponent = async (hostRef, instance, isInitialLoad) => {
2480
+ var _a;
2481
+ const elm = hostRef.$hostElement$;
2482
+ const endUpdate = createTime("update", hostRef.$cmpMeta$.$tagName$);
2483
+ const rc = elm["s-rc"];
2484
+ if (isInitialLoad) {
2485
+ attachStyles(hostRef);
2486
+ }
2487
+ const endRender = createTime("render", hostRef.$cmpMeta$.$tagName$);
2488
+ {
2489
+ callRender(hostRef, instance, elm, isInitialLoad);
2490
+ }
2491
+ if (rc) {
2492
+ rc.map((cb) => cb());
2493
+ elm["s-rc"] = void 0;
2494
+ }
2495
+ endRender();
2496
+ endUpdate();
2497
+ {
2498
+ const childrenPromises = (_a = elm["s-p"]) != null ? _a : [];
2499
+ const postUpdate = () => postUpdateComponent(hostRef);
2500
+ if (childrenPromises.length === 0) {
2501
+ postUpdate();
2502
+ } else {
2503
+ Promise.all(childrenPromises).then(postUpdate);
2504
+ hostRef.$flags$ |= 4 /* isWaitingForChildren */;
2505
+ childrenPromises.length = 0;
2506
+ }
2507
+ }
2508
+ };
2509
+ var callRender = (hostRef, instance, elm, isInitialLoad) => {
2510
+ try {
2511
+ instance = instance.render && instance.render();
2512
+ {
2513
+ hostRef.$flags$ &= -17 /* isQueuedForUpdate */;
2514
+ }
2515
+ {
2516
+ hostRef.$flags$ |= 2 /* hasRendered */;
2517
+ }
2518
+ {
2519
+ {
2520
+ {
2521
+ renderVdom(hostRef, instance, isInitialLoad);
2522
+ }
2523
+ }
2524
+ }
2525
+ } catch (e) {
2526
+ consoleError(e, hostRef.$hostElement$);
2527
+ }
2528
+ return null;
2529
+ };
2530
+ var postUpdateComponent = (hostRef) => {
2531
+ const tagName = hostRef.$cmpMeta$.$tagName$;
2532
+ const elm = hostRef.$hostElement$;
2533
+ const endPostUpdate = createTime("postUpdate", tagName);
2534
+ const instance = elm;
2535
+ const ancestorComponent = hostRef.$ancestorComponent$;
2536
+ safeCall(instance, "componentDidRender", void 0, elm);
2537
+ if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
2538
+ hostRef.$flags$ |= 64 /* hasLoadedComponent */;
2539
+ {
2540
+ addHydratedFlag(elm);
2541
+ }
2542
+ safeCall(instance, "componentDidLoad", void 0, elm);
2543
+ endPostUpdate();
2544
+ {
2545
+ hostRef.$onReadyResolve$(elm);
2546
+ if (!ancestorComponent) {
2547
+ appDidLoad();
2548
+ }
2549
+ }
2550
+ } else {
2551
+ safeCall(instance, "componentDidUpdate", void 0, elm);
2552
+ endPostUpdate();
2553
+ }
2554
+ {
2555
+ if (hostRef.$onRenderResolve$) {
2556
+ hostRef.$onRenderResolve$();
2557
+ hostRef.$onRenderResolve$ = void 0;
2558
+ }
2559
+ if (hostRef.$flags$ & 512 /* needsRerender */) {
2560
+ nextTick(() => scheduleUpdate(hostRef, false));
2561
+ }
2562
+ hostRef.$flags$ &= -517;
2563
+ }
2564
+ };
2565
+ var forceUpdate = (ref) => {
2566
+ var _a;
2567
+ {
2568
+ const hostRef = getHostRef(ref);
2569
+ const isConnected = (_a = hostRef == null ? void 0 : hostRef.$hostElement$) == null ? void 0 : _a.isConnected;
2570
+ if (isConnected && (hostRef.$flags$ & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
2571
+ scheduleUpdate(hostRef, false);
2572
+ }
2573
+ return isConnected;
2574
+ }
2575
+ };
2576
+ var appDidLoad = (who) => {
2577
+ var _a;
2578
+ nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
2579
+ {
2580
+ if ((_a = plt.$orgLocNodes$) == null ? void 0 : _a.size) {
2581
+ plt.$orgLocNodes$.clear();
2582
+ }
2583
+ }
2584
+ };
2585
+ var safeCall = (instance, method, arg, elm) => {
2586
+ if (instance && instance[method]) {
2587
+ try {
2588
+ return instance[method](arg);
2589
+ } catch (e) {
2590
+ consoleError(e, elm);
2591
+ }
2592
+ }
2593
+ return void 0;
2594
+ };
2595
+ var addHydratedFlag = (elm) => {
2596
+ var _a;
2597
+ return elm.classList.add((_a = BUILD.hydratedSelectorName) != null ? _a : "hydrated") ;
2598
+ };
2599
+
2600
+ // src/runtime/set-value.ts
2601
+ var getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
2602
+ var setValue = (ref, propName, newVal, cmpMeta) => {
2603
+ const hostRef = getHostRef(ref);
2604
+ if (!hostRef) {
2605
+ return;
2606
+ }
2607
+ const elm = ref;
2608
+ const oldVal = hostRef.$instanceValues$.get(propName);
2609
+ const flags = hostRef.$flags$;
2610
+ const instance = elm;
2611
+ newVal = parsePropertyValue(
2612
+ newVal,
2613
+ cmpMeta.$members$[propName][0]);
2614
+ const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
2615
+ const didValueChange = newVal !== oldVal && !areBothNaN;
2616
+ if (didValueChange) {
2617
+ hostRef.$instanceValues$.set(propName, newVal);
2618
+ {
2619
+ if (cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
2620
+ const watchMethods = cmpMeta.$watchers$[propName];
2621
+ if (watchMethods) {
2622
+ watchMethods.map((watchMethodName) => {
2623
+ try {
2624
+ instance[watchMethodName](newVal, oldVal, propName);
2625
+ } catch (e) {
2626
+ consoleError(e, elm);
2627
+ }
2628
+ });
2629
+ }
2630
+ }
2631
+ if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
2632
+ if (instance.componentShouldUpdate) {
2633
+ if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
2634
+ return;
2635
+ }
2636
+ }
2637
+ scheduleUpdate(hostRef, false);
2638
+ }
2639
+ }
2640
+ }
2641
+ };
2642
+
2643
+ // src/runtime/proxy-component.ts
2644
+ var proxyComponent = (Cstr, cmpMeta, flags) => {
2645
+ var _a, _b;
2646
+ const prototype = Cstr.prototype;
2647
+ {
2648
+ {
2649
+ if (Cstr.watchers && !cmpMeta.$watchers$) {
2650
+ cmpMeta.$watchers$ = Cstr.watchers;
2651
+ }
2652
+ if (Cstr.deserializers && !cmpMeta.$deserializers$) {
2653
+ cmpMeta.$deserializers$ = Cstr.deserializers;
2654
+ }
2655
+ if (Cstr.serializers && !cmpMeta.$serializers$) {
2656
+ cmpMeta.$serializers$ = Cstr.serializers;
2657
+ }
2658
+ }
2659
+ const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
2660
+ members.map(([memberName, [memberFlags]]) => {
2661
+ if ((memberFlags & 31 /* Prop */ || memberFlags & 32 /* State */)) {
2662
+ const { get: origGetter, set: origSetter } = Object.getOwnPropertyDescriptor(prototype, memberName) || {};
2663
+ if (origGetter) cmpMeta.$members$[memberName][0] |= 2048 /* Getter */;
2664
+ if (origSetter) cmpMeta.$members$[memberName][0] |= 4096 /* Setter */;
2665
+ {
2666
+ Object.defineProperty(prototype, memberName, {
2667
+ get() {
2668
+ {
2669
+ return origGetter ? origGetter.apply(this) : getValue(this, memberName);
2670
+ }
2671
+ },
2672
+ configurable: true,
2673
+ enumerable: true
2674
+ });
2675
+ }
2676
+ Object.defineProperty(prototype, memberName, {
2677
+ set(newValue) {
2678
+ const ref = getHostRef(this);
2679
+ if (!ref) {
2680
+ return;
2681
+ }
2682
+ if (origSetter) {
2683
+ const currentValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
2684
+ if (typeof currentValue === "undefined" && ref.$instanceValues$.get(memberName)) {
2685
+ newValue = ref.$instanceValues$.get(memberName);
2686
+ }
2687
+ origSetter.apply(this, [
2688
+ parsePropertyValue(
2689
+ newValue,
2690
+ memberFlags)
2691
+ ]);
2692
+ newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
2693
+ setValue(this, memberName, newValue, cmpMeta);
2694
+ return;
2695
+ }
2696
+ {
2697
+ setValue(this, memberName, newValue, cmpMeta);
2698
+ return;
2699
+ }
2700
+ }
2701
+ });
2702
+ }
2703
+ });
2704
+ {
2705
+ const attrNameToPropName = /* @__PURE__ */ new Map();
2706
+ prototype.attributeChangedCallback = function(attrName, oldValue, newValue) {
2707
+ plt.jmp(() => {
2708
+ var _a2;
2709
+ const propName = attrNameToPropName.get(attrName);
2710
+ const hostRef = getHostRef(this);
2711
+ if (this.hasOwnProperty(propName) && BUILD.lazyLoad) ;
2712
+ if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
2713
+ this[propName] == newValue) {
2714
+ return;
2715
+ } else if (propName == null) {
2716
+ const flags2 = hostRef == null ? void 0 : hostRef.$flags$;
2717
+ if (hostRef && flags2 && !(flags2 & 8 /* isConstructingInstance */) && flags2 & 128 /* isWatchReady */ && newValue !== oldValue) {
2718
+ const elm = this;
2719
+ const instance = elm;
2720
+ const entry = (_a2 = cmpMeta.$watchers$) == null ? void 0 : _a2[attrName];
2721
+ entry == null ? void 0 : entry.forEach((callbackName) => {
2722
+ if (instance[callbackName] != null) {
2723
+ instance[callbackName].call(instance, newValue, oldValue, attrName);
2724
+ }
2725
+ });
2726
+ }
2727
+ return;
2728
+ }
2729
+ const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
2730
+ newValue = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
2731
+ if (newValue != this[propName] && (!propDesc.get || !!propDesc.set)) {
2732
+ this[propName] = newValue;
2733
+ }
2734
+ });
2735
+ };
2736
+ Cstr.observedAttributes = Array.from(
2737
+ /* @__PURE__ */ new Set([
2738
+ ...Object.keys((_b = cmpMeta.$watchers$) != null ? _b : {}),
2739
+ ...members.filter(([_, m]) => m[0] & 31 /* HasAttribute */).map(([propName, m]) => {
2740
+ var _a2;
2741
+ const attrName = m[1] || propName;
2742
+ attrNameToPropName.set(attrName, propName);
2743
+ if (m[0] & 512 /* ReflectAttr */) {
2744
+ (_a2 = cmpMeta.$attrsToReflect$) == null ? void 0 : _a2.push([propName, attrName]);
2745
+ }
2746
+ return attrName;
2747
+ })
2748
+ ])
2749
+ );
2750
+ }
2751
+ }
2752
+ return Cstr;
2753
+ };
2754
+
2755
+ // src/runtime/initialize-component.ts
2756
+ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
2757
+ let Cstr;
2758
+ if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
2759
+ hostRef.$flags$ |= 32 /* hasInitializedComponent */;
2760
+ {
2761
+ Cstr = elm.constructor;
2762
+ const cmpTag = elm.localName;
2763
+ customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
2764
+ }
2765
+ if (Cstr && Cstr.style) {
2766
+ let style;
2767
+ if (typeof Cstr.style === "string") {
2768
+ style = Cstr.style;
2769
+ } else if (typeof Cstr.style !== "string") {
2770
+ hostRef.$modeName$ = computeMode(elm);
2771
+ if (hostRef.$modeName$) {
2772
+ style = Cstr.style[hostRef.$modeName$];
2773
+ }
2774
+ }
2775
+ const scopeId2 = getScopeId(cmpMeta, hostRef.$modeName$);
2776
+ if (!styles.has(scopeId2)) {
2777
+ const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$);
2778
+ registerStyle(scopeId2, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
2779
+ endRegisterStyles();
2780
+ }
2781
+ }
2782
+ }
2783
+ const ancestorComponent = hostRef.$ancestorComponent$;
2784
+ const schedule = () => scheduleUpdate(hostRef, true);
2785
+ if (ancestorComponent && ancestorComponent["s-rc"]) {
2786
+ ancestorComponent["s-rc"].push(schedule);
2787
+ } else {
2788
+ schedule();
2789
+ }
2790
+ };
2791
+ var fireConnectedCallback = (instance, elm) => {
2792
+ };
2793
+
2794
+ // src/runtime/connected-callback.ts
2795
+ var connectedCallback = (elm) => {
2796
+ if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
2797
+ const hostRef = getHostRef(elm);
2798
+ if (!hostRef) {
2799
+ return;
2800
+ }
2801
+ const cmpMeta = hostRef.$cmpMeta$;
2802
+ const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
2803
+ if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
2804
+ hostRef.$flags$ |= 1 /* hasConnected */;
2805
+ let hostId;
2806
+ {
2807
+ hostId = elm.getAttribute(HYDRATE_ID);
2808
+ if (hostId) {
2809
+ if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2810
+ const scopeId2 = addStyle(elm.shadowRoot, cmpMeta, elm.getAttribute("s-mode")) ;
2811
+ elm.classList.remove(scopeId2 + "-h", scopeId2 + "-s");
2812
+ } else if (cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
2813
+ const scopeId2 = getScopeId(cmpMeta, elm.getAttribute("s-mode") );
2814
+ elm["s-sc"] = scopeId2;
2815
+ }
2816
+ initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);
2817
+ }
2818
+ }
2819
+ if (!hostId) {
2820
+ if (// TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
2821
+ cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */)) {
2822
+ setContentReference(elm);
2823
+ }
2824
+ }
2825
+ {
2826
+ let ancestorComponent = elm;
2827
+ while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
2828
+ if (ancestorComponent.nodeType === 1 /* ElementNode */ && ancestorComponent.hasAttribute("s-id") && ancestorComponent["s-p"] || ancestorComponent["s-p"]) {
2829
+ attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
2830
+ break;
2831
+ }
2832
+ }
2833
+ }
2834
+ if (cmpMeta.$members$) {
2835
+ Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
2836
+ if (memberFlags & 31 /* Prop */ && memberName in elm && elm[memberName] !== Object.prototype[memberName]) {
2837
+ const value = elm[memberName];
2838
+ delete elm[memberName];
2839
+ elm[memberName] = value;
2840
+ }
2841
+ });
2842
+ }
2843
+ {
2844
+ initializeComponent(elm, hostRef, cmpMeta);
2845
+ }
2846
+ } else {
2847
+ addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
2848
+ if (hostRef == null ? void 0 : hostRef.$lazyInstance$) ; else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
2849
+ hostRef.$onReadyPromise$.then(() => fireConnectedCallback());
2850
+ }
2851
+ }
2852
+ endConnected();
2853
+ }
2854
+ };
2855
+ var setContentReference = (elm) => {
2856
+ if (!win.document) {
2857
+ return;
2858
+ }
2859
+ const contentRefElm = elm["s-cr"] = win.document.createComment(
2860
+ ""
2861
+ );
2862
+ contentRefElm["s-cn"] = true;
2863
+ insertBefore(elm, contentRefElm, elm.firstChild);
2864
+ };
2865
+ var disconnectedCallback = async (elm) => {
2866
+ if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
2867
+ const hostRef = getHostRef(elm);
2868
+ {
2869
+ if (hostRef == null ? void 0 : hostRef.$rmListeners$) {
2870
+ hostRef.$rmListeners$.map((rmListener) => rmListener());
2871
+ hostRef.$rmListeners$ = void 0;
2872
+ }
2873
+ }
2874
+ }
2875
+ if (rootAppliedStyles.has(elm)) {
2876
+ rootAppliedStyles.delete(elm);
2877
+ }
2878
+ if (elm.shadowRoot && rootAppliedStyles.has(elm.shadowRoot)) {
2879
+ rootAppliedStyles.delete(elm.shadowRoot);
2880
+ }
2881
+ };
2882
+ var proxyCustomElement = (Cstr, compactMeta) => {
2883
+ const cmpMeta = {
2884
+ $flags$: compactMeta[0],
2885
+ $tagName$: compactMeta[1]
2886
+ };
2887
+ {
2888
+ cmpMeta.$members$ = compactMeta[2];
2889
+ }
2890
+ {
2891
+ cmpMeta.$listeners$ = compactMeta[3];
2892
+ }
2893
+ {
2894
+ cmpMeta.$watchers$ = Cstr.$watchers$;
2895
+ cmpMeta.$deserializers$ = Cstr.$deserializers$;
2896
+ cmpMeta.$serializers$ = Cstr.$serializers$;
2897
+ }
2898
+ {
2899
+ cmpMeta.$attrsToReflect$ = [];
2900
+ }
2901
+ if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) && cmpMeta.$flags$ & 256 /* hasRenderFn */) {
2902
+ {
2903
+ patchPseudoShadowDom(Cstr.prototype);
2904
+ }
2905
+ }
2906
+ {
2907
+ hydrateScopedToShadow();
2908
+ }
2909
+ const originalConnectedCallback = Cstr.prototype.connectedCallback;
2910
+ const originalDisconnectedCallback = Cstr.prototype.disconnectedCallback;
2911
+ Object.assign(Cstr.prototype, {
2912
+ __hasHostListenerAttached: false,
2913
+ __registerHost() {
2914
+ registerHost(this, cmpMeta);
2915
+ },
2916
+ connectedCallback() {
2917
+ if (!this.__hasHostListenerAttached) {
2918
+ const hostRef = getHostRef(this);
2919
+ if (!hostRef) {
2920
+ return;
2921
+ }
2922
+ addHostEventListeners(this, hostRef, cmpMeta.$listeners$);
2923
+ this.__hasHostListenerAttached = true;
2924
+ }
2925
+ connectedCallback(this);
2926
+ if (originalConnectedCallback) {
2927
+ originalConnectedCallback.call(this);
2928
+ }
2929
+ },
2930
+ disconnectedCallback() {
2931
+ disconnectedCallback(this);
2932
+ if (originalDisconnectedCallback) {
2933
+ originalDisconnectedCallback.call(this);
2934
+ }
2935
+ },
2936
+ __attachShadow() {
2937
+ {
2938
+ if (!this.shadowRoot) {
2939
+ createShadowRoot.call(this, cmpMeta);
2940
+ } else {
2941
+ if (this.shadowRoot.mode !== "open") {
2942
+ throw new Error(
2943
+ `Unable to re-use existing shadow root for ${cmpMeta.$tagName$}! Mode is set to ${this.shadowRoot.mode} but Stencil only supports open shadow roots.`
2944
+ );
2945
+ }
2946
+ }
2947
+ }
2948
+ }
2949
+ });
2950
+ Cstr.is = cmpMeta.$tagName$;
2951
+ return proxyComponent(Cstr, cmpMeta);
2952
+ };
2953
+
2954
+ // src/runtime/fragment.ts
2955
+ var Fragment = (_, children) => children;
2956
+ var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
2957
+ if (listeners && win.document) {
2958
+ listeners.map(([flags, name, method]) => {
2959
+ const target = getHostListenerTarget(win.document, elm, flags) ;
2960
+ const handler = hostListenerProxy(hostRef, method);
2961
+ const opts = hostListenerOpts(flags);
2962
+ plt.ael(target, name, handler, opts);
2963
+ (hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
2964
+ });
2965
+ }
2966
+ };
2967
+ var hostListenerProxy = (hostRef, methodName) => (ev) => {
2968
+ try {
2969
+ {
2970
+ hostRef.$hostElement$[methodName](ev);
2971
+ }
2972
+ } catch (e) {
2973
+ consoleError(e, hostRef.$hostElement$);
2974
+ }
2975
+ };
2976
+ var getHostListenerTarget = (doc, elm, flags) => {
2977
+ if (flags & 4 /* TargetDocument */) {
2978
+ return doc;
2979
+ }
2980
+ if (flags & 8 /* TargetWindow */) {
2981
+ return win;
2982
+ }
2983
+ if (flags & 16 /* TargetBody */) {
2984
+ return doc.body;
2985
+ }
2986
+ return elm;
2987
+ };
2988
+ var hostListenerOpts = (flags) => supportsListenerOptions ? {
2989
+ passive: (flags & 1 /* Passive */) !== 0,
2990
+ capture: (flags & 2 /* Capture */) !== 0
2991
+ } : (flags & 2 /* Capture */) !== 0;
2992
+
2993
+ // src/runtime/nonce.ts
2994
+ var setNonce = (nonce) => plt.$nonce$ = nonce;
2995
+
2996
+ // src/runtime/platform-options.ts
2997
+ var setPlatformOptions = (opts) => Object.assign(plt, opts);
2998
+
2999
+ // src/runtime/render.ts
3000
+ function render(vnode, container) {
3001
+ const cmpMeta = {
3002
+ $flags$: 0,
3003
+ $tagName$: container.tagName
3004
+ };
3005
+ const ref = {
3006
+ $cmpMeta$: cmpMeta,
3007
+ $hostElement$: container
3008
+ };
3009
+ renderVdom(ref, vnode);
3010
+ }
3011
+
3012
+ export { Build as B, Fragment as F, H, LogLevel as L, setNonce as a, setPlatformOptions as b, config as c, Host as d, createEvent as e, printIonWarning as f, getAssetPath as g, h, forceUpdate as i, printIonError as j, readTask as k, configFromSession as l, configFromURL as m, saveConfig as n, getMode as o, proxyCustomElement as p, setMode as q, render as r, setAssetPath as s, printRequiredElementError as t, writeTask as w };