@shopify/hydrogen 1.0.0-alpha.22 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (773) hide show
  1. package/CHANGELOG.md +2198 -0
  2. package/README.md +2 -2
  3. package/dist/esnext/FileSessionStorage.d.ts +1 -0
  4. package/dist/esnext/FileSessionStorage.js +1 -0
  5. package/dist/esnext/client.d.ts +14 -5
  6. package/dist/esnext/client.js +14 -5
  7. package/dist/esnext/components/AddToCartButton/AddToCartButton.client.d.ts +12 -7
  8. package/dist/esnext/components/AddToCartButton/AddToCartButton.client.js +40 -36
  9. package/dist/esnext/components/AddToCartButton/index.d.ts +1 -1
  10. package/dist/esnext/components/BaseButton/BaseButton.client.d.ts +14 -0
  11. package/dist/esnext/components/BaseButton/BaseButton.client.js +15 -0
  12. package/dist/esnext/components/BaseButton/index.d.ts +1 -0
  13. package/dist/esnext/components/BaseButton/index.js +1 -0
  14. package/dist/esnext/components/BuyNowButton/BuyNowButton.client.d.ts +15 -0
  15. package/dist/esnext/components/BuyNowButton/BuyNowButton.client.js +27 -0
  16. package/dist/esnext/components/BuyNowButton/index.d.ts +1 -1
  17. package/dist/esnext/components/BuyNowButton/index.js +1 -1
  18. package/dist/esnext/components/CartCheckoutButton/CartCheckoutButton.client.d.ts +7 -3
  19. package/dist/esnext/components/CartCheckoutButton/CartCheckoutButton.client.js +9 -6
  20. package/dist/esnext/components/CartCost/CartCost.client.d.ts +14 -0
  21. package/dist/esnext/components/CartCost/CartCost.client.js +29 -0
  22. package/dist/esnext/components/CartCost/index.d.ts +1 -0
  23. package/dist/esnext/components/CartCost/index.js +1 -0
  24. package/dist/esnext/components/CartLineImage/CartLineImage.client.d.ts +9 -6
  25. package/dist/esnext/components/CartLineImage/CartLineImage.client.js +6 -3
  26. package/dist/esnext/components/CartLinePrice/CartLinePrice.client.d.ts +10 -4
  27. package/dist/esnext/components/CartLinePrice/CartLinePrice.client.js +9 -8
  28. package/dist/esnext/components/CartLineProductTitle/CartLineProductTitle.client.d.ts +8 -3
  29. package/dist/esnext/components/CartLineProductTitle/CartLineProductTitle.client.js +4 -0
  30. package/dist/esnext/components/CartLineProvider/CartLineProvider.client.d.ts +5 -0
  31. package/dist/esnext/components/CartLineProvider/CartLineProvider.client.js +3 -0
  32. package/dist/esnext/components/CartLineProvider/context.d.ts +20 -10
  33. package/dist/esnext/components/CartLineProvider/index.d.ts +1 -1
  34. package/dist/esnext/components/CartLineProvider/index.js +1 -1
  35. package/dist/esnext/components/CartLineQuantity/CartLineQuantity.client.d.ts +8 -3
  36. package/dist/esnext/components/CartLineQuantity/CartLineQuantity.client.js +4 -0
  37. package/dist/esnext/components/CartLineQuantityAdjustButton/CartLineQuantityAdjustButton.d.ts +9 -4
  38. package/dist/esnext/components/CartLineQuantityAdjustButton/CartLineQuantityAdjustButton.js +22 -13
  39. package/dist/esnext/components/CartLines/CartLines.client.d.ts +15 -0
  40. package/dist/esnext/components/CartLines/{CartLines.js → CartLines.client.js} +7 -5
  41. package/dist/esnext/components/CartLines/index.d.ts +1 -1
  42. package/dist/esnext/components/CartLines/index.js +1 -1
  43. package/dist/esnext/components/CartProvider/CartProvider.client.d.ts +37 -3
  44. package/dist/esnext/components/CartProvider/CartProvider.client.js +474 -370
  45. package/dist/esnext/components/CartProvider/cart-queries.d.ts +10 -0
  46. package/dist/esnext/components/CartProvider/cart-queries.js +202 -0
  47. package/dist/esnext/components/CartProvider/constants.d.ts +1 -1
  48. package/dist/esnext/components/CartProvider/constants.js +1 -1
  49. package/dist/esnext/components/CartProvider/graphql/CartAttributesUpdateMutation.d.ts +82 -4
  50. package/dist/esnext/components/CartProvider/graphql/CartBuyerIdentityUpdateMutation.d.ts +82 -4
  51. package/dist/esnext/components/CartProvider/graphql/CartCreateMutation.d.ts +82 -4
  52. package/dist/esnext/components/CartProvider/graphql/CartDiscountCodesUpdateMutation.d.ts +83 -5
  53. package/dist/esnext/components/CartProvider/graphql/CartFragment.d.ts +22 -8
  54. package/dist/esnext/components/CartProvider/graphql/CartLineAddMutation.d.ts +82 -4
  55. package/dist/esnext/components/CartProvider/graphql/CartLineRemoveMutation.d.ts +82 -4
  56. package/dist/esnext/components/CartProvider/graphql/CartLineUpdateMutation.d.ts +82 -4
  57. package/dist/esnext/components/CartProvider/graphql/CartNoteUpdateMutation.d.ts +83 -5
  58. package/dist/esnext/components/CartProvider/graphql/CartQuery.d.ts +82 -4
  59. package/dist/esnext/components/CartProvider/hooks.client.d.ts +15 -0
  60. package/dist/esnext/components/CartProvider/hooks.client.js +64 -0
  61. package/dist/esnext/components/CartProvider/index.d.ts +3 -3
  62. package/dist/esnext/components/CartProvider/index.js +2 -3
  63. package/dist/esnext/components/CartProvider/types.d.ts +48 -49
  64. package/dist/esnext/components/CartShopPayButton/CartShopPayButton.client.d.ts +7 -2
  65. package/dist/esnext/components/CartShopPayButton/CartShopPayButton.client.js +11 -4
  66. package/dist/esnext/components/ExternalVideo/ExternalVideo.d.ts +16 -9
  67. package/dist/esnext/components/ExternalVideo/ExternalVideo.js +11 -6
  68. package/dist/esnext/components/ExternalVideo/index.d.ts +1 -1
  69. package/dist/esnext/components/Image/Image.d.ts +103 -12
  70. package/dist/esnext/components/Image/Image.js +133 -7
  71. package/dist/esnext/components/Image/index.d.ts +2 -1
  72. package/dist/esnext/components/Link/Link.client.d.ts +27 -0
  73. package/dist/esnext/components/Link/Link.client.js +145 -0
  74. package/dist/esnext/components/Link/index.d.ts +1 -0
  75. package/dist/esnext/components/Link/index.js +1 -0
  76. package/dist/esnext/components/LocalizationProvider/LocalizationClientProvider.client.d.ts +2 -2
  77. package/dist/esnext/components/LocalizationProvider/LocalizationClientProvider.client.js +3 -12
  78. package/dist/esnext/components/LocalizationProvider/LocalizationContext.client.d.ts +6 -5
  79. package/dist/esnext/components/LocalizationProvider/LocalizationProvider.server.d.ts +19 -2
  80. package/dist/esnext/components/LocalizationProvider/LocalizationProvider.server.js +24 -5
  81. package/dist/esnext/components/LocalizationProvider/index.d.ts +0 -1
  82. package/dist/esnext/components/LocalizationProvider/index.js +0 -1
  83. package/dist/esnext/components/MediaFile/MediaFile.d.ts +18 -18
  84. package/dist/esnext/components/MediaFile/MediaFile.js +20 -10
  85. package/dist/esnext/components/MediaFile/index.d.ts +1 -1
  86. package/dist/esnext/components/Metafield/Metafield.client.d.ts +16 -7
  87. package/dist/esnext/components/Metafield/Metafield.client.js +83 -29
  88. package/dist/esnext/components/Metafield/components/StarRating/StarRating.d.ts +5 -5
  89. package/dist/esnext/components/Metafield/components/StarRating/StarRating.js +1 -1
  90. package/dist/esnext/components/Metafield/index.d.ts +1 -2
  91. package/dist/esnext/components/Metafield/types.d.ts +1 -1
  92. package/dist/esnext/components/ModelViewer/ModelViewer.client.d.ts +128 -0
  93. package/dist/esnext/components/ModelViewer/ModelViewer.client.js +104 -0
  94. package/dist/esnext/components/ModelViewer/index.d.ts +1 -0
  95. package/dist/esnext/components/ModelViewer/index.js +1 -0
  96. package/dist/esnext/components/Money/Money.client.d.ts +24 -6
  97. package/dist/esnext/components/Money/Money.client.js +36 -7
  98. package/dist/esnext/components/Money/index.d.ts +1 -1
  99. package/dist/esnext/components/ProductOptionsProvider/ProductOptionsProvider.client.d.ts +21 -0
  100. package/dist/esnext/components/ProductOptionsProvider/ProductOptionsProvider.client.js +133 -0
  101. package/dist/esnext/components/ProductOptionsProvider/context.d.ts +2 -0
  102. package/dist/esnext/components/ProductOptionsProvider/context.js +2 -0
  103. package/dist/esnext/components/ProductOptionsProvider/index.d.ts +2 -0
  104. package/dist/esnext/components/ProductOptionsProvider/index.js +2 -0
  105. package/dist/esnext/components/ProductPrice/ProductPrice.client.d.ts +15 -4
  106. package/dist/esnext/components/ProductPrice/ProductPrice.client.js +35 -13
  107. package/dist/esnext/components/Seo/CollectionSeo.client.d.ts +3 -0
  108. package/dist/esnext/components/Seo/CollectionSeo.client.js +14 -0
  109. package/dist/esnext/components/Seo/DefaultPageSeo.client.d.ts +3 -0
  110. package/dist/esnext/components/Seo/DefaultPageSeo.client.js +18 -0
  111. package/dist/esnext/components/Seo/DescriptionSeo.client.d.ts +4 -0
  112. package/dist/esnext/components/Seo/DescriptionSeo.client.js +10 -0
  113. package/dist/esnext/components/Seo/HomePageSeo.client.d.ts +2 -0
  114. package/dist/esnext/components/Seo/HomePageSeo.client.js +25 -0
  115. package/dist/esnext/components/Seo/ImageSeo.client.d.ts +3 -0
  116. package/dist/esnext/components/Seo/ImageSeo.client.js +10 -0
  117. package/dist/esnext/components/Seo/NoIndexSeo.client.d.ts +3 -0
  118. package/dist/esnext/components/Seo/NoIndexSeo.client.js +10 -0
  119. package/dist/esnext/components/Seo/PageSeo.client.d.ts +3 -0
  120. package/dist/esnext/components/Seo/PageSeo.client.js +12 -0
  121. package/dist/esnext/components/Seo/ProductSeo.client.d.ts +5 -0
  122. package/dist/esnext/components/Seo/ProductSeo.client.js +62 -0
  123. package/dist/esnext/components/Seo/Seo.client.d.ts +30 -0
  124. package/dist/esnext/components/Seo/Seo.client.js +31 -0
  125. package/dist/esnext/components/Seo/TitleSeo.client.d.ts +3 -0
  126. package/dist/esnext/components/Seo/TitleSeo.client.js +10 -0
  127. package/dist/esnext/components/Seo/TwitterSeo.client.d.ts +2 -0
  128. package/dist/esnext/components/Seo/TwitterSeo.client.js +9 -0
  129. package/dist/esnext/components/Seo/index.d.ts +1 -0
  130. package/dist/esnext/components/Seo/index.js +1 -0
  131. package/dist/esnext/components/Seo/seo-types.d.ts +18 -0
  132. package/dist/esnext/components/{ExternalVideo/ExternalVideoFragment.js → Seo/seo-types.js} +0 -0
  133. package/dist/esnext/components/ShopPayButton/ShopPayButton.client.d.ts +29 -4
  134. package/dist/esnext/components/ShopPayButton/ShopPayButton.client.js +50 -26
  135. package/dist/esnext/components/ShopPayButton/index.d.ts +1 -1
  136. package/dist/esnext/components/Video/Video.d.ts +13 -12
  137. package/dist/esnext/components/Video/Video.js +21 -6
  138. package/dist/esnext/components/Video/index.d.ts +1 -1
  139. package/dist/esnext/components/index.d.ts +28 -41
  140. package/dist/esnext/components/index.js +26 -87
  141. package/dist/esnext/components/types.d.ts +4 -6
  142. package/dist/esnext/components/types.js +1 -1
  143. package/dist/esnext/config.d.ts +7 -0
  144. package/dist/esnext/config.js +5 -0
  145. package/dist/esnext/constants.d.ts +9 -0
  146. package/dist/esnext/constants.js +9 -0
  147. package/dist/esnext/entry-client.js +145 -23
  148. package/dist/esnext/entry-server.d.ts +5 -2
  149. package/dist/esnext/entry-server.js +570 -247
  150. package/dist/esnext/foundation/Analytics/Analytics.client.d.ts +3 -0
  151. package/dist/esnext/foundation/Analytics/Analytics.client.js +30 -0
  152. package/dist/esnext/foundation/Analytics/Analytics.server.d.ts +1 -0
  153. package/dist/esnext/foundation/Analytics/Analytics.server.js +47 -0
  154. package/dist/esnext/foundation/Analytics/ClientAnalytics.d.ts +27 -0
  155. package/dist/esnext/foundation/Analytics/ClientAnalytics.js +99 -0
  156. package/dist/esnext/foundation/Analytics/ServerAnalyticsRoute.d.ts +4 -0
  157. package/dist/esnext/foundation/Analytics/ServerAnalyticsRoute.js +51 -0
  158. package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetrics.client.d.ts +7 -0
  159. package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetrics.client.js +81 -0
  160. package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetricsDebug.client.d.ts +1 -0
  161. package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetricsDebug.client.js +23 -0
  162. package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/ServerAnalyticsConnector.d.ts +3 -0
  163. package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/ServerAnalyticsConnector.js +7 -0
  164. package/dist/esnext/foundation/Analytics/connectors/Shopify/ServerAnalyticsConnector.d.ts +3 -0
  165. package/dist/esnext/foundation/Analytics/connectors/Shopify/ServerAnalyticsConnector.js +7 -0
  166. package/dist/esnext/foundation/Analytics/connectors/Shopify/ShopifyAnalytics.client.d.ts +3 -0
  167. package/dist/esnext/foundation/Analytics/connectors/Shopify/ShopifyAnalytics.client.js +182 -0
  168. package/dist/esnext/foundation/Analytics/connectors/Shopify/ShopifyAnalytics.server.d.ts +3 -0
  169. package/dist/esnext/foundation/Analytics/connectors/Shopify/ShopifyAnalytics.server.js +43 -0
  170. package/dist/esnext/foundation/Analytics/connectors/Shopify/const.d.ts +28 -0
  171. package/dist/esnext/foundation/Analytics/connectors/Shopify/const.js +51 -0
  172. package/dist/esnext/foundation/Analytics/connectors/Shopify/utils.d.ts +3 -0
  173. package/dist/esnext/foundation/Analytics/connectors/Shopify/utils.js +56 -0
  174. package/dist/esnext/foundation/Analytics/const.d.ts +9 -0
  175. package/dist/esnext/foundation/Analytics/const.js +9 -0
  176. package/dist/esnext/foundation/Analytics/hook.d.ts +1 -0
  177. package/dist/esnext/foundation/Analytics/hook.js +9 -0
  178. package/dist/esnext/foundation/Analytics/index.d.ts +1 -0
  179. package/dist/esnext/foundation/Analytics/index.js +1 -0
  180. package/dist/esnext/foundation/Analytics/types.d.ts +5 -0
  181. package/dist/esnext/{components/ProductProvider → foundation/Analytics}/types.js +0 -0
  182. package/dist/esnext/foundation/Analytics/utils.d.ts +3 -0
  183. package/dist/esnext/foundation/Analytics/utils.js +29 -0
  184. package/dist/esnext/foundation/AnalyticsErrorBoundary.client.d.ts +4 -0
  185. package/dist/esnext/foundation/AnalyticsErrorBoundary.client.js +8 -0
  186. package/dist/esnext/foundation/BuiltInRoutes/BuiltInRoutes.d.ts +2 -0
  187. package/dist/esnext/foundation/BuiltInRoutes/BuiltInRoutes.js +23 -0
  188. package/dist/esnext/foundation/BuiltInRoutes/healthCheck.d.ts +1 -0
  189. package/dist/esnext/foundation/BuiltInRoutes/healthCheck.js +3 -0
  190. package/dist/esnext/foundation/Cache/cache-sub-request.d.ts +17 -0
  191. package/dist/esnext/foundation/Cache/cache-sub-request.js +64 -0
  192. package/dist/esnext/foundation/Cache/cache.d.ts +17 -0
  193. package/dist/esnext/foundation/Cache/cache.js +127 -0
  194. package/dist/esnext/foundation/Cache/strategies/index.d.ts +7 -0
  195. package/dist/esnext/foundation/Cache/strategies/index.js +54 -0
  196. package/dist/esnext/foundation/Cookie/Cookie.d.ts +48 -0
  197. package/dist/esnext/foundation/Cookie/Cookie.js +72 -0
  198. package/dist/esnext/foundation/CookieSessionStorage/CookieSessionStorage.d.ts +5 -0
  199. package/dist/esnext/foundation/CookieSessionStorage/CookieSessionStorage.js +31 -0
  200. package/dist/esnext/foundation/DevTools/DevTools.client.d.ts +3 -0
  201. package/dist/esnext/foundation/DevTools/DevTools.client.js +17 -0
  202. package/dist/esnext/foundation/DevTools/DevTools.server.d.ts +1 -0
  203. package/dist/esnext/foundation/DevTools/DevTools.server.js +14 -0
  204. package/dist/esnext/foundation/DevTools/components/GraphQL.client.d.ts +1 -0
  205. package/dist/esnext/foundation/DevTools/components/GraphQL.client.js +25 -0
  206. package/dist/esnext/foundation/DevTools/components/Heading.d.ts +5 -0
  207. package/dist/esnext/foundation/DevTools/components/Heading.js +12 -0
  208. package/dist/esnext/foundation/DevTools/components/Interface.client.d.ts +11 -0
  209. package/dist/esnext/foundation/DevTools/components/Interface.client.js +47 -0
  210. package/dist/esnext/foundation/DevTools/components/Panels.d.ts +8 -0
  211. package/dist/esnext/foundation/DevTools/components/Panels.js +60 -0
  212. package/dist/esnext/foundation/DevTools/components/Performance.client.d.ts +14 -0
  213. package/dist/esnext/foundation/DevTools/components/Performance.client.js +26 -0
  214. package/dist/esnext/foundation/DevTools/components/Settings.client.d.ts +7 -0
  215. package/dist/esnext/foundation/DevTools/components/Settings.client.js +20 -0
  216. package/dist/esnext/foundation/DevTools/components/Table.d.ts +9 -0
  217. package/dist/esnext/foundation/DevTools/components/Table.js +7 -0
  218. package/dist/esnext/foundation/DevTools/components/icons.d.ts +2 -0
  219. package/dist/esnext/foundation/DevTools/components/icons.js +13 -0
  220. package/dist/esnext/foundation/DevTools/components/index.d.ts +2 -0
  221. package/dist/esnext/foundation/DevTools/components/index.js +2 -0
  222. package/dist/esnext/foundation/FileRoutes/FileRoutes.server.d.ts +22 -0
  223. package/dist/esnext/foundation/FileRoutes/FileRoutes.server.js +69 -0
  224. package/dist/esnext/foundation/FileSessionStorage/FileSessionStorage.d.ts +6 -0
  225. package/dist/esnext/foundation/FileSessionStorage/FileSessionStorage.js +149 -0
  226. package/dist/esnext/foundation/Head/Head.client.d.ts +5 -0
  227. package/dist/esnext/foundation/Head/Head.client.js +10 -0
  228. package/dist/esnext/foundation/Head/index.d.ts +1 -0
  229. package/dist/esnext/foundation/Head/index.js +1 -0
  230. package/dist/esnext/foundation/Html/Html.d.ts +13 -0
  231. package/dist/esnext/foundation/Html/Html.js +96 -0
  232. package/dist/esnext/foundation/HydrogenRequest/HydrogenRequest.server.d.ts +76 -0
  233. package/dist/esnext/foundation/HydrogenRequest/HydrogenRequest.server.js +210 -0
  234. package/dist/esnext/foundation/HydrogenResponse/HydrogenResponse.server.d.ts +21 -0
  235. package/dist/esnext/foundation/HydrogenResponse/HydrogenResponse.server.js +48 -0
  236. package/dist/esnext/foundation/MemorySessionStorage/MemorySessionStorage.d.ts +5 -0
  237. package/dist/esnext/foundation/MemorySessionStorage/MemorySessionStorage.js +53 -0
  238. package/dist/esnext/foundation/Redirect/Redirect.client.d.ts +5 -0
  239. package/dist/esnext/foundation/Redirect/Redirect.client.js +15 -0
  240. package/dist/esnext/foundation/Route/Route.server.d.ts +12 -0
  241. package/dist/esnext/foundation/Route/Route.server.js +28 -0
  242. package/dist/esnext/foundation/Router/BrowserRouter.client.d.ts +14 -0
  243. package/dist/esnext/foundation/Router/BrowserRouter.client.js +138 -0
  244. package/dist/esnext/foundation/Router/Router.server.d.ts +10 -0
  245. package/dist/esnext/foundation/Router/Router.server.js +8 -0
  246. package/dist/esnext/foundation/ServerPropsProvider/ServerPropsProvider.d.ts +41 -0
  247. package/dist/esnext/foundation/ServerPropsProvider/ServerPropsProvider.js +65 -0
  248. package/dist/esnext/foundation/ServerPropsProvider/index.d.ts +2 -0
  249. package/dist/esnext/foundation/ServerPropsProvider/index.js +1 -0
  250. package/dist/esnext/foundation/ServerRequestProvider/ServerRequestProvider.d.ts +23 -0
  251. package/dist/esnext/foundation/ServerRequestProvider/ServerRequestProvider.js +125 -0
  252. package/dist/esnext/foundation/ServerRequestProvider/index.d.ts +1 -0
  253. package/dist/esnext/foundation/ServerRequestProvider/index.js +1 -0
  254. package/dist/esnext/foundation/ServerStateProvider/ServerStateProvider.d.ts +30 -0
  255. package/dist/esnext/foundation/ServerStateProvider/ServerStateProvider.js +59 -0
  256. package/dist/esnext/foundation/ShopifyProvider/ShopifyProvider.client.d.ts +7 -0
  257. package/dist/esnext/foundation/ShopifyProvider/ShopifyProvider.client.js +8 -0
  258. package/dist/esnext/foundation/ShopifyProvider/ShopifyProvider.server.d.ts +16 -0
  259. package/dist/esnext/foundation/ShopifyProvider/ShopifyProvider.server.js +60 -0
  260. package/dist/esnext/foundation/ShopifyProvider/index.d.ts +1 -2
  261. package/dist/esnext/foundation/ShopifyProvider/index.js +1 -2
  262. package/dist/esnext/foundation/ShopifyProvider/types.d.ts +12 -10
  263. package/dist/esnext/foundation/constants.d.ts +2 -0
  264. package/dist/esnext/foundation/constants.js +4 -0
  265. package/dist/esnext/foundation/fetchSync/client/fetchSync.d.ts +10 -0
  266. package/dist/esnext/foundation/fetchSync/client/fetchSync.js +28 -0
  267. package/dist/esnext/foundation/fetchSync/server/fetchSync.d.ts +8 -0
  268. package/dist/esnext/foundation/fetchSync/server/fetchSync.js +29 -0
  269. package/dist/esnext/foundation/fetchSync/types.d.ts +5 -0
  270. package/dist/{worker → esnext/foundation/fetchSync}/types.js +0 -0
  271. package/dist/esnext/foundation/index.d.ts +3 -4
  272. package/dist/esnext/foundation/index.js +3 -4
  273. package/dist/esnext/foundation/runtime.d.ts +2 -0
  274. package/dist/esnext/foundation/runtime.js +6 -0
  275. package/dist/esnext/foundation/session/session.d.ts +27 -0
  276. package/dist/esnext/foundation/session/session.js +37 -0
  277. package/dist/esnext/foundation/ssr-interop.d.ts +29 -0
  278. package/dist/esnext/foundation/ssr-interop.js +35 -0
  279. package/dist/esnext/foundation/useNavigate/useNavigate.d.ts +17 -0
  280. package/dist/esnext/foundation/useNavigate/useNavigate.js +39 -0
  281. package/dist/esnext/foundation/useQuery/hooks.d.ts +37 -0
  282. package/dist/esnext/foundation/useQuery/hooks.js +105 -0
  283. package/dist/esnext/foundation/useQuery/index.d.ts +1 -0
  284. package/dist/esnext/foundation/useQuery/index.js +1 -0
  285. package/dist/esnext/foundation/useRequestContext/index.d.ts +15 -0
  286. package/dist/esnext/foundation/useRequestContext/index.js +23 -0
  287. package/dist/esnext/foundation/useRouteParams/RouteParamsProvider.client.d.ts +13 -0
  288. package/dist/esnext/foundation/useRouteParams/RouteParamsProvider.client.js +12 -0
  289. package/dist/esnext/foundation/useRouteParams/useRouteParams.d.ts +4 -0
  290. package/dist/esnext/foundation/useRouteParams/useRouteParams.js +9 -0
  291. package/dist/esnext/foundation/useServerProps/index.d.ts +1 -0
  292. package/dist/esnext/foundation/useServerProps/index.js +1 -0
  293. package/dist/esnext/foundation/useServerProps/use-server-props.d.ts +21 -0
  294. package/dist/esnext/foundation/useServerProps/use-server-props.js +35 -0
  295. package/dist/esnext/foundation/useSession/useSession.d.ts +2 -0
  296. package/dist/esnext/foundation/useSession/useSession.js +7 -0
  297. package/dist/esnext/foundation/useShop/index.d.ts +1 -0
  298. package/dist/esnext/foundation/useShop/index.js +1 -0
  299. package/dist/esnext/foundation/useShop/use-shop.d.ts +6 -0
  300. package/dist/esnext/foundation/useShop/use-shop.js +14 -0
  301. package/dist/esnext/foundation/useUrl/index.d.ts +1 -0
  302. package/dist/esnext/foundation/useUrl/index.js +1 -0
  303. package/dist/esnext/foundation/useUrl/useUrl.d.ts +4 -0
  304. package/dist/esnext/foundation/useUrl/useUrl.js +29 -0
  305. package/dist/esnext/framework/cache/in-memory.d.ts +17 -0
  306. package/dist/esnext/framework/cache/in-memory.js +80 -0
  307. package/dist/esnext/framework/graphiql.d.ts +1 -1
  308. package/dist/esnext/framework/graphiql.js +1 -2
  309. package/dist/esnext/framework/load-config.d.ts +5 -0
  310. package/dist/esnext/framework/load-config.js +7 -0
  311. package/dist/esnext/framework/middleware.d.ts +11 -7
  312. package/dist/esnext/framework/middleware.js +49 -68
  313. package/dist/esnext/framework/plugin.d.ts +8 -3
  314. package/dist/esnext/framework/plugin.js +23 -4
  315. package/dist/esnext/framework/plugins/vite-plugin-client-imports.d.ts +2 -0
  316. package/dist/esnext/framework/plugins/vite-plugin-client-imports.js +25 -0
  317. package/dist/esnext/framework/plugins/vite-plugin-css-modules-rsc.d.ts +2 -0
  318. package/dist/esnext/framework/plugins/vite-plugin-css-modules-rsc.js +98 -0
  319. package/dist/esnext/framework/plugins/vite-plugin-hydration-auto-import.d.ts +3 -0
  320. package/dist/esnext/framework/plugins/vite-plugin-hydration-auto-import.js +35 -0
  321. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-client-middleware.d.ts +9 -0
  322. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-client-middleware.js +36 -0
  323. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-config.d.ts +1 -1
  324. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-config.js +79 -20
  325. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-middleware.d.ts +10 -3
  326. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-middleware.js +47 -7
  327. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-rsc.d.ts +2 -0
  328. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-rsc.js +23 -0
  329. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-suppress-warnings.d.ts +3 -0
  330. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-suppress-warnings.js +19 -0
  331. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-virtual-files.d.ts +7 -0
  332. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-virtual-files.js +101 -0
  333. package/dist/esnext/framework/plugins/vite-plugin-platform-entry.d.ts +3 -0
  334. package/dist/esnext/framework/plugins/vite-plugin-platform-entry.js +70 -0
  335. package/dist/esnext/framework/plugins/{vite-plugin-react-server-components-shim.d.ts → vite-plugin-purge-query-cache.d.ts} +0 -0
  336. package/dist/esnext/framework/plugins/vite-plugin-purge-query-cache.js +11 -0
  337. package/dist/{node/framework/plugins/vite-plugin-react-server-components-shim.d.ts → esnext/framework/plugins/vite-plugin-ssr-interop.d.ts} +0 -0
  338. package/dist/esnext/framework/plugins/vite-plugin-ssr-interop.js +16 -0
  339. package/dist/esnext/framework/types.d.ts +6 -0
  340. package/dist/esnext/{components/Image/ImageFragment.js → framework/types.js} +0 -0
  341. package/dist/esnext/framework/viteception.d.ts +5 -0
  342. package/dist/esnext/framework/viteception.js +16 -0
  343. package/dist/esnext/hooks/index.d.ts +5 -5
  344. package/dist/esnext/hooks/index.js +5 -5
  345. package/dist/esnext/hooks/useCart/index.d.ts +1 -0
  346. package/dist/esnext/hooks/useCart/index.js +1 -0
  347. package/dist/esnext/hooks/useCart/useCart.d.ts +4 -0
  348. package/dist/esnext/hooks/useCart/useCart.js +12 -0
  349. package/dist/esnext/hooks/useCartLine/index.d.ts +1 -0
  350. package/dist/esnext/hooks/useCartLine/index.js +1 -0
  351. package/dist/esnext/hooks/useCartLine/useCartLine.d.ts +39 -0
  352. package/dist/esnext/{components/CartLineProvider/hooks.js → hooks/useCartLine/useCartLine.js} +4 -1
  353. package/dist/esnext/hooks/useLoadScript/index.d.ts +1 -0
  354. package/dist/esnext/hooks/useLoadScript/index.js +1 -0
  355. package/dist/esnext/hooks/useLoadScript/useLoadScript.client.d.ts +8 -0
  356. package/dist/esnext/hooks/useLoadScript/useLoadScript.client.js +23 -0
  357. package/dist/esnext/hooks/useLocalization/useLocalization.d.ts +4 -0
  358. package/dist/esnext/hooks/useLocalization/useLocalization.js +14 -0
  359. package/dist/esnext/hooks/useMeasurement/hooks.js +2 -2
  360. package/dist/esnext/hooks/useMoney/hooks.d.ts +44 -1
  361. package/dist/esnext/hooks/useMoney/hooks.js +69 -22
  362. package/dist/esnext/hooks/useProductOptions/helpers.d.ts +6 -4
  363. package/dist/esnext/hooks/useProductOptions/helpers.js +9 -6
  364. package/dist/esnext/hooks/useProductOptions/index.d.ts +1 -1
  365. package/dist/esnext/hooks/useProductOptions/index.js +1 -1
  366. package/dist/esnext/hooks/useProductOptions/types.d.ts +42 -48
  367. package/dist/esnext/hooks/useProductOptions/useProductOptions.client.d.ts +1 -0
  368. package/dist/esnext/hooks/useProductOptions/useProductOptions.client.js +9 -0
  369. package/dist/esnext/hooks/useShopQuery/hooks.d.ts +22 -3
  370. package/dist/esnext/hooks/useShopQuery/hooks.js +163 -24
  371. package/dist/esnext/hooks/useShopQuery/index.d.ts +1 -1
  372. package/dist/esnext/hooks/useShopQuery/index.js +1 -1
  373. package/dist/esnext/index.d.ts +41 -8
  374. package/dist/esnext/index.js +37 -10
  375. package/dist/esnext/node.d.ts +1 -0
  376. package/dist/esnext/node.js +1 -0
  377. package/dist/esnext/platforms/node.d.ts +9 -0
  378. package/dist/esnext/platforms/node.js +41 -0
  379. package/dist/esnext/{components/LocalizationProvider/LocalizationQuery.js → platforms/worker-event.d.ts} +0 -0
  380. package/dist/esnext/platforms/worker-event.js +3 -0
  381. package/dist/esnext/platforms/worker.d.ts +14 -0
  382. package/dist/esnext/platforms/worker.js +25 -0
  383. package/dist/esnext/shared-types.d.ts +27 -0
  384. package/dist/esnext/shared-types.js +4 -0
  385. package/dist/esnext/{graphql/types/types.d.ts → storefront-api-types.d.ts} +2404 -1886
  386. package/dist/esnext/{graphql/types/types.js → storefront-api-types.js} +1079 -722
  387. package/dist/esnext/streaming.server.d.ts +16 -0
  388. package/dist/esnext/streaming.server.js +24 -0
  389. package/dist/esnext/types.d.ts +92 -39
  390. package/dist/esnext/types.js +1 -1
  391. package/dist/esnext/utilities/apiRoutes.d.ts +42 -0
  392. package/dist/esnext/utilities/apiRoutes.js +152 -0
  393. package/dist/esnext/utilities/bot-ua.d.ts +4 -0
  394. package/dist/esnext/utilities/bot-ua.js +61 -0
  395. package/dist/esnext/utilities/defer.d.ts +6 -0
  396. package/dist/esnext/utilities/defer.js +14 -0
  397. package/dist/esnext/utilities/devtools.d.ts +11 -0
  398. package/dist/esnext/utilities/devtools.js +11 -0
  399. package/dist/esnext/utilities/empty-hydrogen-config.d.ts +2 -0
  400. package/dist/esnext/utilities/empty-hydrogen-config.js +2 -0
  401. package/dist/esnext/utilities/error.d.ts +1 -0
  402. package/dist/esnext/utilities/error.js +6 -0
  403. package/dist/esnext/utilities/fetch.d.ts +9 -0
  404. package/dist/esnext/utilities/fetch.js +31 -0
  405. package/dist/esnext/utilities/flattenConnection/flattenConnection.d.ts +7 -0
  406. package/dist/esnext/utilities/flattenConnection/flattenConnection.js +18 -0
  407. package/dist/esnext/utilities/flattenConnection/index.d.ts +1 -0
  408. package/dist/esnext/utilities/flattenConnection/index.js +1 -0
  409. package/dist/esnext/utilities/graphql-tag.d.ts +1 -0
  410. package/dist/esnext/utilities/graphql-tag.js +6 -0
  411. package/dist/esnext/utilities/graphql-tracker.d.ts +17 -0
  412. package/dist/esnext/utilities/graphql-tracker.js +121 -0
  413. package/dist/esnext/utilities/hash.d.ts +2 -0
  414. package/dist/esnext/utilities/hash.js +30 -0
  415. package/dist/esnext/utilities/html-encoding.d.ts +1 -0
  416. package/dist/esnext/utilities/html-encoding.js +8 -0
  417. package/dist/esnext/utilities/image_size.d.ts +30 -14
  418. package/dist/esnext/utilities/image_size.js +80 -30
  419. package/dist/esnext/utilities/index.d.ts +10 -6
  420. package/dist/esnext/utilities/index.js +10 -6
  421. package/dist/esnext/utilities/isBrowser/index.d.ts +1 -0
  422. package/dist/esnext/utilities/isBrowser/index.js +1 -0
  423. package/dist/esnext/utilities/isBrowser/isBrowser.d.ts +4 -0
  424. package/dist/esnext/utilities/isBrowser/isBrowser.js +6 -0
  425. package/dist/esnext/utilities/isServer/index.d.ts +1 -0
  426. package/dist/esnext/utilities/isServer/index.js +1 -0
  427. package/dist/esnext/utilities/isServer/isServer.d.ts +4 -0
  428. package/dist/esnext/utilities/isServer/isServer.js +7 -0
  429. package/dist/esnext/utilities/{script_loader.d.ts → load_script.d.ts} +0 -0
  430. package/dist/esnext/utilities/{script_loader.js → load_script.js} +1 -1
  431. package/dist/esnext/utilities/log/index.d.ts +4 -0
  432. package/dist/esnext/utilities/log/index.js +4 -0
  433. package/dist/esnext/utilities/log/log-cache-api-status.d.ts +1 -0
  434. package/dist/esnext/utilities/log/log-cache-api-status.js +17 -0
  435. package/dist/esnext/utilities/log/log-cache-header.d.ts +10 -0
  436. package/dist/esnext/utilities/log/log-cache-header.js +30 -0
  437. package/dist/esnext/utilities/log/log-query-timeline.d.ts +12 -0
  438. package/dist/esnext/utilities/log/log-query-timeline.js +102 -0
  439. package/dist/esnext/utilities/log/log.d.ts +28 -0
  440. package/dist/esnext/utilities/log/log.js +74 -0
  441. package/dist/esnext/utilities/log/utils.d.ts +3 -0
  442. package/dist/esnext/utilities/log/utils.js +11 -0
  443. package/dist/esnext/utilities/matchPath.d.ts +10 -0
  444. package/dist/esnext/utilities/matchPath.js +54 -0
  445. package/dist/esnext/utilities/{meaurement.d.ts → measurement.d.ts} +0 -0
  446. package/dist/esnext/utilities/{meaurement.js → measurement.js} +0 -0
  447. package/dist/esnext/utilities/object.d.ts +5 -0
  448. package/dist/esnext/utilities/object.js +7 -0
  449. package/dist/esnext/utilities/parse.d.ts +1 -0
  450. package/dist/esnext/utilities/parse.js +9 -0
  451. package/dist/esnext/utilities/parseMetafield/index.d.ts +1 -0
  452. package/dist/esnext/utilities/parseMetafield/index.js +1 -0
  453. package/dist/esnext/utilities/parseMetafield/parseMetafield.d.ts +15 -0
  454. package/dist/esnext/utilities/parseMetafield/parseMetafield.js +62 -0
  455. package/dist/esnext/utilities/storefrontApi.d.ts +5 -0
  456. package/dist/esnext/utilities/storefrontApi.js +26 -0
  457. package/dist/esnext/utilities/suspense.d.ts +7 -2
  458. package/dist/esnext/utilities/suspense.js +32 -6
  459. package/dist/esnext/utilities/template.d.ts +9 -0
  460. package/dist/esnext/utilities/template.js +22 -0
  461. package/dist/esnext/utilities/timing.d.ts +7 -0
  462. package/dist/esnext/utilities/timing.js +14 -0
  463. package/dist/esnext/{components/MediaFile/MediaFileFragment.js → utilities/web-api-polyfill.d.ts} +0 -0
  464. package/dist/esnext/utilities/web-api-polyfill.js +25 -0
  465. package/dist/esnext/version.d.ts +1 -1
  466. package/dist/esnext/version.js +1 -1
  467. package/dist/node/framework/cache/in-memory.d.ts +17 -0
  468. package/dist/node/framework/cache/in-memory.js +84 -0
  469. package/dist/node/framework/graphiql.d.ts +1 -1
  470. package/dist/node/framework/graphiql.js +1 -2
  471. package/dist/node/framework/load-config.d.ts +5 -0
  472. package/dist/node/framework/load-config.js +11 -0
  473. package/dist/node/framework/middleware.d.ts +11 -7
  474. package/dist/node/framework/middleware.js +56 -73
  475. package/dist/node/framework/plugin.d.ts +5 -3
  476. package/dist/node/framework/plugin.js +27 -8
  477. package/dist/node/framework/plugins/vite-plugin-client-imports.d.ts +2 -0
  478. package/dist/node/framework/plugins/vite-plugin-client-imports.js +28 -0
  479. package/dist/node/framework/plugins/vite-plugin-css-modules-rsc.d.ts +2 -0
  480. package/dist/node/framework/plugins/vite-plugin-css-modules-rsc.js +104 -0
  481. package/dist/node/framework/plugins/vite-plugin-hydration-auto-import.d.ts +3 -0
  482. package/dist/node/framework/plugins/vite-plugin-hydration-auto-import.js +40 -0
  483. package/dist/node/framework/plugins/vite-plugin-hydrogen-client-middleware.d.ts +9 -0
  484. package/dist/node/framework/plugins/vite-plugin-hydrogen-client-middleware.js +38 -0
  485. package/dist/node/framework/plugins/vite-plugin-hydrogen-config.d.ts +1 -1
  486. package/dist/node/framework/plugins/vite-plugin-hydrogen-config.js +79 -20
  487. package/dist/node/framework/plugins/vite-plugin-hydrogen-middleware.d.ts +10 -3
  488. package/dist/node/framework/plugins/vite-plugin-hydrogen-middleware.js +48 -7
  489. package/dist/node/framework/plugins/vite-plugin-hydrogen-rsc.d.ts +2 -0
  490. package/dist/node/framework/plugins/vite-plugin-hydrogen-rsc.js +29 -0
  491. package/dist/node/framework/plugins/vite-plugin-hydrogen-suppress-warnings.d.ts +3 -0
  492. package/dist/node/framework/plugins/vite-plugin-hydrogen-suppress-warnings.js +21 -0
  493. package/dist/node/framework/plugins/vite-plugin-hydrogen-virtual-files.d.ts +7 -0
  494. package/dist/node/framework/plugins/vite-plugin-hydrogen-virtual-files.js +107 -0
  495. package/dist/node/framework/plugins/vite-plugin-platform-entry.d.ts +3 -0
  496. package/dist/node/framework/plugins/vite-plugin-platform-entry.js +75 -0
  497. package/dist/node/framework/plugins/vite-plugin-purge-query-cache.d.ts +3 -0
  498. package/dist/node/framework/plugins/vite-plugin-purge-query-cache.js +16 -0
  499. package/dist/node/framework/plugins/vite-plugin-ssr-interop.d.ts +3 -0
  500. package/dist/node/framework/plugins/vite-plugin-ssr-interop.js +18 -0
  501. package/dist/node/framework/types.d.ts +6 -0
  502. package/dist/node/{foundation/ShopifyProvider → framework}/types.js +0 -0
  503. package/dist/node/framework/viteception.d.ts +5 -0
  504. package/dist/node/framework/viteception.js +20 -0
  505. package/dist/node/shared-types.d.ts +27 -0
  506. package/dist/node/shared-types.js +5 -0
  507. package/dist/{esnext/components/Metafield/MetafieldFragment.js → node/utilities/web-api-polyfill.d.ts} +0 -0
  508. package/dist/node/utilities/web-api-polyfill.js +53 -0
  509. package/package.json +101 -56
  510. package/vendor/react-server-dom-vite/LICENSE +21 -0
  511. package/vendor/react-server-dom-vite/README.md +5 -0
  512. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-plugin.js +600 -0
  513. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.browser.development.server.js +1808 -0
  514. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.browser.production.min.server.js +47 -0
  515. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.node.development.server.js +1882 -0
  516. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.node.production.min.server.js +47 -0
  517. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite.development.js +629 -0
  518. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite.production.min.js +19 -0
  519. package/vendor/react-server-dom-vite/esm/package.json +3 -0
  520. package/vendor/react-server-dom-vite/esm/react-server-dom-vite-client-proxy.js +83 -0
  521. package/vendor/react-server-dom-vite/esm/react-server-dom-vite-plugin.js +596 -0
  522. package/vendor/react-server-dom-vite/esm/react-server-dom-vite-writer.browser.server.js +1800 -0
  523. package/vendor/react-server-dom-vite/esm/react-server-dom-vite-writer.node.server.js +1874 -0
  524. package/vendor/react-server-dom-vite/esm/react-server-dom-vite.js +619 -0
  525. package/vendor/react-server-dom-vite/index.js +7 -0
  526. package/vendor/react-server-dom-vite/package.json +67 -0
  527. package/vendor/react-server-dom-vite/plugin.js +3 -0
  528. package/vendor/react-server-dom-vite/writer.browser.server.js +7 -0
  529. package/vendor/react-server-dom-vite/writer.node.server.js +7 -0
  530. package/client.d.ts +0 -1
  531. package/client.js +0 -1
  532. package/dist/esnext/components/BuyNowButton/BuyNowButton.d.ts +0 -12
  533. package/dist/esnext/components/BuyNowButton/BuyNowButton.js +0 -29
  534. package/dist/esnext/components/CartContainer/CartContainer.client.d.ts +0 -9
  535. package/dist/esnext/components/CartContainer/CartContainer.client.js +0 -24
  536. package/dist/esnext/components/CartContainer/index.d.ts +0 -1
  537. package/dist/esnext/components/CartContainer/index.js +0 -1
  538. package/dist/esnext/components/CartLineAttributes/CartLineAttributes.client.d.ts +0 -10
  539. package/dist/esnext/components/CartLineAttributes/CartLineAttributes.client.js +0 -9
  540. package/dist/esnext/components/CartLineAttributes/index.d.ts +0 -1
  541. package/dist/esnext/components/CartLineAttributes/index.js +0 -1
  542. package/dist/esnext/components/CartLineProvider/hooks.d.ts +0 -26
  543. package/dist/esnext/components/CartLineSelectedOptions/CartLineSelectedOptions.client.d.ts +0 -10
  544. package/dist/esnext/components/CartLineSelectedOptions/CartLineSelectedOptions.client.js +0 -9
  545. package/dist/esnext/components/CartLineSelectedOptions/index.d.ts +0 -1
  546. package/dist/esnext/components/CartLineSelectedOptions/index.js +0 -1
  547. package/dist/esnext/components/CartLines/CartLines.d.ts +0 -7
  548. package/dist/esnext/components/CartProvider/CartServerProvider.server.d.ts +0 -11
  549. package/dist/esnext/components/CartProvider/CartServerProvider.server.js +0 -20
  550. package/dist/esnext/components/CartProvider/hooks.d.ts +0 -18
  551. package/dist/esnext/components/CartProvider/hooks.js +0 -79
  552. package/dist/esnext/components/CartToggle/CartToggle.client.d.ts +0 -8
  553. package/dist/esnext/components/CartToggle/CartToggle.client.js +0 -11
  554. package/dist/esnext/components/CartToggle/index.d.ts +0 -1
  555. package/dist/esnext/components/CartToggle/index.js +0 -1
  556. package/dist/esnext/components/CartTotal/CartTotal.client.d.ts +0 -3
  557. package/dist/esnext/components/CartTotal/CartTotal.client.js +0 -8
  558. package/dist/esnext/components/CartTotal/index.d.ts +0 -1
  559. package/dist/esnext/components/CartTotal/index.js +0 -1
  560. package/dist/esnext/components/CartUIProvider/CartUIProvider.client.d.ts +0 -5
  561. package/dist/esnext/components/CartUIProvider/CartUIProvider.client.js +0 -26
  562. package/dist/esnext/components/CartUIProvider/context.d.ts +0 -9
  563. package/dist/esnext/components/CartUIProvider/context.js +0 -2
  564. package/dist/esnext/components/CartUIProvider/hooks.d.ts +0 -1
  565. package/dist/esnext/components/CartUIProvider/hooks.js +0 -9
  566. package/dist/esnext/components/CartUIProvider/index.d.ts +0 -2
  567. package/dist/esnext/components/CartUIProvider/index.js +0 -2
  568. package/dist/esnext/components/ExternalVideo/ExternalVideoFragment.d.ts +0 -4
  569. package/dist/esnext/components/Image/ImageFragment.d.ts +0 -4
  570. package/dist/esnext/components/LocalizationProvider/LocalizationQuery.d.ts +0 -18
  571. package/dist/esnext/components/LocalizationProvider/hooks.d.ts +0 -8
  572. package/dist/esnext/components/LocalizationProvider/hooks.js +0 -17
  573. package/dist/esnext/components/MediaFile/MediaFileFragment.d.ts +0 -22
  574. package/dist/esnext/components/Metafield/MetafieldFragment.d.ts +0 -4
  575. package/dist/esnext/components/Model3D/Model3D.client.d.ts +0 -25
  576. package/dist/esnext/components/Model3D/Model3D.client.js +0 -30
  577. package/dist/esnext/components/Model3D/Model3DFragment.d.ts +0 -11
  578. package/dist/esnext/components/Model3D/Model3DFragment.js +0 -1
  579. package/dist/esnext/components/Model3D/index.d.ts +0 -1
  580. package/dist/esnext/components/Model3D/index.js +0 -1
  581. package/dist/esnext/components/ProductDescription/ProductDescription.client.d.ts +0 -3
  582. package/dist/esnext/components/ProductDescription/ProductDescription.client.js +0 -10
  583. package/dist/esnext/components/ProductDescription/index.d.ts +0 -1
  584. package/dist/esnext/components/ProductDescription/index.js +0 -1
  585. package/dist/esnext/components/ProductMetafield/ProductMetafield.client.d.ts +0 -7
  586. package/dist/esnext/components/ProductMetafield/ProductMetafield.client.js +0 -16
  587. package/dist/esnext/components/ProductMetafield/index.d.ts +0 -1
  588. package/dist/esnext/components/ProductMetafield/index.js +0 -1
  589. package/dist/esnext/components/ProductProvider/ProductProvider.client.d.ts +0 -7
  590. package/dist/esnext/components/ProductProvider/ProductProvider.client.js +0 -35
  591. package/dist/esnext/components/ProductProvider/ProductProviderFragment.d.ts +0 -96
  592. package/dist/esnext/components/ProductProvider/ProductProviderFragment.js +0 -1
  593. package/dist/esnext/components/ProductProvider/context.d.ts +0 -13
  594. package/dist/esnext/components/ProductProvider/context.js +0 -2
  595. package/dist/esnext/components/ProductProvider/hooks.d.ts +0 -1
  596. package/dist/esnext/components/ProductProvider/hooks.js +0 -6
  597. package/dist/esnext/components/ProductProvider/index.d.ts +0 -2
  598. package/dist/esnext/components/ProductProvider/index.js +0 -2
  599. package/dist/esnext/components/ProductProvider/types.d.ts +0 -5
  600. package/dist/esnext/components/ProductTitle/ProductTitle.client.d.ts +0 -3
  601. package/dist/esnext/components/ProductTitle/ProductTitle.client.js +0 -11
  602. package/dist/esnext/components/ProductTitle/index.d.ts +0 -1
  603. package/dist/esnext/components/ProductTitle/index.js +0 -1
  604. package/dist/esnext/components/RawHtml/RawHtml.d.ts +0 -7
  605. package/dist/esnext/components/RawHtml/RawHtml.js +0 -13
  606. package/dist/esnext/components/RawHtml/index.d.ts +0 -1
  607. package/dist/esnext/components/RawHtml/index.js +0 -1
  608. package/dist/esnext/components/SelectedVariantAddToCartButton/SelectedVariantAddToCartButton.client.d.ts +0 -6
  609. package/dist/esnext/components/SelectedVariantAddToCartButton/SelectedVariantAddToCartButton.client.js +0 -12
  610. package/dist/esnext/components/SelectedVariantAddToCartButton/index.d.ts +0 -1
  611. package/dist/esnext/components/SelectedVariantAddToCartButton/index.js +0 -1
  612. package/dist/esnext/components/SelectedVariantBuyNowButton/SelectedVariantBuyNowButton.d.ts +0 -4
  613. package/dist/esnext/components/SelectedVariantBuyNowButton/SelectedVariantBuyNowButton.js +0 -12
  614. package/dist/esnext/components/SelectedVariantBuyNowButton/index.d.ts +0 -1
  615. package/dist/esnext/components/SelectedVariantBuyNowButton/index.js +0 -1
  616. package/dist/esnext/components/SelectedVariantImage/SelectedVariantImage.client.d.ts +0 -6
  617. package/dist/esnext/components/SelectedVariantImage/SelectedVariantImage.client.js +0 -12
  618. package/dist/esnext/components/SelectedVariantImage/index.d.ts +0 -1
  619. package/dist/esnext/components/SelectedVariantImage/index.js +0 -1
  620. package/dist/esnext/components/SelectedVariantMetafield/SelectedVariantMetafield.client.d.ts +0 -7
  621. package/dist/esnext/components/SelectedVariantMetafield/SelectedVariantMetafield.client.js +0 -15
  622. package/dist/esnext/components/SelectedVariantMetafield/index.d.ts +0 -1
  623. package/dist/esnext/components/SelectedVariantMetafield/index.js +0 -1
  624. package/dist/esnext/components/SelectedVariantPrice/SelectedVariantPrice.client.d.ts +0 -6
  625. package/dist/esnext/components/SelectedVariantPrice/SelectedVariantPrice.client.js +0 -18
  626. package/dist/esnext/components/SelectedVariantPrice/index.d.ts +0 -1
  627. package/dist/esnext/components/SelectedVariantPrice/index.js +0 -1
  628. package/dist/esnext/components/SelectedVariantShopPayButton/SelectedVariantShopPayButton.client.d.ts +0 -2
  629. package/dist/esnext/components/SelectedVariantShopPayButton/SelectedVariantShopPayButton.client.js +0 -12
  630. package/dist/esnext/components/SelectedVariantShopPayButton/index.d.ts +0 -1
  631. package/dist/esnext/components/SelectedVariantShopPayButton/index.js +0 -1
  632. package/dist/esnext/components/SelectedVariantUnitPrice/SelectedVariantUnitPrice.client.d.ts +0 -3
  633. package/dist/esnext/components/SelectedVariantUnitPrice/SelectedVariantUnitPrice.client.js +0 -12
  634. package/dist/esnext/components/SelectedVariantUnitPrice/index.d.ts +0 -1
  635. package/dist/esnext/components/SelectedVariantUnitPrice/index.js +0 -1
  636. package/dist/esnext/components/UnitPrice/UnitPrice.client.d.ts +0 -8
  637. package/dist/esnext/components/UnitPrice/UnitPrice.client.js +0 -16
  638. package/dist/esnext/components/UnitPrice/index.d.ts +0 -1
  639. package/dist/esnext/components/UnitPrice/index.js +0 -1
  640. package/dist/esnext/components/Video/VideoFragment.d.ts +0 -11
  641. package/dist/esnext/components/Video/VideoFragment.js +0 -1
  642. package/dist/esnext/foundation/ClientMarker/ClientMarker.d.ts +0 -10
  643. package/dist/esnext/foundation/ClientMarker/ClientMarker.js +0 -25
  644. package/dist/esnext/foundation/ClientMarker/index.d.ts +0 -1
  645. package/dist/esnext/foundation/ClientMarker/index.js +0 -1
  646. package/dist/esnext/foundation/Hydration/Cache.client.d.ts +0 -9
  647. package/dist/esnext/foundation/Hydration/Cache.client.js +0 -131
  648. package/dist/esnext/foundation/Hydration/ClientComponents.server.d.ts +0 -13
  649. package/dist/esnext/foundation/Hydration/ClientComponents.server.js +0 -18
  650. package/dist/esnext/foundation/Hydration/Html.d.ts +0 -5
  651. package/dist/esnext/foundation/Hydration/Html.js +0 -9
  652. package/dist/esnext/foundation/Hydration/HydrationContext.server.d.ts +0 -1
  653. package/dist/esnext/foundation/Hydration/HydrationContext.server.js +0 -2
  654. package/dist/esnext/foundation/Hydration/ServerComponentRequest.server.d.ts +0 -13
  655. package/dist/esnext/foundation/Hydration/ServerComponentRequest.server.js +0 -39
  656. package/dist/esnext/foundation/Hydration/ServerComponentResponse.server.d.ts +0 -18
  657. package/dist/esnext/foundation/Hydration/ServerComponentResponse.server.js +0 -35
  658. package/dist/esnext/foundation/Hydration/react-utils.d.ts +0 -5
  659. package/dist/esnext/foundation/Hydration/react-utils.js +0 -55
  660. package/dist/esnext/foundation/Hydration/wire.server.d.ts +0 -4
  661. package/dist/esnext/foundation/Hydration/wire.server.js +0 -75
  662. package/dist/esnext/foundation/Hydration/writer.server.d.ts +0 -14
  663. package/dist/esnext/foundation/Hydration/writer.server.js +0 -29
  664. package/dist/esnext/foundation/Router/DefaultRoutes.d.ts +0 -20
  665. package/dist/esnext/foundation/Router/DefaultRoutes.js +0 -54
  666. package/dist/esnext/foundation/Router/ServerStateRouter.client.d.ts +0 -6
  667. package/dist/esnext/foundation/Router/ServerStateRouter.client.js +0 -27
  668. package/dist/esnext/foundation/Router/index.d.ts +0 -1
  669. package/dist/esnext/foundation/Router/index.js +0 -1
  670. package/dist/esnext/foundation/ServerStateProvider/ServerStateProvider.client.d.ts +0 -11
  671. package/dist/esnext/foundation/ServerStateProvider/ServerStateProvider.client.js +0 -48
  672. package/dist/esnext/foundation/ServerStateProvider/index.d.ts +0 -1
  673. package/dist/esnext/foundation/ServerStateProvider/index.js +0 -1
  674. package/dist/esnext/foundation/ShopifyProvider/ShopifyContext.d.ts +0 -1
  675. package/dist/esnext/foundation/ShopifyProvider/ShopifyContext.js +0 -2
  676. package/dist/esnext/foundation/ShopifyProvider/ShopifyProvider.d.ts +0 -3
  677. package/dist/esnext/foundation/ShopifyProvider/ShopifyProvider.js +0 -11
  678. package/dist/esnext/foundation/ShopifyProvider/ShopifyServerProvider.server.d.ts +0 -8
  679. package/dist/esnext/foundation/ShopifyProvider/ShopifyServerProvider.server.js +0 -7
  680. package/dist/esnext/foundation/ShopifyProvider/hooks.d.ts +0 -2
  681. package/dist/esnext/foundation/ShopifyProvider/hooks.js +0 -9
  682. package/dist/esnext/framework/plugins/vite-plugin-react-server-components-shim.js +0 -123
  683. package/dist/esnext/framework/server-components.d.ts +0 -12
  684. package/dist/esnext/framework/server-components.js +0 -72
  685. package/dist/esnext/graphql/graphql-constants.d.ts +0 -1295
  686. package/dist/esnext/graphql/graphql-constants.js +0 -2482
  687. package/dist/esnext/handle-event.d.ts +0 -20
  688. package/dist/esnext/handle-event.js +0 -140
  689. package/dist/esnext/handle-worker-event.d.ts +0 -11
  690. package/dist/esnext/handle-worker-event.js +0 -14
  691. package/dist/esnext/hooks/useParsedMetafields/hooks.d.ts +0 -3
  692. package/dist/esnext/hooks/useParsedMetafields/hooks.js +0 -15
  693. package/dist/esnext/hooks/useParsedMetafields/index.d.ts +0 -1
  694. package/dist/esnext/hooks/useParsedMetafields/index.js +0 -1
  695. package/dist/esnext/hooks/useProductOptions/useProductOptions.d.ts +0 -23
  696. package/dist/esnext/hooks/useProductOptions/useProductOptions.js +0 -84
  697. package/dist/esnext/hooks/useQuery/QueryProvider.d.ts +0 -6
  698. package/dist/esnext/hooks/useQuery/QueryProvider.js +0 -13
  699. package/dist/esnext/hooks/useQuery/hooks.d.ts +0 -12
  700. package/dist/esnext/hooks/useQuery/hooks.js +0 -28
  701. package/dist/esnext/hooks/useQuery/index.d.ts +0 -2
  702. package/dist/esnext/hooks/useQuery/index.js +0 -2
  703. package/dist/esnext/utilities/connections.d.ts +0 -2
  704. package/dist/esnext/utilities/connections.js +0 -4
  705. package/dist/esnext/utilities/environment.d.ts +0 -2
  706. package/dist/esnext/utilities/environment.js +0 -2
  707. package/dist/esnext/utilities/metafields.d.ts +0 -2
  708. package/dist/esnext/utilities/metafields.js +0 -32
  709. package/dist/node/foundation/ClientMarker/ClientMarker.d.ts +0 -10
  710. package/dist/node/foundation/ClientMarker/ClientMarker.js +0 -48
  711. package/dist/node/foundation/ClientMarker/index.d.ts +0 -1
  712. package/dist/node/foundation/ClientMarker/index.js +0 -13
  713. package/dist/node/foundation/Hydration/HydrationContext.server.d.ts +0 -1
  714. package/dist/node/foundation/Hydration/HydrationContext.server.js +0 -5
  715. package/dist/node/foundation/Hydration/ServerComponentRequest.server.d.ts +0 -13
  716. package/dist/node/foundation/Hydration/ServerComponentRequest.server.js +0 -43
  717. package/dist/node/foundation/Hydration/ServerComponentResponse.server.d.ts +0 -18
  718. package/dist/node/foundation/Hydration/ServerComponentResponse.server.js +0 -39
  719. package/dist/node/foundation/Hydration/react-utils.d.ts +0 -5
  720. package/dist/node/foundation/Hydration/react-utils.js +0 -63
  721. package/dist/node/foundation/Router/DefaultRoutes.d.ts +0 -20
  722. package/dist/node/foundation/Router/DefaultRoutes.js +0 -78
  723. package/dist/node/foundation/Router/index.d.ts +0 -1
  724. package/dist/node/foundation/Router/index.js +0 -5
  725. package/dist/node/foundation/ShopifyProvider/ShopifyContext.d.ts +0 -1
  726. package/dist/node/foundation/ShopifyProvider/ShopifyContext.js +0 -5
  727. package/dist/node/foundation/ShopifyProvider/ShopifyProvider.d.ts +0 -3
  728. package/dist/node/foundation/ShopifyProvider/ShopifyProvider.js +0 -34
  729. package/dist/node/foundation/ShopifyProvider/ShopifyServerProvider.server.d.ts +0 -8
  730. package/dist/node/foundation/ShopifyProvider/ShopifyServerProvider.server.js +0 -14
  731. package/dist/node/foundation/ShopifyProvider/hooks.d.ts +0 -2
  732. package/dist/node/foundation/ShopifyProvider/hooks.js +0 -13
  733. package/dist/node/foundation/ShopifyProvider/index.d.ts +0 -2
  734. package/dist/node/foundation/ShopifyProvider/index.js +0 -8
  735. package/dist/node/foundation/ShopifyProvider/types.d.ts +0 -12
  736. package/dist/node/foundation/index.d.ts +0 -4
  737. package/dist/node/foundation/index.js +0 -13
  738. package/dist/node/framework/plugins/vite-plugin-react-server-components-shim.js +0 -128
  739. package/dist/node/framework/server-components.d.ts +0 -12
  740. package/dist/node/framework/server-components.js +0 -77
  741. package/dist/node/graphql/types/types.d.ts +0 -5583
  742. package/dist/node/graphql/types/types.js +0 -1417
  743. package/dist/node/handle-event.d.ts +0 -20
  744. package/dist/node/handle-event.js +0 -143
  745. package/dist/node/hooks/useQuery/QueryProvider.d.ts +0 -6
  746. package/dist/node/hooks/useQuery/QueryProvider.js +0 -20
  747. package/dist/node/hooks/useQuery/hooks.d.ts +0 -12
  748. package/dist/node/hooks/useQuery/hooks.js +0 -32
  749. package/dist/node/hooks/useQuery/index.d.ts +0 -2
  750. package/dist/node/hooks/useQuery/index.js +0 -14
  751. package/dist/node/types.d.ts +0 -62
  752. package/dist/node/types.js +0 -2
  753. package/dist/worker/foundation/Hydration/ServerComponentRequest.server.d.ts +0 -13
  754. package/dist/worker/foundation/Hydration/ServerComponentRequest.server.js +0 -39
  755. package/dist/worker/foundation/Hydration/ServerComponentResponse.server.d.ts +0 -18
  756. package/dist/worker/foundation/Hydration/ServerComponentResponse.server.js +0 -35
  757. package/dist/worker/graphql/types/types.d.ts +0 -5583
  758. package/dist/worker/graphql/types/types.js +0 -1414
  759. package/dist/worker/handle-event.d.ts +0 -20
  760. package/dist/worker/handle-event.js +0 -140
  761. package/dist/worker/handle-worker-event.d.ts +0 -11
  762. package/dist/worker/handle-worker-event.js +0 -14
  763. package/dist/worker/types.d.ts +0 -62
  764. package/entry-client.d.ts +0 -1
  765. package/entry-client.js +0 -1
  766. package/entry-server.d.ts +0 -1
  767. package/entry-server.js +0 -1
  768. package/marker.js +0 -1
  769. package/middleware.d.ts +0 -1
  770. package/middleware.js +0 -1
  771. package/plugin.d.ts +0 -1
  772. package/plugin.js +0 -1
  773. package/worker.js +0 -1
