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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (915) 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/useSubscribed.js +1 -1
  32. package/dist/cjs/components/credits/context/hooks/useSubscribed.js.map +3 -3
  33. package/dist/cjs/components/credits/context/hooks/useUploadReceipt.js +1 -1
  34. package/dist/cjs/components/credits/context/hooks/useUploadReceipt.js.map +2 -2
  35. package/dist/cjs/components/credits/context/memberPriceConst.d.ts +10 -0
  36. package/dist/cjs/components/credits/context/memberPriceConst.js +2 -0
  37. package/dist/cjs/components/credits/context/memberPriceConst.js.map +7 -0
  38. package/dist/cjs/components/credits/context/memberPriceTypes.d.ts +46 -0
  39. package/dist/cjs/components/credits/context/memberPriceTypes.js +2 -0
  40. package/dist/cjs/components/credits/context/memberPriceTypes.js.map +7 -0
  41. package/dist/cjs/components/credits/context/provider.d.ts +11 -33
  42. package/dist/cjs/components/credits/context/provider.js +1 -1
  43. package/dist/cjs/components/credits/context/provider.js.map +3 -3
  44. package/dist/cjs/components/credits/context/utils/atobID.d.ts +1 -0
  45. package/dist/cjs/components/credits/context/utils/atobID.js +2 -0
  46. package/dist/cjs/components/credits/context/utils/atobID.js.map +7 -0
  47. package/dist/cjs/components/credits/context/utils/functionDiscountCalculate.d.ts +5 -0
  48. package/dist/cjs/components/credits/context/utils/functionDiscountCalculate.js +2 -0
  49. package/dist/cjs/components/credits/context/utils/functionDiscountCalculate.js.map +7 -0
  50. package/dist/cjs/components/credits/context/utils/getFunctionMemberPrice.d.ts +8 -0
  51. package/dist/cjs/components/credits/context/utils/getFunctionMemberPrice.js +2 -0
  52. package/dist/cjs/components/credits/context/utils/getFunctionMemberPrice.js.map +7 -0
  53. package/dist/cjs/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.d.ts +9 -0
  54. package/dist/cjs/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.js +2 -0
  55. package/dist/cjs/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.js.map +7 -0
  56. package/dist/cjs/components/credits/context/utils/variantGetCoupon.d.ts +6 -0
  57. package/dist/cjs/components/credits/context/utils/variantGetCoupon.js +2 -0
  58. package/dist/cjs/components/credits/context/utils/variantGetCoupon.js.map +7 -0
  59. package/dist/cjs/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.d.ts +4 -0
  60. package/dist/cjs/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.js +2 -0
  61. package/dist/cjs/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.js.map +7 -0
  62. package/dist/cjs/components/credits/creditsAnkersolixTask/index.d.ts +2 -0
  63. package/dist/cjs/components/credits/creditsAnkersolixTask/index.js +2 -0
  64. package/dist/cjs/components/credits/creditsAnkersolixTask/index.js.map +7 -0
  65. package/dist/cjs/components/credits/creditsAnkersolixTask/type.d.ts +1 -0
  66. package/dist/cjs/components/credits/creditsAnkersolixTask/type.js +2 -0
  67. package/dist/cjs/components/credits/creditsAnkersolixTask/type.js.map +7 -0
  68. package/dist/cjs/components/credits/creditsBanner/index.d.ts +17 -16
  69. package/dist/cjs/components/credits/creditsBanner/index.js +2 -0
  70. package/dist/cjs/components/credits/creditsBanner/index.js.map +7 -0
  71. package/dist/{esm/components/credits/credits-benefits/benefitItem.d.ts → cjs/components/credits/creditsBenefits/BenefitItem.d.ts} +4 -1
  72. package/dist/cjs/components/credits/creditsBenefits/BenefitItem.js +2 -0
  73. package/dist/cjs/components/credits/creditsBenefits/BenefitItem.js.map +7 -0
  74. package/dist/cjs/components/credits/{credits-benefits/iconInfo.js → creditsBenefits/IconInfo.js} +1 -1
  75. package/dist/cjs/components/credits/{credits-benefits/iconInfo.js.map → creditsBenefits/IconInfo.js.map} +2 -2
  76. package/dist/cjs/components/credits/creditsBenefits/index.d.ts +12 -9
  77. package/dist/cjs/components/credits/creditsBenefits/index.js +4 -0
  78. package/dist/cjs/components/credits/creditsBenefits/index.js.map +7 -0
  79. package/dist/cjs/components/credits/creditsCash/CreditsCash.d.ts +5 -0
  80. package/dist/cjs/components/credits/creditsCash/CreditsCash.js +2 -0
  81. package/dist/cjs/components/credits/creditsCash/CreditsCash.js.map +7 -0
  82. package/dist/cjs/components/credits/creditsCash/RedeemableItem.d.ts +1 -7
  83. package/dist/cjs/components/credits/creditsCash/RedeemableItem.js +2 -0
  84. package/dist/cjs/components/credits/creditsCash/RedeemableItem.js.map +7 -0
  85. package/dist/cjs/components/credits/creditsCash/index.d.ts +2 -13
  86. package/dist/cjs/components/credits/creditsCash/index.js +2 -0
  87. package/dist/cjs/components/credits/creditsCash/index.js.map +7 -0
  88. package/dist/cjs/components/credits/creditsCash/type.d.ts +2 -4
  89. package/dist/cjs/components/credits/creditsCash/type.js +2 -0
  90. package/dist/cjs/components/credits/creditsCash/type.js.map +7 -0
  91. package/dist/cjs/components/credits/creditsFaq/faqItem/FaqItem.js +2 -0
  92. package/dist/cjs/components/credits/creditsFaq/faqItem/FaqItem.js.map +7 -0
  93. package/dist/cjs/components/credits/creditsFaq/index.d.ts +4 -3
  94. package/dist/cjs/components/credits/creditsFaq/index.js +2 -0
  95. package/dist/cjs/components/credits/creditsFaq/index.js.map +7 -0
  96. package/dist/cjs/components/credits/creditsInfoCard/index.d.ts +10 -15
  97. package/dist/cjs/components/credits/creditsInfoCard/index.js +2 -0
  98. package/dist/cjs/components/credits/creditsInfoCard/index.js.map +7 -0
  99. package/dist/cjs/components/credits/creditsMemberPrice/CreditsMemberPrice.d.ts +5 -0
  100. package/dist/cjs/components/credits/creditsMemberPrice/CreditsMemberPrice.js +2 -0
  101. package/dist/cjs/components/credits/creditsMemberPrice/CreditsMemberPrice.js.map +7 -0
  102. package/dist/cjs/components/credits/creditsMemberPrice/MemberPriceItem.d.ts +7 -0
  103. package/dist/cjs/components/credits/creditsMemberPrice/MemberPriceItem.js +2 -0
  104. package/dist/cjs/components/credits/creditsMemberPrice/MemberPriceItem.js.map +7 -0
  105. package/dist/cjs/components/credits/creditsMemberPrice/index.d.ts +2 -0
  106. package/dist/cjs/components/credits/creditsMemberPrice/index.js +2 -0
  107. package/dist/cjs/components/credits/creditsMemberPrice/index.js.map +7 -0
  108. package/dist/cjs/components/credits/creditsMemberPrice/type.d.ts +64 -0
  109. package/dist/cjs/components/credits/creditsMemberPrice/type.js +2 -0
  110. package/dist/cjs/components/credits/creditsMemberPrice/type.js.map +7 -0
  111. package/dist/cjs/components/credits/creditsNavigation/CreditsNavigation.d.ts +4 -0
  112. package/dist/cjs/components/credits/creditsNavigation/CreditsNavigation.js +2 -0
  113. package/dist/cjs/components/credits/creditsNavigation/CreditsNavigation.js.map +7 -0
  114. package/dist/cjs/components/credits/creditsNavigation/index.d.ts +2 -0
  115. package/dist/cjs/components/credits/creditsNavigation/index.js +2 -0
  116. package/dist/cjs/components/credits/creditsNavigation/index.js.map +7 -0
  117. package/dist/cjs/components/credits/creditsNavigation/type.d.ts +7 -0
  118. package/dist/cjs/components/credits/creditsNavigation/type.js +2 -0
  119. package/dist/cjs/components/credits/creditsNavigation/type.js.map +7 -0
  120. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/CountrySelect.js +2 -0
  121. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/CountrySelect.js.map +7 -0
  122. package/dist/cjs/components/credits/{credits-redeem-list/address-form/form-item.js → creditsRedeemList/AddressForm/FormItem.js} +1 -1
  123. package/dist/cjs/components/credits/{credits-redeem-list/address-form/form-item.js.map → creditsRedeemList/AddressForm/FormItem.js.map} +2 -2
  124. package/dist/cjs/components/credits/{credits-redeem-list/address-form → creditsRedeemList/AddressForm}/Input.js.map +1 -1
  125. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/StateSelect.js +2 -0
  126. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/StateSelect.js.map +7 -0
  127. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/index.js +2 -0
  128. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/index.js.map +7 -0
  129. package/dist/cjs/components/credits/{credits-redeem-list/address-form → creditsRedeemList/AddressForm}/type.js.map +1 -1
  130. package/dist/cjs/components/credits/creditsRedeemList/CreditsRedeemList.d.ts +5 -0
  131. package/dist/cjs/components/credits/creditsRedeemList/CreditsRedeemList.js +2 -0
  132. package/dist/cjs/components/credits/creditsRedeemList/CreditsRedeemList.js.map +7 -0
  133. package/dist/cjs/components/credits/creditsRedeemList/NonProductValue.d.ts +4 -0
  134. package/dist/cjs/components/credits/creditsRedeemList/NonProductValue.js +2 -0
  135. package/dist/cjs/components/credits/creditsRedeemList/NonProductValue.js.map +7 -0
  136. package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.js +2 -0
  137. package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.js.map +7 -0
  138. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.js +2 -0
  139. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.js.map +7 -0
  140. package/dist/cjs/components/credits/{credits-redeem-list/redeem-product-modal → creditsRedeemList/RedeemProductModal}/Error.js +1 -1
  141. package/dist/cjs/components/credits/{credits-redeem-list/redeem-product-modal → creditsRedeemList/RedeemProductModal}/Error.js.map +3 -3
  142. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Init.js +2 -0
  143. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Init.js.map +7 -0
  144. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.d.ts +6 -0
  145. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js +2 -0
  146. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js.map +7 -0
  147. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js +2 -0
  148. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js.map +7 -0
  149. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.js +2 -0
  150. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.js.map +7 -0
  151. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.js +2 -0
  152. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.js.map +7 -0
  153. package/dist/cjs/components/credits/creditsRedeemList/RedeemableItem.js +2 -0
  154. package/dist/cjs/components/credits/creditsRedeemList/RedeemableItem.js.map +7 -0
  155. package/dist/cjs/components/credits/creditsRedeemList/index.d.ts +2 -13
  156. package/dist/cjs/components/credits/creditsRedeemList/index.js +2 -0
  157. package/dist/cjs/components/credits/creditsRedeemList/index.js.map +7 -0
  158. package/dist/cjs/components/credits/creditsRedeemList/type.d.ts +2 -15
  159. package/dist/cjs/components/credits/creditsRedeemList/type.js.map +7 -0
  160. package/dist/cjs/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.d.ts +4 -0
  161. package/dist/cjs/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js +2 -0
  162. package/dist/cjs/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js.map +7 -0
  163. package/dist/cjs/components/credits/creditsWaysToGetCredits/index.d.ts +2 -2
  164. package/dist/cjs/components/credits/creditsWaysToGetCredits/index.js +2 -0
  165. package/dist/cjs/components/credits/creditsWaysToGetCredits/index.js.map +7 -0
  166. package/dist/cjs/components/credits/creditsWaysToGetCredits/type.d.ts +5 -16
  167. package/dist/cjs/components/credits/creditsWaysToGetCredits/type.js +2 -0
  168. package/dist/cjs/components/credits/creditsWaysToGetCredits/type.js.map +7 -0
  169. package/dist/cjs/components/credits/creditsWaysToGetCredits/useActions.d.ts +11 -2
  170. package/dist/cjs/components/credits/creditsWaysToGetCredits/useActions.js +2 -0
  171. package/dist/cjs/components/credits/creditsWaysToGetCredits/useActions.js.map +7 -0
  172. package/dist/cjs/components/credits/modal/MyRewardsModal.d.ts +4 -1
  173. package/dist/cjs/components/credits/modal/MyRewardsModal.js +1 -1
  174. package/dist/cjs/components/credits/modal/MyRewardsModal.js.map +3 -3
  175. package/dist/cjs/components/credits/modal/activitiesModal.d.ts +4 -1
  176. package/dist/cjs/components/credits/modal/activitiesModal.js +1 -1
  177. package/dist/cjs/components/credits/modal/activitiesModal.js.map +3 -3
  178. package/dist/cjs/components/credits/modal/creditsUploadReceiptModal.js +1 -1
  179. package/dist/cjs/components/credits/modal/creditsUploadReceiptModal.js.map +3 -3
  180. package/dist/cjs/components/credits/modal/loadingDots.d.ts +2 -1
  181. package/dist/cjs/components/credits/modal/loadingDots.js +1 -1
  182. package/dist/cjs/components/credits/modal/loadingDots.js.map +3 -3
  183. package/dist/cjs/components/credits/modal/modalContainer.js +1 -1
  184. package/dist/cjs/components/credits/modal/modalContainer.js.map +3 -3
  185. package/dist/cjs/components/credits/modal/rulesModal.js +1 -1
  186. package/dist/cjs/components/credits/modal/rulesModal.js.map +3 -3
  187. package/dist/cjs/components/credits/modal/subscribeModal.d.ts +15 -0
  188. package/dist/cjs/components/credits/modal/subscribeModal.js +2 -0
  189. package/dist/cjs/components/credits/modal/subscribeModal.js.map +7 -0
  190. package/dist/cjs/components/credits/modal/tip.js +1 -1
  191. package/dist/cjs/components/credits/modal/tip.js.map +3 -3
  192. package/dist/cjs/components/credits/type.d.ts +24 -5
  193. package/dist/cjs/components/credits/type.js +1 -1
  194. package/dist/cjs/components/credits/type.js.map +1 -1
  195. package/dist/cjs/components/index.d.ts +1 -0
  196. package/dist/cjs/components/index.js +1 -1
  197. package/dist/cjs/components/index.js.map +2 -2
  198. package/dist/cjs/components/registration/authCodeActivate/Message.d.ts +4 -0
  199. package/dist/cjs/components/registration/authCodeActivate/Message.js +2 -0
  200. package/dist/cjs/components/registration/authCodeActivate/Message.js.map +7 -0
  201. package/dist/cjs/components/registration/authCodeActivate/index.d.ts +3 -0
  202. package/dist/cjs/components/registration/authCodeActivate/index.js +2 -0
  203. package/dist/cjs/components/registration/authCodeActivate/index.js.map +7 -0
  204. package/dist/cjs/components/registration/authCodeActivate/type.d.ts +22 -0
  205. package/dist/cjs/components/registration/authCodeActivate/type.js +2 -0
  206. package/dist/cjs/components/registration/authCodeActivate/type.js.map +7 -0
  207. package/dist/cjs/components/registration/context/index.d.ts +1 -0
  208. package/dist/cjs/components/registration/context/index.js +2 -0
  209. package/dist/cjs/components/registration/context/index.js.map +7 -0
  210. package/dist/cjs/components/registration/context/provider.d.ts +27 -0
  211. package/dist/cjs/components/registration/context/provider.js +2 -0
  212. package/dist/cjs/components/registration/context/provider.js.map +7 -0
  213. package/dist/cjs/components/registration/index.d.ts +2 -0
  214. package/dist/cjs/components/registration/index.js +2 -0
  215. package/dist/cjs/components/registration/index.js.map +7 -0
  216. package/dist/cjs/components/registration/modalContainer.d.ts +14 -0
  217. package/dist/cjs/components/registration/modalContainer.js +2 -0
  218. package/dist/cjs/components/registration/modalContainer.js.map +7 -0
  219. package/dist/cjs/debug-env.js +2 -0
  220. package/dist/cjs/debug-env.js.map +7 -0
  221. package/dist/cjs/index.d.ts +2 -2
  222. package/dist/cjs/index.js +1 -726
  223. package/dist/cjs/index.js.map +4 -4
  224. package/dist/cjs/stories/chat.stories.js +2 -0
  225. package/dist/cjs/stories/chat.stories.js.map +7 -0
  226. package/dist/cjs/templates/Credits.d.ts +73 -0
  227. package/dist/cjs/templates/Credits.js +2 -0
  228. package/dist/cjs/templates/Credits.js.map +7 -0
  229. package/dist/cjs/templates/index.d.ts +1 -0
  230. package/dist/cjs/templates/index.js +2 -0
  231. package/dist/cjs/templates/index.js.map +7 -0
  232. package/dist/esm/components/chat/index.js +1 -1
  233. package/dist/esm/components/chat/index.js.map +2 -2
  234. package/dist/esm/components/credits/context/const.d.ts +2 -1
  235. package/dist/esm/components/credits/context/const.js +1 -1
  236. package/dist/esm/components/credits/context/const.js.map +2 -2
  237. package/dist/esm/components/credits/context/hooks/useActivities.js +1 -1
  238. package/dist/esm/components/credits/context/hooks/useActivities.js.map +3 -3
  239. package/dist/esm/components/credits/context/hooks/useAddressValidate.js +1 -1
  240. package/dist/esm/components/credits/context/hooks/useAddressValidate.js.map +3 -3
  241. package/dist/esm/components/credits/context/hooks/useAlpcFetch.js +1 -1
  242. package/dist/esm/components/credits/context/hooks/useAlpcFetch.js.map +3 -3
  243. package/dist/esm/components/credits/context/hooks/useCountries.js +1 -1
  244. package/dist/esm/components/credits/context/hooks/useCountries.js.map +3 -3
  245. package/dist/esm/components/credits/context/hooks/useFunctionMemberPrice.d.ts +7 -0
  246. package/dist/esm/components/credits/context/hooks/useFunctionMemberPrice.js +2 -0
  247. package/dist/esm/components/credits/context/hooks/useFunctionMemberPrice.js.map +7 -0
  248. package/dist/esm/components/credits/context/hooks/useMyRewards.js +1 -1
  249. package/dist/esm/components/credits/context/hooks/useMyRewards.js.map +3 -3
  250. package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.d.ts +5 -10
  251. package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.js +1 -1
  252. package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.js.map +3 -3
  253. package/dist/esm/components/credits/context/hooks/useRedeemCoupon.d.ts +2 -1
  254. package/dist/esm/components/credits/context/hooks/useRedeemCoupon.js +1 -1
  255. package/dist/esm/components/credits/context/hooks/useRedeemCoupon.js.map +3 -3
  256. package/dist/esm/components/credits/context/hooks/useRedeemProduct.js +1 -1
  257. package/dist/esm/components/credits/context/hooks/useRedeemProduct.js.map +3 -3
  258. package/dist/esm/components/credits/context/hooks/useRedeemableList.js +1 -1
  259. package/dist/esm/components/credits/context/hooks/useRedeemableList.js.map +3 -3
  260. package/dist/esm/components/credits/context/hooks/useSubscribed.js +1 -1
  261. package/dist/esm/components/credits/context/hooks/useSubscribed.js.map +3 -3
  262. package/dist/esm/components/credits/context/hooks/useUploadReceipt.js +1 -1
  263. package/dist/esm/components/credits/context/hooks/useUploadReceipt.js.map +2 -2
  264. package/dist/esm/components/credits/context/memberPriceConst.d.ts +10 -0
  265. package/dist/esm/components/credits/context/memberPriceConst.js +2 -0
  266. package/dist/esm/components/credits/context/memberPriceConst.js.map +7 -0
  267. package/dist/esm/components/credits/context/memberPriceTypes.d.ts +46 -0
  268. package/dist/esm/components/credits/context/memberPriceTypes.js +1 -0
  269. package/dist/esm/components/credits/context/provider.d.ts +11 -33
  270. package/dist/esm/components/credits/context/provider.js +1 -1
  271. package/dist/esm/components/credits/context/provider.js.map +3 -3
  272. package/dist/esm/components/credits/context/utils/atobID.d.ts +1 -0
  273. package/dist/esm/components/credits/context/utils/atobID.js +2 -0
  274. package/dist/esm/components/credits/context/utils/atobID.js.map +7 -0
  275. package/dist/esm/components/credits/context/utils/functionDiscountCalculate.d.ts +5 -0
  276. package/dist/esm/components/credits/context/utils/functionDiscountCalculate.js +2 -0
  277. package/dist/esm/components/credits/context/utils/functionDiscountCalculate.js.map +7 -0
  278. package/dist/esm/components/credits/context/utils/getFunctionMemberPrice.d.ts +8 -0
  279. package/dist/esm/components/credits/context/utils/getFunctionMemberPrice.js +2 -0
  280. package/dist/esm/components/credits/context/utils/getFunctionMemberPrice.js.map +7 -0
  281. package/dist/esm/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.d.ts +9 -0
  282. package/dist/esm/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.js +2 -0
  283. package/dist/esm/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.js.map +7 -0
  284. package/dist/esm/components/credits/context/utils/variantGetCoupon.d.ts +6 -0
  285. package/dist/esm/components/credits/context/utils/variantGetCoupon.js +2 -0
  286. package/dist/esm/components/credits/context/utils/variantGetCoupon.js.map +7 -0
  287. package/dist/esm/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.d.ts +4 -0
  288. package/dist/esm/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.js +2 -0
  289. package/dist/esm/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.js.map +7 -0
  290. package/dist/esm/components/credits/creditsAnkersolixTask/index.d.ts +2 -0
  291. package/dist/esm/components/credits/creditsAnkersolixTask/index.js +2 -0
  292. package/dist/esm/components/credits/creditsAnkersolixTask/index.js.map +7 -0
  293. package/dist/esm/components/credits/creditsAnkersolixTask/type.d.ts +1 -0
  294. package/dist/esm/components/credits/creditsAnkersolixTask/type.js +2 -0
  295. package/dist/esm/components/credits/creditsAnkersolixTask/type.js.map +7 -0
  296. package/dist/esm/components/credits/creditsBanner/index.d.ts +17 -16
  297. package/dist/esm/components/credits/creditsBanner/index.js +1 -1
  298. package/dist/esm/components/credits/creditsBanner/index.js.map +3 -3
  299. package/dist/{cjs/components/credits/credits-benefits/benefitItem.d.ts → esm/components/credits/creditsBenefits/BenefitItem.d.ts} +4 -1
  300. package/dist/esm/components/credits/creditsBenefits/BenefitItem.js +2 -0
  301. package/dist/esm/components/credits/creditsBenefits/BenefitItem.js.map +7 -0
  302. package/dist/esm/components/credits/{credits-benefits/iconInfo.js → creditsBenefits/IconInfo.js} +1 -1
  303. package/dist/esm/components/credits/creditsBenefits/{iconInfo.js.map → IconInfo.js.map} +2 -2
  304. package/dist/esm/components/credits/creditsBenefits/index.d.ts +12 -9
  305. package/dist/esm/components/credits/creditsBenefits/index.js +3 -3
  306. package/dist/esm/components/credits/creditsBenefits/index.js.map +3 -3
  307. package/dist/esm/components/credits/creditsCash/CreditsCash.d.ts +5 -0
  308. package/dist/esm/components/credits/creditsCash/CreditsCash.js +2 -0
  309. package/dist/esm/components/credits/creditsCash/CreditsCash.js.map +7 -0
  310. package/dist/esm/components/credits/creditsCash/RedeemableItem.d.ts +1 -7
  311. package/dist/esm/components/credits/creditsCash/RedeemableItem.js +1 -1
  312. package/dist/esm/components/credits/creditsCash/RedeemableItem.js.map +3 -3
  313. package/dist/esm/components/credits/creditsCash/index.d.ts +2 -13
  314. package/dist/esm/components/credits/creditsCash/index.js +1 -1
  315. package/dist/esm/components/credits/creditsCash/index.js.map +4 -4
  316. package/dist/esm/components/credits/creditsCash/type.d.ts +2 -4
  317. package/dist/esm/components/credits/creditsFaq/faqItem/FaqItem.js +1 -1
  318. package/dist/esm/components/credits/creditsFaq/faqItem/FaqItem.js.map +2 -2
  319. package/dist/esm/components/credits/creditsFaq/index.d.ts +4 -3
  320. package/dist/esm/components/credits/creditsFaq/index.js +1 -1
  321. package/dist/esm/components/credits/creditsFaq/index.js.map +3 -3
  322. package/dist/esm/components/credits/creditsInfoCard/index.d.ts +10 -15
  323. package/dist/esm/components/credits/creditsInfoCard/index.js +1 -1
  324. package/dist/esm/components/credits/creditsInfoCard/index.js.map +3 -3
  325. package/dist/esm/components/credits/creditsMemberPrice/CreditsMemberPrice.d.ts +5 -0
  326. package/dist/esm/components/credits/creditsMemberPrice/CreditsMemberPrice.js +2 -0
  327. package/dist/esm/components/credits/creditsMemberPrice/CreditsMemberPrice.js.map +7 -0
  328. package/dist/esm/components/credits/creditsMemberPrice/MemberPriceItem.d.ts +7 -0
  329. package/dist/esm/components/credits/creditsMemberPrice/MemberPriceItem.js +2 -0
  330. package/dist/esm/components/credits/creditsMemberPrice/MemberPriceItem.js.map +7 -0
  331. package/dist/esm/components/credits/creditsMemberPrice/index.d.ts +2 -0
  332. package/dist/esm/components/credits/creditsMemberPrice/index.js +2 -0
  333. package/dist/esm/components/credits/creditsMemberPrice/index.js.map +7 -0
  334. package/dist/esm/components/credits/creditsMemberPrice/type.d.ts +64 -0
  335. package/dist/esm/components/credits/creditsNavigation/CreditsNavigation.d.ts +4 -0
  336. package/dist/esm/components/credits/creditsNavigation/CreditsNavigation.js +2 -0
  337. package/dist/esm/components/credits/creditsNavigation/CreditsNavigation.js.map +7 -0
  338. package/dist/esm/components/credits/creditsNavigation/index.d.ts +2 -0
  339. package/dist/esm/components/credits/creditsNavigation/index.js +2 -0
  340. package/dist/esm/components/credits/creditsNavigation/index.js.map +7 -0
  341. package/dist/esm/components/credits/creditsNavigation/type.d.ts +7 -0
  342. package/dist/esm/components/credits/creditsRedeemList/AddressForm/CountrySelect.js +1 -1
  343. package/dist/esm/components/credits/creditsRedeemList/AddressForm/CountrySelect.js.map +3 -3
  344. package/dist/esm/components/credits/creditsRedeemList/AddressForm/StateSelect.js +1 -1
  345. package/dist/esm/components/credits/creditsRedeemList/AddressForm/StateSelect.js.map +3 -3
  346. package/dist/esm/components/credits/creditsRedeemList/AddressForm/index.js +1 -1
  347. package/dist/esm/components/credits/creditsRedeemList/AddressForm/index.js.map +3 -3
  348. package/dist/esm/components/credits/creditsRedeemList/CreditsRedeemList.d.ts +5 -0
  349. package/dist/esm/components/credits/creditsRedeemList/CreditsRedeemList.js +2 -0
  350. package/dist/esm/components/credits/creditsRedeemList/CreditsRedeemList.js.map +7 -0
  351. package/dist/esm/components/credits/creditsRedeemList/NonProductValue.d.ts +4 -0
  352. package/dist/esm/components/credits/creditsRedeemList/NonProductValue.js +2 -0
  353. package/dist/esm/components/credits/creditsRedeemList/NonProductValue.js.map +7 -0
  354. package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.js +1 -1
  355. package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.js.map +3 -3
  356. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.js +1 -1
  357. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.js.map +3 -3
  358. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Error.js +1 -1
  359. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Error.js.map +2 -2
  360. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.js +1 -1
  361. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.js.map +3 -3
  362. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.d.ts +6 -0
  363. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js +2 -0
  364. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js.map +7 -0
  365. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js +1 -1
  366. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js.map +3 -3
  367. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.js +1 -1
  368. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.js.map +3 -3
  369. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.js +1 -1
  370. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.js.map +3 -3
  371. package/dist/esm/components/credits/creditsRedeemList/RedeemableItem.js +1 -1
  372. package/dist/esm/components/credits/creditsRedeemList/RedeemableItem.js.map +3 -3
  373. package/dist/esm/components/credits/creditsRedeemList/index.d.ts +2 -13
  374. package/dist/esm/components/credits/creditsRedeemList/index.js +1 -1
  375. package/dist/esm/components/credits/creditsRedeemList/index.js.map +4 -4
  376. package/dist/esm/components/credits/creditsRedeemList/type.d.ts +2 -15
  377. package/dist/esm/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.d.ts +4 -0
  378. package/dist/esm/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js +2 -0
  379. package/dist/esm/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js.map +7 -0
  380. package/dist/esm/components/credits/creditsWaysToGetCredits/index.d.ts +2 -2
  381. package/dist/esm/components/credits/creditsWaysToGetCredits/index.js +1 -1
  382. package/dist/esm/components/credits/creditsWaysToGetCredits/index.js.map +4 -4
  383. package/dist/esm/components/credits/creditsWaysToGetCredits/type.d.ts +5 -16
  384. package/dist/esm/components/credits/creditsWaysToGetCredits/type.js +1 -1
  385. package/dist/esm/components/credits/creditsWaysToGetCredits/type.js.map +2 -2
  386. package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.d.ts +11 -2
  387. package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.js +1 -1
  388. package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.js.map +3 -3
  389. package/dist/esm/components/credits/modal/MyRewardsModal.d.ts +4 -1
  390. package/dist/esm/components/credits/modal/MyRewardsModal.js +1 -1
  391. package/dist/esm/components/credits/modal/MyRewardsModal.js.map +3 -3
  392. package/dist/esm/components/credits/modal/activitiesModal.d.ts +4 -1
  393. package/dist/esm/components/credits/modal/activitiesModal.js +1 -1
  394. package/dist/esm/components/credits/modal/activitiesModal.js.map +3 -3
  395. package/dist/esm/components/credits/modal/creditsUploadReceiptModal.js +1 -1
  396. package/dist/esm/components/credits/modal/creditsUploadReceiptModal.js.map +3 -3
  397. package/dist/esm/components/credits/modal/loadingDots.d.ts +2 -1
  398. package/dist/esm/components/credits/modal/loadingDots.js +1 -1
  399. package/dist/esm/components/credits/modal/loadingDots.js.map +3 -3
  400. package/dist/esm/components/credits/modal/modalContainer.js +1 -1
  401. package/dist/esm/components/credits/modal/modalContainer.js.map +3 -3
  402. package/dist/esm/components/credits/modal/rulesModal.js +1 -1
  403. package/dist/esm/components/credits/modal/rulesModal.js.map +2 -2
  404. package/dist/esm/components/credits/modal/subscribeModal.d.ts +15 -0
  405. package/dist/esm/components/credits/modal/subscribeModal.js +2 -0
  406. package/dist/esm/components/credits/modal/subscribeModal.js.map +7 -0
  407. package/dist/esm/components/credits/modal/tip.js +1 -1
  408. package/dist/esm/components/credits/modal/tip.js.map +3 -3
  409. package/dist/esm/components/credits/type.d.ts +24 -5
  410. package/dist/esm/components/index.d.ts +1 -0
  411. package/dist/esm/components/index.js +1 -1
  412. package/dist/esm/components/index.js.map +2 -2
  413. package/dist/esm/components/registration/authCodeActivate/Message.d.ts +4 -0
  414. package/dist/esm/components/registration/authCodeActivate/Message.js +2 -0
  415. package/dist/esm/components/registration/authCodeActivate/Message.js.map +7 -0
  416. package/dist/esm/components/registration/authCodeActivate/index.d.ts +3 -0
  417. package/dist/esm/components/registration/authCodeActivate/index.js +2 -0
  418. package/dist/esm/components/registration/authCodeActivate/index.js.map +7 -0
  419. package/dist/esm/components/registration/authCodeActivate/type.d.ts +22 -0
  420. package/dist/esm/components/registration/authCodeActivate/type.js.map +7 -0
  421. package/dist/esm/components/registration/context/index.d.ts +1 -0
  422. package/dist/esm/components/registration/context/index.js +2 -0
  423. package/dist/esm/components/registration/context/index.js.map +7 -0
  424. package/dist/esm/components/registration/context/provider.d.ts +27 -0
  425. package/dist/esm/components/registration/context/provider.js +2 -0
  426. package/dist/esm/components/registration/context/provider.js.map +7 -0
  427. package/dist/esm/components/registration/index.d.ts +2 -0
  428. package/dist/esm/components/registration/index.js +2 -0
  429. package/dist/esm/components/registration/index.js.map +7 -0
  430. package/dist/esm/components/registration/modalContainer.d.ts +14 -0
  431. package/dist/esm/components/registration/modalContainer.js +2 -0
  432. package/dist/esm/components/registration/modalContainer.js.map +7 -0
  433. package/dist/esm/index.d.ts +2 -2
  434. package/dist/esm/index.js +1 -1
  435. package/dist/esm/index.js.map +2 -2
  436. package/dist/esm/templates/Credits.d.ts +73 -0
  437. package/dist/esm/templates/Credits.js +2 -0
  438. package/dist/esm/templates/Credits.js.map +7 -0
  439. package/dist/esm/templates/index.d.ts +1 -0
  440. package/dist/esm/templates/index.js +2 -0
  441. package/dist/esm/templates/index.js.map +7 -0
  442. package/package.json +25 -22
  443. package/src/components/chat/index.tsx +1 -1
  444. package/src/components/credits/context/const.ts +1 -0
  445. package/src/components/credits/context/hooks/useActivities.ts +4 -3
  446. package/src/components/credits/context/hooks/useAddressValidate.ts +2 -2
  447. package/src/components/credits/context/hooks/useAlpcFetch.ts +14 -10
  448. package/src/components/credits/context/hooks/useCountries.ts +2 -2
  449. package/src/components/credits/context/hooks/useFunctionMemberPrice.ts +33 -0
  450. package/src/components/credits/context/hooks/useMyRewards.ts +4 -3
  451. package/src/components/credits/context/hooks/useRedeemAndBuy.ts +21 -24
  452. package/src/components/credits/context/hooks/useRedeemCoupon.ts +7 -3
  453. package/src/components/credits/context/hooks/useRedeemProduct.ts +5 -2
  454. package/src/components/credits/context/hooks/useRedeemableList.ts +4 -18
  455. package/src/components/credits/context/hooks/useSubscribed.ts +6 -7
  456. package/src/components/credits/context/hooks/useUploadReceipt.tsx +0 -1
  457. package/src/components/credits/context/memberPriceConst.ts +13 -0
  458. package/src/components/credits/context/memberPriceTypes.ts +54 -0
  459. package/src/components/credits/context/provider.tsx +25 -20
  460. package/src/components/credits/context/utils/atobID.ts +8 -0
  461. package/src/components/credits/context/utils/functionDiscountCalculate.ts +57 -0
  462. package/src/components/credits/context/utils/getFunctionMemberPrice.ts +135 -0
  463. package/src/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.ts +51 -0
  464. package/src/components/credits/context/utils/variantGetCoupon.ts +34 -0
  465. package/src/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.tsx +270 -0
  466. package/src/components/credits/creditsAnkersolixTask/index.ts +2 -0
  467. package/src/components/credits/creditsAnkersolixTask/type.ts +7 -0
  468. package/src/components/credits/creditsBanner/index.tsx +16 -18
  469. package/src/components/credits/creditsBenefits/BenefitItem.tsx +107 -0
  470. package/src/components/credits/creditsBenefits/index.tsx +20 -15
  471. package/src/components/credits/creditsCash/CreditsCash.tsx +84 -0
  472. package/src/components/credits/creditsCash/RedeemableItem.tsx +60 -43
  473. package/src/components/credits/creditsCash/index.ts +2 -0
  474. package/src/components/credits/creditsCash/type.ts +2 -4
  475. package/src/components/credits/creditsFaq/faqItem/FaqItem.tsx +12 -12
  476. package/src/components/credits/creditsFaq/index.tsx +8 -6
  477. package/src/components/credits/creditsInfoCard/index.tsx +42 -36
  478. package/src/components/credits/creditsMemberPrice/CreditsMemberPrice.tsx +389 -0
  479. package/src/components/credits/creditsMemberPrice/MemberPriceItem.tsx +158 -0
  480. package/src/components/credits/creditsMemberPrice/index.ts +2 -0
  481. package/src/components/credits/creditsMemberPrice/type.ts +75 -0
  482. package/src/components/credits/creditsNavigation/CreditsNavigation.tsx +123 -0
  483. package/src/components/credits/creditsNavigation/index.ts +2 -0
  484. package/src/components/credits/creditsNavigation/type.ts +10 -0
  485. package/src/components/credits/creditsRedeemList/AddressForm/CountrySelect.tsx +7 -3
  486. package/src/components/credits/creditsRedeemList/AddressForm/StateSelect.tsx +5 -1
  487. package/src/components/credits/creditsRedeemList/AddressForm/index.tsx +5 -5
  488. package/src/components/credits/creditsRedeemList/{index.tsx → CreditsRedeemList.tsx} +30 -35
  489. package/src/components/credits/creditsRedeemList/NonProductValue.tsx +39 -0
  490. package/src/components/credits/creditsRedeemList/RedeemCouponModal.tsx +11 -13
  491. package/src/components/credits/creditsRedeemList/RedeemProductModal/Address.tsx +14 -11
  492. package/src/components/credits/creditsRedeemList/RedeemProductModal/Error.tsx +1 -1
  493. package/src/components/credits/creditsRedeemList/RedeemProductModal/Init.tsx +6 -12
  494. package/src/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.tsx +25 -0
  495. package/src/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.tsx +11 -7
  496. package/src/components/credits/creditsRedeemList/RedeemProductModal/Success.tsx +4 -1
  497. package/src/components/credits/creditsRedeemList/RedeemProductModal/index.tsx +4 -5
  498. package/src/components/credits/creditsRedeemList/RedeemableItem.tsx +23 -32
  499. package/src/components/credits/creditsRedeemList/index.ts +2 -0
  500. package/src/components/credits/creditsRedeemList/type.ts +2 -16
  501. package/src/components/credits/creditsWaysToGetCredits/{index.tsx → CreditsWaysToGetCredits.tsx} +66 -18
  502. package/src/components/credits/creditsWaysToGetCredits/index.ts +2 -0
  503. package/src/components/credits/creditsWaysToGetCredits/type.ts +5 -16
  504. package/src/components/credits/creditsWaysToGetCredits/useActions.ts +24 -10
  505. package/src/components/credits/modal/MyRewardsModal.tsx +83 -63
  506. package/src/components/credits/modal/activitiesModal.tsx +61 -46
  507. package/src/components/credits/modal/creditsUploadReceiptModal.tsx +9 -1
  508. package/src/components/credits/modal/loadingDots.tsx +9 -7
  509. package/src/components/credits/modal/modalContainer.tsx +5 -1
  510. package/src/components/credits/modal/rulesModal.tsx +1 -1
  511. package/src/components/credits/modal/subscribeModal.tsx +201 -0
  512. package/src/components/credits/modal/tip.tsx +10 -1
  513. package/src/components/credits/type.ts +24 -5
  514. package/src/components/index.ts +2 -2
  515. package/src/components/registration/authCodeActivate/Message.tsx +43 -0
  516. package/src/components/registration/authCodeActivate/index.tsx +338 -0
  517. package/src/components/registration/authCodeActivate/type.ts +23 -0
  518. package/src/components/registration/context/index.tsx +1 -0
  519. package/src/components/registration/context/provider.tsx +86 -0
  520. package/src/components/registration/index.ts +2 -0
  521. package/src/components/registration/modalContainer.tsx +114 -0
  522. package/src/index.ts +2 -4
  523. package/src/styles/global.css +15 -0
  524. package/src/templates/Credits.tsx +165 -0
  525. package/src/templates/index.ts +1 -0
  526. package/style.css +1 -0
  527. package/tailwind.config.ts +10 -0
  528. package/dist/cjs/components/chat/chat-context.d.ts +0 -101
  529. package/dist/cjs/components/credits/context/hooks/useSendEmailValidation.d.ts +0 -1
  530. package/dist/cjs/components/credits/context/hooks/useSendEmailValidation.js +0 -2
  531. package/dist/cjs/components/credits/context/hooks/useSendEmailValidation.js.map +0 -7
  532. package/dist/cjs/components/credits/context/hooks/useSubscriptions.d.ts +0 -5
  533. package/dist/cjs/components/credits/context/hooks/useSubscriptions.js +0 -2
  534. package/dist/cjs/components/credits/context/hooks/useSubscriptions.js.map +0 -7
  535. package/dist/cjs/components/credits/credits-banner/index.d.ts +0 -23
  536. package/dist/cjs/components/credits/credits-banner/index.js +0 -2
  537. package/dist/cjs/components/credits/credits-banner/index.js.map +0 -7
  538. package/dist/cjs/components/credits/credits-benefits/benefitItem.js +0 -2
  539. package/dist/cjs/components/credits/credits-benefits/benefitItem.js.map +0 -7
  540. package/dist/cjs/components/credits/credits-benefits/index.d.ts +0 -12
  541. package/dist/cjs/components/credits/credits-benefits/index.js +0 -4
  542. package/dist/cjs/components/credits/credits-benefits/index.js.map +0 -7
  543. package/dist/cjs/components/credits/credits-cash/RedeemableItem.d.ts +0 -15
  544. package/dist/cjs/components/credits/credits-cash/RedeemableItem.js +0 -2
  545. package/dist/cjs/components/credits/credits-cash/RedeemableItem.js.map +0 -7
  546. package/dist/cjs/components/credits/credits-cash/index.d.ts +0 -13
  547. package/dist/cjs/components/credits/credits-cash/index.js +0 -2
  548. package/dist/cjs/components/credits/credits-cash/index.js.map +0 -7
  549. package/dist/cjs/components/credits/credits-cash/type.d.ts +0 -47
  550. package/dist/cjs/components/credits/credits-cash/type.js +0 -2
  551. package/dist/cjs/components/credits/credits-cash/type.js.map +0 -7
  552. package/dist/cjs/components/credits/credits-faq/faq-item/FaqItem.d.ts +0 -13
  553. package/dist/cjs/components/credits/credits-faq/faq-item/faq-item.d.ts +0 -13
  554. package/dist/cjs/components/credits/credits-faq/faq-item/faq-item.js +0 -2
  555. package/dist/cjs/components/credits/credits-faq/faq-item/faq-item.js.map +0 -7
  556. package/dist/cjs/components/credits/credits-faq/faqItem/FaqItem.d.ts +0 -13
  557. package/dist/cjs/components/credits/credits-faq/index.d.ts +0 -16
  558. package/dist/cjs/components/credits/credits-faq/index.js +0 -2
  559. package/dist/cjs/components/credits/credits-faq/index.js.map +0 -7
  560. package/dist/cjs/components/credits/credits-info-card/index.d.ts +0 -20
  561. package/dist/cjs/components/credits/credits-info-card/index.js +0 -2
  562. package/dist/cjs/components/credits/credits-info-card/index.js.map +0 -7
  563. package/dist/cjs/components/credits/credits-redeem-list/AddressForm/Input.d.ts +0 -13
  564. package/dist/cjs/components/credits/credits-redeem-list/AddressForm/country-select.d.ts +0 -14
  565. package/dist/cjs/components/credits/credits-redeem-list/AddressForm/form-item.d.ts +0 -6
  566. package/dist/cjs/components/credits/credits-redeem-list/AddressForm/index.d.ts +0 -2
  567. package/dist/cjs/components/credits/credits-redeem-list/AddressForm/state-select.d.ts +0 -15
  568. package/dist/cjs/components/credits/credits-redeem-list/AddressForm/type.d.ts +0 -26
  569. package/dist/cjs/components/credits/credits-redeem-list/RedeemCouponModal.d.ts +0 -9
  570. package/dist/cjs/components/credits/credits-redeem-list/RedeemProductModal/Address.d.ts +0 -20
  571. package/dist/cjs/components/credits/credits-redeem-list/RedeemProductModal/Error.d.ts +0 -8
  572. package/dist/cjs/components/credits/credits-redeem-list/RedeemProductModal/Init.d.ts +0 -11
  573. package/dist/cjs/components/credits/credits-redeem-list/RedeemProductModal/ProductInfo.d.ts +0 -8
  574. package/dist/cjs/components/credits/credits-redeem-list/RedeemProductModal/Success.d.ts +0 -13
  575. package/dist/cjs/components/credits/credits-redeem-list/RedeemProductModal/index.d.ts +0 -11
  576. package/dist/cjs/components/credits/credits-redeem-list/RedeemableItem.d.ts +0 -9
  577. package/dist/cjs/components/credits/credits-redeem-list/RedeemableItem.js +0 -2
  578. package/dist/cjs/components/credits/credits-redeem-list/RedeemableItem.js.map +0 -7
  579. package/dist/cjs/components/credits/credits-redeem-list/address-form/Input.d.ts +0 -13
  580. package/dist/cjs/components/credits/credits-redeem-list/address-form/country-select.d.ts +0 -14
  581. package/dist/cjs/components/credits/credits-redeem-list/address-form/country-select.js +0 -2
  582. package/dist/cjs/components/credits/credits-redeem-list/address-form/country-select.js.map +0 -7
  583. package/dist/cjs/components/credits/credits-redeem-list/address-form/form-item.d.ts +0 -6
  584. package/dist/cjs/components/credits/credits-redeem-list/address-form/index.d.ts +0 -2
  585. package/dist/cjs/components/credits/credits-redeem-list/address-form/index.js +0 -2
  586. package/dist/cjs/components/credits/credits-redeem-list/address-form/index.js.map +0 -7
  587. package/dist/cjs/components/credits/credits-redeem-list/address-form/state-select.d.ts +0 -15
  588. package/dist/cjs/components/credits/credits-redeem-list/address-form/state-select.js +0 -2
  589. package/dist/cjs/components/credits/credits-redeem-list/address-form/state-select.js.map +0 -7
  590. package/dist/cjs/components/credits/credits-redeem-list/address-form/type.d.ts +0 -26
  591. package/dist/cjs/components/credits/credits-redeem-list/index.d.ts +0 -13
  592. package/dist/cjs/components/credits/credits-redeem-list/index.js +0 -2
  593. package/dist/cjs/components/credits/credits-redeem-list/index.js.map +0 -7
  594. package/dist/cjs/components/credits/credits-redeem-list/redeem-coupon-modal.d.ts +0 -9
  595. package/dist/cjs/components/credits/credits-redeem-list/redeem-coupon-modal.js +0 -2
  596. package/dist/cjs/components/credits/credits-redeem-list/redeem-coupon-modal.js.map +0 -7
  597. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Address.d.ts +0 -20
  598. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Address.js +0 -2
  599. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Address.js.map +0 -7
  600. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Error.d.ts +0 -8
  601. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Init.d.ts +0 -11
  602. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Init.js +0 -2
  603. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Init.js.map +0 -7
  604. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/ProductInfo.d.ts +0 -8
  605. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/ProductInfo.js +0 -2
  606. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/ProductInfo.js.map +0 -7
  607. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Success.d.ts +0 -13
  608. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Success.js +0 -2
  609. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Success.js.map +0 -7
  610. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/index.d.ts +0 -11
  611. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/index.js +0 -2
  612. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/index.js.map +0 -7
  613. package/dist/cjs/components/credits/credits-redeem-list/type.d.ts +0 -77
  614. package/dist/cjs/components/credits/credits-redeem-list/type.js.map +0 -7
  615. package/dist/cjs/components/credits/credits-ways-to-get-credits/index.d.ts +0 -2
  616. package/dist/cjs/components/credits/credits-ways-to-get-credits/index.js +0 -2
  617. package/dist/cjs/components/credits/credits-ways-to-get-credits/index.js.map +0 -7
  618. package/dist/cjs/components/credits/credits-ways-to-get-credits/type.d.ts +0 -60
  619. package/dist/cjs/components/credits/credits-ways-to-get-credits/type.js +0 -2
  620. package/dist/cjs/components/credits/credits-ways-to-get-credits/type.js.map +0 -7
  621. package/dist/cjs/components/credits/credits-ways-to-get-credits/useActions.d.ts +0 -96
  622. package/dist/cjs/components/credits/credits-ways-to-get-credits/useActions.js +0 -2
  623. package/dist/cjs/components/credits/credits-ways-to-get-credits/useActions.js.map +0 -7
  624. package/dist/cjs/components/credits/creditsBenefits/benefitItem.d.ts +0 -19
  625. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/country-select.d.ts +0 -14
  626. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/form-item.d.ts +0 -6
  627. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/state-select.d.ts +0 -15
  628. package/dist/cjs/helpers/fetchResponse.d.ts +0 -14
  629. package/dist/cjs/helpers/fetchResponse.js +0 -2
  630. package/dist/cjs/helpers/fetchResponse.js.map +0 -7
  631. package/dist/cjs/helpers/fetcher.d.ts +0 -2
  632. package/dist/cjs/helpers/fetcher.js +0 -2
  633. package/dist/cjs/helpers/fetcher.js.map +0 -7
  634. package/dist/cjs/helpers/index.d.ts +0 -2
  635. package/dist/cjs/helpers/index.js +0 -2
  636. package/dist/cjs/helpers/index.js.map +0 -7
  637. package/dist/cjs/helpers/track.d.ts +0 -15
  638. package/dist/cjs/helpers/track.js +0 -2
  639. package/dist/cjs/helpers/track.js.map +0 -7
  640. package/dist/cjs/helpers/utils.d.ts +0 -3
  641. package/dist/cjs/helpers/utils.js +0 -2
  642. package/dist/cjs/helpers/utils.js.map +0 -7
  643. package/dist/cjs/index.css +0 -2
  644. package/dist/cjs/index.css.map +0 -7
  645. package/dist/cjs/shopify/context/ShopifyProvider.d.ts +0 -10
  646. package/dist/cjs/shopify/context/index.d.ts +0 -1
  647. package/dist/cjs/shopify/context/shopify-provider.d.ts +0 -10
  648. package/dist/cjs/shopify/fetchers/create-cart.d.ts +0 -12
  649. package/dist/cjs/shopify/fetchers/get-products-by-handles.d.ts +0 -7
  650. package/dist/cjs/shopify/fetchers/index.d.ts +0 -2
  651. package/dist/cjs/shopify/fragments/article.d.ts +0 -2
  652. package/dist/cjs/shopify/fragments/blog.d.ts +0 -1
  653. package/dist/cjs/shopify/fragments/cart.d.ts +0 -1
  654. package/dist/cjs/shopify/fragments/collection.d.ts +0 -1
  655. package/dist/cjs/shopify/fragments/image.d.ts +0 -1
  656. package/dist/cjs/shopify/fragments/index.d.ts +0 -11
  657. package/dist/cjs/shopify/fragments/metafields.d.ts +0 -2
  658. package/dist/cjs/shopify/fragments/page-info.d.ts +0 -1
  659. package/dist/cjs/shopify/fragments/page.d.ts +0 -1
  660. package/dist/cjs/shopify/fragments/product.d.ts +0 -1
  661. package/dist/cjs/shopify/fragments/seo.d.ts +0 -1
  662. package/dist/cjs/shopify/fragments/variant.d.ts +0 -1
  663. package/dist/cjs/shopify/gql/fragment-masking.d.ts +0 -15
  664. package/dist/cjs/shopify/gql/gql.d.ts +0 -87
  665. package/dist/cjs/shopify/gql/graphql.d.ts +0 -7669
  666. package/dist/cjs/shopify/gql/index.d.ts +0 -3
  667. package/dist/cjs/shopify/hooks/index.d.ts +0 -2
  668. package/dist/cjs/shopify/hooks/use-create-cart.d.ts +0 -2
  669. package/dist/cjs/shopify/hooks/use-products-by-handles.d.ts +0 -4
  670. package/dist/cjs/shopify/hooks/useCreateCart.d.ts +0 -2
  671. package/dist/cjs/shopify/hooks/useProductsByHandles.d.ts +0 -4
  672. package/dist/cjs/shopify/mutations/create-cart.d.ts +0 -1
  673. package/dist/cjs/shopify/queries/get-product-by-handles.d.ts +0 -1
  674. package/dist/cjs/shopify/queries/index.d.ts +0 -1
  675. package/dist/cjs/shopify/src/index.d.ts +0 -5
  676. package/dist/cjs/shopify/tsup.config.d.ts +0 -2
  677. package/dist/cjs/shopify/types/article.d.ts +0 -48
  678. package/dist/cjs/shopify/types/cart.d.ts +0 -173
  679. package/dist/cjs/shopify/types/checkout.d.ts +0 -42
  680. package/dist/cjs/shopify/types/collection.d.ts +0 -122
  681. package/dist/cjs/shopify/types/common.d.ts +0 -42
  682. package/dist/cjs/shopify/types/config.d.ts +0 -12
  683. package/dist/cjs/shopify/types/customer.d.ts +0 -30
  684. package/dist/cjs/shopify/types/fetcher.d.ts +0 -38
  685. package/dist/cjs/shopify/types/index.d.ts +0 -12
  686. package/dist/cjs/shopify/types/page.d.ts +0 -33
  687. package/dist/cjs/shopify/types/product.d.ts +0 -174
  688. package/dist/cjs/shopify/types/search.d.ts +0 -54
  689. package/dist/cjs/shopify/types/site.d.ts +0 -33
  690. package/dist/cjs/shopify/types/type-helper.d.ts +0 -5
  691. package/dist/cjs/shopify/utils/colors.d.ts +0 -3
  692. package/dist/cjs/shopify/utils/const.d.ts +0 -76
  693. package/dist/cjs/shopify/utils/cookie.d.ts +0 -15
  694. package/dist/cjs/shopify/utils/errors.d.ts +0 -38
  695. package/dist/cjs/shopify/utils/fetch-graphql-api.d.ts +0 -19
  696. package/dist/cjs/shopify/utils/handle-fetch-response.d.ts +0 -5
  697. package/dist/cjs/shopify/utils/helper.d.ts +0 -28
  698. package/dist/cjs/shopify/utils/normalize/cart.d.ts +0 -7
  699. package/dist/cjs/shopify/utils/normalize/customer.d.ts +0 -3
  700. package/dist/cjs/shopify/utils/normalize/index.d.ts +0 -2
  701. package/dist/cjs/shopify/utils/normalize/metafield.d.ts +0 -5
  702. package/dist/cjs/shopify/utils/normalize/product.d.ts +0 -16
  703. package/dist/cjs/shopify/utils/store.d.ts +0 -2
  704. package/dist/cjs/shopify/utils/type-helper.d.ts +0 -5
  705. package/dist/cjs/tsconfig.tsbuildinfo +0 -1
  706. package/dist/esm/components/chat/chat-context.d.ts +0 -101
  707. package/dist/esm/components/chat/chat-context.js +0 -2
  708. package/dist/esm/components/chat/chat-context.js.map +0 -7
  709. package/dist/esm/components/credits/context/hooks/useSendEmailValidation.d.ts +0 -1
  710. package/dist/esm/components/credits/context/hooks/useSendEmailValidation.js +0 -2
  711. package/dist/esm/components/credits/context/hooks/useSendEmailValidation.js.map +0 -7
  712. package/dist/esm/components/credits/context/hooks/useSubscriptions.d.ts +0 -5
  713. package/dist/esm/components/credits/context/hooks/useSubscriptions.js +0 -2
  714. package/dist/esm/components/credits/context/hooks/useSubscriptions.js.map +0 -7
  715. package/dist/esm/components/credits/credits-banner/index.d.ts +0 -23
  716. package/dist/esm/components/credits/credits-banner/index.js +0 -2
  717. package/dist/esm/components/credits/credits-banner/index.js.map +0 -7
  718. package/dist/esm/components/credits/credits-benefits/benefitItem.js +0 -2
  719. package/dist/esm/components/credits/credits-benefits/benefitItem.js.map +0 -7
  720. package/dist/esm/components/credits/credits-benefits/iconInfo.d.ts +0 -2
  721. package/dist/esm/components/credits/credits-benefits/iconInfo.js.map +0 -7
  722. package/dist/esm/components/credits/credits-benefits/index.d.ts +0 -12
  723. package/dist/esm/components/credits/credits-benefits/index.js +0 -4
  724. package/dist/esm/components/credits/credits-benefits/index.js.map +0 -7
  725. package/dist/esm/components/credits/credits-cash/RedeemableItem.d.ts +0 -15
  726. package/dist/esm/components/credits/credits-cash/RedeemableItem.js +0 -2
  727. package/dist/esm/components/credits/credits-cash/RedeemableItem.js.map +0 -7
  728. package/dist/esm/components/credits/credits-cash/index.d.ts +0 -13
  729. package/dist/esm/components/credits/credits-cash/index.js +0 -2
  730. package/dist/esm/components/credits/credits-cash/index.js.map +0 -7
  731. package/dist/esm/components/credits/credits-cash/type.d.ts +0 -47
  732. package/dist/esm/components/credits/credits-faq/faq-item/FaqItem.d.ts +0 -13
  733. package/dist/esm/components/credits/credits-faq/faq-item/faq-item.d.ts +0 -13
  734. package/dist/esm/components/credits/credits-faq/faq-item/faq-item.js +0 -2
  735. package/dist/esm/components/credits/credits-faq/faq-item/faq-item.js.map +0 -7
  736. package/dist/esm/components/credits/credits-faq/faqItem/FaqItem.d.ts +0 -13
  737. package/dist/esm/components/credits/credits-faq/index.d.ts +0 -16
  738. package/dist/esm/components/credits/credits-faq/index.js +0 -2
  739. package/dist/esm/components/credits/credits-faq/index.js.map +0 -7
  740. package/dist/esm/components/credits/credits-info-card/index.d.ts +0 -20
  741. package/dist/esm/components/credits/credits-info-card/index.js +0 -2
  742. package/dist/esm/components/credits/credits-info-card/index.js.map +0 -7
  743. package/dist/esm/components/credits/credits-redeem-list/AddressForm/Input.d.ts +0 -13
  744. package/dist/esm/components/credits/credits-redeem-list/AddressForm/country-select.d.ts +0 -14
  745. package/dist/esm/components/credits/credits-redeem-list/AddressForm/form-item.d.ts +0 -6
  746. package/dist/esm/components/credits/credits-redeem-list/AddressForm/index.d.ts +0 -2
  747. package/dist/esm/components/credits/credits-redeem-list/AddressForm/state-select.d.ts +0 -15
  748. package/dist/esm/components/credits/credits-redeem-list/AddressForm/type.d.ts +0 -26
  749. package/dist/esm/components/credits/credits-redeem-list/RedeemCouponModal.d.ts +0 -9
  750. package/dist/esm/components/credits/credits-redeem-list/RedeemProductModal/Address.d.ts +0 -20
  751. package/dist/esm/components/credits/credits-redeem-list/RedeemProductModal/Error.d.ts +0 -8
  752. package/dist/esm/components/credits/credits-redeem-list/RedeemProductModal/Init.d.ts +0 -11
  753. package/dist/esm/components/credits/credits-redeem-list/RedeemProductModal/ProductInfo.d.ts +0 -8
  754. package/dist/esm/components/credits/credits-redeem-list/RedeemProductModal/Success.d.ts +0 -13
  755. package/dist/esm/components/credits/credits-redeem-list/RedeemProductModal/index.d.ts +0 -11
  756. package/dist/esm/components/credits/credits-redeem-list/RedeemableItem.d.ts +0 -9
  757. package/dist/esm/components/credits/credits-redeem-list/RedeemableItem.js +0 -2
  758. package/dist/esm/components/credits/credits-redeem-list/RedeemableItem.js.map +0 -7
  759. package/dist/esm/components/credits/credits-redeem-list/address-form/Input.d.ts +0 -13
  760. package/dist/esm/components/credits/credits-redeem-list/address-form/Input.js +0 -2
  761. package/dist/esm/components/credits/credits-redeem-list/address-form/Input.js.map +0 -7
  762. package/dist/esm/components/credits/credits-redeem-list/address-form/country-select.d.ts +0 -14
  763. package/dist/esm/components/credits/credits-redeem-list/address-form/country-select.js +0 -2
  764. package/dist/esm/components/credits/credits-redeem-list/address-form/country-select.js.map +0 -7
  765. package/dist/esm/components/credits/credits-redeem-list/address-form/form-item.d.ts +0 -6
  766. package/dist/esm/components/credits/credits-redeem-list/address-form/form-item.js +0 -2
  767. package/dist/esm/components/credits/credits-redeem-list/address-form/form-item.js.map +0 -7
  768. package/dist/esm/components/credits/credits-redeem-list/address-form/index.d.ts +0 -2
  769. package/dist/esm/components/credits/credits-redeem-list/address-form/index.js +0 -2
  770. package/dist/esm/components/credits/credits-redeem-list/address-form/index.js.map +0 -7
  771. package/dist/esm/components/credits/credits-redeem-list/address-form/state-select.d.ts +0 -15
  772. package/dist/esm/components/credits/credits-redeem-list/address-form/state-select.js +0 -2
  773. package/dist/esm/components/credits/credits-redeem-list/address-form/state-select.js.map +0 -7
  774. package/dist/esm/components/credits/credits-redeem-list/address-form/type.d.ts +0 -26
  775. package/dist/esm/components/credits/credits-redeem-list/index.d.ts +0 -13
  776. package/dist/esm/components/credits/credits-redeem-list/index.js +0 -2
  777. package/dist/esm/components/credits/credits-redeem-list/index.js.map +0 -7
  778. package/dist/esm/components/credits/credits-redeem-list/redeem-coupon-modal.d.ts +0 -9
  779. package/dist/esm/components/credits/credits-redeem-list/redeem-coupon-modal.js +0 -2
  780. package/dist/esm/components/credits/credits-redeem-list/redeem-coupon-modal.js.map +0 -7
  781. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Address.d.ts +0 -20
  782. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Address.js +0 -2
  783. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Address.js.map +0 -7
  784. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Error.d.ts +0 -8
  785. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Error.js +0 -2
  786. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Error.js.map +0 -7
  787. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Init.d.ts +0 -11
  788. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Init.js +0 -2
  789. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Init.js.map +0 -7
  790. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/ProductInfo.d.ts +0 -8
  791. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/ProductInfo.js +0 -2
  792. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/ProductInfo.js.map +0 -7
  793. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Success.d.ts +0 -13
  794. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Success.js +0 -2
  795. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Success.js.map +0 -7
  796. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/index.d.ts +0 -11
  797. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/index.js +0 -2
  798. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/index.js.map +0 -7
  799. package/dist/esm/components/credits/credits-redeem-list/type.d.ts +0 -77
  800. package/dist/esm/components/credits/credits-ways-to-get-credits/index.d.ts +0 -2
  801. package/dist/esm/components/credits/credits-ways-to-get-credits/index.js +0 -2
  802. package/dist/esm/components/credits/credits-ways-to-get-credits/index.js.map +0 -7
  803. package/dist/esm/components/credits/credits-ways-to-get-credits/type.d.ts +0 -60
  804. package/dist/esm/components/credits/credits-ways-to-get-credits/type.js +0 -2
  805. package/dist/esm/components/credits/credits-ways-to-get-credits/type.js.map +0 -7
  806. package/dist/esm/components/credits/credits-ways-to-get-credits/useActions.d.ts +0 -96
  807. package/dist/esm/components/credits/credits-ways-to-get-credits/useActions.js +0 -2
  808. package/dist/esm/components/credits/credits-ways-to-get-credits/useActions.js.map +0 -7
  809. package/dist/esm/components/credits/creditsBenefits/benefitItem.d.ts +0 -19
  810. package/dist/esm/components/credits/creditsBenefits/benefitItem.js +0 -2
  811. package/dist/esm/components/credits/creditsBenefits/benefitItem.js.map +0 -7
  812. package/dist/esm/components/credits/creditsBenefits/iconInfo.d.ts +0 -2
  813. package/dist/esm/components/credits/creditsBenefits/iconInfo.js +0 -2
  814. package/dist/esm/components/credits/creditsRedeemList/AddressForm/country-select.d.ts +0 -14
  815. package/dist/esm/components/credits/creditsRedeemList/AddressForm/form-item.d.ts +0 -6
  816. package/dist/esm/components/credits/creditsRedeemList/AddressForm/state-select.d.ts +0 -15
  817. package/dist/esm/helpers/fetchResponse.d.ts +0 -14
  818. package/dist/esm/helpers/fetchResponse.js +0 -2
  819. package/dist/esm/helpers/fetchResponse.js.map +0 -7
  820. package/dist/esm/helpers/fetcher.d.ts +0 -2
  821. package/dist/esm/helpers/fetcher.js +0 -2
  822. package/dist/esm/helpers/fetcher.js.map +0 -7
  823. package/dist/esm/helpers/index.d.ts +0 -2
  824. package/dist/esm/helpers/index.js +0 -2
  825. package/dist/esm/helpers/index.js.map +0 -7
  826. package/dist/esm/helpers/track.d.ts +0 -15
  827. package/dist/esm/helpers/track.js +0 -2
  828. package/dist/esm/helpers/track.js.map +0 -7
  829. package/dist/esm/helpers/utils.d.ts +0 -3
  830. package/dist/esm/helpers/utils.js +0 -2
  831. package/dist/esm/helpers/utils.js.map +0 -7
  832. package/dist/esm/index.css +0 -2
  833. package/dist/esm/index.css.map +0 -7
  834. package/dist/esm/shopify/context/ShopifyProvider.d.ts +0 -10
  835. package/dist/esm/shopify/context/index.d.ts +0 -1
  836. package/dist/esm/shopify/context/shopify-provider.d.ts +0 -10
  837. package/dist/esm/shopify/fetchers/create-cart.d.ts +0 -12
  838. package/dist/esm/shopify/fetchers/get-products-by-handles.d.ts +0 -7
  839. package/dist/esm/shopify/fetchers/index.d.ts +0 -2
  840. package/dist/esm/shopify/fragments/article.d.ts +0 -2
  841. package/dist/esm/shopify/fragments/blog.d.ts +0 -1
  842. package/dist/esm/shopify/fragments/cart.d.ts +0 -1
  843. package/dist/esm/shopify/fragments/collection.d.ts +0 -1
  844. package/dist/esm/shopify/fragments/image.d.ts +0 -1
  845. package/dist/esm/shopify/fragments/index.d.ts +0 -11
  846. package/dist/esm/shopify/fragments/metafields.d.ts +0 -2
  847. package/dist/esm/shopify/fragments/page-info.d.ts +0 -1
  848. package/dist/esm/shopify/fragments/page.d.ts +0 -1
  849. package/dist/esm/shopify/fragments/product.d.ts +0 -1
  850. package/dist/esm/shopify/fragments/seo.d.ts +0 -1
  851. package/dist/esm/shopify/fragments/variant.d.ts +0 -1
  852. package/dist/esm/shopify/gql/fragment-masking.d.ts +0 -15
  853. package/dist/esm/shopify/gql/gql.d.ts +0 -87
  854. package/dist/esm/shopify/gql/graphql.d.ts +0 -7669
  855. package/dist/esm/shopify/gql/index.d.ts +0 -3
  856. package/dist/esm/shopify/hooks/index.d.ts +0 -2
  857. package/dist/esm/shopify/hooks/use-create-cart.d.ts +0 -2
  858. package/dist/esm/shopify/hooks/use-products-by-handles.d.ts +0 -4
  859. package/dist/esm/shopify/hooks/useCreateCart.d.ts +0 -2
  860. package/dist/esm/shopify/hooks/useProductsByHandles.d.ts +0 -4
  861. package/dist/esm/shopify/mutations/create-cart.d.ts +0 -1
  862. package/dist/esm/shopify/queries/get-product-by-handles.d.ts +0 -1
  863. package/dist/esm/shopify/queries/index.d.ts +0 -1
  864. package/dist/esm/shopify/src/index.d.ts +0 -5
  865. package/dist/esm/shopify/tsup.config.d.ts +0 -2
  866. package/dist/esm/shopify/types/article.d.ts +0 -48
  867. package/dist/esm/shopify/types/cart.d.ts +0 -173
  868. package/dist/esm/shopify/types/checkout.d.ts +0 -42
  869. package/dist/esm/shopify/types/collection.d.ts +0 -122
  870. package/dist/esm/shopify/types/common.d.ts +0 -42
  871. package/dist/esm/shopify/types/config.d.ts +0 -12
  872. package/dist/esm/shopify/types/customer.d.ts +0 -30
  873. package/dist/esm/shopify/types/fetcher.d.ts +0 -38
  874. package/dist/esm/shopify/types/index.d.ts +0 -12
  875. package/dist/esm/shopify/types/page.d.ts +0 -33
  876. package/dist/esm/shopify/types/product.d.ts +0 -174
  877. package/dist/esm/shopify/types/search.d.ts +0 -54
  878. package/dist/esm/shopify/types/site.d.ts +0 -33
  879. package/dist/esm/shopify/types/type-helper.d.ts +0 -5
  880. package/dist/esm/shopify/utils/colors.d.ts +0 -3
  881. package/dist/esm/shopify/utils/const.d.ts +0 -76
  882. package/dist/esm/shopify/utils/cookie.d.ts +0 -15
  883. package/dist/esm/shopify/utils/errors.d.ts +0 -38
  884. package/dist/esm/shopify/utils/fetch-graphql-api.d.ts +0 -19
  885. package/dist/esm/shopify/utils/handle-fetch-response.d.ts +0 -5
  886. package/dist/esm/shopify/utils/helper.d.ts +0 -28
  887. package/dist/esm/shopify/utils/normalize/cart.d.ts +0 -7
  888. package/dist/esm/shopify/utils/normalize/customer.d.ts +0 -3
  889. package/dist/esm/shopify/utils/normalize/index.d.ts +0 -2
  890. package/dist/esm/shopify/utils/normalize/metafield.d.ts +0 -5
  891. package/dist/esm/shopify/utils/normalize/product.d.ts +0 -16
  892. package/dist/esm/shopify/utils/store.d.ts +0 -2
  893. package/dist/esm/shopify/utils/type-helper.d.ts +0 -5
  894. package/dist/esm/tsconfig.tsbuildinfo +0 -1
  895. package/src/components/credits/context/hooks/useSendEmailValidation.ts +0 -20
  896. package/src/components/credits/context/hooks/useSubscriptions.ts +0 -54
  897. package/src/components/credits/creditsBenefits/benefitItem.tsx +0 -73
  898. package/src/components/credits/creditsCash/index.tsx +0 -102
  899. package/src/helpers/fetchResponse.ts +0 -35
  900. package/src/helpers/fetcher.ts +0 -44
  901. package/src/helpers/index.ts +0 -2
  902. package/src/helpers/track.ts +0 -55
  903. package/src/helpers/utils.ts +0 -8
  904. /package/dist/cjs/components/credits/{credits-benefits/iconInfo.d.ts → creditsBenefits/IconInfo.d.ts} +0 -0
  905. /package/dist/cjs/components/credits/{credits-redeem-list/address-form → creditsRedeemList/AddressForm}/Input.js +0 -0
  906. /package/dist/cjs/components/credits/{credits-redeem-list/address-form → creditsRedeemList/AddressForm}/type.js +0 -0
  907. /package/dist/cjs/components/credits/{credits-redeem-list → creditsRedeemList}/type.js +0 -0
  908. /package/dist/esm/components/credits/{credits-cash/type.js.map → context/memberPriceTypes.js.map} +0 -0
  909. /package/dist/{cjs/components/credits/creditsBenefits/iconInfo.d.ts → esm/components/credits/creditsBenefits/IconInfo.d.ts} +0 -0
  910. /package/dist/esm/components/credits/{credits-cash → creditsMemberPrice}/type.js +0 -0
  911. /package/dist/esm/components/credits/{credits-redeem-list/address-form → creditsMemberPrice}/type.js.map +0 -0
  912. /package/dist/esm/components/credits/{credits-redeem-list/address-form → creditsNavigation}/type.js +0 -0
  913. /package/dist/esm/components/credits/{credits-redeem-list → creditsNavigation}/type.js.map +0 -0
  914. /package/dist/esm/components/{credits/credits-redeem-list → registration/authCodeActivate}/type.js +0 -0
  915. /package/src/components/credits/creditsBenefits/{iconInfo.tsx → IconInfo.tsx} +0 -0
