@anker-in/campaign-ui 0.1.10 → 0.2.10-beta.2

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 (790) hide show
  1. package/dist/cjs/components/chat/action.js +1 -1
  2. package/dist/cjs/components/chat/action.js.map +1 -1
  3. package/dist/cjs/components/chat/button.d.ts +1 -1
  4. package/dist/cjs/components/chat/button.js +1 -1
  5. package/dist/cjs/components/chat/button.js.map +1 -1
  6. package/dist/cjs/components/chat/index.js +1 -1
  7. package/dist/cjs/components/chat/index.js.map +2 -2
  8. package/dist/cjs/components/chat/{Messages.d.ts → messages.d.ts} +1 -1
  9. package/dist/cjs/components/chat/messages.js +1 -1
  10. package/dist/cjs/components/chat/messages.js.map +2 -2
  11. package/dist/cjs/components/chat/props.js +1 -1
  12. package/dist/cjs/components/chat/props.js.map +2 -2
  13. package/dist/cjs/components/chat/response.js +1 -1
  14. package/dist/cjs/components/chat/response.js.map +2 -2
  15. package/dist/cjs/components/chat/suggestions.d.ts +1 -1
  16. package/dist/cjs/components/chat/suggestions.js.map +1 -1
  17. package/dist/cjs/components/credits/context/const.d.ts +81 -0
  18. package/dist/cjs/components/credits/context/const.js +2 -0
  19. package/dist/cjs/components/credits/context/const.js.map +7 -0
  20. package/dist/cjs/components/credits/context/hooks/useActivities.d.ts +12 -0
  21. package/dist/cjs/components/credits/context/hooks/useActivities.js +2 -0
  22. package/dist/cjs/components/credits/context/hooks/useActivities.js.map +7 -0
  23. package/dist/cjs/components/credits/context/hooks/useAddressValidate.d.ts +34 -0
  24. package/dist/cjs/components/credits/context/hooks/useAddressValidate.js +2 -0
  25. package/dist/cjs/components/credits/context/hooks/useAddressValidate.js.map +7 -0
  26. package/dist/cjs/components/credits/context/hooks/useAlpcFetch.d.ts +23 -0
  27. package/dist/cjs/components/credits/context/hooks/useAlpcFetch.js +2 -0
  28. package/dist/cjs/components/credits/context/hooks/useAlpcFetch.js.map +7 -0
  29. package/dist/cjs/components/credits/context/hooks/useClickOutside.d.ts +3 -0
  30. package/dist/cjs/components/credits/context/hooks/useClickOutside.js +2 -0
  31. package/dist/cjs/components/credits/context/hooks/useClickOutside.js.map +7 -0
  32. package/dist/cjs/components/credits/context/hooks/useCopy.d.ts +5 -0
  33. package/dist/cjs/components/credits/context/hooks/useCopy.js +2 -0
  34. package/dist/cjs/components/credits/context/hooks/useCopy.js.map +7 -0
  35. package/dist/cjs/components/credits/context/hooks/useCountries.d.ts +8 -0
  36. package/dist/cjs/components/credits/context/hooks/useCountries.js +2 -0
  37. package/dist/cjs/components/credits/context/hooks/useCountries.js.map +7 -0
  38. package/dist/cjs/components/credits/context/hooks/useFirstPurchaseFinished.d.ts +1 -0
  39. package/dist/cjs/components/credits/context/hooks/useFirstPurchaseFinished.js +2 -0
  40. package/dist/cjs/components/credits/context/hooks/useFirstPurchaseFinished.js.map +7 -0
  41. package/dist/cjs/components/credits/context/hooks/useMyRewards.d.ts +14 -0
  42. package/dist/cjs/components/credits/context/hooks/useMyRewards.js +2 -0
  43. package/dist/cjs/components/credits/context/hooks/useMyRewards.js.map +7 -0
  44. package/dist/cjs/components/credits/context/hooks/useReceiptUploaded.d.ts +2 -0
  45. package/dist/cjs/components/credits/context/hooks/useReceiptUploaded.js +2 -0
  46. package/dist/cjs/components/credits/context/hooks/useReceiptUploaded.js.map +7 -0
  47. package/dist/cjs/components/credits/context/hooks/useRedeemAndBuy.d.ts +14 -0
  48. package/dist/cjs/components/credits/context/hooks/useRedeemAndBuy.js +2 -0
  49. package/dist/cjs/components/credits/context/hooks/useRedeemAndBuy.js.map +7 -0
  50. package/dist/cjs/components/credits/context/hooks/useRedeemCoupon.d.ts +17 -0
  51. package/dist/cjs/components/credits/context/hooks/useRedeemCoupon.js +2 -0
  52. package/dist/cjs/components/credits/context/hooks/useRedeemCoupon.js.map +7 -0
  53. package/dist/cjs/components/credits/context/hooks/useRedeemProduct.d.ts +16 -0
  54. package/dist/cjs/components/credits/context/hooks/useRedeemProduct.js +2 -0
  55. package/dist/cjs/components/credits/context/hooks/useRedeemProduct.js.map +7 -0
  56. package/dist/cjs/components/credits/context/hooks/useRedeemableList.d.ts +7 -0
  57. package/dist/cjs/components/credits/context/hooks/useRedeemableList.js +2 -0
  58. package/dist/cjs/components/credits/context/hooks/useRedeemableList.js.map +7 -0
  59. package/dist/cjs/components/credits/context/hooks/useSendEmailValidation.d.ts +1 -0
  60. package/dist/cjs/components/credits/context/hooks/useSendEmailValidation.js +2 -0
  61. package/dist/cjs/components/credits/context/hooks/useSendEmailValidation.js.map +7 -0
  62. package/dist/cjs/components/credits/context/hooks/useSubscribed.d.ts +1 -0
  63. package/dist/cjs/components/credits/context/hooks/useSubscribed.js +2 -0
  64. package/dist/cjs/components/credits/context/hooks/useSubscribed.js.map +7 -0
  65. package/dist/cjs/components/credits/context/hooks/useSubscriptions.d.ts +5 -0
  66. package/dist/cjs/components/credits/context/hooks/useSubscriptions.js +2 -0
  67. package/dist/cjs/components/credits/context/hooks/useSubscriptions.js.map +7 -0
  68. package/dist/cjs/components/credits/context/hooks/useUploadReceipt.d.ts +14 -0
  69. package/dist/cjs/components/credits/context/hooks/useUploadReceipt.js +2 -0
  70. package/dist/cjs/components/credits/context/hooks/useUploadReceipt.js.map +7 -0
  71. package/dist/cjs/components/credits/context/provider.d.ts +49 -0
  72. package/dist/cjs/components/credits/context/provider.js +2 -0
  73. package/dist/cjs/components/credits/context/provider.js.map +7 -0
  74. package/dist/cjs/components/credits/context/response.d.ts +63 -0
  75. package/dist/cjs/components/credits/context/response.js +2 -0
  76. package/dist/cjs/components/credits/context/response.js.map +7 -0
  77. package/dist/cjs/components/credits/context/utils.d.ts +25 -0
  78. package/dist/cjs/components/credits/context/utils.js +2 -0
  79. package/dist/cjs/components/credits/context/utils.js.map +7 -0
  80. package/dist/cjs/components/credits/creditsBanner/index.d.ts +23 -0
  81. package/dist/cjs/components/credits/creditsBanner/index.js +2 -0
  82. package/dist/cjs/components/credits/creditsBanner/index.js.map +7 -0
  83. package/dist/cjs/components/credits/creditsBenefits/benefitItem.d.ts +19 -0
  84. package/dist/cjs/components/credits/creditsBenefits/benefitItem.js +2 -0
  85. package/dist/cjs/components/credits/creditsBenefits/benefitItem.js.map +7 -0
  86. package/dist/cjs/components/credits/creditsBenefits/iconInfo.d.ts +2 -0
  87. package/dist/cjs/components/credits/creditsBenefits/iconInfo.js +2 -0
  88. package/dist/cjs/components/credits/creditsBenefits/iconInfo.js.map +7 -0
  89. package/dist/cjs/components/credits/creditsBenefits/index.d.ts +12 -0
  90. package/dist/cjs/components/credits/creditsBenefits/index.js +4 -0
  91. package/dist/cjs/components/credits/creditsBenefits/index.js.map +7 -0
  92. package/dist/cjs/components/credits/creditsCash/RedeemableItem.d.ts +15 -0
  93. package/dist/cjs/components/credits/creditsCash/RedeemableItem.js +2 -0
  94. package/dist/cjs/components/credits/creditsCash/RedeemableItem.js.map +7 -0
  95. package/dist/cjs/components/credits/creditsCash/index.d.ts +13 -0
  96. package/dist/cjs/components/credits/creditsCash/index.js +2 -0
  97. package/dist/cjs/components/credits/creditsCash/index.js.map +7 -0
  98. package/dist/cjs/components/credits/creditsCash/type.d.ts +47 -0
  99. package/dist/cjs/components/credits/creditsCash/type.js +2 -0
  100. package/dist/cjs/components/credits/creditsCash/type.js.map +7 -0
  101. package/dist/cjs/components/credits/creditsFaq/faqItem/FaqItem.d.ts +13 -0
  102. package/dist/cjs/components/credits/creditsFaq/faqItem/FaqItem.js +2 -0
  103. package/dist/cjs/components/credits/creditsFaq/faqItem/FaqItem.js.map +7 -0
  104. package/dist/cjs/components/credits/creditsFaq/index.d.ts +16 -0
  105. package/dist/cjs/components/credits/creditsFaq/index.js +2 -0
  106. package/dist/cjs/components/credits/creditsFaq/index.js.map +7 -0
  107. package/dist/cjs/components/credits/creditsInfoCard/index.d.ts +20 -0
  108. package/dist/cjs/components/credits/creditsInfoCard/index.js +2 -0
  109. package/dist/cjs/components/credits/creditsInfoCard/index.js.map +7 -0
  110. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/CountrySelect.d.ts +14 -0
  111. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/CountrySelect.js +2 -0
  112. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/CountrySelect.js.map +7 -0
  113. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/FormItem.d.ts +6 -0
  114. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/FormItem.js +2 -0
  115. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/FormItem.js.map +7 -0
  116. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/Input.d.ts +13 -0
  117. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/Input.js +2 -0
  118. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/Input.js.map +7 -0
  119. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/StateSelect.d.ts +15 -0
  120. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/StateSelect.js +2 -0
  121. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/StateSelect.js.map +7 -0
  122. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/index.d.ts +2 -0
  123. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/index.js +2 -0
  124. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/index.js.map +7 -0
  125. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/type.d.ts +26 -0
  126. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/type.js +2 -0
  127. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/type.js.map +7 -0
  128. package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.d.ts +9 -0
  129. package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.js +2 -0
  130. package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.js.map +7 -0
  131. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.d.ts +20 -0
  132. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.js +2 -0
  133. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.js.map +7 -0
  134. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Error.d.ts +8 -0
  135. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Error.js +2 -0
  136. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Error.js.map +7 -0
  137. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Init.d.ts +11 -0
  138. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Init.js +2 -0
  139. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Init.js.map +7 -0
  140. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.d.ts +8 -0
  141. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js +2 -0
  142. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js.map +7 -0
  143. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.d.ts +13 -0
  144. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.js +2 -0
  145. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.js.map +7 -0
  146. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.d.ts +11 -0
  147. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.js +2 -0
  148. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.js.map +7 -0
  149. package/dist/cjs/components/credits/creditsRedeemList/RedeemableItem.d.ts +9 -0
  150. package/dist/cjs/components/credits/creditsRedeemList/RedeemableItem.js +2 -0
  151. package/dist/cjs/components/credits/creditsRedeemList/RedeemableItem.js.map +7 -0
  152. package/dist/cjs/components/credits/creditsRedeemList/index.d.ts +13 -0
  153. package/dist/cjs/components/credits/creditsRedeemList/index.js +2 -0
  154. package/dist/cjs/components/credits/creditsRedeemList/index.js.map +7 -0
  155. package/dist/cjs/components/credits/creditsRedeemList/type.d.ts +77 -0
  156. package/dist/cjs/components/credits/creditsRedeemList/type.js +2 -0
  157. package/dist/cjs/components/credits/creditsRedeemList/type.js.map +7 -0
  158. package/dist/cjs/components/credits/creditsWaysToGetCredits/index.d.ts +2 -0
  159. package/dist/cjs/components/credits/creditsWaysToGetCredits/index.js +2 -0
  160. package/dist/cjs/components/credits/creditsWaysToGetCredits/index.js.map +7 -0
  161. package/dist/cjs/components/credits/creditsWaysToGetCredits/type.d.ts +60 -0
  162. package/dist/cjs/components/credits/creditsWaysToGetCredits/type.js +2 -0
  163. package/dist/cjs/components/credits/creditsWaysToGetCredits/type.js.map +7 -0
  164. package/dist/cjs/components/credits/creditsWaysToGetCredits/useActions.d.ts +96 -0
  165. package/dist/cjs/components/credits/creditsWaysToGetCredits/useActions.js +2 -0
  166. package/dist/cjs/components/credits/creditsWaysToGetCredits/useActions.js.map +7 -0
  167. package/dist/cjs/components/credits/index.d.ts +10 -0
  168. package/dist/cjs/components/credits/index.js +2 -0
  169. package/dist/cjs/components/credits/index.js.map +7 -0
  170. package/dist/cjs/components/credits/modal/MyRewardsModal.d.ts +29 -0
  171. package/dist/cjs/components/credits/modal/MyRewardsModal.js +2 -0
  172. package/dist/cjs/components/credits/modal/MyRewardsModal.js.map +7 -0
  173. package/dist/cjs/components/credits/modal/activitiesModal.d.ts +29 -0
  174. package/dist/cjs/components/credits/modal/activitiesModal.js +2 -0
  175. package/dist/cjs/components/credits/modal/activitiesModal.js.map +7 -0
  176. package/dist/cjs/components/credits/modal/creditsUploadReceiptModal.d.ts +24 -0
  177. package/dist/cjs/components/credits/modal/creditsUploadReceiptModal.js +2 -0
  178. package/dist/cjs/components/credits/modal/creditsUploadReceiptModal.js.map +7 -0
  179. package/dist/cjs/components/credits/modal/loadingDots.d.ts +5 -0
  180. package/dist/cjs/components/credits/modal/loadingDots.js +2 -0
  181. package/dist/cjs/components/credits/modal/loadingDots.js.map +7 -0
  182. package/dist/cjs/components/credits/modal/modalContainer.d.ts +15 -0
  183. package/dist/cjs/components/credits/modal/modalContainer.js +2 -0
  184. package/dist/cjs/components/credits/modal/modalContainer.js.map +7 -0
  185. package/dist/cjs/components/credits/modal/rulesModal.d.ts +7 -0
  186. package/dist/cjs/components/credits/modal/rulesModal.js +2 -0
  187. package/dist/cjs/components/credits/modal/rulesModal.js.map +7 -0
  188. package/dist/cjs/components/credits/modal/tip.d.ts +5 -0
  189. package/dist/cjs/components/credits/modal/tip.js +2 -0
  190. package/dist/cjs/components/credits/modal/tip.js.map +7 -0
  191. package/dist/cjs/components/credits/type.d.ts +55 -0
  192. package/dist/cjs/components/credits/type.js +2 -0
  193. package/dist/cjs/components/credits/type.js.map +7 -0
  194. package/dist/cjs/components/index.d.ts +3 -2
  195. package/dist/cjs/components/index.js +1 -1
  196. package/dist/cjs/components/index.js.map +3 -3
  197. package/dist/cjs/debug-env.d.ts +7 -0
  198. package/dist/cjs/helpers/fetcher.js +1 -1
  199. package/dist/cjs/helpers/fetcher.js.map +2 -2
  200. package/dist/cjs/helpers/index.d.ts +2 -2
  201. package/dist/cjs/helpers/index.js +1 -1
  202. package/dist/cjs/helpers/index.js.map +2 -2
  203. package/dist/cjs/helpers/track.d.ts +15 -0
  204. package/dist/cjs/helpers/track.js +2 -0
  205. package/dist/cjs/helpers/track.js.map +7 -0
  206. package/dist/cjs/index.css +2 -0
  207. package/dist/cjs/index.css.map +7 -0
  208. package/dist/cjs/index.d.ts +7 -1
  209. package/dist/cjs/index.js +1 -1
  210. package/dist/cjs/index.js.map +3 -3
  211. package/dist/cjs/shopify/context/ShopifyProvider.d.ts +10 -0
  212. package/dist/cjs/shopify/fetchers/create-cart.d.ts +13 -0
  213. package/dist/cjs/shopify/fetchers/get-products-by-handles.d.ts +7 -0
  214. package/dist/cjs/shopify/fetchers/index.d.ts +2 -0
  215. package/dist/cjs/shopify/fragments/article.d.ts +2 -0
  216. package/dist/cjs/shopify/fragments/blog.d.ts +1 -0
  217. package/dist/cjs/shopify/fragments/cart.d.ts +1 -0
  218. package/dist/cjs/shopify/fragments/collection.d.ts +1 -0
  219. package/dist/cjs/shopify/fragments/image.d.ts +1 -0
  220. package/dist/cjs/shopify/fragments/index.d.ts +11 -0
  221. package/dist/cjs/shopify/fragments/metafields.d.ts +2 -0
  222. package/dist/cjs/shopify/fragments/page-info.d.ts +1 -0
  223. package/dist/cjs/shopify/fragments/page.d.ts +1 -0
  224. package/dist/cjs/shopify/fragments/product.d.ts +1 -0
  225. package/dist/cjs/shopify/fragments/seo.d.ts +1 -0
  226. package/dist/cjs/shopify/fragments/variant.d.ts +1 -0
  227. package/dist/cjs/shopify/gql/fragment-masking.d.ts +15 -0
  228. package/dist/cjs/shopify/gql/gql.d.ts +87 -0
  229. package/dist/cjs/shopify/gql/graphql.d.ts +7669 -0
  230. package/dist/cjs/shopify/gql/index.d.ts +3 -0
  231. package/dist/cjs/shopify/hooks/index.d.ts +2 -0
  232. package/dist/cjs/shopify/hooks/useCreateCart.d.ts +2 -0
  233. package/dist/cjs/shopify/hooks/useProductsByHandles.d.ts +4 -0
  234. package/dist/cjs/shopify/mutations/create-cart.d.ts +1 -0
  235. package/dist/cjs/shopify/queries/get-product-by-handles.d.ts +1 -0
  236. package/dist/cjs/shopify/queries/index.d.ts +1 -0
  237. package/dist/cjs/shopify/src/index.d.ts +5 -0
  238. package/dist/cjs/shopify/tsup.config.d.ts +2 -0
  239. package/dist/cjs/shopify/types/article.d.ts +48 -0
  240. package/dist/cjs/shopify/types/cart.d.ts +173 -0
  241. package/dist/cjs/shopify/types/checkout.d.ts +42 -0
  242. package/dist/cjs/shopify/types/collection.d.ts +122 -0
  243. package/dist/cjs/shopify/types/common.d.ts +42 -0
  244. package/dist/cjs/shopify/types/config.d.ts +12 -0
  245. package/dist/cjs/shopify/types/customer.d.ts +30 -0
  246. package/dist/cjs/shopify/types/fetcher.d.ts +38 -0
  247. package/dist/cjs/shopify/types/index.d.ts +10 -0
  248. package/dist/cjs/shopify/types/page.d.ts +33 -0
  249. package/dist/cjs/shopify/types/product.d.ts +174 -0
  250. package/dist/cjs/shopify/types/search.d.ts +54 -0
  251. package/dist/cjs/shopify/types/site.d.ts +33 -0
  252. package/dist/cjs/shopify/types/type-helper.d.ts +5 -0
  253. package/dist/cjs/shopify/utils/colors.d.ts +3 -0
  254. package/dist/cjs/shopify/utils/const.d.ts +76 -0
  255. package/dist/cjs/shopify/utils/cookie.d.ts +15 -0
  256. package/dist/cjs/shopify/utils/errors.d.ts +38 -0
  257. package/dist/cjs/shopify/utils/fetch-graphql-api.d.ts +19 -0
  258. package/dist/cjs/shopify/utils/handle-fetch-response.d.ts +5 -0
  259. package/dist/cjs/shopify/utils/helper.d.ts +28 -0
  260. package/dist/cjs/shopify/utils/normalize/cart.d.ts +7 -0
  261. package/dist/cjs/shopify/utils/normalize/customer.d.ts +3 -0
  262. package/dist/cjs/shopify/utils/normalize/index.d.ts +2 -0
  263. package/dist/cjs/shopify/utils/normalize/metafield.d.ts +5 -0
  264. package/dist/cjs/shopify/utils/normalize/product.d.ts +16 -0
  265. package/dist/cjs/shopify/utils/store.d.ts +2 -0
  266. package/dist/cjs/shopify/utils/type-helper.d.ts +5 -0
  267. package/dist/cjs/stories/chat.stories.d.ts +1 -1
  268. package/dist/esm/components/chat/action.js +1 -1
  269. package/dist/esm/components/chat/action.js.map +1 -1
  270. package/dist/esm/components/chat/button.d.ts +1 -1
  271. package/dist/esm/components/chat/button.js +1 -1
  272. package/dist/esm/components/chat/button.js.map +1 -1
  273. package/dist/esm/components/chat/index.js +1 -1
  274. package/dist/esm/components/chat/index.js.map +2 -2
  275. package/dist/esm/components/chat/{Messages.d.ts → messages.d.ts} +1 -1
  276. package/dist/esm/components/chat/messages.js +1 -1
  277. package/dist/esm/components/chat/messages.js.map +2 -2
  278. package/dist/esm/components/chat/props.js +0 -1
  279. package/dist/esm/components/chat/props.js.map +3 -3
  280. package/dist/esm/components/chat/response.js +1 -1
  281. package/dist/esm/components/chat/response.js.map +2 -2
  282. package/dist/esm/components/chat/suggestions.d.ts +1 -1
  283. package/dist/esm/components/chat/suggestions.js.map +1 -1
  284. package/dist/esm/components/credits/context/const.d.ts +81 -0
  285. package/dist/esm/components/credits/context/const.js +2 -0
  286. package/dist/esm/components/credits/context/const.js.map +7 -0
  287. package/dist/esm/components/credits/context/hooks/useActivities.d.ts +12 -0
  288. package/dist/esm/components/credits/context/hooks/useActivities.js +2 -0
  289. package/dist/esm/components/credits/context/hooks/useActivities.js.map +7 -0
  290. package/dist/esm/components/credits/context/hooks/useAddressValidate.d.ts +34 -0
  291. package/dist/esm/components/credits/context/hooks/useAddressValidate.js +2 -0
  292. package/dist/esm/components/credits/context/hooks/useAddressValidate.js.map +7 -0
  293. package/dist/esm/components/credits/context/hooks/useAlpcFetch.d.ts +23 -0
  294. package/dist/esm/components/credits/context/hooks/useAlpcFetch.js +2 -0
  295. package/dist/esm/components/credits/context/hooks/useAlpcFetch.js.map +7 -0
  296. package/dist/esm/components/credits/context/hooks/useClickOutside.d.ts +3 -0
  297. package/dist/esm/components/credits/context/hooks/useClickOutside.js +2 -0
  298. package/dist/esm/components/credits/context/hooks/useClickOutside.js.map +7 -0
  299. package/dist/esm/components/credits/context/hooks/useCopy.d.ts +5 -0
  300. package/dist/esm/components/credits/context/hooks/useCopy.js +2 -0
  301. package/dist/esm/components/credits/context/hooks/useCopy.js.map +7 -0
  302. package/dist/esm/components/credits/context/hooks/useCountries.d.ts +8 -0
  303. package/dist/esm/components/credits/context/hooks/useCountries.js +2 -0
  304. package/dist/esm/components/credits/context/hooks/useCountries.js.map +7 -0
  305. package/dist/esm/components/credits/context/hooks/useFirstPurchaseFinished.d.ts +1 -0
  306. package/dist/esm/components/credits/context/hooks/useFirstPurchaseFinished.js +2 -0
  307. package/dist/esm/components/credits/context/hooks/useFirstPurchaseFinished.js.map +7 -0
  308. package/dist/esm/components/credits/context/hooks/useMyRewards.d.ts +14 -0
  309. package/dist/esm/components/credits/context/hooks/useMyRewards.js +2 -0
  310. package/dist/esm/components/credits/context/hooks/useMyRewards.js.map +7 -0
  311. package/dist/esm/components/credits/context/hooks/useReceiptUploaded.d.ts +2 -0
  312. package/dist/esm/components/credits/context/hooks/useReceiptUploaded.js +2 -0
  313. package/dist/esm/components/credits/context/hooks/useReceiptUploaded.js.map +7 -0
  314. package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.d.ts +14 -0
  315. package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.js +2 -0
  316. package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.js.map +7 -0
  317. package/dist/esm/components/credits/context/hooks/useRedeemCoupon.d.ts +17 -0
  318. package/dist/esm/components/credits/context/hooks/useRedeemCoupon.js +2 -0
  319. package/dist/esm/components/credits/context/hooks/useRedeemCoupon.js.map +7 -0
  320. package/dist/esm/components/credits/context/hooks/useRedeemProduct.d.ts +16 -0
  321. package/dist/esm/components/credits/context/hooks/useRedeemProduct.js +2 -0
  322. package/dist/esm/components/credits/context/hooks/useRedeemProduct.js.map +7 -0
  323. package/dist/esm/components/credits/context/hooks/useRedeemableList.d.ts +7 -0
  324. package/dist/esm/components/credits/context/hooks/useRedeemableList.js +2 -0
  325. package/dist/esm/components/credits/context/hooks/useRedeemableList.js.map +7 -0
  326. package/dist/esm/components/credits/context/hooks/useSendEmailValidation.d.ts +1 -0
  327. package/dist/esm/components/credits/context/hooks/useSendEmailValidation.js +2 -0
  328. package/dist/esm/components/credits/context/hooks/useSendEmailValidation.js.map +7 -0
  329. package/dist/esm/components/credits/context/hooks/useSubscribed.d.ts +1 -0
  330. package/dist/esm/components/credits/context/hooks/useSubscribed.js +2 -0
  331. package/dist/esm/components/credits/context/hooks/useSubscribed.js.map +7 -0
  332. package/dist/esm/components/credits/context/hooks/useSubscriptions.d.ts +5 -0
  333. package/dist/esm/components/credits/context/hooks/useSubscriptions.js +2 -0
  334. package/dist/esm/components/credits/context/hooks/useSubscriptions.js.map +7 -0
  335. package/dist/esm/components/credits/context/hooks/useUploadReceipt.d.ts +14 -0
  336. package/dist/esm/components/credits/context/hooks/useUploadReceipt.js +2 -0
  337. package/dist/esm/components/credits/context/hooks/useUploadReceipt.js.map +7 -0
  338. package/dist/esm/components/credits/context/provider.d.ts +49 -0
  339. package/dist/esm/components/credits/context/provider.js +2 -0
  340. package/dist/esm/components/credits/context/provider.js.map +7 -0
  341. package/dist/esm/components/credits/context/response.d.ts +63 -0
  342. package/dist/esm/components/credits/context/response.js +1 -0
  343. package/dist/esm/components/credits/context/utils.d.ts +25 -0
  344. package/dist/esm/components/credits/context/utils.js +2 -0
  345. package/dist/esm/components/credits/context/utils.js.map +7 -0
  346. package/dist/esm/components/credits/creditsBanner/index.d.ts +23 -0
  347. package/dist/esm/components/credits/creditsBanner/index.js +2 -0
  348. package/dist/esm/components/credits/creditsBanner/index.js.map +7 -0
  349. package/dist/esm/components/credits/creditsBenefits/benefitItem.d.ts +19 -0
  350. package/dist/esm/components/credits/creditsBenefits/benefitItem.js +2 -0
  351. package/dist/esm/components/credits/creditsBenefits/benefitItem.js.map +7 -0
  352. package/dist/esm/components/credits/creditsBenefits/iconInfo.d.ts +2 -0
  353. package/dist/esm/components/credits/creditsBenefits/iconInfo.js +2 -0
  354. package/dist/esm/components/credits/creditsBenefits/iconInfo.js.map +7 -0
  355. package/dist/esm/components/credits/creditsBenefits/index.d.ts +12 -0
  356. package/dist/esm/components/credits/creditsBenefits/index.js +4 -0
  357. package/dist/esm/components/credits/creditsBenefits/index.js.map +7 -0
  358. package/dist/esm/components/credits/creditsCash/RedeemableItem.d.ts +15 -0
  359. package/dist/esm/components/credits/creditsCash/RedeemableItem.js +2 -0
  360. package/dist/esm/components/credits/creditsCash/RedeemableItem.js.map +7 -0
  361. package/dist/esm/components/credits/creditsCash/index.d.ts +13 -0
  362. package/dist/esm/components/credits/creditsCash/index.js +2 -0
  363. package/dist/esm/components/credits/creditsCash/index.js.map +7 -0
  364. package/dist/esm/components/credits/creditsCash/type.d.ts +47 -0
  365. package/dist/esm/components/credits/creditsCash/type.js +1 -0
  366. package/dist/esm/components/credits/creditsFaq/faqItem/FaqItem.d.ts +13 -0
  367. package/dist/esm/components/credits/creditsFaq/faqItem/FaqItem.js +2 -0
  368. package/dist/esm/components/credits/creditsFaq/faqItem/FaqItem.js.map +7 -0
  369. package/dist/esm/components/credits/creditsFaq/index.d.ts +16 -0
  370. package/dist/esm/components/credits/creditsFaq/index.js +2 -0
  371. package/dist/esm/components/credits/creditsFaq/index.js.map +7 -0
  372. package/dist/esm/components/credits/creditsInfoCard/index.d.ts +20 -0
  373. package/dist/esm/components/credits/creditsInfoCard/index.js +2 -0
  374. package/dist/esm/components/credits/creditsInfoCard/index.js.map +7 -0
  375. package/dist/esm/components/credits/creditsRedeemList/AddressForm/CountrySelect.d.ts +14 -0
  376. package/dist/esm/components/credits/creditsRedeemList/AddressForm/CountrySelect.js +2 -0
  377. package/dist/esm/components/credits/creditsRedeemList/AddressForm/CountrySelect.js.map +7 -0
  378. package/dist/esm/components/credits/creditsRedeemList/AddressForm/FormItem.d.ts +6 -0
  379. package/dist/esm/components/credits/creditsRedeemList/AddressForm/FormItem.js +2 -0
  380. package/dist/esm/components/credits/creditsRedeemList/AddressForm/FormItem.js.map +7 -0
  381. package/dist/esm/components/credits/creditsRedeemList/AddressForm/Input.d.ts +13 -0
  382. package/dist/esm/components/credits/creditsRedeemList/AddressForm/Input.js +2 -0
  383. package/dist/esm/components/credits/creditsRedeemList/AddressForm/Input.js.map +7 -0
  384. package/dist/esm/components/credits/creditsRedeemList/AddressForm/StateSelect.d.ts +15 -0
  385. package/dist/esm/components/credits/creditsRedeemList/AddressForm/StateSelect.js +2 -0
  386. package/dist/esm/components/credits/creditsRedeemList/AddressForm/StateSelect.js.map +7 -0
  387. package/dist/esm/components/credits/creditsRedeemList/AddressForm/index.d.ts +2 -0
  388. package/dist/esm/components/credits/creditsRedeemList/AddressForm/index.js +2 -0
  389. package/dist/esm/components/credits/creditsRedeemList/AddressForm/index.js.map +7 -0
  390. package/dist/esm/components/credits/creditsRedeemList/AddressForm/type.d.ts +26 -0
  391. package/dist/esm/components/credits/creditsRedeemList/AddressForm/type.js +1 -0
  392. package/dist/esm/components/credits/creditsRedeemList/AddressForm/type.js.map +7 -0
  393. package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.d.ts +9 -0
  394. package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.js +2 -0
  395. package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.js.map +7 -0
  396. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.d.ts +20 -0
  397. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.js +2 -0
  398. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.js.map +7 -0
  399. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Error.d.ts +8 -0
  400. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Error.js +2 -0
  401. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Error.js.map +7 -0
  402. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.d.ts +11 -0
  403. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.js +2 -0
  404. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.js.map +7 -0
  405. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.d.ts +8 -0
  406. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js +2 -0
  407. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js.map +7 -0
  408. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.d.ts +13 -0
  409. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.js +2 -0
  410. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.js.map +7 -0
  411. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.d.ts +11 -0
  412. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.js +2 -0
  413. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.js.map +7 -0
  414. package/dist/esm/components/credits/creditsRedeemList/RedeemableItem.d.ts +9 -0
  415. package/dist/esm/components/credits/creditsRedeemList/RedeemableItem.js +2 -0
  416. package/dist/esm/components/credits/creditsRedeemList/RedeemableItem.js.map +7 -0
  417. package/dist/esm/components/credits/creditsRedeemList/index.d.ts +13 -0
  418. package/dist/esm/components/credits/creditsRedeemList/index.js +2 -0
  419. package/dist/esm/components/credits/creditsRedeemList/index.js.map +7 -0
  420. package/dist/esm/components/credits/creditsRedeemList/type.d.ts +77 -0
  421. package/dist/esm/components/credits/creditsRedeemList/type.js +1 -0
  422. package/dist/esm/components/credits/creditsRedeemList/type.js.map +7 -0
  423. package/dist/esm/components/credits/creditsWaysToGetCredits/index.d.ts +2 -0
  424. package/dist/esm/components/credits/creditsWaysToGetCredits/index.js +2 -0
  425. package/dist/esm/components/credits/creditsWaysToGetCredits/index.js.map +7 -0
  426. package/dist/esm/components/credits/creditsWaysToGetCredits/type.d.ts +60 -0
  427. package/dist/esm/components/credits/creditsWaysToGetCredits/type.js +2 -0
  428. package/dist/esm/components/credits/creditsWaysToGetCredits/type.js.map +7 -0
  429. package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.d.ts +96 -0
  430. package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.js +2 -0
  431. package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.js.map +7 -0
  432. package/dist/esm/components/credits/index.d.ts +10 -0
  433. package/dist/esm/components/credits/index.js +2 -0
  434. package/dist/esm/components/credits/index.js.map +7 -0
  435. package/dist/esm/components/credits/modal/MyRewardsModal.d.ts +29 -0
  436. package/dist/esm/components/credits/modal/MyRewardsModal.js +2 -0
  437. package/dist/esm/components/credits/modal/MyRewardsModal.js.map +7 -0
  438. package/dist/esm/components/credits/modal/activitiesModal.d.ts +29 -0
  439. package/dist/esm/components/credits/modal/activitiesModal.js +2 -0
  440. package/dist/esm/components/credits/modal/activitiesModal.js.map +7 -0
  441. package/dist/esm/components/credits/modal/creditsUploadReceiptModal.d.ts +24 -0
  442. package/dist/esm/components/credits/modal/creditsUploadReceiptModal.js +2 -0
  443. package/dist/esm/components/credits/modal/creditsUploadReceiptModal.js.map +7 -0
  444. package/dist/esm/components/credits/modal/loadingDots.d.ts +5 -0
  445. package/dist/esm/components/credits/modal/loadingDots.js +2 -0
  446. package/dist/esm/components/credits/modal/loadingDots.js.map +7 -0
  447. package/dist/esm/components/credits/modal/modalContainer.d.ts +15 -0
  448. package/dist/esm/components/credits/modal/modalContainer.js +2 -0
  449. package/dist/esm/components/credits/modal/modalContainer.js.map +7 -0
  450. package/dist/esm/components/credits/modal/rulesModal.d.ts +7 -0
  451. package/dist/esm/components/credits/modal/rulesModal.js +2 -0
  452. package/dist/esm/components/credits/modal/rulesModal.js.map +7 -0
  453. package/dist/esm/components/credits/modal/tip.d.ts +5 -0
  454. package/dist/esm/components/credits/modal/tip.js +2 -0
  455. package/dist/esm/components/credits/modal/tip.js.map +7 -0
  456. package/dist/esm/components/credits/type.d.ts +55 -0
  457. package/dist/esm/components/credits/type.js +1 -0
  458. package/dist/esm/components/credits/type.js.map +7 -0
  459. package/dist/esm/components/index.d.ts +3 -2
  460. package/dist/esm/components/index.js +1 -1
  461. package/dist/esm/components/index.js.map +2 -2
  462. package/dist/esm/debug-env.d.ts +7 -0
  463. package/dist/esm/helpers/fetcher.js +1 -1
  464. package/dist/esm/helpers/fetcher.js.map +2 -2
  465. package/dist/esm/helpers/index.d.ts +2 -2
  466. package/dist/esm/helpers/index.js +1 -1
  467. package/dist/esm/helpers/index.js.map +2 -2
  468. package/dist/esm/helpers/track.d.ts +15 -0
  469. package/dist/esm/helpers/track.js +2 -0
  470. package/dist/esm/helpers/track.js.map +7 -0
  471. package/dist/esm/index.css +2 -0
  472. package/dist/esm/index.css.map +7 -0
  473. package/dist/esm/index.d.ts +7 -1
  474. package/dist/esm/index.js +1 -1
  475. package/dist/esm/index.js.map +3 -3
  476. package/dist/esm/shopify/context/ShopifyProvider.d.ts +10 -0
  477. package/dist/esm/shopify/fetchers/create-cart.d.ts +13 -0
  478. package/dist/esm/shopify/fetchers/get-products-by-handles.d.ts +7 -0
  479. package/dist/esm/shopify/fetchers/index.d.ts +2 -0
  480. package/dist/esm/shopify/fragments/article.d.ts +2 -0
  481. package/dist/esm/shopify/fragments/blog.d.ts +1 -0
  482. package/dist/esm/shopify/fragments/cart.d.ts +1 -0
  483. package/dist/esm/shopify/fragments/collection.d.ts +1 -0
  484. package/dist/esm/shopify/fragments/image.d.ts +1 -0
  485. package/dist/esm/shopify/fragments/index.d.ts +11 -0
  486. package/dist/esm/shopify/fragments/metafields.d.ts +2 -0
  487. package/dist/esm/shopify/fragments/page-info.d.ts +1 -0
  488. package/dist/esm/shopify/fragments/page.d.ts +1 -0
  489. package/dist/esm/shopify/fragments/product.d.ts +1 -0
  490. package/dist/esm/shopify/fragments/seo.d.ts +1 -0
  491. package/dist/esm/shopify/fragments/variant.d.ts +1 -0
  492. package/dist/esm/shopify/gql/fragment-masking.d.ts +15 -0
  493. package/dist/esm/shopify/gql/gql.d.ts +87 -0
  494. package/dist/esm/shopify/gql/graphql.d.ts +7669 -0
  495. package/dist/esm/shopify/gql/index.d.ts +3 -0
  496. package/dist/esm/shopify/hooks/index.d.ts +2 -0
  497. package/dist/esm/shopify/hooks/useCreateCart.d.ts +2 -0
  498. package/dist/esm/shopify/hooks/useProductsByHandles.d.ts +4 -0
  499. package/dist/esm/shopify/mutations/create-cart.d.ts +1 -0
  500. package/dist/esm/shopify/queries/get-product-by-handles.d.ts +1 -0
  501. package/dist/esm/shopify/queries/index.d.ts +1 -0
  502. package/dist/esm/shopify/src/index.d.ts +5 -0
  503. package/dist/esm/shopify/tsup.config.d.ts +2 -0
  504. package/dist/esm/shopify/types/article.d.ts +48 -0
  505. package/dist/esm/shopify/types/cart.d.ts +173 -0
  506. package/dist/esm/shopify/types/checkout.d.ts +42 -0
  507. package/dist/esm/shopify/types/collection.d.ts +122 -0
  508. package/dist/esm/shopify/types/common.d.ts +42 -0
  509. package/dist/esm/shopify/types/config.d.ts +12 -0
  510. package/dist/esm/shopify/types/customer.d.ts +30 -0
  511. package/dist/esm/shopify/types/fetcher.d.ts +38 -0
  512. package/dist/esm/shopify/types/index.d.ts +10 -0
  513. package/dist/esm/shopify/types/page.d.ts +33 -0
  514. package/dist/esm/shopify/types/product.d.ts +174 -0
  515. package/dist/esm/shopify/types/search.d.ts +54 -0
  516. package/dist/esm/shopify/types/site.d.ts +33 -0
  517. package/dist/esm/shopify/types/type-helper.d.ts +5 -0
  518. package/dist/esm/shopify/utils/colors.d.ts +3 -0
  519. package/dist/esm/shopify/utils/const.d.ts +76 -0
  520. package/dist/esm/shopify/utils/cookie.d.ts +15 -0
  521. package/dist/esm/shopify/utils/errors.d.ts +38 -0
  522. package/dist/esm/shopify/utils/fetch-graphql-api.d.ts +19 -0
  523. package/dist/esm/shopify/utils/handle-fetch-response.d.ts +5 -0
  524. package/dist/esm/shopify/utils/helper.d.ts +28 -0
  525. package/dist/esm/shopify/utils/normalize/cart.d.ts +7 -0
  526. package/dist/esm/shopify/utils/normalize/customer.d.ts +3 -0
  527. package/dist/esm/shopify/utils/normalize/index.d.ts +2 -0
  528. package/dist/esm/shopify/utils/normalize/metafield.d.ts +5 -0
  529. package/dist/esm/shopify/utils/normalize/product.d.ts +16 -0
  530. package/dist/esm/shopify/utils/store.d.ts +2 -0
  531. package/dist/esm/shopify/utils/type-helper.d.ts +5 -0
  532. package/dist/esm/stories/chat.stories.d.ts +1 -1
  533. package/package.json +34 -27
  534. package/src/components/chat/button.tsx +1 -1
  535. package/src/components/chat/index.tsx +6 -6
  536. package/src/components/chat/messages.tsx +2 -2
  537. package/src/components/chat/response.tsx +1 -4
  538. package/src/components/chat/suggestions.tsx +1 -1
  539. package/src/components/credits/context/const.ts +103 -0
  540. package/src/components/credits/context/hooks/useActivities.ts +70 -0
  541. package/src/components/credits/context/hooks/useAddressValidate.ts +281 -0
  542. package/src/components/credits/context/hooks/useAlpcFetch.ts +295 -0
  543. package/src/components/credits/context/hooks/useClickOutside.ts +34 -0
  544. package/src/components/credits/context/hooks/useCopy.ts +35 -0
  545. package/src/components/credits/context/hooks/useCountries.ts +55 -0
  546. package/src/components/credits/context/hooks/useFirstPurchaseFinished.ts +24 -0
  547. package/src/components/credits/context/hooks/useMyRewards.ts +97 -0
  548. package/src/components/credits/context/hooks/useReceiptUploaded.ts +24 -0
  549. package/src/components/credits/context/hooks/useRedeemAndBuy.ts +60 -0
  550. package/src/components/credits/context/hooks/useRedeemCoupon.ts +33 -0
  551. package/src/components/credits/context/hooks/useRedeemProduct.ts +34 -0
  552. package/src/components/credits/context/hooks/useRedeemableList.ts +91 -0
  553. package/src/components/credits/context/hooks/useSendEmailValidation.ts +20 -0
  554. package/src/components/credits/context/hooks/useSubscribed.ts +37 -0
  555. package/src/components/credits/context/hooks/useSubscriptions.ts +54 -0
  556. package/src/components/credits/context/hooks/useUploadReceipt.tsx +30 -0
  557. package/src/components/credits/context/provider.tsx +86 -0
  558. package/src/components/credits/context/response.ts +72 -0
  559. package/src/components/credits/context/utils.ts +149 -0
  560. package/src/components/credits/creditsBanner/index.tsx +105 -0
  561. package/src/components/credits/creditsBenefits/benefitItem.tsx +73 -0
  562. package/src/components/credits/creditsBenefits/iconInfo.tsx +23 -0
  563. package/src/components/credits/creditsBenefits/index.tsx +119 -0
  564. package/src/components/credits/creditsCash/RedeemableItem.tsx +216 -0
  565. package/src/components/credits/creditsCash/index.tsx +102 -0
  566. package/src/components/credits/creditsCash/type.ts +46 -0
  567. package/src/components/credits/creditsFaq/faqItem/FaqItem.tsx +95 -0
  568. package/src/components/credits/creditsFaq/index.tsx +86 -0
  569. package/src/components/credits/creditsInfoCard/index.tsx +176 -0
  570. package/src/components/credits/creditsRedeemList/AddressForm/CountrySelect.tsx +111 -0
  571. package/src/components/credits/creditsRedeemList/AddressForm/FormItem.tsx +23 -0
  572. package/src/components/credits/creditsRedeemList/AddressForm/Input.tsx +58 -0
  573. package/src/components/credits/creditsRedeemList/AddressForm/StateSelect.tsx +126 -0
  574. package/src/components/credits/creditsRedeemList/AddressForm/index.tsx +156 -0
  575. package/src/components/credits/creditsRedeemList/AddressForm/type.ts +24 -0
  576. package/src/components/credits/creditsRedeemList/RedeemCouponModal.tsx +213 -0
  577. package/src/components/credits/creditsRedeemList/RedeemProductModal/Address.tsx +72 -0
  578. package/src/components/credits/creditsRedeemList/RedeemProductModal/Error.tsx +14 -0
  579. package/src/components/credits/creditsRedeemList/RedeemProductModal/Init.tsx +129 -0
  580. package/src/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.tsx +72 -0
  581. package/src/components/credits/creditsRedeemList/RedeemProductModal/Success.tsx +45 -0
  582. package/src/components/credits/creditsRedeemList/RedeemProductModal/index.tsx +196 -0
  583. package/src/components/credits/creditsRedeemList/RedeemableItem.tsx +191 -0
  584. package/src/components/credits/creditsRedeemList/index.tsx +195 -0
  585. package/src/components/credits/creditsRedeemList/type.ts +78 -0
  586. package/src/components/credits/creditsWaysToGetCredits/index.tsx +189 -0
  587. package/src/components/credits/creditsWaysToGetCredits/type.ts +64 -0
  588. package/src/components/credits/creditsWaysToGetCredits/useActions.ts +217 -0
  589. package/src/components/credits/index.ts +11 -0
  590. package/src/components/credits/modal/MyRewardsModal.tsx +309 -0
  591. package/src/components/credits/modal/activitiesModal.tsx +248 -0
  592. package/src/components/credits/modal/creditsUploadReceiptModal.tsx +141 -0
  593. package/src/components/credits/modal/loadingDots.tsx +17 -0
  594. package/src/components/credits/modal/modalContainer.tsx +112 -0
  595. package/src/components/credits/modal/rulesModal.tsx +44 -0
  596. package/src/components/credits/modal/tip.tsx +92 -0
  597. package/src/components/credits/type.ts +60 -0
  598. package/src/components/index.ts +4 -2
  599. package/src/debug-env.ts +18 -0
  600. package/src/helpers/fetcher.ts +1 -1
  601. package/src/helpers/index.ts +2 -2
  602. package/src/helpers/track.ts +55 -0
  603. package/src/index.ts +23 -1
  604. package/src/shopify/MIGRATION_GUIDE.md +156 -0
  605. package/src/shopify/context/ShopifyProvider.tsx +34 -0
  606. package/src/shopify/dist/cart-BNkVu3fh.d.ts +220 -0
  607. package/src/shopify/dist/cart-BcrGTPdx.d.cts +220 -0
  608. package/src/shopify/dist/fetchers.cjs +7945 -0
  609. package/src/shopify/dist/fetchers.cjs.map +1 -0
  610. package/src/shopify/dist/fetchers.d.cts +3 -0
  611. package/src/shopify/dist/fetchers.d.ts +3 -0
  612. package/src/shopify/dist/fetchers.js +7942 -0
  613. package/src/shopify/dist/fetchers.js.map +1 -0
  614. package/src/shopify/dist/fragments.cjs +731 -0
  615. package/src/shopify/dist/fragments.cjs.map +1 -0
  616. package/src/shopify/dist/fragments.d.cts +25 -0
  617. package/src/shopify/dist/fragments.d.ts +25 -0
  618. package/src/shopify/dist/fragments.js +705 -0
  619. package/src/shopify/dist/fragments.js.map +1 -0
  620. package/src/shopify/dist/graphql-D4M28V-x.d.cts +3558 -0
  621. package/src/shopify/dist/graphql-D4M28V-x.d.ts +3558 -0
  622. package/src/shopify/dist/hooks.cjs +9431 -0
  623. package/src/shopify/dist/hooks.cjs.map +1 -0
  624. package/src/shopify/dist/hooks.d.cts +14 -0
  625. package/src/shopify/dist/hooks.d.ts +14 -0
  626. package/src/shopify/dist/hooks.js +9427 -0
  627. package/src/shopify/dist/hooks.js.map +1 -0
  628. package/src/shopify/dist/index-BTtE4HZM.d.ts +42 -0
  629. package/src/shopify/dist/index-BjNIecYX.d.cts +42 -0
  630. package/src/shopify/dist/index.cjs +9642 -0
  631. package/src/shopify/dist/index.cjs.map +1 -0
  632. package/src/shopify/dist/index.d.cts +11 -0
  633. package/src/shopify/dist/index.d.ts +11 -0
  634. package/src/shopify/dist/index.js +9619 -0
  635. package/src/shopify/dist/index.js.map +1 -0
  636. package/src/shopify/dist/product-Bqi3sqb9.d.cts +262 -0
  637. package/src/shopify/dist/product-DNk6jYAP.d.ts +262 -0
  638. package/src/shopify/dist/queries.cjs +615 -0
  639. package/src/shopify/dist/queries.cjs.map +1 -0
  640. package/src/shopify/dist/queries.d.cts +3 -0
  641. package/src/shopify/dist/queries.d.ts +3 -0
  642. package/src/shopify/dist/queries.js +601 -0
  643. package/src/shopify/dist/queries.js.map +1 -0
  644. package/src/shopify/dist/types.cjs +19 -0
  645. package/src/shopify/dist/types.cjs.map +1 -0
  646. package/src/shopify/dist/types.d.cts +282 -0
  647. package/src/shopify/dist/types.d.ts +282 -0
  648. package/src/shopify/dist/types.js +1 -0
  649. package/src/shopify/dist/types.js.map +1 -0
  650. package/src/shopify/dist/utils.cjs +334 -0
  651. package/src/shopify/dist/utils.cjs.map +1 -0
  652. package/src/shopify/dist/utils.d.cts +12 -0
  653. package/src/shopify/dist/utils.d.ts +12 -0
  654. package/src/shopify/dist/utils.js +319 -0
  655. package/src/shopify/dist/utils.js.map +1 -0
  656. package/src/shopify/fetchers/create-cart.ts +40 -0
  657. package/src/shopify/fetchers/get-products-by-handles.ts +41 -0
  658. package/src/shopify/fetchers/index.ts +3 -0
  659. package/src/shopify/fragments/article.ts +51 -0
  660. package/src/shopify/fragments/blog.ts +10 -0
  661. package/src/shopify/fragments/cart.ts +190 -0
  662. package/src/shopify/fragments/collection.ts +15 -0
  663. package/src/shopify/fragments/image.ts +8 -0
  664. package/src/shopify/fragments/index.ts +11 -0
  665. package/src/shopify/fragments/metafields.ts +17 -0
  666. package/src/shopify/fragments/page-info.ts +8 -0
  667. package/src/shopify/fragments/page.ts +12 -0
  668. package/src/shopify/fragments/product.ts +71 -0
  669. package/src/shopify/fragments/seo.ts +6 -0
  670. package/src/shopify/fragments/variant.ts +29 -0
  671. package/src/shopify/gql/fragment-masking.ts +85 -0
  672. package/src/shopify/gql/gql.ts +110 -0
  673. package/src/shopify/gql/graphql.ts +11780 -0
  674. package/src/shopify/gql/index.ts +4 -0
  675. package/src/shopify/hooks/index.ts +2 -0
  676. package/src/shopify/hooks/useCreateCart.ts +24 -0
  677. package/src/shopify/hooks/useProductsByHandles.ts +25 -0
  678. package/src/shopify/mutations/create-cart.ts +16 -0
  679. package/src/shopify/package.json +84 -0
  680. package/src/shopify/queries/get-product-by-handles.ts +32 -0
  681. package/src/shopify/queries/index.ts +2 -0
  682. package/src/shopify/src/index.ts +5 -0
  683. package/src/shopify/tsconfig.json +25 -0
  684. package/src/shopify/tsup.config.ts +21 -0
  685. package/src/shopify/types/article.ts +46 -0
  686. package/src/shopify/types/cart.ts +202 -0
  687. package/src/shopify/types/checkout.ts +44 -0
  688. package/src/shopify/types/collection.ts +104 -0
  689. package/src/shopify/types/common.ts +53 -0
  690. package/src/shopify/types/config.ts +14 -0
  691. package/src/shopify/types/customer.ts +31 -0
  692. package/src/shopify/types/fetcher.ts +61 -0
  693. package/src/shopify/types/index.ts +10 -0
  694. package/src/shopify/types/page.ts +45 -0
  695. package/src/shopify/types/product.ts +176 -0
  696. package/src/shopify/types/search.ts +62 -0
  697. package/src/shopify/types/site.ts +38 -0
  698. package/src/shopify/types/type-helper.ts +5 -0
  699. package/src/shopify/utils/colors.ts +206 -0
  700. package/src/shopify/utils/const.ts +115 -0
  701. package/src/shopify/utils/cookie.ts +39 -0
  702. package/src/shopify/utils/errors.ts +65 -0
  703. package/src/shopify/utils/fetch-graphql-api.ts +67 -0
  704. package/src/shopify/utils/handle-fetch-response.ts +60 -0
  705. package/src/shopify/utils/helper.ts +89 -0
  706. package/src/shopify/utils/normalize/cart.ts +106 -0
  707. package/src/shopify/utils/normalize/customer.ts +18 -0
  708. package/src/shopify/utils/normalize/index.ts +2 -0
  709. package/src/shopify/utils/normalize/metafield.ts +69 -0
  710. package/src/shopify/utils/normalize/product.ts +193 -0
  711. package/src/shopify/utils/store.ts +5 -0
  712. package/src/shopify/utils/type-helper.ts +7 -0
  713. package/src/stories/chat.stories.tsx +1 -1
  714. package/tailwind.config.ts +72 -0
  715. package/dist/cjs/components/animation/CodeEditor.d.ts +0 -7
  716. package/dist/cjs/components/animation/CodeEditor.js +0 -2
  717. package/dist/cjs/components/animation/CodeEditor.js.map +0 -7
  718. package/dist/cjs/components/animation/Preview.d.ts +0 -5
  719. package/dist/cjs/components/animation/Preview.js +0 -2
  720. package/dist/cjs/components/animation/Preview.js.map +0 -7
  721. package/dist/cjs/components/animation/bannerAni.d.ts +0 -16
  722. package/dist/cjs/components/animation/bannerAni.js +0 -59
  723. package/dist/cjs/components/animation/bannerAni.js.map +0 -7
  724. package/dist/cjs/components/animation/libs.d.js +0 -2
  725. package/dist/cjs/components/animation/textAni.d.ts +0 -9
  726. package/dist/cjs/components/animation/textAni.js +0 -2
  727. package/dist/cjs/components/animation/textAni.js.map +0 -7
  728. package/dist/cjs/components/chat/message.d.ts +0 -2
  729. package/dist/cjs/components/chat/response copy.d.ts +0 -2
  730. package/dist/cjs/components/chat/rresponse.d.ts +0 -2
  731. package/dist/cjs/components/theme.d.ts +0 -13
  732. package/dist/cjs/helpers/component-props.d.ts +0 -7
  733. package/dist/cjs/helpers/component-props.js +0 -2
  734. package/dist/cjs/helpers/component-props.js.map +0 -7
  735. package/dist/cjs/helpers/constants.d.ts +0 -2
  736. package/dist/cjs/helpers/constants.js +0 -2
  737. package/dist/cjs/helpers/constants.js.map +0 -7
  738. package/dist/cjs/stories/chat.stories.js +0 -2
  739. package/dist/cjs/stories/chat.stories.js.map +0 -7
  740. package/dist/cjs/tsconfig.tsbuildinfo +0 -1
  741. package/dist/esm/components/animation/CodeEditor.d.ts +0 -7
  742. package/dist/esm/components/animation/CodeEditor.js +0 -2
  743. package/dist/esm/components/animation/CodeEditor.js.map +0 -7
  744. package/dist/esm/components/animation/Preview.d.ts +0 -5
  745. package/dist/esm/components/animation/Preview.js +0 -2
  746. package/dist/esm/components/animation/Preview.js.map +0 -7
  747. package/dist/esm/components/animation/bannerAni.d.ts +0 -16
  748. package/dist/esm/components/animation/bannerAni.js +0 -59
  749. package/dist/esm/components/animation/bannerAni.js.map +0 -7
  750. package/dist/esm/components/animation/libs.d.js +0 -2
  751. package/dist/esm/components/animation/libs.d.js.map +0 -7
  752. package/dist/esm/components/animation/textAni.d.ts +0 -9
  753. package/dist/esm/components/animation/textAni.js +0 -2
  754. package/dist/esm/components/animation/textAni.js.map +0 -7
  755. package/dist/esm/components/chat/Markdown.d.ts +0 -5
  756. package/dist/esm/components/chat/marksdown.d.ts +0 -5
  757. package/dist/esm/components/chat/message.d.ts +0 -2
  758. package/dist/esm/components/chat/response copy.d.ts +0 -2
  759. package/dist/esm/components/chat/rresponse.d.ts +0 -2
  760. package/dist/esm/components/theme.d.ts +0 -13
  761. package/dist/esm/helpers/component-props.d.ts +0 -7
  762. package/dist/esm/helpers/component-props.js +0 -1
  763. package/dist/esm/helpers/constants.d.ts +0 -2
  764. package/dist/esm/helpers/constants.js +0 -2
  765. package/dist/esm/helpers/constants.js.map +0 -7
  766. package/dist/esm/stories/chat.stories.js +0 -2
  767. package/dist/esm/stories/chat.stories.js.map +0 -7
  768. package/dist/esm/styles/chat.css +0 -14
  769. package/dist/esm/styles/css/animations.css +0 -35
  770. package/dist/esm/styles/css/button.css +0 -56
  771. package/dist/esm/styles/css/colors.css +0 -12
  772. package/dist/esm/styles/css/console.css +0 -134
  773. package/dist/esm/styles/css/header.css +0 -43
  774. package/dist/esm/styles/css/input.css +0 -89
  775. package/dist/esm/styles/css/markdown.css +0 -131
  776. package/dist/esm/styles/css/messages.css +0 -73
  777. package/dist/esm/styles/css/panel.css +0 -23
  778. package/dist/esm/styles/css/popup.css +0 -44
  779. package/dist/esm/styles/css/response.css +0 -26
  780. package/dist/esm/styles/css/sidebar.css +0 -31
  781. package/dist/esm/styles/css/suggestions.css +0 -35
  782. package/dist/esm/styles/css/window.css +0 -60
  783. package/dist/esm/styles/index.css +0 -1
  784. package/dist/esm/tsconfig.tsbuildinfo +0 -1
  785. /package/dist/cjs/components/chat/{Markdown.d.ts → markdown.d.ts} +0 -0
  786. /package/dist/cjs/components/chat/{Response.d.ts → response.d.ts} +0 -0
  787. /package/dist/{cjs/components/chat/marksdown.d.ts → esm/components/chat/markdown.d.ts} +0 -0
  788. /package/dist/esm/components/chat/{Response.d.ts → response.d.ts} +0 -0
  789. /package/dist/{cjs/components/animation/libs.d.js.map → esm/components/credits/context/response.js.map} +0 -0
  790. /package/dist/esm/{helpers/component-props.js.map → components/credits/creditsCash/type.js.map} +0 -0
