@anker-in/campaign-ui 0.3.4 → 0.4.0-beta.1

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 (363) hide show
  1. package/dist/cjs/components/LiveChatWidget/LiveChatWidget.js +1 -1
  2. package/dist/cjs/components/LiveChatWidget/LiveChatWidget.js.map +3 -3
  3. package/dist/cjs/components/LiveChatWidget/components/MessageContent/PromotionList.js.map +2 -2
  4. package/dist/cjs/components/LiveChatWidget/components/MessageList.js +3 -3
  5. package/dist/cjs/components/LiveChatWidget/components/MessageList.js.map +3 -3
  6. package/dist/cjs/components/LiveChatWidget/hooks/useChatState.d.ts +2 -1
  7. package/dist/cjs/components/LiveChatWidget/hooks/useChatState.js +1 -1
  8. package/dist/cjs/components/LiveChatWidget/hooks/useChatState.js.map +2 -2
  9. package/dist/cjs/components/LiveChatWidget/types.d.ts +2 -1
  10. package/dist/cjs/components/LiveChatWidget/types.js.map +1 -1
  11. package/dist/cjs/components/credits/context/const.d.ts +10 -2
  12. package/dist/cjs/components/credits/context/const.js +1 -1
  13. package/dist/cjs/components/credits/context/const.js.map +2 -2
  14. package/dist/cjs/components/credits/context/hooks/useFunctionMemberPrice.d.ts +7 -0
  15. package/dist/cjs/components/credits/context/hooks/useFunctionMemberPrice.js +2 -0
  16. package/dist/cjs/components/credits/context/hooks/useFunctionMemberPrice.js.map +7 -0
  17. package/dist/cjs/components/credits/context/hooks/useMyRewards.js +1 -1
  18. package/dist/cjs/components/credits/context/hooks/useMyRewards.js.map +3 -3
  19. package/dist/cjs/components/credits/context/hooks/useRedeemGoGift.d.ts +17 -0
  20. package/dist/cjs/components/credits/context/hooks/useRedeemGoGift.js +2 -0
  21. package/dist/cjs/components/credits/context/hooks/useRedeemGoGift.js.map +7 -0
  22. package/dist/cjs/components/credits/context/hooks/useRedeemableList.d.ts +7 -2
  23. package/dist/cjs/components/credits/context/hooks/useRedeemableList.js +1 -1
  24. package/dist/cjs/components/credits/context/hooks/useRedeemableList.js.map +3 -3
  25. package/dist/cjs/components/credits/context/provider.d.ts +5 -1
  26. package/dist/cjs/components/credits/context/provider.js +1 -1
  27. package/dist/cjs/components/credits/context/provider.js.map +3 -3
  28. package/dist/cjs/components/credits/context/response.d.ts +1 -0
  29. package/dist/cjs/components/credits/context/response.js.map +1 -1
  30. package/dist/cjs/components/credits/context/utils/atobID.d.ts +1 -0
  31. package/dist/cjs/components/credits/context/utils/atobID.js +2 -0
  32. package/dist/cjs/components/credits/context/utils/atobID.js.map +7 -0
  33. package/dist/cjs/components/credits/context/utils/functionDiscountCalculate.d.ts +5 -0
  34. package/dist/cjs/components/credits/context/utils/functionDiscountCalculate.js +2 -0
  35. package/dist/cjs/components/credits/context/utils/functionDiscountCalculate.js.map +7 -0
  36. package/dist/cjs/components/credits/context/utils/getFunctionMemberPrice.d.ts +8 -0
  37. package/dist/cjs/components/credits/context/utils/getFunctionMemberPrice.js +2 -0
  38. package/dist/cjs/components/credits/context/utils/getFunctionMemberPrice.js.map +7 -0
  39. package/dist/cjs/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.d.ts +9 -0
  40. package/dist/cjs/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.js +2 -0
  41. package/dist/cjs/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.js.map +7 -0
  42. package/dist/cjs/components/credits/context/utils/variantGetCoupon.d.ts +6 -0
  43. package/dist/cjs/components/credits/context/utils/variantGetCoupon.js +2 -0
  44. package/dist/cjs/components/credits/context/utils/variantGetCoupon.js.map +7 -0
  45. package/dist/cjs/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.js +1 -1
  46. package/dist/cjs/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.js.map +2 -2
  47. package/dist/cjs/components/credits/creditsBanner/index.js +2 -2
  48. package/dist/cjs/components/credits/creditsBanner/index.js.map +2 -2
  49. package/dist/cjs/components/credits/creditsCash/CreditsCash.js +1 -1
  50. package/dist/cjs/components/credits/creditsCash/CreditsCash.js.map +2 -2
  51. package/dist/cjs/components/credits/creditsGoGift/CreditsGoGift.d.ts +5 -0
  52. package/dist/cjs/components/credits/creditsGoGift/CreditsGoGift.js +2 -0
  53. package/dist/cjs/components/credits/creditsGoGift/CreditsGoGift.js.map +7 -0
  54. package/dist/cjs/components/credits/creditsGoGift/index.d.ts +2 -0
  55. package/dist/cjs/components/credits/creditsGoGift/index.js +2 -0
  56. package/dist/cjs/components/credits/creditsGoGift/index.js.map +7 -0
  57. package/dist/cjs/components/credits/creditsGoGift/type.d.ts +22 -0
  58. package/dist/cjs/components/credits/creditsGoGift/type.js +2 -0
  59. package/dist/cjs/components/credits/creditsGoGift/type.js.map +7 -0
  60. package/dist/cjs/components/credits/creditsGofit/CreditsGofit.d.ts +5 -0
  61. package/dist/cjs/components/credits/creditsGofit/CreditsGofit.js +2 -0
  62. package/dist/cjs/components/credits/creditsGofit/CreditsGofit.js.map +7 -0
  63. package/dist/cjs/components/credits/creditsGofit/index.d.ts +2 -0
  64. package/dist/cjs/components/credits/creditsGofit/index.js +2 -0
  65. package/dist/cjs/components/credits/creditsGofit/index.js.map +7 -0
  66. package/dist/cjs/components/credits/creditsGofit/type.d.ts +22 -0
  67. package/dist/cjs/components/credits/creditsGofit/type.js +2 -0
  68. package/dist/cjs/components/credits/creditsGofit/type.js.map +7 -0
  69. package/dist/cjs/components/credits/creditsInfoCard/index.js +1 -1
  70. package/dist/cjs/components/credits/creditsInfoCard/index.js.map +3 -3
  71. package/dist/cjs/components/credits/creditsMemberPrice/CreditsMemberPrice.js +1 -1
  72. package/dist/cjs/components/credits/creditsMemberPrice/CreditsMemberPrice.js.map +2 -2
  73. package/dist/cjs/components/credits/creditsRedeemList/CreditsRedeemList.js +1 -1
  74. package/dist/cjs/components/credits/creditsRedeemList/CreditsRedeemList.js.map +3 -3
  75. package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal/CouponInit.d.ts +10 -0
  76. package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal/CouponInit.js +2 -0
  77. package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal/CouponInit.js.map +7 -0
  78. package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal/CouponSuccess.d.ts +10 -0
  79. package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal/CouponSuccess.js +2 -0
  80. package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal/CouponSuccess.js.map +7 -0
  81. package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.d.ts +4 -5
  82. package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.js +1 -1
  83. package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.js.map +3 -3
  84. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.d.ts +2 -3
  85. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.js +1 -1
  86. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.js.map +2 -2
  87. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Init.d.ts +2 -3
  88. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Init.js +1 -1
  89. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Init.js.map +2 -2
  90. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.d.ts +1 -3
  91. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js +1 -1
  92. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js.map +3 -3
  93. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.d.ts +3 -4
  94. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js +1 -1
  95. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js.map +2 -2
  96. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.d.ts +2 -3
  97. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.js +1 -1
  98. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.js.map +2 -2
  99. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.d.ts +4 -5
  100. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.js +1 -1
  101. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.js.map +3 -3
  102. package/dist/cjs/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductInit.d.ts +10 -0
  103. package/dist/cjs/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductInit.js +2 -0
  104. package/dist/cjs/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductInit.js.map +7 -0
  105. package/dist/cjs/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductSuccess.d.ts +9 -0
  106. package/dist/cjs/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductSuccess.js +2 -0
  107. package/dist/cjs/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductSuccess.js.map +7 -0
  108. package/dist/cjs/components/credits/creditsRedeemList/RedeemVirtualProductModal.d.ts +8 -0
  109. package/dist/cjs/components/credits/creditsRedeemList/RedeemVirtualProductModal.js +2 -0
  110. package/dist/cjs/components/credits/creditsRedeemList/RedeemVirtualProductModal.js.map +7 -0
  111. package/dist/cjs/components/credits/creditsRedeemList/RedeemableItem.js +1 -1
  112. package/dist/cjs/components/credits/creditsRedeemList/RedeemableItem.js.map +2 -2
  113. package/dist/cjs/components/credits/creditsRedeemList/type.d.ts +11 -0
  114. package/dist/cjs/components/credits/creditsRedeemList/type.js +1 -1
  115. package/dist/cjs/components/credits/creditsRedeemList/type.js.map +1 -1
  116. package/dist/cjs/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js +1 -1
  117. package/dist/cjs/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js.map +2 -2
  118. package/dist/cjs/components/credits/creditsWaysToGetCredits/type.d.ts +2 -2
  119. package/dist/cjs/components/credits/creditsWaysToGetCredits/type.js.map +1 -1
  120. package/dist/cjs/components/credits/index.d.ts +2 -1
  121. package/dist/cjs/components/credits/index.js +1 -1
  122. package/dist/cjs/components/credits/index.js.map +3 -3
  123. package/dist/cjs/components/credits/modal/MyRewardsModal.d.ts +16 -0
  124. package/dist/cjs/components/credits/modal/MyRewardsModal.js +1 -1
  125. package/dist/cjs/components/credits/modal/MyRewardsModal.js.map +3 -3
  126. package/dist/cjs/components/credits/modal/RewardsModal.d.ts +64 -0
  127. package/dist/cjs/components/credits/modal/RewardsModal.js +2 -0
  128. package/dist/cjs/components/credits/modal/RewardsModal.js.map +7 -0
  129. package/dist/cjs/components/credits/modal/activitiesModal.d.ts +1 -1
  130. package/dist/cjs/components/credits/modal/activitiesModal.js +2 -2
  131. package/dist/cjs/components/credits/modal/activitiesModal.js.map +3 -3
  132. package/dist/cjs/components/credits/modal/creditsUploadReceiptModal.js +2 -2
  133. package/dist/cjs/components/credits/modal/creditsUploadReceiptModal.js.map +3 -3
  134. package/dist/cjs/components/credits/modal/loadingDots.js +1 -1
  135. package/dist/cjs/components/credits/modal/loadingDots.js.map +2 -2
  136. package/dist/cjs/components/credits/modal/modalContainer.js +2 -2
  137. package/dist/cjs/components/credits/modal/modalContainer.js.map +4 -4
  138. package/dist/cjs/components/credits/modal/rulesModal.d.ts +1 -1
  139. package/dist/cjs/components/credits/modal/rulesModal.js +2 -2
  140. package/dist/cjs/components/credits/modal/rulesModal.js.map +3 -3
  141. package/dist/cjs/components/credits/modal/subscribeModal.d.ts +1 -1
  142. package/dist/cjs/components/credits/modal/subscribeModal.js +2 -2
  143. package/dist/cjs/components/credits/modal/subscribeModal.js.map +3 -3
  144. package/dist/cjs/components/credits/modal/tip.js +1 -1
  145. package/dist/cjs/components/credits/modal/tip.js.map +2 -2
  146. package/dist/cjs/components/credits/type.d.ts +67 -5
  147. package/dist/cjs/components/credits/type.js +1 -1
  148. package/dist/cjs/components/credits/type.js.map +1 -1
  149. package/dist/cjs/stories/LiveChatWidget.stories.js +2 -9
  150. package/dist/cjs/stories/LiveChatWidget.stories.js.map +2 -2
  151. package/dist/cjs/templates/Credits.d.ts +1 -87
  152. package/dist/cjs/templates/Credits.js +1 -1
  153. package/dist/cjs/templates/Credits.js.map +3 -3
  154. package/dist/cjs/templates/Credits.types.d.ts +96 -0
  155. package/dist/cjs/templates/Credits.types.js +2 -0
  156. package/dist/cjs/templates/Credits.types.js.map +7 -0
  157. package/dist/esm/components/LiveChatWidget/LiveChatWidget.js +1 -1
  158. package/dist/esm/components/LiveChatWidget/LiveChatWidget.js.map +3 -3
  159. package/dist/esm/components/LiveChatWidget/components/MessageContent/PromotionList.js.map +2 -2
  160. package/dist/esm/components/LiveChatWidget/components/MessageList.js +3 -3
  161. package/dist/esm/components/LiveChatWidget/components/MessageList.js.map +3 -3
  162. package/dist/esm/components/LiveChatWidget/hooks/useChatState.d.ts +2 -1
  163. package/dist/esm/components/LiveChatWidget/hooks/useChatState.js +1 -1
  164. package/dist/esm/components/LiveChatWidget/hooks/useChatState.js.map +2 -2
  165. package/dist/esm/components/LiveChatWidget/types.d.ts +2 -1
  166. package/dist/esm/components/credits/context/const.d.ts +10 -2
  167. package/dist/esm/components/credits/context/const.js +1 -1
  168. package/dist/esm/components/credits/context/const.js.map +2 -2
  169. package/dist/esm/components/credits/context/hooks/useFunctionMemberPrice.d.ts +7 -0
  170. package/dist/esm/components/credits/context/hooks/useFunctionMemberPrice.js +2 -0
  171. package/dist/esm/components/credits/context/hooks/useFunctionMemberPrice.js.map +7 -0
  172. package/dist/esm/components/credits/context/hooks/useMyRewards.js +1 -1
  173. package/dist/esm/components/credits/context/hooks/useMyRewards.js.map +3 -3
  174. package/dist/esm/components/credits/context/hooks/useRedeemGoGift.d.ts +17 -0
  175. package/dist/esm/components/credits/context/hooks/useRedeemGoGift.js +2 -0
  176. package/dist/esm/components/credits/context/hooks/useRedeemGoGift.js.map +7 -0
  177. package/dist/esm/components/credits/context/hooks/useRedeemableList.d.ts +7 -2
  178. package/dist/esm/components/credits/context/hooks/useRedeemableList.js +1 -1
  179. package/dist/esm/components/credits/context/hooks/useRedeemableList.js.map +3 -3
  180. package/dist/esm/components/credits/context/provider.d.ts +5 -1
  181. package/dist/esm/components/credits/context/provider.js +1 -1
  182. package/dist/esm/components/credits/context/provider.js.map +3 -3
  183. package/dist/esm/components/credits/context/response.d.ts +1 -0
  184. package/dist/esm/components/credits/context/utils/atobID.d.ts +1 -0
  185. package/dist/esm/components/credits/context/utils/atobID.js +2 -0
  186. package/dist/esm/components/credits/context/utils/atobID.js.map +7 -0
  187. package/dist/esm/components/credits/context/utils/functionDiscountCalculate.d.ts +5 -0
  188. package/dist/esm/components/credits/context/utils/functionDiscountCalculate.js +2 -0
  189. package/dist/esm/components/credits/context/utils/functionDiscountCalculate.js.map +7 -0
  190. package/dist/esm/components/credits/context/utils/getFunctionMemberPrice.d.ts +8 -0
  191. package/dist/esm/components/credits/context/utils/getFunctionMemberPrice.js +2 -0
  192. package/dist/esm/components/credits/context/utils/getFunctionMemberPrice.js.map +7 -0
  193. package/dist/esm/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.d.ts +9 -0
  194. package/dist/esm/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.js +2 -0
  195. package/dist/esm/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.js.map +7 -0
  196. package/dist/esm/components/credits/context/utils/variantGetCoupon.d.ts +6 -0
  197. package/dist/esm/components/credits/context/utils/variantGetCoupon.js +2 -0
  198. package/dist/esm/components/credits/context/utils/variantGetCoupon.js.map +7 -0
  199. package/dist/esm/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.js +1 -1
  200. package/dist/esm/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.js.map +1 -1
  201. package/dist/esm/components/credits/creditsBanner/index.js +2 -2
  202. package/dist/esm/components/credits/creditsBanner/index.js.map +2 -2
  203. package/dist/esm/components/credits/creditsCash/CreditsCash.js +1 -1
  204. package/dist/esm/components/credits/creditsCash/CreditsCash.js.map +1 -1
  205. package/dist/esm/components/credits/creditsGoGift/CreditsGoGift.d.ts +5 -0
  206. package/dist/esm/components/credits/creditsGoGift/CreditsGoGift.js +2 -0
  207. package/dist/esm/components/credits/creditsGoGift/CreditsGoGift.js.map +7 -0
  208. package/dist/esm/components/credits/creditsGoGift/index.d.ts +2 -0
  209. package/dist/esm/components/credits/creditsGoGift/index.js +2 -0
  210. package/dist/esm/components/credits/creditsGoGift/index.js.map +7 -0
  211. package/dist/esm/components/credits/creditsGoGift/type.d.ts +22 -0
  212. package/dist/esm/components/credits/creditsGoGift/type.js +1 -0
  213. package/dist/esm/components/credits/creditsGoGift/type.js.map +7 -0
  214. package/dist/esm/components/credits/creditsGofit/CreditsGofit.d.ts +5 -0
  215. package/dist/esm/components/credits/creditsGofit/CreditsGofit.js +2 -0
  216. package/dist/esm/components/credits/creditsGofit/CreditsGofit.js.map +7 -0
  217. package/dist/esm/components/credits/creditsGofit/index.d.ts +2 -0
  218. package/dist/esm/components/credits/creditsGofit/index.js +2 -0
  219. package/dist/esm/components/credits/creditsGofit/index.js.map +7 -0
  220. package/dist/esm/components/credits/creditsGofit/type.d.ts +22 -0
  221. package/dist/esm/components/credits/creditsGofit/type.js +1 -0
  222. package/dist/esm/components/credits/creditsGofit/type.js.map +7 -0
  223. package/dist/esm/components/credits/creditsInfoCard/index.js +1 -1
  224. package/dist/esm/components/credits/creditsInfoCard/index.js.map +3 -3
  225. package/dist/esm/components/credits/creditsMemberPrice/CreditsMemberPrice.js +1 -1
  226. package/dist/esm/components/credits/creditsMemberPrice/CreditsMemberPrice.js.map +1 -1
  227. package/dist/esm/components/credits/creditsRedeemList/CreditsRedeemList.js +1 -1
  228. package/dist/esm/components/credits/creditsRedeemList/CreditsRedeemList.js.map +3 -3
  229. package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal/CouponInit.d.ts +10 -0
  230. package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal/CouponInit.js +2 -0
  231. package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal/CouponInit.js.map +7 -0
  232. package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal/CouponSuccess.d.ts +10 -0
  233. package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal/CouponSuccess.js +2 -0
  234. package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal/CouponSuccess.js.map +7 -0
  235. package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.d.ts +4 -5
  236. package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.js +1 -1
  237. package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.js.map +3 -3
  238. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.d.ts +2 -3
  239. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.js +1 -1
  240. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.js.map +2 -2
  241. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.d.ts +2 -3
  242. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.js +1 -1
  243. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.js.map +2 -2
  244. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.d.ts +1 -3
  245. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js +1 -1
  246. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js.map +3 -3
  247. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.d.ts +3 -4
  248. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js +1 -1
  249. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js.map +2 -2
  250. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.d.ts +2 -3
  251. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.js +1 -1
  252. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.js.map +2 -2
  253. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.d.ts +4 -5
  254. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.js +1 -1
  255. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.js.map +3 -3
  256. package/dist/esm/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductInit.d.ts +10 -0
  257. package/dist/esm/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductInit.js +2 -0
  258. package/dist/esm/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductInit.js.map +7 -0
  259. package/dist/esm/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductSuccess.d.ts +9 -0
  260. package/dist/esm/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductSuccess.js +2 -0
  261. package/dist/esm/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductSuccess.js.map +7 -0
  262. package/dist/esm/components/credits/creditsRedeemList/RedeemVirtualProductModal.d.ts +8 -0
  263. package/dist/esm/components/credits/creditsRedeemList/RedeemVirtualProductModal.js +2 -0
  264. package/dist/esm/components/credits/creditsRedeemList/RedeemVirtualProductModal.js.map +7 -0
  265. package/dist/esm/components/credits/creditsRedeemList/RedeemableItem.js +1 -1
  266. package/dist/esm/components/credits/creditsRedeemList/RedeemableItem.js.map +2 -2
  267. package/dist/esm/components/credits/creditsRedeemList/type.d.ts +11 -0
  268. package/dist/esm/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js +1 -1
  269. package/dist/esm/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js.map +1 -1
  270. package/dist/esm/components/credits/creditsWaysToGetCredits/type.d.ts +2 -2
  271. package/dist/esm/components/credits/creditsWaysToGetCredits/type.js.map +1 -1
  272. package/dist/esm/components/credits/index.d.ts +2 -1
  273. package/dist/esm/components/credits/index.js +1 -1
  274. package/dist/esm/components/credits/index.js.map +3 -3
  275. package/dist/esm/components/credits/modal/MyRewardsModal.d.ts +16 -0
  276. package/dist/esm/components/credits/modal/MyRewardsModal.js +1 -1
  277. package/dist/esm/components/credits/modal/MyRewardsModal.js.map +3 -3
  278. package/dist/esm/components/credits/modal/RewardsModal.d.ts +64 -0
  279. package/dist/esm/components/credits/modal/RewardsModal.js +2 -0
  280. package/dist/esm/components/credits/modal/RewardsModal.js.map +7 -0
  281. package/dist/esm/components/credits/modal/activitiesModal.d.ts +1 -1
  282. package/dist/esm/components/credits/modal/activitiesModal.js +2 -2
  283. package/dist/esm/components/credits/modal/activitiesModal.js.map +3 -3
  284. package/dist/esm/components/credits/modal/creditsUploadReceiptModal.js +2 -2
  285. package/dist/esm/components/credits/modal/creditsUploadReceiptModal.js.map +2 -2
  286. package/dist/esm/components/credits/modal/loadingDots.js +1 -1
  287. package/dist/esm/components/credits/modal/loadingDots.js.map +2 -2
  288. package/dist/esm/components/credits/modal/modalContainer.js +2 -2
  289. package/dist/esm/components/credits/modal/modalContainer.js.map +3 -3
  290. package/dist/esm/components/credits/modal/rulesModal.d.ts +1 -1
  291. package/dist/esm/components/credits/modal/rulesModal.js +2 -2
  292. package/dist/esm/components/credits/modal/rulesModal.js.map +3 -3
  293. package/dist/esm/components/credits/modal/subscribeModal.d.ts +1 -1
  294. package/dist/esm/components/credits/modal/subscribeModal.js +2 -2
  295. package/dist/esm/components/credits/modal/subscribeModal.js.map +2 -2
  296. package/dist/esm/components/credits/modal/tip.js +1 -1
  297. package/dist/esm/components/credits/modal/tip.js.map +2 -2
  298. package/dist/esm/components/credits/type.d.ts +67 -5
  299. package/dist/esm/stories/LiveChatWidget.stories.js +1 -8
  300. package/dist/esm/stories/LiveChatWidget.stories.js.map +2 -2
  301. package/dist/esm/templates/Credits.d.ts +1 -87
  302. package/dist/esm/templates/Credits.js +1 -1
  303. package/dist/esm/templates/Credits.js.map +3 -3
  304. package/dist/esm/templates/Credits.types.d.ts +96 -0
  305. package/dist/esm/templates/Credits.types.js +2 -0
  306. package/dist/esm/templates/Credits.types.js.map +7 -0
  307. package/package.json +2 -2
  308. package/src/components/LiveChatWidget/LiveChatWidget.tsx +20 -0
  309. package/src/components/LiveChatWidget/components/MessageContent/PromotionList.tsx +1 -1
  310. package/src/components/LiveChatWidget/components/MessageList.tsx +39 -44
  311. package/src/components/LiveChatWidget/hooks/useChatState.ts +4 -3
  312. package/src/components/LiveChatWidget/types.ts +2 -1
  313. package/src/components/credits/context/const.ts +8 -0
  314. package/src/components/credits/context/hooks/useMyRewards.ts +7 -31
  315. package/src/components/credits/context/hooks/useRedeemGoGift.ts +36 -0
  316. package/src/components/credits/context/hooks/useRedeemableList.ts +13 -19
  317. package/src/components/credits/context/provider.tsx +17 -2
  318. package/src/components/credits/context/response.ts +1 -0
  319. package/src/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.tsx +2 -2
  320. package/src/components/credits/creditsBanner/index.tsx +5 -5
  321. package/src/components/credits/creditsCash/CreditsCash.tsx +1 -1
  322. package/src/components/credits/creditsGoGift/CreditsGoGift.tsx +210 -0
  323. package/src/components/credits/creditsGoGift/index.ts +2 -0
  324. package/src/components/credits/creditsGoGift/type.ts +23 -0
  325. package/src/components/credits/creditsInfoCard/index.tsx +5 -28
  326. package/src/components/credits/creditsMemberPrice/CreditsMemberPrice.tsx +1 -1
  327. package/src/components/credits/creditsRedeemList/CreditsRedeemList.tsx +39 -17
  328. package/src/components/credits/creditsRedeemList/RedeemCouponModal/CouponInit.tsx +77 -0
  329. package/src/components/credits/creditsRedeemList/RedeemCouponModal/CouponSuccess.tsx +86 -0
  330. package/src/components/credits/creditsRedeemList/RedeemCouponModal.tsx +29 -138
  331. package/src/components/credits/creditsRedeemList/RedeemProductModal/Address.tsx +5 -6
  332. package/src/components/credits/creditsRedeemList/RedeemProductModal/Init.tsx +11 -12
  333. package/src/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.tsx +23 -14
  334. package/src/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.tsx +11 -9
  335. package/src/components/credits/creditsRedeemList/RedeemProductModal/Success.tsx +4 -5
  336. package/src/components/credits/creditsRedeemList/RedeemProductModal/index.tsx +29 -28
  337. package/src/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductInit.tsx +101 -0
  338. package/src/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductSuccess.tsx +65 -0
  339. package/src/components/credits/creditsRedeemList/RedeemVirtualProductModal.tsx +156 -0
  340. package/src/components/credits/creditsRedeemList/RedeemableItem.tsx +1 -1
  341. package/src/components/credits/creditsRedeemList/type.ts +11 -0
  342. package/src/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.tsx +2 -2
  343. package/src/components/credits/creditsWaysToGetCredits/type.ts +2 -2
  344. package/src/components/credits/index.ts +2 -1
  345. package/src/components/credits/modal/{activitiesModal.tsx → ActivitiesModal.tsx} +2 -2
  346. package/src/components/credits/modal/{creditsUploadReceiptModal.tsx → CreditsUploadReceiptModal.tsx} +1 -1
  347. package/src/components/credits/modal/{modalContainer.tsx → ModalContainer.tsx} +1 -1
  348. package/src/components/credits/modal/{MyRewardsModal.tsx → RewardsModal.tsx} +145 -103
  349. package/src/components/credits/modal/{rulesModal.tsx → RulesModal.tsx} +1 -1
  350. package/src/components/credits/modal/{subscribeModal.tsx → SubscribeModal.tsx} +1 -1
  351. package/src/components/credits/type.ts +68 -5
  352. package/src/stories/LiveChatWidget.stories.tsx +7 -12
  353. package/src/styles/livechat.css +29 -0
  354. package/src/templates/Credits.tsx +110 -142
  355. package/src/templates/Credits.types.ts +110 -0
  356. package/dist/index.d.mts +0 -1305
  357. package/dist/index.d.ts +0 -1305
  358. package/dist/index.js +0 -26656
  359. package/dist/index.js.map +0 -1
  360. package/dist/index.mjs +0 -26641
  361. package/dist/index.mjs.map +0 -1
  362. /package/src/components/credits/modal/{loadingDots.tsx → LoadingDots.tsx} +0 -0
  363. /package/src/components/credits/modal/{tip.tsx → Tip.tsx} +0 -0
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/components/credits/creditsRedeemList/RedeemProductModal/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'\nimport { useHeadlessContext } from '@anker-in/lib'\nimport { ROUNDED_BRANDS } from '../../../../constants'\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 const { brand } = useHeadlessContext()\n const rounded = ROUNDED_BRANDS.includes(brand)\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={classNames('flex w-full items-center bg-[#F5F5F7] p-[16px]', !rounded && 'rounded-none')}>\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": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAuBM,IAAAI,EAAA,6BAvBNC,EAA6B,iCAC7BC,EAAuB,yBAGvBC,EAA4B,yBAC5BC,EAAmC,yBACnCC,EAA+B,iCAYxB,MAAMP,EAAU,CAAC,CAAE,KAAAQ,EAAM,gBAAAC,EAAiB,QAAAC,EAAS,QAAAC,EAAS,SAAAC,EAAU,QAAAC,EAAS,KAAAC,CAAK,IAAoB,CAC7G,KAAM,CAAE,MAAAC,CAAM,KAAI,sBAAmB,EAC/BC,EAAU,iBAAe,SAASD,CAAK,EAC7C,SACE,OAAC,OAAI,aAAW,EAAAE,SAAW,iFAAiF,EAC1G,oBAAC,OAAI,UAAU,6BACb,oBAAC,OAAI,UAAU,wDACZ,SAAAT,EAAK,YAAY,QAAQ,YAAY,IAAI,CAACU,EAAqBC,OAC9D,OAAC,QAAiB,UAAU,qDAAqD,KAAMD,GAA5EC,CAAyF,CACrG,EACH,EAECV,MAAmB,OAAC,QAAK,UAAU,6BAA6B,KAAMA,EAAiB,KAExF,OAAC,OAAI,aAAW,EAAAQ,SAAW,iDAAkD,CAACD,GAAW,cAAc,EACrG,mBAAC,eAAY,KAAMF,EAAM,KAAMN,EAAM,EACvC,KAEA,OAAC,UACC,QAASE,GAAW,CAACC,EACrB,QAAQ,UACR,UAAU,qDACV,QAASE,EACT,SAAUD,EAET,SAAAJ,EAAK,YAAY,QAAQ,cAC5B,GACF,EACF,CAEJ",
4
+ "sourcesContent": ["import { Button, Text } from '@anker-in/headless-ui'\nimport classNames from 'classnames'\nimport type { RedeemableItem as RedeemableItemType, RedeemModalCommon } from '../../type'\nimport { ProductInfo } from './ProductInfo'\nimport { useHeadlessContext } from '@anker-in/lib'\nimport { ROUNDED_BRANDS } from '../../../../constants'\n\ntype SuccessProps = {\n copy: RedeemModalCommon\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 const { brand } = useHeadlessContext()\n const rounded = ROUNDED_BRANDS.includes(brand)\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.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={classNames('flex w-full items-center bg-[#F5F5F7] p-[16px]', !rounded && 'rounded-none')}>\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.product.paymentButton}\n </Button>\n </div>\n </div>\n )\n}\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAsBM,IAAAI,EAAA,6BAtBNC,EAA6B,iCAC7BC,EAAuB,yBAEvBC,EAA4B,yBAC5BC,EAAmC,yBACnCC,EAA+B,iCAYxB,MAAMP,EAAU,CAAC,CAAE,KAAAQ,EAAM,gBAAAC,EAAiB,QAAAC,EAAS,QAAAC,EAAS,SAAAC,EAAU,QAAAC,EAAS,KAAAC,CAAK,IAAoB,CAC7G,KAAM,CAAE,MAAAC,CAAM,KAAI,sBAAmB,EAC/BC,EAAU,iBAAe,SAASD,CAAK,EAC7C,SACE,OAAC,OAAI,aAAW,EAAAE,SAAW,iFAAiF,EAC1G,oBAAC,OAAI,UAAU,6BACb,oBAAC,OAAI,UAAU,wDACZ,SAAAT,EAAK,QAAQ,YAAY,IAAI,CAACU,EAAqBC,OAClD,OAAC,QAAiB,UAAU,qDAAqD,KAAMD,GAA5EC,CAAyF,CACrG,EACH,EAECV,MAAmB,OAAC,QAAK,UAAU,6BAA6B,KAAMA,EAAiB,KAExF,OAAC,OAAI,aAAW,EAAAQ,SAAW,iDAAkD,CAACD,GAAW,cAAc,EACrG,mBAAC,eAAY,KAAMF,EAAM,KAAMN,EAAM,EACvC,KAEA,OAAC,UACC,QAASE,GAAW,CAACC,EACrB,QAAQ,UACR,UAAU,qDACV,QAASE,EACT,SAAUD,EAET,SAAAJ,EAAK,QAAQ,cAChB,GACF,EACF,CAEJ",
6
6
  "names": ["Success_exports", "__export", "Success", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_classnames", "import_ProductInfo", "import_lib", "import_constants", "copy", "shippingProduct", "loading", "address", "disabled", "onClose", "item", "brand", "rounded", "classNames", "description", "index"]
7
7
  }
@@ -1,10 +1,9 @@
1
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 & {
2
+ import type { ModalContainerProps } from '../../modal/ModalContainer';
3
+ import type { RedeemableItem as RedeemableItemType, RedeemModalCommon } from '../../type';
4
+ type RedeemProductModalProps = Omit<ModalContainerProps, 'isOpen'> & {
6
5
  item: RedeemableItemType;
7
- copy: CreditsRedeemListCopy;
6
+ copy: RedeemModalCommon;
8
7
  onError: (code: AlpcErrorCode) => void;
9
8
  };
10
9
  declare function RedeemProductModal({ item, copy, onError, ...props }: RedeemProductModalProps): import("react/jsx-runtime").JSX.Element;
@@ -1,2 +1,2 @@
1
- "use strict";var W=Object.create;var g=Object.defineProperty;var X=Object.getOwnPropertyDescriptor;var Y=Object.getOwnPropertyNames;var Z=Object.getPrototypeOf,$=Object.prototype.hasOwnProperty;var j=(r,e)=>{for(var t in e)g(r,t,{get:e[t],enumerable:!0})},y=(r,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Y(e))!$.call(r,i)&&i!==t&&g(r,i,{get:()=>e[i],enumerable:!(a=X(e,i))||a.enumerable});return r};var L=(r,e,t)=>(t=r!=null?W(Z(r)):{},y(e||!r||!r.__esModule?g(t,"default",{value:r,enumerable:!0}):t,r)),D=r=>y(g({},"__esModule",{value:!0}),r);var oe={};j(oe,{default:()=>re});module.exports=D(oe);var n=require("react/jsx-runtime"),v=L(require("classnames")),s=require("react"),b=require("../../context/provider"),S=L(require("../../context/hooks/useCountries")),f=require("../../context/const"),x=require("../../context/hooks/useAddressValidate"),U=require("../../context/hooks/useRedeemProduct"),O=require("../../modal/modalContainer"),q=require("@anker-in/lib"),w=require("./Error"),F=require("./Success"),K=require("./Address"),_=require("./Init");function ee({item:r,copy:e,onError:t,...a}){const{fetchCreditInfo:i,profile:P}=(0,b.useCreditsContext)(),{storeDomain:k,locale:T}=(0,q.useHeadlessContext)(),{pageCommon:B}=(0,b.useCreditsContext)(),{shippingAddress:G,shippingProduct:R}=e.redeemModal.product,[m,c]=(0,s.useState)("init"),[l,H]=(0,s.useState)(),[J,p]=(0,s.useState)({code:0,message:"",imageUrl:""}),[C,u]=(0,s.useState)(!1),{countries:A=[],isLoading:de}=(0,S.default)({shopifyStoreDomain:k}),{isMutating:M,trigger:N}=(0,U.useRedeemProduct)({onSuccess(o){if(!o){c("error"),p({code:0,imageUrl:e.redeemModal.errorImageUrl||"",message:e.redeemModal.commonError||""});return}if(o?.code===0)i(P?.user_id),c("success");else{let d,I;o.code===f.AlpcErrorCode.CodeLpcShopifyCouponRuleRedeemLimit?(d=e.redeemModal.redeemLimitError,u(!0)):o.code===f.AlpcErrorCode.CodeLpcRuleInventoryNotEnough?(d=e.redeemModal.inventoryNotEnough,u(!0),I=e.redeemModal.inventoryNotEnough):o.code===f.AlpcErrorCode.CodeLpcNotEnoughCredits?(d=e.redeemModal.creditsNotEnough,u(!0),i(P?.user_id)):o.code===f.AlpcErrorCode.CodeCrossSiteError&&(d=e.redeemModal.crossSiteError,u(!0)),c("error"),p({code:o.code,imageUrl:I||e.redeemModal.errorImageUrl||"",message:d||e.redeemModal.commonError||""}),t&&t(o.code)}},onError(o){c("error"),p({code:0,imageUrl:e.redeemModal.errorImageUrl||"",message:e.redeemModal.commonError||""})}}),h=(0,s.useMemo)(()=>e?.redeemModal.product.form?.flat().find(d=>d.type==="state")?.key,[e?.redeemModal.product.form]),{validate:E,errors:V}=(0,x.useAddressValidate)({address:l,validatorInfo:B?.validatorInfo,formData:e?.redeemModal.product.form?.flat()||[],errorLabel:{require:e.redeemModal.product.required,email:e.redeemModal.product.invalidEmail}}),z=(0,s.useCallback)(async()=>{const o=[];if(h&&((A.find(Q=>Q.code===l.country)?.provinces||[]).length||o.push(h)),E({force:!0,ignoreKeys:o}))return;let d={...l};d.name&&delete d.name,d.country==="UK"&&(d.country="GB"),N({address:btoa(JSON.stringify(d)),rule_id:Number(r.alpc?.id)})},[r,N,h,E,l,A]);return(0,s.useEffect)(()=>{a.isOpen||(u(!1),p({code:0,message:"",imageUrl:""}))},[a.isOpen,T]),(0,n.jsxs)(O.CreditsModalContainer,{...a,className:(0,v.default)("w-[540px] md:h-auto min-md:max-h-[calc(100vh-40px)]",m!=="init"&&"w-[740px] md:w-full"),scrollClassName:"mb-0 min-l:px-0 md:mb-0 px-0",titleClassName:(0,v.default)("h-[56px]",m==="init"&&"bg-[#F5F5F7]"),title:m==="address"?"Order Confirmation":"",children:[m==="error"&&(0,n.jsx)(w.Error,{errorInfo:J}),m==="success"&&(0,n.jsx)(F.Success,{copy:e,shippingProduct:R,loading:M,address:l,disabled:C,onClose:a.onClose,item:r}),m==="address"&&(0,n.jsx)(K.Address,{copy:e,shippingAddress:G,setAddress:H,validateAddress:E,validateErrors:V,shippingProduct:R,loading:M,address:l,disabled:C,handlePayment:z,item:r}),m==="init"&&(0,n.jsx)(_.Init,{item:r,copy:e,loading:M,disabled:C,setStatus:c})]})}var re=ee;
1
+ "use strict";var Q=Object.create;var g=Object.defineProperty;var W=Object.getOwnPropertyDescriptor;var X=Object.getOwnPropertyNames;var Y=Object.getPrototypeOf,Z=Object.prototype.hasOwnProperty;var $=(r,e)=>{for(var s in e)g(r,s,{get:e[s],enumerable:!0})},S=(r,e,s,u)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of X(e))!Z.call(r,i)&&i!==s&&g(r,i,{get:()=>e[i],enumerable:!(u=W(e,i))||u.enumerable});return r};var x=(r,e,s)=>(s=r!=null?Q(Y(r)):{},S(e||!r||!r.__esModule?g(s,"default",{value:r,enumerable:!0}):s,r)),j=r=>S(g({},"__esModule",{value:!0}),r);var re={};$(re,{default:()=>ee});module.exports=j(re);var a=require("react/jsx-runtime"),b=x(require("classnames")),d=require("react"),U=require("../../context/provider"),y=x(require("../../context/hooks/useCountries")),f=require("../../context/const"),L=require("../../context/hooks/useAddressValidate"),O=require("../../context/hooks/useRedeemProduct"),q=require("../../modal/ModalContainer"),w=require("@anker-in/lib"),F=require("./Error"),K=require("./Success"),_=require("./Address"),k=require("./Init");function D({item:r,copy:e,onError:s,...u}){const{fetchCreditInfo:i,profile:M,pageCommon:T}=(0,U.useCreditsContext)(),{storeDomain:B}=(0,w.useHeadlessContext)(),{shippingAddress:G,shippingProduct:P}=e.product,[n,m]=(0,d.useState)("init"),[l,R]=(0,d.useState)(),[H,p]=(0,d.useState)({code:0,message:"",imageUrl:""}),[C,c]=(0,d.useState)(!1),{countries:A=[],isLoading:oe}=(0,y.default)({shopifyStoreDomain:B}),{isMutating:h,trigger:N}=(0,O.useRedeemProduct)({onSuccess(o){if(!o){m("error"),p({code:0,imageUrl:e.errorImageUrl||"",message:e.commonError||""});return}if(o?.code===0)i(M?.user_id),m("success");else{let t,v;o.code===f.AlpcErrorCode.CodeLpcShopifyCouponRuleRedeemLimit?(t=e.redeemLimitError,c(!0)):o.code===f.AlpcErrorCode.CodeLpcRuleInventoryNotEnough?(t=e.inventoryNotEnough,c(!0),v=e.inventoryNotEnough):o.code===f.AlpcErrorCode.CodeLpcNotEnoughCredits?(t=e.creditsNotEnough,c(!0),i(M?.user_id)):o.code===f.AlpcErrorCode.CodeCrossSiteError&&(t=e.crossSiteError,c(!0)),m("error"),p({code:o.code,imageUrl:v||e.errorImageUrl||"",message:t||e.commonError||""}),s&&s(o.code)}},onError(o){m("error"),p({code:0,imageUrl:e.errorImageUrl||"",message:e.commonError||""})}}),E=(0,d.useMemo)(()=>e?.product.form?.flat().find(t=>t.type==="state")?.key,[e?.product.form]),{validate:I,errors:J}=(0,L.useAddressValidate)({address:l,validatorInfo:T?.validatorInfo,formData:e?.product.form?.flat()||[],errorLabel:{require:e.product.required,email:e.product.invalidEmail}}),V=(0,d.useCallback)(async()=>{const o=[];if(E&&((A.find(z=>z.code===l.country)?.provinces||[]).length||o.push(E)),I({force:!0,ignoreKeys:o}))return;let t={...l};t.name&&delete t.name,t.country==="UK"&&(t.country="GB"),N({address:btoa(JSON.stringify(t)),rule_id:Number(r.alpc?.id)})},[r,N,E,I,l,A]);return(0,d.useEffect)(()=>()=>{c(!1),p({code:0,message:"",imageUrl:""}),m("init"),R(void 0)},[]),(0,a.jsxs)(q.CreditsModalContainer,{...u,isOpen:!!r,className:(0,b.default)("w-[540px] md:h-auto min-md:max-h-[calc(100vh-40px)]",n!=="init"&&"w-[740px] md:w-full"),scrollClassName:"mb-0 min-l:px-0 md:mb-0 px-0",titleClassName:(0,b.default)("h-[56px]",n==="init"&&"bg-[#F5F5F7]"),title:n==="address"?"Order Confirmation":"",children:[n==="error"&&(0,a.jsx)(F.Error,{errorInfo:H}),n==="success"&&(0,a.jsx)(K.Success,{copy:e,shippingProduct:P,loading:h,address:l,disabled:C,onClose:u.onClose,item:r}),n==="address"&&(0,a.jsx)(_.Address,{copy:e,shippingAddress:G,setAddress:R,validateAddress:I,validateErrors:J,shippingProduct:P,loading:h,address:l,disabled:C,handlePayment:V,item:r}),n==="init"&&(0,a.jsx)(k.Init,{item:r,copy:e,loading:h,disabled:C,setStatus:m})]})}var ee=D;
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/components/credits/creditsRedeemList/RedeemProductModal/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 { useHeadlessContext } from '@anker-in/lib'\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 } = useHeadlessContext()\n\n const { pageCommon } = useCreditsContext()\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: pageCommon?.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 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": "0jBAAA,IAAAA,GAAA,GAAAC,EAAAD,GAAA,aAAAE,KAAA,eAAAC,EAAAH,IAsJI,IAAAI,EAAA,6BAtJJC,EAAuB,yBACvBC,EAA0D,iBAC1DC,EAAkC,kCAClCC,EAAyB,+CACzBC,EAA8B,+BAC9BC,EAAmC,kDACnCC,EAAiC,gDAEjCC,EAAsC,sCAEtCC,EAAmC,yBAEnCC,EAAsB,mBACtBC,EAAwB,qBACxBC,EAAwB,qBACxBC,EAAqB,kBAQrB,SAASC,GAAmB,CA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AC/B,CAAC,CACH,EAAG,CAACA,EAAMuB,EAASK,EAAeC,EAAiBhB,EAASM,CAAS,CAAC,EAEtE,sBAAU,IAAM,CACThB,EAAM,SACTe,EAAY,EAAK,EACjBF,EAAa,CAAE,KAAM,EAAG,QAAS,GAAI,SAAU,EAAG,CAAC,EAEvD,EAAG,CAACb,EAAM,OAAQI,CAAM,CAAC,KAGvB,QAAC,yBACE,GAAGJ,EACJ,aAAW,EAAA+B,SACT,sDACAvB,IAAW,QAAU,qBACvB,EACA,gBAAgB,+BAChB,kBAAgB,EAAAuB,SAAW,WAAYvB,IAAW,QAAU,cAAc,EAC1E,MAAOA,IAAW,UAAY,qBAAuB,GAEpD,UAAAA,IAAW,YAAW,OAAC,SAAM,UAAWI,EAAW,EACnDJ,IAAW,cACV,OAAC,WACC,KAAMV,EACN,gBAAiBS,EACjB,QAASY,EACT,QAAST,EACT,SAAUI,EACV,QAASd,EAAM,QACf,KAAMH,EACR,EAEDW,IAAW,cACV,OAAC,WACC,KAAMV,EACN,gBAAiBQ,EACjB,WAAYK,EACZ,gBAAiBe,EACjB,eAAgBC,EAChB,gBAAiBpB,EACjB,QAASY,EACT,QAAST,EACT,SAAUI,EACV,cAAec,EACf,KAAM/B,EACR,EAEDW,IAAW,WACV,OAAC,QAAK,KAAMX,EAAM,KAAMC,EAAM,QAASqB,EAAS,SAAUL,EAAU,UAAWL,EAAW,GAE9F,CAEJ,CAEA,IAAO7B,GAAQgB",
6
- "names": ["RedeemProductModal_exports", "__export", "RedeemProductModal_default", "__toCommonJS", "import_jsx_runtime", "import_classnames", "import_react", "import_provider", "import_useCountries", "import_const", "import_useAddressValidate", "import_useRedeemProduct", "import_modalContainer", "import_lib", "import_Error", "import_Success", "import_Address", "import_Init", "RedeemProductModal", "item", "copy", "onError", "props", "fetchCreditInfo", "profile", "storeDomain", "locale", "pageCommon", "shippingAddress", "shippingProduct", "status", "setStatus", "address", "setAddress", "errorInfo", "setErrorInfo", "disabled", "setDisabled", "countries", "countriesLoading", "useCountries", "loading", "trigger", "responseData", "errorMsg", "errorImage", "error", "stateInputKey", "validateAddress", "validateErrors", "handlePayment", "ignoreKeys", "requestAddress", "classNames"]
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, RedeemModalCommon } from '../../type'\nimport { useHeadlessContext } from '@anker-in/lib'\nimport { Error } from './Error'\nimport { Success } from './Success'\nimport { Address } from './Address'\nimport { Init } from './Init'\n\ntype RedeemProductModalProps = Omit<ModalContainerProps, 'isOpen'> & {\n item: RedeemableItemType\n copy: RedeemModalCommon\n onError: (code: AlpcErrorCode) => void\n}\n\nfunction RedeemProductModal({ item, copy, onError, ...props }: RedeemProductModalProps) {\n const { fetchCreditInfo, profile, pageCommon } = useCreditsContext()\n const { storeDomain } = useHeadlessContext()\n\n const { shippingAddress, shippingProduct } = copy.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.errorImageUrl || '',\n message: copy.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.redeemLimitError\n setDisabled(true)\n } else if (responseData.code === AlpcErrorCode.CodeLpcRuleInventoryNotEnough) {\n errorMsg = copy.inventoryNotEnough\n setDisabled(true)\n errorImage = copy.inventoryNotEnough\n } else if (responseData.code === AlpcErrorCode.CodeLpcNotEnoughCredits) {\n errorMsg = copy.creditsNotEnough\n setDisabled(true)\n fetchCreditInfo(profile?.user_id)\n } else if (responseData.code === AlpcErrorCode.CodeCrossSiteError) {\n errorMsg = copy.crossSiteError\n setDisabled(true)\n }\n\n setStatus('error')\n setErrorInfo({\n code: responseData.code,\n imageUrl: errorImage || copy.errorImageUrl || '',\n message: errorMsg || copy.commonError || '',\n })\n onError && onError(responseData.code)\n }\n },\n onError(error) {\n setStatus('error')\n setErrorInfo({\n code: 0,\n imageUrl: copy.errorImageUrl || '',\n message: copy.commonError || '',\n })\n },\n })\n\n const stateInputKey = useMemo(() => {\n const stateInput = copy?.product.form?.flat().find(item => item.type === 'state')\n return stateInput?.key\n }, [copy?.product.form])\n\n const { validate: validateAddress, errors: validateErrors } = useAddressValidate({\n address: address,\n validatorInfo: pageCommon?.validatorInfo,\n formData: copy?.product.form?.flat() || [],\n errorLabel: {\n require: copy.product.required,\n email: copy.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 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 return () => {\n setDisabled(false)\n setErrorInfo({ code: 0, message: '', imageUrl: '' })\n setStatus('init')\n setAddress(undefined)\n }\n }, [])\n\n return (\n <CreditsModalContainer\n {...props}\n isOpen={!!item}\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": "0jBAAA,IAAAA,GAAA,GAAAC,EAAAD,GAAA,aAAAE,KAAA,eAAAC,EAAAH,IAsJI,IAAAI,EAAA,6BAtJJC,EAAuB,yBACvBC,EAA0D,iBAC1DC,EAAkC,kCAClCC,EAAyB,+CACzBC,EAA8B,+BAC9BC,EAAmC,kDACnCC,EAAiC,gDAEjCC,EAAsC,sCAEtCC,EAAmC,yBACnCC,EAAsB,mBACtBC,EAAwB,qBACxBC,EAAwB,qBACxBC,EAAqB,kBAQrB,SAASC,EAAmB,CAAE,KAAAC,EAAM,KAAAC,EAAM,QAAAC,EAAS,GAAGC,CAAM,EAA4B,CACtF,KAAM,CAAE,gBAAA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AAC,CAAC,KAGH,QAAC,yBACE,GAAGV,EACJ,OAAQ,CAAC,CAACH,EACV,aAAW,EAAAiC,SACT,sDACAvB,IAAW,QAAU,qBACvB,EACA,gBAAgB,+BAChB,kBAAgB,EAAAuB,SAAW,WAAYvB,IAAW,QAAU,cAAc,EAC1E,MAAOA,IAAW,UAAY,qBAAuB,GAEpD,UAAAA,IAAW,YAAW,OAAC,SAAM,UAAWI,EAAW,EACnDJ,IAAW,cACV,OAAC,WACC,KAAMT,EACN,gBAAiBQ,EACjB,QAASY,EACT,QAAST,EACT,SAAUI,EACV,QAASb,EAAM,QACf,KAAMH,EACR,EAEDU,IAAW,cACV,OAAC,WACC,KAAMT,EACN,gBAAiBO,EACjB,WAAYK,EACZ,gBAAiBe,EACjB,eAAgBC,EAChB,gBAAiBpB,EACjB,QAASY,EACT,QAAST,EACT,SAAUI,EACV,cAAec,EACf,KAAM9B,EACR,EAEDU,IAAW,WACV,OAAC,QAAK,KAAMV,EAAM,KAAMC,EAAM,QAASoB,EAAS,SAAUL,EAAU,UAAWL,EAAW,GAE9F,CAEJ,CAEA,IAAO5B,GAAQgB",
6
+ "names": ["RedeemProductModal_exports", "__export", "RedeemProductModal_default", "__toCommonJS", "import_jsx_runtime", "import_classnames", "import_react", "import_provider", "import_useCountries", "import_const", "import_useAddressValidate", "import_useRedeemProduct", "import_ModalContainer", "import_lib", "import_Error", "import_Success", "import_Address", "import_Init", "RedeemProductModal", "item", "copy", "onError", "props", "fetchCreditInfo", "profile", "pageCommon", "storeDomain", "shippingAddress", "shippingProduct", "status", "setStatus", "address", "setAddress", "errorInfo", "setErrorInfo", "disabled", "setDisabled", "countries", "countriesLoading", "useCountries", "loading", "trigger", "responseData", "errorMsg", "errorImage", "error", "stateInputKey", "validateAddress", "validateErrors", "handlePayment", "ignoreKeys", "requestAddress", "classNames"]
7
7
  }
@@ -0,0 +1,10 @@
1
+ import type { RedeemableItem as RedeemableItemType, RedeemModalCommon } from '../../type';
2
+ type VirtualProductInitProps = {
3
+ item: RedeemableItemType;
4
+ copy: RedeemModalCommon;
5
+ loading: boolean;
6
+ disabled: boolean;
7
+ onConfirm: () => void;
8
+ };
9
+ export declare const VirtualProductInit: ({ item, copy, loading, disabled, onConfirm }: VirtualProductInitProps) => import("react/jsx-runtime").JSX.Element;
10
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";var g=Object.create;var x=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var N=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty;var P=(e,l)=>{for(var a in l)x(e,a,{get:l[a],enumerable:!0})},n=(e,l,a,o)=>{if(l&&typeof l=="object"||typeof l=="function")for(let i of h(l))!w.call(e,i)&&i!==a&&x(e,i,{get:()=>l[i],enumerable:!(o=b(l,i))||o.enumerable});return e};var y=(e,l,a)=>(a=e!=null?g(N(e)):{},n(l||!e||!e.__esModule?x(a,"default",{value:e,enumerable:!0}):a,e)),C=e=>n(x({},"__esModule",{value:!0}),e);var T={};P(T,{VirtualProductInit:()=>F});module.exports=C(T);var t=require("react/jsx-runtime"),m=require("@anker-in/headless-ui"),r=y(require("classnames")),c=require("react"),u=require("../../context/utils"),f=require("../RedeemProductModal/NonProductValue"),v=require("../../context/provider");const F=({item:e,copy:l,loading:a,disabled:o,onConfirm:i})=>{const{pageCommon:p}=(0,v.useCreditsContext)();return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:(0,r.default)("max-h-[500px] overflow-y-auto bg-[#F5F5F7] px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]"),children:[(0,t.jsxs)("div",{className:"relative mx-auto h-[164px] w-[324px]",children:[p?.imageMapping?.[e.config?.type]?.url&&(0,t.jsx)(m.Picture,{source:p.imageMapping[e.config.type].url,className:"h-full [&_img]:h-full"}),(0,t.jsx)("div",{className:"absolute bottom-[8px] left-[16px] font-extrabold text-white",children:e.config.value?(0,t.jsx)(f.NoneProductValue,{item:e}):(0,t.jsx)(m.Text,{size:3,html:e.alpc?.title})})]}),(0,t.jsxs)(m.Text,{as:"p",className:(0,r.default)("mt-[30px] text-center text-[24px] font-bold leading-[1.2] md:mt-[18px] md:text-[20px] md:leading-[1.2]"),children:[(0,u.numberFormat)(e.alpc?.consumeCredits)," ",p?.pointUnit]}),l?.virtualProduct?.steps&&l.virtualProduct.steps.length>0&&(0,t.jsxs)("div",{className:"mt-[16px] w-full text-[14px] font-semibold text-[#777] md:mt-[12px]",children:[(0,t.jsx)("div",{className:"text-[16px] font-bold leading-[1.4]",children:l.virtualProduct.stepTitle}),(0,t.jsx)("div",{className:"mt-[4px] flex items-center justify-center",children:l.virtualProduct.steps.map((d,s)=>(0,t.jsxs)(c.Fragment,{children:[(0,t.jsxs)("div",{className:"flex w-[76px] flex-col items-center text-center md:h-[94px] min-l:w-[130px]",children:[(0,t.jsx)(m.Picture,{source:d.imageUrl,className:"mb-[4px] h-[58px] w-[58px]"}),(0,t.jsx)("div",{className:"min-h-[34px] text-[14px] font-bold text-[#777] md:min-h-[28px] md:text-[12px]",children:d.title})]}),s!==l.virtualProduct.steps.length-1&&(0,t.jsx)(m.Picture,{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]"})]},s))})]}),e.config?.rules?.length>0&&(0,t.jsxs)("div",{className:"mt-[18px] w-full text-[16px] font-bold leading-[1.4] text-[#6D6D6F] md:mt-[12px] md:text-[14px]",children:[(0,t.jsxs)("div",{className:"mb-[4px]",children:[p?.ruleLabel,":"]}),(0,t.jsx)("ul",{className:"ml-4 grid grid-flow-row gap-[4px]",children:e.config?.rules?.map((d,s)=>(0,t.jsx)("li",{className:"list-disc",children:(0,t.jsx)(m.Text,{html:d})},s))})]})]}),(0,t.jsxs)("div",{className:"bg-white px-[48px] pt-[24px] text-center md:px-[16px]",children:[(0,t.jsx)(m.Text,{className:"block text-[24px] font-bold leading-[1.2] md:text-[20px] md:leading-[1.2]",html:l.confirmTitle}),(0,t.jsx)(m.Button,{loading:a,variant:"primary",size:"lg",className:"mt-[16px] w-full",onClick:i,disabled:o,children:l.confirmButton})]})]})};
2
+ //# sourceMappingURL=VirtualProductInit.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductInit.tsx"],
4
+ "sourcesContent": ["import { Button, Picture, Text } from '@anker-in/headless-ui'\nimport classNames from 'classnames'\nimport { Fragment } from 'react'\nimport { numberFormat } from '../../context/utils'\nimport type { RedeemableItem as RedeemableItemType, RedeemModalCommon } from '../../type'\nimport { NoneProductValue } from '../RedeemProductModal/NonProductValue'\nimport { useCreditsContext } from '../../context/provider'\n\ntype VirtualProductInitProps = {\n item: RedeemableItemType\n copy: RedeemModalCommon\n loading: boolean\n disabled: boolean\n onConfirm: () => void\n}\n\nexport const VirtualProductInit = ({ item, copy, loading, disabled, onConfirm }: VirtualProductInitProps) => {\n const { pageCommon } = useCreditsContext()\n\n return (\n <>\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 <div className=\"relative mx-auto h-[164px] w-[324px]\">\n {pageCommon?.imageMapping?.[item.config?.type]?.url && (\n <Picture source={pageCommon.imageMapping[item.config.type].url} className=\"h-full [&_img]:h-full\" />\n )}\n <div className=\"absolute bottom-[8px] left-[16px] font-extrabold text-white\">\n {item.config.value ? (\n <NoneProductValue item={item} />\n ) : (\n <Text size={3} html={item.alpc?.title} />\n )}\n </div>\n </div>\n <Text\n as=\"p\"\n className={classNames(\n 'mt-[30px] text-center text-[24px] font-bold leading-[1.2] md:mt-[18px] md:text-[20px] md:leading-[1.2]'\n )}\n >\n {numberFormat(item.alpc?.consumeCredits)} {pageCommon?.pointUnit}\n </Text>\n {copy?.virtualProduct?.steps && copy.virtualProduct.steps.length > 0 && (\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.virtualProduct.stepTitle}</div>\n <div className=\"mt-[4px] flex items-center justify-center\">\n {copy.virtualProduct.steps.map((step, 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={step.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 {step.title}\n </div>\n </div>\n {index !== copy.virtualProduct.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>\n )}\n {item.config?.rules?.length > 0 && (\n <div className=\"mt-[18px] w-full text-[16px] font-bold leading-[1.4] text-[#6D6D6F] md:mt-[12px] md:text-[14px]\">\n <div className=\"mb-[4px]\">{pageCommon?.ruleLabel}:</div>\n <ul className=\"ml-4 grid grid-flow-row gap-[4px]\">\n {item.config?.rules?.map((text, index) => (\n <li className=\"list-disc\" key={index}>\n <Text html={text} />\n </li>\n ))}\n </ul>\n </div>\n )}\n </div>\n <div className=\"bg-white px-[48px] pt-[24px] text-center md:px-[16px]\">\n <Text\n className=\"block text-[24px] font-bold leading-[1.2] md:text-[20px] md:leading-[1.2]\"\n html={copy.confirmTitle}\n ></Text>\n <Button\n loading={loading}\n variant=\"primary\"\n size=\"lg\"\n className=\"mt-[16px] w-full\"\n onClick={onConfirm}\n disabled={disabled}\n >\n {copy.confirmButton}\n </Button>\n </div>\n </>\n )\n}\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,wBAAAE,IAAA,eAAAC,EAAAH,G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AAO,OAAS,MAC5B,QAAC,OAAI,UAAU,kGACb,qBAAC,OAAI,UAAU,WAAY,UAAAK,GAAY,UAAU,KAAC,KAClD,OAAC,MAAG,UAAU,oCACX,SAAAL,EAAK,QAAQ,OAAO,IAAI,CAACS,EAAMD,OAC9B,OAAC,MAAG,UAAU,YACZ,mBAAC,QAAK,KAAMC,EAAM,GADWD,CAE/B,CACD,EACH,GACF,GAEJ,KACA,QAAC,OAAI,UAAU,wDACb,oBAAC,QACC,UAAU,4EACV,KAAMP,EAAK,aACZ,KACD,OAAC,UACC,QAASC,EACT,QAAQ,UACR,KAAK,KACL,UAAU,mBACV,QAASE,EACT,SAAUD,EAET,SAAAF,EAAK,cACR,GACF,GACF,CAEJ",
6
+ "names": ["VirtualProductInit_exports", "__export", "VirtualProductInit", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_classnames", "import_react", "import_utils", "import_NonProductValue", "import_provider", "item", "copy", "loading", "disabled", "onConfirm", "pageCommon", "classNames", "step", "index", "text"]
7
+ }
@@ -0,0 +1,9 @@
1
+ import type { RedeemModalCommon, RedeemableItem as RedeemableItemType } from '../../type';
2
+ type VirtualProductSuccessProps = {
3
+ item: RedeemableItemType;
4
+ copy: RedeemModalCommon;
5
+ disabled: boolean;
6
+ onClose: () => void;
7
+ };
8
+ export declare const VirtualProductSuccess: ({ item, copy, disabled, onClose }: VirtualProductSuccessProps) => import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";var n=Object.create;var i=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var b=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty;var h=(e,t)=>{for(var l in t)i(e,l,{get:t[l],enumerable:!0})},c=(e,t,l,m)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of v(t))!g.call(e,s)&&s!==l&&i(e,s,{get:()=>t[s],enumerable:!(m=f(t,s))||m.enumerable});return e};var N=(e,t,l)=>(l=e!=null?n(b(e)):{},c(t||!e||!e.__esModule?i(l,"default",{value:e,enumerable:!0}):l,e)),P=e=>c(i({},"__esModule",{value:!0}),e);var w={};h(w,{VirtualProductSuccess:()=>C});module.exports=P(w);var o=require("react/jsx-runtime"),a=require("@anker-in/headless-ui"),r=N(require("classnames")),d=require("@anker-in/lib"),u=require("../RedeemProductModal/NonProductValue"),x=require("../../context/provider");const C=({item:e,copy:t,disabled:l,onClose:m})=>{const{locale:s}=(0,d.useHeadlessContext)(),{pageCommon:p}=(0,x.useCreditsContext)();return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{className:(0,r.default)("max-h-[500px] overflow-y-auto bg-[#F5F5F7] px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]"),children:(0,o.jsxs)("div",{className:"relative mx-auto h-[164px] w-[324px]",children:[p?.imageMapping?.[e.config?.type]?.url&&(0,o.jsx)(a.Picture,{source:p.imageMapping[e.config.type].url,className:"h-full [&_img]:h-full"}),(0,o.jsx)("div",{className:"absolute bottom-[8px] left-[16px] font-extrabold text-white",children:e.config.value?(0,o.jsx)(u.NoneProductValue,{item:e}):(0,o.jsx)(a.Text,{size:3,html:e.alpc?.title})})]})}),(0,o.jsxs)("div",{className:"bg-white px-[48px] pt-[24px] text-center md:px-[16px]",children:[(0,o.jsxs)("div",{className:"flex flex-col",children:[(0,o.jsx)(a.Text,{className:"mb-[4px] text-[24px] font-bold leading-[1.2] md:text-[20px]",html:t.virtualProduct.successTitle}),(0,o.jsx)(a.Text,{className:"text-[16px] font-bold leading-[1.4] text-[#6D6D6F] md:text-[14px]",html:t.virtualProduct.successDesc})]}),(0,o.jsx)(a.Button,{variant:"primary",size:"lg",className:"mt-[16px] w-full",onClick:()=>{window.location.href=t.virtualProduct.successButtonUrl||`/${s}`,m()},disabled:l,children:t.virtualProduct.successButton})]})]})};
2
+ //# sourceMappingURL=VirtualProductSuccess.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductSuccess.tsx"],
4
+ "sourcesContent": ["import { Button, Picture, Text } from '@anker-in/headless-ui'\nimport classNames from 'classnames'\nimport { useHeadlessContext } from '@anker-in/lib'\nimport type { RedeemModalCommon, RedeemableItem as RedeemableItemType } from '../../type'\nimport { NoneProductValue } from '../RedeemProductModal/NonProductValue'\nimport { useCreditsContext } from '../../context/provider'\n\ntype VirtualProductSuccessProps = {\n item: RedeemableItemType\n copy: RedeemModalCommon\n disabled: boolean\n onClose: () => void\n}\n\nexport const VirtualProductSuccess = ({ item, copy, disabled, onClose }: VirtualProductSuccessProps) => {\n const { locale } = useHeadlessContext()\n const { pageCommon } = useCreditsContext()\n\n return (\n <>\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 <div className=\"relative mx-auto h-[164px] w-[324px]\">\n {pageCommon?.imageMapping?.[item.config?.type]?.url && (\n <Picture source={pageCommon.imageMapping[item.config.type].url} className=\"h-full [&_img]:h-full\" />\n )}\n <div className=\"absolute bottom-[8px] left-[16px] font-extrabold text-white\">\n {item.config.value ? (\n <NoneProductValue item={item} />\n ) : (\n <Text size={3} html={item.alpc?.title} />\n )}\n </div>\n </div>\n </div>\n <div className=\"bg-white px-[48px] pt-[24px] text-center md:px-[16px]\">\n <div className=\"flex flex-col\">\n <Text\n className=\"mb-[4px] text-[24px] font-bold leading-[1.2] md:text-[20px]\"\n html={copy.virtualProduct.successTitle}\n ></Text>\n <Text\n className=\"text-[16px] font-bold leading-[1.4] text-[#6D6D6F] md:text-[14px]\"\n html={copy.virtualProduct.successDesc}\n ></Text>\n </div>\n <Button\n variant=\"primary\"\n size=\"lg\"\n className=\"mt-[16px] w-full\"\n onClick={() => {\n window.location.href = copy.virtualProduct.successButtonUrl || `/${locale}`\n onClose()\n }}\n disabled={disabled}\n >\n {copy.virtualProduct.successButton}\n </Button>\n </div>\n </>\n )\n}\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,2BAAAE,IAAA,eAAAC,EAAAH,GAmBI,IAAAI,EAAA,6BAnBJC,EAAsC,iCACtCC,EAAuB,yBACvBC,EAAmC,yBAEnCC,EAAiC,iDACjCC,EAAkC,kCAS3B,MAAMP,EAAwB,CAAC,CAAE,KAAAQ,EAAM,KAAAC,EAAM,SAAAC,EAAU,QAAAC,CAAQ,IAAkC,CACtG,KAAM,CAAE,OAAAC,CAAO,KAAI,sBAAmB,EAChC,CAAE,WAAAC,CAAW,KAAI,qBAAkB,EAEzC,SACE,oBACE,oBAAC,OACC,aAAW,EAAAC,SACT,8FACF,EAEA,oBAAC,OAAI,UAAU,uCACZ,UAAAD,GAAY,eAAeL,EAAK,QAAQ,IAAI,GAAG,QAC9C,OAAC,WAAQ,OAAQK,EAAW,aAAaL,EAAK,OAAO,IAAI,EAAE,IAAK,UAAU,wBAAwB,KAEpG,OAAC,OAAI,UAAU,8DACZ,SAAAA,EAAK,OAAO,SACX,OAAC,oBAAiB,KAAMA,EAAM,KAE9B,OAAC,QAAK,KAAM,EAAG,KAAMA,EAAK,MAAM,MAAO,EAE3C,GACF,EACF,KACA,QAAC,OAAI,UAAU,wDACb,qBAAC,OAAI,UAAU,gBACb,oBAAC,QACC,UAAU,8DACV,KAAMC,EAAK,eAAe,aAC3B,KACD,OAAC,QACC,UAAU,oEACV,KAAMA,EAAK,eAAe,YAC3B,GACH,KACA,OAAC,UACC,QAAQ,UACR,KAAK,KACL,UAAU,mBACV,QAAS,IAAM,CACb,OAAO,SAAS,KAAOA,EAAK,eAAe,kBAAoB,IAAIG,CAAM,GACzED,EAAQ,CACV,EACA,SAAUD,EAET,SAAAD,EAAK,eAAe,cACvB,GACF,GACF,CAEJ",
6
+ "names": ["VirtualProductSuccess_exports", "__export", "VirtualProductSuccess", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_classnames", "import_lib", "import_NonProductValue", "import_provider", "item", "copy", "disabled", "onClose", "locale", "pageCommon", "classNames"]
7
+ }
@@ -0,0 +1,8 @@
1
+ import type { ModalContainerProps } from '../modal/ModalContainer';
2
+ import type { RedeemableItem as RedeemableItemType, RedeemModalCommon } from '../type';
3
+ declare function RedeemVirtualProductModal({ item, copy, onError, ...props }: Omit<ModalContainerProps, 'isOpen'> & {
4
+ item: RedeemableItemType;
5
+ copy: RedeemModalCommon;
6
+ onError: (code: number) => void;
7
+ }): import("react/jsx-runtime").JSX.Element;
8
+ export default RedeemVirtualProductModal;
@@ -0,0 +1,2 @@
1
+ "use strict";var g=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var A=Object.prototype.hasOwnProperty;var V=(o,e)=>{for(var s in e)g(o,s,{get:e[s],enumerable:!0})},k=(o,e,s,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of w(e))!A.call(o,n)&&n!==s&&g(o,n,{get:()=>e[n],enumerable:!(l=T(e,n))||l.enumerable});return o};var z=o=>k(g({},"__esModule",{value:!0}),o);var U={};V(U,{default:()=>J});module.exports=z(U);var a=require("react/jsx-runtime"),M=require("@anker-in/headless-ui"),d=require("react"),y=require("../context/provider"),I=require("../context/hooks/useRedeemGoGift"),S=require("../context/hooks/useRedeemProduct"),i=require("../context/const"),P=require("../modal/ModalContainer"),v=require("./RedeemVirtualProductModal/VirtualProductInit"),L=require("./RedeemVirtualProductModal/VirtualProductSuccess");function H({item:o,copy:e,onError:s,...l}){const[n,c]=(0,d.useState)(),[x,m]=(0,d.useState)(),[b,u]=(0,d.useState)(!1),{profile:t,fetchCreditInfo:p}=(0,y.useCreditsContext)(),C=o.config?.type===i.ConsumeType.GoGift,E=o.config?.type===i.ConsumeType.GiftCard,{isMutating:_,trigger:N}=(0,I.useRedeemGoGift)({onSuccess(r){if(!r){m(e?.commonError);return}r?.data?.id?(c(r.data.id),p(t?.user_id)):R(r.code)},onError(r){m(r.message||e?.commonError)}}),{isMutating:F,trigger:h}=(0,S.useRedeemProduct)({onSuccess(r){if(!r){m(e?.commonError);return}r?.code===0?(c("success"),p(t?.user_id)):R(r.code)},onError(){m(e?.commonError)}}),G=C?_:F,R=r=>{let f;r===i.AlpcErrorCode.CodeLpcShopifyCouponRuleRedeemLimit?(f=e?.redeemLimitError,u(!0)):r===i.AlpcErrorCode.CodeLpcRuleInventoryNotEnough?(f=e?.inventoryNotEnough,u(!0)):r===i.AlpcErrorCode.CodeLpcNotEnoughCredits?(f=e?.creditsNotEnough,u(!0),p(t?.user_id)):r===i.AlpcErrorCode.CodeCrossSiteError&&(f=e?.crossSiteError,u(!0)),m(f||e?.commonError||""),s&&s(r)},O=(0,d.useCallback)(async()=>{if(m(""),C)N({user_id:t?.user_id,rule_id:Number(o.alpc?.id)});else if(E){const r={email:t?.email||"",firstName:t?.firstName||"",lastName:t?.lastName||"",address1:"Default Address",city:"Default City",province:"Default Province",country:"US",zip:"00000"};h({address:btoa(JSON.stringify(r)),rule_id:Number(o.alpc?.id)})}},[o,t,N,h,C,E]);return(0,d.useEffect)(()=>()=>{u(!1),m(""),c(void 0)},[]),(0,a.jsxs)(P.CreditsModalContainer,{...l,isOpen:!!o,className:"w-[540px] md:h-auto",scrollClassName:"mb-[40px] min-l:px-0 md:mb-[24px] px-0",titleClassName:"h-[56px] bg-[#F5F5F7]",children:[n&&!G?(0,a.jsx)(L.VirtualProductSuccess,{item:o,copy:e,disabled:b,onClose:l.onClose}):(0,a.jsx)(v.VirtualProductInit,{item:o,copy:e,loading:G,disabled:b,onConfirm:O}),x&&(0,a.jsx)("div",{className:"mx-auto max-w-full bg-white px-[48px] py-[12px] text-center text-[#FF0000] md:px-[16px]",children:(0,a.jsx)(M.Text,{className:"text-[14px] font-semibold text-[#1F2021]",html:x})})]})}var J=H;
2
+ //# sourceMappingURL=RedeemVirtualProductModal.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/components/credits/creditsRedeemList/RedeemVirtualProductModal.tsx"],
4
+ "sourcesContent": ["import { Text } from '@anker-in/headless-ui'\nimport { useCallback, useEffect, useState } from 'react'\nimport type { ModalContainerProps } from '../modal/ModalContainer'\nimport { useCreditsContext } from '../context/provider'\nimport { useRedeemGoGift } from '../context/hooks/useRedeemGoGift'\nimport { useRedeemProduct } from '../context/hooks/useRedeemProduct'\nimport { AlpcErrorCode, ConsumeType } from '../context/const'\nimport { CreditsModalContainer } from '../modal/ModalContainer'\nimport type { RedeemableItem as RedeemableItemType, RedeemModalCommon } from '../type'\nimport { useHeadlessContext } from '@anker-in/lib'\nimport { VirtualProductInit } from './RedeemVirtualProductModal/VirtualProductInit'\nimport { VirtualProductSuccess } from './RedeemVirtualProductModal/VirtualProductSuccess'\n\nfunction RedeemVirtualProductModal({\n item,\n copy,\n onError,\n ...props\n}: Omit<ModalContainerProps, 'isOpen'> & {\n item: RedeemableItemType\n copy: RedeemModalCommon\n onError: (code: number) => void\n}) {\n const [giftCardId, setGiftCardId] = useState<string>()\n const [errorInfo, setErrorInfo] = useState<string>()\n\n const [disabled, setDisabled] = useState(false)\n\n const { profile, fetchCreditInfo } = useCreditsContext()\n\n // \u5224\u65AD\u662F GoGift \u8FD8\u662F GiftCard \u7C7B\u578B\n const isGoGift = item.config?.type === ConsumeType.GoGift\n const isGiftCard = item.config?.type === ConsumeType.GiftCard\n\n // GoGift \u4F7F\u7528\u4E13\u7528\u63A5\u53E3\n const { isMutating: goGiftLoading, trigger: triggerGoGift } = useRedeemGoGift({\n onSuccess(responseData) {\n if (!responseData) {\n setErrorInfo(copy?.commonError)\n return\n }\n\n if (responseData?.data?.id) {\n setGiftCardId(responseData.data.id)\n fetchCreditInfo(profile?.user_id)\n } else {\n handleRedeemError(responseData.code)\n }\n },\n onError(error) {\n setErrorInfo(error.message || copy?.commonError)\n },\n })\n\n // GiftCard \u4F7F\u7528 Product \u63A5\u53E3\uFF0C\u4F46\u4E0D\u9700\u8981\u5730\u5740\n const { isMutating: productLoading, trigger: triggerProduct } = useRedeemProduct({\n onSuccess(responseData) {\n if (!responseData) {\n setErrorInfo(copy?.commonError)\n return\n }\n\n if (responseData?.code === 0) {\n setGiftCardId('success')\n fetchCreditInfo(profile?.user_id)\n } else {\n handleRedeemError(responseData.code)\n }\n },\n onError() {\n setErrorInfo(copy?.commonError)\n },\n })\n\n const loading = isGoGift ? goGiftLoading : productLoading\n\n const handleRedeemError = (code: number) => {\n let errorMsg: string | undefined\n if (code === AlpcErrorCode.CodeLpcShopifyCouponRuleRedeemLimit) {\n errorMsg = copy?.redeemLimitError\n setDisabled(true)\n } else if (code === AlpcErrorCode.CodeLpcRuleInventoryNotEnough) {\n errorMsg = copy?.inventoryNotEnough\n setDisabled(true)\n } else if (code === AlpcErrorCode.CodeLpcNotEnoughCredits) {\n errorMsg = copy?.creditsNotEnough\n setDisabled(true)\n fetchCreditInfo(profile?.user_id)\n } else if (code === AlpcErrorCode.CodeCrossSiteError) {\n errorMsg = copy?.crossSiteError\n setDisabled(true)\n }\n\n setErrorInfo(errorMsg || copy?.commonError || '')\n onError && onError(code)\n }\n\n const handleConfirm = useCallback(async () => {\n setErrorInfo('')\n\n if (isGoGift) {\n // GoGift \u7C7B\u578B\u4F7F\u7528\u4E13\u7528\u63A5\u53E3\n triggerGoGift({\n user_id: profile?.user_id,\n rule_id: Number(item.alpc?.id),\n })\n } else if (isGiftCard) {\n // GiftCard \u7C7B\u578B\u4F7F\u7528 Product \u63A5\u53E3\uFF0C\u4F20\u9012\u9ED8\u8BA4\u5730\u5740\n const defaultAddress = {\n email: profile?.email || '',\n firstName: profile?.firstName || '',\n lastName: profile?.lastName || '',\n address1: 'Default Address',\n city: 'Default City',\n province: 'Default Province',\n country: 'US',\n zip: '00000',\n }\n triggerProduct({\n address: btoa(JSON.stringify(defaultAddress)),\n rule_id: Number(item.alpc?.id),\n })\n }\n }, [item, profile, triggerGoGift, triggerProduct, isGoGift, isGiftCard])\n\n useEffect(() => {\n return () => {\n setDisabled(false)\n setErrorInfo('')\n setGiftCardId(undefined)\n }\n }, [])\n\n return (\n <CreditsModalContainer\n {...props}\n isOpen={!!item}\n className=\"w-[540px] md:h-auto\"\n scrollClassName=\"mb-[40px] min-l:px-0 md:mb-[24px] px-0\"\n titleClassName=\"h-[56px] bg-[#F5F5F7]\"\n >\n {giftCardId && !loading ? (\n <VirtualProductSuccess item={item} copy={copy} disabled={disabled} onClose={props.onClose} />\n ) : (\n <VirtualProductInit item={item} copy={copy} loading={loading} disabled={disabled} onConfirm={handleConfirm} />\n )}\n {errorInfo && (\n <div className=\"mx-auto max-w-full bg-white px-[48px] py-[12px] text-center text-[#FF0000] md:px-[16px]\">\n <Text className=\"text-[14px] font-semibold text-[#1F2021]\" html={errorInfo} />\n </div>\n )}\n </CreditsModalContainer>\n )\n}\n\nexport default RedeemVirtualProductModal\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAsII,IAAAI,EAAA,6BAtIJC,EAAqB,iCACrBC,EAAiD,iBAEjDC,EAAkC,+BAClCC,EAAgC,4CAChCC,EAAiC,6CACjCC,EAA2C,4BAC3CC,EAAsC,mCAGtCC,EAAmC,0DACnCC,EAAsC,6DAEtC,SAASC,EAA0B,CACjC,KAAAC,EACA,KAAAC,EACA,QAAAC,EACA,GAAGC,CACL,EAIG,CACD,KAAM,CAACC,EAAYC,CAAa,KAAI,YAAiB,EAC/C,CAACC,EAAWC,CAAY,KAAI,YAAiB,EAE7C,CAACC,EAAUC,CAAW,KAAI,YAAS,EAAK,EAExC,CAAE,QAAAC,EAAS,gBAAAC,CAAgB,KAAI,qBAAkB,EAGjDC,EAAWZ,EAAK,QAAQ,OAAS,cAAY,OAC7Ca,EAAab,EAAK,QAAQ,OAAS,cAAY,SAG/C,CAAE,WAAYc,EAAe,QAASC,CAAc,KAAI,mBAAgB,CAC5E,UAAUC,EAAc,CACtB,GAAI,CAACA,EAAc,CACjBT,EAAaN,GAAM,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,IAAK,OACP,EACAU,EAAe,CACb,QAAS,KAAK,KAAK,UAAUK,CAAc,CAAC,EAC5C,QAAS,OAAOzB,EAAK,MAAM,EAAE,CAC/B,CAAC,CACH,CACF,EAAG,CAACA,EAAMU,EAASK,EAAeK,EAAgBR,EAAUC,CAAU,CAAC,EAEvE,sBAAU,IACD,IAAM,CACXJ,EAAY,EAAK,EACjBF,EAAa,EAAE,EACfF,EAAc,MAAS,CACzB,EACC,CAAC,CAAC,KAGH,QAAC,yBACE,GAAGF,EACJ,OAAQ,CAAC,CAACH,EACV,UAAU,sBACV,gBAAgB,yCAChB,eAAe,wBAEd,UAAAI,GAAc,CAACiB,KACd,OAAC,yBAAsB,KAAMrB,EAAM,KAAMC,EAAM,SAAUO,EAAU,QAASL,EAAM,QAAS,KAE3F,OAAC,sBAAmB,KAAMH,EAAM,KAAMC,EAAM,QAASoB,EAAS,SAAUb,EAAU,UAAWgB,EAAe,EAE7GlB,MACC,OAAC,OAAI,UAAU,0FACb,mBAAC,QAAK,UAAU,2CAA2C,KAAMA,EAAW,EAC9E,GAEJ,CAEJ,CAEA,IAAOnB,EAAQY",
6
+ "names": ["RedeemVirtualProductModal_exports", "__export", "RedeemVirtualProductModal_default", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_react", "import_provider", "import_useRedeemGoGift", "import_useRedeemProduct", "import_const", "import_ModalContainer", "import_VirtualProductInit", "import_VirtualProductSuccess", "RedeemVirtualProductModal", "item", "copy", "onError", "props", "giftCardId", "setGiftCardId", "errorInfo", "setErrorInfo", "disabled", "setDisabled", "profile", "fetchCreditInfo", "isGoGift", "isGiftCard", "goGiftLoading", "triggerGoGift", "responseData", "handleRedeemError", "error", "productLoading", "triggerProduct", "loading", "code", "errorMsg", "handleConfirm", "defaultAddress"]
7
+ }
@@ -1,2 +1,2 @@
1
- "use strict";var P=Object.create;var x=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var $=Object.getOwnPropertyNames;var z=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty;var L=(t,l)=>{for(var e in l)x(t,e,{get:l[e],enumerable:!0})},_=(t,l,e,u)=>{if(l&&typeof l=="object"||typeof l=="function")for(let r of $(l))!E.call(t,r)&&r!==e&&x(t,r,{get:()=>l[r],enumerable:!(u=S(l,r))||u.enumerable});return t};var D=(t,l,e)=>(e=t!=null?P(z(t)):{},_(l||!t||!t.__esModule?x(e,"default",{value:t,enumerable:!0}):e,t)),O=t=>_(x({},"__esModule",{value:!0}),t);var A={};L(A,{RedeemableItem:()=>F});module.exports=O(A);var a=require("react/jsx-runtime"),n=require("@anker-in/headless-ui"),f=require("react"),v=D(require("classnames")),N=require("../context/provider"),o=require("../context/const"),d=require("../context/utils"),c=require("@anker-in/lib"),C=require("./NonProductValue"),R=require("../../../constants");function F({copy:t,className:l,item:e,onRulesOpen:u,onRedeem:r}){const{creditInfo:b,profile:i,gtm:{pageGroup:y,pageHandle:p},pageCommon:s}=(0,N.useCreditsContext)(),{brand:T}=(0,c.useHeadlessContext)(),m=Object.keys(i||{}).length>0,w=R.ROUNDED_BRANDS.includes(T),I=(0,f.useMemo)(()=>!!(e.alpc?.remainingInventory<=0&&e.alpc?.isLimited||e.alpc?.consumeType===o.AlpcConsumeType.Product&&!e.variant?.availableForSale||m&&i?.activated&&e.alpc?.consumeCredits>Number(b?.available_credit||0)),[e.alpc?.remainingInventory,e.alpc?.isLimited,e.alpc?.consumeType,e.alpc?.consumeCredits,m,i?.activated,b?.available_credit,e.variant?.availableForSale]),h=(0,f.useMemo)(()=>m?e.alpc?.consumeType===o.AlpcConsumeType.Product?e.variant?.availableForSale?t.btnRedeem:s?.soldOut||"Sold Out":t.btnRedeem:t.unlockRewards,[m,e.alpc?.consumeType,e.variant?.availableForSale,t.btnRedeem,t.unlockRewards,s?.soldOut]),k=(0,f.useMemo)(()=>{if(!(e.config?.type!==o.ConsumeType.Product||!e.product?.handle))return(0,d.extractVariantId)(e.variant?.id)?`/products/${e.product.handle}?variant=${(0,d.extractVariantId)(e.variant?.id)}${p?`&ref=${p}`:""}`:`/products/${e.product.handle}${p?`?ref=${p}`:""}`},[e.config?.type,e.product?.handle,e.variant?.id,p]);return(0,a.jsxs)("div",{className:(0,v.default)("flex flex-col items-center rounded-[16px] bg-[#EAEAEC] p-[24px] md:rounded-[12px] md:px-[8px] xl:py-[16px] md-xl:px-[16px]",!w&&"rounded-none md:rounded-none",l),children:[e.config?.type===o.ConsumeType.Product?(0,a.jsx)("a",{href:k,className:(0,v.default)("relative mx-auto h-[224px] w-fit md:my-[10px] l:h-[120px] l-xxl:h-[138px]"),children:(0,a.jsx)(n.Picture,{className:"h-full w-auto [&_img]:h-full [&_img]:object-contain",source:e.config?.image?.url||e.product.images?.[0]?.url})}):(0,a.jsxs)("div",{className:"relative mx-auto my-[30px] h-[164px] md:my-0 md:h-[66px] l-xxl:h-[138px] md-l:h-[80px]",children:[(0,a.jsx)(n.Picture,{source:s?.imageMapping?.[e.config?.type]?.url,className:"h-full [&_img]:h-full [&_img]:w-auto [&_img]:object-contain"}),(0,a.jsx)(C.NoneProductValue,{item:e})]}),(0,a.jsxs)("div",{className:(0,v.default)("mt-[10px] xl:mt-[8px] flex w-full flex-1 flex-col justify-between"),children:[(0,a.jsx)(n.Text,{html:e.config?.title||e.alpc?.title,title:e.config?.title||e.alpc?.title,size:2,className:"line-clamp-2 h-[58px] text-[24px] leading-[1.2] l:h-[40px] l:text-[16px] l-xxl:h-[48px] l-xxl:text-[20px]"}),e.config?.rules?.length>0&&(0,a.jsx)("button",{type:"button",onClick:()=>{u(e.config?.rules||[]),(0,c.gaTrack)({event:"ga4Event",event_name:"lp_button",member_active_status:i?.activated?"active":"not active",event_parameters:{page_group:y,position:t.title,button_name:s?.ruleLabel,info:e.alpc?.id?.toString()}})},className:"mt-[8px] w-fit text-[16px] font-bold underline md:text-[14px] l:mt-0",tabIndex:0,onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&g.preventDefault()},children:s?.ruleLabel}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"mt-[26px] flex items-center l:mt-[12px] l-xl:mt-[16px]",children:[(0,a.jsx)(n.Picture,{className:"size-[24px] l-xxl:size-[22px] md-l:size-[18px] md:size-[16px]",source:"https://cdn.shopify.com/s/files/1/0511/6346/3874/files/icon_hire_purchase.png?v=1757496783"}),(0,a.jsx)(n.Text,{html:`${(0,d.numberFormat)(e.alpc?.consumeCredits)}`,size:2,as:"p",className:"ml-[4px] text-[24px] font-bold mt-[4px] leading-none l-xxl:text-[20px] l:text-[16px] "})]}),(0,a.jsx)(n.Button,{disabled:I,variant:"primary",size:"lg",className:"mt-[8px] md:px-[8px] l:w-full",onClick:()=>{r(e),(0,c.gaTrack)({event:"ga4Event",event_name:"lp_button",member_active_status:i?.activated?"active":"not active",event_parameters:{page_group:y,position:t.title,button_name:h,info:e.alpc?.id?.toString()}})},children:h})]})]})]})}
1
+ "use strict";var P=Object.create;var x=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var $=Object.getOwnPropertyNames;var z=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty;var L=(t,l)=>{for(var e in l)x(t,e,{get:l[e],enumerable:!0})},_=(t,l,e,u)=>{if(l&&typeof l=="object"||typeof l=="function")for(let r of $(l))!E.call(t,r)&&r!==e&&x(t,r,{get:()=>l[r],enumerable:!(u=S(l,r))||u.enumerable});return t};var D=(t,l,e)=>(e=t!=null?P(z(t)):{},_(l||!t||!t.__esModule?x(e,"default",{value:t,enumerable:!0}):e,t)),O=t=>_(x({},"__esModule",{value:!0}),t);var A={};L(A,{RedeemableItem:()=>F});module.exports=O(A);var a=require("react/jsx-runtime"),n=require("@anker-in/headless-ui"),f=require("react"),v=D(require("classnames")),N=require("../context/provider"),o=require("../context/const"),d=require("../context/utils"),c=require("@anker-in/lib"),C=require("./NonProductValue"),R=require("../../../constants");function F({copy:t,className:l,item:e,onRulesOpen:u,onRedeem:r}){const{creditInfo:b,profile:i,gtm:{pageGroup:y,pageHandle:p},pageCommon:s}=(0,N.useCreditsContext)(),{brand:T}=(0,c.useHeadlessContext)(),m=Object.keys(i||{}).length>0,w=R.ROUNDED_BRANDS.includes(T),I=(0,f.useMemo)(()=>!!(e.alpc?.remainingInventory<=0&&e.alpc?.isLimited||e.alpc?.consumeType===o.AlpcConsumeType.Product&&!e.variant?.availableForSale||m&&i?.activated&&e.alpc?.consumeCredits>Number(b?.available_credit||0)),[e.alpc?.remainingInventory,e.alpc?.isLimited,e.alpc?.consumeType,e.alpc?.consumeCredits,m,i?.activated,b?.available_credit,e.variant?.availableForSale]),h=(0,f.useMemo)(()=>m?e.alpc?.consumeType===o.AlpcConsumeType.Product?e.variant?.availableForSale?t.btnRedeem:s?.soldOut||"Sold Out":t.btnRedeem:t.unlockRewards,[m,e.alpc?.consumeType,e.variant?.availableForSale,t.btnRedeem,t.unlockRewards,s?.soldOut]),k=(0,f.useMemo)(()=>{if(!(e.config?.type!==o.ConsumeType.Product||!e.product?.handle))return(0,d.extractVariantId)(e.variant?.id)?`/products/${e.product.handle}?variant=${(0,d.extractVariantId)(e.variant?.id)}${p?`&ref=${p}`:""}`:`/products/${e.product.handle}${p?`?ref=${p}`:""}`},[e.config?.type,e.product?.handle,e.variant?.id,p]);return(0,a.jsxs)("div",{className:(0,v.default)("flex flex-col items-center rounded-[16px] bg-[#EAEAEC] p-[24px] md:rounded-[12px] md:px-[8px] xl:py-[16px] md-xl:px-[16px]",!w&&"rounded-none md:rounded-none",l),children:[e.config?.type===o.ConsumeType.Product?(0,a.jsx)("a",{href:k,className:(0,v.default)("relative mx-auto h-[224px] w-fit md:my-[10px] l:h-[120px] l-xxl:h-[138px]"),children:(0,a.jsx)(n.Picture,{className:"h-full w-auto [&_img]:h-full [&_img]:object-contain",source:e.config?.image?.url||e.product?.images?.[0]?.url})}):(0,a.jsxs)("div",{className:"relative mx-auto my-[30px] h-[164px] md:my-0 md:h-[66px] l-xxl:h-[138px] md-l:h-[80px]",children:[(0,a.jsx)(n.Picture,{source:s?.imageMapping?.[e.config?.type]?.url,className:"h-full [&_img]:h-full [&_img]:w-auto [&_img]:object-contain"}),(0,a.jsx)(C.NoneProductValue,{item:e})]}),(0,a.jsxs)("div",{className:(0,v.default)("mt-[10px] xl:mt-[8px] flex w-full flex-1 flex-col justify-between"),children:[(0,a.jsx)(n.Text,{html:e.config?.title||e.alpc?.title,title:e.config?.title||e.alpc?.title,size:2,className:"line-clamp-2 h-[58px] text-[24px] leading-[1.2] l:h-[40px] l:text-[16px] l-xxl:h-[48px] l-xxl:text-[20px]"}),e.config?.rules?.length>0&&(0,a.jsx)("button",{type:"button",onClick:()=>{u(e.config?.rules||[]),(0,c.gaTrack)({event:"ga4Event",event_name:"lp_button",member_active_status:i?.activated?"active":"not active",event_parameters:{page_group:y,position:t.title,button_name:s?.ruleLabel,info:e.alpc?.id?.toString()}})},className:"mt-[8px] w-fit text-[16px] font-bold underline md:text-[14px] l:mt-0",tabIndex:0,onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&g.preventDefault()},children:s?.ruleLabel}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"mt-[26px] flex items-center l:mt-[12px] l-xl:mt-[16px]",children:[(0,a.jsx)(n.Picture,{className:"size-[24px] l-xxl:size-[22px] md-l:size-[18px] md:size-[16px]",source:"https://cdn.shopify.com/s/files/1/0511/6346/3874/files/icon_hire_purchase.png?v=1757496783"}),(0,a.jsx)(n.Text,{html:`${(0,d.numberFormat)(e.alpc?.consumeCredits)}`,size:2,as:"p",className:"ml-[4px] text-[24px] font-bold mt-[4px] leading-none l-xxl:text-[20px] l:text-[16px] "})]}),(0,a.jsx)(n.Button,{disabled:I,variant:"primary",size:"lg",className:"mt-[8px] md:px-[8px] l:w-full",onClick:()=>{r(e),(0,c.gaTrack)({event:"ga4Event",event_name:"lp_button",member_active_status:i?.activated?"active":"not active",event_parameters:{page_group:y,position:t.title,button_name:h,info:e.alpc?.id?.toString()}})},children:h})]})]})]})}
2
2
  //# sourceMappingURL=RedeemableItem.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/components/credits/creditsRedeemList/RedeemableItem.tsx"],
