@anker-in/campaign-ui 0.1.10 → 0.2.0-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 (677) hide show
  1. package/dist/cjs/components/chat/action.js +1 -1
  2. package/dist/cjs/components/chat/action.js.map +1 -1
  3. package/dist/cjs/components/chat/button.d.ts +1 -1
  4. package/dist/cjs/components/chat/button.js +1 -1
  5. package/dist/cjs/components/chat/button.js.map +1 -1
  6. package/dist/cjs/components/chat/index.js +1 -1
  7. package/dist/cjs/components/chat/index.js.map +3 -3
  8. package/dist/cjs/components/chat/{Messages.d.ts → messages.d.ts} +1 -1
  9. package/dist/cjs/components/chat/messages.js +1 -1
  10. package/dist/cjs/components/chat/messages.js.map +2 -2
  11. package/dist/cjs/components/chat/props.js +1 -1
  12. package/dist/cjs/components/chat/props.js.map +2 -2
  13. package/dist/cjs/components/chat/response.js +1 -1
  14. package/dist/cjs/components/chat/response.js.map +2 -2
  15. package/dist/cjs/components/chat/suggestions.d.ts +1 -1
  16. package/dist/cjs/components/chat/suggestions.js.map +1 -1
  17. package/dist/cjs/components/credits/const.d.ts +1 -0
  18. package/dist/cjs/components/credits/const.js +2 -0
  19. package/dist/cjs/components/credits/const.js.map +7 -0
  20. package/dist/cjs/components/credits/context/const.d.ts +82 -0
  21. package/dist/cjs/components/credits/context/const.js +2 -0
  22. package/dist/cjs/components/credits/context/const.js.map +7 -0
  23. package/dist/cjs/components/credits/context/hooks/useActivities.d.ts +12 -0
  24. package/dist/cjs/components/credits/context/hooks/useActivities.js +2 -0
  25. package/dist/cjs/components/credits/context/hooks/useActivities.js.map +7 -0
  26. package/dist/cjs/components/credits/context/hooks/useAddressValidate.d.ts +34 -0
  27. package/dist/cjs/components/credits/context/hooks/useAddressValidate.js +2 -0
  28. package/dist/cjs/components/credits/context/hooks/useAddressValidate.js.map +7 -0
  29. package/dist/cjs/components/credits/context/hooks/useAlpcFetch.d.ts +23 -0
  30. package/dist/cjs/components/credits/context/hooks/useAlpcFetch.js +2 -0
  31. package/dist/cjs/components/credits/context/hooks/useAlpcFetch.js.map +7 -0
  32. package/dist/cjs/components/credits/context/hooks/useClickOutside.d.ts +3 -0
  33. package/dist/cjs/components/credits/context/hooks/useClickOutside.js +2 -0
  34. package/dist/cjs/components/credits/context/hooks/useClickOutside.js.map +7 -0
  35. package/dist/cjs/components/credits/context/hooks/useCopy.d.ts +5 -0
  36. package/dist/cjs/components/credits/context/hooks/useCopy.js +2 -0
  37. package/dist/cjs/components/credits/context/hooks/useCopy.js.map +7 -0
  38. package/dist/cjs/components/credits/context/hooks/useCountries.d.ts +8 -0
  39. package/dist/cjs/components/credits/context/hooks/useCountries.js +2 -0
  40. package/dist/cjs/components/credits/context/hooks/useCountries.js.map +7 -0
  41. package/dist/cjs/components/credits/context/hooks/useFirstPurchaseFinished.d.ts +1 -0
  42. package/dist/cjs/components/credits/context/hooks/useFirstPurchaseFinished.js +2 -0
  43. package/dist/cjs/components/credits/context/hooks/useFirstPurchaseFinished.js.map +7 -0
  44. package/dist/cjs/components/credits/context/hooks/useMyRewards.d.ts +14 -0
  45. package/dist/cjs/components/credits/context/hooks/useMyRewards.js +2 -0
  46. package/dist/cjs/components/credits/context/hooks/useMyRewards.js.map +7 -0
  47. package/dist/cjs/components/credits/context/hooks/useReceiptUploaded.d.ts +2 -0
  48. package/dist/cjs/components/credits/context/hooks/useReceiptUploaded.js +2 -0
  49. package/dist/cjs/components/credits/context/hooks/useReceiptUploaded.js.map +7 -0
  50. package/dist/cjs/components/credits/context/hooks/useRedeemAndBuy.d.ts +9 -0
  51. package/dist/cjs/components/credits/context/hooks/useRedeemAndBuy.js +2 -0
  52. package/dist/cjs/components/credits/context/hooks/useRedeemAndBuy.js.map +7 -0
  53. package/dist/cjs/components/credits/context/hooks/useRedeemCoupon.d.ts +18 -0
  54. package/dist/cjs/components/credits/context/hooks/useRedeemCoupon.js +2 -0
  55. package/dist/cjs/components/credits/context/hooks/useRedeemCoupon.js.map +7 -0
  56. package/dist/cjs/components/credits/context/hooks/useRedeemProduct.d.ts +16 -0
  57. package/dist/cjs/components/credits/context/hooks/useRedeemProduct.js +2 -0
  58. package/dist/cjs/components/credits/context/hooks/useRedeemProduct.js.map +7 -0
  59. package/dist/cjs/components/credits/context/hooks/useRedeemableList.d.ts +7 -0
  60. package/dist/cjs/components/credits/context/hooks/useRedeemableList.js +2 -0
  61. package/dist/cjs/components/credits/context/hooks/useRedeemableList.js.map +7 -0
  62. package/dist/cjs/components/credits/context/hooks/useSubscribed.d.ts +1 -0
  63. package/dist/cjs/components/credits/context/hooks/useSubscribed.js +2 -0
  64. package/dist/cjs/components/credits/context/hooks/useSubscribed.js.map +7 -0
  65. package/dist/cjs/components/credits/context/hooks/useUploadReceipt.d.ts +14 -0
  66. package/dist/cjs/components/credits/context/hooks/useUploadReceipt.js +2 -0
  67. package/dist/cjs/components/credits/context/hooks/useUploadReceipt.js.map +7 -0
  68. package/dist/cjs/components/credits/context/provider.d.ts +24 -0
  69. package/dist/cjs/components/credits/context/provider.js +2 -0
  70. package/dist/cjs/components/credits/context/provider.js.map +7 -0
  71. package/dist/cjs/components/credits/context/response.d.ts +63 -0
  72. package/dist/cjs/components/credits/context/response.js +2 -0
  73. package/dist/cjs/components/credits/context/response.js.map +7 -0
  74. package/dist/cjs/components/credits/context/utils.d.ts +25 -0
  75. package/dist/cjs/components/credits/context/utils.js +2 -0
  76. package/dist/cjs/components/credits/context/utils.js.map +7 -0
  77. package/dist/cjs/components/credits/creditsBanner/index.d.ts +23 -0
  78. package/dist/cjs/components/credits/creditsBanner/index.js +2 -0
  79. package/dist/cjs/components/credits/creditsBanner/index.js.map +7 -0
  80. package/dist/cjs/components/credits/creditsBenefits/benefitItem.d.ts +19 -0
  81. package/dist/cjs/components/credits/creditsBenefits/benefitItem.js +2 -0
  82. package/dist/cjs/components/credits/creditsBenefits/benefitItem.js.map +7 -0
  83. package/dist/cjs/components/credits/creditsBenefits/iconInfo.d.ts +2 -0
  84. package/dist/cjs/components/credits/creditsBenefits/iconInfo.js +2 -0
  85. package/dist/cjs/components/credits/creditsBenefits/iconInfo.js.map +7 -0
  86. package/dist/cjs/components/credits/creditsBenefits/index.d.ts +11 -0
  87. package/dist/cjs/components/credits/creditsBenefits/index.js +4 -0
  88. package/dist/cjs/components/credits/creditsBenefits/index.js.map +7 -0
  89. package/dist/cjs/components/credits/creditsCash/CreditsCash.d.ts +4 -0
  90. package/dist/cjs/components/credits/creditsCash/CreditsCash.js +2 -0
  91. package/dist/cjs/components/credits/creditsCash/CreditsCash.js.map +7 -0
  92. package/dist/cjs/components/credits/creditsCash/RedeemableItem.d.ts +9 -0
  93. package/dist/cjs/components/credits/creditsCash/RedeemableItem.js +2 -0
  94. package/dist/cjs/components/credits/creditsCash/RedeemableItem.js.map +7 -0
  95. package/dist/cjs/components/credits/creditsCash/index.d.ts +2 -0
  96. package/dist/cjs/components/credits/creditsCash/index.js +2 -0
  97. package/dist/cjs/components/credits/creditsCash/index.js.map +7 -0
  98. package/dist/cjs/components/credits/creditsCash/type.d.ts +47 -0
  99. package/dist/cjs/components/credits/creditsCash/type.js +2 -0
  100. package/dist/cjs/components/credits/creditsCash/type.js.map +7 -0
  101. package/dist/cjs/components/credits/creditsFaq/faqItem/FaqItem.d.ts +13 -0
  102. package/dist/cjs/components/credits/creditsFaq/faqItem/FaqItem.js +2 -0
  103. package/dist/cjs/components/credits/creditsFaq/faqItem/FaqItem.js.map +7 -0
  104. package/dist/cjs/components/credits/creditsFaq/index.d.ts +16 -0
  105. package/dist/cjs/components/credits/creditsFaq/index.js +2 -0
  106. package/dist/cjs/components/credits/creditsFaq/index.js.map +7 -0
  107. package/dist/cjs/components/credits/creditsInfoCard/index.d.ts +16 -0
  108. package/dist/cjs/components/credits/creditsInfoCard/index.js +2 -0
  109. package/dist/cjs/components/credits/creditsInfoCard/index.js.map +7 -0
  110. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/CountrySelect.d.ts +14 -0
  111. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/CountrySelect.js +2 -0
  112. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/CountrySelect.js.map +7 -0
  113. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/FormItem.d.ts +6 -0
  114. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/FormItem.js +2 -0
  115. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/FormItem.js.map +7 -0
  116. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/Input.d.ts +13 -0
  117. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/Input.js +2 -0
  118. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/Input.js.map +7 -0
  119. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/StateSelect.d.ts +15 -0
  120. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/StateSelect.js +2 -0
  121. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/StateSelect.js.map +7 -0
  122. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/index.d.ts +2 -0
  123. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/index.js +2 -0
  124. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/index.js.map +7 -0
  125. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/type.d.ts +26 -0
  126. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/type.js +2 -0
  127. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/type.js.map +7 -0
  128. package/dist/cjs/components/credits/creditsRedeemList/CreditsRedeemList.d.ts +4 -0
  129. package/dist/cjs/components/credits/creditsRedeemList/CreditsRedeemList.js +2 -0
  130. package/dist/cjs/components/credits/creditsRedeemList/CreditsRedeemList.js.map +7 -0
  131. package/dist/cjs/components/credits/creditsRedeemList/NonProductValue.d.ts +4 -0
  132. package/dist/cjs/components/credits/creditsRedeemList/NonProductValue.js +2 -0
  133. package/dist/cjs/components/credits/creditsRedeemList/NonProductValue.js.map +7 -0
  134. package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.d.ts +9 -0
  135. package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.js +2 -0
  136. package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.js.map +7 -0
  137. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.d.ts +20 -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/creditsRedeemList/RedeemProductModal/Error.d.ts +8 -0
  141. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Error.js +2 -0
  142. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Error.js.map +7 -0
  143. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Init.d.ts +11 -0
  144. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Init.js +2 -0
  145. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Init.js.map +7 -0
  146. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.d.ts +6 -0
  147. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js +2 -0
  148. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js.map +7 -0
  149. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.d.ts +8 -0
  150. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js +2 -0
  151. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js.map +7 -0
  152. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.d.ts +13 -0
  153. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.js +2 -0
  154. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.js.map +7 -0
  155. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.d.ts +11 -0
  156. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.js +2 -0
  157. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.js.map +7 -0
  158. package/dist/cjs/components/credits/creditsRedeemList/RedeemableItem.d.ts +9 -0
  159. package/dist/cjs/components/credits/creditsRedeemList/RedeemableItem.js +2 -0
  160. package/dist/cjs/components/credits/creditsRedeemList/RedeemableItem.js.map +7 -0
  161. package/dist/cjs/components/credits/creditsRedeemList/index.d.ts +2 -0
  162. package/dist/cjs/components/credits/creditsRedeemList/index.js +2 -0
  163. package/dist/cjs/components/credits/creditsRedeemList/index.js.map +7 -0
  164. package/dist/cjs/components/credits/creditsRedeemList/type.d.ts +63 -0
  165. package/dist/cjs/components/credits/creditsRedeemList/type.js +2 -0
  166. package/dist/cjs/components/credits/creditsRedeemList/type.js.map +7 -0
  167. package/dist/cjs/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.d.ts +2 -0
  168. package/dist/cjs/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js +2 -0
  169. package/dist/cjs/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js.map +7 -0
  170. package/dist/cjs/components/credits/creditsWaysToGetCredits/index.d.ts +2 -0
  171. package/dist/cjs/components/credits/creditsWaysToGetCredits/index.js +2 -0
  172. package/dist/cjs/components/credits/creditsWaysToGetCredits/index.js.map +7 -0
  173. package/dist/cjs/components/credits/creditsWaysToGetCredits/type.d.ts +49 -0
  174. package/dist/cjs/components/credits/creditsWaysToGetCredits/type.js +2 -0
  175. package/dist/cjs/components/credits/creditsWaysToGetCredits/type.js.map +7 -0
  176. package/dist/cjs/components/credits/creditsWaysToGetCredits/useActions.d.ts +105 -0
  177. package/dist/cjs/components/credits/creditsWaysToGetCredits/useActions.js +2 -0
  178. package/dist/cjs/components/credits/creditsWaysToGetCredits/useActions.js.map +7 -0
  179. package/dist/cjs/components/credits/index.d.ts +10 -0
  180. package/dist/cjs/components/credits/index.js +2 -0
  181. package/dist/cjs/components/credits/index.js.map +7 -0
  182. package/dist/cjs/components/credits/modal/MyRewardsModal.d.ts +32 -0
  183. package/dist/cjs/components/credits/modal/MyRewardsModal.js +2 -0
  184. package/dist/cjs/components/credits/modal/MyRewardsModal.js.map +7 -0
  185. package/dist/cjs/components/credits/modal/activitiesModal.d.ts +32 -0
  186. package/dist/cjs/components/credits/modal/activitiesModal.js +2 -0
  187. package/dist/cjs/components/credits/modal/activitiesModal.js.map +7 -0
  188. package/dist/cjs/components/credits/modal/creditsUploadReceiptModal.d.ts +24 -0
  189. package/dist/cjs/components/credits/modal/creditsUploadReceiptModal.js +2 -0
  190. package/dist/cjs/components/credits/modal/creditsUploadReceiptModal.js.map +7 -0
  191. package/dist/cjs/components/credits/modal/loadingDots.d.ts +6 -0
  192. package/dist/cjs/components/credits/modal/loadingDots.js +2 -0
  193. package/dist/cjs/components/credits/modal/loadingDots.js.map +7 -0
  194. package/dist/cjs/components/credits/modal/modalContainer.d.ts +15 -0
  195. package/dist/cjs/components/credits/modal/modalContainer.js +2 -0
  196. package/dist/cjs/components/credits/modal/modalContainer.js.map +7 -0
  197. package/dist/cjs/components/credits/modal/rulesModal.d.ts +7 -0
  198. package/dist/cjs/components/credits/modal/rulesModal.js +2 -0
  199. package/dist/cjs/components/credits/modal/rulesModal.js.map +7 -0
  200. package/dist/cjs/components/credits/modal/subscribeModal.d.ts +15 -0
  201. package/dist/cjs/components/credits/modal/subscribeModal.js +2 -0
  202. package/dist/cjs/components/credits/modal/subscribeModal.js.map +7 -0
  203. package/dist/cjs/components/credits/modal/tip.d.ts +5 -0
  204. package/dist/cjs/components/credits/modal/tip.js +2 -0
  205. package/dist/cjs/components/credits/modal/tip.js.map +7 -0
  206. package/dist/cjs/components/credits/type.d.ts +72 -0
  207. package/dist/cjs/components/credits/type.js +2 -0
  208. package/dist/cjs/components/credits/type.js.map +7 -0
  209. package/dist/cjs/components/index.d.ts +4 -2
  210. package/dist/cjs/components/index.js +1 -1
  211. package/dist/cjs/components/index.js.map +3 -3
  212. package/dist/cjs/components/registration/authCodeActivate/Message.d.ts +4 -0
  213. package/dist/cjs/components/registration/authCodeActivate/Message.js +2 -0
  214. package/dist/cjs/components/registration/authCodeActivate/Message.js.map +7 -0
  215. package/dist/cjs/components/registration/authCodeActivate/index.d.ts +3 -0
  216. package/dist/cjs/components/registration/authCodeActivate/index.js +2 -0
  217. package/dist/cjs/components/registration/authCodeActivate/index.js.map +7 -0
  218. package/dist/cjs/components/registration/authCodeActivate/type.d.ts +23 -0
  219. package/dist/cjs/components/registration/authCodeActivate/type.js +2 -0
  220. package/dist/cjs/components/registration/authCodeActivate/type.js.map +7 -0
  221. package/dist/cjs/components/registration/context/index.d.ts +1 -0
  222. package/dist/cjs/components/registration/context/index.js +2 -0
  223. package/dist/cjs/components/registration/context/index.js.map +7 -0
  224. package/dist/cjs/components/registration/context/provider.d.ts +25 -0
  225. package/dist/cjs/components/registration/context/provider.js +2 -0
  226. package/dist/cjs/components/registration/context/provider.js.map +7 -0
  227. package/dist/cjs/components/registration/index.d.ts +2 -0
  228. package/dist/cjs/components/registration/index.js +2 -0
  229. package/dist/cjs/components/registration/index.js.map +7 -0
  230. package/dist/cjs/components/registration/modalContainer.d.ts +15 -0
  231. package/dist/cjs/components/registration/modalContainer.js +2 -0
  232. package/dist/cjs/components/registration/modalContainer.js.map +7 -0
  233. package/dist/cjs/debug-env.d.ts +7 -0
  234. package/dist/cjs/debug-env.js +2 -0
  235. package/dist/cjs/debug-env.js.map +7 -0
  236. package/dist/cjs/index.d.ts +2 -1
  237. package/dist/cjs/index.js +1 -1
  238. package/dist/cjs/index.js.map +2 -2
  239. package/dist/cjs/stories/chat.stories.d.ts +1 -1
  240. package/dist/cjs/stories/chat.stories.js +1 -1
  241. package/dist/cjs/stories/chat.stories.js.map +3 -3
  242. package/dist/cjs/templates/credits.d.ts +58 -0
  243. package/dist/cjs/templates/credits.js +2 -0
  244. package/dist/cjs/templates/credits.js.map +7 -0
  245. package/dist/cjs/templates/index.d.ts +1 -0
  246. package/dist/cjs/templates/index.js +2 -0
  247. package/dist/cjs/templates/index.js.map +7 -0
  248. package/dist/esm/components/chat/action.js +1 -1
  249. package/dist/esm/components/chat/action.js.map +1 -1
  250. package/dist/esm/components/chat/button.d.ts +1 -1
  251. package/dist/esm/components/chat/button.js +1 -1
  252. package/dist/esm/components/chat/button.js.map +1 -1
  253. package/dist/esm/components/chat/index.js +1 -1
  254. package/dist/esm/components/chat/index.js.map +2 -2
  255. package/dist/esm/components/chat/{Messages.d.ts → messages.d.ts} +1 -1
  256. package/dist/esm/components/chat/messages.js +1 -1
  257. package/dist/esm/components/chat/messages.js.map +2 -2
  258. package/dist/esm/components/chat/props.js +0 -1
  259. package/dist/esm/components/chat/props.js.map +3 -3
  260. package/dist/esm/components/chat/response.js +1 -1
  261. package/dist/esm/components/chat/response.js.map +2 -2
  262. package/dist/esm/components/chat/suggestions.d.ts +1 -1
  263. package/dist/esm/components/chat/suggestions.js.map +1 -1
  264. package/dist/esm/components/credits/const.d.ts +1 -0
  265. package/dist/esm/components/credits/const.js +2 -0
  266. package/dist/esm/components/credits/const.js.map +7 -0
  267. package/dist/esm/components/credits/context/const.d.ts +82 -0
  268. package/dist/esm/components/credits/context/const.js +2 -0
  269. package/dist/esm/components/credits/context/const.js.map +7 -0
  270. package/dist/esm/components/credits/context/hooks/useActivities.d.ts +12 -0
  271. package/dist/esm/components/credits/context/hooks/useActivities.js +2 -0
  272. package/dist/esm/components/credits/context/hooks/useActivities.js.map +7 -0
  273. package/dist/esm/components/credits/context/hooks/useAddressValidate.d.ts +34 -0
  274. package/dist/esm/components/credits/context/hooks/useAddressValidate.js +2 -0
  275. package/dist/esm/components/credits/context/hooks/useAddressValidate.js.map +7 -0
  276. package/dist/esm/components/credits/context/hooks/useAlpcFetch.d.ts +23 -0
  277. package/dist/esm/components/credits/context/hooks/useAlpcFetch.js +2 -0
  278. package/dist/esm/components/credits/context/hooks/useAlpcFetch.js.map +7 -0
  279. package/dist/esm/components/credits/context/hooks/useClickOutside.d.ts +3 -0
  280. package/dist/esm/components/credits/context/hooks/useClickOutside.js +2 -0
  281. package/dist/esm/components/credits/context/hooks/useClickOutside.js.map +7 -0
  282. package/dist/esm/components/credits/context/hooks/useCopy.d.ts +5 -0
  283. package/dist/esm/components/credits/context/hooks/useCopy.js +2 -0
  284. package/dist/esm/components/credits/context/hooks/useCopy.js.map +7 -0
  285. package/dist/esm/components/credits/context/hooks/useCountries.d.ts +8 -0
  286. package/dist/esm/components/credits/context/hooks/useCountries.js +2 -0
  287. package/dist/esm/components/credits/context/hooks/useCountries.js.map +7 -0
  288. package/dist/esm/components/credits/context/hooks/useFirstPurchaseFinished.d.ts +1 -0
  289. package/dist/esm/components/credits/context/hooks/useFirstPurchaseFinished.js +2 -0
  290. package/dist/esm/components/credits/context/hooks/useFirstPurchaseFinished.js.map +7 -0
  291. package/dist/esm/components/credits/context/hooks/useMyRewards.d.ts +14 -0
  292. package/dist/esm/components/credits/context/hooks/useMyRewards.js +2 -0
  293. package/dist/esm/components/credits/context/hooks/useMyRewards.js.map +7 -0
  294. package/dist/esm/components/credits/context/hooks/useReceiptUploaded.d.ts +2 -0
  295. package/dist/esm/components/credits/context/hooks/useReceiptUploaded.js +2 -0
  296. package/dist/esm/components/credits/context/hooks/useReceiptUploaded.js.map +7 -0
  297. package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.d.ts +9 -0
  298. package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.js +2 -0
  299. package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.js.map +7 -0
  300. package/dist/esm/components/credits/context/hooks/useRedeemCoupon.d.ts +18 -0
  301. package/dist/esm/components/credits/context/hooks/useRedeemCoupon.js +2 -0
  302. package/dist/esm/components/credits/context/hooks/useRedeemCoupon.js.map +7 -0
  303. package/dist/esm/components/credits/context/hooks/useRedeemProduct.d.ts +16 -0
  304. package/dist/esm/components/credits/context/hooks/useRedeemProduct.js +2 -0
  305. package/dist/esm/components/credits/context/hooks/useRedeemProduct.js.map +7 -0
  306. package/dist/esm/components/credits/context/hooks/useRedeemableList.d.ts +7 -0
  307. package/dist/esm/components/credits/context/hooks/useRedeemableList.js +2 -0
  308. package/dist/esm/components/credits/context/hooks/useRedeemableList.js.map +7 -0
  309. package/dist/esm/components/credits/context/hooks/useSubscribed.d.ts +1 -0
  310. package/dist/esm/components/credits/context/hooks/useSubscribed.js +2 -0
  311. package/dist/esm/components/credits/context/hooks/useSubscribed.js.map +7 -0
  312. package/dist/esm/components/credits/context/hooks/useUploadReceipt.d.ts +14 -0
  313. package/dist/esm/components/credits/context/hooks/useUploadReceipt.js +2 -0
  314. package/dist/esm/components/credits/context/hooks/useUploadReceipt.js.map +7 -0
  315. package/dist/esm/components/credits/context/provider.d.ts +24 -0
  316. package/dist/esm/components/credits/context/provider.js +2 -0
  317. package/dist/esm/components/credits/context/provider.js.map +7 -0
  318. package/dist/esm/components/credits/context/response.d.ts +63 -0
  319. package/dist/esm/components/credits/context/response.js +1 -0
  320. package/dist/esm/components/credits/context/utils.d.ts +25 -0
  321. package/dist/esm/components/credits/context/utils.js +2 -0
  322. package/dist/esm/components/credits/context/utils.js.map +7 -0
  323. package/dist/esm/components/credits/creditsBanner/index.d.ts +23 -0
  324. package/dist/esm/components/credits/creditsBanner/index.js +2 -0
  325. package/dist/esm/components/credits/creditsBanner/index.js.map +7 -0
  326. package/dist/esm/components/credits/creditsBenefits/benefitItem.d.ts +19 -0
  327. package/dist/esm/components/credits/creditsBenefits/benefitItem.js +2 -0
  328. package/dist/esm/components/credits/creditsBenefits/benefitItem.js.map +7 -0
  329. package/dist/esm/components/credits/creditsBenefits/iconInfo.d.ts +2 -0
  330. package/dist/esm/components/credits/creditsBenefits/iconInfo.js +2 -0
  331. package/dist/esm/components/credits/creditsBenefits/iconInfo.js.map +7 -0
  332. package/dist/esm/components/credits/creditsBenefits/index.d.ts +11 -0
  333. package/dist/esm/components/credits/creditsBenefits/index.js +4 -0
  334. package/dist/esm/components/credits/creditsBenefits/index.js.map +7 -0
  335. package/dist/esm/components/credits/creditsCash/CreditsCash.d.ts +4 -0
  336. package/dist/esm/components/credits/creditsCash/CreditsCash.js +2 -0
  337. package/dist/esm/components/credits/creditsCash/CreditsCash.js.map +7 -0
  338. package/dist/esm/components/credits/creditsCash/RedeemableItem.d.ts +9 -0
  339. package/dist/esm/components/credits/creditsCash/RedeemableItem.js +2 -0
  340. package/dist/esm/components/credits/creditsCash/RedeemableItem.js.map +7 -0
  341. package/dist/esm/components/credits/creditsCash/index.d.ts +2 -0
  342. package/dist/esm/components/credits/creditsCash/index.js +2 -0
  343. package/dist/esm/components/credits/creditsCash/index.js.map +7 -0
  344. package/dist/esm/components/credits/creditsCash/type.d.ts +47 -0
  345. package/dist/esm/components/credits/creditsCash/type.js +1 -0
  346. package/dist/esm/components/credits/creditsFaq/faqItem/FaqItem.d.ts +13 -0
  347. package/dist/esm/components/credits/creditsFaq/faqItem/FaqItem.js +2 -0
  348. package/dist/esm/components/credits/creditsFaq/faqItem/FaqItem.js.map +7 -0
  349. package/dist/esm/components/credits/creditsFaq/index.d.ts +16 -0
  350. package/dist/esm/components/credits/creditsFaq/index.js +2 -0
  351. package/dist/esm/components/credits/creditsFaq/index.js.map +7 -0
  352. package/dist/esm/components/credits/creditsInfoCard/index.d.ts +16 -0
  353. package/dist/esm/components/credits/creditsInfoCard/index.js +2 -0
  354. package/dist/esm/components/credits/creditsInfoCard/index.js.map +7 -0
  355. package/dist/esm/components/credits/creditsRedeemList/AddressForm/CountrySelect.d.ts +14 -0
  356. package/dist/esm/components/credits/creditsRedeemList/AddressForm/CountrySelect.js +2 -0
  357. package/dist/esm/components/credits/creditsRedeemList/AddressForm/CountrySelect.js.map +7 -0
  358. package/dist/esm/components/credits/creditsRedeemList/AddressForm/FormItem.d.ts +6 -0
  359. package/dist/esm/components/credits/creditsRedeemList/AddressForm/FormItem.js +2 -0
  360. package/dist/esm/components/credits/creditsRedeemList/AddressForm/FormItem.js.map +7 -0
  361. package/dist/esm/components/credits/creditsRedeemList/AddressForm/Input.d.ts +13 -0
  362. package/dist/esm/components/credits/creditsRedeemList/AddressForm/Input.js +2 -0
  363. package/dist/esm/components/credits/creditsRedeemList/AddressForm/Input.js.map +7 -0
  364. package/dist/esm/components/credits/creditsRedeemList/AddressForm/StateSelect.d.ts +15 -0
  365. package/dist/esm/components/credits/creditsRedeemList/AddressForm/StateSelect.js +2 -0
  366. package/dist/esm/components/credits/creditsRedeemList/AddressForm/StateSelect.js.map +7 -0
  367. package/dist/esm/components/credits/creditsRedeemList/AddressForm/index.d.ts +2 -0
  368. package/dist/esm/components/credits/creditsRedeemList/AddressForm/index.js +2 -0
  369. package/dist/esm/components/credits/creditsRedeemList/AddressForm/index.js.map +7 -0
  370. package/dist/esm/components/credits/creditsRedeemList/AddressForm/type.d.ts +26 -0
  371. package/dist/esm/components/credits/creditsRedeemList/AddressForm/type.js +1 -0
  372. package/dist/esm/components/credits/creditsRedeemList/AddressForm/type.js.map +7 -0
  373. package/dist/esm/components/credits/creditsRedeemList/CreditsRedeemList.d.ts +4 -0
  374. package/dist/esm/components/credits/creditsRedeemList/CreditsRedeemList.js +2 -0
  375. package/dist/esm/components/credits/creditsRedeemList/CreditsRedeemList.js.map +7 -0
  376. package/dist/esm/components/credits/creditsRedeemList/NonProductValue.d.ts +4 -0
  377. package/dist/esm/components/credits/creditsRedeemList/NonProductValue.js +2 -0
  378. package/dist/esm/components/credits/creditsRedeemList/NonProductValue.js.map +7 -0
  379. package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.d.ts +9 -0
  380. package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.js +2 -0
  381. package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.js.map +7 -0
  382. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.d.ts +20 -0
  383. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.js +2 -0
  384. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.js.map +7 -0
  385. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Error.d.ts +8 -0
  386. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Error.js +2 -0
  387. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Error.js.map +7 -0
  388. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.d.ts +11 -0
  389. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.js +2 -0
  390. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.js.map +7 -0
  391. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.d.ts +6 -0
  392. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js +2 -0
  393. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js.map +7 -0
  394. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.d.ts +8 -0
  395. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js +2 -0
  396. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js.map +7 -0
  397. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.d.ts +13 -0
  398. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.js +2 -0
  399. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.js.map +7 -0
  400. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.d.ts +11 -0
  401. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.js +2 -0
  402. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.js.map +7 -0
  403. package/dist/esm/components/credits/creditsRedeemList/RedeemableItem.d.ts +9 -0
  404. package/dist/esm/components/credits/creditsRedeemList/RedeemableItem.js +2 -0
  405. package/dist/esm/components/credits/creditsRedeemList/RedeemableItem.js.map +7 -0
  406. package/dist/esm/components/credits/creditsRedeemList/index.d.ts +2 -0
  407. package/dist/esm/components/credits/creditsRedeemList/index.js +2 -0
  408. package/dist/esm/components/credits/creditsRedeemList/index.js.map +7 -0
  409. package/dist/esm/components/credits/creditsRedeemList/type.d.ts +63 -0
  410. package/dist/esm/components/credits/creditsRedeemList/type.js +1 -0
  411. package/dist/esm/components/credits/creditsRedeemList/type.js.map +7 -0
  412. package/dist/esm/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.d.ts +2 -0
  413. package/dist/esm/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js +2 -0
  414. package/dist/esm/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js.map +7 -0
  415. package/dist/esm/components/credits/creditsWaysToGetCredits/index.d.ts +2 -0
  416. package/dist/esm/components/credits/creditsWaysToGetCredits/index.js +2 -0
  417. package/dist/esm/components/credits/creditsWaysToGetCredits/index.js.map +7 -0
  418. package/dist/esm/components/credits/creditsWaysToGetCredits/type.d.ts +49 -0
  419. package/dist/esm/components/credits/creditsWaysToGetCredits/type.js +2 -0
  420. package/dist/esm/components/credits/creditsWaysToGetCredits/type.js.map +7 -0
  421. package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.d.ts +105 -0
  422. package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.js +2 -0
  423. package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.js.map +7 -0
  424. package/dist/esm/components/credits/index.d.ts +10 -0
  425. package/dist/esm/components/credits/index.js +2 -0
  426. package/dist/esm/components/credits/index.js.map +7 -0
  427. package/dist/esm/components/credits/modal/MyRewardsModal.d.ts +32 -0
  428. package/dist/esm/components/credits/modal/MyRewardsModal.js +2 -0
  429. package/dist/esm/components/credits/modal/MyRewardsModal.js.map +7 -0
  430. package/dist/esm/components/credits/modal/activitiesModal.d.ts +32 -0
  431. package/dist/esm/components/credits/modal/activitiesModal.js +2 -0
  432. package/dist/esm/components/credits/modal/activitiesModal.js.map +7 -0
  433. package/dist/esm/components/credits/modal/creditsUploadReceiptModal.d.ts +24 -0
  434. package/dist/esm/components/credits/modal/creditsUploadReceiptModal.js +2 -0
  435. package/dist/esm/components/credits/modal/creditsUploadReceiptModal.js.map +7 -0
  436. package/dist/esm/components/credits/modal/loadingDots.d.ts +6 -0
  437. package/dist/esm/components/credits/modal/loadingDots.js +2 -0
  438. package/dist/esm/components/credits/modal/loadingDots.js.map +7 -0
  439. package/dist/esm/components/credits/modal/modalContainer.d.ts +15 -0
  440. package/dist/esm/components/credits/modal/modalContainer.js +2 -0
  441. package/dist/esm/components/credits/modal/modalContainer.js.map +7 -0
  442. package/dist/esm/components/credits/modal/rulesModal.d.ts +7 -0
  443. package/dist/esm/components/credits/modal/rulesModal.js +2 -0
  444. package/dist/esm/components/credits/modal/rulesModal.js.map +7 -0
  445. package/dist/esm/components/credits/modal/subscribeModal.d.ts +15 -0
  446. package/dist/esm/components/credits/modal/subscribeModal.js +2 -0
  447. package/dist/esm/components/credits/modal/subscribeModal.js.map +7 -0
  448. package/dist/esm/components/credits/modal/tip.d.ts +5 -0
  449. package/dist/esm/components/credits/modal/tip.js +2 -0
  450. package/dist/esm/components/credits/modal/tip.js.map +7 -0
  451. package/dist/esm/components/credits/type.d.ts +72 -0
  452. package/dist/esm/components/credits/type.js +1 -0
  453. package/dist/esm/components/credits/type.js.map +7 -0
  454. package/dist/esm/components/index.d.ts +4 -2
  455. package/dist/esm/components/index.js +1 -1
  456. package/dist/esm/components/index.js.map +2 -2
  457. package/dist/esm/components/registration/authCodeActivate/Message.d.ts +4 -0
  458. package/dist/esm/components/registration/authCodeActivate/Message.js +2 -0
  459. package/dist/esm/components/registration/authCodeActivate/Message.js.map +7 -0
  460. package/dist/esm/components/registration/authCodeActivate/index.d.ts +3 -0
  461. package/dist/esm/components/registration/authCodeActivate/index.js +2 -0
  462. package/dist/esm/components/registration/authCodeActivate/index.js.map +7 -0
  463. package/dist/esm/components/registration/authCodeActivate/type.d.ts +23 -0
  464. package/dist/esm/components/registration/authCodeActivate/type.js +1 -0
  465. package/dist/esm/components/registration/authCodeActivate/type.js.map +7 -0
  466. package/dist/esm/components/registration/context/index.d.ts +1 -0
  467. package/dist/esm/components/registration/context/index.js +2 -0
  468. package/dist/esm/components/registration/context/index.js.map +7 -0
  469. package/dist/esm/components/registration/context/provider.d.ts +25 -0
  470. package/dist/esm/components/registration/context/provider.js +2 -0
  471. package/dist/esm/components/registration/context/provider.js.map +7 -0
  472. package/dist/esm/components/registration/index.d.ts +2 -0
  473. package/dist/esm/components/registration/index.js +2 -0
  474. package/dist/esm/components/registration/index.js.map +7 -0
  475. package/dist/esm/components/registration/modalContainer.d.ts +15 -0
  476. package/dist/esm/components/registration/modalContainer.js +2 -0
  477. package/dist/esm/components/registration/modalContainer.js.map +7 -0
  478. package/dist/esm/debug-env.d.ts +7 -0
  479. package/dist/esm/debug-env.js +2 -0
  480. package/dist/esm/debug-env.js.map +7 -0
  481. package/dist/esm/index.d.ts +2 -1
  482. package/dist/esm/index.js +1 -1
  483. package/dist/esm/index.js.map +2 -2
  484. package/dist/esm/stories/chat.stories.d.ts +1 -1
  485. package/dist/esm/stories/chat.stories.js +1 -1
  486. package/dist/esm/stories/chat.stories.js.map +2 -2
  487. package/dist/esm/templates/credits.d.ts +58 -0
  488. package/dist/esm/templates/credits.js +2 -0
  489. package/dist/esm/templates/credits.js.map +7 -0
  490. package/dist/esm/templates/index.d.ts +1 -0
  491. package/dist/esm/templates/index.js +2 -0
  492. package/dist/esm/templates/index.js.map +7 -0
  493. package/package.json +47 -33
  494. package/src/components/chat/button.tsx +1 -1
  495. package/src/components/chat/index.tsx +6 -6
  496. package/src/components/chat/messages.tsx +2 -2
  497. package/src/components/chat/response.tsx +1 -4
  498. package/src/components/chat/suggestions.tsx +1 -1
  499. package/src/components/credits/const.ts +1 -0
  500. package/src/components/credits/context/const.ts +104 -0
  501. package/src/components/credits/context/hooks/useActivities.ts +70 -0
  502. package/src/components/credits/context/hooks/useAddressValidate.ts +281 -0
  503. package/src/components/credits/context/hooks/useAlpcFetch.ts +295 -0
  504. package/src/components/credits/context/hooks/useClickOutside.ts +34 -0
  505. package/src/components/credits/context/hooks/useCopy.ts +35 -0
  506. package/src/components/credits/context/hooks/useCountries.ts +55 -0
  507. package/src/components/credits/context/hooks/useFirstPurchaseFinished.ts +24 -0
  508. package/src/components/credits/context/hooks/useMyRewards.ts +97 -0
  509. package/src/components/credits/context/hooks/useReceiptUploaded.ts +24 -0
  510. package/src/components/credits/context/hooks/useRedeemAndBuy.ts +57 -0
  511. package/src/components/credits/context/hooks/useRedeemCoupon.ts +34 -0
  512. package/src/components/credits/context/hooks/useRedeemProduct.ts +34 -0
  513. package/src/components/credits/context/hooks/useRedeemableList.ts +77 -0
  514. package/src/components/credits/context/hooks/useSubscribed.ts +36 -0
  515. package/src/components/credits/context/hooks/useUploadReceipt.tsx +29 -0
  516. package/src/components/credits/context/provider.tsx +85 -0
  517. package/src/components/credits/context/response.ts +72 -0
  518. package/src/components/credits/context/utils.ts +149 -0
  519. package/src/components/credits/creditsBanner/index.tsx +103 -0
  520. package/src/components/credits/creditsBenefits/benefitItem.tsx +91 -0
  521. package/src/components/credits/creditsBenefits/iconInfo.tsx +23 -0
  522. package/src/components/credits/creditsBenefits/index.tsx +116 -0
  523. package/src/components/credits/creditsCash/CreditsCash.tsx +85 -0
  524. package/src/components/credits/creditsCash/RedeemableItem.tsx +207 -0
  525. package/src/components/credits/creditsCash/index.ts +2 -0
  526. package/src/components/credits/creditsCash/type.ts +46 -0
  527. package/src/components/credits/creditsFaq/faqItem/FaqItem.tsx +95 -0
  528. package/src/components/credits/creditsFaq/index.tsx +89 -0
  529. package/src/components/credits/creditsInfoCard/index.tsx +184 -0
  530. package/src/components/credits/creditsRedeemList/AddressForm/CountrySelect.tsx +116 -0
  531. package/src/components/credits/creditsRedeemList/AddressForm/FormItem.tsx +23 -0
  532. package/src/components/credits/creditsRedeemList/AddressForm/Input.tsx +58 -0
  533. package/src/components/credits/creditsRedeemList/AddressForm/StateSelect.tsx +131 -0
  534. package/src/components/credits/creditsRedeemList/AddressForm/index.tsx +157 -0
  535. package/src/components/credits/creditsRedeemList/AddressForm/type.ts +24 -0
  536. package/src/components/credits/creditsRedeemList/CreditsRedeemList.tsx +178 -0
  537. package/src/components/credits/creditsRedeemList/NonProductValue.tsx +39 -0
  538. package/src/components/credits/creditsRedeemList/RedeemCouponModal.tsx +211 -0
  539. package/src/components/credits/creditsRedeemList/RedeemProductModal/Address.tsx +74 -0
  540. package/src/components/credits/creditsRedeemList/RedeemProductModal/Error.tsx +14 -0
  541. package/src/components/credits/creditsRedeemList/RedeemProductModal/Init.tsx +123 -0
  542. package/src/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.tsx +25 -0
  543. package/src/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.tsx +74 -0
  544. package/src/components/credits/creditsRedeemList/RedeemProductModal/Success.tsx +49 -0
  545. package/src/components/credits/creditsRedeemList/RedeemProductModal/index.tsx +195 -0
  546. package/src/components/credits/creditsRedeemList/RedeemableItem.tsx +183 -0
  547. package/src/components/credits/creditsRedeemList/index.ts +2 -0
  548. package/src/components/credits/creditsRedeemList/type.ts +63 -0
  549. package/src/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.tsx +235 -0
  550. package/src/components/credits/creditsWaysToGetCredits/index.ts +2 -0
  551. package/src/components/credits/creditsWaysToGetCredits/type.ts +53 -0
  552. package/src/components/credits/creditsWaysToGetCredits/useActions.ts +228 -0
  553. package/src/components/credits/index.ts +11 -0
  554. package/src/components/credits/modal/MyRewardsModal.tsx +330 -0
  555. package/src/components/credits/modal/activitiesModal.tsx +264 -0
  556. package/src/components/credits/modal/creditsUploadReceiptModal.tsx +150 -0
  557. package/src/components/credits/modal/loadingDots.tsx +19 -0
  558. package/src/components/credits/modal/modalContainer.tsx +117 -0
  559. package/src/components/credits/modal/rulesModal.tsx +44 -0
  560. package/src/components/credits/modal/subscribeModal.tsx +224 -0
  561. package/src/components/credits/modal/tip.tsx +102 -0
  562. package/src/components/credits/type.ts +77 -0
  563. package/src/components/index.ts +6 -4
  564. package/src/components/registration/authCodeActivate/Message.tsx +43 -0
  565. package/src/components/registration/authCodeActivate/index.tsx +298 -0
  566. package/src/components/registration/authCodeActivate/type.ts +24 -0
  567. package/src/components/registration/context/index.tsx +1 -0
  568. package/src/components/registration/context/provider.tsx +77 -0
  569. package/src/components/registration/index.ts +2 -0
  570. package/src/components/registration/modalContainer.tsx +112 -0
  571. package/src/debug-env.ts +18 -0
  572. package/src/index.ts +2 -1
  573. package/src/stories/chat.stories.tsx +1 -1
  574. package/{dist/esm/styles/chat.css → src/styles/global.css} +1 -0
  575. package/src/templates/credits.tsx +124 -0
  576. package/src/templates/index.ts +1 -0
  577. package/style.css +1 -0
  578. package/tailwind.config.ts +82 -0
  579. package/dist/cjs/components/animation/CodeEditor.d.ts +0 -7
  580. package/dist/cjs/components/animation/CodeEditor.js +0 -2
  581. package/dist/cjs/components/animation/CodeEditor.js.map +0 -7
  582. package/dist/cjs/components/animation/Preview.d.ts +0 -5
  583. package/dist/cjs/components/animation/Preview.js +0 -2
  584. package/dist/cjs/components/animation/Preview.js.map +0 -7
  585. package/dist/cjs/components/animation/bannerAni.d.ts +0 -16
  586. package/dist/cjs/components/animation/bannerAni.js +0 -59
  587. package/dist/cjs/components/animation/bannerAni.js.map +0 -7
  588. package/dist/cjs/components/animation/libs.d.js +0 -2
  589. package/dist/cjs/components/animation/textAni.d.ts +0 -9
  590. package/dist/cjs/components/animation/textAni.js +0 -2
  591. package/dist/cjs/components/animation/textAni.js.map +0 -7
  592. package/dist/cjs/components/chat/message.d.ts +0 -2
  593. package/dist/cjs/components/chat/response copy.d.ts +0 -2
  594. package/dist/cjs/components/chat/rresponse.d.ts +0 -2
  595. package/dist/cjs/components/theme.d.ts +0 -13
  596. package/dist/cjs/helpers/component-props.d.ts +0 -7
  597. package/dist/cjs/helpers/component-props.js +0 -2
  598. package/dist/cjs/helpers/component-props.js.map +0 -7
  599. package/dist/cjs/helpers/constants.d.ts +0 -2
  600. package/dist/cjs/helpers/constants.js +0 -2
  601. package/dist/cjs/helpers/constants.js.map +0 -7
  602. package/dist/cjs/helpers/fetchResponse.d.ts +0 -14
  603. package/dist/cjs/helpers/fetchResponse.js +0 -2
  604. package/dist/cjs/helpers/fetchResponse.js.map +0 -7
  605. package/dist/cjs/helpers/fetcher.d.ts +0 -2
  606. package/dist/cjs/helpers/fetcher.js +0 -2
  607. package/dist/cjs/helpers/fetcher.js.map +0 -7
  608. package/dist/cjs/helpers/index.d.ts +0 -2
  609. package/dist/cjs/helpers/index.js +0 -2
  610. package/dist/cjs/helpers/index.js.map +0 -7
  611. package/dist/cjs/helpers/utils.d.ts +0 -3
  612. package/dist/cjs/helpers/utils.js +0 -2
  613. package/dist/cjs/helpers/utils.js.map +0 -7
  614. package/dist/cjs/tsconfig.tsbuildinfo +0 -1
  615. package/dist/esm/components/animation/CodeEditor.d.ts +0 -7
  616. package/dist/esm/components/animation/CodeEditor.js +0 -2
  617. package/dist/esm/components/animation/CodeEditor.js.map +0 -7
  618. package/dist/esm/components/animation/Preview.d.ts +0 -5
  619. package/dist/esm/components/animation/Preview.js +0 -2
  620. package/dist/esm/components/animation/Preview.js.map +0 -7
  621. package/dist/esm/components/animation/bannerAni.d.ts +0 -16
  622. package/dist/esm/components/animation/bannerAni.js +0 -59
  623. package/dist/esm/components/animation/bannerAni.js.map +0 -7
  624. package/dist/esm/components/animation/libs.d.js +0 -2
  625. package/dist/esm/components/animation/libs.d.js.map +0 -7
  626. package/dist/esm/components/animation/textAni.d.ts +0 -9
  627. package/dist/esm/components/animation/textAni.js +0 -2
  628. package/dist/esm/components/animation/textAni.js.map +0 -7
  629. package/dist/esm/components/chat/Markdown.d.ts +0 -5
  630. package/dist/esm/components/chat/marksdown.d.ts +0 -5
  631. package/dist/esm/components/chat/message.d.ts +0 -2
  632. package/dist/esm/components/chat/response copy.d.ts +0 -2
  633. package/dist/esm/components/chat/rresponse.d.ts +0 -2
  634. package/dist/esm/components/theme.d.ts +0 -13
  635. package/dist/esm/helpers/component-props.d.ts +0 -7
  636. package/dist/esm/helpers/component-props.js +0 -1
  637. package/dist/esm/helpers/constants.d.ts +0 -2
  638. package/dist/esm/helpers/constants.js +0 -2
  639. package/dist/esm/helpers/constants.js.map +0 -7
  640. package/dist/esm/helpers/fetchResponse.d.ts +0 -14
  641. package/dist/esm/helpers/fetchResponse.js +0 -2
  642. package/dist/esm/helpers/fetchResponse.js.map +0 -7
  643. package/dist/esm/helpers/fetcher.d.ts +0 -2
  644. package/dist/esm/helpers/fetcher.js +0 -2
  645. package/dist/esm/helpers/fetcher.js.map +0 -7
  646. package/dist/esm/helpers/index.d.ts +0 -2
  647. package/dist/esm/helpers/index.js +0 -2
  648. package/dist/esm/helpers/index.js.map +0 -7
  649. package/dist/esm/helpers/utils.d.ts +0 -3
  650. package/dist/esm/helpers/utils.js +0 -2
  651. package/dist/esm/helpers/utils.js.map +0 -7
  652. package/dist/esm/styles/css/animations.css +0 -35
  653. package/dist/esm/styles/css/button.css +0 -56
  654. package/dist/esm/styles/css/colors.css +0 -12
  655. package/dist/esm/styles/css/console.css +0 -134
  656. package/dist/esm/styles/css/header.css +0 -43
  657. package/dist/esm/styles/css/input.css +0 -89
  658. package/dist/esm/styles/css/markdown.css +0 -131
  659. package/dist/esm/styles/css/messages.css +0 -73
  660. package/dist/esm/styles/css/panel.css +0 -23
  661. package/dist/esm/styles/css/popup.css +0 -44
  662. package/dist/esm/styles/css/response.css +0 -26
  663. package/dist/esm/styles/css/sidebar.css +0 -31
  664. package/dist/esm/styles/css/suggestions.css +0 -35
  665. package/dist/esm/styles/css/window.css +0 -60
  666. package/dist/esm/styles/index.css +0 -1
  667. package/dist/esm/tsconfig.tsbuildinfo +0 -1
  668. package/src/helpers/fetchResponse.ts +0 -35
  669. package/src/helpers/fetcher.ts +0 -44
  670. package/src/helpers/index.ts +0 -2
  671. package/src/helpers/utils.ts +0 -8
  672. /package/dist/cjs/components/chat/{Markdown.d.ts → markdown.d.ts} +0 -0
  673. /package/dist/cjs/components/chat/{Response.d.ts → response.d.ts} +0 -0
  674. /package/dist/{cjs/components/chat/marksdown.d.ts → esm/components/chat/markdown.d.ts} +0 -0
  675. /package/dist/esm/components/chat/{Response.d.ts → response.d.ts} +0 -0
  676. /package/dist/{cjs/components/animation/libs.d.js.map → esm/components/credits/context/response.js.map} +0 -0
  677. /package/dist/esm/{helpers/component-props.js.map → components/credits/creditsCash/type.js.map} +0 -0
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/components/credits/creditsBenefits/iconInfo.tsx"],
4
+ "sourcesContent": ["export const IconInfo = () => {\n return (\n <svg\n xmlns='http://www.w3.org/2000/svg'\n className='size-[18px] cursor-pointer [&_svg]:size-full'\n width='18'\n height='18'\n viewBox='0 0 18 18'\n fill='none'\n >\n <path\n d='M9 1.125C11.1744 1.125 13.1441 2.00737 14.5684 3.43164C15.9926 4.85593 16.875 6.8256 16.875 9C16.875 11.1744 15.9926 13.1441 14.5684 14.5684C13.1441 15.9926 11.1744 16.875 9 16.875C6.8256 16.875 4.85593 15.9926 3.43164 14.5684C2.00737 13.1441 1.125 11.1744 1.125 9C1.125 6.8256 2.00738 4.85593 3.43164 3.43164C4.85593 2.00738 6.8256 1.125 9 1.125ZM9 2.625C7.23941 2.625 5.64668 3.33772 4.49219 4.49219C3.33772 5.64668 2.625 7.23941 2.625 9C2.625 10.7606 3.33772 12.3533 4.49219 13.5078C5.64668 14.6623 7.23941 15.375 9 15.375C10.7606 15.375 12.3533 14.6623 13.5078 13.5078C14.6623 12.3533 15.375 10.7606 15.375 9C15.375 7.23941 14.6623 5.64668 13.5078 4.49219C12.3533 3.33772 10.7606 2.625 9 2.625Z'\n fill='#6D6D6F'\n />\n <path\n d='M9 11.583C9.51777 11.583 9.9375 12.0027 9.9375 12.5205V12.5596C9.93718 13.0771 9.51757 13.4971 9 13.4971C8.48243 13.4971 8.06282 13.0771 8.0625 12.5596V12.5205C8.0625 12.0027 8.48223 11.583 9 11.583ZM8.99902 4.5C9.51671 4.49959 9.93696 4.91886 9.9375 5.43652L9.94043 9.37109C9.94084 9.88884 9.52165 10.3091 9.00391 10.3096C8.48616 10.31 8.06587 9.89079 8.06543 9.37305L8.0625 5.43848C8.06209 4.92079 8.48136 4.50054 8.99902 4.5Z'\n fill='#6D6D6F'\n />\n </svg>\n )\n}\n\nexport default IconInfo\n"],
5
+ "mappings": "AAEI,OAQE,OAAAA,EARF,QAAAC,MAAA,oBAFG,MAAMC,EAAW,IAEpBD,EAAC,OACC,MAAM,6BACN,UAAU,+CACV,MAAM,KACN,OAAO,KACP,QAAQ,YACR,KAAK,OAEL,UAAAD,EAAC,QACC,EAAE,6rBACF,KAAK,UACP,EACAA,EAAC,QACC,EAAE,+aACF,KAAK,UACP,GACF,EAIJ,IAAOG,EAAQD",
6
+ "names": ["jsx", "jsxs", "IconInfo", "iconInfo_default"]
7
+ }
@@ -0,0 +1,11 @@
1
+ import 'swiper/css';
2
+ import 'swiper/css/grid';
3
+ import 'swiper/css/pagination';
4
+ import { type BenefitItemCopy } from './benefitItem';
5
+ export type CreditsBenefitsCopy = {
6
+ title: string;
7
+ benefits: BenefitItemCopy[];
8
+ };
9
+ export declare const CreditsBenefits: ({ copy }: {
10
+ copy: CreditsBenefitsCopy;
11
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import{jsx as i,jsxs as a}from"react/jsx-runtime";import"swiper/css";import"swiper/css/grid";import"swiper/css/pagination";import{Container as c,Heading as u}from"@anker-in/headless-ui";import{useState as f}from"react";import{Grid as g,Pagination as b}from"swiper/modules";import{Swiper as v,SwiperSlide as C}from"swiper/react";import l from"./benefitItem";import{useCreditsContext as w}from"../context/provider";import{gaTrack as x,classNames as k,useHeadlessContext as N}from"@anker-in/lib";import{roundedBrands as h}from"../const";const H=({copy:r})=>{const[n,s]=f(null),{profile:p,gtm:d}=w(),{brand:m}=N(),y=h.includes(m),o=({item:t,index:e})=>{x({event:"ga4Event",event_name:"lp_button",member_active_status:p?.activated?"active":"not active",event_parameters:{page_group:d.pageGroup,position:r.title,button_name:t.text,info:""}}),n===e?s(null):(s(e),setTimeout(()=>{s(null)},5e3))};return a(c,{id:"benefits",className:"!z-[30] bg-[#F5F5F7]",children:[i(u,{as:"h2",size:"4",html:r?.title}),i("div",{className:"mt-[24px] grid grid-cols-4 xl:grid-cols-3 gap-[16px] l:hidden items-stretch",children:r.benefits.map((t,e)=>i(l,{item:t,handleClick:o,isNoteActive:n===e,index:e},e))}),a("div",{className:"mt-[24px] hidden l:block",children:[i(v,{spaceBetween:16,slidesPerView:2,slidesPerGroup:2,grid:{rows:2,fill:"row"},breakpoints:{768:{slidesPerView:3,slidesPerGroup:3}},wrapperClass:"!items-stretch",modules:[g,b],pagination:{clickable:!0,el:"#benefits-pagination",renderBullet(t,e){return`<div class='${e} !flex justify-center size-[8px] rounded-full bg-[#D9D9D9] cursor-pointer items-center'>
2
+ </div>`}},children:r.benefits.map((t,e)=>i(C,{className:k("!h-auto !flex",n===e&&"!z-[100]"),children:i(l,{item:t,handleClick:o,isNoteActive:n===e,index:e})},e))}),i("div",{id:"benefits-pagination",className:`mx-auto mt-[12px] grid !w-fit grid-flow-col [&_.swiper-pagination-bullet-active>div]:!bg-[#151515]
3
+ [&_.swiper-pagination-bullet]:cursor-pointer [&_.swiper-pagination-bullet]:rounded-full`})]}),n&&i("div",{role:"button",tabIndex:0,className:"fixed inset-0 z-10",onClick:()=>s(null),onKeyDown:t=>t.key==="Escape"&&s(null)})]})};export{H as CreditsBenefits};
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/components/credits/creditsBenefits/index.tsx"],
4
+ "sourcesContent": ["import 'swiper/css'\nimport 'swiper/css/grid'\nimport 'swiper/css/pagination'\n\nimport { Container, Heading } from '@anker-in/headless-ui'\nimport { useState } from 'react'\nimport { Grid, Pagination } from 'swiper/modules'\nimport { Swiper, SwiperSlide } from 'swiper/react'\n\nimport BenefitItem, { type BenefitItemCopy } from './benefitItem'\nimport { useCreditsContext } from '../context/provider'\nimport { gaTrack, classNames as cn, useHeadlessContext } from '@anker-in/lib'\nimport { roundedBrands } from '../const'\n\nexport type CreditsBenefitsCopy = {\n title: string\n benefits: BenefitItemCopy[]\n}\n\nexport const CreditsBenefits = ({ copy }: { copy: CreditsBenefitsCopy }) => {\n const [activeNoteIndex, setActiveNoteIndex] = useState<number | null>(null)\n const { profile, gtm } = useCreditsContext()\n const { brand } = useHeadlessContext()\n const rounded = roundedBrands.includes(brand)\n const handleClick = ({ item, index }: { item: BenefitItemCopy; index: number }) => {\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: copy.title,\n button_name: item.text,\n info: '',\n },\n })\n if (activeNoteIndex === index) {\n setActiveNoteIndex(null)\n } else {\n setActiveNoteIndex(index)\n setTimeout(() => {\n setActiveNoteIndex(null)\n }, 5000)\n }\n }\n\n return (\n <Container id=\"benefits\" className=\"!z-[30] bg-[#F5F5F7]\">\n <Heading as=\"h2\" size=\"4\" html={copy?.title} />\n <div className=\"mt-[24px] grid grid-cols-4 xl:grid-cols-3 gap-[16px] l:hidden items-stretch\">\n {copy.benefits.map((item, index) => (\n <BenefitItem\n key={index}\n item={item}\n handleClick={handleClick}\n isNoteActive={activeNoteIndex === index}\n index={index}\n />\n ))}\n </div>\n <div className=\"mt-[24px] hidden l:block\">\n <Swiper\n spaceBetween={16}\n slidesPerView={2}\n slidesPerGroup={2}\n grid={{\n rows: 2,\n fill: 'row',\n }}\n breakpoints={{\n 768: {\n slidesPerView: 3,\n slidesPerGroup: 3,\n },\n }}\n wrapperClass=\"!items-stretch\"\n modules={[Grid, Pagination]}\n pagination={{\n clickable: true,\n el: '#benefits-pagination',\n renderBullet(index, className) {\n return `<div class='${className} !flex justify-center size-[8px] rounded-full bg-[#D9D9D9] cursor-pointer items-center'>\n </div>`\n },\n }}\n >\n {copy.benefits.map((item, index) => (\n <SwiperSlide key={index} className={cn('!h-auto !flex', activeNoteIndex === index && '!z-[100]')}>\n <BenefitItem\n item={item}\n handleClick={handleClick}\n isNoteActive={activeNoteIndex === index}\n index={index}\n />\n </SwiperSlide>\n ))}\n </Swiper>\n <div\n id=\"benefits-pagination\"\n className=\"mx-auto mt-[12px] grid !w-fit grid-flow-col [&_.swiper-pagination-bullet-active>div]:!bg-[#151515] \n [&_.swiper-pagination-bullet]:cursor-pointer [&_.swiper-pagination-bullet]:rounded-full\"\n ></div>\n </div>\n\n {activeNoteIndex && (\n <div\n role=\"button\"\n tabIndex={0}\n className=\"fixed inset-0 z-10\"\n onClick={() => setActiveNoteIndex(null)}\n onKeyDown={e => e.key === 'Escape' && setActiveNoteIndex(null)}\n />\n )}\n </Container>\n )\n}\n"],
5
+ "mappings": "AAgDM,cAAAA,EAYA,QAAAC,MAZA,oBAhDN,MAAO,aACP,MAAO,kBACP,MAAO,wBAEP,OAAS,aAAAC,EAAW,WAAAC,MAAe,wBACnC,OAAS,YAAAC,MAAgB,QACzB,OAAS,QAAAC,EAAM,cAAAC,MAAkB,iBACjC,OAAS,UAAAC,EAAQ,eAAAC,MAAmB,eAEpC,OAAOC,MAA2C,gBAClD,OAAS,qBAAAC,MAAyB,sBAClC,OAAS,WAAAC,EAAS,cAAcC,EAAI,sBAAAC,MAA0B,gBAC9D,OAAS,iBAAAC,MAAqB,WAOvB,MAAMC,EAAkB,CAAC,CAAE,KAAAC,CAAK,IAAqC,CAC1E,KAAM,CAACC,EAAiBC,CAAkB,EAAId,EAAwB,IAAI,EACpE,CAAE,QAAAe,EAAS,IAAAC,CAAI,EAAIV,EAAkB,EACrC,CAAE,MAAAW,CAAM,EAAIR,EAAmB,EAC/BS,EAAUR,EAAc,SAASO,CAAK,EACtCE,EAAc,CAAC,CAAE,KAAAC,EAAM,MAAAC,CAAM,IAAgD,C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AC,OACC,KAAK,SACL,SAAU,EACV,UAAU,qBACV,QAAS,IAAMkB,EAAmB,IAAI,EACtC,UAAWS,GAAKA,EAAE,MAAQ,UAAYT,EAAmB,IAAI,EAC/D,GAEJ,CAEJ",
6
+ "names": ["jsx", "jsxs", "Container", "Heading", "useState", "Grid", "Pagination", "Swiper", "SwiperSlide", "BenefitItem", "useCreditsContext", "gaTrack", "cn", "useHeadlessContext", "roundedBrands", "CreditsBenefits", "copy", "activeNoteIndex", "setActiveNoteIndex", "profile", "gtm", "brand", "rounded", "handleClick", "item", "index", "className", "e"]
7
+ }
@@ -0,0 +1,4 @@
1
+ import { CreditsCashCopy } from './type';
2
+ export declare const CreditsCash: ({ copy }: {
3
+ copy: CreditsCashCopy;
4
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import{jsx as a,jsxs as B}from"react/jsx-runtime";import{Container as f,Heading as C}from"@anker-in/headless-ui";import{useMemo as g,useState as h}from"react";import b from"./RedeemableItem";import x from"../context/hooks/useRedeemableList";import v from"../modal/rulesModal";import{useProductsByHandles as y,useHeadlessContext as N}from"@anker-in/lib";import{classNames as R}from"@anker-in/lib";import{useRegistration as I}from"../../../components/registration";import{roundedBrands as k}from"../const";const q=({copy:s})=>{const{authCodeActivate:D}=I(),[i,d]=h(),{redeemableList:m}=x(),{brand:c}=N(),H=k.includes(c),u=[],{data:o}=y({handles:s?.list?.map(e=>e.products?.[0]?.handle)||[],metafieldIdentifiers:{variant:u}}),p=g(()=>o?.map(e=>{const r=s.list.find(n=>n.products?.[0]?.handle===e.handle),t=m.find(n=>n.id?.toString()===r?.redeemId?.toString()),l=e.variants?.find(n=>n.sku===r?.products?.[0]?.sku)||e.variants?.[0];return!t||!l?null:{product:e,productVariant:l,alpcData:{id:t?.id,consumeCredits:t?.consume_credits,remainingInventory:t?.remaining_inventory,isLimited:t?.is_limited,consumeType:t?.consume_type,title:t?.name,desc:t?.note},config:r}}).filter(Boolean),[o,s.list,m]);return B(f,{className:R("bg-[#F5F5F5]"),children:[a(C,{as:"h2",size:"4",html:s.title}),a("div",{className:"relative mt-[24px] grid grid-cols-4 gap-[16px] l:gap-[12px] md:grid-cols-2 md-xl:grid-cols-3",children:p?.map((e,r)=>a(b,{copy:s,itemData:e,setRules:d,currencyCode:o?.[0]?.price.currencyCode||"USD"},r))}),i&&a(v,{overlayClassName:"md:px-[16px] md:items-center",className:"md:h-fit md:rounded-b-[16px]",isOpen:i.length>0,onClose:()=>d([]),titleClassName:"border-b-transparent h-[56px]",rules:i,scrollClassName:"md:mt-[8px] md:mb-[24px] md:pt-0",title:s?.ruleLabel,ruleClassName:"text-[#1d1d1f] font-bold"})]})};export{q as CreditsCash};
2
+ //# sourceMappingURL=CreditsCash.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/components/credits/creditsCash/CreditsCash.tsx"],
4
+ "sourcesContent": ["import { Container, Heading } from '@anker-in/headless-ui'\nimport { useMemo, useState } from 'react'\n\nimport RedeemableItem from './RedeemableItem'\nimport useRedeemableList from '../context/hooks/useRedeemableList'\nimport RulesModal from '../modal/rulesModal'\nimport { useProductsByHandles, useHeadlessContext } from '@anker-in/lib'\nimport { CreditsCashCopy, RedeemItem } from './type'\nimport { Product, classNames as cn } from '@anker-in/lib'\nimport { useRegistration } from '../../../components/registration'\nimport { roundedBrands } from '../const'\n\nexport const CreditsCash = ({ copy }: { copy: CreditsCashCopy }) => {\n const { authCodeActivate } = useRegistration()\n const [rules, setRules] = useState<string | string[]>()\n const { redeemableList } = useRedeemableList()\n const { brand } = useHeadlessContext()\n const rounded = roundedBrands.includes(brand)\n\n const variantMetafieldIdentifiers: any[] = []\n\n const { data: productByHandles } = useProductsByHandles({\n handles: copy?.list?.map(item => item.products?.[0]?.handle) || [],\n metafieldIdentifiers: {\n variant: variantMetafieldIdentifiers,\n },\n })\n\n const list = useMemo(() => {\n return productByHandles\n ?.map((product: Product) => {\n const config = copy.list.find(item => item.products?.[0]?.handle === product.handle)\n const alpcData = redeemableList.find(item => item.id?.toString() === config?.redeemId?.toString())\n const productVariant =\n product.variants?.find((variant: any) => variant.sku === config?.products?.[0]?.sku) || product.variants?.[0]\n if (!alpcData || !productVariant) return null\n return {\n product,\n productVariant,\n alpcData: {\n id: alpcData?.id,\n consumeCredits: alpcData?.consume_credits,\n remainingInventory: alpcData?.remaining_inventory,\n isLimited: alpcData?.is_limited,\n consumeType: alpcData?.consume_type,\n title: alpcData?.name,\n desc: alpcData?.note,\n },\n config,\n }\n })\n .filter(Boolean) as unknown as RedeemItem[]\n }, [productByHandles, copy.list, redeemableList])\n\n return (\n <Container className={cn('bg-[#F5F5F5]')}>\n <Heading as=\"h2\" size=\"4\" html={copy.title} />\n <div className=\"relative mt-[24px] grid grid-cols-4 gap-[16px] l:gap-[12px] md:grid-cols-2 md-xl:grid-cols-3\">\n {list?.map((item, index: number) => (\n <RedeemableItem\n key={index}\n copy={copy}\n itemData={item}\n setRules={setRules}\n currencyCode={productByHandles?.[0]?.price.currencyCode || 'USD'}\n />\n ))}\n </div>\n\n {rules && (\n <RulesModal\n overlayClassName=\"md:px-[16px] md:items-center\"\n className=\"md:h-fit md:rounded-b-[16px]\"\n isOpen={rules.length > 0}\n onClose={() => setRules([])}\n titleClassName=\"border-b-transparent h-[56px]\"\n rules={rules}\n scrollClassName=\"md:mt-[8px] md:mb-[24px] md:pt-0\"\n title={copy?.ruleLabel}\n ruleClassName=\"text-[#1d1d1f] font-bold\"\n />\n )}\n </Container>\n )\n}\n"],
5
+ "mappings": "AAuDI,OACE,OAAAA,EADF,QAAAC,MAAA,oBAvDJ,OAAS,aAAAC,EAAW,WAAAC,MAAe,wBACnC,OAAS,WAAAC,EAAS,YAAAC,MAAgB,QAElC,OAAOC,MAAoB,mBAC3B,OAAOC,MAAuB,qCAC9B,OAAOC,MAAgB,sBACvB,OAAS,wBAAAC,EAAsB,sBAAAC,MAA0B,gBAEzD,OAAkB,cAAcC,MAAU,gBAC1C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AAQ,GAAG,KAAK,KAAK,IAAI,KAAMY,EAAK,MAAO,EAC5Cf,EAAC,OAAI,UAAU,+FACZ,SAAAyB,GAAM,IAAI,CAACD,EAAMO,IAChB/B,EAACM,EAAA,CAEC,KAAMS,EACN,SAAUS,EACV,SAAUN,EACV,aAAcK,IAAmB,CAAC,GAAG,MAAM,cAAgB,OAJtDQ,CAKP,CACD,EACH,EAECd,GACCjB,EAACQ,EAAA,CACC,iBAAiB,+BACjB,UAAU,+BACV,OAAQS,EAAM,OAAS,EACvB,QAAS,IAAMC,EAAS,CAAC,CAAC,EAC1B,eAAe,gCACf,MAAOD,EACP,gBAAgB,mCAChB,MAAOF,GAAM,UACb,cAAc,2BAChB,GAEJ,CAEJ",
6
+ "names": ["jsx", "jsxs", "Container", "Heading", "useMemo", "useState", "RedeemableItem", "useRedeemableList", "RulesModal", "useProductsByHandles", "useHeadlessContext", "cn", "useRegistration", "roundedBrands", "CreditsCash", "copy", "authCodeActivate", "rules", "setRules", "redeemableList", "brand", "rounded", "variantMetafieldIdentifiers", "productByHandles", "item", "list", "product", "config", "alpcData", "productVariant", "variant", "index"]
7
+ }
@@ -0,0 +1,9 @@
1
+ import { CreditsCashCopy, RedeemItem } from './type';
2
+ declare function RedeemableItem({ copy, itemData, setRules, className, }: {
3
+ copy: CreditsCashCopy;
4
+ itemData: RedeemItem;
5
+ className?: string;
6
+ setRules: (rules: string[]) => void;
7
+ currencyCode: string;
8
+ }): import("react/jsx-runtime").JSX.Element;
9
+ export default RedeemableItem;
@@ -0,0 +1,2 @@
1
+ import{jsx as i,jsxs as n}from"react/jsx-runtime";import{Button as z,Text as u,Picture as g}from"@anker-in/headless-ui";import{useMemo as o,useState as I}from"react";import{useCreditsContext as k}from"../context/provider";import{useRedeemAndBuy as F}from"../context/hooks/useRedeemAndBuy";import{numberFormat as y}from"../context/utils";import{gaTrack as b,classNames as p}from"@anker-in/lib";import{useRegistration as E}from"../../../components/registration";function V({copy:t,itemData:e,setRules:h,className:C}){const{creditInfo:c,profile:l,openSignUpPopup:N,gtm:{pageGroup:x}}=k(),{authCodeActivate:m}=E(),[f,v]=I(null),{trigger:_,isMutating:w}=F({},{onError:a=>{v(a.message)}}),r=o(()=>!!l,[l?.activated]),s=o(()=>r&&l?.activated&&e.alpcData?.consumeCredits>Number(c?.available_credit||0),[r,l?.activated,e.alpcData?.consumeCredits,c?.available_credit]),R=o(()=>!!(e.alpcData?.remainingInventory<=0&&e.alpcData?.isLimited||!e.productVariant?.availableForSale||s),[e.alpcData?.remainingInventory,e.alpcData?.isLimited,e.productVariant?.availableForSale,s]),S=()=>{v(null),r?!l?.activated&&!m.isActivateSuccess?m.open():(_({productVariant:e?.productVariant,redeemId:e?.config?.redeemId}),b({event:"ga4Event",event_name:"lp_button",member_active_status:l?.activated?"active":"not active",event_parameters:{page_group:x,position:t.title,button_name:d,info:e?.alpcData?.id?.toString()}})):N()},d=o(()=>e.productVariant?.availableForSale?r?t.btnRedeem:t.unlockRewards:t?.soldOut||"Sold Out",[r,e.productVariant?.availableForSale,t.btnRedeem,t.unlockRewards,t?.soldOut]);return n("div",{className:p("flex flex-col items-center rounded-[16px] bg-[#EAEAEC] p-[24px] md:rounded-[12px] md:px-[8px] xl:py-[16px] md-xl:px-[16px]",C),children:[i("div",{className:p("relative mx-auto h-[224px] w-fit l:h-[120px] l-xxl:h-[138px]"),children:i(g,{className:"mx-auto h-full w-auto",imgClassName:"h-full object-contain",source:e?.config?.image?.url||e?.productVariant?.metafields?.global?.transparentImg||e?.productVariant?.image?.url})}),n("div",{className:p("mt-[22px] w-full l:mt-[8px]"),children:[i(u,{html:e?.product?.title,title:e.config?.title||e.alpcData?.title||e.product?.title,size:2,className:"line-clamp-2 h-[58px] text-[24px] leading-[1.2] l:h-[40px] l:text-[16px] l-xxl:h-[48px] l-xxl:text-[20px]"}),e?.config?.rules?.split("<br>")?.length>0&&i("button",{type:"button",onClick:()=>{h(e?.config?.rules?.split("<br>")),b({event:"ga4Event",event_name:"lp_button",member_active_status:l?.activated?"active":"not active",event_parameters:{page_group:x,position:t.title,button_name:t?.ruleLabel,info:e?.alpcData?.id?.toString()}})},className:"mt-[8px] text-[16px] font-bold underline xxl:text-[14px]",tabIndex:0,onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&a.preventDefault()},children:t?.ruleLabel}),n("div",{className:"mt-[24px] flex items-center l:mt-[12px] laptop:text-[16px] lg-desktop:text-[18px]",children:[i(g,{className:"size-[24px] l-xxl:size-[22px] md-l:size-[18px] md:size-[16px]",source:"https://cdn.shopify.com/s/files/1/0511/6346/3874/files/icon_hire_purchase.png?v=1757496783"}),i(u,{html:`${y(e?.alpcData?.consumeCredits)} + ${e?.config?.price}`,size:2,as:"p",className:"ml-[4px] mt-[4px] text-[28px] font-bold leading-none md:text-[18px] l-xxl:text-[24px] md-l:text-[20px] "})]}),n("div",{className:"group relative w-full",children:[i(z,{disabled:R,variant:"primary",size:"lg",className:"mt-[8px] md:px-[10px] l:w-full",loading:w,onClick:()=>{S()},title:s?t.insufficientCredits:d,children:d}),i("div",{className:p("absolute -bottom-[20px] left-0 z-10 w-[300px] translate-y-full opacity-0 transition-opacity group-hover:opacity-100 md:-bottom-[14px] md:w-[160px]",s?"block":"hidden"),children:n("div",{className:"relative rounded-[10px] bg-[#6D6D6F] p-[16px] text-[14px] font-medium text-white shadow md:px-[10px] md:py-[8px]",children:[i(u,{as:"p",size:"2",html:t?.insufficientCredits,className:"text-[14px]"}),i("div",{className:"absolute -top-[10px] left-[48px] mb-2 size-[16px] origin-top-left rotate-45 transform rounded-[2px] bg-[#6D6D6F]"})]})})]})]}),f&&i("div",{className:"mt-[8px] text-[14px] text-[#FF0000]",children:f})]})}var U=V;export{U as default};
2
+ //# sourceMappingURL=RedeemableItem.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/components/credits/creditsCash/RedeemableItem.tsx"],
4
+ "sourcesContent": ["import { Button, Text, Picture } from '@anker-in/headless-ui'\nimport { useMemo, useState } from 'react'\n\nimport { CreditsCashCopy, RedeemItem } from './type'\nimport { useCreditsContext } from '../context/provider'\nimport { useRedeemAndBuy } from '../context/hooks/useRedeemAndBuy'\nimport { numberFormat } from '../context/utils'\nimport { gaTrack, classNames as cn } from '@anker-in/lib'\nimport { useRegistration } from '../../../components/registration'\n\nfunction RedeemableItem({\n copy,\n itemData,\n setRules,\n className,\n}: {\n copy: CreditsCashCopy\n itemData: RedeemItem\n className?: string\n setRules: (rules: string[]) => void\n currencyCode: string\n}) {\n const {\n creditInfo,\n profile,\n openSignUpPopup,\n gtm: { pageGroup },\n } = useCreditsContext()\n const { authCodeActivate } = useRegistration()\n const [error, setError] = useState<string | null>(null)\n const { trigger, isMutating } = useRedeemAndBuy(\n {},\n {\n onError: error => {\n setError(error.message)\n },\n }\n )\n\n const isLogin = useMemo(() => {\n return !!profile\n }, [profile?.activated])\n\n const inSufficientCredit = useMemo(() => {\n return (\n isLogin && profile?.activated && itemData.alpcData?.consumeCredits > Number(creditInfo?.available_credit || 0)\n )\n }, [isLogin, profile?.activated, itemData.alpcData?.consumeCredits, creditInfo?.available_credit])\n\n const isDisabled = useMemo(() => {\n // \u5151\u6362\u9650\u5236\n if (itemData.alpcData?.remainingInventory <= 0 && itemData.alpcData?.isLimited) {\n return true\n }\n\n // \u5546\u54C1\u5E93\u5B58\u9650\u5236\n if (!itemData.productVariant?.availableForSale) {\n return true\n }\n\n // \u79EF\u5206\u4E0D\u8DB3\n if (inSufficientCredit) {\n return true\n }\n return false\n }, [\n itemData.alpcData?.remainingInventory,\n itemData.alpcData?.isLimited,\n itemData.productVariant?.availableForSale,\n inSufficientCredit,\n ])\n\n const handleRedeem = () => {\n setError(null)\n if (!isLogin) {\n openSignUpPopup()\n } else if (!profile?.activated && !authCodeActivate.isActivateSuccess) {\n authCodeActivate.open()\n } else {\n trigger({\n productVariant: itemData?.productVariant,\n redeemId: itemData?.config?.redeemId,\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: pageGroup,\n position: copy.title,\n button_name: redeemButtonText,\n info: itemData?.alpcData?.id?.toString(),\n },\n })\n }\n }\n\n const redeemButtonText = useMemo(() => {\n // \u7F3A\u8D27\u6587\u6848\n if (!itemData.productVariant?.availableForSale) {\n return copy?.soldOut || 'Sold Out'\n } else if (!isLogin) {\n return copy.unlockRewards\n } else {\n return copy.btnRedeem\n }\n }, [isLogin, itemData.productVariant?.availableForSale, copy.btnRedeem, copy.unlockRewards, copy?.soldOut])\n\n return (\n <div\n className={cn(\n 'flex flex-col items-center rounded-[16px] bg-[#EAEAEC] p-[24px] md:rounded-[12px] md:px-[8px] xl:py-[16px] md-xl:px-[16px]',\n className\n )}\n >\n <div className={cn('relative mx-auto h-[224px] w-fit l:h-[120px] l-xxl:h-[138px]')}>\n <Picture\n className=\"mx-auto h-full w-auto\"\n imgClassName=\"h-full object-contain\"\n source={\n itemData?.config?.image?.url ||\n itemData?.productVariant?.metafields?.global?.transparentImg ||\n itemData?.productVariant?.image?.url\n }\n ></Picture>\n </div>\n <div className={cn('mt-[22px] w-full l:mt-[8px]')}>\n <Text\n html={itemData?.product?.title}\n title={itemData.config?.title || itemData.alpcData?.title || itemData.product?.title}\n size={2}\n className=\"line-clamp-2 h-[58px] text-[24px] leading-[1.2] l:h-[40px] l:text-[16px] l-xxl:h-[48px] l-xxl:text-[20px]\"\n />\n {itemData?.config?.rules?.split('<br>')?.length > 0 && (\n <button\n type=\"button\"\n onClick={() => {\n setRules(itemData?.config?.rules?.split('<br>'))\n gaTrack({\n event: 'ga4Event',\n event_name: 'lp_button',\n member_active_status: profile?.activated ? 'active' : 'not active',\n event_parameters: {\n page_group: pageGroup,\n position: copy.title,\n button_name: copy?.ruleLabel,\n info: itemData?.alpcData?.id?.toString(),\n },\n })\n }}\n className=\"mt-[8px] text-[16px] font-bold underline xxl:text-[14px]\"\n tabIndex={0}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n }\n }}\n >\n {copy?.ruleLabel}\n </button>\n )}\n <div className=\"mt-[24px] flex items-center l:mt-[12px] laptop:text-[16px] lg-desktop:text-[18px]\">\n <Picture\n className=\"size-[24px] l-xxl:size-[22px] md-l:size-[18px] md:size-[16px]\"\n source=\"https://cdn.shopify.com/s/files/1/0511/6346/3874/files/icon_hire_purchase.png?v=1757496783\"\n />\n <Text\n html={`${numberFormat(itemData?.alpcData?.consumeCredits)} + ${itemData?.config?.price}`}\n size={2}\n as=\"p\"\n className=\"ml-[4px] mt-[4px] text-[28px] font-bold leading-none md:text-[18px] l-xxl:text-[24px] md-l:text-[20px] \"\n />\n </div>\n\n <div className=\"group relative w-full\">\n <Button\n disabled={isDisabled}\n variant=\"primary\"\n size=\"lg\"\n className=\"mt-[8px] md:px-[10px] l:w-full\"\n loading={isMutating}\n onClick={() => {\n handleRedeem()\n }}\n title={inSufficientCredit ? copy.insufficientCredits : redeemButtonText}\n >\n {redeemButtonText}\n </Button>\n <div\n className={cn(\n 'absolute -bottom-[20px] left-0 z-10 w-[300px] translate-y-full opacity-0 transition-opacity group-hover:opacity-100 md:-bottom-[14px] md:w-[160px]',\n inSufficientCredit ? 'block' : 'hidden'\n )}\n >\n <div className=\"relative rounded-[10px] bg-[#6D6D6F] p-[16px] text-[14px] font-medium text-white shadow md:px-[10px] md:py-[8px]\">\n <Text as=\"p\" size=\"2\" html={copy?.insufficientCredits} className=\"text-[14px]\" />\n <div className=\"absolute -top-[10px] left-[48px] mb-2 size-[16px] origin-top-left rotate-45 transform rounded-[2px] bg-[#6D6D6F]\" />\n </div>\n </div>\n </div>\n </div>\n {error && <div className=\"mt-[8px] text-[14px] text-[#FF0000]\">{error}</div>}\n </div>\n )\n}\n\nexport default RedeemableItem\n"],
5
+ "mappings": "AAoHQ,cAAAA,EA6CA,QAAAC,MA7CA,oBApHR,OAAS,UAAAC,EAAQ,QAAAC,EAAM,WAAAC,MAAe,wBACtC,O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ACjCA,EAAE,eAAe,CAErB,EAEC,SAAAlB,GAAM,UACT,EAEFb,EAAC,OAAI,UAAU,oFACb,UAAAD,EAACI,EAAA,CACC,UAAU,gEACV,OAAO,6FACT,EACAJ,EAACG,EAAA,CACC,KAAM,GAAGM,EAAaM,GAAU,UAAU,cAAc,CAAC,MAAMA,GAAU,QAAQ,KAAK,GACtF,KAAM,EACN,GAAG,IACH,UAAU,0GACZ,GACF,EAEAd,EAAC,OAAI,UAAU,wBACb,UAAAD,EAACE,EAAA,CACC,SAAU2B,EACV,QAAQ,UACR,KAAK,KACL,UAAU,iCACV,QAASH,EACT,QAAS,IAAM,CACbI,EAAa,CACf,EACA,MAAOF,EAAqBd,EAAK,oBAAsBiB,EAEtD,SAAAA,EACH,EACA/B,EAAC,OACC,UAAWW,EACT,qJACAiB,EAAqB,QAAU,QACjC,EAEA,SAAA3B,EAAC,OAAI,UAAU,mHACb,UAAAD,EAACG,EAAA,CAAK,GAAG,IAAI,KAAK,IAAI,KAAMW,GAAM,oBAAqB,UAAU,cAAc,EAC/Ed,EAAC,OAAI,UAAU,mHAAmH,GACpI,EACF,GACF,GACF,EACCuB,GAASvB,EAAC,OAAI,UAAU,sCAAuC,SAAAuB,EAAM,GACxE,CAEJ,CAEA,IAAOU,EAAQpB",
6
+ "names": ["jsx", "jsxs", "Button", "Text", "Picture", "useMemo", "useState", "useCreditsContext", "useRedeemAndBuy", "numberFormat", "gaTrack", "cn", "useRegistration", "RedeemableItem", "copy", "itemData", "setRules", "className", "creditInfo", "profile", "openSignUpPopup", "pageGroup", "authCodeActivate", "error", "setError", "trigger", "isMutating", "isLogin", "inSufficientCredit", "isDisabled", "handleRedeem", "redeemButtonText", "e", "RedeemableItem_default"]
7
+ }
@@ -0,0 +1,2 @@
1
+ export * from './type';
2
+ export * from './CreditsCash';
@@ -0,0 +1,2 @@
1
+ export*from"./type";export*from"./CreditsCash";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/components/credits/creditsCash/index.ts"],
4
+ "sourcesContent": ["export * from './type'\nexport * from './CreditsCash'\n"],
5
+ "mappings": "AAAA,WAAc,SACd,WAAc",
6
+ "names": []
7
+ }
@@ -0,0 +1,47 @@
1
+ import { ProductVariant, Product } from '@anker-in/lib';
2
+ import { AlpcConsumeType } from '../context/const';
3
+ type RedeemableItemConfig = {
4
+ title: string;
5
+ desc: string;
6
+ price: string;
7
+ credit: string;
8
+ rules: string;
9
+ image: {
10
+ url: string;
11
+ };
12
+ mobileImage: {
13
+ url: string;
14
+ };
15
+ redeemId: number;
16
+ };
17
+ export type CreditsCashCopy = {
18
+ title: string;
19
+ list: (RedeemableItemConfig & {
20
+ products: {
21
+ handle: string;
22
+ sku: string;
23
+ }[];
24
+ })[];
25
+ soldOut: string;
26
+ ruleLabel: string;
27
+ unlockRewards: string;
28
+ btnRedeem: string;
29
+ off: string;
30
+ insufficientCredits: string;
31
+ };
32
+ export type RedeemItem = {
33
+ product: Product;
34
+ productVariant: ProductVariant;
35
+ alpcData: {
36
+ id: number;
37
+ consumeCredits: number;
38
+ remainingInventory: number;
39
+ isLimited: boolean;
40
+ consumeType: AlpcConsumeType.Product;
41
+ showCredit: boolean;
42
+ title: string;
43
+ desc: string;
44
+ };
45
+ config: RedeemableItemConfig;
46
+ };
47
+ export {};
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=type.js.map
@@ -0,0 +1,13 @@
1
+ import { type ReactNode } from 'react';
2
+ type FaqItemProps = {
3
+ index: number;
4
+ question?: string;
5
+ answer?: string | number;
6
+ showDots: boolean;
7
+ itemRightIconRender?: ({ expanded }: {
8
+ expanded: boolean;
9
+ }) => ReactNode;
10
+ defaultExpended?: boolean;
11
+ };
12
+ export declare const FaqItem: ({ index, question, answer, showDots, itemRightIconRender, defaultExpended, }: FaqItemProps) => import("react/jsx-runtime").JSX.Element;
13
+ export {};
@@ -0,0 +1,2 @@
1
+ import{jsx as t,jsxs as s}from"react/jsx-runtime";import{Heading as f,Text as l}from"@anker-in/headless-ui";import{ChevronDownIcon as b}from"@heroicons/react/24/outline";import{classNames as e}from"@anker-in/lib";import{motion as c}from"framer-motion";import{useEffect as u,useState as v}from"react";const k=({index:a,question:n,answer:o,showDots:x,itemRightIconRender:p,defaultExpended:m=!1})=>{const[r,d]=v(m);return u(()=>{a==0&&d(!0),n||d(!0)},[a,n]),s("div",{className:e("relative mx-0 border-b-[1px] border-[#e4e5e6] py-[24px] l:py-[16px]"),children:[s("div",{className:"relative flex items-center",onClick:()=>{d(!r)},role:"button",tabIndex:0,onKeyDown:i=>{(i.key==="Enter"||i.key===" ")&&i.preventDefault()},children:[t(f,{html:n,as:"h3",className:e(x?'before:absolute before:left-[-15px] before:top-[8px] before:h-[6px] before:w-[6px] before:rounded-[50%] before:bg-[#000] before:content-[""]':"","relative block flex-1 cursor-pointer pr-[10px] text-[18px] font-bold text-[#1D1D1F] l:text-[16px]")}),p?p({expanded:r}):t(b,{className:e("size-[16px] shrink-0 cursor-pointer stroke-[2.5px] transition-all",r?"rotate-180":"")})]}),t(c.div,{initial:!1,animate:{height:r?"auto":0},className:"overflow-hidden [&_td]:border [&_td]:border-[#333] [&_td]:px-[8px] [&_td]:py-[4px]",children:o?.toString()?.includes("https://www.youtube.com")?t(l,{as:"div",className:e("mt-[8px]"),"data-ratio":"16:9","data-content":o,html:o?.toString()}):t(l,{as:"div",html:o?.toString(),className:e("mt-[8px] text-[16px] font-bold leading-[1.5] text-[#3D3D3F] l:text-[14px] [&_a]:text-brand [&_a]:underline")})})]},a)};export{k as FaqItem};
2
+ //# sourceMappingURL=FaqItem.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/components/credits/creditsFaq/faqItem/FaqItem.tsx"],
4
+ "sourcesContent": ["import { Heading, Text } from '@anker-in/headless-ui'\nimport { ChevronDownIcon } from '@heroicons/react/24/outline'\nimport { classNames as cn } from '@anker-in/lib'\nimport { motion } from 'framer-motion'\nimport { type ReactNode, useEffect, useState } from 'react'\n\ntype FaqItemProps = {\n index: number\n question?: string\n answer?: string | number\n showDots: boolean\n itemRightIconRender?: ({ expanded }: { expanded: boolean }) => ReactNode\n defaultExpended?: boolean\n}\n\nexport const FaqItem = ({\n index,\n question,\n answer,\n showDots,\n itemRightIconRender,\n defaultExpended = false,\n}: FaqItemProps) => {\n const [expanded, setExpanded] = useState(defaultExpended)\n useEffect(() => {\n if (index == 0) {\n setExpanded(true)\n }\n if (!question) {\n setExpanded(true)\n }\n }, [index, question])\n\n return (\n <div key={index} className={cn('relative mx-0 border-b-[1px] border-[#e4e5e6] py-[24px] l:py-[16px]')}>\n <div\n className=\"relative flex items-center\"\n onClick={() => {\n setExpanded(!expanded)\n }}\n role=\"button\"\n tabIndex={0}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n }\n }}\n >\n <Heading\n html={question}\n as=\"h3\"\n className={cn(\n showDots\n ? 'before:absolute before:left-[-15px] before:top-[8px] before:h-[6px] before:w-[6px] before:rounded-[50%] before:bg-[#000] before:content-[\"\"]'\n : '',\n 'relative block flex-1 cursor-pointer pr-[10px] text-[18px] font-bold text-[#1D1D1F] l:text-[16px]'\n )}\n ></Heading>\n {itemRightIconRender ? (\n itemRightIconRender({ expanded })\n ) : (\n <ChevronDownIcon\n className={cn(\n 'size-[16px] shrink-0 cursor-pointer stroke-[2.5px] transition-all',\n expanded ? 'rotate-180' : ''\n )}\n />\n )}\n </div>\n <motion.div\n initial={false}\n animate={{ height: !expanded ? 0 : 'auto' }}\n className=\"overflow-hidden [&_td]:border [&_td]:border-[#333] [&_td]:px-[8px] [&_td]:py-[4px]\"\n >\n {answer?.toString()?.includes('https://www.youtube.com') ? (\n <Text\n as=\"div\"\n className={cn('mt-[8px]')}\n data-ratio=\"16:9\"\n data-content={answer}\n html={answer?.toString()}\n ></Text>\n ) : (\n <Text\n as=\"div\"\n html={answer?.toString()}\n className={cn(\n 'mt-[8px] text-[16px] font-bold leading-[1.5] text-[#3D3D3F] l:text-[14px] [&_a]:text-brand [&_a]:underline'\n )}\n ></Text>\n )}\n </motion.div>\n </div>\n )\n}\n"],
5
+ "mappings": "AAmCM,OAaE,OAAAA,EAbF,QAAAC,MAAA,oBAnCN,OAAS,WAAAC,EAAS,QAAAC,MAAY,wBAC9B,OAAS,mBAAAC,MAAuB,8BAChC,OAAS,cAAcC,MAAU,gBACjC,OAAS,UAAAC,MAAc,gBACvB,OAAyB,aAAAC,EAAW,YAAAC,MAAgB,QAW7C,MAAMC,EAAU,CAAC,CACtB,MAAAC,EACA,SAAAC,EACA,OAAAC,EACA,SAAAC,EACA,oBAAAC,EACA,gBAAAC,EAAkB,EACpB,IAAoB,CAClB,KAAM,CAACC,EAAUC,CAAW,EAAIT,EAASO,CAAe,EACxD,OAAAR,EAAU,IAAM,CACVG,GAAS,GACXO,EAAY,EAAI,EAEbN,GACHM,EAAY,EAAI,CAEpB,EAAG,CAACP,EAAOC,CAAQ,CAAC,EAGlBV,EAAC,OAAgB,UAAWI,EAAG,sEAAsE,EACnG,UAAAJ,EAAC,OACC,UAAU,6BACV,QAAS,IAAM,CACbgB,EAAY,CAACD,CAAQ,CACvB,EACA,KAAK,SACL,SAAU,EACV,UAAWE,GAAK,EACVA,EAAE,MAAQ,SAAWA,EAAE,MAAQ,MACjCA,EAAE,eAAe,CAErB,EAEA,UAAAlB,EAACE,EAAA,CACC,KAAMS,EACN,GAAG,KACH,UAAWN,EACTQ,EACI,+IACA,GACJ,mGACF,EACD,EACAC,EACCA,EAAoB,CAAE,SAAAE,CAAS,CAAC,EAEhChB,EAACI,EAAA,CACC,UAAWC,EACT,oEACAW,EAAW,aAAe,EAC5B,EACF,GAEJ,EACAhB,EAACM,EAAO,IAAP,CACC,QAAS,GACT,QAAS,CAAE,OAASU,EAAe,OAAJ,CAAW,EAC1C,UAAU,qFAET,SAAAJ,GAAQ,SAAS,GAAG,SAAS,yBAAyB,EACrDZ,EAACG,EAAA,CACC,GAAG,MACH,UAAWE,EAAG,UAAU,EACxB,aAAW,OACX,eAAcO,EACd,KAAMA,GAAQ,SAAS,EACxB,EAEDZ,EAACG,EAAA,CACC,GAAG,MACH,KAAMS,GAAQ,SAAS,EACvB,UAAWP,EACT,4GACF,EACD,EAEL,IAzDQK,CA0DV,CAEJ",
6
+ "names": ["jsx", "jsxs", "Heading", "Text", "ChevronDownIcon", "cn", "motion", "useEffect", "useState", "FaqItem", "index", "question", "answer", "showDots", "itemRightIconRender", "defaultExpended", "expanded", "setExpanded", "e"]
7
+ }
@@ -0,0 +1,16 @@
1
+ export type CreditsFaqCopy = {
2
+ title: string;
3
+ subTitle: string;
4
+ learnMore: {
5
+ link: string;
6
+ label: string;
7
+ };
8
+ items: {
9
+ category_name: string;
10
+ question: string;
11
+ answer: string;
12
+ }[];
13
+ };
14
+ export declare const CreditsFaq: ({ copy }: {
15
+ copy: CreditsFaqCopy;
16
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import{jsx as t,jsxs as k}from"react/jsx-runtime";import{Container as c,Heading as b,Tabs as p,TabsList as x,TabsTrigger as T,Text as h}from"@anker-in/headless-ui";import{classNames as q,useHeadlessContext as v}from"@anker-in/lib";import{useMemo as o,useState as C}from"react";import{FaqItem as w}from"./faqItem/FaqItem";import{roundedBrands as F}from"../const";const _=({copy:a})=>{const{title:m,items:r,subTitle:i=""}=a||{},{brand:g}=v(),u=F.includes(g),s=o(()=>Array.from(new Set(r?.map?.(e=>e.category_name).filter(e=>!!e))),[r]),[l,d]=C(s[0]?.toString()||""),f=o(()=>r?s.length?r.filter(e=>e?.category_name===l):r:[],[r,s.length,l]);return k(c,{className:"bg-[#F5F5F7]",id:"faq",children:[m&&t(b,{as:"h2",size:"4",html:a?.title}),i&&t("div",{className:"mt-[8px] flex flex-row",children:t(h,{size:"4",as:"p",html:i,className:"flex-1"})}),t(p,{align:"left",shape:u?"rounded":"square",className:"mt-[24px]",value:l.toString(),onValueChange:e=>{d(e)},children:t(x,{children:s.map((e,n)=>t(T,{value:e?.toString()||"",children:e},n))})}),t("div",{className:q("mt-[24px] flex flex-col overflow-auto pt-0"),children:f?.map((e,n)=>t(w,{index:n,defaultExpended:r.length===1,question:e.question,answer:e.answer,showDots:!1},n))}),a.learnMore?.link&&a.learnMore?.label&&t("a",{href:a.learnMore?.link,target:"_blank",className:"mt-[24px] block w-full text-center text-[18px] font-bold text-brand hover:underline l:text-[16px]",children:a.learnMore?.label})]})};export{_ as CreditsFaq};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/components/credits/creditsFaq/index.tsx"],
4
+ "sourcesContent": ["import { Container, Heading, Tabs, TabsList, TabsTrigger, Text } from '@anker-in/headless-ui'\nimport { classNames as cn, useHeadlessContext } from '@anker-in/lib'\nimport { useMemo, useState } from 'react'\n\nimport { FaqItem } from './faqItem/FaqItem'\nimport { roundedBrands } from '../const'\n\nexport type CreditsFaqCopy = {\n title: string\n subTitle: string\n learnMore: {\n link: string\n label: string\n }\n items: {\n category_name: string\n question: string\n answer: string\n }[]\n}\nexport const CreditsFaq = ({ copy }: { copy: CreditsFaqCopy }) => {\n const { title, items: faqList, subTitle = '' } = copy || {}\n const { brand } = useHeadlessContext()\n const rounded = roundedBrands.includes(brand)\n const categoryList = useMemo(() => {\n return Array.from(new Set(faqList?.map?.(faq => faq.category_name).filter(item => !!item)))\n }, [faqList])\n const [activeTab, setActiveTab] = useState<string>(categoryList[0]?.toString() || '')\n\n const currentList = useMemo(() => {\n if (!faqList) return []\n if (categoryList.length) {\n return faqList.filter(item => item?.category_name === activeTab)\n }\n return faqList\n }, [faqList, categoryList.length, activeTab])\n\n return (\n <Container className=\"bg-[#F5F5F7]\" id=\"faq\">\n {title && <Heading as=\"h2\" size=\"4\" html={copy?.title} />}\n {subTitle && (\n <div className=\"mt-[8px] flex flex-row\">\n <Text size=\"4\" as=\"p\" html={subTitle} className=\"flex-1\" />\n </div>\n )}\n {/* faq-nav */}\n <Tabs\n align=\"left\"\n shape={rounded ? 'rounded' : 'square'}\n className=\"mt-[24px]\"\n value={activeTab.toString()}\n onValueChange={value => {\n setActiveTab(value)\n }}\n >\n <TabsList>\n {categoryList.map((item, index) => (\n <TabsTrigger key={index} value={item?.toString() || ''}>\n {item}\n </TabsTrigger>\n ))}\n </TabsList>\n </Tabs>\n <div className={cn('mt-[24px] flex flex-col overflow-auto pt-0')}>\n {currentList?.map((item, index) => {\n return (\n <FaqItem\n key={index}\n index={index}\n defaultExpended={faqList.length === 1}\n question={item.question}\n answer={item.answer}\n showDots={false}\n ></FaqItem>\n )\n })}\n </div>\n {copy.learnMore?.link && copy.learnMore?.label && (\n <a\n href={copy.learnMore?.link}\n target=\"_blank\"\n className=\"mt-[24px] block w-full text-center text-[18px] font-bold text-brand hover:underline l:text-[16px]\"\n >\n {copy.learnMore?.label}\n </a>\n )}\n </Container>\n )\n}\n"],
5
+ "mappings": "AAsCI,OACY,OAAAA,EADZ,QAAAC,MAAA,oBAtCJ,OAAS,aAAAC,EAAW,WAAAC,EAAS,QAAAC,EAAM,YAAAC,EAAU,eAAAC,EAAa,QAAAC,MAAY,wBACtE,OAAS,cAAcC,EAAI,sBAAAC,MAA0B,gBACrD,OAAS,WAAAC,EAAS,YAAAC,MAAgB,QAElC,OAAS,WAAAC,MAAe,oBACxB,OAAS,iBAAAC,MAAqB,WAevB,MAAMC,EAAa,CAAC,CAAE,KAAAC,CAAK,IAAgC,CAChE,KAAM,CAAE,MAAAC,EAAO,MAAOC,EAAS,SAAAC,EAAW,EAAG,EAAIH,GAAQ,CAAC,EACpD,CAAE,MAAAI,CAAM,EAAIV,EAAmB,EAC/BW,EAAUP,EAAc,SAASM,CAAK,EACtCE,EAAeX,EAAQ,IACpB,MAAM,KAAK,IAAI,IAAIO,GAAS,MAAMK,GAAOA,EAAI,aAAa,EAAE,OAAOC,GAAQ,CAAC,CAACA,CAAI,CAAC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rigger", "Text", "cn", "useHeadlessContext", "useMemo", "useState", "FaqItem", "roundedBrands", "CreditsFaq", "copy", "title", "faqList", "subTitle", "brand", "rounded", "categoryList", "faq", "item", "activeTab", "setActiveTab", "currentList", "value", "index"]
7
+ }
@@ -0,0 +1,16 @@
1
+ type ButtonConfig = {
2
+ text: string;
3
+ type: 'activities' | 'rewards';
4
+ };
5
+ export type CreditsInfoCardCopy = {
6
+ balanceLabel: string;
7
+ comingSoonLabel: string;
8
+ comingSoonTips: string;
9
+ buttons: ButtonConfig[];
10
+ pointUnit: string;
11
+ infoIcon: string;
12
+ };
13
+ export declare function CreditsInfoCard({ copy }: {
14
+ copy: CreditsInfoCardCopy;
15
+ }): import("react/jsx-runtime").JSX.Element;
16
+ export {};
@@ -0,0 +1,2 @@
1
+ import{jsx as e,jsxs as i}from"react/jsx-runtime";import{Button as N,Container as w,Text as x}from"@anker-in/headless-ui";import{useCallback as k,useState as m}from"react";import{useCreditsContext as y}from"../context/provider";import{numberFormat as v}from"../context/utils";import h from"../modal/activitiesModal";import z from"../modal/MyRewardsModal";import{gaNormalClick as B,classNames as t,useHeadlessContext as I}from"@anker-in/lib";import{roundedBrands as S}from"../const";function A({copy:a}){const[b,p]=m(!1),[u,c]=m(!1),[d,o]=m(!1),{creditInfo:l,pageCommon:n}=y(),{brand:g}=I(),r=S.includes(g),C=k(s=>{if(B({position:"info_card",label:s.text}),s.type)switch(s.type){case"activities":p(!0);break;case"rewards":c(!0);break}},[]);return i(w,{asChild:!0,id:"infoCard",className:"-mb-[86px] -translate-y-[86px] x:-mb-[30px] x:-translate-y-[30px]",children:[i("div",{className:t("mx-auto flex justify-between items-center rounded-[12px] border border-white px-[24px] py-[40px]","l:flex-col l:items-start","min-l:px-[48px]","min-xl:px-[100px]",!r&&"rounded-none"),style:{background:"linear-gradient(119.61deg, rgba(250, 250, 250, 0.6) 38.58%, rgba(255, 255, 255, 0.6) 63.73%, rgba(249, 252, 255, 0.6) 89.37%)",backdropFilter:"blur(8px)"},children:[i("div",{className:t("grid grid-cols-2 gap-[24px] font-bold l:w-full md:grid-cols-1 md:flex-col md:gap-[16px] min-md:items-center"),children:[i("div",{className:"mr-[80px] md:mr-[0] md:flex-1 md-xl:mr-[64px]",children:[e("div",{className:t("mb-[24px] text-[14px] font-bold l:mb-[6px] xl:text-[16px] min-md:text-[18px] l-xl:mb-[16px]"),children:a.balanceLabel}),i("div",{className:"flex items-baseline",children:[e("div",{className:t("mr-[8px] text-[36px] font-extrabold","min-md:text-[44px]","min-xl:text-[56px]"),children:l?v(l.available_credit):0}),e("div",{className:"text-[16px]",children:a?.pointUnit})]})]}),i("div",{className:"w-fit md:flex-1",children:[i("div",{className:t("mb-[24px] flex text-[18px] l:mb-[6px] l:text-[14px] l-xl:mb-[16px]"),children:[e(x,{className:"text-[14px] font-bold xl:text-[16px] min-md:text-[18px]",html:a.comingSoonLabel}),a.comingSoonTips&&i("div",{className:"group relative ml-[4px] flex cursor-pointer items-start",children:[e(x,{as:"div",html:a?.infoIcon,className:"size-[18px] cursor-pointer [&_svg]:size-full",onClick:()=>{d?o(!1):(o(!0),setTimeout(()=>{o(!1)},5e3))}}),e("div",{className:t("absolute -bottom-[12px] -left-[32px] z-10 w-[356px] translate-y-full md:w-[276px]",d?"block":"hidden"),children:i("div",{className:t("relative rounded-[10px] bg-[#6D6D6F] p-[16px] text-[14px] font-medium text-white shadow",!r&&"rounded-none"),children:[e(x,{size:"2",html:a.comingSoonTips,className:"desktop:text-[18px]"}),e("div",{className:t("absolute -top-[10px] left-[40px] mb-2 size-[16px] origin-top-left rotate-45 transform rounded-[2px] bg-[#6D6D6F]",!r&&"rounded-none")})]})})]})]}),i("div",{className:"flex items-baseline ",children:[e("div",{className:t("mr-[8px] text-[36px] font-extrabold","min-l:text-[44px]","min-xl:text-[56px]"),children:l?v(l.pending_credit):0}),e("div",{className:"text-[16px]",children:a?.pointUnit})]})]})]}),e("div",{className:t("grid w-fit md:w-full l:mt-[32px] l:gap-[12px] min-l:gap-[16px] min-l:pl-[48px] md-l:grid-cols-2"),children:a.buttons?.map((s,f)=>e(N,{variant:f===0?"secondary":"primary",size:"lg",className:"min-w-[156px] laptop:min-w-[189px]",onClick:()=>{C(s)},children:s.text},f))}),n?.activities&&e(h,{isOpen:b,data:n?.activities,onClose:()=>{p(!1)}}),n?.rewards&&e(z,{isOpen:u,data:n?.rewards,onClose:()=>{c(!1)}})]}),d&&e("div",{role:"button",tabIndex:0,className:"fixed inset-0 z-10",onClick:()=>o(!1),onKeyDown:s=>s.key==="Escape"&&o(!1)})]})}export{A as CreditsInfoCard};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/components/credits/creditsInfoCard/index.tsx"],
4
+ "sourcesContent": ["import { Button, Container, Text } from '@anker-in/headless-ui'\n\nimport { useCallback, useState } from 'react'\nimport { useCreditsContext } from '../context/provider'\nimport { numberFormat } from '../context/utils'\nimport ActivitiesModal from '../modal/activitiesModal'\nimport MyRewardsModal from '../modal/MyRewardsModal'\nimport { gaNormalClick, classNames as cn, useHeadlessContext } from '@anker-in/lib'\nimport { roundedBrands } from '../const'\n\ntype ButtonConfig = {\n text: string\n type: 'activities' | 'rewards'\n}\nexport type CreditsInfoCardCopy = {\n balanceLabel: string\n comingSoonLabel: string\n comingSoonTips: string\n buttons: ButtonConfig[]\n pointUnit: string\n infoIcon: string\n}\n\nexport function CreditsInfoCard({ copy }: { copy: CreditsInfoCardCopy }) {\n const [openActivities, setOpenActivities] = useState(false)\n const [openRewards, setOpenRewards] = useState(false)\n const [hover, setHover] = useState<boolean>(false)\n const { creditInfo, pageCommon } = useCreditsContext()\n const { brand } = useHeadlessContext()\n const rounded = roundedBrands.includes(brand)\n const handleButtonClick = useCallback((buttonConfig: ButtonConfig) => {\n gaNormalClick({ position: 'info_card', label: buttonConfig.text })\n\n if (buttonConfig.type) {\n switch (buttonConfig.type) {\n case 'activities':\n setOpenActivities(true)\n break\n case 'rewards':\n setOpenRewards(true)\n break\n }\n }\n }, [])\n\n return (\n <Container asChild id=\"infoCard\" className=\"-mb-[86px] -translate-y-[86px] x:-mb-[30px] x:-translate-y-[30px]\">\n <div\n className={cn(\n 'mx-auto flex justify-between items-center rounded-[12px] border border-white px-[24px] py-[40px]',\n 'l:flex-col l:items-start',\n 'min-l:px-[48px]',\n 'min-xl:px-[100px]',\n !rounded && 'rounded-none'\n )}\n style={{\n background:\n 'linear-gradient(119.61deg, rgba(250, 250, 250, 0.6) 38.58%, rgba(255, 255, 255, 0.6) 63.73%, rgba(249, 252, 255, 0.6) 89.37%)',\n backdropFilter: 'blur(8px)',\n }}\n >\n <div\n className={cn(\n 'grid grid-cols-2 gap-[24px] font-bold l:w-full md:grid-cols-1 md:flex-col md:gap-[16px] min-md:items-center'\n )}\n >\n <div className=\"mr-[80px] md:mr-[0] md:flex-1 md-xl:mr-[64px]\">\n <div\n className={cn(\n 'mb-[24px] text-[14px] font-bold l:mb-[6px] xl:text-[16px] min-md:text-[18px] l-xl:mb-[16px]'\n )}\n >\n {copy.balanceLabel}\n </div>\n <div className=\"flex items-baseline\">\n <div className={cn('mr-[8px] text-[36px] font-extrabold', 'min-md:text-[44px]', 'min-xl:text-[56px]')}>\n {creditInfo ? numberFormat(creditInfo.available_credit) : 0}\n </div>\n <div className=\"text-[16px]\">{copy?.pointUnit}</div>\n </div>\n </div>\n <div className=\"w-fit md:flex-1\">\n <div className={cn('mb-[24px] flex text-[18px] l:mb-[6px] l:text-[14px] l-xl:mb-[16px]')}>\n <Text className=\"text-[14px] font-bold xl:text-[16px] min-md:text-[18px]\" html={copy.comingSoonLabel} />\n {copy.comingSoonTips && (\n <div className=\"group relative ml-[4px] flex cursor-pointer items-start\">\n <Text\n as=\"div\"\n html={copy?.infoIcon}\n className=\"size-[18px] cursor-pointer [&_svg]:size-full\"\n onClick={() => {\n if (hover) {\n setHover(false)\n } else {\n setHover(true)\n setTimeout(() => {\n setHover(false)\n }, 5000)\n }\n }}\n />\n <div\n className={cn(\n 'absolute -bottom-[12px] -left-[32px] z-10 w-[356px] translate-y-full md:w-[276px]',\n hover ? 'block' : 'hidden'\n )}\n >\n <div\n className={cn(\n 'relative rounded-[10px] bg-[#6D6D6F] p-[16px] text-[14px] font-medium text-white shadow',\n !rounded && 'rounded-none'\n )}\n >\n <Text size=\"2\" html={copy.comingSoonTips} className=\"desktop:text-[18px]\" />\n <div\n className={cn(\n 'absolute -top-[10px] left-[40px] mb-2 size-[16px] origin-top-left rotate-45 transform rounded-[2px] bg-[#6D6D6F]',\n !rounded && 'rounded-none'\n )}\n />\n </div>\n </div>\n </div>\n )}\n </div>\n <div className=\"flex items-baseline \">\n <div className={cn('mr-[8px] text-[36px] font-extrabold', 'min-l:text-[44px]', 'min-xl:text-[56px]')}>\n {creditInfo ? numberFormat(creditInfo.pending_credit) : 0}\n </div>\n <div className=\"text-[16px]\">{copy?.pointUnit}</div>\n </div>\n </div>\n </div>\n <div\n className={cn(\n 'grid w-fit md:w-full l:mt-[32px] l:gap-[12px] min-l:gap-[16px] min-l:pl-[48px] md-l:grid-cols-2'\n )}\n >\n {copy.buttons?.map((item, index) => (\n <Button\n key={index}\n variant={index === 0 ? 'secondary' : 'primary'}\n size=\"lg\"\n className=\"min-w-[156px] laptop:min-w-[189px]\"\n onClick={() => {\n handleButtonClick(item)\n }}\n >\n {item.text}\n </Button>\n ))}\n </div>\n\n {pageCommon?.activities && (\n <ActivitiesModal\n isOpen={openActivities}\n data={pageCommon?.activities}\n onClose={() => {\n setOpenActivities(false)\n }}\n />\n )}\n {pageCommon?.rewards && (\n <MyRewardsModal\n isOpen={openRewards}\n data={pageCommon?.rewards}\n onClose={() => {\n setOpenRewards(false)\n }}\n ></MyRewardsModal>\n )}\n </div>\n {hover && (\n <div\n role=\"button\"\n tabIndex={0}\n className=\"fixed inset-0 z-10\"\n onClick={() => setHover(false)}\n onKeyDown={e => e.key === 'Escape' && setHover(false)}\n />\n )}\n </Container>\n )\n}\n"],
5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E,CAAI,CACxB,EAEC,SAAAA,EAAK,MARDC,CASP,CACD,EACH,EAECN,GAAY,YACXxB,EAACS,EAAA,CACC,OAAQQ,EACR,KAAMO,GAAY,WAClB,QAAS,IAAM,CACbN,EAAkB,EAAK,CACzB,EACF,EAEDM,GAAY,SACXxB,EAACU,EAAA,CACC,OAAQS,EACR,KAAMK,GAAY,QAClB,QAAS,IAAM,CACbJ,EAAe,EAAK,CACtB,EACD,GAEL,EACCC,GACCrB,EAAC,OACC,KAAK,SACL,SAAU,EACV,UAAU,qBACV,QAAS,IAAMsB,EAAS,EAAK,EAC7B,UAAWS,GAAKA,EAAE,MAAQ,UAAYT,EAAS,EAAK,EACtD,GAEJ,CAEJ",
6
+ "names": ["jsx", "jsxs", "Button", "Container", "Text", "useCallback", "useState", "useCreditsContext", "numberFormat", "ActivitiesModal", "MyRewardsModal", "gaNormalClick", "cn", "useHeadlessContext", "roundedBrands", "CreditsInfoCard", "copy", "openActivities", "setOpenActivities", "openRewards", "setOpenRewards", "hover", "setHover", "creditInfo", "pageCommon", "brand", "rounded", "handleButtonClick", "buttonConfig", "item", "index", "e"]
7
+ }
@@ -0,0 +1,14 @@
1
+ interface Country {
2
+ id: string;
3
+ code: string;
4
+ name: string;
5
+ }
6
+ interface CountrySelectProps {
7
+ countries: Country[];
8
+ loading?: boolean;
9
+ className?: string;
10
+ value?: string;
11
+ onChange: (code: string) => void;
12
+ }
13
+ export declare function CountrySelect({ countries, loading, className, value, onChange }: CountrySelectProps): import("react/jsx-runtime").JSX.Element;
14
+ export {};
@@ -0,0 +1,2 @@
1
+ import{jsx as o,jsxs as p}from"react/jsx-runtime";import{Picture as v}from"@anker-in/headless-ui";import y from"../../context/hooks/useClickOutside";import s from"classnames";import{useEffect as h,useState as c}from"react";import{roundedBrands as C}from"../../const";import{useHeadlessContext as k}from"@anker-in/lib";function _({countries:t,loading:u,className:a,value:n,onChange:i}){const[f,r]=c(!1),[m,l]=c(""),{brand:g}=k(),d=C.includes(g),x=y(()=>{r(!1)});return h(()=>{const e=t.filter(b=>b.code===n);e.length&&l(e[0].name)},[l,t,n]),p("div",{className:"relative",children:[o("select",{className:s("!h-[50px] pr-[45px] min-l:hidden",a),style:{WebkitTextFillColor:"black"},disabled:u,value:n,onChange:e=>{i(e.target.value)},children:t.map(e=>o("option",{value:e.code,children:e.name},e.code))}),o("div",{className:s("absolute left-0 top-0 hidden !h-[50px] rounded-[2px] pr-[45px] text-[16px] font-bold focus:!border-[#6D6D6F] min-l:!block",!d&&"rounded-none",a),onClick:()=>{r(!0)},role:"button",tabIndex:0,onKeyDown:e=>{(e.key==="Enter"||e.key===" ")&&e.preventDefault()},children:m}),o(v,{source:"https://cdn.shopify.com/s/files/1/0517/6767/3016/files/country-select.png?v=1692202500",imgClassName:"pointer-events-none absolute right-0 top-0 bottom-0 !w-[45px] object-cover",alt:"arrow"}),o("div",{ref:x,className:s("absolute left-0 top-[58px] z-30 max-h-[334px] w-full cursor-pointer overflow-auto bg-white shadow-[0px_1px_12px_0px_rgba(0,0,0,0.12)]",!d&&"rounded-none",{"!hidden":!f}),children:o("ul",{className:"py-[6px]",children:t.map(e=>p("li",{value:e.code,className:s("relative px-[14px] py-[17px] text-[16px] font-bold leading-[1] transition hover:bg-[#EAEAEC]",{"!bg-[#EAEAEC]":e.code===n}),children:[o("button",{className:"absolute left-0 top-0 z-1 size-full opacity-0",value:e.code,onClick:()=>{l(e.name),r(!1),i(e.code)}}),e.name]},e.code))})})]})}export{_ as CountrySelect};
2
+ //# sourceMappingURL=CountrySelect.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/components/credits/creditsRedeemList/AddressForm/CountrySelect.tsx"],
4
+ "sourcesContent": ["import { Picture } from '@anker-in/headless-ui'\nimport useClickOutside from '../../context/hooks/useClickOutside'\nimport classNames from 'classnames'\nimport { useEffect, useState } from 'react'\nimport { roundedBrands } from '../../const'\nimport { useHeadlessContext } from '@anker-in/lib'\n\ninterface Country {\n id: string\n code: string\n name: string\n}\n\ninterface CountrySelectProps {\n countries: Country[]\n loading?: boolean\n className?: string\n value?: string\n onChange: (code: string) => void\n}\n\nexport function CountrySelect({ countries, loading, className, value, onChange }: CountrySelectProps) {\n const [show, setShow] = useState(false)\n const [display, setDisplay] = useState<any>('')\n const { brand } = useHeadlessContext()\n const rounded = roundedBrands.includes(brand)\n const dorpdown = useClickOutside<HTMLDivElement>(() => {\n setShow(false)\n })\n\n useEffect(() => {\n const target = countries.filter(item => item.code === value)\n if (target.length) setDisplay(target[0].name)\n }, [setDisplay, countries, value])\n\n return (\n <div className=\"relative\">\n <select\n className={classNames('!h-[50px] pr-[45px] min-l:hidden', className)}\n style={{\n WebkitTextFillColor: 'black',\n }}\n disabled={loading}\n value={value}\n onChange={event => {\n onChange(event.target.value)\n }}\n >\n {countries.map((item: { id: string; name: string; code: string }) => (\n <option key={item.code} value={item.code}>\n {item.name}\n </option>\n ))}\n </select>\n\n <div\n className={classNames(\n 'absolute left-0 top-0 hidden !h-[50px] rounded-[2px] pr-[45px] text-[16px] font-bold focus:!border-[#6D6D6F] min-l:!block',\n !rounded && 'rounded-none',\n className\n )}\n onClick={() => {\n setShow(true)\n }}\n role=\"button\"\n tabIndex={0}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n }\n }}\n >\n {display}\n </div>\n\n <Picture\n source=\"https://cdn.shopify.com/s/files/1/0517/6767/3016/files/country-select.png?v=1692202500\"\n imgClassName=\"pointer-events-none absolute right-0 top-0 bottom-0 !w-[45px] object-cover\"\n alt=\"arrow\"\n />\n\n <div\n ref={dorpdown}\n className={classNames(\n 'absolute left-0 top-[58px] z-30 max-h-[334px] w-full cursor-pointer overflow-auto bg-white shadow-[0px_1px_12px_0px_rgba(0,0,0,0.12)]',\n !rounded && 'rounded-none',\n { '!hidden': !show }\n )}\n >\n <ul className=\"py-[6px]\">\n {countries.map((item: { id: string; name: string; code: string }) => (\n <li\n key={item.code}\n value={item.code}\n className={classNames(\n 'relative px-[14px] py-[17px] text-[16px] font-bold leading-[1] transition hover:bg-[#EAEAEC]',\n { '!bg-[#EAEAEC]': item.code === value }\n )}\n >\n <button\n className=\"absolute left-0 top-0 z-1 size-full opacity-0\"\n value={item.code}\n onClick={() => {\n setDisplay(item.name)\n setShow(false)\n onChange(item.code)\n }}\n />\n {item.name}\n </li>\n ))}\n </ul>\n </div>\n </div>\n )\n}\n"],
5
+ "mappings": "AAiDU,cAAAA,EA0CE,QAAAC,MA1CF,oBAjDV,OAAS,WAAAC,MAAe,wBACxB,OAAOC,MAAqB,sCAC5B,OAAOC,MAAgB,aACvB,OAAS,aAAAC,EAAW,YAAAC,MAAgB,QACpC,OAAS,iBAAAC,MAAqB,cAC9B,OAAS,sBAAAC,MAA0B,gBAgB5B,SAASC,EAAc,CAAE,UAAAC,EAAW,QAAAC,EAAS,UAAAC,EAAW,MAAAC,EAAO,SAAAC,CAAS,EAAuB,CACpG,KAAM,CAACC,EAAMC,CAAO,EAAIV,EAAS,EAAK,EAChC,CAACW,EAASC,CAAU,EAAIZ,EAAc,EAAE,EACxC,CAAE,MAAAa,CAAM,EAAIX,EAAmB,EAC/BY,EAAUb,EAAc,SAASY,CAAK,EACtCE,EAAWlB,EAAgC,IAAM,CACrDa,EAAQ,EAAK,CACf,CAAC,EAED,OAAAX,EAAU,IAAM,CACd,MAAMiB,EAASZ,EAAU,OAAOa,GAAQA,EAAK,OAASV,CAAK,EACvDS,EAAO,QAAQJ,EAAWI,EAAO,CAAC,EAAE,IAAI,CAC9C,EAAG,CAACJ,EAAYR,EAAWG,CAAK,CAAC,EAG/BZ,EAAC,OAAI,UAAU,WACb,UAAAD,EAAC,UACC,UAAWI,EAAW,mCAAoCQ,CAAS,EACnE,MAAO,CACL,oBAAqB,OACvB,EACA,SAAUD,EACV,MAAOE,EACP,SAAUW,GAAS,CACjBV,EAASU,EAAM,OAAO,KAAK,CAC7B,EAEC,SAAAd,EAAU,IAAKa,GACdvB,EAAC,UAAuB,MAAOuB,EAAK,KACjC,SAAAA,EAAK,MADKA,EAAK,IAElB,CACD,EACH,EAEAvB,EAAC,OACC,UAAWI,EACT,4HACA,CAACgB,GAAW,eACZR,CACF,EACA,QAAS,IAAM,CACbI,EAAQ,EAAI,CACd,EACA,KAAK,SACL,SAAU,EACV,UAAW,GAAK,EACV,EAAE,MAAQ,SAAW,EAAE,MAAQ,MACjC,EAAE,eAAe,CAErB,EAEC,SAAAC,EACH,EAEAjB,EAACE,EAAA,CACC,OAAO,yFACP,aAAa,6EACb,IAAI,QACN,EAEAF,EAAC,OACC,IAAKqB,EACL,UAAWjB,EACT,yIACA,CAACgB,GAAW,eACZ,CAAE,UAAW,CAACL,CAAK,CACrB,EAEA,SAAAf,EAAC,MAAG,UAAU,WACX,SAAAU,EAAU,IAAKa,GACdtB,EAAC,MAEC,MAAOsB,EAAK,KACZ,UAAWnB,EACT,+FACA,CAAE,gBAAiBmB,EAAK,OAASV,CAAM,CACzC,EAEA,UAAAb,EAAC,UACC,UAAU,gDACV,MAAOuB,EAAK,KACZ,QAAS,IAAM,CACbL,EAAWK,EAAK,IAAI,EACpBP,EAAQ,EAAK,EACbF,EAASS,EAAK,IAAI,CACpB,EACF,EACCA,EAAK,OAhBDA,EAAK,IAiBZ,CACD,EACH,EACF,GACF,CAEJ",
6
+ "names": ["jsx", "jsxs", "Picture", "useClickOutside", "classNames", "useEffect", "useState", "roundedBrands", "useHeadlessContext", "CountrySelect", "countries", "loading", "className", "value", "onChange", "show", "setShow", "display", "setDisplay", "brand", "rounded", "dorpdown", "target", "item", "event"]
7
+ }
@@ -0,0 +1,6 @@
1
+ import { type PropsWithChildren } from 'react';
2
+ export declare const FormItem: ({ error, children, label, required, }: PropsWithChildren<{
3
+ label?: string;
4
+ required: boolean;
5
+ error?: string;
6
+ }>) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import{jsx as e,jsxs as s}from"react/jsx-runtime";import{Text as i}from"@anker-in/headless-ui";const d=({error:t,children:m,label:o,required:p})=>s("div",{children:[o&&e(i,{html:p?`${o} *`:o,className:"text-[16px] font-bold"}),e("div",{className:"mt-[8px] h-[50px] w-full text-[14px] font-semibold",children:m}),t&&typeof t=="string"&&e(i,{as:"div",html:t,className:"mt-[8px] text-[16px] font-bold text-[#FF4D4D]"})]});export{d as FormItem};
2
+ //# sourceMappingURL=FormItem.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/components/credits/creditsRedeemList/AddressForm/FormItem.tsx"],
4
+ "sourcesContent": ["import { Text } from '@anker-in/headless-ui'\nimport { type PropsWithChildren } from 'react'\n\nexport const FormItem = ({\n error,\n children,\n label,\n required,\n}: PropsWithChildren<{\n label?: string\n required: boolean\n error?: string\n}>) => {\n return (\n <div>\n {label && <Text html={required ? `${label} *` : label} className=\"text-[16px] font-bold\"></Text>}\n <div className=\"mt-[8px] h-[50px] w-full text-[14px] font-semibold\">{children}</div>\n {error && typeof error === 'string' && (\n <Text as=\"div\" html={error} className=\"mt-[8px] text-[16px] font-bold text-[#FF4D4D]\" />\n )}\n </div>\n )\n}\n"],
5
+ "mappings": "AAcI,OACY,OAAAA,EADZ,QAAAC,MAAA,oBAdJ,OAAS,QAAAC,MAAY,wBAGd,MAAMC,EAAW,CAAC,CACvB,MAAAC,EACA,SAAAC,EACA,MAAAC,EACA,SAAAC,CACF,IAMIN,EAAC,OACE,UAAAK,GAASN,EAACE,EAAA,CAAK,KAAMK,EAAW,GAAGD,CAAK,KAAOA,EAAO,UAAU,wBAAwB,EACzFN,EAAC,OAAI,UAAU,qDAAsD,SAAAK,EAAS,EAC7ED,GAAS,OAAOA,GAAU,UACzBJ,EAACE,EAAA,CAAK,GAAG,MAAM,KAAME,EAAO,UAAU,gDAAgD,GAE1F",
6
+ "names": ["jsx", "jsxs", "Text", "FormItem", "error", "children", "label", "required"]
7
+ }
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ interface InputProps {
3
+ className?: string;
4
+ value: string;
5
+ error?: string | boolean;
6
+ placeholder: string;
7
+ required?: boolean;
8
+ disabled?: boolean;
9
+ onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
10
+ onBlur?: () => void;
11
+ }
12
+ export declare function Input({ className, error, value, placeholder, disabled, onChange, onBlur }: InputProps): import("react/jsx-runtime").JSX.Element;
13
+ export {};
@@ -0,0 +1,2 @@
1
+ import{jsx as m}from"react/jsx-runtime";import h from"classnames";import{useCallback as r,useEffect as g,useState as b}from"react";function C({className:s,error:u,value:t,placeholder:c,disabled:p,onChange:a,onBlur:o}){const[v,e]=b(!1);g(()=>{t&&e(!0)},[t]);const d=r(n=>{const l=n.currentTarget.value;l&&e(!!l),a(n)},[a]),i=r(n=>{e(!!n.currentTarget.value),o&&o()},[o]),f=r(()=>{e(!0)},[]);return m("input",{className:h("w-full rounded-[2px] border border-[#6D6D6F] p-[14px] text-[16px] font-bold placeholder:text-[16px] placeholder:font-bold placeholder:text-[#6D6D6F] focus:outline-none focus:ring-0",s,u&&"border-[#FF4D4D]"),value:t,placeholder:c,disabled:p,onChange:d,onBlur:i,onFocus:f})}export{C as Input};
2
+ //# sourceMappingURL=Input.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/components/credits/creditsRedeemList/AddressForm/Input.tsx"],
4
+ "sourcesContent": ["import classNames from 'classnames'\nimport React, { useCallback, useEffect, useState } from 'react'\n\ninterface InputProps {\n className?: string\n value: string\n error?: string | boolean\n placeholder: string\n required?: boolean\n disabled?: boolean\n onChange: (event: React.ChangeEvent<HTMLInputElement>) => void\n onBlur?: () => void\n}\n\nexport function Input({ className, error, value, placeholder, disabled, onChange, onBlur }: InputProps) {\n const [focus, setFocus] = useState(false)\n\n useEffect(() => {\n if (value) setFocus(true)\n }, [value])\n\n const handleOnChange = useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n const val = event.currentTarget.value\n if (val) setFocus(!!val)\n onChange(event)\n },\n [onChange],\n )\n\n const handleOnBlur = useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n setFocus(!!event.currentTarget.value)\n onBlur && onBlur()\n },\n [onBlur],\n )\n\n const handleOnFocus = useCallback(() => {\n setFocus(true)\n }, [])\n\n return (\n <input\n className={classNames(\n 'w-full rounded-[2px] border border-[#6D6D6F] p-[14px] text-[16px] font-bold placeholder:text-[16px] placeholder:font-bold placeholder:text-[#6D6D6F] focus:outline-none focus:ring-0',\n className,\n error && 'border-[#FF4D4D]',\n )}\n value={value}\n placeholder={placeholder}\n disabled={disabled}\n onChange={handleOnChange}\n onBlur={handleOnBlur}\n onFocus={handleOnFocus}\n ></input>\n )\n}\n"],
5
+ "mappings": "AA2CI,cAAAA,MAAA,oBA3CJ,OAAOC,MAAgB,aACvB,OAAgB,eAAAC,EAAa,aAAAC,EAAW,YAAAC,MAAgB,QAajD,SAASC,EAAM,CAAE,UAAAC,EAAW,MAAAC,EAAO,MAAAC,EAAO,YAAAC,EAAa,SAAAC,EAAU,SAAAC,EAAU,OAAAC,CAAO,EAAe,CACtG,KAAM,CAACC,EAAOC,CAAQ,EAAIV,EAAS,EAAK,EAExCD,EAAU,IAAM,CACVK,GAAOM,EAAS,EAAI,CAC1B,EAAG,CAACN,CAAK,CAAC,EAEV,MAAMO,EAAiBb,EACpBc,GAA+C,CAC9C,MAAMC,EAAMD,EAAM,cAAc,MAC5BC,GAAKH,EAAS,CAAC,CAACG,CAAG,EACvBN,EAASK,CAAK,CAChB,EACA,CAACL,CAAQ,CACX,EAEMO,EAAehB,EAClBc,GAA+C,CAC9CF,EAAS,CAAC,CAACE,EAAM,cAAc,KAAK,EACpCJ,GAAUA,EAAO,CACnB,EACA,CAACA,CAAM,CACT,EAEMO,EAAgBjB,EAAY,IAAM,CACtCY,EAAS,EAAI,CACf,EAAG,CAAC,CAAC,EAEL,OACEd,EAAC,SACC,UAAWC,EACT,uLACAK,EACAC,GAAS,kBACX,EACA,MAAOC,EACP,YAAaC,EACb,SAAUC,EACV,SAAUK,EACV,OAAQG,EACR,QAASC,EACV,CAEL",
6
+ "names": ["jsx", "classNames", "useCallback", "useEffect", "useState", "Input", "className", "error", "value", "placeholder", "disabled", "onChange", "onBlur", "focus", "setFocus", "handleOnChange", "event", "val", "handleOnBlur", "handleOnFocus"]
7
+ }
@@ -0,0 +1,15 @@
1
+ interface StateSelectProps {
2
+ states: {
3
+ code: string;
4
+ id: string;
5
+ name: string;
6
+ }[];
7
+ className?: string;
8
+ countryId?: string;
9
+ defaultCode?: string;
10
+ stateName?: string;
11
+ stateCode?: string;
12
+ onChange: (code: string, name: string) => void;
13
+ }
14
+ export declare function StateSelect({ states, stateName, stateCode, className, onChange }: StateSelectProps): import("react/jsx-runtime").JSX.Element;
15
+ export {};
@@ -0,0 +1,2 @@
1
+ import{Fragment as j,jsx as n,jsxs as f}from"react/jsx-runtime";import a from"classnames";import{Picture as y}from"@anker-in/headless-ui";import{useEffect as k,useMemo as w,useState as u}from"react";import S from"../../context/hooks/useClickOutside";import{useHeadlessContext as N}from"@anker-in/lib";import{roundedBrands as C}from"../../const";function T({states:t,stateName:r="",stateCode:s="",className:i="",onChange:d}){const[g,c]=u(!1),[m,p]=u(""),{brand:v}=N(),x=C.includes(v),b=S(()=>{c(!1)}),l=w(()=>{const e=t.find(o=>s?o.code===s:o.name===r);return e?[e?.id,e?.name,e?.code].join(","):""},[t,s,r]);return k(()=>{const e=t.filter(o=>[o.id,o.name,o.code].join(",")===l);e.length&&p(e[0].name)},[p,t,l]),n("div",{className:"relative h-full",children:t.length?f(j,{children:[n("select",{className:a("h-[52px] pr-[45px] min-l:hidden",i),value:l,style:{WebkitTextFillColor:l?"black":"#666"},onChange:e=>{const[,o,h]=e.target.value.split(",");d(h,o)},children:t.map(e=>n("option",{value:[e.id,e.name,e.code].join(","),children:e.name},e.id))}),n("div",{className:a("absolute left-0 top-0 hidden h-[52px] pr-[45px] min-l:!block",i),onClick:()=>{c(!0)},role:"button",tabIndex:0,onKeyDown:e=>{(e.key==="Enter"||e.key===" ")&&e.preventDefault()},children:m}),n(y,{source:"https://cdn.shopify.com/s/files/1/0517/6767/3016/files/country-select.png?v=1692202500",className:"pointer-events-none absolute right-0 top-1/2 h-[45px] !w-[45px] -translate-y-1/2 object-cover",alt:"arrow"}),n("div",{ref:b,className:a("absolute left-0 top-[58px] z-30 max-h-[334px] w-full cursor-pointer overflow-auto bg-white shadow-[0px_1px_12px_0px_rgba(0,0,0,0.12)]",!x&&"rounded-none",{"!hidden":!g}),children:n("ul",{className:"py-[6px]",children:t.map(e=>f("li",{value:[e.id,e.name,e.code].join(","),className:a("relative px-[14px] py-[17px] text-[16px] font-semibold leading-[1] transition hover:bg-[#F7F8F9]",{"!bg-[#e8e8e8]":[e.id,e.name,e.code].join(",")===l}),children:[n("button",{className:"absolute left-0 top-0 z-1 size-full opacity-0",value:[e.id,e.name,e.code].join(","),onClick:()=>{p(e.name),c(!1),d(e.code,e.name)}}),e.name]},e.id))})})]}):n("input",{className:i,value:r,style:{WebkitTextFillColor:"black"},onChange:e=>{d("",e.target.value)}})})}export{T as StateSelect};
2
+ //# sourceMappingURL=StateSelect.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/components/credits/creditsRedeemList/AddressForm/StateSelect.tsx"],
4
+ "sourcesContent": ["import classNames from 'classnames'\nimport { Picture } from '@anker-in/headless-ui'\nimport { useEffect, useMemo, useState } from 'react'\nimport useClickOutside from '../../context/hooks/useClickOutside'\nimport { useHeadlessContext } from '@anker-in/lib'\nimport { roundedBrands } from '../../const'\n\ninterface StateSelectProps {\n states: { code: string; id: string; name: string }[]\n className?: string\n countryId?: string\n defaultCode?: string\n stateName?: string\n stateCode?: string\n onChange: (code: string, name: string) => void\n}\n\nexport function StateSelect({ states, stateName = '', stateCode = '', className = '', onChange }: StateSelectProps) {\n const [show, setShow] = useState(false)\n const [display, setDisplay] = useState<any>('')\n const { brand } = useHeadlessContext()\n const rounded = roundedBrands.includes(brand)\n\n const dropdown = useClickOutside<HTMLDivElement>(() => {\n setShow(false)\n })\n\n const value = useMemo(() => {\n const currentState = states.find(item => (stateCode ? item.code === stateCode : item.name === stateName))\n\n return currentState ? [currentState?.id, currentState?.name, currentState?.code].join(',') : ''\n }, [states, stateCode, stateName])\n\n useEffect(() => {\n const target = states.filter(item => [item.id, item.name, item.code].join(',') === value)\n if (target.length) setDisplay(target[0].name)\n }, [setDisplay, states, value])\n\n return (\n <div className=\"relative h-full\">\n {states.length ? (\n <>\n <select\n className={classNames('h-[52px] pr-[45px] min-l:hidden', className)}\n value={value}\n style={{\n WebkitTextFillColor: value ? 'black' : '#666',\n }}\n onChange={event => {\n const [, name, code] = event.target.value.split(',')\n onChange(code, name)\n }}\n >\n {states.map((item: { id: string; name: string; code: string }) => (\n <option key={item.id} value={[item.id, item.name, item.code].join(',')}>\n {item.name}\n </option>\n ))}\n </select>\n <div\n className={classNames('absolute left-0 top-0 hidden h-[52px] pr-[45px] min-l:!block', className)}\n onClick={() => {\n setShow(true)\n }}\n role=\"button\"\n tabIndex={0}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n }\n }}\n >\n {display}\n </div>\n\n <Picture\n source=\"https://cdn.shopify.com/s/files/1/0517/6767/3016/files/country-select.png?v=1692202500\"\n className=\"pointer-events-none absolute right-0 top-1/2 h-[45px] !w-[45px] -translate-y-1/2 object-cover\"\n alt=\"arrow\"\n />\n\n <div\n ref={dropdown}\n className={classNames(\n 'absolute left-0 top-[58px] z-30 max-h-[334px] w-full cursor-pointer overflow-auto bg-white shadow-[0px_1px_12px_0px_rgba(0,0,0,0.12)]',\n !rounded && 'rounded-none',\n { '!hidden': !show }\n )}\n >\n <ul className=\"py-[6px]\">\n {states.map((item: { id: string; name: string; code: string }) => (\n <li\n key={item.id}\n value={[item.id, item.name, item.code].join(',')}\n className={classNames(\n 'relative px-[14px] py-[17px] text-[16px] font-semibold leading-[1] transition hover:bg-[#F7F8F9]',\n {\n '!bg-[#e8e8e8]': [item.id, item.name, item.code].join(',') === value,\n }\n )}\n >\n <button\n className=\"absolute left-0 top-0 z-1 size-full opacity-0\"\n value={[item.id, item.name, item.code].join(',')}\n onClick={() => {\n setDisplay(item.name)\n setShow(false)\n onChange(item.code, item.name)\n }}\n />\n {item.name}\n </li>\n ))}\n </ul>\n </div>\n </>\n ) : (\n <input\n className={className}\n value={stateName}\n style={{\n WebkitTextFillColor: 'black',\n }}\n onChange={event => {\n onChange('', event.target.value)\n }}\n ></input>\n )}\n </div>\n )\n}\n"],
5
+ "mappings": "AAyCQ,mBAAAA,EAaM,OAAAC,EAqCE,QAAAC,MAlDR,oBAzCR,OAAOC,MAAgB,aACvB,OAAS,WAAAC,MAAe,wBACxB,OAAS,aAAAC,EAAW,WAAAC,EAAS,YAAAC,MAAgB,QAC7C,OAAOC,MAAqB,sCAC5B,OAAS,sBAAAC,MAA0B,gBACnC,OAAS,iBAAAC,MAAqB,cAYvB,SAASC,EAAY,CAAE,OAAAC,EAAQ,UAAAC,EAAY,GAAI,UAAAC,EAAY,GAAI,UAAAC,EAAY,GAAI,SAAAC,CAAS,EAAqB,CAClH,KAAM,CAACC,EAAMC,CAAO,EAAIX,EAAS,EAAK,EAChC,CAACY,EAASC,CAAU,EAAIb,EAAc,EAAE,EACxC,CAAE,MAAAc,CAAM,EAAIZ,EAAmB,EAC/Ba,EAAUZ,EAAc,SAASW,CAAK,EAEtCE,EAAWf,EAAgC,IAAM,CACrDU,EAAQ,EAAK,CACf,CAAC,EAEKM,EAAQlB,EAAQ,IAAM,CAC1B,MAAMmB,EAAeb,EAAO,KAAKc,GAASZ,EAAYY,EAAK,OAASZ,EAAYY,EAAK,OAASb,CAAU,EAExG,OAAOY,EAAe,CAACA,GAAc,GAAIA,GAAc,KAAMA,GAAc,IAAI,EAAE,KAAK,GAAG,EAAI,EAC/F,EAAG,CAACb,EAAQE,EAAWD,CAAS,CAAC,EAEjC,OAAAR,EAAU,IA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gBAAiB,CAACuB,EAAK,GAAIA,EAAK,KAAMA,EAAK,IAAI,EAAE,KAAK,GAAG,IAAMF,CACjE,CACF,EAEA,UAAAvB,EAAC,UACC,UAAU,gDACV,MAAO,CAACyB,EAAK,GAAIA,EAAK,KAAMA,EAAK,IAAI,EAAE,KAAK,GAAG,EAC/C,QAAS,IAAM,CACbN,EAAWM,EAAK,IAAI,EACpBR,EAAQ,EAAK,EACbF,EAASU,EAAK,KAAMA,EAAK,IAAI,CAC/B,EACF,EACCA,EAAK,OAlBDA,EAAK,EAmBZ,CACD,EACH,EACF,GACF,EAEAzB,EAAC,SACC,UAAWc,EACX,MAAOF,EACP,MAAO,CACL,oBAAqB,OACvB,EACA,SAAUe,GAAS,CACjBZ,EAAS,GAAIY,EAAM,OAAO,KAAK,CACjC,EACD,EAEL,CAEJ",
6
+ "names": ["Fragment", "jsx", "jsxs", "classNames", "Picture", "useEffect", "useMemo", "useState", "useClickOutside", "useHeadlessContext", "roundedBrands", "StateSelect", "states", "stateName", "stateCode", "className", "onChange", "show", "setShow", "display", "setDisplay", "brand", "rounded", "dropdown", "value", "currentState", "item", "target", "event", "name", "code"]
7
+ }
@@ -0,0 +1,2 @@
1
+ import { AddressFormProps } from './type';
2
+ export declare const AddressForm: ({ countries, countriesLoading, form, validate, errors, onChange }: AddressFormProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,2 @@
1
+ import{jsx as o,jsxs as L}from"react/jsx-runtime";import x from"classnames";import{useCallback as S,useEffect as w,useMemo as N,useState as I}from"react";import{CountrySelect as q}from"./CountrySelect";import{FormItem as P}from"./FormItem";import{Input as B}from"./Input";import{StateSelect as K}from"./StateSelect";import{ALPC_COUNTRY_MAP as U}from"../../context/const";import{useCreditsContext as z}from"../../context/provider";import{useHeadlessContext as D}from"@anker-in/lib";import{roundedBrands as E}from"../../const";const Z=({countries:c,countriesLoading:g,form:n,validate:C,errors:h,onChange:l})=>{const{profile:u,customer:r}=z(),{locale:m,brand:k}=D(),F=E.includes(k),[e,i]=I(),p=N(()=>c.find(a=>a.code===e?.country)?.provinces||[],[e,c]),v=N(()=>n?.flat().find(a=>a.type==="state")?.key,[n]),A=S(()=>{if(r?.defaultAddress)return{name:(r?.defaultAddress.firstName||"")+" "+(r?.defaultAddress.lastName||""),first_name:r?.defaultAddress.firstName,last_name:r?.defaultAddress.lastName,address1:r?.defaultAddress.address1,address2:r?.defaultAddress.address2,city:r?.defaultAddress.city,phone:r?.defaultAddress.phone,country:r?.defaultAddress.countryCodeV2,province:r?.defaultAddress.province,province_code:r?.defaultAddress.provinceCode,email:r?.email||u?.email,zip:r?.defaultAddress.zip};{let s=U.get(m)||m;return s==="UK"&&(s="GB"),s==="EU"&&(s="NL"),{email:u?.email,country:s}}},[r,u?.email,m]);return w(()=>{if(r){const s=A();i(s),l(s)}},[r,A]),e?o("div",{className:"grid gap-[20px]",children:n&&n.map((s,a)=>o("div",{className:"item-center -mx-[6px] flex",children:s.map((t,_)=>{const f=h.find(d=>d.key===t.key)?.message,y=x("h-full w-full appearance-none rounded-[2px] border bg-white px-[14px] py-[17px] leading-[1] outline-none placeholder:text-[#999] autofill:shadow-white focus:border-brand disabled:pointer-events-none disabled:text-[#999] disabled:bg-[#F7F8F9] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",f?"!border-[#F84D4F]":"border-[#d8d8d8]",!F&&"rounded-none");return t.type==="state"&&!p.length?null:o("div",{className:x("mx-[6px] flex-1"),children:L(P,{error:f,required:t.required,label:t.label,children:[t.type==="country"&&o(q,{className:y,countries:c,loading:g,value:e.country,onChange:d=>{e.country!==d&&(e.province="",e.province_code=""),e.country=d,i({...e}),l(e)}}),t.type==="state"&&o(K,{className:y,states:p,stateCode:e.province_code,stateName:e.province,onChange:(d,b)=>{e.province_code=d,e.province=b,i({...e}),l(e)}}),t.type!=="state"&&t.type!=="country"&&o(B,{placeholder:t.label,className:y,error:f,value:e[t.key],required:t.required,disabled:t.type==="email",onChange:d=>{const b=d.target.value;e[t.key]=b,i({...e}),l(e)},onBlur:()=>{C({ignoreKeys:p.length&&v?[v]:[]})}})]})},_)})},a))}):null};export{Z as AddressForm};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/components/credits/creditsRedeemList/AddressForm/index.tsx"],
4
+ "sourcesContent": ["import classNames from 'classnames'\nimport { useCallback, useEffect, useMemo, useState } from 'react'\n\nimport { CountrySelect } from './CountrySelect'\nimport { FormItem } from './FormItem'\nimport { Input } from './Input'\nimport { StateSelect } from './StateSelect'\nimport { ALPC_COUNTRY_MAP } from '../../context/const'\nimport { useCreditsContext } from '../../context/provider'\nimport { useHeadlessContext } from '@anker-in/lib'\nimport { AddressFormProps } from './type'\nimport { roundedBrands } from '../../const'\n\nexport const AddressForm = ({ countries, countriesLoading, form, validate, errors, onChange }: AddressFormProps) => {\n const { profile, customer } = useCreditsContext()\n const { locale, brand } = useHeadlessContext()\n const rounded = roundedBrands.includes(brand)\n const [address, setAddress] = useState<Record<string, any>>()\n\n const states = useMemo(() => {\n const currentCountry = countries.find(item => item.code === address?.country)\n\n return currentCountry?.provinces || []\n }, [address, countries])\n\n const stateInputKey = useMemo(() => {\n const stateInput = form?.flat().find(item => item.type === 'state')\n return stateInput?.key\n }, [form])\n\n const getDefaultAddress = useCallback(() => {\n if (customer?.defaultAddress) {\n return {\n name: (customer?.defaultAddress.firstName || '') + ' ' + (customer?.defaultAddress.lastName || ''),\n first_name: customer?.defaultAddress.firstName,\n last_name: customer?.defaultAddress.lastName,\n address1: customer?.defaultAddress.address1,\n address2: customer?.defaultAddress.address2,\n city: customer?.defaultAddress.city,\n phone: customer?.defaultAddress.phone,\n country: customer?.defaultAddress.countryCodeV2,\n province: customer?.defaultAddress.province,\n province_code: customer?.defaultAddress.provinceCode,\n email: customer?.email || profile?.email,\n zip: customer?.defaultAddress.zip,\n }\n } else {\n let defaultCountry = ALPC_COUNTRY_MAP.get(locale) || locale\n if (defaultCountry === 'UK') {\n defaultCountry = 'GB'\n }\n if (defaultCountry === 'EU') {\n defaultCountry = 'NL'\n }\n return {\n email: profile?.email,\n country: defaultCountry,\n }\n }\n }, [customer, profile?.email, locale])\n\n useEffect(() => {\n if (customer) {\n const defaultAddress = getDefaultAddress()\n setAddress(defaultAddress)\n onChange(defaultAddress)\n }\n }, [customer, getDefaultAddress])\n\n if (!address) {\n return null\n }\n\n return (\n <div className=\"grid gap-[20px]\">\n {form &&\n form.map((row, rowIndex: number) => (\n <div key={rowIndex} className=\"item-center -mx-[6px] flex\">\n {row.map((input, inputIndex: number) => {\n const error = errors.find(item => item.key === input.key)?.message\n const inputClassName = classNames(\n 'h-full w-full appearance-none rounded-[2px] border bg-white px-[14px] py-[17px] leading-[1] outline-none placeholder:text-[#999] autofill:shadow-white focus:border-brand disabled:pointer-events-none disabled:text-[#999] disabled:bg-[#F7F8F9] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none',\n error ? '!border-[#F84D4F]' : 'border-[#d8d8d8]',\n !rounded && 'rounded-none'\n )\n\n if (input.type === 'state') {\n if (!states.length) {\n return null\n }\n }\n\n return (\n <div key={inputIndex} className={classNames('mx-[6px] flex-1')}>\n <FormItem error={error} required={input.required} label={input.label}>\n {input.type === 'country' && (\n <CountrySelect\n className={inputClassName}\n countries={countries}\n loading={countriesLoading}\n value={address.country}\n onChange={selectedCountryCode => {\n if (address.country !== selectedCountryCode) {\n address.province = ''\n address.province_code = ''\n }\n address.country = selectedCountryCode\n setAddress({ ...address })\n onChange(address)\n }}\n ></CountrySelect>\n )}\n {input.type === 'state' && (\n <StateSelect\n className={inputClassName}\n states={states}\n stateCode={address.province_code}\n stateName={address.province}\n onChange={(provinceCode, provinceName) => {\n address.province_code = provinceCode\n address.province = provinceName\n setAddress({ ...address })\n onChange(address)\n }}\n ></StateSelect>\n )}\n\n {input.type !== 'state' && input.type !== 'country' && (\n <Input\n placeholder={input.label}\n className={inputClassName}\n error={error}\n value={address[input.key]}\n required={input.required}\n disabled={input.type === 'email'}\n onChange={event => {\n const value = event.target.value\n address[input.key] = value\n setAddress({ ...address })\n onChange(address)\n }}\n onBlur={() => {\n validate({\n ignoreKeys: states.length && stateInputKey ? [stateInputKey] : [],\n })\n }}\n />\n )}\n </FormItem>\n </div>\n )\n })}\n </div>\n ))}\n </div>\n )\n}\n"],
5
+ "mappings": "AA8FkB,OAEI,OAAAA,EAFJ,QAAAC,MAAA,oBA9FlB,OAAOC,MAAgB,aACvB,OAAS,eAAAC,EAAa,aAAAC,EAAW,WAAAC,EAAS,YAAAC,MAAgB,QAE1D,OAAS,iBAAAC,MAAqB,kBAC9B,OAAS,YAAAC,MAAgB,aACzB,OAAS,SAAAC,MAAa,UACtB,OAAS,eAAAC,MAAmB,gBAC5B,OAAS,oBAAAC,MAAwB,sBACjC,OAAS,qBAAAC,MAAyB,yBAClC,OAAS,sBAAAC,MAA0B,gBAEnC,OAAS,iBAAAC,MAAqB,cAEvB,MAAMC,EAAc,CAAC,CAAE,UAAAC,EAAW,iBAAAC,EAAkB,KAAAC,EAAM,SAAAC,EAAU,OAAAC,EAAQ,SAAAC,CAAS,IAAwB,CAClH,KAAM,CAAE,QAAAC,EAAS,SAAAC,CAAS,EAAIX,EAAkB,EAC1C,CAAE,OAAAY,EAAQ,MAAAC,CAAM,EAAIZ,EAAmB,EACvCa,EAAUZ,EAAc,SAASW,CAAK,EACtC,CAACE,EAASC,CAAU,EAAItB,EAA8B,EAEtDuB,EAASxB,EAAQ,IACEW,EAAU,KAAKc,GAAQA,EAAK,OAASH,GAAS,OAAO,GAErD,WAAa,CAAC,EACpC,CAACA,EAASX,CAAS,CAAC,EAEjBe,EAAgB1B,EAAQ,IACTa,GAAM,KAAK,EAAE,KAAKY,GAAQA,EAAK,OAAS,OAAO,GAC/C,IAClB,CAACZ,CAAI,CAAC,EAEHc,EAAoB7B,EAAY,IAAM,CAC1C,GAAIoB,GAAU,eACZ,MAA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,EAACO,EAAA,CACC,UAAWiC,EACX,UAAWxB,EACX,QAASC,EACT,MAAOU,EAAQ,QACf,SAAUc,GAAuB,CAC3Bd,EAAQ,UAAYc,IACtBd,EAAQ,SAAW,GACnBA,EAAQ,cAAgB,IAE1BA,EAAQ,QAAUc,EAClBb,EAAW,CAAE,GAAGD,CAAQ,CAAC,EACzBN,EAASM,CAAO,CAClB,EACD,EAEFU,EAAM,OAAS,SACdrC,EAACU,EAAA,CACC,UAAW8B,EACX,OAAQX,EACR,UAAWF,EAAQ,cACnB,UAAWA,EAAQ,SACnB,SAAU,CAACe,EAAcC,IAAiB,CACxChB,EAAQ,cAAgBe,EACxBf,EAAQ,SAAWgB,EACnBf,EAAW,CAAE,GAAGD,CAAQ,CAAC,EACzBN,EAASM,CAAO,CAClB,EACD,EAGFU,EAAM,OAAS,SAAWA,EAAM,OAAS,WACxCrC,EAACS,EAAA,CACC,YAAa4B,EAAM,MACnB,UAAWG,EACX,MAAOD,EACP,MAAOZ,EAAQU,EAAM,GAAG,EACxB,SAAUA,EAAM,SAChB,SAAUA,EAAM,OAAS,QACzB,SAAUO,GAAS,CACjB,MAAMC,EAAQD,EAAM,OAAO,MAC3BjB,EAAQU,EAAM,GAAG,EAAIQ,EACrBjB,EAAW,CAAE,GAAGD,CAAQ,CAAC,EACzBN,EAASM,CAAO,CAClB,EACA,OAAQ,IAAM,CACZR,EAAS,CACP,WAAYU,EAAO,QAAUE,EAAgB,CAACA,CAAa,EAAI,CAAC,CAClE,CAAC,CACH,EACF,GAEJ,GAvDQO,CAwDV,CAEJ,CAAC,GA1EOF,CA2EV,CACD,EACL,EApFO,IAsFX",
6
+ "names": ["jsx", "jsxs", "classNames", "useCallback", "useEffect", "useMemo", "useState", "CountrySelect", "FormItem", "Input", "StateSelect", "ALPC_COUNTRY_MAP", "useCreditsContext", "useHeadlessContext", "roundedBrands", "AddressForm", "countries", "countriesLoading", "form", "validate", "errors", "onChange", "profile", "customer", "locale", "brand", "rounded", "address", "setAddress", "states", "item", "stateInputKey", "getDefaultAddress", "defaultCountry", "defaultAddress", "row", "rowIndex", "input", "inputIndex", "error", "inputClassName", "selectedCountryCode", "provinceCode", "provinceName", "event", "value"]
7
+ }