@@ -0,0 +1,319 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __commonJS = (cb, mod) => function __require() {
8
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
19
+ // If the importer is in node compatibility mode or this is not an ESM
20
+ // file that has been converted to a CommonJS file using a Babel-
21
+ // compatible transform (i.e. "__esModule" has not been set), then set
22
+ // "default" to the CommonJS "module.exports" for node compatibility.
23
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
24
+ mod
25
+ ));
26
+
27
+ // ../../node_modules/.pnpm/js-cookie@2.2.1/node_modules/js-cookie/src/js.cookie.js
28
+ var require_js_cookie = __commonJS({
29
+ "../../node_modules/.pnpm/js-cookie@2.2.1/node_modules/js-cookie/src/js.cookie.js"(exports, module) {
30
+ "use strict";
31
+ (function(factory) {
32
+ var registeredInModuleLoader;
33
+ if (typeof define === "function" && define.amd) {
34
+ define(factory);
35
+ registeredInModuleLoader = true;
36
+ }
37
+ if (typeof exports === "object") {
38
+ module.exports = factory();
39
+ registeredInModuleLoader = true;
40
+ }
41
+ if (!registeredInModuleLoader) {
42
+ var OldCookies = window.Cookies;
43
+ var api = window.Cookies = factory();
44
+ api.noConflict = function() {
45
+ window.Cookies = OldCookies;
46
+ return api;
47
+ };
48
+ }
49
+ })(function() {
50
+ function extend() {
51
+ var i = 0;
52
+ var result = {};
53
+ for (; i < arguments.length; i++) {
54
+ var attributes = arguments[i];
55
+ for (var key in attributes) {
56
+ result[key] = attributes[key];
57
+ }
58
+ }
59
+ return result;
60
+ }
61
+ function decode(s) {
62
+ return s.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent);
63
+ }
64
+ function init(converter) {
65
+ function api() {
66
+ }
67
+ function set(key, value, attributes) {
68
+ if (typeof document === "undefined") {
69
+ return;
70
+ }
71
+ attributes = extend({
72
+ path: "/"
73
+ }, api.defaults, attributes);
74
+ if (typeof attributes.expires === "number") {
75
+ attributes.expires = new Date(/* @__PURE__ */ new Date() * 1 + attributes.expires * 864e5);
76
+ }
77
+ attributes.expires = attributes.expires ? attributes.expires.toUTCString() : "";
78
+ try {
79
+ var result = JSON.stringify(value);
80
+ if (/^[\{\[]/.test(result)) {
81
+ value = result;
82
+ }
83
+ } catch (e) {
84
+ }
85
+ value = converter.write ? converter.write(value, key) : encodeURIComponent(String(value)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);
86
+ key = encodeURIComponent(String(key)).replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent).replace(/[\(\)]/g, escape);
87
+ var stringifiedAttributes = "";
88
+ for (var attributeName in attributes) {
89
+ if (!attributes[attributeName]) {
90
+ continue;
91
+ }
92
+ stringifiedAttributes += "; " + attributeName;
93
+ if (attributes[attributeName] === true) {
94
+ continue;
95
+ }
96
+ stringifiedAttributes += "=" + attributes[attributeName].split(";")[0];
97
+ }
98
+ return document.cookie = key + "=" + value + stringifiedAttributes;
99
+ }
100
+ function get(key, json) {
101
+ if (typeof document === "undefined") {
102
+ return;
103
+ }
104
+ var jar = {};
105
+ var cookies = document.cookie ? document.cookie.split("; ") : [];
106
+ var i = 0;
107
+ for (; i < cookies.length; i++) {
108
+ var parts = cookies[i].split("=");
109
+ var cookie = parts.slice(1).join("=");
110
+ if (!json && cookie.charAt(0) === '"') {
111
+ cookie = cookie.slice(1, -1);
112
+ }
113
+ try {
114
+ var name = decode(parts[0]);
115
+ cookie = (converter.read || converter)(cookie, name) || decode(cookie);
116
+ if (json) {
117
+ try {
118
+ cookie = JSON.parse(cookie);
119
+ } catch (e) {
120
+ }
121
+ }
122
+ jar[name] = cookie;
123
+ if (key === name) {
124
+ break;
125
+ }
126
+ } catch (e) {
127
+ }
128
+ }
129
+ return key ? jar[key] : jar;
130
+ }
131
+ api.set = set;
132
+ api.get = function(key) {
133
+ return get(
134
+ key,
135
+ false
136
+ /* read as raw */
137
+ );
138
+ };
139
+ api.getJSON = function(key) {
140
+ return get(
141
+ key,
142
+ true
143
+ /* read as json */
144
+ );
145
+ };
146
+ api.remove = function(key, attributes) {
147
+ set(key, "", extend(attributes, {
148
+ expires: -1
149
+ }));
150
+ };
151
+ api.defaults = {};
152
+ api.withConverter = init;
153
+ return api;
154
+ }
155
+ return init(function() {
156
+ });
157
+ });
158
+ }
159
+ });
160
+
161
+ // utils/index.ts
162
+ var import_js_cookie2 = __toESM(require_js_cookie(), 1);
163
+
164
+ // utils/const.ts
165
+ var locales = Object.keys(I18N_STORE_DOMAIN || {});
166
+ var ENV = process.env.NEXT_PUBLIC_ENV;
167
+ var REVALIDATE_TIME = 60 * 5;
168
+ var APPLICATION_NAME = process.env.NEXT_PUBLIC_I18N_ACCOUNT_APPLICATION_NAME && JSON.parse(process.env.NEXT_PUBLIC_I18N_ACCOUNT_APPLICATION_NAME);
169
+ var HOST = process.env.NEXT_PUBLIC_ENV === "production" ? `www.${process.env.NEXT_PUBLIC_BRAND}.com` : `beta.${process.env.NEXT_PUBLIC_BRAND}.com`;
170
+ var BRAND = `${process.env.NEXT_PUBLIC_BRAND}`;
171
+ var GOOGLE_CLIENT_ID = process.env.NEXT_PUBLIC_GOOGLE_CLIENT_ID;
172
+ var FACEBOOK_APP_ID = process.env.NEXT_PUBLIC_FACEBOOK_APP_ID;
173
+ var metafieldNamespacePrefix = process.env.NEXT_PUBLIC_METAFIELD_NAMESPACE_PREFIX || "";
174
+
175
+ // utils/helper.ts
176
+ var import_js_cookie = __toESM(require_js_cookie(), 1);
177
+ function atobID(id) {
178
+ var _a, _b;
179
+ if (id && typeof id === "string" && id.includes("/")) {
180
+ return (_b = (_a = id.split("/").pop()) == null ? void 0 : _a.split("?")) == null ? void 0 : _b.shift();
181
+ } else {
182
+ return id;
183
+ }
184
+ }
185
+ var getThemeLocale = (locale) => {
186
+ if (locale === "eu-de") return "de";
187
+ if (locale === "eu-en") return "eu";
188
+ if (locale === "au") return "au";
189
+ return locale;
190
+ };
191
+
192
+ // utils/store.ts
193
+ var BRAND2 = process.env.NEXT_PUBLIC_BRAND || "soundcore";
194
+ var ORIGIN_URL = process.env.NEXT_PUBLIC_ENV === "production" ? `https://www.${BRAND2}.com` : `https://beta.${BRAND2}.com`;
195
+ var PASSPORT_URL = process.env.NEXT_PUBLIC_ENV === "production" ? `https://passport.${BRAND2}.com` : `https://beta.passport.${BRAND2}.com`;
196
+ var I18N_STOREFRONT_TOKEN = process.env.NEXT_PUBLIC_I18N_SHOPIFY_STOREFRONT_TOKEN && JSON.parse(process.env.NEXT_PUBLIC_I18N_SHOPIFY_STOREFRONT_TOKEN);
197
+ var I18N_STORE_DOMAIN = process.env.NEXT_PUBLIC_I18N_SHOPIFY_STORE_DOMAIN && JSON.parse(process.env.NEXT_PUBLIC_I18N_SHOPIFY_STORE_DOMAIN);
198
+ var I18N_THEME_DOMAIN = I18N_STORE_DOMAIN && function() {
199
+ const result = {};
200
+ Object.entries(I18N_STORE_DOMAIN).forEach(([key, value]) => {
201
+ result[key] = process.env.NEXT_PUBLIC_ENV === "production" ? `${getThemeLocale(key)}.${BRAND2}.com` : value;
202
+ });
203
+ return result;
204
+ }();
205
+ var storeDomain = I18N_STORE_DOMAIN;
206
+ var I18N_API_URL = function() {
207
+ const result = {};
208
+ Object.keys(storeDomain).forEach((locale) => {
209
+ result[locale] = `https://${storeDomain[locale]}/api/2025-07/graphql.json`;
210
+ });
211
+ return result;
212
+ }();
213
+ var locales2 = Object.keys(I18N_STORE_DOMAIN || {});
214
+ var I18N_APP_NAME = function() {
215
+ const result = {};
216
+ Object.entries(I18N_STORE_DOMAIN).forEach(([locale, storeDomain2]) => {
217
+ result[locale] = storeDomain2.replace(".myshopify.com", "");
218
+ });
219
+ return result;
220
+ }();
221
+ var metafieldNamespacePrefix2 = process.env.NEXT_PUBLIC_METAFIELD_NAMESPACE_PREFIX || "";
222
+
223
+ // utils/cookie.ts
224
+ var SHOPIFY_COOKIE_EXPIRE = 30;
225
+ var SHOPIFY_CART_COOKIE_EXPIRE = 14;
226
+ var I18N_SHOPIFY_CART_COOKIE = function() {
227
+ const result = {};
228
+ locales.forEach((locale) => {
229
+ result[locale] = `shopifyCart_${I18N_STORE_DOMAIN[locale]}`;
230
+ });
231
+ return result;
232
+ }();
233
+ var I18N_SHOPIFY_CART_ID_COOKIE = function() {
234
+ const result = {};
235
+ locales.forEach((locale) => {
236
+ result[locale] = `shopifyCheckoutId_${I18N_STORE_DOMAIN[locale]}`;
237
+ });
238
+ return result;
239
+ }();
240
+ var I18N_SHOPIFY_CHECKOUT_URL_COOKIE = function() {
241
+ const result = {};
242
+ locales.forEach((locale) => {
243
+ result[locale] = `shopifyCheckoutUrl_${I18N_STORE_DOMAIN[locale]}`;
244
+ });
245
+ return result;
246
+ }();
247
+ var I18N_SHOPIFY_CUSTOMER_TOKEN_COOKIE = function() {
248
+ const result = {};
249
+ locales.forEach((locale) => {
250
+ result[locale] = `shopifyCustomerToken_${I18N_STORE_DOMAIN[locale]}`;
251
+ });
252
+ return result;
253
+ }();
254
+ var I18N_SHOPIFY_RESENT_CART_ID_COOKIE = function() {
255
+ const result = {};
256
+ locales.forEach((locale) => {
257
+ result[locale] = `shopifyRecentCartId_${I18N_STORE_DOMAIN[locale]}`;
258
+ });
259
+ return result;
260
+ }();
261
+
262
+ // utils/index.ts
263
+ var createCartCookieOptions = () => {
264
+ const hostUrl = window.location.host.split(".");
265
+ return {
266
+ domain: hostUrl.reverse().slice(0, 2).reverse().join("."),
267
+ // 一二级域名
268
+ expires: SHOPIFY_CART_COOKIE_EXPIRE
269
+ };
270
+ };
271
+ var setCartCookies = (locale, cart) => {
272
+ const shopifyCartCookie = I18N_SHOPIFY_CART_COOKIE[locale];
273
+ import_js_cookie2.default.set(
274
+ shopifyCartCookie,
275
+ JSON.stringify({
276
+ from: "storefront" /* Storefront */,
277
+ items: cart.lineItems.map((item) => ({
278
+ id: atobID(item.variantId),
279
+ quantity: item.quantity
280
+ }))
281
+ }),
282
+ createCartCookieOptions()
283
+ );
284
+ };
285
+ var removeCartCookies = (locale) => {
286
+ const shopifyCartCookie = I18N_SHOPIFY_CART_COOKIE[locale];
287
+ import_js_cookie2.default.remove(shopifyCartCookie, createCartCookieOptions());
288
+ };
289
+ var removeCheckoutCookies = (locale) => {
290
+ var _a;
291
+ const options = {
292
+ Domain: (_a = window == null ? void 0 : window.location) == null ? void 0 : _a.hostname,
293
+ SameSite: "Strict",
294
+ Secure: true,
295
+ expires: SHOPIFY_COOKIE_EXPIRE
296
+ };
297
+ const checkoutUrlCookie = I18N_SHOPIFY_CHECKOUT_URL_COOKIE[locale];
298
+ const checkoutIdCookie = I18N_SHOPIFY_CART_ID_COOKIE[locale];
299
+ import_js_cookie2.default.remove(checkoutIdCookie, options);
300
+ import_js_cookie2.default.remove(checkoutUrlCookie, options);
301
+ };
302
+ export {
303
+ createCartCookieOptions,
304
+ removeCartCookies,
305
+ removeCheckoutCookies,
306
+ setCartCookies
307
+ };
308
+ /*! Bundled license information:
309
+
310
+ js-cookie/src/js.cookie.js:
311
+ (*!
312
+ * JavaScript Cookie v2.2.1
313
+ * https://github.com/js-cookie/js-cookie
314
+ *
315
+ * Copyright 2006, 2015 Klaus Hartl & Fagner Brack
316
+ * Released under the MIT license
317
+ *)
318
+ */
319
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../node_modules/.pnpm/js-cookie@2.2.1/node_modules/js-cookie/src/js.cookie.js","../utils/index.ts","../utils/const.ts","../utils/helper.ts","../utils/store.ts","../utils/cookie.ts"],"sourcesContent":["/*!\n * JavaScript Cookie v2.2.1\n * https://github.com/js-cookie/js-cookie\n *\n * Copyright 2006, 2015 Klaus Hartl & Fagner Brack\n * Released under the MIT license\n */\n;(function (factory) {\n\tvar registeredInModuleLoader;\n\tif (typeof define === 'function' && define.amd) {\n\t\tdefine(factory);\n\t\tregisteredInModuleLoader = true;\n\t}\n\tif (typeof exports === 'object') {\n\t\tmodule.exports = factory();\n\t\tregisteredInModuleLoader = true;\n\t}\n\tif (!registeredInModuleLoader) {\n\t\tvar OldCookies = window.Cookies;\n\t\tvar api = window.Cookies = factory();\n\t\tapi.noConflict = function () {\n\t\t\twindow.Cookies = OldCookies;\n\t\t\treturn api;\n\t\t};\n\t}\n}(function () {\n\tfunction extend () {\n\t\tvar i = 0;\n\t\tvar result = {};\n\t\tfor (; i < arguments.length; i++) {\n\t\t\tvar attributes = arguments[ i ];\n\t\t\tfor (var key in attributes) {\n\t\t\t\tresult[key] = attributes[key];\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\tfunction decode (s) {\n\t\treturn s.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent);\n\t}\n\n\tfunction init (converter) {\n\t\tfunction api() {}\n\n\t\tfunction set (key, value, attributes) {\n\t\t\tif (typeof document === 'undefined') {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tattributes = extend({\n\t\t\t\tpath: '/'\n\t\t\t}, api.defaults, attributes);\n\n\t\t\tif (typeof attributes.expires === 'number') {\n\t\t\t\tattributes.expires = new Date(new Date() * 1 + attributes.expires * 864e+5);\n\t\t\t}\n\n\t\t\t// We're using \"expires\" because \"max-age\" is not supported by IE\n\t\t\tattributes.expires = attributes.expires ? attributes.expires.toUTCString() : '';\n\n\t\t\ttry {\n\t\t\t\tvar result = JSON.stringify(value);\n\t\t\t\tif (/^[\\{\\[]/.test(result)) {\n\t\t\t\t\tvalue = result;\n\t\t\t\t}\n\t\t\t} catch (e) {}\n\n\t\t\tvalue = converter.write ?\n\t\t\t\tconverter.write(value, key) :\n\t\t\t\tencodeURIComponent(String(value))\n\t\t\t\t\t.replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);\n\n\t\t\tkey = encodeURIComponent(String(key))\n\t\t\t\t.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent)\n\t\t\t\t.replace(/[\\(\\)]/g, escape);\n\n\t\t\tvar stringifiedAttributes = '';\n\t\t\tfor (var attributeName in attributes) {\n\t\t\t\tif (!attributes[attributeName]) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tstringifiedAttributes += '; ' + attributeName;\n\t\t\t\tif (attributes[attributeName] === true) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Considers RFC 6265 section 5.2:\n\t\t\t\t// ...\n\t\t\t\t// 3. If the remaining unparsed-attributes contains a %x3B (\";\")\n\t\t\t\t// character:\n\t\t\t\t// Consume the characters of the unparsed-attributes up to,\n\t\t\t\t// not including, the first %x3B (\";\") character.\n\t\t\t\t// ...\n\t\t\t\tstringifiedAttributes += '=' + attributes[attributeName].split(';')[0];\n\t\t\t}\n\n\t\t\treturn (document.cookie = key + '=' + value + stringifiedAttributes);\n\t\t}\n\n\t\tfunction get (key, json) {\n\t\t\tif (typeof document === 'undefined') {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar jar = {};\n\t\t\t// To prevent the for loop in the first place assign an empty array\n\t\t\t// in case there are no cookies at all.\n\t\t\tvar cookies = document.cookie ? document.cookie.split('; ') : [];\n\t\t\tvar i = 0;\n\n\t\t\tfor (; i < cookies.length; i++) {\n\t\t\t\tvar parts = cookies[i].split('=');\n\t\t\t\tvar cookie = parts.slice(1).join('=');\n\n\t\t\t\tif (!json && cookie.charAt(0) === '\"') {\n\t\t\t\t\tcookie = cookie.slice(1, -1);\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tvar name = decode(parts[0]);\n\t\t\t\t\tcookie = (converter.read || converter)(cookie, name) ||\n\t\t\t\t\t\tdecode(cookie);\n\n\t\t\t\t\tif (json) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tcookie = JSON.parse(cookie);\n\t\t\t\t\t\t} catch (e) {}\n\t\t\t\t\t}\n\n\t\t\t\t\tjar[name] = cookie;\n\n\t\t\t\t\tif (key === name) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} catch (e) {}\n\t\t\t}\n\n\t\t\treturn key ? jar[key] : jar;\n\t\t}\n\n\t\tapi.set = set;\n\t\tapi.get = function (key) {\n\t\t\treturn get(key, false /* read as raw */);\n\t\t};\n\t\tapi.getJSON = function (key) {\n\t\t\treturn get(key, true /* read as json */);\n\t\t};\n\t\tapi.remove = function (key, attributes) {\n\t\t\tset(key, '', extend(attributes, {\n\t\t\t\texpires: -1\n\t\t\t}));\n\t\t};\n\n\t\tapi.defaults = {};\n\n\t\tapi.withConverter = init;\n\n\t\treturn api;\n\t}\n\n\treturn init(function () {});\n}));\n","import Cookies from 'js-cookie'\nimport {\n I18N_SHOPIFY_CART_COOKIE,\n I18N_SHOPIFY_CART_ID_COOKIE,\n I18N_SHOPIFY_CHECKOUT_URL_COOKIE,\n SHOPIFY_CART_COOKIE_EXPIRE,\n SHOPIFY_COOKIE_EXPIRE,\n} from './cookie'\nimport { Cart } from '../types/cart'\nimport { atobID } from './helper'\n\nimport { CartDataSource } from './const'\n\nexport const createCartCookieOptions = () => {\n const hostUrl = window.location.host.split('.')\n return {\n domain: hostUrl.reverse().slice(0, 2).reverse().join('.'), // 一二级域名\n expires: SHOPIFY_CART_COOKIE_EXPIRE,\n }\n}\n\nexport const setCartCookies = (locale: string, cart: Cart) => {\n const shopifyCartCookie = I18N_SHOPIFY_CART_COOKIE[locale]\n\n Cookies.set(\n shopifyCartCookie,\n JSON.stringify({\n from: CartDataSource.Storefront,\n items: cart.lineItems.map(item => ({\n id: atobID(item.variantId),\n quantity: item.quantity,\n })),\n }),\n createCartCookieOptions()\n )\n}\n\nexport const removeCartCookies = (locale: string) => {\n const shopifyCartCookie = I18N_SHOPIFY_CART_COOKIE[locale]\n Cookies.remove(shopifyCartCookie, createCartCookieOptions())\n}\n\nexport const removeCheckoutCookies = (locale: string) => {\n const options = {\n Domain: window?.location?.hostname,\n SameSite: 'Strict',\n Secure: true,\n expires: SHOPIFY_COOKIE_EXPIRE,\n }\n\n const checkoutUrlCookie = I18N_SHOPIFY_CHECKOUT_URL_COOKIE[locale]\n const checkoutIdCookie = I18N_SHOPIFY_CART_ID_COOKIE[locale]\n Cookies.remove(checkoutIdCookie, options)\n Cookies.remove(checkoutUrlCookie, options)\n}\n","import { I18N_STORE_DOMAIN } from './store'\n\n// 购物车数据来源\nexport enum CartDataSource {\n Storefront = 'storefront',\n Theme = 'theme',\n}\n\nexport const locales = Object.keys(I18N_STORE_DOMAIN || {})\n\nexport const ENV = process.env.NEXT_PUBLIC_ENV\n\nexport const REVALIDATE_TIME = 60 * 5\n\nexport const APPLICATION_NAME =\n process.env.NEXT_PUBLIC_I18N_ACCOUNT_APPLICATION_NAME &&\n JSON.parse(process.env.NEXT_PUBLIC_I18N_ACCOUNT_APPLICATION_NAME)\n\nexport const SOLD_OUT_PRICE = 9999999.99\n\nexport enum TemplateType {\n Page = 'page',\n Product = 'product',\n Collection = 'collection',\n Blog = 'blog',\n Article = 'article',\n}\n\nexport enum DiscountType {\n fixedAmount = 'fixed_amount',\n percentage = 'percentage',\n}\n\nexport const HOST =\n process.env.NEXT_PUBLIC_ENV === 'production'\n ? `www.${process.env.NEXT_PUBLIC_BRAND}.com`\n : `beta.${process.env.NEXT_PUBLIC_BRAND}.com`\n\nexport const BRAND = `${process.env.NEXT_PUBLIC_BRAND}`\n\nexport const GOOGLE_CLIENT_ID = process.env.NEXT_PUBLIC_GOOGLE_CLIENT_ID\nexport const FACEBOOK_APP_ID = process.env.NEXT_PUBLIC_FACEBOOK_APP_ID\n\nexport const COLOR_LABEL = [\n 'color',\n 'colour',\n 'couleur',\n 'cor',\n 'colore',\n 'farbe',\n '색',\n '色',\n 'カラー',\n 'färg',\n 'farve',\n]\n\nexport enum CouponChannel {\n LIGHTNING_DEAL = 'LIGHTNING_DEAL',\n DEAL = 'LIGHTNING_DEAL',\n COUPON = 'COUPON',\n PED = 'PED',\n WS24 = 'WS24',\n WSTD = 'WSTD',\n WSCH = 'WSCH',\n}\n\nexport const PRICE_SYMBOL = {\n us: '$',\n uk: '£',\n ca: '$',\n eu: '€',\n pl: 'zł',\n fr: '€',\n de: '€',\n vn: '₫',\n cl: '$',\n sg: '$',\n ae: 'AED',\n es: '€',\n}\n\nexport const CURRENCY_CODE = {\n us: 'USD',\n uk: 'GBP',\n ca: 'CAD',\n eu: 'EUR',\n pl: 'PL',\n fr: 'EUR',\n de: 'EUR',\n vn: 'VND',\n cl: 'CLP',\n es: 'EUR',\n}\n\nexport const COUNTRY_CODE = {\n pl: 'PL',\n} as Record<string, string>\n\nexport const LANGUAGE_CODE = {\n pl: 'PL',\n} as Record<string, string>\n\nexport const metafieldNamespacePrefix = process.env.NEXT_PUBLIC_METAFIELD_NAMESPACE_PREFIX || ''\n\nexport const CUSTOMER_ATTRIBUTE_KEY = '_discounts_function_env'\nexport const CUSTOMER_SCRIPT_GIFT_KEY = '_giveaway_gradient_gifts'\n\nexport const CODE_AMOUNT_KEY = '_sku_code_money'\nexport const SCRIPT_CODE_AMOUNT_KEY = '_code_money'\n\n// 主产品公开 code\nexport const MAIN_PRODUCT_CODE = ['WS24', 'WSTD', 'WS7D', 'WSCP', 'WSPE', 'WSPD']\n","import { HasMetafieldsIdentifier } from '../gql'\nimport { HasMetafieldQueryRoot } from '../types/fetcher'\nimport { PartialRecord } from '../utils/type-helper'\nimport { metafieldNamespacePrefix } from './const'\nimport Cookies from 'js-cookie'\nimport { CouponChannel } from '../utils/const'\nimport { ProductVariant } from '../types/product'\n\n// 判断对象是否为空\nexport function isObjEmpty(obj?: Record<string, any>) {\n if (!obj) return true\n else {\n return Object.keys(obj).length === 0\n }\n}\n\nexport function atobID(id: string) {\n if (id && typeof id === 'string' && id.includes('/')) {\n return id.split('/').pop()?.split('?')?.shift()\n } else {\n return id\n }\n}\n\nexport function btoaID(\n id: string,\n type: 'ProductVariant' | 'Product' = 'ProductVariant'\n) {\n return `gid://shopify/${type}/${id}`\n}\n\n// 皮肤站三级域名\nexport const getThemeLocale = (locale: string) => {\n if (locale === 'eu-de') return 'de'\n if (locale === 'eu-en') return 'eu'\n if (locale === 'au') return 'au'\n return locale\n}\n\n/**\n * 生成 metafieldIdentifiers 查询参数\n */\nexport function constructMetafieldIdentifiersQueryParams<\n T extends HasMetafieldQueryRoot\n>(\n metafieldIdentifiers: PartialRecord<T, HasMetafieldsIdentifier[]> = {}\n): PartialRecord<`${T}MetafieldIdentifiers`, HasMetafieldsIdentifier[]> {\n const identifiers = Object.entries(metafieldIdentifiers).reduce(\n (queryInput, [key, value]) => {\n const metafieldIdentifiers = value as HasMetafieldsIdentifier[]\n ;(queryInput as any)[`${key}MetafieldIdentifiers`] = metafieldIdentifiers\n .filter((item) => !item.namespace.startsWith(metafieldNamespacePrefix))\n .map((item) => ({\n namespace: `${metafieldNamespacePrefix}combo`,\n key: item.namespace,\n }))\n .concat(metafieldIdentifiers)\n return queryInput\n },\n {} as PartialRecord<`${T}MetafieldIdentifiers`, HasMetafieldsIdentifier[]>\n )\n return identifiers\n}\n\nexport const referralAttributes = () => {\n const inviteCode = Cookies.get('invite_code')\n const playModeId = Cookies.get('playModeId')\n const popup = Cookies.get('_popup')\n if (inviteCode && playModeId) {\n return popup\n ? [\n { key: '_invite_code', value: inviteCode ? inviteCode : '' },\n { key: '_play_mode_id', value: playModeId ? playModeId : '' },\n { key: '_popup', value: popup },\n ]\n : [\n { key: '_invite_code', value: inviteCode ? inviteCode : '' },\n { key: '_play_mode_id', value: playModeId ? playModeId : '' },\n ]\n }\n return []\n}\n\nexport const getNormalCoupon = ({ variant }: { variant?: ProductVariant }) => {\n return variant?.coupons?.find(\n (coupon: any) => coupon.discount_type !== CouponChannel.WSCH\n )\n}\n","import { getThemeLocale } from './helper'\n\nexport const BRAND = process.env.NEXT_PUBLIC_BRAND || 'soundcore'\n\nexport const ORIGIN_URL =\n process.env.NEXT_PUBLIC_ENV === 'production' ? `https://www.${BRAND}.com` : `https://beta.${BRAND}.com`\n\n// 用户中心域名\nexport const PASSPORT_URL =\n process.env.NEXT_PUBLIC_ENV === 'production' ? `https://passport.${BRAND}.com` : `https://beta.passport.${BRAND}.com`\n\n//所有区域的 Shopify 店铺Token\nexport const I18N_STOREFRONT_TOKEN =\n process.env.NEXT_PUBLIC_I18N_SHOPIFY_STOREFRONT_TOKEN &&\n JSON.parse(process.env.NEXT_PUBLIC_I18N_SHOPIFY_STOREFRONT_TOKEN)\n\n//所有区域的 Shopify 店铺域名: *.myshopify.com\nexport const I18N_STORE_DOMAIN: Record<string, string> =\n process.env.NEXT_PUBLIC_I18N_SHOPIFY_STORE_DOMAIN && JSON.parse(process.env.NEXT_PUBLIC_I18N_SHOPIFY_STORE_DOMAIN)\n\n// 主题站域名\nexport const I18N_THEME_DOMAIN =\n I18N_STORE_DOMAIN &&\n (function () {\n const result: Record<string, string> = {}\n\n Object.entries(I18N_STORE_DOMAIN).forEach(([key, value]) => {\n result[key] = process.env.NEXT_PUBLIC_ENV === 'production' ? `${getThemeLocale(key)}.${BRAND}.com` : value\n })\n\n return result\n })()\n\nconst storeDomain = I18N_STORE_DOMAIN\n\n// 所有区域的 Shopify Storefront API 地址,使用主题站域名\nexport const I18N_API_URL = (function () {\n const result: { [key: string]: string } = {}\n Object.keys(storeDomain).forEach(locale => {\n result[locale] = `https://${storeDomain[locale]}/api/2025-07/graphql.json`\n })\n return result\n})()\n\nexport const locales = Object.keys(I18N_STORE_DOMAIN || {})\n\nexport const I18N_APP_NAME = (function () {\n const result: { [key: string]: string } = {}\n Object.entries(I18N_STORE_DOMAIN).forEach(([locale, storeDomain]) => {\n result[locale] = storeDomain.replace('.myshopify.com', '')\n })\n return result\n})()\n\nexport const metafieldNamespacePrefix = process.env.NEXT_PUBLIC_METAFIELD_NAMESPACE_PREFIX || ''\n","import { I18N_STORE_DOMAIN } from './store'\nimport { locales } from './const'\n\nexport const SHOPIFY_COOKIE_EXPIRE = 30\nexport const SHOPIFY_CART_COOKIE_EXPIRE = 14\n\n// 购物车Cookie名称\nexport const I18N_SHOPIFY_CART_COOKIE = (function () {\n const result: { [key: string]: string } = {}\n locales.forEach((locale: string) => {\n result[locale] = `shopifyCart_${I18N_STORE_DOMAIN[locale]}`\n })\n return result\n})()\n\n// Cart ID Cookie名称\nexport const I18N_SHOPIFY_CART_ID_COOKIE = (function () {\n const result: { [key: string]: string } = {}\n locales.forEach((locale: string) => {\n result[locale] = `shopifyCheckoutId_${I18N_STORE_DOMAIN[locale]}`\n })\n return result\n})()\n\n// CheckoutUrl Cookie名称\nexport const I18N_SHOPIFY_CHECKOUT_URL_COOKIE = (function () {\n const result: { [key: string]: string } = {}\n locales.forEach((locale: string) => {\n result[locale] = `shopifyCheckoutUrl_${I18N_STORE_DOMAIN[locale]}`\n })\n return result\n})()\n\n// CustomerToken Cookie名称\nexport const I18N_SHOPIFY_CUSTOMER_TOKEN_COOKIE = (function () {\n const result: { [key: string]: string } = {}\n locales.forEach((locale: string) => {\n result[locale] = `shopifyCustomerToken_${I18N_STORE_DOMAIN[locale]}`\n })\n return result\n})()\n\n// CheckoutID 对应 Key 值\nexport const I18N_SHOPIFY_RESENT_CART_ID_COOKIE = (function () {\n const result: { [key: string]: string } = {}\n locales.forEach((locale: string) => {\n result[locale] = `shopifyRecentCartId_${I18N_STORE_DOMAIN[locale]}`\n })\n return result\n})()\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAOC,KAAC,SAAU,SAAS;AACpB,UAAI;AACJ,UAAI,OAAO,WAAW,cAAc,OAAO,KAAK;AAC/C,eAAO,OAAO;AACd,mCAA2B;AAAA,MAC5B;AACA,UAAI,OAAO,YAAY,UAAU;AAChC,eAAO,UAAU,QAAQ;AACzB,mCAA2B;AAAA,MAC5B;AACA,UAAI,CAAC,0BAA0B;AAC9B,YAAI,aAAa,OAAO;AACxB,YAAI,MAAM,OAAO,UAAU,QAAQ;AACnC,YAAI,aAAa,WAAY;AAC5B,iBAAO,UAAU;AACjB,iBAAO;AAAA,QACR;AAAA,MACD;AAAA,IACD,GAAE,WAAY;AACb,eAAS,SAAU;AAClB,YAAI,IAAI;AACR,YAAI,SAAS,CAAC;AACd,eAAO,IAAI,UAAU,QAAQ,KAAK;AACjC,cAAI,aAAa,UAAW,CAAE;AAC9B,mBAAS,OAAO,YAAY;AAC3B,mBAAO,GAAG,IAAI,WAAW,GAAG;AAAA,UAC7B;AAAA,QACD;AACA,eAAO;AAAA,MACR;AAEA,eAAS,OAAQ,GAAG;AACnB,eAAO,EAAE,QAAQ,oBAAoB,kBAAkB;AAAA,MACxD;AAEA,eAAS,KAAM,WAAW;AACzB,iBAAS,MAAM;AAAA,QAAC;AAEhB,iBAAS,IAAK,KAAK,OAAO,YAAY;AACrC,cAAI,OAAO,aAAa,aAAa;AACpC;AAAA,UACD;AAEA,uBAAa,OAAO;AAAA,YACnB,MAAM;AAAA,UACP,GAAG,IAAI,UAAU,UAAU;AAE3B,cAAI,OAAO,WAAW,YAAY,UAAU;AAC3C,uBAAW,UAAU,IAAI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
2
+ import { createCartMutation } from '../mutations/create-cart'
3
+ import type { Cart } from '../types/cart'
4
+ import { ShopifyFetcher } from '@shopify/types/fetcher'
5
+ import { fetchGraphqlApi } from '../utils/fetch-graphql-api'
6
+ import { normalizeCart } from '../utils/normalize'
7
+ import { ShopifyConfig } from '@shopify/types/config'
8
+
9
+ /**
10
+ * Creates a cart using the Shopify API.
11
+ *
12
+ * @param options - The options for the cart.
13
+ * @param config - The store configuration.
14
+ * @returns The created cart or undefined if the cart creation fails.
15
+ */
16
+ export const createCart: ShopifyFetcher<
17
+ Cart | undefined,
18
+ CartInput & {
19
+ disableSetCookie?: boolean
20
+ }
21
+ > = async function ({ options, config }: { options: CartInput; config: ShopifyConfig }) {
22
+ const { attributes, ...fetchOptions } = options
23
+
24
+ const { data } = await fetchGraphqlApi<{ cartCreate: CartCreatePayload }, CartInput>({
25
+ query: createCartMutation,
26
+ variables: {
27
+ attributes: attributes || [],
28
+ ...fetchOptions,
29
+ },
30
+ config,
31
+ })
32
+
33
+ const cart = data?.cartCreate?.cart
34
+
35
+ if (cart) {
36
+ return normalizeCart(cart, '')
37
+ } else {
38
+ return undefined
39
+ }
40
+ }
@@ -0,0 +1,41 @@
1
+ import { getProductsByHandlesQuery } from '../queries/get-product-by-handles'
2
+ import { fetchGraphqlApi } from '../utils/fetch-graphql-api'
3
+ import { constructMetafieldIdentifiersQueryParams } from '../utils/helper'
4
+ import { normalizeProduct } from '../utils/normalize/product'
5
+ import { Product as ShopifyProduct } from '@shopify/gql'
6
+ import { HasMetafieldQueryRoot, ShopifyFetcher, ShopifyFetcherVariables } from '@shopify/types/fetcher'
7
+ import { Product } from '../types/product'
8
+
9
+ export type GetProductsByHandlesReq = {
10
+ handles: string[]
11
+ }
12
+
13
+ export type GetProductsMetafieldQueryRoot = HasMetafieldQueryRoot.Product | HasMetafieldQueryRoot.Variant
14
+
15
+ export const getProductsByHandles: ShopifyFetcher<
16
+ Product[],
17
+ GetProductsByHandlesReq,
18
+ GetProductsMetafieldQueryRoot
19
+ > = async ({ options, config }) => {
20
+ const { handles, metafieldIdentifiers, metafieldsNamespace } = options
21
+
22
+ if (!handles?.length) {
23
+ return []
24
+ }
25
+
26
+ const products = await fetchGraphqlApi<
27
+ Record<string, ShopifyProduct>,
28
+ ShopifyFetcherVariables<GetProductsByHandlesReq, GetProductsMetafieldQueryRoot>
29
+ >({
30
+ query: getProductsByHandlesQuery(handles),
31
+ variables: {
32
+ handles,
33
+ ...constructMetafieldIdentifiersQueryParams(metafieldIdentifiers, metafieldsNamespace),
34
+ },
35
+ config,
36
+ })
37
+
38
+ return Object.values(products.data)
39
+ .filter(item => !!item)
40
+ .map(product => normalizeProduct(product, '')) as Product[]
41
+ }
@@ -0,0 +1,3 @@
1
+ export { getProductsByHandles } from './get-products-by-handles'
2
+ export type { GetProductsByHandlesReq, GetProductsMetafieldQueryRoot } from './get-products-by-handles'
3
+
@@ -0,0 +1,51 @@
1
+ export const articleFragment = /* GraphQL */ `
2
+ fragment article on Article {
3
+ id
4
+ handle
5
+ title
6
+ seo {
7
+ ...seo
8
+ }
9
+ image {
10
+ ...image
11
+ }
12
+ tags
13
+ publishedAt
14
+ content
15
+ contentHtml
16
+ excerpt
17
+ excerptHtml
18
+ authorV2 {
19
+ bio
20
+ email
21
+ firstName
22
+ lastName
23
+ name
24
+ }
25
+ }
26
+ `
27
+
28
+ export const articleWithoutContentFragment = /* GraphQL */ `
29
+ fragment article on Article {
30
+ id
31
+ handle
32
+ title
33
+ seo {
34
+ ...seo
35
+ }
36
+ image {
37
+ ...image
38
+ }
39
+ tags
40
+ publishedAt
41
+ excerpt
42
+ excerptHtml
43
+ authorV2 {
44
+ bio
45
+ email
46
+ firstName
47
+ lastName
48
+ name
49
+ }
50
+ }
51
+ `
@@ -0,0 +1,10 @@
1
+ export const blogFragment = /* GraphQL */ `
2
+ fragment blog on Blog {
3
+ id
4
+ handle
5
+ title
6
+ seo {
7
+ ...seo
8
+ }
9
+ }
10
+ `