@anker-in/campaign-ui 0.2.0 → 0.2.2-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (529) hide show
  1. package/dist/cjs/components/chat/index.js +1 -1
  2. package/dist/cjs/components/chat/index.js.map +3 -3
  3. package/dist/cjs/components/credits/context/hooks/useActivities.js +1 -1
  4. package/dist/cjs/components/credits/context/hooks/useActivities.js.map +3 -3
  5. package/dist/cjs/components/credits/context/hooks/useAlpcFetch.js +1 -1
  6. package/dist/cjs/components/credits/context/hooks/useAlpcFetch.js.map +3 -3
  7. package/dist/cjs/components/credits/context/hooks/useFunctionMemberPrice.d.ts +7 -0
  8. package/dist/cjs/components/credits/context/hooks/useFunctionMemberPrice.js +2 -0
  9. package/dist/cjs/components/credits/context/hooks/useFunctionMemberPrice.js.map +7 -0
  10. package/dist/cjs/components/credits/context/hooks/useMyRewards.js +1 -1
  11. package/dist/cjs/components/credits/context/hooks/useMyRewards.js.map +3 -3
  12. package/dist/cjs/components/credits/context/hooks/useRedeemAndBuy.js +1 -1
  13. package/dist/cjs/components/credits/context/hooks/useRedeemAndBuy.js.map +2 -2
  14. package/dist/cjs/components/credits/context/hooks/useRedeemCoupon.js +1 -1
  15. package/dist/cjs/components/credits/context/hooks/useRedeemCoupon.js.map +3 -3
  16. package/dist/cjs/components/credits/context/hooks/useRedeemProduct.js +1 -1
  17. package/dist/cjs/components/credits/context/hooks/useRedeemProduct.js.map +3 -3
  18. package/dist/cjs/components/credits/context/hooks/useRedeemableList.js +1 -1
  19. package/dist/cjs/components/credits/context/hooks/useRedeemableList.js.map +3 -3
  20. package/dist/cjs/components/credits/context/hooks/useSubscribed.js +1 -1
  21. package/dist/cjs/components/credits/context/hooks/useSubscribed.js.map +3 -3
  22. package/dist/cjs/components/credits/context/memberPriceConst.d.ts +10 -0
  23. package/dist/cjs/components/credits/context/memberPriceConst.js +2 -0
  24. package/dist/cjs/components/credits/context/memberPriceConst.js.map +7 -0
  25. package/dist/cjs/components/credits/context/memberPriceTypes.d.ts +46 -0
  26. package/dist/cjs/components/credits/context/memberPriceTypes.js +2 -0
  27. package/dist/cjs/components/credits/context/memberPriceTypes.js.map +7 -0
  28. package/dist/cjs/components/credits/context/provider.d.ts +11 -33
  29. package/dist/cjs/components/credits/context/provider.js +1 -1
  30. package/dist/cjs/components/credits/context/provider.js.map +3 -3
  31. package/dist/cjs/components/credits/context/utils/atobID.d.ts +1 -0
  32. package/dist/cjs/components/credits/context/utils/atobID.js +2 -0
  33. package/dist/cjs/components/credits/context/utils/atobID.js.map +7 -0
  34. package/dist/cjs/components/credits/context/utils/functionDiscountCalculate.d.ts +5 -0
  35. package/dist/cjs/components/credits/context/utils/functionDiscountCalculate.js +2 -0
  36. package/dist/cjs/components/credits/context/utils/functionDiscountCalculate.js.map +7 -0
  37. package/dist/cjs/components/credits/context/utils/getFunctionMemberPrice.d.ts +8 -0
  38. package/dist/cjs/components/credits/context/utils/getFunctionMemberPrice.js +2 -0
  39. package/dist/cjs/components/credits/context/utils/getFunctionMemberPrice.js.map +7 -0
  40. package/dist/cjs/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.d.ts +9 -0
  41. package/dist/cjs/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.js +2 -0
  42. package/dist/cjs/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.js.map +7 -0
  43. package/dist/cjs/components/credits/context/utils/variantGetCoupon.d.ts +6 -0
  44. package/dist/cjs/components/credits/context/utils/variantGetCoupon.js +2 -0
  45. package/dist/cjs/components/credits/context/utils/variantGetCoupon.js.map +7 -0
  46. package/dist/cjs/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.d.ts +4 -0
  47. package/dist/cjs/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.js +2 -0
  48. package/dist/cjs/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.js.map +7 -0
  49. package/dist/cjs/components/credits/creditsAnkersolixTask/index.d.ts +2 -0
  50. package/dist/cjs/components/credits/creditsAnkersolixTask/index.js +2 -0
  51. package/dist/cjs/components/credits/creditsAnkersolixTask/index.js.map +7 -0
  52. package/dist/cjs/components/credits/creditsAnkersolixTask/type.d.ts +1 -0
  53. package/dist/cjs/components/credits/creditsAnkersolixTask/type.js +2 -0
  54. package/dist/cjs/components/credits/creditsAnkersolixTask/type.js.map +7 -0
  55. package/dist/cjs/components/credits/creditsBanner/index.d.ts +17 -16
  56. package/dist/cjs/components/credits/creditsBanner/index.js +1 -1
  57. package/dist/cjs/components/credits/creditsBanner/index.js.map +3 -3
  58. package/dist/cjs/components/credits/creditsBenefits/benefitItem.d.ts +4 -1
  59. package/dist/cjs/components/credits/creditsBenefits/benefitItem.js +2 -2
  60. package/dist/cjs/components/credits/creditsBenefits/benefitItem.js.map +4 -4
  61. package/dist/cjs/components/credits/creditsBenefits/iconInfo.js +1 -1
  62. package/dist/cjs/components/credits/creditsBenefits/iconInfo.js.map +2 -2
  63. package/dist/cjs/components/credits/creditsBenefits/index.d.ts +12 -9
  64. package/dist/cjs/components/credits/creditsBenefits/index.js +3 -3
  65. package/dist/cjs/components/credits/creditsBenefits/index.js.map +3 -3
  66. package/dist/cjs/components/credits/creditsCash/CreditsCash.d.ts +5 -0
  67. package/dist/cjs/components/credits/creditsCash/CreditsCash.js +2 -0
  68. package/dist/cjs/components/credits/creditsCash/CreditsCash.js.map +7 -0
  69. package/dist/cjs/components/credits/creditsCash/RedeemableItem.d.ts +1 -5
  70. package/dist/cjs/components/credits/creditsCash/RedeemableItem.js +1 -1
  71. package/dist/cjs/components/credits/creditsCash/RedeemableItem.js.map +3 -3
  72. package/dist/cjs/components/credits/creditsCash/index.d.ts +2 -11
  73. package/dist/cjs/components/credits/creditsCash/index.js +1 -1
  74. package/dist/cjs/components/credits/creditsCash/index.js.map +4 -4
  75. package/dist/cjs/components/credits/creditsCash/type.d.ts +1 -3
  76. package/dist/cjs/components/credits/creditsCash/type.js +1 -1
  77. package/dist/cjs/components/credits/creditsCash/type.js.map +1 -1
  78. package/dist/cjs/components/credits/creditsFaq/faqItem/FaqItem.js +1 -1
  79. package/dist/cjs/components/credits/creditsFaq/faqItem/FaqItem.js.map +3 -3
  80. package/dist/cjs/components/credits/creditsFaq/index.d.ts +4 -3
  81. package/dist/cjs/components/credits/creditsFaq/index.js +1 -1
  82. package/dist/cjs/components/credits/creditsFaq/index.js.map +3 -3
  83. package/dist/cjs/components/credits/creditsInfoCard/index.d.ts +10 -15
  84. package/dist/cjs/components/credits/creditsInfoCard/index.js +1 -1
  85. package/dist/cjs/components/credits/creditsInfoCard/index.js.map +3 -3
  86. package/dist/cjs/components/credits/creditsMemberPrice/CreditsMemberPrice.d.ts +5 -0
  87. package/dist/cjs/components/credits/creditsMemberPrice/CreditsMemberPrice.js +2 -0
  88. package/dist/cjs/components/credits/creditsMemberPrice/CreditsMemberPrice.js.map +7 -0
  89. package/dist/cjs/components/credits/creditsMemberPrice/MemberPriceItem.d.ts +7 -0
  90. package/dist/cjs/components/credits/creditsMemberPrice/MemberPriceItem.js +2 -0
  91. package/dist/cjs/components/credits/creditsMemberPrice/MemberPriceItem.js.map +7 -0
  92. package/dist/cjs/components/credits/creditsMemberPrice/index.d.ts +2 -0
  93. package/dist/cjs/components/credits/creditsMemberPrice/index.js +2 -0
  94. package/dist/cjs/components/credits/creditsMemberPrice/index.js.map +7 -0
  95. package/dist/cjs/components/credits/creditsMemberPrice/type.d.ts +64 -0
  96. package/dist/cjs/components/credits/creditsMemberPrice/type.js +2 -0
  97. package/dist/cjs/components/credits/creditsMemberPrice/type.js.map +7 -0
  98. package/dist/cjs/components/credits/creditsNavigation/CreditsNavigation.d.ts +4 -0
  99. package/dist/cjs/components/credits/creditsNavigation/CreditsNavigation.js +2 -0
  100. package/dist/cjs/components/credits/creditsNavigation/CreditsNavigation.js.map +7 -0
  101. package/dist/cjs/components/credits/creditsNavigation/index.d.ts +2 -0
  102. package/dist/cjs/components/credits/creditsNavigation/index.js +2 -0
  103. package/dist/cjs/components/credits/creditsNavigation/index.js.map +7 -0
  104. package/dist/cjs/components/credits/creditsNavigation/type.d.ts +7 -0
  105. package/dist/cjs/components/credits/creditsNavigation/type.js +2 -0
  106. package/dist/cjs/components/credits/creditsNavigation/type.js.map +7 -0
  107. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/CountrySelect.js +1 -1
  108. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/CountrySelect.js.map +3 -3
  109. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/StateSelect.js +1 -1
  110. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/StateSelect.js.map +3 -3
  111. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/index.js +1 -1
  112. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/index.js.map +3 -3
  113. package/dist/cjs/components/credits/creditsRedeemList/CreditsRedeemList.d.ts +5 -0
  114. package/dist/cjs/components/credits/creditsRedeemList/CreditsRedeemList.js +2 -0
  115. package/dist/cjs/components/credits/creditsRedeemList/CreditsRedeemList.js.map +7 -0
  116. package/dist/cjs/components/credits/creditsRedeemList/NonProductValue.d.ts +1 -3
  117. package/dist/cjs/components/credits/creditsRedeemList/NonProductValue.js +1 -1
  118. package/dist/cjs/components/credits/creditsRedeemList/NonProductValue.js.map +3 -3
  119. package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.js +1 -1
  120. package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.js.map +3 -3
  121. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.js +1 -1
  122. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.js.map +3 -3
  123. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Error.js +1 -1
  124. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Error.js.map +2 -2
  125. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Init.js +1 -1
  126. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Init.js.map +3 -3
  127. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js +1 -1
  128. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js.map +3 -3
  129. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js +1 -1
  130. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js.map +3 -3
  131. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.js +1 -1
  132. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.js.map +3 -3
  133. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.js +1 -1
  134. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.js.map +3 -3
  135. package/dist/cjs/components/credits/creditsRedeemList/RedeemableItem.js +1 -1
  136. package/dist/cjs/components/credits/creditsRedeemList/RedeemableItem.js.map +3 -3
  137. package/dist/cjs/components/credits/creditsRedeemList/index.d.ts +2 -12
  138. package/dist/cjs/components/credits/creditsRedeemList/index.js +1 -1
  139. package/dist/cjs/components/credits/creditsRedeemList/index.js.map +4 -4
  140. package/dist/cjs/components/credits/creditsRedeemList/type.d.ts +2 -15
  141. package/dist/cjs/components/credits/creditsRedeemList/type.js.map +1 -1
  142. package/dist/cjs/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.d.ts +4 -0
  143. package/dist/cjs/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js +2 -0
  144. package/dist/cjs/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js.map +7 -0
  145. package/dist/cjs/components/credits/creditsWaysToGetCredits/index.d.ts +2 -2
  146. package/dist/cjs/components/credits/creditsWaysToGetCredits/index.js +1 -1
  147. package/dist/cjs/components/credits/creditsWaysToGetCredits/index.js.map +4 -4
  148. package/dist/cjs/components/credits/creditsWaysToGetCredits/type.d.ts +5 -15
  149. package/dist/cjs/components/credits/creditsWaysToGetCredits/type.js +1 -1
  150. package/dist/cjs/components/credits/creditsWaysToGetCredits/type.js.map +2 -2
  151. package/dist/cjs/components/credits/creditsWaysToGetCredits/useActions.d.ts +11 -2
  152. package/dist/cjs/components/credits/creditsWaysToGetCredits/useActions.js +1 -1
  153. package/dist/cjs/components/credits/creditsWaysToGetCredits/useActions.js.map +3 -3
  154. package/dist/cjs/components/credits/modal/MyRewardsModal.js +1 -1
  155. package/dist/cjs/components/credits/modal/MyRewardsModal.js.map +3 -3
  156. package/dist/cjs/components/credits/modal/activitiesModal.js +1 -1
  157. package/dist/cjs/components/credits/modal/activitiesModal.js.map +3 -3
  158. package/dist/cjs/components/credits/modal/creditsUploadReceiptModal.js +1 -1
  159. package/dist/cjs/components/credits/modal/creditsUploadReceiptModal.js.map +3 -3
  160. package/dist/cjs/components/credits/modal/modalContainer.js +1 -1
  161. package/dist/cjs/components/credits/modal/modalContainer.js.map +3 -3
  162. package/dist/cjs/components/credits/modal/rulesModal.js +1 -1
  163. package/dist/cjs/components/credits/modal/rulesModal.js.map +3 -3
  164. package/dist/cjs/components/credits/modal/subscribeModal.d.ts +15 -0
  165. package/dist/cjs/components/credits/modal/subscribeModal.js +2 -0
  166. package/dist/cjs/components/credits/modal/subscribeModal.js.map +7 -0
  167. package/dist/cjs/components/credits/modal/tip.js +1 -1
  168. package/dist/cjs/components/credits/modal/tip.js.map +3 -3
  169. package/dist/cjs/components/credits/type.d.ts +23 -4
  170. package/dist/cjs/components/credits/type.js +1 -1
  171. package/dist/cjs/components/credits/type.js.map +1 -1
  172. package/dist/cjs/components/index.d.ts +1 -0
  173. package/dist/cjs/components/index.js +1 -1
  174. package/dist/cjs/components/index.js.map +2 -2
  175. package/dist/cjs/components/registration/authCodeActivate/Message.js +1 -1
  176. package/dist/cjs/components/registration/authCodeActivate/Message.js.map +2 -2
  177. package/dist/cjs/components/registration/authCodeActivate/index.js +1 -1
  178. package/dist/cjs/components/registration/authCodeActivate/index.js.map +3 -3
  179. package/dist/cjs/components/registration/authCodeActivate/type.d.ts +1 -2
  180. package/dist/cjs/components/registration/authCodeActivate/type.js +1 -1
  181. package/dist/cjs/components/registration/authCodeActivate/type.js.map +1 -1
  182. package/dist/cjs/components/registration/context/index.d.ts +1 -0
  183. package/dist/cjs/components/registration/context/index.js +2 -0
  184. package/dist/cjs/components/registration/context/index.js.map +7 -0
  185. package/dist/cjs/components/registration/context/provider.d.ts +27 -0
  186. package/dist/cjs/components/registration/context/provider.js +2 -0
  187. package/dist/cjs/components/registration/context/provider.js.map +7 -0
  188. package/dist/cjs/components/registration/index.d.ts +1 -0
  189. package/dist/cjs/components/registration/index.js +1 -1
  190. package/dist/cjs/components/registration/index.js.map +2 -2
  191. package/dist/cjs/components/registration/modalContainer.d.ts +1 -2
  192. package/dist/cjs/components/registration/modalContainer.js +1 -1
  193. package/dist/cjs/components/registration/modalContainer.js.map +3 -3
  194. package/dist/cjs/index.d.ts +2 -1
  195. package/dist/cjs/index.js +1 -1
  196. package/dist/cjs/index.js.map +2 -2
  197. package/dist/cjs/templates/credits.d.ts +73 -0
  198. package/dist/cjs/templates/credits.js +2 -0
  199. package/dist/cjs/templates/credits.js.map +7 -0
  200. package/dist/cjs/templates/index.d.ts +1 -0
  201. package/dist/cjs/templates/index.js +2 -0
  202. package/dist/cjs/templates/index.js.map +7 -0
  203. package/dist/esm/components/chat/index.js +1 -1
  204. package/dist/esm/components/chat/index.js.map +2 -2
  205. package/dist/esm/components/credits/context/hooks/useActivities.js +1 -1
  206. package/dist/esm/components/credits/context/hooks/useActivities.js.map +3 -3
  207. package/dist/esm/components/credits/context/hooks/useAlpcFetch.js +1 -1
  208. package/dist/esm/components/credits/context/hooks/useAlpcFetch.js.map +3 -3
  209. package/dist/esm/components/credits/context/hooks/useFunctionMemberPrice.d.ts +7 -0
  210. package/dist/esm/components/credits/context/hooks/useFunctionMemberPrice.js +2 -0
  211. package/dist/esm/components/credits/context/hooks/useFunctionMemberPrice.js.map +7 -0
  212. package/dist/esm/components/credits/context/hooks/useMyRewards.js +1 -1
  213. package/dist/esm/components/credits/context/hooks/useMyRewards.js.map +3 -3
  214. package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.js +1 -1
  215. package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.js.map +2 -2
  216. package/dist/esm/components/credits/context/hooks/useRedeemCoupon.js +1 -1
  217. package/dist/esm/components/credits/context/hooks/useRedeemCoupon.js.map +3 -3
  218. package/dist/esm/components/credits/context/hooks/useRedeemProduct.js +1 -1
  219. package/dist/esm/components/credits/context/hooks/useRedeemProduct.js.map +3 -3
  220. package/dist/esm/components/credits/context/hooks/useRedeemableList.js +1 -1
  221. package/dist/esm/components/credits/context/hooks/useRedeemableList.js.map +3 -3
  222. package/dist/esm/components/credits/context/hooks/useSubscribed.js +1 -1
  223. package/dist/esm/components/credits/context/hooks/useSubscribed.js.map +3 -3
  224. package/dist/esm/components/credits/context/memberPriceConst.d.ts +10 -0
  225. package/dist/esm/components/credits/context/memberPriceConst.js +2 -0
  226. package/dist/esm/components/credits/context/memberPriceConst.js.map +7 -0
  227. package/dist/esm/components/credits/context/memberPriceTypes.d.ts +46 -0
  228. package/dist/esm/components/credits/context/memberPriceTypes.js +1 -0
  229. package/dist/esm/components/credits/context/memberPriceTypes.js.map +7 -0
  230. package/dist/esm/components/credits/context/provider.d.ts +11 -33
  231. package/dist/esm/components/credits/context/provider.js +1 -1
  232. package/dist/esm/components/credits/context/provider.js.map +3 -3
  233. package/dist/esm/components/credits/context/utils/atobID.d.ts +1 -0
  234. package/dist/esm/components/credits/context/utils/atobID.js +2 -0
  235. package/dist/esm/components/credits/context/utils/atobID.js.map +7 -0
  236. package/dist/esm/components/credits/context/utils/functionDiscountCalculate.d.ts +5 -0
  237. package/dist/esm/components/credits/context/utils/functionDiscountCalculate.js +2 -0
  238. package/dist/esm/components/credits/context/utils/functionDiscountCalculate.js.map +7 -0
  239. package/dist/esm/components/credits/context/utils/getFunctionMemberPrice.d.ts +8 -0
  240. package/dist/esm/components/credits/context/utils/getFunctionMemberPrice.js +2 -0
  241. package/dist/esm/components/credits/context/utils/getFunctionMemberPrice.js.map +7 -0
  242. package/dist/esm/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.d.ts +9 -0
  243. package/dist/esm/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.js +2 -0
  244. package/dist/esm/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.js.map +7 -0
  245. package/dist/esm/components/credits/context/utils/variantGetCoupon.d.ts +6 -0
  246. package/dist/esm/components/credits/context/utils/variantGetCoupon.js +2 -0
  247. package/dist/esm/components/credits/context/utils/variantGetCoupon.js.map +7 -0
  248. package/dist/esm/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.d.ts +4 -0
  249. package/dist/esm/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.js +2 -0
  250. package/dist/esm/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.js.map +7 -0
  251. package/dist/esm/components/credits/creditsAnkersolixTask/index.d.ts +2 -0
  252. package/dist/esm/components/credits/creditsAnkersolixTask/index.js +2 -0
  253. package/dist/esm/components/credits/creditsAnkersolixTask/index.js.map +7 -0
  254. package/dist/esm/components/credits/creditsAnkersolixTask/type.d.ts +1 -0
  255. package/dist/esm/components/credits/creditsAnkersolixTask/type.js +2 -0
  256. package/dist/esm/components/credits/creditsAnkersolixTask/type.js.map +7 -0
  257. package/dist/esm/components/credits/creditsBanner/index.d.ts +17 -16
  258. package/dist/esm/components/credits/creditsBanner/index.js +1 -1
  259. package/dist/esm/components/credits/creditsBanner/index.js.map +3 -3
  260. package/dist/esm/components/credits/creditsBenefits/benefitItem.d.ts +4 -1
  261. package/dist/esm/components/credits/creditsBenefits/benefitItem.js +2 -2
  262. package/dist/esm/components/credits/creditsBenefits/benefitItem.js.map +4 -4
  263. package/dist/esm/components/credits/creditsBenefits/iconInfo.js +1 -1
  264. package/dist/esm/components/credits/creditsBenefits/iconInfo.js.map +2 -2
  265. package/dist/esm/components/credits/creditsBenefits/index.d.ts +12 -9
  266. package/dist/esm/components/credits/creditsBenefits/index.js +3 -3
  267. package/dist/esm/components/credits/creditsBenefits/index.js.map +3 -3
  268. package/dist/esm/components/credits/creditsCash/CreditsCash.d.ts +5 -0
  269. package/dist/esm/components/credits/creditsCash/CreditsCash.js +2 -0
  270. package/dist/esm/components/credits/creditsCash/CreditsCash.js.map +7 -0
  271. package/dist/esm/components/credits/creditsCash/RedeemableItem.d.ts +1 -5
  272. package/dist/esm/components/credits/creditsCash/RedeemableItem.js +1 -1
  273. package/dist/esm/components/credits/creditsCash/RedeemableItem.js.map +3 -3
  274. package/dist/esm/components/credits/creditsCash/index.d.ts +2 -11
  275. package/dist/esm/components/credits/creditsCash/index.js +1 -1
  276. package/dist/esm/components/credits/creditsCash/index.js.map +4 -4
  277. package/dist/esm/components/credits/creditsCash/type.d.ts +1 -3
  278. package/dist/esm/components/credits/creditsFaq/faqItem/FaqItem.js +1 -1
  279. package/dist/esm/components/credits/creditsFaq/faqItem/FaqItem.js.map +2 -2
  280. package/dist/esm/components/credits/creditsFaq/index.d.ts +4 -3
  281. package/dist/esm/components/credits/creditsFaq/index.js +1 -1
  282. package/dist/esm/components/credits/creditsFaq/index.js.map +3 -3
  283. package/dist/esm/components/credits/creditsInfoCard/index.d.ts +10 -15
  284. package/dist/esm/components/credits/creditsInfoCard/index.js +1 -1
  285. package/dist/esm/components/credits/creditsInfoCard/index.js.map +3 -3
  286. package/dist/esm/components/credits/creditsMemberPrice/CreditsMemberPrice.d.ts +5 -0
  287. package/dist/esm/components/credits/creditsMemberPrice/CreditsMemberPrice.js +2 -0
  288. package/dist/esm/components/credits/creditsMemberPrice/CreditsMemberPrice.js.map +7 -0
  289. package/dist/esm/components/credits/creditsMemberPrice/MemberPriceItem.d.ts +7 -0
  290. package/dist/esm/components/credits/creditsMemberPrice/MemberPriceItem.js +2 -0
  291. package/dist/esm/components/credits/creditsMemberPrice/MemberPriceItem.js.map +7 -0
  292. package/dist/esm/components/credits/creditsMemberPrice/index.d.ts +2 -0
  293. package/dist/esm/components/credits/creditsMemberPrice/index.js +2 -0
  294. package/dist/esm/components/credits/creditsMemberPrice/index.js.map +7 -0
  295. package/dist/esm/components/credits/creditsMemberPrice/type.d.ts +64 -0
  296. package/dist/esm/components/credits/creditsMemberPrice/type.js +1 -0
  297. package/dist/esm/components/credits/creditsMemberPrice/type.js.map +7 -0
  298. package/dist/esm/components/credits/creditsNavigation/CreditsNavigation.d.ts +4 -0
  299. package/dist/esm/components/credits/creditsNavigation/CreditsNavigation.js +2 -0
  300. package/dist/esm/components/credits/creditsNavigation/CreditsNavigation.js.map +7 -0
  301. package/dist/esm/components/credits/creditsNavigation/index.d.ts +2 -0
  302. package/dist/esm/components/credits/creditsNavigation/index.js +2 -0
  303. package/dist/esm/components/credits/creditsNavigation/index.js.map +7 -0
  304. package/dist/esm/components/credits/creditsNavigation/type.d.ts +7 -0
  305. package/dist/esm/components/credits/creditsNavigation/type.js +1 -0
  306. package/dist/esm/components/credits/creditsNavigation/type.js.map +7 -0
  307. package/dist/esm/components/credits/creditsRedeemList/AddressForm/CountrySelect.js +1 -1
  308. package/dist/esm/components/credits/creditsRedeemList/AddressForm/CountrySelect.js.map +3 -3
  309. package/dist/esm/components/credits/creditsRedeemList/AddressForm/StateSelect.js +1 -1
  310. package/dist/esm/components/credits/creditsRedeemList/AddressForm/StateSelect.js.map +3 -3
  311. package/dist/esm/components/credits/creditsRedeemList/AddressForm/index.js +1 -1
  312. package/dist/esm/components/credits/creditsRedeemList/AddressForm/index.js.map +3 -3
  313. package/dist/esm/components/credits/creditsRedeemList/CreditsRedeemList.d.ts +5 -0
  314. package/dist/esm/components/credits/creditsRedeemList/CreditsRedeemList.js +2 -0
  315. package/dist/esm/components/credits/creditsRedeemList/CreditsRedeemList.js.map +7 -0
  316. package/dist/esm/components/credits/creditsRedeemList/NonProductValue.d.ts +1 -3
  317. package/dist/esm/components/credits/creditsRedeemList/NonProductValue.js +1 -1
  318. package/dist/esm/components/credits/creditsRedeemList/NonProductValue.js.map +3 -3
  319. package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.js +1 -1
  320. package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.js.map +3 -3
  321. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.js +1 -1
  322. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.js.map +3 -3
  323. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Error.js +1 -1
  324. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Error.js.map +2 -2
  325. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.js +1 -1
  326. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.js.map +3 -3
  327. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js +1 -1
  328. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js.map +3 -3
  329. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js +1 -1
  330. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js.map +3 -3
  331. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.js +1 -1
  332. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.js.map +3 -3
  333. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.js +1 -1
  334. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.js.map +3 -3
  335. package/dist/esm/components/credits/creditsRedeemList/RedeemableItem.js +1 -1
  336. package/dist/esm/components/credits/creditsRedeemList/RedeemableItem.js.map +3 -3
  337. package/dist/esm/components/credits/creditsRedeemList/index.d.ts +2 -12
  338. package/dist/esm/components/credits/creditsRedeemList/index.js +1 -1
  339. package/dist/esm/components/credits/creditsRedeemList/index.js.map +4 -4
  340. package/dist/esm/components/credits/creditsRedeemList/type.d.ts +2 -15
  341. package/dist/esm/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.d.ts +4 -0
  342. package/dist/esm/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js +2 -0
  343. package/dist/esm/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js.map +7 -0
  344. package/dist/esm/components/credits/creditsWaysToGetCredits/index.d.ts +2 -2
  345. package/dist/esm/components/credits/creditsWaysToGetCredits/index.js +1 -1
  346. package/dist/esm/components/credits/creditsWaysToGetCredits/index.js.map +4 -4
  347. package/dist/esm/components/credits/creditsWaysToGetCredits/type.d.ts +5 -15
  348. package/dist/esm/components/credits/creditsWaysToGetCredits/type.js.map +2 -2
  349. package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.d.ts +11 -2
  350. package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.js +1 -1
  351. package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.js.map +3 -3
  352. package/dist/esm/components/credits/modal/MyRewardsModal.js +1 -1
  353. package/dist/esm/components/credits/modal/MyRewardsModal.js.map +3 -3
  354. package/dist/esm/components/credits/modal/activitiesModal.js +1 -1
  355. package/dist/esm/components/credits/modal/activitiesModal.js.map +3 -3
  356. package/dist/esm/components/credits/modal/creditsUploadReceiptModal.js +1 -1
  357. package/dist/esm/components/credits/modal/creditsUploadReceiptModal.js.map +3 -3
  358. package/dist/esm/components/credits/modal/modalContainer.js +1 -1
  359. package/dist/esm/components/credits/modal/modalContainer.js.map +3 -3
  360. package/dist/esm/components/credits/modal/rulesModal.js +1 -1
  361. package/dist/esm/components/credits/modal/rulesModal.js.map +2 -2
  362. package/dist/esm/components/credits/modal/subscribeModal.d.ts +15 -0
  363. package/dist/esm/components/credits/modal/subscribeModal.js +2 -0
  364. package/dist/esm/components/credits/modal/subscribeModal.js.map +7 -0
  365. package/dist/esm/components/credits/modal/tip.js +1 -1
  366. package/dist/esm/components/credits/modal/tip.js.map +3 -3
  367. package/dist/esm/components/credits/type.d.ts +23 -4
  368. package/dist/esm/components/index.d.ts +1 -0
  369. package/dist/esm/components/index.js +1 -1
  370. package/dist/esm/components/index.js.map +2 -2
  371. package/dist/esm/components/registration/authCodeActivate/Message.js +1 -1
  372. package/dist/esm/components/registration/authCodeActivate/Message.js.map +2 -2
  373. package/dist/esm/components/registration/authCodeActivate/index.js +1 -1
  374. package/dist/esm/components/registration/authCodeActivate/index.js.map +3 -3
  375. package/dist/esm/components/registration/authCodeActivate/type.d.ts +1 -2
  376. package/dist/esm/components/registration/context/index.d.ts +1 -0
  377. package/dist/esm/components/registration/context/index.js +2 -0
  378. package/dist/esm/components/registration/context/index.js.map +7 -0
  379. package/dist/esm/components/registration/context/provider.d.ts +27 -0
  380. package/dist/esm/components/registration/context/provider.js +2 -0
  381. package/dist/esm/components/registration/context/provider.js.map +7 -0
  382. package/dist/esm/components/registration/index.d.ts +1 -0
  383. package/dist/esm/components/registration/index.js +1 -1
  384. package/dist/esm/components/registration/index.js.map +2 -2
  385. package/dist/esm/components/registration/modalContainer.d.ts +1 -2
  386. package/dist/esm/components/registration/modalContainer.js +1 -1
  387. package/dist/esm/components/registration/modalContainer.js.map +3 -3
  388. package/dist/esm/index.d.ts +2 -1
  389. package/dist/esm/index.js +1 -1
  390. package/dist/esm/index.js.map +2 -2
  391. package/dist/esm/templates/credits.d.ts +73 -0
  392. package/dist/esm/templates/credits.js +2 -0
  393. package/dist/esm/templates/credits.js.map +7 -0
  394. package/dist/esm/templates/index.d.ts +1 -0
  395. package/dist/esm/templates/index.js +2 -0
  396. package/dist/esm/templates/index.js.map +7 -0
  397. package/dist/index.js +40660 -0
  398. package/dist/index.js.map +1 -0
  399. package/dist/index.mjs +40648 -0
  400. package/dist/index.mjs.map +1 -0
  401. package/package.json +24 -22
  402. package/src/components/chat/index.tsx +1 -1
  403. package/src/components/credits/context/hooks/useActivities.ts +3 -2
  404. package/src/components/credits/context/hooks/useAlpcFetch.ts +8 -4
  405. package/src/components/credits/context/hooks/useFunctionMemberPrice.ts +33 -0
  406. package/src/components/credits/context/hooks/useMyRewards.ts +3 -2
  407. package/src/components/credits/context/hooks/useRedeemAndBuy.ts +0 -2
  408. package/src/components/credits/context/hooks/useRedeemCoupon.ts +4 -1
  409. package/src/components/credits/context/hooks/useRedeemProduct.ts +4 -1
  410. package/src/components/credits/context/hooks/useRedeemableList.ts +3 -3
  411. package/src/components/credits/context/hooks/useSubscribed.ts +1 -2
  412. package/src/components/credits/context/memberPriceConst.ts +13 -0
  413. package/src/components/credits/context/memberPriceTypes.ts +54 -0
  414. package/src/components/credits/context/provider.tsx +25 -20
  415. package/src/components/credits/context/utils/atobID.ts +8 -0
  416. package/src/components/credits/context/utils/functionDiscountCalculate.ts +57 -0
  417. package/src/components/credits/context/utils/getFunctionMemberPrice.ts +135 -0
  418. package/src/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.ts +51 -0
  419. package/src/components/credits/context/utils/variantGetCoupon.ts +34 -0
  420. package/src/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.tsx +270 -0
  421. package/src/components/credits/creditsAnkersolixTask/index.ts +2 -0
  422. package/src/components/credits/creditsAnkersolixTask/type.ts +7 -0
  423. package/src/components/credits/creditsBanner/index.tsx +15 -17
  424. package/src/components/credits/creditsBenefits/BenefitItem.tsx +107 -0
  425. package/src/components/credits/creditsBenefits/index.tsx +17 -12
  426. package/src/components/credits/creditsCash/{index.tsx → CreditsCash.tsx} +11 -27
  427. package/src/components/credits/creditsCash/RedeemableItem.tsx +43 -21
  428. package/src/components/credits/creditsCash/index.ts +2 -0
  429. package/src/components/credits/creditsCash/type.ts +1 -3
  430. package/src/components/credits/creditsFaq/faqItem/FaqItem.tsx +12 -12
  431. package/src/components/credits/creditsFaq/index.tsx +7 -5
  432. package/src/components/credits/creditsInfoCard/index.tsx +39 -34
  433. package/src/components/credits/creditsMemberPrice/CreditsMemberPrice.tsx +389 -0
  434. package/src/components/credits/creditsMemberPrice/MemberPriceItem.tsx +158 -0
  435. package/src/components/credits/creditsMemberPrice/index.ts +2 -0
  436. package/src/components/credits/creditsMemberPrice/type.ts +75 -0
  437. package/src/components/credits/creditsNavigation/CreditsNavigation.tsx +123 -0
  438. package/src/components/credits/creditsNavigation/index.ts +2 -0
  439. package/src/components/credits/creditsNavigation/type.ts +10 -0
  440. package/src/components/credits/creditsRedeemList/AddressForm/CountrySelect.tsx +7 -3
  441. package/src/components/credits/creditsRedeemList/AddressForm/StateSelect.tsx +5 -1
  442. package/src/components/credits/creditsRedeemList/AddressForm/index.tsx +5 -4
  443. package/src/components/credits/creditsRedeemList/{index.tsx → CreditsRedeemList.tsx} +30 -29
  444. package/src/components/credits/creditsRedeemList/NonProductValue.tsx +4 -3
  445. package/src/components/credits/creditsRedeemList/RedeemCouponModal.tsx +6 -6
  446. package/src/components/credits/creditsRedeemList/RedeemProductModal/Address.tsx +14 -11
  447. package/src/components/credits/creditsRedeemList/RedeemProductModal/Error.tsx +1 -1
  448. package/src/components/credits/creditsRedeemList/RedeemProductModal/Init.tsx +4 -2
  449. package/src/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.tsx +3 -1
  450. package/src/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.tsx +9 -5
  451. package/src/components/credits/creditsRedeemList/RedeemProductModal/Success.tsx +4 -1
  452. package/src/components/credits/creditsRedeemList/RedeemProductModal/index.tsx +2 -2
  453. package/src/components/credits/creditsRedeemList/RedeemableItem.tsx +11 -7
  454. package/src/components/credits/creditsRedeemList/index.ts +2 -0
  455. package/src/components/credits/creditsRedeemList/type.ts +2 -16
  456. package/src/components/credits/creditsWaysToGetCredits/{index.tsx → CreditsWaysToGetCredits.tsx} +65 -16
  457. package/src/components/credits/creditsWaysToGetCredits/index.ts +2 -0
  458. package/src/components/credits/creditsWaysToGetCredits/type.ts +5 -15
  459. package/src/components/credits/creditsWaysToGetCredits/useActions.ts +22 -8
  460. package/src/components/credits/modal/MyRewardsModal.tsx +10 -2
  461. package/src/components/credits/modal/activitiesModal.tsx +8 -3
  462. package/src/components/credits/modal/creditsUploadReceiptModal.tsx +9 -1
  463. package/src/components/credits/modal/modalContainer.tsx +5 -1
  464. package/src/components/credits/modal/rulesModal.tsx +1 -1
  465. package/src/components/credits/modal/subscribeModal.tsx +201 -0
  466. package/src/components/credits/modal/tip.tsx +10 -1
  467. package/src/components/credits/type.ts +23 -4
  468. package/src/components/index.ts +2 -2
  469. package/src/components/registration/authCodeActivate/Message.tsx +43 -0
  470. package/src/components/registration/authCodeActivate/index.tsx +338 -0
  471. package/src/components/registration/authCodeActivate/type.ts +23 -0
  472. package/src/components/registration/context/index.tsx +1 -0
  473. package/src/components/registration/context/provider.tsx +86 -0
  474. package/src/components/registration/index.ts +2 -0
  475. package/src/components/registration/modalContainer.tsx +114 -0
  476. package/src/index.ts +2 -1
  477. package/src/templates/Credits.tsx +165 -0
  478. package/src/templates/index.ts +1 -0
  479. package/dist/cjs/components/credits/context/hooks/useSendEmailValidation.d.ts +0 -1
  480. package/dist/cjs/components/credits/context/hooks/useSendEmailValidation.js +0 -2
  481. package/dist/cjs/components/credits/context/hooks/useSendEmailValidation.js.map +0 -7
  482. package/dist/cjs/components/credits/context/hooks/useSubscriptions.d.ts +0 -9
  483. package/dist/cjs/components/credits/context/hooks/useSubscriptions.js +0 -2
  484. package/dist/cjs/components/credits/context/hooks/useSubscriptions.js.map +0 -7
  485. package/dist/cjs/helpers/fetchResponse.d.ts +0 -14
  486. package/dist/cjs/helpers/fetchResponse.js +0 -2
  487. package/dist/cjs/helpers/fetchResponse.js.map +0 -7
  488. package/dist/cjs/helpers/fetcher.d.ts +0 -2
  489. package/dist/cjs/helpers/fetcher.js +0 -2
  490. package/dist/cjs/helpers/fetcher.js.map +0 -7
  491. package/dist/cjs/helpers/index.d.ts +0 -2
  492. package/dist/cjs/helpers/index.js +0 -2
  493. package/dist/cjs/helpers/index.js.map +0 -7
  494. package/dist/cjs/helpers/track.d.ts +0 -19
  495. package/dist/cjs/helpers/track.js +0 -2
  496. package/dist/cjs/helpers/track.js.map +0 -7
  497. package/dist/cjs/helpers/utils.d.ts +0 -3
  498. package/dist/cjs/helpers/utils.js +0 -2
  499. package/dist/cjs/helpers/utils.js.map +0 -7
  500. package/dist/esm/components/credits/context/hooks/useSendEmailValidation.d.ts +0 -1
  501. package/dist/esm/components/credits/context/hooks/useSendEmailValidation.js +0 -2
  502. package/dist/esm/components/credits/context/hooks/useSendEmailValidation.js.map +0 -7
  503. package/dist/esm/components/credits/context/hooks/useSubscriptions.d.ts +0 -9
  504. package/dist/esm/components/credits/context/hooks/useSubscriptions.js +0 -2
  505. package/dist/esm/components/credits/context/hooks/useSubscriptions.js.map +0 -7
  506. package/dist/esm/helpers/fetchResponse.d.ts +0 -14
  507. package/dist/esm/helpers/fetchResponse.js +0 -2
  508. package/dist/esm/helpers/fetchResponse.js.map +0 -7
  509. package/dist/esm/helpers/fetcher.d.ts +0 -2
  510. package/dist/esm/helpers/fetcher.js +0 -2
  511. package/dist/esm/helpers/fetcher.js.map +0 -7
  512. package/dist/esm/helpers/index.d.ts +0 -2
  513. package/dist/esm/helpers/index.js +0 -2
  514. package/dist/esm/helpers/index.js.map +0 -7
  515. package/dist/esm/helpers/track.d.ts +0 -19
  516. package/dist/esm/helpers/track.js +0 -2
  517. package/dist/esm/helpers/track.js.map +0 -7
  518. package/dist/esm/helpers/utils.d.ts +0 -3
  519. package/dist/esm/helpers/utils.js +0 -2
  520. package/dist/esm/helpers/utils.js.map +0 -7
  521. package/src/components/credits/context/hooks/useSendEmailValidation.ts +0 -20
  522. package/src/components/credits/context/hooks/useSubscriptions.ts +0 -29
  523. package/src/components/credits/creditsBenefits/benefitItem.tsx +0 -73
  524. package/src/helpers/fetchResponse.ts +0 -35
  525. package/src/helpers/fetcher.ts +0 -44
  526. package/src/helpers/index.ts +0 -2
  527. package/src/helpers/track.ts +0 -73
  528. package/src/helpers/utils.ts +0 -8
  529. /package/src/components/credits/creditsBenefits/{iconInfo.tsx → IconInfo.tsx} +0 -0
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/components/credits/context/hooks/useRedeemProduct.ts"],
4
- "sourcesContent": ["import { ALPC_COUNTRY_MAP } from '../const'\nimport { useAlpcMutation, type UseMutationConfig } from './useAlpcFetch'\nimport { useHeadlessContext } from '@anker-in/lib'\n\ntype RedeemProductResponse = {\n code: number\n data: {\n success: boolean\n }\n}\n\nexport const useRedeemProduct = (mutationOptions: UseMutationConfig<RedeemProductResponse> = {}) => {\n const { storeDomain, locale, appName, brand } = useHeadlessContext()\n\n return useAlpcMutation<\n RedeemProductResponse,\n {\n rule_id: number\n address: string\n }\n >(\n {\n url: `/v1/credit/exchange/goods`,\n initData: {\n quantity: 1,\n brand,\n country: (ALPC_COUNTRY_MAP.get(locale || '') || locale)?.toUpperCase(),\n domain: storeDomain,\n app_name: appName,\n },\n },\n mutationOptions\n )\n}\n"],
5
- "mappings": "AAAA,OAAS,oBAAAA,MAAwB,WACjC,OAAS,mBAAAC,MAA+C,iBACxD,OAAS,sBAAAC,MAA0B,gBAS5B,MAAMC,EAAmB,CAACC,EAA4D,CAAC,IAAM,CAClG,KAAM,CAAE,YAAAC,EAAa,OAAAC,EAAQ,QAAAC,EAAS,MAAAC,CAAM,EAAIN,EAAmB,EAEnE,OAAOD,EAOL,CACE,IAAK,4BACL,SAAU,CACR,SAAU,EACV,MAAAO,EACA,SAAUR,EAAiB,IAAIM,GAAU,EAAE,GAAKA,IAAS,YAAY,EACrE,OAAQD,EACR,SAAUE,CACZ,CACF,EACAH,CACF,CACF",
6
- "names": ["ALPC_COUNTRY_MAP", "useAlpcMutation", "useHeadlessContext", "useRedeemProduct", "mutationOptions", "storeDomain", "locale", "appName", "brand"]
4
+ "sourcesContent": ["import { ALPC_COUNTRY_MAP } from '../const'\nimport { useAlpcMutation, type UseMutationConfig } from './useAlpcFetch'\nimport { useHeadlessContext } from '@anker-in/lib'\nimport { useCreditsContext } from '../provider'\n\ntype RedeemProductResponse = {\n code: number\n data: {\n success: boolean\n }\n}\n\nexport const useRedeemProduct = (mutationOptions: UseMutationConfig<RedeemProductResponse> = {}) => {\n const { alpcBrand } = useCreditsContext()\n const { storeDomain, locale, appName, brand: headlessBrand } = useHeadlessContext()\n const brand = alpcBrand || headlessBrand\n\n return useAlpcMutation<\n RedeemProductResponse,\n {\n rule_id: number\n address: string\n }\n >(\n {\n url: `/v1/credit/exchange/goods`,\n initData: {\n quantity: 1,\n brand,\n country: (ALPC_COUNTRY_MAP.get(locale || '') || locale)?.toUpperCase(),\n domain: storeDomain,\n app_name: appName,\n },\n },\n mutationOptions\n )\n}\n"],
5
+ "mappings": "AAAA,OAAS,oBAAAA,MAAwB,WACjC,OAAS,mBAAAC,MAA+C,iBACxD,OAAS,sBAAAC,MAA0B,gBACnC,OAAS,qBAAAC,MAAyB,cAS3B,MAAMC,EAAmB,CAACC,EAA4D,CAAC,IAAM,CAClG,KAAM,CAAE,UAAAC,CAAU,EAAIH,EAAkB,EAClC,CAAE,YAAAI,EAAa,OAAAC,EAAQ,QAAAC,EAAS,MAAOC,CAAc,EAAIR,EAAmB,EAGlF,OAAOD,EAOL,CACE,IAAK,4BACL,SAAU,CACR,SAAU,EACV,MAbQK,GAAaI,EAcrB,SAAUV,EAAiB,IAAIQ,GAAU,EAAE,GAAKA,IAAS,YAAY,EACrE,OAAQD,EACR,SAAUE,CACZ,CACF,EACAJ,CACF,CACF",
6
+ "names": ["ALPC_COUNTRY_MAP", "useAlpcMutation", "useHeadlessContext", "useCreditsContext", "useRedeemProduct", "mutationOptions", "alpcBrand", "storeDomain", "locale", "appName", "headlessBrand"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{useCallback as C,useEffect as L,useState as R}from"react";import{useAlpcMutation as b}from"./useAlpcFetch";import{ALPC_COUNTRY_MAP as x}from"../const";import{useCreditsContext as y}from"../provider";import{useHeadlessContext as S}from"@anker-in/lib";function A(){let t="";const{profile:n,isLoadingProfile:c}=y(),{locale:u,brand:d}=S();u==="pl"?t="eu":t=u;const[p,_]=R([]),{isMutating:f,trigger:l}=b({url:"/v1/credit/consume_credit_rules",initData:{brand:d,page:1,page_size:20,country:(x.get(t)||t)?.toUpperCase(),task_target:1}}),s=C(()=>{l({user_id:n?.user_id},{onSuccess(g){let a=g.data.consume_credit_rules||[],o=a.filter(e=>e.consume_type==1)||[],r=a.filter(e=>e.consume_type==2)||[];o=o.sort((e,i)=>e.consume_credits-i.consume_credits),r=r.sort((e,i)=>e.consume_credits-i.consume_credits);const m=o.concat(r);_(m),localStorage?.setItem(`consume_credit_rules-${t}`,JSON.stringify({expire:Date.now()+10*60*1e3,consume_credit_rules:m}))}})},[n,l,t]);return L(()=>{c||s()},[s,c]),{listLoading:f,redeemableList:p,getRedeemableList:s}}var O=A;export{O as default};
1
+ import{useCallback as R,useEffect as b,useState as x}from"react";import{useAlpcMutation as y}from"./useAlpcFetch";import{ALPC_COUNTRY_MAP as S}from"../const";import{useCreditsContext as A}from"../provider";import{useHeadlessContext as M}from"@anker-in/lib";function P(){let t="";const{profile:n,isLoadingProfile:c,alpcBrand:m}=A(),{locale:u,brand:p}=M(),_=m||p;u==="pl"?t="eu":t=u;const[f,g]=x([]),{isMutating:C,trigger:l}=y({url:"/v1/credit/consume_credit_rules",initData:{brand:_,page:1,page_size:20,country:(S.get(t)||t)?.toUpperCase()}}),s=R(()=>{l({user_id:n?.user_id},{onSuccess(L){let a=L.data.consume_credit_rules||[],r=a.filter(e=>e.consume_type==1)||[],o=a.filter(e=>e.consume_type==2)||[];r=r.sort((e,i)=>e.consume_credits-i.consume_credits),o=o.sort((e,i)=>e.consume_credits-i.consume_credits);const d=r.concat(o);g(d),localStorage?.setItem(`consume_credit_rules-${t}`,JSON.stringify({expire:Date.now()+10*60*1e3,consume_credit_rules:d}))}})},[n,l,t]);return b(()=>{c||s()},[s,c]),{listLoading:C,redeemableList:f,getRedeemableList:s}}var h=P;export{h as default};
2
2
  //# sourceMappingURL=useRedeemableList.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/components/credits/context/hooks/useRedeemableList.ts"],
4
- "sourcesContent": ["import { useCallback, useEffect, useState } from 'react'\n\nimport { useAlpcMutation } from './useAlpcFetch'\nimport { ALPC_COUNTRY_MAP } from '../const'\nimport { useCreditsContext } from '../provider'\nimport type { ConsumeCreditRuleResponse } from '../response'\nimport { useHeadlessContext } from '@anker-in/lib'\n\nfunction useRedeemableList() {\n let locale = '' as string\n const { profile, isLoadingProfile } = useCreditsContext()\n const { locale: contextLocale, brand } = useHeadlessContext()\n\n if (contextLocale === 'pl') {\n locale = 'eu'\n } else {\n locale = contextLocale\n }\n\n const [redeemableList, setRedeemableList] = useState<ConsumeCreditRuleResponse[]>([])\n const { isMutating: listLoading, trigger } = useAlpcMutation<\n {\n data: { consume_credit_rules: ConsumeCreditRuleResponse[] }\n },\n { user_id?: string }\n >({\n url: `/v1/credit/consume_credit_rules`,\n initData: {\n brand,\n page: 1,\n page_size: 20,\n country: (ALPC_COUNTRY_MAP.get(locale) || locale)?.toUpperCase(),\n task_target: 1, // 1: 'app', 2: 'website'\n },\n })\n\n const getRedeemableList = useCallback(() => {\n trigger(\n {\n user_id: profile?.user_id,\n },\n {\n onSuccess(responseData) {\n let list = responseData.data.consume_credit_rules || []\n let cList = list.filter(i => i.consume_type == 1) || []\n let pList = list.filter(i => i.consume_type == 2) || []\n cList = cList.sort((prev, next) => prev.consume_credits - next.consume_credits)\n pList = pList.sort((prev, next) => prev.consume_credits - next.consume_credits)\n const resultList = cList.concat(pList)\n setRedeemableList(resultList)\n\n localStorage?.setItem(\n `consume_credit_rules-${locale}`,\n JSON.stringify({\n expire: Date.now() + 10 * 60 * 1000,\n consume_credit_rules: resultList,\n })\n )\n },\n }\n )\n }, [profile, trigger, locale])\n\n useEffect(() => {\n if (!isLoadingProfile) {\n getRedeemableList()\n }\n }, [getRedeemableList, isLoadingProfile])\n\n return {\n listLoading,\n redeemableList,\n getRedeemableList,\n }\n}\n\nexport default useRedeemableList\n"],
5
- "mappings": "AAAA,OAAS,eAAAA,EAAa,aAAAC,EAAW,YAAAC,MAAgB,QAEjD,OAAS,mBAAAC,MAAuB,iBAChC,OAAS,oBAAAC,MAAwB,WACjC,OAAS,qBAAAC,MAAyB,cAElC,OAAS,sBAAAC,MAA0B,gBAEnC,SAASC,GAAoB,CAC3B,IAAIC,EAAS,GACb,KAAM,CAAE,QAAAC,EAAS,iBAAAC,CAAiB,EAAIL,EAAkB,EAClD,CAAE,OAAQM,EAAe,MAAAC,CAAM,EAAIN,EAAmB,EAExDK,IAAkB,KACpBH,EAAS,KAETA,EAASG,EAGX,KAAM,CAACE,EAAgBC,CAAiB,EAAIZ,EAAsC,CAAC,CAAC,EAC9E,CAAE,WAAYa,EAAa,QAAAC,CAAQ,EAAIb,EAK3C,CACA,IAAK,kCACL,SAAU,CACR,MAAAS,EACA,KAAM,EACN,UAAW,GACX,SAAUR,EAAiB,IAAII,CAAM,GAAKA,IAAS,YAAY,EAC/D,YAAa,CACf,CACF,CAAC,EAEKS,EAAoBjB,EAAY,IAAM,CAC1CgB,EACE,CACE,QAASP,GAAS,OACpB,EACA,CACE,UAAUS,EAAc,CACtB,IAAIC,EAAOD,EAAa,KAAK,sBAAwB,CAAC,EAClDE,EAAQD,EAAK,OAAOE,GAAKA,EAAE,cAAgB,CAAC,GAAK,CAAC,EAClDC,EAAQH,EAAK,OAAOE,GAAKA,EAAE,cAAgB,CAAC,GAAK,CAAC,EACtDD,EAAQA,EAAM,KAAK,CAACG,EAAMC,IAASD,EAAK,gBAAkBC,EAAK,eAAe,EAC9EF,EAAQA,EAAM,KAAK,CAACC,EAAMC,IAASD,EAAK,gBAAkBC,EAAK,eAAe,EAC9E,MAAMC,EAAaL,EAAM,OAAOE,CAAK,EACrCR,EAAkBW,CAAU,EAE5B,cAAc,QACZ,wBAAwBjB,CAAM,GAC9B,KAAK,UAAU,CACb,OAAQ,KAAK,IAAI,EAAI,GAAK,GAAK,IAC/B,qBAAsBiB,CACxB,CAAC,CACH,CACF,CACF,CACF,CACF,EAAG,CAAChB,EAASO,EAASR,CAAM,CAAC,EAE7B,OAAAP,EAAU,IAAM,CACTS,GACHO,EAAkB,CAEtB,EAAG,CAACA,EAAmBP,CAAgB,CAAC,EAEjC,CACL,YAAAK,EACA,eAAAF,EACA,kBAAAI,CACF,CACF,CAEA,IAAOS,EAAQnB",
6
- "names": ["useCallback", "useEffect", "useState", "useAlpcMutation", "ALPC_COUNTRY_MAP", "useCreditsContext", "useHeadlessContext", "useRedeemableList", "locale", "profile", "isLoadingProfile", "contextLocale", "brand", "redeemableList", "setRedeemableList", "listLoading", "trigger", "getRedeemableList", "responseData", "list", "cList", "i", "pList", "prev", "next", "resultList", "useRedeemableList_default"]
4
+ "sourcesContent": ["import { useCallback, useEffect, useState } from 'react'\n\nimport { useAlpcMutation } from './useAlpcFetch'\nimport { ALPC_COUNTRY_MAP } from '../const'\nimport { useCreditsContext } from '../provider'\nimport type { ConsumeCreditRuleResponse } from '../response'\nimport { useHeadlessContext } from '@anker-in/lib'\n\nfunction useRedeemableList() {\n let locale = '' as string\n const { profile, isLoadingProfile, alpcBrand } = useCreditsContext()\n const { locale: contextLocale, brand: headlessBrand } = useHeadlessContext()\n const brand = alpcBrand || headlessBrand\n\n if (contextLocale === 'pl') {\n locale = 'eu'\n } else {\n locale = contextLocale\n }\n\n const [redeemableList, setRedeemableList] = useState<ConsumeCreditRuleResponse[]>([])\n const { isMutating: listLoading, trigger } = useAlpcMutation<\n {\n data: { consume_credit_rules: ConsumeCreditRuleResponse[] }\n },\n { user_id?: string }\n >({\n url: `/v1/credit/consume_credit_rules`,\n initData: {\n brand,\n page: 1,\n page_size: 20,\n country: (ALPC_COUNTRY_MAP.get(locale) || locale)?.toUpperCase(),\n },\n })\n\n const getRedeemableList = useCallback(() => {\n trigger(\n {\n user_id: profile?.user_id,\n },\n {\n onSuccess(responseData) {\n let list = responseData.data.consume_credit_rules || []\n let cList = list.filter(i => i.consume_type == 1) || []\n let pList = list.filter(i => i.consume_type == 2) || []\n cList = cList.sort((prev, next) => prev.consume_credits - next.consume_credits)\n pList = pList.sort((prev, next) => prev.consume_credits - next.consume_credits)\n const resultList = cList.concat(pList)\n setRedeemableList(resultList)\n\n localStorage?.setItem(\n `consume_credit_rules-${locale}`,\n JSON.stringify({\n expire: Date.now() + 10 * 60 * 1000,\n consume_credit_rules: resultList,\n })\n )\n },\n }\n )\n }, [profile, trigger, locale])\n\n useEffect(() => {\n if (!isLoadingProfile) {\n getRedeemableList()\n }\n }, [getRedeemableList, isLoadingProfile])\n\n return {\n listLoading,\n redeemableList,\n getRedeemableList,\n }\n}\n\nexport default useRedeemableList\n"],
5
+ "mappings": "AAAA,OAAS,eAAAA,EAAa,aAAAC,EAAW,YAAAC,MAAgB,QAEjD,OAAS,mBAAAC,MAAuB,iBAChC,OAAS,oBAAAC,MAAwB,WACjC,OAAS,qBAAAC,MAAyB,cAElC,OAAS,sBAAAC,MAA0B,gBAEnC,SAASC,GAAoB,CAC3B,IAAIC,EAAS,GACb,KAAM,CAAE,QAAAC,EAAS,iBAAAC,EAAkB,UAAAC,CAAU,EAAIN,EAAkB,EAC7D,CAAE,OAAQO,EAAe,MAAOC,CAAc,EAAIP,EAAmB,EACrEQ,EAAQH,GAAaE,EAEvBD,IAAkB,KACpBJ,EAAS,KAETA,EAASI,EAGX,KAAM,CAACG,EAAgBC,CAAiB,EAAId,EAAsC,CAAC,CAAC,EAC9E,CAAE,WAAYe,EAAa,QAAAC,CAAQ,EAAIf,EAK3C,CACA,IAAK,kCACL,SAAU,CACR,MAAAW,EACA,KAAM,EACN,UAAW,GACX,SAAUV,EAAiB,IAAII,CAAM,GAAKA,IAAS,YAAY,CACjE,CACF,CAAC,EAEKW,EAAoBnB,EAAY,IAAM,CAC1CkB,EACE,CACE,QAAST,GAAS,OACpB,EACA,CACE,UAAUW,EAAc,CACtB,IAAIC,EAAOD,EAAa,KAAK,sBAAwB,CAAC,EAClDE,EAAQD,EAAK,OAAOE,GAAKA,EAAE,cAAgB,CAAC,GAAK,CAAC,EAClDC,EAAQH,EAAK,OAAOE,GAAKA,EAAE,cAAgB,CAAC,GAAK,CAAC,EACtDD,EAAQA,EAAM,KAAK,CAACG,EAAMC,IAASD,EAAK,gBAAkBC,EAAK,eAAe,EAC9EF,EAAQA,EAAM,KAAK,CAACC,EAAMC,IAASD,EAAK,gBAAkBC,EAAK,eAAe,EAC9E,MAAMC,EAAaL,EAAM,OAAOE,CAAK,EACrCR,EAAkBW,CAAU,EAE5B,cAAc,QACZ,wBAAwBnB,CAAM,GAC9B,KAAK,UAAU,CACb,OAAQ,KAAK,IAAI,EAAI,GAAK,GAAK,IAC/B,qBAAsBmB,CACxB,CAAC,CACH,CACF,CACF,CACF,CACF,EAAG,CAAClB,EAASS,EAASV,CAAM,CAAC,EAE7B,OAAAP,EAAU,IAAM,CACTS,GACHS,EAAkB,CAEtB,EAAG,CAACA,EAAmBT,CAAgB,CAAC,EAEjC,CACL,YAAAO,EACA,eAAAF,EACA,kBAAAI,CACF,CACF,CAEA,IAAOS,EAAQrB",
6
+ "names": ["useCallback", "useEffect", "useState", "useAlpcMutation", "ALPC_COUNTRY_MAP", "useCreditsContext", "useHeadlessContext", "useRedeemableList", "locale", "profile", "isLoadingProfile", "alpcBrand", "contextLocale", "headlessBrand", "brand", "redeemableList", "setRedeemableList", "listLoading", "trigger", "getRedeemableList", "responseData", "list", "cList", "i", "pList", "prev", "next", "resultList", "useRedeemableList_default"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{useMemo as t}from"react";import{TaskSubType as n}from"../const";import c from"./useActivities";import{useSubscriptions as b}from"./useSubscriptions";import{useCreditsContext as p}from"../provider";import{useHeadlessContext as m}from"@anker-in/lib";const g=()=>{const{profile:i}=p(),{brand:o}=m(),u=t(()=>({page:1,pageSize:50}),[]),{activities:s}=c(u),{data:r}=b({email:i?.email});return t(()=>r?.preference?r.preference.some(e=>e.brand===o&&e.subscribe)?!0:s?.some(e=>e.task_sub_type===n.Subscription):!1,[r?.preference,s])};export{g as useSubscribed};
1
+ import{useMemo as t}from"react";import{TaskSubType as n}from"../const";import c from"./useActivities";import{useCreditsContext as b}from"../provider";import{useHeadlessContext as p,useSubscriptions as a}from"@anker-in/lib";const C=()=>{const{profile:i}=b(),{brand:o}=p(),u=t(()=>({page:1,pageSize:50}),[]),{activities:r}=c(u),{data:s}=a({email:i?.email});return t(()=>s?.preference?s.preference.some(e=>e.brand===o&&e.subscribe)?!0:r?.some(e=>e.task_sub_type===n.Subscription):!1,[s?.preference,r])};export{C as useSubscribed};
2
2
  //# sourceMappingURL=useSubscribed.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/components/credits/context/hooks/useSubscribed.ts"],
4
- "sourcesContent": ["import { useMemo } from 'react'\n\nimport { TaskSubType } from '../const'\nimport useActivities from './useActivities'\nimport { useSubscriptions } from './useSubscriptions'\nimport { useCreditsContext } from '../provider'\nimport { useHeadlessContext } from '@anker-in/lib'\n\nexport const useSubscribed = () => {\n const { profile } = useCreditsContext()\n const { brand } = useHeadlessContext()\n\n const activitiesOptions = useMemo(() => ({ page: 1, pageSize: 50 }), [])\n\n const { activities } = useActivities(activitiesOptions)\n const { data: subscription } = useSubscriptions({ email: profile?.email })\n\n const isSubscribed = useMemo(() => {\n if (!subscription?.preference) {\n return false\n }\n\n const subscribeResult = subscription.preference.some(item => {\n return item.brand === brand && item.subscribe\n })\n\n if (subscribeResult) {\n return true\n }\n\n return activities?.some(item => {\n return item.task_sub_type === TaskSubType.Subscription\n })\n }, [subscription?.preference, activities])\n\n return isSubscribed\n}\n"],
5
- "mappings": "AAAA,OAAS,WAAAA,MAAe,QAExB,OAAS,eAAAC,MAAmB,WAC5B,OAAOC,MAAmB,kBAC1B,OAAS,oBAAAC,MAAwB,qBACjC,OAAS,qBAAAC,MAAyB,cAClC,OAAS,sBAAAC,MAA0B,gBAE5B,MAAMC,EAAgB,IAAM,CACjC,KAAM,CAAE,QAAAC,CAAQ,EAAIH,EAAkB,EAChC,CAAE,MAAAI,CAAM,EAAIH,EAAmB,EAE/BI,EAAoBT,EAAQ,KAAO,CAAE,KAAM,EAAG,SAAU,EAAG,GAAI,CAAC,CAAC,EAEjE,CAAE,WAAAU,CAAW,EAAIR,EAAcO,CAAiB,EAChD,CAAE,KAAME,CAAa,EAAIR,EAAiB,CAAE,MAAOI,GAAS,KAAM,CAAC,EAoBzE,OAlBqBP,EAAQ,IACtBW,GAAc,WAIKA,EAAa,WAAW,KAAKC,GAC5CA,EAAK,QAAUJ,GAASI,EAAK,SACrC,EAGQ,GAGFF,GAAY,KAAKE,GACfA,EAAK,gBAAkBX,EAAY,YAC3C,EAbQ,GAcR,CAACU,GAAc,WAAYD,CAAU,CAAC,CAG3C",
6
- "names": ["useMemo", "TaskSubType", "useActivities", "useSubscriptions", "useCreditsContext", "useHeadlessContext", "useSubscribed", "profile", "brand", "activitiesOptions", "activities", "subscription", "item"]
4
+ "sourcesContent": ["import { useMemo } from 'react'\n\nimport { TaskSubType } from '../const'\nimport useActivities from './useActivities'\nimport { useCreditsContext } from '../provider'\nimport { useHeadlessContext, useSubscriptions } from '@anker-in/lib'\n\nexport const useSubscribed = () => {\n const { profile } = useCreditsContext()\n const { brand } = useHeadlessContext()\n\n const activitiesOptions = useMemo(() => ({ page: 1, pageSize: 50 }), [])\n\n const { activities } = useActivities(activitiesOptions)\n const { data: subscription } = useSubscriptions({ email: profile?.email })\n\n const isSubscribed = useMemo(() => {\n if (!subscription?.preference) {\n return false\n }\n\n const subscribeResult = subscription.preference.some(item => {\n return item.brand === brand && item.subscribe\n })\n\n if (subscribeResult) {\n return true\n }\n\n return activities?.some(item => {\n return item.task_sub_type === TaskSubType.Subscription\n })\n }, [subscription?.preference, activities])\n\n return isSubscribed\n}\n"],
5
+ "mappings": "AAAA,OAAS,WAAAA,MAAe,QAExB,OAAS,eAAAC,MAAmB,WAC5B,OAAOC,MAAmB,kBAC1B,OAAS,qBAAAC,MAAyB,cAClC,OAAS,sBAAAC,EAAoB,oBAAAC,MAAwB,gBAE9C,MAAMC,EAAgB,IAAM,CACjC,KAAM,CAAE,QAAAC,CAAQ,EAAIJ,EAAkB,EAChC,CAAE,MAAAK,CAAM,EAAIJ,EAAmB,EAE/BK,EAAoBT,EAAQ,KAAO,CAAE,KAAM,EAAG,SAAU,EAAG,GAAI,CAAC,CAAC,EAEjE,CAAE,WAAAU,CAAW,EAAIR,EAAcO,CAAiB,EAChD,CAAE,KAAME,CAAa,EAAIN,EAAiB,CAAE,MAAOE,GAAS,KAAM,CAAC,EAoBzE,OAlBqBP,EAAQ,IACtBW,GAAc,WAIKA,EAAa,WAAW,KAAKC,GAC5CA,EAAK,QAAUJ,GAASI,EAAK,SACrC,EAGQ,GAGFF,GAAY,KAAKE,GACfA,EAAK,gBAAkBX,EAAY,YAC3C,EAbQ,GAcR,CAACU,GAAc,WAAYD,CAAU,CAAC,CAG3C",
6
+ "names": ["useMemo", "TaskSubType", "useActivities", "useCreditsContext", "useHeadlessContext", "useSubscriptions", "useSubscribed", "profile", "brand", "activitiesOptions", "activities", "subscription", "item"]
7
7
  }
@@ -0,0 +1,10 @@
1
+ export declare enum FunctionDiscountType {
2
+ Percentage = 1,
3
+ FixedAmount = 2,
4
+ FixedPrice = 3
5
+ }
6
+ export declare enum RoundSelected {
7
+ RoundHighest = "round_highest",
8
+ RoundLowest = "round_lowest",
9
+ RoundNearest = "round_nearest"
10
+ }
@@ -0,0 +1,2 @@
1
+ var x=(r=>(r[r.Percentage=1]="Percentage",r[r.FixedAmount=2]="FixedAmount",r[r.FixedPrice=3]="FixedPrice",r))(x||{}),a=(r=>(r.RoundHighest="round_highest",r.RoundLowest="round_lowest",r.RoundNearest="round_nearest",r))(a||{});export{x as FunctionDiscountType,a as RoundSelected};
2
+ //# sourceMappingURL=memberPriceConst.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/components/credits/context/memberPriceConst.ts"],
4
+ "sourcesContent": ["// Function \u6298\u6263\u7C7B\u578B\nexport enum FunctionDiscountType {\n Percentage = 1,\n FixedAmount,\n FixedPrice,\n}\n\n// \u5C0F\u6570\u4F4D\u53D6\u820D\u65B9\u5F0F\nexport enum RoundSelected {\n RoundHighest = 'round_highest',\n RoundLowest = 'round_lowest',\n RoundNearest = 'round_nearest',\n}\n"],
5
+ "mappings": "AACO,IAAKA,OACVA,IAAA,WAAa,GAAb,aACAA,IAAA,6BACAA,IAAA,2BAHUA,OAAA,IAOAC,OACVA,EAAA,aAAe,gBACfA,EAAA,YAAc,eACdA,EAAA,aAAe,gBAHLA,OAAA",
6
+ "names": ["FunctionDiscountType", "RoundSelected"]
7
+ }
@@ -0,0 +1,46 @@
1
+ import { FunctionDiscountType, RoundSelected } from './memberPriceConst';
2
+ export type PriceEndingConf = {
3
+ apply_price_ending: boolean;
4
+ one_decimal_place: string;
5
+ two_decimal_place: string;
6
+ round_selected: RoundSelected;
7
+ };
8
+ export type DiscountConfig = {
9
+ discount_type: FunctionDiscountType;
10
+ discount_value: number;
11
+ price_ending_conf?: PriceEndingConf;
12
+ };
13
+ export type FunctionMemberPriceConfig = {
14
+ rule_id: string;
15
+ result_detail: {
16
+ member_discounts?: {
17
+ user_identity: number;
18
+ main_products: {
19
+ all_store_variant: boolean;
20
+ variants: {
21
+ variant_id: string;
22
+ sku: string;
23
+ handle: string;
24
+ }[];
25
+ };
26
+ discount_conf: DiscountConfig;
27
+ }[];
28
+ };
29
+ discount_combinations: {
30
+ other_product_discounts: boolean;
31
+ };
32
+ };
33
+ export type FunctionMemberPriceResult = {
34
+ hasMemberPrice: boolean;
35
+ useCoupon: boolean;
36
+ originalPrice: number;
37
+ originalPriceWithCurrency: string;
38
+ salePrice: number;
39
+ salePriceWithCurrency: string;
40
+ salePriceWithoutCoupon: number;
41
+ salePriceWithoutCouponWithCurrency: string;
42
+ savePrice: number;
43
+ savePriceWithCurrency: string;
44
+ savePriceWithoutCoupon: number;
45
+ savePriceWithoutCouponWithCurrency: string;
46
+ };
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=memberPriceTypes.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -1,38 +1,9 @@
1
- import React from 'react';
1
+ import { PropsWithChildren } from 'react';
2
2
  import type { DTC_TASK_TYPE } from './const';
