@hhgtech/hhg-components 1.29.397 → 1.29.399-beta-1
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/build/{InputDate-cb61c874.js → InputDate-aa541b12.js} +17 -7
- package/build/{LastPeriod-d8ddca7e.js → LastPeriod-103d1f20.js} +1 -1
- package/build/{MobileBottomNavigationIcon-d0bf4f2f.js → MobileBottomNavigationIcon-395466c4.js} +3 -3
- package/build/{Spinner-09c645f2.js → Spinner-40bbe05d.js} +1 -1
- package/build/{WhatsApp-bd0758b4.js → WhatsApp-e8f9b3f8.js} +1 -1
- package/build/adapters.js +19 -19
- package/build/atoms.js +48 -48
- package/build/babyGrowth.js +83 -83
- package/build/cache.js +2 -2
- package/build/care.js +17 -17
- package/build/careBookingSearchBar.js +14 -14
- package/build/careBookingSearchBarV2.js +15 -15
- package/build/components/atoms/drawerComponent/index.d.ts +7 -0
- package/build/components/molecules/healthTools/form/dueDateForm/utils.d.ts +10 -0
- package/build/components.js +97 -97
- package/build/{constants-cc117e43.js → constants-b2b0eb4a.js} +1 -1
- package/build/constants.js +3 -3
- package/build/constantsDomainLocales.js +1 -1
- package/build/constantsRiskScreener.js +2 -2
- package/build/constantsSite.js +2 -2
- package/build/{core-854a9835.js → core-c4768755.js} +1 -1
- package/build/{dataTransform-1a7310bf.js → dataTransform-59958928.js} +1 -1
- package/build/ecom.js +4 -4
- package/build/{editor-2ec97fb8.js → editor-6ac7b7d0.js} +11 -11
- package/build/embeddedHeathToolCards_babyGrowth.js +23 -23
- package/build/embeddedHeathToolCards_babyPoop.js +19 -19
- package/build/embeddedHeathToolCards_babyVaccine.js +22 -22
- package/build/embeddedHeathToolCards_bmi_bmi.js +25 -25
- package/build/embeddedHeathToolCards_bmrBmr.js +25 -25
- package/build/embeddedHeathToolCards_dueDate_dueDate.js +22 -22
- package/build/embeddedHeathToolCards_ovulation_ovulation.js +22 -22
- package/build/embeddedHeathToolCards_pwg_pwg.js +26 -26
- package/build/embeddedHeathToolCards_targetHeartRate.js +27 -27
- package/build/esm/{InputDate-3de0b6eb.js → InputDate-040971f3.js} +17 -7
- package/build/esm/{LastPeriod-c00e7236.js → LastPeriod-fdcb654c.js} +1 -1
- package/build/esm/{MobileBottomNavigationIcon-1dc5526b.js → MobileBottomNavigationIcon-87b48227.js} +3 -3
- package/build/esm/{Spinner-37ae77a1.js → Spinner-4b9e00d5.js} +1 -1
- package/build/esm/{WhatsApp-6cf1cba2.js → WhatsApp-10cdd8f4.js} +1 -1
- package/build/esm/adapters.js +19 -19
- package/build/esm/atoms.js +48 -48
- package/build/esm/babyGrowth.js +83 -83
- package/build/esm/cache.js +2 -2
- package/build/esm/care.js +17 -17
- package/build/esm/careBookingSearchBar.js +14 -14
- package/build/esm/careBookingSearchBarV2.js +15 -15
- package/build/esm/components/atoms/drawerComponent/index.d.ts +7 -0
- package/build/esm/components/molecules/healthTools/form/dueDateForm/utils.d.ts +10 -0
- package/build/esm/components.js +97 -97
- package/build/esm/{constants-8391efd4.js → constants-d07b0d23.js} +1 -1
- package/build/esm/constants.js +3 -3
- package/build/esm/constantsDomainLocales.js +1 -1
- package/build/esm/constantsRiskScreener.js +2 -2
- package/build/esm/constantsSite.js +2 -2
- package/build/esm/{core-7ced398e.js → core-81e4f5bd.js} +1 -1
- package/build/esm/{dataTransform-33dce2b7.js → dataTransform-7b74f0e3.js} +1 -1
- package/build/esm/ecom.js +4 -4
- package/build/esm/{editor-225465e9.js → editor-4a1b99ac.js} +11 -11
- package/build/esm/embeddedHeathToolCards_babyGrowth.js +23 -23
- package/build/esm/embeddedHeathToolCards_babyPoop.js +19 -19
- package/build/esm/embeddedHeathToolCards_babyVaccine.js +22 -22
- package/build/esm/embeddedHeathToolCards_bmi_bmi.js +25 -25
- package/build/esm/embeddedHeathToolCards_bmrBmr.js +25 -25
- package/build/esm/embeddedHeathToolCards_dueDate_dueDate.js +22 -22
- package/build/esm/embeddedHeathToolCards_ovulation_ovulation.js +22 -22
- package/build/esm/embeddedHeathToolCards_pwg_pwg.js +26 -26
- package/build/esm/embeddedHeathToolCards_targetHeartRate.js +27 -27
- package/build/esm/footer.js +21 -21
- package/build/esm/gAssets.js +2 -2
- package/build/esm/{healthTools-e8b13544.js → healthTools-82e338ca.js} +1 -1
- package/build/esm/healthToolsCardWrapper.js +18 -18
- package/build/esm/healthToolsForm.js +33 -33
- package/build/esm/hooks.js +13 -13
- package/build/esm/i18n-values/id-ID.js +1 -1
- package/build/esm/i18n.js +2 -2
- package/build/esm/i18nV2.js +2 -2
- package/build/esm/{index-f37b2f4c.js → index-04a7046b.js} +13 -13
- package/build/esm/{index-54d05e87.js → index-08a16153.js} +5 -5
- package/build/esm/{index-e160727d.js → index-08c88a64.js} +2 -2
- package/build/esm/{index-fa37e358.js → index-0b04f69e.js} +3 -3
- package/build/esm/{index-bf06494d.js → index-0bf57dd9.js} +6 -6
- package/build/esm/{index-ce42020e.js → index-0c11d8ec.js} +1 -1
- package/build/esm/{index-8ecb1332.js → index-0c2d9911.js} +17 -17
- package/build/esm/{index-a09019fd.js → index-1a612df2.js} +2 -2
- package/build/esm/{index-6c00503e.js → index-1b9036ee.js} +2 -2
- package/build/esm/{index-711160fd.js → index-1d207481.js} +2 -2
- package/build/esm/{index-27607593.js → index-1ecf2690.js} +6 -6
- package/build/esm/{index-190c6d36.js → index-202e6504.js} +11 -11
- package/build/esm/{index-8c21ead4.js → index-262cf0b8.js} +3 -3
- package/build/esm/{index-db5af859.js → index-2a4e631a.js} +2 -2
- package/build/esm/{index-756725c2.js → index-2b5b1084.js} +2 -2
- package/build/esm/{index-52b415e3.js → index-2c36cb80.js} +1 -1
- package/build/esm/{index-cb24aaef.js → index-352ff5bf.js} +10 -10
- package/build/esm/{index-0b5c7bb3.js → index-3584a784.js} +5 -5
- package/build/esm/{index-f1ce4d65.js → index-3a93037b.js} +13 -13
- package/build/esm/{index-599f32ab.js → index-3da6d16e.js} +31 -31
- package/build/esm/{index-9e52e7ff.js → index-3e92d09a.js} +2 -2
- package/build/esm/{index-92bb90c9.js → index-4954ec08.js} +3 -3
- package/build/esm/{index-3d569636.js → index-50197ae5.js} +3 -3
- package/build/esm/{index-b2ad799b.js → index-57c3024c.js} +13 -13
- package/build/esm/{index-dede8436.js → index-57c8d41a.js} +16 -16
- package/build/esm/{index-33f4508d.js → index-57f65f23.js} +15 -15
- package/build/esm/{index-aee74f37.js → index-60f57b5c.js} +1 -1
- package/build/esm/{index-113f57fd.js → index-687aaf84.js} +1 -1
- package/build/esm/{index-b902c3fb.js → index-6978214d.js} +16 -16
- package/build/esm/{index-0af646e0.js → index-6b14ac3a.js} +13 -13
- package/build/esm/{index-110695a5.js → index-72a9a416.js} +2 -2
- package/build/esm/{index-847f9ab6.js → index-742c5132.js} +18 -18
- package/build/esm/{index-18957b53.js → index-75d08c28.js} +16 -16
- package/build/esm/{index-e5026fe0.js → index-77dd3c61.js} +3 -3
- package/build/esm/{index-48ba9a23.js → index-7aa8c45d.js} +2 -2
- package/build/esm/{index-023a138f.js → index-7c1ae8bd.js} +32 -32
- package/build/esm/{index-bad504c6.js → index-80331a57.js} +25 -25
- package/build/esm/{index-c4507a0c.js → index-81e33dfd.js} +3 -3
- package/build/esm/{index-9050f4e9.js → index-8d545249.js} +2 -2
- package/build/esm/{index-cff26977.js → index-8dd72afe.js} +17 -17
- package/build/esm/{index-cfd3d75e.js → index-91a6ab08.js} +8 -8
- package/build/esm/{index-b462e743.js → index-9262d66c.js} +31 -31
- package/build/esm/{index-c07c34ee.js → index-93eafe9d.js} +22 -22
- package/build/esm/{index-98c2852d.js → index-94272011.js} +18 -18
- package/build/esm/{index-4a08219a.js → index-94df575b.js} +1 -1
- package/build/esm/{index-f340ae87.js → index-972733fa.js} +2 -2
- package/build/esm/{index-0914bea0.js → index-9b90b968.js} +4 -4
- package/build/esm/{index-448c4373.js → index-a090bd8a.js} +78 -53
- package/build/esm/{index-4e6b231b.js → index-afbd1441.js} +24 -24
- package/build/esm/{index-dbfb26ed.js → index-b5625901.js} +1 -1
- package/build/esm/{index-3fbf9806.js → index-b672d159.js} +2 -2
- package/build/esm/{index-42d18aba.js → index-b99f89d3.js} +1 -1
- package/build/esm/{index-50f9d5f5.js → index-bd081cae.js} +7 -7
- package/build/esm/{index-aac78899.js → index-bde87f43.js} +6 -6
- package/build/esm/{index-02da49e4.js → index-c1f82f44.js} +6 -6
- package/build/esm/{index-e7780c40.js → index-c5edd42e.js} +17 -17
- package/build/esm/{index-7ee37015.js → index-caf01855.js} +4 -4
- package/build/esm/{index-7132e119.js → index-d0bddde6.js} +1 -1
- package/build/esm/{index-4c04e5bc.js → index-d314155f.js} +21 -21
- package/build/esm/{index-864940b7.js → index-d5f18aab.js} +7 -7
- package/build/esm/{index-12c25215.js → index-d7999708.js} +1 -1
- package/build/esm/{index-c07bd09a.js → index-e341fdf4.js} +2 -2
- package/build/esm/{index-d4867431.js → index-ef528685.js} +6 -6
- package/build/esm/{index-4a02282f.js → index-f5b96d67.js} +2 -2
- package/build/esm/{index-0527b881.js → index-fe8bd886.js} +16 -16
- package/build/esm/index.js +118 -118
- package/build/esm/{labelSorting-76adca0e.js → labelSorting-849f3d40.js} +4 -4
- package/build/esm/lead/LeadGen.helpers.d.ts +14 -14
- package/build/esm/lead/LeadGen.type.d.ts +19 -0
- package/build/esm/lead/LeadGenForm/LeadGenEmpty.d.ts +8 -0
- package/build/esm/lead/LeadGenForm/LeadGenForm.helpers.d.ts +1 -1
- package/build/esm/lead/LeadGenLightBoxB/LeadGenLightBoxB.styled.d.ts +262 -0
- package/build/esm/lead/components/context.d.ts +3 -2
- package/build/esm/lead/components/index.d.ts +3 -2
- package/build/esm/lead/icons/NoData.d.ts +3 -0
- package/build/esm/lead/icons/index.d.ts +5 -0
- package/build/esm/lead/layouts/lightbox/index.d.ts +8 -4
- package/build/esm/lead/leadGenContext.d.ts +7 -0
- package/build/esm/lead/newLeadPopup.d.ts +5 -3
- package/build/esm/lead/services/index.d.ts +2 -1
- package/build/esm/lead/utils/formatFormData.d.ts +6 -0
- package/build/esm/lead/utils/formatTrackingData.d.ts +14 -0
- package/build/esm/lead.css +1 -1
- package/build/esm/lead.js +763 -292
- package/build/esm/{logoIcon-acedf6f6.js → logoIcon-27cb7ffe.js} +2 -2
- package/build/esm/mantine.js +25 -25
- package/build/esm/misc.js +17 -17
- package/build/esm/miscGetDynamicHealthTool.js +4 -4
- package/build/esm/miscGetSocialList.js +8 -8
- package/build/esm/miscScreenSizeContext.js +1 -1
- package/build/esm/mobileBottomNavigation.js +5 -5
- package/build/esm/mobileBottomNavigationIcon.js +5 -5
- package/build/esm/molecules.js +74 -74
- package/build/esm/moleculesArticleCard.js +6 -6
- package/build/esm/moleculesArticleCardV2.js +16 -16
- package/build/esm/navigation.js +46 -46
- package/build/esm/navigationLogoutPopup.js +9 -9
- package/build/esm/navigationProfileButton.js +23 -23
- package/build/esm/onboardingV2.js +29 -29
- package/build/esm/organisms.js +50 -50
- package/build/esm/{post-a58ebf7c.js → post-a0d61d79.js} +2 -2
- package/build/esm/profileNavigation.js +19 -19
- package/build/esm/progressBar.js +1 -1
- package/build/esm/pwg.js +22 -22
- package/build/esm/ssoV2.js +31 -31
- package/build/esm/{store-94edb3b3.js → store-654b826f.js} +3 -3
- package/build/esm/subot.js +36 -36
- package/build/esm/surveyOrPremiumBanner.js +33 -33
- package/build/esm/surveyQuestionCard.js +10 -10
- package/build/esm/{surveyThankyouCard-a6a24b46.js → surveyThankyouCard-9088e1ca.js} +5 -5
- package/build/esm/together.js +56 -56
- package/build/esm/togetherApiUtils.js +4 -4
- package/build/esm/togetherAtoms.js +30 -30
- package/build/esm/togetherComponentGlobalContext.js +4 -4
- package/build/esm/togetherMolecules.js +51 -51
- package/build/esm/togetherMoleculesCardAuthor.js +28 -28
- package/build/esm/togetherMoleculesPostImagePreview.js +11 -11
- package/build/esm/togetherMoleculesProfileDetail.js +39 -39
- package/build/esm/togetherOrganisms.js +50 -50
- package/build/esm/togetherRichTextEditor.js +17 -17
- package/build/esm/togetherShareBox.js +10 -10
- package/build/esm/{translationsProvider-e2245dc2.js → translationsProvider-5bfb084e.js} +1 -1
- package/build/esm/{treePopoverMenu-7502dc2c.js → treePopoverMenu-07f9a293.js} +19 -19
- package/build/esm/{types-e0d98e14.js → types-fac132cf.js} +2 -2
- package/build/esm/types.js +2 -2
- package/build/esm/{useCategory-f0c930aa.js → useCategory-9e326139.js} +5 -5
- package/build/esm/{useHealthToolCache-4b8a204f.js → useHealthToolCache-9581cef2.js} +1 -1
- package/build/esm/{useMantineLocale-36230243.js → useMantineLocale-0e2e5582.js} +6 -6
- package/build/esm/{usePlacesAutocomplete-cbc980ee.js → usePlacesAutocomplete-83ddd788.js} +1 -1
- package/build/esm/{useScreenSize-2bbf367e.js → useScreenSize-8377bc13.js} +2 -2
- package/build/esm/useTogetherAuthRequiredAction.js +10 -10
- package/build/esm/{utils-966f2cee.js → utils-00390482.js} +3 -3
- package/build/esm/{utils-dbc9c0f0.js → utils-9ec63d07.js} +2 -2
- package/build/esm/{utils-539deb75.js → utils-c3112a09.js} +5 -5
- package/build/esm/{utils-2bee2fb4.js → utils-e9d3e777.js} +2 -2
- package/build/esm/vaccination.js +21 -21
- package/build/footer.js +21 -21
- package/build/gAssets.js +2 -2
- package/build/{healthTools-955e57bd.js → healthTools-4be155fb.js} +1 -1
- package/build/healthToolsCardWrapper.js +18 -18
- package/build/healthToolsForm.js +33 -33
- package/build/hooks.js +13 -13
- package/build/i18n-values/id-ID.js +1 -1
- package/build/i18n.js +2 -2
- package/build/i18nV2.js +1 -1
- package/build/{index-1afb5492.js → index-0a77b413.js} +17 -17
- package/build/{index-457ee264.js → index-0bb8ede9.js} +6 -6
- package/build/{index-2fa7fa9c.js → index-0c616755.js} +78 -53
- package/build/{index-111cd51c.js → index-0fff8d2b.js} +6 -6
- package/build/{index-789a2c8f.js → index-14926905.js} +8 -8
- package/build/{index-aa7f2f8e.js → index-14cee6c8.js} +2 -2
- package/build/{index-37b80834.js → index-14fb75ee.js} +4 -4
- package/build/{index-58052fd7.js → index-1536d95d.js} +2 -2
- package/build/{index-26279472.js → index-1666fe3c.js} +2 -2
- package/build/{index-e151865b.js → index-1821d90b.js} +21 -21
- package/build/{index-4a829a3d.js → index-1a980da1.js} +3 -3
- package/build/{index-e180bceb.js → index-22367cd3.js} +17 -17
- package/build/{index-c7da40e0.js → index-27a64f3f.js} +6 -6
- package/build/{index-8e775085.js → index-27c39152.js} +2 -2
- package/build/{index-7a234e75.js → index-29a5d58d.js} +31 -31
- package/build/{index-b5f73835.js → index-2dd0cb94.js} +16 -16
- package/build/{index-7fc05b9e.js → index-2e38c74f.js} +3 -3
- package/build/{index-27815146.js → index-2ef82042.js} +1 -1
- package/build/{index-70de9850.js → index-3459a898.js} +1 -1
- package/build/{index-11233691.js → index-3556792c.js} +2 -2
- package/build/{index-b106675e.js → index-367c4821.js} +1 -1
- package/build/{index-aafaafd3.js → index-37205340.js} +18 -18
- package/build/{index-fa7b3e87.js → index-39b114a2.js} +3 -3
- package/build/{index-ea84a11b.js → index-3d4caf29.js} +4 -4
- package/build/{index-cbadd61d.js → index-3faf8b5f.js} +1 -1
- package/build/{index-28ed74f1.js → index-438e7ba7.js} +5 -5
- package/build/{index-45465636.js → index-4fc84788.js} +1 -1
- package/build/{index-605608ab.js → index-53472cbe.js} +22 -22
- package/build/{index-5142eef5.js → index-5666fd88.js} +2 -2
- package/build/{index-a0cbffda.js → index-57af9738.js} +13 -13
- package/build/{index-501b45c2.js → index-58cbee69.js} +6 -6
- package/build/{index-861663fa.js → index-66814f96.js} +16 -16
- package/build/{index-d896c731.js → index-6f89a632.js} +2 -2
- package/build/{index-3a100f96.js → index-7cfe36b0.js} +25 -25
- package/build/{index-f9e32d5a.js → index-7f869cd9.js} +2 -2
- package/build/{index-9757b60e.js → index-8753a6f8.js} +1 -1
- package/build/{index-4985c02f.js → index-885fcc73.js} +2 -2
- package/build/{index-1712dc69.js → index-902a378f.js} +7 -7
- package/build/{index-c6b097b8.js → index-94cade53.js} +3 -3
- package/build/{index-88a9a7b0.js → index-9c3cd7de.js} +1 -1
- package/build/{index-1676c1f6.js → index-a372afc0.js} +6 -6
- package/build/{index-a6161efc.js → index-a4a7ae64.js} +2 -2
- package/build/{index-3a3bd736.js → index-a4aec26a.js} +2 -2
- package/build/{index-ec35690d.js → index-a76adef8.js} +32 -32
- package/build/{index-86f8e22b.js → index-ad40ef28.js} +1 -1
- package/build/{index-08fcf3aa.js → index-ada60be0.js} +5 -5
- package/build/{index-cec7c2e9.js → index-b416a0e9.js} +1 -1
- package/build/{index-6250307d.js → index-b6e53ae3.js} +15 -15
- package/build/{index-2c5a8ca9.js → index-ba5c2681.js} +31 -31
- package/build/{index-0e634110.js → index-bf551276.js} +2 -2
- package/build/{index-546f0d5e.js → index-c2855d52.js} +16 -16
- package/build/{index-8df6fefb.js → index-c840bee6.js} +17 -17
- package/build/{index-c70382d7.js → index-cd2e940f.js} +2 -2
- package/build/{index-cd397653.js → index-d3c6625d.js} +13 -13
- package/build/{index-ab17d0f2.js → index-d5e77f0b.js} +16 -16
- package/build/{index-62ee4445.js → index-d98d2e78.js} +24 -24
- package/build/{index-b82cddb5.js → index-e12121f4.js} +3 -3
- package/build/{index-95ae1af5.js → index-e13a1d4e.js} +18 -18
- package/build/{index-e36c3713.js → index-e2c91391.js} +7 -7
- package/build/{index-ba1dfbb6.js → index-e35a802b.js} +11 -11
- package/build/{index-7e6e1cab.js → index-e830b854.js} +10 -10
- package/build/{index-cbc87e7c.js → index-eea3b6c6.js} +13 -13
- package/build/{index-539696ad.js → index-f15f2fa9.js} +3 -3
- package/build/{index-c826f710.js → index-f4849d05.js} +2 -2
- package/build/{index-aaecebaa.js → index-f7d2811e.js} +13 -13
- package/build/index.js +118 -118
- package/build/{labelSorting-f89451d4.js → labelSorting-b631349f.js} +4 -4
- package/build/lead/LeadGen.helpers.d.ts +14 -14
- package/build/lead/LeadGen.type.d.ts +19 -0
- package/build/lead/LeadGenForm/LeadGenEmpty.d.ts +8 -0
- package/build/lead/LeadGenForm/LeadGenForm.helpers.d.ts +1 -1
- package/build/lead/LeadGenLightBoxB/LeadGenLightBoxB.styled.d.ts +262 -0
- package/build/lead/components/context.d.ts +3 -2
- package/build/lead/components/index.d.ts +3 -2
- package/build/lead/icons/NoData.d.ts +3 -0
- package/build/lead/icons/index.d.ts +5 -0
- package/build/lead/layouts/lightbox/index.d.ts +8 -4
- package/build/lead/leadGenContext.d.ts +7 -0
- package/build/lead/newLeadPopup.d.ts +5 -3
- package/build/lead/services/index.d.ts +2 -1
- package/build/lead/utils/formatFormData.d.ts +6 -0
- package/build/lead/utils/formatTrackingData.d.ts +14 -0
- package/build/lead.css +1 -1
- package/build/lead.js +763 -292
- package/build/{logoIcon-dfd6c2a2.js → logoIcon-837a016a.js} +2 -2
- package/build/mantine.js +22 -22
- package/build/misc.js +17 -17
- package/build/miscGetDynamicHealthTool.js +4 -4
- package/build/miscGetSocialList.js +8 -8
- package/build/miscScreenSizeContext.js +1 -1
- package/build/mobileBottomNavigation.js +5 -5
- package/build/mobileBottomNavigationIcon.js +5 -5
- package/build/molecules.js +74 -74
- package/build/moleculesArticleCard.js +6 -6
- package/build/moleculesArticleCardV2.js +16 -16
- package/build/navigation.js +46 -46
- package/build/navigationLogoutPopup.js +9 -9
- package/build/navigationProfileButton.js +23 -23
- package/build/onboardingV2.js +28 -28
- package/build/organisms.js +50 -50
- package/build/{post-9c853116.js → post-87dbab20.js} +2 -2
- package/build/profileNavigation.js +19 -19
- package/build/progressBar.js +1 -1
- package/build/pwg.js +22 -22
- package/build/ssoV2.js +29 -29
- package/build/{store-c0cc1ed3.js → store-bb5ee4e6.js} +3 -3
- package/build/subot.js +35 -35
- package/build/surveyOrPremiumBanner.js +33 -33
- package/build/surveyQuestionCard.js +10 -10
- package/build/{surveyThankyouCard-b094b0cc.js → surveyThankyouCard-0e2b84a4.js} +5 -5
- package/build/together.js +56 -56
- package/build/togetherApiUtils.js +4 -4
- package/build/togetherAtoms.js +30 -30
- package/build/togetherComponentGlobalContext.js +4 -4
- package/build/togetherMolecules.js +51 -51
- package/build/togetherMoleculesCardAuthor.js +28 -28
- package/build/togetherMoleculesPostImagePreview.js +11 -11
- package/build/togetherMoleculesProfileDetail.js +39 -39
- package/build/togetherOrganisms.js +50 -50
- package/build/togetherRichTextEditor.js +17 -17
- package/build/togetherShareBox.js +10 -10
- package/build/{translationsProvider-56928a3c.js → translationsProvider-1e52797e.js} +1 -1
- package/build/{treePopoverMenu-08beab6b.js → treePopoverMenu-fa24d7b9.js} +19 -19
- package/build/{types-75b58469.js → types-376ad3f6.js} +2 -2
- package/build/types.js +2 -2
- package/build/{useCategory-6ae322de.js → useCategory-1b373d97.js} +5 -5
- package/build/{useHealthToolCache-f6d33c9b.js → useHealthToolCache-14dbae1e.js} +1 -1
- package/build/{useMantineLocale-3e2ab14d.js → useMantineLocale-0f35569b.js} +6 -6
- package/build/{usePlacesAutocomplete-06298b2c.js → usePlacesAutocomplete-280d1b99.js} +1 -1
- package/build/{useScreenSize-bf9fd1ec.js → useScreenSize-496bb0aa.js} +2 -2
- package/build/useTogetherAuthRequiredAction.js +10 -10
- package/build/{utils-3b31e8c3.js → utils-010c2071.js} +5 -5
- package/build/{utils-b8b39ab6.js → utils-7ab58e7a.js} +2 -2
- package/build/{utils-a06acd51.js → utils-7d37105b.js} +3 -3
- package/build/{utils-cac21f95.js → utils-d2fb3de6.js} +2 -2
- package/build/vaccination.js +21 -21
- package/package.json +1 -1
- /package/build/{BMI_BOYS.percentile.monthly-9f152c2a.js → BMI_BOYS.percentile.monthly-12c1b591.js} +0 -0
- /package/build/{BMI_BOYS.percentile.weekly-97d3222c.js → BMI_BOYS.percentile.weekly-9673877e.js} +0 -0
- /package/build/{BMI_BOYS.percentile.yearly-5f0acf05.js → BMI_BOYS.percentile.yearly-752cc020.js} +0 -0
- /package/build/{BMI_BOYS.zscore.monthly-a2e1063e.js → BMI_BOYS.zscore.monthly-ff032036.js} +0 -0
- /package/build/{BMI_BOYS.zscore.weekly-0fba0d7f.js → BMI_BOYS.zscore.weekly-bd8afd8a.js} +0 -0
- /package/build/{BMI_BOYS.zscore.yearly-8a0ed23b.js → BMI_BOYS.zscore.yearly-ed87e955.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.monthly-e761fac3.js → BMI_GIRLS.percentile.monthly-4aa8db0e.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.weekly-30c96d04.js → BMI_GIRLS.percentile.weekly-d23a0b64.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.yearly-f8abc794.js → BMI_GIRLS.percentile.yearly-2af61d49.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.monthly-4cc8b26d.js → BMI_GIRLS.zscore.monthly-c5315776.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.weekly-5daade4d.js → BMI_GIRLS.zscore.weekly-7b301c10.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.yearly-dc817f11.js → BMI_GIRLS.zscore.yearly-ea377aca.js} +0 -0
- /package/build/{ChevronDown-8e7e32c9.js → ChevronDown-d94394a7.js} +0 -0
- /package/build/{Close-d03cb628.js → Close-2457a0c9.js} +0 -0
- /package/build/{Google-a9a0c01a.js → Google-a444bff9.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-8af7454e.js → HEAD CIRCUM_BOYS.percentile.monthly-268c5f7c.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-e31113cd.js → HEAD CIRCUM_BOYS.percentile.weekly-91a9fd20.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-d2ec1246.js → HEAD CIRCUM_BOYS.percentile.yearly-1b3a4204.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-64736415.js → HEAD CIRCUM_BOYS.zscore.monthly-59877b6d.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-3085e7bc.js → HEAD CIRCUM_BOYS.zscore.weekly-4d2921b1.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-ca16e1b1.js → HEAD CIRCUM_BOYS.zscore.yearly-433b8e36.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-76e8d246.js → HEAD CIRCUM_GIRLS.percentile.monthly-39f39042.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-55d95d81.js → HEAD CIRCUM_GIRLS.percentile.weekly-b2480530.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-d1c5a180.js → HEAD CIRCUM_GIRLS.percentile.yearly-3b7c2aaf.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-adfc2acd.js → HEAD CIRCUM_GIRLS.zscore.monthly-1fe42876.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-6b316c6e.js → HEAD CIRCUM_GIRLS.zscore.weekly-202c99af.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-7d7c487c.js → HEAD CIRCUM_GIRLS.zscore.yearly-ba8d8965.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.monthly-9c3b903f.js → HEIGHT_BOYS.percentile.monthly-774046fa.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.weekly-29c1833b.js → HEIGHT_BOYS.percentile.weekly-5f2898b9.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.yearly-db218a30.js → HEIGHT_BOYS.percentile.yearly-fda9b4d7.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.monthly-64e999d1.js → HEIGHT_BOYS.zscore.monthly-7f28ef3a.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.weekly-773bdf94.js → HEIGHT_BOYS.zscore.weekly-7970c4b3.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.yearly-82dc5bd6.js → HEIGHT_BOYS.zscore.yearly-63c14f03.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.monthly-b4b00b8e.js → HEIGHT_GIRLS.percentile.monthly-ed16fc3e.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.weekly-7e3dc1c6.js → HEIGHT_GIRLS.percentile.weekly-60a7f98b.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.yearly-c696c874.js → HEIGHT_GIRLS.percentile.yearly-4383e785.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.monthly-1e3efa55.js → HEIGHT_GIRLS.zscore.monthly-69d42d37.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.weekly-4c8a6df2.js → HEIGHT_GIRLS.zscore.weekly-94aadef4.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.yearly-b201f9f6.js → HEIGHT_GIRLS.zscore.yearly-0eed6395.js} +0 -0
- /package/build/{Locale-d6ed6fd5.js → Locale-d033470f.js} +0 -0
- /package/build/{Visible-8cb29e3b.js → Visible-8f80442f.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.monthly-28b8b791.js → WEIGHT_BOYS.percentile.monthly-0dc0aa37.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.weekly-cb8c252d.js → WEIGHT_BOYS.percentile.weekly-e0faa29f.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.yearly-642524f9.js → WEIGHT_BOYS.percentile.yearly-e09b35b2.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.monthly-29c479ba.js → WEIGHT_BOYS.zscore.monthly-4dbdd2a8.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.weekly-79388d42.js → WEIGHT_BOYS.zscore.weekly-a2fe88cb.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.yearly-04ab41ac.js → WEIGHT_BOYS.zscore.yearly-16701780.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.monthly-6e66b039.js → WEIGHT_GIRLS.percentile.monthly-04bfa3f3.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.weekly-1300e791.js → WEIGHT_GIRLS.percentile.weekly-d5a8692d.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.yearly-1015a28c.js → WEIGHT_GIRLS.percentile.yearly-6e2691f0.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.monthly-d2e917af.js → WEIGHT_GIRLS.zscore.monthly-cdb81153.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.weekly-02c0d2bd.js → WEIGHT_GIRLS.zscore.weekly-01e3ba40.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.yearly-af8b3d14.js → WEIGHT_GIRLS.zscore.yearly-4d6f6b21.js} +0 -0
- /package/build/{animation-ea19bb57.js → animation-13fc9a5c.js} +0 -0
- /package/build/{constants-52aef66c.js → constants-6ddc9740.js} +0 -0
- /package/build/{constants-4f94e6fd.js → constants-de110737.js} +0 -0
- /package/build/{constants-86bdcc53.js → constants-dedace83.js} +0 -0
- /package/build/{dataTransform-44b74b9e.js → dataTransform-dbd3050a.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.monthly-075f5d48.js → BMI_BOYS.percentile.monthly-07164f30.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.weekly-e566b297.js → BMI_BOYS.percentile.weekly-82fda194.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.yearly-968ff034.js → BMI_BOYS.percentile.yearly-0ae9fd50.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.monthly-1f7b53a2.js → BMI_BOYS.zscore.monthly-bdf4543c.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.weekly-f8e35173.js → BMI_BOYS.zscore.weekly-8536052b.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.yearly-32275a4d.js → BMI_BOYS.zscore.yearly-fdd405d6.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.monthly-efe5bd3e.js → BMI_GIRLS.percentile.monthly-5456beb9.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.weekly-e328b638.js → BMI_GIRLS.percentile.weekly-9539456f.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.yearly-1963bfcd.js → BMI_GIRLS.percentile.yearly-722032ad.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.monthly-458782d1.js → BMI_GIRLS.zscore.monthly-b30d67dd.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.weekly-ef8b1961.js → BMI_GIRLS.zscore.weekly-43399cd6.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.yearly-f32a5313.js → BMI_GIRLS.zscore.yearly-1b74a8ca.js} +0 -0
- /package/build/esm/{ChevronDown-e4cc466e.js → ChevronDown-0f0536b9.js} +0 -0
- /package/build/esm/{Close-f335d7d5.js → Close-8709bb1a.js} +0 -0
- /package/build/esm/{Google-a40ce59d.js → Google-e08a3ab5.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.monthly-88877c38.js → HEAD CIRCUM_BOYS.percentile.monthly-04e625ec.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.weekly-ae47f376.js → HEAD CIRCUM_BOYS.percentile.weekly-d75418f8.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.yearly-d2873655.js → HEAD CIRCUM_BOYS.percentile.yearly-f87115e4.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.monthly-ab04bb64.js → HEAD CIRCUM_BOYS.zscore.monthly-1d89f384.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.weekly-42be0c33.js → HEAD CIRCUM_BOYS.zscore.weekly-e67b272c.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.yearly-9e0f7356.js → HEAD CIRCUM_BOYS.zscore.yearly-e0d987e2.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.monthly-28147114.js → HEAD CIRCUM_GIRLS.percentile.monthly-4a9a529c.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.weekly-ec14a371.js → HEAD CIRCUM_GIRLS.percentile.weekly-58fae6b6.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.yearly-b2227c73.js → HEAD CIRCUM_GIRLS.percentile.yearly-7f30c7d5.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.monthly-9e2dc52c.js → HEAD CIRCUM_GIRLS.zscore.monthly-8643b7fa.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.weekly-ca8a02b2.js → HEAD CIRCUM_GIRLS.zscore.weekly-ade97cf9.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.yearly-ea07af92.js → HEAD CIRCUM_GIRLS.zscore.yearly-af7c4fe1.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.monthly-9c0fddf3.js → HEIGHT_BOYS.percentile.monthly-67242b20.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.weekly-7049e16b.js → HEIGHT_BOYS.percentile.weekly-fe2f4fb0.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.yearly-73f5111e.js → HEIGHT_BOYS.percentile.yearly-942c308d.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.monthly-cdb3f14b.js → HEIGHT_BOYS.zscore.monthly-8e9e79f8.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.weekly-6705f40a.js → HEIGHT_BOYS.zscore.weekly-cb7f4a6f.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.yearly-3cb76051.js → HEIGHT_BOYS.zscore.yearly-5f64b5f5.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.monthly-209b4861.js → HEIGHT_GIRLS.percentile.monthly-a533db61.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.weekly-7dd27242.js → HEIGHT_GIRLS.percentile.weekly-ad00c084.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.yearly-54be350a.js → HEIGHT_GIRLS.percentile.yearly-6a1b88a6.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.monthly-3a4a1089.js → HEIGHT_GIRLS.zscore.monthly-e6ecb2ef.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.weekly-731251d8.js → HEIGHT_GIRLS.zscore.weekly-cc797df8.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.yearly-749a8061.js → HEIGHT_GIRLS.zscore.yearly-9f16d4f7.js} +0 -0
- /package/build/esm/{Locale-c05b4162.js → Locale-ef1ab92a.js} +0 -0
- /package/build/esm/{Visible-ce15dc3e.js → Visible-7d5312f2.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.monthly-ae9baf0d.js → WEIGHT_BOYS.percentile.monthly-0001a703.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.weekly-ea249e46.js → WEIGHT_BOYS.percentile.weekly-f498155e.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.yearly-e8066fa4.js → WEIGHT_BOYS.percentile.yearly-ad476998.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.monthly-d4af506c.js → WEIGHT_BOYS.zscore.monthly-d760c689.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.weekly-4ebd43b1.js → WEIGHT_BOYS.zscore.weekly-77cf2afc.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.yearly-9c5344f6.js → WEIGHT_BOYS.zscore.yearly-62d5a122.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.monthly-de2f6755.js → WEIGHT_GIRLS.percentile.monthly-58c5f9b0.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.weekly-1eaa454c.js → WEIGHT_GIRLS.percentile.weekly-ed007a38.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.yearly-ac8d51e9.js → WEIGHT_GIRLS.percentile.yearly-8940c7a5.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.monthly-f4d1616e.js → WEIGHT_GIRLS.zscore.monthly-3e1ad564.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.weekly-169c1e67.js → WEIGHT_GIRLS.zscore.weekly-a2f57b42.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.yearly-279d9930.js → WEIGHT_GIRLS.zscore.yearly-07dfb111.js} +0 -0
- /package/build/esm/{animation-7e1886f4.js → animation-31b053a0.js} +0 -0
- /package/build/esm/{constants-82f3d21d.js → constants-6b69c869.js} +0 -0
- /package/build/esm/{constants-d33263b5.js → constants-aecefa4d.js} +0 -0
- /package/build/esm/{constants-ecd7b299.js → constants-b5fa4078.js} +0 -0
- /package/build/esm/{dataTransform-51d2a647.js → dataTransform-9f8b600e.js} +0 -0
- /package/build/esm/{index-7fa44c0e.js → index-3364346c.js} +0 -0
- /package/build/esm/{index-85f20c91.js → index-409b714e.js} +0 -0
- /package/build/esm/{index-f2b664b2.js → index-87e884b3.js} +0 -0
- /package/build/esm/{index-743926ea.js → index-a197d032.js} +0 -0
- /package/build/esm/{index-59fcd11e.js → index-a5411938.js} +0 -0
- /package/build/esm/{index-7beff254.js → index-c7534f23.js} +0 -0
- /package/build/esm/{index-2bf9e0c7.js → index-cd336f69.js} +0 -0
- /package/build/esm/{index-83b79fc6.js → index-d6782aa6.js} +0 -0
- /package/build/esm/{index.styles-ee329278.js → index.styles-6e33deb7.js} +0 -0
- /package/build/esm/lead/layouts/{ emptyIcon.d.ts → emptyIcon.d.ts} +0 -0
- /package/build/esm/{localizeNumberFormat-3d282054.js → localizeNumberFormat-e332ea1d.js} +0 -0
- /package/build/esm/{normalizeLink-c1b5cc6b.js → normalizeLink-eafb4e5f.js} +0 -0
- /package/build/esm/{number-5016cef5.js → number-ec3de6f8.js} +0 -0
- /package/build/esm/{other-a43016d1.js → other-b683dd98.js} +0 -0
- /package/build/esm/{paths-bec5b0c5.js → paths-31188ffd.js} +0 -0
- /package/build/esm/{translationsContext-a275465e.js → translationsContext-e84e8dd5.js} +0 -0
- /package/build/esm/{tslib.es6-30e6f9a9.js → tslib.es6-a18d2489.js} +0 -0
- /package/build/esm/{types-0216b206.js → types-48f9107a.js} +0 -0
- /package/build/esm/{useIsInit-46e41f1c.js → useIsInit-06acc734.js} +0 -0
- /package/build/esm/{useOutsideClick-dfa1a3dd.js → useOutsideClick-60ca4240.js} +0 -0
- /package/build/esm/{useScrollbarSize-853656f8.js → useScrollbarSize-e2b6fbca.js} +0 -0
- /package/build/esm/{useUniqueId-3e15eabc.js → useUniqueId-d5184b40.js} +0 -0
- /package/build/esm/{utils-1a28819a.js → utils-9edfb2cd.js} +0 -0
- /package/build/{index-b1053088.js → index-01c1eb1c.js} +0 -0
- /package/build/{index-46396ba3.js → index-4789f077.js} +0 -0
- /package/build/{index-be96a59c.js → index-48418ffa.js} +0 -0
- /package/build/{index-66735537.js → index-90cd97e3.js} +0 -0
- /package/build/{index-0acde5e3.js → index-c8c575b1.js} +0 -0
- /package/build/{index-0324e04f.js → index-d32004ec.js} +0 -0
- /package/build/{index-681fd02b.js → index-d5c6fcd7.js} +0 -0
- /package/build/{index-62e98f6e.js → index-db49615a.js} +0 -0
- /package/build/{index.styles-31ab4468.js → index.styles-15321ba5.js} +0 -0
- /package/build/lead/layouts/{ emptyIcon.d.ts → emptyIcon.d.ts} +0 -0
- /package/build/{localizeNumberFormat-e66a05f7.js → localizeNumberFormat-968d75ee.js} +0 -0
- /package/build/{normalizeLink-83d9a351.js → normalizeLink-8d23e8e6.js} +0 -0
- /package/build/{number-21785cfd.js → number-cee994ac.js} +0 -0
- /package/build/{other-9e4ceb9d.js → other-43c05cf3.js} +0 -0
- /package/build/{paths-9daec102.js → paths-1171d7de.js} +0 -0
- /package/build/{translationsContext-43dbcf8f.js → translationsContext-53600e94.js} +0 -0
- /package/build/{tslib.es6-df8551a2.js → tslib.es6-992634ee.js} +0 -0
- /package/build/{types-3325c59c.js → types-af84ece8.js} +0 -0
- /package/build/{useIsInit-6023b3a5.js → useIsInit-66e9555f.js} +0 -0
- /package/build/{useOutsideClick-2401a2e4.js → useOutsideClick-2f7a1647.js} +0 -0
- /package/build/{useScrollbarSize-68754034.js → useScrollbarSize-c74d4050.js} +0 -0
- /package/build/{useUniqueId-27b130fe.js → useUniqueId-3f09990c.js} +0 -0
- /package/build/{utils-1438d0cf.js → utils-ccc9a77a.js} +0 -0
package/build/esm/lead.js
CHANGED
|
@@ -1,52 +1,53 @@
|
|
|
1
|
-
import { _ as __rest, a as __awaiter } from './tslib.es6-
|
|
1
|
+
import { _ as __rest, a as __awaiter } from './tslib.es6-a18d2489.js';
|
|
2
2
|
import React__default, { createContext, useMemo, useEffect, useRef, useState, useContext, useCallback, forwardRef, useImperativeHandle, memo, useLayoutEffect } from 'react';
|
|
3
|
-
import { createStyles, Box, Button as Button$1, Input as Input$1,
|
|
4
|
-
import dayjs from 'dayjs';
|
|
3
|
+
import { createStyles, Box, Button as Button$1, Input as Input$1, Autocomplete, clsx, Checkbox as Checkbox$1, Radio as Radio$1, Select as Select$1, TextInput, NumberInput as NumberInput$1, Portal, Transition, Overlay } from '@mantine/core';
|
|
5
4
|
import debounce from 'lodash/debounce';
|
|
6
5
|
import { createFormContext, useForm } from '@mantine/form';
|
|
7
|
-
import
|
|
6
|
+
import dayjs from 'dayjs';
|
|
7
|
+
import { B as BEARER_TOKEN_COOKIE } from './index-caf01855.js';
|
|
8
8
|
import { getCookie, setCookie } from './miscCookieHelper.js';
|
|
9
|
-
import { u as useTranslations } from './index-
|
|
10
|
-
import { T as TranslationsContext } from './translationsContext-
|
|
11
|
-
import { M as MediaQueries, b as getWrapperDomWithSelector, a as getPopupWrapperDom } from './utils-
|
|
12
|
-
import { T as Text } from './index-
|
|
13
|
-
import { S as Select, d as Checkbox, I as Input, R as Radio, P as Phone, N as NumberInput, O as OTP } from './index-
|
|
14
|
-
import { D as DatePicker } from './index-
|
|
15
|
-
import { B as Button } from './index-
|
|
16
|
-
import './index.styles-
|
|
9
|
+
import { u as useTranslations } from './index-60f57b5c.js';
|
|
10
|
+
import { T as TranslationsContext } from './translationsContext-e84e8dd5.js';
|
|
11
|
+
import { M as MediaQueries, b as getWrapperDomWithSelector, a as getPopupWrapperDom } from './utils-9edfb2cd.js';
|
|
12
|
+
import { T as Text } from './index-1a612df2.js';
|
|
13
|
+
import { S as Select, d as Checkbox, I as Input, R as Radio, P as Phone, N as NumberInput, O as OTP } from './index-202e6504.js';
|
|
14
|
+
import { D as DatePicker } from './index-ef528685.js';
|
|
15
|
+
import { B as Button } from './index-d0bddde6.js';
|
|
16
|
+
import './index.styles-6e33deb7.js';
|
|
17
17
|
import { useClickOutside } from '@mantine/hooks';
|
|
18
|
-
import './useMantineLocale-
|
|
19
|
-
import { C as COMMON_DATE_TRANSLATE_KEY } from './index-
|
|
20
|
-
import './index-
|
|
21
|
-
import { Z as ZINDEX_SSO, I as ISO_FORMAT } from './index-
|
|
22
|
-
import './other-
|
|
23
|
-
import './index-
|
|
24
|
-
import { M as MAPPED_LOCALE } from './utils-
|
|
18
|
+
import './useMantineLocale-0e2e5582.js';
|
|
19
|
+
import { C as COMMON_DATE_TRANSLATE_KEY } from './index-b5625901.js';
|
|
20
|
+
import './index-a197d032.js';
|
|
21
|
+
import { Z as ZINDEX_SSO, I as ISO_FORMAT } from './index-72a9a416.js';
|
|
22
|
+
import './other-b683dd98.js';
|
|
23
|
+
import './index-262cf0b8.js';
|
|
24
|
+
import { M as MAPPED_LOCALE } from './utils-9ec63d07.js';
|
|
25
25
|
import { DateInput } from '@mantine/dates';
|
|
26
|
-
import { u as usePlacesAutocomplete, G as GOOGLE_API_KEY } from './usePlacesAutocomplete-
|
|
27
|
-
import { H as Heading$1 } from './index-
|
|
28
|
-
import { t as translationsMap$1 } from './translationsProvider-
|
|
29
|
-
import { L as LOCALE } from './Locale-
|
|
26
|
+
import { u as usePlacesAutocomplete, G as GOOGLE_API_KEY } from './usePlacesAutocomplete-83ddd788.js';
|
|
27
|
+
import { H as Heading$1 } from './index-972733fa.js';
|
|
28
|
+
import { t as translationsMap$1 } from './translationsProvider-5bfb084e.js';
|
|
29
|
+
import { L as LOCALE } from './Locale-ef1ab92a.js';
|
|
30
30
|
import { v1 } from 'uuid';
|
|
31
31
|
import { parsePhoneNumber } from 'react-phone-number-input';
|
|
32
32
|
import styled from '@emotion/styled';
|
|
33
33
|
import { theme } from './miscTheme.js';
|
|
34
34
|
import { css } from '@emotion/react';
|
|
35
|
-
import { T as TogetherComponentGlobalContext } from './utils-
|
|
36
|
-
import { i as isVideo } from './index-
|
|
37
|
-
import { u as useScreenSize } from './useScreenSize-
|
|
35
|
+
import { T as TogetherComponentGlobalContext } from './utils-00390482.js';
|
|
36
|
+
import { i as isVideo } from './index-3364346c.js';
|
|
37
|
+
import { u as useScreenSize } from './useScreenSize-8377bc13.js';
|
|
38
|
+
import { motion } from 'framer-motion';
|
|
38
39
|
import { createPortal } from 'react-dom';
|
|
39
|
-
import { B as Button$2 } from './index-
|
|
40
|
-
import { I as InputDate } from './InputDate-
|
|
41
|
-
import { D as DrawerComponent } from './index-
|
|
42
|
-
import { C as Close } from './Close-
|
|
40
|
+
import { B as Button$2 } from './index-3e92d09a.js';
|
|
41
|
+
import { I as InputDate } from './InputDate-040971f3.js';
|
|
42
|
+
import { D as DrawerComponent } from './index-1d207481.js';
|
|
43
|
+
import { C as Close } from './Close-8709bb1a.js';
|
|
43
44
|
import './constantsIsProduction.js';
|
|
44
|
-
import './normalizeLink-
|
|
45
|
+
import './normalizeLink-eafb4e5f.js';
|
|
45
46
|
import './constantsDomainLocales.js';
|
|
46
47
|
import '@hhgtech/icons/other';
|
|
47
48
|
import '@mantine/carousel';
|
|
48
49
|
import 'classnames';
|
|
49
|
-
import './useUniqueId-
|
|
50
|
+
import './useUniqueId-d5184b40.js';
|
|
50
51
|
import './constantsSite.js';
|
|
51
52
|
import '@hhgtech/icons/core';
|
|
52
53
|
import '@mantine/notifications';
|
|
@@ -63,11 +64,11 @@ import './i18n-values/tl-PH.js';
|
|
|
63
64
|
import './i18n-values/vi-VN.js';
|
|
64
65
|
import './i18n-values/vi-VN_MB.js';
|
|
65
66
|
import './i18n-values/zh-TW.js';
|
|
66
|
-
import './index-
|
|
67
|
+
import './index-cd336f69.js';
|
|
67
68
|
import 'slugify';
|
|
68
69
|
import 'string-format';
|
|
69
70
|
import './togetherApiPaths.js';
|
|
70
|
-
import './constants-
|
|
71
|
+
import './constants-6b69c869.js';
|
|
71
72
|
import 'vaul';
|
|
72
73
|
|
|
73
74
|
const LeadGenComponentContext = createContext({});
|
|
@@ -162,20 +163,21 @@ const LEADGEN_ACTIONS = {
|
|
|
162
163
|
SCROLL: 'SCROLL',
|
|
163
164
|
TIME: 'TIME',
|
|
164
165
|
};
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
166
|
+
var LEADGEN_LAYOUT;
|
|
167
|
+
(function (LEADGEN_LAYOUT) {
|
|
168
|
+
LEADGEN_LAYOUT["LightBoxA"] = "LightBoxA";
|
|
169
|
+
LEADGEN_LAYOUT["LightBoxB"] = "LightBoxB";
|
|
170
|
+
LEADGEN_LAYOUT["SkinA"] = "SkinA";
|
|
171
|
+
LEADGEN_LAYOUT["SkinB"] = "SkinB";
|
|
172
|
+
LEADGEN_LAYOUT["Floating"] = "Floating";
|
|
173
|
+
LEADGEN_LAYOUT["Tab"] = "Tab";
|
|
174
|
+
LEADGEN_LAYOUT["InlineA"] = "InlineA";
|
|
175
|
+
LEADGEN_LAYOUT["InlineB"] = "InlineB";
|
|
176
|
+
LEADGEN_LAYOUT["CenterTab"] = "CenterTab";
|
|
177
|
+
LEADGEN_LAYOUT["Sidebar"] = "Sidebar";
|
|
178
|
+
LEADGEN_LAYOUT["Fullscreen"] = "Fullscreen";
|
|
179
|
+
LEADGEN_LAYOUT["Slider"] = "Slider";
|
|
180
|
+
})(LEADGEN_LAYOUT || (LEADGEN_LAYOUT = {}));
|
|
179
181
|
const LEADGEN_BLOCK = {
|
|
180
182
|
TextBlock: 'TextBlock',
|
|
181
183
|
NumberBlock: 'NumberBlock',
|
|
@@ -359,6 +361,18 @@ const formatCampaignDetail = (campaign) => {
|
|
|
359
361
|
}
|
|
360
362
|
};
|
|
361
363
|
|
|
364
|
+
const formatLeadGenFormValue = (values = {}, blocks) => {
|
|
365
|
+
const newValues = {};
|
|
366
|
+
for (const block of blocks) {
|
|
367
|
+
const { data } = block || {};
|
|
368
|
+
const { value: fieldName } = data || {};
|
|
369
|
+
if (fieldName in values) {
|
|
370
|
+
newValues[fieldName] = values[fieldName];
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
return newValues;
|
|
374
|
+
};
|
|
375
|
+
|
|
362
376
|
class Store {
|
|
363
377
|
constructor() {
|
|
364
378
|
this.apiSsoUrl = 'https://staging-id.hellobacsi.com/';
|
|
@@ -512,9 +526,9 @@ const getCampaignByCode = (campaign_code) => {
|
|
|
512
526
|
method: METHOD.GET,
|
|
513
527
|
});
|
|
514
528
|
};
|
|
515
|
-
const getSubscriptionBoxInfo = ({ category, site, }) => {
|
|
529
|
+
const getSubscriptionBoxInfo = ({ category, site, slug, }) => {
|
|
516
530
|
return leadApi.call({
|
|
517
|
-
url: `${LEADGEN_API_PATH.V2_SUBSCRIPTION_INFO}?category=${category}&site=${site}`,
|
|
531
|
+
url: `${LEADGEN_API_PATH.V2_SUBSCRIPTION_INFO}?category=${category}&site=${site}&slug=${slug}`,
|
|
518
532
|
method: METHOD.GET,
|
|
519
533
|
});
|
|
520
534
|
};
|
|
@@ -661,7 +675,7 @@ const clearCacheUsedEmailOrPhone = () => {
|
|
|
661
675
|
const [LeadFormProvider$1, useLeadFormContext$1, useLeadForm$1] = createFormContext();
|
|
662
676
|
const useLeadFormConfig$1 = ({ listBlockAdded = [], validatingPhoneRef, validatingEmailRef, campaignId, campaign_subot_id = [], userInfo, }) => {
|
|
663
677
|
const { t } = useTranslations();
|
|
664
|
-
const initialValues = useMemo(() => mappingSSOToLead(userInfo), [userInfo === null || userInfo === void 0 ? void 0 : userInfo.id]);
|
|
678
|
+
const initialValues = useMemo(() => formatLeadGenFormValue(mappingSSOToLead(userInfo), listBlockAdded), [userInfo === null || userInfo === void 0 ? void 0 : userInfo.id]);
|
|
665
679
|
useEffect(() => {
|
|
666
680
|
if (!window.intlTelInputUtils) {
|
|
667
681
|
require('intl-tel-input/build/js/utils');
|
|
@@ -977,15 +991,15 @@ const Fields = ({ listBlockAdded, popupId, locale, onClose, onOtherSubmit, style
|
|
|
977
991
|
case 'TextBlock':
|
|
978
992
|
return (React__default.createElement(Input, Object.assign({ key: index, withAsterisk: required, spellCheck: false, type: "text", placeholder: placeholder, className: cx('leadgen-control', classes.control),
|
|
979
993
|
// onChangeRaw={(e) => inputOnChange('text', e)}
|
|
980
|
-
label: placeholder, "data-control": "text", name: value }, form.getInputProps(value))));
|
|
994
|
+
label: placeholder, "data-control": "text", "data-lead-control": name, name: value }, form.getInputProps(value))));
|
|
981
995
|
case 'NumberBlock':
|
|
982
996
|
return (React__default.createElement(NumberInput, Object.assign({ key: index, withAsterisk: required, spellCheck: false, type: "number", placeholder: placeholder, className: cx('leadgen-control', classes.control),
|
|
983
997
|
// onChange={(e) => inputOnChange('number', e)}
|
|
984
|
-
label: placeholder, "data-control": "number", name: value }, form.getInputProps(value))));
|
|
998
|
+
label: placeholder, "data-control": "number", "data-lead-control": name, name: value }, form.getInputProps(value))));
|
|
985
999
|
case 'EmailBlock':
|
|
986
1000
|
return (React__default.createElement(Input, Object.assign({ key: index, withAsterisk: required, spellCheck: false,
|
|
987
1001
|
// type="email"
|
|
988
|
-
placeholder: placeholder, className: cx('leadgen-control', classes.control), label: placeholder, "data-control": "email", name: value }, form.getInputProps(value))));
|
|
1002
|
+
placeholder: placeholder, className: cx('leadgen-control', classes.control), label: placeholder, "data-control": "email", "data-lead-control": name, name: value }, form.getInputProps(value))));
|
|
989
1003
|
case 'PhoneOtpBlock':
|
|
990
1004
|
case 'WhatsappOtpBlock':
|
|
991
1005
|
case 'ZaloOtpBlock':
|
|
@@ -1000,14 +1014,14 @@ const Fields = ({ listBlockAdded, popupId, locale, onClose, onOtherSubmit, style
|
|
|
1000
1014
|
form.setFieldValue(value, v);
|
|
1001
1015
|
},
|
|
1002
1016
|
// onBlur={(e) => inputOnBlur('tel', e)}
|
|
1003
|
-
id: id, defaultCountry: (locale ? MAPPED_LOCALE[locale] || 'VN' : 'VN'), "data-control": "tel" })));
|
|
1017
|
+
id: id, defaultCountry: (locale ? MAPPED_LOCALE[locale] || 'VN' : 'VN'), "data-control": "tel", "data-lead-control": name })));
|
|
1004
1018
|
}
|
|
1005
1019
|
case 'LocationBlock': {
|
|
1006
1020
|
return (React__default.createElement(LocationBlock, { key: index, name: value, placeholder: placeholder, locale: locale, required: required }));
|
|
1007
1021
|
}
|
|
1008
1022
|
case 'DateBlock':
|
|
1009
1023
|
return (React__default.createElement(React__default.Fragment, null,
|
|
1010
|
-
React__default.createElement(DatePicker, Object.assign({ withAsterisk: required, key: index, type: "default", name: value, placeholder: placeholder, className: cx('leadgen-control', classes.control), label: placeholder, "data-control": "date", popoverProps: popoverProps }, form.getInputProps(value))),
|
|
1024
|
+
React__default.createElement(DatePicker, Object.assign({ withAsterisk: required, key: index, type: "default", name: value, placeholder: placeholder, className: cx('leadgen-control', classes.control), label: placeholder, "data-control": "date", "data-lead-control": name, popoverProps: popoverProps }, form.getInputProps(value))),
|
|
1011
1025
|
React__default.createElement("input", { type: "hidden", name: value, "data-control": "date" })));
|
|
1012
1026
|
case 'LinkButtonBlock':
|
|
1013
1027
|
return (React__default.createElement("div", { key: index },
|
|
@@ -1025,14 +1039,14 @@ const Fields = ({ listBlockAdded, popupId, locale, onClose, onOtherSubmit, style
|
|
|
1025
1039
|
display: 'flex',
|
|
1026
1040
|
flexDirection: 'column',
|
|
1027
1041
|
gap: 8,
|
|
1028
|
-
} }, form.getInputProps(value)), listQuestion.map((l, _index) => (React__default.createElement(Checkbox, { name: value, key: _index, value: l.value, label: l.placeholder, "data-control": "checkbox" }))))));
|
|
1042
|
+
} }, form.getInputProps(value)), listQuestion.map((l, _index) => (React__default.createElement(Checkbox, { name: value, key: _index, value: l.value, label: l.placeholder, "data-control": "checkbox", "data-lead-control": name }))))));
|
|
1029
1043
|
case 'RadioBlock':
|
|
1030
1044
|
return (React__default.createElement(React__default.Fragment, null,
|
|
1031
1045
|
isSendMailChimp && (React__default.createElement(Input, { type: "hidden", name: value + '-mailchimp', value: isSendMailChimp })),
|
|
1032
|
-
React__default.createElement(Radio.Group, Object.assign({ withAsterisk: required, className: cx('leadgen-control', classes.control), key: index, label: placeholder, size: "md" }, form.getInputProps(value)), listQuestion.map((l, _index) => (React__default.createElement(Radio, { name: value, key: _index, value: l.value, label: l.placeholder, "data-control": "radio" }))))));
|
|
1046
|
+
React__default.createElement(Radio.Group, Object.assign({ withAsterisk: required, className: cx('leadgen-control', classes.control), key: index, label: placeholder, size: "md" }, form.getInputProps(value)), listQuestion.map((l, _index) => (React__default.createElement(Radio, { name: value, key: _index, value: l.value, label: l.placeholder, "data-control": "radio", "data-lead-control": name }))))));
|
|
1033
1047
|
case 'DropdownBlock':
|
|
1034
1048
|
return (React__default.createElement(React__default.Fragment, null,
|
|
1035
|
-
React__default.createElement("div", { style: { display: 'none' }, "data-extra": true, "data-name": value, "data-control": 'dropdown' }),
|
|
1049
|
+
React__default.createElement("div", { style: { display: 'none' }, "data-extra": true, "data-name": value, "data-control": 'dropdown', "data-lead-control": name }),
|
|
1036
1050
|
React__default.createElement(Select, Object.assign({ key: index, className: cx('leadgen-control', classes.control), label: placeholder, withAsterisk: required, name: value, data: listQuestion.map((l) => ({
|
|
1037
1051
|
value: l.value,
|
|
1038
1052
|
label: l.placeholder,
|
|
@@ -1040,7 +1054,7 @@ const Fields = ({ listBlockAdded, popupId, locale, onClose, onOtherSubmit, style
|
|
|
1040
1054
|
case 'TncBlock':
|
|
1041
1055
|
const tncInputProps = form.getInputProps('TNC-' + b.id);
|
|
1042
1056
|
return (React__default.createElement(React__default.Fragment, null,
|
|
1043
|
-
React__default.createElement(Checkbox, Object.assign({ name: 'TNC-' + b.id, key: b.id, label: React__default.createElement("p", { className: "lead-modal__tnc-link", dangerouslySetInnerHTML: { __html: data.valueHTML } }), className: "tnc-block", "data-control": "checkbox" }, tncInputProps, { error: tncInputProps.error ? tncInputProps.error : undefined }))));
|
|
1057
|
+
React__default.createElement(Checkbox, Object.assign({ name: 'TNC-' + b.id, key: b.id, label: React__default.createElement("p", { className: "lead-modal__tnc-link", dangerouslySetInnerHTML: { __html: data.valueHTML } }), className: "tnc-block", "data-control": "checkbox", "data-lead-control": name }, tncInputProps, { error: tncInputProps.error ? tncInputProps.error : undefined }))));
|
|
1044
1058
|
}
|
|
1045
1059
|
return null;
|
|
1046
1060
|
})));
|
|
@@ -1073,7 +1087,9 @@ const Heading = (_a) => {
|
|
|
1073
1087
|
const FormComponent = ({ styles, className, classNames, fillInfo, popoverProps, submitProps, }) => {
|
|
1074
1088
|
var _a;
|
|
1075
1089
|
const { primaryColor } = useContext(LeadGenContext$1);
|
|
1076
|
-
const { listBlockAdded, leadFormConfig: { form, validateObj }, validatingEmailRef, validatingPhoneRef,
|
|
1090
|
+
const { listBlockAdded, leadFormConfig: { form, validateObj }, validatingEmailRef, validatingPhoneRef,
|
|
1091
|
+
// formRef,
|
|
1092
|
+
setFormRef, onClose, onOtherSubmit, actionBlocks, locale, setShowOtpPhone, onSubmit, } = useContext(LeadGenComponentContext);
|
|
1077
1093
|
const { classes, cx } = useStyles$1(undefined, {
|
|
1078
1094
|
name: 'LeadGen__FormComponent',
|
|
1079
1095
|
styles,
|
|
@@ -1134,7 +1150,7 @@ const FormComponent = ({ styles, className, classNames, fillInfo, popoverProps,
|
|
|
1134
1150
|
var _a;
|
|
1135
1151
|
const respMessage = (_a = res === null || res === void 0 ? void 0 : res._messages) === null || _a === void 0 ? void 0 : _a[0];
|
|
1136
1152
|
if (respMessage === 'This phone number was verified') {
|
|
1137
|
-
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(
|
|
1153
|
+
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit();
|
|
1138
1154
|
return;
|
|
1139
1155
|
}
|
|
1140
1156
|
setShowOtpPhone(newShowOtpPhone);
|
|
@@ -1144,7 +1160,7 @@ const FormComponent = ({ styles, className, classNames, fillInfo, popoverProps,
|
|
|
1144
1160
|
});
|
|
1145
1161
|
return;
|
|
1146
1162
|
}
|
|
1147
|
-
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(
|
|
1163
|
+
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit();
|
|
1148
1164
|
})(e);
|
|
1149
1165
|
}, 100);
|
|
1150
1166
|
};
|
|
@@ -1314,10 +1330,13 @@ const OtpBlockComponent = ({ otpData, onSuccess, autoSendWhenOpen, className, st
|
|
|
1314
1330
|
};
|
|
1315
1331
|
const OtpBlock$1 = (_a) => {
|
|
1316
1332
|
var rest = __rest(_a, []);
|
|
1317
|
-
const { showOtpPhone, setShowOtpPhone, onSubmit,
|
|
1333
|
+
const { showOtpPhone, setShowOtpPhone, onSubmit,
|
|
1334
|
+
// formRef,
|
|
1335
|
+
// leadFormConfig: { form },
|
|
1336
|
+
} = useContext(LeadGenComponentContext);
|
|
1318
1337
|
return showOtpPhone ? (React__default.createElement(OtpBlockComponent, Object.assign({ otpData: showOtpPhone, autoSendWhenOpen: false, onSuccess: () => {
|
|
1319
1338
|
setShowOtpPhone(null);
|
|
1320
|
-
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(
|
|
1339
|
+
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit();
|
|
1321
1340
|
} }, rest))) : null;
|
|
1322
1341
|
};
|
|
1323
1342
|
|
|
@@ -2066,6 +2085,7 @@ const LeadGenContextProvider = (props) => {
|
|
|
2066
2085
|
Service.getSubscriptionBoxInfo({
|
|
2067
2086
|
category: categoryId,
|
|
2068
2087
|
site: site_domain,
|
|
2088
|
+
slug: location === null || location === void 0 ? void 0 : location.pathname,
|
|
2069
2089
|
}).then((res) => {
|
|
2070
2090
|
const { _data } = res || {};
|
|
2071
2091
|
const { item, campaign_code } = _data || {};
|
|
@@ -2119,7 +2139,7 @@ const [LeadFormProvider, useLeadFormContext, useLeadForm] = createFormContext();
|
|
|
2119
2139
|
const useLeadFormConfig = ({ listBlockAdded = [], validatingPhoneRef, validatingEmailRef, campaignId, campaign_subot_id = [], userInfo, format, }) => {
|
|
2120
2140
|
var _a;
|
|
2121
2141
|
const { t } = useTranslations();
|
|
2122
|
-
const initialValues = useMemo(() => mappingSSOToLead(userInfo), [userInfo === null || userInfo === void 0 ? void 0 : userInfo.id]);
|
|
2142
|
+
const initialValues = useMemo(() => formatLeadGenFormValue(mappingSSOToLead(userInfo), listBlockAdded), [userInfo === null || userInfo === void 0 ? void 0 : userInfo.id]);
|
|
2123
2143
|
const LEAD_LOCALE = LEAD_LOCALE_DATA[(_a = document === null || document === void 0 ? void 0 : document.documentElement) === null || _a === void 0 ? void 0 : _a.lang] ||
|
|
2124
2144
|
LEAD_LOCALE_DATA['vi-VN'];
|
|
2125
2145
|
const validateObj = useMemo(() => {
|
|
@@ -2281,7 +2301,7 @@ const useLeadFormConfig = ({ listBlockAdded = [], validatingPhoneRef, validating
|
|
|
2281
2301
|
}, {});
|
|
2282
2302
|
}, [listBlockAdded.map((b) => b.name).join(','), format]);
|
|
2283
2303
|
const form = useLeadForm({
|
|
2284
|
-
validateInputOnChange:
|
|
2304
|
+
validateInputOnChange: false,
|
|
2285
2305
|
validateInputOnBlur: true,
|
|
2286
2306
|
clearInputErrorOnChange: true,
|
|
2287
2307
|
validate: validateObj,
|
|
@@ -2354,15 +2374,14 @@ const StyledLeadGenSubscriptionBoxBody = styled.div `
|
|
|
2354
2374
|
}
|
|
2355
2375
|
`;
|
|
2356
2376
|
const StyledLeadGenSubscriptionBoxHeaderImage = styled.div `
|
|
2357
|
-
margin-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
height: 44px;
|
|
2377
|
+
margin-left: 8px;
|
|
2378
|
+
width: 80px;
|
|
2379
|
+
height: 68px;
|
|
2361
2380
|
|
|
2362
2381
|
img {
|
|
2363
2382
|
width: 100%;
|
|
2364
2383
|
height: 100%;
|
|
2365
|
-
object-
|
|
2384
|
+
object-fit: contain;
|
|
2366
2385
|
onject-position: center;
|
|
2367
2386
|
}
|
|
2368
2387
|
|
|
@@ -2372,29 +2391,39 @@ const StyledLeadGenSubscriptionBoxHeaderImage = styled.div `
|
|
|
2372
2391
|
`;
|
|
2373
2392
|
const StyledLeadGenSubscriptionBoxHeader = styled.div `
|
|
2374
2393
|
display: flex;
|
|
2375
|
-
align-items:
|
|
2394
|
+
align-items: start;
|
|
2376
2395
|
margin-bottom: 16px;
|
|
2377
2396
|
.leadgen-title {
|
|
2378
2397
|
margin-bottom: 0;
|
|
2379
2398
|
flex: 1;
|
|
2380
2399
|
min-width: 0;
|
|
2381
|
-
color: ${theme.colors.
|
|
2382
|
-
font-size:
|
|
2400
|
+
color: ${theme.colors.gray600};
|
|
2401
|
+
font-size: 17px;
|
|
2383
2402
|
font-weight: 400;
|
|
2384
|
-
line-height:
|
|
2403
|
+
line-height: 24px;
|
|
2385
2404
|
letter-spacing: -0.4px;
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2405
|
+
b {
|
|
2406
|
+
color: #111111;
|
|
2407
|
+
font-weight: 700;
|
|
2408
|
+
}
|
|
2409
|
+
${MediaQueries.mbUp} {
|
|
2410
|
+
font-size: 20px;
|
|
2411
|
+
line-height: 28px;
|
|
2412
|
+
b {
|
|
2413
|
+
font-weight: 500;
|
|
2414
|
+
}
|
|
2392
2415
|
}
|
|
2393
2416
|
}
|
|
2394
2417
|
`;
|
|
2395
2418
|
const StyledLeadGenSubscriptionBox = styled.div `
|
|
2396
2419
|
padding: 16px;
|
|
2397
2420
|
border: 1px solid ${theme.colors.neutral100};
|
|
2421
|
+
background: linear-gradient(
|
|
2422
|
+
180.71deg,
|
|
2423
|
+
#7bc2ff -18.54%,
|
|
2424
|
+
#e3f2ff 17.12%,
|
|
2425
|
+
#ffffff 99.25%
|
|
2426
|
+
);
|
|
2398
2427
|
border-radius: 12px;
|
|
2399
2428
|
margin-inline: auto;
|
|
2400
2429
|
.leadgen-form_inputs {
|
|
@@ -2428,6 +2457,7 @@ const StyledLeadGenSubscriptionBox = styled.div `
|
|
|
2428
2457
|
margin-left: 8px;
|
|
2429
2458
|
width: auto;
|
|
2430
2459
|
min-height: 56px;
|
|
2460
|
+
font-size: 16px;
|
|
2431
2461
|
}
|
|
2432
2462
|
}
|
|
2433
2463
|
}
|
|
@@ -2467,16 +2497,64 @@ const PhoneInput = forwardRef((props, ref) => {
|
|
|
2467
2497
|
React__default.createElement(Phone, Object.assign({}, restProps, { id: id, ref: ref, name: name, spellCheck: false, placeholder: placeholder, defaultCountry: defaultCountry, className: "mantine-Input-input", type: "tel", "data-control": "tel" })))));
|
|
2468
2498
|
});
|
|
2469
2499
|
|
|
2470
|
-
const
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2500
|
+
const NoData = ({ className, style }) => {
|
|
2501
|
+
return (React__default.createElement("svg", { width: "64", height: "55", viewBox: "0 0 64 55", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: className, style: style },
|
|
2502
|
+
React__default.createElement("path", { d: "M32.6226 54.0001C46.2852 54.0001 57.3652 43.0033 57.3652 29.4239C57.3652 15.8446 46.2852 4.84778 32.6226 4.84778C18.9599 4.84778 7.87988 15.8446 7.87988 29.4239C7.87988 43.0033 18.9599 54.0001 32.6226 54.0001Z", fill: "#E6EAF5" }),
|
|
2503
|
+
React__default.createElement("path", { d: "M51.5751 26.2165V41.2537C51.5751 44.3778 49.0342 46.9187 45.8684 46.9187H19.4596C16.3355 46.9187 13.7946 44.4195 13.7529 41.2954C13.7529 41.2537 13.7529 41.2537 13.7529 41.2121V26.2165C13.7529 26.1748 13.7529 26.1748 13.7529 26.1332C13.7529 26.0498 13.7529 25.9665 13.7946 25.8832C13.8362 25.7583 13.8779 25.675 13.9195 25.55L21.0008 12.0123C21.2507 11.4708 21.7922 11.1792 22.3754 11.1792H42.911C43.4941 11.1792 43.994 11.4708 44.2856 12.0123L51.3668 25.55C51.4085 25.6333 51.4501 25.7583 51.4918 25.8832C51.5751 25.9665 51.5751 26.0915 51.5751 26.2165Z", fill: "#D5DDEA" }),
|
|
2504
|
+
React__default.createElement("path", { d: "M51.5751 26.2164V42.7949C51.5751 45.0859 49.7423 46.9187 47.4096 46.9187H17.9184C15.6274 46.9187 13.7529 45.0859 13.7529 42.7949V26.1331C13.7529 26.0498 13.7529 25.9665 13.7946 25.8832H23.2918C24.708 25.8832 25.8743 27.0078 25.8743 28.4658C25.8743 29.1739 26.1659 29.8404 26.6241 30.2986C27.124 30.7984 27.7071 31.0483 28.4569 31.0483H36.9127C38.329 31.0483 39.4953 29.9237 39.4953 28.4658C39.4953 27.7576 39.7869 27.0912 40.2451 26.633C40.7449 26.1331 41.3281 25.8832 42.0362 25.8832H51.4918C51.5751 25.9665 51.5751 26.0915 51.5751 26.2164Z", fill: "url(#paint0_linear_2578_27197)" }),
|
|
2505
|
+
React__default.createElement("path", { d: "M56.7342 17.6773C57.6774 17.6773 58.442 16.9126 58.442 15.9694C58.442 15.0262 57.6774 14.2616 56.7342 14.2616C55.791 14.2616 55.0264 15.0262 55.0264 15.9694C55.0264 16.9126 55.791 17.6773 56.7342 17.6773Z", fill: "#EAEEF9" }),
|
|
2506
|
+
React__default.createElement("path", { d: "M55.0257 12.1373C55.6698 12.1373 56.192 11.6152 56.192 10.971C56.192 10.3269 55.6698 9.80469 55.0257 9.80469C54.3816 9.80469 53.8594 10.3269 53.8594 10.971C53.8594 11.6152 54.3816 12.1373 55.0257 12.1373Z", fill: "#EAEEF9" }),
|
|
2507
|
+
React__default.createElement("path", { d: "M7.79034 15.9694C8.43449 15.9694 8.95667 15.4472 8.95667 14.803C8.95667 14.1589 8.43449 13.6367 7.79034 13.6367C7.1462 13.6367 6.62402 14.1589 6.62402 14.803C6.62402 15.4472 7.1462 15.9694 7.79034 15.9694Z", fill: "#EAEEF9" }),
|
|
2508
|
+
React__default.createElement("path", { d: "M5.16603 41.6286C6.36229 41.6286 7.33205 40.6588 7.33205 39.4625C7.33205 38.2663 6.36229 37.2965 5.16603 37.2965C3.96976 37.2965 3 38.2663 3 39.4625C3 40.6588 3.96976 41.6286 5.16603 41.6286Z", fill: "#EAEEF9" }),
|
|
2509
|
+
React__default.createElement("path", { d: "M43.0864 6.16785C43.6301 12.1024 43.9019 13.4615 42.6711 18.8361C42.2708 20.0309 41.8705 21.3396 41.0128 22.25C39.812 23.6725 37.6392 24.2984 35.8666 23.8432C34.0368 23.388 32.5501 21.7948 32.2071 19.8602C31.9212 18.6654 32.3214 17.2429 33.3507 16.5032C34.4371 15.8204 35.981 15.9911 36.8958 16.8446C37.9251 17.6981 38.3254 19.0068 38.2682 20.2585C38.211 21.5103 37.7536 22.7621 37.1246 23.8432C35.7027 26.5014 35.1173 26.4916 32.2071 30.8575", stroke: "#ABB5CC", strokeMiterlimit: "10", strokeDasharray: "4 4" }),
|
|
2510
|
+
React__default.createElement("path", { d: "M46.2749 3.95757C46.0575 4.75059 45.1881 5.03896 44.3187 4.53431C43.3769 4.10176 42.7249 3.74129 42.8698 3.02037C43.0871 2.29945 43.9565 2.22735 44.9708 2.15526C46.2024 2.01108 46.4198 3.16455 46.2749 3.95757Z", fill: "#DAE2EB" }),
|
|
2511
|
+
React__default.createElement("path", { d: "M39.2479 4.67842C39.6102 5.32726 40.6245 5.75981 41.3489 5.11098C42.1459 4.39005 42.7979 3.88541 42.4357 3.16448C42.0734 2.51565 41.4938 2.73193 40.2622 2.87611C39.2479 3.09239 38.8132 3.9575 39.2479 4.67842Z", fill: "#DAE2EB" }),
|
|
2512
|
+
React__default.createElement("path", { d: "M42.4358 2.01104C42.9429 1.93895 43.4501 2.22732 43.595 2.65987C43.6674 2.80406 43.7399 3.02034 43.7399 3.16452C43.8848 4.17381 43.5225 5.03892 42.9429 5.11102C42.2909 5.2552 41.6389 4.53428 41.5664 3.59707C41.5664 3.3087 41.5664 3.16452 41.5664 2.94824C41.6389 2.4436 41.9286 2.08313 42.4358 2.01104C42.5082 2.01104 42.4358 2.01104 42.4358 2.01104Z", fill: "#989FB0" }),
|
|
2513
|
+
React__default.createElement("path", { d: "M27.9127 37.0298C28.4405 37.0298 28.8684 36.6019 28.8684 36.0741C28.8684 35.5463 28.4405 35.1184 27.9127 35.1184C27.3849 35.1184 26.957 35.5463 26.957 36.0741C26.957 36.6019 27.3849 37.0298 27.9127 37.0298Z", fill: "#989FB0" }),
|
|
2514
|
+
React__default.createElement("path", { d: "M37.4186 37.0298C37.9464 37.0298 38.3742 36.6019 38.3742 36.0741C38.3742 35.5463 37.9464 35.1184 37.4186 35.1184C36.8908 35.1184 36.4629 35.5463 36.4629 36.0741C36.4629 36.6019 36.8908 37.0298 37.4186 37.0298Z", fill: "#989FB0" }),
|
|
2515
|
+
React__default.createElement("path", { d: "M34.2147 43.3063H31.2186C30.7536 43.3063 30.3662 42.9188 30.3662 42.4539C30.3662 41.989 30.7536 41.6016 31.2186 41.6016H34.1889C34.6538 41.6016 35.0413 41.989 35.0413 42.4539C35.0671 42.9188 34.6797 43.3063 34.2147 43.3063Z", fill: "#989FB0" }),
|
|
2516
|
+
React__default.createElement("defs", null,
|
|
2517
|
+
React__default.createElement("linearGradient", { id: "paint0_linear_2578_27197", x1: "32.6517", y1: "25.3966", x2: "32.6517", y2: "47.1455", gradientUnits: "userSpaceOnUse" },
|
|
2518
|
+
React__default.createElement("stop", { stopColor: "#FDFEFF" }),
|
|
2519
|
+
React__default.createElement("stop", { offset: "0.9964", stopColor: "#ECF0F5" })))));
|
|
2520
|
+
};
|
|
2521
|
+
|
|
2522
|
+
const libraries = ['places'];
|
|
2523
|
+
const GoogleLocationBlock = (props) => {
|
|
2524
|
+
var _a;
|
|
2525
|
+
const { inputWrapperOrder = ['label', 'input', 'description', 'error'], defaultValue, value: valueProps, onChange: onChangeProps, locale } = props, restProps = __rest(props, ["inputWrapperOrder", "defaultValue", "value", "onChange", "locale"]);
|
|
2526
|
+
const [LoadScript, setLoadScript] = useState(null);
|
|
2527
|
+
const [value, setValue] = useState(defaultValue || valueProps);
|
|
2528
|
+
const { predictions } = usePlacesAutocomplete(value, '', locale === 'tl-PH' ? 'en' : (_a = locale === null || locale === void 0 ? void 0 : locale.split('-')) === null || _a === void 0 ? void 0 : _a[0]);
|
|
2529
|
+
const onChangeAutocomplete = useCallback((s) => {
|
|
2530
|
+
setValue(s);
|
|
2531
|
+
onChangeProps === null || onChangeProps === void 0 ? void 0 : onChangeProps(s);
|
|
2532
|
+
}, []);
|
|
2533
|
+
const onClickItem = useCallback((item) => {
|
|
2534
|
+
/** For sure get value */
|
|
2535
|
+
setValue(item.value);
|
|
2536
|
+
const predCur = predictions === null || predictions === void 0 ? void 0 : predictions.find(({ description }) => description === item.value);
|
|
2537
|
+
onChangeProps === null || onChangeProps === void 0 ? void 0 : onChangeProps(item.value, predCur === null || predCur === void 0 ? void 0 : predCur.rawData);
|
|
2538
|
+
}, [onChangeProps, predictions]);
|
|
2539
|
+
useEffect(() => {
|
|
2540
|
+
setValue(valueProps);
|
|
2541
|
+
}, [valueProps]);
|
|
2542
|
+
useEffect(() => {
|
|
2543
|
+
var _a, _b, _c;
|
|
2544
|
+
// only load extra google script when not yet loaded
|
|
2545
|
+
if (!((_c = (_b = (_a = window === null || window === void 0 ? void 0 : window.google) === null || _a === void 0 ? void 0 : _a.maps) === null || _b === void 0 ? void 0 : _b.places) === null || _c === void 0 ? void 0 : _c.AutocompleteService) && !LoadScript) {
|
|
2546
|
+
import('@react-google-maps/api').then((m) => {
|
|
2547
|
+
setLoadScript(() => m.LoadScript);
|
|
2548
|
+
});
|
|
2477
2549
|
}
|
|
2478
|
-
}
|
|
2479
|
-
return
|
|
2550
|
+
}, []);
|
|
2551
|
+
return (React__default.createElement(Autocomplete, Object.assign({ defaultValue: defaultValue, value: value, onChange: onChangeAutocomplete, data: predictions.map((pred) => {
|
|
2552
|
+
return { value: pred.description, label: pred.description };
|
|
2553
|
+
}), filter: () => true, onItemSubmit: onClickItem, inputWrapperOrder: inputWrapperOrder, zIndex: ZINDEX_SSO - 9e6 + 2, withinPortal: true, styles: { dropdown: { pointerEvents: 'auto' } }, inputContainer: (children) => {
|
|
2554
|
+
return (React__default.createElement(React__default.Fragment, null,
|
|
2555
|
+
LoadScript && (React__default.createElement(LoadScript, { googleMapsApiKey: GOOGLE_API_KEY, libraries: libraries, loadingElement: React__default.createElement(React__default.Fragment, null), style: { width: '100%' } })),
|
|
2556
|
+
children));
|
|
2557
|
+
} }, restProps)));
|
|
2480
2558
|
};
|
|
2481
2559
|
|
|
2482
2560
|
const StyledLeadGenFormInner = styled.div `
|
|
@@ -2815,17 +2893,22 @@ const TextField$1 = (props) => {
|
|
|
2815
2893
|
onChangeShrink === null || onChangeShrink === void 0 ? void 0 : onChangeShrink(false);
|
|
2816
2894
|
});
|
|
2817
2895
|
const [shrink, setShrink] = useState(shrinkProps);
|
|
2896
|
+
const focusInput = (target) => {
|
|
2897
|
+
const $textEl = target.querySelectorAll('input:not([disabled]):not([type="submit"]),select:not([disabled]),textarea:not([disabled])');
|
|
2898
|
+
const $focusEl = $textEl.item($textEl.length - 1);
|
|
2899
|
+
if ($focusEl) {
|
|
2900
|
+
$focusEl.focus({ preventScroll: true });
|
|
2901
|
+
}
|
|
2902
|
+
};
|
|
2818
2903
|
const onClick = useCallback((e) => {
|
|
2819
|
-
setShrink(true);
|
|
2820
|
-
onChangeShrink === null || onChangeShrink === void 0 ? void 0 : onChangeShrink(true);
|
|
2821
2904
|
if (shrink) {
|
|
2905
|
+
e.preventDefault();
|
|
2906
|
+
focusInput(e.currentTarget);
|
|
2822
2907
|
return;
|
|
2823
2908
|
}
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
$focusEl.focus();
|
|
2828
|
-
}
|
|
2909
|
+
setShrink(true);
|
|
2910
|
+
onChangeShrink === null || onChangeShrink === void 0 ? void 0 : onChangeShrink(true);
|
|
2911
|
+
focusInput(e.currentTarget);
|
|
2829
2912
|
}, [shrink]);
|
|
2830
2913
|
useEffect(() => {
|
|
2831
2914
|
setShrink(shrinkProps);
|
|
@@ -2838,44 +2921,6 @@ const ChoiceField$1 = (props) => {
|
|
|
2838
2921
|
return (React__default.createElement(StyledChoiceFieldContainer$1, Object.assign({ className: clsx(className, 'choiceField') }, restProps), children));
|
|
2839
2922
|
};
|
|
2840
2923
|
|
|
2841
|
-
const libraries = ['places'];
|
|
2842
|
-
const GoogleLocationBlock = (props) => {
|
|
2843
|
-
var _a;
|
|
2844
|
-
const { inputWrapperOrder = ['label', 'input', 'description', 'error'], defaultValue, value: valueProps, onChange: onChangeProps, locale } = props, restProps = __rest(props, ["inputWrapperOrder", "defaultValue", "value", "onChange", "locale"]);
|
|
2845
|
-
const [LoadScript, setLoadScript] = useState(null);
|
|
2846
|
-
const [value, setValue] = useState(defaultValue || valueProps);
|
|
2847
|
-
const { predictions } = usePlacesAutocomplete(value, '', locale === 'tl-PH' ? 'en' : (_a = locale === null || locale === void 0 ? void 0 : locale.split('-')) === null || _a === void 0 ? void 0 : _a[0]);
|
|
2848
|
-
const onChangeAutocomplete = useCallback((s) => {
|
|
2849
|
-
setValue(s);
|
|
2850
|
-
onChangeProps === null || onChangeProps === void 0 ? void 0 : onChangeProps(s);
|
|
2851
|
-
}, []);
|
|
2852
|
-
const onClickItem = useCallback((item) => {
|
|
2853
|
-
/** For sure get value */
|
|
2854
|
-
setValue(item.value);
|
|
2855
|
-
const predCur = predictions === null || predictions === void 0 ? void 0 : predictions.find(({ description }) => description === item.value);
|
|
2856
|
-
onChangeProps === null || onChangeProps === void 0 ? void 0 : onChangeProps(item.value, predCur === null || predCur === void 0 ? void 0 : predCur.rawData);
|
|
2857
|
-
}, [onChangeProps, predictions]);
|
|
2858
|
-
useEffect(() => {
|
|
2859
|
-
setValue(valueProps);
|
|
2860
|
-
}, [valueProps]);
|
|
2861
|
-
useEffect(() => {
|
|
2862
|
-
var _a, _b, _c;
|
|
2863
|
-
// only load extra google script when not yet loaded
|
|
2864
|
-
if (!((_c = (_b = (_a = window === null || window === void 0 ? void 0 : window.google) === null || _a === void 0 ? void 0 : _a.maps) === null || _b === void 0 ? void 0 : _b.places) === null || _c === void 0 ? void 0 : _c.AutocompleteService) && !LoadScript) {
|
|
2865
|
-
import('@react-google-maps/api').then((m) => {
|
|
2866
|
-
setLoadScript(() => m.LoadScript);
|
|
2867
|
-
});
|
|
2868
|
-
}
|
|
2869
|
-
}, []);
|
|
2870
|
-
return (React__default.createElement(Autocomplete, Object.assign({ defaultValue: defaultValue, value: value, onChange: onChangeAutocomplete, data: predictions.map((pred) => {
|
|
2871
|
-
return { value: pred.description, label: pred.description };
|
|
2872
|
-
}), filter: () => true, onItemSubmit: onClickItem, inputWrapperOrder: inputWrapperOrder, zIndex: ZINDEX_SSO - 9e6 + 2, withinPortal: true, styles: { dropdown: { pointerEvents: 'auto' } }, inputContainer: (children) => {
|
|
2873
|
-
return (React__default.createElement(React__default.Fragment, null,
|
|
2874
|
-
LoadScript && (React__default.createElement(LoadScript, { googleMapsApiKey: GOOGLE_API_KEY, libraries: libraries, loadingElement: React__default.createElement(React__default.Fragment, null), style: { width: '100%' } })),
|
|
2875
|
-
children));
|
|
2876
|
-
} }, restProps)));
|
|
2877
|
-
};
|
|
2878
|
-
|
|
2879
2924
|
const LeadGenForm = forwardRef((props, ref) => {
|
|
2880
2925
|
const { locale, blocks, scrollToErrorField = true, form: formProps, rules: validate, initialValues, onFinish, onFinishFailed, className, style, } = props;
|
|
2881
2926
|
const formRef = useRef(null);
|
|
@@ -2929,52 +2974,73 @@ const LeadGenForm = forwardRef((props, ref) => {
|
|
|
2929
2974
|
return (React__default.createElement("form", { ref: formRef, onSubmit: form.onSubmit(middlewareFinish, middlewareFinishFailed), className: className, style: style },
|
|
2930
2975
|
React__default.createElement(StyledLeadGenFormInner, { className: "leadgen-form_inputs" }, blocks.map((block, idx) => {
|
|
2931
2976
|
const { id, name: blockName, data } = block;
|
|
2932
|
-
const { placeholder, value: name, required, listQuestion, valueHTML, isSendMailChimp = false, } = data;
|
|
2977
|
+
const { placeholder: label, value: name, required, listQuestion, valueHTML, isSendMailChimp = false, } = data;
|
|
2933
2978
|
const formInputProps = form.getInputProps(name);
|
|
2934
2979
|
const { value, error } = formInputProps;
|
|
2935
2980
|
const reactKey = `${id}-${idx}`;
|
|
2936
2981
|
switch (blockName) {
|
|
2937
2982
|
case LEADGEN_BLOCK.TextBlock: {
|
|
2938
2983
|
return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
|
|
2939
|
-
React__default.createElement(TextInput, Object.assign({ name: name, spellCheck: false, withAsterisk: required, label:
|
|
2984
|
+
React__default.createElement(TextInput, Object.assign({ name: name, spellCheck: false, withAsterisk: required, label: label, placeholder: " ", inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, type: "text", "data-control": "text" }, formInputProps))));
|
|
2940
2985
|
}
|
|
2941
2986
|
case LEADGEN_BLOCK.NumberBlock: {
|
|
2942
2987
|
return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
|
|
2943
|
-
React__default.createElement(NumberInput$1, Object.assign({ name: value, spellCheck: false, withAsterisk: required, label:
|
|
2988
|
+
React__default.createElement(NumberInput$1, Object.assign({ name: value, spellCheck: false, withAsterisk: required, label: label, placeholder: " ", inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, type: "number", "data-control": "number" }, formInputProps))));
|
|
2944
2989
|
}
|
|
2945
2990
|
case LEADGEN_BLOCK.EmailBlock: {
|
|
2946
2991
|
return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
|
|
2947
|
-
React__default.createElement(TextInput, Object.assign({ name: name, spellCheck: false, withAsterisk: required, label:
|
|
2992
|
+
React__default.createElement(TextInput, Object.assign({ name: name, spellCheck: false, withAsterisk: required, label: label, placeholder: " ", inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, "data-control": "email" }, formInputProps))));
|
|
2948
2993
|
}
|
|
2949
2994
|
case LEADGEN_BLOCK.PhoneOtpBlock:
|
|
2950
2995
|
case LEADGEN_BLOCK.WhatsappOtpBlock:
|
|
2951
2996
|
case LEADGEN_BLOCK.ZaloOtpBlock:
|
|
2952
2997
|
case LEADGEN_BLOCK.PhoneBlock: {
|
|
2953
2998
|
return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
|
|
2954
|
-
React__default.createElement(PhoneInput, Object.assign({ name: name, spellCheck: false, withAsterisk: required, label:
|
|
2999
|
+
React__default.createElement(PhoneInput, Object.assign({ name: name, spellCheck: false, withAsterisk: required, label: label, placeholder: " ", inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, defaultCountry: (locale ? MAPPED_LOCALE[locale] || 'VN' : 'VN'), type: "text", "data-control": "tel" }, formInputProps))));
|
|
2955
3000
|
}
|
|
2956
3001
|
case LEADGEN_BLOCK.LocationBlock: {
|
|
2957
3002
|
return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
|
|
2958
|
-
React__default.createElement(GoogleLocationBlock, Object.assign({ name: name, withAsterisk: required, label:
|
|
3003
|
+
React__default.createElement(GoogleLocationBlock, Object.assign({ name: name, withAsterisk: required, label: label, placeholder: " ", inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, locale: locale, "data-control": "text" }, formInputProps))));
|
|
2959
3004
|
}
|
|
2960
3005
|
case LEADGEN_BLOCK.DateBlock: {
|
|
2961
3006
|
return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
|
|
2962
|
-
React__default.createElement(DateInput, Object.assign({ locale: (MAPPED_LOCALE === null || MAPPED_LOCALE === void 0 ? void 0 : MAPPED_LOCALE[locale]) || MAPPED_LOCALE['vi-VN'], valueFormat: "DD/MM/YYYY", name: name, withAsterisk: required, label:
|
|
3007
|
+
React__default.createElement(DateInput, Object.assign({ locale: (MAPPED_LOCALE === null || MAPPED_LOCALE === void 0 ? void 0 : MAPPED_LOCALE[locale]) || MAPPED_LOCALE['vi-VN'], valueFormat: "DD/MM/YYYY", name: name, withAsterisk: required, label: label, placeholder: " ", inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, type: "default", "data-control": "date" }, formInputProps))));
|
|
2963
3008
|
}
|
|
2964
3009
|
case LEADGEN_BLOCK.DropdownBlock:
|
|
2965
3010
|
return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
|
|
2966
3011
|
React__default.createElement("div", { style: { display: 'none' }, "data-extra": true, "data-name": value, "data-control": 'dropdown' }),
|
|
2967
|
-
React__default.createElement(Select$1, Object.assign({ name: name, withAsterisk: required, label:
|
|
3012
|
+
React__default.createElement(Select$1, Object.assign({ name: name, withAsterisk: required, label: label, placeholder: " ", searchable: true, data: listQuestion.map((l) => ({
|
|
2968
3013
|
value: l.value,
|
|
2969
3014
|
label: l.placeholder,
|
|
2970
|
-
}))
|
|
3015
|
+
})), nothingFound: React__default.createElement(NoData, null), styles: {
|
|
3016
|
+
item: {
|
|
3017
|
+
paddingBlock: 12,
|
|
3018
|
+
paddingInline: 10,
|
|
3019
|
+
fontSize: 16,
|
|
3020
|
+
lineHeight: 1.5,
|
|
3021
|
+
},
|
|
3022
|
+
nothingFound: {
|
|
3023
|
+
fontSize: 54,
|
|
3024
|
+
paddingBlock: 30,
|
|
3025
|
+
},
|
|
3026
|
+
itemsWrapper: {
|
|
3027
|
+
padding: 6,
|
|
3028
|
+
},
|
|
3029
|
+
dropdown: {
|
|
3030
|
+
'.mantine-ScrollArea-scrollbar[data-orientation="vertical"]': {
|
|
3031
|
+
'--radix-scroll-area-thumb-width': '6px',
|
|
3032
|
+
width: 'var(--radix-scroll-area-thumb-width)',
|
|
3033
|
+
paddingInline: 0,
|
|
3034
|
+
},
|
|
3035
|
+
},
|
|
3036
|
+
}, maxDropdownHeight: 192 }, formInputProps))));
|
|
2971
3037
|
case LEADGEN_BLOCK.CheckboxBlock: {
|
|
2972
3038
|
const formInputCheckboxProps = form.getInputProps(name, {
|
|
2973
3039
|
type: 'checkbox',
|
|
2974
3040
|
});
|
|
2975
3041
|
return (React__default.createElement(ChoiceField$1, { className: "leadgen-form_input leadgen-form_input_checkbox", key: reactKey },
|
|
2976
3042
|
isSendMailChimp && (React__default.createElement("div", { style: { display: 'none' }, "data-name": name + '-mailchimp' })),
|
|
2977
|
-
React__default.createElement(Checkbox$1.Group, Object.assign({ size: "md", withAsterisk: required, label:
|
|
3043
|
+
React__default.createElement(Checkbox$1.Group, Object.assign({ size: "md", withAsterisk: required, label: label, value: value, sx: {
|
|
2978
3044
|
display: 'flex',
|
|
2979
3045
|
flexDirection: 'column',
|
|
2980
3046
|
flexWrap: 'wrap',
|
|
@@ -2986,7 +3052,7 @@ const LeadGenForm = forwardRef((props, ref) => {
|
|
|
2986
3052
|
case LEADGEN_BLOCK.RadioBlock: {
|
|
2987
3053
|
return (React__default.createElement(ChoiceField$1, { className: "leadgen-form_input leadgen-form_input_checkbox", key: reactKey },
|
|
2988
3054
|
isSendMailChimp && (React__default.createElement("div", { style: { display: 'none' }, "data-name": name + '-mailchimp' })),
|
|
2989
|
-
React__default.createElement(Radio$1.Group, Object.assign({ size: "md", withAsterisk: required, label:
|
|
3055
|
+
React__default.createElement(Radio$1.Group, Object.assign({ size: "md", withAsterisk: required, label: label, value: value, spellCheck: true, inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, inputContainer: (children) => {
|
|
2990
3056
|
return (React__default.createElement("div", { className: "leadgen-choiceContainer" }, children));
|
|
2991
3057
|
} }, formInputProps), listQuestion.map((l, _index) => (React__default.createElement(Radio$1, { name: name, key: _index, value: l.value, label: l.placeholder, "data-control": "radio" }))))));
|
|
2992
3058
|
}
|
|
@@ -3021,8 +3087,8 @@ const LeadGenSubscriptionBoxA = (props) => {
|
|
|
3021
3087
|
}, [title]);
|
|
3022
3088
|
return (React__default.createElement(StyledLeadGenSubscriptionBoxA, { className: "subcription_box_A" },
|
|
3023
3089
|
React__default.createElement(StyledLeadGenSubscriptionBoxHeader, { className: "leadgen-subscription_box_header" },
|
|
3024
|
-
|
|
3025
|
-
|
|
3090
|
+
titleComp,
|
|
3091
|
+
imageComp),
|
|
3026
3092
|
React__default.createElement(StyledLeadGenSubscriptionBoxBody, { className: "leadgen-subscription_box_body" },
|
|
3027
3093
|
React__default.createElement(LeadGenForm, { ref: formRef, form: form, rules: rules, blocks: blocks, locale: locale, onFinish: onFinish, className: "leadgen-subscription_box_form" }),
|
|
3028
3094
|
React__default.createElement(Button$1, { disabled: loading, loading: loading, variant: "filled", size: "lg", onClick: () => {
|
|
@@ -3605,6 +3671,182 @@ const useViewportDimensions = () => {
|
|
|
3605
3671
|
return useMemo(() => (Object.assign({}, dimensions)), [dimensions.height, dimensions.width]);
|
|
3606
3672
|
};
|
|
3607
3673
|
|
|
3674
|
+
const StyledLeadGenLightBoxBFooter = styled.div `
|
|
3675
|
+
padding-top: calc(var(--spacing-y, 20px) * 8 / 20);
|
|
3676
|
+
padding-inline: var(--spacing-x, 20px);
|
|
3677
|
+
padding-bottom: var(--spacing-y, 20px);
|
|
3678
|
+
`;
|
|
3679
|
+
const StyledLeadGenLightBoxBBody = styled.div `
|
|
3680
|
+
flex: 1;
|
|
3681
|
+
min-height: 0;
|
|
3682
|
+
overflow: auto;
|
|
3683
|
+
padding-inline: var(--spacing-y, 20px);
|
|
3684
|
+
padding-block: calc(var(--spacing-x, 20px) * 8 / 20);
|
|
3685
|
+
&::-webkit-scrollbar {
|
|
3686
|
+
width: 6px;
|
|
3687
|
+
height: 6px;
|
|
3688
|
+
}
|
|
3689
|
+
|
|
3690
|
+
&::-webkit-scrollbar-track {
|
|
3691
|
+
background-color: transparent;
|
|
3692
|
+
}
|
|
3693
|
+
|
|
3694
|
+
&::-webkit-scrollbar-thumb {
|
|
3695
|
+
background-color: rgba(0, 0, 0, 0.4);
|
|
3696
|
+
border-radius: 6px;
|
|
3697
|
+
}
|
|
3698
|
+
`;
|
|
3699
|
+
const StyledLeadGenLightBoxBHeader = styled.div `
|
|
3700
|
+
display: flex;
|
|
3701
|
+
padding-top: var(--spacing-y, 20px);
|
|
3702
|
+
padding-inline: var(--spacing-x, 20px);
|
|
3703
|
+
padding-bottom: calc(var(--spacing-y, 20px) * 8 / 20);
|
|
3704
|
+
`;
|
|
3705
|
+
const StyledLeadGenLightBoxBWrapper = styled.div `
|
|
3706
|
+
height: 100%;
|
|
3707
|
+
display: flex;
|
|
3708
|
+
flex-direction: column;
|
|
3709
|
+
`;
|
|
3710
|
+
const StyledLeadGenLightBoxB = styled.div `
|
|
3711
|
+
--spacing-x: 20px;
|
|
3712
|
+
--spacing-y: 20px;
|
|
3713
|
+
--close-width: 24px;
|
|
3714
|
+
--close-height: 24px;
|
|
3715
|
+
|
|
3716
|
+
// For old version, Wrap every thing in children
|
|
3717
|
+
&[data-type='LightBoxB_typeA'] {
|
|
3718
|
+
height: 100%;
|
|
3719
|
+
width: 100%;
|
|
3720
|
+
.leadgen-wrapper,
|
|
3721
|
+
.leadgen-inner,
|
|
3722
|
+
.leadgen-form {
|
|
3723
|
+
height: 100%;
|
|
3724
|
+
}
|
|
3725
|
+
.leadgen-content {
|
|
3726
|
+
height: 100%;
|
|
3727
|
+
display: flex;
|
|
3728
|
+
flex-direction: column;
|
|
3729
|
+
}
|
|
3730
|
+
.leadgen-header {
|
|
3731
|
+
display: none;
|
|
3732
|
+
}
|
|
3733
|
+
.leadgen-title {
|
|
3734
|
+
padding-right: calc(var(--close-width, 24px) * 50 / 24);
|
|
3735
|
+
}
|
|
3736
|
+
.leadgen-description {
|
|
3737
|
+
display: none;
|
|
3738
|
+
}
|
|
3739
|
+
.leadgen-body {
|
|
3740
|
+
flex: 1;
|
|
3741
|
+
min-height: 0;
|
|
3742
|
+
}
|
|
3743
|
+
|
|
3744
|
+
.leadgen-close_btn {
|
|
3745
|
+
top: var(--spacing-y, 20px);
|
|
3746
|
+
right: var(--spacing-x, 20px);
|
|
3747
|
+
width: var(--close-width, 24px) !important;
|
|
3748
|
+
height: var(--close-height, 24px);
|
|
3749
|
+
box-shadow: none;
|
|
3750
|
+
font-size: 24px;
|
|
3751
|
+
}
|
|
3752
|
+
|
|
3753
|
+
.leadgen-empty_footer {
|
|
3754
|
+
.leadgen-btn {
|
|
3755
|
+
flex: 1;
|
|
3756
|
+
min-width: 0;
|
|
3757
|
+
}
|
|
3758
|
+
}
|
|
3759
|
+
|
|
3760
|
+
.leadgen-form_body {
|
|
3761
|
+
overflow: auto;
|
|
3762
|
+
animation: scrolling forwards;
|
|
3763
|
+
animation-timeline: scroll(self);
|
|
3764
|
+
}
|
|
3765
|
+
@keyframes scrolling {
|
|
3766
|
+
0%,
|
|
3767
|
+
to {
|
|
3768
|
+
border-bottom: 1px solid ${theme.colors.neutral100};
|
|
3769
|
+
}
|
|
3770
|
+
}
|
|
3771
|
+
}
|
|
3772
|
+
`;
|
|
3773
|
+
const StyledMotionContainer = styled(motion.div) `
|
|
3774
|
+
position: fixed;
|
|
3775
|
+
inset: 0;
|
|
3776
|
+
z-index: ${ZINDEX_SSO + 1};
|
|
3777
|
+
background-color: #fff;
|
|
3778
|
+
`;
|
|
3779
|
+
|
|
3780
|
+
const PREFIX_CLS = 'LightBoxB_typeA';
|
|
3781
|
+
const DURATION = 1000 * 0.5;
|
|
3782
|
+
const DRAWER_STYLE = {
|
|
3783
|
+
visible: {
|
|
3784
|
+
opacity: 1,
|
|
3785
|
+
translateY: '0px',
|
|
3786
|
+
transitionProperty: 'translate',
|
|
3787
|
+
transitionDuration: '0.25s',
|
|
3788
|
+
},
|
|
3789
|
+
hidden: {
|
|
3790
|
+
opacity: 0,
|
|
3791
|
+
translateY: '100%',
|
|
3792
|
+
transitionProperty: 'translate',
|
|
3793
|
+
transitionDuration: '0.25s',
|
|
3794
|
+
},
|
|
3795
|
+
};
|
|
3796
|
+
const LeadGenLightBoxBTypeA = (props) => {
|
|
3797
|
+
const { visible, onVisible, icon, title, buttonText, blocks, children } = props, restProps = __rest(props, ["visible", "onVisible", "icon", "title", "buttonText", "blocks", "children"]);
|
|
3798
|
+
const formRef = useRef();
|
|
3799
|
+
const [open, setOpen] = useState(visible);
|
|
3800
|
+
const { height } = useViewportDimensions();
|
|
3801
|
+
usePreventScroll();
|
|
3802
|
+
const onOpenChange = useCallback((open) => {
|
|
3803
|
+
if (!open) {
|
|
3804
|
+
// Wait for duration of animation
|
|
3805
|
+
setTimeout(() => {
|
|
3806
|
+
onVisible === null || onVisible === void 0 ? void 0 : onVisible(open);
|
|
3807
|
+
}, DURATION);
|
|
3808
|
+
return;
|
|
3809
|
+
}
|
|
3810
|
+
onVisible === null || onVisible === void 0 ? void 0 : onVisible(open);
|
|
3811
|
+
}, [onVisible]);
|
|
3812
|
+
const iconComp = useMemo(() => {
|
|
3813
|
+
if (!icon) {
|
|
3814
|
+
return null;
|
|
3815
|
+
}
|
|
3816
|
+
return React__default.createElement(React__default.Fragment, null);
|
|
3817
|
+
}, [icon]);
|
|
3818
|
+
const titleComp = useMemo(() => {
|
|
3819
|
+
if (!title) {
|
|
3820
|
+
return null;
|
|
3821
|
+
}
|
|
3822
|
+
return title;
|
|
3823
|
+
}, [title]);
|
|
3824
|
+
const childrenComp = useMemo(() => {
|
|
3825
|
+
if (children) {
|
|
3826
|
+
return children;
|
|
3827
|
+
}
|
|
3828
|
+
return (React__default.createElement(StyledLeadGenLightBoxBWrapper, { className: `${PREFIX_CLS}_wrapper lightboxB_wrapper` },
|
|
3829
|
+
React__default.createElement(StyledLeadGenLightBoxBHeader, { className: `${PREFIX_CLS}_header lightboxB_header` },
|
|
3830
|
+
React__default.createElement("div", { className: "lightBoxB_header_icon" }, iconComp),
|
|
3831
|
+
React__default.createElement("div", { className: "lightBoxB_header_title" }, titleComp),
|
|
3832
|
+
React__default.createElement("div", { className: "lightBoxB_header_close", onClick: () => onOpenChange(false) },
|
|
3833
|
+
React__default.createElement(CloseButton, null))),
|
|
3834
|
+
React__default.createElement(StyledLeadGenLightBoxBBody, { className: `${PREFIX_CLS}_body lightboxB_body` },
|
|
3835
|
+
React__default.createElement(LeadGenForm, Object.assign({ ref: formRef, blocks: blocks }, restProps))),
|
|
3836
|
+
React__default.createElement(StyledLeadGenLightBoxBFooter, { className: `${PREFIX_CLS}_footer lightboxB_footer` },
|
|
3837
|
+
React__default.createElement(Button, { onClick: () => { var _a; return (_a = formRef.current) === null || _a === void 0 ? void 0 : _a.submit(); } }, buttonText))));
|
|
3838
|
+
}, [children, onOpenChange]);
|
|
3839
|
+
useEffect(() => {
|
|
3840
|
+
setOpen(visible);
|
|
3841
|
+
}, [visible]);
|
|
3842
|
+
return (React__default.createElement(StyledMotionContainer, { animate: open ? 'visible' : 'hidden', variants: DRAWER_STYLE },
|
|
3843
|
+
React__default.createElement(StyledLeadGenLightBoxB, { "data-type": "LightBoxB_typeA", style: height ? { maxHeight: height } : undefined }, childrenComp)));
|
|
3844
|
+
};
|
|
3845
|
+
|
|
3846
|
+
const LeadGenLightBoxB = (props) => {
|
|
3847
|
+
return React__default.createElement(LeadGenLightBoxBTypeA, Object.assign({}, props));
|
|
3848
|
+
};
|
|
3849
|
+
|
|
3608
3850
|
const ThankyouPopup = ({ title, titleAlign, subtitle, subtitleAlign, link, linkNewTab, linkText, image, }) => {
|
|
3609
3851
|
const { primaryColor } = useContext(LeadGenContext$1);
|
|
3610
3852
|
const { width: imageWidth, height: imageHeight, loaded: imageLoaded, } = useImageSize(image);
|
|
@@ -3974,6 +4216,7 @@ const StyledTextFieldContainer = styled.div `
|
|
|
3974
4216
|
outline: none !important;
|
|
3975
4217
|
border: none;
|
|
3976
4218
|
box-shadow: none;
|
|
4219
|
+
font-size: var(--input, 15px);
|
|
3977
4220
|
padding: 0 var(--phone-input-space-x, 8px);
|
|
3978
4221
|
opacity: 0;
|
|
3979
4222
|
color: ${theme.colors.gray800} !important;
|
|
@@ -4093,17 +4336,22 @@ const TextField = (props) => {
|
|
|
4093
4336
|
onChangeShrink === null || onChangeShrink === void 0 ? void 0 : onChangeShrink(false);
|
|
4094
4337
|
});
|
|
4095
4338
|
const [shrink, setShrink] = useState(shrinkProps);
|
|
4339
|
+
const focusInput = (target) => {
|
|
4340
|
+
const $textEl = target.querySelectorAll('input:not([disabled]):not([type="submit"]),select:not([disabled]),textarea:not([disabled])');
|
|
4341
|
+
const $focusEl = $textEl.item($textEl.length - 1);
|
|
4342
|
+
if ($focusEl) {
|
|
4343
|
+
$focusEl.focus({ preventScroll: true });
|
|
4344
|
+
}
|
|
4345
|
+
};
|
|
4096
4346
|
const onClick = useCallback((e) => {
|
|
4097
|
-
setShrink(true);
|
|
4098
|
-
onChangeShrink === null || onChangeShrink === void 0 ? void 0 : onChangeShrink(true);
|
|
4099
4347
|
if (shrink) {
|
|
4348
|
+
e.preventDefault();
|
|
4349
|
+
focusInput(e.currentTarget);
|
|
4100
4350
|
return;
|
|
4101
4351
|
}
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
$focusEl.focus();
|
|
4106
|
-
}
|
|
4352
|
+
setShrink(true);
|
|
4353
|
+
onChangeShrink === null || onChangeShrink === void 0 ? void 0 : onChangeShrink(true);
|
|
4354
|
+
focusInput(e.currentTarget);
|
|
4107
4355
|
}, [shrink]);
|
|
4108
4356
|
useEffect(() => {
|
|
4109
4357
|
setShrink(shrinkProps);
|
|
@@ -4130,7 +4378,7 @@ const LightboxFields = ({ listBlockAdded, popupId, locale, onClose, onOtherSubmi
|
|
|
4130
4378
|
return (React__default.createElement(React__default.Fragment, null, listBlockAdded.map((b, index) => {
|
|
4131
4379
|
var _a;
|
|
4132
4380
|
const { name = '', data = {}, id } = b || {};
|
|
4133
|
-
const { placeholder, value, align, listQuestion, isSendMailChimp = false, newtab, url, } = data;
|
|
4381
|
+
const { placeholder: label, value, align, listQuestion, isSendMailChimp = false, newtab, url, } = data;
|
|
4134
4382
|
const required = (_a = data.required) !== null && _a !== void 0 ? _a : true;
|
|
4135
4383
|
const formValue = (formValues === null || formValues === void 0 ? void 0 : formValues[value]) || null;
|
|
4136
4384
|
switch (name) {
|
|
@@ -4140,23 +4388,23 @@ const LightboxFields = ({ listBlockAdded, popupId, locale, onClose, onOtherSubmi
|
|
|
4140
4388
|
return (React__default.createElement(SubtitleBlock, { key: index, align: align }, value));
|
|
4141
4389
|
case 'TextBlock':
|
|
4142
4390
|
return (React__default.createElement(TextField, { key: index, shrink: !!formValue, className: "lead-modal__form-control leadgen-form_field" },
|
|
4143
|
-
React__default.createElement(TextInput, Object.assign({ withAsterisk: required, spellCheck: false, type: "text", placeholder:
|
|
4391
|
+
React__default.createElement(TextInput, Object.assign({ withAsterisk: required, spellCheck: false, type: "text", placeholder: " ",
|
|
4144
4392
|
// className="lead-modal__form-control leadgen-form_field"
|
|
4145
4393
|
// onChangeRaw={(e) => inputOnChange('text', e)}
|
|
4146
|
-
label:
|
|
4394
|
+
label: label, "data-control": "text", "data-lead-control": 'TextBlock', inputWrapperOrder: ['label', 'input', 'description', 'error'] }, form.getInputProps(value), { name: value }))));
|
|
4147
4395
|
case 'NumberBlock':
|
|
4148
4396
|
return (React__default.createElement(TextField, { key: index, shrink: !!formValue, className: "lead-modal__form-control leadgen-form_field" },
|
|
4149
|
-
React__default.createElement(NumberInput$1, Object.assign({ withAsterisk: required, spellCheck: false, type: "number", placeholder:
|
|
4397
|
+
React__default.createElement(NumberInput$1, Object.assign({ withAsterisk: required, spellCheck: false, type: "number", placeholder: " ",
|
|
4150
4398
|
// className="lead-modal__form-control leadgen-form_field"
|
|
4151
4399
|
// onChange={(e) => inputOnChange('number', e)}
|
|
4152
|
-
label:
|
|
4400
|
+
label: label, "data-control": "number", "data-lead-control": name, name: value, inputWrapperOrder: ['label', 'input', 'description', 'error'] }, form.getInputProps(value)))));
|
|
4153
4401
|
case 'EmailBlock':
|
|
4154
4402
|
return (React__default.createElement(TextField, { key: index, shrink: !!formValue, className: "lead-modal__form-control leadgen-form_field" },
|
|
4155
4403
|
React__default.createElement(TextInput, Object.assign({ withAsterisk: required, spellCheck: false,
|
|
4156
4404
|
// type="email"
|
|
4157
|
-
placeholder:
|
|
4405
|
+
placeholder: " ",
|
|
4158
4406
|
// className="lead-modal__form-control leadgen-form_field"
|
|
4159
|
-
label:
|
|
4407
|
+
label: label, "data-control": "email", "data-lead-control": name, name: value, inputWrapperOrder: ['label', 'input', 'description', 'error'] }, form.getInputProps(value)))));
|
|
4160
4408
|
case 'PhoneOtpBlock':
|
|
4161
4409
|
case 'WhatsappOtpBlock':
|
|
4162
4410
|
case 'ZaloOtpBlock':
|
|
@@ -4166,20 +4414,20 @@ const LightboxFields = ({ listBlockAdded, popupId, locale, onClose, onOtherSubmi
|
|
|
4166
4414
|
return (React__default.createElement(TextField, { key: index, shrink: !!formValue, className: clsx('lead-modal__form-control leadgen-form_field', {
|
|
4167
4415
|
'leadgen-form_field_error': !!error,
|
|
4168
4416
|
}) },
|
|
4169
|
-
React__default.createElement(Input$1.Wrapper, { size: "md", withAsterisk: required, label:
|
|
4417
|
+
React__default.createElement(Input$1.Wrapper, { size: "md", withAsterisk: required, label: label, "data-invalid": !!error, labelProps: { htmlFor: htmlForId }, inputWrapperOrder: ['label', 'input', 'description', 'error'], error: error },
|
|
4170
4418
|
React__default.createElement("div", { className: "mantine-Input-wrapper" },
|
|
4171
|
-
React__default.createElement(Phone, Object.assign({ className: "mantine-Input-input", name: value, spellCheck: false, type: "tel", placeholder:
|
|
4419
|
+
React__default.createElement(Phone, Object.assign({ className: "mantine-Input-input", name: value, spellCheck: false, type: "tel", placeholder: " ",
|
|
4172
4420
|
// onBlur={(e) => inputOnBlur('tel', e)}
|
|
4173
|
-
id: htmlForId, defaultCountry: (locale ? MAPPED_LOCALE[locale] || 'VN' : 'VN'), "data-control": "tel" }, formPhoneInputWrapper))))));
|
|
4421
|
+
id: htmlForId, defaultCountry: (locale ? MAPPED_LOCALE[locale] || 'VN' : 'VN'), "data-control": "tel", "data-lead-control": name }, formPhoneInputWrapper))))));
|
|
4174
4422
|
}
|
|
4175
4423
|
case 'LocationBlock': {
|
|
4176
4424
|
return (React__default.createElement(TextField, { key: index, shrink: !!formValue, className: "lead-modal__form-control leadgen-form_field" },
|
|
4177
|
-
React__default.createElement(GoogleLocationBlock, Object.assign({ withAsterisk: required, name: value, placeholder:
|
|
4425
|
+
React__default.createElement(GoogleLocationBlock, Object.assign({ withAsterisk: required, name: value, placeholder: " ", label: label, "data-control": "text", "data-lead-control": name, locale: locale, inputWrapperOrder: ['label', 'input', 'description', 'error'] }, form.getInputProps(value)))));
|
|
4178
4426
|
}
|
|
4179
4427
|
case 'DateBlock': {
|
|
4180
4428
|
const _c = form.getInputProps(value), { error } = _c, formInputProps = __rest(_c, ["error"]);
|
|
4181
|
-
return (React__default.createElement(Input$1.Wrapper, { key: index, size: "md", withAsterisk: required, label:
|
|
4182
|
-
React__default.createElement(InputDate, Object.assign({ name: value, error: Boolean(error), locale: locale, "data-extra": true, "data-name": value, "data-control": "date", className: "leadgen-form_field_date", labelTuples: labelTuples }, formInputProps))));
|
|
4429
|
+
return (React__default.createElement(Input$1.Wrapper, { key: index, size: "md", withAsterisk: required, label: label, "data-invalid": !!error, inputWrapperOrder: ['label', 'input', 'description', 'error'], error: error, className: "lead-modal__form-control leadgen-form_field" },
|
|
4430
|
+
React__default.createElement(InputDate, Object.assign({ name: value, error: Boolean(error), locale: locale, "data-extra": true, "data-name": value, "data-control": "date", "data-lead-control": name, className: "leadgen-form_field_date", labelTuples: labelTuples }, formInputProps))));
|
|
4183
4431
|
}
|
|
4184
4432
|
case 'LinkButtonBlock':
|
|
4185
4433
|
return (React__default.createElement("div", { key: index },
|
|
@@ -4195,38 +4443,59 @@ const LightboxFields = ({ listBlockAdded, popupId, locale, onClose, onOtherSubmi
|
|
|
4195
4443
|
}, "data-name": value + '-mailchimp' })),
|
|
4196
4444
|
React__default.createElement(Checkbox.Group, Object.assign({ withAsterisk: required,
|
|
4197
4445
|
// className="lead-modal__form-control leadgen-form_field"
|
|
4198
|
-
label:
|
|
4446
|
+
label: label, size: "md", sx: {
|
|
4199
4447
|
display: 'flex',
|
|
4200
4448
|
flexDirection: 'column',
|
|
4201
4449
|
flexWrap: 'wrap',
|
|
4202
4450
|
gap: 8,
|
|
4203
4451
|
}, inputWrapperOrder: ['label', 'input', 'description', 'error'], inputContainer: (children) => {
|
|
4204
4452
|
return (React__default.createElement("div", { className: "leadgen-choiceContainer" }, children));
|
|
4205
|
-
} }, form.getInputProps(value)), listQuestion.map((l, _index) => (React__default.createElement(Checkbox, { name: value, key: _index, value: l.value, label: l.placeholder, "data-control": "checkbox" }))))));
|
|
4453
|
+
} }, form.getInputProps(value)), listQuestion.map((l, _index) => (React__default.createElement(Checkbox, { name: value, key: _index, value: l.value, label: l.placeholder, "data-control": "checkbox", "data-lead-control": name }))))));
|
|
4206
4454
|
case 'RadioBlock':
|
|
4207
4455
|
return (React__default.createElement(ChoiceField, { className: "leadgen-form_radio", key: index },
|
|
4208
4456
|
isSendMailChimp && (React__default.createElement(Input$1, { type: "hidden", name: value + '-mailchimp', value: isSendMailChimp })),
|
|
4209
4457
|
React__default.createElement(Radio.Group, Object.assign({ withAsterisk: required,
|
|
4210
4458
|
// className="lead-modal__form-control leadgen-form_field"
|
|
4211
|
-
label:
|
|
4459
|
+
label: label, size: "md", inputWrapperOrder: ['label', 'input', 'description', 'error'], inputContainer: (children) => {
|
|
4212
4460
|
return (React__default.createElement("div", { className: "leadgen-choiceContainer" }, children));
|
|
4213
|
-
} }, form.getInputProps(value)), listQuestion.map((l, _index) => (React__default.createElement(Radio, { name: value, key: _index, value: l.value, label: l.placeholder, "data-control": "radio" }))))));
|
|
4461
|
+
} }, form.getInputProps(value)), listQuestion.map((l, _index) => (React__default.createElement(Radio, { name: value, key: _index, value: l.value, label: l.placeholder, "data-control": "radio", "data-lead-control": name }))))));
|
|
4214
4462
|
case 'DropdownBlock':
|
|
4215
|
-
return (React__default.createElement(TextField, { shrink: !!formValue, className: "lead-modal__form-control leadgen-form_field", key: index },
|
|
4216
|
-
React__default.createElement("div", { style: { display: 'none' }, "data-extra": true, "data-name": value, "data-control": 'dropdown' }),
|
|
4463
|
+
return (React__default.createElement(TextField, { shrink: !!formValue, className: "lead-modal__form-control leadgen-form_field DropdownBlock", key: index },
|
|
4464
|
+
React__default.createElement("div", { style: { display: 'none' }, "data-extra": true, "data-name": value, "data-control": 'dropdown', "data-lead-control": name }),
|
|
4217
4465
|
React__default.createElement(Select
|
|
4218
4466
|
// className="lead-modal__form-control leadgen-form_field"
|
|
4219
4467
|
, Object.assign({
|
|
4220
4468
|
// className="lead-modal__form-control leadgen-form_field"
|
|
4221
|
-
label:
|
|
4469
|
+
label: label, placeholder: " ", searchable: true, withAsterisk: required, name: value, data: listQuestion.map((l) => ({
|
|
4222
4470
|
value: l.value,
|
|
4223
4471
|
label: l.placeholder,
|
|
4224
|
-
}))
|
|
4472
|
+
})), nothingFound: React__default.createElement(NoData, null), styles: {
|
|
4473
|
+
item: {
|
|
4474
|
+
paddingBlock: 12,
|
|
4475
|
+
paddingInline: 10,
|
|
4476
|
+
fontSize: 16,
|
|
4477
|
+
lineHeight: 1.5,
|
|
4478
|
+
},
|
|
4479
|
+
nothingFound: {
|
|
4480
|
+
fontSize: 54,
|
|
4481
|
+
paddingBlock: 30,
|
|
4482
|
+
},
|
|
4483
|
+
itemsWrapper: {
|
|
4484
|
+
padding: 6,
|
|
4485
|
+
},
|
|
4486
|
+
dropdown: {
|
|
4487
|
+
'.mantine-ScrollArea-scrollbar[data-orientation="vertical"]': {
|
|
4488
|
+
'--radix-scroll-area-thumb-width': '6px',
|
|
4489
|
+
width: 'var(--radix-scroll-area-thumb-width)',
|
|
4490
|
+
paddingInline: 0,
|
|
4491
|
+
},
|
|
4492
|
+
},
|
|
4493
|
+
}, maxDropdownHeight: 192 }, form.getInputProps(value)))));
|
|
4225
4494
|
case 'TncBlock':
|
|
4226
4495
|
const _d = form.getInputProps(`TNC-${id}`), { error } = _d, tncInputProps = __rest(_d, ["error"]);
|
|
4227
4496
|
return (React__default.createElement(ChoiceField, { className: "leadgen-form_checkbox", key: id },
|
|
4228
4497
|
React__default.createElement(Input$1.Wrapper, { error: error },
|
|
4229
|
-
React__default.createElement(Checkbox, Object.assign({ name: 'TNC-' + id, label: React__default.createElement("p", { className: "lead-modal__tnc-link", dangerouslySetInnerHTML: { __html: data.valueHTML } }), className: "tnc-block", "data-control": "checkbox" }, tncInputProps)))));
|
|
4498
|
+
React__default.createElement(Checkbox, Object.assign({ name: 'TNC-' + id, label: React__default.createElement("p", { className: "lead-modal__tnc-link", dangerouslySetInnerHTML: { __html: data.valueHTML } }), className: "tnc-block", "data-control": "checkbox", "data-lead-control": name }, tncInputProps)))));
|
|
4230
4499
|
}
|
|
4231
4500
|
return null;
|
|
4232
4501
|
})));
|
|
@@ -4474,7 +4743,9 @@ const LEADGEN_SHOW_HEADER = [
|
|
|
4474
4743
|
LEADGEN_LAYOUT.Sidebar,
|
|
4475
4744
|
LEADGEN_LAYOUT.Slider,
|
|
4476
4745
|
];
|
|
4477
|
-
const
|
|
4746
|
+
// const CAMPAGE_CODE_LIST_APPLY_NEW_UI = ['ri3lkoxcetjoj39', 'u0adw7hw8kw7t89']
|
|
4747
|
+
const CAMPAGE_CODE_LIST_APPLY_NEW_UI = ['ri3lkoxcetjoj39'];
|
|
4748
|
+
const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSubmit, imageMobile, imageDesktop, imageOverlayMobile, imageOverlayDesktop, imageBackground, currentLayout, title, onSubmit, onUnmount, showThankyou, campaignId, campaignCode, campaign_subot_id, locale, showEmpty, setShowEmpty, userInfo, }) => {
|
|
4478
4749
|
var _a, _b;
|
|
4479
4750
|
const { primaryColor } = useContext(LeadGenContext$1);
|
|
4480
4751
|
const { isMobile } = useScreenSize();
|
|
@@ -4482,17 +4753,25 @@ const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSub
|
|
|
4482
4753
|
const [showOtpPhone, setShowOtpPhone] = useState(null);
|
|
4483
4754
|
const [isSubmitLoading, setIsSubmitLoading] = useState(false);
|
|
4484
4755
|
const [snap, setSnap] = useState(0.8);
|
|
4756
|
+
const isTrackedForm = useRef(false);
|
|
4485
4757
|
const formRef = useRef();
|
|
4758
|
+
const [lastFormRef, setLastFormRef] = useState();
|
|
4486
4759
|
const onClose = () => {
|
|
4487
4760
|
if (showOtpPhone) {
|
|
4488
4761
|
setShowOtpPhone(null);
|
|
4489
4762
|
}
|
|
4490
4763
|
else {
|
|
4491
|
-
onCloseProp === null || onCloseProp === void 0 ? void 0 : onCloseProp(
|
|
4764
|
+
onCloseProp === null || onCloseProp === void 0 ? void 0 : onCloseProp({
|
|
4765
|
+
formValues: form.values,
|
|
4766
|
+
formActiveTime: formActiveTime.current,
|
|
4767
|
+
formRef: formRef.current,
|
|
4768
|
+
listBlockAdded,
|
|
4769
|
+
});
|
|
4492
4770
|
}
|
|
4493
4771
|
};
|
|
4494
4772
|
const { height } = useViewportDimensions();
|
|
4495
4773
|
usePreventScroll();
|
|
4774
|
+
const formActiveTime = useRef(0);
|
|
4496
4775
|
const textBlocks = JSON.parse(extraFields.textBlocks);
|
|
4497
4776
|
const listBlockAdded = JSON.parse(extraFields.listBlockAdded);
|
|
4498
4777
|
const actionBlocks = JSON.parse(extraFields.actionBlocks);
|
|
@@ -4509,6 +4788,7 @@ const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSub
|
|
|
4509
4788
|
const isFullscreen = currentLayout === LEADGEN_LAYOUT.Fullscreen;
|
|
4510
4789
|
const isInPage = isInline || isSidebar;
|
|
4511
4790
|
const isDrawer = isLightBoxB && isMobile;
|
|
4791
|
+
const isNewUI = useMemo(() => CAMPAGE_CODE_LIST_APPLY_NEW_UI.includes(campaignCode), [campaignCode]);
|
|
4512
4792
|
const limitFieldsLightBoxB = isLightBoxB && listBlockAdded.length <= LEADGEN_LIMIT_LIGHTBOXB;
|
|
4513
4793
|
const hasForm = isLightBoxA
|
|
4514
4794
|
? listBlockAdded.some((item) => LEADGEN_BLOCK_INPUT.some((k) => k === (item === null || item === void 0 ? void 0 : item.name)))
|
|
@@ -4517,6 +4797,17 @@ const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSub
|
|
|
4517
4797
|
const showHeader = !!imageMobile || !!imageDesktop;
|
|
4518
4798
|
const onlyHeader = !title && !description;
|
|
4519
4799
|
const showButtonClose = !isInline;
|
|
4800
|
+
const validatingPhoneRef = useRef(false);
|
|
4801
|
+
const validatingEmailRef = useRef(false);
|
|
4802
|
+
const { form, validateObj } = useLeadFormConfig({
|
|
4803
|
+
listBlockAdded,
|
|
4804
|
+
validatingPhoneRef,
|
|
4805
|
+
validatingEmailRef,
|
|
4806
|
+
campaignId,
|
|
4807
|
+
campaign_subot_id,
|
|
4808
|
+
userInfo,
|
|
4809
|
+
format: (_a = (ISO_FORMAT[locale] || ISO_FORMAT['vi-VN'])) === null || _a === void 0 ? void 0 : _a.dateFormat,
|
|
4810
|
+
});
|
|
4520
4811
|
if (window.innerWidth < 769 &&
|
|
4521
4812
|
LEADGEN_LAYOUT_NOT_SHOW_IN_MOBILE.includes(currentLayout)) {
|
|
4522
4813
|
console.log('😎 Not show fullscreen, slider on mobile ');
|
|
@@ -4531,17 +4822,33 @@ const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSub
|
|
|
4531
4822
|
}
|
|
4532
4823
|
clearCacheUsedEmailOrPhone();
|
|
4533
4824
|
}, []);
|
|
4534
|
-
|
|
4535
|
-
|
|
4536
|
-
|
|
4537
|
-
|
|
4538
|
-
|
|
4539
|
-
|
|
4540
|
-
|
|
4541
|
-
|
|
4542
|
-
|
|
4543
|
-
|
|
4544
|
-
|
|
4825
|
+
useEffect(() => {
|
|
4826
|
+
formRef.current && setLastFormRef(formRef.current);
|
|
4827
|
+
}, [formRef.current]);
|
|
4828
|
+
useEffect(() => {
|
|
4829
|
+
const handleBeforeUnload = () => {
|
|
4830
|
+
!isTrackedForm.current &&
|
|
4831
|
+
!showThankyou &&
|
|
4832
|
+
(onUnmount === null || onUnmount === void 0 ? void 0 : onUnmount({
|
|
4833
|
+
formValues: form.values,
|
|
4834
|
+
formActiveTime: formActiveTime.current,
|
|
4835
|
+
formRef: lastFormRef,
|
|
4836
|
+
listBlockAdded,
|
|
4837
|
+
}));
|
|
4838
|
+
};
|
|
4839
|
+
window.addEventListener('beforeunload', handleBeforeUnload);
|
|
4840
|
+
return () => window.removeEventListener('beforeunload', handleBeforeUnload);
|
|
4841
|
+
}, [lastFormRef, form.values, showThankyou]);
|
|
4842
|
+
useEffect(() => {
|
|
4843
|
+
let intervalId = null;
|
|
4844
|
+
if (isLightBox && !showThankyou) {
|
|
4845
|
+
intervalId = setInterval(() => {
|
|
4846
|
+
formActiveTime.current += 1;
|
|
4847
|
+
// console.log({ formActiveTime: formActiveTime.current })
|
|
4848
|
+
}, 1000);
|
|
4849
|
+
}
|
|
4850
|
+
return () => clearInterval(intervalId);
|
|
4851
|
+
}, [showThankyou]);
|
|
4545
4852
|
const listBlockAddedRequired = useMemo(() => leadGenFieldRequired(listBlockAdded), listBlockAdded);
|
|
4546
4853
|
const disabledButtonSubmit = useMemo(() => {
|
|
4547
4854
|
if (listBlockAddedRequired.length) {
|
|
@@ -4551,10 +4858,46 @@ const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSub
|
|
|
4551
4858
|
}, [...listBlockAddedRequired.map((k) => form.values[k])]);
|
|
4552
4859
|
const onFocus = (e) => {
|
|
4553
4860
|
e.preventDefault();
|
|
4554
|
-
|
|
4555
|
-
const
|
|
4556
|
-
|
|
4557
|
-
|
|
4861
|
+
function scrollIntoView() {
|
|
4862
|
+
const $Input = e.target;
|
|
4863
|
+
const $TextField = $Input.closest('.leadgen-form_field');
|
|
4864
|
+
const scrollIntoView = {
|
|
4865
|
+
block: 'center',
|
|
4866
|
+
behavior: 'auto',
|
|
4867
|
+
};
|
|
4868
|
+
if ($TextField.classList.contains('DropdownBlock')) {
|
|
4869
|
+
scrollIntoView.block = 'start';
|
|
4870
|
+
const tfOffsetTop = ($TextField === null || $TextField === void 0 ? void 0 : $TextField.offsetTop) || 0;
|
|
4871
|
+
const tfHeight = $TextField.clientHeight;
|
|
4872
|
+
const $ScrollableElement = getParentScroll($TextField);
|
|
4873
|
+
if ($ScrollableElement) {
|
|
4874
|
+
// https://hhgdev.atlassian.net/browse/EL-682
|
|
4875
|
+
const scrollHeight = $ScrollableElement.scrollHeight;
|
|
4876
|
+
if (scrollHeight - (tfOffsetTop + tfHeight) < 192) {
|
|
4877
|
+
scrollIntoView.block = 'end';
|
|
4878
|
+
}
|
|
4879
|
+
}
|
|
4880
|
+
}
|
|
4881
|
+
if (isMobile) {
|
|
4882
|
+
window.scrollTo(0, 0);
|
|
4883
|
+
}
|
|
4884
|
+
$TextField.scrollIntoView(scrollIntoView);
|
|
4885
|
+
}
|
|
4886
|
+
let time = 0;
|
|
4887
|
+
function requestFrame(timestamp) {
|
|
4888
|
+
if (time === 0) {
|
|
4889
|
+
time = timestamp;
|
|
4890
|
+
}
|
|
4891
|
+
if (timestamp - time <= 250) {
|
|
4892
|
+
requestAnimationFrame(requestFrame);
|
|
4893
|
+
}
|
|
4894
|
+
else {
|
|
4895
|
+
scrollIntoView();
|
|
4896
|
+
}
|
|
4897
|
+
}
|
|
4898
|
+
if (isMobile) {
|
|
4899
|
+
requestAnimationFrame(requestFrame);
|
|
4900
|
+
}
|
|
4558
4901
|
};
|
|
4559
4902
|
const middlewareOnSubmit = (e) => {
|
|
4560
4903
|
e.preventDefault();
|
|
@@ -4611,7 +4954,12 @@ const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSub
|
|
|
4611
4954
|
var _a;
|
|
4612
4955
|
const respMessage = (_a = res === null || res === void 0 ? void 0 : res._messages) === null || _a === void 0 ? void 0 : _a[0];
|
|
4613
4956
|
if (respMessage === 'This phone number was verified') {
|
|
4614
|
-
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(
|
|
4957
|
+
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit({
|
|
4958
|
+
formValues: v,
|
|
4959
|
+
formActiveTime: formActiveTime.current,
|
|
4960
|
+
formRef: formRef.current,
|
|
4961
|
+
listBlockAdded,
|
|
4962
|
+
});
|
|
4615
4963
|
return;
|
|
4616
4964
|
}
|
|
4617
4965
|
setShowOtpPhone(newShowOtpPhone);
|
|
@@ -4621,7 +4969,12 @@ const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSub
|
|
|
4621
4969
|
});
|
|
4622
4970
|
return;
|
|
4623
4971
|
}
|
|
4624
|
-
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(
|
|
4972
|
+
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit({
|
|
4973
|
+
formValues: v,
|
|
4974
|
+
formActiveTime: formActiveTime.current,
|
|
4975
|
+
formRef: formRef.current,
|
|
4976
|
+
listBlockAdded,
|
|
4977
|
+
});
|
|
4625
4978
|
})(e);
|
|
4626
4979
|
}, 100);
|
|
4627
4980
|
};
|
|
@@ -4667,7 +5020,12 @@ const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSub
|
|
|
4667
5020
|
React__default.createElement(LightboxFields, { listBlockAdded: listBlockAdded, popupId: popupId, locale: locale, onClose: onClose, onOtherSubmit: onOtherSubmit }))))));
|
|
4668
5021
|
const PopupOtp = showOtpPhone && (React__default.createElement(OtpBlock, { otpData: showOtpPhone, autoSendWhenOpen: false, onSuccess: () => {
|
|
4669
5022
|
setShowOtpPhone(null);
|
|
4670
|
-
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(
|
|
5023
|
+
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit({
|
|
5024
|
+
formValues: form.values,
|
|
5025
|
+
formActiveTime: formActiveTime.current,
|
|
5026
|
+
formRef: formRef.current,
|
|
5027
|
+
listBlockAdded,
|
|
5028
|
+
});
|
|
4671
5029
|
} }));
|
|
4672
5030
|
const PopupThankYou = showThankyou && (React__default.createElement(ThankyouPopup, { title: showThankyou.title, titleAlign: showThankyou.titleAlign, subtitle: showThankyou.subtitle, subtitleAlign: showThankyou.subtitleAlign, link: showThankyou.link, linkNewTab: showThankyou.linkNewTab, linkText: showThankyou.linkText, image: showThankyou.image }));
|
|
4673
5031
|
const PopupContent = (React__default.createElement("div", { className: clsx('leadgen-content', {
|
|
@@ -4702,18 +5060,13 @@ const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSub
|
|
|
4702
5060
|
'leadgen-inline': isInPage,
|
|
4703
5061
|
'leadgen-slider': isSlider,
|
|
4704
5062
|
});
|
|
4705
|
-
const PopupContainer = isDrawer ? (
|
|
4706
|
-
// <LeadGenLightBoxB
|
|
4707
|
-
// form={form}
|
|
4708
|
-
// loading={isSubmitLoading}
|
|
4709
|
-
// visible={open}
|
|
4710
|
-
// onVisible={() => onOpenChange(false)}
|
|
4711
|
-
// >
|
|
4712
|
-
// {PopupWrapper}
|
|
4713
|
-
// </LeadGenLightBoxB>
|
|
4714
|
-
React__default.createElement(DrawerComponent, { fadeFromIndex: ZINDEX_SSO - 9e6, open: open, snapPoints: [0.8, 1], activeSnapPoint: snap, setActiveSnapPoint: setSnap, onOpenChange: onOpenChange, overlayClassName: popupContainerClassName, className: "leadgen-drawer" },
|
|
5063
|
+
const PopupContainer = isDrawer ? (isNewUI ? (React__default.createElement(LeadGenLightBoxB, { form: form, loading: isSubmitLoading, visible: open, onVisible: () => onOpenChange(false) }, PopupWrapper)) : (React__default.createElement(DrawerComponent, { fadeFromIndex: ZINDEX_SSO - 9e6, open: open, snapPoints: [0.8, 1], activeSnapPoint: snap, setActiveSnapPoint: setSnap, onOpenChange: onOpenChange, overlayClassName: popupContainerClassName, className: "leadgen-drawer" },
|
|
4715
5064
|
PopupWrapper,
|
|
4716
|
-
React__default.createElement("div", { style: {
|
|
5065
|
+
React__default.createElement("div", { style: {
|
|
5066
|
+
position: 'absolute',
|
|
5067
|
+
inset: 0,
|
|
5068
|
+
zIndex: snap === 1 ? -1 : 1,
|
|
5069
|
+
}, onClick: () => setSnap(1) })))) : (React__default.createElement("div", { id: popupId, "data-popup-url": currentPath, "data-popup-type": "lightbox-inline", className: popupContainerClassName, style: isMobile ? { maxHeight: height } : undefined },
|
|
4717
5070
|
isFullscreen ? (React__default.createElement("img", { className: "le-only-desktop le-fullscreen-img", draggable: false, src: imageBackground || '', style: {
|
|
4718
5071
|
aspectRatio: `${imageBackgroundWidth}/${imageBackgroundHeight}`,
|
|
4719
5072
|
} })) : null,
|
|
@@ -4820,7 +5173,7 @@ function getCategoryLevel(t = 'Xin chao {{category_2}} extra') {
|
|
|
4820
5173
|
return null;
|
|
4821
5174
|
}
|
|
4822
5175
|
}
|
|
4823
|
-
const NewLeadPopup = ({ campaign, action, onSubmit, onClose, showThankyou, locale, showEmpty, setShowEmpty, userInfo, }) => {
|
|
5176
|
+
const NewLeadPopup = ({ campaign, action, onSubmit, onClose, onUnmount, showThankyou, locale, showEmpty, setShowEmpty, userInfo, }) => {
|
|
4824
5177
|
var _a, _b;
|
|
4825
5178
|
const { apiUrl, siteDomain } = useContext(LeadGenContext$1);
|
|
4826
5179
|
useEffect(() => {
|
|
@@ -4939,7 +5292,7 @@ const NewLeadPopup = ({ campaign, action, onSubmit, onClose, showThankyou, local
|
|
|
4939
5292
|
currentLayout == 'Fullscreen' ||
|
|
4940
5293
|
currentLayout == 'Sidebar' ||
|
|
4941
5294
|
currentLayout == 'Slider') {
|
|
4942
|
-
return (React__default.createElement(LightboxLayout, { popupId: popupIdRef.current, extraFields: extra_fields, onClose: onClose, onOtherSubmit: onOtherSubmit, imageMobile: image, imageDesktop: image_desktop, imageBackground: image_background, currentLayout: currentLayout, title: titleText, onSubmit: (
|
|
5295
|
+
return (React__default.createElement(LightboxLayout, { popupId: popupIdRef.current, extraFields: extra_fields, onClose: onClose, onOtherSubmit: onOtherSubmit, onUnmount: onUnmount, imageMobile: image, imageDesktop: image_desktop, imageBackground: image_background, currentLayout: currentLayout, title: titleText, onSubmit: (params) => onSubmit(params, categoryLevel, categoryData), key: currentLayout, imageOverlayDesktop: image_overlay_desktop, imageOverlayMobile: image_overlay_mobile, showThankyou: showThankyou, campaignId: campaign.id, campaignCode: campaign.code, campaign_subot_id: campaign.bot_id || [], locale: locale, showEmpty: showEmpty, setShowEmpty: setShowEmpty, userInfo: userInfo }));
|
|
4943
5296
|
}
|
|
4944
5297
|
else if (currentLayout.includes('Skin')) {
|
|
4945
5298
|
return (React__default.createElement(SkinLayout, { popupId: popupIdRef.current, link: actionBlocks.linkButtonBlock.data.url, linkNewTab: !!actionBlocks.linkButtonBlock.data.newtab, linkText: actionBlocks.linkButtonBlock.data.value, onClose: onClose, onOtherSubmit: onOtherSubmit, imageMobile: image, imageDesktop: image_desktop, currentLayout: currentLayout }));
|
|
@@ -4947,9 +5300,84 @@ const NewLeadPopup = ({ campaign, action, onSubmit, onClose, showThankyou, local
|
|
|
4947
5300
|
return null;
|
|
4948
5301
|
};
|
|
4949
5302
|
|
|
5303
|
+
const numberFormatType = 2; // i18n.phonenumbers.PhoneNumberFormat.NATIONAL
|
|
5304
|
+
const formatFormData = (currentForm, formData) => {
|
|
5305
|
+
return Object.keys(formData)
|
|
5306
|
+
.filter((key) => !!formData[key])
|
|
5307
|
+
.map((name) => {
|
|
5308
|
+
var _a, _b, _c, _d;
|
|
5309
|
+
const value = String(formData[name]);
|
|
5310
|
+
const control = ((_a = currentForm
|
|
5311
|
+
.querySelector(`*[name="${name}"][data-control]`)) === null || _a === void 0 ? void 0 : _a.getAttribute('data-control')) ||
|
|
5312
|
+
((_b = currentForm
|
|
5313
|
+
.querySelector(`*[data-extra][data-name="${name}"]`)) === null || _b === void 0 ? void 0 : _b.getAttribute('data-control')) ||
|
|
5314
|
+
'text';
|
|
5315
|
+
const leadControl = ((_c = currentForm
|
|
5316
|
+
.querySelector(`*[name="${name}"][data-lead-control]`)) === null || _c === void 0 ? void 0 : _c.getAttribute('data-lead-control')) ||
|
|
5317
|
+
((_d = currentForm
|
|
5318
|
+
.querySelector(`*[data-extra][data-name="${name}"]`)) === null || _d === void 0 ? void 0 : _d.getAttribute('data-lead-control')) ||
|
|
5319
|
+
'text';
|
|
5320
|
+
const formatedValue = control === 'tel'
|
|
5321
|
+
? window.intlTelInputUtils
|
|
5322
|
+
.formatNumber(String(value), LEAD_LOCALE === null || LEAD_LOCALE === void 0 ? void 0 : LEAD_LOCALE.countryCodeNumber, numberFormatType)
|
|
5323
|
+
.replace(/\s+/g, '')
|
|
5324
|
+
: control === 'date'
|
|
5325
|
+
? dayjs(value).format('YYYY-MM-DD')
|
|
5326
|
+
: value;
|
|
5327
|
+
return {
|
|
5328
|
+
key: name,
|
|
5329
|
+
value: formatedValue,
|
|
5330
|
+
control,
|
|
5331
|
+
leadControl,
|
|
5332
|
+
// is_sent_mailchimp: currentForm.querySelector(
|
|
5333
|
+
// `div[data-name="${i.name}-mailchimp"]`,
|
|
5334
|
+
// )
|
|
5335
|
+
// ? 'true'
|
|
5336
|
+
// : 'false',
|
|
5337
|
+
};
|
|
5338
|
+
});
|
|
5339
|
+
};
|
|
5340
|
+
|
|
5341
|
+
const formatTrackingData = (params) => {
|
|
5342
|
+
const { formParams = {}, currentLayout, commonData } = params;
|
|
5343
|
+
const { formValues, formActiveTime, listBlockAdded } = formParams;
|
|
5344
|
+
const listFieldHasValue = [];
|
|
5345
|
+
const data = Object.assign(Object.assign({ template_type: currentLayout, time_on_form: [LEADGEN_LAYOUT.LightBoxA, LEADGEN_LAYOUT.LightBoxB].includes(currentLayout)
|
|
5346
|
+
? formActiveTime
|
|
5347
|
+
: 0 }, commonData), { data_input: formValues
|
|
5348
|
+
.map((control) => {
|
|
5349
|
+
const findIndex = listBlockAdded.findIndex((i) => {
|
|
5350
|
+
const compareVal = control.key.startsWith('TNC-')
|
|
5351
|
+
? `TNC-${i.id}`
|
|
5352
|
+
: i.data.value;
|
|
5353
|
+
return compareVal == control.key;
|
|
5354
|
+
});
|
|
5355
|
+
if (findIndex > -1) {
|
|
5356
|
+
const curLeadControl = listBlockAdded[findIndex].name;
|
|
5357
|
+
listFieldHasValue.push(listBlockAdded[findIndex].data.value);
|
|
5358
|
+
return {
|
|
5359
|
+
field_name: control.key,
|
|
5360
|
+
component_type: curLeadControl,
|
|
5361
|
+
value: control.value,
|
|
5362
|
+
};
|
|
5363
|
+
}
|
|
5364
|
+
})
|
|
5365
|
+
.filter(Boolean), data_not_input: listBlockAdded
|
|
5366
|
+
.map((item) => {
|
|
5367
|
+
if (!listFieldHasValue.includes(item.data.value)) {
|
|
5368
|
+
return {
|
|
5369
|
+
field_name: item.data.value,
|
|
5370
|
+
component_type: item.name,
|
|
5371
|
+
};
|
|
5372
|
+
}
|
|
5373
|
+
})
|
|
5374
|
+
.filter(Boolean) });
|
|
5375
|
+
return data;
|
|
5376
|
+
};
|
|
5377
|
+
|
|
4950
5378
|
// mount css
|
|
4951
5379
|
const _LeadGen = ({ apiUrl: apiUrlProp, siteDomain, siteId, locale, primaryColor, apiSubotUrl, DEBUG_URL, forceCampaign, children, extraPayloadValues = [], excludeExitRulesHandler, userInfo, onClose: onCloseProps, onSubmit: onSubmitProps, }) => {
|
|
4952
|
-
var _a;
|
|
5380
|
+
var _a, _b;
|
|
4953
5381
|
const scrollEventHandlerRef = useRef();
|
|
4954
5382
|
const leadStartTimeRef = useRef(Date.now());
|
|
4955
5383
|
const { apiUrl } = useMemo(() => {
|
|
@@ -4965,6 +5393,7 @@ const _LeadGen = ({ apiUrl: apiUrlProp, siteDomain, siteId, locale, primaryColor
|
|
|
4965
5393
|
const [action, setAction] = useState('');
|
|
4966
5394
|
const [showThankyou, setShowThankyou] = useState(null);
|
|
4967
5395
|
const [showEmpty, setShowEmpty] = useState(false);
|
|
5396
|
+
const currentLayout = useMemo(() => showCampaign === null || showCampaign === void 0 ? void 0 : showCampaign.extra_fields.currentLayout, [showCampaign === null || showCampaign === void 0 ? void 0 : showCampaign.extra_fields.currentLayout]);
|
|
4968
5397
|
useEffect(() => {
|
|
4969
5398
|
if (forceCampaign) {
|
|
4970
5399
|
setShowCampaign(forceCampaign);
|
|
@@ -4987,14 +5416,15 @@ const _LeadGen = ({ apiUrl: apiUrlProp, siteDomain, siteId, locale, primaryColor
|
|
|
4987
5416
|
setAction('HIDE');
|
|
4988
5417
|
onCloseProps === null || onCloseProps === void 0 ? void 0 : onCloseProps();
|
|
4989
5418
|
};
|
|
4990
|
-
const onClose = () => {
|
|
4991
|
-
var
|
|
5419
|
+
const onClose = (params) => __awaiter(void 0, void 0, void 0, function* () {
|
|
5420
|
+
var _c, _d;
|
|
5421
|
+
const { formRef, listBlockAdded: listBlockAddedProp = [], formValues: formDataObj, } = params || {};
|
|
4992
5422
|
if (!showCampaign)
|
|
4993
5423
|
return;
|
|
4994
5424
|
LeadLog(`👋👋👋 CLOSE POPUP ${showCampaign.code} 👋👋👋`);
|
|
4995
5425
|
if (!excludeExitRulesHandler) {
|
|
4996
|
-
const showAfterExit = Number((
|
|
4997
|
-
const expiresDay = Number((
|
|
5426
|
+
const showAfterExit = Number((_c = showCampaign.rules.find((rule) => rule.rule == 'show_again_after_exit')) === null || _c === void 0 ? void 0 : _c.value);
|
|
5427
|
+
const expiresDay = Number((_d = showCampaign.rules.find((rule) => rule.rule == 'days_to_show_again')) === null || _d === void 0 ? void 0 : _d.value);
|
|
4998
5428
|
if (showAfterExit == 0) {
|
|
4999
5429
|
if (!expiresDay) {
|
|
5000
5430
|
setCookie(`lead_closed_${showCampaign.code}`, `target_${showCampaign === null || showCampaign === void 0 ? void 0 : showCampaign.extra_fields.popupVersion}`, { domain: '.' + siteDomain, path: '/' });
|
|
@@ -5004,21 +5434,61 @@ const _LeadGen = ({ apiUrl: apiUrlProp, siteDomain, siteId, locale, primaryColor
|
|
|
5004
5434
|
}
|
|
5005
5435
|
}
|
|
5006
5436
|
}
|
|
5007
|
-
|
|
5008
|
-
|
|
5009
|
-
|
|
5010
|
-
|
|
5011
|
-
|
|
5012
|
-
|
|
5013
|
-
|
|
5014
|
-
|
|
5015
|
-
|
|
5016
|
-
|
|
5017
|
-
|
|
5437
|
+
const listBlockAdded = listBlockAddedProp.filter((i) => i.name !== 'LinkButtonBlock');
|
|
5438
|
+
yield Promise.all([
|
|
5439
|
+
fetch(`${apiUrl}api/campaign/${showCampaign.code}/popup_exit`, {
|
|
5440
|
+
method: 'POST',
|
|
5441
|
+
headers: {
|
|
5442
|
+
'Content-Type': 'application/json',
|
|
5443
|
+
},
|
|
5444
|
+
body: JSON.stringify({
|
|
5445
|
+
action: 'CLICK',
|
|
5446
|
+
url: location.href.toLowerCase(),
|
|
5447
|
+
title_article: document.title,
|
|
5448
|
+
cookie_id: getCookie('hhg-id'),
|
|
5449
|
+
duration: Math.ceil((Date.now() - leadStartTimeRef.current) / 1000),
|
|
5450
|
+
}),
|
|
5018
5451
|
}),
|
|
5019
|
-
|
|
5452
|
+
!showThankyou &&
|
|
5453
|
+
listBlockAdded.length > 0 &&
|
|
5454
|
+
trackingCompletionForm({
|
|
5455
|
+
commonData: {
|
|
5456
|
+
cookie_id: getCookie('hhg-id'),
|
|
5457
|
+
ga_client_id: getCookie('_ga') || null,
|
|
5458
|
+
country_code: locale ? MAPPED_LOCALE[locale] || 'VN' : 'VN',
|
|
5459
|
+
status: 'in_progress',
|
|
5460
|
+
campaign_id: showCampaign === null || showCampaign === void 0 ? void 0 : showCampaign.id,
|
|
5461
|
+
total_fields: listBlockAdded.length,
|
|
5462
|
+
},
|
|
5463
|
+
currentLayout,
|
|
5464
|
+
formParams: Object.assign(Object.assign({}, params), { listBlockAdded, formValues: formatFormData(formRef, formDataObj) }),
|
|
5465
|
+
}),
|
|
5466
|
+
]);
|
|
5020
5467
|
onCloseBase();
|
|
5021
|
-
};
|
|
5468
|
+
});
|
|
5469
|
+
const onUnmount = (params) => __awaiter(void 0, void 0, void 0, function* () {
|
|
5470
|
+
const { formRef, listBlockAdded: listBlockAddedProp = [], formValues: formDataObj, } = params || {};
|
|
5471
|
+
const listBlockAdded = listBlockAddedProp.filter((i) => i.name !== 'LinkButtonBlock');
|
|
5472
|
+
if (listBlockAdded.length === 0)
|
|
5473
|
+
return;
|
|
5474
|
+
if ([LEADGEN_LAYOUT.InlineA, LEADGEN_LAYOUT.InlineB].includes(currentLayout) &&
|
|
5475
|
+
Object.keys(formDataObj).length === 0)
|
|
5476
|
+
return;
|
|
5477
|
+
const data = formatTrackingData({
|
|
5478
|
+
commonData: {
|
|
5479
|
+
cookie_id: getCookie('hhg-id'),
|
|
5480
|
+
ga_client_id: getCookie('_ga') || null,
|
|
5481
|
+
country_code: locale ? MAPPED_LOCALE[locale] || 'VN' : 'VN',
|
|
5482
|
+
status: 'in_progress',
|
|
5483
|
+
campaign_id: showCampaign === null || showCampaign === void 0 ? void 0 : showCampaign.id,
|
|
5484
|
+
total_fields: listBlockAdded.length,
|
|
5485
|
+
},
|
|
5486
|
+
currentLayout,
|
|
5487
|
+
formParams: Object.assign(Object.assign({}, params), { listBlockAdded, formValues: formatFormData(formRef, formDataObj) }),
|
|
5488
|
+
});
|
|
5489
|
+
const blob = new Blob([JSON.stringify(data)], { type: 'application/json' });
|
|
5490
|
+
navigator.sendBeacon(`${apiUrl}api/collection/tracking-completion`, blob);
|
|
5491
|
+
});
|
|
5022
5492
|
useEffect(() => {
|
|
5023
5493
|
if (forceCampaign === null || forceCampaign === void 0 ? void 0 : forceCampaign.code)
|
|
5024
5494
|
return;
|
|
@@ -5057,69 +5527,56 @@ const _LeadGen = ({ apiUrl: apiUrlProp, siteDomain, siteId, locale, primaryColor
|
|
|
5057
5527
|
DEBUG_URL,
|
|
5058
5528
|
});
|
|
5059
5529
|
}, []);
|
|
5060
|
-
const
|
|
5061
|
-
|
|
5530
|
+
const trackingCompletionForm = useCallback((params) => __awaiter(void 0, void 0, void 0, function* () {
|
|
5531
|
+
const { currentLayout, formParams } = params || {};
|
|
5532
|
+
const { formValues } = formParams;
|
|
5533
|
+
if ([LEADGEN_LAYOUT.InlineA, LEADGEN_LAYOUT.InlineB].includes(currentLayout) &&
|
|
5534
|
+
Object.keys(formValues).length === 0)
|
|
5535
|
+
return;
|
|
5536
|
+
const data = formatTrackingData(params);
|
|
5537
|
+
return fetch(`${apiUrl}api/collection/tracking-completion`, {
|
|
5538
|
+
method: 'POST',
|
|
5539
|
+
headers: {
|
|
5540
|
+
'Content-Type': 'application/json',
|
|
5541
|
+
},
|
|
5542
|
+
body: JSON.stringify(data),
|
|
5543
|
+
});
|
|
5544
|
+
}), [(_a = showCampaign === null || showCampaign === void 0 ? void 0 : showCampaign.extra_fields) === null || _a === void 0 ? void 0 : _a.currentLayout]);
|
|
5545
|
+
const onSubmit = (params, categoryLevel, categoryData) => __awaiter(void 0, void 0, void 0, function* () {
|
|
5546
|
+
var _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
5547
|
+
const { formRef, listBlockAdded: listBlockAddedProp = [], formValues: formDataObj, } = params || {};
|
|
5548
|
+
const listBlockAdded = listBlockAddedProp.filter((i) => i.name !== 'LinkButtonBlock');
|
|
5062
5549
|
if (!formDataObj || Object.values(formDataObj).every((v) => !Boolean(v))) {
|
|
5063
5550
|
setShowEmpty(true);
|
|
5064
5551
|
return;
|
|
5065
5552
|
}
|
|
5066
5553
|
LeadLog('submitHandler', categoryLevel, categoryData);
|
|
5067
|
-
const
|
|
5068
|
-
|
|
5069
|
-
|
|
5070
|
-
|
|
5071
|
-
|
|
5554
|
+
const formatedFormData = formatFormData(formRef, formDataObj);
|
|
5555
|
+
const formData = formatedFormData.map(({ key, value, control }) => ({
|
|
5556
|
+
key,
|
|
5557
|
+
value,
|
|
5558
|
+
control,
|
|
5072
5559
|
}));
|
|
5073
5560
|
console.log('** RYAN index.tsx 218 formData : ', formData);
|
|
5074
|
-
const numberFormatType = 2; // i18n.phonenumbers.PhoneNumberFormat.NATIONAL
|
|
5075
5561
|
// Get ga_client_id from cookies
|
|
5076
5562
|
const gaCookie = getCookie('_ga') || null;
|
|
5077
5563
|
if (!window.intlTelInputUtils) {
|
|
5078
5564
|
yield require('intl-tel-input/build/js/utils');
|
|
5079
5565
|
}
|
|
5080
|
-
const
|
|
5081
|
-
url: location.href.toLowerCase(),
|
|
5082
|
-
title_article: document.title,
|
|
5083
|
-
meta: [
|
|
5084
|
-
...formData.map((i) => {
|
|
5085
|
-
var _a, _b;
|
|
5086
|
-
const control = ((_a = currentForm
|
|
5087
|
-
.querySelector(`*[name="${i.name}"][data-control]`)) === null || _a === void 0 ? void 0 : _a.getAttribute('data-control')) ||
|
|
5088
|
-
((_b = currentForm
|
|
5089
|
-
.querySelector(`*[data-extra][data-name="${i.name}"]`)) === null || _b === void 0 ? void 0 : _b.getAttribute('data-control')) ||
|
|
5090
|
-
'text';
|
|
5091
|
-
const value = control === 'tel'
|
|
5092
|
-
? window.intlTelInputUtils
|
|
5093
|
-
.formatNumber(String(i.value), LEAD_LOCALE === null || LEAD_LOCALE === void 0 ? void 0 : LEAD_LOCALE.countryCodeNumber, numberFormatType)
|
|
5094
|
-
.replace(/\s+/g, '')
|
|
5095
|
-
: control === 'date'
|
|
5096
|
-
? dayjs(i.value).format('YYYY-MM-DD')
|
|
5097
|
-
: i.value;
|
|
5098
|
-
return {
|
|
5099
|
-
key: i.name,
|
|
5100
|
-
value,
|
|
5101
|
-
control,
|
|
5102
|
-
// is_sent_mailchimp: currentForm.querySelector(
|
|
5103
|
-
// `div[data-name="${i.name}-mailchimp"]`,
|
|
5104
|
-
// )
|
|
5105
|
-
// ? 'true'
|
|
5106
|
-
// : 'false',
|
|
5107
|
-
};
|
|
5108
|
-
}),
|
|
5109
|
-
...extraPayloadValues,
|
|
5110
|
-
],
|
|
5566
|
+
const commonData = {
|
|
5111
5567
|
cookie_id: getCookie('hhg-id'),
|
|
5112
5568
|
ga_client_id: gaCookie,
|
|
5113
5569
|
};
|
|
5570
|
+
const data = Object.assign({ url: location.href.toLowerCase(), title_article: document.title, meta: [...formData, ...extraPayloadValues] }, commonData);
|
|
5114
5571
|
// categoryLevel
|
|
5115
5572
|
if (categoryLevel) {
|
|
5116
5573
|
if (categoryData[categoryLevel].value_en) {
|
|
5117
5574
|
data['category'] = categoryData[categoryLevel].value_en;
|
|
5118
5575
|
}
|
|
5119
5576
|
}
|
|
5120
|
-
const expiresDay = Number(((
|
|
5577
|
+
const expiresDay = Number(((_f = (_e = showCampaign.rules) === null || _e === void 0 ? void 0 : _e.find((r) => r.rule === 'days_to_show_again')) === null || _f === void 0 ? void 0 : _f.value) ||
|
|
5121
5578
|
7);
|
|
5122
|
-
const showAgain = Number(((
|
|
5579
|
+
const showAgain = Number(((_h = (_g = showCampaign.rules) === null || _g === void 0 ? void 0 : _g.find((r) => r.rule === 'show_again_after_submit')) === null || _h === void 0 ? void 0 : _h.value) || 0);
|
|
5123
5580
|
if (showAgain == 0) {
|
|
5124
5581
|
LeadLog('⛔ Popup never show again!');
|
|
5125
5582
|
setCookie(`lead_submited_${showCampaign.code}`, `target_${showCampaign === null || showCampaign === void 0 ? void 0 : showCampaign.extra_fields.targetType}`, { domain: '.' + siteDomain, path: '/' });
|
|
@@ -5128,13 +5585,21 @@ const _LeadGen = ({ apiUrl: apiUrlProp, siteDomain, siteId, locale, primaryColor
|
|
|
5128
5585
|
LeadLog(`⌛ Popup will show again after ${expiresDay} days!`);
|
|
5129
5586
|
setCookie(`lead_submited_${showCampaign.code}`, `target_${showCampaign === null || showCampaign === void 0 ? void 0 : showCampaign.extra_fields.targetType}`, { domain: '.' + siteDomain, days: expiresDay, path: '/' });
|
|
5130
5587
|
}
|
|
5131
|
-
|
|
5132
|
-
|
|
5133
|
-
|
|
5134
|
-
|
|
5135
|
-
|
|
5136
|
-
|
|
5137
|
-
|
|
5588
|
+
yield Promise.all([
|
|
5589
|
+
fetch(`${apiUrl}api/campaign/${showCampaign.code}/lead`, {
|
|
5590
|
+
method: 'POST',
|
|
5591
|
+
headers: {
|
|
5592
|
+
'Content-Type': 'application/json',
|
|
5593
|
+
},
|
|
5594
|
+
body: JSON.stringify(data),
|
|
5595
|
+
}),
|
|
5596
|
+
listBlockAdded.length > 0 &&
|
|
5597
|
+
trackingCompletionForm({
|
|
5598
|
+
commonData: Object.assign(Object.assign({}, commonData), { country_code: locale ? MAPPED_LOCALE[locale] || 'VN' : 'VN', status: 'complete', campaign_id: showCampaign === null || showCampaign === void 0 ? void 0 : showCampaign.id, total_fields: listBlockAdded.length }),
|
|
5599
|
+
currentLayout,
|
|
5600
|
+
formParams: Object.assign(Object.assign({}, params), { listBlockAdded, formValues: formatedFormData }),
|
|
5601
|
+
}),
|
|
5602
|
+
]);
|
|
5138
5603
|
onSubmitProps === null || onSubmitProps === void 0 ? void 0 : onSubmitProps(formDataObj);
|
|
5139
5604
|
if ((showCampaign === null || showCampaign === void 0 ? void 0 : showCampaign.extra_fields.popupShowThankYou) == 'notshow') {
|
|
5140
5605
|
onClose();
|
|
@@ -5153,15 +5618,15 @@ const _LeadGen = ({ apiUrl: apiUrlProp, siteDomain, siteId, locale, primaryColor
|
|
|
5153
5618
|
const titleBlock = listBlockThankyou.find((i) => i.name == 'TitleBlock');
|
|
5154
5619
|
const subtitleBlock = listBlockThankyou.find((i) => i.name == 'SubtitleBlock');
|
|
5155
5620
|
const linkButtonBlock = listBlockThankyou.find((i) => i.name == 'LinkButtonBlock');
|
|
5156
|
-
thankTitle = ((
|
|
5157
|
-
titleAlign = ((
|
|
5158
|
-
thankDesc = ((
|
|
5159
|
-
descAlign = ((
|
|
5160
|
-
linkText = ((
|
|
5161
|
-
linkNewTab = ((
|
|
5162
|
-
linkUrl = ((
|
|
5621
|
+
thankTitle = ((_j = titleBlock === null || titleBlock === void 0 ? void 0 : titleBlock.data) === null || _j === void 0 ? void 0 : _j.value) || '';
|
|
5622
|
+
titleAlign = ((_k = titleBlock === null || titleBlock === void 0 ? void 0 : titleBlock.data) === null || _k === void 0 ? void 0 : _k.align) || '';
|
|
5623
|
+
thankDesc = ((_l = subtitleBlock === null || subtitleBlock === void 0 ? void 0 : subtitleBlock.data) === null || _l === void 0 ? void 0 : _l.value) || '';
|
|
5624
|
+
descAlign = ((_m = subtitleBlock === null || subtitleBlock === void 0 ? void 0 : subtitleBlock.data) === null || _m === void 0 ? void 0 : _m.align) || '';
|
|
5625
|
+
linkText = ((_o = linkButtonBlock === null || linkButtonBlock === void 0 ? void 0 : linkButtonBlock.data) === null || _o === void 0 ? void 0 : _o.value) || '';
|
|
5626
|
+
linkNewTab = ((_p = linkButtonBlock === null || linkButtonBlock === void 0 ? void 0 : linkButtonBlock.data) === null || _p === void 0 ? void 0 : _p.newtab) || false;
|
|
5627
|
+
linkUrl = ((_q = linkButtonBlock === null || linkButtonBlock === void 0 ? void 0 : linkButtonBlock.data) === null || _q === void 0 ? void 0 : _q.url) || '';
|
|
5163
5628
|
// ALWAYS SHOW THANK YOU ON COMPOUND COMP
|
|
5164
|
-
// const curLayout =
|
|
5629
|
+
// const curLayout = currentLayout
|
|
5165
5630
|
// TODO: newbuilder thank you
|
|
5166
5631
|
// List layout not show thanks you
|
|
5167
5632
|
// if (
|
|
@@ -5200,7 +5665,7 @@ const _LeadGen = ({ apiUrl: apiUrlProp, siteDomain, siteId, locale, primaryColor
|
|
|
5200
5665
|
}
|
|
5201
5666
|
// Submit Inisder Obj
|
|
5202
5667
|
formData.map((data) => {
|
|
5203
|
-
const name = data.
|
|
5668
|
+
const name = data.key;
|
|
5204
5669
|
const value = data.value;
|
|
5205
5670
|
if (name == 'tel') {
|
|
5206
5671
|
window.insider_object.user.phone_number = value;
|
|
@@ -5218,16 +5683,22 @@ const _LeadGen = ({ apiUrl: apiUrlProp, siteDomain, siteId, locale, primaryColor
|
|
|
5218
5683
|
leadStartTimeRef.current = Date.now();
|
|
5219
5684
|
}
|
|
5220
5685
|
}, [showCampaign]);
|
|
5221
|
-
return (React__default.createElement(LeadGenContext$1.Provider, { value: {
|
|
5686
|
+
return (React__default.createElement(LeadGenContext$1.Provider, { value: {
|
|
5687
|
+
primaryColor,
|
|
5688
|
+
apiUrl,
|
|
5689
|
+
siteDomain,
|
|
5690
|
+
siteId,
|
|
5691
|
+
locale,
|
|
5692
|
+
} },
|
|
5222
5693
|
React__default.createElement(TranslationsContext.Provider, { value: { locale, values: getTranslations(locale) } }, children ? (React__default.createElement(Component, { campaign: showCampaign, onSubmit: onSubmit, onClose: onClose, showThankyou: showThankyou, setShowThankyou: setShowThankyou, locale: locale, showEmpty: showEmpty, setShowEmpty: setShowEmpty, userInfo: userInfo }, children)) : (React__default.createElement(Portal, { target: getPopupWrapperDom() },
|
|
5223
5694
|
React__default.createElement(Box, { sx: { position: 'fixed', zIndex: ZINDEX_SSO - 9e6 } },
|
|
5224
|
-
React__default.createElement(Transition, { mounted: Boolean(((
|
|
5695
|
+
React__default.createElement(Transition, { mounted: Boolean(((_b = showCampaign === null || showCampaign === void 0 ? void 0 : showCampaign.extra_fields) === null || _b === void 0 ? void 0 : _b.popupVersion) === '2.1'), transition: "fade", duration: 600, timingFunction: "ease", exitDuration: 200 }, (styles) => {
|
|
5225
5696
|
var _a;
|
|
5226
5697
|
return (React__default.createElement(Box, { style: styles }, ((_a = showCampaign === null || showCampaign === void 0 ? void 0 : showCampaign.extra_fields) === null || _a === void 0 ? void 0 : _a.popupVersion) === '2.1' && (React__default.createElement(React__default.Fragment, null,
|
|
5227
|
-
!!
|
|
5228
|
-
!
|
|
5229
|
-
!
|
|
5230
|
-
React__default.createElement(NewLeadPopup, { campaign: showCampaign, action: action, onSubmit: onSubmit, onClose: onClose, showThankyou: showThankyou, locale: locale, showEmpty: showEmpty, setShowEmpty: setShowEmpty, userInfo: userInfo })))));
|
|
5698
|
+
!!currentLayout &&
|
|
5699
|
+
!currentLayout.includes('Inline') &&
|
|
5700
|
+
!currentLayout.includes('Sidebar') && (React__default.createElement(Overlay, { color: "#000", opacity: 0.6, center: true, zIndex: 400, pos: 'fixed', onClick: () => onClose() })),
|
|
5701
|
+
React__default.createElement(NewLeadPopup, { campaign: showCampaign, action: action, onSubmit: onSubmit, onClose: onClose, onUnmount: onUnmount, showThankyou: showThankyou, locale: locale, showEmpty: showEmpty, setShowEmpty: setShowEmpty, userInfo: userInfo })))));
|
|
5231
5702
|
})))))));
|
|
5232
5703
|
};
|
|
5233
5704
|
const LeadGen = _LeadGen;
|