@hhgtech/hhg-components 1.29.311 → 1.29.313-beta-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (518) hide show
  1. package/README.md +2 -0
  2. package/build/{LastPeriod-2107ce0b.js → LastPeriod-b507c884.js} +1 -1
  3. package/build/{MobileBottomNavigationIcon-2fa0dfec.js → MobileBottomNavigationIcon-d69086de.js} +3 -3
  4. package/build/{Spinner-5eeed23a.js → Spinner-5562c737.js} +1 -1
  5. package/build/{WhatsApp-93a9b026.js → WhatsApp-cd02e7e9.js} +1 -1
  6. package/build/adapters.js +19 -19
  7. package/build/atoms.js +46 -46
  8. package/build/babyGrowth.js +83 -83
  9. package/build/cache.js +2 -2
  10. package/build/care.js +17 -17
  11. package/build/careBookingSearchBar.js +14 -14
  12. package/build/careBookingSearchBarV2.js +15 -15
  13. package/build/components/mantine/modal/index.d.ts +2 -2
  14. package/build/components/mantine/phone/countrySelect.d.ts +1 -1
  15. package/build/components/mantine/phone/phoneWithCustomCountrySelect.d.ts +1 -0
  16. package/build/components.js +90 -90
  17. package/build/{constants-a3c59889.js → constants-5144c4b4.js} +1 -1
  18. package/build/constants.js +3 -3
  19. package/build/constantsDomainLocales.js +1 -1
  20. package/build/constantsRiskScreener.js +2 -2
  21. package/build/constantsSite.js +2 -2
  22. package/build/{core-ecc818f0.js → core-be7d1d0d.js} +1 -1
  23. package/build/{dataTransform-df350bff.js → dataTransform-e1fb5138.js} +1 -1
  24. package/build/ecom.js +4 -4
  25. package/build/{editor-40df96a9.js → editor-5972d7de.js} +11 -11
  26. package/build/embeddedHeathToolCards_babyGrowth.js +23 -23
  27. package/build/embeddedHeathToolCards_babyPoop.js +19 -19
  28. package/build/embeddedHeathToolCards_babyVaccine.js +22 -22
  29. package/build/embeddedHeathToolCards_bmi_bmi.js +25 -25
  30. package/build/embeddedHeathToolCards_bmrBmr.js +25 -25
  31. package/build/embeddedHeathToolCards_dueDate_dueDate.js +22 -22
  32. package/build/embeddedHeathToolCards_ovulation_ovulation.js +22 -22
  33. package/build/embeddedHeathToolCards_pwg_pwg.js +26 -26
  34. package/build/embeddedHeathToolCards_targetHeartRate.js +27 -27
  35. package/build/esm/{LastPeriod-e3951455.js → LastPeriod-a5ac12c2.js} +1 -1
  36. package/build/esm/{MobileBottomNavigationIcon-9216cca7.js → MobileBottomNavigationIcon-5a807d18.js} +3 -3
  37. package/build/esm/{Spinner-903430aa.js → Spinner-51be0186.js} +1 -1
  38. package/build/esm/{WhatsApp-a64943bc.js → WhatsApp-a184d272.js} +1 -1
  39. package/build/esm/adapters.js +19 -19
  40. package/build/esm/atoms.js +46 -46
  41. package/build/esm/babyGrowth.js +83 -83
  42. package/build/esm/cache.js +2 -2
  43. package/build/esm/care.js +17 -17
  44. package/build/esm/careBookingSearchBar.js +14 -14
  45. package/build/esm/careBookingSearchBarV2.js +15 -15
  46. package/build/esm/components/mantine/modal/index.d.ts +2 -2
  47. package/build/esm/components/mantine/phone/countrySelect.d.ts +1 -1
  48. package/build/esm/components/mantine/phone/phoneWithCustomCountrySelect.d.ts +1 -0
  49. package/build/esm/components.js +90 -90
  50. package/build/esm/{constants-79f4e640.js → constants-649cb778.js} +1 -1
  51. package/build/esm/constants.js +3 -3
  52. package/build/esm/constantsDomainLocales.js +1 -1
  53. package/build/esm/constantsRiskScreener.js +2 -2
  54. package/build/esm/constantsSite.js +2 -2
  55. package/build/esm/{core-1a9ff9e4.js → core-7d66d3c9.js} +1 -1
  56. package/build/esm/{dataTransform-c881832b.js → dataTransform-70805d45.js} +1 -1
  57. package/build/esm/ecom.js +4 -4
  58. package/build/esm/{editor-cf4bd5c2.js → editor-87fc1ea4.js} +11 -11
  59. package/build/esm/embeddedHeathToolCards_babyGrowth.js +23 -23
  60. package/build/esm/embeddedHeathToolCards_babyPoop.js +19 -19
  61. package/build/esm/embeddedHeathToolCards_babyVaccine.js +22 -22
  62. package/build/esm/embeddedHeathToolCards_bmi_bmi.js +25 -25
  63. package/build/esm/embeddedHeathToolCards_bmrBmr.js +25 -25
  64. package/build/esm/embeddedHeathToolCards_dueDate_dueDate.js +22 -22
  65. package/build/esm/embeddedHeathToolCards_ovulation_ovulation.js +22 -22
  66. package/build/esm/embeddedHeathToolCards_pwg_pwg.js +26 -26
  67. package/build/esm/embeddedHeathToolCards_targetHeartRate.js +27 -27
  68. package/build/esm/{fixedBottomAdBlock-46427068.js → fixedBottomAdBlock-f3fd6271.js} +24 -24
  69. package/build/esm/footer.js +21 -21
  70. package/build/esm/gAssets.js +2 -2
  71. package/build/esm/healthToolsCardWrapper.js +18 -18
  72. package/build/esm/healthToolsForm.js +33 -33
  73. package/build/esm/hooks.js +13 -13
  74. package/build/esm/i18n/translationKeys.d.ts +1 -1
  75. package/build/esm/i18n-values/en-PH.js +1 -0
  76. package/build/esm/i18n-values/hi-IN.js +1 -0
  77. package/build/esm/i18n-values/id-ID.js +1 -0
  78. package/build/esm/i18n-values/km-KH.js +2 -1
  79. package/build/esm/i18n-values/ms-MY.js +1 -0
  80. package/build/esm/i18n-values/my-MM.js +1 -0
  81. package/build/esm/i18n-values/th-TH.js +1 -0
  82. package/build/esm/i18n-values/tl-PH.js +1 -0
  83. package/build/esm/i18n-values/vi-VN.js +1 -0
  84. package/build/esm/i18n-values/vi-VN_MB.js +1 -0
  85. package/build/esm/i18n-values/zh-TW.js +1 -0
  86. package/build/esm/i18n.js +2 -2
  87. package/build/esm/i18nV2.js +2 -2
  88. package/build/esm/{index-a7f516ad.js → index-0760c921.js} +2 -2
  89. package/build/esm/{index-347f6319.js → index-0e4ba19d.js} +2 -2
  90. package/build/esm/{index-809fc2cb.js → index-15560079.js} +32 -32
  91. package/build/esm/{index-81f30b2c.js → index-1e2fb535.js} +6 -6
  92. package/build/esm/{index-6c43703a.js → index-26335a2a.js} +6 -6
  93. package/build/esm/{index-fa13fe6b.js → index-2ae53507.js} +1 -1
  94. package/build/esm/{index-10898fb6.js → index-2d92baf8.js} +15 -15
  95. package/build/esm/{index-c5c3e71e.js → index-2e8e27af.js} +2 -2
  96. package/build/esm/{index-e66f15e0.js → index-34c27c3b.js} +10 -10
  97. package/build/esm/{index-cdb8c87e.js → index-35a77f28.js} +1 -1
  98. package/build/esm/{index-cde9ca6c.js → index-3e663899.js} +18 -18
  99. package/build/esm/{index-d92ce05b.js → index-40570976.js} +17 -17
  100. package/build/esm/{index-85f514dd.js → index-48d360ad.js} +17 -17
  101. package/build/esm/{index-b4ead995.js → index-4aa69e87.js} +2 -2
  102. package/build/esm/{index-e33334d0.js → index-64952600.js} +2 -2
  103. package/build/esm/{index-148c8577.js → index-649fb34b.js} +5 -5
  104. package/build/esm/{index-7da61d52.js → index-64eccd4e.js} +2 -2
  105. package/build/esm/{index-630296c3.js → index-6597a3f5.js} +1 -1
  106. package/build/esm/{index-308d4854.js → index-68fd26e2.js} +3 -3
  107. package/build/esm/{index-2bf08a6b.js → index-6b43b997.js} +2 -2
  108. package/build/esm/{index-c5c4cd20.js → index-6be6a609.js} +6 -6
  109. package/build/esm/{index-ca0e9bf8.js → index-6e63ffb9.js} +16 -16
  110. package/build/esm/{index-189a9824.js → index-6eda6c0a.js} +3 -3
  111. package/build/esm/{index-2f27692b.js → index-6ff672fa.js} +13 -13
  112. package/build/esm/{index-88358d84.js → index-70a1bb1a.js} +13 -13
  113. package/build/esm/{index-78e5203a.js → index-70a8c9f9.js} +13 -13
  114. package/build/esm/{index-3d3d0613.js → index-741cab72.js} +2 -2
  115. package/build/esm/{index-be992c75.js → index-74d19a0c.js} +3 -3
  116. package/build/esm/{index-c85f723d.js → index-7db11b87.js} +15 -15
  117. package/build/esm/{index-8d5b7ebd.js → index-7fe777e3.js} +16 -16
  118. package/build/esm/{index-4cc596e0.js → index-86d74d75.js} +7 -7
  119. package/build/esm/{index-4c62f4db.js → index-89dec459.js} +6 -6
  120. package/build/esm/{index-75b8afb7.js → index-8a584799.js} +1 -1
  121. package/build/esm/{index-e6e1a986.js → index-8c2c61c5.js} +16 -16
  122. package/build/esm/{index-9e9fd42c.js → index-8debf657.js} +1 -1
  123. package/build/esm/{index-6bb36621.js → index-8feac2e3.js} +1 -1
  124. package/build/esm/{index-d291e7d4.js → index-92e174e4.js} +3 -3
  125. package/build/esm/{index-434b8921.js → index-9320823c.js} +21 -21
  126. package/build/esm/{index-41fff10e.js → index-9cd7d779.js} +3 -3
  127. package/build/esm/{index-0099b8f2.js → index-9e5d3098.js} +1 -1
  128. package/build/esm/{index-13f9bf44.js → index-9fd13b8a.js} +30 -30
  129. package/build/esm/{index-3afff570.js → index-a5700e3e.js} +18 -18
  130. package/build/esm/{index-6354b22f.js → index-abdd5b13.js} +3 -3
  131. package/build/esm/{index-1d64e6cf.js → index-b3edbdd9.js} +26 -26
  132. package/build/esm/{index-14bfa2c9.js → index-b5967e5a.js} +2 -2
  133. package/build/esm/{index-d5dc6344.js → index-bb9b4cc8.js} +2 -2
  134. package/build/esm/{index-340d1a01.js → index-c4b01341.js} +24 -24
  135. package/build/esm/{index-66c9c3c6.js → index-c8fbe699.js} +16 -16
  136. package/build/esm/{index-dd2caaea.js → index-ca191fc5.js} +4 -4
  137. package/build/esm/{index-b5a40899.js → index-d1717b80.js} +11 -11
  138. package/build/esm/{index-060736dd.js → index-dde94622.js} +7 -7
  139. package/build/esm/{index-ae56762e.js → index-e38f7526.js} +17 -17
  140. package/build/esm/{index-116f69cf.js → index-e51bad6d.js} +1 -1
  141. package/build/esm/{index-0fa8c9a5.js → index-e59af171.js} +5 -5
  142. package/build/esm/{index-0202ef16.js → index-f3ceed6e.js} +3 -3
  143. package/build/esm/{index-16e03c09.js → index-f4cde892.js} +2 -2
  144. package/build/esm/{index-53014194.js → index-f61fb7f3.js} +13 -13
  145. package/build/esm/{index-cf31f84c.js → index-f7203a54.js} +2 -2
  146. package/build/esm/{index-b6442a0d.js → index-fd294899.js} +20 -20
  147. package/build/esm/{index-4a13f41d.js → index-fe29a330.js} +1 -1
  148. package/build/esm/index.js +112 -112
  149. package/build/esm/interfaces/types/index.d.ts +1 -0
  150. package/build/esm/{labelSorting-76cf0104.js → labelSorting-9b37b0d6.js} +4 -4
  151. package/build/esm/lead/index.d.ts +3 -1
  152. package/build/esm/lead.js +25 -25
  153. package/build/esm/{logoIcon-90c6ed4d.js → logoIcon-c0e996da.js} +2 -2
  154. package/build/esm/mantine.js +25 -25
  155. package/build/esm/misc.js +16 -16
  156. package/build/esm/miscGetDynamicHealthTool.js +4 -4
  157. package/build/esm/miscGetSocialList.js +8 -8
  158. package/build/esm/miscScreenSizeContext.js +1 -1
  159. package/build/esm/mobileBottomNavigation.js +5 -5
  160. package/build/esm/mobileBottomNavigationIcon.js +5 -5
  161. package/build/esm/molecules.js +69 -69
  162. package/build/esm/moleculesArticleCard.js +6 -6
  163. package/build/esm/moleculesArticleCardV2.js +16 -16
  164. package/build/esm/navigation.js +40 -40
  165. package/build/esm/navigationLogoutPopup.js +9 -9
  166. package/build/esm/navigationProfileButton.js +23 -23
  167. package/build/esm/onboardingV2.js +29 -29
  168. package/build/esm/organisms.js +44 -44
  169. package/build/esm/{post-0c8fcb47.js → post-5f2dcee7.js} +2 -2
  170. package/build/esm/profileNavigation.js +19 -19
  171. package/build/esm/progressBar.js +1 -1
  172. package/build/esm/pwg.js +22 -22
  173. package/build/esm/ssoV2/api/index.d.ts +1 -1
  174. package/build/esm/ssoV2/api/paths.d.ts +1 -0
  175. package/build/esm/ssoV2/index.d.ts +8 -0
  176. package/build/esm/ssoV2/screens/components/progressBar.d.ts +15 -0
  177. package/build/esm/ssoV2/screens/components/progressBar.utils.d.ts +9 -0
  178. package/build/esm/ssoV2/screens/components/setupLater.d.ts +6 -0
  179. package/build/esm/ssoV2/screens/components/zalo.d.ts +6 -0
  180. package/build/esm/ssoV2/screens/setup/otherSetup.d.ts +1 -1
  181. package/build/esm/ssoV2/ssoStateManager/store.d.ts +14 -0
  182. package/build/esm/ssoV2.js +594 -304
  183. package/build/esm/{store-2a1b6eeb.js → store-c97a7b72.js} +42 -19
  184. package/build/esm/subot.js +33 -33
  185. package/build/esm/surveyOrPremiumBanner.js +31 -31
  186. package/build/esm/surveyQuestionCard.js +10 -10
  187. package/build/esm/{surveyThankyouCard-876d3fa8.js → surveyThankyouCard-4f4283df.js} +5 -5
  188. package/build/esm/together.js +53 -53
  189. package/build/esm/togetherApiUtils.js +4 -4
  190. package/build/esm/togetherAtoms.js +30 -30
  191. package/build/esm/togetherComponentGlobalContext.js +4 -4
  192. package/build/esm/togetherMolecules.js +48 -48
  193. package/build/esm/togetherMoleculesCardAuthor.js +27 -27
  194. package/build/esm/togetherMoleculesPostImagePreview.js +11 -11
  195. package/build/esm/togetherMoleculesProfileDetail.js +37 -37
  196. package/build/esm/togetherOrganisms.js +47 -47
  197. package/build/esm/togetherRichTextEditor.js +17 -17
  198. package/build/esm/togetherShareBox.js +10 -10
  199. package/build/esm/{treePopoverMenu-b567b402.js → treePopoverMenu-efaf6ef6.js} +19 -19
  200. package/build/esm/{types-98286e03.js → types-5a014d9e.js} +2 -2
  201. package/build/esm/types.js +2 -2
  202. package/build/esm/{useCategory-e9703fcc.js → useCategory-5586fd98.js} +5 -5
  203. package/build/esm/{useHealthToolCache-497b3113.js → useHealthToolCache-9b53d1dc.js} +1 -1
  204. package/build/esm/{useMantineLocale-bd1e758a.js → useMantineLocale-d719cece.js} +6 -6
  205. package/build/esm/{usePlacesAutocomplete-d6c6019b.js → usePlacesAutocomplete-dd73e88c.js} +1 -1
  206. package/build/esm/{useScreenSize-40c82c05.js → useScreenSize-ec9488ba.js} +2 -2
  207. package/build/esm/useTogetherAuthRequiredAction.js +9 -9
  208. package/build/esm/{utils-5f291626.js → utils-154d7c18.js} +2 -2
  209. package/build/esm/{utils-e5d33fe3.js → utils-339deebd.js} +2 -2
  210. package/build/esm/{utils-10430638.js → utils-f2f650b5.js} +3 -3
  211. package/build/esm/vaccination.js +21 -21
  212. package/build/{fixedBottomAdBlock-fb98a4e6.js → fixedBottomAdBlock-d11163cf.js} +24 -24
  213. package/build/footer.js +21 -21
  214. package/build/gAssets.js +2 -2
  215. package/build/healthToolsCardWrapper.js +18 -18
  216. package/build/healthToolsForm.js +33 -33
  217. package/build/hooks.js +13 -13
  218. package/build/i18n/translationKeys.d.ts +1 -1
  219. package/build/i18n-values/en-PH.js +1 -0
  220. package/build/i18n-values/hi-IN.js +1 -0
  221. package/build/i18n-values/id-ID.js +1 -0
  222. package/build/i18n-values/km-KH.js +2 -1
  223. package/build/i18n-values/ms-MY.js +1 -0
  224. package/build/i18n-values/my-MM.js +1 -0
  225. package/build/i18n-values/th-TH.js +1 -0
  226. package/build/i18n-values/tl-PH.js +1 -0
  227. package/build/i18n-values/vi-VN.js +1 -0
  228. package/build/i18n-values/vi-VN_MB.js +1 -0
  229. package/build/i18n-values/zh-TW.js +1 -0
  230. package/build/i18n.js +1 -1
  231. package/build/i18nV2.js +1 -1
  232. package/build/{index-46b2200b.js → index-00a80576.js} +16 -16
  233. package/build/{index-969cd112.js → index-045fe9d6.js} +11 -11
  234. package/build/{index-2baef874.js → index-06768359.js} +1 -1
  235. package/build/{index-76efb5fb.js → index-0b301a1a.js} +1 -1
  236. package/build/{index-e67c5ae1.js → index-152599c0.js} +1 -1
  237. package/build/{index-3c10fbfa.js → index-171f6c0b.js} +2 -2
  238. package/build/{index-4ee89043.js → index-1e629398.js} +3 -3
  239. package/build/{index-95ccdb7f.js → index-1eb974e2.js} +3 -3
  240. package/build/{index-23805e05.js → index-2b8b3216.js} +6 -6
  241. package/build/{index-286cce3b.js → index-31f7b614.js} +17 -17
  242. package/build/{index-9de29abf.js → index-39fb5e28.js} +16 -16
  243. package/build/{index-4b623617.js → index-3c5d5f30.js} +2 -2
  244. package/build/{index-ee69c925.js → index-3d06c3a5.js} +2 -2
  245. package/build/{index-90ab1ea7.js → index-402f8f5e.js} +3 -3
  246. package/build/{index-5874bcf9.js → index-46f19eb1.js} +6 -6
  247. package/build/{index-9e2d7c97.js → index-4b521427.js} +5 -5
  248. package/build/{index-1d6281f6.js → index-4d7cafe2.js} +1 -1
  249. package/build/{index-bfad3960.js → index-536bfd81.js} +2 -2
  250. package/build/{index-ad33b8f9.js → index-562970dd.js} +16 -16
  251. package/build/{index-9a625f5e.js → index-586afd16.js} +13 -13
  252. package/build/{index-3aec5aee.js → index-59858544.js} +2 -2
  253. package/build/{index-e208b34a.js → index-62cdb55a.js} +13 -13
  254. package/build/{index-e811fb10.js → index-65d47f96.js} +13 -13
  255. package/build/{index-e1e08c25.js → index-686dd591.js} +2 -2
  256. package/build/{index-89b71178.js → index-6c4f66ba.js} +3 -3
  257. package/build/{index-b6d27f9a.js → index-7c6796a2.js} +21 -21
  258. package/build/{index-96be67bf.js → index-81a908e6.js} +2 -2
  259. package/build/{index-c3785047.js → index-889fee34.js} +2 -2
  260. package/build/{index-8fc3d400.js → index-89fa2faa.js} +7 -7
  261. package/build/{index-0c5b5a40.js → index-8a2ef4de.js} +20 -20
  262. package/build/{index-1f9ad2eb.js → index-8d8e369e.js} +1 -1
  263. package/build/{index-4df71ee6.js → index-8edefd6c.js} +17 -17
  264. package/build/{index-9125292c.js → index-90f2794a.js} +3 -3
  265. package/build/{index-40771dad.js → index-a70c4fdb.js} +3 -3
  266. package/build/{index-188f5a1c.js → index-a7aeb365.js} +2 -2
  267. package/build/{index-53aa2337.js → index-a868c1c2.js} +15 -15
  268. package/build/{index-fd92c8a1.js → index-a870bcb7.js} +6 -6
  269. package/build/{index-e8747d65.js → index-af97f431.js} +13 -13
  270. package/build/{index-e649c3f8.js → index-b59054dc.js} +6 -6
  271. package/build/{index-d3872755.js → index-c682786d.js} +2 -2
  272. package/build/{index-34fe205a.js → index-ca0f608b.js} +10 -10
  273. package/build/{index-2551c303.js → index-cb6c8cd9.js} +1 -1
  274. package/build/{index-4f1ed7eb.js → index-cf457cd1.js} +2 -2
  275. package/build/{index-56fff3f2.js → index-d2e93c87.js} +1 -1
  276. package/build/{index-6089f95a.js → index-d9653d1a.js} +16 -16
  277. package/build/{index-55e75fea.js → index-dba4940d.js} +18 -18
  278. package/build/{index-6ee7fe98.js → index-dbea7439.js} +30 -30
  279. package/build/{index-c08747a6.js → index-de30f501.js} +26 -26
  280. package/build/{index-685db51a.js → index-e0032e99.js} +24 -24
  281. package/build/{index-95320aa8.js → index-e0ac43ae.js} +1 -1
  282. package/build/{index-4a04c1d8.js → index-e6d5eb02.js} +7 -7
  283. package/build/{index-ea370ff2.js → index-e7d5ec68.js} +17 -17
  284. package/build/{index-2e0023c8.js → index-e9cdd0ff.js} +15 -15
  285. package/build/{index-a834d49b.js → index-ead35dec.js} +3 -3
  286. package/build/{index-8aad4619.js → index-eb7cf902.js} +18 -18
  287. package/build/{index-99410d26.js → index-ec07d952.js} +2 -2
  288. package/build/{index-1e0434fd.js → index-f143d837.js} +5 -5
  289. package/build/{index-aef6ff34.js → index-f22365a5.js} +32 -32
  290. package/build/{index-606a09c0.js → index-f46b29a6.js} +1 -1
  291. package/build/{index-32f52199.js → index-f6800516.js} +4 -4
  292. package/build/index.js +112 -112
  293. package/build/interfaces/types/index.d.ts +1 -0
  294. package/build/{labelSorting-95a1a528.js → labelSorting-9c64df57.js} +4 -4
  295. package/build/lead/index.d.ts +3 -1
  296. package/build/lead.js +26 -24
  297. package/build/{logoIcon-e5bd7343.js → logoIcon-753519a3.js} +2 -2
  298. package/build/mantine.js +22 -22
  299. package/build/misc.js +16 -16
  300. package/build/miscGetDynamicHealthTool.js +4 -4
  301. package/build/miscGetSocialList.js +8 -8
  302. package/build/miscScreenSizeContext.js +1 -1
  303. package/build/mobileBottomNavigation.js +5 -5
  304. package/build/mobileBottomNavigationIcon.js +5 -5
  305. package/build/molecules.js +69 -69
  306. package/build/moleculesArticleCard.js +6 -6
  307. package/build/moleculesArticleCardV2.js +16 -16
  308. package/build/navigation.js +40 -40
  309. package/build/navigationLogoutPopup.js +9 -9
  310. package/build/navigationProfileButton.js +23 -23
  311. package/build/onboardingV2.js +28 -28
  312. package/build/organisms.js +44 -44
  313. package/build/{post-88476eaa.js → post-ca9f57f0.js} +2 -2
  314. package/build/profileNavigation.js +19 -19
  315. package/build/progressBar.js +1 -1
  316. package/build/pwg.js +22 -22
  317. package/build/ssoV2/api/index.d.ts +1 -1
  318. package/build/ssoV2/api/paths.d.ts +1 -0
  319. package/build/ssoV2/index.d.ts +8 -0
  320. package/build/ssoV2/screens/components/progressBar.d.ts +15 -0
  321. package/build/ssoV2/screens/components/progressBar.utils.d.ts +9 -0
  322. package/build/ssoV2/screens/components/setupLater.d.ts +6 -0
  323. package/build/ssoV2/screens/components/zalo.d.ts +6 -0
  324. package/build/ssoV2/screens/setup/otherSetup.d.ts +1 -1
  325. package/build/ssoV2/ssoStateManager/store.d.ts +14 -0
  326. package/build/ssoV2.js +590 -300
  327. package/build/{store-69bb3be7.js → store-9549ce58.js} +44 -18
  328. package/build/subot.js +32 -32
  329. package/build/surveyOrPremiumBanner.js +31 -31
  330. package/build/surveyQuestionCard.js +10 -10
  331. package/build/{surveyThankyouCard-56f0ae37.js → surveyThankyouCard-b24e6094.js} +5 -5
  332. package/build/together.js +53 -53
  333. package/build/togetherApiUtils.js +4 -4
  334. package/build/togetherAtoms.js +30 -30
  335. package/build/togetherComponentGlobalContext.js +4 -4
  336. package/build/togetherMolecules.js +48 -48
  337. package/build/togetherMoleculesCardAuthor.js +27 -27
  338. package/build/togetherMoleculesPostImagePreview.js +11 -11
  339. package/build/togetherMoleculesProfileDetail.js +37 -37
  340. package/build/togetherOrganisms.js +47 -47
  341. package/build/togetherRichTextEditor.js +17 -17
  342. package/build/togetherShareBox.js +10 -10
  343. package/build/{treePopoverMenu-87ca9b4c.js → treePopoverMenu-3e90a4cd.js} +19 -19
  344. package/build/{types-267e6ecb.js → types-45af02fd.js} +2 -2
  345. package/build/types.js +2 -2
  346. package/build/{useCategory-601dc682.js → useCategory-34c7076e.js} +5 -5
  347. package/build/{useHealthToolCache-fb8ea8e7.js → useHealthToolCache-a632736f.js} +1 -1
  348. package/build/{useMantineLocale-48052e4d.js → useMantineLocale-6fa1608c.js} +6 -6
  349. package/build/{usePlacesAutocomplete-32fb6ea6.js → usePlacesAutocomplete-4143e54b.js} +1 -1
  350. package/build/{useScreenSize-e56ada5a.js → useScreenSize-a1946b66.js} +2 -2
  351. package/build/useTogetherAuthRequiredAction.js +9 -9
  352. package/build/{utils-bc112548.js → utils-270e8215.js} +2 -2
  353. package/build/{utils-51039a43.js → utils-5826dc4f.js} +2 -2
  354. package/build/{utils-741b2173.js → utils-5dc1b399.js} +3 -3
  355. package/build/vaccination.js +21 -21
  356. package/package.json +1 -1
  357. /package/build/{BMI_BOYS.percentile.monthly-93d6990e.js → BMI_BOYS.percentile.monthly-a884e02d.js} +0 -0
  358. /package/build/{BMI_BOYS.percentile.weekly-9de93fe7.js → BMI_BOYS.percentile.weekly-fb2abbd8.js} +0 -0
  359. /package/build/{BMI_BOYS.percentile.yearly-a40e7b56.js → BMI_BOYS.percentile.yearly-9156b8ea.js} +0 -0
  360. /package/build/{BMI_BOYS.zscore.monthly-ba9026f5.js → BMI_BOYS.zscore.monthly-cbc1aca1.js} +0 -0
  361. /package/build/{BMI_BOYS.zscore.weekly-a7de23e7.js → BMI_BOYS.zscore.weekly-8d77bfab.js} +0 -0
  362. /package/build/{BMI_BOYS.zscore.yearly-1416c78c.js → BMI_BOYS.zscore.yearly-13444379.js} +0 -0
  363. /package/build/{BMI_GIRLS.percentile.monthly-4790fce8.js → BMI_GIRLS.percentile.monthly-9963af5b.js} +0 -0
  364. /package/build/{BMI_GIRLS.percentile.weekly-f929726a.js → BMI_GIRLS.percentile.weekly-a2a716b9.js} +0 -0
  365. /package/build/{BMI_GIRLS.percentile.yearly-4387c6c5.js → BMI_GIRLS.percentile.yearly-664d5c66.js} +0 -0
  366. /package/build/{BMI_GIRLS.zscore.monthly-4c264643.js → BMI_GIRLS.zscore.monthly-cded90b2.js} +0 -0
  367. /package/build/{BMI_GIRLS.zscore.weekly-a133bb6e.js → BMI_GIRLS.zscore.weekly-8232c588.js} +0 -0
  368. /package/build/{BMI_GIRLS.zscore.yearly-a0404db2.js → BMI_GIRLS.zscore.yearly-7a7495d4.js} +0 -0
  369. /package/build/{ChevronDown-aaa35ea2.js → ChevronDown-e762a3e5.js} +0 -0
  370. /package/build/{Close-6c6e9720.js → Close-46e8f185.js} +0 -0
  371. /package/build/{Google-10b046ef.js → Google-48b0994b.js} +0 -0
  372. /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-f63b1535.js → HEAD CIRCUM_BOYS.percentile.monthly-e8a502b2.js} +0 -0
  373. /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-5a387c89.js → HEAD CIRCUM_BOYS.percentile.weekly-9fb62093.js} +0 -0
  374. /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-e257b63e.js → HEAD CIRCUM_BOYS.percentile.yearly-3f23c2b6.js} +0 -0
  375. /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-2676a44b.js → HEAD CIRCUM_BOYS.zscore.monthly-51e30970.js} +0 -0
  376. /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-4fee3b5b.js → HEAD CIRCUM_BOYS.zscore.weekly-466a0d05.js} +0 -0
  377. /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-545e264d.js → HEAD CIRCUM_BOYS.zscore.yearly-7145e5ae.js} +0 -0
  378. /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-ae0d3971.js → HEAD CIRCUM_GIRLS.percentile.monthly-687c6c5e.js} +0 -0
  379. /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-b472028c.js → HEAD CIRCUM_GIRLS.percentile.weekly-719f1622.js} +0 -0
  380. /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-7a362bfe.js → HEAD CIRCUM_GIRLS.percentile.yearly-bac02af6.js} +0 -0
  381. /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-e48d6185.js → HEAD CIRCUM_GIRLS.zscore.monthly-c743e161.js} +0 -0
  382. /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-8a9676c2.js → HEAD CIRCUM_GIRLS.zscore.weekly-bcb9413e.js} +0 -0
  383. /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-d213569e.js → HEAD CIRCUM_GIRLS.zscore.yearly-9bf782e7.js} +0 -0
  384. /package/build/{HEIGHT_BOYS.percentile.monthly-57cf9281.js → HEIGHT_BOYS.percentile.monthly-83df762b.js} +0 -0
  385. /package/build/{HEIGHT_BOYS.percentile.weekly-155a877f.js → HEIGHT_BOYS.percentile.weekly-631c066b.js} +0 -0
  386. /package/build/{HEIGHT_BOYS.percentile.yearly-94b0bdeb.js → HEIGHT_BOYS.percentile.yearly-e5298975.js} +0 -0
  387. /package/build/{HEIGHT_BOYS.zscore.monthly-4d7065ee.js → HEIGHT_BOYS.zscore.monthly-f6a1a8c2.js} +0 -0
  388. /package/build/{HEIGHT_BOYS.zscore.weekly-cc0f3ef4.js → HEIGHT_BOYS.zscore.weekly-0e2c6eac.js} +0 -0
  389. /package/build/{HEIGHT_BOYS.zscore.yearly-1d12eeaa.js → HEIGHT_BOYS.zscore.yearly-08d68cb4.js} +0 -0
  390. /package/build/{HEIGHT_GIRLS.percentile.monthly-5af692bf.js → HEIGHT_GIRLS.percentile.monthly-b36b2c3d.js} +0 -0
  391. /package/build/{HEIGHT_GIRLS.percentile.weekly-82607a5b.js → HEIGHT_GIRLS.percentile.weekly-51ab6ace.js} +0 -0
  392. /package/build/{HEIGHT_GIRLS.percentile.yearly-1f188b70.js → HEIGHT_GIRLS.percentile.yearly-0f8e54e4.js} +0 -0
  393. /package/build/{HEIGHT_GIRLS.zscore.monthly-20f568c9.js → HEIGHT_GIRLS.zscore.monthly-cf0bd1be.js} +0 -0
  394. /package/build/{HEIGHT_GIRLS.zscore.weekly-351d9c9c.js → HEIGHT_GIRLS.zscore.weekly-4e7b8f9b.js} +0 -0
  395. /package/build/{HEIGHT_GIRLS.zscore.yearly-66277de4.js → HEIGHT_GIRLS.zscore.yearly-22a86cb8.js} +0 -0
  396. /package/build/{Locale-4c8042b0.js → Locale-2499969c.js} +0 -0
  397. /package/build/{Visible-fd04e5be.js → Visible-5789d8b3.js} +0 -0
  398. /package/build/{WEIGHT_BOYS.percentile.monthly-98d965cb.js → WEIGHT_BOYS.percentile.monthly-216cd59d.js} +0 -0
  399. /package/build/{WEIGHT_BOYS.percentile.weekly-8f8e8921.js → WEIGHT_BOYS.percentile.weekly-57b648aa.js} +0 -0
  400. /package/build/{WEIGHT_BOYS.percentile.yearly-154795f6.js → WEIGHT_BOYS.percentile.yearly-15997899.js} +0 -0
  401. /package/build/{WEIGHT_BOYS.zscore.monthly-d0519c13.js → WEIGHT_BOYS.zscore.monthly-531a41a7.js} +0 -0
  402. /package/build/{WEIGHT_BOYS.zscore.weekly-e1ead695.js → WEIGHT_BOYS.zscore.weekly-bca577e1.js} +0 -0
  403. /package/build/{WEIGHT_BOYS.zscore.yearly-2fe02df0.js → WEIGHT_BOYS.zscore.yearly-e9d655c4.js} +0 -0
  404. /package/build/{WEIGHT_GIRLS.percentile.monthly-3efc2d52.js → WEIGHT_GIRLS.percentile.monthly-868f1fbb.js} +0 -0
  405. /package/build/{WEIGHT_GIRLS.percentile.weekly-dc56f5bc.js → WEIGHT_GIRLS.percentile.weekly-f43cd5d6.js} +0 -0
  406. /package/build/{WEIGHT_GIRLS.percentile.yearly-7e0956b7.js → WEIGHT_GIRLS.percentile.yearly-92955051.js} +0 -0
  407. /package/build/{WEIGHT_GIRLS.zscore.monthly-cafaa82f.js → WEIGHT_GIRLS.zscore.monthly-972c5684.js} +0 -0
  408. /package/build/{WEIGHT_GIRLS.zscore.weekly-68994c02.js → WEIGHT_GIRLS.zscore.weekly-54cdbd08.js} +0 -0
  409. /package/build/{WEIGHT_GIRLS.zscore.yearly-2981a41f.js → WEIGHT_GIRLS.zscore.yearly-17ad5cf5.js} +0 -0
  410. /package/build/{animation-b507cd11.js → animation-f57b974d.js} +0 -0
  411. /package/build/{constants-2b28086d.js → constants-0635b13c.js} +0 -0
  412. /package/build/{constants-992b0578.js → constants-53c083f1.js} +0 -0
  413. /package/build/{constants-10359dd4.js → constants-e4f3f287.js} +0 -0
  414. /package/build/{dataTransform-6e222d1a.js → dataTransform-d85e8fbe.js} +0 -0
  415. /package/build/{doctor-b2ec210f.js → doctor-f465ad0b.js} +0 -0
  416. /package/build/esm/{BMI_BOYS.percentile.monthly-a07f0f54.js → BMI_BOYS.percentile.monthly-a2897ca9.js} +0 -0
  417. /package/build/esm/{BMI_BOYS.percentile.weekly-85dbca5e.js → BMI_BOYS.percentile.weekly-a809506e.js} +0 -0
  418. /package/build/esm/{BMI_BOYS.percentile.yearly-f41886bc.js → BMI_BOYS.percentile.yearly-3db825bc.js} +0 -0
  419. /package/build/esm/{BMI_BOYS.zscore.monthly-ea595935.js → BMI_BOYS.zscore.monthly-f14db0ec.js} +0 -0
  420. /package/build/esm/{BMI_BOYS.zscore.weekly-7d9c599e.js → BMI_BOYS.zscore.weekly-2ad4ac07.js} +0 -0
  421. /package/build/esm/{BMI_BOYS.zscore.yearly-805285c0.js → BMI_BOYS.zscore.yearly-c940a8ed.js} +0 -0
  422. /package/build/esm/{BMI_GIRLS.percentile.monthly-540f6f76.js → BMI_GIRLS.percentile.monthly-bf529e16.js} +0 -0
  423. /package/build/esm/{BMI_GIRLS.percentile.weekly-57919e11.js → BMI_GIRLS.percentile.weekly-3272570f.js} +0 -0
  424. /package/build/esm/{BMI_GIRLS.percentile.yearly-93301c51.js → BMI_GIRLS.percentile.yearly-0b1699a2.js} +0 -0
  425. /package/build/esm/{BMI_GIRLS.zscore.monthly-da84c887.js → BMI_GIRLS.zscore.monthly-6a85e1eb.js} +0 -0
  426. /package/build/esm/{BMI_GIRLS.zscore.weekly-0955bde2.js → BMI_GIRLS.zscore.weekly-ef332530.js} +0 -0
  427. /package/build/esm/{BMI_GIRLS.zscore.yearly-971fce28.js → BMI_GIRLS.zscore.yearly-d1c3f3f3.js} +0 -0
  428. /package/build/esm/{ChevronDown-1e78a8e7.js → ChevronDown-26c20357.js} +0 -0
  429. /package/build/esm/{Close-d0842035.js → Close-c109f586.js} +0 -0
  430. /package/build/esm/{Google-64dc9f05.js → Google-1ea2f735.js} +0 -0
  431. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.monthly-c15a00f2.js → HEAD CIRCUM_BOYS.percentile.monthly-2fdf46e8.js} +0 -0
  432. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.weekly-954bfb7e.js → HEAD CIRCUM_BOYS.percentile.weekly-0976758b.js} +0 -0
  433. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.yearly-821fc4f5.js → HEAD CIRCUM_BOYS.percentile.yearly-31850315.js} +0 -0
  434. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.monthly-db8b365a.js → HEAD CIRCUM_BOYS.zscore.monthly-fadb2438.js} +0 -0
  435. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.weekly-eb78ff15.js → HEAD CIRCUM_BOYS.zscore.weekly-81bf5027.js} +0 -0
  436. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.yearly-ec7bc0b9.js → HEAD CIRCUM_BOYS.zscore.yearly-79245bec.js} +0 -0
  437. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.monthly-4cda8496.js → HEAD CIRCUM_GIRLS.percentile.monthly-8c310cfa.js} +0 -0
  438. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.weekly-fede4105.js → HEAD CIRCUM_GIRLS.percentile.weekly-4a7d3faf.js} +0 -0
  439. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.yearly-dccd0acf.js → HEAD CIRCUM_GIRLS.percentile.yearly-50da1b56.js} +0 -0
  440. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.monthly-14e6354f.js → HEAD CIRCUM_GIRLS.zscore.monthly-c36936e3.js} +0 -0
  441. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.weekly-b2f1adef.js → HEAD CIRCUM_GIRLS.zscore.weekly-5263ac1a.js} +0 -0
  442. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.yearly-d01b98b8.js → HEAD CIRCUM_GIRLS.zscore.yearly-5ba4510e.js} +0 -0
  443. /package/build/esm/{HEIGHT_BOYS.percentile.monthly-82e1ff12.js → HEIGHT_BOYS.percentile.monthly-00dbf0b1.js} +0 -0
  444. /package/build/esm/{HEIGHT_BOYS.percentile.weekly-2ad2d4ca.js → HEIGHT_BOYS.percentile.weekly-9d33d66b.js} +0 -0
  445. /package/build/esm/{HEIGHT_BOYS.percentile.yearly-7086aebe.js → HEIGHT_BOYS.percentile.yearly-5889f9f8.js} +0 -0
  446. /package/build/esm/{HEIGHT_BOYS.zscore.monthly-838e2b31.js → HEIGHT_BOYS.zscore.monthly-0a5fef7b.js} +0 -0
  447. /package/build/esm/{HEIGHT_BOYS.zscore.weekly-e4449bdc.js → HEIGHT_BOYS.zscore.weekly-0e30ac0a.js} +0 -0
  448. /package/build/esm/{HEIGHT_BOYS.zscore.yearly-23327e54.js → HEIGHT_BOYS.zscore.yearly-8b3c9655.js} +0 -0
  449. /package/build/esm/{HEIGHT_GIRLS.percentile.monthly-4d4e9eb8.js → HEIGHT_GIRLS.percentile.monthly-de5e8823.js} +0 -0
  450. /package/build/esm/{HEIGHT_GIRLS.percentile.weekly-56a63779.js → HEIGHT_GIRLS.percentile.weekly-daf86288.js} +0 -0
  451. /package/build/esm/{HEIGHT_GIRLS.percentile.yearly-4489fbb4.js → HEIGHT_GIRLS.percentile.yearly-a445137c.js} +0 -0
  452. /package/build/esm/{HEIGHT_GIRLS.zscore.monthly-32157cb0.js → HEIGHT_GIRLS.zscore.monthly-cebb3d6e.js} +0 -0
  453. /package/build/esm/{HEIGHT_GIRLS.zscore.weekly-082dac9e.js → HEIGHT_GIRLS.zscore.weekly-307d7ec8.js} +0 -0
  454. /package/build/esm/{HEIGHT_GIRLS.zscore.yearly-5deb5013.js → HEIGHT_GIRLS.zscore.yearly-a4d970ce.js} +0 -0
  455. /package/build/esm/{Locale-05f46f2a.js → Locale-ca064114.js} +0 -0
  456. /package/build/esm/{Visible-fd6bc425.js → Visible-10c939ba.js} +0 -0
  457. /package/build/esm/{WEIGHT_BOYS.percentile.monthly-1c1fad72.js → WEIGHT_BOYS.percentile.monthly-cf8fd0a1.js} +0 -0
  458. /package/build/esm/{WEIGHT_BOYS.percentile.weekly-6d494fdd.js → WEIGHT_BOYS.percentile.weekly-9651ac69.js} +0 -0
  459. /package/build/esm/{WEIGHT_BOYS.percentile.yearly-9be5f2bb.js → WEIGHT_BOYS.percentile.yearly-e71e62bc.js} +0 -0
  460. /package/build/esm/{WEIGHT_BOYS.zscore.monthly-fc1521fe.js → WEIGHT_BOYS.zscore.monthly-f7f4c5bc.js} +0 -0
  461. /package/build/esm/{WEIGHT_BOYS.zscore.weekly-8485d2f3.js → WEIGHT_BOYS.zscore.weekly-c0ea4686.js} +0 -0
  462. /package/build/esm/{WEIGHT_BOYS.zscore.yearly-e232227b.js → WEIGHT_BOYS.zscore.yearly-e1ae8f58.js} +0 -0
  463. /package/build/esm/{WEIGHT_GIRLS.percentile.monthly-4736c7aa.js → WEIGHT_GIRLS.percentile.monthly-325b071c.js} +0 -0
  464. /package/build/esm/{WEIGHT_GIRLS.percentile.weekly-00d5d075.js → WEIGHT_GIRLS.percentile.weekly-9ed5e034.js} +0 -0
  465. /package/build/esm/{WEIGHT_GIRLS.percentile.yearly-17fafef1.js → WEIGHT_GIRLS.percentile.yearly-ff12b7d2.js} +0 -0
  466. /package/build/esm/{WEIGHT_GIRLS.zscore.monthly-0f34e73c.js → WEIGHT_GIRLS.zscore.monthly-9f996595.js} +0 -0
  467. /package/build/esm/{WEIGHT_GIRLS.zscore.weekly-7df80bb8.js → WEIGHT_GIRLS.zscore.weekly-b25bbe9f.js} +0 -0
  468. /package/build/esm/{WEIGHT_GIRLS.zscore.yearly-9b920f57.js → WEIGHT_GIRLS.zscore.yearly-95cf54c6.js} +0 -0
  469. /package/build/esm/{animation-8e63068e.js → animation-ee820de5.js} +0 -0
  470. /package/build/esm/{constants-fff0e873.js → constants-1a6da7bf.js} +0 -0
  471. /package/build/esm/{constants-1ed528a3.js → constants-893878b5.js} +0 -0
  472. /package/build/esm/{constants-25cc884e.js → constants-c1fd11ff.js} +0 -0
  473. /package/build/esm/{dataTransform-7f13a99d.js → dataTransform-4580bda2.js} +0 -0
  474. /package/build/esm/{doctor-e1757149.js → doctor-9b0f96eb.js} +0 -0
  475. /package/build/esm/{index-c02e04f4.js → index-07bf5594.js} +0 -0
  476. /package/build/esm/{index-0552435e.js → index-08bd9deb.js} +0 -0
  477. /package/build/esm/{index-d50c1b6d.js → index-51d21547.js} +0 -0
  478. /package/build/esm/{index-3f41e1e2.js → index-8184c6c4.js} +0 -0
  479. /package/build/esm/{index-cef61a9e.js → index-863d46f2.js} +0 -0
  480. /package/build/esm/{index-618f0b0c.js → index-8f0506a3.js} +0 -0
  481. /package/build/esm/{index-84bd0271.js → index-a46ac796.js} +0 -0
  482. /package/build/esm/{index-d3f5d34b.js → index-e5266a44.js} +0 -0
  483. /package/build/esm/{index-f4597cea.js → index-f7b7f379.js} +0 -0
  484. /package/build/esm/{index.styles-dfe31537.js → index.styles-e2fabf72.js} +0 -0
  485. /package/build/esm/{localizeNumberFormat-c14eab14.js → localizeNumberFormat-6f3ec904.js} +0 -0
  486. /package/build/esm/{normalizeLink-2bf24c8c.js → normalizeLink-659f4fc2.js} +0 -0
  487. /package/build/esm/{other-8e7af889.js → other-a9ddfef3.js} +0 -0
  488. /package/build/esm/{paths-a859c358.js → paths-c9acae97.js} +0 -0
  489. /package/build/esm/{translationsContext-b6c33e91.js → translationsContext-77ad18c1.js} +0 -0
  490. /package/build/esm/{tslib.es6-709d7787.js → tslib.es6-dc0b4bb5.js} +0 -0
  491. /package/build/esm/{types-0904d32f.js → types-0f5f6faa.js} +0 -0
  492. /package/build/esm/{useIsInit-3383f41b.js → useIsInit-084c9527.js} +0 -0
  493. /package/build/esm/{useOutsideClick-11006abd.js → useOutsideClick-1121c143.js} +0 -0
  494. /package/build/esm/{useScrollbarSize-c15fd39e.js → useScrollbarSize-461ff3f3.js} +0 -0
  495. /package/build/esm/{useUniqueId-cf5d6065.js → useUniqueId-ef63b218.js} +0 -0
  496. /package/build/esm/{utils-e21b8836.js → utils-98ba790c.js} +0 -0
  497. /package/build/{index-6cb41f70.js → index-20ecf9c2.js} +0 -0
  498. /package/build/{index-0d669510.js → index-27837d33.js} +0 -0
  499. /package/build/{index-ba7abd78.js → index-3bdd572d.js} +0 -0
  500. /package/build/{index-44dd2ed3.js → index-61493b41.js} +0 -0
  501. /package/build/{index-c2436bb5.js → index-83e69b8d.js} +0 -0
  502. /package/build/{index-8fc12b04.js → index-c657f20c.js} +0 -0
  503. /package/build/{index-39237568.js → index-d41cd58d.js} +0 -0
  504. /package/build/{index-c7782352.js → index-f3a90e89.js} +0 -0
  505. /package/build/{index-950cbd1e.js → index-f5f9e6ba.js} +0 -0
  506. /package/build/{index.styles-483ecf51.js → index.styles-7c49bacd.js} +0 -0
  507. /package/build/{localizeNumberFormat-c35b4fab.js → localizeNumberFormat-186a3dfb.js} +0 -0
  508. /package/build/{normalizeLink-d98c5115.js → normalizeLink-12f9515f.js} +0 -0
  509. /package/build/{other-a39e1798.js → other-61f740aa.js} +0 -0
  510. /package/build/{paths-cc67867e.js → paths-cfd54742.js} +0 -0
  511. /package/build/{translationsContext-9fb25554.js → translationsContext-6ed3ca43.js} +0 -0
  512. /package/build/{tslib.es6-54d5a3b5.js → tslib.es6-59a63be1.js} +0 -0
  513. /package/build/{types-5e6fd5c4.js → types-331482e6.js} +0 -0
  514. /package/build/{useIsInit-044fcacb.js → useIsInit-db0cef33.js} +0 -0
  515. /package/build/{useOutsideClick-e29d71c0.js → useOutsideClick-415ddf5e.js} +0 -0
  516. /package/build/{useScrollbarSize-46c0ff33.js → useScrollbarSize-278c96a7.js} +0 -0
  517. /package/build/{useUniqueId-45824993.js → useUniqueId-bd1728ba.js} +0 -0
  518. /package/build/{utils-ca404e47.js → utils-70b74b65.js} +0 -0