@@ -0,0 +1,2 @@
1
+ import{jsx as t,jsxs as p}from"react/jsx-runtime";import{Text as o}from"@anker-in/headless-ui";import{ConsumeType as l}from"../../context/const";import{useCreditsContext as a}from"../../context/provider";const x=({item:e,copy:i})=>{const{pageCommon:n}=a();return e.config?.type===l.ShippingCoupon?t(o,{className:"text-[24px] w-[70%] font-bold leading-none",html:e.config?.value,as:"p"}):e.config?.value?p("div",{className:"flex items-end gap-[4px]",children:[t(o,{className:"text-[64px] font-extrabold leading-none",html:e.config.value.toString()}),t(o,{className:"text-[24px] font-bold leading-[2]",html:e.config.type===l.Coupon?n?.off:n?.giftCardLabel})]}):t(o,{className:"text-[24px] w-[70%] font-bold leading-none",html:e.config?.title,as:"p"})};export{x as NoneProductValue};
2
+ //# sourceMappingURL=NonProductValue.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.tsx"],
4
+ "sourcesContent": ["import { Text } from '@anker-in/headless-ui'\nimport { RedeemableItem } from '../../type'\nimport { CreditsRedeemListCopy } from '../type'\nimport { ConsumeType } from '../../context/const'\nimport { useCreditsContext } from '../../context/provider'\n\nexport const NoneProductValue = ({ item, copy }: { item: RedeemableItem; copy: CreditsRedeemListCopy }) => {\n const { pageCommon } = useCreditsContext()\n // shipping coupon \u4EC5\u5C55\u793A\u6587\u6848\n if (item.config?.type === ConsumeType.ShippingCoupon) {\n return <Text className=\"text-[24px] w-[70%] font-bold leading-none\" html={item.config?.value} as=\"p\" />\n } else {\n return item.config?.value ? (\n <div className=\"flex items-end gap-[4px]\">\n <Text className=\"text-[64px] font-extrabold leading-none\" html={item.config.value.toString()} />\n <Text\n className=\"text-[24px] font-bold leading-[2]\"\n html={item.config.type === ConsumeType.Coupon ? pageCommon?.off : pageCommon?.giftCardLabel}\n />\n </div>\n ) : (\n <Text className=\"text-[24px] w-[70%] font-bold leading-none\" html={item.config?.title} as=\"p\" />\n )\n }\n}\n"],
5
+ "mappings": "AAUW,cAAAA,EAGL,QAAAC,MAHK,oBAVX,OAAS,QAAAC,MAAY,wBAGrB,OAAS,eAAAC,MAAmB,sBAC5B,OAAS,qBAAAC,MAAyB,yBAE3B,MAAMC,EAAmB,CAAC,CAAE,KAAAC,EAAM,KAAAC,CAAK,IAA6D,CACzG,KAAM,CAAE,WAAAC,CAAW,EAAIJ,EAAkB,EAEzC,OAAIE,EAAK,QAAQ,OAASH,EAAY,eAC7BH,EAACE,EAAA,CAAK,UAAU,6CAA6C,KAAMI,EAAK,QAAQ,MAAO,GAAG,IAAI,EAE9FA,EAAK,QAAQ,MAClBL,EAAC,OAAI,UAAU,2BACb,UAAAD,EAACE,EAAA,CAAK,UAAU,0CAA0C,KAAMI,EAAK,OAAO,MAAM,SAAS,EAAG,EAC9FN,EAACE,EAAA,CACC,UAAU,oCACV,KAAMI,EAAK,OAAO,OAASH,EAAY,OAASK,GAAY,IAAMA,GAAY,cAChF,GACF,EAEAR,EAACE,EAAA,CAAK,UAAU,6CAA6C,KAAMI,EAAK,QAAQ,MAAO,GAAG,IAAI,CAGpG",
6
+ "names": ["jsx", "jsxs", "Text", "ConsumeType", "useCreditsContext", "NoneProductValue", "item", "copy", "pageCommon"]
7
+ }
@@ -1,2 +1,2 @@
1
- import{jsx as a,jsxs as e}from"react/jsx-runtime";import{Picture as m}from"@anker-in/headless-ui";import{formatPrice as l}from"../../context/utils";import{useShopifyContext as i}from"@anker-in/shopify";const x=({item:t,copy:d})=>{const{locale:s}=i();return e("div",{className:"flex w-full items-center justify-center md:items-start md:justify-start",children:[a(m,{className:"mr-[16px] size-[100px] shrink-0 md:mr-[12px] md:hidden md:size-[44px] [&_img]:h-full [&_img]:w-auto [&_img]:object-contain",source:t.variant.image?.url||t.product?.images[0]?.url,alt:t.product.title}),e("div",{className:"md:flex md:flex-col",children:[e("div",{className:"md:flex md:items-center",children:[a(m,{className:"mr-[16px] size-[100px] shrink-0 md:mr-[12px] md:size-[44px] min-md:hidden [&_img]:h-full [&_img]:w-auto [&_img]:object-contain",source:t.variant.image?.url||t.product?.images[0]?.url,alt:t.product.title}),a("div",{className:"flex-1 text-[16px] font-bold leading-[1.4] min-l:!hidden",title:t.product.title,children:t.product.title})]}),e("div",{className:"mt-[16px] md:mt-[12px]",children:[a("div",{className:"mb-[12px] line-clamp-1 text-[16px] font-bold l:!hidden",title:t.product.title,children:t.product.title}),e("div",{className:"flex font-semibold leading-[1.4] md:flex-col",children:[e("div",{className:"mr-[40px] text-[15px] font-bold text-[#777] md:mr-0 md:text-[12px]",children:[e("div",{className:"mb-[8px] flex items-center md:mb-[4px]",children:[e("span",{children:[d.redeemModal.product.variantLabel,": "]}),a("span",{className:"ml-1",children:t.variant.title||""})]}),e("div",{className:"mb-[8px] flex items-center md:mb-[4px]",children:[e("span",{children:[d.redeemModal.product.shippingFeeLabel,": "]}),a("span",{className:"ml-1",children:l({amount:0,currencyCode:t.product.price?.currencyCode,locale:s||"us"})})]})]}),e("div",{className:"text-[15px] font-bold text-[#777] md:text-[12px]",children:[e("div",{className:"mb-[8px] flex items-center md:mb-[4px]",children:[e("span",{children:[d.redeemModal.product.quantityLabel,": "]}),a("span",{className:"ml-1",children:"1"})]}),e("div",{className:"l:flex l:items-center l:justify-between",children:[e("span",{children:[d.redeemModal.product.totalPriceLabel,": "]}),e("span",{className:"ml-1",children:[t.alpc?.consumeCredits," ",d?.pointUnit]})]})]})]})]})]})]})};export{x as ProductInfo};
1
+ import{jsx as a,jsxs as e}from"react/jsx-runtime";import{Picture as d,Text as i}from"@anker-in/headless-ui";import{formatPrice as r}from"../../context/utils";import{useHeadlessContext as o}from"@anker-in/lib";import{useCreditsContext as p}from"../../context/provider";const b=({item:t,copy:m})=>{const{locale:s}=o(),{pageCommon:l}=p();return e("div",{className:"flex w-full items-center justify-center md:items-start md:justify-start",children:[a(d,{className:"mr-[16px] size-[100px] shrink-0 md:mr-[12px] md:hidden md:size-[44px] [&_img]:h-full [&_img]:w-auto [&_img]:object-contain",source:t.variant.image?.url||t.product?.images[0]?.url,alt:t.product.title}),e("div",{className:"md:flex md:flex-col",children:[e("div",{className:"md:flex md:items-center",children:[a(d,{className:"mr-[16px] size-[100px] shrink-0 md:mr-[12px] md:size-[44px] min-md:hidden [&_img]:h-full [&_img]:w-auto [&_img]:object-contain",source:t.variant.image?.url||t.product?.images[0]?.url,alt:t.product.title}),a("div",{className:"flex-1 text-[16px] font-bold leading-[1.4] min-l:!hidden",title:t.product.title,children:t.product.title})]}),e("div",{className:"mt-[16px] md:mt-[12px]",children:[a(i,{className:"mb-[12px] line-clamp-1 text-[16px] font-bold l:!hidden",html:t.product.title,title:t.product.title}),e("div",{className:"flex font-semibold leading-[1.4] md:flex-col",children:[e("div",{className:"mr-[40px] text-[15px] font-bold text-[#777] md:mr-0 md:text-[12px]",children:[e("div",{className:"mb-[8px] flex items-center md:mb-[4px]",children:[e("span",{children:[m.redeemModal.product.variantLabel,": "]}),a("span",{className:"ml-1",children:t.variant.title||""})]}),e("div",{className:"mb-[8px] flex items-center md:mb-[4px]",children:[e("span",{children:[m.redeemModal.product.shippingFeeLabel,": "]}),a("span",{className:"ml-1",children:r({amount:0,currencyCode:t.product.price?.currencyCode,locale:s||"us"})})]})]}),e("div",{className:"text-[15px] font-bold text-[#777] md:text-[12px]",children:[e("div",{className:"mb-[8px] flex items-center md:mb-[4px]",children:[e("span",{children:[m.redeemModal.product.quantityLabel,": "]}),a("span",{className:"ml-1",children:"1"})]}),e("div",{className:"l:flex l:items-center l:justify-between",children:[e("span",{children:[m.redeemModal.product.totalPriceLabel,": "]}),e("span",{className:"ml-1",children:[t.alpc?.consumeCredits," ",l?.pointUnit]})]})]})]})]})]})]})};export{b as ProductInfo};
2
2
  //# sourceMappingURL=ProductInfo.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.tsx"],