@@ -0,0 +1,1800 @@
1
+ /**
2
+ * @license React
3
+ * react-server-dom-vite-writer.browser.server.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */
10
+
11
+ import { __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, createServerContext } from 'react';
12
+
13
+ var assign = Object.assign;
14
+
15
+ var ReactSharedInternals = __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
16
+
17
+ function error(format) {
18
+ {
19
+ {
20
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
21
+ args[_key2 - 1] = arguments[_key2];
22
+ }
23
+
24
+ printWarning('error', format, args);
25
+ }
26
+ }
27
+ }
28
+
29
+ function printWarning(level, format, args) {
30
+ // When changing this logic, you might want to also
31
+ // update consoleWithStackDev.www.js as well.
32
+ {
33
+ var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
34
+ var stack = ReactDebugCurrentFrame.getStackAddendum();
35
+
36
+ if (stack !== '') {
37
+ format += '%s';
38
+ args = args.concat([stack]);
39
+ } // eslint-disable-next-line react-internal/safe-string-coercion
40
+
41
+
42
+ var argsWithFormat = args.map(function (item) {
43
+ return String(item);
44
+ }); // Careful: RN currently depends on this prefix
45
+
46
+ argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
47
+ // breaks IE9: https://github.com/facebook/react/issues/13610
48
+ // eslint-disable-next-line react-internal/no-production-logging
49
+
50
+ Function.prototype.apply.call(console[level], console, argsWithFormat);
51
+ }
52
+ }
53
+
54
+ function scheduleWork(callback) {
55
+ callback();
56
+ }
57
+ var VIEW_SIZE = 512;
58
+ var currentView = null;
59
+ var writtenBytes = 0;
60
+ function beginWriting(destination) {
61
+ currentView = new Uint8Array(VIEW_SIZE);
62
+ writtenBytes = 0;
63
+ }
64
+ function writeChunk(destination, chunk) {
65
+ if (chunk.length === 0) {
66
+ return;
67
+ }
68
+
69
+ if (chunk.length > VIEW_SIZE) {
70
+ // this chunk may overflow a single view which implies it was not
71
+ // one that is cached by the streaming renderer. We will enqueu
72
+ // it directly and expect it is not re-used
73
+ if (writtenBytes > 0) {
74
+ destination.enqueue(new Uint8Array(currentView.buffer, 0, writtenBytes));
75
+ currentView = new Uint8Array(VIEW_SIZE);
76
+ writtenBytes = 0;
77
+ }
78
+
79
+ destination.enqueue(chunk);
80
+ return;
81
+ }
82
+
83
+ var bytesToWrite = chunk;
84
+ var allowableBytes = currentView.length - writtenBytes;
85
+
86
+ if (allowableBytes < bytesToWrite.length) {
87
+ // this chunk would overflow the current view. We enqueue a full view
88
+ // and start a new view with the remaining chunk
89
+ if (allowableBytes === 0) {
90
+ // the current view is already full, send it
91
+ destination.enqueue(currentView);
92
+ } else {
93
+ // fill up the current view and apply the remaining chunk bytes
94
+ // to a new view.
95
+ currentView.set(bytesToWrite.subarray(0, allowableBytes), writtenBytes); // writtenBytes += allowableBytes; // this can be skipped because we are going to immediately reset the view
96
+
97
+ destination.enqueue(currentView);
98
+ bytesToWrite = bytesToWrite.subarray(allowableBytes);
99
+ }
100
+
101
+ currentView = new Uint8Array(VIEW_SIZE);
102
+ writtenBytes = 0;
103
+ }
104
+
105
+ currentView.set(bytesToWrite, writtenBytes);
106
+ writtenBytes += bytesToWrite.length;
107
+ }
108
+ function writeChunkAndReturn(destination, chunk) {
109
+ writeChunk(destination, chunk); // in web streams there is no backpressure so we can alwas write more
110
+
111
+ return true;
112
+ }
113
+ function completeWriting(destination) {
114
+ if (currentView && writtenBytes > 0) {
115
+ destination.enqueue(new Uint8Array(currentView.buffer, 0, writtenBytes));
116
+ currentView = null;
117
+ writtenBytes = 0;
118
+ }
119
+ }
120
+ function close(destination) {
121
+ destination.close();
122
+ }
123
+ var textEncoder = new TextEncoder();
124
+ function stringToChunk(content) {
125
+ return textEncoder.encode(content);
126
+ }
127
+ function stringToPrecomputedChunk(content) {
128
+ return textEncoder.encode(content);
129
+ }
130
+ function closeWithError(destination, error) {
131
+ if (typeof destination.error === 'function') {
132
+ // $FlowFixMe: This is an Error object or the destination accepts other types.
133
+ destination.error(error);
134
+ } else {
135
+ // Earlier implementations doesn't support this method. In that environment you're
136
+ // supposed to throw from a promise returned but we don't return a promise in our
137
+ // approach. We could fork this implementation but this is environment is an edge
138
+ // case to begin with. It's even less common to run this in an older environment.
139
+ // Even then, this is not where errors are supposed to happen and they get reported
140
+ // to a global callback in addition to this anyway. So it's fine just to close this.
141
+ destination.close();
142
+ }
143
+ }
144
+
145
+ // This file is an intermediate layer to translate between Flight
146
+ var stringify = JSON.stringify;
147
+
148
+ function serializeRowHeader(tag, id) {
149
+ return tag + id.toString(16) + ':';
150
+ }
151
+
152
+ function processErrorChunk(request, id, message, stack) {
153
+ var errorInfo = {
154
+ message: message,
155
+ stack: stack
156
+ };
157
+ var row = serializeRowHeader('E', id) + stringify(errorInfo) + '\n';
158
+ return stringToChunk(row);
159
+ }
160
+ function processModelChunk(request, id, model) {
161
+ var json = stringify(model, request.toJSON);
162
+ var row = serializeRowHeader('J', id) + json + '\n';
163
+ return stringToChunk(row);
164
+ }
165
+ function processModuleChunk(request, id, moduleMetaData) {
166
+ var json = stringify(moduleMetaData);
167
+ var row = serializeRowHeader('M', id) + json + '\n';
168
+ return stringToChunk(row);
169
+ }
170
+ function processProviderChunk(request, id, contextName) {
171
+ var row = serializeRowHeader('P', id) + contextName + '\n';
172
+ return stringToChunk(row);
173
+ }
174
+ function processSymbolChunk(request, id, name) {
175
+ var json = stringify(name);
176
+ var row = serializeRowHeader('S', id) + json + '\n';
177
+ return stringToChunk(row);
178
+ }
179
+
180
+ // eslint-disable-next-line no-unused-vars
181
+ var MODULE_TAG = Symbol.for('react.module.reference');
182
+ function getModuleKey(reference) {
183
+ if (typeof reference === 'string') reference = globalThis.__STRING_REFERENCE_INDEX[reference];
184
+ return reference.filepath + '#' + reference.name;
185
+ }
186
+ function isModuleReference(reference) {
187
+ if (typeof reference === 'string') return !!globalThis.__STRING_REFERENCE_INDEX[reference];
188
+ return reference.$$typeof === MODULE_TAG;
189
+ }
190
+ function resolveModuleMetaData(config, moduleReference) {
191
+ if (typeof moduleReference === 'string') moduleReference = globalThis.__STRING_REFERENCE_INDEX[moduleReference];
192
+ return {
193
+ id: moduleReference.filepath,
194
+ name: moduleReference.name
195
+ };
196
+ }
197
+
198
+ // ATTENTION
199
+ // When adding new symbols to this file,
200
+ // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
201
+ // The Symbol used to tag the ReactElement-like types.
202
+ var REACT_ELEMENT_TYPE = Symbol.for('react.element');
203
+ var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
204
+ var REACT_PROVIDER_TYPE = Symbol.for('react.provider');
205
+ var REACT_SERVER_CONTEXT_TYPE = Symbol.for('react.server_context');
206
+ var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
207
+ var REACT_MEMO_TYPE = Symbol.for('react.memo');
208
+ var REACT_LAZY_TYPE = Symbol.for('react.lazy');
209
+ var REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED = Symbol.for('react.default_value');
210
+
211
+ // A reserved attribute.
212
+ // It is handled by React separately and shouldn't be written to the DOM.
213
+ var RESERVED = 0; // A simple string attribute.
214
+ // Attributes that aren't in the filter are presumed to have this type.
215
+
216
+ var STRING = 1; // A string attribute that accepts booleans in React. In HTML, these are called
217
+ // "enumerated" attributes with "true" and "false" as possible values.
218
+ // When true, it should be set to a "true" string.
219
+ // When false, it should be set to a "false" string.
220
+
221
+ var BOOLEANISH_STRING = 2; // A real boolean attribute.
222
+ // When true, it should be present (set either to an empty string or its name).
223
+ // When false, it should be omitted.
224
+
225
+ var BOOLEAN = 3; // An attribute that can be used as a flag as well as with a value.
226
+ // When true, it should be present (set either to an empty string or its name).
227
+ // When false, it should be omitted.
228
+ // For any other value, should be present with that value.
229
+
230
+ var OVERLOADED_BOOLEAN = 4; // An attribute that must be numeric or parse as a numeric.
231
+ // When falsy, it should be removed.
232
+
233
+ var NUMERIC = 5; // An attribute that must be positive numeric or parse as a positive numeric.
234
+ // When falsy, it should be removed.
235
+
236
+ var POSITIVE_NUMERIC = 6;
237
+
238
+ function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL, removeEmptyString) {
239
+ this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN;
240
+ this.attributeName = attributeName;
241
+ this.attributeNamespace = attributeNamespace;
242
+ this.mustUseProperty = mustUseProperty;
243
+ this.propertyName = name;
244
+ this.type = type;
245
+ this.sanitizeURL = sanitizeURL;
246
+ this.removeEmptyString = removeEmptyString;
247
+ } // When adding attributes to this list, be sure to also add them to
248
+ // the `possibleStandardNames` module to ensure casing and incorrect
249
+ // name warnings.
250
+
251
+
252
+ var properties = {}; // These props are reserved by React. They shouldn't be written to the DOM.
253
+
254
+ var reservedProps = ['children', 'dangerouslySetInnerHTML', // TODO: This prevents the assignment of defaultValue to regular
255
+ // elements (not just inputs). Now that ReactDOMInput assigns to the
256
+ // defaultValue property -- do we need this?
257
+ 'defaultValue', 'defaultChecked', 'innerHTML', 'suppressContentEditableWarning', 'suppressHydrationWarning', 'style'];
258
+
259
+ {
260
+ reservedProps.push('innerText', 'textContent');
261
+ }
262
+
263
+ reservedProps.forEach(function (name) {
264
+ properties[name] = new PropertyInfoRecord(name, RESERVED, false, // mustUseProperty
265
+ name, // attributeName
266
+ null, // attributeNamespace
267
+ false, // sanitizeURL
268
+ false);
269
+ }); // A few React string attributes have a different name.
270
+ // This is a mapping from React prop names to the attribute names.
271
+
272
+ [['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor', 'for'], ['httpEquiv', 'http-equiv']].forEach(function (_ref) {
273
+ var name = _ref[0],
274
+ attributeName = _ref[1];
275
+ properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
276
+ attributeName, // attributeName
277
+ null, // attributeNamespace
278
+ false, // sanitizeURL
279
+ false);
280
+ }); // These are "enumerated" HTML attributes that accept "true" and "false".
281
+ // In React, we let users pass `true` and `false` even though technically
282
+ // these aren't boolean attributes (they are coerced to strings).
283
+
284
+ ['contentEditable', 'draggable', 'spellCheck', 'value'].forEach(function (name) {
285
+ properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty
286
+ name.toLowerCase(), // attributeName
287
+ null, // attributeNamespace
288
+ false, // sanitizeURL
289
+ false);
290
+ }); // These are "enumerated" SVG attributes that accept "true" and "false".
291
+ // In React, we let users pass `true` and `false` even though technically
292
+ // these aren't boolean attributes (they are coerced to strings).
293
+ // Since these are SVG attributes, their attribute names are case-sensitive.
294
+
295
+ ['autoReverse', 'externalResourcesRequired', 'focusable', 'preserveAlpha'].forEach(function (name) {
296
+ properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty
297
+ name, // attributeName
298
+ null, // attributeNamespace
299
+ false, // sanitizeURL
300
+ false);
301
+ }); // These are HTML boolean attributes.
302
+
303
+ ['allowFullScreen', 'async', // Note: there is a special case that prevents it from being written to the DOM
304
+ // on the client side because the browsers are inconsistent. Instead we call focus().
305
+ 'autoFocus', 'autoPlay', 'controls', 'default', 'defer', 'disabled', 'disablePictureInPicture', 'disableRemotePlayback', 'formNoValidate', 'hidden', 'loop', 'noModule', 'noValidate', 'open', 'playsInline', 'readOnly', 'required', 'reversed', 'scoped', 'seamless', // Microdata
306
+ 'itemScope'].forEach(function (name) {
307
+ properties[name] = new PropertyInfoRecord(name, BOOLEAN, false, // mustUseProperty
308
+ name.toLowerCase(), // attributeName
309
+ null, // attributeNamespace
310
+ false, // sanitizeURL
311
+ false);
312
+ }); // These are the few React props that we set as DOM properties
313
+ // rather than attributes. These are all booleans.
314
+
315
+ ['checked', // Note: `option.selected` is not updated if `select.multiple` is
316
+ // disabled with `removeAttribute`. We have special logic for handling this.
317
+ 'multiple', 'muted', 'selected' // NOTE: if you add a camelCased prop to this list,
318
+ // you'll need to set attributeName to name.toLowerCase()
319
+ // instead in the assignment below.
320
+ ].forEach(function (name) {
321
+ properties[name] = new PropertyInfoRecord(name, BOOLEAN, true, // mustUseProperty
322
+ name, // attributeName
323
+ null, // attributeNamespace
324
+ false, // sanitizeURL
325
+ false);
326
+ }); // These are HTML attributes that are "overloaded booleans": they behave like
327
+ // booleans, but can also accept a string value.
328
+
329
+ ['capture', 'download' // NOTE: if you add a camelCased prop to this list,
330
+ // you'll need to set attributeName to name.toLowerCase()
331
+ // instead in the assignment below.
332
+ ].forEach(function (name) {
333
+ properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false, // mustUseProperty
334
+ name, // attributeName
335
+ null, // attributeNamespace
336
+ false, // sanitizeURL
337
+ false);
338
+ }); // These are HTML attributes that must be positive numbers.
339
+
340
+ ['cols', 'rows', 'size', 'span' // NOTE: if you add a camelCased prop to this list,
341
+ // you'll need to set attributeName to name.toLowerCase()
342
+ // instead in the assignment below.
343
+ ].forEach(function (name) {
344
+ properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false, // mustUseProperty
345
+ name, // attributeName
346
+ null, // attributeNamespace
347
+ false, // sanitizeURL
348
+ false);
349
+ }); // These are HTML attributes that must be numbers.
350
+
351
+ ['rowSpan', 'start'].forEach(function (name) {
352
+ properties[name] = new PropertyInfoRecord(name, NUMERIC, false, // mustUseProperty
353
+ name.toLowerCase(), // attributeName
354
+ null, // attributeNamespace
355
+ false, // sanitizeURL
356
+ false);
357
+ });
358
+ var CAMELIZE = /[\-\:]([a-z])/g;
359
+
360
+ var capitalize = function (token) {
361
+ return token[1].toUpperCase();
362
+ }; // This is a list of all SVG attributes that need special casing, namespacing,
363
+ // or boolean value assignment. Regular attributes that just accept strings
364
+ // and have the same names are omitted, just like in the HTML attribute filter.
365
+ // Some of these attributes can be hard to find. This list was created by
366
+ // scraping the MDN documentation.
367
+
368
+
369
+ ['accent-height', 'alignment-baseline', 'arabic-form', 'baseline-shift', 'cap-height', 'clip-path', 'clip-rule', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'dominant-baseline', 'enable-background', 'fill-opacity', 'fill-rule', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'glyph-name', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'horiz-adv-x', 'horiz-origin-x', 'image-rendering', 'letter-spacing', 'lighting-color', 'marker-end', 'marker-mid', 'marker-start', 'overline-position', 'overline-thickness', 'paint-order', 'panose-1', 'pointer-events', 'rendering-intent', 'shape-rendering', 'stop-color', 'stop-opacity', 'strikethrough-position', 'strikethrough-thickness', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'text-anchor', 'text-decoration', 'text-rendering', 'underline-position', 'underline-thickness', 'unicode-bidi', 'unicode-range', 'units-per-em', 'v-alphabetic', 'v-hanging', 'v-ideographic', 'v-mathematical', 'vector-effect', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'word-spacing', 'writing-mode', 'xmlns:xlink', 'x-height' // NOTE: if you add a camelCased prop to this list,
370
+ // you'll need to set attributeName to name.toLowerCase()
371
+ // instead in the assignment below.
372
+ ].forEach(function (attributeName) {
373
+ var name = attributeName.replace(CAMELIZE, capitalize);
374
+ properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
375
+ attributeName, null, // attributeNamespace
376
+ false, // sanitizeURL
377
+ false);
378
+ }); // String SVG attributes with the xlink namespace.
379
+
380
+ ['xlink:actuate', 'xlink:arcrole', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type' // NOTE: if you add a camelCased prop to this list,
381
+ // you'll need to set attributeName to name.toLowerCase()
382
+ // instead in the assignment below.
383
+ ].forEach(function (attributeName) {
384
+ var name = attributeName.replace(CAMELIZE, capitalize);
385
+ properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
386
+ attributeName, 'http://www.w3.org/1999/xlink', false, // sanitizeURL
387
+ false);
388
+ }); // String SVG attributes with the xml namespace.
389
+
390
+ ['xml:base', 'xml:lang', 'xml:space' // NOTE: if you add a camelCased prop to this list,
391
+ // you'll need to set attributeName to name.toLowerCase()
392
+ // instead in the assignment below.
393
+ ].forEach(function (attributeName) {
394
+ var name = attributeName.replace(CAMELIZE, capitalize);
395
+ properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
396
+ attributeName, 'http://www.w3.org/XML/1998/namespace', false, // sanitizeURL
397
+ false);
398
+ }); // These attribute exists both in HTML and SVG.
399
+ // The attribute name is case-sensitive in SVG so we can't just use
400
+ // the React name like we do for attributes that exist only in HTML.
401
+
402
+ ['tabIndex', 'crossOrigin'].forEach(function (attributeName) {
403
+ properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty
404
+ attributeName.toLowerCase(), // attributeName
405
+ null, // attributeNamespace
406
+ false, // sanitizeURL
407
+ false);
408
+ }); // These attributes accept URLs. These must not allow javascript: URLS.
409
+ // These will also need to accept Trusted Types object in the future.
410
+
411
+ var xlinkHref = 'xlinkHref';
412
+ properties[xlinkHref] = new PropertyInfoRecord('xlinkHref', STRING, false, // mustUseProperty
413
+ 'xlink:href', 'http://www.w3.org/1999/xlink', true, // sanitizeURL
414
+ false);
415
+ ['src', 'href', 'action', 'formAction'].forEach(function (attributeName) {
416
+ properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty
417
+ attributeName.toLowerCase(), // attributeName
418
+ null, // attributeNamespace
419
+ true, // sanitizeURL
420
+ true);
421
+ });
422
+
423
+ /**
424
+ * CSS properties which accept numbers but are not in units of "px".
425
+ */
426
+ var isUnitlessNumber = {
427
+ animationIterationCount: true,
428
+ aspectRatio: true,
429
+ borderImageOutset: true,
430
+ borderImageSlice: true,
431
+ borderImageWidth: true,
432
+ boxFlex: true,
433
+ boxFlexGroup: true,
434
+ boxOrdinalGroup: true,
435
+ columnCount: true,
436
+ columns: true,
437
+ flex: true,
438
+ flexGrow: true,
439
+ flexPositive: true,
440
+ flexShrink: true,
441
+ flexNegative: true,
442
+ flexOrder: true,
443
+ gridArea: true,
444
+ gridRow: true,
445
+ gridRowEnd: true,
446
+ gridRowSpan: true,
447
+ gridRowStart: true,
448
+ gridColumn: true,
449
+ gridColumnEnd: true,
450
+ gridColumnSpan: true,
451
+ gridColumnStart: true,
452
+ fontWeight: true,
453
+ lineClamp: true,
454
+ lineHeight: true,
455
+ opacity: true,
456
+ order: true,
457
+ orphans: true,
458
+ tabSize: true,
459
+ widows: true,
460
+ zIndex: true,
461
+ zoom: true,
462
+ // SVG-related properties
463
+ fillOpacity: true,
464
+ floodOpacity: true,
465
+ stopOpacity: true,
466
+ strokeDasharray: true,
467
+ strokeDashoffset: true,
468
+ strokeMiterlimit: true,
469
+ strokeOpacity: true,
470
+ strokeWidth: true
471
+ };
472
+ /**
473
+ * @param {string} prefix vendor-specific prefix, eg: Webkit
474
+ * @param {string} key style name, eg: transitionDuration
475
+ * @return {string} style name prefixed with `prefix`, properly camelCased, eg:
476
+ * WebkitTransitionDuration
477
+ */
478
+
479
+ function prefixKey(prefix, key) {
480
+ return prefix + key.charAt(0).toUpperCase() + key.substring(1);
481
+ }
482
+ /**
483
+ * Support style names that may come passed in prefixed by adding permutations
484
+ * of vendor prefixes.
485
+ */
486
+
487
+
488
+ var prefixes = ['Webkit', 'ms', 'Moz', 'O']; // Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an
489
+ // infinite loop, because it iterates over the newly added props too.
490
+
491
+ Object.keys(isUnitlessNumber).forEach(function (prop) {
492
+ prefixes.forEach(function (prefix) {
493
+ isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];
494
+ });
495
+ });
496
+
497
+ var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare
498
+
499
+ function isArray(a) {
500
+ return isArrayImpl(a);
501
+ }
502
+
503
+ var startInlineScript = stringToPrecomputedChunk('<script>');
504
+ var endInlineScript = stringToPrecomputedChunk('</script>');
505
+ var startScriptSrc = stringToPrecomputedChunk('<script src="');
506
+ var startModuleSrc = stringToPrecomputedChunk('<script type="module" src="');
507
+ var endAsyncScript = stringToPrecomputedChunk('" async=""></script>');
508
+
509
+ var textSeparator = stringToPrecomputedChunk('<!-- -->');
510
+
511
+ var styleAttributeStart = stringToPrecomputedChunk(' style="');
512
+ var styleAssign = stringToPrecomputedChunk(':');
513
+ var styleSeparator = stringToPrecomputedChunk(';');
514
+
515
+ var attributeSeparator = stringToPrecomputedChunk(' ');
516
+ var attributeAssign = stringToPrecomputedChunk('="');
517
+ var attributeEnd = stringToPrecomputedChunk('"');
518
+ var attributeEmptyString = stringToPrecomputedChunk('=""');
519
+
520
+ var endOfStartTag = stringToPrecomputedChunk('>');
521
+ var endOfStartTagSelfClosing = stringToPrecomputedChunk('/>');
522
+
523
+ var selectedMarkerAttribute = stringToPrecomputedChunk(' selected=""');
524
+
525
+ var leadingNewline = stringToPrecomputedChunk('\n');
526
+
527
+ var DOCTYPE = stringToPrecomputedChunk('<!DOCTYPE html>');
528
+ var endTag1 = stringToPrecomputedChunk('</');
529
+ var endTag2 = stringToPrecomputedChunk('>');
530
+ // A placeholder is a node inside a hidden partial tree that can be filled in later, but before
531
+ // display. It's never visible to users. We use the template tag because it can be used in every
532
+ // type of parent. <script> tags also work in every other tag except <colgroup>.
533
+
534
+ var placeholder1 = stringToPrecomputedChunk('<template id="');
535
+ var placeholder2 = stringToPrecomputedChunk('"></template>');
536
+
537
+ var startCompletedSuspenseBoundary = stringToPrecomputedChunk('<!--$-->');
538
+ var startPendingSuspenseBoundary1 = stringToPrecomputedChunk('<!--$?--><template id="');
539
+ var startPendingSuspenseBoundary2 = stringToPrecomputedChunk('"></template>');
540
+ var startClientRenderedSuspenseBoundary = stringToPrecomputedChunk('<!--$!-->');
541
+ var endSuspenseBoundary = stringToPrecomputedChunk('<!--/$-->');
542
+ var clientRenderedSuspenseBoundaryError1 = stringToPrecomputedChunk('<template');
543
+ var clientRenderedSuspenseBoundaryErrorAttrInterstitial = stringToPrecomputedChunk('"');
544
+ var clientRenderedSuspenseBoundaryError1A = stringToPrecomputedChunk(' data-dgst="');
545
+ var clientRenderedSuspenseBoundaryError1B = stringToPrecomputedChunk(' data-msg="');
546
+ var clientRenderedSuspenseBoundaryError1C = stringToPrecomputedChunk(' data-stck="');
547
+ var clientRenderedSuspenseBoundaryError2 = stringToPrecomputedChunk('></template>');
548
+ var startSegmentHTML = stringToPrecomputedChunk('<div hidden id="');
549
+ var startSegmentHTML2 = stringToPrecomputedChunk('">');
550
+ var endSegmentHTML = stringToPrecomputedChunk('</div>');
551
+ var startSegmentSVG = stringToPrecomputedChunk('<svg aria-hidden="true" style="display:none" id="');
552
+ var startSegmentSVG2 = stringToPrecomputedChunk('">');
553
+ var endSegmentSVG = stringToPrecomputedChunk('</svg>');
554
+ var startSegmentMathML = stringToPrecomputedChunk('<math aria-hidden="true" style="display:none" id="');
555
+ var startSegmentMathML2 = stringToPrecomputedChunk('">');
556
+ var endSegmentMathML = stringToPrecomputedChunk('</math>');
557
+ var startSegmentTable = stringToPrecomputedChunk('<table hidden id="');
558
+ var startSegmentTable2 = stringToPrecomputedChunk('">');
559
+ var endSegmentTable = stringToPrecomputedChunk('</table>');
560
+ var startSegmentTableBody = stringToPrecomputedChunk('<table hidden><tbody id="');
561
+ var startSegmentTableBody2 = stringToPrecomputedChunk('">');
562
+ var endSegmentTableBody = stringToPrecomputedChunk('</tbody></table>');
563
+ var startSegmentTableRow = stringToPrecomputedChunk('<table hidden><tr id="');
564
+ var startSegmentTableRow2 = stringToPrecomputedChunk('">');
565
+ var endSegmentTableRow = stringToPrecomputedChunk('</tr></table>');
566
+ var startSegmentColGroup = stringToPrecomputedChunk('<table hidden><colgroup id="');
567
+ var startSegmentColGroup2 = stringToPrecomputedChunk('">');
568
+ var endSegmentColGroup = stringToPrecomputedChunk('</colgroup></table>');
569
+ // The following code is the source scripts that we then minify and inline below,
570
+ // with renamed function names that we hope don't collide:
571
+ // const COMMENT_NODE = 8;
572
+ // const SUSPENSE_START_DATA = '$';
573
+ // const SUSPENSE_END_DATA = '/$';
574
+ // const SUSPENSE_PENDING_START_DATA = '$?';
575
+ // const SUSPENSE_FALLBACK_START_DATA = '$!';
576
+ //
577
+ // function clientRenderBoundary(suspenseBoundaryID, errorDigest, errorMsg, errorComponentStack) {
578
+ // // Find the fallback's first element.
579
+ // const suspenseIdNode = document.getElementById(suspenseBoundaryID);
580
+ // if (!suspenseIdNode) {
581
+ // // The user must have already navigated away from this tree.
582
+ // // E.g. because the parent was hydrated.
583
+ // return;
584
+ // }
585
+ // // Find the boundary around the fallback. This is always the previous node.
586
+ // const suspenseNode = suspenseIdNode.previousSibling;
587
+ // // Tag it to be client rendered.
588
+ // suspenseNode.data = SUSPENSE_FALLBACK_START_DATA;
589
+ // // assign error metadata to first sibling
590
+ // let dataset = suspenseIdNode.dataset;
591
+ // if (errorDigest) dataset.dgst = errorDigest;
592
+ // if (errorMsg) dataset.msg = errorMsg;
593
+ // if (errorComponentStack) dataset.stck = errorComponentStack;
594
+ // // Tell React to retry it if the parent already hydrated.
595
+ // if (suspenseNode._reactRetry) {
596
+ // suspenseNode._reactRetry();
597
+ // }
598
+ // }
599
+ //
600
+ // function completeBoundary(suspenseBoundaryID, contentID) {
601
+ // // Find the fallback's first element.
602
+ // const suspenseIdNode = document.getElementById(suspenseBoundaryID);
603
+ // const contentNode = document.getElementById(contentID);
604
+ // // We'll detach the content node so that regardless of what happens next we don't leave in the tree.
605
+ // // This might also help by not causing recalcing each time we move a child from here to the target.
606
+ // contentNode.parentNode.removeChild(contentNode);
607
+ // if (!suspenseIdNode) {
608
+ // // The user must have already navigated away from this tree.
609
+ // // E.g. because the parent was hydrated. That's fine there's nothing to do
610
+ // // but we have to make sure that we already deleted the container node.
611
+ // return;
612
+ // }
613
+ // // Find the boundary around the fallback. This is always the previous node.
614
+ // const suspenseNode = suspenseIdNode.previousSibling;
615
+ //
616
+ // // Clear all the existing children. This is complicated because
617
+ // // there can be embedded Suspense boundaries in the fallback.
618
+ // // This is similar to clearSuspenseBoundary in ReactDOMHostConfig.
619
+ // // TODO: We could avoid this if we never emitted suspense boundaries in fallback trees.
620
+ // // They never hydrate anyway. However, currently we support incrementally loading the fallback.
621
+ // const parentInstance = suspenseNode.parentNode;
622
+ // let node = suspenseNode.nextSibling;
623
+ // let depth = 0;
624
+ // do {
625
+ // if (node && node.nodeType === COMMENT_NODE) {
626
+ // const data = node.data;
627
+ // if (data === SUSPENSE_END_DATA) {
628
+ // if (depth === 0) {
629
+ // break;
630
+ // } else {
631
+ // depth--;
632
+ // }
633
+ // } else if (
634
+ // data === SUSPENSE_START_DATA ||
635
+ // data === SUSPENSE_PENDING_START_DATA ||
636
+ // data === SUSPENSE_FALLBACK_START_DATA
637
+ // ) {
638
+ // depth++;
639
+ // }
640
+ // }
641
+ //
642
+ // const nextNode = node.nextSibling;
643
+ // parentInstance.removeChild(node);
644
+ // node = nextNode;
645
+ // } while (node);
646
+ //
647
+ // const endOfBoundary = node;
648
+ //
649
+ // // Insert all the children from the contentNode between the start and end of suspense boundary.
650
+ // while (contentNode.firstChild) {
651
+ // parentInstance.insertBefore(contentNode.firstChild, endOfBoundary);
652
+ // }
653
+ // suspenseNode.data = SUSPENSE_START_DATA;
654
+ // if (suspenseNode._reactRetry) {
655
+ // suspenseNode._reactRetry();
656
+ // }
657
+ // }
658
+ //
659
+ // function completeSegment(containerID, placeholderID) {
660
+ // const segmentContainer = document.getElementById(containerID);
661
+ // const placeholderNode = document.getElementById(placeholderID);
662
+ // // We always expect both nodes to exist here because, while we might
663
+ // // have navigated away from the main tree, we still expect the detached
664
+ // // tree to exist.
665
+ // segmentContainer.parentNode.removeChild(segmentContainer);
666
+ // while (segmentContainer.firstChild) {
667
+ // placeholderNode.parentNode.insertBefore(
668
+ // segmentContainer.firstChild,
669
+ // placeholderNode,
670
+ // );
671
+ // }
672
+ // placeholderNode.parentNode.removeChild(placeholderNode);
673
+ // }
674
+
675
+ var completeSegmentFunction = 'function $RS(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)}';
676
+ var completeBoundaryFunction = 'function $RC(a,b){a=document.getElementById(a);b=document.getElementById(b);b.parentNode.removeChild(b);if(a){a=a.previousSibling;var f=a.parentNode,c=a.nextSibling,e=0;do{if(c&&8===c.nodeType){var d=c.data;if("/$"===d)if(0===e)break;else e--;else"$"!==d&&"$?"!==d&&"$!"!==d||e++}d=c.nextSibling;f.removeChild(c);c=d}while(c);for(;b.firstChild;)f.insertBefore(b.firstChild,c);a.data="$";a._reactRetry&&a._reactRetry()}}';
677
+ var clientRenderFunction = 'function $RX(b,c,d,e){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),b._reactRetry&&b._reactRetry())}';
678
+ var completeSegmentScript1Full = stringToPrecomputedChunk(completeSegmentFunction + ';$RS("');
679
+ var completeSegmentScript1Partial = stringToPrecomputedChunk('$RS("');
680
+ var completeSegmentScript2 = stringToPrecomputedChunk('","');
681
+ var completeSegmentScript3 = stringToPrecomputedChunk('")</script>');
682
+ var completeBoundaryScript1Full = stringToPrecomputedChunk(completeBoundaryFunction + ';$RC("');
683
+ var completeBoundaryScript1Partial = stringToPrecomputedChunk('$RC("');
684
+ var completeBoundaryScript2 = stringToPrecomputedChunk('","');
685
+ var completeBoundaryScript3 = stringToPrecomputedChunk('")</script>');
686
+ var clientRenderScript1Full = stringToPrecomputedChunk(clientRenderFunction + ';$RX("');
687
+ var clientRenderScript1Partial = stringToPrecomputedChunk('$RX("');
688
+ var clientRenderScript1A = stringToPrecomputedChunk('"');
689
+ var clientRenderScript2 = stringToPrecomputedChunk(')</script>');
690
+ var clientRenderErrorScriptArgInterstitial = stringToPrecomputedChunk(',');
691
+
692
+ var rendererSigil;
693
+
694
+ {
695
+ // Use this to detect multiple renderers using the same context
696
+ rendererSigil = {};
697
+ } // Used to store the parent path of all context overrides in a shared linked list.
698
+ // Forming a reverse tree.
699
+
700
+
701
+ var rootContextSnapshot = null; // We assume that this runtime owns the "current" field on all ReactContext instances.
702
+ // This global (actually thread local) state represents what state all those "current",
703
+ // fields are currently in.
704
+
705
+ var currentActiveSnapshot = null;
706
+
707
+ function popNode(prev) {
708
+ {
709
+ prev.context._currentValue = prev.parentValue;
710
+ }
711
+ }
712
+
713
+ function pushNode(next) {
714
+ {
715
+ next.context._currentValue = next.value;
716
+ }
717
+ }
718
+
719
+ function popToNearestCommonAncestor(prev, next) {
720
+ if (prev === next) ; else {
721
+ popNode(prev);
722
+ var parentPrev = prev.parent;
723
+ var parentNext = next.parent;
724
+
725
+ if (parentPrev === null) {
726
+ if (parentNext !== null) {
727
+ throw new Error('The stacks must reach the root at the same time. This is a bug in React.');
728
+ }
729
+ } else {
730
+ if (parentNext === null) {
731
+ throw new Error('The stacks must reach the root at the same time. This is a bug in React.');
732
+ }
733
+
734
+ popToNearestCommonAncestor(parentPrev, parentNext); // On the way back, we push the new ones that weren't common.
735
+
736
+ pushNode(next);
737
+ }
738
+ }
739
+ }
740
+
741
+ function popAllPrevious(prev) {
742
+ popNode(prev);
743
+ var parentPrev = prev.parent;
744
+
745
+ if (parentPrev !== null) {
746
+ popAllPrevious(parentPrev);
747
+ }
748
+ }
749
+
750
+ function pushAllNext(next) {
751
+ var parentNext = next.parent;
752
+
753
+ if (parentNext !== null) {
754
+ pushAllNext(parentNext);
755
+ }
756
+
757
+ pushNode(next);
758
+ }
759
+
760
+ function popPreviousToCommonLevel(prev, next) {
761
+ popNode(prev);
762
+ var parentPrev = prev.parent;
763
+
764
+ if (parentPrev === null) {
765
+ throw new Error('The depth must equal at least at zero before reaching the root. This is a bug in React.');
766
+ }
767
+
768
+ if (parentPrev.depth === next.depth) {
769
+ // We found the same level. Now we just need to find a shared ancestor.
770
+ popToNearestCommonAncestor(parentPrev, next);
771
+ } else {
772
+ // We must still be deeper.
773
+ popPreviousToCommonLevel(parentPrev, next);
774
+ }
775
+ }
776
+
777
+ function popNextToCommonLevel(prev, next) {
778
+ var parentNext = next.parent;
779
+
780
+ if (parentNext === null) {
781
+ throw new Error('The depth must equal at least at zero before reaching the root. This is a bug in React.');
782
+ }
783
+
784
+ if (prev.depth === parentNext.depth) {
785
+ // We found the same level. Now we just need to find a shared ancestor.
786
+ popToNearestCommonAncestor(prev, parentNext);
787
+ } else {
788
+ // We must still be deeper.
789
+ popNextToCommonLevel(prev, parentNext);
790
+ }
791
+
792
+ pushNode(next);
793
+ } // Perform context switching to the new snapshot.
794
+ // To make it cheap to read many contexts, while not suspending, we make the switch eagerly by
795
+ // updating all the context's current values. That way reads, always just read the current value.
796
+ // At the cost of updating contexts even if they're never read by this subtree.
797
+
798
+
799
+ function switchContext(newSnapshot) {
800
+ // The basic algorithm we need to do is to pop back any contexts that are no longer on the stack.
801
+ // We also need to update any new contexts that are now on the stack with the deepest value.
802
+ // The easiest way to update new contexts is to just reapply them in reverse order from the
803
+ // perspective of the backpointers. To avoid allocating a lot when switching, we use the stack
804
+ // for that. Therefore this algorithm is recursive.
805
+ // 1) First we pop which ever snapshot tree was deepest. Popping old contexts as we go.
806
+ // 2) Then we find the nearest common ancestor from there. Popping old contexts as we go.
807
+ // 3) Then we reapply new contexts on the way back up the stack.
808
+ var prev = currentActiveSnapshot;
809
+ var next = newSnapshot;
810
+
811
+ if (prev !== next) {
812
+ if (prev === null) {
813
+ // $FlowFixMe: This has to be non-null since it's not equal to prev.
814
+ pushAllNext(next);
815
+ } else if (next === null) {
816
+ popAllPrevious(prev);
817
+ } else if (prev.depth === next.depth) {
818
+ popToNearestCommonAncestor(prev, next);
819
+ } else if (prev.depth > next.depth) {
820
+ popPreviousToCommonLevel(prev, next);
821
+ } else {
822
+ popNextToCommonLevel(prev, next);
823
+ }
824
+
825
+ currentActiveSnapshot = next;
826
+ }
827
+ }
828
+ function pushProvider(context, nextValue) {
829
+ var prevValue;
830
+
831
+ {
832
+ prevValue = context._currentValue;
833
+ context._currentValue = nextValue;
834
+
835
+ {
836
+ if (context._currentRenderer !== undefined && context._currentRenderer !== null && context._currentRenderer !== rendererSigil) {
837
+ error('Detected multiple renderers concurrently rendering the ' + 'same context provider. This is currently unsupported.');
838
+ }
839
+
840
+ context._currentRenderer = rendererSigil;
841
+ }
842
+ }
843
+
844
+ var prevNode = currentActiveSnapshot;
845
+ var newNode = {
846
+ parent: prevNode,
847
+ depth: prevNode === null ? 0 : prevNode.depth + 1,
848
+ context: context,
849
+ parentValue: prevValue,
850
+ value: nextValue
851
+ };
852
+ currentActiveSnapshot = newNode;
853
+ return newNode;
854
+ }
855
+ function popProvider() {
856
+ var prevSnapshot = currentActiveSnapshot;
857
+
858
+ if (prevSnapshot === null) {
859
+ throw new Error('Tried to pop a Context at the root of the app. This is a bug in React.');
860
+ }
861
+
862
+ {
863
+ var value = prevSnapshot.parentValue;
864
+
865
+ if (value === REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED) {
866
+ prevSnapshot.context._currentValue = prevSnapshot.context._defaultValue;
867
+ } else {
868
+ prevSnapshot.context._currentValue = value;
869
+ }
870
+ }
871
+
872
+ return currentActiveSnapshot = prevSnapshot.parent;
873
+ }
874
+ function getActiveContext() {
875
+ return currentActiveSnapshot;
876
+ }
877
+ function readContext(context) {
878
+ var value = context._currentValue ;
879
+ return value;
880
+ }
881
+
882
+ var currentRequest = null;
883
+ function prepareToUseHooksForRequest(request) {
884
+ currentRequest = request;
885
+ }
886
+ function resetHooksForRequest() {
887
+ currentRequest = null;
888
+ }
889
+
890
+ function readContext$1(context) {
891
+ {
892
+ if (context.$$typeof !== REACT_SERVER_CONTEXT_TYPE) {
893
+ error('Only ServerContext is supported in Flight');
894
+ }
895
+
896
+ if (currentCache === null) {
897
+ error('Context can only be read while React is rendering. ' + 'In classes, you can read it in the render method or getDerivedStateFromProps. ' + 'In function components, you can read it directly in the function body, but not ' + 'inside Hooks like useReducer() or useMemo().');
898
+ }
899
+ }
900
+
901
+ return readContext(context);
902
+ }
903
+
904
+ var Dispatcher = {
905
+ useMemo: function (nextCreate) {
906
+ return nextCreate();
907
+ },
908
+ useCallback: function (callback) {
909
+ return callback;
910
+ },
911
+ useDebugValue: function () {},
912
+ useDeferredValue: unsupportedHook,
913
+ useTransition: unsupportedHook,
914
+ getCacheForType: function (resourceType) {
915
+ if (!currentCache) {
916
+ throw new Error('Reading the cache is only supported while rendering.');
917
+ }
918
+
919
+ var entry = currentCache.get(resourceType);
920
+
921
+ if (entry === undefined) {
922
+ entry = resourceType(); // TODO: Warn if undefined?
923
+
924
+ currentCache.set(resourceType, entry);
925
+ }
926
+
927
+ return entry;
928
+ },
929
+ readContext: readContext$1,
930
+ useContext: readContext$1,
931
+ useReducer: unsupportedHook,
932
+ useRef: unsupportedHook,
933
+ useState: unsupportedHook,
934
+ useInsertionEffect: unsupportedHook,
935
+ useLayoutEffect: unsupportedHook,
936
+ useImperativeHandle: unsupportedHook,
937
+ useEffect: unsupportedHook,
938
+ useId: useId,
939
+ useMutableSource: unsupportedHook,
940
+ useSyncExternalStore: unsupportedHook,
941
+ useCacheRefresh: function () {
942
+ return unsupportedRefresh;
943
+ }
944
+ };
945
+
946
+ function unsupportedHook() {
947
+ throw new Error('This Hook is not supported in Server Components.');
948
+ }
949
+
950
+ function unsupportedRefresh() {
951
+ if (!currentCache) {
952
+ throw new Error('Refreshing the cache is not supported in Server Components.');
953
+ }
954
+ }
955
+
956
+ var currentCache = null;
957
+ function setCurrentCache(cache) {
958
+ currentCache = cache;
959
+ return currentCache;
960
+ }
961
+ function getCurrentCache() {
962
+ return currentCache;
963
+ }
964
+
965
+ function useId() {
966
+ if (currentRequest === null) {
967
+ throw new Error('useId can only be used while React is rendering');
968
+ }
969
+
970
+ var id = currentRequest.identifierCount++; // use 'S' for Flight components to distinguish from 'R' and 'r' in Fizz/Client
971
+
972
+ return ':' + currentRequest.identifierPrefix + 'S' + id.toString(32) + ':';
973
+ }
974
+
975
+ var ContextRegistry = ReactSharedInternals.ContextRegistry;
976
+ function getOrCreateServerContext(globalName) {
977
+ if (!ContextRegistry[globalName]) {
978
+ ContextRegistry[globalName] = createServerContext(globalName, REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED);
979
+ }
980
+
981
+ return ContextRegistry[globalName];
982
+ }
983
+
984
+ var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
985
+
986
+ function defaultErrorHandler(error) {
987
+ console['error'](error); // Don't transform to our wrapper
988
+ }
989
+
990
+ var OPEN = 0;
991
+ var CLOSING = 1;
992
+ var CLOSED = 2;
993
+ function createRequest(model, bundlerConfig, onError, context, identifierPrefix) {
994
+ var pingedSegments = [];
995
+ var request = {
996
+ status: OPEN,
997
+ fatalError: null,
998
+ destination: null,
999
+ bundlerConfig: bundlerConfig,
1000
+ cache: new Map(),
1001
+ nextChunkId: 0,
1002
+ pendingChunks: 0,
1003
+ pingedSegments: pingedSegments,
1004
+ completedModuleChunks: [],
1005
+ completedJSONChunks: [],
1006
+ completedErrorChunks: [],
1007
+ writtenSymbols: new Map(),
1008
+ writtenModules: new Map(),
1009
+ writtenProviders: new Map(),
1010
+ identifierPrefix: identifierPrefix || '',
1011
+ identifierCount: 1,
1012
+ onError: onError === undefined ? defaultErrorHandler : onError,
1013
+ toJSON: function (key, value) {
1014
+ return resolveModelToJSON(request, this, key, value);
1015
+ }
1016
+ };
1017
+ request.pendingChunks++;
1018
+ var rootContext = createRootContext(context);
1019
+ var rootSegment = createSegment(request, model, rootContext);
1020
+ pingedSegments.push(rootSegment);
1021
+ return request;
1022
+ }
1023
+
1024
+ function createRootContext(reqContext) {
1025
+ return importServerContexts(reqContext);
1026
+ }
1027
+
1028
+ var POP = {};
1029
+
1030
+ function attemptResolveElement(type, key, ref, props) {
1031
+ if (ref !== null && ref !== undefined) {
1032
+ // When the ref moves to the regular props object this will implicitly
1033
+ // throw for functions. We could probably relax it to a DEV warning for other
1034
+ // cases.
1035
+ throw new Error('Refs cannot be used in server components, nor passed to client components.');
1036
+ }
1037
+
1038
+ if (typeof type === 'function') {
1039
+ if (isModuleReference(type)) {
1040
+ // This is a reference to a client component.
1041
+ return [REACT_ELEMENT_TYPE, type, key, props];
1042
+ } // This is a server-side component.
1043
+
1044
+
1045
+ return type(props);
1046
+ } else if (typeof type === 'string') {
1047
+ // This is a host element. E.g. HTML.
1048
+ return [REACT_ELEMENT_TYPE, type, key, props];
1049
+ } else if (typeof type === 'symbol') {
1050
+ if (type === REACT_FRAGMENT_TYPE) {
1051
+ // For key-less fragments, we add a small optimization to avoid serializing
1052
+ // it as a wrapper.
1053
+ // TODO: If a key is specified, we should propagate its key to any children.
1054
+ // Same as if a server component has a key.
1055
+ return props.children;
1056
+ } // This might be a built-in React component. We'll let the client decide.
1057
+ // Any built-in works as long as its props are serializable.
1058
+
1059
+
1060
+ return [REACT_ELEMENT_TYPE, type, key, props];
1061
+ } else if (type != null && typeof type === 'object') {
1062
+ if (isModuleReference(type)) {
1063
+ // This is a reference to a client component.
1064
+ return [REACT_ELEMENT_TYPE, type, key, props];
1065
+ }
1066
+
1067
+ switch (type.$$typeof) {
1068
+ case REACT_LAZY_TYPE:
1069
+ {
1070
+ var payload = type._payload;
1071
+ var init = type._init;
1072
+ var wrappedType = init(payload);
1073
+ return attemptResolveElement(wrappedType, key, ref, props);
1074
+ }
1075
+
1076
+ case REACT_FORWARD_REF_TYPE:
1077
+ {
1078
+ var render = type.render;
1079
+ return render(props, undefined);
1080
+ }
1081
+
1082
+ case REACT_MEMO_TYPE:
1083
+ {
1084
+ return attemptResolveElement(type.type, key, ref, props);
1085
+ }
1086
+
1087
+ case REACT_PROVIDER_TYPE:
1088
+ {
1089
+ pushProvider(type._context, props.value);
1090
+
1091
+ {
1092
+ var extraKeys = Object.keys(props).filter(function (value) {
1093
+ if (value === 'children' || value === 'value') {
1094
+ return false;
1095
+ }
1096
+
1097
+ return true;
1098
+ });
1099
+
1100
+ if (extraKeys.length !== 0) {
1101
+ error('ServerContext can only have a value prop and children. Found: %s', JSON.stringify(extraKeys));
1102
+ }
1103
+ }
1104
+
1105
+ return [REACT_ELEMENT_TYPE, type, key, // Rely on __popProvider being serialized last to pop the provider.
1106
+ {
1107
+ value: props.value,
1108
+ children: props.children,
1109
+ __pop: POP
1110
+ }];
1111
+ }
1112
+ }
1113
+ }
1114
+
1115
+ throw new Error("Unsupported server component type: " + describeValueForErrorMessage(type));
1116
+ }
1117
+
1118
+ function pingSegment(request, segment) {
1119
+ var pingedSegments = request.pingedSegments;
1120
+ pingedSegments.push(segment);
1121
+
1122
+ if (pingedSegments.length === 1) {
1123
+ scheduleWork(function () {
1124
+ return performWork(request);
1125
+ });
1126
+ }
1127
+ }
1128
+
1129
+ function createSegment(request, model, context) {
1130
+ var id = request.nextChunkId++;
1131
+ var segment = {
1132
+ id: id,
1133
+ model: model,
1134
+ context: context,
1135
+ ping: function () {
1136
+ return pingSegment(request, segment);
1137
+ }
1138
+ };
1139
+ return segment;
1140
+ }
1141
+
1142
+ function serializeByValueID(id) {
1143
+ return '$' + id.toString(16);
1144
+ }
1145
+
1146
+ function serializeByRefID(id) {
1147
+ return '@' + id.toString(16);
1148
+ }
1149
+
1150
+ function escapeStringValue(value) {
1151
+ if (value[0] === '$' || value[0] === '@') {
1152
+ // We need to escape $ or @ prefixed strings since we use those to encode
1153
+ // references to IDs and as special symbol values.
1154
+ return '$' + value;
1155
+ } else {
1156
+ return value;
1157
+ }
1158
+ }
1159
+
1160
+ function isObjectPrototype(object) {
1161
+ if (!object) {
1162
+ return false;
1163
+ }
1164
+
1165
+ var ObjectPrototype = Object.prototype;
1166
+
1167
+ if (object === ObjectPrototype) {
1168
+ return true;
1169
+ } // It might be an object from a different Realm which is
1170
+ // still just a plain simple object.
1171
+
1172
+
1173
+ if (Object.getPrototypeOf(object)) {
1174
+ return false;
1175
+ }
1176
+
1177
+ var names = Object.getOwnPropertyNames(object);
1178
+
1179
+ for (var i = 0; i < names.length; i++) {
1180
+ if (!(names[i] in ObjectPrototype)) {
1181
+ return false;
1182
+ }
1183
+ }
1184
+
1185
+ return true;
1186
+ }
1187
+
1188
+ function isSimpleObject(object) {
1189
+ if (!isObjectPrototype(Object.getPrototypeOf(object))) {
1190
+ return false;
1191
+ }
1192
+
1193
+ var names = Object.getOwnPropertyNames(object);
1194
+
1195
+ for (var i = 0; i < names.length; i++) {
1196
+ var descriptor = Object.getOwnPropertyDescriptor(object, names[i]);
1197
+
1198
+ if (!descriptor) {
1199
+ return false;
1200
+ }
1201
+
1202
+ if (!descriptor.enumerable) {
1203
+ if ((names[i] === 'key' || names[i] === 'ref') && typeof descriptor.get === 'function') {
1204
+ // React adds key and ref getters to props objects to issue warnings.
1205
+ // Those getters will not be transferred to the client, but that's ok,
1206
+ // so we'll special case them.
1207
+ continue;
1208
+ }
1209
+
1210
+ return false;
1211
+ }
1212
+ }
1213
+
1214
+ return true;
1215
+ }
1216
+
1217
+ function objectName(object) {
1218
+ var name = Object.prototype.toString.call(object);
1219
+ return name.replace(/^\[object (.*)\]$/, function (m, p0) {
1220
+ return p0;
1221
+ });
1222
+ }
1223
+
1224
+ function describeKeyForErrorMessage(key) {
1225
+ var encodedKey = JSON.stringify(key);
1226
+ return '"' + key + '"' === encodedKey ? key : encodedKey;
1227
+ }
1228
+
1229
+ function describeValueForErrorMessage(value) {
1230
+ switch (typeof value) {
1231
+ case 'string':
1232
+ {
1233
+ return JSON.stringify(value.length <= 10 ? value : value.substr(0, 10) + '...');
1234
+ }
1235
+
1236
+ case 'object':
1237
+ {
1238
+ if (isArray(value)) {
1239
+ return '[...]';
1240
+ }
1241
+
1242
+ var name = objectName(value);
1243
+
1244
+ if (name === 'Object') {
1245
+ return '{...}';
1246
+ }
1247
+
1248
+ return name;
1249
+ }
1250
+
1251
+ case 'function':
1252
+ return 'function';
1253
+
1254
+ default:
1255
+ // eslint-disable-next-line react-internal/safe-string-coercion
1256
+ return String(value);
1257
+ }
1258
+ }
1259
+
1260
+ function describeObjectForErrorMessage(objectOrArray, expandedName) {
1261
+ if (isArray(objectOrArray)) {
1262
+ var str = '[';
1263
+ var array = objectOrArray;
1264
+
1265
+ for (var i = 0; i < array.length; i++) {
1266
+ if (i > 0) {
1267
+ str += ', ';
1268
+ }
1269
+
1270
+ if (i > 6) {
1271
+ str += '...';
1272
+ break;
1273
+ }
1274
+
1275
+ var _value = array[i];
1276
+
1277
+ if ('' + i === expandedName && typeof _value === 'object' && _value !== null) {
1278
+ str += describeObjectForErrorMessage(_value);
1279
+ } else {
1280
+ str += describeValueForErrorMessage(_value);
1281
+ }
1282
+ }
1283
+
1284
+ str += ']';
1285
+ return str;
1286
+ } else {
1287
+ var _str = '{';
1288
+ var object = objectOrArray;
1289
+ var names = Object.keys(object);
1290
+
1291
+ for (var _i = 0; _i < names.length; _i++) {
1292
+ if (_i > 0) {
1293
+ _str += ', ';
1294
+ }
1295
+
1296
+ if (_i > 6) {
1297
+ _str += '...';
1298
+ break;
1299
+ }
1300
+
1301
+ var name = names[_i];
1302
+ _str += describeKeyForErrorMessage(name) + ': ';
1303
+ var _value2 = object[name];
1304
+
1305
+ if (name === expandedName && typeof _value2 === 'object' && _value2 !== null) {
1306
+ _str += describeObjectForErrorMessage(_value2);
1307
+ } else {
1308
+ _str += describeValueForErrorMessage(_value2);
1309
+ }
1310
+ }
1311
+
1312
+ _str += '}';
1313
+ return _str;
1314
+ }
1315
+ }
1316
+
1317
+ var insideContextProps = null;
1318
+ var isInsideContextValue = false;
1319
+ function resolveModelToJSON(request, parent, key, value) {
1320
+ {
1321
+ // $FlowFixMe
1322
+ var originalValue = parent[key];
1323
+
1324
+ if (typeof originalValue === 'object' && originalValue !== value) {
1325
+ error('Only plain objects can be passed to client components from server components. ' + 'Objects with toJSON methods are not supported. Convert it manually ' + 'to a simple value before passing it to props. ' + 'Remove %s from these props: %s', describeKeyForErrorMessage(key), describeObjectForErrorMessage(parent));
1326
+ }
1327
+ } // Special Symbols
1328
+
1329
+
1330
+ switch (value) {
1331
+ case REACT_ELEMENT_TYPE:
1332
+ return '$';
1333
+ }
1334
+
1335
+ {
1336
+ if (parent[0] === REACT_ELEMENT_TYPE && parent[1] && parent[1].$$typeof === REACT_PROVIDER_TYPE && key === '3') {
1337
+ insideContextProps = value;
1338
+ } else if (insideContextProps === parent && key === 'value') {
1339
+ isInsideContextValue = true;
1340
+ } else if (insideContextProps === parent && key === 'children') {
1341
+ isInsideContextValue = false;
1342
+ }
1343
+ } // Resolve server components.
1344
+
1345
+
1346
+ while (typeof value === 'object' && value !== null && (value.$$typeof === REACT_ELEMENT_TYPE || value.$$typeof === REACT_LAZY_TYPE)) {
1347
+ {
1348
+ if (isInsideContextValue) {
1349
+ error('React elements are not allowed in ServerContext');
1350
+ }
1351
+ }
1352
+
1353
+ try {
1354
+ switch (value.$$typeof) {
1355
+ case REACT_ELEMENT_TYPE:
1356
+ {
1357
+ // TODO: Concatenate keys of parents onto children.
1358
+ var element = value; // Attempt to render the server component.
1359
+
1360
+ value = attemptResolveElement(element.type, element.key, element.ref, element.props);
1361
+ break;
1362
+ }
1363
+
1364
+ case REACT_LAZY_TYPE:
1365
+ {
1366
+ var payload = value._payload;
1367
+ var init = value._init;
1368
+ value = init(payload);
1369
+ break;
1370
+ }
1371
+ }
1372
+ } catch (x) {
1373
+ if (typeof x === 'object' && x !== null && typeof x.then === 'function') {
1374
+ // Something suspended, we'll need to create a new segment and resolve it later.
1375
+ request.pendingChunks++;
1376
+ var newSegment = createSegment(request, value, getActiveContext());
1377
+ var ping = newSegment.ping;
1378
+ x.then(ping, ping);
1379
+ return serializeByRefID(newSegment.id);
1380
+ } else {
1381
+ logRecoverableError(request, x); // Something errored. We'll still send everything we have up until this point.
1382
+ // We'll replace this element with a lazy reference that throws on the client
1383
+ // once it gets rendered.
1384
+
1385
+ request.pendingChunks++;
1386
+ var errorId = request.nextChunkId++;
1387
+ emitErrorChunk(request, errorId, x);
1388
+ return serializeByRefID(errorId);
1389
+ }
1390
+ }
1391
+ }
1392
+
1393
+ if (value == null) {
1394
+ return value;
1395
+ }
1396
+
1397
+ if (typeof value === 'object' || isModuleReference(value)) {
1398
+ if (isModuleReference(value)) {
1399
+ var moduleReference = value;
1400
+ var moduleKey = getModuleKey(moduleReference);
1401
+ var writtenModules = request.writtenModules;
1402
+ var existingId = writtenModules.get(moduleKey);
1403
+
1404
+ if (existingId !== undefined) {
1405
+ if (parent[0] === REACT_ELEMENT_TYPE && key === '1') {
1406
+ // If we're encoding the "type" of an element, we can refer
1407
+ // to that by a lazy reference instead of directly since React
1408
+ // knows how to deal with lazy values. This lets us suspend
1409
+ // on this component rather than its parent until the code has
1410
+ // loaded.
1411
+ return serializeByRefID(existingId);
1412
+ }
1413
+
1414
+ return serializeByValueID(existingId);
1415
+ }
1416
+
1417
+ try {
1418
+ var moduleMetaData = resolveModuleMetaData(request.bundlerConfig, moduleReference);
1419
+ request.pendingChunks++;
1420
+ var moduleId = request.nextChunkId++;
1421
+ emitModuleChunk(request, moduleId, moduleMetaData);
1422
+ writtenModules.set(moduleKey, moduleId);
1423
+
1424
+ if (parent[0] === REACT_ELEMENT_TYPE && key === '1') {
1425
+ // If we're encoding the "type" of an element, we can refer
1426
+ // to that by a lazy reference instead of directly since React
1427
+ // knows how to deal with lazy values. This lets us suspend
1428
+ // on this component rather than its parent until the code has
1429
+ // loaded.
1430
+ return serializeByRefID(moduleId);
1431
+ }
1432
+
1433
+ return serializeByValueID(moduleId);
1434
+ } catch (x) {
1435
+ request.pendingChunks++;
1436
+
1437
+ var _errorId = request.nextChunkId++;
1438
+
1439
+ emitErrorChunk(request, _errorId, x);
1440
+ return serializeByValueID(_errorId);
1441
+ }
1442
+ } else if (value.$$typeof === REACT_PROVIDER_TYPE) {
1443
+ var providerKey = value._context._globalName;
1444
+ var writtenProviders = request.writtenProviders;
1445
+ var providerId = writtenProviders.get(key);
1446
+
1447
+ if (providerId === undefined) {
1448
+ request.pendingChunks++;
1449
+ providerId = request.nextChunkId++;
1450
+ writtenProviders.set(providerKey, providerId);
1451
+ emitProviderChunk(request, providerId, providerKey);
1452
+ }
1453
+
1454
+ return serializeByValueID(providerId);
1455
+ } else if (value === POP) {
1456
+ popProvider();
1457
+
1458
+ {
1459
+ insideContextProps = null;
1460
+ isInsideContextValue = false;
1461
+ }
1462
+
1463
+ return undefined;
1464
+ }
1465
+
1466
+ {
1467
+ if (value !== null && !isArray(value)) {
1468
+ // Verify that this is a simple plain object.
1469
+ if (objectName(value) !== 'Object') {
1470
+ error('Only plain objects can be passed to client components from server components. ' + 'Built-ins like %s are not supported. ' + 'Remove %s from these props: %s', objectName(value), describeKeyForErrorMessage(key), describeObjectForErrorMessage(parent));
1471
+ } else if (typeof value === 'object' && !isSimpleObject(value)) {
1472
+ error('Only plain objects can be passed to client components from server components. ' + 'Classes or other objects with methods are not supported. ' + 'Remove %s from these props: %s', describeKeyForErrorMessage(key), describeObjectForErrorMessage(parent, key));
1473
+ } else if (Object.getOwnPropertySymbols) {
1474
+ var symbols = Object.getOwnPropertySymbols(value);
1475
+
1476
+ if (symbols.length > 0) {
1477
+ error('Only plain objects can be passed to client components from server components. ' + 'Objects with symbol properties like %s are not supported. ' + 'Remove %s from these props: %s', symbols[0].description, describeKeyForErrorMessage(key), describeObjectForErrorMessage(parent, key));
1478
+ }
1479
+ }
1480
+ }
1481
+ }
1482
+
1483
+ return value;
1484
+ }
1485
+
1486
+ if (typeof value === 'string') {
1487
+ return escapeStringValue(value);
1488
+ }
1489
+
1490
+ if (typeof value === 'boolean' || typeof value === 'number' || typeof value === 'undefined') {
1491
+ return value;
1492
+ }
1493
+
1494
+ if (typeof value === 'function') {
1495
+ if (/^on[A-Z]/.test(key)) {
1496
+ throw new Error('Event handlers cannot be passed to client component props. ' + ("Remove " + describeKeyForErrorMessage(key) + " from these props if possible: " + describeObjectForErrorMessage(parent) + "\n") + 'If you need interactivity, consider converting part of this to a client component.');
1497
+ } else {
1498
+ throw new Error('Functions cannot be passed directly to client components ' + "because they're not serializable. " + ("Remove " + describeKeyForErrorMessage(key) + " (" + (value.displayName || value.name || 'function') + ") from this object, or avoid the entire object: " + describeObjectForErrorMessage(parent)));
1499
+ }
1500
+ }
1501
+
1502
+ if (typeof value === 'symbol') {
1503
+ var writtenSymbols = request.writtenSymbols;
1504
+
1505
+ var _existingId = writtenSymbols.get(value);
1506
+
1507
+ if (_existingId !== undefined) {
1508
+ return serializeByValueID(_existingId);
1509
+ }
1510
+
1511
+ var name = value.description;
1512
+
1513
+ if (Symbol.for(name) !== value) {
1514
+ throw new Error('Only global symbols received from Symbol.for(...) can be passed to client components. ' + ("The symbol Symbol.for(" + value.description + ") cannot be found among global symbols. ") + ("Remove " + describeKeyForErrorMessage(key) + " from this object, or avoid the entire object: " + describeObjectForErrorMessage(parent)));
1515
+ }
1516
+
1517
+ request.pendingChunks++;
1518
+ var symbolId = request.nextChunkId++;
1519
+ emitSymbolChunk(request, symbolId, name);
1520
+ writtenSymbols.set(value, symbolId);
1521
+ return serializeByValueID(symbolId);
1522
+ } // $FlowFixMe: bigint isn't added to Flow yet.
1523
+
1524
+
1525
+ if (typeof value === 'bigint') {
1526
+ throw new Error("BigInt (" + value + ") is not yet supported in client component props. " + ("Remove " + describeKeyForErrorMessage(key) + " from this object or use a plain number instead: " + describeObjectForErrorMessage(parent)));
1527
+ }
1528
+
1529
+ throw new Error("Type " + typeof value + " is not supported in client component props. " + ("Remove " + describeKeyForErrorMessage(key) + " from this object, or avoid the entire object: " + describeObjectForErrorMessage(parent)));
1530
+ }
1531
+
1532
+ function logRecoverableError(request, error) {
1533
+ var onError = request.onError;
1534
+ onError(error);
1535
+ }
1536
+
1537
+ function fatalError(request, error) {
1538
+ // This is called outside error handling code such as if an error happens in React internals.
1539
+ if (request.destination !== null) {
1540
+ request.status = CLOSED;
1541
+ closeWithError(request.destination, error);
1542
+ } else {
1543
+ request.status = CLOSING;
1544
+ request.fatalError = error;
1545
+ }
1546
+ }
1547
+
1548
+ function emitErrorChunk(request, id, error) {
1549
+ // TODO: We should not leak error messages to the client in prod.
1550
+ // Give this an error code instead and log on the server.
1551
+ // We can serialize the error in DEV as a convenience.
1552
+ var message;
1553
+ var stack = '';
1554
+
1555
+ try {
1556
+ if (error instanceof Error) {
1557
+ // eslint-disable-next-line react-internal/safe-string-coercion
1558
+ message = String(error.message); // eslint-disable-next-line react-internal/safe-string-coercion
1559
+
1560
+ stack = String(error.stack);
1561
+ } else {
1562
+ message = 'Error: ' + error;
1563
+ }
1564
+ } catch (x) {
1565
+ message = 'An error occurred but serializing the error message failed.';
1566
+ }
1567
+
1568
+ var processedChunk = processErrorChunk(request, id, message, stack);
1569
+ request.completedErrorChunks.push(processedChunk);
1570
+ }
1571
+
1572
+ function emitModuleChunk(request, id, moduleMetaData) {
1573
+ var processedChunk = processModuleChunk(request, id, moduleMetaData);
1574
+ request.completedModuleChunks.push(processedChunk);
1575
+ }
1576
+
1577
+ function emitSymbolChunk(request, id, name) {
1578
+ var processedChunk = processSymbolChunk(request, id, name);
1579
+ request.completedModuleChunks.push(processedChunk);
1580
+ }
1581
+
1582
+ function emitProviderChunk(request, id, contextName) {
1583
+ var processedChunk = processProviderChunk(request, id, contextName);
1584
+ request.completedJSONChunks.push(processedChunk);
1585
+ }
1586
+
1587
+ function retrySegment(request, segment) {
1588
+ switchContext(segment.context);
1589
+
1590
+ try {
1591
+ var _value3 = segment.model;
1592
+
1593
+ while (typeof _value3 === 'object' && _value3 !== null && _value3.$$typeof === REACT_ELEMENT_TYPE) {
1594
+ // TODO: Concatenate keys of parents onto children.
1595
+ var element = _value3; // Attempt to render the server component.
1596
+ // Doing this here lets us reuse this same segment if the next component
1597
+ // also suspends.
1598
+
1599
+ segment.model = _value3;
1600
+ _value3 = attemptResolveElement(element.type, element.key, element.ref, element.props);
1601
+ }
1602
+
1603
+ var processedChunk = processModelChunk(request, segment.id, _value3);
1604
+ request.completedJSONChunks.push(processedChunk);
1605
+ } catch (x) {
1606
+ if (typeof x === 'object' && x !== null && typeof x.then === 'function') {
1607
+ // Something suspended again, let's pick it back up later.
1608
+ var ping = segment.ping;
1609
+ x.then(ping, ping);
1610
+ return;
1611
+ } else {
1612
+ logRecoverableError(request, x); // This errored, we need to serialize this error to the
1613
+
1614
+ emitErrorChunk(request, segment.id, x);
1615
+ }
1616
+ }
1617
+ }
1618
+
1619
+ function performWork(request) {
1620
+ var prevDispatcher = ReactCurrentDispatcher.current;
1621
+ var prevCache = getCurrentCache();
1622
+ ReactCurrentDispatcher.current = Dispatcher;
1623
+ setCurrentCache(request.cache);
1624
+ prepareToUseHooksForRequest(request);
1625
+
1626
+ try {
1627
+ var pingedSegments = request.pingedSegments;
1628
+ request.pingedSegments = [];
1629
+
1630
+ for (var i = 0; i < pingedSegments.length; i++) {
1631
+ var segment = pingedSegments[i];
1632
+ retrySegment(request, segment);
1633
+ }
1634
+
1635
+ if (request.destination !== null) {
1636
+ flushCompletedChunks(request, request.destination);
1637
+ }
1638
+ } catch (error) {
1639
+ logRecoverableError(request, error);
1640
+ fatalError(request, error);
1641
+ } finally {
1642
+ ReactCurrentDispatcher.current = prevDispatcher;
1643
+ setCurrentCache(prevCache);
1644
+ resetHooksForRequest();
1645
+ }
1646
+ }
1647
+
1648
+ function flushCompletedChunks(request, destination) {
1649
+ beginWriting();
1650
+
1651
+ try {
1652
+ // We emit module chunks first in the stream so that
1653
+ // they can be preloaded as early as possible.
1654
+ var moduleChunks = request.completedModuleChunks;
1655
+ var i = 0;
1656
+
1657
+ for (; i < moduleChunks.length; i++) {
1658
+ request.pendingChunks--;
1659
+ var chunk = moduleChunks[i];
1660
+ var keepWriting = writeChunkAndReturn(destination, chunk);
1661
+
1662
+ if (!keepWriting) {
1663
+ request.destination = null;
1664
+ i++;
1665
+ break;
1666
+ }
1667
+ }
1668
+
1669
+ moduleChunks.splice(0, i); // Next comes model data.
1670
+
1671
+ var jsonChunks = request.completedJSONChunks;
1672
+ i = 0;
1673
+
1674
+ for (; i < jsonChunks.length; i++) {
1675
+ request.pendingChunks--;
1676
+ var _chunk = jsonChunks[i];
1677
+
1678
+ var _keepWriting = writeChunkAndReturn(destination, _chunk);
1679
+
1680
+ if (!_keepWriting) {
1681
+ request.destination = null;
1682
+ i++;
1683
+ break;
1684
+ }
1685
+ }
1686
+
1687
+ jsonChunks.splice(0, i); // Finally, errors are sent. The idea is that it's ok to delay
1688
+ // any error messages and prioritize display of other parts of
1689
+ // the page.
1690
+
1691
+ var errorChunks = request.completedErrorChunks;
1692
+ i = 0;
1693
+
1694
+ for (; i < errorChunks.length; i++) {
1695
+ request.pendingChunks--;
1696
+ var _chunk2 = errorChunks[i];
1697
+
1698
+ var _keepWriting2 = writeChunkAndReturn(destination, _chunk2);
1699
+
1700
+ if (!_keepWriting2) {
1701
+ request.destination = null;
1702
+ i++;
1703
+ break;
1704
+ }
1705
+ }
1706
+
1707
+ errorChunks.splice(0, i);
1708
+ } finally {
1709
+ completeWriting(destination);
1710
+ }
1711
+
1712
+ if (request.pendingChunks === 0) {
1713
+ // We're done.
1714
+ close(destination);
1715
+ }
1716
+ }
1717
+
1718
+ function startWork(request) {
1719
+ scheduleWork(function () {
1720
+ return performWork(request);
1721
+ });
1722
+ }
1723
+ function startFlowing(request, destination) {
1724
+ if (request.status === CLOSING) {
1725
+ request.status = CLOSED;
1726
+ closeWithError(destination, request.fatalError);
1727
+ return;
1728
+ }
1729
+
1730
+ if (request.status === CLOSED) {
1731
+ return;
1732
+ }
1733
+
1734
+ if (request.destination !== null) {
1735
+ // We're already flowing.
1736
+ return;
1737
+ }
1738
+
1739
+ request.destination = destination;
1740
+
1741
+ try {
1742
+ flushCompletedChunks(request, destination);
1743
+ } catch (error) {
1744
+ logRecoverableError(request, error);
1745
+ fatalError(request, error);
1746
+ }
1747
+ }
1748
+
1749
+ function importServerContexts(contexts) {
1750
+ if (contexts) {
1751
+ var prevContext = getActiveContext();
1752
+ switchContext(rootContextSnapshot);
1753
+
1754
+ for (var i = 0; i < contexts.length; i++) {
1755
+ var _contexts$i = contexts[i],
1756
+ name = _contexts$i[0],
1757
+ _value4 = _contexts$i[1];
1758
+ var context = getOrCreateServerContext(name);
1759
+ pushProvider(context, _value4);
1760
+ }
1761
+
1762
+ var importedContext = getActiveContext();
1763
+ switchContext(prevContext);
1764
+ return importedContext;
1765
+ }
1766
+
1767
+ return rootContextSnapshot;
1768
+ }
1769
+
1770
+ function renderToReadableStream(model, options) {
1771
+ var request = createRequest( // Wrap root in a dummy element that simply adds a flag
1772
+ // to the current dispatcher to check later in the proxies.
1773
+ assign({}, model, {
1774
+ $$typeof: Symbol.for('react.element'),
1775
+ props: {
1776
+ children: model
1777
+ },
1778
+ type: function () {
1779
+ __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentDispatcher.current.isRsc = true;
1780
+ return model;
1781
+ }
1782
+ }), {}, // Manifest, not used
1783
+ options ? options.onError : undefined, options ? options.context : undefined, options ? options.identifierPrefix : undefined);
1784
+ var stream = new ReadableStream({
1785
+ type: 'bytes',
1786
+ start: function (controller) {
1787
+ startWork(request);
1788
+ },
1789
+ pull: function (controller) {
1790
+ startFlowing(request, controller);
1791
+ },
1792
+ cancel: function (reason) {}
1793
+ }, // $FlowFixMe size() methods are not allowed on byte streams.
1794
+ {
1795
+ highWaterMark: 0
1796
+ });
1797
+ return stream;
1798
+ }
1799
+
1800
+ export { renderToReadableStream };