@@ -1,27 +1,27 @@
1
- import { a as __awaiter, _ as __rest } from './tslib.es6-709d7787.js';
2
- import React__default, { createContext, useEffect, useState, useMemo, useCallback, forwardRef } from 'react';
3
- import { I as Input, s as styles, O as OTP, f as PasswordInput, R as Radio, E as ErrorBoundary } from './index-b5a40899.js';
4
- import { a as useSSOSteps, f as fetchSSOV2Api, w as websiteId, S as SSO_V2_PATHS, c as checkUserExist, u as useSSOV2Store, b as SSOStepTypeType, F as FacebookAppId, G as GoogleAuthClientId, h as handleAuthSuccess, g as getUserInfo, i as isUserFinishedSetup, d as updateUserInfo, r as resetPassword, e as redirect } from './store-2a1b6eeb.js';
5
- export { u as useSSOV2Store } from './store-2a1b6eeb.js';
1
+ import { a as __awaiter, _ as __rest } from './tslib.es6-dc0b4bb5.js';
2
+ import React__default, { createContext, useMemo, useEffect, useState, useCallback, forwardRef } from 'react';
3
+ import { I as Input, s as styles, O as OTP, f as PasswordInput, E as ErrorBoundary } from './index-d1717b80.js';
4
+ import { S as SSOStepTypeType, a as useSSOSteps, u as useSSOV2Store, i as isUserFinishedSetup, f as fetchSSOV2Api, w as websiteId, b as SSO_V2_PATHS, c as checkUserExist, F as FacebookAppId, G as GoogleAuthClientId, h as handleAuthSuccess, g as getUserInfo, d as updateUserInfo, e as isPhoneNotVerifedYet, j as isLoginWithPhoneNotVerifedYet, k as isFlowFinishedSetup, r as resetPassword, l as redirect } from './store-c97a7b72.js';
5
+ export { u as useSSOV2Store } from './store-c97a7b72.js';
6
6
  import { ChevronLeft } from '@hhgtech/icons/arrow';
