@anker-in/campaign-ui 0.5.21 → 0.5.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/credits/context/hooks/useCountries.d.ts +2 -1
- package/dist/cjs/components/credits/context/hooks/useCountries.js +1 -1
- package/dist/cjs/components/credits/context/hooks/useCountries.js.map +3 -3
- package/dist/cjs/components/credits/context/hooks/useShippingCountries.d.ts +2 -1
- package/dist/cjs/components/credits/context/hooks/useShippingCountries.js +1 -1
- package/dist/cjs/components/credits/context/hooks/useShippingCountries.js.map +3 -3
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.js +1 -1
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.js.map +3 -3
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.js +1 -1
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.js.map +3 -3
- package/dist/cjs/components/memberPopup/context/provider.js +1 -1
- package/dist/cjs/components/memberPopup/context/provider.js.map +2 -2
- package/dist/cjs/components/memberPopup/panels/ActivitiesSubscribePanel.js +1 -1
- package/dist/cjs/components/memberPopup/panels/ActivitiesSubscribePanel.js.map +3 -3
- package/dist/cjs/components/memberPopup/panels/EarnCredits/ActivatePanel.js +1 -1
- package/dist/cjs/components/memberPopup/panels/EarnCredits/ActivatePanel.js.map +3 -3
- package/dist/cjs/components/memberPopup/panels/EarnCredits/CompleteProfilePanel.js +1 -1
- package/dist/cjs/components/memberPopup/panels/EarnCredits/CompleteProfilePanel.js.map +2 -2
- package/dist/cjs/components/memberPopup/panels/EarnCredits/hooks/useUpdateProfile.d.ts +2 -1
- package/dist/cjs/components/memberPopup/panels/EarnCredits/hooks/useUpdateProfile.js +1 -1
- package/dist/cjs/components/memberPopup/panels/EarnCredits/hooks/useUpdateProfile.js.map +3 -3
- package/dist/cjs/components/memberPopup/panels/Referral/hooks/useReferralOverview.js +1 -1
- package/dist/cjs/components/memberPopup/panels/Referral/hooks/useReferralOverview.js.map +2 -2
- package/dist/cjs/components/registration/authCodeActivate/index.js +1 -1
- package/dist/cjs/components/registration/authCodeActivate/index.js.map +3 -3
- package/dist/cjs/components/registration/context/provider.d.ts +3 -1
- package/dist/cjs/components/registration/context/provider.js +1 -1
- package/dist/cjs/components/registration/context/provider.js.map +3 -3
- package/dist/cjs/lib/registration/hooks/useEmailValidation.d.ts +1 -1
- package/dist/cjs/lib/registration/hooks/useEmailValidation.js +1 -1
- package/dist/cjs/lib/registration/hooks/useEmailValidation.js.map +3 -3
- package/dist/cjs/lib/registration/hooks/useSendEmailValidation.d.ts +1 -1
- package/dist/cjs/lib/registration/hooks/useSendEmailValidation.js +1 -1
- package/dist/cjs/lib/registration/hooks/useSendEmailValidation.js.map +3 -3
- package/dist/cjs/lib/utils/fetcher/fetcher.d.ts +1 -1
- package/dist/cjs/lib/utils/fetcher/fetcher.js +1 -1
- package/dist/cjs/lib/utils/fetcher/fetcher.js.map +3 -3
- package/dist/cjs/templates/Credits.js +1 -1
- package/dist/cjs/templates/Credits.js.map +2 -2
- package/dist/esm/components/credits/context/hooks/useCountries.d.ts +2 -1
- package/dist/esm/components/credits/context/hooks/useCountries.js +1 -1
- package/dist/esm/components/credits/context/hooks/useCountries.js.map +3 -3
- package/dist/esm/components/credits/context/hooks/useShippingCountries.d.ts +2 -1
- package/dist/esm/components/credits/context/hooks/useShippingCountries.js +1 -1
- package/dist/esm/components/credits/context/hooks/useShippingCountries.js.map +3 -3
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.js +1 -1
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.js.map +3 -3
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.js +1 -1
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.js.map +3 -3
- package/dist/esm/components/memberPopup/context/provider.js +1 -1
- package/dist/esm/components/memberPopup/context/provider.js.map +2 -2
- package/dist/esm/components/memberPopup/panels/ActivitiesSubscribePanel.js +1 -1
- package/dist/esm/components/memberPopup/panels/ActivitiesSubscribePanel.js.map +3 -3
- package/dist/esm/components/memberPopup/panels/EarnCredits/ActivatePanel.js +1 -1
- package/dist/esm/components/memberPopup/panels/EarnCredits/ActivatePanel.js.map +3 -3
- package/dist/esm/components/memberPopup/panels/EarnCredits/CompleteProfilePanel.js +1 -1
- package/dist/esm/components/memberPopup/panels/EarnCredits/CompleteProfilePanel.js.map +2 -2
- package/dist/esm/components/memberPopup/panels/EarnCredits/hooks/useUpdateProfile.d.ts +2 -1
- package/dist/esm/components/memberPopup/panels/EarnCredits/hooks/useUpdateProfile.js +1 -1
- package/dist/esm/components/memberPopup/panels/EarnCredits/hooks/useUpdateProfile.js.map +3 -3
- package/dist/esm/components/memberPopup/panels/Referral/hooks/useReferralOverview.js +1 -1
- package/dist/esm/components/memberPopup/panels/Referral/hooks/useReferralOverview.js.map +2 -2
- package/dist/esm/components/registration/authCodeActivate/index.js +1 -1
- package/dist/esm/components/registration/authCodeActivate/index.js.map +3 -3
- package/dist/esm/components/registration/context/provider.d.ts +3 -1
- package/dist/esm/components/registration/context/provider.js +1 -1
- package/dist/esm/components/registration/context/provider.js.map +3 -3
- package/dist/esm/lib/registration/hooks/useEmailValidation.d.ts +1 -1
- package/dist/esm/lib/registration/hooks/useEmailValidation.js +1 -1
- package/dist/esm/lib/registration/hooks/useEmailValidation.js.map +3 -3
- package/dist/esm/lib/registration/hooks/useSendEmailValidation.d.ts +1 -1
- package/dist/esm/lib/registration/hooks/useSendEmailValidation.js +1 -1
- package/dist/esm/lib/registration/hooks/useSendEmailValidation.js.map +3 -3
- package/dist/esm/lib/utils/fetcher/fetcher.d.ts +1 -1
- package/dist/esm/lib/utils/fetcher/fetcher.js +1 -1
- package/dist/esm/lib/utils/fetcher/fetcher.js.map +3 -3
- package/dist/esm/templates/Credits.js +1 -1
- package/dist/esm/templates/Credits.js.map +2 -2
- package/package.json +1 -1
- package/src/components/credits/context/hooks/useCountries.ts +3 -3
- package/src/components/credits/context/hooks/useShippingCountries.ts +17 -8
- package/src/components/credits/creditsRedeemList/RedeemProductModal/Address.tsx +3 -1
- package/src/components/credits/creditsRedeemList/RedeemProductModal/index.tsx +2 -2
- package/src/components/memberPopup/context/provider.tsx +1 -0
- package/src/components/memberPopup/panels/ActivitiesSubscribePanel.tsx +3 -3
- package/src/components/memberPopup/panels/EarnCredits/ActivatePanel.tsx +3 -3
- package/src/components/memberPopup/panels/EarnCredits/CompleteProfilePanel.tsx +2 -2
- package/src/components/memberPopup/panels/EarnCredits/hooks/useUpdateProfile.ts +4 -3
- package/src/components/memberPopup/panels/Referral/hooks/useReferralOverview.ts +1 -1
- package/src/components/registration/authCodeActivate/index.tsx +3 -3
- package/src/components/registration/context/provider.tsx +8 -1
- package/src/lib/registration/hooks/useEmailValidation.ts +3 -1
- package/src/lib/registration/hooks/useSendEmailValidation.ts +2 -1
- package/src/lib/utils/fetcher/fetcher.ts +2 -1
- package/src/templates/Credits.tsx +5 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../src/components/memberPopup/panels/EarnCredits/CompleteProfilePanel.tsx"],
|
|
4
|
-
"sourcesContent": ["import { useCallback, useEffect, useState } from 'react'\nimport { Button, Text } from '@anker-in/headless-ui'\nimport { gaTrack, classNames as cn, useHeadlessContext } from '../../../../lib'\nimport type { CompleteProfileCopy } from '../../type'\nimport { useUpdateProfile } from './hooks/useUpdateProfile'\nimport useCountries from '../../../credits/context/hooks/useCountries'\nimport { useMemberPopupContext } from '../../context/provider'\nimport { ROUNDED_BRANDS } from '../../../../constants'\n\ntype Props = {\n copy: CompleteProfileCopy\n onClose: () => void\n}\n\nexport default function CompleteProfilePanel({ copy, onClose }: Props) {\n const { profile, fetchCreditInfo, alpcConfig, setIsProfileCompleteSuccess } = useMemberPopupContext()\n const { locale } = alpcConfig\n const { brand, storeDomain } = useHeadlessContext()\n const rounded = ROUNDED_BRANDS.includes(brand)\n\n const [firstName, setFirstName] = useState('')\n const [lastName, setLastName] = useState('')\n const [phone, setPhone] = useState('')\n const [birthDay, setBirthDay] = useState('')\n const [country, setCountry] = useState('')\n const [firstNameError, setFirstNameError] = useState('')\n const [lastNameError, setLastNameError] = useState('')\n\n const { updateProfile, isLoading } = useUpdateProfile({ locale, appName: alpcConfig.appName })\n const { countries } = useCountries({ shopifyStoreDomain: storeDomain })\n\n useEffect(() => {\n if (profile) {\n setFirstName(profile.first_name ?? '')\n setLastName(profile.last_name ?? '')\n setPhone(profile.phone_number ?? '')\n setBirthDay(profile.dob ?? '')\n setCountry(profile.country?.id ?? '')\n }\n }, [profile])\n\n useEffect(() => {\n if (countries.length > 0 && !country) {\n setCountry(countries[0].id)\n }\n }, [countries])\n\n const validate = useCallback(() => {\n let hasError = false\n if (!firstName.trim()) {\n setFirstNameError(copy.required)\n hasError = true\n } else {\n setFirstNameError('')\n }\n if (!lastName.trim()) {\n setLastNameError(copy.required)\n hasError = true\n } else {\n setLastNameError('')\n }\n return hasError\n }, [firstName, lastName, copy.required])\n\n const handleSubmit = useCallback(async () => {\n if (validate()) return\n const success = await updateProfile({\n first_name: firstName.trim(),\n last_name: lastName.trim(),\n phone_number: phone,\n country,\n dob: birthDay,\n })\n if (success) {\n setTimeout(() => fetchCreditInfo(profile?.user_id), 3000)\n setIsProfileCompleteSuccess(true)\n gaTrack({\n event: 'ga4Event',\n event_name: 'lp_button',\n event_parameters: {\n position: 'earn_credits',\n button_name: 'complete_profile_success',\n info: 'Member Floating Window',\n },\n })\n onClose()\n }\n }, [\n validate,\n updateProfile,\n firstName,\n lastName,\n phone,\n country,\n birthDay,\n fetchCreditInfo,\n profile,\n setIsProfileCompleteSuccess,\n onClose,\n ])\n\n return (\n <div className=\"flex flex-col gap-[16px]\">\n {copy.subtitle && <Text className=\"text-[14px] text-[#1d1d1f]\" html={copy.subtitle} />}\n\n <div>\n <label className=\"block text-[14px] font-[700] text-[#1d1d1f]\">{copy.email}</label>\n <input\n className={cn(\n 'mt-[8px] h-[46px] w-full border border-[#d8d8d8] bg-[#f5f5f5] px-[12px] text-[14px] text-[#999]',\n rounded ? 'rounded-[4px]' : 'rounded-none'\n )}\n value={profile?.email ?? ''}\n disabled\n />\n </div>\n\n <div>\n <label className=\"block text-[14px] font-[700] text-[#1d1d1f]\">\n {copy.firstName} <span className=\"text-[#f84d4f]\">*</span>\n </label>\n <input\n className={cn(\n 'mt-[8px] h-[46px] w-full border px-[12px] text-[14px] outline-none',\n firstNameError ? 'border-[#f84d4f]' : 'border-[#d8d8d8]',\n rounded ? 'rounded-[4px]' : 'rounded-none'\n )}\n value={firstName}\n onChange={e => {\n setFirstName(e.target.value)\n setFirstNameError('')\n }}\n />\n {firstNameError && <Text className=\"mt-[4px] text-[12px] text-[#f84d4f]\" html={firstNameError} />}\n </div>\n\n <div>\n <label className=\"block text-[14px] font-[700] text-[#1d1d1f]\">\n {copy.lastName} <span className=\"text-[#f84d4f]\">*</span>\n </label>\n <input\n className={cn(\n 'mt-[8px] h-[46px] w-full border px-[12px] text-[14px] outline-none',\n lastNameError ? 'border-[#f84d4f]' : 'border-[#d8d8d8]',\n rounded ? 'rounded-[4px]' : 'rounded-none'\n )}\n value={lastName}\n onChange={e => {\n setLastName(e.target.value)\n setLastNameError('')\n }}\n />\n {lastNameError && <Text className=\"mt-[4px] text-[12px] text-[#f84d4f]\" html={lastNameError} />}\n </div>\n\n <div>\n <label className=\"block text-[14px] font-[700] text-[#1d1d1f]\">{copy.birthday}</label>\n <input\n className={cn(\n 'mt-[8px] h-[46px] w-full border border-[#d8d8d8] px-[12px] text-[14px] outline-none',\n rounded ? 'rounded-[4px]' : 'rounded-none'\n )}\n type=\"date\"\n value={birthDay}\n onChange={e => setBirthDay(e.target.value)}\n />\n </div>\n\n <div>\n <label className=\"block text-[14px] font-[700] text-[#1d1d1f]\">{copy.phone}</label>\n <input\n className={cn(\n 'mt-[8px] h-[46px] w-full border border-[#d8d8d8] px-[12px] text-[14px] outline-none',\n rounded ? 'rounded-[4px]' : 'rounded-none'\n )}\n value={phone}\n onChange={e => setPhone(e.target.value)}\n />\n </div>\n\n <div>\n <label className=\"block text-[14px] font-[700] text-[#1d1d1f]\">{copy.country}</label>\n <select\n className={cn(\n 'mt-[8px] h-[46px] w-full border border-[#d8d8d8] px-[12px] text-[14px] outline-none',\n rounded ? 'rounded-[4px]' : 'rounded-none'\n )}\n value={country}\n onChange={e => setCountry(e.target.value)}\n >\n {countries.map((c: { id: string; name: string }) => (\n <option key={c.id} value={c.id}>\n {c.name}\n </option>\n ))}\n </select>\n </div>\n\n <div className=\"flex gap-[12px]\">\n <Button variant=\"secondary\" size=\"base\" className=\"flex-1\" onClick={onClose} disabled={isLoading}>\n {copy.cancel}\n </Button>\n <Button variant=\"primary\" size=\"base\" className=\"flex-1\" loading={isLoading} onClick={handleSubmit}>\n {copy.save}\n </Button>\n </div>\n </div>\n )\n}\n"],
|
|
5
|
-
"mappings": "AAuGwB,cAAAA,EAElB,QAAAC,MAFkB,oBAvGxB,OAAS,eAAAC,EAAa,aAAAC,EAAW,YAAAC,MAAgB,QACjD,OAAS,UAAAC,EAAQ,QAAAC,MAAY,wBAC7B,OAAS,WAAAC,EAAS,cAAcC,EAAI,sBAAAC,MAA0B,kBAE9D,OAAS,oBAAAC,MAAwB,2BACjC,OAAOC,MAAkB,8CACzB,OAAS,yBAAAC,MAA6B,yBACtC,OAAS,kBAAAC,MAAsB,wBAOhB,SAARC,EAAsC,CAAE,KAAAC,EAAM,QAAAC,CAAQ,EAAU,CACrE,KAAM,CAAE,QAAAC,EAAS,gBAAAC,EAAiB,WAAAC,EAAY,4BAAAC,CAA4B,EAAIR,EAAsB,EAC9F,CAAE,OAAAS,CAAO,EAAIF,EACb,CAAE,MAAAG,EAAO,YAAAC,CAAY,EAAId,EAAmB,EAC5Ce,EAAUX,EAAe,SAASS,CAAK,EAEvC,CAACG,EAAWC,CAAY,EAAItB,EAAS,EAAE,EACvC,CAACuB,EAAUC,CAAW,EAAIxB,EAAS,EAAE,EACrC,CAACyB,EAAOC,CAAQ,EAAI1B,EAAS,EAAE,EAC/B,CAAC2B,EAAUC,CAAW,EAAI5B,EAAS,EAAE,EACrC,CAAC6B,EAASC,CAAU,EAAI9B,EAAS,EAAE,EACnC,CAAC+B,EAAgBC,CAAiB,EAAIhC,EAAS,EAAE,EACjD,CAACiC,EAAeC,CAAgB,EAAIlC,EAAS,EAAE,EAE/C,CAAE,cAAAmC,EAAe,UAAAC,CAAU,EAAI9B,EAAiB,CAAE,OAAAW,EAAQ,QAASF,EAAW,
|
|
4
|
+
"sourcesContent": ["import { useCallback, useEffect, useState } from 'react'\nimport { Button, Text } from '@anker-in/headless-ui'\nimport { gaTrack, classNames as cn, useHeadlessContext } from '../../../../lib'\nimport type { CompleteProfileCopy } from '../../type'\nimport { useUpdateProfile } from './hooks/useUpdateProfile'\nimport useCountries from '../../../credits/context/hooks/useCountries'\nimport { useMemberPopupContext } from '../../context/provider'\nimport { ROUNDED_BRANDS } from '../../../../constants'\n\ntype Props = {\n copy: CompleteProfileCopy\n onClose: () => void\n}\n\nexport default function CompleteProfilePanel({ copy, onClose }: Props) {\n const { profile, fetchCreditInfo, alpcConfig, setIsProfileCompleteSuccess } = useMemberPopupContext()\n const { locale } = alpcConfig\n const { brand, storeDomain } = useHeadlessContext()\n const rounded = ROUNDED_BRANDS.includes(brand)\n\n const [firstName, setFirstName] = useState('')\n const [lastName, setLastName] = useState('')\n const [phone, setPhone] = useState('')\n const [birthDay, setBirthDay] = useState('')\n const [country, setCountry] = useState('')\n const [firstNameError, setFirstNameError] = useState('')\n const [lastNameError, setLastNameError] = useState('')\n\n const { updateProfile, isLoading } = useUpdateProfile({ locale, appName: alpcConfig.appName, apiBaseUrl: alpcConfig.apiBaseUrl })\n const { countries } = useCountries({ shopifyStoreDomain: storeDomain, apiBaseUrl: alpcConfig.apiBaseUrl })\n\n useEffect(() => {\n if (profile) {\n setFirstName(profile.first_name ?? '')\n setLastName(profile.last_name ?? '')\n setPhone(profile.phone_number ?? '')\n setBirthDay(profile.dob ?? '')\n setCountry(profile.country?.id ?? '')\n }\n }, [profile])\n\n useEffect(() => {\n if (countries.length > 0 && !country) {\n setCountry(countries[0].id)\n }\n }, [countries])\n\n const validate = useCallback(() => {\n let hasError = false\n if (!firstName.trim()) {\n setFirstNameError(copy.required)\n hasError = true\n } else {\n setFirstNameError('')\n }\n if (!lastName.trim()) {\n setLastNameError(copy.required)\n hasError = true\n } else {\n setLastNameError('')\n }\n return hasError\n }, [firstName, lastName, copy.required])\n\n const handleSubmit = useCallback(async () => {\n if (validate()) return\n const success = await updateProfile({\n first_name: firstName.trim(),\n last_name: lastName.trim(),\n phone_number: phone,\n country,\n dob: birthDay,\n })\n if (success) {\n setTimeout(() => fetchCreditInfo(profile?.user_id), 3000)\n setIsProfileCompleteSuccess(true)\n gaTrack({\n event: 'ga4Event',\n event_name: 'lp_button',\n event_parameters: {\n position: 'earn_credits',\n button_name: 'complete_profile_success',\n info: 'Member Floating Window',\n },\n })\n onClose()\n }\n }, [\n validate,\n updateProfile,\n firstName,\n lastName,\n phone,\n country,\n birthDay,\n fetchCreditInfo,\n profile,\n setIsProfileCompleteSuccess,\n onClose,\n ])\n\n return (\n <div className=\"flex flex-col gap-[16px]\">\n {copy.subtitle && <Text className=\"text-[14px] text-[#1d1d1f]\" html={copy.subtitle} />}\n\n <div>\n <label className=\"block text-[14px] font-[700] text-[#1d1d1f]\">{copy.email}</label>\n <input\n className={cn(\n 'mt-[8px] h-[46px] w-full border border-[#d8d8d8] bg-[#f5f5f5] px-[12px] text-[14px] text-[#999]',\n rounded ? 'rounded-[4px]' : 'rounded-none'\n )}\n value={profile?.email ?? ''}\n disabled\n />\n </div>\n\n <div>\n <label className=\"block text-[14px] font-[700] text-[#1d1d1f]\">\n {copy.firstName} <span className=\"text-[#f84d4f]\">*</span>\n </label>\n <input\n className={cn(\n 'mt-[8px] h-[46px] w-full border px-[12px] text-[14px] outline-none',\n firstNameError ? 'border-[#f84d4f]' : 'border-[#d8d8d8]',\n rounded ? 'rounded-[4px]' : 'rounded-none'\n )}\n value={firstName}\n onChange={e => {\n setFirstName(e.target.value)\n setFirstNameError('')\n }}\n />\n {firstNameError && <Text className=\"mt-[4px] text-[12px] text-[#f84d4f]\" html={firstNameError} />}\n </div>\n\n <div>\n <label className=\"block text-[14px] font-[700] text-[#1d1d1f]\">\n {copy.lastName} <span className=\"text-[#f84d4f]\">*</span>\n </label>\n <input\n className={cn(\n 'mt-[8px] h-[46px] w-full border px-[12px] text-[14px] outline-none',\n lastNameError ? 'border-[#f84d4f]' : 'border-[#d8d8d8]',\n rounded ? 'rounded-[4px]' : 'rounded-none'\n )}\n value={lastName}\n onChange={e => {\n setLastName(e.target.value)\n setLastNameError('')\n }}\n />\n {lastNameError && <Text className=\"mt-[4px] text-[12px] text-[#f84d4f]\" html={lastNameError} />}\n </div>\n\n <div>\n <label className=\"block text-[14px] font-[700] text-[#1d1d1f]\">{copy.birthday}</label>\n <input\n className={cn(\n 'mt-[8px] h-[46px] w-full border border-[#d8d8d8] px-[12px] text-[14px] outline-none',\n rounded ? 'rounded-[4px]' : 'rounded-none'\n )}\n type=\"date\"\n value={birthDay}\n onChange={e => setBirthDay(e.target.value)}\n />\n </div>\n\n <div>\n <label className=\"block text-[14px] font-[700] text-[#1d1d1f]\">{copy.phone}</label>\n <input\n className={cn(\n 'mt-[8px] h-[46px] w-full border border-[#d8d8d8] px-[12px] text-[14px] outline-none',\n rounded ? 'rounded-[4px]' : 'rounded-none'\n )}\n value={phone}\n onChange={e => setPhone(e.target.value)}\n />\n </div>\n\n <div>\n <label className=\"block text-[14px] font-[700] text-[#1d1d1f]\">{copy.country}</label>\n <select\n className={cn(\n 'mt-[8px] h-[46px] w-full border border-[#d8d8d8] px-[12px] text-[14px] outline-none',\n rounded ? 'rounded-[4px]' : 'rounded-none'\n )}\n value={country}\n onChange={e => setCountry(e.target.value)}\n >\n {countries.map((c: { id: string; name: string }) => (\n <option key={c.id} value={c.id}>\n {c.name}\n </option>\n ))}\n </select>\n </div>\n\n <div className=\"flex gap-[12px]\">\n <Button variant=\"secondary\" size=\"base\" className=\"flex-1\" onClick={onClose} disabled={isLoading}>\n {copy.cancel}\n </Button>\n <Button variant=\"primary\" size=\"base\" className=\"flex-1\" loading={isLoading} onClick={handleSubmit}>\n {copy.save}\n </Button>\n </div>\n </div>\n )\n}\n"],
|
|
5
|
+
"mappings": "AAuGwB,cAAAA,EAElB,QAAAC,MAFkB,oBAvGxB,OAAS,eAAAC,EAAa,aAAAC,EAAW,YAAAC,MAAgB,QACjD,OAAS,UAAAC,EAAQ,QAAAC,MAAY,wBAC7B,OAAS,WAAAC,EAAS,cAAcC,EAAI,sBAAAC,MAA0B,kBAE9D,OAAS,oBAAAC,MAAwB,2BACjC,OAAOC,MAAkB,8CACzB,OAAS,yBAAAC,MAA6B,yBACtC,OAAS,kBAAAC,MAAsB,wBAOhB,SAARC,EAAsC,CAAE,KAAAC,EAAM,QAAAC,CAAQ,EAAU,CACrE,KAAM,CAAE,QAAAC,EAAS,gBAAAC,EAAiB,WAAAC,EAAY,4BAAAC,CAA4B,EAAIR,EAAsB,EAC9F,CAAE,OAAAS,CAAO,EAAIF,EACb,CAAE,MAAAG,EAAO,YAAAC,CAAY,EAAId,EAAmB,EAC5Ce,EAAUX,EAAe,SAASS,CAAK,EAEvC,CAACG,EAAWC,CAAY,EAAItB,EAAS,EAAE,EACvC,CAACuB,EAAUC,CAAW,EAAIxB,EAAS,EAAE,EACrC,CAACyB,EAAOC,CAAQ,EAAI1B,EAAS,EAAE,EAC/B,CAAC2B,EAAUC,CAAW,EAAI5B,EAAS,EAAE,EACrC,CAAC6B,EAASC,CAAU,EAAI9B,EAAS,EAAE,EACnC,CAAC+B,EAAgBC,CAAiB,EAAIhC,EAAS,EAAE,EACjD,CAACiC,EAAeC,CAAgB,EAAIlC,EAAS,EAAE,EAE/C,CAAE,cAAAmC,EAAe,UAAAC,CAA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C,EAAY,EAAE,OAAO,KAAK,EAC3C,GACF,EAEA/B,EAAC,OACC,UAAAD,EAAC,SAAM,UAAU,8CAA+C,SAAAe,EAAK,MAAM,EAC3Ef,EAAC,SACC,UAAWQ,EACT,sFACAgB,EAAU,gBAAkB,cAC9B,EACA,MAAOK,EACP,SAAU,GAAKC,EAAS,EAAE,OAAO,KAAK,EACxC,GACF,EAEA7B,EAAC,OACC,UAAAD,EAAC,SAAM,UAAU,8CAA+C,SAAAe,EAAK,QAAQ,EAC7Ef,EAAC,UACC,UAAWQ,EACT,sFACAgB,EAAU,gBAAkB,cAC9B,EACA,MAAOS,EACP,SAAU,GAAKC,EAAW,EAAE,OAAO,KAAK,EAEvC,SAAAO,EAAU,IAAKI,GACd7C,EAAC,UAAkB,MAAO6C,EAAE,GACzB,SAAAA,EAAE,MADQA,EAAE,EAEf,CACD,EACH,GACF,EAEA5C,EAAC,OAAI,UAAU,kBACb,UAAAD,EAACK,EAAA,CAAO,QAAQ,YAAY,KAAK,OAAO,UAAU,SAAS,QAASW,EAAS,SAAUwB,EACpF,SAAAzB,EAAK,OACR,EACAf,EAACK,EAAA,CAAO,QAAQ,UAAU,KAAK,OAAO,UAAU,SAAS,QAASmC,EAAW,QAASI,EACnF,SAAA7B,EAAK,KACR,GACF,GACF,CAEJ",
|
|
6
6
|
"names": ["jsx", "jsxs", "useCallback", "useEffect", "useState", "Button", "Text", "gaTrack", "cn", "useHeadlessContext", "useUpdateProfile", "useCountries", "useMemberPopupContext", "ROUNDED_BRANDS", "CompleteProfilePanel", "copy", "onClose", "profile", "fetchCreditInfo", "alpcConfig", "setIsProfileCompleteSuccess", "locale", "brand", "storeDomain", "rounded", "firstName", "setFirstName", "lastName", "setLastName", "phone", "setPhone", "birthDay", "setBirthDay", "country", "setCountry", "firstNameError", "setFirstNameError", "lastNameError", "setLastNameError", "updateProfile", "isLoading", "countries", "validate", "hasError", "handleSubmit", "c"]
|
|
7
7
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
type UseUpdateProfileConfig = {
|
|
2
2
|
locale?: string;
|
|
3
3
|
appName?: string;
|
|
4
|
+
apiBaseUrl?: string;
|
|
4
5
|
};
|
|
5
6
|
type ProfileData = {
|
|
6
7
|
first_name?: string;
|
|
@@ -9,7 +10,7 @@ type ProfileData = {
|
|
|
9
10
|
country?: string;
|
|
10
11
|
dob?: string;
|
|
11
12
|
};
|
|
12
|
-
export declare function useUpdateProfile({ locale, appName }?: UseUpdateProfileConfig): {
|
|
13
|
+
export declare function useUpdateProfile({ locale, appName, apiBaseUrl }?: UseUpdateProfileConfig): {
|
|
13
14
|
updateProfile: (data: ProfileData) => Promise<boolean>;
|
|
14
15
|
isLoading: boolean;
|
|
15
16
|
error: string | null;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{useCallback as
|
|
1
|
+
import{useCallback as p,useState as i}from"react";function d({locale:n="",appName:s="",apiBaseUrl:a=""}={}){const[l,o]=i(!1),[u,r]=i(null);return{updateProfile:p(async f=>{o(!0),r(null);try{const e=await fetch(`${a}/api/multipass/account/users/update_profile`,{method:"PUT",credentials:"include",headers:{"Content-Type":"application/json","current-language":n},body:JSON.stringify({app:s,...f})}),t=await e.json();return e.ok&&!t.error?!0:(r(t?.error?.message||t?.error||"Update failed"),!1)}catch(e){return r(e?.message??"Unknown error"),!1}finally{o(!1)}},[n,s,a]),isLoading:l,error:u}}export{d as useUpdateProfile};
|
|
2
2
|
//# sourceMappingURL=useUpdateProfile.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../src/components/memberPopup/panels/EarnCredits/hooks/useUpdateProfile.ts"],
|
|
4
|
-
"sourcesContent": ["import { useCallback, useState } from 'react'\n\ntype UseUpdateProfileConfig = {\n locale?: string\n appName?: string\n}\n\ntype ProfileData = {\n first_name?: string\n last_name?: string\n phone_number?: string\n country?: string\n dob?: string\n}\n\nexport function useUpdateProfile({ locale = '', appName = '' }: UseUpdateProfileConfig = {}) {\n const [isLoading, setIsLoading] = useState(false)\n const [error, setError] = useState<string | null>(null)\n\n const updateProfile = useCallback(\n async (data: ProfileData): Promise<boolean> => {\n setIsLoading(true)\n setError(null)\n try {\n const response = await fetch(
|
|
5
|
-
"mappings": "AAAA,OAAS,eAAAA,EAAa,YAAAC,MAAgB,
|
|
6
|
-
"names": ["useCallback", "useState", "useUpdateProfile", "locale", "appName", "isLoading", "setIsLoading", "error", "setError", "data", "response", "result"]
|
|
4
|
+
"sourcesContent": ["import { useCallback, useState } from 'react'\n\ntype UseUpdateProfileConfig = {\n locale?: string\n appName?: string\n apiBaseUrl?: string\n}\n\ntype ProfileData = {\n first_name?: string\n last_name?: string\n phone_number?: string\n country?: string\n dob?: string\n}\n\nexport function useUpdateProfile({ locale = '', appName = '', apiBaseUrl = '' }: UseUpdateProfileConfig = {}) {\n const [isLoading, setIsLoading] = useState(false)\n const [error, setError] = useState<string | null>(null)\n\n const updateProfile = useCallback(\n async (data: ProfileData): Promise<boolean> => {\n setIsLoading(true)\n setError(null)\n try {\n const response = await fetch(`${apiBaseUrl}/api/multipass/account/users/update_profile`, {\n method: 'PUT',\n credentials: 'include',\n headers: {\n 'Content-Type': 'application/json',\n 'current-language': locale,\n },\n body: JSON.stringify({ app: appName, ...data }),\n })\n const result = await response.json()\n if (response.ok && !result.error) {\n return true\n }\n setError(result?.error?.message || result?.error || 'Update failed')\n return false\n } catch (e: any) {\n setError(e?.message ?? 'Unknown error')\n return false\n } finally {\n setIsLoading(false)\n }\n },\n [locale, appName, apiBaseUrl]\n )\n\n return { updateProfile, isLoading, error }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,OAAS,eAAAA,EAAa,YAAAC,MAAgB,QAgB/B,SAASC,EAAiB,CAAE,OAAAC,EAAS,GAAI,QAAAC,EAAU,GAAI,WAAAC,EAAa,EAAG,EAA4B,CAAC,EAAG,CAC5G,KAAM,CAACC,EAAWC,CAAY,EAAIN,EAAS,EAAK,EAC1C,CAACO,EAAOC,CAAQ,EAAIR,EAAwB,IAAI,EAgCtD,MAAO,CAAE,cA9BaD,EACpB,MAAOU,GAAwC,CAC7CH,EAAa,EAAI,EACjBE,EAAS,IAAI,EACb,GAAI,CACF,MAAME,EAAW,MAAM,MAAM,GAAGN,CAAU,8CAA+C,CACvF,OAAQ,MACR,YAAa,UACb,QAAS,CACP,eAAgB,mBAChB,mBAAoBF,CACtB,EACA,KAAM,KAAK,UAAU,CAAE,IAAKC,EAAS,GAAGM,CAAK,CAAC,CAChD,CAAC,EACKE,EAAS,MAAMD,EAAS,KAAK,EACnC,OAAIA,EAAS,IAAM,CAACC,EAAO,MAClB,IAETH,EAASG,GAAQ,OAAO,SAAWA,GAAQ,OAAS,eAAe,EAC5D,GACT,OAAS,EAAQ,CACf,OAAAH,EAAS,GAAG,SAAW,eAAe,EAC/B,EACT,QAAE,CACAF,EAAa,EAAK,CACpB,CACF,EACA,CAACJ,EAAQC,EAASC,CAAU,CAC9B,EAEwB,UAAAC,EAAW,MAAAE,CAAM,CAC3C",
|
|
6
|
+
"names": ["useCallback", "useState", "useUpdateProfile", "locale", "appName", "apiBaseUrl", "isLoading", "setIsLoading", "error", "setError", "data", "response", "result"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import l from"swr";import{useMemberPopupContext as p}from"../../../context/provider";function v(){const{profile:
|
|
1
|
+
import l from"swr";import{useMemberPopupContext as p}from"../../../context/provider";function v(){const{profile:a,alpcConfig:r}=p(),s=!!a?`${r.apiBaseUrl||""}/api/multipass/mktsrv/v1/referral/reward/overview/cash`:null,n=async i=>{const e=await fetch(i,{method:"GET",credentials:"include",headers:{"Content-Type":"application/json","current-language":r.locale}});if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);return e.json()},{data:o,isLoading:t}=l(s,n,{revalidateOnFocus:!1});return{isLoading:t,data:o}}export{v as useReferralOverview};
|
|
2
2
|
//# sourceMappingURL=useReferralOverview.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../src/components/memberPopup/panels/Referral/hooks/useReferralOverview.ts"],
|
|
4
|
-
"sourcesContent": ["import useSWR from 'swr'\nimport { useMemberPopupContext } from '../../../context/provider'\n\nexport type ReferralRewardOverviewResponse = {\n data: {\n data: {\n available: number\n pending: number\n }\n }\n}\n\nexport function useReferralOverview(): {\n isLoading: boolean\n data?: ReferralRewardOverviewResponse\n} {\n const { profile, alpcConfig } = useMemberPopupContext()\n const isLogin = !!profile\n\n const swrKey = isLogin ?
|
|
5
|
-
"mappings": "AAAA,OAAOA,MAAY,MACnB,OAAS,yBAAAC,MAA6B,4BAW/B,SAASC,GAGd,CACA,KAAM,CAAE,QAAAC,EAAS,WAAAC,CAAW,EAAIH,EAAsB,EAGhDI,EAFU,CAAC,CAACF,EAEO,yDAA2D,
|
|
4
|
+
"sourcesContent": ["import useSWR from 'swr'\nimport { useMemberPopupContext } from '../../../context/provider'\n\nexport type ReferralRewardOverviewResponse = {\n data: {\n data: {\n available: number\n pending: number\n }\n }\n}\n\nexport function useReferralOverview(): {\n isLoading: boolean\n data?: ReferralRewardOverviewResponse\n} {\n const { profile, alpcConfig } = useMemberPopupContext()\n const isLogin = !!profile\n\n const swrKey = isLogin ? `${alpcConfig.apiBaseUrl || ''}/api/multipass/mktsrv/v1/referral/reward/overview/cash` : null\n\n const swrFetcher = async (url: string) => {\n const response = await fetch(url, {\n method: 'GET',\n credentials: 'include',\n headers: {\n 'Content-Type': 'application/json',\n 'current-language': alpcConfig.locale,\n },\n })\n if (!response.ok) {\n throw new Error(`HTTP error! status: ${response.status}`)\n }\n return response.json()\n }\n\n const { data, isLoading } = useSWR<ReferralRewardOverviewResponse>(swrKey, swrFetcher, {\n revalidateOnFocus: false,\n })\n\n return { isLoading, data }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,OAAOA,MAAY,MACnB,OAAS,yBAAAC,MAA6B,4BAW/B,SAASC,GAGd,CACA,KAAM,CAAE,QAAAC,EAAS,WAAAC,CAAW,EAAIH,EAAsB,EAGhDI,EAFU,CAAC,CAACF,EAEO,GAAGC,EAAW,YAAc,EAAE,yDAA2D,KAE5GE,EAAa,MAAOC,GAAgB,CACxC,MAAMC,EAAW,MAAM,MAAMD,EAAK,CAChC,OAAQ,MACR,YAAa,UACb,QAAS,CACP,eAAgB,mBAChB,mBAAoBH,EAAW,MACjC,CACF,CAAC,EACD,GAAI,CAACI,EAAS,GACZ,MAAM,IAAI,MAAM,uBAAuBA,EAAS,MAAM,EAAE,EAE1D,OAAOA,EAAS,KAAK,CACvB,EAEM,CAAE,KAAAC,EAAM,UAAAC,CAAU,EAAIV,EAAuCK,EAAQC,EAAY,CACrF,kBAAmB,EACrB,CAAC,EAED,MAAO,CAAE,UAAAI,EAAW,KAAAD,CAAK,CAC3B",
|
|
6
6
|
"names": ["useSWR", "useMemberPopupContext", "useReferralOverview", "profile", "alpcConfig", "swrKey", "swrFetcher", "url", "response", "data", "isLoading"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as n,jsxs as _}from"react/jsx-runtime";import{Button as X,Text as l}from"@anker-in/headless-ui";import{useSendEmailValidation as Y,gaTrack as H,classNames as L,useHeadlessContext as Z,useEmailValidation as y,useCountDown as ee}from"../../../lib";import{useCallback as V,useEffect as C,useRef as te,useState as p}from"react";import{Message as ae}from"./Message";import{useRegistration as ne}from"../context";import{RegistrationModalContainer as se}from"../modalContainer";import{ROUNDED_BRANDS as oe}from"../../../constants";const be=({copy:t})=>{const{locale:$,brand:F}=Z(),{email:i,authCodeActivate:f,apiBaseUrl:k}=ne(),O=oe.includes(F),{activeToken:E,setActiveToken:P,setIsSendingActivateEmail:M,setIsActivateSuccess:j,onAuthSuccess:b,autoSendEmail:D}=f,{isMutating:z,trigger:U}=y(void 0,k),{isMutating:w,trigger:h,data:x}=Y(k),[K,c]=p(""),[q,u]=p(""),{startCountDown:I,startAction:R,countDown:G}=ee(60),[B,d]=p(""),[N,m]=p(0),[s,S]=p(new Array(6).fill("")),T=te([]),v=s.join("");C(()=>{T.current[N]&&T.current[N].focus()},[N]),C(()=>{const o=x?.data?.data?.active_token??x?.data?.active_token;o&&P(o)},[x?.data?.data?.active_token,x?.data?.active_token]),C(()=>{M(w)},[w,M]),C(()=>{D&&i&&h({email:i,data:{redirect_url:`${window?.location?.origin}${window?.location?.pathname}`}},{onSuccess:()=>{u("success"),c(t?.sendEmailSuccessMessage||""),R(),setTimeout(()=>{u(""),c("")},5e3)}})},[D,i,h]);const J=V(async()=>{i&&(await h({email:i,data:{redirect_url:`${window?.location?.origin}${window?.location?.pathname}`}},{onSuccess:()=>{u("success"),c(t?.sendEmailSuccessMessage||""),R(),setTimeout(()=>{u(""),c("")},5e3)}}),H({event:"ga4Event",event_name:"lp_button",event_parameters:{page_group:"reg_sub_pop",position:"auth_code",button_name:"sent_again"}}))},[i,h]),Q=(o,e)=>{const{value:a}=o.target;if(d(""),Number.isNaN(Number(a)))return;if(a.length>1){e<s.length-1&&(s[e+1]||(m(e+1),S(g=>{const A=[...g];return A[e]=a[0],a.length>1&&(A[e+1]=a[1]),A})));return}const r=[...s];r[e]=a,S(r),a?e<s.length-1&&!s[e+1]&&m(e+1):e>0&&m(e-1)},W=V(async()=>{if(!v?.length){d(t?.codeEmptyError||"");return}if(v.length<6){d(t?.incorrectCodeError||"");return}E&&await U({token:E,code:v},{onSuccess:e=>{if(e.status>=200&&e.status<300||e?.data?.user_id||e?.user_id)u("success"),c(t?.authSuccessMessage||""),j(!0),b?b():setTimeout(()=>{f.close(),window.location.reload()},3e3);else{const a=e?.data?.error_code??e?.error_code;a==="104"?b?b():setTimeout(()=>{f.close(),window.location.reload()},3e3):d(a==="142"?t?.incorrectCodeError||"Invalid verification code.":a==="154"?t?.expiredCodeMessage||"":t?.sendEmailErrorMessage||"")}}});let o=setTimeout(()=>{u(""),c(""),clearTimeout(o)},5e3);H({event:"ga4Event",event_name:"lp_button",event_parameters:{page_group:"reg_sub_pop",position:"auth_code",button_name:"check_and_active"}})},[v,t?.codeEmptyError,t?.authSuccessMessage,t?.incorrectCodeError,t?.expiredCodeMessage,t?.sendEmailErrorMessage,$,E]);return n(se,{isOpen:f.isOpen,onClose:f.close,children:_("div",{className:"relative",children:[_("div",{children:[n(l,{className:"text-[22px] font-extrabold leading-[120%] text-[#333] min-l:text-[24px] [&_abbr]:text-[#005d8e]",html:t?.authCodeTitle}),n(l,{as:"p",className:"mt-3 text-[14px] font-semibold leading-[140%] text-[rgba(51,51,51,0.75)] min-l:text-base [&_abbr]:text-[#333]",html:t?.authCodeDesc?.replace("%email%",i||"")})]}),_("div",{className:"mt-6",children:[n(l,{className:"mt-4 text-[14px] !font-bold font-semibold leading-[140%] text-[#333] min-l:mt-6",html:t?.enterActiveCodeText}),n("div",{className:"my-3 grid grid-cols-6 gap-2",children:s.map((o,e)=>n("div",{className:"col-span-1 aspect-1 text-[#555]",children:n("input",{ref:a=>{a&&(T.current[e]=a)},type:"tel",className:L("flex size-full items-center justify-center border border-[#333333]/20 bg-[#EEEEEE] text-center text-[24px] font-medium focus:border-[#333]/50 [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none [&:focus-visible]:outline-none",O&&"rounded-[12px]"),value:o,autoComplete:"false",autoCorrect:"false",spellCheck:"false",autoCapitalize:"false",onChange:a=>Q(a,e),onFocus:()=>{m(e)},onPaste:a=>{const r=a.clipboardData.getData("text");if(!Number.isNaN(Number(r))){const g=r.split("").slice(0,6);S(g.concat(Array(6-g.length).fill(""))),g.length<=s.length&&m(g.length-1)}},onKeyDown:a=>{const{value:r}=a.target;a.key==="Backspace"&&!r&&e>0&&m(e-1)}},e)},e))}),B&&n(l,{className:"mb-3 text-[14px] font-semibold leading-[120%] text-[#f84d4f]",html:B}),t?.authCodeContent&&n("ul",{className:'flex flex-col gap-1 [&_li]:flex [&_li]:gap-2 [&_li]:text-[14px] [&_li]:font-semibold [&_li]:leading-[120%] [&_li]:text-[rgba(51,51,51,0.55)] [&_li]:before:content-["\u2022"]',dangerouslySetInnerHTML:{__html:t?.authCodeContent}})]}),_("div",{className:"mt-4 min-l:mt-6",children:[n(l,{className:"text-base font-semibold leading-[100%] text-[#333]",html:t?.authCodeReceiveText})," ",I?n(l,{html:t?.retrieveText?.replace("%countdownTime%",G.toString()),className:"cursor-pointer text-base font-semibold leading-[100%] !text-brand text-[#005d8e] text-[#333] underline"}):n(l,{onClick:J,className:L("cursor-pointer text-base font-semibold leading-[100%] !text-brand text-[#005d8e] text-[#333] underline",{"pointer-events-none":I||w}),html:t?.sendAgainText}),n(X,{type:"submit",loading:z,className:"mt-6 flex h-[54px] w-full cursor-pointer items-center justify-center px-8 py-[15px] text-center text-base font-bold leading-[100%] text-white min-l:mt-8",onClick:W,children:t.buttonText})]}),n(ae,{status:q,message:K})]})})};export{be as AuthCodeActivate};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/components/registration/authCodeActivate/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Button, Text } from '@anker-in/headless-ui'\nimport {\n useSendEmailValidation,\n gaTrack,\n classNames as cn,\n useHeadlessContext,\n useEmailValidation,\n useCountDown,\n} from '../../../lib'\nimport React, { useCallback, useEffect, useRef, useState } from 'react'\nimport { Message } from './Message'\nimport { AuthCodeActivateProps } from './type'\nimport { useRegistration } from '../context'\nimport { RegistrationModalContainer } from '../modalContainer'\nimport { ROUNDED_BRANDS } from '../../../constants'\n\nexport const AuthCodeActivate: React.FC<AuthCodeActivateProps> = ({ copy }) => {\n const { locale, brand } = useHeadlessContext()\n const { email, authCodeActivate } = useRegistration()\n const rounded = ROUNDED_BRANDS.includes(brand)\n\n const { activeToken, setActiveToken, setIsSendingActivateEmail, setIsActivateSuccess, onAuthSuccess, autoSendEmail } =\n authCodeActivate\n\n const { isMutating: emailValidationLoading, trigger: triggerEmailValidation } = useEmailValidation()\n\n const {\n isMutating: isSendingEmail,\n trigger: triggerSendValidationEmail,\n data: sendEmailData,\n } = useSendEmailValidation()\n\n const [messageText, setMessageText] = useState('')\n const [messageStatus, setMessageStatus] = useState('')\n const { startCountDown: isStartCountDown, startAction: startCountDown, countDown } = useCountDown(60)\n\n const [error, setError] = useState('')\n const [focusIndex, setFocusIndex] = useState(0)\n const [codeArray, setCodeArray] = useState(new Array(6).fill(''))\n\n const inputRefs = useRef<HTMLInputElement[]>([])\n const code = codeArray.join('')\n\n useEffect(() => {\n if (inputRefs.current[focusIndex]) {\n inputRefs.current[focusIndex].focus()\n }\n }, [focusIndex])\n\n useEffect(() => {\n const token = sendEmailData?.data?.data?.active_token ?? sendEmailData?.data?.active_token\n if (token) {\n setActiveToken(token)\n }\n }, [sendEmailData?.data?.data?.active_token, sendEmailData?.data?.active_token])\n\n useEffect(() => {\n setIsSendingActivateEmail(isSendingEmail)\n }, [isSendingEmail, setIsSendingActivateEmail])\n\n // \u81EA\u52A8\u53D1\u9001\u90AE\u7BB1\u9A8C\u8BC1\u7801\n useEffect(() => {\n if (autoSendEmail && email) {\n triggerSendValidationEmail(\n {\n email: email,\n data: {\n redirect_url: `${window?.location?.origin}${window?.location?.pathname}`,\n },\n },\n {\n onSuccess: () => {\n setMessageStatus('success')\n setMessageText(copy?.sendEmailSuccessMessage || '')\n startCountDown()\n setTimeout(() => {\n setMessageStatus('')\n setMessageText('')\n }, 5000)\n },\n }\n )\n }\n }, [autoSendEmail, email, triggerSendValidationEmail])\n\n const handleSendAgain = useCallback(async () => {\n if (!email) return\n // \u53D1\u8D77\u7F51\u7EDC\u8BF7\u6C42\n await triggerSendValidationEmail(\n {\n email: email,\n data: {\n redirect_url: `${window?.location?.origin}${window?.location?.pathname}`,\n },\n },\n {\n onSuccess: () => {\n setMessageStatus('success')\n setMessageText(copy?.sendEmailSuccessMessage || '')\n startCountDown()\n setTimeout(() => {\n setMessageStatus('')\n setMessageText('')\n }, 5000)\n },\n }\n )\n gaTrack({\n event: 'ga4Event',\n event_name: 'lp_button',\n event_parameters: {\n page_group: 'reg_sub_pop',\n position: 'auth_code',\n button_name: 'sent_again',\n },\n })\n }, [email, triggerSendValidationEmail])\n\n const handleInputCodeChange = (event: React.ChangeEvent<HTMLInputElement>, index: number) => {\n const { value } = event.target\n\n setError('')\n\n if (Number.isNaN(Number(value))) {\n return\n }\n\n if (value.length > 1) {\n if (index < codeArray.length - 1) {\n if (!codeArray[index + 1]) {\n setFocusIndex(index + 1)\n setCodeArray(old => {\n const newCode = [...old]\n newCode[index] = value[0]\n if (value.length > 1) {\n newCode[index + 1] = value[1]\n }\n return newCode\n })\n }\n }\n return\n }\n const newCode = [...codeArray]\n newCode[index] = value\n setCodeArray(newCode)\n if (value) {\n if (index < codeArray.length - 1 && !codeArray[index + 1]) {\n setFocusIndex(index + 1)\n }\n } else if (index > 0) {\n setFocusIndex(index - 1)\n }\n }\n\n const handleAuthCodeSubmit = useCallback(async () => {\n if (!code?.length) {\n setError(copy?.codeEmptyError || '')\n return\n }\n\n if (code.length < 6) {\n setError(copy?.incorrectCodeError || '')\n return\n }\n\n if (activeToken) {\n await triggerEmailValidation(\n {\n token: activeToken,\n code: code,\n },\n {\n onSuccess: data => {\n if ((data.status >= 200 && data.status < 300) || data?.data?.user_id || data?.user_id) {\n setMessageStatus('success')\n setMessageText(copy?.authSuccessMessage || '')\n setIsActivateSuccess(true)\n if (onAuthSuccess) {\n onAuthSuccess()\n } else {\n setTimeout(() => {\n authCodeActivate.close()\n window.location.reload()\n }, 3000)\n }\n } else {\n const errorCode = data?.data?.error_code ?? data?.error_code\n if (errorCode === '104') {\n if (onAuthSuccess) {\n onAuthSuccess()\n } else {\n setTimeout(() => {\n authCodeActivate.close()\n window.location.reload()\n }, 3000)\n }\n } else if (errorCode === '142') {\n setError(copy?.incorrectCodeError || 'Invalid verification code.')\n } else if (errorCode === '154') {\n setError(copy?.expiredCodeMessage || '')\n } else {\n setError(copy?.sendEmailErrorMessage || '')\n }\n }\n },\n }\n )\n }\n\n // \u8BBE\u7F6E\u5B9A\u65F6\u5668\u6E05\u9664\u72B6\u6001\u4FE1\u606F\n let timer = setTimeout(() => {\n setMessageStatus('')\n setMessageText('')\n clearTimeout(timer)\n }, 5000)\n\n gaTrack({\n event: 'ga4Event',\n event_name: 'lp_button',\n event_parameters: {\n page_group: 'reg_sub_pop',\n position: 'auth_code',\n button_name: 'check_and_active',\n },\n })\n }, [\n code,\n copy?.codeEmptyError,\n copy?.authSuccessMessage,\n copy?.incorrectCodeError,\n copy?.expiredCodeMessage,\n copy?.sendEmailErrorMessage,\n locale,\n activeToken,\n ])\n\n return (\n <RegistrationModalContainer isOpen={authCodeActivate.isOpen} onClose={authCodeActivate.close}>\n <div className=\"relative\">\n <div>\n <Text\n className=\"text-[22px] font-extrabold leading-[120%] text-[#333] min-l:text-[24px] [&_abbr]:text-[#005d8e]\"\n html={copy?.authCodeTitle}\n />\n <Text\n as=\"p\"\n className=\"mt-3 text-[14px] font-semibold leading-[140%] text-[rgba(51,51,51,0.75)] min-l:text-base [&_abbr]:text-[#333]\"\n html={copy?.authCodeDesc?.replace('%email%', email || '')}\n />\n </div>\n <div className=\"mt-6\">\n <Text\n className=\"mt-4 text-[14px] !font-bold font-semibold leading-[140%] text-[#333] min-l:mt-6\"\n html={copy?.enterActiveCodeText}\n />\n <div className=\"my-3 grid grid-cols-6 gap-2\">\n {codeArray.map((item, index) => (\n <div key={index} className=\"col-span-1 aspect-1 text-[#555]\">\n <input\n ref={inputRef => {\n if (inputRef) {\n inputRefs.current[index] = inputRef\n }\n }}\n key={index}\n type=\"tel\"\n className={cn(\n 'flex size-full items-center justify-center border border-[#333333]/20 bg-[#EEEEEE] text-center text-[24px] font-medium focus:border-[#333]/50 [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none [&:focus-visible]:outline-none',\n rounded && 'rounded-[12px]'\n )}\n value={item}\n autoComplete=\"false\"\n autoCorrect=\"false\"\n spellCheck=\"false\"\n autoCapitalize=\"false\"\n onChange={event => handleInputCodeChange(event, index)}\n onFocus={() => {\n setFocusIndex(index)\n }}\n onPaste={event => {\n const paste = event.clipboardData.getData('text')\n if (!Number.isNaN(Number(paste))) {\n const pastedCode = paste.split('').slice(0, 6)\n setCodeArray(pastedCode.concat(Array(6 - pastedCode.length).fill('')))\n if (pastedCode.length <= codeArray.length) {\n setFocusIndex(pastedCode.length - 1)\n }\n }\n }}\n onKeyDown={event => {\n const { value } = event.target as HTMLInputElement\n if (event.key === 'Backspace' && !value && index > 0) {\n setFocusIndex(index - 1)\n }\n }}\n />\n </div>\n ))}\n </div>\n\n {error && <Text className=\"mb-3 text-[14px] font-semibold leading-[120%] text-[#f84d4f]\" html={error} />}\n {copy?.authCodeContent && (\n <ul\n className='flex flex-col gap-1 [&_li]:flex [&_li]:gap-2 [&_li]:text-[14px] [&_li]:font-semibold [&_li]:leading-[120%] [&_li]:text-[rgba(51,51,51,0.55)] [&_li]:before:content-[\"\u2022\"]'\n dangerouslySetInnerHTML={{ __html: copy?.authCodeContent }}\n />\n )}\n </div>\n <div className=\"mt-4 min-l:mt-6\">\n <Text className=\"text-base font-semibold leading-[100%] text-[#333]\" html={copy?.authCodeReceiveText} />{' '}\n {isStartCountDown ? (\n <Text\n html={copy?.retrieveText?.replace('%countdownTime%', countDown.toString())}\n className=\"cursor-pointer text-base font-semibold leading-[100%] !text-brand text-[#005d8e] text-[#333] underline\"\n />\n ) : (\n <Text\n onClick={handleSendAgain}\n className={cn(\n 'cursor-pointer text-base font-semibold leading-[100%] !text-brand text-[#005d8e] text-[#333] underline',\n {\n 'pointer-events-none': isStartCountDown || isSendingEmail,\n }\n )}\n html={copy?.sendAgainText}\n />\n )}\n <Button\n type=\"submit\"\n loading={emailValidationLoading}\n className=\"mt-6 flex h-[54px] w-full cursor-pointer items-center justify-center px-8 py-[15px] text-center text-base font-bold leading-[100%] text-white min-l:mt-8\"\n onClick={handleAuthCodeSubmit}\n >\n {copy.buttonText}\n </Button>\n </div>\n <Message status={messageStatus} message={messageText} />\n </div>\n </RegistrationModalContainer>\n )\n}\n"],
|
|
5
|
-
"mappings": "AAgPQ,OACE,OAAAA,EADF,QAAAC,MAAA,oBAhPR,OAAS,UAAAC,EAAQ,QAAAC,MAAY,wBAC7B,OACE,0BAAAC,EACA,WAAAC,EACA,cAAcC,EACd,sBAAAC,EACA,sBAAAC,EACA,gBAAAC,
|
|
6
|
-
"names": ["jsx", "jsxs", "Button", "Text", "useSendEmailValidation", "gaTrack", "cn", "useHeadlessContext", "useEmailValidation", "useCountDown", "useCallback", "useEffect", "useRef", "useState", "Message", "useRegistration", "RegistrationModalContainer", "ROUNDED_BRANDS", "AuthCodeActivate", "copy", "locale", "brand", "email", "authCodeActivate", "rounded", "activeToken", "setActiveToken", "setIsSendingActivateEmail", "setIsActivateSuccess", "onAuthSuccess", "autoSendEmail", "emailValidationLoading", "triggerEmailValidation", "isSendingEmail", "triggerSendValidationEmail", "sendEmailData", "messageText", "setMessageText", "messageStatus", "setMessageStatus", "isStartCountDown", "startCountDown", "countDown", "error", "setError", "focusIndex", "setFocusIndex", "codeArray", "setCodeArray", "inputRefs", "code", "token", "handleSendAgain", "handleInputCodeChange", "event", "index", "value", "old", "newCode", "handleAuthCodeSubmit", "data", "errorCode", "timer", "item", "inputRef", "paste", "pastedCode"]
|
|
4
|
+
"sourcesContent": ["import { Button, Text } from '@anker-in/headless-ui'\nimport {\n useSendEmailValidation,\n gaTrack,\n classNames as cn,\n useHeadlessContext,\n useEmailValidation,\n useCountDown,\n} from '../../../lib'\nimport React, { useCallback, useEffect, useRef, useState } from 'react'\nimport { Message } from './Message'\nimport { AuthCodeActivateProps } from './type'\nimport { useRegistration } from '../context'\nimport { RegistrationModalContainer } from '../modalContainer'\nimport { ROUNDED_BRANDS } from '../../../constants'\n\nexport const AuthCodeActivate: React.FC<AuthCodeActivateProps> = ({ copy }) => {\n const { locale, brand } = useHeadlessContext()\n const { email, authCodeActivate, apiBaseUrl } = useRegistration()\n const rounded = ROUNDED_BRANDS.includes(brand)\n\n const { activeToken, setActiveToken, setIsSendingActivateEmail, setIsActivateSuccess, onAuthSuccess, autoSendEmail } =\n authCodeActivate\n\n const { isMutating: emailValidationLoading, trigger: triggerEmailValidation } = useEmailValidation(undefined, apiBaseUrl)\n\n const {\n isMutating: isSendingEmail,\n trigger: triggerSendValidationEmail,\n data: sendEmailData,\n } = useSendEmailValidation(apiBaseUrl)\n\n const [messageText, setMessageText] = useState('')\n const [messageStatus, setMessageStatus] = useState('')\n const { startCountDown: isStartCountDown, startAction: startCountDown, countDown } = useCountDown(60)\n\n const [error, setError] = useState('')\n const [focusIndex, setFocusIndex] = useState(0)\n const [codeArray, setCodeArray] = useState(new Array(6).fill(''))\n\n const inputRefs = useRef<HTMLInputElement[]>([])\n const code = codeArray.join('')\n\n useEffect(() => {\n if (inputRefs.current[focusIndex]) {\n inputRefs.current[focusIndex].focus()\n }\n }, [focusIndex])\n\n useEffect(() => {\n const token = sendEmailData?.data?.data?.active_token ?? sendEmailData?.data?.active_token\n if (token) {\n setActiveToken(token)\n }\n }, [sendEmailData?.data?.data?.active_token, sendEmailData?.data?.active_token])\n\n useEffect(() => {\n setIsSendingActivateEmail(isSendingEmail)\n }, [isSendingEmail, setIsSendingActivateEmail])\n\n // \u81EA\u52A8\u53D1\u9001\u90AE\u7BB1\u9A8C\u8BC1\u7801\n useEffect(() => {\n if (autoSendEmail && email) {\n triggerSendValidationEmail(\n {\n email: email,\n data: {\n redirect_url: `${window?.location?.origin}${window?.location?.pathname}`,\n },\n },\n {\n onSuccess: () => {\n setMessageStatus('success')\n setMessageText(copy?.sendEmailSuccessMessage || '')\n startCountDown()\n setTimeout(() => {\n setMessageStatus('')\n setMessageText('')\n }, 5000)\n },\n }\n )\n }\n }, [autoSendEmail, email, triggerSendValidationEmail])\n\n const handleSendAgain = useCallback(async () => {\n if (!email) return\n // \u53D1\u8D77\u7F51\u7EDC\u8BF7\u6C42\n await triggerSendValidationEmail(\n {\n email: email,\n data: {\n redirect_url: `${window?.location?.origin}${window?.location?.pathname}`,\n },\n },\n {\n onSuccess: () => {\n setMessageStatus('success')\n setMessageText(copy?.sendEmailSuccessMessage || '')\n startCountDown()\n setTimeout(() => {\n setMessageStatus('')\n setMessageText('')\n }, 5000)\n },\n }\n )\n gaTrack({\n event: 'ga4Event',\n event_name: 'lp_button',\n event_parameters: {\n page_group: 'reg_sub_pop',\n position: 'auth_code',\n button_name: 'sent_again',\n },\n })\n }, [email, triggerSendValidationEmail])\n\n const handleInputCodeChange = (event: React.ChangeEvent<HTMLInputElement>, index: number) => {\n const { value } = event.target\n\n setError('')\n\n if (Number.isNaN(Number(value))) {\n return\n }\n\n if (value.length > 1) {\n if (index < codeArray.length - 1) {\n if (!codeArray[index + 1]) {\n setFocusIndex(index + 1)\n setCodeArray(old => {\n const newCode = [...old]\n newCode[index] = value[0]\n if (value.length > 1) {\n newCode[index + 1] = value[1]\n }\n return newCode\n })\n }\n }\n return\n }\n const newCode = [...codeArray]\n newCode[index] = value\n setCodeArray(newCode)\n if (value) {\n if (index < codeArray.length - 1 && !codeArray[index + 1]) {\n setFocusIndex(index + 1)\n }\n } else if (index > 0) {\n setFocusIndex(index - 1)\n }\n }\n\n const handleAuthCodeSubmit = useCallback(async () => {\n if (!code?.length) {\n setError(copy?.codeEmptyError || '')\n return\n }\n\n if (code.length < 6) {\n setError(copy?.incorrectCodeError || '')\n return\n }\n\n if (activeToken) {\n await triggerEmailValidation(\n {\n token: activeToken,\n code: code,\n },\n {\n onSuccess: data => {\n if ((data.status >= 200 && data.status < 300) || data?.data?.user_id || data?.user_id) {\n setMessageStatus('success')\n setMessageText(copy?.authSuccessMessage || '')\n setIsActivateSuccess(true)\n if (onAuthSuccess) {\n onAuthSuccess()\n } else {\n setTimeout(() => {\n authCodeActivate.close()\n window.location.reload()\n }, 3000)\n }\n } else {\n const errorCode = data?.data?.error_code ?? data?.error_code\n if (errorCode === '104') {\n if (onAuthSuccess) {\n onAuthSuccess()\n } else {\n setTimeout(() => {\n authCodeActivate.close()\n window.location.reload()\n }, 3000)\n }\n } else if (errorCode === '142') {\n setError(copy?.incorrectCodeError || 'Invalid verification code.')\n } else if (errorCode === '154') {\n setError(copy?.expiredCodeMessage || '')\n } else {\n setError(copy?.sendEmailErrorMessage || '')\n }\n }\n },\n }\n )\n }\n\n // \u8BBE\u7F6E\u5B9A\u65F6\u5668\u6E05\u9664\u72B6\u6001\u4FE1\u606F\n let timer = setTimeout(() => {\n setMessageStatus('')\n setMessageText('')\n clearTimeout(timer)\n }, 5000)\n\n gaTrack({\n event: 'ga4Event',\n event_name: 'lp_button',\n event_parameters: {\n page_group: 'reg_sub_pop',\n position: 'auth_code',\n button_name: 'check_and_active',\n },\n })\n }, [\n code,\n copy?.codeEmptyError,\n copy?.authSuccessMessage,\n copy?.incorrectCodeError,\n copy?.expiredCodeMessage,\n copy?.sendEmailErrorMessage,\n locale,\n activeToken,\n ])\n\n return (\n <RegistrationModalContainer isOpen={authCodeActivate.isOpen} onClose={authCodeActivate.close}>\n <div className=\"relative\">\n <div>\n <Text\n className=\"text-[22px] font-extrabold leading-[120%] text-[#333] min-l:text-[24px] [&_abbr]:text-[#005d8e]\"\n html={copy?.authCodeTitle}\n />\n <Text\n as=\"p\"\n className=\"mt-3 text-[14px] font-semibold leading-[140%] text-[rgba(51,51,51,0.75)] min-l:text-base [&_abbr]:text-[#333]\"\n html={copy?.authCodeDesc?.replace('%email%', email || '')}\n />\n </div>\n <div className=\"mt-6\">\n <Text\n className=\"mt-4 text-[14px] !font-bold font-semibold leading-[140%] text-[#333] min-l:mt-6\"\n html={copy?.enterActiveCodeText}\n />\n <div className=\"my-3 grid grid-cols-6 gap-2\">\n {codeArray.map((item, index) => (\n <div key={index} className=\"col-span-1 aspect-1 text-[#555]\">\n <input\n ref={inputRef => {\n if (inputRef) {\n inputRefs.current[index] = inputRef\n }\n }}\n key={index}\n type=\"tel\"\n className={cn(\n 'flex size-full items-center justify-center border border-[#333333]/20 bg-[#EEEEEE] text-center text-[24px] font-medium focus:border-[#333]/50 [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none [&:focus-visible]:outline-none',\n rounded && 'rounded-[12px]'\n )}\n value={item}\n autoComplete=\"false\"\n autoCorrect=\"false\"\n spellCheck=\"false\"\n autoCapitalize=\"false\"\n onChange={event => handleInputCodeChange(event, index)}\n onFocus={() => {\n setFocusIndex(index)\n }}\n onPaste={event => {\n const paste = event.clipboardData.getData('text')\n if (!Number.isNaN(Number(paste))) {\n const pastedCode = paste.split('').slice(0, 6)\n setCodeArray(pastedCode.concat(Array(6 - pastedCode.length).fill('')))\n if (pastedCode.length <= codeArray.length) {\n setFocusIndex(pastedCode.length - 1)\n }\n }\n }}\n onKeyDown={event => {\n const { value } = event.target as HTMLInputElement\n if (event.key === 'Backspace' && !value && index > 0) {\n setFocusIndex(index - 1)\n }\n }}\n />\n </div>\n ))}\n </div>\n\n {error && <Text className=\"mb-3 text-[14px] font-semibold leading-[120%] text-[#f84d4f]\" html={error} />}\n {copy?.authCodeContent && (\n <ul\n className='flex flex-col gap-1 [&_li]:flex [&_li]:gap-2 [&_li]:text-[14px] [&_li]:font-semibold [&_li]:leading-[120%] [&_li]:text-[rgba(51,51,51,0.55)] [&_li]:before:content-[\"\u2022\"]'\n dangerouslySetInnerHTML={{ __html: copy?.authCodeContent }}\n />\n )}\n </div>\n <div className=\"mt-4 min-l:mt-6\">\n <Text className=\"text-base font-semibold leading-[100%] text-[#333]\" html={copy?.authCodeReceiveText} />{' '}\n {isStartCountDown ? (\n <Text\n html={copy?.retrieveText?.replace('%countdownTime%', countDown.toString())}\n className=\"cursor-pointer text-base font-semibold leading-[100%] !text-brand text-[#005d8e] text-[#333] underline\"\n />\n ) : (\n <Text\n onClick={handleSendAgain}\n className={cn(\n 'cursor-pointer text-base font-semibold leading-[100%] !text-brand text-[#005d8e] text-[#333] underline',\n {\n 'pointer-events-none': isStartCountDown || isSendingEmail,\n }\n )}\n html={copy?.sendAgainText}\n />\n )}\n <Button\n type=\"submit\"\n loading={emailValidationLoading}\n className=\"mt-6 flex h-[54px] w-full cursor-pointer items-center justify-center px-8 py-[15px] text-center text-base font-bold leading-[100%] text-white min-l:mt-8\"\n onClick={handleAuthCodeSubmit}\n >\n {copy.buttonText}\n </Button>\n </div>\n <Message status={messageStatus} message={messageText} />\n </div>\n </RegistrationModalContainer>\n )\n}\n"],
|
|
5
|
+
"mappings": "AAgPQ,OACE,OAAAA,EADF,QAAAC,MAAA,oBAhPR,OAAS,UAAAC,EAAQ,QAAAC,MAAY,wBAC7B,OACE,0BAAAC,EACA,WAAAC,EACA,cAAcC,EACd,sBAAAC,EACA,sBAAAC,EACA,gBAAAC,OACK,eACP,OAAgB,eAAAC,EAAa,aAAAC,EAAW,UAAAC,GAAQ,YAAAC,MAAgB,QAChE,OAAS,WAAAC,OAAe,YAExB,OAAS,mBAAAC,OAAuB,aAChC,OAAS,8BAAAC,OAAkC,oBAC3C,OAAS,kBAAAC,OAAsB,qBAExB,MAAMC,GAAoD,CAAC,CAAE,KAAAC,CAAK,IAAM,CAC7E,KAAM,CAAE,OAAAC,EAAQ,MAAAC,CAAM,EAAId,EAAmB,EACvC,CAAE,MAAAe,EAAO,iBAAAC,EAAkB,WAAAC,CAAW,EAAIT,GAAgB,EAC1DU,EAAUR,GAAe,SAASI,CAAK,EAEvC,CAAE,YAAAK,EAAa,eAAAC,EAAgB,0BAAAC,EAA2B,qBAAAC,EAAsB,cAAAC,EAAe,cAAAC,CAAc,EACjHR,EAEI,CAAE,WAAYS,EAAwB,QAASC,CAAuB,EAAIzB,EAAmB,OAAWgB,CAAU,EAElH,CACJ,WAAYU,EACZ,QAASC,EACT,KAAMC,CACR,EAAIhC,EAAuBoB,CAAU,EAE/B,CAACa,EAAaC,CAAc,EAAIzB,EAAS,EAAE,EAC3C,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AAA,CAAK,UAAU,qDAAqD,KAAMgB,GAAM,oBAAqB,EAAG,IACxGsB,EACCzC,EAACG,EAAA,CACC,KAAMgB,GAAM,cAAc,QAAQ,kBAAmBwB,EAAU,SAAS,CAAC,EACzE,UAAU,yGACZ,EAEA3C,EAACG,EAAA,CACC,QAASkD,EACT,UAAW/C,EACT,yGACA,CACE,sBAAuBmC,GAAoBP,CAC7C,CACF,EACA,KAAMf,GAAM,cACd,EAEFnB,EAACE,EAAA,CACC,KAAK,SACL,QAAS8B,EACT,UAAU,2JACV,QAAS4B,EAER,SAAAzC,EAAK,WACR,GACF,EACAnB,EAACc,GAAA,CAAQ,OAAQyB,EAAe,QAASF,EAAa,GACxD,EACF,CAEJ",
|
|
6
|
+
"names": ["jsx", "jsxs", "Button", "Text", "useSendEmailValidation", "gaTrack", "cn", "useHeadlessContext", "useEmailValidation", "useCountDown", "useCallback", "useEffect", "useRef", "useState", "Message", "useRegistration", "RegistrationModalContainer", "ROUNDED_BRANDS", "AuthCodeActivate", "copy", "locale", "brand", "email", "authCodeActivate", "apiBaseUrl", "rounded", "activeToken", "setActiveToken", "setIsSendingActivateEmail", "setIsActivateSuccess", "onAuthSuccess", "autoSendEmail", "emailValidationLoading", "triggerEmailValidation", "isSendingEmail", "triggerSendValidationEmail", "sendEmailData", "messageText", "setMessageText", "messageStatus", "setMessageStatus", "isStartCountDown", "startCountDown", "countDown", "error", "setError", "focusIndex", "setFocusIndex", "codeArray", "setCodeArray", "inputRefs", "code", "token", "handleSendAgain", "handleInputCodeChange", "event", "index", "value", "old", "newCode", "handleAuthCodeSubmit", "data", "errorCode", "timer", "item", "inputRef", "paste", "pastedCode"]
|
|
7
7
|
}
|
|
@@ -2,6 +2,7 @@ import { Dispatch, PropsWithChildren, SetStateAction } from 'react';
|
|
|
2
2
|
interface RegistrationContextType {
|
|
3
3
|
email?: string;
|
|
4
4
|
copy?: any;
|
|
5
|
+
apiBaseUrl?: string;
|
|
5
6
|
authCodeActivate: {
|
|
6
7
|
isOpen: boolean;
|
|
7
8
|
open: () => void;
|
|
@@ -20,8 +21,9 @@ interface RegistrationContextType {
|
|
|
20
21
|
}
|
|
21
22
|
export declare const RegistrationContext: import("react").Context<RegistrationContextType>;
|
|
22
23
|
export declare const useRegistration: () => RegistrationContextType;
|
|
23
|
-
export declare const RegistrationProvider: ({ children, email, copy }: PropsWithChildren<{
|
|
24
|
+
export declare const RegistrationProvider: ({ children, email, copy, apiBaseUrl, }: PropsWithChildren<{
|
|
24
25
|
email?: string;
|
|
25
26
|
copy?: any;
|
|
27
|
+
apiBaseUrl?: string;
|
|
26
28
|
}>) => import("react").JSX.Element;
|
|
27
29
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as E,jsxs as x}from"react/jsx-runtime";import{createContext as g,useContext as m,useState as e}from"react";import{AuthCodeActivate as C}from"../authCodeActivate";const s=g({email:void 0,copy:void 0,authCodeActivate:{activeToken:void 0,setActiveToken:()=>{},isOpen:!1,open:()=>{},close:()=>{},isActivateSuccess:!1,isSendingActivateEmail:!1,setIsSendingActivateEmail:()=>{},setIsActivateSuccess:()=>{},setOnAuthSuccess:()=>{},onAuthSuccess:void 0,autoSendEmail:!1,setAutoSendEmail:()=>{}}}),y=()=>{const t=m(s);if(!t)throw new Error("useRegistration must be used within a RegistrationProvider");return t},D=({children:t,email:o,copy:i,apiBaseUrl:a})=>{const[c,n]=e(!1),[d,u]=e(void 0),[r,l]=e(!1),[A,S]=e(),[v,p]=e(!1),[h,f]=e(!1);return x(s.Provider,{value:{email:o,copy:i,apiBaseUrl:a,authCodeActivate:{activeToken:A,isOpen:c,open:()=>n(!0),close:()=>n(!1),isActivateSuccess:r,setIsActivateSuccess:l,onAuthSuccess:d,setOnAuthSuccess:u,isSendingActivateEmail:v,setIsSendingActivateEmail:p,setActiveToken:S,autoSendEmail:h,setAutoSendEmail:f}},children:[t,i?.authCodeActivate&&E(C,{copy:i.authCodeActivate})]})};export{s as RegistrationContext,D as RegistrationProvider,y as useRegistration};
|
|
2
2
|
//# sourceMappingURL=provider.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/components/registration/context/provider.tsx"],
|
|
4
|
-
"sourcesContent": ["import { createContext, Dispatch, PropsWithChildren, SetStateAction, useContext, useState } from 'react'\nimport { AuthCodeActivate } from '../authCodeActivate'\n\ninterface RegistrationContextType {\n email?: string\n copy?: any\n authCodeActivate: {\n isOpen: boolean\n open: () => void\n close: () => void\n isActivateSuccess: boolean\n activeToken?: string\n onAuthSuccess: (() => void) | undefined\n isSendingActivateEmail: boolean\n setIsSendingActivateEmail: Dispatch<SetStateAction<boolean>>\n setActiveToken: Dispatch<SetStateAction<string | undefined>>\n setIsActivateSuccess: Dispatch<SetStateAction<boolean>>\n setOnAuthSuccess: Dispatch<SetStateAction<(() => void) | undefined>>\n autoSendEmail: boolean\n setAutoSendEmail: Dispatch<SetStateAction<boolean>>\n }\n}\n\nexport const RegistrationContext = createContext<RegistrationContextType>({\n email: undefined,\n copy: undefined,\n authCodeActivate: {\n activeToken: undefined,\n setActiveToken: () => {},\n isOpen: false,\n open: () => {},\n close: () => {},\n isActivateSuccess: false,\n isSendingActivateEmail: false,\n setIsSendingActivateEmail: () => {},\n setIsActivateSuccess: () => {},\n setOnAuthSuccess: () => {},\n onAuthSuccess: undefined,\n autoSendEmail: false,\n setAutoSendEmail: () => {},\n },\n})\n\nexport const useRegistration = () => {\n const context = useContext(RegistrationContext)\n if (!context) {\n throw new Error('useRegistration must be used within a RegistrationProvider')\n }\n return context\n}\n\nexport const RegistrationProvider = ({
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["jsx", "jsxs", "createContext", "useContext", "useState", "AuthCodeActivate", "RegistrationContext", "useRegistration", "context", "RegistrationProvider", "children", "email", "copy", "popAuthCode", "setPopAuthCode", "onAuthSuccess", "setOnAuthSuccess", "isActivateSuccess", "setIsActivateSuccess", "activeToken", "setActiveToken", "isSendingActivateEmail", "setIsSendingActivateEmail", "autoSendEmail", "setAutoSendEmail"]
|
|
4
|
+
"sourcesContent": ["import { createContext, Dispatch, PropsWithChildren, SetStateAction, useContext, useState } from 'react'\nimport { AuthCodeActivate } from '../authCodeActivate'\n\ninterface RegistrationContextType {\n email?: string\n copy?: any\n apiBaseUrl?: string\n authCodeActivate: {\n isOpen: boolean\n open: () => void\n close: () => void\n isActivateSuccess: boolean\n activeToken?: string\n onAuthSuccess: (() => void) | undefined\n isSendingActivateEmail: boolean\n setIsSendingActivateEmail: Dispatch<SetStateAction<boolean>>\n setActiveToken: Dispatch<SetStateAction<string | undefined>>\n setIsActivateSuccess: Dispatch<SetStateAction<boolean>>\n setOnAuthSuccess: Dispatch<SetStateAction<(() => void) | undefined>>\n autoSendEmail: boolean\n setAutoSendEmail: Dispatch<SetStateAction<boolean>>\n }\n}\n\nexport const RegistrationContext = createContext<RegistrationContextType>({\n email: undefined,\n copy: undefined,\n authCodeActivate: {\n activeToken: undefined,\n setActiveToken: () => {},\n isOpen: false,\n open: () => {},\n close: () => {},\n isActivateSuccess: false,\n isSendingActivateEmail: false,\n setIsSendingActivateEmail: () => {},\n setIsActivateSuccess: () => {},\n setOnAuthSuccess: () => {},\n onAuthSuccess: undefined,\n autoSendEmail: false,\n setAutoSendEmail: () => {},\n },\n})\n\nexport const useRegistration = () => {\n const context = useContext(RegistrationContext)\n if (!context) {\n throw new Error('useRegistration must be used within a RegistrationProvider')\n }\n return context\n}\n\nexport const RegistrationProvider = ({\n children,\n email,\n copy,\n apiBaseUrl,\n}: PropsWithChildren<{ email?: string; copy?: any; apiBaseUrl?: string }>) => {\n const [popAuthCode, setPopAuthCode] = useState(false)\n const [onAuthSuccess, setOnAuthSuccess] = useState<(() => void) | undefined>(undefined)\n const [isActivateSuccess, setIsActivateSuccess] = useState(false)\n const [activeToken, setActiveToken] = useState<string>()\n const [isSendingActivateEmail, setIsSendingActivateEmail] = useState(false)\n const [autoSendEmail, setAutoSendEmail] = useState(false)\n\n return (\n <RegistrationContext.Provider\n value={{\n email,\n copy,\n apiBaseUrl,\n authCodeActivate: {\n activeToken,\n isOpen: popAuthCode,\n open: () => setPopAuthCode(true),\n close: () => setPopAuthCode(false),\n isActivateSuccess,\n setIsActivateSuccess,\n onAuthSuccess,\n setOnAuthSuccess,\n isSendingActivateEmail,\n setIsSendingActivateEmail,\n setActiveToken,\n autoSendEmail,\n setAutoSendEmail,\n },\n }}\n >\n {children}\n {copy?.authCodeActivate && <AuthCodeActivate copy={copy.authCodeActivate} />}\n </RegistrationContext.Provider>\n )\n}\n"],
|
|
5
|
+
"mappings": "AAkEI,OAuB6B,OAAAA,EAvB7B,QAAAC,MAAA,oBAlEJ,OAAS,iBAAAC,EAA4D,cAAAC,EAAY,YAAAC,MAAgB,QACjG,OAAS,oBAAAC,MAAwB,sBAuB1B,MAAMC,EAAsBJ,EAAuC,CACxE,MAAO,OACP,KAAM,OACN,iBAAkB,CAChB,YAAa,OACb,eAAgB,IAAM,CAAC,EACvB,OAAQ,GACR,KAAM,IAAM,CAAC,EACb,MAAO,IAAM,CAAC,EACd,kBAAmB,GACnB,uBAAwB,GACxB,0BAA2B,IAAM,CAAC,EAClC,qBAAsB,IAAM,CAAC,EAC7B,iBAAkB,IAAM,CAAC,EACzB,cAAe,OACf,cAAe,GACf,iBAAkB,IAAM,CAAC,CAC3B,CACF,CAAC,EAEYK,EAAkB,IAAM,CACnC,MAAMC,EAAUL,EAAWG,CAAmB,EAC9C,GAAI,CAACE,EACH,MAAM,IAAI,MAAM,4DAA4D,EAE9E,OAAOA,CACT,EAEaC,EAAuB,CAAC,CACnC,SAAAC,EACA,MAAAC,EACA,KAAAC,EACA,WAAAC,CACF,IAA8E,CAC5E,KAAM,CAACC,EAAaC,CAAc,EAAIX,EAAS,EAAK,EAC9C,CAACY,EAAeC,CAAgB,EAAIb,EAAmC,MAAS,EAChF,CAACc,EAAmBC,CAAoB,EAAIf,EAAS,EAAK,EAC1D,CAACgB,EAAaC,CAAc,EAAIjB,EAAiB,EACjD,CAACkB,EAAwBC,CAAyB,EAAInB,EAAS,EAAK,EACpE,CAACoB,EAAeC,CAAgB,EAAIrB,EAAS,EAAK,EAExD,OACEH,EAACK,EAAoB,SAApB,CACC,MAAO,CACL,MAAAK,EACA,KAAAC,EACA,WAAAC,EACA,iBAAkB,CAChB,YAAAO,EACA,OAAQN,EACR,KAAM,IAAMC,EAAe,EAAI,EAC/B,MAAO,IAAMA,EAAe,EAAK,EACjC,kBAAAG,EACA,qBAAAC,EACA,cAAAH,EACA,iBAAAC,EACA,uBAAAK,EACA,0BAAAC,EACA,eAAAF,EACA,cAAAG,EACA,iBAAAC,CACF,CACF,EAEC,UAAAf,EACAE,GAAM,kBAAoBZ,EAACK,EAAA,CAAiB,KAAMO,EAAK,iBAAkB,GAC5E,CAEJ",
|
|
6
|
+
"names": ["jsx", "jsxs", "createContext", "useContext", "useState", "AuthCodeActivate", "RegistrationContext", "useRegistration", "context", "RegistrationProvider", "children", "email", "copy", "apiBaseUrl", "popAuthCode", "setPopAuthCode", "onAuthSuccess", "setOnAuthSuccess", "isActivateSuccess", "setIsActivateSuccess", "activeToken", "setActiveToken", "isSendingActivateEmail", "setIsSendingActivateEmail", "autoSendEmail", "setAutoSendEmail"]
|
|
7
7
|
}
|
|
@@ -6,7 +6,7 @@ export declare const useEmailValidation: (config?: SWRMutationConfiguration<any,
|
|
|
6
6
|
}, string, {
|
|
7
7
|
token: string;
|
|
8
8
|
code: string;
|
|
9
|
-
}
|
|
9
|
+
}>, apiBaseUrl?: string) => import("swr/dist/mutation").SWRMutationResponse<any, {
|
|
10
10
|
type: "responseError";
|
|
11
11
|
data: any;
|
|
12
12
|
response: any;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import r from"swr/mutation";import{useHeadlessContext as i}from"../../context";import{fetcher as s}from"../../utils";const g=(t,o)=>{const{locale:a}=i();return r("emailValidation",(c,{arg:{token:e,code:n}})=>s({url:"/api/multipass/account/users/email_validation",baseUrl:o,method:"POST",body:{activation_code:e,verify_code:n},action:"account",needRecaptcha:!0,locale:a}),t)};export{g as useEmailValidation};
|
|
2
2
|
//# sourceMappingURL=useEmailValidation.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/lib/registration/hooks/useEmailValidation.ts"],
|
|
4
|
-
"sourcesContent": ["import useSWRMutation, { SWRMutationConfiguration } from 'swr/mutation'\nimport { useHeadlessContext } from '../../context'\nimport { fetcher } from '../../utils'\n\nexport const useEmailValidation = (\n config?: SWRMutationConfiguration<\n any,\n { type: 'responseError'; data: any; response: any },\n string,\n { token: string; code: string }\n
|
|
5
|
-
"mappings": "AAAA,OAAOA,MAAkD,eACzD,OAAS,sBAAAC,MAA0B,gBACnC,OAAS,WAAAC,MAAe,cAEjB,MAAMC,
|
|
6
|
-
"names": ["useSWRMutation", "useHeadlessContext", "fetcher", "useEmailValidation", "config", "locale", "_", "token", "code"]
|
|
4
|
+
"sourcesContent": ["import useSWRMutation, { SWRMutationConfiguration } from 'swr/mutation'\nimport { useHeadlessContext } from '../../context'\nimport { fetcher } from '../../utils'\n\nexport const useEmailValidation = (\n config?: SWRMutationConfiguration<\n any,\n { type: 'responseError'; data: any; response: any },\n string,\n { token: string; code: string }\n >,\n apiBaseUrl?: string\n) => {\n const { locale } = useHeadlessContext()\n return useSWRMutation(\n 'emailValidation',\n (_, { arg: { token, code } }: { arg: { token: string; code: string } }) => {\n return fetcher({\n url: `/api/multipass/account/users/email_validation`,\n baseUrl: apiBaseUrl,\n method: 'POST',\n body: { activation_code: token, verify_code: code },\n action: 'account',\n needRecaptcha: true,\n locale,\n })\n },\n config\n )\n}\n"],
|
|
5
|
+
"mappings": "AAAA,OAAOA,MAAkD,eACzD,OAAS,sBAAAC,MAA0B,gBACnC,OAAS,WAAAC,MAAe,cAEjB,MAAMC,EAAqB,CAChCC,EAMAC,IACG,CACH,KAAM,CAAE,OAAAC,CAAO,EAAIL,EAAmB,EACtC,OAAOD,EACL,kBACA,CAACO,EAAG,CAAE,IAAK,CAAE,MAAAC,EAAO,KAAAC,CAAK,CAAE,IAClBP,EAAQ,CACb,IAAK,gDACL,QAASG,EACT,OAAQ,OACR,KAAM,CAAE,gBAAiBG,EAAO,YAAaC,CAAK,EAClD,OAAQ,UACR,cAAe,GACf,OAAAH,CACF,CAAC,EAEHF,CACF,CACF",
|
|
6
|
+
"names": ["useSWRMutation", "useHeadlessContext", "fetcher", "useEmailValidation", "config", "apiBaseUrl", "locale", "_", "token", "code"]
|
|
7
7
|
}
|
|
@@ -3,6 +3,6 @@ export type RequestData = {
|
|
|
3
3
|
email: string;
|
|
4
4
|
data: any;
|
|
5
5
|
};
|
|
6
|
-
export declare function useSendEmailValidation(): SWRMutationResponse<any, any, string, {
|
|
6
|
+
export declare function useSendEmailValidation(apiBaseUrl?: string): SWRMutationResponse<any, any, string, {
|
|
7
7
|
email: string;
|
|
8
8
|
} & any>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import o from"swr/mutation";import{useHeadlessContext as s}from"../../context";import{fetcher as r}from"../../utils";function c(a){const{appName:e,locale:t}=s();return o("send-email-validation",(p,{arg:{email:n,...i}})=>r({locale:t,url:"/api/multipass/account/users/send_validation_email",baseUrl:a,method:"POST",body:{email:n,app:e,...i},needRecaptcha:!0,action:"verifyAccount"}))}export{c as useSendEmailValidation};
|
|
2
2
|
//# sourceMappingURL=useSendEmailValidation.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/lib/registration/hooks/useSendEmailValidation.ts"],
|
|
4
|
-
"sourcesContent": ["import useSWRMutation, { type SWRMutationResponse } from 'swr/mutation'\nimport { useHeadlessContext } from '../../context'\nimport { fetcher } from '../../utils'\n\n// data \u53C2\u6570\u4F1A\u88AB stringify \u540E\u653E\u5165\u5230\u90AE\u4EF6\u94FE\u63A5\u53C2\u6570\u4E2D\nexport type RequestData = { email: string; data: any }\n\nexport function useSendEmailValidation(): SWRMutationResponse<any, any, string, { email: string } & any> {\n const { appName, locale } = useHeadlessContext()\n\n return useSWRMutation('send-email-validation', (_, { arg: { email, ...rest } }: { arg: RequestData }) =>\n fetcher({\n locale,\n url: '/api/multipass/account/users/send_validation_email',\n method: 'POST',\n body: { email: email, app: appName, ...rest },\n needRecaptcha: true,\n action: 'verifyAccount',\n })\n )\n}\n"],
|
|
5
|
-
"mappings": "AAAA,OAAOA,MAAkD,eACzD,OAAS,sBAAAC,MAA0B,gBACnC,OAAS,WAAAC,MAAe,cAKjB,SAASC,
|
|
6
|
-
"names": ["useSWRMutation", "useHeadlessContext", "fetcher", "useSendEmailValidation", "appName", "locale", "_", "email", "rest"]
|
|
4
|
+
"sourcesContent": ["import useSWRMutation, { type SWRMutationResponse } from 'swr/mutation'\nimport { useHeadlessContext } from '../../context'\nimport { fetcher } from '../../utils'\n\n// data \u53C2\u6570\u4F1A\u88AB stringify \u540E\u653E\u5165\u5230\u90AE\u4EF6\u94FE\u63A5\u53C2\u6570\u4E2D\nexport type RequestData = { email: string; data: any }\n\nexport function useSendEmailValidation(apiBaseUrl?: string): SWRMutationResponse<any, any, string, { email: string } & any> {\n const { appName, locale } = useHeadlessContext()\n\n return useSWRMutation('send-email-validation', (_, { arg: { email, ...rest } }: { arg: RequestData }) =>\n fetcher({\n locale,\n url: '/api/multipass/account/users/send_validation_email',\n baseUrl: apiBaseUrl,\n method: 'POST',\n body: { email: email, app: appName, ...rest },\n needRecaptcha: true,\n action: 'verifyAccount',\n })\n )\n}\n"],
|
|
5
|
+
"mappings": "AAAA,OAAOA,MAAkD,eACzD,OAAS,sBAAAC,MAA0B,gBACnC,OAAS,WAAAC,MAAe,cAKjB,SAASC,EAAuBC,EAAqF,CAC1H,KAAM,CAAE,QAAAC,EAAS,OAAAC,CAAO,EAAIL,EAAmB,EAE/C,OAAOD,EAAe,wBAAyB,CAACO,EAAG,CAAE,IAAK,CAAE,MAAAC,EAAO,GAAGC,CAAK,CAAE,IAC3EP,EAAQ,CACN,OAAAI,EACA,IAAK,qDACL,QAASF,EACT,OAAQ,OACR,KAAM,CAAE,MAAOI,EAAO,IAAKH,EAAS,GAAGI,CAAK,EAC5C,cAAe,GACf,OAAQ,eACV,CAAC,CACH,CACF",
|
|
6
|
+
"names": ["useSWRMutation", "useHeadlessContext", "fetcher", "useSendEmailValidation", "apiBaseUrl", "appName", "locale", "_", "email", "rest"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const fetcher: ({ locale, url, method, headers, repeatKey, body, type, timeout, }: any) => Promise<any>;
|
|
1
|
+
export declare const fetcher: ({ locale, url, baseUrl, method, headers, repeatKey, body, type, timeout, }: any) => Promise<any>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{handleFetchResponse as
|
|
1
|
+
import{handleFetchResponse as f}from"./fetchResponse";const h=async({locale:l="en",url:o,baseUrl:s,method:a="POST",headers:c={},repeatKey:g,body:e,type:i,timeout:n=9e4})=>{let r="";i==="uploadFile"?r=e:r=e?JSON.stringify(e):"";const t=new AbortController;n&&setTimeout(()=>t.abort(),n);const d=await fetch(`${s||""}${o}`,{method:a,mode:"cors",credentials:"include",headers:{"current-language":l,...c},...n&&{signal:t.signal},...a!=="GET"&&{body:r}});return f(d)};export{h as fetcher};
|
|
2
2
|
//# sourceMappingURL=fetcher.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/lib/utils/fetcher/fetcher.ts"],
|
|
4
|
-
"sourcesContent": ["import { handleFetchResponse } from './fetchResponse'\n\nexport const fetcher = async ({\n locale = 'en',\n url,\n method = 'POST',\n headers = {},\n repeatKey,\n body,\n type,\n timeout = 90000,\n}: any) => {\n // \u6DFB\u52A0\u8C37\u6B4C\u9A8C\u8BC1\n let bodyData = ''\n if (type === 'uploadFile') {\n bodyData = body\n } else {\n bodyData = body ? JSON.stringify(body) : ''\n }\n\n const controller = new AbortController()\n if (timeout) {\n // \u8D85\u65F6\u62A5\u9519\n setTimeout(() => controller.abort(), timeout)\n }\n\n const data = await fetch(url
|
|
5
|
-
"mappings": "AAAA,OAAS,uBAAAA,MAA2B,kBAE7B,MAAMC,EAAU,MAAO,CAC5B,OAAAC,EAAS,KACT,IAAAC,EACA,OAAAC,EAAS,OACT,QAAAC,EAAU,CAAC,EACX,UAAAC,EACA,KAAAC,EACA,KAAAC,EACA,QAAAC,EAAU,GACZ,IAAW,CAET,IAAIC,EAAW,GACXF,IAAS,aACXE,EAAWH,EAEXG,EAAWH,EAAO,KAAK,UAAUA,CAAI,EAAI,GAG3C,MAAMI,EAAa,IAAI,gBACnBF,GAEF,WAAW,IAAME,EAAW,MAAM,EAAGF,CAAO,EAG9C,MAAMG,EAAO,MAAM,
|
|
6
|
-
"names": ["handleFetchResponse", "fetcher", "locale", "url", "method", "headers", "repeatKey", "body", "type", "timeout", "bodyData", "controller", "data"]
|
|
4
|
+
"sourcesContent": ["import { handleFetchResponse } from './fetchResponse'\n\nexport const fetcher = async ({\n locale = 'en',\n url,\n baseUrl,\n method = 'POST',\n headers = {},\n repeatKey,\n body,\n type,\n timeout = 90000,\n}: any) => {\n // \u6DFB\u52A0\u8C37\u6B4C\u9A8C\u8BC1\n let bodyData = ''\n if (type === 'uploadFile') {\n bodyData = body\n } else {\n bodyData = body ? JSON.stringify(body) : ''\n }\n\n const controller = new AbortController()\n if (timeout) {\n // \u8D85\u65F6\u62A5\u9519\n setTimeout(() => controller.abort(), timeout)\n }\n\n const data = await fetch(`${baseUrl || ''}${url}`, {\n method,\n mode: 'cors',\n credentials: 'include',\n headers: {\n 'current-language': locale,\n ...headers,\n },\n ...(timeout && { signal: controller.signal }),\n ...(method !== 'GET' && { body: bodyData }),\n })\n return handleFetchResponse(data)\n}\n"],
|
|
5
|
+
"mappings": "AAAA,OAAS,uBAAAA,MAA2B,kBAE7B,MAAMC,EAAU,MAAO,CAC5B,OAAAC,EAAS,KACT,IAAAC,EACA,QAAAC,EACA,OAAAC,EAAS,OACT,QAAAC,EAAU,CAAC,EACX,UAAAC,EACA,KAAAC,EACA,KAAAC,EACA,QAAAC,EAAU,GACZ,IAAW,CAET,IAAIC,EAAW,GACXF,IAAS,aACXE,EAAWH,EAEXG,EAAWH,EAAO,KAAK,UAAUA,CAAI,EAAI,GAG3C,MAAMI,EAAa,IAAI,gBACnBF,GAEF,WAAW,IAAME,EAAW,MAAM,EAAGF,CAAO,EAG9C,MAAMG,EAAO,MAAM,MAAM,GAAGT,GAAW,EAAE,GAAGD,CAAG,GAAI,CACjD,OAAAE,EACA,KAAM,OACN,YAAa,UACb,QAAS,CACP,mBAAoBH,EACpB,GAAGI,CACL,EACA,GAAII,GAAW,CAAE,OAAQE,EAAW,MAAO,EAC3C,GAAIP,IAAW,OAAS,CAAE,KAAMM,CAAS,CAC3C,CAAC,EACD,OAAOX,EAAoBa,CAAI,CACjC",
|
|
6
|
+
"names": ["handleFetchResponse", "fetcher", "locale", "url", "baseUrl", "method", "headers", "repeatKey", "body", "type", "timeout", "bodyData", "controller", "data"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Fragment as g,jsx as o,jsxs as u}from"react/jsx-runtime";import{classNames as M,HeadlessProvider as h}from"../lib";import{useEffect as T,useRef as
|
|
1
|
+
import{Fragment as g,jsx as o,jsxs as u}from"react/jsx-runtime";import{classNames as M,HeadlessProvider as h}from"../lib";import{useEffect as T,useRef as B}from"react";import{RegistrationProvider as w}from"../components/registration/context/provider";import{CreditsProvider as b,useCreditsContext as I}from"../components/credits/context/provider";import{CreditsBanner as G}from"../components/credits/creditsBanner";import{CreditsInfoCard as R}from"../components/credits/creditsInfoCard";import{CreditsBenefits as L}from"../components/credits/creditsBenefits";import{CreditsWaysToGetCredits as N}from"../components/credits/creditsWaysToGetCredits";import{CreditsAnkersolixTask as A}from"../components/credits/creditsAnkersolixTask";import{CreditsRedeemList as S}from"../components/credits/creditsRedeemList";import{CreditsGoGift as D}from"../components/credits/creditsGoGift";import{CreditsCash as F}from"../components/credits/creditsCash";import{CreditsMemberPrice as U}from"../components/credits/creditsMemberPrice";import{CreditsFaq as q}from"../components/credits/creditsFaq";import{CreditsNavigation as O}from"../components/credits/creditsNavigation";import x from"../components/credits/modal/ActivitiesModal";import W from"../components/credits/modal/RewardsModal";import{ComponentKey as i}from"./Credits.types";const E=({headlessConfig:d,pageConfig:s,userContext:p})=>{const{openMyRewardsModal:t,setOpenMyRewardsModal:n,openActivitiesModal:m,setOpenActivitiesModal:C,pageCommon:a}=I(),l=B(!1);return T(()=>{if(l.current||typeof window>"u")return;const r=new URLSearchParams(window.location.search).get("section");if(!r)return;const P=56,c=(f=0)=>{const y=document.getElementById(r);if(y){l.current=!0;const v=y.getBoundingClientRect().top+window.pageYOffset-P;window.scrollTo({top:v,behavior:"smooth"})}else f<10&&setTimeout(()=>c(f+1),300)};c()},[]),u(g,{children:[s.components[i.Navigation]&&o(O,{copy:s.components[i.Navigation]}),o("div",{className:M("bg-[#f5f5f7] leading-[1.2]"),children:s.order.map(e=>{if(e===i.Navigation)return null;const r=s.components?.[e];return r?u(g,{children:[e===i.Banner&&o(G,{copy:r,id:e}),e===i.InfoCard&&p?.profile&&o(R,{copy:r,id:e}),e===i.Benefits&&o(L,{copy:r,id:e}),e===i.WaysToGetCredits&&o(N,{copy:r,id:e,classNames:d.brand==="anker"?{subtitle:"text-white",equalCreditsText:"bg-gradient-to-r from-[#3AD1FF] to-[#008CD6] bg-clip-text text-transparent"}:{subtitle:"text-[#D1D1D1]",equalCreditsText:"text-[#F6EAD0]"}}),e===i.AnkersolixTask&&o(A,{copy:r,id:e}),e===i.RedeemList&&o(S,{copy:r,id:e}),e===i.GoGift&&o(D,{copy:r,id:e}),e===i.SpendCreditsLikeCash&&o(F,{copy:r,id:e}),e===i.MemberPrice&&o(U,{copy:r,id:e}),e===i.Faqs&&o(q,{copy:r,id:e}),e!==i.Banner&&o("div",{className:"laptop:h-16 desktop:h-[96px] lg-desktop:h-[128px] tablet:h-16 h-16"})]}):null})}),a?.activitiesModal&&o(x,{isOpen:m,data:a.activitiesModal,onClose:()=>C(!1)}),a?.rewardsModal&&o(W,{isOpen:t,data:a.rewardsModal,onClose:()=>n(!1)})]})},se=({headlessConfig:d,siteConfig:s,creditsConfig:p,userContext:t,pageConfig:n,registrationContext:m,gtm:C,cartConfig:a})=>o(h,{headlessConfig:d,children:o(w,{copy:s.registrationsSettings,email:t?.profile?.email,apiBaseUrl:t?.apiBaseUrl,children:o(b,{profile:t?.profile,removeProfile:t?.removeProfile,isLoadingProfile:t?.isLoadingProfile,openSignInPopup:m.openSignInPopup,openSignUpPopup:m.openSignUpPopup,creditInfo:t?.creditInfo,taskIdToTypeMapping:s.taskIdToTypeMapping,taskNameMapping:s.taskNameMapping,customer:t?.customer,fetchCreditInfo:t?.fetchCreditInfo,customerLoading:t?.customerLoading,gtm:C,pageCommon:n.common,memberPriceDiscount:s.memberPriceDiscount,alpcBrand:p?.alpcBrand,alpcCountry:p?.alpcCountry,cartConfig:a,apiBaseUrl:t?.apiBaseUrl,children:o(E,{headlessConfig:d,pageConfig:n,userContext:t})})})});export{se as CreditsTemplate};
|
|
2
2
|
//# sourceMappingURL=Credits.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/templates/Credits.tsx"],
|
|
4
|
-
"sourcesContent": ["import { classNames, HeadlessProvider } from '../lib'\nimport { useEffect, useRef } from 'react'\nimport { RegistrationProvider } from '../components/registration/context/provider'\nimport { CreditsProvider, useCreditsContext } from '../components/credits/context/provider'\nimport { CreditsBanner } from '../components/credits/creditsBanner'\nimport { CreditsInfoCard } from '../components/credits/creditsInfoCard'\nimport { CreditsBenefits } from '../components/credits/creditsBenefits'\nimport { CreditsWaysToGetCredits } from '../components/credits/creditsWaysToGetCredits'\nimport { CreditsAnkersolixTask } from '../components/credits/creditsAnkersolixTask'\nimport { CreditsRedeemList } from '../components/credits/creditsRedeemList'\nimport { CreditsGoGift } from '../components/credits/creditsGoGift'\nimport { CreditsCash } from '../components/credits/creditsCash'\nimport { CreditsMemberPrice } from '../components/credits/creditsMemberPrice'\nimport { CreditsFaq } from '../components/credits/creditsFaq'\nimport { CreditsNavigation } from '../components/credits/creditsNavigation'\nimport ActivitiesModal from '../components/credits/modal/ActivitiesModal'\nimport RewardsModal from '../components/credits/modal/RewardsModal'\nimport { ComponentKey } from './Credits.types'\nimport type {\n CreditsTemplateProps,\n CreditsContentProps,\n CreditsBannerCopy,\n CreditsInfoCardCopy,\n CreditsBenefitsCopy,\n CreditsWaysToGetCreditsCopy,\n CreditsAnkersolixTaskCopy,\n CreditsRedeemListCopy,\n CreditsGoGiftCopy,\n CreditsCashCopy,\n CreditsMemberPriceCopy,\n CreditsFaqCopy,\n} from './Credits.types'\n\nconst CreditsContent = ({ headlessConfig, pageConfig, userContext }: CreditsContentProps) => {\n const { openMyRewardsModal, setOpenMyRewardsModal, openActivitiesModal, setOpenActivitiesModal, pageCommon } = useCreditsContext()\n const hasScrolled = useRef(false)\n\n useEffect(() => {\n if (hasScrolled.current || typeof window === 'undefined') return\n\n const params = new URLSearchParams(window.location.search)\n const section = params.get('section')\n if (!section) return\n\n const navHeight = 56\n\n const tryScroll = (attempts = 0) => {\n const el = document.getElementById(section)\n if (el) {\n hasScrolled.current = true\n const top = el.getBoundingClientRect().top + window.pageYOffset - navHeight\n window.scrollTo({ top, behavior: 'smooth' })\n } else if (attempts < 10) {\n setTimeout(() => tryScroll(attempts + 1), 300)\n }\n }\n\n tryScroll()\n }, [])\n\n return (\n <>\n {/* \u5BFC\u822A\u7EC4\u4EF6 - \u56FA\u5B9A\u4F4D\u7F6E\uFF0C\u4E0D\u53C2\u4E0E order \u6392\u5E8F */}\n {pageConfig.components[ComponentKey.Navigation] && (\n <CreditsNavigation copy={pageConfig.components[ComponentKey.Navigation]} />\n )}\n <div className={classNames('bg-[#f5f5f7] leading-[1.2]')}>\n {pageConfig.order.map(key => {\n // \u8DF3\u8FC7\u5BFC\u822A\u7EC4\u4EF6\uFF0C\u56E0\u4E3A\u5B83\u5DF2\u7ECF\u56FA\u5B9A\u6E32\u67D3\u5728\u4E0A\u65B9\n if (key === ComponentKey.Navigation) return null\n const componentCopy = pageConfig.components?.[key]\n if (!componentCopy) return null\n return (\n <>\n {key === ComponentKey.Banner && <CreditsBanner copy={componentCopy as CreditsBannerCopy} id={key} />}\n {key === ComponentKey.InfoCard && userContext?.profile && (\n <CreditsInfoCard copy={componentCopy as CreditsInfoCardCopy} id={key} />\n )}\n {key === ComponentKey.Benefits && (\n <CreditsBenefits copy={componentCopy as CreditsBenefitsCopy} id={key} />\n )}\n {key === ComponentKey.WaysToGetCredits && (\n <CreditsWaysToGetCredits\n copy={componentCopy as CreditsWaysToGetCreditsCopy}\n id={key}\n classNames={\n headlessConfig.brand === 'anker'\n ? {\n subtitle: 'text-white',\n equalCreditsText:\n 'bg-gradient-to-r from-[#3AD1FF] to-[#008CD6] bg-clip-text text-transparent',\n }\n : {\n subtitle: 'text-[#D1D1D1]',\n equalCreditsText: 'text-[#F6EAD0]',\n }\n }\n />\n )}\n {key === ComponentKey.AnkersolixTask && (\n <CreditsAnkersolixTask copy={componentCopy as CreditsAnkersolixTaskCopy} id={key} />\n )}\n {key === ComponentKey.RedeemList && (\n <CreditsRedeemList copy={componentCopy as CreditsRedeemListCopy} id={key} />\n )}\n {key === ComponentKey.GoGift && <CreditsGoGift copy={componentCopy as CreditsGoGiftCopy} id={key} />}\n {key === ComponentKey.SpendCreditsLikeCash && (\n <CreditsCash copy={componentCopy as CreditsCashCopy} id={key} />\n )}\n {key === ComponentKey.MemberPrice && (\n <CreditsMemberPrice copy={componentCopy as CreditsMemberPriceCopy} id={key} />\n )}\n {key === ComponentKey.Faqs && <CreditsFaq copy={componentCopy as CreditsFaqCopy} id={key} />}\n {key !== ComponentKey.Banner && (\n <div className=\"laptop:h-16 desktop:h-[96px] lg-desktop:h-[128px] tablet:h-16 h-16\" />\n )}\n </>\n )\n })}\n </div>\n\n {/* Global Modals */}\n {pageCommon?.activitiesModal && (\n <ActivitiesModal\n isOpen={openActivitiesModal}\n data={pageCommon.activitiesModal}\n onClose={() => setOpenActivitiesModal(false)}\n />\n )}\n {pageCommon?.rewardsModal && (\n <RewardsModal\n isOpen={openMyRewardsModal}\n data={pageCommon.rewardsModal}\n onClose={() => setOpenMyRewardsModal(false)}\n />\n )}\n </>\n )\n}\n\nexport const CreditsTemplate = ({\n headlessConfig,\n siteConfig,\n creditsConfig,\n userContext,\n pageConfig,\n registrationContext,\n gtm,\n cartConfig,\n}: CreditsTemplateProps) => {\n return (\n <HeadlessProvider headlessConfig={headlessConfig}>\n <RegistrationProvider
|
|
5
|
-
"mappings": "AAgEQ,OASI,YAAAA,EATJ,OAAAC,EASI,QAAAC,MATJ,oBAhER,OAAS,cAAAC,EAAY,oBAAAC,MAAwB,SAC7C,OAAS,aAAAC,EAAW,UAAAC,MAAc,QAClC,OAAS,wBAAAC,MAA4B,8CACrC,OAAS,mBAAAC,EAAiB,qBAAAC,MAAyB,yCACnD,OAAS,iBAAAC,MAAqB,sCAC9B,OAAS,mBAAAC,MAAuB,wCAChC,OAAS,mBAAAC,MAAuB,wCAChC,OAAS,2BAAAC,MAA+B,gDACxC,OAAS,yBAAAC,MAA6B,8CACtC,OAAS,qBAAAC,MAAyB,0CAClC,OAAS,iBAAAC,MAAqB,sCAC9B,OAAS,eAAAC,MAAmB,oCAC5B,OAAS,sBAAAC,MAA0B,2CACnC,OAAS,cAAAC,MAAkB,mCAC3B,OAAS,qBAAAC,MAAyB,0CAClC,OAAOC,MAAqB,8CAC5B,OAAOC,MAAkB,2CACzB,OAAS,gBAAAC,MAAoB,kBAgB7B,MAAMC,EAAiB,CAAC,C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esContent": ["import { classNames, HeadlessProvider } from '../lib'\nimport { useEffect, useRef } from 'react'\nimport { RegistrationProvider } from '../components/registration/context/provider'\nimport { CreditsProvider, useCreditsContext } from '../components/credits/context/provider'\nimport { CreditsBanner } from '../components/credits/creditsBanner'\nimport { CreditsInfoCard } from '../components/credits/creditsInfoCard'\nimport { CreditsBenefits } from '../components/credits/creditsBenefits'\nimport { CreditsWaysToGetCredits } from '../components/credits/creditsWaysToGetCredits'\nimport { CreditsAnkersolixTask } from '../components/credits/creditsAnkersolixTask'\nimport { CreditsRedeemList } from '../components/credits/creditsRedeemList'\nimport { CreditsGoGift } from '../components/credits/creditsGoGift'\nimport { CreditsCash } from '../components/credits/creditsCash'\nimport { CreditsMemberPrice } from '../components/credits/creditsMemberPrice'\nimport { CreditsFaq } from '../components/credits/creditsFaq'\nimport { CreditsNavigation } from '../components/credits/creditsNavigation'\nimport ActivitiesModal from '../components/credits/modal/ActivitiesModal'\nimport RewardsModal from '../components/credits/modal/RewardsModal'\nimport { ComponentKey } from './Credits.types'\nimport type {\n CreditsTemplateProps,\n CreditsContentProps,\n CreditsBannerCopy,\n CreditsInfoCardCopy,\n CreditsBenefitsCopy,\n CreditsWaysToGetCreditsCopy,\n CreditsAnkersolixTaskCopy,\n CreditsRedeemListCopy,\n CreditsGoGiftCopy,\n CreditsCashCopy,\n CreditsMemberPriceCopy,\n CreditsFaqCopy,\n} from './Credits.types'\n\nconst CreditsContent = ({ headlessConfig, pageConfig, userContext }: CreditsContentProps) => {\n const { openMyRewardsModal, setOpenMyRewardsModal, openActivitiesModal, setOpenActivitiesModal, pageCommon } = useCreditsContext()\n const hasScrolled = useRef(false)\n\n useEffect(() => {\n if (hasScrolled.current || typeof window === 'undefined') return\n\n const params = new URLSearchParams(window.location.search)\n const section = params.get('section')\n if (!section) return\n\n const navHeight = 56\n\n const tryScroll = (attempts = 0) => {\n const el = document.getElementById(section)\n if (el) {\n hasScrolled.current = true\n const top = el.getBoundingClientRect().top + window.pageYOffset - navHeight\n window.scrollTo({ top, behavior: 'smooth' })\n } else if (attempts < 10) {\n setTimeout(() => tryScroll(attempts + 1), 300)\n }\n }\n\n tryScroll()\n }, [])\n\n return (\n <>\n {/* \u5BFC\u822A\u7EC4\u4EF6 - \u56FA\u5B9A\u4F4D\u7F6E\uFF0C\u4E0D\u53C2\u4E0E order \u6392\u5E8F */}\n {pageConfig.components[ComponentKey.Navigation] && (\n <CreditsNavigation copy={pageConfig.components[ComponentKey.Navigation]} />\n )}\n <div className={classNames('bg-[#f5f5f7] leading-[1.2]')}>\n {pageConfig.order.map(key => {\n // \u8DF3\u8FC7\u5BFC\u822A\u7EC4\u4EF6\uFF0C\u56E0\u4E3A\u5B83\u5DF2\u7ECF\u56FA\u5B9A\u6E32\u67D3\u5728\u4E0A\u65B9\n if (key === ComponentKey.Navigation) return null\n const componentCopy = pageConfig.components?.[key]\n if (!componentCopy) return null\n return (\n <>\n {key === ComponentKey.Banner && <CreditsBanner copy={componentCopy as CreditsBannerCopy} id={key} />}\n {key === ComponentKey.InfoCard && userContext?.profile && (\n <CreditsInfoCard copy={componentCopy as CreditsInfoCardCopy} id={key} />\n )}\n {key === ComponentKey.Benefits && (\n <CreditsBenefits copy={componentCopy as CreditsBenefitsCopy} id={key} />\n )}\n {key === ComponentKey.WaysToGetCredits && (\n <CreditsWaysToGetCredits\n copy={componentCopy as CreditsWaysToGetCreditsCopy}\n id={key}\n classNames={\n headlessConfig.brand === 'anker'\n ? {\n subtitle: 'text-white',\n equalCreditsText:\n 'bg-gradient-to-r from-[#3AD1FF] to-[#008CD6] bg-clip-text text-transparent',\n }\n : {\n subtitle: 'text-[#D1D1D1]',\n equalCreditsText: 'text-[#F6EAD0]',\n }\n }\n />\n )}\n {key === ComponentKey.AnkersolixTask && (\n <CreditsAnkersolixTask copy={componentCopy as CreditsAnkersolixTaskCopy} id={key} />\n )}\n {key === ComponentKey.RedeemList && (\n <CreditsRedeemList copy={componentCopy as CreditsRedeemListCopy} id={key} />\n )}\n {key === ComponentKey.GoGift && <CreditsGoGift copy={componentCopy as CreditsGoGiftCopy} id={key} />}\n {key === ComponentKey.SpendCreditsLikeCash && (\n <CreditsCash copy={componentCopy as CreditsCashCopy} id={key} />\n )}\n {key === ComponentKey.MemberPrice && (\n <CreditsMemberPrice copy={componentCopy as CreditsMemberPriceCopy} id={key} />\n )}\n {key === ComponentKey.Faqs && <CreditsFaq copy={componentCopy as CreditsFaqCopy} id={key} />}\n {key !== ComponentKey.Banner && (\n <div className=\"laptop:h-16 desktop:h-[96px] lg-desktop:h-[128px] tablet:h-16 h-16\" />\n )}\n </>\n )\n })}\n </div>\n\n {/* Global Modals */}\n {pageCommon?.activitiesModal && (\n <ActivitiesModal\n isOpen={openActivitiesModal}\n data={pageCommon.activitiesModal}\n onClose={() => setOpenActivitiesModal(false)}\n />\n )}\n {pageCommon?.rewardsModal && (\n <RewardsModal\n isOpen={openMyRewardsModal}\n data={pageCommon.rewardsModal}\n onClose={() => setOpenMyRewardsModal(false)}\n />\n )}\n </>\n )\n}\n\nexport const CreditsTemplate = ({\n headlessConfig,\n siteConfig,\n creditsConfig,\n userContext,\n pageConfig,\n registrationContext,\n gtm,\n cartConfig,\n}: CreditsTemplateProps) => {\n return (\n <HeadlessProvider headlessConfig={headlessConfig}>\n <RegistrationProvider\n copy={siteConfig.registrationsSettings}\n email={userContext?.profile?.email}\n apiBaseUrl={userContext?.apiBaseUrl}\n >\n <CreditsProvider\n profile={userContext?.profile}\n removeProfile={userContext?.removeProfile}\n isLoadingProfile={userContext?.isLoadingProfile}\n openSignInPopup={registrationContext.openSignInPopup}\n openSignUpPopup={registrationContext.openSignUpPopup}\n creditInfo={userContext?.creditInfo}\n taskIdToTypeMapping={siteConfig.taskIdToTypeMapping}\n taskNameMapping={siteConfig.taskNameMapping}\n customer={userContext?.customer}\n fetchCreditInfo={userContext?.fetchCreditInfo}\n customerLoading={userContext?.customerLoading}\n gtm={gtm}\n pageCommon={pageConfig.common}\n memberPriceDiscount={siteConfig.memberPriceDiscount}\n alpcBrand={creditsConfig?.alpcBrand}\n alpcCountry={creditsConfig?.alpcCountry}\n cartConfig={cartConfig}\n apiBaseUrl={userContext?.apiBaseUrl}\n >\n <CreditsContent headlessConfig={headlessConfig} pageConfig={pageConfig} userContext={userContext} />\n </CreditsProvider>\n </RegistrationProvider>\n </HeadlessProvider>\n )\n}\n"],
|
|
5
|
+
"mappings": "AAgEQ,OASI,YAAAA,EATJ,OAAAC,EASI,QAAAC,MATJ,oBAhER,OAAS,cAAAC,EAAY,oBAAAC,MAAwB,SAC7C,OAAS,aAAAC,EAAW,UAAAC,MAAc,QAClC,OAAS,wBAAAC,MAA4B,8CACrC,OAAS,mBAAAC,EAAiB,qBAAAC,MAAyB,yCACnD,OAAS,iBAAAC,MAAqB,sCAC9B,OAAS,mBAAAC,MAAuB,wCAChC,OAAS,mBAAAC,MAAuB,wCAChC,OAAS,2BAAAC,MAA+B,gDACxC,OAAS,yBAAAC,MAA6B,8CACtC,OAAS,qBAAAC,MAAyB,0CAClC,OAAS,iBAAAC,MAAqB,sCAC9B,OAAS,eAAAC,MAAmB,oCAC5B,OAAS,sBAAAC,MAA0B,2CACnC,OAAS,cAAAC,MAAkB,mCAC3B,OAAS,qBAAAC,MAAyB,0CAClC,OAAOC,MAAqB,8CAC5B,OAAOC,MAAkB,2CACzB,OAAS,gBAAAC,MAAoB,kBAgB7B,MAAMC,EAAiB,CAAC,CAAE,eAAAC,EAAgB,WAAAC,EAAY,YAAAC,CAAY,IAA2B,CAC3F,KAAM,CAAE,mBAAAC,EAAoB,sBAAAC,EAAuB,oBAAAC,EAAqB,uBAAAC,EAAwB,WAAAC,CAAW,EAAIvB,EAAkB,EAC3HwB,EAAc3B,EAAO,EAAK,EAEhC,OAAAD,EAAU,IAAM,CACd,GAAI4B,EAAY,SAAW,OAAO,OAAW,IAAa,OAG1D,MAAMC,EADS,IAAI,gBAAgB,OAAO,SAAS,MAAM,EAClC,IAAI,SAAS,EACpC,GAAI,CAACA,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B,EAAW,OACvB,oBAAqBiB,EAAW,oBAChC,UAAWC,GAAe,UAC1B,YAAaA,GAAe,YAC5B,WAAYG,EACZ,WAAYpB,GAAa,WAEzB,SAAA1B,EAACuB,EAAA,CAAe,eAAgBC,EAAgB,WAAYC,EAAY,YAAaC,EAAa,EACpG,EACF,EACF",
|
|
6
6
|
"names": ["Fragment", "jsx", "jsxs", "classNames", "HeadlessProvider", "useEffect", "useRef", "RegistrationProvider", "CreditsProvider", "useCreditsContext", "CreditsBanner", "CreditsInfoCard", "CreditsBenefits", "CreditsWaysToGetCredits", "CreditsAnkersolixTask", "CreditsRedeemList", "CreditsGoGift", "CreditsCash", "CreditsMemberPrice", "CreditsFaq", "CreditsNavigation", "ActivitiesModal", "RewardsModal", "ComponentKey", "CreditsContent", "headlessConfig", "pageConfig", "userContext", "openMyRewardsModal", "setOpenMyRewardsModal", "openActivitiesModal", "setOpenActivitiesModal", "pageCommon", "hasScrolled", "section", "navHeight", "tryScroll", "attempts", "el", "top", "key", "componentCopy", "CreditsTemplate", "siteConfig", "creditsConfig", "registrationContext", "gtm", "cartConfig"]
|
|
7
7
|
}
|