@zonos/elements 1.3.286 → 1.3.287

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 (656) hide show
  1. package/README.md +9 -1
  2. package/dist/cjs/RemoveIcon-CuM1YmjP.js +5 -0
  3. package/dist/cjs/{cart-0cf8897b.js → cart-CV4buPlT.js} +17 -27
  4. package/dist/cjs/{collect-79131e52.js → collect-jzWKzrV7.js} +17 -113
  5. package/dist/cjs/debounce-5sZmmlCI.js +9 -0
  6. package/dist/cjs/debounce-Nu2lJW4A.js +405 -0
  7. package/dist/cjs/{formatStringWithLinks-c25b4018.js → formatStringWithLinks-vOVkAjlu.js} +1 -1
  8. package/dist/cjs/{getBorderRadius-97fd5e02.js → getBorderRadius-DGZiQu09.js} +1 -1
  9. package/dist/cjs/{getContrastColor-956dfaf7.js → getContrastColor-B2Kn8XHA.js} +2 -2
  10. package/dist/cjs/{getMissingRequiredShippingFields-a8f04267.js → getMissingRequiredShippingFields-r5vYIqoX.js} +1 -1
  11. package/dist/cjs/{handleFetch-954f30e1.js → handleFetch-DQLhurnE.js} +4 -3
  12. package/dist/cjs/{hasInclusivePrice-d0cd2007.js → hasInclusivePrice-BZMQohG9.js} +1 -1
  13. package/dist/cjs/{helpers-5bdbb68c.js → helpers-ClOZ11A9.js} +0 -3
  14. package/dist/cjs/{index-b1f95d96.js → index-DAAr465v.js} +1252 -580
  15. package/dist/cjs/index.cjs.js +17 -21
  16. package/dist/cjs/{invoice-254ae23b.js → invoice-CHw-mJdS.js} +6 -6
  17. package/dist/cjs/{isContrastColor-30f84a91.js → isContrastColor-B9ldIdpa.js} +1 -1
  18. package/dist/cjs/isDarkColor-f-fD9c2l.js +1187 -0
  19. package/dist/cjs/loader.cjs.js +3 -5
  20. package/dist/cjs/{localization-fb2ece37.js → localization-CxXsmxs5.js} +4 -4
  21. package/dist/cjs/{paypal-8ca67278.js → paypal-BLuHeOJH.js} +10 -9
  22. package/dist/cjs/{placeTestOrder-12b63822.js → placeTestOrder-VK_CMeq0.js} +3 -3
  23. package/dist/cjs/{renderCheckoutCurrency-a1f71587.js → renderCheckoutCurrency-CC4CAy-a.js} +2 -2
  24. package/dist/cjs/{renderFallback-bc20ee20.js → renderFallback-Bme86uk8.js} +1 -1
  25. package/dist/cjs/{shouldRenderTaxIdInput-7d19556c.js → shouldRenderTaxIdInput-TxekHCp7.js} +2 -2
  26. package/dist/cjs/{shouldShowLanguageSelect-82985128.js → shouldShowLanguageSelect-Bj_jKWPK.js} +1 -1
  27. package/dist/cjs/{submitGtag-8a25f001.js → submitGtag-CcEL-w5D.js} +3 -3
  28. package/dist/cjs/throttle-BcxGntLr.js +87 -0
  29. package/dist/cjs/{updateCheckoutSessionAttributes-de7b1466.js → updateCheckoutSessionAttributes-Dltl5RBx.js} +3 -3
  30. package/dist/cjs/zonos-address-completion-dialog_7.cjs.entry.js +644 -692
  31. package/dist/cjs/zonos-address-display_2.cjs.entry.js +13 -17
  32. package/dist/cjs/zonos-address_4.cjs.entry.js +50 -40
  33. package/dist/cjs/zonos-airwallex-payment.cjs.entry.js +15 -16
  34. package/dist/cjs/zonos-badge.cjs.entry.js +7 -10
  35. package/dist/cjs/zonos-banner.cjs.entry.js +6 -9
  36. package/dist/cjs/zonos-button_3.cjs.entry.js +18 -21
  37. package/dist/cjs/zonos-card_5.cjs.entry.js +34 -35
  38. package/dist/cjs/zonos-cart-items_12.cjs.entry.js +85 -83
  39. package/dist/cjs/zonos-checkbox_2.cjs.entry.js +10 -14
  40. package/dist/cjs/zonos-checkout.cjs.entry.js +50 -34
  41. package/dist/cjs/zonos-collapse.cjs.entry.js +5 -8
  42. package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +18 -23
  43. package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +59 -55
  44. package/dist/cjs/zonos-collect.cjs.entry.js +20 -23
  45. package/dist/cjs/zonos-component.cjs.entry.js +3 -6
  46. package/dist/cjs/zonos-controller.cjs.entry.js +13 -16
  47. package/dist/cjs/zonos-country-flag.cjs.entry.js +8 -11
  48. package/dist/cjs/zonos-country-select_4.cjs.entry.js +68 -57
  49. package/dist/cjs/zonos-elements.cjs.js +7 -7
  50. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +22 -23
  51. package/dist/cjs/zonos-hello.cjs.entry.js +19 -17
  52. package/dist/cjs/zonos-input.cjs.entry.js +10 -11
  53. package/dist/cjs/zonos-invoice-cart-items_2.cjs.entry.js +17 -21
  54. package/dist/cjs/zonos-invoice-finish_5.cjs.entry.js +57 -52
  55. package/dist/cjs/zonos-invoice.cjs.entry.js +19 -22
  56. package/dist/cjs/zonos-language-select_2.cjs.entry.js +11 -15
  57. package/dist/cjs/zonos-link.cjs.entry.js +3 -6
  58. package/dist/cjs/zonos-logo.cjs.entry.js +6 -9
  59. package/dist/cjs/zonos-policy-consent_2.cjs.entry.js +15 -19
  60. package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +11 -14
  61. package/dist/cjs/zonos-stripe-input.cjs.entry.js +15 -14
  62. package/dist/cjs/zonos-text.cjs.entry.js +8 -11
  63. package/dist/cjs/zonos-tooltip.cjs.entry.js +4 -7
  64. package/dist/cjs/zonos-v-stack.cjs.entry.js +6 -9
  65. package/dist/cjs/zonosStore-BCNYr6Tk.js +3808 -0
  66. package/dist/collection/__tests__/jsxWithChildren.types.js +13 -0
  67. package/dist/collection/collection-manifest.json +3 -2
  68. package/dist/collection/components/checkout/zonos-checkout/zonos-address-completion-dialog/zonos-address-completion-dialog.js +13 -10
  69. package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-display/zonos-address-display.js +4 -3
  70. package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-form/zonos-address-form.js +8 -5
  71. package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-update-dialog.js +17 -13
  72. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-restricted-items/zonos-cart-restricted-items.js +1 -1
  73. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.js +4 -4
  74. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +7 -5
  75. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-footer/zonos-checkout-footer.js +5 -4
  76. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.js +8 -8
  77. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-empty-state-payment/zonos-empty-state-payment.js +5 -4
  78. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-store-credit/zonos-store-credit.js +1 -1
  79. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +18 -14
  80. package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.js +13 -10
  81. package/dist/collection/components/checkout/zonos-checkout/zonos-review/zonos-review.js +2 -2
  82. package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +7 -7
  83. package/dist/collection/components/checkout/zonos-collect/zonos-collect-finish/zonos-collect-finish.js +8 -6
  84. package/dist/collection/components/checkout/zonos-collect/zonos-collect-footer/zonos-collect-footer.js +6 -5
  85. package/dist/collection/components/checkout/zonos-collect/zonos-collect-order-details/zonos-collect-order-details.js +4 -4
  86. package/dist/collection/components/checkout/zonos-collect/zonos-collect-payment/zonos-collect-payment.js +7 -7
  87. package/dist/collection/components/checkout/zonos-collect/zonos-collect-review/zonos-collect-review.js +3 -3
  88. package/dist/collection/components/checkout/zonos-collect/zonos-collect.js +2 -2
  89. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-cart-items/zonos-invoice-cart-items.js +1 -1
  90. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-finish/zonos-invoice-finish.js +8 -6
  91. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-footer/zonos-invoice-footer.js +6 -5
  92. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-order-details/zonos-invoice-order-details.js +4 -4
  93. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-payment/zonos-invoice-payment.js +7 -7
  94. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-review/zonos-invoice-review.js +3 -3
  95. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-subtotal/zonos-invoice-subtotal.js +1 -1
  96. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice.js +2 -2
  97. package/dist/collection/components/common/zonos-badge/zonos-badge.js +8 -7
  98. package/dist/collection/components/common/zonos-banner/zonos-banner.js +4 -4
  99. package/dist/collection/components/common/zonos-button/zonos-button.js +29 -25
  100. package/dist/collection/components/common/zonos-card/zonos-card.js +9 -8
  101. package/dist/collection/components/common/zonos-checkbox/zonos-checkbox.js +15 -12
  102. package/dist/collection/components/common/zonos-checkout-progress-tabs/zonos-checkout-progress-tabs.js +9 -6
  103. package/dist/collection/components/common/zonos-collapse/zonos-collapse.js +2 -2
  104. package/dist/collection/components/common/zonos-confirm-dialog/zonos-confirm-dialog.js +15 -15
  105. package/dist/collection/components/common/zonos-country-flag/zonos-country-flag.js +6 -5
  106. package/dist/collection/components/common/zonos-custom-message/zonos-custom-message.js +2 -2
  107. package/dist/collection/components/common/zonos-dialog/zonos-dialog.js +22 -21
  108. package/dist/collection/components/common/zonos-h-stack/zonos-h-stack.js +3 -2
  109. package/dist/collection/components/common/zonos-icon/zonos-icon.js +8 -7
  110. package/dist/collection/components/common/zonos-input/zonos-input.js +7 -7
  111. package/dist/collection/components/common/zonos-link/zonos-link.js +7 -7
  112. package/dist/collection/components/common/zonos-loading-overlay/zonos-loading-overlay.js +4 -4
  113. package/dist/collection/components/common/zonos-logo/zonos-logo.js +4 -3
  114. package/dist/collection/components/common/zonos-rest-state/zonos-rest-state.js +8 -7
  115. package/dist/collection/components/common/zonos-select-dialog-header/zonos-select-dialog-header.js +1 -1
  116. package/dist/collection/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.js +15 -12
  117. package/dist/collection/components/common/zonos-skeleton/zonos-skeleton.js +2 -2
  118. package/dist/collection/components/common/zonos-spinner/zonos-spinner.js +3 -3
  119. package/dist/collection/components/common/zonos-stripe-input/zonos-stripe-input.js +17 -17
  120. package/dist/collection/components/common/zonos-stripe-phone-input/zonos-stripe-phone-input.js +23 -20
  121. package/dist/collection/components/common/zonos-stripe-select/zonos-stripe-select.js +19 -19
  122. package/dist/collection/components/common/zonos-text/zonos-text.js +15 -11
  123. package/dist/collection/components/common/zonos-toggle/zonos-toggle.js +4 -3
  124. package/dist/collection/components/common/zonos-tooltip/zonos-tooltip.js +2 -2
  125. package/dist/collection/components/common/zonos-v-stack/zonos-v-stack.js +3 -2
  126. package/dist/collection/components/common/zonos-virtual-scroll/zonos-virtual-scroll.js +7 -6
  127. package/dist/collection/components/component-template/zonos-component/zonos-component.js +3 -3
  128. package/dist/collection/components/hello/zonos-hello/zonos-hello.js +16 -12
  129. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/zonos-hello-dialog-footer.js +3 -2
  130. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +14 -11
  131. package/dist/collection/components/main/zonos-controller.js +18 -10
  132. package/dist/collection/components/store/checkout/stripe.js +1 -1
  133. package/dist/collection/components/stripe/zonos-address/zonos-address.js +9 -8
  134. package/dist/collection/components/stripe/zonos-custom-address/zonos-address-suggestions/zonos-address-suggestions.js +6 -4
  135. package/dist/collection/components/stripe/zonos-custom-address/zonos-custom-address.js +13 -10
  136. package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.js +4 -4
  137. package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +2 -2
  138. package/dist/collection/components/utils/checkout/isEuDapRemittance.js +1 -1
  139. package/dist/collection/components/utils/checkout/shouldRenderTaxIdInput.js +1 -1
  140. package/dist/collection/scripts/cart/_setupCartData.js +2 -2
  141. package/dist/collection/scripts/cart/_setupCartDataWithSettings.js +2 -2
  142. package/dist/collection/types/generated/graphql.internal.types.js +5 -0
  143. package/dist/esm/RemoveIcon-C2QMVeWW.js +3 -0
  144. package/dist/esm/{cart-d04742f5.js → cart-ekBk_gxV.js} +18 -28
  145. package/dist/esm/{collect-4c310a16.js → collect-33rMINDo.js} +17 -113
  146. package/dist/esm/debounce-D4ko2kvZ.js +403 -0
  147. package/dist/esm/debounce-DWPsxJsW.js +7 -0
  148. package/dist/esm/{formatStringWithLinks-0d48f183.js → formatStringWithLinks-BcMPqGl0.js} +1 -1
  149. package/dist/esm/{getBorderRadius-1f7be586.js → getBorderRadius-HwG64EKM.js} +1 -1
  150. package/dist/esm/{getContrastColor-4c0ae8c1.js → getContrastColor-CfCPlW9U.js} +2 -2
  151. package/dist/esm/{getMissingRequiredShippingFields-f0878e32.js → getMissingRequiredShippingFields-u1nhQzJ1.js} +1 -1
  152. package/dist/esm/{handleFetch-a844cac1.js → handleFetch-D5GYDF-O.js} +4 -3
  153. package/dist/esm/{hasInclusivePrice-d801be22.js → hasInclusivePrice-CAVXi310.js} +1 -1
  154. package/dist/esm/{helpers-2f6955b1.js → helpers-DJIdCwJ5.js} +0 -3
  155. package/dist/esm/{index-cfd394c8.js → index-_lt63o7c.js} +1253 -561
  156. package/dist/esm/index.js +20 -22
  157. package/dist/esm/{invoice-86487dac.js → invoice-BNDWuVsD.js} +6 -6
  158. package/dist/esm/{isContrastColor-9fa0d013.js → isContrastColor-CWLU13s9.js} +1 -1
  159. package/dist/esm/isDarkColor-YdrG78th.js +1184 -0
  160. package/dist/esm/loader.js +4 -4
  161. package/dist/esm/{localization-36a4dc22.js → localization-AOqYXGdP.js} +5 -5
  162. package/dist/esm/{paypal-997935ab.js → paypal-CW1D2XqZ.js} +10 -9
  163. package/dist/esm/{placeTestOrder-a53f2056.js → placeTestOrder-nhmsLLOA.js} +3 -3
  164. package/dist/esm/{renderCheckoutCurrency-e0e16eb7.js → renderCheckoutCurrency-BQANmZyM.js} +2 -2
  165. package/dist/esm/{renderFallback-b250f4e9.js → renderFallback-Cy03ZcWE.js} +1 -1
  166. package/dist/esm/{shouldRenderTaxIdInput-ef7b5860.js → shouldRenderTaxIdInput-CKyZ6Zni.js} +2 -2
  167. package/dist/esm/{shouldShowLanguageSelect-328f50e2.js → shouldShowLanguageSelect-BQFCXouB.js} +1 -1
  168. package/dist/esm/{submitGtag-71c450b6.js → submitGtag-CCGQS060.js} +4 -4
  169. package/dist/esm/throttle-D5GyA3yr.js +85 -0
  170. package/dist/esm/{updateCheckoutSessionAttributes-23b222de.js → updateCheckoutSessionAttributes-eRSqdC74.js} +3 -3
  171. package/dist/esm/zonos-address-completion-dialog_7.entry.js +644 -690
  172. package/dist/esm/zonos-address-display_2.entry.js +13 -15
  173. package/dist/esm/zonos-address_4.entry.js +50 -38
  174. package/dist/esm/zonos-airwallex-payment.entry.js +15 -14
  175. package/dist/esm/zonos-badge.entry.js +7 -8
  176. package/dist/esm/zonos-banner.entry.js +6 -7
  177. package/dist/esm/zonos-button_3.entry.js +18 -19
  178. package/dist/esm/zonos-card_5.entry.js +34 -33
  179. package/dist/esm/zonos-cart-items_12.entry.js +85 -81
  180. package/dist/esm/zonos-checkbox_2.entry.js +10 -12
  181. package/dist/esm/zonos-checkout.entry.js +50 -32
  182. package/dist/esm/zonos-collapse.entry.js +5 -6
  183. package/dist/esm/zonos-collect-cart-items_3.entry.js +18 -21
  184. package/dist/esm/zonos-collect-finish_6.entry.js +59 -53
  185. package/dist/esm/zonos-collect.entry.js +20 -21
  186. package/dist/esm/zonos-component.entry.js +3 -4
  187. package/dist/esm/zonos-controller.entry.js +13 -14
  188. package/dist/esm/zonos-country-flag.entry.js +8 -9
  189. package/dist/esm/zonos-country-select_4.entry.js +68 -55
  190. package/dist/esm/zonos-elements.js +6 -5
  191. package/dist/esm/zonos-hello-dialog.entry.js +22 -21
  192. package/dist/esm/zonos-hello.entry.js +19 -15
  193. package/dist/esm/zonos-input.entry.js +10 -9
  194. package/dist/esm/zonos-invoice-cart-items_2.entry.js +17 -19
  195. package/dist/esm/zonos-invoice-finish_5.entry.js +57 -50
  196. package/dist/esm/zonos-invoice.entry.js +19 -20
  197. package/dist/esm/zonos-language-select_2.entry.js +11 -13
  198. package/dist/esm/zonos-link.entry.js +3 -4
  199. package/dist/esm/zonos-logo.entry.js +6 -7
  200. package/dist/esm/zonos-policy-consent_2.entry.js +15 -17
  201. package/dist/esm/zonos-shipping-rich-radio.entry.js +11 -12
  202. package/dist/esm/zonos-stripe-input.entry.js +15 -12
  203. package/dist/esm/zonos-text.entry.js +8 -9
  204. package/dist/esm/zonos-tooltip.entry.js +4 -5
  205. package/dist/esm/zonos-v-stack.entry.js +6 -7
  206. package/dist/esm/zonosStore-DrIOAz4M.js +3795 -0
  207. package/dist/esm-es5/{CheckoutConfig-724d7bae.js → CheckoutConfig-D5SpFsQJ.js} +5 -1
  208. package/dist/esm-es5/VarianceTest-BJmZPrZl.js +9 -0
  209. package/dist/esm-es5/{buildCartItemsByTempCart-a117f75d.js → buildCartItemsByTempCart-BycjkdlE.js} +4 -0
  210. package/dist/esm-es5/cart-ekBk_gxV.js +517 -0
  211. package/dist/esm-es5/classes-BJHSB96f.js +10 -0
  212. package/dist/esm-es5/cleanHtmlMarkdown-ByGDytaN.js +191 -0
  213. package/dist/esm-es5/collect-33rMINDo.js +241 -0
  214. package/dist/esm-es5/containsNonLatinChars-C04AWRC2.js +11 -0
  215. package/dist/esm-es5/createCustomEvent-XQfWgQLB.js +6 -0
  216. package/dist/esm-es5/debounce-D4ko2kvZ.js +153 -0
  217. package/dist/esm-es5/debounce-DWPsxJsW.js +1 -0
  218. package/dist/esm-es5/formatStringWithLinks-BcMPqGl0.js +8 -0
  219. package/dist/esm-es5/getBorderRadius-HwG64EKM.js +8 -0
  220. package/dist/esm-es5/getContrastColor-CfCPlW9U.js +14 -0
  221. package/dist/esm-es5/getGenericSettingsOverride-HeAZDwVW.js +4 -0
  222. package/dist/esm-es5/getMissingRequiredShippingFields-u1nhQzJ1.js +20 -0
  223. package/dist/esm-es5/handleFetch-D5GYDF-O.js +60 -0
  224. package/dist/esm-es5/hasInclusivePrice-CAVXi310.js +6 -0
  225. package/dist/esm-es5/helpers-DJIdCwJ5.js +23 -0
  226. package/dist/esm-es5/index-_lt63o7c.js +162 -0
  227. package/dist/esm-es5/index.js +227 -1
  228. package/dist/esm-es5/invoice-BNDWuVsD.js +13 -0
  229. package/dist/esm-es5/isColorVariable-DXXUq2Lv.js +11 -0
  230. package/dist/esm-es5/isContrastColor-CWLU13s9.js +5 -0
  231. package/dist/esm-es5/isDarkColor-YdrG78th.js +204 -0
  232. package/dist/esm-es5/isSameHostCheckoutLink-BxAHnL5J.js +16 -0
  233. package/dist/esm-es5/loader.js +1 -1
  234. package/dist/esm-es5/localization-AOqYXGdP.js +332 -0
  235. package/dist/esm-es5/paypal-CW1D2XqZ.js +192 -0
  236. package/dist/esm-es5/placeTestOrder-nhmsLLOA.js +1 -0
  237. package/dist/esm-es5/renderCheckoutCurrency-BQANmZyM.js +13 -0
  238. package/dist/esm-es5/{renderFallback-b250f4e9.js → renderFallback-Cy03ZcWE.js} +1 -1
  239. package/dist/esm-es5/shouldRenderTaxIdInput-CKyZ6Zni.js +17 -0
  240. package/dist/esm-es5/shouldShowLanguageSelect-BQFCXouB.js +7 -0
  241. package/dist/esm-es5/styles-BTIeCf3T.js +6 -0
  242. package/dist/esm-es5/submitGtag-CCGQS060.js +45 -0
  243. package/dist/esm-es5/throttle-D5GyA3yr.js +46 -0
  244. package/dist/esm-es5/updateCheckoutSessionAttributes-eRSqdC74.js +8 -0
  245. package/dist/esm-es5/zonos-address-completion-dialog_7.entry.js +2966 -1
  246. package/dist/esm-es5/zonos-address-display_2.entry.js +46 -1
  247. package/dist/esm-es5/zonos-address_4.entry.js +179 -1
  248. package/dist/esm-es5/zonos-airwallex-payment.entry.js +49 -1
  249. package/dist/esm-es5/zonos-badge.entry.js +25 -1
  250. package/dist/esm-es5/zonos-banner.entry.js +7 -1
  251. package/dist/esm-es5/zonos-button_3.entry.js +116 -1
  252. package/dist/esm-es5/zonos-card_5.entry.js +33 -1
  253. package/dist/esm-es5/zonos-cart-items_12.entry.js +666 -1
  254. package/dist/esm-es5/zonos-checkbox_2.entry.js +21 -1
  255. package/dist/esm-es5/zonos-checkout.entry.js +1043 -1
  256. package/dist/esm-es5/zonos-collapse.entry.js +15 -1
  257. package/dist/esm-es5/zonos-collect-cart-items_3.entry.js +13 -1
  258. package/dist/esm-es5/zonos-collect-finish_6.entry.js +157 -1
  259. package/dist/esm-es5/zonos-collect.entry.js +171 -1
  260. package/dist/esm-es5/zonos-component.entry.js +10 -1
  261. package/dist/esm-es5/zonos-controller.entry.js +198 -1
  262. package/dist/esm-es5/zonos-country-flag.entry.js +6 -1
  263. package/dist/esm-es5/zonos-country-select_4.entry.js +152 -1
  264. package/dist/esm-es5/zonos-elements.js +4 -1
  265. package/dist/esm-es5/zonos-hello-dialog.entry.js +63 -1
  266. package/dist/esm-es5/zonos-hello.entry.js +121 -1
  267. package/dist/esm-es5/zonos-input.entry.js +16 -1
  268. package/dist/esm-es5/zonos-invoice-cart-items_2.entry.js +7 -1
  269. package/dist/esm-es5/zonos-invoice-finish_5.entry.js +133 -1
  270. package/dist/esm-es5/zonos-invoice.entry.js +115 -1
  271. package/dist/esm-es5/zonos-language-select_2.entry.js +14 -1
  272. package/dist/esm-es5/zonos-link.entry.js +4 -1
  273. package/dist/esm-es5/zonos-logo.entry.js +7 -1
  274. package/dist/esm-es5/zonos-policy-consent_2.entry.js +31 -1
  275. package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +5 -1
  276. package/dist/esm-es5/zonos-stripe-input.entry.js +27 -1
  277. package/dist/esm-es5/zonos-text.entry.js +24 -1
  278. package/dist/esm-es5/zonos-tooltip.entry.js +7 -1
  279. package/dist/esm-es5/zonos-v-stack.entry.js +5 -1
  280. package/dist/esm-es5/zonosStore-DrIOAz4M.js +1153 -0
  281. package/dist/scripts/index.d.ts +1171 -521
  282. package/dist/scripts/index.js +1 -1
  283. package/dist/scripts/loadZonos.js +1 -1
  284. package/dist/scripts/zonos.js +1 -1
  285. package/dist/types/__tests__/jsxWithChildren.types.d.ts +14 -0
  286. package/dist/types/__tests__/vitest-globals.d.ts +1 -0
  287. package/dist/types/components/store/checkout/cart.d.ts +9 -9
  288. package/dist/types/components/utils/api/checkItemRestrictions.d.ts +2 -2
  289. package/dist/types/components/utils/api/getLocaleMessages.d.ts +5 -5
  290. package/dist/types/components/utils/checkout/isShippableCountry.d.ts +5 -1
  291. package/dist/types/components/utils/hello/detectItemRestrictions.d.ts +2 -2
  292. package/dist/types/components.d.ts +797 -147
  293. package/dist/types/scripts/cart/_setupCartDataWithSettings.d.ts +127 -127
  294. package/dist/types/stencil-public-runtime.d.ts +205 -12
  295. package/dist/types/types/generated/graphql.frontend.types.d.ts +60 -60
  296. package/dist/types/types/generated/graphql.frontend.types.ts +55 -55
  297. package/dist/types/types/generated/graphql.internal.types.d.ts +1290 -1285
  298. package/dist/types/types/generated/graphql.internal.types.ts +1113 -1108
  299. package/dist/zonos-elements/index.esm.js +1 -1
  300. package/dist/zonos-elements/p-02ef0f99.system.entry.js +6 -0
  301. package/dist/zonos-elements/{p-1be53c82.entry.js → p-0466650f.entry.js} +1 -1
  302. package/dist/zonos-elements/p-04bfcd72.system.entry.js +152 -0
  303. package/dist/zonos-elements/p-04cc0dac.system.entry.js +198 -0
  304. package/dist/zonos-elements/p-058f07aa.system.entry.js +7 -0
  305. package/dist/zonos-elements/p-0f603278.system.entry.js +5 -0
  306. package/dist/zonos-elements/{p-bb09ee50.entry.js → p-128485dc.entry.js} +1 -1
  307. package/dist/zonos-elements/p-1568ab06.system.entry.js +117 -0
  308. package/dist/zonos-elements/p-2ba738ec.entry.js +1 -0
  309. package/dist/zonos-elements/{p-6afd5fab.entry.js → p-31ac495f.entry.js} +1 -1
  310. package/dist/zonos-elements/p-34d1545a.entry.js +1 -0
  311. package/dist/zonos-elements/p-39c8a898.entry.js +1 -0
  312. package/dist/zonos-elements/p-3ERbuo5a.js +1 -0
  313. package/dist/zonos-elements/p-450ed170.system.entry.js +46 -0
  314. package/dist/zonos-elements/p-4973f8d8.system.entry.js +180 -0
  315. package/dist/zonos-elements/p-49e7bb1e.system.entry.js +7 -0
  316. package/dist/zonos-elements/p-4a54f664.entry.js +1 -0
  317. package/dist/zonos-elements/p-4ab1c533.system.entry.js +4 -0
  318. package/dist/zonos-elements/p-5024df2d.system.entry.js +666 -0
  319. package/dist/zonos-elements/p-5562a955.system.entry.js +7 -0
  320. package/dist/zonos-elements/p-5836d426.system.entry.js +49 -0
  321. package/dist/zonos-elements/p-5a631080.system.entry.js +13 -0
  322. package/dist/zonos-elements/{p-2ce039e5.entry.js → p-5c08d36b.entry.js} +1 -1
  323. package/dist/zonos-elements/{p-aed4ffb2.entry.js → p-5d3079e8.entry.js} +1 -1
  324. package/dist/zonos-elements/p-629f09dc.system.entry.js +171 -0
  325. package/dist/zonos-elements/p-64e7bc5b.entry.js +1 -0
  326. package/dist/zonos-elements/p-6b0afaa7.entry.js +1 -0
  327. package/dist/zonos-elements/p-6f742021.entry.js +1 -0
  328. package/dist/zonos-elements/p-7681798d.entry.js +1 -0
  329. package/dist/zonos-elements/p-7a5d2211.system.entry.js +115 -0
  330. package/dist/zonos-elements/{p-6de2f9c9.entry.js → p-7ae48e31.entry.js} +1 -1
  331. package/dist/zonos-elements/{p-f37150e8.entry.js → p-8328f44d.entry.js} +1 -1
  332. package/dist/zonos-elements/{p-171a7e1e.entry.js → p-844a743a.entry.js} +1 -1
  333. package/dist/zonos-elements/p-891b47d7.entry.js +1 -0
  334. package/dist/zonos-elements/p-89ddab88.entry.js +1 -0
  335. package/dist/zonos-elements/p-8cd3f1e2.entry.js +1 -0
  336. package/dist/zonos-elements/p-9818f823.entry.js +1 -0
  337. package/dist/zonos-elements/p-9b399685.system.entry.js +10 -0
  338. package/dist/zonos-elements/p-9b6482ef.entry.js +1 -0
  339. package/dist/zonos-elements/{p-2c44e013.entry.js → p-9ebe9a36.entry.js} +1 -1
  340. package/dist/zonos-elements/p-B2EZRfoq.system.js +193 -0
  341. package/dist/zonos-elements/p-B3GRrRtL.system.js +5 -0
  342. package/dist/zonos-elements/p-BANhKkF2.system.js +1 -0
  343. package/dist/zonos-elements/p-BDopxBpR.system.js +6 -0
  344. package/dist/zonos-elements/p-BJufDgh3.js +1 -0
  345. package/dist/zonos-elements/p-BLQFeIez.system.js +191 -0
  346. package/dist/zonos-elements/p-BNtWsPPP.system.js +7 -0
  347. package/dist/zonos-elements/p-BSgVcCxT.system.js +9 -0
  348. package/dist/zonos-elements/p-BXjdMMUy.js +1 -0
  349. package/dist/zonos-elements/p-BbgqQIHv.system.js +9 -0
  350. package/dist/zonos-elements/p-BgSx82zO.system.js +11 -0
  351. package/dist/zonos-elements/p-Bi-s0fp_.system.js +17 -0
  352. package/dist/zonos-elements/p-Bu9WCfUC.system.js +5 -0
  353. package/dist/zonos-elements/p-C19J2XSh.js +1 -0
  354. package/dist/zonos-elements/p-C2QMVeWW.js +1 -0
  355. package/dist/zonos-elements/p-C2j7R11h.system.js +11 -0
  356. package/dist/zonos-elements/p-CEl4pzNq.js +1 -0
  357. package/dist/zonos-elements/p-CICjAi70.js +1 -0
  358. package/dist/zonos-elements/p-CIevpRv_.system.js +162 -0
  359. package/dist/zonos-elements/{p-344a6278.js → p-CJCoACvU.js} +2 -2
  360. package/dist/zonos-elements/p-CKBbIU4b.system.js +14 -0
  361. package/dist/zonos-elements/p-CKTIJ2Gr.js +1 -0
  362. package/dist/zonos-elements/p-CKhl__Kc.system.js +4 -0
  363. package/dist/zonos-elements/p-CPnR_T0a.system.js +1153 -0
  364. package/dist/zonos-elements/p-CQqNJo0D.system.js +13 -0
  365. package/dist/zonos-elements/p-CYdt69j5.system.js +241 -0
  366. package/dist/zonos-elements/p-CZl1nwqv.system.js +46 -0
  367. package/dist/zonos-elements/p-CaAod213.system.js +8 -0
  368. package/dist/zonos-elements/p-CaUXHglQ.system.js +153 -0
  369. package/dist/zonos-elements/{p-45bd8072.system.js → p-CeLaK0Ff.system.js} +1 -1
  370. package/dist/zonos-elements/p-CtEsvWI6.js +1 -0
  371. package/dist/zonos-elements/p-D-DawUYF.system.js +1 -0
  372. package/dist/zonos-elements/p-D0erXw7p.js +1 -0
  373. package/dist/zonos-elements/p-D31lQiWo.system.js +21 -0
  374. package/dist/zonos-elements/p-D5AtAlJx.system.js +13 -0
  375. package/dist/zonos-elements/p-DBOI98r5.system.js +7 -0
  376. package/dist/zonos-elements/{p-41dd1cb8.js → p-DE4a-QD5.js} +1 -1
  377. package/dist/zonos-elements/p-DGsEWFDU.system.js +8 -0
  378. package/dist/zonos-elements/{p-a4c7ee17.js → p-DHwpNxG9.js} +1 -1
  379. package/dist/zonos-elements/p-DIJaXkiE.system.js +332 -0
  380. package/dist/zonos-elements/{p-eef5b0cc.js → p-DJIdCwJ5.js} +1 -1
  381. package/dist/zonos-elements/p-DPW1yXt9.system.js +517 -0
  382. package/dist/zonos-elements/{p-6bdc5c96.js → p-DTgv0QpG.js} +1 -1
  383. package/dist/zonos-elements/p-DW-fW8yR.system.js +205 -0
  384. package/dist/zonos-elements/p-Dj-O6VfM.system.js +7 -0
  385. package/dist/zonos-elements/p-DjuFsKLG.js +1 -0
  386. package/dist/zonos-elements/p-DkpYo2Fs.js +1 -0
  387. package/dist/zonos-elements/p-DnjGkbEy.js +1 -0
  388. package/dist/zonos-elements/p-Dw-5yD9y.system.js +227 -0
  389. package/dist/zonos-elements/p-LypTHRUC.js +1 -0
  390. package/dist/zonos-elements/p-MfsSJh_D.system.js +8 -0
  391. package/dist/zonos-elements/p-YdrG78th.js +1 -0
  392. package/dist/zonos-elements/p-_lt63o7c.js +3 -0
  393. package/dist/zonos-elements/p-a38e62cc.entry.js +1 -0
  394. package/dist/zonos-elements/p-a6faab6a.entry.js +1 -0
  395. package/dist/zonos-elements/p-adfee3a3.entry.js +1 -0
  396. package/dist/zonos-elements/p-b14819ab.system.entry.js +14 -0
  397. package/dist/zonos-elements/{p-0c972ddf.entry.js → p-b68ca96f.entry.js} +1 -1
  398. package/dist/zonos-elements/p-b6deae2b.system.entry.js +5 -0
  399. package/dist/zonos-elements/p-bdba7d9e.system.entry.js +25 -0
  400. package/dist/zonos-elements/p-be64d823.system.entry.js +16 -0
  401. package/dist/zonos-elements/p-beeb9d36.system.entry.js +21 -0
  402. package/dist/zonos-elements/p-cadf6b63.system.entry.js +33 -0
  403. package/dist/zonos-elements/p-cc5306fe.system.entry.js +24 -0
  404. package/dist/zonos-elements/p-cc949df1.system.entry.js +7 -0
  405. package/dist/zonos-elements/{p-5d110c2b.entry.js → p-cdffc9b6.entry.js} +1 -1
  406. package/dist/zonos-elements/p-cf5688f7.entry.js +1 -0
  407. package/dist/zonos-elements/p-d05Ku7gM.system.js +24 -0
  408. package/dist/zonos-elements/p-d33dfc78.system.entry.js +2966 -0
  409. package/dist/zonos-elements/p-d55b9664.system.entry.js +157 -0
  410. package/dist/zonos-elements/p-daf9fa07.system.entry.js +133 -0
  411. package/dist/zonos-elements/p-dcdbc610.system.entry.js +27 -0
  412. package/dist/zonos-elements/p-e101d722.system.entry.js +63 -0
  413. package/dist/zonos-elements/{p-9639a8ed.entry.js → p-e284d329.entry.js} +1 -1
  414. package/dist/zonos-elements/{p-5227aa69.entry.js → p-e9320825.entry.js} +1 -1
  415. package/dist/zonos-elements/p-ea8790aa.entry.js +1 -0
  416. package/dist/zonos-elements/{p-6ee4e027.entry.js → p-eadaefdc.entry.js} +1 -1
  417. package/dist/zonos-elements/p-f27317d3.system.entry.js +31 -0
  418. package/dist/zonos-elements/p-f2cedbcd.system.entry.js +121 -0
  419. package/dist/zonos-elements/p-f57495dc.entry.js +1 -0
  420. package/dist/zonos-elements/p-f6e0aeba.system.entry.js +1043 -0
  421. package/dist/zonos-elements/p-f8fd756a.system.entry.js +15 -0
  422. package/dist/zonos-elements/{p-7ada039e.entry.js → p-fe778437.entry.js} +1 -1
  423. package/dist/zonos-elements/{p-adfbf57b.js → p-i1iCWKdv.js} +1 -1
  424. package/dist/zonos-elements/p-lGLcGvEA.js +1 -0
  425. package/dist/zonos-elements/p-nOb4xPLF.system.js +17 -0
  426. package/dist/zonos-elements/p-nU86HJ5w.js +1 -0
  427. package/dist/zonos-elements/p-pfIceXbY.js +1 -0
  428. package/dist/zonos-elements/p-smUku7Ku.system.js +5 -0
  429. package/dist/zonos-elements/p-t_ClFAJR.js +1 -0
  430. package/dist/zonos-elements/p-uV7m6KrY.system.js +46 -0
  431. package/dist/zonos-elements/p-vN6p_rO1.system.js +11 -0
  432. package/dist/zonos-elements/p-zRjRcLMp.js +1 -0
  433. package/dist/zonos-elements/p-zVLAvre1.system.js +60 -0
  434. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  435. package/dist/zonos-elements/zonos-elements.js +1 -1
  436. package/loader/index.d.ts +1 -1
  437. package/package.json +28 -32
  438. package/dist/cjs/RemoveIcon-081ac073.js +0 -5
  439. package/dist/cjs/debounce-7ca3c878.js +0 -357
  440. package/dist/cjs/isDarkColor-a6e6fd5e.js +0 -1202
  441. package/dist/cjs/throttle-366c204b.js +0 -76
  442. package/dist/cjs/zonosStore-0af0b937.js +0 -3030
  443. package/dist/esm/RemoveIcon-9dc5dd1a.js +0 -3
  444. package/dist/esm/debounce-84ade9c2.js +0 -355
  445. package/dist/esm/isDarkColor-939d8e9c.js +0 -1199
  446. package/dist/esm/throttle-c4c24e86.js +0 -74
  447. package/dist/esm/zonosStore-eca1e364.js +0 -3017
  448. package/dist/esm-es5/VarianceTest-572cecf5.js +0 -1
  449. package/dist/esm-es5/cart-d04742f5.js +0 -1
  450. package/dist/esm-es5/classes-0d95c529.js +0 -1
  451. package/dist/esm-es5/cleanHtmlMarkdown-87d195f6.js +0 -1
  452. package/dist/esm-es5/collect-4c310a16.js +0 -1
  453. package/dist/esm-es5/containsNonLatinChars-2d8810c3.js +0 -1
  454. package/dist/esm-es5/createCustomEvent-58159025.js +0 -1
  455. package/dist/esm-es5/debounce-84ade9c2.js +0 -1
  456. package/dist/esm-es5/formatStringWithLinks-0d48f183.js +0 -1
  457. package/dist/esm-es5/getBorderRadius-1f7be586.js +0 -1
  458. package/dist/esm-es5/getContrastColor-4c0ae8c1.js +0 -1
  459. package/dist/esm-es5/getGenericSettingsOverride-0bc3e118.js +0 -1
  460. package/dist/esm-es5/getMissingRequiredShippingFields-f0878e32.js +0 -1
  461. package/dist/esm-es5/handleFetch-a844cac1.js +0 -1
  462. package/dist/esm-es5/hasInclusivePrice-d801be22.js +0 -1
  463. package/dist/esm-es5/helpers-2f6955b1.js +0 -1
  464. package/dist/esm-es5/index-cfd394c8.js +0 -13
  465. package/dist/esm-es5/invoice-86487dac.js +0 -1
  466. package/dist/esm-es5/isColorVariable-0a94004f.js +0 -1
  467. package/dist/esm-es5/isContrastColor-9fa0d013.js +0 -1
  468. package/dist/esm-es5/isDarkColor-939d8e9c.js +0 -1
  469. package/dist/esm-es5/isSameHostCheckoutLink-c1b88ab7.js +0 -1
  470. package/dist/esm-es5/localization-36a4dc22.js +0 -1
  471. package/dist/esm-es5/paypal-997935ab.js +0 -17
  472. package/dist/esm-es5/placeTestOrder-a53f2056.js +0 -1
  473. package/dist/esm-es5/renderCheckoutCurrency-e0e16eb7.js +0 -1
  474. package/dist/esm-es5/shouldRenderTaxIdInput-ef7b5860.js +0 -1
  475. package/dist/esm-es5/shouldShowLanguageSelect-328f50e2.js +0 -1
  476. package/dist/esm-es5/styles-6fc2fad9.js +0 -1
  477. package/dist/esm-es5/submitGtag-71c450b6.js +0 -1
  478. package/dist/esm-es5/throttle-c4c24e86.js +0 -1
  479. package/dist/esm-es5/updateCheckoutSessionAttributes-23b222de.js +0 -1
  480. package/dist/esm-es5/zonosStore-eca1e364.js +0 -1
  481. package/dist/zonos-elements/p-01174496.system.js +0 -1
  482. package/dist/zonos-elements/p-06f798ee.system.js +0 -1
  483. package/dist/zonos-elements/p-083a11cd.system.entry.js +0 -1
  484. package/dist/zonos-elements/p-08e7107d.js +0 -1
  485. package/dist/zonos-elements/p-0b29169b.js +0 -1
  486. package/dist/zonos-elements/p-0c327a57.system.entry.js +0 -1
  487. package/dist/zonos-elements/p-0d2f81ce.system.js +0 -1
  488. package/dist/zonos-elements/p-0e199a6c.system.entry.js +0 -1
  489. package/dist/zonos-elements/p-0ff845ec.js +0 -1
  490. package/dist/zonos-elements/p-117953db.system.entry.js +0 -1
  491. package/dist/zonos-elements/p-14afffa8.system.js +0 -1
  492. package/dist/zonos-elements/p-1834f486.js +0 -1
  493. package/dist/zonos-elements/p-1aa93d1e.system.js +0 -1
  494. package/dist/zonos-elements/p-1ac0c631.system.js +0 -1
  495. package/dist/zonos-elements/p-1b8771bb.js +0 -1
  496. package/dist/zonos-elements/p-1cdd27ec.js +0 -1
  497. package/dist/zonos-elements/p-1cfb5c2a.system.entry.js +0 -1
  498. package/dist/zonos-elements/p-1f8648c8.system.entry.js +0 -1
  499. package/dist/zonos-elements/p-23e7c655.system.js +0 -1
  500. package/dist/zonos-elements/p-2670438c.system.js +0 -1
  501. package/dist/zonos-elements/p-27660512.js +0 -1
  502. package/dist/zonos-elements/p-277b77e3.js +0 -1
  503. package/dist/zonos-elements/p-278abdcf.entry.js +0 -1
  504. package/dist/zonos-elements/p-29b60bf3.system.js +0 -1
  505. package/dist/zonos-elements/p-2b97f7ed.js +0 -1
  506. package/dist/zonos-elements/p-2bbe9d91.js +0 -1
  507. package/dist/zonos-elements/p-2c7a425d.entry.js +0 -1
  508. package/dist/zonos-elements/p-2cab1746.system.entry.js +0 -1
  509. package/dist/zonos-elements/p-3490b6d0.entry.js +0 -1
  510. package/dist/zonos-elements/p-398d9022.system.js +0 -1
  511. package/dist/zonos-elements/p-3a26e5e7.system.entry.js +0 -1
  512. package/dist/zonos-elements/p-40a4c8a2.system.js +0 -1
  513. package/dist/zonos-elements/p-40af92a1.system.entry.js +0 -1
  514. package/dist/zonos-elements/p-4160bbc2.system.js +0 -1
  515. package/dist/zonos-elements/p-41f1697a.system.entry.js +0 -1
  516. package/dist/zonos-elements/p-4671fde7.entry.js +0 -1
  517. package/dist/zonos-elements/p-490d7fec.system.entry.js +0 -1
  518. package/dist/zonos-elements/p-4941c096.system.entry.js +0 -1
  519. package/dist/zonos-elements/p-4b159ff3.system.js +0 -1
  520. package/dist/zonos-elements/p-502d6eeb.js +0 -1
  521. package/dist/zonos-elements/p-50d088f7.system.entry.js +0 -1
  522. package/dist/zonos-elements/p-51e4e61a.system.entry.js +0 -1
  523. package/dist/zonos-elements/p-551fa762.system.js +0 -1
  524. package/dist/zonos-elements/p-5b990c91.entry.js +0 -1
  525. package/dist/zonos-elements/p-60832726.system.js +0 -1
  526. package/dist/zonos-elements/p-67426156.system.js +0 -1
  527. package/dist/zonos-elements/p-6890e060.system.js +0 -1
  528. package/dist/zonos-elements/p-6eaf7c9e.system.entry.js +0 -1
  529. package/dist/zonos-elements/p-7176f582.entry.js +0 -1
  530. package/dist/zonos-elements/p-7261e245.system.js +0 -13
  531. package/dist/zonos-elements/p-7352abe9.js +0 -1
  532. package/dist/zonos-elements/p-74230da8.system.js +0 -1
  533. package/dist/zonos-elements/p-76834a0a.system.entry.js +0 -1
  534. package/dist/zonos-elements/p-77993ba1.entry.js +0 -1
  535. package/dist/zonos-elements/p-78f8e594.entry.js +0 -1
  536. package/dist/zonos-elements/p-7ac8846c.system.js +0 -1
  537. package/dist/zonos-elements/p-7b525c75.system.js +0 -1
  538. package/dist/zonos-elements/p-7f688485.system.entry.js +0 -1
  539. package/dist/zonos-elements/p-7fbbdb0f.system.js +0 -1
  540. package/dist/zonos-elements/p-8861d47e.js +0 -1
  541. package/dist/zonos-elements/p-8a0b8175.system.entry.js +0 -1
  542. package/dist/zonos-elements/p-8a6c4017.js +0 -1
  543. package/dist/zonos-elements/p-8be02f3a.system.js +0 -1
  544. package/dist/zonos-elements/p-8d14cb66.entry.js +0 -1
  545. package/dist/zonos-elements/p-8e6338b9.entry.js +0 -1
  546. package/dist/zonos-elements/p-916228fb.system.js +0 -1
  547. package/dist/zonos-elements/p-944c1fb3.entry.js +0 -1
  548. package/dist/zonos-elements/p-947e4402.system.entry.js +0 -1
  549. package/dist/zonos-elements/p-96ab529e.entry.js +0 -1
  550. package/dist/zonos-elements/p-998975a3.system.js +0 -18
  551. package/dist/zonos-elements/p-9ad640b2.system.entry.js +0 -1
  552. package/dist/zonos-elements/p-9ecb9afc.system.entry.js +0 -1
  553. package/dist/zonos-elements/p-a04e2750.system.entry.js +0 -1
  554. package/dist/zonos-elements/p-a1bd3a53.system.js +0 -1
  555. package/dist/zonos-elements/p-a553e132.js +0 -1
  556. package/dist/zonos-elements/p-acb7dee1.system.entry.js +0 -1
  557. package/dist/zonos-elements/p-af19722c.system.js +0 -1
  558. package/dist/zonos-elements/p-b4ae66cb.system.entry.js +0 -1
  559. package/dist/zonos-elements/p-bcaffb85.system.entry.js +0 -1
  560. package/dist/zonos-elements/p-be6cd28c.system.entry.js +0 -1
  561. package/dist/zonos-elements/p-bf37ccc7.system.js +0 -1
  562. package/dist/zonos-elements/p-c0af11fe.system.js +0 -1
  563. package/dist/zonos-elements/p-c112fa12.system.entry.js +0 -1
  564. package/dist/zonos-elements/p-c4321a1a.system.js +0 -1
  565. package/dist/zonos-elements/p-c5d1217f.system.js +0 -1
  566. package/dist/zonos-elements/p-c7329333.entry.js +0 -1
  567. package/dist/zonos-elements/p-c756a59d.system.js +0 -1
  568. package/dist/zonos-elements/p-c77b049c.entry.js +0 -1
  569. package/dist/zonos-elements/p-ca87ada5.system.entry.js +0 -1
  570. package/dist/zonos-elements/p-ce75b047.js +0 -2
  571. package/dist/zonos-elements/p-d1a51fac.js +0 -1
  572. package/dist/zonos-elements/p-d6a73125.system.entry.js +0 -1
  573. package/dist/zonos-elements/p-d75726e5.system.entry.js +0 -1
  574. package/dist/zonos-elements/p-d938f42f.system.js +0 -1
  575. package/dist/zonos-elements/p-dd866ca3.system.entry.js +0 -1
  576. package/dist/zonos-elements/p-dd8a7bf4.entry.js +0 -1
  577. package/dist/zonos-elements/p-de58684b.system.js +0 -1
  578. package/dist/zonos-elements/p-e160b75f.js +0 -1
  579. package/dist/zonos-elements/p-e1ef3984.system.entry.js +0 -1
  580. package/dist/zonos-elements/p-e27b8e18.entry.js +0 -1
  581. package/dist/zonos-elements/p-e4b07f7d.system.entry.js +0 -1
  582. package/dist/zonos-elements/p-e4dc24e1.system.js +0 -1
  583. package/dist/zonos-elements/p-e5865ad9.system.js +0 -1
  584. package/dist/zonos-elements/p-e7d7afda.entry.js +0 -1
  585. package/dist/zonos-elements/p-ebbda085.system.js +0 -1
  586. package/dist/zonos-elements/p-f4720b0a.js +0 -1
  587. package/dist/zonos-elements/p-f8356934.system.entry.js +0 -1
  588. package/dist/zonos-elements/p-f9346f1c.entry.js +0 -1
  589. package/dist/zonos-elements/p-fc5f6113.js +0 -1
  590. package/dist/zonos-elements/p-fe28dbe6.entry.js +0 -1
  591. package/loader/package.json +0 -11
  592. /package/dist/cjs/{CheckoutConfig-27c82f94.js → CheckoutConfig-B7JRM7yr.js} +0 -0
  593. /package/dist/cjs/{ShortAddressCode-bec338b0.js → ShortAddressCode-C5l520-F.js} +0 -0
  594. /package/dist/cjs/{TaxId-cd9d490e.js → TaxId-Q6aDqqWv.js} +0 -0
  595. /package/dist/cjs/{VarianceTest-bec00ea8.js → VarianceTest-C98whVgO.js} +0 -0
  596. /package/dist/cjs/{app-globals-3a1e7e63.js → app-globals-V2Kpy_OQ.js} +0 -0
  597. /package/dist/cjs/{buildCartItemsByTempCart-edddbf4b.js → buildCartItemsByTempCart-ILzonEjb.js} +0 -0
  598. /package/dist/cjs/{classes-b7918f56.js → classes-D_DL168u.js} +0 -0
  599. /package/dist/cjs/{cleanHtmlMarkdown-57147de7.js → cleanHtmlMarkdown-DpT-nZLH.js} +0 -0
  600. /package/dist/cjs/{containsNonLatinChars-2be5129b.js → containsNonLatinChars-D_OggJN6.js} +0 -0
  601. /package/dist/cjs/{createCustomEvent-7b6fad95.js → createCustomEvent-Cs5zGImL.js} +0 -0
  602. /package/dist/cjs/{getGenericSettingsOverride-c0ca32b9.js → getGenericSettingsOverride-CL6l6wvX.js} +0 -0
  603. /package/dist/cjs/{getHasMoreSpaceOnRight-4c94667f.js → getHasMoreSpaceOnRight-Cl50u1mb.js} +0 -0
  604. /package/dist/cjs/{isCollectMobileTablet-884d4280.js → isCollectMobileTablet-Cx2nZ15_.js} +0 -0
  605. /package/dist/cjs/{isColorVariable-525dbfa7.js → isColorVariable-CKoJdu9G.js} +0 -0
  606. /package/dist/cjs/{isInvoiceMobileTablet-dde41e4e.js → isInvoiceMobileTablet-CCqFYV6m.js} +0 -0
  607. /package/dist/cjs/{isSameHostCheckoutLink-6148cabb.js → isSameHostCheckoutLink-DbmQ7Ha4.js} +0 -0
  608. /package/dist/cjs/{styles-d1e64fb9.js → styles-nowYls3K.js} +0 -0
  609. /package/dist/esm/{CheckoutConfig-724d7bae.js → CheckoutConfig-D5SpFsQJ.js} +0 -0
  610. /package/dist/esm/{ShortAddressCode-7620e622.js → ShortAddressCode-nJ6oI8-n.js} +0 -0
  611. /package/dist/esm/{TaxId-63a14057.js → TaxId-Cye-evFK.js} +0 -0
  612. /package/dist/esm/{VarianceTest-572cecf5.js → VarianceTest-BJmZPrZl.js} +0 -0
  613. /package/dist/esm/{app-globals-0f993ce5.js → app-globals-DQuL1Twl.js} +0 -0
  614. /package/dist/esm/{buildCartItemsByTempCart-a117f75d.js → buildCartItemsByTempCart-BycjkdlE.js} +0 -0
  615. /package/dist/esm/{classes-0d95c529.js → classes-BJHSB96f.js} +0 -0
  616. /package/dist/esm/{cleanHtmlMarkdown-87d195f6.js → cleanHtmlMarkdown-ByGDytaN.js} +0 -0
  617. /package/dist/esm/{containsNonLatinChars-2d8810c3.js → containsNonLatinChars-C04AWRC2.js} +0 -0
  618. /package/dist/esm/{createCustomEvent-58159025.js → createCustomEvent-XQfWgQLB.js} +0 -0
  619. /package/dist/esm/{getGenericSettingsOverride-0bc3e118.js → getGenericSettingsOverride-HeAZDwVW.js} +0 -0
  620. /package/dist/esm/{getHasMoreSpaceOnRight-70eb913a.js → getHasMoreSpaceOnRight-DAscqB23.js} +0 -0
  621. /package/dist/esm/{isCollectMobileTablet-111b0dd7.js → isCollectMobileTablet-DGlnuxEX.js} +0 -0
  622. /package/dist/esm/{isColorVariable-0a94004f.js → isColorVariable-DXXUq2Lv.js} +0 -0
  623. /package/dist/esm/{isInvoiceMobileTablet-1f7b614e.js → isInvoiceMobileTablet-Clej0Ffe.js} +0 -0
  624. /package/dist/esm/{isSameHostCheckoutLink-c1b88ab7.js → isSameHostCheckoutLink-BxAHnL5J.js} +0 -0
  625. /package/dist/esm/{styles-6fc2fad9.js → styles-BTIeCf3T.js} +0 -0
  626. /package/dist/esm-es5/{RemoveIcon-9dc5dd1a.js → RemoveIcon-C2QMVeWW.js} +0 -0
  627. /package/dist/esm-es5/{ShortAddressCode-7620e622.js → ShortAddressCode-nJ6oI8-n.js} +0 -0
  628. /package/dist/esm-es5/{TaxId-63a14057.js → TaxId-Cye-evFK.js} +0 -0
  629. /package/dist/esm-es5/{app-globals-0f993ce5.js → app-globals-DQuL1Twl.js} +0 -0
  630. /package/dist/esm-es5/{getHasMoreSpaceOnRight-70eb913a.js → getHasMoreSpaceOnRight-DAscqB23.js} +0 -0
  631. /package/dist/esm-es5/{isCollectMobileTablet-111b0dd7.js → isCollectMobileTablet-DGlnuxEX.js} +0 -0
  632. /package/dist/esm-es5/{isInvoiceMobileTablet-1f7b614e.js → isInvoiceMobileTablet-Clej0Ffe.js} +0 -0
  633. /package/dist/zonos-elements/{p-2770ba48.system.js → p-0D0aCMu6.system.js} +0 -0
  634. /package/dist/zonos-elements/{p-b4b7f705.js → p-BJHSB96f.js} +0 -0
  635. /package/dist/zonos-elements/{p-0a377722.js → p-BJmZPrZl.js} +0 -0
  636. /package/dist/zonos-elements/{p-96d77739.js → p-BTIeCf3T.js} +0 -0
  637. /package/dist/zonos-elements/{p-56ba5cbf.system.js → p-BbPAtVJG.system.js} +0 -0
  638. /package/dist/zonos-elements/{p-11206fe2.js → p-BxAHnL5J.js} +0 -0
  639. /package/dist/zonos-elements/{p-cc6ad18a.js → p-ByGDytaN.js} +0 -0
  640. /package/dist/zonos-elements/{p-83666056.js → p-BycjkdlE.js} +0 -0
  641. /package/dist/zonos-elements/{p-0c64dbbb.js → p-C04AWRC2.js} +0 -0
  642. /package/dist/zonos-elements/{p-655ec440.system.js → p-C29tlYn0.system.js} +0 -0
  643. /package/dist/zonos-elements/{p-2adbbce7.system.js → p-CLDnjFm5.system.js} +0 -0
  644. /package/dist/zonos-elements/{p-989cb22b.system.js → p-Cby4EkFu.system.js} +0 -0
  645. /package/dist/zonos-elements/{p-1f3549c6.js → p-Clej0Ffe.js} +0 -0
  646. /package/dist/zonos-elements/{p-bcf5cffb.js → p-Cye-evFK.js} +0 -0
  647. /package/dist/zonos-elements/{p-b2d81c98.js → p-D5SpFsQJ.js} +0 -0
  648. /package/dist/zonos-elements/{p-5883217a.js → p-DAscqB23.js} +0 -0
  649. /package/dist/zonos-elements/{p-579932a7.js → p-DGlnuxEX.js} +0 -0
  650. /package/dist/zonos-elements/{p-e1255160.js → p-DQuL1Twl.js} +0 -0
  651. /package/dist/zonos-elements/{p-ae393255.js → p-DXXUq2Lv.js} +0 -0
  652. /package/dist/zonos-elements/{p-e7b0c156.js → p-HeAZDwVW.js} +0 -0
  653. /package/dist/zonos-elements/{p-595f5dd2.js → p-XQfWgQLB.js} +0 -0
  654. /package/dist/zonos-elements/{p-bc7bf53e.system.js → p-Z99tSPFR.system.js} +0 -0
  655. /package/dist/zonos-elements/{p-6f23a26a.system.js → p-_GDmY2H7.system.js} +0 -0
  656. /package/dist/zonos-elements/{p-1d42cd20.js → p-nJ6oI8-n.js} +0 -0