7
- import { Close, Search } from '@hhgtech/icons/core';
8
- import { Z as ZINDEX_SSO, L as LOCALE_SPECS, S as STATIC_PAGES } from './index-b4ead995.js';
9
- import { L as LogoIcon } from './logoIcon-90c6ed4d.js';
10
- import { B as Button } from './index-0099b8f2.js';
11
- import { M as Modal } from './index-2bf08a6b.js';
12
- import { Stack, Group, Box } from '@mantine/core';
7
+ import { Close, Search, ReplySquare } from '@hhgtech/icons/core';
8
+ import { Z as ZINDEX_SSO, L as LOCALE_SPECS, S as STATIC_PAGES } from './index-4aa69e87.js';
9
+ import { L as LogoIcon } from './logoIcon-c0e996da.js';
10
+ import { B as Button } from './index-9e5d3098.js';
11
+ import { M as Modal } from './index-6b43b997.js';
12
+ import { Stack, Flex, Box, Group, Divider } from '@mantine/core';
13
13
  import '@mantine/dates';
14
- import './index-4a13f41d.js';
15
- import './index-d50c1b6d.js';
16
- import { s as showNotification } from './useMantineLocale-bd1e758a.js';
17
- import { T as Text } from './index-14bfa2c9.js';
18
- import { u as useTranslations } from './index-6bb36621.js';
14
+ import './index-fe29a330.js';
15
+ import './index-51d21547.js';
16
+ import { s as showNotification } from './useMantineLocale-d719cece.js';
17
+ import { T as Text } from './index-b5967e5a.js';
18
+ import { u as useTranslations } from './index-8feac2e3.js';
19
19
  import '@mantine/hooks';
20
- import './utils-e21b8836.js';
21
- import './other-8e7af889.js';
22
- import './index-6354b22f.js';
23
- import { L as LOCALE } from './Locale-05f46f2a.js';
24
- import { G as Google, F as Facebook } from './Google-64dc9f05.js';
20
+ import './utils-98ba790c.js';
21
+ import './other-a9ddfef3.js';
22
+ import './index-abdd5b13.js';
23
+ import { L as LOCALE } from './Locale-ca064114.js';
24
+ import { G as Google, F as Facebook } from './Google-1ea2f735.js';
25
25
  import { parsePhoneNumber, getCountryCallingCode } from 'react-phone-number-input';
26
26
  import styled from '@emotion/styled';
27
27
  import cn from 'classnames';
@@ -29,28 +29,28 @@ import { CaretDown } from '@hhgtech/icons/other';
29
29
  import debounce from 'lodash/debounce';
30
30
  import throttle from 'lodash/throttle';
31
31
  import Flags from 'react-phone-number-input/flags';
32
- import { u as useScreenSize } from './useScreenSize-40c82c05.js';
32
+ import { u as useScreenSize } from './useScreenSize-ec9488ba.js';
33
33
  import { Drawer } from 'vaul';
34
- import { M as MAPPED_LOCALE } from './utils-5f291626.js';
35
- import { S as Spoiler } from './index-be992c75.js';
34
+ import { M as MAPPED_LOCALE } from './utils-154d7c18.js';
35
+ import { S as Spoiler } from './index-74d19a0c.js';
36
36
  import { domainLocales } from './constantsDomainLocales.js';
37
37
  import { useForm, yupResolver } from '@mantine/form';
38
38
  import * as yup from 'yup';
39
39
  import dayjs from 'dayjs';
40
- import { D as DatePicker } from './index-6c43703a.js';
40
+ import { D as DatePicker } from './index-26335a2a.js';
41
41
  import '@mantine/carousel';
42
42
  import './miscTheme.js';
43
- import './useUniqueId-cf5d6065.js';
43
+ import './useUniqueId-ef63b218.js';
44
44
  import './constantsSite.js';
45
45
  import 'zustand';
46
46
  import './constantsIsProduction.js';
47
- import './normalizeLink-2bf24c8c.js';
47
+ import './normalizeLink-659f4fc2.js';
48
48
  import './miscCookieHelper.js';
49
49
  import 'date-fns/locale';
50
50
  import './constantsRiskScreener.js';
51
- import './index.styles-dfe31537.js';
51
+ import './index.styles-e2fabf72.js';
52
52
  import '@mantine/notifications';
53
- import './translationsContext-b6c33e91.js';
53
+ import './translationsContext-77ad18c1.js';
54
54
 
