@anker-in/campaign-ui 0.2.10-beta.1 → 0.2.10-beta.10

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 (465) hide show
  1. package/dist/cjs/components/chat/chat-context.d.ts +101 -0
  2. package/dist/cjs/components/chat/{chatContext.js → chat-context.js} +1 -1
  3. package/dist/cjs/components/chat/{chatContext.js.map → chat-context.js.map} +2 -2
  4. package/dist/cjs/components/credits/context/hooks/useActivities.js +1 -1
  5. package/dist/cjs/components/credits/context/hooks/useActivities.js.map +3 -3
  6. package/dist/cjs/components/credits/context/hooks/useMyRewards.js +1 -1
  7. package/dist/cjs/components/credits/context/hooks/useMyRewards.js.map +3 -3
  8. package/dist/cjs/components/credits/context/hooks/useRedeemAndBuy.d.ts +1 -1
  9. package/dist/cjs/components/credits/context/hooks/useRedeemAndBuy.js +1 -1
  10. package/dist/cjs/components/credits/context/hooks/useRedeemAndBuy.js.map +3 -3
  11. package/dist/cjs/components/credits/context/hooks/useRedeemCoupon.js +1 -1
  12. package/dist/cjs/components/credits/context/hooks/useRedeemCoupon.js.map +3 -3
  13. package/dist/cjs/components/credits/context/hooks/useRedeemProduct.js +1 -1
  14. package/dist/cjs/components/credits/context/hooks/useRedeemProduct.js.map +3 -3
  15. package/dist/cjs/components/credits/context/hooks/useRedeemableList.js +1 -1
  16. package/dist/cjs/components/credits/context/hooks/useRedeemableList.js.map +3 -3
  17. package/dist/cjs/components/credits/context/hooks/useSendEmailValidation.js +1 -1
  18. package/dist/cjs/components/credits/context/hooks/useSendEmailValidation.js.map +3 -3
  19. package/dist/cjs/components/credits/context/hooks/useSubscribed.js +1 -1
  20. package/dist/cjs/components/credits/context/hooks/useSubscribed.js.map +3 -3
  21. package/dist/cjs/components/credits/credits-banner/index.d.ts +23 -0
  22. package/dist/cjs/components/credits/{creditsBanner → credits-banner}/index.js.map +2 -2
  23. package/dist/cjs/components/credits/credits-benefits/benefitItem.d.ts +19 -0
  24. package/dist/cjs/components/credits/{creditsBenefits → credits-benefits}/benefitItem.js.map +1 -1
  25. package/dist/cjs/components/credits/credits-benefits/iconInfo.d.ts +2 -0
  26. package/dist/cjs/components/credits/{creditsBenefits → credits-benefits}/iconInfo.js.map +1 -1
  27. package/dist/cjs/components/credits/credits-benefits/index.d.ts +12 -0
  28. package/dist/cjs/components/credits/{creditsBenefits → credits-benefits}/index.js.map +2 -2
  29. package/dist/cjs/components/credits/credits-cash/RedeemableItem.d.ts +15 -0
  30. package/dist/cjs/components/credits/{creditsCash → credits-cash}/RedeemableItem.js.map +1 -1
  31. package/dist/cjs/components/credits/credits-cash/index.d.ts +13 -0
  32. package/dist/cjs/components/credits/credits-cash/index.js +2 -0
  33. package/dist/cjs/components/credits/credits-cash/index.js.map +7 -0
  34. package/dist/cjs/components/credits/credits-cash/type.d.ts +47 -0
  35. package/dist/cjs/components/credits/credits-cash/type.js.map +7 -0
  36. package/dist/cjs/components/credits/credits-faq/faq-item/FaqItem.d.ts +13 -0
  37. package/dist/cjs/components/credits/credits-faq/faq-item/faq-item.d.ts +13 -0
  38. package/dist/cjs/components/credits/{creditsFaq/faqItem/FaqItem.js → credits-faq/faq-item/faq-item.js} +1 -1
  39. package/dist/cjs/components/credits/{creditsFaq/faqItem/FaqItem.js.map → credits-faq/faq-item/faq-item.js.map} +2 -2
  40. package/dist/cjs/components/credits/credits-faq/faqItem/FaqItem.d.ts +13 -0
  41. package/dist/cjs/components/credits/credits-faq/index.d.ts +16 -0
  42. package/dist/cjs/components/credits/{creditsFaq → credits-faq}/index.js.map +2 -2
  43. package/dist/cjs/components/credits/credits-info-card/index.d.ts +20 -0
  44. package/dist/cjs/components/credits/{creditsInfoCard → credits-info-card}/index.js.map +2 -2
  45. package/dist/cjs/components/credits/credits-redeem-list/AddressForm/Input.d.ts +13 -0
  46. package/dist/cjs/components/credits/credits-redeem-list/AddressForm/country-select.d.ts +14 -0
  47. package/dist/cjs/components/credits/credits-redeem-list/AddressForm/form-item.d.ts +6 -0
  48. package/dist/cjs/components/credits/credits-redeem-list/AddressForm/index.d.ts +2 -0
  49. package/dist/cjs/components/credits/credits-redeem-list/AddressForm/state-select.d.ts +15 -0
  50. package/dist/cjs/components/credits/credits-redeem-list/AddressForm/type.d.ts +26 -0
  51. package/dist/cjs/components/credits/credits-redeem-list/RedeemCouponModal.d.ts +9 -0
  52. package/dist/cjs/components/credits/credits-redeem-list/RedeemProductModal/Address.d.ts +20 -0
  53. package/dist/cjs/components/credits/credits-redeem-list/RedeemProductModal/Error.d.ts +8 -0
  54. package/dist/cjs/components/credits/credits-redeem-list/RedeemProductModal/Init.d.ts +11 -0
  55. package/dist/cjs/components/credits/credits-redeem-list/RedeemProductModal/ProductInfo.d.ts +8 -0
  56. package/dist/cjs/components/credits/credits-redeem-list/RedeemProductModal/Success.d.ts +13 -0
  57. package/dist/cjs/components/credits/credits-redeem-list/RedeemProductModal/index.d.ts +11 -0
  58. package/dist/cjs/components/credits/credits-redeem-list/RedeemableItem.d.ts +9 -0
  59. package/dist/cjs/components/credits/{creditsRedeemList → credits-redeem-list}/RedeemableItem.js.map +1 -1
  60. package/dist/cjs/components/credits/credits-redeem-list/address-form/Input.d.ts +13 -0
  61. package/dist/cjs/components/credits/{creditsRedeemList/AddressForm → credits-redeem-list/address-form}/Input.js.map +1 -1
  62. package/dist/cjs/components/credits/credits-redeem-list/address-form/country-select.d.ts +14 -0
  63. package/dist/cjs/components/credits/{creditsRedeemList/AddressForm/CountrySelect.js → credits-redeem-list/address-form/country-select.js} +1 -1
  64. package/dist/cjs/components/credits/{creditsRedeemList/AddressForm/CountrySelect.js.map → credits-redeem-list/address-form/country-select.js.map} +2 -2
  65. package/dist/cjs/components/credits/credits-redeem-list/address-form/form-item.d.ts +6 -0
  66. package/dist/cjs/components/credits/{creditsRedeemList/AddressForm/FormItem.js → credits-redeem-list/address-form/form-item.js} +1 -1
  67. package/dist/cjs/components/credits/{creditsRedeemList/AddressForm/FormItem.js.map → credits-redeem-list/address-form/form-item.js.map} +2 -2
  68. package/dist/cjs/components/credits/credits-redeem-list/address-form/index.d.ts +2 -0
  69. package/dist/cjs/components/credits/credits-redeem-list/address-form/index.js +2 -0
  70. package/dist/cjs/components/credits/credits-redeem-list/address-form/index.js.map +7 -0
  71. package/dist/cjs/components/credits/credits-redeem-list/address-form/state-select.d.ts +15 -0
  72. package/dist/cjs/components/credits/{creditsRedeemList/AddressForm/StateSelect.js → credits-redeem-list/address-form/state-select.js} +1 -1
  73. package/dist/cjs/components/credits/{creditsRedeemList/AddressForm/StateSelect.js.map → credits-redeem-list/address-form/state-select.js.map} +2 -2
  74. package/dist/cjs/components/credits/credits-redeem-list/address-form/type.d.ts +26 -0
  75. package/dist/cjs/components/credits/{creditsRedeemList/AddressForm → credits-redeem-list/address-form}/type.js.map +1 -1
  76. package/dist/cjs/components/credits/credits-redeem-list/index.d.ts +13 -0
  77. package/dist/cjs/components/credits/credits-redeem-list/index.js +2 -0
  78. package/dist/cjs/components/credits/credits-redeem-list/index.js.map +7 -0
  79. package/dist/cjs/components/credits/credits-redeem-list/redeem-coupon-modal.d.ts +9 -0
  80. package/dist/cjs/components/credits/credits-redeem-list/redeem-coupon-modal.js +2 -0
  81. package/dist/cjs/components/credits/credits-redeem-list/redeem-coupon-modal.js.map +7 -0
  82. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Address.d.ts +20 -0
  83. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Address.js +2 -0
  84. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Address.js.map +7 -0
  85. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Error.d.ts +8 -0
  86. package/dist/cjs/components/credits/{creditsRedeemList/RedeemProductModal → credits-redeem-list/redeem-product-modal}/Error.js.map +1 -1
  87. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Init.d.ts +11 -0
  88. package/dist/cjs/components/credits/{creditsRedeemList/RedeemProductModal → credits-redeem-list/redeem-product-modal}/Init.js.map +1 -1
  89. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/ProductInfo.d.ts +8 -0
  90. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/ProductInfo.js +2 -0
  91. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/ProductInfo.js.map +7 -0
  92. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Success.d.ts +13 -0
  93. package/dist/cjs/components/credits/{creditsRedeemList/RedeemProductModal → credits-redeem-list/redeem-product-modal}/Success.js.map +1 -1
  94. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/index.d.ts +11 -0
  95. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/index.js +2 -0
  96. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/index.js.map +7 -0
  97. package/dist/cjs/components/credits/credits-redeem-list/type.d.ts +77 -0
  98. package/dist/cjs/components/credits/{creditsRedeemList → credits-redeem-list}/type.js.map +1 -1
  99. package/dist/cjs/components/credits/credits-ways-to-get-credits/index.d.ts +2 -0
  100. package/dist/cjs/components/credits/{creditsWaysToGetCredits → credits-ways-to-get-credits}/index.js.map +2 -2
  101. package/dist/cjs/components/credits/credits-ways-to-get-credits/type.d.ts +60 -0
  102. package/dist/cjs/components/credits/{creditsWaysToGetCredits → credits-ways-to-get-credits}/type.js.map +1 -1
  103. package/dist/cjs/components/credits/credits-ways-to-get-credits/useActions.d.ts +96 -0
  104. package/dist/cjs/components/credits/credits-ways-to-get-credits/useActions.js +2 -0
  105. package/dist/cjs/components/credits/credits-ways-to-get-credits/useActions.js.map +7 -0
  106. package/dist/cjs/components/credits/creditsCash/type.d.ts +1 -1
  107. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/country-select.d.ts +14 -0
  108. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/form-item.d.ts +6 -0
  109. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/state-select.d.ts +15 -0
  110. package/dist/cjs/components/credits/type.d.ts +1 -1
  111. package/dist/cjs/components/credits/type.js.map +1 -1
  112. package/dist/cjs/index.d.ts +1 -6
  113. package/dist/cjs/index.js +726 -1
  114. package/dist/cjs/index.js.map +4 -4
  115. package/dist/cjs/shopify/context/ShopifyProvider.d.ts +1 -1
  116. package/dist/cjs/shopify/context/index.d.ts +1 -0
  117. package/dist/cjs/shopify/context/shopify-provider.d.ts +10 -0
  118. package/dist/cjs/shopify/fetchers/create-cart.d.ts +1 -2
  119. package/dist/cjs/shopify/hooks/index.d.ts +2 -2
  120. package/dist/cjs/shopify/hooks/use-create-cart.d.ts +2 -0
  121. package/dist/cjs/shopify/hooks/use-products-by-handles.d.ts +4 -0
  122. package/dist/cjs/shopify/hooks/useProductsByHandles.d.ts +1 -1
  123. package/dist/cjs/shopify/types/index.d.ts +2 -0
  124. package/dist/cjs/tsconfig.tsbuildinfo +1 -0
  125. package/dist/esm/components/chat/chat-context.d.ts +101 -0
  126. package/dist/esm/components/chat/chat-context.js +2 -0
  127. package/dist/esm/components/chat/chat-context.js.map +7 -0
  128. package/dist/esm/components/credits/context/hooks/useActivities.js +1 -1
  129. package/dist/esm/components/credits/context/hooks/useActivities.js.map +2 -2
  130. package/dist/esm/components/credits/context/hooks/useAddressValidate.js +1 -1
  131. package/dist/esm/components/credits/context/hooks/useAddressValidate.js.map +3 -3
  132. package/dist/esm/components/credits/context/hooks/useAlpcFetch.js +1 -1
  133. package/dist/esm/components/credits/context/hooks/useAlpcFetch.js.map +3 -3
  134. package/dist/esm/components/credits/context/hooks/useCountries.js +1 -1
  135. package/dist/esm/components/credits/context/hooks/useCountries.js.map +3 -3
  136. package/dist/esm/components/credits/context/hooks/useMyRewards.js +1 -1
  137. package/dist/esm/components/credits/context/hooks/useMyRewards.js.map +2 -2
  138. package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.d.ts +1 -1
  139. package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.js +1 -1
  140. package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.js.map +2 -2
  141. package/dist/esm/components/credits/context/hooks/useRedeemCoupon.js +1 -1
  142. package/dist/esm/components/credits/context/hooks/useRedeemCoupon.js.map +2 -2
  143. package/dist/esm/components/credits/context/hooks/useRedeemProduct.js +1 -1
  144. package/dist/esm/components/credits/context/hooks/useRedeemProduct.js.map +2 -2
  145. package/dist/esm/components/credits/context/hooks/useRedeemableList.js +1 -1
  146. package/dist/esm/components/credits/context/hooks/useRedeemableList.js.map +2 -2
  147. package/dist/esm/components/credits/context/hooks/useSendEmailValidation.js +1 -1
  148. package/dist/esm/components/credits/context/hooks/useSendEmailValidation.js.map +2 -2
  149. package/dist/esm/components/credits/context/hooks/useSubscribed.js +1 -1
  150. package/dist/esm/components/credits/context/hooks/useSubscribed.js.map +2 -2
  151. package/dist/esm/components/credits/context/hooks/useSubscriptions.js +1 -1
  152. package/dist/esm/components/credits/context/hooks/useSubscriptions.js.map +3 -3
  153. package/dist/esm/components/credits/credits-banner/index.d.ts +23 -0
  154. package/dist/esm/components/credits/credits-banner/index.js +2 -0
  155. package/dist/esm/components/credits/credits-banner/index.js.map +7 -0
  156. package/dist/esm/components/credits/credits-benefits/benefitItem.d.ts +19 -0
  157. package/dist/esm/components/credits/credits-benefits/benefitItem.js +2 -0
  158. package/dist/esm/components/credits/credits-benefits/benefitItem.js.map +7 -0
  159. package/dist/esm/components/credits/credits-benefits/iconInfo.d.ts +2 -0
  160. package/dist/esm/components/credits/credits-benefits/iconInfo.js +2 -0
  161. package/dist/esm/components/credits/credits-benefits/iconInfo.js.map +7 -0
  162. package/dist/esm/components/credits/credits-benefits/index.d.ts +12 -0
  163. package/dist/esm/components/credits/credits-benefits/index.js +4 -0
  164. package/dist/esm/components/credits/credits-benefits/index.js.map +7 -0
  165. package/dist/esm/components/credits/credits-cash/RedeemableItem.d.ts +15 -0
  166. package/dist/esm/components/credits/credits-cash/RedeemableItem.js +2 -0
  167. package/dist/esm/components/credits/credits-cash/RedeemableItem.js.map +7 -0
  168. package/dist/esm/components/credits/credits-cash/index.d.ts +13 -0
  169. package/dist/esm/components/credits/credits-cash/index.js +2 -0
  170. package/dist/esm/components/credits/credits-cash/index.js.map +7 -0
  171. package/dist/esm/components/credits/credits-cash/type.d.ts +47 -0
  172. package/dist/esm/components/credits/credits-cash/type.js +1 -0
  173. package/dist/esm/components/credits/credits-cash/type.js.map +7 -0
  174. package/dist/esm/components/credits/credits-faq/faq-item/FaqItem.d.ts +13 -0
  175. package/dist/esm/components/credits/credits-faq/faq-item/faq-item.d.ts +13 -0
  176. package/dist/esm/components/credits/credits-faq/faq-item/faq-item.js +2 -0
  177. package/dist/esm/components/credits/credits-faq/faq-item/faq-item.js.map +7 -0
  178. package/dist/esm/components/credits/credits-faq/faqItem/FaqItem.d.ts +13 -0
  179. package/dist/esm/components/credits/credits-faq/index.d.ts +16 -0
  180. package/dist/esm/components/credits/credits-faq/index.js +2 -0
  181. package/dist/esm/components/credits/credits-faq/index.js.map +7 -0
  182. package/dist/esm/components/credits/credits-info-card/index.d.ts +20 -0
  183. package/dist/esm/components/credits/credits-info-card/index.js +2 -0
  184. package/dist/esm/components/credits/credits-info-card/index.js.map +7 -0
  185. package/dist/esm/components/credits/credits-redeem-list/AddressForm/Input.d.ts +13 -0
  186. package/dist/esm/components/credits/credits-redeem-list/AddressForm/country-select.d.ts +14 -0
  187. package/dist/esm/components/credits/credits-redeem-list/AddressForm/form-item.d.ts +6 -0
  188. package/dist/esm/components/credits/credits-redeem-list/AddressForm/index.d.ts +2 -0
  189. package/dist/esm/components/credits/credits-redeem-list/AddressForm/state-select.d.ts +15 -0
  190. package/dist/esm/components/credits/credits-redeem-list/AddressForm/type.d.ts +26 -0
  191. package/dist/esm/components/credits/credits-redeem-list/RedeemCouponModal.d.ts +9 -0
  192. package/dist/esm/components/credits/credits-redeem-list/RedeemProductModal/Address.d.ts +20 -0
  193. package/dist/esm/components/credits/credits-redeem-list/RedeemProductModal/Error.d.ts +8 -0
  194. package/dist/esm/components/credits/credits-redeem-list/RedeemProductModal/Init.d.ts +11 -0
  195. package/dist/esm/components/credits/credits-redeem-list/RedeemProductModal/ProductInfo.d.ts +8 -0
  196. package/dist/esm/components/credits/credits-redeem-list/RedeemProductModal/Success.d.ts +13 -0
  197. package/dist/esm/components/credits/credits-redeem-list/RedeemProductModal/index.d.ts +11 -0
  198. package/dist/esm/components/credits/credits-redeem-list/RedeemableItem.d.ts +9 -0
  199. package/dist/esm/components/credits/credits-redeem-list/RedeemableItem.js +2 -0
  200. package/dist/esm/components/credits/credits-redeem-list/RedeemableItem.js.map +7 -0
  201. package/dist/esm/components/credits/credits-redeem-list/address-form/Input.d.ts +13 -0
  202. package/dist/esm/components/credits/credits-redeem-list/address-form/Input.js +2 -0
  203. package/dist/esm/components/credits/credits-redeem-list/address-form/Input.js.map +7 -0
  204. package/dist/esm/components/credits/credits-redeem-list/address-form/country-select.d.ts +14 -0
  205. package/dist/esm/components/credits/credits-redeem-list/address-form/country-select.js +2 -0
  206. package/dist/esm/components/credits/credits-redeem-list/address-form/country-select.js.map +7 -0
  207. package/dist/esm/components/credits/credits-redeem-list/address-form/form-item.d.ts +6 -0
  208. package/dist/esm/components/credits/credits-redeem-list/address-form/form-item.js +2 -0
  209. package/dist/esm/components/credits/credits-redeem-list/address-form/form-item.js.map +7 -0
  210. package/dist/esm/components/credits/credits-redeem-list/address-form/index.d.ts +2 -0
  211. package/dist/esm/components/credits/credits-redeem-list/address-form/index.js +2 -0
  212. package/dist/esm/components/credits/credits-redeem-list/address-form/index.js.map +7 -0
  213. package/dist/esm/components/credits/credits-redeem-list/address-form/state-select.d.ts +15 -0
  214. package/dist/esm/components/credits/credits-redeem-list/address-form/state-select.js +2 -0
  215. package/dist/esm/components/credits/credits-redeem-list/address-form/state-select.js.map +7 -0
  216. package/dist/esm/components/credits/credits-redeem-list/address-form/type.d.ts +26 -0
  217. package/dist/esm/components/credits/credits-redeem-list/address-form/type.js +1 -0
  218. package/dist/esm/components/credits/credits-redeem-list/address-form/type.js.map +7 -0
  219. package/dist/esm/components/credits/credits-redeem-list/index.d.ts +13 -0
  220. package/dist/esm/components/credits/credits-redeem-list/index.js +2 -0
  221. package/dist/esm/components/credits/credits-redeem-list/index.js.map +7 -0
  222. package/dist/esm/components/credits/credits-redeem-list/redeem-coupon-modal.d.ts +9 -0
  223. package/dist/esm/components/credits/credits-redeem-list/redeem-coupon-modal.js +2 -0
  224. package/dist/esm/components/credits/credits-redeem-list/redeem-coupon-modal.js.map +7 -0
  225. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Address.d.ts +20 -0
  226. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Address.js +2 -0
  227. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Address.js.map +7 -0
  228. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Error.d.ts +8 -0
  229. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Error.js +2 -0
  230. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Error.js.map +7 -0
  231. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Init.d.ts +11 -0
  232. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Init.js +2 -0
  233. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Init.js.map +7 -0
  234. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/ProductInfo.d.ts +8 -0
  235. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/ProductInfo.js +2 -0
  236. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/ProductInfo.js.map +7 -0
  237. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Success.d.ts +13 -0
  238. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Success.js +2 -0
  239. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Success.js.map +7 -0
  240. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/index.d.ts +11 -0
  241. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/index.js +2 -0
  242. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/index.js.map +7 -0
  243. package/dist/esm/components/credits/credits-redeem-list/type.d.ts +77 -0
  244. package/dist/esm/components/credits/credits-redeem-list/type.js +1 -0
  245. package/dist/esm/components/credits/credits-redeem-list/type.js.map +7 -0
  246. package/dist/esm/components/credits/credits-ways-to-get-credits/index.d.ts +2 -0
  247. package/dist/esm/components/credits/credits-ways-to-get-credits/index.js +2 -0
  248. package/dist/esm/components/credits/credits-ways-to-get-credits/index.js.map +7 -0
  249. package/dist/esm/components/credits/credits-ways-to-get-credits/type.d.ts +60 -0
  250. package/dist/esm/components/credits/credits-ways-to-get-credits/type.js +2 -0
  251. package/dist/esm/components/credits/credits-ways-to-get-credits/type.js.map +7 -0
  252. package/dist/esm/components/credits/credits-ways-to-get-credits/useActions.d.ts +96 -0
  253. package/dist/esm/components/credits/credits-ways-to-get-credits/useActions.js +2 -0
  254. package/dist/esm/components/credits/credits-ways-to-get-credits/useActions.js.map +7 -0
  255. package/dist/esm/components/credits/creditsBenefits/index.js +3 -3
  256. package/dist/esm/components/credits/creditsBenefits/index.js.map +3 -3
  257. package/dist/esm/components/credits/creditsCash/index.js +1 -1
  258. package/dist/esm/components/credits/creditsCash/index.js.map +2 -2
  259. package/dist/esm/components/credits/creditsCash/type.d.ts +1 -1
  260. package/dist/esm/components/credits/creditsRedeemList/AddressForm/country-select.d.ts +14 -0
  261. package/dist/esm/components/credits/creditsRedeemList/AddressForm/form-item.d.ts +6 -0
  262. package/dist/esm/components/credits/creditsRedeemList/AddressForm/index.js +1 -1
  263. package/dist/esm/components/credits/creditsRedeemList/AddressForm/index.js.map +2 -2
  264. package/dist/esm/components/credits/creditsRedeemList/AddressForm/state-select.d.ts +15 -0
  265. package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.js +1 -1
  266. package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.js.map +2 -2
  267. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.js +1 -1
  268. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.js.map +2 -2
  269. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js +1 -1
  270. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js.map +2 -2
  271. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.js +1 -1
  272. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.js.map +2 -2
  273. package/dist/esm/components/credits/creditsRedeemList/index.js +1 -1
  274. package/dist/esm/components/credits/creditsRedeemList/index.js.map +2 -2
  275. package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.js +1 -1
  276. package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.js.map +2 -2
  277. package/dist/esm/components/credits/modal/loadingDots.js +1 -1
  278. package/dist/esm/components/credits/modal/loadingDots.js.map +2 -2
  279. package/dist/esm/components/credits/type.d.ts +1 -1
  280. package/dist/esm/debug-env.js +2 -0
  281. package/dist/esm/debug-env.js.map +7 -0
  282. package/dist/esm/index.d.ts +1 -6
  283. package/dist/esm/index.js +1 -1
  284. package/dist/esm/index.js.map +3 -3
  285. package/dist/esm/shopify/context/ShopifyProvider.d.ts +1 -1
  286. package/dist/esm/shopify/context/index.d.ts +1 -0
  287. package/dist/esm/shopify/context/shopify-provider.d.ts +10 -0
  288. package/dist/esm/shopify/fetchers/create-cart.d.ts +1 -2
  289. package/dist/esm/shopify/hooks/index.d.ts +2 -2
  290. package/dist/esm/shopify/hooks/use-create-cart.d.ts +2 -0
  291. package/dist/esm/shopify/hooks/use-products-by-handles.d.ts +4 -0
  292. package/dist/esm/shopify/hooks/useProductsByHandles.d.ts +1 -1
  293. package/dist/esm/shopify/types/index.d.ts +2 -0
  294. package/dist/esm/stories/chat.stories.js +2 -0
  295. package/dist/esm/stories/chat.stories.js.map +7 -0
  296. package/dist/esm/tsconfig.tsbuildinfo +1 -0
  297. package/package.json +8 -3
  298. package/src/components/credits/context/hooks/useActivities.ts +1 -1
  299. package/src/components/credits/context/hooks/useAddressValidate.ts +2 -2
  300. package/src/components/credits/context/hooks/useAlpcFetch.ts +3 -3
  301. package/src/components/credits/context/hooks/useCountries.ts +2 -2
  302. package/src/components/credits/context/hooks/useMyRewards.ts +1 -1
  303. package/src/components/credits/context/hooks/useRedeemAndBuy.ts +2 -2
  304. package/src/components/credits/context/hooks/useRedeemCoupon.ts +1 -1
  305. package/src/components/credits/context/hooks/useRedeemProduct.ts +1 -1
  306. package/src/components/credits/context/hooks/useRedeemableList.ts +1 -1
  307. package/src/components/credits/context/hooks/useSendEmailValidation.ts +1 -1
  308. package/src/components/credits/context/hooks/useSubscribed.ts +1 -1
  309. package/src/components/credits/context/hooks/useSubscriptions.ts +2 -2
  310. package/src/components/credits/creditsBenefits/index.tsx +3 -5
  311. package/src/components/credits/creditsCash/index.tsx +2 -2
  312. package/src/components/credits/creditsCash/type.ts +1 -1
  313. package/src/components/credits/creditsRedeemList/AddressForm/index.tsx +1 -1
  314. package/src/components/credits/creditsRedeemList/RedeemCouponModal.tsx +1 -1
  315. package/src/components/credits/creditsRedeemList/RedeemProductModal/Address.tsx +1 -1
  316. package/src/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.tsx +1 -1
  317. package/src/components/credits/creditsRedeemList/RedeemProductModal/index.tsx +1 -1
  318. package/src/components/credits/creditsRedeemList/index.tsx +1 -1
  319. package/src/components/credits/creditsWaysToGetCredits/useActions.ts +1 -1
  320. package/src/components/credits/modal/loadingDots.tsx +2 -2
  321. package/src/components/credits/type.ts +1 -1
  322. package/src/index.ts +2 -21
  323. package/dist/cjs/components/credits/creditsCash/index.js +0 -2
  324. package/dist/cjs/components/credits/creditsCash/index.js.map +0 -7
  325. package/dist/cjs/components/credits/creditsCash/type.js.map +0 -7
  326. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/index.js +0 -2
  327. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/index.js.map +0 -7
  328. package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.js +0 -2
  329. package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.js.map +0 -7
  330. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.js +0 -2
  331. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.js.map +0 -7
  332. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js +0 -2
  333. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js.map +0 -7
  334. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.js +0 -2
  335. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.js.map +0 -7
  336. package/dist/cjs/components/credits/creditsRedeemList/index.js +0 -2
  337. package/dist/cjs/components/credits/creditsRedeemList/index.js.map +0 -7
  338. package/dist/cjs/components/credits/creditsWaysToGetCredits/useActions.js +0 -2
  339. package/dist/cjs/components/credits/creditsWaysToGetCredits/useActions.js.map +0 -7
  340. package/src/shopify/MIGRATION_GUIDE.md +0 -156
  341. package/src/shopify/context/ShopifyProvider.tsx +0 -34
  342. package/src/shopify/dist/cart-BNkVu3fh.d.ts +0 -220
  343. package/src/shopify/dist/cart-BcrGTPdx.d.cts +0 -220
  344. package/src/shopify/dist/fetchers.cjs +0 -7945
  345. package/src/shopify/dist/fetchers.cjs.map +0 -1
  346. package/src/shopify/dist/fetchers.d.cts +0 -3
  347. package/src/shopify/dist/fetchers.d.ts +0 -3
  348. package/src/shopify/dist/fetchers.js +0 -7942
  349. package/src/shopify/dist/fetchers.js.map +0 -1
  350. package/src/shopify/dist/fragments.cjs +0 -731
  351. package/src/shopify/dist/fragments.cjs.map +0 -1
  352. package/src/shopify/dist/fragments.d.cts +0 -25
  353. package/src/shopify/dist/fragments.d.ts +0 -25
  354. package/src/shopify/dist/fragments.js +0 -705
  355. package/src/shopify/dist/fragments.js.map +0 -1
  356. package/src/shopify/dist/graphql-D4M28V-x.d.cts +0 -3558
  357. package/src/shopify/dist/graphql-D4M28V-x.d.ts +0 -3558
  358. package/src/shopify/dist/hooks.cjs +0 -9431
  359. package/src/shopify/dist/hooks.cjs.map +0 -1
  360. package/src/shopify/dist/hooks.d.cts +0 -14
  361. package/src/shopify/dist/hooks.d.ts +0 -14
  362. package/src/shopify/dist/hooks.js +0 -9427
  363. package/src/shopify/dist/hooks.js.map +0 -1
  364. package/src/shopify/dist/index-BTtE4HZM.d.ts +0 -42
  365. package/src/shopify/dist/index-BjNIecYX.d.cts +0 -42
  366. package/src/shopify/dist/index.cjs +0 -9642
  367. package/src/shopify/dist/index.cjs.map +0 -1
  368. package/src/shopify/dist/index.d.cts +0 -11
  369. package/src/shopify/dist/index.d.ts +0 -11
  370. package/src/shopify/dist/index.js +0 -9619
  371. package/src/shopify/dist/index.js.map +0 -1
  372. package/src/shopify/dist/product-Bqi3sqb9.d.cts +0 -262
  373. package/src/shopify/dist/product-DNk6jYAP.d.ts +0 -262
  374. package/src/shopify/dist/queries.cjs +0 -615
  375. package/src/shopify/dist/queries.cjs.map +0 -1
  376. package/src/shopify/dist/queries.d.cts +0 -3
  377. package/src/shopify/dist/queries.d.ts +0 -3
  378. package/src/shopify/dist/queries.js +0 -601
  379. package/src/shopify/dist/queries.js.map +0 -1
  380. package/src/shopify/dist/types.cjs +0 -19
  381. package/src/shopify/dist/types.cjs.map +0 -1
  382. package/src/shopify/dist/types.d.cts +0 -282
  383. package/src/shopify/dist/types.d.ts +0 -282
  384. package/src/shopify/dist/types.js +0 -1
  385. package/src/shopify/dist/types.js.map +0 -1
  386. package/src/shopify/dist/utils.cjs +0 -334
  387. package/src/shopify/dist/utils.cjs.map +0 -1
  388. package/src/shopify/dist/utils.d.cts +0 -12
  389. package/src/shopify/dist/utils.d.ts +0 -12
  390. package/src/shopify/dist/utils.js +0 -319
  391. package/src/shopify/dist/utils.js.map +0 -1
  392. package/src/shopify/fetchers/create-cart.ts +0 -40
  393. package/src/shopify/fetchers/get-products-by-handles.ts +0 -41
  394. package/src/shopify/fetchers/index.ts +0 -3
  395. package/src/shopify/fragments/article.ts +0 -51
  396. package/src/shopify/fragments/blog.ts +0 -10
  397. package/src/shopify/fragments/cart.ts +0 -190
  398. package/src/shopify/fragments/collection.ts +0 -15
  399. package/src/shopify/fragments/image.ts +0 -8
  400. package/src/shopify/fragments/index.ts +0 -11
  401. package/src/shopify/fragments/metafields.ts +0 -17
  402. package/src/shopify/fragments/page-info.ts +0 -8
  403. package/src/shopify/fragments/page.ts +0 -12
  404. package/src/shopify/fragments/product.ts +0 -71
  405. package/src/shopify/fragments/seo.ts +0 -6
  406. package/src/shopify/fragments/variant.ts +0 -29
  407. package/src/shopify/gql/fragment-masking.ts +0 -85
  408. package/src/shopify/gql/gql.ts +0 -110
  409. package/src/shopify/gql/graphql.ts +0 -11780
  410. package/src/shopify/gql/index.ts +0 -4
  411. package/src/shopify/hooks/index.ts +0 -2
  412. package/src/shopify/hooks/useCreateCart.ts +0 -24
  413. package/src/shopify/hooks/useProductsByHandles.ts +0 -25
  414. package/src/shopify/mutations/create-cart.ts +0 -16
  415. package/src/shopify/package.json +0 -84
  416. package/src/shopify/queries/get-product-by-handles.ts +0 -32
  417. package/src/shopify/queries/index.ts +0 -2
  418. package/src/shopify/src/index.ts +0 -5
  419. package/src/shopify/tsconfig.json +0 -25
  420. package/src/shopify/tsup.config.ts +0 -21
  421. package/src/shopify/types/article.ts +0 -46
  422. package/src/shopify/types/cart.ts +0 -202
  423. package/src/shopify/types/checkout.ts +0 -44
  424. package/src/shopify/types/collection.ts +0 -104
  425. package/src/shopify/types/common.ts +0 -53
  426. package/src/shopify/types/config.ts +0 -14
  427. package/src/shopify/types/customer.ts +0 -31
  428. package/src/shopify/types/fetcher.ts +0 -61
  429. package/src/shopify/types/index.ts +0 -10
  430. package/src/shopify/types/page.ts +0 -45
  431. package/src/shopify/types/product.ts +0 -176
  432. package/src/shopify/types/search.ts +0 -62
  433. package/src/shopify/types/site.ts +0 -38
  434. package/src/shopify/types/type-helper.ts +0 -5
  435. package/src/shopify/utils/colors.ts +0 -206
  436. package/src/shopify/utils/const.ts +0 -115
  437. package/src/shopify/utils/cookie.ts +0 -39
  438. package/src/shopify/utils/errors.ts +0 -65
  439. package/src/shopify/utils/fetch-graphql-api.ts +0 -67
  440. package/src/shopify/utils/handle-fetch-response.ts +0 -60
  441. package/src/shopify/utils/helper.ts +0 -89
  442. package/src/shopify/utils/normalize/cart.ts +0 -106
  443. package/src/shopify/utils/normalize/customer.ts +0 -18
  444. package/src/shopify/utils/normalize/index.ts +0 -2
  445. package/src/shopify/utils/normalize/metafield.ts +0 -69
  446. package/src/shopify/utils/normalize/product.ts +0 -193
  447. package/src/shopify/utils/store.ts +0 -5
  448. package/src/shopify/utils/type-helper.ts +0 -7
  449. /package/dist/cjs/components/credits/{creditsBanner → credits-banner}/index.js +0 -0
  450. /package/dist/cjs/components/credits/{creditsBenefits → credits-benefits}/benefitItem.js +0 -0
  451. /package/dist/cjs/components/credits/{creditsBenefits → credits-benefits}/iconInfo.js +0 -0
  452. /package/dist/cjs/components/credits/{creditsBenefits → credits-benefits}/index.js +0 -0
  453. /package/dist/cjs/components/credits/{creditsCash → credits-cash}/RedeemableItem.js +0 -0
  454. /package/dist/cjs/components/credits/{creditsCash → credits-cash}/type.js +0 -0
  455. /package/dist/cjs/components/credits/{creditsFaq → credits-faq}/index.js +0 -0
  456. /package/dist/cjs/components/credits/{creditsInfoCard → credits-info-card}/index.js +0 -0
  457. /package/dist/cjs/components/credits/{creditsRedeemList → credits-redeem-list}/RedeemableItem.js +0 -0
  458. /package/dist/cjs/components/credits/{creditsRedeemList/AddressForm → credits-redeem-list/address-form}/Input.js +0 -0
  459. /package/dist/cjs/components/credits/{creditsRedeemList/AddressForm → credits-redeem-list/address-form}/type.js +0 -0
  460. /package/dist/cjs/components/credits/{creditsRedeemList/RedeemProductModal → credits-redeem-list/redeem-product-modal}/Error.js +0 -0
  461. /package/dist/cjs/components/credits/{creditsRedeemList/RedeemProductModal → credits-redeem-list/redeem-product-modal}/Init.js +0 -0
  462. /package/dist/cjs/components/credits/{creditsRedeemList/RedeemProductModal → credits-redeem-list/redeem-product-modal}/Success.js +0 -0
  463. /package/dist/cjs/components/credits/{creditsRedeemList → credits-redeem-list}/type.js +0 -0
  464. /package/dist/cjs/components/credits/{creditsWaysToGetCredits → credits-ways-to-get-credits}/index.js +0 -0
  465. /package/dist/cjs/components/credits/{creditsWaysToGetCredits → credits-ways-to-get-credits}/type.js +0 -0
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/components/credits/credits-redeem-list/redeem-product-modal/Address.tsx"],
4
+ "sourcesContent": ["import { Button, Text } from '@anker-in/headless-ui'\nimport classNames from 'classnames'\nimport { AddressForm } from '../AddressForm'\nimport { useShopifyContext } from '@shopify/context'\nimport type { RedeemableItem as RedeemableItemType } from '../../type'\nimport { CreditsRedeemListCopy } from '../type'\nimport { ProductInfo } from './ProductInfo'\nimport useCountries from '../../context/hooks/useCountries'\n\ntype AddressProps = {\n copy: CreditsRedeemListCopy\n shippingAddress: string\n setAddress: (address: Record<string, any>) => void\n validateAddress: (address: Record<string, any>) => boolean\n validateErrors: { key: string; message: string }[]\n item: RedeemableItemType\n loading: boolean\n address: Record<string, any> | undefined\n disabled: boolean\n handlePayment: () => void\n shippingProduct: string\n}\n\nexport const Address = ({\n copy,\n shippingAddress,\n setAddress,\n validateAddress,\n validateErrors,\n shippingProduct,\n loading,\n address,\n disabled,\n handlePayment,\n item,\n}: AddressProps) => {\n const { storeDomain } = useShopifyContext()\n const { countries = [], isLoading: countriesLoading } = useCountries({ shopifyStoreDomain: storeDomain })\n\n return (\n <div className=\"relative\">\n <div className={classNames('max-h-[500px] overflow-y-auto px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]')}>\n <div>\n {shippingAddress && <Text className=\"mb-5 text-[16px] font-bold\" html={shippingAddress}></Text>}\n <AddressForm\n onChange={setAddress}\n validate={validateAddress}\n errors={validateErrors}\n form={copy.redeemModal.product.addressForm}\n countries={countries}\n countriesLoading={countriesLoading}\n ></AddressForm>\n </div>\n </div>\n <div className=\"sticky bottom-0 flex flex-col items-center justify-center bg-white px-[48px] py-[24px] l:px-[16px]\">\n <div className=\"flex w-full items-center rounded-[16px] bg-[#F5F5F7] p-[16px]\">\n {shippingProduct && <Text className=\"mb-5 text-[16px] font-bold\" html={shippingProduct}></Text>}\n <ProductInfo item={item} copy={copy} />\n </div>\n <Button\n loading={loading || !address}\n variant=\"primary\"\n className=\"mx-auto mt-[16px] w-[444px] md:mt-[12px] md:w-full\"\n onClick={handlePayment}\n disabled={disabled}\n >\n {copy.redeemModal.product.paymentButton}\n </Button>\n </div>\n </div>\n )\n}\n"],
5
+ "mappings": "AA0CQ,OACsB,OAAAA,EADtB,QAAAC,MAAA,oBA1CR,OAAS,UAAAC,EAAQ,QAAAC,MAAY,wBAC7B,OAAOC,MAAgB,aACvB,OAAS,eAAAC,MAAmB,iBAC5B,OAAS,qBAAAC,MAAyB,mBAGlC,OAAS,eAAAC,MAAmB,gBAC5B,OAAOC,MAAkB,mCAgBlB,MAAMC,EAAU,CAAC,CACtB,KAAAC,EACA,gBAAAC,EACA,WAAAC,EACA,gBAAAC,EACA,eAAAC,EACA,gBAAAC,EACA,QAAAC,EACA,QAAAC,EACA,SAAAC,EACA,cAAAC,EACA,KAAAC,CACF,IAAoB,CAClB,KAAM,CAAE,YAAAC,CAAY,EAAIf,EAAkB,EACpC,CAAE,UAAAgB,EAAY,CAAC,EAAG,UAAWC,CAAiB,EAAIf,EAAa,CAAE,mBAAoBa,CAAY,CAAC,EAExG,OACEpB,EAAC,OAAI,UAAU,WACb,UAAAD,EAAC,OAAI,UAAWI,EAAW,iFAAiF,EAC1G,SAAAH,EAAC,OACE,UAAAU,GAAmBX,EAACG,EAAA,CAAK,UAAU,6BAA6B,KAAMQ,EAAiB,EACxFX,EAACK,EAAA,CACC,SAAUO,EACV,SAAUC,EACV,OAAQC,EACR,KAAMJ,EAAK,YAAY,QAAQ,YAC/B,UAAWY,EACX,iBAAkBC,EACnB,GACH,EACF,EACAtB,EAAC,OAAI,UAAU,qGACb,UAAAA,EAAC,OAAI,UAAU,gEACZ,UAAAc,GAAmBf,EAACG,EAAA,CAAK,UAAU,6BAA6B,KAAMY,EAAiB,EACxFf,EAACO,EAAA,CAAY,KAAMa,EAAM,KAAMV,EAAM,GACvC,EACAV,EAACE,EAAA,CACC,QAASc,GAAW,CAACC,EACrB,QAAQ,UACR,UAAU,qDACV,QAASE,EACT,SAAUD,EAET,SAAAR,EAAK,YAAY,QAAQ,cAC5B,GACF,GACF,CAEJ",
6
+ "names": ["jsx", "jsxs", "Button", "Text", "classNames", "AddressForm", "useShopifyContext", "ProductInfo", "useCountries", "Address", "copy", "shippingAddress", "setAddress", "validateAddress", "validateErrors", "shippingProduct", "loading", "address", "disabled", "handlePayment", "item", "storeDomain", "countries", "countriesLoading"]
7
+ }
@@ -0,0 +1,8 @@
1
+ type ErrorProps = {
2
+ errorInfo: {
3
+ imageUrl: string;
4
+ message: string;
5
+ };
6
+ };
7
+ export declare const Error: ({ errorInfo }: ErrorProps) => import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,2 @@
1
+ import{jsx as e,jsxs as a}from"react/jsx-runtime";import{Picture as t,Text as s}from"@anker-in/headless-ui";const x=({errorInfo:r})=>a("div",{className:"mx-auto max-w-[404px] text-[16px] text-black/40",children:[e(t,{className:"mx-auto mb-[12px] h-[140px] w-[220px]",source:r.imageUrl}),e(s,{as:"div",className:"mt-[16px] text-center",html:r.message})]});export{x as Error};
2
+ //# sourceMappingURL=Error.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/components/credits/credits-redeem-list/redeem-product-modal/Error.tsx"],
4
+ "sourcesContent": ["import { Picture, Text } from '@anker-in/headless-ui'\n\ntype ErrorProps = {\n errorInfo: { imageUrl: string; message: string }\n}\n\nexport const Error = ({ errorInfo }: ErrorProps) => {\n return (\n <div className=\"mx-auto max-w-[404px] text-[16px] text-black/40\">\n <Picture className=\"mx-auto mb-[12px] h-[140px] w-[220px]\" source={errorInfo.imageUrl} />\n <Text as=\"div\" className=\"mt-[16px] text-center\" html={errorInfo.message} />\n </div>\n )\n}\n"],
5
+ "mappings": "AAQI,OACE,OAAAA,EADF,QAAAC,MAAA,oBARJ,OAAS,WAAAC,EAAS,QAAAC,MAAY,wBAMvB,MAAMC,EAAQ,CAAC,CAAE,UAAAC,CAAU,IAE9BJ,EAAC,OAAI,UAAU,kDACb,UAAAD,EAACE,EAAA,CAAQ,UAAU,wCAAwC,OAAQG,EAAU,SAAU,EACvFL,EAACG,EAAA,CAAK,GAAG,MAAM,UAAU,wBAAwB,KAAME,EAAU,QAAS,GAC5E",
6
+ "names": ["jsx", "jsxs", "Picture", "Text", "Error", "errorInfo"]
7
+ }
@@ -0,0 +1,11 @@
1
+ import type { RedeemableItem as RedeemableItemType } from '../../type';
2
+ import { CreditsRedeemListCopy } from '../type';
3
+ type InitProps = {
4
+ copy: CreditsRedeemListCopy;
5
+ item: RedeemableItemType;
6
+ loading: boolean;
7
+ disabled: boolean;
8
+ setStatus: (status: 'address' | 'init' | 'success' | 'error') => void;
9
+ };
10
+ export declare const Init: ({ copy, item, loading, disabled, setStatus }: InitProps) => import("react/jsx-runtime").JSX.Element;
11
+ export {};
@@ -0,0 +1,2 @@
1
+ import{Fragment as b,jsx as e,jsxs as s}from"react/jsx-runtime";import{Button as f,Picture as i,Text as a}from"@anker-in/headless-ui";import m from"classnames";import{Fragment as u,useMemo as g}from"react";import{numberFormat as v}from"../../context/utils";import{ConsumeType as r}from"../../context/const";const F=({copy:l,item:t,loading:x,disabled:n,setStatus:c})=>{const p=g(()=>t.config.rules?.length?t.config.rules:[...t.config.desc?.split("<br>")||[],...l.redeemModal.product.rules||[]],[t.config.rules,t.config.desc,l.redeemModal.product.rules]);return console.log("item",t),s("div",{className:"flex flex-col",children:[e("div",{className:m("max-h-[500px] overflow-y-auto bg-[#F5F5F7] px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]"),children:s(b,{children:[s("div",{className:"relative mx-auto h-[164px] w-fit",children:[e(i,{source:t.config?.type===r.Product?t.product.images[0]?.url:l?.imageMapping[t.config.type]?.url||t.config.image?.url,className:"h-full w-auto [&_img]:h-full [&_img]:w-auto [&_img]:object-contain"}),e("div",{className:"absolute bottom-[8px] left-[16px] font-extrabold text-white",children:t.config.value&&s("div",{className:"flex items-end gap-[4px]",children:[e(a,{className:"text-[64px] font-bold leading-none",html:t.config.value.toString()}),e(a,{className:"text-[24px] font-bold leading-[2]",html:t.config.type===r.Coupon?l?.off:l?.giftCardLabel})]})})]}),s("div",{className:"mt-[30px] md:mt-[18px]",children:[t.config.type==="product"&&e("div",{className:m("mb-[4px] text-center text-[24px] font-bold leading-[1.2] md:text-[20px] md:leading-[1.2]"),children:t.config.title}),s(a,{as:"p",className:m(" text-center text-[24px] font-bold leading-[1.2] md:text-[20px] md:leading-[1.2]"),children:[v(t.alpc?.consumeCredits)," ",l?.pointUnit]})]}),s("div",{className:"mt-[16px] w-full text-[14px] font-semibold text-[#777] md:mt-[12px]",children:[e("div",{className:"text-[16px] font-bold leading-[1.4]",children:l.redeemModal.product.stepTitle}),e("div",{className:"mt-[4px] flex items-center justify-center",children:l.redeemModal.product.steps?.map((d,o)=>s(u,{children:[s("div",{className:"flex w-[76px] flex-col items-center text-center md:h-[94px] min-l:w-[130px]",children:[e(i,{source:d.imageUrl,className:"mb-[4px] h-[58px] w-[58px]"}),e("div",{className:"min-h-[34px] text-[14px] font-bold text-[#777] md:min-h-[28px] md:text-[12px]",children:d.title})]}),o!==l.redeemModal.product.steps.length-1&&e(i,{source:"https://cdn.shopify.com/s/files/1/0517/6767/3016/files/step-arrow.png?v=1690458150",className:"mb-[20px] h-[10px] w-[20px] md:mb-[30px] md:h-[5px] md:w-[12px]"})]},o))}),e("div",{className:"overflow-auto",children:p?.length&&e("ul",{className:"ml-[18px] mt-[16px] grid grid-flow-row gap-[4px] text-[16px] font-bold leading-[1.4] text-[#6D6D6F] md:mt-[12px]",children:p.map((d,o)=>e("li",{className:"list-disc",children:e(a,{as:"div",html:d,className:"font-bold"})},o))})})]})]})}),s("div",{className:"flex-1 bg-white px-[48px] py-[24px] text-center md:px-[16px]",children:[e(a,{as:"p",className:"block text-[24px] font-bold leading-[1.2] md:text-[20px] md:leading-[1.2]",html:l.redeemModal.confirmTitle}),e(f,{loading:x,disabled:n,variant:"primary",size:"lg",className:"mt-[16px] w-full md:mt-[12px]",onClick:()=>{c("address")},children:l.redeemModal.confirmButton})]})]})};export{F as Init};
2
+ //# sourceMappingURL=Init.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/components/credits/credits-redeem-list/redeem-product-modal/Init.tsx"],
4
+ "sourcesContent": ["import { Button, Picture, Text } from '@anker-in/headless-ui'\nimport classNames from 'classnames'\nimport { Fragment, useMemo } from 'react'\nimport { numberFormat } from '../../context/utils'\nimport type { RedeemableItem as RedeemableItemType } from '../../type'\nimport { CreditsRedeemListCopy } from '../type'\nimport { ConsumeType } from '../../context/const'\n\ntype InitProps = {\n copy: CreditsRedeemListCopy\n item: RedeemableItemType\n loading: boolean\n disabled: boolean\n setStatus: (status: 'address' | 'init' | 'success' | 'error') => void\n}\n\nexport const Init = ({ copy, item, loading, disabled, setStatus }: InitProps) => {\n const rules = useMemo(() => {\n if (item.config.rules?.length) {\n return item.config.rules\n }\n const descriptions = item.config.desc?.split('<br>') || []\n return [...descriptions, ...(copy.redeemModal.product.rules || [])]\n }, [item.config.rules, item.config.desc, copy.redeemModal.product.rules])\n\n console.log('item', item)\n return (\n <div className=\"flex flex-col\">\n <div\n className={classNames(\n 'max-h-[500px] overflow-y-auto bg-[#F5F5F7] px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]'\n )}\n >\n <>\n <div className=\"relative mx-auto h-[164px] w-fit\">\n <Picture\n source={\n item.config?.type === ConsumeType.Product\n ? item.product.images[0]?.url\n : copy?.imageMapping[item.config.type]?.url || item.config.image?.url\n }\n className=\"h-full w-auto [&_img]:h-full [&_img]:w-auto [&_img]:object-contain\"\n ></Picture>\n {/* \u793C\u54C1\u5361\u5C55\u793A */}\n <div className=\"absolute bottom-[8px] left-[16px] font-extrabold text-white\">\n {item.config.value && (\n <div className=\"flex items-end gap-[4px]\">\n <Text className=\"text-[64px] font-bold leading-none\" html={item.config.value.toString()} />\n <Text\n className=\"text-[24px] font-bold leading-[2]\"\n html={item.config.type === ConsumeType.Coupon ? copy?.off : copy?.giftCardLabel}\n />\n </div>\n )}\n </div>\n </div>\n <div className=\"mt-[30px] md:mt-[18px]\">\n {item.config.type === 'product' && (\n <div\n className={classNames(\n 'mb-[4px] text-center text-[24px] font-bold leading-[1.2] md:text-[20px] md:leading-[1.2]'\n )}\n >\n {item.config.title}\n </div>\n )}\n <Text\n as=\"p\"\n className={classNames(' text-center text-[24px] font-bold leading-[1.2] md:text-[20px] md:leading-[1.2]')}\n >\n {numberFormat(item.alpc?.consumeCredits)} {copy?.pointUnit}\n </Text>\n </div>\n <div className=\"mt-[16px] w-full text-[14px] font-semibold text-[#777] md:mt-[12px]\">\n <div className=\"text-[16px] font-bold leading-[1.4]\">{copy.redeemModal.product.stepTitle}</div>\n <div className=\"mt-[4px] flex items-center justify-center\">\n {copy.redeemModal.product.steps?.map((item, index) => (\n <Fragment key={index}>\n <div className=\"flex w-[76px] flex-col items-center text-center md:h-[94px] min-l:w-[130px]\">\n <Picture source={item.imageUrl} className=\"mb-[4px] h-[58px] w-[58px]\"></Picture>\n <div className=\"min-h-[34px] text-[14px] font-bold text-[#777] md:min-h-[28px] md:text-[12px]\">\n {item.title}\n </div>\n </div>\n {index !== copy.redeemModal.product.steps.length - 1 && (\n <Picture\n source=\"https://cdn.shopify.com/s/files/1/0517/6767/3016/files/step-arrow.png?v=1690458150\"\n className=\"mb-[20px] h-[10px] w-[20px] md:mb-[30px] md:h-[5px] md:w-[12px]\"\n ></Picture>\n )}\n </Fragment>\n ))}\n </div>\n <div className=\"overflow-auto\">\n {rules?.length && (\n <ul className=\"ml-[18px] mt-[16px] grid grid-flow-row gap-[4px] text-[16px] font-bold leading-[1.4] text-[#6D6D6F] md:mt-[12px]\">\n {rules.map((text, index) => (\n <li className=\"list-disc\" key={index}>\n <Text as=\"div\" html={text} className=\"font-bold\" />\n </li>\n ))}\n </ul>\n )}\n </div>\n </div>\n </>\n </div>\n <div className=\"flex-1 bg-white px-[48px] py-[24px] text-center md:px-[16px]\">\n <Text\n as=\"p\"\n className=\"block text-[24px] font-bold leading-[1.2] md:text-[20px] md:leading-[1.2]\"\n html={copy.redeemModal.confirmTitle}\n ></Text>\n <Button\n loading={loading}\n disabled={disabled}\n variant=\"primary\"\n size=\"lg\"\n className=\"mt-[16px] w-full md:mt-[12px]\"\n onClick={() => {\n setStatus('address')\n }}\n >\n {copy.redeemModal.confirmButton}\n </Button>\n </div>\n </div>\n )\n}\n"],
5
+ "mappings": "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",
6
+ "names": ["Fragment", "jsx", "jsxs", "Button", "Picture", "Text", "classNames", "useMemo", "numberFormat", "ConsumeType", "Init", "copy", "item", "loading", "disabled", "setStatus", "rules", "index", "text"]
7
+ }
@@ -0,0 +1,8 @@
1
+ import type { RedeemableItem as RedeemableItemType } from '../../type';
2
+ import { CreditsRedeemListCopy } from '../type';
3
+ type ProductInfoProps = {
4
+ item: RedeemableItemType;
5
+ copy: CreditsRedeemListCopy;
6
+ };
7
+ export declare const ProductInfo: ({ item, copy }: ProductInfoProps) => import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,2 @@
1
+ import{jsx as a,jsxs as e}from"react/jsx-runtime";import{Picture as m}from"@anker-in/headless-ui";import{formatPrice as l}from"../../context/utils";import{useShopifyContext as i}from"@shopify/context";const x=({item:t,copy:d})=>{const{locale:s}=i();return e("div",{className:"flex w-full items-center justify-center md:items-start md:justify-start",children:[a(m,{className:"mr-[16px] size-[100px] shrink-0 md:mr-[12px] md:hidden md:size-[44px] [&_img]:h-full [&_img]:w-auto [&_img]:object-contain",source:t.variant.image?.url||t.product?.images[0]?.url,alt:t.product.title}),e("div",{className:"md:flex md:flex-col",children:[e("div",{className:"md:flex md:items-center",children:[a(m,{className:"mr-[16px] size-[100px] shrink-0 md:mr-[12px] md:size-[44px] min-md:hidden [&_img]:h-full [&_img]:w-auto [&_img]:object-contain",source:t.variant.image?.url||t.product?.images[0]?.url,alt:t.product.title}),a("div",{className:"flex-1 text-[16px] font-bold leading-[1.4] min-l:!hidden",title:t.product.title,children:t.product.title})]}),e("div",{className:"mt-[16px] md:mt-[12px]",children:[a("div",{className:"mb-[12px] line-clamp-1 text-[16px] font-bold l:!hidden",title:t.product.title,children:t.product.title}),e("div",{className:"flex font-semibold leading-[1.4] md:flex-col",children:[e("div",{className:"mr-[40px] text-[15px] font-bold text-[#777] md:mr-0 md:text-[12px]",children:[e("div",{className:"mb-[8px] flex items-center md:mb-[4px]",children:[e("span",{children:[d.redeemModal.product.variantLabel,": "]}),a("span",{className:"ml-1",children:t.variant.title||""})]}),e("div",{className:"mb-[8px] flex items-center md:mb-[4px]",children:[e("span",{children:[d.redeemModal.product.shippingFeeLabel,": "]}),a("span",{className:"ml-1",children:l({amount:0,currencyCode:t.product.price?.currencyCode,locale:s||"us"})})]})]}),e("div",{className:"text-[15px] font-bold text-[#777] md:text-[12px]",children:[e("div",{className:"mb-[8px] flex items-center md:mb-[4px]",children:[e("span",{children:[d.redeemModal.product.quantityLabel,": "]}),a("span",{className:"ml-1",children:"1"})]}),e("div",{className:"l:flex l:items-center l:justify-between",children:[e("span",{children:[d.redeemModal.product.totalPriceLabel,": "]}),e("span",{className:"ml-1",children:[t.alpc?.consumeCredits," ",d?.pointUnit]})]})]})]})]})]})]})};export{x as ProductInfo};
2
+ //# sourceMappingURL=ProductInfo.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/components/credits/credits-redeem-list/redeem-product-modal/ProductInfo.tsx"],
4
+ "sourcesContent": ["import { Picture } from '@anker-in/headless-ui'\nimport { formatPrice } from '../../context/utils'\nimport type { RedeemableItem as RedeemableItemType } from '../../type'\nimport { CreditsRedeemListCopy } from '../type'\nimport { useShopifyContext } from '@shopify/context'\n\ntype ProductInfoProps = {\n item: RedeemableItemType\n copy: CreditsRedeemListCopy\n}\n\nexport const ProductInfo = ({ item, copy }: ProductInfoProps) => {\n const { locale } = useShopifyContext()\n\n return (\n <div className=\"flex w-full items-center justify-center md:items-start md:justify-start\">\n <Picture\n className=\"mr-[16px] size-[100px] shrink-0 md:mr-[12px] md:hidden md:size-[44px] [&_img]:h-full [&_img]:w-auto [&_img]:object-contain\"\n source={item.variant.image?.url || item.product?.images[0]?.url}\n alt={item.product.title}\n ></Picture>\n <div className=\"md:flex md:flex-col\">\n <div className=\"md:flex md:items-center\">\n <Picture\n className=\"mr-[16px] size-[100px] shrink-0 md:mr-[12px] md:size-[44px] min-md:hidden [&_img]:h-full [&_img]:w-auto [&_img]:object-contain\"\n source={item.variant.image?.url || item.product?.images[0]?.url}\n alt={item.product.title}\n ></Picture>\n <div className=\"flex-1 text-[16px] font-bold leading-[1.4] min-l:!hidden\" title={item.product.title}>\n {item.product.title}\n </div>\n </div>\n\n <div className=\"mt-[16px] md:mt-[12px]\">\n <div className=\"mb-[12px] line-clamp-1 text-[16px] font-bold l:!hidden\" title={item.product.title}>\n {item.product.title}\n </div>\n <div className=\"flex font-semibold leading-[1.4] md:flex-col\">\n <div className=\"mr-[40px] text-[15px] font-bold text-[#777] md:mr-0 md:text-[12px]\">\n <div className=\"mb-[8px] flex items-center md:mb-[4px]\">\n <span>{copy.redeemModal.product.variantLabel}: </span>\n <span className=\"ml-1\">{item.variant.title || ''}</span>\n </div>\n <div className=\"mb-[8px] flex items-center md:mb-[4px]\">\n <span>{copy.redeemModal.product.shippingFeeLabel}: </span>\n <span className=\"ml-1\">\n {formatPrice({\n amount: 0,\n currencyCode: item.product.price?.currencyCode!,\n locale: locale || 'us',\n })}\n </span>\n </div>\n </div>\n <div className=\"text-[15px] font-bold text-[#777] md:text-[12px]\">\n <div className=\"mb-[8px] flex items-center md:mb-[4px]\">\n <span>{copy.redeemModal.product.quantityLabel}: </span>\n <span className=\"ml-1\">1</span>\n </div>\n <div className=\"l:flex l:items-center l:justify-between\">\n <span>{copy.redeemModal.product.totalPriceLabel}: </span>\n <span className=\"ml-1\">\n {item.alpc?.consumeCredits} {copy?.pointUnit}\n </span>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n )\n}\n"],
5
+ "mappings": "AAgBM,cAAAA,EAME,QAAAC,MANF,oBAhBN,OAAS,WAAAC,MAAe,wBACxB,OAAS,eAAAC,MAAmB,sBAG5B,OAAS,qBAAAC,MAAyB,mBAO3B,MAAMC,EAAc,CAAC,CAAE,KAAAC,EAAM,KAAAC,CAAK,IAAwB,CAC/D,KAAM,CAAE,OAAAC,CAAO,EAAIJ,EAAkB,EAErC,OACEH,EAAC,OAAI,UAAU,0EACb,UAAAD,EAACE,EAAA,CACC,UAAU,6HACV,OAAQI,EAAK,QAAQ,OAAO,KAAOA,EAAK,SAAS,OAAO,CAAC,GAAG,IAC5D,IAAKA,EAAK,QAAQ,MACnB,EACDL,EAAC,OAAI,UAAU,sBACb,UAAAA,EAAC,OAAI,UAAU,0BACb,UAAAD,EAACE,EAAA,CACC,UAAU,iIACV,OAAQI,EAAK,QAAQ,OAAO,KAAOA,EAAK,SAAS,OAAO,CAAC,GAAG,IAC5D,IAAKA,EAAK,QAAQ,MACnB,EACDN,EAAC,OAAI,UAAU,2DAA2D,MAAOM,EAAK,QAAQ,MAC3F,SAAAA,EAAK,QAAQ,MAChB,GACF,EAEAL,EAAC,OAAI,UAAU,yBACb,UAAAD,EAAC,OAAI,UAAU,yDAAyD,MAAOM,EAAK,QAAQ,MACzF,SAAAA,EAAK,QAAQ,MAChB,EACAL,EAAC,OAAI,UAAU,+CACb,UAAAA,EAAC,OAAI,UAAU,qEACb,UAAAA,EAAC,OAAI,UAAU,yCACb,UAAAA,EAAC,QAAM,UAAAM,EAAK,YAAY,QAAQ,aAAa,MAAE,EAC/CP,EAAC,QAAK,UAAU,OAAQ,SAAAM,EAAK,QAAQ,OAAS,GAAG,GACnD,EACAL,EAAC,OAAI,UAAU,yCACb,UAAAA,EAAC,QAAM,UAAAM,EAAK,YAAY,QAAQ,iBAAiB,MAAE,EACnDP,EAAC,QAAK,UAAU,OACb,SAAAG,EAAY,CACX,OAAQ,EACR,aAAcG,EAAK,QAAQ,OAAO,aAClC,OAAQE,GAAU,IACpB,CAAC,EACH,GACF,GACF,EACAP,EAAC,OAAI,UAAU,mDACb,UAAAA,EAAC,OAAI,UAAU,yCACb,UAAAA,EAAC,QAAM,UAAAM,EAAK,YAAY,QAAQ,cAAc,MAAE,EAChDP,EAAC,QAAK,UAAU,OAAO,aAAC,GAC1B,EACAC,EAAC,OAAI,UAAU,0CACb,UAAAA,EAAC,QAAM,UAAAM,EAAK,YAAY,QAAQ,gBAAgB,MAAE,EAClDN,EAAC,QAAK,UAAU,OACb,UAAAK,EAAK,MAAM,eAAe,IAAEC,GAAM,WACrC,GACF,GACF,GACF,GACF,GACF,GACF,CAEJ",
6
+ "names": ["jsx", "jsxs", "Picture", "formatPrice", "useShopifyContext", "ProductInfo", "item", "copy", "locale"]
7
+ }
@@ -0,0 +1,13 @@
1
+ import type { RedeemableItem as RedeemableItemType } from '../../type';
2
+ import { CreditsRedeemListCopy } from '../type';
3
+ type SuccessProps = {
4
+ copy: CreditsRedeemListCopy;
5
+ shippingProduct: string;
6
+ loading: boolean;
7
+ address: Record<string, any> | undefined;
8
+ disabled: boolean;
9
+ onClose: () => void;
10
+ item: RedeemableItemType;
11
+ };
12
+ export declare const Success: ({ copy, shippingProduct, loading, address, disabled, onClose, item }: SuccessProps) => import("react/jsx-runtime").JSX.Element;
13
+ export {};
@@ -0,0 +1,2 @@
1
+ import{jsx as e,jsxs as u}from"react/jsx-runtime";import{Button as x,Text as o}from"@anker-in/headless-ui";import n from"classnames";import{ProductInfo as c}from"./ProductInfo";const N=({copy:t,shippingProduct:m,loading:d,address:s,disabled:p,onClose:a,item:l})=>e("div",{className:n("max-h-[500px] overflow-y-auto px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]"),children:u("div",{className:"flex flex-col items-center",children:[e("div",{className:"mb-[16px] grid grid-flow-row gap-y-[4px] md:mb-[12px]",children:t.redeemModal.product.successDesc.map((r,i)=>e(o,{className:"text-[18px] font-bold leading-[1.4] md:text-[14px]",html:r},i))}),m&&e(o,{className:"mb-5 text-[16px] font-bold",html:m}),e("div",{className:"flex w-full items-center rounded-[16px] bg-[#F5F5F7] p-[16px]",children:e(c,{item:l,copy:t})}),e(x,{loading:d||!s,variant:"primary",className:"mx-auto mt-[16px] w-[444px] md:mt-[12px] md:w-full",onClick:a,disabled:p,children:t.redeemModal.product.paymentButton})]})});export{N as Success};
2
+ //# sourceMappingURL=Success.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/components/credits/credits-redeem-list/redeem-product-modal/Success.tsx"],
4
+ "sourcesContent": ["import { Button, Text } from '@anker-in/headless-ui'\nimport classNames from 'classnames'\nimport type { RedeemableItem as RedeemableItemType } from '../../type'\nimport { CreditsRedeemListCopy } from '../type'\nimport { ProductInfo } from './ProductInfo'\n\ntype SuccessProps = {\n copy: CreditsRedeemListCopy\n shippingProduct: string\n loading: boolean\n address: Record<string, any> | undefined\n disabled: boolean\n onClose: () => void\n item: RedeemableItemType\n}\n\nexport const Success = ({ copy, shippingProduct, loading, address, disabled, onClose, item }: SuccessProps) => {\n return (\n <div className={classNames('max-h-[500px] overflow-y-auto px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]')}>\n <div className=\"flex flex-col items-center\">\n <div className=\"mb-[16px] grid grid-flow-row gap-y-[4px] md:mb-[12px]\">\n {copy.redeemModal.product.successDesc.map((description: string, index: number) => (\n <Text key={index} className=\"text-[18px] font-bold leading-[1.4] md:text-[14px]\" html={description}></Text>\n ))}\n </div>\n\n {shippingProduct && <Text className=\"mb-5 text-[16px] font-bold\" html={shippingProduct}></Text>}\n\n <div className=\"flex w-full items-center rounded-[16px] bg-[#F5F5F7] p-[16px]\">\n <ProductInfo item={item} copy={copy} />\n </div>\n\n <Button\n loading={loading || !address}\n variant=\"primary\"\n className=\"mx-auto mt-[16px] w-[444px] md:mt-[12px] md:w-full\"\n onClick={onClose}\n disabled={disabled}\n >\n {copy.redeemModal.product.paymentButton}\n </Button>\n </div>\n </div>\n )\n}\n"],
5
+ "mappings": "AAmBM,OAGM,OAAAA,EAHN,QAAAC,MAAA,oBAnBN,OAAS,UAAAC,EAAQ,QAAAC,MAAY,wBAC7B,OAAOC,MAAgB,aAGvB,OAAS,eAAAC,MAAmB,gBAYrB,MAAMC,EAAU,CAAC,CAAE,KAAAC,EAAM,gBAAAC,EAAiB,QAAAC,EAAS,QAAAC,EAAS,SAAAC,EAAU,QAAAC,EAAS,KAAAC,CAAK,IAEvFb,EAAC,OAAI,UAAWI,EAAW,iFAAiF,EAC1G,SAAAH,EAAC,OAAI,UAAU,6BACb,UAAAD,EAAC,OAAI,UAAU,wDACZ,SAAAO,EAAK,YAAY,QAAQ,YAAY,IAAI,CAACO,EAAqBC,IAC9Df,EAACG,EAAA,CAAiB,UAAU,qDAAqD,KAAMW,GAA5EC,CAAyF,CACrG,EACH,EAECP,GAAmBR,EAACG,EAAA,CAAK,UAAU,6BAA6B,KAAMK,EAAiB,EAExFR,EAAC,OAAI,UAAU,gEACb,SAAAA,EAACK,EAAA,CAAY,KAAMQ,EAAM,KAAMN,EAAM,EACvC,EAEAP,EAACE,EAAA,CACC,QAASO,GAAW,CAACC,EACrB,QAAQ,UACR,UAAU,qDACV,QAASE,EACT,SAAUD,EAET,SAAAJ,EAAK,YAAY,QAAQ,cAC5B,GACF,EACF",
6
+ "names": ["jsx", "jsxs", "Button", "Text", "classNames", "ProductInfo", "Success", "copy", "shippingProduct", "loading", "address", "disabled", "onClose", "item", "description", "index"]
7
+ }
@@ -0,0 +1,11 @@
1
+ import { AlpcErrorCode } from '../../context/const';
2
+ import type { ModalContainerProps } from '../../modal/modalContainer';
3
+ import type { RedeemableItem as RedeemableItemType } from '../../type';
4
+ import { CreditsRedeemListCopy } from '../type';
5
+ type RedeemProductModalProps = ModalContainerProps & {
6
+ item: RedeemableItemType;
7
+ copy: CreditsRedeemListCopy;
8
+ onError: (code: AlpcErrorCode) => void;
9
+ };
10
+ declare function RedeemProductModal({ item, copy, onError, ...props }: RedeemProductModalProps): import("react/jsx-runtime").JSX.Element;
11
+ export default RedeemProductModal;
@@ -0,0 +1,2 @@
1
+ import{jsx as u,jsxs as X}from"react/jsx-runtime";import R from"classnames";import{useCallback as w,useEffect as F,useMemo as K,useState as l}from"react";import{useCreditsContext as _}from"../../context/provider";import k from"../../context/hooks/useCountries";import{AlpcErrorCode as c}from"../../context/const";import{useAddressValidate as T}from"../../context/hooks/useAddressValidate";import{useRedeemProduct as B}from"../../context/hooks/useRedeemProduct";import{CreditsModalContainer as G}from"../../modal/modalContainer";import{useShopifyContext as J}from"@shopify/context";import{Error as V}from"./Error";import{Success as z}from"./Success";import{Address as H}from"./Address";import{Init as Q}from"./Init";function W({item:s,copy:e,onError:h,...m}){const{fetchCreditInfo:E,profile:I}=_(),{storeDomain:A,locale:N}=J(),{validatorInfo:S}=e,{shippingAddress:y,shippingProduct:v}=e.redeemModal.product,[d,i]=l("init"),[t,L]=l(),[x,n]=l({code:0,message:"",imageUrl:""}),[f,a]=l(!1),{countries:b=[],isLoading:Y}=k({shopifyStoreDomain:A}),{isMutating:p,trigger:P}=B({onSuccess(r){if(!r){i("error"),n({code:0,imageUrl:e.redeemModal.errorImageUrl||"",message:e.redeemModal.commonError||""});return}if(r?.code===0)E(I?.user_id),i("success");else{let o,M;r.code===c.CodeLpcShopifyCouponRuleRedeemLimit?(o=e.redeemModal.redeemLimitError,a(!0)):r.code===c.CodeLpcRuleInventoryNotEnough?(o=e.redeemModal.inventoryNotEnough,a(!0),M=e.redeemModal.inventoryNotEnough):r.code===c.CodeLpcNotEnoughCredits?(o=e.redeemModal.creditsNotEnough,a(!0),E(I?.user_id)):r.code===c.CodeCrossSiteError&&(o=e.redeemModal.crossSiteError,a(!0)),i("error"),n({code:r.code,imageUrl:M||e.redeemModal.errorImageUrl||"",message:o||e.redeemModal.commonError||""}),h&&h(r.code)}},onError(r){i("error"),n({code:0,imageUrl:e.redeemModal.errorImageUrl||"",message:e.redeemModal.commonError||""})}}),g=K(()=>e?.redeemModal.product.form?.flat().find(o=>o.type==="state")?.key,[e?.redeemModal.product.form]),{validate:C,errors:U}=T({address:t,validatorInfo:S,formData:e?.redeemModal.product.form?.flat()||[],errorLabel:{require:e.redeemModal.product.required,email:e.redeemModal.product.invalidEmail}}),O=w(async()=>{const r=[];if(g&&((b.find(q=>q.code===t.country)?.provinces||[]).length||r.push(g)),C({force:!0,ignoreKeys:r}))return;console.log("address",t);let o={...t};o.name&&delete o.name,o.country==="UK"&&(o.country="GB"),P({address:btoa(JSON.stringify(o)),rule_id:Number(s.alpc?.id)})},[s,P,g,C,t,b]);return F(()=>{m.isOpen||(a(!1),n({code:0,message:"",imageUrl:""}))},[m.isOpen,N]),X(G,{...m,className:R("w-[540px] md:h-auto min-md:max-h-[calc(100vh-40px)]",d!=="init"&&"w-[740px] md:w-full"),scrollClassName:"mb-0 min-l:px-0 md:mb-0 px-0",titleClassName:R("h-[56px]",d==="init"&&"bg-[#F5F5F7]"),title:d==="address"?"Order Confirmation":"",children:[d==="error"&&u(V,{errorInfo:x}),d==="success"&&u(z,{copy:e,shippingProduct:v,loading:p,address:t,disabled:f,onClose:m.onClose,item:s}),d==="address"&&u(H,{copy:e,shippingAddress:y,setAddress:L,validateAddress:C,validateErrors:U,shippingProduct:v,loading:p,address:t,disabled:f,handlePayment:O,item:s}),d==="init"&&u(Q,{item:s,copy:e,loading:p,disabled:f,setStatus:i})]})}var ce=W;export{ce as default};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/components/credits/credits-redeem-list/redeem-product-modal/index.tsx"],
4
+ "sourcesContent": ["import classNames from 'classnames'\nimport { useCallback, useEffect, useMemo, useState } from 'react'\nimport { useCreditsContext } from '../../context/provider'\nimport useCountries from '../../context/hooks/useCountries'\nimport { AlpcErrorCode } from '../../context/const'\nimport { useAddressValidate } from '../../context/hooks/useAddressValidate'\nimport { useRedeemProduct } from '../../context/hooks/useRedeemProduct'\nimport type { ModalContainerProps } from '../../modal/modalContainer'\nimport { CreditsModalContainer } from '../../modal/modalContainer'\nimport type { RedeemableItem as RedeemableItemType } from '../../type'\nimport { useShopifyContext } from '@shopify/context'\nimport { CreditsRedeemListCopy } from '../type'\nimport { Error } from './Error'\nimport { Success } from './Success'\nimport { Address } from './Address'\nimport { Init } from './Init'\n\ntype RedeemProductModalProps = ModalContainerProps & {\n item: RedeemableItemType\n copy: CreditsRedeemListCopy\n onError: (code: AlpcErrorCode) => void\n}\n\nfunction RedeemProductModal({ item, copy, onError, ...props }: RedeemProductModalProps) {\n const { fetchCreditInfo, profile } = useCreditsContext()\n const { storeDomain, locale } = useShopifyContext()\n\n const { validatorInfo } = copy\n const { shippingAddress, shippingProduct } = copy.redeemModal.product\n\n const [status, setStatus] = useState<'init' | 'address' | 'success' | 'error'>('init')\n const [address, setAddress] = useState<any>()\n const [errorInfo, setErrorInfo] = useState({\n code: 0,\n message: '',\n imageUrl: '',\n })\n const [disabled, setDisabled] = useState(false)\n\n const { countries = [], isLoading: countriesLoading } = useCountries({ shopifyStoreDomain: storeDomain })\n\n const { isMutating: loading, trigger } = useRedeemProduct({\n onSuccess(responseData) {\n if (!responseData) {\n setStatus('error')\n setErrorInfo({\n code: 0,\n imageUrl: copy.redeemModal.errorImageUrl || '',\n message: copy.redeemModal.commonError || '',\n })\n return\n }\n\n if (responseData?.code === 0) {\n fetchCreditInfo(profile?.user_id)\n setStatus('success')\n } else {\n let errorMsg\n let errorImage\n if (responseData.code === AlpcErrorCode.CodeLpcShopifyCouponRuleRedeemLimit) {\n errorMsg = copy.redeemModal.redeemLimitError\n setDisabled(true)\n } else if (responseData.code === AlpcErrorCode.CodeLpcRuleInventoryNotEnough) {\n errorMsg = copy.redeemModal.inventoryNotEnough\n setDisabled(true)\n errorImage = copy.redeemModal.inventoryNotEnough\n } else if (responseData.code === AlpcErrorCode.CodeLpcNotEnoughCredits) {\n errorMsg = copy.redeemModal.creditsNotEnough\n setDisabled(true)\n fetchCreditInfo(profile?.user_id)\n } else if (responseData.code === AlpcErrorCode.CodeCrossSiteError) {\n errorMsg = copy.redeemModal.crossSiteError\n setDisabled(true)\n }\n\n setStatus('error')\n setErrorInfo({\n code: responseData.code,\n imageUrl: errorImage || copy.redeemModal.errorImageUrl || '',\n message: errorMsg || copy.redeemModal.commonError || '',\n })\n onError && onError(responseData.code)\n }\n },\n onError(error) {\n setStatus('error')\n setErrorInfo({\n code: 0,\n imageUrl: copy.redeemModal.errorImageUrl || '',\n message: copy.redeemModal.commonError || '',\n })\n },\n })\n\n const stateInputKey = useMemo(() => {\n const stateInput = copy?.redeemModal.product.form?.flat().find(item => item.type === 'state')\n return stateInput?.key\n }, [copy?.redeemModal.product.form])\n\n const { validate: validateAddress, errors: validateErrors } = useAddressValidate({\n address: address,\n validatorInfo: validatorInfo,\n formData: copy?.redeemModal.product.form?.flat() || [],\n errorLabel: {\n require: copy.redeemModal.product.required,\n email: copy.redeemModal.product.invalidEmail,\n },\n })\n\n const handlePayment = useCallback(async () => {\n const ignoreKeys: string[] = []\n\n if (stateInputKey) {\n const provinces = countries.find(item => item.code === address.country)?.provinces || []\n\n if (!provinces.length) {\n ignoreKeys.push(stateInputKey as never)\n }\n }\n\n if (\n validateAddress({\n force: true,\n ignoreKeys,\n })\n ) {\n // \u5730\u5740\u6821\u9A8C\u9519\u8BEF\n return\n }\n console.log('address', address)\n let requestAddress = { ...address }\n if (requestAddress.name) {\n delete requestAddress.name\n }\n if (requestAddress.country === 'UK') {\n requestAddress.country = 'GB'\n }\n trigger({\n address: btoa(JSON.stringify(requestAddress)),\n rule_id: Number(item.alpc?.id),\n })\n }, [item, trigger, stateInputKey, validateAddress, address, countries])\n\n useEffect(() => {\n if (!props.isOpen) {\n setDisabled(false)\n setErrorInfo({ code: 0, message: '', imageUrl: '' })\n }\n }, [props.isOpen, locale])\n\n return (\n <CreditsModalContainer\n {...props}\n className={classNames(\n 'w-[540px] md:h-auto min-md:max-h-[calc(100vh-40px)]',\n status !== 'init' && 'w-[740px] md:w-full'\n )}\n scrollClassName=\"mb-0 min-l:px-0 md:mb-0 px-0\"\n titleClassName={classNames('h-[56px]', status === 'init' && 'bg-[#F5F5F7]')}\n title={status === 'address' ? 'Order Confirmation' : ''}\n >\n {status === 'error' && <Error errorInfo={errorInfo} />}\n {status === 'success' && (\n <Success\n copy={copy}\n shippingProduct={shippingProduct}\n loading={loading}\n address={address}\n disabled={disabled}\n onClose={props.onClose}\n item={item}\n />\n )}\n {status === 'address' && (\n <Address\n copy={copy}\n shippingAddress={shippingAddress}\n setAddress={setAddress}\n validateAddress={validateAddress}\n validateErrors={validateErrors}\n shippingProduct={shippingProduct}\n loading={loading}\n address={address}\n disabled={disabled}\n handlePayment={handlePayment}\n item={item}\n />\n )}\n {status === 'init' && (\n <Init item={item} copy={copy} loading={loading} disabled={disabled} setStatus={setStatus} />\n )}\n </CreditsModalContainer>\n )\n}\n\nexport default RedeemProductModal\n"],
5
+ "mappings": "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",
6
+ "names": ["jsx", "jsxs", "classNames", "useCallback", "useEffect", "useMemo", "useState", "useCreditsContext", "useCountries", "AlpcErrorCode", "useAddressValidate", "useRedeemProduct", "CreditsModalContainer", "useShopifyContext", "Error", "Success", "Address", "Init", "RedeemProductModal", "item", "copy", "onError", "props", "fetchCreditInfo", "profile", "storeDomain", "locale", "validatorInfo", "shippingAddress", "shippingProduct", "status", "setStatus", "address", "setAddress", "errorInfo", "setErrorInfo", "disabled", "setDisabled", "countries", "countriesLoading", "loading", "trigger", "responseData", "errorMsg", "errorImage", "error", "stateInputKey", "validateAddress", "validateErrors", "handlePayment", "ignoreKeys", "requestAddress", "redeem_product_modal_default"]
7
+ }
@@ -0,0 +1,77 @@
1
+ import { CreditsPageCommon } from '../type';
2
+ export type CreditsRedeemListCopy = {
3
+ title: string;
4
+ giftCardLabel: string;
5
+ unlockRewards: string;
6
+ btnRedeem: string;
7
+ list: {
8
+ label: string;
9
+ list: {
10
+ id: string;
11
+ type: string;
12
+ value: string;
13
+ rules: string[];
14
+ }[];
15
+ }[];
16
+ validatorInfo: {
17
+ addressInfo: {
18
+ name: string;
19
+ country: string;
20
+ province: string;
21
+ city: string;
22
+ address: string;
23
+ };
24
+ };
25
+ redeemModal: {
26
+ confirmTitle: string;
27
+ confirmButton: string;
28
+ commonError: string;
29
+ redeemLimitError: string;
30
+ inventoryNotEnough: string;
31
+ creditsNotEnough: string;
32
+ crossSiteError: string;
33
+ errorImageUrl: string;
34
+ coupon: {
35
+ successDesc: string;
36
+ successTitle: string;
37
+ successButton: string;
38
+ successButtonUrl: string;
39
+ };
40
+ product: {
41
+ required: string;
42
+ invalidEmail: string;
43
+ shippingAddress: string;
44
+ shippingProduct: string;
45
+ addressForm: {
46
+ key: string;
47
+ type: string;
48
+ label: string;
49
+ isSelect: boolean;
50
+ required: boolean;
51
+ placeholder: string;
52
+ }[][];
53
+ form: {
54
+ key: string;
55
+ type: string;
56
+ isSelect: boolean;
57
+ required: boolean;
58
+ placeholder: string;
59
+ }[][];
60
+ successDesc: string[];
61
+ rules: string[];
62
+ steps: {
63
+ imageUrl: string;
64
+ title: string;
65
+ }[];
66
+ quantityLabel: string;
67
+ totalPriceLabel: string;
68
+ variantLabel: string;
69
+ shippingFeeLabel: string;
70
+ paymentButton: string;
71
+ stepTitle: string;
72
+ };
73
+ };
74
+ copied: string;
75
+ off: string;
76
+ copy: string;
77
+ } & CreditsPageCommon;
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=type.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ import { type CreditsWaysToGetCreditsProps } from './type';
2
+ export declare const CreditsWaysToGetCredits: ({ copy, activate, subscribe, uploadReceipt, classNames, }: CreditsWaysToGetCreditsProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import{Fragment as P,jsx as t,jsxs as s}from"react/jsx-runtime";import{Button as N,Container as I,Heading as r,Picture as f,Text as L}from"@anker-in/headless-ui";import{ChevronDownIcon as T,ChevronUpIcon as D}from"@heroicons/react/24/outline";import{motion as S}from"framer-motion";import{useMemo as A,useState as B}from"react";import{TaskType as p}from"./type";import{useActions as G}from"./useActions";import{useCreditsContext as M}from"../context/provider";import{cn as w}from"../../../helpers/index";const J=({copy:i,activate:m,subscribe:h,uploadReceipt:b,classNames:g})=>{const[n,v]=B(!1),{profile:F}=M(),c=!!F,{actions:x}=G({copy:i,activate:m,subscribe:h,uploadReceipt:b}),y=A(()=>{const e=i.list.map(l=>{if(!x[l.id])return;const{finished:o,notLogin:k,notFinished:u,completed:z}=x[l.id];let d="",a,C;return c?o?(d=z.buttonLabel,a=void 0):(d=u.buttonLabel,a=u.handleClick,C=u.link):(d=k.buttonLabel,a=k.handleClick),{...l,buttonLabel:d,handleClick:a,finished:o,link:C}}).filter(Boolean);return c?e.sort((l,o)=>l?.finished&&!o?.finished?1:!l?.finished&&o?.finished?-1:0):e},[x,i.list,c]);return t(I,{id:"ways-to-get-credits",className:" bg-[#F5F5F7] [&>div]:l:!px-0",children:s("div",{className:"rounded-[16px] bg-[#1D1D1F] py-[64px] px-[140px] text-white md:px-[16px] l:rounded-none md-l:px-[32px] l-xl:px-[77px]",children:[t(r,{as:"h2",size:4,html:i?.title,className:"text-center l:pl-[16px] l:text-left"}),s("div",{className:"mt-[64px] flex items-center justify-between md:mt-[64px] l:mt-[24px] l:flex-col-reverse l:items-start md-l:mt-[32px]",children:[s("div",{className:"pl-[16px] l:mt-[40px] desktop:pl-[24px] lg-desktop:pl-[32px]",children:[t(r,{size:3,as:"h3",html:i.subtitle,className:g?.subtitle}),s("div",{className:"mt-[8px] flex items-center",children:[i.creditsIcon?.url&&t(f,{className:"size-[48px] mr-[8px] stroke-brand xl:size-[30px] [&_path]:stroke-brand",source:i.creditsIcon.url,alt:i.creditsIcon.alt||"credits"}),t(r,{html:i.equalCredits,size:4,as:"h3",className:w("mt-2 text-white md:text-[24px]",g?.equalCreditsText)})]})]}),t(f,{className:"w-full laptop:w-[50%]",source:i.mainImage?.url})]}),s("div",{className:"relative",children:[s(S.div,{className:w("relative mt-[64px] grid grid-cols-3 gap-[16px] overflow-hidden md:mt-[16px] md:grid-cols-1 l:gap-[12px] min-md:!h-auto md-l:mt-[32px] md-l:grid-cols-2"),initial:{height:512},animate:{height:n?"auto":512},transition:{duration:.3},onAnimationComplete:()=>{if(!n&&window.screen.width<768){const e=document.getElementById("ways-to-get-credits");e&&e.scrollIntoView({behavior:"smooth",block:"end"})}},children:[y.map(e=>s("div",{className:"flex min-h-[160px] flex-col justify-between rounded-[16px] bg-white p-[16px] text-[#1D1D1F] desktop:min-h-[192px] desktop:p-[24px] lg-desktop:min-h-[240px] lg-desktop:p-[32px]",children:[s("div",{children:[t(r,{as:"h4",html:e.title,size:2,className:"text-pretty"}),s("div",{className:"mt-[4px] flex items-center",children:[t(f,{className:"size-[24px] xl:size-[18px] [&_path]:size-full",source:"https://cdn.shopify.com/s/files/1/0511/6346/3874/files/20250902-153351.png?v=1756798450"}),t(L,{as:"p",html:e.credits,size:2,className:"ml-[4px] mt-[6px] lg-desktop:text-[18px]"})]})]}),e.handleClick&&!(e.id===p.UploadReceipt&&b.isSuccess)&&!(e.id===p.Activate&&m.isSuccess)&&!(e.id===p.Subscribe&&h.isSuccess)?t(N,{as:e.link?"a":"button",...e.link&&{href:e.link},...e.handleClick&&{onClick:e.handleClick},variant:"primary",loading:e.id===p.Activate&&m.isSendingActivateEmail,size:"lg",className:"mt-[24px] w-fit",children:e.buttonLabel}):t(N,{variant:"primary",size:"lg",className:"mt-[24px] w-fit",disabled:!0,children:e.buttonLabel})]},e.id)),!n&&t("div",{className:"absolute inset-0 min-md:hidden",style:{background:"linear-gradient(180deg, rgba(29, 29, 31, 0) 66.37%, #1D1D1F 100%"}})]}),n?t("button",{className:"mx-auto mt-[12px] block w-fit min-md:hidden",onClick:()=>{v(!1)},children:t(D,{className:"size-[40px] rounded-full bg-[#FFFFFF33] p-[8px]"})}):t(P,{children:t("div",{className:"absolute bottom-0 flex w-full translate-y-1/2 justify-center min-md:hidden",children:t("button",{className:"w-fit",onClick:()=>v(!n),children:t(T,{className:"size-[40px] rounded-full bg-[#FFFFFF33] p-[8px]"})})})})]})]})})};export{J as CreditsWaysToGetCredits};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/components/credits/credits-ways-to-get-credits/index.tsx"],
4
+ "sourcesContent": ["import { Button, Container, Heading, Picture, Text } from '@anker-in/headless-ui'\nimport { ChevronDownIcon, ChevronUpIcon } from '@heroicons/react/24/outline'\nimport { motion } from 'framer-motion'\nimport { useMemo, useState } from 'react'\n\nimport { TaskType, type CreditsWaysToGetCreditsProps } from './type'\nimport { useActions } from './useActions'\nimport { useCreditsContext } from '../context/provider'\nimport { cn } from '../../../helpers/index'\n\nexport const CreditsWaysToGetCredits = ({\n copy,\n activate,\n subscribe,\n uploadReceipt,\n classNames,\n}: CreditsWaysToGetCreditsProps) => {\n const [showMore, setShowMore] = useState(false)\n const { profile } = useCreditsContext()\n const isLogin = !!profile\n\n const { actions } = useActions({ copy, activate, subscribe, uploadReceipt })\n\n const list = useMemo(() => {\n const list = copy.list\n .map(item => {\n if (!actions[item.id as keyof typeof actions]) {\n return undefined\n }\n const { finished, notLogin, notFinished, completed } = actions[item.id as keyof typeof actions]\n let buttonLabel = ''\n let handleClick = undefined\n let link = undefined\n if (!isLogin) {\n buttonLabel = notLogin.buttonLabel\n handleClick = notLogin.handleClick\n } else if (finished) {\n buttonLabel = completed.buttonLabel\n handleClick = undefined\n } else {\n buttonLabel = notFinished.buttonLabel\n handleClick = notFinished.handleClick\n link = (notFinished as { link: string }).link\n }\n return {\n ...item,\n buttonLabel,\n handleClick,\n finished,\n link,\n }\n })\n .filter(Boolean) as {\n title: string\n credits: string\n id: TaskType\n buttonLabel: string\n finished: boolean\n link: string\n handleClick: (() => void) | undefined\n }[]\n\n // \u767B\u5F55\u540E\uFF0C\u4FDD\u7559\u539F\u987A\u5E8F\uFF0C\u5C06\u5DF2\u5B8C\u6210\u7684\u4EFB\u52A1\u653E\u5728\u6700\u540E\n if (isLogin) {\n return list.sort((a, b) => {\n if (a?.finished && !b?.finished) {\n return 1 // a\u5DF2\u5B8C\u6210\uFF0Cb\u672A\u5B8C\u6210\uFF0Ca\u6392\u5728\u540E\u9762\n }\n if (!a?.finished && b?.finished) {\n return -1 // a\u672A\u5B8C\u6210\uFF0Cb\u5DF2\u5B8C\u6210\uFF0Ca\u6392\u5728\u524D\u9762\n }\n return 0 // \u90FD\u5DF2\u5B8C\u6210\u6216\u90FD\u672A\u5B8C\u6210\uFF0C\u4FDD\u6301\u539F\u987A\u5E8F\n })\n } else {\n return list\n }\n }, [actions, copy.list, isLogin])\n\n return (\n <Container id=\"ways-to-get-credits\" className=\" bg-[#F5F5F7] [&>div]:l:!px-0\">\n <div className=\"rounded-[16px] bg-[#1D1D1F] py-[64px] px-[140px] text-white md:px-[16px] l:rounded-none md-l:px-[32px] l-xl:px-[77px]\">\n <Heading as=\"h2\" size={4} html={copy?.title} className=\"text-center l:pl-[16px] l:text-left\" />\n <div className=\"mt-[64px] flex items-center justify-between md:mt-[64px] l:mt-[24px] l:flex-col-reverse l:items-start md-l:mt-[32px]\">\n <div className=\"pl-[16px] l:mt-[40px] desktop:pl-[24px] lg-desktop:pl-[32px]\">\n <Heading size={3} as=\"h3\" html={copy.subtitle} className={classNames?.subtitle} />\n <div className=\"mt-[8px] flex items-center\">\n {copy.creditsIcon?.url && (\n <Picture\n className=\"size-[48px] mr-[8px] stroke-brand xl:size-[30px] [&_path]:stroke-brand\"\n source={copy.creditsIcon.url}\n alt={copy.creditsIcon.alt || 'credits'}\n />\n )}\n <Heading\n html={copy.equalCredits}\n size={4}\n as=\"h3\"\n className={cn('mt-2 text-white md:text-[24px]', classNames?.equalCreditsText)}\n />\n </div>\n </div>\n <Picture className=\"w-full laptop:w-[50%]\" source={copy.mainImage?.url} />\n </div>\n\n <div className=\"relative\">\n <motion.div\n className={cn(\n 'relative mt-[64px] grid grid-cols-3 gap-[16px] overflow-hidden md:mt-[16px] md:grid-cols-1 l:gap-[12px] min-md:!h-auto md-l:mt-[32px] md-l:grid-cols-2'\n )}\n initial={{ height: 512 }}\n animate={{ height: showMore ? 'auto' : 512 }}\n transition={{ duration: 0.3 }}\n onAnimationComplete={() => {\n if (!showMore && window.screen.width < 768) {\n const section = document.getElementById('ways-to-get-credits')\n if (section) {\n section.scrollIntoView({ behavior: 'smooth', block: 'end' })\n }\n }\n }}\n >\n {list.map(item => (\n <div\n key={item.id}\n className=\"flex min-h-[160px] flex-col justify-between rounded-[16px] bg-white p-[16px] text-[#1D1D1F] desktop:min-h-[192px] desktop:p-[24px] lg-desktop:min-h-[240px] lg-desktop:p-[32px]\"\n >\n <div>\n <Heading as=\"h4\" html={item.title} size={2} className=\"text-pretty\" />\n <div className=\"mt-[4px] flex items-center\">\n <Picture\n className=\"size-[24px] xl:size-[18px] [&_path]:size-full\"\n source=\"https://cdn.shopify.com/s/files/1/0511/6346/3874/files/20250902-153351.png?v=1756798450\"\n />\n <Text as=\"p\" html={item.credits} size={2} className=\"ml-[4px] mt-[6px] lg-desktop:text-[18px]\" />\n </div>\n </div>\n\n {item.handleClick &&\n !(item.id === TaskType.UploadReceipt && uploadReceipt.isSuccess) &&\n !(item.id === TaskType.Activate && activate.isSuccess) &&\n !(item.id === TaskType.Subscribe && subscribe.isSuccess) ? (\n <Button\n as={item.link ? 'a' : 'button'}\n {...(item.link && { href: item.link })}\n {...(item.handleClick && { onClick: item.handleClick })}\n variant=\"primary\"\n loading={item.id === TaskType.Activate && activate.isSendingActivateEmail}\n size=\"lg\"\n className=\"mt-[24px] w-fit\"\n >\n {item.buttonLabel}\n </Button>\n ) : (\n <Button variant=\"primary\" size=\"lg\" className=\"mt-[24px] w-fit\" disabled>\n {item.buttonLabel}\n </Button>\n )}\n </div>\n ))}\n {!showMore && (\n <div\n className=\"absolute inset-0 min-md:hidden\"\n style={{ background: 'linear-gradient(180deg, rgba(29, 29, 31, 0) 66.37%, #1D1D1F 100%' }}\n ></div>\n )}\n </motion.div>\n {showMore ? (\n <button\n className=\"mx-auto mt-[12px] block w-fit min-md:hidden\"\n onClick={() => {\n setShowMore(false)\n }}\n >\n <ChevronUpIcon className=\"size-[40px] rounded-full bg-[#FFFFFF33] p-[8px]\"></ChevronUpIcon>\n </button>\n ) : (\n <>\n <div className=\"absolute bottom-0 flex w-full translate-y-1/2 justify-center min-md:hidden\">\n <button className=\"w-fit\" onClick={() => setShowMore(!showMore)}>\n <ChevronDownIcon className=\"size-[40px] rounded-full bg-[#FFFFFF33] p-[8px]\"></ChevronDownIcon>\n </button>\n </div>\n </>\n )}\n </div>\n </div>\n </Container>\n )\n}\n"],
5
+ "mappings": "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",
6
+ "names": ["Fragment", "jsx", "jsxs", "Button", "Container", "Heading", "Picture", "Text", "ChevronDownIcon", "ChevronUpIcon", "motion", "useMemo", "useState", "TaskType", "useActions", "useCreditsContext", "cn", "CreditsWaysToGetCredits", "copy", "activate", "subscribe", "uploadReceipt", "classNames", "showMore", "setShowMore", "profile", "isLogin", "actions", "list", "item", "finished", "notLogin", "notFinished", "completed", "buttonLabel", "handleClick", "link", "a", "b", "section"]
7
+ }
@@ -0,0 +1,60 @@
1
+ import type { ReceiptCopy } from '../modal/creditsUploadReceiptModal';
2
+ export type BenefitItem = {
3
+ title: string;
4
+ credits: string;
5
+ id: string;
6
+ };
7
+ export type WaysToGetCreditsCopy = {
8
+ title: string;
9
+ subtitle: string;
10
+ equalCredits: string;
11
+ musicIcon: string;
12
+ list: BenefitItem[];
13
+ mainImage: {
14
+ url: string;
15
+ alt: string;
16
+ };
17
+ joinNow: string;
18
+ activate: string;
19
+ completed: string;
20
+ completeProfile: string;
21
+ makeFirstPurchase: string;
22
+ goShopLink: string;
23
+ uploadReceipt: string;
24
+ shopNow: string;
25
+ subscribe: string;
26
+ sendEmailSuccess: string;
27
+ creditsIcon: {
28
+ url: string;
29
+ alt: string;
30
+ };
31
+ receipt: ReceiptCopy;
32
+ };
33
+ export declare enum TaskType {
34
+ Activate = "activate",
35
+ Subscribe = "subscribe",
36
+ CompleteProfile = "completeProfile",
37
+ FirstPurchase = "firstPurchase",
38
+ UploadReceipt = "uploadReceipt",
39
+ Shop = "shop"
40
+ }
41
+ export type CreditsWaysToGetCreditsProps = {
42
+ copy: WaysToGetCreditsCopy;
43
+ classNames?: {
44
+ equalCreditsText?: string;
45
+ subtitle?: string;
46
+ };
47
+ activate: {
48
+ openAuthCodePopup: () => void;
49
+ isSuccess: boolean;
50
+ isSendingActivateEmail: boolean;
51
+ };
52
+ subscribe: {
53
+ openSubscribePopup: () => void;
54
+ isSuccess: boolean;
55
+ };
56
+ uploadReceipt: {
57
+ openUploadReceiptPopup: () => void;
58
+ isSuccess: boolean;
59
+ };
60
+ };
@@ -0,0 +1,2 @@
1
+ var t=(e=>(e.Activate="activate",e.Subscribe="subscribe",e.CompleteProfile="completeProfile",e.FirstPurchase="firstPurchase",e.UploadReceipt="uploadReceipt",e.Shop="shop",e))(t||{});export{t as TaskType};
2
+ //# sourceMappingURL=type.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/components/credits/credits-ways-to-get-credits/type.ts"],
4
+ "sourcesContent": ["import type { ReceiptCopy } from '../modal/creditsUploadReceiptModal'\n\nexport type BenefitItem = {\n title: string\n credits: string\n id: string\n}\n\nexport type WaysToGetCreditsCopy = {\n title: string\n subtitle: string\n equalCredits: string\n musicIcon: string\n list: BenefitItem[]\n mainImage: {\n url: string\n alt: string\n }\n joinNow: string\n activate: string\n completed: string\n completeProfile: string\n makeFirstPurchase: string\n goShopLink: string\n uploadReceipt: string\n shopNow: string\n subscribe: string\n sendEmailSuccess: string\n creditsIcon: {\n url: string\n alt: string\n }\n receipt: ReceiptCopy\n}\n\nexport enum TaskType {\n Activate = 'activate',\n Subscribe = 'subscribe',\n CompleteProfile = 'completeProfile',\n FirstPurchase = 'firstPurchase',\n UploadReceipt = 'uploadReceipt',\n Shop = 'shop',\n}\n\nexport type CreditsWaysToGetCreditsProps = {\n copy: WaysToGetCreditsCopy\n classNames?: {\n equalCreditsText?: string\n subtitle?: string\n }\n activate: {\n openAuthCodePopup: () => void\n isSuccess: boolean\n isSendingActivateEmail: boolean\n }\n subscribe: {\n openSubscribePopup: () => void\n isSuccess: boolean\n }\n uploadReceipt: {\n openUploadReceiptPopup: () => void\n isSuccess: boolean\n }\n}\n"],
5
+ "mappings": "AAmCO,IAAKA,OACVA,EAAA,SAAW,WACXA,EAAA,UAAY,YACZA,EAAA,gBAAkB,kBAClBA,EAAA,cAAgB,gBAChBA,EAAA,cAAgB,gBAChBA,EAAA,KAAO,OANGA,OAAA",
6
+ "names": ["TaskType"]
7
+ }
@@ -0,0 +1,96 @@
1
+ import type { CreditsWaysToGetCreditsProps } from './type';
2
+ export declare const useActions: ({ copy, subscribe, uploadReceipt, activate, gaParameters, }: CreditsWaysToGetCreditsProps & {
3
+ gaParameters?: {
4
+ position: string;
5
+ };
6
+ }) => {
7
+ actions: {
8
+ activate: {
9
+ finished: any;
10
+ notLogin: {
11
+ buttonLabel: string;
12
+ handleClick: () => void;
13
+ };
14
+ notFinished: {
15
+ buttonLabel: string;
16
+ handleClick: () => void;
17
+ };
18
+ completed: {
19
+ buttonLabel: string;
20
+ };
21
+ };
22
+ subscribe: {
23
+ finished: boolean;
24
+ notLogin: {
25
+ buttonLabel: string;
26
+ handleClick: () => void;
27
+ };
28
+ notFinished: {
29
+ buttonLabel: string;
30
+ handleClick: () => void;
31
+ };
32
+ completed: {
33
+ buttonLabel: string;
34
+ };
35
+ };
36
+ completeProfile: {
37
+ finished: any;
38
+ notLogin: {
39
+ buttonLabel: string;
40
+ handleClick: () => void;
41
+ };
42
+ notFinished: {
43
+ buttonLabel: string;
44
+ link: string;
45
+ handleClick: () => void;
46
+ };
47
+ completed: {
48
+ buttonLabel: string;
49
+ };
50
+ };
51
+ firstPurchase: {
52
+ finished: boolean;
53
+ notLogin: {
54
+ buttonLabel: string;
55
+ handleClick: () => void;
56
+ };
57
+ notFinished: {
58
+ buttonLabel: string;
59
+ link: string;
60
+ handleClick: () => void;
61
+ };
62
+ completed: {
63
+ buttonLabel: string;
64
+ };
65
+ };
66
+ uploadReceipt: {
67
+ finished: boolean;
68
+ notLogin: {
69
+ buttonLabel: string;
70
+ handleClick: () => void;
71
+ };
72
+ notFinished: {
73
+ buttonLabel: string;
74
+ handleClick: () => void;
75
+ };
76
+ completed: {
77
+ buttonLabel: string;
78
+ };
79
+ };
80
+ shop: {
81
+ finished: boolean;
82
+ notLogin: {
83
+ buttonLabel: string;
84
+ handleClick: () => void;
85
+ };
86
+ notFinished: {
87
+ buttonLabel: string;
88
+ link: string;
89
+ handleClick: () => void;
90
+ };
91
+ completed: {
92
+ buttonLabel: string;
93
+ };
94
+ };
95
+ };
96
+ };
@@ -0,0 +1,2 @@
1
+ import{TaskType as t}from"./type";import{useCreditsContext as L}from"../context/provider";import{useMemo as d}from"react";import C from"../context/hooks/useReceiptUploaded";import{useFirstPurchaseFinished as P}from"../context/hooks/useFirstPurchaseFinished";import{useSubscribed as g}from"../context/hooks/useSubscribed";import{useShopifyContext as v}from"@shopify/context";import{gaTrack as F}from"../../../helpers/track";const x=({copy:e,subscribe:u,uploadReceipt:c,activate:m,gaParameters:n})=>{const{openSignUpPopup:a,gtm:p,profile:o}=L(),l=g(),s=P(),b=C(),{appName:h}=v(),r=d(()=>(o?.first_name||o?.last_name)&&o?.phone_number&&o?.dob,[o]);return d(()=>{const i=({buttonName:k,id:f,callback:N})=>{F({event:"ga4Event",event_name:"lp_button",member_active_status:o?.activated?"active":"not active",event_parameters:{page_group:p.pageGroup,position:n?.position||e.title,button_name:k,info:f}}),N()};return{actions:{[t.Activate]:{finished:o?.activated,notLogin:{buttonLabel:e?.joinNow,handleClick:()=>i({buttonName:e?.joinNow,callback:a,id:t.Activate})},notFinished:{buttonLabel:e?.activate,handleClick:()=>i({buttonName:e?.activate,callback:()=>m.openAuthCodePopup(),id:t.Activate})},completed:{buttonLabel:e?.completed}},[t.Subscribe]:{finished:l,notLogin:{buttonLabel:e?.joinNow,handleClick:()=>i({buttonName:e?.joinNow,callback:a,id:t.Subscribe})},notFinished:{buttonLabel:e?.subscribe,handleClick:()=>i({buttonName:e?.subscribe,callback:()=>u.openSubscribePopup(),id:t.Subscribe})},completed:{buttonLabel:e?.completed}},[t.CompleteProfile]:{finished:r,notLogin:{buttonLabel:e?.joinNow,handleClick:()=>i({buttonName:e?.joinNow,callback:a,id:t.CompleteProfile})},notFinished:{buttonLabel:e?.completeProfile,link:`/account/profile?app=${h}`,handleClick:()=>i({buttonName:e?.completeProfile,callback:()=>{},id:t.CompleteProfile})},completed:{buttonLabel:e?.completed}},[t.FirstPurchase]:{finished:s,notLogin:{buttonLabel:e?.makeFirstPurchase,handleClick:()=>i({buttonName:e?.makeFirstPurchase,callback:a,id:t.FirstPurchase})},notFinished:{buttonLabel:e?.makeFirstPurchase,link:e?.goShopLink,handleClick:()=>i({buttonName:e?.makeFirstPurchase,callback:()=>{},id:t.FirstPurchase})},completed:{buttonLabel:e?.completed}},[t.UploadReceipt]:{finished:b,notLogin:{buttonLabel:e?.joinNow,handleClick:()=>i({buttonName:e?.joinNow,callback:a,id:t.UploadReceipt})},notFinished:{buttonLabel:e?.uploadReceipt,handleClick:()=>i({buttonName:e?.uploadReceipt,callback:()=>c.openUploadReceiptPopup(),id:t.UploadReceipt})},completed:{buttonLabel:e?.completed}},[t.Shop]:{finished:!1,notLogin:{buttonLabel:e?.joinNow,handleClick:()=>i({buttonName:e?.joinNow,callback:a,id:t.Shop})},notFinished:{buttonLabel:e?.shopNow,link:e?.goShopLink,handleClick:()=>i({buttonName:e?.shopNow,callback:()=>{},id:t.Shop})},completed:{buttonLabel:e?.completed}}}}},[o?.activated,e?.joinNow,e?.activate,e?.completed,e?.subscribe,e?.completeProfile,e?.makeFirstPurchase,e?.uploadReceipt,e?.shopNow,e.title,e?.goShopLink,l,r,s,b,n?.position,a])};export{x as useActions};
2
+ //# sourceMappingURL=useActions.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/components/credits/credits-ways-to-get-credits/useActions.ts"],
4
+ "sourcesContent": ["import { TaskType } from './type'\nimport { useCreditsContext } from '../context/provider'\nimport { useMemo } from 'react'\nimport useReceiptUploaded from '../context/hooks/useReceiptUploaded'\nimport { useFirstPurchaseFinished } from '../context/hooks/useFirstPurchaseFinished'\nimport { useSubscribed } from '../context/hooks/useSubscribed'\nimport type { CreditsWaysToGetCreditsProps } from './type'\nimport { useShopifyContext } from '@shopify/context'\nimport { gaTrack } from '../../../helpers/track'\n\nexport const useActions = ({\n copy,\n subscribe,\n uploadReceipt,\n activate,\n gaParameters,\n}: CreditsWaysToGetCreditsProps & {\n gaParameters?: {\n position: string\n }\n}) => {\n const { openSignUpPopup, gtm, profile } = useCreditsContext()\n const isSubscribed = useSubscribed()\n const firstPurchaseFinished = useFirstPurchaseFinished()\n const uploadedReceipt = useReceiptUploaded()\n const { appName } = useShopifyContext()\n\n const profileCompleted = useMemo(() => {\n return (profile?.first_name || profile?.last_name) && profile?.phone_number && profile?.dob\n }, [profile])\n\n return useMemo(() => {\n const handleClickWithTrack = ({\n buttonName,\n id,\n callback,\n }: {\n buttonName: string\n id?: string\n callback: () => void\n }) => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'lp_button',\n member_active_status: profile?.activated ? 'active' : 'not active',\n event_parameters: {\n page_group: gtm.pageGroup,\n position: gaParameters?.position || copy.title,\n button_name: buttonName,\n info: id,\n },\n })\n callback()\n }\n return {\n actions: {\n [TaskType.Activate]: {\n finished: profile?.activated,\n notLogin: {\n buttonLabel: copy?.joinNow,\n handleClick: () =>\n handleClickWithTrack({ buttonName: copy?.joinNow, callback: openSignUpPopup, id: TaskType.Activate }),\n },\n notFinished: {\n buttonLabel: copy?.activate,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.activate,\n callback: () => activate.openAuthCodePopup(),\n id: TaskType.Activate,\n }),\n },\n completed: {\n buttonLabel: copy?.completed,\n },\n },\n [TaskType.Subscribe]: {\n finished: isSubscribed,\n notLogin: {\n buttonLabel: copy?.joinNow,\n handleClick: () =>\n handleClickWithTrack({ buttonName: copy?.joinNow, callback: openSignUpPopup, id: TaskType.Subscribe }),\n },\n notFinished: {\n buttonLabel: copy?.subscribe,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.subscribe,\n callback: () => subscribe.openSubscribePopup(),\n id: TaskType.Subscribe,\n }),\n },\n completed: {\n buttonLabel: copy?.completed,\n },\n },\n [TaskType.CompleteProfile]: {\n finished: profileCompleted,\n notLogin: {\n buttonLabel: copy?.joinNow,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.joinNow,\n callback: openSignUpPopup,\n id: TaskType.CompleteProfile,\n }),\n },\n notFinished: {\n buttonLabel: copy?.completeProfile,\n link: `/account/profile?app=${appName}`,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.completeProfile,\n callback: () => {},\n id: TaskType.CompleteProfile,\n }),\n },\n completed: {\n buttonLabel: copy?.completed,\n },\n },\n [TaskType.FirstPurchase]: {\n finished: firstPurchaseFinished,\n notLogin: {\n buttonLabel: copy?.makeFirstPurchase,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.makeFirstPurchase,\n callback: openSignUpPopup,\n id: TaskType.FirstPurchase,\n }),\n },\n notFinished: {\n buttonLabel: copy?.makeFirstPurchase,\n link: copy?.goShopLink,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.makeFirstPurchase,\n callback: () => {},\n id: TaskType.FirstPurchase,\n }),\n },\n completed: {\n buttonLabel: copy?.completed,\n },\n },\n [TaskType.UploadReceipt]: {\n finished: uploadedReceipt,\n notLogin: {\n buttonLabel: copy?.joinNow,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.joinNow,\n callback: openSignUpPopup,\n id: TaskType.UploadReceipt,\n }),\n },\n notFinished: {\n buttonLabel: copy?.uploadReceipt,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.uploadReceipt,\n callback: () => uploadReceipt.openUploadReceiptPopup(),\n id: TaskType.UploadReceipt,\n }),\n },\n completed: {\n buttonLabel: copy?.completed,\n },\n },\n [TaskType.Shop]: {\n finished: false,\n notLogin: {\n buttonLabel: copy?.joinNow,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.joinNow,\n callback: openSignUpPopup,\n id: TaskType.Shop,\n }),\n },\n notFinished: {\n buttonLabel: copy?.shopNow,\n link: copy?.goShopLink,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.shopNow,\n callback: () => {},\n id: TaskType.Shop,\n }),\n },\n completed: {\n buttonLabel: copy?.completed,\n },\n },\n },\n }\n }, [\n profile?.activated,\n copy?.joinNow,\n copy?.activate,\n copy?.completed,\n copy?.subscribe,\n copy?.completeProfile,\n copy?.makeFirstPurchase,\n copy?.uploadReceipt,\n copy?.shopNow,\n copy.title,\n copy?.goShopLink,\n isSubscribed,\n profileCompleted,\n firstPurchaseFinished,\n uploadedReceipt,\n gaParameters?.position,\n openSignUpPopup,\n ])\n}\n"],
5
+ "mappings": "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",
6
+ "names": ["TaskType", "useCreditsContext", "useMemo", "useReceiptUploaded", "useFirstPurchaseFinished", "useSubscribed", "useShopifyContext", "gaTrack", "useActions", "copy", "subscribe", "uploadReceipt", "activate", "gaParameters", "openSignUpPopup", "gtm", "profile", "isSubscribed", "firstPurchaseFinished", "uploadedReceipt", "appName", "profileCompleted", "handleClickWithTrack", "buttonName", "id", "callback"]
7
+ }
@@ -1,4 +1,4 @@
1
- import{jsx as i,jsxs as a}from"react/jsx-runtime";import"swiper/css";import"swiper/css/grid";import"swiper/css/pagination";import{Container as d,Heading as c}from"@anker-in/headless-ui";import{useRouter as u}from"next/router";import{useState as f}from"react";import{Grid as g,Pagination as v}from"swiper/modules";import{Swiper as b,SwiperSlide as w}from"swiper/react";import l from"./benefitItem";import{useCreditsContext as C}from"../context/provider";import{gaTrack as x,getGtmGroup as k}from"../../../helpers/track";import{cn as N}from"../../../helpers/utils";const E=({copy:o})=>{const[r,n]=f(null),{profile:m}=C(),p=u(),s=({item:t,index:e})=>{x({event:"ga4Event",event_name:"lp_button",member_active_status:m?.activated?"active":"not active",event_parameters:{page_group:k(p),position:o.title,button_name:t.text,info:""}}),r===e?n(null):(n(e),setTimeout(()=>{n(null)},5e3))};return a(d,{id:"benefits",className:"!z-[30] bg-[#F5F5F7]",children:[i(c,{as:"h2",size:"4",html:o?.title}),i("div",{className:"mt-[24px] grid grid-cols-2 gap-[16px] l:hidden min-md:grid-cols-3 min-xl:grid-cols-4",children:o.benefits.map((t,e)=>i(l,{item:t,handleClick:s,isNoteActive:r===e,index:e},e))}),a("div",{className:"mt-[24px] hidden l:block",children:[i(b,{spaceBetween:16,slidesPerView:2,slidesPerGroup:2,grid:{rows:2,fill:"row"},breakpoints:{768:{slidesPerView:3,slidesPerGroup:3}},wrapperClass:"items-stretch",modules:[g,v],pagination:{clickable:!0,el:"#benefits-pagination",renderBullet(t,e){return`<div class='${e} !flex justify-center size-[8px] rounded-full bg-[#D9D9D9] cursor-pointer items-center'>
2
- </div>`}},children:o.benefits.map((t,e)=>i(w,{className:N("!h-auto",r===e&&"!z-[100]"),children:i(l,{item:t,handleClick:s,isNoteActive:r===e,index:e})},e))}),i("div",{id:"benefits-pagination",className:`mx-auto mt-[12px] grid !w-fit grid-flow-col [&_.swiper-pagination-bullet-active>div]:!bg-[#151515]
3
- [&_.swiper-pagination-bullet]:cursor-pointer [&_.swiper-pagination-bullet]:rounded-full`})]}),r&&i("div",{role:"button",tabIndex:0,className:"fixed inset-0 z-10",onClick:()=>n(null),onKeyDown:t=>t.key==="Escape"&&n(null)})]})};export{E as CreditsBenefits};
1
+ import{jsx as t,jsxs as a}from"react/jsx-runtime";import"swiper/css";import"swiper/css/grid";import"swiper/css/pagination";import{Container as d,Heading as c}from"@anker-in/headless-ui";import{useState as u}from"react";import{Grid as f,Pagination as g}from"swiper/modules";import{Swiper as v,SwiperSlide as b}from"swiper/react";import l from"./benefitItem";import{useCreditsContext as w}from"../context/provider";import{gaTrack as C}from"../../../helpers/track";import{cn as x}from"../../../helpers/utils";const G=({copy:o})=>{const[n,r]=u(null),{profile:p,gtm:m}=w(),s=({item:i,index:e})=>{C({event:"ga4Event",event_name:"lp_button",member_active_status:p?.activated?"active":"not active",event_parameters:{page_group:m.pageGroup,position:o.title,button_name:i.text,info:""}}),n===e?r(null):(r(e),setTimeout(()=>{r(null)},5e3))};return a(d,{id:"benefits",className:"!z-[30] bg-[#F5F5F7]",children:[t(c,{as:"h2",size:"4",html:o?.title}),t("div",{className:"mt-[24px] grid grid-cols-2 gap-[16px] l:hidden min-md:grid-cols-3 min-xl:grid-cols-4",children:o.benefits.map((i,e)=>t(l,{item:i,handleClick:s,isNoteActive:n===e,index:e},e))}),a("div",{className:"mt-[24px] hidden l:block",children:[t(v,{spaceBetween:16,slidesPerView:2,slidesPerGroup:2,grid:{rows:2,fill:"row"},breakpoints:{768:{slidesPerView:3,slidesPerGroup:3}},wrapperClass:"items-stretch",modules:[f,g],pagination:{clickable:!0,el:"#benefits-pagination",renderBullet(i,e){return`<div class='${e} !flex justify-center size-[8px] rounded-full bg-[#D9D9D9] cursor-pointer items-center'>
2
+ </div>`}},children:o.benefits.map((i,e)=>t(b,{className:x("!h-auto",n===e&&"!z-[100]"),children:t(l,{item:i,handleClick:s,isNoteActive:n===e,index:e})},e))}),t("div",{id:"benefits-pagination",className:`mx-auto mt-[12px] grid !w-fit grid-flow-col [&_.swiper-pagination-bullet-active>div]:!bg-[#151515]
3
+ [&_.swiper-pagination-bullet]:cursor-pointer [&_.swiper-pagination-bullet]:rounded-full`})]}),n&&t("div",{role:"button",tabIndex:0,className:"fixed inset-0 z-10",onClick:()=>r(null),onKeyDown:i=>i.key==="Escape"&&r(null)})]})};export{G as CreditsBenefits};
4
4
  //# sourceMappingURL=index.js.map