4
- "sourcesContent": ["import { Button, Text, Picture } from '@anker-in/headless-ui'\n\nimport { useMemo } from 'react'\n\nimport classNames from 'classnames'\nimport { useCreditsContext } from '../context/provider'\nimport type { RedeemableItem as RedeemableItemType } from '../type'\nimport { AlpcConsumeType, ConsumeType } from '../context/const'\nimport { numberFormat, extractVariantId } from '../context/utils'\nimport type { CreditsRedeemListCopy } from './type'\nimport { gaTrack, useHeadlessContext } from '@anker-in/lib'\nimport { NoneProductValue } from './NonProductValue'\nimport { ROUNDED_BRANDS } from '../../../constants'\n\nexport function RedeemableItem({\n copy,\n className,\n item,\n onRulesOpen,\n onRedeem,\n}: {\n copy: CreditsRedeemListCopy\n className?: string\n item: RedeemableItemType\n onRulesOpen: (rules: string[]) => void\n onRedeem: (item: RedeemableItemType) => void\n}) {\n const {\n creditInfo,\n profile,\n gtm: { pageGroup, pageHandle },\n pageCommon,\n } = useCreditsContext()\n const { brand } = useHeadlessContext()\n const isLogin = Object.keys(profile || {}).length > 0\n const rounded = ROUNDED_BRANDS.includes(brand)\n\n const isDisabled = useMemo(() => {\n if (item.alpc?.remainingInventory <= 0 && item.alpc?.isLimited) {\n // \u6709\u5E93\u5B58\u9650\u5236\n return true\n }\n\n if (item.alpc?.consumeType === AlpcConsumeType.Product) {\n if (!item.variant?.availableForSale) {\n return true\n }\n }\n if (isLogin && profile?.activated && item.alpc?.consumeCredits > Number(creditInfo?.available_credit || 0)) {\n return true\n }\n return false\n }, [\n item.alpc?.remainingInventory,\n item.alpc?.isLimited,\n item.alpc?.consumeType,\n item.alpc?.consumeCredits,\n isLogin,\n profile?.activated,\n creditInfo?.available_credit,\n item.variant?.availableForSale,\n ])\n\n const redeemButtonText = useMemo(() => {\n if (!isLogin) {\n return copy.unlockRewards\n }\n\n // \u7F3A\u8D27\u6587\u6848\n if (item.alpc?.consumeType === AlpcConsumeType.Product) {\n return item.variant?.availableForSale ? copy.btnRedeem : pageCommon?.soldOut || 'Sold Out'\n }\n return copy.btnRedeem\n }, [\n isLogin,\n item.alpc?.consumeType,\n item.variant?.availableForSale,\n copy.btnRedeem,\n copy.unlockRewards,\n pageCommon?.soldOut,\n ])\n\n // \u751F\u6210\u4EA7\u54C1 listing \u9875\u9762\u94FE\u63A5\n const productUrl = useMemo(() => {\n if (item.config?.type !== ConsumeType.Product || !item.product?.handle) {\n return undefined\n }\n return extractVariantId(item.variant?.id)\n ? `/products/${item.product.handle}?variant=${extractVariantId(item.variant?.id)}${pageHandle ? `&ref=${pageHandle}` : ''}`\n : `/products/${item.product.handle}${pageHandle ? `?ref=${pageHandle}` : ''}`\n }, [item.config?.type, item.product?.handle, item.variant?.id, pageHandle])\n\n return (\n <div\n className={classNames(\n 'flex flex-col items-center rounded-[16px] bg-[#EAEAEC] p-[24px] md:rounded-[12px] md:px-[8px] xl:py-[16px] md-xl:px-[16px]',\n !rounded && 'rounded-none md:rounded-none',\n className\n )}\n >\n {item.config?.type === ConsumeType.Product ? (\n <a\n href={productUrl}\n className={classNames('relative mx-auto h-[224px] w-fit md:my-[10px] l:h-[120px] l-xxl:h-[138px]')}\n >\n <Picture\n className=\"h-full w-auto [&_img]:h-full [&_img]:object-contain\"\n source={item.config?.image?.url || item.product.images?.[0]?.url}\n ></Picture>\n </a>\n ) : (\n <div className=\"relative mx-auto my-[30px] h-[164px] md:my-0 md:h-[66px] l-xxl:h-[138px] md-l:h-[80px]\">\n <Picture\n source={pageCommon?.imageMapping?.[item.config?.type]?.url}\n className=\"h-full [&_img]:h-full [&_img]:w-auto [&_img]:object-contain\"\n ></Picture>\n\n <NoneProductValue item={item} />\n </div>\n )}\n <div className={classNames('mt-[10px] xl:mt-[8px] flex w-full flex-1 flex-col justify-between')}>\n <Text\n html={item.config?.title || item.alpc?.title}\n title={item.config?.title || item.alpc?.title}\n size={2}\n className=\"line-clamp-2 h-[58px] text-[24px] leading-[1.2] l:h-[40px] l:text-[16px] l-xxl:h-[48px] l-xxl:text-[20px]\"\n />\n {item.config?.rules?.length > 0 && (\n <button\n type=\"button\"\n onClick={() => {\n onRulesOpen(item.config?.rules || [])\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: pageGroup,\n position: copy.title,\n button_name: pageCommon?.ruleLabel,\n info: item.alpc?.id?.toString(),\n },\n })\n }}\n className=\"mt-[8px] w-fit text-[16px] font-bold underline md:text-[14px] l:mt-0\"\n tabIndex={0}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n }\n }}\n >\n {pageCommon?.ruleLabel}\n </button>\n )}\n <div>\n <div className=\"mt-[26px] flex items-center l:mt-[12px] l-xl:mt-[16px]\">\n <Picture\n className=\"size-[24px] l-xxl:size-[22px] md-l:size-[18px] md:size-[16px]\"\n source=\"https://cdn.shopify.com/s/files/1/0511/6346/3874/files/icon_hire_purchase.png?v=1757496783\"\n />\n <Text\n html={`${numberFormat(item.alpc?.consumeCredits)}`}\n size={2}\n as=\"p\"\n className=\"ml-[4px] text-[24px] font-bold mt-[4px] leading-none l-xxl:text-[20px] l:text-[16px] \"\n />\n </div>\n\n <Button\n disabled={isDisabled}\n variant=\"primary\"\n size=\"lg\"\n className=\"mt-[8px] md:px-[8px] l:w-full\"\n onClick={() => {\n onRedeem(item)\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: pageGroup,\n position: copy.title,\n button_name: redeemButtonText,\n info: item.alpc?.id?.toString(),\n },\n })\n }}\n >\n {redeemButtonText}\n </Button>\n </div>\n </div>\n </div>\n )\n}\n"],
5
- "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,oBAAAE,IAAA,eAAAC,EAAAH,GAyGU,IAAAI,EAAA,6BAzGVC,EAAsC,iCA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CA,EAAE,eAAe,CAErB,EAEC,SAAAR,GAAY,UACf,KAEF,QAAC,OACC,qBAAC,OAAI,UAAU,yDACb,oBAAC,WACC,UAAU,gEACV,OAAO,6FACT,KACA,OAAC,QACC,KAAM,MAAG,gBAAaP,EAAK,MAAM,cAAc,CAAC,GAChD,KAAM,EACN,GAAG,IACH,UAAU,wFACZ,GACF,KAEA,OAAC,UACC,SAAUW,EACV,QAAQ,UACR,KAAK,KACL,UAAU,gCACV,QAAS,IAAM,CACbT,EAASF,CAAI,KACb,WAAQ,CACN,MAAO,WACP,WAAY,YACZ,qBAAsBI,GAAS,UAAY,SAAW,aACtD,iBAAkB,CAChB,WAAYC,EACZ,SAAUP,EAAK,MACf,YAAac,EACb,KAAMZ,EAAK,MAAM,IAAI,SAAS,CAChC,CACF,CAAC,CACH,EAEC,SAAAY,EACH,GACF,GACF,GACF,CAEJ",
4
+ "sourcesContent": ["import { Button, Text, Picture } from '@anker-in/headless-ui'\n\nimport { useMemo } from 'react'\n\nimport classNames from 'classnames'\nimport { useCreditsContext } from '../context/provider'\nimport type { RedeemableItem as RedeemableItemType } from '../type'\nimport { AlpcConsumeType, ConsumeType } from '../context/const'\nimport { numberFormat, extractVariantId } from '../context/utils'\nimport type { CreditsRedeemListCopy } from './type'\nimport { gaTrack, useHeadlessContext } from '@anker-in/lib'\nimport { NoneProductValue } from './NonProductValue'\nimport { ROUNDED_BRANDS } from '../../../constants'\n\nexport function RedeemableItem({\n copy,\n className,\n item,\n onRulesOpen,\n onRedeem,\n}: {\n copy: CreditsRedeemListCopy\n className?: string\n item: RedeemableItemType\n onRulesOpen: (rules: string[]) => void\n onRedeem: (item: RedeemableItemType) => void\n}) {\n const {\n creditInfo,\n profile,\n gtm: { pageGroup, pageHandle },\n pageCommon,\n } = useCreditsContext()\n const { brand } = useHeadlessContext()\n const isLogin = Object.keys(profile || {}).length > 0\n const rounded = ROUNDED_BRANDS.includes(brand)\n\n const isDisabled = useMemo(() => {\n if (item.alpc?.remainingInventory <= 0 && item.alpc?.isLimited) {\n // \u6709\u5E93\u5B58\u9650\u5236\n return true\n }\n\n if (item.alpc?.consumeType === AlpcConsumeType.Product) {\n if (!item.variant?.availableForSale) {\n return true\n }\n }\n if (isLogin && profile?.activated && item.alpc?.consumeCredits > Number(creditInfo?.available_credit || 0)) {\n return true\n }\n return false\n }, [\n item.alpc?.remainingInventory,\n item.alpc?.isLimited,\n item.alpc?.consumeType,\n item.alpc?.consumeCredits,\n isLogin,\n profile?.activated,\n creditInfo?.available_credit,\n item.variant?.availableForSale,\n ])\n\n const redeemButtonText = useMemo(() => {\n if (!isLogin) {\n return copy.unlockRewards\n }\n\n // \u7F3A\u8D27\u6587\u6848\n if (item.alpc?.consumeType === AlpcConsumeType.Product) {\n return item.variant?.availableForSale ? copy.btnRedeem : pageCommon?.soldOut || 'Sold Out'\n }\n return copy.btnRedeem\n }, [\n isLogin,\n item.alpc?.consumeType,\n item.variant?.availableForSale,\n copy.btnRedeem,\n copy.unlockRewards,\n pageCommon?.soldOut,\n ])\n\n // \u751F\u6210\u4EA7\u54C1 listing \u9875\u9762\u94FE\u63A5\n const productUrl = useMemo(() => {\n if (item.config?.type !== ConsumeType.Product || !item.product?.handle) {\n return undefined\n }\n return extractVariantId(item.variant?.id)\n ? `/products/${item.product.handle}?variant=${extractVariantId(item.variant?.id)}${pageHandle ? `&ref=${pageHandle}` : ''}`\n : `/products/${item.product.handle}${pageHandle ? `?ref=${pageHandle}` : ''}`\n }, [item.config?.type, item.product?.handle, item.variant?.id, pageHandle])\n\n return (\n <div\n className={classNames(\n 'flex flex-col items-center rounded-[16px] bg-[#EAEAEC] p-[24px] md:rounded-[12px] md:px-[8px] xl:py-[16px] md-xl:px-[16px]',\n !rounded && 'rounded-none md:rounded-none',\n className\n )}\n >\n {item.config?.type === ConsumeType.Product ? (\n <a\n href={productUrl}\n className={classNames('relative mx-auto h-[224px] w-fit md:my-[10px] l:h-[120px] l-xxl:h-[138px]')}\n >\n <Picture\n className=\"h-full w-auto [&_img]:h-full [&_img]:object-contain\"\n source={item.config?.image?.url || item.product?.images?.[0]?.url}\n ></Picture>\n </a>\n ) : (\n <div className=\"relative mx-auto my-[30px] h-[164px] md:my-0 md:h-[66px] l-xxl:h-[138px] md-l:h-[80px]\">\n <Picture\n source={pageCommon?.imageMapping?.[item.config?.type]?.url}\n className=\"h-full [&_img]:h-full [&_img]:w-auto [&_img]:object-contain\"\n ></Picture>\n\n <NoneProductValue item={item} />\n </div>\n )}\n <div className={classNames('mt-[10px] xl:mt-[8px] flex w-full flex-1 flex-col justify-between')}>\n <Text\n html={item.config?.title || item.alpc?.title}\n title={item.config?.title || item.alpc?.title}\n size={2}\n className=\"line-clamp-2 h-[58px] text-[24px] leading-[1.2] l:h-[40px] l:text-[16px] l-xxl:h-[48px] l-xxl:text-[20px]\"\n />\n {item.config?.rules?.length > 0 && (\n <button\n type=\"button\"\n onClick={() => {\n onRulesOpen(item.config?.rules || [])\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: pageGroup,\n position: copy.title,\n button_name: pageCommon?.ruleLabel,\n info: item.alpc?.id?.toString(),\n },\n })\n }}\n className=\"mt-[8px] w-fit text-[16px] font-bold underline md:text-[14px] l:mt-0\"\n tabIndex={0}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n }\n }}\n >\n {pageCommon?.ruleLabel}\n </button>\n )}\n <div>\n <div className=\"mt-[26px] flex items-center l:mt-[12px] l-xl:mt-[16px]\">\n <Picture\n className=\"size-[24px] l-xxl:size-[22px] md-l:size-[18px] md:size-[16px]\"\n source=\"https://cdn.shopify.com/s/files/1/0511/6346/3874/files/icon_hire_purchase.png?v=1757496783\"\n />\n <Text\n html={`${numberFormat(item.alpc?.consumeCredits)}`}\n size={2}\n as=\"p\"\n className=\"ml-[4px] text-[24px] font-bold mt-[4px] leading-none l-xxl:text-[20px] l:text-[16px] \"\n />\n </div>\n\n <Button\n disabled={isDisabled}\n variant=\"primary\"\n size=\"lg\"\n className=\"mt-[8px] md:px-[8px] l:w-full\"\n onClick={() => {\n onRedeem(item)\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: pageGroup,\n position: copy.title,\n button_name: redeemButtonText,\n info: item.alpc?.id?.toString(),\n },\n })\n }}\n >\n {redeemButtonText}\n </Button>\n </div>\n </div>\n </div>\n )\n}\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,oBAAAE,IAAA,eAAAC,EAAAH,GAyGU,IAAAI,EAAA,6BAzGVC,EAAsC,iCAEtCC,EAAwB,iBAExBC,EAAuB,yBACvBC,EAAkC,+BAElCC,EAA6C,4BAC7CC,EAA+C,4BAE/CC,EAA4C,yBAC5CC,EAAiC,6BACjCC,EAA+B,8BAExB,SAASX,EAAe,CAC7B,KAAAY,EACA,UAAAC,EACA,KAAAC,EACA,YAAAC,EACA,SAAAC,CACF,EAMG,CACD,KAAM,CACJ,WAAAC,EACA,QAAAC,EACA,IAAK,CAAE,UAAAC,EAAW,WAAAC,CAAW,EAC7B,WAAAC,CACF,KAAI,qBAAkB,EAChB,CAAE,MAAAC,CAAM,KAAI,sBAAmB,EAC/BC,EAAU,OAAO,KAAKL,GAAW,CAAC,CAAC,EAAE,OAAS,EAC9CM,EAAU,iBAAe,SAASF,CAAK,EAEvCG,KAAa,WAAQ,IACrB,GAAAX,EAAK,MAAM,oBAAsB,GAAKA,EAAK,MAAM,WAKjDA,EAAK,MAAM,cAAgB,kBAAgB,SACzC,CAACA,EAAK,SAAS,kBAIjBS,GAAWL,GAAS,WAAaJ,EAAK,MAAM,eAAiB,OAAOG,GAAY,kBAAoB,CAAC,GAIxG,CACDH,EAAK,MAAM,mBACXA,EAAK,MAAM,UACXA,EAAK,MAAM,YACXA,EAAK,MAAM,eACXS,EACAL,GAAS,UACTD,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,QAAQ,OAASA,EAAK,MAAM,MACxC,KAAM,EACN,UAAU,4GACZ,EACCA,EAAK,QAAQ,OAAO,OAAS,MAC5B,OAAC,UACC,KAAK,SACL,QAAS,IAAM,CACbC,EAAYD,EAAK,QAAQ,OAAS,CAAC,CAAC,KACpC,WAAQ,CACN,MAAO,WACP,WAAY,YACZ,qBAAsBI,GAAS,UAAY,SAAW,aACtD,iBAAkB,CAChB,WAAYC,EACZ,SAAUP,EAAK,MACf,YAAaS,GAAY,UACzB,KAAMP,EAAK,MAAM,IAAI,SAAS,CAChC,CACF,CAAC,CACH,EACA,UAAU,uEACV,SAAU,EACV,UAAWe,GAAK,EACVA,EAAE,MAAQ,SAAWA,EAAE,MAAQ,MACjCA,EAAE,eAAe,CAErB,EAEC,SAAAR,GAAY,UACf,KAEF,QAAC,OACC,qBAAC,OAAI,UAAU,yDACb,oBAAC,WACC,UAAU,gEACV,OAAO,6FACT,KACA,OAAC,QACC,KAAM,MAAG,gBAAaP,EAAK,MAAM,cAAc,CAAC,GAChD,KAAM,EACN,GAAG,IACH,UAAU,wFACZ,GACF,KAEA,OAAC,UACC,SAAUW,EACV,QAAQ,UACR,KAAK,KACL,UAAU,gCACV,QAAS,IAAM,CACbT,EAASF,CAAI,KACb,WAAQ,CACN,MAAO,WACP,WAAY,YACZ,qBAAsBI,GAAS,UAAY,SAAW,aACtD,iBAAkB,CAChB,WAAYC,EACZ,SAAUP,EAAK,MACf,YAAac,EACb,KAAMZ,EAAK,MAAM,IAAI,SAAS,CAChC,CACF,CAAC,CACH,EAEC,SAAAY,EACH,GACF,GACF,GACF,CAEJ",
6
6
  "names": ["RedeemableItem_exports", "__export", "RedeemableItem", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_react", "import_classnames", "import_provider", "import_const", "import_utils", "import_lib", "import_NonProductValue", "import_constants", "copy", "className", "item", "onRulesOpen", "onRedeem", "creditInfo", "profile", "pageGroup", "pageHandle", "pageCommon", "brand", "isLogin", "rounded", "isDisabled", "redeemButtonText", "productUrl", "classNames", "e"]
7
7
  }
@@ -27,6 +27,17 @@ export type CreditsRedeemListCopy = {
27
27
  successButton: string;
28
28
  successButtonUrl: string;
29
29
  };
30
+ virtualProduct: {
31
+ successDesc: string;
32
+ successTitle: string;
33
+ successButton: string;
34
+ successButtonUrl: string;
35
+ stepTitle?: string;
36
+ steps?: {
37
+ imageUrl: string;
38
+ title: string;
39
+ }[];
40
+ };
30
41
  product: {
31
42
  required: string;
32
43
  invalidEmail: string;
@@ -1,2 +1,2 @@
1
- "use strict";var e=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var o=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var a=(t,r,n,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of o(r))!l.call(t,s)&&s!==n&&e(t,s,{get:()=>r[s],enumerable:!(i=g(r,s))||i.enumerable});return t};var c=t=>a(e({},"__esModule",{value:!0}),t);var d={};module.exports=c(d);
1
+ "use strict";var e=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var o=Object.prototype.hasOwnProperty;var c=(t,s,n,i)=>{if(s&&typeof s=="object"||typeof s=="function")for(let r of l(s))!o.call(t,r)&&r!==n&&e(t,r,{get:()=>s[r],enumerable:!(i=g(s,r))||i.enumerable});return t};var a=t=>c(e({},"__esModule",{value:!0}),t);var u={};module.exports=a(u);
2
2
  //# sourceMappingURL=type.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/components/credits/creditsRedeemList/type.ts"],
4
- "sourcesContent": ["export type CreditsRedeemListCopy = {\n title: string\n availableCredits: string\n unlockRewards: string\n btnRedeem: string\n list: {\n label: string\n list: {\n id: string\n type: string\n value: string\n rules: string[]\n }[]\n }[]\n redeemModal: {\n confirmTitle: string\n confirmButton: string\n commonError: string\n redeemLimitError: string\n inventoryNotEnough: string\n creditsNotEnough: string\n crossSiteError: string\n errorImageUrl: string\n coupon: {\n successDesc: string\n successTitle: string\n successButton: string\n successButtonUrl: string\n }\n product: {\n required: string\n invalidEmail: string\n shippingAddress: string\n shippingProduct: string\n addressForm: {\n key: string\n type: string\n label: string\n isSelect: boolean\n required: boolean\n placeholder: string\n }[][]\n form: {\n key: string\n type: string\n isSelect: boolean\n required: boolean\n placeholder: string\n }[][]\n successDesc: string[]\n rules: string[]\n steps: {\n imageUrl: string\n title: string\n }[]\n quantityLabel: string\n totalPriceLabel: string\n variantLabel: string\n shippingFeeLabel: string\n paymentButton: string\n stepTitle: string\n }\n }\n}\n"],
4
+ "sourcesContent": ["export type CreditsRedeemListCopy = {\n title: string\n availableCredits: string\n unlockRewards: string\n btnRedeem: string\n list: {\n label: string\n list: {\n id: string\n type: string\n value: string\n rules: string[]\n }[]\n }[]\n redeemModal: {\n confirmTitle: string\n confirmButton: string\n commonError: string\n redeemLimitError: string\n inventoryNotEnough: string\n creditsNotEnough: string\n crossSiteError: string\n errorImageUrl: string\n coupon: {\n successDesc: string\n successTitle: string\n successButton: string\n successButtonUrl: string\n }\n virtualProduct: {\n successDesc: string\n successTitle: string\n successButton: string\n successButtonUrl: string\n stepTitle?: string\n steps?: {\n imageUrl: string\n title: string\n }[]\n }\n product: {\n required: string\n invalidEmail: string\n shippingAddress: string\n shippingProduct: string\n addressForm: {\n key: string\n type: string\n label: string\n isSelect: boolean\n required: boolean\n placeholder: string\n }[][]\n form: {\n key: string\n type: string\n isSelect: boolean\n required: boolean\n placeholder: string\n }[][]\n successDesc: string[]\n rules: string[]\n steps: {\n imageUrl: string\n title: string\n }[]\n quantityLabel: string\n totalPriceLabel: string\n variantLabel: string\n shippingFeeLabel: string\n paymentButton: string\n stepTitle: string\n }\n }\n}\n"],
5
5
  "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
6
  "names": ["type_exports", "__toCommonJS"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var k=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var q=Object.prototype.hasOwnProperty;var V=(t,n)=>{for(var p in n)k(t,p,{get:n[p],enumerable:!0})},J=(t,n,p,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let a of j(n))!q.call(t,a)&&a!==p&&k(t,a,{get:()=>n[a],enumerable:!(o=_(n,a))||o.enumerable});return t};var K=t=>J(k({},"__esModule",{value:!0}),t);var X={};V(X,{CreditsWaysToGetCredits:()=>Q});module.exports=K(X);var e=require("react/jsx-runtime"),i=require("@anker-in/headless-ui"),f=require("@heroicons/react/24/outline"),l=require("react"),x=require("./type"),I=require("./useActions"),R=require("../context/provider"),r=require("@anker-in/lib"),T=require("../../registration"),y=require("../modal/creditsUploadReceiptModal"),D=require("../modal/subscribeModal"),L=require("../../../constants");const Q=({copy:t,classNames:n,id:p})=>{const[o,a]=(0,l.useState)(!1),M=(0,l.useRef)(null),{profile:U}=(0,R.useCreditsContext)(),{authCodeActivate:O}=(0,T.useRegistration)(),{brand:B}=(0,r.useHeadlessContext)(),C=L.ROUNDED_BRANDS.includes(B),b=!!U,[A,N]=(0,l.useState)(!1),[P,h]=(0,l.useState)(!1),[w,E]=(0,l.useState)(!1),[F,W]=(0,l.useState)(!1),{actions:v}=(0,I.useActions)({copy:t,subscribe:{openSubscribePopup:()=>h(!0),isSuccess:w},uploadReceipt:{openUploadReceiptPopup:()=>N(!0),isSuccess:F}}),G=(0,l.useMemo)(()=>{const s=(t.list||[]).map(d=>{if(!v[d.id])return;const{finished:c,notLogin:S,notFinished:g,completed:H}=v[d.id];let u="",m,z;return b?c?(u=H.buttonLabel,m=void 0):(u=g.buttonLabel,m=g.handleClick,z=g.link):(u=S.buttonLabel,m=S.handleClick),{...d,buttonLabel:u,handleClick:m,finished:c,link:z}}).filter(Boolean);return b?s.sort((d,c)=>d?.finished&&!c?.finished?1:!d?.finished&&c?.finished?-1:0):s},[v,t.list,b]);return(0,l.useEffect)(()=>{if(!o&&window.innerWidth<768){const s=document.getElementById("ways-to-get-credits");if(s){const d=setTimeout(()=>{s.scrollIntoView({behavior:"smooth",block:"end"})},300);return()=>clearTimeout(d)}}},[o]),(0,e.jsxs)(i.Container,{id:p,className:" bg-[#F5F5F7] [&>div]:l:!px-0",children:[(0,e.jsxs)("div",{className:(0,r.classNames)("rounded-[16px] bg-[#1D1D1F] py-[64px] px-[140px] text-white md:px-[16px] l:rounded-none md-l:px-[32px] l-xl:px-[77px]",!C&&"rounded-none"),children:[(0,e.jsx)(i.Heading,{as:"h2",size:4,html:t?.title,className:"text-center l:pl-[16px] l:text-left"}),(0,e.jsxs)("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:[(0,e.jsxs)("div",{className:"pl-[16px] l:mt-[40px] desktop:pl-[24px] lg-desktop:pl-[32px]",children:[(0,e.jsx)(i.Heading,{size:3,as:"h3",html:t.subtitle,className:n?.subtitle}),(0,e.jsxs)("div",{className:"mt-[8px] flex items-center",children:[t.creditsIcon?.url&&(0,e.jsx)(i.Picture,{className:"size-[48px] mr-[8px] stroke-brand xl:size-[30px] [&_path]:stroke-brand",source:t.creditsIcon.url,alt:t.creditsIcon.alt||"credits"}),(0,e.jsx)(i.Heading,{html:t.equalCredits,size:4,as:"h3",className:(0,r.classNames)("mt-2 text-white md:text-[24px]",n?.equalCreditsText)})]})]}),(0,e.jsx)(i.Picture,{className:"w-full laptop:w-[50%]",source:t.mainImage?.url})]}),(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsxs)("div",{ref:M,className:(0,r.classNames)("relative mt-[64px] grid grid-cols-3 gap-[16px] overflow-hidden transition-all duration-300 md:mt-[16px] md:grid-cols-1 l:gap-[12px] md-l:mt-[32px] md-l:grid-cols-2",o?"min-md:!h-auto md:h-auto":"md:h-[512px] min-md:!h-auto"),children:[G.map(s=>(0,e.jsxs)("div",{className:(0,r.classNames)("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]",!C&&"rounded-none"),children:[(0,e.jsxs)("div",{children:[(0,e.jsx)(i.Text,{as:"p",html:s.title,size:2,className:"text-pretty text-[24px] font-bold xl:text-[20px]"}),(0,e.jsxs)("div",{className:"mt-[4px] flex items-center",children:[(0,e.jsx)(i.Picture,{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"}),(0,e.jsx)(i.Text,{as:"p",html:s.credits,size:2,className:"ml-[4px] mt-[6px] text-[18px] l:text-[14px]"})]})]}),s.handleClick&&!(s.id===x.TaskType.UploadReceipt&&F)&&!(s.id===x.TaskType.Activate&&O.isActivateSuccess)&&!(s.id===x.TaskType.Subscribe&&w)?(0,e.jsx)(i.Button,{as:s.link?"a":"button",...s.link&&{href:s.link},...s.handleClick&&{onClick:s.handleClick},variant:"primary",size:"lg",className:"mt-[24px] w-fit",children:s.buttonLabel}):(0,e.jsx)(i.Button,{variant:"primary",size:"lg",className:"mt-[24px] w-fit",disabled:!0,children:s.buttonLabel})]},s.id)),!o&&(0,e.jsx)("div",{className:"absolute inset-0 pointer-events-none min-md:hidden",style:{background:"linear-gradient(180deg, rgba(29, 29, 31, 0) 66.37%, #1D1D1F 100%)"}})]}),o?(0,e.jsx)("button",{className:"mx-auto mt-[12px] block w-fit min-md:hidden",onClick:()=>{a(!1)},children:(0,e.jsx)(f.ChevronUpIcon,{className:"size-[40px] rounded-full bg-[#FFFFFF33] p-[8px]"})}):(0,e.jsx)(e.Fragment,{children:(0,e.jsx)("div",{className:"absolute bottom-0 flex w-full translate-y-1/2 justify-center min-md:hidden",children:(0,e.jsx)("button",{className:"w-fit",onClick:()=>a(!o),children:(0,e.jsx)(f.ChevronDownIcon,{className:"size-[40px] rounded-full bg-[#FFFFFF33] p-[8px]"})})})})]})]}),t.receipt&&(0,e.jsx)(y.CreditsUploadReceiptModal,{isOpen:A,onClose:()=>{N(!1)},copy:t.receipt,onSuccess:()=>{W(!0)}}),t.subscribe&&(0,e.jsx)(D.CreditsSubscribeModal,{copy:t.subscribe,onSuccess:()=>{E(!0),setTimeout(()=>{h(!1)},3e3)},isOpen:P,onClose:()=>{h(!1)}})]})};
