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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (915) hide show
  1. package/dist/cjs/components/chat/{chat-context.js → chatContext.js} +1 -1
  2. package/dist/cjs/components/chat/{chat-context.js.map → chatContext.js.map} +2 -2
  3. package/dist/cjs/components/chat/index.js +1 -1
  4. package/dist/cjs/components/chat/index.js.map +3 -3
  5. package/dist/cjs/components/credits/context/const.d.ts +2 -1
  6. package/dist/cjs/components/credits/context/const.js +1 -1
  7. package/dist/cjs/components/credits/context/const.js.map +2 -2
  8. package/dist/cjs/components/credits/context/hooks/useActivities.js +1 -1
  9. package/dist/cjs/components/credits/context/hooks/useActivities.js.map +3 -3
  10. package/dist/cjs/components/credits/context/hooks/useAddressValidate.js +1 -1
  11. package/dist/cjs/components/credits/context/hooks/useAddressValidate.js.map +3 -3
  12. package/dist/cjs/components/credits/context/hooks/useAlpcFetch.js +1 -1
  13. package/dist/cjs/components/credits/context/hooks/useAlpcFetch.js.map +3 -3
  14. package/dist/cjs/components/credits/context/hooks/useCountries.js +1 -1
  15. package/dist/cjs/components/credits/context/hooks/useCountries.js.map +3 -3
  16. package/dist/cjs/components/credits/context/hooks/useFunctionMemberPrice.d.ts +7 -0
  17. package/dist/cjs/components/credits/context/hooks/useFunctionMemberPrice.js +2 -0
  18. package/dist/cjs/components/credits/context/hooks/useFunctionMemberPrice.js.map +7 -0
  19. package/dist/cjs/components/credits/context/hooks/useMyRewards.js +1 -1
  20. package/dist/cjs/components/credits/context/hooks/useMyRewards.js.map +3 -3
  21. package/dist/cjs/components/credits/context/hooks/useRedeemAndBuy.d.ts +5 -10
  22. package/dist/cjs/components/credits/context/hooks/useRedeemAndBuy.js +1 -1
  23. package/dist/cjs/components/credits/context/hooks/useRedeemAndBuy.js.map +3 -3
  24. package/dist/cjs/components/credits/context/hooks/useRedeemCoupon.d.ts +2 -1
  25. package/dist/cjs/components/credits/context/hooks/useRedeemCoupon.js +1 -1
  26. package/dist/cjs/components/credits/context/hooks/useRedeemCoupon.js.map +3 -3
  27. package/dist/cjs/components/credits/context/hooks/useRedeemProduct.js +1 -1
  28. package/dist/cjs/components/credits/context/hooks/useRedeemProduct.js.map +3 -3
  29. package/dist/cjs/components/credits/context/hooks/useRedeemableList.js +1 -1
  30. package/dist/cjs/components/credits/context/hooks/useRedeemableList.js.map +3 -3
  31. package/dist/cjs/components/credits/context/hooks/useSubscribed.js +1 -1
  32. package/dist/cjs/components/credits/context/hooks/useSubscribed.js.map +3 -3
  33. package/dist/cjs/components/credits/context/hooks/useUploadReceipt.js +1 -1
  34. package/dist/cjs/components/credits/context/hooks/useUploadReceipt.js.map +2 -2
  35. package/dist/cjs/components/credits/context/memberPriceConst.d.ts +10 -0
  36. package/dist/cjs/components/credits/context/memberPriceConst.js +2 -0
  37. package/dist/cjs/components/credits/context/memberPriceConst.js.map +7 -0
  38. package/dist/cjs/components/credits/context/memberPriceTypes.d.ts +46 -0
  39. package/dist/cjs/components/credits/context/memberPriceTypes.js +2 -0
  40. package/dist/cjs/components/credits/context/memberPriceTypes.js.map +7 -0
  41. package/dist/cjs/components/credits/context/provider.d.ts +11 -33
  42. package/dist/cjs/components/credits/context/provider.js +1 -1
  43. package/dist/cjs/components/credits/context/provider.js.map +3 -3
  44. package/dist/cjs/components/credits/context/utils/atobID.d.ts +1 -0
  45. package/dist/cjs/components/credits/context/utils/atobID.js +2 -0
  46. package/dist/cjs/components/credits/context/utils/atobID.js.map +7 -0
  47. package/dist/cjs/components/credits/context/utils/functionDiscountCalculate.d.ts +5 -0
  48. package/dist/cjs/components/credits/context/utils/functionDiscountCalculate.js +2 -0
  49. package/dist/cjs/components/credits/context/utils/functionDiscountCalculate.js.map +7 -0
  50. package/dist/cjs/components/credits/context/utils/getFunctionMemberPrice.d.ts +8 -0
  51. package/dist/cjs/components/credits/context/utils/getFunctionMemberPrice.js +2 -0
  52. package/dist/cjs/components/credits/context/utils/getFunctionMemberPrice.js.map +7 -0
  53. package/dist/cjs/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.d.ts +9 -0
  54. package/dist/cjs/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.js +2 -0
  55. package/dist/cjs/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.js.map +7 -0
  56. package/dist/cjs/components/credits/context/utils/variantGetCoupon.d.ts +6 -0
  57. package/dist/cjs/components/credits/context/utils/variantGetCoupon.js +2 -0
  58. package/dist/cjs/components/credits/context/utils/variantGetCoupon.js.map +7 -0
  59. package/dist/cjs/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.d.ts +4 -0
  60. package/dist/cjs/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.js +2 -0
  61. package/dist/cjs/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.js.map +7 -0
  62. package/dist/cjs/components/credits/creditsAnkersolixTask/index.d.ts +2 -0
  63. package/dist/cjs/components/credits/creditsAnkersolixTask/index.js +2 -0
  64. package/dist/cjs/components/credits/creditsAnkersolixTask/index.js.map +7 -0
  65. package/dist/cjs/components/credits/creditsAnkersolixTask/type.d.ts +1 -0
  66. package/dist/cjs/components/credits/creditsAnkersolixTask/type.js +2 -0
  67. package/dist/cjs/components/credits/creditsAnkersolixTask/type.js.map +7 -0
  68. package/dist/cjs/components/credits/creditsBanner/index.d.ts +17 -16
  69. package/dist/cjs/components/credits/creditsBanner/index.js +2 -0
  70. package/dist/cjs/components/credits/creditsBanner/index.js.map +7 -0
  71. package/dist/{esm/components/credits/credits-benefits/benefitItem.d.ts → cjs/components/credits/creditsBenefits/BenefitItem.d.ts} +4 -1
  72. package/dist/cjs/components/credits/creditsBenefits/BenefitItem.js +2 -0
  73. package/dist/cjs/components/credits/creditsBenefits/BenefitItem.js.map +7 -0
  74. package/dist/cjs/components/credits/{credits-benefits/iconInfo.js → creditsBenefits/IconInfo.js} +1 -1
  75. package/dist/cjs/components/credits/{credits-benefits/iconInfo.js.map → creditsBenefits/IconInfo.js.map} +2 -2
  76. package/dist/cjs/components/credits/creditsBenefits/index.d.ts +12 -9
  77. package/dist/cjs/components/credits/creditsBenefits/index.js +4 -0
  78. package/dist/cjs/components/credits/creditsBenefits/index.js.map +7 -0
  79. package/dist/cjs/components/credits/creditsCash/CreditsCash.d.ts +5 -0
  80. package/dist/cjs/components/credits/creditsCash/CreditsCash.js +2 -0
  81. package/dist/cjs/components/credits/creditsCash/CreditsCash.js.map +7 -0
  82. package/dist/cjs/components/credits/creditsCash/RedeemableItem.d.ts +1 -7
  83. package/dist/cjs/components/credits/creditsCash/RedeemableItem.js +2 -0
  84. package/dist/cjs/components/credits/creditsCash/RedeemableItem.js.map +7 -0
  85. package/dist/cjs/components/credits/creditsCash/index.d.ts +2 -13
  86. package/dist/cjs/components/credits/creditsCash/index.js +2 -0
  87. package/dist/cjs/components/credits/creditsCash/index.js.map +7 -0
  88. package/dist/cjs/components/credits/creditsCash/type.d.ts +2 -4
  89. package/dist/cjs/components/credits/creditsCash/type.js +2 -0
  90. package/dist/cjs/components/credits/creditsCash/type.js.map +7 -0
  91. package/dist/cjs/components/credits/creditsFaq/faqItem/FaqItem.js +2 -0
  92. package/dist/cjs/components/credits/creditsFaq/faqItem/FaqItem.js.map +7 -0
  93. package/dist/cjs/components/credits/creditsFaq/index.d.ts +4 -3
  94. package/dist/cjs/components/credits/creditsFaq/index.js +2 -0
  95. package/dist/cjs/components/credits/creditsFaq/index.js.map +7 -0
  96. package/dist/cjs/components/credits/creditsInfoCard/index.d.ts +10 -15
  97. package/dist/cjs/components/credits/creditsInfoCard/index.js +2 -0
  98. package/dist/cjs/components/credits/creditsInfoCard/index.js.map +7 -0
  99. package/dist/cjs/components/credits/creditsMemberPrice/CreditsMemberPrice.d.ts +5 -0
  100. package/dist/cjs/components/credits/creditsMemberPrice/CreditsMemberPrice.js +2 -0
  101. package/dist/cjs/components/credits/creditsMemberPrice/CreditsMemberPrice.js.map +7 -0
  102. package/dist/cjs/components/credits/creditsMemberPrice/MemberPriceItem.d.ts +7 -0
  103. package/dist/cjs/components/credits/creditsMemberPrice/MemberPriceItem.js +2 -0
  104. package/dist/cjs/components/credits/creditsMemberPrice/MemberPriceItem.js.map +7 -0
  105. package/dist/cjs/components/credits/creditsMemberPrice/index.d.ts +2 -0
  106. package/dist/cjs/components/credits/creditsMemberPrice/index.js +2 -0
  107. package/dist/cjs/components/credits/creditsMemberPrice/index.js.map +7 -0
  108. package/dist/cjs/components/credits/creditsMemberPrice/type.d.ts +64 -0
  109. package/dist/cjs/components/credits/creditsMemberPrice/type.js +2 -0
  110. package/dist/cjs/components/credits/creditsMemberPrice/type.js.map +7 -0
  111. package/dist/cjs/components/credits/creditsNavigation/CreditsNavigation.d.ts +4 -0
  112. package/dist/cjs/components/credits/creditsNavigation/CreditsNavigation.js +2 -0
  113. package/dist/cjs/components/credits/creditsNavigation/CreditsNavigation.js.map +7 -0
  114. package/dist/cjs/components/credits/creditsNavigation/index.d.ts +2 -0
  115. package/dist/cjs/components/credits/creditsNavigation/index.js +2 -0
  116. package/dist/cjs/components/credits/creditsNavigation/index.js.map +7 -0
  117. package/dist/cjs/components/credits/creditsNavigation/type.d.ts +7 -0
  118. package/dist/cjs/components/credits/creditsNavigation/type.js +2 -0
  119. package/dist/cjs/components/credits/creditsNavigation/type.js.map +7 -0
  120. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/CountrySelect.js +2 -0
  121. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/CountrySelect.js.map +7 -0
  122. package/dist/cjs/components/credits/{credits-redeem-list/address-form/form-item.js → creditsRedeemList/AddressForm/FormItem.js} +1 -1
  123. package/dist/cjs/components/credits/{credits-redeem-list/address-form/form-item.js.map → creditsRedeemList/AddressForm/FormItem.js.map} +2 -2
  124. package/dist/cjs/components/credits/{credits-redeem-list/address-form → creditsRedeemList/AddressForm}/Input.js.map +1 -1
  125. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/StateSelect.js +2 -0
  126. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/StateSelect.js.map +7 -0
  127. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/index.js +2 -0
  128. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/index.js.map +7 -0
  129. package/dist/cjs/components/credits/{credits-redeem-list/address-form → creditsRedeemList/AddressForm}/type.js.map +1 -1
  130. package/dist/cjs/components/credits/creditsRedeemList/CreditsRedeemList.d.ts +5 -0
  131. package/dist/cjs/components/credits/creditsRedeemList/CreditsRedeemList.js +2 -0
  132. package/dist/cjs/components/credits/creditsRedeemList/CreditsRedeemList.js.map +7 -0
  133. package/dist/cjs/components/credits/creditsRedeemList/NonProductValue.d.ts +4 -0
  134. package/dist/cjs/components/credits/creditsRedeemList/NonProductValue.js +2 -0
  135. package/dist/cjs/components/credits/creditsRedeemList/NonProductValue.js.map +7 -0
  136. package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.js +2 -0
  137. package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.js.map +7 -0
  138. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.js +2 -0
  139. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.js.map +7 -0
  140. package/dist/cjs/components/credits/{credits-redeem-list/redeem-product-modal → creditsRedeemList/RedeemProductModal}/Error.js +1 -1
  141. package/dist/cjs/components/credits/{credits-redeem-list/redeem-product-modal → creditsRedeemList/RedeemProductModal}/Error.js.map +3 -3
  142. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Init.js +2 -0
  143. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Init.js.map +7 -0
  144. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.d.ts +6 -0
  145. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js +2 -0
  146. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js.map +7 -0
  147. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js +2 -0
  148. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js.map +7 -0
  149. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.js +2 -0
  150. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.js.map +7 -0
  151. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.js +2 -0
  152. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.js.map +7 -0
  153. package/dist/cjs/components/credits/creditsRedeemList/RedeemableItem.js +2 -0
  154. package/dist/cjs/components/credits/creditsRedeemList/RedeemableItem.js.map +7 -0
  155. package/dist/cjs/components/credits/creditsRedeemList/index.d.ts +2 -13
  156. package/dist/cjs/components/credits/creditsRedeemList/index.js +2 -0
  157. package/dist/cjs/components/credits/creditsRedeemList/index.js.map +7 -0
  158. package/dist/cjs/components/credits/creditsRedeemList/type.d.ts +2 -15
  159. package/dist/cjs/components/credits/creditsRedeemList/type.js.map +7 -0
  160. package/dist/cjs/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.d.ts +4 -0
  161. package/dist/cjs/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js +2 -0
  162. package/dist/cjs/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js.map +7 -0
  163. package/dist/cjs/components/credits/creditsWaysToGetCredits/index.d.ts +2 -2
  164. package/dist/cjs/components/credits/creditsWaysToGetCredits/index.js +2 -0
  165. package/dist/cjs/components/credits/creditsWaysToGetCredits/index.js.map +7 -0
  166. package/dist/cjs/components/credits/creditsWaysToGetCredits/type.d.ts +5 -16
  167. package/dist/cjs/components/credits/creditsWaysToGetCredits/type.js +2 -0
  168. package/dist/cjs/components/credits/creditsWaysToGetCredits/type.js.map +7 -0
  169. package/dist/cjs/components/credits/creditsWaysToGetCredits/useActions.d.ts +11 -2
  170. package/dist/cjs/components/credits/creditsWaysToGetCredits/useActions.js +2 -0
  171. package/dist/cjs/components/credits/creditsWaysToGetCredits/useActions.js.map +7 -0
  172. package/dist/cjs/components/credits/modal/MyRewardsModal.d.ts +4 -1
  173. package/dist/cjs/components/credits/modal/MyRewardsModal.js +1 -1
  174. package/dist/cjs/components/credits/modal/MyRewardsModal.js.map +3 -3
  175. package/dist/cjs/components/credits/modal/activitiesModal.d.ts +4 -1
  176. package/dist/cjs/components/credits/modal/activitiesModal.js +1 -1
  177. package/dist/cjs/components/credits/modal/activitiesModal.js.map +3 -3
  178. package/dist/cjs/components/credits/modal/creditsUploadReceiptModal.js +1 -1
  179. package/dist/cjs/components/credits/modal/creditsUploadReceiptModal.js.map +3 -3
  180. package/dist/cjs/components/credits/modal/loadingDots.d.ts +2 -1
  181. package/dist/cjs/components/credits/modal/loadingDots.js +1 -1
  182. package/dist/cjs/components/credits/modal/loadingDots.js.map +3 -3
  183. package/dist/cjs/components/credits/modal/modalContainer.js +1 -1
  184. package/dist/cjs/components/credits/modal/modalContainer.js.map +3 -3
  185. package/dist/cjs/components/credits/modal/rulesModal.js +1 -1
  186. package/dist/cjs/components/credits/modal/rulesModal.js.map +3 -3
  187. package/dist/cjs/components/credits/modal/subscribeModal.d.ts +15 -0
  188. package/dist/cjs/components/credits/modal/subscribeModal.js +2 -0
  189. package/dist/cjs/components/credits/modal/subscribeModal.js.map +7 -0
  190. package/dist/cjs/components/credits/modal/tip.js +1 -1
  191. package/dist/cjs/components/credits/modal/tip.js.map +3 -3
  192. package/dist/cjs/components/credits/type.d.ts +24 -5
  193. package/dist/cjs/components/credits/type.js +1 -1
  194. package/dist/cjs/components/credits/type.js.map +1 -1
  195. package/dist/cjs/components/index.d.ts +1 -0
  196. package/dist/cjs/components/index.js +1 -1
  197. package/dist/cjs/components/index.js.map +2 -2
  198. package/dist/cjs/components/registration/authCodeActivate/Message.d.ts +4 -0
  199. package/dist/cjs/components/registration/authCodeActivate/Message.js +2 -0
  200. package/dist/cjs/components/registration/authCodeActivate/Message.js.map +7 -0
  201. package/dist/cjs/components/registration/authCodeActivate/index.d.ts +3 -0
  202. package/dist/cjs/components/registration/authCodeActivate/index.js +2 -0
  203. package/dist/cjs/components/registration/authCodeActivate/index.js.map +7 -0
  204. package/dist/cjs/components/registration/authCodeActivate/type.d.ts +22 -0
  205. package/dist/cjs/components/registration/authCodeActivate/type.js +2 -0
  206. package/dist/cjs/components/registration/authCodeActivate/type.js.map +7 -0
  207. package/dist/cjs/components/registration/context/index.d.ts +1 -0
  208. package/dist/cjs/components/registration/context/index.js +2 -0
  209. package/dist/cjs/components/registration/context/index.js.map +7 -0
  210. package/dist/cjs/components/registration/context/provider.d.ts +27 -0
  211. package/dist/cjs/components/registration/context/provider.js +2 -0
  212. package/dist/cjs/components/registration/context/provider.js.map +7 -0
  213. package/dist/cjs/components/registration/index.d.ts +2 -0
  214. package/dist/cjs/components/registration/index.js +2 -0
  215. package/dist/cjs/components/registration/index.js.map +7 -0
  216. package/dist/cjs/components/registration/modalContainer.d.ts +14 -0
  217. package/dist/cjs/components/registration/modalContainer.js +2 -0
  218. package/dist/cjs/components/registration/modalContainer.js.map +7 -0
  219. package/dist/cjs/debug-env.js +2 -0
  220. package/dist/cjs/debug-env.js.map +7 -0
  221. package/dist/cjs/index.d.ts +2 -2
  222. package/dist/cjs/index.js +1 -726
  223. package/dist/cjs/index.js.map +4 -4
  224. package/dist/cjs/stories/chat.stories.js +2 -0
  225. package/dist/cjs/stories/chat.stories.js.map +7 -0
  226. package/dist/cjs/templates/Credits.d.ts +73 -0
  227. package/dist/cjs/templates/Credits.js +2 -0
  228. package/dist/cjs/templates/Credits.js.map +7 -0
  229. package/dist/cjs/templates/index.d.ts +1 -0
  230. package/dist/cjs/templates/index.js +2 -0
  231. package/dist/cjs/templates/index.js.map +7 -0
  232. package/dist/esm/components/chat/index.js +1 -1
  233. package/dist/esm/components/chat/index.js.map +2 -2
  234. package/dist/esm/components/credits/context/const.d.ts +2 -1
  235. package/dist/esm/components/credits/context/const.js +1 -1
  236. package/dist/esm/components/credits/context/const.js.map +2 -2
  237. package/dist/esm/components/credits/context/hooks/useActivities.js +1 -1
  238. package/dist/esm/components/credits/context/hooks/useActivities.js.map +3 -3
  239. package/dist/esm/components/credits/context/hooks/useAddressValidate.js +1 -1
  240. package/dist/esm/components/credits/context/hooks/useAddressValidate.js.map +3 -3
  241. package/dist/esm/components/credits/context/hooks/useAlpcFetch.js +1 -1
  242. package/dist/esm/components/credits/context/hooks/useAlpcFetch.js.map +3 -3
  243. package/dist/esm/components/credits/context/hooks/useCountries.js +1 -1
  244. package/dist/esm/components/credits/context/hooks/useCountries.js.map +3 -3
  245. package/dist/esm/components/credits/context/hooks/useFunctionMemberPrice.d.ts +7 -0
  246. package/dist/esm/components/credits/context/hooks/useFunctionMemberPrice.js +2 -0
  247. package/dist/esm/components/credits/context/hooks/useFunctionMemberPrice.js.map +7 -0
  248. package/dist/esm/components/credits/context/hooks/useMyRewards.js +1 -1
  249. package/dist/esm/components/credits/context/hooks/useMyRewards.js.map +3 -3
  250. package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.d.ts +5 -10
  251. package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.js +1 -1
  252. package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.js.map +3 -3
  253. package/dist/esm/components/credits/context/hooks/useRedeemCoupon.d.ts +2 -1
  254. package/dist/esm/components/credits/context/hooks/useRedeemCoupon.js +1 -1
  255. package/dist/esm/components/credits/context/hooks/useRedeemCoupon.js.map +3 -3
  256. package/dist/esm/components/credits/context/hooks/useRedeemProduct.js +1 -1
  257. package/dist/esm/components/credits/context/hooks/useRedeemProduct.js.map +3 -3
  258. package/dist/esm/components/credits/context/hooks/useRedeemableList.js +1 -1
  259. package/dist/esm/components/credits/context/hooks/useRedeemableList.js.map +3 -3
  260. package/dist/esm/components/credits/context/hooks/useSubscribed.js +1 -1
  261. package/dist/esm/components/credits/context/hooks/useSubscribed.js.map +3 -3
  262. package/dist/esm/components/credits/context/hooks/useUploadReceipt.js +1 -1
  263. package/dist/esm/components/credits/context/hooks/useUploadReceipt.js.map +2 -2
  264. package/dist/esm/components/credits/context/memberPriceConst.d.ts +10 -0
  265. package/dist/esm/components/credits/context/memberPriceConst.js +2 -0
  266. package/dist/esm/components/credits/context/memberPriceConst.js.map +7 -0
  267. package/dist/esm/components/credits/context/memberPriceTypes.d.ts +46 -0
  268. package/dist/esm/components/credits/context/memberPriceTypes.js +1 -0
  269. package/dist/esm/components/credits/context/provider.d.ts +11 -33
  270. package/dist/esm/components/credits/context/provider.js +1 -1
  271. package/dist/esm/components/credits/context/provider.js.map +3 -3
  272. package/dist/esm/components/credits/context/utils/atobID.d.ts +1 -0
  273. package/dist/esm/components/credits/context/utils/atobID.js +2 -0
  274. package/dist/esm/components/credits/context/utils/atobID.js.map +7 -0
  275. package/dist/esm/components/credits/context/utils/functionDiscountCalculate.d.ts +5 -0
  276. package/dist/esm/components/credits/context/utils/functionDiscountCalculate.js +2 -0
  277. package/dist/esm/components/credits/context/utils/functionDiscountCalculate.js.map +7 -0
  278. package/dist/esm/components/credits/context/utils/getFunctionMemberPrice.d.ts +8 -0
  279. package/dist/esm/components/credits/context/utils/getFunctionMemberPrice.js +2 -0
  280. package/dist/esm/components/credits/context/utils/getFunctionMemberPrice.js.map +7 -0
  281. package/dist/esm/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.d.ts +9 -0
  282. package/dist/esm/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.js +2 -0
  283. package/dist/esm/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.js.map +7 -0
  284. package/dist/esm/components/credits/context/utils/variantGetCoupon.d.ts +6 -0
  285. package/dist/esm/components/credits/context/utils/variantGetCoupon.js +2 -0
  286. package/dist/esm/components/credits/context/utils/variantGetCoupon.js.map +7 -0
  287. package/dist/esm/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.d.ts +4 -0
  288. package/dist/esm/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.js +2 -0
  289. package/dist/esm/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.js.map +7 -0
  290. package/dist/esm/components/credits/creditsAnkersolixTask/index.d.ts +2 -0
  291. package/dist/esm/components/credits/creditsAnkersolixTask/index.js +2 -0
  292. package/dist/esm/components/credits/creditsAnkersolixTask/index.js.map +7 -0
  293. package/dist/esm/components/credits/creditsAnkersolixTask/type.d.ts +1 -0
  294. package/dist/esm/components/credits/creditsAnkersolixTask/type.js +2 -0
  295. package/dist/esm/components/credits/creditsAnkersolixTask/type.js.map +7 -0
  296. package/dist/esm/components/credits/creditsBanner/index.d.ts +17 -16
  297. package/dist/esm/components/credits/creditsBanner/index.js +1 -1
  298. package/dist/esm/components/credits/creditsBanner/index.js.map +3 -3
  299. package/dist/{cjs/components/credits/credits-benefits/benefitItem.d.ts → esm/components/credits/creditsBenefits/BenefitItem.d.ts} +4 -1
  300. package/dist/esm/components/credits/creditsBenefits/BenefitItem.js +2 -0
  301. package/dist/esm/components/credits/creditsBenefits/BenefitItem.js.map +7 -0
  302. package/dist/esm/components/credits/{credits-benefits/iconInfo.js → creditsBenefits/IconInfo.js} +1 -1
  303. package/dist/esm/components/credits/creditsBenefits/{iconInfo.js.map → IconInfo.js.map} +2 -2
  304. package/dist/esm/components/credits/creditsBenefits/index.d.ts +12 -9
  305. package/dist/esm/components/credits/creditsBenefits/index.js +3 -3
  306. package/dist/esm/components/credits/creditsBenefits/index.js.map +3 -3
  307. package/dist/esm/components/credits/creditsCash/CreditsCash.d.ts +5 -0
  308. package/dist/esm/components/credits/creditsCash/CreditsCash.js +2 -0
  309. package/dist/esm/components/credits/creditsCash/CreditsCash.js.map +7 -0
  310. package/dist/esm/components/credits/creditsCash/RedeemableItem.d.ts +1 -7
  311. package/dist/esm/components/credits/creditsCash/RedeemableItem.js +1 -1
  312. package/dist/esm/components/credits/creditsCash/RedeemableItem.js.map +3 -3
  313. package/dist/esm/components/credits/creditsCash/index.d.ts +2 -13
  314. package/dist/esm/components/credits/creditsCash/index.js +1 -1
  315. package/dist/esm/components/credits/creditsCash/index.js.map +4 -4
  316. package/dist/esm/components/credits/creditsCash/type.d.ts +2 -4
  317. package/dist/esm/components/credits/creditsFaq/faqItem/FaqItem.js +1 -1
  318. package/dist/esm/components/credits/creditsFaq/faqItem/FaqItem.js.map +2 -2
  319. package/dist/esm/components/credits/creditsFaq/index.d.ts +4 -3
  320. package/dist/esm/components/credits/creditsFaq/index.js +1 -1
  321. package/dist/esm/components/credits/creditsFaq/index.js.map +3 -3
  322. package/dist/esm/components/credits/creditsInfoCard/index.d.ts +10 -15
  323. package/dist/esm/components/credits/creditsInfoCard/index.js +1 -1
  324. package/dist/esm/components/credits/creditsInfoCard/index.js.map +3 -3
  325. package/dist/esm/components/credits/creditsMemberPrice/CreditsMemberPrice.d.ts +5 -0
  326. package/dist/esm/components/credits/creditsMemberPrice/CreditsMemberPrice.js +2 -0
  327. package/dist/esm/components/credits/creditsMemberPrice/CreditsMemberPrice.js.map +7 -0
  328. package/dist/esm/components/credits/creditsMemberPrice/MemberPriceItem.d.ts +7 -0
  329. package/dist/esm/components/credits/creditsMemberPrice/MemberPriceItem.js +2 -0
  330. package/dist/esm/components/credits/creditsMemberPrice/MemberPriceItem.js.map +7 -0
  331. package/dist/esm/components/credits/creditsMemberPrice/index.d.ts +2 -0
  332. package/dist/esm/components/credits/creditsMemberPrice/index.js +2 -0
  333. package/dist/esm/components/credits/creditsMemberPrice/index.js.map +7 -0
  334. package/dist/esm/components/credits/creditsMemberPrice/type.d.ts +64 -0
  335. package/dist/esm/components/credits/creditsNavigation/CreditsNavigation.d.ts +4 -0
  336. package/dist/esm/components/credits/creditsNavigation/CreditsNavigation.js +2 -0
  337. package/dist/esm/components/credits/creditsNavigation/CreditsNavigation.js.map +7 -0
  338. package/dist/esm/components/credits/creditsNavigation/index.d.ts +2 -0
  339. package/dist/esm/components/credits/creditsNavigation/index.js +2 -0
  340. package/dist/esm/components/credits/creditsNavigation/index.js.map +7 -0
  341. package/dist/esm/components/credits/creditsNavigation/type.d.ts +7 -0
  342. package/dist/esm/components/credits/creditsRedeemList/AddressForm/CountrySelect.js +1 -1
  343. package/dist/esm/components/credits/creditsRedeemList/AddressForm/CountrySelect.js.map +3 -3
  344. package/dist/esm/components/credits/creditsRedeemList/AddressForm/StateSelect.js +1 -1
  345. package/dist/esm/components/credits/creditsRedeemList/AddressForm/StateSelect.js.map +3 -3
  346. package/dist/esm/components/credits/creditsRedeemList/AddressForm/index.js +1 -1
  347. package/dist/esm/components/credits/creditsRedeemList/AddressForm/index.js.map +3 -3
  348. package/dist/esm/components/credits/creditsRedeemList/CreditsRedeemList.d.ts +5 -0
  349. package/dist/esm/components/credits/creditsRedeemList/CreditsRedeemList.js +2 -0
  350. package/dist/esm/components/credits/creditsRedeemList/CreditsRedeemList.js.map +7 -0
  351. package/dist/esm/components/credits/creditsRedeemList/NonProductValue.d.ts +4 -0
  352. package/dist/esm/components/credits/creditsRedeemList/NonProductValue.js +2 -0
  353. package/dist/esm/components/credits/creditsRedeemList/NonProductValue.js.map +7 -0
  354. package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.js +1 -1
  355. package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.js.map +3 -3
  356. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.js +1 -1
  357. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.js.map +3 -3
  358. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Error.js +1 -1
  359. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Error.js.map +2 -2
  360. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.js +1 -1
  361. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.js.map +3 -3
  362. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.d.ts +6 -0
  363. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js +2 -0
  364. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js.map +7 -0
  365. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js +1 -1
  366. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js.map +3 -3
  367. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.js +1 -1
  368. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.js.map +3 -3
  369. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.js +1 -1
  370. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.js.map +3 -3
  371. package/dist/esm/components/credits/creditsRedeemList/RedeemableItem.js +1 -1
  372. package/dist/esm/components/credits/creditsRedeemList/RedeemableItem.js.map +3 -3
  373. package/dist/esm/components/credits/creditsRedeemList/index.d.ts +2 -13
  374. package/dist/esm/components/credits/creditsRedeemList/index.js +1 -1
  375. package/dist/esm/components/credits/creditsRedeemList/index.js.map +4 -4
  376. package/dist/esm/components/credits/creditsRedeemList/type.d.ts +2 -15
  377. package/dist/esm/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.d.ts +4 -0
  378. package/dist/esm/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js +2 -0
  379. package/dist/esm/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js.map +7 -0
  380. package/dist/esm/components/credits/creditsWaysToGetCredits/index.d.ts +2 -2
  381. package/dist/esm/components/credits/creditsWaysToGetCredits/index.js +1 -1
  382. package/dist/esm/components/credits/creditsWaysToGetCredits/index.js.map +4 -4
  383. package/dist/esm/components/credits/creditsWaysToGetCredits/type.d.ts +5 -16
  384. package/dist/esm/components/credits/creditsWaysToGetCredits/type.js +1 -1
  385. package/dist/esm/components/credits/creditsWaysToGetCredits/type.js.map +2 -2
  386. package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.d.ts +11 -2
  387. package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.js +1 -1
  388. package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.js.map +3 -3
  389. package/dist/esm/components/credits/modal/MyRewardsModal.d.ts +4 -1
  390. package/dist/esm/components/credits/modal/MyRewardsModal.js +1 -1
  391. package/dist/esm/components/credits/modal/MyRewardsModal.js.map +3 -3
  392. package/dist/esm/components/credits/modal/activitiesModal.d.ts +4 -1
  393. package/dist/esm/components/credits/modal/activitiesModal.js +1 -1
  394. package/dist/esm/components/credits/modal/activitiesModal.js.map +3 -3
  395. package/dist/esm/components/credits/modal/creditsUploadReceiptModal.js +1 -1
  396. package/dist/esm/components/credits/modal/creditsUploadReceiptModal.js.map +3 -3
  397. package/dist/esm/components/credits/modal/loadingDots.d.ts +2 -1
  398. package/dist/esm/components/credits/modal/loadingDots.js +1 -1
  399. package/dist/esm/components/credits/modal/loadingDots.js.map +3 -3
  400. package/dist/esm/components/credits/modal/modalContainer.js +1 -1
  401. package/dist/esm/components/credits/modal/modalContainer.js.map +3 -3
  402. package/dist/esm/components/credits/modal/rulesModal.js +1 -1
  403. package/dist/esm/components/credits/modal/rulesModal.js.map +2 -2
  404. package/dist/esm/components/credits/modal/subscribeModal.d.ts +15 -0
  405. package/dist/esm/components/credits/modal/subscribeModal.js +2 -0
  406. package/dist/esm/components/credits/modal/subscribeModal.js.map +7 -0
  407. package/dist/esm/components/credits/modal/tip.js +1 -1
  408. package/dist/esm/components/credits/modal/tip.js.map +3 -3
  409. package/dist/esm/components/credits/type.d.ts +24 -5
  410. package/dist/esm/components/index.d.ts +1 -0
  411. package/dist/esm/components/index.js +1 -1
  412. package/dist/esm/components/index.js.map +2 -2
  413. package/dist/esm/components/registration/authCodeActivate/Message.d.ts +4 -0
  414. package/dist/esm/components/registration/authCodeActivate/Message.js +2 -0
  415. package/dist/esm/components/registration/authCodeActivate/Message.js.map +7 -0
  416. package/dist/esm/components/registration/authCodeActivate/index.d.ts +3 -0
  417. package/dist/esm/components/registration/authCodeActivate/index.js +2 -0
  418. package/dist/esm/components/registration/authCodeActivate/index.js.map +7 -0
  419. package/dist/esm/components/registration/authCodeActivate/type.d.ts +22 -0
  420. package/dist/esm/components/registration/authCodeActivate/type.js.map +7 -0
  421. package/dist/esm/components/registration/context/index.d.ts +1 -0
  422. package/dist/esm/components/registration/context/index.js +2 -0
  423. package/dist/esm/components/registration/context/index.js.map +7 -0
  424. package/dist/esm/components/registration/context/provider.d.ts +27 -0
  425. package/dist/esm/components/registration/context/provider.js +2 -0
  426. package/dist/esm/components/registration/context/provider.js.map +7 -0
  427. package/dist/esm/components/registration/index.d.ts +2 -0
  428. package/dist/esm/components/registration/index.js +2 -0
  429. package/dist/esm/components/registration/index.js.map +7 -0
  430. package/dist/esm/components/registration/modalContainer.d.ts +14 -0
  431. package/dist/esm/components/registration/modalContainer.js +2 -0
  432. package/dist/esm/components/registration/modalContainer.js.map +7 -0
  433. package/dist/esm/index.d.ts +2 -2
  434. package/dist/esm/index.js +1 -1
  435. package/dist/esm/index.js.map +2 -2
  436. package/dist/esm/templates/Credits.d.ts +73 -0
  437. package/dist/esm/templates/Credits.js +2 -0
  438. package/dist/esm/templates/Credits.js.map +7 -0
  439. package/dist/esm/templates/index.d.ts +1 -0
  440. package/dist/esm/templates/index.js +2 -0
  441. package/dist/esm/templates/index.js.map +7 -0
  442. package/package.json +25 -22
  443. package/src/components/chat/index.tsx +1 -1
  444. package/src/components/credits/context/const.ts +1 -0
  445. package/src/components/credits/context/hooks/useActivities.ts +4 -3
  446. package/src/components/credits/context/hooks/useAddressValidate.ts +2 -2
  447. package/src/components/credits/context/hooks/useAlpcFetch.ts +14 -10
  448. package/src/components/credits/context/hooks/useCountries.ts +2 -2
  449. package/src/components/credits/context/hooks/useFunctionMemberPrice.ts +33 -0
  450. package/src/components/credits/context/hooks/useMyRewards.ts +4 -3
  451. package/src/components/credits/context/hooks/useRedeemAndBuy.ts +21 -24
  452. package/src/components/credits/context/hooks/useRedeemCoupon.ts +7 -3
  453. package/src/components/credits/context/hooks/useRedeemProduct.ts +5 -2
  454. package/src/components/credits/context/hooks/useRedeemableList.ts +4 -18
  455. package/src/components/credits/context/hooks/useSubscribed.ts +6 -7
  456. package/src/components/credits/context/hooks/useUploadReceipt.tsx +0 -1
  457. package/src/components/credits/context/memberPriceConst.ts +13 -0
  458. package/src/components/credits/context/memberPriceTypes.ts +54 -0
  459. package/src/components/credits/context/provider.tsx +25 -20
  460. package/src/components/credits/context/utils/atobID.ts +8 -0
  461. package/src/components/credits/context/utils/functionDiscountCalculate.ts +57 -0
  462. package/src/components/credits/context/utils/getFunctionMemberPrice.ts +135 -0
  463. package/src/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.ts +51 -0
  464. package/src/components/credits/context/utils/variantGetCoupon.ts +34 -0
  465. package/src/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.tsx +270 -0
  466. package/src/components/credits/creditsAnkersolixTask/index.ts +2 -0
  467. package/src/components/credits/creditsAnkersolixTask/type.ts +7 -0
  468. package/src/components/credits/creditsBanner/index.tsx +16 -18
  469. package/src/components/credits/creditsBenefits/BenefitItem.tsx +107 -0
  470. package/src/components/credits/creditsBenefits/index.tsx +20 -15
  471. package/src/components/credits/creditsCash/CreditsCash.tsx +84 -0
  472. package/src/components/credits/creditsCash/RedeemableItem.tsx +60 -43
  473. package/src/components/credits/creditsCash/index.ts +2 -0
  474. package/src/components/credits/creditsCash/type.ts +2 -4
  475. package/src/components/credits/creditsFaq/faqItem/FaqItem.tsx +12 -12
  476. package/src/components/credits/creditsFaq/index.tsx +8 -6
  477. package/src/components/credits/creditsInfoCard/index.tsx +42 -36
  478. package/src/components/credits/creditsMemberPrice/CreditsMemberPrice.tsx +389 -0
  479. package/src/components/credits/creditsMemberPrice/MemberPriceItem.tsx +158 -0
  480. package/src/components/credits/creditsMemberPrice/index.ts +2 -0
  481. package/src/components/credits/creditsMemberPrice/type.ts +75 -0
  482. package/src/components/credits/creditsNavigation/CreditsNavigation.tsx +123 -0
  483. package/src/components/credits/creditsNavigation/index.ts +2 -0
  484. package/src/components/credits/creditsNavigation/type.ts +10 -0
  485. package/src/components/credits/creditsRedeemList/AddressForm/CountrySelect.tsx +7 -3
  486. package/src/components/credits/creditsRedeemList/AddressForm/StateSelect.tsx +5 -1
  487. package/src/components/credits/creditsRedeemList/AddressForm/index.tsx +5 -5
  488. package/src/components/credits/creditsRedeemList/{index.tsx → CreditsRedeemList.tsx} +30 -35
  489. package/src/components/credits/creditsRedeemList/NonProductValue.tsx +39 -0
  490. package/src/components/credits/creditsRedeemList/RedeemCouponModal.tsx +11 -13
  491. package/src/components/credits/creditsRedeemList/RedeemProductModal/Address.tsx +14 -11
  492. package/src/components/credits/creditsRedeemList/RedeemProductModal/Error.tsx +1 -1
  493. package/src/components/credits/creditsRedeemList/RedeemProductModal/Init.tsx +6 -12
  494. package/src/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.tsx +25 -0
  495. package/src/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.tsx +11 -7
  496. package/src/components/credits/creditsRedeemList/RedeemProductModal/Success.tsx +4 -1
  497. package/src/components/credits/creditsRedeemList/RedeemProductModal/index.tsx +4 -5
  498. package/src/components/credits/creditsRedeemList/RedeemableItem.tsx +23 -32
  499. package/src/components/credits/creditsRedeemList/index.ts +2 -0
  500. package/src/components/credits/creditsRedeemList/type.ts +2 -16
  501. package/src/components/credits/creditsWaysToGetCredits/{index.tsx → CreditsWaysToGetCredits.tsx} +66 -18
  502. package/src/components/credits/creditsWaysToGetCredits/index.ts +2 -0
  503. package/src/components/credits/creditsWaysToGetCredits/type.ts +5 -16
  504. package/src/components/credits/creditsWaysToGetCredits/useActions.ts +24 -10
  505. package/src/components/credits/modal/MyRewardsModal.tsx +83 -63
  506. package/src/components/credits/modal/activitiesModal.tsx +61 -46
  507. package/src/components/credits/modal/creditsUploadReceiptModal.tsx +9 -1
  508. package/src/components/credits/modal/loadingDots.tsx +9 -7
  509. package/src/components/credits/modal/modalContainer.tsx +5 -1
  510. package/src/components/credits/modal/rulesModal.tsx +1 -1
  511. package/src/components/credits/modal/subscribeModal.tsx +201 -0
  512. package/src/components/credits/modal/tip.tsx +10 -1
  513. package/src/components/credits/type.ts +24 -5
  514. package/src/components/index.ts +2 -2
  515. package/src/components/registration/authCodeActivate/Message.tsx +43 -0
  516. package/src/components/registration/authCodeActivate/index.tsx +338 -0
  517. package/src/components/registration/authCodeActivate/type.ts +23 -0
  518. package/src/components/registration/context/index.tsx +1 -0
  519. package/src/components/registration/context/provider.tsx +86 -0
  520. package/src/components/registration/index.ts +2 -0
  521. package/src/components/registration/modalContainer.tsx +114 -0
  522. package/src/index.ts +2 -4
  523. package/src/styles/global.css +15 -0
  524. package/src/templates/Credits.tsx +165 -0
  525. package/src/templates/index.ts +1 -0
  526. package/style.css +1 -0
  527. package/tailwind.config.ts +10 -0
  528. package/dist/cjs/components/chat/chat-context.d.ts +0 -101
  529. package/dist/cjs/components/credits/context/hooks/useSendEmailValidation.d.ts +0 -1
  530. package/dist/cjs/components/credits/context/hooks/useSendEmailValidation.js +0 -2
  531. package/dist/cjs/components/credits/context/hooks/useSendEmailValidation.js.map +0 -7
  532. package/dist/cjs/components/credits/context/hooks/useSubscriptions.d.ts +0 -5
  533. package/dist/cjs/components/credits/context/hooks/useSubscriptions.js +0 -2
  534. package/dist/cjs/components/credits/context/hooks/useSubscriptions.js.map +0 -7
  535. package/dist/cjs/components/credits/credits-banner/index.d.ts +0 -23
  536. package/dist/cjs/components/credits/credits-banner/index.js +0 -2
  537. package/dist/cjs/components/credits/credits-banner/index.js.map +0 -7
  538. package/dist/cjs/components/credits/credits-benefits/benefitItem.js +0 -2
  539. package/dist/cjs/components/credits/credits-benefits/benefitItem.js.map +0 -7
  540. package/dist/cjs/components/credits/credits-benefits/index.d.ts +0 -12
  541. package/dist/cjs/components/credits/credits-benefits/index.js +0 -4
  542. package/dist/cjs/components/credits/credits-benefits/index.js.map +0 -7
  543. package/dist/cjs/components/credits/credits-cash/RedeemableItem.d.ts +0 -15
  544. package/dist/cjs/components/credits/credits-cash/RedeemableItem.js +0 -2
  545. package/dist/cjs/components/credits/credits-cash/RedeemableItem.js.map +0 -7
  546. package/dist/cjs/components/credits/credits-cash/index.d.ts +0 -13
  547. package/dist/cjs/components/credits/credits-cash/index.js +0 -2
  548. package/dist/cjs/components/credits/credits-cash/index.js.map +0 -7
  549. package/dist/cjs/components/credits/credits-cash/type.d.ts +0 -47
  550. package/dist/cjs/components/credits/credits-cash/type.js +0 -2
  551. package/dist/cjs/components/credits/credits-cash/type.js.map +0 -7
  552. package/dist/cjs/components/credits/credits-faq/faq-item/FaqItem.d.ts +0 -13
  553. package/dist/cjs/components/credits/credits-faq/faq-item/faq-item.d.ts +0 -13
  554. package/dist/cjs/components/credits/credits-faq/faq-item/faq-item.js +0 -2
  555. package/dist/cjs/components/credits/credits-faq/faq-item/faq-item.js.map +0 -7
  556. package/dist/cjs/components/credits/credits-faq/faqItem/FaqItem.d.ts +0 -13
  557. package/dist/cjs/components/credits/credits-faq/index.d.ts +0 -16
  558. package/dist/cjs/components/credits/credits-faq/index.js +0 -2
  559. package/dist/cjs/components/credits/credits-faq/index.js.map +0 -7
  560. package/dist/cjs/components/credits/credits-info-card/index.d.ts +0 -20
  561. package/dist/cjs/components/credits/credits-info-card/index.js +0 -2
  562. package/dist/cjs/components/credits/credits-info-card/index.js.map +0 -7
  563. package/dist/cjs/components/credits/credits-redeem-list/AddressForm/Input.d.ts +0 -13
  564. package/dist/cjs/components/credits/credits-redeem-list/AddressForm/country-select.d.ts +0 -14
  565. package/dist/cjs/components/credits/credits-redeem-list/AddressForm/form-item.d.ts +0 -6
  566. package/dist/cjs/components/credits/credits-redeem-list/AddressForm/index.d.ts +0 -2
  567. package/dist/cjs/components/credits/credits-redeem-list/AddressForm/state-select.d.ts +0 -15
  568. package/dist/cjs/components/credits/credits-redeem-list/AddressForm/type.d.ts +0 -26
  569. package/dist/cjs/components/credits/credits-redeem-list/RedeemCouponModal.d.ts +0 -9
  570. package/dist/cjs/components/credits/credits-redeem-list/RedeemProductModal/Address.d.ts +0 -20
  571. package/dist/cjs/components/credits/credits-redeem-list/RedeemProductModal/Error.d.ts +0 -8
  572. package/dist/cjs/components/credits/credits-redeem-list/RedeemProductModal/Init.d.ts +0 -11
  573. package/dist/cjs/components/credits/credits-redeem-list/RedeemProductModal/ProductInfo.d.ts +0 -8
  574. package/dist/cjs/components/credits/credits-redeem-list/RedeemProductModal/Success.d.ts +0 -13
  575. package/dist/cjs/components/credits/credits-redeem-list/RedeemProductModal/index.d.ts +0 -11
  576. package/dist/cjs/components/credits/credits-redeem-list/RedeemableItem.d.ts +0 -9
  577. package/dist/cjs/components/credits/credits-redeem-list/RedeemableItem.js +0 -2
  578. package/dist/cjs/components/credits/credits-redeem-list/RedeemableItem.js.map +0 -7
  579. package/dist/cjs/components/credits/credits-redeem-list/address-form/Input.d.ts +0 -13
  580. package/dist/cjs/components/credits/credits-redeem-list/address-form/country-select.d.ts +0 -14
  581. package/dist/cjs/components/credits/credits-redeem-list/address-form/country-select.js +0 -2
  582. package/dist/cjs/components/credits/credits-redeem-list/address-form/country-select.js.map +0 -7
  583. package/dist/cjs/components/credits/credits-redeem-list/address-form/form-item.d.ts +0 -6
  584. package/dist/cjs/components/credits/credits-redeem-list/address-form/index.d.ts +0 -2
  585. package/dist/cjs/components/credits/credits-redeem-list/address-form/index.js +0 -2
  586. package/dist/cjs/components/credits/credits-redeem-list/address-form/index.js.map +0 -7
  587. package/dist/cjs/components/credits/credits-redeem-list/address-form/state-select.d.ts +0 -15
  588. package/dist/cjs/components/credits/credits-redeem-list/address-form/state-select.js +0 -2
  589. package/dist/cjs/components/credits/credits-redeem-list/address-form/state-select.js.map +0 -7
  590. package/dist/cjs/components/credits/credits-redeem-list/address-form/type.d.ts +0 -26
  591. package/dist/cjs/components/credits/credits-redeem-list/index.d.ts +0 -13
  592. package/dist/cjs/components/credits/credits-redeem-list/index.js +0 -2
  593. package/dist/cjs/components/credits/credits-redeem-list/index.js.map +0 -7
  594. package/dist/cjs/components/credits/credits-redeem-list/redeem-coupon-modal.d.ts +0 -9
  595. package/dist/cjs/components/credits/credits-redeem-list/redeem-coupon-modal.js +0 -2
  596. package/dist/cjs/components/credits/credits-redeem-list/redeem-coupon-modal.js.map +0 -7
  597. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Address.d.ts +0 -20
  598. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Address.js +0 -2
  599. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Address.js.map +0 -7
  600. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Error.d.ts +0 -8
  601. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Init.d.ts +0 -11
  602. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Init.js +0 -2
  603. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Init.js.map +0 -7
  604. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/ProductInfo.d.ts +0 -8
  605. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/ProductInfo.js +0 -2
  606. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/ProductInfo.js.map +0 -7
  607. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Success.d.ts +0 -13
  608. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Success.js +0 -2
  609. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Success.js.map +0 -7
  610. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/index.d.ts +0 -11
  611. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/index.js +0 -2
  612. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/index.js.map +0 -7
  613. package/dist/cjs/components/credits/credits-redeem-list/type.d.ts +0 -77
  614. package/dist/cjs/components/credits/credits-redeem-list/type.js.map +0 -7
  615. package/dist/cjs/components/credits/credits-ways-to-get-credits/index.d.ts +0 -2
  616. package/dist/cjs/components/credits/credits-ways-to-get-credits/index.js +0 -2
  617. package/dist/cjs/components/credits/credits-ways-to-get-credits/index.js.map +0 -7
  618. package/dist/cjs/components/credits/credits-ways-to-get-credits/type.d.ts +0 -60
  619. package/dist/cjs/components/credits/credits-ways-to-get-credits/type.js +0 -2
  620. package/dist/cjs/components/credits/credits-ways-to-get-credits/type.js.map +0 -7
  621. package/dist/cjs/components/credits/credits-ways-to-get-credits/useActions.d.ts +0 -96
  622. package/dist/cjs/components/credits/credits-ways-to-get-credits/useActions.js +0 -2
  623. package/dist/cjs/components/credits/credits-ways-to-get-credits/useActions.js.map +0 -7
  624. package/dist/cjs/components/credits/creditsBenefits/benefitItem.d.ts +0 -19
  625. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/country-select.d.ts +0 -14
  626. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/form-item.d.ts +0 -6
  627. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/state-select.d.ts +0 -15
  628. package/dist/cjs/helpers/fetchResponse.d.ts +0 -14
  629. package/dist/cjs/helpers/fetchResponse.js +0 -2
  630. package/dist/cjs/helpers/fetchResponse.js.map +0 -7
  631. package/dist/cjs/helpers/fetcher.d.ts +0 -2
  632. package/dist/cjs/helpers/fetcher.js +0 -2
  633. package/dist/cjs/helpers/fetcher.js.map +0 -7
  634. package/dist/cjs/helpers/index.d.ts +0 -2
  635. package/dist/cjs/helpers/index.js +0 -2
  636. package/dist/cjs/helpers/index.js.map +0 -7
  637. package/dist/cjs/helpers/track.d.ts +0 -15
  638. package/dist/cjs/helpers/track.js +0 -2
  639. package/dist/cjs/helpers/track.js.map +0 -7
  640. package/dist/cjs/helpers/utils.d.ts +0 -3
  641. package/dist/cjs/helpers/utils.js +0 -2
  642. package/dist/cjs/helpers/utils.js.map +0 -7
  643. package/dist/cjs/index.css +0 -2
  644. package/dist/cjs/index.css.map +0 -7
  645. package/dist/cjs/shopify/context/ShopifyProvider.d.ts +0 -10
  646. package/dist/cjs/shopify/context/index.d.ts +0 -1
  647. package/dist/cjs/shopify/context/shopify-provider.d.ts +0 -10
  648. package/dist/cjs/shopify/fetchers/create-cart.d.ts +0 -12
  649. package/dist/cjs/shopify/fetchers/get-products-by-handles.d.ts +0 -7
  650. package/dist/cjs/shopify/fetchers/index.d.ts +0 -2
  651. package/dist/cjs/shopify/fragments/article.d.ts +0 -2
  652. package/dist/cjs/shopify/fragments/blog.d.ts +0 -1
  653. package/dist/cjs/shopify/fragments/cart.d.ts +0 -1
  654. package/dist/cjs/shopify/fragments/collection.d.ts +0 -1
  655. package/dist/cjs/shopify/fragments/image.d.ts +0 -1
  656. package/dist/cjs/shopify/fragments/index.d.ts +0 -11
  657. package/dist/cjs/shopify/fragments/metafields.d.ts +0 -2
  658. package/dist/cjs/shopify/fragments/page-info.d.ts +0 -1
  659. package/dist/cjs/shopify/fragments/page.d.ts +0 -1
  660. package/dist/cjs/shopify/fragments/product.d.ts +0 -1
  661. package/dist/cjs/shopify/fragments/seo.d.ts +0 -1
  662. package/dist/cjs/shopify/fragments/variant.d.ts +0 -1
  663. package/dist/cjs/shopify/gql/fragment-masking.d.ts +0 -15
  664. package/dist/cjs/shopify/gql/gql.d.ts +0 -87
  665. package/dist/cjs/shopify/gql/graphql.d.ts +0 -7669
  666. package/dist/cjs/shopify/gql/index.d.ts +0 -3
  667. package/dist/cjs/shopify/hooks/index.d.ts +0 -2
  668. package/dist/cjs/shopify/hooks/use-create-cart.d.ts +0 -2
  669. package/dist/cjs/shopify/hooks/use-products-by-handles.d.ts +0 -4
  670. package/dist/cjs/shopify/hooks/useCreateCart.d.ts +0 -2
  671. package/dist/cjs/shopify/hooks/useProductsByHandles.d.ts +0 -4
  672. package/dist/cjs/shopify/mutations/create-cart.d.ts +0 -1
  673. package/dist/cjs/shopify/queries/get-product-by-handles.d.ts +0 -1
  674. package/dist/cjs/shopify/queries/index.d.ts +0 -1
  675. package/dist/cjs/shopify/src/index.d.ts +0 -5
  676. package/dist/cjs/shopify/tsup.config.d.ts +0 -2
  677. package/dist/cjs/shopify/types/article.d.ts +0 -48
  678. package/dist/cjs/shopify/types/cart.d.ts +0 -173
  679. package/dist/cjs/shopify/types/checkout.d.ts +0 -42
  680. package/dist/cjs/shopify/types/collection.d.ts +0 -122
  681. package/dist/cjs/shopify/types/common.d.ts +0 -42
  682. package/dist/cjs/shopify/types/config.d.ts +0 -12
  683. package/dist/cjs/shopify/types/customer.d.ts +0 -30
  684. package/dist/cjs/shopify/types/fetcher.d.ts +0 -38
  685. package/dist/cjs/shopify/types/index.d.ts +0 -12
  686. package/dist/cjs/shopify/types/page.d.ts +0 -33
  687. package/dist/cjs/shopify/types/product.d.ts +0 -174
  688. package/dist/cjs/shopify/types/search.d.ts +0 -54
  689. package/dist/cjs/shopify/types/site.d.ts +0 -33
  690. package/dist/cjs/shopify/types/type-helper.d.ts +0 -5
  691. package/dist/cjs/shopify/utils/colors.d.ts +0 -3
  692. package/dist/cjs/shopify/utils/const.d.ts +0 -76
  693. package/dist/cjs/shopify/utils/cookie.d.ts +0 -15
  694. package/dist/cjs/shopify/utils/errors.d.ts +0 -38
  695. package/dist/cjs/shopify/utils/fetch-graphql-api.d.ts +0 -19
  696. package/dist/cjs/shopify/utils/handle-fetch-response.d.ts +0 -5
  697. package/dist/cjs/shopify/utils/helper.d.ts +0 -28
  698. package/dist/cjs/shopify/utils/normalize/cart.d.ts +0 -7
  699. package/dist/cjs/shopify/utils/normalize/customer.d.ts +0 -3
  700. package/dist/cjs/shopify/utils/normalize/index.d.ts +0 -2
  701. package/dist/cjs/shopify/utils/normalize/metafield.d.ts +0 -5
  702. package/dist/cjs/shopify/utils/normalize/product.d.ts +0 -16
  703. package/dist/cjs/shopify/utils/store.d.ts +0 -2
  704. package/dist/cjs/shopify/utils/type-helper.d.ts +0 -5
  705. package/dist/cjs/tsconfig.tsbuildinfo +0 -1
  706. package/dist/esm/components/chat/chat-context.d.ts +0 -101
  707. package/dist/esm/components/chat/chat-context.js +0 -2
  708. package/dist/esm/components/chat/chat-context.js.map +0 -7
  709. package/dist/esm/components/credits/context/hooks/useSendEmailValidation.d.ts +0 -1
  710. package/dist/esm/components/credits/context/hooks/useSendEmailValidation.js +0 -2
  711. package/dist/esm/components/credits/context/hooks/useSendEmailValidation.js.map +0 -7
  712. package/dist/esm/components/credits/context/hooks/useSubscriptions.d.ts +0 -5
  713. package/dist/esm/components/credits/context/hooks/useSubscriptions.js +0 -2
  714. package/dist/esm/components/credits/context/hooks/useSubscriptions.js.map +0 -7
  715. package/dist/esm/components/credits/credits-banner/index.d.ts +0 -23
  716. package/dist/esm/components/credits/credits-banner/index.js +0 -2
  717. package/dist/esm/components/credits/credits-banner/index.js.map +0 -7
  718. package/dist/esm/components/credits/credits-benefits/benefitItem.js +0 -2
  719. package/dist/esm/components/credits/credits-benefits/benefitItem.js.map +0 -7
  720. package/dist/esm/components/credits/credits-benefits/iconInfo.d.ts +0 -2
  721. package/dist/esm/components/credits/credits-benefits/iconInfo.js.map +0 -7
  722. package/dist/esm/components/credits/credits-benefits/index.d.ts +0 -12
  723. package/dist/esm/components/credits/credits-benefits/index.js +0 -4
  724. package/dist/esm/components/credits/credits-benefits/index.js.map +0 -7
  725. package/dist/esm/components/credits/credits-cash/RedeemableItem.d.ts +0 -15
  726. package/dist/esm/components/credits/credits-cash/RedeemableItem.js +0 -2
  727. package/dist/esm/components/credits/credits-cash/RedeemableItem.js.map +0 -7
  728. package/dist/esm/components/credits/credits-cash/index.d.ts +0 -13
  729. package/dist/esm/components/credits/credits-cash/index.js +0 -2
  730. package/dist/esm/components/credits/credits-cash/index.js.map +0 -7
  731. package/dist/esm/components/credits/credits-cash/type.d.ts +0 -47
  732. package/dist/esm/components/credits/credits-faq/faq-item/FaqItem.d.ts +0 -13
  733. package/dist/esm/components/credits/credits-faq/faq-item/faq-item.d.ts +0 -13
  734. package/dist/esm/components/credits/credits-faq/faq-item/faq-item.js +0 -2
  735. package/dist/esm/components/credits/credits-faq/faq-item/faq-item.js.map +0 -7
  736. package/dist/esm/components/credits/credits-faq/faqItem/FaqItem.d.ts +0 -13
  737. package/dist/esm/components/credits/credits-faq/index.d.ts +0 -16
  738. package/dist/esm/components/credits/credits-faq/index.js +0 -2
  739. package/dist/esm/components/credits/credits-faq/index.js.map +0 -7
  740. package/dist/esm/components/credits/credits-info-card/index.d.ts +0 -20
  741. package/dist/esm/components/credits/credits-info-card/index.js +0 -2
  742. package/dist/esm/components/credits/credits-info-card/index.js.map +0 -7
  743. package/dist/esm/components/credits/credits-redeem-list/AddressForm/Input.d.ts +0 -13
  744. package/dist/esm/components/credits/credits-redeem-list/AddressForm/country-select.d.ts +0 -14
  745. package/dist/esm/components/credits/credits-redeem-list/AddressForm/form-item.d.ts +0 -6
  746. package/dist/esm/components/credits/credits-redeem-list/AddressForm/index.d.ts +0 -2
  747. package/dist/esm/components/credits/credits-redeem-list/AddressForm/state-select.d.ts +0 -15
  748. package/dist/esm/components/credits/credits-redeem-list/AddressForm/type.d.ts +0 -26
  749. package/dist/esm/components/credits/credits-redeem-list/RedeemCouponModal.d.ts +0 -9
  750. package/dist/esm/components/credits/credits-redeem-list/RedeemProductModal/Address.d.ts +0 -20
  751. package/dist/esm/components/credits/credits-redeem-list/RedeemProductModal/Error.d.ts +0 -8
  752. package/dist/esm/components/credits/credits-redeem-list/RedeemProductModal/Init.d.ts +0 -11
  753. package/dist/esm/components/credits/credits-redeem-list/RedeemProductModal/ProductInfo.d.ts +0 -8
  754. package/dist/esm/components/credits/credits-redeem-list/RedeemProductModal/Success.d.ts +0 -13
  755. package/dist/esm/components/credits/credits-redeem-list/RedeemProductModal/index.d.ts +0 -11
  756. package/dist/esm/components/credits/credits-redeem-list/RedeemableItem.d.ts +0 -9
  757. package/dist/esm/components/credits/credits-redeem-list/RedeemableItem.js +0 -2
  758. package/dist/esm/components/credits/credits-redeem-list/RedeemableItem.js.map +0 -7
  759. package/dist/esm/components/credits/credits-redeem-list/address-form/Input.d.ts +0 -13
  760. package/dist/esm/components/credits/credits-redeem-list/address-form/Input.js +0 -2
  761. package/dist/esm/components/credits/credits-redeem-list/address-form/Input.js.map +0 -7
  762. package/dist/esm/components/credits/credits-redeem-list/address-form/country-select.d.ts +0 -14
  763. package/dist/esm/components/credits/credits-redeem-list/address-form/country-select.js +0 -2
  764. package/dist/esm/components/credits/credits-redeem-list/address-form/country-select.js.map +0 -7
  765. package/dist/esm/components/credits/credits-redeem-list/address-form/form-item.d.ts +0 -6
  766. package/dist/esm/components/credits/credits-redeem-list/address-form/form-item.js +0 -2
  767. package/dist/esm/components/credits/credits-redeem-list/address-form/form-item.js.map +0 -7
  768. package/dist/esm/components/credits/credits-redeem-list/address-form/index.d.ts +0 -2
  769. package/dist/esm/components/credits/credits-redeem-list/address-form/index.js +0 -2
  770. package/dist/esm/components/credits/credits-redeem-list/address-form/index.js.map +0 -7
  771. package/dist/esm/components/credits/credits-redeem-list/address-form/state-select.d.ts +0 -15
  772. package/dist/esm/components/credits/credits-redeem-list/address-form/state-select.js +0 -2
  773. package/dist/esm/components/credits/credits-redeem-list/address-form/state-select.js.map +0 -7
  774. package/dist/esm/components/credits/credits-redeem-list/address-form/type.d.ts +0 -26
  775. package/dist/esm/components/credits/credits-redeem-list/index.d.ts +0 -13
  776. package/dist/esm/components/credits/credits-redeem-list/index.js +0 -2
  777. package/dist/esm/components/credits/credits-redeem-list/index.js.map +0 -7
  778. package/dist/esm/components/credits/credits-redeem-list/redeem-coupon-modal.d.ts +0 -9
  779. package/dist/esm/components/credits/credits-redeem-list/redeem-coupon-modal.js +0 -2
  780. package/dist/esm/components/credits/credits-redeem-list/redeem-coupon-modal.js.map +0 -7
  781. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Address.d.ts +0 -20
  782. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Address.js +0 -2
  783. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Address.js.map +0 -7
  784. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Error.d.ts +0 -8
  785. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Error.js +0 -2
  786. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Error.js.map +0 -7
  787. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Init.d.ts +0 -11
  788. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Init.js +0 -2
  789. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Init.js.map +0 -7
  790. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/ProductInfo.d.ts +0 -8
  791. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/ProductInfo.js +0 -2
  792. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/ProductInfo.js.map +0 -7
  793. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Success.d.ts +0 -13
  794. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Success.js +0 -2
  795. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Success.js.map +0 -7
  796. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/index.d.ts +0 -11
  797. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/index.js +0 -2
  798. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/index.js.map +0 -7
  799. package/dist/esm/components/credits/credits-redeem-list/type.d.ts +0 -77
  800. package/dist/esm/components/credits/credits-ways-to-get-credits/index.d.ts +0 -2
  801. package/dist/esm/components/credits/credits-ways-to-get-credits/index.js +0 -2
  802. package/dist/esm/components/credits/credits-ways-to-get-credits/index.js.map +0 -7
  803. package/dist/esm/components/credits/credits-ways-to-get-credits/type.d.ts +0 -60
  804. package/dist/esm/components/credits/credits-ways-to-get-credits/type.js +0 -2
  805. package/dist/esm/components/credits/credits-ways-to-get-credits/type.js.map +0 -7
  806. package/dist/esm/components/credits/credits-ways-to-get-credits/useActions.d.ts +0 -96
  807. package/dist/esm/components/credits/credits-ways-to-get-credits/useActions.js +0 -2
  808. package/dist/esm/components/credits/credits-ways-to-get-credits/useActions.js.map +0 -7
  809. package/dist/esm/components/credits/creditsBenefits/benefitItem.d.ts +0 -19
  810. package/dist/esm/components/credits/creditsBenefits/benefitItem.js +0 -2
  811. package/dist/esm/components/credits/creditsBenefits/benefitItem.js.map +0 -7
  812. package/dist/esm/components/credits/creditsBenefits/iconInfo.d.ts +0 -2
  813. package/dist/esm/components/credits/creditsBenefits/iconInfo.js +0 -2
  814. package/dist/esm/components/credits/creditsRedeemList/AddressForm/country-select.d.ts +0 -14
  815. package/dist/esm/components/credits/creditsRedeemList/AddressForm/form-item.d.ts +0 -6
  816. package/dist/esm/components/credits/creditsRedeemList/AddressForm/state-select.d.ts +0 -15
  817. package/dist/esm/helpers/fetchResponse.d.ts +0 -14
  818. package/dist/esm/helpers/fetchResponse.js +0 -2
  819. package/dist/esm/helpers/fetchResponse.js.map +0 -7
  820. package/dist/esm/helpers/fetcher.d.ts +0 -2
  821. package/dist/esm/helpers/fetcher.js +0 -2
  822. package/dist/esm/helpers/fetcher.js.map +0 -7
  823. package/dist/esm/helpers/index.d.ts +0 -2
  824. package/dist/esm/helpers/index.js +0 -2
  825. package/dist/esm/helpers/index.js.map +0 -7
  826. package/dist/esm/helpers/track.d.ts +0 -15
  827. package/dist/esm/helpers/track.js +0 -2
  828. package/dist/esm/helpers/track.js.map +0 -7
  829. package/dist/esm/helpers/utils.d.ts +0 -3
  830. package/dist/esm/helpers/utils.js +0 -2
  831. package/dist/esm/helpers/utils.js.map +0 -7
  832. package/dist/esm/index.css +0 -2
  833. package/dist/esm/index.css.map +0 -7
  834. package/dist/esm/shopify/context/ShopifyProvider.d.ts +0 -10
  835. package/dist/esm/shopify/context/index.d.ts +0 -1
  836. package/dist/esm/shopify/context/shopify-provider.d.ts +0 -10
  837. package/dist/esm/shopify/fetchers/create-cart.d.ts +0 -12
  838. package/dist/esm/shopify/fetchers/get-products-by-handles.d.ts +0 -7
  839. package/dist/esm/shopify/fetchers/index.d.ts +0 -2
  840. package/dist/esm/shopify/fragments/article.d.ts +0 -2
  841. package/dist/esm/shopify/fragments/blog.d.ts +0 -1
  842. package/dist/esm/shopify/fragments/cart.d.ts +0 -1
  843. package/dist/esm/shopify/fragments/collection.d.ts +0 -1
  844. package/dist/esm/shopify/fragments/image.d.ts +0 -1
  845. package/dist/esm/shopify/fragments/index.d.ts +0 -11
  846. package/dist/esm/shopify/fragments/metafields.d.ts +0 -2
  847. package/dist/esm/shopify/fragments/page-info.d.ts +0 -1
  848. package/dist/esm/shopify/fragments/page.d.ts +0 -1
  849. package/dist/esm/shopify/fragments/product.d.ts +0 -1
  850. package/dist/esm/shopify/fragments/seo.d.ts +0 -1
  851. package/dist/esm/shopify/fragments/variant.d.ts +0 -1
  852. package/dist/esm/shopify/gql/fragment-masking.d.ts +0 -15
  853. package/dist/esm/shopify/gql/gql.d.ts +0 -87
  854. package/dist/esm/shopify/gql/graphql.d.ts +0 -7669
  855. package/dist/esm/shopify/gql/index.d.ts +0 -3
  856. package/dist/esm/shopify/hooks/index.d.ts +0 -2
  857. package/dist/esm/shopify/hooks/use-create-cart.d.ts +0 -2
  858. package/dist/esm/shopify/hooks/use-products-by-handles.d.ts +0 -4
  859. package/dist/esm/shopify/hooks/useCreateCart.d.ts +0 -2
  860. package/dist/esm/shopify/hooks/useProductsByHandles.d.ts +0 -4
  861. package/dist/esm/shopify/mutations/create-cart.d.ts +0 -1
  862. package/dist/esm/shopify/queries/get-product-by-handles.d.ts +0 -1
  863. package/dist/esm/shopify/queries/index.d.ts +0 -1
  864. package/dist/esm/shopify/src/index.d.ts +0 -5
  865. package/dist/esm/shopify/tsup.config.d.ts +0 -2
  866. package/dist/esm/shopify/types/article.d.ts +0 -48
  867. package/dist/esm/shopify/types/cart.d.ts +0 -173
  868. package/dist/esm/shopify/types/checkout.d.ts +0 -42
  869. package/dist/esm/shopify/types/collection.d.ts +0 -122
  870. package/dist/esm/shopify/types/common.d.ts +0 -42
  871. package/dist/esm/shopify/types/config.d.ts +0 -12
  872. package/dist/esm/shopify/types/customer.d.ts +0 -30
  873. package/dist/esm/shopify/types/fetcher.d.ts +0 -38
  874. package/dist/esm/shopify/types/index.d.ts +0 -12
  875. package/dist/esm/shopify/types/page.d.ts +0 -33
  876. package/dist/esm/shopify/types/product.d.ts +0 -174
  877. package/dist/esm/shopify/types/search.d.ts +0 -54
  878. package/dist/esm/shopify/types/site.d.ts +0 -33
  879. package/dist/esm/shopify/types/type-helper.d.ts +0 -5
  880. package/dist/esm/shopify/utils/colors.d.ts +0 -3
  881. package/dist/esm/shopify/utils/const.d.ts +0 -76
  882. package/dist/esm/shopify/utils/cookie.d.ts +0 -15
  883. package/dist/esm/shopify/utils/errors.d.ts +0 -38
  884. package/dist/esm/shopify/utils/fetch-graphql-api.d.ts +0 -19
  885. package/dist/esm/shopify/utils/handle-fetch-response.d.ts +0 -5
  886. package/dist/esm/shopify/utils/helper.d.ts +0 -28
  887. package/dist/esm/shopify/utils/normalize/cart.d.ts +0 -7
  888. package/dist/esm/shopify/utils/normalize/customer.d.ts +0 -3
  889. package/dist/esm/shopify/utils/normalize/index.d.ts +0 -2
  890. package/dist/esm/shopify/utils/normalize/metafield.d.ts +0 -5
  891. package/dist/esm/shopify/utils/normalize/product.d.ts +0 -16
  892. package/dist/esm/shopify/utils/store.d.ts +0 -2
  893. package/dist/esm/shopify/utils/type-helper.d.ts +0 -5
  894. package/dist/esm/tsconfig.tsbuildinfo +0 -1
  895. package/src/components/credits/context/hooks/useSendEmailValidation.ts +0 -20
  896. package/src/components/credits/context/hooks/useSubscriptions.ts +0 -54
  897. package/src/components/credits/creditsBenefits/benefitItem.tsx +0 -73
  898. package/src/components/credits/creditsCash/index.tsx +0 -102
  899. package/src/helpers/fetchResponse.ts +0 -35
  900. package/src/helpers/fetcher.ts +0 -44
  901. package/src/helpers/index.ts +0 -2
  902. package/src/helpers/track.ts +0 -55
  903. package/src/helpers/utils.ts +0 -8
  904. /package/dist/cjs/components/credits/{credits-benefits/iconInfo.d.ts → creditsBenefits/IconInfo.d.ts} +0 -0
  905. /package/dist/cjs/components/credits/{credits-redeem-list/address-form → creditsRedeemList/AddressForm}/Input.js +0 -0
  906. /package/dist/cjs/components/credits/{credits-redeem-list/address-form → creditsRedeemList/AddressForm}/type.js +0 -0
  907. /package/dist/cjs/components/credits/{credits-redeem-list → creditsRedeemList}/type.js +0 -0
  908. /package/dist/esm/components/credits/{credits-cash/type.js.map → context/memberPriceTypes.js.map} +0 -0
  909. /package/dist/{cjs/components/credits/creditsBenefits/iconInfo.d.ts → esm/components/credits/creditsBenefits/IconInfo.d.ts} +0 -0
  910. /package/dist/esm/components/credits/{credits-cash → creditsMemberPrice}/type.js +0 -0
  911. /package/dist/esm/components/credits/{credits-redeem-list/address-form → creditsMemberPrice}/type.js.map +0 -0
  912. /package/dist/esm/components/credits/{credits-redeem-list/address-form → creditsNavigation}/type.js +0 -0
  913. /package/dist/esm/components/credits/{credits-redeem-list → creditsNavigation}/type.js.map +0 -0
  914. /package/dist/esm/components/{credits/credits-redeem-list → registration/authCodeActivate}/type.js +0 -0
  915. /package/src/components/credits/creditsBenefits/{iconInfo.tsx → IconInfo.tsx} +0 -0