3
3
  import type { CreditInfoResponse } from './response';
4
- export declare const CreditsContext: React.Context<{
5
- profile: any;
6
- isLoadingProfile: boolean;
7
- removeProfile: () => void;
8
- taskIdToTypeMapping: Record<string, DTC_TASK_TYPE>;
9
- openSignInPopup: () => void;
10
- openSignUpPopup: () => void;
11
- creditInfo?: CreditInfoResponse;
12
- customer?: any;
13
- customerLoading: boolean;
14
- fetchCreditInfo: (user_id: string) => void;
15
- gtm: {
16
- pageGroup: string;
17
- };
18
- }>;
19
- export declare function CreditsProvider({ children, profile, removeProfile, isLoadingProfile, openSignInPopup, openSignUpPopup, taskIdToTypeMapping, creditInfo, customer, customerLoading, fetchCreditInfo, gtm, }: {
20
- children: React.ReactNode;
21
- profile: any;
22
- removeProfile: () => void;
23
- isLoadingProfile: boolean;
24
- openSignInPopup: () => void;
25
- openSignUpPopup: () => void;
26
- taskIdToTypeMapping: Record<string, DTC_TASK_TYPE>;
27
- creditInfo?: CreditInfoResponse;
28
- customer: any;
29
- fetchCreditInfo: (user_id: string) => void;
30
- customerLoading: boolean;
31
- gtm: {
32
- pageGroup: string;
33
- };
34
- }): import("react/jsx-runtime").JSX.Element;
35
- export declare function useCreditsContext(): {
4
+ import { CreditsPageCommon } from '../type';
5
+ import { FunctionMemberPriceConfig } from './memberPriceTypes';
6
+ type Context = {
36
7
  profile: any;
37
8
  isLoadingProfile: boolean;
38
9
  removeProfile: () => void;
@@ -46,4 +17,11 @@ export declare function useCreditsContext(): {
46
17
  gtm: {
47
18
  pageGroup: string;
48
19
  };
20
+ pageCommon: CreditsPageCommon;
21
+ memberPriceDiscount?: FunctionMemberPriceConfig[];
22
+ alpcBrand?: string;
49
23
  };
24
+ export declare const CreditsContext: import("react").Context<Context>;
25
+ export declare function CreditsProvider({ children, profile, removeProfile, isLoadingProfile, openSignInPopup, openSignUpPopup, taskIdToTypeMapping, creditInfo, customer, customerLoading, fetchCreditInfo, gtm, pageCommon, memberPriceDiscount, alpcBrand, }: PropsWithChildren<Context>): import("react/jsx-runtime").JSX.Element;
26
+ export declare function useCreditsContext(): Context;
27
+ export {};
@@ -1,2 +1,2 @@
1
- import{jsx as C}from"react/jsx-runtime";import{createContext as c,useContext as l}from"react";const e=c({profile:null,isLoadingProfile:!1,taskIdToTypeMapping:{},removeProfile:()=>{},openSignInPopup:()=>{},openSignUpPopup:()=>{},creditInfo:void 0,customerLoading:!1,fetchCreditInfo:o=>{},gtm:{pageGroup:""}});function v({children:o,profile:n,removeProfile:i,isLoadingProfile:r,openSignInPopup:t,openSignUpPopup:p,taskIdToTypeMapping:d,creditInfo:s,customer:a,customerLoading:f,fetchCreditInfo:g,gtm:u}){return C(e.Provider,{value:{profile:n,isLoadingProfile:r,removeProfile:i,openSignInPopup:t,openSignUpPopup:p,taskIdToTypeMapping:d,creditInfo:s,fetchCreditInfo:g,customer:a,customerLoading:f,gtm:u},children:o})}function I(){return l(e)}export{e as CreditsContext,v as CreditsProvider,I as useCreditsContext};
1
+ import{jsx as x}from"react/jsx-runtime";import{createContext as P,useContext as l}from"react";const o=P({profile:null,isLoadingProfile:!1,taskIdToTypeMapping:{},removeProfile:()=>{},openSignInPopup:()=>{},openSignUpPopup:()=>{},creditInfo:void 0,customerLoading:!1,fetchCreditInfo:e=>{},gtm:{pageGroup:""},pageCommon:{},memberPriceDiscount:void 0,alpcBrand:void 0});function S({children:e,profile:r,removeProfile:n,isLoadingProfile:t,openSignInPopup:i,openSignUpPopup:p,taskIdToTypeMapping:d,creditInfo:s,customer:m,customerLoading:C,fetchCreditInfo:f,gtm:u,pageCommon:a,memberPriceDiscount:g,alpcBrand:c}){return x(o.Provider,{value:{profile:r,isLoadingProfile:t,removeProfile:n,openSignInPopup:i,openSignUpPopup:p,taskIdToTypeMapping:d,creditInfo:s,fetchCreditInfo:f,customer:m,customerLoading:C,gtm:u,pageCommon:a,memberPriceDiscount:g,alpcBrand:c},children:e})}function _(){const e=l(o);if(!e)throw new Error("useCreditsContext must be used within a CreditsProvider");return e}export{o as CreditsContext,S as CreditsProvider,_ as useCreditsContext};
2
2
  //# sourceMappingURL=provider.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/components/credits/context/provider.tsx"],
4
- "sourcesContent": ["import React, { createContext, useContext } from 'react'\nimport type { DTC_TASK_TYPE } from './const'\nimport type { CreditInfoResponse } from './response'\n\nexport const CreditsContext = createContext<{\n profile: any\n isLoadingProfile: boolean\n removeProfile: () => void\n taskIdToTypeMapping: Record<string, DTC_TASK_TYPE>\n openSignInPopup: () => void\n openSignUpPopup: () => void\n creditInfo?: CreditInfoResponse\n customer?: any\n customerLoading: boolean\n fetchCreditInfo: (user_id: string) => void\n gtm: {\n pageGroup: string\n }\n}>({\n profile: null,\n isLoadingProfile: false,\n taskIdToTypeMapping: {},\n removeProfile: () => {},\n openSignInPopup: () => {},\n openSignUpPopup: () => {},\n creditInfo: undefined,\n customerLoading: false,\n fetchCreditInfo: (user_id: string) => {},\n gtm: {\n pageGroup: '',\n },\n})\n\nexport function CreditsProvider({\n children,\n profile,\n removeProfile,\n isLoadingProfile,\n openSignInPopup,\n openSignUpPopup,\n taskIdToTypeMapping,\n creditInfo,\n customer,\n customerLoading,\n fetchCreditInfo,\n gtm,\n}: {\n children: React.ReactNode\n profile: any\n removeProfile: () => void\n isLoadingProfile: boolean\n openSignInPopup: () => void\n openSignUpPopup: () => void\n taskIdToTypeMapping: Record<string, DTC_TASK_TYPE>\n creditInfo?: CreditInfoResponse\n customer: any\n fetchCreditInfo: (user_id: string) => void\n customerLoading: boolean\n gtm: {\n pageGroup: string\n }\n}) {\n return (\n <CreditsContext.Provider\n value={{\n profile,\n isLoadingProfile,\n removeProfile,\n openSignInPopup,\n openSignUpPopup,\n taskIdToTypeMapping,\n creditInfo,\n fetchCreditInfo,\n customer,\n customerLoading,\n gtm,\n }}\n >\n {children}\n </CreditsContext.Provider>\n )\n}\n\nexport function useCreditsContext() {\n return useContext(CreditsContext)\n}\n"],
5
- "mappings": "AA+DI,cAAAA,MAAA,oBA/DJ,OAAgB,iBAAAC,EAAe,cAAAC,MAAkB,QAI1C,MAAMC,EAAiBF,EAc3B,CACD,QAAS,KACT,iBAAkB,GAClB,oBAAqB,CAAC,EACtB,cAAe,IAAM,CAAC,EACtB,gBAAiB,IAAM,CAAC,EACxB,gBAAiB,IAAM,CAAC,EACxB,WAAY,OACZ,gBAAiB,GACjB,gBAAkBG,GAAoB,CAAC,EACvC,IAAK,CACH,UAAW,EACb,CACF,CAAC,EAEM,SAASC,EAAgB,CAC9B,SAAAC,EACA,QAAAC,EACA,cAAAC,EACA,iBAAAC,EACA,gBAAAC,EACA,gBAAAC,EACA,oBAAAC,EACA,WAAAC,EACA,SAAAC,EACA,gBAAAC,EACA,gBAAAC,EACA,IAAAC,CACF,EAeG,CACD,OACEjB,EAACG,EAAe,SAAf,CACC,MAAO,CACL,QAAAI,EACA,iBAAAE,EACA,cAAAD,EACA,gBAAAE,EACA,gBAAAC,EACA,oBAAAC,EACA,WAAAC,EACA,gBAAAG,EACA,SAAAF,EACA,gBAAAC,EACA,IAAAE,CACF,EAEC,SAAAX,EACH,CAEJ,CAEO,SAASY,GAAoB,CAClC,OAAOhB,EAAWC,CAAc,CAClC",
6
- "names": ["jsx", "createContext", "useContext", "CreditsContext", "user_id", "CreditsProvider", "children", "profile", "removeProfile", "isLoadingProfile", "openSignInPopup", "openSignUpPopup", "taskIdToTypeMapping", "creditInfo", "customer", "customerLoading", "fetchCreditInfo", "gtm", "useCreditsContext"]
4
+ "sourcesContent": ["import { createContext, PropsWithChildren, useContext } from 'react'\nimport type { DTC_TASK_TYPE } from './const'\nimport type { CreditInfoResponse } from './response'\nimport { CreditsPageCommon } from '../type'\nimport { FunctionMemberPriceConfig } from './memberPriceTypes'\n\ntype Context = {\n profile: any\n isLoadingProfile: boolean\n removeProfile: () => void\n taskIdToTypeMapping: Record<string, DTC_TASK_TYPE>\n openSignInPopup: () => void\n openSignUpPopup: () => void\n creditInfo?: CreditInfoResponse\n customer?: any\n customerLoading: boolean\n fetchCreditInfo: (user_id: string) => void\n gtm: {\n pageGroup: string\n }\n pageCommon: CreditsPageCommon\n memberPriceDiscount?: FunctionMemberPriceConfig[]\n alpcBrand?: string\n}\n\nexport const CreditsContext = createContext<Context>({\n profile: null,\n isLoadingProfile: false,\n taskIdToTypeMapping: {},\n removeProfile: () => {},\n openSignInPopup: () => {},\n openSignUpPopup: () => {},\n creditInfo: undefined,\n customerLoading: false,\n fetchCreditInfo: (user_id: string) => {},\n gtm: {\n pageGroup: '',\n },\n pageCommon: {},\n memberPriceDiscount: undefined,\n alpcBrand: undefined,\n})\n\nexport function CreditsProvider({\n children,\n profile,\n removeProfile,\n isLoadingProfile,\n openSignInPopup,\n openSignUpPopup,\n taskIdToTypeMapping,\n creditInfo,\n customer,\n customerLoading,\n fetchCreditInfo,\n gtm,\n pageCommon,\n memberPriceDiscount,\n alpcBrand,\n}: PropsWithChildren<Context>) {\n return (\n <CreditsContext.Provider\n value={{\n profile,\n isLoadingProfile,\n removeProfile,\n openSignInPopup,\n openSignUpPopup,\n taskIdToTypeMapping,\n creditInfo,\n fetchCreditInfo,\n customer,\n customerLoading,\n gtm,\n pageCommon,\n memberPriceDiscount,\n alpcBrand,\n }}\n >\n {children}\n </CreditsContext.Provider>\n )\n}\n\nexport function useCreditsContext() {\n const context = useContext(CreditsContext)\n if (!context) {\n throw new Error('useCreditsContext must be used within a CreditsProvider')\n }\n return context\n}\n"],
5
+ "mappings": "AA6DI,cAAAA,MAAA,oBA7DJ,OAAS,iBAAAC,EAAkC,cAAAC,MAAkB,QAyBtD,MAAMC,EAAiBF,EAAuB,CACnD,QAAS,KACT,iBAAkB,GAClB,oBAAqB,CAAC,EACtB,cAAe,IAAM,CAAC,EACtB,gBAAiB,IAAM,CAAC,EACxB,gBAAiB,IAAM,CAAC,EACxB,WAAY,OACZ,gBAAiB,GACjB,gBAAkBG,GAAoB,CAAC,EACvC,IAAK,CACH,UAAW,EACb,EACA,WAAY,CAAC,EACb,oBAAqB,OACrB,UAAW,MACb,CAAC,EAEM,SAASC,EAAgB,CAC9B,SAAAC,EACA,QAAAC,EACA,cAAAC,EACA,iBAAAC,EACA,gBAAAC,EACA,gBAAAC,EACA,oBAAAC,EACA,WAAAC,EACA,SAAAC,EACA,gBAAAC,EACA,gBAAAC,EACA,IAAAC,EACA,WAAAC,EACA,oBAAAC,EACA,UAAAC,CACF,EAA+B,CAC7B,OACEpB,EAACG,EAAe,SAAf,CACC,MAAO,CACL,QAAAI,EACA,iBAAAE,EACA,cAAAD,EACA,gBAAAE,EACA,gBAAAC,EACA,oBAAAC,EACA,WAAAC,EACA,gBAAAG,EACA,SAAAF,EACA,gBAAAC,EACA,IAAAE,EACA,WAAAC,EACA,oBAAAC,EACA,UAAAC,CACF,EAEC,SAAAd,EACH,CAEJ,CAEO,SAASe,GAAoB,CAClC,MAAMC,EAAUpB,EAAWC,CAAc,EACzC,GAAI,CAACmB,EACH,MAAM,IAAI,MAAM,yDAAyD,EAE3E,OAAOA,CACT",
6
+ "names": ["jsx", "createContext", "useContext", "CreditsContext", "user_id", "CreditsProvider", "children", "profile", "removeProfile", "isLoadingProfile", "openSignInPopup", "openSignUpPopup", "taskIdToTypeMapping", "creditInfo", "customer", "customerLoading", "fetchCreditInfo", "gtm", "pageCommon", "memberPriceDiscount", "alpcBrand", "useCreditsContext", "context"]
7
7
  }
@@ -0,0 +1 @@
1
+ export declare function atobID(id: string): string | undefined;
@@ -0,0 +1,2 @@
1
+ function e(t){return t&&typeof t=="string"&&t.includes("/")?t.split("/").pop()?.split("?")?.shift():t}export{e as atobID};
2
+ //# sourceMappingURL=atobID.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/components/credits/context/utils/atobID.ts"],
4
+ "sourcesContent": ["// \u4ECE Shopify GraphQL ID \u4E2D\u63D0\u53D6\u6570\u5B57 ID\nexport function atobID(id: string) {\n if (id && typeof id === 'string' && id.includes('/')) {\n return id.split('/').pop()?.split('?')?.shift()\n } else {\n return id\n }\n}\n"],
5
+ "mappings": "AACO,SAASA,EAAOC,EAAY,CACjC,OAAIA,GAAM,OAAOA,GAAO,UAAYA,EAAG,SAAS,GAAG,EAC1CA,EAAG,MAAM,GAAG,EAAE,IAAI,GAAG,MAAM,GAAG,GAAG,MAAM,EAEvCA,CAEX",
6
+ "names": ["atobID", "id"]
7
+ }
@@ -0,0 +1,5 @@
1
+ import { DiscountConfig } from '../memberPriceTypes';
2
+ export declare const functionDiscountCalculate: ({ config, price, }: {
3
+ config: DiscountConfig;
4
+ price: number;
5
+ }) => number;
@@ -0,0 +1,2 @@
1
+ import{FunctionDiscountType as c,RoundSelected as i}from"../memberPriceConst";import n from"decimal.js";const b=({config:t,price:o})=>{const{apply_price_ending:r,one_decimal_place:a,two_decimal_place:u,round_selected:s}=t.price_ending_conf||{};let e=new n(o);switch(t.discount_type){case c.Percentage:e=e.mul(100-t.discount_value).div(100);break;case c.FixedAmount:e=e.sub(t.discount_value);break;case c.FixedPrice:e=new n(t.discount_value);break;default:break}if(r){switch(s){case i.RoundHighest:e=e.ceil();break;case i.RoundLowest:e=e.floor();break;case i.RoundNearest:e=e.round();break;default:e=new n(e.toFixed(2,n.ROUND_DOWN));break}const d=e.toString().split(".");e=new n(d[0]+"."+a+u)}return e.toNumber()};export{b as functionDiscountCalculate};
2
+ //# sourceMappingURL=functionDiscountCalculate.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/components/credits/context/utils/functionDiscountCalculate.ts"],
4
+ "sourcesContent": ["import { FunctionDiscountType, RoundSelected } from '../memberPriceConst'\nimport { DiscountConfig } from '../memberPriceTypes'\nimport Decimal from 'decimal.js'\n\n// Function \u8BA1\u7B97\u6298\u540E\u4EF7\nexport const functionDiscountCalculate = ({\n config,\n price,\n}: {\n config: DiscountConfig\n price: number\n}) => {\n const { apply_price_ending, one_decimal_place, two_decimal_place, round_selected } =\n config.price_ending_conf || {}\n\n let salePrice = new Decimal(price)\n\n switch (config.discount_type) {\n // \u767E\u5206\u6BD4\u6298\u6263\n case FunctionDiscountType.Percentage:\n salePrice = salePrice.mul(100 - config.discount_value).div(100)\n break\n // \u56FA\u5B9A\u91D1\u989D\u6298\u6263\n case FunctionDiscountType.FixedAmount:\n salePrice = salePrice.sub(config.discount_value)\n break\n // \u56FA\u5B9A\u4EF7\u683C\u6298\u6263\n case FunctionDiscountType.FixedPrice:\n salePrice = new Decimal(config.discount_value)\n break\n default:\n break\n }\n\n if (apply_price_ending) {\n // \u5C0F\u6570\u4F4D\u53D6\u820D\n switch (round_selected) {\n case RoundSelected.RoundHighest:\n salePrice = salePrice.ceil()\n break\n case RoundSelected.RoundLowest:\n salePrice = salePrice.floor()\n break\n case RoundSelected.RoundNearest:\n salePrice = salePrice.round()\n break\n default:\n salePrice = new Decimal(salePrice.toFixed(2, Decimal.ROUND_DOWN))\n break\n }\n\n const priceEnding = salePrice.toString().split('.')\n salePrice = new Decimal(priceEnding[0] + '.' + one_decimal_place + two_decimal_place)\n }\n\n return salePrice.toNumber()\n}\n"],
5
+ "mappings": "AAAA,OAAS,wBAAAA,EAAsB,iBAAAC,MAAqB,sBAEpD,OAAOC,MAAa,aAGb,MAAMC,EAA4B,CAAC,CACxC,OAAAC,EACA,MAAAC,CACF,IAGM,CACJ,KAAM,CAAE,mBAAAC,EAAoB,kBAAAC,EAAmB,kBAAAC,EAAmB,eAAAC,CAAe,EAC/EL,EAAO,mBAAqB,CAAC,EAE/B,IAAIM,EAAY,IAAIR,EAAQG,CAAK,EAEjC,OAAQD,EAAO,cAAe,CAE5B,KAAKJ,EAAqB,WACxBU,EAAYA,EAAU,IAAI,IAAMN,EAAO,cAAc,EAAE,IAAI,GAAG,EAC9D,MAEF,KAAKJ,EAAqB,YACxBU,EAAYA,EAAU,IAAIN,EAAO,cAAc,EAC/C,MAEF,KAAKJ,EAAqB,WACxBU,EAAY,IAAIR,EAAQE,EAAO,cAAc,EAC7C,MACF,QACE,KACJ,CAEA,GAAIE,EAAoB,CAEtB,OAAQG,EAAgB,CACtB,KAAKR,EAAc,aACjBS,EAAYA,EAAU,KAAK,EAC3B,MACF,KAAKT,EAAc,YACjBS,EAAYA,EAAU,MAAM,EAC5B,MACF,KAAKT,EAAc,aACjBS,EAAYA,EAAU,MAAM,EAC5B,MACF,QACEA,EAAY,IAAIR,EAAQQ,EAAU,QAAQ,EAAGR,EAAQ,UAAU,CAAC,EAChE,KACJ,CAEA,MAAMS,EAAcD,EAAU,SAAS,EAAE,MAAM,GAAG,EAClDA,EAAY,IAAIR,EAAQS,EAAY,CAAC,EAAI,IAAMJ,EAAoBC,CAAiB,CACtF,CAEA,OAAOE,EAAU,SAAS,CAC5B",
6
+ "names": ["FunctionDiscountType", "RoundSelected", "Decimal", "functionDiscountCalculate", "config", "price", "apply_price_ending", "one_decimal_place", "two_decimal_place", "round_selected", "salePrice", "priceEnding"]
7
+ }
@@ -0,0 +1,8 @@
1
+ import { FunctionMemberPriceConfig, FunctionMemberPriceResult } from '../memberPriceTypes';
2
+ import { ProductVariant } from '@anker-in/lib';
3
+ export declare const getFunctionMemberPrice: ({ memberPriceDiscount, currencyCode, variant, locale, }: {
4
+ memberPriceDiscount?: FunctionMemberPriceConfig[];
5
+ currencyCode?: string;
6
+ variant?: ProductVariant;
7
+ locale: string;
8
+ }) => false | FunctionMemberPriceResult;
@@ -0,0 +1,2 @@
1
+ import{formatPrice as o}from"../utils";import{functionDiscountCalculate as b}from"./functionDiscountCalculate";import n from"decimal.js";import{getFunctionMemberPriceDiscountConfig as D}from"./getFunctionMemberPriceDiscountConfig";import d from"./variantGetCoupon";const V=({memberPriceDiscount:l,currencyCode:r,variant:e,locale:i})=>{const m=d({variant:e}),{memberPriceDiscountConfig:c,activeMemberPriceConfig:y}=D({config:l,variant:e}),s=!!y?.discount_combinations.other_product_discounts;if(!c)return!1;const u={amount:e?.price.amount||0,priceWithCurrency:o({amount:e?.price.amount||0,currencyCode:r||"USD",locale:i})},t=c?b({config:c,price:e?.price.amount||0}):e?.price.amount||0,a={amount:t,priceWithCurrency:o({amount:t,currencyCode:r||"USD",locale:i})};let p=t;if(m?.variant_price4wscode&&e&&s)if(s){const P=new n(e.price.amount).minus(m.variant_price4wscode);p=new n(t).minus(P).toNumber()}else{const P=new n(e.price.amount).minus(m.variant_price4wscode);if(t>P.toNumber())return!1}const C={amount:p,priceWithCurrency:o({amount:p,currencyCode:r||"USD",locale:i})},h=new n(u.amount).minus(C.amount).toNumber(),f={amount:h,priceWithCurrency:o({amount:h,currencyCode:r||"USD",locale:i,maximumFractionDigits:2})},W=new n(u.amount).minus(a.amount).toNumber(),g={amount:W,priceWithCurrency:o({amount:W,currencyCode:r||"USD",locale:i,maximumFractionDigits:2})};return{hasMemberPrice:!!c,useCoupon:s,originalPrice:u.amount,originalPriceWithCurrency:u.priceWithCurrency,salePrice:C.amount,salePriceWithCurrency:C.priceWithCurrency,salePriceWithoutCoupon:a.amount,salePriceWithoutCouponWithCurrency:a.priceWithCurrency,savePrice:f.amount,savePriceWithCurrency:f.priceWithCurrency,savePriceWithoutCoupon:g.amount,savePriceWithoutCouponWithCurrency:g.priceWithCurrency}};export{V as getFunctionMemberPrice};
2
+ //# sourceMappingURL=getFunctionMemberPrice.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/components/credits/context/utils/getFunctionMemberPrice.ts"],
4
+ "sourcesContent": ["import { formatPrice } from '../utils'\nimport { FunctionMemberPriceConfig, FunctionMemberPriceResult } from '../memberPriceTypes'\nimport { ProductVariant } from '@anker-in/lib'\nimport { functionDiscountCalculate } from './functionDiscountCalculate'\nimport Decimal from 'decimal.js'\nimport { getFunctionMemberPriceDiscountConfig } from './getFunctionMemberPriceDiscountConfig'\nimport variantGetCoupon from './variantGetCoupon'\n\n// \u8BA1\u7B97\u5355\u4EF6\u5546\u54C1\u7684\u4F1A\u5458\u4EF7\nexport const getFunctionMemberPrice = ({\n memberPriceDiscount,\n currencyCode,\n variant,\n locale,\n}: {\n memberPriceDiscount?: FunctionMemberPriceConfig[]\n currencyCode?: string\n variant?: ProductVariant\n locale: string\n}) => {\n const couponData = variantGetCoupon({ variant })\n\n // variant\u5BF9\u5E94\u7684\u4F1A\u5458\u4EF7\u6298\u6263\u914D\u7F6E\n const { memberPriceDiscountConfig, activeMemberPriceConfig } = getFunctionMemberPriceDiscountConfig({\n config: memberPriceDiscount,\n variant,\n })\n\n const useCoupon = !!activeMemberPriceConfig?.discount_combinations.other_product_discounts\n\n if (!memberPriceDiscountConfig) {\n return false as false\n }\n\n const originalPrice = {\n amount: variant?.price.amount || 0,\n priceWithCurrency: formatPrice({\n amount: variant?.price.amount || 0,\n currencyCode: currencyCode || 'USD',\n locale,\n }),\n }\n\n const salePriceWithoutCouponAmount = memberPriceDiscountConfig\n ? functionDiscountCalculate({\n config: memberPriceDiscountConfig,\n price: variant?.price.amount || 0,\n })\n : variant?.price.amount || 0\n const salePriceWithoutCoupon = {\n amount: salePriceWithoutCouponAmount,\n priceWithCurrency: formatPrice({\n amount: salePriceWithoutCouponAmount,\n currencyCode: currencyCode || 'USD',\n locale,\n }),\n }\n\n // function \u4F1A\u5458\u4EF7\u662F\u5728\u539F\u4EF7\u7684\u57FA\u7840\u4E0A\u8FDB\u884C\u8BA1\u7B97\uFF0C\u6682\u4E0D\u652F\u6301\u6298\u540E\u4EF7\n let salePriceAmount = salePriceWithoutCouponAmount\n\n // \u51CF\u53BBcode\u7684\u4F18\u60E0\n if (couponData?.variant_price4wscode && variant && useCoupon) {\n if (useCoupon) {\n // code\u7684\u4F18\u60E0\u91D1\u989D\n const codeSaveAmountDecimal = new Decimal(variant.price.amount).minus(couponData.variant_price4wscode)\n salePriceAmount = new Decimal(salePriceWithoutCouponAmount).minus(codeSaveAmountDecimal).toNumber()\n } else {\n // \u4E0D\u80FD\u4E0E code \u540C\u65F6\u4F7F\u7528\uFF0C\u9700\u8981\u5224\u65AD\u4F1A\u5458\u4EF7\u662F\u5426\u5C0F\u4E8E code \u7684\u4F18\u60E0\u91D1\u989D\uFF0C\u5982\u679C\u5C0F\u4E8E\u5219\u5F53\u505A\u6CA1\u6709\u4F1A\u5458\u4EF7\n const codeSaveAmountDecimal = new Decimal(variant.price.amount).minus(couponData.variant_price4wscode)\n if (salePriceWithoutCouponAmount > codeSaveAmountDecimal.toNumber()) {\n return false as false\n }\n }\n }\n\n const salePrice = {\n amount: salePriceAmount,\n priceWithCurrency: formatPrice({\n amount: salePriceAmount,\n currencyCode: currencyCode || 'USD',\n locale,\n }),\n }\n\n const savePriceAmount = new Decimal(originalPrice.amount).minus(salePrice.amount).toNumber()\n const savePrice = {\n amount: savePriceAmount,\n priceWithCurrency: formatPrice({\n amount: savePriceAmount,\n currencyCode: currencyCode || 'USD',\n locale,\n maximumFractionDigits: 2,\n }),\n }\n\n const savePriceWithoutCouponAmount = new Decimal(originalPrice.amount)\n .minus(salePriceWithoutCoupon.amount)\n .toNumber()\n const savePriceWithoutCoupon = {\n amount: savePriceWithoutCouponAmount,\n priceWithCurrency: formatPrice({\n amount: savePriceWithoutCouponAmount,\n currencyCode: currencyCode || 'USD',\n locale,\n maximumFractionDigits: 2,\n }),\n }\n\n const result: FunctionMemberPriceResult = {\n // \u662F\u5426\u5B58\u5728\u4F1A\u5458\u4EF7\n hasMemberPrice: !!memberPriceDiscountConfig,\n useCoupon,\n // \u539F\u4EF7\n originalPrice: originalPrice.amount,\n originalPriceWithCurrency: originalPrice.priceWithCurrency as string,\n // \u4F7F\u7528\u5238\u540E\u7684\u6298\u540E\u4EF7\n salePrice: salePrice.amount,\n salePriceWithCurrency: salePrice.priceWithCurrency as string,\n\n // \u4E0D\u4F7F\u7528\u5238\u7684\u6298\u540E\u4EF7\n salePriceWithoutCoupon: salePriceWithoutCoupon.amount,\n salePriceWithoutCouponWithCurrency: salePriceWithoutCoupon.priceWithCurrency as string,\n\n // \u5305\u542B\u4F7F\u7528\u5238\u7684\u8282\u7701\u91D1\u989D\n savePrice: savePrice.amount,\n savePriceWithCurrency: savePrice.priceWithCurrency as string,\n\n // \u4E0D\u4F7F\u7528\u5238\u7684\u8282\u7701\u91D1\u989D\n savePriceWithoutCoupon: savePriceWithoutCoupon.amount,\n savePriceWithoutCouponWithCurrency: savePriceWithoutCoupon.priceWithCurrency as string,\n }\n\n return result\n}\n"],
5
+ "mappings": "AAAA,OAAS,eAAAA,MAAmB,WAG5B,OAAS,6BAAAC,MAAiC,8BAC1C,OAAOC,MAAa,aACpB,OAAS,wCAAAC,MAA4C,yCACrD,OAAOC,MAAsB,qBAGtB,MAAMC,EAAyB,CAAC,CACrC,oBAAAC,EACA,aAAAC,EACA,QAAAC,EACA,OAAAC,CACF,IAKM,CACJ,MAAMC,EAAaN,EAAiB,CAAE,QAAAI,CAAQ,CAAC,EAGzC,CAAE,0BAAAG,EAA2B,wBAAAC,CAAwB,EAAIT,EAAqC,CAClG,OAAQG,EACR,QAAAE,CACF,CAAC,EAEKK,EAAY,CAAC,CAACD,GAAyB,sBAAsB,wBAEnE,GAAI,CAACD,EACH,MAAO,GAGT,MAAMG,EAAgB,CACpB,OAAQN,GAAS,MAAM,QAAU,EACjC,kBAAmBR,EAAY,CAC7B,OAAQQ,GAAS,MAAM,QAAU,EACjC,aAAcD,GAAgB,MAC9B,OAAAE,CACF,CAAC,CACH,EAEMM,EAA+BJ,EACjCV,EAA0B,CACxB,OAAQU,EACR,MAAOH,GAAS,MAAM,QAAU,CAClC,CAAC,EACDA,GAAS,MAAM,QAAU,EACvBQ,EAAyB,CAC7B,OAAQD,EACR,kBAAmBf,EAAY,CAC7B,OAAQe,EACR,aAAcR,GAAgB,MAC9B,OAAAE,CACF,CAAC,CACH,EAGA,IAAIQ,EAAkBF,EAGtB,GAAIL,GAAY,sBAAwBF,GAAWK,EACjD,GAAIA,EAAW,CAEb,MAAMK,EAAwB,IAAIhB,EAAQM,EAAQ,MAAM,MAAM,EAAE,MAAME,EAAW,oBAAoB,EACrGO,EAAkB,IAAIf,EAAQa,CAA4B,EAAE,MAAMG,CAAqB,EAAE,SAAS,CACpG,KAAO,CAEL,MAAMA,EAAwB,IAAIhB,EAAQM,EAAQ,MAAM,MAAM,EAAE,MAAME,EAAW,oBAAoB,EACrG,GAAIK,EAA+BG,EAAsB,SAAS,EAChE,MAAO,EAEX,CAGF,MAAMC,EAAY,CAChB,OAAQF,EACR,kBAAmBjB,EAAY,CAC7B,OAAQiB,EACR,aAAcV,GAAgB,MAC9B,OAAAE,CACF,CAAC,CACH,EAEMW,EAAkB,IAAIlB,EAAQY,EAAc,MAAM,EAAE,MAAMK,EAAU,MAAM,EAAE,SAAS,EACrFE,EAAY,CAChB,OAAQD,EACR,kBAAmBpB,EAAY,CAC7B,OAAQoB,EACR,aAAcb,GAAgB,MAC9B,OAAAE,EACA,sBAAuB,CACzB,CAAC,CACH,EAEMa,EAA+B,IAAIpB,EAAQY,EAAc,MAAM,EAClE,MAAME,EAAuB,MAAM,EACnC,SAAS,EACNO,EAAyB,CAC7B,OAAQD,EACR,kBAAmBtB,EAAY,CAC7B,OAAQsB,EACR,aAAcf,GAAgB,MAC9B,OAAAE,EACA,sBAAuB,CACzB,CAAC,CACH,EA0BA,MAxB0C,CAExC,eAAgB,CAAC,CAACE,EAClB,UAAAE,EAEA,cAAeC,EAAc,OAC7B,0BAA2BA,EAAc,kBAEzC,UAAWK,EAAU,OACrB,sBAAuBA,EAAU,kBAGjC,uBAAwBH,EAAuB,OAC/C,mCAAoCA,EAAuB,kBAG3D,UAAWK,EAAU,OACrB,sBAAuBA,EAAU,kBAGjC,uBAAwBE,EAAuB,OAC/C,mCAAoCA,EAAuB,iBAC7D,CAGF",
6
+ "names": ["formatPrice", "functionDiscountCalculate", "Decimal", "getFunctionMemberPriceDiscountConfig", "variantGetCoupon", "getFunctionMemberPrice", "memberPriceDiscount", "currencyCode", "variant", "locale", "couponData", "memberPriceDiscountConfig", "activeMemberPriceConfig", "useCoupon", "originalPrice", "salePriceWithoutCouponAmount", "salePriceWithoutCoupon", "salePriceAmount", "codeSaveAmountDecimal", "salePrice", "savePriceAmount", "savePrice", "savePriceWithoutCouponAmount", "savePriceWithoutCoupon"]
7
+ }
@@ -0,0 +1,9 @@
1
+ import { DiscountConfig, FunctionMemberPriceConfig } from '../memberPriceTypes';
2
+ import { ProductVariant } from '@anker-in/lib';
3
+ export declare const getFunctionMemberPriceDiscountConfig: ({ config, variant, }: {
4
+ config?: FunctionMemberPriceConfig[];
5
+ variant?: ProductVariant;
6
+ }) => {
7
+ memberPriceDiscountConfig: DiscountConfig | undefined;
8
+ activeMemberPriceConfig: FunctionMemberPriceConfig | undefined;
9
+ };
@@ -0,0 +1,2 @@
1
+ import{atobID as f}from"./atobID";const b=({config:e,variant:t})=>{let i,r;if(!e||!t)return{memberPriceDiscountConfig:i,activeMemberPriceConfig:r};for(const o of e)if(i=o.result_detail.member_discounts?.find(n=>n.main_products.all_store_variant?n:n.main_products.variants.find(c=>String(c.variant_id)===f(t.id)))?.discount_conf,i){r=o;break}return i?{memberPriceDiscountConfig:i,activeMemberPriceConfig:r}:{memberPriceDiscountConfig:i,activeMemberPriceConfig:r}};export{b as getFunctionMemberPriceDiscountConfig};
2
+ //# sourceMappingURL=getFunctionMemberPriceDiscountConfig.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.ts"],
4
+ "sourcesContent": ["import { DiscountConfig, FunctionMemberPriceConfig } from '../memberPriceTypes'\nimport { ProductVariant } from '@anker-in/lib'\nimport { atobID } from './atobID'\n\n// \u83B7\u53D6\u4F1A\u5458\u4EF7\u6298\u6263\u914D\u7F6E\nexport const getFunctionMemberPriceDiscountConfig = ({\n config,\n variant,\n}: {\n config?: FunctionMemberPriceConfig[]\n variant?: ProductVariant\n}) => {\n let memberPriceDiscountConfig: DiscountConfig | undefined\n let activeMemberPriceConfig: FunctionMemberPriceConfig | undefined\n\n if (!config || !variant) {\n return {\n memberPriceDiscountConfig,\n activeMemberPriceConfig,\n }\n }\n\n for (const configItem of config) {\n memberPriceDiscountConfig = configItem.result_detail.member_discounts?.find(discountItem => {\n if (discountItem.main_products.all_store_variant) {\n return discountItem\n }\n\n return discountItem.main_products.variants.find(\n variantConfig => String(variantConfig.variant_id) === atobID(variant.id as string)\n )\n })?.discount_conf\n\n if (memberPriceDiscountConfig) {\n activeMemberPriceConfig = configItem\n break\n }\n }\n\n if (!memberPriceDiscountConfig) {\n return {\n memberPriceDiscountConfig,\n activeMemberPriceConfig,\n }\n }\n\n return {\n memberPriceDiscountConfig,\n activeMemberPriceConfig,\n }\n}\n"],
5
+ "mappings": "AAEA,OAAS,UAAAA,MAAc,WAGhB,MAAMC,EAAuC,CAAC,CACnD,OAAAC,EACA,QAAAC,CACF,IAGM,CACJ,IAAIC,EACAC,EAEJ,GAAI,CAACH,GAAU,CAACC,EACd,MAAO,CACL,0BAAAC,EACA,wBAAAC,CACF,EAGF,UAAWC,KAAcJ,EAWvB,GAVAE,EAA4BE,EAAW,cAAc,kBAAkB,KAAKC,GACtEA,EAAa,cAAc,kBACtBA,EAGFA,EAAa,cAAc,SAAS,KACzCC,GAAiB,OAAOA,EAAc,UAAU,IAAMR,EAAOG,EAAQ,EAAY,CACnF,CACD,GAAG,cAEAC,EAA2B,CAC7BC,EAA0BC,EAC1B,KACF,CAGF,OAAKF,EAOE,CACL,0BAAAA,EACA,wBAAAC,CACF,EATS,CACL,0BAAAD,EACA,wBAAAC,CACF,CAOJ",
6
+ "names": ["atobID", "getFunctionMemberPriceDiscountConfig", "config", "variant", "memberPriceDiscountConfig", "activeMemberPriceConfig", "configItem", "discountItem", "variantConfig"]
7
+ }
@@ -0,0 +1,6 @@
1
+ import { ProductVariant } from '@anker-in/lib';
2
+ declare const variantGetCoupon: ({ variant, channel, }: {
3
+ variant?: ProductVariant;
4
+ channel?: string;
5
+ }) => any;
6
+ export default variantGetCoupon;
@@ -0,0 +1,2 @@
1
+ import{atobID as a}from"./atobID";const r=({variant:e,channel:i=""})=>{if(!e)return;const s="wsch";return(e?.metafields?.discountCodeApp||[])?.filter(t=>{const n=a(e.id);return(!t?.ends_at||new Date(t?.ends_at).getTime()>new Date().getTime())&&new Date(t?.starts_at).getTime()<=new Date().getTime()&&t.variant_shopify_id===+(n||"")&&(i?t?.title?.toLocaleLowerCase().includes(i):!t?.title?.toLocaleLowerCase().includes(s))})?.[0]};var f=r;export{f as default};
2
+ //# sourceMappingURL=variantGetCoupon.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/components/credits/context/utils/variantGetCoupon.ts"],
4
+ "sourcesContent": ["import { ProductVariant } from '@anker-in/lib'\nimport { atobID } from './atobID'\n\nconst variantGetCoupon = ({\n variant,\n channel = '',\n}: {\n variant?: ProductVariant\n channel?: string\n}) => {\n if (!variant) return undefined\n\n const hideChannel = 'wsch'\n const discountCodeApp = variant?.metafields?.discountCodeApp || []\n\n const results = discountCodeApp?.filter((coupon: any) => {\n const variantId = atobID(variant.id as string)\n const isActive =\n (!coupon?.ends_at || new Date(coupon?.ends_at).getTime() > new Date().getTime()) &&\n new Date(coupon?.starts_at).getTime() <= new Date().getTime() &&\n coupon.variant_shopify_id === +(variantId || '')\n\n return (\n isActive &&\n (channel\n ? coupon?.title?.toLocaleLowerCase().includes(channel)\n : !coupon?.title?.toLocaleLowerCase().includes(hideChannel))\n )\n })\n\n return results?.[0]\n}\n\nexport default variantGetCoupon\n"],
5
+ "mappings": "AACA,OAAS,UAAAA,MAAc,WAEvB,MAAMC,EAAmB,CAAC,CACxB,QAAAC,EACA,QAAAC,EAAU,EACZ,IAGM,CACJ,GAAI,CAACD,EAAS,OAEd,MAAME,EAAc,OAkBpB,OAjBwBF,GAAS,YAAY,iBAAmB,CAAC,IAEhC,OAAQG,GAAgB,CACvD,MAAMC,EAAYN,EAAOE,EAAQ,EAAY,EAM7C,OAJG,CAACG,GAAQ,SAAW,IAAI,KAAKA,GAAQ,OAAO,EAAE,QAAQ,EAAI,IAAI,KAAK,EAAE,QAAQ,IAC9E,IAAI,KAAKA,GAAQ,SAAS,EAAE,QAAQ,GAAK,IAAI,KAAK,EAAE,QAAQ,GAC5DA,EAAO,qBAAuB,EAAEC,GAAa,MAI5CH,EACGE,GAAQ,OAAO,kBAAkB,EAAE,SAASF,CAAO,EACnD,CAACE,GAAQ,OAAO,kBAAkB,EAAE,SAASD,CAAW,EAEhE,CAAC,IAEgB,CAAC,CACpB,EAEA,IAAOG,EAAQN",
6
+ "names": ["atobID", "variantGetCoupon", "variant", "channel", "hideChannel", "coupon", "variantId", "variantGetCoupon_default"]
7
+ }
@@ -0,0 +1,4 @@
1
+ import { type CreditsAnkersolixTaskProps } from './type';
2
+ export declare const CreditsAnkersolixTask: ({ copy, classNames, id }: CreditsAnkersolixTaskProps & {
3
+ id?: string;
4
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import{Fragment as A,jsx as e,jsxs as i}from"react/jsx-runtime";import{Button as y,Container as P,Heading as b,Picture as z,Text as _}from"@anker-in/headless-ui";import{ChevronDownIcon as E,ChevronUpIcon as H}from"@heroicons/react/24/outline";import{motion as j}from"framer-motion";import{useMemo as q,useState as d}from"react";import{TaskType as g}from"./type";import{useActions as V}from"../creditsWaysToGetCredits/useActions";import{useCreditsContext as G}from"../context/provider";import{classNames as h,useHeadlessContext as J,ROUNDED_BRANDS as K}from"@anker-in/lib";import{useRegistration as Q}from"../../registration";import{CreditsUploadReceiptModal as W}from"../modal/creditsUploadReceiptModal";import{CreditsSubscribeModal as X}from"../modal/subscribeModal";const re=({copy:s,classNames:Y,id:v})=>{const[l,k]=d(!1),{profile:M}=G(),{authCodeActivate:R}=Q(),{brand:L}=J(),p=K.includes(L),m=!!M,[T,C]=d(!1),[U,x]=d(!1),[F,O]=d(!1),[N,B]=d(!1),{actions:u}=V({copy:s,subscribe:{openSubscribePopup:()=>x(!0),isSuccess:F},uploadReceipt:{openUploadReceiptPopup:()=>C(!0),isSuccess:N}}),w=q(()=>{const t=s.list.map(n=>{if(!u[n.id])return;const{finished:o,notLogin:S,notFinished:f,completed:D}=u[n.id];let r="",c,I;return m?o?(r=D.buttonLabel,c=void 0):(r=f.buttonLabel,c=f.handleClick,I=f.link):(r=S.buttonLabel,c=S.handleClick),{...n,buttonLabel:r,handleClick:c,finished:o,link:I}}).filter(Boolean);return m?t.sort((n,o)=>n?.finished&&!o?.finished?1:!n?.finished&&o?.finished?-1:0):t},[u,s.list,m]),a=w.length>3;return i(P,{id:v,className:"[&>div]:l:!px-0 bg-[#F5F5F7]",children:[e(b,{as:"h2",size:"4",html:s.title,className:"md:px-[16px]"}),i("div",{className:h("mt-[24px] p-[32px] md-l:p-[32px] md:p-[16px] relative overflow-hidden",p?"rounded-[8px]":"",!p&&"l:rounded-none"),style:{background:"linear-gradient(180deg, rgba(255, 241, 214, 0) 39.51%, #F4CA81 119.53%)"},children:[e("div",{className:"absolute inset-0 pointer-events-none -z-10",style:{background:"radial-gradient(ellipse 130% 205% at 45% -20%, #FFF6EA 0%, #FFFFFF 73%, #FFF1D6 100%)"}}),i("div",{className:"flex items-center justify-between h-[560px] md:h-auto md:flex-col md:items-start l:h-auto l:mb-[16px] l:flex-col-reverse l:items-start",children:[i("div",{className:"flex flex-col gap-[8px]",children:[e(b,{as:"h3",size:4,html:s?.subtitle,className:"text-[32px] font-bold text-[#080a0f] tracking-[-1.28px] leading-[1.2] xl:text-[24px]"}),e("div",{className:"flex items-center gap-[8px]",children:e("p",{className:"text-[48px] font-bold tracking-[-1.92px] leading-none bg-gradient-to-r from-[#2c7ed0] via-[#00a9e1] via-43% to-[#00db84] bg-clip-text text-transparent xl-xxl:text-[40px] l-xl:text-[32px] l:text-[24px]",dangerouslySetInnerHTML:{__html:s.equalCredits}})})]}),s.mainImage?.url&&e(z,{className:"w-full max-w-[50%] md:max-w-full md:mt-[24px] l:max-w-full l:mt-[24px]",source:s.mainImage.url})]}),i("div",{className:"relative",children:[i(j.div,{className:h("grid grid-cols-3 gap-[16px] overflow-hidden md:grid-cols-1 md-l:grid-cols-2 min-md:!h-auto"),initial:{height:a?512:"auto"},animate:{height:l||!a?"auto":512},transition:{duration:.3},onAnimationComplete:()=>{if(!l&&a&&window.screen.width<768){const t=document.getElementById(v||"ankersolix-task");t&&t.scrollIntoView({behavior:"smooth",block:"end"})}},children:[w.map(t=>i("div",{className:h("flex min-h-[241px] xl-xxl:min-h-[192px] l:min-h-[160px] l-xl:min-h-[170px] flex-col justify-between bg-white p-[32px] md:p-[16px] l:p-[24px]",""),children:[i("div",{children:[e(b,{as:"h4",html:t.title,size:2,className:"text-[24px] font-bold text-[#080a0f] tracking-[-0.96px] leading-[1.2] text-pretty md:text-[18px] l:text-[20px]"}),i("div",{className:"mt-[8px] flex items-center gap-[4px]",children:[e(z,{className:"size-[24px] [&_path]:size-full",source:"https://cdn.shopify.com/s/files/1/0511/6346/3874/files/20250902-153351.png?v=1756798450"}),e(_,{as:"p",html:t.credits,size:2,className:"text-[18px] font-bold text-[#080a0f] tracking-[-0.36px] leading-[1.4] md:text-[16px]"})]})]}),t.handleClick&&!(t.id===g.UploadReceipt&&N)&&!(t.id===g.Activate&&R.isActivateSuccess)&&!(t.id===g.Subscribe&&F)?e(y,{as:t.link?"a":"button",...t.link&&{href:t.link},...t.handleClick&&{onClick:t.handleClick},variant:"primary",size:"lg",className:"mt-[24px] w-fit bg-[#080a0f] text-white text-[16px] font-bold tracking-[-0.64px] leading-[1.2]",children:t.buttonLabel}):e(y,{variant:"primary",size:"lg",className:"mt-[24px] w-fit bg-[#080a0f] text-white text-[16px] font-bold tracking-[-0.64px] leading-[1.2]",disabled:!0,children:t.buttonLabel})]},t.id)),!l&&a&&e("div",{className:"absolute inset-0 pointer-events-none min-md:hidden",style:{background:"linear-gradient(180deg, rgba(244, 202, 129, 0) 66.37%, #f4ca81 100%)"}})]}),a&&e(A,{children:l?e("button",{className:"mx-auto mt-[12px] block w-fit min-md:hidden",onClick:()=>{k(!1)},children:e(H,{className:"size-[40px] rounded-full bg-[#FFFFFF33] p-[8px]"})}):e(A,{children:e("div",{className:"absolute bottom-0 flex w-full translate-y-1/2 justify-center min-md:hidden",children:e("button",{className:"w-fit",onClick:()=>k(!l),children:e(E,{className:"size-[40px] rounded-full bg-[#FFFFFF33] p-[8px]"})})})})})]})]}),s.receipt&&e(W,{isOpen:T,onClose:()=>{C(!1)},copy:s.receipt,onSuccess:()=>{B(!0)}}),s.subscribe&&e(X,{copy:s.subscribe,onSuccess:()=>{O(!0),setTimeout(()=>{x(!1)},3e3)},isOpen:U,onClose:()=>{x(!1)}})]})};export{re as CreditsAnkersolixTask};
2
+ //# sourceMappingURL=CreditsAnkersolixTask.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.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 CreditsAnkersolixTaskProps } from './type'\nimport { useActions } from '../creditsWaysToGetCredits/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 CreditsAnkersolixTask = ({ copy, classNames, id }: CreditsAnkersolixTaskProps & { 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 // \u53EA\u6709\u5927\u4E8E3\u4E2A\u4EFB\u52A1\u65F6\u624D\u663E\u793A\u8499\u5C42\n const shouldShowMask = list.length > 3\n\n return (\n <Container id={id} className=\"[&>div]:l:!px-0 bg-[#F5F5F7]\">\n <Heading as=\"h2\" size=\"4\" html={copy.title} className='md:px-[16px]'/>\n <div\n className={cn(\n 'mt-[24px] p-[32px] md-l:p-[32px] md:p-[16px] relative overflow-hidden',\n rounded ? 'rounded-[8px]' : '',\n !rounded && 'l:rounded-none'\n )}\n style={{\n background: 'linear-gradient(180deg, rgba(255, 241, 214, 0) 39.51%, #F4CA81 119.53%)',\n }}\n >\n {/* \u5F84\u5411\u6E10\u53D8\u80CC\u666F\u5C42 - \u4F7F\u7528\u4F2A\u5143\u7D20\u6A21\u62DF */}\n <div\n className=\"absolute inset-0 pointer-events-none -z-10\"\n style={{\n background: 'radial-gradient(ellipse 130% 205% at 45% -20%, #FFF6EA 0%, #FFFFFF 73%, #FFF1D6 100%)',\n }}\n />\n {/* \u526F\u6807\u9898\u548C\u88C5\u9970\u56FE\u90E8\u5206 */}\n <div className=\"flex items-center justify-between h-[560px] md:h-auto md:flex-col md:items-start l:h-auto l:mb-[16px] l:flex-col-reverse l:items-start\">\n <div className=\"flex flex-col gap-[8px]\">\n <Heading\n as=\"h3\"\n size={4}\n html={copy?.subtitle}\n className=\"text-[32px] font-bold text-[#080a0f] tracking-[-1.28px] leading-[1.2] xl:text-[24px]\"\n />\n <div className=\"flex items-center gap-[8px]\">\n <p\n className=\"text-[48px] font-bold tracking-[-1.92px] leading-none bg-gradient-to-r from-[#2c7ed0] via-[#00a9e1] via-43% to-[#00db84] bg-clip-text text-transparent xl-xxl:text-[40px] l-xl:text-[32px] l:text-[24px]\"\n dangerouslySetInnerHTML={{ __html: copy.equalCredits }}\n />\n </div>\n </div>\n {copy.mainImage?.url && (\n <Picture className=\"w-full max-w-[50%] md:max-w-full md:mt-[24px] l:max-w-full l:mt-[24px]\" source={copy.mainImage.url} />\n )}\n </div>\n\n {/* \u5361\u7247\u5217\u8868 */}\n <div className=\"relative\">\n <motion.div\n className={cn(\n 'grid grid-cols-3 gap-[16px] overflow-hidden md:grid-cols-1 md-l:grid-cols-2 min-md:!h-auto'\n )}\n initial={{ height: shouldShowMask ? 512 : 'auto' }}\n animate={{ height: showMore || !shouldShowMask ? 'auto' : 512 }}\n transition={{ duration: 0.3 }}\n onAnimationComplete={() => {\n if (!showMore && shouldShowMask && window.screen.width < 768) {\n const section = document.getElementById(id || 'ankersolix-task')\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-[241px] xl-xxl:min-h-[192px] l:min-h-[160px] l-xl:min-h-[170px] flex-col justify-between bg-white p-[32px] md:p-[16px] l:p-[24px]',\n rounded ? '' : ''\n )}\n >\n <div>\n <Heading\n as=\"h4\"\n html={item.title}\n size={2}\n className=\"text-[24px] font-bold text-[#080a0f] tracking-[-0.96px] leading-[1.2] text-pretty md:text-[18px] l:text-[20px]\"\n />\n <div className=\"mt-[8px] flex items-center gap-[4px]\">\n <Picture\n className=\"size-[24px] [&_path]:size-full\"\n source=\"https://cdn.shopify.com/s/files/1/0511/6346/3874/files/20250902-153351.png?v=1756798450\"\n />\n <Text\n as=\"p\"\n html={item.credits}\n size={2}\n className=\"text-[18px] font-bold text-[#080a0f] tracking-[-0.36px] leading-[1.4] md:text-[16px]\"\n />\n </div>\n </div>\n\n {item.handleClick &&\n !(item.id === TaskType.UploadReceipt && isUploadReceiptSuccess) &&\n !(item.id === TaskType.Activate && authCodeActivate.isActivateSuccess) &&\n !(item.id === TaskType.Subscribe && isSubscribeSuccess) ? (\n <Button\n as={item.link ? 'a' : 'button'}\n {...(item.link && { href: item.link })}\n {...(item.handleClick && { onClick: item.handleClick })}\n variant=\"primary\"\n size=\"lg\"\n className=\"mt-[24px] w-fit bg-[#080a0f] text-white text-[16px] font-bold tracking-[-0.64px] leading-[1.2]\"\n >\n {item.buttonLabel}\n </Button>\n ) : (\n <Button\n variant=\"primary\"\n size=\"lg\"\n className=\"mt-[24px] w-fit bg-[#080a0f] text-white text-[16px] font-bold tracking-[-0.64px] leading-[1.2]\"\n disabled\n >\n {item.buttonLabel}\n </Button>\n )}\n </div>\n ))}\n {!showMore && shouldShowMask && (\n <div\n className=\"absolute inset-0 pointer-events-none min-md:hidden\"\n style={{ background: 'linear-gradient(180deg, rgba(244, 202, 129, 0) 66.37%, #f4ca81 100%)' }}\n ></div>\n )}\n </motion.div>\n {shouldShowMask && (\n <>\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 </>\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": "AAiGM,OAmIU,YAAAA,EAnIV,OAAAC,EAoBI,QAAAC,MApBJ,oBAjGN,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,MAAiD,SAC1D,OAAS,cAAAC,MAAkB,wCAC3B,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,GAAwB,CAAC,CAAE,KAAAC,EAAM,WAAAC,EAAY,GAAAC,CAAG,IAAoD,CAC/G,KAAM,CAACC,EAAUC,CAAW,EAAIf,EAAS,EAAK,EACxC,CAAE,QAAAgB,CAAQ,EAAIb,EAAkB,EAChC,CAAE,iBAAAc,CAAiB,EAAIV,EAAgB,EACvC,CAAE,MAAAW,CAAM,EAAIb,EAAmB,EAC/Bc,EAAUb,EAAe,SAASY,CAAK,EACvCE,EAAU,CAAC,CAACJ,EAEZ,CAACK,EAA0BC,CAA2B,EAAItB,EAAS,EAAK,EACxE,CAACuB,EAAsBC,CAAuB,EAAIxB,EAAS,EAAK,EAChE,CAACyB,EAAoBC,CAAqB,EAAI1B,EAAS,EAAK,EAC5D,CAAC2B,EAAwBC,CAAyB,EAAI5B,EAAS,EAAK,EAEpE,CAAE,QAAA6B,CAAQ,EAAI3B,EAAW,CAC7B,KAAAS,EACA,UAAW,CACT,mBAAoB,IAAMa,EAAwB,EAAI,EACtD,UAAWC,CACb,EACA,cAAe,CACb,uBAAwB,IAAMH,EAA4B,EAAI,EAC9D,UAAWK,CACb,CACF,CAAC,EACKG,EAAO/B,EAAQ,IAAM,CACzB,MAAM+B,EAAOnB,EAAK,KACf,IAAIoB,GAAQ,CACX,GAAI,CAACF,EAAQE,EAAK,EAA0B,EAC1C,OAEF,KAAM,CAAE,SAAAC,EAAU,SAAAC,EAAU,YAAAC,EAAa,UAAAC,CAAU,EAAIN,EAAQE,EAAK,EAA0B,EAC9F,IAAIK,EAAc,GACdC,EACAC,EACJ,OAAKlB,EAGMY,GACTI,EAAcD,EAAU,YACxBE,EAAc,SAEdD,EAAcF,EAAY,YAC1BG,EAAcH,EAAY,YAC1BI,EAAQJ,EAAiC,OARzCE,EAAcH,EAAS,YACvBI,EAAcJ,EAAS,aASlB,CACL,GAAGF,EACH,YAAAK,EACA,YAAAC,EACA,SAAAL,EACA,KAAAM,CACF,CACF,CAAC,EACA,OAAO,OAAO,EAWjB,OAAIlB,EACKU,EAAK,KAAK,CAACS,EAAGC,IACfD,GAAG,UAAY,CAACC,GAAG,SACd,EAEL,CAACD,GAAG,UAAYC,GAAG,SACd,GAEF,CACR,EAEMV,CAEX,EAAG,CAACD,EAASlB,EAAK,KAAMS,CAAO,CAAC,EAG1BqB,EAAiBX,EAAK,OAAS,EAErC,OACExC,EAACE,EAAA,CAAU,GAAIqB,EAAI,UAAU,+BAC3B,UAAAxB,EAACI,EAAA,CAAQ,GAAG,KAAK,KAAK,IAAI,KAAMkB,EAAK,MAAO,UAAU,eAAc,EACpErB,EAAC,OACC,UAAWc,EACT,wEACAe,EAAU,gBAAkB,GAC5B,CAACA,GAAW,gBACd,EACA,MAAO,CACL,WAAY,yEACd,EAGA,UAAA9B,EAAC,OACC,UAAU,6CACV,MAAO,CACL,WAAY,uFACd,EACF,EAEAC,EAAC,OAAI,UAAU,yIACb,UAAAA,EAAC,OAAI,UAAU,0BACb,UAAAD,EAACI,EAAA,CACC,GAAG,KACH,KAAM,EACN,KAAMkB,GAAM,SACZ,UAAU,uFACZ,EACAtB,EAAC,OAAI,UAAU,8BACb,SAAAA,EAAC,KACC,UAAU,2MACV,wBAAyB,CAAE,OAAQsB,EAAK,YAAa,EACvD,EACF,GACF,EACCA,EAAK,WAAW,KACftB,EAACK,EAAA,CAAQ,UAAU,yEAAyE,OAAQiB,EAAK,UAAU,IAAK,GAE5H,EAGArB,EAAC,OAAI,UAAU,WACb,UAAAA,EAACQ,EAAO,IAAP,CACC,UAAWM,EACT,4FACF,EACA,QAAS,CAAE,OAAQqC,EAAiB,IAAM,MAAO,EACjD,QAAS,CAAE,OAAQ3B,GAAY,CAAC2B,EAAiB,OAAS,GAAI,EAC9D,WAAY,CAAE,SAAU,EAAI,EAC5B,oBAAqB,IAAM,CACzB,GAAI,CAAC3B,GAAY2B,GAAkB,OAAO,OAAO,MAAQ,IAAK,CAC5D,MAAMC,EAAU,SAAS,eAAe7B,GAAM,iBAAiB,EAC3D6B,GACFA,EAAQ,eAAe,CAAE,SAAU,SAAU,MAAO,KAAM,CAAC,CAE/D,CACF,EAEC,UAAAZ,EAAK,IAAIC,GACRzC,EAAC,OAEC,UAAWc,EACT,+IACU,EACZ,EAEA,UAAAd,EAAC,OACC,UAAAD,EAACI,EAAA,CACC,GAAG,KACH,KAAMsC,EAAK,MACX,KAAM,EACN,UAAU,iHACZ,EACAzC,EAAC,OAAI,UAAU,uCACb,UAAAD,EAACK,EAAA,CACC,UAAU,iCACV,OAAO,0FACT,EACAL,EAACM,EAAA,CACC,GAAG,IACH,KAAMoC,EAAK,QACX,KAAM,EACN,UAAU,uFACZ,GACF,GACF,EAECA,EAAK,aACN,EAAEA,EAAK,KAAO9B,EAAS,eAAiB0B,IACxC,EAAEI,EAAK,KAAO9B,EAAS,UAAYgB,EAAiB,oBACpD,EAAEc,EAAK,KAAO9B,EAAS,WAAawB,GAClCpC,EAACE,EAAA,CACC,GAAIwC,EAAK,KAAO,IAAM,SACrB,GAAIA,EAAK,MAAQ,CAAE,KAAMA,EAAK,IAAK,EACnC,GAAIA,EAAK,aAAe,CAAE,QAASA,EAAK,WAAY,EACrD,QAAQ,UACR,KAAK,KACL,UAAU,iGAET,SAAAA,EAAK,YACR,EAEA1C,EAACE,EAAA,CACC,QAAQ,UACR,KAAK,KACL,UAAU,iGACV,SAAQ,GAEP,SAAAwC,EAAK,YACR,IAjDGA,EAAK,EAmDZ,CACD,EACA,CAACjB,GAAY2B,GACZpD,EAAC,OACC,UAAU,qDACV,MAAO,CAAE,WAAY,sEAAuE,EAC7F,GAEL,EACCoD,GACCpD,EAAAD,EAAA,CACG,SAAA0B,EACCzB,EAAC,UACC,UAAU,8CACV,QAAS,IAAM,CACb0B,EAAY,EAAK,CACnB,EAEA,SAAA1B,EAACQ,EAAA,CAAc,UAAU,kDAAkD,EAC7E,EAEAR,EAAAD,EAAA,CACE,SAAAC,EAAC,OAAI,UAAU,6EACb,SAAAA,EAAC,UAAO,UAAU,QAAQ,QAAS,IAAM0B,EAAY,CAACD,CAAQ,EAC5D,SAAAzB,EAACO,EAAA,CAAgB,UAAU,kDAAkD,EAC/E,EACF,EACF,EAEJ,GAEJ,GACF,EACCe,EAAK,SACJtB,EAACmB,EAAA,CACC,OAAQa,EACR,QAAS,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", "CreditsAnkersolixTask", "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", "shouldShowMask", "section"]
7
+ }
@@ -0,0 +1,2 @@
1
+ export * from './type';
2
+ export * from './CreditsAnkersolixTask';
@@ -0,0 +1,2 @@
1
+ export*from"./type";export*from"./CreditsAnkersolixTask";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/components/credits/creditsAnkersolixTask/index.ts"],
4
+ "sourcesContent": ["export * from './type'\nexport * from './CreditsAnkersolixTask'\n"],
5
+ "mappings": "AAAA,WAAc,SACd,WAAc",
6
+ "names": []
7
+ }
@@ -0,0 +1 @@
1
+ export { type BenefitItem, type CreditsWaysToGetCreditsCopy as CreditsAnkersolixTaskCopy, type CreditsWaysToGetCreditsProps as CreditsAnkersolixTaskProps, TaskType, } from '../creditsWaysToGetCredits/type';
@@ -0,0 +1,2 @@
1
+ import{TaskType as t}from"../creditsWaysToGetCredits/type";export{t as TaskType};
2
+ //# sourceMappingURL=type.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/components/credits/creditsAnkersolixTask/type.ts"],
4
+ "sourcesContent": ["// \u76F4\u63A5\u5F15\u7528\u65E7\u7EC4\u4EF6\u7684\u7C7B\u578B\nexport {\n type BenefitItem,\n type CreditsWaysToGetCreditsCopy as CreditsAnkersolixTaskCopy,\n type CreditsWaysToGetCreditsProps as CreditsAnkersolixTaskProps,\n TaskType,\n} from '../creditsWaysToGetCredits/type'\n"],
5
+ "mappings": "AACA,OAIE,YAAAA,MACK",
6
+ "names": ["TaskType"]
7
+ }
@@ -2,22 +2,23 @@ type Img = {
2
2
  url: string;
3
3
  alt: string;
4
4
  };