55
55
  const SSOStateContext = createContext({
56
56
  locale: LOCALE.Vietnam,
@@ -158,13 +158,227 @@ const BackgroundHeader = () => (React__default.createElement("svg", { width: "29
158
158
  React__default.createElement("stop", { stopColor: "#fff", stopOpacity: "0" }),
159
159
  React__default.createElement("stop", { offset: "1", stopColor: "#fff" })))));
160
160
 
161
+ const isPhoneVerifedAlready = (userInfo, flowData) => {
162
+ var _a;
163
+ if (flowData === null || flowData === void 0 ? void 0 : flowData.metaData) {
164
+ return (_a = flowData === null || flowData === void 0 ? void 0 : flowData.metaData) === null || _a === void 0 ? void 0 : _a.is_phone_verified;
165
+ }
166
+ return (userInfo === null || userInfo === void 0 ? void 0 : userInfo.phone_verified_at) && (userInfo === null || userInfo === void 0 ? void 0 : userInfo.phone);
167
+ };
168
+ const isSetupFullInfoAlready = (userInfo, flowData) => {
169
+ var _a, _b, _c;
170
+ if (flowData === null || flowData === void 0 ? void 0 : flowData.metaData) {
171
+ return (((_a = flowData === null || flowData === void 0 ? void 0 : flowData.metaData) === null || _a === void 0 ? void 0 : _a.is_name) &&
172
+ ((_b = flowData === null || flowData === void 0 ? void 0 : flowData.metaData) === null || _b === void 0 ? void 0 : _b.is_gender) &&
173
+ ((_c = flowData === null || flowData === void 0 ? void 0 : flowData.metaData) === null || _c === void 0 ? void 0 : _c.is_birthday));
174
+ }
175
+ const hasName = !!(userInfo === null || userInfo === void 0 ? void 0 : userInfo.name);
176
+ const hasGender = typeof (userInfo === null || userInfo === void 0 ? void 0 : userInfo.gender) === 'number';
177
+ const hasBirthday = !!(userInfo === null || userInfo === void 0 ? void 0 : userInfo.birthday);
178
+ return hasName && hasGender && hasBirthday;
179
+ };
180
+ const isExistUpdateEmailStep = (steps) => {
181
+ return steps.find((s) => s.type === SSOStepTypeType.UPDATE_EMAIL);
182
+ };
183
+ const isVerifyPhoneInTheSignUp = (steps, flowData) => {
184
+ var _a;
185
+ return ((_a = steps[0]) === null || _a === void 0 ? void 0 : _a.type) === SSOStepTypeType.FIRST && (flowData === null || flowData === void 0 ? void 0 : flowData.flow) === 'signup';
186
+ };
187
+ const parseEmailFromToken = (token) => {
188
+ try {
189
+ const base64Url = token.split('.')[1];
190
+ const base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/');
191
+ const jsonPayload = decodeURIComponent(atob(base64)
192
+ .split('')
193
+ .map(function (c) {
194
+ return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
195
+ })
196
+ .join(''));
197
+ const payload = JSON.parse(jsonPayload);
198
+ return payload.email;
199
+ }
200
+ catch (err) {
201
+ return '';
202
+ }
203
+ };
204
+
205
+ const isSocialFlowFn = (flowData) => {
206
+ return (flowData === null || flowData === void 0 ? void 0 : flowData.method) === 'google' || (flowData === null || flowData === void 0 ? void 0 : flowData.method) === 'facebook';
207
+ };
208
+ const isPhoneFlowFn = (flowData) => {
209
+ return ((flowData === null || flowData === void 0 ? void 0 : flowData.method) === 'sms' ||
210
+ (flowData === null || flowData === void 0 ? void 0 : flowData.method) === 'zalo' ||
211
+ (flowData === null || flowData === void 0 ? void 0 : flowData.method) === 'phone');
212
+ };
213
+ const isEmailFlowFn = (flowData) => {
214
+ return (flowData === null || flowData === void 0 ? void 0 : flowData.method) === 'email';
215
+ };
216
+ const isResetPasswordFlowFn = (steps) => {
217
+ // First -> Passsword -> Password Forgot Setup
218
+ const passwordStep = steps.findIndex((s) => s.type === SSOStepTypeType.PASSWORD);
219
+ const passwordForgotStep = steps.findIndex((s) => s.type === SSOStepTypeType.FORGOT_PASSWORD_SETUP);
220
+ return (passwordStep > 0 &&
221
+ passwordForgotStep > 0 &&
222
+ passwordForgotStep > passwordStep);
223
+ };
224
+ const isDisplayProgressBarFn = (flowData, step) => {
225
+ const showProgressBar = (step === null || step === void 0 ? void 0 : step.type) === SSOStepTypeType.OTP ||
226
+ (step === null || step === void 0 ? void 0 : step.type) === SSOStepTypeType.SETUP_FULL ||
227
+ (step === null || step === void 0 ? void 0 : step.type) === SSOStepTypeType.VERIFY_PHONE ||
228
+ (step === null || step === void 0 ? void 0 : step.type) === SSOStepTypeType.PASSWORD ||
229
+ (step === null || step === void 0 ? void 0 : step.type) === SSOStepTypeType.FORGOT_PASSWORD_PHONE ||
230
+ (step === null || step === void 0 ? void 0 : step.type) === SSOStepTypeType.FORGOT_PASSWORD_SETUP ||
231
+ (step === null || step === void 0 ? void 0 : step.type) === SSOStepTypeType.EMAIL ||
232
+ (step === null || step === void 0 ? void 0 : step.type) === SSOStepTypeType.UPDATE_EMAIL;
233
+ const isWhiteListFlow = isSocialFlowFn(flowData) ||
234
+ isPhoneFlowFn(flowData) ||
235
+ isEmailFlowFn(flowData);
236
+ return showProgressBar && isWhiteListFlow;
237
+ };
238
+ const getCurrentStepNumber = (flowData, { steps, currentStepIndex, }, userInfo) => {
239
+ var _a, _b;
240
+ const step = steps[currentStepIndex];
241
+ const isSocialFlow = isSocialFlowFn(flowData);
242
+ const isPhoneFlow = isPhoneFlowFn(flowData);
243
+ const isEmailFlow = isEmailFlowFn(flowData);
244
+ /** Social (Google, Facebook): FIRST => VERIFY_PHONE | OTP => STEP_FULL */
245
+ if (isSocialFlow) {
246
+ const arrSteps = [
247
+ !isPhoneVerifedAlready(userInfo, flowData)
248
+ ? [SSOStepTypeType.VERIFY_PHONE, SSOStepTypeType.OTP]
249
+ : undefined,
250
+ isExistUpdateEmailStep(steps)
251
+ ? (step === null || step === void 0 ? void 0 : step.type) === SSOStepTypeType.OTP
252
+ ? SSOStepTypeType.OTP
253
+ : SSOStepTypeType.UPDATE_EMAIL
254
+ : undefined,
255
+ !userInfo || !isUserFinishedSetup(userInfo)
256
+ ? SSOStepTypeType.SETUP_FULL
257
+ : undefined,
258
+ ]
259
+ .flat()
260
+ .filter(Boolean);
261
+ const previousStep = steps[currentStepIndex - 1];
262
+ return [
263
+ arrSteps.length,
264
+ (previousStep === null || previousStep === void 0 ? void 0 : previousStep.type) === SSOStepTypeType.UPDATE_EMAIL
265
+ ? arrSteps.findLastIndex((type) => type === (step === null || step === void 0 ? void 0 : step.type)) + 1
266
+ : arrSteps.findIndex((type) => type === (step === null || step === void 0 ? void 0 : step.type)) + 1,
267
+ ];
268
+ }
269
+ if (isPhoneFlow && (flowData === null || flowData === void 0 ? void 0 : flowData.flow) === 'signup') {
270
+ const arrSteps = [
271
+ !isPhoneVerifedAlready(userInfo, flowData)
272
+ ? SSOStepTypeType.OTP
273
+ : undefined,
274
+ !((_a = flowData === null || flowData === void 0 ? void 0 : flowData.metaData) === null || _a === void 0 ? void 0 : _a.is_pass)
275
+ ? SSOStepTypeType.FORGOT_PASSWORD_SETUP
276
+ : undefined,
277
+ !isSetupFullInfoAlready(userInfo, flowData)
278
+ ? SSOStepTypeType.SETUP_FULL
279
+ : undefined,
280
+ ]
281
+ .flat()
282
+ .filter(Boolean);
283
+ return [
284
+ arrSteps.length,
285
+ arrSteps.findIndex((type) => type === (step === null || step === void 0 ? void 0 : step.type)) + 1,
286
+ ];
287
+ }
288
+ if (isPhoneFlow && (flowData === null || flowData === void 0 ? void 0 : flowData.flow) === 'login') {
289
+ const isForgotPasswordPhone = steps.find((s) => s.type === SSOStepTypeType.FORGOT_PASSWORD_PHONE);
290
+ const arrSteps = [
291
+ SSOStepTypeType.PASSWORD,
292
+ !isPhoneVerifedAlready(userInfo, flowData) || isForgotPasswordPhone
293
+ ? [SSOStepTypeType.FORGOT_PASSWORD_PHONE, SSOStepTypeType.OTP]
294
+ : undefined,
295
+ isForgotPasswordPhone ? SSOStepTypeType.FORGOT_PASSWORD_SETUP : undefined,
296
+ isExistUpdateEmailStep(steps)
297
+ ? (step === null || step === void 0 ? void 0 : step.type) === SSOStepTypeType.OTP
298
+ ? SSOStepTypeType.OTP
299
+ : SSOStepTypeType.UPDATE_EMAIL
300
+ : undefined,
301
+ !isSetupFullInfoAlready(userInfo, flowData)
302
+ ? SSOStepTypeType.SETUP_FULL
303
+ : undefined,
304
+ ]
305
+ .flat()
306
+ .filter(Boolean);
307
+ const previousStep = steps[currentStepIndex - 1];
308
+ return [
309
+ arrSteps.length,
310
+ (previousStep === null || previousStep === void 0 ? void 0 : previousStep.type) === SSOStepTypeType.UPDATE_EMAIL
311
+ ? arrSteps.findLastIndex((type) => type === (step === null || step === void 0 ? void 0 : step.type)) + 1
312
+ : arrSteps.findIndex((type) => type === (step === null || step === void 0 ? void 0 : step.type)) + 1,
313
+ ];
314
+ }
315
+ if (isEmailFlow) {
316
+ const hasPasswordStep = !((_b = flowData === null || flowData === void 0 ? void 0 : flowData.metaData) === null || _b === void 0 ? void 0 : _b.is_pass);
317
+ const hasPhoneStep = !isPhoneVerifedAlready(userInfo, flowData);
318
+ const hasSetupFullStep = !isSetupFullInfoAlready(userInfo, flowData);
319
+ const isForgotPasswordSetup = steps.find((s) => s.type === SSOStepTypeType.FORGOT_PASSWORD_SETUP);
320
+ if (!hasPasswordStep && !hasPhoneStep && !hasSetupFullStep)
321
+ return [];
322
+ const arrSteps = [
323
+ (step === null || step === void 0 ? void 0 : step.type) === SSOStepTypeType.OTP
324
+ ? SSOStepTypeType.OTP
325
+ : SSOStepTypeType.EMAIL,
326
+ hasPasswordStep || isForgotPasswordSetup
327
+ ? SSOStepTypeType.FORGOT_PASSWORD_SETUP
328
+ : SSOStepTypeType.PASSWORD,
329
+ hasPhoneStep
330
+ ? (step === null || step === void 0 ? void 0 : step.type) === SSOStepTypeType.OTP
331
+ ? SSOStepTypeType.OTP
332
+ : SSOStepTypeType.VERIFY_PHONE
333
+ : undefined,
334
+ hasSetupFullStep ? SSOStepTypeType.SETUP_FULL : undefined,
335
+ ]
336
+ .flat()
337
+ .filter(Boolean);
338
+ const previousStep = steps[currentStepIndex - 1];
339
+ return [
340
+ arrSteps.length,
341
+ (previousStep === null || previousStep === void 0 ? void 0 : previousStep.type) === SSOStepTypeType.VERIFY_PHONE
342
+ ? arrSteps.findLastIndex((type) => type === (step === null || step === void 0 ? void 0 : step.type)) + 1
343
+ : arrSteps.findIndex((type) => type === (step === null || step === void 0 ? void 0 : step.type)) + 1,
344
+ ];
345
+ }
346
+ return [];
347
+ };
348
+ const ProgressBar = () => {
349
+ // const initUserInfo = useRef<UserInfo | undefined | null>()
350
+ const { steps, currentStepIndex } = useSSOSteps();
351
+ const { flowData, userInfo } = useSSOV2Store();
352
+ /** No need update state IF userInfo is changed */
353
+ const initUserInfo = useMemo(() => userInfo, [userInfo]);
354
+ const [totalStepNumber, activeStepNumber] = getCurrentStepNumber(flowData, { steps, currentStepIndex }, initUserInfo);
355
+ if (!activeStepNumber || totalStepNumber === 1)
356
+ return null;
357
+ return (React__default.createElement(Flex, { gap: 2 }, Array.from({ length: totalStepNumber }).map((_, idx) => {
358
+ const currentStepNumber = idx + 1;
359
+ return (React__default.createElement(Box, { key: currentStepNumber, style: {
360
+ width: 'auto',
361
+ height: 2,
362
+ flex: 1,
363
+ borderRadius: 4,
364
+ backgroundColor: currentStepNumber <= activeStepNumber ? '#00B16A' : '#D2D6DC',
365
+ } }));
366
+ })));
367
+ };
368
+
161
369
  const SSOPopupWrapper = ({ children, opened, onClose, }) => {
162
370
  var _a;
163
- const { steps, goBack } = useSSOSteps();
371
+ const { steps, goBack, currentStepIndex } = useSSOSteps();
372
+ const { flowData } = useSSOV2Store();
164
373
  const { locale, tracking } = useSSOState();
165
- const showBack = steps.length > 1;
166
- const showClose = steps.length === 1;
167
- const showLogo = steps.length === 1;
374
+ const currentStep = steps[currentStepIndex];
375
+ const showProgressBar = isDisplayProgressBarFn(flowData, currentStep);
376
+ const showBack = (steps.length > 1 && !showProgressBar) ||
377
+ (currentStep === null || currentStep === void 0 ? void 0 : currentStep.type) === SSOStepTypeType.OTP ||
378
+ (currentStep === null || currentStep === void 0 ? void 0 : currentStep.type) === SSOStepTypeType.PASSWORD ||
379
+ (currentStep === null || currentStep === void 0 ? void 0 : currentStep.type) === SSOStepTypeType.EMAIL;
380
+ const showClose = (currentStep === null || currentStep === void 0 ? void 0 : currentStep.type) === SSOStepTypeType.FIRST;
381
+ const showLogo = (steps.length === 1 || showProgressBar) && !showBack;
168
382
  const logoType = (_a = LOCALE_SPECS[locale]) === null || _a === void 0 ? void 0 : _a.LOGO_TYPE;
169
383
  const [closeConfirmOpen, setCloseConfirmOpen] = React__default.useState(false);
170
384
  const onCloseClick = () => {
@@ -207,7 +421,11 @@ const SSOPopupWrapper = ({ children, opened, onClose, }) => {
207
421
  display: 'block',
208
422
  },
209
423
  },
210
- }), withCloseButton: false, zIndex: ZINDEX_SSO },
424
+ }), withCloseButton: false, zIndex: ZINDEX_SSO, overlayProps: {
425
+ 'data-event-label': 'Focus out',
426
+ 'data-event-category': tracking === null || tracking === void 0 ? void 0 : tracking.category,
427
+ 'data-event-action': tracking === null || tracking === void 0 ? void 0 : tracking.action,
428
+ } },
211
429
  React__default.createElement("div", { style: {
212
430
  height: 40,
213
431
  display: 'flex',
@@ -220,7 +438,7 @@ const SSOPopupWrapper = ({ children, opened, onClose, }) => {
220
438
  padding: 8,
221
439
  background: 'white',
222
440
  borderRadius: '100%',
223
- }, onClick: goBack, "data-event-category": tracking === null || tracking === void 0 ? void 0 : tracking.category, "data-event-action": tracking === null || tracking === void 0 ? void 0 : tracking.action, "data-event-label": "back" },
441
+ }, onClick: goBack, "data-event-category": tracking === null || tracking === void 0 ? void 0 : tracking.category, "data-event-action": tracking === null || tracking === void 0 ? void 0 : tracking.action, "data-event-label": "Back" },
224
442
  React__default.createElement(ChevronLeft, null))),
225
443
  showLogo && (React__default.createElement(LogoIcon, { type: logoType, height: 32, width: 'unset' })),
226
444
  showClose && (React__default.createElement(Button, { variant: "white", style: {
@@ -231,6 +449,7 @@ const SSOPopupWrapper = ({ children, opened, onClose, }) => {
231
449
  borderRadius: '100%',
232
450
  }, onClick: onCloseClick, "data-event-category": tracking === null || tracking === void 0 ? void 0 : tracking.category, "data-event-action": tracking === null || tracking === void 0 ? void 0 : tracking.action, "data-event-label": "Exit" },
233
451
  React__default.createElement(Close, null)))),
452
+ showProgressBar && React__default.createElement(ProgressBar, null),
234
453
  React__default.createElement("div", { style: {
235
454
  flex: 1,
236
455
  } }, children)),
@@ -374,7 +593,10 @@ const SSOEmailScreen = ({ hidden, }) => {
374
593
  const { t } = useTranslations();
375
594
  const [loading, setLoading] = React__default.useState(false);
376
595
  const [errMsg, setErrMsg] = React__default.useState('');
377
- const trackingCategory = `SSO - Sign Up via Email`;
596
+ const { flowData } = useSSOV2Store();
597
+ const trackingCategory = flowData.flow === 'signup'
598
+ ? `SSO - Sign Up via Email`
599
+ : 'SSO - Sign In via Email';
378
600
  const trackingAction = 'Continue With Email';
379
601
  const { setTracking } = useSSOState();
380
602
  useEffect(() => {
@@ -402,6 +624,7 @@ const SSOEmailScreen = ({ hidden, }) => {
402
624
  flowData: {
403
625
  method: 'email',
404
626
  flow: 'login',
627
+ metaData: existRes._data,
405
628
  },
406
629
  });
407
630
  // go to password screen
@@ -419,6 +642,7 @@ const SSOEmailScreen = ({ hidden, }) => {
419
642
  flowData: {
420
643
  method: 'email',
421
644
  flow: 'signup',
645
+ metaData: existRes._data,
422
646
  },
423
647
  });
424
648
  if (!((_b = existRes._data) === null || _b === void 0 ? void 0 : _b.provider)) {
@@ -437,7 +661,7 @@ const SSOEmailScreen = ({ hidden, }) => {
437
661
  config: {
438
662
  email,
439
663
  otpType: 'email',
440
- afterAction: 'setup',
664
+ afterAction: 'forgot',
441
665
  },
442
666
  });
443
667
  goNext();
@@ -616,12 +840,7 @@ const verifyUpdatePhoneZaloOTP = (phone, areaCode, otpCode) => __awaiter(void 0,
616
840
  });
617
841
 
618
842
  const MailIcon = (props) => (React__default.createElement("svg", Object.assign({ width: "21", height: "20", viewBox: "0 0 21 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
619
- React__default.createElement("g", { clipPath: "url(#clip0_1284_30810)" },
620
- React__default.createElement("rect", { x: "0.666992", width: "20", height: "20", rx: "10", fill: "#00B16A" }),
621
- React__default.createElement("path", { d: "M13.792 4.6875H7.54199C5.66699 4.6875 4.41699 5.625 4.41699 7.8125V12.1875C4.41699 14.375 5.66699 15.3125 7.54199 15.3125H13.792C15.667 15.3125 16.917 14.375 16.917 12.1875V7.8125C16.917 5.625 15.667 4.6875 13.792 4.6875ZM14.0857 8.49375L12.1295 10.0563C11.717 10.3875 11.192 10.55 10.667 10.55C10.142 10.55 9.61074 10.3875 9.20449 10.0563L7.24824 8.49375C7.04824 8.33125 7.01699 8.03125 7.17324 7.83125C7.33574 7.63125 7.62949 7.59375 7.82949 7.75625L9.78574 9.31875C10.2607 9.7 11.067 9.7 11.542 9.31875L13.4982 7.75625C13.6982 7.59375 13.9982 7.625 14.1545 7.83125C14.317 8.03125 14.2857 8.33125 14.0857 8.49375Z", fill: "white" })),
622
- React__default.createElement("defs", null,
623
- React__default.createElement("clipPath", { id: "clip0_1284_30810" },
624
- React__default.createElement("rect", { width: "20", height: "20", fill: "white", transform: "translate(0.666992)" })))));
843
+ React__default.createElement("path", { d: "M15.043 2.56348H6.29297C3.66797 2.56348 1.91797 3.87598 1.91797 6.93848V13.0635C1.91797 16.126 3.66797 17.4385 6.29297 17.4385H15.043C17.668 17.4385 19.418 16.126 19.418 13.0635V6.93848C19.418 3.87598 17.668 2.56348 15.043 2.56348ZM15.4542 7.89223L12.7155 10.0797C12.138 10.5435 11.403 10.771 10.668 10.771C9.93297 10.771 9.18922 10.5435 8.62047 10.0797L5.88172 7.89223C5.60172 7.66473 5.55797 7.24473 5.77672 6.96473C6.00422 6.68473 6.41547 6.63223 6.69547 6.85973L9.43422 9.04723C10.0992 9.58098 11.228 9.58098 11.893 9.04723L14.6317 6.85973C14.9117 6.63223 15.3317 6.67598 15.5505 6.96473C15.778 7.24473 15.7342 7.66473 15.4542 7.89223Z", fill: "#00B16A" })));
625
844
 
626
845
  function createCommonjsModule(fn) {
627
846
  var module = { exports: {} };
@@ -1778,7 +1997,7 @@ function CountrySelectWithIcon(_a) {
1778
1997
  var { value, options, className,
1779
1998
  // iconComponent: Icon,
1780
1999
  // getIconAspectRatio,
1781
- arrowComponent: Arrow = DefaultArrowComponent, onChange, disabled, readOnly } = _a, rest = __rest(_a, ["value", "options", "className", "arrowComponent", "onChange", "disabled", "readOnly"]);
2000
+ arrowComponent: Arrow = DefaultArrowComponent, onChange, disabled, readOnly, trackingFn } = _a, rest = __rest(_a, ["value", "options", "className", "arrowComponent", "onChange", "disabled", "readOnly", "trackingFn"]);
1782
2001
  const { t } = useTranslations();
1783
2002
  const [open, setOpen] = useState(false);
1784
2003
  const [modalStyle, setModalStyle] = useState({});
@@ -1862,13 +2081,13 @@ function CountrySelectWithIcon(_a) {
1862
2081
  React__default.createElement(SelectCountryItem, { option: selectedOption, onSelect: (option) => {
1863
2082
  onChange_(option.value);
1864
2083
  setOpen(false);
1865
- } }))),
2084
+ }, trackingFn: trackingFn }))),
1866
2085
  React__default.createElement(Stack, { spacing: 0 },
1867
2086
  React__default.createElement(Text, { size: "s4" }, t('ssov2.first.search.country.all')),
1868
2087
  filteredOptions.map((option) => (React__default.createElement(SelectCountryItem, { option: option, key: option.value, onSelect: (option) => {
1869
2088
  onChange_(option.value);
1870
2089
  setOpen(false);
1871
- }, selected: selectedOption.value === option.value }))))));
2090
+ }, selected: selectedOption.value === option.value, trackingFn: trackingFn }))))));
1872
2091
  const FlagSelected = Flags[selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.value];
1873
2092
  return (React__default.createElement(React__default.Fragment, null,
1874
2093
  React__default.createElement("div", { className: "PhoneInputCountry", ref: countryDivRef },
@@ -1932,7 +2151,7 @@ function CountrySelectWithIcon(_a) {
1932
2151
  }, onClick: () => setOpen(false) }),
1933
2152
  React__default.createElement("div", { style: Object.assign({ position: 'fixed', height: 540, top: '100%', left: 0, width: '100%', backgroundColor: 'white', padding: '8px 24px', zIndex: ZINDEX_SSO + 9, borderRadius: 12, boxShadow: '0px 0px 1px 0px #0000000A, 0px 4px 8px 0px #0000000A, 0px 16px 24px 0px #0000000A, 0px 24px 32px 0px #0000000A', overflow: 'auto' }, modalStyle) }, SelectCountryContent))))));
1934
2153
  }