@@ -1,2 +1,2 @@
1
- var t=(e=>(e.Activate="activate",e.Subscribe="subscribe",e.CompleteProfile="completeProfile",e.FirstPurchase="firstPurchase",e.UploadReceipt="uploadReceipt",e.Shop="shop",e))(t||{});export{t as TaskType};
1
+ var e=(t=>(t.Activate="activate",t.Subscribe="subscribe",t.CompleteProfile="completeProfile",t.FirstPurchase="firstPurchase",t.UploadReceipt="uploadReceipt",t.Shop="shop",t))(e||{});export{e as TaskType};
2
2
  //# sourceMappingURL=type.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/components/credits/creditsWaysToGetCredits/type.ts"],
4
- "sourcesContent": ["import type { ReceiptCopy } from '../modal/creditsUploadReceiptModal'\n\nexport type BenefitItem = {\n title: string\n credits: string\n id: string\n}\n\nexport type WaysToGetCreditsCopy = {\n title: string\n subtitle: string\n equalCredits: string\n musicIcon: string\n list: BenefitItem[]\n mainImage: {\n url: string\n alt: string\n }\n joinNow: string\n activate: string\n completed: string\n completeProfile: string\n makeFirstPurchase: string\n goShopLink: string\n uploadReceipt: string\n shopNow: string\n subscribe: string\n sendEmailSuccess: string\n creditsIcon: {\n url: string\n alt: string\n }\n receipt: ReceiptCopy\n}\n\nexport enum TaskType {\n Activate = 'activate',\n Subscribe = 'subscribe',\n CompleteProfile = 'completeProfile',\n FirstPurchase = 'firstPurchase',\n UploadReceipt = 'uploadReceipt',\n Shop = 'shop',\n}\n\nexport type CreditsWaysToGetCreditsProps = {\n copy: WaysToGetCreditsCopy\n classNames?: {\n equalCreditsText?: string\n subtitle?: string\n }\n activate: {\n openAuthCodePopup: () => void\n isSuccess: boolean\n isSendingActivateEmail: boolean\n }\n subscribe: {\n openSubscribePopup: () => void\n isSuccess: boolean\n }\n uploadReceipt: {\n openUploadReceiptPopup: () => void\n isSuccess: boolean\n }\n}\n"],
5
- "mappings": "AAmCO,IAAKA,OACVA,EAAA,SAAW,WACXA,EAAA,UAAY,YACZA,EAAA,gBAAkB,kBAClBA,EAAA,cAAgB,gBAChBA,EAAA,cAAgB,gBAChBA,EAAA,KAAO,OANGA,OAAA",
4
+ "sourcesContent": ["import type { ReceiptCopy } from '../modal/creditsUploadReceiptModal'\nimport type { CreditsSubscribeModalCopy } from '../modal/subscribeModal'\n\nexport type BenefitItem = {\n title: string\n credits: string\n id: string\n}\n\nexport type CreditsWaysToGetCreditsCopy = {\n title: string\n subtitle: string\n equalCredits: string\n musicIcon: string\n list: BenefitItem[]\n mainImage: {\n url: string\n alt: string\n }\n joinNow: string\n activate: string\n completed: string\n completeProfile: string\n makeFirstPurchase: string\n goShopLink: string\n uploadReceipt: string\n shopNow: string\n subscribeLabel: string\n sendEmailSuccess: string\n creditsIcon: {\n url: string\n alt: string\n }\n receipt: ReceiptCopy\n subscribe: CreditsSubscribeModalCopy\n}\n\nexport enum TaskType {\n Activate = 'activate',\n Subscribe = 'subscribe',\n CompleteProfile = 'completeProfile',\n FirstPurchase = 'firstPurchase',\n UploadReceipt = 'uploadReceipt',\n Shop = 'shop',\n}\n\nexport type CreditsWaysToGetCreditsProps = {\n copy: CreditsWaysToGetCreditsCopy\n classNames?: {\n equalCreditsText?: string\n subtitle?: string\n }\n}\n"],
5
+ "mappings": "AAqCO,IAAKA,OACVA,EAAA,SAAW,WACXA,EAAA,UAAY,YACZA,EAAA,gBAAkB,kBAClBA,EAAA,cAAgB,gBAChBA,EAAA,cAAgB,gBAChBA,EAAA,KAAO,OANGA,OAAA",
6
6
  "names": ["TaskType"]