5
- type BannerProps = {
6
- copy: {
7
- pcImg: Img;
8
- laptopImg: Img;
9
- mobileImg: Img;
10
- joinNow: string;
11
- loginIn: string;
12
- login: {
13
- title: string;
14
- description: string;
15
- };
16
- unLogin: {
17
- title: string;
18
- description: string;
19
- };
5
+ export type CreditsBannerCopy = {
6
+ pcImg: Img;
7
+ laptopImg: Img;
8
+ mobileImg: Img;
9
+ joinNow: string;
10
+ loginIn: string;
11
+ login: {
12
+ title: string;
13
+ description: string;
14
+ };
15
+ unLogin: {
16
+ title: string;
17
+ description: string;
20
18
  };
21
19
  };
22
- export declare function CreditsBanner({ copy }: BannerProps): import("react/jsx-runtime").JSX.Element;
20
+ export declare function CreditsBanner({ copy, id }: {
21
+ copy: CreditsBannerCopy;
22
+ id?: string;
23
+ }): import("react/jsx-runtime").JSX.Element;
23
24
  export {};
@@ -1,2 +1,2 @@
1
- import{Fragment as I,jsx as i,jsxs as l}from"react/jsx-runtime";import{Button as s,Container as p,Heading as d,Picture as c,Text as u}from"@anker-in/headless-ui";import f from"classnames";import{useCreditsContext as x}from"../context/provider";function C({copy:t}){const{profile:e,openSignInPopup:r,openSignUpPopup:o}=x(),n=e?Object.keys(e).length!==0:!1,m=e?.first_name?e?.first_name+" "+e?.last_name:e?.email?.split("@")[0],a=g=>{g==="primary"?o():r()};return i(I,{children:l("div",{className:" relative w-full",children:[i(c,{className:"aspect-h-[804] aspect-w-[1920] md:aspect-h-[660] md:aspect-w-[390] md-l:aspect-h-[660] md-l:aspect-w-[768]",source:`${t.pcImg?.url}, ${t.laptopImg?.url} 1024, ${t.mobileImg?.url} 768`,alt:t.pcImg?.alt,loading:"eager"}),n&&i("div",{className:"absolute inset-0 ",style:{background:"linear-gradient(180deg, rgba(245, 245, 247, 0) 70.31%, #F5F5F7 100%)"}}),i(p,{className:"l:h-auto !absolute inset-0 mx-auto grid h-full",asChild:!0,children:i("div",{className:"grid grid-cols-12",children:l("div",{className:"l:col-span-12 l:justify-start l:truncate l:pt-[64px] col-span-5 flex h-full flex-col justify-center text-[#1F2021]",children:[i(d,{as:"h1",size:"5",html:n?t.login.title?.replace("$name",m||""):t.unLogin.title}),i(u,{size:"3",className:"l:mt-[4px] l-xxl:text-[14px] mt-[16px]",html:n?t.login.description:t.unLogin.description}),!n&&l("div",{className:f("mt-[32px] grid w-fit grid-flow-col gap-[12px] l:mt-[24px]",n&&"hidden"),children:[i(s,{variant:"secondary",size:"lg",onClick:()=>{a("primary")},children:t.joinNow}),i(s,{variant:"primary",size:"lg",onClick:()=>{a("secondary")},children:t.loginIn})]})]})})})]})})}export{C as CreditsBanner};
1
+ import{Fragment as h,jsx as i,jsxs as l}from"react/jsx-runtime";import{Button as s,Container as d,Heading as c,Picture as u,Text as x}from"@anker-in/headless-ui";import f from"classnames";import{useCreditsContext as I}from"../context/provider";function w({copy:t,id:r}){const{profile:e,openSignInPopup:o,openSignUpPopup:g}=I(),n=e?Object.keys(e).length!==0:!1,m=e?.first_name?e?.first_name+" "+e?.last_name:e?.email?.split("@")[0],a=p=>{p==="primary"?g():o()};return i(h,{children:l("div",{id:r,className:" relative w-full",children:[i(u,{className:"aspect-h-[804] aspect-w-[1920] md:aspect-h-[660] md:aspect-w-[390] md-l:aspect-h-[660] md-l:aspect-w-[768]",source:`${t.pcImg?.url}, ${t.laptopImg?.url} 1024, ${t.mobileImg?.url} 768`,alt:t.pcImg?.alt,loading:"eager"}),n&&i("div",{className:"absolute inset-0 ",style:{background:"linear-gradient(180deg, rgba(245, 245, 247, 0) 70.31%, #F5F5F7 100%)"}}),i(d,{className:"l:h-auto !absolute inset-0 mx-auto grid h-full",asChild:!0,children:i("div",{className:"grid grid-cols-12",children:l("div",{className:"l:col-span-12 l:justify-start l:truncate l:pt-[64px] col-span-5 flex h-full flex-col justify-center text-[#1F2021]",children:[i(c,{as:"h1",size:"5",html:n?t.login.title?.replace("$name",m||""):t.unLogin.title}),i(x,{size:"3",className:"l:mt-[4px] l-xxl:text-[14px] mt-[16px]",html:n?t.login.description:t.unLogin.description}),!n&&l("div",{className:f("mt-[32px] grid w-fit grid-flow-col gap-[12px] l:mt-[24px]",n&&"hidden"),children:[i(s,{variant:"secondary",size:"lg",onClick:()=>{a("primary")},children:t.joinNow}),i(s,{variant:"primary",size:"lg",onClick:()=>{a("secondary")},children:t.loginIn})]})]})})})]})})}export{w as CreditsBanner};
2
2
  //# sourceMappingURL=index.js.map