1935
- const SelectCountryItem = ({ option, onSelect, selected, }) => {
2154
+ const SelectCountryItem = ({ option, onSelect, selected, trackingFn, }) => {
1936
2155
  const selectedCallingCode = useMemo(() => {
1937
2156
  if (!option.value)
1938
2157
  return '';
@@ -1943,14 +2162,15 @@ const SelectCountryItem = ({ option, onSelect, selected, }) => {
1943
2162
  return '';
1944
2163
  }, [option.value]);
1945
2164
  const Flag = Flags[option.value];
1946
- return (React__default.createElement(Stack, { sx: {
2165
+ const tracking = (trackingFn === null || trackingFn === void 0 ? void 0 : trackingFn(option)) || {};
2166
+ return (React__default.createElement(Stack, Object.assign({ sx: {
1947
2167
  padding: '0 24px',
1948
2168
  backgroundColor: selected ? '#e3f2ff' : 'transparent',
1949
2169
  ':hover': { backgroundColor: '#F7F9FA' },
1950
2170
  cursor: 'pointer',
1951
2171
  marginLeft: -24,
1952
2172
  marginRight: -24,
1953
- }, justify: "center", onClick: () => onSelect(option) },
2173
+ }, justify: "center", onClick: () => onSelect(option) }, tracking),
1954
2174
  React__default.createElement(Group, { position: "apart", sx: {
1955
2175
  height: 50,
1956
2176
  borderBottom: '1px solid #E4E8EC',
@@ -2002,7 +2222,7 @@ function isSameOptionValue(value1, value2) {
2002
2222
  const PhoneForwardRef = (props, ref) => {
2003
2223
  const { isError, defaultCountry,
2004
2224
  // countries = countriesDefault,
2005
- countryCallingCodeEditable = false, defaultValue, value: valueProps, onChange: onChangeProps, className } = props, inputProps = __rest(props, ["isError", "defaultCountry", "countryCallingCodeEditable", "defaultValue", "value", "onChange", "className"]);
2225
+ countryCallingCodeEditable = false, defaultValue, value: valueProps, onChange: onChangeProps, className, trackingFn } = props, inputProps = __rest(props, ["isError", "defaultCountry", "countryCallingCodeEditable", "defaultValue", "value", "onChange", "className", "trackingFn"]);
2006
2226
  const [value, setValue] = useState(defaultValue || valueProps);
2007
2227
  const [PhoneInputUtils, setPhoneInputUtils] = useState(null);
2008
2228
  const onChange = (val) => {
@@ -2026,7 +2246,7 @@ const PhoneForwardRef = (props, ref) => {
2026
2246
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2027
2247
  ref: ref, value: value, onChange: onChange,
2028
2248
  // countries={countries}
2029
- defaultCountry: defaultCountry, countryCallingCodeEditable: countryCallingCodeEditable, className: cn(styles.phoneInput, { isError, [styles.error]: isError }, className), countrySelectComponent: CountrySelectWithIcon }, inputProps)));
2249
+ defaultCountry: defaultCountry, countryCallingCodeEditable: countryCallingCodeEditable, className: cn(styles.phoneInput, { isError, [styles.error]: isError }, className), countrySelectComponent: CountrySelectWithIcon, countrySelectProps: { trackingFn } }, inputProps)));
2030
2250
  };
2031
2251
  const PhoneWithCustomCountrySelect = forwardRef(PhoneForwardRef);
2032
2252
 
@@ -2056,17 +2276,32 @@ const StyledPhone = styled(PhoneWithCustomCountrySelect) `
2056
2276
  }
2057
2277
  `;
2058
2278
 
2279
+ const Zalo = ({ size = 20, useCurrentColor = false }) => {
2280
+ const color = useCurrentColor ? 'currentColor' : '#0068FF';
2281
+ return (React__default.createElement("svg", { width: (size * 21) / 20, height: size, viewBox: "0 0 21 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
2282
+ React__default.createElement("path", { d: "M13.7007 6.55306C13.9781 6.55306 14.2555 6.55306 14.5336 6.55306C14.529 8.17796 14.529 9.8035 14.5336 11.4284C14.262 11.3903 13.81 11.5642 13.7079 11.2027C13.691 9.65349 13.7066 8.10296 13.7007 6.55306Z", fill: color }),
2283
+ React__default.createElement("path", { d: "M5.21482 6.61061C6.50542 6.60932 7.79474 6.60091 9.0847 6.60996C9.07564 6.86278 9.06142 7.13823 8.89201 7.34256C8.01005 8.44048 7.14685 9.55262 6.26554 10.6505C7.20245 10.6564 8.13937 10.6525 9.07629 10.6525C9.05883 10.8717 9.13578 11.1271 8.99353 11.3172C8.9043 11.44 8.74265 11.429 8.6088 11.4303C7.43652 11.4239 6.26424 11.4362 5.09261 11.4239C5.09584 11.1762 5.09843 10.9021 5.27172 10.7049C6.14333 9.61146 7.02529 8.52583 7.89302 7.42985C7.00136 7.43114 6.10906 7.42403 5.2174 7.43373C5.21159 7.15957 5.21352 6.88477 5.21482 6.61061Z", fill: color }),
2284
+ React__default.createElement("path", { d: "M16.5981 7.68655C17.5267 7.47899 18.5341 8.08873 18.7882 9.00302C19.1069 9.95416 18.525 11.0851 17.5635 11.3747C16.7469 11.6625 15.7692 11.2868 15.3457 10.5342C15.0133 9.97809 14.9933 9.25002 15.2953 8.67778C15.5513 8.17279 16.046 7.80358 16.5981 7.68655ZM16.5826 8.51031C16.0162 8.71011 15.711 9.39938 15.9322 9.9561C16.1151 10.4824 16.7313 10.8044 17.2667 10.6428C17.8778 10.4967 18.247 9.78087 18.0304 9.19441C17.8493 8.61377 17.1478 8.27883 16.5826 8.51031Z", fill: color }),
2285
+ React__default.createElement("path", { d: "M9.71965 8.36353C10.1665 7.81005 10.9488 7.53718 11.6381 7.73439C11.8657 7.79194 12.072 7.90574 12.2711 8.02666C12.2692 7.96588 12.2647 7.84496 12.2627 7.78418C12.5233 7.78289 12.7832 7.78354 13.0438 7.78224C13.0425 8.99784 13.0412 10.2134 13.0445 11.4297C12.8531 11.4245 12.6584 11.4472 12.4703 11.4084C12.3384 11.3547 12.2976 11.2105 12.2453 11.0928C11.5262 11.6515 10.3966 11.5247 9.79919 10.8445C9.16229 10.1856 9.12931 9.06315 9.71965 8.36353ZM10.7723 8.52648C10.1736 8.73727 9.88324 9.50865 10.1865 10.0647C10.4451 10.6066 11.1732 10.8342 11.6937 10.5355C12.1767 10.282 12.3998 9.65285 12.1922 9.14979C11.9911 8.60277 11.3129 8.29629 10.7723 8.52648Z", fill: color }),
2286
+ React__default.createElement("path", { d: "M4.20742 0.101327C4.89217 -0.00665471 5.58855 -0.00730131 6.28041 0.008217L6.22092 0.0631777C5.31569 0.656106 4.56499 1.47017 4.02249 2.4045C2.93492 4.27511 2.53856 6.48711 2.62843 8.63123C2.71766 10.377 3.13666 12.1325 4.02508 13.6501C4.1738 13.9217 4.42144 14.1616 4.42532 14.4913C4.45313 15.1987 4.10332 15.8653 3.63001 16.371C3.66105 16.4033 3.69144 16.4356 3.72247 16.468C4.16539 16.9516 4.63805 17.4062 5.08809 17.8834C5.72757 18.6063 6.45628 19.2464 7.08283 19.9822C6.04052 19.9977 4.98592 20.0462 3.9559 19.8516C2.65947 19.6001 1.50853 18.7013 0.958922 17.4999C0.625925 16.8055 0.526349 16.0289 0.500485 15.2679C0.499838 11.7543 0.499838 8.24133 0.500485 4.72837C0.51471 3.55415 0.825723 2.32562 1.65207 1.45465C2.30643 0.716886 3.233 0.237112 4.20742 0.101327Z", fill: color }),
2287
+ React__default.createElement("path", { d: "M6.22092 0.0631777C6.36576 0.0217955 6.51706 0.0088636 6.66707 0.00433743C9.25281 0.0140364 11.8386 0.00304423 14.4243 0.00757041C15.1155 0.0159762 15.8106 -0.0305788 16.4966 0.0748164C17.4465 0.147235 18.3608 0.549418 19.0675 1.18502C19.9546 2.03271 20.4279 3.25348 20.4428 4.47102C20.4435 7.89863 20.4415 11.3288 20.4447 14.7551C20.4357 14.7752 20.4182 14.8166 20.4092 14.8373C19.4878 15.8679 18.2489 16.5656 16.9538 17.0169C15.2086 17.6118 13.3393 17.8032 11.5049 17.6635C9.67051 17.5058 7.8219 17.0266 6.26618 16.0128C5.47087 16.3665 4.59344 16.5397 3.72247 16.468C3.69144 16.4356 3.66105 16.4033 3.63001 16.371C4.10332 15.8653 4.45313 15.1987 4.42532 14.4913C4.42144 14.1616 4.1738 13.9217 4.02508 13.6501C3.13666 12.1325 2.71766 10.377 2.62843 8.63123C2.53856 6.48711 2.93492 4.27511 4.02249 2.4045C4.56499 1.47017 5.31569 0.656106 6.22092 0.0631777ZM13.7007 6.55306C13.7066 8.10296 13.691 9.65349 13.7079 11.2027C13.81 11.5642 14.262 11.3903 14.5336 11.4284C14.529 9.8035 14.529 8.17796 14.5336 6.55306C14.2555 6.55306 13.9781 6.55306 13.7007 6.55306ZM5.21482 6.61061C5.21352 6.88477 5.21159 7.15957 5.2174 7.43373C6.10906 7.42403 7.00136 7.43114 7.89302 7.42985C7.02529 8.52583 6.14333 9.61146 5.27172 10.7049C5.09843 10.9021 5.09584 11.1762 5.09261 11.4239C6.26424 11.4362 7.43652 11.4239 8.6088 11.4303C8.74265 11.429 8.9043 11.44 8.99353 11.3172C9.13578 11.1271 9.05883 10.8717 9.07629 10.6525C8.13937 10.6525 7.20245 10.6564 6.26554 10.6505C7.14685 9.55262 8.01005 8.44048 8.89201 7.34256C9.06142 7.13823 9.07564 6.86278 9.0847 6.60996C7.79474 6.60091 6.50542 6.60932 5.21482 6.61061ZM16.5981 7.68655C16.046 7.80358 15.5513 8.17279 15.2953 8.67778C14.9933 9.25002 15.0133 9.97809 15.3457 10.5342C15.7692 11.2868 16.7469 11.6625 17.5635 11.3747C18.525 11.0851 19.1069 9.95416 18.7882 9.00302C18.5341 8.08873 17.5267 7.47899 16.5981 7.68655ZM9.71965 8.36353C9.12931 9.06315 9.16229 10.1856 9.79919 10.8445C10.3966 11.5247 11.5262 11.6515 12.2453 11.0928C12.2976 11.2105 12.3384 11.3547 12.4703 11.4084C12.6584 11.4472 12.8531 11.4245 13.0445 11.4297C13.0412 10.2134 13.0425 8.99784 13.0438 7.78224C12.7832 7.78354 12.5233 7.78289 12.2627 7.78418C12.2647 7.84496 12.2692 7.96588 12.2711 8.02666C12.072 7.90574 11.8657 7.79194 11.6381 7.73439C10.9488 7.53718 10.1665 7.81005 9.71965 8.36353Z", fill: "white" }),
2288
+ React__default.createElement("path", { d: "M10.7737 8.52648C11.3142 8.29629 11.9925 8.60278 12.1936 9.1498C12.4012 9.65285 12.1781 10.282 11.6951 10.5355C11.1746 10.8342 10.4465 10.6066 10.1879 10.0647C9.8846 9.50866 10.1749 8.73727 10.7737 8.52648Z", fill: "white" }),
2289
+ React__default.createElement("path", { d: "M16.5822 8.51048C17.1473 8.279 17.8489 8.61394 18.0299 9.19458C18.2465 9.78104 17.8773 10.4968 17.2663 10.643C16.7309 10.8046 16.1147 10.4826 15.9317 9.95627C15.7106 9.39955 16.0158 8.71028 16.5822 8.51048Z", fill: "white" }),
2290
+ React__default.createElement("path", { d: "M20.4094 14.8378L20.4604 14.7822C20.487 15.7929 20.3777 16.8475 19.8817 17.7469C19.305 18.8021 18.2588 19.5858 17.082 19.8367C16.4218 19.9731 15.7448 20.0035 15.0724 19.9951C13.0039 19.9957 10.9354 19.9951 8.86698 19.9957C8.27211 19.986 7.67595 20.0138 7.08302 19.9828C6.45646 19.247 5.72775 18.6068 5.08827 17.8839C4.63824 17.4068 4.16557 16.9522 3.72266 16.4685C4.59362 16.5403 5.47105 16.367 6.26637 16.0133C7.82208 17.0272 9.67069 17.5063 11.5051 17.6641C13.3395 17.8038 15.2088 17.6124 16.954 17.0175C18.2491 16.5662 19.488 15.8685 20.4094 14.8378Z", fill: color })));
2291
+ };
2292
+
2059
2293
  const SSOFirstScreen = ({ hidden, config, }) => {
2060
2294
  var _a, _b;
2061
2295
  const [phone, setPhone] = React__default.useState('');
2062
2296
  const [errMsg, setErrMsg] = React__default.useState('');
2063
2297
  const { locale, onClose, setTracking } = useSSOState();
2064
2298
  const { addStep, goNext } = useSSOSteps();
2299
+ const { setUserInfo } = useSSOV2Store();
2065
2300
  const [activeTab, setActiveTab] = React__default.useState('login');
2066
2301
  const { legalTextType } = config || {};
2067
2302
  const { t } = useTranslations();
2068
- const trackingCategory = 'Sign In or Sign Up';
2069
- const trackingAction = `SSO - ${activeTab === 'login' ? 'Sign In' : 'Sign Up'}`;
2303
+ const trackingAction = 'Sign In or Sign Up';
2304
+ const trackingCategory = `SSO - ${activeTab === 'login' ? 'Sign In' : 'Sign Up'}`;
2070
2305
  useEffect(() => {
2071
2306
  if (!hidden) {
2072
2307
  setErrMsg('');
@@ -2077,24 +2312,42 @@ const SSOFirstScreen = ({ hidden, config, }) => {
2077
2312
  }
2078
2313
  }, [hidden]);
2079
2314
  const [loading, setLoading] = React__default.useState(false);
2315
+ // onTrigger -> handleLoginBySocial -> loginBySocial
2080
2316
  const handleLoginBySocial = (credential, provider) => __awaiter(void 0, void 0, void 0, function* () {
2081
- var _c, _d;
2082
2317
  const res = yield loginBySocial(credential, provider);
2083
2318
  if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
2084
2319
  handleAuthSuccess(res === null || res === void 0 ? void 0 : res._data);
2085
2320
  const userInfo = yield getUserInfo();
2321
+ setUserInfo(userInfo === null || userInfo === void 0 ? void 0 : userInfo._data);
2086
2322
  if ((userInfo === null || userInfo === void 0 ? void 0 : userInfo._status) === 1 && userInfo._data) {
2087
2323
  useSSOV2Store.setState({
2088
2324
  flowData: {
2089
2325
  method: provider,
2090
2326
  },
2091
2327
  });
2092
- if (!isUserFinishedSetup(userInfo._data) ||
2093
- !userInfo._data.phone ||
2094
- !userInfo._data.phone_verified_at) {
2095
- useSSOV2Store.setState((f) => ({
2096
- flowData: Object.assign(Object.assign({}, f.flowData), { flow: 'signup' }),
2097
- }));
2328
+ const isNotHavePhone = !userInfo._data.phone || !userInfo._data.phone_verified_at;
2329
+ if (isNotHavePhone) {
2330
+ useSSOV2Store.setState((f) => {
2331
+ var _a;
2332
+ return ({
2333
+ flowData: Object.assign(Object.assign({}, f.flowData), { flow: ((_a = userInfo === null || userInfo === void 0 ? void 0 : userInfo._data) === null || _a === void 0 ? void 0 : _a.first_time_login) ? 'signup' : 'login', isVerifyPhone: true }),
2334
+ });
2335
+ });
2336
+ addStep({
2337
+ type: SSOStepTypeType.VERIFY_PHONE,
2338
+ config: {
2339
+ provider: provider,
2340
+ },
2341
+ });
2342
+ goNext();
2343
+ }
2344
+ else if (!isUserFinishedSetup(userInfo._data)) {
2345
+ useSSOV2Store.setState((f) => {
2346
+ var _a;
2347
+ return ({
2348
+ flowData: Object.assign(Object.assign({}, f.flowData), { flow: ((_a = userInfo === null || userInfo === void 0 ? void 0 : userInfo._data) === null || _a === void 0 ? void 0 : _a.first_time_login) ? 'signup' : 'login' }),
2349
+ });
2350
+ });
2098
2351
  if (provider === 'facebook') {
2099
2352
  window.FB.api('/me', { fields: 'name, email, gender, birthday' }, function (response) {
2100
2353
  addStep({
@@ -2122,19 +2375,6 @@ const SSOFirstScreen = ({ hidden, config, }) => {
2122
2375
  goNext();
2123
2376
  }
2124
2377
  }
2125
- else if (!((_c = userInfo._data) === null || _c === void 0 ? void 0 : _c.phone_verified_at) ||
2126
- !((_d = userInfo._data) === null || _d === void 0 ? void 0 : _d.phone)) {
2127
- useSSOV2Store.setState((f) => ({
2128
- flowData: Object.assign(Object.assign({}, f.flowData), { flow: 'login', isVerifyPhone: true }),
2129
- }));
2130
- addStep({
2131
- type: SSOStepTypeType.VERIFY_PHONE,
2132
- config: {
2133
- provider: provider,
2134
- },
2135
- });
2136
- goNext();
2137
- }
2138
2378
  else {
2139
2379
  onClose === null || onClose === void 0 ? void 0 : onClose(true);
2140
2380
  }
@@ -2174,7 +2414,7 @@ const SSOFirstScreen = ({ hidden, config, }) => {
2174
2414
  };
2175
2415
  }, []);
2176
2416
  const onClickContinueZalo = () => __awaiter(void 0, void 0, void 0, function* () {
2177
- var _e, _f;
2417
+ var _c, _d;
2178
2418
  setLoading(true);
2179
2419
  const { areaCode, phoneNumber } = splitPhone(phone);
2180
2420
  if (!areaCode || !phoneNumber || !phone) {
@@ -2183,12 +2423,13 @@ const SSOFirstScreen = ({ hidden, config, }) => {
2183
2423
  }
2184
2424
  const userExist = yield checkUserExist({ phone: phoneNumber });
2185
2425
  if ((userExist === null || userExist === void 0 ? void 0 : userExist._status) === 1) {
2186
- const provider = (_e = userExist._data) === null || _e === void 0 ? void 0 : _e.provider;
2187
- if ((_f = userExist._data) === null || _f === void 0 ? void 0 : _f.is_pass) {
2426
+ const provider = (_c = userExist._data) === null || _c === void 0 ? void 0 : _c.provider;
2427
+ if ((_d = userExist._data) === null || _d === void 0 ? void 0 : _d.is_pass) {
2188
2428
  useSSOV2Store.setState({
2189
2429
  flowData: {
2190
2430
  method: 'zalo',
2191
2431
  flow: 'login',
2432
+ metaData: userExist._data,
2192
2433
  },
2193
2434
  });
2194
2435
  addStep({
@@ -2216,6 +2457,7 @@ const SSOFirstScreen = ({ hidden, config, }) => {
2216
2457
  flowData: {
2217
2458
  method: 'zalo',
2218
2459
  flow: 'signup',
2460
+ metaData: userExist._data,
2219
2461
  },
2220
2462
  });
2221
2463
  addStep({
@@ -2223,7 +2465,7 @@ const SSOFirstScreen = ({ hidden, config, }) => {
2223
2465
  config: {
2224
2466
  phone,
2225
2467
  otpType: 'phone-zalo',
2226
- afterAction: 'setup',
2468
+ afterAction: 'forgot',
2227
2469
  },
2228
2470
  });
2229
2471
  goNext();
@@ -2235,7 +2477,7 @@ const SSOFirstScreen = ({ hidden, config, }) => {
2235
2477
  setLoading(false);
2236
2478
  });
2237
2479
  const onClickContinuePhone = () => __awaiter(void 0, void 0, void 0, function* () {
2238
- var _g, _h;
2480
+ var _e, _f;
2239
2481
  setLoading(true);
2240
2482
  const { areaCode, phoneNumber } = splitPhone(phone);
2241
2483
  if (!areaCode || !phoneNumber || !phone) {
@@ -2244,12 +2486,13 @@ const SSOFirstScreen = ({ hidden, config, }) => {
2244
2486
  }
2245
2487
  const userExist = yield checkUserExist({ phone: phoneNumber });
2246
2488
  if ((userExist === null || userExist === void 0 ? void 0 : userExist._status) === 1) {
2247
- const provider = (_g = userExist._data) === null || _g === void 0 ? void 0 : _g.provider;
2248
- if ((_h = userExist._data) === null || _h === void 0 ? void 0 : _h.is_pass) {
2489
+ const provider = (_e = userExist._data) === null || _e === void 0 ? void 0 : _e.provider;
2490
+ if ((_f = userExist._data) === null || _f === void 0 ? void 0 : _f.is_pass) {
2249
2491
  useSSOV2Store.setState({
2250
2492
  flowData: {
2251
2493
  method: 'sms',
2252
2494
  flow: 'login',
2495
+ metaData: userExist._data,
2253
2496
  },
2254
2497
  });
2255
2498
  addStep({
@@ -2277,6 +2520,7 @@ const SSOFirstScreen = ({ hidden, config, }) => {
2277
2520
  flowData: {
2278
2521
  method: 'sms',
2279
2522
  flow: 'signup',
2523
+ metaData: userExist._data,
2280
2524
  },
2281
2525
  });
2282
2526
  addStep({
@@ -2284,7 +2528,7 @@ const SSOFirstScreen = ({ hidden, config, }) => {
2284
2528
  config: {
2285
2529
  phone,
2286
2530
  otpType: 'phone-sms',
2287
- afterAction: 'setup',
2531
+ afterAction: 'forgot',
2288
2532
  },
2289
2533
  });
2290
2534
  goNext();
@@ -2296,7 +2540,7 @@ const SSOFirstScreen = ({ hidden, config, }) => {
2296
2540
  setLoading(false);
2297
2541
  });
2298
2542
  const onClickLoginWithPhone = () => __awaiter(void 0, void 0, void 0, function* () {
2299
- var _j, _k;
2543
+ var _g, _h;
2300
2544
  setLoading(true);
2301
2545
  const { areaCode, phoneNumber } = splitPhone(phone);
2302
2546
  if (!areaCode || !phoneNumber || !phone) {
@@ -2305,7 +2549,7 @@ const SSOFirstScreen = ({ hidden, config, }) => {
2305
2549
  }
2306
2550
  const userExist = yield checkUserExist({ phone: phoneNumber });
2307
2551
  if ((userExist === null || userExist === void 0 ? void 0 : userExist._status) === 1) {
2308
- if (!userExist._data || !((_j = userExist._data) === null || _j === void 0 ? void 0 : _j.is_pass)) {
2552
+ if (!userExist._data || !((_g = userExist._data) === null || _g === void 0 ? void 0 : _g.is_pass)) {
2309
2553
  showNotification({
2310
2554
  message: t('ssov2.first.noAccountOrPass'),
2311
2555
  type: 'danger',
@@ -2313,11 +2557,12 @@ const SSOFirstScreen = ({ hidden, config, }) => {
2313
2557
  setActiveTab('signup');
2314
2558
  return setLoading(false);
2315
2559
  }
2316
- if ((_k = userExist._data) === null || _k === void 0 ? void 0 : _k.is_pass) {
2560
+ if ((_h = userExist._data) === null || _h === void 0 ? void 0 : _h.is_pass) {
2317
2561
  useSSOV2Store.setState({
2318
2562
  flowData: {
2319
2563
  method: 'phone',
2320
2564
  flow: 'login',
2565
+ metaData: userExist._data,
2321
2566
  },
2322
2567
  });
2323
2568
  addStep({
@@ -2339,7 +2584,7 @@ const SSOFirstScreen = ({ hidden, config, }) => {
2339
2584
  useSSOV2Store.setState({
2340
2585
  flowData: {
2341
2586
  method: 'email',
2342
- flow: 'login',
2587
+ flow: activeTab === 'login' ? 'login' : 'signup',
2343
2588
  },
2344
2589
  });
2345
2590
  addStep({
@@ -2396,10 +2641,21 @@ const SSOFirstScreen = ({ hidden, config, }) => {
2396
2641
  onClickContinueZalo();
2397
2642
  } },
2398
2643
  React__default.createElement(Input.Wrapper, { error: errMsg },
2399
- React__default.createElement(StyledPhone, { defaultCountry: (locale ? MAPPED_LOCALE[locale] || 'VN' : 'VN'), value: phone, onChange: (value) => setPhone(value), isError: !!errMsg, required: true, name: "phone", disabled: loading, "data-event-category": trackingCategory, "data-event-action": trackingAction, "data-event-label": "Enter Phone" }))),
2644
+ React__default.createElement(StyledPhone, { defaultCountry: (locale ? MAPPED_LOCALE[locale] || 'VN' : 'VN'), value: phone, onChange: (value) => setPhone(value), isError: !!errMsg, required: true, name: "phone", disabled: loading, "data-event-category": trackingCategory, "data-event-action": trackingAction, "data-event-label": "Enter Phone", trackingFn: useCallback((option) => {
2645
+ if (!(option === null || option === void 0 ? void 0 : option.label))
2646
+ return;
2647
+ return {
2648
+ 'data-event-action': 'Country Selection',
2649
+ 'data-event-label': option.label,
2650
+ 'data-event-category': activeTab === 'signup'
2651
+ ? 'SSO - Sign Up'
2652
+ : 'SSO - Sign In',
2653
+ };
2654
+ }, [activeTab]) }))),
2400
2655
  React__default.createElement(Button, { size: "lg", variant: "primary", onClick: onClickLoginWithPhone, loading: loading, disabled: loading, "data-event-category": trackingCategory, "data-event-action": trackingAction, "data-event-label": "Continue Login", display: activeTab === 'login' ? 'block' : 'none' }, t('ssov2.button.continue')),
2401
- React__default.createElement(Button, { size: "lg", variant: "primary", onClick: onClickContinueZalo, loading: loading, disabled: loading, "data-event-category": trackingCategory, "data-event-action": trackingAction, "data-event-label": "Continue with Zalo", display: activeTab === 'signup' ? 'block' : 'none' }, t('ssov2.button.otp.zalo')),
2402
- React__default.createElement(Button, { size: "lg", variant: "secondary", onClick: onClickContinuePhone, loading: loading, disabled: loading, "data-event-category": trackingCategory, "data-event-action": trackingAction, "data-event-label": "Continue with SMS", display: activeTab === 'signup' ? 'block' : 'none' }, t('ssov2.button.otp.sms'))),
2656
+ React__default.createElement(Button, { size: "lg", variant: "primary", onClick: onClickContinueZalo, loading: loading, disabled: loading, "data-event-category": trackingCategory, "data-event-action": trackingAction, "data-event-label": "Continue with Zalo", display: activeTab === 'signup' ? 'block' : 'none', leftIcon: React__default.createElement(Zalo, null) }, t('ssov2.button.otp.zalo')),
2657
+ React__default.createElement(Button, { size: "sm", variant: "white", onClick: onClickContinuePhone, loading: loading, disabled: loading, "data-event-category": trackingCategory, "data-event-action": trackingAction, "data-event-label": "Continue with SMS", display: activeTab === 'signup' ? 'block' : 'none', style: { fontWeight: 400 }, color: "#595959", leftIcon: React__default.createElement(ReplySquare, { size: 18 }) }, t('ssov2.button.otp.sms'))),
2658
+ React__default.createElement(Divider, { color: "#E4E8EC", display: activeTab === 'signup' ? 'block' : 'none' }),
2403
2659
  React__default.createElement(Stack, { spacing: 16, align: "center" },
2404
2660
  React__default.createElement(Text, { size: "p4", color: "gray.4" }, t('ssov2.orContinueWith')),
2405
2661
  React__default.createElement(Group, { spacing: 8, style: {
@@ -2478,10 +2734,8 @@ const initSendUpdateEmailOtp = (email) => __awaiter(void 0, void 0, void 0, func
2478
2734
  });
2479
2735
  });
2480
2736
  const resendUpdateEmailOTP = () => __awaiter(void 0, void 0, void 0, function* () {
2481
- const formData = new FormData();
2482
2737
  return fetchSSOV2Api(SSO_V2_PATHS.ECOM_CARE.RESEND_OTP, {
2483
- method: 'POST',
2484
- body: formData,
2738
+ method: 'GET',
2485
2739
  });
2486
2740
  });
2487
2741
  const verifyUpdateEmailOTP = (otpCode) => __awaiter(void 0, void 0, void 0, function* () {
@@ -2496,8 +2750,8 @@ const verifyUpdateEmailOTP = (otpCode) => __awaiter(void 0, void 0, void 0, func
2496
2750
  const SSOOTPScreen = ({ hidden, index, config, }) => {
2497
2751
  const { t } = useTranslations();
2498
2752
  const { onClose, setTracking } = useSSOState();
2499
- const { setSteps } = useSSOSteps();
2500
- const { flowData } = useSSOV2Store();
2753
+ const { setSteps, steps } = useSSOSteps();
2754
+ const { flowData, userInfo } = useSSOV2Store();
2501
2755
  const [loading, setLoading] = React__default.useState(false);
2502
2756
  const [otp, setOtp] = React__default.useState('');
2503
2757
  const [error, setError] = React__default.useState('');
@@ -2509,14 +2763,14 @@ const SSOOTPScreen = ({ hidden, index, config, }) => {
2509
2763
  const isEmail = otpType === 'email' || otpType === 'update-email';
2510
2764
  const isZalo = otpType === 'phone-zalo';
2511
2765
  const isSMS = otpType === 'phone-sms';
2512
- const trackingMethod = flowData.method;
2513
- const trackingCategory = `SSO - ${otpType === 'update-email' || isUpdatePhone
2514
- ? 'Existing Users'
2515
- : flowData.flow === 'signup'
2516
- ? 'Sign Up'
2517
- : 'Sign In'} via ${trackingMethod}`;
2766
+ const trackingMethod = flowData === null || flowData === void 0 ? void 0 : flowData.method;
2767
+ const trackingCategory = userInfo && !userInfo.first_time_login
2768
+ ? `SSO - Existing User via ${trackingMethod}`
2769
+ : isVerifyPhoneInTheSignUp(steps, flowData)
2770
+ ? `SSO - Sign Up via ${trackingMethod}`
2771
+ : `SSO - Sign In via ${trackingMethod}`;
2518
2772
  const trackingAction = isEmail
2519
- ? 'Verify Email'
2773
+ ? 'Verify Your Email'
2520
2774
  : `Verify Phone Number via ${isZalo ? 'Zalo' : isSMS ? 'SMS' : ''}`;
2521
2775
  useEffect(() => {
2522
2776
  if (!hidden) {
@@ -2529,15 +2783,7 @@ const SSOOTPScreen = ({ hidden, index, config, }) => {
2529
2783
  }, [hidden]);
2530
2784
  const addStepAndGoNext = (step) => {
2531
2785
  useSSOSteps.setState((old) => {
2532
- var _a, _b;
2533
2786
  const oldSteps = old.steps;
2534
- if (((_a = oldSteps[index - 1]) === null || _a === void 0 ? void 0 : _a.type) === SSOStepTypeType.VERIFY_PHONE ||
2535
- ((_b = oldSteps[index - 1]) === null || _b === void 0 ? void 0 : _b.type) === SSOStepTypeType.UPDATE_EMAIL) {
2536
- return {
2537
- steps: oldSteps.slice(0, index - 1).concat(step),
2538
- currentStepIndex: index - 1,
2539
- };
2540
- }
2541
2787
  return {
2542
2788
  steps: oldSteps.slice(0, index).concat(step),
2543
2789
  currentStepIndex: index,
@@ -2868,7 +3114,7 @@ const SSOOTPScreen = ({ hidden, index, config, }) => {
2868
3114
  'data-event-category': trackingCategory,
2869
3115
  'data-event-action': trackingAction,
2870
3116
  'data-event-label': 'Enter Code',
2871
- } })),
3117
+ }, placeholder: "*" })),
2872
3118
  React__default.createElement(Group, { spacing: 8, align: "center", style: {
2873
3119
  height: 40,
2874
3120
  } },
@@ -2880,7 +3126,7 @@ const SSOOTPScreen = ({ hidden, index, config, }) => {
2880
3126
  count: resendTime,
2881
3127
  })))),
2882
3128
  React__default.createElement(Button, { type: "submit", size: "lg", variant: "primary", mt: 12, fullWidth: true, disabled: loading, loading: loading, "data-event-category": trackingCategory, "data-event-action": trackingAction, "data-event-label": "Continue", ref: submitButtonRef }, t('ssov2.button.continue')),
2883
- !isEmail && (React__default.createElement(Button, { size: "lg", variant: "tertiary", mt: 12, onClick: swapZaloSms, fullWidth: true, disabled: loading, loading: loading, "data-event-category": trackingCategory, "data-event-action": trackingAction, "data-event-label": `Send OTP Code via ${otpType === 'phone-sms' ? 'Zalo' : 'SMS'}` }, t('ssov2.otp.sendVia', {
3129
+ !isEmail && (React__default.createElement(Button, { size: "sm", variant: "white", mt: 12, onClick: swapZaloSms, fullWidth: true, disabled: loading, loading: loading, "data-event-category": trackingCategory, "data-event-action": trackingAction, "data-event-label": `Send OTP Code via ${otpType === 'phone-sms' ? 'Zalo' : 'SMS'}`, leftIcon: otpType === 'phone-sms' ? (React__default.createElement(Zalo, { size: 18, useCurrentColor: true })) : (React__default.createElement(ReplySquare, { size: 18 })), style: { fontWeight: 400 }, color: "#595959" }, t('ssov2.otp.sendVia', {
2884
3130
  method: otpType === 'phone-sms' ? 'Zalo' : 'SMS',
2885
3131
  })))));
2886
3132
  };
@@ -2888,6 +3134,7 @@ const SSOOTPScreen = ({ hidden, index, config, }) => {
2888
3134
  const SSOPasswordScreen = ({ hidden, config, }) => {
2889
3135
  const { t } = useTranslations();
2890
3136
  const { onClose, setTracking } = useSSOState();
3137
+ const { setUserInfo, flowData } = useSSOV2Store();
2891
3138
  const [errMsg, setErrMsg] = React__default.useState('');
2892
3139
  const phone = config === null || config === void 0 ? void 0 : config.phone;
2893
3140
  const method = config === null || config === void 0 ? void 0 : config.method;
@@ -2923,9 +3170,15 @@ const SSOPasswordScreen = ({ hidden, config, }) => {
2923
3170
  let res;
2924
3171
  if (!((_a = existRes._data) === null || _a === void 0 ? void 0 : _a.provider)) {
2925
3172
  res = yield registerBySendEmailOTP(email);
3173
+ useSSOV2Store.setState((f) => ({
3174
+ flowData: Object.assign(Object.assign({}, f.flowData), { flow: 'signup' }),
3175
+ }));
2926
3176
  }
2927
3177
  else {
2928
3178
  res = yield resendEmailOTP(email);
3179
+ useSSOV2Store.setState((f) => ({
3180
+ flowData: Object.assign(Object.assign({}, f.flowData), { flow: 'login' }),
3181
+ }));
2929
3182
  }
2930
3183
  if ((res === null || res === void 0 ? void 0 : res._status) !== 1) {
2931
3184
  setErrMsg(getErrorTextFromCode(t, res === null || res === void 0 ? void 0 : res.code));
@@ -2951,11 +3204,13 @@ const SSOPasswordScreen = ({ hidden, config, }) => {
2951
3204
  setLoading(false);
2952
3205
  });
2953
3206
  const onAuthSuccess = (data) => __awaiter(void 0, void 0, void 0, function* () {
2954
- var _c, _d;
2955
3207
  handleAuthSuccess(data);
3208
+ const userInfo = yield getUserInfo();
3209
+ const isPhoneFlow = isPhoneFlowFn(flowData);
3210
+ const isEmailFlow = isEmailFlowFn(flowData);
3211
+ setUserInfo(userInfo === null || userInfo === void 0 ? void 0 : userInfo._data);
2956
3212
  if (!phone && !!email) {
2957
- const userInfo = yield getUserInfo();
2958
- if (!((_c = userInfo._data) === null || _c === void 0 ? void 0 : _c.phone_verified_at) || !((_d = userInfo._data) === null || _d === void 0 ? void 0 : _d.phone)) {
3213
+ if (isPhoneNotVerifedYet(userInfo === null || userInfo === void 0 ? void 0 : userInfo._data)) {
2959
3214
  useSSOV2Store.setState((s) => ({
2960
3215
  flowData: Object.assign(Object.assign({}, s.flowData), { isVerifyPhone: true }),
2961
3216
  }));
@@ -2969,6 +3224,27 @@ const SSOPasswordScreen = ({ hidden, config, }) => {
2969
3224
  return;
2970
3225
  }
2971
3226
  }
3227
+ if (isLoginWithPhoneNotVerifedYet(flowData, userInfo._data)) {
3228
+ addStep({
3229
+ type: SSOStepTypeType.FORGOT_PASSWORD_PHONE,
3230
+ config: {
3231
+ phone: `${userInfo._data.area_code}${userInfo._data.phone}`,
3232
+ afterAction: 'setup',
3233
+ },
3234
+ });
3235
+ goNext();
3236
+ return;
3237
+ }
3238
+ if ((isPhoneFlow || isEmailFlow) && !isUserFinishedSetup(userInfo === null || userInfo === void 0 ? void 0 : userInfo._data)) {
3239
+ addStep({
3240
+ type: SSOStepTypeType.SETUP_FULL,
3241
+ config: {
3242
+ userInfo: userInfo === null || userInfo === void 0 ? void 0 : userInfo._data,
3243
+ },
3244
+ });
3245
+ goNext();
3246
+ return;
3247
+ }
2972
3248
  onClose === null || onClose === void 0 ? void 0 : onClose(true);
2973
3249
  });
2974
3250
  return (React__default.createElement("form", { style: {
@@ -3017,6 +3293,48 @@ const SSOPasswordScreen = ({ hidden, config, }) => {
3017
3293
  React__default.createElement(Button, { type: "submit", size: "lg", variant: "primary", mt: 12, fullWidth: true, disabled: loading, loading: loading, "data-event-category": trackingCategory, "data-event-action": trackingAction, "data-event-label": "Sign In" }, t('ssov2.password.signIn'))));
3018
3294
  };
3019
3295
 
3296
+ const SetupLater = ({ style = {} }) => {
3297
+ const { t } = useTranslations();
3298
+ const { onClose, tracking } = useSSOState();
3299
+ const [loading, setLoading] = useState(false);
3300
+ const { userInfo, flowData } = useSSOV2Store();
3301
+ const { currentStepIndex, steps, addStep, goNext } = useSSOSteps();
3302
+ const currentStep = steps[currentStepIndex];
3303
+ const onClickSetupLater = () => __awaiter(void 0, void 0, void 0, function* () {
3304
+ if (loading)
3305
+ return;
3306
+ setLoading(true);
3307
+ if (userInfo &&
3308
+ !isUserFinishedSetup(userInfo) &&
3309
+ ((currentStep === null || currentStep === void 0 ? void 0 : currentStep.type) === SSOStepTypeType.VERIFY_PHONE ||
3310
+ (currentStep === null || currentStep === void 0 ? void 0 : currentStep.type) === SSOStepTypeType.FORGOT_PASSWORD_PHONE)) {
3311
+ addStep({
3312
+ type: SSOStepTypeType.SETUP_FULL,
3313
+ config: {
3314
+ userInfo,
3315
+ },
3316
+ });
3317
+ goNext();
3318
+ }
3319
+ else if (!userInfo &&
3320
+ !isFlowFinishedSetup(flowData) &&
3321
+ (currentStep === null || currentStep === void 0 ? void 0 : currentStep.type) === SSOStepTypeType.VERIFY_PHONE) {
3322
+ addStep({
3323
+ type: SSOStepTypeType.SETUP_FULL,
3324
+ config: {
3325
+ userInfo,
3326
+ },
3327
+ });
3328
+ goNext();
3329
+ }
3330
+ else {
3331
+ onClose === null || onClose === void 0 ? void 0 : onClose(true);
3332
+ }
3333
+ setLoading(false);
3334
+ });
3335
+ return (React__default.createElement(Button, { size: "sm", variant: "white", color: "#737373", style: Object.assign({ fontWeight: 400 }, style), onClick: onClickSetupLater, disabled: loading, dataEventCategory: tracking === null || tracking === void 0 ? void 0 : tracking.category, dataEventAction: tracking === null || tracking === void 0 ? void 0 : tracking.action, dataEventLabel: "Setup Later" }, t('ssov2.button.setupLater')));
3336
+ };
3337
+
3020
3338
  const SSOPasswordForgotPhone = ({ hidden, config, }) => {
3021
3339
  const phone = config === null || config === void 0 ? void 0 : config.phone;
3022
3340
  const { t } = useTranslations();
@@ -3064,7 +3382,7 @@ const SSOPasswordForgotPhone = ({ hidden, config, }) => {
3064
3382
  config: {
3065
3383
  phone,
3066
3384
  otpType: 'phone-zalo',
3067
- afterAction: 'forgot',
3385
+ afterAction: config.afterAction || 'forgot',
3068
3386
  provider: (_b = userExist._data) === null || _b === void 0 ? void 0 : _b.provider,
3069
3387
  },
3070
3388
  });
@@ -3107,7 +3425,7 @@ const SSOPasswordForgotPhone = ({ hidden, config, }) => {
3107
3425
  config: {
3108
3426
  phone,
3109
3427
  otpType: 'phone-sms',
3110
- afterAction: 'forgot',
3428
+ afterAction: config.afterAction || 'forgot',
3111
3429
  provider: (_d = userExist._data) === null || _d === void 0 ? void 0 : _d.provider,
3112
3430
  },
3113
3431
  });
@@ -3132,10 +3450,19 @@ const SSOPasswordForgotPhone = ({ hidden, config, }) => {
3132
3450
  React__default.createElement(Stack, { mt: 24, spacing: 16 },
3133
3451
  React__default.createElement(StyledPhone, { defaultCountry: (locale ? MAPPED_LOCALE[locale] || 'VN' : 'VN'), value: phone,
3134
3452
  // onChange={(value) => setPhone(value)}
3135
- isError: !!errMsg, required: true, disabled: true, "data-event-category": trackingCategory, "data-event-action": trackingAction, "data-event-label": "Enter Phone" }),
3453
+ isError: !!errMsg, required: true, disabled: true, "data-event-category": trackingCategory, "data-event-action": trackingAction, "data-event-label": "Enter Phone", trackingFn: useCallback((option) => {
3454
+ if (!(option === null || option === void 0 ? void 0 : option.label))
3455
+ return;
3456
+ return {
3457
+ 'data-event-action': 'Country Selection',
3458
+ 'data-event-label': option.label,
3459
+ 'data-event-category': trackingCategory,
3460
+ };
3461
+ }, []) }),
3136
3462
  errMsg && (React__default.createElement(Text, { size: "label2", color: "red.6", mt: -12 }, errMsg)),
3137
- React__default.createElement(Button, { size: "lg", variant: "primary", onClick: onClickContinueZalo, disabled: loading, loading: loading, "data-event-category": trackingCategory, "data-event-action": trackingAction, "data-event-label": "Continue with Zalo" }, t('ssov2.button.continueZalo')),
3138
- React__default.createElement(Button, { size: "lg", variant: "secondary", onClick: onClickContinuePhone, disabled: loading, loading: loading, "data-event-category": trackingCategory, "data-event-action": trackingAction, "data-event-label": "Continue with SMS" }, t('ssov2.button.continueSMS')))));
3463
+ React__default.createElement(Button, { size: "lg", variant: "primary", onClick: onClickContinueZalo, disabled: loading, loading: loading, "data-event-category": trackingCategory, "data-event-action": trackingAction, "data-event-label": "Continue with Zalo", leftIcon: React__default.createElement(Zalo, null) }, t('ssov2.button.continueZalo')),
3464
+ React__default.createElement(Button, { size: "sm", variant: "white", onClick: onClickContinuePhone, disabled: loading, loading: loading, "data-event-category": trackingCategory, "data-event-action": trackingAction, "data-event-label": "Continue with SMS", style: { fontWeight: 400 }, color: "#595959", leftIcon: React__default.createElement(ReplySquare, { size: 18 }) }, t('ssov2.button.continueSMS')),
3465
+ React__default.createElement(SetupLater, null))));
3139
3466
  };
3140
3467
 
3141
3468
  const CheckGrayIcon = () => (React__default.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
@@ -3176,11 +3503,14 @@ const SSOPasswordForgotSetup = ({ hidden, }) => {
3176
3503
  const { t } = useTranslations();
3177
3504
  const [loading, setLoading] = React__default.useState(false);
3178
3505
  const [errMsg, setErrMsg] = React__default.useState('');
3179
- const { setTracking } = useSSOState();
3180
- const { flowData } = useSSOV2Store();
3506
+ const { setTracking, onClose } = useSSOState();
3507
+ const { addStep, goNext } = useSSOSteps();
3508
+ const { flowData, setUserInfo } = useSSOV2Store();
3181
3509
  const trackingMethod = flowData.method;
3182
- const trackingCategory = `SSO - Sign In via ${trackingMethod}`;
3183
- const trackingAction = `Setup New Password`;
3510
+ const trackingCategory = flowData.flow === 'login'
3511
+ ? `SSO - Sign In via ${trackingMethod}`
3512
+ : `SSO - Sign Up via ${trackingMethod}`;
3513
+ const trackingAction = `Setup Password`;
3184
3514
  useEffect(() => {
3185
3515
  if (!hidden) {
3186
3516
  setErrMsg('');
@@ -3208,6 +3538,7 @@ const SSOPasswordForgotSetup = ({ hidden, }) => {
3208
3538
  })),
3209
3539
  });
3210
3540
  const onSubmit = (values) => __awaiter(void 0, void 0, void 0, function* () {
3541
+ var _a;
3211
3542
  setLoading(true);
3212
3543
  try {
3213
3544
  const { password, confirmPassword } = values;
@@ -3215,22 +3546,72 @@ const SSOPasswordForgotSetup = ({ hidden, }) => {
3215
3546
  password.length <= 50 &&
3216
3547
  password.match(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)/) &&
3217
3548
  password === confirmPassword) {
3218
- const res = yield resetPassword(password, confirmPassword);
3549
+ const isPhoneOrEmailFlow = isPhoneFlowFn(flowData) || isEmailFlowFn(flowData);
3550
+ const res = isPhoneOrEmailFlow
3551
+ ? yield updateUserInfo({
3552
+ password,
3553
+ confirm_password: confirmPassword,
3554
+ validate: '',
3555
+ })
3556
+ : yield resetPassword(password, confirmPassword);
3219
3557
  if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
3220
- showNotification({
3221
- type: 'success',
3222
- message: 'Password has been reset successfully',
3223
- });
3224
- // back to login step
3225
- const foundPasswordIndex = steps.findIndex((step) => step.type === SSOStepTypeType.PASSWORD);
3226
- if (foundPasswordIndex === -1) {
3227
- // reset to first step
3228
- setSteps((s) => [s[0]]);
3229
- useSSOSteps.setState({ currentStepIndex: 0 });
3558
+ if (isPhoneOrEmailFlow) {
3559
+ // Login again to fetch token
3560
+ const email = parseEmailFromToken((_a = res === null || res === void 0 ? void 0 : res._data) === null || _a === void 0 ? void 0 : _a.token);
3561
+ // Only Email flow have the verify phone before. Need new profile to tracking correctly
3562
+ const newTokenRes = isEmailFlowFn(flowData) && isResetPasswordFlowFn(steps)
3563
+ ? yield loginByEmailPassword(email, password)
3564
+ : null;
3565
+ handleAuthSuccess((newTokenRes === null || newTokenRes === void 0 ? void 0 : newTokenRes._data) || (res === null || res === void 0 ? void 0 : res._data));
3566
+ const userInfo = yield getUserInfo();
3567
+ // Phone
3568
+ if (isPhoneFlowFn(flowData)) {
3569
+ if (userInfo && !isUserFinishedSetup(userInfo === null || userInfo === void 0 ? void 0 : userInfo._data)) {
3570
+ addStep({
3571
+ type: SSOStepTypeType.SETUP_FULL,
3572
+ config: {
3573
+ userInfo: userInfo === null || userInfo === void 0 ? void 0 : userInfo._data,
3574
+ },
3575
+ });
3576
+ goNext();
3577
+ }
3578
+ else {
3579
+ onClose === null || onClose === void 0 ? void 0 : onClose(true);
3580
+ }
3581
+ }
3582
+ // Email
3583
+ if (isEmailFlowFn(flowData)) {
3584
+ setUserInfo(userInfo === null || userInfo === void 0 ? void 0 : userInfo._data);
3585
+ if (isPhoneNotVerifedYet(userInfo === null || userInfo === void 0 ? void 0 : userInfo._data)) {
3586
+ addStep({
3587
+ type: SSOStepTypeType.VERIFY_PHONE,
3588
+ config: {
3589
+ provider: 'email',
3590
+ },
3591
+ });
3592
+ goNext();
3593
+ }
3594
+ else {
3595
+ onClose === null || onClose === void 0 ? void 0 : onClose(true);
3596
+ }
3597
+ }
3230
3598
  }
3231
3599
  else {
3232
- setSteps((s) => s.slice(0, foundPasswordIndex + 1));
3233
- useSSOSteps.setState({ currentStepIndex: foundPasswordIndex });
3600
+ showNotification({
3601
+ type: 'success',
3602
+ message: 'Password has been reset successfully',
3603
+ });
3604
+ // back to login step
3605
+ const foundPasswordIndex = steps.findIndex((step) => step.type === SSOStepTypeType.PASSWORD);
3606
+ if (foundPasswordIndex === -1) {
3607
+ // reset to first step
3608
+ setSteps((s) => [s[0]]);
3609
+ useSSOSteps.setState({ currentStepIndex: 0 });
3610
+ }
3611
+ else {
3612
+ setSteps((s) => s.slice(0, foundPasswordIndex + 1));
3613
+ useSSOSteps.setState({ currentStepIndex: foundPasswordIndex });
3614
+ }
3234
3615
  }
3235
3616
  // onClose?.()
3236
3617
  }
@@ -3258,7 +3639,9 @@ const SSOPasswordForgotSetup = ({ hidden, }) => {
3258
3639
  action: trackingAction,
3259
3640
  } }),
3260
3641
  errMsg && (React__default.createElement(Text, { size: "label2", color: "red.6", mt: -12 }, errMsg)),
3261
- React__default.createElement(Button, { type: "submit", size: "lg", variant: "primary", fullWidth: true, disabled: loading, loading: loading, "data-event-category": trackingCategory, "data-event-action": trackingAction, "data-event-label": "Save" }, t('ssov2.button.save')))));
3642
+ React__default.createElement(Button, { type: "submit", size: "lg", variant: "primary", fullWidth: true, disabled: loading, loading: loading, "data-event-category": trackingCategory, "data-event-action": trackingAction, "data-event-label": (flowData === null || flowData === void 0 ? void 0 : flowData.flow) === 'signup' ? 'Create New Account' : 'Save' }, (flowData === null || flowData === void 0 ? void 0 : flowData.flow) === 'signup'
3643
+ ? t('ssov2.setup.button.createAccount')
3644
+ : t('ssov2.button.save')))));
3262
3645
  };
3263
3646
 
3264
3647
  const SSOPhoneVerify = ({ hidden, config, }) => {
@@ -3267,8 +3650,15 @@ const SSOPhoneVerify = ({ hidden, config, }) => {
3267
3650
  const [loading, setLoading] = React__default.useState(false);
3268
3651
  const [errMsg, setErrMsg] = React__default.useState('');
3269
3652
  const { locale, setTracking } = useSSOState();
3653
+ const { flowData, userInfo } = useSSOV2Store();
3654
+ const { steps } = useSSOSteps();
3270
3655
  const { afterAction, provider } = config || {};
3271
- const trackingCategory = `SSO - Existing Users via ${provider}`;
3656
+ const trackingMethod = flowData === null || flowData === void 0 ? void 0 : flowData.method;
3657
+ const trackingCategory = userInfo && !userInfo.first_time_login
3658
+ ? `SSO - Existing User via ${trackingMethod}`
3659
+ : isVerifyPhoneInTheSignUp(steps, flowData)
3660
+ ? `SSO - Sign Up via ${trackingMethod}`
3661
+ : `SSO - Sign In via ${trackingMethod}`;
3272
3662
  const trackingAction = 'Verify Phone Number';
3273
3663
  useEffect(() => {
3274
3664
  if (!hidden) {
@@ -3279,6 +3669,7 @@ const SSOPhoneVerify = ({ hidden, config, }) => {
3279
3669
  });
3280
3670
  }
3281
3671
  }, [hidden]);
3672
+ const { source } = useSSOV2Store();
3282
3673
  const { addStep, goNext } = useSSOSteps();
3283
3674
  const onClickContinueZalo = () => __awaiter(void 0, void 0, void 0, function* () {
3284
3675
  setLoading(true);
@@ -3376,9 +3767,18 @@ const SSOPhoneVerify = ({ hidden, config, }) => {
3376
3767
  React__default.createElement(StyledPhone, { defaultCountry: (locale ? MAPPED_LOCALE[locale] || 'VN' : 'VN'), value: phone, onChange: (value) => {
3377
3768
  setPhone(value);
3378
3769
  setErrMsg('');
3379
- }, isError: !!errMsg, required: true, name: "phone", disabled: loading, "data-event-category": trackingCategory, "data-event-action": trackingAction, "data-event-label": "Enter Phone" })),
3380
- React__default.createElement(Button, { size: "lg", variant: "primary", onClick: onClickContinueZalo, disabled: loading, loading: loading, "data-event-category": trackingCategory, "data-event-action": trackingAction, "data-event-label": "Continue with Zalo" }, t('ssov2.button.continueZalo')),
3381
- React__default.createElement(Button, { size: "lg", variant: "secondary", onClick: onClickContinuePhone, disabled: loading, loading: loading, "data-event-category": trackingCategory, "data-event-action": trackingAction, "data-event-label": "Continue with SMS" }, t('ssov2.button.continueSMS'))))));
3770
+ }, isError: !!errMsg, required: true, name: "phone", disabled: loading, "data-event-category": trackingCategory, "data-event-action": trackingAction, "data-event-label": "Enter Phone", trackingFn: useCallback((option) => {
3771
+ if (!(option === null || option === void 0 ? void 0 : option.label))
3772
+ return;
3773
+ return {
3774
+ 'data-event-action': 'Country Selection',
3775
+ 'data-event-label': option.label,
3776
+ 'data-event-category': trackingCategory,
3777
+ };
3778
+ }, []) })),
3779
+ React__default.createElement(Button, { size: "lg", variant: "primary", onClick: onClickContinueZalo, disabled: loading, loading: loading, "data-event-category": trackingCategory, "data-event-action": trackingAction, "data-event-label": "Continue with Zalo", leftIcon: React__default.createElement(Zalo, null) }, t('ssov2.button.continueZalo')),
3780
+ React__default.createElement(Button, { size: "sm", variant: "white", onClick: onClickContinuePhone, disabled: loading, loading: loading, "data-event-category": trackingCategory, "data-event-action": trackingAction, "data-event-label": "Continue with SMS", style: { fontWeight: 400 }, color: "#595959", leftIcon: React__default.createElement(ReplySquare, { size: 18 }) }, t('ssov2.button.continueSMS')),
3781
+ source !== 'care_onboarding' && source !== 'ecom' && React__default.createElement(SetupLater, null)))));
3382
3782
  };
3383
3783
 
3384
3784
  const FemaleIcon = () => (React__default.createElement("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
@@ -3410,39 +3810,19 @@ const MaleIcon = () => (React__default.createElement("svg", { width: "20", heigh
3410
3810
  React__default.createElement("path", { d: "M11.122 6.393a.157.157 0 0 1-.051-.304c.687-.234 1.688-.344 2.26-.03a.156.156 0 0 1-.15.274c-.463-.254-1.38-.163-2.009.052a.2.2 0 0 1-.05.008m-2.19.572a.16.16 0 0 1-.144-.097c-.013-.027-.123-.097-.363-.129-.325-.043-.672.016-.772.131a.156.156 0 1 1-.236-.205c.214-.245.721-.29 1.103-.228.209.034.475.116.556.311a.156.156 0 0 1-.144.217m.222-.571a.2.2 0 0 1-.05-.009c-.629-.215-1.546-.306-2.009-.051a.156.156 0 1 1-.15-.274c.572-.315 1.572-.206 2.26.03a.156.156 0 0 1-.05.304", fill: "#404040" }),
3411
3811
  React__default.createElement("path", { d: "m11.12 9.547-.019.001a8 8 0 0 1-1.928 0 .156.156 0 1 0-.037.31c.665.08 1.337.08 2.003 0a.156.156 0 0 0-.019-.31", fill: "#D84023" })));
3412
3812
 
3813
+ // import { StyledPhone } from '../components/phone'
3413
3814
  // always has name, gender dob
3414
- const OtherSetup = ({ form, needPhone, skipPhone, needEmail, isEmailDisable, isPhoneDisabled, loading, tracking, }) => {
3815
+ const OtherSetup = ({ form,
3816
+ // needPhone,
3817
+ // skipPhone,
3818
+ needEmail, isEmailDisable,
3819
+ // isPhoneDisabled,
3820
+ loading, tracking, }) => {
3415
3821
  const { t } = useTranslations();
3416
- const { locale = 'vi-VN' } = useSSOState();
3822
+ // const { locale = 'vi-VN' } = useSSOState()
3417
3823
  const { setupSource } = useSSOV2Store();
3418
3824
  const [dobChanged, setDobChanged] = React__default.useState(false);
3419
3825
  return (React__default.createElement(Stack, { spacing: 12 },
3420
- needPhone && (React__default.createElement(React__default.Fragment, null,
3421
- React__default.createElement(Input.Wrapper, Object.assign({ label: t('ssov2.setup.field.phone.label'), withAsterisk: true }, form.getInputProps('phone')),
3422
- React__default.createElement(StyledPhone, { defaultCountry: (locale ? MAPPED_LOCALE[locale] || 'VN' : 'VN'), value: form.getInputProps('phone').value, onChange: (value) => {
3423
- form.setFieldValue('phone', value);
3424
- }, isError: !!form.getInputProps('phone').error, required: true, name: "phone", disabled: loading || isPhoneDisabled, "data-event-category": tracking === null || tracking === void 0 ? void 0 : tracking.category, "data-event-action": tracking === null || tracking === void 0 ? void 0 : tracking.action, "data-event-label": "Enter Phone" })),
3425
- !skipPhone && (React__default.createElement(Group, { spacing: 24 },
3426
- React__default.createElement(Text, { size: "p4" }, t('ssov2.setup.field.otp.label')),
3427
- React__default.createElement(Radio.Group, Object.assign({ name: "otpMethod", styles: {
3428
- root: {
3429
- display: 'flex',
3430
- flexDirection: 'row',
3431
- flexWrap: 'wrap',
3432
- gap: 24,
3433
- },
3434
- } }, form.getInputProps('otpMethod')),
3435
- React__default.createElement(Radio, { value: "zalo", label: "Zalo", styles: {
3436
- label: {
3437
- paddingLeft: 8,
3438
- },
3439
- }, disabled: loading, "data-event-category": tracking === null || tracking === void 0 ? void 0 : tracking.category, "data-event-action": tracking === null || tracking === void 0 ? void 0 : tracking.action, "data-event-label": "Send OTP Code via Zalo" }),
3440
- React__default.createElement(Radio, { value: "sms", label: "SMS", styles: {
3441
- label: {
3442
- paddingLeft: 8,
3443
- },
3444
- }, disabled: loading, "data-event-category": tracking === null || tracking === void 0 ? void 0 : tracking.category, "data-event-action": tracking === null || tracking === void 0 ? void 0 : tracking.action, "data-event-label": "Send OTP Code via SMS" })))))),
3445
- needEmail && (React__default.createElement(Input, Object.assign({ name: "email", type: "email", label: t('ssov2.setup.field.email.label'), disabled: isEmailDisable || loading, required: setupSource === 'care' ? true : false, withAsterisk: setupSource === 'care' ? true : false, "data-event-category": tracking === null || tracking === void 0 ? void 0 : tracking.category, "data-event-action": tracking === null || tracking === void 0 ? void 0 : tracking.action, "data-event-label": "Enter Email" }, form.getInputProps('email')))),
3446
3826
  React__default.createElement(Input, Object.assign({ name: "name", label: t('ssov2.setup.field.name.label'), withAsterisk: true, required: true, placeholder: t('ssov2.setup.field.name.placeholder'), disabled: loading, "data-event-category": tracking === null || tracking === void 0 ? void 0 : tracking.category, "data-event-action": tracking === null || tracking === void 0 ? void 0 : tracking.action, "data-event-label": "Enter Name" }, form.getInputProps('name'))),
3447
3827
  React__default.createElement(Input.Wrapper, Object.assign({ label: t('ssov2.setup.field.gender.label'), withAsterisk: true }, form.getInputProps('gender')),
3448
3828
  React__default.createElement(Group, null,
@@ -3457,7 +3837,7 @@ const OtherSetup = ({ form, needPhone, skipPhone, needEmail, isEmailDisable, isP
3457
3837
  ? 'secondary'
3458
3838
  : 'tertiary', onClick: () => {
3459
3839
  form.setFieldValue('gender', 'female');
3460
- }, leftIcon: React__default.createElement(FemaleIcon, null), disabled: loading, "data-event-category": tracking === null || tracking === void 0 ? void 0 : tracking.category, "data-event-action": tracking === null || tracking === void 0 ? void 0 : tracking.action, "data-event-label": "Enter Gender Female" }, t('ssov2.setup.field.gender.female')),
3840
+ }, leftIcon: React__default.createElement(FemaleIcon, null), disabled: loading, "data-event-category": tracking === null || tracking === void 0 ? void 0 : tracking.category, "data-event-action": tracking === null || tracking === void 0 ? void 0 : tracking.action, "data-event-label": "Enter Gender" }, t('ssov2.setup.field.gender.female')),
3461
3841
  React__default.createElement(Button, { type: "button", styles: {
3462
3842
  root: {
3463
3843
  flex: 1,
@@ -3469,7 +3849,7 @@ const OtherSetup = ({ form, needPhone, skipPhone, needEmail, isEmailDisable, isP
3469
3849
  ? 'secondary'
3470
3850
  : 'tertiary', onClick: () => {
3471
3851
  form.setFieldValue('gender', 'male');
3472
- }, leftIcon: React__default.createElement(MaleIcon, null), disabled: loading, "data-event-category": tracking === null || tracking === void 0 ? void 0 : tracking.category, "data-event-action": tracking === null || tracking === void 0 ? void 0 : tracking.action, "data-event-label": "Enter Gender Male" }, t('ssov2.setup.field.gender.male')))),
3852
+ }, leftIcon: React__default.createElement(MaleIcon, null), disabled: loading, "data-event-category": tracking === null || tracking === void 0 ? void 0 : tracking.category, "data-event-action": tracking === null || tracking === void 0 ? void 0 : tracking.action, "data-event-label": "Enter Gender" }, t('ssov2.setup.field.gender.male')))),
3473
3853
  React__default.createElement(DatePicker, Object.assign({ name: "dob", label: t('ssov2.setup.field.dob.label'), withAsterisk: true, required: true, placeholder: t('ssov2.setup.field.dob.placeholder'), maxDate: new Date(new Date().getFullYear() - 18, new Date().getMonth(), new Date().getDate()), disabled: loading, "data-event-category": tracking === null || tracking === void 0 ? void 0 : tracking.category, "data-event-action": tracking === null || tracking === void 0 ? void 0 : tracking.action, "data-event-label": "Enter Birthday" }, form.getInputProps('dob'), { onChange: (e) => {
3474
3854
  form.getInputProps('dob').onChange(e);
3475
3855
  setDobChanged(true);
@@ -3477,9 +3857,13 @@ const OtherSetup = ({ form, needPhone, skipPhone, needEmail, isEmailDisable, isP
3477
3857
  if (!form.getInputProps('dob').value && !dobChanged)
3478
3858
  return;
3479
3859
  form.getInputProps('dob').onBlur(e);
3480
- } }))));
3860
+ } })),
3861
+ needEmail && (React__default.createElement(Input, Object.assign({ name: "email", type: "email", label: t('ssov2.setup.field.email.label'), disabled: isEmailDisable || loading, required: setupSource === 'care' || setupSource === 'ecom' ? true : false, withAsterisk: setupSource === 'care' || setupSource === 'ecom' ? true : false, "data-event-category": tracking === null || tracking === void 0 ? void 0 : tracking.category, "data-event-action": tracking === null || tracking === void 0 ? void 0 : tracking.action, "data-event-label": "Enter Email", style: {
3862
+ display: isEmailDisable ? 'none' : 'block',
3863
+ } }, form.getInputProps('email'))))));
3481
3864
  };
3482
3865
 
3866
+ // import { SSOPasswordWithConfirm } from '../passwordForgotSetup/passwordWithConfirm'
3483
3867
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
3484
3868
  const getDefaultData = (data) => {
3485
3869
  try {
@@ -3505,7 +3889,6 @@ const SSOSetupScreen = ({ hidden, config, }) => {
3505
3889
  var _a, _b, _c;
3506
3890
  const { onClose, setTracking } = useSSOState();
3507
3891
  const { t } = useTranslations();
3508
- const { goNext, addStep } = useSSOSteps();
3509
3892
  const { setupSource, flowData } = useSSOV2Store();
3510
3893
  const [errMsg, setErrMsg] = React__default.useState('');
3511
3894
  const userInfo = config === null || config === void 0 ? void 0 : config.userInfo;
@@ -3515,13 +3898,6 @@ const SSOSetupScreen = ({ hidden, config, }) => {
3515
3898
  const provider = (_a = config === null || config === void 0 ? void 0 : config.userInfo) === null || _a === void 0 ? void 0 : _a.provider;
3516
3899
  const authFlow = flowData === null || flowData === void 0 ? void 0 : flowData.flow;
3517
3900
  const defaultData = getDefaultData(config === null || config === void 0 ? void 0 : config.setupDefaultData);
3518
- const needPass = (authMethod === 'phone' ||
3519
- authMethod === 'zalo' ||
3520
- authMethod === 'sms' ||
3521
- authMethod === 'email' ||
3522
- provider === 'email' ||
3523
- provider === 'phone') &&
3524
- !(userInfo === null || userInfo === void 0 ? void 0 : userInfo.is_pass);
3525
3901
  const skipPhone = (userInfo === null || userInfo === void 0 ? void 0 : userInfo.phone) && !!(userInfo === null || userInfo === void 0 ? void 0 : userInfo.phone_verified_at);
3526
3902
  const isPhoneDisabled = !!(configPhone || (defaultData === null || defaultData === void 0 ? void 0 : defaultData.phone) || skipPhone);
3527
3903
  const needPhone = authFlow === 'signup' &&
@@ -3538,11 +3914,10 @@ const SSOSetupScreen = ({ hidden, config, }) => {
3538
3914
  : undefined) ||
3539
3915
  undefined;
3540
3916
  const needEmail = setupSource === 'care' ||
3917
+ setupSource === 'ecom' ||
3541
3918
  !(flowData === null || flowData === void 0 ? void 0 : flowData.isVerifyPhone) ||
3542
3919
  authMethod === 'facebook' ||
3543
3920
  provider === 'facebook';
3544
- // const needPhone = !userInfo?.phone_verified_at
3545
- // const needEmail = authFlow !== 'verify-phone'
3546
3921
  const isEmailDisable = (defaultEmail &&
3547
3922
  (authMethod === 'google' ||
3548
3923
  authMethod === 'email' ||
@@ -3550,7 +3925,7 @@ const SSOSetupScreen = ({ hidden, config, }) => {
3550
3925
  provider === 'email')) ||
3551
3926
  (!!(userInfo === null || userInfo === void 0 ? void 0 : userInfo.email) && !!(userInfo === null || userInfo === void 0 ? void 0 : userInfo.email_verified_at));
3552
3927
  const trackingCategory = `SSO - ${authFlow === 'signup' ? 'Sign Up' : 'Existing Users'} via ${authMethod || (userInfo === null || userInfo === void 0 ? void 0 : userInfo.provider)}`;
3553
- const trackingAction = 'Almost done';
3928
+ const trackingAction = 'Add Information';
3554
3929
  useEffect(() => {
3555
3930
  if (!hidden) {
3556
3931
  setErrMsg('');
@@ -3579,32 +3954,9 @@ const SSOSetupScreen = ({ hidden, config, }) => {
3579
3954
  ? dayjs(defaultData.birthday, 'MM/DD/YYYY').toDate()
3580
3955
  : undefined }),
3581
3956
  validateInputOnBlur: true,
3582
- validate: yupResolver(yup.object().shape(Object.assign(Object.assign(Object.assign(Object.assign({}, (needPass
3583
- ? {
3584
- password: yup
3585
- .string()
3586
- .required(t('ssov2.validate.password.required'))
3587
- .min(8, ' ')
3588
- .max(50, ' ')
3589
- .matches(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)/, ' '),
3590
- confirmPassword: yup
3591
- .string()
3592
- .required(t('ssov2.validate.confirmPassword.required'))
3593
- .test('passwords-match', t('ssov2.validate.confirmPassword.match'), function (value) {
3594
- return this.parent.password === value;
3595
- }),
3596
- }
3597
- : {})), (needPhone
3598
- ? Object.assign({ phone: yup.string().required(t('ssov2.validate.phone.required')) }, (!skipPhone
3599
- ? {
3600
- otpMethod: yup
3601
- .string()
3602
- .required(t('ssov2.validate.otp.required'))
3603
- .oneOf(['zalo', 'sms']),
3604
- }
3605
- : {})) : {})), (needEmail
3957
+ validate: yupResolver(yup.object().shape(Object.assign(Object.assign({}, (needEmail
3606
3958
  ? {
3607
- email: setupSource === 'care'
3959
+ email: setupSource === 'care' || setupSource === 'ecom'
3608
3960
  ? yup
3609
3961
  .string()
3610
3962
  .email(t('ssov2.validate.email.invalid'))
@@ -3619,15 +3971,13 @@ const SSOSetupScreen = ({ hidden, config, }) => {
3619
3971
  const onSubmit = (values) => __awaiter(void 0, void 0, void 0, function* () {
3620
3972
  setLoading(true);
3621
3973
  try {
3622
- const { password, confirmPassword, phone, gender, name, dob, otpMethod } = values;
3974
+ const { phone, gender, name, dob } = values;
3623
3975
  const { phoneNumber, areaCode } = splitPhone(phone || configPhone || '');
3624
3976
  // validate only, delay set data to after otp
3625
3977
  const res = yield updateUserInfo({
3626
3978
  name,
3627
3979
  birthday: dayjs(dob).format('YYYY-MM-DD'),
3628
3980
  email: values.email || undefined,
3629
- password,
3630
- confirm_password: confirmPassword,
3631
3981
  phone_number: phoneNumber || (userInfo === null || userInfo === void 0 ? void 0 : userInfo.phone),
3632
3982
  area_code: areaCode || (userInfo === null || userInfo === void 0 ? void 0 : userInfo.area_code) || '84',
3633
3983
  gender: gender === 'male' ? 1 : 0,
@@ -3635,80 +3985,23 @@ const SSOSetupScreen = ({ hidden, config, }) => {
3635
3985
  validate: 'true',
3636
3986
  });
3637
3987
  if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
3638
- // if need phone and has phone then start phone verify step, close after done
3639
- if (needPhone && !skipPhone) {
3640
- const setupData = {
3641
- name,
3642
- birthday: dayjs(dob).format('YYYY-MM-DD'),
3643
- email: values.email || undefined,
3644
- password,
3645
- confirm_password: confirmPassword,
3646
- phone_number: phoneNumber || (userInfo === null || userInfo === void 0 ? void 0 : userInfo.phone),
3647
- area_code: areaCode || (userInfo === null || userInfo === void 0 ? void 0 : userInfo.area_code) || '84',
3648
- gender: gender === 'male' ? 1 : 0,
3649
- source: setupSource,
3650
- };
3651
- if (otpMethod === 'zalo') {
3652
- const res = yield resendUpdatePhoneZaloOTP(phoneNumber, areaCode);
3653
- if ((res === null || res === void 0 ? void 0 : res._status) !== 1) {
3654
- setErrMsg(getErrorTextFromCode(t, res === null || res === void 0 ? void 0 : res.code));
3655
- return setLoading(false);
3656
- }
3657
- addStep({
3658
- type: SSOStepTypeType.OTP,
3659
- config: {
3660
- phone,
3661
- otpType: 'phone-zalo',
3662
- isUpdatePhone: true,
3663
- afterAction: 'submitSetup',
3664
- setupData,
3665
- provider,
3666
- },
3667
- });
3668
- goNext();
3669
- }
3670
- else {
3671
- const res = yield resendUpdatePhoneOTP(phoneNumber, areaCode);
3672
- if ((res === null || res === void 0 ? void 0 : res._status) !== 1) {
3673
- setErrMsg(getErrorTextFromCode(t, res === null || res === void 0 ? void 0 : res.code));
3674
- return setLoading(false);
3675
- }
3676
- addStep({
3677
- type: SSOStepTypeType.OTP,
3678
- config: {
3679
- phone,
3680
- otpType: 'phone-sms',
3681
- isUpdatePhone: true,
3682
- afterAction: 'submitSetup',
3683
- setupData,
3684
- provider,
3685
- },
3686
- });
3687
- goNext();
3688
- }
3988
+ const res = yield updateUserInfo({
3989
+ name,
3990
+ birthday: dayjs(dob).format('YYYY-MM-DD'),
3991
+ email: values.email || undefined,
3992
+ phone_number: phoneNumber || (userInfo === null || userInfo === void 0 ? void 0 : userInfo.phone),
3993
+ area_code: areaCode || (userInfo === null || userInfo === void 0 ? void 0 : userInfo.area_code),
3994
+ gender: gender === 'male' ? 1 : 0,
3995
+ source: setupSource,
3996
+ validate: '',
3997
+ });
3998
+ if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
3999
+ handleAuthSuccess(res === null || res === void 0 ? void 0 : res._data);
4000
+ onClose === null || onClose === void 0 ? void 0 : onClose(true);
3689
4001
  }
3690
4002
  else {
3691
- // close?
3692
- const res = yield updateUserInfo({
3693
- name,
3694
- birthday: dayjs(dob).format('YYYY-MM-DD'),
3695
- email: values.email || undefined,
3696
- password,
3697
- confirm_password: confirmPassword,
3698
- phone_number: phoneNumber || (userInfo === null || userInfo === void 0 ? void 0 : userInfo.phone),
3699
- area_code: areaCode || (userInfo === null || userInfo === void 0 ? void 0 : userInfo.area_code),
3700
- gender: gender === 'male' ? 1 : 0,
3701
- source: setupSource,
3702
- validate: '',
3703
- });
3704
- if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
3705
- handleAuthSuccess(res === null || res === void 0 ? void 0 : res._data);
3706
- onClose === null || onClose === void 0 ? void 0 : onClose(true);
3707
- }
3708
- else {
3709
- setErrMsg(getErrorTextFromCode(t, res === null || res === void 0 ? void 0 : res.code));
3710
- return setLoading(false);
3711
- }
4003
+ setErrMsg(getErrorTextFromCode(t, res === null || res === void 0 ? void 0 : res.code));
4004
+ return setLoading(false);
3712
4005
  }
3713
4006
  }
3714
4007
  else {
@@ -3729,36 +4022,22 @@ const SSOSetupScreen = ({ hidden, config, }) => {
3729
4022
  React__default.createElement(Stack, { spacing: 8 },
3730
4023
  React__default.createElement(Text, { size: "s1", weight: "semiBold" }, t('ssov2.setup.title')),
3731
4024
  React__default.createElement(Text, { size: "p4" }, t('ssov2.setup.description'))),
3732
- needPass && (React__default.createElement(SSOPasswordWithConfirm, { form: form, loading: loading, tracking: {
3733
- category: trackingCategory,
3734
- action: trackingAction,
3735
- } })),
3736
4025
  React__default.createElement(OtherSetup, { needPhone: needPhone, skipPhone: skipPhone, needEmail: needEmail, isEmailDisable: isEmailDisable, isPhoneDisabled: isPhoneDisabled, form: form, loading: loading, tracking: {
3737
4026
  category: trackingCategory,
3738
4027
  action: trackingAction,
3739
4028
  } }),
3740
4029
  errMsg && (React__default.createElement(Text, { color: "red.6", size: "p4" }, errMsg)),
3741
- React__default.createElement(Button, { type: "submit", variant: "primary", fullWidth: true, loading: loading, disabled: loading, "data-event-category": trackingCategory, "data-event-action": trackingAction, "data-event-label": needPhone && !skipPhone
3742
- ? 'Verify Phone Number'
3743
- : authFlow === 'signup'
3744
- ? 'Create New Account'
3745
- : 'Save' }, needPhone && !skipPhone
3746
- ? t('ssov2.setup.button.veriyPhone')
3747
- : authFlow === 'signup'
3748
- ? t('ssov2.setup.button.createAccount')
3749
- : t('ssov2.button.save')))));
4030
+ React__default.createElement(Button, { type: "submit", variant: "primary", fullWidth: true, loading: loading, disabled: loading, "data-event-category": trackingCategory, "data-event-action": trackingAction, "data-event-label": "Save" }, t('ssov2.button.save')),
4031
+ React__default.createElement(SetupLater, { style: { marginTop: -8 } }))));
3750
4032
  };
3751
4033
 
3752
- // import {
3753
- // getSSOFlowFromUserProfile,
3754
- // useSSOV2Store,
3755
- // } from '../ssoStateManager/store'
3756
4034
  const SSOUpdateEmailScreen = ({ hidden, }) => {
3757
4035
  const { t } = useTranslations();
3758
4036
  const [errMsg, setErrMsg] = React__default.useState('');
3759
4037
  const { setTracking } = useSSOState();
3760
- const trackingCategory = `SSO - Update Email`;
3761
- const trackingAction = 'Update Your Email';
4038
+ const { flowData } = useSSOV2Store();
4039
+ const trackingCategory = `SSO - Existing User via ${flowData === null || flowData === void 0 ? void 0 : flowData.method}`;
4040
+ const trackingAction = 'Continue With Email';
3762
4041
  useEffect(() => {
3763
4042
  if (!hidden) {
3764
4043
  setErrMsg('');
@@ -3784,9 +4063,6 @@ const SSOUpdateEmailScreen = ({ hidden, }) => {
3784
4063
  if ((existRes === null || existRes === void 0 ? void 0 : existRes._status) === 1) {
3785
4064
  const userInfo = yield getUserInfo();
3786
4065
  if (!existRes._data || email === ((_a = userInfo === null || userInfo === void 0 ? void 0 : userInfo._data) === null || _a === void 0 ? void 0 : _a.email)) {
3787
- // useSSOV2Store.setState({
3788
- // flowData: getSSOFlowFromUserProfile(userInfo?._data),
3789
- // })
3790
4066
  const res = yield initSendUpdateEmailOtp(email);
3791
4067
  if ((res === null || res === void 0 ? void 0 : res._status) !== 1) {
3792
4068
  setErrMsg(getErrorTextFromCode(t, res === null || res === void 0 ? void 0 : res.code));
@@ -3855,6 +4131,20 @@ const SSOScreenRenderer = () => {
3855
4131
  })));
3856
4132
  };
3857
4133
 
4134
+ if (!Array.prototype.findLastIndex) {
4135
+ Array.prototype.findLastIndex = function (callback, thisArg) {
4136
+ for (let i = this.length - 1; i >= 0; i--) {
4137
+ if (callback.call(thisArg, this[i], i, this))
4138
+ return i;
4139
+ }
4140
+ return -1;
4141
+ };
4142
+ }
4143
+ if (!String.prototype.capitalize) {
4144
+ String.prototype.capitalize = function () {
4145
+ return this.charAt(0).toUpperCase() + this.slice(1);
4146
+ };
4147
+ }
3858
4148
  const SSOV2 = ({ onClose: onCloseProps, locale }) => {
3859
4149
  const { isOpen, setOpen, returnUrl, setMounted, source, overrideClose, setOnCloseProp, forceReloadOnClose, } = useSSOV2Store();
3860
4150
  useEffect(() => {