7
7
  }
@@ -1,5 +1,14 @@
1
- import type { CreditsWaysToGetCreditsProps } from './type';
2
- export declare const useActions: ({ copy, subscribe, uploadReceipt, activate, gaParameters, }: CreditsWaysToGetCreditsProps & {
1
+ import type { CreditsWaysToGetCreditsCopy } from './type';
2
+ export declare const useActions: ({ copy, subscribe, uploadReceipt, gaParameters, }: {
3
+ copy: CreditsWaysToGetCreditsCopy;
4
+ subscribe: {
5
+ openSubscribePopup: () => void;
6
+ isSuccess: boolean;
7
+ };
8
+ uploadReceipt: {
9
+ openUploadReceiptPopup: () => void;
10
+ isSuccess: boolean;
11
+ };
3
12
  gaParameters?: {
4
13
  position: string;
5
14
  };
@@ -1,2 +1,2 @@
1
- import{TaskType as t}from"./type";import{useCreditsContext as L}from"../context/provider";import{useMemo as d}from"react";import C from"../context/hooks/useReceiptUploaded";import{useFirstPurchaseFinished as P}from"../context/hooks/useFirstPurchaseFinished";import{useSubscribed as g}from"../context/hooks/useSubscribed";import{useShopifyContext as v}from"@anker-in/shopify";import{gaTrack as F}from"../../../helpers/track";const x=({copy:e,subscribe:u,uploadReceipt:c,activate:m,gaParameters:n})=>{const{openSignUpPopup:a,gtm:p,profile:o}=L(),l=g(),s=P(),b=C(),{appName:h}=v(),r=d(()=>(o?.first_name||o?.last_name)&&o?.phone_number&&o?.dob,[o]);return d(()=>{const i=({buttonName:k,id:f,callback:N})=>{F({event:"ga4Event",event_name:"lp_button",member_active_status:o?.activated?"active":"not active",event_parameters:{page_group:p.pageGroup,position:n?.position||e.title,button_name:k,info:f}}),N()};return{actions:{[t.Activate]:{finished:o?.activated,notLogin:{buttonLabel:e?.joinNow,handleClick:()=>i({buttonName:e?.joinNow,callback:a,id:t.Activate})},notFinished:{buttonLabel:e?.activate,handleClick:()=>i({buttonName:e?.activate,callback:()=>m.openAuthCodePopup(),id:t.Activate})},completed:{buttonLabel:e?.completed}},[t.Subscribe]:{finished:l,notLogin:{buttonLabel:e?.joinNow,handleClick:()=>i({buttonName:e?.joinNow,callback:a,id:t.Subscribe})},notFinished:{buttonLabel:e?.subscribe,handleClick:()=>i({buttonName:e?.subscribe,callback:()=>u.openSubscribePopup(),id:t.Subscribe})},completed:{buttonLabel:e?.completed}},[t.CompleteProfile]:{finished:r,notLogin:{buttonLabel:e?.joinNow,handleClick:()=>i({buttonName:e?.joinNow,callback:a,id:t.CompleteProfile})},notFinished:{buttonLabel:e?.completeProfile,link:`/account/profile?app=${h}`,handleClick:()=>i({buttonName:e?.completeProfile,callback:()=>{},id:t.CompleteProfile})},completed:{buttonLabel:e?.completed}},[t.FirstPurchase]:{finished:s,notLogin:{buttonLabel:e?.makeFirstPurchase,handleClick:()=>i({buttonName:e?.makeFirstPurchase,callback:a,id:t.FirstPurchase})},notFinished:{buttonLabel:e?.makeFirstPurchase,link:e?.goShopLink,handleClick:()=>i({buttonName:e?.makeFirstPurchase,callback:()=>{},id:t.FirstPurchase})},completed:{buttonLabel:e?.completed}},[t.UploadReceipt]:{finished:b,notLogin:{buttonLabel:e?.joinNow,handleClick:()=>i({buttonName:e?.joinNow,callback:a,id:t.UploadReceipt})},notFinished:{buttonLabel:e?.uploadReceipt,handleClick:()=>i({buttonName:e?.uploadReceipt,callback:()=>c.openUploadReceiptPopup(),id:t.UploadReceipt})},completed:{buttonLabel:e?.completed}},[t.Shop]:{finished:!1,notLogin:{buttonLabel:e?.joinNow,handleClick:()=>i({buttonName:e?.joinNow,callback:a,id:t.Shop})},notFinished:{buttonLabel:e?.shopNow,link:e?.goShopLink,handleClick:()=>i({buttonName:e?.shopNow,callback:()=>{},id:t.Shop})},completed:{buttonLabel:e?.completed}}}}},[o?.activated,e?.joinNow,e?.activate,e?.completed,e?.subscribe,e?.completeProfile,e?.makeFirstPurchase,e?.uploadReceipt,e?.shopNow,e.title,e?.goShopLink,l,r,s,b,n?.position,a])};export{x as useActions};
1
+ import{useHeadlessContext as C,gaTrack as P}from"@anker-in/lib";import{TaskType as t}from"./type";import{useCreditsContext as g}from"../context/provider";import{useMemo as d}from"react";import v from"../context/hooks/useReceiptUploaded";import{useFirstPurchaseFinished as F}from"../context/hooks/useFirstPurchaseFinished";import{useSubscribed as S}from"../context/hooks/useSubscribed";import{useRegistration as w}from"../../registration";const W=({copy:e,subscribe:c,uploadReceipt:m,gaParameters:n})=>{const{openSignUpPopup:a,gtm:p,profile:o}=g(),{authCodeActivate:l}=w(),s=S(),b=F(),r=v(),{appName:h,passportUrl:k}=C(),u=d(()=>(o?.first_name||o?.last_name)&&o?.phone_number&&o?.dob,[o]);return d(()=>{const i=({buttonName:L,id:f,callback:N})=>{P({event:"ga4Event",event_name:"lp_button",member_active_status:o?.activated?"active":"not active",event_parameters:{page_group:p.pageGroup,position:n?.position||e.title,button_name:L,info:f}}),N()};return{actions:{[t.Activate]:{finished:o?.activated,notLogin:{buttonLabel:e?.joinNow,handleClick:()=>i({buttonName:e?.joinNow,callback:a,id:t.Activate})},notFinished:{buttonLabel:e?.activate,handleClick:()=>i({buttonName:e?.activate,callback:()=>{l.setAutoSendEmail(!0),l.open()},id:t.Activate})},completed:{buttonLabel:e?.completed}},[t.Subscribe]:{finished:s,notLogin:{buttonLabel:e?.joinNow,handleClick:()=>i({buttonName:e?.joinNow,callback:a,id:t.Subscribe})},notFinished:{buttonLabel:e?.subscribeLabel,handleClick:()=>i({buttonName:e?.subscribeLabel,callback:()=>c.openSubscribePopup(),id:t.Subscribe})},completed:{buttonLabel:e?.completed}},[t.CompleteProfile]:{finished:u,notLogin:{buttonLabel:e?.joinNow,handleClick:()=>i({buttonName:e?.joinNow,callback:a,id:t.CompleteProfile})},notFinished:{buttonLabel:e?.completeProfile,link:`${k}/account/profile?app=${h}`,handleClick:()=>i({buttonName:e?.completeProfile,callback:()=>{},id:t.CompleteProfile})},completed:{buttonLabel:e?.completed}},[t.FirstPurchase]:{finished:b,notLogin:{buttonLabel:e?.makeFirstPurchase,handleClick:()=>i({buttonName:e?.makeFirstPurchase,callback:a,id:t.FirstPurchase})},notFinished:{buttonLabel:e?.makeFirstPurchase,link:e?.goShopLink,handleClick:()=>i({buttonName:e?.makeFirstPurchase,callback:()=>{},id:t.FirstPurchase})},completed:{buttonLabel:e?.completed}},[t.UploadReceipt]:{finished:r,notLogin:{buttonLabel:e?.joinNow,handleClick:()=>i({buttonName:e?.joinNow,callback:a,id:t.UploadReceipt})},notFinished:{buttonLabel:e?.uploadReceipt,handleClick:()=>i({buttonName:e?.uploadReceipt,callback:()=>m.openUploadReceiptPopup(),id:t.UploadReceipt})},completed:{buttonLabel:e?.completed}},[t.Shop]:{finished:!1,notLogin:{buttonLabel:e?.joinNow,handleClick:()=>i({buttonName:e?.joinNow,callback:a,id:t.Shop})},notFinished:{buttonLabel:e?.shopNow,link:e?.goShopLink,handleClick:()=>i({buttonName:e?.shopNow,callback:()=>{},id:t.Shop})},completed:{buttonLabel:e?.completed}}}}},[o?.activated,e?.joinNow,e?.activate,e?.completed,e?.subscribe,e?.completeProfile,e?.makeFirstPurchase,e?.uploadReceipt,e?.shopNow,e.title,e?.goShopLink,s,u,b,r,n?.position,a])};export{W as useActions};
2
2
  //# sourceMappingURL=useActions.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/components/credits/creditsWaysToGetCredits/useActions.ts"],
4
- "sourcesContent": ["import { TaskType } from './type'\nimport { useCreditsContext } from '../context/provider'\nimport { useMemo } from 'react'\nimport useReceiptUploaded from '../context/hooks/useReceiptUploaded'\nimport { useFirstPurchaseFinished } from '../context/hooks/useFirstPurchaseFinished'\nimport { useSubscribed } from '../context/hooks/useSubscribed'\nimport type { CreditsWaysToGetCreditsProps } from './type'\nimport { useShopifyContext } from '@anker-in/shopify'\nimport { gaTrack } from '../../../helpers/track'\n\nexport const useActions = ({\n copy,\n subscribe,\n uploadReceipt,\n activate,\n gaParameters,\n}: CreditsWaysToGetCreditsProps & {\n gaParameters?: {\n position: string\n }\n}) => {\n const { openSignUpPopup, gtm, profile } = useCreditsContext()\n const isSubscribed = useSubscribed()\n const firstPurchaseFinished = useFirstPurchaseFinished()\n const uploadedReceipt = useReceiptUploaded()\n const { appName } = useShopifyContext()\n\n const profileCompleted = useMemo(() => {\n return (profile?.first_name || profile?.last_name) && profile?.phone_number && profile?.dob\n }, [profile])\n\n return useMemo(() => {\n const handleClickWithTrack = ({\n buttonName,\n id,\n callback,\n }: {\n buttonName: string\n id?: string\n callback: () => void\n }) => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'lp_button',\n member_active_status: profile?.activated ? 'active' : 'not active',\n event_parameters: {\n page_group: gtm.pageGroup,\n position: gaParameters?.position || copy.title,\n button_name: buttonName,\n info: id,\n },\n })\n callback()\n }\n return {\n actions: {\n [TaskType.Activate]: {\n finished: profile?.activated,\n notLogin: {\n buttonLabel: copy?.joinNow,\n handleClick: () =>\n handleClickWithTrack({ buttonName: copy?.joinNow, callback: openSignUpPopup, id: TaskType.Activate }),\n },\n notFinished: {\n buttonLabel: copy?.activate,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.activate,\n callback: () => activate.openAuthCodePopup(),\n id: TaskType.Activate,\n }),\n },\n completed: {\n buttonLabel: copy?.completed,\n },\n },\n [TaskType.Subscribe]: {\n finished: isSubscribed,\n notLogin: {\n buttonLabel: copy?.joinNow,\n handleClick: () =>\n handleClickWithTrack({ buttonName: copy?.joinNow, callback: openSignUpPopup, id: TaskType.Subscribe }),\n },\n notFinished: {\n buttonLabel: copy?.subscribe,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.subscribe,\n callback: () => subscribe.openSubscribePopup(),\n id: TaskType.Subscribe,\n }),\n },\n completed: {\n buttonLabel: copy?.completed,\n },\n },\n [TaskType.CompleteProfile]: {\n finished: profileCompleted,\n notLogin: {\n buttonLabel: copy?.joinNow,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.joinNow,\n callback: openSignUpPopup,\n id: TaskType.CompleteProfile,\n }),\n },\n notFinished: {\n buttonLabel: copy?.completeProfile,\n link: `/account/profile?app=${appName}`,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.completeProfile,\n callback: () => {},\n id: TaskType.CompleteProfile,\n }),\n },\n completed: {\n buttonLabel: copy?.completed,\n },\n },\n [TaskType.FirstPurchase]: {\n finished: firstPurchaseFinished,\n notLogin: {\n buttonLabel: copy?.makeFirstPurchase,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.makeFirstPurchase,\n callback: openSignUpPopup,\n id: TaskType.FirstPurchase,\n }),\n },\n notFinished: {\n buttonLabel: copy?.makeFirstPurchase,\n link: copy?.goShopLink,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.makeFirstPurchase,\n callback: () => {},\n id: TaskType.FirstPurchase,\n }),\n },\n completed: {\n buttonLabel: copy?.completed,\n },\n },\n [TaskType.UploadReceipt]: {\n finished: uploadedReceipt,\n notLogin: {\n buttonLabel: copy?.joinNow,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.joinNow,\n callback: openSignUpPopup,\n id: TaskType.UploadReceipt,\n }),\n },\n notFinished: {\n buttonLabel: copy?.uploadReceipt,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.uploadReceipt,\n callback: () => uploadReceipt.openUploadReceiptPopup(),\n id: TaskType.UploadReceipt,\n }),\n },\n completed: {\n buttonLabel: copy?.completed,\n },\n },\n [TaskType.Shop]: {\n finished: false,\n notLogin: {\n buttonLabel: copy?.joinNow,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.joinNow,\n callback: openSignUpPopup,\n id: TaskType.Shop,\n }),\n },\n notFinished: {\n buttonLabel: copy?.shopNow,\n link: copy?.goShopLink,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.shopNow,\n callback: () => {},\n id: TaskType.Shop,\n }),\n },\n completed: {\n buttonLabel: copy?.completed,\n },\n },\n },\n }\n }, [\n profile?.activated,\n copy?.joinNow,\n copy?.activate,\n copy?.completed,\n copy?.subscribe,\n copy?.completeProfile,\n copy?.makeFirstPurchase,\n copy?.uploadReceipt,\n copy?.shopNow,\n copy.title,\n copy?.goShopLink,\n isSubscribed,\n profileCompleted,\n firstPurchaseFinished,\n uploadedReceipt,\n gaParameters?.position,\n openSignUpPopup,\n ])\n}\n"],
5
- "mappings": "AAAA,OAAS,YAAAA,MAAgB,SACzB,OAAS,qBAAAC,MAAyB,sBAClC,OAAS,WAAAC,MAAe,QACxB,OAAOC,MAAwB,sCAC/B,OAAS,4BAAAC,MAAgC,4CACzC,OAAS,iBAAAC,MAAqB,iCAE9B,OAAS,qBAAAC,MAAyB,oBAClC,OAAS,WAAAC,MAAe,yBAEjB,MAAMC,EAAa,CAAC,CACzB,KAAAC,EACA,UAAAC,EACA,cAAAC,EACA,SAAAC,EACA,aAAAC,CACF,IAIM,CACJ,KAAM,CAAE,gBAAAC,EAAiB,IAAAC,EAAK,QAAAC,CAAQ,EAAIf,EAAkB,EACtDgB,EAAeZ,EAAc,EAC7Ba,EAAwBd,EAAyB,EACjDe,EAAkBhB,EAAmB,EACrC,CAAE,QAAAiB,CAAQ,EAAId,EAAkB,EAEhCe,EAAmBnB,EAAQ,KACvBc,GAAS,YAAcA,GAAS,YAAcA,GAAS,cAAgBA,GAAS,IACvF,CAACA,CAAO,CAAC,EAEZ,OAAOd,EAAQ,IAAM,CACnB,MAAMoB,EAAuB,CAAC,CAC5B,WAAAC,EACA,GAAAC,EACA,SAAAC,CACF,IAIM,CACJlB,EAAQ,CACN,MAAO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MACLA,GAAM,WACNQ,EACAI,EACAH,EACAC,EACAN,GAAc,SACdC,CACF,CAAC,CACH",
6
- "names": ["TaskType", "useCreditsContext", "useMemo", "useReceiptUploaded", "useFirstPurchaseFinished", "useSubscribed", "useShopifyContext", "gaTrack", "useActions", "copy", "subscribe", "uploadReceipt", "activate", "gaParameters", "openSignUpPopup", "gtm", "profile", "isSubscribed", "firstPurchaseFinished", "uploadedReceipt", "appName", "profileCompleted", "handleClickWithTrack", "buttonName", "id", "callback"]
4
+ "sourcesContent": ["import { useHeadlessContext, gaTrack } from '@anker-in/lib'\n\nimport { TaskType } from './type'\nimport { useCreditsContext } from '../context/provider'\nimport { useMemo } from 'react'\nimport useReceiptUploaded from '../context/hooks/useReceiptUploaded'\nimport { useFirstPurchaseFinished } from '../context/hooks/useFirstPurchaseFinished'\nimport { useSubscribed } from '../context/hooks/useSubscribed'\nimport type { CreditsWaysToGetCreditsCopy } from './type'\n\nimport { useRegistration } from '../../registration'\n\nexport const useActions = ({\n copy,\n subscribe,\n uploadReceipt,\n gaParameters,\n}: {\n copy: CreditsWaysToGetCreditsCopy\n subscribe: {\n openSubscribePopup: () => void\n isSuccess: boolean\n }\n uploadReceipt: {\n openUploadReceiptPopup: () => void\n isSuccess: boolean\n }\n gaParameters?: {\n position: string\n }\n}) => {\n const { openSignUpPopup, gtm, profile } = useCreditsContext()\n const { authCodeActivate } = useRegistration()\n const isSubscribed = useSubscribed()\n const firstPurchaseFinished = useFirstPurchaseFinished()\n const uploadedReceipt = useReceiptUploaded()\n const { appName, passportUrl } = useHeadlessContext()\n\n const profileCompleted = useMemo(() => {\n return (profile?.first_name || profile?.last_name) && profile?.phone_number && profile?.dob\n }, [profile])\n\n return useMemo(() => {\n const handleClickWithTrack = ({\n buttonName,\n id,\n callback,\n }: {\n buttonName: string\n id?: string\n callback: () => void\n }) => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'lp_button',\n member_active_status: profile?.activated ? 'active' : 'not active',\n event_parameters: {\n page_group: gtm.pageGroup,\n position: gaParameters?.position || copy.title,\n button_name: buttonName,\n info: id,\n },\n })\n callback()\n }\n return {\n actions: {\n [TaskType.Activate]: {\n finished: profile?.activated,\n notLogin: {\n buttonLabel: copy?.joinNow,\n handleClick: () =>\n handleClickWithTrack({ buttonName: copy?.joinNow, callback: openSignUpPopup, id: TaskType.Activate }),\n },\n notFinished: {\n buttonLabel: copy?.activate,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.activate,\n callback: () => {\n authCodeActivate.setAutoSendEmail(true)\n authCodeActivate.open()\n },\n id: TaskType.Activate,\n }),\n },\n completed: {\n buttonLabel: copy?.completed,\n },\n },\n [TaskType.Subscribe]: {\n finished: isSubscribed,\n notLogin: {\n buttonLabel: copy?.joinNow,\n handleClick: () =>\n handleClickWithTrack({ buttonName: copy?.joinNow, callback: openSignUpPopup, id: TaskType.Subscribe }),\n },\n notFinished: {\n buttonLabel: copy?.subscribeLabel,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.subscribeLabel,\n callback: () => subscribe.openSubscribePopup(),\n id: TaskType.Subscribe,\n }),\n },\n completed: {\n buttonLabel: copy?.completed,\n },\n },\n [TaskType.CompleteProfile]: {\n finished: profileCompleted,\n notLogin: {\n buttonLabel: copy?.joinNow,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.joinNow,\n callback: openSignUpPopup,\n id: TaskType.CompleteProfile,\n }),\n },\n notFinished: {\n buttonLabel: copy?.completeProfile,\n link: `${passportUrl}/account/profile?app=${appName}`,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.completeProfile,\n callback: () => {},\n id: TaskType.CompleteProfile,\n }),\n },\n completed: {\n buttonLabel: copy?.completed,\n },\n },\n [TaskType.FirstPurchase]: {\n finished: firstPurchaseFinished,\n notLogin: {\n buttonLabel: copy?.makeFirstPurchase,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.makeFirstPurchase,\n callback: openSignUpPopup,\n id: TaskType.FirstPurchase,\n }),\n },\n notFinished: {\n buttonLabel: copy?.makeFirstPurchase,\n link: copy?.goShopLink,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.makeFirstPurchase,\n callback: () => {},\n id: TaskType.FirstPurchase,\n }),\n },\n completed: {\n buttonLabel: copy?.completed,\n },\n },\n [TaskType.UploadReceipt]: {\n finished: uploadedReceipt,\n notLogin: {\n buttonLabel: copy?.joinNow,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.joinNow,\n callback: openSignUpPopup,\n id: TaskType.UploadReceipt,\n }),\n },\n notFinished: {\n buttonLabel: copy?.uploadReceipt,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.uploadReceipt,\n callback: () => uploadReceipt.openUploadReceiptPopup(),\n id: TaskType.UploadReceipt,\n }),\n },\n completed: {\n buttonLabel: copy?.completed,\n },\n },\n [TaskType.Shop]: {\n finished: false,\n notLogin: {\n buttonLabel: copy?.joinNow,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.joinNow,\n callback: openSignUpPopup,\n id: TaskType.Shop,\n }),\n },\n notFinished: {\n buttonLabel: copy?.shopNow,\n link: copy?.goShopLink,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.shopNow,\n callback: () => {},\n id: TaskType.Shop,\n }),\n },\n completed: {\n buttonLabel: copy?.completed,\n },\n },\n },\n }\n }, [\n profile?.activated,\n copy?.joinNow,\n copy?.activate,\n copy?.completed,\n copy?.subscribe,\n copy?.completeProfile,\n copy?.makeFirstPurchase,\n copy?.uploadReceipt,\n copy?.shopNow,\n copy.title,\n copy?.goShopLink,\n isSubscribed,\n profileCompleted,\n firstPurchaseFinished,\n uploadedReceipt,\n gaParameters?.position,\n openSignUpPopup,\n ])\n}\n"],
5
+ "mappings": "AAAA,OAAS,sBAAAA,EAAoB,WAAAC,MAAe,gBAE5C,OAAS,YAAAC,MAAgB,SACzB,OAAS,qBAAAC,MAAyB,sBAClC,OAAS,WAAAC,MAAe,QACxB,OAA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GAAM,QAClB,SAAUI,EACV,GAAIZ,EAAS,aACf,CAAC,CACL,EACA,YAAa,CACX,YAAaQ,GAAM,cACnB,YAAa,IACXc,EAAqB,CACnB,WAAYd,GAAM,cAClB,SAAU,IAAME,EAAc,uBAAuB,EACrD,GAAIV,EAAS,aACf,CAAC,CACL,EACA,UAAW,CACT,YAAaQ,GAAM,SACrB,CACF,EACA,CAACR,EAAS,IAAI,EAAG,CACf,SAAU,GACV,SAAU,CACR,YAAaQ,GAAM,QACnB,YAAa,IACXc,EAAqB,CACnB,WAAYd,GAAM,QAClB,SAAUI,EACV,GAAIZ,EAAS,IACf,CAAC,CACL,EACA,YAAa,CACX,YAAaQ,GAAM,QACnB,KAAMA,GAAM,WACZ,YAAa,IACXc,EAAqB,CACnB,WAAYd,GAAM,QAClB,SAAU,IAAM,CAAC,EACjB,GAAIR,EAAS,IACf,CAAC,CACL,EACA,UAAW,CACT,YAAaQ,GAAM,SACrB,CACF,CACF,CACF,CACF,EAAG,CACDM,GAAS,UACTN,GAAM,QACNA,GAAM,SACNA,GAAM,UACNA,GAAM,UACNA,GAAM,gBACNA,GAAM,kBACNA,GAAM,cACNA,GAAM,QACNA,EAAK,MACLA,GAAM,WACNQ,EACAK,EACAJ,EACAC,EACAP,GAAc,SACdC,CACF,CAAC,CACH",
6
+ "names": ["useHeadlessContext", "gaTrack", "TaskType", "useCreditsContext", "useMemo", "useReceiptUploaded", "useFirstPurchaseFinished", "useSubscribed", "useRegistration", "useActions", "copy", "subscribe", "uploadReceipt", "gaParameters", "openSignUpPopup", "gtm", "profile", "authCodeActivate", "isSubscribed", "firstPurchaseFinished", "uploadedReceipt", "appName", "passportUrl", "profileCompleted", "handleClickWithTrack", "buttonName", "id", "callback"]
7
7
  }
@@ -15,12 +15,15 @@ export interface MyRewardsMetafields {
15
15
  pendingTip: string;
16
16
  processingTip: string;
17
17
  ShippedTip: string;
18
- emptyListImageUrl: string;
19
18
  emptyListLabel: string;
20
19
  pointUnit: string;
21
20
  code: string;
22
21
  copied: string;
23
22
  copy: string;
23
+ emptyListImage: {
24
+ url: string;
25
+ alt?: string;
26
+ };
24
27
  }
25
28
  interface MyRewardsModalProps extends ModalContainerProps {
26
29
  data: MyRewardsMetafields;
@@ -1,2 +1,2 @@
1
- import{jsx as i,jsxs as r}from"react/jsx-runtime";import{Tabs as j,TabsList as E,TabsTrigger as $,Picture as z}from"@anker-in/headless-ui";import M from"classnames";import H from"copy-to-clipboard";import K from"dayjs";import{useCallback as w,useMemo as p,useState as u}from"react";import{ApprovalStatus as m,AlpcConsumeType as n,RewardType as t}from"../context/const";import{CreditsModalContainer as V}from"./modalContainer";import q from"./tip";import B from"./loadingDots";import S from"../context/hooks/useMyRewards";function G({data:o,...a}){const[l,R]=u(n.Coupon),[d,F]=u(1),[c,h]=u(1),[_,g]=u(-1),A=p(()=>{const e=[];return o.couponTab&&e.push({title:o.couponTab,type:n.Coupon}),o.productTab&&e.push({title:o.productTab,type:n.Product}),e},[o.couponTab,o.productTab]),D=p(()=>({page:a.isOpen?c:0,pageSize:1e3,consumeType:n.Product}),[a.isOpen,c]),O=p(()=>({page:a.isOpen?d:0,pageSize:1e3,consumeType:n.Coupon}),[a.isOpen,d]),{myRewards:v=[],canNext:b,isLoading:x}=S(O),{myRewards:y=[],canNext:C,isLoading:T}=S(D),N=p(()=>l===n.Coupon?v.map(e=>({title:e.goods_title,value:e.consume_credits,type:t.Received,date:new Date(e.create_time*1e3),couponCode:e.coupon_code,orderNumber:""})):l===n.Product?y.map(e=>{let s=t.Pending;return e.fulfillment_status&&e.fulfillment_status!=="null"?e.fulfillment_status==="fulfilled"?s=t.Fulfilled:s=t.Unfulfilled:e.approval_status===m.Success||e.approval_status===m.DoubleConfirm?s=t.ApproveSuccess:e.approval_status===m.Failed&&(s=t.Failed),{title:e.goods_title,value:e.consume_credits,type:s,date:new Date(e.create_time*1e3),orderNumber:e.order_number,couponCode:""}}):[],[l,y,v]),L=p(()=>l===n.Coupon?b:l===n.Product?C:!1,[l,b,C]),U=p(()=>({[t.Received]:o.receivedLabel,[t.Pending]:o.pendingLabel,[t.ApproveFail]:o.failedLabel,[t.ApproveSuccess]:o.approveSuccessLabel,[t.Unfulfilled]:o.unfulfilledLabel,[t.Fulfilled]:o.fulfilledLabel,[t.Failed]:o.failedLabel}),[o]),P=p(()=>({[t.Received]:"",[t.Pending]:o.pendingTip,[t.ApproveFail]:"",[t.ApproveSuccess]:o.confirmedTip,[t.Unfulfilled]:o.processingTip,[t.Fulfilled]:o.ShippedTip,[t.Failed]:""}),[o]),k=p(()=>({[t.Received]:"#52C41A",[t.Pending]:"#999",[t.ApproveFail]:"#F84D4F",[t.ApproveSuccess]:"#999",[t.Unfulfilled]:"#999",[t.Fulfilled]:"#999",[t.Failed]:"#F84D4F"}),[]),I=w(()=>{L&&(l===n.Coupon?F(d+1):l===n.Product&&h(c+1))},[l,c,d,L]),Y=w((e,s)=>{g(s),H(e),setTimeout(()=>{g(-1)},2e3)},[]);return r(V,{title:o.title,className:M("h-[800px] w-[640px]"),useAnimation:!0,animationClassName:"md:translate-y-[100vh]",scrollClassName:"min-l:px-0 md:mb-0 md:px-0",...a,onScrollEnd:I,children:[i("div",{className:"px-[24px] md:px-[16px]",children:i(j,{align:"left",shape:"rounded",value:l.toString(),onValueChange:e=>{R(Number(e))},children:i(E,{children:A.map(e=>i($,{value:e.type.toString(),children:e.title},e.type))})})}),r("div",{className:"mt-[24px] overflow-auto overscroll-contain px-[24px] md:px-[16px]",children:[!N.length&&!x&&!T&&r("div",{className:"flex h-full flex-col items-center justify-center",children:[i(z,{className:"mb-[12px] w-[160px]",src:o?.emptyListImageUrl}),i("div",{className:"text-[16px] font-semibold leading-[1.4]",children:o?.emptyListLabel})]}),x||T&&i("div",{className:"flex h-full flex-col items-center justify-center",children:i(B,{})}),i("div",{className:"grid gap-[18px] md:gap-[12px]",children:N.map((e,s)=>r("div",{className:"grid gap-[8px]",children:[e?.orderNumber&&r("div",{className:"text-[15px] font-semibold leading-[1.4] text-[#777]",children:[o.orderNumberLabel,": ",e.orderNumber]}),r("div",{className:"flex items-center justify-between rounded-[8px] bg-[#f7f8f9] px-[16px] py-[20px]",children:[r("div",{className:"grid gap-[4px]",children:[i("div",{className:"text-[16px] font-bold leading-[1.4]",children:e.title}),r("div",{className:"text-[14px] font-semibold text-[#999]",children:[o.valueLabel,": ",e.value," ",o?.pointUnit]}),r("div",{className:"text-[14px] font-semibold text-[#999]",children:[e?.couponCode?`${o?.code||"Code"}: ${e.couponCode} `:"",e?.couponCode&&i("span",{className:"cursor-pointer text-[14px] font-semibold text-brand underline",onClick:()=>{Y(e.couponCode,s)},role:"button",tabIndex:0,onKeyDown:f=>{(f.key==="Enter"||f.key===" ")&&f.preventDefault()},children:_===s?o?.copied||"COPIED":o?.copy||"COPY"})]})]}),r("div",{className:"grid gap-[4px] text-right",children:[r("div",{className:M("flex items-center justify-end text-[16px] font-bold leading-[1.4]",`text-[${k[e.type]}]`),children:[i("span",{children:U[e.type]}),P[e.type]&&i(q,{info:P[e.type],index:s})]}),i("div",{className:"text-[14px] font-semibold text-[#999]",children:K(e.date).format("YYYY-MM-DD HH:mm").toString()})]})]})]},s))})]})]})}var ne=G;export{ne as default};
1
+ import{jsx as s,jsxs as l}from"react/jsx-runtime";import{Tabs as $,TabsList as z,TabsTrigger as q,Picture as B}from"@anker-in/headless-ui";import m from"classnames";import K from"copy-to-clipboard";import V from"dayjs";import{useCallback as w,useMemo as p,useState as c}from"react";import{ApprovalStatus as g,AlpcConsumeType as n,RewardType as t}from"../context/const";import{CreditsModalContainer as G}from"./modalContainer";import J from"./tip";import Q from"./loadingDots";import R from"../context/hooks/useMyRewards";import{useHeadlessContext as W,ROUNDED_BRANDS as X}from"@anker-in/lib";function Z({data:o,...a}){const[r,S]=c(n.Coupon),{brand:F}=W(),b=X.includes(F),[d,_]=c(1),[u,h]=c(1),[D,v]=c(-1),A=p(()=>{const e=[];return o.couponTab&&e.push({title:o.couponTab,type:n.Coupon}),o.productTab&&e.push({title:o.productTab,type:n.Product}),e},[o.couponTab,o.productTab]),O=p(()=>({page:a.isOpen?u:0,pageSize:1e3,consumeType:n.Product}),[a.isOpen,u]),I=p(()=>({page:a.isOpen?d:0,pageSize:1e3,consumeType:n.Coupon}),[a.isOpen,d]),{myRewards:x=[],canNext:y,isLoading:U}=R(I),{myRewards:C=[],canNext:N,isLoading:k}=R(O),T=p(()=>r===n.Coupon?x.map(e=>({title:e.goods_title,value:e.consume_credits,type:t.Received,date:new Date(e.create_time*1e3),couponCode:e.coupon_code,orderNumber:""})):r===n.Product?C.map(e=>{let i=t.Pending;return e.fulfillment_status&&e.fulfillment_status!=="null"?e.fulfillment_status==="fulfilled"?i=t.Fulfilled:i=t.Unfulfilled:e.approval_status===g.Success||e.approval_status===g.DoubleConfirm?i=t.ApproveSuccess:e.approval_status===g.Failed&&(i=t.Failed),{title:e.goods_title,value:e.consume_credits,type:i,date:new Date(e.create_time*1e3),orderNumber:e.order_number,couponCode:""}}):[],[r,C,x]),L=p(()=>r===n.Coupon?y:r===n.Product?N:!1,[r,y,N]),E=p(()=>({[t.Received]:o.receivedLabel,[t.Pending]:o.pendingLabel,[t.ApproveFail]:o.failedLabel,[t.ApproveSuccess]:o.approveSuccessLabel,[t.Unfulfilled]:o.unfulfilledLabel,[t.Fulfilled]:o.fulfilledLabel,[t.Failed]:o.failedLabel}),[o]),P=p(()=>({[t.Received]:"",[t.Pending]:o.pendingTip,[t.ApproveFail]:"",[t.ApproveSuccess]:o.confirmedTip,[t.Unfulfilled]:o.processingTip,[t.Fulfilled]:o.ShippedTip,[t.Failed]:""}),[o]),Y=p(()=>({[t.Received]:"#52C41A",[t.Pending]:"#999",[t.ApproveFail]:"#F84D4F",[t.ApproveSuccess]:"#999",[t.Unfulfilled]:"#999",[t.Fulfilled]:"#999",[t.Failed]:"#F84D4F"}),[]),j=w(()=>{L&&(r===n.Coupon?_(d+1):r===n.Product&&h(u+1))},[r,u,d,L]),H=w((e,i)=>{v(i),K(e),setTimeout(()=>{v(-1)},2e3)},[]),M=r===n.Coupon?U:k;return l(G,{title:o.title,className:m("h-[800px] w-[640px]"),useAnimation:!0,animationClassName:"md:translate-y-[100vh]",scrollClassName:"md:mb-0",...a,onScrollEnd:j,children:[s("div",{className:"",children:s($,{align:"left",shape:b?"rounded":"square",value:r.toString(),onValueChange:e=>{S(Number(e))},children:s(z,{children:A.map(e=>s(q,{value:e.type.toString(),children:e.title},e.type))})})}),M&&s("div",{className:"flex h-full flex-col items-center justify-center",children:s(Q,{})}),!M&&s("div",{className:"mt-[24px] overflow-auto overscroll-contain",children:T.length>0?s("div",{className:"grid gap-[18px] md:gap-[12px]",children:T.map((e,i)=>l("div",{className:"grid gap-[8px]",children:[e?.orderNumber&&l("div",{className:"text-[15px] font-semibold leading-[1.4] text-[#777]",children:[o.orderNumberLabel,": ",e.orderNumber]}),l("div",{className:m("flex items-center justify-between rounded-[8px] bg-[#f7f8f9] px-[16px] py-[20px]",!b&&"rounded-none"),children:[l("div",{className:"grid gap-[4px]",children:[s("div",{className:"text-[16px] font-bold leading-[1.4]",children:e.title}),l("div",{className:"text-[14px] font-semibold text-[#999]",children:[o.valueLabel,": ",e.value," ",o?.pointUnit]}),l("div",{className:"text-[14px] font-semibold text-[#999]",children:[e?.couponCode?`${o?.code||"Code"}: ${e.couponCode} `:"",e?.couponCode&&s("span",{className:"cursor-pointer text-[14px] font-semibold text-brand underline",onClick:()=>{H(e.couponCode,i)},role:"button",tabIndex:0,onKeyDown:f=>{(f.key==="Enter"||f.key===" ")&&f.preventDefault()},children:D===i?o?.copied||"COPIED":o?.copy||"COPY"})]})]}),l("div",{className:"grid gap-[4px] text-right",children:[l("div",{className:m("flex items-center justify-end text-[16px] font-bold leading-[1.4]",`text-[${Y[e.type]}]`),children:[s("span",{children:E[e.type]}),P[e.type]&&s(J,{info:P[e.type],index:i})]}),s("div",{className:"text-[14px] font-semibold text-[#999]",children:V(e.date).format("YYYY-MM-DD HH:mm").toString()})]})]})]},i))}):l("div",{className:"flex h-full flex-col items-center justify-center",children:[s(B,{className:"mb-[12px] w-[160px]",source:o?.emptyListImage?.url,alt:o?.emptyListImage?.alt||"empty list image"}),s("div",{className:"text-[16px] font-semibold leading-[1.4]",children:o?.emptyListLabel})]})})]})}var ue=Z;export{ue as default};
2
2
  //# sourceMappingURL=MyRewardsModal.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/components/credits/modal/MyRewardsModal.tsx"],
4
- "sourcesContent": ["import { Tabs, TabsList, TabsTrigger, Picture } from '@anker-in/headless-ui'\nimport classNames from 'classnames'\nimport clipboard from 'copy-to-clipboard'\nimport dayjs from 'dayjs'\nimport { useCallback, useMemo, useState } from 'react'\n\nimport { ApprovalStatus, AlpcConsumeType, RewardType } from '../context/const'\nimport { CreditsModalContainer, type ModalContainerProps } from './modalContainer'\nimport Tip from './tip'\nimport LoadingDots from './loadingDots'\nimport useMyRewards from '../context/hooks/useMyRewards'\n\nexport interface MyRewardsMetafields {\n title: string\n orderNumberLabel: string\n valueLabel: string\n receivedLabel: string\n failedLabel: string\n approveSuccessLabel: string\n couponTab: string\n productTab: string\n pendingLabel: string\n unfulfilledLabel: string\n fulfilledLabel: string\n confirmedTip: string\n pendingTip: string\n processingTip: string\n ShippedTip: string\n emptyListImageUrl: string\n emptyListLabel: string\n pointUnit: string\n code: string\n copied: string\n copy: string\n}\ninterface MyRewardsModalProps extends ModalContainerProps {\n data: MyRewardsMetafields\n}\n\nfunction MyRewardsModal({ data, ...props }: MyRewardsModalProps) {\n const [activeTab, setActiveTab] = useState(AlpcConsumeType.Coupon)\n\n const [couponPage, setCouponPage] = useState(1)\n const [productPage, setProductPage] = useState(1)\n const [copied, setCopied] = useState(-1)\n\n const tabs = useMemo(() => {\n const availableTabs: { title: string; type: number }[] = []\n\n if (data.couponTab) {\n availableTabs.push({\n title: data.couponTab,\n type: AlpcConsumeType.Coupon,\n })\n }\n\n if (data.productTab) {\n availableTabs.push({\n title: data.productTab,\n type: AlpcConsumeType.Product,\n })\n }\n\n return availableTabs\n }, [data.couponTab, data.productTab])\n\n const myProductRewardsOptions = useMemo(() => {\n return {\n page: props.isOpen ? productPage : 0,\n pageSize: 1000,\n consumeType: AlpcConsumeType.Product,\n }\n }, [props.isOpen, productPage])\n const myCouponRewardsOptions = useMemo(() => {\n return {\n page: props.isOpen ? couponPage : 0,\n pageSize: 1000,\n consumeType: AlpcConsumeType.Coupon,\n }\n }, [props.isOpen, couponPage])\n\n const {\n myRewards: myCouponRewards = [],\n canNext: couponCanNext,\n isLoading: couponIsLoading,\n } = useMyRewards(myCouponRewardsOptions)\n const {\n myRewards: myProductRewards = [],\n canNext: productCanNext,\n isLoading: productIsLoading,\n } = useMyRewards(myProductRewardsOptions)\n\n const list = useMemo(() => {\n if (activeTab === AlpcConsumeType.Coupon) {\n return myCouponRewards.map(item => ({\n title: item.goods_title,\n value: item.consume_credits,\n type: RewardType.Received,\n date: new Date(item.create_time * 1000),\n couponCode: item.coupon_code,\n orderNumber: '',\n }))\n }\n\n if (activeTab === AlpcConsumeType.Product) {\n return myProductRewards.map(item => {\n let type = RewardType.Pending\n\n if (item.fulfillment_status && item.fulfillment_status !== 'null') {\n // \u7269\u6D41\u72B6\u6001\n if (item.fulfillment_status === 'fulfilled') {\n type = RewardType.Fulfilled\n } else {\n type = RewardType.Unfulfilled\n }\n } else {\n if (\n item.approval_status === ApprovalStatus.Success ||\n item.approval_status === ApprovalStatus.DoubleConfirm\n ) {\n type = RewardType.ApproveSuccess\n } else if (item.approval_status === ApprovalStatus.Failed) {\n type = RewardType.Failed\n }\n }\n\n return {\n title: item.goods_title,\n value: item.consume_credits,\n type,\n date: new Date(item.create_time * 1000),\n orderNumber: item.order_number,\n couponCode: '',\n }\n })\n }\n\n return []\n }, [activeTab, myProductRewards, myCouponRewards])\n\n const canNext = useMemo(() => {\n if (activeTab === AlpcConsumeType.Coupon) {\n return couponCanNext\n }\n\n if (activeTab === AlpcConsumeType.Product) {\n return productCanNext\n }\n\n return false\n }, [activeTab, couponCanNext, productCanNext])\n\n const TypeMap = useMemo(() => {\n return {\n [RewardType.Received]: data.receivedLabel,\n [RewardType.Pending]: data.pendingLabel,\n [RewardType.ApproveFail]: data.failedLabel,\n [RewardType.ApproveSuccess]: data.approveSuccessLabel,\n [RewardType.Unfulfilled]: data.unfulfilledLabel,\n [RewardType.Fulfilled]: data.fulfilledLabel,\n [RewardType.Failed]: data.failedLabel,\n }\n }, [data])\n\n const TipMap = useMemo(() => {\n return {\n [RewardType.Received]: '',\n [RewardType.Pending]: data.pendingTip,\n [RewardType.ApproveFail]: '',\n [RewardType.ApproveSuccess]: data.confirmedTip,\n [RewardType.Unfulfilled]: data.processingTip,\n [RewardType.Fulfilled]: data.ShippedTip,\n [RewardType.Failed]: '',\n }\n }, [data])\n\n const ColorMap = useMemo(() => {\n return {\n [RewardType.Received]: '#52C41A',\n [RewardType.Pending]: '#999',\n [RewardType.ApproveFail]: '#F84D4F',\n [RewardType.ApproveSuccess]: '#999',\n [RewardType.Unfulfilled]: '#999',\n [RewardType.Fulfilled]: '#999',\n [RewardType.Failed]: '#F84D4F',\n }\n }, [])\n\n const handleScrollEnd = useCallback(() => {\n if (!canNext) {\n return\n }\n\n if (activeTab === AlpcConsumeType.Coupon) {\n setCouponPage(couponPage + 1)\n } else if (activeTab === AlpcConsumeType.Product) {\n setProductPage(productPage + 1)\n }\n }, [activeTab, productPage, couponPage, canNext])\n\n const handleCopy = useCallback((code: string, idx: number) => {\n setCopied(idx)\n clipboard(code)\n setTimeout(() => {\n setCopied(-1)\n }, 2000)\n }, [])\n\n return (\n <CreditsModalContainer\n title={data.title}\n className={classNames('h-[800px] w-[640px]')}\n useAnimation\n animationClassName=\"md:translate-y-[100vh]\"\n scrollClassName=\"min-l:px-0 md:mb-0 md:px-0\"\n {...props}\n onScrollEnd={handleScrollEnd}\n >\n <div className=\"px-[24px] md:px-[16px]\">\n <Tabs\n align=\"left\"\n shape=\"rounded\"\n value={activeTab.toString()}\n onValueChange={value => {\n setActiveTab(Number(value))\n }}\n >\n <TabsList>\n {tabs.map(tab => (\n <TabsTrigger key={tab.type} value={tab.type.toString()}>\n {tab.title}\n </TabsTrigger>\n ))}\n </TabsList>\n </Tabs>\n </div>\n\n <div className=\"mt-[24px] overflow-auto overscroll-contain px-[24px] md:px-[16px]\">\n {!list.length && !couponIsLoading && !productIsLoading && (\n <div className=\"flex h-full flex-col items-center justify-center\">\n <Picture className=\"mb-[12px] w-[160px]\" src={data?.emptyListImageUrl}></Picture>\n <div className=\"text-[16px] font-semibold leading-[1.4]\">{data?.emptyListLabel}</div>\n </div>\n )}\n {couponIsLoading ||\n (productIsLoading && (\n <div className=\"flex h-full flex-col items-center justify-center\">\n <LoadingDots />\n </div>\n ))}\n <div className=\"grid gap-[18px] md:gap-[12px]\">\n {list.map((item, index) => (\n <div key={index} className=\"grid gap-[8px]\">\n {item?.orderNumber && (\n <div className=\"text-[15px] font-semibold leading-[1.4] text-[#777]\">\n {data.orderNumberLabel}: {item.orderNumber}\n </div>\n )}\n <div className=\"flex items-center justify-between rounded-[8px] bg-[#f7f8f9] px-[16px] py-[20px]\">\n <div className=\"grid gap-[4px]\">\n <div className=\"text-[16px] font-bold leading-[1.4]\">{item.title}</div>\n <div className=\"text-[14px] font-semibold text-[#999]\">\n {data.valueLabel}: {item.value} {data?.pointUnit}\n </div>\n <div className=\"text-[14px] font-semibold text-[#999]\">\n {item?.couponCode ? `${data?.code || 'Code'}: ${item.couponCode} ` : ''}\n {item?.couponCode && (\n <span\n className=\"cursor-pointer text-[14px] font-semibold text-brand underline\"\n onClick={() => {\n handleCopy(item.couponCode, index)\n }}\n role=\"button\"\n tabIndex={0}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n }\n }}\n >\n {copied === index ? data?.copied || 'COPIED' : data?.copy || 'COPY'}\n </span>\n )}\n </div>\n </div>\n <div className=\"grid gap-[4px] text-right\">\n <div\n className={classNames(\n 'flex items-center justify-end text-[16px] font-bold leading-[1.4]',\n `text-[${ColorMap[item.type]}]`\n )}\n >\n <span>{TypeMap[item.type]}</span>\n {TipMap[item.type] && <Tip info={TipMap[item.type]} index={index} />}\n </div>\n <div className=\"text-[14px] font-semibold text-[#999]\">\n {dayjs(item.date).format('YYYY-MM-DD HH:mm').toString()}\n </div>\n </div>\n </div>\n </div>\n ))}\n </div>\n </div>\n </CreditsModalContainer>\n )\n}\n\nexport default MyRewardsModal\n"],
5
- "mappings": "AAqOc,cAAAA,EAUJ,QAAAC,MAVI,oBArOd,OAAS,QAAAC,EAAM,YAAAC,EAAU,eAAAC,EAAa,WAAAC,MAAe,wBACrD,OAAOC,MAAgB,aACvB,OAAOC,MAAe,oBACtB,OAAOC,MAAW,QAClB,OAAS,eAAAC,EAAa,WAAAC,EAAS,YAAAC,MAAgB,QAE/C,OAAS,kBAAAC,EAAgB,mBAAAC,EAAiB,cAAAC,MAAkB,mBAC5D,OAAS,yBAAAC,MAAuD,mBAChE,OAAOC,MAAS,QAChB,OAAOC,MAAiB,gBACxB,OAAOC,MAAkB,gCA6BzB,SAASC,EAAe,CAAE,KAAAC,EAAM,GAAGC,CAAM,EAAwB,CAC/D,KAAM,CAACC,EAAWC,CAAY,EAAIZ,EAASE,EAAgB,MAAM,EAE3D,CAACW,EAAYC,CAAa,EAAId,EAAS,CAAC,EACxC,CAACe,EAAaC,CAAc,EAAIhB,EAAS,CAAC,EAC1C,CAACiB,EAAQC,CAAS,EAAIlB,EAAS,EAAE,EAEjCmB,EAAOpB,EAAQ,IAAM,CACzB,MAAMqB,EAAmD,CAAC,EAE1D,OAAIX,EAAK,WACPW,EAAc,KAAK,CACjB,MAAOX,EAAK,UACZ,KAAMP,EAAgB,MACxB,CAAC,EAGCO,EAAK,YACPW,EAAc,KAAK,CACjB,MAAOX,EAAK,WACZ,KAAMP,EAAgB,OACxB,CAAC,EAGIkB,CACT,EAAG,CAACX,EAAK,UAAWA,EAAK,UAAU,CAAC,EAE9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AmB,EAAK,WAAW,KAAGqB,EAAK,MAAM,IAAErB,GAAM,WACzC,EACAnB,EAAC,OAAI,UAAU,wCACZ,UAAAwC,GAAM,WAAa,GAAGrB,GAAM,MAAQ,MAAM,KAAKqB,EAAK,UAAU,IAAM,GACpEA,GAAM,YACLzC,EAAC,QACC,UAAU,gEACV,QAAS,IAAM,CACbgD,EAAWP,EAAK,WAAYY,CAAK,CACnC,EACA,KAAK,SACL,SAAU,EACV,UAAWC,GAAK,EACVA,EAAE,MAAQ,SAAWA,EAAE,MAAQ,MACjCA,EAAE,eAAe,CAErB,EAEC,SAAA1B,IAAWyB,EAAQjC,GAAM,QAAU,SAAWA,GAAM,MAAQ,OAC/D,GAEJ,GACF,EACAnB,EAAC,OAAI,UAAU,4BACb,UAAAA,EAAC,OACC,UAAWK,EACT,oEACA,SAASwC,EAASL,EAAK,IAAI,CAAC,GAC9B,EAEA,UAAAzC,EAAC,QAAM,SAAA4C,EAAQH,EAAK,IAAI,EAAE,EACzBI,EAAOJ,EAAK,IAAI,GAAKzC,EAACgB,EAAA,CAAI,KAAM6B,EAAOJ,EAAK,IAAI,EAAG,MAAOY,EAAO,GACpE,EACArD,EAAC,OAAI,UAAU,wCACZ,SAAAQ,EAAMiC,EAAK,IAAI,EAAE,OAAO,kBAAkB,EAAE,SAAS,EACxD,GACF,GACF,IA/CQY,CAgDV,CACD,EACH,GACF,GACF,CAEJ,CAEA,IAAOE,GAAQpC",
6
- "names": ["jsx", "jsxs", "Tabs", "TabsList", "TabsTrigger", "Picture", "classNames", "clipboard", "dayjs", "useCallback", "useMemo", "useState", "ApprovalStatus", "AlpcConsumeType", "RewardType", "CreditsModalContainer", "Tip", "LoadingDots", "useMyRewards", "MyRewardsModal", "data", "props", "activeTab", "setActiveTab", "couponPage", "setCouponPage", "productPage", "setProductPage", "copied", "setCopied", "tabs", "availableTabs", "myProductRewardsOptions", "myCouponRewardsOptions", "myCouponRewards", "couponCanNext", "couponIsLoading", "myProductRewards", "productCanNext", "productIsLoading", "list", "item", "type", "canNext", "TypeMap", "TipMap", "ColorMap", "handleScrollEnd", "handleCopy", "code", "idx", "value", "tab", "index", "e", "MyRewardsModal_default"]
4
+ "sourcesContent": ["import { Tabs, TabsList, TabsTrigger, Picture } from '@anker-in/headless-ui'\nimport classNames from 'classnames'\nimport clipboard from 'copy-to-clipboard'\nimport dayjs from 'dayjs'\nimport { useCallback, useMemo, useState } from 'react'\n\nimport { ApprovalStatus, AlpcConsumeType, RewardType } from '../context/const'\nimport { CreditsModalContainer, type ModalContainerProps } from './modalContainer'\nimport Tip from './tip'\nimport LoadingDots from './loadingDots'\nimport useMyRewards from '../context/hooks/useMyRewards'\nimport { useHeadlessContext, ROUNDED_BRANDS } from '@anker-in/lib'\n\nexport interface MyRewardsMetafields {\n title: string\n orderNumberLabel: string\n valueLabel: string\n receivedLabel: string\n failedLabel: string\n approveSuccessLabel: string\n couponTab: string\n productTab: string\n pendingLabel: string\n unfulfilledLabel: string\n fulfilledLabel: string\n confirmedTip: string\n pendingTip: string\n processingTip: string\n ShippedTip: string\n emptyListLabel: string\n pointUnit: string\n code: string\n copied: string\n copy: string\n emptyListImage: {\n url: string\n alt?: string\n }\n}\ninterface MyRewardsModalProps extends ModalContainerProps {\n data: MyRewardsMetafields\n}\n\nfunction MyRewardsModal({ data, ...props }: MyRewardsModalProps) {\n const [activeTab, setActiveTab] = useState(AlpcConsumeType.Coupon)\n const { brand } = useHeadlessContext()\n const rounded = ROUNDED_BRANDS.includes(brand)\n\n const [couponPage, setCouponPage] = useState(1)\n const [productPage, setProductPage] = useState(1)\n const [copied, setCopied] = useState(-1)\n\n const tabs = useMemo(() => {\n const availableTabs: { title: string; type: number }[] = []\n\n if (data.couponTab) {\n availableTabs.push({\n title: data.couponTab,\n type: AlpcConsumeType.Coupon,\n })\n }\n\n if (data.productTab) {\n availableTabs.push({\n title: data.productTab,\n type: AlpcConsumeType.Product,\n })\n }\n\n return availableTabs\n }, [data.couponTab, data.productTab])\n\n const myProductRewardsOptions = useMemo(() => {\n return {\n page: props.isOpen ? productPage : 0,\n pageSize: 1000,\n consumeType: AlpcConsumeType.Product,\n }\n }, [props.isOpen, productPage])\n const myCouponRewardsOptions = useMemo(() => {\n return {\n page: props.isOpen ? couponPage : 0,\n pageSize: 1000,\n consumeType: AlpcConsumeType.Coupon,\n }\n }, [props.isOpen, couponPage])\n\n const {\n myRewards: myCouponRewards = [],\n canNext: couponCanNext,\n isLoading: couponIsLoading,\n } = useMyRewards(myCouponRewardsOptions)\n const {\n myRewards: myProductRewards = [],\n canNext: productCanNext,\n isLoading: productIsLoading,\n } = useMyRewards(myProductRewardsOptions)\n\n const list = useMemo(() => {\n if (activeTab === AlpcConsumeType.Coupon) {\n return myCouponRewards.map(item => ({\n title: item.goods_title,\n value: item.consume_credits,\n type: RewardType.Received,\n date: new Date(item.create_time * 1000),\n couponCode: item.coupon_code,\n orderNumber: '',\n }))\n }\n\n if (activeTab === AlpcConsumeType.Product) {\n return myProductRewards.map(item => {\n let type = RewardType.Pending\n\n if (item.fulfillment_status && item.fulfillment_status !== 'null') {\n // \u7269\u6D41\u72B6\u6001\n if (item.fulfillment_status === 'fulfilled') {\n type = RewardType.Fulfilled\n } else {\n type = RewardType.Unfulfilled\n }\n } else {\n if (\n item.approval_status === ApprovalStatus.Success ||\n item.approval_status === ApprovalStatus.DoubleConfirm\n ) {\n type = RewardType.ApproveSuccess\n } else if (item.approval_status === ApprovalStatus.Failed) {\n type = RewardType.Failed\n }\n }\n\n return {\n title: item.goods_title,\n value: item.consume_credits,\n type,\n date: new Date(item.create_time * 1000),\n orderNumber: item.order_number,\n couponCode: '',\n }\n })\n }\n\n return []\n }, [activeTab, myProductRewards, myCouponRewards])\n\n const canNext = useMemo(() => {\n if (activeTab === AlpcConsumeType.Coupon) {\n return couponCanNext\n }\n\n if (activeTab === AlpcConsumeType.Product) {\n return productCanNext\n }\n\n return false\n }, [activeTab, couponCanNext, productCanNext])\n\n const TypeMap = useMemo(() => {\n return {\n [RewardType.Received]: data.receivedLabel,\n [RewardType.Pending]: data.pendingLabel,\n [RewardType.ApproveFail]: data.failedLabel,\n [RewardType.ApproveSuccess]: data.approveSuccessLabel,\n [RewardType.Unfulfilled]: data.unfulfilledLabel,\n [RewardType.Fulfilled]: data.fulfilledLabel,\n [RewardType.Failed]: data.failedLabel,\n }\n }, [data])\n\n const TipMap = useMemo(() => {\n return {\n [RewardType.Received]: '',\n [RewardType.Pending]: data.pendingTip,\n [RewardType.ApproveFail]: '',\n [RewardType.ApproveSuccess]: data.confirmedTip,\n [RewardType.Unfulfilled]: data.processingTip,\n [RewardType.Fulfilled]: data.ShippedTip,\n [RewardType.Failed]: '',\n }\n }, [data])\n\n const ColorMap = useMemo(() => {\n return {\n [RewardType.Received]: '#52C41A',\n [RewardType.Pending]: '#999',\n [RewardType.ApproveFail]: '#F84D4F',\n [RewardType.ApproveSuccess]: '#999',\n [RewardType.Unfulfilled]: '#999',\n [RewardType.Fulfilled]: '#999',\n [RewardType.Failed]: '#F84D4F',\n }\n }, [])\n\n const handleScrollEnd = useCallback(() => {\n if (!canNext) {\n return\n }\n\n if (activeTab === AlpcConsumeType.Coupon) {\n setCouponPage(couponPage + 1)\n } else if (activeTab === AlpcConsumeType.Product) {\n setProductPage(productPage + 1)\n }\n }, [activeTab, productPage, couponPage, canNext])\n\n const handleCopy = useCallback((code: string, idx: number) => {\n setCopied(idx)\n clipboard(code)\n setTimeout(() => {\n setCopied(-1)\n }, 2000)\n }, [])\n\n const isLoading = activeTab === AlpcConsumeType.Coupon ? couponIsLoading : productIsLoading\n\n return (\n <CreditsModalContainer\n title={data.title}\n className={classNames('h-[800px] w-[640px]')}\n useAnimation\n animationClassName=\"md:translate-y-[100vh]\"\n scrollClassName=\"md:mb-0\"\n {...props}\n onScrollEnd={handleScrollEnd}\n >\n <div className=\"\">\n <Tabs\n align=\"left\"\n shape={rounded ? 'rounded' : 'square'}\n value={activeTab.toString()}\n onValueChange={value => {\n setActiveTab(Number(value))\n }}\n >\n <TabsList>\n {tabs.map(tab => (\n <TabsTrigger key={tab.type} value={tab.type.toString()}>\n {tab.title}\n </TabsTrigger>\n ))}\n </TabsList>\n </Tabs>\n </div>\n\n {isLoading && (\n <div className=\"flex h-full flex-col items-center justify-center\">\n <LoadingDots />\n </div>\n )}\n\n {!isLoading && (\n <div className=\"mt-[24px] overflow-auto overscroll-contain\">\n {list.length > 0 ? (\n <div className=\"grid gap-[18px] md:gap-[12px]\">\n {list.map((item, index) => (\n <div key={index} className=\"grid gap-[8px]\">\n {item?.orderNumber && (\n <div className=\"text-[15px] font-semibold leading-[1.4] text-[#777]\">\n {data.orderNumberLabel}: {item.orderNumber}\n </div>\n )}\n <div\n className={classNames(\n 'flex items-center justify-between rounded-[8px] bg-[#f7f8f9] px-[16px] py-[20px]',\n !rounded && 'rounded-none'\n )}\n >\n <div className=\"grid gap-[4px]\">\n <div className=\"text-[16px] font-bold leading-[1.4]\">{item.title}</div>\n <div className=\"text-[14px] font-semibold text-[#999]\">\n {data.valueLabel}: {item.value} {data?.pointUnit}\n </div>\n <div className=\"text-[14px] font-semibold text-[#999]\">\n {item?.couponCode ? `${data?.code || 'Code'}: ${item.couponCode} ` : ''}\n {item?.couponCode && (\n <span\n className=\"cursor-pointer text-[14px] font-semibold text-brand underline\"\n onClick={() => {\n handleCopy(item.couponCode, index)\n }}\n role=\"button\"\n tabIndex={0}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n }\n }}\n >\n {copied === index ? data?.copied || 'COPIED' : data?.copy || 'COPY'}\n </span>\n )}\n </div>\n </div>\n <div className=\"grid gap-[4px] text-right\">\n <div\n className={classNames(\n 'flex items-center justify-end text-[16px] font-bold leading-[1.4]',\n `text-[${ColorMap[item.type]}]`\n )}\n >\n <span>{TypeMap[item.type]}</span>\n {TipMap[item.type] && <Tip info={TipMap[item.type]} index={index} />}\n </div>\n <div className=\"text-[14px] font-semibold text-[#999]\">\n {dayjs(item.date).format('YYYY-MM-DD HH:mm').toString()}\n </div>\n </div>\n </div>\n </div>\n ))}\n </div>\n ) : (\n <div className=\"flex h-full flex-col items-center justify-center\">\n <Picture\n className=\"mb-[12px] w-[160px]\"\n source={data?.emptyListImage?.url}\n alt={data?.emptyListImage?.alt || 'empty list image'}\n ></Picture>\n <div className=\"text-[16px] font-semibold leading-[1.4]\">{data?.emptyListLabel}</div>\n </div>\n )}\n </div>\n )}\n </CreditsModalContainer>\n )\n}\n\nexport default MyRewardsModal\n"],
5
+ "mappings": "AA6Oc,cAAAA,EAqBM,QAAAC,MArBN,oBA7Od,OAAS,QAAAC,EAAM,YAAAC,EAAU,eAAAC,EAAa,WAAAC,MAAe,wBACrD,OAAOC,MAAgB,aACvB,OAAOC,MAAe,oBACtB,OAAOC,MAAW,QAClB,OAAS,eAAAC,EAAa,WAAAC,EAAS,YAAAC,MAAgB,QAE/C,OAAS,kBAAAC,EAAgB,mBAAAC,EAAiB,cAAAC,MAAkB,mBAC5D,OAAS,yBAAAC,MAAuD,mBAChE,OAAOC,MAAS,QAChB,OAAOC,MAAiB,gBACxB,OAAOC,MAAkB,gCACzB,OAAS,sBAAAC,EAAoB,kBAAAC,MAAsB,gBAgCnD,SAASC,EAAe,CAAE,KAAAC,EAAM,GAAGC,CAAM,EAAwB,CAC/D,KAAM,CAACC,EAAWC,CAAY,EAAId,EAASE,EAAgB,MAAM,EAC3D,CAAE,MAAAa,CAAM,EAAIP,EAAmB,EAC/BQ,EAAUP,EAAe,SAASM,CAAK,EAEvC,CAACE,EAAYC,CAAa,EAAIlB,EAAS,CAAC,EACxC,CAACmB,EAAaC,CAAc,EAAIpB,EAAS,CAAC,EAC1C,CAACqB,EAAQC,CAAS,EAAItB,EAAS,EAAE,EAEjCuB,EAAOxB,EAAQ,IAAM,CACzB,MAAMyB,EAAmD,CAAC,EAE1D,OAAIb,EAAK,WACPa,EAAc,KAAK,CACjB,MAAOb,EAAK,UACZ,KAAMT,EAAgB,MACxB,CAAC,EAGCS,EAAK,Y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"dayjs", "useCallback", "useMemo", "useState", "ApprovalStatus", "AlpcConsumeType", "RewardType", "CreditsModalContainer", "Tip", "LoadingDots", "useMyRewards", "useHeadlessContext", "ROUNDED_BRANDS", "MyRewardsModal", "data", "props", "activeTab", "setActiveTab", "brand", "rounded", "couponPage", "setCouponPage", "productPage", "setProductPage", "copied", "setCopied", "tabs", "availableTabs", "myProductRewardsOptions", "myCouponRewardsOptions", "myCouponRewards", "couponCanNext", "couponIsLoading", "myProductRewards", "productCanNext", "productIsLoading", "list", "item", "type", "canNext", "TypeMap", "TipMap", "ColorMap", "handleScrollEnd", "handleCopy", "code", "idx", "isLoading", "value", "tab", "index", "e", "MyRewardsModal_default"]
7
7
  }
@@ -19,7 +19,10 @@ export interface MyActivitiesMetafields {
19
19
  firstPurchaseTask: string;
20
20
  uploadReceiptTask: string;
21
21
  shoppingTask: string;
22
- emptyListImageUrl: string;
22
+ emptyListImage: {
23
+ url: string;
24
+ alt?: string;
25
+ };
23
26
  emptyListLabel: string;
24
27
  }
25
28
  interface ActivitiesModalProps extends ModalContainerProps {
@@ -1,2 +1,2 @@
1
- import{jsx as i,jsxs as n}from"react/jsx-runtime";import{useCallback as D,useMemo as f,useState as y}from"react";import{useCreditsContext as L}from"../context/provider";import{CreditType as p,DTC_TASK_TYPE as g,TaskSubType as r,TaskType as Y}from"../context/const";import E from"../context/hooks/useActivities";import{CreditsModalContainer as w}from"./modalContainer";import{cn as b}from"../../../helpers/utils";import{Tabs as R,TabsList as B,TabsTrigger as I}from"@anker-in/headless-ui";import j from"./loadingDots";import{Picture as F,Text as h}from"@anker-in/headless-ui";import N from"dayjs";function O({data:e,...c}){const[d,A]=y(1),{taskIdToTypeMapping:u}=L(),_=f(()=>({page:c.isOpen?d:0,pageSize:1e3}),[c.isOpen,d]),[o,M]=y(p.All),P=f(()=>{const s=[{title:e.allTab,type:p.All},{title:e.earnedTab,type:p.Earned},{title:e.deductedTab,type:p.Deducted}];return e.expiredTab&&s.push({title:e.expiredTab,type:p.Expired}),s},[e]),{activities:x=[],canNext:v,isLoading:k}=E(_),T=f(()=>{const s={[r.Activation]:e.activationTask,[r.UpdateName]:e.updateNameTask,[r.UpdatePhone]:e.updatePhoneTask,[r.UpdateBirthday]:e.updateBirthdayTask,[r.Subscription]:e.subscriptionTask,[r.UpadteAppName]:e.updateAppNameTask,[r.Refund]:e.refundTask,[r.ProductUnApproved]:e.productUnApprovedTask},m={[g.FirstPurchase]:e.firstPurchaseTask,[g.UploadReceipt]:e.uploadReceiptTask,[g.Shopping]:e.shoppingTask};function U(t){return t.task_type===Y.Redeem&&t.task_sub_type===r.ProductUnApproved&&e.productUnApprovedTask?t.task_name.replace("Refund",e.productUnApprovedTask):u?.[String(t.task_rule_id)]?m[u?.[String(t.task_rule_id)]]:s[t.task_sub_type]||t.task_name}let a=x.map(t=>({title:U(t),date:new Date(t.create_time*1e3),value:t.credit,type:t.credit_type,pending_time:t.pending_time,credit_type:t.credit_type,status:t.status}))||[];return o===p.Earned?a=a?.filter(t=>t.type===1):o===p.Deducted?a=a?.filter(t=>t.type===2&&t.status!==3):o===p.Expired&&(a=a?.filter(t=>t.type===2&&t.status===3)),a.map(t=>{let{value:l,...S}=t;return t.type===p.Deducted&&l>0&&(l=-l),{value:l,...S}})},[e.activationTask,e.updateNameTask,e.updatePhoneTask,e.updateBirthdayTask,e.subscriptionTask,e.updateAppNameTask,e.refundTask,e.productUnApprovedTask,e.firstPurchaseTask,e.uploadReceiptTask,e.shoppingTask,x,o,u]),C=D(()=>{v&&A(d+1)},[d,v]);return n(w,{title:e.title,className:b("h-[800px] w-[640px]"),useAnimation:!0,animationClassName:"md:translate-y-[100vh]",scrollClassName:"min-l:px-0 md:mb-0 md:px-0",...c,onScrollEnd:C,children:[i("div",{className:"w-full overflow-x-auto",children:i(R,{align:"left",shape:"rounded",value:o.toString(),onValueChange:s=>{M(Number(s))},className:"px-[24px] md:px-[16px]",children:i(B,{children:P.map(s=>i(I,{value:s.type.toString(),children:s.title},s.type))})})}),n("div",{className:"mt-[24px] grid gap-[18px] overflow-auto overscroll-contain px-[24px] md:gap-[12px] md:px-[16px]",children:[k&&i("div",{className:"flex h-full flex-col items-center justify-center",children:i(j,{})}),!T.length&&!k&&n("div",{className:"flex h-full flex-col items-center justify-center",children:[i(F,{className:"mb-[16px] h-[120px] w-[160px]",src:e?.emptyListImageUrl}),i("div",{className:"leading-1.4 text-[16px] font-semibold",children:e?.emptyListLabel})]}),T.map((s,m)=>n("div",{className:"flex h-fit items-center justify-between rounded-[8px] bg-[#f2f0f1] px-[16px] py-[20px] text-[16px]",children:[n("div",{className:"grid gap-[6px]",children:[i("div",{className:"font-bold",children:s.title}),i("div",{className:"text-[14px] font-semibold text-[#999]",children:N(s.date).format("YYYY-MM-DD HH:mm").toString()}),!e.pendingTips&&n("div",{className:`hidden text-[14px] font-semibold text-[#777] ${s.status===2&&s.credit_type===1?"!flex":""}`,children:[i(h,{html:e.pendingTips}),i("span",{children:N.unix(s.pending_time).add(1,"day").format("YYYY-MM-DD")}),e.pendingTips2&&i(h,{html:e.pendingTips2})]})]}),n("div",{className:b("font-bold",s.value>=0||s.credit_type===p.Expired?"text-[#52C41A]":"text-[#F84D4F]"),children:[s.value>=0&&"+",s.value]})]},m))]}),!!T.length&&i("div",{className:"mt-[12px] px-[24px] pb-[24px] text-[14px] font-semibold text-[#999] md:px-[16px]",children:e.tips})]})}var Z=O;export{Z as default};
1
+ import{Fragment as V,jsx as i,jsxs as n}from"react/jsx-runtime";import{useCallback as E,useMemo as g,useState as h}from"react";import{useCreditsContext as R}from"../context/provider";import{CreditType as p,DTC_TASK_TYPE as f,TaskSubType as a,TaskType as Y}from"../context/const";import w from"../context/hooks/useActivities";import{CreditsModalContainer as B}from"./modalContainer";import{classNames as v,useHeadlessContext as I,ROUNDED_BRANDS as O}from"@anker-in/lib";import{Tabs as j,TabsList as F,TabsTrigger as H}from"@anker-in/headless-ui";import z from"./loadingDots";import{Picture as q,Text as N}from"@anker-in/headless-ui";import A from"dayjs";function K({data:e,...c}){const[l,_]=h(1),{taskIdToTypeMapping:u}=R(),{brand:M}=I(),k=O.includes(M),P=g(()=>({page:c.isOpen?l:0,pageSize:1e3}),[c.isOpen,l]),[o,C]=h(p.All),D=g(()=>{const s=[{title:e.allTab,type:p.All},{title:e.earnedTab,type:p.Earned},{title:e.deductedTab,type:p.Deducted}];return e.expiredTab&&s.push({title:e.expiredTab,type:p.Expired}),s},[e]),{activities:x=[],canNext:y,isLoading:b}=w(P),T=g(()=>{const s={[a.Activation]:e.activationTask,[a.UpdateName]:e.updateNameTask,[a.UpdatePhone]:e.updatePhoneTask,[a.UpdateBirthday]:e.updateBirthdayTask,[a.Subscription]:e.subscriptionTask,[a.UpadteAppName]:e.updateAppNameTask,[a.Refund]:e.refundTask,[a.ProductUnApproved]:e.productUnApprovedTask},m={[f.FirstPurchase]:e.firstPurchaseTask,[f.UploadReceipt]:e.uploadReceiptTask,[f.Shopping]:e.shoppingTask};function U(t){return t.task_type===Y.Redeem&&t.task_sub_type===a.ProductUnApproved&&e.productUnApprovedTask?t.task_name.replace("Refund",e.productUnApprovedTask):u?.[String(t.task_rule_id)]?m[u?.[String(t.task_rule_id)]]:s[t.task_sub_type]||t.task_name}let r=x.map(t=>({title:U(t),date:new Date(t.create_time*1e3),value:t.credit,type:t.credit_type,pending_time:t.pending_time,credit_type:t.credit_type,status:t.status}))||[];return o===p.Earned?r=r?.filter(t=>t.type===1):o===p.Deducted?r=r?.filter(t=>t.type===2&&t.status!==3):o===p.Expired&&(r=r?.filter(t=>t.type===2&&t.status===3)),r.map(t=>{let{value:d,...L}=t;return t.type===p.Deducted&&d>0&&(d=-d),{value:d,...L}})},[e.activationTask,e.updateNameTask,e.updatePhoneTask,e.updateBirthdayTask,e.subscriptionTask,e.updateAppNameTask,e.refundTask,e.productUnApprovedTask,e.firstPurchaseTask,e.uploadReceiptTask,e.shoppingTask,x,o,u]),S=E(()=>{y&&_(l+1)},[l,y]);return n(B,{title:e.title,className:v("h-[800px] w-[640px]"),useAnimation:!0,animationClassName:"md:translate-y-[100vh]",scrollClassName:"",...c,onScrollEnd:S,children:[i("div",{className:"w-full sticky top-0 bg-white z-10 pb-[24px] overflow-x-auto",children:i(j,{align:"left",shape:k?"rounded":"square",value:o.toString(),onValueChange:s=>{C(Number(s))},className:"",children:i(F,{children:D.map(s=>i(H,{value:s.type.toString(),children:s.title},s.type))})})}),n("div",{className:"grid gap-[18px] overflow-auto overscroll-contain md:gap-[12px]",children:[b&&i("div",{className:"flex h-full flex-col items-center justify-center",children:i(z,{})}),!b&&i(V,{children:T.length>0?T.map((s,m)=>n("div",{className:v("flex h-fit items-center justify-between rounded-[8px] bg-[#f2f0f1] px-[16px] py-[20px] text-[16px]",!k&&"rounded-none"),children:[n("div",{className:"grid gap-[6px]",children:[i("div",{className:"font-bold",children:s.title}),i("div",{className:"text-[14px] font-semibold text-[#999]",children:A(s.date).format("YYYY-MM-DD HH:mm").toString()}),!e.pendingTips&&n("div",{className:`hidden text-[14px] font-semibold text-[#777] ${s.status===2&&s.credit_type===1?"!flex":""}`,children:[i(N,{html:e.pendingTips}),i("span",{children:A.unix(s.pending_time).add(1,"day").format("YYYY-MM-DD")}),e.pendingTips2&&i(N,{html:e.pendingTips2})]})]}),n("div",{className:v("font-bold",s.value>=0||s.credit_type===p.Expired?"text-[#52C41A]":"text-[#F84D4F]"),children:[s.value>=0&&"+",s.value]})]},m)):n("div",{className:"flex h-full flex-col items-center justify-center",children:[i(q,{className:"mb-[16px] h-[120px] w-[160px]",source:e?.emptyListImage?.url,alt:e?.emptyListImage?.alt||"empty list image"}),i("div",{className:"leading-1.4 text-[16px] font-semibold",children:e?.emptyListLabel})]})})]}),T.length>0&&i("div",{className:"mt-[12px] pb-[24px] text-[14px] font-semibold text-[#999]",children:e.tips})]})}var pe=K;export{pe as default};
2
2
  //# sourceMappingURL=activitiesModal.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/components/credits/modal/activitiesModal.tsx"],
4
- "sourcesContent": ["import { useCallback, useMemo, useState } from 'react'\nimport { useCreditsContext } from '../context/provider'\nimport { CreditType, DTC_TASK_TYPE, TaskSubType, TaskType } from '../context/const'\nimport useActivities from '../context/hooks/useActivities'\nimport type { Task } from '../context/response'\nimport { CreditsModalContainer, type ModalContainerProps } from './modalContainer'\nimport { cn } from '../../../helpers/utils'\nimport { Tabs, TabsList, TabsTrigger } from '@anker-in/headless-ui'\nimport LoadingDots from './loadingDots'\nimport { Picture, Text } from '@anker-in/headless-ui'\nimport dayjs from 'dayjs'\n\nexport interface MyActivitiesMetafields {\n title: string\n tips: string\n allTab: string\n earnedTab: string\n deductedTab: string\n expiredTab: string\n activationTask: string\n updateNameTask: string\n updatePhoneTask: string\n updateBirthdayTask: string\n updateAppNameTask: string\n subscriptionTask: string\n refundTask: string\n productUnApprovedTask: string\n pendingTips?: string\n pendingTips2?: string\n firstPurchaseTask: string\n uploadReceiptTask: string\n shoppingTask: string\n emptyListImageUrl: string\n emptyListLabel: string\n}\n\ninterface ActivitiesModalProps extends ModalContainerProps {\n data: MyActivitiesMetafields\n}\n\nfunction ActivitiesModal({ data, ...props }: ActivitiesModalProps) {\n const [page, setPage] = useState(1)\n const { taskIdToTypeMapping } = useCreditsContext()\n\n const myActivitiesOptions = useMemo(() => {\n return {\n page: props.isOpen ? page : 0,\n pageSize: 1000,\n }\n }, [props.isOpen, page])\n\n const [activeTab, setActiveTab] = useState(CreditType.All)\n const tabs = useMemo(() => {\n const tabs = [\n {\n title: data.allTab,\n type: CreditType.All,\n },\n {\n title: data.earnedTab,\n type: CreditType.Earned,\n },\n {\n title: data.deductedTab,\n type: CreditType.Deducted,\n },\n ]\n if (data.expiredTab) {\n tabs.push({\n title: data.expiredTab,\n type: CreditType.Expired,\n })\n }\n return tabs\n }, [data])\n\n const { activities = [], canNext, isLoading } = useActivities(myActivitiesOptions)\n\n const list = useMemo(() => {\n const taskNameMap = {\n [TaskSubType.Activation]: data.activationTask,\n [TaskSubType.UpdateName]: data.updateNameTask,\n [TaskSubType.UpdatePhone]: data.updatePhoneTask,\n [TaskSubType.UpdateBirthday]: data.updateBirthdayTask,\n [TaskSubType.Subscription]: data.subscriptionTask,\n [TaskSubType.UpadteAppName]: data.updateAppNameTask,\n [TaskSubType.Refund]: data.refundTask,\n [TaskSubType.ProductUnApproved]: data.productUnApprovedTask,\n }\n const dtcTaskTypeToNameMap = {\n [DTC_TASK_TYPE.FirstPurchase]: data.firstPurchaseTask,\n [DTC_TASK_TYPE.UploadReceipt]: data.uploadReceiptTask,\n [DTC_TASK_TYPE.Shopping]: data.shoppingTask,\n }\n\n function getTitle(item: Task) {\n if (\n item.task_type === TaskType.Redeem &&\n item.task_sub_type === TaskSubType.ProductUnApproved &&\n data.productUnApprovedTask\n ) {\n // \u65B0\u589E\u7684\u90E8\u5206\u4EFB\u52A1\u90FD\u4F7F\u7528\u4E86 alpc \u540C\u4E00\u4E2A\u4EFB\u52A1\u7C7B\u578B\uFF0C\u9700\u8981\u7528\u4EFB\u52A1 id \u6765\u533A\u5206\n return item.task_name.replace('Refund', data.productUnApprovedTask)\n } else if (taskIdToTypeMapping?.[String(item.task_rule_id)]) {\n return dtcTaskTypeToNameMap[taskIdToTypeMapping?.[String(item.task_rule_id)]]\n } else {\n return taskNameMap[item.task_sub_type] || item.task_name\n }\n }\n\n const all = activities.map(item => ({\n title: getTitle(item),\n date: new Date(item.create_time * 1000),\n value: item.credit,\n type: item.credit_type,\n pending_time: item.pending_time,\n credit_type: item.credit_type,\n status: item.status,\n }))\n\n let filtered = all || []\n if (activeTab === CreditType.Earned) {\n filtered = filtered?.filter(item => item.type === 1)\n } else if (activeTab === CreditType.Deducted) {\n filtered = filtered?.filter(item => item.type === 2 && item.status !== 3)\n } else if (activeTab === CreditType.Expired) {\n filtered = filtered?.filter(item => item.type === 2 && item.status === 3)\n }\n\n return filtered.map(item => {\n let { value, ...otherItem } = item\n if (item.type === CreditType.Deducted && value > 0) {\n value = -value\n }\n\n return {\n value,\n ...otherItem,\n }\n })\n }, [\n data.activationTask,\n data.updateNameTask,\n data.updatePhoneTask,\n data.updateBirthdayTask,\n data.subscriptionTask,\n data.updateAppNameTask,\n data.refundTask,\n data.productUnApprovedTask,\n data.firstPurchaseTask,\n data.uploadReceiptTask,\n data.shoppingTask,\n activities,\n activeTab,\n taskIdToTypeMapping,\n ])\n\n const handleScrollEnd = useCallback(() => {\n if (!canNext) {\n return\n }\n setPage(page + 1)\n }, [page, canNext])\n\n return (\n <CreditsModalContainer\n title={data.title}\n className={cn('h-[800px] w-[640px]')}\n useAnimation\n animationClassName=\"md:translate-y-[100vh]\"\n scrollClassName=\"min-l:px-0 md:mb-0 md:px-0\"\n {...props}\n onScrollEnd={handleScrollEnd}\n >\n <div className=\"w-full overflow-x-auto\">\n <Tabs\n align=\"left\"\n shape=\"rounded\"\n value={activeTab.toString()}\n onValueChange={value => {\n setActiveTab(Number(value))\n }}\n className=\"px-[24px] md:px-[16px]\"\n >\n <TabsList>\n {tabs.map(tab => (\n <TabsTrigger key={tab.type} value={tab.type.toString()}>\n {tab.title}\n </TabsTrigger>\n ))}\n </TabsList>\n </Tabs>\n </div>\n\n <div className=\"mt-[24px] grid gap-[18px] overflow-auto overscroll-contain px-[24px] md:gap-[12px] md:px-[16px]\">\n {isLoading && (\n <div className=\"flex h-full flex-col items-center justify-center\">\n <LoadingDots />\n </div>\n )}\n {!list.length && !isLoading && (\n <div className=\"flex h-full flex-col items-center justify-center\">\n <Picture className=\"mb-[16px] h-[120px] w-[160px]\" src={data?.emptyListImageUrl}></Picture>\n <div className=\"leading-1.4 text-[16px] font-semibold\">{data?.emptyListLabel}</div>\n </div>\n )}\n {list.map((item, index) => (\n <div\n key={index}\n className=\"flex h-fit items-center justify-between rounded-[8px] bg-[#f2f0f1] px-[16px] py-[20px] text-[16px]\"\n >\n <div className=\"grid gap-[6px]\">\n <div className=\"font-bold\">{item.title}</div>\n <div className=\"text-[14px] font-semibold text-[#999]\">\n {dayjs(item.date).format('YYYY-MM-DD HH:mm').toString()}\n </div>\n {!data.pendingTips && (\n <div\n className={`hidden text-[14px] font-semibold text-[#777] ${item.status === 2 && item.credit_type === 1 ? '!flex' : ''}`}\n >\n <Text html={data.pendingTips} />\n <span>{dayjs.unix(item.pending_time).add(1, 'day').format('YYYY-MM-DD')}</span>\n {data.pendingTips2 && <Text html={data.pendingTips2} />}\n </div>\n )}\n </div>\n <div\n className={cn(\n 'font-bold',\n item.value >= 0 || item.credit_type === CreditType.Expired ? 'text-[#52C41A]' : 'text-[#F84D4F]'\n )}\n >\n {item.value >= 0 && '+'}\n {item.value}\n </div>\n </div>\n ))}\n </div>\n {!!list.length && (\n <div className=\"mt-[12px] px-[24px] pb-[24px] text-[14px] font-semibold text-[#999] md:px-[16px]\">\n {data.tips}\n </div>\n )}\n </CreditsModalContainer>\n )\n}\n\nexport default ActivitiesModal\n"],
5
- "mappings": "AA0Lc,cAAAA,EAeJ,QAAAC,MAfI,oBA1Ld,OAAS,eAAAC,EAAa,WAAAC,EAAS,YAAAC,MAAgB,QAC/C,OAAS,qBAAAC,MAAyB,sBAClC,OAAS,cAAAC,EAAY,iBAAAC,EAAe,eAAAC,EAAa,YAAAC,MAAgB,mBACjE,OAAOC,MAAmB,iCAE1B,OAAS,yBAAAC,MAAuD,mBAChE,OAAS,MAAAC,MAAU,yBACnB,OAAS,QAAAC,EAAM,YAAAC,EAAU,eAAAC,MAAmB,wBAC5C,OAAOC,MAAiB,gBACxB,OAAS,WAAAC,EAAS,QAAAC,MAAY,wBAC9B,OAAOC,MAAW,QA8BlB,SAASC,EAAgB,CAAE,KAAAC,EAAM,GAAGC,CAAM,EAAyB,CACjE,KAAM,CAACC,EAAMC,CAAO,EAAIpB,EAAS,CAAC,EAC5B,CAAE,oBAAAqB,CAAoB,EAAIpB,EAAkB,EAE5CqB,EAAsBvB,EAAQ,KAC3B,CACL,KAAMmB,EAAM,OAASC,EAAO,EAC5B,SAAU,GACZ,GACC,CAACD,EA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AAgB/B,EAAW,QAAU,iBAAmB,gBAClF,EAEC,UAAA+B,EAAK,OAAS,GAAK,IACnBA,EAAK,OACR,IA1BKM,CA2BP,CACD,GACH,EACC,CAAC,CAACV,EAAK,QACNjC,EAAC,OAAI,UAAU,mFACZ,SAAAqB,EAAK,KACR,GAEJ,CAEJ,CAEA,IAAOuB,EAAQxB",
6
- "names": ["jsx", "jsxs", "useCallback", "useMemo", "useState", "useCreditsContext", "CreditType", "DTC_TASK_TYPE", "TaskSubType", "TaskType", "useActivities", "CreditsModalContainer", "cn", "Tabs", "TabsList", "TabsTrigger", "LoadingDots", "Picture", "Text", "dayjs", "ActivitiesModal", "data", "props", "page", "setPage", "taskIdToTypeMapping", "myActivitiesOptions", "activeTab", "setActiveTab", "tabs", "activities", "canNext", "isLoading", "list", "taskNameMap", "dtcTaskTypeToNameMap", "getTitle", "item", "filtered", "value", "otherItem", "handleScrollEnd", "tab", "index", "activitiesModal_default"]
4
+ "sourcesContent": ["import { useCallback, useMemo, useState } from 'react'\nimport { useCreditsContext } from '../context/provider'\nimport { CreditType, DTC_TASK_TYPE, TaskSubType, TaskType } from '../context/const'\nimport useActivities from '../context/hooks/useActivities'\nimport type { Task } from '../context/response'\nimport { CreditsModalContainer, type ModalContainerProps } from './modalContainer'\nimport { classNames as cn, useHeadlessContext, ROUNDED_BRANDS } from '@anker-in/lib'\nimport { Tabs, TabsList, TabsTrigger } from '@anker-in/headless-ui'\nimport LoadingDots from './loadingDots'\nimport { Picture, Text } from '@anker-in/headless-ui'\nimport dayjs from 'dayjs'\n\nexport interface MyActivitiesMetafields {\n title: string\n tips: string\n allTab: string\n earnedTab: string\n deductedTab: string\n expiredTab: string\n activationTask: string\n updateNameTask: string\n updatePhoneTask: string\n updateBirthdayTask: string\n updateAppNameTask: string\n subscriptionTask: string\n refundTask: string\n productUnApprovedTask: string\n pendingTips?: string\n pendingTips2?: string\n firstPurchaseTask: string\n uploadReceiptTask: string\n shoppingTask: string\n emptyListImage: {\n url: string\n alt?: string\n }\n emptyListLabel: string\n}\n\ninterface ActivitiesModalProps extends ModalContainerProps {\n data: MyActivitiesMetafields\n}\n\nfunction ActivitiesModal({ data, ...props }: ActivitiesModalProps) {\n const [page, setPage] = useState(1)\n const { taskIdToTypeMapping } = useCreditsContext()\n const { brand } = useHeadlessContext()\n const rounded = ROUNDED_BRANDS.includes(brand)\n\n const myActivitiesOptions = useMemo(() => {\n return {\n page: props.isOpen ? page : 0,\n pageSize: 1000,\n }\n }, [props.isOpen, page])\n\n const [activeTab, setActiveTab] = useState(CreditType.All)\n const tabs = useMemo(() => {\n const tabs = [\n {\n title: data.allTab,\n type: CreditType.All,\n },\n {\n title: data.earnedTab,\n type: CreditType.Earned,\n },\n {\n title: data.deductedTab,\n type: CreditType.Deducted,\n },\n ]\n if (data.expiredTab) {\n tabs.push({\n title: data.expiredTab,\n type: CreditType.Expired,\n })\n }\n return tabs\n }, [data])\n\n const { activities = [], canNext, isLoading } = useActivities(myActivitiesOptions)\n\n const list = useMemo(() => {\n const taskNameMap = {\n [TaskSubType.Activation]: data.activationTask,\n [TaskSubType.UpdateName]: data.updateNameTask,\n [TaskSubType.UpdatePhone]: data.updatePhoneTask,\n [TaskSubType.UpdateBirthday]: data.updateBirthdayTask,\n [TaskSubType.Subscription]: data.subscriptionTask,\n [TaskSubType.UpadteAppName]: data.updateAppNameTask,\n [TaskSubType.Refund]: data.refundTask,\n [TaskSubType.ProductUnApproved]: data.productUnApprovedTask,\n }\n const dtcTaskTypeToNameMap = {\n [DTC_TASK_TYPE.FirstPurchase]: data.firstPurchaseTask,\n [DTC_TASK_TYPE.UploadReceipt]: data.uploadReceiptTask,\n [DTC_TASK_TYPE.Shopping]: data.shoppingTask,\n }\n\n function getTitle(item: Task) {\n if (\n item.task_type === TaskType.Redeem &&\n item.task_sub_type === TaskSubType.ProductUnApproved &&\n data.productUnApprovedTask\n ) {\n // \u65B0\u589E\u7684\u90E8\u5206\u4EFB\u52A1\u90FD\u4F7F\u7528\u4E86 alpc \u540C\u4E00\u4E2A\u4EFB\u52A1\u7C7B\u578B\uFF0C\u9700\u8981\u7528\u4EFB\u52A1 id \u6765\u533A\u5206\n return item.task_name.replace('Refund', data.productUnApprovedTask)\n } else if (taskIdToTypeMapping?.[String(item.task_rule_id)]) {\n return dtcTaskTypeToNameMap[taskIdToTypeMapping?.[String(item.task_rule_id)]]\n } else {\n return taskNameMap[item.task_sub_type] || item.task_name\n }\n }\n\n const all = activities.map(item => ({\n title: getTitle(item),\n date: new Date(item.create_time * 1000),\n value: item.credit,\n type: item.credit_type,\n pending_time: item.pending_time,\n credit_type: item.credit_type,\n status: item.status,\n }))\n\n let filtered = all || []\n if (activeTab === CreditType.Earned) {\n filtered = filtered?.filter(item => item.type === 1)\n } else if (activeTab === CreditType.Deducted) {\n filtered = filtered?.filter(item => item.type === 2 && item.status !== 3)\n } else if (activeTab === CreditType.Expired) {\n filtered = filtered?.filter(item => item.type === 2 && item.status === 3)\n }\n\n return filtered.map(item => {\n let { value, ...otherItem } = item\n if (item.type === CreditType.Deducted && value > 0) {\n value = -value\n }\n\n return {\n value,\n ...otherItem,\n }\n })\n }, [\n data.activationTask,\n data.updateNameTask,\n data.updatePhoneTask,\n data.updateBirthdayTask,\n data.subscriptionTask,\n data.updateAppNameTask,\n data.refundTask,\n data.productUnApprovedTask,\n data.firstPurchaseTask,\n data.uploadReceiptTask,\n data.shoppingTask,\n activities,\n activeTab,\n taskIdToTypeMapping,\n ])\n\n const handleScrollEnd = useCallback(() => {\n if (!canNext) {\n return\n }\n setPage(page + 1)\n }, [page, canNext])\n\n return (\n <CreditsModalContainer\n title={data.title}\n className={cn('h-[800px] w-[640px]')}\n useAnimation\n animationClassName=\"md:translate-y-[100vh]\"\n scrollClassName=\"\"\n {...props}\n onScrollEnd={handleScrollEnd}\n >\n <div className=\"w-full sticky top-0 bg-white z-10 pb-[24px] overflow-x-auto\">\n <Tabs\n align=\"left\"\n shape={rounded ? 'rounded' : 'square'}\n value={activeTab.toString()}\n onValueChange={value => {\n setActiveTab(Number(value))\n }}\n className=\"\"\n >\n <TabsList>\n {tabs.map(tab => (\n <TabsTrigger key={tab.type} value={tab.type.toString()}>\n {tab.title}\n </TabsTrigger>\n ))}\n </TabsList>\n </Tabs>\n </div>\n\n <div className=\"grid gap-[18px] overflow-auto overscroll-contain md:gap-[12px]\">\n {isLoading && (\n <div className=\"flex h-full flex-col items-center justify-center\">\n <LoadingDots />\n </div>\n )}\n\n {!isLoading && (\n <>\n {list.length > 0 ? (\n list.map((item, index) => (\n <div\n key={index}\n className={cn(\n 'flex h-fit items-center justify-between rounded-[8px] bg-[#f2f0f1] px-[16px] py-[20px] text-[16px]',\n !rounded && 'rounded-none'\n )}\n >\n <div className=\"grid gap-[6px]\">\n <div className=\"font-bold\">{item.title}</div>\n <div className=\"text-[14px] font-semibold text-[#999]\">\n {dayjs(item.date).format('YYYY-MM-DD HH:mm').toString()}\n </div>\n {!data.pendingTips && (\n <div\n className={`hidden text-[14px] font-semibold text-[#777] ${item.status === 2 && item.credit_type === 1 ? '!flex' : ''}`}\n >\n <Text html={data.pendingTips} />\n <span>{dayjs.unix(item.pending_time).add(1, 'day').format('YYYY-MM-DD')}</span>\n {data.pendingTips2 && <Text html={data.pendingTips2} />}\n </div>\n )}\n </div>\n <div\n className={cn(\n 'font-bold',\n item.value >= 0 || item.credit_type === CreditType.Expired ? 'text-[#52C41A]' : 'text-[#F84D4F]'\n )}\n >\n {item.value >= 0 && '+'}\n {item.value}\n </div>\n </div>\n ))\n ) : (\n <div className=\"flex h-full flex-col items-center justify-center\">\n <Picture\n className=\"mb-[16px] h-[120px] w-[160px]\"\n source={data?.emptyListImage?.url}\n alt={data?.emptyListImage?.alt || 'empty list image'}\n ></Picture>\n <div className=\"leading-1.4 text-[16px] font-semibold\">{data?.emptyListLabel}</div>\n </div>\n )}\n </>\n )}\n </div>\n {/* \u79EF\u5206\u5230\u8D26\u65F6\u95F4\u63D0\u9192 */}\n {list.length > 0 && <div className=\"mt-[12px] pb-[24px] text-[14px] font-semibold text-[#999]\">{data.tips}</div>}\n </CreditsModalContainer>\n )\n}\n\nexport default ActivitiesModal\n"],
5
+ "mappings": "AA+Lc,OAgBJ,YAAAA,EAhBI,OAAAC,EAgCQ,QAAAC,MAhCR,oBA/Ld,OAAS,eAAAC,EAAa,WAAAC,EAAS,YAAAC,MAAgB,QAC/C,OAAS,qBAAAC,MAAyB,sBAClC,OAAS,cAAAC,EAAY,iBAAAC,EAAe,eAAAC,EAAa,YAAAC,MAAgB,mBACjE,OAAOC,MAAmB,iCAE1B,OAAS,yBAAAC,MAAuD,mBAChE,OAAS,cAAcC,EAAI,sBAAAC,EAAoB,kBAAAC,MAAsB,gBACrE,OAAS,QAAAC,EAAM,YAAAC,EAAU,eAAAC,MAAmB,wBAC5C,OAAOC,MAAiB,gBACxB,OAAS,WAAAC,EAAS,QAAAC,MAAY,wBAC9B,OAAOC,MAAW,QAiClB,SAASC,EAAgB,CAAE,KAAAC,EAAM,GAAGC,CAAM,EAAyB,CACjE,KAAM,CAACC,EAAMC,CAAO,EAAItB,EAAS,CAAC,EAC5B,CAAE,oBAAAuB,CAAoB,EAAItB,EAAkB,EAC5C,CAAE,MAAAuB,CAAM,EAAIf,EAAmB,EAC/BgB,EAAUf,EAAe,SAASc,CAAK,EAEvCE,EAAsB3B,EAAQ,KAC3B,CACL,KAAMqB,EAAM,OAASC,EAAO,EAC5B,SAAU,GACZ,GACC,CAACD,EAAM,OAAQC,CAAI,CAAC,EAEjB,CAACM,EAAWC,CAAY,EAAI5B,EAASE,EAAW,GAAG,EACnD2B,EAAO9B,EAAQ,IAAM,CACzB,MAAM8B,EAAO,CACX,CACE,MAAOV,EAAK,OACZ,KAAMjB,EAAW,GACnB,EACA,CACE,MAAOiB,EAAK,UACZ,KAAMjB,EAAW,MACnB,EACA,CACE,MAAOiB,EAAK,YACZ,KAAMjB,EAAW,QACnB,CACF,EACA,OAAIiB,EAAK,YACPU,EAAK,KAAK,CACR,MAAOV,EA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EA,IAAOyB,GAAQ1B",
6
+ "names": ["Fragment", "jsx", "jsxs", "useCallback", "useMemo", "useState", "useCreditsContext", "CreditType", "DTC_TASK_TYPE", "TaskSubType", "TaskType", "useActivities", "CreditsModalContainer", "cn", "useHeadlessContext", "ROUNDED_BRANDS", "Tabs", "TabsList", "TabsTrigger", "LoadingDots", "Picture", "Text", "dayjs", "ActivitiesModal", "data", "props", "page", "setPage", "taskIdToTypeMapping", "brand", "rounded", "myActivitiesOptions", "activeTab", "setActiveTab", "tabs", "activities", "canNext", "isLoading", "list", "taskNameMap", "dtcTaskTypeToNameMap", "getTitle", "item", "filtered", "value", "otherItem", "handleScrollEnd", "tab", "index", "activitiesModal_default"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{jsx as s,jsxs as h}from"react/jsx-runtime";import{Button as f,Heading as g,Text as l}from"@anker-in/headless-ui";import{useCallback as S,useState as a}from"react";import{CreditsModalContainer as C}from"./modalContainer";import{useUploadReceipt as v}from"../context/hooks/useUploadReceipt";function k({isOpen:N,onClose:o,copy:e,onSuccess:r}){const{trigger:c,isMutating:b}=v(),[n,d]=a(""),[p,m]=a(!1),[t,u]=a({icon:"",title:"",description:"",isSuccess:!1}),R=S(()=>{c({orderName:n},{onSuccess:i=>{if(m(!0),i?.ok)r(),u({icon:e.successIcon,title:e.successTitle||"Success",description:e.successDescription||"Your receipt has been uploaded successfully",isSuccess:!0});else{const T=e.failedReasons.find(D=>D.code===i.code?.toString());u({icon:e.failedIcon,title:e.failedTitle||"Failed",description:T?.description||"Please try again",isSuccess:!1})}}})},[c,n,r,e.successIcon,e.successTitle,e.successDescription,e.failedReasons,e.failedIcon,e.failedTitle]),x=()=>{m(!1),d(""),t.isSuccess&&o()};return h(C,{isOpen:N,onClose:o,className:"w-[540px] md:h-auto",scrollClassName:"mb-[40px] min-l:px-[48px] md:mb-0 md:pb-[24px] md:px-[16px]",titleClassName:"h-[56px]",useAnimation:!0,animationClassName:"md:translate-y-[100vh]",children:[s(g,{size:"3",children:e.title}),s(l,{size:"3",className:"mt-[8px] md:mt-[4px]",children:e.description}),s("input",{placeholder:e.placeholder,className:"mt-[24px] h-[50px] w-full rounded-[2px] border border-[#6D6D6F] pl-[14px] text-[16px] font-bold placeholder:text-[16px] placeholder:font-bold placeholder:text-[#6D6D6F] focus:outline-none focus:ring-0 md:rounded-[4px] md:placeholder:text-[14px]",value:n,onChange:i=>d(i.target.value)}),s(l,{size:"1",as:"p",className:"mt-[8px] text-[#6D6D6F]",children:e.note}),s(f,{variant:"primary",className:"mt-[24px] w-full",loading:b,onClick:R,children:e.submit}),p&&h(C,{isOpen:p,onClose:x,className:"w-[540px] md:h-auto",scrollClassName:"mb-[40px] min-l:px-[48px] md:mb-0 md:pb-[24px] md:px-[16px] flex flex-col items-center text-center",titleClassName:"h-[56px]",children:[s(l,{size:"3",className:"size-[64px]",as:"div",html:t.icon}),s(g,{size:"3",className:"mt-[16px]",children:t.title}),s(l,{size:"3",className:"mt-[8px] md:mt-[4px]",children:t.description}),s(f,{variant:"primary",className:"mt-[24px]",onClick:x,children:e.gotIt})]})]})}export{k as CreditsUploadReceiptModal};
1
+ import{jsx as s,jsxs as N}from"react/jsx-runtime";import{Button as f,Heading as g,Text as n}from"@anker-in/headless-ui";import{useCallback as I,useState as l}from"react";import{CreditsModalContainer as C}from"./modalContainer";import{useUploadReceipt as z}from"../context/hooks/useUploadReceipt";import{useHeadlessContext as M,ROUNDED_BRANDS as O}from"@anker-in/lib";import P from"classnames";function A({isOpen:h,onClose:a,copy:e,onSuccess:r}){const{trigger:c,isMutating:b}=z(),[o,d]=l(""),[p,m]=l(!1),[t,u]=l({icon:"",title:"",description:"",isSuccess:!1}),{brand:D}=M(),R=O.includes(D),S=I(()=>{c({orderName:o},{onSuccess:i=>{if(m(!0),i?.ok)r(),u({icon:e.successIcon,title:e.successTitle||"Success",description:e.successDescription||"Your receipt has been uploaded successfully",isSuccess:!0});else{const T=e.failedReasons.find(v=>v.code===i.code?.toString());u({icon:e.failedIcon,title:e.failedTitle||"Failed",description:T?.description||"Please try again",isSuccess:!1})}}})},[c,o,r,e.successIcon,e.successTitle,e.successDescription,e.failedReasons,e.failedIcon,e.failedTitle]),x=()=>{m(!1),d(""),t.isSuccess&&a()};return N(C,{isOpen:h,onClose:a,className:"w-[540px] md:h-auto",scrollClassName:"mb-[40px] min-l:px-[48px] md:mb-0 md:pb-[24px] md:px-[16px]",titleClassName:"h-[56px]",useAnimation:!0,animationClassName:"md:translate-y-[100vh]",children:[s(g,{size:"3",children:e.title}),s(n,{size:"3",className:"mt-[8px] md:mt-[4px]",children:e.description}),s("input",{placeholder:e.placeholder,className:P("mt-[24px] h-[50px] w-full rounded-[2px] border border-[#6D6D6F] pl-[14px] text-[16px] font-bold placeholder:text-[16px] placeholder:font-bold placeholder:text-[#6D6D6F] focus:outline-none focus:ring-0 md:rounded-[4px] md:placeholder:text-[14px]",!R&&"rounded-none"),value:o,onChange:i=>d(i.target.value)}),s(n,{size:"1",as:"p",className:"mt-[8px] text-[#6D6D6F]",children:e.note}),s(f,{variant:"primary",className:"mt-[24px] w-full",loading:b,onClick:S,children:e.submit}),p&&N(C,{isOpen:p,onClose:x,className:"w-[540px] md:h-auto",scrollClassName:"mb-[40px] min-l:px-[48px] md:mb-0 md:pb-[24px] md:px-[16px] flex flex-col items-center text-center",titleClassName:"h-[56px]",children:[s(n,{size:"3",className:"size-[64px]",as:"div",html:t.icon}),s(g,{size:"3",className:"mt-[16px]",children:t.title}),s(n,{size:"3",className:"mt-[8px] md:mt-[4px]",children:t.description}),s(f,{variant:"primary",className:"mt-[24px]",onClick:x,children:e.gotIt})]})]})}export{A as CreditsUploadReceiptModal};
2
2
  //# sourceMappingURL=creditsUploadReceiptModal.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/components/credits/modal/creditsUploadReceiptModal.tsx"],
4
- "sourcesContent": ["import { Button, Heading, Text } from '@anker-in/headless-ui'\nimport { useCallback, useState } from 'react'\nimport { CreditsModalContainer } from './modalContainer'\nimport { useUploadReceipt } from '../context/hooks/useUploadReceipt'\n\nexport type ReceiptCopy = {\n title: string\n description: string\n placeholder: string\n note: string\n submit: string\n successTitle: string\n successDescription: string\n gotIt: string\n failedTitle: string\n successIcon: string\n failedIcon: string\n failedReasons: {\n code: string\n id: string\n description: string\n }[]\n}\n\nexport function CreditsUploadReceiptModal({\n isOpen,\n onClose,\n copy,\n onSuccess,\n}: {\n isOpen: boolean\n onClose: () => void\n copy: ReceiptCopy\n onSuccess: () => void\n}) {\n const { trigger, isMutating } = useUploadReceipt()\n const [orderName, setOrderName] = useState('')\n const [resultPopup, setResultPopup] = useState(false)\n const [resultPopupContent, setResultPopupContent] = useState({\n icon: '',\n title: '',\n description: '',\n isSuccess: false,\n })\n\n const handleSubmit = useCallback(() => {\n trigger(\n { orderName },\n {\n onSuccess: result => {\n setResultPopup(true)\n if (result?.ok) {\n onSuccess()\n setResultPopupContent({\n icon: copy.successIcon,\n title: copy.successTitle || 'Success',\n description: copy.successDescription || 'Your receipt has been uploaded successfully',\n isSuccess: true,\n })\n } else {\n const error = copy.failedReasons.find(reason => reason.code === result.code?.toString())\n setResultPopupContent({\n icon: copy.failedIcon,\n title: copy.failedTitle || 'Failed',\n description: error?.description || 'Please try again',\n isSuccess: false,\n })\n }\n },\n }\n )\n }, [\n trigger,\n orderName,\n onSuccess,\n copy.successIcon,\n copy.successTitle,\n copy.successDescription,\n copy.failedReasons,\n copy.failedIcon,\n copy.failedTitle,\n ])\n\n const handleResultClose = () => {\n setResultPopup(false)\n setOrderName('')\n // \u5982\u679C\u4E0A\u4F20\u6210\u529F\uFF0C\u5168\u90E8\u5F39\u7A97\u5173\u95ED\n if (resultPopupContent.isSuccess) {\n onClose()\n }\n }\n\n return (\n <CreditsModalContainer\n isOpen={isOpen}\n onClose={onClose}\n className=\"w-[540px] md:h-auto\"\n scrollClassName=\"mb-[40px] min-l:px-[48px] md:mb-0 md:pb-[24px] md:px-[16px]\"\n titleClassName=\"h-[56px]\"\n useAnimation\n animationClassName=\"md:translate-y-[100vh]\"\n >\n <Heading size=\"3\">{copy.title}</Heading>\n <Text size=\"3\" className=\"mt-[8px] md:mt-[4px]\">\n {copy.description}\n </Text>\n <input\n placeholder={copy.placeholder}\n className=\"mt-[24px] h-[50px] w-full rounded-[2px] border border-[#6D6D6F] pl-[14px] text-[16px] font-bold placeholder:text-[16px] placeholder:font-bold placeholder:text-[#6D6D6F] focus:outline-none focus:ring-0 md:rounded-[4px] md:placeholder:text-[14px]\"\n value={orderName}\n onChange={e => setOrderName(e.target.value)}\n />\n <Text size=\"1\" as=\"p\" className=\"mt-[8px] text-[#6D6D6F]\">\n {copy.note}\n </Text>\n <Button variant=\"primary\" className=\"mt-[24px] w-full\" loading={isMutating} onClick={handleSubmit}>\n {copy.submit}\n </Button>\n {resultPopup && (\n <CreditsModalContainer\n isOpen={resultPopup}\n onClose={handleResultClose}\n className=\"w-[540px] md:h-auto\"\n scrollClassName=\"mb-[40px] min-l:px-[48px] md:mb-0 md:pb-[24px] md:px-[16px] flex flex-col items-center text-center\"\n titleClassName=\"h-[56px]\"\n >\n <Text size=\"3\" className=\"size-[64px]\" as=\"div\" html={resultPopupContent.icon} />\n <Heading size=\"3\" className=\"mt-[16px]\">\n {resultPopupContent.title}\n </Heading>\n <Text size=\"3\" className=\"mt-[8px] md:mt-[4px]\">\n {resultPopupContent.description}\n </Text>\n <Button variant=\"primary\" className=\"mt-[24px]\" onClick={handleResultClose}>\n {copy.gotIt}\n </Button>\n </CreditsModalContainer>\n )}\n </CreditsModalContainer>\n )\n}\n"],
5
- "mappings": "AAsGM,cAAAA,EAiBE,QAAAC,MAjBF,oBAtGN,OAAS,UAAAC,EAAQ,WAAAC,EAAS,QAAAC,MAAY,wBACtC,OAAS,eAAAC,EAAa,YAAAC,MAAgB,QACtC,OAAS,yBAAAC,MAA6B,mBACtC,OAAS,oBAAAC,MAAwB,oCAqB1B,SAASC,EAA0B,CACxC,OAAA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ACC,YAAaY,EAAK,YAClB,UAAU,uPACV,MAAOI,EACP,SAAUW,GAAKV,EAAaU,EAAE,OAAO,KAAK,EAC5C,EACA3B,EAACI,EAAA,CAAK,KAAK,IAAI,GAAG,IAAI,UAAU,0BAC7B,SAAAQ,EAAK,KACR,EACAZ,EAACE,EAAA,CAAO,QAAQ,UAAU,UAAU,mBAAmB,QAASa,EAAY,QAASO,EAClF,SAAAV,EAAK,OACR,EACCM,GACCjB,EAACM,EAAA,CACC,OAAQW,EACR,QAASQ,EACT,UAAU,sBACV,gBAAgB,qGAChB,eAAe,WAEf,UAAA1B,EAACI,EAAA,CAAK,KAAK,IAAI,UAAU,cAAc,GAAG,MAAM,KAAMgB,EAAmB,KAAM,EAC/EpB,EAACG,EAAA,CAAQ,KAAK,IAAI,UAAU,YACzB,SAAAiB,EAAmB,MACtB,EACApB,EAACI,EAAA,CAAK,KAAK,IAAI,UAAU,uBACtB,SAAAgB,EAAmB,YACtB,EACApB,EAACE,EAAA,CAAO,QAAQ,UAAU,UAAU,YAAY,QAASwB,EACtD,SAAAd,EAAK,MACR,GACF,GAEJ,CAEJ",
6
- "names": ["jsx", "jsxs", "Button", "Heading", "Text", "useCallback", "useState", "CreditsModalContainer", "useUploadReceipt", "CreditsUploadReceiptModal", "isOpen", "onClose", "copy", "onSuccess", "trigger", "isMutating", "orderName", "setOrderName", "resultPopup", "setResultPopup", "resultPopupContent", "setResultPopupContent", "handleSubmit", "result", "error", "reason", "handleResultClose", "e"]
4
+ "sourcesContent": ["import { Button, Heading, Text } from '@anker-in/headless-ui'\nimport { useCallback, useState } from 'react'\nimport { CreditsModalContainer } from './modalContainer'\nimport { useUploadReceipt } from '../context/hooks/useUploadReceipt'\nimport { useHeadlessContext, ROUNDED_BRANDS } from '@anker-in/lib'\nimport classNames from 'classnames'\n\nexport type ReceiptCopy = {\n title: string\n description: string\n placeholder: string\n note: string\n submit: string\n successTitle: string\n successDescription: string\n gotIt: string\n failedTitle: string\n successIcon: string\n failedIcon: string\n failedReasons: {\n code: string\n id: string\n description: string\n }[]\n}\n\nexport function CreditsUploadReceiptModal({\n isOpen,\n onClose,\n copy,\n onSuccess,\n}: {\n isOpen: boolean\n onClose: () => void\n copy: ReceiptCopy\n onSuccess: () => void\n}) {\n const { trigger, isMutating } = useUploadReceipt()\n const [orderName, setOrderName] = useState('')\n const [resultPopup, setResultPopup] = useState(false)\n const [resultPopupContent, setResultPopupContent] = useState({\n icon: '',\n title: '',\n description: '',\n isSuccess: false,\n })\n\n const { brand } = useHeadlessContext()\n const rounded = ROUNDED_BRANDS.includes(brand)\n\n const handleSubmit = useCallback(() => {\n trigger(\n { orderName },\n {\n onSuccess: result => {\n setResultPopup(true)\n if (result?.ok) {\n onSuccess()\n setResultPopupContent({\n icon: copy.successIcon,\n title: copy.successTitle || 'Success',\n description: copy.successDescription || 'Your receipt has been uploaded successfully',\n isSuccess: true,\n })\n } else {\n const error = copy.failedReasons.find(reason => reason.code === result.code?.toString())\n setResultPopupContent({\n icon: copy.failedIcon,\n title: copy.failedTitle || 'Failed',\n description: error?.description || 'Please try again',\n isSuccess: false,\n })\n }\n },\n }\n )\n }, [\n trigger,\n orderName,\n onSuccess,\n copy.successIcon,\n copy.successTitle,\n copy.successDescription,\n copy.failedReasons,\n copy.failedIcon,\n copy.failedTitle,\n ])\n\n const handleResultClose = () => {\n setResultPopup(false)\n setOrderName('')\n // \u5982\u679C\u4E0A\u4F20\u6210\u529F\uFF0C\u5168\u90E8\u5F39\u7A97\u5173\u95ED\n if (resultPopupContent.isSuccess) {\n onClose()\n }\n }\n\n return (\n <CreditsModalContainer\n isOpen={isOpen}\n onClose={onClose}\n className=\"w-[540px] md:h-auto\"\n scrollClassName=\"mb-[40px] min-l:px-[48px] md:mb-0 md:pb-[24px] md:px-[16px]\"\n titleClassName=\"h-[56px]\"\n useAnimation\n animationClassName=\"md:translate-y-[100vh]\"\n >\n <Heading size=\"3\">{copy.title}</Heading>\n <Text size=\"3\" className=\"mt-[8px] md:mt-[4px]\">\n {copy.description}\n </Text>\n <input\n placeholder={copy.placeholder}\n className={classNames(\n 'mt-[24px] h-[50px] w-full rounded-[2px] border border-[#6D6D6F] pl-[14px] text-[16px] font-bold placeholder:text-[16px] placeholder:font-bold placeholder:text-[#6D6D6F] focus:outline-none focus:ring-0 md:rounded-[4px] md:placeholder:text-[14px]',\n !rounded && 'rounded-none'\n )}\n value={orderName}\n onChange={e => setOrderName(e.target.value)}\n />\n <Text size=\"1\" as=\"p\" className=\"mt-[8px] text-[#6D6D6F]\">\n {copy.note}\n </Text>\n <Button variant=\"primary\" className=\"mt-[24px] w-full\" loading={isMutating} onClick={handleSubmit}>\n {copy.submit}\n </Button>\n {resultPopup && (\n <CreditsModalContainer\n isOpen={resultPopup}\n onClose={handleResultClose}\n className=\"w-[540px] md:h-auto\"\n scrollClassName=\"mb-[40px] min-l:px-[48px] md:mb-0 md:pb-[24px] md:px-[16px] flex flex-col items-center text-center\"\n titleClassName=\"h-[56px]\"\n >\n <Text size=\"3\" className=\"size-[64px]\" as=\"div\" html={resultPopupContent.icon} />\n <Heading size=\"3\" className=\"mt-[16px]\">\n {resultPopupContent.title}\n </Heading>\n <Text size=\"3\" className=\"mt-[8px] md:mt-[4px]\">\n {resultPopupContent.description}\n </Text>\n <Button variant=\"primary\" className=\"mt-[24px]\" onClick={handleResultClose}>\n {copy.gotIt}\n </Button>\n </CreditsModalContainer>\n )}\n </CreditsModalContainer>\n )\n}\n"],
5
+ "mappings": "AA2GM,cAAAA,EAoBE,QAAAC,MApBF,oBA3GN,OAAS,UAAAC,EAAQ,WAAAC,EAAS,QAAAC,MAAY,wBACtC,OAAS,eAAAC,EAAa,YAAAC,MAAgB,QACtC,OAAS,yBAAAC,MAA6B,mBACtC,OAAS,oBAAAC,MAAwB,oCACjC,OAAS,sBAAAC,EAAoB,kBAAAC,MAAsB,gBACnD,OAAOC,MAAgB,aAqBhB,SAASC,EAA0B,CACxC,OAAAC,EACA,QAAAC,EACA,KAAAC,EACA,UA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UAAU,uBACtB,SAAAW,EAAK,YACR,EACAf,EAAC,SACC,YAAae,EAAK,YAClB,UAAWJ,EACT,uPACA,CAACe,GAAW,cACd,EACA,MAAOP,EACP,SAAUa,GAAKZ,EAAaY,EAAE,OAAO,KAAK,EAC5C,EACAhC,EAACI,EAAA,CAAK,KAAK,IAAI,GAAG,IAAI,UAAU,0BAC7B,SAAAW,EAAK,KACR,EACAf,EAACE,EAAA,CAAO,QAAQ,UAAU,UAAU,mBAAmB,QAASgB,EAAY,QAASS,EAClF,SAAAZ,EAAK,OACR,EACCM,GACCpB,EAACM,EAAA,CACC,OAAQc,EACR,QAASU,EACT,UAAU,sBACV,gBAAgB,qGAChB,eAAe,WAEf,UAAA/B,EAACI,EAAA,CAAK,KAAK,IAAI,UAAU,cAAc,GAAG,MAAM,KAAMmB,EAAmB,KAAM,EAC/EvB,EAACG,EAAA,CAAQ,KAAK,IAAI,UAAU,YACzB,SAAAoB,EAAmB,MACtB,EACAvB,EAACI,EAAA,CAAK,KAAK,IAAI,UAAU,uBACtB,SAAAmB,EAAmB,YACtB,EACAvB,EAACE,EAAA,CAAO,QAAQ,UAAU,UAAU,YAAY,QAAS6B,EACtD,SAAAhB,EAAK,MACR,GACF,GAEJ,CAEJ",
6
+ "names": ["jsx", "jsxs", "Button", "Heading", "Text", "useCallback", "useState", "CreditsModalContainer", "useUploadReceipt", "useHeadlessContext", "ROUNDED_BRANDS", "classNames", "CreditsUploadReceiptModal", "isOpen", "onClose", "copy", "onSuccess", "trigger", "isMutating", "orderName", "setOrderName", "resultPopup", "setResultPopup", "resultPopupContent", "setResultPopupContent", "brand", "rounded", "handleSubmit", "result", "error", "reason", "handleResultClose", "e"]
7
7
  }
@@ -1,5 +1,6 @@
1
+ import { FC } from 'react';
1
2
  interface LoadingProps {
2
3
  className?: string;
3
4
  }
4
- declare function LoadingDots({ className }: LoadingProps): import("react/jsx-runtime").JSX.Element;
5
+ declare const LoadingDots: FC<LoadingProps>;
5
6
  export default LoadingDots;
@@ -1,2 +1,2 @@
1
- import{jsx as a,jsxs as t}from"react/jsx-runtime";import{cn as s}from"../../../helpers/utils";function d({className:o}){return t("div",{className:s(o),children:[a("span",{className:"dot"},"dot_1"),a("span",{className:"dot"},"dot_2"),a("span",{className:"dot"},"dot_3")]})}var n=d;export{n as default};
1
+ import{jsx as a,jsxs as l}from"react/jsx-runtime";import s from"classnames";const t=n=>{const{className:e}=n;return l("span",{className:s("inline-flex min-h-[19px] items-center text-center leading-7",e),children:[a("span",{className:"animate-blink mx-0.5 h-2 w-2 rounded-full bg-current"},"dot_1"),a("span",{className:"animate-blink mx-0.5 h-2 w-2 rounded-full bg-current [animation-delay:0.2s]"},"dot_2"),a("span",{className:"animate-blink mx-0.5 h-2 w-2 rounded-full bg-current [animation-delay:0.4s]"},"dot_3")]})};var r=t;export{r as default};
2
2
  //# sourceMappingURL=loadingDots.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/components/credits/modal/loadingDots.tsx"],
4
- "sourcesContent": ["import { cn } from '../../../helpers/utils'\n\ninterface LoadingProps {\n className?: string\n}\n\nfunction LoadingDots({ className }: LoadingProps) {\n return (\n <div className={cn(className)}>\n <span className=\"dot\" key={`dot_1`} />\n <span className=\"dot\" key={`dot_2`} />\n <span className=\"dot\" key={`dot_3`} />\n </div>\n )\n}\n\nexport default LoadingDots\n"],
5
- "mappings": "AAQI,OACE,OAAAA,EADF,QAAAC,MAAA,oBARJ,OAAS,MAAAC,MAAU,yBAMnB,SAASC,EAAY,CAAE,UAAAC,CAAU,EAAiB,CAChD,OACEH,EAAC,OAAI,UAAWC,EAAGE,CAAS,EAC1B,UAAAJ,EAAC,QAAK,UAAU,OAAW,OAAS,EACpCA,EAAC,QAAK,UAAU,OAAW,OAAS,EACpCA,EAAC,QAAK,UAAU,OAAW,OAAS,GACtC,CAEJ,CAEA,IAAOK,EAAQF",
6
- "names": ["jsx", "jsxs", "cn", "LoadingDots", "className", "loadingDots_default"]
4
+ "sourcesContent": ["import classNames from 'classnames'\nimport { FC } from 'react'\n\ninterface LoadingProps {\n className?: string\n}\n\nconst LoadingDots: FC<LoadingProps> = props => {\n const { className } = props\n return (\n <span className={classNames('inline-flex min-h-[19px] items-center text-center leading-7', className)}>\n <span className=\"animate-blink mx-0.5 h-2 w-2 rounded-full bg-current\" key={`dot_1`} />\n <span className=\"animate-blink mx-0.5 h-2 w-2 rounded-full bg-current [animation-delay:0.2s]\" key={`dot_2`} />\n <span className=\"animate-blink mx-0.5 h-2 w-2 rounded-full bg-current [animation-delay:0.4s]\" key={`dot_3`} />\n </span>\n )\n}\n\nexport default LoadingDots\n"],
5
+ "mappings": "AAUI,OACE,OAAAA,EADF,QAAAC,MAAA,oBAVJ,OAAOC,MAAgB,aAOvB,MAAMC,EAAgCC,GAAS,CAC7C,KAAM,CAAE,UAAAC,CAAU,EAAID,EACtB,OACEH,EAAC,QAAK,UAAWC,EAAW,8DAA+DG,CAAS,EAClG,UAAAL,EAAC,QAAK,UAAU,wDAA4D,OAAS,EACrFA,EAAC,QAAK,UAAU,+EAAmF,OAAS,EAC5GA,EAAC,QAAK,UAAU,+EAAmF,OAAS,GAC9G,CAEJ,EAEA,IAAOM,EAAQH",
6
+ "names": ["jsx", "jsxs", "classNames", "LoadingDots", "props", "className", "loadingDots_default"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{jsx as n,jsxs as d}from"react/jsx-runtime";import{cn as l}from"../../../helpers/utils";import{useEffect as g,useState as u}from"react";import w from"react-modal";const N=({isOpen:i,title:o,className:m="",overlayClassName:c="",scrollClassName:p="",onClose:a,onScrollEnd:s,children:x,useAnimation:r,animationClassName:C,titleClassName:f="",...v})=>{const[h,L]=u(!1);return g(()=>{r&&requestAnimationFrame(()=>{L(i??!1)})},[i,r]),d(w,{isOpen:i??!1,overlayClassName:l("fixed inset-0 z-[999] flex items-center justify-center bg-black/70 leading-[1.2] md:items-end",c),className:l("min-md:max-h-[calc(100vh-96px)] relative flex min-h-[200px] flex-col overflow-hidden rounded-[16px] bg-white outline-none transition-all duration-300 md:h-[88.27vh] md:w-full md:rounded-b-none",h?"":C,m),onRequestClose:a,...v,children:[d("div",{className:l("flex w-full shrink-0 items-center justify-between",o?"min-l:px-[32px] h-[70px] border-b border-[#e2e2e2] px-[24px]":"h-[48px] px-[16px]",f),children:[n("div",{className:"text-[18px] font-bold",children:o}),n("div",{className:"size-[22px] cursor-pointer",onClick:a,onKeyDown:e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),a?.())},role:"button",tabIndex:0,children:n("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",children:n("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.8525 5.31015C16.4558 4.91337 15.8125 4.91338 15.4157 5.31015L11.1268 9.5991L6.83815 5.31049C6.44138 4.91372 5.79808 4.91372 5.40131 5.31049C5.00454 5.70726 5.00455 6.35055 5.40131 6.74732L9.68993 11.0359L5.40105 15.3248C5.00428 15.7216 5.00428 16.3649 5.40105 16.7616C5.79782 17.1584 6.44111 17.1584 6.83788 16.7616L11.1268 12.4728L15.416 16.762C15.8128 17.1588 16.456 17.1588 16.8528 16.762C17.2496 16.3652 17.2496 15.7219 16.8528 15.3252L12.5636 11.0359L16.8525 6.74698C17.2493 6.35021 17.2493 5.70692 16.8525 5.31015ZM16.921 6.02856C16.921 6.22992 16.8441 6.43127 16.6905 6.5849L14.465 8.8104L12.2395 11.0359L12.2395 11.0359L16.6905 6.58493C16.8441 6.43129 16.921 6.22993 16.921 6.02856ZM5.34966 6.19087C5.37992 6.3354 5.45115 6.47307 5.56336 6.58528L10.014 11.0359L10.014 11.0359L5.56336 6.58524C5.45116 6.47304 5.37992 6.33539 5.34966 6.19087ZM5.35087 16.2121C5.38193 16.3541 5.45267 16.4891 5.56309 16.5996C5.87037 16.9068 6.36856 16.9068 6.67583 16.5996L11.1268 12.1486L15.578 16.5999C15.8853 16.9072 16.3835 16.9072 16.6908 16.5999C16.8498 16.4409 16.9265 16.2307 16.9209 16.0223C16.9265 16.2307 16.8498 16.4409 16.6908 16.5999C16.3835 16.9072 15.8853 16.9072 15.578 16.5999L11.1268 12.1487L6.67583 16.5996C6.36856 16.9069 5.87037 16.9069 5.56309 16.5996C5.45267 16.4892 5.38192 16.3541 5.35087 16.2121Z",fill:"#333333"})})})]}),n("div",{className:l("my-[32px] flex-1 overflow-auto overscroll-contain px-[24px] md:mb-[48px]",!o&&"mt-0","min-l:px-[32px]",p),onScroll:e=>{const t=e.target;t.scrollHeight<=t.clientHeight||t.scrollTop+t.clientHeight>=t.scrollHeight-50&&s&&s(e)},children:x})]})};export{N as CreditsModalContainer};
1
+ import{jsx as n,jsxs as d}from"react/jsx-runtime";import{classNames as l,useHeadlessContext as b,ROUNDED_BRANDS as w}from"@anker-in/lib";import{useEffect as N,useState as y}from"react";import M from"react-modal";const H=({isOpen:o,title:i,className:m="",overlayClassName:c="",scrollClassName:p="",onClose:s,onScrollEnd:a,children:x,useAnimation:r,animationClassName:C,titleClassName:f="",...v})=>{const[u,h]=y(!1);N(()=>{r&&requestAnimationFrame(()=>{h(o??!1)})},[o,r]);const{brand:L}=b(),g=w.includes(L);return d(M,{isOpen:o??!1,overlayClassName:l("fixed inset-0 z-[999] flex items-center justify-center bg-black/70 leading-[1.2] md:items-end",c),className:l("min-md:max-h-[calc(100vh-96px)] relative flex min-h-[200px] flex-col overflow-hidden rounded-[16px] bg-white outline-none transition-all duration-300 md:h-[88.27vh] md:w-full md:rounded-b-none",!g&&"rounded-none",u?"":C,m),onRequestClose:s,...v,children:[d("div",{className:l("flex w-full shrink-0 items-center justify-between",i?"min-l:px-[32px] h-[70px] border-b border-[#e2e2e2] px-[24px]":"h-[48px] px-[16px]",f),children:[n("div",{className:"text-[18px] font-bold",children:i}),n("div",{className:"size-[22px] cursor-pointer",onClick:s,onKeyDown:e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),s?.())},role:"button",tabIndex:0,children:n("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",children:n("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.8525 5.31015C16.4558 4.91337 15.8125 4.91338 15.4157 5.31015L11.1268 9.5991L6.83815 5.31049C6.44138 4.91372 5.79808 4.91372 5.40131 5.31049C5.00454 5.70726 5.00455 6.35055 5.40131 6.74732L9.68993 11.0359L5.40105 15.3248C5.00428 15.7216 5.00428 16.3649 5.40105 16.7616C5.79782 17.1584 6.44111 17.1584 6.83788 16.7616L11.1268 12.4728L15.416 16.762C15.8128 17.1588 16.456 17.1588 16.8528 16.762C17.2496 16.3652 17.2496 15.7219 16.8528 15.3252L12.5636 11.0359L16.8525 6.74698C17.2493 6.35021 17.2493 5.70692 16.8525 5.31015ZM16.921 6.02856C16.921 6.22992 16.8441 6.43127 16.6905 6.5849L14.465 8.8104L12.2395 11.0359L12.2395 11.0359L16.6905 6.58493C16.8441 6.43129 16.921 6.22993 16.921 6.02856ZM5.34966 6.19087C5.37992 6.3354 5.45115 6.47307 5.56336 6.58528L10.014 11.0359L10.014 11.0359L5.56336 6.58524C5.45116 6.47304 5.37992 6.33539 5.34966 6.19087ZM5.35087 16.2121C5.38193 16.3541 5.45267 16.4891 5.56309 16.5996C5.87037 16.9068 6.36856 16.9068 6.67583 16.5996L11.1268 12.1486L15.578 16.5999C15.8853 16.9072 16.3835 16.9072 16.6908 16.5999C16.8498 16.4409 16.9265 16.2307 16.9209 16.0223C16.9265 16.2307 16.8498 16.4409 16.6908 16.5999C16.3835 16.9072 15.8853 16.9072 15.578 16.5999L11.1268 12.1487L6.67583 16.5996C6.36856 16.9069 5.87037 16.9069 5.56309 16.5996C5.45267 16.4892 5.38192 16.3541 5.35087 16.2121Z",fill:"#333333"})})})]}),n("div",{className:l("my-[32px] flex-1 overflow-auto overscroll-contain px-[24px] md:mb-[48px]",!i&&"mt-0","min-l:px-[32px]",p),onScroll:e=>{const t=e.target;t.scrollHeight<=t.clientHeight||t.scrollTop+t.clientHeight>=t.scrollHeight-50&&a&&a(e)},children:x})]})};export{H as CreditsModalContainer};
2
2
  //# sourceMappingURL=modalContainer.js.map