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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (918) hide show
  1. package/dist/cjs/components/chat/{chat-context.js → chatContext.js} +1 -1
  2. package/dist/cjs/components/chat/{chat-context.js.map → chatContext.js.map} +2 -2
  3. package/dist/cjs/components/chat/index.js +1 -1
  4. package/dist/cjs/components/chat/index.js.map +3 -3
  5. package/dist/cjs/components/credits/context/const.d.ts +2 -1
  6. package/dist/cjs/components/credits/context/const.js +1 -1
  7. package/dist/cjs/components/credits/context/const.js.map +2 -2
  8. package/dist/cjs/components/credits/context/hooks/useActivities.js +1 -1
  9. package/dist/cjs/components/credits/context/hooks/useActivities.js.map +3 -3
  10. package/dist/cjs/components/credits/context/hooks/useAddressValidate.js +1 -1
  11. package/dist/cjs/components/credits/context/hooks/useAddressValidate.js.map +3 -3
  12. package/dist/cjs/components/credits/context/hooks/useAlpcFetch.js +1 -1
  13. package/dist/cjs/components/credits/context/hooks/useAlpcFetch.js.map +3 -3
  14. package/dist/cjs/components/credits/context/hooks/useCountries.js +1 -1
  15. package/dist/cjs/components/credits/context/hooks/useCountries.js.map +3 -3
  16. package/dist/cjs/components/credits/context/hooks/useFunctionMemberPrice.d.ts +7 -0
  17. package/dist/cjs/components/credits/context/hooks/useFunctionMemberPrice.js +2 -0
  18. package/dist/cjs/components/credits/context/hooks/useFunctionMemberPrice.js.map +7 -0
  19. package/dist/cjs/components/credits/context/hooks/useMyRewards.js +1 -1
  20. package/dist/cjs/components/credits/context/hooks/useMyRewards.js.map +3 -3
  21. package/dist/cjs/components/credits/context/hooks/useRedeemAndBuy.d.ts +5 -10
  22. package/dist/cjs/components/credits/context/hooks/useRedeemAndBuy.js +1 -1
  23. package/dist/cjs/components/credits/context/hooks/useRedeemAndBuy.js.map +3 -3
  24. package/dist/cjs/components/credits/context/hooks/useRedeemCoupon.d.ts +2 -1
  25. package/dist/cjs/components/credits/context/hooks/useRedeemCoupon.js +1 -1
  26. package/dist/cjs/components/credits/context/hooks/useRedeemCoupon.js.map +3 -3
  27. package/dist/cjs/components/credits/context/hooks/useRedeemProduct.js +1 -1
  28. package/dist/cjs/components/credits/context/hooks/useRedeemProduct.js.map +3 -3
  29. package/dist/cjs/components/credits/context/hooks/useRedeemableList.js +1 -1
  30. package/dist/cjs/components/credits/context/hooks/useRedeemableList.js.map +3 -3
  31. package/dist/cjs/components/credits/context/hooks/useSendEmailValidation.js +1 -1
  32. package/dist/cjs/components/credits/context/hooks/useSendEmailValidation.js.map +3 -3
  33. package/dist/cjs/components/credits/context/hooks/useSubscribed.js +1 -1
  34. package/dist/cjs/components/credits/context/hooks/useSubscribed.js.map +3 -3
  35. package/dist/cjs/components/credits/context/hooks/useSubscriptions.d.ts +7 -3
  36. package/dist/cjs/components/credits/context/hooks/useSubscriptions.js +1 -1
  37. package/dist/cjs/components/credits/context/hooks/useSubscriptions.js.map +3 -3
  38. package/dist/cjs/components/credits/context/hooks/useUploadReceipt.js +1 -1
  39. package/dist/cjs/components/credits/context/hooks/useUploadReceipt.js.map +2 -2
  40. package/dist/cjs/components/credits/context/memberPriceConst.d.ts +10 -0
  41. package/dist/cjs/components/credits/context/memberPriceConst.js +2 -0
  42. package/dist/cjs/components/credits/context/memberPriceConst.js.map +7 -0
  43. package/dist/cjs/components/credits/context/memberPriceTypes.d.ts +46 -0
  44. package/dist/cjs/components/credits/context/memberPriceTypes.js +2 -0
  45. package/dist/cjs/components/credits/context/memberPriceTypes.js.map +7 -0
  46. package/dist/cjs/components/credits/context/provider.d.ts +11 -33
  47. package/dist/cjs/components/credits/context/provider.js +1 -1
  48. package/dist/cjs/components/credits/context/provider.js.map +3 -3
  49. package/dist/cjs/components/credits/context/utils/atobID.d.ts +1 -0
  50. package/dist/cjs/components/credits/context/utils/atobID.js +2 -0
  51. package/dist/cjs/components/credits/context/utils/atobID.js.map +7 -0
  52. package/dist/cjs/components/credits/context/utils/functionDiscountCalculate.d.ts +5 -0
  53. package/dist/cjs/components/credits/context/utils/functionDiscountCalculate.js +2 -0
  54. package/dist/cjs/components/credits/context/utils/functionDiscountCalculate.js.map +7 -0
  55. package/dist/cjs/components/credits/context/utils/getFunctionMemberPrice.d.ts +8 -0
  56. package/dist/cjs/components/credits/context/utils/getFunctionMemberPrice.js +2 -0
  57. package/dist/cjs/components/credits/context/utils/getFunctionMemberPrice.js.map +7 -0
  58. package/dist/cjs/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.d.ts +9 -0
  59. package/dist/cjs/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.js +2 -0
  60. package/dist/cjs/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.js.map +7 -0
  61. package/dist/cjs/components/credits/context/utils/variantGetCoupon.d.ts +6 -0
  62. package/dist/cjs/components/credits/context/utils/variantGetCoupon.js +2 -0
  63. package/dist/cjs/components/credits/context/utils/variantGetCoupon.js.map +7 -0
  64. package/dist/cjs/components/credits/context/utils.d.ts +4 -0
  65. package/dist/cjs/components/credits/context/utils.js +1 -1
  66. package/dist/cjs/components/credits/context/utils.js.map +3 -3
  67. package/dist/cjs/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.d.ts +4 -0
  68. package/dist/cjs/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.js +2 -0
  69. package/dist/cjs/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.js.map +7 -0
  70. package/dist/cjs/components/credits/creditsAnkersolixTask/index.d.ts +2 -0
  71. package/dist/cjs/components/credits/creditsAnkersolixTask/index.js +2 -0
  72. package/dist/cjs/components/credits/creditsAnkersolixTask/index.js.map +7 -0
  73. package/dist/cjs/components/credits/creditsAnkersolixTask/type.d.ts +1 -0
  74. package/dist/cjs/components/credits/creditsAnkersolixTask/type.js +2 -0
  75. package/dist/cjs/components/credits/creditsAnkersolixTask/type.js.map +7 -0
  76. package/dist/cjs/components/credits/creditsBanner/index.d.ts +17 -16
  77. package/dist/cjs/components/credits/creditsBanner/index.js +2 -0
  78. package/dist/cjs/components/credits/creditsBanner/index.js.map +7 -0
  79. package/dist/cjs/components/credits/creditsBenefits/benefitItem.d.ts +4 -1
  80. package/dist/cjs/components/credits/creditsBenefits/benefitItem.js +2 -0
  81. package/dist/cjs/components/credits/creditsBenefits/benefitItem.js.map +7 -0
  82. package/dist/cjs/components/credits/{credits-benefits → creditsBenefits}/iconInfo.js +1 -1
  83. package/dist/cjs/components/credits/{credits-benefits → creditsBenefits}/iconInfo.js.map +2 -2
  84. package/dist/cjs/components/credits/creditsBenefits/index.d.ts +12 -9
  85. package/dist/cjs/components/credits/creditsBenefits/index.js +4 -0
  86. package/dist/cjs/components/credits/creditsBenefits/index.js.map +7 -0
  87. package/dist/cjs/components/credits/creditsCash/CreditsCash.d.ts +5 -0
  88. package/dist/cjs/components/credits/creditsCash/CreditsCash.js +2 -0
  89. package/dist/cjs/components/credits/creditsCash/CreditsCash.js.map +7 -0
  90. package/dist/cjs/components/credits/creditsCash/RedeemableItem.d.ts +1 -7
  91. package/dist/cjs/components/credits/creditsCash/RedeemableItem.js +2 -0
  92. package/dist/cjs/components/credits/creditsCash/RedeemableItem.js.map +7 -0
  93. package/dist/cjs/components/credits/creditsCash/index.d.ts +2 -13
  94. package/dist/cjs/components/credits/creditsCash/index.js +2 -0
  95. package/dist/cjs/components/credits/creditsCash/index.js.map +7 -0
  96. package/dist/cjs/components/credits/creditsCash/type.d.ts +2 -4
  97. package/dist/cjs/components/credits/creditsCash/type.js +2 -0
  98. package/dist/cjs/components/credits/creditsCash/type.js.map +7 -0
  99. package/dist/cjs/components/credits/creditsFaq/faqItem/FaqItem.js +2 -0
  100. package/dist/cjs/components/credits/creditsFaq/faqItem/FaqItem.js.map +7 -0
  101. package/dist/cjs/components/credits/creditsFaq/index.d.ts +4 -3
  102. package/dist/cjs/components/credits/creditsFaq/index.js +2 -0
  103. package/dist/cjs/components/credits/creditsFaq/index.js.map +7 -0
  104. package/dist/cjs/components/credits/creditsInfoCard/index.d.ts +10 -15
  105. package/dist/cjs/components/credits/creditsInfoCard/index.js +2 -0
  106. package/dist/cjs/components/credits/creditsInfoCard/index.js.map +7 -0
  107. package/dist/cjs/components/credits/creditsMemberPrice/CreditsMemberPrice.d.ts +5 -0
  108. package/dist/cjs/components/credits/creditsMemberPrice/CreditsMemberPrice.js +2 -0
  109. package/dist/cjs/components/credits/creditsMemberPrice/CreditsMemberPrice.js.map +7 -0
  110. package/dist/cjs/components/credits/creditsMemberPrice/MemberPriceItem.d.ts +7 -0
  111. package/dist/cjs/components/credits/creditsMemberPrice/MemberPriceItem.js +2 -0
  112. package/dist/cjs/components/credits/creditsMemberPrice/MemberPriceItem.js.map +7 -0
  113. package/dist/cjs/components/credits/creditsMemberPrice/Pagination.d.ts +7 -0
  114. package/dist/cjs/components/credits/creditsMemberPrice/Pagination.js +2 -0
  115. package/dist/cjs/components/credits/creditsMemberPrice/Pagination.js.map +7 -0
  116. package/dist/cjs/components/credits/creditsMemberPrice/index.d.ts +2 -0
  117. package/dist/cjs/components/credits/creditsMemberPrice/index.js +2 -0
  118. package/dist/cjs/components/credits/creditsMemberPrice/index.js.map +7 -0
  119. package/dist/cjs/components/credits/creditsMemberPrice/type.d.ts +64 -0
  120. package/dist/cjs/components/credits/creditsMemberPrice/type.js +2 -0
  121. package/dist/cjs/components/credits/creditsMemberPrice/type.js.map +7 -0
  122. package/dist/cjs/components/credits/creditsNavigation/CreditsNavigation.d.ts +4 -0
  123. package/dist/cjs/components/credits/creditsNavigation/CreditsNavigation.js +2 -0
  124. package/dist/cjs/components/credits/creditsNavigation/CreditsNavigation.js.map +7 -0
  125. package/dist/cjs/components/credits/creditsNavigation/index.d.ts +2 -0
  126. package/dist/cjs/components/credits/creditsNavigation/index.js +2 -0
  127. package/dist/cjs/components/credits/creditsNavigation/index.js.map +7 -0
  128. package/dist/cjs/components/credits/creditsNavigation/type.d.ts +7 -0
  129. package/dist/cjs/components/credits/creditsNavigation/type.js +2 -0
  130. package/dist/cjs/components/credits/creditsNavigation/type.js.map +7 -0
  131. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/CountrySelect.js +2 -0
  132. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/CountrySelect.js.map +7 -0
  133. package/dist/cjs/components/credits/{credits-redeem-list/address-form/form-item.js → creditsRedeemList/AddressForm/FormItem.js} +1 -1
  134. package/dist/cjs/components/credits/{credits-redeem-list/address-form/form-item.js.map → creditsRedeemList/AddressForm/FormItem.js.map} +2 -2
  135. package/dist/cjs/components/credits/{credits-redeem-list/address-form → creditsRedeemList/AddressForm}/Input.js.map +1 -1
  136. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/StateSelect.js +2 -0
  137. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/StateSelect.js.map +7 -0
  138. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/index.js +2 -0
  139. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/index.js.map +7 -0
  140. package/dist/cjs/components/credits/{credits-redeem-list/address-form → creditsRedeemList/AddressForm}/type.js.map +1 -1
  141. package/dist/cjs/components/credits/creditsRedeemList/CreditsRedeemList.d.ts +5 -0
  142. package/dist/cjs/components/credits/creditsRedeemList/CreditsRedeemList.js +2 -0
  143. package/dist/cjs/components/credits/creditsRedeemList/CreditsRedeemList.js.map +7 -0
  144. package/dist/cjs/components/credits/creditsRedeemList/NonProductValue.d.ts +4 -0
  145. package/dist/cjs/components/credits/creditsRedeemList/NonProductValue.js +2 -0
  146. package/dist/cjs/components/credits/creditsRedeemList/NonProductValue.js.map +7 -0
  147. package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.js +2 -0
  148. package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.js.map +7 -0
  149. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.js +2 -0
  150. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.js.map +7 -0
  151. package/dist/cjs/components/credits/{credits-redeem-list/redeem-product-modal → creditsRedeemList/RedeemProductModal}/Error.js +1 -1
  152. package/dist/cjs/components/credits/{credits-redeem-list/redeem-product-modal → creditsRedeemList/RedeemProductModal}/Error.js.map +3 -3
  153. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Init.js +2 -0
  154. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Init.js.map +7 -0
  155. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.d.ts +6 -0
  156. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js +2 -0
  157. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js.map +7 -0
  158. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js +2 -0
  159. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js.map +7 -0
  160. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.js +2 -0
  161. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.js.map +7 -0
  162. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.js +2 -0
  163. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.js.map +7 -0
  164. package/dist/cjs/components/credits/creditsRedeemList/RedeemableItem.js +2 -0
  165. package/dist/cjs/components/credits/creditsRedeemList/RedeemableItem.js.map +7 -0
  166. package/dist/cjs/components/credits/creditsRedeemList/index.d.ts +2 -13
  167. package/dist/cjs/components/credits/creditsRedeemList/index.js +2 -0
  168. package/dist/cjs/components/credits/creditsRedeemList/index.js.map +7 -0
  169. package/dist/cjs/components/credits/creditsRedeemList/type.d.ts +2 -15
  170. package/dist/cjs/components/credits/creditsRedeemList/type.js.map +7 -0
  171. package/dist/cjs/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.d.ts +4 -0
  172. package/dist/cjs/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js +2 -0
  173. package/dist/cjs/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js.map +7 -0
  174. package/dist/cjs/components/credits/creditsWaysToGetCredits/index.d.ts +2 -2
  175. package/dist/cjs/components/credits/creditsWaysToGetCredits/index.js +2 -0
  176. package/dist/cjs/components/credits/creditsWaysToGetCredits/index.js.map +7 -0
  177. package/dist/cjs/components/credits/creditsWaysToGetCredits/type.d.ts +5 -16
  178. package/dist/cjs/components/credits/creditsWaysToGetCredits/type.js +2 -0
  179. package/dist/cjs/components/credits/creditsWaysToGetCredits/type.js.map +7 -0
  180. package/dist/cjs/components/credits/creditsWaysToGetCredits/useActions.d.ts +11 -2
  181. package/dist/cjs/components/credits/creditsWaysToGetCredits/useActions.js +2 -0
  182. package/dist/cjs/components/credits/creditsWaysToGetCredits/useActions.js.map +7 -0
  183. package/dist/cjs/components/credits/modal/MyRewardsModal.d.ts +4 -1
  184. package/dist/cjs/components/credits/modal/MyRewardsModal.js +1 -1
  185. package/dist/cjs/components/credits/modal/MyRewardsModal.js.map +3 -3
  186. package/dist/cjs/components/credits/modal/activitiesModal.d.ts +4 -1
  187. package/dist/cjs/components/credits/modal/activitiesModal.js +1 -1
  188. package/dist/cjs/components/credits/modal/activitiesModal.js.map +3 -3
  189. package/dist/cjs/components/credits/modal/creditsUploadReceiptModal.js +1 -1
  190. package/dist/cjs/components/credits/modal/creditsUploadReceiptModal.js.map +3 -3
  191. package/dist/cjs/components/credits/modal/loadingDots.d.ts +2 -1
  192. package/dist/cjs/components/credits/modal/loadingDots.js +1 -1
  193. package/dist/cjs/components/credits/modal/loadingDots.js.map +3 -3
  194. package/dist/cjs/components/credits/modal/modalContainer.js +1 -1
  195. package/dist/cjs/components/credits/modal/modalContainer.js.map +3 -3
  196. package/dist/cjs/components/credits/modal/rulesModal.js +1 -1
  197. package/dist/cjs/components/credits/modal/rulesModal.js.map +3 -3
  198. package/dist/cjs/components/credits/modal/subscribeModal.d.ts +15 -0
  199. package/dist/cjs/components/credits/modal/subscribeModal.js +2 -0
  200. package/dist/cjs/components/credits/modal/subscribeModal.js.map +7 -0
  201. package/dist/cjs/components/credits/modal/tip.js +1 -1
  202. package/dist/cjs/components/credits/modal/tip.js.map +3 -3
  203. package/dist/cjs/components/credits/type.d.ts +24 -5
  204. package/dist/cjs/components/credits/type.js +1 -1
  205. package/dist/cjs/components/credits/type.js.map +1 -1
  206. package/dist/cjs/components/index.d.ts +2 -1
  207. package/dist/cjs/components/index.js +1 -1
  208. package/dist/cjs/components/index.js.map +2 -2
  209. package/dist/cjs/components/registration/authCodeActivate/Message.d.ts +4 -0
  210. package/dist/cjs/components/registration/authCodeActivate/Message.js +2 -0
  211. package/dist/cjs/components/registration/authCodeActivate/Message.js.map +7 -0
  212. package/dist/cjs/components/registration/authCodeActivate/index.d.ts +3 -0
  213. package/dist/cjs/components/registration/authCodeActivate/index.js +2 -0
  214. package/dist/cjs/components/registration/authCodeActivate/index.js.map +7 -0
  215. package/dist/cjs/components/registration/authCodeActivate/type.d.ts +22 -0
  216. package/dist/cjs/components/registration/authCodeActivate/type.js +2 -0
  217. package/dist/cjs/components/registration/authCodeActivate/type.js.map +7 -0
  218. package/dist/cjs/components/registration/context/index.d.ts +1 -0
  219. package/dist/cjs/components/registration/context/index.js +2 -0
  220. package/dist/cjs/components/registration/context/index.js.map +7 -0
  221. package/dist/cjs/components/registration/context/provider.d.ts +27 -0
  222. package/dist/cjs/components/registration/context/provider.js +2 -0
  223. package/dist/cjs/components/registration/context/provider.js.map +7 -0
  224. package/dist/cjs/components/registration/index.d.ts +2 -0
  225. package/dist/cjs/components/registration/index.js +2 -0
  226. package/dist/cjs/components/registration/index.js.map +7 -0
  227. package/dist/cjs/components/registration/modalContainer.d.ts +14 -0
  228. package/dist/cjs/components/registration/modalContainer.js +2 -0
  229. package/dist/cjs/components/registration/modalContainer.js.map +7 -0
  230. package/dist/cjs/constants.d.ts +1 -0
  231. package/dist/cjs/constants.js +2 -0
  232. package/dist/cjs/constants.js.map +7 -0
  233. package/dist/cjs/debug-env.js +2 -0
  234. package/dist/cjs/debug-env.js.map +7 -0
  235. package/dist/cjs/helpers/fetcher.d.ts +1 -1
  236. package/dist/cjs/helpers/fetcher.js +1 -1
  237. package/dist/cjs/helpers/fetcher.js.map +3 -3
  238. package/dist/cjs/helpers/index.d.ts +2 -2
  239. package/dist/cjs/helpers/index.js +1 -1
  240. package/dist/cjs/helpers/index.js.map +2 -2
  241. package/dist/cjs/helpers/track.d.ts +6 -2
  242. package/dist/cjs/helpers/track.js +1 -1
  243. package/dist/cjs/helpers/track.js.map +3 -3
  244. package/dist/cjs/index.d.ts +3 -2
  245. package/dist/cjs/index.js +1 -726
  246. package/dist/cjs/index.js.map +4 -4
  247. package/dist/cjs/stories/chat.stories.js +2 -0
  248. package/dist/cjs/stories/chat.stories.js.map +7 -0
  249. package/dist/cjs/templates/credits.d.ts +73 -0
  250. package/dist/cjs/templates/credits.js +2 -0
  251. package/dist/cjs/templates/credits.js.map +7 -0
  252. package/dist/cjs/templates/index.d.ts +1 -0
  253. package/dist/cjs/templates/index.js +2 -0
  254. package/dist/cjs/templates/index.js.map +7 -0
  255. package/dist/esm/components/chat/index.js +1 -1
  256. package/dist/esm/components/chat/index.js.map +2 -2
  257. package/dist/esm/components/credits/context/const.d.ts +2 -1
  258. package/dist/esm/components/credits/context/const.js +1 -1
  259. package/dist/esm/components/credits/context/const.js.map +2 -2
  260. package/dist/esm/components/credits/context/hooks/useActivities.js +1 -1
  261. package/dist/esm/components/credits/context/hooks/useActivities.js.map +3 -3
  262. package/dist/esm/components/credits/context/hooks/useAddressValidate.js +1 -1
  263. package/dist/esm/components/credits/context/hooks/useAddressValidate.js.map +3 -3
  264. package/dist/esm/components/credits/context/hooks/useAlpcFetch.js +1 -1
  265. package/dist/esm/components/credits/context/hooks/useAlpcFetch.js.map +3 -3
  266. package/dist/esm/components/credits/context/hooks/useCountries.js +1 -1
  267. package/dist/esm/components/credits/context/hooks/useCountries.js.map +3 -3
  268. package/dist/esm/components/credits/context/hooks/useFunctionMemberPrice.d.ts +7 -0
  269. package/dist/esm/components/credits/context/hooks/useFunctionMemberPrice.js +2 -0
  270. package/dist/esm/components/credits/context/hooks/useFunctionMemberPrice.js.map +7 -0
  271. package/dist/esm/components/credits/context/hooks/useMyRewards.js +1 -1
  272. package/dist/esm/components/credits/context/hooks/useMyRewards.js.map +3 -3
  273. package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.d.ts +5 -10
  274. package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.js +1 -1
  275. package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.js.map +3 -3
  276. package/dist/esm/components/credits/context/hooks/useRedeemCoupon.d.ts +2 -1
  277. package/dist/esm/components/credits/context/hooks/useRedeemCoupon.js +1 -1
  278. package/dist/esm/components/credits/context/hooks/useRedeemCoupon.js.map +3 -3
  279. package/dist/esm/components/credits/context/hooks/useRedeemProduct.js +1 -1
  280. package/dist/esm/components/credits/context/hooks/useRedeemProduct.js.map +3 -3
  281. package/dist/esm/components/credits/context/hooks/useRedeemableList.js +1 -1
  282. package/dist/esm/components/credits/context/hooks/useRedeemableList.js.map +3 -3
  283. package/dist/esm/components/credits/context/hooks/useSendEmailValidation.js +1 -1
  284. package/dist/esm/components/credits/context/hooks/useSendEmailValidation.js.map +3 -3
  285. package/dist/esm/components/credits/context/hooks/useSubscribed.js +1 -1
  286. package/dist/esm/components/credits/context/hooks/useSubscribed.js.map +3 -3
  287. package/dist/esm/components/credits/context/hooks/useSubscriptions.d.ts +7 -3
  288. package/dist/esm/components/credits/context/hooks/useSubscriptions.js +1 -1
  289. package/dist/esm/components/credits/context/hooks/useSubscriptions.js.map +3 -3
  290. package/dist/esm/components/credits/context/hooks/useUploadReceipt.js +1 -1
  291. package/dist/esm/components/credits/context/hooks/useUploadReceipt.js.map +2 -2
  292. package/dist/esm/components/credits/context/memberPriceConst.d.ts +10 -0
  293. package/dist/esm/components/credits/context/memberPriceConst.js +2 -0
  294. package/dist/esm/components/credits/context/memberPriceConst.js.map +7 -0
  295. package/dist/esm/components/credits/context/memberPriceTypes.d.ts +46 -0
  296. package/dist/esm/components/credits/context/memberPriceTypes.js +1 -0
  297. package/dist/esm/components/credits/context/provider.d.ts +11 -33
  298. package/dist/esm/components/credits/context/provider.js +1 -1
  299. package/dist/esm/components/credits/context/provider.js.map +3 -3
  300. package/dist/esm/components/credits/context/utils/atobID.d.ts +1 -0
  301. package/dist/esm/components/credits/context/utils/atobID.js +2 -0
  302. package/dist/esm/components/credits/context/utils/atobID.js.map +7 -0
  303. package/dist/esm/components/credits/context/utils/functionDiscountCalculate.d.ts +5 -0
  304. package/dist/esm/components/credits/context/utils/functionDiscountCalculate.js +2 -0
  305. package/dist/esm/components/credits/context/utils/functionDiscountCalculate.js.map +7 -0
  306. package/dist/esm/components/credits/context/utils/getFunctionMemberPrice.d.ts +8 -0
  307. package/dist/esm/components/credits/context/utils/getFunctionMemberPrice.js +2 -0
  308. package/dist/esm/components/credits/context/utils/getFunctionMemberPrice.js.map +7 -0
  309. package/dist/esm/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.d.ts +9 -0
  310. package/dist/esm/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.js +2 -0
  311. package/dist/esm/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.js.map +7 -0
  312. package/dist/esm/components/credits/context/utils/variantGetCoupon.d.ts +6 -0
  313. package/dist/esm/components/credits/context/utils/variantGetCoupon.js +2 -0
  314. package/dist/esm/components/credits/context/utils/variantGetCoupon.js.map +7 -0
  315. package/dist/esm/components/credits/context/utils.d.ts +4 -0
  316. package/dist/esm/components/credits/context/utils.js +1 -1
  317. package/dist/esm/components/credits/context/utils.js.map +3 -3
  318. package/dist/esm/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.d.ts +4 -0
  319. package/dist/esm/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.js +2 -0
  320. package/dist/esm/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.js.map +7 -0
  321. package/dist/esm/components/credits/creditsAnkersolixTask/index.d.ts +2 -0
  322. package/dist/esm/components/credits/creditsAnkersolixTask/index.js +2 -0
  323. package/dist/esm/components/credits/creditsAnkersolixTask/index.js.map +7 -0
  324. package/dist/esm/components/credits/creditsAnkersolixTask/type.d.ts +1 -0
  325. package/dist/esm/components/credits/creditsAnkersolixTask/type.js +2 -0
  326. package/dist/esm/components/credits/creditsAnkersolixTask/type.js.map +7 -0
  327. package/dist/esm/components/credits/creditsBanner/index.d.ts +17 -16
  328. package/dist/esm/components/credits/creditsBanner/index.js +1 -1
  329. package/dist/esm/components/credits/creditsBanner/index.js.map +3 -3
  330. package/dist/esm/components/credits/creditsBenefits/benefitItem.d.ts +4 -1
  331. package/dist/esm/components/credits/creditsBenefits/benefitItem.js +2 -2
  332. package/dist/esm/components/credits/creditsBenefits/benefitItem.js.map +4 -4
  333. package/dist/esm/components/credits/creditsBenefits/iconInfo.js +1 -1
  334. package/dist/esm/components/credits/creditsBenefits/iconInfo.js.map +2 -2
  335. package/dist/esm/components/credits/creditsBenefits/index.d.ts +12 -9
  336. package/dist/esm/components/credits/creditsBenefits/index.js +3 -3
  337. package/dist/esm/components/credits/creditsBenefits/index.js.map +3 -3
  338. package/dist/esm/components/credits/creditsCash/CreditsCash.d.ts +5 -0
  339. package/dist/esm/components/credits/creditsCash/CreditsCash.js +2 -0
  340. package/dist/esm/components/credits/creditsCash/CreditsCash.js.map +7 -0
  341. package/dist/esm/components/credits/creditsCash/RedeemableItem.d.ts +1 -7
  342. package/dist/esm/components/credits/creditsCash/RedeemableItem.js +1 -1
  343. package/dist/esm/components/credits/creditsCash/RedeemableItem.js.map +3 -3
  344. package/dist/esm/components/credits/creditsCash/index.d.ts +2 -13
  345. package/dist/esm/components/credits/creditsCash/index.js +1 -1
  346. package/dist/esm/components/credits/creditsCash/index.js.map +4 -4
  347. package/dist/esm/components/credits/creditsCash/type.d.ts +2 -4
  348. package/dist/esm/components/credits/creditsFaq/faqItem/FaqItem.js +1 -1
  349. package/dist/esm/components/credits/creditsFaq/faqItem/FaqItem.js.map +2 -2
  350. package/dist/esm/components/credits/creditsFaq/index.d.ts +4 -3
  351. package/dist/esm/components/credits/creditsFaq/index.js +1 -1
  352. package/dist/esm/components/credits/creditsFaq/index.js.map +3 -3
  353. package/dist/esm/components/credits/creditsInfoCard/index.d.ts +10 -15
  354. package/dist/esm/components/credits/creditsInfoCard/index.js +1 -1
  355. package/dist/esm/components/credits/creditsInfoCard/index.js.map +3 -3
  356. package/dist/esm/components/credits/creditsMemberPrice/CreditsMemberPrice.d.ts +5 -0
  357. package/dist/esm/components/credits/creditsMemberPrice/CreditsMemberPrice.js +2 -0
  358. package/dist/esm/components/credits/creditsMemberPrice/CreditsMemberPrice.js.map +7 -0
  359. package/dist/esm/components/credits/creditsMemberPrice/MemberPriceItem.d.ts +7 -0
  360. package/dist/esm/components/credits/creditsMemberPrice/MemberPriceItem.js +2 -0
  361. package/dist/esm/components/credits/creditsMemberPrice/MemberPriceItem.js.map +7 -0
  362. package/dist/esm/components/credits/creditsMemberPrice/Pagination.d.ts +7 -0
  363. package/dist/esm/components/credits/creditsMemberPrice/Pagination.js +2 -0
  364. package/dist/esm/components/credits/creditsMemberPrice/Pagination.js.map +7 -0
  365. package/dist/esm/components/credits/creditsMemberPrice/index.d.ts +2 -0
  366. package/dist/esm/components/credits/creditsMemberPrice/index.js +2 -0
  367. package/dist/esm/components/credits/creditsMemberPrice/index.js.map +7 -0
  368. package/dist/esm/components/credits/creditsMemberPrice/type.d.ts +64 -0
  369. package/dist/esm/components/credits/creditsNavigation/CreditsNavigation.d.ts +4 -0
  370. package/dist/esm/components/credits/creditsNavigation/CreditsNavigation.js +2 -0
  371. package/dist/esm/components/credits/creditsNavigation/CreditsNavigation.js.map +7 -0
  372. package/dist/esm/components/credits/creditsNavigation/index.d.ts +2 -0
  373. package/dist/esm/components/credits/creditsNavigation/index.js +2 -0
  374. package/dist/esm/components/credits/creditsNavigation/index.js.map +7 -0
  375. package/dist/esm/components/credits/creditsNavigation/type.d.ts +7 -0
  376. package/dist/esm/components/credits/creditsRedeemList/AddressForm/CountrySelect.js +1 -1
  377. package/dist/esm/components/credits/creditsRedeemList/AddressForm/CountrySelect.js.map +3 -3
  378. package/dist/esm/components/credits/creditsRedeemList/AddressForm/StateSelect.js +1 -1
  379. package/dist/esm/components/credits/creditsRedeemList/AddressForm/StateSelect.js.map +3 -3
  380. package/dist/esm/components/credits/creditsRedeemList/AddressForm/index.js +1 -1
  381. package/dist/esm/components/credits/creditsRedeemList/AddressForm/index.js.map +3 -3
  382. package/dist/esm/components/credits/creditsRedeemList/CreditsRedeemList.d.ts +5 -0
  383. package/dist/esm/components/credits/creditsRedeemList/CreditsRedeemList.js +2 -0
  384. package/dist/esm/components/credits/creditsRedeemList/CreditsRedeemList.js.map +7 -0
  385. package/dist/esm/components/credits/creditsRedeemList/NonProductValue.d.ts +4 -0
  386. package/dist/esm/components/credits/creditsRedeemList/NonProductValue.js +2 -0
  387. package/dist/esm/components/credits/creditsRedeemList/NonProductValue.js.map +7 -0
  388. package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.js +1 -1
  389. package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.js.map +3 -3
  390. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.js +1 -1
  391. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.js.map +3 -3
  392. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Error.js +1 -1
  393. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Error.js.map +2 -2
  394. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.js +1 -1
  395. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.js.map +3 -3
  396. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.d.ts +6 -0
  397. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js +2 -0
  398. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js.map +7 -0
  399. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js +1 -1
  400. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js.map +3 -3
  401. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.js +1 -1
  402. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.js.map +3 -3
  403. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.js +1 -1
  404. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.js.map +3 -3
  405. package/dist/esm/components/credits/creditsRedeemList/RedeemableItem.js +1 -1
  406. package/dist/esm/components/credits/creditsRedeemList/RedeemableItem.js.map +3 -3
  407. package/dist/esm/components/credits/creditsRedeemList/index.d.ts +2 -13
  408. package/dist/esm/components/credits/creditsRedeemList/index.js +1 -1
  409. package/dist/esm/components/credits/creditsRedeemList/index.js.map +4 -4
  410. package/dist/esm/components/credits/creditsRedeemList/type.d.ts +2 -15
  411. package/dist/esm/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.d.ts +4 -0
  412. package/dist/esm/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js +2 -0
  413. package/dist/esm/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js.map +7 -0
  414. package/dist/esm/components/credits/creditsWaysToGetCredits/index.d.ts +2 -2
  415. package/dist/esm/components/credits/creditsWaysToGetCredits/index.js +1 -1
  416. package/dist/esm/components/credits/creditsWaysToGetCredits/index.js.map +4 -4
  417. package/dist/esm/components/credits/creditsWaysToGetCredits/type.d.ts +5 -16
  418. package/dist/esm/components/credits/creditsWaysToGetCredits/type.js +1 -1
  419. package/dist/esm/components/credits/creditsWaysToGetCredits/type.js.map +2 -2
  420. package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.d.ts +11 -2
  421. package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.js +1 -1
  422. package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.js.map +3 -3
  423. package/dist/esm/components/credits/modal/MyRewardsModal.d.ts +4 -1
  424. package/dist/esm/components/credits/modal/MyRewardsModal.js +1 -1
  425. package/dist/esm/components/credits/modal/MyRewardsModal.js.map +3 -3
  426. package/dist/esm/components/credits/modal/activitiesModal.d.ts +4 -1
  427. package/dist/esm/components/credits/modal/activitiesModal.js +1 -1
  428. package/dist/esm/components/credits/modal/activitiesModal.js.map +3 -3
  429. package/dist/esm/components/credits/modal/creditsUploadReceiptModal.js +1 -1
  430. package/dist/esm/components/credits/modal/creditsUploadReceiptModal.js.map +3 -3
  431. package/dist/esm/components/credits/modal/loadingDots.d.ts +2 -1
  432. package/dist/esm/components/credits/modal/loadingDots.js +1 -1
  433. package/dist/esm/components/credits/modal/loadingDots.js.map +3 -3
  434. package/dist/esm/components/credits/modal/modalContainer.js +1 -1
  435. package/dist/esm/components/credits/modal/modalContainer.js.map +3 -3
  436. package/dist/esm/components/credits/modal/rulesModal.js +1 -1
  437. package/dist/esm/components/credits/modal/rulesModal.js.map +2 -2
  438. package/dist/esm/components/credits/modal/subscribeModal.d.ts +15 -0
  439. package/dist/esm/components/credits/modal/subscribeModal.js +2 -0
  440. package/dist/esm/components/credits/modal/subscribeModal.js.map +7 -0
  441. package/dist/esm/components/credits/modal/tip.js +1 -1
  442. package/dist/esm/components/credits/modal/tip.js.map +3 -3
  443. package/dist/esm/components/credits/type.d.ts +24 -5
  444. package/dist/esm/components/index.d.ts +2 -1
  445. package/dist/esm/components/index.js +1 -1
  446. package/dist/esm/components/index.js.map +2 -2
  447. package/dist/esm/components/registration/authCodeActivate/Message.d.ts +4 -0
  448. package/dist/esm/components/registration/authCodeActivate/Message.js +2 -0
  449. package/dist/esm/components/registration/authCodeActivate/Message.js.map +7 -0
  450. package/dist/esm/components/registration/authCodeActivate/index.d.ts +3 -0
  451. package/dist/esm/components/registration/authCodeActivate/index.js +2 -0
  452. package/dist/esm/components/registration/authCodeActivate/index.js.map +7 -0
  453. package/dist/esm/components/registration/authCodeActivate/type.d.ts +22 -0
  454. package/dist/esm/components/registration/authCodeActivate/type.js.map +7 -0
  455. package/dist/esm/components/registration/context/index.d.ts +1 -0
  456. package/dist/esm/components/registration/context/index.js +2 -0
  457. package/dist/esm/components/registration/context/index.js.map +7 -0
  458. package/dist/esm/components/registration/context/provider.d.ts +27 -0
  459. package/dist/esm/components/registration/context/provider.js +2 -0
  460. package/dist/esm/components/registration/context/provider.js.map +7 -0
  461. package/dist/esm/components/registration/index.d.ts +2 -0
  462. package/dist/esm/components/registration/index.js +2 -0
  463. package/dist/esm/components/registration/index.js.map +7 -0
  464. package/dist/esm/components/registration/modalContainer.d.ts +14 -0
  465. package/dist/esm/components/registration/modalContainer.js +2 -0
  466. package/dist/esm/components/registration/modalContainer.js.map +7 -0
  467. package/dist/esm/constants.d.ts +1 -0
  468. package/dist/esm/constants.js +2 -0
  469. package/dist/esm/constants.js.map +7 -0
  470. package/dist/esm/helpers/fetcher.d.ts +1 -1
  471. package/dist/esm/helpers/fetcher.js +1 -1
  472. package/dist/esm/helpers/fetcher.js.map +3 -3
  473. package/dist/esm/helpers/index.d.ts +2 -2
  474. package/dist/esm/helpers/index.js +1 -1
  475. package/dist/esm/helpers/index.js.map +2 -2
  476. package/dist/esm/helpers/track.d.ts +6 -2
  477. package/dist/esm/helpers/track.js +1 -1
  478. package/dist/esm/helpers/track.js.map +3 -3
  479. package/dist/esm/index.d.ts +3 -2
  480. package/dist/esm/index.js +1 -1
  481. package/dist/esm/index.js.map +2 -2
  482. package/dist/esm/templates/credits.d.ts +73 -0
  483. package/dist/esm/templates/credits.js +2 -0
  484. package/dist/esm/templates/credits.js.map +7 -0
  485. package/dist/esm/templates/index.d.ts +1 -0
  486. package/dist/esm/templates/index.js +2 -0
  487. package/dist/esm/templates/index.js.map +7 -0
  488. package/package.json +25 -22
  489. package/src/components/chat/index.tsx +1 -1
  490. package/src/components/credits/context/const.ts +1 -0
  491. package/src/components/credits/context/hooks/useActivities.ts +4 -3
  492. package/src/components/credits/context/hooks/useAddressValidate.ts +2 -2
  493. package/src/components/credits/context/hooks/useAlpcFetch.ts +14 -10
  494. package/src/components/credits/context/hooks/useCountries.ts +2 -2
  495. package/src/components/credits/context/hooks/useFunctionMemberPrice.ts +33 -0
  496. package/src/components/credits/context/hooks/useMyRewards.ts +4 -3
  497. package/src/components/credits/context/hooks/useRedeemAndBuy.ts +21 -24
  498. package/src/components/credits/context/hooks/useRedeemCoupon.ts +7 -3
  499. package/src/components/credits/context/hooks/useRedeemProduct.ts +5 -2
  500. package/src/components/credits/context/hooks/useRedeemableList.ts +4 -18
  501. package/src/components/credits/context/hooks/useSubscribed.ts +6 -7
  502. package/src/components/credits/context/hooks/useUploadReceipt.tsx +0 -1
  503. package/src/components/credits/context/memberPriceConst.ts +13 -0
  504. package/src/components/credits/context/memberPriceTypes.ts +54 -0
  505. package/src/components/credits/context/provider.tsx +25 -20
  506. package/src/components/credits/context/utils/atobID.ts +8 -0
  507. package/src/components/credits/context/utils/functionDiscountCalculate.ts +57 -0
  508. package/src/components/credits/context/utils/getFunctionMemberPrice.ts +135 -0
  509. package/src/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.ts +51 -0
  510. package/src/components/credits/context/utils/variantGetCoupon.ts +34 -0
  511. package/src/components/credits/context/utils.ts +9 -0
  512. package/src/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.tsx +273 -0
  513. package/src/components/credits/creditsAnkersolixTask/index.ts +2 -0
  514. package/src/components/credits/creditsAnkersolixTask/type.ts +7 -0
  515. package/src/components/credits/creditsBanner/index.tsx +16 -18
  516. package/src/components/credits/creditsBenefits/BenefitItem.tsx +108 -0
  517. package/src/components/credits/creditsBenefits/index.tsx +20 -15
  518. package/src/components/credits/creditsCash/CreditsCash.tsx +84 -0
  519. package/src/components/credits/creditsCash/RedeemableItem.tsx +66 -44
  520. package/src/components/credits/creditsCash/index.ts +2 -0
  521. package/src/components/credits/creditsCash/type.ts +2 -4
  522. package/src/components/credits/creditsFaq/faqItem/FaqItem.tsx +12 -12
  523. package/src/components/credits/creditsFaq/index.tsx +9 -6
  524. package/src/components/credits/creditsInfoCard/index.tsx +43 -36
  525. package/src/components/credits/creditsMemberPrice/CreditsMemberPrice.tsx +314 -0
  526. package/src/components/credits/creditsMemberPrice/MemberPriceItem.tsx +181 -0
  527. package/src/components/credits/creditsMemberPrice/Pagination.tsx +113 -0
  528. package/src/components/credits/creditsMemberPrice/index.ts +2 -0
  529. package/src/components/credits/creditsMemberPrice/type.ts +75 -0
  530. package/src/components/credits/creditsNavigation/CreditsNavigation.tsx +123 -0
  531. package/src/components/credits/creditsNavigation/index.ts +2 -0
  532. package/src/components/credits/creditsNavigation/type.ts +10 -0
  533. package/src/components/credits/creditsRedeemList/AddressForm/CountrySelect.tsx +8 -3
  534. package/src/components/credits/creditsRedeemList/AddressForm/StateSelect.tsx +6 -1
  535. package/src/components/credits/creditsRedeemList/AddressForm/index.tsx +6 -5
  536. package/src/components/credits/creditsRedeemList/{index.tsx → CreditsRedeemList.tsx} +31 -35
  537. package/src/components/credits/creditsRedeemList/NonProductValue.tsx +39 -0
  538. package/src/components/credits/creditsRedeemList/RedeemCouponModal.tsx +11 -13
  539. package/src/components/credits/creditsRedeemList/RedeemProductModal/Address.tsx +15 -11
  540. package/src/components/credits/creditsRedeemList/RedeemProductModal/Error.tsx +1 -1
  541. package/src/components/credits/creditsRedeemList/RedeemProductModal/Init.tsx +6 -12
  542. package/src/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.tsx +25 -0
  543. package/src/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.tsx +11 -7
  544. package/src/components/credits/creditsRedeemList/RedeemProductModal/Success.tsx +5 -1
  545. package/src/components/credits/creditsRedeemList/RedeemProductModal/index.tsx +4 -5
  546. package/src/components/credits/creditsRedeemList/RedeemableItem.tsx +24 -32
  547. package/src/components/credits/creditsRedeemList/index.ts +2 -0
  548. package/src/components/credits/creditsRedeemList/type.ts +2 -16
  549. package/src/components/credits/creditsWaysToGetCredits/{index.tsx → CreditsWaysToGetCredits.tsx} +79 -20
  550. package/src/components/credits/creditsWaysToGetCredits/index.ts +2 -0
  551. package/src/components/credits/creditsWaysToGetCredits/type.ts +5 -16
  552. package/src/components/credits/creditsWaysToGetCredits/useActions.ts +24 -10
  553. package/src/components/credits/modal/MyRewardsModal.tsx +84 -63
  554. package/src/components/credits/modal/activitiesModal.tsx +62 -46
  555. package/src/components/credits/modal/creditsUploadReceiptModal.tsx +10 -1
  556. package/src/components/credits/modal/loadingDots.tsx +9 -7
  557. package/src/components/credits/modal/modalContainer.tsx +6 -1
  558. package/src/components/credits/modal/rulesModal.tsx +1 -1
  559. package/src/components/credits/modal/subscribeModal.tsx +202 -0
  560. package/src/components/credits/modal/tip.tsx +11 -1
  561. package/src/components/credits/type.ts +24 -5
  562. package/src/components/index.ts +3 -3
  563. package/src/components/registration/authCodeActivate/Message.tsx +43 -0
  564. package/src/components/registration/authCodeActivate/index.tsx +338 -0
  565. package/src/components/registration/authCodeActivate/type.ts +23 -0
  566. package/src/components/registration/context/index.tsx +1 -0
  567. package/src/components/registration/context/provider.tsx +86 -0
  568. package/src/components/registration/index.ts +2 -0
  569. package/src/components/registration/modalContainer.tsx +115 -0
  570. package/src/constants.ts +1 -0
  571. package/src/index.ts +3 -4
  572. package/src/styles/global.css +15 -0
  573. package/src/templates/Credits.tsx +165 -0
  574. package/src/templates/index.ts +1 -0
  575. package/style.css +1 -0
  576. package/tailwind.config.ts +10 -0
  577. package/dist/cjs/components/chat/chat-context.d.ts +0 -101
  578. package/dist/cjs/components/credits/credits-banner/index.d.ts +0 -23
  579. package/dist/cjs/components/credits/credits-banner/index.js +0 -2
  580. package/dist/cjs/components/credits/credits-banner/index.js.map +0 -7
  581. package/dist/cjs/components/credits/credits-benefits/benefitItem.d.ts +0 -19
  582. package/dist/cjs/components/credits/credits-benefits/benefitItem.js +0 -2
  583. package/dist/cjs/components/credits/credits-benefits/benefitItem.js.map +0 -7
  584. package/dist/cjs/components/credits/credits-benefits/iconInfo.d.ts +0 -2
  585. package/dist/cjs/components/credits/credits-benefits/index.d.ts +0 -12
  586. package/dist/cjs/components/credits/credits-benefits/index.js +0 -4
  587. package/dist/cjs/components/credits/credits-benefits/index.js.map +0 -7
  588. package/dist/cjs/components/credits/credits-cash/RedeemableItem.d.ts +0 -15
  589. package/dist/cjs/components/credits/credits-cash/RedeemableItem.js +0 -2
  590. package/dist/cjs/components/credits/credits-cash/RedeemableItem.js.map +0 -7
  591. package/dist/cjs/components/credits/credits-cash/index.d.ts +0 -13
  592. package/dist/cjs/components/credits/credits-cash/index.js +0 -2
  593. package/dist/cjs/components/credits/credits-cash/index.js.map +0 -7
  594. package/dist/cjs/components/credits/credits-cash/type.d.ts +0 -47
  595. package/dist/cjs/components/credits/credits-cash/type.js +0 -2
  596. package/dist/cjs/components/credits/credits-cash/type.js.map +0 -7
  597. package/dist/cjs/components/credits/credits-faq/faq-item/FaqItem.d.ts +0 -13
  598. package/dist/cjs/components/credits/credits-faq/faq-item/faq-item.d.ts +0 -13
  599. package/dist/cjs/components/credits/credits-faq/faq-item/faq-item.js +0 -2
  600. package/dist/cjs/components/credits/credits-faq/faq-item/faq-item.js.map +0 -7
  601. package/dist/cjs/components/credits/credits-faq/faqItem/FaqItem.d.ts +0 -13
  602. package/dist/cjs/components/credits/credits-faq/index.d.ts +0 -16
  603. package/dist/cjs/components/credits/credits-faq/index.js +0 -2
  604. package/dist/cjs/components/credits/credits-faq/index.js.map +0 -7
  605. package/dist/cjs/components/credits/credits-info-card/index.d.ts +0 -20
  606. package/dist/cjs/components/credits/credits-info-card/index.js +0 -2
  607. package/dist/cjs/components/credits/credits-info-card/index.js.map +0 -7
  608. package/dist/cjs/components/credits/credits-redeem-list/AddressForm/Input.d.ts +0 -13
  609. package/dist/cjs/components/credits/credits-redeem-list/AddressForm/country-select.d.ts +0 -14
  610. package/dist/cjs/components/credits/credits-redeem-list/AddressForm/form-item.d.ts +0 -6
  611. package/dist/cjs/components/credits/credits-redeem-list/AddressForm/index.d.ts +0 -2
  612. package/dist/cjs/components/credits/credits-redeem-list/AddressForm/state-select.d.ts +0 -15
  613. package/dist/cjs/components/credits/credits-redeem-list/AddressForm/type.d.ts +0 -26
  614. package/dist/cjs/components/credits/credits-redeem-list/RedeemCouponModal.d.ts +0 -9
  615. package/dist/cjs/components/credits/credits-redeem-list/RedeemProductModal/Address.d.ts +0 -20
  616. package/dist/cjs/components/credits/credits-redeem-list/RedeemProductModal/Error.d.ts +0 -8
  617. package/dist/cjs/components/credits/credits-redeem-list/RedeemProductModal/Init.d.ts +0 -11
  618. package/dist/cjs/components/credits/credits-redeem-list/RedeemProductModal/ProductInfo.d.ts +0 -8
  619. package/dist/cjs/components/credits/credits-redeem-list/RedeemProductModal/Success.d.ts +0 -13
  620. package/dist/cjs/components/credits/credits-redeem-list/RedeemProductModal/index.d.ts +0 -11
  621. package/dist/cjs/components/credits/credits-redeem-list/RedeemableItem.d.ts +0 -9
  622. package/dist/cjs/components/credits/credits-redeem-list/RedeemableItem.js +0 -2
  623. package/dist/cjs/components/credits/credits-redeem-list/RedeemableItem.js.map +0 -7
  624. package/dist/cjs/components/credits/credits-redeem-list/address-form/Input.d.ts +0 -13
  625. package/dist/cjs/components/credits/credits-redeem-list/address-form/country-select.d.ts +0 -14
  626. package/dist/cjs/components/credits/credits-redeem-list/address-form/country-select.js +0 -2
  627. package/dist/cjs/components/credits/credits-redeem-list/address-form/country-select.js.map +0 -7
  628. package/dist/cjs/components/credits/credits-redeem-list/address-form/form-item.d.ts +0 -6
  629. package/dist/cjs/components/credits/credits-redeem-list/address-form/index.d.ts +0 -2
  630. package/dist/cjs/components/credits/credits-redeem-list/address-form/index.js +0 -2
  631. package/dist/cjs/components/credits/credits-redeem-list/address-form/index.js.map +0 -7
  632. package/dist/cjs/components/credits/credits-redeem-list/address-form/state-select.d.ts +0 -15
  633. package/dist/cjs/components/credits/credits-redeem-list/address-form/state-select.js +0 -2
  634. package/dist/cjs/components/credits/credits-redeem-list/address-form/state-select.js.map +0 -7
  635. package/dist/cjs/components/credits/credits-redeem-list/address-form/type.d.ts +0 -26
  636. package/dist/cjs/components/credits/credits-redeem-list/index.d.ts +0 -13
  637. package/dist/cjs/components/credits/credits-redeem-list/index.js +0 -2
  638. package/dist/cjs/components/credits/credits-redeem-list/index.js.map +0 -7
  639. package/dist/cjs/components/credits/credits-redeem-list/redeem-coupon-modal.d.ts +0 -9
  640. package/dist/cjs/components/credits/credits-redeem-list/redeem-coupon-modal.js +0 -2
  641. package/dist/cjs/components/credits/credits-redeem-list/redeem-coupon-modal.js.map +0 -7
  642. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Address.d.ts +0 -20
  643. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Address.js +0 -2
  644. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Address.js.map +0 -7
  645. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Error.d.ts +0 -8
  646. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Init.d.ts +0 -11
  647. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Init.js +0 -2
  648. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Init.js.map +0 -7
  649. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/ProductInfo.d.ts +0 -8
  650. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/ProductInfo.js +0 -2
  651. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/ProductInfo.js.map +0 -7
  652. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Success.d.ts +0 -13
  653. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Success.js +0 -2
  654. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Success.js.map +0 -7
  655. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/index.d.ts +0 -11
  656. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/index.js +0 -2
  657. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/index.js.map +0 -7
  658. package/dist/cjs/components/credits/credits-redeem-list/type.d.ts +0 -77
  659. package/dist/cjs/components/credits/credits-redeem-list/type.js.map +0 -7
  660. package/dist/cjs/components/credits/credits-ways-to-get-credits/index.d.ts +0 -2
  661. package/dist/cjs/components/credits/credits-ways-to-get-credits/index.js +0 -2
  662. package/dist/cjs/components/credits/credits-ways-to-get-credits/index.js.map +0 -7
  663. package/dist/cjs/components/credits/credits-ways-to-get-credits/type.d.ts +0 -60
  664. package/dist/cjs/components/credits/credits-ways-to-get-credits/type.js +0 -2
  665. package/dist/cjs/components/credits/credits-ways-to-get-credits/type.js.map +0 -7
  666. package/dist/cjs/components/credits/credits-ways-to-get-credits/useActions.d.ts +0 -96
  667. package/dist/cjs/components/credits/credits-ways-to-get-credits/useActions.js +0 -2
  668. package/dist/cjs/components/credits/credits-ways-to-get-credits/useActions.js.map +0 -7
  669. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/country-select.d.ts +0 -14
  670. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/form-item.d.ts +0 -6
  671. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/state-select.d.ts +0 -15
  672. package/dist/cjs/index.css +0 -2
  673. package/dist/cjs/index.css.map +0 -7
  674. package/dist/cjs/shopify/context/ShopifyProvider.d.ts +0 -10
  675. package/dist/cjs/shopify/context/index.d.ts +0 -1
  676. package/dist/cjs/shopify/context/shopify-provider.d.ts +0 -10
  677. package/dist/cjs/shopify/fetchers/create-cart.d.ts +0 -12
  678. package/dist/cjs/shopify/fetchers/get-products-by-handles.d.ts +0 -7
  679. package/dist/cjs/shopify/fetchers/index.d.ts +0 -2
  680. package/dist/cjs/shopify/fragments/article.d.ts +0 -2
  681. package/dist/cjs/shopify/fragments/blog.d.ts +0 -1
  682. package/dist/cjs/shopify/fragments/cart.d.ts +0 -1
  683. package/dist/cjs/shopify/fragments/collection.d.ts +0 -1
  684. package/dist/cjs/shopify/fragments/image.d.ts +0 -1
  685. package/dist/cjs/shopify/fragments/index.d.ts +0 -11
  686. package/dist/cjs/shopify/fragments/metafields.d.ts +0 -2
  687. package/dist/cjs/shopify/fragments/page-info.d.ts +0 -1
  688. package/dist/cjs/shopify/fragments/page.d.ts +0 -1
  689. package/dist/cjs/shopify/fragments/product.d.ts +0 -1
  690. package/dist/cjs/shopify/fragments/seo.d.ts +0 -1
  691. package/dist/cjs/shopify/fragments/variant.d.ts +0 -1
  692. package/dist/cjs/shopify/gql/fragment-masking.d.ts +0 -15
  693. package/dist/cjs/shopify/gql/gql.d.ts +0 -87
  694. package/dist/cjs/shopify/gql/graphql.d.ts +0 -7669
  695. package/dist/cjs/shopify/gql/index.d.ts +0 -3
  696. package/dist/cjs/shopify/hooks/index.d.ts +0 -2
  697. package/dist/cjs/shopify/hooks/use-create-cart.d.ts +0 -2
  698. package/dist/cjs/shopify/hooks/use-products-by-handles.d.ts +0 -4
  699. package/dist/cjs/shopify/hooks/useCreateCart.d.ts +0 -2
  700. package/dist/cjs/shopify/hooks/useProductsByHandles.d.ts +0 -4
  701. package/dist/cjs/shopify/mutations/create-cart.d.ts +0 -1
  702. package/dist/cjs/shopify/queries/get-product-by-handles.d.ts +0 -1
  703. package/dist/cjs/shopify/queries/index.d.ts +0 -1
  704. package/dist/cjs/shopify/src/index.d.ts +0 -5
  705. package/dist/cjs/shopify/tsup.config.d.ts +0 -2
  706. package/dist/cjs/shopify/types/article.d.ts +0 -48
  707. package/dist/cjs/shopify/types/cart.d.ts +0 -173
  708. package/dist/cjs/shopify/types/checkout.d.ts +0 -42
  709. package/dist/cjs/shopify/types/collection.d.ts +0 -122
  710. package/dist/cjs/shopify/types/common.d.ts +0 -42
  711. package/dist/cjs/shopify/types/config.d.ts +0 -12
  712. package/dist/cjs/shopify/types/customer.d.ts +0 -30
  713. package/dist/cjs/shopify/types/fetcher.d.ts +0 -38
  714. package/dist/cjs/shopify/types/index.d.ts +0 -12
  715. package/dist/cjs/shopify/types/page.d.ts +0 -33
  716. package/dist/cjs/shopify/types/product.d.ts +0 -174
  717. package/dist/cjs/shopify/types/search.d.ts +0 -54
  718. package/dist/cjs/shopify/types/site.d.ts +0 -33
  719. package/dist/cjs/shopify/types/type-helper.d.ts +0 -5
  720. package/dist/cjs/shopify/utils/colors.d.ts +0 -3
  721. package/dist/cjs/shopify/utils/const.d.ts +0 -76
  722. package/dist/cjs/shopify/utils/cookie.d.ts +0 -15
  723. package/dist/cjs/shopify/utils/errors.d.ts +0 -38
  724. package/dist/cjs/shopify/utils/fetch-graphql-api.d.ts +0 -19
  725. package/dist/cjs/shopify/utils/handle-fetch-response.d.ts +0 -5
  726. package/dist/cjs/shopify/utils/helper.d.ts +0 -28
  727. package/dist/cjs/shopify/utils/normalize/cart.d.ts +0 -7
  728. package/dist/cjs/shopify/utils/normalize/customer.d.ts +0 -3
  729. package/dist/cjs/shopify/utils/normalize/index.d.ts +0 -2
  730. package/dist/cjs/shopify/utils/normalize/metafield.d.ts +0 -5
  731. package/dist/cjs/shopify/utils/normalize/product.d.ts +0 -16
  732. package/dist/cjs/shopify/utils/store.d.ts +0 -2
  733. package/dist/cjs/shopify/utils/type-helper.d.ts +0 -5
  734. package/dist/cjs/tsconfig.tsbuildinfo +0 -1
  735. package/dist/esm/components/chat/chat-context.d.ts +0 -101
  736. package/dist/esm/components/chat/chat-context.js +0 -2
  737. package/dist/esm/components/chat/chat-context.js.map +0 -7
  738. package/dist/esm/components/credits/credits-banner/index.d.ts +0 -23
  739. package/dist/esm/components/credits/credits-banner/index.js +0 -2
  740. package/dist/esm/components/credits/credits-banner/index.js.map +0 -7
  741. package/dist/esm/components/credits/credits-benefits/benefitItem.d.ts +0 -19
  742. package/dist/esm/components/credits/credits-benefits/benefitItem.js +0 -2
  743. package/dist/esm/components/credits/credits-benefits/benefitItem.js.map +0 -7
  744. package/dist/esm/components/credits/credits-benefits/iconInfo.d.ts +0 -2
  745. package/dist/esm/components/credits/credits-benefits/iconInfo.js +0 -2
  746. package/dist/esm/components/credits/credits-benefits/iconInfo.js.map +0 -7
  747. package/dist/esm/components/credits/credits-benefits/index.d.ts +0 -12
  748. package/dist/esm/components/credits/credits-benefits/index.js +0 -4
  749. package/dist/esm/components/credits/credits-benefits/index.js.map +0 -7
  750. package/dist/esm/components/credits/credits-cash/RedeemableItem.d.ts +0 -15
  751. package/dist/esm/components/credits/credits-cash/RedeemableItem.js +0 -2
  752. package/dist/esm/components/credits/credits-cash/RedeemableItem.js.map +0 -7
  753. package/dist/esm/components/credits/credits-cash/index.d.ts +0 -13
  754. package/dist/esm/components/credits/credits-cash/index.js +0 -2
  755. package/dist/esm/components/credits/credits-cash/index.js.map +0 -7
  756. package/dist/esm/components/credits/credits-cash/type.d.ts +0 -47
  757. package/dist/esm/components/credits/credits-faq/faq-item/FaqItem.d.ts +0 -13
  758. package/dist/esm/components/credits/credits-faq/faq-item/faq-item.d.ts +0 -13
  759. package/dist/esm/components/credits/credits-faq/faq-item/faq-item.js +0 -2
  760. package/dist/esm/components/credits/credits-faq/faq-item/faq-item.js.map +0 -7
  761. package/dist/esm/components/credits/credits-faq/faqItem/FaqItem.d.ts +0 -13
  762. package/dist/esm/components/credits/credits-faq/index.d.ts +0 -16
  763. package/dist/esm/components/credits/credits-faq/index.js +0 -2
  764. package/dist/esm/components/credits/credits-faq/index.js.map +0 -7
  765. package/dist/esm/components/credits/credits-info-card/index.d.ts +0 -20
  766. package/dist/esm/components/credits/credits-info-card/index.js +0 -2
  767. package/dist/esm/components/credits/credits-info-card/index.js.map +0 -7
  768. package/dist/esm/components/credits/credits-redeem-list/AddressForm/Input.d.ts +0 -13
  769. package/dist/esm/components/credits/credits-redeem-list/AddressForm/country-select.d.ts +0 -14
  770. package/dist/esm/components/credits/credits-redeem-list/AddressForm/form-item.d.ts +0 -6
  771. package/dist/esm/components/credits/credits-redeem-list/AddressForm/index.d.ts +0 -2
  772. package/dist/esm/components/credits/credits-redeem-list/AddressForm/state-select.d.ts +0 -15
  773. package/dist/esm/components/credits/credits-redeem-list/AddressForm/type.d.ts +0 -26
  774. package/dist/esm/components/credits/credits-redeem-list/RedeemCouponModal.d.ts +0 -9
  775. package/dist/esm/components/credits/credits-redeem-list/RedeemProductModal/Address.d.ts +0 -20
  776. package/dist/esm/components/credits/credits-redeem-list/RedeemProductModal/Error.d.ts +0 -8
  777. package/dist/esm/components/credits/credits-redeem-list/RedeemProductModal/Init.d.ts +0 -11
  778. package/dist/esm/components/credits/credits-redeem-list/RedeemProductModal/ProductInfo.d.ts +0 -8
  779. package/dist/esm/components/credits/credits-redeem-list/RedeemProductModal/Success.d.ts +0 -13
  780. package/dist/esm/components/credits/credits-redeem-list/RedeemProductModal/index.d.ts +0 -11
  781. package/dist/esm/components/credits/credits-redeem-list/RedeemableItem.d.ts +0 -9
  782. package/dist/esm/components/credits/credits-redeem-list/RedeemableItem.js +0 -2
  783. package/dist/esm/components/credits/credits-redeem-list/RedeemableItem.js.map +0 -7
  784. package/dist/esm/components/credits/credits-redeem-list/address-form/Input.d.ts +0 -13
  785. package/dist/esm/components/credits/credits-redeem-list/address-form/Input.js +0 -2
  786. package/dist/esm/components/credits/credits-redeem-list/address-form/Input.js.map +0 -7
  787. package/dist/esm/components/credits/credits-redeem-list/address-form/country-select.d.ts +0 -14
  788. package/dist/esm/components/credits/credits-redeem-list/address-form/country-select.js +0 -2
  789. package/dist/esm/components/credits/credits-redeem-list/address-form/country-select.js.map +0 -7
  790. package/dist/esm/components/credits/credits-redeem-list/address-form/form-item.d.ts +0 -6
  791. package/dist/esm/components/credits/credits-redeem-list/address-form/form-item.js +0 -2
  792. package/dist/esm/components/credits/credits-redeem-list/address-form/form-item.js.map +0 -7
  793. package/dist/esm/components/credits/credits-redeem-list/address-form/index.d.ts +0 -2
  794. package/dist/esm/components/credits/credits-redeem-list/address-form/index.js +0 -2
  795. package/dist/esm/components/credits/credits-redeem-list/address-form/index.js.map +0 -7
  796. package/dist/esm/components/credits/credits-redeem-list/address-form/state-select.d.ts +0 -15
  797. package/dist/esm/components/credits/credits-redeem-list/address-form/state-select.js +0 -2
  798. package/dist/esm/components/credits/credits-redeem-list/address-form/state-select.js.map +0 -7
  799. package/dist/esm/components/credits/credits-redeem-list/address-form/type.d.ts +0 -26
  800. package/dist/esm/components/credits/credits-redeem-list/index.d.ts +0 -13
  801. package/dist/esm/components/credits/credits-redeem-list/index.js +0 -2
  802. package/dist/esm/components/credits/credits-redeem-list/index.js.map +0 -7
  803. package/dist/esm/components/credits/credits-redeem-list/redeem-coupon-modal.d.ts +0 -9
  804. package/dist/esm/components/credits/credits-redeem-list/redeem-coupon-modal.js +0 -2
  805. package/dist/esm/components/credits/credits-redeem-list/redeem-coupon-modal.js.map +0 -7
  806. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Address.d.ts +0 -20
  807. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Address.js +0 -2
  808. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Address.js.map +0 -7
  809. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Error.d.ts +0 -8
  810. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Error.js +0 -2
  811. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Error.js.map +0 -7
  812. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Init.d.ts +0 -11
  813. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Init.js +0 -2
  814. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Init.js.map +0 -7
  815. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/ProductInfo.d.ts +0 -8
  816. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/ProductInfo.js +0 -2
  817. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/ProductInfo.js.map +0 -7
  818. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Success.d.ts +0 -13
  819. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Success.js +0 -2
  820. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Success.js.map +0 -7
  821. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/index.d.ts +0 -11
  822. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/index.js +0 -2
  823. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/index.js.map +0 -7
  824. package/dist/esm/components/credits/credits-redeem-list/type.d.ts +0 -77
  825. package/dist/esm/components/credits/credits-ways-to-get-credits/index.d.ts +0 -2
  826. package/dist/esm/components/credits/credits-ways-to-get-credits/index.js +0 -2
  827. package/dist/esm/components/credits/credits-ways-to-get-credits/index.js.map +0 -7
  828. package/dist/esm/components/credits/credits-ways-to-get-credits/type.d.ts +0 -60
  829. package/dist/esm/components/credits/credits-ways-to-get-credits/type.js +0 -2
  830. package/dist/esm/components/credits/credits-ways-to-get-credits/type.js.map +0 -7
  831. package/dist/esm/components/credits/credits-ways-to-get-credits/useActions.d.ts +0 -96
  832. package/dist/esm/components/credits/credits-ways-to-get-credits/useActions.js +0 -2
  833. package/dist/esm/components/credits/credits-ways-to-get-credits/useActions.js.map +0 -7
  834. package/dist/esm/components/credits/creditsRedeemList/AddressForm/country-select.d.ts +0 -14
  835. package/dist/esm/components/credits/creditsRedeemList/AddressForm/form-item.d.ts +0 -6
  836. package/dist/esm/components/credits/creditsRedeemList/AddressForm/state-select.d.ts +0 -15
  837. package/dist/esm/index.css +0 -2
  838. package/dist/esm/index.css.map +0 -7
  839. package/dist/esm/shopify/context/ShopifyProvider.d.ts +0 -10
  840. package/dist/esm/shopify/context/index.d.ts +0 -1
  841. package/dist/esm/shopify/context/shopify-provider.d.ts +0 -10
  842. package/dist/esm/shopify/fetchers/create-cart.d.ts +0 -12
  843. package/dist/esm/shopify/fetchers/get-products-by-handles.d.ts +0 -7
  844. package/dist/esm/shopify/fetchers/index.d.ts +0 -2
  845. package/dist/esm/shopify/fragments/article.d.ts +0 -2
  846. package/dist/esm/shopify/fragments/blog.d.ts +0 -1
  847. package/dist/esm/shopify/fragments/cart.d.ts +0 -1
  848. package/dist/esm/shopify/fragments/collection.d.ts +0 -1
  849. package/dist/esm/shopify/fragments/image.d.ts +0 -1
  850. package/dist/esm/shopify/fragments/index.d.ts +0 -11
  851. package/dist/esm/shopify/fragments/metafields.d.ts +0 -2
  852. package/dist/esm/shopify/fragments/page-info.d.ts +0 -1
  853. package/dist/esm/shopify/fragments/page.d.ts +0 -1
  854. package/dist/esm/shopify/fragments/product.d.ts +0 -1
  855. package/dist/esm/shopify/fragments/seo.d.ts +0 -1
  856. package/dist/esm/shopify/fragments/variant.d.ts +0 -1
  857. package/dist/esm/shopify/gql/fragment-masking.d.ts +0 -15
  858. package/dist/esm/shopify/gql/gql.d.ts +0 -87
  859. package/dist/esm/shopify/gql/graphql.d.ts +0 -7669
  860. package/dist/esm/shopify/gql/index.d.ts +0 -3
  861. package/dist/esm/shopify/hooks/index.d.ts +0 -2
  862. package/dist/esm/shopify/hooks/use-create-cart.d.ts +0 -2
  863. package/dist/esm/shopify/hooks/use-products-by-handles.d.ts +0 -4
  864. package/dist/esm/shopify/hooks/useCreateCart.d.ts +0 -2
  865. package/dist/esm/shopify/hooks/useProductsByHandles.d.ts +0 -4
  866. package/dist/esm/shopify/mutations/create-cart.d.ts +0 -1
  867. package/dist/esm/shopify/queries/get-product-by-handles.d.ts +0 -1
  868. package/dist/esm/shopify/queries/index.d.ts +0 -1
  869. package/dist/esm/shopify/src/index.d.ts +0 -5
  870. package/dist/esm/shopify/tsup.config.d.ts +0 -2
  871. package/dist/esm/shopify/types/article.d.ts +0 -48
  872. package/dist/esm/shopify/types/cart.d.ts +0 -173
  873. package/dist/esm/shopify/types/checkout.d.ts +0 -42
  874. package/dist/esm/shopify/types/collection.d.ts +0 -122
  875. package/dist/esm/shopify/types/common.d.ts +0 -42
  876. package/dist/esm/shopify/types/config.d.ts +0 -12
  877. package/dist/esm/shopify/types/customer.d.ts +0 -30
  878. package/dist/esm/shopify/types/fetcher.d.ts +0 -38
  879. package/dist/esm/shopify/types/index.d.ts +0 -12
  880. package/dist/esm/shopify/types/page.d.ts +0 -33
  881. package/dist/esm/shopify/types/product.d.ts +0 -174
  882. package/dist/esm/shopify/types/search.d.ts +0 -54
  883. package/dist/esm/shopify/types/site.d.ts +0 -33
  884. package/dist/esm/shopify/types/type-helper.d.ts +0 -5
  885. package/dist/esm/shopify/utils/colors.d.ts +0 -3
  886. package/dist/esm/shopify/utils/const.d.ts +0 -76
  887. package/dist/esm/shopify/utils/cookie.d.ts +0 -15
  888. package/dist/esm/shopify/utils/errors.d.ts +0 -38
  889. package/dist/esm/shopify/utils/fetch-graphql-api.d.ts +0 -19
  890. package/dist/esm/shopify/utils/handle-fetch-response.d.ts +0 -5
  891. package/dist/esm/shopify/utils/helper.d.ts +0 -28
  892. package/dist/esm/shopify/utils/normalize/cart.d.ts +0 -7
  893. package/dist/esm/shopify/utils/normalize/customer.d.ts +0 -3
  894. package/dist/esm/shopify/utils/normalize/index.d.ts +0 -2
  895. package/dist/esm/shopify/utils/normalize/metafield.d.ts +0 -5
  896. package/dist/esm/shopify/utils/normalize/product.d.ts +0 -16
  897. package/dist/esm/shopify/utils/store.d.ts +0 -2
  898. package/dist/esm/shopify/utils/type-helper.d.ts +0 -5
  899. package/dist/esm/tsconfig.tsbuildinfo +0 -1
  900. package/src/components/credits/context/hooks/useSendEmailValidation.ts +0 -20
  901. package/src/components/credits/context/hooks/useSubscriptions.ts +0 -54
  902. package/src/components/credits/creditsBenefits/benefitItem.tsx +0 -73
  903. package/src/components/credits/creditsCash/index.tsx +0 -102
  904. package/src/helpers/fetchResponse.ts +0 -35
  905. package/src/helpers/fetcher.ts +0 -44
  906. package/src/helpers/index.ts +0 -2
  907. package/src/helpers/track.ts +0 -55
  908. package/src/helpers/utils.ts +0 -8
  909. /package/dist/cjs/components/credits/{credits-redeem-list/address-form → creditsRedeemList/AddressForm}/Input.js +0 -0
  910. /package/dist/cjs/components/credits/{credits-redeem-list/address-form → creditsRedeemList/AddressForm}/type.js +0 -0
  911. /package/dist/cjs/components/credits/{credits-redeem-list → creditsRedeemList}/type.js +0 -0
  912. /package/dist/esm/components/credits/{credits-cash/type.js.map → context/memberPriceTypes.js.map} +0 -0
  913. /package/dist/esm/components/credits/{credits-cash → creditsMemberPrice}/type.js +0 -0
  914. /package/dist/esm/components/credits/{credits-redeem-list/address-form → creditsMemberPrice}/type.js.map +0 -0
  915. /package/dist/esm/components/credits/{credits-redeem-list/address-form → creditsNavigation}/type.js +0 -0
  916. /package/dist/esm/components/credits/{credits-redeem-list → creditsNavigation}/type.js.map +0 -0
  917. /package/dist/esm/components/{credits/credits-redeem-list → registration/authCodeActivate}/type.js +0 -0
  918. /package/src/components/credits/creditsBenefits/{iconInfo.tsx → IconInfo.tsx} +0 -0
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/components/credits/creditsNavigation/CreditsNavigation.tsx"],
4
+ "sourcesContent": ["import { useEffect, useState, useRef, useCallback } from 'react'\nimport { classNames as cn } from '@anker-in/lib'\nimport { Container } from '@anker-in/headless-ui'\nimport { CreditsNavigationCopy } from './type'\n\nexport const CreditsNavigation = ({ copy }: { copy: CreditsNavigationCopy }) => {\n const [activeId, setActiveId] = useState<string>('')\n const observerRef = useRef<IntersectionObserver | null>(null)\n\n // \u5E73\u6ED1\u6EDA\u52A8\u5230\u76EE\u6807\u6A21\u5757\n const scrollToSection = (targetId: string) => {\n const element = document.getElementById(targetId)\n if (element) {\n const navHeight = 56 // \u5BFC\u822A\u680F\u9AD8\u5EA6\n const elementPosition = element.getBoundingClientRect().top + window.pageYOffset\n const offsetPosition = elementPosition - navHeight\n\n window.scrollTo({\n top: offsetPosition,\n behavior: 'smooth',\n })\n }\n }\n\n // \u4F7F\u7528 Intersection Observer \u76D1\u542C\u6A21\u5757\u53EF\u89C1\u6027\n const setupObserver = useCallback(() => {\n // \u6E05\u7406\u4E4B\u524D\u7684 observer\n if (observerRef.current) {\n observerRef.current.disconnect()\n }\n\n // \u8BA1\u7B97\u6BCF\u4E2A\u5143\u7D20\u5728\u89C6\u53E3\u4E2D\u7684\u53EF\u89C1\u9762\u79EF\n const visibilityMap = new Map<string, number>()\n\n const observerCallback = (entries: IntersectionObserverEntry[]) => {\n entries.forEach(entry => {\n const id = entry.target.id\n if (!id) return\n\n // \u8BA1\u7B97\u53EF\u89C1\u9762\u79EF\n const visibleHeight = entry.intersectionRect.height\n const visibleWidth = entry.intersectionRect.width\n const visibleArea = visibleHeight * visibleWidth\n\n visibilityMap.set(id, entry.isIntersecting ? visibleArea : 0)\n })\n\n // \u627E\u51FA\u53EF\u89C1\u9762\u79EF\u6700\u5927\u7684\u5143\u7D20\n let maxArea = 0\n let maxId = ''\n\n visibilityMap.forEach((area, id) => {\n if (area > maxArea) {\n maxArea = area\n maxId = id\n }\n })\n\n if (maxId && maxId !== activeId) {\n setActiveId(maxId)\n }\n }\n\n // \u521B\u5EFA\u65B0\u7684 observer\n observerRef.current = new IntersectionObserver(observerCallback, {\n threshold: [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1],\n rootMargin: '-56px 0px 0px 0px', // \u8003\u8651\u5BFC\u822A\u680F\u9AD8\u5EA6\n })\n\n // \u89C2\u5BDF\u6240\u6709\u76EE\u6807\u5143\u7D20\n copy.items.forEach(item => {\n const element = document.getElementById(item.targetId)\n if (element && observerRef.current) {\n observerRef.current.observe(element)\n }\n })\n }, [copy.items, activeId])\n\n useEffect(() => {\n setupObserver()\n\n return () => {\n if (observerRef.current) {\n observerRef.current.disconnect()\n }\n }\n }, [setupObserver])\n\n return (\n <nav className={cn('sticky top-0 z-50 bg-white')}>\n <Container asChild>\n <div\n className={cn(\n 'md:overflow-x-auto md:overflow-y-hidden md:-mx-[16px] md:px-[16px]',\n 'md:scrollbar-hide md:[&::-webkit-scrollbar]:hidden md:[-ms-overflow-style:none] md:[scrollbar-width:none]'\n )}\n >\n <ul className={cn('flex items-end gap-[24px] pt-[16px] md:gap-[16px] md:pr-[16px]')}>\n {copy.items.map((item, index) => {\n const isActive = activeId === item.targetId\n return (\n <li key={index} className={cn('md:flex-shrink-0')}>\n <button\n onClick={() => scrollToSection(item.targetId)}\n className={cn(\n 'pb-[16px] text-[14px] font-bold tracking-[-0.28px] leading-[1.4]',\n 'transition-all duration-200 relative border-b-4 whitespace-nowrap',\n isActive\n ? 'text-[#080a0f] border-brand-1'\n : 'text-[#4a4c56] hover:text-[#080a0f] border-transparent'\n )}\n >\n {item.label}\n </button>\n </li>\n )\n })}\n </ul>\n </div>\n </Container>\n </nav>\n )\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,uBAAAE,IAAA,eAAAC,EAAAH,GAsGkB,IAAAI,EAAA,6BAtGlBC,EAAyD,iBACzDC,EAAiC,yBACjCC,EAA0B,iCAGnB,MAAML,EAAoB,CAAC,CAAE,KAAAM,CAAK,IAAuC,CAC9E,KAAM,CAACC,EAAUC,CAAW,KAAI,YAAiB,EAAE,EAC7CC,KAAc,UAAoC,IAAI,EAGtDC,EAAmBC,GAAqB,CAC5C,MAAMC,EAAU,SAAS,eAAeD,CAAQ,EAChD,GAAIC,EAAS,CAGX,MAAMC,EADkBD,EAAQ,sBAAsB,EAAE,IAAM,OAAO,YAC5B,GAEzC,OAAO,SAAS,CACd,IAAKC,EACL,SAAU,QACZ,CAAC,CACH,CACF,EAGMC,KAAgB,eAAY,IAAM,CAElCL,EAAY,SACdA,EAAY,QAAQ,WAAW,EAIjC,MAAMM,EAAgB,IAAI,IAEpBC,EAAoBC,GAAyC,CACjEA,EAAQ,QAAQC,GAAS,CACvB,MAAMC,EAAKD,EAAM,OAAO,GACxB,GAAI,CAACC,EAAI,OAGT,MAAMC,EAAgBF,EAAM,iBAAiB,OACvCG,EAAeH,EAAM,iBAAiB,MACtCI,EAAcF,EAAgBC,EAEpCN,EAAc,IAAII,EAAID,EAAM,eAAiBI,EAAc,CAAC,CAC9D,CAAC,EAGD,IAAIC,EAAU,EACVC,EAAQ,GAEZT,EAAc,QAAQ,CAACU,EAAMN,IAAO,CAC9BM,EAAOF,IACTA,EAAUE,EACVD,EAAQL,EAEZ,CAAC,EAEGK,GAASA,IAAUjB,GACrBC,EAAYgB,CAAK,CAErB,EAGAf,EAAY,QAAU,IAAI,qBAAqBO,EAAkB,CAC/D,UAAW,CAAC,EAAG,GAAK,GAAK,GAAK,GAAK,GAAK,GAAK,GAAK,GAAK,GAAK,CAAC,EAC7D,WAAY,mBACd,CAAC,EAGDV,EAAK,MAAM,QAAQoB,GAAQ,CACzB,MAAMd,EAAU,SAAS,eAAec,EAAK,QAAQ,EACjDd,GAAWH,EAAY,SACzBA,EAAY,QAAQ,QAAQG,CAAO,CAEvC,CAAC,CACH,EAAG,CAACN,EAAK,MAAOC,CAAQ,CAAC,EAEzB,sBAAU,KACRO,EAAc,EAEP,IAAM,CACPL,EAAY,SACdA,EAAY,QAAQ,WAAW,CAEnC,GACC,CAACK,CAAa,CAAC,KAGhB,OAAC,OAAI,aAAW,EAAAa,YAAG,4BAA4B,EAC7C,mBAAC,aAAU,QAAO,GAChB,mBAAC,OACC,aAAW,EAAAA,YACT,qEACA,2GACF,EAEA,mBAAC,MAAG,aAAW,EAAAA,YAAG,gEAAgE,EAC/E,SAAArB,EAAK,MAAM,IAAI,CAACoB,EAAME,IAAU,CAC/B,MAAMC,EAAWtB,IAAamB,EAAK,SACnC,SACE,OAAC,MAAe,aAAW,EAAAC,YAAG,kBAAkB,EAC9C,mBAAC,UACC,QAAS,IAAMjB,EAAgBgB,EAAK,QAAQ,EAC5C,aAAW,EAAAC,YACT,mEACA,oEACAE,EACI,gCACA,wDACN,EAEC,SAAAH,EAAK,MACR,GAZOE,CAaT,CAEJ,CAAC,EACH,EACF,EACF,EACF,CAEJ",
6
+ "names": ["CreditsNavigation_exports", "__export", "CreditsNavigation", "__toCommonJS", "import_jsx_runtime", "import_react", "import_lib", "import_headless_ui", "copy", "activeId", "setActiveId", "observerRef", "scrollToSection", "targetId", "element", "offsetPosition", "setupObserver", "visibilityMap", "observerCallback", "entries", "entry", "id", "visibleHeight", "visibleWidth", "visibleArea", "maxArea", "maxId", "area", "item", "cn", "index", "isActive"]
7
+ }
@@ -0,0 +1,2 @@
1
+ export { CreditsNavigation } from './CreditsNavigation';
2
+ export type { CreditsNavigationCopy, NavigationItem } from './type';
@@ -0,0 +1,2 @@
1
+ "use strict";var a=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var n=Object.prototype.hasOwnProperty;var v=(i,t)=>{for(var e in t)a(i,e,{get:t[e],enumerable:!0})},y=(i,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of m(t))!n.call(i,o)&&o!==e&&a(i,o,{get:()=>t[o],enumerable:!(r=g(t,o))||r.enumerable});return i};var C=i=>y(a({},"__esModule",{value:!0}),i);var N={};v(N,{CreditsNavigation:()=>p.CreditsNavigation});module.exports=C(N);var p=require("./CreditsNavigation");
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/components/credits/creditsNavigation/index.ts"],
4
+ "sourcesContent": ["export { CreditsNavigation } from './CreditsNavigation'\nexport type { CreditsNavigationCopy, NavigationItem } from './type'\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,4DAAAE,EAAAF,GAAA,IAAAG,EAAkC",
6
+ "names": ["creditsNavigation_exports", "__export", "__toCommonJS", "import_CreditsNavigation"]
7
+ }
@@ -0,0 +1,7 @@
1
+ export type NavigationItem = {
2
+ label: string;
3
+ targetId: string;
4
+ };
5
+ export type CreditsNavigationCopy = {
6
+ items: NavigationItem[];
7
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";var g=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var n=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var s=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of n(t))!p.call(e,i)&&i!==o&&g(e,i,{get:()=>t[i],enumerable:!(a=r(t,i))||a.enumerable});return e};var m=e=>s(g({},"__esModule",{value:!0}),e);var v={};module.exports=m(v);
2
+ //# sourceMappingURL=type.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/components/credits/creditsNavigation/type.ts"],
4
+ "sourcesContent": ["// \u5BFC\u822A\u9879\u914D\u7F6E\nexport type NavigationItem = {\n label: string\n targetId: string // \u5BF9\u5E94\u7EC4\u4EF6\u7684DOM id\n}\n\n// \u5BFC\u822A\u7EC4\u4EF6\u914D\u7F6E\nexport type CreditsNavigationCopy = {\n items: NavigationItem[]\n}\n"],
5
+ "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
+ "names": ["type_exports", "__toCommonJS"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var E=Object.create;var d=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var S=Object.getPrototypeOf,A=Object.prototype.hasOwnProperty;var _=(o,t)=>{for(var n in t)d(o,n,{get:t[n],enumerable:!0})},f=(o,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of D(t))!A.call(o,l)&&l!==n&&d(o,l,{get:()=>t[l],enumerable:!(r=w(t,l))||r.enumerable});return o};var m=(o,t,n)=>(n=o!=null?E(S(o)):{},f(t||!o||!o.__esModule?d(n,"default",{value:o,enumerable:!0}):n,o)),z=o=>f(d({},"__esModule",{value:!0}),o);var F={};_(F,{CountrySelect:()=>P});module.exports=z(F);var s=require("react/jsx-runtime"),g=require("@anker-in/headless-ui"),x=m(require("../../context/hooks/useClickOutside")),a=m(require("classnames")),i=require("react"),b=require("@anker-in/lib"),v=require("../../../../constants");function P({countries:o,loading:t,className:n,value:r,onChange:l}){const[y,c]=(0,i.useState)(!1),[h,p]=(0,i.useState)(""),{brand:C}=(0,b.useHeadlessContext)(),u=v.ROUNDED_BRANDS.includes(C),N=(0,x.default)(()=>{c(!1)});return(0,i.useEffect)(()=>{const e=o.filter(k=>k.code===r);e.length&&p(e[0].name)},[p,o,r]),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("select",{className:(0,a.default)("!h-[50px] pr-[45px] min-l:hidden",n),style:{WebkitTextFillColor:"black"},disabled:t,value:r,onChange:e=>{l(e.target.value)},children:o.map(e=>(0,s.jsx)("option",{value:e.code,children:e.name},e.code))}),(0,s.jsx)("div",{className:(0,a.default)("absolute left-0 top-0 hidden !h-[50px] rounded-[2px] pr-[45px] text-[16px] font-bold focus:!border-[#6D6D6F] min-l:!block",!u&&"rounded-none",n),onClick:()=>{c(!0)},role:"button",tabIndex:0,onKeyDown:e=>{(e.key==="Enter"||e.key===" ")&&e.preventDefault()},children:h}),(0,s.jsx)(g.Picture,{source:"https://cdn.shopify.com/s/files/1/0517/6767/3016/files/country-select.png?v=1692202500",className:"absolute pointer-events-none right-0 top-0 bottom-0 size-[50px] object-cover",alt:"arrow"}),(0,s.jsx)("div",{ref:N,className:(0,a.default)("absolute left-0 top-[58px] z-30 max-h-[334px] w-full cursor-pointer overflow-auto bg-white shadow-[0px_1px_12px_0px_rgba(0,0,0,0.12)]",!u&&"rounded-none",{"!hidden":!y}),children:(0,s.jsx)("ul",{className:"py-[6px]",children:o.map(e=>(0,s.jsxs)("li",{value:e.code,className:(0,a.default)("relative px-[14px] py-[17px] text-[16px] font-bold leading-[1] transition hover:bg-[#EAEAEC]",{"!bg-[#EAEAEC]":e.code===r}),children:[(0,s.jsx)("button",{className:"absolute left-0 top-0 z-1 size-full opacity-0",value:e.code,onClick:()=>{p(e.name),c(!1),l(e.code)}}),e.name]},e.code))})})]})}
2
+ //# sourceMappingURL=CountrySelect.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/components/credits/creditsRedeemList/AddressForm/CountrySelect.tsx"],
4
+ "sourcesContent": ["import { Picture } from '@anker-in/headless-ui'\nimport useClickOutside from '../../context/hooks/useClickOutside'\nimport classNames from 'classnames'\nimport { useEffect, useState } from 'react'\nimport { useHeadlessContext } from '@anker-in/lib'\nimport { ROUNDED_BRANDS } from '../../../../constants'\n\ninterface Country {\n id: string\n code: string\n name: string\n}\n\ninterface CountrySelectProps {\n countries: Country[]\n loading?: boolean\n className?: string\n value?: string\n onChange: (code: string) => void\n}\n\nexport function CountrySelect({ countries, loading, className, value, onChange }: CountrySelectProps) {\n const [show, setShow] = useState(false)\n const [display, setDisplay] = useState<any>('')\n const { brand } = useHeadlessContext()\n const rounded = ROUNDED_BRANDS.includes(brand)\n const dorpdown = useClickOutside<HTMLDivElement>(() => {\n setShow(false)\n })\n\n useEffect(() => {\n const target = countries.filter(item => item.code === value)\n if (target.length) setDisplay(target[0].name)\n }, [setDisplay, countries, value])\n\n return (\n <div className=\"relative\">\n <select\n className={classNames('!h-[50px] pr-[45px] min-l:hidden', className)}\n style={{\n WebkitTextFillColor: 'black',\n }}\n disabled={loading}\n value={value}\n onChange={event => {\n onChange(event.target.value)\n }}\n >\n {countries.map((item: { id: string; name: string; code: string }) => (\n <option key={item.code} value={item.code}>\n {item.name}\n </option>\n ))}\n </select>\n\n <div\n className={classNames(\n 'absolute left-0 top-0 hidden !h-[50px] rounded-[2px] pr-[45px] text-[16px] font-bold focus:!border-[#6D6D6F] min-l:!block',\n !rounded && 'rounded-none',\n className\n )}\n onClick={() => {\n setShow(true)\n }}\n role=\"button\"\n tabIndex={0}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n }\n }}\n >\n {display}\n </div>\n\n <Picture\n source=\"https://cdn.shopify.com/s/files/1/0517/6767/3016/files/country-select.png?v=1692202500\"\n className=\"absolute pointer-events-none right-0 top-0 bottom-0 size-[50px] object-cover\"\n alt=\"arrow\"\n />\n\n <div\n ref={dorpdown}\n className={classNames(\n 'absolute left-0 top-[58px] z-30 max-h-[334px] w-full cursor-pointer overflow-auto bg-white shadow-[0px_1px_12px_0px_rgba(0,0,0,0.12)]',\n !rounded && 'rounded-none',\n { '!hidden': !show }\n )}\n >\n <ul className=\"py-[6px]\">\n {countries.map((item: { id: string; name: string; code: string }) => (\n <li\n key={item.code}\n value={item.code}\n className={classNames(\n 'relative px-[14px] py-[17px] text-[16px] font-bold leading-[1] transition hover:bg-[#EAEAEC]',\n { '!bg-[#EAEAEC]': item.code === value }\n )}\n >\n <button\n className=\"absolute left-0 top-0 z-1 size-full opacity-0\"\n value={item.code}\n onClick={() => {\n setDisplay(item.name)\n setShow(false)\n onChange(item.code)\n }}\n />\n {item.name}\n </li>\n ))}\n </ul>\n </div>\n </div>\n )\n}\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,mBAAAE,IAAA,eAAAC,EAAAH,GAiDU,IAAAI,EAAA,6BAjDVC,EAAwB,iCACxBC,EAA4B,kDAC5BC,EAAuB,yBACvBC,EAAoC,iBACpCC,EAAmC,yBACnCC,EAA+B,iCAgBxB,SAASR,EAAc,CAAE,UAAAS,EAAW,QAAAC,EAAS,UAAAC,EAAW,MAAAC,EAAO,SAAAC,CAAS,EAAuB,CACpG,KAAM,CAACC,EAAMC,CAAO,KAAI,YAAS,EAAK,EAChC,CAACC,EAASC,CAAU,KAAI,YAAc,EAAE,EACxC,CAAE,MAAAC,CAAM,KAAI,sBAAmB,EAC/BC,EAAU,iBAAe,SAASD,CAAK,EACvCE,KAAW,EAAAC,SAAgC,IAAM,CACrDN,EAAQ,EAAK,CACf,CAAC,EAED,sBAAU,IAAM,CACd,MAAMO,EAASb,EAAU,OAAOc,GAAQA,EAAK,OAASX,CAAK,EACvDU,EAAO,QAAQL,EAAWK,EAAO,CAAC,EAAE,IAAI,CAC9C,EAAG,CAACL,EAAYR,EAAWG,CAAK,CAAC,KAG/B,QAAC,OAAI,UAAU,WACb,oBAAC,UACC,aAAW,EAAAY,SAAW,mCAAoCb,CAAS,EACnE,MAAO,CACL,oBAAqB,OACvB,EACA,SAAUD,EACV,MAAOE,EACP,SAAUa,GAAS,CACjBZ,EAASY,EAAM,OAAO,KAAK,CAC7B,EAEC,SAAAhB,EAAU,IAAKc,MACd,OAAC,UAAuB,MAAOA,EAAK,KACjC,SAAAA,EAAK,MADKA,EAAK,IAElB,CACD,EACH,KAEA,OAAC,OACC,aAAW,EAAAC,SACT,4HACA,CAACL,GAAW,eACZR,CACF,EACA,QAAS,IAAM,CACbI,EAAQ,EAAI,CACd,EACA,KAAK,SACL,SAAU,EACV,UAAW,GAAK,EACV,EAAE,MAAQ,SAAW,EAAE,MAAQ,MACjC,EAAE,eAAe,CAErB,EAEC,SAAAC,EACH,KAEA,OAAC,WACC,OAAO,yFACP,UAAU,+EACV,IAAI,QACN,KAEA,OAAC,OACC,IAAKI,EACL,aAAW,EAAAI,SACT,yIACA,CAACL,GAAW,eACZ,CAAE,UAAW,CAACL,CAAK,CACrB,EAEA,mBAAC,MAAG,UAAU,WACX,SAAAL,EAAU,IAAKc,MACd,QAAC,MAEC,MAAOA,EAAK,KACZ,aAAW,EAAAC,SACT,+FACA,CAAE,gBAAiBD,EAAK,OAASX,CAAM,CACzC,EAEA,oBAAC,UACC,UAAU,gDACV,MAAOW,EAAK,KACZ,QAAS,IAAM,CACbN,EAAWM,EAAK,IAAI,EACpBR,EAAQ,EAAK,EACbF,EAASU,EAAK,IAAI,CACpB,EACF,EACCA,EAAK,OAhBDA,EAAK,IAiBZ,CACD,EACH,EACF,GACF,CAEJ",
6
+ "names": ["CountrySelect_exports", "__export", "CountrySelect", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_useClickOutside", "import_classnames", "import_react", "import_lib", "import_constants", "countries", "loading", "className", "value", "onChange", "show", "setShow", "display", "setDisplay", "brand", "rounded", "dorpdown", "useClickOutside", "target", "item", "classNames", "event"]
7
+ }
@@ -1,2 +1,2 @@
1
1
  "use strict";var s=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var n=(t,o)=>{for(var e in o)s(t,e,{get:o[e],enumerable:!0})},f=(t,o,e,p)=>{if(o&&typeof o=="object"||typeof o=="function")for(let m of d(o))!l.call(t,m)&&m!==e&&s(t,m,{get:()=>o[m],enumerable:!(p=x(o,m))||p.enumerable});return t};var h=t=>f(s({},"__esModule",{value:!0}),t);var v={};n(v,{FormItem:()=>a});module.exports=h(v);var i=require("react/jsx-runtime"),r=require("@anker-in/headless-ui");const a=({error:t,children:o,label:e,required:p})=>(0,i.jsxs)("div",{children:[e&&(0,i.jsx)(r.Text,{html:p?`${e} *`:e,className:"text-[16px] font-bold"}),(0,i.jsx)("div",{className:"mt-[8px] h-[50px] w-full text-[14px] font-semibold",children:o}),t&&typeof t=="string"&&(0,i.jsx)(r.Text,{as:"div",html:t,className:"mt-[8px] text-[16px] font-bold text-[#FF4D4D]"})]});
2
- //# sourceMappingURL=form-item.js.map
2
+ //# sourceMappingURL=FormItem.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../src/components/credits/credits-redeem-list/address-form/form-item.tsx"],
3
+ "sources": ["../../../../../../src/components/credits/creditsRedeemList/AddressForm/FormItem.tsx"],
4
4
  "sourcesContent": ["import { Text } from '@anker-in/headless-ui'\nimport { type PropsWithChildren } from 'react'\n\nexport const FormItem = ({\n error,\n children,\n label,\n required,\n}: PropsWithChildren<{\n label?: string\n required: boolean\n error?: string\n}>) => {\n return (\n <div>\n {label && <Text html={required ? `${label} *` : label} className=\"text-[16px] font-bold\"></Text>}\n <div className=\"mt-[8px] h-[50px] w-full text-[14px] font-semibold\">{children}</div>\n {error && typeof error === 'string' && (\n <Text as=\"div\" html={error} className=\"mt-[8px] text-[16px] font-bold text-[#FF4D4D]\" />\n )}\n </div>\n )\n}\n"],
5
5
  "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,cAAAE,IAAA,eAAAC,EAAAH,GAcI,IAAAI,EAAA,6BAdJC,EAAqB,iCAGd,MAAMH,EAAW,CAAC,CACvB,MAAAI,EACA,SAAAC,EACA,MAAAC,EACA,SAAAC,CACF,OAMI,QAAC,OACE,UAAAD,MAAS,OAAC,QAAK,KAAMC,EAAW,GAAGD,CAAK,KAAOA,EAAO,UAAU,wBAAwB,KACzF,OAAC,OAAI,UAAU,qDAAsD,SAAAD,EAAS,EAC7ED,GAAS,OAAOA,GAAU,aACzB,OAAC,QAAK,GAAG,MAAM,KAAMA,EAAO,UAAU,gDAAgD,GAE1F",
6
- "names": ["form_item_exports", "__export", "FormItem", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "error", "children", "label", "required"]
6
+ "names": ["FormItem_exports", "__export", "FormItem", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "error", "children", "label", "required"]
7
7
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../src/components/credits/credits-redeem-list/address-form/Input.tsx"],
3
+ "sources": ["../../../../../../src/components/credits/creditsRedeemList/AddressForm/Input.tsx"],
4
4
  "sourcesContent": ["import classNames from 'classnames'\nimport React, { useCallback, useEffect, useState } from 'react'\n\ninterface InputProps {\n className?: string\n value: string\n error?: string | boolean\n placeholder: string\n required?: boolean\n disabled?: boolean\n onChange: (event: React.ChangeEvent<HTMLInputElement>) => void\n onBlur?: () => void\n}\n\nexport function Input({ className, error, value, placeholder, disabled, onChange, onBlur }: InputProps) {\n const [focus, setFocus] = useState(false)\n\n useEffect(() => {\n if (value) setFocus(true)\n }, [value])\n\n const handleOnChange = useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n const val = event.currentTarget.value\n if (val) setFocus(!!val)\n onChange(event)\n },\n [onChange],\n )\n\n const handleOnBlur = useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n setFocus(!!event.currentTarget.value)\n onBlur && onBlur()\n },\n [onBlur],\n )\n\n const handleOnFocus = useCallback(() => {\n setFocus(true)\n }, [])\n\n return (\n <input\n className={classNames(\n 'w-full rounded-[2px] border border-[#6D6D6F] p-[14px] text-[16px] font-bold placeholder:text-[16px] placeholder:font-bold placeholder:text-[#6D6D6F] focus:outline-none focus:ring-0',\n className,\n error && 'border-[#FF4D4D]',\n )}\n value={value}\n placeholder={placeholder}\n disabled={disabled}\n onChange={handleOnChange}\n onBlur={handleOnBlur}\n onFocus={handleOnFocus}\n ></input>\n )\n}\n"],
5
5
  "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,WAAAE,IAAA,eAAAC,EAAAH,GA2CI,IAAAI,EAAA,6BA3CJC,EAAuB,yBACvBC,EAAwD,iBAajD,SAASJ,EAAM,CAAE,UAAAK,EAAW,MAAAC,EAAO,MAAAC,EAAO,YAAAC,EAAa,SAAAC,EAAU,SAAAC,EAAU,OAAAC,CAAO,EAAe,CACtG,KAAM,CAACC,EAAOC,CAAQ,KAAI,YAAS,EAAK,KAExC,aAAU,IAAM,CACVN,GAAOM,EAAS,EAAI,CAC1B,EAAG,CAACN,CAAK,CAAC,EAEV,MAAMO,KAAiB,eACpBC,GAA+C,CAC9C,MAAMC,EAAMD,EAAM,cAAc,MAC5BC,GAAKH,EAAS,CAAC,CAACG,CAAG,EACvBN,EAASK,CAAK,CAChB,EACA,CAACL,CAAQ,CACX,EAEMO,KAAe,eAClBF,GAA+C,CAC9CF,EAAS,CAAC,CAACE,EAAM,cAAc,KAAK,EACpCJ,GAAUA,EAAO,CACnB,EACA,CAACA,CAAM,CACT,EAEMO,KAAgB,eAAY,IAAM,CACtCL,EAAS,EAAI,CACf,EAAG,CAAC,CAAC,EAEL,SACE,OAAC,SACC,aAAW,EAAAM,SACT,uLACAd,EACAC,GAAS,kBACX,EACA,MAAOC,EACP,YAAaC,EACb,SAAUC,EACV,SAAUK,EACV,OAAQG,EACR,QAASC,EACV,CAEL",
6
6
  "names": ["Input_exports", "__export", "Input", "__toCommonJS", "import_jsx_runtime", "import_classnames", "import_react", "className", "error", "value", "placeholder", "disabled", "onChange", "onBlur", "focus", "setFocus", "handleOnChange", "event", "val", "handleOnBlur", "handleOnFocus", "classNames"]
@@ -0,0 +1,2 @@
1
+ "use strict";var D=Object.create;var p=Object.defineProperty;var j=Object.getOwnPropertyDescriptor;var F=Object.getOwnPropertyNames;var _=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty;var z=(n,o)=>{for(var l in o)p(n,l,{get:o[l],enumerable:!0})},g=(n,o,l,i)=>{if(o&&typeof o=="object"||typeof o=="function")for(let a of F(o))!E.call(n,a)&&a!==l&&p(n,a,{get:()=>o[a],enumerable:!(i=j(o,a))||i.enumerable});return n};var m=(n,o,l)=>(l=n!=null?D(_(n)):{},g(o||!n||!n.__esModule?p(l,"default",{value:n,enumerable:!0}):l,n)),P=n=>g(p({},"__esModule",{value:!0}),n);var H={};z(H,{StateSelect:()=>T});module.exports=P(H);var t=require("react/jsx-runtime"),d=m(require("classnames")),v=require("@anker-in/headless-ui"),r=require("react"),x=m(require("../../context/hooks/useClickOutside")),b=require("@anker-in/lib"),h=require("../../../../constants");function T({states:n,stateName:o="",stateCode:l="",className:i="",onChange:a}){const[y,u]=(0,r.useState)(!1),[k,f]=(0,r.useState)(""),{brand:w}=(0,b.useHeadlessContext)(),N=h.ROUNDED_BRANDS.includes(w),S=(0,x.default)(()=>{u(!1)}),c=(0,r.useMemo)(()=>{const e=n.find(s=>l?s.code===l:s.name===o);return e?[e?.id,e?.name,e?.code].join(","):""},[n,l,o]);return(0,r.useEffect)(()=>{const e=n.filter(s=>[s.id,s.name,s.code].join(",")===c);e.length&&f(e[0].name)},[f,n,c]),(0,t.jsx)("div",{className:"relative h-full",children:n.length?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("select",{className:(0,d.default)("h-[52px] pr-[45px] min-l:hidden",i),value:c,style:{WebkitTextFillColor:c?"black":"#666"},onChange:e=>{const[,s,C]=e.target.value.split(",");a(C,s)},children:n.map(e=>(0,t.jsx)("option",{value:[e.id,e.name,e.code].join(","),children:e.name},e.id))}),(0,t.jsx)("div",{className:(0,d.default)("absolute left-0 top-0 hidden h-[52px] pr-[45px] min-l:!block",i),onClick:()=>{u(!0)},role:"button",tabIndex:0,onKeyDown:e=>{(e.key==="Enter"||e.key===" ")&&e.preventDefault()},children:k}),(0,t.jsx)(v.Picture,{source:"https://cdn.shopify.com/s/files/1/0517/6767/3016/files/country-select.png?v=1692202500",className:"pointer-events-none absolute right-0 top-1/2 h-[45px] !w-[45px] -translate-y-1/2 object-cover",alt:"arrow"}),(0,t.jsx)("div",{ref:S,className:(0,d.default)("absolute left-0 top-[58px] z-30 max-h-[334px] w-full cursor-pointer overflow-auto bg-white shadow-[0px_1px_12px_0px_rgba(0,0,0,0.12)]",!N&&"rounded-none",{"!hidden":!y}),children:(0,t.jsx)("ul",{className:"py-[6px]",children:n.map(e=>(0,t.jsxs)("li",{value:[e.id,e.name,e.code].join(","),className:(0,d.default)("relative px-[14px] py-[17px] text-[16px] font-semibold leading-[1] transition hover:bg-[#F7F8F9]",{"!bg-[#e8e8e8]":[e.id,e.name,e.code].join(",")===c}),children:[(0,t.jsx)("button",{className:"absolute left-0 top-0 z-1 size-full opacity-0",value:[e.id,e.name,e.code].join(","),onClick:()=>{f(e.name),u(!1),a(e.code,e.name)}}),e.name]},e.id))})})]}):(0,t.jsx)("input",{className:i,value:o,style:{WebkitTextFillColor:"black"},onChange:e=>{a("",e.target.value)}})})}
2
+ //# sourceMappingURL=StateSelect.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/components/credits/creditsRedeemList/AddressForm/StateSelect.tsx"],
4
+ "sourcesContent": ["import classNames from 'classnames'\nimport { Picture } from '@anker-in/headless-ui'\nimport { useEffect, useMemo, useState } from 'react'\nimport useClickOutside from '../../context/hooks/useClickOutside'\nimport { useHeadlessContext } from '@anker-in/lib'\nimport { ROUNDED_BRANDS } from '../../../../constants'\n\ninterface StateSelectProps {\n states: { code: string; id: string; name: string }[]\n className?: string\n countryId?: string\n defaultCode?: string\n stateName?: string\n stateCode?: string\n onChange: (code: string, name: string) => void\n}\n\nexport function StateSelect({ states, stateName = '', stateCode = '', className = '', onChange }: StateSelectProps) {\n const [show, setShow] = useState(false)\n const [display, setDisplay] = useState<any>('')\n const { brand } = useHeadlessContext()\n const rounded = ROUNDED_BRANDS.includes(brand)\n\n const dropdown = useClickOutside<HTMLDivElement>(() => {\n setShow(false)\n })\n\n const value = useMemo(() => {\n const currentState = states.find(item => (stateCode ? item.code === stateCode : item.name === stateName))\n\n return currentState ? [currentState?.id, currentState?.name, currentState?.code].join(',') : ''\n }, [states, stateCode, stateName])\n\n useEffect(() => {\n const target = states.filter(item => [item.id, item.name, item.code].join(',') === value)\n if (target.length) setDisplay(target[0].name)\n }, [setDisplay, states, value])\n\n return (\n <div className=\"relative h-full\">\n {states.length ? (\n <>\n <select\n className={classNames('h-[52px] pr-[45px] min-l:hidden', className)}\n value={value}\n style={{\n WebkitTextFillColor: value ? 'black' : '#666',\n }}\n onChange={event => {\n const [, name, code] = event.target.value.split(',')\n onChange(code, name)\n }}\n >\n {states.map((item: { id: string; name: string; code: string }) => (\n <option key={item.id} value={[item.id, item.name, item.code].join(',')}>\n {item.name}\n </option>\n ))}\n </select>\n <div\n className={classNames('absolute left-0 top-0 hidden h-[52px] pr-[45px] min-l:!block', className)}\n onClick={() => {\n setShow(true)\n }}\n role=\"button\"\n tabIndex={0}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n }\n }}\n >\n {display}\n </div>\n\n <Picture\n source=\"https://cdn.shopify.com/s/files/1/0517/6767/3016/files/country-select.png?v=1692202500\"\n className=\"pointer-events-none absolute right-0 top-1/2 h-[45px] !w-[45px] -translate-y-1/2 object-cover\"\n alt=\"arrow\"\n />\n\n <div\n ref={dropdown}\n className={classNames(\n 'absolute left-0 top-[58px] z-30 max-h-[334px] w-full cursor-pointer overflow-auto bg-white shadow-[0px_1px_12px_0px_rgba(0,0,0,0.12)]',\n !rounded && 'rounded-none',\n { '!hidden': !show }\n )}\n >\n <ul className=\"py-[6px]\">\n {states.map((item: { id: string; name: string; code: string }) => (\n <li\n key={item.id}\n value={[item.id, item.name, item.code].join(',')}\n className={classNames(\n 'relative px-[14px] py-[17px] text-[16px] font-semibold leading-[1] transition hover:bg-[#F7F8F9]',\n {\n '!bg-[#e8e8e8]': [item.id, item.name, item.code].join(',') === value,\n }\n )}\n >\n <button\n className=\"absolute left-0 top-0 z-1 size-full opacity-0\"\n value={[item.id, item.name, item.code].join(',')}\n onClick={() => {\n setDisplay(item.name)\n setShow(false)\n onChange(item.code, item.name)\n }}\n />\n {item.name}\n </li>\n ))}\n </ul>\n </div>\n </>\n ) : (\n <input\n className={className}\n value={stateName}\n style={{\n WebkitTextFillColor: 'black',\n }}\n onChange={event => {\n onChange('', event.target.value)\n }}\n ></input>\n )}\n </div>\n )\n}\n"],
5
+ "mappings": "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",
6
+ "names": ["StateSelect_exports", "__export", "StateSelect", "__toCommonJS", "import_jsx_runtime", "import_classnames", "import_headless_ui", "import_react", "import_useClickOutside", "import_lib", "import_constants", "states", "stateName", "stateCode", "className", "onChange", "show", "setShow", "display", "setDisplay", "brand", "rounded", "dropdown", "useClickOutside", "value", "currentState", "item", "target", "classNames", "event", "name", "code"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var K=Object.create;var y=Object.defineProperty;var z=Object.getOwnPropertyDescriptor;var L=Object.getOwnPropertyNames;var M=Object.getPrototypeOf,O=Object.prototype.hasOwnProperty;var G=(r,s)=>{for(var d in s)y(r,d,{get:s[d],enumerable:!0})},F=(r,s,d,m)=>{if(s&&typeof s=="object"||typeof s=="function")for(let c of L(s))!O.call(r,c)&&c!==d&&y(r,c,{get:()=>s[c],enumerable:!(m=z(s,c))||m.enumerable});return r};var H=(r,s,d)=>(d=r!=null?K(M(r)):{},F(s||!r||!r.__esModule?y(d,"default",{value:r,enumerable:!0}):d,r)),T=r=>F(y({},"__esModule",{value:!0}),r);var Y={};G(Y,{AddressForm:()=>V});module.exports=T(Y);var n=require("react/jsx-runtime"),C=H(require("classnames")),l=require("react"),_=require("./CountrySelect"),S=require("./FormItem"),w=require("./Input"),I=require("./StateSelect"),D=require("../../context/const"),q=require("../../context/provider"),P=require("@anker-in/lib"),R=require("../../../../constants");const V=({countries:r,countriesLoading:s,form:d,validate:m,errors:c,onChange:p})=>{const{profile:b,customer:t}=(0,q.useCreditsContext)(),{locale:v,brand:U}=(0,P.useHeadlessContext)(),B=R.ROUNDED_BRANDS.includes(U),[e,f]=(0,l.useState)(),A=(0,l.useMemo)(()=>r.find(u=>u.code===e?.country)?.provinces||[],[e,r]),h=(0,l.useMemo)(()=>d?.flat().find(u=>u.type==="state")?.key,[d]),k=(0,l.useCallback)(()=>{if(t?.defaultAddress)return{name:(t?.defaultAddress.firstName||"")+" "+(t?.defaultAddress.lastName||""),first_name:t?.defaultAddress.firstName,last_name:t?.defaultAddress.lastName,address1:t?.defaultAddress.address1,address2:t?.defaultAddress.address2,city:t?.defaultAddress.city,phone:t?.defaultAddress.phone,country:t?.defaultAddress.countryCodeV2,province:t?.defaultAddress.province,province_code:t?.defaultAddress.provinceCode,email:t?.email||b?.email,zip:t?.defaultAddress.zip};{let a=D.ALPC_COUNTRY_MAP.get(v)||v;return a==="UK"&&(a="GB"),a==="EU"&&(a="NL"),{email:b?.email,country:a}}},[t,b?.email,v]);return(0,l.useEffect)(()=>{if(t){const a=k();f(a),p(a)}},[t,k]),e?(0,n.jsx)("div",{className:"grid gap-[20px]",children:d&&d.map((a,u)=>(0,n.jsx)("div",{className:"item-center -mx-[6px] flex",children:a.map((o,E)=>{const N=c.find(i=>i.key===o.key)?.message,x=(0,C.default)("h-full w-full appearance-none rounded-[2px] border bg-white px-[14px] py-[17px] leading-[1] outline-none placeholder:text-[#999] autofill:shadow-white focus:border-brand disabled:pointer-events-none disabled:text-[#999] disabled:bg-[#F7F8F9] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",N?"!border-[#F84D4F]":"border-[#d8d8d8]",!B&&"rounded-none");return o.type==="state"&&!A.length?null:(0,n.jsx)("div",{className:(0,C.default)("mx-[6px] flex-1"),children:(0,n.jsxs)(S.FormItem,{error:N,required:o.required,label:o.label,children:[o.type==="country"&&(0,n.jsx)(_.CountrySelect,{className:x,countries:r,loading:s,value:e.country,onChange:i=>{e.country!==i&&(e.province="",e.province_code=""),e.country=i,f({...e}),p(e)}}),o.type==="state"&&(0,n.jsx)(I.StateSelect,{className:x,states:A,stateCode:e.province_code,stateName:e.province,onChange:(i,g)=>{e.province_code=i,e.province=g,f({...e}),p(e)}}),o.type!=="state"&&o.type!=="country"&&(0,n.jsx)(w.Input,{placeholder:o.label,className:x,error:N,value:e[o.key],required:o.required,disabled:o.type==="email",onChange:i=>{const g=i.target.value;e[o.key]=g,f({...e}),p(e)},onBlur:()=>{m({ignoreKeys:A.length&&h?[h]:[]})}})]})},E)})},u))}):null};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/components/credits/creditsRedeemList/AddressForm/index.tsx"],
4
+ "sourcesContent": ["import classNames from 'classnames'\nimport { useCallback, useEffect, useMemo, useState } from 'react'\n\nimport { CountrySelect } from './CountrySelect'\nimport { FormItem } from './FormItem'\nimport { Input } from './Input'\nimport { StateSelect } from './StateSelect'\nimport { ALPC_COUNTRY_MAP } from '../../context/const'\nimport { useCreditsContext } from '../../context/provider'\nimport { useHeadlessContext } from '@anker-in/lib'\nimport { AddressFormProps } from './type'\nimport { ROUNDED_BRANDS } from '../../../../constants'\n\nexport const AddressForm = ({ countries, countriesLoading, form, validate, errors, onChange }: AddressFormProps) => {\n const { profile, customer } = useCreditsContext()\n const { locale, brand } = useHeadlessContext()\n const rounded = ROUNDED_BRANDS.includes(brand)\n const [address, setAddress] = useState<Record<string, any>>()\n\n const states = useMemo(() => {\n const currentCountry = countries.find(item => item.code === address?.country)\n\n return currentCountry?.provinces || []\n }, [address, countries])\n\n const stateInputKey = useMemo(() => {\n const stateInput = form?.flat().find(item => item.type === 'state')\n return stateInput?.key\n }, [form])\n\n const getDefaultAddress = useCallback(() => {\n if (customer?.defaultAddress) {\n return {\n name: (customer?.defaultAddress.firstName || '') + ' ' + (customer?.defaultAddress.lastName || ''),\n first_name: customer?.defaultAddress.firstName,\n last_name: customer?.defaultAddress.lastName,\n address1: customer?.defaultAddress.address1,\n address2: customer?.defaultAddress.address2,\n city: customer?.defaultAddress.city,\n phone: customer?.defaultAddress.phone,\n country: customer?.defaultAddress.countryCodeV2,\n province: customer?.defaultAddress.province,\n province_code: customer?.defaultAddress.provinceCode,\n email: customer?.email || profile?.email,\n zip: customer?.defaultAddress.zip,\n }\n } else {\n let defaultCountry = ALPC_COUNTRY_MAP.get(locale) || locale\n if (defaultCountry === 'UK') {\n defaultCountry = 'GB'\n }\n if (defaultCountry === 'EU') {\n defaultCountry = 'NL'\n }\n return {\n email: profile?.email,\n country: defaultCountry,\n }\n }\n }, [customer, profile?.email, locale])\n\n useEffect(() => {\n if (customer) {\n const defaultAddress = getDefaultAddress()\n setAddress(defaultAddress)\n onChange(defaultAddress)\n }\n }, [customer, getDefaultAddress])\n\n if (!address) {\n return null\n }\n\n return (\n <div className=\"grid gap-[20px]\">\n {form &&\n form.map((row, rowIndex: number) => (\n <div key={rowIndex} className=\"item-center -mx-[6px] flex\">\n {row.map((input, inputIndex: number) => {\n const error = errors.find(item => item.key === input.key)?.message\n const inputClassName = classNames(\n 'h-full w-full appearance-none rounded-[2px] border bg-white px-[14px] py-[17px] leading-[1] outline-none placeholder:text-[#999] autofill:shadow-white focus:border-brand disabled:pointer-events-none disabled:text-[#999] disabled:bg-[#F7F8F9] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none',\n error ? '!border-[#F84D4F]' : 'border-[#d8d8d8]',\n !rounded && 'rounded-none'\n )\n\n if (input.type === 'state') {\n if (!states.length) {\n return null\n }\n }\n\n return (\n <div key={inputIndex} className={classNames('mx-[6px] flex-1')}>\n <FormItem error={error} required={input.required} label={input.label}>\n {input.type === 'country' && (\n <CountrySelect\n className={inputClassName}\n countries={countries}\n loading={countriesLoading}\n value={address.country}\n onChange={selectedCountryCode => {\n if (address.country !== selectedCountryCode) {\n address.province = ''\n address.province_code = ''\n }\n address.country = selectedCountryCode\n setAddress({ ...address })\n onChange(address)\n }}\n ></CountrySelect>\n )}\n {input.type === 'state' && (\n <StateSelect\n className={inputClassName}\n states={states}\n stateCode={address.province_code}\n stateName={address.province}\n onChange={(provinceCode, provinceName) => {\n address.province_code = provinceCode\n address.province = provinceName\n setAddress({ ...address })\n onChange(address)\n }}\n ></StateSelect>\n )}\n\n {input.type !== 'state' && input.type !== 'country' && (\n <Input\n placeholder={input.label}\n className={inputClassName}\n error={error}\n value={address[input.key]}\n required={input.required}\n disabled={input.type === 'email'}\n onChange={event => {\n const value = event.target.value\n address[input.key] = value\n setAddress({ ...address })\n onChange(address)\n }}\n onBlur={() => {\n validate({\n ignoreKeys: states.length && stateInputKey ? [stateInputKey] : [],\n })\n }}\n />\n )}\n </FormItem>\n </div>\n )\n })}\n </div>\n ))}\n </div>\n )\n}\n"],
5
+ "mappings": "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",
6
+ "names": ["AddressForm_exports", "__export", "AddressForm", "__toCommonJS", "import_jsx_runtime", "import_classnames", "import_react", "import_CountrySelect", "import_FormItem", "import_Input", "import_StateSelect", "import_const", "import_provider", "import_lib", "import_constants", "countries", "countriesLoading", "form", "validate", "errors", "onChange", "profile", "customer", "locale", "brand", "rounded", "address", "setAddress", "states", "item", "stateInputKey", "getDefaultAddress", "defaultCountry", "defaultAddress", "row", "rowIndex", "input", "inputIndex", "error", "inputClassName", "classNames", "selectedCountryCode", "provinceCode", "provinceName", "event", "value"]
7
+ }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../src/components/credits/credits-redeem-list/address-form/type.ts"],
3
+ "sources": ["../../../../../../src/components/credits/creditsRedeemList/AddressForm/type.ts"],
4
4
  "sourcesContent": ["import { CreditsRedeemListCopy } from '../type'\n\ntype ShippingCountry = {\n id: string\n name: string\n code: string\n provinces: {\n id: string\n name: string\n code: string\n }[]\n}\n\nexport interface AddressFormProps {\n form: CreditsRedeemListCopy['redeemModal']['product']['addressForm']\n onChange: (address: any) => void\n validate: (args: { force?: boolean; ignoreKeys?: string[] }) => boolean\n errors: {\n key: string\n message: string\n }[]\n countries: ShippingCountry[]\n countriesLoading: boolean\n}\n"],