1
+ "use strict";var k=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var q=Object.prototype.hasOwnProperty;var V=(t,n)=>{for(var p in n)k(t,p,{get:n[p],enumerable:!0})},J=(t,n,p,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let a of j(n))!q.call(t,a)&&a!==p&&k(t,a,{get:()=>n[a],enumerable:!(o=_(n,a))||o.enumerable});return t};var K=t=>J(k({},"__esModule",{value:!0}),t);var X={};V(X,{CreditsWaysToGetCredits:()=>Q});module.exports=K(X);var e=require("react/jsx-runtime"),i=require("@anker-in/headless-ui"),f=require("@heroicons/react/24/outline"),l=require("react"),x=require("./type"),I=require("./useActions"),R=require("../context/provider"),r=require("@anker-in/lib"),T=require("../../registration"),y=require("../modal/CreditsUploadReceiptModal"),D=require("../modal/SubscribeModal"),L=require("../../../constants");const Q=({copy:t,classNames:n,id:p})=>{const[o,a]=(0,l.useState)(!1),M=(0,l.useRef)(null),{profile:U}=(0,R.useCreditsContext)(),{authCodeActivate:O}=(0,T.useRegistration)(),{brand:B}=(0,r.useHeadlessContext)(),C=L.ROUNDED_BRANDS.includes(B),b=!!U,[A,N]=(0,l.useState)(!1),[P,h]=(0,l.useState)(!1),[w,E]=(0,l.useState)(!1),[F,W]=(0,l.useState)(!1),{actions:v}=(0,I.useActions)({copy:t,subscribe:{openSubscribePopup:()=>h(!0),isSuccess:w},uploadReceipt:{openUploadReceiptPopup:()=>N(!0),isSuccess:F}}),G=(0,l.useMemo)(()=>{const s=(t.list||[]).map(d=>{if(!v[d.id])return;const{finished:c,notLogin:S,notFinished:g,completed:H}=v[d.id];let u="",m,z;return b?c?(u=H.buttonLabel,m=void 0):(u=g.buttonLabel,m=g.handleClick,z=g.link):(u=S.buttonLabel,m=S.handleClick),{...d,buttonLabel:u,handleClick:m,finished:c,link:z}}).filter(Boolean);return b?s.sort((d,c)=>d?.finished&&!c?.finished?1:!d?.finished&&c?.finished?-1:0):s},[v,t.list,b]);return(0,l.useEffect)(()=>{if(!o&&window.innerWidth<768){const s=document.getElementById("ways-to-get-credits");if(s){const d=setTimeout(()=>{s.scrollIntoView({behavior:"smooth",block:"end"})},300);return()=>clearTimeout(d)}}},[o]),(0,e.jsxs)(i.Container,{id:p,className:" bg-[#F5F5F7] [&>div]:l:!px-0",children:[(0,e.jsxs)("div",{className:(0,r.classNames)("rounded-[16px] bg-[#1D1D1F] py-[64px] px-[140px] text-white md:px-[16px] l:rounded-none md-l:px-[32px] l-xl:px-[77px]",!C&&"rounded-none"),children:[(0,e.jsx)(i.Heading,{as:"h2",size:4,html:t?.title,className:"text-center l:pl-[16px] l:text-left"}),(0,e.jsxs)("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:[(0,e.jsxs)("div",{className:"pl-[16px] l:mt-[40px] desktop:pl-[24px] lg-desktop:pl-[32px]",children:[(0,e.jsx)(i.Heading,{size:3,as:"h3",html:t.subtitle,className:n?.subtitle}),(0,e.jsxs)("div",{className:"mt-[8px] flex items-center",children:[t.creditsIcon?.url&&(0,e.jsx)(i.Picture,{className:"size-[48px] mr-[8px] stroke-brand xl:size-[30px] [&_path]:stroke-brand",source:t.creditsIcon.url,alt:t.creditsIcon.alt||"credits"}),(0,e.jsx)(i.Heading,{html:t.equalCredits,size:4,as:"h3",className:(0,r.classNames)("mt-2 text-white md:text-[24px]",n?.equalCreditsText)})]})]}),(0,e.jsx)(i.Picture,{className:"w-full laptop:w-[50%]",source:t.mainImage?.url})]}),(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsxs)("div",{ref:M,className:(0,r.classNames)("relative mt-[64px] grid grid-cols-3 gap-[16px] overflow-hidden transition-all duration-300 md:mt-[16px] md:grid-cols-1 l:gap-[12px] md-l:mt-[32px] md-l:grid-cols-2",o?"min-md:!h-auto md:h-auto":"md:h-[512px] min-md:!h-auto"),children:[G.map(s=>(0,e.jsxs)("div",{className:(0,r.classNames)("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]",!C&&"rounded-none"),children:[(0,e.jsxs)("div",{children:[(0,e.jsx)(i.Text,{as:"p",html:s.title,size:2,className:"text-pretty text-[24px] font-bold xl:text-[20px]"}),(0,e.jsxs)("div",{className:"mt-[4px] flex items-center",children:[(0,e.jsx)(i.Picture,{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"}),(0,e.jsx)(i.Text,{as:"p",html:s.credits,size:2,className:"ml-[4px] mt-[6px] text-[18px] l:text-[14px]"})]})]}),s.handleClick&&!(s.id===x.TaskType.UploadReceipt&&F)&&!(s.id===x.TaskType.Activate&&O.isActivateSuccess)&&!(s.id===x.TaskType.Subscribe&&w)?(0,e.jsx)(i.Button,{as:s.link?"a":"button",...s.link&&{href:s.link},...s.handleClick&&{onClick:s.handleClick},variant:"primary",size:"lg",className:"mt-[24px] w-fit",children:s.buttonLabel}):(0,e.jsx)(i.Button,{variant:"primary",size:"lg",className:"mt-[24px] w-fit",disabled:!0,children:s.buttonLabel})]},s.id)),!o&&(0,e.jsx)("div",{className:"absolute inset-0 pointer-events-none min-md:hidden",style:{background:"linear-gradient(180deg, rgba(29, 29, 31, 0) 66.37%, #1D1D1F 100%)"}})]}),o?(0,e.jsx)("button",{className:"mx-auto mt-[12px] block w-fit min-md:hidden",onClick:()=>{a(!1)},children:(0,e.jsx)(f.ChevronUpIcon,{className:"size-[40px] rounded-full bg-[#FFFFFF33] p-[8px]"})}):(0,e.jsx)(e.Fragment,{children:(0,e.jsx)("div",{className:"absolute bottom-0 flex w-full translate-y-1/2 justify-center min-md:hidden",children:(0,e.jsx)("button",{className:"w-fit",onClick:()=>a(!o),children:(0,e.jsx)(f.ChevronDownIcon,{className:"size-[40px] rounded-full bg-[#FFFFFF33] p-[8px]"})})})})]})]}),t.receipt&&(0,e.jsx)(y.CreditsUploadReceiptModal,{isOpen:A,onClose:()=>{N(!1)},copy:t.receipt,onSuccess:()=>{W(!0)}}),t.subscribe&&(0,e.jsx)(D.CreditsSubscribeModal,{copy:t.subscribe,onSuccess:()=>{E(!0),setTimeout(()=>{h(!1)},3e3)},isOpen:P,onClose:()=>{h(!1)}})]})};
2
2
  //# sourceMappingURL=CreditsWaysToGetCredits.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.tsx"],
