@hhgtech/hhg-components 1.29.110 → 1.29.111
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/Google-9a9770c8.js +38 -0
- package/build/{LastPeriod-9964beff.js → LastPeriod-d16c1ea8.js} +1 -1
- package/build/{MobileBottomNavigationIcon-47d13939.js → MobileBottomNavigationIcon-d0bc3fac.js} +3 -3
- package/build/{Spinner-3cfb77fb.js → Spinner-8a698498.js} +1 -1
- package/build/{WhatsApp-d804a21a.js → WhatsApp-f783bf8f.js} +1 -1
- package/build/adapters.js +18 -18
- package/build/atoms.js +45 -45
- package/build/babyGrowth.js +82 -82
- 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.js +88 -88
- package/build/{constants-b6a27170.js → constants-bda3fd86.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-f7393a4d.js → core-cba930f7.js} +1 -1
- package/build/{dataTransform-a9aa9e94.js → dataTransform-837b8411.js} +1 -1
- package/build/ecom.js +4 -4
- package/build/{editor-44ca788c.js → editor-42ef0b82.js} +11 -11
- package/build/embeddedHeathToolCards_babyGrowth.js +22 -22
- package/build/embeddedHeathToolCards_babyPoop.js +18 -18
- package/build/embeddedHeathToolCards_babyVaccine.js +21 -21
- package/build/embeddedHeathToolCards_bmi_bmi.js +25 -25
- package/build/embeddedHeathToolCards_bmrBmr.js +25 -25
- package/build/embeddedHeathToolCards_dueDate_dueDate.js +21 -21
- package/build/embeddedHeathToolCards_ovulation_ovulation.js +21 -21
- package/build/embeddedHeathToolCards_pwg_pwg.js +26 -26
- package/build/embeddedHeathToolCards_targetHeartRate.js +27 -27
- package/build/esm/Google-844b3694.js +15 -0
- package/build/esm/{LastPeriod-94d47b13.js → LastPeriod-6a71dddc.js} +1 -1
- package/build/esm/{MobileBottomNavigationIcon-5a2f9cda.js → MobileBottomNavigationIcon-3cfa4b14.js} +3 -3
- package/build/esm/{Spinner-adc15177.js → Spinner-5a0df635.js} +1 -1
- package/build/esm/{WhatsApp-72259ef3.js → WhatsApp-def7f0e9.js} +1 -1
- package/build/esm/adapters.js +18 -18
- package/build/esm/atoms.js +45 -45
- package/build/esm/babyGrowth.js +82 -82
- 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.js +88 -88
- package/build/esm/{constants-62165820.js → constants-03f8dbae.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-d6efb3c7.js → core-e8e5bd42.js} +1 -1
- package/build/esm/{dataTransform-0a6dc377.js → dataTransform-6d013343.js} +1 -1
- package/build/esm/ecom.js +4 -4
- package/build/esm/{editor-9349fc79.js → editor-99f55a70.js} +11 -11
- package/build/esm/embeddedHeathToolCards_babyGrowth.js +22 -22
- package/build/esm/embeddedHeathToolCards_babyPoop.js +18 -18
- package/build/esm/embeddedHeathToolCards_babyVaccine.js +21 -21
- package/build/esm/embeddedHeathToolCards_bmi_bmi.js +25 -25
- package/build/esm/embeddedHeathToolCards_bmrBmr.js +25 -25
- package/build/esm/embeddedHeathToolCards_dueDate_dueDate.js +21 -21
- package/build/esm/embeddedHeathToolCards_ovulation_ovulation.js +21 -21
- package/build/esm/embeddedHeathToolCards_pwg_pwg.js +26 -26
- package/build/esm/embeddedHeathToolCards_targetHeartRate.js +27 -27
- package/build/esm/{fixedBottomAdBlock-f4baa787.js → fixedBottomAdBlock-a2106963.js} +22 -22
- package/build/esm/footer.js +20 -20
- package/build/esm/gAssets.js +2 -2
- package/build/esm/healthToolsCardWrapper.js +17 -17
- package/build/esm/healthToolsForm.js +33 -33
- package/build/esm/hooks.js +14 -14
- package/build/esm/i18n.js +2 -2
- package/build/esm/i18nV2.js +2 -2
- package/build/esm/{index-33bb2e7a.js → index-02336dba.js} +1 -1
- package/build/esm/{index-3e3fcf95.js → index-0251091e.js} +2 -2
- package/build/esm/{index-5221ae6b.js → index-061cf8ff.js} +11 -11
- package/build/esm/{index-16c22540.js → index-072a4c0b.js} +2 -2
- package/build/esm/{index-89f80018.js → index-1a32ef86.js} +14 -14
- package/build/esm/{index-a807d223.js → index-1dd59b40.js} +16 -16
- package/build/esm/{index-aa32f4d3.js → index-20e6a915.js} +23 -23
- package/build/esm/{index-8064c18c.js → index-2381e9de.js} +6 -6
- package/build/esm/{index-15fa6e53.js → index-2542c25d.js} +1 -1
- package/build/esm/{index-53b37308.js → index-29c78f77.js} +15 -15
- package/build/esm/{index-c2025e5d.js → index-2a6c5203.js} +12 -12
- package/build/esm/{index-c072844e.js → index-30ca84b5.js} +2 -2
- package/build/esm/{index-2448ba80.js → index-316277f8.js} +3 -3
- package/build/esm/{index-cf2e8195.js → index-38efcc39.js} +2 -2
- package/build/esm/{index-3d5d1e1b.js → index-3d912153.js} +14 -14
- package/build/esm/{index-43b726db.js → index-3fd32195.js} +2 -2
- package/build/esm/{index-aa9360c8.js → index-4bb6e69a.js} +4 -4
- package/build/esm/{index-56a79323.js → index-5a54ed9b.js} +3 -3
- package/build/esm/{index-b7f5af36.js → index-6e166286.js} +13 -13
- package/build/esm/{index-5ded1850.js → index-83a8eee7.js} +15 -15
- package/build/esm/{index-2af5a80e.js → index-87acd8f7.js} +18 -18
- package/build/esm/{index-35c7265c.js → index-8af36482.js} +3 -3
- package/build/esm/{index-50eafe3e.js → index-8b5cf2b7.js} +12 -12
- package/build/esm/{index-e6dcd686.js → index-8d68eb39.js} +1 -1
- package/build/esm/{index-d942cc15.js → index-8e3e9da4.js} +5 -5
- package/build/esm/{index-e52421fc.js → index-918e70f4.js} +16 -16
- package/build/esm/{index-b9208015.js → index-9335ba57.js} +15 -15
- package/build/esm/{index-6e7ee277.js → index-93df7701.js} +16 -16
- package/build/esm/{index-b7a5ae7c.js → index-96a59dd0.js} +6 -6
- package/build/esm/{index-bc9435ba.js → index-9a05ab79.js} +21 -21
- package/build/esm/{index-d46a2e09.js → index-a1ac4405.js} +1 -1
- package/build/esm/{index-8f6f01e4.js → index-a2b7c2e7.js} +19 -19
- package/build/esm/{index-235e6ff6.js → index-a4e0d76f.js} +1 -1
- package/build/esm/{index-0fde3c88.js → index-a8815b22.js} +31 -31
- package/build/esm/{index-cbf33f76.js → index-ad747da0.js} +2 -2
- package/build/esm/{index-8cfb8ffd.js → index-c94cfc7d.js} +2 -2
- package/build/esm/{index-d46bc097.js → index-cad3f20c.js} +12 -12
- package/build/esm/{index-16cca3e0.js → index-cb04f4e0.js} +3 -3
- package/build/esm/{index-d6ba0b97.js → index-cb235b95.js} +3 -3
- package/build/esm/{index-7f2d389c.js → index-d1b85eee.js} +1 -1
- package/build/esm/{index-58449963.js → index-d6d45316.js} +7 -7
- package/build/esm/{index-32ef64f3.js → index-d9197263.js} +2 -2
- package/build/esm/{index-0653c377.js → index-dbb54dad.js} +6 -6
- package/build/esm/{index-5c8ec94d.js → index-df82f273.js} +2 -2
- package/build/esm/{index-cdff6bde.js → index-e20c7cb4.js} +6 -6
- package/build/esm/{index-88d1e9fe.js → index-e43e6daf.js} +1 -1
- package/build/esm/{index-f67d0646.js → index-e45c2db8.js} +1 -1
- package/build/esm/{index-17fce332.js → index-e730899e.js} +17 -17
- package/build/esm/{index-a47dc117.js → index-e900f7fc.js} +5 -5
- package/build/esm/{index-37d07df3.js → index-ebc6c341.js} +12 -12
- package/build/esm/{index-5154a719.js → index-edf5db37.js} +14 -14
- package/build/esm/{index-a5d23469.js → index-f10f1fb8.js} +7 -7
- package/build/esm/{index-14d4175c.js → index-f2732541.js} +1 -1
- package/build/esm/{index-e0813672.js → index-f5bca47f.js} +2 -2
- package/build/esm/{index-ab3252bc.js → index-fc9567f0.js} +2 -2
- package/build/esm/{index-0ab47613.js → index-fdc3a02f.js} +20 -20
- package/build/esm/index.js +111 -122
- package/build/esm/{index.styles-87407526.js → index.styles-9ffb84a3.js} +1 -1
- package/build/esm/{labelSorting-f9f43706.js → labelSorting-e862f3cb.js} +4 -4
- package/build/esm/lead.js +22 -22
- package/build/esm/{logoIcon-acc01a57.js → logoIcon-34e8fa76.js} +2 -2
- package/build/esm/mantine.js +24 -24
- package/build/esm/misc.js +18 -18
- package/build/esm/miscGetDynamicHealthTool.js +5 -5
- 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 +67 -67
- package/build/esm/moleculesArticleCard.js +6 -6
- package/build/esm/moleculesArticleCardV2.js +15 -15
- package/build/esm/navigation.js +40 -40
- package/build/esm/navigationLogoutPopup.js +9 -9
- package/build/esm/navigationProfileButton.js +23 -23
- package/build/esm/onboardingV2.js +28 -28
- package/build/esm/organisms.js +44 -44
- package/build/esm/{post-e5559ad6.js → post-3e244908.js} +2 -2
- package/build/esm/profileNavigation.js +19 -19
- package/build/esm/progressBar.js +1 -1
- package/build/esm/pwg.js +21 -21
- package/build/esm/ssoV2.js +1622 -0
- package/build/esm/subot.js +30 -30
- package/build/esm/surveyOrPremiumBanner.js +29 -29
- package/build/esm/surveyQuestionCard.js +10 -10
- package/build/esm/{surveyThankyouCard-bcf08bf0.js → surveyThankyouCard-dda42736.js} +5 -5
- package/build/esm/together.js +50 -50
- 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 +40 -40
- package/build/esm/togetherMoleculesCardAuthor.js +24 -24
- package/build/esm/togetherMoleculesPostImagePreview.js +11 -11
- package/build/esm/togetherMoleculesProfileDetail.js +30 -30
- package/build/esm/togetherOrganisms.js +45 -45
- package/build/esm/togetherRichTextEditor.js +17 -17
- package/build/esm/togetherShareBox.js +10 -10
- package/build/esm/{treePopoverMenu-fbc40cab.js → treePopoverMenu-99ccaf15.js} +18 -18
- package/build/esm/{types-f7e921ce.js → types-943eb3cb.js} +2 -2
- package/build/esm/types.js +2 -2
- package/build/esm/{useCategory-e9c58e46.js → useCategory-032bef23.js} +5 -5
- package/build/esm/{useHealthToolCache-5dcdf1dd.js → useHealthToolCache-5bc2c18b.js} +1 -1
- package/build/esm/{useMantineLocale-e24e123a.js → useMantineLocale-8c5b5fc9.js} +5 -5
- package/build/esm/{usePlacesAutocomplete-c6b04bb5.js → usePlacesAutocomplete-8af8d9c4.js} +1 -1
- package/build/esm/useTogetherAuthRequiredAction.js +4 -4
- package/build/esm/{useTranslations-07b27d99.js → useTranslations-95c6883a.js} +1 -1
- package/build/esm/{utils-4e13c960.js → utils-073ebee6.js} +2 -2
- package/build/esm/{utils-36b96c58.js → utils-56de005f.js} +3 -3
- package/build/esm/{utils-017de61e.js → utils-62937217.js} +2 -2
- package/build/esm/vaccination.js +20 -20
- package/build/{fixedBottomAdBlock-40e013d6.js → fixedBottomAdBlock-4e2f014d.js} +22 -22
- package/build/footer.js +20 -20
- package/build/gAssets.js +2 -2
- package/build/healthToolsCardWrapper.js +17 -17
- package/build/healthToolsForm.js +33 -33
- package/build/hooks.js +14 -14
- package/build/i18n.js +1 -1
- package/build/i18nV2.js +1 -1
- package/build/{index-c0d6ff80.js → index-0b5356e5.js} +6 -6
- package/build/{index-95abe4d4.js → index-0c83d79d.js} +2 -2
- package/build/{index-8da9d74a.js → index-0e75a585.js} +2 -2
- package/build/{index-d7e780fe.js → index-14584b97.js} +15 -15
- package/build/{index-99282efe.js → index-1fcb5e5c.js} +14 -14
- package/build/{index-c63ea941.js → index-205dc16c.js} +3 -3
- package/build/{index-75bae308.js → index-24116842.js} +2 -2
- package/build/{index-9deaf0f8.js → index-2952c70d.js} +3 -3
- package/build/{index-747fed64.js → index-2aa7c4cd.js} +2 -2
- package/build/{index-e3b79653.js → index-2ac6a777.js} +3 -3
- package/build/{index-a6b6b993.js → index-2e7f9ae7.js} +12 -12
- package/build/{index-f5944a20.js → index-35f41022.js} +4 -4
- package/build/{index-7233bd6d.js → index-36227b55.js} +2 -2
- package/build/{index-049aece7.js → index-46743170.js} +19 -19
- package/build/{index-27bfcf07.js → index-4ec635ce.js} +1 -1
- package/build/{index-1ddced1b.js → index-50a7b410.js} +11 -11
- package/build/{index-b0472af7.js → index-545c39d3.js} +17 -17
- package/build/{index-e7e7b68c.js → index-55d4275e.js} +20 -20
- package/build/{index-2ce37ad2.js → index-570d9d4c.js} +16 -16
- package/build/{index-529f2cf6.js → index-581d8105.js} +6 -6
- package/build/{index-8ea79133.js → index-612701f6.js} +6 -6
- package/build/{index-13ad9534.js → index-65b72b18.js} +3 -3
- package/build/{index-40d370cc.js → index-67ffc70a.js} +1 -1
- package/build/{index-28e00c63.js → index-6bd20e17.js} +12 -12
- package/build/{index-03548c34.js → index-6c2f66f8.js} +1 -1
- package/build/{index-5c8dc1a3.js → index-74f169c4.js} +2 -2
- package/build/{index-b1794d6c.js → index-7e4b085c.js} +2 -2
- package/build/{index-28722db9.js → index-823c0f3c.js} +2 -2
- package/build/{index-986d4587.js → index-85bcdccc.js} +2 -2
- package/build/{index-f6c7b353.js → index-8a341a35.js} +1 -1
- package/build/{index-9244359b.js → index-8e570054.js} +12 -12
- package/build/{index-de3d8886.js → index-90dd5604.js} +31 -31
- package/build/{index-45fab631.js → index-9216c6ed.js} +1 -1
- package/build/{index-81bf5c98.js → index-96c1b956.js} +15 -15
- package/build/{index-5b08c63c.js → index-9b03e760.js} +7 -7
- package/build/{index-d84ef58d.js → index-9b2a6df6.js} +1 -1
- package/build/{index-4e709717.js → index-a5f1a090.js} +13 -12
- package/build/{index-6192f9c2.js → index-a79f2e3c.js} +16 -16
- package/build/{index-f5bb3a9d.js → index-a8647e95.js} +15 -15
- package/build/{index-742fa48b.js → index-ad655c42.js} +14 -14
- package/build/{index-21598eb4.js → index-b2519660.js} +2 -2
- package/build/{index-f24a8689.js → index-b47d6440.js} +1 -1
- package/build/{index-830cf23b.js → index-b96fc0d1.js} +12 -12
- package/build/{index-f77a5513.js → index-bbe2ebb5.js} +6 -6
- package/build/{index-a80275e1.js → index-c99871c5.js} +5 -5
- package/build/{index-b77008b4.js → index-cd40a719.js} +23 -23
- package/build/{index-a812f053.js → index-d585bec5.js} +16 -16
- package/build/{index-3d5a2af4.js → index-dd400977.js} +18 -18
- package/build/{index-45a2a666.js → index-ddf07c51.js} +21 -21
- package/build/{index-583288bc.js → index-e0c93d12.js} +1 -1
- package/build/{index-8adbdb4f.js → index-e19284e4.js} +7 -7
- package/build/{index-f3afbbb6.js → index-e435db02.js} +1 -1
- package/build/{index-13fbb425.js → index-e59269bb.js} +14 -14
- package/build/{index-61c24e51.js → index-e8ede7d9.js} +5 -5
- package/build/{index-19e4fddf.js → index-ed9e7ac3.js} +3 -3
- package/build/{index-e77fda5d.js → index-fab1cc3a.js} +2 -2
- package/build/index.js +112 -123
- package/build/{index.styles-cf5296fa.js → index.styles-3c08adf1.js} +1 -1
- package/build/{labelSorting-1767b217.js → labelSorting-c35f771e.js} +4 -4
- package/build/lead.js +22 -22
- package/build/{logoIcon-b6e9ebbc.js → logoIcon-206b5862.js} +2 -2
- package/build/mantine.js +20 -20
- package/build/misc.js +18 -18
- package/build/miscGetDynamicHealthTool.js +5 -5
- 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 +67 -67
- package/build/moleculesArticleCard.js +6 -6
- package/build/moleculesArticleCardV2.js +15 -15
- package/build/navigation.js +40 -40
- package/build/navigationLogoutPopup.js +9 -9
- package/build/navigationProfileButton.js +23 -23
- package/build/onboardingV2.js +27 -27
- package/build/organisms.js +44 -44
- package/build/{post-563403e1.js → post-c0fc6a66.js} +2 -2
- package/build/profileNavigation.js +19 -19
- package/build/progressBar.js +1 -1
- package/build/pwg.js +21 -21
- package/build/ssoV2.js +1652 -0
- package/build/subot.js +29 -29
- package/build/surveyOrPremiumBanner.js +29 -29
- package/build/surveyQuestionCard.js +10 -10
- package/build/{surveyThankyouCard-40786ef3.js → surveyThankyouCard-2bdf2dcd.js} +5 -5
- package/build/together.js +50 -50
- package/build/togetherApiUtils.js +4 -4
- package/build/togetherAtoms.js +30 -30
- package/build/togetherComponentGlobalContext.js +4 -4
- package/build/togetherMolecules.js +40 -40
- package/build/togetherMoleculesCardAuthor.js +24 -24
- package/build/togetherMoleculesPostImagePreview.js +11 -11
- package/build/togetherMoleculesProfileDetail.js +30 -30
- package/build/togetherOrganisms.js +45 -45
- package/build/togetherRichTextEditor.js +17 -17
- package/build/togetherShareBox.js +10 -10
- package/build/{treePopoverMenu-e0f418f8.js → treePopoverMenu-2ab933a7.js} +18 -18
- package/build/{types-a5ed4acd.js → types-59f18720.js} +2 -2
- package/build/types.js +2 -2
- package/build/{useCategory-7833d8d9.js → useCategory-09029dc3.js} +5 -5
- package/build/{useHealthToolCache-7ef0f9cd.js → useHealthToolCache-de6b2733.js} +1 -1
- package/build/{useMantineLocale-16175b54.js → useMantineLocale-06fe1f92.js} +5 -5
- package/build/{usePlacesAutocomplete-48ea8506.js → usePlacesAutocomplete-96f0c57a.js} +1 -1
- package/build/useTogetherAuthRequiredAction.js +4 -4
- package/build/{useTranslations-783bc413.js → useTranslations-398426f8.js} +1 -1
- package/build/{utils-dfe2edbf.js → utils-1645a4a3.js} +3 -3
- package/build/{utils-3aa5b9de.js → utils-74cf7dfd.js} +2 -2
- package/build/{utils-17e8be52.js → utils-9c9e505f.js} +2 -2
- package/build/vaccination.js +20 -20
- package/package.json +1 -1
- /package/build/{BMI_BOYS.percentile.monthly-31834ca0.js → BMI_BOYS.percentile.monthly-b2263c02.js} +0 -0
- /package/build/{BMI_BOYS.percentile.weekly-bb6043c1.js → BMI_BOYS.percentile.weekly-7189e549.js} +0 -0
- /package/build/{BMI_BOYS.percentile.yearly-cc6cba70.js → BMI_BOYS.percentile.yearly-01310d86.js} +0 -0
- /package/build/{BMI_BOYS.zscore.monthly-1b73153b.js → BMI_BOYS.zscore.monthly-a80fe254.js} +0 -0
- /package/build/{BMI_BOYS.zscore.weekly-0a4888e3.js → BMI_BOYS.zscore.weekly-4b605ea9.js} +0 -0
- /package/build/{BMI_BOYS.zscore.yearly-e7a5067a.js → BMI_BOYS.zscore.yearly-ee3eba97.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.monthly-de7218fe.js → BMI_GIRLS.percentile.monthly-166e660d.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.weekly-2d05d7fc.js → BMI_GIRLS.percentile.weekly-62efceea.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.yearly-6b402892.js → BMI_GIRLS.percentile.yearly-1ee84938.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.monthly-43fb7f4b.js → BMI_GIRLS.zscore.monthly-59fdaf1b.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.weekly-cca85dfc.js → BMI_GIRLS.zscore.weekly-da5bb3f4.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.yearly-79aa7d6f.js → BMI_GIRLS.zscore.yearly-745c6883.js} +0 -0
- /package/build/{ChevronDown-0bb6ebf7.js → ChevronDown-db345ad4.js} +0 -0
- /package/build/{Close-fc7a4318.js → Close-556fd99a.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-18fb5aae.js → HEAD CIRCUM_BOYS.percentile.monthly-c46325c7.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-ff6fc30b.js → HEAD CIRCUM_BOYS.percentile.weekly-cd1657f0.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-7ada75df.js → HEAD CIRCUM_BOYS.percentile.yearly-e3f39494.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-a8a584ad.js → HEAD CIRCUM_BOYS.zscore.monthly-ca64bade.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-78df99bd.js → HEAD CIRCUM_BOYS.zscore.weekly-a443b982.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-5a089140.js → HEAD CIRCUM_BOYS.zscore.yearly-33721395.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-71447fa2.js → HEAD CIRCUM_GIRLS.percentile.monthly-ac1db53c.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-09041858.js → HEAD CIRCUM_GIRLS.percentile.weekly-6c4f0f23.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-218785e5.js → HEAD CIRCUM_GIRLS.percentile.yearly-24448b3b.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-3c0fdcef.js → HEAD CIRCUM_GIRLS.zscore.monthly-ab7475ce.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-210cbe5a.js → HEAD CIRCUM_GIRLS.zscore.weekly-2aa317de.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-51bab3b5.js → HEAD CIRCUM_GIRLS.zscore.yearly-70253fe6.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.monthly-42cab1f3.js → HEIGHT_BOYS.percentile.monthly-be0f2b40.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.weekly-ea8a4c57.js → HEIGHT_BOYS.percentile.weekly-75ebc1b7.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.yearly-6b52f3a2.js → HEIGHT_BOYS.percentile.yearly-5234db88.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.monthly-1ff1109c.js → HEIGHT_BOYS.zscore.monthly-0ee39002.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.weekly-91ac3319.js → HEIGHT_BOYS.zscore.weekly-2c310565.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.yearly-08a54dc1.js → HEIGHT_BOYS.zscore.yearly-0bf8fade.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.monthly-374799e5.js → HEIGHT_GIRLS.percentile.monthly-748720cd.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.weekly-f4fb53fc.js → HEIGHT_GIRLS.percentile.weekly-8a46153d.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.yearly-e3687860.js → HEIGHT_GIRLS.percentile.yearly-330180a0.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.monthly-567531c2.js → HEIGHT_GIRLS.zscore.monthly-85383059.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.weekly-ec4377ed.js → HEIGHT_GIRLS.zscore.weekly-80e2f73d.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.yearly-dfea8277.js → HEIGHT_GIRLS.zscore.yearly-cba1cdb3.js} +0 -0
- /package/build/{Locale-da0ee478.js → Locale-ced9e812.js} +0 -0
- /package/build/{Visible-b7f98f50.js → Visible-395cf603.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.monthly-7618b9f6.js → WEIGHT_BOYS.percentile.monthly-1f8d0b96.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.weekly-ddb5a122.js → WEIGHT_BOYS.percentile.weekly-19bd270c.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.yearly-8e3c3567.js → WEIGHT_BOYS.percentile.yearly-1d3127d2.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.monthly-b243c952.js → WEIGHT_BOYS.zscore.monthly-e91aa7b9.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.weekly-e9328217.js → WEIGHT_BOYS.zscore.weekly-5bfa9b63.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.yearly-6e5652c7.js → WEIGHT_BOYS.zscore.yearly-377e4368.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.monthly-fec10910.js → WEIGHT_GIRLS.percentile.monthly-cd9bf691.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.weekly-11d3a59c.js → WEIGHT_GIRLS.percentile.weekly-017fd0e2.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.yearly-cf89f368.js → WEIGHT_GIRLS.percentile.yearly-d13af71c.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.monthly-2fff3f7b.js → WEIGHT_GIRLS.zscore.monthly-47af4518.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.weekly-8c4f6b7f.js → WEIGHT_GIRLS.zscore.weekly-11bb0652.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.yearly-b151d214.js → WEIGHT_GIRLS.zscore.yearly-975dca0f.js} +0 -0
- /package/build/{animation-60d97a74.js → animation-6eabf812.js} +0 -0
- /package/build/{constants-cdc1139b.js → constants-467b578b.js} +0 -0
- /package/build/{constants-cd64dee8.js → constants-8ccc1c6f.js} +0 -0
- /package/build/{constants-36dd380b.js → constants-b11de697.js} +0 -0
- /package/build/{dataTransform-ffd966a9.js → dataTransform-aa9f096c.js} +0 -0
- /package/build/{doctor-e94198ef.js → doctor-e6502faf.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.monthly-2a332a3a.js → BMI_BOYS.percentile.monthly-ced0a7a3.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.weekly-c3d892ac.js → BMI_BOYS.percentile.weekly-1b3ca2b8.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.yearly-cdc46283.js → BMI_BOYS.percentile.yearly-2c5a0ee8.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.monthly-66652c80.js → BMI_BOYS.zscore.monthly-cd03546a.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.weekly-ab18f061.js → BMI_BOYS.zscore.weekly-fcc1661e.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.yearly-0c467eb6.js → BMI_BOYS.zscore.yearly-9cabe9ca.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.monthly-2429b0cf.js → BMI_GIRLS.percentile.monthly-210f66f1.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.weekly-b9b4c395.js → BMI_GIRLS.percentile.weekly-4d723cba.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.yearly-6fb9ad13.js → BMI_GIRLS.percentile.yearly-9c05a767.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.monthly-c9bbc776.js → BMI_GIRLS.zscore.monthly-4382143e.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.weekly-5dc0474f.js → BMI_GIRLS.zscore.weekly-c0709379.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.yearly-e2ef86f8.js → BMI_GIRLS.zscore.yearly-be97f79b.js} +0 -0
- /package/build/esm/{ChevronDown-02044338.js → ChevronDown-b42c352b.js} +0 -0
- /package/build/esm/{Close-61220f73.js → Close-1e215489.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.monthly-fd04fa07.js → HEAD CIRCUM_BOYS.percentile.monthly-a24003f5.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.weekly-528f1994.js → HEAD CIRCUM_BOYS.percentile.weekly-96006f38.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.yearly-83ba6bf3.js → HEAD CIRCUM_BOYS.percentile.yearly-5610453d.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.monthly-ed488d96.js → HEAD CIRCUM_BOYS.zscore.monthly-e8d8d9ce.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.weekly-17cdff23.js → HEAD CIRCUM_BOYS.zscore.weekly-4daab427.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.yearly-d3dc9d78.js → HEAD CIRCUM_BOYS.zscore.yearly-08ec7af4.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.monthly-f56ed0bf.js → HEAD CIRCUM_GIRLS.percentile.monthly-009bc515.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.weekly-942cc7b6.js → HEAD CIRCUM_GIRLS.percentile.weekly-69a760cf.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.yearly-211ea40d.js → HEAD CIRCUM_GIRLS.percentile.yearly-81b6e6b4.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.monthly-68b579a0.js → HEAD CIRCUM_GIRLS.zscore.monthly-2c6d6ca7.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.weekly-37cdec10.js → HEAD CIRCUM_GIRLS.zscore.weekly-8a16120c.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.yearly-1cb077e9.js → HEAD CIRCUM_GIRLS.zscore.yearly-710b1ee2.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.monthly-0ace7dd5.js → HEIGHT_BOYS.percentile.monthly-3387956d.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.weekly-64dbe278.js → HEIGHT_BOYS.percentile.weekly-7f2c0632.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.yearly-fe232854.js → HEIGHT_BOYS.percentile.yearly-c1bb4a68.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.monthly-32f5b99c.js → HEIGHT_BOYS.zscore.monthly-7e42058a.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.weekly-f1bad17d.js → HEIGHT_BOYS.zscore.weekly-583b2b8b.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.yearly-bebdef69.js → HEIGHT_BOYS.zscore.yearly-4f581e61.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.monthly-18d1f48d.js → HEIGHT_GIRLS.percentile.monthly-4f367793.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.weekly-ee656308.js → HEIGHT_GIRLS.percentile.weekly-0f233037.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.yearly-bd0761eb.js → HEIGHT_GIRLS.percentile.yearly-6d387c7f.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.monthly-c5680c01.js → HEIGHT_GIRLS.zscore.monthly-a340801d.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.weekly-e4eb9dfb.js → HEIGHT_GIRLS.zscore.weekly-8fa49156.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.yearly-5b368aea.js → HEIGHT_GIRLS.zscore.yearly-39888c32.js} +0 -0
- /package/build/esm/{Locale-c89fbd16.js → Locale-2e537a6a.js} +0 -0
- /package/build/esm/{Visible-b92c39ca.js → Visible-4941f057.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.monthly-e8772fe0.js → WEIGHT_BOYS.percentile.monthly-7a60a73c.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.weekly-943a8f07.js → WEIGHT_BOYS.percentile.weekly-3cfb9f20.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.yearly-e0d5b2d1.js → WEIGHT_BOYS.percentile.yearly-166da826.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.monthly-7ec7bb71.js → WEIGHT_BOYS.zscore.monthly-96e662e5.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.weekly-77029cdb.js → WEIGHT_BOYS.zscore.weekly-deef00c4.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.yearly-fa652850.js → WEIGHT_BOYS.zscore.yearly-d27b755f.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.monthly-2d420c45.js → WEIGHT_GIRLS.percentile.monthly-361eaf8a.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.weekly-7c95da70.js → WEIGHT_GIRLS.percentile.weekly-df3a8d7e.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.yearly-131a0c7e.js → WEIGHT_GIRLS.percentile.yearly-65ec2031.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.monthly-bf6a297e.js → WEIGHT_GIRLS.zscore.monthly-7ad785b0.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.weekly-a45a5b31.js → WEIGHT_GIRLS.zscore.weekly-ce7380eb.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.yearly-1673c2b4.js → WEIGHT_GIRLS.zscore.yearly-eb5f8c05.js} +0 -0
- /package/build/esm/{animation-b441d9e7.js → animation-8cdf0413.js} +0 -0
- /package/build/esm/{constants-a84552ab.js → constants-0a2e2d89.js} +0 -0
- /package/build/esm/{constants-568c2ca4.js → constants-39fd57dc.js} +0 -0
- /package/build/esm/{constants-df4d1c0d.js → constants-c6b6dd70.js} +0 -0
- /package/build/esm/{dataTransform-1801ffc6.js → dataTransform-46c04e86.js} +0 -0
- /package/build/esm/{doctor-921f53e7.js → doctor-77d627cf.js} +0 -0
- /package/build/esm/{index-c7b97299.js → index-103508c0.js} +0 -0
- /package/build/esm/{index-18fc11e8.js → index-347e9ebf.js} +0 -0
- /package/build/esm/{index-ece91fe7.js → index-4a0f7a2a.js} +0 -0
- /package/build/esm/{index-404735f4.js → index-6df8ce2b.js} +0 -0
- /package/build/esm/{index-9f91a24e.js → index-823e3a77.js} +0 -0
- /package/build/esm/{index-f226ee8e.js → index-c2c1151d.js} +0 -0
- /package/build/esm/{index-24541ad3.js → index-c6266db7.js} +0 -0
- /package/build/esm/{index-58b02c69.js → index-f7f5582d.js} +0 -0
- /package/build/esm/{localizeNumberFormat-af0711db.js → localizeNumberFormat-55809d96.js} +0 -0
- /package/build/esm/{normalizeLink-98741f59.js → normalizeLink-5ca463b6.js} +0 -0
- /package/build/esm/{number-8cf59b73.js → number-4657b47b.js} +0 -0
- /package/build/esm/{other-5355d55f.js → other-09dd1a84.js} +0 -0
- /package/build/esm/{paths-59c509e3.js → paths-baec036c.js} +0 -0
- /package/build/esm/{routing-f4ff38f2.js → routing-3e2e2990.js} +0 -0
- /package/build/esm/{translationsContext-4bf4000a.js → translationsContext-b39ae826.js} +0 -0
- /package/build/esm/{tslib.es6-bb49a9db.js → tslib.es6-5f83e366.js} +0 -0
- /package/build/esm/{types-f588016e.js → types-dbdccf8d.js} +0 -0
- /package/build/esm/{useIsInit-93c72c57.js → useIsInit-a92309dc.js} +0 -0
- /package/build/esm/{useOutsideClick-1f5614e9.js → useOutsideClick-0be26f49.js} +0 -0
- /package/build/esm/{useScrollbarSize-09745987.js → useScrollbarSize-a4d05dbd.js} +0 -0
- /package/build/esm/{useUniqueId-f32a085b.js → useUniqueId-7d9bfd02.js} +0 -0
- /package/build/esm/{utils-393be1f5.js → utils-f168370f.js} +0 -0
- /package/build/{index-919c8bcc.js → index-3413e9d2.js} +0 -0
- /package/build/{index-9dcca919.js → index-3ab23404.js} +0 -0
- /package/build/{index-c1400cee.js → index-aabca052.js} +0 -0
- /package/build/{index-27ca71a1.js → index-b9c86a3d.js} +0 -0
- /package/build/{index-98868c1d.js → index-c6494ca6.js} +0 -0
- /package/build/{index-f5eaaf0a.js → index-f5d2c8d3.js} +0 -0
- /package/build/{index-e14e6c07.js → index-f64e7c74.js} +0 -0
- /package/build/{index-670ba3e3.js → index-fc8fe2d4.js} +0 -0
- /package/build/{localizeNumberFormat-5f29804a.js → localizeNumberFormat-d2e5c1a5.js} +0 -0
- /package/build/{normalizeLink-fab7982c.js → normalizeLink-84ac179b.js} +0 -0
- /package/build/{number-7485b550.js → number-e5fda4be.js} +0 -0
- /package/build/{other-7842a151.js → other-f335833f.js} +0 -0
- /package/build/{paths-76a73441.js → paths-643266bc.js} +0 -0
- /package/build/{routing-ab1ad38d.js → routing-5902192d.js} +0 -0
- /package/build/{translationsContext-531de800.js → translationsContext-8627f575.js} +0 -0
- /package/build/{tslib.es6-ba3eff7f.js → tslib.es6-bdc4ef33.js} +0 -0
- /package/build/{types-88e52088.js → types-efc43fc9.js} +0 -0
- /package/build/{useIsInit-24caa63d.js → useIsInit-a9a5096b.js} +0 -0
- /package/build/{useOutsideClick-d75084aa.js → useOutsideClick-6e5b26b3.js} +0 -0
- /package/build/{useScrollbarSize-ad4b22ea.js → useScrollbarSize-01d92d17.js} +0 -0
- /package/build/{useUniqueId-fafea8ea.js → useUniqueId-72e1f41e.js} +0 -0
- /package/build/{utils-59b38be2.js → utils-c6a6f3d0.js} +0 -0
package/build/ssoV2.js
ADDED
|
@@ -0,0 +1,1652 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var arrow = require('@hhgtech/icons/arrow');
|
|
7
|
+
var core = require('@hhgtech/icons/core');
|
|
8
|
+
var logoIcon = require('./logoIcon-206b5862.js');
|
|
9
|
+
var index$2 = require('./index-4ec635ce.js');
|
|
10
|
+
var index$1 = require('./index-0e75a585.js');
|
|
11
|
+
var Locale = require('./Locale-ced9e812.js');
|
|
12
|
+
var index = require('./index-fab1cc3a.js');
|
|
13
|
+
var tslib_es6 = require('./tslib.es6-bdc4ef33.js');
|
|
14
|
+
var core$1 = require('@mantine/core');
|
|
15
|
+
var index$4 = require('./index-a5f1a090.js');
|
|
16
|
+
var constantsIsProduction = require('./constantsIsProduction.js');
|
|
17
|
+
var routing = require('./routing-5902192d.js');
|
|
18
|
+
var index$3 = require('./index-0c83d79d.js');
|
|
19
|
+
var other = require('@hhgtech/icons/other');
|
|
20
|
+
var Google = require('./Google-9a9770c8.js');
|
|
21
|
+
var styled = require('@emotion/styled');
|
|
22
|
+
var utils = require('./utils-9c9e505f.js');
|
|
23
|
+
var miscCookieHelper = require('./miscCookieHelper.js');
|
|
24
|
+
var miscTheme = require('./miscTheme.js');
|
|
25
|
+
var constantsDomainLocales = require('./constantsDomainLocales.js');
|
|
26
|
+
var form = require('@mantine/form');
|
|
27
|
+
var throttle = require('lodash/throttle');
|
|
28
|
+
require('@mantine/dates');
|
|
29
|
+
require('./index-67ffc70a.js');
|
|
30
|
+
require('./index-b9c86a3d.js');
|
|
31
|
+
require('./useMantineLocale-06fe1f92.js');
|
|
32
|
+
var useTranslations = require('./useTranslations-398426f8.js');
|
|
33
|
+
require('@mantine/hooks');
|
|
34
|
+
require('./utils-c6a6f3d0.js');
|
|
35
|
+
require('./other-f335833f.js');
|
|
36
|
+
var yup = require('yup');
|
|
37
|
+
var dayjs = require('dayjs');
|
|
38
|
+
var index$5 = require('./index-0b5356e5.js');
|
|
39
|
+
require('./index-e0c93d12.js');
|
|
40
|
+
require('./index.styles-3c08adf1.js');
|
|
41
|
+
require('date-fns/locale');
|
|
42
|
+
require('./constantsSite.js');
|
|
43
|
+
require('./constantsRiskScreener.js');
|
|
44
|
+
require('@mantine/carousel');
|
|
45
|
+
require('classnames');
|
|
46
|
+
require('./useUniqueId-72e1f41e.js');
|
|
47
|
+
require('./translationsContext-8627f575.js');
|
|
48
|
+
require('string-format');
|
|
49
|
+
|
|
50
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
51
|
+
|
|
52
|
+
function _interopNamespace(e) {
|
|
53
|
+
if (e && e.__esModule) return e;
|
|
54
|
+
var n = Object.create(null);
|
|
55
|
+
if (e) {
|
|
56
|
+
Object.keys(e).forEach(function (k) {
|
|
57
|
+
if (k !== 'default') {
|
|
58
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
59
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
60
|
+
enumerable: true,
|
|
61
|
+
get: function () { return e[k]; }
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
n["default"] = e;
|
|
67
|
+
return Object.freeze(n);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
71
|
+
var styled__default = /*#__PURE__*/_interopDefault(styled);
|
|
72
|
+
var throttle__default = /*#__PURE__*/_interopDefault(throttle);
|
|
73
|
+
var yup__namespace = /*#__PURE__*/_interopNamespace(yup);
|
|
74
|
+
var dayjs__default = /*#__PURE__*/_interopDefault(dayjs);
|
|
75
|
+
|
|
76
|
+
const SSOStateContext = React.createContext({
|
|
77
|
+
locale: Locale.LOCALE.Vietnam,
|
|
78
|
+
onClose: () => false,
|
|
79
|
+
source: 'default',
|
|
80
|
+
});
|
|
81
|
+
const SSOStateProvider = ({ children, locale = Locale.LOCALE.Vietnam, onClose, source = 'default', }) => {
|
|
82
|
+
return (React__default["default"].createElement(SSOStateContext.Provider, { value: {
|
|
83
|
+
locale,
|
|
84
|
+
onClose,
|
|
85
|
+
source,
|
|
86
|
+
} }, children));
|
|
87
|
+
};
|
|
88
|
+
const useSSOState = () => {
|
|
89
|
+
return React__default["default"].useContext(SSOStateContext);
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
var SSOStepTypeType;
|
|
93
|
+
(function (SSOStepTypeType) {
|
|
94
|
+
SSOStepTypeType["FIRST"] = "first";
|
|
95
|
+
SSOStepTypeType["EMAIL"] = "email";
|
|
96
|
+
SSOStepTypeType["VERIFY_PHONE"] = "verify_phone";
|
|
97
|
+
SSOStepTypeType["PASSWORD"] = "password";
|
|
98
|
+
SSOStepTypeType["UPDATE_EMAIL"] = "update_email";
|
|
99
|
+
SSOStepTypeType["FORGOT_PASSWORD_PHONE"] = "forgot_password_phone";
|
|
100
|
+
SSOStepTypeType["FORGOT_PASSWORD_SETUP"] = "forgot_password_setup";
|
|
101
|
+
SSOStepTypeType["OTP"] = "otp";
|
|
102
|
+
SSOStepTypeType["SETUP_FULL"] = "setup_full";
|
|
103
|
+
})(SSOStepTypeType || (SSOStepTypeType = {}));
|
|
104
|
+
const SSOStepsContext = React.createContext({
|
|
105
|
+
currentStepIndex: 0,
|
|
106
|
+
steps: [
|
|
107
|
+
{
|
|
108
|
+
type: SSOStepTypeType.FIRST,
|
|
109
|
+
},
|
|
110
|
+
],
|
|
111
|
+
setSteps: () => false,
|
|
112
|
+
goNext: () => false,
|
|
113
|
+
goBack: () => false,
|
|
114
|
+
addStep: () => false,
|
|
115
|
+
});
|
|
116
|
+
const SSOStepsProvider = ({ children }) => {
|
|
117
|
+
const [steps, setSteps] = React.useState([
|
|
118
|
+
{
|
|
119
|
+
type: SSOStepTypeType.FIRST,
|
|
120
|
+
},
|
|
121
|
+
]);
|
|
122
|
+
const [currentStepIndex, setCurrentStepIndex] = React.useState(0);
|
|
123
|
+
return (React__default["default"].createElement(SSOStepsContext.Provider, { value: {
|
|
124
|
+
currentStepIndex,
|
|
125
|
+
steps,
|
|
126
|
+
setSteps,
|
|
127
|
+
addStep: (step) => {
|
|
128
|
+
setSteps((s) => [...s, step]);
|
|
129
|
+
},
|
|
130
|
+
goNext: () => {
|
|
131
|
+
setCurrentStepIndex((index) => index + 1);
|
|
132
|
+
},
|
|
133
|
+
goBack: () => {
|
|
134
|
+
setCurrentStepIndex((index) => index - 1);
|
|
135
|
+
// remove step when go back
|
|
136
|
+
setSteps((steps) => steps.slice(0, steps.length - 1));
|
|
137
|
+
},
|
|
138
|
+
} }, children));
|
|
139
|
+
};
|
|
140
|
+
const useSSOSteps = () => {
|
|
141
|
+
return React__default["default"].useContext(SSOStepsContext);
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
const SSOPopupWrapper = ({ children, opened, onClose, }) => {
|
|
145
|
+
var _a;
|
|
146
|
+
const { steps, goBack } = useSSOSteps();
|
|
147
|
+
const { locale } = useSSOState();
|
|
148
|
+
const showBack = steps.length > 1;
|
|
149
|
+
const showClose = steps.length === 1;
|
|
150
|
+
const showLogo = steps.length === 1;
|
|
151
|
+
const logoType = (_a = index.LOCALE_SPECS[locale]) === null || _a === void 0 ? void 0 : _a.LOGO_TYPE;
|
|
152
|
+
const [closeConfirmOpen, setCloseConfirmOpen] = React__default["default"].useState(false);
|
|
153
|
+
const onCloseClick = () => {
|
|
154
|
+
setCloseConfirmOpen(true);
|
|
155
|
+
};
|
|
156
|
+
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
157
|
+
React__default["default"].createElement(index$1.Modal, { opened: opened, onClose: onCloseClick, styles: (theme) => ({
|
|
158
|
+
body: {
|
|
159
|
+
display: 'flex',
|
|
160
|
+
flexDirection: 'column',
|
|
161
|
+
gap: 24,
|
|
162
|
+
padding: '36px 24px',
|
|
163
|
+
position: 'relative',
|
|
164
|
+
background: 'linear-gradient(180deg, #A5D4FF 0%, #FFFFFF 150px)',
|
|
165
|
+
overflow: 'auto',
|
|
166
|
+
[theme.fn.smallerThan('sm')]: {
|
|
167
|
+
height: '100%',
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
content: {
|
|
171
|
+
[theme.fn.smallerThan('sm')]: {
|
|
172
|
+
width: '100%',
|
|
173
|
+
height: '100%',
|
|
174
|
+
borderRadius: 0,
|
|
175
|
+
maxWidth: '100%',
|
|
176
|
+
maxHeight: '100%',
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
inner: {
|
|
180
|
+
[theme.fn.smallerThan('sm')]: {
|
|
181
|
+
padding: 0,
|
|
182
|
+
left: 0,
|
|
183
|
+
right: 0,
|
|
184
|
+
display: 'block',
|
|
185
|
+
},
|
|
186
|
+
},
|
|
187
|
+
}), withCloseButton: false },
|
|
188
|
+
React__default["default"].createElement("div", { style: {
|
|
189
|
+
height: 40,
|
|
190
|
+
display: 'flex',
|
|
191
|
+
alignItems: 'center',
|
|
192
|
+
justifyContent: 'space-between',
|
|
193
|
+
} },
|
|
194
|
+
showBack && (React__default["default"].createElement(index$2.Button, { variant: "white", style: {
|
|
195
|
+
width: 40,
|
|
196
|
+
height: 40,
|
|
197
|
+
padding: 8,
|
|
198
|
+
background: 'white',
|
|
199
|
+
borderRadius: '100%',
|
|
200
|
+
}, onClick: goBack },
|
|
201
|
+
React__default["default"].createElement(arrow.ChevronLeft, null))),
|
|
202
|
+
showLogo && (React__default["default"].createElement(logoIcon.LogoIcon, { type: logoType, height: 32, width: 'unset' })),
|
|
203
|
+
showClose && (React__default["default"].createElement(index$2.Button, { variant: "white", style: {
|
|
204
|
+
width: 40,
|
|
205
|
+
height: 40,
|
|
206
|
+
padding: 8,
|
|
207
|
+
background: 'white',
|
|
208
|
+
borderRadius: '100%',
|
|
209
|
+
}, onClick: onCloseClick },
|
|
210
|
+
React__default["default"].createElement(core.Close, null)))),
|
|
211
|
+
React__default["default"].createElement("div", { style: {
|
|
212
|
+
flex: 1,
|
|
213
|
+
} }, children)),
|
|
214
|
+
React__default["default"].createElement(index$1.Modal, { opened: closeConfirmOpen, onClose: () => setCloseConfirmOpen(false), withCloseButton: false },
|
|
215
|
+
"are you sure",
|
|
216
|
+
React__default["default"].createElement(index$2.Button, { onClick: onClose }, "Yes"),
|
|
217
|
+
React__default["default"].createElement(index$2.Button, { onClick: () => setCloseConfirmOpen(false) }, "No"))));
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
const SSO_V2_PATHS = {
|
|
221
|
+
LOGIN_BY_SOCIAL: 'member/social-login',
|
|
222
|
+
EMAIL: {
|
|
223
|
+
REGISTER_BY_SEND_OTP: 'login/login-with-email',
|
|
224
|
+
LOGIN_BY_PASSWORD: 'member/login',
|
|
225
|
+
VERIFY_BY_OTP: 'login/email-verify-code',
|
|
226
|
+
SEND_OTP: 'login/email-resend-otp-code', // FOR RESEND OTP IN CASE FAIL
|
|
227
|
+
},
|
|
228
|
+
PHONE: {
|
|
229
|
+
REGISTER_BY_SEND_OTP: 'login/login-with-sms',
|
|
230
|
+
SEND_OTP: 'login/sms/sent-otp',
|
|
231
|
+
VERIFY_BY_OTP: 'login/phone-verify-code',
|
|
232
|
+
LOGIN_BY_PASSWORD: 'member/login-by-phone'
|
|
233
|
+
},
|
|
234
|
+
ZALO: {
|
|
235
|
+
REGISTER_BY_SEND_OTP: 'login/login-with-zalo',
|
|
236
|
+
SEND_OTP: 'login/zalo/sent-otp',
|
|
237
|
+
VERIFY_BY_OTP: 'login/zalo-verify-code'
|
|
238
|
+
},
|
|
239
|
+
RESET_PASSWORD: 'login/reset-password',
|
|
240
|
+
CHECK_USER_EXIST: 'member/check-user-exist',
|
|
241
|
+
UPDATE_USER_INFO: 'login/update-first-info',
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
const locale = process.env.UNIFY_LOCALE || 'vi-VN';
|
|
245
|
+
const websiteId = index.LOCALE_SPECS[locale].SITE_ID;
|
|
246
|
+
index.LOCALE_SPECS[locale].PHONE;
|
|
247
|
+
const allAvailableAreaCodes = Object.keys(index.LOCALE_SPECS).map((locale) => index.LOCALE_SPECS[locale].PHONE);
|
|
248
|
+
const getSSOV2ApiUrl = (path) => {
|
|
249
|
+
return `${routing.getCurrentSsoUrl(locale)}/api/v2/${path}`;
|
|
250
|
+
};
|
|
251
|
+
const getSSOApiUrl = (path) => {
|
|
252
|
+
return `${routing.getCurrentSsoUrl(locale)}/api/${path}`;
|
|
253
|
+
};
|
|
254
|
+
const BEARER_TOKEN_COOKIE = 'hhg_user_token';
|
|
255
|
+
// NOTICE: RUN ONLY CLIENT SIDE
|
|
256
|
+
const fetchSSOV2Api = (path, options = {}, noAuth) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
257
|
+
var _a;
|
|
258
|
+
let response;
|
|
259
|
+
const authToken = noAuth ? '' : (_a = document.cookie
|
|
260
|
+
.split('; ')
|
|
261
|
+
.find((row) => row.startsWith(BEARER_TOKEN_COOKIE))) === null || _a === void 0 ? void 0 : _a.split('=')[1];
|
|
262
|
+
try {
|
|
263
|
+
response = yield fetch(getSSOV2ApiUrl(path), authToken ? Object.assign(Object.assign({}, options), { headers: Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.headers), { Authorization: `Bearer ${authToken}` }) }) : options);
|
|
264
|
+
}
|
|
265
|
+
catch (error) {
|
|
266
|
+
console.error(error);
|
|
267
|
+
return null;
|
|
268
|
+
}
|
|
269
|
+
return response === null || response === void 0 ? void 0 : response.json();
|
|
270
|
+
});
|
|
271
|
+
const fetchSSOApi = (path, options = {}, noAuth) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
272
|
+
var _b;
|
|
273
|
+
let response;
|
|
274
|
+
const authToken = noAuth ? '' : (_b = document.cookie
|
|
275
|
+
.split('; ')
|
|
276
|
+
.find((row) => row.startsWith(BEARER_TOKEN_COOKIE))) === null || _b === void 0 ? void 0 : _b.split('=')[1];
|
|
277
|
+
try {
|
|
278
|
+
response = yield fetch(getSSOApiUrl(path), authToken ? Object.assign(Object.assign({}, options), { headers: Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.headers), { Authorization: `Bearer ${authToken}` }) }) : options);
|
|
279
|
+
}
|
|
280
|
+
catch (error) {
|
|
281
|
+
console.error(error);
|
|
282
|
+
return null;
|
|
283
|
+
}
|
|
284
|
+
return response === null || response === void 0 ? void 0 : response.json();
|
|
285
|
+
});
|
|
286
|
+
const resetPassword = (password, confirmPassword) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
287
|
+
return fetchSSOV2Api(SSO_V2_PATHS.RESET_PASSWORD, {
|
|
288
|
+
method: 'POST',
|
|
289
|
+
body: JSON.stringify({
|
|
290
|
+
"password": password,
|
|
291
|
+
"confirm-password": confirmPassword
|
|
292
|
+
}),
|
|
293
|
+
});
|
|
294
|
+
});
|
|
295
|
+
// "email":"kenny_test2201_11@mailinator.com"
|
|
296
|
+
// "phone_number":"906911910"
|
|
297
|
+
const checkUserExist = ({ email, phone // no +
|
|
298
|
+
}) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
299
|
+
// "provider": "email",
|
|
300
|
+
// "is_pass": true,
|
|
301
|
+
// "is_status": "Active"
|
|
302
|
+
const formData = new FormData();
|
|
303
|
+
if (email) {
|
|
304
|
+
formData.append('email', email);
|
|
305
|
+
}
|
|
306
|
+
else {
|
|
307
|
+
formData.append('phone_number', phone);
|
|
308
|
+
}
|
|
309
|
+
return fetchSSOV2Api(SSO_V2_PATHS.CHECK_USER_EXIST, {
|
|
310
|
+
method: 'POST',
|
|
311
|
+
body: formData
|
|
312
|
+
});
|
|
313
|
+
});
|
|
314
|
+
// "name": "Huy Tran 888",
|
|
315
|
+
// "birthday": "1989-04-26",
|
|
316
|
+
// "email":"kenny_test2201_02@mailinator.com", // optional chỉ require khi source là care | ecom
|
|
317
|
+
// "password": "Kenny2103",
|
|
318
|
+
// "confirm_password":"Kenny2103",
|
|
319
|
+
// "phone_number":"906911912", // require khi user register bằng email hoặc social
|
|
320
|
+
// "area_code":"+84", // require khi có phone number
|
|
321
|
+
// "gender": 1,
|
|
322
|
+
// "validate": false, // true validate sau khi validate xong truyền false để update
|
|
323
|
+
// "source": "care" | "ecom" // default sẽ ko require email. nếu source là care sẽ require email. ==> support cho business care
|
|
324
|
+
const updateUserInfo = (data) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
325
|
+
const formData = new FormData();
|
|
326
|
+
Object.keys(data).forEach((key) => {
|
|
327
|
+
if (data[key]) {
|
|
328
|
+
formData.append(key, data[key]);
|
|
329
|
+
}
|
|
330
|
+
});
|
|
331
|
+
return fetchSSOV2Api(SSO_V2_PATHS.UPDATE_USER_INFO, {
|
|
332
|
+
method: 'POST',
|
|
333
|
+
body: formData
|
|
334
|
+
});
|
|
335
|
+
});
|
|
336
|
+
const GoogleAuthClientId = constantsIsProduction.isProduction ? '289442006438-040a42cbidr6v5d178f3iqi9q95821r3.apps.googleusercontent.com' : '289442006438-cihobuq1h3r4426pur7u0e43fqdnep59.apps.googleusercontent.com';
|
|
337
|
+
const FacebookAppId = '2759888574045636';
|
|
338
|
+
|
|
339
|
+
const registerBySendEmailOTP = (email) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
340
|
+
const formData = new FormData();
|
|
341
|
+
formData.append('email', email);
|
|
342
|
+
formData.append('website_id', websiteId);
|
|
343
|
+
return fetchSSOV2Api(SSO_V2_PATHS.EMAIL.REGISTER_BY_SEND_OTP, {
|
|
344
|
+
method: 'POST',
|
|
345
|
+
body: formData
|
|
346
|
+
});
|
|
347
|
+
});
|
|
348
|
+
const resendEmailOTP = (email) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
349
|
+
const formData = new FormData();
|
|
350
|
+
formData.append('email', email);
|
|
351
|
+
return fetchSSOV2Api(SSO_V2_PATHS.EMAIL.SEND_OTP, {
|
|
352
|
+
method: 'POST',
|
|
353
|
+
body: formData
|
|
354
|
+
});
|
|
355
|
+
});
|
|
356
|
+
const verifyByEmailOTP = (email, otpCode) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
357
|
+
const formData = new FormData();
|
|
358
|
+
formData.append('email', email);
|
|
359
|
+
formData.append('code', otpCode);
|
|
360
|
+
return fetchSSOV2Api(SSO_V2_PATHS.EMAIL.VERIFY_BY_OTP, {
|
|
361
|
+
method: 'POST',
|
|
362
|
+
body: formData
|
|
363
|
+
});
|
|
364
|
+
});
|
|
365
|
+
|
|
366
|
+
const SSOEmailScreen = ({ hidden, }) => {
|
|
367
|
+
const [errMsg, setErrMsg] = React__default["default"].useState('');
|
|
368
|
+
const { addStep, goNext } = useSSOSteps();
|
|
369
|
+
return (React__default["default"].createElement("form", { style: {
|
|
370
|
+
display: hidden ? 'none' : 'block',
|
|
371
|
+
}, onSubmit: (e) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
372
|
+
var _a, _b, _c;
|
|
373
|
+
e.preventDefault();
|
|
374
|
+
const email = e.currentTarget.email.value;
|
|
375
|
+
const existRes = yield checkUserExist({ email });
|
|
376
|
+
if ((existRes === null || existRes === void 0 ? void 0 : existRes._status) === 1) {
|
|
377
|
+
if (((_a = existRes._data) === null || _a === void 0 ? void 0 : _a.is_pass) &&
|
|
378
|
+
((_b = existRes._data) === null || _b === void 0 ? void 0 : _b.is_status) === 'Active') {
|
|
379
|
+
// go to password screen
|
|
380
|
+
addStep({
|
|
381
|
+
type: SSOStepTypeType.PASSWORD,
|
|
382
|
+
config: {
|
|
383
|
+
email,
|
|
384
|
+
},
|
|
385
|
+
});
|
|
386
|
+
goNext();
|
|
387
|
+
}
|
|
388
|
+
else {
|
|
389
|
+
// go to register screen
|
|
390
|
+
registerBySendEmailOTP(email);
|
|
391
|
+
addStep({
|
|
392
|
+
type: SSOStepTypeType.OTP,
|
|
393
|
+
config: {
|
|
394
|
+
email,
|
|
395
|
+
otpType: 'email',
|
|
396
|
+
},
|
|
397
|
+
});
|
|
398
|
+
goNext();
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
else {
|
|
402
|
+
setErrMsg(((_c = existRes._messages) === null || _c === void 0 ? void 0 : _c[0]) || 'api error');
|
|
403
|
+
}
|
|
404
|
+
}) },
|
|
405
|
+
React__default["default"].createElement(core$1.Stack, { spacing: 8 },
|
|
406
|
+
React__default["default"].createElement(index$3.Text, { size: "s1", weight: "semiBold" }, "Continue with email"),
|
|
407
|
+
React__default["default"].createElement(index$3.Text, { size: "p4" }, "S\u1EED d\u1EE5ng email c\u1EE7a b\u1EA1n \u0111\u1EC3 ti\u1EBFp t\u1EE5c \u0111\u0103ng nh\u1EADp ho\u1EB7c \u0111\u0103ng k\u00FD")),
|
|
408
|
+
React__default["default"].createElement(index$4.Input, { name: "email", placeholder: "Email c\u1EE7a b\u1EA1n", error: errMsg || undefined, type: "email", required: true, mt: 24 }),
|
|
409
|
+
React__default["default"].createElement(index$2.Button, { type: "submit", size: "lg", variant: "primary", fullWidth: true, mt: 16 }, "Verify Your Email")));
|
|
410
|
+
};
|
|
411
|
+
|
|
412
|
+
// "phone_number":"906911910",
|
|
413
|
+
// "password":"Kenny2103!"
|
|
414
|
+
const loginByPhonePassword = (phone, password) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
415
|
+
const formData = new FormData();
|
|
416
|
+
formData.append('phone_number', phone);
|
|
417
|
+
formData.append('password', password);
|
|
418
|
+
return fetchSSOV2Api(SSO_V2_PATHS.PHONE.LOGIN_BY_PASSWORD, {
|
|
419
|
+
method: 'POST',
|
|
420
|
+
body: formData
|
|
421
|
+
}, true);
|
|
422
|
+
});
|
|
423
|
+
// "phone_number": "906911910",
|
|
424
|
+
// "area_code":"+84",
|
|
425
|
+
const registerBySendPhoneOTP = (phone, areaCode) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
426
|
+
const formData = new FormData();
|
|
427
|
+
formData.append('phone_number', phone);
|
|
428
|
+
formData.append('area_code', areaCode);
|
|
429
|
+
formData.append('website_id', websiteId);
|
|
430
|
+
return fetchSSOV2Api(SSO_V2_PATHS.PHONE.REGISTER_BY_SEND_OTP, {
|
|
431
|
+
method: 'POST',
|
|
432
|
+
body: formData
|
|
433
|
+
});
|
|
434
|
+
});
|
|
435
|
+
// "phone_number": "906911910",
|
|
436
|
+
// "area_code":"+84",
|
|
437
|
+
const resendPhoneOTP = (phone, areaCode) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
438
|
+
const formData = new FormData();
|
|
439
|
+
formData.append('phone_number', phone);
|
|
440
|
+
formData.append('area_code', areaCode);
|
|
441
|
+
return fetchSSOV2Api(SSO_V2_PATHS.PHONE.SEND_OTP, {
|
|
442
|
+
method: 'POST',
|
|
443
|
+
body: formData
|
|
444
|
+
});
|
|
445
|
+
});
|
|
446
|
+
// "otp_code":"212616",
|
|
447
|
+
// "phone_number": "906911910",
|
|
448
|
+
// "area_code":"+84"
|
|
449
|
+
const verifyByPhoneOTP = (phone, areaCode, otpCode) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
450
|
+
const formData = new FormData();
|
|
451
|
+
formData.append('phone_number', phone);
|
|
452
|
+
formData.append('area_code', areaCode);
|
|
453
|
+
formData.append('otp_code', otpCode);
|
|
454
|
+
return fetchSSOV2Api(SSO_V2_PATHS.PHONE.VERIFY_BY_OTP, {
|
|
455
|
+
method: 'POST',
|
|
456
|
+
body: formData,
|
|
457
|
+
});
|
|
458
|
+
});
|
|
459
|
+
|
|
460
|
+
const splitPhone = (phone) => {
|
|
461
|
+
var _a, _b;
|
|
462
|
+
if (!phone)
|
|
463
|
+
return { areaCode: '', phoneNumber: '' };
|
|
464
|
+
let areaCode = '';
|
|
465
|
+
let phoneNumber = phone;
|
|
466
|
+
if (phone.startsWith('+')) {
|
|
467
|
+
areaCode = ((_a = phone.match(new RegExp(`^\\+(${allAvailableAreaCodes.map(c => c.replace('+', '')).join('|')})`))) === null || _a === void 0 ? void 0 : _a[0]) || '';
|
|
468
|
+
phoneNumber = phone.slice(areaCode.length);
|
|
469
|
+
}
|
|
470
|
+
else {
|
|
471
|
+
areaCode = ((_b = phone.match(new RegExp(`^(${allAvailableAreaCodes.map(c => c.replace('+', '')).join('|')})`))) === null || _b === void 0 ? void 0 : _b[0]) || '';
|
|
472
|
+
phoneNumber = phone.slice(areaCode.length);
|
|
473
|
+
if (areaCode) {
|
|
474
|
+
areaCode = `+${areaCode}`;
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
return { areaCode, phoneNumber };
|
|
478
|
+
};
|
|
479
|
+
|
|
480
|
+
const loginBySocial = (token, social) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
481
|
+
const formData = new FormData();
|
|
482
|
+
formData.append('token', token);
|
|
483
|
+
formData.append('social', social);
|
|
484
|
+
formData.append('website_id', websiteId);
|
|
485
|
+
return fetchSSOV2Api(SSO_V2_PATHS.LOGIN_BY_SOCIAL, {
|
|
486
|
+
method: 'POST',
|
|
487
|
+
body: formData,
|
|
488
|
+
});
|
|
489
|
+
});
|
|
490
|
+
|
|
491
|
+
// "phone_number": "906911910",
|
|
492
|
+
// "area_code":"+84",
|
|
493
|
+
const registerBySendZaloOTP = (phone, areaCode) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
494
|
+
const formData = new FormData();
|
|
495
|
+
formData.append('phone_number', phone);
|
|
496
|
+
formData.append('area_code', areaCode);
|
|
497
|
+
formData.append('website_id', websiteId);
|
|
498
|
+
return fetchSSOV2Api(SSO_V2_PATHS.ZALO.REGISTER_BY_SEND_OTP, {
|
|
499
|
+
method: 'POST',
|
|
500
|
+
body: formData,
|
|
501
|
+
});
|
|
502
|
+
});
|
|
503
|
+
// "phone_number": "906911910",
|
|
504
|
+
// "area_code":"+84",
|
|
505
|
+
const resendZaloOTP = (phone, areaCode) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
506
|
+
const formData = new FormData();
|
|
507
|
+
formData.append('phone_number', phone);
|
|
508
|
+
formData.append('area_code', areaCode);
|
|
509
|
+
return fetchSSOV2Api(SSO_V2_PATHS.ZALO.SEND_OTP, {
|
|
510
|
+
method: 'POST',
|
|
511
|
+
body: formData
|
|
512
|
+
});
|
|
513
|
+
});
|
|
514
|
+
// "otp_code":"212616",
|
|
515
|
+
// "phone_number": "906911910",
|
|
516
|
+
// "area_code":"+84"
|
|
517
|
+
const verifyByZaloOTP = (phone, areaCode, otpCode) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
518
|
+
const formData = new FormData();
|
|
519
|
+
formData.append('otp_code', otpCode);
|
|
520
|
+
formData.append('phone_number', phone);
|
|
521
|
+
formData.append('area_code', areaCode);
|
|
522
|
+
return fetchSSOV2Api(SSO_V2_PATHS.ZALO.VERIFY_BY_OTP, {
|
|
523
|
+
method: 'POST',
|
|
524
|
+
body: formData
|
|
525
|
+
});
|
|
526
|
+
});
|
|
527
|
+
|
|
528
|
+
const MailIcon = (props) => (React__default["default"].createElement("svg", Object.assign({ width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
|
|
529
|
+
React__default["default"].createElement("g", { clipPath: "url(#clip0_869_25628)" },
|
|
530
|
+
React__default["default"].createElement("rect", { width: "24", height: "24", rx: "12", fill: "#00B16A" }),
|
|
531
|
+
React__default["default"].createElement("path", { d: "M15.75 5.625h-7.5C6 5.625 4.5 6.75 4.5 9.375v5.25c0 2.625 1.5 3.75 3.75 3.75h7.5c2.25 0 3.75-1.125 3.75-3.75v-5.25c0-2.625-1.5-3.75-3.75-3.75m.352 4.568-2.347 1.875c-.495.397-1.125.592-1.755.592s-1.267-.195-1.755-.592l-2.347-1.875a.577.577 0 0 1-.09-.795.56.56 0 0 1 .787-.09l2.348 1.874c.57.458 1.537.458 2.107 0l2.348-1.875c.24-.194.6-.157.787.09a.57.57 0 0 1-.082.796", fill: "#fff" })),
|
|
532
|
+
React__default["default"].createElement("defs", null,
|
|
533
|
+
React__default["default"].createElement("clipPath", { id: "clip0_869_25628" },
|
|
534
|
+
React__default["default"].createElement("path", { fill: "#fff", d: "M0 0h24v24H0z" })))));
|
|
535
|
+
|
|
536
|
+
const StyledPhone = styled__default["default"](index$4.Phone) `
|
|
537
|
+
position: relative;
|
|
538
|
+
.PhoneInputCountry {
|
|
539
|
+
background: unset;
|
|
540
|
+
border: none;
|
|
541
|
+
position: absolute;
|
|
542
|
+
left: 0;
|
|
543
|
+
top: 0;
|
|
544
|
+
height: 100%;
|
|
545
|
+
padding-right: 0;
|
|
546
|
+
min-width: 100px;
|
|
547
|
+
.PhoneInputCountryIcon {
|
|
548
|
+
min-width: 70px;
|
|
549
|
+
.PhoneInputCountryIconImg {
|
|
550
|
+
margin: auto;
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
.PhoneInputInput {
|
|
555
|
+
border-radius: 8px;
|
|
556
|
+
border-left-width: 1px;
|
|
557
|
+
line-height: 46px;
|
|
558
|
+
padding-left: 105px;
|
|
559
|
+
}
|
|
560
|
+
`;
|
|
561
|
+
|
|
562
|
+
const SSOFirstScreen = ({ hidden }) => {
|
|
563
|
+
const [phone, setPhone] = React__default["default"].useState('');
|
|
564
|
+
const [errMsg, setErrMsg] = React__default["default"].useState('');
|
|
565
|
+
const { locale, onClose } = useSSOState();
|
|
566
|
+
const { addStep, goNext } = useSSOSteps();
|
|
567
|
+
const handleLoginBySocial = (credential, provider) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
568
|
+
var _a, _b, _c, _d, _e;
|
|
569
|
+
const res = yield loginBySocial(credential, provider);
|
|
570
|
+
if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
|
|
571
|
+
// TODO: set token, get profile, determin if need update info or just login
|
|
572
|
+
miscCookieHelper.setCookie(index.BEARER_TOKEN_COOKIE, (_a = res._data) === null || _a === void 0 ? void 0 : _a.token, {
|
|
573
|
+
domain: window.location.hostname === 'localhost'
|
|
574
|
+
? 'localhost'
|
|
575
|
+
: `.${constantsDomainLocales.domainLocales[process.env.UNIFY_LOCALE || 'vi-VN']}`,
|
|
576
|
+
expires: new Date(res._data.expire_in * 1000).toUTCString(),
|
|
577
|
+
});
|
|
578
|
+
const userInfo = yield fetchSSOApi('user/profile');
|
|
579
|
+
if ((userInfo === null || userInfo === void 0 ? void 0 : userInfo._status) === 1) {
|
|
580
|
+
if ((_b = userInfo._data) === null || _b === void 0 ? void 0 : _b.is_new) {
|
|
581
|
+
addStep({
|
|
582
|
+
type: SSOStepTypeType.SETUP_FULL,
|
|
583
|
+
config: {
|
|
584
|
+
userInfo,
|
|
585
|
+
disabledEmail: true,
|
|
586
|
+
},
|
|
587
|
+
});
|
|
588
|
+
goNext();
|
|
589
|
+
}
|
|
590
|
+
else if (!((_c = userInfo._data) === null || _c === void 0 ? void 0 : _c.phone_verified)) {
|
|
591
|
+
addStep({
|
|
592
|
+
type: SSOStepTypeType.VERIFY_PHONE,
|
|
593
|
+
});
|
|
594
|
+
goNext();
|
|
595
|
+
}
|
|
596
|
+
else {
|
|
597
|
+
onClose();
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
else {
|
|
601
|
+
setErrMsg(((_d = userInfo === null || userInfo === void 0 ? void 0 : userInfo._messages) === null || _d === void 0 ? void 0 : _d[0]) || 'API error');
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
else {
|
|
605
|
+
setErrMsg(((_e = res === null || res === void 0 ? void 0 : res._messages) === null || _e === void 0 ? void 0 : _e[0]) || 'API error');
|
|
606
|
+
}
|
|
607
|
+
});
|
|
608
|
+
React.useEffect(() => {
|
|
609
|
+
const script = document.createElement('script');
|
|
610
|
+
script.src = 'https://accounts.google.com/gsi/client';
|
|
611
|
+
script.async = true;
|
|
612
|
+
document.body.appendChild(script);
|
|
613
|
+
window.googleAuthCallback = (authData) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
614
|
+
if (authData === null || authData === void 0 ? void 0 : authData.credential) {
|
|
615
|
+
handleLoginBySocial(authData.credential, 'google');
|
|
616
|
+
}
|
|
617
|
+
else {
|
|
618
|
+
setErrMsg('Google login failed');
|
|
619
|
+
}
|
|
620
|
+
});
|
|
621
|
+
const fbScript = document.createElement('script');
|
|
622
|
+
fbScript.src = 'https://connect.facebook.net/en_US/sdk.js';
|
|
623
|
+
fbScript.async = true;
|
|
624
|
+
document.body.appendChild(fbScript);
|
|
625
|
+
window.fbAsyncInit = function () {
|
|
626
|
+
window.FB.init({
|
|
627
|
+
appId: FacebookAppId,
|
|
628
|
+
cookie: true,
|
|
629
|
+
xfbml: true,
|
|
630
|
+
version: 'v20.0', // Use this Graph API version for this call.
|
|
631
|
+
});
|
|
632
|
+
};
|
|
633
|
+
return () => {
|
|
634
|
+
document.body.removeChild(script);
|
|
635
|
+
document.body.removeChild(fbScript);
|
|
636
|
+
};
|
|
637
|
+
}, []);
|
|
638
|
+
const onClickContinueZalo = () => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
639
|
+
var _f, _g, _h;
|
|
640
|
+
const { areaCode, phoneNumber } = splitPhone(phone);
|
|
641
|
+
const userExist = yield checkUserExist({ phone: phoneNumber });
|
|
642
|
+
if ((userExist === null || userExist === void 0 ? void 0 : userExist._status) === 1) {
|
|
643
|
+
if (((_f = userExist._data) === null || _f === void 0 ? void 0 : _f.is_pass) && ((_g = userExist._data) === null || _g === void 0 ? void 0 : _g.is_status) === 'Active') {
|
|
644
|
+
addStep({
|
|
645
|
+
type: SSOStepTypeType.PASSWORD,
|
|
646
|
+
config: {
|
|
647
|
+
phone,
|
|
648
|
+
},
|
|
649
|
+
});
|
|
650
|
+
}
|
|
651
|
+
else {
|
|
652
|
+
registerBySendZaloOTP(phoneNumber, areaCode);
|
|
653
|
+
addStep({
|
|
654
|
+
type: SSOStepTypeType.OTP,
|
|
655
|
+
config: {
|
|
656
|
+
phone,
|
|
657
|
+
otpType: 'phone-zalo',
|
|
658
|
+
},
|
|
659
|
+
});
|
|
660
|
+
}
|
|
661
|
+
goNext();
|
|
662
|
+
}
|
|
663
|
+
else {
|
|
664
|
+
setErrMsg(((_h = userExist === null || userExist === void 0 ? void 0 : userExist._messages) === null || _h === void 0 ? void 0 : _h[0]) || 'API error');
|
|
665
|
+
}
|
|
666
|
+
});
|
|
667
|
+
const onClickContinuePhone = () => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
668
|
+
var _j, _k, _l;
|
|
669
|
+
const { areaCode, phoneNumber } = splitPhone(phone);
|
|
670
|
+
const userExist = yield checkUserExist({ phone: phoneNumber });
|
|
671
|
+
if ((userExist === null || userExist === void 0 ? void 0 : userExist._status) === 1) {
|
|
672
|
+
if (((_j = userExist._data) === null || _j === void 0 ? void 0 : _j.is_pass) && ((_k = userExist._data) === null || _k === void 0 ? void 0 : _k.is_status) === 'Active') {
|
|
673
|
+
addStep({
|
|
674
|
+
type: SSOStepTypeType.PASSWORD,
|
|
675
|
+
config: {
|
|
676
|
+
phone,
|
|
677
|
+
},
|
|
678
|
+
});
|
|
679
|
+
}
|
|
680
|
+
else {
|
|
681
|
+
registerBySendPhoneOTP(phoneNumber, areaCode);
|
|
682
|
+
addStep({
|
|
683
|
+
type: SSOStepTypeType.OTP,
|
|
684
|
+
config: {
|
|
685
|
+
phone,
|
|
686
|
+
otpType: 'phone-sms',
|
|
687
|
+
},
|
|
688
|
+
});
|
|
689
|
+
}
|
|
690
|
+
goNext();
|
|
691
|
+
}
|
|
692
|
+
else {
|
|
693
|
+
setErrMsg(((_l = userExist === null || userExist === void 0 ? void 0 : userExist._messages) === null || _l === void 0 ? void 0 : _l[0]) || 'API error');
|
|
694
|
+
}
|
|
695
|
+
});
|
|
696
|
+
const onClickEmail = () => {
|
|
697
|
+
addStep({
|
|
698
|
+
type: SSOStepTypeType.EMAIL,
|
|
699
|
+
});
|
|
700
|
+
goNext();
|
|
701
|
+
};
|
|
702
|
+
return (React__default["default"].createElement("div", { style: {
|
|
703
|
+
display: hidden ? 'none' : 'flex',
|
|
704
|
+
flexDirection: 'column',
|
|
705
|
+
height: '100%',
|
|
706
|
+
} },
|
|
707
|
+
React__default["default"].createElement(core$1.Stack, { spacing: 8 },
|
|
708
|
+
React__default["default"].createElement(index$3.Text, { size: "s1", weight: "semiBold" }, "Sign in or Sign up"),
|
|
709
|
+
React__default["default"].createElement(index$3.Text, { size: "p4" }, "Continue with your phone number, email or your socials to log in or sign up.")),
|
|
710
|
+
React__default["default"].createElement(core$1.Stack, { mt: 24, spacing: 24 },
|
|
711
|
+
React__default["default"].createElement(core$1.Stack, { spacing: 16 },
|
|
712
|
+
React__default["default"].createElement(index$4.Input.Wrapper, { error: errMsg },
|
|
713
|
+
React__default["default"].createElement(StyledPhone, { defaultCountry: (locale ? utils.MAPPED_LOCALE[locale] || 'VN' : 'VN'), value: phone, onChange: (value) => setPhone(value), isError: !!errMsg, required: true, name: "phone" })),
|
|
714
|
+
React__default["default"].createElement(index$2.Button, { size: "lg", variant: "primary", onClick: onClickContinueZalo }, "Continue with Zalo"),
|
|
715
|
+
React__default["default"].createElement(index$2.Button, { size: "lg", variant: "secondary", onClick: onClickContinuePhone }, "Continue with SMS")),
|
|
716
|
+
React__default["default"].createElement(core$1.Stack, { spacing: 16, align: "center" },
|
|
717
|
+
React__default["default"].createElement(index$3.Text, { size: "p4" }, "Or continue with"),
|
|
718
|
+
React__default["default"].createElement(core$1.Group, { spacing: 24 },
|
|
719
|
+
React__default["default"].createElement("div", { style: {
|
|
720
|
+
position: 'relative',
|
|
721
|
+
width: 48,
|
|
722
|
+
height: 48,
|
|
723
|
+
} },
|
|
724
|
+
React__default["default"].createElement("div", { id: "g_id_onload", "data-client_id": GoogleAuthClientId, "data-context": "signin", "data-ux_mode": "popup", "data-callback": "googleAuthCallback", "data-auto_prompt": "false" }),
|
|
725
|
+
React__default["default"].createElement("div", { className: "g_id_signin", "data-type": "icon", "data-shape": "circle", "data-theme": "outline", "data-text": "signin_with", "data-size": "large", style: {
|
|
726
|
+
transform: 'translate(4px,4px) scale(1.1)',
|
|
727
|
+
} }),
|
|
728
|
+
React__default["default"].createElement(index$2.Button, { variant: "white", style: {
|
|
729
|
+
width: 48,
|
|
730
|
+
height: 48,
|
|
731
|
+
padding: 12,
|
|
732
|
+
background: '#F7F9FC',
|
|
733
|
+
borderRadius: '100%',
|
|
734
|
+
position: 'absolute',
|
|
735
|
+
pointerEvents: 'none',
|
|
736
|
+
top: 0,
|
|
737
|
+
left: 0,
|
|
738
|
+
}, onClick: () => {
|
|
739
|
+
const googleButton = document.querySelector('.g_id_signin');
|
|
740
|
+
googleButton === null || googleButton === void 0 ? void 0 : googleButton.dispatchEvent(new Event('click'));
|
|
741
|
+
} },
|
|
742
|
+
React__default["default"].createElement(Google.Google, { style: { width: 24, height: 24 } }))),
|
|
743
|
+
React__default["default"].createElement(index$2.Button, { variant: "white", style: {
|
|
744
|
+
width: 48,
|
|
745
|
+
height: 48,
|
|
746
|
+
padding: 12,
|
|
747
|
+
background: '#F7F9FC',
|
|
748
|
+
borderRadius: '100%',
|
|
749
|
+
}, onClick: () => {
|
|
750
|
+
window.FB.login(function (response) {
|
|
751
|
+
var _a;
|
|
752
|
+
return tslib_es6.__awaiter(this, void 0, void 0, function* () {
|
|
753
|
+
if ((_a = response === null || response === void 0 ? void 0 : response.authResponse) === null || _a === void 0 ? void 0 : _a.accessToken) {
|
|
754
|
+
handleLoginBySocial(response.authResponse.accessToken, 'facebook');
|
|
755
|
+
}
|
|
756
|
+
else {
|
|
757
|
+
setErrMsg('Facebook login failed');
|
|
758
|
+
}
|
|
759
|
+
});
|
|
760
|
+
}, { scope: 'public_profile,email' });
|
|
761
|
+
} },
|
|
762
|
+
React__default["default"].createElement(Google.Facebook, { style: { width: 24, height: 24 } })),
|
|
763
|
+
React__default["default"].createElement(index$2.Button, { variant: "white", style: {
|
|
764
|
+
width: 48,
|
|
765
|
+
height: 48,
|
|
766
|
+
padding: 12,
|
|
767
|
+
background: '#F7F9FC',
|
|
768
|
+
borderRadius: '100%',
|
|
769
|
+
}, onClick: onClickEmail },
|
|
770
|
+
React__default["default"].createElement(MailIcon, null))))),
|
|
771
|
+
React__default["default"].createElement(core$1.Stack, { spacing: 24, sx: (theme) => ({
|
|
772
|
+
marginTop: 56,
|
|
773
|
+
[theme.fn.smallerThan('sm')]: {
|
|
774
|
+
marginTop: 'auto',
|
|
775
|
+
},
|
|
776
|
+
}) },
|
|
777
|
+
React__default["default"].createElement(index$3.Text, { size: "p4", color: 'blue.6' },
|
|
778
|
+
React__default["default"].createElement(other.Info, { size: 16, color: miscTheme.theme.colors.primaryBase, style: {
|
|
779
|
+
verticalAlign: 'sub',
|
|
780
|
+
} }),
|
|
781
|
+
' ',
|
|
782
|
+
"Why We Need Your Information?"),
|
|
783
|
+
React__default["default"].createElement(index$3.Text, { size: "p5", color: "gray.6" },
|
|
784
|
+
"By tapping continue, I confirm that I have read, understand and agree to the",
|
|
785
|
+
' ',
|
|
786
|
+
React__default["default"].createElement("a", { href: "#privacy", target: "_blank", style: {
|
|
787
|
+
color: '#262626',
|
|
788
|
+
textDecoration: 'underline',
|
|
789
|
+
} }, "Privacy Policy"),
|
|
790
|
+
' ',
|
|
791
|
+
"and the",
|
|
792
|
+
' ',
|
|
793
|
+
React__default["default"].createElement("a", { href: "#tos", target: "_blank", style: {
|
|
794
|
+
color: '#262626',
|
|
795
|
+
textDecoration: 'underline',
|
|
796
|
+
} }, "Terms of Service"),
|
|
797
|
+
' ',
|
|
798
|
+
"of Hello Health Group."))));
|
|
799
|
+
};
|
|
800
|
+
|
|
801
|
+
const SSOOTPScreen = ({ hidden, index: index$1, }) => {
|
|
802
|
+
const { steps, setSteps, addStep, goNext } = useSSOSteps();
|
|
803
|
+
const [otp, setOtp] = React__default["default"].useState('');
|
|
804
|
+
const [error, setError] = React__default["default"].useState('');
|
|
805
|
+
const currentStepIndex = index$1;
|
|
806
|
+
const currentStep = steps[currentStepIndex];
|
|
807
|
+
const { phone, email, otpType, isForgot } = currentStep.config;
|
|
808
|
+
const isEmail = otpType === 'email';
|
|
809
|
+
const sendOTPCode = (checkResend) => {
|
|
810
|
+
if (checkResend && resendTime > 0)
|
|
811
|
+
return;
|
|
812
|
+
// send otp code logic here
|
|
813
|
+
const { areaCode, phoneNumber } = splitPhone(phone);
|
|
814
|
+
if (otpType === 'phone-sms') {
|
|
815
|
+
resendPhoneOTP(phoneNumber, areaCode);
|
|
816
|
+
}
|
|
817
|
+
else if (otpType === 'phone-zalo') {
|
|
818
|
+
resendZaloOTP(phoneNumber, areaCode);
|
|
819
|
+
}
|
|
820
|
+
else if (otpType === 'email') {
|
|
821
|
+
resendEmailOTP(email);
|
|
822
|
+
}
|
|
823
|
+
setupResendTimer();
|
|
824
|
+
};
|
|
825
|
+
const submitOtp = () => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
826
|
+
var _a, _b;
|
|
827
|
+
const { areaCode, phoneNumber } = splitPhone(phone);
|
|
828
|
+
// submit otp code logic here
|
|
829
|
+
let res;
|
|
830
|
+
if (otpType === 'phone-sms') {
|
|
831
|
+
res = yield verifyByPhoneOTP(phoneNumber, areaCode, otp);
|
|
832
|
+
}
|
|
833
|
+
else if (otpType === 'phone-zalo') {
|
|
834
|
+
res = yield verifyByZaloOTP(phoneNumber, areaCode, otp);
|
|
835
|
+
}
|
|
836
|
+
else if (otpType === 'email') {
|
|
837
|
+
res = yield verifyByEmailOTP(email, otp);
|
|
838
|
+
}
|
|
839
|
+
if ((res === null || res === void 0 ? void 0 : res._status) !== 1) {
|
|
840
|
+
setOtp('');
|
|
841
|
+
// log error
|
|
842
|
+
setError(((_a = res._messages) === null || _a === void 0 ? void 0 : _a[0]) || 'API error');
|
|
843
|
+
return;
|
|
844
|
+
}
|
|
845
|
+
miscCookieHelper.setCookie(index.BEARER_TOKEN_COOKIE, (_b = res._data) === null || _b === void 0 ? void 0 : _b.token, {
|
|
846
|
+
domain: window.location.hostname === 'localhost'
|
|
847
|
+
? 'localhost'
|
|
848
|
+
: `.${constantsDomainLocales.domainLocales[process.env.UNIFY_LOCALE || 'vi-VN']}`,
|
|
849
|
+
expires: new Date(res._data.expire_in * 1000).toUTCString(),
|
|
850
|
+
});
|
|
851
|
+
if (isForgot) {
|
|
852
|
+
addStep({
|
|
853
|
+
type: SSOStepTypeType.FORGOT_PASSWORD_SETUP,
|
|
854
|
+
});
|
|
855
|
+
}
|
|
856
|
+
else {
|
|
857
|
+
const userInfo = yield fetchSSOApi('user/profile');
|
|
858
|
+
addStep({
|
|
859
|
+
type: SSOStepTypeType.SETUP_FULL,
|
|
860
|
+
config: {
|
|
861
|
+
userInfo: userInfo,
|
|
862
|
+
disabledEmail: isEmail,
|
|
863
|
+
},
|
|
864
|
+
});
|
|
865
|
+
}
|
|
866
|
+
goNext();
|
|
867
|
+
});
|
|
868
|
+
const swapZaloSms = () => {
|
|
869
|
+
if (isEmail)
|
|
870
|
+
return;
|
|
871
|
+
const { areaCode, phoneNumber } = splitPhone(phone);
|
|
872
|
+
const newType = otpType === 'phone-sms' ? 'phone-zalo' : 'phone-sms';
|
|
873
|
+
if (newType === 'phone-sms') {
|
|
874
|
+
registerBySendPhoneOTP(phoneNumber, areaCode);
|
|
875
|
+
}
|
|
876
|
+
else {
|
|
877
|
+
registerBySendZaloOTP(phoneNumber, areaCode);
|
|
878
|
+
}
|
|
879
|
+
setSteps((s) => s.splice(currentStepIndex, 1, Object.assign(Object.assign({}, currentStep), { config: Object.assign(Object.assign({}, currentStep === null || currentStep === void 0 ? void 0 : currentStep.config), { otpType: newType }) })));
|
|
880
|
+
};
|
|
881
|
+
const [resendTime, setResendTime] = React__default["default"].useState(30);
|
|
882
|
+
const setupResendTimer = () => {
|
|
883
|
+
const countdown = () => {
|
|
884
|
+
setResendTime((t) => {
|
|
885
|
+
if (t - 1 > 0) {
|
|
886
|
+
setTimeout(() => countdown(), 1000);
|
|
887
|
+
}
|
|
888
|
+
return t - 1;
|
|
889
|
+
});
|
|
890
|
+
};
|
|
891
|
+
countdown();
|
|
892
|
+
};
|
|
893
|
+
React.useEffect(() => {
|
|
894
|
+
setupResendTimer();
|
|
895
|
+
}, []);
|
|
896
|
+
return (React__default["default"].createElement("div", { style: {
|
|
897
|
+
display: hidden ? 'none' : 'block',
|
|
898
|
+
} },
|
|
899
|
+
React__default["default"].createElement(core$1.Stack, { spacing: 8 },
|
|
900
|
+
React__default["default"].createElement(index$3.Text, { size: "s1", weight: "semiBold" }, "Verify Phone Number"),
|
|
901
|
+
React__default["default"].createElement(index$3.Text, { size: "p4" }, isEmail ? (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
902
|
+
"Enter the 6-digit OTP sent to your email ",
|
|
903
|
+
React__default["default"].createElement("b", null, email),
|
|
904
|
+
".")) : (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
905
|
+
"Enter the 6-digit OTP sent to the phone number ",
|
|
906
|
+
React__default["default"].createElement("b", null, phone),
|
|
907
|
+
" via",
|
|
908
|
+
' ',
|
|
909
|
+
React__default["default"].createElement("b", null, otpType === 'phone-sms' ? 'SMS' : 'Zalo App'),
|
|
910
|
+
". OTP code will expire in ",
|
|
911
|
+
React__default["default"].createElement("b", null, "10 mins"))))),
|
|
912
|
+
React__default["default"].createElement(core$1.Stack, { mt: 24, spacing: 8 },
|
|
913
|
+
React__default["default"].createElement(index$4.Input.Wrapper, { error: error },
|
|
914
|
+
React__default["default"].createElement(index$4.OTP, { value: otp, onChange: (otp) => setOtp(String(otp)) })),
|
|
915
|
+
React__default["default"].createElement(core$1.Group, { spacing: 8, align: "center", style: {
|
|
916
|
+
height: 40,
|
|
917
|
+
} },
|
|
918
|
+
React__default["default"].createElement(index$3.Text, { size: "p4" }, "Didn\u2019t receive the code?"),
|
|
919
|
+
React__default["default"].createElement(index$3.Text, { size: "s4", color: "blue.6", onClick: () => sendOTPCode(true) },
|
|
920
|
+
"Resend (",
|
|
921
|
+
resendTime,
|
|
922
|
+
")"))),
|
|
923
|
+
React__default["default"].createElement(index$2.Button, { size: "lg", variant: "primary", mt: 12, onClick: submitOtp, fullWidth: true }, "Continue"),
|
|
924
|
+
!isEmail && (React__default["default"].createElement(index$2.Button, { size: "lg", variant: "tertiary", mt: 12, onClick: swapZaloSms, fullWidth: true },
|
|
925
|
+
"Send OTP Code via ",
|
|
926
|
+
otpType === 'phone-sms' ? 'Zalo App' : 'SMS'))));
|
|
927
|
+
};
|
|
928
|
+
|
|
929
|
+
const SSOPasswordScreen = ({ hidden, index, }) => {
|
|
930
|
+
var _a;
|
|
931
|
+
const [errMsg, setErrMsg] = React__default["default"].useState('');
|
|
932
|
+
const { steps, addStep, goNext } = useSSOSteps();
|
|
933
|
+
const resetPassword = () => {
|
|
934
|
+
addStep({
|
|
935
|
+
type: SSOStepTypeType.FORGOT_PASSWORD_PHONE,
|
|
936
|
+
});
|
|
937
|
+
goNext();
|
|
938
|
+
};
|
|
939
|
+
const thisStep = steps[index];
|
|
940
|
+
const phone = (_a = thisStep === null || thisStep === void 0 ? void 0 : thisStep.config) === null || _a === void 0 ? void 0 : _a.phone;
|
|
941
|
+
return (React__default["default"].createElement("form", { style: {
|
|
942
|
+
display: hidden ? 'none' : 'block',
|
|
943
|
+
}, onSubmit: (e) => {
|
|
944
|
+
e.preventDefault();
|
|
945
|
+
const password = e.currentTarget.password.value;
|
|
946
|
+
// call api to login with email and password, if fail then show error
|
|
947
|
+
loginByPhonePassword(phone, password)
|
|
948
|
+
.then((res) => {
|
|
949
|
+
var _a;
|
|
950
|
+
if ((_a = res._messages) === null || _a === void 0 ? void 0 : _a[0]) {
|
|
951
|
+
setErrMsg(res._messages[0]);
|
|
952
|
+
}
|
|
953
|
+
else {
|
|
954
|
+
setErrMsg('api error');
|
|
955
|
+
}
|
|
956
|
+
})
|
|
957
|
+
.catch(() => {
|
|
958
|
+
setErrMsg('api error');
|
|
959
|
+
});
|
|
960
|
+
} },
|
|
961
|
+
React__default["default"].createElement(core$1.Stack, { spacing: 8 },
|
|
962
|
+
React__default["default"].createElement(index$3.Text, { size: "s1", weight: "semiBold" },
|
|
963
|
+
"Welcome back!",
|
|
964
|
+
React__default["default"].createElement("br", null),
|
|
965
|
+
"Enter your password"),
|
|
966
|
+
React__default["default"].createElement(index$3.Text, { size: "p4" }, "\u0110\u0103ng nh\u1EADp b\u1EB1ng m\u1EADt kh\u1EA9u c\u1EE7a b\u1EA1n.")),
|
|
967
|
+
React__default["default"].createElement(core$1.Stack, { mt: 24, spacing: 8 },
|
|
968
|
+
React__default["default"].createElement(index$4.PasswordInput, { name: "password", placeholder: "Nh\u1EADp m\u1EADt kh\u1EA9u", error: errMsg || undefined }),
|
|
969
|
+
React__default["default"].createElement(core$1.Group, { spacing: 8, align: "center", style: {
|
|
970
|
+
height: 40,
|
|
971
|
+
} },
|
|
972
|
+
React__default["default"].createElement(index$3.Text, { size: "p4" }, "Forgot Password?"),
|
|
973
|
+
React__default["default"].createElement(index$3.Text, { size: "s4", color: "blue.6", style: {
|
|
974
|
+
cursor: 'pointer',
|
|
975
|
+
}, onClick: resetPassword }, "Reset"))),
|
|
976
|
+
React__default["default"].createElement(index$2.Button, { type: "submit", size: "lg", variant: "primary", mt: 12, fullWidth: true }, "Sign In")));
|
|
977
|
+
};
|
|
978
|
+
|
|
979
|
+
const SSOPasswordForgotPhone = ({ hidden, }) => {
|
|
980
|
+
const [phone, setPhone] = React__default["default"].useState('');
|
|
981
|
+
const [errMsg, setErrMsg] = React__default["default"].useState('');
|
|
982
|
+
const { locale } = useSSOState();
|
|
983
|
+
const { addStep, goNext } = useSSOSteps();
|
|
984
|
+
const onClickContinueZalo = () => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
985
|
+
var _a;
|
|
986
|
+
const { areaCode, phoneNumber } = splitPhone(phone);
|
|
987
|
+
const userExist = yield checkUserExist({ phone: phoneNumber });
|
|
988
|
+
if ((userExist === null || userExist === void 0 ? void 0 : userExist._status) === 1) {
|
|
989
|
+
resendZaloOTP(phoneNumber, areaCode);
|
|
990
|
+
addStep({
|
|
991
|
+
type: SSOStepTypeType.OTP,
|
|
992
|
+
config: {
|
|
993
|
+
phone,
|
|
994
|
+
otpType: 'phone-zalo',
|
|
995
|
+
isForgot: true,
|
|
996
|
+
},
|
|
997
|
+
});
|
|
998
|
+
goNext();
|
|
999
|
+
}
|
|
1000
|
+
else {
|
|
1001
|
+
setErrMsg(((_a = userExist === null || userExist === void 0 ? void 0 : userExist._messages) === null || _a === void 0 ? void 0 : _a[0]) || 'API error');
|
|
1002
|
+
}
|
|
1003
|
+
});
|
|
1004
|
+
const onClickContinuePhone = () => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
1005
|
+
var _b;
|
|
1006
|
+
const { areaCode, phoneNumber } = splitPhone(phone);
|
|
1007
|
+
const userExist = yield checkUserExist({ phone: phoneNumber });
|
|
1008
|
+
if ((userExist === null || userExist === void 0 ? void 0 : userExist._status) === 1) {
|
|
1009
|
+
registerBySendPhoneOTP(phoneNumber, areaCode);
|
|
1010
|
+
addStep({
|
|
1011
|
+
type: SSOStepTypeType.OTP,
|
|
1012
|
+
config: {
|
|
1013
|
+
phone,
|
|
1014
|
+
otpType: 'phone-sms',
|
|
1015
|
+
isForgot: true,
|
|
1016
|
+
},
|
|
1017
|
+
});
|
|
1018
|
+
goNext();
|
|
1019
|
+
}
|
|
1020
|
+
else {
|
|
1021
|
+
setErrMsg(((_b = userExist === null || userExist === void 0 ? void 0 : userExist._messages) === null || _b === void 0 ? void 0 : _b[0]) || 'API error');
|
|
1022
|
+
}
|
|
1023
|
+
});
|
|
1024
|
+
return (React__default["default"].createElement("div", { style: {
|
|
1025
|
+
display: hidden ? 'none' : 'block',
|
|
1026
|
+
} },
|
|
1027
|
+
React__default["default"].createElement(core$1.Stack, { spacing: 8 },
|
|
1028
|
+
React__default["default"].createElement(index$3.Text, { size: "s1", weight: "semiBold" }, "Reset password"),
|
|
1029
|
+
React__default["default"].createElement(index$3.Text, { size: "p4" }, "Please provide the phone number you used to create your account.")),
|
|
1030
|
+
React__default["default"].createElement(core$1.Stack, { mt: 24, spacing: 16 },
|
|
1031
|
+
React__default["default"].createElement(StyledPhone, { defaultCountry: (locale ? utils.MAPPED_LOCALE[locale] || 'VN' : 'VN'), value: phone, onChange: (value) => setPhone(value), isError: !!errMsg, required: true }),
|
|
1032
|
+
errMsg && (React__default["default"].createElement(index$3.Text, { size: "label2", color: "red.6", mt: -12 }, errMsg)),
|
|
1033
|
+
React__default["default"].createElement(index$2.Button, { size: "lg", variant: "primary", onClick: onClickContinueZalo }, "Continue with Zalo"),
|
|
1034
|
+
React__default["default"].createElement(index$2.Button, { size: "lg", variant: "secondary", onClick: onClickContinuePhone }, "Continue with SMS"))));
|
|
1035
|
+
};
|
|
1036
|
+
|
|
1037
|
+
const BackgroundHeader = () => (React__default["default"].createElement("svg", { width: "292", height: "255", viewBox: "0 0 292 255", fill: "none", xmlns: "http://www.w3.org/2000/svg", style: {
|
|
1038
|
+
position: 'absolute',
|
|
1039
|
+
top: 0,
|
|
1040
|
+
left: '50%',
|
|
1041
|
+
zIndex: 0,
|
|
1042
|
+
transform: 'translateX(-50%)',
|
|
1043
|
+
pointerEvents: 'none',
|
|
1044
|
+
} },
|
|
1045
|
+
React__default["default"].createElement("circle", { opacity: ".2", cx: "146", cy: "109", r: "146", fill: "url(#paint0_linear_908_34610)" }),
|
|
1046
|
+
React__default["default"].createElement("circle", { opacity: ".3", cx: "146", cy: "109", r: "85", fill: "url(#paint1_linear_908_34610)" }),
|
|
1047
|
+
React__default["default"].createElement("circle", { cx: "146.5", cy: "108.5", r: "47.5", fill: "url(#paint2_linear_908_34610)" }),
|
|
1048
|
+
React__default["default"].createElement("circle", { cx: "146.5", cy: "108.5", r: "47", stroke: "url(#paint3_linear_908_34610)" }),
|
|
1049
|
+
React__default["default"].createElement("path", { d: "M163.327 94.716c-.522-3.187-7.981-5.714-17.11-5.714s-16.589 2.527-17.111 5.714h-.032v26.428h.032c.522 3.186 7.982 5.714 17.111 5.714 9.128 0 16.588-2.528 17.11-5.714h.032V94.716z", fill: "#545E73" }),
|
|
1050
|
+
React__default["default"].createElement("path", { d: "M146.217 118.286c-9.468 0-17.143-2.718-17.143-6.071v8.928h.032c.522 3.187 7.982 5.714 17.111 5.714 9.128 0 16.588-2.527 17.11-5.714h.032v-8.928c0 3.353-7.675 6.071-17.142 6.071", fill: "#2B62CD" }),
|
|
1051
|
+
React__default["default"].createElement("path", { d: "M129.074 111.859v.358q.002-.18.032-.358zm34.25 0q.031.178.032.358v-.358z", fill: "#38454F" }),
|
|
1052
|
+
React__default["default"].createElement("path", { d: "M146.217 109.714c-9.468 0-17.143-2.719-17.143-6.071v8.928h.032c.522 3.186 7.982 5.714 17.111 5.714 9.128 0 16.588-2.528 17.11-5.714h.032v-8.928c0 3.352-7.675 6.071-17.142 6.071", fill: "#2D87F3" }),
|
|
1053
|
+
React__default["default"].createElement("path", { d: "M129.074 103.287v.357q.002-.18.032-.357zm34.25 0q.031.178.032.357v-.357z", fill: "#556080" }),
|
|
1054
|
+
React__default["default"].createElement("path", { d: "M146.217 101.145c9.467 0 17.142-2.719 17.142-6.072s-7.675-6.071-17.142-6.071c-9.468 0-17.143 2.718-17.143 6.071s7.675 6.072 17.143 6.072", fill: "#91CAFF" }),
|
|
1055
|
+
React__default["default"].createElement("path", { d: "M146.217 101.144c-9.468 0-17.143-2.719-17.143-6.072v8.929h.032c.522 3.186 7.982 5.714 17.111 5.714 9.128 0 16.588-2.528 17.11-5.714h.032v-8.929c0 3.353-7.675 6.072-17.142 6.072", fill: "#45A4FF" }),
|
|
1056
|
+
React__default["default"].createElement("path", { d: "M129.074 94.717v.357q.002-.18.032-.357zm34.25 0q.031.177.032.357v-.357z", fill: "#8697CB" }),
|
|
1057
|
+
React__default["default"].createElement("path", { d: "M156.36 129.002a8.57 8.57 0 0 0 8.571-8.571 8.571 8.571 0 1 0-8.571 8.571", fill: "#00B16A" }),
|
|
1058
|
+
React__default["default"].createElement("path", { d: "M161.054 116.273a.714.714 0 0 0-.995.178l-3.997 5.743-2.82-2.316a.714.714 0 0 0-.906 1.105l3.418 2.806a.72.72 0 0 0 1.04-.144l4.438-6.377a.716.716 0 0 0-.178-.995", fill: "#fff" }),
|
|
1059
|
+
React__default["default"].createElement("defs", null,
|
|
1060
|
+
React__default["default"].createElement("linearGradient", { id: "paint0_linear_908_34610", x1: "147.5", y1: "141", x2: "36.5", y2: "30", gradientUnits: "userSpaceOnUse" },
|
|
1061
|
+
React__default["default"].createElement("stop", { stopColor: "#fff", stopOpacity: "0" }),
|
|
1062
|
+
React__default["default"].createElement("stop", { offset: "1", stopColor: "#fff" })),
|
|
1063
|
+
React__default["default"].createElement("linearGradient", { id: "paint1_linear_908_34610", x1: "218.376", y1: "63.134", x2: "61", y2: "109", gradientUnits: "userSpaceOnUse" },
|
|
1064
|
+
React__default["default"].createElement("stop", { stopColor: "#fff" }),
|
|
1065
|
+
React__default["default"].createElement("stop", { offset: "1", stopColor: "#fff", stopOpacity: "0" })),
|
|
1066
|
+
React__default["default"].createElement("linearGradient", { id: "paint2_linear_908_34610", x1: "146.5", y1: "61", x2: "146.5", y2: "156", gradientUnits: "userSpaceOnUse" },
|
|
1067
|
+
React__default["default"].createElement("stop", { stopColor: "#fff", stopOpacity: ".6" }),
|
|
1068
|
+
React__default["default"].createElement("stop", { offset: "1", stopColor: "#fff", stopOpacity: "0" })),
|
|
1069
|
+
React__default["default"].createElement("linearGradient", { id: "paint3_linear_908_34610", x1: "178.979", y1: "98.35", x2: "108.338", y2: "98.35", gradientUnits: "userSpaceOnUse" },
|
|
1070
|
+
React__default["default"].createElement("stop", { stopColor: "#fff", stopOpacity: "0" }),
|
|
1071
|
+
React__default["default"].createElement("stop", { offset: "1", stopColor: "#fff" })))));
|
|
1072
|
+
|
|
1073
|
+
const CustomerSupportIcon = () => {
|
|
1074
|
+
return (React__default["default"].createElement("svg", { width: "32", height: "32", viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
1075
|
+
React__default["default"].createElement("g", { clipPath: "url(#clip0_911_24123)" },
|
|
1076
|
+
React__default["default"].createElement("path", { d: "M23.3 16.625c-.042-1.1.166-4.401.166-4.401.073-.27.15-.594.205-.854C25.33 3.783 20.246.75 16 .75c-1.133 0-2.488.413-3.13 1.203a.82.82 0 0 1-.503.307c-2.862.46-4.742 4.183-4.062 8.77q.087.586.23 1.19v.002c.183 1.009.231 3.303.165 4.403-.271 4.482-5.173 8.453-1.985 11.608 8.41 1.974 10.202 2.142 18.57 0 3.187-3.155-1.81-7.122-1.985-11.608", fill: "#9B4E4E" }),
|
|
1077
|
+
React__default["default"].createElement("path", { d: "M24.675 14.972a3.2 3.2 0 0 0-.64-.718.25.25 0 1 0-.302.399q.308.261.53.6a1.41 1.41 0 0 1 .177 1.562c-.465.892-1.84 1.63-3.614 2.043q.139.221.264.451c1.85-.457 3.275-1.267 3.794-2.263a1.89 1.89 0 0 0-.21-2.074", fill: "#473049" }),
|
|
1078
|
+
React__default["default"].createElement("path", { d: "M18.545 22.798c-.35.41-2.09 4.555-2.535 5.29-.448-.735-2.198-4.89-2.545-5.3.351-.358.597-.808.707-1.297q.096-.405.115-.82c.365.137 3.063.134 3.428-.003v.003q.018.4.11.79c.107.505.357.969.72 1.337", fill: "#FF977B" }),
|
|
1079
|
+
React__default["default"].createElement("path", { d: "M17.824 21.46a3.39 3.39 0 0 1-3.652.03q.095-.404.115-.82c.365.138 3.062.135 3.427-.002v.003q.018.4.11.79", fill: "#FF7364" }),
|
|
1080
|
+
React__default["default"].createElement("path", { d: "M25.284 28.233c.153.66-.362 1.082-1.08 1.472-.917.5-3.717 1.55-8.205 1.55s-7.287-1.05-8.205-1.55c-.717-.39-1.232-.812-1.08-1.472.048-.187.126-.365.233-.525.535-.84 1.567-2.198 4.2-3.598q.335-.174.692-.33c.075 1.013 2.985.21 2.985.21a.96.96 0 0 1 .57.835c.038.888.168 2.528.615 3.263.445-.735.575-2.375.613-3.263a.96.96 0 0 1 .57-.835s2.907.81 2.985-.202q.347.151.675.322c2.632 1.4 3.665 2.758 4.2 3.598.107.16.185.338.232.525", fill: "#F9E0B4" }),
|
|
1081
|
+
React__default["default"].createElement("path", { d: "M22.317 12.023c.359-.006.715.05 1.055.165.785.282 1.33.962 1.2 2.3-.105 1.1-.647 1.752-1.317 2.03-.461.188-.97.217-1.45.085.277-.97.555-3.88.512-4.58m-12.124 4.579a2.26 2.26 0 0 1-1.448-.082c-.672-.28-1.215-.93-1.322-2.033-.123-1.287.375-1.965 1.112-2.265a3 3 0 0 1 1.145-.2c-.042.7.235 3.61.513 4.58", fill: "#4B3956" }),
|
|
1082
|
+
React__default["default"].createElement("path", { d: "M22.319 12.021c.04.7-.235 3.61-.513 4.581-.285.996-1.532 3.582-5.285 4.418a2.4 2.4 0 0 1-1.044 0c-3.752-.836-5-3.422-5.284-4.418-.278-.97-.554-3.88-.513-4.58 1.219-.669.668-2.955 1.56-5.057.556-1.307 1.305-1.644 1.722-1.727a.9.9 0 0 0 .533-.338c1.6-2.056 4.794-.95 5.966 1.225 1.066 1.977 1.225 4.918 2.858 5.896", fill: "#FFB497" }),
|
|
1083
|
+
React__default["default"].createElement("path", { d: "M20.13 23.118c.067.217.083.446.048.67-.077 1.012-.52 2.735-1.227 2.542-1.018-.277-1.758-2.34-1.758-2.34.518-.23 1.003-.782 1.353-1.192q.068-.086.132-.16a.463.463 0 0 1 .625-.103c.295.153.683.345.828.583m-5.306.872s-.74 2.063-1.758 2.34c-.71.193-1.152-1.537-1.227-2.55a1.5 1.5 0 0 1 .047-.662c.145-.238.533-.43.828-.583a.463.463 0 0 1 .625.103l.125.15c.347.41.837.972 1.36 1.202", fill: "#F7F0DF" }),
|
|
1084
|
+
React__default["default"].createElement("path", { d: "M14.94 16.018a.306.306 0 0 0-.3.385 1.414 1.414 0 0 0 2.72 0 .307.307 0 0 0-.3-.385z", fill: "#fff" }),
|
|
1085
|
+
React__default["default"].createElement("path", { d: "M12.776 11.492h-.05a.676.676 0 0 0-.675.676v.541c0 .374.302.676.676.676h.049a.676.676 0 0 0 .676-.676v-.54a.676.676 0 0 0-.676-.677m6.448 1.893h.05a.676.676 0 0 0 .675-.676v-.541a.676.676 0 0 0-.676-.676h-.049a.676.676 0 0 0-.676.675v.542c0 .373.303.676.676.676", fill: "#9B4E4E" }),
|
|
1086
|
+
React__default["default"].createElement("path", { d: "M16.017 29.117h-.034a.47.47 0 0 0-.471.472v.034c0 .26.21.471.471.471h.034c.26 0 .472-.21.472-.471v-.034a.47.47 0 0 0-.472-.472", fill: "#fff" }),
|
|
1087
|
+
React__default["default"].createElement("path", { d: "M16.003 15.2c-.008 0-.69-.01-.69-.402a.25.25 0 0 1 .455-.142 1 1 0 0 0 .235.044.8.8 0 0 0 .229-.044.25.25 0 0 1 .456.142c0 .391-.679.402-.685.402", fill: "#FF7364" }),
|
|
1088
|
+
React__default["default"].createElement("path", { d: "M11.532 12.095a.25.25 0 0 1-.225-.36 1.62 1.62 0 0 1 1.338-.752c.396-.017.782.124 1.075.39a.25.25 0 1 1-.333.374 1 1 0 0 0-.742-.264 1.14 1.14 0 0 0-.888.473.25.25 0 0 1-.225.14m-.451-1.716a.25.25 0 0 1-.175-.43c.606-.587 2.632-.888 3.235-.48a.25.25 0 0 1-.281.415c-.37-.253-2.149-.02-2.606.425a.25.25 0 0 1-.173.07m9.387 1.715a.25.25 0 0 1-.226-.14 1.14 1.14 0 0 0-.887-.472 1 1 0 0 0-.742.264.25.25 0 1 1-.332-.373c.293-.267.68-.408 1.075-.391a1.62 1.62 0 0 1 1.337.752.25.25 0 0 1-.225.36m.452-1.715a.25.25 0 0 1-.174-.07c-.457-.444-2.235-.677-2.605-.426a.25.25 0 0 1-.281-.414c.603-.408 2.628-.108 3.234.48a.25.25 0 0 1-.175.43zm2.71 1.175c-.135-.78-.492-2.643-2.005-5.64-.06-.125-.092-.258.005-.355a.254.254 0 0 1 .355.005c.795.817 1.67 2.882 1.9 4.565zM10.163 6.313c-.015.025-1.525 2.925-1.83 4.89l-.028-.173q-.1-.658-.127-1.322C8.54 7.94 9.673 6.16 9.73 6.063a.25.25 0 0 1 .34-.093.25.25 0 0 1 .093.343", fill: "#844040" }),
|
|
1089
|
+
React__default["default"].createElement("path", { d: "M23.29 17.917c-1.345.813-3.559 1.331-5.908 1.3a.254.254 0 0 0-.253.247.25.25 0 0 0 .246.253l.23.002c2.522 0 4.831-.603 6.2-1.543a23 23 0 0 1-.516-.259", fill: "#473049" }),
|
|
1090
|
+
React__default["default"].createElement("path", { d: "M16.138 20.42c.686 0 1.241-.426 1.241-.952s-.555-.952-1.241-.952-1.242.426-1.242.952.556.952 1.242.952", fill: "#4B3956" })),
|
|
1091
|
+
React__default["default"].createElement("defs", null,
|
|
1092
|
+
React__default["default"].createElement("clipPath", { id: "clip0_911_24123" },
|
|
1093
|
+
React__default["default"].createElement("path", { fill: "#fff", d: "M0 0h32v32H0z" })))));
|
|
1094
|
+
};
|
|
1095
|
+
|
|
1096
|
+
const HealthUpdateIcon = () => {
|
|
1097
|
+
return (React__default["default"].createElement("svg", { width: "32", height: "32", viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
1098
|
+
React__default["default"].createElement("path", { d: "M20.69 3.066 4.714 5.456a1.714 1.714 0 0 0-1.442 1.95l3.01 20.106a1.714 1.714 0 0 0 1.948 1.442l15.975-2.39a1.714 1.714 0 0 0 1.441-1.95L22.638 4.507a1.714 1.714 0 0 0-1.949-1.441", fill: "#1B89E5" }),
|
|
1099
|
+
React__default["default"].createElement("path", { d: "m4.488 5.49 16.427-2.458 3.13 20.914-16.427 2.458z", fill: "#fff" }),
|
|
1100
|
+
React__default["default"].createElement("path", { d: "m13.559 8.067-.567.084a.83.83 0 0 0-.696.942l.02.141a.18.18 0 0 1-.15.203l-.14.021a.83.83 0 0 0-.697.942l.085.568a.83.83 0 0 0 .942.696l.141-.021a.18.18 0 0 1 .203.15l.022.14a.83.83 0 0 0 .942.697l.566-.085a.83.83 0 0 0 .697-.941l-.021-.142a.18.18 0 0 1 .15-.203l.141-.021a.83.83 0 0 0 .697-.943l-.085-.565a.83.83 0 0 0-.942-.697l-.142.022a.18.18 0 0 1-.203-.15l-.02-.142a.83.83 0 0 0-.943-.696m6.553 5.392-9.31 1.393a.32.32 0 0 0 .094.634l9.31-1.393a.32.32 0 1 0-.095-.634m.299 2.303L8.74 17.508a.32.32 0 0 0 .096.634l11.67-1.746a.32.32 0 0 0-.096-.634m-.591 2.436L9.039 19.81a.32.32 0 1 0 .095.634l10.78-1.613a.32.32 0 0 0-.095-.634m-1.084 2.51-9.397 1.406a.32.32 0 0 0 .095.634l9.397-1.407a.32.32 0 1 0-.095-.633m2.318-.347-.828.124a.32.32 0 0 0 .095.634l.828-.124a.32.32 0 0 0-.095-.634", fill: "#78C5EF" }),
|
|
1101
|
+
React__default["default"].createElement("path", { d: "m27.358 4.303-.805-.273a1.26 1.26 0 0 0-1.596.789l-4.406 13.013.494 2.544a.442.442 0 0 0 .728.246l1.937-1.72 2.61-7.71.224.075a.583.583 0 0 0 .739-.365l1.357-4.007a2.045 2.045 0 0 0-1.282-2.592", fill: "#36B1F2" }),
|
|
1102
|
+
React__default["default"].createElement("path", { d: "M26.32 11.443a.25.25 0 0 1-.236-.33l1.614-4.768a.25.25 0 1 1 .474.16l-1.615 4.768a.25.25 0 0 1-.237.17", fill: "#1B89E5" }),
|
|
1103
|
+
React__default["default"].createElement("path", { d: "M17.67 5.535 8.324 6.934a1.15 1.15 0 0 1-1.307-.967l-.098-.654a.44.44 0 0 1 .368-.497l10.754-1.61a.437.437 0 0 1 .498.368l.097.654a1.15 1.15 0 0 1-.967 1.307z", fill: "#3C3854" })));
|
|
1104
|
+
};
|
|
1105
|
+
|
|
1106
|
+
const PersonalizeIcon = () => {
|
|
1107
|
+
return (React__default["default"].createElement("svg", { width: "32", height: "32", viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
1108
|
+
React__default["default"].createElement("path", { d: "M31.364 22.343a5 5 0 0 0-1.713-1.477c-.847-.488-1.52-.816-1.638-1.931h-1.761c-.12 1.115-.797 1.443-1.644 1.931a5 5 0 0 0-1.712 1.477c-.33.438-.095.709.331.936.723.386 2.4.827 3.903.827 1.502 0 3.18-.441 3.902-.827.426-.227.662-.498.332-.936", fill: "#F78181" }),
|
|
1109
|
+
React__default["default"].createElement("path", { d: "M21.765 14c-.006-3.907-4.11-7.388-7.666-4.77a.4.4 0 0 1-.129.065c-.958.303-1.65 1.213-2.108 2.305-1.408 3.347.2 7.77-.291 11.538h9.938c-.185-2.536.26-6.777.256-9.138", fill: "#FF6671" }),
|
|
1110
|
+
React__default["default"].createElement("path", { d: "M5.354 9.745c-3.033 0-5.268 3.012-4.76 6.07.424 2.568 3.008 2.747 3.008 2.747l3.5-.003s2.586-.175 3.012-2.743c.507-3.06-1.728-6.07-4.76-6.07", fill: "#3A417C" }),
|
|
1111
|
+
React__default["default"].createElement("path", { d: "M9.073 22.755c-.688.367-2.288.79-3.72.79s-3.03-.423-3.72-.79c-.408-.218-.63-.475-.318-.893.43-.588.99-1.07 1.635-1.407.205-.118.393-.203.563-.283h.002c.503-.235.843-.415.928-1.207h1.822c.085.797.428.975.935 1.21.17.08.355.165.558.28.644.339 1.202.82 1.632 1.407.315.418.09.675-.317.893", fill: "#BF6666" }),
|
|
1112
|
+
React__default["default"].createElement("path", { d: "M31.332 22.342a5.04 5.04 0 0 0-1.712-1.477 9 9 0 0 1-.815-.498 3.43 3.43 0 0 1-3.373-.005c-.245.178-.547.325-.855.503a5 5 0 0 0-1.712 1.477c-.33.44-.095.71.33.938.722.385 2.4.827 3.902.827s3.18-.442 3.903-.827c.427-.228.662-.498.332-.938", fill: "#3A417C" }),
|
|
1113
|
+
React__default["default"].createElement("path", { d: "M28.232 9.496c-1.05-.28-3.25-.14-3.708 1.205a.46.46 0 0 1-.18.24c-1.035.682-1.353 1.643-.862 3.845h7.298c.738-4.148-1.278-4.95-2.548-5.29", fill: "#FFB45A" }),
|
|
1114
|
+
React__default["default"].createElement("path", { d: "M8.402 14.623a.51.51 0 0 1 .229.432 5.9 5.9 0 0 1-.278 1.793c-.262.697-.942 1.882-2.245 2.152a4 4 0 0 1-.757.09 4 4 0 0 1-.76-.09c-1.303-.27-1.98-1.455-2.243-2.152a5.9 5.9 0 0 1-.278-1.793.51.51 0 0 1 .229-.432c.99-.668 2.339-.862 3.052-.86.71-.002 2.06.192 3.051.86", fill: "#CE7A7A" }),
|
|
1115
|
+
React__default["default"].createElement("path", { d: "M30.781 14.786a1.2 1.2 0 0 0-.469-.053.45.45 0 0 1-.225-.04c-.956-.438-.852-1.208-.955-1.723-.407-2.036-2.745-1.94-3.408-1.24a.36.36 0 0 1-.19.11c-.87.175-1.371 1.948-1.469 2.68a.24.24 0 0 1-.232.209q-.18 0-.35.057c-.448.157-.572.675-.392 1.157a1.03 1.03 0 0 0 .948.725.255.255 0 0 1 .267.175 3.31 3.31 0 0 0 1.945 2.092 2.13 2.13 0 0 0 1.762 0 3.3 3.3 0 0 0 1.945-2.092.254.254 0 0 1 .267-.175 1.03 1.03 0 0 0 .947-.725c.181-.482.056-1-.391-1.157m-9.271 8.351a5.9 5.9 0 0 0-2.012-1.734c-.995-.573-1.723-.494-1.863-1.803l-2.213-.01c-.14 1.31-.844 1.24-1.839 1.814a5.9 5.9 0 0 0-2.011 1.734c-.388.515-.112.833.389 1.1.849.453 2.82.972 4.584.972s3.726-.519 4.575-.972c.5-.268.777-.586.39-1.1", fill: "#FF9797" }),
|
|
1116
|
+
React__default["default"].createElement("path", { d: "M21.51 23.137a5.9 5.9 0 0 0-2.012-1.734c-.995-.573-1.723-.494-1.863-1.803l-2.213-.01c-.14 1.31-.844 1.24-1.839 1.814a5.9 5.9 0 0 0-2.011 1.734c-.388.515-.112.833.389 1.1.849.453 2.82.972 4.584.972s3.726-.519 4.575-.972c.5-.268.777-.586.39-1.1", fill: "#FF9797" }),
|
|
1117
|
+
React__default["default"].createElement("path", { d: "M18.682 13.703a3.32 3.32 0 0 1 1.206 3.398 3.63 3.63 0 0 1-2.229 2.489 3.5 3.5 0 0 1-1.118.213 3.5 3.5 0 0 1-1.12-.213 3.63 3.63 0 0 1-2.228-2.49 8.5 8.5 0 0 1-.284-2.55c.137-2.045.975-3.52 2.095-3.245a.25.25 0 0 0 .182-.023c1.377-.755 1.672 1.03 3.496 2.421", fill: "#FFAEAE" }),
|
|
1118
|
+
React__default["default"].createElement("path", { d: "M21.12 24.238c-.85.452-2.81.972-4.575.972s-3.735-.52-4.585-.972c-.5-.268-.777-.585-.387-1.1a5.65 5.65 0 0 1 1.735-1.573 6.03 6.03 0 0 0 3.232.788 6.1 6.1 0 0 0 3.253-.775 5.7 5.7 0 0 1 1.717 1.56c.388.515.11.832-.39 1.1", fill: "#5C8EFF" }),
|
|
1119
|
+
React__default["default"].createElement("path", { d: "M9.073 22.755c-.688.368-2.288.79-3.72.79s-3.03-.422-3.72-.79c-.408-.217-.63-.475-.318-.892.43-.588.99-1.07 1.635-1.408.205-.117.393-.202.563-.282h.002c.557.318 1.192.47 1.833.44a3.47 3.47 0 0 0 1.852-.438c.17.08.355.165.558.28a4.8 4.8 0 0 1 1.632 1.408c.315.417.09.675-.317.892", fill: "#4856B5" })));
|
|
1120
|
+
};
|
|
1121
|
+
|
|
1122
|
+
const SecurityIcon = () => {
|
|
1123
|
+
return (React__default["default"].createElement("svg", { width: "32", height: "32", viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
1124
|
+
React__default["default"].createElement("path", { d: "M16 29.625c1.196 0 2.348-.639 3.327-1.31 5.423-3.715 6.606-5.558 6.995-6.163.436-.68 1.533-2.23 2.73-12.356.33-2.804-1.143-5.19-3.893-6.066a31.65 31.65 0 0 0-18.319 0c-2.75.874-4.222 3.262-3.892 6.067 1.196 10.125 2.293 11.674 2.73 12.355.388.605 1.572 2.448 6.994 6.163.98.671 2.13 1.31 3.328 1.31", fill: "#9DBA22" }),
|
|
1125
|
+
React__default["default"].createElement("path", { d: "M25.142 7.18c-2.902-1.307-6.095-1.645-9.143-1.645s-6.241.338-9.143 1.645c-.7.316-1.115.77-1.04 1.365.382 3.052 1.583 11.235 2.192 12.128 1.21 1.777 5.533 4.67 7.267 5.788a1.37 1.37 0 0 0 1.448 0c1.733-1.119 6.056-4.011 7.267-5.788.609-.893 1.81-9.075 2.193-12.128.074-.595-.34-1.049-1.041-1.365", fill: "#BFDF46" }),
|
|
1126
|
+
React__default["default"].createElement("path", { d: "M15.798 19.264c-1.522-.418-2.486-1.494-2.992-3.333a9.2 9.2 0 0 1-.177-4.156c.109-.644.715-1.192 1.434-.802q1.159.616 2.377 1.102c2.909 1.205 3.817 4.07 2.732 5.783-.578.912-1.922 1.806-3.375 1.406", fill: "#fff" }),
|
|
1127
|
+
React__default["default"].createElement("path", { d: "M20.667 20.13a.3.3 0 0 1-.095-.015c-2.152-.684-4.24-2.662-4.838-4.08a.313.313 0 0 1 .508-.35q.045.045.067.106c.461 1.092 2.311 3.048 4.451 3.728a.313.313 0 0 1-.094.61", fill: "#9DBA22" })));
|
|
1128
|
+
};
|
|
1129
|
+
|
|
1130
|
+
const ServiceIcon = () => {
|
|
1131
|
+
return (React__default["default"].createElement("svg", { width: "32", height: "32", viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
1132
|
+
React__default["default"].createElement("g", { clipPath: "url(#clip0_911_3434)" },
|
|
1133
|
+
React__default["default"].createElement("path", { d: "M30.466 17.553c.714-.548.988-1.39.611-1.881s-1.261-.444-1.975.104c-.714.549-.988 1.391-.611 1.882s1.261.444 1.975-.105", fill: "#563960" }),
|
|
1134
|
+
React__default["default"].createElement("path", { d: "M30.122 7.72a2.2 2.2 0 0 1-.438.37 2.355 2.355 0 0 1-2.787-3.79l.022-.017a2.356 2.356 0 0 1 3.203 3.437", fill: "#E8E2E2" }),
|
|
1135
|
+
React__default["default"].createElement("path", { d: "M16.474 3.996c-.544-.568-1.058-1.45-1.082-2.29l-1.395.7a1.394 1.394 0 1 0 1.247 2.491l1.159-.583.259-.14a3 3 0 0 1-.188-.178", fill: "#E5395E" }),
|
|
1136
|
+
React__default["default"].createElement("path", { d: "M18.934 2.175a1.39 1.39 0 0 1-.77 1.246l-1.472.738-.256.138a2.52 2.52 0 0 1-1.189-1.331 2 2 0 0 1-.042-1.165l.353-.191 1.358-.68a1.392 1.392 0 0 1 2.018 1.245", fill: "#F9AF2B" }),
|
|
1137
|
+
React__default["default"].createElement("path", { d: "M5.507 6.695c-.407.705-1.475.86-2.425.362L2.975 7a3 3 0 0 1-.358-.248c.005-.012 1.05-.635 1.355-1.157.258-.44.25-1.335.268-1.38q.136.058.265.132.132.078.257.168c.795.585 1.128 1.515.745 2.18", fill: "#F44A52" }),
|
|
1138
|
+
React__default["default"].createElement("path", { d: "M4.343 5.848a2.9 2.9 0 0 1-1.285 1.197L2.976 7a2.6 2.6 0 0 1-.398-.28c-.692-.587-.965-1.442-.605-2.067.378-.655 1.323-.833 2.215-.463a3 3 0 0 1 .51.28c.029.485-.095.967-.355 1.378", fill: "#E8E2E2" }),
|
|
1139
|
+
React__default["default"].createElement("path", { d: "M1.87 17.24a1.12 1.12 0 1 0 0-2.24 1.12 1.12 0 0 0 0 2.24", fill: "#F9AF2B" }),
|
|
1140
|
+
React__default["default"].createElement("path", { d: "M30.123 7.72a2.2 2.2 0 0 1-.437.37c0-1.013-1.5-3.058-3.153-3.418q.162-.206.365-.372l.023-.018c1.65.45 3.052 2.16 3.202 3.438", fill: "#C3C7C9" }),
|
|
1141
|
+
React__default["default"].createElement("path", { d: "M25.295 17.4v9.637c0 2.13-1.745 3.225-3.855 3.518-2.707.375-8.128.375-10.835 0-2.11-.29-3.855-1.387-3.855-3.517v-9.637a3.86 3.86 0 0 1 1.354-2.93c.229-.194.412-.436.537-.71h14.767c.12.275.303.518.534.71q.16.135.303.29a3.85 3.85 0 0 1 1.05 2.64", fill: "#1B89E5" }),
|
|
1142
|
+
React__default["default"].createElement("path", { d: "M16.568 17.151h-1.093a1.58 1.58 0 0 0-1.58 1.58v.272a.34.34 0 0 1-.34.34h-.272a1.58 1.58 0 0 0-1.58 1.58v1.095a1.58 1.58 0 0 0 1.58 1.58h.272a.34.34 0 0 1 .34.34v.272a1.58 1.58 0 0 0 1.58 1.58h1.093a1.58 1.58 0 0 0 1.58-1.58v-.273a.34.34 0 0 1 .34-.34h.274a1.58 1.58 0 0 0 1.58-1.58v-1.092a1.58 1.58 0 0 0-1.58-1.58h-.273a.34.34 0 0 1-.341-.34v-.274a1.58 1.58 0 0 0-1.58-1.58", fill: "#fff" }),
|
|
1143
|
+
React__default["default"].createElement("path", { d: "M24.137 13.762H7.907a.47.47 0 0 1-.471-.47v-2.7a2.583 2.583 0 0 1 2.552-2.554c3.017-.1 9.05-.1 12.067 0a2.583 2.583 0 0 1 2.553 2.552v2.7a.473.473 0 0 1-.471.472", fill: "#E8E2E2" })),
|
|
1144
|
+
React__default["default"].createElement("defs", null,
|
|
1145
|
+
React__default["default"].createElement("clipPath", { id: "clip0_911_3434" },
|
|
1146
|
+
React__default["default"].createElement("path", { fill: "#fff", d: "M0 0h32v32H0z" })))));
|
|
1147
|
+
};
|
|
1148
|
+
|
|
1149
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1150
|
+
const getContents = (t) => {
|
|
1151
|
+
return [
|
|
1152
|
+
{
|
|
1153
|
+
label: 'Personalized Experience',
|
|
1154
|
+
description: 'Your name, gender, and date of birth help us provide tailored health advice and personalized care plans that fit your unique needs.',
|
|
1155
|
+
icon: React__default["default"].createElement(PersonalizeIcon, null),
|
|
1156
|
+
},
|
|
1157
|
+
{
|
|
1158
|
+
label: 'Timely Health Updates',
|
|
1159
|
+
description: 'We use your phone number and email to send important notifications, health reminders, and updates on new content to keep you informed.',
|
|
1160
|
+
icon: React__default["default"].createElement(HealthUpdateIcon, null),
|
|
1161
|
+
},
|
|
1162
|
+
{
|
|
1163
|
+
label: 'Enhanced Security',
|
|
1164
|
+
description: 'We use your phone number and email to send important notifications, health reminders, and updates on new content to keep you informed.',
|
|
1165
|
+
icon: React__default["default"].createElement(SecurityIcon, null),
|
|
1166
|
+
},
|
|
1167
|
+
{
|
|
1168
|
+
label: 'Quick Customer Support',
|
|
1169
|
+
description: 'We use your phone number and email to send important notifications, health reminders, and updates on new content to keep you informed.',
|
|
1170
|
+
icon: React__default["default"].createElement(CustomerSupportIcon, null),
|
|
1171
|
+
},
|
|
1172
|
+
{
|
|
1173
|
+
label: 'Service Improvement',
|
|
1174
|
+
description: 'We use your phone number and email to send important notifications, health reminders, and updates on new content to keep you informed.',
|
|
1175
|
+
icon: React__default["default"].createElement(ServiceIcon, null),
|
|
1176
|
+
},
|
|
1177
|
+
];
|
|
1178
|
+
};
|
|
1179
|
+
const CollectInfoTextPopup = () => {
|
|
1180
|
+
const [opened, setOpened] = React__default["default"].useState(false);
|
|
1181
|
+
useTranslations.useTranslations();
|
|
1182
|
+
const contents = getContents();
|
|
1183
|
+
const [mobileDragOffset, setMobileDragOffset] = React.useState(0);
|
|
1184
|
+
const dragStartYRef = React.useRef(0);
|
|
1185
|
+
const mobileDragOffsetRef = React.useRef(mobileDragOffset);
|
|
1186
|
+
mobileDragOffsetRef.current = mobileDragOffset;
|
|
1187
|
+
const throttleSetMobileDragOffset = React.useMemo(() => {
|
|
1188
|
+
return throttle__default["default"](setMobileDragOffset, 70);
|
|
1189
|
+
}, []);
|
|
1190
|
+
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
1191
|
+
React__default["default"].createElement(index$3.Text, { size: "p4", onClick: () => {
|
|
1192
|
+
setOpened(true);
|
|
1193
|
+
setMobileDragOffset(0);
|
|
1194
|
+
}, color: "blue.6", style: {
|
|
1195
|
+
cursor: 'pointer',
|
|
1196
|
+
} },
|
|
1197
|
+
React__default["default"].createElement(other.Info, { size: 16, color: '#2D87F3', style: {
|
|
1198
|
+
verticalAlign: 'sub',
|
|
1199
|
+
} }),
|
|
1200
|
+
' ',
|
|
1201
|
+
"Why We Need Your Information?"),
|
|
1202
|
+
React__default["default"].createElement("style", { key: mobileDragOffset }, `
|
|
1203
|
+
.collect-info-text-popup .mantine-Modal-inner {
|
|
1204
|
+
transform: translateY(${Math.round(mobileDragOffset)}px);
|
|
1205
|
+
}
|
|
1206
|
+
`),
|
|
1207
|
+
React__default["default"].createElement(index$1.Modal, { opened: opened, onClose: () => setOpened(false), withCloseButton: false, styles: (theme) => ({
|
|
1208
|
+
body: {
|
|
1209
|
+
padding: '32px 24px',
|
|
1210
|
+
position: 'relative',
|
|
1211
|
+
background: 'linear-gradient(180deg, #91CAFF 0%, #CFE8FF 100px, #FFFFFF 200px)',
|
|
1212
|
+
[theme.fn.smallerThan('sm')]: {
|
|
1213
|
+
height: '100%',
|
|
1214
|
+
},
|
|
1215
|
+
},
|
|
1216
|
+
content: {
|
|
1217
|
+
[theme.fn.smallerThan('sm')]: {
|
|
1218
|
+
width: '100%',
|
|
1219
|
+
height: '100%',
|
|
1220
|
+
borderBottomLeftRadius: 0,
|
|
1221
|
+
borderBottomRightRadius: 0,
|
|
1222
|
+
maxWidth: '100%',
|
|
1223
|
+
maxHeight: '100%',
|
|
1224
|
+
},
|
|
1225
|
+
},
|
|
1226
|
+
inner: {
|
|
1227
|
+
[theme.fn.smallerThan('sm')]: {
|
|
1228
|
+
padding: 0,
|
|
1229
|
+
left: 0,
|
|
1230
|
+
right: 0,
|
|
1231
|
+
top: 120,
|
|
1232
|
+
// transform: `translateY(${Math.round(mobileDragOffset)}px)`,
|
|
1233
|
+
display: 'block',
|
|
1234
|
+
transition: 'transform 70ms',
|
|
1235
|
+
},
|
|
1236
|
+
},
|
|
1237
|
+
}), className: "collect-info-text-popup" },
|
|
1238
|
+
React__default["default"].createElement(core$1.Box, { sx: (theme) => ({
|
|
1239
|
+
[theme.fn.largerThan('sm')]: {
|
|
1240
|
+
display: 'none',
|
|
1241
|
+
},
|
|
1242
|
+
padding: 8,
|
|
1243
|
+
width: '100%',
|
|
1244
|
+
cursor: 'grab',
|
|
1245
|
+
display: 'flex',
|
|
1246
|
+
justifyContent: 'center',
|
|
1247
|
+
position: 'absolute',
|
|
1248
|
+
top: 0,
|
|
1249
|
+
left: 0,
|
|
1250
|
+
}), draggable: true, onDrag: (e) => {
|
|
1251
|
+
if (e.clientY < 0)
|
|
1252
|
+
return;
|
|
1253
|
+
throttleSetMobileDragOffset(e.clientY - dragStartYRef.current);
|
|
1254
|
+
}, onDragStart: (e) => {
|
|
1255
|
+
dragStartYRef.current = e.clientY;
|
|
1256
|
+
}, onDragEnd: (e) => {
|
|
1257
|
+
if (e.clientY - dragStartYRef.current > 100) {
|
|
1258
|
+
setMobileDragOffset(window.innerHeight);
|
|
1259
|
+
setTimeout(() => {
|
|
1260
|
+
setOpened(false);
|
|
1261
|
+
}, 100);
|
|
1262
|
+
}
|
|
1263
|
+
else {
|
|
1264
|
+
throttleSetMobileDragOffset(0);
|
|
1265
|
+
}
|
|
1266
|
+
}, onTouchStart: (e) => {
|
|
1267
|
+
dragStartYRef.current = e.touches[0].clientY;
|
|
1268
|
+
}, onTouchMove: (e) => {
|
|
1269
|
+
if (e.touches[0].clientY < 0)
|
|
1270
|
+
return;
|
|
1271
|
+
throttleSetMobileDragOffset(e.touches[0].clientY - dragStartYRef.current);
|
|
1272
|
+
}, onTouchEnd: (e) => {
|
|
1273
|
+
if (e.changedTouches[0].clientY - dragStartYRef.current > 100) {
|
|
1274
|
+
setMobileDragOffset(window.innerHeight);
|
|
1275
|
+
setTimeout(() => {
|
|
1276
|
+
setOpened(false);
|
|
1277
|
+
}, 100);
|
|
1278
|
+
}
|
|
1279
|
+
else {
|
|
1280
|
+
throttleSetMobileDragOffset(0);
|
|
1281
|
+
}
|
|
1282
|
+
} },
|
|
1283
|
+
React__default["default"].createElement(core$1.Box, { sx: {
|
|
1284
|
+
border: '1.5px solid #ADB3BC',
|
|
1285
|
+
background: 'gray',
|
|
1286
|
+
borderRadius: 3,
|
|
1287
|
+
width: 44,
|
|
1288
|
+
} })),
|
|
1289
|
+
React__default["default"].createElement("div", { style: {
|
|
1290
|
+
height: 40,
|
|
1291
|
+
} },
|
|
1292
|
+
React__default["default"].createElement(index$2.Button, { variant: "white", sx: (theme) => ({
|
|
1293
|
+
width: 40,
|
|
1294
|
+
height: 40,
|
|
1295
|
+
padding: 8,
|
|
1296
|
+
background: 'white',
|
|
1297
|
+
borderRadius: '100%',
|
|
1298
|
+
[theme.fn.smallerThan('sm')]: {
|
|
1299
|
+
display: 'none',
|
|
1300
|
+
},
|
|
1301
|
+
}), onClick: () => setOpened(false) },
|
|
1302
|
+
React__default["default"].createElement(arrow.ChevronLeft, null))),
|
|
1303
|
+
React__default["default"].createElement(BackgroundHeader, null),
|
|
1304
|
+
React__default["default"].createElement(core$1.Stack, { pos: "relative", mt: 100, spacing: 8, style: {
|
|
1305
|
+
zIndex: 1,
|
|
1306
|
+
} },
|
|
1307
|
+
React__default["default"].createElement(index$3.Text, { size: "h4" }, "Why We Need Your Information"),
|
|
1308
|
+
React__default["default"].createElement(index$4.Accordion, { styles: {
|
|
1309
|
+
item: {
|
|
1310
|
+
borderBottomColor: '#E4E8EC',
|
|
1311
|
+
paddingBottom: 16,
|
|
1312
|
+
marginTop: 16,
|
|
1313
|
+
},
|
|
1314
|
+
control: {
|
|
1315
|
+
padding: 0,
|
|
1316
|
+
},
|
|
1317
|
+
content: {
|
|
1318
|
+
padding: 0,
|
|
1319
|
+
marginTop: 8,
|
|
1320
|
+
},
|
|
1321
|
+
} }, contents.map((item, index) => (React__default["default"].createElement(index$4.Accordion.Item, { key: index, value: item.label },
|
|
1322
|
+
React__default["default"].createElement(index$4.Accordion.Control, { icon: item.icon },
|
|
1323
|
+
React__default["default"].createElement(index$3.Text, { size: "s3", weight: "semiBold" }, item.label)),
|
|
1324
|
+
React__default["default"].createElement(index$4.Accordion.Panel, null,
|
|
1325
|
+
React__default["default"].createElement(index$3.Text, { size: "p3" }, item.description))))))))));
|
|
1326
|
+
};
|
|
1327
|
+
|
|
1328
|
+
const SSOPasswordWithConfirm = (_a) => {
|
|
1329
|
+
var { form } = _a, props = tslib_es6.__rest(_a, ["form"]);
|
|
1330
|
+
const [atLeast8Chars, setAtLeast8Chars] = React__default["default"].useState(undefined);
|
|
1331
|
+
const [atLeastOneUpper, setAtLeastOneUpper] = React__default["default"].useState(undefined);
|
|
1332
|
+
const password = form.values.password;
|
|
1333
|
+
React.useEffect(() => {
|
|
1334
|
+
if (typeof password === 'undefined')
|
|
1335
|
+
return;
|
|
1336
|
+
setAtLeast8Chars(password.length >= 8);
|
|
1337
|
+
setAtLeastOneUpper(!!password.match(/[A-Z]/));
|
|
1338
|
+
}, [password]);
|
|
1339
|
+
return (React__default["default"].createElement(core$1.Stack, Object.assign({ spacing: 12 }, props),
|
|
1340
|
+
React__default["default"].createElement(index$4.PasswordInput, Object.assign({ name: "password", placeholder: "Nh\u1EADp m\u1EADt kh\u1EA9u", label: "Password", required: true, withAsterisk: true }, form.getInputProps('password'))),
|
|
1341
|
+
React__default["default"].createElement(core$1.Stack, { spacing: 8 },
|
|
1342
|
+
React__default["default"].createElement(index$3.Text, { size: "n1" },
|
|
1343
|
+
atLeast8Chars ? (React__default["default"].createElement(core.CheckCircle, { color: miscTheme.theme.colors.green600 })) : typeof atLeast8Chars === 'undefined' ? (React__default["default"].createElement(core.CheckCircle, null)) : (React__default["default"].createElement(other.CircleBorder, { color: miscTheme.theme.colors.red600, isSolid: true })),
|
|
1344
|
+
' ',
|
|
1345
|
+
"At least 8 characters."),
|
|
1346
|
+
React__default["default"].createElement(index$3.Text, { size: "n1" },
|
|
1347
|
+
atLeastOneUpper ? (React__default["default"].createElement(core.CheckCircle, { color: miscTheme.theme.colors.green600 })) : typeof atLeastOneUpper === 'undefined' ? (React__default["default"].createElement(core.CheckCircle, null)) : (React__default["default"].createElement(other.CircleBorder, { color: miscTheme.theme.colors.red600, isSolid: true })),
|
|
1348
|
+
' ',
|
|
1349
|
+
"At least one uppercase letter and one number.")),
|
|
1350
|
+
React__default["default"].createElement(index$4.PasswordInput, Object.assign({ name: "confirm-password", placeholder: "X\u00E1c nh\u1EADn m\u1EADt kh\u1EA9u", label: "Confirm Password", required: true, withAsterisk: true }, form.getInputProps('confirmPassword')))));
|
|
1351
|
+
};
|
|
1352
|
+
|
|
1353
|
+
const SSOPasswordForgotSetup = ({ hidden }) => {
|
|
1354
|
+
const { onClose } = useSSOState();
|
|
1355
|
+
const form$1 = form.useForm({
|
|
1356
|
+
validate: form.yupResolver(yup__namespace.object().shape({
|
|
1357
|
+
password: yup__namespace
|
|
1358
|
+
.string()
|
|
1359
|
+
.required('Password is required')
|
|
1360
|
+
.min(8)
|
|
1361
|
+
.matches(/[A-Z]/, 'Password must contain at least one uppercase letter'),
|
|
1362
|
+
confirmPassword: yup__namespace
|
|
1363
|
+
.string()
|
|
1364
|
+
.required('Confirm password is required')
|
|
1365
|
+
.test('passwords-match', 'Passwords must match', function (value) {
|
|
1366
|
+
return this.parent.password === value;
|
|
1367
|
+
}),
|
|
1368
|
+
})),
|
|
1369
|
+
});
|
|
1370
|
+
const onSubmit = (values) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
1371
|
+
const { password, confirmPassword } = values;
|
|
1372
|
+
if (password.length >= 8 &&
|
|
1373
|
+
password.match(/[A-Z]/) &&
|
|
1374
|
+
password === confirmPassword) {
|
|
1375
|
+
const res = yield resetPassword(password, confirmPassword);
|
|
1376
|
+
if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
|
|
1377
|
+
// close popup
|
|
1378
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
1379
|
+
}
|
|
1380
|
+
}
|
|
1381
|
+
});
|
|
1382
|
+
return (React__default["default"].createElement("form", { style: {
|
|
1383
|
+
display: hidden ? 'none' : 'block',
|
|
1384
|
+
}, onSubmit: form$1.onSubmit(onSubmit) },
|
|
1385
|
+
React__default["default"].createElement(core$1.Stack, { spacing: 24 },
|
|
1386
|
+
React__default["default"].createElement(core$1.Stack, { spacing: 8 },
|
|
1387
|
+
React__default["default"].createElement(index$3.Text, { size: "s1", weight: "semiBold" }, "Setup your password"),
|
|
1388
|
+
React__default["default"].createElement(index$3.Text, { size: "p4" }, "Set up your login password and other details to complete the registration process.")),
|
|
1389
|
+
React__default["default"].createElement(SSOPasswordWithConfirm, { form: form$1 }),
|
|
1390
|
+
React__default["default"].createElement(CollectInfoTextPopup, null),
|
|
1391
|
+
React__default["default"].createElement(index$2.Button, { size: "lg", variant: "primary", fullWidth: true }, "Save"))));
|
|
1392
|
+
};
|
|
1393
|
+
|
|
1394
|
+
const SSOPhoneVerify = ({ hidden, }) => {
|
|
1395
|
+
const [phone, setPhone] = React__default["default"].useState('');
|
|
1396
|
+
const [errMsg, setErrMsg] = React__default["default"].useState('');
|
|
1397
|
+
const { locale } = useSSOState();
|
|
1398
|
+
const { addStep, goNext } = useSSOSteps();
|
|
1399
|
+
const onClickContinueZalo = () => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
1400
|
+
var _a, _b, _c;
|
|
1401
|
+
const { areaCode, phoneNumber } = splitPhone(phone);
|
|
1402
|
+
const userExist = yield checkUserExist({ phone: phoneNumber });
|
|
1403
|
+
if ((userExist === null || userExist === void 0 ? void 0 : userExist._status) === 1) {
|
|
1404
|
+
if (((_a = userExist._data) === null || _a === void 0 ? void 0 : _a.is_pass) && ((_b = userExist._data) === null || _b === void 0 ? void 0 : _b.is_status) === 'Active') {
|
|
1405
|
+
addStep({
|
|
1406
|
+
type: SSOStepTypeType.PASSWORD,
|
|
1407
|
+
config: {
|
|
1408
|
+
phone,
|
|
1409
|
+
},
|
|
1410
|
+
});
|
|
1411
|
+
}
|
|
1412
|
+
else {
|
|
1413
|
+
registerBySendZaloOTP(phoneNumber, areaCode);
|
|
1414
|
+
addStep({
|
|
1415
|
+
type: SSOStepTypeType.OTP,
|
|
1416
|
+
config: {
|
|
1417
|
+
phone,
|
|
1418
|
+
otpType: 'phone-zalo',
|
|
1419
|
+
},
|
|
1420
|
+
});
|
|
1421
|
+
}
|
|
1422
|
+
goNext();
|
|
1423
|
+
}
|
|
1424
|
+
else {
|
|
1425
|
+
setErrMsg(((_c = userExist === null || userExist === void 0 ? void 0 : userExist._messages) === null || _c === void 0 ? void 0 : _c[0]) || 'API error');
|
|
1426
|
+
}
|
|
1427
|
+
});
|
|
1428
|
+
const onClickContinuePhone = () => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
1429
|
+
var _d, _e, _f;
|
|
1430
|
+
const { areaCode, phoneNumber } = splitPhone(phone);
|
|
1431
|
+
const userExist = yield checkUserExist({ phone: phoneNumber });
|
|
1432
|
+
if ((userExist === null || userExist === void 0 ? void 0 : userExist._status) === 1) {
|
|
1433
|
+
if (((_d = userExist._data) === null || _d === void 0 ? void 0 : _d.is_pass) && ((_e = userExist._data) === null || _e === void 0 ? void 0 : _e.is_status) === 'Active') {
|
|
1434
|
+
addStep({
|
|
1435
|
+
type: SSOStepTypeType.PASSWORD,
|
|
1436
|
+
config: {
|
|
1437
|
+
phone,
|
|
1438
|
+
},
|
|
1439
|
+
});
|
|
1440
|
+
}
|
|
1441
|
+
else {
|
|
1442
|
+
registerBySendPhoneOTP(phoneNumber, areaCode);
|
|
1443
|
+
addStep({
|
|
1444
|
+
type: SSOStepTypeType.OTP,
|
|
1445
|
+
config: {
|
|
1446
|
+
phone,
|
|
1447
|
+
otpType: 'phone-sms',
|
|
1448
|
+
},
|
|
1449
|
+
});
|
|
1450
|
+
}
|
|
1451
|
+
goNext();
|
|
1452
|
+
}
|
|
1453
|
+
else {
|
|
1454
|
+
setErrMsg(((_f = userExist === null || userExist === void 0 ? void 0 : userExist._messages) === null || _f === void 0 ? void 0 : _f[0]) || 'API error');
|
|
1455
|
+
}
|
|
1456
|
+
});
|
|
1457
|
+
return (React__default["default"].createElement("form", { style: {
|
|
1458
|
+
display: hidden ? 'none' : 'block',
|
|
1459
|
+
}, onSubmit: (e) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
1460
|
+
var _g, _h, _j;
|
|
1461
|
+
e.preventDefault();
|
|
1462
|
+
const email = e.currentTarget.email.value;
|
|
1463
|
+
const existRes = yield checkUserExist({ email });
|
|
1464
|
+
if ((existRes === null || existRes === void 0 ? void 0 : existRes._status) === 1) {
|
|
1465
|
+
if (((_g = existRes._data) === null || _g === void 0 ? void 0 : _g.is_pass) &&
|
|
1466
|
+
((_h = existRes._data) === null || _h === void 0 ? void 0 : _h.is_status) === 'Active') {
|
|
1467
|
+
// go to password screen
|
|
1468
|
+
addStep({
|
|
1469
|
+
type: SSOStepTypeType.PASSWORD,
|
|
1470
|
+
config: {
|
|
1471
|
+
email,
|
|
1472
|
+
},
|
|
1473
|
+
});
|
|
1474
|
+
goNext();
|
|
1475
|
+
}
|
|
1476
|
+
else {
|
|
1477
|
+
// go to register screen
|
|
1478
|
+
registerBySendEmailOTP(email);
|
|
1479
|
+
addStep({
|
|
1480
|
+
type: SSOStepTypeType.OTP,
|
|
1481
|
+
config: {
|
|
1482
|
+
email,
|
|
1483
|
+
otpType: 'email',
|
|
1484
|
+
},
|
|
1485
|
+
});
|
|
1486
|
+
goNext();
|
|
1487
|
+
}
|
|
1488
|
+
}
|
|
1489
|
+
else {
|
|
1490
|
+
setErrMsg(((_j = existRes._messages) === null || _j === void 0 ? void 0 : _j[0]) || 'api error');
|
|
1491
|
+
}
|
|
1492
|
+
}) },
|
|
1493
|
+
React__default["default"].createElement(core$1.Stack, { spacing: 24 },
|
|
1494
|
+
React__default["default"].createElement(core$1.Stack, { spacing: 8 },
|
|
1495
|
+
React__default["default"].createElement(index$3.Text, { size: "s1", weight: "semiBold" }, "Verify Phone Number"),
|
|
1496
|
+
React__default["default"].createElement(index$3.Text, { size: "p4" }, "Please provide additional information to complete the account registration process.")),
|
|
1497
|
+
React__default["default"].createElement(core$1.Stack, { spacing: 16 },
|
|
1498
|
+
React__default["default"].createElement(index$4.Input.Wrapper, { error: errMsg },
|
|
1499
|
+
React__default["default"].createElement(StyledPhone, { defaultCountry: (locale ? utils.MAPPED_LOCALE[locale] || 'VN' : 'VN'), value: phone, onChange: (value) => setPhone(value), isError: !!errMsg, required: true, name: "phone" })),
|
|
1500
|
+
React__default["default"].createElement(index$2.Button, { size: "lg", variant: "primary", onClick: onClickContinueZalo }, "Continue with Zalo"),
|
|
1501
|
+
React__default["default"].createElement(index$2.Button, { size: "lg", variant: "secondary", onClick: onClickContinuePhone }, "Continue with SMS")),
|
|
1502
|
+
React__default["default"].createElement(CollectInfoTextPopup, null))));
|
|
1503
|
+
};
|
|
1504
|
+
|
|
1505
|
+
// always has name, gender dob
|
|
1506
|
+
const OtherSetup = ({ form, needPhone, needEmail, isEmailDisable, }) => {
|
|
1507
|
+
const { locale = 'vi-VN' } = useSSOState();
|
|
1508
|
+
return (React__default["default"].createElement(core$1.Stack, { spacing: 8 },
|
|
1509
|
+
needPhone && (React__default["default"].createElement(index$4.Input.Wrapper, Object.assign({ label: "S\u1ED1 \u0111i\u1EC7n tho\u1EA1i", withAsterisk: true }, form.getInputProps('phone')),
|
|
1510
|
+
React__default["default"].createElement(StyledPhone, { defaultCountry: (locale ? utils.MAPPED_LOCALE[locale] || 'VN' : 'VN'), value: form.getInputProps('phone').value, onChange: (value) => {
|
|
1511
|
+
form.setFieldValue('phone', value);
|
|
1512
|
+
}, isError: !!form.getInputProps('phone').error, required: true, name: "phone" }))),
|
|
1513
|
+
// email is disabled
|
|
1514
|
+
needEmail && (React__default["default"].createElement(index$4.Input, Object.assign({ name: "email", type: "email", label: "Email", disabled: isEmailDisable }, form.getInputProps('email')))),
|
|
1515
|
+
React__default["default"].createElement(index$4.Input, Object.assign({ name: "name", label: "Name", withAsterisk: true, required: true }, form.getInputProps('name'))),
|
|
1516
|
+
React__default["default"].createElement(index$4.Input.Wrapper, Object.assign({ label: "Gender", withAsterisk: true }, form.getInputProps('gender')),
|
|
1517
|
+
React__default["default"].createElement(core$1.Group, null,
|
|
1518
|
+
React__default["default"].createElement(index$2.Button, { type: "button", sx: {
|
|
1519
|
+
flex: 1,
|
|
1520
|
+
}, variant: form.getInputProps('gender').value === 'female'
|
|
1521
|
+
? 'secondary'
|
|
1522
|
+
: 'tertiary', onClick: () => {
|
|
1523
|
+
form.setFieldValue('gender', 'female');
|
|
1524
|
+
} }, "Female"),
|
|
1525
|
+
React__default["default"].createElement(index$2.Button, { type: "button", sx: {
|
|
1526
|
+
flex: 1,
|
|
1527
|
+
}, variant: form.getInputProps('gender').value === 'male'
|
|
1528
|
+
? 'secondary'
|
|
1529
|
+
: 'tertiary', onClick: () => {
|
|
1530
|
+
form.setFieldValue('gender', 'male');
|
|
1531
|
+
} }, "Male"))),
|
|
1532
|
+
React__default["default"].createElement(index$5.DatePicker, Object.assign({ name: "dob", label: "Birthday", withAsterisk: true, required: true }, form.getInputProps('dob')))));
|
|
1533
|
+
};
|
|
1534
|
+
|
|
1535
|
+
const SSOSetupScreen = ({ hidden, index: index$1, }) => {
|
|
1536
|
+
const { onClose, source } = useSSOState();
|
|
1537
|
+
const { steps } = useSSOSteps();
|
|
1538
|
+
const currentStep = steps[index$1];
|
|
1539
|
+
const config = currentStep === null || currentStep === void 0 ? void 0 : currentStep.config;
|
|
1540
|
+
const userInfo = config === null || config === void 0 ? void 0 : config.userInfo;
|
|
1541
|
+
const isEmailDisable = !!(userInfo === null || userInfo === void 0 ? void 0 : userInfo.email) && !!(config === null || config === void 0 ? void 0 : config.disabledEmail);
|
|
1542
|
+
const needPass = !(userInfo === null || userInfo === void 0 ? void 0 : userInfo.is_pass);
|
|
1543
|
+
const needPhone = !(userInfo === null || userInfo === void 0 ? void 0 : userInfo.phone_verified_at);
|
|
1544
|
+
const needEmail = !(userInfo === null || userInfo === void 0 ? void 0 : userInfo.email) || isEmailDisable;
|
|
1545
|
+
// const isNew = !!userInfo?.is_new
|
|
1546
|
+
const form$1 = form.useForm({
|
|
1547
|
+
initialValues: Object.assign({}, (needEmail
|
|
1548
|
+
? {
|
|
1549
|
+
email: (userInfo === null || userInfo === void 0 ? void 0 : userInfo.email) || '',
|
|
1550
|
+
}
|
|
1551
|
+
: {})),
|
|
1552
|
+
validateInputOnBlur: true,
|
|
1553
|
+
validate: form.yupResolver(yup__namespace.object().shape(Object.assign(Object.assign(Object.assign(Object.assign({}, (needPass
|
|
1554
|
+
? {
|
|
1555
|
+
password: yup__namespace
|
|
1556
|
+
.string()
|
|
1557
|
+
.required('Password is required')
|
|
1558
|
+
.min(8, ' ')
|
|
1559
|
+
.matches(/[A-Z]/, ' '),
|
|
1560
|
+
confirmPassword: yup__namespace
|
|
1561
|
+
.string()
|
|
1562
|
+
.required('Confirm password is required')
|
|
1563
|
+
.test('passwords-match', 'Passwords must match', function (value) {
|
|
1564
|
+
return this.parent.password === value;
|
|
1565
|
+
}),
|
|
1566
|
+
}
|
|
1567
|
+
: {})), (needPhone
|
|
1568
|
+
? {
|
|
1569
|
+
phone: yup__namespace.string().required('Phone number is required'),
|
|
1570
|
+
}
|
|
1571
|
+
: {})), (needEmail
|
|
1572
|
+
? {
|
|
1573
|
+
email: yup__namespace.string().email('Invalid email'),
|
|
1574
|
+
}
|
|
1575
|
+
: {})), { gender: yup__namespace
|
|
1576
|
+
.string()
|
|
1577
|
+
.required('Gender is required')
|
|
1578
|
+
.oneOf(['male', 'female']), dob: yup__namespace.date().required('Date of birth is required'), name: yup__namespace.string().required('Name is required') }))),
|
|
1579
|
+
});
|
|
1580
|
+
const onSubmit = (values) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
1581
|
+
var _a;
|
|
1582
|
+
const { password, confirmPassword, phone, gender, name, dob } = values;
|
|
1583
|
+
const { phoneNumber, areaCode } = splitPhone(phone || '');
|
|
1584
|
+
const res = yield updateUserInfo({
|
|
1585
|
+
name,
|
|
1586
|
+
birthday: dayjs__default["default"](dob).format('YYYY-MM-DD'),
|
|
1587
|
+
email: values.email,
|
|
1588
|
+
password,
|
|
1589
|
+
confirm_password: confirmPassword,
|
|
1590
|
+
phone_number: phoneNumber,
|
|
1591
|
+
area_code: areaCode,
|
|
1592
|
+
gender: gender === 'male' ? 1 : 0,
|
|
1593
|
+
source,
|
|
1594
|
+
});
|
|
1595
|
+
if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
|
|
1596
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
1597
|
+
miscCookieHelper.setCookie(index.BEARER_TOKEN_COOKIE, (_a = res._data) === null || _a === void 0 ? void 0 : _a.token, {
|
|
1598
|
+
domain: window.location.hostname === 'localhost'
|
|
1599
|
+
? 'localhost'
|
|
1600
|
+
: `.${constantsDomainLocales.domainLocales[process.env.UNIFY_LOCALE || 'vi-VN']}`,
|
|
1601
|
+
expires: new Date(res._data.expire_in * 1000).toUTCString(),
|
|
1602
|
+
});
|
|
1603
|
+
}
|
|
1604
|
+
});
|
|
1605
|
+
return (React__default["default"].createElement("form", { style: {
|
|
1606
|
+
display: hidden ? 'none' : 'block',
|
|
1607
|
+
}, onSubmit: form$1.onSubmit(onSubmit) },
|
|
1608
|
+
React__default["default"].createElement(core$1.Stack, { spacing: 24 },
|
|
1609
|
+
React__default["default"].createElement(core$1.Stack, { spacing: 8 },
|
|
1610
|
+
React__default["default"].createElement(index$3.Text, { size: "s1", weight: "semiBold" }, "Almost done!"),
|
|
1611
|
+
React__default["default"].createElement(index$3.Text, { size: "p4" }, "Please provide additional information to complete the account registration process.")),
|
|
1612
|
+
needPass && React__default["default"].createElement(SSOPasswordWithConfirm, { form: form$1 }),
|
|
1613
|
+
React__default["default"].createElement(OtherSetup, { needPhone: needPhone, needEmail: needEmail, isEmailDisable: isEmailDisable, form: form$1 }),
|
|
1614
|
+
React__default["default"].createElement(CollectInfoTextPopup, null),
|
|
1615
|
+
React__default["default"].createElement(index$2.Button, { type: "submit", variant: "primary", fullWidth: true }, needPhone ? 'Verify Phone Number' : 'Save'))));
|
|
1616
|
+
};
|
|
1617
|
+
|
|
1618
|
+
const SSOScreenRenderer = () => {
|
|
1619
|
+
const { steps, currentStepIndex } = useSSOSteps();
|
|
1620
|
+
return (React__default["default"].createElement(React__default["default"].Fragment, null, steps.map((step, index) => {
|
|
1621
|
+
const isCurrentStep = index === currentStepIndex;
|
|
1622
|
+
switch (step.type) {
|
|
1623
|
+
case SSOStepTypeType.FIRST:
|
|
1624
|
+
return React__default["default"].createElement(SSOFirstScreen, { key: index, hidden: !isCurrentStep });
|
|
1625
|
+
case SSOStepTypeType.PASSWORD:
|
|
1626
|
+
return (React__default["default"].createElement(SSOPasswordScreen, { key: index, hidden: !isCurrentStep, index: index }));
|
|
1627
|
+
case SSOStepTypeType.FORGOT_PASSWORD_PHONE:
|
|
1628
|
+
return (React__default["default"].createElement(SSOPasswordForgotPhone, { key: index, hidden: !isCurrentStep, index: index }));
|
|
1629
|
+
case SSOStepTypeType.FORGOT_PASSWORD_SETUP:
|
|
1630
|
+
return (React__default["default"].createElement(SSOPasswordForgotSetup, { key: index, hidden: !isCurrentStep }));
|
|
1631
|
+
case SSOStepTypeType.OTP:
|
|
1632
|
+
return (React__default["default"].createElement(SSOOTPScreen, { key: index, hidden: !isCurrentStep, index: index }));
|
|
1633
|
+
case SSOStepTypeType.EMAIL:
|
|
1634
|
+
return (React__default["default"].createElement(SSOEmailScreen, { key: index, hidden: !isCurrentStep, index: index }));
|
|
1635
|
+
case SSOStepTypeType.SETUP_FULL:
|
|
1636
|
+
return (React__default["default"].createElement(SSOSetupScreen, { key: index, hidden: !isCurrentStep, index: index }));
|
|
1637
|
+
case SSOStepTypeType.VERIFY_PHONE:
|
|
1638
|
+
return (React__default["default"].createElement(SSOPhoneVerify, { key: index, hidden: !isCurrentStep, index: index }));
|
|
1639
|
+
default:
|
|
1640
|
+
return React__default["default"].createElement("div", { key: index }, "Not found");
|
|
1641
|
+
}
|
|
1642
|
+
})));
|
|
1643
|
+
};
|
|
1644
|
+
|
|
1645
|
+
const SSOV2 = ({ onClose, locale, source = 'default' }) => {
|
|
1646
|
+
return (React__default["default"].createElement(SSOStateProvider, { onClose: onClose, locale: locale, source: source },
|
|
1647
|
+
React__default["default"].createElement(SSOStepsProvider, null,
|
|
1648
|
+
React__default["default"].createElement(SSOPopupWrapper, { opened: true, onClose: onClose },
|
|
1649
|
+
React__default["default"].createElement(SSOScreenRenderer, null)))));
|
|
1650
|
+
};
|
|
1651
|
+
|
|
1652
|
+
exports.SSOV2 = SSOV2;
|