4
- "sourcesContent": ["import { Picture } from '@anker-in/headless-ui'\nimport { formatPrice } from '../../context/utils'\nimport type { RedeemableItem as RedeemableItemType } from '../../type'\nimport { CreditsRedeemListCopy } from '../type'\nimport { useShopifyContext } from '@anker-in/shopify'\n\ntype ProductInfoProps = {\n item: RedeemableItemType\n copy: CreditsRedeemListCopy\n}\n\nexport const ProductInfo = ({ item, copy }: ProductInfoProps) => {\n const { locale } = useShopifyContext()\n\n return (\n <div className=\"flex w-full items-center justify-center md:items-start md:justify-start\">\n <Picture\n className=\"mr-[16px] size-[100px] shrink-0 md:mr-[12px] md:hidden md:size-[44px] [&_img]:h-full [&_img]:w-auto [&_img]:object-contain\"\n source={item.variant.image?.url || item.product?.images[0]?.url}\n alt={item.product.title}\n ></Picture>\n <div className=\"md:flex md:flex-col\">\n <div className=\"md:flex md:items-center\">\n <Picture\n className=\"mr-[16px] size-[100px] shrink-0 md:mr-[12px] md:size-[44px] min-md:hidden [&_img]:h-full [&_img]:w-auto [&_img]:object-contain\"\n source={item.variant.image?.url || item.product?.images[0]?.url}\n alt={item.product.title}\n ></Picture>\n <div className=\"flex-1 text-[16px] font-bold leading-[1.4] min-l:!hidden\" title={item.product.title}>\n {item.product.title}\n </div>\n </div>\n\n <div className=\"mt-[16px] md:mt-[12px]\">\n <div className=\"mb-[12px] line-clamp-1 text-[16px] font-bold l:!hidden\" title={item.product.title}>\n {item.product.title}\n </div>\n <div className=\"flex font-semibold leading-[1.4] md:flex-col\">\n <div className=\"mr-[40px] text-[15px] font-bold text-[#777] md:mr-0 md:text-[12px]\">\n <div className=\"mb-[8px] flex items-center md:mb-[4px]\">\n <span>{copy.redeemModal.product.variantLabel}: </span>\n <span className=\"ml-1\">{item.variant.title || ''}</span>\n </div>\n <div className=\"mb-[8px] flex items-center md:mb-[4px]\">\n <span>{copy.redeemModal.product.shippingFeeLabel}: </span>\n <span className=\"ml-1\">\n {formatPrice({\n amount: 0,\n currencyCode: item.product.price?.currencyCode!,\n locale: locale || 'us',\n })}\n </span>\n </div>\n </div>\n <div className=\"text-[15px] font-bold text-[#777] md:text-[12px]\">\n <div className=\"mb-[8px] flex items-center md:mb-[4px]\">\n <span>{copy.redeemModal.product.quantityLabel}: </span>\n <span className=\"ml-1\">1</span>\n </div>\n <div className=\"l:flex l:items-center l:justify-between\">\n <span>{copy.redeemModal.product.totalPriceLabel}: </span>\n <span className=\"ml-1\">\n {item.alpc?.consumeCredits} {copy?.pointUnit}\n </span>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n )\n}\n"],
5
- "mappings": "AAgBM,cAAAA,EAME,QAAAC,MANF,oBAhBN,OAAS,WAAAC,MAAe,wBACxB,OAAS,eAAAC,MAAmB,sBAG5B,OAAS,qBAAAC,MAAyB,oBAO3B,MAAMC,EAAc,CAAC,CAAE,KAAAC,EAAM,KAAAC,CAAK,IAAwB,CAC/D,KAAM,CAAE,OAAAC,CAAO,EAAIJ,EAAkB,EAErC,OACEH,EAAC,OAAI,UAAU,0E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B,MAAE,EAClDN,EAAC,QAAK,UAAU,OACb,UAAAK,EAAK,MAAM,eAAe,IAAEC,GAAM,WACrC,GACF,GACF,GACF,GACF,GACF,GACF,CAEJ",
6
- "names": ["jsx", "jsxs", "Picture", "formatPrice", "useShopifyContext", "ProductInfo", "item", "copy", "locale"]
4
+ "sourcesContent": ["import { Picture, Text } from '@anker-in/headless-ui'\nimport { formatPrice } from '../../context/utils'\nimport type { RedeemableItem as RedeemableItemType } from '../../type'\nimport { CreditsRedeemListCopy } from '../type'\nimport { useHeadlessContext } from '@anker-in/lib'\nimport { useCreditsContext } from '../../context/provider'\n\ntype ProductInfoProps = {\n item: RedeemableItemType\n copy: CreditsRedeemListCopy\n}\n\nexport const ProductInfo = ({ item, copy }: ProductInfoProps) => {\n const { locale } = useHeadlessContext()\n const { pageCommon } = useCreditsContext()\n\n return (\n <div className=\"flex w-full items-center justify-center md:items-start md:justify-start\">\n <Picture\n className=\"mr-[16px] size-[100px] shrink-0 md:mr-[12px] md:hidden md:size-[44px] [&_img]:h-full [&_img]:w-auto [&_img]:object-contain\"\n source={item.variant.image?.url || item.product?.images[0]?.url}\n alt={item.product.title}\n ></Picture>\n <div className=\"md:flex md:flex-col\">\n <div className=\"md:flex md:items-center\">\n <Picture\n className=\"mr-[16px] size-[100px] shrink-0 md:mr-[12px] md:size-[44px] min-md:hidden [&_img]:h-full [&_img]:w-auto [&_img]:object-contain\"\n source={item.variant.image?.url || item.product?.images[0]?.url}\n alt={item.product.title}\n ></Picture>\n <div className=\"flex-1 text-[16px] font-bold leading-[1.4] min-l:!hidden\" title={item.product.title}>\n {item.product.title}\n </div>\n </div>\n\n <div className=\"mt-[16px] md:mt-[12px]\">\n <Text\n className=\"mb-[12px] line-clamp-1 text-[16px] font-bold l:!hidden\"\n html={item.product.title}\n title={item.product.title}\n ></Text>\n <div className=\"flex font-semibold leading-[1.4] md:flex-col\">\n <div className=\"mr-[40px] text-[15px] font-bold text-[#777] md:mr-0 md:text-[12px]\">\n <div className=\"mb-[8px] flex items-center md:mb-[4px]\">\n <span>{copy.redeemModal.product.variantLabel}: </span>\n <span className=\"ml-1\">{item.variant.title || ''}</span>\n </div>\n <div className=\"mb-[8px] flex items-center md:mb-[4px]\">\n <span>{copy.redeemModal.product.shippingFeeLabel}: </span>\n <span className=\"ml-1\">\n {formatPrice({\n amount: 0,\n currencyCode: item.product.price?.currencyCode!,\n locale: locale || 'us',\n })}\n </span>\n </div>\n </div>\n <div className=\"text-[15px] font-bold text-[#777] md:text-[12px]\">\n <div className=\"mb-[8px] flex items-center md:mb-[4px]\">\n <span>{copy.redeemModal.product.quantityLabel}: </span>\n <span className=\"ml-1\">1</span>\n </div>\n <div className=\"l:flex l:items-center l:justify-between\">\n <span>{copy.redeemModal.product.totalPriceLabel}: </span>\n <span className=\"ml-1\">\n {item.alpc?.consumeCredits} {pageCommon?.pointUnit}\n </span>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n )\n}\n"],
5
+ "mappings": "AAkBM,cAAAA,EAME,QAAAC,MANF,oBAlBN,OAAS,WAAAC,EAAS,QAAAC,MAAY,wBAC9B,OAAS,eAAAC,MAAmB,sBAG5B,OAAS,sBAAAC,MAA0B,gBACnC,OAAS,qBAAAC,MAAyB,yBAO3B,MAAMC,EAAc,CAAC,CAAE,KAAAC,EAAM,KAAAC,CAAK,IAAwB,CAC/D,KAAM,CAAE,OAAAC,CAAO,EAAIL,EAAmB,EAChC,CAAE,WAAAM,CAAW,EAAIL,EAAkB,EAEzC,OACEL,EAAC,OAAI,UAAU,0EACb,UAAAD,EAACE,EAAA,CACC,UAAU,6HACV,OAAQM,EAAK,QAAQ,OAAO,KAAOA,EAAK,SAAS,OAAO,CAAC,GAAG,IAC5D,IAAKA,EAAK,QAAQ,MACnB,EACDP,EAAC,OAAI,UAAU,sBACb,UAAAA,EAAC,OAAI,UAAU,0BACb,UAAAD,EAACE,EAAA,CACC,UAAU,iIACV,OAAQM,EAAK,QAAQ,OAAO,KAAOA,EAAK,SAAS,OAAO,CAAC,GAAG,IAC5D,IAAKA,EAAK,QAAQ,MACnB,EACDR,EAAC,OAAI,UAAU,2DAA2D,MAAOQ,EAAK,QAAQ,MAC3F,SAAAA,EAAK,QAAQ,MAChB,GACF,EAEAP,EAAC,OAAI,UAAU,yBACb,UAAAD,EAACG,EAAA,CACC,UAAU,yDACV,KAAMK,EAAK,QAAQ,MACnB,MAAOA,EAAK,QAAQ,MACrB,EACDP,EAAC,OAAI,UAAU,+CACb,UAAAA,EAAC,OAAI,UAAU,qEACb,UAAAA,EAAC,OAAI,UAAU,yCACb,UAAAA,EAAC,QAAM,UAAAQ,EAAK,YAAY,QAAQ,aAAa,MAAE,EAC/CT,EAAC,QAAK,UAAU,OAAQ,SAAAQ,EAAK,QAAQ,OAAS,GAAG,GACnD,EACAP,EAAC,OAAI,UAAU,yCACb,UAAAA,EAAC,QAAM,UAAAQ,EAAK,YAAY,QAAQ,iBAAiB,MAAE,EACnDT,EAAC,QAAK,UAAU,OACb,SAAAI,EAAY,CACX,OAAQ,EACR,aAAcI,EAAK,QAAQ,OAAO,aAClC,OAAQE,GAAU,IACpB,CAAC,EACH,GACF,GACF,EACAT,EAAC,OAAI,UAAU,mDACb,UAAAA,EAAC,OAAI,UAAU,yCACb,UAAAA,EAAC,QAAM,UAAAQ,EAAK,YAAY,QAAQ,cAAc,MAAE,EAChDT,EAAC,QAAK,UAAU,OAAO,aAAC,GAC1B,EACAC,EAAC,OAAI,UAAU,0CACb,UAAAA,EAAC,QAAM,UAAAQ,EAAK,YAAY,QAAQ,gBAAgB,MAAE,EAClDR,EAAC,QAAK,UAAU,OACb,UAAAO,EAAK,MAAM,eAAe,IAAEG,GAAY,WAC3C,GACF,GACF,GACF,GACF,GACF,GACF,CAEJ",
6
+ "names": ["jsx", "jsxs", "Picture", "Text", "formatPrice", "useHeadlessContext", "useCreditsContext", "ProductInfo", "item", "copy", "locale", "pageCommon"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{jsx as e,jsxs as u}from"react/jsx-runtime";import{Button as x,Text as o}from"@anker-in/headless-ui";import n from"classnames";import{ProductInfo as c}from"./ProductInfo";const N=({copy:t,shippingProduct:m,loading:d,address:s,disabled:p,onClose:a,item:l})=>e("div",{className:n("max-h-[500px] overflow-y-auto px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]"),children:u("div",{className:"flex flex-col items-center",children:[e("div",{className:"mb-[16px] grid grid-flow-row gap-y-[4px] md:mb-[12px]",children:t.redeemModal.product.successDesc.map((r,i)=>e(o,{className:"text-[18px] font-bold leading-[1.4] md:text-[14px]",html:r},i))}),m&&e(o,{className:"mb-5 text-[16px] font-bold",html:m}),e("div",{className:"flex w-full items-center rounded-[16px] bg-[#F5F5F7] p-[16px]",children:e(c,{item:l,copy:t})}),e(x,{loading:d||!s,variant:"primary",className:"mx-auto mt-[16px] w-[444px] md:mt-[12px] md:w-full",onClick:a,disabled:p,children:t.redeemModal.product.paymentButton})]})});export{N as Success};
1
+ import{jsx as e,jsxs as v}from"react/jsx-runtime";import{Button as u,Text as m}from"@anker-in/headless-ui";import d from"classnames";import{ProductInfo as f}from"./ProductInfo";import{useHeadlessContext as b,ROUNDED_BRANDS as y}from"@anker-in/lib";const h=({copy:t,shippingProduct:o,loading:s,address:a,disabled:p,onClose:r,item:l})=>{const{brand:i}=b(),n=y.includes(i);return e("div",{className:d("max-h-[500px] overflow-y-auto px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]"),children:v("div",{className:"flex flex-col items-center",children:[e("div",{className:"mb-[16px] grid grid-flow-row gap-y-[4px] md:mb-[12px]",children:t.redeemModal.product.successDesc.map((x,c)=>e(m,{className:"text-[18px] font-bold leading-[1.4] md:text-[14px]",html:x},c))}),o&&e(m,{className:"mb-5 text-[16px] font-bold",html:o}),e("div",{className:d("flex w-full items-center bg-[#F5F5F7] p-[16px]",!n&&"rounded-none"),children:e(f,{item:l,copy:t})}),e(u,{loading:s||!a,variant:"primary",className:"mx-auto mt-[16px] w-[444px] md:mt-[12px] md:w-full",onClick:r,disabled:p,children:t.redeemModal.product.paymentButton})]})})};export{h as Success};
2
2
  //# sourceMappingURL=Success.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/components/credits/creditsRedeemList/RedeemProductModal/Success.tsx"],
4
- "sourcesContent": ["import { Button, Text } from '@anker-in/headless-ui'\nimport classNames from 'classnames'\nimport type { RedeemableItem as RedeemableItemType } from '../../type'\nimport { CreditsRedeemListCopy } from '../type'\nimport { ProductInfo } from './ProductInfo'\n\ntype SuccessProps = {\n copy: CreditsRedeemListCopy\n shippingProduct: string\n loading: boolean\n address: Record<string, any> | undefined\n disabled: boolean\n onClose: () => void\n item: RedeemableItemType\n}\n\nexport const Success = ({ copy, shippingProduct, loading, address, disabled, onClose, item }: SuccessProps) => {\n return (\n <div className={classNames('max-h-[500px] overflow-y-auto px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]')}>\n <div className=\"flex flex-col items-center\">\n <div className=\"mb-[16px] grid grid-flow-row gap-y-[4px] md:mb-[12px]\">\n {copy.redeemModal.product.successDesc.map((description: string, index: number) => (\n <Text key={index} className=\"text-[18px] font-bold leading-[1.4] md:text-[14px]\" html={description}></Text>\n ))}\n </div>\n\n {shippingProduct && <Text className=\"mb-5 text-[16px] font-bold\" html={shippingProduct}></Text>}\n\n <div className=\"flex w-full items-center rounded-[16px] bg-[#F5F5F7] p-[16px]\">\n <ProductInfo item={item} copy={copy} />\n </div>\n\n <Button\n loading={loading || !address}\n variant=\"primary\"\n className=\"mx-auto mt-[16px] w-[444px] md:mt-[12px] md:w-full\"\n onClick={onClose}\n disabled={disabled}\n >\n {copy.redeemModal.product.paymentButton}\n </Button>\n </div>\n </div>\n )\n}\n"],
5
- "mappings": "AAmBM,OAGM,OAAAA,EAHN,QAAAC,MAAA,oBAnBN,OAAS,UAAAC,EAAQ,QAAAC,MAAY,wBAC7B,OAAOC,MAAgB,aAGvB,OAAS,eAAAC,MAAmB,gBAYrB,MAAMC,EAAU,CAAC,CAAE,KAAAC,EAAM,gBAAAC,EAAiB,QAAAC,EAAS,QAAAC,EAAS,SAAAC,EAAU,QAAAC,EAAS,KAAAC,CAAK,IAEvFb,EAAC,OAAI,UAAWI,EAAW,iFAAiF,EAC1G,SAAAH,EAAC,OAAI,UAAU,6BACb,UAAAD,EAAC,OAAI,UAAU,wDACZ,SAAAO,EAAK,YAAY,QAAQ,YAAY,IAAI,CAACO,EAAqBC,IAC9Df,EAACG,EAAA,CAAiB,UAAU,qDAAqD,KAAMW,GAA5EC,CAAyF,CACrG,EACH,EAECP,GAAmBR,EAACG,EAAA,CAAK,UAAU,6BAA6B,KAAMK,EAAiB,EAExFR,EAAC,OAAI,UAAU,gEACb,SAAAA,EAACK,EAAA,CAAY,KAAMQ,EAAM,KAAMN,EAAM,EACvC,EAEAP,EAACE,EAAA,CACC,QAASO,GAAW,CAACC,EACrB,QAAQ,UACR,UAAU,qDACV,QAASE,EACT,SAAUD,EAET,SAAAJ,EAAK,YAAY,QAAQ,cAC5B,GACF,EACF",
6
- "names": ["jsx", "jsxs", "Button", "Text", "classNames", "ProductInfo", "Success", "copy", "shippingProduct", "loading", "address", "disabled", "onClose", "item", "description", "index"]
4
+ "sourcesContent": ["import { Button, Text } from '@anker-in/headless-ui'\nimport classNames from 'classnames'\nimport type { RedeemableItem as RedeemableItemType } from '../../type'\nimport { CreditsRedeemListCopy } from '../type'\nimport { ProductInfo } from './ProductInfo'\nimport { useHeadlessContext, ROUNDED_BRANDS } from '@anker-in/lib'\n\ntype SuccessProps = {\n copy: CreditsRedeemListCopy\n shippingProduct: string\n loading: boolean\n address: Record<string, any> | undefined\n disabled: boolean\n onClose: () => void\n item: RedeemableItemType\n}\n\nexport const Success = ({ copy, shippingProduct, loading, address, disabled, onClose, item }: SuccessProps) => {\n const { brand } = useHeadlessContext()\n const rounded = ROUNDED_BRANDS.includes(brand)\n return (\n <div className={classNames('max-h-[500px] overflow-y-auto px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]')}>\n <div className=\"flex flex-col items-center\">\n <div className=\"mb-[16px] grid grid-flow-row gap-y-[4px] md:mb-[12px]\">\n {copy.redeemModal.product.successDesc.map((description: string, index: number) => (\n <Text key={index} className=\"text-[18px] font-bold leading-[1.4] md:text-[14px]\" html={description}></Text>\n ))}\n </div>\n\n {shippingProduct && <Text className=\"mb-5 text-[16px] font-bold\" html={shippingProduct}></Text>}\n\n <div className={classNames('flex w-full items-center bg-[#F5F5F7] p-[16px]', !rounded && 'rounded-none')}>\n <ProductInfo item={item} copy={copy} />\n </div>\n\n <Button\n loading={loading || !address}\n variant=\"primary\"\n className=\"mx-auto mt-[16px] w-[444px] md:mt-[12px] md:w-full\"\n onClick={onClose}\n disabled={disabled}\n >\n {copy.redeemModal.product.paymentButton}\n </Button>\n </div>\n </div>\n )\n}\n"],
5
+ "mappings": "AAsBM,OAGM,OAAAA,EAHN,QAAAC,MAAA,oBAtBN,OAAS,UAAAC,EAAQ,QAAAC,MAAY,wBAC7B,OAAOC,MAAgB,aAGvB,OAAS,eAAAC,MAAmB,gBAC5B,OAAS,sBAAAC,EAAoB,kBAAAC,MAAsB,gBAY5C,MAAMC,EAAU,CAAC,CAAE,KAAAC,EAAM,gBAAAC,EAAiB,QAAAC,EAAS,QAAAC,EAAS,SAAAC,EAAU,QAAAC,EAAS,KAAAC,CAAK,IAAoB,CAC7G,KAAM,CAAE,MAAAC,CAAM,EAAIV,EAAmB,EAC/BW,EAAUV,EAAe,SAASS,CAAK,EAC7C,OACEhB,EAAC,OAAI,UAAWI,EAAW,iFAAiF,EAC1G,SAAAH,EAAC,OAAI,UAAU,6BACb,UAAAD,EAAC,OAAI,UAAU,wDACZ,SAAAS,EAAK,YAAY,QAAQ,YAAY,IAAI,CAACS,EAAqBC,IAC9DnB,EAACG,EAAA,CAAiB,UAAU,qDAAqD,KAAMe,GAA5EC,CAAyF,CACrG,EACH,EAECT,GAAmBV,EAACG,EAAA,CAAK,UAAU,6BAA6B,KAAMO,EAAiB,EAExFV,EAAC,OAAI,UAAWI,EAAW,iDAAkD,CAACa,GAAW,cAAc,EACrG,SAAAjB,EAACK,EAAA,CAAY,KAAMU,EAAM,KAAMN,EAAM,EACvC,EAEAT,EAACE,EAAA,CACC,QAASS,GAAW,CAACC,EACrB,QAAQ,UACR,UAAU,qDACV,QAASE,EACT,SAAUD,EAET,SAAAJ,EAAK,YAAY,QAAQ,cAC5B,GACF,EACF,CAEJ",
6
+ "names": ["jsx", "jsxs", "Button", "Text", "classNames", "ProductInfo", "useHeadlessContext", "ROUNDED_BRANDS", "Success", "copy", "shippingProduct", "loading", "address", "disabled", "onClose", "item", "brand", "rounded", "description", "index"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{jsx as u,jsxs as X}from"react/jsx-runtime";import R from"classnames";import{useCallback as w,useEffect as F,useMemo as K,useState as l}from"react";import{useCreditsContext as _}from"../../context/provider";import k from"../../context/hooks/useCountries";import{AlpcErrorCode as c}from"../../context/const";import{useAddressValidate as T}from"../../context/hooks/useAddressValidate";import{useRedeemProduct as B}from"../../context/hooks/useRedeemProduct";import{CreditsModalContainer as G}from"../../modal/modalContainer";import{useShopifyContext as J}from"@anker-in/shopify";import{Error as V}from"./Error";import{Success as z}from"./Success";import{Address as H}from"./Address";import{Init as Q}from"./Init";function W({item:s,copy:e,onError:h,...m}){const{fetchCreditInfo:E,profile:I}=_(),{storeDomain:A,locale:N}=J(),{validatorInfo:S}=e,{shippingAddress:y,shippingProduct:v}=e.redeemModal.product,[d,i]=l("init"),[t,L]=l(),[x,n]=l({code:0,message:"",imageUrl:""}),[f,a]=l(!1),{countries:b=[],isLoading:Y}=k({shopifyStoreDomain:A}),{isMutating:p,trigger:P}=B({onSuccess(r){if(!r){i("error"),n({code:0,imageUrl:e.redeemModal.errorImageUrl||"",message:e.redeemModal.commonError||""});return}if(r?.code===0)E(I?.user_id),i("success");else{let o,M;r.code===c.CodeLpcShopifyCouponRuleRedeemLimit?(o=e.redeemModal.redeemLimitError,a(!0)):r.code===c.CodeLpcRuleInventoryNotEnough?(o=e.redeemModal.inventoryNotEnough,a(!0),M=e.redeemModal.inventoryNotEnough):r.code===c.CodeLpcNotEnoughCredits?(o=e.redeemModal.creditsNotEnough,a(!0),E(I?.user_id)):r.code===c.CodeCrossSiteError&&(o=e.redeemModal.crossSiteError,a(!0)),i("error"),n({code:r.code,imageUrl:M||e.redeemModal.errorImageUrl||"",message:o||e.redeemModal.commonError||""}),h&&h(r.code)}},onError(r){i("error"),n({code:0,imageUrl:e.redeemModal.errorImageUrl||"",message:e.redeemModal.commonError||""})}}),g=K(()=>e?.redeemModal.product.form?.flat().find(o=>o.type==="state")?.key,[e?.redeemModal.product.form]),{validate:C,errors:U}=T({address:t,validatorInfo:S,formData:e?.redeemModal.product.form?.flat()||[],errorLabel:{require:e.redeemModal.product.required,email:e.redeemModal.product.invalidEmail}}),O=w(async()=>{const r=[];if(g&&((b.find(q=>q.code===t.country)?.provinces||[]).length||r.push(g)),C({force:!0,ignoreKeys:r}))return;console.log("address",t);let o={...t};o.name&&delete o.name,o.country==="UK"&&(o.country="GB"),P({address:btoa(JSON.stringify(o)),rule_id:Number(s.alpc?.id)})},[s,P,g,C,t,b]);return F(()=>{m.isOpen||(a(!1),n({code:0,message:"",imageUrl:""}))},[m.isOpen,N]),X(G,{...m,className:R("w-[540px] md:h-auto min-md:max-h-[calc(100vh-40px)]",d!=="init"&&"w-[740px] md:w-full"),scrollClassName:"mb-0 min-l:px-0 md:mb-0 px-0",titleClassName:R("h-[56px]",d==="init"&&"bg-[#F5F5F7]"),title:d==="address"?"Order Confirmation":"",children:[d==="error"&&u(V,{errorInfo:x}),d==="success"&&u(z,{copy:e,shippingProduct:v,loading:p,address:t,disabled:f,onClose:m.onClose,item:s}),d==="address"&&u(H,{copy:e,shippingAddress:y,setAddress:L,validateAddress:C,validateErrors:U,shippingProduct:v,loading:p,address:t,disabled:f,handlePayment:O,item:s}),d==="init"&&u(Q,{item:s,copy:e,loading:p,disabled:f,setStatus:i})]})}var ce=W;export{ce as default};
1
+ import{jsx as u,jsxs as X}from"react/jsx-runtime";import R from"classnames";import{useCallback as F,useEffect as K,useMemo as _,useState as l}from"react";import{useCreditsContext as A}from"../../context/provider";import k from"../../context/hooks/useCountries";import{AlpcErrorCode as c}from"../../context/const";import{useAddressValidate as T}from"../../context/hooks/useAddressValidate";import{useRedeemProduct as B}from"../../context/hooks/useRedeemProduct";import{CreditsModalContainer as G}from"../../modal/modalContainer";import{useHeadlessContext as H}from"@anker-in/lib";import{Error as J}from"./Error";import{Success as V}from"./Success";import{Address as z}from"./Address";import{Init as Q}from"./Init";function W({item:s,copy:e,onError:h,...m}){const{fetchCreditInfo:E,profile:I}=A(),{storeDomain:N,locale:y}=H(),{pageCommon:L}=A(),{shippingAddress:S,shippingProduct:v}=e.redeemModal.product,[d,i]=l("init"),[t,x]=l(),[U,n]=l({code:0,message:"",imageUrl:""}),[f,a]=l(!1),{countries:b=[],isLoading:Y}=k({shopifyStoreDomain:N}),{isMutating:p,trigger:P}=B({onSuccess(r){if(!r){i("error"),n({code:0,imageUrl:e.redeemModal.errorImageUrl||"",message:e.redeemModal.commonError||""});return}if(r?.code===0)E(I?.user_id),i("success");else{let o,M;r.code===c.CodeLpcShopifyCouponRuleRedeemLimit?(o=e.redeemModal.redeemLimitError,a(!0)):r.code===c.CodeLpcRuleInventoryNotEnough?(o=e.redeemModal.inventoryNotEnough,a(!0),M=e.redeemModal.inventoryNotEnough):r.code===c.CodeLpcNotEnoughCredits?(o=e.redeemModal.creditsNotEnough,a(!0),E(I?.user_id)):r.code===c.CodeCrossSiteError&&(o=e.redeemModal.crossSiteError,a(!0)),i("error"),n({code:r.code,imageUrl:M||e.redeemModal.errorImageUrl||"",message:o||e.redeemModal.commonError||""}),h&&h(r.code)}},onError(r){i("error"),n({code:0,imageUrl:e.redeemModal.errorImageUrl||"",message:e.redeemModal.commonError||""})}}),g=_(()=>e?.redeemModal.product.form?.flat().find(o=>o.type==="state")?.key,[e?.redeemModal.product.form]),{validate:C,errors:O}=T({address:t,validatorInfo:L?.validatorInfo,formData:e?.redeemModal.product.form?.flat()||[],errorLabel:{require:e.redeemModal.product.required,email:e.redeemModal.product.invalidEmail}}),q=F(async()=>{const r=[];if(g&&((b.find(w=>w.code===t.country)?.provinces||[]).length||r.push(g)),C({force:!0,ignoreKeys:r}))return;let o={...t};o.name&&delete o.name,o.country==="UK"&&(o.country="GB"),P({address:btoa(JSON.stringify(o)),rule_id:Number(s.alpc?.id)})},[s,P,g,C,t,b]);return K(()=>{m.isOpen||(a(!1),n({code:0,message:"",imageUrl:""}))},[m.isOpen,y]),X(G,{...m,className:R("w-[540px] md:h-auto min-md:max-h-[calc(100vh-40px)]",d!=="init"&&"w-[740px] md:w-full"),scrollClassName:"mb-0 min-l:px-0 md:mb-0 px-0",titleClassName:R("h-[56px]",d==="init"&&"bg-[#F5F5F7]"),title:d==="address"?"Order Confirmation":"",children:[d==="error"&&u(J,{errorInfo:U}),d==="success"&&u(V,{copy:e,shippingProduct:v,loading:p,address:t,disabled:f,onClose:m.onClose,item:s}),d==="address"&&u(z,{copy:e,shippingAddress:S,setAddress:x,validateAddress:C,validateErrors:O,shippingProduct:v,loading:p,address:t,disabled:f,handlePayment:q,item:s}),d==="init"&&u(Q,{item:s,copy:e,loading:p,disabled:f,setStatus:i})]})}var ce=W;export{ce as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/components/credits/creditsRedeemList/RedeemProductModal/index.tsx"],
4
- "sourcesContent": ["import classNames from 'classnames'\nimport { useCallback, useEffect, useMemo, useState } from 'react'\nimport { useCreditsContext } from '../../context/provider'\nimport useCountries from '../../context/hooks/useCountries'\nimport { AlpcErrorCode } from '../../context/const'\nimport { useAddressValidate } from '../../context/hooks/useAddressValidate'\nimport { useRedeemProduct } from '../../context/hooks/useRedeemProduct'\nimport type { ModalContainerProps } from '../../modal/modalContainer'\nimport { CreditsModalContainer } from '../../modal/modalContainer'\nimport type { RedeemableItem as RedeemableItemType } from '../../type'\nimport { useShopifyContext } from '@anker-in/shopify'\nimport { CreditsRedeemListCopy } from '../type'\nimport { Error } from './Error'\nimport { Success } from './Success'\nimport { Address } from './Address'\nimport { Init } from './Init'\n\ntype RedeemProductModalProps = ModalContainerProps & {\n item: RedeemableItemType\n copy: CreditsRedeemListCopy\n onError: (code: AlpcErrorCode) => void\n}\n\nfunction RedeemProductModal({ item, copy, onError, ...props }: RedeemProductModalProps) {\n const { fetchCreditInfo, profile } = useCreditsContext()\n const { storeDomain, locale } = useShopifyContext()\n\n const { validatorInfo } = copy\n const { shippingAddress, shippingProduct } = copy.redeemModal.product\n\n const [status, setStatus] = useState<'init' | 'address' | 'success' | 'error'>('init')\n const [address, setAddress] = useState<any>()\n const [errorInfo, setErrorInfo] = useState({\n code: 0,\n message: '',\n imageUrl: '',\n })\n const [disabled, setDisabled] = useState(false)\n\n const { countries = [], isLoading: countriesLoading } = useCountries({ shopifyStoreDomain: storeDomain })\n\n const { isMutating: loading, trigger } = useRedeemProduct({\n onSuccess(responseData) {\n if (!responseData) {\n setStatus('error')\n setErrorInfo({\n code: 0,\n imageUrl: copy.redeemModal.errorImageUrl || '',\n message: copy.redeemModal.commonError || '',\n })\n return\n }\n\n if (responseData?.code === 0) {\n fetchCreditInfo(profile?.user_id)\n setStatus('success')\n } else {\n let errorMsg\n let errorImage\n if (responseData.code === AlpcErrorCode.CodeLpcShopifyCouponRuleRedeemLimit) {\n errorMsg = copy.redeemModal.redeemLimitError\n setDisabled(true)\n } else if (responseData.code === AlpcErrorCode.CodeLpcRuleInventoryNotEnough) {\n errorMsg = copy.redeemModal.inventoryNotEnough\n setDisabled(true)\n errorImage = copy.redeemModal.inventoryNotEnough\n } else if (responseData.code === AlpcErrorCode.CodeLpcNotEnoughCredits) {\n errorMsg = copy.redeemModal.creditsNotEnough\n setDisabled(true)\n fetchCreditInfo(profile?.user_id)\n } else if (responseData.code === AlpcErrorCode.CodeCrossSiteError) {\n errorMsg = copy.redeemModal.crossSiteError\n setDisabled(true)\n }\n\n setStatus('error')\n setErrorInfo({\n code: responseData.code,\n imageUrl: errorImage || copy.redeemModal.errorImageUrl || '',\n message: errorMsg || copy.redeemModal.commonError || '',\n })\n onError && onError(responseData.code)\n }\n },\n onError(error) {\n setStatus('error')\n setErrorInfo({\n code: 0,\n imageUrl: copy.redeemModal.errorImageUrl || '',\n message: copy.redeemModal.commonError || '',\n })\n },\n })\n\n const stateInputKey = useMemo(() => {\n const stateInput = copy?.redeemModal.product.form?.flat().find(item => item.type === 'state')\n return stateInput?.key\n }, [copy?.redeemModal.product.form])\n\n const { validate: validateAddress, errors: validateErrors } = useAddressValidate({\n address: address,\n validatorInfo: validatorInfo,\n formData: copy?.redeemModal.product.form?.flat() || [],\n errorLabel: {\n require: copy.redeemModal.product.required,\n email: copy.redeemModal.product.invalidEmail,\n },\n })\n\n const handlePayment = useCallback(async () => {\n const ignoreKeys: string[] = []\n\n if (stateInputKey) {\n const provinces = countries.find(item => item.code === address.country)?.provinces || []\n\n if (!provinces.length) {\n ignoreKeys.push(stateInputKey as never)\n }\n }\n\n if (\n validateAddress({\n force: true,\n ignoreKeys,\n })\n ) {\n // \u5730\u5740\u6821\u9A8C\u9519\u8BEF\n return\n }\n console.log('address', address)\n let requestAddress = { ...address }\n if (requestAddress.name) {\n delete requestAddress.name\n }\n if (requestAddress.country === 'UK') {\n requestAddress.country = 'GB'\n }\n trigger({\n address: btoa(JSON.stringify(requestAddress)),\n rule_id: Number(item.alpc?.id),\n })\n }, [item, trigger, stateInputKey, validateAddress, address, countries])\n\n useEffect(() => {\n if (!props.isOpen) {\n setDisabled(false)\n setErrorInfo({ code: 0, message: '', imageUrl: '' })\n }\n }, [props.isOpen, locale])\n\n return (\n <CreditsModalContainer\n {...props}\n className={classNames(\n 'w-[540px] md:h-auto min-md:max-h-[calc(100vh-40px)]',\n status !== 'init' && 'w-[740px] md:w-full'\n )}\n scrollClassName=\"mb-0 min-l:px-0 md:mb-0 px-0\"\n titleClassName={classNames('h-[56px]', status === 'init' && 'bg-[#F5F5F7]')}\n title={status === 'address' ? 'Order Confirmation' : ''}\n >\n {status === 'error' && <Error errorInfo={errorInfo} />}\n {status === 'success' && (\n <Success\n copy={copy}\n shippingProduct={shippingProduct}\n loading={loading}\n address={address}\n disabled={disabled}\n onClose={props.onClose}\n item={item}\n />\n )}\n {status === 'address' && (\n <Address\n copy={copy}\n shippingAddress={shippingAddress}\n setAddress={setAddress}\n validateAddress={validateAddress}\n validateErrors={validateErrors}\n shippingProduct={shippingProduct}\n loading={loading}\n address={address}\n disabled={disabled}\n handlePayment={handlePayment}\n item={item}\n />\n )}\n {status === 'init' && (\n <Init item={item} copy={copy} loading={loading} disabled={disabled} setStatus={setStatus} />\n )}\n </CreditsModalContainer>\n )\n}\n\nexport default RedeemProductModal\n"],
5
- "mappings": "AAuJI,OAUyB,OAAAA,EAVzB,QAAAC,MAAA,oBAvJJ,OAAOC,MAAgB,aACvB,OAAS,eAAAC,EAAa,aAAAC,EAAW,WAAAC,EAAS,YAAAC,MAAgB,QAC1D,OAAS,qBAAAC,MAAyB,yBAClC,OAAOC,MAAkB,mCACzB,OAAS,iBAAAC,MAAqB,sBAC9B,OAAS,sBAAAC,MAA0B,yCACnC,OAAS,oBAAAC,MAAwB,uCAEjC,OAAS,yBAAAC,MAA6B,6BAEtC,OAAS,qBAAAC,MAAyB,oBAElC,OAAS,SAAAC,MAAa,UACtB,OAAS,WAAAC,MAAe,YACxB,OAAS,WAAAC,MAAe,YACxB,OAAS,QAAAC,MAAY,SAQrB,SAASC,EAAmB,CAAE,KAAAC,EAAM,KAAAC,EAAM,QAAAC,EAAS,GAAGC,CAAM,EAA4B,CACtF,KAAM,CAAE,gBAAAC,EAAiB,QAAAC,CAAQ,EAAIjB,EAAkB,EACjD,CAAE,YAAAkB,EAAa,OAAAC,CAAO,EAAIb,EAAkB,EAE5C,CAAE,c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CAAE,KAAM,EAAG,QAAS,GAAI,SAAU,EAAG,CAAC,EAEvD,EAAG,CAACb,EAAM,OAAQI,CAAM,CAAC,EAGvBzB,EAACW,EAAA,CACE,GAAGU,EACJ,UAAWpB,EACT,sDACA4B,IAAW,QAAU,qBACvB,EACA,gBAAgB,+BAChB,eAAgB5B,EAAW,WAAY4B,IAAW,QAAU,cAAc,EAC1E,MAAOA,IAAW,UAAY,qBAAuB,GAEpD,UAAAA,IAAW,SAAW9B,EAACc,EAAA,CAAM,UAAWoB,EAAW,EACnDJ,IAAW,WACV9B,EAACe,EAAA,CACC,KAAMK,EACN,gBAAiBS,EACjB,QAASW,EACT,QAASR,EACT,SAAUI,EACV,QAASd,EAAM,QACf,KAAMH,EACR,EAEDW,IAAW,WACV9B,EAACgB,EAAA,CACC,KAAMI,EACN,gBAAiBQ,EACjB,WAAYK,EACZ,gBAAiBc,EACjB,eAAgBC,EAChB,gBAAiBnB,EACjB,QAASW,EACT,QAASR,EACT,SAAUI,EACV,cAAea,EACf,KAAM9B,EACR,EAEDW,IAAW,QACV9B,EAACiB,EAAA,CAAK,KAAME,EAAM,KAAMC,EAAM,QAASoB,EAAS,SAAUJ,EAAU,UAAWL,EAAW,GAE9F,CAEJ,CAEA,IAAOqB,GAAQlC",
6
- "names": ["jsx", "jsxs", "classNames", "useCallback", "useEffect", "useMemo", "useState", "useCreditsContext", "useCountries", "AlpcErrorCode", "useAddressValidate", "useRedeemProduct", "CreditsModalContainer", "useShopifyContext", "Error", "Success", "Address", "Init", "RedeemProductModal", "item", "copy", "onError", "props", "fetchCreditInfo", "profile", "storeDomain", "locale", "validatorInfo", "shippingAddress", "shippingProduct", "status", "setStatus", "address", "setAddress", "errorInfo", "setErrorInfo", "disabled", "setDisabled", "countries", "countriesLoading", "loading", "trigger", "responseData", "errorMsg", "errorImage", "error", "stateInputKey", "validateAddress", "validateErrors", "handlePayment", "ignoreKeys", "requestAddress", "RedeemProductModal_default"]
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": "AAsJI,OAUyB,OAAAA,EAVzB,QAAAC,MAAA,oBAtJJ,OAAOC,MAAgB,aACvB,OAAS,eAAAC,EAAa,aAAAC,EAAW,WAAAC,EAAS,YAAAC,MAAgB,QAC1D,OAAS,qBAAAC,MAAyB,yBAClC,OAAOC,MAAkB,mCACzB,OAAS,iBAAAC,MAAqB,sBAC9B,OAAS,sBAAAC,MAA0B,yCACnC,OAAS,oBAAAC,MAAwB,uCAEjC,OAAS,yBAAAC,MAA6B,6BAEtC,OAAS,sBAAAC,MAA0B,gBAEnC,OAAS,SAAAC,MAAa,UACtB,OAAS,WAAAC,MAAe,YACxB,OAAS,WAAAC,MAAe,YACxB,OAAS,QA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K,UAAUU,CAAc,CAAC,EAC5C,QAAS,OAAOhC,EAAK,MAAM,EAAE,CAC/B,CAAC,CACH,EAAG,CAACA,EAAMsB,EAASK,EAAeC,EAAiBf,EAASM,CAAS,CAAC,EAEtE,OAAAlC,EAAU,IAAM,CACTkB,EAAM,SACTe,EAAY,EAAK,EACjBF,EAAa,CAAE,KAAM,EAAG,QAAS,GAAI,SAAU,EAAG,CAAC,EAEvD,EAAG,CAACb,EAAM,OAAQI,CAAM,CAAC,EAGvBzB,EAACW,EAAA,CACE,GAAGU,EACJ,UAAWpB,EACT,sDACA4B,IAAW,QAAU,qBACvB,EACA,gBAAgB,+BAChB,eAAgB5B,EAAW,WAAY4B,IAAW,QAAU,cAAc,EAC1E,MAAOA,IAAW,UAAY,qBAAuB,GAEpD,UAAAA,IAAW,SAAW9B,EAACc,EAAA,CAAM,UAAWoB,EAAW,EACnDJ,IAAW,WACV9B,EAACe,EAAA,CACC,KAAMK,EACN,gBAAiBS,EACjB,QAASW,EACT,QAASR,EACT,SAAUI,EACV,QAASd,EAAM,QACf,KAAMH,EACR,EAEDW,IAAW,WACV9B,EAACgB,EAAA,CACC,KAAMI,EACN,gBAAiBQ,EACjB,WAAYK,EACZ,gBAAiBc,EACjB,eAAgBC,EAChB,gBAAiBnB,EACjB,QAASW,EACT,QAASR,EACT,SAAUI,EACV,cAAea,EACf,KAAM9B,EACR,EAEDW,IAAW,QACV9B,EAACiB,EAAA,CAAK,KAAME,EAAM,KAAMC,EAAM,QAASoB,EAAS,SAAUJ,EAAU,UAAWL,EAAW,GAE9F,CAEJ,CAEA,IAAOqB,GAAQlC",
6
+ "names": ["jsx", "jsxs", "classNames", "useCallback", "useEffect", "useMemo", "useState", "useCreditsContext", "useCountries", "AlpcErrorCode", "useAddressValidate", "useRedeemProduct", "CreditsModalContainer", "useHeadlessContext", "Error", "Success", "Address", "Init", "RedeemProductModal", "item", "copy", "onError", "props", "fetchCreditInfo", "profile", "storeDomain", "locale", "pageCommon", "shippingAddress", "shippingProduct", "status", "setStatus", "address", "setAddress", "errorInfo", "setErrorInfo", "disabled", "setDisabled", "countries", "countriesLoading", "loading", "trigger", "responseData", "errorMsg", "errorImage", "error", "stateInputKey", "validateAddress", "validateErrors", "handlePayment", "ignoreKeys", "requestAddress", "RedeemProductModal_default"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{jsx as l,jsxs as a}from"react/jsx-runtime";import{Button as y,Text as n,Picture as p}from"@anker-in/headless-ui";import{useMemo as c}from"react";import s from"classnames";import{useCreditsContext as N}from"../context/provider";import{AlpcConsumeType as u,ConsumeType as f}from"../context/const";import{numberFormat as C}from"../context/utils";import{gaTrack as v}from"../../../helpers/track";function E({copy:t,className:g,item:e,onRulesOpen:b,onRedeem:h}){const{creditInfo:m,profile:i,gtm:{pageGroup:x}}=N(),o=Object.keys(i||{}).length>0,_=c(()=>!!(e.alpc?.remainingInventory<=0&&e.alpc?.isLimited||e.alpc?.consumeType===u.Product&&!e.variant?.availableForSale||o&&i?.activated&&e.alpc?.consumeCredits>Number(m?.available_credit||0)),[e.alpc?.remainingInventory,e.alpc?.isLimited,e.alpc?.consumeType,e.alpc?.consumeCredits,o,i?.activated,m?.available_credit,e.variant?.availableForSale]),d=c(()=>o?e.alpc?.consumeType===u.Product?e.variant?.availableForSale?t.btnRedeem:t?.soldOut||"Sold Out":t.btnRedeem:t.unlockRewards,[o,e.alpc?.consumeType,e.variant?.availableForSale,t.btnRedeem,t.unlockRewards,t?.soldOut]);return a("div",{className:s("flex flex-col items-center rounded-[16px] bg-[#EAEAEC] p-[24px] md:rounded-[12px] md:px-[8px] xl:py-[16px] md-xl:px-[16px]",g),children:[e.config?.type!==f.Product?a("div",{className:"relative mx-auto my-[30px] h-[164px] md:my-0 md:h-[66px] l-xxl:h-[138px] md-l:h-[80px]",children:[l(p,{source:t?.imageMapping[e.config?.type]?.url,className:"h-full [&_img]:h-full [&_img]:w-auto [&_img]:object-contain"}),l("div",{className:"absolute bottom-[8px] left-[16px] font-extrabold text-white md:bottom-[2px] md:left-[5px]",children:e.config?.value?a("div",{className:"flex items-end",children:[l(n,{className:"text-[64px] font-bold leading-none md:text-[20px] l-xxl:text-[40px] md-l:text-[22px]",html:e.config?.value}),l(n,{className:"ml-[4px] text-[24px] font-bold leading-[2] md:ml-[2px] l:text-[12px] xxl:leading-[1.4] l-xxl:text-[20px]",html:e.config?.type===f.GiftCard?t?.giftCardLabel:t?.off})]}):l(n,{size:3,html:e.config?.title||e.alpc?.title})})]}):l("div",{className:s("relative mx-auto h-[224px] w-fit md:my-[10px] l:h-[120px] l-xxl:h-[138px]"),children:l(p,{className:"h-full w-auto [&_img]:h-full [&_img]:object-contain",source:e.config?.image?.url||e.product.images?.[0]?.url})}),a("div",{className:s("mt-[22px] flex w-full flex-1 flex-col justify-between"),children:[l(n,{html:e.config?.title||e.alpc?.title,title:e.config?.title||e.alpc?.title,size:2,className:"text-[24px] font-bold leading-[1.2] l:text-[16px] l-xxl:text-[20px]"}),e.config?.rules?.length>0&&l("button",{type:"button",onClick:()=>{b(e.config?.rules||[]),v({event:"ga4Event",event_name:"lp_button",member_active_status:i?.activated?"active":"not active",event_parameters:{page_group:x,position:t.title,button_name:t?.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:r=>{(r.key==="Enter"||r.key===" ")&&r.preventDefault()},children:t?.ruleLabel}),a("div",{children:[a("div",{className:"mt-[24px] flex items-center l:mt-[12px] l-xl:mt-[16px]",children:[l(p,{className:"size-[20px]",source:"https://cdn.shopify.com/s/files/1/0511/6346/3874/files/icon_hire_purchase.png?v=1757496783"}),l(n,{html:`${C(e.alpc?.consumeCredits)}`,size:2,as:"p",className:"ml-[4px] text-[28px] font-bold leading-[1.2] md:text-[18px] l-xxl:text-[24px] md-l:text-[20px] "})]}),l(y,{disabled:_,variant:"primary",size:"lg",className:"mt-[8px] md:px-[8px] l:w-full",onClick:()=>{h(e),v({event:"ga4Event",event_name:"lp_button",member_active_status:i?.activated?"active":"not active",event_parameters:{page_group:x,position:t.title,button_name:d,info:e.alpc?.id?.toString()}})},children:d})]})]})]})}export{E as RedeemableItem};
1
+ import{jsx as t,jsxs as o}from"react/jsx-runtime";import{Button as C,Text as u,Picture as p}from"@anker-in/headless-ui";import{useMemo as x}from"react";import s from"classnames";import{useCreditsContext as R}from"../context/provider";import{AlpcConsumeType as f,ConsumeType as T}from"../context/const";import{numberFormat as w}from"../context/utils";import{gaTrack as v,useHeadlessContext as I,ROUNDED_BRANDS as k}from"@anker-in/lib";import{NoneProductValue as S}from"./NonProductValue";function B({copy:l,className:g,item:e,onRulesOpen:b,onRedeem:y}){const{creditInfo:m,profile:a,gtm:{pageGroup:d},pageCommon:n}=R(),{brand:_}=I(),i=Object.keys(a||{}).length>0,h=k.includes(_),N=x(()=>!!(e.alpc?.remainingInventory<=0&&e.alpc?.isLimited||e.alpc?.consumeType===f.Product&&!e.variant?.availableForSale||i&&a?.activated&&e.alpc?.consumeCredits>Number(m?.available_credit||0)),[e.alpc?.remainingInventory,e.alpc?.isLimited,e.alpc?.consumeType,e.alpc?.consumeCredits,i,a?.activated,m?.available_credit,e.variant?.availableForSale]),c=x(()=>i?e.alpc?.consumeType===f.Product?e.variant?.availableForSale?l.btnRedeem:n?.soldOut||"Sold Out":l.btnRedeem:l.unlockRewards,[i,e.alpc?.consumeType,e.variant?.availableForSale,l.btnRedeem,l.unlockRewards,n?.soldOut]);return o("div",{className:s("flex flex-col items-center rounded-[16px] bg-[#EAEAEC] p-[24px] md:rounded-[12px] md:px-[8px] xl:py-[16px] md-xl:px-[16px]",!h&&"rounded-none md:rounded-none",g),children:[e.config?.type===T.Product?t("div",{className:s("relative mx-auto h-[224px] w-fit md:my-[10px] l:h-[120px] l-xxl:h-[138px]"),children:t(p,{className:"h-full w-auto [&_img]:h-full [&_img]:object-contain",source:e.config?.image?.url||e.product.images?.[0]?.url})}):o("div",{className:"relative mx-auto my-[30px] h-[164px] md:my-0 md:h-[66px] l-xxl:h-[138px] md-l:h-[80px]",children:[t(p,{source:n?.imageMapping?.[e.config?.type]?.url,className:"h-full [&_img]:h-full [&_img]:w-auto [&_img]:object-contain"}),t(S,{item:e})]}),o("div",{className:s("mt-[22px] flex w-full flex-1 flex-col justify-between"),children:[t(u,{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&&t("button",{type:"button",onClick:()=>{b(e.config?.rules||[]),v({event:"ga4Event",event_name:"lp_button",member_active_status:a?.activated?"active":"not active",event_parameters:{page_group:d,position:l.title,button_name:n?.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:r=>{(r.key==="Enter"||r.key===" ")&&r.preventDefault()},children:n?.ruleLabel}),o("div",{children:[o("div",{className:"mt-[26px] flex items-center l:mt-[12px] l-xl:mt-[16px]",children:[t(p,{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"}),t(u,{html:`${w(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] "})]}),t(C,{disabled:N,variant:"primary",size:"lg",className:"mt-[8px] md:px-[8px] l:w-full",onClick:()=>{y(e),v({event:"ga4Event",event_name:"lp_button",member_active_status:a?.activated?"active":"not active",event_parameters:{page_group:d,position:l.title,button_name:c,info:e.alpc?.id?.toString()}})},children:c})]})]})]})}export{B as RedeemableItem};
2
2
  //# sourceMappingURL=RedeemableItem.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/components/credits/creditsRedeemList/RedeemableItem.tsx"],
4
- "sourcesContent": ["import { Button, Text, Picture } from '@anker-in/headless-ui'\n\nimport { useMemo } from 'react'\n\nimport classNames from 'classnames'\nimport { useCreditsContext } from '../context/provider'\nimport type { RedeemableItem as RedeemableItemType } from '../type'\nimport { AlpcConsumeType, ConsumeType } from '../context/const'\nimport { numberFormat } from '../context/utils'\nimport type { CreditsRedeemListCopy } from './type'\nimport { gaTrack } from '../../../helpers/track'\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 } = useCreditsContext()\n const isLogin = Object.keys(profile || {}).length > 0\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 : copy?.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 copy?.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 className\n )}\n >\n {item.config?.type !== ConsumeType.Product ? (\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={copy?.imageMapping[item.config?.type]?.url}\n className=\"h-full [&_img]:h-full [&_img]:w-auto [&_img]:object-contain\"\n ></Picture>\n <div className=\"absolute bottom-[8px] left-[16px] font-extrabold text-white md:bottom-[2px] md:left-[5px]\">\n {item.config?.value ? (\n <div className=\"flex items-end\">\n <Text\n className=\"text-[64px] font-bold leading-none md:text-[20px] l-xxl:text-[40px] md-l:text-[22px]\"\n html={item.config?.value}\n />\n <Text\n className=\"ml-[4px] text-[24px] font-bold leading-[2] md:ml-[2px] l:text-[12px] xxl:leading-[1.4] l-xxl:text-[20px]\"\n html={item.config?.type === ConsumeType.GiftCard ? copy?.giftCardLabel : copy?.off}\n />\n </div>\n ) : (\n <Text size={3} html={item.config?.title || item.alpc?.title} />\n )}\n </div>\n </div>\n ) : (\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={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=\"text-[24px] font-bold leading-[1.2] l:text-[16px] 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: copy?.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 {copy?.ruleLabel}\n </button>\n )}\n <div>\n <div className=\"mt-[24px] flex items-center l:mt-[12px] l-xl:mt-[16px]\">\n <Picture\n className=\"size-[20px]\"\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 leading-[1.2] 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": "AAsFU,cAAAA,EAMI,QAAAC,MANJ,oBAtFV,OAAS,UAAAC,EAAQ,QAAAC,EAAM,WAAAC,MAAe,wBAEtC,OAAS,WAAAC,MAAe,QAExB,OAAOC,MAAgB,aACvB,OAAS,qBAAAC,MAAyB,sBAElC,OAAS,mBAAAC,EAAiB,eAAAC,MAAmB,mBAC7C,OAAS,gBAAAC,MAAoB,mBAE7B,OAAS,WAAAC,MAAe,yBAEjB,SAASC,EAAe,CAC7B,KAAAC,EACA,UAAAC,EACA,KAAAC,EACA,YAAAC,EACA,SAAAC,CACF,EAMG,CACD,KAAM,CACJ,WAAAC,EACA,QAAAC,EACA,IAAK,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UP,EAAK,MACf,YAAaU,EACb,KAAMR,EAAK,MAAM,IAAI,SAAS,CAChC,CACF,CAAC,CACH,EAEC,SAAAQ,EACH,GACF,GACF,GACF,CAEJ",
6
- "names": ["jsx", "jsxs", "Button", "Text", "Picture", "useMemo", "classNames", "useCreditsContext", "AlpcConsumeType", "ConsumeType", "numberFormat", "gaTrack", "RedeemableItem", "copy", "className", "item", "onRulesOpen", "onRedeem", "creditInfo", "profile", "pageGroup", "isLogin", "isDisabled", "redeemButtonText", "e"]
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, ROUNDED_BRANDS } from '@anker-in/lib'\nimport { NoneProductValue } from './NonProductValue'\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": "AA2FU,cAAAA,EAMF,QAAAC,MANE,oBA3FV,OAAS,UAAAC,EAAQ,QAAAC,EAAM,WAAAC,MAAe,wBAEtC,OAAS,WAAAC,MAAe,QAExB,OAAOC,MAAgB,aACvB,OAAS,qBAAAC,MAAyB,sBAElC,OAAS,mBAAAC,EAAiB,eAAAC,MAAmB,mBAC7C,OAAS,gBAAAC,MAAoB,mBAE7B,OAA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W,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": ["jsx", "jsxs", "Button", "Text", "Picture", "useMemo", "classNames", "useCreditsContext", "AlpcConsumeType", "ConsumeType", "numberFormat", "gaTrack", "useHeadlessContext", "ROUNDED_BRANDS", "NoneProductValue", "RedeemableItem", "copy", "className", "item", "onRulesOpen", "onRedeem", "creditInfo", "profile", "pageGroup", "pageCommon", "brand", "isLogin", "rounded", "isDisabled", "redeemButtonText", "e"]
7
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';
@@ -1,2 +1,2 @@
1
- import{jsx as n,jsxs as X}from"react/jsx-runtime";import{Container as F,Heading as D,Tabs as z,TabsList as H,TabsTrigger as j}from"@anker-in/headless-ui";import c from"classnames";import{useCallback as w,useMemo as L,useState as g}from"react";import B from"./RedeemCouponModal";import G from"./RedeemProductModal";import{useCreditsContext as U}from"../context/provider";import V from"../context/hooks/useRedeemableList";import{AlpcConsumeType as f,AlpcErrorCode as q}from"../context/const";import{useProductsByHandles as J}from"@anker-in/shopify";import{RedeemableItem as K}from"./RedeemableItem";import Q from"../modal/rulesModal";import{gaTrack as W}from"../../../helpers/track";function pe({copy:t,className:N="",tabClassName:k="",hideTitle:x=!1,cardClassName:_,activate:d}){const{profile:b,openSignUpPopup:I,gtm:{pageGroup:P}}=U(),S=Object.keys(b||{}).length>0,[m,E]=g(t.list[0].label),[o,l]=g(void 0),[p,C]=g(),{listLoading:O,redeemableList:R,getRedeemableList:v}=V(),r=L(()=>R.map(e=>({id:e.id.toString(),title:e.name,consumeCredits:e.consume_credits,remainingInventory:e.remaining_inventory,isLimited:!!e.is_limited,consumeType:e.consume_type,handle:e.sku_handle,sku:e.goods_sku,image:e.goods_url})),[t.list,m,R]),A=r.map(e=>e.handle),{data:T}=J({handles:A}),M=L(()=>t.list.find(s=>s.label===m)?.list.filter(s=>r.some(i=>i.id===s.id)).map(s=>{const i=r.find(a=>a.id===s.id),u=T?.find(a=>a.handle===i?.handle),y=u?.variants.find(a=>a.sku===i?.sku);return i?.consumeType===f.Product&&(!u||!y)?null:{alpc:r.find(a=>a.id===s.id),config:s,product:u,variant:y}}).filter(s=>s!==null),[r,T]),h=w(e=>{e===q.CodeLpcRuleInventoryNotEnough&&v()},[v]);return console.log("popRedeemData",o),X(F,{className:c("relative bg-[#F5F5F7]",N),children:[!x&&n(D,{as:"h2",size:"4",html:t.title}),n(z,{shape:"rounded",align:"left",className:c("sticky top-0 z-20 py-[24px] md:justify-center",k),value:m.toString(),onValueChange:e=>{E(e),W({event:"ga4Event",event_name:"lp_navigation",event_parameters:{navigation:e,page_group:P}})},children:n(H,{children:t.list.map(e=>n(j,{value:e.label,children:e.label},e.label))})}),!!r?.length&&!O&&n("div",{className:c("relative grid grid-cols-4 gap-[16px] md:grid-cols-2 md:gap-[12px] md-xl:grid-cols-3"),children:M?.map(e=>n(K,{copy:t,item:e,onRedeem:s=>{S?!b?.activated&&!d.isSuccess?(d.openAuthCodePopup(),d.setOnSuccess(()=>{l(s)})):l(s):I()},onRulesOpen:C,className:_},e?.alpc?.id))}),o?.alpc?.consumeType===f.Coupon&&t?.redeemModal?.coupon&&o&&n(B,{isOpen:!!o,item:o,copy:t,onError:h,onClose:()=>{l(void 0)}}),o?.alpc?.consumeType===f.Product&&t?.redeemModal&&o&&n(G,{isOpen:!!o,item:o,copy:t,onError:h,onClose:()=>{l(void 0)}}),p&&n(Q,{overlayClassName:"md:px-[16px] md:items-center",className:"md:h-fit md:rounded-b-[16px]",isOpen:p.length>0,onClose:()=>C([]),titleClassName:"border-b-transparent h-[56px]",rules:p,scrollClassName:"md:mt-[8px] md:mb-[24px] md:pt-0",title:t?.ruleLabel,ruleClassName:"text-[#1d1d1f] font-bold"})]})}export{pe as CreditsRedeemList};
1
+ export*from"./type";export*from"./CreditsRedeemList";
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../src/components/credits/creditsRedeemList/index.tsx"],
4
- "sourcesContent": ["import { Container, Heading, Tabs, TabsList, TabsTrigger } from '@anker-in/headless-ui'\nimport classNames from 'classnames'\nimport { useCallback, useMemo, useState } from 'react'\n\nimport RedeemCouponModal from './RedeemCouponModal'\nimport RedeemProductModal from './RedeemProductModal'\nimport { useCreditsContext } from '../context/provider'\nimport useRedeemableList from '../context/hooks/useRedeemableList'\nimport { AlpcConsumeType, AlpcErrorCode } from '../context/const'\nimport { useProductsByHandles } from '@anker-in/shopify'\nimport type { RedeemableItem as RedeemableItemType } from '../type'\nimport { RedeemableItem } from './RedeemableItem'\nimport RulesModal from '../modal/rulesModal'\nimport { CreditsRedeemListCopy } from './type'\nimport { gaTrack } from '../../../helpers/track'\n\nexport function CreditsRedeemList({\n copy,\n className = '',\n tabClassName = '',\n hideTitle = false,\n cardClassName,\n activate,\n}: {\n copy: CreditsRedeemListCopy\n className?: string\n tabClassName?: string\n hideTitle?: boolean\n cardClassName?: string\n activate: {\n openAuthCodePopup: () => void\n isSuccess: boolean\n setOnSuccess: (callback: Function) => void\n }\n}) {\n const {\n profile,\n openSignUpPopup,\n gtm: { pageGroup },\n } = useCreditsContext()\n const isLogin = Object.keys(profile || {}).length > 0\n\n const [activeTab, setActiveTab] = useState<string>(copy.list[0].label)\n\n const [popRedeemData, setPopRedeemData] = useState<RedeemableItemType | undefined>(undefined)\n\n const [rules, setRules] = useState<string | string[]>()\n\n const { listLoading, redeemableList, getRedeemableList } = useRedeemableList()\n\n const alpcList = useMemo(() => {\n return redeemableList.map(item => {\n return {\n id: item.id.toString(),\n title: item.name,\n consumeCredits: item.consume_credits,\n remainingInventory: item.remaining_inventory,\n isLimited: !!item.is_limited,\n consumeType: item.consume_type,\n handle: item.sku_handle,\n sku: item.goods_sku,\n image: item.goods_url,\n }\n })\n }, [copy.list, activeTab, redeemableList])\n\n const handles = alpcList.map(item => item.handle)\n const { data: products } = useProductsByHandles({ handles })\n\n const list = useMemo(() => {\n const currentList = copy.list.find(item => item.label === activeTab)\n return currentList?.list\n .filter(item => alpcList.some(alpcItem => alpcItem.id === item.id))\n .map(item => {\n const alpcItem = alpcList.find(alpcItem => alpcItem.id === item.id)\n const product = products?.find(product => product.handle === alpcItem?.handle)\n const variant = product?.variants.find(variant => variant.sku === alpcItem?.sku)\n if (alpcItem?.consumeType === AlpcConsumeType.Product && (!product || !variant)) return null\n return {\n alpc: alpcList.find(alpcItem => alpcItem.id === item.id),\n config: item,\n product,\n variant,\n }\n })\n .filter(item => item !== null) as unknown as RedeemableItemType[]\n }, [alpcList, products])\n\n const handleRedeemError = useCallback(\n (errorCode: AlpcErrorCode) => {\n if (errorCode === AlpcErrorCode.CodeLpcRuleInventoryNotEnough) {\n getRedeemableList()\n }\n },\n [getRedeemableList]\n )\n\n console.log('popRedeemData', popRedeemData)\n\n return (\n <Container className={classNames('relative bg-[#F5F5F7]', className)}>\n {!hideTitle && <Heading as=\"h2\" size=\"4\" html={copy.title} />}\n\n <Tabs\n shape=\"rounded\"\n align=\"left\"\n className={classNames('sticky top-0 z-20 py-[24px] md:justify-center', tabClassName)}\n value={activeTab.toString()}\n onValueChange={value => {\n setActiveTab(value)\n gaTrack({\n event: 'ga4Event',\n event_name: 'lp_navigation',\n event_parameters: {\n navigation: value,\n page_group: pageGroup,\n },\n })\n }}\n >\n <TabsList>\n {copy.list.map(item => (\n <TabsTrigger key={item.label} value={item.label}>\n {item.label}\n </TabsTrigger>\n ))}\n </TabsList>\n </Tabs>\n {/* PC\u7AEF */}\n {!!alpcList?.length && !listLoading && (\n <div\n className={classNames('relative grid grid-cols-4 gap-[16px] md:grid-cols-2 md:gap-[12px] md-xl:grid-cols-3')}\n >\n {list?.map(item => (\n <RedeemableItem\n key={item?.alpc?.id}\n copy={copy}\n item={item}\n onRedeem={(item: RedeemableItemType) => {\n if (!isLogin) {\n openSignUpPopup()\n } else if (!profile?.activated && !activate.isSuccess) {\n activate.openAuthCodePopup()\n activate.setOnSuccess(() => {\n setPopRedeemData(item)\n })\n } else {\n setPopRedeemData(item)\n }\n }}\n onRulesOpen={setRules}\n className={cardClassName}\n />\n ))}\n </div>\n )}\n\n {popRedeemData?.alpc?.consumeType === AlpcConsumeType.Coupon && copy?.redeemModal?.coupon && popRedeemData && (\n <RedeemCouponModal\n isOpen={!!popRedeemData}\n item={popRedeemData}\n copy={copy}\n onError={handleRedeemError}\n onClose={() => {\n setPopRedeemData(undefined)\n }}\n />\n )}\n {popRedeemData?.alpc?.consumeType === AlpcConsumeType.Product && copy?.redeemModal && popRedeemData && (\n <RedeemProductModal\n isOpen={!!popRedeemData}\n item={popRedeemData}\n copy={copy}\n onError={handleRedeemError}\n onClose={() => {\n setPopRedeemData(undefined)\n }}\n />\n )}\n {rules && (\n <RulesModal\n overlayClassName=\"md:px-[16px] md:items-center\"\n className=\"md:h-fit md:rounded-b-[16px]\"\n isOpen={rules.length > 0}\n onClose={() => setRules([])}\n titleClassName=\"border-b-transparent h-[56px]\"\n rules={rules}\n scrollClassName=\"md:mt-[8px] md:mb-[24px] md:pt-0\"\n title={copy?.ruleLabel}\n ruleClassName=\"text-[#1d1d1f] font-bold\"\n />\n )}\n </Container>\n )\n}\n"],
5
- "mappings": "AAoGI,OACiB,OAAAA,EADjB,QAAAC,MAAA,oBApGJ,OAAS,aAAAC,EAAW,WAAAC,EAAS,QAAAC,EAAM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,EAAA,CACE,SAAAiB,EAAK,KAAK,IAAIoB,GACb1C,EAACM,EAAA,CAA6B,MAAOoC,EAAK,MACvC,SAAAA,EAAK,OADUA,EAAK,KAEvB,CACD,EACH,EACF,EAEC,CAAC,CAACD,GAAU,QAAU,CAACH,GACtBtC,EAAC,OACC,UAAWO,EAAW,qFAAqF,EAE1G,SAAAsC,GAAM,IAAIH,GACT1C,EAACkB,EAAA,CAEC,KAAMI,EACN,KAAMoB,EACN,SAAWA,GAA6B,CACjCX,EAEM,CAACH,GAAS,WAAa,CAACD,EAAS,WAC1CA,EAAS,kBAAkB,EAC3BA,EAAS,aAAa,IAAM,CAC1BQ,EAAiBO,CAAI,CACvB,CAAC,GAEDP,EAAiBO,CAAI,EAPrBb,EAAgB,CASpB,EACA,YAAaQ,EACb,UAAWX,GAhBNgB,GAAM,MAAM,EAiBnB,CACD,EACH,EAGDR,GAAe,MAAM,cAAgBnB,EAAgB,QAAUO,GAAM,aAAa,QAAUY,GAC3FlC,EAACW,EAAA,CACC,OAAQ,CAAC,CAACuB,EACV,KAAMA,EACN,KAAMZ,EACN,QAAS2B,EACT,QAAS,IAAM,CACbd,EAAiB,MAAS,CAC5B,EACF,EAEDD,GAAe,MAAM,cAAgBnB,EAAgB,SAAWO,GAAM,aAAeY,GACpFlC,EAACY,EAAA,CACC,OAAQ,CAAC,CAACsB,EACV,KAAMA,EACN,KAAMZ,EACN,QAAS2B,EACT,QAAS,IAAM,CACbd,EAAiB,MAAS,CAC5B,EACF,EAEDC,GACCpC,EAACmB,EAAA,CACC,iBAAiB,+BACjB,UAAU,+BACV,OAAQiB,EAAM,OAAS,EACvB,QAAS,IAAMC,EAAS,CAAC,CAAC,EAC1B,eAAe,gCACf,MAAOD,EACP,gBAAgB,mCAChB,MAAOd,GAAM,UACb,cAAc,2BAChB,GAEJ,CAEJ",
6
- "names": ["jsx", "jsxs", "Container", "Heading", "Tabs", "TabsList", "TabsTrigger", "classNames", "useCallback", "useMemo", "useState", "RedeemCouponModal", "RedeemProductModal", "useCreditsContext", "useRedeemableList", "AlpcConsumeType", "AlpcErrorCode", "useProductsByHandles", "RedeemableItem", "RulesModal", "gaTrack", "CreditsRedeemList", "copy", "className", "tabClassName", "hideTitle", "cardClassName", "activate", "profile", "openSignUpPopup", "pageGroup", "isLogin", "activeTab", "setActiveTab", "popRedeemData", "setPopRedeemData", "rules", "setRules", "listLoading", "redeemableList", "getRedeemableList", "alpcList", "item", "handles", "products", "list", "alpcItem", "product", "variant", "handleRedeemError", "errorCode", "value"]
3
+ "sources": ["../../../../../src/components/credits/creditsRedeemList/index.ts"],
4
+ "sourcesContent": ["export * from './type'\nexport * from './CreditsRedeemList'\n"],
5
+ "mappings": "AAAA,WAAc,SACd,WAAc",
6
+ "names": []
7
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,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
+ import{Fragment as X,jsx as t,jsxs as i}from"react/jsx-runtime";import{Button as z,Container as B,Heading as p,Picture as b,Text as P}from"@anker-in/headless-ui";import{ChevronDownIcon as G,ChevronUpIcon as W}from"@heroicons/react/24/outline";import{motion as _}from"framer-motion";import{useMemo as j,useState as a}from"react";import{TaskType as h}from"./type";import{useActions as q}from"./useActions";import{useCreditsContext as E}from"../context/provider";import{classNames as c,useHeadlessContext as H,ROUNDED_BRANDS as V}from"@anker-in/lib";import{useRegistration as J}from"../../registration";import{CreditsUploadReceiptModal as K}from"../modal/creditsUploadReceiptModal";import{CreditsSubscribeModal as Q}from"../modal/subscribeModal";const de=({copy:s,classNames:v,id:I})=>{const[l,g]=a(!1),{profile:y}=E(),{authCodeActivate:D}=J(),{brand:R}=H(),k=V.includes(R),m=!!y,[T,C]=a(!1),[U,u]=a(!1),[N,L]=a(!1),[w,M]=a(!1),{actions:x}=q({copy:s,subscribe:{openSubscribePopup:()=>u(!0),isSuccess:N},uploadReceipt:{openUploadReceiptPopup:()=>C(!0),isSuccess:w}}),O=j(()=>{const e=s.list.map(n=>{if(!x[n.id])return;const{finished:o,notLogin:F,notFinished:f,completed:A}=x[n.id];let d="",r,S;return m?o?(d=A.buttonLabel,r=void 0):(d=f.buttonLabel,r=f.handleClick,S=f.link):(d=F.buttonLabel,r=F.handleClick),{...n,buttonLabel:d,handleClick:r,finished:o,link:S}}).filter(Boolean);return m?e.sort((n,o)=>n?.finished&&!o?.finished?1:!n?.finished&&o?.finished?-1:0):e},[x,s.list,m]);return i(B,{id:I,className:" bg-[#F5F5F7] [&>div]:l:!px-0",children:[i("div",{className:c("rounded-[16px] bg-[#1D1D1F] py-[64px] px-[140px] text-white md:px-[16px] l:rounded-none md-l:px-[32px] l-xl:px-[77px]",!k&&"rounded-none"),children:[t(p,{as:"h2",size:4,html:s?.title,className:"text-center l:pl-[16px] l:text-left"}),i("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:[i("div",{className:"pl-[16px] l:mt-[40px] desktop:pl-[24px] lg-desktop:pl-[32px]",children:[t(p,{size:3,as:"h3",html:s.subtitle,className:v?.subtitle}),i("div",{className:"mt-[8px] flex items-center",children:[s.creditsIcon?.url&&t(b,{className:"size-[48px] mr-[8px] stroke-brand xl:size-[30px] [&_path]:stroke-brand",source:s.creditsIcon.url,alt:s.creditsIcon.alt||"credits"}),t(p,{html:s.equalCredits,size:4,as:"h3",className:c("mt-2 text-white md:text-[24px]",v?.equalCreditsText)})]})]}),t(b,{className:"w-full laptop:w-[50%]",source:s.mainImage?.url})]}),i("div",{className:"relative",children:[i(_.div,{className:c("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 e=document.getElementById("ways-to-get-credits");e&&e.scrollIntoView({behavior:"smooth",block:"end"})}},children:[O.map(e=>i("div",{className:c("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]",!k&&"rounded-none"),children:[i("div",{children:[t(p,{as:"h4",html:e.title,size:2,className:"text-pretty"}),i("div",{className:"mt-[4px] flex items-center",children:[t(b,{className:"size-[24px] xl:size-[18px] [&_path]:size-full",source:"https://cdn.shopify.com/s/files/1/0511/6346/3874/files/20250902-153351.png?v=1756798450"}),t(P,{as:"p",html:e.credits,size:2,className:"ml-[4px] mt-[6px] lg-desktop:text-[18px]"})]})]}),e.handleClick&&!(e.id===h.UploadReceipt&&w)&&!(e.id===h.Activate&&D.isActivateSuccess)&&!(e.id===h.Subscribe&&N)?t(z,{as:e.link?"a":"button",...e.link&&{href:e.link},...e.handleClick&&{onClick:e.handleClick},variant:"primary",size:"lg",className:"mt-[24px] w-fit",children:e.buttonLabel}):t(z,{variant:"primary",size:"lg",className:"mt-[24px] w-fit",disabled:!0,children:e.buttonLabel})]},e.id)),!l&&t("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?t("button",{className:"mx-auto mt-[12px] block w-fit min-md:hidden",onClick:()=>{g(!1)},children:t(W,{className:"size-[40px] rounded-full bg-[#FFFFFF33] p-[8px]"})}):t(X,{children:t("div",{className:"absolute bottom-0 flex w-full translate-y-1/2 justify-center min-md:hidden",children:t("button",{className:"w-fit",onClick:()=>g(!l),children:t(G,{className:"size-[40px] rounded-full bg-[#FFFFFF33] p-[8px]"})})})})]})]}),s.receipt&&t(K,{isOpen:T,onClose:()=>{C(!1)},copy:s.receipt,onSuccess:()=>{M(!0)}}),s.subscribe&&t(Q,{copy:s.subscribe,onSuccess:()=>{L(!0),setTimeout(()=>{u(!1)},3e3)},isOpen:U,onClose:()=>{u(!1)}})]})};export{de as CreditsWaysToGetCredits};
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, ROUNDED_BRANDS } from '@anker-in/lib'\nimport { useRegistration } from '../../registration'\nimport { CreditsUploadReceiptModal } from '../modal/creditsUploadReceiptModal'\nimport { CreditsSubscribeModal } from '../modal/subscribeModal'\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 <Heading as=\"h4\" html={item.title} size={2} className=\"text-pretty\" />\n <div className=\"mt-[4px] flex items-center\">\n <Picture\n className=\"size-[24px] xl:size-[18px] [&_path]:size-full\"\n source=\"https://cdn.shopify.com/s/files/1/0511/6346/3874/files/20250902-153351.png?v=1756798450\"\n />\n <Text as=\"p\" html={item.credits} size={2} className=\"ml-[4px] mt-[6px] lg-desktop:text-[18px]\" />\n </div>\n </div>\n\n {item.handleClick &&\n !(item.id === TaskType.UploadReceipt && 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": "AAoGQ,OAiGI,YAAAA,EAjGJ,OAAAC,EAII,QAAAC,MAJJ,oBApGR,OAAS,UAAAC,EAAQ,aAAAC,EAAW,WAAAC,EAAS,WAAAC,EAAS,QAAAC,MAAY,wBAC1D,OAAS,mBAAAC,EAAiB,iBAAAC,MAAqB,8BAC/C,OAAS,UAAAC,MAAc,gBACvB,OAAS,WAAAC,EAAS,YAAAC,MAAgB,QAElC,OAAS,YAAAC,MAAmD,SAC5D,OAAS,cAAAC,MAAkB,eAC3B,OAAS,qBAAAC,MAAyB,sBAClC,OAAS,cAAcC,EAAI,sBAAAC,EAAoB,kBAAAC,MAAsB,gBACrE,OAAS,mBAAAC,MAAuB,qBAChC,OAAS,6BAAAC,MAAiC,qCAC1C,OAAS,yBAAAC,MAA6B,0BAE/B,MAAMC,GAA0B,CAAC,CAAE,KAAAC,EAAM,WAAAC,EAAY,GAAAC,CAAG,IAAsD,CACnH,KAAM,CAACC,EAAUC,CAA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,IAAM,CACbC,EAA4B,EAAK,CACnC,EACA,KAAMX,EAAK,QACX,UAAW,IAAM,CACfiB,EAA0B,EAAI,CAChC,EACF,EAEDjB,EAAK,WACJtB,EAACoB,EAAA,CACC,KAAME,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": ["Fragment", "jsx", "jsxs", "Button", "Container", "Heading", "Picture", "Text", "ChevronDownIcon", "ChevronUpIcon", "motion", "useMemo", "useState", "TaskType", "useActions", "useCreditsContext", "cn", "useHeadlessContext", "ROUNDED_BRANDS", "useRegistration", "CreditsUploadReceiptModal", "CreditsSubscribeModal", "CreditsWaysToGetCredits", "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", "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';
@@ -1,2 +1,2 @@
1
- import{Fragment as P,jsx as t,jsxs as s}from"react/jsx-runtime";import{Button as N,Container as I,Heading as r,Picture as f,Text as L}from"@anker-in/headless-ui";import{ChevronDownIcon as T,ChevronUpIcon as D}from"@heroicons/react/24/outline";import{motion as S}from"framer-motion";import{useMemo as A,useState as B}from"react";import{TaskType as p}from"./type";import{useActions as G}from"./useActions";import{useCreditsContext as M}from"../context/provider";import{cn as w}from"../../../helpers/index";const J=({copy:i,activate:m,subscribe:h,uploadReceipt:b,classNames:g})=>{const[n,v]=B(!1),{profile:F}=M(),c=!!F,{actions:x}=G({copy:i,activate:m,subscribe:h,uploadReceipt:b}),y=A(()=>{const e=i.list.map(l=>{if(!x[l.id])return;const{finished:o,notLogin:k,notFinished:u,completed:z}=x[l.id];let d="",a,C;return c?o?(d=z.buttonLabel,a=void 0):(d=u.buttonLabel,a=u.handleClick,C=u.link):(d=k.buttonLabel,a=k.handleClick),{...l,buttonLabel:d,handleClick:a,finished:o,link:C}}).filter(Boolean);return c?e.sort((l,o)=>l?.finished&&!o?.finished?1:!l?.finished&&o?.finished?-1:0):e},[x,i.list,c]);return t(I,{id:"ways-to-get-credits",className:" bg-[#F5F5F7] [&>div]:l:!px-0",children:s("div",{className:"rounded-[16px] bg-[#1D1D1F] py-[64px] px-[140px] text-white md:px-[16px] l:rounded-none md-l:px-[32px] l-xl:px-[77px]",children:[t(r,{as:"h2",size:4,html:i?.title,className:"text-center l:pl-[16px] l:text-left"}),s("div",{className:"mt-[64px] flex items-center justify-between md:mt-[64px] l:mt-[24px] l:flex-col-reverse l:items-start md-l:mt-[32px]",children:[s("div",{className:"pl-[16px] l:mt-[40px] desktop:pl-[24px] lg-desktop:pl-[32px]",children:[t(r,{size:3,as:"h3",html:i.subtitle,className:g?.subtitle}),s("div",{className:"mt-[8px] flex items-center",children:[i.creditsIcon?.url&&t(f,{className:"size-[48px] mr-[8px] stroke-brand xl:size-[30px] [&_path]:stroke-brand",source:i.creditsIcon.url,alt:i.creditsIcon.alt||"credits"}),t(r,{html:i.equalCredits,size:4,as:"h3",className:w("mt-2 text-white md:text-[24px]",g?.equalCreditsText)})]})]}),t(f,{className:"w-full laptop:w-[50%]",source:i.mainImage?.url})]}),s("div",{className:"relative",children:[s(S.div,{className:w("relative mt-[64px] grid grid-cols-3 gap-[16px] overflow-hidden md:mt-[16px] md:grid-cols-1 l:gap-[12px] min-md:!h-auto md-l:mt-[32px] md-l:grid-cols-2"),initial:{height:512},animate:{height:n?"auto":512},transition:{duration:.3},onAnimationComplete:()=>{if(!n&&window.screen.width<768){const e=document.getElementById("ways-to-get-credits");e&&e.scrollIntoView({behavior:"smooth",block:"end"})}},children:[y.map(e=>s("div",{className:"flex min-h-[160px] flex-col justify-between rounded-[16px] bg-white p-[16px] text-[#1D1D1F] desktop:min-h-[192px] desktop:p-[24px] lg-desktop:min-h-[240px] lg-desktop:p-[32px]",children:[s("div",{children:[t(r,{as:"h4",html:e.title,size:2,className:"text-pretty"}),s("div",{className:"mt-[4px] flex items-center",children:[t(f,{className:"size-[24px] xl:size-[18px] [&_path]:size-full",source:"https://cdn.shopify.com/s/files/1/0511/6346/3874/files/20250902-153351.png?v=1756798450"}),t(L,{as:"p",html:e.credits,size:2,className:"ml-[4px] mt-[6px] lg-desktop:text-[18px]"})]})]}),e.handleClick&&!(e.id===p.UploadReceipt&&b.isSuccess)&&!(e.id===p.Activate&&m.isSuccess)&&!(e.id===p.Subscribe&&h.isSuccess)?t(N,{as:e.link?"a":"button",...e.link&&{href:e.link},...e.handleClick&&{onClick:e.handleClick},variant:"primary",loading:e.id===p.Activate&&m.isSendingActivateEmail,size:"lg",className:"mt-[24px] w-fit",children:e.buttonLabel}):t(N,{variant:"primary",size:"lg",className:"mt-[24px] w-fit",disabled:!0,children:e.buttonLabel})]},e.id)),!n&&t("div",{className:"absolute inset-0 min-md:hidden",style:{background:"linear-gradient(180deg, rgba(29, 29, 31, 0) 66.37%, #1D1D1F 100%"}})]}),n?t("button",{className:"mx-auto mt-[12px] block w-fit min-md:hidden",onClick:()=>{v(!1)},children:t(D,{className:"size-[40px] rounded-full bg-[#FFFFFF33] p-[8px]"})}):t(P,{children:t("div",{className:"absolute bottom-0 flex w-full translate-y-1/2 justify-center min-md:hidden",children:t("button",{className:"w-fit",onClick:()=>v(!n),children:t(T,{className:"size-[40px] rounded-full bg-[#FFFFFF33] p-[8px]"})})})})]})]})})};export{J as CreditsWaysToGetCredits};
1
+ export*from"./type";export*from"./CreditsWaysToGetCredits";
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../src/components/credits/creditsWaysToGetCredits/index.tsx"],
4
- "sourcesContent": ["import { Button, Container, Heading, Picture, Text } from '@anker-in/headless-ui'\nimport { ChevronDownIcon, ChevronUpIcon } from '@heroicons/react/24/outline'\nimport { motion } from 'framer-motion'\nimport { useMemo, useState } from 'react'\n\nimport { TaskType, type CreditsWaysToGetCreditsProps } from './type'\nimport { useActions } from './useActions'\nimport { useCreditsContext } from '../context/provider'\nimport { cn } from '../../../helpers/index'\n\nexport const CreditsWaysToGetCredits = ({\n copy,\n activate,\n subscribe,\n uploadReceipt,\n classNames,\n}: CreditsWaysToGetCreditsProps) => {\n const [showMore, setShowMore] = useState(false)\n const { profile } = useCreditsContext()\n const isLogin = !!profile\n\n const { actions } = useActions({ copy, activate, subscribe, uploadReceipt })\n\n const list = useMemo(() => {\n const list = copy.list\n .map(item => {\n if (!actions[item.id as keyof typeof actions]) {\n return undefined\n }\n const { finished, notLogin, notFinished, completed } = actions[item.id as keyof typeof actions]\n let buttonLabel = ''\n let handleClick = undefined\n let link = undefined\n if (!isLogin) {\n buttonLabel = notLogin.buttonLabel\n handleClick = notLogin.handleClick\n } else if (finished) {\n buttonLabel = completed.buttonLabel\n handleClick = undefined\n } else {\n buttonLabel = notFinished.buttonLabel\n handleClick = notFinished.handleClick\n link = (notFinished as { link: string }).link\n }\n return {\n ...item,\n buttonLabel,\n handleClick,\n finished,\n link,\n }\n })\n .filter(Boolean) as {\n title: string\n credits: string\n id: TaskType\n buttonLabel: string\n finished: boolean\n link: string\n handleClick: (() => void) | undefined\n }[]\n\n // \u767B\u5F55\u540E\uFF0C\u4FDD\u7559\u539F\u987A\u5E8F\uFF0C\u5C06\u5DF2\u5B8C\u6210\u7684\u4EFB\u52A1\u653E\u5728\u6700\u540E\n if (isLogin) {\n return list.sort((a, b) => {\n if (a?.finished && !b?.finished) {\n return 1 // a\u5DF2\u5B8C\u6210\uFF0Cb\u672A\u5B8C\u6210\uFF0Ca\u6392\u5728\u540E\u9762\n }\n if (!a?.finished && b?.finished) {\n return -1 // a\u672A\u5B8C\u6210\uFF0Cb\u5DF2\u5B8C\u6210\uFF0Ca\u6392\u5728\u524D\u9762\n }\n return 0 // \u90FD\u5DF2\u5B8C\u6210\u6216\u90FD\u672A\u5B8C\u6210\uFF0C\u4FDD\u6301\u539F\u987A\u5E8F\n })\n } else {\n return list\n }\n }, [actions, copy.list, isLogin])\n\n return (\n <Container id=\"ways-to-get-credits\" className=\" bg-[#F5F5F7] [&>div]:l:!px-0\">\n <div className=\"rounded-[16px] bg-[#1D1D1F] py-[64px] px-[140px] text-white md:px-[16px] l:rounded-none md-l:px-[32px] l-xl:px-[77px]\">\n <Heading as=\"h2\" size={4} html={copy?.title} className=\"text-center l:pl-[16px] l:text-left\" />\n <div className=\"mt-[64px] flex items-center justify-between md:mt-[64px] l:mt-[24px] l:flex-col-reverse l:items-start md-l:mt-[32px]\">\n <div className=\"pl-[16px] l:mt-[40px] desktop:pl-[24px] lg-desktop:pl-[32px]\">\n <Heading size={3} as=\"h3\" html={copy.subtitle} className={classNames?.subtitle} />\n <div className=\"mt-[8px] flex items-center\">\n {copy.creditsIcon?.url && (\n <Picture\n className=\"size-[48px] mr-[8px] stroke-brand xl:size-[30px] [&_path]:stroke-brand\"\n source={copy.creditsIcon.url}\n alt={copy.creditsIcon.alt || 'credits'}\n />\n )}\n <Heading\n html={copy.equalCredits}\n size={4}\n as=\"h3\"\n className={cn('mt-2 text-white md:text-[24px]', classNames?.equalCreditsText)}\n />\n </div>\n </div>\n <Picture className=\"w-full laptop:w-[50%]\" source={copy.mainImage?.url} />\n </div>\n\n <div className=\"relative\">\n <motion.div\n className={cn(\n 'relative mt-[64px] grid grid-cols-3 gap-[16px] overflow-hidden md:mt-[16px] md:grid-cols-1 l:gap-[12px] min-md:!h-auto md-l:mt-[32px] md-l:grid-cols-2'\n )}\n initial={{ height: 512 }}\n animate={{ height: showMore ? 'auto' : 512 }}\n transition={{ duration: 0.3 }}\n onAnimationComplete={() => {\n if (!showMore && window.screen.width < 768) {\n const section = document.getElementById('ways-to-get-credits')\n if (section) {\n section.scrollIntoView({ behavior: 'smooth', block: 'end' })\n }\n }\n }}\n >\n {list.map(item => (\n <div\n key={item.id}\n className=\"flex min-h-[160px] flex-col justify-between rounded-[16px] bg-white p-[16px] text-[#1D1D1F] desktop:min-h-[192px] desktop:p-[24px] lg-desktop:min-h-[240px] lg-desktop:p-[32px]\"\n >\n <div>\n <Heading as=\"h4\" html={item.title} size={2} className=\"text-pretty\" />\n <div className=\"mt-[4px] flex items-center\">\n <Picture\n className=\"size-[24px] xl:size-[18px] [&_path]:size-full\"\n source=\"https://cdn.shopify.com/s/files/1/0511/6346/3874/files/20250902-153351.png?v=1756798450\"\n />\n <Text as=\"p\" html={item.credits} size={2} className=\"ml-[4px] mt-[6px] lg-desktop:text-[18px]\" />\n </div>\n </div>\n\n {item.handleClick &&\n !(item.id === TaskType.UploadReceipt && uploadReceipt.isSuccess) &&\n !(item.id === TaskType.Activate && activate.isSuccess) &&\n !(item.id === TaskType.Subscribe && subscribe.isSuccess) ? (\n <Button\n as={item.link ? 'a' : 'button'}\n {...(item.link && { href: item.link })}\n {...(item.handleClick && { onClick: item.handleClick })}\n variant=\"primary\"\n loading={item.id === TaskType.Activate && activate.isSendingActivateEmail}\n size=\"lg\"\n className=\"mt-[24px] w-fit\"\n >\n {item.buttonLabel}\n </Button>\n ) : (\n <Button variant=\"primary\" size=\"lg\" className=\"mt-[24px] w-fit\" disabled>\n {item.buttonLabel}\n </Button>\n )}\n </div>\n ))}\n {!showMore && (\n <div\n className=\"absolute inset-0 min-md:hidden\"\n style={{ background: 'linear-gradient(180deg, rgba(29, 29, 31, 0) 66.37%, #1D1D1F 100%' }}\n ></div>\n )}\n </motion.div>\n {showMore ? (\n <button\n className=\"mx-auto mt-[12px] block w-fit min-md:hidden\"\n onClick={() => {\n setShowMore(false)\n }}\n >\n <ChevronUpIcon className=\"size-[40px] rounded-full bg-[#FFFFFF33] p-[8px]\"></ChevronUpIcon>\n </button>\n ) : (\n <>\n <div className=\"absolute bottom-0 flex w-full translate-y-1/2 justify-center min-md:hidden\">\n <button className=\"w-fit\" onClick={() => setShowMore(!showMore)}>\n <ChevronDownIcon className=\"size-[40px] rounded-full bg-[#FFFFFF33] p-[8px]\"></ChevronDownIcon>\n </button>\n </div>\n </>\n )}\n </div>\n </div>\n </Container>\n )\n}\n"],
5
- "mappings": "AAiFQ,OA+FI,YAAAA,EA/FJ,OAAAC,EAII,QAAAC,MAJJ,oBAjFR,OAAS,UAAAC,EAAQ,aAAAC,EAAW,WAAAC,EAAS,WAAAC,EAAS,QAAAC,MAAY,wBAC1D,OAAS,mBAAAC,EAAiB,iBAAAC,MAAqB,8BAC/C,OAAS,UAAAC,MAAc,gBACvB,OAAS,WAAAC,EAAS,YAAAC,MAAgB,QAElC,OAAS,YAAAC,MAAmD,SAC5D,OAAS,cAAAC,MAAkB,eAC3B,OAAS,qBAAAC,MAAyB,sBAClC,OAAS,MAAAC,MAAU,yBAEZ,MAAMC,EAA0B,CAAC,CACtC,KAAAC,EACA,SAAAC,EACA,UAAAC,EACA,cAAAC,EACA,WAAAC,CACF,IAAoC,CAClC,KAAM,CAACC,EAAUC,CAAW,EAAIZ,EAAS,EAAK,EACxC,CAAE,QAAAa,CAAQ,EAAIV,EAAkB,EAChCW,EAAU,CAAC,CAACD,EAEZ,CAAE,QAAAE,CAAQ,EAAIb,EAAW,CAAE,KAAAI,EAAM,SAAAC,EAAU,UAAAC,EAAW,cAAAC,CAAc,CAAC,EAErEO,EAAOjB,EAAQ,IAAM,CACzB,MAAMiB,EAAOV,EAAK,KACf,IAAIW,GAAQ,CACX,GAAI,CAACF,EAAQE,EAAK,EAA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AA0B,EAAK,YACR,IAhCGA,EAAK,EAkCZ,CACD,EACA,CAACN,GACAtB,EAAC,OACC,UAAU,iCACV,MAAO,CAAE,WAAY,kEAAmE,EACzF,GAEL,EACCsB,EACCtB,EAAC,UACC,UAAU,8CACV,QAAS,IAAM,CACbuB,EAAY,EAAK,CACnB,EAEA,SAAAvB,EAACQ,EAAA,CAAc,UAAU,kDAAkD,EAC7E,EAEAR,EAAAD,EAAA,CACE,SAAAC,EAAC,OAAI,UAAU,6EACb,SAAAA,EAAC,UAAO,UAAU,QAAQ,QAAS,IAAMuB,EAAY,CAACD,CAAQ,EAC5D,SAAAtB,EAACO,EAAA,CAAgB,UAAU,kDAAkD,EAC/E,EACF,EACF,GAEJ,GACF,EACF,CAEJ",
6
- "names": ["Fragment", "jsx", "jsxs", "Button", "Container", "Heading", "Picture", "Text", "ChevronDownIcon", "ChevronUpIcon", "motion", "useMemo", "useState", "TaskType", "useActions", "useCreditsContext", "cn", "CreditsWaysToGetCredits", "copy", "activate", "subscribe", "uploadReceipt", "classNames", "showMore", "setShowMore", "profile", "isLogin", "actions", "list", "item", "finished", "notLogin", "notFinished", "completed", "buttonLabel", "handleClick", "link", "a", "b", "section"]
3
+ "sources": ["../../../../../src/components/credits/creditsWaysToGetCredits/index.ts"],
4
+ "sourcesContent": ["export * from './type'\nexport * from './CreditsWaysToGetCredits'\n"],
5
+ "mappings": "AAAA,WAAc,SACd,WAAc",
6
+ "names": []
7
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
  };