4
- "sourcesContent": ["import { Button, Container, Heading, Picture, Text } from '@anker-in/headless-ui'\nimport { ChevronDownIcon, ChevronUpIcon } from '@heroicons/react/24/outline'\nimport { useEffect, useMemo, useRef, useState } from 'react'\n\nimport { TaskType, type CreditsWaysToGetCreditsProps } from './type'\nimport { useActions } from './useActions'\nimport { useCreditsContext } from '../context/provider'\nimport { classNames as cn, useHeadlessContext } from '@anker-in/lib'\nimport { useRegistration } from '../../registration'\nimport { CreditsUploadReceiptModal } from '../modal/creditsUploadReceiptModal'\nimport { CreditsSubscribeModal } from '../modal/subscribeModal'\nimport { ROUNDED_BRANDS } from '../../../constants'\n\nexport const CreditsWaysToGetCredits = ({ copy, classNames, id }: CreditsWaysToGetCreditsProps & { id?: string }) => {\n const [showMore, setShowMore] = useState(false)\n const containerRef = useRef<HTMLDivElement>(null)\n const { profile } = useCreditsContext()\n const { authCodeActivate } = useRegistration()\n const { brand } = useHeadlessContext()\n const rounded = ROUNDED_BRANDS.includes(brand)\n const isLogin = !!profile\n\n const [isUploadReceiptModalOpen, setIsUploadReceiptModalOpen] = useState(false)\n const [isSubscribeModalOpen, setIsSubscribeModalOpen] = useState(false)\n const [isSubscribeSuccess, setIsSubscribeSuccess] = useState(false)\n const [isUploadReceiptSuccess, setIsUploadReceiptSuccess] = useState(false)\n\n const { actions } = useActions({\n copy,\n subscribe: {\n openSubscribePopup: () => setIsSubscribeModalOpen(true),\n isSuccess: isSubscribeSuccess,\n },\n uploadReceipt: {\n openUploadReceiptPopup: () => setIsUploadReceiptModalOpen(true),\n isSuccess: isUploadReceiptSuccess,\n },\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 useEffect(() => {\n if (!showMore && window.innerWidth < 768) {\n const section = document.getElementById('ways-to-get-credits')\n if (section) {\n const timer = setTimeout(() => {\n section.scrollIntoView({ behavior: 'smooth', block: 'end' })\n }, 300)\n return () => clearTimeout(timer)\n }\n }\n }, [showMore])\n\n return (\n <Container id={id} className=\" bg-[#F5F5F7] [&>div]:l:!px-0\">\n <div\n className={cn(\n '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 !rounded && 'rounded-none'\n )}\n >\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 <div\n ref={containerRef}\n className={cn(\n 'relative mt-[64px] grid grid-cols-3 gap-[16px] overflow-hidden transition-all duration-300 md:mt-[16px] md:grid-cols-1 l:gap-[12px] md-l:mt-[32px] md-l:grid-cols-2',\n showMore ? 'min-md:!h-auto md:h-auto' : 'md:h-[512px] min-md:!h-auto'\n )}\n >\n {list.map(item => (\n <div\n key={item.id}\n className={cn(\n '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 !rounded && 'rounded-none'\n )}\n >\n <div>\n <Text\n as=\"p\"\n html={item.title}\n size={2}\n className=\"text-pretty text-[24px] font-bold xl:text-[20px]\"\n />\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\n as=\"p\"\n html={item.credits}\n size={2}\n className=\"ml-[4px] mt-[6px] text-[18px] l:text-[14px]\"\n />\n </div>\n </div>\n\n {item.handleClick &&\n !(item.id === TaskType.UploadReceipt && isUploadReceiptSuccess) &&\n !(item.id === TaskType.Activate && authCodeActivate.isActivateSuccess) &&\n !(item.id === TaskType.Subscribe && isSubscribeSuccess) ? (\n <Button\n as={item.link ? 'a' : 'button'}\n {...(item.link && { href: item.link })}\n {...(item.handleClick && { onClick: item.handleClick })}\n variant=\"primary\"\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 pointer-events-none min-md:hidden\"\n style={{ background: 'linear-gradient(180deg, rgba(29, 29, 31, 0) 66.37%, #1D1D1F 100%)' }}\n ></div>\n )}\n </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 {copy.receipt && (\n <CreditsUploadReceiptModal\n isOpen={isUploadReceiptModalOpen}\n onClose={() => {\n setIsUploadReceiptModalOpen(false)\n }}\n copy={copy.receipt}\n onSuccess={() => {\n setIsUploadReceiptSuccess(true)\n }}\n />\n )}\n {copy.subscribe && (\n <CreditsSubscribeModal\n copy={copy.subscribe}\n onSuccess={() => {\n setIsSubscribeSuccess(true)\n setTimeout(() => {\n setIsSubscribeModalOpen(false)\n }, 3000)\n }}\n isOpen={isSubscribeModalOpen}\n onClose={() => {\n setIsSubscribeModalOpen(false)\n }}\n />\n )}\n </Container>\n )\n}\n"],
4
+ "sourcesContent": ["import { Button, Container, Heading, Picture, Text } from '@anker-in/headless-ui'\nimport { ChevronDownIcon, ChevronUpIcon } from '@heroicons/react/24/outline'\nimport { useEffect, useMemo, useRef, useState } from 'react'\n\nimport { TaskType, type CreditsWaysToGetCreditsProps } from './type'\nimport { useActions } from './useActions'\nimport { useCreditsContext } from '../context/provider'\nimport { classNames as cn, useHeadlessContext } from '@anker-in/lib'\nimport { useRegistration } from '../../registration'\nimport { CreditsUploadReceiptModal } from '../modal/CreditsUploadReceiptModal'\nimport { CreditsSubscribeModal } from '../modal/SubscribeModal'\nimport { ROUNDED_BRANDS } from '../../../constants'\n\nexport const CreditsWaysToGetCredits = ({ copy, classNames, id }: CreditsWaysToGetCreditsProps & { id?: string }) => {\n const [showMore, setShowMore] = useState(false)\n const containerRef = useRef<HTMLDivElement>(null)\n const { profile } = useCreditsContext()\n const { authCodeActivate } = useRegistration()\n const { brand } = useHeadlessContext()\n const rounded = ROUNDED_BRANDS.includes(brand)\n const isLogin = !!profile\n\n const [isUploadReceiptModalOpen, setIsUploadReceiptModalOpen] = useState(false)\n const [isSubscribeModalOpen, setIsSubscribeModalOpen] = useState(false)\n const [isSubscribeSuccess, setIsSubscribeSuccess] = useState(false)\n const [isUploadReceiptSuccess, setIsUploadReceiptSuccess] = useState(false)\n\n const { actions } = useActions({\n copy,\n subscribe: {\n openSubscribePopup: () => setIsSubscribeModalOpen(true),\n isSuccess: isSubscribeSuccess,\n },\n uploadReceipt: {\n openUploadReceiptPopup: () => setIsUploadReceiptModalOpen(true),\n isSuccess: isUploadReceiptSuccess,\n },\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 useEffect(() => {\n if (!showMore && window.innerWidth < 768) {\n const section = document.getElementById('ways-to-get-credits')\n if (section) {\n const timer = setTimeout(() => {\n section.scrollIntoView({ behavior: 'smooth', block: 'end' })\n }, 300)\n return () => clearTimeout(timer)\n }\n }\n }, [showMore])\n\n return (\n <Container id={id} className=\" bg-[#F5F5F7] [&>div]:l:!px-0\">\n <div\n className={cn(\n '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 !rounded && 'rounded-none'\n )}\n >\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 <div\n ref={containerRef}\n className={cn(\n 'relative mt-[64px] grid grid-cols-3 gap-[16px] overflow-hidden transition-all duration-300 md:mt-[16px] md:grid-cols-1 l:gap-[12px] md-l:mt-[32px] md-l:grid-cols-2',\n showMore ? 'min-md:!h-auto md:h-auto' : 'md:h-[512px] min-md:!h-auto'\n )}\n >\n {list.map(item => (\n <div\n key={item.id}\n className={cn(\n '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 !rounded && 'rounded-none'\n )}\n >\n <div>\n <Text\n as=\"p\"\n html={item.title}\n size={2}\n className=\"text-pretty text-[24px] font-bold xl:text-[20px]\"\n />\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\n as=\"p\"\n html={item.credits}\n size={2}\n className=\"ml-[4px] mt-[6px] text-[18px] l:text-[14px]\"\n />\n </div>\n </div>\n\n {item.handleClick &&\n !(item.id === TaskType.UploadReceipt && isUploadReceiptSuccess) &&\n !(item.id === TaskType.Activate && authCodeActivate.isActivateSuccess) &&\n !(item.id === TaskType.Subscribe && isSubscribeSuccess) ? (\n <Button\n as={item.link ? 'a' : 'button'}\n {...(item.link && { href: item.link })}\n {...(item.handleClick && { onClick: item.handleClick })}\n variant=\"primary\"\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 pointer-events-none min-md:hidden\"\n style={{ background: 'linear-gradient(180deg, rgba(29, 29, 31, 0) 66.37%, #1D1D1F 100%)' }}\n ></div>\n )}\n </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 {copy.receipt && (\n <CreditsUploadReceiptModal\n isOpen={isUploadReceiptModalOpen}\n onClose={() => {\n setIsUploadReceiptModalOpen(false)\n }}\n copy={copy.receipt}\n onSuccess={() => {\n setIsUploadReceiptSuccess(true)\n }}\n />\n )}\n {copy.subscribe && (\n <CreditsSubscribeModal\n copy={copy.subscribe}\n onSuccess={() => {\n setIsSubscribeSuccess(true)\n setTimeout(() => {\n setIsSubscribeModalOpen(false)\n }, 3000)\n }}\n isOpen={isSubscribeModalOpen}\n onClose={() => {\n setIsSubscribeModalOpen(false)\n }}\n />\n )}\n </Container>\n )\n}\n"],
5
5
  "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,6BAAAE,IAAA,eAAAC,EAAAH,GAiHQ,IAAAI,EAAA,6BAjHRC,EAA0D,iCAC1DC,EAA+C,uCAC/CC,EAAqD,iBAErDC,EAA4D,kBAC5DC,EAA2B,wBAC3BC,EAAkC,+BAClCC,EAAqD,yBACrDC,EAAgC,8BAChCC,EAA0C,8CAC1CC,EAAsC,mCACtCC,EAA+B,8BAExB,MAAMb,EAA0B,CAAC,CAAE,KAAAc,EAAM,WAAAC,EAAY,GAAAC,CAAG,IAAsD,CACnH,KAAM,CAACC,EAAUC,CAAW,KAAI,YAAS,EAAK,EACxCC,KAAe,UAAuB,IAAI,EAC1C,CAAE,QAAAC,CAAQ,KAAI,qBAAkB,EAChC,CAAE,iBAAAC,CAAiB,KAAI,mBAAgB,EACvC,CAAE,MAAAC,CAAM,KAAI,sBAAmB,EAC/BC,EAAU,iBAAe,SAASD,CAAK,EACvCE,EAAU,CAAC,CAACJ,EAEZ,CAACK,EAA0BC,CAA2B,KAAI,YAAS,EAAK,EACxE,CAAC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AS,UAAYd,EAAiB,oBACpD,EAAEc,EAAK,KAAO,WAAS,WAAaN,MAClC,OAAC,UACC,GAAIM,EAAK,KAAO,IAAM,SACrB,GAAIA,EAAK,MAAQ,CAAE,KAAMA,EAAK,IAAK,EACnC,GAAIA,EAAK,aAAe,CAAE,QAASA,EAAK,WAAY,EACrD,QAAQ,UACR,KAAK,KACL,UAAU,kBAET,SAAAA,EAAK,YACR,KAEA,OAAC,UAAO,QAAQ,UAAU,KAAK,KAAK,UAAU,kBAAkB,SAAQ,GACrE,SAAAA,EAAK,YACR,IA5CGA,EAAK,EA8CZ,CACD,EACA,CAAClB,MACA,OAAC,OACC,UAAU,qDACV,MAAO,CAAE,WAAY,mEAAoE,EAC1F,GAEL,EACCA,KACC,OAAC,UACC,UAAU,8CACV,QAAS,IAAM,CACbC,EAAY,EAAK,CACnB,EAEA,mBAAC,iBAAc,UAAU,kDAAkD,EAC7E,KAEA,mBACE,mBAAC,OAAI,UAAU,6EACb,mBAAC,UAAO,UAAU,QAAQ,QAAS,IAAMA,EAAY,CAACD,CAAQ,EAC5D,mBAAC,mBAAgB,UAAU,kDAAkD,EAC/E,EACF,EACF,GAEJ,GACF,EACCH,EAAK,YACJ,OAAC,6BACC,OAAQW,EACR,QAAS,IAAM,CACbC,EAA4B,EAAK,CACnC,EACA,KAAMZ,EAAK,QACX,UAAW,IAAM,CACfkB,EAA0B,EAAI,CAChC,EACF,EAEDlB,EAAK,cACJ,OAAC,yBACC,KAAMA,EAAK,UACX,UAAW,IAAM,CACfgB,EAAsB,EAAI,EAC1B,WAAW,IAAM,CACfF,EAAwB,EAAK,CAC/B,EAAG,GAAI,CACT,EACA,OAAQD,EACR,QAAS,IAAM,CACbC,EAAwB,EAAK,CAC/B,EACF,GAEJ,CAEJ",