@@ -1,15 +1,11 @@
1
1
  const NAMESPACE = 'zonos-elements';
2
- const BUILD = /* zonos-elements */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, constructableCSS: true, cssAnnotations: true, devTools: false, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: true, hostListenerTarget: true, hostListenerTargetBody: true, hostListenerTargetDocument: true, hostListenerTargetParent: false, hostListenerTargetWindow: true, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: true, mode: false, modernPropertyDecls: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: true, propNumber: true, propString: true, reflect: false, scoped: true, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: true, shadowDom: true, slot: true, slotChildNodesFix: false, slotRelocation: true, state: true, style: true, svg: true, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: true, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: true, watchCallback: true };
2
+ const BUILD = /* zonos-elements */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, constructableCSS: true, cssAnnotations: true, deserializer: false, devTools: false, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: true, hostListenerTarget: true, hostListenerTargetBody: true, hostListenerTargetDocument: true, hostListenerTargetParent: false, hostListenerTargetWindow: true, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: true, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propChangeCallback: true, propMutable: true, propNumber: true, propString: true, reflect: false, scoped: true, scopedSlotTextContentFix: false, scriptDataOpts: false, serializer: false, shadowDelegatesFocus: true, shadowDom: true, shadowSlotAssignmentManual: false, slot: true, slotChildNodesFix: false, slotRelocation: true, state: true, style: true, svg: true, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: true, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: true };
3
3
  const Env = /* zonos-elements */ {};
