@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,2 +1,2 @@
|
|
|
1
1
|
"use strict";var p=Object.create;var a=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var l=Object.getPrototypeOf,R=Object.prototype.hasOwnProperty;var h=(e,t)=>{for(var o in t)a(e,o,{get:t[o],enumerable:!0})},i=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of d(t))!R.call(e,n)&&n!==o&&a(e,n,{get:()=>t[n],enumerable:!(r=C(t,n))||r.enumerable});return e};var x=(e,t,o)=>(o=e!=null?p(l(e)):{},i(t||!e||!e.__esModule?a(o,"default",{value:e,enumerable:!0}):o,e)),u=e=>i(a({},"__esModule",{value:!0}),e);var I={};h(I,{ChatContext:()=>s,useChatContext:()=>f});module.exports=u(I);var c=x(require("react"));const s=c.default.createContext(void 0);function f(){const e=c.default.useContext(s);if(e===void 0)throw new Error("Context not found. Did you forget to wrap your app in a <ChatContextProvider> component?");return e}
|
|
2
|
-
//# sourceMappingURL=
|
|
2
|
+
//# sourceMappingURL=chatContext.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/components/chat/
|
|
3
|
+
"sources": ["../../../../src/components/chat/chatContext.tsx"],
|
|
4
4
|
"sourcesContent": ["import React from 'react'\n\n/**\n * Icons for CopilotChat component.\n */\nexport interface CopilotChatIcons {\n /**\n * The icon to use for the open chat button.\n * @default <OpenIcon />\n */\n openIcon?: React.ReactNode\n\n /**\n * The icon to use for the close chat button.\n * @default <CloseIcon />\n */\n closeIcon?: React.ReactNode\n\n /**\n * The icon to use for the close chat button in the header.\n * @default <HeaderCloseIcon />\n */\n headerCloseIcon?: React.ReactNode\n\n /**\n * The icon to use for the send button.\n * @default <SendIcon />\n */\n sendIcon?: React.ReactNode\n\n /**\n * The icon to use for the activity indicator.\n * @default <ActivityIcon />\n */\n activityIcon?: React.ReactNode\n\n /**\n * The icon to use for the spinner.\n * @default <SpinnerIcon />\n */\n spinnerIcon?: React.ReactNode\n\n /**\n * The icon to use for the stop button.\n * @default <StopIcon />\n */\n stopIcon?: React.ReactNode\n\n /**\n * The icon to use for the regenerate button.\n * @default <RegenerateIcon />\n */\n regenerateIcon?: React.ReactNode\n\n /**\n * The icons to use for push to talk.\n * @default <PushToTalkIcon />\n */\n\n pushToTalkIcon?: React.ReactNode\n}\n\n/**\n * Labels for CopilotChat component.\n */\nexport interface CopilotChatLabels {\n /**\n * The initial message(s) to display in the chat window.\n */\n initial?: string | string[]\n\n /**\n * The title to display in the header.\n * @default \"CopilotKit\"\n */\n title?: string\n\n /**\n * The placeholder to display in the input.\n * @default \"Type a message...\"\n */\n placeholder?: string\n\n /**\n * The message to display when an error occurs.\n * @default \"\u274C An error occurred. Please try again.\"\n */\n error?: string\n\n /**\n * The label to display on the stop button.\n * @default \"Stop generating\"\n */\n stopGenerating?: string\n\n /**\n * The label to display on the regenerate button.\n * @default \"Regenerate response\"\n */\n regenerateResponse?: string\n}\n\ninterface ChatContext {\n labels: Required<CopilotChatLabels>\n icons: Required<CopilotChatIcons>\n open: boolean\n setOpen: (_open: boolean) => void\n}\n\nexport const ChatContext = React.createContext<ChatContext | undefined>(undefined)\n\nexport function useChatContext(): ChatContext {\n const context = React.useContext(ChatContext)\n if (context === undefined) {\n throw new Error('Context not found. Did you forget to wrap your app in a <ChatContextProvider> component?')\n }\n return context\n}\n\nexport interface ChatContextProps {\n // temperature?: number;\n // instructions?: string;\n // maxFeedback?: number;\n labels?: CopilotChatLabels\n icons?: CopilotChatIcons\n children?: React.ReactNode\n open: boolean\n setOpen: (_open: boolean) => void\n}\n\n// export const ChatContextProvider = ({\n// // temperature,\n// // instructions,\n// // maxFeedback,\n// labels,\n// icons,\n// children,\n// open,\n// setOpen,\n// }: ChatContextProps) => {\n// const context = {\n// labels: {\n// ...{\n// initial: \"\",\n// title: \"CopilotKit\",\n// placeholder: \"Type a message...\",\n// error: \"\u274C An error occurred. Please try again.\",\n// stopGenerating: \"Stop generating\",\n// regenerateResponse: \"Regenerate response\",\n// },\n// ...labels,\n// },\n\n// icons: {\n// ...icons,\n// },\n// open,\n// setOpen,\n// };\n// return <ChatContext.Provider value={context}>{children}</ChatContext.Provider>;\n// };\n"],
|
|
5
5
|
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,iBAAAE,EAAA,mBAAAC,IAAA,eAAAC,EAAAJ,GAAA,IAAAK,EAAkB,oBA6GX,MAAMH,EAAc,EAAAI,QAAM,cAAuC,MAAS,EAE1E,SAASH,GAA8B,CAC5C,MAAMI,EAAU,EAAAD,QAAM,WAAWJ,CAAW,EAC5C,GAAIK,IAAY,OACd,MAAM,IAAI,MAAM,0FAA0F,EAE5G,OAAOA,CACT",
|
|
6
|
-
"names": ["
|
|
6
|
+
"names": ["chatContext_exports", "__export", "ChatContext", "useChatContext", "__toCommonJS", "import_react", "React", "context"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var ne=Object.create;var
|
|
1
|
+
"use strict";var ne=Object.create;var R=Object.defineProperty;var re=Object.getOwnPropertyDescriptor;var ae=Object.getOwnPropertyNames;var ie=Object.getPrototypeOf,pe=Object.prototype.hasOwnProperty;var ce=(t,s)=>{for(var n in s)R(t,n,{get:s[n],enumerable:!0})},x=(t,s,n,p)=>{if(s&&typeof s=="object"||typeof s=="function")for(let a of ae(s))!pe.call(t,a)&&a!==n&&R(t,a,{get:()=>s[a],enumerable:!(p=re(s,a))||p.enumerable});return t};var h=(t,s,n)=>(n=t!=null?ne(ie(t)):{},x(s||!t||!t.__esModule?R(n,"default",{value:t,enumerable:!0}):n,t)),le=t=>x(R({},"__esModule",{value:!0}),t);var de={};ce(de,{default:()=>ge});module.exports=le(de);var o=require("react/jsx-runtime"),B=require("react"),r=require("react"),O=require("@copilotkit/react-core"),v=require("@copilotkit/react-ui"),w=h(require("./button")),S=h(require("./messages")),M=h(require("./response")),$=h(require("./suggestions")),q=require("./action"),E=require("@anker-in/lib");const ue=t=>{const{title:s,runtimeUrl:n,popup:p,shopifyDomain:a,userId:c="",account:g="",prologue:D="",locale:d="",query:l="",messagesCallback:K,showResponseButton:_,gotocheckoutRender:N,commonRender:I,shulexRender:H,pointsExchangeCouponRender:U,gotocartRender:G,addtocartRender:A,productRender:F,signupRender:L,addtocartHandler:z,style:J,className:Q="",lang:m}=t,[V,W]=m?.popupTipTimeout||[3e3,6e3],[b,f]=(0,r.useState)(!1),[y,X]=(0,r.useState)(!1),[u,Y]=(0,r.useState)(D),[Z,C]=(0,r.useState)([]),[P,j]=(0,r.useState)([]),T=(0,B.useMemo)(()=>({"x-user-id":c||"","x-shopify-domain":a,"x-member-ship":g,"x-user-locale":d}),[c,a,g,d]),ee=(0,r.useCallback)(async()=>{const e=await(0,E.fetcher)({url:`${n}/copilotkit/start${l}`,method:"GET",headers:T});C(e?.suggested_questions?.map(i=>({message:i,title:i}))||[]),Y(e?.opening_statement||""),j(e?.history||[])},[c,a,g,d,l]),te=(0,r.useCallback)(async()=>{const e=await(0,E.fetcher)({url:`${n}/copilotkit/suggested_questions${l}`,method:"GET",headers:T});C(e?.suggested_questions?.data?.map(i=>({message:i,title:i}))||[])},[c,a,g,d,l]),oe=()=>{b||f(!0),setTimeout(()=>{f(!1)},W)};return(0,r.useEffect)(()=>{const e=setTimeout(()=>{oe()},V);return()=>{clearTimeout(e)}},[]),(0,o.jsx)("div",{className:Q,style:J||{},children:c&&n&&(0,o.jsx)(O.CopilotKit,{runtimeUrl:`${n}/copilotkit/chat${l}`,showDevConsole:!1,headers:T,children:(0,o.jsx)(v.CopilotPopup,{...p,showResponseButton:_!=="follow",labels:{title:s||"DTC Live Chat",initial:u||""},instructions:u||"",onInProgress:e=>{y&&e&&C([]),y&&!e&&te()},Messages:({messages:e,inProgress:i})=>(0,o.jsx)(S.default,{messages:e,inProgress:i,messagesCallback:K,ResponseButton:_==="follow"?(0,o.jsx)(M.default,{messagesId:e?.[e.length-1]?.id}):void 0,children:(0,o.jsx)($.default,{currentSuggestions:Z})}),Button:({open:e,setOpen:i})=>{const se=p?.Button||w.default;(0,r.useEffect)(()=>{X(e)},[e]);const k=(0,r.useCallback)(()=>{i(!e),f(!1),(!u||!P?.length)&&ee()},[u]);return(0,o.jsxs)(o.Fragment,{children:[m?.popupTip&&b&&!y&&(0,o.jsx)("div",{className:"copilotKitPopup copilotKitPopupTip",children:(0,o.jsx)("button",{onClick:k,"aria-label":"Open Chat",className:"copilotKitPopupTipContent",children:m?.popupTip})}),(0,o.jsx)(se,{open:e,setOpen:k})]})},children:(0,o.jsx)(q.CopilotAction,{start:u,history:P,commonRender:I,shulexRender:H,pointsExchangeCouponRender:U,gotocartRender:G,gotocheckoutRender:N,addtocartRender:A,signupRender:L,productRender:F,addtocartHandler:z,productRenderTipMessage:m?.productRenderTipMessage})})})})};var ge=ue;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/components/chat/index.tsx"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable react-hooks/exhaustive-deps */\nimport React, { useMemo } from 'react'\nimport { useCallback, useState, useEffect } from 'react'\nimport { CopilotKit } from '@copilotkit/react-core'\nimport { CopilotPopup } from '@copilotkit/react-ui'\nimport DefaultButton from './button'\nimport Messages from './messages'\nimport ResponseButton from './response'\nimport Suggestions from './suggestions'\nimport { CopilotAction } from './action'\nimport fetcher from '
|
|
5
|
-
"mappings": "skBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aAAAE,KAAA,eAAAC,GAAAH,IA6LoB,IAAAI,EAAA,6BA5LpBC,EAA+B,iBAC/BA,EAAiD,iBACjDC,EAA2B,kCAC3BC,EAA6B,gCAC7BC,EAA0B,uBAC1BC,EAAqB,yBACrBC,EAA2B,yBAC3BC,EAAwB,4BACxBC,EAA8B,oBAC9BC,
|
|
6
|
-
"names": ["chat_exports", "__export", "chat_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_react_core", "import_react_ui", "import_button", "import_messages", "import_response", "import_suggestions", "import_action", "
|
|
4
|
+
"sourcesContent": ["/* eslint-disable react-hooks/exhaustive-deps */\nimport React, { useMemo } from 'react'\nimport { useCallback, useState, useEffect } from 'react'\nimport { CopilotKit } from '@copilotkit/react-core'\nimport { CopilotPopup } from '@copilotkit/react-ui'\nimport DefaultButton from './button'\nimport Messages from './messages'\nimport ResponseButton from './response'\nimport Suggestions from './suggestions'\nimport { CopilotAction } from './action'\nimport { fetcher } from '@anker-in/lib'\n\nexport interface ChatProps {\n title: string\n runtimeUrl: string\n shopifyDomain: string\n /** GA \u7684 client id\n */\n userId: string\n /** \u662F\u5426\u767B\u9646\u7528\u6237 0 or 1\n */\n account?: string\n /** \u7528\u6237\u6D4F\u89C8\u5668\u8BED\u8A00\n */\n locale?: string\n /** \u5F00\u573A\u767D\n */\n prologue?: string\n /** ?a=1&b=2\n */\n query?: string\n /** 'follow' or 'unfollow' | true or false\n * follow: ResponseButton \u4F1A\u8DDF\u968F\u5728 messages \u7684\u540E\u8FB9\n * unfollow: ResponseButton \u5728\u804A\u5929\u6846\u5E95\u90E8\n */\n showResponseButton?: string | boolean\n /** messages \u7684\u56DE\u8C03\u4E8B\u4EF6\n * \u6BCF\u6B21\u751F\u6210/\u63A5\u53D7\u65B0\u7684messages\uFF0C\u4F1A\u5C06 \u6574\u4E2A messages list \u4F20\u9012\u7ED9\u5916\u90E8\n */\n messagesCallback?: (_messages: any) => void\n /** \u901A\u7528 action \u7684\u89E6\u53D1\u4E8B\u4EF6\n */\n commonRender?: string | ((_props: any) => React.ReactElement)\n /** shulex\u7684 action \u7684\u89E6\u53D1\u4E8B\u4EF6\n */\n shulexRender?: string | ((_props: any) => React.ReactElement)\n /** \u901A\u7528 \u79EF\u5206 \u6362 Coupon \u7684\u89E6\u53D1\u4E8B\u4EF6\n */\n pointsExchangeCouponRender?: string | ((_props: any) => React.ReactElement)\n /** \u8DF3\u8F6C checkout action \u5361\u7247\uFF0C\u63A5\u53D7\u53C2\u6570\uFF1A {\"status\":\"complete\",\"args\":[{\"sku\":[\"A3936031\"],\"handle\":\"space-a40-a3936031\"}],\"result\":\"\"}\n * \u540E\u7AEF\u63A5\u53E3\u6587\u6863\uFF1Ahttps://anker-in.feishu.cn/wiki/DOYJwE9oxipWmYk072ncnJNznBb\n */\n gotocheckoutRender?: string | ((_props: any) => React.ReactElement)\n /** \u6253\u5F00\u8D2D\u7269\u8F66 action \u5361\u7247\uFF0C\u63A5\u53D7\u53C2\u6570\uFF1A {\"status\":\"complete\",\"args\":[{\"sku\":[\"A3936031\"],\"handle\":\"space-a40-a3936031\"}],\"result\":\"\"}\n * \u540E\u7AEF\u63A5\u53E3\u6587\u6863\uFF1Ahttps://anker-in.feishu.cn/wiki/DOYJwE9oxipWmYk072ncnJNznBb\n */\n gotocartRender?: string | ((_props: any) => React.ReactElement)\n /** \u6253\u5F00\u8D2D\u7269\u8F66 action \u7684\u89E6\u53D1\u4E8B\u4EF6\n */\n addtocartHandler?: (_args: any) => Promise<any>\n /** \u52A0\u8D2D\u5361\u7247\uFF0C\u63A5\u53D7\u53C2\u6570\uFF1A {\"status\":\"complete\",\"args\":[{\"sku\":[\"A3936031\"],\"handle\":\"space-a40-a3936031\"}],\"result\":\"\"}\n * \u540E\u7AEF\u63A5\u53E3\u6587\u6863\uFF1Ahttps://anker-in.feishu.cn/wiki/DOYJwE9oxipWmYk072ncnJNznBb\n */\n addtocartRender?: string | ((_props: any) => React.ReactElement)\n /** \u8BA2\u9605\u5361\u7247\uFF0C\u63A5\u53D7\u53C2\u6570\uFF1A {\"status\":\"complete\",\"args\":[{\"sku\":[\"A3936031\"],\"handle\":\"space-a40-a3936031\"}],\"result\":\"\"}\n * \u540E\u7AEF\u63A5\u53E3\u6587\u6863\uFF1Ahttps://anker-in.feishu.cn/wiki/DOYJwE9oxipWmYk072ncnJNznBb\n */\n signupRender?: string | ((_props: any) => React.ReactElement)\n /** \u4EA7\u54C1\u5361\u7247\uFF0C\u63A5\u53D7\u53C2\u6570\uFF1A {\"status\":\"complete\",\"args\":[{\"sku\":[\"A3936031\"],\"handle\":\"space-a40-a3936031\"}],\"result\":\"\"}\n * \u540E\u7AEF\u63A5\u53E3\u6587\u6863\uFF1Ahttps://anker-in.feishu.cn/wiki/DOYJwE9oxipWmYk072ncnJNznBb\n */\n productRender?: string | ((_props: any) => React.ReactElement)\n /** CopilotPopup \u81EA\u5B9A\u4E49\u53C2\u6570\uFF0C\u53C2\u8003\uFF1Ahttps://docs.copilotkit.ai/reference/components/CopilotPopup */\n popup?: any\n /** \u6587\u6848\uFF0C{\"productRenderTipMessage\": \"\",\"popupTip\": \"Hi ! Welcome to soundcore Innovations live chat\uFF01\", \"popupTipTimeout\": [3000, 6000]} */\n lang?: any\n /** \u53C2\u8003\u6B64\u6587\u6863\uFF1Ahttps://docs.copilotkit.ai/concepts/customize-look-and-feel */\n style?: any\n className?: string\n}\n\nconst Chat = (props: ChatProps) => {\n const {\n title,\n runtimeUrl,\n popup,\n shopifyDomain,\n userId = '',\n account = '',\n prologue = '',\n locale = '',\n query = '',\n messagesCallback,\n showResponseButton,\n gotocheckoutRender,\n commonRender,\n shulexRender,\n pointsExchangeCouponRender,\n gotocartRender,\n addtocartRender,\n productRender,\n signupRender,\n addtocartHandler,\n style,\n className = '',\n lang,\n } = props\n const [autoTipOpen, autoTipClose] = lang?.popupTipTimeout || [3000, 6000]\n\n const [openTip, setOpenTip] = useState(false)\n const [openPopup, setOpenPopup] = useState(false)\n const [start, setstart] = useState(prologue)\n const [currentSuggestions, setCurrentSuggestions] = useState([])\n const [history, sethistory] = useState<[{ content: string; role: string }] | []>([])\n\n const headers = useMemo(\n () => ({\n 'x-user-id': userId || '',\n 'x-shopify-domain': shopifyDomain,\n 'x-member-ship': account,\n 'x-user-locale': locale,\n }),\n [userId, shopifyDomain, account, locale]\n )\n\n const getStart = useCallback(async () => {\n const result = await fetcher({\n url: `${runtimeUrl}/copilotkit/start${query}`,\n method: 'GET',\n headers,\n })\n\n setCurrentSuggestions(result?.suggested_questions?.map((item: string) => ({ message: item, title: item })) || [])\n setstart(result?.opening_statement || '')\n sethistory(result?.history || [])\n }, [userId, shopifyDomain, account, locale, query])\n\n const getSuggestions = useCallback(async () => {\n const result = await fetcher({\n url: `${runtimeUrl}/copilotkit/suggested_questions${query}`,\n method: 'GET',\n headers,\n })\n\n setCurrentSuggestions(\n result?.suggested_questions?.data?.map((item: string) => ({ message: item, title: item })) || []\n )\n }, [userId, shopifyDomain, account, locale, query])\n\n const setOpenTipFn = () => {\n if (!openTip) setOpenTip(true)\n setTimeout(() => {\n setOpenTip(false)\n }, autoTipClose)\n }\n\n useEffect(() => {\n const timer = setTimeout(() => {\n setOpenTipFn()\n }, autoTipOpen)\n\n return () => {\n clearTimeout(timer)\n }\n }, [])\n\n return (\n <div className={className} style={style || {}}>\n {userId && runtimeUrl && (\n <CopilotKit runtimeUrl={`${runtimeUrl}/copilotkit/chat${query}`} showDevConsole={false} headers={headers}>\n <CopilotPopup\n {...popup}\n showResponseButton={showResponseButton !== 'follow'}\n labels={{\n title: title || 'DTC Live Chat',\n initial: start || '',\n }}\n instructions={start || ''}\n onInProgress={load => {\n if (openPopup && load) setCurrentSuggestions([])\n if (openPopup && !load) getSuggestions()\n }}\n Messages={({ messages, inProgress }) => (\n <Messages\n messages={messages}\n inProgress={inProgress}\n messagesCallback={messagesCallback}\n ResponseButton={\n showResponseButton === 'follow' ? (\n <ResponseButton messagesId={messages?.[messages.length - 1]?.id} />\n ) : undefined\n }\n >\n <Suggestions currentSuggestions={currentSuggestions} />\n </Messages>\n )}\n Button={({ open, setOpen: setOpenDefault }: { open: boolean; setOpen: (open: boolean) => void }) => {\n const Button = popup?.Button || DefaultButton\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useEffect(() => {\n setOpenPopup(open)\n }, [open])\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const setOpen = useCallback(() => {\n setOpenDefault(!open)\n setOpenTip(false)\n if (!start || !history?.length) getStart()\n }, [start])\n\n return (\n <>\n {lang?.popupTip && openTip && !openPopup && (\n <div className=\"copilotKitPopup copilotKitPopupTip\">\n <button onClick={setOpen} aria-label=\"Open Chat\" className=\"copilotKitPopupTipContent\">\n {lang?.popupTip}\n </button>\n </div>\n )}\n <Button open={open} setOpen={setOpen} />\n </>\n )\n }}\n >\n <CopilotAction\n start={start}\n history={history}\n commonRender={commonRender}\n shulexRender={shulexRender}\n pointsExchangeCouponRender={pointsExchangeCouponRender}\n gotocartRender={gotocartRender}\n gotocheckoutRender={gotocheckoutRender}\n addtocartRender={addtocartRender}\n signupRender={signupRender}\n productRender={productRender}\n addtocartHandler={addtocartHandler}\n productRenderTipMessage={lang?.productRenderTipMessage}\n />\n </CopilotPopup>\n </CopilotKit>\n )}\n </div>\n )\n}\n\nexport default Chat\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["chat_exports", "__export", "chat_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_react_core", "import_react_ui", "import_button", "import_messages", "import_response", "import_suggestions", "import_action", "import_lib", "Chat", "props", "title", "runtimeUrl", "popup", "shopifyDomain", "userId", "account", "prologue", "locale", "query", "messagesCallback", "showResponseButton", "gotocheckoutRender", "commonRender", "shulexRender", "pointsExchangeCouponRender", "gotocartRender", "addtocartRender", "productRender", "signupRender", "addtocartHandler", "style", "className", "lang", "autoTipOpen", "autoTipClose", "openTip", "setOpenTip", "openPopup", "setOpenPopup", "start", "setstart", "currentSuggestions", "setCurrentSuggestions", "history", "sethistory", "headers", "getStart", "result", "item", "getSuggestions", "setOpenTipFn", "timer", "load", "messages", "inProgress", "Messages", "ResponseButton", "Suggestions", "open", "setOpenDefault", "Button", "DefaultButton", "setOpen"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var L=Object.defineProperty;var
|
|
1
|
+
"use strict";var L=Object.defineProperty;var O=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var I=Object.prototype.hasOwnProperty;var z=(h,f)=>{for(var o in f)L(h,o,{get:f[o],enumerable:!0})},j=(h,f,o,x)=>{if(f&&typeof f=="object"||typeof f=="function")for(let n of B(f))!I.call(h,n)&&n!==o&&L(h,n,{get:()=>f[n],enumerable:!(x=O(f,n))||x.enumerable});return h};var q=h=>j(L({},"__esModule",{value:!0}),h);var J={};z(J,{ALPC_COUNTRY_MAP:()=>D,AlpcConsumeType:()=>P,AlpcErrorCode:()=>G,ApprovalStatus:()=>$,ConsumeType:()=>m,CouponType:()=>N,CreditType:()=>U,DTC_TASK_TYPE:()=>F,PRICE_SYMBOL:()=>H,RewardType:()=>M,TaskSubType:()=>d,TaskType:()=>c});module.exports=q(J);var U=(n=>(n[n.All=0]="All",n[n.Earned=1]="Earned",n[n.Deducted=2]="Deducted",n[n.Expired=3]="Expired",n))(U||{}),m=(u=>(u.Coupon="coupon",u.GiftCard="giftCard",u.GoGift="goGift",u.Product="product",u.ShippingCoupon="shippingCoupon",u))(m||{}),P=(o=>(o[o.Coupon=1]="Coupon",o[o.Product=2]="Product",o))(P||{}),c=(x=>(x[x.Program=1]="Program",x[x.Operation=2]="Operation",x[x.Redeem=3]="Redeem",x))(c||{}),F=(x=>(x.FirstPurchase="firstPurchase",x.UploadReceipt="uploadReceipt",x.Shopping="shopping",x))(F||{}),d=(t=>(t[t.Activation=1]="Activation",t[t.UpdateName=2]="UpdateName",t[t.UpdatePhone=3]="UpdatePhone",t[t.UpdateBirthday=4]="UpdateBirthday",t[t.Subscription=5]="Subscription",t[t.UpadteAppName=7]="UpadteAppName",t[t.Refund=3e3]="Refund",t[t.ProductUnApproved=5e3]="ProductUnApproved",t))(d||{}),N=(o=>(o.FixedMount="fixed_amount",o.Percent="percent",o))(N||{}),M=(g=>(g[g.Received=0]="Received",g[g.Pending=1]="Pending",g[g.ApproveSuccess=2]="ApproveSuccess",g[g.ApproveFail=3]="ApproveFail",g[g.Unfulfilled=4]="Unfulfilled",g[g.Fulfilled=5]="Fulfilled",g[g.Failed=6]="Failed",g))(M||{}),G=(i=>(i[i.CodeLpcRedeemFailed=180001]="CodeLpcRedeemFailed",i[i.CodeLpcUserNotFound=180002]="CodeLpcUserNotFound",i[i.CodeLpcCreditRuleNotFound=180003]="CodeLpcCreditRuleNotFound",i[i.CodeLpcUnknownError=180004]="CodeLpcUnknownError",i[i.CodeLpcNotEnoughCredits=180005]="CodeLpcNotEnoughCredits",i[i.CodeLpcUserMigrate=180006]="CodeLpcUserMigrate",i[i.CodeLpcRuleInventoryNotEnough=180007]="CodeLpcRuleInventoryNotEnough",i[i.CodeLpcShopifyCouponRuleRedeemLimit=180009]="CodeLpcShopifyCouponRuleRedeemLimit",i[i.CodeCrossSiteError=180011]="CodeCrossSiteError",i))(G||{});const D=new Map([["eu-en","eu"],["eu-de","de"]]);var $=(n=>(n[n.Pending=0]="Pending",n[n.Success=1]="Success",n[n.Failed=2]="Failed",n[n.DoubleConfirm=3]="DoubleConfirm",n))($||{});const H={us:"$",uk:"\xA3",ca:"$",eu:"\u20AC",pl:"z\u0142",fr:"\u20AC",de:"\u20AC",vn:"\u20AB",cl:"$",sg:"$",ae:"AED",es:"\u20AC"};
|
|
2
2
|
//# sourceMappingURL=const.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/components/credits/context/const.ts"],
|
|
4
|
-
"sourcesContent": ["export enum CreditType {\n All = 0,\n Earned = 1,\n Deducted = 2,\n Expired = 3,\n}\n\nexport enum ConsumeType {\n Coupon = 'coupon',\n GiftCard = 'giftCard',\n GoGift = 'goGift',\n Product = 'product',\n}\n\nexport enum AlpcConsumeType {\n Coupon = 1,\n Product = 2,\n}\n\nexport enum TaskType {\n Program = 1,\n Operation = 2,\n Redeem = 3,\n}\n\nexport enum DTC_TASK_TYPE {\n FirstPurchase = 'firstPurchase',\n UploadReceipt = 'uploadReceipt',\n Shopping = 'shopping',\n}\n\nexport enum TaskSubType {\n Activation = 1, // \u6FC0\u6D3B\u4E8B\u4EF6\n UpdateName = 2, // \u5B8C\u5584\u59D3\u540D\n UpdatePhone = 3, // \u66F4\u65B0\u624B\u673A\u53F7\n UpdateBirthday = 4, // \u66F4\u65B0\u751F\u65E5\n Subscription = 5, // \u8BA2\u9605\n UpadteAppName = 7, // \u5B8C\u5584APP\u59D3\u540D\n Refund = 3000, // \u8D2D\u7269\u9001\u79EF\u5206\u4EFB\u52A1\u9000\u6B3E\n ProductUnApproved = 5000, // \u5151\u6362\u5546\u54C1\u5BA1\u6838\u4E0D\u901A\u8FC7\n}\n\nexport enum CouponType {\n FixedMount = 'fixed_amount',\n Percent = 'percent',\n}\n\nexport enum RewardType {\n Received = 0,\n Pending = 1,\n ApproveSuccess = 2,\n ApproveFail = 3,\n Unfulfilled = 4,\n Fulfilled = 5,\n Failed = 6,\n}\n\nexport enum AlpcErrorCode {\n CodeLpcRedeemFailed = 180001,\n //user not found\n CodeLpcUserNotFound = 180002,\n //credit rule not found\n CodeLpcCreditRuleNotFound = 180003,\n //unknown error\n CodeLpcUnknownError = 180004,\n // not enough credits\n CodeLpcNotEnoughCredits = 180005,\n // user migrate\n CodeLpcUserMigrate = 180006,\n // \u5E93\u5B58\u4E0D\u8DB3\n CodeLpcRuleInventoryNotEnough = 180007,\n // \u5151\u6362\u6B21\u6570\u9650\u5236\n CodeLpcShopifyCouponRuleRedeemLimit = 180009,\n // \u8DE8\u533A\u5151\u6362\u9519\u8BEF\uFF08\u975E\u6B27\u5151\u6362\u6B27\u6D32\u7684\uFF09\n CodeCrossSiteError = 180011,\n}\n\nexport const ALPC_COUNTRY_MAP = new Map<string, string>([\n ['eu-en', 'eu'],\n ['eu-de', 'de'],\n])\n\nexport enum ApprovalStatus {\n Pending = 0,\n Success = 1,\n Failed = 2,\n DoubleConfirm = 3,\n}\n\nexport const PRICE_SYMBOL = {\n us: '$',\n uk: '\u00A3',\n ca: '$',\n eu: '\u20AC',\n pl: 'z\u0142',\n fr: '\u20AC',\n de: '\u20AC',\n vn: '\u20AB',\n cl: '$',\n sg: '$',\n ae: 'AED',\n es: '\u20AC',\n}\n"],
|
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,sBAAAE,EAAA,oBAAAC,EAAA,kBAAAC,EAAA,mBAAAC,EAAA,gBAAAC,EAAA,eAAAC,EAAA,eAAAC,EAAA,kBAAAC,EAAA,iBAAAC,EAAA,eAAAC,EAAA,gBAAAC,EAAA,aAAAC,IAAA,eAAAC,EAAAd,GAAO,IAAKQ,OACVA,IAAA,IAAM,GAAN,MACAA,IAAA,OAAS,GAAT,SACAA,IAAA,SAAW,GAAX,WACAA,IAAA,QAAU,GAAV,UAJUA,OAAA,IAOAF,OACVA,EAAA,OAAS,SACTA,EAAA,SAAW,WACXA,EAAA,OAAS,SACTA,EAAA,QAAU,
|
|
4
|
+
"sourcesContent": ["export enum CreditType {\n All = 0,\n Earned = 1,\n Deducted = 2,\n Expired = 3,\n}\n\nexport enum ConsumeType {\n Coupon = 'coupon',\n GiftCard = 'giftCard',\n GoGift = 'goGift',\n Product = 'product',\n ShippingCoupon = 'shippingCoupon',\n}\n\nexport enum AlpcConsumeType {\n Coupon = 1,\n Product = 2,\n}\n\nexport enum TaskType {\n Program = 1,\n Operation = 2,\n Redeem = 3,\n}\n\nexport enum DTC_TASK_TYPE {\n FirstPurchase = 'firstPurchase',\n UploadReceipt = 'uploadReceipt',\n Shopping = 'shopping',\n}\n\nexport enum TaskSubType {\n Activation = 1, // \u6FC0\u6D3B\u4E8B\u4EF6\n UpdateName = 2, // \u5B8C\u5584\u59D3\u540D\n UpdatePhone = 3, // \u66F4\u65B0\u624B\u673A\u53F7\n UpdateBirthday = 4, // \u66F4\u65B0\u751F\u65E5\n Subscription = 5, // \u8BA2\u9605\n UpadteAppName = 7, // \u5B8C\u5584APP\u59D3\u540D\n Refund = 3000, // \u8D2D\u7269\u9001\u79EF\u5206\u4EFB\u52A1\u9000\u6B3E\n ProductUnApproved = 5000, // \u5151\u6362\u5546\u54C1\u5BA1\u6838\u4E0D\u901A\u8FC7\n}\n\nexport enum CouponType {\n FixedMount = 'fixed_amount',\n Percent = 'percent',\n}\n\nexport enum RewardType {\n Received = 0,\n Pending = 1,\n ApproveSuccess = 2,\n ApproveFail = 3,\n Unfulfilled = 4,\n Fulfilled = 5,\n Failed = 6,\n}\n\nexport enum AlpcErrorCode {\n CodeLpcRedeemFailed = 180001,\n //user not found\n CodeLpcUserNotFound = 180002,\n //credit rule not found\n CodeLpcCreditRuleNotFound = 180003,\n //unknown error\n CodeLpcUnknownError = 180004,\n // not enough credits\n CodeLpcNotEnoughCredits = 180005,\n // user migrate\n CodeLpcUserMigrate = 180006,\n // \u5E93\u5B58\u4E0D\u8DB3\n CodeLpcRuleInventoryNotEnough = 180007,\n // \u5151\u6362\u6B21\u6570\u9650\u5236\n CodeLpcShopifyCouponRuleRedeemLimit = 180009,\n // \u8DE8\u533A\u5151\u6362\u9519\u8BEF\uFF08\u975E\u6B27\u5151\u6362\u6B27\u6D32\u7684\uFF09\n CodeCrossSiteError = 180011,\n}\n\nexport const ALPC_COUNTRY_MAP = new Map<string, string>([\n ['eu-en', 'eu'],\n ['eu-de', 'de'],\n])\n\nexport enum ApprovalStatus {\n Pending = 0,\n Success = 1,\n Failed = 2,\n DoubleConfirm = 3,\n}\n\nexport const PRICE_SYMBOL = {\n us: '$',\n uk: '\u00A3',\n ca: '$',\n eu: '\u20AC',\n pl: 'z\u0142',\n fr: '\u20AC',\n de: '\u20AC',\n vn: '\u20AB',\n cl: '$',\n sg: '$',\n ae: 'AED',\n es: '\u20AC',\n}\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,sBAAAE,EAAA,oBAAAC,EAAA,kBAAAC,EAAA,mBAAAC,EAAA,gBAAAC,EAAA,eAAAC,EAAA,eAAAC,EAAA,kBAAAC,EAAA,iBAAAC,EAAA,eAAAC,EAAA,gBAAAC,EAAA,aAAAC,IAAA,eAAAC,EAAAd,GAAO,IAAKQ,OACVA,IAAA,IAAM,GAAN,MACAA,IAAA,OAAS,GAAT,SACAA,IAAA,SAAW,GAAX,WACAA,IAAA,QAAU,GAAV,UAJUA,OAAA,IAOAF,OACVA,EAAA,OAAS,SACTA,EAAA,SAAW,WACXA,EAAA,OAAS,SACTA,EAAA,QAAU,UACVA,EAAA,eAAiB,iBALPA,OAAA,IAQAH,OACVA,IAAA,OAAS,GAAT,SACAA,IAAA,QAAU,GAAV,UAFUA,OAAA,IAKAU,OACVA,IAAA,QAAU,GAAV,UACAA,IAAA,UAAY,GAAZ,YACAA,IAAA,OAAS,GAAT,SAHUA,OAAA,IAMAJ,OACVA,EAAA,cAAgB,gBAChBA,EAAA,cAAgB,gBAChBA,EAAA,SAAW,WAHDA,OAAA,IAMAG,OACVA,IAAA,WAAa,GAAb,aACAA,IAAA,WAAa,GAAb,aACAA,IAAA,YAAc,GAAd,cACAA,IAAA,eAAiB,GAAjB,iBACAA,IAAA,aAAe,GAAf,eACAA,IAAA,cAAgB,GAAhB,gBACAA,IAAA,OAAS,KAAT,SACAA,IAAA,kBAAoB,KAApB,oBARUA,OAAA,IAWAL,OACVA,EAAA,WAAa,eACbA,EAAA,QAAU,UAFAA,OAAA,IAKAI,OACVA,IAAA,SAAW,GAAX,WACAA,IAAA,QAAU,GAAV,UACAA,IAAA,eAAiB,GAAjB,iBACAA,IAAA,YAAc,GAAd,cACAA,IAAA,YAAc,GAAd,cACAA,IAAA,UAAY,GAAZ,YACAA,IAAA,OAAS,GAAT,SAPUA,OAAA,IAUAP,OACVA,IAAA,oBAAsB,QAAtB,sBAEAA,IAAA,oBAAsB,QAAtB,sBAEAA,IAAA,0BAA4B,QAA5B,4BAEAA,IAAA,oBAAsB,QAAtB,sBAEAA,IAAA,wBAA0B,QAA1B,0BAEAA,IAAA,mBAAqB,QAArB,qBAEAA,IAAA,8BAAgC,QAAhC,gCAEAA,IAAA,oCAAsC,QAAtC,sCAEAA,IAAA,mBAAqB,QAArB,qBAjBUA,OAAA,IAoBL,MAAMF,EAAmB,IAAI,IAAoB,CACtD,CAAC,QAAS,IAAI,EACd,CAAC,QAAS,IAAI,CAChB,CAAC,EAEM,IAAKG,OACVA,IAAA,QAAU,GAAV,UACAA,IAAA,QAAU,GAAV,UACAA,IAAA,OAAS,GAAT,SACAA,IAAA,cAAgB,GAAhB,gBAJUA,OAAA,IAOL,MAAMK,EAAe,CAC1B,GAAI,IACJ,GAAI,OACJ,GAAI,IACJ,GAAI,SACJ,GAAI,UACJ,GAAI,SACJ,GAAI,SACJ,GAAI,SACJ,GAAI,IACJ,GAAI,IACJ,GAAI,MACJ,GAAI,QACN",
|
|
6
6
|
"names": ["const_exports", "__export", "ALPC_COUNTRY_MAP", "AlpcConsumeType", "AlpcErrorCode", "ApprovalStatus", "ConsumeType", "CouponType", "CreditType", "DTC_TASK_TYPE", "PRICE_SYMBOL", "RewardType", "TaskSubType", "TaskType", "__toCommonJS"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var c=Object.defineProperty;var
|
|
1
|
+
"use strict";var c=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var z=(t,e)=>{for(var r in e)c(t,r,{get:e[r],enumerable:!0})},B=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of R(e))!h.call(t,s)&&s!==r&&c(t,s,{get:()=>e[s],enumerable:!(o=P(e,s))||o.enumerable});return t};var M=t=>B(c({},"__esModule",{value:!0}),t);var E={};z(E,{default:()=>k});module.exports=M(E);var i=require("react"),p=require("./useAlpcFetch"),f=require("../provider"),b=require("@anker-in/lib");function S({page:t,pageSize:e,options:r={}}){const{profile:o,isLoadingProfile:s,alpcBrand:C}=(0,f.useCreditsContext)(),{brand:L}=(0,b.useHeadlessContext)(),v=C||L,[n,_]=(0,i.useState)([]),[u,x]=(0,i.useState)(0),[d,A]=(0,i.useState)(0),{isMutating:a,trigger:g}=(0,p.useAlpcMutation)({url:"/v1/credit/log",initData:{brand:v}}),l=(0,i.useCallback)(async()=>{const y={page:t,page_size:e,user_id:o?.user_id,...r};g(y,{onSuccess(m){A(t),x(m?.data?.total),_(n.concat(m?.data?.creditLogs||[]))}})},[n,o,t,e,r,g]);return(0,i.useEffect)(()=>{s||!o||a||t!==d&&t&&l()},[l,s,a,o,t,d]),{activities:n,isLoading:a,total:u,canNext:u>n.length&&!a}}var k=S;
|
|
2
2
|
//# sourceMappingURL=useActivities.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../src/components/credits/context/hooks/useActivities.ts"],
|
|
4
|
-
"sourcesContent": ["import { useCallback, useEffect, useState } from 'react'\n\nimport { useAlpcMutation } from './useAlpcFetch'\nimport type { CreditLogResponse } from '../response'\nimport { useCreditsContext } from '../provider'\nimport {
|
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAiD,iBAEjDC,EAAgC,0BAEhCC,EAAkC,uBAClCC,
|
|
6
|
-
"names": ["useActivities_exports", "__export", "useActivities_default", "__toCommonJS", "import_react", "import_useAlpcFetch", "import_provider", "
|
|
4
|
+
"sourcesContent": ["import { useCallback, useEffect, useState } from 'react'\n\nimport { useAlpcMutation } from './useAlpcFetch'\nimport type { CreditLogResponse } from '../response'\nimport { useCreditsContext } from '../provider'\nimport { useHeadlessContext } from '@anker-in/lib'\n\nfunction useActivities({ page, pageSize, options = {} }: { page: number; pageSize: number; options?: any }) {\n const { profile, isLoadingProfile, alpcBrand } = useCreditsContext()\n const { brand: headlessBrand } = useHeadlessContext()\n const brand = alpcBrand || headlessBrand\n const [activities, setActivities] = useState<CreditLogResponse[]>([])\n const [total, setTotal] = useState(0)\n\n const [currentPage, setCurrentPage] = useState(0)\n\n const { isMutating: isLoading, trigger } = useAlpcMutation<\n {\n data: {\n total: number\n creditLogs: CreditLogResponse[]\n }\n },\n {\n page: number\n page_size: number\n user_id: string\n }\n >({\n url: `/v1/credit/log`,\n initData: {\n brand,\n },\n })\n\n const getActivities = useCallback(async () => {\n const params = {\n page: page,\n page_size: pageSize,\n user_id: profile?.user_id,\n ...options,\n }\n\n trigger(params, {\n onSuccess(responseData) {\n setCurrentPage(page)\n setTotal(responseData?.data?.total)\n setActivities(activities.concat(responseData?.data?.creditLogs || []))\n },\n })\n }, [activities, profile, page, pageSize, options, trigger])\n\n useEffect(() => {\n if (isLoadingProfile || !profile || isLoading) {\n return\n }\n\n if (page !== currentPage && page) {\n getActivities()\n }\n }, [getActivities, isLoadingProfile, isLoading, profile, page, currentPage])\n\n return {\n activities,\n isLoading,\n total,\n canNext: total > activities.length && !isLoading,\n }\n}\n\nexport default useActivities\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAiD,iBAEjDC,EAAgC,0BAEhCC,EAAkC,uBAClCC,EAAmC,yBAEnC,SAASC,EAAc,CAAE,KAAAC,EAAM,SAAAC,EAAU,QAAAC,EAAU,CAAC,CAAE,EAAsD,CAC1G,KAAM,CAAE,QAAAC,EAAS,iBAAAC,EAAkB,UAAAC,CAAU,KAAI,qBAAkB,EAC7D,CAAE,MAAOC,CAAc,KAAI,sBAAmB,EAC9CC,EAAQF,GAAaC,EACrB,CAACE,EAAYC,CAAa,KAAI,YAA8B,CAAC,CAAC,EAC9D,CAACC,EAAOC,CAAQ,KAAI,YAAS,CAAC,EAE9B,CAACC,EAAaC,CAAc,KAAI,YAAS,CAAC,EAE1C,CAAE,WAAYC,EAAW,QAAAC,CAAQ,KAAI,mBAYzC,CACA,IAAK,iBACL,SAAU,CACR,MAAAR,CACF,CACF,CAAC,EAEKS,KAAgB,eAAY,SAAY,CAC5C,MAAMC,EAAS,CACb,KAAMjB,EACN,UAAWC,EACX,QAASE,GAAS,QAClB,GAAGD,CACL,EAEAa,EAAQE,EAAQ,CACd,UAAUC,EAAc,CACtBL,EAAeb,CAAI,EACnBW,EAASO,GAAc,MAAM,KAAK,EAClCT,EAAcD,EAAW,OAAOU,GAAc,MAAM,YAAc,CAAC,CAAC,CAAC,CACvE,CACF,CAAC,CACH,EAAG,CAACV,EAAYL,EAASH,EAAMC,EAAUC,EAASa,CAAO,CAAC,EAE1D,sBAAU,IAAM,CACVX,GAAoB,CAACD,GAAWW,GAIhCd,IAASY,GAAeZ,GAC1BgB,EAAc,CAElB,EAAG,CAACA,EAAeZ,EAAkBU,EAAWX,EAASH,EAAMY,CAAW,CAAC,EAEpE,CACL,WAAAJ,EACA,UAAAM,EACA,MAAAJ,EACA,QAASA,EAAQF,EAAW,QAAU,CAACM,CACzC,CACF,CAEA,IAAOrB,EAAQM",
|
|
6
|
+
"names": ["useActivities_exports", "__export", "useActivities_default", "__toCommonJS", "import_react", "import_useAlpcFetch", "import_provider", "import_lib", "useActivities", "page", "pageSize", "options", "profile", "isLoadingProfile", "alpcBrand", "headlessBrand", "brand", "activities", "setActivities", "total", "setTotal", "currentPage", "setCurrentPage", "isLoading", "trigger", "getActivities", "params", "responseData"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var L=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var I=Object.prototype.hasOwnProperty;var O=(e,a)=>{for(var d in a)L(e,d,{get:a[d],enumerable:!0})},D=(e,a,d,r)=>{if(a&&typeof a=="object"||typeof a=="function")for(let t of b(a))!I.call(e,t)&&t!==d&&L(e,t,{get:()=>a[t],enumerable:!(r=_(a,t))||r.enumerable});return e};var v=e=>D(L({},"__esModule",{value:!0}),e);var j={};O(j,{useAddressValidate:()=>Y});module.exports=v(j);var
|
|
1
|
+
"use strict";var L=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var I=Object.prototype.hasOwnProperty;var O=(e,a)=>{for(var d in a)L(e,d,{get:a[d],enumerable:!0})},D=(e,a,d,r)=>{if(a&&typeof a=="object"||typeof a=="function")for(let t of b(a))!I.call(e,t)&&t!==d&&L(e,t,{get:()=>a[t],enumerable:!(r=_(a,t))||r.enumerable});return e};var v=e=>D(L({},"__esModule",{value:!0}),e);var j={};O(j,{useAddressValidate:()=>Y});module.exports=v(j);var x=require("react"),k=require("../utils"),U=require("@anker-in/lib");const T=/[&%*<>^#;-]/,F=/[&^*%<>;,?]/,N=/[^a-zA-Z0-9\s]/,V=/^\d+(\s+\d+)*$/,G=/(Packstation|Postfiliale)/gi,H=/(P(\.)?\s*?O(\.)?\s*?box|Post(al)?(\s*)?(Office(\s*))?Box)/gi,w={minLength:(e,a)=>e?.length>0&&e?.length<a?.length,maxLength:(e,a)=>e?.length>a?.length,isUSSpecialCharacters:e=>T.test(e),isEUSpecialCharacters:e=>F.test(e),isSC:e=>N.test(e),isPureDigital:e=>V.test(e),isPackstation:e=>G.test(e),isPobox:e=>H.test(e)},B={us:{nameRules:["isUSSpecialCharacters"],addressRules:{address1:["isPobox","isUSSpecialCharacters","minLength","maxLength","isPureDigital"],address2:["isPobox","isUSSpecialCharacters","maxLength","isPureDigital"]},addressLengths:{min:4,max:32}},"eu-en":{nameRules:["isEUSpecialCharacters"],addressRules:{address1:["isPobox","isEUSpecialCharacters","minLength","maxLength","isPureDigital","isPackstation"],address2:["isPobox","isEUSpecialCharacters","maxLength","isPackstation"]},addressLengths:{min:3,max:70}},uk:{nameRules:["isEUSpecialCharacters"],addressRules:{address1:["isPobox","isEUSpecialCharacters","minLength","maxLength","isPureDigital"],address2:["isPobox","isEUSpecialCharacters","maxLength"]},addressLengths:{min:3,max:35}},"eu-de":{nameRules:["isEUSpecialCharacters"],addressRules:{address1:["isPobox","isEUSpecialCharacters","minLength","maxLength","isPureDigital","isPackstation"],address2:["isPobox","isPackstation","isEUSpecialCharacters","maxLength"]},addressLengths:{min:3,max:35}},ca:{nameRules:["isUSSpecialCharacters"],addressRules:{address1:["isPobox","maxLength"],address2:["isPobox","maxLength"]},addressLengths:{max:35}}},M={uk:{rules:["isEUSpecialCharacters","minLength","maxLength"],lengths:{min:2,max:35}},"eu-en":{rules:["isEUSpecialCharacters","minLength","maxLength"],lengths:{min:2,max:35}},"eu-de":{rules:["isEUSpecialCharacters","minLength","maxLength"],lengths:{min:2,max:35}},ca:{rules:["minLength","maxLength"],lengths:{min:2,max:15}}},Y=({address:e,validatorInfo:a,formData:d,errorLabel:r})=>{const{locale:t}=(0,U.useHeadlessContext)(),[q,A]=(0,x.useState)([]),y=(0,x.useMemo)(()=>{const{city_rules:C={},name_rules:p={},address1_rules:u,address2_rules:g,POboxErr:f,packstationErr:P}=a||{},i=B[t],m=M[t],S=[...d.map(s=>({key:s.key,required:s.required,error:r.require||"This field is required"})),{key:"email",error:r.email||"Invalid email format",validator(s){return!(0,k.emailValidate)(s)}},{key:"first_name",required:!0,error:r.require||"First name is required"},{key:"last_name",required:!0,error:r.require||"Last name is required"},{key:"name",error:p.maxLengthErr||r.require||"Name is too long",validator:s=>s?.length>=31}],E=m?m.rules.map(s=>{const l={key:"city",rule:s,error:""};return s==="minLength"?(l.params={length:m.lengths.min},l.error=C.minLengthErr||r.require||"City is too short"):s==="maxLength"?(l.params={length:m.lengths.max},l.error=C.maxLengthErr||r.require||"City is too long"):s==="isEUSpecialCharacters"&&(l.error=C.characterErr||r.require||"Invalid characters in city"),l}):[],o=i?.nameRules.map(s=>({key:"first_name",rule:s,error:p.characterErr})).concat(i?.nameRules.map(s=>({key:"last_name",rule:s,error:p.characterErr}))||[])||[],h=i?Object.entries(i.addressRules).flatMap(([s,l])=>l.map(c=>{const n={key:s,rule:c,error:""},R=s==="address1"?u:g;return c==="isPobox"?n.error=f||r.require||"PO Box not allowed":c==="isPackstation"?n.error=P||r.require||"Packstation not allowed":c==="isUSSpecialCharacters"||c==="isEUSpecialCharacters"?n.error=R?.characterErr||r.require||"Invalid characters":c==="minLength"?(n.params={length:"min"in i.addressLengths?i.addressLengths.min:0},n.error=R?.minLengthErr||r.require||"Address is too short"):c==="maxLength"?(n.params={length:i.addressLengths.max},n.error=R?.maxLengthErr||r.require||"Address is too long"):c==="isPureDigital"&&(n.error=R?.pureDigitalErr||r.require||"Address cannot be only numbers"),n})):[];return[...S,...E,...o,...h]},[t,a,d,r]);return{validate:(0,x.useCallback)(({force:C,ignoreKeys:p})=>{let u=[];return y.forEach(({key:g,rule:f,params:P,required:i,error:m,validator:S})=>{const E=f?w[f]:void 0;let o;const h=e[g];p?.includes(g)||h===void 0&&!C||u.find(s=>s.key==g)||(i&&!h?o=m:S?o=S(h,g,e):E&&(o=E(h,P)),o&&u.push({key:g,message:typeof o=="string"?o:m}))}),A(u),!!u.length},[e,y]),errors:q}};
|
|
2
2
|
//# sourceMappingURL=useAddressValidate.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../src/components/credits/context/hooks/useAddressValidate.ts"],
|
|
4
|
-
"sourcesContent": ["import {
|
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,wBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,
|
|
6
|
-
"names": ["useAddressValidate_exports", "__export", "useAddressValidate", "__toCommonJS", "
|
|
4
|
+
"sourcesContent": ["import { useCallback, useMemo, useState } from 'react'\nimport { emailValidate } from '../utils'\nimport { useHeadlessContext } from '@anker-in/lib'\n\ntype ValidatorCallback = (value: string, params?: Record<string, any>) => boolean\n\nconst US_SPECIAL_CHARACTERS = /[&%*<>^#;-]/\nconst EU_SPECIAL_CHARACTERS = /[&^*%<>;,?]/\nconst SC_CHARACTERS = /[^a-zA-Z0-9\\s]/\nconst PURE_DIGITAL = /^\\d+(\\s+\\d+)*$/\nconst PACKSTATION = /(Packstation|Postfiliale)/gi\nconst POBOX = /(P(\\.)?\\s*?O(\\.)?\\s*?box|Post(al)?(\\s*)?(Office(\\s*))?Box)/gi\n\nconst ruleValidators: Record<string, ValidatorCallback> = {\n minLength: (value, params) => value?.length > 0 && value?.length < params?.length,\n maxLength: (value, params) => value?.length > params?.length,\n isUSSpecialCharacters: value => US_SPECIAL_CHARACTERS.test(value),\n isEUSpecialCharacters: value => EU_SPECIAL_CHARACTERS.test(value),\n isSC: value => SC_CHARACTERS.test(value),\n isPureDigital: value => PURE_DIGITAL.test(value),\n isPackstation: value => PACKSTATION.test(value),\n isPobox: value => POBOX.test(value),\n}\n\nexport interface Rule {\n key: string\n error: string\n rule?: string\n params?: Record<string, any>\n required?: boolean\n validator?: (value: string, key: string, address: Record<string, any>) => boolean | string\n}\n\nexport type FormData = {\n key: string\n label: string\n tips: string\n required: boolean\n placeholder: string\n type?: string\n}[]\n\n// \u56FD\u5BB6/\u5730\u533A\u914D\u7F6E\u6620\u5C04\nconst LOCALE_CONFIGS = {\n us: {\n nameRules: ['isUSSpecialCharacters'],\n addressRules: {\n address1: ['isPobox', 'isUSSpecialCharacters', 'minLength', 'maxLength', 'isPureDigital'],\n address2: ['isPobox', 'isUSSpecialCharacters', 'maxLength', 'isPureDigital'],\n },\n addressLengths: { min: 4, max: 32 },\n },\n 'eu-en': {\n nameRules: ['isEUSpecialCharacters'],\n addressRules: {\n address1: ['isPobox', 'isEUSpecialCharacters', 'minLength', 'maxLength', 'isPureDigital', 'isPackstation'],\n address2: ['isPobox', 'isEUSpecialCharacters', 'maxLength', 'isPackstation'],\n },\n addressLengths: { min: 3, max: 70 },\n },\n uk: {\n nameRules: ['isEUSpecialCharacters'],\n addressRules: {\n address1: ['isPobox', 'isEUSpecialCharacters', 'minLength', 'maxLength', 'isPureDigital'],\n address2: ['isPobox', 'isEUSpecialCharacters', 'maxLength'],\n },\n addressLengths: { min: 3, max: 35 },\n },\n 'eu-de': {\n nameRules: ['isEUSpecialCharacters'],\n addressRules: {\n address1: ['isPobox', 'isEUSpecialCharacters', 'minLength', 'maxLength', 'isPureDigital', 'isPackstation'],\n address2: ['isPobox', 'isPackstation', 'isEUSpecialCharacters', 'maxLength'],\n },\n addressLengths: { min: 3, max: 35 },\n },\n ca: {\n nameRules: ['isUSSpecialCharacters'],\n addressRules: {\n address1: ['isPobox', 'maxLength'],\n address2: ['isPobox', 'maxLength'],\n },\n addressLengths: { max: 35 },\n },\n}\n\n// \u57CE\u5E02\u89C4\u5219\u914D\u7F6E\nconst CITY_CONFIGS = {\n uk: { rules: ['isEUSpecialCharacters', 'minLength', 'maxLength'], lengths: { min: 2, max: 35 } },\n 'eu-en': { rules: ['isEUSpecialCharacters', 'minLength', 'maxLength'], lengths: { min: 2, max: 35 } },\n 'eu-de': { rules: ['isEUSpecialCharacters', 'minLength', 'maxLength'], lengths: { min: 2, max: 35 } },\n ca: { rules: ['minLength', 'maxLength'], lengths: { min: 2, max: 15 } },\n}\n\nexport const useAddressValidate = ({\n address,\n validatorInfo,\n formData,\n errorLabel,\n}: {\n address: Record<string, any>\n validatorInfo: any\n formData: any\n errorLabel: {\n require: string\n email: string\n }\n}) => {\n const { locale } = useHeadlessContext()\n const [errors, setErrors] = useState<{ key: string; message: string }[]>([])\n\n const addressRules: Rule[] = useMemo(() => {\n const {\n city_rules = {},\n name_rules = {},\n address1_rules,\n address2_rules,\n POboxErr,\n packstationErr,\n } = validatorInfo || {}\n\n const localeConfig = LOCALE_CONFIGS[locale as keyof typeof LOCALE_CONFIGS]\n const cityConfig = CITY_CONFIGS[locale as keyof typeof CITY_CONFIGS]\n\n // \u57FA\u7840\u89C4\u5219\n const baseRules: Rule[] = [\n // \u8868\u5355\u5B57\u6BB5\u89C4\u5219\n ...formData.map((item: any) => ({\n key: item.key,\n required: item.required,\n error: errorLabel.require || 'This field is required',\n })),\n\n // \u90AE\u7BB1\u6821\u9A8C\n {\n key: 'email',\n error: errorLabel.email || 'Invalid email format',\n validator(value) {\n return !emailValidate(value)\n },\n },\n\n // \u59D3\u540D\u89C4\u5219\n {\n key: 'first_name',\n required: true,\n error: errorLabel.require || 'First name is required',\n },\n {\n key: 'last_name',\n required: true,\n error: errorLabel.require || 'Last name is required',\n },\n {\n key: 'name',\n error: name_rules.maxLengthErr || errorLabel.require || 'Name is too long',\n validator: value => value?.length >= 31,\n },\n ]\n\n // \u57CE\u5E02\u89C4\u5219\n const cityRules: Rule[] = cityConfig\n ? cityConfig.rules.map(rule => {\n const ruleConfig: Rule = { key: 'city', rule, error: '' }\n\n if (rule === 'minLength') {\n ruleConfig.params = { length: cityConfig.lengths.min }\n ruleConfig.error = city_rules.minLengthErr || errorLabel.require || 'City is too short'\n } else if (rule === 'maxLength') {\n ruleConfig.params = { length: cityConfig.lengths.max }\n ruleConfig.error = city_rules.maxLengthErr || errorLabel.require || 'City is too long'\n } else if (rule === 'isEUSpecialCharacters') {\n ruleConfig.error = city_rules.characterErr || errorLabel.require || 'Invalid characters in city'\n }\n\n return ruleConfig\n })\n : []\n\n // \u59D3\u540D\u7279\u6B8A\u5B57\u7B26\u89C4\u5219\n const nameRules: Rule[] =\n localeConfig?.nameRules\n .map(rule => ({\n key: 'first_name',\n rule,\n error: name_rules.characterErr,\n }))\n .concat(\n localeConfig?.nameRules.map(rule => ({\n key: 'last_name',\n rule,\n error: name_rules.characterErr,\n })) || []\n ) || []\n\n // \u5730\u5740\u89C4\u5219\n const addressRules: Rule[] = localeConfig\n ? Object.entries(localeConfig.addressRules).flatMap(([addressKey, rules]) =>\n rules.map(rule => {\n const ruleConfig: Rule = { key: addressKey, rule, error: '' }\n const rulesConfig = addressKey === 'address1' ? address1_rules : address2_rules\n\n if (rule === 'isPobox') {\n ruleConfig.error = POboxErr || errorLabel.require || 'PO Box not allowed'\n } else if (rule === 'isPackstation') {\n ruleConfig.error = packstationErr || errorLabel.require || 'Packstation not allowed'\n } else if (rule === 'isUSSpecialCharacters' || rule === 'isEUSpecialCharacters') {\n ruleConfig.error = rulesConfig?.characterErr || errorLabel.require || 'Invalid characters'\n } else if (rule === 'minLength') {\n ruleConfig.params = { length: 'min' in localeConfig.addressLengths ? localeConfig.addressLengths.min : 0 }\n ruleConfig.error = rulesConfig?.minLengthErr || errorLabel.require || 'Address is too short'\n } else if (rule === 'maxLength') {\n ruleConfig.params = { length: localeConfig.addressLengths.max }\n ruleConfig.error = rulesConfig?.maxLengthErr || errorLabel.require || 'Address is too long'\n } else if (rule === 'isPureDigital') {\n ruleConfig.error = rulesConfig?.pureDigitalErr || errorLabel.require || 'Address cannot be only numbers'\n }\n\n return ruleConfig\n })\n )\n : []\n\n return [...baseRules, ...cityRules, ...nameRules, ...addressRules]\n }, [locale, validatorInfo, formData, errorLabel])\n\n const validate = useCallback(\n ({ force, ignoreKeys }: { force?: boolean; ignoreKeys?: string[] }) => {\n let newErrors: { key: string; message: string }[] = []\n\n addressRules.forEach(({ key, rule, params, required, error, validator }) => {\n const defaultValidator = rule ? ruleValidators[rule] : undefined\n\n let result\n\n const value = address[key]\n\n if (ignoreKeys?.includes(key)) {\n return\n }\n\n if (value === undefined && !force) {\n return\n }\n\n if (newErrors.find(item => item.key == key)) {\n return\n }\n\n if (required && !value) {\n result = error\n } else if (validator) {\n result = validator(value, key, address)\n } else if (defaultValidator) {\n result = defaultValidator(value, params)\n }\n\n if (result) {\n newErrors.push({\n key,\n message: typeof result === 'string' ? result : error,\n })\n }\n })\n\n setErrors(newErrors)\n\n if (newErrors.length) {\n return true\n }\n\n return false\n },\n [address, addressRules]\n )\n\n return {\n validate,\n errors,\n }\n}\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["useAddressValidate_exports", "__export", "useAddressValidate", "__toCommonJS", "import_react", "import_utils", "import_lib", "US_SPECIAL_CHARACTERS", "EU_SPECIAL_CHARACTERS", "SC_CHARACTERS", "PURE_DIGITAL", "PACKSTATION", "POBOX", "ruleValidators", "value", "params", "LOCALE_CONFIGS", "CITY_CONFIGS", "address", "validatorInfo", "formData", "errorLabel", "locale", "errors", "setErrors", "addressRules", "city_rules", "name_rules", "address1_rules", "address2_rules", "POboxErr", "packstationErr", "localeConfig", "cityConfig", "baseRules", "item", "cityRules", "rule", "ruleConfig", "nameRules", "addressKey", "rules", "rulesConfig", "force", "ignoreKeys", "newErrors", "key", "required", "error", "validator", "defaultValidator", "result"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var P=Object.create;var O=Object.defineProperty;var F=Object.getOwnPropertyDescriptor;var q=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,v=Object.prototype.hasOwnProperty;var I=(t,e)=>{for(var r in e)O(t,r,{get:e[r],enumerable:!0})},S=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of q(e))!v.call(t,a)&&a!==r&&O(t,a,{get:()=>e[a],enumerable:!(n=F(e,a))||n.enumerable});return t};var x=(t,e,r)=>(r=t!=null?P(j(t)):{},S(e||!t||!t.__esModule?O(r,"default",{value:t,enumerable:!0}):r,t)),$=t=>S(O({},"__esModule",{value:!0}),t);var J={};I(J,{useAlpcFetch:()=>N,useAlpcMutation:()=>W});module.exports=$(J);var A=x(require("js-cookie")),o=require("react"),C=x(require("swr")),U=require("@anker-in/lib"),m=require("../utils"),b=require("../provider");let R;const B=t=>fetch((0,m.getAlpcPath)(t.locale)+t.url,t.fetchOptions).then(async e=>{if(e.status<300)return(await e.json()).data;if(e.status===401&&t.onReAuth){R||(R=t.onReAuth());const r=await R;if(R=void 0,r)return fetch((0,m.getAlpcPath)(t.locale)+t.url,t.fetchOptions).then(async n=>{if(n.status<300)return(await n.json()).data;if(n.status===401){t.onUnAuth&&t.onUnAuth();return}});t.onUnAuth&&t.onUnAuth();return}}),w=async(t,e,r)=>{let n=await fetch(`${(0,m.getAlpcPath)(t)}/cloud/login`,{method:"POST"}),a=await n.json();if(n.status<300&&!e&&a?.data?.code===27004){const s=A.default.get("alpcEU");if(Number(s)===1?A.default.set("alpcEU","0",{expires:30,domain:`.${r}.com`}):A.default.set("alpcEU","1",{expires:30,domain:`.${r}.com`}),n=await fetch(`${(0,m.getAlpcPath)(t)}/cloud/login`,{method:"POST"}),a=await n.json(),n.status>300)return!1}return!a?.data?.code},k=(t,e,r={})=>{const n=(0,o.useRef)(!1),[a,s]=(0,o.useState)(),[c,i]=(0,o.useState)(!1),u=(0,o.useRef)(t),d=(0,o.useRef)(e),h=(0,o.useRef)(r),g=(0,o.useCallback)(async(y,D={})=>{if(n.current)return;n.current=!0,i(!0);const p={...h.current,...D},{onSuccess:f,onError:T}=p||{};try{const l=await d.current(u.current,{arg:y});return s(l),i(!1),n.current=!1,f&&f(l),l}catch(l){i(!1),n.current=!1,T&&T(l)}},[]);return{isMutating:c,trigger:g,data:a}},N=(t,e)=>{const[r,n]=(0,o.useState)(!1),{removeProfile:a,alpcBrand:s}=(0,b.useCreditsContext)(),{enable:c,...i}=e||{},{locale:u="",brand:d}=(0,U.useHeadlessContext)(),h=s||d,{queryKey:g=[],body:y={},headers:D,...p}=t,f=c??!0,[T,l]=g;return(0,C.default)([T,l],f?([E,M])=>B({url:E,locale:u,fetchOptions:{method:"POST",headers:{"current-language":u,...D},body:JSON.stringify({...y,...M}),...p},onReAuth:async()=>await w(u,r,h)?(n(!0),!0):!1,onUnAuth(){a()}}):null,{revalidateOnFocus:!1,...i})},W=(t,e)=>{const[r,n]=(0,o.useState)(!1),{removeProfile:a,alpcBrand:s}=(0,b.useCreditsContext)(),{locale:c="",brand:i}=(0,U.useHeadlessContext)(),u=s||i,{url:d,initData:h,headers:g,...y}=t;return k(d,(p,f)=>B({url:p,locale:c,fetchOptions:{method:"POST",headers:{"current-language":c,...g},...y,body:JSON.stringify({...h,...f.arg})},onReAuth:async()=>await w(c,r,u)?(n(!0),!0):!1,onUnAuth(){a()}}),e)};
|
|
2
2
|
//# sourceMappingURL=useAlpcFetch.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../src/components/credits/context/hooks/useAlpcFetch.ts"],
|
|
4
|
-
"sourcesContent": ["import Cookies from 'js-cookie'\nimport {
|
|
5
|
-
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,kBAAAE,EAAA,oBAAAC,IAAA,eAAAC,EAAAJ,GAAA,IAAAK,EAAoB,wBACpBC,
|
|
6
|
-
"names": ["useAlpcFetch_exports", "__export", "useAlpcFetch", "useAlpcMutation", "__toCommonJS", "import_js_cookie", "
|
|
4
|
+
"sourcesContent": ["import Cookies from 'js-cookie'\nimport { useCallback, useRef, useState } from 'react'\nimport useSWR, { type SWRConfiguration } from 'swr'\nimport { useHeadlessContext } from '@anker-in/lib'\n\nimport { getAlpcPath } from '../utils'\nimport { useCreditsContext } from '../provider'\n\ninterface UseAlpcFetchOptionsSwrOptions<TData, Error> extends SWRConfiguration<TData, Error> {\n enable?: boolean\n}\n\ninterface FetchOptions extends RequestInit {\n queryKey: [string, Record<string, any>]\n data?: Record<string, any>\n}\n\ninterface MutationOptions extends RequestInit {\n url: string\n initData: Record<string, any>\n}\n\ninterface FetcherOptions {\n url: string\n locale: string\n fetchOptions: RequestInit\n onReAuth: () => Promise<boolean>\n onUnAuth: () => void\n}\n\nlet reAuthPromise: Promise<boolean> | undefined\n\ntype Fetcher<TData, TBody> = (url: string, data: { arg: TBody }) => Promise<TData>\n\nconst fetcher = (options: FetcherOptions) => {\n return fetch(getAlpcPath(options.locale) + options.url, options.fetchOptions).then(async response => {\n if (response.status < 300) {\n const responseData = await response.json()\n return responseData.data\n }\n\n // \u9519\u8BEF\u5904\u7406\n if (response.status === 401) {\n // \u91CD\u65B0\u767B\u5F55\u5C1D\u8BD5\n if (options.onReAuth) {\n if (!reAuthPromise) {\n reAuthPromise = options.onReAuth()\n }\n\n const result = await reAuthPromise\n\n reAuthPromise = undefined\n\n if (result) {\n // \u8DE8\u533A\u91CD\u65B0\u767B\u5F55\u540E\u9700\u8981\u66FF\u6362\u533A\u57DF\u6807\u5FD7\uFF0C\u6240\u4EE5\u4E0D\u80FD\u7528\u6700\u5F00\u59CB\u8BF7\u6C42\u7684\u90A3\u4E2A\u94FE\u63A5\n return fetch(getAlpcPath(options.locale) + options.url, options.fetchOptions).then(async response => {\n if (response.status < 300) {\n const responseData = await response.json()\n return responseData.data\n }\n\n if (response.status === 401) {\n if (options.onUnAuth) {\n options.onUnAuth()\n }\n return\n }\n })\n } else {\n if (options.onUnAuth) {\n options.onUnAuth()\n }\n return\n }\n }\n }\n })\n}\n\nconst reAuth = async (locale: string, retry: boolean, brand: string) => {\n let reloginResponse = await fetch(`${getAlpcPath(locale)}/cloud/login`, {\n method: 'POST',\n })\n let reloginResponseData = await reloginResponse.json()\n\n if (reloginResponse!.status < 300 && !retry) {\n if (reloginResponseData?.data?.code === 27004) {\n // \u8DE8\u533A\u767B\u5F55\u9519\u8BEF\n const alpcEUCookie = Cookies.get('alpcEU')\n\n if (Number(alpcEUCookie) === 1) {\n Cookies.set('alpcEU', '0', {\n expires: 30,\n domain: `.${brand}.com`,\n })\n } else {\n Cookies.set('alpcEU', '1', {\n expires: 30,\n domain: `.${brand}.com`,\n })\n }\n\n // \u91CD\u65B0\u5C1D\u8BD5\u6362\u533A\u767B\u5F55\n reloginResponse = await fetch(`${getAlpcPath(locale)}/cloud/login`, {\n method: 'POST',\n })\n reloginResponseData = await reloginResponse.json()\n\n if (reloginResponse.status > 300) {\n return false\n }\n }\n }\n if (!reloginResponseData?.data?.code) {\n // \u91CD\u65B0\u767B\u5F55\u6210\u529F\n return true\n }\n\n return false\n}\n\nexport interface UseMutationConfig<TData> {\n onSuccess?: (response: TData) => any\n onError?: (error: Error) => any\n}\n\nconst useMutation = <TData, TBody>(\n url: string,\n fetcher: Fetcher<TData, TBody>,\n mutationConfig: UseMutationConfig<TData> = {}\n) => {\n const innerMutating = useRef<boolean>(false)\n\n const [data, setData] = useState<TData>()\n const [isMutating, setIsMutating] = useState(false)\n\n const urlRef = useRef(url)\n const fetcherRef = useRef(fetcher)\n const configRef = useRef(mutationConfig)\n\n const trigger = useCallback(\n async (fetchData: TBody, opts: UseMutationConfig<TData> = {}) => {\n if (innerMutating.current) {\n return\n }\n\n innerMutating.current = true\n setIsMutating(true)\n\n const config = {\n ...configRef.current,\n ...opts,\n }\n\n const { onSuccess, onError } = config || {}\n\n try {\n const fetchResult = await fetcherRef.current(urlRef.current, {\n arg: fetchData,\n })\n setData(fetchResult)\n\n setIsMutating(false)\n innerMutating.current = false\n\n if (onSuccess) {\n onSuccess(fetchResult)\n }\n return fetchResult\n } catch (err: any) {\n setIsMutating(false)\n innerMutating.current = false\n\n if (onError) {\n onError(err)\n }\n }\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n []\n )\n\n return {\n isMutating,\n trigger,\n data,\n }\n}\n\nexport const useAlpcFetch = <TData>(\n options: FetchOptions,\n swrOptions?: UseAlpcFetchOptionsSwrOptions<TData, Error>\n) => {\n const [retry, setRetry] = useState(false)\n const { removeProfile, alpcBrand } = useCreditsContext()\n\n const { enable, ...otherSwrOptions } = swrOptions || {}\n\n const { locale = '', brand: headlessBrand } = useHeadlessContext()\n // \u4F18\u5148\u4F7F\u7528 creditsContext \u4E2D\u7684 alpcBrand\uFF0C\u5982\u679C\u6CA1\u6709\u5219\u4F7F\u7528 headlessConfig \u4E2D\u7684 brand\n const brand = alpcBrand || headlessBrand\n\n const { queryKey = [], body: fetchBody = {}, headers, ...fetchOptions } = options\n const fetchEnable = enable ?? true\n\n const [url, requestBody] = queryKey\n\n const context = useSWR<TData>(\n [url, requestBody],\n !fetchEnable\n ? null\n : ([requestUrl, data]: [string, Record<string, any>]) =>\n fetcher({\n url: requestUrl,\n locale,\n fetchOptions: {\n method: 'POST',\n headers: {\n 'current-language': locale,\n ...headers,\n },\n body: JSON.stringify({\n ...fetchBody,\n ...data,\n }),\n ...fetchOptions,\n },\n onReAuth: async () => {\n const result = await reAuth(locale, retry, brand)\n\n if (result) {\n setRetry(true)\n return true\n }\n\n return false\n },\n onUnAuth() {\n // \u5931\u8D25\u540E\u9000\u51FA\u767B\u5F55\n removeProfile()\n },\n }),\n {\n revalidateOnFocus: false,\n ...otherSwrOptions,\n }\n )\n\n return context\n}\n\nexport const useAlpcMutation = <TData, TBody>(options: MutationOptions, mutationOptions?: UseMutationConfig<TData>) => {\n const [retry, setRetry] = useState(false)\n const { removeProfile, alpcBrand } = useCreditsContext()\n\n const { locale = '', brand: headlessBrand } = useHeadlessContext()\n // \u4F18\u5148\u4F7F\u7528 creditsContext \u4E2D\u7684 alpcBrand\uFF0C\u5982\u679C\u6CA1\u6709\u5219\u4F7F\u7528 headlessConfig \u4E2D\u7684 brand\n const brand = alpcBrand || headlessBrand\n\n const { url, initData, headers, ...fetchOptions } = options\n\n const context = useMutation<TData, TBody>(\n url,\n (requestUrl, data: { arg: TBody }) =>\n fetcher({\n url: requestUrl,\n locale,\n fetchOptions: {\n method: 'POST',\n headers: {\n 'current-language': locale,\n ...headers,\n },\n ...fetchOptions,\n body: JSON.stringify({\n ...initData,\n ...data.arg,\n }),\n },\n onReAuth: async () => {\n const result = await reAuth(locale, retry, brand)\n\n if (result) {\n setRetry(true)\n return true\n }\n\n return false\n },\n onUnAuth() {\n // \u5931\u8D25\u540E\u9000\u51FA\u767B\u5F55\n removeProfile()\n },\n }),\n mutationOptions\n )\n\n return context\n}\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["useAlpcFetch_exports", "__export", "useAlpcFetch", "useAlpcMutation", "__toCommonJS", "import_js_cookie", "import_react", "import_swr", "import_lib", "import_utils", "import_provider", "reAuthPromise", "fetcher", "options", "response", "result", "reAuth", "locale", "retry", "brand", "reloginResponse", "reloginResponseData", "alpcEUCookie", "Cookies", "useMutation", "url", "mutationConfig", "innerMutating", "data", "setData", "isMutating", "setIsMutating", "urlRef", "fetcherRef", "configRef", "trigger", "fetchData", "opts", "config", "onSuccess", "onError", "fetchResult", "err", "swrOptions", "setRetry", "removeProfile", "alpcBrand", "enable", "otherSwrOptions", "headlessBrand", "queryKey", "fetchBody", "headers", "fetchOptions", "fetchEnable", "requestBody", "useSWR", "requestUrl", "mutationOptions", "initData"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var p=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var
|
|
1
|
+
"use strict";var p=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var C=Object.prototype.hasOwnProperty;var S=(e,o)=>{for(var s in o)p(e,s,{get:o[s],enumerable:!0})},m=(e,o,s,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let t of y(o))!C.call(e,t)&&t!==s&&p(e,t,{get:()=>o[t],enumerable:!(n=g(o,t))||n.enumerable});return e};var w=e=>m(p({},"__esModule",{value:!0}),e);var x={};S(x,{default:()=>b});module.exports=w(x);var a=require("react"),l=require("@anker-in/lib");function E({shopifyStoreDomain:e}){const{locale:o=""}=(0,l.useHeadlessContext)(),[s,n]=(0,a.useState)(!1),[t,u]=(0,a.useState)([]);return(0,a.useEffect)(()=>{(async()=>{n(!0);try{const d=await(await fetch(`/api/multipass/rainbowbridge/uc/shop/shipping_zones?shop=${e}`)).json();let r=[];const h=new Set;d.data.data.forEach(c=>{c.countries.forEach(i=>{h.has(i.code)||(h.add(i.code),r.push(i))})}),r=r.sort((c,i)=>c.code.localeCompare(i.code)),console.log("fetch shipsToCountries",r),u(r)}catch(f){u([]),console.error(f)}finally{n(!1)}})()},[o]),{isLoading:s,countries:t}}var b=E;
|
|
2
2
|
//# sourceMappingURL=useCountries.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../src/components/credits/context/hooks/useCountries.ts"],
|
|
4
|
-
"sourcesContent": ["import {
|
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,
|
|
6
|
-
"names": ["useCountries_exports", "__export", "useCountries_default", "__toCommonJS", "
|
|
4
|
+
"sourcesContent": ["import { useEffect, useState } from 'react'\n\nimport { useHeadlessContext } from '@anker-in/lib'\nimport { type ShippingCountry, type ShippingZone } from '../../type'\n\nfunction useCountries({ shopifyStoreDomain }: { shopifyStoreDomain: string }) {\n const { locale = '' } = useHeadlessContext()\n\n const [isLoading, setLoading] = useState(false)\n const [countries, setCountries] = useState<ShippingCountry[]>([])\n\n useEffect(() => {\n const fetchCountries = async () => {\n setLoading(true)\n try {\n const response = await fetch(`/api/multipass/rainbowbridge/uc/shop/shipping_zones?shop=${shopifyStoreDomain}`)\n const res: any = await response.json()\n\n // \u56FD\u5BB6\u8FC7\u6EE4\n let shipsToCountries: ShippingCountry[] = []\n const countrySet = new Set()\n res.data.data.forEach((shippingZoneItem: ShippingZone) => {\n shippingZoneItem.countries.forEach(shippingZoneCountryItem => {\n if (!countrySet.has(shippingZoneCountryItem.code)) {\n countrySet.add(shippingZoneCountryItem.code)\n shipsToCountries.push(shippingZoneCountryItem)\n }\n })\n })\n\n // \u5B57\u6BCD\u987A\u5E8F\u6392\u5E8F\n shipsToCountries = shipsToCountries.sort((a, b) => {\n return a.code.localeCompare(b.code)\n })\n\n console.log('fetch shipsToCountries', shipsToCountries)\n setCountries(shipsToCountries)\n } catch (e) {\n setCountries([])\n console.error(e)\n } finally {\n setLoading(false)\n }\n }\n\n fetchCountries()\n }, [locale])\n\n return {\n isLoading,\n countries,\n }\n}\n\nexport default useCountries\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAoC,iBAEpCC,EAAmC,yBAGnC,SAASC,EAAa,CAAE,mBAAAC,CAAmB,EAAmC,CAC5E,KAAM,CAAE,OAAAC,EAAS,EAAG,KAAI,sBAAmB,EAErC,CAACC,EAAWC,CAAU,KAAI,YAAS,EAAK,EACxC,CAACC,EAAWC,CAAY,KAAI,YAA4B,CAAC,CAAC,EAEhE,sBAAU,IAAM,EACS,SAAY,CACjCF,EAAW,EAAI,EACf,GAAI,CAEF,MAAMG,EAAW,MADA,MAAM,MAAM,4DAA4DN,CAAkB,EAAE,GAC7E,KAAK,EAGrC,IAAIO,EAAsC,CAAC,EAC3C,MAAMC,EAAa,IAAI,IACvBF,EAAI,KAAK,KAAK,QAASG,GAAmC,CACxDA,EAAiB,UAAU,QAAQC,GAA2B,CACvDF,EAAW,IAAIE,EAAwB,IAAI,IAC9CF,EAAW,IAAIE,EAAwB,IAAI,EAC3CH,EAAiB,KAAKG,CAAuB,EAEjD,CAAC,CACH,CAAC,EAGDH,EAAmBA,EAAiB,KAAK,CAACI,EAAGC,IACpCD,EAAE,KAAK,cAAcC,EAAE,IAAI,CACnC,EAED,QAAQ,IAAI,yBAA0BL,CAAgB,EACtDF,EAAaE,CAAgB,CAC/B,OAASM,EAAG,CACVR,EAAa,CAAC,CAAC,EACf,QAAQ,MAAMQ,CAAC,CACjB,QAAE,CACAV,EAAW,EAAK,CAClB,CACF,GAEe,CACjB,EAAG,CAACF,CAAM,CAAC,EAEJ,CACL,UAAAC,EACA,UAAAE,CACF,CACF,CAEA,IAAOT,EAAQI",
|
|
6
|
+
"names": ["useCountries_exports", "__export", "useCountries_default", "__toCommonJS", "import_react", "import_lib", "useCountries", "shopifyStoreDomain", "locale", "isLoading", "setLoading", "countries", "setCountries", "res", "shipsToCountries", "countrySet", "shippingZoneItem", "shippingZoneCountryItem", "a", "b", "e"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ProductVariant } from '@anker-in/lib';
|
|
2
|
+
import { FunctionMemberPriceResult } from '../memberPriceTypes';
|
|
3
|
+
export declare const useFunctionMemberPrice: ({ variant }: {
|
|
4
|
+
variant?: ProductVariant;
|
|
5
|
+
}) => FunctionMemberPriceResult | (Partial<FunctionMemberPriceResult> & {
|
|
6
|
+
hasMemberPrice: false;
|
|
7
|
+
});
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var i=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var l=(r,e)=>{for(var o in e)i(r,o,{get:e[o],enumerable:!0})},f=(r,e,o,c)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of b(e))!a.call(r,t)&&t!==o&&i(r,t,{get:()=>e[t],enumerable:!(c=P(e,t))||c.enumerable});return r};var M=r=>f(i({},"__esModule",{value:!0}),r);var d={};l(d,{useFunctionMemberPrice:()=>p});module.exports=M(d);var m=require("../utils/getFunctionMemberPrice"),n=require("react"),s=require("../provider"),u=require("@anker-in/lib");const p=({variant:r})=>{const{memberPriceDiscount:e}=(0,s.useCreditsContext)(),{locale:o=""}=(0,u.useHeadlessContext)();return(0,n.useMemo)(()=>{const t=(0,m.getFunctionMemberPrice)({memberPriceDiscount:e,currencyCode:r?.price.currencyCode,variant:r,locale:o});return t||{hasMemberPrice:!1}},[o,e,r])};
|
|
2
|
+
//# sourceMappingURL=useFunctionMemberPrice.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/components/credits/context/hooks/useFunctionMemberPrice.ts"],
|
|
4
|
+
"sourcesContent": ["import { ProductVariant } from '@anker-in/lib'\nimport { FunctionMemberPriceResult } from '../memberPriceTypes'\nimport { getFunctionMemberPrice } from '../utils/getFunctionMemberPrice'\nimport { useMemo } from 'react'\nimport { useCreditsContext } from '../provider'\nimport { useHeadlessContext } from '@anker-in/lib'\n\n// \u8BA1\u7B97\u5355\u4EF6\u5546\u54C1\u7684\u4F1A\u5458\u4EF7\nexport const useFunctionMemberPrice = ({ variant }: { variant?: ProductVariant }) => {\n const { memberPriceDiscount } = useCreditsContext()\n const { locale = '' } = useHeadlessContext()\n\n const memberPrice:\n | FunctionMemberPriceResult\n | (Partial<FunctionMemberPriceResult> & {\n hasMemberPrice: false\n }) = useMemo(() => {\n const result = getFunctionMemberPrice({\n memberPriceDiscount: memberPriceDiscount,\n currencyCode: variant?.price.currencyCode,\n variant,\n locale,\n })\n\n if (result) {\n return result as FunctionMemberPriceResult\n }\n\n return { hasMemberPrice: false }\n }, [locale, memberPriceDiscount, variant])\n\n return memberPrice\n}\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,4BAAAE,IAAA,eAAAC,EAAAH,GAEA,IAAAI,EAAuC,2CACvCC,EAAwB,iBACxBC,EAAkC,uBAClCC,EAAmC,yBAG5B,MAAML,EAAyB,CAAC,CAAE,QAAAM,CAAQ,IAAoC,CACnF,KAAM,CAAE,oBAAAC,CAAoB,KAAI,qBAAkB,EAC5C,CAAE,OAAAC,EAAS,EAAG,KAAI,sBAAmB,EAqB3C,SAfS,WAAQ,IAAM,CACrB,MAAMC,KAAS,0BAAuB,CACpC,oBAAqBF,EACrB,aAAcD,GAAS,MAAM,aAC7B,QAAAA,EACA,OAAAE,CACF,CAAC,EAED,OAAIC,GAIG,CAAE,eAAgB,EAAM,CACjC,EAAG,CAACD,EAAQD,EAAqBD,CAAO,CAAC,CAG3C",
|
|
6
|
+
"names": ["useFunctionMemberPrice_exports", "__export", "useFunctionMemberPrice", "__toCommonJS", "import_getFunctionMemberPrice", "import_react", "import_provider", "import_lib", "variant", "memberPriceDiscount", "locale", "result"]
|
|
7
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var m=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var B=(e,t)=>{for(var s in t)m(e,s,{get:t[s],enumerable:!0})},k=(e,t,s,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of T(t))!h.call(e,o)&&o!==s&&m(e,o,{get:()=>t[o],enumerable:!(n=N(t,o))||n.enumerable});return e};var v=e=>k(m({},"__esModule",{value:!0}),e);var H={};B(H,{default:()=>E});module.exports=v(H);var r=require("react"),u=require("../const"),f=require("./useAlpcFetch"),C=require("../provider"),y=require("@anker-in/lib");function z({page:e,pageSize:t,consumeType:s}){const{isLoadingProfile:n,profile:o,alpcBrand:R}=(0,C.useCreditsContext)(),{brand:b,locale:p,appName:L}=(0,y.useHeadlessContext)(),A=R||b,M=!!o,[i,l]=(0,r.useState)([]),[_,w]=(0,r.useState)(0),[g,P]=(0,r.useState)(0),{isMutating:a,trigger:c}=(0,f.useAlpcMutation)({url:"/v1/credit/log/coupon",initData:{brand:A,country:u.ALPC_COUNTRY_MAP.get(p)||p,app_name:L}});(0,r.useEffect)(()=>{n||!o||a||e!==g&&e&&c({consume_type:s||u.AlpcConsumeType.Coupon,page:e,page_size:t,user_id:o?.user_id},{onSuccess(d){P(e),w(d?.data?.total),l(i.concat(d?.data?.redeem_logs||[]))}})},[c,i,s,e,t,g,o,n,a]);const x=(0,r.useCallback)(async()=>{n||!M||!o||a||await c({consume_type:s||u.AlpcConsumeType.Coupon,page:e,page_size:t,user_id:o?.user_id},{onSuccess(d){l(d?.data?.redeem_logs||[])}})},[s,a,n,e,t,o,c]);return{myRewards:i,isLoading:a,total:_,getMyRewards:x,canNext:_>i.length&&!a}}var E=z;
|
|
2
2
|
//# sourceMappingURL=useMyRewards.js.map
|