@anker-in/campaign-ui 0.1.10 → 0.2.0
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.
- package/dist/cjs/components/chat/action.js +1 -1
- package/dist/cjs/components/chat/action.js.map +1 -1
- package/dist/cjs/components/chat/button.d.ts +1 -1
- package/dist/cjs/components/chat/button.js +1 -1
- package/dist/cjs/components/chat/button.js.map +1 -1
- package/dist/cjs/components/chat/index.js +1 -1
- package/dist/cjs/components/chat/index.js.map +2 -2
- package/dist/cjs/components/chat/{Messages.d.ts → messages.d.ts} +1 -1
- package/dist/cjs/components/chat/messages.js +1 -1
- package/dist/cjs/components/chat/messages.js.map +2 -2
- package/dist/cjs/components/chat/props.js +1 -1
- package/dist/cjs/components/chat/props.js.map +2 -2
- package/dist/cjs/components/chat/response.js +1 -1
- package/dist/cjs/components/chat/response.js.map +2 -2
- package/dist/cjs/components/chat/suggestions.d.ts +1 -1
- package/dist/cjs/components/chat/suggestions.js.map +1 -1
- package/dist/cjs/components/credits/context/const.d.ts +82 -0
- package/dist/cjs/components/credits/context/const.js +2 -0
- package/dist/cjs/components/credits/context/const.js.map +7 -0
- package/dist/cjs/components/credits/context/hooks/useActivities.d.ts +12 -0
- package/dist/cjs/components/credits/context/hooks/useActivities.js +2 -0
- package/dist/cjs/components/credits/context/hooks/useActivities.js.map +7 -0
- package/dist/cjs/components/credits/context/hooks/useAddressValidate.d.ts +34 -0
- package/dist/cjs/components/credits/context/hooks/useAddressValidate.js +2 -0
- package/dist/cjs/components/credits/context/hooks/useAddressValidate.js.map +7 -0
- package/dist/cjs/components/credits/context/hooks/useAlpcFetch.d.ts +23 -0
- package/dist/cjs/components/credits/context/hooks/useAlpcFetch.js +2 -0
- package/dist/cjs/components/credits/context/hooks/useAlpcFetch.js.map +7 -0
- package/dist/cjs/components/credits/context/hooks/useClickOutside.d.ts +3 -0
- package/dist/cjs/components/credits/context/hooks/useClickOutside.js +2 -0
- package/dist/cjs/components/credits/context/hooks/useClickOutside.js.map +7 -0
- package/dist/cjs/components/credits/context/hooks/useCopy.d.ts +5 -0
- package/dist/cjs/components/credits/context/hooks/useCopy.js +2 -0
- package/dist/cjs/components/credits/context/hooks/useCopy.js.map +7 -0
- package/dist/cjs/components/credits/context/hooks/useCountries.d.ts +8 -0
- package/dist/cjs/components/credits/context/hooks/useCountries.js +2 -0
- package/dist/cjs/components/credits/context/hooks/useCountries.js.map +7 -0
- package/dist/cjs/components/credits/context/hooks/useFirstPurchaseFinished.d.ts +1 -0
- package/dist/cjs/components/credits/context/hooks/useFirstPurchaseFinished.js +2 -0
- package/dist/cjs/components/credits/context/hooks/useFirstPurchaseFinished.js.map +7 -0
- package/dist/cjs/components/credits/context/hooks/useMyRewards.d.ts +14 -0
- package/dist/cjs/components/credits/context/hooks/useMyRewards.js +2 -0
- package/dist/cjs/components/credits/context/hooks/useMyRewards.js.map +7 -0
- package/dist/cjs/components/credits/context/hooks/useReceiptUploaded.d.ts +2 -0
- package/dist/cjs/components/credits/context/hooks/useReceiptUploaded.js +2 -0
- package/dist/cjs/components/credits/context/hooks/useReceiptUploaded.js.map +7 -0
- package/dist/cjs/components/credits/context/hooks/useRedeemAndBuy.d.ts +9 -0
- package/dist/cjs/components/credits/context/hooks/useRedeemAndBuy.js +2 -0
- package/dist/cjs/components/credits/context/hooks/useRedeemAndBuy.js.map +7 -0
- package/dist/cjs/components/credits/context/hooks/useRedeemCoupon.d.ts +18 -0
- package/dist/cjs/components/credits/context/hooks/useRedeemCoupon.js +2 -0
- package/dist/cjs/components/credits/context/hooks/useRedeemCoupon.js.map +7 -0
- package/dist/cjs/components/credits/context/hooks/useRedeemProduct.d.ts +16 -0
- package/dist/cjs/components/credits/context/hooks/useRedeemProduct.js +2 -0
- package/dist/cjs/components/credits/context/hooks/useRedeemProduct.js.map +7 -0
- package/dist/cjs/components/credits/context/hooks/useRedeemableList.d.ts +7 -0
- package/dist/cjs/components/credits/context/hooks/useRedeemableList.js +2 -0
- package/dist/cjs/components/credits/context/hooks/useRedeemableList.js.map +7 -0
- package/dist/cjs/components/credits/context/hooks/useSendEmailValidation.d.ts +1 -0
- package/dist/cjs/components/credits/context/hooks/useSendEmailValidation.js +2 -0
- package/dist/cjs/components/credits/context/hooks/useSendEmailValidation.js.map +7 -0
- package/dist/cjs/components/credits/context/hooks/useSubscribed.d.ts +1 -0
- package/dist/cjs/components/credits/context/hooks/useSubscribed.js +2 -0
- package/dist/cjs/components/credits/context/hooks/useSubscribed.js.map +7 -0
- package/dist/cjs/components/credits/context/hooks/useSubscriptions.d.ts +9 -0
- package/dist/cjs/components/credits/context/hooks/useSubscriptions.js +2 -0
- package/dist/cjs/components/credits/context/hooks/useSubscriptions.js.map +7 -0
- package/dist/cjs/components/credits/context/hooks/useUploadReceipt.d.ts +14 -0
- package/dist/cjs/components/credits/context/hooks/useUploadReceipt.js +2 -0
- package/dist/cjs/components/credits/context/hooks/useUploadReceipt.js.map +7 -0
- package/dist/cjs/components/credits/context/provider.d.ts +49 -0
- package/dist/cjs/components/credits/context/provider.js +2 -0
- package/dist/cjs/components/credits/context/provider.js.map +7 -0
- package/dist/cjs/components/credits/context/response.d.ts +63 -0
- package/dist/cjs/components/credits/context/response.js +2 -0
- package/dist/cjs/components/credits/context/response.js.map +7 -0
- package/dist/cjs/components/credits/context/utils.d.ts +25 -0
- package/dist/cjs/components/credits/context/utils.js +2 -0
- package/dist/cjs/components/credits/context/utils.js.map +7 -0
- package/dist/cjs/components/credits/creditsBanner/index.d.ts +23 -0
- package/dist/cjs/components/credits/creditsBanner/index.js +2 -0
- package/dist/cjs/components/credits/creditsBanner/index.js.map +7 -0
- package/dist/cjs/components/credits/creditsBenefits/benefitItem.d.ts +19 -0
- package/dist/cjs/components/credits/creditsBenefits/benefitItem.js +2 -0
- package/dist/cjs/components/credits/creditsBenefits/benefitItem.js.map +7 -0
- package/dist/cjs/components/credits/creditsBenefits/iconInfo.d.ts +2 -0
- package/dist/cjs/components/credits/creditsBenefits/iconInfo.js +2 -0
- package/dist/cjs/components/credits/creditsBenefits/iconInfo.js.map +7 -0
- package/dist/cjs/components/credits/creditsBenefits/index.d.ts +12 -0
- package/dist/cjs/components/credits/creditsBenefits/index.js +4 -0
- package/dist/cjs/components/credits/creditsBenefits/index.js.map +7 -0
- package/dist/cjs/components/credits/creditsCash/RedeemableItem.d.ts +13 -0
- package/dist/cjs/components/credits/creditsCash/RedeemableItem.js +2 -0
- package/dist/cjs/components/credits/creditsCash/RedeemableItem.js.map +7 -0
- package/dist/cjs/components/credits/creditsCash/index.d.ts +11 -0
- package/dist/cjs/components/credits/creditsCash/index.js +2 -0
- package/dist/cjs/components/credits/creditsCash/index.js.map +7 -0
- package/dist/cjs/components/credits/creditsCash/type.d.ts +47 -0
- package/dist/cjs/components/credits/creditsCash/type.js +2 -0
- package/dist/cjs/components/credits/creditsCash/type.js.map +7 -0
- package/dist/cjs/components/credits/creditsFaq/faqItem/FaqItem.d.ts +13 -0
- package/dist/cjs/components/credits/creditsFaq/faqItem/FaqItem.js +2 -0
- package/dist/cjs/components/credits/creditsFaq/faqItem/FaqItem.js.map +7 -0
- package/dist/cjs/components/credits/creditsFaq/index.d.ts +16 -0
- package/dist/cjs/components/credits/creditsFaq/index.js +2 -0
- package/dist/cjs/components/credits/creditsFaq/index.js.map +7 -0
- package/dist/cjs/components/credits/creditsInfoCard/index.d.ts +20 -0
- package/dist/cjs/components/credits/creditsInfoCard/index.js +2 -0
- package/dist/cjs/components/credits/creditsInfoCard/index.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/CountrySelect.d.ts +14 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/CountrySelect.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/CountrySelect.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/FormItem.d.ts +6 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/FormItem.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/FormItem.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/Input.d.ts +13 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/Input.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/Input.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/StateSelect.d.ts +15 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/StateSelect.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/StateSelect.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/index.d.ts +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/index.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/index.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/type.d.ts +26 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/type.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/type.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/NonProductValue.d.ts +6 -0
- package/dist/cjs/components/credits/creditsRedeemList/NonProductValue.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/NonProductValue.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.d.ts +9 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.d.ts +20 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Error.d.ts +8 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Error.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Error.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Init.d.ts +11 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Init.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Init.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.d.ts +6 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.d.ts +8 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.d.ts +13 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.d.ts +11 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemableItem.d.ts +9 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemableItem.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemableItem.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/index.d.ts +12 -0
- package/dist/cjs/components/credits/creditsRedeemList/index.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/index.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/type.d.ts +77 -0
- package/dist/cjs/components/credits/creditsRedeemList/type.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/type.js.map +7 -0
- package/dist/cjs/components/credits/creditsWaysToGetCredits/index.d.ts +2 -0
- package/dist/cjs/components/credits/creditsWaysToGetCredits/index.js +2 -0
- package/dist/cjs/components/credits/creditsWaysToGetCredits/index.js.map +7 -0
- package/dist/cjs/components/credits/creditsWaysToGetCredits/type.d.ts +59 -0
- package/dist/cjs/components/credits/creditsWaysToGetCredits/type.js +2 -0
- package/dist/cjs/components/credits/creditsWaysToGetCredits/type.js.map +7 -0
- package/dist/cjs/components/credits/creditsWaysToGetCredits/useActions.d.ts +96 -0
- package/dist/cjs/components/credits/creditsWaysToGetCredits/useActions.js +2 -0
- package/dist/cjs/components/credits/creditsWaysToGetCredits/useActions.js.map +7 -0
- package/dist/cjs/components/credits/index.d.ts +10 -0
- package/dist/cjs/components/credits/index.js +2 -0
- package/dist/cjs/components/credits/index.js.map +7 -0
- package/dist/cjs/components/credits/modal/MyRewardsModal.d.ts +32 -0
- package/dist/cjs/components/credits/modal/MyRewardsModal.js +2 -0
- package/dist/cjs/components/credits/modal/MyRewardsModal.js.map +7 -0
- package/dist/cjs/components/credits/modal/activitiesModal.d.ts +32 -0
- package/dist/cjs/components/credits/modal/activitiesModal.js +2 -0
- package/dist/cjs/components/credits/modal/activitiesModal.js.map +7 -0
- package/dist/cjs/components/credits/modal/creditsUploadReceiptModal.d.ts +24 -0
- package/dist/cjs/components/credits/modal/creditsUploadReceiptModal.js +2 -0
- package/dist/cjs/components/credits/modal/creditsUploadReceiptModal.js.map +7 -0
- package/dist/cjs/components/credits/modal/loadingDots.d.ts +6 -0
- package/dist/cjs/components/credits/modal/loadingDots.js +2 -0
- package/dist/cjs/components/credits/modal/loadingDots.js.map +7 -0
- package/dist/cjs/components/credits/modal/modalContainer.d.ts +15 -0
- package/dist/cjs/components/credits/modal/modalContainer.js +2 -0
- package/dist/cjs/components/credits/modal/modalContainer.js.map +7 -0
- package/dist/cjs/components/credits/modal/rulesModal.d.ts +7 -0
- package/dist/cjs/components/credits/modal/rulesModal.js +2 -0
- package/dist/cjs/components/credits/modal/rulesModal.js.map +7 -0
- package/dist/cjs/components/credits/modal/tip.d.ts +5 -0
- package/dist/cjs/components/credits/modal/tip.js +2 -0
- package/dist/cjs/components/credits/modal/tip.js.map +7 -0
- package/dist/cjs/components/credits/type.d.ts +55 -0
- package/dist/cjs/components/credits/type.js +2 -0
- package/dist/cjs/components/credits/type.js.map +7 -0
- package/dist/cjs/components/index.d.ts +3 -2
- package/dist/cjs/components/index.js +1 -1
- package/dist/cjs/components/index.js.map +3 -3
- package/dist/cjs/components/registration/authCodeActivate/Message.d.ts +4 -0
- package/dist/cjs/components/registration/authCodeActivate/Message.js +2 -0
- package/dist/cjs/components/registration/authCodeActivate/Message.js.map +7 -0
- package/dist/cjs/components/registration/authCodeActivate/index.d.ts +3 -0
- package/dist/cjs/components/registration/authCodeActivate/index.js +2 -0
- package/dist/cjs/components/registration/authCodeActivate/index.js.map +7 -0
- package/dist/cjs/components/registration/authCodeActivate/type.d.ts +23 -0
- package/dist/cjs/components/registration/authCodeActivate/type.js +2 -0
- package/dist/cjs/components/registration/authCodeActivate/type.js.map +7 -0
- package/dist/cjs/components/registration/index.d.ts +1 -0
- package/dist/cjs/components/registration/index.js +2 -0
- package/dist/cjs/components/registration/index.js.map +7 -0
- package/dist/cjs/components/registration/modalContainer.d.ts +15 -0
- package/dist/cjs/components/registration/modalContainer.js +2 -0
- package/dist/cjs/components/registration/modalContainer.js.map +7 -0
- package/dist/cjs/debug-env.d.ts +7 -0
- package/dist/cjs/debug-env.js +2 -0
- package/dist/cjs/debug-env.js.map +7 -0
- package/dist/cjs/helpers/fetcher.js +1 -1
- package/dist/cjs/helpers/fetcher.js.map +2 -2
- package/dist/cjs/helpers/index.d.ts +2 -2
- package/dist/cjs/helpers/index.js +1 -1
- package/dist/cjs/helpers/index.js.map +2 -2
- package/dist/cjs/helpers/track.d.ts +19 -0
- package/dist/cjs/helpers/track.js +2 -0
- package/dist/cjs/helpers/track.js.map +7 -0
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/stories/chat.stories.d.ts +1 -1
- package/dist/cjs/stories/chat.stories.js +1 -1
- package/dist/cjs/stories/chat.stories.js.map +3 -3
- package/dist/esm/components/chat/action.js +1 -1
- package/dist/esm/components/chat/action.js.map +1 -1
- package/dist/esm/components/chat/button.d.ts +1 -1
- package/dist/esm/components/chat/button.js +1 -1
- package/dist/esm/components/chat/button.js.map +1 -1
- package/dist/esm/components/chat/index.js +1 -1
- package/dist/esm/components/chat/index.js.map +2 -2
- package/dist/esm/components/chat/{Messages.d.ts → messages.d.ts} +1 -1
- package/dist/esm/components/chat/messages.js +1 -1
- package/dist/esm/components/chat/messages.js.map +2 -2
- package/dist/esm/components/chat/props.js +0 -1
- package/dist/esm/components/chat/props.js.map +3 -3
- package/dist/esm/components/chat/response.js +1 -1
- package/dist/esm/components/chat/response.js.map +2 -2
- package/dist/esm/components/chat/suggestions.d.ts +1 -1
- package/dist/esm/components/chat/suggestions.js.map +1 -1
- package/dist/esm/components/credits/context/const.d.ts +82 -0
- package/dist/esm/components/credits/context/const.js +2 -0
- package/dist/esm/components/credits/context/const.js.map +7 -0
- package/dist/esm/components/credits/context/hooks/useActivities.d.ts +12 -0
- package/dist/esm/components/credits/context/hooks/useActivities.js +2 -0
- package/dist/esm/components/credits/context/hooks/useActivities.js.map +7 -0
- package/dist/esm/components/credits/context/hooks/useAddressValidate.d.ts +34 -0
- package/dist/esm/components/credits/context/hooks/useAddressValidate.js +2 -0
- package/dist/esm/components/credits/context/hooks/useAddressValidate.js.map +7 -0
- package/dist/esm/components/credits/context/hooks/useAlpcFetch.d.ts +23 -0
- package/dist/esm/components/credits/context/hooks/useAlpcFetch.js +2 -0
- package/dist/esm/components/credits/context/hooks/useAlpcFetch.js.map +7 -0
- package/dist/esm/components/credits/context/hooks/useClickOutside.d.ts +3 -0
- package/dist/esm/components/credits/context/hooks/useClickOutside.js +2 -0
- package/dist/esm/components/credits/context/hooks/useClickOutside.js.map +7 -0
- package/dist/esm/components/credits/context/hooks/useCopy.d.ts +5 -0
- package/dist/esm/components/credits/context/hooks/useCopy.js +2 -0
- package/dist/esm/components/credits/context/hooks/useCopy.js.map +7 -0
- package/dist/esm/components/credits/context/hooks/useCountries.d.ts +8 -0
- package/dist/esm/components/credits/context/hooks/useCountries.js +2 -0
- package/dist/esm/components/credits/context/hooks/useCountries.js.map +7 -0
- package/dist/esm/components/credits/context/hooks/useFirstPurchaseFinished.d.ts +1 -0
- package/dist/esm/components/credits/context/hooks/useFirstPurchaseFinished.js +2 -0
- package/dist/esm/components/credits/context/hooks/useFirstPurchaseFinished.js.map +7 -0
- package/dist/esm/components/credits/context/hooks/useMyRewards.d.ts +14 -0
- package/dist/esm/components/credits/context/hooks/useMyRewards.js +2 -0
- package/dist/esm/components/credits/context/hooks/useMyRewards.js.map +7 -0
- package/dist/esm/components/credits/context/hooks/useReceiptUploaded.d.ts +2 -0
- package/dist/esm/components/credits/context/hooks/useReceiptUploaded.js +2 -0
- package/dist/esm/components/credits/context/hooks/useReceiptUploaded.js.map +7 -0
- package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.d.ts +9 -0
- package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.js +2 -0
- package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.js.map +7 -0
- package/dist/esm/components/credits/context/hooks/useRedeemCoupon.d.ts +18 -0
- package/dist/esm/components/credits/context/hooks/useRedeemCoupon.js +2 -0
- package/dist/esm/components/credits/context/hooks/useRedeemCoupon.js.map +7 -0
- package/dist/esm/components/credits/context/hooks/useRedeemProduct.d.ts +16 -0
- package/dist/esm/components/credits/context/hooks/useRedeemProduct.js +2 -0
- package/dist/esm/components/credits/context/hooks/useRedeemProduct.js.map +7 -0
- package/dist/esm/components/credits/context/hooks/useRedeemableList.d.ts +7 -0
- package/dist/esm/components/credits/context/hooks/useRedeemableList.js +2 -0
- package/dist/esm/components/credits/context/hooks/useRedeemableList.js.map +7 -0
- package/dist/esm/components/credits/context/hooks/useSendEmailValidation.d.ts +1 -0
- package/dist/esm/components/credits/context/hooks/useSendEmailValidation.js +2 -0
- package/dist/esm/components/credits/context/hooks/useSendEmailValidation.js.map +7 -0
- package/dist/esm/components/credits/context/hooks/useSubscribed.d.ts +1 -0
- package/dist/esm/components/credits/context/hooks/useSubscribed.js +2 -0
- package/dist/esm/components/credits/context/hooks/useSubscribed.js.map +7 -0
- package/dist/esm/components/credits/context/hooks/useSubscriptions.d.ts +9 -0
- package/dist/esm/components/credits/context/hooks/useSubscriptions.js +2 -0
- package/dist/esm/components/credits/context/hooks/useSubscriptions.js.map +7 -0
- package/dist/esm/components/credits/context/hooks/useUploadReceipt.d.ts +14 -0
- package/dist/esm/components/credits/context/hooks/useUploadReceipt.js +2 -0
- package/dist/esm/components/credits/context/hooks/useUploadReceipt.js.map +7 -0
- package/dist/esm/components/credits/context/provider.d.ts +49 -0
- package/dist/esm/components/credits/context/provider.js +2 -0
- package/dist/esm/components/credits/context/provider.js.map +7 -0
- package/dist/esm/components/credits/context/response.d.ts +63 -0
- package/dist/esm/components/credits/context/response.js +1 -0
- package/dist/esm/components/credits/context/utils.d.ts +25 -0
- package/dist/esm/components/credits/context/utils.js +2 -0
- package/dist/esm/components/credits/context/utils.js.map +7 -0
- package/dist/esm/components/credits/creditsBanner/index.d.ts +23 -0
- package/dist/esm/components/credits/creditsBanner/index.js +2 -0
- package/dist/esm/components/credits/creditsBanner/index.js.map +7 -0
- package/dist/esm/components/credits/creditsBenefits/benefitItem.d.ts +19 -0
- package/dist/esm/components/credits/creditsBenefits/benefitItem.js +2 -0
- package/dist/esm/components/credits/creditsBenefits/benefitItem.js.map +7 -0
- package/dist/esm/components/credits/creditsBenefits/iconInfo.d.ts +2 -0
- package/dist/esm/components/credits/creditsBenefits/iconInfo.js +2 -0
- package/dist/esm/components/credits/creditsBenefits/iconInfo.js.map +7 -0
- package/dist/esm/components/credits/creditsBenefits/index.d.ts +12 -0
- package/dist/esm/components/credits/creditsBenefits/index.js +4 -0
- package/dist/esm/components/credits/creditsBenefits/index.js.map +7 -0
- package/dist/esm/components/credits/creditsCash/RedeemableItem.d.ts +13 -0
- package/dist/esm/components/credits/creditsCash/RedeemableItem.js +2 -0
- package/dist/esm/components/credits/creditsCash/RedeemableItem.js.map +7 -0
- package/dist/esm/components/credits/creditsCash/index.d.ts +11 -0
- package/dist/esm/components/credits/creditsCash/index.js +2 -0
- package/dist/esm/components/credits/creditsCash/index.js.map +7 -0
- package/dist/esm/components/credits/creditsCash/type.d.ts +47 -0
- package/dist/esm/components/credits/creditsCash/type.js +1 -0
- package/dist/esm/components/credits/creditsFaq/faqItem/FaqItem.d.ts +13 -0
- package/dist/esm/components/credits/creditsFaq/faqItem/FaqItem.js +2 -0
- package/dist/esm/components/credits/creditsFaq/faqItem/FaqItem.js.map +7 -0
- package/dist/esm/components/credits/creditsFaq/index.d.ts +16 -0
- package/dist/esm/components/credits/creditsFaq/index.js +2 -0
- package/dist/esm/components/credits/creditsFaq/index.js.map +7 -0
- package/dist/esm/components/credits/creditsInfoCard/index.d.ts +20 -0
- package/dist/esm/components/credits/creditsInfoCard/index.js +2 -0
- package/dist/esm/components/credits/creditsInfoCard/index.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/CountrySelect.d.ts +14 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/CountrySelect.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/CountrySelect.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/FormItem.d.ts +6 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/FormItem.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/FormItem.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/Input.d.ts +13 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/Input.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/Input.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/StateSelect.d.ts +15 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/StateSelect.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/StateSelect.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/index.d.ts +2 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/index.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/index.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/type.d.ts +26 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/type.js +1 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/type.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/NonProductValue.d.ts +6 -0
- package/dist/esm/components/credits/creditsRedeemList/NonProductValue.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/NonProductValue.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.d.ts +9 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.d.ts +20 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Error.d.ts +8 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Error.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Error.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.d.ts +11 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.d.ts +6 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.d.ts +8 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.d.ts +13 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.d.ts +11 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemableItem.d.ts +9 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemableItem.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemableItem.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/index.d.ts +12 -0
- package/dist/esm/components/credits/creditsRedeemList/index.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/index.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/type.d.ts +77 -0
- package/dist/esm/components/credits/creditsRedeemList/type.js +1 -0
- package/dist/esm/components/credits/creditsRedeemList/type.js.map +7 -0
- package/dist/esm/components/credits/creditsWaysToGetCredits/index.d.ts +2 -0
- package/dist/esm/components/credits/creditsWaysToGetCredits/index.js +2 -0
- package/dist/esm/components/credits/creditsWaysToGetCredits/index.js.map +7 -0
- package/dist/esm/components/credits/creditsWaysToGetCredits/type.d.ts +59 -0
- package/dist/esm/components/credits/creditsWaysToGetCredits/type.js +2 -0
- package/dist/esm/components/credits/creditsWaysToGetCredits/type.js.map +7 -0
- package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.d.ts +96 -0
- package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.js +2 -0
- package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.js.map +7 -0
- package/dist/esm/components/credits/index.d.ts +10 -0
- package/dist/esm/components/credits/index.js +2 -0
- package/dist/esm/components/credits/index.js.map +7 -0
- package/dist/esm/components/credits/modal/MyRewardsModal.d.ts +32 -0
- package/dist/esm/components/credits/modal/MyRewardsModal.js +2 -0
- package/dist/esm/components/credits/modal/MyRewardsModal.js.map +7 -0
- package/dist/esm/components/credits/modal/activitiesModal.d.ts +32 -0
- package/dist/esm/components/credits/modal/activitiesModal.js +2 -0
- package/dist/esm/components/credits/modal/activitiesModal.js.map +7 -0
- package/dist/esm/components/credits/modal/creditsUploadReceiptModal.d.ts +24 -0
- package/dist/esm/components/credits/modal/creditsUploadReceiptModal.js +2 -0
- package/dist/esm/components/credits/modal/creditsUploadReceiptModal.js.map +7 -0
- package/dist/esm/components/credits/modal/loadingDots.d.ts +6 -0
- package/dist/esm/components/credits/modal/loadingDots.js +2 -0
- package/dist/esm/components/credits/modal/loadingDots.js.map +7 -0
- package/dist/esm/components/credits/modal/modalContainer.d.ts +15 -0
- package/dist/esm/components/credits/modal/modalContainer.js +2 -0
- package/dist/esm/components/credits/modal/modalContainer.js.map +7 -0
- package/dist/esm/components/credits/modal/rulesModal.d.ts +7 -0
- package/dist/esm/components/credits/modal/rulesModal.js +2 -0
- package/dist/esm/components/credits/modal/rulesModal.js.map +7 -0
- package/dist/esm/components/credits/modal/tip.d.ts +5 -0
- package/dist/esm/components/credits/modal/tip.js +2 -0
- package/dist/esm/components/credits/modal/tip.js.map +7 -0
- package/dist/esm/components/credits/type.d.ts +55 -0
- package/dist/esm/components/credits/type.js +1 -0
- package/dist/esm/components/credits/type.js.map +7 -0
- package/dist/esm/components/index.d.ts +3 -2
- package/dist/esm/components/index.js +1 -1
- package/dist/esm/components/index.js.map +2 -2
- package/dist/esm/components/registration/authCodeActivate/Message.d.ts +4 -0
- package/dist/esm/components/registration/authCodeActivate/Message.js +2 -0
- package/dist/esm/components/registration/authCodeActivate/Message.js.map +7 -0
- package/dist/esm/components/registration/authCodeActivate/index.d.ts +3 -0
- package/dist/esm/components/registration/authCodeActivate/index.js +2 -0
- package/dist/esm/components/registration/authCodeActivate/index.js.map +7 -0
- package/dist/esm/components/registration/authCodeActivate/type.d.ts +23 -0
- package/dist/esm/components/registration/authCodeActivate/type.js +1 -0
- package/dist/esm/components/registration/authCodeActivate/type.js.map +7 -0
- package/dist/esm/components/registration/index.d.ts +1 -0
- package/dist/esm/components/registration/index.js +2 -0
- package/dist/esm/components/registration/index.js.map +7 -0
- package/dist/esm/components/registration/modalContainer.d.ts +15 -0
- package/dist/esm/components/registration/modalContainer.js +2 -0
- package/dist/esm/components/registration/modalContainer.js.map +7 -0
- package/dist/esm/debug-env.d.ts +7 -0
- package/dist/esm/debug-env.js +2 -0
- package/dist/esm/debug-env.js.map +7 -0
- package/dist/esm/helpers/fetcher.js +1 -1
- package/dist/esm/helpers/fetcher.js.map +2 -2
- package/dist/esm/helpers/index.d.ts +2 -2
- package/dist/esm/helpers/index.js +1 -1
- package/dist/esm/helpers/index.js.map +2 -2
- package/dist/esm/helpers/track.d.ts +19 -0
- package/dist/esm/helpers/track.js +2 -0
- package/dist/esm/helpers/track.js.map +7 -0
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/stories/chat.stories.d.ts +1 -1
- package/dist/esm/stories/chat.stories.js +1 -1
- package/dist/esm/stories/chat.stories.js.map +2 -2
- package/package.json +46 -33
- package/src/components/chat/button.tsx +1 -1
- package/src/components/chat/index.tsx +6 -6
- package/src/components/chat/messages.tsx +2 -2
- package/src/components/chat/response.tsx +1 -4
- package/src/components/chat/suggestions.tsx +1 -1
- package/src/components/credits/context/const.ts +104 -0
- package/src/components/credits/context/hooks/useActivities.ts +70 -0
- package/src/components/credits/context/hooks/useAddressValidate.ts +281 -0
- package/src/components/credits/context/hooks/useAlpcFetch.ts +295 -0
- package/src/components/credits/context/hooks/useClickOutside.ts +34 -0
- package/src/components/credits/context/hooks/useCopy.ts +35 -0
- package/src/components/credits/context/hooks/useCountries.ts +55 -0
- package/src/components/credits/context/hooks/useFirstPurchaseFinished.ts +24 -0
- package/src/components/credits/context/hooks/useMyRewards.ts +97 -0
- package/src/components/credits/context/hooks/useReceiptUploaded.ts +24 -0
- package/src/components/credits/context/hooks/useRedeemAndBuy.ts +59 -0
- package/src/components/credits/context/hooks/useRedeemCoupon.ts +34 -0
- package/src/components/credits/context/hooks/useRedeemProduct.ts +34 -0
- package/src/components/credits/context/hooks/useRedeemableList.ts +77 -0
- package/src/components/credits/context/hooks/useSendEmailValidation.ts +20 -0
- package/src/components/credits/context/hooks/useSubscribed.ts +37 -0
- package/src/components/credits/context/hooks/useSubscriptions.ts +29 -0
- package/src/components/credits/context/hooks/useUploadReceipt.tsx +29 -0
- package/src/components/credits/context/provider.tsx +86 -0
- package/src/components/credits/context/response.ts +72 -0
- package/src/components/credits/context/utils.ts +149 -0
- package/src/components/credits/creditsBanner/index.tsx +105 -0
- package/src/components/credits/creditsBenefits/benefitItem.tsx +73 -0
- package/src/components/credits/creditsBenefits/iconInfo.tsx +23 -0
- package/src/components/credits/creditsBenefits/index.tsx +117 -0
- package/src/components/credits/creditsCash/RedeemableItem.tsx +211 -0
- package/src/components/credits/creditsCash/index.tsx +100 -0
- package/src/components/credits/creditsCash/type.ts +46 -0
- package/src/components/credits/creditsFaq/faqItem/FaqItem.tsx +95 -0
- package/src/components/credits/creditsFaq/index.tsx +86 -0
- package/src/components/credits/creditsInfoCard/index.tsx +177 -0
- package/src/components/credits/creditsRedeemList/AddressForm/CountrySelect.tsx +111 -0
- package/src/components/credits/creditsRedeemList/AddressForm/FormItem.tsx +23 -0
- package/src/components/credits/creditsRedeemList/AddressForm/Input.tsx +58 -0
- package/src/components/credits/creditsRedeemList/AddressForm/StateSelect.tsx +126 -0
- package/src/components/credits/creditsRedeemList/AddressForm/index.tsx +155 -0
- package/src/components/credits/creditsRedeemList/AddressForm/type.ts +24 -0
- package/src/components/credits/creditsRedeemList/NonProductValue.tsx +38 -0
- package/src/components/credits/creditsRedeemList/RedeemCouponModal.tsx +211 -0
- package/src/components/credits/creditsRedeemList/RedeemProductModal/Address.tsx +72 -0
- package/src/components/credits/creditsRedeemList/RedeemProductModal/Error.tsx +14 -0
- package/src/components/credits/creditsRedeemList/RedeemProductModal/Init.tsx +121 -0
- package/src/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.tsx +23 -0
- package/src/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.tsx +72 -0
- package/src/components/credits/creditsRedeemList/RedeemProductModal/Success.tsx +45 -0
- package/src/components/credits/creditsRedeemList/RedeemProductModal/index.tsx +195 -0
- package/src/components/credits/creditsRedeemList/RedeemableItem.tsx +178 -0
- package/src/components/credits/creditsRedeemList/index.tsx +189 -0
- package/src/components/credits/creditsRedeemList/type.ts +78 -0
- package/src/components/credits/creditsWaysToGetCredits/index.tsx +188 -0
- package/src/components/credits/creditsWaysToGetCredits/type.ts +63 -0
- package/src/components/credits/creditsWaysToGetCredits/useActions.ts +217 -0
- package/src/components/credits/index.ts +11 -0
- package/src/components/credits/modal/MyRewardsModal.tsx +321 -0
- package/src/components/credits/modal/activitiesModal.tsx +258 -0
- package/src/components/credits/modal/creditsUploadReceiptModal.tsx +141 -0
- package/src/components/credits/modal/loadingDots.tsx +19 -0
- package/src/components/credits/modal/modalContainer.tsx +112 -0
- package/src/components/credits/modal/rulesModal.tsx +44 -0
- package/src/components/credits/modal/tip.tsx +92 -0
- package/src/components/credits/type.ts +60 -0
- package/src/components/index.ts +4 -2
- package/src/debug-env.ts +18 -0
- package/src/helpers/fetcher.ts +1 -1
- package/src/helpers/index.ts +2 -2
- package/src/helpers/track.ts +73 -0
- package/src/index.ts +1 -1
- package/src/stories/chat.stories.tsx +1 -1
- package/{dist/esm/styles/chat.css → src/styles/global.css} +1 -0
- package/style.css +1 -0
- package/tailwind.config.ts +82 -0
- package/dist/cjs/components/animation/CodeEditor.d.ts +0 -7
- package/dist/cjs/components/animation/CodeEditor.js +0 -2
- package/dist/cjs/components/animation/CodeEditor.js.map +0 -7
- package/dist/cjs/components/animation/Preview.d.ts +0 -5
- package/dist/cjs/components/animation/Preview.js +0 -2
- package/dist/cjs/components/animation/Preview.js.map +0 -7
- package/dist/cjs/components/animation/bannerAni.d.ts +0 -16
- package/dist/cjs/components/animation/bannerAni.js +0 -59
- package/dist/cjs/components/animation/bannerAni.js.map +0 -7
- package/dist/cjs/components/animation/libs.d.js +0 -2
- package/dist/cjs/components/animation/textAni.d.ts +0 -9
- package/dist/cjs/components/animation/textAni.js +0 -2
- package/dist/cjs/components/animation/textAni.js.map +0 -7
- package/dist/cjs/components/chat/message.d.ts +0 -2
- package/dist/cjs/components/chat/response copy.d.ts +0 -2
- package/dist/cjs/components/chat/rresponse.d.ts +0 -2
- package/dist/cjs/components/theme.d.ts +0 -13
- package/dist/cjs/helpers/component-props.d.ts +0 -7
- package/dist/cjs/helpers/component-props.js +0 -2
- package/dist/cjs/helpers/component-props.js.map +0 -7
- package/dist/cjs/helpers/constants.d.ts +0 -2
- package/dist/cjs/helpers/constants.js +0 -2
- package/dist/cjs/helpers/constants.js.map +0 -7
- package/dist/cjs/tsconfig.tsbuildinfo +0 -1
- package/dist/esm/components/animation/CodeEditor.d.ts +0 -7
- package/dist/esm/components/animation/CodeEditor.js +0 -2
- package/dist/esm/components/animation/CodeEditor.js.map +0 -7
- package/dist/esm/components/animation/Preview.d.ts +0 -5
- package/dist/esm/components/animation/Preview.js +0 -2
- package/dist/esm/components/animation/Preview.js.map +0 -7
- package/dist/esm/components/animation/bannerAni.d.ts +0 -16
- package/dist/esm/components/animation/bannerAni.js +0 -59
- package/dist/esm/components/animation/bannerAni.js.map +0 -7
- package/dist/esm/components/animation/libs.d.js +0 -2
- package/dist/esm/components/animation/libs.d.js.map +0 -7
- package/dist/esm/components/animation/textAni.d.ts +0 -9
- package/dist/esm/components/animation/textAni.js +0 -2
- package/dist/esm/components/animation/textAni.js.map +0 -7
- package/dist/esm/components/chat/Markdown.d.ts +0 -5
- package/dist/esm/components/chat/marksdown.d.ts +0 -5
- package/dist/esm/components/chat/message.d.ts +0 -2
- package/dist/esm/components/chat/response copy.d.ts +0 -2
- package/dist/esm/components/chat/rresponse.d.ts +0 -2
- package/dist/esm/components/theme.d.ts +0 -13
- package/dist/esm/helpers/component-props.d.ts +0 -7
- package/dist/esm/helpers/component-props.js +0 -1
- package/dist/esm/helpers/constants.d.ts +0 -2
- package/dist/esm/helpers/constants.js +0 -2
- package/dist/esm/helpers/constants.js.map +0 -7
- package/dist/esm/styles/css/animations.css +0 -35
- package/dist/esm/styles/css/button.css +0 -56
- package/dist/esm/styles/css/colors.css +0 -12
- package/dist/esm/styles/css/console.css +0 -134
- package/dist/esm/styles/css/header.css +0 -43
- package/dist/esm/styles/css/input.css +0 -89
- package/dist/esm/styles/css/markdown.css +0 -131
- package/dist/esm/styles/css/messages.css +0 -73
- package/dist/esm/styles/css/panel.css +0 -23
- package/dist/esm/styles/css/popup.css +0 -44
- package/dist/esm/styles/css/response.css +0 -26
- package/dist/esm/styles/css/sidebar.css +0 -31
- package/dist/esm/styles/css/suggestions.css +0 -35
- package/dist/esm/styles/css/window.css +0 -60
- package/dist/esm/styles/index.css +0 -1
- package/dist/esm/tsconfig.tsbuildinfo +0 -1
- /package/dist/cjs/components/chat/{Markdown.d.ts → markdown.d.ts} +0 -0
- /package/dist/cjs/components/chat/{Response.d.ts → response.d.ts} +0 -0
- /package/dist/{cjs/components/chat/marksdown.d.ts → esm/components/chat/markdown.d.ts} +0 -0
- /package/dist/esm/components/chat/{Response.d.ts → response.d.ts} +0 -0
- /package/dist/{cjs/components/animation/libs.d.js.map → esm/components/credits/context/response.js.map} +0 -0
- /package/dist/esm/{helpers/component-props.js.map → components/credits/creditsCash/type.js.map} +0 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SWRMutationConfiguration } from 'swr/mutation';
|
|
2
|
+
import type { ProductVariant } from '@anker-in/lib';
|
|
3
|
+
export declare const useRedeemAndBuy: (_: any, swrOptions?: SWRMutationConfiguration<undefined, Error, string, any> & {
|
|
4
|
+
throwOnError?: boolean;
|
|
5
|
+
}) => import("swr/mutation").SWRMutationResponse<undefined, Error, "redeemAndBuy", {
|
|
6
|
+
productVariant: ProductVariant;
|
|
7
|
+
quantity?: number;
|
|
8
|
+
redeemId: number;
|
|
9
|
+
}>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import u from"swr/mutation";import{useRedeemCoupon as a}from"./useRedeemCoupon";import{useCreditsContext as d}from"../provider";import{useBuyNow as s}from"@anker-in/lib";const _=(m,e)=>{const{trigger:t}=a(),{profile:n}=d(),{trigger:i}=s({},{throwOnError:!0});return u("redeemAndBuy",async(c,{arg:o})=>{const r=await t({user_id:n?.user_id,rule_id:o.redeemId});if(console.log("res",r),r&&r?.data?.coupon_code)i({discountCodes:[r.data.coupon_code],lineItems:[{variant:o.productVariant,quantity:o.quantity||1}]});else throw new Error(`Redeem failed: ${r?.msg}`)},e)};export{_ as useRedeemAndBuy};
|
|
2
|
+
//# sourceMappingURL=useRedeemAndBuy.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/components/credits/context/hooks/useRedeemAndBuy.ts"],
|
|
4
|
+
"sourcesContent": ["import useSWRMutation, { SWRMutationConfiguration } from 'swr/mutation'\nimport { useRedeemCoupon } from './useRedeemCoupon'\nimport type { ProductVariant } from '@anker-in/lib'\nimport { useCreditsContext } from '../provider'\nimport { useBuyNow } from '@anker-in/lib'\nimport { AlpcErrorCode } from '../const'\n\nexport const useRedeemAndBuy = (\n _: any,\n swrOptions?: SWRMutationConfiguration<undefined, Error, string, any> & {\n throwOnError?: boolean\n }\n) => {\n const { trigger } = useRedeemCoupon()\n const { profile } = useCreditsContext()\n\n const { trigger: buyNow } = useBuyNow(\n {},\n {\n throwOnError: true,\n }\n )\n\n return useSWRMutation(\n 'redeemAndBuy',\n async (\n _,\n {\n arg,\n }: {\n arg: {\n productVariant: ProductVariant\n quantity?: number\n redeemId: number\n }\n }\n ) => {\n const res = await trigger({\n user_id: profile?.user_id,\n rule_id: arg.redeemId,\n })\n console.log('res', res)\n if (res && res?.data?.coupon_code) {\n buyNow({\n discountCodes: [res.data.coupon_code],\n lineItems: [\n {\n variant: arg.productVariant,\n quantity: arg.quantity || 1,\n },\n ],\n })\n } else {\n throw new Error(`Redeem failed: ${res?.msg}`)\n }\n },\n swrOptions\n )\n}\n"],
|
|
5
|
+
"mappings": "AAAA,OAAOA,MAAkD,eACzD,OAAS,mBAAAC,MAAuB,oBAEhC,OAAS,qBAAAC,MAAyB,cAClC,OAAS,aAAAC,MAAiB,gBAGnB,MAAMC,EAAkB,CAC7BC,EACAC,IAGG,CACH,KAAM,CAAE,QAAAC,CAAQ,EAAIN,EAAgB,EAC9B,CAAE,QAAAO,CAAQ,EAAIN,EAAkB,EAEhC,CAAE,QAASO,CAAO,EAAIN,EAC1B,CAAC,EACD,CACE,aAAc,EAChB,CACF,EAEA,OAAOH,EACL,eACA,MACEK,EACA,CACE,IAAAK,CACF,IAOG,CACH,MAAMC,EAAM,MAAMJ,EAAQ,CACxB,QAASC,GAAS,QAClB,QAASE,EAAI,QACf,CAAC,EAED,GADA,QAAQ,IAAI,MAAOC,CAAG,EAClBA,GAAOA,GAAK,MAAM,YACpBF,EAAO,CACL,cAAe,CAACE,EAAI,KAAK,WAAW,EACpC,UAAW,CACT,CACE,QAASD,EAAI,eACb,SAAUA,EAAI,UAAY,CAC5B,CACF,CACF,CAAC,MAED,OAAM,IAAI,MAAM,kBAAkBC,GAAK,GAAG,EAAE,CAEhD,EACAL,CACF,CACF",
|
|
6
|
+
"names": ["useSWRMutation", "useRedeemCoupon", "useCreditsContext", "useBuyNow", "useRedeemAndBuy", "_", "swrOptions", "trigger", "profile", "buyNow", "arg", "res"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type UseMutationConfig } from './useAlpcFetch';
|
|
2
|
+
type RedeemCouponResponse = {
|
|
3
|
+
data: {
|
|
4
|
+
success: boolean;
|
|
5
|
+
coupon_code: string;
|
|
6
|
+
};
|
|
7
|
+
msg: string;
|
|
8
|
+
code: number;
|
|
9
|
+
};
|
|
10
|
+
export declare const useRedeemCoupon: (mutationOptions?: UseMutationConfig<RedeemCouponResponse>) => {
|
|
11
|
+
isMutating: boolean;
|
|
12
|
+
trigger: (fetchData: {
|
|
13
|
+
user_id?: string;
|
|
14
|
+
rule_id: number;
|
|
15
|
+
}, opts?: UseMutationConfig<RedeemCouponResponse>) => Promise<RedeemCouponResponse | undefined>;
|
|
16
|
+
data: RedeemCouponResponse | undefined;
|
|
17
|
+
};
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{ALPC_COUNTRY_MAP as s}from"../const";import{useAlpcMutation as r}from"./useAlpcFetch";import{useHeadlessContext as p}from"@anker-in/lib";const a=(o={})=>{const{locale:e,appName:n,brand:t}=p();return r({url:"/v1/credit/redeem/coupon",initData:{brand:t,country:s.get(e)||e,app_name:n}},o)};export{a as useRedeemCoupon};
|
|
2
|
+
//# sourceMappingURL=useRedeemCoupon.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/components/credits/context/hooks/useRedeemCoupon.ts"],
|
|
4
|
+
"sourcesContent": ["import { ALPC_COUNTRY_MAP } from '../const'\nimport { useAlpcMutation, type UseMutationConfig } from './useAlpcFetch'\nimport { useHeadlessContext } from '@anker-in/lib'\n\ntype RedeemCouponResponse = {\n data: {\n success: boolean\n coupon_code: string\n }\n msg: string // \u62A5\u9519\u4FE1\u606F\n code: number // \u62A5\u9519\u7801\n}\n\nexport const useRedeemCoupon = (mutationOptions: UseMutationConfig<RedeemCouponResponse> = {}) => {\n const { locale, appName, brand } = useHeadlessContext()\n\n return useAlpcMutation<\n RedeemCouponResponse,\n {\n user_id?: string\n rule_id: number\n }\n >(\n {\n url: `/v1/credit/redeem/coupon`,\n initData: {\n brand,\n country: ALPC_COUNTRY_MAP.get(locale) || locale,\n app_name: appName,\n },\n },\n mutationOptions\n )\n}\n"],
|
|
5
|
+
"mappings": "AAAA,OAAS,oBAAAA,MAAwB,WACjC,OAAS,mBAAAC,MAA+C,iBACxD,OAAS,sBAAAC,MAA0B,gBAW5B,MAAMC,EAAkB,CAACC,EAA2D,CAAC,IAAM,CAChG,KAAM,CAAE,OAAAC,EAAQ,QAAAC,EAAS,MAAAC,CAAM,EAAIL,EAAmB,EAEtD,OAAOD,EAOL,CACE,IAAK,2BACL,SAAU,CACR,MAAAM,EACA,QAASP,EAAiB,IAAIK,CAAM,GAAKA,EACzC,SAAUC,CACZ,CACF,EACAF,CACF,CACF",
|
|
6
|
+
"names": ["ALPC_COUNTRY_MAP", "useAlpcMutation", "useHeadlessContext", "useRedeemCoupon", "mutationOptions", "locale", "appName", "brand"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type UseMutationConfig } from './useAlpcFetch';
|
|
2
|
+
type RedeemProductResponse = {
|
|
3
|
+
code: number;
|
|
4
|
+
data: {
|
|
5
|
+
success: boolean;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
export declare const useRedeemProduct: (mutationOptions?: UseMutationConfig<RedeemProductResponse>) => {
|
|
9
|
+
isMutating: boolean;
|
|
10
|
+
trigger: (fetchData: {
|
|
11
|
+
rule_id: number;
|
|
12
|
+
address: string;
|
|
13
|
+
}, opts?: UseMutationConfig<RedeemProductResponse>) => Promise<RedeemProductResponse | undefined>;
|
|
14
|
+
data: RedeemProductResponse | undefined;
|
|
15
|
+
};
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{ALPC_COUNTRY_MAP as s}from"../const";import{useAlpcMutation as a}from"./useAlpcFetch";import{useHeadlessContext as d}from"@anker-in/lib";const p=(o={})=>{const{storeDomain:t,locale:e,appName:n,brand:r}=d();return a({url:"/v1/credit/exchange/goods",initData:{quantity:1,brand:r,country:(s.get(e||"")||e)?.toUpperCase(),domain:t,app_name:n}},o)};export{p as useRedeemProduct};
|
|
2
|
+
//# sourceMappingURL=useRedeemProduct.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/components/credits/context/hooks/useRedeemProduct.ts"],
|
|
4
|
+
"sourcesContent": ["import { ALPC_COUNTRY_MAP } from '../const'\nimport { useAlpcMutation, type UseMutationConfig } from './useAlpcFetch'\nimport { useHeadlessContext } from '@anker-in/lib'\n\ntype RedeemProductResponse = {\n code: number\n data: {\n success: boolean\n }\n}\n\nexport const useRedeemProduct = (mutationOptions: UseMutationConfig<RedeemProductResponse> = {}) => {\n const { storeDomain, locale, appName, brand } = useHeadlessContext()\n\n return useAlpcMutation<\n RedeemProductResponse,\n {\n rule_id: number\n address: string\n }\n >(\n {\n url: `/v1/credit/exchange/goods`,\n initData: {\n quantity: 1,\n brand,\n country: (ALPC_COUNTRY_MAP.get(locale || '') || locale)?.toUpperCase(),\n domain: storeDomain,\n app_name: appName,\n },\n },\n mutationOptions\n )\n}\n"],
|
|
5
|
+
"mappings": "AAAA,OAAS,oBAAAA,MAAwB,WACjC,OAAS,mBAAAC,MAA+C,iBACxD,OAAS,sBAAAC,MAA0B,gBAS5B,MAAMC,EAAmB,CAACC,EAA4D,CAAC,IAAM,CAClG,KAAM,CAAE,YAAAC,EAAa,OAAAC,EAAQ,QAAAC,EAAS,MAAAC,CAAM,EAAIN,EAAmB,EAEnE,OAAOD,EAOL,CACE,IAAK,4BACL,SAAU,CACR,SAAU,EACV,MAAAO,EACA,SAAUR,EAAiB,IAAIM,GAAU,EAAE,GAAKA,IAAS,YAAY,EACrE,OAAQD,EACR,SAAUE,CACZ,CACF,EACAH,CACF,CACF",
|
|
6
|
+
"names": ["ALPC_COUNTRY_MAP", "useAlpcMutation", "useHeadlessContext", "useRedeemProduct", "mutationOptions", "storeDomain", "locale", "appName", "brand"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{useCallback as C,useEffect as L,useState as R}from"react";import{useAlpcMutation as b}from"./useAlpcFetch";import{ALPC_COUNTRY_MAP as x}from"../const";import{useCreditsContext as y}from"../provider";import{useHeadlessContext as S}from"@anker-in/lib";function A(){let t="";const{profile:n,isLoadingProfile:c}=y(),{locale:u,brand:d}=S();u==="pl"?t="eu":t=u;const[p,_]=R([]),{isMutating:f,trigger:l}=b({url:"/v1/credit/consume_credit_rules",initData:{brand:d,page:1,page_size:20,country:(x.get(t)||t)?.toUpperCase(),task_target:1}}),s=C(()=>{l({user_id:n?.user_id},{onSuccess(g){let a=g.data.consume_credit_rules||[],o=a.filter(e=>e.consume_type==1)||[],r=a.filter(e=>e.consume_type==2)||[];o=o.sort((e,i)=>e.consume_credits-i.consume_credits),r=r.sort((e,i)=>e.consume_credits-i.consume_credits);const m=o.concat(r);_(m),localStorage?.setItem(`consume_credit_rules-${t}`,JSON.stringify({expire:Date.now()+10*60*1e3,consume_credit_rules:m}))}})},[n,l,t]);return L(()=>{c||s()},[s,c]),{listLoading:f,redeemableList:p,getRedeemableList:s}}var O=A;export{O as default};
|
|
2
|
+
//# sourceMappingURL=useRedeemableList.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/components/credits/context/hooks/useRedeemableList.ts"],
|
|
4
|
+
"sourcesContent": ["import { useCallback, useEffect, useState } from 'react'\n\nimport { useAlpcMutation } from './useAlpcFetch'\nimport { ALPC_COUNTRY_MAP } from '../const'\nimport { useCreditsContext } from '../provider'\nimport type { ConsumeCreditRuleResponse } from '../response'\nimport { useHeadlessContext } from '@anker-in/lib'\n\nfunction useRedeemableList() {\n let locale = '' as string\n const { profile, isLoadingProfile } = useCreditsContext()\n const { locale: contextLocale, brand } = useHeadlessContext()\n\n if (contextLocale === 'pl') {\n locale = 'eu'\n } else {\n locale = contextLocale\n }\n\n const [redeemableList, setRedeemableList] = useState<ConsumeCreditRuleResponse[]>([])\n const { isMutating: listLoading, trigger } = useAlpcMutation<\n {\n data: { consume_credit_rules: ConsumeCreditRuleResponse[] }\n },\n { user_id?: string }\n >({\n url: `/v1/credit/consume_credit_rules`,\n initData: {\n brand,\n page: 1,\n page_size: 20,\n country: (ALPC_COUNTRY_MAP.get(locale) || locale)?.toUpperCase(),\n task_target: 1, // 1: 'app', 2: 'website'\n },\n })\n\n const getRedeemableList = useCallback(() => {\n trigger(\n {\n user_id: profile?.user_id,\n },\n {\n onSuccess(responseData) {\n let list = responseData.data.consume_credit_rules || []\n let cList = list.filter(i => i.consume_type == 1) || []\n let pList = list.filter(i => i.consume_type == 2) || []\n cList = cList.sort((prev, next) => prev.consume_credits - next.consume_credits)\n pList = pList.sort((prev, next) => prev.consume_credits - next.consume_credits)\n const resultList = cList.concat(pList)\n setRedeemableList(resultList)\n\n localStorage?.setItem(\n `consume_credit_rules-${locale}`,\n JSON.stringify({\n expire: Date.now() + 10 * 60 * 1000,\n consume_credit_rules: resultList,\n })\n )\n },\n }\n )\n }, [profile, trigger, locale])\n\n useEffect(() => {\n if (!isLoadingProfile) {\n getRedeemableList()\n }\n }, [getRedeemableList, isLoadingProfile])\n\n return {\n listLoading,\n redeemableList,\n getRedeemableList,\n }\n}\n\nexport default useRedeemableList\n"],
|
|
5
|
+
"mappings": "AAAA,OAAS,eAAAA,EAAa,aAAAC,EAAW,YAAAC,MAAgB,QAEjD,OAAS,mBAAAC,MAAuB,iBAChC,OAAS,oBAAAC,MAAwB,WACjC,OAAS,qBAAAC,MAAyB,cAElC,OAAS,sBAAAC,MAA0B,gBAEnC,SAASC,GAAoB,CAC3B,IAAIC,EAAS,GACb,KAAM,CAAE,QAAAC,EAAS,iBAAAC,CAAiB,EAAIL,EAAkB,EAClD,CAAE,OAAQM,EAAe,MAAAC,CAAM,EAAIN,EAAmB,EAExDK,IAAkB,KACpBH,EAAS,KAETA,EAASG,EAGX,KAAM,CAACE,EAAgBC,CAAiB,EAAIZ,EAAsC,CAAC,CAAC,EAC9E,CAAE,WAAYa,EAAa,QAAAC,CAAQ,EAAIb,EAK3C,CACA,IAAK,kCACL,SAAU,CACR,MAAAS,EACA,KAAM,EACN,UAAW,GACX,SAAUR,EAAiB,IAAII,CAAM,GAAKA,IAAS,YAAY,EAC/D,YAAa,CACf,CACF,CAAC,EAEKS,EAAoBjB,EAAY,IAAM,CAC1CgB,EACE,CACE,QAASP,GAAS,OACpB,EACA,CACE,UAAUS,EAAc,CACtB,IAAIC,EAAOD,EAAa,KAAK,sBAAwB,CAAC,EAClDE,EAAQD,EAAK,OAAOE,GAAKA,EAAE,cAAgB,CAAC,GAAK,CAAC,EAClDC,EAAQH,EAAK,OAAOE,GAAKA,EAAE,cAAgB,CAAC,GAAK,CAAC,EACtDD,EAAQA,EAAM,KAAK,CAACG,EAAMC,IAASD,EAAK,gBAAkBC,EAAK,eAAe,EAC9EF,EAAQA,EAAM,KAAK,CAACC,EAAMC,IAASD,EAAK,gBAAkBC,EAAK,eAAe,EAC9E,MAAMC,EAAaL,EAAM,OAAOE,CAAK,EACrCR,EAAkBW,CAAU,EAE5B,cAAc,QACZ,wBAAwBjB,CAAM,GAC9B,KAAK,UAAU,CACb,OAAQ,KAAK,IAAI,EAAI,GAAK,GAAK,IAC/B,qBAAsBiB,CACxB,CAAC,CACH,CACF,CACF,CACF,CACF,EAAG,CAAChB,EAASO,EAASR,CAAM,CAAC,EAE7B,OAAAP,EAAU,IAAM,CACTS,GACHO,EAAkB,CAEtB,EAAG,CAACA,EAAmBP,CAAgB,CAAC,EAEjC,CACL,YAAAK,EACA,eAAAF,EACA,kBAAAI,CACF,CACF,CAEA,IAAOS,EAAQnB",
|
|
6
|
+
"names": ["useCallback", "useEffect", "useState", "useAlpcMutation", "ALPC_COUNTRY_MAP", "useCreditsContext", "useHeadlessContext", "useRedeemableList", "locale", "profile", "isLoadingProfile", "contextLocale", "brand", "redeemableList", "setRedeemableList", "listLoading", "trigger", "getRedeemableList", "responseData", "list", "cList", "i", "pList", "prev", "next", "resultList", "useRedeemableList_default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useSendEmailValidation(): import("swr/mutation").SWRMutationResponse<any, any, "send-email-validation", never>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import a from"../../../../helpers/fetcher";import i from"swr/mutation";import{useCreditsContext as n}from"../provider";import{useHeadlessContext as r}from"@anker-in/lib";function u(){const{profile:e}=n(),{appName:t,locale:o}=r();return i("send-email-validation",()=>a({locale:o,url:"/api/multipass/account/users/send_validation_email",method:"POST",body:{email:e?.email,app:t},needRecaptcha:!0,action:"verifyAccount"}))}export{u as useSendEmailValidation};
|
|
2
|
+
//# sourceMappingURL=useSendEmailValidation.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/components/credits/context/hooks/useSendEmailValidation.ts"],
|
|
4
|
+
"sourcesContent": ["import fetcher from '../../../../helpers/fetcher'\nimport useSWRMutation from 'swr/mutation'\nimport { useCreditsContext } from '../provider'\nimport { useHeadlessContext } from '@anker-in/lib'\n\nexport function useSendEmailValidation() {\n const { profile } = useCreditsContext()\n const { appName, locale } = useHeadlessContext()\n\n return useSWRMutation('send-email-validation', () =>\n fetcher({\n locale,\n url: '/api/multipass/account/users/send_validation_email',\n method: 'POST',\n body: { email: profile?.email, app: appName },\n needRecaptcha: true,\n action: 'verifyAccount',\n })\n )\n}\n"],
|
|
5
|
+
"mappings": "AAAA,OAAOA,MAAa,8BACpB,OAAOC,MAAoB,eAC3B,OAAS,qBAAAC,MAAyB,cAClC,OAAS,sBAAAC,MAA0B,gBAE5B,SAASC,GAAyB,CACvC,KAAM,CAAE,QAAAC,CAAQ,EAAIH,EAAkB,EAChC,CAAE,QAAAI,EAAS,OAAAC,CAAO,EAAIJ,EAAmB,EAE/C,OAAOF,EAAe,wBAAyB,IAC7CD,EAAQ,CACN,OAAAO,EACA,IAAK,qDACL,OAAQ,OACR,KAAM,CAAE,MAAOF,GAAS,MAAO,IAAKC,CAAQ,EAC5C,cAAe,GACf,OAAQ,eACV,CAAC,CACH,CACF",
|
|
6
|
+
"names": ["fetcher", "useSWRMutation", "useCreditsContext", "useHeadlessContext", "useSendEmailValidation", "profile", "appName", "locale"]
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useSubscribed: () => boolean;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{useMemo as t}from"react";import{TaskSubType as n}from"../const";import c from"./useActivities";import{useSubscriptions as b}from"./useSubscriptions";import{useCreditsContext as p}from"../provider";import{useHeadlessContext as m}from"@anker-in/lib";const g=()=>{const{profile:i}=p(),{brand:o}=m(),u=t(()=>({page:1,pageSize:50}),[]),{activities:s}=c(u),{data:r}=b({email:i?.email});return t(()=>r?.preference?r.preference.some(e=>e.brand===o&&e.subscribe)?!0:s?.some(e=>e.task_sub_type===n.Subscription):!1,[r?.preference,s])};export{g as useSubscribed};
|
|
2
|
+
//# sourceMappingURL=useSubscribed.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/components/credits/context/hooks/useSubscribed.ts"],
|
|
4
|
+
"sourcesContent": ["import { useMemo } from 'react'\n\nimport { TaskSubType } from '../const'\nimport useActivities from './useActivities'\nimport { useSubscriptions } from './useSubscriptions'\nimport { useCreditsContext } from '../provider'\nimport { useHeadlessContext } from '@anker-in/lib'\n\nexport const useSubscribed = () => {\n const { profile } = useCreditsContext()\n const { brand } = useHeadlessContext()\n\n const activitiesOptions = useMemo(() => ({ page: 1, pageSize: 50 }), [])\n\n const { activities } = useActivities(activitiesOptions)\n const { data: subscription } = useSubscriptions({ email: profile?.email })\n\n const isSubscribed = useMemo(() => {\n if (!subscription?.preference) {\n return false\n }\n\n const subscribeResult = subscription.preference.some(item => {\n return item.brand === brand && item.subscribe\n })\n\n if (subscribeResult) {\n return true\n }\n\n return activities?.some(item => {\n return item.task_sub_type === TaskSubType.Subscription\n })\n }, [subscription?.preference, activities])\n\n return isSubscribed\n}\n"],
|
|
5
|
+
"mappings": "AAAA,OAAS,WAAAA,MAAe,QAExB,OAAS,eAAAC,MAAmB,WAC5B,OAAOC,MAAmB,kBAC1B,OAAS,oBAAAC,MAAwB,qBACjC,OAAS,qBAAAC,MAAyB,cAClC,OAAS,sBAAAC,MAA0B,gBAE5B,MAAMC,EAAgB,IAAM,CACjC,KAAM,CAAE,QAAAC,CAAQ,EAAIH,EAAkB,EAChC,CAAE,MAAAI,CAAM,EAAIH,EAAmB,EAE/BI,EAAoBT,EAAQ,KAAO,CAAE,KAAM,EAAG,SAAU,EAAG,GAAI,CAAC,CAAC,EAEjE,CAAE,WAAAU,CAAW,EAAIR,EAAcO,CAAiB,EAChD,CAAE,KAAME,CAAa,EAAIR,EAAiB,CAAE,MAAOI,GAAS,KAAM,CAAC,EAoBzE,OAlBqBP,EAAQ,IACtBW,GAAc,WAIKA,EAAa,WAAW,KAAKC,GAC5CA,EAAK,QAAUJ,GAASI,EAAK,SACrC,EAGQ,GAGFF,GAAY,KAAKE,GACfA,EAAK,gBAAkBX,EAAY,YAC3C,EAbQ,GAcR,CAACU,GAAc,WAAYD,CAAU,CAAC,CAG3C",
|
|
6
|
+
"names": ["useMemo", "TaskSubType", "useActivities", "useSubscriptions", "useCreditsContext", "useHeadlessContext", "useSubscribed", "profile", "brand", "activitiesOptions", "activities", "subscription", "item"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SWRResponse } from 'swr';
|
|
2
|
+
import type { Subscription } from '../../type';
|
|
3
|
+
export type SubscriptionApiResponse = {
|
|
4
|
+
data: Subscription;
|
|
5
|
+
};
|
|
6
|
+
export type FetchSubscriptionResponse = SWRResponse<Subscription>;
|
|
7
|
+
export declare function useSubscriptions({ email }: {
|
|
8
|
+
email?: string;
|
|
9
|
+
}): FetchSubscriptionResponse;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import n from"swr";import r from"../../../../helpers/fetcher";import{useHeadlessContext as c}from"@anker-in/lib";function m({email:s}){const{locale:t}=c(),{data:e,...o}=n(s?["/api/multipass/account/subscriptions",s]:null,async([p,i])=>r({method:"GET",url:p,body:{email:i},action:"login",locale:t,headers:{},type:""}));return{data:e?.data,...o}}export{m as useSubscriptions};
|
|
2
|
+
//# sourceMappingURL=useSubscriptions.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/components/credits/context/hooks/useSubscriptions.ts"],
|
|
4
|
+
"sourcesContent": ["import useSWR, { SWRResponse } from 'swr'\nimport type { Subscription } from '../../type'\nimport fetcher from '../../../../helpers/fetcher'\nimport { useHeadlessContext } from '@anker-in/lib'\n\nexport type SubscriptionApiResponse = { data: Subscription }\nexport type FetchSubscriptionResponse = SWRResponse<Subscription>\n\nexport function useSubscriptions({ email }: { email?: string }): FetchSubscriptionResponse {\n const { locale } = useHeadlessContext()\n\n const { data, ...rest } = useSWR<SubscriptionApiResponse>(\n email ? ['/api/multipass/account/subscriptions', email] : null,\n async ([url, email]) =>\n fetcher({\n method: 'GET',\n url,\n body: {\n email,\n },\n action: 'login',\n locale,\n headers: {},\n type: '',\n })\n )\n\n return { data: data?.data, ...rest } as unknown as FetchSubscriptionResponse\n}\n"],
|
|
5
|
+
"mappings": "AAAA,OAAOA,MAA6B,MAEpC,OAAOC,MAAa,8BACpB,OAAS,sBAAAC,MAA0B,gBAK5B,SAASC,EAAiB,CAAE,MAAAC,CAAM,EAAkD,CACzF,KAAM,CAAE,OAAAC,CAAO,EAAIH,EAAmB,EAEhC,CAAE,KAAAI,EAAM,GAAGC,CAAK,EAAIP,EACxBI,EAAQ,CAAC,uCAAwCA,CAAK,EAAI,KAC1D,MAAO,CAACI,EAAKJ,CAAK,IAChBH,EAAQ,CACN,OAAQ,MACR,IAAAO,EACA,KAAM,CACJ,MAAAJ,CACF,EACA,OAAQ,QACR,OAAAC,EACA,QAAS,CAAC,EACV,KAAM,EACR,CAAC,CACL,EAEA,MAAO,CAAE,KAAMC,GAAM,KAAM,GAAGC,CAAK,CACrC",
|
|
6
|
+
"names": ["useSWR", "fetcher", "useHeadlessContext", "useSubscriptions", "email", "locale", "data", "rest", "url"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const uploadReceipt: (_: any, { arg: { orderName } }: {
|
|
2
|
+
arg: {
|
|
3
|
+
orderName: string;
|
|
4
|
+
};
|
|
5
|
+
}) => Promise<{
|
|
6
|
+
ok: boolean;
|
|
7
|
+
code: number;
|
|
8
|
+
}>;
|
|
9
|
+
export declare const useUploadReceipt: () => import("swr/mutation").SWRMutationResponse<{
|
|
10
|
+
ok: boolean;
|
|
11
|
+
code: number;
|
|
12
|
+
}, any, "/api/multipass/mktsrv/v1/credit/upload_third_party_order", {
|
|
13
|
+
orderName: string;
|
|
14
|
+
}>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import r from"swr/mutation";const a=async(d,{arg:{orderName:t}})=>{const o=await fetch("/api/multipass/mktsrv/v1/credit/upload_third_party_order",{credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({order_name:t})}),{data:e}=await o.json();return{ok:e?.code===0,code:e?.code}},n=()=>r("/api/multipass/mktsrv/v1/credit/upload_third_party_order",a);export{a as uploadReceipt,n as useUploadReceipt};
|
|
2
|
+
//# sourceMappingURL=useUploadReceipt.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/components/credits/context/hooks/useUploadReceipt.tsx"],
|
|
4
|
+
"sourcesContent": ["import useSWRMutation from 'swr/mutation'\n\nexport const uploadReceipt = async (\n _: any,\n { arg: { orderName } }: { arg: { orderName: string } }\n): Promise<{\n ok: boolean\n code: number\n}> => {\n const response = await fetch(`/api/multipass/mktsrv/v1/credit/upload_third_party_order`, {\n credentials: 'include',\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n order_name: orderName,\n }),\n })\n const { data } = await response.json()\n return {\n ok: data?.code === 0,\n code: data?.code,\n }\n}\n\nexport const useUploadReceipt = () => {\n return useSWRMutation('/api/multipass/mktsrv/v1/credit/upload_third_party_order', uploadReceipt)\n}\n"],
|
|
5
|
+
"mappings": "AAAA,OAAOA,MAAoB,eAEpB,MAAMC,EAAgB,MAC3BC,EACA,CAAE,IAAK,CAAE,UAAAC,CAAU,CAAE,IAIjB,CACJ,MAAMC,EAAW,MAAM,MAAM,2DAA4D,CACvF,YAAa,UACb,OAAQ,OACR,QAAS,CACP,eAAgB,kBAClB,EACA,KAAM,KAAK,UAAU,CACnB,WAAYD,CACd,CAAC,CACH,CAAC,EACK,CAAE,KAAAE,CAAK,EAAI,MAAMD,EAAS,KAAK,EACrC,MAAO,CACL,GAAIC,GAAM,OAAS,EACnB,KAAMA,GAAM,IACd,CACF,EAEaC,EAAmB,IACvBN,EAAe,2DAA4DC,CAAa",
|
|
6
|
+
"names": ["useSWRMutation", "uploadReceipt", "_", "orderName", "response", "data", "useUploadReceipt"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { DTC_TASK_TYPE } from './const';
|
|
3
|
+
import type { CreditInfoResponse } from './response';
|
|
4
|
+
export declare const CreditsContext: React.Context<{
|
|
5
|
+
profile: any;
|
|
6
|
+
isLoadingProfile: boolean;
|
|
7
|
+
removeProfile: () => void;
|
|
8
|
+
taskIdToTypeMapping: Record<string, DTC_TASK_TYPE>;
|
|
9
|
+
openSignInPopup: () => void;
|
|
10
|
+
openSignUpPopup: () => void;
|
|
11
|
+
creditInfo?: CreditInfoResponse;
|
|
12
|
+
customer?: any;
|
|
13
|
+
customerLoading: boolean;
|
|
14
|
+
fetchCreditInfo: (user_id: string) => void;
|
|
15
|
+
gtm: {
|
|
16
|
+
pageGroup: string;
|
|
17
|
+
};
|
|
18
|
+
}>;
|
|
19
|
+
export declare function CreditsProvider({ children, profile, removeProfile, isLoadingProfile, openSignInPopup, openSignUpPopup, taskIdToTypeMapping, creditInfo, customer, customerLoading, fetchCreditInfo, gtm, }: {
|
|
20
|
+
children: React.ReactNode;
|
|
21
|
+
profile: any;
|
|
22
|
+
removeProfile: () => void;
|
|
23
|
+
isLoadingProfile: boolean;
|
|
24
|
+
openSignInPopup: () => void;
|
|
25
|
+
openSignUpPopup: () => void;
|
|
26
|
+
taskIdToTypeMapping: Record<string, DTC_TASK_TYPE>;
|
|
27
|
+
creditInfo?: CreditInfoResponse;
|
|
28
|
+
customer: any;
|
|
29
|
+
fetchCreditInfo: (user_id: string) => void;
|
|
30
|
+
customerLoading: boolean;
|
|
31
|
+
gtm: {
|
|
32
|
+
pageGroup: string;
|
|
33
|
+
};
|
|
34
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
export declare function useCreditsContext(): {
|
|
36
|
+
profile: any;
|
|
37
|
+
isLoadingProfile: boolean;
|
|
38
|
+
removeProfile: () => void;
|
|
39
|
+
taskIdToTypeMapping: Record<string, DTC_TASK_TYPE>;
|
|
40
|
+
openSignInPopup: () => void;
|
|
41
|
+
openSignUpPopup: () => void;
|
|
42
|
+
creditInfo?: CreditInfoResponse;
|
|
43
|
+
customer?: any;
|
|
44
|
+
customerLoading: boolean;
|
|
45
|
+
fetchCreditInfo: (user_id: string) => void;
|
|
46
|
+
gtm: {
|
|
47
|
+
pageGroup: string;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as C}from"react/jsx-runtime";import{createContext as c,useContext as l}from"react";const e=c({profile:null,isLoadingProfile:!1,taskIdToTypeMapping:{},removeProfile:()=>{},openSignInPopup:()=>{},openSignUpPopup:()=>{},creditInfo:void 0,customerLoading:!1,fetchCreditInfo:o=>{},gtm:{pageGroup:""}});function v({children:o,profile:n,removeProfile:i,isLoadingProfile:r,openSignInPopup:t,openSignUpPopup:p,taskIdToTypeMapping:d,creditInfo:s,customer:a,customerLoading:f,fetchCreditInfo:g,gtm:u}){return C(e.Provider,{value:{profile:n,isLoadingProfile:r,removeProfile:i,openSignInPopup:t,openSignUpPopup:p,taskIdToTypeMapping:d,creditInfo:s,fetchCreditInfo:g,customer:a,customerLoading:f,gtm:u},children:o})}function I(){return l(e)}export{e as CreditsContext,v as CreditsProvider,I as useCreditsContext};
|
|
2
|
+
//# sourceMappingURL=provider.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/components/credits/context/provider.tsx"],
|
|
4
|
+
"sourcesContent": ["import React, { createContext, useContext } from 'react'\nimport type { DTC_TASK_TYPE } from './const'\nimport type { CreditInfoResponse } from './response'\n\nexport const CreditsContext = createContext<{\n profile: any\n isLoadingProfile: boolean\n removeProfile: () => void\n taskIdToTypeMapping: Record<string, DTC_TASK_TYPE>\n openSignInPopup: () => void\n openSignUpPopup: () => void\n creditInfo?: CreditInfoResponse\n customer?: any\n customerLoading: boolean\n fetchCreditInfo: (user_id: string) => void\n gtm: {\n pageGroup: string\n }\n}>({\n profile: null,\n isLoadingProfile: false,\n taskIdToTypeMapping: {},\n removeProfile: () => {},\n openSignInPopup: () => {},\n openSignUpPopup: () => {},\n creditInfo: undefined,\n customerLoading: false,\n fetchCreditInfo: (user_id: string) => {},\n gtm: {\n pageGroup: '',\n },\n})\n\nexport function CreditsProvider({\n children,\n profile,\n removeProfile,\n isLoadingProfile,\n openSignInPopup,\n openSignUpPopup,\n taskIdToTypeMapping,\n creditInfo,\n customer,\n customerLoading,\n fetchCreditInfo,\n gtm,\n}: {\n children: React.ReactNode\n profile: any\n removeProfile: () => void\n isLoadingProfile: boolean\n openSignInPopup: () => void\n openSignUpPopup: () => void\n taskIdToTypeMapping: Record<string, DTC_TASK_TYPE>\n creditInfo?: CreditInfoResponse\n customer: any\n fetchCreditInfo: (user_id: string) => void\n customerLoading: boolean\n gtm: {\n pageGroup: string\n }\n}) {\n return (\n <CreditsContext.Provider\n value={{\n profile,\n isLoadingProfile,\n removeProfile,\n openSignInPopup,\n openSignUpPopup,\n taskIdToTypeMapping,\n creditInfo,\n fetchCreditInfo,\n customer,\n customerLoading,\n gtm,\n }}\n >\n {children}\n </CreditsContext.Provider>\n )\n}\n\nexport function useCreditsContext() {\n return useContext(CreditsContext)\n}\n"],
|
|
5
|
+
"mappings": "AA+DI,cAAAA,MAAA,oBA/DJ,OAAgB,iBAAAC,EAAe,cAAAC,MAAkB,QAI1C,MAAMC,EAAiBF,EAc3B,CACD,QAAS,KACT,iBAAkB,GAClB,oBAAqB,CAAC,EACtB,cAAe,IAAM,CAAC,EACtB,gBAAiB,IAAM,CAAC,EACxB,gBAAiB,IAAM,CAAC,EACxB,WAAY,OACZ,gBAAiB,GACjB,gBAAkBG,GAAoB,CAAC,EACvC,IAAK,CACH,UAAW,EACb,CACF,CAAC,EAEM,SAASC,EAAgB,CAC9B,SAAAC,EACA,QAAAC,EACA,cAAAC,EACA,iBAAAC,EACA,gBAAAC,EACA,gBAAAC,EACA,oBAAAC,EACA,WAAAC,EACA,SAAAC,EACA,gBAAAC,EACA,gBAAAC,EACA,IAAAC,CACF,EAeG,CACD,OACEjB,EAACG,EAAe,SAAf,CACC,MAAO,CACL,QAAAI,EACA,iBAAAE,EACA,cAAAD,EACA,gBAAAE,EACA,gBAAAC,EACA,oBAAAC,EACA,WAAAC,EACA,gBAAAG,EACA,SAAAF,EACA,gBAAAC,EACA,IAAAE,CACF,EAEC,SAAAX,EACH,CAEJ,CAEO,SAASY,GAAoB,CAClC,OAAOhB,EAAWC,CAAc,CAClC",
|
|
6
|
+
"names": ["jsx", "createContext", "useContext", "CreditsContext", "user_id", "CreditsProvider", "children", "profile", "removeProfile", "isLoadingProfile", "openSignInPopup", "openSignUpPopup", "taskIdToTypeMapping", "creditInfo", "customer", "customerLoading", "fetchCreditInfo", "gtm", "useCreditsContext"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { ApprovalStatus, AlpcConsumeType, CreditType, TaskSubType, TaskType } from './const';
|
|
2
|
+
interface BaseResponse {
|
|
3
|
+
brand: string;
|
|
4
|
+
}
|
|
5
|
+
export interface Task extends BaseResponse {
|
|
6
|
+
goods_sku?: string;
|
|
7
|
+
task_type: TaskType;
|
|
8
|
+
task_sub_type: TaskSubType;
|
|
9
|
+
task_rule_id: number;
|
|
10
|
+
task_name: string;
|
|
11
|
+
task_note: string;
|
|
12
|
+
app_name: string;
|
|
13
|
+
}
|
|
14
|
+
export interface CreditLogResponse extends Task {
|
|
15
|
+
credit: number;
|
|
16
|
+
task_name: string;
|
|
17
|
+
create_time: number;
|
|
18
|
+
credit_type: CreditType;
|
|
19
|
+
pending_time: number;
|
|
20
|
+
status: number;
|
|
21
|
+
expired_time?: number;
|
|
22
|
+
}
|
|
23
|
+
export interface ConsumeCreditRuleResponse extends BaseResponse {
|
|
24
|
+
id: number;
|
|
25
|
+
name: string;
|
|
26
|
+
note: string;
|
|
27
|
+
consume_credits: number;
|
|
28
|
+
consume_type: AlpcConsumeType;
|
|
29
|
+
coupon_rule: string;
|
|
30
|
+
remaining_inventory: number;
|
|
31
|
+
is_limited: number;
|
|
32
|
+
sku_handle: string;
|
|
33
|
+
goods_sku: string;
|
|
34
|
+
goods_url: string;
|
|
35
|
+
extra?: string;
|
|
36
|
+
}
|
|
37
|
+
export interface RedeemLogResponse extends BaseResponse {
|
|
38
|
+
goods_title: string;
|
|
39
|
+
coupon_code: string;
|
|
40
|
+
order_number: string;
|
|
41
|
+
create_time: number;
|
|
42
|
+
consume_credits: number;
|
|
43
|
+
fulfillment_status: string;
|
|
44
|
+
approval_status: ApprovalStatus;
|
|
45
|
+
rule_id: number;
|
|
46
|
+
code_status: number;
|
|
47
|
+
}
|
|
48
|
+
export interface CreditTaskResponse extends Task {
|
|
49
|
+
status: number;
|
|
50
|
+
is_enable: number;
|
|
51
|
+
id: number;
|
|
52
|
+
weight: number;
|
|
53
|
+
reward_type: number;
|
|
54
|
+
}
|
|
55
|
+
export interface CreditInfoResponse extends BaseResponse {
|
|
56
|
+
total_credit: number;
|
|
57
|
+
available_credit: number;
|
|
58
|
+
pending_credit: number;
|
|
59
|
+
expired_credit: number;
|
|
60
|
+
cancel_credit: number;
|
|
61
|
+
consumed_credit: number;
|
|
62
|
+
}
|
|
63
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=response.js.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare function getAlpcPath(locale?: string): "/api/multipass/alpc-eu" | "/api/multipass/alpc";
|
|
2
|
+
export declare function numberFormat(num?: number): string | number;
|
|
3
|
+
export declare const emailValidate: (email: any) => boolean;
|
|
4
|
+
export declare const languageTerritory: (locale: string) => string;
|
|
5
|
+
export declare function formatPrice({ amount, currencyCode, locale, maximumFractionDigits, minimumFractionDigits, removeTrailingZeros, }: {
|
|
6
|
+
amount: number;
|
|
7
|
+
currencyCode: string;
|
|
8
|
+
locale: string;
|
|
9
|
+
maximumFractionDigits?: number;
|
|
10
|
+
minimumFractionDigits?: number;
|
|
11
|
+
removeTrailingZeros?: boolean;
|
|
12
|
+
}): string;
|
|
13
|
+
export declare function formatVariantPrice({ amount, baseAmount, currencyCode, locale, maximumFractionDigits, minimumFractionDigits, removeTrailingZeros, }: {
|
|
14
|
+
baseAmount: number;
|
|
15
|
+
amount: number;
|
|
16
|
+
currencyCode: string;
|
|
17
|
+
locale: string;
|
|
18
|
+
maximumFractionDigits?: number;
|
|
19
|
+
minimumFractionDigits?: number;
|
|
20
|
+
removeTrailingZeros?: boolean;
|
|
21
|
+
}): {
|
|
22
|
+
price: string;
|
|
23
|
+
basePrice: string | undefined;
|
|
24
|
+
discount: string | null;
|
|
25
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import g from"js-cookie";import{PRICE_SYMBOL as a}from"./const";function k(e=""){let n=!1;const r=g.get("alpcEU");return r===void 0||r===""?["de","eu-de","eu","eu-en","uk","fr","fra"].includes(e)&&(n=!0):Number(r)&&(n=!0),n?"/api/multipass/alpc-eu":"/api/multipass/alpc"}function C(e=0){return typeof Intl>"u"?e:new Intl.NumberFormat().format(e)}const E=e=>/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e),c=e=>({us:"en-us",uk:"en-gb",ca:"en-ca",au:"en-au",nz:"en-nz",eu:"en-eu",pl:"pl-pl",fr:"fr-fr",de:"de-de",vn:"vi-vn",sg:"en-sg","ae-en":"en-ae",plus:"en-us",cl:"es-cl",es:"es-es",se:"en-se",dk:"en-dk",is:"en-is",no:"en-no",fi:"en-fi"})[e]||"";function f({amount:e,currencyCode:n,locale:r,maximumFractionDigits:t,minimumFractionDigits:u,removeTrailingZeros:o=!1}){let i=new Intl.NumberFormat(c(r)||r,{style:"currency",currency:n||"USD",minimumFractionDigits:t===0?0:u,maximumFractionDigits:t}).format(e);return["eu-de","eu-en","de","eu"].includes(r)&&(i=i?.toString()?.replace(/[\s]/g,"")),o&&(i=i.replace(/(\.\d*?[1-9])0+\b/,"$1").replace(/\.0+\b/,"").replace(/(\,\d*?[1-9])0+\b/,"$1").replace(/\,0+\b/,"")),i}function I({amount:e,baseAmount:n,currencyCode:r,locale:t,maximumFractionDigits:u,minimumFractionDigits:o,removeTrailingZeros:s}){if(typeof Intl>"u")return{price:`${a[t]}${e}`,basePrice:`${a[t]}${n}`,discount:`${a[t]}${n-e||0}`};const i=n>e,m=new Intl.NumberFormat(c(t),{style:"percent"}),p=i?m.format((n-e)/n):null,l=f({amount:e,currencyCode:r,locale:t,removeTrailingZeros:s}),d=i?f({amount:n,currencyCode:r,locale:t,maximumFractionDigits:u,minimumFractionDigits:o,removeTrailingZeros:s}):void 0;return{price:l,basePrice:d,discount:p}}export{E as emailValidate,f as formatPrice,I as formatVariantPrice,k as getAlpcPath,c as languageTerritory,C as numberFormat};
|
|
2
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/components/credits/context/utils.ts"],
|
|
4
|
+
"sourcesContent": ["import Cookies from 'js-cookie'\nimport { PRICE_SYMBOL } from './const'\n\nexport function getAlpcPath(locale = '') {\n let isEU = false\n const alpcEUCookie = Cookies.get('alpcEU')\n if (alpcEUCookie === undefined || alpcEUCookie === '') {\n if (['de', 'eu-de', 'eu', 'eu-en', 'uk', 'fr', 'fra'].includes(locale)) {\n isEU = true\n }\n } else {\n let alpcEU = Number(alpcEUCookie)\n if (alpcEU) {\n isEU = true\n }\n }\n\n if (isEU) {\n return '/api/multipass/alpc-eu'\n }\n\n return '/api/multipass/alpc'\n}\n\nexport function numberFormat(num: number = 0) {\n if (typeof Intl === 'undefined') {\n return num\n }\n\n return new Intl.NumberFormat().format(num)\n}\n\nexport const emailValidate = (email: any) => {\n return /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/.test(\n email\n )\n}\n\nexport const languageTerritory = (locale: string) =>\n // https://unicode-org.github.io/cldr-staging/charts/37/supplemental/language_territory_information.html\n ({\n us: 'en-us',\n uk: 'en-gb',\n ca: 'en-ca',\n au: 'en-au',\n nz: 'en-nz',\n eu: 'en-eu',\n pl: 'pl-pl',\n fr: 'fr-fr',\n de: 'de-de',\n vn: 'vi-vn',\n sg: 'en-sg',\n 'ae-en': 'en-ae',\n plus: 'en-us',\n cl: 'es-cl',\n es: 'es-es',\n // Nordic countries\n se: 'en-se',\n dk: 'en-dk',\n is: 'en-is',\n no: 'en-no',\n fi: 'en-fi',\n })[locale] || ''\n\nexport function formatPrice({\n amount,\n currencyCode,\n locale,\n maximumFractionDigits,\n minimumFractionDigits,\n removeTrailingZeros = false,\n}: {\n amount: number\n currencyCode: string\n locale: string\n maximumFractionDigits?: number\n minimumFractionDigits?: number\n removeTrailingZeros?: boolean\n}) {\n const formatCurrency = new Intl.NumberFormat(languageTerritory(locale) || locale, {\n style: 'currency',\n currency: currencyCode || 'USD',\n minimumFractionDigits: maximumFractionDigits === 0 ? 0 : minimumFractionDigits,\n maximumFractionDigits,\n })\n\n let formattedValue = formatCurrency.format(amount)\n\n if (['eu-de', 'eu-en', 'de', 'eu'].includes(locale)) {\n formattedValue = formattedValue?.toString()?.replace(/[\\s]/g, '')\n }\n\n if (removeTrailingZeros) {\n // Adjust the regex to match comma as decimal separator\n formattedValue = formattedValue\n .replace(/(\\.\\d*?[1-9])0+\\b/, '$1')\n .replace(/\\.0+\\b/, '')\n .replace(/(\\,\\d*?[1-9])0+\\b/, '$1')\n .replace(/\\,0+\\b/, '')\n }\n\n return formattedValue\n}\n\nexport function formatVariantPrice({\n amount,\n baseAmount,\n currencyCode,\n locale,\n maximumFractionDigits,\n minimumFractionDigits,\n removeTrailingZeros,\n}: {\n baseAmount: number\n amount: number\n currencyCode: string\n locale: string\n maximumFractionDigits?: number\n minimumFractionDigits?: number\n removeTrailingZeros?: boolean\n}) {\n if (typeof Intl === 'undefined') {\n return {\n price: `${PRICE_SYMBOL[locale as keyof typeof PRICE_SYMBOL]}${amount}`,\n basePrice: `${PRICE_SYMBOL[locale as keyof typeof PRICE_SYMBOL]}${baseAmount}`,\n discount: `${PRICE_SYMBOL[locale as keyof typeof PRICE_SYMBOL]}${baseAmount - amount || 0}`,\n }\n }\n\n const hasDiscount = baseAmount > amount\n const formatDiscount = new Intl.NumberFormat(languageTerritory(locale), {\n style: 'percent',\n })\n const discount = hasDiscount ? formatDiscount.format((baseAmount - amount) / baseAmount) : null\n\n const price = formatPrice({ amount, currencyCode, locale, removeTrailingZeros })\n const basePrice = hasDiscount\n ? formatPrice({\n amount: baseAmount,\n currencyCode,\n locale,\n maximumFractionDigits,\n minimumFractionDigits,\n removeTrailingZeros,\n })\n : undefined\n\n return { price, basePrice, discount }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,OAAOA,MAAa,YACpB,OAAS,gBAAAC,MAAoB,UAEtB,SAASC,EAAYC,EAAS,GAAI,CACvC,IAAIC,EAAO,GACX,MAAMC,EAAeL,EAAQ,IAAI,QAAQ,EAYzC,OAXIK,IAAiB,QAAaA,IAAiB,GAC7C,CAAC,KAAM,QAAS,KAAM,QAAS,KAAM,KAAM,KAAK,EAAE,SAASF,CAAM,IACnEC,EAAO,IAGI,OAAOC,CAAY,IAE9BD,EAAO,IAIPA,EACK,yBAGF,qBACT,CAEO,SAASE,EAAaC,EAAc,EAAG,CAC5C,OAAI,OAAO,KAAS,IACXA,EAGF,IAAI,KAAK,aAAa,EAAE,OAAOA,CAAG,CAC3C,CAEO,MAAMC,EAAiBC,GACrB,yJAAyJ,KAC9JA,CACF,EAGWC,EAAqBP,IAE/B,CACC,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,QAAS,QACT,KAAM,QACN,GAAI,QACJ,GAAI,QAEJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,OACN,GAAGA,CAAM,GAAK,GAET,SAASQ,EAAY,CAC1B,OAAAC,EACA,aAAAC,EACA,OAAAV,EACA,sBAAAW,EACA,sBAAAC,EACA,oBAAAC,EAAsB,EACxB,EAOG,CAQD,IAAIC,EAPmB,IAAI,KAAK,aAAaP,EAAkBP,CAAM,GAAKA,EAAQ,CAChF,MAAO,WACP,SAAUU,GAAgB,MAC1B,sBAAuBC,IAA0B,EAAI,EAAIC,EACzD,sBAAAD,CACF,CAAC,EAEmC,OAAOF,CAAM,EAEjD,MAAI,CAAC,QAAS,QAAS,KAAM,IAAI,EAAE,SAAST,CAAM,IAChDc,EAAiBA,GAAgB,SAAS,GAAG,QAAQ,QAAS,EAAE,GAG9DD,IAEFC,EAAiBA,EACd,QAAQ,oBAAqB,IAAI,EACjC,QAAQ,SAAU,EAAE,EACpB,QAAQ,oBAAqB,IAAI,EACjC,QAAQ,SAAU,EAAE,GAGlBA,CACT,CAEO,SAASC,EAAmB,CACjC,OAAAN,EACA,WAAAO,EACA,aAAAN,EACA,OAAAV,EACA,sBAAAW,EACA,sBAAAC,EACA,oBAAAC,CACF,EAQG,CACD,GAAI,OAAO,KAAS,IAClB,MAAO,CACL,MAAO,GAAGf,EAAaE,CAAmC,CAAC,GAAGS,CAAM,GACpE,UAAW,GAAGX,EAAaE,CAAmC,CAAC,GAAGgB,CAAU,GAC5E,SAAU,GAAGlB,EAAaE,CAAmC,CAAC,GAAGgB,EAAaP,GAAU,CAAC,EAC3F,EAGF,MAAMQ,EAAcD,EAAaP,EAC3BS,EAAiB,IAAI,KAAK,aAAaX,EAAkBP,CAAM,EAAG,CACtE,MAAO,SACT,CAAC,EACKmB,EAAWF,EAAcC,EAAe,QAAQF,EAAaP,GAAUO,CAAU,EAAI,KAErFI,EAAQZ,EAAY,CAAE,OAAAC,EAAQ,aAAAC,EAAc,OAAAV,EAAQ,oBAAAa,CAAoB,CAAC,EACzEQ,EAAYJ,EACdT,EAAY,CACV,OAAQQ,EACR,aAAAN,EACA,OAAAV,EACA,sBAAAW,EACA,sBAAAC,EACA,oBAAAC,CACF,CAAC,EACD,OAEJ,MAAO,CAAE,MAAAO,EAAO,UAAAC,EAAW,SAAAF,CAAS,CACtC",
|
|
6
|
+
"names": ["Cookies", "PRICE_SYMBOL", "getAlpcPath", "locale", "isEU", "alpcEUCookie", "numberFormat", "num", "emailValidate", "email", "languageTerritory", "formatPrice", "amount", "currencyCode", "maximumFractionDigits", "minimumFractionDigits", "removeTrailingZeros", "formattedValue", "formatVariantPrice", "baseAmount", "hasDiscount", "formatDiscount", "discount", "price", "basePrice"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
type Img = {
|
|
2
|
+
url: string;
|
|
3
|
+
alt: string;
|
|
4
|
+
};
|
|
5
|
+
type BannerProps = {
|
|
6
|
+
copy: {
|
|
7
|
+
pcImg: Img;
|
|
8
|
+
laptopImg: Img;
|
|
9
|
+
mobileImg: Img;
|
|
10
|
+
joinNow: string;
|
|
11
|
+
loginIn: string;
|
|
12
|
+
login: {
|
|
13
|
+
title: string;
|
|
14
|
+
description: string;
|
|
15
|
+
};
|
|
16
|
+
unLogin: {
|
|
17
|
+
title: string;
|
|
18
|
+
description: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export declare function CreditsBanner({ copy }: BannerProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Fragment as I,jsx as i,jsxs as l}from"react/jsx-runtime";import{Button as s,Container as p,Heading as d,Picture as c,Text as u}from"@anker-in/headless-ui";import f from"classnames";import{useCreditsContext as x}from"../context/provider";function C({copy:t}){const{profile:e,openSignInPopup:r,openSignUpPopup:o}=x(),n=e?Object.keys(e).length!==0:!1,m=e?.first_name?e?.first_name+" "+e?.last_name:e?.email?.split("@")[0],a=g=>{g==="primary"?o():r()};return i(I,{children:l("div",{className:" relative w-full",children:[i(c,{className:"aspect-h-[804] aspect-w-[1920] md:aspect-h-[660] md:aspect-w-[390] md-l:aspect-h-[660] md-l:aspect-w-[768]",source:`${t.pcImg?.url}, ${t.laptopImg?.url} 1024, ${t.mobileImg?.url} 768`,alt:t.pcImg?.alt,loading:"eager"}),n&&i("div",{className:"absolute inset-0 ",style:{background:"linear-gradient(180deg, rgba(245, 245, 247, 0) 70.31%, #F5F5F7 100%)"}}),i(p,{className:"l:h-auto !absolute inset-0 mx-auto grid h-full",asChild:!0,children:i("div",{className:"grid grid-cols-12",children:l("div",{className:"l:col-span-12 l:justify-start l:truncate l:pt-[64px] col-span-5 flex h-full flex-col justify-center text-[#1F2021]",children:[i(d,{as:"h1",size:"5",html:n?t.login.title?.replace("$name",m||""):t.unLogin.title}),i(u,{size:"3",className:"l:mt-[4px] l-xxl:text-[14px] mt-[16px]",html:n?t.login.description:t.unLogin.description}),!n&&l("div",{className:f("mt-[32px] grid w-fit grid-flow-col gap-[12px] l:mt-[24px]",n&&"hidden"),children:[i(s,{variant:"secondary",size:"lg",onClick:()=>{a("primary")},children:t.joinNow}),i(s,{variant:"primary",size:"lg",onClick:()=>{a("secondary")},children:t.loginIn})]})]})})})]})})}export{C as CreditsBanner};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/components/credits/creditsBanner/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import { Button, Container, Heading, Picture, Text } from '@anker-in/headless-ui'\nimport classNames from 'classnames'\nimport { useCreditsContext } from '../context/provider'\n\ntype Img = {\n url: string\n alt: string\n}\ntype BannerProps = {\n copy: {\n pcImg: Img\n laptopImg: Img\n mobileImg: Img\n joinNow: string\n loginIn: string\n login: {\n title: string\n description: string\n }\n unLogin: {\n title: string\n description: string\n }\n }\n}\n\nexport function CreditsBanner({ copy }: BannerProps) {\n const { profile, openSignInPopup, openSignUpPopup } = useCreditsContext()\n const isLogin = profile ? Object.keys(profile).length !== 0 : false\n\n const displayName = profile?.first_name\n ? profile?.first_name + ' ' + profile?.last_name\n : profile?.email?.split('@')[0]\n\n const handleButtonClick = (buttonType: 'primary' | 'secondary') => {\n buttonType === 'primary' ? openSignUpPopup() : openSignInPopup()\n }\n\n return (\n <>\n <div className=\" relative w-full\">\n <Picture\n className=\"aspect-h-[804] aspect-w-[1920] md:aspect-h-[660] md:aspect-w-[390] md-l:aspect-h-[660] md-l:aspect-w-[768]\"\n source={`${copy.pcImg?.url}, ${copy.laptopImg?.url} 1024, ${copy.mobileImg?.url} 768`}\n alt={copy.pcImg?.alt}\n loading=\"eager\"\n ></Picture>\n {isLogin && (\n <div\n className=\"absolute inset-0 \"\n style={{\n background: 'linear-gradient(180deg, rgba(245, 245, 247, 0) 70.31%, #F5F5F7 100%)',\n }}\n ></div>\n )}\n\n <Container className=\"l:h-auto !absolute inset-0 mx-auto grid h-full\" asChild>\n <div className=\"grid grid-cols-12\">\n <div className=\"l:col-span-12 l:justify-start l:truncate l:pt-[64px] col-span-5 flex h-full flex-col justify-center text-[#1F2021]\">\n <Heading\n as=\"h1\"\n size=\"5\"\n html={isLogin ? copy.login.title?.replace('$name', displayName || '') : copy.unLogin.title}\n ></Heading>\n\n <Text\n size=\"3\"\n className=\"l:mt-[4px] l-xxl:text-[14px] mt-[16px]\"\n html={isLogin ? copy.login.description : copy.unLogin.description}\n ></Text>\n\n {!isLogin && (\n <div\n className={classNames(\n 'mt-[32px] grid w-fit grid-flow-col gap-[12px] l:mt-[24px]',\n isLogin && 'hidden'\n )}\n >\n <Button\n variant=\"secondary\"\n size=\"lg\"\n onClick={() => {\n handleButtonClick('primary')\n }}\n >\n {copy.joinNow}\n </Button>\n <Button\n variant=\"primary\"\n size=\"lg\"\n onClick={() => {\n handleButtonClick('secondary')\n }}\n >\n {copy.loginIn}\n </Button>\n </div>\n )}\n </div>\n </div>\n </Container>\n </div>\n </>\n )\n}\n"],
|
|
5
|
+
"mappings": "AAuCI,mBAAAA,EAEI,OAAAC,EA+BQ,QAAAC,MAjCZ,oBAvCJ,OAAS,UAAAC,EAAQ,aAAAC,EAAW,WAAAC,EAAS,WAAAC,EAAS,QAAAC,MAAY,wBAC1D,OAAOC,MAAgB,aACvB,OAAS,qBAAAC,MAAyB,sBAwB3B,SAASC,EAAc,CAAE,KAAAC,CAAK,EAAgB,CACnD,KAAM,CAAE,QAAAC,EAAS,gBAAAC,EAAiB,gBAAAC,CAAgB,EAAIL,EAAkB,EAClEM,EAAUH,EAAU,OAAO,KAAKA,CAAO,EAAE,SAAW,EAAI,GAExDI,EAAcJ,GAAS,WACzBA,GAAS,WAAa,IAAMA,GAAS,UACrCA,GAAS,OAAO,MAAM,GAAG,EAAE,CAAC,EAE1BK,EAAqBC,GAAwC,CACjEA,IAAe,UAAYJ,EAAgB,EAAID,EAAgB,CACjE,EAEA,OACEZ,EAAAD,EAAA,CACE,SAAAE,EAAC,OAAI,UAAU,mBACb,UAAAD,EAACK,EAAA,CACC,UAAU,6GACV,OAAQ,GAAGK,EAAK,OAAO,GAAG,KAAKA,EAAK,WAAW,GAAG,UAAUA,EAAK,WAAW,GAAG,OAC/E,IAAKA,EAAK,OAAO,IACjB,QAAQ,QACT,EACAI,GACCd,EAAC,OACC,UAAU,oBACV,MAAO,CACL,WAAY,sEACd,EACD,EAGHA,EAACG,EAAA,CAAU,UAAU,iDAAiD,QAAO,GAC3E,SAAAH,EAAC,OAAI,UAAU,oBACb,SAAAC,EAAC,OAAI,UAAU,qHACb,UAAAD,EAACI,EAAA,CACC,GAAG,KACH,KAAK,IACL,KAAMU,EAAUJ,EAAK,MAAM,OAAO,QAAQ,QAASK,GAAe,EAAE,EAAIL,EAAK,QAAQ,MACtF,EAEDV,EAACM,EAAA,CACC,KAAK,IACL,UAAU,yCACV,KAAMQ,EAAUJ,EAAK,MAAM,YAAcA,EAAK,QAAQ,YACvD,EAEA,CAACI,GACAb,EAAC,OACC,UAAWM,EACT,4DACAO,GAAW,QACb,EAEA,UAAAd,EAACE,EAAA,CACC,QAAQ,YACR,KAAK,KACL,QAAS,IAAM,CACbc,EAAkB,SAAS,CAC7B,EAEC,SAAAN,EAAK,QACR,EACAV,EAACE,EAAA,CACC,QAAQ,UACR,KAAK,KACL,QAAS,IAAM,CACbc,EAAkB,WAAW,CAC/B,EAEC,SAAAN,EAAK,QACR,GACF,GAEJ,EACF,EACF,GACF,EACF,CAEJ",
|
|
6
|
+
"names": ["Fragment", "jsx", "jsxs", "Button", "Container", "Heading", "Picture", "Text", "classNames", "useCreditsContext", "CreditsBanner", "copy", "profile", "openSignInPopup", "openSignUpPopup", "isLogin", "displayName", "handleButtonClick", "buttonType"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface BenefitItemCopy {
|
|
2
|
+
icon: {
|
|
3
|
+
alt: string;
|
|
4
|
+
url: string;
|
|
5
|
+
};
|
|
6
|
+
text: string;
|
|
7
|
+
note?: string;
|
|
8
|
+
tag?: string;
|
|
9
|
+
}
|
|
10
|
+
declare const BenefitItem: ({ item, handleClick, isNoteActive, index, }: {
|
|
11
|
+
item: BenefitItemCopy;
|
|
12
|
+
handleClick: ({ item, index }: {
|
|
13
|
+
item: BenefitItemCopy;
|
|
14
|
+
index: number;
|
|
15
|
+
}) => void;
|
|
16
|
+
isNoteActive: boolean;
|
|
17
|
+
index: number;
|
|
18
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export default BenefitItem;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as t,jsxs as o}from"react/jsx-runtime";import{Heading as r,Picture as x,Text as l}from"@anker-in/headless-ui";import{cn as s}from"../../../helpers/utils";import p from"./iconInfo";const m=({item:e,handleClick:a,isNoteActive:n,index:d})=>t("div",{className:"relative flex-1 flex flex-col rounded-[16px] border border-white px-[24px] pb-[26px] pt-[24px] md:min-h-[180px] md:p-[16px]",style:{background:"linear-gradient(119.61deg, #FAFAFA 38.58%, #FFFFFF 63.73%, #F9FCFF 89.37%)"},children:o("div",{className:"flex flex-col",children:[t(x,{className:"mb-[16px] size-[31px] md:absolute md:bottom-[16px] md:right-[16px] md:mb-0",alt:e.icon?.alt,source:e.icon?.url}),o("div",{className:"flex items-center",children:[t(r,{html:e.text,size:"2",className:"break-all"}),e.note&&o("div",{role:"button",tabIndex:0,onKeyDown:i=>{(i.key==="Enter"||i.key===" ")&&i.preventDefault()},className:"relative mb-1 ml-[4px]",onClick:()=>a({item:e,index:d}),children:[t(p,{}),t("div",{className:s("absolute -bottom-[12px] left-[32px] z-10 w-[356px] -translate-x-full translate-y-full md:w-[276px]",n?"block":"hidden"),children:o("div",{className:"relative rounded-[10px] bg-[#6D6D6F] p-[16px] text-[14px] font-medium text-white shadow",children:[t(l,{as:"p",size:"2",html:e.note,className:"desktop:text-[18px]"}),t("div",{className:"absolute -top-[10px] right-[9px] mb-2 size-[16px] origin-top-left rotate-45 transform rounded-[2px] bg-[#6D6D6F]"})]})})]})]}),e.tag&&t(l,{as:"div",html:e.tag,className:"mt-[2px] text-[16px] font-bold text-[#6D6D6F]"})]})});var v=m;export{v as default};
|
|
2
|
+
//# sourceMappingURL=benefitItem.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/components/credits/creditsBenefits/benefitItem.tsx"],
|
|
4
|
+
"sourcesContent": ["import { Heading, Picture, Text } from '@anker-in/headless-ui'\nimport { cn } from '../../../helpers/utils'\nimport IconInfo from './iconInfo'\n\nexport interface BenefitItemCopy {\n icon: {\n alt: string\n url: string\n }\n text: string\n note?: string\n tag?: string\n}\nconst BenefitItem = ({\n item,\n handleClick,\n isNoteActive,\n index,\n}: {\n item: BenefitItemCopy\n handleClick: ({ item, index }: { item: BenefitItemCopy; index: number }) => void\n isNoteActive: boolean\n index: number\n}) => {\n return (\n <div\n className=\"relative flex-1 flex flex-col rounded-[16px] border border-white px-[24px] pb-[26px] pt-[24px] md:min-h-[180px] md:p-[16px]\"\n style={{\n background: 'linear-gradient(119.61deg, #FAFAFA 38.58%, #FFFFFF 63.73%, #F9FCFF 89.37%)',\n }}\n >\n <div className=\"flex flex-col\">\n <Picture\n className=\"mb-[16px] size-[31px] md:absolute md:bottom-[16px] md:right-[16px] md:mb-0\"\n alt={item.icon?.alt}\n source={item.icon?.url}\n />\n <div className=\"flex items-center\">\n <Heading html={item.text} size=\"2\" className=\"break-all\" />\n {item.note && (\n <div\n role=\"button\"\n tabIndex={0}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n }\n }}\n className=\"relative mb-1 ml-[4px]\"\n onClick={() => handleClick({ item, index })}\n >\n <IconInfo />\n <div\n className={cn(\n 'absolute -bottom-[12px] left-[32px] z-10 w-[356px] -translate-x-full translate-y-full md:w-[276px]',\n isNoteActive ? 'block' : 'hidden'\n )}\n >\n <div className=\"relative rounded-[10px] bg-[#6D6D6F] p-[16px] text-[14px] font-medium text-white shadow\">\n <Text as=\"p\" size=\"2\" html={item.note} className=\"desktop:text-[18px]\" />\n <div className=\"absolute -top-[10px] right-[9px] mb-2 size-[16px] origin-top-left rotate-45 transform rounded-[2px] bg-[#6D6D6F]\" />\n </div>\n </div>\n </div>\n )}\n </div>\n {item.tag && <Text as=\"div\" html={item.tag} className=\"mt-[2px] text-[16px] font-bold text-[#6D6D6F]\" />}\n </div>\n </div>\n )\n}\n\nexport default BenefitItem\n"],
|
|
5
|
+
"mappings": "AAgCQ,cAAAA,EA0BQ,QAAAC,MA1BR,oBAhCR,OAAS,WAAAC,EAAS,WAAAC,EAAS,QAAAC,MAAY,wBACvC,OAAS,MAAAC,MAAU,yBACnB,OAAOC,MAAc,aAWrB,MAAMC,EAAc,CAAC,CACnB,KAAAC,EACA,YAAAC,EACA,aAAAC,EACA,MAAAC,CACF,IAOIX,EAAC,OACC,UAAU,8HACV,MAAO,CACL,WAAY,4EACd,EAEA,SAAAC,EAAC,OAAI,UAAU,gBACb,UAAAD,EAACG,EAAA,CACC,UAAU,6EACV,IAAKK,EAAK,MAAM,IAChB,OAAQA,EAAK,MAAM,IACrB,EACAP,EAAC,OAAI,UAAU,oBACb,UAAAD,EAACE,EAAA,CAAQ,KAAMM,EAAK,KAAM,KAAK,IAAI,UAAU,YAAY,EACxDA,EAAK,MACJP,EAAC,OACC,KAAK,SACL,SAAU,EACV,UAAWW,GAAK,EACVA,EAAE,MAAQ,SAAWA,EAAE,MAAQ,MACjCA,EAAE,eAAe,CAErB,EACA,UAAU,yBACV,QAAS,IAAMH,EAAY,CAAE,KAAAD,EAAM,MAAAG,CAAM,CAAC,EAE1C,UAAAX,EAACM,EAAA,EAAS,EACVN,EAAC,OACC,UAAWK,EACT,qGACAK,EAAe,QAAU,QAC3B,EAEA,SAAAT,EAAC,OAAI,UAAU,0FACb,UAAAD,EAACI,EAAA,CAAK,GAAG,IAAI,KAAK,IAAI,KAAMI,EAAK,KAAM,UAAU,sBAAsB,EACvER,EAAC,OAAI,UAAU,mHAAmH,GACpI,EACF,GACF,GAEJ,EACCQ,EAAK,KAAOR,EAACI,EAAA,CAAK,GAAG,MAAM,KAAMI,EAAK,IAAK,UAAU,gDAAgD,GACxG,EACF,EAIJ,IAAOK,EAAQN",
|
|
6
|
+
"names": ["jsx", "jsxs", "Heading", "Picture", "Text", "cn", "IconInfo", "BenefitItem", "item", "handleClick", "isNoteActive", "index", "e", "benefitItem_default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as C,jsxs as o}from"react/jsx-runtime";const l=()=>o("svg",{xmlns:"http://www.w3.org/2000/svg",className:"size-[18px] cursor-pointer [&_svg]:size-full",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:[C("path",{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",fill:"#6D6D6F"}),C("path",{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",fill:"#6D6D6F"})]});var s=l;export{l as IconInfo,s as default};
|
|
2
|
+
//# sourceMappingURL=iconInfo.js.map
|
|
@@ -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,12 @@
|
|
|
1
|
+
import 'swiper/css';
|
|
2
|
+
import 'swiper/css/grid';
|
|
3
|
+
import 'swiper/css/pagination';
|
|
4
|
+
import { type BenefitItemCopy } from './benefitItem';
|
|
5
|
+
interface CreditsBenefitsProps {
|
|
6
|
+
copy: {
|
|
7
|
+
title: string;
|
|
8
|
+
benefits: BenefitItemCopy[];
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export declare const CreditsBenefits: ({ copy }: CreditsBenefitsProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -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 d,Heading as c}from"@anker-in/headless-ui";import{useState as u}from"react";import{Grid as f,Pagination as g}from"swiper/modules";import{Swiper as v,SwiperSlide as b}from"swiper/react";import l from"./benefitItem";import{useCreditsContext as w}from"../context/provider";import{gaTrack as C}from"../../../helpers/track";import{cn as x}from"../../../helpers/utils";const G=({copy:s})=>{const[r,n]=u(null),{profile:p,gtm:m}=w(),o=({item:t,index:e})=>{C({event:"ga4Event",event_name:"lp_button",member_active_status:p?.activated?"active":"not active",event_parameters:{page_group:m.pageGroup,position:s.title,button_name:t.text,info:""}}),r===e?n(null):(n(e),setTimeout(()=>{n(null)},5e3))};return a(d,{id:"benefits",className:"!z-[30] bg-[#F5F5F7]",children:[i(c,{as:"h2",size:"4",html:s?.title}),i("div",{className:"mt-[24px] grid grid-cols-4 xl:grid-cols-3 gap-[16px] l:hidden items-stretch",children:s.benefits.map((t,e)=>i(l,{item:t,handleClick:o,isNoteActive:r===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:[f,g],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:s.benefits.map((t,e)=>i(b,{className:x("!h-auto !flex",r===e&&"!z-[100]"),children:i(l,{item:t,handleClick:o,isNoteActive:r===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`})]}),r&&i("div",{role:"button",tabIndex:0,className:"fixed inset-0 z-10",onClick:()=>n(null),onKeyDown:t=>t.key==="Escape"&&n(null)})]})};export{G 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 } from '../../../helpers/track'\nimport { cn } from '../../../helpers/utils'\n\ninterface CreditsBenefitsProps {\n copy: {\n title: string\n benefits: BenefitItemCopy[]\n }\n}\n\nexport const CreditsBenefits = ({ copy }: CreditsBenefitsProps) => {\n const [activeNoteIndex, setActiveNoteIndex] = useState<number | null>(null)\n const { profile, gtm } = useCreditsContext()\n\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": "AAiDM,cAAAA,EAYA,QAAAC,MAZA,oBAjDN,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,MAAe,yBACxB,OAAS,MAAAC,MAAU,yBASZ,MAAMC,EAAkB,CAAC,CAAE,KAAAC,CAAK,IAA4B,CACjE,KAAM,CAACC,EAAiBC,CAAkB,EAAIZ,EAAwB,IAAI,EACpE,CAAE,QAAAa,EAAS,IAAAC,CAAI,EAAIR,EAAkB,EAErCS,EAAc,CAAC,CAAE,KAAAC,EAAM,MAAAC,CAAM,IAAgD,CACjFV,EAAQ,CACN,MAAO,WACP,WAAY,YACZ,qBAAsBM,GAAS,UAAY,SAAW,aACtD,iBAAkB,CAChB,WAAYC,EAAI,UAChB,SAAUJ,EAAK,MACf,YAAaM,EAAK,KAClB,KAAM,EACR,CACF,CAAC,EACGL,IAAoBM,EACtBL,EAAmB,IAAI,GAEvBA,EAAmBK,CAAK,EACxB,WAAW,IAAM,CACfL,EAAmB,IAAI,CACzB,EAAG,GAAI,EAEX,EAEA,OACEf,EAACC,EAAA,CAAU,GAAG,WAAW,UAAU,uBACjC,UAAAF,EAACG,EAAA,CAAQ,GAAG,KAAK,KAAK,IAAI,KAAMW,GAAM,MAAO,EAC7Cd,EAAC,OAAI,UAAU,8EACZ,SAAAc,EAAK,SAAS,IAAI,CAACM,EAAMC,IACxBrB,EAACS,EAAA,CAEC,KAAMW,EACN,YAAaD,EACb,aAAcJ,IAAoBM,EAClC,MAAOA,GAJFA,CAKP,CACD,EACH,EACApB,EAAC,OAAI,UAAU,2BACb,UAAAD,EAACO,EAAA,CACC,aAAc,GACd,cAAe,EACf,eAAgB,EAChB,KAAM,CACJ,KAAM,EACN,KAAM,KACR,EACA,YAAa,CACX,IAAK,CACH,cAAe,EACf,eAAgB,CAClB,CACF,EACA,aAAa,iBACb,QAAS,CAACF,EAAMC,CAAU,EAC1B,WAAY,CACV,UAAW,GACX,GAAI,uBACJ,aAAae,EAAOC,EAAW,CAC7B,MAAO,eAAeA,CAAS;AAAA,qBAEjC,CACF,EAEC,SAAAR,EAAK,SAAS,IAAI,CAACM,EAAMC,IACxBrB,EAACQ,EAAA,CAAwB,UAAWI,EAAG,gBAAiBG,IAAoBM,GAAS,UAAU,EAC7F,SAAArB,EAACS,EAAA,CACC,KAAMW,EACN,YAAaD,EACb,aAAcJ,IAAoBM,EAClC,MAAOA,EACT,GANgBA,CAOlB,CACD,EACH,EACArB,EAAC,OACC,GAAG,sBACH,UAAU;AAAA,mGAEX,GACH,EAECe,GACCf,EAAC,OACC,KAAK,SACL,SAAU,EACV,UAAU,qBACV,QAAS,IAAMgB,EAAmB,IAAI,EACtC,UAAWO,GAAKA,EAAE,MAAQ,UAAYP,EAAmB,IAAI,EAC/D,GAEJ,CAEJ",
|
|
6
|
+
"names": ["jsx", "jsxs", "Container", "Heading", "useState", "Grid", "Pagination", "Swiper", "SwiperSlide", "BenefitItem", "useCreditsContext", "gaTrack", "cn", "CreditsBenefits", "copy", "activeNoteIndex", "setActiveNoteIndex", "profile", "gtm", "handleClick", "item", "index", "className", "e"]
|
|
7
|
+
}
|