@anker-in/campaign-ui 0.2.10-beta.9 → 0.2.11-beta.3

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 (918) hide show
  1. package/dist/cjs/components/chat/{chat-context.js → chatContext.js} +1 -1
  2. package/dist/cjs/components/chat/{chat-context.js.map → chatContext.js.map} +2 -2
  3. package/dist/cjs/components/chat/index.js +1 -1
  4. package/dist/cjs/components/chat/index.js.map +3 -3
  5. package/dist/cjs/components/credits/context/const.d.ts +2 -1
  6. package/dist/cjs/components/credits/context/const.js +1 -1
  7. package/dist/cjs/components/credits/context/const.js.map +2 -2
  8. package/dist/cjs/components/credits/context/hooks/useActivities.js +1 -1
  9. package/dist/cjs/components/credits/context/hooks/useActivities.js.map +3 -3
  10. package/dist/cjs/components/credits/context/hooks/useAddressValidate.js +1 -1
  11. package/dist/cjs/components/credits/context/hooks/useAddressValidate.js.map +3 -3
  12. package/dist/cjs/components/credits/context/hooks/useAlpcFetch.js +1 -1
  13. package/dist/cjs/components/credits/context/hooks/useAlpcFetch.js.map +3 -3
  14. package/dist/cjs/components/credits/context/hooks/useCountries.js +1 -1
  15. package/dist/cjs/components/credits/context/hooks/useCountries.js.map +3 -3
  16. package/dist/cjs/components/credits/context/hooks/useFunctionMemberPrice.d.ts +7 -0
  17. package/dist/cjs/components/credits/context/hooks/useFunctionMemberPrice.js +2 -0
  18. package/dist/cjs/components/credits/context/hooks/useFunctionMemberPrice.js.map +7 -0
  19. package/dist/cjs/components/credits/context/hooks/useMyRewards.js +1 -1
  20. package/dist/cjs/components/credits/context/hooks/useMyRewards.js.map +3 -3
  21. package/dist/cjs/components/credits/context/hooks/useRedeemAndBuy.d.ts +5 -10
  22. package/dist/cjs/components/credits/context/hooks/useRedeemAndBuy.js +1 -1
  23. package/dist/cjs/components/credits/context/hooks/useRedeemAndBuy.js.map +3 -3
  24. package/dist/cjs/components/credits/context/hooks/useRedeemCoupon.d.ts +2 -1
  25. package/dist/cjs/components/credits/context/hooks/useRedeemCoupon.js +1 -1
  26. package/dist/cjs/components/credits/context/hooks/useRedeemCoupon.js.map +3 -3
  27. package/dist/cjs/components/credits/context/hooks/useRedeemProduct.js +1 -1
  28. package/dist/cjs/components/credits/context/hooks/useRedeemProduct.js.map +3 -3
  29. package/dist/cjs/components/credits/context/hooks/useRedeemableList.js +1 -1
  30. package/dist/cjs/components/credits/context/hooks/useRedeemableList.js.map +3 -3
  31. package/dist/cjs/components/credits/context/hooks/useSendEmailValidation.js +1 -1
  32. package/dist/cjs/components/credits/context/hooks/useSendEmailValidation.js.map +3 -3
  33. package/dist/cjs/components/credits/context/hooks/useSubscribed.js +1 -1
  34. package/dist/cjs/components/credits/context/hooks/useSubscribed.js.map +3 -3
  35. package/dist/cjs/components/credits/context/hooks/useSubscriptions.d.ts +7 -3
  36. package/dist/cjs/components/credits/context/hooks/useSubscriptions.js +1 -1
  37. package/dist/cjs/components/credits/context/hooks/useSubscriptions.js.map +3 -3
  38. package/dist/cjs/components/credits/context/hooks/useUploadReceipt.js +1 -1
  39. package/dist/cjs/components/credits/context/hooks/useUploadReceipt.js.map +2 -2
  40. package/dist/cjs/components/credits/context/memberPriceConst.d.ts +10 -0
  41. package/dist/cjs/components/credits/context/memberPriceConst.js +2 -0
  42. package/dist/cjs/components/credits/context/memberPriceConst.js.map +7 -0
  43. package/dist/cjs/components/credits/context/memberPriceTypes.d.ts +46 -0
  44. package/dist/cjs/components/credits/context/memberPriceTypes.js +2 -0
  45. package/dist/cjs/components/credits/context/memberPriceTypes.js.map +7 -0
  46. package/dist/cjs/components/credits/context/provider.d.ts +11 -33
  47. package/dist/cjs/components/credits/context/provider.js +1 -1
  48. package/dist/cjs/components/credits/context/provider.js.map +3 -3
  49. package/dist/cjs/components/credits/context/utils/atobID.d.ts +1 -0
  50. package/dist/cjs/components/credits/context/utils/atobID.js +2 -0
  51. package/dist/cjs/components/credits/context/utils/atobID.js.map +7 -0
  52. package/dist/cjs/components/credits/context/utils/functionDiscountCalculate.d.ts +5 -0
  53. package/dist/cjs/components/credits/context/utils/functionDiscountCalculate.js +2 -0
  54. package/dist/cjs/components/credits/context/utils/functionDiscountCalculate.js.map +7 -0
  55. package/dist/cjs/components/credits/context/utils/getFunctionMemberPrice.d.ts +8 -0
  56. package/dist/cjs/components/credits/context/utils/getFunctionMemberPrice.js +2 -0
  57. package/dist/cjs/components/credits/context/utils/getFunctionMemberPrice.js.map +7 -0
  58. package/dist/cjs/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.d.ts +9 -0
  59. package/dist/cjs/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.js +2 -0
  60. package/dist/cjs/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.js.map +7 -0
  61. package/dist/cjs/components/credits/context/utils/variantGetCoupon.d.ts +6 -0
  62. package/dist/cjs/components/credits/context/utils/variantGetCoupon.js +2 -0
  63. package/dist/cjs/components/credits/context/utils/variantGetCoupon.js.map +7 -0
  64. package/dist/cjs/components/credits/context/utils.d.ts +4 -0
  65. package/dist/cjs/components/credits/context/utils.js +1 -1
  66. package/dist/cjs/components/credits/context/utils.js.map +3 -3
  67. package/dist/cjs/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.d.ts +4 -0
  68. package/dist/cjs/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.js +2 -0
  69. package/dist/cjs/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.js.map +7 -0
  70. package/dist/cjs/components/credits/creditsAnkersolixTask/index.d.ts +2 -0
  71. package/dist/cjs/components/credits/creditsAnkersolixTask/index.js +2 -0
  72. package/dist/cjs/components/credits/creditsAnkersolixTask/index.js.map +7 -0
  73. package/dist/cjs/components/credits/creditsAnkersolixTask/type.d.ts +1 -0
  74. package/dist/cjs/components/credits/creditsAnkersolixTask/type.js +2 -0
  75. package/dist/cjs/components/credits/creditsAnkersolixTask/type.js.map +7 -0
  76. package/dist/cjs/components/credits/creditsBanner/index.d.ts +17 -16
  77. package/dist/cjs/components/credits/creditsBanner/index.js +2 -0
  78. package/dist/cjs/components/credits/creditsBanner/index.js.map +7 -0
  79. package/dist/cjs/components/credits/creditsBenefits/benefitItem.d.ts +4 -1
  80. package/dist/cjs/components/credits/creditsBenefits/benefitItem.js +2 -0
  81. package/dist/cjs/components/credits/creditsBenefits/benefitItem.js.map +7 -0
  82. package/dist/cjs/components/credits/{credits-benefits → creditsBenefits}/iconInfo.js +1 -1
  83. package/dist/cjs/components/credits/{credits-benefits → creditsBenefits}/iconInfo.js.map +2 -2
  84. package/dist/cjs/components/credits/creditsBenefits/index.d.ts +12 -9
  85. package/dist/cjs/components/credits/creditsBenefits/index.js +4 -0
  86. package/dist/cjs/components/credits/creditsBenefits/index.js.map +7 -0
  87. package/dist/cjs/components/credits/creditsCash/CreditsCash.d.ts +5 -0
  88. package/dist/cjs/components/credits/creditsCash/CreditsCash.js +2 -0
  89. package/dist/cjs/components/credits/creditsCash/CreditsCash.js.map +7 -0
  90. package/dist/cjs/components/credits/creditsCash/RedeemableItem.d.ts +1 -7
  91. package/dist/cjs/components/credits/creditsCash/RedeemableItem.js +2 -0
  92. package/dist/cjs/components/credits/creditsCash/RedeemableItem.js.map +7 -0
  93. package/dist/cjs/components/credits/creditsCash/index.d.ts +2 -13
  94. package/dist/cjs/components/credits/creditsCash/index.js +2 -0
  95. package/dist/cjs/components/credits/creditsCash/index.js.map +7 -0
  96. package/dist/cjs/components/credits/creditsCash/type.d.ts +2 -4
  97. package/dist/cjs/components/credits/creditsCash/type.js +2 -0
  98. package/dist/cjs/components/credits/creditsCash/type.js.map +7 -0
  99. package/dist/cjs/components/credits/creditsFaq/faqItem/FaqItem.js +2 -0
  100. package/dist/cjs/components/credits/creditsFaq/faqItem/FaqItem.js.map +7 -0
  101. package/dist/cjs/components/credits/creditsFaq/index.d.ts +4 -3
  102. package/dist/cjs/components/credits/creditsFaq/index.js +2 -0
  103. package/dist/cjs/components/credits/creditsFaq/index.js.map +7 -0
  104. package/dist/cjs/components/credits/creditsInfoCard/index.d.ts +10 -15
  105. package/dist/cjs/components/credits/creditsInfoCard/index.js +2 -0
  106. package/dist/cjs/components/credits/creditsInfoCard/index.js.map +7 -0
  107. package/dist/cjs/components/credits/creditsMemberPrice/CreditsMemberPrice.d.ts +5 -0
  108. package/dist/cjs/components/credits/creditsMemberPrice/CreditsMemberPrice.js +2 -0
  109. package/dist/cjs/components/credits/creditsMemberPrice/CreditsMemberPrice.js.map +7 -0
  110. package/dist/cjs/components/credits/creditsMemberPrice/MemberPriceItem.d.ts +7 -0
  111. package/dist/cjs/components/credits/creditsMemberPrice/MemberPriceItem.js +2 -0
  112. package/dist/cjs/components/credits/creditsMemberPrice/MemberPriceItem.js.map +7 -0
  113. package/dist/cjs/components/credits/creditsMemberPrice/Pagination.d.ts +7 -0
  114. package/dist/cjs/components/credits/creditsMemberPrice/Pagination.js +2 -0
  115. package/dist/cjs/components/credits/creditsMemberPrice/Pagination.js.map +7 -0
  116. package/dist/cjs/components/credits/creditsMemberPrice/index.d.ts +2 -0
  117. package/dist/cjs/components/credits/creditsMemberPrice/index.js +2 -0
  118. package/dist/cjs/components/credits/creditsMemberPrice/index.js.map +7 -0
  119. package/dist/cjs/components/credits/creditsMemberPrice/type.d.ts +64 -0
  120. package/dist/cjs/components/credits/creditsMemberPrice/type.js +2 -0
  121. package/dist/cjs/components/credits/creditsMemberPrice/type.js.map +7 -0
  122. package/dist/cjs/components/credits/creditsNavigation/CreditsNavigation.d.ts +4 -0
  123. package/dist/cjs/components/credits/creditsNavigation/CreditsNavigation.js +2 -0
  124. package/dist/cjs/components/credits/creditsNavigation/CreditsNavigation.js.map +7 -0
  125. package/dist/cjs/components/credits/creditsNavigation/index.d.ts +2 -0
  126. package/dist/cjs/components/credits/creditsNavigation/index.js +2 -0
  127. package/dist/cjs/components/credits/creditsNavigation/index.js.map +7 -0
  128. package/dist/cjs/components/credits/creditsNavigation/type.d.ts +7 -0
  129. package/dist/cjs/components/credits/creditsNavigation/type.js +2 -0
  130. package/dist/cjs/components/credits/creditsNavigation/type.js.map +7 -0
  131. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/CountrySelect.js +2 -0
  132. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/CountrySelect.js.map +7 -0
  133. package/dist/cjs/components/credits/{credits-redeem-list/address-form/form-item.js → creditsRedeemList/AddressForm/FormItem.js} +1 -1
  134. package/dist/cjs/components/credits/{credits-redeem-list/address-form/form-item.js.map → creditsRedeemList/AddressForm/FormItem.js.map} +2 -2
  135. package/dist/cjs/components/credits/{credits-redeem-list/address-form → creditsRedeemList/AddressForm}/Input.js.map +1 -1
  136. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/StateSelect.js +2 -0
  137. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/StateSelect.js.map +7 -0
  138. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/index.js +2 -0
  139. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/index.js.map +7 -0
  140. package/dist/cjs/components/credits/{credits-redeem-list/address-form → creditsRedeemList/AddressForm}/type.js.map +1 -1
  141. package/dist/cjs/components/credits/creditsRedeemList/CreditsRedeemList.d.ts +5 -0
  142. package/dist/cjs/components/credits/creditsRedeemList/CreditsRedeemList.js +2 -0
  143. package/dist/cjs/components/credits/creditsRedeemList/CreditsRedeemList.js.map +7 -0
  144. package/dist/cjs/components/credits/creditsRedeemList/NonProductValue.d.ts +4 -0
  145. package/dist/cjs/components/credits/creditsRedeemList/NonProductValue.js +2 -0
  146. package/dist/cjs/components/credits/creditsRedeemList/NonProductValue.js.map +7 -0
  147. package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.js +2 -0
  148. package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.js.map +7 -0
  149. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.js +2 -0
  150. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.js.map +7 -0
  151. package/dist/cjs/components/credits/{credits-redeem-list/redeem-product-modal → creditsRedeemList/RedeemProductModal}/Error.js +1 -1
  152. package/dist/cjs/components/credits/{credits-redeem-list/redeem-product-modal → creditsRedeemList/RedeemProductModal}/Error.js.map +3 -3
  153. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Init.js +2 -0
  154. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Init.js.map +7 -0
  155. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.d.ts +6 -0
  156. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js +2 -0
  157. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js.map +7 -0
  158. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js +2 -0
  159. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js.map +7 -0
  160. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.js +2 -0
  161. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.js.map +7 -0
  162. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.js +2 -0
  163. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.js.map +7 -0
  164. package/dist/cjs/components/credits/creditsRedeemList/RedeemableItem.js +2 -0
  165. package/dist/cjs/components/credits/creditsRedeemList/RedeemableItem.js.map +7 -0
  166. package/dist/cjs/components/credits/creditsRedeemList/index.d.ts +2 -13
  167. package/dist/cjs/components/credits/creditsRedeemList/index.js +2 -0
  168. package/dist/cjs/components/credits/creditsRedeemList/index.js.map +7 -0
  169. package/dist/cjs/components/credits/creditsRedeemList/type.d.ts +2 -15
  170. package/dist/cjs/components/credits/creditsRedeemList/type.js.map +7 -0
  171. package/dist/cjs/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.d.ts +4 -0
  172. package/dist/cjs/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js +2 -0
  173. package/dist/cjs/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js.map +7 -0
  174. package/dist/cjs/components/credits/creditsWaysToGetCredits/index.d.ts +2 -2
  175. package/dist/cjs/components/credits/creditsWaysToGetCredits/index.js +2 -0
  176. package/dist/cjs/components/credits/creditsWaysToGetCredits/index.js.map +7 -0
  177. package/dist/cjs/components/credits/creditsWaysToGetCredits/type.d.ts +5 -16
  178. package/dist/cjs/components/credits/creditsWaysToGetCredits/type.js +2 -0
  179. package/dist/cjs/components/credits/creditsWaysToGetCredits/type.js.map +7 -0
  180. package/dist/cjs/components/credits/creditsWaysToGetCredits/useActions.d.ts +11 -2
  181. package/dist/cjs/components/credits/creditsWaysToGetCredits/useActions.js +2 -0
  182. package/dist/cjs/components/credits/creditsWaysToGetCredits/useActions.js.map +7 -0
  183. package/dist/cjs/components/credits/modal/MyRewardsModal.d.ts +4 -1
  184. package/dist/cjs/components/credits/modal/MyRewardsModal.js +1 -1
  185. package/dist/cjs/components/credits/modal/MyRewardsModal.js.map +3 -3
  186. package/dist/cjs/components/credits/modal/activitiesModal.d.ts +4 -1
  187. package/dist/cjs/components/credits/modal/activitiesModal.js +1 -1
  188. package/dist/cjs/components/credits/modal/activitiesModal.js.map +3 -3
  189. package/dist/cjs/components/credits/modal/creditsUploadReceiptModal.js +1 -1
  190. package/dist/cjs/components/credits/modal/creditsUploadReceiptModal.js.map +3 -3
  191. package/dist/cjs/components/credits/modal/loadingDots.d.ts +2 -1
  192. package/dist/cjs/components/credits/modal/loadingDots.js +1 -1
  193. package/dist/cjs/components/credits/modal/loadingDots.js.map +3 -3
  194. package/dist/cjs/components/credits/modal/modalContainer.js +1 -1
  195. package/dist/cjs/components/credits/modal/modalContainer.js.map +3 -3
  196. package/dist/cjs/components/credits/modal/rulesModal.js +1 -1
  197. package/dist/cjs/components/credits/modal/rulesModal.js.map +3 -3
  198. package/dist/cjs/components/credits/modal/subscribeModal.d.ts +15 -0
  199. package/dist/cjs/components/credits/modal/subscribeModal.js +2 -0
  200. package/dist/cjs/components/credits/modal/subscribeModal.js.map +7 -0
  201. package/dist/cjs/components/credits/modal/tip.js +1 -1
  202. package/dist/cjs/components/credits/modal/tip.js.map +3 -3
  203. package/dist/cjs/components/credits/type.d.ts +24 -5
  204. package/dist/cjs/components/credits/type.js +1 -1
  205. package/dist/cjs/components/credits/type.js.map +1 -1
  206. package/dist/cjs/components/index.d.ts +2 -1
  207. package/dist/cjs/components/index.js +1 -1
  208. package/dist/cjs/components/index.js.map +2 -2
  209. package/dist/cjs/components/registration/authCodeActivate/Message.d.ts +4 -0
  210. package/dist/cjs/components/registration/authCodeActivate/Message.js +2 -0
  211. package/dist/cjs/components/registration/authCodeActivate/Message.js.map +7 -0
  212. package/dist/cjs/components/registration/authCodeActivate/index.d.ts +3 -0
  213. package/dist/cjs/components/registration/authCodeActivate/index.js +2 -0
  214. package/dist/cjs/components/registration/authCodeActivate/index.js.map +7 -0
  215. package/dist/cjs/components/registration/authCodeActivate/type.d.ts +22 -0
  216. package/dist/cjs/components/registration/authCodeActivate/type.js +2 -0
  217. package/dist/cjs/components/registration/authCodeActivate/type.js.map +7 -0
  218. package/dist/cjs/components/registration/context/index.d.ts +1 -0
  219. package/dist/cjs/components/registration/context/index.js +2 -0
  220. package/dist/cjs/components/registration/context/index.js.map +7 -0
  221. package/dist/cjs/components/registration/context/provider.d.ts +27 -0
  222. package/dist/cjs/components/registration/context/provider.js +2 -0
  223. package/dist/cjs/components/registration/context/provider.js.map +7 -0
  224. package/dist/cjs/components/registration/index.d.ts +2 -0
  225. package/dist/cjs/components/registration/index.js +2 -0
  226. package/dist/cjs/components/registration/index.js.map +7 -0
  227. package/dist/cjs/components/registration/modalContainer.d.ts +14 -0
  228. package/dist/cjs/components/registration/modalContainer.js +2 -0
  229. package/dist/cjs/components/registration/modalContainer.js.map +7 -0
  230. package/dist/cjs/constants.d.ts +1 -0
  231. package/dist/cjs/constants.js +2 -0
  232. package/dist/cjs/constants.js.map +7 -0
  233. package/dist/cjs/debug-env.js +2 -0
  234. package/dist/cjs/debug-env.js.map +7 -0
  235. package/dist/cjs/helpers/fetcher.d.ts +1 -1
  236. package/dist/cjs/helpers/fetcher.js +1 -1
  237. package/dist/cjs/helpers/fetcher.js.map +3 -3
  238. package/dist/cjs/helpers/index.d.ts +2 -2
  239. package/dist/cjs/helpers/index.js +1 -1
  240. package/dist/cjs/helpers/index.js.map +2 -2
  241. package/dist/cjs/helpers/track.d.ts +6 -2
  242. package/dist/cjs/helpers/track.js +1 -1
  243. package/dist/cjs/helpers/track.js.map +3 -3
  244. package/dist/cjs/index.d.ts +3 -2
  245. package/dist/cjs/index.js +1 -726
  246. package/dist/cjs/index.js.map +4 -4
  247. package/dist/cjs/stories/chat.stories.js +2 -0
  248. package/dist/cjs/stories/chat.stories.js.map +7 -0
  249. package/dist/cjs/templates/credits.d.ts +73 -0
  250. package/dist/cjs/templates/credits.js +2 -0
  251. package/dist/cjs/templates/credits.js.map +7 -0
  252. package/dist/cjs/templates/index.d.ts +1 -0
  253. package/dist/cjs/templates/index.js +2 -0
  254. package/dist/cjs/templates/index.js.map +7 -0
  255. package/dist/esm/components/chat/index.js +1 -1
  256. package/dist/esm/components/chat/index.js.map +2 -2
  257. package/dist/esm/components/credits/context/const.d.ts +2 -1
  258. package/dist/esm/components/credits/context/const.js +1 -1
  259. package/dist/esm/components/credits/context/const.js.map +2 -2
  260. package/dist/esm/components/credits/context/hooks/useActivities.js +1 -1
  261. package/dist/esm/components/credits/context/hooks/useActivities.js.map +3 -3
  262. package/dist/esm/components/credits/context/hooks/useAddressValidate.js +1 -1
  263. package/dist/esm/components/credits/context/hooks/useAddressValidate.js.map +3 -3
  264. package/dist/esm/components/credits/context/hooks/useAlpcFetch.js +1 -1
  265. package/dist/esm/components/credits/context/hooks/useAlpcFetch.js.map +3 -3
  266. package/dist/esm/components/credits/context/hooks/useCountries.js +1 -1
  267. package/dist/esm/components/credits/context/hooks/useCountries.js.map +3 -3
  268. package/dist/esm/components/credits/context/hooks/useFunctionMemberPrice.d.ts +7 -0
  269. package/dist/esm/components/credits/context/hooks/useFunctionMemberPrice.js +2 -0
  270. package/dist/esm/components/credits/context/hooks/useFunctionMemberPrice.js.map +7 -0
  271. package/dist/esm/components/credits/context/hooks/useMyRewards.js +1 -1
  272. package/dist/esm/components/credits/context/hooks/useMyRewards.js.map +3 -3
  273. package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.d.ts +5 -10
  274. package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.js +1 -1
  275. package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.js.map +3 -3
  276. package/dist/esm/components/credits/context/hooks/useRedeemCoupon.d.ts +2 -1
  277. package/dist/esm/components/credits/context/hooks/useRedeemCoupon.js +1 -1
  278. package/dist/esm/components/credits/context/hooks/useRedeemCoupon.js.map +3 -3
  279. package/dist/esm/components/credits/context/hooks/useRedeemProduct.js +1 -1
  280. package/dist/esm/components/credits/context/hooks/useRedeemProduct.js.map +3 -3
  281. package/dist/esm/components/credits/context/hooks/useRedeemableList.js +1 -1
  282. package/dist/esm/components/credits/context/hooks/useRedeemableList.js.map +3 -3
  283. package/dist/esm/components/credits/context/hooks/useSendEmailValidation.js +1 -1
  284. package/dist/esm/components/credits/context/hooks/useSendEmailValidation.js.map +3 -3
  285. package/dist/esm/components/credits/context/hooks/useSubscribed.js +1 -1
  286. package/dist/esm/components/credits/context/hooks/useSubscribed.js.map +3 -3
  287. package/dist/esm/components/credits/context/hooks/useSubscriptions.d.ts +7 -3
  288. package/dist/esm/components/credits/context/hooks/useSubscriptions.js +1 -1
  289. package/dist/esm/components/credits/context/hooks/useSubscriptions.js.map +3 -3
  290. package/dist/esm/components/credits/context/hooks/useUploadReceipt.js +1 -1
  291. package/dist/esm/components/credits/context/hooks/useUploadReceipt.js.map +2 -2
  292. package/dist/esm/components/credits/context/memberPriceConst.d.ts +10 -0
  293. package/dist/esm/components/credits/context/memberPriceConst.js +2 -0
  294. package/dist/esm/components/credits/context/memberPriceConst.js.map +7 -0
  295. package/dist/esm/components/credits/context/memberPriceTypes.d.ts +46 -0
  296. package/dist/esm/components/credits/context/memberPriceTypes.js +1 -0
  297. package/dist/esm/components/credits/context/provider.d.ts +11 -33
  298. package/dist/esm/components/credits/context/provider.js +1 -1
  299. package/dist/esm/components/credits/context/provider.js.map +3 -3
  300. package/dist/esm/components/credits/context/utils/atobID.d.ts +1 -0
  301. package/dist/esm/components/credits/context/utils/atobID.js +2 -0
  302. package/dist/esm/components/credits/context/utils/atobID.js.map +7 -0
  303. package/dist/esm/components/credits/context/utils/functionDiscountCalculate.d.ts +5 -0
  304. package/dist/esm/components/credits/context/utils/functionDiscountCalculate.js +2 -0
  305. package/dist/esm/components/credits/context/utils/functionDiscountCalculate.js.map +7 -0
  306. package/dist/esm/components/credits/context/utils/getFunctionMemberPrice.d.ts +8 -0
  307. package/dist/esm/components/credits/context/utils/getFunctionMemberPrice.js +2 -0
  308. package/dist/esm/components/credits/context/utils/getFunctionMemberPrice.js.map +7 -0
  309. package/dist/esm/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.d.ts +9 -0
  310. package/dist/esm/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.js +2 -0
  311. package/dist/esm/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.js.map +7 -0
  312. package/dist/esm/components/credits/context/utils/variantGetCoupon.d.ts +6 -0
  313. package/dist/esm/components/credits/context/utils/variantGetCoupon.js +2 -0
  314. package/dist/esm/components/credits/context/utils/variantGetCoupon.js.map +7 -0
  315. package/dist/esm/components/credits/context/utils.d.ts +4 -0
  316. package/dist/esm/components/credits/context/utils.js +1 -1
  317. package/dist/esm/components/credits/context/utils.js.map +3 -3
  318. package/dist/esm/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.d.ts +4 -0
  319. package/dist/esm/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.js +2 -0
  320. package/dist/esm/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.js.map +7 -0
  321. package/dist/esm/components/credits/creditsAnkersolixTask/index.d.ts +2 -0
  322. package/dist/esm/components/credits/creditsAnkersolixTask/index.js +2 -0
  323. package/dist/esm/components/credits/creditsAnkersolixTask/index.js.map +7 -0
  324. package/dist/esm/components/credits/creditsAnkersolixTask/type.d.ts +1 -0
  325. package/dist/esm/components/credits/creditsAnkersolixTask/type.js +2 -0
  326. package/dist/esm/components/credits/creditsAnkersolixTask/type.js.map +7 -0
  327. package/dist/esm/components/credits/creditsBanner/index.d.ts +17 -16
  328. package/dist/esm/components/credits/creditsBanner/index.js +1 -1
  329. package/dist/esm/components/credits/creditsBanner/index.js.map +3 -3
  330. package/dist/esm/components/credits/creditsBenefits/benefitItem.d.ts +4 -1
  331. package/dist/esm/components/credits/creditsBenefits/benefitItem.js +2 -2
  332. package/dist/esm/components/credits/creditsBenefits/benefitItem.js.map +4 -4
  333. package/dist/esm/components/credits/creditsBenefits/iconInfo.js +1 -1
  334. package/dist/esm/components/credits/creditsBenefits/iconInfo.js.map +2 -2
  335. package/dist/esm/components/credits/creditsBenefits/index.d.ts +12 -9
  336. package/dist/esm/components/credits/creditsBenefits/index.js +3 -3
  337. package/dist/esm/components/credits/creditsBenefits/index.js.map +3 -3
  338. package/dist/esm/components/credits/creditsCash/CreditsCash.d.ts +5 -0
  339. package/dist/esm/components/credits/creditsCash/CreditsCash.js +2 -0
  340. package/dist/esm/components/credits/creditsCash/CreditsCash.js.map +7 -0
  341. package/dist/esm/components/credits/creditsCash/RedeemableItem.d.ts +1 -7
  342. package/dist/esm/components/credits/creditsCash/RedeemableItem.js +1 -1
  343. package/dist/esm/components/credits/creditsCash/RedeemableItem.js.map +3 -3
  344. package/dist/esm/components/credits/creditsCash/index.d.ts +2 -13
  345. package/dist/esm/components/credits/creditsCash/index.js +1 -1
  346. package/dist/esm/components/credits/creditsCash/index.js.map +4 -4
  347. package/dist/esm/components/credits/creditsCash/type.d.ts +2 -4
  348. package/dist/esm/components/credits/creditsFaq/faqItem/FaqItem.js +1 -1
  349. package/dist/esm/components/credits/creditsFaq/faqItem/FaqItem.js.map +2 -2
  350. package/dist/esm/components/credits/creditsFaq/index.d.ts +4 -3
  351. package/dist/esm/components/credits/creditsFaq/index.js +1 -1
  352. package/dist/esm/components/credits/creditsFaq/index.js.map +3 -3
  353. package/dist/esm/components/credits/creditsInfoCard/index.d.ts +10 -15
  354. package/dist/esm/components/credits/creditsInfoCard/index.js +1 -1
  355. package/dist/esm/components/credits/creditsInfoCard/index.js.map +3 -3
  356. package/dist/esm/components/credits/creditsMemberPrice/CreditsMemberPrice.d.ts +5 -0
  357. package/dist/esm/components/credits/creditsMemberPrice/CreditsMemberPrice.js +2 -0
  358. package/dist/esm/components/credits/creditsMemberPrice/CreditsMemberPrice.js.map +7 -0
  359. package/dist/esm/components/credits/creditsMemberPrice/MemberPriceItem.d.ts +7 -0
  360. package/dist/esm/components/credits/creditsMemberPrice/MemberPriceItem.js +2 -0
  361. package/dist/esm/components/credits/creditsMemberPrice/MemberPriceItem.js.map +7 -0
  362. package/dist/esm/components/credits/creditsMemberPrice/Pagination.d.ts +7 -0
  363. package/dist/esm/components/credits/creditsMemberPrice/Pagination.js +2 -0
  364. package/dist/esm/components/credits/creditsMemberPrice/Pagination.js.map +7 -0
  365. package/dist/esm/components/credits/creditsMemberPrice/index.d.ts +2 -0
  366. package/dist/esm/components/credits/creditsMemberPrice/index.js +2 -0
  367. package/dist/esm/components/credits/creditsMemberPrice/index.js.map +7 -0
  368. package/dist/esm/components/credits/creditsMemberPrice/type.d.ts +64 -0
  369. package/dist/esm/components/credits/creditsNavigation/CreditsNavigation.d.ts +4 -0
  370. package/dist/esm/components/credits/creditsNavigation/CreditsNavigation.js +2 -0
  371. package/dist/esm/components/credits/creditsNavigation/CreditsNavigation.js.map +7 -0
  372. package/dist/esm/components/credits/creditsNavigation/index.d.ts +2 -0
  373. package/dist/esm/components/credits/creditsNavigation/index.js +2 -0
  374. package/dist/esm/components/credits/creditsNavigation/index.js.map +7 -0
  375. package/dist/esm/components/credits/creditsNavigation/type.d.ts +7 -0
  376. package/dist/esm/components/credits/creditsRedeemList/AddressForm/CountrySelect.js +1 -1
  377. package/dist/esm/components/credits/creditsRedeemList/AddressForm/CountrySelect.js.map +3 -3
  378. package/dist/esm/components/credits/creditsRedeemList/AddressForm/StateSelect.js +1 -1
  379. package/dist/esm/components/credits/creditsRedeemList/AddressForm/StateSelect.js.map +3 -3
  380. package/dist/esm/components/credits/creditsRedeemList/AddressForm/index.js +1 -1
  381. package/dist/esm/components/credits/creditsRedeemList/AddressForm/index.js.map +3 -3
  382. package/dist/esm/components/credits/creditsRedeemList/CreditsRedeemList.d.ts +5 -0
  383. package/dist/esm/components/credits/creditsRedeemList/CreditsRedeemList.js +2 -0
  384. package/dist/esm/components/credits/creditsRedeemList/CreditsRedeemList.js.map +7 -0
  385. package/dist/esm/components/credits/creditsRedeemList/NonProductValue.d.ts +4 -0
  386. package/dist/esm/components/credits/creditsRedeemList/NonProductValue.js +2 -0
  387. package/dist/esm/components/credits/creditsRedeemList/NonProductValue.js.map +7 -0
  388. package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.js +1 -1
  389. package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.js.map +3 -3
  390. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.js +1 -1
  391. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.js.map +3 -3
  392. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Error.js +1 -1
  393. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Error.js.map +2 -2
  394. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.js +1 -1
  395. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.js.map +3 -3
  396. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.d.ts +6 -0
  397. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js +2 -0
  398. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js.map +7 -0
  399. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js +1 -1
  400. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js.map +3 -3
  401. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.js +1 -1
  402. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.js.map +3 -3
  403. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.js +1 -1
  404. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.js.map +3 -3
  405. package/dist/esm/components/credits/creditsRedeemList/RedeemableItem.js +1 -1
  406. package/dist/esm/components/credits/creditsRedeemList/RedeemableItem.js.map +3 -3
  407. package/dist/esm/components/credits/creditsRedeemList/index.d.ts +2 -13
  408. package/dist/esm/components/credits/creditsRedeemList/index.js +1 -1
  409. package/dist/esm/components/credits/creditsRedeemList/index.js.map +4 -4
  410. package/dist/esm/components/credits/creditsRedeemList/type.d.ts +2 -15
  411. package/dist/esm/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.d.ts +4 -0
  412. package/dist/esm/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js +2 -0
  413. package/dist/esm/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js.map +7 -0
  414. package/dist/esm/components/credits/creditsWaysToGetCredits/index.d.ts +2 -2
  415. package/dist/esm/components/credits/creditsWaysToGetCredits/index.js +1 -1
  416. package/dist/esm/components/credits/creditsWaysToGetCredits/index.js.map +4 -4
  417. package/dist/esm/components/credits/creditsWaysToGetCredits/type.d.ts +5 -16
  418. package/dist/esm/components/credits/creditsWaysToGetCredits/type.js +1 -1
  419. package/dist/esm/components/credits/creditsWaysToGetCredits/type.js.map +2 -2
  420. package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.d.ts +11 -2
  421. package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.js +1 -1
  422. package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.js.map +3 -3
  423. package/dist/esm/components/credits/modal/MyRewardsModal.d.ts +4 -1
  424. package/dist/esm/components/credits/modal/MyRewardsModal.js +1 -1
  425. package/dist/esm/components/credits/modal/MyRewardsModal.js.map +3 -3
  426. package/dist/esm/components/credits/modal/activitiesModal.d.ts +4 -1
  427. package/dist/esm/components/credits/modal/activitiesModal.js +1 -1
  428. package/dist/esm/components/credits/modal/activitiesModal.js.map +3 -3
  429. package/dist/esm/components/credits/modal/creditsUploadReceiptModal.js +1 -1
  430. package/dist/esm/components/credits/modal/creditsUploadReceiptModal.js.map +3 -3
  431. package/dist/esm/components/credits/modal/loadingDots.d.ts +2 -1
  432. package/dist/esm/components/credits/modal/loadingDots.js +1 -1
  433. package/dist/esm/components/credits/modal/loadingDots.js.map +3 -3
  434. package/dist/esm/components/credits/modal/modalContainer.js +1 -1
  435. package/dist/esm/components/credits/modal/modalContainer.js.map +3 -3
  436. package/dist/esm/components/credits/modal/rulesModal.js +1 -1
  437. package/dist/esm/components/credits/modal/rulesModal.js.map +2 -2
  438. package/dist/esm/components/credits/modal/subscribeModal.d.ts +15 -0
  439. package/dist/esm/components/credits/modal/subscribeModal.js +2 -0
  440. package/dist/esm/components/credits/modal/subscribeModal.js.map +7 -0
  441. package/dist/esm/components/credits/modal/tip.js +1 -1
  442. package/dist/esm/components/credits/modal/tip.js.map +3 -3
  443. package/dist/esm/components/credits/type.d.ts +24 -5
  444. package/dist/esm/components/index.d.ts +2 -1
  445. package/dist/esm/components/index.js +1 -1
  446. package/dist/esm/components/index.js.map +2 -2
  447. package/dist/esm/components/registration/authCodeActivate/Message.d.ts +4 -0
  448. package/dist/esm/components/registration/authCodeActivate/Message.js +2 -0
  449. package/dist/esm/components/registration/authCodeActivate/Message.js.map +7 -0
  450. package/dist/esm/components/registration/authCodeActivate/index.d.ts +3 -0
  451. package/dist/esm/components/registration/authCodeActivate/index.js +2 -0
  452. package/dist/esm/components/registration/authCodeActivate/index.js.map +7 -0
  453. package/dist/esm/components/registration/authCodeActivate/type.d.ts +22 -0
  454. package/dist/esm/components/registration/authCodeActivate/type.js.map +7 -0
  455. package/dist/esm/components/registration/context/index.d.ts +1 -0
  456. package/dist/esm/components/registration/context/index.js +2 -0
  457. package/dist/esm/components/registration/context/index.js.map +7 -0
  458. package/dist/esm/components/registration/context/provider.d.ts +27 -0
  459. package/dist/esm/components/registration/context/provider.js +2 -0
  460. package/dist/esm/components/registration/context/provider.js.map +7 -0
  461. package/dist/esm/components/registration/index.d.ts +2 -0
  462. package/dist/esm/components/registration/index.js +2 -0
  463. package/dist/esm/components/registration/index.js.map +7 -0
  464. package/dist/esm/components/registration/modalContainer.d.ts +14 -0
  465. package/dist/esm/components/registration/modalContainer.js +2 -0
  466. package/dist/esm/components/registration/modalContainer.js.map +7 -0
  467. package/dist/esm/constants.d.ts +1 -0
  468. package/dist/esm/constants.js +2 -0
  469. package/dist/esm/constants.js.map +7 -0
  470. package/dist/esm/helpers/fetcher.d.ts +1 -1
  471. package/dist/esm/helpers/fetcher.js +1 -1
  472. package/dist/esm/helpers/fetcher.js.map +3 -3
  473. package/dist/esm/helpers/index.d.ts +2 -2
  474. package/dist/esm/helpers/index.js +1 -1
  475. package/dist/esm/helpers/index.js.map +2 -2
  476. package/dist/esm/helpers/track.d.ts +6 -2
  477. package/dist/esm/helpers/track.js +1 -1
  478. package/dist/esm/helpers/track.js.map +3 -3
  479. package/dist/esm/index.d.ts +3 -2
  480. package/dist/esm/index.js +1 -1
  481. package/dist/esm/index.js.map +2 -2
  482. package/dist/esm/templates/credits.d.ts +73 -0
  483. package/dist/esm/templates/credits.js +2 -0
  484. package/dist/esm/templates/credits.js.map +7 -0
  485. package/dist/esm/templates/index.d.ts +1 -0
  486. package/dist/esm/templates/index.js +2 -0
  487. package/dist/esm/templates/index.js.map +7 -0
  488. package/package.json +25 -22
  489. package/src/components/chat/index.tsx +1 -1
  490. package/src/components/credits/context/const.ts +1 -0
  491. package/src/components/credits/context/hooks/useActivities.ts +4 -3
  492. package/src/components/credits/context/hooks/useAddressValidate.ts +2 -2
  493. package/src/components/credits/context/hooks/useAlpcFetch.ts +14 -10
  494. package/src/components/credits/context/hooks/useCountries.ts +2 -2
  495. package/src/components/credits/context/hooks/useFunctionMemberPrice.ts +33 -0
  496. package/src/components/credits/context/hooks/useMyRewards.ts +4 -3
  497. package/src/components/credits/context/hooks/useRedeemAndBuy.ts +21 -24
  498. package/src/components/credits/context/hooks/useRedeemCoupon.ts +7 -3
  499. package/src/components/credits/context/hooks/useRedeemProduct.ts +5 -2
  500. package/src/components/credits/context/hooks/useRedeemableList.ts +4 -18
  501. package/src/components/credits/context/hooks/useSubscribed.ts +6 -7
  502. package/src/components/credits/context/hooks/useUploadReceipt.tsx +0 -1
  503. package/src/components/credits/context/memberPriceConst.ts +13 -0
  504. package/src/components/credits/context/memberPriceTypes.ts +54 -0
  505. package/src/components/credits/context/provider.tsx +25 -20
  506. package/src/components/credits/context/utils/atobID.ts +8 -0
  507. package/src/components/credits/context/utils/functionDiscountCalculate.ts +57 -0
  508. package/src/components/credits/context/utils/getFunctionMemberPrice.ts +135 -0
  509. package/src/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.ts +51 -0
  510. package/src/components/credits/context/utils/variantGetCoupon.ts +34 -0
  511. package/src/components/credits/context/utils.ts +9 -0
  512. package/src/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.tsx +273 -0
  513. package/src/components/credits/creditsAnkersolixTask/index.ts +2 -0
  514. package/src/components/credits/creditsAnkersolixTask/type.ts +7 -0
  515. package/src/components/credits/creditsBanner/index.tsx +16 -18
  516. package/src/components/credits/creditsBenefits/BenefitItem.tsx +108 -0
  517. package/src/components/credits/creditsBenefits/index.tsx +20 -15
  518. package/src/components/credits/creditsCash/CreditsCash.tsx +84 -0
  519. package/src/components/credits/creditsCash/RedeemableItem.tsx +66 -44
  520. package/src/components/credits/creditsCash/index.ts +2 -0
  521. package/src/components/credits/creditsCash/type.ts +2 -4
  522. package/src/components/credits/creditsFaq/faqItem/FaqItem.tsx +12 -12
  523. package/src/components/credits/creditsFaq/index.tsx +9 -6
  524. package/src/components/credits/creditsInfoCard/index.tsx +43 -36
  525. package/src/components/credits/creditsMemberPrice/CreditsMemberPrice.tsx +314 -0
  526. package/src/components/credits/creditsMemberPrice/MemberPriceItem.tsx +181 -0
  527. package/src/components/credits/creditsMemberPrice/Pagination.tsx +113 -0
  528. package/src/components/credits/creditsMemberPrice/index.ts +2 -0
  529. package/src/components/credits/creditsMemberPrice/type.ts +75 -0
  530. package/src/components/credits/creditsNavigation/CreditsNavigation.tsx +123 -0
  531. package/src/components/credits/creditsNavigation/index.ts +2 -0
  532. package/src/components/credits/creditsNavigation/type.ts +10 -0
  533. package/src/components/credits/creditsRedeemList/AddressForm/CountrySelect.tsx +8 -3
  534. package/src/components/credits/creditsRedeemList/AddressForm/StateSelect.tsx +6 -1
  535. package/src/components/credits/creditsRedeemList/AddressForm/index.tsx +6 -5
  536. package/src/components/credits/creditsRedeemList/{index.tsx → CreditsRedeemList.tsx} +31 -35
  537. package/src/components/credits/creditsRedeemList/NonProductValue.tsx +39 -0
  538. package/src/components/credits/creditsRedeemList/RedeemCouponModal.tsx +11 -13
  539. package/src/components/credits/creditsRedeemList/RedeemProductModal/Address.tsx +15 -11
  540. package/src/components/credits/creditsRedeemList/RedeemProductModal/Error.tsx +1 -1
  541. package/src/components/credits/creditsRedeemList/RedeemProductModal/Init.tsx +6 -12
  542. package/src/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.tsx +25 -0
  543. package/src/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.tsx +11 -7
  544. package/src/components/credits/creditsRedeemList/RedeemProductModal/Success.tsx +5 -1
  545. package/src/components/credits/creditsRedeemList/RedeemProductModal/index.tsx +4 -5
  546. package/src/components/credits/creditsRedeemList/RedeemableItem.tsx +24 -32
  547. package/src/components/credits/creditsRedeemList/index.ts +2 -0
  548. package/src/components/credits/creditsRedeemList/type.ts +2 -16
  549. package/src/components/credits/creditsWaysToGetCredits/{index.tsx → CreditsWaysToGetCredits.tsx} +79 -20
  550. package/src/components/credits/creditsWaysToGetCredits/index.ts +2 -0
  551. package/src/components/credits/creditsWaysToGetCredits/type.ts +5 -16
  552. package/src/components/credits/creditsWaysToGetCredits/useActions.ts +24 -10
  553. package/src/components/credits/modal/MyRewardsModal.tsx +84 -63
  554. package/src/components/credits/modal/activitiesModal.tsx +62 -46
  555. package/src/components/credits/modal/creditsUploadReceiptModal.tsx +10 -1
  556. package/src/components/credits/modal/loadingDots.tsx +9 -7
  557. package/src/components/credits/modal/modalContainer.tsx +6 -1
  558. package/src/components/credits/modal/rulesModal.tsx +1 -1
  559. package/src/components/credits/modal/subscribeModal.tsx +202 -0
  560. package/src/components/credits/modal/tip.tsx +11 -1
  561. package/src/components/credits/type.ts +24 -5
  562. package/src/components/index.ts +3 -3
  563. package/src/components/registration/authCodeActivate/Message.tsx +43 -0
  564. package/src/components/registration/authCodeActivate/index.tsx +338 -0
  565. package/src/components/registration/authCodeActivate/type.ts +23 -0
  566. package/src/components/registration/context/index.tsx +1 -0
  567. package/src/components/registration/context/provider.tsx +86 -0
  568. package/src/components/registration/index.ts +2 -0
  569. package/src/components/registration/modalContainer.tsx +115 -0
  570. package/src/constants.ts +1 -0
  571. package/src/index.ts +3 -4
  572. package/src/styles/global.css +15 -0
  573. package/src/templates/Credits.tsx +165 -0
  574. package/src/templates/index.ts +1 -0
  575. package/style.css +1 -0
  576. package/tailwind.config.ts +10 -0
  577. package/dist/cjs/components/chat/chat-context.d.ts +0 -101
  578. package/dist/cjs/components/credits/credits-banner/index.d.ts +0 -23
  579. package/dist/cjs/components/credits/credits-banner/index.js +0 -2
  580. package/dist/cjs/components/credits/credits-banner/index.js.map +0 -7
  581. package/dist/cjs/components/credits/credits-benefits/benefitItem.d.ts +0 -19
  582. package/dist/cjs/components/credits/credits-benefits/benefitItem.js +0 -2
  583. package/dist/cjs/components/credits/credits-benefits/benefitItem.js.map +0 -7
  584. package/dist/cjs/components/credits/credits-benefits/iconInfo.d.ts +0 -2
  585. package/dist/cjs/components/credits/credits-benefits/index.d.ts +0 -12
  586. package/dist/cjs/components/credits/credits-benefits/index.js +0 -4
  587. package/dist/cjs/components/credits/credits-benefits/index.js.map +0 -7
  588. package/dist/cjs/components/credits/credits-cash/RedeemableItem.d.ts +0 -15
  589. package/dist/cjs/components/credits/credits-cash/RedeemableItem.js +0 -2
  590. package/dist/cjs/components/credits/credits-cash/RedeemableItem.js.map +0 -7
  591. package/dist/cjs/components/credits/credits-cash/index.d.ts +0 -13
  592. package/dist/cjs/components/credits/credits-cash/index.js +0 -2
  593. package/dist/cjs/components/credits/credits-cash/index.js.map +0 -7
  594. package/dist/cjs/components/credits/credits-cash/type.d.ts +0 -47
  595. package/dist/cjs/components/credits/credits-cash/type.js +0 -2
  596. package/dist/cjs/components/credits/credits-cash/type.js.map +0 -7
  597. package/dist/cjs/components/credits/credits-faq/faq-item/FaqItem.d.ts +0 -13
  598. package/dist/cjs/components/credits/credits-faq/faq-item/faq-item.d.ts +0 -13
  599. package/dist/cjs/components/credits/credits-faq/faq-item/faq-item.js +0 -2
  600. package/dist/cjs/components/credits/credits-faq/faq-item/faq-item.js.map +0 -7
  601. package/dist/cjs/components/credits/credits-faq/faqItem/FaqItem.d.ts +0 -13
  602. package/dist/cjs/components/credits/credits-faq/index.d.ts +0 -16
  603. package/dist/cjs/components/credits/credits-faq/index.js +0 -2
  604. package/dist/cjs/components/credits/credits-faq/index.js.map +0 -7
  605. package/dist/cjs/components/credits/credits-info-card/index.d.ts +0 -20
  606. package/dist/cjs/components/credits/credits-info-card/index.js +0 -2
  607. package/dist/cjs/components/credits/credits-info-card/index.js.map +0 -7
  608. package/dist/cjs/components/credits/credits-redeem-list/AddressForm/Input.d.ts +0 -13
  609. package/dist/cjs/components/credits/credits-redeem-list/AddressForm/country-select.d.ts +0 -14
  610. package/dist/cjs/components/credits/credits-redeem-list/AddressForm/form-item.d.ts +0 -6
  611. package/dist/cjs/components/credits/credits-redeem-list/AddressForm/index.d.ts +0 -2
  612. package/dist/cjs/components/credits/credits-redeem-list/AddressForm/state-select.d.ts +0 -15
  613. package/dist/cjs/components/credits/credits-redeem-list/AddressForm/type.d.ts +0 -26
  614. package/dist/cjs/components/credits/credits-redeem-list/RedeemCouponModal.d.ts +0 -9
  615. package/dist/cjs/components/credits/credits-redeem-list/RedeemProductModal/Address.d.ts +0 -20
  616. package/dist/cjs/components/credits/credits-redeem-list/RedeemProductModal/Error.d.ts +0 -8
  617. package/dist/cjs/components/credits/credits-redeem-list/RedeemProductModal/Init.d.ts +0 -11
  618. package/dist/cjs/components/credits/credits-redeem-list/RedeemProductModal/ProductInfo.d.ts +0 -8
  619. package/dist/cjs/components/credits/credits-redeem-list/RedeemProductModal/Success.d.ts +0 -13
  620. package/dist/cjs/components/credits/credits-redeem-list/RedeemProductModal/index.d.ts +0 -11
  621. package/dist/cjs/components/credits/credits-redeem-list/RedeemableItem.d.ts +0 -9
  622. package/dist/cjs/components/credits/credits-redeem-list/RedeemableItem.js +0 -2
  623. package/dist/cjs/components/credits/credits-redeem-list/RedeemableItem.js.map +0 -7
  624. package/dist/cjs/components/credits/credits-redeem-list/address-form/Input.d.ts +0 -13
  625. package/dist/cjs/components/credits/credits-redeem-list/address-form/country-select.d.ts +0 -14
  626. package/dist/cjs/components/credits/credits-redeem-list/address-form/country-select.js +0 -2
  627. package/dist/cjs/components/credits/credits-redeem-list/address-form/country-select.js.map +0 -7
  628. package/dist/cjs/components/credits/credits-redeem-list/address-form/form-item.d.ts +0 -6
  629. package/dist/cjs/components/credits/credits-redeem-list/address-form/index.d.ts +0 -2
  630. package/dist/cjs/components/credits/credits-redeem-list/address-form/index.js +0 -2
  631. package/dist/cjs/components/credits/credits-redeem-list/address-form/index.js.map +0 -7
  632. package/dist/cjs/components/credits/credits-redeem-list/address-form/state-select.d.ts +0 -15
  633. package/dist/cjs/components/credits/credits-redeem-list/address-form/state-select.js +0 -2
  634. package/dist/cjs/components/credits/credits-redeem-list/address-form/state-select.js.map +0 -7
  635. package/dist/cjs/components/credits/credits-redeem-list/address-form/type.d.ts +0 -26
  636. package/dist/cjs/components/credits/credits-redeem-list/index.d.ts +0 -13
  637. package/dist/cjs/components/credits/credits-redeem-list/index.js +0 -2
  638. package/dist/cjs/components/credits/credits-redeem-list/index.js.map +0 -7
  639. package/dist/cjs/components/credits/credits-redeem-list/redeem-coupon-modal.d.ts +0 -9
  640. package/dist/cjs/components/credits/credits-redeem-list/redeem-coupon-modal.js +0 -2
  641. package/dist/cjs/components/credits/credits-redeem-list/redeem-coupon-modal.js.map +0 -7
  642. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Address.d.ts +0 -20
  643. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Address.js +0 -2
  644. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Address.js.map +0 -7
  645. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Error.d.ts +0 -8
  646. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Init.d.ts +0 -11
  647. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Init.js +0 -2
  648. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Init.js.map +0 -7
  649. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/ProductInfo.d.ts +0 -8
  650. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/ProductInfo.js +0 -2
  651. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/ProductInfo.js.map +0 -7
  652. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Success.d.ts +0 -13
  653. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Success.js +0 -2
  654. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Success.js.map +0 -7
  655. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/index.d.ts +0 -11
  656. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/index.js +0 -2
  657. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/index.js.map +0 -7
  658. package/dist/cjs/components/credits/credits-redeem-list/type.d.ts +0 -77
  659. package/dist/cjs/components/credits/credits-redeem-list/type.js.map +0 -7
  660. package/dist/cjs/components/credits/credits-ways-to-get-credits/index.d.ts +0 -2
  661. package/dist/cjs/components/credits/credits-ways-to-get-credits/index.js +0 -2
  662. package/dist/cjs/components/credits/credits-ways-to-get-credits/index.js.map +0 -7
  663. package/dist/cjs/components/credits/credits-ways-to-get-credits/type.d.ts +0 -60
  664. package/dist/cjs/components/credits/credits-ways-to-get-credits/type.js +0 -2
  665. package/dist/cjs/components/credits/credits-ways-to-get-credits/type.js.map +0 -7
  666. package/dist/cjs/components/credits/credits-ways-to-get-credits/useActions.d.ts +0 -96
  667. package/dist/cjs/components/credits/credits-ways-to-get-credits/useActions.js +0 -2
  668. package/dist/cjs/components/credits/credits-ways-to-get-credits/useActions.js.map +0 -7
  669. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/country-select.d.ts +0 -14
  670. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/form-item.d.ts +0 -6
  671. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/state-select.d.ts +0 -15
  672. package/dist/cjs/index.css +0 -2
  673. package/dist/cjs/index.css.map +0 -7
  674. package/dist/cjs/shopify/context/ShopifyProvider.d.ts +0 -10
  675. package/dist/cjs/shopify/context/index.d.ts +0 -1
  676. package/dist/cjs/shopify/context/shopify-provider.d.ts +0 -10
  677. package/dist/cjs/shopify/fetchers/create-cart.d.ts +0 -12
  678. package/dist/cjs/shopify/fetchers/get-products-by-handles.d.ts +0 -7
  679. package/dist/cjs/shopify/fetchers/index.d.ts +0 -2
  680. package/dist/cjs/shopify/fragments/article.d.ts +0 -2
  681. package/dist/cjs/shopify/fragments/blog.d.ts +0 -1
  682. package/dist/cjs/shopify/fragments/cart.d.ts +0 -1
  683. package/dist/cjs/shopify/fragments/collection.d.ts +0 -1
  684. package/dist/cjs/shopify/fragments/image.d.ts +0 -1
  685. package/dist/cjs/shopify/fragments/index.d.ts +0 -11
  686. package/dist/cjs/shopify/fragments/metafields.d.ts +0 -2
  687. package/dist/cjs/shopify/fragments/page-info.d.ts +0 -1
  688. package/dist/cjs/shopify/fragments/page.d.ts +0 -1
  689. package/dist/cjs/shopify/fragments/product.d.ts +0 -1
  690. package/dist/cjs/shopify/fragments/seo.d.ts +0 -1
  691. package/dist/cjs/shopify/fragments/variant.d.ts +0 -1
  692. package/dist/cjs/shopify/gql/fragment-masking.d.ts +0 -15
  693. package/dist/cjs/shopify/gql/gql.d.ts +0 -87
  694. package/dist/cjs/shopify/gql/graphql.d.ts +0 -7669
  695. package/dist/cjs/shopify/gql/index.d.ts +0 -3
  696. package/dist/cjs/shopify/hooks/index.d.ts +0 -2
  697. package/dist/cjs/shopify/hooks/use-create-cart.d.ts +0 -2
  698. package/dist/cjs/shopify/hooks/use-products-by-handles.d.ts +0 -4
  699. package/dist/cjs/shopify/hooks/useCreateCart.d.ts +0 -2
  700. package/dist/cjs/shopify/hooks/useProductsByHandles.d.ts +0 -4
  701. package/dist/cjs/shopify/mutations/create-cart.d.ts +0 -1
  702. package/dist/cjs/shopify/queries/get-product-by-handles.d.ts +0 -1
  703. package/dist/cjs/shopify/queries/index.d.ts +0 -1
  704. package/dist/cjs/shopify/src/index.d.ts +0 -5
  705. package/dist/cjs/shopify/tsup.config.d.ts +0 -2
  706. package/dist/cjs/shopify/types/article.d.ts +0 -48
  707. package/dist/cjs/shopify/types/cart.d.ts +0 -173
  708. package/dist/cjs/shopify/types/checkout.d.ts +0 -42
  709. package/dist/cjs/shopify/types/collection.d.ts +0 -122
  710. package/dist/cjs/shopify/types/common.d.ts +0 -42
  711. package/dist/cjs/shopify/types/config.d.ts +0 -12
  712. package/dist/cjs/shopify/types/customer.d.ts +0 -30
  713. package/dist/cjs/shopify/types/fetcher.d.ts +0 -38
  714. package/dist/cjs/shopify/types/index.d.ts +0 -12
  715. package/dist/cjs/shopify/types/page.d.ts +0 -33
  716. package/dist/cjs/shopify/types/product.d.ts +0 -174
  717. package/dist/cjs/shopify/types/search.d.ts +0 -54
  718. package/dist/cjs/shopify/types/site.d.ts +0 -33
  719. package/dist/cjs/shopify/types/type-helper.d.ts +0 -5
  720. package/dist/cjs/shopify/utils/colors.d.ts +0 -3
  721. package/dist/cjs/shopify/utils/const.d.ts +0 -76
  722. package/dist/cjs/shopify/utils/cookie.d.ts +0 -15
  723. package/dist/cjs/shopify/utils/errors.d.ts +0 -38
  724. package/dist/cjs/shopify/utils/fetch-graphql-api.d.ts +0 -19
  725. package/dist/cjs/shopify/utils/handle-fetch-response.d.ts +0 -5
  726. package/dist/cjs/shopify/utils/helper.d.ts +0 -28
  727. package/dist/cjs/shopify/utils/normalize/cart.d.ts +0 -7
  728. package/dist/cjs/shopify/utils/normalize/customer.d.ts +0 -3
  729. package/dist/cjs/shopify/utils/normalize/index.d.ts +0 -2
  730. package/dist/cjs/shopify/utils/normalize/metafield.d.ts +0 -5
  731. package/dist/cjs/shopify/utils/normalize/product.d.ts +0 -16
  732. package/dist/cjs/shopify/utils/store.d.ts +0 -2
  733. package/dist/cjs/shopify/utils/type-helper.d.ts +0 -5
  734. package/dist/cjs/tsconfig.tsbuildinfo +0 -1
  735. package/dist/esm/components/chat/chat-context.d.ts +0 -101
  736. package/dist/esm/components/chat/chat-context.js +0 -2
  737. package/dist/esm/components/chat/chat-context.js.map +0 -7
  738. package/dist/esm/components/credits/credits-banner/index.d.ts +0 -23
  739. package/dist/esm/components/credits/credits-banner/index.js +0 -2
  740. package/dist/esm/components/credits/credits-banner/index.js.map +0 -7
  741. package/dist/esm/components/credits/credits-benefits/benefitItem.d.ts +0 -19
  742. package/dist/esm/components/credits/credits-benefits/benefitItem.js +0 -2
  743. package/dist/esm/components/credits/credits-benefits/benefitItem.js.map +0 -7
  744. package/dist/esm/components/credits/credits-benefits/iconInfo.d.ts +0 -2
  745. package/dist/esm/components/credits/credits-benefits/iconInfo.js +0 -2
  746. package/dist/esm/components/credits/credits-benefits/iconInfo.js.map +0 -7
  747. package/dist/esm/components/credits/credits-benefits/index.d.ts +0 -12
  748. package/dist/esm/components/credits/credits-benefits/index.js +0 -4
  749. package/dist/esm/components/credits/credits-benefits/index.js.map +0 -7
  750. package/dist/esm/components/credits/credits-cash/RedeemableItem.d.ts +0 -15
  751. package/dist/esm/components/credits/credits-cash/RedeemableItem.js +0 -2
  752. package/dist/esm/components/credits/credits-cash/RedeemableItem.js.map +0 -7
  753. package/dist/esm/components/credits/credits-cash/index.d.ts +0 -13
  754. package/dist/esm/components/credits/credits-cash/index.js +0 -2
  755. package/dist/esm/components/credits/credits-cash/index.js.map +0 -7
  756. package/dist/esm/components/credits/credits-cash/type.d.ts +0 -47
  757. package/dist/esm/components/credits/credits-faq/faq-item/FaqItem.d.ts +0 -13
  758. package/dist/esm/components/credits/credits-faq/faq-item/faq-item.d.ts +0 -13
  759. package/dist/esm/components/credits/credits-faq/faq-item/faq-item.js +0 -2
  760. package/dist/esm/components/credits/credits-faq/faq-item/faq-item.js.map +0 -7
  761. package/dist/esm/components/credits/credits-faq/faqItem/FaqItem.d.ts +0 -13
  762. package/dist/esm/components/credits/credits-faq/index.d.ts +0 -16
  763. package/dist/esm/components/credits/credits-faq/index.js +0 -2
  764. package/dist/esm/components/credits/credits-faq/index.js.map +0 -7
  765. package/dist/esm/components/credits/credits-info-card/index.d.ts +0 -20
  766. package/dist/esm/components/credits/credits-info-card/index.js +0 -2
  767. package/dist/esm/components/credits/credits-info-card/index.js.map +0 -7
  768. package/dist/esm/components/credits/credits-redeem-list/AddressForm/Input.d.ts +0 -13
  769. package/dist/esm/components/credits/credits-redeem-list/AddressForm/country-select.d.ts +0 -14
  770. package/dist/esm/components/credits/credits-redeem-list/AddressForm/form-item.d.ts +0 -6
  771. package/dist/esm/components/credits/credits-redeem-list/AddressForm/index.d.ts +0 -2
  772. package/dist/esm/components/credits/credits-redeem-list/AddressForm/state-select.d.ts +0 -15
  773. package/dist/esm/components/credits/credits-redeem-list/AddressForm/type.d.ts +0 -26
  774. package/dist/esm/components/credits/credits-redeem-list/RedeemCouponModal.d.ts +0 -9
  775. package/dist/esm/components/credits/credits-redeem-list/RedeemProductModal/Address.d.ts +0 -20
  776. package/dist/esm/components/credits/credits-redeem-list/RedeemProductModal/Error.d.ts +0 -8
  777. package/dist/esm/components/credits/credits-redeem-list/RedeemProductModal/Init.d.ts +0 -11
  778. package/dist/esm/components/credits/credits-redeem-list/RedeemProductModal/ProductInfo.d.ts +0 -8
  779. package/dist/esm/components/credits/credits-redeem-list/RedeemProductModal/Success.d.ts +0 -13
  780. package/dist/esm/components/credits/credits-redeem-list/RedeemProductModal/index.d.ts +0 -11
  781. package/dist/esm/components/credits/credits-redeem-list/RedeemableItem.d.ts +0 -9
  782. package/dist/esm/components/credits/credits-redeem-list/RedeemableItem.js +0 -2
  783. package/dist/esm/components/credits/credits-redeem-list/RedeemableItem.js.map +0 -7
  784. package/dist/esm/components/credits/credits-redeem-list/address-form/Input.d.ts +0 -13
  785. package/dist/esm/components/credits/credits-redeem-list/address-form/Input.js +0 -2
  786. package/dist/esm/components/credits/credits-redeem-list/address-form/Input.js.map +0 -7
  787. package/dist/esm/components/credits/credits-redeem-list/address-form/country-select.d.ts +0 -14
  788. package/dist/esm/components/credits/credits-redeem-list/address-form/country-select.js +0 -2
  789. package/dist/esm/components/credits/credits-redeem-list/address-form/country-select.js.map +0 -7
  790. package/dist/esm/components/credits/credits-redeem-list/address-form/form-item.d.ts +0 -6
  791. package/dist/esm/components/credits/credits-redeem-list/address-form/form-item.js +0 -2
  792. package/dist/esm/components/credits/credits-redeem-list/address-form/form-item.js.map +0 -7
  793. package/dist/esm/components/credits/credits-redeem-list/address-form/index.d.ts +0 -2
  794. package/dist/esm/components/credits/credits-redeem-list/address-form/index.js +0 -2
  795. package/dist/esm/components/credits/credits-redeem-list/address-form/index.js.map +0 -7
  796. package/dist/esm/components/credits/credits-redeem-list/address-form/state-select.d.ts +0 -15
  797. package/dist/esm/components/credits/credits-redeem-list/address-form/state-select.js +0 -2
  798. package/dist/esm/components/credits/credits-redeem-list/address-form/state-select.js.map +0 -7
  799. package/dist/esm/components/credits/credits-redeem-list/address-form/type.d.ts +0 -26
  800. package/dist/esm/components/credits/credits-redeem-list/index.d.ts +0 -13
  801. package/dist/esm/components/credits/credits-redeem-list/index.js +0 -2
  802. package/dist/esm/components/credits/credits-redeem-list/index.js.map +0 -7
  803. package/dist/esm/components/credits/credits-redeem-list/redeem-coupon-modal.d.ts +0 -9
  804. package/dist/esm/components/credits/credits-redeem-list/redeem-coupon-modal.js +0 -2
  805. package/dist/esm/components/credits/credits-redeem-list/redeem-coupon-modal.js.map +0 -7
  806. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Address.d.ts +0 -20
  807. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Address.js +0 -2
  808. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Address.js.map +0 -7
  809. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Error.d.ts +0 -8
  810. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Error.js +0 -2
  811. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Error.js.map +0 -7
  812. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Init.d.ts +0 -11
  813. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Init.js +0 -2
  814. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Init.js.map +0 -7
  815. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/ProductInfo.d.ts +0 -8
  816. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/ProductInfo.js +0 -2
  817. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/ProductInfo.js.map +0 -7
  818. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Success.d.ts +0 -13
  819. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Success.js +0 -2
  820. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Success.js.map +0 -7
  821. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/index.d.ts +0 -11
  822. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/index.js +0 -2
  823. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/index.js.map +0 -7
  824. package/dist/esm/components/credits/credits-redeem-list/type.d.ts +0 -77
  825. package/dist/esm/components/credits/credits-ways-to-get-credits/index.d.ts +0 -2
  826. package/dist/esm/components/credits/credits-ways-to-get-credits/index.js +0 -2
  827. package/dist/esm/components/credits/credits-ways-to-get-credits/index.js.map +0 -7
  828. package/dist/esm/components/credits/credits-ways-to-get-credits/type.d.ts +0 -60
  829. package/dist/esm/components/credits/credits-ways-to-get-credits/type.js +0 -2
  830. package/dist/esm/components/credits/credits-ways-to-get-credits/type.js.map +0 -7
  831. package/dist/esm/components/credits/credits-ways-to-get-credits/useActions.d.ts +0 -96
  832. package/dist/esm/components/credits/credits-ways-to-get-credits/useActions.js +0 -2
  833. package/dist/esm/components/credits/credits-ways-to-get-credits/useActions.js.map +0 -7
  834. package/dist/esm/components/credits/creditsRedeemList/AddressForm/country-select.d.ts +0 -14
  835. package/dist/esm/components/credits/creditsRedeemList/AddressForm/form-item.d.ts +0 -6
  836. package/dist/esm/components/credits/creditsRedeemList/AddressForm/state-select.d.ts +0 -15
  837. package/dist/esm/index.css +0 -2
  838. package/dist/esm/index.css.map +0 -7
  839. package/dist/esm/shopify/context/ShopifyProvider.d.ts +0 -10
  840. package/dist/esm/shopify/context/index.d.ts +0 -1
  841. package/dist/esm/shopify/context/shopify-provider.d.ts +0 -10
  842. package/dist/esm/shopify/fetchers/create-cart.d.ts +0 -12
  843. package/dist/esm/shopify/fetchers/get-products-by-handles.d.ts +0 -7
  844. package/dist/esm/shopify/fetchers/index.d.ts +0 -2
  845. package/dist/esm/shopify/fragments/article.d.ts +0 -2
  846. package/dist/esm/shopify/fragments/blog.d.ts +0 -1
  847. package/dist/esm/shopify/fragments/cart.d.ts +0 -1
  848. package/dist/esm/shopify/fragments/collection.d.ts +0 -1
  849. package/dist/esm/shopify/fragments/image.d.ts +0 -1
  850. package/dist/esm/shopify/fragments/index.d.ts +0 -11
  851. package/dist/esm/shopify/fragments/metafields.d.ts +0 -2
  852. package/dist/esm/shopify/fragments/page-info.d.ts +0 -1
  853. package/dist/esm/shopify/fragments/page.d.ts +0 -1
  854. package/dist/esm/shopify/fragments/product.d.ts +0 -1
  855. package/dist/esm/shopify/fragments/seo.d.ts +0 -1
  856. package/dist/esm/shopify/fragments/variant.d.ts +0 -1
  857. package/dist/esm/shopify/gql/fragment-masking.d.ts +0 -15
  858. package/dist/esm/shopify/gql/gql.d.ts +0 -87
  859. package/dist/esm/shopify/gql/graphql.d.ts +0 -7669
  860. package/dist/esm/shopify/gql/index.d.ts +0 -3
  861. package/dist/esm/shopify/hooks/index.d.ts +0 -2
  862. package/dist/esm/shopify/hooks/use-create-cart.d.ts +0 -2
  863. package/dist/esm/shopify/hooks/use-products-by-handles.d.ts +0 -4
  864. package/dist/esm/shopify/hooks/useCreateCart.d.ts +0 -2
  865. package/dist/esm/shopify/hooks/useProductsByHandles.d.ts +0 -4
  866. package/dist/esm/shopify/mutations/create-cart.d.ts +0 -1
  867. package/dist/esm/shopify/queries/get-product-by-handles.d.ts +0 -1
  868. package/dist/esm/shopify/queries/index.d.ts +0 -1
  869. package/dist/esm/shopify/src/index.d.ts +0 -5
  870. package/dist/esm/shopify/tsup.config.d.ts +0 -2
  871. package/dist/esm/shopify/types/article.d.ts +0 -48
  872. package/dist/esm/shopify/types/cart.d.ts +0 -173
  873. package/dist/esm/shopify/types/checkout.d.ts +0 -42
  874. package/dist/esm/shopify/types/collection.d.ts +0 -122
  875. package/dist/esm/shopify/types/common.d.ts +0 -42
  876. package/dist/esm/shopify/types/config.d.ts +0 -12
  877. package/dist/esm/shopify/types/customer.d.ts +0 -30
  878. package/dist/esm/shopify/types/fetcher.d.ts +0 -38
  879. package/dist/esm/shopify/types/index.d.ts +0 -12
  880. package/dist/esm/shopify/types/page.d.ts +0 -33
  881. package/dist/esm/shopify/types/product.d.ts +0 -174
  882. package/dist/esm/shopify/types/search.d.ts +0 -54
  883. package/dist/esm/shopify/types/site.d.ts +0 -33
  884. package/dist/esm/shopify/types/type-helper.d.ts +0 -5
  885. package/dist/esm/shopify/utils/colors.d.ts +0 -3
  886. package/dist/esm/shopify/utils/const.d.ts +0 -76
  887. package/dist/esm/shopify/utils/cookie.d.ts +0 -15
  888. package/dist/esm/shopify/utils/errors.d.ts +0 -38
  889. package/dist/esm/shopify/utils/fetch-graphql-api.d.ts +0 -19
  890. package/dist/esm/shopify/utils/handle-fetch-response.d.ts +0 -5
  891. package/dist/esm/shopify/utils/helper.d.ts +0 -28
  892. package/dist/esm/shopify/utils/normalize/cart.d.ts +0 -7
  893. package/dist/esm/shopify/utils/normalize/customer.d.ts +0 -3
  894. package/dist/esm/shopify/utils/normalize/index.d.ts +0 -2
  895. package/dist/esm/shopify/utils/normalize/metafield.d.ts +0 -5
  896. package/dist/esm/shopify/utils/normalize/product.d.ts +0 -16
  897. package/dist/esm/shopify/utils/store.d.ts +0 -2
  898. package/dist/esm/shopify/utils/type-helper.d.ts +0 -5
  899. package/dist/esm/tsconfig.tsbuildinfo +0 -1
  900. package/src/components/credits/context/hooks/useSendEmailValidation.ts +0 -20
  901. package/src/components/credits/context/hooks/useSubscriptions.ts +0 -54
  902. package/src/components/credits/creditsBenefits/benefitItem.tsx +0 -73
  903. package/src/components/credits/creditsCash/index.tsx +0 -102
  904. package/src/helpers/fetchResponse.ts +0 -35
  905. package/src/helpers/fetcher.ts +0 -44
  906. package/src/helpers/index.ts +0 -2
  907. package/src/helpers/track.ts +0 -55
  908. package/src/helpers/utils.ts +0 -8
  909. /package/dist/cjs/components/credits/{credits-redeem-list/address-form → creditsRedeemList/AddressForm}/Input.js +0 -0
  910. /package/dist/cjs/components/credits/{credits-redeem-list/address-form → creditsRedeemList/AddressForm}/type.js +0 -0
  911. /package/dist/cjs/components/credits/{credits-redeem-list → creditsRedeemList}/type.js +0 -0
  912. /package/dist/esm/components/credits/{credits-cash/type.js.map → context/memberPriceTypes.js.map} +0 -0
  913. /package/dist/esm/components/credits/{credits-cash → creditsMemberPrice}/type.js +0 -0
  914. /package/dist/esm/components/credits/{credits-redeem-list/address-form → creditsMemberPrice}/type.js.map +0 -0
  915. /package/dist/esm/components/credits/{credits-redeem-list/address-form → creditsNavigation}/type.js +0 -0
  916. /package/dist/esm/components/credits/{credits-redeem-list → creditsNavigation}/type.js.map +0 -0
  917. /package/dist/esm/components/{credits/credits-redeem-list → registration/authCodeActivate}/type.js +0 -0
  918. /package/src/components/credits/creditsBenefits/{iconInfo.tsx → IconInfo.tsx} +0 -0
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 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,CAAE,KAAAC,EAAM,KAAAC,EAAM,QAAAC,EAAS,GAAGC,CAAM,EAA4B,CACtF,KAAM,CAAE,gBAAAC,EAAiB,QAAAC,CAAQ,KAAI,qBAAkB,EACjD,CAAE,YAAAC,EAAa,OAAAC,CAAO,KAAI,sBAAmB,EAE7C,CAAE,WAAAC,CAAW,KAAI,qBAAkB,EACnC,CAAE,gBAAAC,EAAiB,gBAAAC,CAAgB,EAAIT,EAAK,YAAY,QAExD,CAACU,EAAQC,CAAS,KAAI,YAAmD,MAAM,EAC/E,CAACC,EAASC,CAAU,KAAI,YAAc,EACtC,CAACC,EAAWC,CAAY,KAAI,YAAS,CACzC,KAAM,EACN,QAAS,GACT,SAAU,EACZ,CAAC,EACK,CAACC,EAAUC,CAAW,KAAI,YAAS,EAAK,EAExC,CAAE,UAAAC,EAAY,CAAC,EAAG,UAAWC,EAAiB,KAAI,EAAAC,SAAa,CAAE,mBAAoBf,CAAY,CAAC,EAElG,CAAE,WAAYgB,EAAS,QAAAC,CAAQ,KAAI,oBAAiB,CACxD,UAAUC,EAAc,CACtB,GAAI,CAACA,EAAc,CACjBZ,EAAU,OAAO,EAC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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"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var I=Object.create;var c=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var z=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty;var L=(t,a)=>{for(var e in a)c(t,e,{get:a[e],enumerable:!0})},y=(t,a,e,m)=>{if(a&&typeof a=="object"||typeof a=="function")for(let o of S(a))!E.call(t,o)&&o!==e&&c(t,o,{get:()=>a[o],enumerable:!(m=k(a,o))||m.enumerable});return t};var P=(t,a,e)=>(e=t!=null?I(z(t)):{},y(a||!t||!t.__esModule?c(e,"default",{value:t,enumerable:!0}):e,t)),D=t=>y(c({},"__esModule",{value:!0}),t);var F={};L(F,{RedeemableItem:()=>O});module.exports=D(F);var l=require("react/jsx-runtime"),n=require("@anker-in/headless-ui"),f=require("react"),u=P(require("classnames")),_=require("../context/provider"),p=require("../context/const"),h=require("../context/utils"),s=require("@anker-in/lib"),N=require("./NonProductValue"),C=require("../../../constants");function O({copy:t,className:a,item:e,onRulesOpen:m,onRedeem:o}){const{creditInfo:v,profile:i,gtm:{pageGroup:g},pageCommon:r}=(0,_.useCreditsContext)(),{brand:R}=(0,s.useHeadlessContext)(),d=Object.keys(i||{}).length>0,T=C.ROUNDED_BRANDS.includes(R),w=(0,f.useMemo)(()=>!!(e.alpc?.remainingInventory<=0&&e.alpc?.isLimited||e.alpc?.consumeType===p.AlpcConsumeType.Product&&!e.variant?.availableForSale||d&&i?.activated&&e.alpc?.consumeCredits>Number(v?.available_credit||0)),[e.alpc?.remainingInventory,e.alpc?.isLimited,e.alpc?.consumeType,e.alpc?.consumeCredits,d,i?.activated,v?.available_credit,e.variant?.availableForSale]),b=(0,f.useMemo)(()=>d?e.alpc?.consumeType===p.AlpcConsumeType.Product?e.variant?.availableForSale?t.btnRedeem:r?.soldOut||"Sold Out":t.btnRedeem:t.unlockRewards,[d,e.alpc?.consumeType,e.variant?.availableForSale,t.btnRedeem,t.unlockRewards,r?.soldOut]);return(0,l.jsxs)("div",{className:(0,u.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]",!T&&"rounded-none md:rounded-none",a),children:[e.config?.type===p.ConsumeType.Product?(0,l.jsx)("div",{className:(0,u.default)("relative mx-auto h-[224px] w-fit md:my-[10px] l:h-[120px] l-xxl:h-[138px]"),children:(0,l.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,l.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,l.jsx)(n.Picture,{source:r?.imageMapping?.[e.config?.type]?.url,className:"h-full [&_img]:h-full [&_img]:w-auto [&_img]:object-contain"}),(0,l.jsx)(N.NoneProductValue,{item:e})]}),(0,l.jsxs)("div",{className:(0,u.default)("mt-[22px] flex w-full flex-1 flex-col justify-between"),children:[(0,l.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,l.jsx)("button",{type:"button",onClick:()=>{m(e.config?.rules||[]),(0,s.gaTrack)({event:"ga4Event",event_name:"lp_button",member_active_status:i?.activated?"active":"not active",event_parameters:{page_group:g,position:t.title,button_name:r?.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:x=>{(x.key==="Enter"||x.key===" ")&&x.preventDefault()},children:r?.ruleLabel}),(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"mt-[26px] flex items-center l:mt-[12px] l-xl:mt-[16px]",children:[(0,l.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,l.jsx)(n.Text,{html:`${(0,h.numberFormat)(e.alpc?.consumeCredits)}`,size:2,as:"p",className:"ml-[4px] text-[28px] font-bold mt-[4px] leading-none md:text-[18px] l-xxl:text-[24px] md-l:text-[20px] "})]}),(0,l.jsx)(n.Button,{disabled:w,variant:"primary",size:"lg",className:"mt-[8px] md:px-[8px] l:w-full",onClick:()=>{o(e),(0,s.gaTrack)({event:"ga4Event",event_name:"lp_button",member_active_status:i?.activated?"active":"not active",event_parameters:{page_group:g,position:t.title,button_name:b,info:e.alpc?.id?.toString()}})},children:b})]})]})]})}
2
+ //# sourceMappingURL=RedeemableItem.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 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 } 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 },\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 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 <div className={classNames('relative mx-auto h-[224px] w-fit md:my-[10px] l:h-[120px] l-xxl:h-[138px]')}>\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 </div>\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-[22px] 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-[28px] font-bold mt-[4px] leading-none md:text-[18px] l-xxl:text-[24px] md-l:text-[20px] \"\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,GA4FU,IAAAI,EAAA,6BA5FVC,EAAsC,iCAEtCC,EAAwB,iBAExBC,EAAuB,yBACvBC,EAAkC,+BAElCC,EAA6C,4BAC7CC,EAA6B,4BAE7BC,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,CAAU,EACjB,WAAAC,CACF,KAAI,qBAAkB,EAChB,CAAE,MAAAC,CAAM,KAAI,sBAAmB,EAC/BC,EAAU,OAAO,KAAKJ,GAAW,CAAC,CAAC,EAAE,OAAS,EAC9CK,EAAU,iBAAe,SAASF,CAAK,EAEvCG,KAAa,WAA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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,YAAaQ,GAAY,UACzB,KAAMN,EAAK,MAAM,IAAI,SAAS,CAChC,CACF,CAAC,CACH,EACA,UAAU,uEACV,SAAU,EACV,UAAWa,GAAK,EACVA,EAAE,MAAQ,SAAWA,EAAE,MAAQ,MACjCA,EAAE,eAAe,CAErB,EAEC,SAAAP,GAAY,UACf,KAEF,QAAC,OACC,qBAAC,OAAI,UAAU,yDACb,oBAAC,WACC,UAAU,gEACV,OAAO,6FACT,KACA,OAAC,QACC,KAAM,MAAG,gBAAaN,EAAK,MAAM,cAAc,CAAC,GAChD,KAAM,EACN,GAAG,IACH,UAAU,0GACZ,GACF,KAEA,OAAC,UACC,SAAUU,EACV,QAAQ,UACR,KAAK,KACL,UAAU,gCACV,QAAS,IAAM,CACbR,EAASF,CAAI,KACb,WAAQ,CACN,MAAO,WACP,WAAY,YACZ,qBAAsBI,GAAS,UAAY,SAAW,aACtD,iBAAkB,CAChB,WAAYC,EACZ,SAAUP,EAAK,MACf,YAAaa,EACb,KAAMX,EAAK,MAAM,IAAI,SAAS,CAChC,CACF,CAAC,CACH,EAEC,SAAAW,EACH,GACF,GACF,GACF,CAEJ",
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", "pageCommon", "brand", "isLogin", "rounded", "isDisabled", "redeemButtonText", "classNames", "e"]
7
+ }
@@ -1,13 +1,2 @@
1
- import { CreditsRedeemListCopy } from './type';
2
- export declare function CreditsRedeemList({ copy, className, tabClassName, hideTitle, cardClassName, activate, }: {
3
- copy: CreditsRedeemListCopy;
4
- className?: string;
5
- tabClassName?: string;
6
- hideTitle?: boolean;
7
- cardClassName?: string;
8
- activate: {
9
- openAuthCodePopup: () => void;
10
- isSuccess: boolean;
11
- setOnSuccess: (callback: Function) => void;
12
- };
13
- }): import("react/jsx-runtime").JSX.Element;
1
+ export * from './type';
2
+ export * from './CreditsRedeemList';
@@ -0,0 +1,2 @@
1
+ "use strict";var a=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var t=(r,o,p,x)=>{if(o&&typeof o=="object"||typeof o=="function")for(let m of c(o))!d.call(r,m)&&m!==p&&a(r,m,{get:()=>o[m],enumerable:!(x=b(o,m))||x.enumerable});return r},f=(r,o,p)=>(t(r,o,"default"),p&&t(p,o,"default"));var g=r=>t(a({},"__esModule",{value:!0}),r);var e={};module.exports=g(e);f(e,require("./type"),module.exports);f(e,require("./CreditsRedeemList"),module.exports);
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/components/credits/creditsRedeemList/index.ts"],
4
+ "sourcesContent": ["export * from './type'\nexport * from './CreditsRedeemList'\n"],
5
+ "mappings": "iaAAA,IAAAA,EAAA,kBAAAC,EAAAD,GAAAE,EAAAF,EAAc,kBAAd,gBACAE,EAAAF,EAAc,+BADd",
6
+ "names": ["creditsRedeemList_exports", "__toCommonJS", "__reExport"]
7
+ }
@@ -1,7 +1,6 @@
1
- import { CreditsPageCommon } from '../type';
2
1
  export type CreditsRedeemListCopy = {
3
2
  title: string;
4
- giftCardLabel: string;
3
+ availableCredits: string;
5
4
  unlockRewards: string;
6
5
  btnRedeem: string;
7
6
  list: {
@@ -13,15 +12,6 @@ export type CreditsRedeemListCopy = {
13
12
  rules: string[];
14
13
  }[];
15
14
  }[];
16
- validatorInfo: {
17
- addressInfo: {
18
- name: string;
19
- country: string;
20
- province: string;
21
- city: string;
22
- address: string;
23
- };
24
- };
25
15
  redeemModal: {
26
16
  confirmTitle: string;
27
17
  confirmButton: string;
@@ -71,7 +61,4 @@ export type CreditsRedeemListCopy = {
71
61
  stepTitle: string;
72
62
  };
73
63
  };
74
- copied: string;
75
- off: string;
76
- copy: string;
77
- } & CreditsPageCommon;
64
+ };
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 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"],
5
+ "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
+ "names": ["type_exports", "__toCommonJS"]
7
+ }
@@ -0,0 +1,4 @@
1
+ import { type CreditsWaysToGetCreditsProps } from './type';
2
+ export declare const CreditsWaysToGetCredits: ({ copy, classNames, id }: CreditsWaysToGetCreditsProps & {
3
+ id?: string;
4
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ "use strict";var k=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var H=Object.prototype.hasOwnProperty;var V=(t,n)=>{for(var r in n)k(t,r,{get:n[r],enumerable:!0})},J=(t,n,r,l)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of E(n))!H.call(t,o)&&o!==r&&k(t,o,{get:()=>n[o],enumerable:!(l=q(n,o))||l.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"),I=require("framer-motion"),a=require("react"),x=require("./type"),y=require("./useActions"),D=require("../context/provider"),d=require("@anker-in/lib"),R=require("../../registration"),T=require("../modal/creditsUploadReceiptModal"),U=require("../modal/subscribeModal"),L=require("../../../constants");const Q=({copy:t,classNames:n,id:r})=>{const[l,o]=(0,a.useState)(!1),{profile:M}=(0,D.useCreditsContext)(),{authCodeActivate:O}=(0,R.useRegistration)(),{brand:A}=(0,d.useHeadlessContext)(),C=L.ROUNDED_BRANDS.includes(A),b=!!M,[B,N]=(0,a.useState)(!1),[P,h]=(0,a.useState)(!1),[w,G]=(0,a.useState)(!1),[F,W]=(0,a.useState)(!1),{actions:v}=(0,y.useActions)({copy:t,subscribe:{openSubscribePopup:()=>h(!0),isSuccess:w},uploadReceipt:{openUploadReceiptPopup:()=>N(!0),isSuccess:F}}),_=(0,a.useMemo)(()=>{const s=t.list.map(p=>{if(!v[p.id])return;const{finished:c,notLogin:S,notFinished:g,completed:j}=v[p.id];let m="",u,z;return b?c?(m=j.buttonLabel,u=void 0):(m=g.buttonLabel,u=g.handleClick,z=g.link):(m=S.buttonLabel,u=S.handleClick),{...p,buttonLabel:m,handleClick:u,finished:c,link:z}}).filter(Boolean);return b?s.sort((p,c)=>p?.finished&&!c?.finished?1:!p?.finished&&c?.finished?-1:0):s},[v,t.list,b]);return(0,e.jsxs)(i.Container,{id:r,className:" bg-[#F5F5F7] [&>div]:l:!px-0",children:[(0,e.jsxs)("div",{className:(0,d.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,d.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)(I.motion.div,{className:(0,d.classNames)("relative mt-[64px] grid grid-cols-3 gap-[16px] overflow-hidden md:mt-[16px] md:grid-cols-1 l:gap-[12px] min-md:!h-auto md-l:mt-[32px] md-l:grid-cols-2"),initial:{height:512},animate:{height:l?"auto":512},transition:{duration:.3},onAnimationComplete:()=>{if(!l&&window.screen.width<768){const s=document.getElementById("ways-to-get-credits");s&&s.scrollIntoView({behavior:"smooth",block:"end"})}},children:[_.map(s=>(0,e.jsxs)("div",{className:(0,d.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)),!l&&(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%)"}})]}),l?(0,e.jsx)("button",{className:"mx-auto mt-[12px] block w-fit min-md:hidden",onClick:()=>{o(!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:()=>o(!l),children:(0,e.jsx)(f.ChevronDownIcon,{className:"size-[40px] rounded-full bg-[#FFFFFF33] p-[8px]"})})})})]})]}),t.receipt&&(0,e.jsx)(T.CreditsUploadReceiptModal,{isOpen:B,onClose:()=>{N(!1)},copy:t.receipt,onSuccess:()=>{W(!0)}}),t.subscribe&&(0,e.jsx)(U.CreditsSubscribeModal,{copy:t.subscribe,onSuccess:()=>{G(!0),setTimeout(()=>{h(!1)},3e3)},isOpen:P,onClose:()=>{h(!1)}})]})};
2
+ //# sourceMappingURL=CreditsWaysToGetCredits.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 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 { motion } from 'framer-motion'\nimport { useMemo, useState } from 'react'\n\nimport { TaskType, type CreditsWaysToGetCreditsProps } from './type'\nimport { useActions } from './useActions'\nimport { useCreditsContext } from '../context/provider'\nimport { 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 { 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 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 <motion.div\n className={cn(\n 'relative mt-[64px] grid grid-cols-3 gap-[16px] overflow-hidden md:mt-[16px] md:grid-cols-1 l:gap-[12px] min-md:!h-auto md-l:mt-[32px] md-l:grid-cols-2'\n )}\n initial={{ height: 512 }}\n animate={{ height: showMore ? 'auto' : 512 }}\n transition={{ duration: 0.3 }}\n onAnimationComplete={() => {\n if (!showMore && window.screen.width < 768) {\n const section = document.getElementById('ways-to-get-credits')\n if (section) {\n section.scrollIntoView({ behavior: 'smooth', block: 'end' })\n }\n }\n }}\n >\n {list.map(item => (\n <div\n key={item.id}\n className={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 </motion.div>\n {showMore ? (\n <button\n className=\"mx-auto mt-[12px] block w-fit min-md:hidden\"\n onClick={() => {\n setShowMore(false)\n }}\n >\n <ChevronUpIcon className=\"size-[40px] rounded-full bg-[#FFFFFF33] p-[8px]\"></ChevronUpIcon>\n </button>\n ) : (\n <>\n <div className=\"absolute bottom-0 flex w-full translate-y-1/2 justify-center min-md:hidden\">\n <button className=\"w-fit\" onClick={() => setShowMore(!showMore)}>\n <ChevronDownIcon className=\"size-[40px] rounded-full bg-[#FFFFFF33] p-[8px]\"></ChevronDownIcon>\n </button>\n </div>\n </>\n )}\n </div>\n </div>\n {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
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,6BAAAE,IAAA,eAAAC,EAAAH,GAqGQ,IAAAI,EAAA,6BArGRC,EAA0D,iCAC1DC,EAA+C,uCAC/CC,EAAuB,yBACvBC,EAAkC,iBAElCC,EAA4D,kBAC5DC,EAA2B,wBAC3BC,EAAkC,+BAClCC,EAAqD,yBACrDC,EAAgC,8BAChCC,EAA0C,8CAC1CC,EAAsC,mCACtCC,EAA+B,8BAExB,MAAMd,EAA0B,CAAC,CAAE,KAAAe,EAAM,WAAAC,EAAY,GAAAC,CAAG,IAAsD,CACnH,KAAM,CAACC,EAAUC,CAAW,KAAI,YAAS,EAAK,EACxC,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,CAACC,EAAsBC,CAAuB,KAAI,YAAS,EAAK,EAChE,CAACC,EAAoBC,CAAqB,KAAI,YAAS,EAAK,EAC5D,CAACC,EAAwBC,CAAyB,KAAI,YAAS,EAAK,EAEpE,CAAE,QAAAC,CAAQ,KAAI,cAAW,CAC7B,KAAAlB,EACA,UAAW,CACT,mBAAoB,IAAMa,EAAwB,EAAI,EACtD,UAAWC,CACb,EACA,cAAe,CACb,uBAAwB,IAAMH,EAA4B,EAAI,EAC9D,UAAWK,CACb,CACF,CAAC,EACKG,KAAO,WAAQ,IAAM,CACzB,MAAMA,EAAOnB,EAAK,KACf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AO,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,OAAQU,EACR,QAAS,IAAM,CACbC,EAA4B,EAAK,CACnC,EACA,KAAMX,EAAK,QACX,UAAW,IAAM,CACfiB,EAA0B,EAAI,CAChC,EACF,EAEDjB,EAAK,cACJ,OAAC,yBACC,KAAMA,EAAK,UACX,UAAW,IAAM,CACfe,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_framer_motion", "import_react", "import_type", "import_useActions", "import_provider", "import_lib", "import_registration", "import_creditsUploadReceiptModal", "import_subscribeModal", "import_constants", "copy", "classNames", "id", "showMore", "setShowMore", "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", "cn", "section"]
7
+ }
@@ -1,2 +1,2 @@
1
- import { type CreditsWaysToGetCreditsProps } from './type';
2
- export declare const CreditsWaysToGetCredits: ({ copy, activate, subscribe, uploadReceipt, classNames, }: CreditsWaysToGetCreditsProps) => import("react/jsx-runtime").JSX.Element;
1
+ export * from './type';
2
+ export * from './CreditsWaysToGetCredits';
@@ -0,0 +1,2 @@
1
+ "use strict";var a=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var t=(r,o,p,x)=>{if(o&&typeof o=="object"||typeof o=="function")for(let m of c(o))!d.call(r,m)&&m!==p&&a(r,m,{get:()=>o[m],enumerable:!(x=b(o,m))||x.enumerable});return r},f=(r,o,p)=>(t(r,o,"default"),p&&t(p,o,"default"));var g=r=>t(a({},"__esModule",{value:!0}),r);var e={};module.exports=g(e);f(e,require("./type"),module.exports);f(e,require("./CreditsWaysToGetCredits"),module.exports);
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/components/credits/creditsWaysToGetCredits/index.ts"],
4
+ "sourcesContent": ["export * from './type'\nexport * from './CreditsWaysToGetCredits'\n"],
5
+ "mappings": "iaAAA,IAAAA,EAAA,kBAAAC,EAAAD,GAAAE,EAAAF,EAAc,kBAAd,gBACAE,EAAAF,EAAc,qCADd",
6
+ "names": ["creditsWaysToGetCredits_exports", "__toCommonJS", "__reExport"]
7
+ }
@@ -1,10 +1,11 @@
1
1
  import type { ReceiptCopy } from '../modal/creditsUploadReceiptModal';
2
+ import type { CreditsSubscribeModalCopy } from '../modal/subscribeModal';
2
3
  export type BenefitItem = {
3
4
  title: string;
4
5
  credits: string;
5
6
  id: string;
6
7
  };
7
- export type WaysToGetCreditsCopy = {
8
+ export type CreditsWaysToGetCreditsCopy = {
8
9
  title: string;
9
10
  subtitle: string;
10
11
  equalCredits: string;
@@ -22,13 +23,14 @@ export type WaysToGetCreditsCopy = {
22
23
  goShopLink: string;
23
24
  uploadReceipt: string;
24
25
  shopNow: string;
25
- subscribe: string;
26
+ subscribeLabel: string;
26
27
  sendEmailSuccess: string;
27
28
  creditsIcon: {
28
29
  url: string;
29
30
  alt: string;
30
31
  };
31
32
  receipt: ReceiptCopy;
33
+ subscribe: CreditsSubscribeModalCopy;
32
34
  };
33
35
  export declare enum TaskType {
34
36
  Activate = "activate",
@@ -39,22 +41,9 @@ export declare enum TaskType {
39
41
  Shop = "shop"
40
42
  }
41
43
  export type CreditsWaysToGetCreditsProps = {
42
- copy: WaysToGetCreditsCopy;
44
+ copy: CreditsWaysToGetCreditsCopy;
43
45
  classNames?: {
44
46
  equalCreditsText?: string;
45
47
  subtitle?: string;
46
48
  };
47
- activate: {
48
- openAuthCodePopup: () => void;
49
- isSuccess: boolean;
50
- isSendingActivateEmail: boolean;
51
- };
52
- subscribe: {
53
- openSubscribePopup: () => void;
54
- isSuccess: boolean;
55
- };
56
- uploadReceipt: {
57
- openUploadReceiptPopup: () => void;
58
- isSuccess: boolean;
59
- };
60
49
  };
@@ -0,0 +1,2 @@
1
+ "use strict";var o=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var d=(e,t)=>{for(var s in t)o(e,s,{get:t[s],enumerable:!0})},g=(e,t,s,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of l(t))!a.call(e,r)&&r!==s&&o(e,r,{get:()=>t[r],enumerable:!(c=p(t,r))||c.enumerable});return e};var u=e=>g(o({},"__esModule",{value:!0}),e);var m={};d(m,{TaskType:()=>n});module.exports=u(m);var n=(i=>(i.Activate="activate",i.Subscribe="subscribe",i.CompleteProfile="completeProfile",i.FirstPurchase="firstPurchase",i.UploadReceipt="uploadReceipt",i.Shop="shop",i))(n||{});
2
+ //# sourceMappingURL=type.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 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"],
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
+ "names": ["type_exports", "__export", "TaskType", "__toCommonJS"]
7
+ }
@@ -1,5 +1,14 @@
1
- import type { CreditsWaysToGetCreditsProps } from './type';
2
- export declare const useActions: ({ copy, subscribe, uploadReceipt, activate, gaParameters, }: CreditsWaysToGetCreditsProps & {
1
+ import type { CreditsWaysToGetCreditsCopy } from './type';
2
+ export declare const useActions: ({ copy, subscribe, uploadReceipt, gaParameters, }: {
3
+ copy: CreditsWaysToGetCreditsCopy;
4
+ subscribe: {
5
+ openSubscribePopup: () => void;
6
+ isSuccess: boolean;
7
+ };
8
+ uploadReceipt: {
9
+ openUploadReceiptPopup: () => void;
10
+ isSuccess: boolean;
11
+ };
3
12
  gaParameters?: {
4
13
  position: string;
5
14
  };
@@ -0,0 +1,2 @@
1
+ "use strict";var j=Object.create;var b=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var U=Object.getOwnPropertyNames;var A=Object.getPrototypeOf,T=Object.prototype.hasOwnProperty;var x=(e,i)=>{for(var n in i)b(e,n,{get:i[n],enumerable:!0})},k=(e,i,n,s)=>{if(i&&typeof i=="object"||typeof i=="function")for(let o of U(i))!T.call(e,o)&&o!==n&&b(e,o,{get:()=>i[o],enumerable:!(s=_(i,o))||s.enumerable});return e};var G=(e,i,n)=>(n=e!=null?j(A(e)):{},k(i||!e||!e.__esModule?b(n,"default",{value:e,enumerable:!0}):n,e)),W=e=>k(b({},"__esModule",{value:!0}),e);var $={};x($,{useActions:()=>E});module.exports=W($);var r=require("@anker-in/lib"),t=require("./type"),L=require("../context/provider"),u=require("react"),f=G(require("../context/hooks/useReceiptUploaded")),N=require("../context/hooks/useFirstPurchaseFinished"),C=require("../context/hooks/useSubscribed"),P=require("../../registration");const E=({copy:e,subscribe:i,uploadReceipt:n,gaParameters:s})=>{const{openSignUpPopup:o,gtm:g,profile:l}=(0,L.useCreditsContext)(),{authCodeActivate:d}=(0,P.useRegistration)(),c=(0,C.useSubscribed)(),m=(0,N.useFirstPurchaseFinished)(),p=(0,f.default)(),{appName:v,passportUrl:F}=(0,r.useHeadlessContext)(),h=(0,u.useMemo)(()=>(l?.first_name||l?.last_name)&&l?.phone_number&&l?.dob,[l]);return(0,u.useMemo)(()=>{const a=({buttonName:S,id:w,callback:R})=>{(0,r.gaTrack)({event:"ga4Event",event_name:"lp_button",member_active_status:l?.activated?"active":"not active",event_parameters:{page_group:g.pageGroup,position:s?.position||e.title,button_name:S,info:w}}),R()};return{actions:{[t.TaskType.Activate]:{finished:l?.activated,notLogin:{buttonLabel:e?.joinNow,handleClick:()=>a({buttonName:e?.joinNow,callback:o,id:t.TaskType.Activate})},notFinished:{buttonLabel:e?.activate,handleClick:()=>a({buttonName:e?.activate,callback:()=>{d.setAutoSendEmail(!0),d.open()},id:t.TaskType.Activate})},completed:{buttonLabel:e?.completed}},[t.TaskType.Subscribe]:{finished:c,notLogin:{buttonLabel:e?.joinNow,handleClick:()=>a({buttonName:e?.joinNow,callback:o,id:t.TaskType.Subscribe})},notFinished:{buttonLabel:e?.subscribeLabel,handleClick:()=>a({buttonName:e?.subscribeLabel,callback:()=>i.openSubscribePopup(),id:t.TaskType.Subscribe})},completed:{buttonLabel:e?.completed}},[t.TaskType.CompleteProfile]:{finished:h,notLogin:{buttonLabel:e?.joinNow,handleClick:()=>a({buttonName:e?.joinNow,callback:o,id:t.TaskType.CompleteProfile})},notFinished:{buttonLabel:e?.completeProfile,link:`${F}/account/profile?app=${v}`,handleClick:()=>a({buttonName:e?.completeProfile,callback:()=>{},id:t.TaskType.CompleteProfile})},completed:{buttonLabel:e?.completed}},[t.TaskType.FirstPurchase]:{finished:m,notLogin:{buttonLabel:e?.makeFirstPurchase,handleClick:()=>a({buttonName:e?.makeFirstPurchase,callback:o,id:t.TaskType.FirstPurchase})},notFinished:{buttonLabel:e?.makeFirstPurchase,link:e?.goShopLink,handleClick:()=>a({buttonName:e?.makeFirstPurchase,callback:()=>{},id:t.TaskType.FirstPurchase})},completed:{buttonLabel:e?.completed}},[t.TaskType.UploadReceipt]:{finished:p,notLogin:{buttonLabel:e?.joinNow,handleClick:()=>a({buttonName:e?.joinNow,callback:o,id:t.TaskType.UploadReceipt})},notFinished:{buttonLabel:e?.uploadReceipt,handleClick:()=>a({buttonName:e?.uploadReceipt,callback:()=>n.openUploadReceiptPopup(),id:t.TaskType.UploadReceipt})},completed:{buttonLabel:e?.completed}},[t.TaskType.Shop]:{finished:!1,notLogin:{buttonLabel:e?.joinNow,handleClick:()=>a({buttonName:e?.joinNow,callback:o,id:t.TaskType.Shop})},notFinished:{buttonLabel:e?.shopNow,link:e?.goShopLink,handleClick:()=>a({buttonName:e?.shopNow,callback:()=>{},id:t.TaskType.Shop})},completed:{buttonLabel:e?.completed}}}}},[l?.activated,e?.joinNow,e?.activate,e?.completed,e?.subscribe,e?.completeProfile,e?.makeFirstPurchase,e?.uploadReceipt,e?.shopNow,e.title,e?.goShopLink,c,h,m,p,s?.position,o])};
2
+ //# sourceMappingURL=useActions.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/components/credits/creditsWaysToGetCredits/useActions.ts"],
4
+ "sourcesContent": ["import { useHeadlessContext, gaTrack } from '@anker-in/lib'\n\nimport { TaskType } from './type'\nimport { useCreditsContext } from '../context/provider'\nimport { useMemo } from 'react'\nimport useReceiptUploaded from '../context/hooks/useReceiptUploaded'\nimport { useFirstPurchaseFinished } from '../context/hooks/useFirstPurchaseFinished'\nimport { useSubscribed } from '../context/hooks/useSubscribed'\nimport type { CreditsWaysToGetCreditsCopy } from './type'\n\nimport { useRegistration } from '../../registration'\n\nexport const useActions = ({\n copy,\n subscribe,\n uploadReceipt,\n gaParameters,\n}: {\n copy: CreditsWaysToGetCreditsCopy\n subscribe: {\n openSubscribePopup: () => void\n isSuccess: boolean\n }\n uploadReceipt: {\n openUploadReceiptPopup: () => void\n isSuccess: boolean\n }\n gaParameters?: {\n position: string\n }\n}) => {\n const { openSignUpPopup, gtm, profile } = useCreditsContext()\n const { authCodeActivate } = useRegistration()\n const isSubscribed = useSubscribed()\n const firstPurchaseFinished = useFirstPurchaseFinished()\n const uploadedReceipt = useReceiptUploaded()\n const { appName, passportUrl } = useHeadlessContext()\n\n const profileCompleted = useMemo(() => {\n return (profile?.first_name || profile?.last_name) && profile?.phone_number && profile?.dob\n }, [profile])\n\n return useMemo(() => {\n const handleClickWithTrack = ({\n buttonName,\n id,\n callback,\n }: {\n buttonName: string\n id?: string\n callback: () => void\n }) => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'lp_button',\n member_active_status: profile?.activated ? 'active' : 'not active',\n event_parameters: {\n page_group: gtm.pageGroup,\n position: gaParameters?.position || copy.title,\n button_name: buttonName,\n info: id,\n },\n })\n callback()\n }\n return {\n actions: {\n [TaskType.Activate]: {\n finished: profile?.activated,\n notLogin: {\n buttonLabel: copy?.joinNow,\n handleClick: () =>\n handleClickWithTrack({ buttonName: copy?.joinNow, callback: openSignUpPopup, id: TaskType.Activate }),\n },\n notFinished: {\n buttonLabel: copy?.activate,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.activate,\n callback: () => {\n authCodeActivate.setAutoSendEmail(true)\n authCodeActivate.open()\n },\n id: TaskType.Activate,\n }),\n },\n completed: {\n buttonLabel: copy?.completed,\n },\n },\n [TaskType.Subscribe]: {\n finished: isSubscribed,\n notLogin: {\n buttonLabel: copy?.joinNow,\n handleClick: () =>\n handleClickWithTrack({ buttonName: copy?.joinNow, callback: openSignUpPopup, id: TaskType.Subscribe }),\n },\n notFinished: {\n buttonLabel: copy?.subscribeLabel,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.subscribeLabel,\n callback: () => subscribe.openSubscribePopup(),\n id: TaskType.Subscribe,\n }),\n },\n completed: {\n buttonLabel: copy?.completed,\n },\n },\n [TaskType.CompleteProfile]: {\n finished: profileCompleted,\n notLogin: {\n buttonLabel: copy?.joinNow,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.joinNow,\n callback: openSignUpPopup,\n id: TaskType.CompleteProfile,\n }),\n },\n notFinished: {\n buttonLabel: copy?.completeProfile,\n link: `${passportUrl}/account/profile?app=${appName}`,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.completeProfile,\n callback: () => {},\n id: TaskType.CompleteProfile,\n }),\n },\n completed: {\n buttonLabel: copy?.completed,\n },\n },\n [TaskType.FirstPurchase]: {\n finished: firstPurchaseFinished,\n notLogin: {\n buttonLabel: copy?.makeFirstPurchase,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.makeFirstPurchase,\n callback: openSignUpPopup,\n id: TaskType.FirstPurchase,\n }),\n },\n notFinished: {\n buttonLabel: copy?.makeFirstPurchase,\n link: copy?.goShopLink,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.makeFirstPurchase,\n callback: () => {},\n id: TaskType.FirstPurchase,\n }),\n },\n completed: {\n buttonLabel: copy?.completed,\n },\n },\n [TaskType.UploadReceipt]: {\n finished: uploadedReceipt,\n notLogin: {\n buttonLabel: copy?.joinNow,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.joinNow,\n callback: openSignUpPopup,\n id: TaskType.UploadReceipt,\n }),\n },\n notFinished: {\n buttonLabel: copy?.uploadReceipt,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.uploadReceipt,\n callback: () => uploadReceipt.openUploadReceiptPopup(),\n id: TaskType.UploadReceipt,\n }),\n },\n completed: {\n buttonLabel: copy?.completed,\n },\n },\n [TaskType.Shop]: {\n finished: false,\n notLogin: {\n buttonLabel: copy?.joinNow,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.joinNow,\n callback: openSignUpPopup,\n id: TaskType.Shop,\n }),\n },\n notFinished: {\n buttonLabel: copy?.shopNow,\n link: copy?.goShopLink,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.shopNow,\n callback: () => {},\n id: TaskType.Shop,\n }),\n },\n completed: {\n buttonLabel: copy?.completed,\n },\n },\n },\n }\n }, [\n profile?.activated,\n copy?.joinNow,\n copy?.activate,\n copy?.completed,\n copy?.subscribe,\n copy?.completeProfile,\n copy?.makeFirstPurchase,\n copy?.uploadReceipt,\n copy?.shopNow,\n copy.title,\n copy?.goShopLink,\n isSubscribed,\n profileCompleted,\n firstPurchaseFinished,\n uploadedReceipt,\n gaParameters?.position,\n openSignUpPopup,\n ])\n}\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,gBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAA4C,yBAE5CC,EAAyB,kBACzBC,EAAkC,+BAClCC,EAAwB,iBACxBC,EAA+B,kDAC/BC,EAAyC,qD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ACXe,EAAqB,CACnB,WAAYf,GAAM,cAClB,SAAU,IAAME,EAAc,uBAAuB,EACrD,GAAI,WAAS,aACf,CAAC,CACL,EACA,UAAW,CACT,YAAaF,GAAM,SACrB,CACF,EACA,CAAC,WAAS,IAAI,EAAG,CACf,SAAU,GACV,SAAU,CACR,YAAaA,GAAM,QACnB,YAAa,IACXe,EAAqB,CACnB,WAAYf,GAAM,QAClB,SAAUI,EACV,GAAI,WAAS,IACf,CAAC,CACL,EACA,YAAa,CACX,YAAaJ,GAAM,QACnB,KAAMA,GAAM,WACZ,YAAa,IACXe,EAAqB,CACnB,WAAYf,GAAM,QAClB,SAAU,IAAM,CAAC,EACjB,GAAI,WAAS,IACf,CAAC,CACL,EACA,UAAW,CACT,YAAaA,GAAM,SACrB,CACF,CACF,CACF,CACF,EAAG,CACDM,GAAS,UACTN,GAAM,QACNA,GAAM,SACNA,GAAM,UACNA,GAAM,UACNA,GAAM,gBACNA,GAAM,kBACNA,GAAM,cACNA,GAAM,QACNA,EAAK,MACLA,GAAM,WACNQ,EACAM,EACAL,EACAC,EACAP,GAAc,SACdC,CACF,CAAC,CACH",
6
+ "names": ["useActions_exports", "__export", "useActions", "__toCommonJS", "import_lib", "import_type", "import_provider", "import_react", "import_useReceiptUploaded", "import_useFirstPurchaseFinished", "import_useSubscribed", "import_registration", "copy", "subscribe", "uploadReceipt", "gaParameters", "openSignUpPopup", "gtm", "profile", "authCodeActivate", "isSubscribed", "firstPurchaseFinished", "uploadedReceipt", "useReceiptUploaded", "appName", "passportUrl", "profileCompleted", "handleClickWithTrack", "buttonName", "id", "callback"]
7
+ }
@@ -15,12 +15,15 @@ export interface MyRewardsMetafields {
15
15
  pendingTip: string;
16
16
  processingTip: string;
17
17
  ShippedTip: string;
18
- emptyListImageUrl: string;
19
18
  emptyListLabel: string;
20
19
  pointUnit: string;
21
20
  code: string;
22
21
  copied: string;
23
22
  copy: string;
23
+ emptyListImage: {
24
+ url: string;
25
+ alt?: string;
26
+ };
24
27
  }
25
28
  interface MyRewardsModalProps extends ModalContainerProps {
26
29
  data: MyRewardsMetafields;
@@ -1,2 +1,2 @@
1
- "use strict";var H=Object.create;var f=Object.defineProperty;var K=Object.getOwnPropertyDescriptor;var V=Object.getOwnPropertyNames;var q=Object.getPrototypeOf,B=Object.prototype.hasOwnProperty;var G=(o,n)=>{for(var s in n)f(o,s,{get:n[s],enumerable:!0})},S=(o,n,s,c)=>{if(n&&typeof n=="object"||typeof n=="function")for(let p of V(n))!B.call(o,p)&&p!==s&&f(o,p,{get:()=>n[p],enumerable:!(c=K(n,p))||c.enumerable});return o};var d=(o,n,s)=>(s=o!=null?H(q(o)):{},S(n||!o||!o.__esModule?f(s,"default",{value:o,enumerable:!0}):s,o)),J=o=>S(f({},"__esModule",{value:!0}),o);var X={};G(X,{default:()=>W});module.exports=J(X);var i=require("react/jsx-runtime"),a=require("@anker-in/headless-ui"),g=d(require("classnames")),R=d(require("copy-to-clipboard")),F=d(require("dayjs")),r=require("react"),e=require("../context/const"),h=require("./modalContainer"),_=d(require("./tip")),A=d(require("./loadingDots")),v=d(require("../context/hooks/useMyRewards"));function Q({data:o,...n}){const[s,c]=(0,r.useState)(e.AlpcConsumeType.Coupon),[p,D]=(0,r.useState)(1),[u,O]=(0,r.useState)(1),[U,b]=(0,r.useState)(-1),k=(0,r.useMemo)(()=>{const t=[];return o.couponTab&&t.push({title:o.couponTab,type:e.AlpcConsumeType.Coupon}),o.productTab&&t.push({title:o.productTab,type:e.AlpcConsumeType.Product}),t},[o.couponTab,o.productTab]),I=(0,r.useMemo)(()=>({page:n.isOpen?u:0,pageSize:1e3,consumeType:e.AlpcConsumeType.Product}),[n.isOpen,u]),Y=(0,r.useMemo)(()=>({page:n.isOpen?p:0,pageSize:1e3,consumeType:e.AlpcConsumeType.Coupon}),[n.isOpen,p]),{myRewards:x=[],canNext:y,isLoading:C}=(0,v.default)(Y),{myRewards:T=[],canNext:N,isLoading:L}=(0,v.default)(I),P=(0,r.useMemo)(()=>s===e.AlpcConsumeType.Coupon?x.map(t=>({title:t.goods_title,value:t.consume_credits,type:e.RewardType.Received,date:new Date(t.create_time*1e3),couponCode:t.coupon_code,orderNumber:""})):s===e.AlpcConsumeType.Product?T.map(t=>{let l=e.RewardType.Pending;return t.fulfillment_status&&t.fulfillment_status!=="null"?t.fulfillment_status==="fulfilled"?l=e.RewardType.Fulfilled:l=e.RewardType.Unfulfilled:t.approval_status===e.ApprovalStatus.Success||t.approval_status===e.ApprovalStatus.DoubleConfirm?l=e.RewardType.ApproveSuccess:t.approval_status===e.ApprovalStatus.Failed&&(l=e.RewardType.Failed),{title:t.goods_title,value:t.consume_credits,type:l,date:new Date(t.create_time*1e3),orderNumber:t.order_number,couponCode:""}}):[],[s,T,x]),M=(0,r.useMemo)(()=>s===e.AlpcConsumeType.Coupon?y:s===e.AlpcConsumeType.Product?N:!1,[s,y,N]),j=(0,r.useMemo)(()=>({[e.RewardType.Received]:o.receivedLabel,[e.RewardType.Pending]:o.pendingLabel,[e.RewardType.ApproveFail]:o.failedLabel,[e.RewardType.ApproveSuccess]:o.approveSuccessLabel,[e.RewardType.Unfulfilled]:o.unfulfilledLabel,[e.RewardType.Fulfilled]:o.fulfilledLabel,[e.RewardType.Failed]:o.failedLabel}),[o]),w=(0,r.useMemo)(()=>({[e.RewardType.Received]:"",[e.RewardType.Pending]:o.pendingTip,[e.RewardType.ApproveFail]:"",[e.RewardType.ApproveSuccess]:o.confirmedTip,[e.RewardType.Unfulfilled]:o.processingTip,[e.RewardType.Fulfilled]:o.ShippedTip,[e.RewardType.Failed]:""}),[o]),E=(0,r.useMemo)(()=>({[e.RewardType.Received]:"#52C41A",[e.RewardType.Pending]:"#999",[e.RewardType.ApproveFail]:"#F84D4F",[e.RewardType.ApproveSuccess]:"#999",[e.RewardType.Unfulfilled]:"#999",[e.RewardType.Fulfilled]:"#999",[e.RewardType.Failed]:"#F84D4F"}),[]),$=(0,r.useCallback)(()=>{M&&(s===e.AlpcConsumeType.Coupon?D(p+1):s===e.AlpcConsumeType.Product&&O(u+1))},[s,u,p,M]),z=(0,r.useCallback)((t,l)=>{b(l),(0,R.default)(t),setTimeout(()=>{b(-1)},2e3)},[]);return(0,i.jsxs)(h.CreditsModalContainer,{title:o.title,className:(0,g.default)("h-[800px] w-[640px]"),useAnimation:!0,animationClassName:"md:translate-y-[100vh]",scrollClassName:"min-l:px-0 md:mb-0 md:px-0",...n,onScrollEnd:$,children:[(0,i.jsx)("div",{className:"px-[24px] md:px-[16px]",children:(0,i.jsx)(a.Tabs,{align:"left",shape:"rounded",value:s.toString(),onValueChange:t=>{c(Number(t))},children:(0,i.jsx)(a.TabsList,{children:k.map(t=>(0,i.jsx)(a.TabsTrigger,{value:t.type.toString(),children:t.title},t.type))})})}),(0,i.jsxs)("div",{className:"mt-[24px] overflow-auto overscroll-contain px-[24px] md:px-[16px]",children:[!P.length&&!C&&!L&&(0,i.jsxs)("div",{className:"flex h-full flex-col items-center justify-center",children:[(0,i.jsx)(a.Picture,{className:"mb-[12px] w-[160px]",src:o?.emptyListImageUrl}),(0,i.jsx)("div",{className:"text-[16px] font-semibold leading-[1.4]",children:o?.emptyListLabel})]}),C||L&&(0,i.jsx)("div",{className:"flex h-full flex-col items-center justify-center",children:(0,i.jsx)(A.default,{})}),(0,i.jsx)("div",{className:"grid gap-[18px] md:gap-[12px]",children:P.map((t,l)=>(0,i.jsxs)("div",{className:"grid gap-[8px]",children:[t?.orderNumber&&(0,i.jsxs)("div",{className:"text-[15px] font-semibold leading-[1.4] text-[#777]",children:[o.orderNumberLabel,": ",t.orderNumber]}),(0,i.jsxs)("div",{className:"flex items-center justify-between rounded-[8px] bg-[#f7f8f9] px-[16px] py-[20px]",children:[(0,i.jsxs)("div",{className:"grid gap-[4px]",children:[(0,i.jsx)("div",{className:"text-[16px] font-bold leading-[1.4]",children:t.title}),(0,i.jsxs)("div",{className:"text-[14px] font-semibold text-[#999]",children:[o.valueLabel,": ",t.value," ",o?.pointUnit]}),(0,i.jsxs)("div",{className:"text-[14px] font-semibold text-[#999]",children:[t?.couponCode?`${o?.code||"Code"}: ${t.couponCode} `:"",t?.couponCode&&(0,i.jsx)("span",{className:"cursor-pointer text-[14px] font-semibold text-brand underline",onClick:()=>{z(t.couponCode,l)},role:"button",tabIndex:0,onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&m.preventDefault()},children:U===l?o?.copied||"COPIED":o?.copy||"COPY"})]})]}),(0,i.jsxs)("div",{className:"grid gap-[4px] text-right",children:[(0,i.jsxs)("div",{className:(0,g.default)("flex items-center justify-end text-[16px] font-bold leading-[1.4]",`text-[${E[t.type]}]`),children:[(0,i.jsx)("span",{children:j[t.type]}),w[t.type]&&(0,i.jsx)(_.default,{info:w[t.type],index:l})]}),(0,i.jsx)("div",{className:"text-[14px] font-semibold text-[#999]",children:(0,F.default)(t.date).format("YYYY-MM-DD HH:mm").toString()})]})]})]},l))})]})]})}var W=Q;
1
+ "use strict";var G=Object.create;var m=Object.defineProperty;var J=Object.getOwnPropertyDescriptor;var Q=Object.getOwnPropertyNames;var W=Object.getPrototypeOf,X=Object.prototype.hasOwnProperty;var Z=(o,n)=>{for(var s in n)m(o,s,{get:n[s],enumerable:!0})},S=(o,n,s,u)=>{if(n&&typeof n=="object"||typeof n=="function")for(let a of Q(n))!X.call(o,a)&&a!==s&&m(o,a,{get:()=>n[a],enumerable:!(u=J(n,a))||u.enumerable});return o};var d=(o,n,s)=>(s=o!=null?G(W(o)):{},S(n||!o||!o.__esModule?m(s,"default",{value:o,enumerable:!0}):s,o)),ee=o=>S(m({},"__esModule",{value:!0}),o);var ie={};Z(ie,{default:()=>te});module.exports=ee(ie);var i=require("react/jsx-runtime"),p=require("@anker-in/headless-ui"),g=d(require("classnames")),F=d(require("copy-to-clipboard")),_=d(require("dayjs")),r=require("react"),e=require("../context/const"),h=require("./modalContainer"),D=d(require("./tip")),A=d(require("./loadingDots")),v=d(require("../context/hooks/useMyRewards")),O=require("@anker-in/lib"),I=require("../../../constants");function oe({data:o,...n}){const[s,u]=(0,r.useState)(e.AlpcConsumeType.Coupon),{brand:a}=(0,O.useHeadlessContext)(),x=I.ROUNDED_BRANDS.includes(a),[c,U]=(0,r.useState)(1),[f,k]=(0,r.useState)(1),[E,y]=(0,r.useState)(-1),Y=(0,r.useMemo)(()=>{const t=[];return o.couponTab&&t.push({title:o.couponTab,type:e.AlpcConsumeType.Coupon}),o.productTab&&t.push({title:o.productTab,type:e.AlpcConsumeType.Product}),t},[o.couponTab,o.productTab]),j=(0,r.useMemo)(()=>({page:n.isOpen?f:0,pageSize:1e3,consumeType:e.AlpcConsumeType.Product}),[n.isOpen,f]),H=(0,r.useMemo)(()=>({page:n.isOpen?c:0,pageSize:1e3,consumeType:e.AlpcConsumeType.Coupon}),[n.isOpen,c]),{myRewards:C=[],canNext:N,isLoading:$}=(0,v.default)(H),{myRewards:T=[],canNext:L,isLoading:z}=(0,v.default)(j),P=(0,r.useMemo)(()=>s===e.AlpcConsumeType.Coupon?C.map(t=>({title:t.goods_title,value:t.consume_credits,type:e.RewardType.Received,date:new Date(t.create_time*1e3),couponCode:t.coupon_code,orderNumber:""})):s===e.AlpcConsumeType.Product?T.map(t=>{let l=e.RewardType.Pending;return t.fulfillment_status&&t.fulfillment_status!=="null"?t.fulfillment_status==="fulfilled"?l=e.RewardType.Fulfilled:l=e.RewardType.Unfulfilled:t.approval_status===e.ApprovalStatus.Success||t.approval_status===e.ApprovalStatus.DoubleConfirm?l=e.RewardType.ApproveSuccess:t.approval_status===e.ApprovalStatus.Failed&&(l=e.RewardType.Failed),{title:t.goods_title,value:t.consume_credits,type:l,date:new Date(t.create_time*1e3),orderNumber:t.order_number,couponCode:""}}):[],[s,T,C]),M=(0,r.useMemo)(()=>s===e.AlpcConsumeType.Coupon?N:s===e.AlpcConsumeType.Product?L:!1,[s,N,L]),q=(0,r.useMemo)(()=>({[e.RewardType.Received]:o.receivedLabel,[e.RewardType.Pending]:o.pendingLabel,[e.RewardType.ApproveFail]:o.failedLabel,[e.RewardType.ApproveSuccess]:o.approveSuccessLabel,[e.RewardType.Unfulfilled]:o.unfulfilledLabel,[e.RewardType.Fulfilled]:o.fulfilledLabel,[e.RewardType.Failed]:o.failedLabel}),[o]),w=(0,r.useMemo)(()=>({[e.RewardType.Received]:"",[e.RewardType.Pending]:o.pendingTip,[e.RewardType.ApproveFail]:"",[e.RewardType.ApproveSuccess]:o.confirmedTip,[e.RewardType.Unfulfilled]:o.processingTip,[e.RewardType.Fulfilled]:o.ShippedTip,[e.RewardType.Failed]:""}),[o]),B=(0,r.useMemo)(()=>({[e.RewardType.Received]:"#52C41A",[e.RewardType.Pending]:"#999",[e.RewardType.ApproveFail]:"#F84D4F",[e.RewardType.ApproveSuccess]:"#999",[e.RewardType.Unfulfilled]:"#999",[e.RewardType.Fulfilled]:"#999",[e.RewardType.Failed]:"#F84D4F"}),[]),K=(0,r.useCallback)(()=>{M&&(s===e.AlpcConsumeType.Coupon?U(c+1):s===e.AlpcConsumeType.Product&&k(f+1))},[s,f,c,M]),V=(0,r.useCallback)((t,l)=>{y(l),(0,F.default)(t),setTimeout(()=>{y(-1)},2e3)},[]),R=s===e.AlpcConsumeType.Coupon?$:z;return(0,i.jsxs)(h.CreditsModalContainer,{title:o.title,className:(0,g.default)("h-[800px] w-[640px]"),useAnimation:!0,animationClassName:"md:translate-y-[100vh]",scrollClassName:"md:mb-0",...n,onScrollEnd:K,children:[(0,i.jsx)("div",{className:"",children:(0,i.jsx)(p.Tabs,{align:"left",shape:x?"rounded":"square",value:s.toString(),onValueChange:t=>{u(Number(t))},children:(0,i.jsx)(p.TabsList,{children:Y.map(t=>(0,i.jsx)(p.TabsTrigger,{value:t.type.toString(),children:t.title},t.type))})})}),R&&(0,i.jsx)("div",{className:"flex h-full flex-col items-center justify-center",children:(0,i.jsx)(A.default,{})}),!R&&(0,i.jsx)("div",{className:"mt-[24px] overflow-auto overscroll-contain",children:P.length>0?(0,i.jsx)("div",{className:"grid gap-[18px] md:gap-[12px]",children:P.map((t,l)=>(0,i.jsxs)("div",{className:"grid gap-[8px]",children:[t?.orderNumber&&(0,i.jsxs)("div",{className:"text-[15px] font-semibold leading-[1.4] text-[#777]",children:[o.orderNumberLabel,": ",t.orderNumber]}),(0,i.jsxs)("div",{className:(0,g.default)("flex items-center justify-between rounded-[8px] bg-[#f7f8f9] px-[16px] py-[20px]",!x&&"rounded-none"),children:[(0,i.jsxs)("div",{className:"grid gap-[4px]",children:[(0,i.jsx)("div",{className:"text-[16px] font-bold leading-[1.4]",children:t.title}),(0,i.jsxs)("div",{className:"text-[14px] font-semibold text-[#999]",children:[o.valueLabel,": ",t.value," ",o?.pointUnit]}),(0,i.jsxs)("div",{className:"text-[14px] font-semibold text-[#999]",children:[t?.couponCode?`${o?.code||"Code"}: ${t.couponCode} `:"",t?.couponCode&&(0,i.jsx)("span",{className:"cursor-pointer text-[14px] font-semibold text-brand underline",onClick:()=>{V(t.couponCode,l)},role:"button",tabIndex:0,onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&b.preventDefault()},children:E===l?o?.copied||"COPIED":o?.copy||"COPY"})]})]}),(0,i.jsxs)("div",{className:"grid gap-[4px] text-right",children:[(0,i.jsxs)("div",{className:(0,g.default)("flex items-center justify-end text-[16px] font-bold leading-[1.4]",`text-[${B[t.type]}]`),children:[(0,i.jsx)("span",{children:q[t.type]}),w[t.type]&&(0,i.jsx)(D.default,{info:w[t.type],index:l})]}),(0,i.jsx)("div",{className:"text-[14px] font-semibold text-[#999]",children:(0,_.default)(t.date).format("YYYY-MM-DD HH:mm").toString()})]})]})]},l))}):(0,i.jsxs)("div",{className:"flex h-full flex-col items-center justify-center",children:[(0,i.jsx)(p.Picture,{className:"mb-[12px] w-[160px]",source:o?.emptyListImage?.url,alt:o?.emptyListImage?.alt||"empty list image"}),(0,i.jsx)("div",{className:"text-[16px] font-semibold leading-[1.4]",children:o?.emptyListLabel})]})})]})}var te=oe;
2
2
  //# sourceMappingURL=MyRewardsModal.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/components/credits/modal/MyRewardsModal.tsx"],
4
- "sourcesContent": ["import { Tabs, TabsList, TabsTrigger, Picture } from '@anker-in/headless-ui'\nimport classNames from 'classnames'\nimport clipboard from 'copy-to-clipboard'\nimport dayjs from 'dayjs'\nimport { useCallback, useMemo, useState } from 'react'\n\nimport { ApprovalStatus, AlpcConsumeType, RewardType } from '../context/const'\nimport { CreditsModalContainer, type ModalContainerProps } from './modalContainer'\nimport Tip from './tip'\nimport LoadingDots from './loadingDots'\nimport useMyRewards from '../context/hooks/useMyRewards'\n\nexport interface MyRewardsMetafields {\n title: string\n orderNumberLabel: string\n valueLabel: string\n receivedLabel: string\n failedLabel: string\n approveSuccessLabel: string\n couponTab: string\n productTab: string\n pendingLabel: string\n unfulfilledLabel: string\n fulfilledLabel: string\n confirmedTip: string\n pendingTip: string\n processingTip: string\n ShippedTip: string\n emptyListImageUrl: string\n emptyListLabel: string\n pointUnit: string\n code: string\n copied: string\n copy: string\n}\ninterface MyRewardsModalProps extends ModalContainerProps {\n data: MyRewardsMetafields\n}\n\nfunction MyRewardsModal({ data, ...props }: MyRewardsModalProps) {\n const [activeTab, setActiveTab] = useState(AlpcConsumeType.Coupon)\n\n const [couponPage, setCouponPage] = useState(1)\n const [productPage, setProductPage] = useState(1)\n const [copied, setCopied] = useState(-1)\n\n const tabs = useMemo(() => {\n const availableTabs: { title: string; type: number }[] = []\n\n if (data.couponTab) {\n availableTabs.push({\n title: data.couponTab,\n type: AlpcConsumeType.Coupon,\n })\n }\n\n if (data.productTab) {\n availableTabs.push({\n title: data.productTab,\n type: AlpcConsumeType.Product,\n })\n }\n\n return availableTabs\n }, [data.couponTab, data.productTab])\n\n const myProductRewardsOptions = useMemo(() => {\n return {\n page: props.isOpen ? productPage : 0,\n pageSize: 1000,\n consumeType: AlpcConsumeType.Product,\n }\n }, [props.isOpen, productPage])\n const myCouponRewardsOptions = useMemo(() => {\n return {\n page: props.isOpen ? couponPage : 0,\n pageSize: 1000,\n consumeType: AlpcConsumeType.Coupon,\n }\n }, [props.isOpen, couponPage])\n\n const {\n myRewards: myCouponRewards = [],\n canNext: couponCanNext,\n isLoading: couponIsLoading,\n } = useMyRewards(myCouponRewardsOptions)\n const {\n myRewards: myProductRewards = [],\n canNext: productCanNext,\n isLoading: productIsLoading,\n } = useMyRewards(myProductRewardsOptions)\n\n const list = useMemo(() => {\n if (activeTab === AlpcConsumeType.Coupon) {\n return myCouponRewards.map(item => ({\n title: item.goods_title,\n value: item.consume_credits,\n type: RewardType.Received,\n date: new Date(item.create_time * 1000),\n couponCode: item.coupon_code,\n orderNumber: '',\n }))\n }\n\n if (activeTab === AlpcConsumeType.Product) {\n return myProductRewards.map(item => {\n let type = RewardType.Pending\n\n if (item.fulfillment_status && item.fulfillment_status !== 'null') {\n // \u7269\u6D41\u72B6\u6001\n if (item.fulfillment_status === 'fulfilled') {\n type = RewardType.Fulfilled\n } else {\n type = RewardType.Unfulfilled\n }\n } else {\n if (\n item.approval_status === ApprovalStatus.Success ||\n item.approval_status === ApprovalStatus.DoubleConfirm\n ) {\n type = RewardType.ApproveSuccess\n } else if (item.approval_status === ApprovalStatus.Failed) {\n type = RewardType.Failed\n }\n }\n\n return {\n title: item.goods_title,\n value: item.consume_credits,\n type,\n date: new Date(item.create_time * 1000),\n orderNumber: item.order_number,\n couponCode: '',\n }\n })\n }\n\n return []\n }, [activeTab, myProductRewards, myCouponRewards])\n\n const canNext = useMemo(() => {\n if (activeTab === AlpcConsumeType.Coupon) {\n return couponCanNext\n }\n\n if (activeTab === AlpcConsumeType.Product) {\n return productCanNext\n }\n\n return false\n }, [activeTab, couponCanNext, productCanNext])\n\n const TypeMap = useMemo(() => {\n return {\n [RewardType.Received]: data.receivedLabel,\n [RewardType.Pending]: data.pendingLabel,\n [RewardType.ApproveFail]: data.failedLabel,\n [RewardType.ApproveSuccess]: data.approveSuccessLabel,\n [RewardType.Unfulfilled]: data.unfulfilledLabel,\n [RewardType.Fulfilled]: data.fulfilledLabel,\n [RewardType.Failed]: data.failedLabel,\n }\n }, [data])\n\n const TipMap = useMemo(() => {\n return {\n [RewardType.Received]: '',\n [RewardType.Pending]: data.pendingTip,\n [RewardType.ApproveFail]: '',\n [RewardType.ApproveSuccess]: data.confirmedTip,\n [RewardType.Unfulfilled]: data.processingTip,\n [RewardType.Fulfilled]: data.ShippedTip,\n [RewardType.Failed]: '',\n }\n }, [data])\n\n const ColorMap = useMemo(() => {\n return {\n [RewardType.Received]: '#52C41A',\n [RewardType.Pending]: '#999',\n [RewardType.ApproveFail]: '#F84D4F',\n [RewardType.ApproveSuccess]: '#999',\n [RewardType.Unfulfilled]: '#999',\n [RewardType.Fulfilled]: '#999',\n [RewardType.Failed]: '#F84D4F',\n }\n }, [])\n\n const handleScrollEnd = useCallback(() => {\n if (!canNext) {\n return\n }\n\n if (activeTab === AlpcConsumeType.Coupon) {\n setCouponPage(couponPage + 1)\n } else if (activeTab === AlpcConsumeType.Product) {\n setProductPage(productPage + 1)\n }\n }, [activeTab, productPage, couponPage, canNext])\n\n const handleCopy = useCallback((code: string, idx: number) => {\n setCopied(idx)\n clipboard(code)\n setTimeout(() => {\n setCopied(-1)\n }, 2000)\n }, [])\n\n return (\n <CreditsModalContainer\n title={data.title}\n className={classNames('h-[800px] w-[640px]')}\n useAnimation\n animationClassName=\"md:translate-y-[100vh]\"\n scrollClassName=\"min-l:px-0 md:mb-0 md:px-0\"\n {...props}\n onScrollEnd={handleScrollEnd}\n >\n <div className=\"px-[24px] md:px-[16px]\">\n <Tabs\n align=\"left\"\n shape=\"rounded\"\n value={activeTab.toString()}\n onValueChange={value => {\n setActiveTab(Number(value))\n }}\n >\n <TabsList>\n {tabs.map(tab => (\n <TabsTrigger key={tab.type} value={tab.type.toString()}>\n {tab.title}\n </TabsTrigger>\n ))}\n </TabsList>\n </Tabs>\n </div>\n\n <div className=\"mt-[24px] overflow-auto overscroll-contain px-[24px] md:px-[16px]\">\n {!list.length && !couponIsLoading && !productIsLoading && (\n <div className=\"flex h-full flex-col items-center justify-center\">\n <Picture className=\"mb-[12px] w-[160px]\" src={data?.emptyListImageUrl}></Picture>\n <div className=\"text-[16px] font-semibold leading-[1.4]\">{data?.emptyListLabel}</div>\n </div>\n )}\n {couponIsLoading ||\n (productIsLoading && (\n <div className=\"flex h-full flex-col items-center justify-center\">\n <LoadingDots />\n </div>\n ))}\n <div className=\"grid gap-[18px] md:gap-[12px]\">\n {list.map((item, index) => (\n <div key={index} className=\"grid gap-[8px]\">\n {item?.orderNumber && (\n <div className=\"text-[15px] font-semibold leading-[1.4] text-[#777]\">\n {data.orderNumberLabel}: {item.orderNumber}\n </div>\n )}\n <div className=\"flex items-center justify-between rounded-[8px] bg-[#f7f8f9] px-[16px] py-[20px]\">\n <div className=\"grid gap-[4px]\">\n <div className=\"text-[16px] font-bold leading-[1.4]\">{item.title}</div>\n <div className=\"text-[14px] font-semibold text-[#999]\">\n {data.valueLabel}: {item.value} {data?.pointUnit}\n </div>\n <div className=\"text-[14px] font-semibold text-[#999]\">\n {item?.couponCode ? `${data?.code || 'Code'}: ${item.couponCode} ` : ''}\n {item?.couponCode && (\n <span\n className=\"cursor-pointer text-[14px] font-semibold text-brand underline\"\n onClick={() => {\n handleCopy(item.couponCode, index)\n }}\n role=\"button\"\n tabIndex={0}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n }\n }}\n >\n {copied === index ? data?.copied || 'COPIED' : data?.copy || 'COPY'}\n </span>\n )}\n </div>\n </div>\n <div className=\"grid gap-[4px] text-right\">\n <div\n className={classNames(\n 'flex items-center justify-end text-[16px] font-bold leading-[1.4]',\n `text-[${ColorMap[item.type]}]`\n )}\n >\n <span>{TypeMap[item.type]}</span>\n {TipMap[item.type] && <Tip info={TipMap[item.type]} index={index} />}\n </div>\n <div className=\"text-[14px] font-semibold text-[#999]\">\n {dayjs(item.date).format('YYYY-MM-DD HH:mm').toString()}\n </div>\n </div>\n </div>\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,aAAW,EAAAiC,SACT,oEACA,SAASN,EAASL,EAAK,IAAI,CAAC,GAC9B,EAEA,oBAAC,QAAM,SAAAG,EAAQH,EAAK,IAAI,EAAE,EACzBI,EAAOJ,EAAK,IAAI,MAAK,OAAC,EAAAiB,QAAA,CAAI,KAAMb,EAAOJ,EAAK,IAAI,EAAG,MAAOe,EAAO,GACpE,KACA,OAAC,OAAI,UAAU,wCACZ,cAAAG,SAAMlB,EAAK,IAAI,EAAE,OAAO,kBAAkB,EAAE,SAAS,EACxD,GACF,GACF,IA/CQe,CAgDV,CACD,EACH,GACF,GACF,CAEJ,CAEA,IAAOnD,EAAQa",
6
- "names": ["MyRewardsModal_exports", "__export", "MyRewardsModal_default", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_classnames", "import_copy_to_clipboard", "import_dayjs", "import_react", "import_const", "import_modalContainer", "import_tip", "import_loadingDots", "import_useMyRewards", "MyRewardsModal", "data", "props", "activeTab", "setActiveTab", "couponPage", "setCouponPage", "productPage", "setProductPage", "copied", "setCopied", "tabs", "availableTabs", "myProductRewardsOptions", "myCouponRewardsOptions", "myCouponRewards", "couponCanNext", "couponIsLoading", "useMyRewards", "myProductRewards", "productCanNext", "productIsLoading", "list", "item", "type", "canNext", "TypeMap", "TipMap", "ColorMap", "handleScrollEnd", "handleCopy", "code", "idx", "clipboard", "classNames", "value", "tab", "LoadingDots", "index", "e", "Tip", "dayjs"]
4
+ "sourcesContent": ["import { Tabs, TabsList, TabsTrigger, Picture } from '@anker-in/headless-ui'\nimport classNames from 'classnames'\nimport clipboard from 'copy-to-clipboard'\nimport dayjs from 'dayjs'\nimport { useCallback, useMemo, useState } from 'react'\n\nimport { ApprovalStatus, AlpcConsumeType, RewardType } from '../context/const'\nimport { CreditsModalContainer, type ModalContainerProps } from './modalContainer'\nimport Tip from './tip'\nimport LoadingDots from './loadingDots'\nimport useMyRewards from '../context/hooks/useMyRewards'\nimport { useHeadlessContext } from '@anker-in/lib'\nimport { ROUNDED_BRANDS } from '../../../constants'\n\nexport interface MyRewardsMetafields {\n title: string\n orderNumberLabel: string\n valueLabel: string\n receivedLabel: string\n failedLabel: string\n approveSuccessLabel: string\n couponTab: string\n productTab: string\n pendingLabel: string\n unfulfilledLabel: string\n fulfilledLabel: string\n confirmedTip: string\n pendingTip: string\n processingTip: string\n ShippedTip: string\n emptyListLabel: string\n pointUnit: string\n code: string\n copied: string\n copy: string\n emptyListImage: {\n url: string\n alt?: string\n }\n}\ninterface MyRewardsModalProps extends ModalContainerProps {\n data: MyRewardsMetafields\n}\n\nfunction MyRewardsModal({ data, ...props }: MyRewardsModalProps) {\n const [activeTab, setActiveTab] = useState(AlpcConsumeType.Coupon)\n const { brand } = useHeadlessContext()\n const rounded = ROUNDED_BRANDS.includes(brand)\n\n const [couponPage, setCouponPage] = useState(1)\n const [productPage, setProductPage] = useState(1)\n const [copied, setCopied] = useState(-1)\n\n const tabs = useMemo(() => {\n const availableTabs: { title: string; type: number }[] = []\n\n if (data.couponTab) {\n availableTabs.push({\n title: data.couponTab,\n type: AlpcConsumeType.Coupon,\n })\n }\n\n if (data.productTab) {\n availableTabs.push({\n title: data.productTab,\n type: AlpcConsumeType.Product,\n })\n }\n\n return availableTabs\n }, [data.couponTab, data.productTab])\n\n const myProductRewardsOptions = useMemo(() => {\n return {\n page: props.isOpen ? productPage : 0,\n pageSize: 1000,\n consumeType: AlpcConsumeType.Product,\n }\n }, [props.isOpen, productPage])\n const myCouponRewardsOptions = useMemo(() => {\n return {\n page: props.isOpen ? couponPage : 0,\n pageSize: 1000,\n consumeType: AlpcConsumeType.Coupon,\n }\n }, [props.isOpen, couponPage])\n\n const {\n myRewards: myCouponRewards = [],\n canNext: couponCanNext,\n isLoading: couponIsLoading,\n } = useMyRewards(myCouponRewardsOptions)\n const {\n myRewards: myProductRewards = [],\n canNext: productCanNext,\n isLoading: productIsLoading,\n } = useMyRewards(myProductRewardsOptions)\n\n const list = useMemo(() => {\n if (activeTab === AlpcConsumeType.Coupon) {\n return myCouponRewards.map(item => ({\n title: item.goods_title,\n value: item.consume_credits,\n type: RewardType.Received,\n date: new Date(item.create_time * 1000),\n couponCode: item.coupon_code,\n orderNumber: '',\n }))\n }\n\n if (activeTab === AlpcConsumeType.Product) {\n return myProductRewards.map(item => {\n let type = RewardType.Pending\n\n if (item.fulfillment_status && item.fulfillment_status !== 'null') {\n // \u7269\u6D41\u72B6\u6001\n if (item.fulfillment_status === 'fulfilled') {\n type = RewardType.Fulfilled\n } else {\n type = RewardType.Unfulfilled\n }\n } else {\n if (\n item.approval_status === ApprovalStatus.Success ||\n item.approval_status === ApprovalStatus.DoubleConfirm\n ) {\n type = RewardType.ApproveSuccess\n } else if (item.approval_status === ApprovalStatus.Failed) {\n type = RewardType.Failed\n }\n }\n\n return {\n title: item.goods_title,\n value: item.consume_credits,\n type,\n date: new Date(item.create_time * 1000),\n orderNumber: item.order_number,\n couponCode: '',\n }\n })\n }\n\n return []\n }, [activeTab, myProductRewards, myCouponRewards])\n\n const canNext = useMemo(() => {\n if (activeTab === AlpcConsumeType.Coupon) {\n return couponCanNext\n }\n\n if (activeTab === AlpcConsumeType.Product) {\n return productCanNext\n }\n\n return false\n }, [activeTab, couponCanNext, productCanNext])\n\n const TypeMap = useMemo(() => {\n return {\n [RewardType.Received]: data.receivedLabel,\n [RewardType.Pending]: data.pendingLabel,\n [RewardType.ApproveFail]: data.failedLabel,\n [RewardType.ApproveSuccess]: data.approveSuccessLabel,\n [RewardType.Unfulfilled]: data.unfulfilledLabel,\n [RewardType.Fulfilled]: data.fulfilledLabel,\n [RewardType.Failed]: data.failedLabel,\n }\n }, [data])\n\n const TipMap = useMemo(() => {\n return {\n [RewardType.Received]: '',\n [RewardType.Pending]: data.pendingTip,\n [RewardType.ApproveFail]: '',\n [RewardType.ApproveSuccess]: data.confirmedTip,\n [RewardType.Unfulfilled]: data.processingTip,\n [RewardType.Fulfilled]: data.ShippedTip,\n [RewardType.Failed]: '',\n }\n }, [data])\n\n const ColorMap = useMemo(() => {\n return {\n [RewardType.Received]: '#52C41A',\n [RewardType.Pending]: '#999',\n [RewardType.ApproveFail]: '#F84D4F',\n [RewardType.ApproveSuccess]: '#999',\n [RewardType.Unfulfilled]: '#999',\n [RewardType.Fulfilled]: '#999',\n [RewardType.Failed]: '#F84D4F',\n }\n }, [])\n\n const handleScrollEnd = useCallback(() => {\n if (!canNext) {\n return\n }\n\n if (activeTab === AlpcConsumeType.Coupon) {\n setCouponPage(couponPage + 1)\n } else if (activeTab === AlpcConsumeType.Product) {\n setProductPage(productPage + 1)\n }\n }, [activeTab, productPage, couponPage, canNext])\n\n const handleCopy = useCallback((code: string, idx: number) => {\n setCopied(idx)\n clipboard(code)\n setTimeout(() => {\n setCopied(-1)\n }, 2000)\n }, [])\n\n const isLoading = activeTab === AlpcConsumeType.Coupon ? couponIsLoading : productIsLoading\n\n return (\n <CreditsModalContainer\n title={data.title}\n className={classNames('h-[800px] w-[640px]')}\n useAnimation\n animationClassName=\"md:translate-y-[100vh]\"\n scrollClassName=\"md:mb-0\"\n {...props}\n onScrollEnd={handleScrollEnd}\n >\n <div className=\"\">\n <Tabs\n align=\"left\"\n shape={rounded ? 'rounded' : 'square'}\n value={activeTab.toString()}\n onValueChange={value => {\n setActiveTab(Number(value))\n }}\n >\n <TabsList>\n {tabs.map(tab => (\n <TabsTrigger key={tab.type} value={tab.type.toString()}>\n {tab.title}\n </TabsTrigger>\n ))}\n </TabsList>\n </Tabs>\n </div>\n\n {isLoading && (\n <div className=\"flex h-full flex-col items-center justify-center\">\n <LoadingDots />\n </div>\n )}\n\n {!isLoading && (\n <div className=\"mt-[24px] overflow-auto overscroll-contain\">\n {list.length > 0 ? (\n <div className=\"grid gap-[18px] md:gap-[12px]\">\n {list.map((item, index) => (\n <div key={index} className=\"grid gap-[8px]\">\n {item?.orderNumber && (\n <div className=\"text-[15px] font-semibold leading-[1.4] text-[#777]\">\n {data.orderNumberLabel}: {item.orderNumber}\n </div>\n )}\n <div\n className={classNames(\n 'flex items-center justify-between rounded-[8px] bg-[#f7f8f9] px-[16px] py-[20px]',\n !rounded && 'rounded-none'\n )}\n >\n <div className=\"grid gap-[4px]\">\n <div className=\"text-[16px] font-bold leading-[1.4]\">{item.title}</div>\n <div className=\"text-[14px] font-semibold text-[#999]\">\n {data.valueLabel}: {item.value} {data?.pointUnit}\n </div>\n <div className=\"text-[14px] font-semibold text-[#999]\">\n {item?.couponCode ? `${data?.code || 'Code'}: ${item.couponCode} ` : ''}\n {item?.couponCode && (\n <span\n className=\"cursor-pointer text-[14px] font-semibold text-brand underline\"\n onClick={() => {\n handleCopy(item.couponCode, index)\n }}\n role=\"button\"\n tabIndex={0}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n }\n }}\n >\n {copied === index ? data?.copied || 'COPIED' : data?.copy || 'COPY'}\n </span>\n )}\n </div>\n </div>\n <div className=\"grid gap-[4px] text-right\">\n <div\n className={classNames(\n 'flex items-center justify-end text-[16px] font-bold leading-[1.4]',\n `text-[${ColorMap[item.type]}]`\n )}\n >\n <span>{TypeMap[item.type]}</span>\n {TipMap[item.type] && <Tip info={TipMap[item.type]} index={index} />}\n </div>\n <div className=\"text-[14px] font-semibold text-[#999]\">\n {dayjs(item.date).format('YYYY-MM-DD HH:mm').toString()}\n </div>\n </div>\n </div>\n </div>\n ))}\n </div>\n ) : (\n <div className=\"flex h-full flex-col items-center justify-center\">\n <Picture\n className=\"mb-[12px] w-[160px]\"\n source={data?.emptyListImage?.url}\n alt={data?.emptyListImage?.alt || 'empty list image'}\n ></Picture>\n <div className=\"text-[16px] font-semibold leading-[1.4]\">{data?.emptyListLabel}</div>\n </div>\n )}\n </div>\n )}\n </CreditsModalContainer>\n )\n}\n\nexport default MyRewardsModal\n"],
5
+ "mappings": "2jBAAA,IAAAA,GAAA,GAAAC,EAAAD,GAAA,aAAAE,KAAA,eAAAC,GAAAH,IA8Oc,IAAAI,EAAA,6BA9OdC,EAAqD,iCACrDC,EAAuB,yBACv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EAAAkB,QAAA,CAAI,KAAMd,EAAOJ,EAAK,IAAI,EAAG,MAAOgB,EAAO,GACpE,KACA,OAAC,OAAI,UAAU,wCACZ,cAAAG,SAAMnB,EAAK,IAAI,EAAE,OAAO,kBAAkB,EAAE,SAAS,EACxD,GACF,GACF,IApDQgB,CAqDV,CACD,EACH,KAEA,QAAC,OAAI,UAAU,mDACb,oBAAC,WACC,UAAU,sBACV,OAAQxC,GAAM,gBAAgB,IAC9B,IAAKA,GAAM,gBAAgB,KAAO,mBACnC,KACD,OAAC,OAAI,UAAU,0CAA2C,SAAAA,GAAM,eAAe,GACjF,EAEJ,GAEJ,CAEJ,CAEA,IAAOhB,GAAQe",
6
+ "names": ["MyRewardsModal_exports", "__export", "MyRewardsModal_default", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_classnames", "import_copy_to_clipboard", "import_dayjs", "import_react", "import_const", "import_modalContainer", "import_tip", "import_loadingDots", "import_useMyRewards", "import_lib", "import_constants", "MyRewardsModal", "data", "props", "activeTab", "setActiveTab", "brand", "rounded", "couponPage", "setCouponPage", "productPage", "setProductPage", "copied", "setCopied", "tabs", "availableTabs", "myProductRewardsOptions", "myCouponRewardsOptions", "myCouponRewards", "couponCanNext", "couponIsLoading", "useMyRewards", "myProductRewards", "productCanNext", "productIsLoading", "list", "item", "type", "canNext", "TypeMap", "TipMap", "ColorMap", "handleScrollEnd", "handleCopy", "code", "idx", "clipboard", "isLoading", "classNames", "value", "tab", "LoadingDots", "index", "e", "Tip", "dayjs"]
7
7
  }
@@ -19,7 +19,10 @@ export interface MyActivitiesMetafields {
19
19
  firstPurchaseTask: string;
20
20
  uploadReceiptTask: string;
21
21
  shoppingTask: string;
22
- emptyListImageUrl: string;
22
+ emptyListImage: {
23
+ url: string;
24
+ alt?: string;
25
+ };
23
26
  emptyListLabel: string;
24
27
  }
25
28
  interface ActivitiesModalProps extends ModalContainerProps {
@@ -1,2 +1,2 @@
1
- "use strict";var w=Object.create;var f=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var I=Object.getPrototypeOf,j=Object.prototype.hasOwnProperty;var F=(e,r)=>{for(var a in r)f(e,a,{get:r[a],enumerable:!0})},A=(e,r,a,T)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of B(r))!j.call(e,n)&&n!==a&&f(e,n,{get:()=>r[n],enumerable:!(T=R(r,n))||T.enumerable});return e};var v=(e,r,a)=>(a=e!=null?w(I(e)):{},A(r||!e||!e.__esModule?f(a,"default",{value:e,enumerable:!0}):a,e)),O=e=>A(f({},"__esModule",{value:!0}),e);var K={};F(K,{default:()=>z});module.exports=O(K);var i=require("react/jsx-runtime"),o=require("react"),_=require("../context/provider"),t=require("../context/const"),M=v(require("../context/hooks/useActivities")),P=require("./modalContainer"),k=require("../../../helpers/utils"),l=require("@anker-in/headless-ui"),C=v(require("./loadingDots")),u=require("@anker-in/headless-ui"),y=v(require("dayjs"));function H({data:e,...r}){const[a,T]=(0,o.useState)(1),{taskIdToTypeMapping:n}=(0,_.useCreditsContext)(),U=(0,o.useMemo)(()=>({page:r.isOpen?a:0,pageSize:1e3}),[r.isOpen,a]),[c,S]=(0,o.useState)(t.CreditType.All),D=(0,o.useMemo)(()=>{const p=[{title:e.allTab,type:t.CreditType.All},{title:e.earnedTab,type:t.CreditType.Earned},{title:e.deductedTab,type:t.CreditType.Deducted}];return e.expiredTab&&p.push({title:e.expiredTab,type:t.CreditType.Expired}),p},[e]),{activities:b=[],canNext:h,isLoading:N}=(0,M.default)(U),g=(0,o.useMemo)(()=>{const p={[t.TaskSubType.Activation]:e.activationTask,[t.TaskSubType.UpdateName]:e.updateNameTask,[t.TaskSubType.UpdatePhone]:e.updatePhoneTask,[t.TaskSubType.UpdateBirthday]:e.updateBirthdayTask,[t.TaskSubType.Subscription]:e.subscriptionTask,[t.TaskSubType.UpadteAppName]:e.updateAppNameTask,[t.TaskSubType.Refund]:e.refundTask,[t.TaskSubType.ProductUnApproved]:e.productUnApprovedTask},x={[t.DTC_TASK_TYPE.FirstPurchase]:e.firstPurchaseTask,[t.DTC_TASK_TYPE.UploadReceipt]:e.uploadReceiptTask,[t.DTC_TASK_TYPE.Shopping]:e.shoppingTask};function Y(s){return s.task_type===t.TaskType.Redeem&&s.task_sub_type===t.TaskSubType.ProductUnApproved&&e.productUnApprovedTask?s.task_name.replace("Refund",e.productUnApprovedTask):n?.[String(s.task_rule_id)]?x[n?.[String(s.task_rule_id)]]:p[s.task_sub_type]||s.task_name}let d=b.map(s=>({title:Y(s),date:new Date(s.create_time*1e3),value:s.credit,type:s.credit_type,pending_time:s.pending_time,credit_type:s.credit_type,status:s.status}))||[];return c===t.CreditType.Earned?d=d?.filter(s=>s.type===1):c===t.CreditType.Deducted?d=d?.filter(s=>s.type===2&&s.status!==3):c===t.CreditType.Expired&&(d=d?.filter(s=>s.type===2&&s.status===3)),d.map(s=>{let{value:m,...E}=s;return s.type===t.CreditType.Deducted&&m>0&&(m=-m),{value:m,...E}})},[e.activationTask,e.updateNameTask,e.updatePhoneTask,e.updateBirthdayTask,e.subscriptionTask,e.updateAppNameTask,e.refundTask,e.productUnApprovedTask,e.firstPurchaseTask,e.uploadReceiptTask,e.shoppingTask,b,c,n]),L=(0,o.useCallback)(()=>{h&&T(a+1)},[a,h]);return(0,i.jsxs)(P.CreditsModalContainer,{title:e.title,className:(0,k.cn)("h-[800px] w-[640px]"),useAnimation:!0,animationClassName:"md:translate-y-[100vh]",scrollClassName:"min-l:px-0 md:mb-0 md:px-0",...r,onScrollEnd:L,children:[(0,i.jsx)("div",{className:"w-full overflow-x-auto",children:(0,i.jsx)(l.Tabs,{align:"left",shape:"rounded",value:c.toString(),onValueChange:p=>{S(Number(p))},className:"px-[24px] md:px-[16px]",children:(0,i.jsx)(l.TabsList,{children:D.map(p=>(0,i.jsx)(l.TabsTrigger,{value:p.type.toString(),children:p.title},p.type))})})}),(0,i.jsxs)("div",{className:"mt-[24px] grid gap-[18px] overflow-auto overscroll-contain px-[24px] md:gap-[12px] md:px-[16px]",children:[N&&(0,i.jsx)("div",{className:"flex h-full flex-col items-center justify-center",children:(0,i.jsx)(C.default,{})}),!g.length&&!N&&(0,i.jsxs)("div",{className:"flex h-full flex-col items-center justify-center",children:[(0,i.jsx)(u.Picture,{className:"mb-[16px] h-[120px] w-[160px]",src:e?.emptyListImageUrl}),(0,i.jsx)("div",{className:"leading-1.4 text-[16px] font-semibold",children:e?.emptyListLabel})]}),g.map((p,x)=>(0,i.jsxs)("div",{className:"flex h-fit items-center justify-between rounded-[8px] bg-[#f2f0f1] px-[16px] py-[20px] text-[16px]",children:[(0,i.jsxs)("div",{className:"grid gap-[6px]",children:[(0,i.jsx)("div",{className:"font-bold",children:p.title}),(0,i.jsx)("div",{className:"text-[14px] font-semibold text-[#999]",children:(0,y.default)(p.date).format("YYYY-MM-DD HH:mm").toString()}),!e.pendingTips&&(0,i.jsxs)("div",{className:`hidden text-[14px] font-semibold text-[#777] ${p.status===2&&p.credit_type===1?"!flex":""}`,children:[(0,i.jsx)(u.Text,{html:e.pendingTips}),(0,i.jsx)("span",{children:y.default.unix(p.pending_time).add(1,"day").format("YYYY-MM-DD")}),e.pendingTips2&&(0,i.jsx)(u.Text,{html:e.pendingTips2})]})]}),(0,i.jsxs)("div",{className:(0,k.cn)("font-bold",p.value>=0||p.credit_type===t.CreditType.Expired?"text-[#52C41A]":"text-[#F84D4F]"),children:[p.value>=0&&"+",p.value]})]},x))]}),!!g.length&&(0,i.jsx)("div",{className:"mt-[12px] px-[24px] pb-[24px] text-[14px] font-semibold text-[#999] md:px-[16px]",children:e.tips})]})}var z=H;
1
+ "use strict";var I=Object.create;var f=Object.defineProperty;var O=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var F=Object.getPrototypeOf,H=Object.prototype.hasOwnProperty;var z=(e,r)=>{for(var a in r)f(e,a,{get:r[a],enumerable:!0})},_=(e,r,a,m)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of j(r))!H.call(e,n)&&n!==a&&f(e,n,{get:()=>r[n],enumerable:!(m=O(r,n))||m.enumerable});return e};var x=(e,r,a)=>(a=e!=null?I(F(e)):{},_(r||!e||!e.__esModule?f(a,"default",{value:e,enumerable:!0}):a,e)),q=e=>_(f({},"__esModule",{value:!0}),e);var $={};z($,{default:()=>V});module.exports=q($);var i=require("react/jsx-runtime"),o=require("react"),M=require("../context/provider"),t=require("../context/const"),P=x(require("../context/hooks/useActivities")),C=require("./modalContainer"),d=require("@anker-in/lib"),c=require("@anker-in/headless-ui"),D=x(require("./loadingDots")),T=require("@anker-in/headless-ui"),S=require("../../../constants"),y=x(require("dayjs"));function K({data:e,...r}){const[a,m]=(0,o.useState)(1),{taskIdToTypeMapping:n}=(0,M.useCreditsContext)(),{brand:U}=(0,d.useHeadlessContext)(),b=S.ROUNDED_BRANDS.includes(U),L=(0,o.useMemo)(()=>({page:r.isOpen?a:0,pageSize:1e3}),[r.isOpen,a]),[u,E]=(0,o.useState)(t.CreditType.All),R=(0,o.useMemo)(()=>{const p=[{title:e.allTab,type:t.CreditType.All},{title:e.earnedTab,type:t.CreditType.Earned},{title:e.deductedTab,type:t.CreditType.Deducted}];return e.expiredTab&&p.push({title:e.expiredTab,type:t.CreditType.Expired}),p},[e]),{activities:h=[],canNext:N,isLoading:A}=(0,P.default)(L),v=(0,o.useMemo)(()=>{const p={[t.TaskSubType.Activation]:e.activationTask,[t.TaskSubType.UpdateName]:e.updateNameTask,[t.TaskSubType.UpdatePhone]:e.updatePhoneTask,[t.TaskSubType.UpdateBirthday]:e.updateBirthdayTask,[t.TaskSubType.Subscription]:e.subscriptionTask,[t.TaskSubType.UpadteAppName]:e.updateAppNameTask,[t.TaskSubType.Refund]:e.refundTask,[t.TaskSubType.ProductUnApproved]:e.productUnApprovedTask},k={[t.DTC_TASK_TYPE.FirstPurchase]:e.firstPurchaseTask,[t.DTC_TASK_TYPE.UploadReceipt]:e.uploadReceiptTask,[t.DTC_TASK_TYPE.Shopping]:e.shoppingTask};function w(s){return s.task_type===t.TaskType.Redeem&&s.task_sub_type===t.TaskSubType.ProductUnApproved&&e.productUnApprovedTask?s.task_name.replace("Refund",e.productUnApprovedTask):n?.[String(s.task_rule_id)]?k[n?.[String(s.task_rule_id)]]:p[s.task_sub_type]||s.task_name}let l=h.map(s=>({title:w(s),date:new Date(s.create_time*1e3),value:s.credit,type:s.credit_type,pending_time:s.pending_time,credit_type:s.credit_type,status:s.status}))||[];return u===t.CreditType.Earned?l=l?.filter(s=>s.type===1):u===t.CreditType.Deducted?l=l?.filter(s=>s.type===2&&s.status!==3):u===t.CreditType.Expired&&(l=l?.filter(s=>s.type===2&&s.status===3)),l.map(s=>{let{value:g,...B}=s;return s.type===t.CreditType.Deducted&&g>0&&(g=-g),{value:g,...B}})},[e.activationTask,e.updateNameTask,e.updatePhoneTask,e.updateBirthdayTask,e.subscriptionTask,e.updateAppNameTask,e.refundTask,e.productUnApprovedTask,e.firstPurchaseTask,e.uploadReceiptTask,e.shoppingTask,h,u,n]),Y=(0,o.useCallback)(()=>{N&&m(a+1)},[a,N]);return(0,i.jsxs)(C.CreditsModalContainer,{title:e.title,className:(0,d.classNames)("h-[800px] w-[640px]"),useAnimation:!0,animationClassName:"md:translate-y-[100vh]",scrollClassName:"",...r,onScrollEnd:Y,children:[(0,i.jsx)("div",{className:"w-full sticky top-0 bg-white z-10 pb-[24px] overflow-x-auto",children:(0,i.jsx)(c.Tabs,{align:"left",shape:b?"rounded":"square",value:u.toString(),onValueChange:p=>{E(Number(p))},className:"",children:(0,i.jsx)(c.TabsList,{children:R.map(p=>(0,i.jsx)(c.TabsTrigger,{value:p.type.toString(),children:p.title},p.type))})})}),(0,i.jsxs)("div",{className:"grid gap-[18px] overflow-auto overscroll-contain md:gap-[12px]",children:[A&&(0,i.jsx)("div",{className:"flex h-full flex-col items-center justify-center",children:(0,i.jsx)(D.default,{})}),!A&&(0,i.jsx)(i.Fragment,{children:v.length>0?v.map((p,k)=>(0,i.jsxs)("div",{className:(0,d.classNames)("flex h-fit items-center justify-between rounded-[8px] bg-[#f2f0f1] px-[16px] py-[20px] text-[16px]",!b&&"rounded-none"),children:[(0,i.jsxs)("div",{className:"grid gap-[6px]",children:[(0,i.jsx)("div",{className:"font-bold",children:p.title}),(0,i.jsx)("div",{className:"text-[14px] font-semibold text-[#999]",children:(0,y.default)(p.date).format("YYYY-MM-DD HH:mm").toString()}),!e.pendingTips&&(0,i.jsxs)("div",{className:`hidden text-[14px] font-semibold text-[#777] ${p.status===2&&p.credit_type===1?"!flex":""}`,children:[(0,i.jsx)(T.Text,{html:e.pendingTips}),(0,i.jsx)("span",{children:y.default.unix(p.pending_time).add(1,"day").format("YYYY-MM-DD")}),e.pendingTips2&&(0,i.jsx)(T.Text,{html:e.pendingTips2})]})]}),(0,i.jsxs)("div",{className:(0,d.classNames)("font-bold",p.value>=0||p.credit_type===t.CreditType.Expired?"text-[#52C41A]":"text-[#F84D4F]"),children:[p.value>=0&&"+",p.value]})]},k)):(0,i.jsxs)("div",{className:"flex h-full flex-col items-center justify-center",children:[(0,i.jsx)(T.Picture,{className:"mb-[16px] h-[120px] w-[160px]",source:e?.emptyListImage?.url,alt:e?.emptyListImage?.alt||"empty list image"}),(0,i.jsx)("div",{className:"leading-1.4 text-[16px] font-semibold",children:e?.emptyListLabel})]})})]}),v.length>0&&(0,i.jsx)("div",{className:"mt-[12px] pb-[24px] text-[14px] font-semibold text-[#999]",children:e.tips})]})}var V=K;
2
2
  //# sourceMappingURL=activitiesModal.js.map