6
- "names": ["CreditsWaysToGetCredits_exports", "__export", "CreditsWaysToGetCredits", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_outline", "import_react", "import_type", "import_useActions", "import_provider", "import_lib", "import_registration", "import_creditsUploadReceiptModal", "import_subscribeModal", "import_constants", "copy", "classNames", "id", "showMore", "setShowMore", "containerRef", "profile", "authCodeActivate", "brand", "rounded", "isLogin", "isUploadReceiptModalOpen", "setIsUploadReceiptModalOpen", "isSubscribeModalOpen", "setIsSubscribeModalOpen", "isSubscribeSuccess", "setIsSubscribeSuccess", "isUploadReceiptSuccess", "setIsUploadReceiptSuccess", "actions", "list", "item", "finished", "notLogin", "notFinished", "completed", "buttonLabel", "handleClick", "link", "a", "b", "section", "timer", "cn"]
6
+ "names": ["CreditsWaysToGetCredits_exports", "__export", "CreditsWaysToGetCredits", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_outline", "import_react", "import_type", "import_useActions", "import_provider", "import_lib", "import_registration", "import_CreditsUploadReceiptModal", "import_SubscribeModal", "import_constants", "copy", "classNames", "id", "showMore", "setShowMore", "containerRef", "profile", "authCodeActivate", "brand", "rounded", "isLogin", "isUploadReceiptModalOpen", "setIsUploadReceiptModalOpen", "isSubscribeModalOpen", "setIsSubscribeModalOpen", "isSubscribeSuccess", "setIsSubscribeSuccess", "isUploadReceiptSuccess", "setIsUploadReceiptSuccess", "actions", "list", "item", "finished", "notLogin", "notFinished", "completed", "buttonLabel", "handleClick", "link", "a", "b", "section", "timer", "cn"]
7
7
  }
@@ -1,5 +1,5 @@
1
- import type { ReceiptCopy } from '../modal/creditsUploadReceiptModal';
2
- import type { CreditsSubscribeModalCopy } from '../modal/subscribeModal';
1
+ import type { ReceiptCopy } from '../modal/CreditsUploadReceiptModal';
2
+ import type { CreditsSubscribeModalCopy } from '../modal/SubscribeModal';
3
3
  export type BenefitItem = {
4
4
  title: string;
5
5
  credits: string;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/components/credits/creditsWaysToGetCredits/type.ts"],
4
- "sourcesContent": ["import type { ReceiptCopy } from '../modal/creditsUploadReceiptModal'\nimport type { CreditsSubscribeModalCopy } from '../modal/subscribeModal'\n\nexport type BenefitItem = {\n title: string\n credits: string\n id: string\n}\n\nexport type CreditsWaysToGetCreditsCopy = {\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 subscribeLabel: string\n sendEmailSuccess: string\n creditsIcon: {\n url: string\n alt: string\n }\n receipt: ReceiptCopy\n subscribe: CreditsSubscribeModalCopy\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: CreditsWaysToGetCreditsCopy\n classNames?: {\n equalCreditsText?: string\n subtitle?: string\n }\n}\n"],
4
+ "sourcesContent": ["import type { ReceiptCopy } from '../modal/CreditsUploadReceiptModal'\nimport type { CreditsSubscribeModalCopy } from '../modal/SubscribeModal'\n\nexport type BenefitItem = {\n title: string\n credits: string\n id: string\n}\n\nexport type CreditsWaysToGetCreditsCopy = {\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 subscribeLabel: string\n sendEmailSuccess: string\n creditsIcon: {\n url: string\n alt: string\n }\n receipt: ReceiptCopy\n subscribe: CreditsSubscribeModalCopy\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: CreditsWaysToGetCreditsCopy\n classNames?: {\n equalCreditsText?: string\n subtitle?: string\n }\n}\n"],
5
5
  "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,cAAAE,IAAA,eAAAC,EAAAH,GAqCO,IAAKE,OACVA,EAAA,SAAW,WACXA,EAAA,UAAY,YACZA,EAAA,gBAAkB,kBAClBA,EAAA,cAAgB,gBAChBA,EAAA,cAAgB,gBAChBA,EAAA,KAAO,OANGA,OAAA",
6
6
  "names": ["type_exports", "__export", "TaskType", "__toCommonJS"]
7
7
  }
@@ -1,6 +1,6 @@
1
1
  export { CreditsProvider, useCreditsContext } from './context/provider';
2
2
  export { useUploadReceipt as useCreditsUploadReceipt } from './context/hooks/useUploadReceipt';
3
- export { CreditsUploadReceiptModal } from './modal/creditsUploadReceiptModal';
3
+ export { CreditsUploadReceiptModal } from './modal/CreditsUploadReceiptModal';
4
4
  export { CreditsBanner } from './creditsBanner';
5
5
  export { CreditsBenefits } from './creditsBenefits';
6
6
  export { CreditsInfoCard } from './creditsInfoCard';
@@ -8,3 +8,4 @@ export { CreditsWaysToGetCredits } from './creditsWaysToGetCredits';
8
8
  export { CreditsFaq } from './creditsFaq';
9
9
  export { CreditsCash } from './creditsCash';
10
10
  export { CreditsRedeemList } from './creditsRedeemList';
11
+ export { CreditsGoGift } from './creditsGoGift';
@@ -1,2 +1,2 @@
1
- "use strict";var d=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var U=Object.prototype.hasOwnProperty;var B=(r,e)=>{for(var o in e)d(r,o,{get:e[o],enumerable:!0})},h=(r,e,o,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of u(e))!U.call(r,t)&&t!==o&&d(r,t,{get:()=>e[t],enumerable:!(i=c(e,t))||i.enumerable});return r};var q=r=>h(d({},"__esModule",{value:!0}),r);var v={};B(v,{CreditsBanner:()=>f.CreditsBanner,CreditsBenefits:()=>m.CreditsBenefits,CreditsCash:()=>l.CreditsCash,CreditsFaq:()=>n.CreditsFaq,CreditsInfoCard:()=>x.CreditsInfoCard,CreditsProvider:()=>s.CreditsProvider,CreditsRedeemList:()=>R.CreditsRedeemList,CreditsUploadReceiptModal:()=>C.CreditsUploadReceiptModal,CreditsWaysToGetCredits:()=>a.CreditsWaysToGetCredits,useCreditsContext:()=>s.useCreditsContext,useCreditsUploadReceipt:()=>p.useUploadReceipt});module.exports=q(v);var s=require("./context/provider"),p=require("./context/hooks/useUploadReceipt"),C=require("./modal/creditsUploadReceiptModal"),f=require("./creditsBanner"),m=require("./creditsBenefits"),x=require("./creditsInfoCard"),a=require("./creditsWaysToGetCredits"),n=require("./creditsFaq"),l=require("./creditsCash"),R=require("./creditsRedeemList");
1
+ "use strict";var d=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var G=Object.getOwnPropertyNames;var U=Object.prototype.hasOwnProperty;var B=(r,e)=>{for(var o in e)d(r,o,{get:e[o],enumerable:!0})},h=(r,e,o,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of G(e))!U.call(r,t)&&t!==o&&d(r,t,{get:()=>e[t],enumerable:!(i=u(e,t))||i.enumerable});return r};var q=r=>h(d({},"__esModule",{value:!0}),r);var v={};B(v,{CreditsBanner:()=>f.CreditsBanner,CreditsBenefits:()=>m.CreditsBenefits,CreditsCash:()=>l.CreditsCash,CreditsFaq:()=>n.CreditsFaq,CreditsGoGift:()=>c.CreditsGoGift,CreditsInfoCard:()=>x.CreditsInfoCard,CreditsProvider:()=>s.CreditsProvider,CreditsRedeemList:()=>R.CreditsRedeemList,CreditsUploadReceiptModal:()=>C.CreditsUploadReceiptModal,CreditsWaysToGetCredits:()=>a.CreditsWaysToGetCredits,useCreditsContext:()=>s.useCreditsContext,useCreditsUploadReceipt:()=>p.useUploadReceipt});module.exports=q(v);var s=require("./context/provider"),p=require("./context/hooks/useUploadReceipt"),C=require("./modal/CreditsUploadReceiptModal"),f=require("./creditsBanner"),m=require("./creditsBenefits"),x=require("./creditsInfoCard"),a=require("./creditsWaysToGetCredits"),n=require("./creditsFaq"),l=require("./creditsCash"),R=require("./creditsRedeemList"),c=require("./creditsGoGift");
2
2
  //# sourceMappingURL=index.js.map