@anker-in/campaign-ui 0.2.10-beta.19 → 0.2.10-beta.20
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/index.d.mts +494 -0
- package/dist/index.d.ts +494 -0
- package/dist/index.js +31227 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +31211 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +39 -42
- package/src/components/credits/context/hooks/useActivities.ts +2 -2
- package/src/components/credits/context/hooks/useAddressValidate.ts +2 -2
- package/src/components/credits/context/hooks/useAlpcFetch.ts +8 -8
- package/src/components/credits/context/hooks/useCountries.ts +2 -2
- package/src/components/credits/context/hooks/useMyRewards.ts +2 -2
- package/src/components/credits/context/hooks/useRedeemAndBuy.ts +20 -23
- package/src/components/credits/context/hooks/useRedeemCoupon.ts +2 -2
- package/src/components/credits/context/hooks/useRedeemProduct.ts +2 -2
- package/src/components/credits/context/hooks/useRedeemableList.ts +2 -2
- package/src/components/credits/context/hooks/useSendEmailValidation.ts +2 -2
- package/src/components/credits/context/hooks/useSubscribed.ts +2 -2
- package/src/components/credits/context/hooks/useSubscriptions.ts +2 -2
- package/src/components/credits/creditsCash/RedeemableItem.tsx +13 -18
- package/src/components/credits/creditsRedeemList/AddressForm/index.tsx +2 -2
- package/src/components/credits/creditsRedeemList/RedeemCouponModal.tsx +2 -2
- package/src/components/credits/creditsRedeemList/RedeemProductModal/Address.tsx +2 -2
- package/src/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.tsx +2 -2
- package/src/components/credits/creditsRedeemList/RedeemProductModal/index.tsx +2 -2
- package/src/components/credits/creditsWaysToGetCredits/useActions.ts +4 -3
- package/dist/cjs/components/chat/action.d.ts +0 -25
- package/dist/cjs/components/chat/action.js +0 -2
- package/dist/cjs/components/chat/action.js.map +0 -7
- package/dist/cjs/components/chat/button.d.ts +0 -3
- package/dist/cjs/components/chat/button.js +0 -2
- package/dist/cjs/components/chat/button.js.map +0 -7
- package/dist/cjs/components/chat/chat-context.d.ts +0 -101
- package/dist/cjs/components/chat/chat-context.js +0 -2
- package/dist/cjs/components/chat/chat-context.js.map +0 -7
- package/dist/cjs/components/chat/chatContext.d.ts +0 -101
- package/dist/cjs/components/chat/chatContext.js +0 -2
- package/dist/cjs/components/chat/chatContext.js.map +0 -7
- package/dist/cjs/components/chat/index.d.ts +0 -71
- package/dist/cjs/components/chat/index.js +0 -2
- package/dist/cjs/components/chat/index.js.map +0 -7
- package/dist/cjs/components/chat/markdown.d.ts +0 -5
- package/dist/cjs/components/chat/markdown.js +0 -2
- package/dist/cjs/components/chat/markdown.js.map +0 -7
- package/dist/cjs/components/chat/messages.d.ts +0 -3
- package/dist/cjs/components/chat/messages.js +0 -2
- package/dist/cjs/components/chat/messages.js.map +0 -7
- package/dist/cjs/components/chat/props.d.ts +0 -43
- package/dist/cjs/components/chat/props.js +0 -2
- package/dist/cjs/components/chat/props.js.map +0 -7
- package/dist/cjs/components/chat/response.d.ts +0 -4
- package/dist/cjs/components/chat/response.js +0 -2
- package/dist/cjs/components/chat/response.js.map +0 -7
- package/dist/cjs/components/chat/suggestions.d.ts +0 -3
- package/dist/cjs/components/chat/suggestions.js +0 -2
- package/dist/cjs/components/chat/suggestions.js.map +0 -7
- package/dist/cjs/components/chat/utils.d.ts +0 -3
- package/dist/cjs/components/chat/utils.js +0 -2
- package/dist/cjs/components/chat/utils.js.map +0 -7
- package/dist/cjs/components/credits/context/const.d.ts +0 -81
- package/dist/cjs/components/credits/context/const.js +0 -2
- package/dist/cjs/components/credits/context/const.js.map +0 -7
- package/dist/cjs/components/credits/context/hooks/useActivities.d.ts +0 -12
- package/dist/cjs/components/credits/context/hooks/useActivities.js +0 -2
- package/dist/cjs/components/credits/context/hooks/useActivities.js.map +0 -7
- package/dist/cjs/components/credits/context/hooks/useAddressValidate.d.ts +0 -34
- package/dist/cjs/components/credits/context/hooks/useAddressValidate.js +0 -2
- package/dist/cjs/components/credits/context/hooks/useAddressValidate.js.map +0 -7
- package/dist/cjs/components/credits/context/hooks/useAlpcFetch.d.ts +0 -23
- package/dist/cjs/components/credits/context/hooks/useAlpcFetch.js +0 -2
- package/dist/cjs/components/credits/context/hooks/useAlpcFetch.js.map +0 -7
- package/dist/cjs/components/credits/context/hooks/useClickOutside.d.ts +0 -3
- package/dist/cjs/components/credits/context/hooks/useClickOutside.js +0 -2
- package/dist/cjs/components/credits/context/hooks/useClickOutside.js.map +0 -7
- package/dist/cjs/components/credits/context/hooks/useCopy.d.ts +0 -5
- package/dist/cjs/components/credits/context/hooks/useCopy.js +0 -2
- package/dist/cjs/components/credits/context/hooks/useCopy.js.map +0 -7
- package/dist/cjs/components/credits/context/hooks/useCountries.d.ts +0 -8
- package/dist/cjs/components/credits/context/hooks/useCountries.js +0 -2
- package/dist/cjs/components/credits/context/hooks/useCountries.js.map +0 -7
- package/dist/cjs/components/credits/context/hooks/useFirstPurchaseFinished.d.ts +0 -1
- package/dist/cjs/components/credits/context/hooks/useFirstPurchaseFinished.js +0 -2
- package/dist/cjs/components/credits/context/hooks/useFirstPurchaseFinished.js.map +0 -7
- package/dist/cjs/components/credits/context/hooks/useMyRewards.d.ts +0 -14
- package/dist/cjs/components/credits/context/hooks/useMyRewards.js +0 -2
- package/dist/cjs/components/credits/context/hooks/useMyRewards.js.map +0 -7
- package/dist/cjs/components/credits/context/hooks/useReceiptUploaded.d.ts +0 -2
- package/dist/cjs/components/credits/context/hooks/useReceiptUploaded.js +0 -2
- package/dist/cjs/components/credits/context/hooks/useReceiptUploaded.js.map +0 -7
- package/dist/cjs/components/credits/context/hooks/useRedeemAndBuy.d.ts +0 -14
- package/dist/cjs/components/credits/context/hooks/useRedeemAndBuy.js +0 -2
- package/dist/cjs/components/credits/context/hooks/useRedeemAndBuy.js.map +0 -7
- package/dist/cjs/components/credits/context/hooks/useRedeemCoupon.d.ts +0 -17
- package/dist/cjs/components/credits/context/hooks/useRedeemCoupon.js +0 -2
- package/dist/cjs/components/credits/context/hooks/useRedeemCoupon.js.map +0 -7
- package/dist/cjs/components/credits/context/hooks/useRedeemProduct.d.ts +0 -16
- package/dist/cjs/components/credits/context/hooks/useRedeemProduct.js +0 -2
- package/dist/cjs/components/credits/context/hooks/useRedeemProduct.js.map +0 -7
- package/dist/cjs/components/credits/context/hooks/useRedeemableList.d.ts +0 -7
- package/dist/cjs/components/credits/context/hooks/useRedeemableList.js +0 -2
- package/dist/cjs/components/credits/context/hooks/useRedeemableList.js.map +0 -7
- package/dist/cjs/components/credits/context/hooks/useSendEmailValidation.d.ts +0 -1
- package/dist/cjs/components/credits/context/hooks/useSendEmailValidation.js +0 -2
- package/dist/cjs/components/credits/context/hooks/useSendEmailValidation.js.map +0 -7
- package/dist/cjs/components/credits/context/hooks/useSubscribed.d.ts +0 -1
- package/dist/cjs/components/credits/context/hooks/useSubscribed.js +0 -2
- package/dist/cjs/components/credits/context/hooks/useSubscribed.js.map +0 -7
- package/dist/cjs/components/credits/context/hooks/useSubscriptions.d.ts +0 -5
- package/dist/cjs/components/credits/context/hooks/useSubscriptions.js +0 -2
- package/dist/cjs/components/credits/context/hooks/useSubscriptions.js.map +0 -7
- package/dist/cjs/components/credits/context/hooks/useUploadReceipt.d.ts +0 -14
- package/dist/cjs/components/credits/context/hooks/useUploadReceipt.js +0 -2
- package/dist/cjs/components/credits/context/hooks/useUploadReceipt.js.map +0 -7
- package/dist/cjs/components/credits/context/provider.d.ts +0 -49
- package/dist/cjs/components/credits/context/provider.js +0 -2
- package/dist/cjs/components/credits/context/provider.js.map +0 -7
- package/dist/cjs/components/credits/context/response.d.ts +0 -63
- package/dist/cjs/components/credits/context/response.js +0 -2
- package/dist/cjs/components/credits/context/response.js.map +0 -7
- package/dist/cjs/components/credits/context/utils.d.ts +0 -25
- package/dist/cjs/components/credits/context/utils.js +0 -2
- package/dist/cjs/components/credits/context/utils.js.map +0 -7
- 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/iconInfo.js +0 -2
- package/dist/cjs/components/credits/credits-benefits/iconInfo.js.map +0 -7
- 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/Input.js +0 -2
- package/dist/cjs/components/credits/credits-redeem-list/address-form/Input.js.map +0 -7
- 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/form-item.js +0 -2
- package/dist/cjs/components/credits/credits-redeem-list/address-form/form-item.js.map +0 -7
- 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/address-form/type.js +0 -2
- package/dist/cjs/components/credits/credits-redeem-list/address-form/type.js.map +0 -7
- 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/Error.js +0 -2
- package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Error.js.map +0 -7
- 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 +0 -2
- 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/creditsBanner/index.d.ts +0 -23
- package/dist/cjs/components/credits/creditsBanner/index.js +0 -2
- package/dist/cjs/components/credits/creditsBanner/index.js.map +0 -7
- package/dist/cjs/components/credits/creditsBenefits/benefitItem.d.ts +0 -19
- package/dist/cjs/components/credits/creditsBenefits/benefitItem.js +0 -2
- package/dist/cjs/components/credits/creditsBenefits/benefitItem.js.map +0 -7
- package/dist/cjs/components/credits/creditsBenefits/iconInfo.d.ts +0 -2
- package/dist/cjs/components/credits/creditsBenefits/iconInfo.js +0 -2
- package/dist/cjs/components/credits/creditsBenefits/iconInfo.js.map +0 -7
- package/dist/cjs/components/credits/creditsBenefits/index.d.ts +0 -12
- package/dist/cjs/components/credits/creditsBenefits/index.js +0 -4
- package/dist/cjs/components/credits/creditsBenefits/index.js.map +0 -7
- package/dist/cjs/components/credits/creditsCash/RedeemableItem.d.ts +0 -15
- package/dist/cjs/components/credits/creditsCash/RedeemableItem.js +0 -2
- package/dist/cjs/components/credits/creditsCash/RedeemableItem.js.map +0 -7
- package/dist/cjs/components/credits/creditsCash/index.d.ts +0 -13
- package/dist/cjs/components/credits/creditsCash/index.js +0 -2
- package/dist/cjs/components/credits/creditsCash/index.js.map +0 -7
- package/dist/cjs/components/credits/creditsCash/type.d.ts +0 -47
- package/dist/cjs/components/credits/creditsCash/type.js +0 -2
- package/dist/cjs/components/credits/creditsCash/type.js.map +0 -7
- package/dist/cjs/components/credits/creditsFaq/faqItem/FaqItem.d.ts +0 -13
- package/dist/cjs/components/credits/creditsFaq/faqItem/FaqItem.js +0 -2
- package/dist/cjs/components/credits/creditsFaq/faqItem/FaqItem.js.map +0 -7
- package/dist/cjs/components/credits/creditsFaq/index.d.ts +0 -16
- package/dist/cjs/components/credits/creditsFaq/index.js +0 -2
- package/dist/cjs/components/credits/creditsFaq/index.js.map +0 -7
- package/dist/cjs/components/credits/creditsInfoCard/index.d.ts +0 -20
- package/dist/cjs/components/credits/creditsInfoCard/index.js +0 -2
- package/dist/cjs/components/credits/creditsInfoCard/index.js.map +0 -7
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/CountrySelect.d.ts +0 -14
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/CountrySelect.js +0 -2
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/CountrySelect.js.map +0 -7
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/FormItem.d.ts +0 -6
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/FormItem.js +0 -2
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/FormItem.js.map +0 -7
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/Input.d.ts +0 -13
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/Input.js +0 -2
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/Input.js.map +0 -7
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/StateSelect.d.ts +0 -15
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/StateSelect.js +0 -2
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/StateSelect.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/index.d.ts +0 -2
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/index.js +0 -2
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/index.js.map +0 -7
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/state-select.d.ts +0 -15
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/type.d.ts +0 -26
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/type.js +0 -2
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/type.js.map +0 -7
- package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.d.ts +0 -9
- package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.js +0 -2
- package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.js.map +0 -7
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.d.ts +0 -20
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.js +0 -2
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.js.map +0 -7
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Error.d.ts +0 -8
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Error.js +0 -2
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Error.js.map +0 -7
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Init.d.ts +0 -11
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Init.js +0 -2
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Init.js.map +0 -7
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.d.ts +0 -8
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js +0 -2
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js.map +0 -7
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.d.ts +0 -13
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.js +0 -2
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.js.map +0 -7
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.d.ts +0 -11
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.js +0 -2
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.js.map +0 -7
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal.d.ts +0 -62
- package/dist/cjs/components/credits/creditsRedeemList/RedeemableItem.d.ts +0 -9
- package/dist/cjs/components/credits/creditsRedeemList/RedeemableItem.js +0 -2
- package/dist/cjs/components/credits/creditsRedeemList/RedeemableItem.js.map +0 -7
- package/dist/cjs/components/credits/creditsRedeemList/index.d.ts +0 -13
- package/dist/cjs/components/credits/creditsRedeemList/index.js +0 -2
- package/dist/cjs/components/credits/creditsRedeemList/index.js.map +0 -7
- package/dist/cjs/components/credits/creditsRedeemList/type.d.ts +0 -77
- package/dist/cjs/components/credits/creditsRedeemList/type.js +0 -2
- package/dist/cjs/components/credits/creditsRedeemList/type.js.map +0 -7
- package/dist/cjs/components/credits/creditsWaysToGetCredits/index.d.ts +0 -2
- package/dist/cjs/components/credits/creditsWaysToGetCredits/index.js +0 -2
- package/dist/cjs/components/credits/creditsWaysToGetCredits/index.js.map +0 -7
- package/dist/cjs/components/credits/creditsWaysToGetCredits/type.d.ts +0 -60
- package/dist/cjs/components/credits/creditsWaysToGetCredits/type.js +0 -2
- package/dist/cjs/components/credits/creditsWaysToGetCredits/type.js.map +0 -7
- package/dist/cjs/components/credits/creditsWaysToGetCredits/useActions.d.ts +0 -96
- package/dist/cjs/components/credits/creditsWaysToGetCredits/useActions.js +0 -2
- package/dist/cjs/components/credits/creditsWaysToGetCredits/useActions.js.map +0 -7
- package/dist/cjs/components/credits/index.d.ts +0 -10
- package/dist/cjs/components/credits/index.js +0 -2
- package/dist/cjs/components/credits/index.js.map +0 -7
- package/dist/cjs/components/credits/modal/MyRewardsModal.d.ts +0 -32
- package/dist/cjs/components/credits/modal/MyRewardsModal.js +0 -2
- package/dist/cjs/components/credits/modal/MyRewardsModal.js.map +0 -7
- package/dist/cjs/components/credits/modal/activitiesModal.d.ts +0 -32
- package/dist/cjs/components/credits/modal/activitiesModal.js +0 -2
- package/dist/cjs/components/credits/modal/activitiesModal.js.map +0 -7
- package/dist/cjs/components/credits/modal/creditsUploadReceiptModal.d.ts +0 -24
- package/dist/cjs/components/credits/modal/creditsUploadReceiptModal.js +0 -2
- package/dist/cjs/components/credits/modal/creditsUploadReceiptModal.js.map +0 -7
- package/dist/cjs/components/credits/modal/loadingDots.d.ts +0 -6
- package/dist/cjs/components/credits/modal/loadingDots.js +0 -2
- package/dist/cjs/components/credits/modal/loadingDots.js.map +0 -7
- package/dist/cjs/components/credits/modal/modalContainer.d.ts +0 -15
- package/dist/cjs/components/credits/modal/modalContainer.js +0 -2
- package/dist/cjs/components/credits/modal/modalContainer.js.map +0 -7
- package/dist/cjs/components/credits/modal/rulesModal.d.ts +0 -7
- package/dist/cjs/components/credits/modal/rulesModal.js +0 -2
- package/dist/cjs/components/credits/modal/rulesModal.js.map +0 -7
- package/dist/cjs/components/credits/modal/tip.d.ts +0 -5
- package/dist/cjs/components/credits/modal/tip.js +0 -2
- package/dist/cjs/components/credits/modal/tip.js.map +0 -7
- package/dist/cjs/components/credits/type.d.ts +0 -55
- package/dist/cjs/components/credits/type.js +0 -2
- package/dist/cjs/components/credits/type.js.map +0 -7
- package/dist/cjs/components/index.d.ts +0 -3
- package/dist/cjs/components/index.js +0 -2
- package/dist/cjs/components/index.js.map +0 -7
- package/dist/cjs/debug-env.d.ts +0 -7
- package/dist/cjs/debug-env.js +0 -2
- package/dist/cjs/debug-env.js.map +0 -7
- package/dist/cjs/helpers/fetchResponse.d.ts +0 -14
- package/dist/cjs/helpers/fetchResponse.js +0 -2
- package/dist/cjs/helpers/fetchResponse.js.map +0 -7
- package/dist/cjs/helpers/fetcher.d.ts +0 -2
- package/dist/cjs/helpers/fetcher.js +0 -2
- package/dist/cjs/helpers/fetcher.js.map +0 -7
- package/dist/cjs/helpers/index.d.ts +0 -2
- package/dist/cjs/helpers/index.js +0 -2
- package/dist/cjs/helpers/index.js.map +0 -7
- package/dist/cjs/helpers/ssr-safe.d.ts +0 -33
- package/dist/cjs/helpers/track.d.ts +0 -19
- package/dist/cjs/helpers/track.js +0 -2
- package/dist/cjs/helpers/track.js.map +0 -7
- package/dist/cjs/helpers/utils.d.ts +0 -3
- package/dist/cjs/helpers/utils.js +0 -2
- package/dist/cjs/helpers/utils.js.map +0 -7
- package/dist/cjs/index.css +0 -388
- package/dist/cjs/index.css.map +0 -7
- package/dist/cjs/index.d.ts +0 -2
- package/dist/cjs/index.js +0 -2
- package/dist/cjs/index.js.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 -13
- 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 -10
- 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/stories/chat.stories.d.ts +0 -7
- package/dist/cjs/stories/chat.stories.js +0 -2
- package/dist/cjs/stories/chat.stories.js.map +0 -7
- package/dist/cjs/tsconfig.tsbuildinfo +0 -1
- package/dist/esm/components/chat/action.d.ts +0 -25
- package/dist/esm/components/chat/action.js +0 -2
- package/dist/esm/components/chat/action.js.map +0 -7
- package/dist/esm/components/chat/button.d.ts +0 -3
- package/dist/esm/components/chat/button.js +0 -2
- package/dist/esm/components/chat/button.js.map +0 -7
- 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/chat/chatContext.d.ts +0 -101
- package/dist/esm/components/chat/chatContext.js +0 -2
- package/dist/esm/components/chat/chatContext.js.map +0 -7
- package/dist/esm/components/chat/index.d.ts +0 -71
- package/dist/esm/components/chat/index.js +0 -2
- package/dist/esm/components/chat/index.js.map +0 -7
- package/dist/esm/components/chat/markdown.d.ts +0 -5
- package/dist/esm/components/chat/markdown.js +0 -2
- package/dist/esm/components/chat/markdown.js.map +0 -7
- package/dist/esm/components/chat/messages.d.ts +0 -3
- package/dist/esm/components/chat/messages.js +0 -2
- package/dist/esm/components/chat/messages.js.map +0 -7
- package/dist/esm/components/chat/props.d.ts +0 -43
- package/dist/esm/components/chat/props.js +0 -1
- package/dist/esm/components/chat/props.js.map +0 -7
- package/dist/esm/components/chat/response.d.ts +0 -4
- package/dist/esm/components/chat/response.js +0 -2
- package/dist/esm/components/chat/response.js.map +0 -7
- package/dist/esm/components/chat/suggestions.d.ts +0 -3
- package/dist/esm/components/chat/suggestions.js +0 -2
- package/dist/esm/components/chat/suggestions.js.map +0 -7
- package/dist/esm/components/chat/utils.d.ts +0 -3
- package/dist/esm/components/chat/utils.js +0 -2
- package/dist/esm/components/chat/utils.js.map +0 -7
- package/dist/esm/components/credits/context/const.d.ts +0 -81
- package/dist/esm/components/credits/context/const.js +0 -2
- package/dist/esm/components/credits/context/const.js.map +0 -7
- package/dist/esm/components/credits/context/hooks/useActivities.d.ts +0 -12
- package/dist/esm/components/credits/context/hooks/useActivities.js +0 -2
- package/dist/esm/components/credits/context/hooks/useActivities.js.map +0 -7
- package/dist/esm/components/credits/context/hooks/useAddressValidate.d.ts +0 -34
- package/dist/esm/components/credits/context/hooks/useAddressValidate.js +0 -2
- package/dist/esm/components/credits/context/hooks/useAddressValidate.js.map +0 -7
- package/dist/esm/components/credits/context/hooks/useAlpcFetch.d.ts +0 -23
- package/dist/esm/components/credits/context/hooks/useAlpcFetch.js +0 -2
- package/dist/esm/components/credits/context/hooks/useAlpcFetch.js.map +0 -7
- package/dist/esm/components/credits/context/hooks/useClickOutside.d.ts +0 -3
- package/dist/esm/components/credits/context/hooks/useClickOutside.js +0 -2
- package/dist/esm/components/credits/context/hooks/useClickOutside.js.map +0 -7
- package/dist/esm/components/credits/context/hooks/useCopy.d.ts +0 -5
- package/dist/esm/components/credits/context/hooks/useCopy.js +0 -2
- package/dist/esm/components/credits/context/hooks/useCopy.js.map +0 -7
- package/dist/esm/components/credits/context/hooks/useCountries.d.ts +0 -8
- package/dist/esm/components/credits/context/hooks/useCountries.js +0 -2
- package/dist/esm/components/credits/context/hooks/useCountries.js.map +0 -7
- package/dist/esm/components/credits/context/hooks/useFirstPurchaseFinished.d.ts +0 -1
- package/dist/esm/components/credits/context/hooks/useFirstPurchaseFinished.js +0 -2
- package/dist/esm/components/credits/context/hooks/useFirstPurchaseFinished.js.map +0 -7
- package/dist/esm/components/credits/context/hooks/useMyRewards.d.ts +0 -14
- package/dist/esm/components/credits/context/hooks/useMyRewards.js +0 -2
- package/dist/esm/components/credits/context/hooks/useMyRewards.js.map +0 -7
- package/dist/esm/components/credits/context/hooks/useReceiptUploaded.d.ts +0 -2
- package/dist/esm/components/credits/context/hooks/useReceiptUploaded.js +0 -2
- package/dist/esm/components/credits/context/hooks/useReceiptUploaded.js.map +0 -7
- package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.d.ts +0 -14
- package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.js +0 -2
- package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.js.map +0 -7
- package/dist/esm/components/credits/context/hooks/useRedeemCoupon.d.ts +0 -17
- package/dist/esm/components/credits/context/hooks/useRedeemCoupon.js +0 -2
- package/dist/esm/components/credits/context/hooks/useRedeemCoupon.js.map +0 -7
- package/dist/esm/components/credits/context/hooks/useRedeemProduct.d.ts +0 -16
- package/dist/esm/components/credits/context/hooks/useRedeemProduct.js +0 -2
- package/dist/esm/components/credits/context/hooks/useRedeemProduct.js.map +0 -7
- package/dist/esm/components/credits/context/hooks/useRedeemableList.d.ts +0 -7
- package/dist/esm/components/credits/context/hooks/useRedeemableList.js +0 -2
- package/dist/esm/components/credits/context/hooks/useRedeemableList.js.map +0 -7
- package/dist/esm/components/credits/context/hooks/useSendEmailValidation.d.ts +0 -1
- package/dist/esm/components/credits/context/hooks/useSendEmailValidation.js +0 -2
- package/dist/esm/components/credits/context/hooks/useSendEmailValidation.js.map +0 -7
- package/dist/esm/components/credits/context/hooks/useSubscribed.d.ts +0 -1
- package/dist/esm/components/credits/context/hooks/useSubscribed.js +0 -2
- package/dist/esm/components/credits/context/hooks/useSubscribed.js.map +0 -7
- package/dist/esm/components/credits/context/hooks/useSubscriptions.d.ts +0 -5
- package/dist/esm/components/credits/context/hooks/useSubscriptions.js +0 -2
- package/dist/esm/components/credits/context/hooks/useSubscriptions.js.map +0 -7
- package/dist/esm/components/credits/context/hooks/useUploadReceipt.d.ts +0 -14
- package/dist/esm/components/credits/context/hooks/useUploadReceipt.js +0 -2
- package/dist/esm/components/credits/context/hooks/useUploadReceipt.js.map +0 -7
- package/dist/esm/components/credits/context/provider.d.ts +0 -49
- package/dist/esm/components/credits/context/provider.js +0 -2
- package/dist/esm/components/credits/context/provider.js.map +0 -7
- package/dist/esm/components/credits/context/response.d.ts +0 -63
- package/dist/esm/components/credits/context/response.js +0 -1
- package/dist/esm/components/credits/context/response.js.map +0 -7
- package/dist/esm/components/credits/context/utils.d.ts +0 -25
- package/dist/esm/components/credits/context/utils.js +0 -2
- package/dist/esm/components/credits/context/utils.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-cash/type.js +0 -1
- package/dist/esm/components/credits/credits-cash/type.js.map +0 -7
- 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/address-form/type.js +0 -1
- package/dist/esm/components/credits/credits-redeem-list/address-form/type.js.map +0 -7
- 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-redeem-list/type.js +0 -1
- package/dist/esm/components/credits/credits-redeem-list/type.js.map +0 -7
- 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/creditsBanner/index.d.ts +0 -23
- package/dist/esm/components/credits/creditsBanner/index.js +0 -2
- package/dist/esm/components/credits/creditsBanner/index.js.map +0 -7
- package/dist/esm/components/credits/creditsBenefits/benefitItem.d.ts +0 -19
- package/dist/esm/components/credits/creditsBenefits/benefitItem.js +0 -2
- package/dist/esm/components/credits/creditsBenefits/benefitItem.js.map +0 -7
- package/dist/esm/components/credits/creditsBenefits/iconInfo.d.ts +0 -2
- package/dist/esm/components/credits/creditsBenefits/iconInfo.js +0 -2
- package/dist/esm/components/credits/creditsBenefits/iconInfo.js.map +0 -7
- package/dist/esm/components/credits/creditsBenefits/index.d.ts +0 -12
- package/dist/esm/components/credits/creditsBenefits/index.js +0 -4
- package/dist/esm/components/credits/creditsBenefits/index.js.map +0 -7
- package/dist/esm/components/credits/creditsCash/RedeemableItem.d.ts +0 -15
- package/dist/esm/components/credits/creditsCash/RedeemableItem.js +0 -2
- package/dist/esm/components/credits/creditsCash/RedeemableItem.js.map +0 -7
- package/dist/esm/components/credits/creditsCash/index.d.ts +0 -13
- package/dist/esm/components/credits/creditsCash/index.js +0 -2
- package/dist/esm/components/credits/creditsCash/index.js.map +0 -7
- package/dist/esm/components/credits/creditsCash/type.d.ts +0 -47
- package/dist/esm/components/credits/creditsCash/type.js +0 -1
- package/dist/esm/components/credits/creditsCash/type.js.map +0 -7
- package/dist/esm/components/credits/creditsFaq/faqItem/FaqItem.d.ts +0 -13
- package/dist/esm/components/credits/creditsFaq/faqItem/FaqItem.js +0 -2
- package/dist/esm/components/credits/creditsFaq/faqItem/FaqItem.js.map +0 -7
- package/dist/esm/components/credits/creditsFaq/index.d.ts +0 -16
- package/dist/esm/components/credits/creditsFaq/index.js +0 -2
- package/dist/esm/components/credits/creditsFaq/index.js.map +0 -7
- package/dist/esm/components/credits/creditsInfoCard/index.d.ts +0 -20
- package/dist/esm/components/credits/creditsInfoCard/index.js +0 -2
- package/dist/esm/components/credits/creditsInfoCard/index.js.map +0 -7
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/CountrySelect.d.ts +0 -14
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/CountrySelect.js +0 -2
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/CountrySelect.js.map +0 -7
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/FormItem.d.ts +0 -6
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/FormItem.js +0 -2
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/FormItem.js.map +0 -7
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/Input.d.ts +0 -13
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/Input.js +0 -2
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/Input.js.map +0 -7
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/StateSelect.d.ts +0 -15
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/StateSelect.js +0 -2
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/StateSelect.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/index.d.ts +0 -2
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/index.js +0 -2
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/index.js.map +0 -7
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/state-select.d.ts +0 -15
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/type.d.ts +0 -26
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/type.js +0 -1
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/type.js.map +0 -7
- package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.d.ts +0 -9
- package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.js +0 -2
- package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.js.map +0 -7
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.d.ts +0 -20
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.js +0 -2
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.js.map +0 -7
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Error.d.ts +0 -8
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Error.js +0 -2
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Error.js.map +0 -7
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.d.ts +0 -11
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.js +0 -2
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.js.map +0 -7
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.d.ts +0 -8
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js +0 -2
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js.map +0 -7
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.d.ts +0 -13
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.js +0 -2
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.js.map +0 -7
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.d.ts +0 -11
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.js +0 -2
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.js.map +0 -7
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal.d.ts +0 -62
- package/dist/esm/components/credits/creditsRedeemList/RedeemableItem.d.ts +0 -9
- package/dist/esm/components/credits/creditsRedeemList/RedeemableItem.js +0 -2
- package/dist/esm/components/credits/creditsRedeemList/RedeemableItem.js.map +0 -7
- package/dist/esm/components/credits/creditsRedeemList/index.d.ts +0 -13
- package/dist/esm/components/credits/creditsRedeemList/index.js +0 -2
- package/dist/esm/components/credits/creditsRedeemList/index.js.map +0 -7
- package/dist/esm/components/credits/creditsRedeemList/type.d.ts +0 -77
- package/dist/esm/components/credits/creditsRedeemList/type.js +0 -1
- package/dist/esm/components/credits/creditsRedeemList/type.js.map +0 -7
- package/dist/esm/components/credits/creditsWaysToGetCredits/index.d.ts +0 -2
- package/dist/esm/components/credits/creditsWaysToGetCredits/index.js +0 -2
- package/dist/esm/components/credits/creditsWaysToGetCredits/index.js.map +0 -7
- package/dist/esm/components/credits/creditsWaysToGetCredits/type.d.ts +0 -60
- package/dist/esm/components/credits/creditsWaysToGetCredits/type.js +0 -2
- package/dist/esm/components/credits/creditsWaysToGetCredits/type.js.map +0 -7
- package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.d.ts +0 -96
- package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.js +0 -2
- package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.js.map +0 -7
- package/dist/esm/components/credits/index.d.ts +0 -10
- package/dist/esm/components/credits/index.js +0 -2
- package/dist/esm/components/credits/index.js.map +0 -7
- package/dist/esm/components/credits/modal/MyRewardsModal.d.ts +0 -32
- package/dist/esm/components/credits/modal/MyRewardsModal.js +0 -2
- package/dist/esm/components/credits/modal/MyRewardsModal.js.map +0 -7
- package/dist/esm/components/credits/modal/activitiesModal.d.ts +0 -32
- package/dist/esm/components/credits/modal/activitiesModal.js +0 -2
- package/dist/esm/components/credits/modal/activitiesModal.js.map +0 -7
- package/dist/esm/components/credits/modal/creditsUploadReceiptModal.d.ts +0 -24
- package/dist/esm/components/credits/modal/creditsUploadReceiptModal.js +0 -2
- package/dist/esm/components/credits/modal/creditsUploadReceiptModal.js.map +0 -7
- package/dist/esm/components/credits/modal/loadingDots.d.ts +0 -6
- package/dist/esm/components/credits/modal/loadingDots.js +0 -2
- package/dist/esm/components/credits/modal/loadingDots.js.map +0 -7
- package/dist/esm/components/credits/modal/modalContainer.d.ts +0 -15
- package/dist/esm/components/credits/modal/modalContainer.js +0 -2
- package/dist/esm/components/credits/modal/modalContainer.js.map +0 -7
- package/dist/esm/components/credits/modal/rulesModal.d.ts +0 -7
- package/dist/esm/components/credits/modal/rulesModal.js +0 -2
- package/dist/esm/components/credits/modal/rulesModal.js.map +0 -7
- package/dist/esm/components/credits/modal/tip.d.ts +0 -5
- package/dist/esm/components/credits/modal/tip.js +0 -2
- package/dist/esm/components/credits/modal/tip.js.map +0 -7
- package/dist/esm/components/credits/type.d.ts +0 -55
- package/dist/esm/components/credits/type.js +0 -1
- package/dist/esm/components/credits/type.js.map +0 -7
- package/dist/esm/components/index.d.ts +0 -3
- package/dist/esm/components/index.js +0 -2
- package/dist/esm/components/index.js.map +0 -7
- package/dist/esm/debug-env.d.ts +0 -7
- package/dist/esm/debug-env.js +0 -2
- package/dist/esm/debug-env.js.map +0 -7
- package/dist/esm/helpers/fetchResponse.d.ts +0 -14
- package/dist/esm/helpers/fetchResponse.js +0 -2
- package/dist/esm/helpers/fetchResponse.js.map +0 -7
- package/dist/esm/helpers/fetcher.d.ts +0 -2
- package/dist/esm/helpers/fetcher.js +0 -2
- package/dist/esm/helpers/fetcher.js.map +0 -7
- package/dist/esm/helpers/index.d.ts +0 -2
- package/dist/esm/helpers/index.js +0 -2
- package/dist/esm/helpers/index.js.map +0 -7
- package/dist/esm/helpers/ssr-safe.d.ts +0 -33
- package/dist/esm/helpers/track.d.ts +0 -19
- package/dist/esm/helpers/track.js +0 -2
- package/dist/esm/helpers/track.js.map +0 -7
- package/dist/esm/helpers/utils.d.ts +0 -3
- package/dist/esm/helpers/utils.js +0 -2
- package/dist/esm/helpers/utils.js.map +0 -7
- package/dist/esm/index.css +0 -388
- package/dist/esm/index.css.map +0 -7
- package/dist/esm/index.d.ts +0 -2
- package/dist/esm/index.js +0 -2
- package/dist/esm/index.js.map +0 -7
- package/dist/esm/package.json +0 -3
- 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 -13
- 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 -10
- 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/stories/chat.stories.d.ts +0 -7
- package/dist/esm/stories/chat.stories.js +0 -2
- package/dist/esm/stories/chat.stories.js.map +0 -7
- package/dist/esm/tsconfig.tsbuildinfo +0 -1
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { ModalContainerProps } from '../modal/modalContainer';
|
|
2
|
-
import type { RedeemableItem as RedeemableItemType } from '../type';
|
|
3
|
-
import { CreditsRedeemListCopy } from './type';
|
|
4
|
-
declare function RedeemCouponModal({ item, copy, onError, ...props }: ModalContainerProps & {
|
|
5
|
-
item: RedeemableItemType;
|
|
6
|
-
copy: CreditsRedeemListCopy;
|
|
7
|
-
onError: (code: number) => void;
|
|
8
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export default RedeemCouponModal;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var B=Object.create;var f=Object.defineProperty;var z=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames;var O=Object.getPrototypeOf,U=Object.prototype.hasOwnProperty;var A=(o,t)=>{for(var i in t)f(o,i,{get:t[i],enumerable:!0})},E=(o,t,i,m)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of P(t))!U.call(o,a)&&a!==i&&f(o,a,{get:()=>t[a],enumerable:!(m=z(t,a))||m.enumerable});return o};var w=(o,t,i)=>(i=o!=null?B(O(o)):{},E(t||!o||!o.__esModule?f(i,"default",{value:o,enumerable:!0}):i,o)),D=o=>E(f({},"__esModule",{value:!0}),o);var j={};A(j,{default:()=>$});module.exports=D(j);var e=require("react/jsx-runtime"),d=require("@anker-in/headless-ui"),g=w(require("classnames")),r=require("react"),F=w(require("../context/hooks/useCopy")),R=require("../context/provider"),T=require("../context/hooks/useRedeemCoupon"),c=require("../context/const"),k=require("../modal/modalContainer"),I=require("../context/utils"),L=require("@anker-in/shopify");function K({item:o,copy:t,onError:i,...m}){const{locale:a}=(0,L.useShopifyContext)(),[n,S]=(0,r.useState)(),[C,x]=(0,r.useState)(),[b,p]=(0,r.useState)(!1),{copy:y,copied:v}=(0,F.default)(),{profile:u,fetchCreditInfo:N}=(0,R.useCreditsContext)(),{isMutating:h,trigger:M}=(0,T.useRedeemCoupon)({onSuccess(l){if(!l){x(t.redeemModal.commonError);return}if(l?.data?.success)S(l.data.coupon_code),N(u?.user_id);else{let s;l.code===c.AlpcErrorCode.CodeLpcShopifyCouponRuleRedeemLimit?(s=t.redeemModal.redeemLimitError,p(!0)):l.code===c.AlpcErrorCode.CodeLpcRuleInventoryNotEnough?(s=t.redeemModal.inventoryNotEnough,p(!0)):l.code===c.AlpcErrorCode.CodeLpcNotEnoughCredits?(s=t.redeemModal.creditsNotEnough,p(!0),N(u?.user_id)):l.code===c.AlpcErrorCode.CodeCrossSiteError&&(s=t.redeemModal.crossSiteError,p(!0)),x(s||t.redeemModal.commonError||""),i&&i(l.code)}},onError(l){x(l.message||t.redeemModal.commonError)}}),_=(0,r.useCallback)(async()=>{x(""),M({user_id:u?.user_id,rule_id:Number(o.alpc?.id)})},[o,u,M]);return(0,r.useEffect)(()=>{m.isOpen||(p(!1),x(""))},[m.isOpen]),(0,e.jsxs)(k.CreditsModalContainer,{...m,className:"w-[540px] md:h-auto",scrollClassName:"mb-[40px] min-l:px-0 md:mb-[24px] px-0",titleClassName:"h-[56px] bg-[#F5F5F7]",children:[(0,e.jsxs)("div",{className:(0,g.default)("max-h-[500px] overflow-y-auto bg-[#F5F5F7] px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]"),children:[(0,e.jsxs)("div",{className:"relative mx-auto h-[164px] w-[324px]",children:[t?.imageMapping?.coupon?.url&&(0,e.jsx)(d.Picture,{source:t?.imageMapping?.coupon?.url,className:"h-full [&_img]:h-full"}),(0,e.jsx)("div",{className:"absolute bottom-[8px] left-[16px] font-extrabold text-white",children:o.config.value?(0,e.jsxs)("div",{className:"flex items-end gap-[4px]",children:[(0,e.jsx)(d.Text,{className:"text-[64px] font-bold leading-none",html:o.config.value.toString()}),(0,e.jsx)(d.Text,{className:"text-[24px] font-bold leading-[2]",html:t?.off})]}):(0,e.jsx)(d.Text,{size:3,html:o.alpc?.title})})]}),n?(0,e.jsxs)("div",{className:"mt-[30px] flex items-center justify-center md:mt-[18px]",children:[(0,e.jsx)("div",{className:"mr-[10px] text-[24px] font-bold leading-[1.4] md:leading-[1.2]",children:n}),(0,e.jsx)("div",{className:(0,g.default)("cursor-pointer text-[16px] font-bold leading-[1.2] underline md:text-[14px]",v?"pointer-events-none":"pointer-events-auto"),onClick:()=>{y(n)},role:"button",tabIndex:0,onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&l.preventDefault()},children:v?t?.copied:t?.copy})]}):(0,e.jsxs)(d.Text,{as:"p",className:(0,g.default)("mt-[30px] text-center text-[24px] font-bold leading-[1.2] md:mt-[18px] md:text-[20px] md:leading-[1.2]"),children:[(0,I.numberFormat)(o.alpc?.consumeCredits)," ",t?.pointUnit]}),!n&&o.config?.rules?.length>0&&(0,e.jsxs)("div",{className:"mt-[18px] w-full text-[16px] font-bold leading-[1.4] text-[#6D6D6F] md:mt-[12px] md:text-[14px]",children:[(0,e.jsxs)("div",{className:"mb-[4px]",children:[t?.ruleLabel,":"]}),(0,e.jsx)("ul",{className:"ml-4 grid grid-flow-row gap-[4px]",children:o.config?.rules?.map((l,s)=>(0,e.jsx)("li",{className:"list-disc",children:(0,e.jsx)(d.Text,{html:l})},s))})]})]}),(0,e.jsxs)("div",{className:"bg-white px-[48px] pt-[24px] text-center md:px-[16px]",children:[n&&!h?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"flex flex-col",children:[(0,e.jsx)(d.Text,{className:"mb-[4px] text-[24px] font-bold leading-[1.2] md:text-[20px]",html:t.redeemModal.coupon.successTitle}),(0,e.jsx)(d.Text,{className:"text-[16px] font-bold leading-[1.4] text-[#6D6D6F] md:text-[14px]",html:t.redeemModal.coupon.successDesc})]}),(0,e.jsx)(d.Button,{variant:"primary",size:"lg",className:"mt-[16px] w-full",onClick:()=>{window.location.href=t.redeemModal.coupon.successButtonUrl||`/${a}`,m.onClose&&m.onClose()},disabled:b,children:t.redeemModal.coupon.successButton})]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(d.Text,{className:"block text-[24px] font-bold leading-[1.2] md:text-[20px] md:leading-[1.2]",html:t.redeemModal.confirmTitle}),(0,e.jsx)(d.Button,{loading:h,variant:"primary",size:"lg",className:"mt-[16px] w-full",onClick:_,disabled:b,children:t.redeemModal.confirmButton})]}),C&&(0,e.jsx)("div",{className:"mx-auto max-w-full py-[12px] text-center",children:(0,e.jsx)(d.Text,{className:"text-[14px] font-semibold text-[#1F2021]",html:C})})]})]})}var $=K;
|
|
2
|
-
//# sourceMappingURL=RedeemCouponModal.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../src/components/credits/creditsRedeemList/RedeemCouponModal.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Button, Picture, Text } from '@anker-in/headless-ui'\nimport classNames from 'classnames'\nimport { useCallback, useEffect, useState } from 'react'\nimport type { ModalContainerProps } from '../modal/modalContainer'\nimport useCopy from '../context/hooks/useCopy'\nimport { useCreditsContext } from '../context/provider'\nimport { useRedeemCoupon } from '../context/hooks/useRedeemCoupon'\nimport { AlpcErrorCode } from '../context/const'\nimport { CreditsModalContainer } from '../modal/modalContainer'\nimport { numberFormat } from '../context/utils'\nimport type { RedeemableItem as RedeemableItemType } from '../type'\nimport { useShopifyContext } from '@anker-in/shopify'\nimport { CreditsRedeemListCopy } from './type'\n\nfunction RedeemCouponModal({\n item,\n copy,\n onError,\n ...props\n}: ModalContainerProps & {\n item: RedeemableItemType\n copy: CreditsRedeemListCopy\n onError: (code: number) => void\n}) {\n const { locale } = useShopifyContext()\n const [couponCode, setCouponCode] = useState<string>()\n const [errorInfo, setErrorInfo] = useState<string>()\n\n const [disabled, setDisabled] = useState(false)\n const { copy: copyText, copied: copiedStatus } = useCopy()\n\n const { profile, fetchCreditInfo } = useCreditsContext()\n\n const { isMutating: loading, trigger } = useRedeemCoupon({\n onSuccess(responseData) {\n if (!responseData) {\n setErrorInfo(copy.redeemModal.commonError)\n return\n }\n\n if (responseData?.data?.success) {\n setCouponCode(responseData.data.coupon_code)\n fetchCreditInfo(profile?.user_id)\n } else {\n let errorMsg\n if (responseData.code === AlpcErrorCode.CodeLpcShopifyCouponRuleRedeemLimit) {\n errorMsg = copy.redeemModal.redeemLimitError\n setDisabled(true)\n } else if (responseData.code === AlpcErrorCode.CodeLpcRuleInventoryNotEnough) {\n errorMsg = copy.redeemModal.inventoryNotEnough\n setDisabled(true)\n } else if (responseData.code === AlpcErrorCode.CodeLpcNotEnoughCredits) {\n errorMsg = copy.redeemModal.creditsNotEnough\n setDisabled(true)\n fetchCreditInfo(profile?.user_id)\n } else if (responseData.code === AlpcErrorCode.CodeCrossSiteError) {\n errorMsg = copy.redeemModal.crossSiteError\n setDisabled(true)\n }\n\n setErrorInfo(errorMsg || copy.redeemModal.commonError || '')\n onError && onError(responseData.code)\n }\n },\n onError(error) {\n setErrorInfo(error.message || copy.redeemModal.commonError)\n },\n })\n\n const handleConfirm = useCallback(async () => {\n setErrorInfo('')\n trigger({\n user_id: profile?.user_id,\n rule_id: Number(item.alpc?.id),\n })\n }, [item, profile, trigger])\n\n useEffect(() => {\n if (!props.isOpen) {\n setDisabled(false)\n setErrorInfo('')\n }\n }, [props.isOpen])\n\n return (\n <CreditsModalContainer\n {...props}\n className=\"w-[540px] md:h-auto\"\n scrollClassName=\"mb-[40px] min-l:px-0 md:mb-[24px] px-0\"\n titleClassName=\"h-[56px] bg-[#F5F5F7]\"\n >\n <div\n className={classNames(\n 'max-h-[500px] overflow-y-auto bg-[#F5F5F7] px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]'\n )}\n >\n <div className=\"relative mx-auto h-[164px] w-[324px]\">\n {copy?.imageMapping?.coupon?.url && (\n <Picture source={copy?.imageMapping?.coupon?.url} className=\"h-full [&_img]:h-full\" />\n )}\n <div className=\"absolute bottom-[8px] left-[16px] font-extrabold text-white\">\n {item.config.value ? (\n <div className=\"flex items-end gap-[4px]\">\n <Text className=\"text-[64px] font-bold leading-none\" html={item.config.value.toString()} />\n <Text className=\"text-[24px] font-bold leading-[2]\" html={copy?.off} />\n </div>\n ) : (\n <Text size={3} html={item.alpc?.title} />\n )}\n </div>\n </div>\n {couponCode ? (\n <div className=\"mt-[30px] flex items-center justify-center md:mt-[18px]\">\n <div className=\"mr-[10px] text-[24px] font-bold leading-[1.4] md:leading-[1.2]\">{couponCode}</div>\n <div\n className={classNames(\n 'cursor-pointer text-[16px] font-bold leading-[1.2] underline md:text-[14px]',\n copiedStatus ? 'pointer-events-none' : 'pointer-events-auto'\n )}\n onClick={() => {\n copyText(couponCode)\n }}\n role=\"button\"\n tabIndex={0}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n }\n }}\n >\n {copiedStatus ? copy?.copied : copy?.copy}\n </div>\n </div>\n ) : (\n <Text\n as=\"p\"\n className={classNames(\n 'mt-[30px] text-center text-[24px] font-bold leading-[1.2] md:mt-[18px] md:text-[20px] md:leading-[1.2]'\n )}\n >\n {numberFormat(item.alpc?.consumeCredits)} {copy?.pointUnit}\n </Text>\n )}\n {!couponCode && item.config?.rules?.length > 0 && (\n <div className=\"mt-[18px] w-full text-[16px] font-bold leading-[1.4] text-[#6D6D6F] md:mt-[12px] md:text-[14px]\">\n <div className=\"mb-[4px]\">{copy?.ruleLabel}:</div>\n <ul className=\"ml-4 grid grid-flow-row gap-[4px]\">\n {item.config?.rules?.map((text, index) => (\n <li className=\"list-disc\" key={index}>\n <Text html={text} />\n </li>\n ))}\n </ul>\n </div>\n )}\n </div>\n <div className=\"bg-white px-[48px] pt-[24px] text-center md:px-[16px]\">\n {couponCode && !loading ? (\n <>\n <div className=\"flex flex-col\">\n <Text\n className=\"mb-[4px] text-[24px] font-bold leading-[1.2] md:text-[20px]\"\n html={copy.redeemModal.coupon.successTitle}\n ></Text>\n <Text\n className=\"text-[16px] font-bold leading-[1.4] text-[#6D6D6F] md:text-[14px]\"\n html={copy.redeemModal.coupon.successDesc}\n ></Text>\n </div>\n <Button\n variant=\"primary\"\n size=\"lg\"\n className=\"mt-[16px] w-full\"\n onClick={() => {\n window.location.href = copy.redeemModal.coupon.successButtonUrl || `/${locale}`\n if (props.onClose) {\n props.onClose()\n }\n }}\n disabled={disabled}\n >\n {copy.redeemModal.coupon.successButton}\n </Button>\n </>\n ) : (\n <>\n <Text\n className=\"block text-[24px] font-bold leading-[1.2] md:text-[20px] md:leading-[1.2]\"\n html={copy.redeemModal.confirmTitle}\n ></Text>\n <Button\n loading={loading}\n variant=\"primary\"\n size=\"lg\"\n className=\"mt-[16px] w-full\"\n onClick={handleConfirm}\n disabled={disabled}\n >\n {copy.redeemModal.confirmButton}\n </Button>\n </>\n )}\n {errorInfo && (\n <div className=\"mx-auto max-w-full py-[12px] text-center\">\n <Text className=\"text-[14px] font-semibold text-[#1F2021]\" html={errorInfo} />\n </div>\n )}\n </div>\n </CreditsModalContainer>\n )\n}\n\nexport default RedeemCouponModal\n"],
|
|
5
|
-
"mappings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", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_classnames", "import_react", "import_useCopy", "import_provider", "import_useRedeemCoupon", "import_const", "import_modalContainer", "import_utils", "import_shopify", "RedeemCouponModal", "item", "copy", "onError", "props", "locale", "couponCode", "setCouponCode", "errorInfo", "setErrorInfo", "disabled", "setDisabled", "copyText", "copiedStatus", "useCopy", "profile", "fetchCreditInfo", "loading", "trigger", "responseData", "errorMsg", "error", "handleConfirm", "classNames", "e", "text", "index"]
|
|
7
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { RedeemableItem as RedeemableItemType } from '../../type';
|
|
2
|
-
import { CreditsRedeemListCopy } from '../type';
|
|
3
|
-
type AddressProps = {
|
|
4
|
-
copy: CreditsRedeemListCopy;
|
|
5
|
-
shippingAddress: string;
|
|
6
|
-
setAddress: (address: Record<string, any>) => void;
|
|
7
|
-
validateAddress: (address: Record<string, any>) => boolean;
|
|
8
|
-
validateErrors: {
|
|
9
|
-
key: string;
|
|
10
|
-
message: string;
|
|
11
|
-
}[];
|
|
12
|
-
item: RedeemableItemType;
|
|
13
|
-
loading: boolean;
|
|
14
|
-
address: Record<string, any> | undefined;
|
|
15
|
-
disabled: boolean;
|
|
16
|
-
handlePayment: () => void;
|
|
17
|
-
shippingProduct: string;
|
|
18
|
-
};
|
|
19
|
-
export declare const Address: ({ copy, shippingAddress, setAddress, validateAddress, validateErrors, shippingProduct, loading, address, disabled, handlePayment, item, }: AddressProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
-
export {};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var A=Object.create;var m=Object.defineProperty;var F=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var L=Object.getPrototypeOf,T=Object.prototype.hasOwnProperty;var I=(e,o)=>{for(var s in o)m(e,s,{get:o[s],enumerable:!0})},n=(e,o,s,i)=>{if(o&&typeof o=="object"||typeof o=="function")for(let d of w(o))!T.call(e,d)&&d!==s&&m(e,d,{get:()=>o[d],enumerable:!(i=F(o,d))||i.enumerable});return e};var p=(e,o,s)=>(s=e!=null?A(L(e)):{},n(o||!e||!e.__esModule?m(s,"default",{value:e,enumerable:!0}):s,e)),P=e=>n(m({},"__esModule",{value:!0}),e);var B={};I(B,{Address:()=>k});module.exports=P(B);var t=require("react/jsx-runtime"),r=require("@anker-in/headless-ui"),l=p(require("classnames")),x=require("../AddressForm"),c=require("@anker-in/shopify"),f=require("./ProductInfo"),u=p(require("../../context/hooks/useCountries"));const k=({copy:e,shippingAddress:o,setAddress:s,validateAddress:i,validateErrors:d,shippingProduct:a,loading:y,address:v,disabled:b,handlePayment:g,item:h})=>{const{storeDomain:C}=(0,c.useShopifyContext)(),{countries:N=[],isLoading:R}=(0,u.default)({shopifyStoreDomain:C});return(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("div",{className:(0,l.default)("max-h-[500px] overflow-y-auto px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]"),children:(0,t.jsxs)("div",{children:[o&&(0,t.jsx)(r.Text,{className:"mb-5 text-[16px] font-bold",html:o}),(0,t.jsx)(x.AddressForm,{onChange:s,validate:i,errors:d,form:e.redeemModal.product.addressForm,countries:N,countriesLoading:R})]})}),(0,t.jsxs)("div",{className:"sticky bottom-0 flex flex-col items-center justify-center bg-white px-[48px] py-[24px] l:px-[16px]",children:[(0,t.jsxs)("div",{className:"flex w-full items-center rounded-[16px] bg-[#F5F5F7] p-[16px]",children:[a&&(0,t.jsx)(r.Text,{className:"mb-5 text-[16px] font-bold",html:a}),(0,t.jsx)(f.ProductInfo,{item:h,copy:e})]}),(0,t.jsx)(r.Button,{loading:y||!v,variant:"primary",className:"mx-auto mt-[16px] w-[444px] md:mt-[12px] md:w-full",onClick:g,disabled:b,children:e.redeemModal.product.paymentButton})]})]})};
|
|
2
|
-
//# sourceMappingURL=Address.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../src/components/credits/creditsRedeemList/RedeemProductModal/Address.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Button, Text } from '@anker-in/headless-ui'\nimport classNames from 'classnames'\nimport { AddressForm } from '../AddressForm'\nimport { useShopifyContext } from '@anker-in/shopify'\nimport type { RedeemableItem as RedeemableItemType } from '../../type'\nimport { CreditsRedeemListCopy } from '../type'\nimport { ProductInfo } from './ProductInfo'\nimport useCountries from '../../context/hooks/useCountries'\n\ntype AddressProps = {\n copy: CreditsRedeemListCopy\n shippingAddress: string\n setAddress: (address: Record<string, any>) => void\n validateAddress: (address: Record<string, any>) => boolean\n validateErrors: { key: string; message: string }[]\n item: RedeemableItemType\n loading: boolean\n address: Record<string, any> | undefined\n disabled: boolean\n handlePayment: () => void\n shippingProduct: string\n}\n\nexport const Address = ({\n copy,\n shippingAddress,\n setAddress,\n validateAddress,\n validateErrors,\n shippingProduct,\n loading,\n address,\n disabled,\n handlePayment,\n item,\n}: AddressProps) => {\n const { storeDomain } = useShopifyContext()\n const { countries = [], isLoading: countriesLoading } = useCountries({ shopifyStoreDomain: storeDomain })\n\n return (\n <div className=\"relative\">\n <div className={classNames('max-h-[500px] overflow-y-auto px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]')}>\n <div>\n {shippingAddress && <Text className=\"mb-5 text-[16px] font-bold\" html={shippingAddress}></Text>}\n <AddressForm\n onChange={setAddress}\n validate={validateAddress}\n errors={validateErrors}\n form={copy.redeemModal.product.addressForm}\n countries={countries}\n countriesLoading={countriesLoading}\n ></AddressForm>\n </div>\n </div>\n <div className=\"sticky bottom-0 flex flex-col items-center justify-center bg-white px-[48px] py-[24px] l:px-[16px]\">\n <div className=\"flex w-full items-center rounded-[16px] bg-[#F5F5F7] p-[16px]\">\n {shippingProduct && <Text className=\"mb-5 text-[16px] font-bold\" html={shippingProduct}></Text>}\n <ProductInfo item={item} copy={copy} />\n </div>\n <Button\n loading={loading || !address}\n variant=\"primary\"\n className=\"mx-auto mt-[16px] w-[444px] md:mt-[12px] md:w-full\"\n onClick={handlePayment}\n disabled={disabled}\n >\n {copy.redeemModal.product.paymentButton}\n </Button>\n </div>\n </div>\n )\n}\n"],
|
|
5
|
-
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA0CQ,IAAAI,EAAA,6BA1CRC,EAA6B,iCAC7BC,EAAuB,yBACvBC,EAA4B,0BAC5BC,EAAkC,6BAGlCC,EAA4B,yBAC5BC,EAAyB,+CAgBlB,MAAMR,EAAU,CAAC,CACtB,KAAAS,EACA,gBAAAC,EACA,WAAAC,EACA,gBAAAC,EACA,eAAAC,EACA,gBAAAC,EACA,QAAAC,EACA,QAAAC,EACA,SAAAC,EACA,cAAAC,EACA,KAAAC,CACF,IAAoB,CAClB,KAAM,CAAE,YAAAC,CAAY,KAAI,qBAAkB,EACpC,CAAE,UAAAC,EAAY,CAAC,EAAG,UAAWC,CAAiB,KAAI,EAAAC,SAAa,CAAE,mBAAoBH,CAAY,CAAC,EAExG,SACE,QAAC,OAAI,UAAU,WACb,oBAAC,OAAI,aAAW,EAAAI,SAAW,iFAAiF,EAC1G,oBAAC,OACE,UAAAd,MAAmB,OAAC,QAAK,UAAU,6BAA6B,KAAMA,EAAiB,KACxF,OAAC,eACC,SAAUC,EACV,SAAUC,EACV,OAAQC,EACR,KAAMJ,EAAK,YAAY,QAAQ,YAC/B,UAAWY,EACX,iBAAkBC,EACnB,GACH,EACF,KACA,QAAC,OAAI,UAAU,qGACb,qBAAC,OAAI,UAAU,gEACZ,UAAAR,MAAmB,OAAC,QAAK,UAAU,6BAA6B,KAAMA,EAAiB,KACxF,OAAC,eAAY,KAAMK,EAAM,KAAMV,EAAM,GACvC,KACA,OAAC,UACC,QAASM,GAAW,CAACC,EACrB,QAAQ,UACR,UAAU,qDACV,QAASE,EACT,SAAUD,EAET,SAAAR,EAAK,YAAY,QAAQ,cAC5B,GACF,GACF,CAEJ",
|
|
6
|
-
"names": ["Address_exports", "__export", "Address", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_classnames", "import_AddressForm", "import_shopify", "import_ProductInfo", "import_useCountries", "copy", "shippingAddress", "setAddress", "validateAddress", "validateErrors", "shippingProduct", "loading", "address", "disabled", "handlePayment", "item", "storeDomain", "countries", "countriesLoading", "useCountries", "classNames"]
|
|
7
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var x=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var l=(r,e)=>{for(var a in e)x(r,a,{get:e[a],enumerable:!0})},g=(r,e,a,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of i(e))!c.call(r,t)&&t!==a&&x(r,t,{get:()=>e[t],enumerable:!(o=p(e,t))||o.enumerable});return r};var n=r=>g(x({},"__esModule",{value:!0}),r);var d={};l(d,{Error:()=>u});module.exports=n(d);var s=require("react/jsx-runtime"),m=require("@anker-in/headless-ui");const u=({errorInfo:r})=>(0,s.jsxs)("div",{className:"mx-auto max-w-[404px] text-[16px] text-black/40",children:[(0,s.jsx)(m.Picture,{className:"mx-auto mb-[12px] h-[140px] w-[220px]",source:r.imageUrl}),(0,s.jsx)(m.Text,{as:"div",className:"mt-[16px] text-center",html:r.message})]});
|
|
2
|
-
//# sourceMappingURL=Error.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../src/components/credits/creditsRedeemList/RedeemProductModal/Error.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Picture, Text } from '@anker-in/headless-ui'\n\ntype ErrorProps = {\n errorInfo: { imageUrl: string; message: string }\n}\n\nexport const Error = ({ errorInfo }: ErrorProps) => {\n return (\n <div className=\"mx-auto max-w-[404px] text-[16px] text-black/40\">\n <Picture className=\"mx-auto mb-[12px] h-[140px] w-[220px]\" source={errorInfo.imageUrl} />\n <Text as=\"div\" className=\"mt-[16px] text-center\" html={errorInfo.message} />\n </div>\n )\n}\n"],
|
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,WAAAE,IAAA,eAAAC,EAAAH,GAQI,IAAAI,EAAA,6BARJC,EAA8B,iCAMvB,MAAMH,EAAQ,CAAC,CAAE,UAAAI,CAAU,OAE9B,QAAC,OAAI,UAAU,kDACb,oBAAC,WAAQ,UAAU,wCAAwC,OAAQA,EAAU,SAAU,KACvF,OAAC,QAAK,GAAG,MAAM,UAAU,wBAAwB,KAAMA,EAAU,QAAS,GAC5E",
|
|
6
|
-
"names": ["Error_exports", "__export", "Error", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "errorInfo"]
|
|
7
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { RedeemableItem as RedeemableItemType } from '../../type';
|
|
2
|
-
import { CreditsRedeemListCopy } from '../type';
|
|
3
|
-
type InitProps = {
|
|
4
|
-
copy: CreditsRedeemListCopy;
|
|
5
|
-
item: RedeemableItemType;
|
|
6
|
-
loading: boolean;
|
|
7
|
-
disabled: boolean;
|
|
8
|
-
setStatus: (status: 'address' | 'init' | 'success' | 'error') => void;
|
|
9
|
-
};
|
|
10
|
-
export declare const Init: ({ copy, item, loading, disabled, setStatus }: InitProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
export {};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var g=Object.create;var p=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var N=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty;var w=(l,t)=>{for(var d in t)p(l,d,{get:t[d],enumerable:!0})},f=(l,t,d,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of b(t))!h.call(l,a)&&a!==d&&p(l,a,{get:()=>t[a],enumerable:!(i=v(t,a))||i.enumerable});return l};var y=(l,t,d)=>(d=l!=null?g(N(l)):{},f(t||!l||!l.__esModule?p(d,"default",{value:l,enumerable:!0}):d,l)),C=l=>f(p({},"__esModule",{value:!0}),l);var T={};w(T,{Init:()=>M});module.exports=C(T);var e=require("react/jsx-runtime"),s=require("@anker-in/headless-ui"),r=y(require("classnames")),x=require("react"),u=require("../../context/utils"),n=require("../../context/const");const M=({copy:l,item:t,loading:d,disabled:i,setStatus:a})=>{const c=(0,x.useMemo)(()=>t.config.rules?.length?t.config.rules:[...t.config.desc?.split("<br>")||[],...l.redeemModal.product.rules||[]],[t.config.rules,t.config.desc,l.redeemModal.product.rules]);return console.log("item",t),(0,e.jsxs)("div",{className:"flex flex-col",children:[(0,e.jsx)("div",{className:(0,r.default)("max-h-[500px] overflow-y-auto bg-[#F5F5F7] px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]"),children:(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"relative mx-auto h-[164px] w-fit",children:[(0,e.jsx)(s.Picture,{source:t.config?.type===n.ConsumeType.Product?t.product.images[0]?.url:l?.imageMapping[t.config.type]?.url||t.config.image?.url,className:"h-full w-auto [&_img]:h-full [&_img]:w-auto [&_img]:object-contain"}),(0,e.jsx)("div",{className:"absolute bottom-[8px] left-[16px] font-extrabold text-white",children:t.config.value&&(0,e.jsxs)("div",{className:"flex items-end gap-[4px]",children:[(0,e.jsx)(s.Text,{className:"text-[64px] font-bold leading-none",html:t.config.value.toString()}),(0,e.jsx)(s.Text,{className:"text-[24px] font-bold leading-[2]",html:t.config.type===n.ConsumeType.Coupon?l?.off:l?.giftCardLabel})]})})]}),(0,e.jsxs)("div",{className:"mt-[30px] md:mt-[18px]",children:[t.config.type==="product"&&(0,e.jsx)("div",{className:(0,r.default)("mb-[4px] text-center text-[24px] font-bold leading-[1.2] md:text-[20px] md:leading-[1.2]"),children:t.config.title}),(0,e.jsxs)(s.Text,{as:"p",className:(0,r.default)(" text-center text-[24px] font-bold leading-[1.2] md:text-[20px] md:leading-[1.2]"),children:[(0,u.numberFormat)(t.alpc?.consumeCredits)," ",l?.pointUnit]})]}),(0,e.jsxs)("div",{className:"mt-[16px] w-full text-[14px] font-semibold text-[#777] md:mt-[12px]",children:[(0,e.jsx)("div",{className:"text-[16px] font-bold leading-[1.4]",children:l.redeemModal.product.stepTitle}),(0,e.jsx)("div",{className:"mt-[4px] flex items-center justify-center",children:l.redeemModal.product.steps?.map((o,m)=>(0,e.jsxs)(x.Fragment,{children:[(0,e.jsxs)("div",{className:"flex w-[76px] flex-col items-center text-center md:h-[94px] min-l:w-[130px]",children:[(0,e.jsx)(s.Picture,{source:o.imageUrl,className:"mb-[4px] h-[58px] w-[58px]"}),(0,e.jsx)("div",{className:"min-h-[34px] text-[14px] font-bold text-[#777] md:min-h-[28px] md:text-[12px]",children:o.title})]}),m!==l.redeemModal.product.steps.length-1&&(0,e.jsx)(s.Picture,{source:"https://cdn.shopify.com/s/files/1/0517/6767/3016/files/step-arrow.png?v=1690458150",className:"mb-[20px] h-[10px] w-[20px] md:mb-[30px] md:h-[5px] md:w-[12px]"})]},m))}),(0,e.jsx)("div",{className:"overflow-auto",children:c?.length&&(0,e.jsx)("ul",{className:"ml-[18px] mt-[16px] grid grid-flow-row gap-[4px] text-[16px] font-bold leading-[1.4] text-[#6D6D6F] md:mt-[12px]",children:c.map((o,m)=>(0,e.jsx)("li",{className:"list-disc",children:(0,e.jsx)(s.Text,{as:"div",html:o,className:"font-bold"})},m))})})]})]})}),(0,e.jsxs)("div",{className:"flex-1 bg-white px-[48px] py-[24px] text-center md:px-[16px]",children:[(0,e.jsx)(s.Text,{as:"p",className:"block text-[24px] font-bold leading-[1.2] md:text-[20px] md:leading-[1.2]",html:l.redeemModal.confirmTitle}),(0,e.jsx)(s.Button,{loading:d,disabled:i,variant:"primary",size:"lg",className:"mt-[16px] w-full md:mt-[12px]",onClick:()=>{a("address")},children:l.redeemModal.confirmButton})]})]})};
|
|
2
|
-
//# sourceMappingURL=Init.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../src/components/credits/creditsRedeemList/RedeemProductModal/Init.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Button, Picture, Text } from '@anker-in/headless-ui'\nimport classNames from 'classnames'\nimport { Fragment, useMemo } from 'react'\nimport { numberFormat } from '../../context/utils'\nimport type { RedeemableItem as RedeemableItemType } from '../../type'\nimport { CreditsRedeemListCopy } from '../type'\nimport { ConsumeType } from '../../context/const'\n\ntype InitProps = {\n copy: CreditsRedeemListCopy\n item: RedeemableItemType\n loading: boolean\n disabled: boolean\n setStatus: (status: 'address' | 'init' | 'success' | 'error') => void\n}\n\nexport const Init = ({ copy, item, loading, disabled, setStatus }: InitProps) => {\n const rules = useMemo(() => {\n if (item.config.rules?.length) {\n return item.config.rules\n }\n const descriptions = item.config.desc?.split('<br>') || []\n return [...descriptions, ...(copy.redeemModal.product.rules || [])]\n }, [item.config.rules, item.config.desc, copy.redeemModal.product.rules])\n\n console.log('item', item)\n return (\n <div className=\"flex flex-col\">\n <div\n className={classNames(\n 'max-h-[500px] overflow-y-auto bg-[#F5F5F7] px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]'\n )}\n >\n <>\n <div className=\"relative mx-auto h-[164px] w-fit\">\n <Picture\n source={\n item.config?.type === ConsumeType.Product\n ? item.product.images[0]?.url\n : copy?.imageMapping[item.config.type]?.url || item.config.image?.url\n }\n className=\"h-full w-auto [&_img]:h-full [&_img]:w-auto [&_img]:object-contain\"\n ></Picture>\n {/* \u793C\u54C1\u5361\u5C55\u793A */}\n <div className=\"absolute bottom-[8px] left-[16px] font-extrabold text-white\">\n {item.config.value && (\n <div className=\"flex items-end gap-[4px]\">\n <Text className=\"text-[64px] font-bold leading-none\" html={item.config.value.toString()} />\n <Text\n className=\"text-[24px] font-bold leading-[2]\"\n html={item.config.type === ConsumeType.Coupon ? copy?.off : copy?.giftCardLabel}\n />\n </div>\n )}\n </div>\n </div>\n <div className=\"mt-[30px] md:mt-[18px]\">\n {item.config.type === 'product' && (\n <div\n className={classNames(\n 'mb-[4px] text-center text-[24px] font-bold leading-[1.2] md:text-[20px] md:leading-[1.2]'\n )}\n >\n {item.config.title}\n </div>\n )}\n <Text\n as=\"p\"\n className={classNames(' text-center text-[24px] font-bold leading-[1.2] md:text-[20px] md:leading-[1.2]')}\n >\n {numberFormat(item.alpc?.consumeCredits)} {copy?.pointUnit}\n </Text>\n </div>\n <div className=\"mt-[16px] w-full text-[14px] font-semibold text-[#777] md:mt-[12px]\">\n <div className=\"text-[16px] font-bold leading-[1.4]\">{copy.redeemModal.product.stepTitle}</div>\n <div className=\"mt-[4px] flex items-center justify-center\">\n {copy.redeemModal.product.steps?.map((item, index) => (\n <Fragment key={index}>\n <div className=\"flex w-[76px] flex-col items-center text-center md:h-[94px] min-l:w-[130px]\">\n <Picture source={item.imageUrl} className=\"mb-[4px] h-[58px] w-[58px]\"></Picture>\n <div className=\"min-h-[34px] text-[14px] font-bold text-[#777] md:min-h-[28px] md:text-[12px]\">\n {item.title}\n </div>\n </div>\n {index !== copy.redeemModal.product.steps.length - 1 && (\n <Picture\n source=\"https://cdn.shopify.com/s/files/1/0517/6767/3016/files/step-arrow.png?v=1690458150\"\n className=\"mb-[20px] h-[10px] w-[20px] md:mb-[30px] md:h-[5px] md:w-[12px]\"\n ></Picture>\n )}\n </Fragment>\n ))}\n </div>\n <div className=\"overflow-auto\">\n {rules?.length && (\n <ul className=\"ml-[18px] mt-[16px] grid grid-flow-row gap-[4px] text-[16px] font-bold leading-[1.4] text-[#6D6D6F] md:mt-[12px]\">\n {rules.map((text, index) => (\n <li className=\"list-disc\" key={index}>\n <Text as=\"div\" html={text} className=\"font-bold\" />\n </li>\n ))}\n </ul>\n )}\n </div>\n </div>\n </>\n </div>\n <div className=\"flex-1 bg-white px-[48px] py-[24px] text-center md:px-[16px]\">\n <Text\n as=\"p\"\n className=\"block text-[24px] font-bold leading-[1.2] md:text-[20px] md:leading-[1.2]\"\n html={copy.redeemModal.confirmTitle}\n ></Text>\n <Button\n loading={loading}\n disabled={disabled}\n variant=\"primary\"\n size=\"lg\"\n className=\"mt-[16px] w-full md:mt-[12px]\"\n onClick={() => {\n setStatus('address')\n }}\n >\n {copy.redeemModal.confirmButton}\n </Button>\n </div>\n </div>\n )\n}\n"],
|
|
5
|
-
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,UAAAE,IAAA,eAAAC,EAAAH,GAiCQ,IAAAI,EAAA,6BAjCRC,EAAsC,iCACtCC,EAAuB,yBACvBC,EAAkC,iBAClCC,EAA6B,+BAG7BC,EAA4B,+BAUrB,MAAMP,EAAO,CAAC,CAAE,KAAAQ,EAAM,KAAAC,EAAM,QAAAC,EAAS,SAAAC,EAAU,UAAAC,CAAU,IAAiB,CAC/E,MAAMC,KAAQ,WAAQ,IAChBJ,EAAK,OAAO,OAAO,OACdA,EAAK,OAAO,MAGd,CAAC,GADaA,EAAK,OAAO,MAAM,MAAM,MAAM,GAAK,CAAC,EAChC,GAAID,EAAK,YAAY,QAAQ,OAAS,CAAC,CAAE,EACjE,CAACC,EAAK,OAAO,MAAOA,EAAK,OAAO,KAAMD,EAAK,YAAY,QAAQ,KAAK,CAAC,EAExE,eAAQ,IAAI,OAAQC,CAAI,KAEtB,QAAC,OAAI,UAAU,gBACb,oBAAC,OACC,aAAW,EAAAK,SACT,8FACF,EAEA,gCACE,qBAAC,OAAI,UAAU,mCACb,oBAAC,WACC,OACEL,EAAK,QAAQ,OAAS,cAAY,QAC9BA,EAAK,QAAQ,OAAO,CAAC,GAAG,IACxBD,GAAM,aAAaC,EAAK,OAAO,IAAI,GAAG,KAAOA,EAAK,OAAO,OAAO,IAEtE,UAAU,qEACX,KAED,OAAC,OAAI,UAAU,8DACZ,SAAAA,EAAK,OAAO,UACX,QAAC,OAAI,UAAU,2BACb,oBAAC,QAAK,UAAU,qCAAqC,KAAMA,EAAK,OAAO,MAAM,SAAS,EAAG,KACzF,OAAC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F,GACF,CAEJ",
|
|
6
|
-
"names": ["Init_exports", "__export", "Init", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_classnames", "import_react", "import_utils", "import_const", "copy", "item", "loading", "disabled", "setStatus", "rules", "classNames", "index", "text"]
|
|
7
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { RedeemableItem as RedeemableItemType } from '../../type';
|
|
2
|
-
import { CreditsRedeemListCopy } from '../type';
|
|
3
|
-
type ProductInfoProps = {
|
|
4
|
-
item: RedeemableItemType;
|
|
5
|
-
copy: CreditsRedeemListCopy;
|
|
6
|
-
};
|
|
7
|
-
export declare const ProductInfo: ({ item, copy }: ProductInfoProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export {};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var s=Object.defineProperty;var o=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var n=Object.prototype.hasOwnProperty;var x=(t,a)=>{for(var d in a)s(t,d,{get:a[d],enumerable:!0})},u=(t,a,d,i)=>{if(a&&typeof a=="object"||typeof a=="function")for(let m of c(a))!n.call(t,m)&&m!==d&&s(t,m,{get:()=>a[m],enumerable:!(i=o(a,m))||i.enumerable});return t};var f=t=>u(s({},"__esModule",{value:!0}),t);var b={};x(b,{ProductInfo:()=>v});module.exports=f(b);var e=require("react/jsx-runtime"),l=require("@anker-in/headless-ui"),r=require("../../context/utils"),p=require("@anker-in/shopify");const v=({item:t,copy:a})=>{const{locale:d}=(0,p.useShopifyContext)();return(0,e.jsxs)("div",{className:"flex w-full items-center justify-center md:items-start md:justify-start",children:[(0,e.jsx)(l.Picture,{className:"mr-[16px] size-[100px] shrink-0 md:mr-[12px] md:hidden md:size-[44px] [&_img]:h-full [&_img]:w-auto [&_img]:object-contain",source:t.variant.image?.url||t.product?.images[0]?.url,alt:t.product.title}),(0,e.jsxs)("div",{className:"md:flex md:flex-col",children:[(0,e.jsxs)("div",{className:"md:flex md:items-center",children:[(0,e.jsx)(l.Picture,{className:"mr-[16px] size-[100px] shrink-0 md:mr-[12px] md:size-[44px] min-md:hidden [&_img]:h-full [&_img]:w-auto [&_img]:object-contain",source:t.variant.image?.url||t.product?.images[0]?.url,alt:t.product.title}),(0,e.jsx)("div",{className:"flex-1 text-[16px] font-bold leading-[1.4] min-l:!hidden",title:t.product.title,children:t.product.title})]}),(0,e.jsxs)("div",{className:"mt-[16px] md:mt-[12px]",children:[(0,e.jsx)("div",{className:"mb-[12px] line-clamp-1 text-[16px] font-bold l:!hidden",title:t.product.title,children:t.product.title}),(0,e.jsxs)("div",{className:"flex font-semibold leading-[1.4] md:flex-col",children:[(0,e.jsxs)("div",{className:"mr-[40px] text-[15px] font-bold text-[#777] md:mr-0 md:text-[12px]",children:[(0,e.jsxs)("div",{className:"mb-[8px] flex items-center md:mb-[4px]",children:[(0,e.jsxs)("span",{children:[a.redeemModal.product.variantLabel,": "]}),(0,e.jsx)("span",{className:"ml-1",children:t.variant.title||""})]}),(0,e.jsxs)("div",{className:"mb-[8px] flex items-center md:mb-[4px]",children:[(0,e.jsxs)("span",{children:[a.redeemModal.product.shippingFeeLabel,": "]}),(0,e.jsx)("span",{className:"ml-1",children:(0,r.formatPrice)({amount:0,currencyCode:t.product.price?.currencyCode,locale:d||"us"})})]})]}),(0,e.jsxs)("div",{className:"text-[15px] font-bold text-[#777] md:text-[12px]",children:[(0,e.jsxs)("div",{className:"mb-[8px] flex items-center md:mb-[4px]",children:[(0,e.jsxs)("span",{children:[a.redeemModal.product.quantityLabel,": "]}),(0,e.jsx)("span",{className:"ml-1",children:"1"})]}),(0,e.jsxs)("div",{className:"l:flex l:items-center l:justify-between",children:[(0,e.jsxs)("span",{children:[a.redeemModal.product.totalPriceLabel,": "]}),(0,e.jsxs)("span",{className:"ml-1",children:[t.alpc?.consumeCredits," ",a?.pointUnit]})]})]})]})]})]})]})};
|
|
2
|
-
//# sourceMappingURL=ProductInfo.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../src/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Picture } from '@anker-in/headless-ui'\nimport { formatPrice } from '../../context/utils'\nimport type { RedeemableItem as RedeemableItemType } from '../../type'\nimport { CreditsRedeemListCopy } from '../type'\nimport { useShopifyContext } from '@anker-in/shopify'\n\ntype ProductInfoProps = {\n item: RedeemableItemType\n copy: CreditsRedeemListCopy\n}\n\nexport const ProductInfo = ({ item, copy }: ProductInfoProps) => {\n const { locale } = useShopifyContext()\n\n return (\n <div className=\"flex w-full items-center justify-center md:items-start md:justify-start\">\n <Picture\n className=\"mr-[16px] size-[100px] shrink-0 md:mr-[12px] md:hidden md:size-[44px] [&_img]:h-full [&_img]:w-auto [&_img]:object-contain\"\n source={item.variant.image?.url || item.product?.images[0]?.url}\n alt={item.product.title}\n ></Picture>\n <div className=\"md:flex md:flex-col\">\n <div className=\"md:flex md:items-center\">\n <Picture\n className=\"mr-[16px] size-[100px] shrink-0 md:mr-[12px] md:size-[44px] min-md:hidden [&_img]:h-full [&_img]:w-auto [&_img]:object-contain\"\n source={item.variant.image?.url || item.product?.images[0]?.url}\n alt={item.product.title}\n ></Picture>\n <div className=\"flex-1 text-[16px] font-bold leading-[1.4] min-l:!hidden\" title={item.product.title}>\n {item.product.title}\n </div>\n </div>\n\n <div className=\"mt-[16px] md:mt-[12px]\">\n <div className=\"mb-[12px] line-clamp-1 text-[16px] font-bold l:!hidden\" title={item.product.title}>\n {item.product.title}\n </div>\n <div className=\"flex font-semibold leading-[1.4] md:flex-col\">\n <div className=\"mr-[40px] text-[15px] font-bold text-[#777] md:mr-0 md:text-[12px]\">\n <div className=\"mb-[8px] flex items-center md:mb-[4px]\">\n <span>{copy.redeemModal.product.variantLabel}: </span>\n <span className=\"ml-1\">{item.variant.title || ''}</span>\n </div>\n <div className=\"mb-[8px] flex items-center md:mb-[4px]\">\n <span>{copy.redeemModal.product.shippingFeeLabel}: </span>\n <span className=\"ml-1\">\n {formatPrice({\n amount: 0,\n currencyCode: item.product.price?.currencyCode!,\n locale: locale || 'us',\n })}\n </span>\n </div>\n </div>\n <div className=\"text-[15px] font-bold text-[#777] md:text-[12px]\">\n <div className=\"mb-[8px] flex items-center md:mb-[4px]\">\n <span>{copy.redeemModal.product.quantityLabel}: </span>\n <span className=\"ml-1\">1</span>\n </div>\n <div className=\"l:flex l:items-center l:justify-between\">\n <span>{copy.redeemModal.product.totalPriceLabel}: </span>\n <span className=\"ml-1\">\n {item.alpc?.consumeCredits} {copy?.pointUnit}\n </span>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n )\n}\n"],
|
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,iBAAAE,IAAA,eAAAC,EAAAH,GAgBM,IAAAI,EAAA,6BAhBNC,EAAwB,iCACxBC,EAA4B,+BAG5BC,EAAkC,6BAO3B,MAAML,EAAc,CAAC,CAAE,KAAAM,EAAM,KAAAC,CAAK,IAAwB,CAC/D,KAAM,CAAE,OAAAC,CAAO,KAAI,qBAAkB,EAErC,SACE,QAAC,OAAI,UAAU,0EACb,oBAAC,WACC,UAAU,6HACV,OAAQF,EAAK,QAAQ,OAAO,KAAOA,EAAK,SAAS,OAAO,CAAC,GAAG,IAC5D,IAAKA,EAAK,QAAQ,MACnB,KACD,QAAC,OAAI,UAAU,sBACb,qBAAC,OAAI,UAAU,0BACb,oBAAC,WACC,UAAU,iIACV,OAAQA,EAAK,QAAQ,OAAO,KAAOA,EAAK,SAAS,OAAO,CAAC,GAAG,IAC5D,IAAKA,EAAK,QAAQ,MACnB,KACD,OAAC,OAAI,UAAU,2DAA2D,MAAOA,EAAK,QAAQ,MAC3F,SAAAA,EAAK,QAAQ,MAChB,GACF,KAEA,QAAC,OAAI,UAAU,yBACb,oBAAC,OAAI,UAAU,yDAAyD,MAAOA,EAAK,QAAQ,MACzF,SAAAA,EAAK,QAAQ,MAChB,KACA,QAAC,OAAI,UAAU,+CACb,qBAAC,OAAI,UAAU,qEACb,qBAAC,OAAI,UAAU,yCACb,qBAAC,QAAM,UAAAC,EAAK,YAAY,QAAQ,aAAa,MAAE,KAC/C,OAAC,QAAK,UAAU,OAAQ,SAAAD,EAAK,QAAQ,OAAS,GAAG,GACnD,KACA,QAAC,OAAI,UAAU,yCACb,qBAAC,QAAM,UAAAC,EAAK,YAAY,QAAQ,iBAAiB,MAAE,KACnD,OAAC,QAAK,UAAU,OACb,2BAAY,CACX,OAAQ,EACR,aAAcD,EAAK,QAAQ,OAAO,aAClC,OAAQE,GAAU,IACpB,CAAC,EACH,GACF,GACF,KACA,QAAC,OAAI,UAAU,mDACb,qBAAC,OAAI,UAAU,yCACb,qBAAC,QAAM,UAAAD,EAAK,YAAY,QAAQ,cAAc,MAAE,KAChD,OAAC,QAAK,UAAU,OAAO,aAAC,GAC1B,KACA,QAAC,OAAI,UAAU,0CACb,qBAAC,QAAM,UAAAA,EAAK,YAAY,QAAQ,gBAAgB,MAAE,KAClD,QAAC,QAAK,UAAU,OACb,UAAAD,EAAK,MAAM,eAAe,IAAEC,GAAM,WACrC,GACF,GACF,GACF,GACF,GACF,GACF,CAEJ",
|
|
6
|
-
"names": ["ProductInfo_exports", "__export", "ProductInfo", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_utils", "import_shopify", "item", "copy", "locale"]
|
|
7
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { RedeemableItem as RedeemableItemType } from '../../type';
|
|
2
|
-
import { CreditsRedeemListCopy } from '../type';
|
|
3
|
-
type SuccessProps = {
|
|
4
|
-
copy: CreditsRedeemListCopy;
|
|
5
|
-
shippingProduct: string;
|
|
6
|
-
loading: boolean;
|
|
7
|
-
address: Record<string, any> | undefined;
|
|
8
|
-
disabled: boolean;
|
|
9
|
-
onClose: () => void;
|
|
10
|
-
item: RedeemableItemType;
|
|
11
|
-
};
|
|
12
|
-
export declare const Success: ({ copy, shippingProduct, loading, address, disabled, onClose, item }: SuccessProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
export {};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var f=Object.create;var a=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var v=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty;var N=(e,t)=>{for(var m in t)a(e,m,{get:t[m],enumerable:!0})},l=(e,t,m,p)=>{if(t&&typeof t=="object"||typeof t=="function")for(let d of y(t))!g.call(e,d)&&d!==m&&a(e,d,{get:()=>t[d],enumerable:!(p=b(t,d))||p.enumerable});return e};var w=(e,t,m)=>(m=e!=null?f(v(e)):{},l(t||!e||!e.__esModule?a(m,"default",{value:e,enumerable:!0}):m,e)),C=e=>l(a({},"__esModule",{value:!0}),e);var T={};N(T,{Success:()=>R});module.exports=C(T);var o=require("react/jsx-runtime"),s=require("@anker-in/headless-ui"),r=w(require("classnames")),i=require("./ProductInfo");const R=({copy:e,shippingProduct:t,loading:m,address:p,disabled:d,onClose:x,item:n})=>(0,o.jsx)("div",{className:(0,r.default)("max-h-[500px] overflow-y-auto px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]"),children:(0,o.jsxs)("div",{className:"flex flex-col items-center",children:[(0,o.jsx)("div",{className:"mb-[16px] grid grid-flow-row gap-y-[4px] md:mb-[12px]",children:e.redeemModal.product.successDesc.map((c,u)=>(0,o.jsx)(s.Text,{className:"text-[18px] font-bold leading-[1.4] md:text-[14px]",html:c},u))}),t&&(0,o.jsx)(s.Text,{className:"mb-5 text-[16px] font-bold",html:t}),(0,o.jsx)("div",{className:"flex w-full items-center rounded-[16px] bg-[#F5F5F7] p-[16px]",children:(0,o.jsx)(i.ProductInfo,{item:n,copy:e})}),(0,o.jsx)(s.Button,{loading:m||!p,variant:"primary",className:"mx-auto mt-[16px] w-[444px] md:mt-[12px] md:w-full",onClick:x,disabled:d,children:e.redeemModal.product.paymentButton})]})});
|
|
2
|
-
//# sourceMappingURL=Success.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../src/components/credits/creditsRedeemList/RedeemProductModal/Success.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Button, Text } from '@anker-in/headless-ui'\nimport classNames from 'classnames'\nimport type { RedeemableItem as RedeemableItemType } from '../../type'\nimport { CreditsRedeemListCopy } from '../type'\nimport { ProductInfo } from './ProductInfo'\n\ntype SuccessProps = {\n copy: CreditsRedeemListCopy\n shippingProduct: string\n loading: boolean\n address: Record<string, any> | undefined\n disabled: boolean\n onClose: () => void\n item: RedeemableItemType\n}\n\nexport const Success = ({ copy, shippingProduct, loading, address, disabled, onClose, item }: SuccessProps) => {\n return (\n <div className={classNames('max-h-[500px] overflow-y-auto px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]')}>\n <div className=\"flex flex-col items-center\">\n <div className=\"mb-[16px] grid grid-flow-row gap-y-[4px] md:mb-[12px]\">\n {copy.redeemModal.product.successDesc.map((description: string, index: number) => (\n <Text key={index} className=\"text-[18px] font-bold leading-[1.4] md:text-[14px]\" html={description}></Text>\n ))}\n </div>\n\n {shippingProduct && <Text className=\"mb-5 text-[16px] font-bold\" html={shippingProduct}></Text>}\n\n <div className=\"flex w-full items-center rounded-[16px] bg-[#F5F5F7] p-[16px]\">\n <ProductInfo item={item} copy={copy} />\n </div>\n\n <Button\n loading={loading || !address}\n variant=\"primary\"\n className=\"mx-auto mt-[16px] w-[444px] md:mt-[12px] md:w-full\"\n onClick={onClose}\n disabled={disabled}\n >\n {copy.redeemModal.product.paymentButton}\n </Button>\n </div>\n </div>\n )\n}\n"],
|
|
5
|
-
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAmBM,IAAAI,EAAA,6BAnBNC,EAA6B,iCAC7BC,EAAuB,yBAGvBC,EAA4B,yBAYrB,MAAML,EAAU,CAAC,CAAE,KAAAM,EAAM,gBAAAC,EAAiB,QAAAC,EAAS,QAAAC,EAAS,SAAAC,EAAU,QAAAC,EAAS,KAAAC,CAAK,OAEvF,OAAC,OAAI,aAAW,EAAAC,SAAW,iFAAiF,EAC1G,oBAAC,OAAI,UAAU,6BACb,oBAAC,OAAI,UAAU,wDACZ,SAAAP,EAAK,YAAY,QAAQ,YAAY,IAAI,CAACQ,EAAqBC,OAC9D,OAAC,QAAiB,UAAU,qDAAqD,KAAMD,GAA5EC,CAAyF,CACrG,EACH,EAECR,MAAmB,OAAC,QAAK,UAAU,6BAA6B,KAAMA,EAAiB,KAExF,OAAC,OAAI,UAAU,gEACb,mBAAC,eAAY,KAAMK,EAAM,KAAMN,EAAM,EACvC,KAEA,OAAC,UACC,QAASE,GAAW,CAACC,EACrB,QAAQ,UACR,UAAU,qDACV,QAASE,EACT,SAAUD,EAET,SAAAJ,EAAK,YAAY,QAAQ,cAC5B,GACF,EACF",
|
|
6
|
-
"names": ["Success_exports", "__export", "Success", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_classnames", "import_ProductInfo", "copy", "shippingProduct", "loading", "address", "disabled", "onClose", "item", "classNames", "description", "index"]
|
|
7
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { AlpcErrorCode } from '../../context/const';
|
|
2
|
-
import type { ModalContainerProps } from '../../modal/modalContainer';
|
|
3
|
-
import type { RedeemableItem as RedeemableItemType } from '../../type';
|
|
4
|
-
import { CreditsRedeemListCopy } from '../type';
|
|
5
|
-
type RedeemProductModalProps = ModalContainerProps & {
|
|
6
|
-
item: RedeemableItemType;
|
|
7
|
-
copy: CreditsRedeemListCopy;
|
|
8
|
-
onError: (code: AlpcErrorCode) => void;
|
|
9
|
-
};
|
|
10
|
-
declare function RedeemProductModal({ item, copy, onError, ...props }: RedeemProductModalProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
export default RedeemProductModal;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var W=Object.create;var g=Object.defineProperty;var X=Object.getOwnPropertyDescriptor;var Y=Object.getOwnPropertyNames;var Z=Object.getPrototypeOf,$=Object.prototype.hasOwnProperty;var j=(r,e)=>{for(var t in e)g(r,t,{get:e[t],enumerable:!0})},N=(r,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Y(e))!$.call(r,i)&&i!==t&&g(r,i,{get:()=>e[i],enumerable:!(a=X(e,i))||a.enumerable});return r};var S=(r,e,t)=>(t=r!=null?W(Z(r)):{},N(e||!r||!r.__esModule?g(t,"default",{value:r,enumerable:!0}):t,r)),D=r=>N(g({},"__esModule",{value:!0}),r);var oe={};j(oe,{default:()=>re});module.exports=D(oe);var l=require("react/jsx-runtime"),v=S(require("classnames")),s=require("react"),y=require("../../context/provider"),L=S(require("../../context/hooks/useCountries")),f=require("../../context/const"),x=require("../../context/hooks/useAddressValidate"),U=require("../../context/hooks/useRedeemProduct"),O=require("../../modal/modalContainer"),q=require("@anker-in/shopify"),w=require("./Error"),F=require("./Success"),K=require("./Address"),_=require("./Init");function ee({item:r,copy:e,onError:t,...a}){const{fetchCreditInfo:i,profile:b}=(0,y.useCreditsContext)(),{storeDomain:k,locale:T}=(0,q.useShopifyContext)(),{validatorInfo:B}=e,{shippingAddress:G,shippingProduct:P}=e.redeemModal.product,[m,c]=(0,s.useState)("init"),[n,J]=(0,s.useState)(),[V,p]=(0,s.useState)({code:0,message:"",imageUrl:""}),[C,u]=(0,s.useState)(!1),{countries:R=[],isLoading:de}=(0,L.default)({shopifyStoreDomain:k}),{isMutating:M,trigger:A}=(0,U.useRedeemProduct)({onSuccess(o){if(!o){c("error"),p({code:0,imageUrl:e.redeemModal.errorImageUrl||"",message:e.redeemModal.commonError||""});return}if(o?.code===0)i(b?.user_id),c("success");else{let d,I;o.code===f.AlpcErrorCode.CodeLpcShopifyCouponRuleRedeemLimit?(d=e.redeemModal.redeemLimitError,u(!0)):o.code===f.AlpcErrorCode.CodeLpcRuleInventoryNotEnough?(d=e.redeemModal.inventoryNotEnough,u(!0),I=e.redeemModal.inventoryNotEnough):o.code===f.AlpcErrorCode.CodeLpcNotEnoughCredits?(d=e.redeemModal.creditsNotEnough,u(!0),i(b?.user_id)):o.code===f.AlpcErrorCode.CodeCrossSiteError&&(d=e.redeemModal.crossSiteError,u(!0)),c("error"),p({code:o.code,imageUrl:I||e.redeemModal.errorImageUrl||"",message:d||e.redeemModal.commonError||""}),t&&t(o.code)}},onError(o){c("error"),p({code:0,imageUrl:e.redeemModal.errorImageUrl||"",message:e.redeemModal.commonError||""})}}),h=(0,s.useMemo)(()=>e?.redeemModal.product.form?.flat().find(d=>d.type==="state")?.key,[e?.redeemModal.product.form]),{validate:E,errors:z}=(0,x.useAddressValidate)({address:n,validatorInfo:B,formData:e?.redeemModal.product.form?.flat()||[],errorLabel:{require:e.redeemModal.product.required,email:e.redeemModal.product.invalidEmail}}),H=(0,s.useCallback)(async()=>{const o=[];if(h&&((R.find(Q=>Q.code===n.country)?.provinces||[]).length||o.push(h)),E({force:!0,ignoreKeys:o}))return;console.log("address",n);let d={...n};d.name&&delete d.name,d.country==="UK"&&(d.country="GB"),A({address:btoa(JSON.stringify(d)),rule_id:Number(r.alpc?.id)})},[r,A,h,E,n,R]);return(0,s.useEffect)(()=>{a.isOpen||(u(!1),p({code:0,message:"",imageUrl:""}))},[a.isOpen,T]),(0,l.jsxs)(O.CreditsModalContainer,{...a,className:(0,v.default)("w-[540px] md:h-auto min-md:max-h-[calc(100vh-40px)]",m!=="init"&&"w-[740px] md:w-full"),scrollClassName:"mb-0 min-l:px-0 md:mb-0 px-0",titleClassName:(0,v.default)("h-[56px]",m==="init"&&"bg-[#F5F5F7]"),title:m==="address"?"Order Confirmation":"",children:[m==="error"&&(0,l.jsx)(w.Error,{errorInfo:V}),m==="success"&&(0,l.jsx)(F.Success,{copy:e,shippingProduct:P,loading:M,address:n,disabled:C,onClose:a.onClose,item:r}),m==="address"&&(0,l.jsx)(K.Address,{copy:e,shippingAddress:G,setAddress:J,validateAddress:E,validateErrors:z,shippingProduct:P,loading:M,address:n,disabled:C,handlePayment:H,item:r}),m==="init"&&(0,l.jsx)(_.Init,{item:r,copy:e,loading:M,disabled:C,setStatus:c})]})}var re=ee;
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../src/components/credits/creditsRedeemList/RedeemProductModal/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import classNames from 'classnames'\nimport { useCallback, useEffect, useMemo, useState } from 'react'\nimport { useCreditsContext } from '../../context/provider'\nimport useCountries from '../../context/hooks/useCountries'\nimport { AlpcErrorCode } from '../../context/const'\nimport { useAddressValidate } from '../../context/hooks/useAddressValidate'\nimport { useRedeemProduct } from '../../context/hooks/useRedeemProduct'\nimport type { ModalContainerProps } from '../../modal/modalContainer'\nimport { CreditsModalContainer } from '../../modal/modalContainer'\nimport type { RedeemableItem as RedeemableItemType } from '../../type'\nimport { useShopifyContext } from '@anker-in/shopify'\nimport { CreditsRedeemListCopy } from '../type'\nimport { Error } from './Error'\nimport { Success } from './Success'\nimport { Address } from './Address'\nimport { Init } from './Init'\n\ntype RedeemProductModalProps = ModalContainerProps & {\n item: RedeemableItemType\n copy: CreditsRedeemListCopy\n onError: (code: AlpcErrorCode) => void\n}\n\nfunction RedeemProductModal({ item, copy, onError, ...props }: RedeemProductModalProps) {\n const { fetchCreditInfo, profile } = useCreditsContext()\n const { storeDomain, locale } = useShopifyContext()\n\n const { validatorInfo } = copy\n const { shippingAddress, shippingProduct } = copy.redeemModal.product\n\n const [status, setStatus] = useState<'init' | 'address' | 'success' | 'error'>('init')\n const [address, setAddress] = useState<any>()\n const [errorInfo, setErrorInfo] = useState({\n code: 0,\n message: '',\n imageUrl: '',\n })\n const [disabled, setDisabled] = useState(false)\n\n const { countries = [], isLoading: countriesLoading } = useCountries({ shopifyStoreDomain: storeDomain })\n\n const { isMutating: loading, trigger } = useRedeemProduct({\n onSuccess(responseData) {\n if (!responseData) {\n setStatus('error')\n setErrorInfo({\n code: 0,\n imageUrl: copy.redeemModal.errorImageUrl || '',\n message: copy.redeemModal.commonError || '',\n })\n return\n }\n\n if (responseData?.code === 0) {\n fetchCreditInfo(profile?.user_id)\n setStatus('success')\n } else {\n let errorMsg\n let errorImage\n if (responseData.code === AlpcErrorCode.CodeLpcShopifyCouponRuleRedeemLimit) {\n errorMsg = copy.redeemModal.redeemLimitError\n setDisabled(true)\n } else if (responseData.code === AlpcErrorCode.CodeLpcRuleInventoryNotEnough) {\n errorMsg = copy.redeemModal.inventoryNotEnough\n setDisabled(true)\n errorImage = copy.redeemModal.inventoryNotEnough\n } else if (responseData.code === AlpcErrorCode.CodeLpcNotEnoughCredits) {\n errorMsg = copy.redeemModal.creditsNotEnough\n setDisabled(true)\n fetchCreditInfo(profile?.user_id)\n } else if (responseData.code === AlpcErrorCode.CodeCrossSiteError) {\n errorMsg = copy.redeemModal.crossSiteError\n setDisabled(true)\n }\n\n setStatus('error')\n setErrorInfo({\n code: responseData.code,\n imageUrl: errorImage || copy.redeemModal.errorImageUrl || '',\n message: errorMsg || copy.redeemModal.commonError || '',\n })\n onError && onError(responseData.code)\n }\n },\n onError(error) {\n setStatus('error')\n setErrorInfo({\n code: 0,\n imageUrl: copy.redeemModal.errorImageUrl || '',\n message: copy.redeemModal.commonError || '',\n })\n },\n })\n\n const stateInputKey = useMemo(() => {\n const stateInput = copy?.redeemModal.product.form?.flat().find(item => item.type === 'state')\n return stateInput?.key\n }, [copy?.redeemModal.product.form])\n\n const { validate: validateAddress, errors: validateErrors } = useAddressValidate({\n address: address,\n validatorInfo: validatorInfo,\n formData: copy?.redeemModal.product.form?.flat() || [],\n errorLabel: {\n require: copy.redeemModal.product.required,\n email: copy.redeemModal.product.invalidEmail,\n },\n })\n\n const handlePayment = useCallback(async () => {\n const ignoreKeys: string[] = []\n\n if (stateInputKey) {\n const provinces = countries.find(item => item.code === address.country)?.provinces || []\n\n if (!provinces.length) {\n ignoreKeys.push(stateInputKey as never)\n }\n }\n\n if (\n validateAddress({\n force: true,\n ignoreKeys,\n })\n ) {\n // \u5730\u5740\u6821\u9A8C\u9519\u8BEF\n return\n }\n console.log('address', address)\n let requestAddress = { ...address }\n if (requestAddress.name) {\n delete requestAddress.name\n }\n if (requestAddress.country === 'UK') {\n requestAddress.country = 'GB'\n }\n trigger({\n address: btoa(JSON.stringify(requestAddress)),\n rule_id: Number(item.alpc?.id),\n })\n }, [item, trigger, stateInputKey, validateAddress, address, countries])\n\n useEffect(() => {\n if (!props.isOpen) {\n setDisabled(false)\n setErrorInfo({ code: 0, message: '', imageUrl: '' })\n }\n }, [props.isOpen, locale])\n\n return (\n <CreditsModalContainer\n {...props}\n className={classNames(\n 'w-[540px] md:h-auto min-md:max-h-[calc(100vh-40px)]',\n status !== 'init' && 'w-[740px] md:w-full'\n )}\n scrollClassName=\"mb-0 min-l:px-0 md:mb-0 px-0\"\n titleClassName={classNames('h-[56px]', status === 'init' && 'bg-[#F5F5F7]')}\n title={status === 'address' ? 'Order Confirmation' : ''}\n >\n {status === 'error' && <Error errorInfo={errorInfo} />}\n {status === 'success' && (\n <Success\n copy={copy}\n shippingProduct={shippingProduct}\n loading={loading}\n address={address}\n disabled={disabled}\n onClose={props.onClose}\n item={item}\n />\n )}\n {status === 'address' && (\n <Address\n copy={copy}\n shippingAddress={shippingAddress}\n setAddress={setAddress}\n validateAddress={validateAddress}\n validateErrors={validateErrors}\n shippingProduct={shippingProduct}\n loading={loading}\n address={address}\n disabled={disabled}\n handlePayment={handlePayment}\n item={item}\n />\n )}\n {status === 'init' && (\n <Init item={item} copy={copy} loading={loading} disabled={disabled} setStatus={setStatus} />\n )}\n </CreditsModalContainer>\n )\n}\n\nexport default RedeemProductModal\n"],
|
|
5
|
-
"mappings": "0jBAAA,IAAAA,GAAA,GAAAC,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names": ["RedeemProductModal_exports", "__export", "RedeemProductModal_default", "__toCommonJS", "import_jsx_runtime", "import_classnames", "import_react", "import_provider", "import_useCountries", "import_const", "import_useAddressValidate", "import_useRedeemProduct", "import_modalContainer", "import_shopify", "import_Error", "import_Success", "import_Address", "import_Init", "RedeemProductModal", "item", "copy", "onError", "props", "fetchCreditInfo", "profile", "storeDomain", "locale", "validatorInfo", "shippingAddress", "shippingProduct", "status", "setStatus", "address", "setAddress", "errorInfo", "setErrorInfo", "disabled", "setDisabled", "countries", "countriesLoading", "useCountries", "loading", "trigger", "responseData", "errorMsg", "errorImage", "error", "stateInputKey", "validateAddress", "validateErrors", "handlePayment", "ignoreKeys", "requestAddress", "classNames"]
|
|
7
|
-
}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { AlpcErrorCode } from '../context/const';
|
|
2
|
-
import type { ModalContainerProps } from '../modal/modalContainer';
|
|
3
|
-
import type { RedeemableItem as RedeemableItemType } from '../type';
|
|
4
|
-
export type FormData = {
|
|
5
|
-
key: string;
|
|
6
|
-
label: string;
|
|
7
|
-
tips: string;
|
|
8
|
-
required: boolean;
|
|
9
|
-
placeholder: string;
|
|
10
|
-
type?: string;
|
|
11
|
-
}[];
|
|
12
|
-
export type RedeemProductModalCopy = {
|
|
13
|
-
confirmTitle: string;
|
|
14
|
-
confirmButton: string;
|
|
15
|
-
off: string;
|
|
16
|
-
giftCardLabel: string;
|
|
17
|
-
pointUnit: string;
|
|
18
|
-
imageMapping: Record<string, {
|
|
19
|
-
url: string;
|
|
20
|
-
}>;
|
|
21
|
-
validatorInfo: {
|
|
22
|
-
addressInfo: {
|
|
23
|
-
name: string;
|
|
24
|
-
country: string;
|
|
25
|
-
province: string;
|
|
26
|
-
city: string;
|
|
27
|
-
address: string;
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
shippingAddress: string;
|
|
31
|
-
shippingProduct: string;
|
|
32
|
-
product: {
|
|
33
|
-
addressForm: FormData;
|
|
34
|
-
form: FormData;
|
|
35
|
-
successDesc: string[];
|
|
36
|
-
rules: string[];
|
|
37
|
-
steps: {
|
|
38
|
-
imageUrl: string;
|
|
39
|
-
title: string;
|
|
40
|
-
}[];
|
|
41
|
-
quantityLabel: string;
|
|
42
|
-
totalPriceLabel: string;
|
|
43
|
-
variantLabel: string;
|
|
44
|
-
shippingFeeLabel: string;
|
|
45
|
-
paymentButton: string;
|
|
46
|
-
stepTitle: string;
|
|
47
|
-
};
|
|
48
|
-
errorImageUrl: string;
|
|
49
|
-
commonError: string;
|
|
50
|
-
redeemLimitError: string;
|
|
51
|
-
inventoryNotEnough: string;
|
|
52
|
-
inventoryNotEnoughImageUrl: string;
|
|
53
|
-
creditsNotEnough: string;
|
|
54
|
-
crossSiteError: string;
|
|
55
|
-
};
|
|
56
|
-
type RedeemProductModalProps = ModalContainerProps & {
|
|
57
|
-
item: RedeemableItemType;
|
|
58
|
-
copy: RedeemProductModalCopy;
|
|
59
|
-
onError: (code: AlpcErrorCode) => void;
|
|
60
|
-
};
|
|
61
|
-
declare function RedeemProductModal({ item, copy, onError, ...props }: RedeemProductModalProps): import("react/jsx-runtime").JSX.Element;
|
|
62
|
-
export default RedeemProductModal;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { RedeemableItem as RedeemableItemType } from '../type';
|
|
2
|
-
import type { CreditsRedeemListCopy } from './type';
|
|
3
|
-
export declare function RedeemableItem({ copy, className, item, onRulesOpen, onRedeem, }: {
|
|
4
|
-
copy: CreditsRedeemListCopy;
|
|
5
|
-
className?: string;
|
|
6
|
-
item: RedeemableItemType;
|
|
7
|
-
onRulesOpen: (rules: string[]) => void;
|
|
8
|
-
onRedeem: (item: RedeemableItemType) => void;
|
|
9
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var N=Object.create;var m=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var T=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty;var I=(t,a)=>{for(var e in a)m(t,e,{get:a[e],enumerable:!0})},b=(t,a,e,p)=>{if(a&&typeof a=="object"||typeof a=="function")for(let n of R(a))!w.call(t,n)&&n!==e&&m(t,n,{get:()=>a[n],enumerable:!(p=C(a,n))||p.enumerable});return t};var k=(t,a,e)=>(e=t!=null?N(T(t)):{},b(a||!t||!t.__esModule?m(e,"default",{value:t,enumerable:!0}):e,t)),L=t=>b(m({},"__esModule",{value:!0}),t);var E={};I(E,{RedeemableItem:()=>S});module.exports=L(E);var l=require("react/jsx-runtime"),i=require("@anker-in/headless-ui"),c=require("react"),x=k(require("classnames")),h=require("../context/provider"),o=require("../context/const"),_=require("../context/utils"),u=require("../../../helpers/track");function S({copy:t,className:a,item:e,onRulesOpen:p,onRedeem:n}){const{creditInfo:f,profile:r,gtm:{pageGroup:v}}=(0,h.useCreditsContext)(),s=Object.keys(r||{}).length>0,y=(0,c.useMemo)(()=>!!(e.alpc?.remainingInventory<=0&&e.alpc?.isLimited||e.alpc?.consumeType===o.AlpcConsumeType.Product&&!e.variant?.availableForSale||s&&r?.activated&&e.alpc?.consumeCredits>Number(f?.available_credit||0)),[e.alpc?.remainingInventory,e.alpc?.isLimited,e.alpc?.consumeType,e.alpc?.consumeCredits,s,r?.activated,f?.available_credit,e.variant?.availableForSale]),g=(0,c.useMemo)(()=>s?e.alpc?.consumeType===o.AlpcConsumeType.Product?e.variant?.availableForSale?t.btnRedeem:t?.soldOut||"Sold Out":t.btnRedeem:t.unlockRewards,[s,e.alpc?.consumeType,e.variant?.availableForSale,t.btnRedeem,t.unlockRewards,t?.soldOut]);return(0,l.jsxs)("div",{className:(0,x.default)("flex flex-col items-center rounded-[16px] bg-[#EAEAEC] p-[24px] md:rounded-[12px] md:px-[8px] xl:py-[16px] md-xl:px-[16px]",a),children:[e.config?.type!==o.ConsumeType.Product?(0,l.jsxs)("div",{className:"relative mx-auto my-[30px] h-[164px] md:my-0 md:h-[66px] l-xxl:h-[138px] md-l:h-[80px]",children:[(0,l.jsx)(i.Picture,{source:t?.imageMapping[e.config?.type]?.url,className:"h-full [&_img]:h-full [&_img]:w-auto [&_img]:object-contain"}),(0,l.jsx)("div",{className:"absolute bottom-[8px] left-[16px] font-extrabold text-white md:bottom-[2px] md:left-[5px]",children:e.config?.value?(0,l.jsxs)("div",{className:"flex items-end",children:[(0,l.jsx)(i.Text,{className:"text-[64px] font-bold leading-none md:text-[20px] l-xxl:text-[40px] md-l:text-[22px]",html:e.config?.value}),(0,l.jsx)(i.Text,{className:"ml-[4px] text-[24px] font-bold leading-[2] md:ml-[2px] l:text-[12px] xxl:leading-[1.4] l-xxl:text-[20px]",html:e.config?.type===o.ConsumeType.GiftCard?t?.giftCardLabel:t?.off})]}):(0,l.jsx)(i.Text,{size:3,html:e.config?.title||e.alpc?.title})})]}):(0,l.jsx)("div",{className:(0,x.default)("relative mx-auto h-[224px] w-fit md:my-[10px] l:h-[120px] l-xxl:h-[138px]"),children:(0,l.jsx)(i.Picture,{className:"h-full w-auto [&_img]:h-full [&_img]:object-contain",source:e.config?.image?.url||e.product.images?.[0]?.url})}),(0,l.jsxs)("div",{className:(0,x.default)("mt-[22px] flex w-full flex-1 flex-col justify-between"),children:[(0,l.jsx)(i.Text,{html:e.config?.title||e.alpc?.title,title:e.config?.title||e.alpc?.title,size:2,className:"text-[24px] font-bold leading-[1.2] l:text-[16px] l-xxl:text-[20px]"}),e.config?.rules?.length>0&&(0,l.jsx)("button",{type:"button",onClick:()=>{p(e.config?.rules||[]),(0,u.gaTrack)({event:"ga4Event",event_name:"lp_button",member_active_status:r?.activated?"active":"not active",event_parameters:{page_group:v,position:t.title,button_name:t?.ruleLabel,info:e.alpc?.id?.toString()}})},className:"mt-[8px] w-fit text-[16px] font-bold underline md:text-[14px] l:mt-0",tabIndex:0,onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&d.preventDefault()},children:t?.ruleLabel}),(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"mt-[24px] flex items-center l:mt-[12px] l-xl:mt-[16px]",children:[(0,l.jsx)(i.Picture,{className:"size-[20px]",source:"https://cdn.shopify.com/s/files/1/0511/6346/3874/files/icon_hire_purchase.png?v=1757496783"}),(0,l.jsx)(i.Text,{html:`${(0,_.numberFormat)(e.alpc?.consumeCredits)}`,size:2,as:"p",className:"ml-[4px] text-[28px] font-bold leading-[1.2] md:text-[18px] l-xxl:text-[24px] md-l:text-[20px] "})]}),(0,l.jsx)(i.Button,{disabled:y,variant:"primary",size:"lg",className:"mt-[8px] md:px-[8px] l:w-full",onClick:()=>{n(e),(0,u.gaTrack)({event:"ga4Event",event_name:"lp_button",member_active_status:r?.activated?"active":"not active",event_parameters:{page_group:v,position:t.title,button_name:g,info:e.alpc?.id?.toString()}})},children:g})]})]})]})}
|
|
2
|
-
//# sourceMappingURL=RedeemableItem.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../src/components/credits/creditsRedeemList/RedeemableItem.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Button, Text, Picture } from '@anker-in/headless-ui'\n\nimport { useMemo } from 'react'\n\nimport classNames from 'classnames'\nimport { useCreditsContext } from '../context/provider'\nimport type { RedeemableItem as RedeemableItemType } from '../type'\nimport { AlpcConsumeType, ConsumeType } from '../context/const'\nimport { numberFormat } from '../context/utils'\nimport type { CreditsRedeemListCopy } from './type'\nimport { gaTrack } from '../../../helpers/track'\n\nexport function RedeemableItem({\n copy,\n className,\n item,\n onRulesOpen,\n onRedeem,\n}: {\n copy: CreditsRedeemListCopy\n className?: string\n item: RedeemableItemType\n onRulesOpen: (rules: string[]) => void\n onRedeem: (item: RedeemableItemType) => void\n}) {\n const {\n creditInfo,\n profile,\n gtm: { pageGroup },\n } = useCreditsContext()\n const isLogin = Object.keys(profile || {}).length > 0\n\n const isDisabled = useMemo(() => {\n if (item.alpc?.remainingInventory <= 0 && item.alpc?.isLimited) {\n // \u6709\u5E93\u5B58\u9650\u5236\n return true\n }\n\n if (item.alpc?.consumeType === AlpcConsumeType.Product) {\n if (!item.variant?.availableForSale) {\n return true\n }\n }\n if (isLogin && profile?.activated && item.alpc?.consumeCredits > Number(creditInfo?.available_credit || 0)) {\n return true\n }\n return false\n }, [\n item.alpc?.remainingInventory,\n item.alpc?.isLimited,\n item.alpc?.consumeType,\n item.alpc?.consumeCredits,\n isLogin,\n profile?.activated,\n creditInfo?.available_credit,\n item.variant?.availableForSale,\n ])\n\n const redeemButtonText = useMemo(() => {\n if (!isLogin) {\n return copy.unlockRewards\n }\n\n // \u7F3A\u8D27\u6587\u6848\n if (item.alpc?.consumeType === AlpcConsumeType.Product) {\n return item.variant?.availableForSale ? copy.btnRedeem : copy?.soldOut || 'Sold Out'\n }\n return copy.btnRedeem\n }, [\n isLogin,\n item.alpc?.consumeType,\n item.variant?.availableForSale,\n copy.btnRedeem,\n copy.unlockRewards,\n copy?.soldOut,\n ])\n\n return (\n <div\n className={classNames(\n 'flex flex-col items-center rounded-[16px] bg-[#EAEAEC] p-[24px] md:rounded-[12px] md:px-[8px] xl:py-[16px] md-xl:px-[16px]',\n className\n )}\n >\n {item.config?.type !== ConsumeType.Product ? (\n <div className=\"relative mx-auto my-[30px] h-[164px] md:my-0 md:h-[66px] l-xxl:h-[138px] md-l:h-[80px]\">\n <Picture\n source={copy?.imageMapping[item.config?.type]?.url}\n className=\"h-full [&_img]:h-full [&_img]:w-auto [&_img]:object-contain\"\n ></Picture>\n <div className=\"absolute bottom-[8px] left-[16px] font-extrabold text-white md:bottom-[2px] md:left-[5px]\">\n {item.config?.value ? (\n <div className=\"flex items-end\">\n <Text\n className=\"text-[64px] font-bold leading-none md:text-[20px] l-xxl:text-[40px] md-l:text-[22px]\"\n html={item.config?.value}\n />\n <Text\n className=\"ml-[4px] text-[24px] font-bold leading-[2] md:ml-[2px] l:text-[12px] xxl:leading-[1.4] l-xxl:text-[20px]\"\n html={item.config?.type === ConsumeType.GiftCard ? copy?.giftCardLabel : copy?.off}\n />\n </div>\n ) : (\n <Text size={3} html={item.config?.title || item.alpc?.title} />\n )}\n </div>\n </div>\n ) : (\n <div className={classNames('relative mx-auto h-[224px] w-fit md:my-[10px] l:h-[120px] l-xxl:h-[138px]')}>\n <Picture\n className=\"h-full w-auto [&_img]:h-full [&_img]:object-contain\"\n source={item.config?.image?.url || item.product.images?.[0]?.url}\n ></Picture>\n </div>\n )}\n <div className={classNames('mt-[22px] flex w-full flex-1 flex-col justify-between')}>\n <Text\n html={item.config?.title || item.alpc?.title}\n title={item.config?.title || item.alpc?.title}\n size={2}\n className=\"text-[24px] font-bold leading-[1.2] l:text-[16px] l-xxl:text-[20px]\"\n />\n {item.config?.rules?.length > 0 && (\n <button\n type=\"button\"\n onClick={() => {\n onRulesOpen(item.config?.rules || [])\n gaTrack({\n event: 'ga4Event',\n event_name: 'lp_button',\n member_active_status: profile?.activated ? 'active' : 'not active',\n event_parameters: {\n page_group: pageGroup,\n position: copy.title,\n button_name: copy?.ruleLabel,\n info: item.alpc?.id?.toString(),\n },\n })\n }}\n className=\"mt-[8px] w-fit text-[16px] font-bold underline md:text-[14px] l:mt-0\"\n tabIndex={0}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n }\n }}\n >\n {copy?.ruleLabel}\n </button>\n )}\n <div>\n <div className=\"mt-[24px] flex items-center l:mt-[12px] l-xl:mt-[16px]\">\n <Picture\n className=\"size-[20px]\"\n source=\"https://cdn.shopify.com/s/files/1/0511/6346/3874/files/icon_hire_purchase.png?v=1757496783\"\n />\n <Text\n html={`${numberFormat(item.alpc?.consumeCredits)}`}\n size={2}\n as=\"p\"\n className=\"ml-[4px] text-[28px] font-bold leading-[1.2] md:text-[18px] l-xxl:text-[24px] md-l:text-[20px] \"\n />\n </div>\n\n <Button\n disabled={isDisabled}\n variant=\"primary\"\n size=\"lg\"\n className=\"mt-[8px] md:px-[8px] l:w-full\"\n onClick={() => {\n onRedeem(item)\n gaTrack({\n event: 'ga4Event',\n event_name: 'lp_button',\n member_active_status: profile?.activated ? 'active' : 'not active',\n event_parameters: {\n page_group: pageGroup,\n position: copy.title,\n button_name: redeemButtonText,\n info: item.alpc?.id?.toString(),\n },\n })\n }}\n >\n {redeemButtonText}\n </Button>\n </div>\n </div>\n </div>\n )\n}\n"],
|
|
5
|
-
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,oBAAAE,IAAA,eAAAC,EAAAH,GAsFU,IAAAI,EAAA,6BAtFVC,EAAsC,iCAEtCC,EAAwB,iBAExBC,EAAuB,yBACvBC,EAAkC,+BAElCC,EAA6C,4BAC7CC,EAA6B,4BAE7BC,EAAwB,kCAEjB,SAAST,EAAe,CAC7B,KAAAU,EACA,UAAAC,EACA,KAAAC,EACA,YAAAC,EACA,SAAAC,CACF,EAMG,CACD,KAAM,CACJ,WAAAC,EACA,QAAAC,EACA,IAAK,CAAE,UAAAC,CAAU,CACnB,KAAI,qBAAkB,EAChBC,EAAU,OAAO,KAAKF,GAAW,CAAC,CAAC,EAAE,OAAS,EAE9CG,KAAa,WAAQ,IACrB,GAAAP,EAAK,MAAM,oBAAsB,GAAKA,EAAK,MAAM,WAKjDA,EAAK,MAAM,cAAgB,kBAAgB,SACzC,CAACA,EAAK,SAAS,kBAIjBM,GAAWF,GAAS,WAAaJ,EAAK,MAAM,eAAiB,OAAOG,GAAY,kBAAoB,CAAC,GAIxG,CACDH,EAAK,MAAM,mBACXA,EAAK,MAAM,UACXA,EAAK,MAAM,YACXA,EAAK,MAAM,eACXM,EACAF,GAAS,UACTD,GAAY,iBACZH,EAAK,SAAS,gBAChB,CAAC,EAEKQ,KAAmB,WAAQ,IAC1BF,EAKDN,EAAK,MAAM,cAAgB,kBAAgB,QACtCA,EAAK,SAAS,iBAAmBF,EAAK,UAAYA,GAAM,SAAW,WAErEA,EAAK,UAPHA,EAAK,cAQb,CACDQ,EACAN,EAAK,MAAM,YACXA,EAAK,SAAS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,GAAK,EACVA,EAAE,MAAQ,SAAWA,EAAE,MAAQ,MACjCA,EAAE,eAAe,CAErB,EAEC,SAAAZ,GAAM,UACT,KAEF,QAAC,OACC,qBAAC,OAAI,UAAU,yDACb,oBAAC,WACC,UAAU,cACV,OAAO,6FACT,KACA,OAAC,QACC,KAAM,MAAG,gBAAaE,EAAK,MAAM,cAAc,CAAC,GAChD,KAAM,EACN,GAAG,IACH,UAAU,kGACZ,GACF,KAEA,OAAC,UACC,SAAUO,EACV,QAAQ,UACR,KAAK,KACL,UAAU,gCACV,QAAS,IAAM,CACbL,EAASF,CAAI,KACb,WAAQ,CACN,MAAO,WACP,WAAY,YACZ,qBAAsBI,GAAS,UAAY,SAAW,aACtD,iBAAkB,CAChB,WAAYC,EACZ,SAAUP,EAAK,MACf,YAAaU,EACb,KAAMR,EAAK,MAAM,IAAI,SAAS,CAChC,CACF,CAAC,CACH,EAEC,SAAAQ,EACH,GACF,GACF,GACF,CAEJ",
|
|
6
|
-
"names": ["RedeemableItem_exports", "__export", "RedeemableItem", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_react", "import_classnames", "import_provider", "import_const", "import_utils", "import_track", "copy", "className", "item", "onRulesOpen", "onRedeem", "creditInfo", "profile", "pageGroup", "isLogin", "isDisabled", "redeemButtonText", "classNames", "e"]
|
|
7
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { CreditsRedeemListCopy } from './type';
|
|
2
|
-
export declare function CreditsRedeemList({ copy, className, tabClassName, hideTitle, cardClassName, activate, }: {
|
|
3
|
-
copy: CreditsRedeemListCopy;
|
|
4
|
-
className?: string;
|
|
5
|
-
tabClassName?: string;
|
|
6
|
-
hideTitle?: boolean;
|
|
7
|
-
cardClassName?: string;
|
|
8
|
-
activate: {
|
|
9
|
-
openAuthCodePopup: () => void;
|
|
10
|
-
isSuccess: boolean;
|
|
11
|
-
setOnSuccess: (callback: Function) => void;
|
|
12
|
-
};
|
|
13
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var J=Object.create;var C=Object.defineProperty;var K=Object.getOwnPropertyDescriptor;var Q=Object.getOwnPropertyNames;var W=Object.getPrototypeOf,X=Object.prototype.hasOwnProperty;var Y=(e,t)=>{for(var a in t)C(e,a,{get:t[a],enumerable:!0})},S=(e,t,a,f)=>{if(t&&typeof t=="object"||typeof t=="function")for(let d of Q(t))!X.call(e,d)&&d!==a&&C(e,d,{get:()=>t[d],enumerable:!(f=K(t,d))||f.enumerable});return e};var g=(e,t,a)=>(a=e!=null?J(W(e)):{},S(t||!e||!e.__esModule?C(a,"default",{value:e,enumerable:!0}):a,e)),Z=e=>S(C({},"__esModule",{value:!0}),e);var ee={};Y(ee,{CreditsRedeemList:()=>$});module.exports=Z(ee);var n=require("react/jsx-runtime"),r=require("@anker-in/headless-ui"),R=g(require("classnames")),l=require("react"),E=g(require("./RedeemCouponModal")),O=g(require("./RedeemProductModal")),A=require("../context/provider"),M=g(require("../context/hooks/useRedeemableList")),u=require("../context/const"),F=require("@anker-in/shopify"),D=require("./RedeemableItem"),z=g(require("../modal/rulesModal")),H=require("../../../helpers/track");function $({copy:e,className:t="",tabClassName:a="",hideTitle:f=!1,cardClassName:d,activate:v}){const{profile:L,openSignUpPopup:j,gtm:{pageGroup:w}}=(0,A.useCreditsContext)(),B=Object.keys(L||{}).length>0,[T,G]=(0,l.useState)(e.list[0].label),[i,b]=(0,l.useState)(void 0),[h,N]=(0,l.useState)(),{listLoading:U,redeemableList:k,getRedeemableList:x}=(0,M.default)(),p=(0,l.useMemo)(()=>k.map(s=>({id:s.id.toString(),title:s.name,consumeCredits:s.consume_credits,remainingInventory:s.remaining_inventory,isLimited:!!s.is_limited,consumeType:s.consume_type,handle:s.sku_handle,sku:s.goods_sku,image:s.goods_url})),[e.list,T,k]),V=p.map(s=>s.handle),{data:_}=(0,F.useProductsByHandles)({handles:V}),q=(0,l.useMemo)(()=>e.list.find(o=>o.label===T)?.list.filter(o=>p.some(c=>c.id===o.id)).map(o=>{const c=p.find(m=>m.id===o.id),y=_?.find(m=>m.handle===c?.handle),P=y?.variants.find(m=>m.sku===c?.sku);return c?.consumeType===u.AlpcConsumeType.Product&&(!y||!P)?null:{alpc:p.find(m=>m.id===o.id),config:o,product:y,variant:P}}).filter(o=>o!==null),[p,_]),I=(0,l.useCallback)(s=>{s===u.AlpcErrorCode.CodeLpcRuleInventoryNotEnough&&x()},[x]);return console.log("popRedeemData",i),(0,n.jsxs)(r.Container,{className:(0,R.default)("relative bg-[#F5F5F7]",t),children:[!f&&(0,n.jsx)(r.Heading,{as:"h2",size:"4",html:e.title}),(0,n.jsx)(r.Tabs,{shape:"rounded",align:"left",className:(0,R.default)("sticky top-0 z-20 py-[24px] md:justify-center",a),value:T.toString(),onValueChange:s=>{G(s),(0,H.gaTrack)({event:"ga4Event",event_name:"lp_navigation",event_parameters:{navigation:s,page_group:w}})},children:(0,n.jsx)(r.TabsList,{children:e.list.map(s=>(0,n.jsx)(r.TabsTrigger,{value:s.label,children:s.label},s.label))})}),!!p?.length&&!U&&(0,n.jsx)("div",{className:(0,R.default)("relative grid grid-cols-4 gap-[16px] md:grid-cols-2 md:gap-[12px] md-xl:grid-cols-3"),children:q?.map(s=>(0,n.jsx)(D.RedeemableItem,{copy:e,item:s,onRedeem:o=>{B?!L?.activated&&!v.isSuccess?(v.openAuthCodePopup(),v.setOnSuccess(()=>{b(o)})):b(o):j()},onRulesOpen:N,className:d},s?.alpc?.id))}),i?.alpc?.consumeType===u.AlpcConsumeType.Coupon&&e?.redeemModal?.coupon&&i&&(0,n.jsx)(E.default,{isOpen:!!i,item:i,copy:e,onError:I,onClose:()=>{b(void 0)}}),i?.alpc?.consumeType===u.AlpcConsumeType.Product&&e?.redeemModal&&i&&(0,n.jsx)(O.default,{isOpen:!!i,item:i,copy:e,onError:I,onClose:()=>{b(void 0)}}),h&&(0,n.jsx)(z.default,{overlayClassName:"md:px-[16px] md:items-center",className:"md:h-fit md:rounded-b-[16px]",isOpen:h.length>0,onClose:()=>N([]),titleClassName:"border-b-transparent h-[56px]",rules:h,scrollClassName:"md:mt-[8px] md:mb-[24px] md:pt-0",title:e?.ruleLabel,ruleClassName:"text-[#1d1d1f] font-bold"})]})}
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../src/components/credits/creditsRedeemList/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Container, Heading, Tabs, TabsList, TabsTrigger } from '@anker-in/headless-ui'\nimport classNames from 'classnames'\nimport { useCallback, useMemo, useState } from 'react'\n\nimport RedeemCouponModal from './RedeemCouponModal'\nimport RedeemProductModal from './RedeemProductModal'\nimport { useCreditsContext } from '../context/provider'\nimport useRedeemableList from '../context/hooks/useRedeemableList'\nimport { AlpcConsumeType, AlpcErrorCode } from '../context/const'\nimport { useProductsByHandles } from '@anker-in/shopify'\nimport type { RedeemableItem as RedeemableItemType } from '../type'\nimport { RedeemableItem } from './RedeemableItem'\nimport RulesModal from '../modal/rulesModal'\nimport { CreditsRedeemListCopy } from './type'\nimport { gaTrack } from '../../../helpers/track'\n\nexport function CreditsRedeemList({\n copy,\n className = '',\n tabClassName = '',\n hideTitle = false,\n cardClassName,\n activate,\n}: {\n copy: CreditsRedeemListCopy\n className?: string\n tabClassName?: string\n hideTitle?: boolean\n cardClassName?: string\n activate: {\n openAuthCodePopup: () => void\n isSuccess: boolean\n setOnSuccess: (callback: Function) => void\n }\n}) {\n const {\n profile,\n openSignUpPopup,\n gtm: { pageGroup },\n } = useCreditsContext()\n const isLogin = Object.keys(profile || {}).length > 0\n\n const [activeTab, setActiveTab] = useState<string>(copy.list[0].label)\n\n const [popRedeemData, setPopRedeemData] = useState<RedeemableItemType | undefined>(undefined)\n\n const [rules, setRules] = useState<string | string[]>()\n\n const { listLoading, redeemableList, getRedeemableList } = useRedeemableList()\n\n const alpcList = useMemo(() => {\n return redeemableList.map(item => {\n return {\n id: item.id.toString(),\n title: item.name,\n consumeCredits: item.consume_credits,\n remainingInventory: item.remaining_inventory,\n isLimited: !!item.is_limited,\n consumeType: item.consume_type,\n handle: item.sku_handle,\n sku: item.goods_sku,\n image: item.goods_url,\n }\n })\n }, [copy.list, activeTab, redeemableList])\n\n const handles = alpcList.map(item => item.handle)\n const { data: products } = useProductsByHandles({ handles })\n\n const list = useMemo(() => {\n const currentList = copy.list.find(item => item.label === activeTab)\n return currentList?.list\n .filter(item => alpcList.some(alpcItem => alpcItem.id === item.id))\n .map(item => {\n const alpcItem = alpcList.find(alpcItem => alpcItem.id === item.id)\n const product = products?.find(product => product.handle === alpcItem?.handle)\n const variant = product?.variants.find(variant => variant.sku === alpcItem?.sku)\n if (alpcItem?.consumeType === AlpcConsumeType.Product && (!product || !variant)) return null\n return {\n alpc: alpcList.find(alpcItem => alpcItem.id === item.id),\n config: item,\n product,\n variant,\n }\n })\n .filter(item => item !== null) as unknown as RedeemableItemType[]\n }, [alpcList, products])\n\n const handleRedeemError = useCallback(\n (errorCode: AlpcErrorCode) => {\n if (errorCode === AlpcErrorCode.CodeLpcRuleInventoryNotEnough) {\n getRedeemableList()\n }\n },\n [getRedeemableList]\n )\n\n console.log('popRedeemData', popRedeemData)\n\n return (\n <Container className={classNames('relative bg-[#F5F5F7]', className)}>\n {!hideTitle && <Heading as=\"h2\" size=\"4\" html={copy.title} />}\n\n <Tabs\n shape=\"rounded\"\n align=\"left\"\n className={classNames('sticky top-0 z-20 py-[24px] md:justify-center', tabClassName)}\n value={activeTab.toString()}\n onValueChange={value => {\n setActiveTab(value)\n gaTrack({\n event: 'ga4Event',\n event_name: 'lp_navigation',\n event_parameters: {\n navigation: value,\n page_group: pageGroup,\n },\n })\n }}\n >\n <TabsList>\n {copy.list.map(item => (\n <TabsTrigger key={item.label} value={item.label}>\n {item.label}\n </TabsTrigger>\n ))}\n </TabsList>\n </Tabs>\n {/* PC\u7AEF */}\n {!!alpcList?.length && !listLoading && (\n <div\n className={classNames('relative grid grid-cols-4 gap-[16px] md:grid-cols-2 md:gap-[12px] md-xl:grid-cols-3')}\n >\n {list?.map(item => (\n <RedeemableItem\n key={item?.alpc?.id}\n copy={copy}\n item={item}\n onRedeem={(item: RedeemableItemType) => {\n if (!isLogin) {\n openSignUpPopup()\n } else if (!profile?.activated && !activate.isSuccess) {\n activate.openAuthCodePopup()\n activate.setOnSuccess(() => {\n setPopRedeemData(item)\n })\n } else {\n setPopRedeemData(item)\n }\n }}\n onRulesOpen={setRules}\n className={cardClassName}\n />\n ))}\n </div>\n )}\n\n {popRedeemData?.alpc?.consumeType === AlpcConsumeType.Coupon && copy?.redeemModal?.coupon && popRedeemData && (\n <RedeemCouponModal\n isOpen={!!popRedeemData}\n item={popRedeemData}\n copy={copy}\n onError={handleRedeemError}\n onClose={() => {\n setPopRedeemData(undefined)\n }}\n />\n )}\n {popRedeemData?.alpc?.consumeType === AlpcConsumeType.Product && copy?.redeemModal && popRedeemData && (\n <RedeemProductModal\n isOpen={!!popRedeemData}\n item={popRedeemData}\n copy={copy}\n onError={handleRedeemError}\n onClose={() => {\n setPopRedeemData(undefined)\n }}\n />\n )}\n {rules && (\n <RulesModal\n overlayClassName=\"md:px-[16px] md:items-center\"\n className=\"md:h-fit md:rounded-b-[16px]\"\n isOpen={rules.length > 0}\n onClose={() => setRules([])}\n titleClassName=\"border-b-transparent h-[56px]\"\n rules={rules}\n scrollClassName=\"md:mt-[8px] md:mb-[24px] md:pt-0\"\n title={copy?.ruleLabel}\n ruleClassName=\"text-[#1d1d1f] font-bold\"\n />\n )}\n </Container>\n )\n}\n"],
|
|
5
|
-
"mappings": "0jBAAA,IAAAA,GAAA,GAAAC,EAAAD,GAAA,uBAAAE,IAAA,eAAAC,EAAAH,IAoGI,IAAAI,EAAA,6BApGJC,EAAgE,iCAChEC,EAAuB,yBACvBC,EAA+C,iBAE/CC,EAA8B,kCAC9BC,EAA+B,mCAC/BC,EA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AEM,CAACH,GAAS,WAAa,CAACD,EAAS,WAC1CA,EAAS,kBAAkB,EAC3BA,EAAS,aAAa,IAAM,CAC1BQ,EAAiBQ,CAAI,CACvB,CAAC,GAEDR,EAAiBQ,CAAI,EAPrBd,EAAgB,CASpB,EACA,YAAaQ,EACb,UAAWX,GAhBNiB,GAAM,MAAM,EAiBnB,CACD,EACH,EAGDT,GAAe,MAAM,cAAgB,kBAAgB,QAAUZ,GAAM,aAAa,QAAUY,MAC3F,OAAC,EAAAoB,QAAA,CACC,OAAQ,CAAC,CAACpB,EACV,KAAMA,EACN,KAAMZ,EACN,QAAS4B,EACT,QAAS,IAAM,CACbf,EAAiB,MAAS,CAC5B,EACF,EAEDD,GAAe,MAAM,cAAgB,kBAAgB,SAAWZ,GAAM,aAAeY,MACpF,OAAC,EAAAqB,QAAA,CACC,OAAQ,CAAC,CAACrB,EACV,KAAMA,EACN,KAAMZ,EACN,QAAS4B,EACT,QAAS,IAAM,CACbf,EAAiB,MAAS,CAC5B,EACF,EAEDC,MACC,OAAC,EAAAoB,QAAA,CACC,iBAAiB,+BACjB,UAAU,+BACV,OAAQpB,EAAM,OAAS,EACvB,QAAS,IAAMC,EAAS,CAAC,CAAC,EAC1B,eAAe,gCACf,MAAOD,EACP,gBAAgB,mCAChB,MAAOd,GAAM,UACb,cAAc,2BAChB,GAEJ,CAEJ",
|
|
6
|
-
"names": ["creditsRedeemList_exports", "__export", "CreditsRedeemList", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_classnames", "import_react", "import_RedeemCouponModal", "import_RedeemProductModal", "import_provider", "import_useRedeemableList", "import_const", "import_shopify", "import_RedeemableItem", "import_rulesModal", "import_track", "copy", "className", "tabClassName", "hideTitle", "cardClassName", "activate", "profile", "openSignUpPopup", "pageGroup", "isLogin", "activeTab", "setActiveTab", "popRedeemData", "setPopRedeemData", "rules", "setRules", "listLoading", "redeemableList", "getRedeemableList", "useRedeemableList", "alpcList", "item", "handles", "products", "list", "alpcItem", "product", "variant", "handleRedeemError", "errorCode", "classNames", "value", "RedeemCouponModal", "RedeemProductModal", "RulesModal"]
|
|
7
|
-
}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { CreditsPageCommon } from '../type';
|
|
2
|
-
export type CreditsRedeemListCopy = {
|
|
3
|
-
title: string;
|
|
4
|
-
giftCardLabel: string;
|
|
5
|
-
unlockRewards: string;
|
|
6
|
-
btnRedeem: string;
|
|
7
|
-
list: {
|
|
8
|
-
label: string;
|
|
9
|
-
list: {
|
|
10
|
-
id: string;
|
|
11
|
-
type: string;
|
|
12
|
-
value: string;
|
|
13
|
-
rules: string[];
|
|
14
|
-
}[];
|
|
15
|
-
}[];
|
|
16
|
-
validatorInfo: {
|
|
17
|
-
addressInfo: {
|
|
18
|
-
name: string;
|
|
19
|
-
country: string;
|
|
20
|
-
province: string;
|
|
21
|
-
city: string;
|
|
22
|
-
address: string;
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
redeemModal: {
|
|
26
|
-
confirmTitle: string;
|
|
27
|
-
confirmButton: string;
|
|
28
|
-
commonError: string;
|
|
29
|
-
redeemLimitError: string;
|
|
30
|
-
inventoryNotEnough: string;
|
|
31
|
-
creditsNotEnough: string;
|
|
32
|
-
crossSiteError: string;
|
|
33
|
-
errorImageUrl: string;
|
|
34
|
-
coupon: {
|
|
35
|
-
successDesc: string;
|
|
36
|
-
successTitle: string;
|
|
37
|
-
successButton: string;
|
|
38
|
-
successButtonUrl: string;
|
|
39
|
-
};
|
|
40
|
-
product: {
|
|
41
|
-
required: string;
|
|
42
|
-
invalidEmail: string;
|
|
43
|
-
shippingAddress: string;
|
|
44
|
-
shippingProduct: string;
|
|
45
|
-
addressForm: {
|
|
46
|
-
key: string;
|
|
47
|
-
type: string;
|
|
48
|
-
label: string;
|
|
49
|
-
isSelect: boolean;
|
|
50
|
-
required: boolean;
|
|
51
|
-
placeholder: string;
|
|
52
|
-
}[][];
|
|
53
|
-
form: {
|
|
54
|
-
key: string;
|
|
55
|
-
type: string;
|
|
56
|
-
isSelect: boolean;
|
|
57
|
-
required: boolean;
|
|
58
|
-
placeholder: string;
|
|
59
|
-
}[][];
|
|
60
|
-
successDesc: string[];
|
|
61
|
-
rules: string[];
|
|
62
|
-
steps: {
|
|
63
|
-
imageUrl: string;
|
|
64
|
-
title: string;
|
|
65
|
-
}[];
|
|
66
|
-
quantityLabel: string;
|
|
67
|
-
totalPriceLabel: string;
|
|
68
|
-
variantLabel: string;
|
|
69
|
-
shippingFeeLabel: string;
|
|
70
|
-
paymentButton: string;
|
|
71
|
-
stepTitle: string;
|
|
72
|
-
};
|
|
73
|
-
};
|
|
74
|
-
copied: string;
|
|
75
|
-
off: string;
|
|
76
|
-
copy: string;
|
|
77
|
-
} & CreditsPageCommon;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var e=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var o=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var a=(t,r,n,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of o(r))!l.call(t,s)&&s!==n&&e(t,s,{get:()=>r[s],enumerable:!(i=g(r,s))||i.enumerable});return t};var c=t=>a(e({},"__esModule",{value:!0}),t);var d={};module.exports=c(d);
|
|
2
|
-
//# sourceMappingURL=type.js.map
|