@anker-in/campaign-ui 0.2.10-beta.9 → 0.2.11-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/chat/{chat-context.js → chatContext.js} +1 -1
- package/dist/cjs/components/chat/{chat-context.js.map → chatContext.js.map} +2 -2
- package/dist/cjs/components/chat/index.js +1 -1
- package/dist/cjs/components/chat/index.js.map +3 -3
- package/dist/cjs/components/credits/context/const.d.ts +2 -1
- package/dist/cjs/components/credits/context/const.js +1 -1
- package/dist/cjs/components/credits/context/const.js.map +2 -2
- package/dist/cjs/components/credits/context/hooks/useActivities.js +1 -1
- package/dist/cjs/components/credits/context/hooks/useActivities.js.map +3 -3
- package/dist/cjs/components/credits/context/hooks/useAddressValidate.js +1 -1
- package/dist/cjs/components/credits/context/hooks/useAddressValidate.js.map +3 -3
- package/dist/cjs/components/credits/context/hooks/useAlpcFetch.js +1 -1
- package/dist/cjs/components/credits/context/hooks/useAlpcFetch.js.map +3 -3
- package/dist/cjs/components/credits/context/hooks/useCountries.js +1 -1
- package/dist/cjs/components/credits/context/hooks/useCountries.js.map +3 -3
- package/dist/cjs/components/credits/context/hooks/useFunctionMemberPrice.d.ts +7 -0
- package/dist/cjs/components/credits/context/hooks/useFunctionMemberPrice.js +2 -0
- package/dist/cjs/components/credits/context/hooks/useFunctionMemberPrice.js.map +7 -0
- package/dist/cjs/components/credits/context/hooks/useMyRewards.js +1 -1
- package/dist/cjs/components/credits/context/hooks/useMyRewards.js.map +3 -3
- package/dist/cjs/components/credits/context/hooks/useRedeemAndBuy.d.ts +5 -10
- package/dist/cjs/components/credits/context/hooks/useRedeemAndBuy.js +1 -1
- package/dist/cjs/components/credits/context/hooks/useRedeemAndBuy.js.map +3 -3
- package/dist/cjs/components/credits/context/hooks/useRedeemCoupon.d.ts +2 -1
- package/dist/cjs/components/credits/context/hooks/useRedeemCoupon.js +1 -1
- package/dist/cjs/components/credits/context/hooks/useRedeemCoupon.js.map +3 -3
- package/dist/cjs/components/credits/context/hooks/useRedeemProduct.js +1 -1
- package/dist/cjs/components/credits/context/hooks/useRedeemProduct.js.map +3 -3
- package/dist/cjs/components/credits/context/hooks/useRedeemableList.js +1 -1
- package/dist/cjs/components/credits/context/hooks/useRedeemableList.js.map +3 -3
- package/dist/cjs/components/credits/context/hooks/useSendEmailValidation.js +1 -1
- package/dist/cjs/components/credits/context/hooks/useSendEmailValidation.js.map +3 -3
- package/dist/cjs/components/credits/context/hooks/useSubscribed.js +1 -1
- package/dist/cjs/components/credits/context/hooks/useSubscribed.js.map +3 -3
- package/dist/cjs/components/credits/context/hooks/useSubscriptions.d.ts +7 -3
- package/dist/cjs/components/credits/context/hooks/useSubscriptions.js +1 -1
- package/dist/cjs/components/credits/context/hooks/useSubscriptions.js.map +3 -3
- package/dist/cjs/components/credits/context/hooks/useUploadReceipt.js +1 -1
- package/dist/cjs/components/credits/context/hooks/useUploadReceipt.js.map +2 -2
- package/dist/cjs/components/credits/context/memberPriceConst.d.ts +10 -0
- package/dist/cjs/components/credits/context/memberPriceConst.js +2 -0
- package/dist/cjs/components/credits/context/memberPriceConst.js.map +7 -0
- package/dist/cjs/components/credits/context/memberPriceTypes.d.ts +46 -0
- package/dist/cjs/components/credits/context/memberPriceTypes.js +2 -0
- package/dist/cjs/components/credits/context/memberPriceTypes.js.map +7 -0
- package/dist/cjs/components/credits/context/provider.d.ts +11 -33
- package/dist/cjs/components/credits/context/provider.js +1 -1
- package/dist/cjs/components/credits/context/provider.js.map +3 -3
- package/dist/cjs/components/credits/context/utils/atobID.d.ts +1 -0
- package/dist/cjs/components/credits/context/utils/atobID.js +2 -0
- package/dist/cjs/components/credits/context/utils/atobID.js.map +7 -0
- package/dist/cjs/components/credits/context/utils/functionDiscountCalculate.d.ts +5 -0
- package/dist/cjs/components/credits/context/utils/functionDiscountCalculate.js +2 -0
- package/dist/cjs/components/credits/context/utils/functionDiscountCalculate.js.map +7 -0
- package/dist/cjs/components/credits/context/utils/getFunctionMemberPrice.d.ts +8 -0
- package/dist/cjs/components/credits/context/utils/getFunctionMemberPrice.js +2 -0
- package/dist/cjs/components/credits/context/utils/getFunctionMemberPrice.js.map +7 -0
- package/dist/cjs/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.d.ts +9 -0
- package/dist/cjs/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.js +2 -0
- package/dist/cjs/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.js.map +7 -0
- package/dist/cjs/components/credits/context/utils/variantGetCoupon.d.ts +6 -0
- package/dist/cjs/components/credits/context/utils/variantGetCoupon.js +2 -0
- package/dist/cjs/components/credits/context/utils/variantGetCoupon.js.map +7 -0
- package/dist/cjs/components/credits/context/utils.d.ts +4 -0
- package/dist/cjs/components/credits/context/utils.js +1 -1
- package/dist/cjs/components/credits/context/utils.js.map +3 -3
- package/dist/cjs/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.d.ts +4 -0
- package/dist/cjs/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.js +2 -0
- package/dist/cjs/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.js.map +7 -0
- package/dist/cjs/components/credits/creditsAnkersolixTask/index.d.ts +2 -0
- package/dist/cjs/components/credits/creditsAnkersolixTask/index.js +2 -0
- package/dist/cjs/components/credits/creditsAnkersolixTask/index.js.map +7 -0
- package/dist/cjs/components/credits/creditsAnkersolixTask/type.d.ts +1 -0
- package/dist/cjs/components/credits/creditsAnkersolixTask/type.js +2 -0
- package/dist/cjs/components/credits/creditsAnkersolixTask/type.js.map +7 -0
- package/dist/cjs/components/credits/creditsBanner/index.d.ts +17 -16
- 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 +4 -1
- 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/{credits-benefits → creditsBenefits}/iconInfo.js +1 -1
- package/dist/cjs/components/credits/{credits-benefits → creditsBenefits}/iconInfo.js.map +2 -2
- package/dist/cjs/components/credits/creditsBenefits/index.d.ts +12 -9
- 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/CreditsCash.d.ts +5 -0
- package/dist/cjs/components/credits/creditsCash/CreditsCash.js +2 -0
- package/dist/cjs/components/credits/creditsCash/CreditsCash.js.map +7 -0
- package/dist/cjs/components/credits/creditsCash/RedeemableItem.d.ts +1 -7
- 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 +2 -13
- 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 +2 -4
- 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.js +2 -0
- package/dist/cjs/components/credits/creditsFaq/faqItem/FaqItem.js.map +7 -0
- package/dist/cjs/components/credits/creditsFaq/index.d.ts +4 -3
- 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 +10 -15
- 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/creditsMemberPrice/CreditsMemberPrice.d.ts +5 -0
- package/dist/cjs/components/credits/creditsMemberPrice/CreditsMemberPrice.js +2 -0
- package/dist/cjs/components/credits/creditsMemberPrice/CreditsMemberPrice.js.map +7 -0
- package/dist/cjs/components/credits/creditsMemberPrice/MemberPriceItem.d.ts +7 -0
- package/dist/cjs/components/credits/creditsMemberPrice/MemberPriceItem.js +2 -0
- package/dist/cjs/components/credits/creditsMemberPrice/MemberPriceItem.js.map +7 -0
- package/dist/cjs/components/credits/creditsMemberPrice/Pagination.d.ts +7 -0
- package/dist/cjs/components/credits/creditsMemberPrice/Pagination.js +2 -0
- package/dist/cjs/components/credits/creditsMemberPrice/Pagination.js.map +7 -0
- package/dist/cjs/components/credits/creditsMemberPrice/index.d.ts +2 -0
- package/dist/cjs/components/credits/creditsMemberPrice/index.js +2 -0
- package/dist/cjs/components/credits/creditsMemberPrice/index.js.map +7 -0
- package/dist/cjs/components/credits/creditsMemberPrice/type.d.ts +64 -0
- package/dist/cjs/components/credits/creditsMemberPrice/type.js +2 -0
- package/dist/cjs/components/credits/creditsMemberPrice/type.js.map +7 -0
- package/dist/cjs/components/credits/creditsNavigation/CreditsNavigation.d.ts +4 -0
- package/dist/cjs/components/credits/creditsNavigation/CreditsNavigation.js +2 -0
- package/dist/cjs/components/credits/creditsNavigation/CreditsNavigation.js.map +7 -0
- package/dist/cjs/components/credits/creditsNavigation/index.d.ts +2 -0
- package/dist/cjs/components/credits/creditsNavigation/index.js +2 -0
- package/dist/cjs/components/credits/creditsNavigation/index.js.map +7 -0
- package/dist/cjs/components/credits/creditsNavigation/type.d.ts +7 -0
- package/dist/cjs/components/credits/creditsNavigation/type.js +2 -0
- package/dist/cjs/components/credits/creditsNavigation/type.js.map +7 -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/{credits-redeem-list/address-form/form-item.js → creditsRedeemList/AddressForm/FormItem.js} +1 -1
- package/dist/cjs/components/credits/{credits-redeem-list/address-form/form-item.js.map → creditsRedeemList/AddressForm/FormItem.js.map} +2 -2
- package/dist/cjs/components/credits/{credits-redeem-list/address-form → creditsRedeemList/AddressForm}/Input.js.map +1 -1
- 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.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/index.js.map +7 -0
- package/dist/cjs/components/credits/{credits-redeem-list/address-form → creditsRedeemList/AddressForm}/type.js.map +1 -1
- package/dist/cjs/components/credits/creditsRedeemList/CreditsRedeemList.d.ts +5 -0
- package/dist/cjs/components/credits/creditsRedeemList/CreditsRedeemList.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/CreditsRedeemList.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/NonProductValue.d.ts +4 -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.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.js.map +7 -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/{credits-redeem-list/redeem-product-modal → creditsRedeemList/RedeemProductModal}/Error.js +1 -1
- package/dist/cjs/components/credits/{credits-redeem-list/redeem-product-modal → creditsRedeemList/RedeemProductModal}/Error.js.map +3 -3
- 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.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js.map +7 -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.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.js.map +7 -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 +2 -13
- 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 +2 -15
- package/dist/cjs/components/credits/creditsRedeemList/type.js.map +7 -0
- package/dist/cjs/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.d.ts +4 -0
- package/dist/cjs/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js +2 -0
- package/dist/cjs/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js.map +7 -0
- package/dist/cjs/components/credits/creditsWaysToGetCredits/index.d.ts +2 -2
- 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 +5 -16
- 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 +11 -2
- 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/modal/MyRewardsModal.d.ts +4 -1
- package/dist/cjs/components/credits/modal/MyRewardsModal.js +1 -1
- package/dist/cjs/components/credits/modal/MyRewardsModal.js.map +3 -3
- package/dist/cjs/components/credits/modal/activitiesModal.d.ts +4 -1
- package/dist/cjs/components/credits/modal/activitiesModal.js +1 -1
- package/dist/cjs/components/credits/modal/activitiesModal.js.map +3 -3
- package/dist/cjs/components/credits/modal/creditsUploadReceiptModal.js +1 -1
- package/dist/cjs/components/credits/modal/creditsUploadReceiptModal.js.map +3 -3
- package/dist/cjs/components/credits/modal/loadingDots.d.ts +2 -1
- package/dist/cjs/components/credits/modal/loadingDots.js +1 -1
- package/dist/cjs/components/credits/modal/loadingDots.js.map +3 -3
- package/dist/cjs/components/credits/modal/modalContainer.js +1 -1
- package/dist/cjs/components/credits/modal/modalContainer.js.map +3 -3
- package/dist/cjs/components/credits/modal/rulesModal.js +1 -1
- package/dist/cjs/components/credits/modal/rulesModal.js.map +3 -3
- package/dist/cjs/components/credits/modal/subscribeModal.d.ts +15 -0
- package/dist/cjs/components/credits/modal/subscribeModal.js +2 -0
- package/dist/cjs/components/credits/modal/subscribeModal.js.map +7 -0
- package/dist/cjs/components/credits/modal/tip.js +1 -1
- package/dist/cjs/components/credits/modal/tip.js.map +3 -3
- package/dist/cjs/components/credits/type.d.ts +24 -5
- package/dist/cjs/components/credits/type.js +1 -1
- package/dist/cjs/components/credits/type.js.map +1 -1
- package/dist/cjs/components/index.d.ts +2 -1
- package/dist/cjs/components/index.js +1 -1
- package/dist/cjs/components/index.js.map +2 -2
- 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 +22 -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/context/index.d.ts +1 -0
- package/dist/cjs/components/registration/context/index.js +2 -0
- package/dist/cjs/components/registration/context/index.js.map +7 -0
- package/dist/cjs/components/registration/context/provider.d.ts +27 -0
- package/dist/cjs/components/registration/context/provider.js +2 -0
- package/dist/cjs/components/registration/context/provider.js.map +7 -0
- package/dist/cjs/components/registration/index.d.ts +2 -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 +14 -0
- package/dist/cjs/components/registration/modalContainer.js +2 -0
- package/dist/cjs/components/registration/modalContainer.js.map +7 -0
- package/dist/cjs/constants.d.ts +1 -0
- package/dist/cjs/constants.js +2 -0
- package/dist/cjs/constants.js.map +7 -0
- package/dist/cjs/debug-env.js +2 -0
- package/dist/cjs/debug-env.js.map +7 -0
- package/dist/cjs/helpers/fetcher.d.ts +1 -1
- package/dist/cjs/helpers/fetcher.js +1 -1
- package/dist/cjs/helpers/fetcher.js.map +3 -3
- 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 +6 -2
- package/dist/cjs/helpers/track.js +1 -1
- package/dist/cjs/helpers/track.js.map +3 -3
- package/dist/cjs/index.d.ts +3 -2
- package/dist/cjs/index.js +1 -726
- package/dist/cjs/index.js.map +4 -4
- package/dist/cjs/stories/chat.stories.js +2 -0
- package/dist/cjs/stories/chat.stories.js.map +7 -0
- package/dist/cjs/templates/credits.d.ts +73 -0
- package/dist/cjs/templates/credits.js +2 -0
- package/dist/cjs/templates/credits.js.map +7 -0
- package/dist/cjs/templates/index.d.ts +1 -0
- package/dist/cjs/templates/index.js +2 -0
- package/dist/cjs/templates/index.js.map +7 -0
- package/dist/esm/components/chat/index.js +1 -1
- package/dist/esm/components/chat/index.js.map +2 -2
- package/dist/esm/components/credits/context/const.d.ts +2 -1
- package/dist/esm/components/credits/context/const.js +1 -1
- package/dist/esm/components/credits/context/const.js.map +2 -2
- package/dist/esm/components/credits/context/hooks/useActivities.js +1 -1
- package/dist/esm/components/credits/context/hooks/useActivities.js.map +3 -3
- package/dist/esm/components/credits/context/hooks/useAddressValidate.js +1 -1
- package/dist/esm/components/credits/context/hooks/useAddressValidate.js.map +3 -3
- package/dist/esm/components/credits/context/hooks/useAlpcFetch.js +1 -1
- package/dist/esm/components/credits/context/hooks/useAlpcFetch.js.map +3 -3
- package/dist/esm/components/credits/context/hooks/useCountries.js +1 -1
- package/dist/esm/components/credits/context/hooks/useCountries.js.map +3 -3
- package/dist/esm/components/credits/context/hooks/useFunctionMemberPrice.d.ts +7 -0
- package/dist/esm/components/credits/context/hooks/useFunctionMemberPrice.js +2 -0
- package/dist/esm/components/credits/context/hooks/useFunctionMemberPrice.js.map +7 -0
- package/dist/esm/components/credits/context/hooks/useMyRewards.js +1 -1
- package/dist/esm/components/credits/context/hooks/useMyRewards.js.map +3 -3
- package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.d.ts +5 -10
- package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.js +1 -1
- package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.js.map +3 -3
- package/dist/esm/components/credits/context/hooks/useRedeemCoupon.d.ts +2 -1
- package/dist/esm/components/credits/context/hooks/useRedeemCoupon.js +1 -1
- package/dist/esm/components/credits/context/hooks/useRedeemCoupon.js.map +3 -3
- package/dist/esm/components/credits/context/hooks/useRedeemProduct.js +1 -1
- package/dist/esm/components/credits/context/hooks/useRedeemProduct.js.map +3 -3
- package/dist/esm/components/credits/context/hooks/useRedeemableList.js +1 -1
- package/dist/esm/components/credits/context/hooks/useRedeemableList.js.map +3 -3
- package/dist/esm/components/credits/context/hooks/useSendEmailValidation.js +1 -1
- package/dist/esm/components/credits/context/hooks/useSendEmailValidation.js.map +3 -3
- package/dist/esm/components/credits/context/hooks/useSubscribed.js +1 -1
- package/dist/esm/components/credits/context/hooks/useSubscribed.js.map +3 -3
- package/dist/esm/components/credits/context/hooks/useSubscriptions.d.ts +7 -3
- package/dist/esm/components/credits/context/hooks/useSubscriptions.js +1 -1
- package/dist/esm/components/credits/context/hooks/useSubscriptions.js.map +3 -3
- package/dist/esm/components/credits/context/hooks/useUploadReceipt.js +1 -1
- package/dist/esm/components/credits/context/hooks/useUploadReceipt.js.map +2 -2
- package/dist/esm/components/credits/context/memberPriceConst.d.ts +10 -0
- package/dist/esm/components/credits/context/memberPriceConst.js +2 -0
- package/dist/esm/components/credits/context/memberPriceConst.js.map +7 -0
- package/dist/esm/components/credits/context/memberPriceTypes.d.ts +46 -0
- package/dist/esm/components/credits/context/memberPriceTypes.js +1 -0
- package/dist/esm/components/credits/context/provider.d.ts +11 -33
- package/dist/esm/components/credits/context/provider.js +1 -1
- package/dist/esm/components/credits/context/provider.js.map +3 -3
- package/dist/esm/components/credits/context/utils/atobID.d.ts +1 -0
- package/dist/esm/components/credits/context/utils/atobID.js +2 -0
- package/dist/esm/components/credits/context/utils/atobID.js.map +7 -0
- package/dist/esm/components/credits/context/utils/functionDiscountCalculate.d.ts +5 -0
- package/dist/esm/components/credits/context/utils/functionDiscountCalculate.js +2 -0
- package/dist/esm/components/credits/context/utils/functionDiscountCalculate.js.map +7 -0
- package/dist/esm/components/credits/context/utils/getFunctionMemberPrice.d.ts +8 -0
- package/dist/esm/components/credits/context/utils/getFunctionMemberPrice.js +2 -0
- package/dist/esm/components/credits/context/utils/getFunctionMemberPrice.js.map +7 -0
- package/dist/esm/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.d.ts +9 -0
- package/dist/esm/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.js +2 -0
- package/dist/esm/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.js.map +7 -0
- package/dist/esm/components/credits/context/utils/variantGetCoupon.d.ts +6 -0
- package/dist/esm/components/credits/context/utils/variantGetCoupon.js +2 -0
- package/dist/esm/components/credits/context/utils/variantGetCoupon.js.map +7 -0
- package/dist/esm/components/credits/context/utils.d.ts +4 -0
- package/dist/esm/components/credits/context/utils.js +1 -1
- package/dist/esm/components/credits/context/utils.js.map +3 -3
- package/dist/esm/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.d.ts +4 -0
- package/dist/esm/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.js +2 -0
- package/dist/esm/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.js.map +7 -0
- package/dist/esm/components/credits/creditsAnkersolixTask/index.d.ts +2 -0
- package/dist/esm/components/credits/creditsAnkersolixTask/index.js +2 -0
- package/dist/esm/components/credits/creditsAnkersolixTask/index.js.map +7 -0
- package/dist/esm/components/credits/creditsAnkersolixTask/type.d.ts +1 -0
- package/dist/esm/components/credits/creditsAnkersolixTask/type.js +2 -0
- package/dist/esm/components/credits/creditsAnkersolixTask/type.js.map +7 -0
- package/dist/esm/components/credits/creditsBanner/index.d.ts +17 -16
- package/dist/esm/components/credits/creditsBanner/index.js +1 -1
- package/dist/esm/components/credits/creditsBanner/index.js.map +3 -3
- package/dist/esm/components/credits/creditsBenefits/benefitItem.d.ts +4 -1
- package/dist/esm/components/credits/creditsBenefits/benefitItem.js +2 -2
- package/dist/esm/components/credits/creditsBenefits/benefitItem.js.map +4 -4
- package/dist/esm/components/credits/creditsBenefits/iconInfo.js +1 -1
- package/dist/esm/components/credits/creditsBenefits/iconInfo.js.map +2 -2
- package/dist/esm/components/credits/creditsBenefits/index.d.ts +12 -9
- package/dist/esm/components/credits/creditsBenefits/index.js +3 -3
- package/dist/esm/components/credits/creditsBenefits/index.js.map +3 -3
- package/dist/esm/components/credits/creditsCash/CreditsCash.d.ts +5 -0
- package/dist/esm/components/credits/creditsCash/CreditsCash.js +2 -0
- package/dist/esm/components/credits/creditsCash/CreditsCash.js.map +7 -0
- package/dist/esm/components/credits/creditsCash/RedeemableItem.d.ts +1 -7
- package/dist/esm/components/credits/creditsCash/RedeemableItem.js +1 -1
- package/dist/esm/components/credits/creditsCash/RedeemableItem.js.map +3 -3
- package/dist/esm/components/credits/creditsCash/index.d.ts +2 -13
- package/dist/esm/components/credits/creditsCash/index.js +1 -1
- package/dist/esm/components/credits/creditsCash/index.js.map +4 -4
- package/dist/esm/components/credits/creditsCash/type.d.ts +2 -4
- package/dist/esm/components/credits/creditsFaq/faqItem/FaqItem.js +1 -1
- package/dist/esm/components/credits/creditsFaq/faqItem/FaqItem.js.map +2 -2
- package/dist/esm/components/credits/creditsFaq/index.d.ts +4 -3
- package/dist/esm/components/credits/creditsFaq/index.js +1 -1
- package/dist/esm/components/credits/creditsFaq/index.js.map +3 -3
- package/dist/esm/components/credits/creditsInfoCard/index.d.ts +10 -15
- package/dist/esm/components/credits/creditsInfoCard/index.js +1 -1
- package/dist/esm/components/credits/creditsInfoCard/index.js.map +3 -3
- package/dist/esm/components/credits/creditsMemberPrice/CreditsMemberPrice.d.ts +5 -0
- package/dist/esm/components/credits/creditsMemberPrice/CreditsMemberPrice.js +2 -0
- package/dist/esm/components/credits/creditsMemberPrice/CreditsMemberPrice.js.map +7 -0
- package/dist/esm/components/credits/creditsMemberPrice/MemberPriceItem.d.ts +7 -0
- package/dist/esm/components/credits/creditsMemberPrice/MemberPriceItem.js +2 -0
- package/dist/esm/components/credits/creditsMemberPrice/MemberPriceItem.js.map +7 -0
- package/dist/esm/components/credits/creditsMemberPrice/Pagination.d.ts +7 -0
- package/dist/esm/components/credits/creditsMemberPrice/Pagination.js +2 -0
- package/dist/esm/components/credits/creditsMemberPrice/Pagination.js.map +7 -0
- package/dist/esm/components/credits/creditsMemberPrice/index.d.ts +2 -0
- package/dist/esm/components/credits/creditsMemberPrice/index.js +2 -0
- package/dist/esm/components/credits/creditsMemberPrice/index.js.map +7 -0
- package/dist/esm/components/credits/creditsMemberPrice/type.d.ts +64 -0
- package/dist/esm/components/credits/creditsNavigation/CreditsNavigation.d.ts +4 -0
- package/dist/esm/components/credits/creditsNavigation/CreditsNavigation.js +2 -0
- package/dist/esm/components/credits/creditsNavigation/CreditsNavigation.js.map +7 -0
- package/dist/esm/components/credits/creditsNavigation/index.d.ts +2 -0
- package/dist/esm/components/credits/creditsNavigation/index.js +2 -0
- package/dist/esm/components/credits/creditsNavigation/index.js.map +7 -0
- package/dist/esm/components/credits/creditsNavigation/type.d.ts +7 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/CountrySelect.js +1 -1
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/CountrySelect.js.map +3 -3
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/StateSelect.js +1 -1
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/StateSelect.js.map +3 -3
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/index.js +1 -1
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/index.js.map +3 -3
- package/dist/esm/components/credits/creditsRedeemList/CreditsRedeemList.d.ts +5 -0
- package/dist/esm/components/credits/creditsRedeemList/CreditsRedeemList.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/CreditsRedeemList.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/NonProductValue.d.ts +4 -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.js +1 -1
- package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.js.map +3 -3
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.js +1 -1
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.js.map +3 -3
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Error.js +1 -1
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Error.js.map +2 -2
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.js +1 -1
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.js.map +3 -3
- 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.js +1 -1
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js.map +3 -3
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.js +1 -1
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.js.map +3 -3
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.js +1 -1
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.js.map +3 -3
- package/dist/esm/components/credits/creditsRedeemList/RedeemableItem.js +1 -1
- package/dist/esm/components/credits/creditsRedeemList/RedeemableItem.js.map +3 -3
- package/dist/esm/components/credits/creditsRedeemList/index.d.ts +2 -13
- package/dist/esm/components/credits/creditsRedeemList/index.js +1 -1
- package/dist/esm/components/credits/creditsRedeemList/index.js.map +4 -4
- package/dist/esm/components/credits/creditsRedeemList/type.d.ts +2 -15
- package/dist/esm/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.d.ts +4 -0
- package/dist/esm/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js +2 -0
- package/dist/esm/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js.map +7 -0
- package/dist/esm/components/credits/creditsWaysToGetCredits/index.d.ts +2 -2
- package/dist/esm/components/credits/creditsWaysToGetCredits/index.js +1 -1
- package/dist/esm/components/credits/creditsWaysToGetCredits/index.js.map +4 -4
- package/dist/esm/components/credits/creditsWaysToGetCredits/type.d.ts +5 -16
- package/dist/esm/components/credits/creditsWaysToGetCredits/type.js +1 -1
- package/dist/esm/components/credits/creditsWaysToGetCredits/type.js.map +2 -2
- package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.d.ts +11 -2
- package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.js +1 -1
- package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.js.map +3 -3
- package/dist/esm/components/credits/modal/MyRewardsModal.d.ts +4 -1
- package/dist/esm/components/credits/modal/MyRewardsModal.js +1 -1
- package/dist/esm/components/credits/modal/MyRewardsModal.js.map +3 -3
- package/dist/esm/components/credits/modal/activitiesModal.d.ts +4 -1
- package/dist/esm/components/credits/modal/activitiesModal.js +1 -1
- package/dist/esm/components/credits/modal/activitiesModal.js.map +3 -3
- package/dist/esm/components/credits/modal/creditsUploadReceiptModal.js +1 -1
- package/dist/esm/components/credits/modal/creditsUploadReceiptModal.js.map +3 -3
- package/dist/esm/components/credits/modal/loadingDots.d.ts +2 -1
- package/dist/esm/components/credits/modal/loadingDots.js +1 -1
- package/dist/esm/components/credits/modal/loadingDots.js.map +3 -3
- package/dist/esm/components/credits/modal/modalContainer.js +1 -1
- package/dist/esm/components/credits/modal/modalContainer.js.map +3 -3
- package/dist/esm/components/credits/modal/rulesModal.js +1 -1
- package/dist/esm/components/credits/modal/rulesModal.js.map +2 -2
- package/dist/esm/components/credits/modal/subscribeModal.d.ts +15 -0
- package/dist/esm/components/credits/modal/subscribeModal.js +2 -0
- package/dist/esm/components/credits/modal/subscribeModal.js.map +7 -0
- package/dist/esm/components/credits/modal/tip.js +1 -1
- package/dist/esm/components/credits/modal/tip.js.map +3 -3
- package/dist/esm/components/credits/type.d.ts +24 -5
- package/dist/esm/components/index.d.ts +2 -1
- 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 +22 -0
- package/dist/esm/components/registration/authCodeActivate/type.js.map +7 -0
- package/dist/esm/components/registration/context/index.d.ts +1 -0
- package/dist/esm/components/registration/context/index.js +2 -0
- package/dist/esm/components/registration/context/index.js.map +7 -0
- package/dist/esm/components/registration/context/provider.d.ts +27 -0
- package/dist/esm/components/registration/context/provider.js +2 -0
- package/dist/esm/components/registration/context/provider.js.map +7 -0
- package/dist/esm/components/registration/index.d.ts +2 -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 +14 -0
- package/dist/esm/components/registration/modalContainer.js +2 -0
- package/dist/esm/components/registration/modalContainer.js.map +7 -0
- package/dist/esm/constants.d.ts +1 -0
- package/dist/esm/constants.js +2 -0
- package/dist/esm/constants.js.map +7 -0
- package/dist/esm/helpers/fetcher.d.ts +1 -1
- package/dist/esm/helpers/fetcher.js +1 -1
- package/dist/esm/helpers/fetcher.js.map +3 -3
- 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 +6 -2
- package/dist/esm/helpers/track.js +1 -1
- package/dist/esm/helpers/track.js.map +3 -3
- package/dist/esm/index.d.ts +3 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/templates/credits.d.ts +73 -0
- package/dist/esm/templates/credits.js +2 -0
- package/dist/esm/templates/credits.js.map +7 -0
- package/dist/esm/templates/index.d.ts +1 -0
- package/dist/esm/templates/index.js +2 -0
- package/dist/esm/templates/index.js.map +7 -0
- package/package.json +25 -22
- package/src/components/chat/index.tsx +1 -1
- package/src/components/credits/context/const.ts +1 -0
- package/src/components/credits/context/hooks/useActivities.ts +4 -3
- package/src/components/credits/context/hooks/useAddressValidate.ts +2 -2
- package/src/components/credits/context/hooks/useAlpcFetch.ts +14 -10
- package/src/components/credits/context/hooks/useCountries.ts +2 -2
- package/src/components/credits/context/hooks/useFunctionMemberPrice.ts +33 -0
- package/src/components/credits/context/hooks/useMyRewards.ts +4 -3
- package/src/components/credits/context/hooks/useRedeemAndBuy.ts +21 -24
- package/src/components/credits/context/hooks/useRedeemCoupon.ts +7 -3
- package/src/components/credits/context/hooks/useRedeemProduct.ts +5 -2
- package/src/components/credits/context/hooks/useRedeemableList.ts +4 -18
- package/src/components/credits/context/hooks/useSubscribed.ts +6 -7
- package/src/components/credits/context/hooks/useUploadReceipt.tsx +0 -1
- package/src/components/credits/context/memberPriceConst.ts +13 -0
- package/src/components/credits/context/memberPriceTypes.ts +54 -0
- package/src/components/credits/context/provider.tsx +25 -20
- package/src/components/credits/context/utils/atobID.ts +8 -0
- package/src/components/credits/context/utils/functionDiscountCalculate.ts +57 -0
- package/src/components/credits/context/utils/getFunctionMemberPrice.ts +135 -0
- package/src/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.ts +51 -0
- package/src/components/credits/context/utils/variantGetCoupon.ts +34 -0
- package/src/components/credits/context/utils.ts +9 -0
- package/src/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.tsx +273 -0
- package/src/components/credits/creditsAnkersolixTask/index.ts +2 -0
- package/src/components/credits/creditsAnkersolixTask/type.ts +7 -0
- package/src/components/credits/creditsBanner/index.tsx +16 -18
- package/src/components/credits/creditsBenefits/BenefitItem.tsx +108 -0
- package/src/components/credits/creditsBenefits/index.tsx +20 -15
- package/src/components/credits/creditsCash/CreditsCash.tsx +84 -0
- package/src/components/credits/creditsCash/RedeemableItem.tsx +66 -44
- package/src/components/credits/creditsCash/index.ts +2 -0
- package/src/components/credits/creditsCash/type.ts +2 -4
- package/src/components/credits/creditsFaq/faqItem/FaqItem.tsx +12 -12
- package/src/components/credits/creditsFaq/index.tsx +9 -6
- package/src/components/credits/creditsInfoCard/index.tsx +43 -36
- package/src/components/credits/creditsMemberPrice/CreditsMemberPrice.tsx +314 -0
- package/src/components/credits/creditsMemberPrice/MemberPriceItem.tsx +181 -0
- package/src/components/credits/creditsMemberPrice/Pagination.tsx +113 -0
- package/src/components/credits/creditsMemberPrice/index.ts +2 -0
- package/src/components/credits/creditsMemberPrice/type.ts +75 -0
- package/src/components/credits/creditsNavigation/CreditsNavigation.tsx +123 -0
- package/src/components/credits/creditsNavigation/index.ts +2 -0
- package/src/components/credits/creditsNavigation/type.ts +10 -0
- package/src/components/credits/creditsRedeemList/AddressForm/CountrySelect.tsx +8 -3
- package/src/components/credits/creditsRedeemList/AddressForm/StateSelect.tsx +6 -1
- package/src/components/credits/creditsRedeemList/AddressForm/index.tsx +6 -5
- package/src/components/credits/creditsRedeemList/{index.tsx → CreditsRedeemList.tsx} +31 -35
- package/src/components/credits/creditsRedeemList/NonProductValue.tsx +39 -0
- package/src/components/credits/creditsRedeemList/RedeemCouponModal.tsx +11 -13
- package/src/components/credits/creditsRedeemList/RedeemProductModal/Address.tsx +15 -11
- package/src/components/credits/creditsRedeemList/RedeemProductModal/Error.tsx +1 -1
- package/src/components/credits/creditsRedeemList/RedeemProductModal/Init.tsx +6 -12
- package/src/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.tsx +25 -0
- package/src/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.tsx +11 -7
- package/src/components/credits/creditsRedeemList/RedeemProductModal/Success.tsx +5 -1
- package/src/components/credits/creditsRedeemList/RedeemProductModal/index.tsx +4 -5
- package/src/components/credits/creditsRedeemList/RedeemableItem.tsx +24 -32
- package/src/components/credits/creditsRedeemList/index.ts +2 -0
- package/src/components/credits/creditsRedeemList/type.ts +2 -16
- package/src/components/credits/creditsWaysToGetCredits/{index.tsx → CreditsWaysToGetCredits.tsx} +79 -20
- package/src/components/credits/creditsWaysToGetCredits/index.ts +2 -0
- package/src/components/credits/creditsWaysToGetCredits/type.ts +5 -16
- package/src/components/credits/creditsWaysToGetCredits/useActions.ts +24 -10
- package/src/components/credits/modal/MyRewardsModal.tsx +84 -63
- package/src/components/credits/modal/activitiesModal.tsx +62 -46
- package/src/components/credits/modal/creditsUploadReceiptModal.tsx +10 -1
- package/src/components/credits/modal/loadingDots.tsx +9 -7
- package/src/components/credits/modal/modalContainer.tsx +6 -1
- package/src/components/credits/modal/rulesModal.tsx +1 -1
- package/src/components/credits/modal/subscribeModal.tsx +202 -0
- package/src/components/credits/modal/tip.tsx +11 -1
- package/src/components/credits/type.ts +24 -5
- package/src/components/index.ts +3 -3
- package/src/components/registration/authCodeActivate/Message.tsx +43 -0
- package/src/components/registration/authCodeActivate/index.tsx +338 -0
- package/src/components/registration/authCodeActivate/type.ts +23 -0
- package/src/components/registration/context/index.tsx +1 -0
- package/src/components/registration/context/provider.tsx +86 -0
- package/src/components/registration/index.ts +2 -0
- package/src/components/registration/modalContainer.tsx +115 -0
- package/src/constants.ts +1 -0
- package/src/index.ts +3 -4
- package/src/styles/global.css +15 -0
- package/src/templates/Credits.tsx +165 -0
- package/src/templates/index.ts +1 -0
- package/style.css +1 -0
- package/tailwind.config.ts +10 -0
- package/dist/cjs/components/chat/chat-context.d.ts +0 -101
- package/dist/cjs/components/credits/credits-banner/index.d.ts +0 -23
- package/dist/cjs/components/credits/credits-banner/index.js +0 -2
- package/dist/cjs/components/credits/credits-banner/index.js.map +0 -7
- package/dist/cjs/components/credits/credits-benefits/benefitItem.d.ts +0 -19
- package/dist/cjs/components/credits/credits-benefits/benefitItem.js +0 -2
- package/dist/cjs/components/credits/credits-benefits/benefitItem.js.map +0 -7
- package/dist/cjs/components/credits/credits-benefits/iconInfo.d.ts +0 -2
- package/dist/cjs/components/credits/credits-benefits/index.d.ts +0 -12
- package/dist/cjs/components/credits/credits-benefits/index.js +0 -4
- package/dist/cjs/components/credits/credits-benefits/index.js.map +0 -7
- package/dist/cjs/components/credits/credits-cash/RedeemableItem.d.ts +0 -15
- package/dist/cjs/components/credits/credits-cash/RedeemableItem.js +0 -2
- package/dist/cjs/components/credits/credits-cash/RedeemableItem.js.map +0 -7
- package/dist/cjs/components/credits/credits-cash/index.d.ts +0 -13
- package/dist/cjs/components/credits/credits-cash/index.js +0 -2
- package/dist/cjs/components/credits/credits-cash/index.js.map +0 -7
- package/dist/cjs/components/credits/credits-cash/type.d.ts +0 -47
- package/dist/cjs/components/credits/credits-cash/type.js +0 -2
- package/dist/cjs/components/credits/credits-cash/type.js.map +0 -7
- package/dist/cjs/components/credits/credits-faq/faq-item/FaqItem.d.ts +0 -13
- package/dist/cjs/components/credits/credits-faq/faq-item/faq-item.d.ts +0 -13
- package/dist/cjs/components/credits/credits-faq/faq-item/faq-item.js +0 -2
- package/dist/cjs/components/credits/credits-faq/faq-item/faq-item.js.map +0 -7
- package/dist/cjs/components/credits/credits-faq/faqItem/FaqItem.d.ts +0 -13
- package/dist/cjs/components/credits/credits-faq/index.d.ts +0 -16
- package/dist/cjs/components/credits/credits-faq/index.js +0 -2
- package/dist/cjs/components/credits/credits-faq/index.js.map +0 -7
- package/dist/cjs/components/credits/credits-info-card/index.d.ts +0 -20
- package/dist/cjs/components/credits/credits-info-card/index.js +0 -2
- package/dist/cjs/components/credits/credits-info-card/index.js.map +0 -7
- package/dist/cjs/components/credits/credits-redeem-list/AddressForm/Input.d.ts +0 -13
- package/dist/cjs/components/credits/credits-redeem-list/AddressForm/country-select.d.ts +0 -14
- package/dist/cjs/components/credits/credits-redeem-list/AddressForm/form-item.d.ts +0 -6
- package/dist/cjs/components/credits/credits-redeem-list/AddressForm/index.d.ts +0 -2
- package/dist/cjs/components/credits/credits-redeem-list/AddressForm/state-select.d.ts +0 -15
- package/dist/cjs/components/credits/credits-redeem-list/AddressForm/type.d.ts +0 -26
- package/dist/cjs/components/credits/credits-redeem-list/RedeemCouponModal.d.ts +0 -9
- package/dist/cjs/components/credits/credits-redeem-list/RedeemProductModal/Address.d.ts +0 -20
- package/dist/cjs/components/credits/credits-redeem-list/RedeemProductModal/Error.d.ts +0 -8
- package/dist/cjs/components/credits/credits-redeem-list/RedeemProductModal/Init.d.ts +0 -11
- package/dist/cjs/components/credits/credits-redeem-list/RedeemProductModal/ProductInfo.d.ts +0 -8
- package/dist/cjs/components/credits/credits-redeem-list/RedeemProductModal/Success.d.ts +0 -13
- package/dist/cjs/components/credits/credits-redeem-list/RedeemProductModal/index.d.ts +0 -11
- package/dist/cjs/components/credits/credits-redeem-list/RedeemableItem.d.ts +0 -9
- package/dist/cjs/components/credits/credits-redeem-list/RedeemableItem.js +0 -2
- package/dist/cjs/components/credits/credits-redeem-list/RedeemableItem.js.map +0 -7
- package/dist/cjs/components/credits/credits-redeem-list/address-form/Input.d.ts +0 -13
- package/dist/cjs/components/credits/credits-redeem-list/address-form/country-select.d.ts +0 -14
- package/dist/cjs/components/credits/credits-redeem-list/address-form/country-select.js +0 -2
- package/dist/cjs/components/credits/credits-redeem-list/address-form/country-select.js.map +0 -7
- package/dist/cjs/components/credits/credits-redeem-list/address-form/form-item.d.ts +0 -6
- package/dist/cjs/components/credits/credits-redeem-list/address-form/index.d.ts +0 -2
- package/dist/cjs/components/credits/credits-redeem-list/address-form/index.js +0 -2
- package/dist/cjs/components/credits/credits-redeem-list/address-form/index.js.map +0 -7
- package/dist/cjs/components/credits/credits-redeem-list/address-form/state-select.d.ts +0 -15
- package/dist/cjs/components/credits/credits-redeem-list/address-form/state-select.js +0 -2
- package/dist/cjs/components/credits/credits-redeem-list/address-form/state-select.js.map +0 -7
- package/dist/cjs/components/credits/credits-redeem-list/address-form/type.d.ts +0 -26
- package/dist/cjs/components/credits/credits-redeem-list/index.d.ts +0 -13
- package/dist/cjs/components/credits/credits-redeem-list/index.js +0 -2
- package/dist/cjs/components/credits/credits-redeem-list/index.js.map +0 -7
- package/dist/cjs/components/credits/credits-redeem-list/redeem-coupon-modal.d.ts +0 -9
- package/dist/cjs/components/credits/credits-redeem-list/redeem-coupon-modal.js +0 -2
- package/dist/cjs/components/credits/credits-redeem-list/redeem-coupon-modal.js.map +0 -7
- package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Address.d.ts +0 -20
- package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Address.js +0 -2
- package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Address.js.map +0 -7
- package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Error.d.ts +0 -8
- package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Init.d.ts +0 -11
- package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Init.js +0 -2
- package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Init.js.map +0 -7
- package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/ProductInfo.d.ts +0 -8
- package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/ProductInfo.js +0 -2
- package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/ProductInfo.js.map +0 -7
- package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Success.d.ts +0 -13
- package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Success.js +0 -2
- package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Success.js.map +0 -7
- package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/index.d.ts +0 -11
- package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/index.js +0 -2
- package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/index.js.map +0 -7
- package/dist/cjs/components/credits/credits-redeem-list/type.d.ts +0 -77
- package/dist/cjs/components/credits/credits-redeem-list/type.js.map +0 -7
- package/dist/cjs/components/credits/credits-ways-to-get-credits/index.d.ts +0 -2
- package/dist/cjs/components/credits/credits-ways-to-get-credits/index.js +0 -2
- package/dist/cjs/components/credits/credits-ways-to-get-credits/index.js.map +0 -7
- package/dist/cjs/components/credits/credits-ways-to-get-credits/type.d.ts +0 -60
- package/dist/cjs/components/credits/credits-ways-to-get-credits/type.js +0 -2
- package/dist/cjs/components/credits/credits-ways-to-get-credits/type.js.map +0 -7
- package/dist/cjs/components/credits/credits-ways-to-get-credits/useActions.d.ts +0 -96
- package/dist/cjs/components/credits/credits-ways-to-get-credits/useActions.js +0 -2
- package/dist/cjs/components/credits/credits-ways-to-get-credits/useActions.js.map +0 -7
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/country-select.d.ts +0 -14
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/form-item.d.ts +0 -6
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/state-select.d.ts +0 -15
- package/dist/cjs/index.css +0 -2
- package/dist/cjs/index.css.map +0 -7
- package/dist/cjs/shopify/context/ShopifyProvider.d.ts +0 -10
- package/dist/cjs/shopify/context/index.d.ts +0 -1
- package/dist/cjs/shopify/context/shopify-provider.d.ts +0 -10
- package/dist/cjs/shopify/fetchers/create-cart.d.ts +0 -12
- package/dist/cjs/shopify/fetchers/get-products-by-handles.d.ts +0 -7
- package/dist/cjs/shopify/fetchers/index.d.ts +0 -2
- package/dist/cjs/shopify/fragments/article.d.ts +0 -2
- package/dist/cjs/shopify/fragments/blog.d.ts +0 -1
- package/dist/cjs/shopify/fragments/cart.d.ts +0 -1
- package/dist/cjs/shopify/fragments/collection.d.ts +0 -1
- package/dist/cjs/shopify/fragments/image.d.ts +0 -1
- package/dist/cjs/shopify/fragments/index.d.ts +0 -11
- package/dist/cjs/shopify/fragments/metafields.d.ts +0 -2
- package/dist/cjs/shopify/fragments/page-info.d.ts +0 -1
- package/dist/cjs/shopify/fragments/page.d.ts +0 -1
- package/dist/cjs/shopify/fragments/product.d.ts +0 -1
- package/dist/cjs/shopify/fragments/seo.d.ts +0 -1
- package/dist/cjs/shopify/fragments/variant.d.ts +0 -1
- package/dist/cjs/shopify/gql/fragment-masking.d.ts +0 -15
- package/dist/cjs/shopify/gql/gql.d.ts +0 -87
- package/dist/cjs/shopify/gql/graphql.d.ts +0 -7669
- package/dist/cjs/shopify/gql/index.d.ts +0 -3
- package/dist/cjs/shopify/hooks/index.d.ts +0 -2
- package/dist/cjs/shopify/hooks/use-create-cart.d.ts +0 -2
- package/dist/cjs/shopify/hooks/use-products-by-handles.d.ts +0 -4
- package/dist/cjs/shopify/hooks/useCreateCart.d.ts +0 -2
- package/dist/cjs/shopify/hooks/useProductsByHandles.d.ts +0 -4
- package/dist/cjs/shopify/mutations/create-cart.d.ts +0 -1
- package/dist/cjs/shopify/queries/get-product-by-handles.d.ts +0 -1
- package/dist/cjs/shopify/queries/index.d.ts +0 -1
- package/dist/cjs/shopify/src/index.d.ts +0 -5
- package/dist/cjs/shopify/tsup.config.d.ts +0 -2
- package/dist/cjs/shopify/types/article.d.ts +0 -48
- package/dist/cjs/shopify/types/cart.d.ts +0 -173
- package/dist/cjs/shopify/types/checkout.d.ts +0 -42
- package/dist/cjs/shopify/types/collection.d.ts +0 -122
- package/dist/cjs/shopify/types/common.d.ts +0 -42
- package/dist/cjs/shopify/types/config.d.ts +0 -12
- package/dist/cjs/shopify/types/customer.d.ts +0 -30
- package/dist/cjs/shopify/types/fetcher.d.ts +0 -38
- package/dist/cjs/shopify/types/index.d.ts +0 -12
- package/dist/cjs/shopify/types/page.d.ts +0 -33
- package/dist/cjs/shopify/types/product.d.ts +0 -174
- package/dist/cjs/shopify/types/search.d.ts +0 -54
- package/dist/cjs/shopify/types/site.d.ts +0 -33
- package/dist/cjs/shopify/types/type-helper.d.ts +0 -5
- package/dist/cjs/shopify/utils/colors.d.ts +0 -3
- package/dist/cjs/shopify/utils/const.d.ts +0 -76
- package/dist/cjs/shopify/utils/cookie.d.ts +0 -15
- package/dist/cjs/shopify/utils/errors.d.ts +0 -38
- package/dist/cjs/shopify/utils/fetch-graphql-api.d.ts +0 -19
- package/dist/cjs/shopify/utils/handle-fetch-response.d.ts +0 -5
- package/dist/cjs/shopify/utils/helper.d.ts +0 -28
- package/dist/cjs/shopify/utils/normalize/cart.d.ts +0 -7
- package/dist/cjs/shopify/utils/normalize/customer.d.ts +0 -3
- package/dist/cjs/shopify/utils/normalize/index.d.ts +0 -2
- package/dist/cjs/shopify/utils/normalize/metafield.d.ts +0 -5
- package/dist/cjs/shopify/utils/normalize/product.d.ts +0 -16
- package/dist/cjs/shopify/utils/store.d.ts +0 -2
- package/dist/cjs/shopify/utils/type-helper.d.ts +0 -5
- package/dist/cjs/tsconfig.tsbuildinfo +0 -1
- package/dist/esm/components/chat/chat-context.d.ts +0 -101
- package/dist/esm/components/chat/chat-context.js +0 -2
- package/dist/esm/components/chat/chat-context.js.map +0 -7
- package/dist/esm/components/credits/credits-banner/index.d.ts +0 -23
- package/dist/esm/components/credits/credits-banner/index.js +0 -2
- package/dist/esm/components/credits/credits-banner/index.js.map +0 -7
- package/dist/esm/components/credits/credits-benefits/benefitItem.d.ts +0 -19
- package/dist/esm/components/credits/credits-benefits/benefitItem.js +0 -2
- package/dist/esm/components/credits/credits-benefits/benefitItem.js.map +0 -7
- package/dist/esm/components/credits/credits-benefits/iconInfo.d.ts +0 -2
- package/dist/esm/components/credits/credits-benefits/iconInfo.js +0 -2
- package/dist/esm/components/credits/credits-benefits/iconInfo.js.map +0 -7
- package/dist/esm/components/credits/credits-benefits/index.d.ts +0 -12
- package/dist/esm/components/credits/credits-benefits/index.js +0 -4
- package/dist/esm/components/credits/credits-benefits/index.js.map +0 -7
- package/dist/esm/components/credits/credits-cash/RedeemableItem.d.ts +0 -15
- package/dist/esm/components/credits/credits-cash/RedeemableItem.js +0 -2
- package/dist/esm/components/credits/credits-cash/RedeemableItem.js.map +0 -7
- package/dist/esm/components/credits/credits-cash/index.d.ts +0 -13
- package/dist/esm/components/credits/credits-cash/index.js +0 -2
- package/dist/esm/components/credits/credits-cash/index.js.map +0 -7
- package/dist/esm/components/credits/credits-cash/type.d.ts +0 -47
- package/dist/esm/components/credits/credits-faq/faq-item/FaqItem.d.ts +0 -13
- package/dist/esm/components/credits/credits-faq/faq-item/faq-item.d.ts +0 -13
- package/dist/esm/components/credits/credits-faq/faq-item/faq-item.js +0 -2
- package/dist/esm/components/credits/credits-faq/faq-item/faq-item.js.map +0 -7
- package/dist/esm/components/credits/credits-faq/faqItem/FaqItem.d.ts +0 -13
- package/dist/esm/components/credits/credits-faq/index.d.ts +0 -16
- package/dist/esm/components/credits/credits-faq/index.js +0 -2
- package/dist/esm/components/credits/credits-faq/index.js.map +0 -7
- package/dist/esm/components/credits/credits-info-card/index.d.ts +0 -20
- package/dist/esm/components/credits/credits-info-card/index.js +0 -2
- package/dist/esm/components/credits/credits-info-card/index.js.map +0 -7
- package/dist/esm/components/credits/credits-redeem-list/AddressForm/Input.d.ts +0 -13
- package/dist/esm/components/credits/credits-redeem-list/AddressForm/country-select.d.ts +0 -14
- package/dist/esm/components/credits/credits-redeem-list/AddressForm/form-item.d.ts +0 -6
- package/dist/esm/components/credits/credits-redeem-list/AddressForm/index.d.ts +0 -2
- package/dist/esm/components/credits/credits-redeem-list/AddressForm/state-select.d.ts +0 -15
- package/dist/esm/components/credits/credits-redeem-list/AddressForm/type.d.ts +0 -26
- package/dist/esm/components/credits/credits-redeem-list/RedeemCouponModal.d.ts +0 -9
- package/dist/esm/components/credits/credits-redeem-list/RedeemProductModal/Address.d.ts +0 -20
- package/dist/esm/components/credits/credits-redeem-list/RedeemProductModal/Error.d.ts +0 -8
- package/dist/esm/components/credits/credits-redeem-list/RedeemProductModal/Init.d.ts +0 -11
- package/dist/esm/components/credits/credits-redeem-list/RedeemProductModal/ProductInfo.d.ts +0 -8
- package/dist/esm/components/credits/credits-redeem-list/RedeemProductModal/Success.d.ts +0 -13
- package/dist/esm/components/credits/credits-redeem-list/RedeemProductModal/index.d.ts +0 -11
- package/dist/esm/components/credits/credits-redeem-list/RedeemableItem.d.ts +0 -9
- package/dist/esm/components/credits/credits-redeem-list/RedeemableItem.js +0 -2
- package/dist/esm/components/credits/credits-redeem-list/RedeemableItem.js.map +0 -7
- package/dist/esm/components/credits/credits-redeem-list/address-form/Input.d.ts +0 -13
- package/dist/esm/components/credits/credits-redeem-list/address-form/Input.js +0 -2
- package/dist/esm/components/credits/credits-redeem-list/address-form/Input.js.map +0 -7
- package/dist/esm/components/credits/credits-redeem-list/address-form/country-select.d.ts +0 -14
- package/dist/esm/components/credits/credits-redeem-list/address-form/country-select.js +0 -2
- package/dist/esm/components/credits/credits-redeem-list/address-form/country-select.js.map +0 -7
- package/dist/esm/components/credits/credits-redeem-list/address-form/form-item.d.ts +0 -6
- package/dist/esm/components/credits/credits-redeem-list/address-form/form-item.js +0 -2
- package/dist/esm/components/credits/credits-redeem-list/address-form/form-item.js.map +0 -7
- package/dist/esm/components/credits/credits-redeem-list/address-form/index.d.ts +0 -2
- package/dist/esm/components/credits/credits-redeem-list/address-form/index.js +0 -2
- package/dist/esm/components/credits/credits-redeem-list/address-form/index.js.map +0 -7
- package/dist/esm/components/credits/credits-redeem-list/address-form/state-select.d.ts +0 -15
- package/dist/esm/components/credits/credits-redeem-list/address-form/state-select.js +0 -2
- package/dist/esm/components/credits/credits-redeem-list/address-form/state-select.js.map +0 -7
- package/dist/esm/components/credits/credits-redeem-list/address-form/type.d.ts +0 -26
- package/dist/esm/components/credits/credits-redeem-list/index.d.ts +0 -13
- package/dist/esm/components/credits/credits-redeem-list/index.js +0 -2
- package/dist/esm/components/credits/credits-redeem-list/index.js.map +0 -7
- package/dist/esm/components/credits/credits-redeem-list/redeem-coupon-modal.d.ts +0 -9
- package/dist/esm/components/credits/credits-redeem-list/redeem-coupon-modal.js +0 -2
- package/dist/esm/components/credits/credits-redeem-list/redeem-coupon-modal.js.map +0 -7
- package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Address.d.ts +0 -20
- package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Address.js +0 -2
- package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Address.js.map +0 -7
- package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Error.d.ts +0 -8
- package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Error.js +0 -2
- package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Error.js.map +0 -7
- package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Init.d.ts +0 -11
- package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Init.js +0 -2
- package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Init.js.map +0 -7
- package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/ProductInfo.d.ts +0 -8
- package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/ProductInfo.js +0 -2
- package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/ProductInfo.js.map +0 -7
- package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Success.d.ts +0 -13
- package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Success.js +0 -2
- package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Success.js.map +0 -7
- package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/index.d.ts +0 -11
- package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/index.js +0 -2
- package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/index.js.map +0 -7
- package/dist/esm/components/credits/credits-redeem-list/type.d.ts +0 -77
- package/dist/esm/components/credits/credits-ways-to-get-credits/index.d.ts +0 -2
- package/dist/esm/components/credits/credits-ways-to-get-credits/index.js +0 -2
- package/dist/esm/components/credits/credits-ways-to-get-credits/index.js.map +0 -7
- package/dist/esm/components/credits/credits-ways-to-get-credits/type.d.ts +0 -60
- package/dist/esm/components/credits/credits-ways-to-get-credits/type.js +0 -2
- package/dist/esm/components/credits/credits-ways-to-get-credits/type.js.map +0 -7
- package/dist/esm/components/credits/credits-ways-to-get-credits/useActions.d.ts +0 -96
- package/dist/esm/components/credits/credits-ways-to-get-credits/useActions.js +0 -2
- package/dist/esm/components/credits/credits-ways-to-get-credits/useActions.js.map +0 -7
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/country-select.d.ts +0 -14
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/form-item.d.ts +0 -6
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/state-select.d.ts +0 -15
- package/dist/esm/index.css +0 -2
- package/dist/esm/index.css.map +0 -7
- package/dist/esm/shopify/context/ShopifyProvider.d.ts +0 -10
- package/dist/esm/shopify/context/index.d.ts +0 -1
- package/dist/esm/shopify/context/shopify-provider.d.ts +0 -10
- package/dist/esm/shopify/fetchers/create-cart.d.ts +0 -12
- package/dist/esm/shopify/fetchers/get-products-by-handles.d.ts +0 -7
- package/dist/esm/shopify/fetchers/index.d.ts +0 -2
- package/dist/esm/shopify/fragments/article.d.ts +0 -2
- package/dist/esm/shopify/fragments/blog.d.ts +0 -1
- package/dist/esm/shopify/fragments/cart.d.ts +0 -1
- package/dist/esm/shopify/fragments/collection.d.ts +0 -1
- package/dist/esm/shopify/fragments/image.d.ts +0 -1
- package/dist/esm/shopify/fragments/index.d.ts +0 -11
- package/dist/esm/shopify/fragments/metafields.d.ts +0 -2
- package/dist/esm/shopify/fragments/page-info.d.ts +0 -1
- package/dist/esm/shopify/fragments/page.d.ts +0 -1
- package/dist/esm/shopify/fragments/product.d.ts +0 -1
- package/dist/esm/shopify/fragments/seo.d.ts +0 -1
- package/dist/esm/shopify/fragments/variant.d.ts +0 -1
- package/dist/esm/shopify/gql/fragment-masking.d.ts +0 -15
- package/dist/esm/shopify/gql/gql.d.ts +0 -87
- package/dist/esm/shopify/gql/graphql.d.ts +0 -7669
- package/dist/esm/shopify/gql/index.d.ts +0 -3
- package/dist/esm/shopify/hooks/index.d.ts +0 -2
- package/dist/esm/shopify/hooks/use-create-cart.d.ts +0 -2
- package/dist/esm/shopify/hooks/use-products-by-handles.d.ts +0 -4
- package/dist/esm/shopify/hooks/useCreateCart.d.ts +0 -2
- package/dist/esm/shopify/hooks/useProductsByHandles.d.ts +0 -4
- package/dist/esm/shopify/mutations/create-cart.d.ts +0 -1
- package/dist/esm/shopify/queries/get-product-by-handles.d.ts +0 -1
- package/dist/esm/shopify/queries/index.d.ts +0 -1
- package/dist/esm/shopify/src/index.d.ts +0 -5
- package/dist/esm/shopify/tsup.config.d.ts +0 -2
- package/dist/esm/shopify/types/article.d.ts +0 -48
- package/dist/esm/shopify/types/cart.d.ts +0 -173
- package/dist/esm/shopify/types/checkout.d.ts +0 -42
- package/dist/esm/shopify/types/collection.d.ts +0 -122
- package/dist/esm/shopify/types/common.d.ts +0 -42
- package/dist/esm/shopify/types/config.d.ts +0 -12
- package/dist/esm/shopify/types/customer.d.ts +0 -30
- package/dist/esm/shopify/types/fetcher.d.ts +0 -38
- package/dist/esm/shopify/types/index.d.ts +0 -12
- package/dist/esm/shopify/types/page.d.ts +0 -33
- package/dist/esm/shopify/types/product.d.ts +0 -174
- package/dist/esm/shopify/types/search.d.ts +0 -54
- package/dist/esm/shopify/types/site.d.ts +0 -33
- package/dist/esm/shopify/types/type-helper.d.ts +0 -5
- package/dist/esm/shopify/utils/colors.d.ts +0 -3
- package/dist/esm/shopify/utils/const.d.ts +0 -76
- package/dist/esm/shopify/utils/cookie.d.ts +0 -15
- package/dist/esm/shopify/utils/errors.d.ts +0 -38
- package/dist/esm/shopify/utils/fetch-graphql-api.d.ts +0 -19
- package/dist/esm/shopify/utils/handle-fetch-response.d.ts +0 -5
- package/dist/esm/shopify/utils/helper.d.ts +0 -28
- package/dist/esm/shopify/utils/normalize/cart.d.ts +0 -7
- package/dist/esm/shopify/utils/normalize/customer.d.ts +0 -3
- package/dist/esm/shopify/utils/normalize/index.d.ts +0 -2
- package/dist/esm/shopify/utils/normalize/metafield.d.ts +0 -5
- package/dist/esm/shopify/utils/normalize/product.d.ts +0 -16
- package/dist/esm/shopify/utils/store.d.ts +0 -2
- package/dist/esm/shopify/utils/type-helper.d.ts +0 -5
- package/dist/esm/tsconfig.tsbuildinfo +0 -1
- package/src/components/credits/context/hooks/useSendEmailValidation.ts +0 -20
- package/src/components/credits/context/hooks/useSubscriptions.ts +0 -54
- package/src/components/credits/creditsBenefits/benefitItem.tsx +0 -73
- package/src/components/credits/creditsCash/index.tsx +0 -102
- package/src/helpers/fetchResponse.ts +0 -35
- package/src/helpers/fetcher.ts +0 -44
- package/src/helpers/index.ts +0 -2
- package/src/helpers/track.ts +0 -55
- package/src/helpers/utils.ts +0 -8
- /package/dist/cjs/components/credits/{credits-redeem-list/address-form → creditsRedeemList/AddressForm}/Input.js +0 -0
- /package/dist/cjs/components/credits/{credits-redeem-list/address-form → creditsRedeemList/AddressForm}/type.js +0 -0
- /package/dist/cjs/components/credits/{credits-redeem-list → creditsRedeemList}/type.js +0 -0
- /package/dist/esm/components/credits/{credits-cash/type.js.map → context/memberPriceTypes.js.map} +0 -0
- /package/dist/esm/components/credits/{credits-cash → creditsMemberPrice}/type.js +0 -0
- /package/dist/esm/components/credits/{credits-redeem-list/address-form → creditsMemberPrice}/type.js.map +0 -0
- /package/dist/esm/components/credits/{credits-redeem-list/address-form → creditsNavigation}/type.js +0 -0
- /package/dist/esm/components/credits/{credits-redeem-list → creditsNavigation}/type.js.map +0 -0
- /package/dist/esm/components/{credits/credits-redeem-list → registration/authCodeActivate}/type.js +0 -0
- /package/src/components/credits/creditsBenefits/{iconInfo.tsx → IconInfo.tsx} +0 -0
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { CreditsRedeemListCopy } from './type';
|
|
2
|
-
export declare function CreditsRedeemList({ copy, className, tabClassName, hideTitle, cardClassName, activate, }: {
|
|
3
|
-
copy: CreditsRedeemListCopy;
|
|
4
|
-
className?: string;
|
|
5
|
-
tabClassName?: string;
|
|
6
|
-
hideTitle?: boolean;
|
|
7
|
-
cardClassName?: string;
|
|
8
|
-
activate: {
|
|
9
|
-
openAuthCodePopup: () => void;
|
|
10
|
-
isSuccess: boolean;
|
|
11
|
-
setOnSuccess: (callback: Function) => void;
|
|
12
|
-
};
|
|
13
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var J=Object.create;var C=Object.defineProperty;var K=Object.getOwnPropertyDescriptor;var Q=Object.getOwnPropertyNames;var W=Object.getPrototypeOf,X=Object.prototype.hasOwnProperty;var Y=(e,t)=>{for(var a in t)C(e,a,{get:t[a],enumerable:!0})},S=(e,t,a,f)=>{if(t&&typeof t=="object"||typeof t=="function")for(let d of Q(t))!X.call(e,d)&&d!==a&&C(e,d,{get:()=>t[d],enumerable:!(f=K(t,d))||f.enumerable});return e};var g=(e,t,a)=>(a=e!=null?J(W(e)):{},S(t||!e||!e.__esModule?C(a,"default",{value:e,enumerable:!0}):a,e)),Z=e=>S(C({},"__esModule",{value:!0}),e);var ee={};Y(ee,{CreditsRedeemList:()=>$});module.exports=Z(ee);var n=require("react/jsx-runtime"),r=require("@anker-in/headless-ui"),R=g(require("classnames")),l=require("react"),E=g(require("./RedeemCouponModal")),O=g(require("./RedeemProductModal")),A=require("../context/provider"),M=g(require("../context/hooks/useRedeemableList")),u=require("../context/const"),F=require("@shopify/hooks/useProductsByHandles"),D=require("./RedeemableItem"),z=g(require("../modal/rulesModal")),H=require("../../../helpers/track");function $({copy:e,className:t="",tabClassName:a="",hideTitle:f=!1,cardClassName:d,activate:v}){const{profile:L,openSignUpPopup:j,gtm:{pageGroup:w}}=(0,A.useCreditsContext)(),B=Object.keys(L||{}).length>0,[T,G]=(0,l.useState)(e.list[0].label),[i,b]=(0,l.useState)(void 0),[h,N]=(0,l.useState)(),{listLoading:U,redeemableList:k,getRedeemableList:x}=(0,M.default)(),p=(0,l.useMemo)(()=>k.map(s=>({id:s.id.toString(),title:s.name,consumeCredits:s.consume_credits,remainingInventory:s.remaining_inventory,isLimited:!!s.is_limited,consumeType:s.consume_type,handle:s.sku_handle,sku:s.goods_sku,image:s.goods_url})),[e.list,T,k]),V=p.map(s=>s.handle),{data:_}=(0,F.useProductsByHandles)({handles:V}),q=(0,l.useMemo)(()=>e.list.find(o=>o.label===T)?.list.filter(o=>p.some(c=>c.id===o.id)).map(o=>{const c=p.find(m=>m.id===o.id),y=_?.find(m=>m.handle===c?.handle),P=y?.variants.find(m=>m.sku===c?.sku);return c?.consumeType===u.AlpcConsumeType.Product&&(!y||!P)?null:{alpc:p.find(m=>m.id===o.id),config:o,product:y,variant:P}}).filter(o=>o!==null),[p,_]),I=(0,l.useCallback)(s=>{s===u.AlpcErrorCode.CodeLpcRuleInventoryNotEnough&&x()},[x]);return console.log("popRedeemData",i),(0,n.jsxs)(r.Container,{className:(0,R.default)("relative bg-[#F5F5F7]",t),children:[!f&&(0,n.jsx)(r.Heading,{as:"h2",size:"4",html:e.title}),(0,n.jsx)(r.Tabs,{shape:"rounded",align:"left",className:(0,R.default)("sticky top-0 z-20 py-[24px] md:justify-center",a),value:T.toString(),onValueChange:s=>{G(s),(0,H.gaTrack)({event:"ga4Event",event_name:"lp_navigation",event_parameters:{navigation:s,page_group:w}})},children:(0,n.jsx)(r.TabsList,{children:e.list.map(s=>(0,n.jsx)(r.TabsTrigger,{value:s.label,children:s.label},s.label))})}),!!p?.length&&!U&&(0,n.jsx)("div",{className:(0,R.default)("relative grid grid-cols-4 gap-[16px] md:grid-cols-2 md:gap-[12px] md-xl:grid-cols-3"),children:q?.map(s=>(0,n.jsx)(D.RedeemableItem,{copy:e,item:s,onRedeem:o=>{B?!L?.activated&&!v.isSuccess?(v.openAuthCodePopup(),v.setOnSuccess(()=>{b(o)})):b(o):j()},onRulesOpen:N,className:d},s?.alpc?.id))}),i?.alpc?.consumeType===u.AlpcConsumeType.Coupon&&e?.redeemModal?.coupon&&i&&(0,n.jsx)(E.default,{isOpen:!!i,item:i,copy:e,onError:I,onClose:()=>{b(void 0)}}),i?.alpc?.consumeType===u.AlpcConsumeType.Product&&e?.redeemModal&&i&&(0,n.jsx)(O.default,{isOpen:!!i,item:i,copy:e,onError:I,onClose:()=>{b(void 0)}}),h&&(0,n.jsx)(z.default,{overlayClassName:"md:px-[16px] md:items-center",className:"md:h-fit md:rounded-b-[16px]",isOpen:h.length>0,onClose:()=>N([]),titleClassName:"border-b-transparent h-[56px]",rules:h,scrollClassName:"md:mt-[8px] md:mb-[24px] md:pt-0",title:e?.ruleLabel,ruleClassName:"text-[#1d1d1f] font-bold"})]})}
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../src/components/credits/credits-redeem-list/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Container, Heading, Tabs, TabsList, TabsTrigger } from '@anker-in/headless-ui'\nimport classNames from 'classnames'\nimport { useCallback, useMemo, useState } from 'react'\n\nimport RedeemCouponModal from './RedeemCouponModal'\nimport RedeemProductModal from './RedeemProductModal'\nimport { useCreditsContext } from '../context/provider'\nimport useRedeemableList from '../context/hooks/useRedeemableList'\nimport { AlpcConsumeType, AlpcErrorCode } from '../context/const'\nimport { useProductsByHandles } from '@shopify/hooks/useProductsByHandles'\nimport type { RedeemableItem as RedeemableItemType } from '../type'\nimport { RedeemableItem } from './RedeemableItem'\nimport RulesModal from '../modal/rulesModal'\nimport { CreditsRedeemListCopy } from './type'\nimport { gaTrack } from '../../../helpers/track'\n\nexport function CreditsRedeemList({\n copy,\n className = '',\n tabClassName = '',\n hideTitle = false,\n cardClassName,\n activate,\n}: {\n copy: CreditsRedeemListCopy\n className?: string\n tabClassName?: string\n hideTitle?: boolean\n cardClassName?: string\n activate: {\n openAuthCodePopup: () => void\n isSuccess: boolean\n setOnSuccess: (callback: Function) => void\n }\n}) {\n const {\n profile,\n openSignUpPopup,\n gtm: { pageGroup },\n } = useCreditsContext()\n const isLogin = Object.keys(profile || {}).length > 0\n\n const [activeTab, setActiveTab] = useState<string>(copy.list[0].label)\n\n const [popRedeemData, setPopRedeemData] = useState<RedeemableItemType | undefined>(undefined)\n\n const [rules, setRules] = useState<string | string[]>()\n\n const { listLoading, redeemableList, getRedeemableList } = useRedeemableList()\n\n const alpcList = useMemo(() => {\n return redeemableList.map(item => {\n return {\n id: item.id.toString(),\n title: item.name,\n consumeCredits: item.consume_credits,\n remainingInventory: item.remaining_inventory,\n isLimited: !!item.is_limited,\n consumeType: item.consume_type,\n handle: item.sku_handle,\n sku: item.goods_sku,\n image: item.goods_url,\n }\n })\n }, [copy.list, activeTab, redeemableList])\n\n const handles = alpcList.map(item => item.handle)\n const { data: products } = useProductsByHandles({ handles })\n\n const list = useMemo(() => {\n const currentList = copy.list.find(item => item.label === activeTab)\n return currentList?.list\n .filter(item => alpcList.some(alpcItem => alpcItem.id === item.id))\n .map(item => {\n const alpcItem = alpcList.find(alpcItem => alpcItem.id === item.id)\n const product = products?.find(product => product.handle === alpcItem?.handle)\n const variant = product?.variants.find(variant => variant.sku === alpcItem?.sku)\n if (alpcItem?.consumeType === AlpcConsumeType.Product && (!product || !variant)) return null\n return {\n alpc: alpcList.find(alpcItem => alpcItem.id === item.id),\n config: item,\n product,\n variant,\n }\n })\n .filter(item => item !== null) as unknown as RedeemableItemType[]\n }, [alpcList, products])\n\n const handleRedeemError = useCallback(\n (errorCode: AlpcErrorCode) => {\n if (errorCode === AlpcErrorCode.CodeLpcRuleInventoryNotEnough) {\n getRedeemableList()\n }\n },\n [getRedeemableList]\n )\n\n console.log('popRedeemData', popRedeemData)\n\n return (\n <Container className={classNames('relative bg-[#F5F5F7]', className)}>\n {!hideTitle && <Heading as=\"h2\" size=\"4\" html={copy.title} />}\n\n <Tabs\n shape=\"rounded\"\n align=\"left\"\n className={classNames('sticky top-0 z-20 py-[24px] md:justify-center', tabClassName)}\n value={activeTab.toString()}\n onValueChange={value => {\n setActiveTab(value)\n gaTrack({\n event: 'ga4Event',\n event_name: 'lp_navigation',\n event_parameters: {\n navigation: value,\n page_group: pageGroup,\n },\n })\n }}\n >\n <TabsList>\n {copy.list.map(item => (\n <TabsTrigger key={item.label} value={item.label}>\n {item.label}\n </TabsTrigger>\n ))}\n </TabsList>\n </Tabs>\n {/* PC\u7AEF */}\n {!!alpcList?.length && !listLoading && (\n <div\n className={classNames('relative grid grid-cols-4 gap-[16px] md:grid-cols-2 md:gap-[12px] md-xl:grid-cols-3')}\n >\n {list?.map(item => (\n <RedeemableItem\n key={item?.alpc?.id}\n copy={copy}\n item={item}\n onRedeem={(item: RedeemableItemType) => {\n if (!isLogin) {\n openSignUpPopup()\n } else if (!profile?.activated && !activate.isSuccess) {\n activate.openAuthCodePopup()\n activate.setOnSuccess(() => {\n setPopRedeemData(item)\n })\n } else {\n setPopRedeemData(item)\n }\n }}\n onRulesOpen={setRules}\n className={cardClassName}\n />\n ))}\n </div>\n )}\n\n {popRedeemData?.alpc?.consumeType === AlpcConsumeType.Coupon && copy?.redeemModal?.coupon && popRedeemData && (\n <RedeemCouponModal\n isOpen={!!popRedeemData}\n item={popRedeemData}\n copy={copy}\n onError={handleRedeemError}\n onClose={() => {\n setPopRedeemData(undefined)\n }}\n />\n )}\n {popRedeemData?.alpc?.consumeType === AlpcConsumeType.Product && copy?.redeemModal && popRedeemData && (\n <RedeemProductModal\n isOpen={!!popRedeemData}\n item={popRedeemData}\n copy={copy}\n onError={handleRedeemError}\n onClose={() => {\n setPopRedeemData(undefined)\n }}\n />\n )}\n {rules && (\n <RulesModal\n overlayClassName=\"md:px-[16px] md:items-center\"\n className=\"md:h-fit md:rounded-b-[16px]\"\n isOpen={rules.length > 0}\n onClose={() => setRules([])}\n titleClassName=\"border-b-transparent h-[56px]\"\n rules={rules}\n scrollClassName=\"md:mt-[8px] md:mb-[24px] md:pt-0\"\n title={copy?.ruleLabel}\n ruleClassName=\"text-[#1d1d1f] font-bold\"\n />\n )}\n </Container>\n )\n}\n"],
|
|
5
|
-
"mappings": "0jBAAA,IAAAA,GAAA,GAAAC,EAAAD,GAAA,uBAAAE,IAAA,eAAAC,EAAAH,IAoGI,IAAAI,EAAA,6BApGJC,EAAgE,iCAChEC,EAAuB,yBACvBC,EAA+C,iBAE/CC,EAA8B,kCAC9BC,EAA+B,mCAC/BC,EAAkC,+BAClCC,EAA8B,iDAC9BC,EAA+C,4BAC/CC,EAAqC,+CAErCC,EAA+B,4B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aAAa,IAAM,CAC1BQ,EAAiBQ,CAAI,CACvB,CAAC,GAEDR,EAAiBQ,CAAI,EAPrBd,EAAgB,CASpB,EACA,YAAaQ,EACb,UAAWX,GAhBNiB,GAAM,MAAM,EAiBnB,CACD,EACH,EAGDT,GAAe,MAAM,cAAgB,kBAAgB,QAAUZ,GAAM,aAAa,QAAUY,MAC3F,OAAC,EAAAoB,QAAA,CACC,OAAQ,CAAC,CAACpB,EACV,KAAMA,EACN,KAAMZ,EACN,QAAS4B,EACT,QAAS,IAAM,CACbf,EAAiB,MAAS,CAC5B,EACF,EAEDD,GAAe,MAAM,cAAgB,kBAAgB,SAAWZ,GAAM,aAAeY,MACpF,OAAC,EAAAqB,QAAA,CACC,OAAQ,CAAC,CAACrB,EACV,KAAMA,EACN,KAAMZ,EACN,QAAS4B,EACT,QAAS,IAAM,CACbf,EAAiB,MAAS,CAC5B,EACF,EAEDC,MACC,OAAC,EAAAoB,QAAA,CACC,iBAAiB,+BACjB,UAAU,+BACV,OAAQpB,EAAM,OAAS,EACvB,QAAS,IAAMC,EAAS,CAAC,CAAC,EAC1B,eAAe,gCACf,MAAOD,EACP,gBAAgB,mCAChB,MAAOd,GAAM,UACb,cAAc,2BAChB,GAEJ,CAEJ",
|
|
6
|
-
"names": ["credits_redeem_list_exports", "__export", "CreditsRedeemList", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_classnames", "import_react", "import_RedeemCouponModal", "import_RedeemProductModal", "import_provider", "import_useRedeemableList", "import_const", "import_useProductsByHandles", "import_RedeemableItem", "import_rulesModal", "import_track", "copy", "className", "tabClassName", "hideTitle", "cardClassName", "activate", "profile", "openSignUpPopup", "pageGroup", "isLogin", "activeTab", "setActiveTab", "popRedeemData", "setPopRedeemData", "rules", "setRules", "listLoading", "redeemableList", "getRedeemableList", "useRedeemableList", "alpcList", "item", "handles", "products", "list", "alpcItem", "product", "variant", "handleRedeemError", "errorCode", "classNames", "value", "RedeemCouponModal", "RedeemProductModal", "RulesModal"]
|
|
7
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { ModalContainerProps } from '../modal/modalContainer';
|
|
2
|
-
import type { RedeemableItem as RedeemableItemType } from '../type';
|
|
3
|
-
import { CreditsRedeemListCopy } from './type';
|
|
4
|
-
declare function RedeemCouponModal({ item, copy, onError, ...props }: ModalContainerProps & {
|
|
5
|
-
item: RedeemableItemType;
|
|
6
|
-
copy: CreditsRedeemListCopy;
|
|
7
|
-
onError: (code: number) => void;
|
|
8
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export default RedeemCouponModal;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var B=Object.create;var f=Object.defineProperty;var z=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames;var O=Object.getPrototypeOf,U=Object.prototype.hasOwnProperty;var A=(o,t)=>{for(var i in t)f(o,i,{get:t[i],enumerable:!0})},E=(o,t,i,m)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of P(t))!U.call(o,a)&&a!==i&&f(o,a,{get:()=>t[a],enumerable:!(m=z(t,a))||m.enumerable});return o};var w=(o,t,i)=>(i=o!=null?B(O(o)):{},E(t||!o||!o.__esModule?f(i,"default",{value:o,enumerable:!0}):i,o)),D=o=>E(f({},"__esModule",{value:!0}),o);var j={};A(j,{default:()=>$});module.exports=D(j);var e=require("react/jsx-runtime"),d=require("@anker-in/headless-ui"),g=w(require("classnames")),r=require("react"),F=w(require("../context/hooks/useCopy")),R=require("../context/provider"),T=require("../context/hooks/useRedeemCoupon"),c=require("../context/const"),k=require("../modal/modalContainer"),I=require("../context/utils"),L=require("@shopify/context");function K({item:o,copy:t,onError:i,...m}){const{locale:a}=(0,L.useShopifyContext)(),[n,S]=(0,r.useState)(),[C,x]=(0,r.useState)(),[b,p]=(0,r.useState)(!1),{copy:y,copied:v}=(0,F.default)(),{profile:u,fetchCreditInfo:N}=(0,R.useCreditsContext)(),{isMutating:h,trigger:M}=(0,T.useRedeemCoupon)({onSuccess(l){if(!l){x(t.redeemModal.commonError);return}if(l?.data?.success)S(l.data.coupon_code),N(u?.user_id);else{let s;l.code===c.AlpcErrorCode.CodeLpcShopifyCouponRuleRedeemLimit?(s=t.redeemModal.redeemLimitError,p(!0)):l.code===c.AlpcErrorCode.CodeLpcRuleInventoryNotEnough?(s=t.redeemModal.inventoryNotEnough,p(!0)):l.code===c.AlpcErrorCode.CodeLpcNotEnoughCredits?(s=t.redeemModal.creditsNotEnough,p(!0),N(u?.user_id)):l.code===c.AlpcErrorCode.CodeCrossSiteError&&(s=t.redeemModal.crossSiteError,p(!0)),x(s||t.redeemModal.commonError||""),i&&i(l.code)}},onError(l){x(l.message||t.redeemModal.commonError)}}),_=(0,r.useCallback)(async()=>{x(""),M({user_id:u?.user_id,rule_id:Number(o.alpc?.id)})},[o,u,M]);return(0,r.useEffect)(()=>{m.isOpen||(p(!1),x(""))},[m.isOpen]),(0,e.jsxs)(k.CreditsModalContainer,{...m,className:"w-[540px] md:h-auto",scrollClassName:"mb-[40px] min-l:px-0 md:mb-[24px] px-0",titleClassName:"h-[56px] bg-[#F5F5F7]",children:[(0,e.jsxs)("div",{className:(0,g.default)("max-h-[500px] overflow-y-auto bg-[#F5F5F7] px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]"),children:[(0,e.jsxs)("div",{className:"relative mx-auto h-[164px] w-[324px]",children:[t?.imageMapping?.coupon?.url&&(0,e.jsx)(d.Picture,{source:t?.imageMapping?.coupon?.url,className:"h-full [&_img]:h-full"}),(0,e.jsx)("div",{className:"absolute bottom-[8px] left-[16px] font-extrabold text-white",children:o.config.value?(0,e.jsxs)("div",{className:"flex items-end gap-[4px]",children:[(0,e.jsx)(d.Text,{className:"text-[64px] font-bold leading-none",html:o.config.value.toString()}),(0,e.jsx)(d.Text,{className:"text-[24px] font-bold leading-[2]",html:t?.off})]}):(0,e.jsx)(d.Text,{size:3,html:o.alpc?.title})})]}),n?(0,e.jsxs)("div",{className:"mt-[30px] flex items-center justify-center md:mt-[18px]",children:[(0,e.jsx)("div",{className:"mr-[10px] text-[24px] font-bold leading-[1.4] md:leading-[1.2]",children:n}),(0,e.jsx)("div",{className:(0,g.default)("cursor-pointer text-[16px] font-bold leading-[1.2] underline md:text-[14px]",v?"pointer-events-none":"pointer-events-auto"),onClick:()=>{y(n)},role:"button",tabIndex:0,onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&l.preventDefault()},children:v?t?.copied:t?.copy})]}):(0,e.jsxs)(d.Text,{as:"p",className:(0,g.default)("mt-[30px] text-center text-[24px] font-bold leading-[1.2] md:mt-[18px] md:text-[20px] md:leading-[1.2]"),children:[(0,I.numberFormat)(o.alpc?.consumeCredits)," ",t?.pointUnit]}),!n&&o.config?.rules?.length>0&&(0,e.jsxs)("div",{className:"mt-[18px] w-full text-[16px] font-bold leading-[1.4] text-[#6D6D6F] md:mt-[12px] md:text-[14px]",children:[(0,e.jsxs)("div",{className:"mb-[4px]",children:[t?.ruleLabel,":"]}),(0,e.jsx)("ul",{className:"ml-4 grid grid-flow-row gap-[4px]",children:o.config?.rules?.map((l,s)=>(0,e.jsx)("li",{className:"list-disc",children:(0,e.jsx)(d.Text,{html:l})},s))})]})]}),(0,e.jsxs)("div",{className:"bg-white px-[48px] pt-[24px] text-center md:px-[16px]",children:[n&&!h?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"flex flex-col",children:[(0,e.jsx)(d.Text,{className:"mb-[4px] text-[24px] font-bold leading-[1.2] md:text-[20px]",html:t.redeemModal.coupon.successTitle}),(0,e.jsx)(d.Text,{className:"text-[16px] font-bold leading-[1.4] text-[#6D6D6F] md:text-[14px]",html:t.redeemModal.coupon.successDesc})]}),(0,e.jsx)(d.Button,{variant:"primary",size:"lg",className:"mt-[16px] w-full",onClick:()=>{window.location.href=t.redeemModal.coupon.successButtonUrl||`/${a}`,m.onClose&&m.onClose()},disabled:b,children:t.redeemModal.coupon.successButton})]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(d.Text,{className:"block text-[24px] font-bold leading-[1.2] md:text-[20px] md:leading-[1.2]",html:t.redeemModal.confirmTitle}),(0,e.jsx)(d.Button,{loading:h,variant:"primary",size:"lg",className:"mt-[16px] w-full",onClick:_,disabled:b,children:t.redeemModal.confirmButton})]}),C&&(0,e.jsx)("div",{className:"mx-auto max-w-full py-[12px] text-center",children:(0,e.jsx)(d.Text,{className:"text-[14px] font-semibold text-[#1F2021]",html:C})})]})]})}var $=K;
|
|
2
|
-
//# sourceMappingURL=redeem-coupon-modal.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../src/components/credits/credits-redeem-list/redeem-coupon-modal.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Button, Picture, Text } from '@anker-in/headless-ui'\nimport classNames from 'classnames'\nimport { useCallback, useEffect, useState } from 'react'\nimport type { ModalContainerProps } from '../modal/modalContainer'\nimport useCopy from '../context/hooks/useCopy'\nimport { useCreditsContext } from '../context/provider'\nimport { useRedeemCoupon } from '../context/hooks/useRedeemCoupon'\nimport { AlpcErrorCode } from '../context/const'\nimport { CreditsModalContainer } from '../modal/modalContainer'\nimport { numberFormat } from '../context/utils'\nimport type { RedeemableItem as RedeemableItemType } from '../type'\nimport { useShopifyContext } from '@shopify/context'\nimport { CreditsRedeemListCopy } from './type'\n\nfunction RedeemCouponModal({\n item,\n copy,\n onError,\n ...props\n}: ModalContainerProps & {\n item: RedeemableItemType\n copy: CreditsRedeemListCopy\n onError: (code: number) => void\n}) {\n const { locale } = useShopifyContext()\n const [couponCode, setCouponCode] = useState<string>()\n const [errorInfo, setErrorInfo] = useState<string>()\n\n const [disabled, setDisabled] = useState(false)\n const { copy: copyText, copied: copiedStatus } = useCopy()\n\n const { profile, fetchCreditInfo } = useCreditsContext()\n\n const { isMutating: loading, trigger } = useRedeemCoupon({\n onSuccess(responseData) {\n if (!responseData) {\n setErrorInfo(copy.redeemModal.commonError)\n return\n }\n\n if (responseData?.data?.success) {\n setCouponCode(responseData.data.coupon_code)\n fetchCreditInfo(profile?.user_id)\n } else {\n let errorMsg\n if (responseData.code === AlpcErrorCode.CodeLpcShopifyCouponRuleRedeemLimit) {\n errorMsg = copy.redeemModal.redeemLimitError\n setDisabled(true)\n } else if (responseData.code === AlpcErrorCode.CodeLpcRuleInventoryNotEnough) {\n errorMsg = copy.redeemModal.inventoryNotEnough\n setDisabled(true)\n } else if (responseData.code === AlpcErrorCode.CodeLpcNotEnoughCredits) {\n errorMsg = copy.redeemModal.creditsNotEnough\n setDisabled(true)\n fetchCreditInfo(profile?.user_id)\n } else if (responseData.code === AlpcErrorCode.CodeCrossSiteError) {\n errorMsg = copy.redeemModal.crossSiteError\n setDisabled(true)\n }\n\n setErrorInfo(errorMsg || copy.redeemModal.commonError || '')\n onError && onError(responseData.code)\n }\n },\n onError(error) {\n setErrorInfo(error.message || copy.redeemModal.commonError)\n },\n })\n\n const handleConfirm = useCallback(async () => {\n setErrorInfo('')\n trigger({\n user_id: profile?.user_id,\n rule_id: Number(item.alpc?.id),\n })\n }, [item, profile, trigger])\n\n useEffect(() => {\n if (!props.isOpen) {\n setDisabled(false)\n setErrorInfo('')\n }\n }, [props.isOpen])\n\n return (\n <CreditsModalContainer\n {...props}\n className=\"w-[540px] md:h-auto\"\n scrollClassName=\"mb-[40px] min-l:px-0 md:mb-[24px] px-0\"\n titleClassName=\"h-[56px] bg-[#F5F5F7]\"\n >\n <div\n className={classNames(\n 'max-h-[500px] overflow-y-auto bg-[#F5F5F7] px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]'\n )}\n >\n <div className=\"relative mx-auto h-[164px] w-[324px]\">\n {copy?.imageMapping?.coupon?.url && (\n <Picture source={copy?.imageMapping?.coupon?.url} className=\"h-full [&_img]:h-full\" />\n )}\n <div className=\"absolute bottom-[8px] left-[16px] font-extrabold text-white\">\n {item.config.value ? (\n <div className=\"flex items-end gap-[4px]\">\n <Text className=\"text-[64px] font-bold leading-none\" html={item.config.value.toString()} />\n <Text className=\"text-[24px] font-bold leading-[2]\" html={copy?.off} />\n </div>\n ) : (\n <Text size={3} html={item.alpc?.title} />\n )}\n </div>\n </div>\n {couponCode ? (\n <div className=\"mt-[30px] flex items-center justify-center md:mt-[18px]\">\n <div className=\"mr-[10px] text-[24px] font-bold leading-[1.4] md:leading-[1.2]\">{couponCode}</div>\n <div\n className={classNames(\n 'cursor-pointer text-[16px] font-bold leading-[1.2] underline md:text-[14px]',\n copiedStatus ? 'pointer-events-none' : 'pointer-events-auto'\n )}\n onClick={() => {\n copyText(couponCode)\n }}\n role=\"button\"\n tabIndex={0}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n }\n }}\n >\n {copiedStatus ? copy?.copied : copy?.copy}\n </div>\n </div>\n ) : (\n <Text\n as=\"p\"\n className={classNames(\n 'mt-[30px] text-center text-[24px] font-bold leading-[1.2] md:mt-[18px] md:text-[20px] md:leading-[1.2]'\n )}\n >\n {numberFormat(item.alpc?.consumeCredits)} {copy?.pointUnit}\n </Text>\n )}\n {!couponCode && item.config?.rules?.length > 0 && (\n <div className=\"mt-[18px] w-full text-[16px] font-bold leading-[1.4] text-[#6D6D6F] md:mt-[12px] md:text-[14px]\">\n <div className=\"mb-[4px]\">{copy?.ruleLabel}:</div>\n <ul className=\"ml-4 grid grid-flow-row gap-[4px]\">\n {item.config?.rules?.map((text, index) => (\n <li className=\"list-disc\" key={index}>\n <Text html={text} />\n </li>\n ))}\n </ul>\n </div>\n )}\n </div>\n <div className=\"bg-white px-[48px] pt-[24px] text-center md:px-[16px]\">\n {couponCode && !loading ? (\n <>\n <div className=\"flex flex-col\">\n <Text\n className=\"mb-[4px] text-[24px] font-bold leading-[1.2] md:text-[20px]\"\n html={copy.redeemModal.coupon.successTitle}\n ></Text>\n <Text\n className=\"text-[16px] font-bold leading-[1.4] text-[#6D6D6F] md:text-[14px]\"\n html={copy.redeemModal.coupon.successDesc}\n ></Text>\n </div>\n <Button\n variant=\"primary\"\n size=\"lg\"\n className=\"mt-[16px] w-full\"\n onClick={() => {\n window.location.href = copy.redeemModal.coupon.successButtonUrl || `/${locale}`\n if (props.onClose) {\n props.onClose()\n }\n }}\n disabled={disabled}\n >\n {copy.redeemModal.coupon.successButton}\n </Button>\n </>\n ) : (\n <>\n <Text\n className=\"block text-[24px] font-bold leading-[1.2] md:text-[20px] md:leading-[1.2]\"\n html={copy.redeemModal.confirmTitle}\n ></Text>\n <Button\n loading={loading}\n variant=\"primary\"\n size=\"lg\"\n className=\"mt-[16px] w-full\"\n onClick={handleConfirm}\n disabled={disabled}\n >\n {copy.redeemModal.confirmButton}\n </Button>\n </>\n )}\n {errorInfo && (\n <div className=\"mx-auto max-w-full py-[12px] text-center\">\n <Text className=\"text-[14px] font-semibold text-[#1F2021]\" html={errorInfo} />\n </div>\n )}\n </div>\n </CreditsModalContainer>\n )\n}\n\nexport default RedeemCouponModal\n"],
|
|
5
|
-
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAkGY,IAAAI,EAAA,6BAlGZC,EAAsC,iCACtCC,EAAuB,yBACvBC,EAAiD,iBAEjDC,EAAoB,uCACpBC,EAAkC,+BAClCC,EAAgC,4CAChCC,EAA8B,4BAC9BC,EAAsC,mCACtCC,EAA6B,4BAE7BC,EAAkC,4BAGlC,SAASC,EAAkB,CACzB,KAAAC,EACA,KAAAC,EACA,QAAAC,EACA,GAAGC,CACL,EAIG,CACD,KAAM,CAAE,OAAAC,CAAO,KAAI,qBAAkB,EAC/B,CAACC,EAAYC,CAAa,KAAI,YAAiB,EAC/C,CAACC,EAAWC,CAAY,KAAI,YAAiB,EAE7C,CAACC,EAAUC,CAAW,KAAI,YAAS,EAAK,EACxC,CAAE,KAAMC,EAAU,OAAQC,CAAa,KAAI,EAAAC,SAAQ,EAEnD,CAAE,QAAAC,EAAS,gBAAAC,CAAg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,QACC,UAAU,oEACV,KAAMA,EAAK,YAAY,OAAO,YAC/B,GACH,KACA,OAAC,UACC,QAAQ,UACR,KAAK,KACL,UAAU,mBACV,QAAS,IAAM,CACb,OAAO,SAAS,KAAOA,EAAK,YAAY,OAAO,kBAAoB,IAAIG,CAAM,GACzED,EAAM,SACRA,EAAM,QAAQ,CAElB,EACA,SAAUM,EAET,SAAAR,EAAK,YAAY,OAAO,cAC3B,GACF,KAEA,oBACE,oBAAC,QACC,UAAU,4EACV,KAAMA,EAAK,YAAY,aACxB,KACD,OAAC,UACC,QAASe,EACT,QAAQ,UACR,KAAK,KACL,UAAU,mBACV,QAASK,EACT,SAAUZ,EAET,SAAAR,EAAK,YAAY,cACpB,GACF,EAEDM,MACC,OAAC,OAAI,UAAU,2CACb,mBAAC,QAAK,UAAU,2CAA2C,KAAMA,EAAW,EAC9E,GAEJ,GACF,CAEJ,CAEA,IAAOrB,EAAQa",
|
|
6
|
-
"names": ["redeem_coupon_modal_exports", "__export", "redeem_coupon_modal_default", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_classnames", "import_react", "import_useCopy", "import_provider", "import_useRedeemCoupon", "import_const", "import_modalContainer", "import_utils", "import_context", "RedeemCouponModal", "item", "copy", "onError", "props", "locale", "couponCode", "setCouponCode", "errorInfo", "setErrorInfo", "disabled", "setDisabled", "copyText", "copiedStatus", "useCopy", "profile", "fetchCreditInfo", "loading", "trigger", "responseData", "errorMsg", "error", "handleConfirm", "classNames", "e", "text", "index"]
|
|
7
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { RedeemableItem as RedeemableItemType } from '../../type';
|
|
2
|
-
import { CreditsRedeemListCopy } from '../type';
|
|
3
|
-
type AddressProps = {
|
|
4
|
-
copy: CreditsRedeemListCopy;
|
|
5
|
-
shippingAddress: string;
|
|
6
|
-
setAddress: (address: Record<string, any>) => void;
|
|
7
|
-
validateAddress: (address: Record<string, any>) => boolean;
|
|
8
|
-
validateErrors: {
|
|
9
|
-
key: string;
|
|
10
|
-
message: string;
|
|
11
|
-
}[];
|
|
12
|
-
item: RedeemableItemType;
|
|
13
|
-
loading: boolean;
|
|
14
|
-
address: Record<string, any> | undefined;
|
|
15
|
-
disabled: boolean;
|
|
16
|
-
handlePayment: () => void;
|
|
17
|
-
shippingProduct: string;
|
|
18
|
-
};
|
|
19
|
-
export declare const Address: ({ copy, shippingAddress, setAddress, validateAddress, validateErrors, shippingProduct, loading, address, disabled, handlePayment, item, }: AddressProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
-
export {};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var A=Object.create;var m=Object.defineProperty;var F=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var L=Object.getPrototypeOf,T=Object.prototype.hasOwnProperty;var I=(e,o)=>{for(var s in o)m(e,s,{get:o[s],enumerable:!0})},n=(e,o,s,i)=>{if(o&&typeof o=="object"||typeof o=="function")for(let d of w(o))!T.call(e,d)&&d!==s&&m(e,d,{get:()=>o[d],enumerable:!(i=F(o,d))||i.enumerable});return e};var p=(e,o,s)=>(s=e!=null?A(L(e)):{},n(o||!e||!e.__esModule?m(s,"default",{value:e,enumerable:!0}):s,e)),P=e=>n(m({},"__esModule",{value:!0}),e);var B={};I(B,{Address:()=>k});module.exports=P(B);var t=require("react/jsx-runtime"),r=require("@anker-in/headless-ui"),l=p(require("classnames")),x=require("../AddressForm"),c=require("@shopify/context"),f=require("./ProductInfo"),u=p(require("../../context/hooks/useCountries"));const k=({copy:e,shippingAddress:o,setAddress:s,validateAddress:i,validateErrors:d,shippingProduct:a,loading:y,address:v,disabled:b,handlePayment:g,item:h})=>{const{storeDomain:C}=(0,c.useShopifyContext)(),{countries:N=[],isLoading:R}=(0,u.default)({shopifyStoreDomain:C});return(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("div",{className:(0,l.default)("max-h-[500px] overflow-y-auto px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]"),children:(0,t.jsxs)("div",{children:[o&&(0,t.jsx)(r.Text,{className:"mb-5 text-[16px] font-bold",html:o}),(0,t.jsx)(x.AddressForm,{onChange:s,validate:i,errors:d,form:e.redeemModal.product.addressForm,countries:N,countriesLoading:R})]})}),(0,t.jsxs)("div",{className:"sticky bottom-0 flex flex-col items-center justify-center bg-white px-[48px] py-[24px] l:px-[16px]",children:[(0,t.jsxs)("div",{className:"flex w-full items-center rounded-[16px] bg-[#F5F5F7] p-[16px]",children:[a&&(0,t.jsx)(r.Text,{className:"mb-5 text-[16px] font-bold",html:a}),(0,t.jsx)(f.ProductInfo,{item:h,copy:e})]}),(0,t.jsx)(r.Button,{loading:y||!v,variant:"primary",className:"mx-auto mt-[16px] w-[444px] md:mt-[12px] md:w-full",onClick:g,disabled:b,children:e.redeemModal.product.paymentButton})]})]})};
|
|
2
|
-
//# sourceMappingURL=Address.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../src/components/credits/credits-redeem-list/redeem-product-modal/Address.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Button, Text } from '@anker-in/headless-ui'\nimport classNames from 'classnames'\nimport { AddressForm } from '../AddressForm'\nimport { useShopifyContext } from '@shopify/context'\nimport type { RedeemableItem as RedeemableItemType } from '../../type'\nimport { CreditsRedeemListCopy } from '../type'\nimport { ProductInfo } from './ProductInfo'\nimport useCountries from '../../context/hooks/useCountries'\n\ntype AddressProps = {\n copy: CreditsRedeemListCopy\n shippingAddress: string\n setAddress: (address: Record<string, any>) => void\n validateAddress: (address: Record<string, any>) => boolean\n validateErrors: { key: string; message: string }[]\n item: RedeemableItemType\n loading: boolean\n address: Record<string, any> | undefined\n disabled: boolean\n handlePayment: () => void\n shippingProduct: string\n}\n\nexport const Address = ({\n copy,\n shippingAddress,\n setAddress,\n validateAddress,\n validateErrors,\n shippingProduct,\n loading,\n address,\n disabled,\n handlePayment,\n item,\n}: AddressProps) => {\n const { storeDomain } = useShopifyContext()\n const { countries = [], isLoading: countriesLoading } = useCountries({ shopifyStoreDomain: storeDomain })\n\n return (\n <div className=\"relative\">\n <div className={classNames('max-h-[500px] overflow-y-auto px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]')}>\n <div>\n {shippingAddress && <Text className=\"mb-5 text-[16px] font-bold\" html={shippingAddress}></Text>}\n <AddressForm\n onChange={setAddress}\n validate={validateAddress}\n errors={validateErrors}\n form={copy.redeemModal.product.addressForm}\n countries={countries}\n countriesLoading={countriesLoading}\n ></AddressForm>\n </div>\n </div>\n <div className=\"sticky bottom-0 flex flex-col items-center justify-center bg-white px-[48px] py-[24px] l:px-[16px]\">\n <div className=\"flex w-full items-center rounded-[16px] bg-[#F5F5F7] p-[16px]\">\n {shippingProduct && <Text className=\"mb-5 text-[16px] font-bold\" html={shippingProduct}></Text>}\n <ProductInfo item={item} copy={copy} />\n </div>\n <Button\n loading={loading || !address}\n variant=\"primary\"\n className=\"mx-auto mt-[16px] w-[444px] md:mt-[12px] md:w-full\"\n onClick={handlePayment}\n disabled={disabled}\n >\n {copy.redeemModal.product.paymentButton}\n </Button>\n </div>\n </div>\n )\n}\n"],
|
|
5
|
-
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA0CQ,IAAAI,EAAA,6BA1CRC,EAA6B,iCAC7BC,EAAuB,yBACvBC,EAA4B,0BAC5BC,EAAkC,4BAGlCC,EAA4B,yBAC5BC,EAAyB,+CAgBlB,MAAMR,EAAU,CAAC,CACtB,KAAAS,EACA,gBAAAC,EACA,WAAAC,EACA,gBAAAC,EACA,eAAAC,EACA,gBAAAC,EACA,QAAAC,EACA,QAAAC,EACA,SAAAC,EACA,cAAAC,EACA,KAAAC,CACF,IAAoB,CAClB,KAAM,CAAE,YAAAC,CAAY,KAAI,qBAAkB,EACpC,CAAE,UAAAC,EAAY,CAAC,EAAG,UAAWC,CAAiB,KAAI,EAAAC,SAAa,CAAE,mBAAoBH,CAAY,CAAC,EAExG,SACE,QAAC,OAAI,UAAU,WACb,oBAAC,OAAI,aAAW,EAAAI,SAAW,iFAAiF,EAC1G,oBAAC,OACE,UAAAd,MAAmB,OAAC,QAAK,UAAU,6BAA6B,KAAMA,EAAiB,KACxF,OAAC,eACC,SAAUC,EACV,SAAUC,EACV,OAAQC,EACR,KAAMJ,EAAK,YAAY,QAAQ,YAC/B,UAAWY,EACX,iBAAkBC,EACnB,GACH,EACF,KACA,QAAC,OAAI,UAAU,qGACb,qBAAC,OAAI,UAAU,gEACZ,UAAAR,MAAmB,OAAC,QAAK,UAAU,6BAA6B,KAAMA,EAAiB,KACxF,OAAC,eAAY,KAAMK,EAAM,KAAMV,EAAM,GACvC,KACA,OAAC,UACC,QAASM,GAAW,CAACC,EACrB,QAAQ,UACR,UAAU,qDACV,QAASE,EACT,SAAUD,EAET,SAAAR,EAAK,YAAY,QAAQ,cAC5B,GACF,GACF,CAEJ",
|
|
6
|
-
"names": ["Address_exports", "__export", "Address", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_classnames", "import_AddressForm", "import_context", "import_ProductInfo", "import_useCountries", "copy", "shippingAddress", "setAddress", "validateAddress", "validateErrors", "shippingProduct", "loading", "address", "disabled", "handlePayment", "item", "storeDomain", "countries", "countriesLoading", "useCountries", "classNames"]
|
|
7
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { RedeemableItem as RedeemableItemType } from '../../type';
|
|
2
|
-
import { CreditsRedeemListCopy } from '../type';
|
|
3
|
-
type InitProps = {
|
|
4
|
-
copy: CreditsRedeemListCopy;
|
|
5
|
-
item: RedeemableItemType;
|
|
6
|
-
loading: boolean;
|
|
7
|
-
disabled: boolean;
|
|
8
|
-
setStatus: (status: 'address' | 'init' | 'success' | 'error') => void;
|
|
9
|
-
};
|
|
10
|
-
export declare const Init: ({ copy, item, loading, disabled, setStatus }: InitProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
export {};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var g=Object.create;var p=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var N=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty;var w=(l,t)=>{for(var d in t)p(l,d,{get:t[d],enumerable:!0})},f=(l,t,d,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of b(t))!h.call(l,a)&&a!==d&&p(l,a,{get:()=>t[a],enumerable:!(i=v(t,a))||i.enumerable});return l};var y=(l,t,d)=>(d=l!=null?g(N(l)):{},f(t||!l||!l.__esModule?p(d,"default",{value:l,enumerable:!0}):d,l)),C=l=>f(p({},"__esModule",{value:!0}),l);var T={};w(T,{Init:()=>M});module.exports=C(T);var e=require("react/jsx-runtime"),s=require("@anker-in/headless-ui"),r=y(require("classnames")),x=require("react"),u=require("../../context/utils"),n=require("../../context/const");const M=({copy:l,item:t,loading:d,disabled:i,setStatus:a})=>{const c=(0,x.useMemo)(()=>t.config.rules?.length?t.config.rules:[...t.config.desc?.split("<br>")||[],...l.redeemModal.product.rules||[]],[t.config.rules,t.config.desc,l.redeemModal.product.rules]);return console.log("item",t),(0,e.jsxs)("div",{className:"flex flex-col",children:[(0,e.jsx)("div",{className:(0,r.default)("max-h-[500px] overflow-y-auto bg-[#F5F5F7] px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]"),children:(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"relative mx-auto h-[164px] w-fit",children:[(0,e.jsx)(s.Picture,{source:t.config?.type===n.ConsumeType.Product?t.product.images[0]?.url:l?.imageMapping[t.config.type]?.url||t.config.image?.url,className:"h-full w-auto [&_img]:h-full [&_img]:w-auto [&_img]:object-contain"}),(0,e.jsx)("div",{className:"absolute bottom-[8px] left-[16px] font-extrabold text-white",children:t.config.value&&(0,e.jsxs)("div",{className:"flex items-end gap-[4px]",children:[(0,e.jsx)(s.Text,{className:"text-[64px] font-bold leading-none",html:t.config.value.toString()}),(0,e.jsx)(s.Text,{className:"text-[24px] font-bold leading-[2]",html:t.config.type===n.ConsumeType.Coupon?l?.off:l?.giftCardLabel})]})})]}),(0,e.jsxs)("div",{className:"mt-[30px] md:mt-[18px]",children:[t.config.type==="product"&&(0,e.jsx)("div",{className:(0,r.default)("mb-[4px] text-center text-[24px] font-bold leading-[1.2] md:text-[20px] md:leading-[1.2]"),children:t.config.title}),(0,e.jsxs)(s.Text,{as:"p",className:(0,r.default)(" text-center text-[24px] font-bold leading-[1.2] md:text-[20px] md:leading-[1.2]"),children:[(0,u.numberFormat)(t.alpc?.consumeCredits)," ",l?.pointUnit]})]}),(0,e.jsxs)("div",{className:"mt-[16px] w-full text-[14px] font-semibold text-[#777] md:mt-[12px]",children:[(0,e.jsx)("div",{className:"text-[16px] font-bold leading-[1.4]",children:l.redeemModal.product.stepTitle}),(0,e.jsx)("div",{className:"mt-[4px] flex items-center justify-center",children:l.redeemModal.product.steps?.map((o,m)=>(0,e.jsxs)(x.Fragment,{children:[(0,e.jsxs)("div",{className:"flex w-[76px] flex-col items-center text-center md:h-[94px] min-l:w-[130px]",children:[(0,e.jsx)(s.Picture,{source:o.imageUrl,className:"mb-[4px] h-[58px] w-[58px]"}),(0,e.jsx)("div",{className:"min-h-[34px] text-[14px] font-bold text-[#777] md:min-h-[28px] md:text-[12px]",children:o.title})]}),m!==l.redeemModal.product.steps.length-1&&(0,e.jsx)(s.Picture,{source:"https://cdn.shopify.com/s/files/1/0517/6767/3016/files/step-arrow.png?v=1690458150",className:"mb-[20px] h-[10px] w-[20px] md:mb-[30px] md:h-[5px] md:w-[12px]"})]},m))}),(0,e.jsx)("div",{className:"overflow-auto",children:c?.length&&(0,e.jsx)("ul",{className:"ml-[18px] mt-[16px] grid grid-flow-row gap-[4px] text-[16px] font-bold leading-[1.4] text-[#6D6D6F] md:mt-[12px]",children:c.map((o,m)=>(0,e.jsx)("li",{className:"list-disc",children:(0,e.jsx)(s.Text,{as:"div",html:o,className:"font-bold"})},m))})})]})]})}),(0,e.jsxs)("div",{className:"flex-1 bg-white px-[48px] py-[24px] text-center md:px-[16px]",children:[(0,e.jsx)(s.Text,{as:"p",className:"block text-[24px] font-bold leading-[1.2] md:text-[20px] md:leading-[1.2]",html:l.redeemModal.confirmTitle}),(0,e.jsx)(s.Button,{loading:d,disabled:i,variant:"primary",size:"lg",className:"mt-[16px] w-full md:mt-[12px]",onClick:()=>{a("address")},children:l.redeemModal.confirmButton})]})]})};
|
|
2
|
-
//# sourceMappingURL=Init.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../src/components/credits/credits-redeem-list/redeem-product-modal/Init.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Button, Picture, Text } from '@anker-in/headless-ui'\nimport classNames from 'classnames'\nimport { Fragment, useMemo } from 'react'\nimport { numberFormat } from '../../context/utils'\nimport type { RedeemableItem as RedeemableItemType } from '../../type'\nimport { CreditsRedeemListCopy } from '../type'\nimport { ConsumeType } from '../../context/const'\n\ntype InitProps = {\n copy: CreditsRedeemListCopy\n item: RedeemableItemType\n loading: boolean\n disabled: boolean\n setStatus: (status: 'address' | 'init' | 'success' | 'error') => void\n}\n\nexport const Init = ({ copy, item, loading, disabled, setStatus }: InitProps) => {\n const rules = useMemo(() => {\n if (item.config.rules?.length) {\n return item.config.rules\n }\n const descriptions = item.config.desc?.split('<br>') || []\n return [...descriptions, ...(copy.redeemModal.product.rules || [])]\n }, [item.config.rules, item.config.desc, copy.redeemModal.product.rules])\n\n console.log('item', item)\n return (\n <div className=\"flex flex-col\">\n <div\n className={classNames(\n 'max-h-[500px] overflow-y-auto bg-[#F5F5F7] px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]'\n )}\n >\n <>\n <div className=\"relative mx-auto h-[164px] w-fit\">\n <Picture\n source={\n item.config?.type === ConsumeType.Product\n ? item.product.images[0]?.url\n : copy?.imageMapping[item.config.type]?.url || item.config.image?.url\n }\n className=\"h-full w-auto [&_img]:h-full [&_img]:w-auto [&_img]:object-contain\"\n ></Picture>\n {/* \u793C\u54C1\u5361\u5C55\u793A */}\n <div className=\"absolute bottom-[8px] left-[16px] font-extrabold text-white\">\n {item.config.value && (\n <div className=\"flex items-end gap-[4px]\">\n <Text className=\"text-[64px] font-bold leading-none\" html={item.config.value.toString()} />\n <Text\n className=\"text-[24px] font-bold leading-[2]\"\n html={item.config.type === ConsumeType.Coupon ? copy?.off : copy?.giftCardLabel}\n />\n </div>\n )}\n </div>\n </div>\n <div className=\"mt-[30px] md:mt-[18px]\">\n {item.config.type === 'product' && (\n <div\n className={classNames(\n 'mb-[4px] text-center text-[24px] font-bold leading-[1.2] md:text-[20px] md:leading-[1.2]'\n )}\n >\n {item.config.title}\n </div>\n )}\n <Text\n as=\"p\"\n className={classNames(' text-center text-[24px] font-bold leading-[1.2] md:text-[20px] md:leading-[1.2]')}\n >\n {numberFormat(item.alpc?.consumeCredits)} {copy?.pointUnit}\n </Text>\n </div>\n <div className=\"mt-[16px] w-full text-[14px] font-semibold text-[#777] md:mt-[12px]\">\n <div className=\"text-[16px] font-bold leading-[1.4]\">{copy.redeemModal.product.stepTitle}</div>\n <div className=\"mt-[4px] flex items-center justify-center\">\n {copy.redeemModal.product.steps?.map((item, index) => (\n <Fragment key={index}>\n <div className=\"flex w-[76px] flex-col items-center text-center md:h-[94px] min-l:w-[130px]\">\n <Picture source={item.imageUrl} className=\"mb-[4px] h-[58px] w-[58px]\"></Picture>\n <div className=\"min-h-[34px] text-[14px] font-bold text-[#777] md:min-h-[28px] md:text-[12px]\">\n {item.title}\n </div>\n </div>\n {index !== copy.redeemModal.product.steps.length - 1 && (\n <Picture\n source=\"https://cdn.shopify.com/s/files/1/0517/6767/3016/files/step-arrow.png?v=1690458150\"\n className=\"mb-[20px] h-[10px] w-[20px] md:mb-[30px] md:h-[5px] md:w-[12px]\"\n ></Picture>\n )}\n </Fragment>\n ))}\n </div>\n <div className=\"overflow-auto\">\n {rules?.length && (\n <ul className=\"ml-[18px] mt-[16px] grid grid-flow-row gap-[4px] text-[16px] font-bold leading-[1.4] text-[#6D6D6F] md:mt-[12px]\">\n {rules.map((text, index) => (\n <li className=\"list-disc\" key={index}>\n <Text as=\"div\" html={text} className=\"font-bold\" />\n </li>\n ))}\n </ul>\n )}\n </div>\n </div>\n </>\n </div>\n <div className=\"flex-1 bg-white px-[48px] py-[24px] text-center md:px-[16px]\">\n <Text\n as=\"p\"\n className=\"block text-[24px] font-bold leading-[1.2] md:text-[20px] md:leading-[1.2]\"\n html={copy.redeemModal.confirmTitle}\n ></Text>\n <Button\n loading={loading}\n disabled={disabled}\n variant=\"primary\"\n size=\"lg\"\n className=\"mt-[16px] w-full md:mt-[12px]\"\n onClick={() => {\n setStatus('address')\n }}\n >\n {copy.redeemModal.confirmButton}\n </Button>\n </div>\n </div>\n )\n}\n"],
|
|
5
|
-
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,UAAAE,IAAA,eAAAC,EAAAH,GAiCQ,IAAAI,EAAA,6BAjCRC,EAAsC,iCACtCC,EAAuB,yBACvBC,EAAkC,iBAClCC,EAA6B,+BAG7BC,EAA4B,+BAUrB,MAAMP,EAAO,CAAC,CAAE,KAAAQ,EAAM,KAAAC,EAAM,QAAAC,EAAS,SAAAC,EAAU,UAAAC,CAAU,IAAiB,CAC/E,MAAMC,KAAQ,WAAQ,IAChBJ,EAAK,OAAO,OAAO,OACdA,EAAK,OAAO,MAGd,CAAC,GADaA,EAAK,OAAO,MAAM,MAAM,MAAM,GAAK,CAAC,EAChC,GAAID,EAAK,YAAY,QAAQ,OAAS,CAAC,CAAE,EACjE,CAACC,EAAK,OAAO,MAAOA,EAAK,OAAO,KAAMD,EAAK,YAAY,QAAQ,KAAK,CAAC,EAExE,eAAQ,IAAI,OAAQC,CAAI,KAEtB,QAAC,OAAI,UAAU,gBACb,oBAAC,OACC,aAAW,EAAAK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I,CAACG,EAAMD,OAChB,OAAC,MAAG,UAAU,YACZ,mBAAC,QAAK,GAAG,MAAM,KAAMC,EAAM,UAAU,YAAY,GADpBD,CAE/B,CACD,EACH,EAEJ,GACF,GACF,EACF,KACA,QAAC,OAAI,UAAU,+DACb,oBAAC,QACC,GAAG,IACH,UAAU,4EACV,KAAMP,EAAK,YAAY,aACxB,KACD,OAAC,UACC,QAASE,EACT,SAAUC,EACV,QAAQ,UACR,KAAK,KACL,UAAU,gCACV,QAAS,IAAM,CACbC,EAAU,SAAS,CACrB,EAEC,SAAAJ,EAAK,YAAY,cACpB,GACF,GACF,CAEJ",
|
|
6
|
-
"names": ["Init_exports", "__export", "Init", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_classnames", "import_react", "import_utils", "import_const", "copy", "item", "loading", "disabled", "setStatus", "rules", "classNames", "index", "text"]
|
|
7
|
-
}
|
package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/ProductInfo.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { RedeemableItem as RedeemableItemType } from '../../type';
|
|
2
|
-
import { CreditsRedeemListCopy } from '../type';
|
|
3
|
-
type ProductInfoProps = {
|
|
4
|
-
item: RedeemableItemType;
|
|
5
|
-
copy: CreditsRedeemListCopy;
|
|
6
|
-
};
|
|
7
|
-
export declare const ProductInfo: ({ item, copy }: ProductInfoProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export {};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var s=Object.defineProperty;var o=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var n=Object.prototype.hasOwnProperty;var x=(t,a)=>{for(var d in a)s(t,d,{get:a[d],enumerable:!0})},u=(t,a,d,i)=>{if(a&&typeof a=="object"||typeof a=="function")for(let m of c(a))!n.call(t,m)&&m!==d&&s(t,m,{get:()=>a[m],enumerable:!(i=o(a,m))||i.enumerable});return t};var f=t=>u(s({},"__esModule",{value:!0}),t);var b={};x(b,{ProductInfo:()=>v});module.exports=f(b);var e=require("react/jsx-runtime"),l=require("@anker-in/headless-ui"),r=require("../../context/utils"),p=require("@shopify/context");const v=({item:t,copy:a})=>{const{locale:d}=(0,p.useShopifyContext)();return(0,e.jsxs)("div",{className:"flex w-full items-center justify-center md:items-start md:justify-start",children:[(0,e.jsx)(l.Picture,{className:"mr-[16px] size-[100px] shrink-0 md:mr-[12px] md:hidden md:size-[44px] [&_img]:h-full [&_img]:w-auto [&_img]:object-contain",source:t.variant.image?.url||t.product?.images[0]?.url,alt:t.product.title}),(0,e.jsxs)("div",{className:"md:flex md:flex-col",children:[(0,e.jsxs)("div",{className:"md:flex md:items-center",children:[(0,e.jsx)(l.Picture,{className:"mr-[16px] size-[100px] shrink-0 md:mr-[12px] md:size-[44px] min-md:hidden [&_img]:h-full [&_img]:w-auto [&_img]:object-contain",source:t.variant.image?.url||t.product?.images[0]?.url,alt:t.product.title}),(0,e.jsx)("div",{className:"flex-1 text-[16px] font-bold leading-[1.4] min-l:!hidden",title:t.product.title,children:t.product.title})]}),(0,e.jsxs)("div",{className:"mt-[16px] md:mt-[12px]",children:[(0,e.jsx)("div",{className:"mb-[12px] line-clamp-1 text-[16px] font-bold l:!hidden",title:t.product.title,children:t.product.title}),(0,e.jsxs)("div",{className:"flex font-semibold leading-[1.4] md:flex-col",children:[(0,e.jsxs)("div",{className:"mr-[40px] text-[15px] font-bold text-[#777] md:mr-0 md:text-[12px]",children:[(0,e.jsxs)("div",{className:"mb-[8px] flex items-center md:mb-[4px]",children:[(0,e.jsxs)("span",{children:[a.redeemModal.product.variantLabel,": "]}),(0,e.jsx)("span",{className:"ml-1",children:t.variant.title||""})]}),(0,e.jsxs)("div",{className:"mb-[8px] flex items-center md:mb-[4px]",children:[(0,e.jsxs)("span",{children:[a.redeemModal.product.shippingFeeLabel,": "]}),(0,e.jsx)("span",{className:"ml-1",children:(0,r.formatPrice)({amount:0,currencyCode:t.product.price?.currencyCode,locale:d||"us"})})]})]}),(0,e.jsxs)("div",{className:"text-[15px] font-bold text-[#777] md:text-[12px]",children:[(0,e.jsxs)("div",{className:"mb-[8px] flex items-center md:mb-[4px]",children:[(0,e.jsxs)("span",{children:[a.redeemModal.product.quantityLabel,": "]}),(0,e.jsx)("span",{className:"ml-1",children:"1"})]}),(0,e.jsxs)("div",{className:"l:flex l:items-center l:justify-between",children:[(0,e.jsxs)("span",{children:[a.redeemModal.product.totalPriceLabel,": "]}),(0,e.jsxs)("span",{className:"ml-1",children:[t.alpc?.consumeCredits," ",a?.pointUnit]})]})]})]})]})]})]})};
|
|
2
|
-
//# sourceMappingURL=ProductInfo.js.map
|
package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/ProductInfo.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../src/components/credits/credits-redeem-list/redeem-product-modal/ProductInfo.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Picture } from '@anker-in/headless-ui'\nimport { formatPrice } from '../../context/utils'\nimport type { RedeemableItem as RedeemableItemType } from '../../type'\nimport { CreditsRedeemListCopy } from '../type'\nimport { useShopifyContext } from '@shopify/context'\n\ntype ProductInfoProps = {\n item: RedeemableItemType\n copy: CreditsRedeemListCopy\n}\n\nexport const ProductInfo = ({ item, copy }: ProductInfoProps) => {\n const { locale } = useShopifyContext()\n\n return (\n <div className=\"flex w-full items-center justify-center md:items-start md:justify-start\">\n <Picture\n className=\"mr-[16px] size-[100px] shrink-0 md:mr-[12px] md:hidden md:size-[44px] [&_img]:h-full [&_img]:w-auto [&_img]:object-contain\"\n source={item.variant.image?.url || item.product?.images[0]?.url}\n alt={item.product.title}\n ></Picture>\n <div className=\"md:flex md:flex-col\">\n <div className=\"md:flex md:items-center\">\n <Picture\n className=\"mr-[16px] size-[100px] shrink-0 md:mr-[12px] md:size-[44px] min-md:hidden [&_img]:h-full [&_img]:w-auto [&_img]:object-contain\"\n source={item.variant.image?.url || item.product?.images[0]?.url}\n alt={item.product.title}\n ></Picture>\n <div className=\"flex-1 text-[16px] font-bold leading-[1.4] min-l:!hidden\" title={item.product.title}>\n {item.product.title}\n </div>\n </div>\n\n <div className=\"mt-[16px] md:mt-[12px]\">\n <div className=\"mb-[12px] line-clamp-1 text-[16px] font-bold l:!hidden\" title={item.product.title}>\n {item.product.title}\n </div>\n <div className=\"flex font-semibold leading-[1.4] md:flex-col\">\n <div className=\"mr-[40px] text-[15px] font-bold text-[#777] md:mr-0 md:text-[12px]\">\n <div className=\"mb-[8px] flex items-center md:mb-[4px]\">\n <span>{copy.redeemModal.product.variantLabel}: </span>\n <span className=\"ml-1\">{item.variant.title || ''}</span>\n </div>\n <div className=\"mb-[8px] flex items-center md:mb-[4px]\">\n <span>{copy.redeemModal.product.shippingFeeLabel}: </span>\n <span className=\"ml-1\">\n {formatPrice({\n amount: 0,\n currencyCode: item.product.price?.currencyCode!,\n locale: locale || 'us',\n })}\n </span>\n </div>\n </div>\n <div className=\"text-[15px] font-bold text-[#777] md:text-[12px]\">\n <div className=\"mb-[8px] flex items-center md:mb-[4px]\">\n <span>{copy.redeemModal.product.quantityLabel}: </span>\n <span className=\"ml-1\">1</span>\n </div>\n <div className=\"l:flex l:items-center l:justify-between\">\n <span>{copy.redeemModal.product.totalPriceLabel}: </span>\n <span className=\"ml-1\">\n {item.alpc?.consumeCredits} {copy?.pointUnit}\n </span>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n )\n}\n"],
|
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,iBAAAE,IAAA,eAAAC,EAAAH,GAgBM,IAAAI,EAAA,6BAhBNC,EAAwB,iCACxBC,EAA4B,+BAG5BC,EAAkC,4BAO3B,MAAML,EAAc,CAAC,CAAE,KAAAM,EAAM,KAAAC,CAAK,IAAwB,CAC/D,KAAM,CAAE,OAAAC,CAAO,KAAI,qBAAkB,EAErC,SACE,QAAC,OAAI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GACF,GACF,GACF,GACF,GACF,CAEJ",
|
|
6
|
-
"names": ["ProductInfo_exports", "__export", "ProductInfo", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_utils", "import_context", "item", "copy", "locale"]
|
|
7
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { RedeemableItem as RedeemableItemType } from '../../type';
|
|
2
|
-
import { CreditsRedeemListCopy } from '../type';
|
|
3
|
-
type SuccessProps = {
|
|
4
|
-
copy: CreditsRedeemListCopy;
|
|
5
|
-
shippingProduct: string;
|
|
6
|
-
loading: boolean;
|
|
7
|
-
address: Record<string, any> | undefined;
|
|
8
|
-
disabled: boolean;
|
|
9
|
-
onClose: () => void;
|
|
10
|
-
item: RedeemableItemType;
|
|
11
|
-
};
|
|
12
|
-
export declare const Success: ({ copy, shippingProduct, loading, address, disabled, onClose, item }: SuccessProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
export {};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var f=Object.create;var a=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var v=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty;var N=(e,t)=>{for(var m in t)a(e,m,{get:t[m],enumerable:!0})},l=(e,t,m,p)=>{if(t&&typeof t=="object"||typeof t=="function")for(let d of y(t))!g.call(e,d)&&d!==m&&a(e,d,{get:()=>t[d],enumerable:!(p=b(t,d))||p.enumerable});return e};var w=(e,t,m)=>(m=e!=null?f(v(e)):{},l(t||!e||!e.__esModule?a(m,"default",{value:e,enumerable:!0}):m,e)),C=e=>l(a({},"__esModule",{value:!0}),e);var T={};N(T,{Success:()=>R});module.exports=C(T);var o=require("react/jsx-runtime"),s=require("@anker-in/headless-ui"),r=w(require("classnames")),i=require("./ProductInfo");const R=({copy:e,shippingProduct:t,loading:m,address:p,disabled:d,onClose:x,item:n})=>(0,o.jsx)("div",{className:(0,r.default)("max-h-[500px] overflow-y-auto px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]"),children:(0,o.jsxs)("div",{className:"flex flex-col items-center",children:[(0,o.jsx)("div",{className:"mb-[16px] grid grid-flow-row gap-y-[4px] md:mb-[12px]",children:e.redeemModal.product.successDesc.map((c,u)=>(0,o.jsx)(s.Text,{className:"text-[18px] font-bold leading-[1.4] md:text-[14px]",html:c},u))}),t&&(0,o.jsx)(s.Text,{className:"mb-5 text-[16px] font-bold",html:t}),(0,o.jsx)("div",{className:"flex w-full items-center rounded-[16px] bg-[#F5F5F7] p-[16px]",children:(0,o.jsx)(i.ProductInfo,{item:n,copy:e})}),(0,o.jsx)(s.Button,{loading:m||!p,variant:"primary",className:"mx-auto mt-[16px] w-[444px] md:mt-[12px] md:w-full",onClick:x,disabled:d,children:e.redeemModal.product.paymentButton})]})});
|
|
2
|
-
//# sourceMappingURL=Success.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../src/components/credits/credits-redeem-list/redeem-product-modal/Success.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Button, Text } from '@anker-in/headless-ui'\nimport classNames from 'classnames'\nimport type { RedeemableItem as RedeemableItemType } from '../../type'\nimport { CreditsRedeemListCopy } from '../type'\nimport { ProductInfo } from './ProductInfo'\n\ntype SuccessProps = {\n copy: CreditsRedeemListCopy\n shippingProduct: string\n loading: boolean\n address: Record<string, any> | undefined\n disabled: boolean\n onClose: () => void\n item: RedeemableItemType\n}\n\nexport const Success = ({ copy, shippingProduct, loading, address, disabled, onClose, item }: SuccessProps) => {\n return (\n <div className={classNames('max-h-[500px] overflow-y-auto px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]')}>\n <div className=\"flex flex-col items-center\">\n <div className=\"mb-[16px] grid grid-flow-row gap-y-[4px] md:mb-[12px]\">\n {copy.redeemModal.product.successDesc.map((description: string, index: number) => (\n <Text key={index} className=\"text-[18px] font-bold leading-[1.4] md:text-[14px]\" html={description}></Text>\n ))}\n </div>\n\n {shippingProduct && <Text className=\"mb-5 text-[16px] font-bold\" html={shippingProduct}></Text>}\n\n <div className=\"flex w-full items-center rounded-[16px] bg-[#F5F5F7] p-[16px]\">\n <ProductInfo item={item} copy={copy} />\n </div>\n\n <Button\n loading={loading || !address}\n variant=\"primary\"\n className=\"mx-auto mt-[16px] w-[444px] md:mt-[12px] md:w-full\"\n onClick={onClose}\n disabled={disabled}\n >\n {copy.redeemModal.product.paymentButton}\n </Button>\n </div>\n </div>\n )\n}\n"],
|
|
5
|
-
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAmBM,IAAAI,EAAA,6BAnBNC,EAA6B,iCAC7BC,EAAuB,yBAGvBC,EAA4B,yBAYrB,MAAML,EAAU,CAAC,CAAE,KAAAM,EAAM,gBAAAC,EAAiB,QAAAC,EAAS,QAAAC,EAAS,SAAAC,EAAU,QAAAC,EAAS,KAAAC,CAAK,OAEvF,OAAC,OAAI,aAAW,EAAAC,SAAW,iFAAiF,EAC1G,oBAAC,OAAI,UAAU,6BACb,oBAAC,OAAI,UAAU,wDACZ,SAAAP,EAAK,YAAY,QAAQ,YAAY,IAAI,CAACQ,EAAqBC,OAC9D,OAAC,QAAiB,UAAU,qDAAqD,KAAMD,GAA5EC,CAAyF,CACrG,EACH,EAECR,MAAmB,OAAC,QAAK,UAAU,6BAA6B,KAAMA,EAAiB,KAExF,OAAC,OAAI,UAAU,gEACb,mBAAC,eAAY,KAAMK,EAAM,KAAMN,EAAM,EACvC,KAEA,OAAC,UACC,QAASE,GAAW,CAACC,EACrB,QAAQ,UACR,UAAU,qDACV,QAASE,EACT,SAAUD,EAET,SAAAJ,EAAK,YAAY,QAAQ,cAC5B,GACF,EACF",
|
|
6
|
-
"names": ["Success_exports", "__export", "Success", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_classnames", "import_ProductInfo", "copy", "shippingProduct", "loading", "address", "disabled", "onClose", "item", "classNames", "description", "index"]
|
|
7
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { AlpcErrorCode } from '../../context/const';
|
|
2
|
-
import type { ModalContainerProps } from '../../modal/modalContainer';
|
|
3
|
-
import type { RedeemableItem as RedeemableItemType } from '../../type';
|
|
4
|
-
import { CreditsRedeemListCopy } from '../type';
|
|
5
|
-
type RedeemProductModalProps = ModalContainerProps & {
|
|
6
|
-
item: RedeemableItemType;
|
|
7
|
-
copy: CreditsRedeemListCopy;
|
|
8
|
-
onError: (code: AlpcErrorCode) => void;
|
|
9
|
-
};
|
|
10
|
-
declare function RedeemProductModal({ item, copy, onError, ...props }: RedeemProductModalProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
export default RedeemProductModal;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var W=Object.create;var g=Object.defineProperty;var X=Object.getOwnPropertyDescriptor;var Y=Object.getOwnPropertyNames;var Z=Object.getPrototypeOf,$=Object.prototype.hasOwnProperty;var j=(r,e)=>{for(var t in e)g(r,t,{get:e[t],enumerable:!0})},N=(r,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Y(e))!$.call(r,i)&&i!==t&&g(r,i,{get:()=>e[i],enumerable:!(a=X(e,i))||a.enumerable});return r};var S=(r,e,t)=>(t=r!=null?W(Z(r)):{},N(e||!r||!r.__esModule?g(t,"default",{value:r,enumerable:!0}):t,r)),D=r=>N(g({},"__esModule",{value:!0}),r);var oe={};j(oe,{default:()=>re});module.exports=D(oe);var l=require("react/jsx-runtime"),v=S(require("classnames")),s=require("react"),y=require("../../context/provider"),L=S(require("../../context/hooks/useCountries")),f=require("../../context/const"),x=require("../../context/hooks/useAddressValidate"),U=require("../../context/hooks/useRedeemProduct"),O=require("../../modal/modalContainer"),q=require("@shopify/context"),w=require("./Error"),F=require("./Success"),K=require("./Address"),_=require("./Init");function ee({item:r,copy:e,onError:t,...a}){const{fetchCreditInfo:i,profile:b}=(0,y.useCreditsContext)(),{storeDomain:k,locale:T}=(0,q.useShopifyContext)(),{validatorInfo:B}=e,{shippingAddress:G,shippingProduct:P}=e.redeemModal.product,[m,c]=(0,s.useState)("init"),[n,J]=(0,s.useState)(),[V,p]=(0,s.useState)({code:0,message:"",imageUrl:""}),[C,u]=(0,s.useState)(!1),{countries:R=[],isLoading:de}=(0,L.default)({shopifyStoreDomain:k}),{isMutating:M,trigger:A}=(0,U.useRedeemProduct)({onSuccess(o){if(!o){c("error"),p({code:0,imageUrl:e.redeemModal.errorImageUrl||"",message:e.redeemModal.commonError||""});return}if(o?.code===0)i(b?.user_id),c("success");else{let d,I;o.code===f.AlpcErrorCode.CodeLpcShopifyCouponRuleRedeemLimit?(d=e.redeemModal.redeemLimitError,u(!0)):o.code===f.AlpcErrorCode.CodeLpcRuleInventoryNotEnough?(d=e.redeemModal.inventoryNotEnough,u(!0),I=e.redeemModal.inventoryNotEnough):o.code===f.AlpcErrorCode.CodeLpcNotEnoughCredits?(d=e.redeemModal.creditsNotEnough,u(!0),i(b?.user_id)):o.code===f.AlpcErrorCode.CodeCrossSiteError&&(d=e.redeemModal.crossSiteError,u(!0)),c("error"),p({code:o.code,imageUrl:I||e.redeemModal.errorImageUrl||"",message:d||e.redeemModal.commonError||""}),t&&t(o.code)}},onError(o){c("error"),p({code:0,imageUrl:e.redeemModal.errorImageUrl||"",message:e.redeemModal.commonError||""})}}),h=(0,s.useMemo)(()=>e?.redeemModal.product.form?.flat().find(d=>d.type==="state")?.key,[e?.redeemModal.product.form]),{validate:E,errors:z}=(0,x.useAddressValidate)({address:n,validatorInfo:B,formData:e?.redeemModal.product.form?.flat()||[],errorLabel:{require:e.redeemModal.product.required,email:e.redeemModal.product.invalidEmail}}),H=(0,s.useCallback)(async()=>{const o=[];if(h&&((R.find(Q=>Q.code===n.country)?.provinces||[]).length||o.push(h)),E({force:!0,ignoreKeys:o}))return;console.log("address",n);let d={...n};d.name&&delete d.name,d.country==="UK"&&(d.country="GB"),A({address:btoa(JSON.stringify(d)),rule_id:Number(r.alpc?.id)})},[r,A,h,E,n,R]);return(0,s.useEffect)(()=>{a.isOpen||(u(!1),p({code:0,message:"",imageUrl:""}))},[a.isOpen,T]),(0,l.jsxs)(O.CreditsModalContainer,{...a,className:(0,v.default)("w-[540px] md:h-auto min-md:max-h-[calc(100vh-40px)]",m!=="init"&&"w-[740px] md:w-full"),scrollClassName:"mb-0 min-l:px-0 md:mb-0 px-0",titleClassName:(0,v.default)("h-[56px]",m==="init"&&"bg-[#F5F5F7]"),title:m==="address"?"Order Confirmation":"",children:[m==="error"&&(0,l.jsx)(w.Error,{errorInfo:V}),m==="success"&&(0,l.jsx)(F.Success,{copy:e,shippingProduct:P,loading:M,address:n,disabled:C,onClose:a.onClose,item:r}),m==="address"&&(0,l.jsx)(K.Address,{copy:e,shippingAddress:G,setAddress:J,validateAddress:E,validateErrors:z,shippingProduct:P,loading:M,address:n,disabled:C,handlePayment:H,item:r}),m==="init"&&(0,l.jsx)(_.Init,{item:r,copy:e,loading:M,disabled:C,setStatus:c})]})}var re=ee;
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../src/components/credits/credits-redeem-list/redeem-product-modal/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import classNames from 'classnames'\nimport { useCallback, useEffect, useMemo, useState } from 'react'\nimport { useCreditsContext } from '../../context/provider'\nimport useCountries from '../../context/hooks/useCountries'\nimport { AlpcErrorCode } from '../../context/const'\nimport { useAddressValidate } from '../../context/hooks/useAddressValidate'\nimport { useRedeemProduct } from '../../context/hooks/useRedeemProduct'\nimport type { ModalContainerProps } from '../../modal/modalContainer'\nimport { CreditsModalContainer } from '../../modal/modalContainer'\nimport type { RedeemableItem as RedeemableItemType } from '../../type'\nimport { useShopifyContext } from '@shopify/context'\nimport { CreditsRedeemListCopy } from '../type'\nimport { Error } from './Error'\nimport { Success } from './Success'\nimport { Address } from './Address'\nimport { Init } from './Init'\n\ntype RedeemProductModalProps = ModalContainerProps & {\n item: RedeemableItemType\n copy: CreditsRedeemListCopy\n onError: (code: AlpcErrorCode) => void\n}\n\nfunction RedeemProductModal({ item, copy, onError, ...props }: RedeemProductModalProps) {\n const { fetchCreditInfo, profile } = useCreditsContext()\n const { storeDomain, locale } = useShopifyContext()\n\n const { validatorInfo } = copy\n const { shippingAddress, shippingProduct } = copy.redeemModal.product\n\n const [status, setStatus] = useState<'init' | 'address' | 'success' | 'error'>('init')\n const [address, setAddress] = useState<any>()\n const [errorInfo, setErrorInfo] = useState({\n code: 0,\n message: '',\n imageUrl: '',\n })\n const [disabled, setDisabled] = useState(false)\n\n const { countries = [], isLoading: countriesLoading } = useCountries({ shopifyStoreDomain: storeDomain })\n\n const { isMutating: loading, trigger } = useRedeemProduct({\n onSuccess(responseData) {\n if (!responseData) {\n setStatus('error')\n setErrorInfo({\n code: 0,\n imageUrl: copy.redeemModal.errorImageUrl || '',\n message: copy.redeemModal.commonError || '',\n })\n return\n }\n\n if (responseData?.code === 0) {\n fetchCreditInfo(profile?.user_id)\n setStatus('success')\n } else {\n let errorMsg\n let errorImage\n if (responseData.code === AlpcErrorCode.CodeLpcShopifyCouponRuleRedeemLimit) {\n errorMsg = copy.redeemModal.redeemLimitError\n setDisabled(true)\n } else if (responseData.code === AlpcErrorCode.CodeLpcRuleInventoryNotEnough) {\n errorMsg = copy.redeemModal.inventoryNotEnough\n setDisabled(true)\n errorImage = copy.redeemModal.inventoryNotEnough\n } else if (responseData.code === AlpcErrorCode.CodeLpcNotEnoughCredits) {\n errorMsg = copy.redeemModal.creditsNotEnough\n setDisabled(true)\n fetchCreditInfo(profile?.user_id)\n } else if (responseData.code === AlpcErrorCode.CodeCrossSiteError) {\n errorMsg = copy.redeemModal.crossSiteError\n setDisabled(true)\n }\n\n setStatus('error')\n setErrorInfo({\n code: responseData.code,\n imageUrl: errorImage || copy.redeemModal.errorImageUrl || '',\n message: errorMsg || copy.redeemModal.commonError || '',\n })\n onError && onError(responseData.code)\n }\n },\n onError(error) {\n setStatus('error')\n setErrorInfo({\n code: 0,\n imageUrl: copy.redeemModal.errorImageUrl || '',\n message: copy.redeemModal.commonError || '',\n })\n },\n })\n\n const stateInputKey = useMemo(() => {\n const stateInput = copy?.redeemModal.product.form?.flat().find(item => item.type === 'state')\n return stateInput?.key\n }, [copy?.redeemModal.product.form])\n\n const { validate: validateAddress, errors: validateErrors } = useAddressValidate({\n address: address,\n validatorInfo: validatorInfo,\n formData: copy?.redeemModal.product.form?.flat() || [],\n errorLabel: {\n require: copy.redeemModal.product.required,\n email: copy.redeemModal.product.invalidEmail,\n },\n })\n\n const handlePayment = useCallback(async () => {\n const ignoreKeys: string[] = []\n\n if (stateInputKey) {\n const provinces = countries.find(item => item.code === address.country)?.provinces || []\n\n if (!provinces.length) {\n ignoreKeys.push(stateInputKey as never)\n }\n }\n\n if (\n validateAddress({\n force: true,\n ignoreKeys,\n })\n ) {\n // \u5730\u5740\u6821\u9A8C\u9519\u8BEF\n return\n }\n console.log('address', address)\n let requestAddress = { ...address }\n if (requestAddress.name) {\n delete requestAddress.name\n }\n if (requestAddress.country === 'UK') {\n requestAddress.country = 'GB'\n }\n trigger({\n address: btoa(JSON.stringify(requestAddress)),\n rule_id: Number(item.alpc?.id),\n })\n }, [item, trigger, stateInputKey, validateAddress, address, countries])\n\n useEffect(() => {\n if (!props.isOpen) {\n setDisabled(false)\n setErrorInfo({ code: 0, message: '', imageUrl: '' })\n }\n }, [props.isOpen, locale])\n\n return (\n <CreditsModalContainer\n {...props}\n className={classNames(\n 'w-[540px] md:h-auto min-md:max-h-[calc(100vh-40px)]',\n status !== 'init' && 'w-[740px] md:w-full'\n )}\n scrollClassName=\"mb-0 min-l:px-0 md:mb-0 px-0\"\n titleClassName={classNames('h-[56px]', status === 'init' && 'bg-[#F5F5F7]')}\n title={status === 'address' ? 'Order Confirmation' : ''}\n >\n {status === 'error' && <Error errorInfo={errorInfo} />}\n {status === 'success' && (\n <Success\n copy={copy}\n shippingProduct={shippingProduct}\n loading={loading}\n address={address}\n disabled={disabled}\n onClose={props.onClose}\n item={item}\n />\n )}\n {status === 'address' && (\n <Address\n copy={copy}\n shippingAddress={shippingAddress}\n setAddress={setAddress}\n validateAddress={validateAddress}\n validateErrors={validateErrors}\n shippingProduct={shippingProduct}\n loading={loading}\n address={address}\n disabled={disabled}\n handlePayment={handlePayment}\n item={item}\n />\n )}\n {status === 'init' && (\n <Init item={item} copy={copy} loading={loading} disabled={disabled} setStatus={setStatus} />\n )}\n </CreditsModalContainer>\n )\n}\n\nexport default RedeemProductModal\n"],
|
|
5
|
-
"mappings": "0jBAAA,IAAAA,GAAA,GAAAC,EAAAD,GAAA,aAAAE,KAAA,eAAAC,EAAAH,IAuJI,IAAAI,EAAA,6BAvJJC,EAAuB,yBACvBC,EAA0D,iBAC1DC,EAAkC,kCAClCC,EAAyB,+CACzBC,EAA8B,+BAC9BC,EAAmC,kDACnCC,EAAiC,gDAEjCC,EAAsC,sCAEtCC,EAAkC,4BAElCC,EAAsB,mBACtBC,EAAwB,qBACxBC,EAAwB,qBACxBC,EAAqB,kBAQrB,SAASC,GAAmB,CAAE,KAAAC,EAAM,KAAAC,EAAM,QAAAC,EAAS,GAAGC,CAAM,EAA4B,CACtF,KAAM,CAAE,gBAAAC,EAAiB,QAAAC,CAAQ,KAAI,qBAAkB,EACjD,CAAE,YAAAC,EAAa,OAAAC,CAAO,KAAI,qBAAkB,EAE5C,CAAE,cAAAC,CAAc,EAAIP,EACpB,CAAE,gBAAAQ,EAAiB,gBAAAC,CAAgB,EAAIT,EAAK,YAAY,QAExD,CAACU,EAAQC,CAAS,KAAI,YAAmD,MAAM,EAC/E,CAACC,EAASC,CAAU,KAAI,YAAc,EACtC,CAACC,EAAWC,CAAY,KAAI,YAAS,CACzC,KAAM,EACN,QAAS,GACT,SAAU,EACZ,CAAC,EACK,CAACC,EAAUC,CA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YAAW,OAAC,SAAM,UAAWI,EAAW,EACnDJ,IAAW,cACV,OAAC,WACC,KAAMV,EACN,gBAAiBS,EACjB,QAASY,EACT,QAAST,EACT,SAAUI,EACV,QAASd,EAAM,QACf,KAAMH,EACR,EAEDW,IAAW,cACV,OAAC,WACC,KAAMV,EACN,gBAAiBQ,EACjB,WAAYK,EACZ,gBAAiBe,EACjB,eAAgBC,EAChB,gBAAiBpB,EACjB,QAASY,EACT,QAAST,EACT,SAAUI,EACV,cAAec,EACf,KAAM/B,EACR,EAEDW,IAAW,WACV,OAAC,QAAK,KAAMX,EAAM,KAAMC,EAAM,QAASqB,EAAS,SAAUL,EAAU,UAAWL,EAAW,GAE9F,CAEJ,CAEA,IAAO7B,GAAQgB",
|
|
6
|
-
"names": ["redeem_product_modal_exports", "__export", "redeem_product_modal_default", "__toCommonJS", "import_jsx_runtime", "import_classnames", "import_react", "import_provider", "import_useCountries", "import_const", "import_useAddressValidate", "import_useRedeemProduct", "import_modalContainer", "import_context", "import_Error", "import_Success", "import_Address", "import_Init", "RedeemProductModal", "item", "copy", "onError", "props", "fetchCreditInfo", "profile", "storeDomain", "locale", "validatorInfo", "shippingAddress", "shippingProduct", "status", "setStatus", "address", "setAddress", "errorInfo", "setErrorInfo", "disabled", "setDisabled", "countries", "countriesLoading", "useCountries", "loading", "trigger", "responseData", "errorMsg", "errorImage", "error", "stateInputKey", "validateAddress", "validateErrors", "handlePayment", "ignoreKeys", "requestAddress", "classNames"]
|
|
7
|
-
}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { CreditsPageCommon } from '../type';
|
|
2
|
-
export type CreditsRedeemListCopy = {
|
|
3
|
-
title: string;
|
|
4
|
-
giftCardLabel: string;
|
|
5
|
-
unlockRewards: string;
|
|
6
|
-
btnRedeem: string;
|
|
7
|
-
list: {
|
|
8
|
-
label: string;
|
|
9
|
-
list: {
|
|
10
|
-
id: string;
|
|
11
|
-
type: string;
|
|
12
|
-
value: string;
|
|
13
|
-
rules: string[];
|
|
14
|
-
}[];
|
|
15
|
-
}[];
|
|
16
|
-
validatorInfo: {
|
|
17
|
-
addressInfo: {
|
|
18
|
-
name: string;
|
|
19
|
-
country: string;
|
|
20
|
-
province: string;
|
|
21
|
-
city: string;
|
|
22
|
-
address: string;
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
redeemModal: {
|
|
26
|
-
confirmTitle: string;
|
|
27
|
-
confirmButton: string;
|
|
28
|
-
commonError: string;
|
|
29
|
-
redeemLimitError: string;
|
|
30
|
-
inventoryNotEnough: string;
|
|
31
|
-
creditsNotEnough: string;
|
|
32
|
-
crossSiteError: string;
|
|
33
|
-
errorImageUrl: string;
|
|
34
|
-
coupon: {
|
|
35
|
-
successDesc: string;
|
|
36
|
-
successTitle: string;
|
|
37
|
-
successButton: string;
|
|
38
|
-
successButtonUrl: string;
|
|
39
|
-
};
|
|
40
|
-
product: {
|
|
41
|
-
required: string;
|
|
42
|
-
invalidEmail: string;
|
|
43
|
-
shippingAddress: string;
|
|
44
|
-
shippingProduct: string;
|
|
45
|
-
addressForm: {
|
|
46
|
-
key: string;
|
|
47
|
-
type: string;
|
|
48
|
-
label: string;
|
|
49
|
-
isSelect: boolean;
|
|
50
|
-
required: boolean;
|
|
51
|
-
placeholder: string;
|
|
52
|
-
}[][];
|
|
53
|
-
form: {
|
|
54
|
-
key: string;
|
|
55
|
-
type: string;
|
|
56
|
-
isSelect: boolean;
|
|
57
|
-
required: boolean;
|
|
58
|
-
placeholder: string;
|
|
59
|
-
}[][];
|
|
60
|
-
successDesc: string[];
|
|
61
|
-
rules: string[];
|
|
62
|
-
steps: {
|
|
63
|
-
imageUrl: string;
|
|
64
|
-
title: string;
|
|
65
|
-
}[];
|
|
66
|
-
quantityLabel: string;
|
|
67
|
-
totalPriceLabel: string;
|
|
68
|
-
variantLabel: string;
|
|
69
|
-
shippingFeeLabel: string;
|
|
70
|
-
paymentButton: string;
|
|
71
|
-
stepTitle: string;
|
|
72
|
-
};
|
|
73
|
-
};
|
|
74
|
-
copied: string;
|
|
75
|
-
off: string;
|
|
76
|
-
copy: string;
|
|
77
|
-
} & CreditsPageCommon;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../src/components/credits/credits-redeem-list/type.ts"],
|
|
4
|
-
"sourcesContent": ["import { CreditsPageCommon } from '../type'\n\nexport type CreditsRedeemListCopy = {\n title: string\n giftCardLabel: string\n unlockRewards: string\n btnRedeem: string\n list: {\n label: string\n list: {\n id: string\n type: string\n value: string\n rules: string[]\n }[]\n }[]\n validatorInfo: {\n addressInfo: {\n name: string\n country: string\n province: string\n city: string\n address: string\n }\n }\n redeemModal: {\n confirmTitle: string\n confirmButton: string\n commonError: string\n redeemLimitError: string\n inventoryNotEnough: string\n creditsNotEnough: string\n crossSiteError: string\n errorImageUrl: string\n coupon: {\n successDesc: string\n successTitle: string\n successButton: string\n successButtonUrl: string\n }\n product: {\n required: string\n invalidEmail: string\n shippingAddress: string\n shippingProduct: string\n addressForm: {\n key: string\n type: string\n label: string\n isSelect: boolean\n required: boolean\n placeholder: string\n }[][]\n form: {\n key: string\n type: string\n isSelect: boolean\n required: boolean\n placeholder: string\n }[][]\n successDesc: string[]\n rules: string[]\n steps: {\n imageUrl: string\n title: string\n }[]\n quantityLabel: string\n totalPriceLabel: string\n variantLabel: string\n shippingFeeLabel: string\n paymentButton: string\n stepTitle: string\n }\n }\n copied: string\n off: string\n copy: string\n} & CreditsPageCommon\n"],
|
|
5
|
-
"mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
|
|
6
|
-
"names": ["type_exports", "__toCommonJS"]
|
|
7
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var v=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var A=Object.prototype.hasOwnProperty;var B=(i,l)=>{for(var o in l)v(i,o,{get:l[o],enumerable:!0})},G=(i,l,o,a)=>{if(l&&typeof l=="object"||typeof l=="function")for(let n of S(l))!A.call(i,n)&&n!==o&&v(i,n,{get:()=>l[n],enumerable:!(a=D(l,n))||a.enumerable});return i};var M=i=>G(v({},"__esModule",{value:!0}),i);var U={};B(U,{CreditsWaysToGetCredits:()=>P});module.exports=M(U);var e=require("react/jsx-runtime"),s=require("@anker-in/headless-ui"),u=require("@heroicons/react/24/outline"),F=require("framer-motion"),f=require("react"),m=require("./type"),y=require("./useActions"),z=require("../context/provider"),k=require("../../../helpers/index");const P=({copy:i,activate:l,subscribe:o,uploadReceipt:a,classNames:n})=>{const[r,C]=(0,f.useState)(!1),{profile:I}=(0,z.useCreditsContext)(),h=!!I,{actions:b}=(0,y.useActions)({copy:i,activate:l,subscribe:o,uploadReceipt:a}),L=(0,f.useMemo)(()=>{const t=i.list.map(d=>{if(!b[d.id])return;const{finished:p,notLogin:N,notFinished:g,completed:T}=b[d.id];let c="",x,w;return h?p?(c=T.buttonLabel,x=void 0):(c=g.buttonLabel,x=g.handleClick,w=g.link):(c=N.buttonLabel,x=N.handleClick),{...d,buttonLabel:c,handleClick:x,finished:p,link:w}}).filter(Boolean);return h?t.sort((d,p)=>d?.finished&&!p?.finished?1:!d?.finished&&p?.finished?-1:0):t},[b,i.list,h]);return(0,e.jsx)(s.Container,{id:"ways-to-get-credits",className:" bg-[#F5F5F7] [&>div]:l:!px-0",children:(0,e.jsxs)("div",{className:"rounded-[16px] bg-[#1D1D1F] py-[64px] px-[140px] text-white md:px-[16px] l:rounded-none md-l:px-[32px] l-xl:px-[77px]",children:[(0,e.jsx)(s.Heading,{as:"h2",size:4,html:i?.title,className:"text-center l:pl-[16px] l:text-left"}),(0,e.jsxs)("div",{className:"mt-[64px] flex items-center justify-between md:mt-[64px] l:mt-[24px] l:flex-col-reverse l:items-start md-l:mt-[32px]",children:[(0,e.jsxs)("div",{className:"pl-[16px] l:mt-[40px] desktop:pl-[24px] lg-desktop:pl-[32px]",children:[(0,e.jsx)(s.Heading,{size:3,as:"h3",html:i.subtitle,className:n?.subtitle}),(0,e.jsxs)("div",{className:"mt-[8px] flex items-center",children:[i.creditsIcon?.url&&(0,e.jsx)(s.Picture,{className:"size-[48px] mr-[8px] stroke-brand xl:size-[30px] [&_path]:stroke-brand",source:i.creditsIcon.url,alt:i.creditsIcon.alt||"credits"}),(0,e.jsx)(s.Heading,{html:i.equalCredits,size:4,as:"h3",className:(0,k.cn)("mt-2 text-white md:text-[24px]",n?.equalCreditsText)})]})]}),(0,e.jsx)(s.Picture,{className:"w-full laptop:w-[50%]",source:i.mainImage?.url})]}),(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsxs)(F.motion.div,{className:(0,k.cn)("relative mt-[64px] grid grid-cols-3 gap-[16px] overflow-hidden md:mt-[16px] md:grid-cols-1 l:gap-[12px] min-md:!h-auto md-l:mt-[32px] md-l:grid-cols-2"),initial:{height:512},animate:{height:r?"auto":512},transition:{duration:.3},onAnimationComplete:()=>{if(!r&&window.screen.width<768){const t=document.getElementById("ways-to-get-credits");t&&t.scrollIntoView({behavior:"smooth",block:"end"})}},children:[L.map(t=>(0,e.jsxs)("div",{className:"flex min-h-[160px] flex-col justify-between rounded-[16px] bg-white p-[16px] text-[#1D1D1F] desktop:min-h-[192px] desktop:p-[24px] lg-desktop:min-h-[240px] lg-desktop:p-[32px]",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)(s.Heading,{as:"h4",html:t.title,size:2,className:"text-pretty"}),(0,e.jsxs)("div",{className:"mt-[4px] flex items-center",children:[(0,e.jsx)(s.Picture,{className:"size-[24px] xl:size-[18px] [&_path]:size-full",source:"https://cdn.shopify.com/s/files/1/0511/6346/3874/files/20250902-153351.png?v=1756798450"}),(0,e.jsx)(s.Text,{as:"p",html:t.credits,size:2,className:"ml-[4px] mt-[6px] lg-desktop:text-[18px]"})]})]}),t.handleClick&&!(t.id===m.TaskType.UploadReceipt&&a.isSuccess)&&!(t.id===m.TaskType.Activate&&l.isSuccess)&&!(t.id===m.TaskType.Subscribe&&o.isSuccess)?(0,e.jsx)(s.Button,{as:t.link?"a":"button",...t.link&&{href:t.link},...t.handleClick&&{onClick:t.handleClick},variant:"primary",loading:t.id===m.TaskType.Activate&&l.isSendingActivateEmail,size:"lg",className:"mt-[24px] w-fit",children:t.buttonLabel}):(0,e.jsx)(s.Button,{variant:"primary",size:"lg",className:"mt-[24px] w-fit",disabled:!0,children:t.buttonLabel})]},t.id)),!r&&(0,e.jsx)("div",{className:"absolute inset-0 min-md:hidden",style:{background:"linear-gradient(180deg, rgba(29, 29, 31, 0) 66.37%, #1D1D1F 100%"}})]}),r?(0,e.jsx)("button",{className:"mx-auto mt-[12px] block w-fit min-md:hidden",onClick:()=>{C(!1)},children:(0,e.jsx)(u.ChevronUpIcon,{className:"size-[40px] rounded-full bg-[#FFFFFF33] p-[8px]"})}):(0,e.jsx)(e.Fragment,{children:(0,e.jsx)("div",{className:"absolute bottom-0 flex w-full translate-y-1/2 justify-center min-md:hidden",children:(0,e.jsx)("button",{className:"w-fit",onClick:()=>C(!r),children:(0,e.jsx)(u.ChevronDownIcon,{className:"size-[40px] rounded-full bg-[#FFFFFF33] p-[8px]"})})})})]})]})})};
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../src/components/credits/credits-ways-to-get-credits/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Button, Container, Heading, Picture, Text } from '@anker-in/headless-ui'\nimport { ChevronDownIcon, ChevronUpIcon } from '@heroicons/react/24/outline'\nimport { motion } from 'framer-motion'\nimport { useMemo, useState } from 'react'\n\nimport { TaskType, type CreditsWaysToGetCreditsProps } from './type'\nimport { useActions } from './useActions'\nimport { useCreditsContext } from '../context/provider'\nimport { cn } from '../../../helpers/index'\n\nexport const CreditsWaysToGetCredits = ({\n copy,\n activate,\n subscribe,\n uploadReceipt,\n classNames,\n}: CreditsWaysToGetCreditsProps) => {\n const [showMore, setShowMore] = useState(false)\n const { profile } = useCreditsContext()\n const isLogin = !!profile\n\n const { actions } = useActions({ copy, activate, subscribe, uploadReceipt })\n\n const list = useMemo(() => {\n const list = copy.list\n .map(item => {\n if (!actions[item.id as keyof typeof actions]) {\n return undefined\n }\n const { finished, notLogin, notFinished, completed } = actions[item.id as keyof typeof actions]\n let buttonLabel = ''\n let handleClick = undefined\n let link = undefined\n if (!isLogin) {\n buttonLabel = notLogin.buttonLabel\n handleClick = notLogin.handleClick\n } else if (finished) {\n buttonLabel = completed.buttonLabel\n handleClick = undefined\n } else {\n buttonLabel = notFinished.buttonLabel\n handleClick = notFinished.handleClick\n link = (notFinished as { link: string }).link\n }\n return {\n ...item,\n buttonLabel,\n handleClick,\n finished,\n link,\n }\n })\n .filter(Boolean) as {\n title: string\n credits: string\n id: TaskType\n buttonLabel: string\n finished: boolean\n link: string\n handleClick: (() => void) | undefined\n }[]\n\n // \u767B\u5F55\u540E\uFF0C\u4FDD\u7559\u539F\u987A\u5E8F\uFF0C\u5C06\u5DF2\u5B8C\u6210\u7684\u4EFB\u52A1\u653E\u5728\u6700\u540E\n if (isLogin) {\n return list.sort((a, b) => {\n if (a?.finished && !b?.finished) {\n return 1 // a\u5DF2\u5B8C\u6210\uFF0Cb\u672A\u5B8C\u6210\uFF0Ca\u6392\u5728\u540E\u9762\n }\n if (!a?.finished && b?.finished) {\n return -1 // a\u672A\u5B8C\u6210\uFF0Cb\u5DF2\u5B8C\u6210\uFF0Ca\u6392\u5728\u524D\u9762\n }\n return 0 // \u90FD\u5DF2\u5B8C\u6210\u6216\u90FD\u672A\u5B8C\u6210\uFF0C\u4FDD\u6301\u539F\u987A\u5E8F\n })\n } else {\n return list\n }\n }, [actions, copy.list, isLogin])\n\n return (\n <Container id=\"ways-to-get-credits\" className=\" bg-[#F5F5F7] [&>div]:l:!px-0\">\n <div className=\"rounded-[16px] bg-[#1D1D1F] py-[64px] px-[140px] text-white md:px-[16px] l:rounded-none md-l:px-[32px] l-xl:px-[77px]\">\n <Heading as=\"h2\" size={4} html={copy?.title} className=\"text-center l:pl-[16px] l:text-left\" />\n <div className=\"mt-[64px] flex items-center justify-between md:mt-[64px] l:mt-[24px] l:flex-col-reverse l:items-start md-l:mt-[32px]\">\n <div className=\"pl-[16px] l:mt-[40px] desktop:pl-[24px] lg-desktop:pl-[32px]\">\n <Heading size={3} as=\"h3\" html={copy.subtitle} className={classNames?.subtitle} />\n <div className=\"mt-[8px] flex items-center\">\n {copy.creditsIcon?.url && (\n <Picture\n className=\"size-[48px] mr-[8px] stroke-brand xl:size-[30px] [&_path]:stroke-brand\"\n source={copy.creditsIcon.url}\n alt={copy.creditsIcon.alt || 'credits'}\n />\n )}\n <Heading\n html={copy.equalCredits}\n size={4}\n as=\"h3\"\n className={cn('mt-2 text-white md:text-[24px]', classNames?.equalCreditsText)}\n />\n </div>\n </div>\n <Picture className=\"w-full laptop:w-[50%]\" source={copy.mainImage?.url} />\n </div>\n\n <div className=\"relative\">\n <motion.div\n className={cn(\n 'relative mt-[64px] grid grid-cols-3 gap-[16px] overflow-hidden md:mt-[16px] md:grid-cols-1 l:gap-[12px] min-md:!h-auto md-l:mt-[32px] md-l:grid-cols-2'\n )}\n initial={{ height: 512 }}\n animate={{ height: showMore ? 'auto' : 512 }}\n transition={{ duration: 0.3 }}\n onAnimationComplete={() => {\n if (!showMore && window.screen.width < 768) {\n const section = document.getElementById('ways-to-get-credits')\n if (section) {\n section.scrollIntoView({ behavior: 'smooth', block: 'end' })\n }\n }\n }}\n >\n {list.map(item => (\n <div\n key={item.id}\n className=\"flex min-h-[160px] flex-col justify-between rounded-[16px] bg-white p-[16px] text-[#1D1D1F] desktop:min-h-[192px] desktop:p-[24px] lg-desktop:min-h-[240px] lg-desktop:p-[32px]\"\n >\n <div>\n <Heading as=\"h4\" html={item.title} size={2} className=\"text-pretty\" />\n <div className=\"mt-[4px] flex items-center\">\n <Picture\n className=\"size-[24px] xl:size-[18px] [&_path]:size-full\"\n source=\"https://cdn.shopify.com/s/files/1/0511/6346/3874/files/20250902-153351.png?v=1756798450\"\n />\n <Text as=\"p\" html={item.credits} size={2} className=\"ml-[4px] mt-[6px] lg-desktop:text-[18px]\" />\n </div>\n </div>\n\n {item.handleClick &&\n !(item.id === TaskType.UploadReceipt && uploadReceipt.isSuccess) &&\n !(item.id === TaskType.Activate && activate.isSuccess) &&\n !(item.id === TaskType.Subscribe && subscribe.isSuccess) ? (\n <Button\n as={item.link ? 'a' : 'button'}\n {...(item.link && { href: item.link })}\n {...(item.handleClick && { onClick: item.handleClick })}\n variant=\"primary\"\n loading={item.id === TaskType.Activate && activate.isSendingActivateEmail}\n size=\"lg\"\n className=\"mt-[24px] w-fit\"\n >\n {item.buttonLabel}\n </Button>\n ) : (\n <Button variant=\"primary\" size=\"lg\" className=\"mt-[24px] w-fit\" disabled>\n {item.buttonLabel}\n </Button>\n )}\n </div>\n ))}\n {!showMore && (\n <div\n className=\"absolute inset-0 min-md:hidden\"\n style={{ background: 'linear-gradient(180deg, rgba(29, 29, 31, 0) 66.37%, #1D1D1F 100%' }}\n ></div>\n )}\n </motion.div>\n {showMore ? (\n <button\n className=\"mx-auto mt-[12px] block w-fit min-md:hidden\"\n onClick={() => {\n setShowMore(false)\n }}\n >\n <ChevronUpIcon className=\"size-[40px] rounded-full bg-[#FFFFFF33] p-[8px]\"></ChevronUpIcon>\n </button>\n ) : (\n <>\n <div className=\"absolute bottom-0 flex w-full translate-y-1/2 justify-center min-md:hidden\">\n <button className=\"w-fit\" onClick={() => setShowMore(!showMore)}>\n <ChevronDownIcon className=\"size-[40px] rounded-full bg-[#FFFFFF33] p-[8px]\"></ChevronDownIcon>\n </button>\n </div>\n </>\n )}\n </div>\n </div>\n </Container>\n )\n}\n"],
|
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,6BAAAE,IAAA,eAAAC,EAAAH,GAiFQ,IAAAI,EAAA,6BAjFRC,EAA0D,iCA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,UAAYV,EAAS,YAC5C,EAAEU,EAAK,KAAO,WAAS,WAAaT,EAAU,cAC5C,OAAC,UACC,GAAIS,EAAK,KAAO,IAAM,SACrB,GAAIA,EAAK,MAAQ,CAAE,KAAMA,EAAK,IAAK,EACnC,GAAIA,EAAK,aAAe,CAAE,QAASA,EAAK,WAAY,EACrD,QAAQ,UACR,QAASA,EAAK,KAAO,WAAS,UAAYV,EAAS,uBACnD,KAAK,KACL,UAAU,kBAET,SAAAU,EAAK,YACR,KAEA,OAAC,UAAO,QAAQ,UAAU,KAAK,KAAK,UAAU,kBAAkB,SAAQ,GACrE,SAAAA,EAAK,YACR,IAhCGA,EAAK,EAkCZ,CACD,EACA,CAACN,MACA,OAAC,OACC,UAAU,iCACV,MAAO,CAAE,WAAY,kEAAmE,EACzF,GAEL,EACCA,KACC,OAAC,UACC,UAAU,8CACV,QAAS,IAAM,CACbC,EAAY,EAAK,CACnB,EAEA,mBAAC,iBAAc,UAAU,kDAAkD,EAC7E,KAEA,mBACE,mBAAC,OAAI,UAAU,6EACb,mBAAC,UAAO,UAAU,QAAQ,QAAS,IAAMA,EAAY,CAACD,CAAQ,EAC5D,mBAAC,mBAAgB,UAAU,kDAAkD,EAC/E,EACF,EACF,GAEJ,GACF,EACF,CAEJ",
|
|
6
|
-
"names": ["credits_ways_to_get_credits_exports", "__export", "CreditsWaysToGetCredits", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_outline", "import_framer_motion", "import_react", "import_type", "import_useActions", "import_provider", "import_helpers", "copy", "activate", "subscribe", "uploadReceipt", "classNames", "showMore", "setShowMore", "profile", "isLogin", "actions", "list", "item", "finished", "notLogin", "notFinished", "completed", "buttonLabel", "handleClick", "link", "a", "b", "section"]
|
|
7
|
-
}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import type { ReceiptCopy } from '../modal/creditsUploadReceiptModal';
|
|
2
|
-
export type BenefitItem = {
|
|
3
|
-
title: string;
|
|
4
|
-
credits: string;
|
|
5
|
-
id: string;
|
|
6
|
-
};
|
|
7
|
-
export type WaysToGetCreditsCopy = {
|
|
8
|
-
title: string;
|
|
9
|
-
subtitle: string;
|
|
10
|
-
equalCredits: string;
|
|
11
|
-
musicIcon: string;
|
|
12
|
-
list: BenefitItem[];
|
|
13
|
-
mainImage: {
|
|
14
|
-
url: string;
|
|
15
|
-
alt: string;
|
|
16
|
-
};
|
|
17
|
-
joinNow: string;
|
|
18
|
-
activate: string;
|
|
19
|
-
completed: string;
|
|
20
|
-
completeProfile: string;
|
|
21
|
-
makeFirstPurchase: string;
|
|
22
|
-
goShopLink: string;
|
|
23
|
-
uploadReceipt: string;
|
|
24
|
-
shopNow: string;
|
|
25
|
-
subscribe: string;
|
|
26
|
-
sendEmailSuccess: string;
|
|
27
|
-
creditsIcon: {
|
|
28
|
-
url: string;
|
|
29
|
-
alt: string;
|
|
30
|
-
};
|
|
31
|
-
receipt: ReceiptCopy;
|
|
32
|
-
};
|
|
33
|
-
export declare enum TaskType {
|
|
34
|
-
Activate = "activate",
|
|
35
|
-
Subscribe = "subscribe",
|
|
36
|
-
CompleteProfile = "completeProfile",
|
|
37
|
-
FirstPurchase = "firstPurchase",
|
|
38
|
-
UploadReceipt = "uploadReceipt",
|
|
39
|
-
Shop = "shop"
|
|
40
|
-
}
|
|
41
|
-
export type CreditsWaysToGetCreditsProps = {
|
|
42
|
-
copy: WaysToGetCreditsCopy;
|
|
43
|
-
classNames?: {
|
|
44
|
-
equalCreditsText?: string;
|
|
45
|
-
subtitle?: string;
|
|
46
|
-
};
|
|
47
|
-
activate: {
|
|
48
|
-
openAuthCodePopup: () => void;
|
|
49
|
-
isSuccess: boolean;
|
|
50
|
-
isSendingActivateEmail: boolean;
|
|
51
|
-
};
|
|
52
|
-
subscribe: {
|
|
53
|
-
openSubscribePopup: () => void;
|
|
54
|
-
isSuccess: boolean;
|
|
55
|
-
};
|
|
56
|
-
uploadReceipt: {
|
|
57
|
-
openUploadReceiptPopup: () => void;
|
|
58
|
-
isSuccess: boolean;
|
|
59
|
-
};
|
|
60
|
-
};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var r=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var u=(t,e)=>{for(var o in e)r(t,o,{get:e[o],enumerable:!0})},g=(t,e,o,c)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of l(e))!a.call(t,s)&&s!==o&&r(t,s,{get:()=>e[s],enumerable:!(c=p(e,s))||c.enumerable});return t};var d=t=>g(r({},"__esModule",{value:!0}),t);var m={};u(m,{TaskType:()=>n});module.exports=d(m);var n=(i=>(i.Activate="activate",i.Subscribe="subscribe",i.CompleteProfile="completeProfile",i.FirstPurchase="firstPurchase",i.UploadReceipt="uploadReceipt",i.Shop="shop",i))(n||{});
|
|
2
|
-
//# sourceMappingURL=type.js.map
|