5
5
  "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
6
  "names": ["type_exports", "__toCommonJS"]
@@ -0,0 +1,5 @@
1
+ import { CreditsRedeemListCopy } from './type';
2
+ export declare const CreditsRedeemList: ({ copy, id }: {
3
+ copy: CreditsRedeemListCopy;
4
+ id?: string;
5
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ "use strict";var W=Object.create;var C=Object.defineProperty;var X=Object.getOwnPropertyDescriptor;var Y=Object.getOwnPropertyNames;var Z=Object.getPrototypeOf,ee=Object.prototype.hasOwnProperty;var te=(e,s)=>{for(var o in s)C(e,o,{get:s[o],enumerable:!0})},S=(e,s,o,b)=>{if(s&&typeof s=="object"||typeof s=="function")for(let m of Y(s))!ee.call(e,m)&&m!==o&&C(e,m,{get:()=>s[m],enumerable:!(b=X(s,m))||b.enumerable});return e};var f=(e,s,o)=>(o=e!=null?W(Z(e)):{},S(s||!e||!e.__esModule?C(o,"default",{value:e,enumerable:!0}):o,e)),se=e=>S(C({},"__esModule",{value:!0}),e);var oe={};te(oe,{CreditsRedeemList:()=>ne});module.exports=se(oe);var n=require("react/jsx-runtime"),r=require("@anker-in/headless-ui"),v=f(require("classnames")),i=require("react"),M=f(require("./RedeemCouponModal")),O=f(require("./RedeemProductModal")),P=require("../context/provider"),D=f(require("../context/hooks/useRedeemableList")),u=require("../context/const"),g=require("@anker-in/lib"),F=require("./RedeemableItem"),H=require("../../../constants"),z=f(require("../modal/rulesModal")),B=require("../../../components/registration"),U=require("../context/utils");const ne=({copy:e,id:s})=>{const{profile:o,openSignUpPopup:b,gtm:{pageGroup:m},pageCommon:j,creditInfo:q}=(0,P.useCreditsContext)(),{authCodeActivate:h}=(0,B.useRegistration)(),{brand:w}=(0,g.useHeadlessContext)(),G=H.ROUNDED_BRANDS.includes(w),L=Object.keys(o||{}).length>0,V=o?.activated,[x,$]=(0,i.useState)(e.list[0].label),[l,R]=(0,i.useState)(void 0),[y,N]=(0,i.useState)(),{listLoading:J,redeemableList:_,getRedeemableList:k}=(0,D.default)(),c=(0,i.useMemo)(()=>_.map(t=>({id:t.id.toString(),title:t.name,consumeCredits:t.consume_credits,remainingInventory:t.remaining_inventory,isLimited:!!t.is_limited,consumeType:t.consume_type,handle:t.sku_handle,sku:t.goods_sku,image:t.goods_url})),[e.list,x,_]),K=c.map(t=>t.handle),{data:I}=(0,g.useProductsByHandles)({handles:K}),Q=(0,i.useMemo)(()=>e.list.find(a=>a.label===x)?.list.filter(a=>c.some(d=>d.id===a.id)).map(a=>{const d=c.find(p=>p.id===a.id),T=I?.find(p=>p.handle===d?.handle),E=T?.variants.find(p=>p.sku===d?.sku);return d?.isLimited&&(!d?.remainingInventory||d.remainingInventory<=0)||d?.consumeType===u.AlpcConsumeType.Product&&(!T||!E)?null:{alpc:c.find(p=>p.id===a.id),config:a,product:T,variant:E}}).filter(a=>a!==null),[c,I]),A=(0,i.useCallback)(t=>{t===u.AlpcErrorCode.CodeLpcRuleInventoryNotEnough&&k()},[k]);return(0,n.jsxs)(r.Container,{id:s,className:(0,v.default)("relative bg-[#F5F5F7]"),children:[(0,n.jsx)(r.Heading,{as:"h2",size:"4",html:e.title}),L&&V&&(0,n.jsx)(r.Text,{html:e.availableCredits?.replace("$credits",(0,U.numberFormat)(q?.available_credit||0).toString()),className:"mt-[12px] text-[20px] l-xxl:text-[18px] l:text-[16px] font-bold text-[#4A4C56]",as:"p"}),(0,n.jsx)(r.Tabs,{shape:G?"rounded":"square",align:"left",className:(0,v.default)("sticky top-0 z-20 py-[24px] md:justify-center"),value:x.toString(),onValueChange:t=>{$(t),(0,g.gaTrack)({event:"ga4Event",event_name:"lp_navigation",event_parameters:{navigation:t,page_group:m}})},children:(0,n.jsx)(r.TabsList,{children:e.list.map(t=>(0,n.jsx)(r.TabsTrigger,{value:t.label,children:t.label},t.label))})}),!!c?.length&&!J&&(0,n.jsx)("div",{className:(0,v.default)("relative grid grid-cols-4 gap-[16px] md:grid-cols-2 md:gap-[12px] md-xl:grid-cols-3"),children:Q?.map(t=>(0,n.jsx)(F.RedeemableItem,{copy:e,item:t,onRedeem:a=>{L?!o?.activated&&!h.isActivateSuccess?h.open():R(a):b()},onRulesOpen:N},t?.alpc?.id))}),l?.alpc?.consumeType===u.AlpcConsumeType.Coupon&&e?.redeemModal?.coupon&&l&&(0,n.jsx)(M.default,{isOpen:!!l,item:l,copy:e,onError:A,onClose:()=>{R(void 0)}}),l?.alpc?.consumeType===u.AlpcConsumeType.Product&&e?.redeemModal&&l&&(0,n.jsx)(O.default,{isOpen:!!l,item:l,copy:e,onError:A,onClose:()=>{R(void 0)}}),y&&(0,n.jsx)(z.default,{overlayClassName:"md:px-[16px] md:items-center",className:"md:h-fit md:rounded-b-[16px]",isOpen:y.length>0,onClose:()=>N([]),titleClassName:"border-b-transparent h-[56px]",rules:y,scrollClassName:"md:mt-[8px] md:mb-[24px] md:pt-0",title:j?.ruleLabel,ruleClassName:"text-[#1d1d1f] font-bold"})]})};
2
+ //# sourceMappingURL=CreditsRedeemList.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/components/credits/creditsRedeemList/CreditsRedeemList.tsx"],
4
+ "sourcesContent": ["import { Container, Heading, Tabs, TabsList, TabsTrigger, Text } from '@anker-in/headless-ui'\nimport classNames from 'classnames'\nimport { useCallback, useMemo, useState } from 'react'\n\nimport RedeemCouponModal from './RedeemCouponModal'\nimport RedeemProductModal from './RedeemProductModal'\nimport { useCreditsContext } from '../context/provider'\nimport useRedeemableList from '../context/hooks/useRedeemableList'\nimport { AlpcConsumeType, AlpcErrorCode } from '../context/const'\nimport { useHeadlessContext, useProductsByHandles, gaTrack } from '@anker-in/lib'\nimport type { RedeemableItem as RedeemableItemType } from '../type'\nimport { RedeemableItem } from './RedeemableItem'\nimport { ROUNDED_BRANDS } from '../../../constants'\nimport RulesModal from '../modal/rulesModal'\nimport { CreditsRedeemListCopy } from './type'\nimport { useRegistration } from '../../../components/registration'\nimport { numberFormat } from '../context/utils'\n\nexport const CreditsRedeemList = ({ copy, id }: { copy: CreditsRedeemListCopy; id?: string }) => {\n const {\n profile,\n openSignUpPopup,\n gtm: { pageGroup },\n pageCommon,\n creditInfo,\n } = useCreditsContext()\n const { authCodeActivate } = useRegistration()\n const { brand } = useHeadlessContext()\n const rounded = ROUNDED_BRANDS.includes(brand)\n\n const isLogin = Object.keys(profile || {}).length > 0\n const isActivated = profile?.activated\n\n const [activeTab, setActiveTab] = useState<string>(copy.list[0].label)\n\n const [popRedeemData, setPopRedeemData] = useState<RedeemableItemType | undefined>(undefined)\n\n const [rules, setRules] = useState<string | string[]>()\n\n const { listLoading, redeemableList, getRedeemableList } = useRedeemableList()\n\n const alpcList = useMemo(() => {\n return redeemableList.map(item => {\n return {\n id: item.id.toString(),\n title: item.name,\n consumeCredits: item.consume_credits,\n remainingInventory: item.remaining_inventory,\n isLimited: !!item.is_limited,\n consumeType: item.consume_type,\n handle: item.sku_handle,\n sku: item.goods_sku,\n image: item.goods_url,\n }\n })\n }, [copy.list, activeTab, redeemableList])\n\n const handles = alpcList.map(item => item.handle)\n const { data: products } = useProductsByHandles({ handles })\n\n const list = useMemo(() => {\n const currentList = copy.list.find(item => item.label === activeTab)\n return currentList?.list\n .filter(item => alpcList.some(alpcItem => alpcItem.id === item.id))\n .map(item => {\n const alpcItem = alpcList.find(alpcItem => alpcItem.id === item.id)\n const product = products?.find(product => product.handle === alpcItem?.handle)\n const variant = product?.variants.find(variant => variant.sku === alpcItem?.sku)\n // \u8FC7\u6EE4\u6389\u5E93\u5B58\u4E0D\u8DB3\u7684\u5546\u54C1\n if (alpcItem?.isLimited && (!alpcItem?.remainingInventory || alpcItem.remainingInventory <= 0)) return null\n if (alpcItem?.consumeType === AlpcConsumeType.Product && (!product || !variant)) return null\n return {\n alpc: alpcList.find(alpcItem => alpcItem.id === item.id),\n config: item,\n product,\n variant,\n }\n })\n .filter(item => item !== null) as unknown as RedeemableItemType[]\n }, [alpcList, products])\n\n const handleRedeemError = useCallback(\n (errorCode: AlpcErrorCode) => {\n if (errorCode === AlpcErrorCode.CodeLpcRuleInventoryNotEnough) {\n getRedeemableList()\n }\n },\n [getRedeemableList]\n )\n\n return (\n <Container id={id} className={classNames('relative bg-[#F5F5F7]')}>\n <Heading as=\"h2\" size=\"4\" html={copy.title} />\n\n {/* \u53EF\u7528\u79EF\u5206\u5C55\u793A */}\n {isLogin && isActivated && (\n <Text\n html={copy.availableCredits?.replace('$credits', numberFormat(creditInfo?.available_credit || 0).toString())}\n className=\"mt-[12px] text-[20px] l-xxl:text-[18px] l:text-[16px] font-bold text-[#4A4C56]\"\n as=\"p\"\n />\n )}\n\n <Tabs\n shape={rounded ? 'rounded' : 'square'}\n align=\"left\"\n className={classNames('sticky top-0 z-20 py-[24px] md:justify-center')}\n value={activeTab.toString()}\n onValueChange={value => {\n setActiveTab(value)\n gaTrack({\n event: 'ga4Event',\n event_name: 'lp_navigation',\n event_parameters: {\n navigation: value,\n page_group: pageGroup,\n },\n })\n }}\n >\n <TabsList>\n {copy.list.map(item => (\n <TabsTrigger key={item.label} value={item.label}>\n {item.label}\n </TabsTrigger>\n ))}\n </TabsList>\n </Tabs>\n {/* PC\u7AEF */}\n {!!alpcList?.length && !listLoading && (\n <div\n className={classNames('relative grid grid-cols-4 gap-[16px] md:grid-cols-2 md:gap-[12px] md-xl:grid-cols-3')}\n >\n {list?.map(item => (\n <RedeemableItem\n key={item?.alpc?.id}\n copy={copy}\n item={item}\n onRedeem={(item: RedeemableItemType) => {\n if (!isLogin) {\n openSignUpPopup()\n } else if (!profile?.activated && !authCodeActivate.isActivateSuccess) {\n authCodeActivate.open()\n } else {\n setPopRedeemData(item)\n }\n }}\n onRulesOpen={setRules}\n />\n ))}\n </div>\n )}\n\n {popRedeemData?.alpc?.consumeType === AlpcConsumeType.Coupon && copy?.redeemModal?.coupon && popRedeemData && (\n <RedeemCouponModal\n isOpen={!!popRedeemData}\n item={popRedeemData}\n copy={copy}\n onError={handleRedeemError}\n onClose={() => {\n setPopRedeemData(undefined)\n }}\n />\n )}\n {popRedeemData?.alpc?.consumeType === AlpcConsumeType.Product && copy?.redeemModal && popRedeemData && (\n <RedeemProductModal\n isOpen={!!popRedeemData}\n item={popRedeemData}\n copy={copy}\n onError={handleRedeemError}\n onClose={() => {\n setPopRedeemData(undefined)\n }}\n />\n )}\n {rules && (\n <RulesModal\n overlayClassName=\"md:px-[16px] md:items-center\"\n className=\"md:h-fit md:rounded-b-[16px]\"\n isOpen={rules.length > 0}\n onClose={() => setRules([])}\n titleClassName=\"border-b-transparent h-[56px]\"\n rules={rules}\n scrollClassName=\"md:mt-[8px] md:mb-[24px] md:pt-0\"\n title={pageCommon?.ruleLabel}\n ruleClassName=\"text-[#1d1d1f] font-bold\"\n />\n )}\n </Container>\n )\n}\n"],
5
+ "mappings": "8jBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,uBAAAE,KAAA,eAAAC,GAAAH,IA2FI,IAAAI,EAAA,6BA3FJC,EAAsE,iCACtEC,EAAuB,yBACvBC,EAA+C,iBAE/CC,EAA8B,kCAC9BC,EAA+B,mCAC/BC,EAAkC,+BAClCC,EAA8B,iDAC9BC,EAA+C,4BAC/CC,EAAkE,yBAElEC,EAA+B,4BAC/BC,EAA+B,8BAC/BC,EAAuB,kCAEvBC,EAAgC,4CAChCC,EAA6B,4BAEtB,MAAMhB,GAAoB,CAAC,CAAE,KAAAiB,EAAM,GAAAC,CAAG,IAAoD,CAC/F,KAAM,CACJ,QAAAC,EACA,gBAAAC,EACA,IAAK,CAAE,UAAAC,CAAU,EACjB,WAAAC,EACA,WAAAC,CACF,KAAI,qBAAkB,EAChB,CAAE,iBAAAC,CAAiB,KAAI,mBAAgB,EACvC,CAAE,MAAAC,CAAM,KAAI,sBAAmB,EAC/BC,EAAU,iBAAe,SAASD,CAAK,EAEvCE,EAAU,OAAO,KAAKR,GAAW,CAAC,CAAC,EAAE,OAAS,EAC9CS,EAAcT,GAAS,UAEvB,CAACU,EAAWC,CAAY,KAAI,YAAiBb,EAAK,KAAK,CAAC,EAAE,KAAK,EAE/D,CAACc,EAAeC,CAAgB,KAAI,YAAyC,MAAS,EAEtF,CAACC,EAAOC,CAAQ,KAAI,YAA4B,EAEhD,CAAE,YAAAC,EAAa,eAAAC,EAAgB,kBAAAC,CAAkB,KAAI,EAAAC,SAAkB,EAEvEC,KAAW,WAAQ,IAChBH,EAAe,IAAII,IACjB,CACL,GAAIA,EAAK,GAAG,SAAS,EACrB,MAAOA,EAAK,KACZ,eAAgBA,EAAK,gBACrB,mBAAoBA,EAAK,oBACzB,UAAW,CAAC,CAACA,EAAK,WAClB,YAAaA,EAAK,aAClB,OAAQA,EAAK,WACb,IAAKA,EAAK,UACV,MAAOA,EAAK,SACd,EACD,EACA,CAACvB,EAAK,KAAMY,EAAWO,CAAc,CAAC,EAEnCK,EAAUF,EAAS,IAAIC,GAAQA,EAAK,MAAM,EAC1C,CAAE,KAAME,CAAS,KAAI,wBAAqB,CAAE,QAAAD,CAAQ,CAAC,EAErDE,KAAO,WAAQ,IACC1B,EAAK,KAAK,KAAKuB,GAAQA,EAAK,QAAUX,CAAS,GAC/C,KACjB,OAAOW,GAAQD,EAAS,KAAKK,GAAYA,EAAS,KAAOJ,EAAK,EAAE,CAAC,EACjE,IAAIA,GAAQ,CACX,MAAMI,EAAWL,EAAS,KAAKK,GAAYA,EAAS,KAAOJ,EAAK,EAAE,EAC5DK,EAAUH,GAAU,KAAKG,GAAWA,EAAQ,SAAWD,GAAU,MAAM,EACvEE,EAAUD,GAAS,SAAS,KAAKC,GAAWA,EAAQ,MAAQF,GAAU,GAAG,EAG/E,OADIA,GAAU,YAAc,CAACA,GAAU,oBAAsBA,EAAS,oBAAsB,IACxFA,GAAU,cAAgB,kBAAgB,UAAY,CAACC,GAAW,CAACC,GAAiB,KACjF,CACL,KAAMP,EAAS,KAAKK,GAAYA,EAAS,KAAOJ,EAAK,EAAE,EACvD,OAAQA,EACR,QAAAK,EACA,QAAAC,CACF,CACF,CAAC,EACA,OAAON,GAAQA,IAAS,IAAI,EAC9B,CAACD,EAAUG,CAAQ,CAAC,EAEjBK,KAAoB,eACvBC,GAA6B,CACxBA,IAAc,gBAAc,+BAC9BX,EAAkB,CAEtB,EACA,CAACA,CAAiB,CACpB,EAEA,SACE,QAAC,aAAU,GAAInB,EAAI,aAAW,EAAA+B,SAAW,uBAAuB,EAC9D,oBAAC,WAAQ,GAAG,KAAK,KAAK,IAAI,KAAMhC,EAAK,MAAO,EAG3CU,GAAWC,MACV,OAAC,QACC,KAAMX,EAAK,kBAAkB,QAAQ,cAAY,gBAAaM,GAAY,kBAAoB,CAAC,EAAE,SAAS,CAAC,EAC3G,UAAU,iFACV,GAAG,IACL,KAGF,OAAC,QACC,MAAOG,EAAU,UAAY,SAC7B,MAAM,OACN,aAAW,EAAAuB,SAAW,+CAA+C,EACrE,MAAOpB,EAAU,SAAS,EAC1B,cAAeqB,GAAS,CACtBpB,EAAaoB,CAAK,KAClB,WAAQ,CACN,MAAO,WACP,WAAY,gBACZ,iBAAkB,CAChB,WAAYA,EACZ,WAAY7B,CACd,CACF,CAAC,CACH,EAEA,mBAAC,YACE,SAAAJ,EAAK,KAAK,IAAIuB,MACb,OAAC,eAA6B,MAAOA,EAAK,MACvC,SAAAA,EAAK,OADUA,EAAK,KAEvB,CACD,EACH,EACF,EAEC,CAAC,CAACD,GAAU,QAAU,CAACJ,MACtB,OAAC,OACC,aAAW,EAAAc,SAAW,qFAAqF,EAE1G,SAAAN,GAAM,IAAIH,MACT,OAAC,kBAEC,KAAMvB,EACN,KAAMuB,EACN,SAAWA,GAA6B,CACjCb,EAEM,CAACR,GAAS,WAAa,CAACK,EAAiB,kBAClDA,EAAiB,KAAK,EAEtBQ,EAAiBQ,CAAI,EAJrBpB,EAAgB,CAMpB,EACA,YAAac,GAZRM,GAAM,MAAM,EAanB,CACD,EACH,EAGDT,GAAe,MAAM,cAAgB,kBAAgB,QAAUd,GAAM,aAAa,QAAUc,MAC3F,OAAC,EAAAoB,QAAA,CACC,OAAQ,CAAC,CAACpB,EACV,KAAMA,EACN,KAAMd,EACN,QAAS8B,EACT,QAAS,IAAM,CACbf,EAAiB,MAAS,CAC5B,EACF,EAEDD,GAAe,MAAM,cAAgB,kBAAgB,SAAWd,GAAM,aAAec,MACpF,OAAC,EAAAqB,QAAA,CACC,OAAQ,CAAC,CAACrB,EACV,KAAMA,EACN,KAAMd,EACN,QAAS8B,EACT,QAAS,IAAM,CACbf,EAAiB,MAAS,CAC5B,EACF,EAEDC,MACC,OAAC,EAAAoB,QAAA,CACC,iBAAiB,+BACjB,UAAU,+BACV,OAAQpB,EAAM,OAAS,EACvB,QAAS,IAAMC,EAAS,CAAC,CAAC,EAC1B,eAAe,gCACf,MAAOD,EACP,gBAAgB,mCAChB,MAAOX,GAAY,UACnB,cAAc,2BAChB,GAEJ,CAEJ",
6
+ "names": ["CreditsRedeemList_exports", "__export", "CreditsRedeemList", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_classnames", "import_react", "import_RedeemCouponModal", "import_RedeemProductModal", "import_provider", "import_useRedeemableList", "import_const", "import_lib", "import_RedeemableItem", "import_constants", "import_rulesModal", "import_registration", "import_utils", "copy", "id", "profile", "openSignUpPopup", "pageGroup", "pageCommon", "creditInfo", "authCodeActivate", "brand", "rounded", "isLogin", "isActivated", "activeTab", "setActiveTab", "popRedeemData", "setPopRedeemData", "rules", "setRules", "listLoading", "redeemableList", "getRedeemableList", "useRedeemableList", "alpcList", "item", "handles", "products", "list", "alpcItem", "product", "variant", "handleRedeemError", "errorCode", "classNames", "value", "RedeemCouponModal", "RedeemProductModal", "RulesModal"]
7
+ }
@@ -0,0 +1,4 @@
1
+ import { RedeemableItem } from '../type';
2
+ export declare const NoneProductValue: ({ item }: {
3
+ item: RedeemableItem;
4
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ "use strict";var m=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var s=Object.prototype.hasOwnProperty;var r=(t,e)=>{for(var p in e)m(t,p,{get:e[p],enumerable:!0})},b=(t,e,p,d)=>{if(e&&typeof e=="object"||typeof e=="function")for(let x of i(e))!s.call(t,x)&&x!==p&&m(t,x,{get:()=>e[x],enumerable:!(d=f(e,x))||d.enumerable});return t};var c=t=>b(m({},"__esModule",{value:!0}),t);var u={};r(u,{NoneProductValue:()=>g});module.exports=c(u);var l=require("react/jsx-runtime"),o=require("@anker-in/headless-ui"),a=require("../context/const"),n=require("../context/provider");const g=({item:t})=>{const{pageCommon:e}=(0,n.useCreditsContext)();return t.config?.type===a.ConsumeType.ShippingCoupon?(0,l.jsx)("div",{className:"absolute left-[16px] l-xxl:left-[12px] bottom-[8px] l:left-[8px] font-extrabold text-white md:bottom-[4px] md:left-[5px]",children:(0,l.jsx)(o.Text,{className:"text-[32px] font-bold leading-none md:text-[12px] l-xxl:text-[20px] w-[70%] md:w-full md-l:text-[14px]",html:t.config?.value,as:"p"})}):(0,l.jsx)("div",{className:"absolute left-[16px] l-xxl:left-[12px] l:left-[8px] bottom-[8px] font-extrabold text-white md:bottom-[4px] md:left-[5px]",children:t.config?.value?(0,l.jsxs)("div",{className:"flex items-end",children:[(0,l.jsx)(o.Text,{className:"text-[64px] font-extrabold leading-none md:text-[20px] l-xxl:text-[40px] md-l:text-[22px]",html:t.config?.value.toString()}),(0,l.jsx)(o.Text,{className:"ml-[4px] text-[24px] font-bold leading-[2] md:ml-[2px] l:text-[12px] xxl:leading-[1.4] l-xxl:text-[20px]",html:t.config?.type===a.ConsumeType.GiftCard?e?.giftCardLabel:e?.off})]}):(0,l.jsx)(o.Text,{className:"text-[24px] w-[70%] font-bold leading-none",html:t.config?.title,as:"p"})})};
2
+ //# sourceMappingURL=NonProductValue.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/components/credits/creditsRedeemList/NonProductValue.tsx"],
4
+ "sourcesContent": ["import { Text } from '@anker-in/headless-ui'\nimport { RedeemableItem } from '../type'\nimport { ConsumeType } from '../context/const'\nimport { useCreditsContext } from '../context/provider'\n\nexport const NoneProductValue = ({ item }: { item: RedeemableItem }) => {\n const { pageCommon } = useCreditsContext()\n // shipping coupon \u4EC5\u5C55\u793A\u6587\u6848\n if (item.config?.type === ConsumeType.ShippingCoupon) {\n return (\n <div className=\"absolute left-[16px] l-xxl:left-[12px] bottom-[8px] l:left-[8px] font-extrabold text-white md:bottom-[4px] md:left-[5px]\">\n <Text\n className=\"text-[32px] font-bold leading-none md:text-[12px] l-xxl:text-[20px] w-[70%] md:w-full md-l:text-[14px]\"\n html={item.config?.value}\n as=\"p\"\n />\n </div>\n )\n } else {\n return (\n <div className=\"absolute left-[16px] l-xxl:left-[12px] l:left-[8px] bottom-[8px] font-extrabold text-white md:bottom-[4px] md:left-[5px]\">\n {item.config?.value ? (\n <div className=\"flex items-end\">\n <Text\n className=\"text-[64px] font-extrabold leading-none md:text-[20px] l-xxl:text-[40px] md-l:text-[22px]\"\n html={item.config?.value.toString()}\n />\n <Text\n className=\"ml-[4px] text-[24px] font-bold leading-[2] md:ml-[2px] l:text-[12px] xxl:leading-[1.4] l-xxl:text-[20px]\"\n html={item.config?.type === ConsumeType.GiftCard ? pageCommon?.giftCardLabel : pageCommon?.off}\n />\n </div>\n ) : (\n <Text className=\"text-[24px] w-[70%] font-bold leading-none\" html={item.config?.title} as=\"p\" />\n )}\n </div>\n )\n }\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,sBAAAE,IAAA,eAAAC,EAAAH,GAWQ,IAAAI,EAAA,6BAXRC,EAAqB,iCAErBC,EAA4B,4BAC5BC,EAAkC,+BAE3B,MAAML,EAAmB,CAAC,CAAE,KAAAM,CAAK,IAAgC,CACtE,KAAM,CAAE,WAAAC,CAAW,KAAI,qBAAkB,EAEzC,OAAID,EAAK,QAAQ,OAAS,cAAY,kBAElC,OAAC,OAAI,UAAU,2HACb,mBAAC,QACC,UAAU,yGACV,KAAMA,EAAK,QAAQ,MACnB,GAAG,IACL,EACF,KAIA,OAAC,OAAI,UAAU,2HACZ,SAAAA,EAAK,QAAQ,SACZ,QAAC,OAAI,UAAU,iBACb,oBAAC,QACC,UAAU,4FACV,KAAMA,EAAK,QAAQ,MAAM,SAAS,EACpC,KACA,OAAC,QACC,UAAU,2GACV,KAAMA,EAAK,QAAQ,OAAS,cAAY,SAAWC,GAAY,cAAgBA,GAAY,IAC7F,GACF,KAEA,OAAC,QAAK,UAAU,6CAA6C,KAAMD,EAAK,QAAQ,MAAO,GAAG,IAAI,EAElG,CAGN",
6
+ "names": ["NonProductValue_exports", "__export", "NoneProductValue", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_const", "import_provider", "item", "pageCommon"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var z=Object.create;var g=Object.defineProperty;var O=Object.getOwnPropertyDescriptor;var U=Object.getOwnPropertyNames;var A=Object.getPrototypeOf,D=Object.prototype.hasOwnProperty;var H=(o,t)=>{for(var r in t)g(o,r,{get:t[r],enumerable:!0})},E=(o,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of U(t))!D.call(o,a)&&a!==r&&g(o,a,{get:()=>t[a],enumerable:!(i=O(t,a))||i.enumerable});return o};var w=(o,t,r)=>(r=o!=null?z(A(o)):{},E(t||!o||!o.__esModule?g(r,"default",{value:o,enumerable:!0}):r,o)),K=o=>E(g({},"__esModule",{value:!0}),o);var j={};H(j,{default:()=>$});module.exports=K(j);var e=require("react/jsx-runtime"),d=require("@anker-in/headless-ui"),C=w(require("classnames")),m=require("react"),F=w(require("../context/hooks/useCopy")),R=require("../context/provider"),T=require("../context/hooks/useRedeemCoupon"),u=require("../context/const"),k=require("../modal/modalContainer"),I=require("../context/utils"),L=require("@anker-in/lib"),_=require("./RedeemProductModal/NonProductValue");function V({item:o,copy:t,onError:r,...i}){const{locale:a}=(0,L.useHeadlessContext)(),[p,B]=(0,m.useState)(),[b,c]=(0,m.useState)(),[v,x]=(0,m.useState)(!1),{copy:S,copied:N}=(0,F.default)(),{profile:f,fetchCreditInfo:h,pageCommon:n}=(0,R.useCreditsContext)(),{isMutating:M,trigger:y}=(0,T.useRedeemCoupon)({onSuccess(l){if(!l){c(t.redeemModal.commonError);return}if(l?.data?.success)B(l.data.coupon_code),h(f?.user_id);else{let s;l.code===u.AlpcErrorCode.CodeLpcShopifyCouponRuleRedeemLimit?(s=t.redeemModal.redeemLimitError,x(!0)):l.code===u.AlpcErrorCode.CodeLpcRuleInventoryNotEnough?(s=t.redeemModal.inventoryNotEnough,x(!0)):l.code===u.AlpcErrorCode.CodeLpcNotEnoughCredits?(s=t.redeemModal.creditsNotEnough,x(!0),h(f?.user_id)):l.code===u.AlpcErrorCode.CodeCrossSiteError&&(s=t.redeemModal.crossSiteError,x(!0)),c(s||t.redeemModal.commonError||""),r&&r(l.code)}},onError(l){c(l.message||t.redeemModal.commonError)}}),P=(0,m.useCallback)(async()=>{c(""),y({user_id:f?.user_id,rule_id:Number(o.alpc?.id)})},[o,f,y]);return(0,m.useEffect)(()=>{i.isOpen||(x(!1),c(""))},[i.isOpen]),(0,e.jsxs)(k.CreditsModalContainer,{...i,className:"w-[540px] md:h-auto",scrollClassName:"mb-[40px] min-l:px-0 md:mb-[24px] px-0",titleClassName:"h-[56px] bg-[#F5F5F7]",children:[(0,e.jsxs)("div",{className:(0,C.default)("max-h-[500px] overflow-y-auto bg-[#F5F5F7] px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]"),children:[(0,e.jsxs)("div",{className:"relative mx-auto h-[164px] w-[324px]",children:[n?.imageMapping?.[o.config?.type]?.url&&(0,e.jsx)(d.Picture,{source:n.imageMapping[o.config.type].url,className:"h-full [&_img]:h-full"}),(0,e.jsx)("div",{className:"absolute bottom-[8px] left-[16px] font-extrabold text-white",children:o.config.value?(0,e.jsx)(_.NoneProductValue,{item:o,copy:t}):(0,e.jsx)(d.Text,{size:3,html:o.alpc?.title})})]}),p?(0,e.jsxs)("div",{className:"mt-[30px] flex items-center justify-center md:mt-[18px]",children:[(0,e.jsx)("div",{className:"mr-[10px] text-[24px] font-bold leading-[1.4] md:leading-[1.2]",children:p}),(0,e.jsx)("div",{className:(0,C.default)("cursor-pointer text-[16px] font-bold leading-[1.2] underline md:text-[14px]",N?"pointer-events-none":"pointer-events-auto"),onClick:()=>{S(p)},role:"button",tabIndex:0,onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&l.preventDefault()},children:N?n?.copied:n?.copy})]}):(0,e.jsxs)(d.Text,{as:"p",className:(0,C.default)("mt-[30px] text-center text-[24px] font-bold leading-[1.2] md:mt-[18px] md:text-[20px] md:leading-[1.2]"),children:[(0,I.numberFormat)(o.alpc?.consumeCredits)," ",n?.pointUnit]}),!p&&o.config?.rules?.length>0&&(0,e.jsxs)("div",{className:"mt-[18px] w-full text-[16px] font-bold leading-[1.4] text-[#6D6D6F] md:mt-[12px] md:text-[14px]",children:[(0,e.jsxs)("div",{className:"mb-[4px]",children:[n?.ruleLabel,":"]}),(0,e.jsx)("ul",{className:"ml-4 grid grid-flow-row gap-[4px]",children:o.config?.rules?.map((l,s)=>(0,e.jsx)("li",{className:"list-disc",children:(0,e.jsx)(d.Text,{html:l})},s))})]})]}),(0,e.jsxs)("div",{className:"bg-white px-[48px] pt-[24px] text-center md:px-[16px]",children:[p&&!M?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"flex flex-col",children:[(0,e.jsx)(d.Text,{className:"mb-[4px] text-[24px] font-bold leading-[1.2] md:text-[20px]",html:t.redeemModal.coupon.successTitle}),(0,e.jsx)(d.Text,{className:"text-[16px] font-bold leading-[1.4] text-[#6D6D6F] md:text-[14px]",html:t.redeemModal.coupon.successDesc})]}),(0,e.jsx)(d.Button,{variant:"primary",size:"lg",className:"mt-[16px] w-full",onClick:()=>{window.location.href=t.redeemModal.coupon.successButtonUrl||`/${a}`,i.onClose&&i.onClose()},disabled:v,children:t.redeemModal.coupon.successButton})]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(d.Text,{className:"block text-[24px] font-bold leading-[1.2] md:text-[20px] md:leading-[1.2]",html:t.redeemModal.confirmTitle}),(0,e.jsx)(d.Button,{loading:M,variant:"primary",size:"lg",className:"mt-[16px] w-full",onClick:P,disabled:v,children:t.redeemModal.confirmButton})]}),b&&(0,e.jsx)("div",{className:"mx-auto max-w-full py-[12px] text-center text-[#FF0000]",children:(0,e.jsx)(d.Text,{className:"text-[14px] font-semibold text-[#1F2021]",html:b})})]})]})}var $=V;
2
+ //# sourceMappingURL=RedeemCouponModal.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/components/credits/creditsRedeemList/RedeemCouponModal.tsx"],
4
+ "sourcesContent": ["import { Button, Picture, Text } from '@anker-in/headless-ui'\nimport classNames from 'classnames'\nimport { useCallback, useEffect, useState } from 'react'\nimport type { ModalContainerProps } from '../modal/modalContainer'\nimport useCopy from '../context/hooks/useCopy'\nimport { useCreditsContext } from '../context/provider'\nimport { useRedeemCoupon } from '../context/hooks/useRedeemCoupon'\nimport { AlpcErrorCode } from '../context/const'\nimport { CreditsModalContainer } from '../modal/modalContainer'\nimport { numberFormat } from '../context/utils'\nimport type { RedeemableItem as RedeemableItemType } from '../type'\nimport { useHeadlessContext } from '@anker-in/lib'\nimport { CreditsRedeemListCopy } from './type'\nimport { NoneProductValue } from './RedeemProductModal/NonProductValue'\n\nfunction RedeemCouponModal({\n item,\n copy,\n onError,\n ...props\n}: ModalContainerProps & {\n item: RedeemableItemType\n copy: CreditsRedeemListCopy\n onError: (code: number) => void\n}) {\n const { locale } = useHeadlessContext()\n const [couponCode, setCouponCode] = useState<string>()\n const [errorInfo, setErrorInfo] = useState<string>()\n\n const [disabled, setDisabled] = useState(false)\n const { copy: copyText, copied: copiedStatus } = useCopy()\n\n const { profile, fetchCreditInfo, pageCommon } = useCreditsContext()\n\n const { isMutating: loading, trigger } = useRedeemCoupon({\n onSuccess(responseData) {\n if (!responseData) {\n setErrorInfo(copy.redeemModal.commonError)\n return\n }\n\n if (responseData?.data?.success) {\n setCouponCode(responseData.data.coupon_code)\n fetchCreditInfo(profile?.user_id)\n } else {\n let errorMsg\n if (responseData.code === AlpcErrorCode.CodeLpcShopifyCouponRuleRedeemLimit) {\n errorMsg = copy.redeemModal.redeemLimitError\n setDisabled(true)\n } else if (responseData.code === AlpcErrorCode.CodeLpcRuleInventoryNotEnough) {\n errorMsg = copy.redeemModal.inventoryNotEnough\n setDisabled(true)\n } else if (responseData.code === AlpcErrorCode.CodeLpcNotEnoughCredits) {\n errorMsg = copy.redeemModal.creditsNotEnough\n setDisabled(true)\n fetchCreditInfo(profile?.user_id)\n } else if (responseData.code === AlpcErrorCode.CodeCrossSiteError) {\n errorMsg = copy.redeemModal.crossSiteError\n setDisabled(true)\n }\n\n setErrorInfo(errorMsg || copy.redeemModal.commonError || '')\n onError && onError(responseData.code)\n }\n },\n onError(error) {\n setErrorInfo(error.message || copy.redeemModal.commonError)\n },\n })\n\n const handleConfirm = useCallback(async () => {\n setErrorInfo('')\n trigger({\n user_id: profile?.user_id,\n rule_id: Number(item.alpc?.id),\n })\n }, [item, profile, trigger])\n\n useEffect(() => {\n if (!props.isOpen) {\n setDisabled(false)\n setErrorInfo('')\n }\n }, [props.isOpen])\n\n return (\n <CreditsModalContainer\n {...props}\n className=\"w-[540px] md:h-auto\"\n scrollClassName=\"mb-[40px] min-l:px-0 md:mb-[24px] px-0\"\n titleClassName=\"h-[56px] bg-[#F5F5F7]\"\n >\n <div\n className={classNames(\n 'max-h-[500px] overflow-y-auto bg-[#F5F5F7] px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]'\n )}\n >\n <div className=\"relative mx-auto h-[164px] w-[324px]\">\n {pageCommon?.imageMapping?.[item.config?.type]?.url && (\n <Picture source={pageCommon.imageMapping[item.config.type].url} className=\"h-full [&_img]:h-full\" />\n )}\n <div className=\"absolute bottom-[8px] left-[16px] font-extrabold text-white\">\n {item.config.value ? (\n <NoneProductValue item={item} copy={copy} />\n ) : (\n <Text size={3} html={item.alpc?.title} />\n )}\n </div>\n </div>\n {couponCode ? (\n <div className=\"mt-[30px] flex items-center justify-center md:mt-[18px]\">\n <div className=\"mr-[10px] text-[24px] font-bold leading-[1.4] md:leading-[1.2]\">{couponCode}</div>\n <div\n className={classNames(\n 'cursor-pointer text-[16px] font-bold leading-[1.2] underline md:text-[14px]',\n copiedStatus ? 'pointer-events-none' : 'pointer-events-auto'\n )}\n onClick={() => {\n copyText(couponCode)\n }}\n role=\"button\"\n tabIndex={0}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n }\n }}\n >\n {copiedStatus ? pageCommon?.copied : pageCommon?.copy}\n </div>\n </div>\n ) : (\n <Text\n as=\"p\"\n className={classNames(\n 'mt-[30px] text-center text-[24px] font-bold leading-[1.2] md:mt-[18px] md:text-[20px] md:leading-[1.2]'\n )}\n >\n {numberFormat(item.alpc?.consumeCredits)} {pageCommon?.pointUnit}\n </Text>\n )}\n {!couponCode && item.config?.rules?.length > 0 && (\n <div className=\"mt-[18px] w-full text-[16px] font-bold leading-[1.4] text-[#6D6D6F] md:mt-[12px] md:text-[14px]\">\n <div className=\"mb-[4px]\">{pageCommon?.ruleLabel}:</div>\n <ul className=\"ml-4 grid grid-flow-row gap-[4px]\">\n {item.config?.rules?.map((text, index) => (\n <li className=\"list-disc\" key={index}>\n <Text html={text} />\n </li>\n ))}\n </ul>\n </div>\n )}\n </div>\n <div className=\"bg-white px-[48px] pt-[24px] text-center md:px-[16px]\">\n {couponCode && !loading ? (\n <>\n <div className=\"flex flex-col\">\n <Text\n className=\"mb-[4px] text-[24px] font-bold leading-[1.2] md:text-[20px]\"\n html={copy.redeemModal.coupon.successTitle}\n ></Text>\n <Text\n className=\"text-[16px] font-bold leading-[1.4] text-[#6D6D6F] md:text-[14px]\"\n html={copy.redeemModal.coupon.successDesc}\n ></Text>\n </div>\n <Button\n variant=\"primary\"\n size=\"lg\"\n className=\"mt-[16px] w-full\"\n onClick={() => {\n window.location.href = copy.redeemModal.coupon.successButtonUrl || `/${locale}`\n if (props.onClose) {\n props.onClose()\n }\n }}\n disabled={disabled}\n >\n {copy.redeemModal.coupon.successButton}\n </Button>\n </>\n ) : (\n <>\n <Text\n className=\"block text-[24px] font-bold leading-[1.2] md:text-[20px] md:leading-[1.2]\"\n html={copy.redeemModal.confirmTitle}\n ></Text>\n <Button\n loading={loading}\n variant=\"primary\"\n size=\"lg\"\n className=\"mt-[16px] w-full\"\n onClick={handleConfirm}\n disabled={disabled}\n >\n {copy.redeemModal.confirmButton}\n </Button>\n </>\n )}\n {errorInfo && (\n <div className=\"mx-auto max-w-full py-[12px] text-center text-[#FF0000]\">\n <Text className=\"text-[14px] font-semibold text-[#1F2021]\" html={errorInfo} />\n </div>\n )}\n </div>\n </CreditsModalContainer>\n )\n}\n\nexport default RedeemCouponModal\n"],
5
+ "mappings": "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",
6
+ "names": ["RedeemCouponModal_exports", "__export", "RedeemCouponModal_default", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_classnames", "import_react", "import_useCopy", "import_provider", "import_useRedeemCoupon", "import_const", "import_modalContainer", "import_utils", "import_lib", "import_NonProductValue", "RedeemCouponModal", "item", "copy", "onError", "props", "locale", "couponCode", "setCouponCode", "errorInfo", "setErrorInfo", "disabled", "setDisabled", "copyText", "copiedStatus", "useCopy", "profile", "fetchCreditInfo", "pageCommon", "loading", "trigger", "responseData", "errorMsg", "error", "handleConfirm", "classNames", "e", "text", "index"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var D=Object.create;var a=Object.defineProperty;var L=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var B=Object.getPrototypeOf,I=Object.prototype.hasOwnProperty;var P=(e,o)=>{for(var t in o)a(e,t,{get:o[t],enumerable:!0})},p=(e,o,t,m)=>{if(o&&typeof o=="object"||typeof o=="function")for(let s of T(o))!I.call(e,s)&&s!==t&&a(e,s,{get:()=>o[s],enumerable:!(m=L(o,s))||m.enumerable});return e};var l=(e,o,t)=>(t=e!=null?D(B(e)):{},p(o||!e||!e.__esModule?a(t,"default",{value:e,enumerable:!0}):t,e)),k=e=>p(a({},"__esModule",{value:!0}),e);var E={};P(E,{Address:()=>M});module.exports=k(E);var d=require("react/jsx-runtime"),r=require("@anker-in/headless-ui"),i=l(require("classnames")),x=require("../AddressForm"),c=require("@anker-in/lib"),u=require("./ProductInfo"),f=l(require("../../context/hooks/useCountries")),v=require("../../../../constants");const M=({copy:e,shippingAddress:o,setAddress:t,validateAddress:m,validateErrors:s,shippingProduct:n,loading:y,address:b,disabled:g,handlePayment:N,item:R})=>{const{storeDomain:h,brand:A}=(0,c.useHeadlessContext)(),C=v.ROUNDED_BRANDS.includes(A),{countries:F=[],isLoading:w}=(0,f.default)({shopifyStoreDomain:h});return(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsx)("div",{className:(0,i.default)("max-h-[500px] overflow-y-auto px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]"),children:(0,d.jsxs)("div",{children:[o&&(0,d.jsx)(r.Text,{className:"mb-5 text-[16px] font-bold",html:o}),e.redeemModal?.product?.addressForm&&(0,d.jsx)(x.AddressForm,{onChange:t,validate:m,errors:s,form:e.redeemModal.product.addressForm,countries:F,countriesLoading:w})]})}),(0,d.jsxs)("div",{className:"sticky bottom-0 flex flex-col items-center justify-center bg-white px-[48px] py-[24px] l:px-[16px]",children:[(0,d.jsxs)("div",{className:(0,i.default)("flex w-full items-center bg-[#F5F5F7] p-[16px]",!C&&"rounded-none"),children:[n&&(0,d.jsx)(r.Text,{className:"mb-5 text-[16px] font-bold",html:n}),(0,d.jsx)(u.ProductInfo,{item:R,copy:e})]}),(0,d.jsx)(r.Button,{loading:y||!b,variant:"primary",className:"mx-auto mt-[16px] w-[444px] md:mt-[12px] md:w-full",onClick:N,disabled:g,children:e.redeemModal.product.paymentButton})]})]})};
2
+ //# sourceMappingURL=Address.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/components/credits/creditsRedeemList/RedeemProductModal/Address.tsx"],
4
+ "sourcesContent": ["import { Button, Text } from '@anker-in/headless-ui'\nimport classNames from 'classnames'\nimport { AddressForm } from '../AddressForm'\nimport { useHeadlessContext } from '@anker-in/lib'\nimport type { RedeemableItem as RedeemableItemType } from '../../type'\nimport { CreditsRedeemListCopy } from '../type'\nimport { ProductInfo } from './ProductInfo'\nimport useCountries from '../../context/hooks/useCountries'\nimport { ROUNDED_BRANDS } from '../../../../constants'\n\ntype AddressProps = {\n copy: CreditsRedeemListCopy\n shippingAddress: string\n setAddress: (address: Record<string, any>) => void\n validateAddress: (address: Record<string, any>) => boolean\n validateErrors: { key: string; message: string }[]\n item: RedeemableItemType\n loading: boolean\n address: Record<string, any> | undefined\n disabled: boolean\n handlePayment: () => void\n shippingProduct: string\n}\n\nexport const Address = ({\n copy,\n shippingAddress,\n setAddress,\n validateAddress,\n validateErrors,\n shippingProduct,\n loading,\n address,\n disabled,\n handlePayment,\n item,\n}: AddressProps) => {\n const { storeDomain, brand } = useHeadlessContext()\n const rounded = ROUNDED_BRANDS.includes(brand)\n const { countries = [], isLoading: countriesLoading } = useCountries({ shopifyStoreDomain: storeDomain })\n\n return (\n <div className=\"relative\">\n <div className={classNames('max-h-[500px] overflow-y-auto px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]')}>\n <div>\n {shippingAddress && <Text className=\"mb-5 text-[16px] font-bold\" html={shippingAddress}></Text>}\n {copy.redeemModal?.product?.addressForm && (\n <AddressForm\n onChange={setAddress}\n validate={validateAddress}\n errors={validateErrors}\n form={copy.redeemModal.product.addressForm}\n countries={countries}\n countriesLoading={countriesLoading}\n ></AddressForm>\n )}\n </div>\n </div>\n <div className=\"sticky bottom-0 flex flex-col items-center justify-center bg-white px-[48px] py-[24px] l:px-[16px]\">\n <div className={classNames('flex w-full items-center bg-[#F5F5F7] p-[16px]', !rounded && 'rounded-none')}>\n {shippingProduct && <Text className=\"mb-5 text-[16px] font-bold\" html={shippingProduct}></Text>}\n <ProductInfo item={item} copy={copy} />\n </div>\n <Button\n loading={loading || !address}\n variant=\"primary\"\n className=\"mx-auto mt-[16px] w-[444px] md:mt-[12px] md:w-full\"\n onClick={handlePayment}\n disabled={disabled}\n >\n {copy.redeemModal.product.paymentButton}\n </Button>\n </div>\n </div>\n )\n}\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA4CQ,IAAAI,EAAA,6BA5CRC,EAA6B,iCAC7BC,EAAuB,yBACvBC,EAA4B,0BAC5BC,EAAmC,yBAGnCC,EAA4B,yBAC5BC,EAAyB,+CACzBC,EAA+B,iCAgBxB,MAAMT,EAAU,CAAC,CACtB,KAAAU,EACA,gBAAAC,EACA,WAAAC,EACA,gBAAAC,EACA,eAAAC,EACA,gBAAAC,EACA,QAAAC,EACA,QAAAC,EACA,SAAAC,EACA,cAAAC,EACA,KAAAC,CACF,IAAoB,CAClB,KAAM,CAAE,YAAAC,EAAa,MAAAC,CAAM,KAAI,sBAAmB,EAC5CC,EAAU,iBAAe,SAASD,CAAK,EACvC,CAAE,UAAAE,EAAY,CAAC,EAAG,UAAWC,CAAiB,KAAI,EAAAC,SAAa,CAAE,mBAAoBL,CAAY,CAAC,EAExG,SACE,QAAC,OAAI,UAAU,WACb,oBAAC,OAAI,aAAW,EAAAM,SAAW,iFAAiF,EAC1G,oBAAC,OACE,UAAAhB,MAAmB,OAAC,QAAK,UAAU,6BAA6B,KAAMA,EAAiB,EACvFD,EAAK,aAAa,SAAS,gBAC1B,OAAC,eACC,SAAUE,EACV,SAAUC,EACV,OAAQC,EACR,KAAMJ,EAAK,YAAY,QAAQ,YAC/B,UAAWc,EACX,iBAAkBC,EACnB,GAEL,EACF,KACA,QAAC,OAAI,UAAU,qGACb,qBAAC,OAAI,aAAW,EAAAE,SAAW,iDAAkD,CAACJ,GAAW,cAAc,EACpG,UAAAR,MAAmB,OAAC,QAAK,UAAU,6BAA6B,KAAMA,EAAiB,KACxF,OAAC,eAAY,KAAMK,EAAM,KAAMV,EAAM,GACvC,KACA,OAAC,UACC,QAASM,GAAW,CAACC,EACrB,QAAQ,UACR,UAAU,qDACV,QAASE,EACT,SAAUD,EAET,SAAAR,EAAK,YAAY,QAAQ,cAC5B,GACF,GACF,CAEJ",
6
+ "names": ["Address_exports", "__export", "Address", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_classnames", "import_AddressForm", "import_lib", "import_ProductInfo", "import_useCountries", "import_constants", "copy", "shippingAddress", "setAddress", "validateAddress", "validateErrors", "shippingProduct", "loading", "address", "disabled", "handlePayment", "item", "storeDomain", "brand", "rounded", "countries", "countriesLoading", "useCountries", "classNames"]
7
+ }
@@ -1,2 +1,2 @@
1
- "use strict";var x=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var l=(r,e)=>{for(var a in e)x(r,a,{get:e[a],enumerable:!0})},g=(r,e,a,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of i(e))!c.call(r,t)&&t!==a&&x(r,t,{get:()=>e[t],enumerable:!(o=p(e,t))||o.enumerable});return r};var n=r=>g(x({},"__esModule",{value:!0}),r);var d={};l(d,{Error:()=>u});module.exports=n(d);var s=require("react/jsx-runtime"),m=require("@anker-in/headless-ui");const u=({errorInfo:r})=>(0,s.jsxs)("div",{className:"mx-auto max-w-[404px] text-[16px] text-black/40",children:[(0,s.jsx)(m.Picture,{className:"mx-auto mb-[12px] h-[140px] w-[220px]",source:r.imageUrl}),(0,s.jsx)(m.Text,{as:"div",className:"mt-[16px] text-center",html:r.message})]});
1
+ "use strict";var x=Object.defineProperty;var o=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var l=(r,e)=>{for(var a in e)x(r,a,{get:e[a],enumerable:!0})},g=(r,e,a,p)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of i(e))!c.call(r,t)&&t!==a&&x(r,t,{get:()=>e[t],enumerable:!(p=o(e,t))||p.enumerable});return r};var n=r=>g(x({},"__esModule",{value:!0}),r);var d={};l(d,{Error:()=>u});module.exports=n(d);var s=require("react/jsx-runtime"),m=require("@anker-in/headless-ui");const u=({errorInfo:r})=>(0,s.jsxs)("div",{className:"mx-auto max-w-[404px] text-[16px] text-black/40 py-[56px]",children:[(0,s.jsx)(m.Picture,{className:"mx-auto mb-[12px] h-[140px] w-[220px]",source:r.imageUrl}),(0,s.jsx)(m.Text,{as:"div",className:"mt-[16px] text-center",html:r.message})]});
2
2
  //# sourceMappingURL=Error.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../src/components/credits/credits-redeem-list/redeem-product-modal/Error.tsx"],
4
- "sourcesContent": ["import { Picture, Text } from '@anker-in/headless-ui'\n\ntype ErrorProps = {\n errorInfo: { imageUrl: string; message: string }\n}\n\nexport const Error = ({ errorInfo }: ErrorProps) => {\n return (\n <div className=\"mx-auto max-w-[404px] text-[16px] text-black/40\">\n <Picture className=\"mx-auto mb-[12px] h-[140px] w-[220px]\" source={errorInfo.imageUrl} />\n <Text as=\"div\" className=\"mt-[16px] text-center\" html={errorInfo.message} />\n </div>\n )\n}\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,WAAAE,IAAA,eAAAC,EAAAH,GAQI,IAAAI,EAAA,6BARJC,EAA8B,iCAMvB,MAAMH,EAAQ,CAAC,CAAE,UAAAI,CAAU,OAE9B,QAAC,OAAI,UAAU,kDACb,oBAAC,WAAQ,UAAU,wCAAwC,OAAQA,EAAU,SAAU,KACvF,OAAC,QAAK,GAAG,MAAM,UAAU,wBAAwB,KAAMA,EAAU,QAAS,GAC5E",
3
+ "sources": ["../../../../../../src/components/credits/creditsRedeemList/RedeemProductModal/Error.tsx"],
4
+ "sourcesContent": ["import { Picture, Text } from '@anker-in/headless-ui'\n\ntype ErrorProps = {\n errorInfo: { imageUrl: string; message: string }\n}\n\nexport const Error = ({ errorInfo }: ErrorProps) => {\n return (\n <div className=\"mx-auto max-w-[404px] text-[16px] text-black/40 py-[56px]\">\n <Picture className=\"mx-auto mb-[12px] h-[140px] w-[220px]\" source={errorInfo.imageUrl} />\n <Text as=\"div\" className=\"mt-[16px] text-center\" html={errorInfo.message} />\n </div>\n )\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,WAAAE,IAAA,eAAAC,EAAAH,GAQI,IAAAI,EAAA,6BARJC,EAA8B,iCAMvB,MAAMH,EAAQ,CAAC,CAAE,UAAAI,CAAU,OAE9B,QAAC,OAAI,UAAU,4DACb,oBAAC,WAAQ,UAAU,wCAAwC,OAAQA,EAAU,SAAU,KACvF,OAAC,QAAK,GAAG,MAAM,UAAU,wBAAwB,KAAMA,EAAU,QAAS,GAC5E",
6
6
  "names": ["Error_exports", "__export", "Error", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "errorInfo"]
7
7
  }
@@ -0,0 +1,2 @@
1
+ "use strict";var N=Object.create;var p=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var y=Object.getPrototypeOf,C=Object.prototype.hasOwnProperty;var M=(o,t)=>{for(var s in t)p(o,s,{get:t[s],enumerable:!0})},u=(o,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of w(t))!C.call(o,l)&&l!==s&&p(o,l,{get:()=>t[l],enumerable:!(i=h(t,l))||i.enumerable});return o};var P=(o,t,s)=>(s=o!=null?N(y(o)):{},u(t||!o||!o.__esModule?p(s,"default",{value:o,enumerable:!0}):s,o)),T=o=>u(p({},"__esModule",{value:!0}),o);var I={};M(I,{Init:()=>F});module.exports=T(I);var e=require("react/jsx-runtime"),d=require("@anker-in/headless-ui"),r=P(require("classnames")),x=require("react"),f=require("../../context/utils"),g=require("../../context/const"),v=require("./NonProductValue"),b=require("../../context/provider");const F=({copy:o,item:t,loading:s,disabled:i,setStatus:l})=>{const{pageCommon:n}=(0,b.useCreditsContext)(),c=(0,x.useMemo)(()=>t.config.rules?.length?t.config.rules:[...t.config.desc?.split("<br>")||[],...o.redeemModal.product.rules||[]],[t.config.rules,t.config.desc,o.redeemModal.product.rules]);return(0,e.jsxs)("div",{className:"flex flex-col",children:[(0,e.jsx)("div",{className:(0,r.default)("max-h-[500px] overflow-y-auto bg-[#F5F5F7] px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]"),children:(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"relative mx-auto h-[164px] w-fit",children:[(0,e.jsx)(d.Picture,{source:t.config?.type===g.ConsumeType.Product?t.product.images[0]?.url:n?.imageMapping?.[t.config.type]?.url||t.config.image?.url,className:"h-full w-auto [&_img]:h-full [&_img]:w-auto [&_img]:object-contain"}),(0,e.jsx)("div",{className:"absolute bottom-[8px] left-[16px] font-extrabold text-white",children:t.config.value&&(0,e.jsx)(v.NoneProductValue,{item:t,copy:o})})]}),(0,e.jsxs)("div",{className:"mt-[30px] md:mt-[18px]",children:[t.config.type==="product"&&(0,e.jsx)("div",{className:(0,r.default)("mb-[4px] text-center text-[24px] font-bold leading-[1.2] md:text-[20px] md:leading-[1.2]"),children:t.config.title}),(0,e.jsxs)(d.Text,{as:"p",className:(0,r.default)(" text-center text-[24px] font-bold leading-[1.2] md:text-[20px] md:leading-[1.2]"),children:[(0,f.numberFormat)(t.alpc?.consumeCredits)," ",n?.pointUnit]})]}),(0,e.jsxs)("div",{className:"mt-[16px] w-full text-[14px] font-semibold text-[#777] md:mt-[12px]",children:[(0,e.jsx)("div",{className:"text-[16px] font-bold leading-[1.4]",children:o.redeemModal.product.stepTitle}),(0,e.jsx)("div",{className:"mt-[4px] flex items-center justify-center",children:o.redeemModal.product.steps?.map((m,a)=>(0,e.jsxs)(x.Fragment,{children:[(0,e.jsxs)("div",{className:"flex w-[76px] flex-col items-center text-center md:h-[94px] min-l:w-[130px]",children:[(0,e.jsx)(d.Picture,{source:m.imageUrl,className:"mb-[4px] h-[58px] w-[58px]"}),(0,e.jsx)("div",{className:"min-h-[34px] text-[14px] font-bold text-[#777] md:min-h-[28px] md:text-[12px]",children:m.title})]}),a!==o.redeemModal.product.steps.length-1&&(0,e.jsx)(d.Picture,{source:"https://cdn.shopify.com/s/files/1/0517/6767/3016/files/step-arrow.png?v=1690458150",className:"mb-[20px] h-[10px] w-[20px] md:mb-[30px] md:h-[5px] md:w-[12px]"})]},a))}),(0,e.jsx)("div",{className:"overflow-auto",children:c?.length&&(0,e.jsx)("ul",{className:"ml-[18px] mt-[16px] grid grid-flow-row gap-[4px] text-[16px] font-bold leading-[1.4] text-[#6D6D6F] md:mt-[12px]",children:c.map((m,a)=>(0,e.jsx)("li",{className:"list-disc",children:(0,e.jsx)(d.Text,{as:"div",html:m,className:"font-bold"})},a))})})]})]})}),(0,e.jsxs)("div",{className:"flex-1 bg-white px-[48px] py-[24px] text-center md:px-[16px]",children:[(0,e.jsx)(d.Text,{as:"p",className:"block text-[24px] font-bold leading-[1.2] md:text-[20px] md:leading-[1.2]",html:o.redeemModal.confirmTitle}),(0,e.jsx)(d.Button,{loading:s,disabled:i,variant:"primary",size:"lg",className:"mt-[16px] w-full md:mt-[12px]",onClick:()=>{l("address")},children:o.redeemModal.confirmButton})]})]})};
2
+ //# sourceMappingURL=Init.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/components/credits/creditsRedeemList/RedeemProductModal/Init.tsx"],
4
+ "sourcesContent": ["import { Button, Picture, Text } from '@anker-in/headless-ui'\nimport classNames from 'classnames'\nimport { Fragment, useMemo } from 'react'\nimport { numberFormat } from '../../context/utils'\nimport type { RedeemableItem as RedeemableItemType } from '../../type'\nimport { CreditsRedeemListCopy } from '../type'\nimport { ConsumeType } from '../../context/const'\nimport { NoneProductValue } from './NonProductValue'\nimport { useCreditsContext } from '../../context/provider'\n\ntype InitProps = {\n copy: CreditsRedeemListCopy\n item: RedeemableItemType\n loading: boolean\n disabled: boolean\n setStatus: (status: 'address' | 'init' | 'success' | 'error') => void\n}\n\nexport const Init = ({ copy, item, loading, disabled, setStatus }: InitProps) => {\n const { pageCommon } = useCreditsContext()\n const rules = useMemo(() => {\n if (item.config.rules?.length) {\n return item.config.rules\n }\n const descriptions = item.config.desc?.split('<br>') || []\n return [...descriptions, ...(copy.redeemModal.product.rules || [])]\n }, [item.config.rules, item.config.desc, copy.redeemModal.product.rules])\n\n return (\n <div className=\"flex flex-col\">\n <div\n className={classNames(\n 'max-h-[500px] overflow-y-auto bg-[#F5F5F7] px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]'\n )}\n >\n <>\n <div className=\"relative mx-auto h-[164px] w-fit\">\n <Picture\n source={\n item.config?.type === ConsumeType.Product\n ? item.product.images[0]?.url\n : pageCommon?.imageMapping?.[item.config.type]?.url || item.config.image?.url\n }\n className=\"h-full w-auto [&_img]:h-full [&_img]:w-auto [&_img]:object-contain\"\n ></Picture>\n {/* \u793C\u54C1\u5361\u5C55\u793A */}\n <div className=\"absolute bottom-[8px] left-[16px] font-extrabold text-white\">\n {item.config.value && <NoneProductValue item={item} copy={copy} />}\n </div>\n </div>\n <div className=\"mt-[30px] md:mt-[18px]\">\n {item.config.type === 'product' && (\n <div\n className={classNames(\n 'mb-[4px] text-center text-[24px] font-bold leading-[1.2] md:text-[20px] md:leading-[1.2]'\n )}\n >\n {item.config.title}\n </div>\n )}\n <Text\n as=\"p\"\n className={classNames(' text-center text-[24px] font-bold leading-[1.2] md:text-[20px] md:leading-[1.2]')}\n >\n {numberFormat(item.alpc?.consumeCredits)} {pageCommon?.pointUnit}\n </Text>\n </div>\n <div className=\"mt-[16px] w-full text-[14px] font-semibold text-[#777] md:mt-[12px]\">\n <div className=\"text-[16px] font-bold leading-[1.4]\">{copy.redeemModal.product.stepTitle}</div>\n <div className=\"mt-[4px] flex items-center justify-center\">\n {copy.redeemModal.product.steps?.map((item, index) => (\n <Fragment key={index}>\n <div className=\"flex w-[76px] flex-col items-center text-center md:h-[94px] min-l:w-[130px]\">\n <Picture source={item.imageUrl} className=\"mb-[4px] h-[58px] w-[58px]\"></Picture>\n <div className=\"min-h-[34px] text-[14px] font-bold text-[#777] md:min-h-[28px] md:text-[12px]\">\n {item.title}\n </div>\n </div>\n {index !== copy.redeemModal.product.steps.length - 1 && (\n <Picture\n source=\"https://cdn.shopify.com/s/files/1/0517/6767/3016/files/step-arrow.png?v=1690458150\"\n className=\"mb-[20px] h-[10px] w-[20px] md:mb-[30px] md:h-[5px] md:w-[12px]\"\n ></Picture>\n )}\n </Fragment>\n ))}\n </div>\n <div className=\"overflow-auto\">\n {rules?.length && (\n <ul className=\"ml-[18px] mt-[16px] grid grid-flow-row gap-[4px] text-[16px] font-bold leading-[1.4] text-[#6D6D6F] md:mt-[12px]\">\n {rules.map((text, index) => (\n <li className=\"list-disc\" key={index}>\n <Text as=\"div\" html={text} className=\"font-bold\" />\n </li>\n ))}\n </ul>\n )}\n </div>\n </div>\n </>\n </div>\n <div className=\"flex-1 bg-white px-[48px] py-[24px] text-center md:px-[16px]\">\n <Text\n as=\"p\"\n className=\"block text-[24px] font-bold leading-[1.2] md:text-[20px] md:leading-[1.2]\"\n html={copy.redeemModal.confirmTitle}\n ></Text>\n <Button\n loading={loading}\n disabled={disabled}\n variant=\"primary\"\n size=\"lg\"\n className=\"mt-[16px] w-full md:mt-[12px]\"\n onClick={() => {\n setStatus('address')\n }}\n >\n {copy.redeemModal.confirmButton}\n </Button>\n </div>\n </div>\n )\n}\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,UAAAE,IAAA,eAAAC,EAAAH,GAmCQ,IAAAI,EAAA,6BAnCRC,EAAsC,iCACtCC,EAAuB,yBACvBC,EAAkC,iBAClCC,EAA6B,+BAG7BC,EAA4B,+BAC5BC,EAAiC,6BACjCC,EAAkC,kCAU3B,MAAMT,EAAO,CAAC,CAAE,KAAAU,EAAM,KAAAC,EAAM,QAAAC,EAAS,SAAAC,EAAU,UAAAC,CAAU,IAAiB,CAC/E,KAAM,CAAE,WAAAC,CAAW,KAAI,qBAAkB,EACnCC,KAAQ,WAAQ,IAChBL,EAAK,OAAO,OAAO,OACdA,EAAK,OAAO,MAGd,CAAC,GADaA,EAAK,OAAO,MAAM,MAAM,MAAM,GAAK,CAAC,EAChC,GAAID,EAAK,YAAY,QAAQ,OAAS,CAAC,CAAE,EACjE,CAACC,EAAK,OAAO,MAAOA,EAAK,OAAO,KAAMD,EAAK,YAAY,QAAQ,KAAK,CAAC,EAExE,SACE,QAAC,OAAI,UAAU,gBACb,oBAAC,OACC,aAAW,EAAAO,SACT,8FACF,EAEA,gCACE,qBAAC,OAAI,UAAU,mCACb,oBAAC,WACC,OACEN,EAAK,QAAQ,OAAS,cAAY,QAC9BA,EAAK,QAAQ,OAAO,CAAC,GAAG,IACxBI,GAAY,eAAeJ,EAAK,OAAO,IAAI,GAAG,KAAOA,EAAK,OAAO,OAAO,IAE9E,UAAU,qEACX,KAED,OAAC,OAAI,UAAU,8DACZ,SAAAA,EAAK,OAAO,UAAS,OAAC,oBAAiB,KAAMA,EAAM,KAAMD,EAAM,EAClE,GACF,KACA,QAAC,OAAI,UAAU,yBACZ,UAAAC,EAAK,OAAO,OAAS,cACpB,OAAC,OACC,aAAW,EAAAM,SACT,0FACF,EAEC,SAAAN,EAAK,OAAO,MACf,KAEF,QAAC,QACC,GAAG,IACH,aAAW,EAAAM,SAAW,kFAAkF,EAEvG,6BAAaN,EAAK,MAAM,cAAc,EAAE,IAAEI,GAAY,WACzD,GACF,KACA,QAAC,OAAI,UAAU,sEACb,oBAAC,OAAI,UAAU,sCAAuC,SAAAL,EAAK,YAAY,QAAQ,UAAU,KACzF,OAAC,OAAI,UAAU,4CACZ,SAAAA,EAAK,YAAY,QAAQ,OAAO,IAAI,CAACC,EAAMO,OAC1C,QAAC,YACC,qBAAC,OAAI,UAAU,8EACb,oBAAC,WAAQ,OAAQP,EAAK,SAAU,UAAU,6BAA6B,KACvE,OAAC,OAAI,UAAU,gFACZ,SAAAA,EAAK,MACR,GACF,EACCO,IAAUR,EAAK,YAAY,QAAQ,MAAM,OAAS,MACjD,OAAC,WACC,OAAO,qFACP,UAAU,kEACX,IAXUQ,CAaf,CACD,EACH,KACA,OAAC,OAAI,UAAU,gBACZ,SAAAF,GAAO,WACN,OAAC,MAAG,UAAU,mHACX,SAAAA,EAAM,IAAI,CAACG,EAAMD,OAChB,OAAC,MAAG,UAAU,YACZ,mBAAC,QAAK,GAAG,MAAM,KAAMC,EAAM,UAAU,YAAY,GADpBD,CAE/B,CACD,EACH,EAEJ,GACF,GACF,EACF,KACA,QAAC,OAAI,UAAU,+DACb,oBAAC,QACC,GAAG,IACH,UAAU,4EACV,KAAMR,EAAK,YAAY,aACxB,KACD,OAAC,UACC,QAASE,EACT,SAAUC,EACV,QAAQ,UACR,KAAK,KACL,UAAU,gCACV,QAAS,IAAM,CACbC,EAAU,SAAS,CACrB,EAEC,SAAAJ,EAAK,YAAY,cACpB,GACF,GACF,CAEJ",
6
+ "names": ["Init_exports", "__export", "Init", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_classnames", "import_react", "import_utils", "import_const", "import_NonProductValue", "import_provider", "copy", "item", "loading", "disabled", "setStatus", "pageCommon", "rules", "classNames", "index", "text"]
7
+ }
@@ -0,0 +1,6 @@
1
+ import { RedeemableItem } from '../../type';
2
+ import { CreditsRedeemListCopy } from '../type';
3
+ export declare const NoneProductValue: ({ item, copy }: {
4
+ item: RedeemableItem;
5
+ copy: CreditsRedeemListCopy;
6
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ "use strict";var p=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var r=Object.prototype.hasOwnProperty;var c=(e,o)=>{for(var t in o)p(e,t,{get:o[t],enumerable:!0})},g=(e,o,t,m)=>{if(o&&typeof o=="object"||typeof o=="function")for(let l of f(o))!r.call(e,l)&&l!==t&&p(e,l,{get:()=>o[l],enumerable:!(m=d(o,l))||m.enumerable});return e};var x=e=>g(p({},"__esModule",{value:!0}),e);var u={};c(u,{NoneProductValue:()=>C});module.exports=x(u);var n=require("react/jsx-runtime"),a=require("@anker-in/headless-ui"),i=require("../../context/const"),s=require("../../context/provider");const C=({item:e,copy:o})=>{const{pageCommon:t}=(0,s.useCreditsContext)();return e.config?.type===i.ConsumeType.ShippingCoupon?(0,n.jsx)(a.Text,{className:"text-[24px] w-[70%] font-bold leading-none",html:e.config?.value,as:"p"}):e.config?.value?(0,n.jsxs)("div",{className:"flex items-end gap-[4px]",children:[(0,n.jsx)(a.Text,{className:"text-[64px] font-extrabold leading-none",html:e.config.value.toString()}),(0,n.jsx)(a.Text,{className:"text-[24px] font-bold leading-[2]",html:e.config.type===i.ConsumeType.Coupon?t?.off:t?.giftCardLabel})]}):(0,n.jsx)(a.Text,{className:"text-[24px] w-[70%] font-bold leading-none",html:e.config?.title,as:"p"})};
2
+ //# sourceMappingURL=NonProductValue.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.tsx"],
4
+ "sourcesContent": ["import { Text } from '@anker-in/headless-ui'\nimport { RedeemableItem } from '../../type'\nimport { CreditsRedeemListCopy } from '../type'\nimport { ConsumeType } from '../../context/const'\nimport { useCreditsContext } from '../../context/provider'\n\nexport const NoneProductValue = ({ item, copy }: { item: RedeemableItem; copy: CreditsRedeemListCopy }) => {\n const { pageCommon } = useCreditsContext()\n // shipping coupon \u4EC5\u5C55\u793A\u6587\u6848\n if (item.config?.type === ConsumeType.ShippingCoupon) {\n return <Text className=\"text-[24px] w-[70%] font-bold leading-none\" html={item.config?.value} as=\"p\" />\n } else {\n return item.config?.value ? (\n <div className=\"flex items-end gap-[4px]\">\n <Text className=\"text-[64px] font-extrabold leading-none\" html={item.config.value.toString()} />\n <Text\n className=\"text-[24px] font-bold leading-[2]\"\n html={item.config.type === ConsumeType.Coupon ? pageCommon?.off : pageCommon?.giftCardLabel}\n />\n </div>\n ) : (\n <Text className=\"text-[24px] w-[70%] font-bold leading-none\" html={item.config?.title} as=\"p\" />\n )\n }\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,sBAAAE,IAAA,eAAAC,EAAAH,GAUW,IAAAI,EAAA,6BAVXC,EAAqB,iCAGrBC,EAA4B,+BAC5BC,EAAkC,kCAE3B,MAAML,EAAmB,CAAC,CAAE,KAAAM,EAAM,KAAAC,CAAK,IAA6D,CACzG,KAAM,CAAE,WAAAC,CAAW,KAAI,qBAAkB,EAEzC,OAAIF,EAAK,QAAQ,OAAS,cAAY,kBAC7B,OAAC,QAAK,UAAU,6CAA6C,KAAMA,EAAK,QAAQ,MAAO,GAAG,IAAI,EAE9FA,EAAK,QAAQ,SAClB,QAAC,OAAI,UAAU,2BACb,oBAAC,QAAK,UAAU,0CAA0C,KAAMA,EAAK,OAAO,MAAM,SAAS,EAAG,KAC9F,OAAC,QACC,UAAU,oCACV,KAAMA,EAAK,OAAO,OAAS,cAAY,OAASE,GAAY,IAAMA,GAAY,cAChF,GACF,KAEA,OAAC,QAAK,UAAU,6CAA6C,KAAMF,EAAK,QAAQ,MAAO,GAAG,IAAI,CAGpG",
6
+ "names": ["NonProductValue_exports", "__export", "NoneProductValue", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_const", "import_provider", "item", "copy", "pageCommon"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var i=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var n=Object.getOwnPropertyNames;var x=Object.prototype.hasOwnProperty;var u=(t,a)=>{for(var m in a)i(t,m,{get:a[m],enumerable:!0})},f=(t,a,m,l)=>{if(a&&typeof a=="object"||typeof a=="function")for(let d of n(a))!x.call(t,d)&&d!==m&&i(t,d,{get:()=>a[d],enumerable:!(l=c(a,d))||l.enumerable});return t};var v=t=>f(i({},"__esModule",{value:!0}),t);var N={};u(N,{ProductInfo:()=>b});module.exports=v(N);var e=require("react/jsx-runtime"),s=require("@anker-in/headless-ui"),r=require("../../context/utils"),o=require("@anker-in/lib"),p=require("../../context/provider");const b=({item:t,copy:a})=>{const{locale:m}=(0,o.useHeadlessContext)(),{pageCommon:l}=(0,p.useCreditsContext)();return(0,e.jsxs)("div",{className:"flex w-full items-center justify-center md:items-start md:justify-start",children:[(0,e.jsx)(s.Picture,{className:"mr-[16px] size-[100px] shrink-0 md:mr-[12px] md:hidden md:size-[44px] [&_img]:h-full [&_img]:w-auto [&_img]:object-contain",source:t.variant.image?.url||t.product?.images[0]?.url,alt:t.product.title}),(0,e.jsxs)("div",{className:"md:flex md:flex-col",children:[(0,e.jsxs)("div",{className:"md:flex md:items-center",children:[(0,e.jsx)(s.Picture,{className:"mr-[16px] size-[100px] shrink-0 md:mr-[12px] md:size-[44px] min-md:hidden [&_img]:h-full [&_img]:w-auto [&_img]:object-contain",source:t.variant.image?.url||t.product?.images[0]?.url,alt:t.product.title}),(0,e.jsx)("div",{className:"flex-1 text-[16px] font-bold leading-[1.4] min-l:!hidden",title:t.product.title,children:t.product.title})]}),(0,e.jsxs)("div",{className:"mt-[16px] md:mt-[12px]",children:[(0,e.jsx)(s.Text,{className:"mb-[12px] line-clamp-1 text-[16px] font-bold l:!hidden",html:t.product.title,title:t.product.title}),(0,e.jsxs)("div",{className:"flex font-semibold leading-[1.4] md:flex-col",children:[(0,e.jsxs)("div",{className:"mr-[40px] text-[15px] font-bold text-[#777] md:mr-0 md:text-[12px]",children:[(0,e.jsxs)("div",{className:"mb-[8px] flex items-center md:mb-[4px]",children:[(0,e.jsxs)("span",{children:[a.redeemModal.product.variantLabel,": "]}),(0,e.jsx)("span",{className:"ml-1",children:t.variant.title||""})]}),(0,e.jsxs)("div",{className:"mb-[8px] flex items-center md:mb-[4px]",children:[(0,e.jsxs)("span",{children:[a.redeemModal.product.shippingFeeLabel,": "]}),(0,e.jsx)("span",{className:"ml-1",children:(0,r.formatPrice)({amount:0,currencyCode:t.product.price?.currencyCode,locale:m||"us"})})]})]}),(0,e.jsxs)("div",{className:"text-[15px] font-bold text-[#777] md:text-[12px]",children:[(0,e.jsxs)("div",{className:"mb-[8px] flex items-center md:mb-[4px]",children:[(0,e.jsxs)("span",{children:[a.redeemModal.product.quantityLabel,": "]}),(0,e.jsx)("span",{className:"ml-1",children:"1"})]}),(0,e.jsxs)("div",{className:"l:flex l:items-center l:justify-between",children:[(0,e.jsxs)("span",{children:[a.redeemModal.product.totalPriceLabel,": "]}),(0,e.jsxs)("span",{className:"ml-1",children:[t.alpc?.consumeCredits," ",l?.pointUnit]})]})]})]})]})]})]})};
2
+ //# sourceMappingURL=ProductInfo.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.tsx"],
4
+ "sourcesContent": ["import { Picture, Text } from '@anker-in/headless-ui'\nimport { formatPrice } from '../../context/utils'\nimport type { RedeemableItem as RedeemableItemType } from '../../type'\nimport { CreditsRedeemListCopy } from '../type'\nimport { useHeadlessContext } from '@anker-in/lib'\nimport { useCreditsContext } from '../../context/provider'\n\ntype ProductInfoProps = {\n item: RedeemableItemType\n copy: CreditsRedeemListCopy\n}\n\nexport const ProductInfo = ({ item, copy }: ProductInfoProps) => {\n const { locale } = useHeadlessContext()\n const { pageCommon } = useCreditsContext()\n\n return (\n <div className=\"flex w-full items-center justify-center md:items-start md:justify-start\">\n <Picture\n className=\"mr-[16px] size-[100px] shrink-0 md:mr-[12px] md:hidden md:size-[44px] [&_img]:h-full [&_img]:w-auto [&_img]:object-contain\"\n source={item.variant.image?.url || item.product?.images[0]?.url}\n alt={item.product.title}\n ></Picture>\n <div className=\"md:flex md:flex-col\">\n <div className=\"md:flex md:items-center\">\n <Picture\n className=\"mr-[16px] size-[100px] shrink-0 md:mr-[12px] md:size-[44px] min-md:hidden [&_img]:h-full [&_img]:w-auto [&_img]:object-contain\"\n source={item.variant.image?.url || item.product?.images[0]?.url}\n alt={item.product.title}\n ></Picture>\n <div className=\"flex-1 text-[16px] font-bold leading-[1.4] min-l:!hidden\" title={item.product.title}>\n {item.product.title}\n </div>\n </div>\n\n <div className=\"mt-[16px] md:mt-[12px]\">\n <Text\n className=\"mb-[12px] line-clamp-1 text-[16px] font-bold l:!hidden\"\n html={item.product.title}\n title={item.product.title}\n ></Text>\n <div className=\"flex font-semibold leading-[1.4] md:flex-col\">\n <div className=\"mr-[40px] text-[15px] font-bold text-[#777] md:mr-0 md:text-[12px]\">\n <div className=\"mb-[8px] flex items-center md:mb-[4px]\">\n <span>{copy.redeemModal.product.variantLabel}: </span>\n <span className=\"ml-1\">{item.variant.title || ''}</span>\n </div>\n <div className=\"mb-[8px] flex items-center md:mb-[4px]\">\n <span>{copy.redeemModal.product.shippingFeeLabel}: </span>\n <span className=\"ml-1\">\n {formatPrice({\n amount: 0,\n currencyCode: item.product.price?.currencyCode!,\n locale: locale || 'us',\n })}\n </span>\n </div>\n </div>\n <div className=\"text-[15px] font-bold text-[#777] md:text-[12px]\">\n <div className=\"mb-[8px] flex items-center md:mb-[4px]\">\n <span>{copy.redeemModal.product.quantityLabel}: </span>\n <span className=\"ml-1\">1</span>\n </div>\n <div className=\"l:flex l:items-center l:justify-between\">\n <span>{copy.redeemModal.product.totalPriceLabel}: </span>\n <span className=\"ml-1\">\n {item.alpc?.consumeCredits} {pageCommon?.pointUnit}\n </span>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n )\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,iBAAAE,IAAA,eAAAC,EAAAH,GAkBM,IAAAI,EAAA,6BAlBNC,EAA8B,iCAC9BC,EAA4B,+BAG5BC,EAAmC,yBACnCC,EAAkC,kCAO3B,MAAMN,EAAc,CAAC,CAAE,KAAAO,EAAM,KAAAC,CAAK,IAAwB,CAC/D,KAAM,CAAE,OAAAC,CAAO,KAAI,sBAAmB,EAChC,CAAE,WAAAC,CAAW,KAAI,qBAAkB,EAEzC,SACE,QAAC,OAAI,UAAU,0EACb,oBAAC,WACC,UAAU,6HACV,OAAQH,EAAK,QAAQ,OAAO,KAAOA,EAAK,SAAS,OAAO,CAAC,GAAG,IAC5D,IAAKA,EAAK,QAAQ,MACnB,KACD,QAAC,OAAI,UAAU,sBACb,qBAAC,OAAI,UAAU,0BACb,oBAAC,WACC,UAAU,iIACV,OAAQA,EAAK,QAAQ,OAAO,KAAOA,EAAK,SAAS,OAAO,CAAC,GAAG,IAC5D,IAAKA,EAAK,QAAQ,MACnB,KACD,OAAC,OAAI,UAAU,2DAA2D,MAAOA,EAAK,QAAQ,MAC3F,SAAAA,EAAK,QAAQ,MAChB,GACF,KAEA,QAAC,OAAI,UAAU,yBACb,oBAAC,QACC,UAAU,yDACV,KAAMA,EAAK,QAAQ,MACnB,MAAOA,EAAK,QAAQ,MACrB,KACD,QAAC,OAAI,UAAU,+CACb,qBAAC,OAAI,UAAU,qEACb,qBAAC,OAAI,UAAU,yCACb,qBAAC,QAAM,UAAAC,EAAK,YAAY,QAAQ,aAAa,MAAE,KAC/C,OAAC,QAAK,UAAU,OAAQ,SAAAD,EAAK,QAAQ,OAAS,GAAG,GACnD,KACA,QAAC,OAAI,UAAU,yCACb,qBAAC,QAAM,UAAAC,EAAK,YAAY,QAAQ,iBAAiB,MAAE,KACnD,OAAC,QAAK,UAAU,OACb,2BAAY,CACX,OAAQ,EACR,aAAcD,EAAK,QAAQ,OAAO,aAClC,OAAQE,GAAU,IACpB,CAAC,EACH,GACF,GACF,KACA,QAAC,OAAI,UAAU,mDACb,qBAAC,OAAI,UAAU,yCACb,qBAAC,QAAM,UAAAD,EAAK,YAAY,QAAQ,cAAc,MAAE,KAChD,OAAC,QAAK,UAAU,OAAO,aAAC,GAC1B,KACA,QAAC,OAAI,UAAU,0CACb,qBAAC,QAAM,UAAAA,EAAK,YAAY,QAAQ,gBAAgB,MAAE,KAClD,QAAC,QAAK,UAAU,OACb,UAAAD,EAAK,MAAM,eAAe,IAAEG,GAAY,WAC3C,GACF,GACF,GACF,GACF,GACF,GACF,CAEJ",
6
+ "names": ["ProductInfo_exports", "__export", "ProductInfo", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_utils", "import_lib", "import_provider", "item", "copy", "locale", "pageCommon"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var g=Object.create;var p=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var C=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty;var T=(e,t)=>{for(var o in t)p(e,o,{get:t[o],enumerable:!0})},i=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let d of R(t))!w.call(e,d)&&d!==o&&p(e,d,{get:()=>t[d],enumerable:!(a=N(t,d))||a.enumerable});return e};var h=(e,t,o)=>(o=e!=null?g(C(e)):{},i(t||!e||!e.__esModule?p(o,"default",{value:e,enumerable:!0}):o,e)),B=e=>i(p({},"__esModule",{value:!0}),e);var I={};T(I,{Success:()=>D});module.exports=B(I);var m=require("react/jsx-runtime"),s=require("@anker-in/headless-ui"),r=h(require("classnames")),l=require("./ProductInfo"),n=require("@anker-in/lib"),x=require("../../../../constants");const D=({copy:e,shippingProduct:t,loading:o,address:a,disabled:d,onClose:c,item:u})=>{const{brand:f}=(0,n.useHeadlessContext)(),b=x.ROUNDED_BRANDS.includes(f);return(0,m.jsx)("div",{className:(0,r.default)("max-h-[500px] overflow-y-auto px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]"),children:(0,m.jsxs)("div",{className:"flex flex-col items-center",children:[(0,m.jsx)("div",{className:"mb-[16px] grid grid-flow-row gap-y-[4px] md:mb-[12px]",children:e.redeemModal.product.successDesc.map((y,v)=>(0,m.jsx)(s.Text,{className:"text-[18px] font-bold leading-[1.4] md:text-[14px]",html:y},v))}),t&&(0,m.jsx)(s.Text,{className:"mb-5 text-[16px] font-bold",html:t}),(0,m.jsx)("div",{className:(0,r.default)("flex w-full items-center bg-[#F5F5F7] p-[16px]",!b&&"rounded-none"),children:(0,m.jsx)(l.ProductInfo,{item:u,copy:e})}),(0,m.jsx)(s.Button,{loading:o||!a,variant:"primary",className:"mx-auto mt-[16px] w-[444px] md:mt-[12px] md:w-full",onClick:c,disabled:d,children:e.redeemModal.product.paymentButton})]})})};
2
+ //# sourceMappingURL=Success.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/components/credits/creditsRedeemList/RedeemProductModal/Success.tsx"],
4
+ "sourcesContent": ["import { Button, Text } from '@anker-in/headless-ui'\nimport classNames from 'classnames'\nimport type { RedeemableItem as RedeemableItemType } from '../../type'\nimport { CreditsRedeemListCopy } from '../type'\nimport { ProductInfo } from './ProductInfo'\nimport { useHeadlessContext } from '@anker-in/lib'\nimport { ROUNDED_BRANDS } from '../../../../constants'\n\ntype SuccessProps = {\n copy: CreditsRedeemListCopy\n shippingProduct: string\n loading: boolean\n address: Record<string, any> | undefined\n disabled: boolean\n onClose: () => void\n item: RedeemableItemType\n}\n\nexport const Success = ({ copy, shippingProduct, loading, address, disabled, onClose, item }: SuccessProps) => {\n const { brand } = useHeadlessContext()\n const rounded = ROUNDED_BRANDS.includes(brand)\n return (\n <div className={classNames('max-h-[500px] overflow-y-auto px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]')}>\n <div className=\"flex flex-col items-center\">\n <div className=\"mb-[16px] grid grid-flow-row gap-y-[4px] md:mb-[12px]\">\n {copy.redeemModal.product.successDesc.map((description: string, index: number) => (\n <Text key={index} className=\"text-[18px] font-bold leading-[1.4] md:text-[14px]\" html={description}></Text>\n ))}\n </div>\n\n {shippingProduct && <Text className=\"mb-5 text-[16px] font-bold\" html={shippingProduct}></Text>}\n\n <div className={classNames('flex w-full items-center bg-[#F5F5F7] p-[16px]', !rounded && 'rounded-none')}>\n <ProductInfo item={item} copy={copy} />\n </div>\n\n <Button\n loading={loading || !address}\n variant=\"primary\"\n className=\"mx-auto mt-[16px] w-[444px] md:mt-[12px] md:w-full\"\n onClick={onClose}\n disabled={disabled}\n >\n {copy.redeemModal.product.paymentButton}\n </Button>\n </div>\n </div>\n )\n}\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAuBM,IAAAI,EAAA,6BAvBNC,EAA6B,iCAC7BC,EAAuB,yBAGvBC,EAA4B,yBAC5BC,EAAmC,yBACnCC,EAA+B,iCAYxB,MAAMP,EAAU,CAAC,CAAE,KAAAQ,EAAM,gBAAAC,EAAiB,QAAAC,EAAS,QAAAC,EAAS,SAAAC,EAAU,QAAAC,EAAS,KAAAC,CAAK,IAAoB,CAC7G,KAAM,CAAE,MAAAC,CAAM,KAAI,sBAAmB,EAC/BC,EAAU,iBAAe,SAASD,CAAK,EAC7C,SACE,OAAC,OAAI,aAAW,EAAAE,SAAW,iFAAiF,EAC1G,oBAAC,OAAI,UAAU,6BACb,oBAAC,OAAI,UAAU,wDACZ,SAAAT,EAAK,YAAY,QAAQ,YAAY,IAAI,CAACU,EAAqBC,OAC9D,OAAC,QAAiB,UAAU,qDAAqD,KAAMD,GAA5EC,CAAyF,CACrG,EACH,EAECV,MAAmB,OAAC,QAAK,UAAU,6BAA6B,KAAMA,EAAiB,KAExF,OAAC,OAAI,aAAW,EAAAQ,SAAW,iDAAkD,CAACD,GAAW,cAAc,EACrG,mBAAC,eAAY,KAAMF,EAAM,KAAMN,EAAM,EACvC,KAEA,OAAC,UACC,QAASE,GAAW,CAACC,EACrB,QAAQ,UACR,UAAU,qDACV,QAASE,EACT,SAAUD,EAET,SAAAJ,EAAK,YAAY,QAAQ,cAC5B,GACF,EACF,CAEJ",
6
+ "names": ["Success_exports", "__export", "Success", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_classnames", "import_ProductInfo", "import_lib", "import_constants", "copy", "shippingProduct", "loading", "address", "disabled", "onClose", "item", "brand", "rounded", "classNames", "description", "index"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var W=Object.create;var g=Object.defineProperty;var X=Object.getOwnPropertyDescriptor;var Y=Object.getOwnPropertyNames;var Z=Object.getPrototypeOf,$=Object.prototype.hasOwnProperty;var j=(r,e)=>{for(var t in e)g(r,t,{get:e[t],enumerable:!0})},y=(r,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Y(e))!$.call(r,i)&&i!==t&&g(r,i,{get:()=>e[i],enumerable:!(a=X(e,i))||a.enumerable});return r};var L=(r,e,t)=>(t=r!=null?W(Z(r)):{},y(e||!r||!r.__esModule?g(t,"default",{value:r,enumerable:!0}):t,r)),D=r=>y(g({},"__esModule",{value:!0}),r);var oe={};j(oe,{default:()=>re});module.exports=D(oe);var n=require("react/jsx-runtime"),v=L(require("classnames")),s=require("react"),b=require("../../context/provider"),S=L(require("../../context/hooks/useCountries")),f=require("../../context/const"),x=require("../../context/hooks/useAddressValidate"),U=require("../../context/hooks/useRedeemProduct"),O=require("../../modal/modalContainer"),q=require("@anker-in/lib"),w=require("./Error"),F=require("./Success"),K=require("./Address"),_=require("./Init");function ee({item:r,copy:e,onError:t,...a}){const{fetchCreditInfo:i,profile:P}=(0,b.useCreditsContext)(),{storeDomain:k,locale:T}=(0,q.useHeadlessContext)(),{pageCommon:B}=(0,b.useCreditsContext)(),{shippingAddress:G,shippingProduct:R}=e.redeemModal.product,[m,c]=(0,s.useState)("init"),[l,H]=(0,s.useState)(),[J,p]=(0,s.useState)({code:0,message:"",imageUrl:""}),[C,u]=(0,s.useState)(!1),{countries:A=[],isLoading:de}=(0,S.default)({shopifyStoreDomain:k}),{isMutating:M,trigger:N}=(0,U.useRedeemProduct)({onSuccess(o){if(!o){c("error"),p({code:0,imageUrl:e.redeemModal.errorImageUrl||"",message:e.redeemModal.commonError||""});return}if(o?.code===0)i(P?.user_id),c("success");else{let d,I;o.code===f.AlpcErrorCode.CodeLpcShopifyCouponRuleRedeemLimit?(d=e.redeemModal.redeemLimitError,u(!0)):o.code===f.AlpcErrorCode.CodeLpcRuleInventoryNotEnough?(d=e.redeemModal.inventoryNotEnough,u(!0),I=e.redeemModal.inventoryNotEnough):o.code===f.AlpcErrorCode.CodeLpcNotEnoughCredits?(d=e.redeemModal.creditsNotEnough,u(!0),i(P?.user_id)):o.code===f.AlpcErrorCode.CodeCrossSiteError&&(d=e.redeemModal.crossSiteError,u(!0)),c("error"),p({code:o.code,imageUrl:I||e.redeemModal.errorImageUrl||"",message:d||e.redeemModal.commonError||""}),t&&t(o.code)}},onError(o){c("error"),p({code:0,imageUrl:e.redeemModal.errorImageUrl||"",message:e.redeemModal.commonError||""})}}),h=(0,s.useMemo)(()=>e?.redeemModal.product.form?.flat().find(d=>d.type==="state")?.key,[e?.redeemModal.product.form]),{validate:E,errors:V}=(0,x.useAddressValidate)({address:l,validatorInfo:B?.validatorInfo,formData:e?.redeemModal.product.form?.flat()||[],errorLabel:{require:e.redeemModal.product.required,email:e.redeemModal.product.invalidEmail}}),z=(0,s.useCallback)(async()=>{const o=[];if(h&&((A.find(Q=>Q.code===l.country)?.provinces||[]).length||o.push(h)),E({force:!0,ignoreKeys:o}))return;let d={...l};d.name&&delete d.name,d.country==="UK"&&(d.country="GB"),N({address:btoa(JSON.stringify(d)),rule_id:Number(r.alpc?.id)})},[r,N,h,E,l,A]);return(0,s.useEffect)(()=>{a.isOpen||(u(!1),p({code:0,message:"",imageUrl:""}))},[a.isOpen,T]),(0,n.jsxs)(O.CreditsModalContainer,{...a,className:(0,v.default)("w-[540px] md:h-auto min-md:max-h-[calc(100vh-40px)]",m!=="init"&&"w-[740px] md:w-full"),scrollClassName:"mb-0 min-l:px-0 md:mb-0 px-0",titleClassName:(0,v.default)("h-[56px]",m==="init"&&"bg-[#F5F5F7]"),title:m==="address"?"Order Confirmation":"",children:[m==="error"&&(0,n.jsx)(w.Error,{errorInfo:J}),m==="success"&&(0,n.jsx)(F.Success,{copy:e,shippingProduct:R,loading:M,address:l,disabled:C,onClose:a.onClose,item:r}),m==="address"&&(0,n.jsx)(K.Address,{copy:e,shippingAddress:G,setAddress:H,validateAddress:E,validateErrors:V,shippingProduct:R,loading:M,address:l,disabled:C,handlePayment:z,item:r}),m==="init"&&(0,n.jsx)(_.Init,{item:r,copy:e,loading:M,disabled:C,setStatus:c})]})}var re=ee;
2
+ //# sourceMappingURL=index.js.map