4
4
 
5
5
  /*
6
- Stencil Client Platform v4.27.2 | MIT Licensed | https://stenciljs.com
6
+ Stencil Client Platform v4.44.2 | MIT Licensed | https://stenciljs.com
7
7
  */
8
- var __defProp = Object.defineProperty;
9
- var __export = (target, all) => {
10
- for (var name in all)
11
- __defProp(target, name, { get: all[name], enumerable: true });
12
- };
8
+
13
9
  var Build = {
14
10
  isDev: BUILD.isDev ? true : false,
15
11
  isBrowser: true,
@@ -20,6 +16,41 @@ var Build = {
20
16
  // src/utils/constants.ts
21
17
  var SVG_NS = "http://www.w3.org/2000/svg";
22
18
  var HTML_NS = "http://www.w3.org/1999/xhtml";
19
+ var PrimitiveType = /* @__PURE__ */ ((PrimitiveType2) => {
20
+ PrimitiveType2["Undefined"] = "undefined";
21
+ PrimitiveType2["Null"] = "null";
22
+ PrimitiveType2["String"] = "string";
23
+ PrimitiveType2["Number"] = "number";
24
+ PrimitiveType2["SpecialNumber"] = "number";
25
+ PrimitiveType2["Boolean"] = "boolean";
26
+ PrimitiveType2["BigInt"] = "bigint";
27
+ return PrimitiveType2;
28
+ })(PrimitiveType || {});
29
+ var NonPrimitiveType = /* @__PURE__ */ ((NonPrimitiveType2) => {
30
+ NonPrimitiveType2["Array"] = "array";
31
+ NonPrimitiveType2["Date"] = "date";
32
+ NonPrimitiveType2["Map"] = "map";
33
+ NonPrimitiveType2["Object"] = "object";
34
+ NonPrimitiveType2["RegularExpression"] = "regexp";
35
+ NonPrimitiveType2["Set"] = "set";
36
+ NonPrimitiveType2["Channel"] = "channel";
37
+ NonPrimitiveType2["Symbol"] = "symbol";
38
+ return NonPrimitiveType2;
39
+ })(NonPrimitiveType || {});
40
+ var TYPE_CONSTANT = "type";
41
+ var VALUE_CONSTANT = "value";
42
+ var SERIALIZED_PREFIX = "serialized:";
43
+
44
+ // src/utils/get-prop-descriptor.ts
45
+ function getPropertyDescriptor(obj, memberName, getOnly) {
46
+ const stopAt = typeof HTMLElement !== "undefined" ? HTMLElement.prototype : null;
47
+ while (obj && obj !== stopAt) {
48
+ const desc = Object.getOwnPropertyDescriptor(obj, memberName);
49
+ if (desc && (!getOnly || desc.get)) return desc;
50
+ obj = Object.getPrototypeOf(obj);
51
+ }
52
+ return void 0;
53
+ }
23
54
 
24
55
  // src/utils/es2022-rewire-class-members.ts
25
56
  var reWireGetterSetter = (instance, hostRef) => {
@@ -29,18 +60,24 @@ var reWireGetterSetter = (instance, hostRef) => {
29
60
  members.map(([memberName, [memberFlags]]) => {
30
61
  if ((BUILD.state || BUILD.prop) && (memberFlags & 31 /* Prop */ || memberFlags & 32 /* State */)) {
31
62
  const ogValue = instance[memberName];
32
- const ogDescriptor = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(instance), memberName);
33
- Object.defineProperty(instance, memberName, {
34
- get() {
35
- return ogDescriptor.get.call(this);
36
- },
37
- set(newValue) {
38
- ogDescriptor.set.call(this, newValue);
39
- },
40
- configurable: true,
41
- enumerable: true
42
- });
43
- instance[memberName] = hostRef.$instanceValues$.has(memberName) ? hostRef.$instanceValues$.get(memberName) : ogValue;
63
+ const ogDescriptor = getPropertyDescriptor(Object.getPrototypeOf(instance), memberName, true) || Object.getOwnPropertyDescriptor(instance, memberName);
64
+ if (ogDescriptor) {
65
+ Object.defineProperty(instance, memberName, {
66
+ get() {
67
+ return ogDescriptor.get.call(this);
68
+ },
69
+ set(newValue) {
70
+ ogDescriptor.set.call(this, newValue);
71
+ },
72
+ configurable: true,
73
+ enumerable: true
74
+ });
75
+ }
76
+ if (hostRef.$instanceValues$.has(memberName)) {
77
+ instance[memberName] = hostRef.$instanceValues$.get(memberName);
78
+ } else if (ogValue !== void 0) {
79
+ instance[memberName] = ogValue;
80
+ }
44
81
  }
45
82
  });
46
83
  };
@@ -53,9 +90,10 @@ var getHostRef = (ref) => {
53
90
  return void 0;
54
91
  };
55
92
  var registerInstance = (lazyInstance, hostRef) => {
93
+ if (!hostRef) return;
56
94
  lazyInstance.__stencil__getHostRef = () => hostRef;
57
95
  hostRef.$lazyInstance$ = lazyInstance;
58
- if (BUILD.modernPropertyDecls && (BUILD.state || BUILD.prop)) {
96
+ if (hostRef.$cmpMeta$.$flags$ & 512 /* hasModernPropertyDecls */ && (BUILD.state || BUILD.prop)) {
59
97
  reWireGetterSetter(lazyInstance, hostRef);
60
98
  }
61
99
  };
@@ -64,7 +102,8 @@ var registerHost = (hostElement, cmpMeta) => {
64
102
  $flags$: 0,
65
103
  $hostElement$: hostElement,
66
104
  $cmpMeta$: cmpMeta,
67
- $instanceValues$: /* @__PURE__ */ new Map()
105
+ $instanceValues$: /* @__PURE__ */ new Map(),
106
+ $serializerValues$: /* @__PURE__ */ new Map()
68
107
  };
69
108
  if (BUILD.isDev) {
70
109
  hostRef.$renderCount$ = 0;
@@ -77,9 +116,12 @@ var registerHost = (hostElement, cmpMeta) => {
77
116
  hostElement["s-p"] = [];
78
117
  hostElement["s-rc"] = [];
79
118
  }
119
+ if (BUILD.lazyLoad) {
120
+ hostRef.$fetchedCbList$ = [];
121
+ }
80
122
  const ref = hostRef;
81
123
  hostElement.__stencil__getHostRef = () => ref;
82
- if (!BUILD.lazyLoad && BUILD.modernPropertyDecls && (BUILD.state || BUILD.prop)) {
124
+ if (!BUILD.lazyLoad && cmpMeta.$flags$ & 512 /* hasModernPropertyDecls */ && (BUILD.state || BUILD.prop)) {
83
125
  reWireGetterSetter(hostElement, hostRef);
84
126
  }
85
127
  return ref;
@@ -98,7 +140,9 @@ var setErrorHandler = (handler) => customError = handler;
98
140
 
99
141
  // src/client/client-load-module.ts
100
142
  var cmpModules = /* @__PURE__ */ new Map();
143
+ var failedLoadAttempts = /* @__PURE__ */ new Map();
101
144
  var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
145
+ var _a;
102
146
  const exportName = cmpMeta.$tagName$.replace(/-/g, "_");
103
147
  const bundleId = cmpMeta.$lazyBundleId$;
104
148
  if (BUILD.isDev && typeof bundleId !== "string") {
@@ -113,21 +157,28 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
113
157
  if (module) {
114
158
  return module[exportName];
115
159
  }
160
+ const retryCount = (_a = failedLoadAttempts.get(bundleId)) != null ? _a : 0;
161
+ const cacheBustParams = [
162
+ retryCount > 0 ? `s-retry=${retryCount}` : "",
163
+ BUILD.hotModuleReplacement && hmrVersionId ? `s-hmr=${hmrVersionId}` : ""
164
+ ].filter(Boolean).join("&");
116
165
  /*!__STENCIL_STATIC_IMPORT_SWITCH__*/
117
166
  return import(
118
167
  /* @vite-ignore */
119
168
  /* webpackInclude: /\.entry\.js$/ */
120
169
  /* webpackExclude: /\.system\.entry\.js$/ */
121
170
  /* webpackMode: "lazy" */
122
- `./${bundleId}.entry.js${BUILD.hotModuleReplacement && hmrVersionId ? "?s-hmr=" + hmrVersionId : ""}`
171
+ `./${bundleId}.entry.js${cacheBustParams ? "?" + cacheBustParams : ""}`
123
172
  ).then(
124
173
  (importedModule) => {
125
174
  if (!BUILD.hotModuleReplacement) {
175
+ failedLoadAttempts.delete(bundleId);
126
176
  cmpModules.set(bundleId, importedModule);
127
177
  }
128
178
  return importedModule[exportName];
129
179
  },
130
180
  (e) => {
181
+ failedLoadAttempts.set(bundleId, retryCount + 1);
131
182
  consoleError(e, hostRef.$hostElement$);
132
183
  }
133
184
  );
@@ -136,6 +187,9 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
136
187
  // src/client/client-style.ts
137
188
  var styles = /* @__PURE__ */ new Map();
138
189
  var modeResolutionChain = [];
190
+ var setScopedSSR = (_opts) => {
191
+ };
192
+ var needsScopedSSR = () => false;
139
193
 
140
194
  // src/runtime/runtime-constants.ts
141
195
  var CONTENT_REF_ID = "r";
@@ -155,6 +209,8 @@ var DEFAULT_DOC_DATA = {
155
209
  };
156
210
  var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
157
211
  var XLINK_NS = "http://www.w3.org/1999/xlink";
212
+ var MAX_LAZY_LOAD_RETRIES = 3;
213
+ var LAZY_LOAD_RETRY_INTERVAL_MS = 1e3;
158
214
  var FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS = [
159
215
  "formAssociatedCallback",
160
216
  "formResetCallback",
@@ -197,12 +253,16 @@ var supportsListenerOptions = /* @__PURE__ */ (() => {
197
253
  var promiseResolve = (v) => Promise.resolve(v);
198
254
  var supportsConstructableStylesheets = BUILD.constructableCSS ? /* @__PURE__ */ (() => {
199
255
  try {
256
+ if (!win.document.adoptedStyleSheets) {
257
+ return false;
258
+ }
200
259
  new CSSStyleSheet();
201
260
  return typeof new CSSStyleSheet().replaceSync === "function";
202
261
  } catch (e) {
203
262
  }
204
263
  return false;
205
264
  })() : false;
265
+ var supportsMutableAdoptedStyleSheets = supportsConstructableStylesheets ? /* @__PURE__ */ (() => !!win.document && Object.getOwnPropertyDescriptor(win.document.adoptedStyleSheets, "length").writable)() : false;
206
266
 
207
267
  // src/client/client-task-queue.ts
208
268
  var queueCongestion = 0;
@@ -210,6 +270,10 @@ var queuePending = false;
210
270
  var queueDomReads = [];
211
271
  var queueDomWrites = [];
212
272
  var queueDomWritesLow = [];
273
+ var scheduleFlush = () => {
274
+ var _a;
275
+ return ((_a = win.document) == null ? void 0 : _a.hidden) ? nextTick(flush) : plt.raf(flush);
276
+ };
213
277
  var queueTask = (queue, write) => (cb) => {
214
278
  queue.push(cb);
215
279
  if (!queuePending) {
@@ -217,7 +281,7 @@ var queueTask = (queue, write) => (cb) => {
217
281
  if (write && plt.$flags$ & 4 /* queueSync */) {
218
282
  nextTick(flush);
219
283
  } else {
220
- plt.raf(flush);
284
+ scheduleFlush();
221
285
  }
222
286
  }
223
287
  };
@@ -261,14 +325,14 @@ var flush = () => {
261
325
  queueDomWrites.length = 0;
262
326
  }
263
327
  if (queuePending = queueDomReads.length + queueDomWrites.length + queueDomWritesLow.length > 0) {
264
- plt.raf(flush);
328
+ scheduleFlush();
265
329
  } else {
266
330
  queueCongestion = 0;
267
331
  }
268
332
  } else {
269
333
  consume(queueDomWrites);
270
334
  if (queuePending = queueDomReads.length > 0) {
271
- plt.raf(flush);
335
+ scheduleFlush();
272
336
  }
273
337
  }
274
338
  };
@@ -283,72 +347,35 @@ var getAssetPath = (path) => {
283
347
  };
284
348
  var setAssetPath = (path) => plt.$resourcesUrl$ = path;
285
349
 
286
- // src/utils/helpers.ts
287
- var isDef = (v) => v != null && v !== void 0;
288
- var isComplexType = (o) => {
289
- o = typeof o;
290
- return o === "object" || o === "function";
291
- };
292
-
293
- // src/utils/query-nonce-meta-tag-content.ts
294
- function queryNonceMetaTagContent(doc) {
295
- var _a, _b, _c;
296
- 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;
350
+ // src/utils/style.ts
351
+ function createStyleSheetIfNeededAndSupported(styles2) {
352
+ return void 0;
297
353
  }
298
354
 
299
- // src/utils/regular-expression.ts
300
- var escapeRegExpSpecialCharacters = (text) => {
301
- return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
302
- };
303
-
304
- // src/utils/result.ts
305
- var result_exports = {};
306
- __export(result_exports, {
307
- err: () => err,
308
- map: () => map,
309
- ok: () => ok,
310
- unwrap: () => unwrap,
311
- unwrapErr: () => unwrapErr
312
- });
313
- var ok = (value) => ({
314
- isOk: true,
315
- isErr: false,
316
- value
317
- });
318
- var err = (value) => ({
319
- isOk: false,
320
- isErr: true,
321
- value
322
- });
323
- function map(result, fn) {
324
- if (result.isOk) {
325
- const val = fn(result.value);
326
- if (val instanceof Promise) {
327
- return val.then((newVal) => ok(newVal));
328
- } else {
329
- return ok(val);
355
+ // src/utils/shadow-root.ts
356
+ var globalStyleSheet;
357
+ function createShadowRoot(cmpMeta) {
358
+ var _a;
359
+ const opts = { mode: "open" };
360
+ if (BUILD.shadowDelegatesFocus) {
361
+ opts.delegatesFocus = !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */);
362
+ }
363
+ if (BUILD.shadowSlotAssignmentManual) {
364
+ const isManual = !!(cmpMeta.$flags$ & 1024 /* shadowSlotAssignmentManual */);
365
+ if (isManual) {
366
+ opts.slotAssignment = "manual";
330
367
  }
331
368
  }
332
- if (result.isErr) {
333
- const value = result.value;
334
- return err(value);
369
+ const shadowRoot = this.attachShadow(opts);
370
+ if (globalStyleSheet === void 0) globalStyleSheet = (_a = createStyleSheetIfNeededAndSupported()) != null ? _a : null;
371
+ if (globalStyleSheet) {
372
+ if (supportsMutableAdoptedStyleSheets) {
373
+ shadowRoot.adoptedStyleSheets.push(globalStyleSheet);
374
+ } else {
375
+ shadowRoot.adoptedStyleSheets = [...shadowRoot.adoptedStyleSheets, globalStyleSheet];
376
+ }
335
377
  }
336
- throw "should never get here";
337
378
  }
338
- var unwrap = (result) => {
339
- if (result.isOk) {
340
- return result.value;
341
- } else {
342
- throw result.value;
343
- }
344
- };
345
- var unwrapErr = (result) => {
346
- if (result.isErr) {
347
- return result.value;
348
- } else {
349
- throw result.value;
350
- }
351
- };
352
379
  var updateFallbackSlotVisibility = (elm) => {
353
380
  const childNodes = internalCall(elm, "childNodes");
354
381
  if (elm.tagName && elm.tagName.includes("-") && elm["s-cr"] && elm.tagName !== "SLOT-FB") {
@@ -390,7 +417,7 @@ function getHostSlotNodes(childNodes, hostName, slotName) {
390
417
  slottedNodes.push(childNode);
391
418
  if (typeof slotName !== "undefined") return slottedNodes;
392
419
  }
393
- slottedNodes = [...slottedNodes, ...getHostSlotNodes(childNode.childNodes, hostName, slotName)];
420
+ slottedNodes = [...slottedNodes, ...getHostSlotNodes(internalCall(childNode, "childNodes"), hostName, slotName)];
394
421
  }
395
422
  return slottedNodes;
396
423
  }
@@ -454,7 +481,7 @@ function patchSlotNode(node) {
454
481
  const slotName = this["s-sn"];
455
482
  if (opts == null ? void 0 : opts.flatten) {
456
483
  console.error(`
457
- Flattening is not supported for Stencil non-shadow slots.
484
+ Flattening is not supported for Stencil non-shadow slots.
458
485
  You can use \`.childNodes\` to nested slot fallback content.
459
486
  If you have a particular use case, please open an issue on the Stencil repo.
460
487
  `);
@@ -502,7 +529,8 @@ var patchPseudoShadowDom = (hostElementPrototype) => {
502
529
  patchSlotRemoveChild(hostElementPrototype);
503
530
  };
504
531
  var patchCloneNode = (HostElementPrototype) => {
505
- const orgCloneNode = HostElementPrototype.cloneNode;
532
+ if (HostElementPrototype.__cloneNode) return;
533
+ const orgCloneNode = HostElementPrototype.__cloneNode = HostElementPrototype.cloneNode;
506
534
  HostElementPrototype.cloneNode = function(deep) {
507
535
  const srcNode = this;
508
536
  const isShadowDom = BUILD.shadowDom ? srcNode.shadowRoot && supportsShadow : false;
@@ -547,6 +575,7 @@ var patchCloneNode = (HostElementPrototype) => {
547
575
  };
548
576
  };
549
577
  var patchSlotAppendChild = (HostElementPrototype) => {
578
+ if (HostElementPrototype.__appendChild) return;
550
579
  HostElementPrototype.__appendChild = HostElementPrototype.appendChild;
551
580
  HostElementPrototype.appendChild = function(newChild) {
552
581
  const { slotName, slotNode } = findSlotFromSlottedNode(newChild, this);
@@ -564,6 +593,7 @@ var patchSlotAppendChild = (HostElementPrototype) => {
564
593
  };
565
594
  };
566
595
  var patchSlotRemoveChild = (ElementPrototype) => {
596
+ if (ElementPrototype.__removeChild) return;
567
597
  ElementPrototype.__removeChild = ElementPrototype.removeChild;
568
598
  ElementPrototype.removeChild = function(toRemove) {
569
599
  if (toRemove && typeof toRemove["s-sn"] !== "undefined") {
@@ -579,6 +609,7 @@ var patchSlotRemoveChild = (ElementPrototype) => {
579
609
  };
580
610
  };
581
611
  var patchSlotPrepend = (HostElementPrototype) => {
612
+ if (HostElementPrototype.__prepend) return;
582
613
  HostElementPrototype.__prepend = HostElementPrototype.prepend;
583
614
  HostElementPrototype.prepend = function(...newChildren) {
584
615
  newChildren.forEach((newChild) => {
@@ -605,6 +636,7 @@ var patchSlotPrepend = (HostElementPrototype) => {
605
636
  };
606
637
  };
607
638
  var patchSlotAppend = (HostElementPrototype) => {
639
+ if (HostElementPrototype.__append) return;
608
640
  HostElementPrototype.__append = HostElementPrototype.append;
609
641
  HostElementPrototype.append = function(...newChildren) {
610
642
  newChildren.forEach((newChild) => {
@@ -616,6 +648,7 @@ var patchSlotAppend = (HostElementPrototype) => {
616
648
  };
617
649
  };
618
650
  var patchSlotInsertAdjacentHTML = (HostElementPrototype) => {
651
+ if (HostElementPrototype.__insertAdjacentHTML) return;
619
652
  const originalInsertAdjacentHtml = HostElementPrototype.insertAdjacentHTML;
620
653
  HostElementPrototype.insertAdjacentHTML = function(position, text) {
621
654
  if (position !== "afterbegin" && position !== "beforeend") {
@@ -641,6 +674,7 @@ var patchSlotInsertAdjacentText = (HostElementPrototype) => {
641
674
  };
642
675
  };
643
676
  var patchInsertBefore = (HostElementPrototype) => {
677
+ if (HostElementPrototype.__insertBefore) return;
644
678
  const eleProto = HostElementPrototype;
645
679
  if (eleProto.__insertBefore) return;
646
680
  eleProto.__insertBefore = HostElementPrototype.insertBefore;
@@ -675,6 +709,7 @@ var patchInsertBefore = (HostElementPrototype) => {
675
709
  };
676
710
  };
677
711
  var patchSlotInsertAdjacentElement = (HostElementPrototype) => {
712
+ if (HostElementPrototype.__insertAdjacentElement) return;
678
713
  const originalInsertAdjacentElement = HostElementPrototype.insertAdjacentElement;
679
714
  HostElementPrototype.insertAdjacentElement = function(position, element) {
680
715
  if (position !== "afterbegin" && position !== "beforeend") {
@@ -729,13 +764,13 @@ var patchChildSlotNodes = (elm) => {
729
764
  patchHostOriginalAccessor("firstChild", elm);
730
765
  Object.defineProperty(elm, "firstChild", {
731
766
  get() {
732
- return this.childNodes[0];
767
+ return this.childNodes[0] || null;
733
768
  }
734
769
  });
735
770
  patchHostOriginalAccessor("lastChild", elm);
736
771
  Object.defineProperty(elm, "lastChild", {
737
772
  get() {
738
- return this.childNodes[this.childNodes.length - 1];
773
+ return this.childNodes[this.childNodes.length - 1] || null;
739
774
  }
740
775
  });
741
776
  patchHostOriginalAccessor("childNodes", elm);
@@ -766,7 +801,7 @@ var patchNextSibling = (node) => {
766
801
  const parentNodes = (_a = this["s-ol"]) == null ? void 0 : _a.parentNode.childNodes;
767
802
  const index = parentNodes == null ? void 0 : parentNodes.indexOf(this);
768
803
  if (parentNodes && index > -1) {
769
- return parentNodes[index + 1];
804
+ return parentNodes[index + 1] || null;
770
805
  }
771
806
  return this.__nextSibling;
772
807
  }
@@ -781,7 +816,7 @@ var patchNextElementSibling = (element) => {
781
816
  const parentEles = (_a = this["s-ol"]) == null ? void 0 : _a.parentNode.children;
782
817
  const index = parentEles == null ? void 0 : parentEles.indexOf(this);
783
818
  if (parentEles && index > -1) {
784
- return parentEles[index + 1];
819
+ return parentEles[index + 1] || null;
785
820
  }
786
821
  return this.__nextElementSibling;
787
822
  }
@@ -796,7 +831,7 @@ var patchPreviousSibling = (node) => {
796
831
  const parentNodes = (_a = this["s-ol"]) == null ? void 0 : _a.parentNode.childNodes;
797
832
  const index = parentNodes == null ? void 0 : parentNodes.indexOf(this);
798
833
  if (parentNodes && index > -1) {
799
- return parentNodes[index - 1];
834
+ return parentNodes[index - 1] || null;
800
835
  }
801
836
  return this.__previousSibling;
802
837
  }
@@ -811,7 +846,7 @@ var patchPreviousElementSibling = (element) => {
811
846
  const parentNodes = (_a = this["s-ol"]) == null ? void 0 : _a.parentNode.children;
812
847
  const index = parentNodes == null ? void 0 : parentNodes.indexOf(this);
813
848
  if (parentNodes && index > -1) {
814
- return parentNodes[index - 1];
849
+ return parentNodes[index - 1] || null;
815
850
  }
816
851
  return this.__previousElementSibling;
817
852
  }
@@ -841,6 +876,9 @@ var validNodesPatches = [
841
876
  "parentNode"
842
877
  ];
843
878
  function patchHostOriginalAccessor(accessorName, node) {
879
+ if (!globalThis.Node || !globalThis.Element) {
880
+ return;
881
+ }
844
882
  let accessor;
845
883
  if (validElementPatches.includes(accessorName)) {
846
884
  accessor = Object.getOwnPropertyDescriptor(Element.prototype, accessorName);
@@ -912,11 +950,13 @@ var inspect = (ref) => {
912
950
  needsRerender: !!(flags & 512 /* needsRerender */)
913
951
  },
914
952
  instanceValues: hostRef.$instanceValues$,
953
+ serializerValues: hostRef.$serializerValues$,
915
954
  ancestorComponent: hostRef.$ancestorComponent$,
916
955
  hostElement,
917
956
  lazyInstance: hostRef.$lazyInstance$,
918
957
  vnode: hostRef.$vnode$,
919
958
  modeName: hostRef.$modeName$,
959
+ fetchedCbList: hostRef.$fetchedCbList$,
920
960
  onReadyPromise: hostRef.$onReadyPromise$,
921
961
  onReadyResolve: hostRef.$onReadyResolve$,
922
962
  onInstancePromise: hostRef.$onInstancePromise$,
@@ -945,7 +985,172 @@ var installDevTools = () => {
945
985
  };
946
986
  }
947
987
  };
988
+
989
+ // src/utils/query-nonce-meta-tag-content.ts
990
+ function queryNonceMetaTagContent(doc) {
991
+ var _a, _b, _c;
992
+ 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;
993
+ }
994
+
995
+ // src/runtime/styles.ts
996
+ var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
997
+ var registerStyle = (scopeId2, cssText, allowCS) => {
998
+ let style = styles.get(scopeId2);
999
+ if (supportsConstructableStylesheets && allowCS) {
1000
+ style = style || new CSSStyleSheet();
1001
+ if (typeof style === "string") {
1002
+ style = cssText;
1003
+ } else {
1004
+ style.replaceSync(cssText);
1005
+ }
1006
+ } else {
1007
+ style = cssText;
1008
+ }
1009
+ styles.set(scopeId2, style);
1010
+ };
1011
+ var addStyle = (styleContainerNode, cmpMeta, mode) => {
1012
+ var _a, _b, _c;
1013
+ const scopeId2 = getScopeId(cmpMeta, mode);
1014
+ const style = styles.get(scopeId2);
1015
+ if (!BUILD.attachStyles || !win.document) {
1016
+ return scopeId2;
1017
+ }
1018
+ styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : win.document;
1019
+ if (style) {
1020
+ if (typeof style === "string") {
1021
+ styleContainerNode = styleContainerNode.head || styleContainerNode;
1022
+ let appliedStyles = rootAppliedStyles.get(styleContainerNode);
1023
+ let styleElm;
1024
+ if (!appliedStyles) {
1025
+ rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
1026
+ }
1027
+ const existingStyleElm = (BUILD.hydrateClientSide || BUILD.hotModuleReplacement) && styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`);
1028
+ if (existingStyleElm) {
1029
+ existingStyleElm.textContent = style;
1030
+ } else if (!appliedStyles.has(scopeId2)) {
1031
+ styleElm = win.document.createElement("style");
1032
+ styleElm.textContent = style;
1033
+ const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
1034
+ if (nonce != null) {
1035
+ styleElm.setAttribute("nonce", nonce);
1036
+ }
1037
+ if ((BUILD.hydrateServerSide || BUILD.hotModuleReplacement) && (cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */ || cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */ || cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
1038
+ styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);
1039
+ }
1040
+ if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
1041
+ if (styleContainerNode.nodeName === "HEAD") {
1042
+ const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
1043
+ const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
1044
+ styleContainerNode.insertBefore(
1045
+ styleElm,
1046
+ (referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
1047
+ );
1048
+ } else if ("host" in styleContainerNode) {
1049
+ if (supportsConstructableStylesheets) {
1050
+ const currentWindow = (_b = styleContainerNode.defaultView) != null ? _b : styleContainerNode.ownerDocument.defaultView;
1051
+ const stylesheet = new currentWindow.CSSStyleSheet();
1052
+ stylesheet.replaceSync(style);
1053
+ if (supportsMutableAdoptedStyleSheets) {
1054
+ styleContainerNode.adoptedStyleSheets.unshift(stylesheet);
1055
+ } else {
1056
+ styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
1057
+ }
1058
+ } else {
1059
+ const existingStyleContainer = styleContainerNode.querySelector("style");
1060
+ if (existingStyleContainer && !BUILD.hotModuleReplacement) {
1061
+ existingStyleContainer.textContent = style + existingStyleContainer.textContent;
1062
+ } else {
1063
+ styleContainerNode.prepend(styleElm);
1064
+ }
1065
+ }
1066
+ } else {
1067
+ styleContainerNode.append(styleElm);
1068
+ }
1069
+ }
1070
+ if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
1071
+ styleContainerNode.insertBefore(styleElm, null);
1072
+ }
1073
+ if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
1074
+ styleElm.textContent += SLOT_FB_CSS;
1075
+ }
1076
+ if (appliedStyles) {
1077
+ appliedStyles.add(scopeId2);
1078
+ }
1079
+ }
1080
+ } else if (BUILD.constructableCSS) {
1081
+ let appliedStyles = rootAppliedStyles.get(styleContainerNode);
1082
+ if (!appliedStyles) {
1083
+ rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
1084
+ }
1085
+ if (!appliedStyles.has(scopeId2)) {
1086
+ const currentWindow = (_c = styleContainerNode.defaultView) != null ? _c : styleContainerNode.ownerDocument.defaultView;
1087
+ let stylesheet;
1088
+ if (style.constructor === currentWindow.CSSStyleSheet) {
1089
+ stylesheet = style;
1090
+ } else {
1091
+ stylesheet = new currentWindow.CSSStyleSheet();
1092
+ for (let i2 = 0; i2 < style.cssRules.length; i2++) {
1093
+ stylesheet.insertRule(style.cssRules[i2].cssText, i2);
1094
+ }
1095
+ }
1096
+ if (supportsMutableAdoptedStyleSheets) {
1097
+ styleContainerNode.adoptedStyleSheets.push(stylesheet);
1098
+ } else {
1099
+ styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, stylesheet];
1100
+ }
1101
+ appliedStyles.add(scopeId2);
1102
+ if (BUILD.hydrateClientSide && "host" in styleContainerNode) {
1103
+ const ssrStyleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`);
1104
+ if (ssrStyleElm) {
1105
+ writeTask(() => ssrStyleElm.remove());
1106
+ }
1107
+ }
1108
+ }
1109
+ }
1110
+ }
1111
+ return scopeId2;
1112
+ };
1113
+ var attachStyles = (hostRef) => {
1114
+ const cmpMeta = hostRef.$cmpMeta$;
1115
+ const elm = hostRef.$hostElement$;
1116
+ const flags = cmpMeta.$flags$;
1117
+ const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
1118
+ const scopeId2 = addStyle(
1119
+ BUILD.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
1120
+ cmpMeta,
1121
+ hostRef.$modeName$
1122
+ );
1123
+ if ((BUILD.shadowDom || BUILD.scoped) && BUILD.cssAnnotations && flags & 10 /* needsScopedEncapsulation */) {
1124
+ elm["s-sc"] = scopeId2;
1125
+ elm.classList.add(scopeId2 + "-h");
1126
+ }
1127
+ endAttachStyles();
1128
+ };
1129
+ var getScopeId = (cmp, mode) => "sc-" + (BUILD.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
1130
+ var convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, "$1{");
1131
+ var hydrateScopedToShadow = () => {
1132
+ if (!win.document) {
1133
+ return;
1134
+ }
1135
+ const styles2 = win.document.querySelectorAll(`[${HYDRATED_STYLE_ID}]`);
1136
+ let i2 = 0;
1137
+ for (; i2 < styles2.length; i2++) {
1138
+ registerStyle(styles2[i2].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles2[i2].innerHTML), true);
1139
+ }
1140
+ };
1141
+
1142
+ // src/utils/helpers.ts
1143
+ var isDef = (v) => v != null && v !== void 0;
1144
+ var isComplexType = (o) => {
1145
+ o = typeof o;
1146
+ return o === "object" || o === "function";
1147
+ };
1148
+
1149
+ // src/runtime/vdom/h.ts
948
1150
  var h = (nodeName, vnodeData, ...children) => {
1151
+ if (typeof nodeName === "string") {
1152
+ nodeName = transformTag(nodeName);
1153
+ }
949
1154
  let child = null;
950
1155
  let key = null;
951
1156
  let slotName = null;
@@ -960,10 +1165,15 @@ var h = (nodeName, vnodeData, ...children) => {
960
1165
  } else if (child != null && typeof child !== "boolean") {
961
1166
  if (simple = typeof nodeName !== "function" && !isComplexType(child)) {
962
1167
  child = String(child);
963
- } else if (BUILD.isDev && typeof nodeName !== "function" && child.$flags$ === void 0) {
964
- consoleDevError(`vNode passed as children has unexpected type.
1168
+ } else if (typeof nodeName !== "function" && child.$flags$ === void 0) {
1169
+ if (BUILD.isDev) {
1170
+ consoleDevError(`vNode passed as children has unexpected type.
965
1171
  Make sure it's using the correct h() function.
966
1172
  Empty objects can also be the cause, look for JSX comments that became objects.`);
1173
+ } else {
1174
+ consoleError("Invalid vNode child");
1175
+ }
1176
+ continue;
967
1177
  }
968
1178
  if (simple && lastSimple) {
969
1179
  vNodeChildren[vNodeChildren.length - 1].$text$ += child;
@@ -1021,7 +1231,8 @@ var newVNode = (tag, text) => {
1021
1231
  const vnode = {
1022
1232
  $flags$: 0,
1023
1233
  $tag$: tag,
1024
- $text$: text,
1234
+ // Normalize undefined to null to prevent rendering "undefined" as text
1235
+ $text$: text != null ? text : null,
1025
1236
  $elm$: null,
1026
1237
  $children$: null
1027
1238
  };
@@ -1085,6 +1296,7 @@ var validateInputProperties = (inputElm) => {
1085
1296
 
1086
1297
  // src/runtime/client-hydrate.ts
1087
1298
  var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1299
+ var _a, _b, _c, _d;
1088
1300
  const endHydrate = createTime("hydrateClient", tagName);
1089
1301
  const shadowRoot = hostElm.shadowRoot;
1090
1302
  const childRenderNodes = [];
@@ -1127,10 +1339,22 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1127
1339
  const orgLocationNode = plt.$orgLocNodes$.get(orgLocationId);
1128
1340
  const node = childRenderNode.$elm$;
1129
1341
  if (!shadowRoot) {
1130
- node["s-hn"] = tagName.toUpperCase();
1342
+ node["s-hn"] = transformTag(tagName).toUpperCase();
1131
1343
  if (childRenderNode.$tag$ === "slot") {
1132
1344
  node["s-cr"] = hostElm["s-cr"];
1133
1345
  }
1346
+ } else if (((_a = childRenderNode.$tag$) == null ? void 0 : _a.toString().includes("-")) && childRenderNode.$tag$ !== "slot-fb" && !childRenderNode.$elm$.shadowRoot) {
1347
+ const cmpMeta = getHostRef(childRenderNode.$elm$);
1348
+ if (cmpMeta) {
1349
+ const scopeId3 = getScopeId(
1350
+ cmpMeta.$cmpMeta$,
1351
+ BUILD.mode ? childRenderNode.$elm$.getAttribute("s-mode") : void 0
1352
+ );
1353
+ const styleSheet = win.document.querySelector(`style[sty-id="${scopeId3}"]`);
1354
+ if (styleSheet) {
1355
+ shadowRootNodes.unshift(styleSheet.cloneNode(true));
1356
+ }
1357
+ }
1134
1358
  }
1135
1359
  if (childRenderNode.$tag$ === "slot") {
1136
1360
  childRenderNode.$name$ = childRenderNode.$elm$["s-sn"] || childRenderNode.$elm$["name"] || null;
@@ -1146,7 +1370,7 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1146
1370
  }
1147
1371
  }
1148
1372
  if (orgLocationNode && orgLocationNode.isConnected) {
1149
- if (shadowRoot && orgLocationNode["s-en"] === "") {
1373
+ if (orgLocationNode.parentElement.shadowRoot && orgLocationNode["s-en"] === "") {
1150
1374
  orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
1151
1375
  }
1152
1376
  orgLocationNode.parentNode.removeChild(orgLocationNode);
@@ -1154,7 +1378,9 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1154
1378
  node["s-oo"] = parseInt(childRenderNode.$nodeId$);
1155
1379
  }
1156
1380
  }
1157
- plt.$orgLocNodes$.delete(orgLocationId);
1381
+ if (orgLocationNode && !orgLocationNode["s-id"]) {
1382
+ plt.$orgLocNodes$.delete(orgLocationId);
1383
+ }
1158
1384
  }
1159
1385
  const hosts = [];
1160
1386
  const snLen = slottedNodes.length;
@@ -1163,6 +1389,7 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1163
1389
  let snGroupIdx;
1164
1390
  let snGroupLen;
1165
1391
  let slottedItem;
1392
+ let currentPos = 0;
1166
1393
  for (snIndex; snIndex < snLen; snIndex++) {
1167
1394
  slotGroup = slottedNodes[snIndex];
1168
1395
  if (!slotGroup || !slotGroup.length) continue;
@@ -1175,21 +1402,27 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1175
1402
  }
1176
1403
  if (!hosts[slottedItem.hostId]) continue;
1177
1404
  const hostEle = hosts[slottedItem.hostId];
1405
+ if (hostEle.shadowRoot && slottedItem.node.parentElement !== hostEle) {
1406
+ hostEle.insertBefore(slottedItem.node, (_c = (_b = slotGroup[snGroupIdx - 1]) == null ? void 0 : _b.node) == null ? void 0 : _c.nextSibling);
1407
+ }
1178
1408
  if (!hostEle.shadowRoot || !shadowRoot) {
1179
- slottedItem.slot["s-cr"] = hostEle["s-cr"];
1180
- if (!slottedItem.slot["s-cr"] && hostEle.shadowRoot) {
1181
- slottedItem.slot["s-cr"] = hostEle;
1182
- } else {
1183
- slottedItem.slot["s-cr"] = (hostEle.__childNodes || hostEle.childNodes)[0];
1409
+ if (!slottedItem.slot["s-cr"]) {
1410
+ slottedItem.slot["s-cr"] = hostEle["s-cr"];
1411
+ if (!slottedItem.slot["s-cr"] && hostEle.shadowRoot) {
1412
+ slottedItem.slot["s-cr"] = hostEle;
1413
+ } else {
1414
+ slottedItem.slot["s-cr"] = (hostEle.__childNodes || hostEle.childNodes)[0];
1415
+ }
1416
+ }
1417
+ addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node["s-oo"] || currentPos);
1418
+ if (((_d = slottedItem.node.parentElement) == null ? void 0 : _d.shadowRoot) && slottedItem.node["getAttribute"] && slottedItem.node.getAttribute("slot")) {
1419
+ slottedItem.node.removeAttribute("slot");
1184
1420
  }
1185
- addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node["s-oo"]);
1186
1421
  if (BUILD.experimentalSlotFixes) {
1187
1422
  patchSlottedNode(slottedItem.node);
1188
1423
  }
1189
1424
  }
1190
- if (hostEle.shadowRoot && slottedItem.node.parentElement !== hostEle) {
1191
- hostEle.appendChild(slottedItem.node);
1192
- }
1425
+ currentPos = (slottedItem.node["s-oo"] || currentPos) + 1;
1193
1426
  }
1194
1427
  }
1195
1428
  if (BUILD.scoped && scopeId2 && slotNodes.length) {
@@ -1202,20 +1435,22 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1202
1435
  const rnLen = shadowRootNodes.length;
1203
1436
  if (rnLen) {
1204
1437
  for (rnIdex; rnIdex < rnLen; rnIdex++) {
1205
- shadowRoot.appendChild(shadowRootNodes[rnIdex]);
1438
+ const node = shadowRootNodes[rnIdex];
1439
+ if (node) {
1440
+ shadowRoot.appendChild(node);
1441
+ }
1206
1442
  }
1207
1443
  Array.from(hostElm.childNodes).forEach((node) => {
1208
- if (typeof node["s-sn"] !== "string") {
1444
+ if (typeof node["s-en"] !== "string" && typeof node["s-sn"] !== "string") {
1209
1445
  if (node.nodeType === 1 /* ElementNode */ && node.slot && node.hidden) {
1210
1446
  node.removeAttribute("hidden");
1211
- } else if (node.nodeType === 8 /* CommentNode */ || node.nodeType === 3 /* TextNode */ && !node.wholeText.trim()) {
1447
+ } else if (node.nodeType === 8 /* CommentNode */ && !node.nodeValue) {
1212
1448
  node.parentNode.removeChild(node);
1213
1449
  }
1214
1450
  }
1215
1451
  });
1216
1452
  }
1217
1453
  }
1218
- plt.$orgLocNodes$.delete(hostElm["s-id"]);
1219
1454
  hostRef.$hostElement$ = hostElm;
1220
1455
  endHydrate();
1221
1456
  };
@@ -1247,7 +1482,7 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
1247
1482
  if (!parentVNode.$children$) {
1248
1483
  parentVNode.$children$ = [];
1249
1484
  }
1250
- if (BUILD.scoped && scopeId2) {
1485
+ if (BUILD.scoped && scopeId2 && childIdSplt[0] === hostId) {
1251
1486
  node["s-si"] = scopeId2;
1252
1487
  childVNode.$attrs$.class += " " + scopeId2;
1253
1488
  }
@@ -1376,10 +1611,6 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
1376
1611
  vnode.$elm$ = node;
1377
1612
  vnode.$index$ = "0";
1378
1613
  parentVNode.$children$ = [vnode];
1379
- } else {
1380
- if (node.nodeType === 3 /* TextNode */ && !node.wholeText.trim()) {
1381
- node.remove();
1382
- }
1383
1614
  }
1384
1615
  return parentVNode;
1385
1616
  };
@@ -1435,10 +1666,10 @@ function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNod
1435
1666
  if (childVNode.$name$) {
1436
1667
  childVNode.$elm$.setAttribute("name", slotName);
1437
1668
  }
1438
- if (parentNodeId && parentNodeId !== childVNode.$hostId$) {
1439
- parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
1669
+ if (parentVNode.$elm$.shadowRoot && parentNodeId && parentNodeId !== childVNode.$hostId$) {
1670
+ internalCall(parentVNode.$elm$, "insertBefore")(slot, internalCall(parentVNode.$elm$, "children")[0]);
1440
1671
  } else {
1441
- node.parentNode.insertBefore(childVNode.$elm$, node);
1672
+ internalCall(internalCall(node, "parentNode"), "insertBefore")(slot, node);
1442
1673
  }
1443
1674
  addSlottedNodes(slottedNodes, slotId, slotName, node, childVNode.$hostId$);
1444
1675
  node.remove();
@@ -1453,8 +1684,8 @@ function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNod
1453
1684
  if (shouldMove) {
1454
1685
  parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
1455
1686
  }
1456
- childRenderNodes.push(childVNode);
1457
1687
  }
1688
+ childRenderNodes.push(childVNode);
1458
1689
  slotNodes.push(childVNode);
1459
1690
  if (!parentVNode.$children$) {
1460
1691
  parentVNode.$children$ = [];
@@ -1462,13 +1693,17 @@ function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNod
1462
1693
  parentVNode.$children$[childVNode.$index$] = childVNode;
1463
1694
  }
1464
1695
  var addSlottedNodes = (slottedNodes, slotNodeId, slotName, slotNode, hostId) => {
1696
+ var _a, _b;
1465
1697
  let slottedNode = slotNode.nextSibling;
1466
1698
  slottedNodes[slotNodeId] = slottedNodes[slotNodeId] || [];
1467
- while (slottedNode && ((slottedNode["getAttribute"] && slottedNode.getAttribute("slot") || slottedNode["s-sn"]) === slotName || slotName === "" && !slottedNode["s-sn"] && (slottedNode.nodeType === 8 /* CommentNode */ && slottedNode.nodeValue.indexOf(".") !== 1 || slottedNode.nodeType === 3 /* TextNode */))) {
1468
- slottedNode["s-sn"] = slotName;
1469
- slottedNodes[slotNodeId].push({ slot: slotNode, node: slottedNode, hostId });
1470
- slottedNode = slottedNode.nextSibling;
1471
- }
1699
+ if (!slottedNode || ((_a = slottedNode.nodeValue) == null ? void 0 : _a.startsWith(SLOT_NODE_ID + "."))) return;
1700
+ do {
1701
+ 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 */))) {
1702
+ slottedNode["s-sn"] = slotName;
1703
+ slottedNodes[slotNodeId].push({ slot: slotNode, node: slottedNode, hostId });
1704
+ }
1705
+ slottedNode = slottedNode == null ? void 0 : slottedNode.nextSibling;
1706
+ } while (slottedNode && !((_b = slottedNode.nodeValue) == null ? void 0 : _b.startsWith(SLOT_NODE_ID + ".")));
1472
1707
  };
1473
1708
  var findCorrespondingNode = (node, type) => {
1474
1709
  let sibling = node;
@@ -1478,6 +1713,11 @@ var findCorrespondingNode = (node, type) => {
1478
1713
  return sibling;
1479
1714
  };
1480
1715
 
1716
+ // src/utils/regular-expression.ts
1717
+ var escapeRegExpSpecialCharacters = (text) => {
1718
+ return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
1719
+ };
1720
+
1481
1721
  // src/utils/shadow-css.ts
1482
1722
  /**
1483
1723
  * @license
@@ -1493,6 +1733,12 @@ var findCorrespondingNode = (node, type) => {
1493
1733
  var safeSelector = (selector) => {
1494
1734
  const placeholders = [];
1495
1735
  let index = 0;
1736
+ selector = selector.replace(/(\[\s*part~=\s*("[^"]*"|'[^']*')\s*\])/g, (_, keep) => {
1737
+ const replaceBy = `__part-${index}__`;
1738
+ placeholders.push(keep);
1739
+ index++;
1740
+ return replaceBy;
1741
+ });
1496
1742
  selector = selector.replace(/(\[[^\]]*\])/g, (_, keep) => {
1497
1743
  const replaceBy = `__ph-${index}__`;
1498
1744
  placeholders.push(keep);
@@ -1512,6 +1758,7 @@ var safeSelector = (selector) => {
1512
1758
  return ss;
1513
1759
  };
1514
1760
  var restoreSafeSelector = (placeholders, content) => {
1761
+ content = content.replace(/__part-(\d+)__/g, (_, index) => placeholders[+index]);
1515
1762
  return content.replace(/__ph-(\d+)__/g, (_, index) => placeholders[+index]);
1516
1763
  };
1517
1764
  var _polyfillHost = "-shadowcsshost";
@@ -1524,12 +1771,18 @@ var _cssColonSlottedRe = new RegExp("(" + _polyfillSlotted + _parenSuffix, "gim"
1524
1771
  var _polyfillHostNoCombinator = _polyfillHost + "-no-combinator";
1525
1772
  var _polyfillHostNoCombinatorRe = /-shadowcsshost-no-combinator([^\s]*)/;
1526
1773
  var _shadowDOMSelectorsRe = [/::shadow/g, /::content/g];
1774
+ var _safePartRe = /__part-(\d+)__/g;
1527
1775
  var _selectorReSuffix = "([>\\s~+[.,{:][\\s\\S]*)?$";
1528
1776
  var _polyfillHostRe = /-shadowcsshost/gim;
1529
- var createSupportsRuleRe = (selector) => new RegExp(`((?<!(^@supports(.*)))|(?<={.*))(${selector}\\b)`, "gim");
1530
- var _colonSlottedRe = createSupportsRuleRe("::slotted");
1531
- var _colonHostRe = createSupportsRuleRe(":host");
1532
- var _colonHostContextRe = createSupportsRuleRe(":host-context");
1777
+ var createSupportsRuleRe = (selector) => {
1778
+ const safeSelector2 = escapeRegExpSpecialCharacters(selector);
1779
+ return new RegExp(
1780
+ // First capture group: match any context before the selector that's not inside @supports selector()
1781
+ // Using negative lookahead to avoid matching inside @supports selector(...) condition
1782
+ `(^|[^@]|@(?!supports\\s+selector\\s*\\([^{]*?${safeSelector2}))(${safeSelector2}\\b)`,
1783
+ "g"
1784
+ );
1785
+ };
1533
1786
  var _commentRe = /\/\*\s*[\s\S]*?\*\//g;
1534
1787
  var stripComments = (input) => {
1535
1788
  return input.replace(_commentRe, "");
@@ -1601,7 +1854,19 @@ var escapeBlocks = (input) => {
1601
1854
  return strEscapedBlocks;
1602
1855
  };
1603
1856
  var insertPolyfillHostInCssText = (cssText) => {
1857
+ const supportsBlocks = [];
1858
+ cssText = cssText.replace(/@supports\s+selector\s*\(\s*([^)]*)\s*\)/g, (_, selectorContent) => {
1859
+ const placeholder = `__supports_${supportsBlocks.length}__`;
1860
+ supportsBlocks.push(selectorContent);
1861
+ return `@supports selector(${placeholder})`;
1862
+ });
1863
+ const _colonSlottedRe = createSupportsRuleRe("::slotted");
1864
+ const _colonHostRe = createSupportsRuleRe(":host");
1865
+ const _colonHostContextRe = createSupportsRuleRe(":host-context");
1604
1866
  cssText = cssText.replace(_colonHostContextRe, `$1${_polyfillHostContext}`).replace(_colonHostRe, `$1${_polyfillHost}`).replace(_colonSlottedRe, `$1${_polyfillSlotted}`);
1867
+ supportsBlocks.forEach((originalSelector, index) => {
1868
+ cssText = cssText.replace(`__supports_${index}__`, originalSelector);
1869
+ });
1605
1870
  return cssText;
1606
1871
  };
1607
1872
  var convertColonRule = (cssText, regExp, partReplacer) => {
@@ -1721,7 +1986,7 @@ var applyStrictSelectorScope = (selector, scopeSelector2, hostSelector) => {
1721
1986
  let scopedSelector = "";
1722
1987
  let startIndex = 0;
1723
1988
  let res;
1724
- const sep = /( |>|\+|~(?!=))\s*/g;
1989
+ const sep = /( |>|\+|~(?!=))(?=(?:[^()]*\([^()]*\))*[^()]*$)\s*/g;
1725
1990
  const hasHost = selector.indexOf(_polyfillHostNoCombinator) > -1;
1726
1991
  let shouldScope = !hasHost;
1727
1992
  while ((res = sep.exec(selector)) !== null) {
@@ -1733,7 +1998,7 @@ var applyStrictSelectorScope = (selector, scopeSelector2, hostSelector) => {
1733
1998
  startIndex = sep.lastIndex;
1734
1999
  }
1735
2000
  const part = selector.substring(startIndex);
1736
- shouldScope = shouldScope || part.indexOf(_polyfillHostNoCombinator) > -1;
2001
+ shouldScope = !part.match(_safePartRe) && (shouldScope || part.indexOf(_polyfillHostNoCombinator) > -1);
1737
2002
  scopedSelector += shouldScope ? _scopeSelectorPart(part) : part;
1738
2003
  return restoreSafeSelector(safeContent.placeholders, scopedSelector);
1739
2004
  };
@@ -1790,13 +2055,43 @@ var scopeCssText = (cssText, scopeId2, hostScopeId, slotScopeId, commentOriginal
1790
2055
  var replaceShadowCssHost = (cssText, hostScopeId) => {
1791
2056
  return cssText.replace(/-shadowcsshost-no-combinator/g, `.${hostScopeId}`);
1792
2057
  };
2058
+ var expandPartSelectors = (cssText) => {
2059
+ const partSelectorRe = /([^\s,{][^,{]*?)::part\(\s*([^)]+?)\s*\)((?:[:.][^,{]*)*)/g;
2060
+ return processRules(cssText, (rule) => {
2061
+ if (rule.selector[0] === "@") {
2062
+ return rule;
2063
+ }
2064
+ const selectors = rule.selector.split(",").map((sel) => {
2065
+ const out = [sel.trim()];
2066
+ let m;
2067
+ while ((m = partSelectorRe.exec(sel)) !== null) {
2068
+ const before = m[1].trimEnd();
2069
+ const partNames = m[2].trim().split(/\s+/);
2070
+ const after = m[3] || "";
2071
+ const partAttr = partNames.flatMap((p) => {
2072
+ if (!rule.selector.includes(`[part~="${p}"]`)) {
2073
+ return [`[part~="${p}"]`];
2074
+ }
2075
+ return [];
2076
+ }).join("");
2077
+ const expanded = `${before} ${partAttr}${after}`;
2078
+ if (!!partAttr && expanded !== sel.trim()) {
2079
+ out.push(expanded);
2080
+ }
2081
+ }
2082
+ return out.join(", ");
2083
+ });
2084
+ rule.selector = selectors.join(", ");
2085
+ return rule;
2086
+ });
2087
+ };
1793
2088
  var scopeCss = (cssText, scopeId2, commentOriginalSelector) => {
1794
2089
  const hostScopeId = scopeId2 + "-h";
1795
2090
  const slotScopeId = scopeId2 + "-s";
1796
2091
  const commentsWithHash = extractCommentsWithHash(cssText);
1797
2092
  cssText = stripComments(cssText);
1798
2093
  const orgSelectors = [];
1799
- if (commentOriginalSelector) {
2094
+ {
1800
2095
  const processCommentedSelector = (rule) => {
1801
2096
  const placeholder = `/*!@___${orgSelectors.length}___*/`;
1802
2097
  const comment = `/*!@${rule.selector}*/`;
@@ -1816,29 +2111,179 @@ var scopeCss = (cssText, scopeId2, commentOriginalSelector) => {
1816
2111
  }
1817
2112
  const scoped = scopeCssText(cssText, scopeId2, hostScopeId, slotScopeId);
1818
2113
  cssText = [scoped.cssText, ...commentsWithHash].join("\n");
1819
- if (commentOriginalSelector) {
2114
+ {
1820
2115
  orgSelectors.forEach(({ placeholder, comment }) => {
1821
2116
  cssText = cssText.replace(placeholder, comment);
1822
2117
  });
1823
2118
  }
1824
2119
  scoped.slottedSelectors.forEach((slottedSelector) => {
1825
- const regex = new RegExp(escapeRegExpSpecialCharacters(slottedSelector.orgSelector), "g");
2120
+ const regex = new RegExp(escapeRegExpSpecialCharacters(slottedSelector.orgSelector) + "(?=\\s*[,{]|$)", "g");
1826
2121
  cssText = cssText.replace(regex, slottedSelector.updatedSelector);
1827
2122
  });
2123
+ cssText = expandPartSelectors(cssText);
1828
2124
  return cssText;
1829
2125
  };
1830
2126
 
1831
2127
  // src/runtime/mode.ts
1832
2128
  var computeMode = (elm) => modeResolutionChain.map((h2) => h2(elm)).find((m) => !!m);
1833
2129
  var setMode = (handler) => modeResolutionChain.push(handler);
1834
- var getMode = (ref) => getHostRef(ref).$modeName$;
1835
- var parsePropertyValue = (propValue, propType) => {
2130
+ var getMode = (ref) => {
2131
+ var _a;
2132
+ return (_a = getHostRef(ref)) == null ? void 0 : _a.$modeName$;
2133
+ };
2134
+
2135
+ // src/runtime/normalize-watchers.ts
2136
+ var normalizeWatchers = (raw) => {
2137
+ if (!raw) return void 0;
2138
+ const keys = Object.keys(raw);
2139
+ if (keys.length === 0) return void 0;
2140
+ let hasLegacy = false;
2141
+ for (const propName of keys) {
2142
+ if (hasLegacy) break;
2143
+ for (const h2 of raw[propName]) {
2144
+ if (typeof h2 === "string") {
2145
+ hasLegacy = true;
2146
+ break;
2147
+ }
2148
+ }
2149
+ }
2150
+ if (!hasLegacy) return raw;
2151
+ const out = {};
2152
+ for (const propName of keys) {
2153
+ out[propName] = raw[propName].map(
2154
+ (h2) => typeof h2 === "string" ? { [h2]: 0 } : h2
2155
+ );
2156
+ }
2157
+ return out;
2158
+ };
2159
+
2160
+ // src/utils/remote-value.ts
2161
+ var RemoteValue = class _RemoteValue {
2162
+ /**
2163
+ * Deserializes a LocalValue serialized object back to its original JavaScript representation
2164
+ *
2165
+ * @param serialized The serialized LocalValue object
2166
+ * @returns The original JavaScript value/object
2167
+ */
2168
+ static fromLocalValue(serialized) {
2169
+ const type = serialized[TYPE_CONSTANT];
2170
+ const value = VALUE_CONSTANT in serialized ? serialized[VALUE_CONSTANT] : void 0;
2171
+ switch (type) {
2172
+ case "string" /* String */:
2173
+ return value;
2174
+ case "boolean" /* Boolean */:
2175
+ return value;
2176
+ case "bigint" /* BigInt */:
2177
+ return BigInt(value);
2178
+ case "undefined" /* Undefined */:
2179
+ return void 0;
2180
+ case "null" /* Null */:
2181
+ return null;
2182
+ case "number" /* Number */:
2183
+ if (value === "NaN") return NaN;
2184
+ if (value === "-0") return -0;
2185
+ if (value === "Infinity") return Infinity;
2186
+ if (value === "-Infinity") return -Infinity;
2187
+ return value;
2188
+ case "array" /* Array */:
2189
+ return value.map((item) => _RemoteValue.fromLocalValue(item));
2190
+ case "date" /* Date */:
2191
+ return new Date(value);
2192
+ case "map" /* Map */:
2193
+ const map = /* @__PURE__ */ new Map();
2194
+ for (const [key, val] of value) {
2195
+ const deserializedKey = typeof key === "object" && key !== null ? _RemoteValue.fromLocalValue(key) : key;
2196
+ const deserializedValue = _RemoteValue.fromLocalValue(val);
2197
+ map.set(deserializedKey, deserializedValue);
2198
+ }
2199
+ return map;
2200
+ case "object" /* Object */:
2201
+ const obj = {};
2202
+ for (const [key, val] of value) {
2203
+ obj[key] = _RemoteValue.fromLocalValue(val);
2204
+ }
2205
+ return obj;
2206
+ case "regexp" /* RegularExpression */:
2207
+ const { pattern, flags } = value;
2208
+ return new RegExp(pattern, flags);
2209
+ case "set" /* Set */:
2210
+ const set = /* @__PURE__ */ new Set();
2211
+ for (const item of value) {
2212
+ set.add(_RemoteValue.fromLocalValue(item));
2213
+ }
2214
+ return set;
2215
+ case "symbol" /* Symbol */:
2216
+ return Symbol(value);
2217
+ default:
2218
+ throw new Error(`Unsupported type: ${type}`);
2219
+ }
2220
+ }
2221
+ /**
2222
+ * Utility method to deserialize multiple LocalValues at once
2223
+ *
2224
+ * @param serializedValues Array of serialized LocalValue objects
2225
+ * @returns Array of deserialized JavaScript values
2226
+ */
2227
+ static fromLocalValueArray(serializedValues) {
2228
+ return serializedValues.map((value) => _RemoteValue.fromLocalValue(value));
2229
+ }
2230
+ /**
2231
+ * Verifies if the given object matches the structure of a serialized LocalValue
2232
+ *
2233
+ * @param obj Object to verify
2234
+ * @returns boolean indicating if the object has LocalValue structure
2235
+ */
2236
+ static isLocalValueObject(obj) {
2237
+ if (typeof obj !== "object" || obj === null) {
2238
+ return false;
2239
+ }
2240
+ if (!obj.hasOwnProperty(TYPE_CONSTANT)) {
2241
+ return false;
2242
+ }
2243
+ const type = obj[TYPE_CONSTANT];
2244
+ const hasTypeProperty = Object.values({ ...PrimitiveType, ...NonPrimitiveType }).includes(type);
2245
+ if (!hasTypeProperty) {
2246
+ return false;
2247
+ }
2248
+ if (type !== "null" /* Null */ && type !== "undefined" /* Undefined */) {
2249
+ return obj.hasOwnProperty(VALUE_CONSTANT);
2250
+ }
2251
+ return true;
2252
+ }
2253
+ };
2254
+
2255
+ // src/utils/serialize.ts
2256
+ function decodeBase64Unicode(base64) {
2257
+ const binary = atob(base64);
2258
+ const bytes = new Uint8Array(binary.length);
2259
+ for (let i2 = 0; i2 < binary.length; i2++) {
2260
+ bytes[i2] = binary.charCodeAt(i2);
2261
+ }
2262
+ return new TextDecoder().decode(bytes);
2263
+ }
2264
+ function deserializeProperty(value) {
2265
+ if (typeof value !== "string" || !value.startsWith(SERIALIZED_PREFIX)) {
2266
+ return value;
2267
+ }
2268
+ return RemoteValue.fromLocalValue(JSON.parse(decodeBase64Unicode(value.slice(SERIALIZED_PREFIX.length))));
2269
+ }
2270
+
2271
+ // src/runtime/parse-property-value.ts
2272
+ var parsePropertyValue = (propValue, propType, isFormAssociated) => {
2273
+ if ((BUILD.hydrateClientSide || BUILD.hydrateServerSide) && typeof propValue === "string" && propValue.startsWith(SERIALIZED_PREFIX)) {
2274
+ propValue = deserializeProperty(propValue);
2275
+ return propValue;
2276
+ }
1836
2277
  if (propValue != null && !isComplexType(propValue)) {
1837
2278
  if (BUILD.propBoolean && propType & 4 /* Boolean */) {
1838
- return propValue === "false" ? false : propValue === "" || !!propValue;
2279
+ if (BUILD.formAssociated && isFormAssociated && typeof propValue === "string") {
2280
+ return propValue === "" || !!propValue;
2281
+ } else {
2282
+ return propValue === "false" ? false : propValue === "" || !!propValue;
2283
+ }
1839
2284
  }
1840
2285
  if (BUILD.propNumber && propType & 2 /* Number */) {
1841
- return parseFloat(propValue);
2286
+ return typeof propValue === "string" ? parseFloat(propValue) : typeof propValue === "number" ? propValue : NaN;
1842
2287
  }
1843
2288
  if (BUILD.propString && propType & 1 /* String */) {
1844
2289
  return String(propValue);
@@ -1847,7 +2292,10 @@ var parsePropertyValue = (propValue, propType) => {
1847
2292
  }
1848
2293
  return propValue;
1849
2294
  };
1850
- var getElement = (ref) => BUILD.lazyLoad ? getHostRef(ref).$hostElement$ : ref;
2295
+ var getElement = (ref) => {
2296
+ var _a;
2297
+ return BUILD.lazyLoad ? (_a = getHostRef(ref)) == null ? void 0 : _a.$hostElement$ : ref;
2298
+ };
1851
2299
 
1852
2300
  // src/runtime/event-emitter.ts
1853
2301
  var createEvent = (ref, name, flags) => {
@@ -1871,123 +2319,9 @@ var emitEvent = (elm, name, opts) => {
1871
2319
  elm.dispatchEvent(ev);
1872
2320
  return ev;
1873
2321
  };
1874
- var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
1875
- var registerStyle = (scopeId2, cssText, allowCS) => {
1876
- let style = styles.get(scopeId2);
1877
- if (supportsConstructableStylesheets && allowCS) {
1878
- style = style || new CSSStyleSheet();
1879
- if (typeof style === "string") {
1880
- style = cssText;
1881
- } else {
1882
- style.replaceSync(cssText);
1883
- }
1884
- } else {
1885
- style = cssText;
1886
- }
1887
- styles.set(scopeId2, style);
1888
- };
1889
- var addStyle = (styleContainerNode, cmpMeta, mode) => {
1890
- var _a;
1891
- const scopeId2 = getScopeId(cmpMeta, mode);
1892
- const style = styles.get(scopeId2);
1893
- if (!BUILD.attachStyles || !win.document) {
1894
- return scopeId2;
1895
- }
1896
- styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : win.document;
1897
- if (style) {
1898
- if (typeof style === "string") {
1899
- styleContainerNode = styleContainerNode.head || styleContainerNode;
1900
- let appliedStyles = rootAppliedStyles.get(styleContainerNode);
1901
- let styleElm;
1902
- if (!appliedStyles) {
1903
- rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
1904
- }
1905
- if (!appliedStyles.has(scopeId2)) {
1906
- if (BUILD.hydrateClientSide && styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
1907
- styleElm.innerHTML = style;
1908
- } else {
1909
- styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) || win.document.createElement("style");
1910
- styleElm.innerHTML = style;
1911
- const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
1912
- if (nonce != null) {
1913
- styleElm.setAttribute("nonce", nonce);
1914
- }
1915
- if ((BUILD.hydrateServerSide || BUILD.hotModuleReplacement) && (cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */ || cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */)) {
1916
- styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);
1917
- }
1918
- if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
1919
- if (styleContainerNode.nodeName === "HEAD") {
1920
- const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
1921
- const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
1922
- styleContainerNode.insertBefore(
1923
- styleElm,
1924
- (referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
1925
- );
1926
- } else if ("host" in styleContainerNode) {
1927
- if (supportsConstructableStylesheets) {
1928
- const stylesheet = new CSSStyleSheet();
1929
- stylesheet.replaceSync(style);
1930
- styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
1931
- } else {
1932
- const existingStyleContainer = styleContainerNode.querySelector("style");
1933
- if (existingStyleContainer) {
1934
- existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
1935
- } else {
1936
- styleContainerNode.prepend(styleElm);
1937
- }
1938
- }
1939
- } else {
1940
- styleContainerNode.append(styleElm);
1941
- }
1942
- }
1943
- if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
1944
- styleContainerNode.insertBefore(styleElm, null);
1945
- }
1946
- }
1947
- if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
1948
- styleElm.innerHTML += SLOT_FB_CSS;
1949
- }
1950
- if (appliedStyles) {
1951
- appliedStyles.add(scopeId2);
1952
- }
1953
- }
1954
- } else if (BUILD.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {
1955
- styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
1956
- }
1957
- }
1958
- return scopeId2;
1959
- };
1960
- var attachStyles = (hostRef) => {
1961
- const cmpMeta = hostRef.$cmpMeta$;
1962
- const elm = hostRef.$hostElement$;
1963
- const flags = cmpMeta.$flags$;
1964
- const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
1965
- const scopeId2 = addStyle(
1966
- BUILD.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
1967
- cmpMeta,
1968
- hostRef.$modeName$
1969
- );
1970
- if ((BUILD.shadowDom || BUILD.scoped) && BUILD.cssAnnotations && (flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */ || flags & 128 /* shadowNeedsScopedCss */)) {
1971
- elm["s-sc"] = scopeId2;
1972
- elm.classList.add(scopeId2 + "-h");
1973
- }
1974
- endAttachStyles();
1975
- };
1976
- var getScopeId = (cmp, mode) => "sc-" + (BUILD.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
1977
- var convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, "$1{");
1978
- var hydrateScopedToShadow = () => {
1979
- if (!win.document) {
1980
- return;
1981
- }
1982
- const styles2 = win.document.querySelectorAll(`[${HYDRATED_STYLE_ID}]`);
1983
- let i2 = 0;
1984
- for (; i2 < styles2.length; i2++) {
1985
- registerStyle(styles2[i2].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles2[i2].innerHTML), true);
1986
- }
1987
- };
1988
- var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRender) => {
1989
- if (oldValue === newValue) {
1990
- return;
2322
+ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRender) => {
2323
+ if (oldValue === newValue) {
2324
+ return;
1991
2325
  }
1992
2326
  let isProp = isMemberInElement(elm, memberName);
1993
2327
  let ln = memberName.toLowerCase();
@@ -1995,12 +2329,13 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
1995
2329
  const classList = elm.classList;
1996
2330
  const oldClasses = parseClassList(oldValue);
1997
2331
  let newClasses = parseClassList(newValue);
1998
- if (BUILD.hydrateClientSide && elm["s-si"] && initialRender) {
1999
- newClasses.push(elm["s-si"]);
2332
+ if (BUILD.hydrateClientSide && (elm["s-si"] || elm["s-sc"]) && initialRender) {
2333
+ const scopeId2 = elm["s-sc"] || elm["s-si"];
2334
+ newClasses.push(scopeId2);
2000
2335
  oldClasses.forEach((c) => {
2001
- if (c.startsWith(elm["s-si"])) newClasses.push(c);
2336
+ if (c.startsWith(scopeId2)) newClasses.push(c);
2002
2337
  });
2003
- newClasses = [...new Set(newClasses)];
2338
+ newClasses = [...new Set(newClasses)].filter((c) => c);
2004
2339
  classList.add(...newClasses);
2005
2340
  } else {
2006
2341
  classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
@@ -2029,7 +2364,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
2029
2364
  }
2030
2365
  } else if (BUILD.vdomKey && memberName === "key") ; else if (BUILD.vdomRef && memberName === "ref") {
2031
2366
  if (newValue) {
2032
- newValue(elm);
2367
+ queueRefAttachment(newValue, elm);
2033
2368
  }
2034
2369
  } else if (BUILD.vdomListener && (BUILD.lazyLoad ? !isProp : !elm.__lookupSetter__(memberName)) && memberName[0] === "o" && memberName[1] === "n") {
2035
2370
  if (memberName[2] === "-") {
@@ -2049,6 +2384,36 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
2049
2384
  plt.ael(elm, memberName, newValue, capture);
2050
2385
  }
2051
2386
  }
2387
+ } else if (BUILD.vdomPropOrAttr && memberName[0] === "a" && memberName.startsWith("attr:")) {
2388
+ const propName = memberName.slice(5);
2389
+ let attrName;
2390
+ if (BUILD.member) {
2391
+ const hostRef = getHostRef(elm);
2392
+ if (hostRef && hostRef.$cmpMeta$ && hostRef.$cmpMeta$.$members$) {
2393
+ const memberMeta = hostRef.$cmpMeta$.$members$[propName];
2394
+ if (memberMeta && memberMeta[1]) {
2395
+ attrName = memberMeta[1];
2396
+ }
2397
+ }
2398
+ }
2399
+ if (!attrName) {
2400
+ attrName = propName.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
2401
+ }
2402
+ if (newValue == null || newValue === false) {
2403
+ if (newValue !== false || elm.getAttribute(attrName) === "") {
2404
+ elm.removeAttribute(attrName);
2405
+ }
2406
+ } else {
2407
+ elm.setAttribute(attrName, newValue === true ? "" : newValue);
2408
+ }
2409
+ return;
2410
+ } else if (BUILD.vdomPropOrAttr && memberName[0] === "p" && memberName.startsWith("prop:")) {
2411
+ const propName = memberName.slice(5);
2412
+ try {
2413
+ elm[propName] = newValue;
2414
+ } catch (e) {
2415
+ }
2416
+ return;
2052
2417
  } else if (BUILD.vdomPropOrAttr) {
2053
2418
  const isComplex = isComplexType(newValue);
2054
2419
  if ((isProp || isComplex && newValue !== null) && !isSvg) {
@@ -2057,7 +2422,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
2057
2422
  const n = newValue == null ? "" : newValue;
2058
2423
  if (memberName === "list") {
2059
2424
  isProp = false;
2060
- } else if (oldValue == null || elm[memberName] != n) {
2425
+ } else if (oldValue == null || elm[memberName] !== n) {
2061
2426
  if (typeof elm.__lookupSetter__(memberName) === "function") {
2062
2427
  elm[memberName] = n;
2063
2428
  } else {
@@ -2078,7 +2443,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
2078
2443
  }
2079
2444
  }
2080
2445
  if (newValue == null || newValue === false) {
2081
- if (newValue !== false || elm.getAttribute(memberName) === "") {
2446
+ if (newValue !== false || elm.getAttribute(memberName) === "" || flags & 4 /* isHost */ && !isEnumeratedAttribute(memberName)) {
2082
2447
  if (BUILD.vdomXlink && xlink) {
2083
2448
  elm.removeAttributeNS(XLINK_NS, memberName);
2084
2449
  } else {
@@ -2095,6 +2460,8 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
2095
2460
  }
2096
2461
  }
2097
2462
  };
2463
+ var ENUMERATED_ATTRIBUTES = /* @__PURE__ */ new Set(["draggable", "contenteditable", "spellcheck"]);
2464
+ var isEnumeratedAttribute = (attrName) => ENUMERATED_ATTRIBUTES.has(attrName) || attrName.startsWith("aria-");
2098
2465
  var parseClassListRegex = /\s/;
2099
2466
  var parseClassList = (value) => {
2100
2467
  if (typeof value === "object" && value && "baseVal" in value) {
@@ -2158,6 +2525,8 @@ var useNativeShadowDom = false;
2158
2525
  var checkSlotFallbackVisibility = false;
2159
2526
  var checkSlotRelocate = false;
2160
2527
  var isSvgMode = false;
2528
+ var refCallbacksToRemove = [];
2529
+ var refCallbacksToAttach = [];
2161
2530
  var createElm = (oldParentVNode, newParentVNode, childIndex) => {
2162
2531
  var _a;
2163
2532
  const newVNode2 = newParentVNode.$children$[childIndex];
@@ -2185,7 +2554,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
2185
2554
  `The JSX ${newVNode2.$text$ !== null ? `"${newVNode2.$text$}" text` : `"${newVNode2.$tag$}" element`} node should not be shared within the same renderer. The renderer caches element lookups in order to improve performance. However, a side effect from this is that the exact same JSX node should not be reused. For more information please see https://stenciljs.com/docs/templating-jsx#avoid-shared-jsx-nodes`
2186
2555
  );
2187
2556
  }
2188
- if (BUILD.vdomText && newVNode2.$text$ !== null) {
2557
+ if (BUILD.vdomText && newVNode2.$text$ != null) {
2189
2558
  elm = newVNode2.$elm$ = win.document.createTextNode(newVNode2.$text$);
2190
2559
  } else if (BUILD.slotRelocation && newVNode2.$flags$ & 1 /* isSlotReference */) {
2191
2560
  elm = newVNode2.$elm$ = BUILD.isDebug || BUILD.hydrateServerSide ? slotReferenceDebugNode(newVNode2) : win.document.createTextNode("");
@@ -2197,9 +2566,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
2197
2566
  isSvgMode = newVNode2.$tag$ === "svg";
2198
2567
  }
2199
2568
  if (!win.document) {
2200
- throw new Error(
2201
- "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."
2202
- );
2569
+ throw new Error("You are trying to render a Stencil component in an environment that doesn't support the DOM.");
2203
2570
  }
2204
2571
  elm = newVNode2.$elm$ = BUILD.svg ? win.document.createElementNS(
2205
2572
  isSvgMode ? SVG_NS : HTML_NS,
@@ -2213,14 +2580,15 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
2213
2580
  if (BUILD.vdomAttribute) {
2214
2581
  updateElement(null, newVNode2, isSvgMode);
2215
2582
  }
2216
- if (BUILD.scoped && isDef(scopeId) && elm["s-si"] !== scopeId) {
2583
+ if ((BUILD.scoped || BUILD.hydrateServerSide && 128 /* shadowNeedsScopedCss */) && isDef(scopeId) && elm["s-si"] !== scopeId) {
2217
2584
  elm.classList.add(elm["s-si"] = scopeId);
2218
2585
  }
2219
2586
  if (newVNode2.$children$) {
2587
+ const appendTarget = newVNode2.$tag$ === "template" ? elm.content : elm;
2220
2588
  for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
2221
2589
  childNode = createElm(oldParentVNode, newVNode2, i2);
2222
2590
  if (childNode) {
2223
- elm.appendChild(childNode);
2591
+ appendTarget.appendChild(childNode);
2224
2592
  }
2225
2593
  }
2226
2594
  }
@@ -2242,13 +2610,9 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
2242
2610
  patchSlotNode(elm);
2243
2611
  oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
2244
2612
  if (oldVNode && oldVNode.$tag$ === newVNode2.$tag$ && oldParentVNode.$elm$) {
2245
- if (BUILD.experimentalSlotFixes) {
2246
- relocateToHostRoot(oldParentVNode.$elm$);
2247
- } else {
2248
- putBackInOriginalLocation(oldParentVNode.$elm$, false);
2249
- }
2613
+ relocateToHostRoot(oldParentVNode.$elm$);
2250
2614
  }
2251
- if (BUILD.scoped) {
2615
+ if (BUILD.scoped || BUILD.hydrateServerSide && 128 /* shadowNeedsScopedCss */) {
2252
2616
  addRemoveSlotScopedClass(contentRef, elm, newParentVNode.$elm$, oldParentVNode == null ? void 0 : oldParentVNode.$elm$);
2253
2617
  }
2254
2618
  }
@@ -2273,12 +2637,12 @@ var relocateToHostRoot = (parentElm) => {
2273
2637
  }
2274
2638
  }
2275
2639
  }
2276
- plt.$flags$ &= ~1 /* isTmpDisconnected */;
2640
+ plt.$flags$ &= -2 /* isTmpDisconnected */;
2277
2641
  };
2278
2642
  var putBackInOriginalLocation = (parentElm, recursive) => {
2279
2643
  plt.$flags$ |= 1 /* isTmpDisconnected */;
2280
2644
  const oldSlotChildNodes = Array.from(parentElm.__childNodes || parentElm.childNodes);
2281
- if (parentElm["s-sr"] && BUILD.experimentalSlotFixes) {
2645
+ if (parentElm["s-sr"]) {
2282
2646
  let node = parentElm;
2283
2647
  while (node = node.nextSibling) {
2284
2648
  if (node && node["s-sn"] === parentElm["s-sn"] && node["s-sh"] === hostTagName) {
@@ -2299,7 +2663,7 @@ var putBackInOriginalLocation = (parentElm, recursive) => {
2299
2663
  putBackInOriginalLocation(childNode, recursive);
2300
2664
  }
2301
2665
  }
2302
- plt.$flags$ &= ~1 /* isTmpDisconnected */;
2666
+ plt.$flags$ &= -2 /* isTmpDisconnected */;
2303
2667
  };
2304
2668
  var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
2305
2669
  let containerElm = BUILD.slotRelocation && parentElm["s-cr"] && parentElm["s-cr"].parentNode || parentElm;
@@ -2307,6 +2671,9 @@ var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
2307
2671
  if (BUILD.shadowDom && containerElm.shadowRoot && containerElm.tagName === hostTagName) {
2308
2672
  containerElm = containerElm.shadowRoot;
2309
2673
  }
2674
+ if (parentVNode.$tag$ === "template") {
2675
+ containerElm = containerElm.content;
2676
+ }
2310
2677
  for (; startIdx <= endIdx; ++startIdx) {
2311
2678
  if (vnodes[startIdx]) {
2312
2679
  childNode = createElm(null, parentVNode, startIdx);
@@ -2350,6 +2717,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
2350
2717
  let newEndVnode = newCh[newEndIdx];
2351
2718
  let node;
2352
2719
  let elmToMove;
2720
+ const containerElm = newVNode2.$tag$ === "template" ? parentElm.content : parentElm;
2353
2721
  while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
2354
2722
  if (oldStartVnode == null) {
2355
2723
  oldStartVnode = oldCh[++oldStartIdx];
@@ -2372,7 +2740,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
2372
2740
  putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
2373
2741
  }
2374
2742
  patch(oldStartVnode, newEndVnode, isInitialRender);
2375
- insertBefore(parentElm, oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
2743
+ insertBefore(containerElm, oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
2376
2744
  oldStartVnode = oldCh[++oldStartIdx];
2377
2745
  newEndVnode = newCh[--newEndIdx];
2378
2746
  } else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
@@ -2380,7 +2748,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
2380
2748
  putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
2381
2749
  }
2382
2750
  patch(oldEndVnode, newStartVnode, isInitialRender);
2383
- insertBefore(parentElm, oldEndVnode.$elm$, oldStartVnode.$elm$);
2751
+ insertBefore(containerElm, oldEndVnode.$elm$, oldStartVnode.$elm$);
2384
2752
  oldEndVnode = oldCh[--oldEndIdx];
2385
2753
  newStartVnode = newCh[++newStartIdx];
2386
2754
  } else {
@@ -2456,13 +2824,13 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
2456
2824
  const tag = newVNode2.$tag$;
2457
2825
  const text = newVNode2.$text$;
2458
2826
  let defaultHolder;
2459
- if (!BUILD.vdomText || text === null) {
2827
+ if (!BUILD.vdomText || text == null) {
2460
2828
  if (BUILD.svg) {
2461
2829
  isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
2462
2830
  }
2463
2831
  if (BUILD.vdomAttribute || BUILD.reflect) {
2464
2832
  if (BUILD.slot && tag === "slot" && !useNativeShadowDom) {
2465
- if (BUILD.experimentalSlotFixes && oldVNode.$name$ !== newVNode2.$name$) {
2833
+ if (oldVNode.$name$ !== newVNode2.$name$) {
2466
2834
  newVNode2.$elm$["s-sn"] = newVNode2.$name$ || "";
2467
2835
  relocateToHostRoot(newVNode2.$elm$.parentElement);
2468
2836
  }
@@ -2481,6 +2849,8 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
2481
2849
  !isInitialRender && BUILD.updatable && oldChildren !== null
2482
2850
  ) {
2483
2851
  removeVnodes(oldChildren, 0, oldChildren.length - 1);
2852
+ } else if (BUILD.hydrateClientSide && isInitialRender && BUILD.updatable && oldChildren !== null && newChildren === null) {
2853
+ newVNode2.$children$ = oldChildren;
2484
2854
  }
2485
2855
  if (BUILD.svg && isSvgMode && tag === "svg") {
2486
2856
  isSvgMode = false;
@@ -2503,7 +2873,10 @@ var markSlotContentForRelocation = (elm) => {
2503
2873
  const slotName = childNode["s-sn"];
2504
2874
  for (j = hostContentNodes.length - 1; j >= 0; j--) {
2505
2875
  node = hostContentNodes[j];
2506
- if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (!BUILD.experimentalSlotFixes || !node["s-sh"] || node["s-sh"] !== childNode["s-hn"])) {
2876
+ if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && // let an exact named-slot match override a stale default-slot claim. Skip this for
2877
+ // `slotName === ''` itself - a matched default node's cached `s-sn` is `''` too, which
2878
+ // would trivially "match" on every re-render and force pointless re-insertion.
2879
+ (!node["s-sh"] || node["s-sh"] !== childNode["s-hn"] || slotName !== "" && getSlotName(node) === slotName)) {
2507
2880
  if (isNodeLocatedInSlot(node, slotName)) {
2508
2881
  let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
2509
2882
  checkSlotFallbackVisibility = true;
@@ -2543,23 +2916,40 @@ var markSlotContentForRelocation = (elm) => {
2543
2916
  };
2544
2917
  var nullifyVNodeRefs = (vNode) => {
2545
2918
  if (BUILD.vdomRef) {
2546
- vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
2919
+ if (vNode.$attrs$ && vNode.$attrs$.ref) {
2920
+ refCallbacksToRemove.push(() => vNode.$attrs$.ref(null));
2921
+ }
2547
2922
  vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
2548
2923
  }
2549
2924
  };
2550
- var insertBefore = (parent, newNode, reference) => {
2551
- if (BUILD.scoped && typeof newNode["s-sn"] === "string" && !!newNode["s-sr"] && !!newNode["s-cr"]) {
2552
- addRemoveSlotScopedClass(newNode["s-cr"], newNode, parent, newNode.parentElement);
2553
- } else if (BUILD.experimentalSlotFixes && typeof newNode["s-sn"] === "string") {
2554
- if (parent.getRootNode().nodeType !== 11 /* DOCUMENT_FRAGMENT_NODE */) {
2555
- patchParentNode(newNode);
2925
+ var queueRefAttachment = (refCallback, elm) => {
2926
+ if (BUILD.vdomRef) {
2927
+ refCallbacksToAttach.push(() => refCallback(elm));
2928
+ }
2929
+ };
2930
+ var flushQueuedRefCallbacks = () => {
2931
+ if (BUILD.vdomRef) {
2932
+ refCallbacksToRemove.forEach((cb) => cb());
2933
+ refCallbacksToRemove.length = 0;
2934
+ refCallbacksToAttach.forEach((cb) => cb());
2935
+ refCallbacksToAttach.length = 0;
2936
+ }
2937
+ };
2938
+ var insertBefore = (parent, newNode, reference, isInitialLoad) => {
2939
+ if (BUILD.slotRelocation) {
2940
+ if (BUILD.scoped && typeof newNode["s-sn"] === "string" && !!newNode["s-sr"] && !!newNode["s-cr"]) {
2941
+ addRemoveSlotScopedClass(newNode["s-cr"], newNode, parent, newNode.parentElement);
2942
+ } else if (typeof newNode["s-sn"] === "string") {
2943
+ if (BUILD.experimentalSlotFixes && parent.getRootNode().nodeType !== 11 /* DOCUMENT_FRAGMENT_NODE */) {
2944
+ patchParentNode(newNode);
2945
+ }
2946
+ parent.insertBefore(newNode, reference);
2947
+ const { slotNode } = findSlotFromSlottedNode(newNode);
2948
+ if (slotNode && !isInitialLoad) dispatchSlotChangeEvent(slotNode);
2949
+ return newNode;
2556
2950
  }
2557
- parent.insertBefore(newNode, reference);
2558
- const { slotNode } = findSlotFromSlottedNode(newNode);
2559
- if (slotNode) dispatchSlotChangeEvent(slotNode);
2560
- return newNode;
2561
2951
  }
2562
- if (BUILD.experimentalSlotFixes && parent.__insertBefore) {
2952
+ if (BUILD.slotRelocation && (parent == null ? void 0 : parent.__insertBefore)) {
2563
2953
  return parent.__insertBefore(newNode, reference);
2564
2954
  } else {
2565
2955
  return parent == null ? void 0 : parent.insertBefore(newNode, reference);
@@ -2591,7 +2981,8 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
2591
2981
  const hostElm = hostRef.$hostElement$;
2592
2982
  const cmpMeta = hostRef.$cmpMeta$;
2593
2983
  const oldVNode = hostRef.$vnode$ || newVNode(null, null);
2594
- const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
2984
+ const isHostElement = isHost(renderFnResults);
2985
+ const rootVnode = isHostElement ? renderFnResults : h(null, null, renderFnResults);
2595
2986
  hostTagName = hostElm.tagName;
2596
2987
  if (BUILD.isDev && Array.isArray(renderFnResults) && renderFnResults.some(isHost)) {
2597
2988
  throw new Error(`The <Host> must be the single root component.
@@ -2609,9 +3000,13 @@ render() {
2609
3000
  }
2610
3001
  if (BUILD.reflect && cmpMeta.$attrsToReflect$) {
2611
3002
  rootVnode.$attrs$ = rootVnode.$attrs$ || {};
2612
- cmpMeta.$attrsToReflect$.map(
2613
- ([propName, attribute]) => rootVnode.$attrs$[attribute] = hostElm[propName]
2614
- );
3003
+ cmpMeta.$attrsToReflect$.forEach(([propName, attribute]) => {
3004
+ if (BUILD.serializer && hostRef.$serializerValues$.has(propName)) {
3005
+ rootVnode.$attrs$[attribute] = hostRef.$serializerValues$.get(propName);
3006
+ } else {
3007
+ rootVnode.$attrs$[attribute] = hostElm[propName];
3008
+ }
3009
+ });
2615
3010
  }
2616
3011
  if (isInitialLoad && rootVnode.$attrs$) {
2617
3012
  for (const key of Object.keys(rootVnode.$attrs$)) {
@@ -2642,19 +3037,27 @@ render() {
2642
3037
  if (!nodeToRelocate["s-ol"] && win.document) {
2643
3038
  const orgLocationNode = BUILD.isDebug || BUILD.hydrateServerSide ? originalLocationDebugNode(nodeToRelocate) : win.document.createTextNode("");
2644
3039
  orgLocationNode["s-nr"] = nodeToRelocate;
2645
- insertBefore(nodeToRelocate.parentNode, nodeToRelocate["s-ol"] = orgLocationNode, nodeToRelocate);
3040
+ insertBefore(
3041
+ nodeToRelocate.parentNode,
3042
+ nodeToRelocate["s-ol"] = orgLocationNode,
3043
+ nodeToRelocate,
3044
+ isInitialLoad
3045
+ );
2646
3046
  }
2647
3047
  }
2648
3048
  for (const relocateData of relocateNodes) {
2649
3049
  const nodeToRelocate = relocateData.$nodeToRelocate$;
2650
3050
  const slotRefNode = relocateData.$slotRefNode$;
3051
+ if (nodeToRelocate.nodeType === 1 /* ElementNode */ && isInitialLoad) {
3052
+ nodeToRelocate["s-ih"] = (_a = nodeToRelocate.hidden) != null ? _a : false;
3053
+ }
2651
3054
  if (slotRefNode) {
2652
3055
  const parentNodeRef = slotRefNode.parentNode;
2653
3056
  let insertBeforeNode = slotRefNode.nextSibling;
2654
- if (!BUILD.hydrateServerSide && (!BUILD.experimentalSlotFixes || insertBeforeNode && insertBeforeNode.nodeType === 1 /* ElementNode */)) {
2655
- let orgLocationNode = (_a = nodeToRelocate["s-ol"]) == null ? void 0 : _a.previousSibling;
3057
+ if (!BUILD.hydrateServerSide && insertBeforeNode && insertBeforeNode.nodeType === 1 /* ElementNode */) {
3058
+ let orgLocationNode = (_b = nodeToRelocate["s-ol"]) == null ? void 0 : _b.previousSibling;
2656
3059
  while (orgLocationNode) {
2657
- let refNode = (_b = orgLocationNode["s-nr"]) != null ? _b : null;
3060
+ let refNode = (_c = orgLocationNode["s-nr"]) != null ? _c : null;
2658
3061
  if (refNode && refNode["s-sn"] === nodeToRelocate["s-sn"] && parentNodeRef === (refNode.__parentNode || refNode.parentNode)) {
2659
3062
  refNode = refNode.nextSibling;
2660
3063
  while (refNode === nodeToRelocate || (refNode == null ? void 0 : refNode["s-sr"])) {
@@ -2672,44 +3075,55 @@ render() {
2672
3075
  const nextSibling = nodeToRelocate.__nextSibling || nodeToRelocate.nextSibling;
2673
3076
  if (!insertBeforeNode && parentNodeRef !== parent || nextSibling !== insertBeforeNode) {
2674
3077
  if (nodeToRelocate !== insertBeforeNode) {
2675
- if (!BUILD.experimentalSlotFixes && !nodeToRelocate["s-hn"] && nodeToRelocate["s-ol"]) {
2676
- nodeToRelocate["s-hn"] = nodeToRelocate["s-ol"].parentNode.nodeName;
3078
+ insertBefore(parentNodeRef, nodeToRelocate, insertBeforeNode, isInitialLoad);
3079
+ if (nodeToRelocate.nodeType === 8 /* CommentNode */ && nodeToRelocate.nodeValue.startsWith("s-nt-")) {
3080
+ const textNode = win.document.createTextNode(nodeToRelocate.nodeValue.replace(/^s-nt-/, ""));
3081
+ textNode["s-hn"] = nodeToRelocate["s-hn"];
3082
+ textNode["s-sn"] = nodeToRelocate["s-sn"];
3083
+ textNode["s-sh"] = nodeToRelocate["s-sh"];
3084
+ textNode["s-sr"] = nodeToRelocate["s-sr"];
3085
+ textNode["s-ol"] = nodeToRelocate["s-ol"];
3086
+ textNode["s-ol"]["s-nr"] = textNode;
3087
+ insertBefore(nodeToRelocate.parentNode, textNode, nodeToRelocate, isInitialLoad);
3088
+ nodeToRelocate.parentNode.removeChild(nodeToRelocate);
2677
3089
  }
2678
- insertBefore(parentNodeRef, nodeToRelocate, insertBeforeNode);
2679
3090
  if (nodeToRelocate.nodeType === 1 /* ElementNode */ && nodeToRelocate.tagName !== "SLOT-FB") {
2680
- nodeToRelocate.hidden = (_c = nodeToRelocate["s-ih"]) != null ? _c : false;
3091
+ nodeToRelocate.hidden = (_d = nodeToRelocate["s-ih"]) != null ? _d : false;
2681
3092
  }
2682
3093
  }
2683
3094
  }
2684
3095
  nodeToRelocate && typeof slotRefNode["s-rf"] === "function" && slotRefNode["s-rf"](slotRefNode);
2685
- } else {
2686
- if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
2687
- if (isInitialLoad) {
2688
- nodeToRelocate["s-ih"] = (_d = nodeToRelocate.hidden) != null ? _d : false;
2689
- }
2690
- nodeToRelocate.hidden = true;
2691
- }
3096
+ } else if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
3097
+ nodeToRelocate.hidden = true;
2692
3098
  }
2693
3099
  }
2694
3100
  }
2695
3101
  if (checkSlotFallbackVisibility) {
2696
3102
  updateFallbackSlotVisibility(rootVnode.$elm$);
2697
3103
  }
2698
- plt.$flags$ &= ~1 /* isTmpDisconnected */;
3104
+ plt.$flags$ &= -2 /* isTmpDisconnected */;
2699
3105
  relocateNodes.length = 0;
2700
3106
  }
2701
- if (BUILD.experimentalScopedSlotChanges && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
3107
+ if (BUILD.slotRelocation && !useNativeShadowDom && !(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) && hostElm["s-cr"]) {
2702
3108
  const children = rootVnode.$elm$.__childNodes || rootVnode.$elm$.childNodes;
2703
3109
  for (const childNode of children) {
2704
3110
  if (childNode["s-hn"] !== hostTagName && !childNode["s-sh"]) {
2705
3111
  if (isInitialLoad && childNode["s-ih"] == null) {
2706
3112
  childNode["s-ih"] = (_e = childNode.hidden) != null ? _e : false;
2707
3113
  }
2708
- childNode.hidden = true;
3114
+ if (childNode.nodeType === 1 /* ElementNode */) {
3115
+ childNode.hidden = true;
3116
+ } else if (childNode.nodeType === 3 /* TextNode */ && !!childNode.nodeValue.trim()) {
3117
+ const textCommentNode = win.document.createComment("s-nt-" + childNode.nodeValue);
3118
+ textCommentNode["s-sn"] = childNode["s-sn"];
3119
+ insertBefore(childNode.parentNode, textCommentNode, childNode, isInitialLoad);
3120
+ childNode.parentNode.removeChild(childNode);
3121
+ }
2709
3122
  }
2710
3123
  }
2711
3124
  }
2712
3125
  contentRef = void 0;
3126
+ flushQueuedRefCallbacks();
2713
3127
  };
2714
3128
  var slotReferenceDebugNode = (slotVNode) => {
2715
3129
  var _a;
@@ -2738,7 +3152,7 @@ var attachToAncestor = (hostRef, ancestorComponent) => {
2738
3152
  }
2739
3153
  };
2740
3154
  var scheduleUpdate = (hostRef, isInitialLoad) => {
2741
- if (BUILD.taskQueue && BUILD.updatable) {
3155
+ if (BUILD.updatable) {
2742
3156
  hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
2743
3157
  }
2744
3158
  if (BUILD.asyncLoading && hostRef.$flags$ & 4 /* isWaitingForChildren */) {
@@ -2747,6 +3161,12 @@ var scheduleUpdate = (hostRef, isInitialLoad) => {
2747
3161
  }
2748
3162
  attachToAncestor(hostRef, hostRef.$ancestorComponent$);
2749
3163
  const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
3164
+ if (isInitialLoad) {
3165
+ queueMicrotask(() => {
3166
+ dispatch();
3167
+ });
3168
+ return;
3169
+ }
2750
3170
  return BUILD.taskQueue ? writeTask(dispatch) : dispatch();
2751
3171
  };
2752
3172
  var dispatchHooks = (hostRef, isInitialLoad) => {
@@ -2760,11 +3180,20 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
2760
3180
  }
2761
3181
  let maybePromise;
2762
3182
  if (isInitialLoad) {
2763
- if (BUILD.lazyLoad && BUILD.hostListener) {
2764
- hostRef.$flags$ |= 256 /* isListenReady */;
2765
- if (hostRef.$queuedListeners$) {
2766
- hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event, elm));
2767
- hostRef.$queuedListeners$ = void 0;
3183
+ if (BUILD.lazyLoad) {
3184
+ if (BUILD.slotRelocation && hostRef.$deferredConnectedCallback$) {
3185
+ hostRef.$deferredConnectedCallback$ = false;
3186
+ safeCall(instance, "connectedCallback", void 0, elm);
3187
+ }
3188
+ if (BUILD.hostListener) {
3189
+ hostRef.$flags$ |= 256 /* isListenReady */;
3190
+ if (hostRef.$queuedListeners$) {
3191
+ hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event, elm));
3192
+ hostRef.$queuedListeners$ = void 0;
3193
+ }
3194
+ }
3195
+ if (hostRef.$fetchedCbList$.length) {
3196
+ hostRef.$fetchedCbList$.forEach((cb) => cb(elm));
2768
3197
  }
2769
3198
  }
2770
3199
  emitLifecycleEvent(elm, "componentWillLoad");
@@ -2778,8 +3207,8 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
2778
3207
  endSchedule();
2779
3208
  return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
2780
3209
  };
2781
- var enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then(fn).catch((err2) => {
2782
- console.error(err2);
3210
+ var enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then(fn).catch((err) => {
3211
+ console.error(err);
2783
3212
  fn();
2784
3213
  }) : fn();
2785
3214
  var isPromisey = (maybePromise) => maybePromise instanceof Promise || maybePromise && maybePromise.then && typeof maybePromise.then === "function";
@@ -2793,7 +3222,7 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
2793
3222
  }
2794
3223
  const endRender = createTime("render", hostRef.$cmpMeta$.$tagName$);
2795
3224
  if (BUILD.isDev) {
2796
- hostRef.$flags$ |= 1024 /* devOnRender */;
3225
+ hostRef.$flags$ |= 2048 /* devOnRender */;
2797
3226
  }
2798
3227
  if (BUILD.hydrateServerSide) {
2799
3228
  await callRender(hostRef, instance, elm, isInitialLoad);
@@ -2802,7 +3231,7 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
2802
3231
  }
2803
3232
  if (BUILD.isDev) {
2804
3233
  hostRef.$renderCount$ = hostRef.$renderCount$ === void 0 ? 1 : hostRef.$renderCount$ + 1;
2805
- hostRef.$flags$ &= ~1024 /* devOnRender */;
3234
+ hostRef.$flags$ &= -2049 /* devOnRender */;
2806
3235
  }
2807
3236
  if (BUILD.hydrateServerSide) {
2808
3237
  try {
@@ -2830,7 +3259,7 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
2830
3259
  if (childrenPromises.length === 0) {
2831
3260
  postUpdate();
2832
3261
  } else {
2833
- Promise.all(childrenPromises).then(postUpdate);
3262
+ Promise.all(childrenPromises).then(postUpdate).catch(postUpdate);
2834
3263
  hostRef.$flags$ |= 4 /* isWaitingForChildren */;
2835
3264
  childrenPromises.length = 0;
2836
3265
  }
@@ -2842,13 +3271,12 @@ var renderingRef = null;
2842
3271
  var callRender = (hostRef, instance, elm, isInitialLoad) => {
2843
3272
  const allRenderFn = BUILD.allRenderFn ? true : false;
2844
3273
  const lazyLoad = BUILD.lazyLoad ? true : false;
2845
- const taskQueue = BUILD.taskQueue ? true : false;
2846
3274
  const updatable = BUILD.updatable ? true : false;
2847
3275
  try {
2848
3276
  renderingRef = instance;
2849
3277
  instance = allRenderFn ? instance.render() : instance.render && instance.render();
2850
- if (updatable && taskQueue) {
2851
- hostRef.$flags$ &= ~16 /* isQueuedForUpdate */;
3278
+ if (updatable) {
3279
+ hostRef.$flags$ &= -17 /* isQueuedForUpdate */;
2852
3280
  }
2853
3281
  if (updatable || lazyLoad) {
2854
3282
  hostRef.$flags$ |= 2 /* hasRendered */;
@@ -2883,11 +3311,11 @@ var postUpdateComponent = (hostRef) => {
2883
3311
  const instance = BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
2884
3312
  const ancestorComponent = hostRef.$ancestorComponent$;
2885
3313
  if (BUILD.isDev) {
2886
- hostRef.$flags$ |= 1024 /* devOnRender */;
3314
+ hostRef.$flags$ |= 2048 /* devOnRender */;
2887
3315
  }
2888
3316
  safeCall(instance, "componentDidRender", void 0, elm);
2889
3317
  if (BUILD.isDev) {
2890
- hostRef.$flags$ &= ~1024 /* devOnRender */;
3318
+ hostRef.$flags$ &= -2049 /* devOnRender */;
2891
3319
  }
2892
3320
  emitLifecycleEvent(elm, "componentDidRender");
2893
3321
  if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
@@ -2896,11 +3324,11 @@ var postUpdateComponent = (hostRef) => {
2896
3324
  addHydratedFlag(elm);
2897
3325
  }
2898
3326
  if (BUILD.isDev) {
2899
- hostRef.$flags$ |= 2048 /* devOnDidLoad */;
3327
+ hostRef.$flags$ |= 4096 /* devOnDidLoad */;
2900
3328
  }
2901
3329
  safeCall(instance, "componentDidLoad", void 0, elm);
2902
3330
  if (BUILD.isDev) {
2903
- hostRef.$flags$ &= ~2048 /* devOnDidLoad */;
3331
+ hostRef.$flags$ &= -4097 /* devOnDidLoad */;
2904
3332
  }
2905
3333
  emitLifecycleEvent(elm, "componentDidLoad");
2906
3334
  endPostUpdate();
@@ -2912,11 +3340,11 @@ var postUpdateComponent = (hostRef) => {
2912
3340
  }
2913
3341
  } else {
2914
3342
  if (BUILD.isDev) {
2915
- hostRef.$flags$ |= 1024 /* devOnRender */;
3343
+ hostRef.$flags$ |= 2048 /* devOnRender */;
2916
3344
  }
2917
3345
  safeCall(instance, "componentDidUpdate", void 0, elm);
2918
3346
  if (BUILD.isDev) {
2919
- hostRef.$flags$ &= ~1024 /* devOnRender */;
3347
+ hostRef.$flags$ &= -2049 /* devOnRender */;
2920
3348
  }
2921
3349
  emitLifecycleEvent(elm, "componentDidUpdate");
2922
3350
  endPostUpdate();
@@ -2932,13 +3360,14 @@ var postUpdateComponent = (hostRef) => {
2932
3360
  if (hostRef.$flags$ & 512 /* needsRerender */) {
2933
3361
  nextTick(() => scheduleUpdate(hostRef, false));
2934
3362
  }
2935
- hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */);
3363
+ hostRef.$flags$ &= -517;
2936
3364
  }
2937
3365
  };
2938
3366
  var forceUpdate = (ref) => {
3367
+ var _a;
2939
3368
  if (BUILD.updatable && (Build.isBrowser || Build.isTesting)) {
2940
3369
  const hostRef = getHostRef(ref);
2941
- const isConnected = hostRef.$hostElement$.isConnected;
3370
+ const isConnected = (_a = hostRef == null ? void 0 : hostRef.$hostElement$) == null ? void 0 : _a.isConnected;
2942
3371
  if (isConnected && (hostRef.$flags$ & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
2943
3372
  scheduleUpdate(hostRef, false);
2944
3373
  }
@@ -2947,10 +3376,16 @@ var forceUpdate = (ref) => {
2947
3376
  return false;
2948
3377
  };
2949
3378
  var appDidLoad = (who) => {
3379
+ var _a;
2950
3380
  if (BUILD.asyncQueue) {
2951
3381
  plt.$flags$ |= 2 /* appLoaded */;
2952
3382
  }
2953
3383
  nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
3384
+ if (BUILD.hydrateClientSide) {
3385
+ if ((_a = plt.$orgLocNodes$) == null ? void 0 : _a.size) {
3386
+ plt.$orgLocNodes$.clear();
3387
+ }
3388
+ }
2954
3389
  if (BUILD.profile && performance.measure) {
2955
3390
  performance.measure(`[Stencil] ${NAMESPACE} initial load (by ${who})`, "st:app:start");
2956
3391
  }
@@ -2997,22 +3432,51 @@ var serverSideConnected = (elm) => {
2997
3432
  var getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
2998
3433
  var setValue = (ref, propName, newVal, cmpMeta) => {
2999
3434
  const hostRef = getHostRef(ref);
3435
+ if (!hostRef) {
3436
+ return;
3437
+ }
3000
3438
  if (BUILD.lazyLoad && !hostRef) {
3001
3439
  throw new Error(
3002
3440
  `Couldn't find host element for "${cmpMeta.$tagName$}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/stenciljs/core/issues/5457).`
3003
3441
  );
3004
3442
  }
3443
+ if (BUILD.serializer && hostRef.$serializerValues$.has(propName) && hostRef.$serializerValues$.get(propName) === newVal) {
3444
+ return;
3445
+ }
3005
3446
  const elm = BUILD.lazyLoad ? hostRef.$hostElement$ : ref;
3006
3447
  const oldVal = hostRef.$instanceValues$.get(propName);
3007
3448
  const flags = hostRef.$flags$;
3008
3449
  const instance = BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
3009
- newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
3450
+ newVal = parsePropertyValue(
3451
+ newVal,
3452
+ cmpMeta.$members$[propName][0],
3453
+ BUILD.formAssociated && !!(cmpMeta.$flags$ & 64 /* formAssociated */)
3454
+ );
3010
3455
  const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
3011
3456
  const didValueChange = newVal !== oldVal && !areBothNaN;
3012
3457
  if ((!BUILD.lazyLoad || !(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {
3013
3458
  hostRef.$instanceValues$.set(propName, newVal);
3459
+ if (BUILD.serializer && BUILD.reflect && cmpMeta.$attrsToReflect$) {
3460
+ if (cmpMeta.$serializers$ && cmpMeta.$serializers$[propName]) {
3461
+ const runSerializer = (inst) => {
3462
+ let attrVal = newVal;
3463
+ for (const serializer of cmpMeta.$serializers$[propName]) {
3464
+ const [[methodName]] = Object.entries(serializer);
3465
+ attrVal = inst[methodName](attrVal, propName);
3466
+ }
3467
+ hostRef.$serializerValues$.set(propName, attrVal);
3468
+ };
3469
+ if (instance) {
3470
+ runSerializer(instance);
3471
+ } else {
3472
+ hostRef.$fetchedCbList$.push(() => {
3473
+ runSerializer(hostRef.$lazyInstance$);
3474
+ });
3475
+ }
3476
+ }
3477
+ }
3014
3478
  if (BUILD.isDev) {
3015
- if (hostRef.$flags$ & 1024 /* devOnRender */) {
3479
+ if (hostRef.$flags$ & 2048 /* devOnRender */) {
3016
3480
  consoleDevWarn(
3017
3481
  `The state/prop "${propName}" changed during rendering. This can potentially lead to infinite-loops and other bugs.`,
3018
3482
  "\nElement",
@@ -3022,7 +3486,7 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
3022
3486
  "\nOld value",
3023
3487
  oldVal
3024
3488
  );
3025
- } else if (hostRef.$flags$ & 2048 /* devOnDidLoad */) {
3489
+ } else if (hostRef.$flags$ & 4096 /* devOnDidLoad */) {
3026
3490
  consoleDevWarn(
3027
3491
  `The state/prop "${propName}" changed during "componentDidLoad()", this triggers extra re-renders, try to setup on "componentWillLoad()"`,
3028
3492
  "\nElement",
@@ -3034,25 +3498,35 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
3034
3498
  );
3035
3499
  }
3036
3500
  }
3037
- if (!BUILD.lazyLoad || instance) {
3038
- if (BUILD.watchCallback && cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
3039
- const watchMethods = cmpMeta.$watchers$[propName];
3040
- if (watchMethods) {
3041
- watchMethods.map((watchMethodName) => {
3042
- try {
3043
- instance[watchMethodName](newVal, oldVal, propName);
3044
- } catch (e) {
3045
- consoleError(e, elm);
3501
+ if (BUILD.propChangeCallback && cmpMeta.$watchers$) {
3502
+ const watchMethods = cmpMeta.$watchers$[propName];
3503
+ if (watchMethods) {
3504
+ watchMethods.map((watcher) => {
3505
+ try {
3506
+ const [[watchMethodName, watcherFlags]] = Object.entries(watcher);
3507
+ if (flags & 128 /* isWatchReady */ || watcherFlags & 1 /* Immediate */) {
3508
+ if (!instance) {
3509
+ hostRef.$fetchedCbList$.push(() => {
3510
+ hostRef.$lazyInstance$[watchMethodName](newVal, oldVal, propName);
3511
+ });
3512
+ } else {
3513
+ instance[watchMethodName](newVal, oldVal, propName);
3514
+ }
3046
3515
  }
3047
- });
3048
- }
3049
- }
3050
- if (BUILD.updatable && (flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
3051
- if (instance.componentShouldUpdate) {
3052
- if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
3053
- return;
3516
+ } catch (e) {
3517
+ consoleError(e, elm);
3054
3518
  }
3519
+ });
3520
+ }
3521
+ }
3522
+ if (BUILD.updatable && flags & 2 /* hasRendered */) {
3523
+ if (instance.componentShouldUpdate) {
3524
+ const shouldUpdate = instance.componentShouldUpdate(newVal, oldVal, propName);
3525
+ if (shouldUpdate === false && !(flags & 16 /* isQueuedForUpdate */)) {
3526
+ return;
3055
3527
  }
3528
+ }
3529
+ if (!(flags & 16 /* isQueuedForUpdate */)) {
3056
3530
  scheduleUpdate(hostRef, false);
3057
3531
  }
3058
3532
  }
@@ -3060,6 +3534,7 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
3060
3534
  };
3061
3535
 
3062
3536
  // src/runtime/proxy-component.ts
3537
+ var reflectedAttrValue = (propValue) => propValue == null || propValue === false ? null : propValue === true ? "" : String(propValue);
3063
3538
  var proxyComponent = (Cstr, cmpMeta, flags) => {
3064
3539
  var _a, _b;
3065
3540
  const prototype = Cstr.prototype;
@@ -3074,10 +3549,11 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
3074
3549
  const originalFormAssociatedCallback = prototype[cbName];
3075
3550
  Object.defineProperty(prototype, cbName, {
3076
3551
  value(...args) {
3552
+ var _a2;
3077
3553
  const hostRef = getHostRef(this);
3078
- const instance = BUILD.lazyLoad ? hostRef.$lazyInstance$ : this;
3554
+ const instance = BUILD.lazyLoad ? hostRef == null ? void 0 : hostRef.$lazyInstance$ : this;
3079
3555
  if (!instance) {
3080
- hostRef.$onReadyPromise$.then((asyncInstance) => {
3556
+ (_a2 = hostRef == null ? void 0 : hostRef.$onReadyPromise$) == null ? void 0 : _a2.then((asyncInstance) => {
3081
3557
  const cb = asyncInstance[cbName];
3082
3558
  typeof cb === "function" && cb.call(asyncInstance, ...args);
3083
3559
  });
@@ -3089,14 +3565,22 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
3089
3565
  });
3090
3566
  });
3091
3567
  }
3092
- if (BUILD.member && cmpMeta.$members$ || BUILD.watchCallback && (cmpMeta.$watchers$ || Cstr.watchers)) {
3093
- if (BUILD.watchCallback && Cstr.watchers && !cmpMeta.$watchers$) {
3094
- cmpMeta.$watchers$ = Cstr.watchers;
3568
+ if (BUILD.member && cmpMeta.$members$ || BUILD.propChangeCallback) {
3569
+ if (BUILD.propChangeCallback) {
3570
+ if (Cstr.watchers && !cmpMeta.$watchers$) {
3571
+ cmpMeta.$watchers$ = normalizeWatchers(Cstr.watchers);
3572
+ }
3573
+ if (Cstr.deserializers && !cmpMeta.$deserializers$) {
3574
+ cmpMeta.$deserializers$ = Cstr.deserializers;
3575
+ }
3576
+ if (Cstr.serializers && !cmpMeta.$serializers$) {
3577
+ cmpMeta.$serializers$ = Cstr.serializers;
3578
+ }
3095
3579
  }
3096
3580
  const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
3097
3581
  members.map(([memberName, [memberFlags]]) => {
3098
3582
  if ((BUILD.prop || BUILD.state) && (memberFlags & 31 /* Prop */ || (!BUILD.lazyLoad || flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
3099
- const { get: origGetter, set: origSetter } = Object.getOwnPropertyDescriptor(prototype, memberName) || {};
3583
+ const { get: origGetter, set: origSetter } = getPropertyDescriptor(prototype, memberName) || {};
3100
3584
  if (origGetter) cmpMeta.$members$[memberName][0] |= 2048 /* Getter */;
3101
3585
  if (origSetter) cmpMeta.$members$[memberName][0] |= 4096 /* Setter */;
3102
3586
  if (flags & 1 /* isElementConstructor */ || !origGetter) {
@@ -3122,6 +3606,9 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
3122
3606
  Object.defineProperty(prototype, memberName, {
3123
3607
  set(newValue) {
3124
3608
  const ref = getHostRef(this);
3609
+ if (!ref) {
3610
+ return;
3611
+ }
3125
3612
  if (BUILD.isDev) {
3126
3613
  if (
3127
3614
  // we are proxying the instance (not element)
@@ -3141,10 +3628,14 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
3141
3628
  const currentValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
3142
3629
  if (typeof currentValue === "undefined" && ref.$instanceValues$.get(memberName)) {
3143
3630
  newValue = ref.$instanceValues$.get(memberName);
3144
- } else if (!ref.$instanceValues$.get(memberName) && currentValue) {
3145
- ref.$instanceValues$.set(memberName, currentValue);
3146
3631
  }
3147
- origSetter.apply(this, [parsePropertyValue(newValue, memberFlags)]);
3632
+ origSetter.apply(this, [
3633
+ parsePropertyValue(
3634
+ newValue,
3635
+ memberFlags,
3636
+ BUILD.formAssociated && !!(cmpMeta.$flags$ & 64 /* formAssociated */)
3637
+ )
3638
+ ]);
3148
3639
  newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
3149
3640
  setValue(this, memberName, newValue, cmpMeta);
3150
3641
  return;
@@ -3157,7 +3648,7 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
3157
3648
  if ((flags & 1 /* isElementConstructor */) === 0 || (cmpMeta.$members$[memberName][0] & 4096 /* Setter */) === 0) {
3158
3649
  setValue(this, memberName, newValue, cmpMeta);
3159
3650
  if (flags & 1 /* isElementConstructor */ && !ref.$lazyInstance$) {
3160
- ref.$onReadyPromise$.then(() => {
3651
+ ref.$fetchedCbList$.push(() => {
3161
3652
  if (cmpMeta.$members$[memberName][0] & 4096 /* Setter */ && ref.$lazyInstance$[memberName] !== ref.$instanceValues$.get(memberName)) {
3162
3653
  ref.$lazyInstance$[memberName] = newValue;
3163
3654
  }
@@ -3170,13 +3661,19 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
3170
3661
  if (!ref.$instanceValues$.get(memberName) && currentValue) {
3171
3662
  ref.$instanceValues$.set(memberName, currentValue);
3172
3663
  }
3173
- ref.$lazyInstance$[memberName] = parsePropertyValue(newValue, memberFlags);
3664
+ ref.$lazyInstance$[memberName] = parsePropertyValue(
3665
+ newValue,
3666
+ memberFlags,
3667
+ BUILD.formAssociated && !!(cmpMeta.$flags$ & 64 /* formAssociated */)
3668
+ );
3174
3669
  setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
3175
3670
  };
3176
3671
  if (ref.$lazyInstance$) {
3177
3672
  setterSetVal();
3178
3673
  } else {
3179
- ref.$onReadyPromise$.then(() => setterSetVal());
3674
+ ref.$fetchedCbList$.push(() => {
3675
+ setterSetVal();
3676
+ });
3180
3677
  }
3181
3678
  }
3182
3679
  }
@@ -3200,30 +3697,68 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
3200
3697
  plt.jmp(() => {
3201
3698
  var _a2;
3202
3699
  const propName = attrNameToPropName.get(attrName);
3700
+ const hostRef = getHostRef(this);
3701
+ if (BUILD.serializer && hostRef.$serializerValues$.has(propName) && hostRef.$serializerValues$.get(propName) === newValue) {
3702
+ return;
3703
+ }
3203
3704
  if (this.hasOwnProperty(propName) && BUILD.lazyLoad) {
3204
3705
  newValue = this[propName];
3205
3706
  delete this[propName];
3707
+ }
3708
+ if (BUILD.deserializer && cmpMeta.$deserializers$ && cmpMeta.$deserializers$[propName]) {
3709
+ const setVal = (methodName, instance) => {
3710
+ const deserializeVal = instance == null ? void 0 : instance[methodName](newValue, propName);
3711
+ if (deserializeVal !== this[propName]) {
3712
+ this[propName] = deserializeVal;
3713
+ }
3714
+ };
3715
+ for (const deserializer of cmpMeta.$deserializers$[propName]) {
3716
+ const [[methodName]] = Object.entries(deserializer);
3717
+ if (BUILD.lazyLoad) {
3718
+ if (hostRef.$lazyInstance$) {
3719
+ setVal(methodName, hostRef.$lazyInstance$);
3720
+ } else {
3721
+ hostRef.$fetchedCbList$.push(() => {
3722
+ setVal(methodName, hostRef.$lazyInstance$);
3723
+ });
3724
+ }
3725
+ } else {
3726
+ setVal(methodName, this);
3727
+ }
3728
+ }
3729
+ return;
3206
3730
  } else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
3207
3731
  this[propName] == newValue) {
3208
3732
  return;
3209
3733
  } else if (propName == null) {
3210
- const hostRef = getHostRef(this);
3211
3734
  const flags2 = hostRef == null ? void 0 : hostRef.$flags$;
3212
- if (flags2 && !(flags2 & 8 /* isConstructingInstance */) && flags2 & 128 /* isWatchReady */ && newValue !== oldValue) {
3735
+ if (hostRef && flags2 && !(flags2 & 8 /* isConstructingInstance */) && newValue !== oldValue) {
3213
3736
  const elm = BUILD.lazyLoad ? hostRef.$hostElement$ : this;
3214
3737
  const instance = BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
3215
3738
  const entry = (_a2 = cmpMeta.$watchers$) == null ? void 0 : _a2[attrName];
3216
- entry == null ? void 0 : entry.forEach((callbackName) => {
3217
- if (instance[callbackName] != null) {
3218
- instance[callbackName].call(instance, newValue, oldValue, attrName);
3739
+ entry == null ? void 0 : entry.forEach((watcher) => {
3740
+ const [[watchMethodName, watcherFlags]] = Object.entries(watcher);
3741
+ if (instance[watchMethodName] != null && (flags2 & 128 /* isWatchReady */ || watcherFlags & 1 /* Immediate */)) {
3742
+ instance[watchMethodName].call(instance, newValue, oldValue, attrName);
3219
3743
  }
3220
3744
  });
3221
3745
  }
3222
3746
  return;
3223
3747
  }
3748
+ const propFlags = members.find(([m]) => m === propName);
3749
+ const propMemberFlags = propFlags ? propFlags[1][0] : 0;
3750
+ const isBooleanTarget = propMemberFlags & 4 /* Boolean */;
3751
+ if (BUILD.reflect && propMemberFlags & 512 /* ReflectAttr */ && propMemberFlags & 8 /* Any */ && // a complex value is never written to an attribute, so a change while the prop holds
3752
+ // one is always external
3753
+ !isComplexType(this[propName]) && reflectedAttrValue(this[propName]) === newValue) {
3754
+ return;
3755
+ }
3756
+ const isSpuriousBooleanRemoval = isBooleanTarget && newValue === null && this[propName] === void 0;
3757
+ if (isBooleanTarget) {
3758
+ newValue = newValue === null || newValue === "false" ? false : true;
3759
+ }
3224
3760
  const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
3225
- newValue = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
3226
- if (newValue !== this[propName] && (!propDesc.get || !!propDesc.set)) {
3761
+ if (!isSpuriousBooleanRemoval && newValue != this[propName] && (!propDesc.get || !!propDesc.set)) {
3227
3762
  this[propName] = newValue;
3228
3763
  }
3229
3764
  });
@@ -3231,7 +3766,7 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
3231
3766
  Cstr.observedAttributes = Array.from(
3232
3767
  /* @__PURE__ */ new Set([
3233
3768
  ...Object.keys((_b = cmpMeta.$watchers$) != null ? _b : {}),
3234
- ...members.filter(([_, m]) => m[0] & 15 /* HasAttribute */).map(([propName, m]) => {
3769
+ ...members.filter(([_, m]) => m[0] & 31 /* HasAttribute */).map(([propName, m]) => {
3235
3770
  var _a2;
3236
3771
  const attrName = m[1] || propName;
3237
3772
  attrNameToPropName.set(attrName, propName);
@@ -3249,84 +3784,111 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
3249
3784
 
3250
3785
  // src/runtime/initialize-component.ts
3251
3786
  var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
3787
+ var _a;
3252
3788
  let Cstr;
3253
- if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
3254
- hostRef.$flags$ |= 32 /* hasInitializedComponent */;
3255
- const bundleId = cmpMeta.$lazyBundleId$;
3256
- if (BUILD.lazyLoad && bundleId) {
3257
- const CstrImport = loadModule(cmpMeta, hostRef, hmrVersionId);
3258
- if (CstrImport && "then" in CstrImport) {
3259
- const endLoad = uniqueTime(
3260
- `st:load:${cmpMeta.$tagName$}:${hostRef.$modeName$}`,
3261
- `[Stencil] Load module for <${cmpMeta.$tagName$}>`
3262
- );
3263
- Cstr = await CstrImport;
3264
- endLoad();
3265
- } else {
3266
- Cstr = CstrImport;
3267
- }
3268
- if (!Cstr) {
3269
- throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
3270
- }
3271
- if (BUILD.member && !Cstr.isProxied) {
3272
- if (BUILD.watchCallback) {
3273
- cmpMeta.$watchers$ = Cstr.watchers;
3789
+ try {
3790
+ if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
3791
+ hostRef.$flags$ |= 32 /* hasInitializedComponent */;
3792
+ hostRef.$flags$ &= -1025 /* hasFailedLoad */;
3793
+ const bundleId = cmpMeta.$lazyBundleId$;
3794
+ if (BUILD.lazyLoad && bundleId) {
3795
+ const CstrImport = loadModule(cmpMeta, hostRef, hmrVersionId);
3796
+ if (CstrImport && "then" in CstrImport) {
3797
+ const endLoad = uniqueTime(
3798
+ `st:load:${cmpMeta.$tagName$}:${hostRef.$modeName$}`,
3799
+ `[Stencil] Load module for <${cmpMeta.$tagName$}>`
3800
+ );
3801
+ Cstr = await CstrImport;
3802
+ endLoad();
3803
+ } else {
3804
+ Cstr = CstrImport;
3274
3805
  }
3275
- proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
3276
- Cstr.isProxied = true;
3277
- }
3278
- const endNewInstance = createTime("createInstance", cmpMeta.$tagName$);
3279
- if (BUILD.member) {
3280
- hostRef.$flags$ |= 8 /* isConstructingInstance */;
3281
- }
3282
- try {
3283
- new Cstr(hostRef);
3284
- } catch (e) {
3285
- consoleError(e, elm);
3286
- }
3287
- if (BUILD.member) {
3288
- hostRef.$flags$ &= ~8 /* isConstructingInstance */;
3289
- }
3290
- if (BUILD.watchCallback) {
3291
- hostRef.$flags$ |= 128 /* isWatchReady */;
3292
- }
3293
- endNewInstance();
3294
- fireConnectedCallback(hostRef.$lazyInstance$, elm);
3295
- } else {
3296
- Cstr = elm.constructor;
3297
- const cmpTag = elm.localName;
3298
- customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
3299
- }
3300
- if (BUILD.style && Cstr && Cstr.style) {
3301
- let style;
3302
- if (typeof Cstr.style === "string") {
3303
- style = Cstr.style;
3304
- } else if (BUILD.mode && typeof Cstr.style !== "string") {
3305
- hostRef.$modeName$ = computeMode(elm);
3306
- if (hostRef.$modeName$) {
3307
- style = Cstr.style[hostRef.$modeName$];
3806
+ if (!Cstr) {
3807
+ hostRef.$flags$ &= -33 /* hasInitializedComponent */;
3808
+ hostRef.$loadRetryCount$ = ((_a = hostRef.$loadRetryCount$) != null ? _a : 0) + 1;
3809
+ if (hostRef.$loadRetryCount$ < MAX_LAZY_LOAD_RETRIES) {
3810
+ hostRef.$flags$ |= 1024 /* hasFailedLoad */;
3811
+ }
3812
+ throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
3308
3813
  }
3309
- if (BUILD.hydrateServerSide && hostRef.$modeName$) {
3310
- elm.setAttribute("s-mode", hostRef.$modeName$);
3814
+ if (BUILD.member && !Cstr.isProxied) {
3815
+ if (BUILD.propChangeCallback) {
3816
+ cmpMeta.$watchers$ = normalizeWatchers(Cstr.watchers);
3817
+ cmpMeta.$serializers$ = Cstr.serializers;
3818
+ cmpMeta.$deserializers$ = Cstr.deserializers;
3819
+ }
3820
+ proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
3821
+ Cstr.isProxied = true;
3822
+ }
3823
+ const endNewInstance = createTime("createInstance", cmpMeta.$tagName$);
3824
+ if (BUILD.member) {
3825
+ hostRef.$flags$ |= 8 /* isConstructingInstance */;
3826
+ }
3827
+ try {
3828
+ new Cstr(hostRef);
3829
+ } catch (e) {
3830
+ consoleError(e, elm);
3831
+ }
3832
+ if (BUILD.member) {
3833
+ hostRef.$flags$ &= -9 /* isConstructingInstance */;
3834
+ }
3835
+ if (BUILD.propChangeCallback) {
3836
+ hostRef.$flags$ |= 128 /* isWatchReady */;
3311
3837
  }
3838
+ endNewInstance();
3839
+ const needsDeferredCallback = BUILD.slotRelocation && cmpMeta.$flags$ & 4 /* hasSlotRelocation */;
3840
+ if (!needsDeferredCallback) {
3841
+ fireConnectedCallback(hostRef.$lazyInstance$, elm);
3842
+ } else {
3843
+ hostRef.$deferredConnectedCallback$ = true;
3844
+ }
3845
+ } else {
3846
+ Cstr = elm.constructor;
3847
+ const cmpTag = elm.localName;
3848
+ customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
3312
3849
  }
3313
- const scopeId2 = getScopeId(cmpMeta, hostRef.$modeName$);
3314
- if (!styles.has(scopeId2)) {
3315
- const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$);
3316
- if (BUILD.hydrateServerSide && BUILD.shadowDom && cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */) {
3317
- style = scopeCss(style, scopeId2, true);
3850
+ if (BUILD.style && Cstr && Cstr.style) {
3851
+ let style;
3852
+ if (typeof Cstr.style === "string") {
3853
+ style = Cstr.style;
3854
+ } else if (BUILD.mode && typeof Cstr.style !== "string") {
3855
+ hostRef.$modeName$ = computeMode(elm);
3856
+ if (hostRef.$modeName$) {
3857
+ style = Cstr.style[hostRef.$modeName$];
3858
+ }
3859
+ if (BUILD.hydrateServerSide && hostRef.$modeName$) {
3860
+ elm.setAttribute("s-mode", hostRef.$modeName$);
3861
+ }
3862
+ }
3863
+ const scopeId2 = getScopeId(cmpMeta, hostRef.$modeName$);
3864
+ if (!styles.has(scopeId2) || BUILD.hotModuleReplacement && hmrVersionId) {
3865
+ const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$);
3866
+ if (BUILD.hydrateServerSide && BUILD.shadowDom) {
3867
+ if (cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */) {
3868
+ style = scopeCss(style, scopeId2);
3869
+ }
3870
+ }
3871
+ registerStyle(scopeId2, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
3872
+ endRegisterStyles();
3318
3873
  }
3319
- registerStyle(scopeId2, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
3320
- endRegisterStyles();
3321
3874
  }
3322
3875
  }
3323
- }
3324
- const ancestorComponent = hostRef.$ancestorComponent$;
3325
- const schedule = () => scheduleUpdate(hostRef, true);
3326
- if (BUILD.asyncLoading && ancestorComponent && ancestorComponent["s-rc"]) {
3327
- ancestorComponent["s-rc"].push(schedule);
3328
- } else {
3329
- schedule();
3876
+ const ancestorComponent = hostRef.$ancestorComponent$;
3877
+ const schedule = () => scheduleUpdate(hostRef, true);
3878
+ if (BUILD.asyncLoading && ancestorComponent && ancestorComponent["s-rc"]) {
3879
+ ancestorComponent["s-rc"].push(schedule);
3880
+ } else {
3881
+ schedule();
3882
+ }
3883
+ } catch (e) {
3884
+ consoleError(e, elm);
3885
+ if (BUILD.asyncLoading && hostRef.$onRenderResolve$) {
3886
+ hostRef.$onRenderResolve$();
3887
+ hostRef.$onRenderResolve$ = void 0;
3888
+ }
3889
+ if (BUILD.asyncLoading && hostRef.$onReadyResolve$ && !(hostRef.$flags$ & 1024 /* hasFailedLoad */)) {
3890
+ hostRef.$onReadyResolve$(elm);
3891
+ }
3330
3892
  }
3331
3893
  };
3332
3894
  var fireConnectedCallback = (instance, elm) => {
@@ -3339,6 +3901,9 @@ var fireConnectedCallback = (instance, elm) => {
3339
3901
  var connectedCallback = (elm) => {
3340
3902
  if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
3341
3903
  const hostRef = getHostRef(elm);
3904
+ if (!hostRef) {
3905
+ return;
3906
+ }
3342
3907
  const cmpMeta = hostRef.$cmpMeta$;
3343
3908
  const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
3344
3909
  if (BUILD.hostListenerTargetParent) {
@@ -3377,7 +3942,7 @@ var connectedCallback = (elm) => {
3377
3942
  }
3378
3943
  if (BUILD.prop && !BUILD.hydrateServerSide && cmpMeta.$members$) {
3379
3944
  Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
3380
- if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
3945
+ if (memberFlags & 31 /* Prop */ && Object.prototype.hasOwnProperty.call(elm, memberName)) {
3381
3946
  const value = elm[memberName];
3382
3947
  delete elm[memberName];
3383
3948
  elm[memberName] = value;
@@ -3393,6 +3958,8 @@ var connectedCallback = (elm) => {
3393
3958
  addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, false);
3394
3959
  if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
3395
3960
  fireConnectedCallback(hostRef.$lazyInstance$, elm);
3961
+ } else if (hostRef.$flags$ & 1024 /* hasFailedLoad */) {
3962
+ setTimeout(() => initializeComponent(elm, hostRef, cmpMeta), LAZY_LOAD_RETRY_INTERVAL_MS);
3396
3963
  } else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
3397
3964
  hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$, elm));
3398
3965
  }
@@ -3419,7 +3986,7 @@ var disconnectedCallback = async (elm) => {
3419
3986
  if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
3420
3987
  const hostRef = getHostRef(elm);
3421
3988
  if (BUILD.hostListener) {
3422
- if (hostRef.$rmListeners$) {
3989
+ if (hostRef == null ? void 0 : hostRef.$rmListeners$) {
3423
3990
  hostRef.$rmListeners$.map((rmListener) => rmListener());
3424
3991
  hostRef.$rmListeners$ = void 0;
3425
3992
  }
@@ -3442,104 +4009,118 @@ var disconnectedCallback = async (elm) => {
3442
4009
 
3443
4010
  // src/runtime/bootstrap-custom-element.ts
3444
4011
  var defineCustomElement = (Cstr, compactMeta) => {
3445
- customElements.define(compactMeta[1], proxyCustomElement(Cstr, compactMeta));
4012
+ customElements.define(
4013
+ transformTag(compactMeta[1]),
4014
+ proxyCustomElement(Cstr, compactMeta)
4015
+ );
3446
4016
  };
3447
4017
  var proxyCustomElement = (Cstr, compactMeta) => {
4018
+ if (BUILD.profile && performance.mark && performance.getEntriesByName("st:app:start", "mark").length === 0) {
4019
+ performance.mark("st:app:start");
4020
+ }
3448
4021
  const cmpMeta = {
3449
4022
  $flags$: compactMeta[0],
3450
4023
  $tagName$: compactMeta[1]
3451
4024
  };
3452
- if (BUILD.member) {
3453
- cmpMeta.$members$ = compactMeta[2];
3454
- }
3455
- if (BUILD.hostListener) {
3456
- cmpMeta.$listeners$ = compactMeta[3];
3457
- }
3458
- if (BUILD.watchCallback) {
3459
- cmpMeta.$watchers$ = Cstr.$watchers$;
3460
- }
3461
- if (BUILD.reflect) {
3462
- cmpMeta.$attrsToReflect$ = [];
3463
- }
3464
- if (BUILD.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
3465
- cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
3466
- }
3467
- if (BUILD.experimentalSlotFixes) {
3468
- if (BUILD.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
3469
- patchPseudoShadowDom(Cstr.prototype);
4025
+ try {
4026
+ if (BUILD.member) {
4027
+ cmpMeta.$members$ = compactMeta[2];
3470
4028
  }
3471
- } else {
3472
- if (BUILD.slotChildNodesFix) {
3473
- patchChildSlotNodes(Cstr.prototype);
4029
+ if (BUILD.hostListener) {
4030
+ cmpMeta.$listeners$ = compactMeta[3];
3474
4031
  }
3475
- if (BUILD.cloneNodeFix) {
3476
- patchCloneNode(Cstr.prototype);
4032
+ if (BUILD.propChangeCallback) {
4033
+ cmpMeta.$watchers$ = normalizeWatchers(Cstr.$watchers$);
4034
+ cmpMeta.$deserializers$ = Cstr.$deserializers$;
4035
+ cmpMeta.$serializers$ = Cstr.$serializers$;
3477
4036
  }
3478
- if (BUILD.appendChildSlotFix) {
3479
- patchSlotAppendChild(Cstr.prototype);
4037
+ if (BUILD.reflect) {
4038
+ cmpMeta.$attrsToReflect$ = [];
3480
4039
  }
3481
- if (BUILD.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
3482
- patchTextContent(Cstr.prototype);
4040
+ if (BUILD.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
4041
+ cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
3483
4042
  }
3484
- }
3485
- if (BUILD.hydrateClientSide && BUILD.shadowDom) {
3486
- hydrateScopedToShadow();
3487
- }
3488
- const originalConnectedCallback = Cstr.prototype.connectedCallback;
3489
- const originalDisconnectedCallback = Cstr.prototype.disconnectedCallback;
3490
- Object.assign(Cstr.prototype, {
3491
- __hasHostListenerAttached: false,
3492
- __registerHost() {
3493
- registerHost(this, cmpMeta);
3494
- },
3495
- connectedCallback() {
3496
- if (!this.__hasHostListenerAttached) {
3497
- const hostRef = getHostRef(this);
3498
- addHostEventListeners(this, hostRef, cmpMeta.$listeners$, false);
3499
- this.__hasHostListenerAttached = true;
3500
- }
3501
- connectedCallback(this);
3502
- if (originalConnectedCallback) {
3503
- originalConnectedCallback.call(this);
3504
- }
3505
- },
3506
- disconnectedCallback() {
3507
- disconnectedCallback(this);
3508
- if (originalDisconnectedCallback) {
3509
- originalDisconnectedCallback.call(this);
4043
+ if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) && cmpMeta.$flags$ & 256 /* hasSlot */) {
4044
+ if (BUILD.experimentalSlotFixes) {
4045
+ patchPseudoShadowDom(Cstr.prototype);
4046
+ } else {
4047
+ if (BUILD.slotChildNodesFix) {
4048
+ patchChildSlotNodes(Cstr.prototype);
4049
+ }
4050
+ if (BUILD.cloneNodeFix) {
4051
+ patchCloneNode(Cstr.prototype);
4052
+ }
4053
+ if (BUILD.appendChildSlotFix) {
4054
+ patchSlotAppendChild(Cstr.prototype);
4055
+ }
4056
+ if (BUILD.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
4057
+ patchTextContent(Cstr.prototype);
4058
+ }
3510
4059
  }
3511
- },
3512
- __attachShadow() {
3513
- if (supportsShadow) {
3514
- if (!this.shadowRoot) {
3515
- if (BUILD.shadowDelegatesFocus) {
3516
- this.attachShadow({
3517
- mode: "open",
3518
- delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */)
3519
- });
4060
+ } else if (BUILD.cloneNodeFix) {
4061
+ patchCloneNode(Cstr.prototype);
4062
+ }
4063
+ if (BUILD.hydrateClientSide && BUILD.shadowDom) {
4064
+ hydrateScopedToShadow();
4065
+ }
4066
+ const originalConnectedCallback = Cstr.prototype.connectedCallback;
4067
+ const originalDisconnectedCallback = Cstr.prototype.disconnectedCallback;
4068
+ Object.assign(Cstr.prototype, {
4069
+ __hasHostListenerAttached: false,
4070
+ __registerHost() {
4071
+ registerHost(this, cmpMeta);
4072
+ },
4073
+ connectedCallback() {
4074
+ if (!this.__hasHostListenerAttached) {
4075
+ const hostRef = getHostRef(this);
4076
+ if (!hostRef) {
4077
+ return;
4078
+ }
4079
+ addHostEventListeners(this, hostRef, cmpMeta.$listeners$, false);
4080
+ this.__hasHostListenerAttached = true;
4081
+ }
4082
+ connectedCallback(this);
4083
+ if (originalConnectedCallback) {
4084
+ originalConnectedCallback.call(this);
4085
+ }
4086
+ },
4087
+ disconnectedCallback() {
4088
+ disconnectedCallback(this);
4089
+ if (originalDisconnectedCallback) {
4090
+ originalDisconnectedCallback.call(this);
4091
+ }
4092
+ },
4093
+ __attachShadow() {
4094
+ if (supportsShadow) {
4095
+ if (!this.shadowRoot) {
4096
+ createShadowRoot.call(this, cmpMeta);
3520
4097
  } else {
3521
- this.attachShadow({ mode: "open" });
4098
+ if (this.shadowRoot.mode !== "open") {
4099
+ throw new Error(
4100
+ `Unable to re-use existing shadow root for ${cmpMeta.$tagName$}! Mode is set to ${this.shadowRoot.mode} but Stencil only supports open shadow roots.`
4101
+ );
4102
+ }
3522
4103
  }
3523
4104
  } else {
3524
- if (this.shadowRoot.mode !== "open") {
3525
- throw new Error(
3526
- `Unable to re-use existing shadow root for ${cmpMeta.$tagName$}! Mode is set to ${this.shadowRoot.mode} but Stencil only supports open shadow roots.`
3527
- );
3528
- }
4105
+ this.shadowRoot = this;
3529
4106
  }
3530
- } else {
3531
- this.shadowRoot = this;
3532
4107
  }
3533
- }
3534
- });
3535
- Cstr.is = cmpMeta.$tagName$;
3536
- return proxyComponent(Cstr, cmpMeta, 1 /* isElementConstructor */ | 2 /* proxyState */);
4108
+ });
4109
+ Object.defineProperty(Cstr, "is", {
4110
+ value: cmpMeta.$tagName$,
4111
+ configurable: true
4112
+ });
4113
+ return proxyComponent(Cstr, cmpMeta, 1 /* isElementConstructor */ | 2 /* proxyState */);
4114
+ } catch (e) {
4115
+ consoleError(e);
4116
+ return Cstr;
4117
+ }
3537
4118
  };
3538
4119
  var forceModeUpdate = (elm) => {
3539
4120
  if (BUILD.style && BUILD.mode && !BUILD.lazyLoad) {
3540
4121
  const mode = computeMode(elm);
3541
4122
  const hostRef = getHostRef(elm);
3542
- if (hostRef.$modeName$ !== mode) {
4123
+ if (hostRef && hostRef.$modeName$ !== mode) {
3543
4124
  const cmpMeta = hostRef.$cmpMeta$;
3544
4125
  const oldScopeId = elm["s-sc"];
3545
4126
  const scopeId2 = getScopeId(cmpMeta, mode);
@@ -3561,6 +4142,9 @@ var forceModeUpdate = (elm) => {
3561
4142
  // src/runtime/hmr-component.ts
3562
4143
  var hmrStart = (hostElement, cmpMeta, hmrVersionId) => {
3563
4144
  const hostRef = getHostRef(hostElement);
4145
+ if (!hostRef) {
4146
+ return;
4147
+ }
3564
4148
  hostRef.$flags$ = 1 /* hasConnected */;
3565
4149
  initializeComponent(hostElement, hostRef, cmpMeta, hmrVersionId);
3566
4150
  };
@@ -3602,7 +4186,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
3602
4186
  let hasSlotRelocation = false;
3603
4187
  lazyBundles.map((lazyBundle) => {
3604
4188
  lazyBundle[1].map((compactMeta) => {
3605
- var _a2;
4189
+ var _a2, _b;
3606
4190
  const cmpMeta = {
3607
4191
  $flags$: compactMeta[0],
3608
4192
  $tagName$: compactMeta[1],
@@ -3621,31 +4205,28 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
3621
4205
  if (BUILD.reflect) {
3622
4206
  cmpMeta.$attrsToReflect$ = [];
3623
4207
  }
3624
- if (BUILD.watchCallback) {
3625
- cmpMeta.$watchers$ = (_a2 = compactMeta[4]) != null ? _a2 : {};
4208
+ if (BUILD.propChangeCallback) {
4209
+ cmpMeta.$watchers$ = normalizeWatchers(compactMeta[4]);
4210
+ cmpMeta.$serializers$ = (_a2 = compactMeta[5]) != null ? _a2 : {};
4211
+ cmpMeta.$deserializers$ = (_b = compactMeta[6]) != null ? _b : {};
3626
4212
  }
3627
4213
  if (BUILD.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
3628
4214
  cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
3629
4215
  }
3630
- const tagName = BUILD.transformTagName && options.transformTagName ? options.transformTagName(cmpMeta.$tagName$) : cmpMeta.$tagName$;
4216
+ const tagName = BUILD.transformTagName && options.transformTagName ? options.transformTagName(cmpMeta.$tagName$) : transformTag(cmpMeta.$tagName$);
3631
4217
  const HostElement = class extends HTMLElement {
4218
+ ["s-p"];
4219
+ ["s-rc"];
4220
+ hasRegisteredEventListeners = false;
3632
4221
  // StencilLazyHost
3633
4222
  constructor(self) {
3634
4223
  super(self);
3635
- this.hasRegisteredEventListeners = false;
3636
4224
  self = this;
3637
4225
  registerHost(self, cmpMeta);
3638
4226
  if (BUILD.shadowDom && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
3639
4227
  if (supportsShadow) {
3640
4228
  if (!self.shadowRoot) {
3641
- if (BUILD.shadowDelegatesFocus) {
3642
- self.attachShadow({
3643
- mode: "open",
3644
- delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */)
3645
- });
3646
- } else {
3647
- self.attachShadow({ mode: "open" });
3648
- }
4229
+ createShadowRoot.call(self, cmpMeta);
3649
4230
  } else {
3650
4231
  if (self.shadowRoot.mode !== "open") {
3651
4232
  throw new Error(
@@ -3660,6 +4241,9 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
3660
4241
  }
3661
4242
  connectedCallback() {
3662
4243
  const hostRef = getHostRef(this);
4244
+ if (!hostRef) {
4245
+ return;
4246
+ }
3663
4247
  if (!this.hasRegisteredEventListeners) {
3664
4248
  this.hasRegisteredEventListeners = true;
3665
4249
  addHostEventListeners(this, hostRef, cmpMeta.$listeners$, false);
@@ -3676,9 +4260,12 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
3676
4260
  }
3677
4261
  disconnectedCallback() {
3678
4262
  plt.jmp(() => disconnectedCallback(this));
3679
- plt.raf(() => {
4263
+ nextTick(() => {
3680
4264
  var _a3;
3681
4265
  const hostRef = getHostRef(this);
4266
+ if (!hostRef) {
4267
+ return;
4268
+ }
3682
4269
  const i2 = deferredConnectedCallbacks.findIndex((host) => host === this);
3683
4270
  if (i2 > -1) {
3684
4271
  deferredConnectedCallbacks.splice(i2, 1);
@@ -3689,26 +4276,29 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
3689
4276
  });
3690
4277
  }
3691
4278
  componentOnReady() {
3692
- return getHostRef(this).$onReadyPromise$;
4279
+ var _a3;
4280
+ return (_a3 = getHostRef(this)) == null ? void 0 : _a3.$onReadyPromise$;
3693
4281
  }
3694
4282
  };
3695
- if (BUILD.experimentalSlotFixes) {
3696
- if (BUILD.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
4283
+ if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) && cmpMeta.$flags$ & 256 /* hasSlot */) {
4284
+ if (BUILD.experimentalSlotFixes) {
3697
4285
  patchPseudoShadowDom(HostElement.prototype);
4286
+ } else {
4287
+ if (BUILD.slotChildNodesFix) {
4288
+ patchChildSlotNodes(HostElement.prototype);
4289
+ }
4290
+ if (BUILD.cloneNodeFix) {
4291
+ patchCloneNode(HostElement.prototype);
4292
+ }
4293
+ if (BUILD.appendChildSlotFix) {
4294
+ patchSlotAppendChild(HostElement.prototype);
4295
+ }
4296
+ if (BUILD.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
4297
+ patchTextContent(HostElement.prototype);
4298
+ }
3698
4299
  }
3699
- } else {
3700
- if (BUILD.slotChildNodesFix) {
3701
- patchChildSlotNodes(HostElement.prototype);
3702
- }
3703
- if (BUILD.cloneNodeFix) {
3704
- patchCloneNode(HostElement.prototype);
3705
- }
3706
- if (BUILD.appendChildSlotFix) {
3707
- patchSlotAppendChild(HostElement.prototype);
3708
- }
3709
- if (BUILD.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
3710
- patchTextContent(HostElement.prototype);
3711
- }
4300
+ } else if (BUILD.cloneNodeFix) {
4301
+ patchCloneNode(HostElement.prototype);
3712
4302
  }
3713
4303
  if (BUILD.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */) {
3714
4304
  HostElement.formAssociated = true;
@@ -3729,7 +4319,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
3729
4319
  });
3730
4320
  });
3731
4321
  if (cmpTags.length > 0) {
3732
- if (hasSlotRelocation) {
4322
+ if (BUILD.slotRelocation && hasSlotRelocation) {
3733
4323
  dataStyles.textContent += SLOT_FB_CSS;
3734
4324
  }
3735
4325
  if (BUILD.invisiblePrehydration && (BUILD.hydratedClass || BUILD.hydratedAttribute)) {
@@ -3812,6 +4402,12 @@ var hostListenerOpts = (flags) => supportsListenerOptions ? {
3812
4402
  passive: (flags & 1 /* Passive */) !== 0,
3813
4403
  capture: (flags & 2 /* Capture */) !== 0
3814
4404
  } : (flags & 2 /* Capture */) !== 0;
4405
+ var baseClass = BUILD.lazyLoad ? class {
4406
+ } : globalThis.HTMLElement || class {
4407
+ };
4408
+ function Mixin(...mixins) {
4409
+ return mixins.reduceRight((acc, mixin) => mixin(acc), baseClass);
4410
+ }
3815
4411
 
3816
4412
  // src/runtime/nonce.ts
3817
4413
  var setNonce = (nonce) => plt.$nonce$ = nonce;
@@ -3819,6 +4415,90 @@ var setNonce = (nonce) => plt.$nonce$ = nonce;
3819
4415
  // src/runtime/platform-options.ts
3820
4416
  var setPlatformOptions = (opts) => Object.assign(plt, opts);
3821
4417
 
4418
+ // src/runtime/render.ts
4419
+ var hostRefCache = /* @__PURE__ */ new WeakMap();
4420
+ function render(vnode, container) {
4421
+ let ref = hostRefCache.get(container);
4422
+ if (!ref) {
4423
+ const cmpMeta = {
4424
+ $flags$: 0,
4425
+ $tagName$: container.tagName
4426
+ };
4427
+ ref = {
4428
+ $flags$: 0,
4429
+ $cmpMeta$: cmpMeta,
4430
+ $hostElement$: container
4431
+ };
4432
+ hostRefCache.set(container, ref);
4433
+ }
4434
+ renderVdom(ref, vnode);
4435
+ }
4436
+
4437
+ // src/runtime/tag-transform.ts
4438
+ var tagTransformer = void 0;
4439
+ function transformTag(tag) {
4440
+ if (!tagTransformer) return tag;
4441
+ return tagTransformer(tag);
4442
+ }
4443
+ function setTagTransformer(transformer) {
4444
+ if (tagTransformer) {
4445
+ console.warn(`
4446
+ A tagTransformer has already been set.
4447
+ Overwriting it may lead to error and unexpected results if your components have already been defined.
4448
+ `);
4449
+ }
4450
+ tagTransformer = transformer;
4451
+ }
4452
+
4453
+ // src/runtime/vdom/jsx-dev-runtime.ts
4454
+ function jsxDEV(type, props, key, _isStaticChildren, _source, _self) {
4455
+ const propsObj = props || {};
4456
+ const { children, ...rest } = propsObj;
4457
+ let vnodeData = rest;
4458
+ if (key !== void 0 && !("key" in rest)) {
4459
+ vnodeData = { ...rest, key };
4460
+ }
4461
+ if (vnodeData && Object.keys(vnodeData).length === 0) {
4462
+ vnodeData = null;
4463
+ }
4464
+ if (children !== void 0) {
4465
+ if (Array.isArray(children)) {
4466
+ return h(type, vnodeData, ...children);
4467
+ }
4468
+ if (typeof children === "object" && children !== null && "$flags$" in children) {
4469
+ return h(type, vnodeData, children);
4470
+ }
4471
+ return h(type, vnodeData, children);
4472
+ }
4473
+ return h(type, vnodeData);
4474
+ }
4475
+
4476
+ // src/runtime/vdom/jsx-runtime.ts
4477
+ function jsx(type, props, key) {
4478
+ const propsObj = props || {};
4479
+ const { children, ...rest } = propsObj;
4480
+ let vnodeData = rest;
4481
+ if (key !== void 0 && !("key" in rest)) {
4482
+ vnodeData = { ...rest, key };
4483
+ }
4484
+ if (vnodeData && Object.keys(vnodeData).length === 0) {
4485
+ vnodeData = null;
4486
+ }
4487
+ if (children !== void 0) {
4488
+ if (Array.isArray(children)) {
4489
+ return h(type, vnodeData, ...children);
4490
+ }
4491
+ if (typeof children === "object" && children !== null && "$flags$" in children) {
4492
+ return h(type, vnodeData, children);
4493
+ }
4494
+ return h(type, vnodeData, children);
4495
+ }
4496
+ return h(type, vnodeData);
4497
+ }
4498
+ function jsxs(type, props, key) {
4499
+ return jsx(type, props, key);
4500
+ }
4501
+
3822
4502
  // src/runtime/vdom/vdom-annotations.ts
3823
4503
  var insertVdomAnnotations = (doc, staticComponents) => {
3824
4504
  if (doc != null) {
@@ -3964,7 +4644,7 @@ var insertChildVNodeAnnotations = (doc, vnodeChild, cmpData, hostId, depth, inde
3964
4644
  }
3965
4645
  };
3966
4646
 
3967
- const StencilCore = /*#__PURE__*/Object.freeze({
4647
+ var StencilCore = /*#__PURE__*/Object.freeze({
3968
4648
  __proto__: null,
3969
4649
  BUILD: BUILD,
3970
4650
  Build: Build,
@@ -3972,7 +4652,9 @@ const StencilCore = /*#__PURE__*/Object.freeze({
3972
4652
  Fragment: Fragment,
3973
4653
  H: H,
3974
4654
  HTMLElement: H,
4655
+ HYDRATED_STYLE_ID: HYDRATED_STYLE_ID,
3975
4656
  Host: Host,
4657
+ Mixin: Mixin,
3976
4658
  NAMESPACE: NAMESPACE,
3977
4659
  STENCIL_DEV_MODE: STENCIL_DEV_MODE,
3978
4660
  addHostEventListeners: addHostEventListeners,
@@ -3997,9 +4679,14 @@ const StencilCore = /*#__PURE__*/Object.freeze({
3997
4679
  h: h,
3998
4680
  insertVdomAnnotations: insertVdomAnnotations,
3999
4681
  isMemberInElement: isMemberInElement,
4682
+ jsx: jsx,
4683
+ jsxDEV: jsxDEV,
4684
+ jsxs: jsxs,
4000
4685
  loadModule: loadModule,
4001
4686
  modeResolutionChain: modeResolutionChain,
4687
+ needsScopedSSR: needsScopedSSR,
4002
4688
  nextTick: nextTick,
4689
+ normalizeWatchers: normalizeWatchers,
4003
4690
  parsePropertyValue: parsePropertyValue,
4004
4691
  plt: plt,
4005
4692
  postUpdateComponent: postUpdateComponent,
@@ -4009,6 +4696,7 @@ const StencilCore = /*#__PURE__*/Object.freeze({
4009
4696
  readTask: readTask,
4010
4697
  registerHost: registerHost,
4011
4698
  registerInstance: registerInstance,
4699
+ render: render,
4012
4700
  renderVdom: renderVdom,
4013
4701
  setAssetPath: setAssetPath,
4014
4702
  setErrorHandler: setErrorHandler,
@@ -4016,11 +4704,15 @@ const StencilCore = /*#__PURE__*/Object.freeze({
4016
4704
  setNonce: setNonce,
4017
4705
  setPlatformHelpers: setPlatformHelpers,
4018
4706
  setPlatformOptions: setPlatformOptions,
4707
+ setScopedSSR: setScopedSSR,
4708
+ setTagTransformer: setTagTransformer,
4019
4709
  setValue: setValue,
4020
4710
  styles: styles,
4021
4711
  supportsConstructableStylesheets: supportsConstructableStylesheets,
4022
4712
  supportsListenerOptions: supportsListenerOptions,
4713
+ supportsMutableAdoptedStyleSheets: supportsMutableAdoptedStyleSheets,
4023
4714
  supportsShadow: supportsShadow,
4715
+ transformTag: transformTag,
4024
4716
  win: win,
4025
4717
  writeTask: writeTask
4026
4718
  });