@hhgtech/hhg-components 1.29.367 → 1.29.369-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 (545) hide show
  1. package/build/{InputDate-d6777751.js → InputDate-2dc1bddd.js} +20 -20
  2. package/build/{LastPeriod-0a8beda3.js → LastPeriod-0cb2882d.js} +1 -1
  3. package/build/{Locale-86ffe150.js → Locale-648438ba.js} +1 -0
  4. package/build/{MobileBottomNavigationIcon-e7230d5c.js → MobileBottomNavigationIcon-6c21aba3.js} +3 -3
  5. package/build/{Spinner-a41ece31.js → Spinner-301212ef.js} +1 -1
  6. package/build/{WhatsApp-b2be22b9.js → WhatsApp-e9cb5b49.js} +1 -1
  7. package/build/adapters.js +19 -19
  8. package/build/atoms.js +48 -48
  9. package/build/babyGrowth.js +83 -83
  10. package/build/cache.js +2 -2
  11. package/build/care.js +17 -17
  12. package/build/careBookingSearchBar.js +14 -14
  13. package/build/careBookingSearchBarV2.js +15 -15
  14. package/build/components/atoms/logo/index.d.ts +1 -1
  15. package/build/components/mantine/phone/index.d.ts +2 -0
  16. package/build/components/mantine/phoneInput/PhoneInput.d.ts +17 -0
  17. package/build/components/mantine/phoneInput/index.d.ts +1 -0
  18. package/build/components/molecules/mobileBottomNavigation/index.d.ts +2 -1
  19. package/build/components/navigationV2/components/atoms/searchInput/index.d.ts +2 -1
  20. package/build/components/navigationV2/components/molecules/menuServiceList/index.d.ts +4 -1
  21. package/build/components/navigationV2/components/molecules/menuServiceList/index.styled.d.ts +4 -0
  22. package/build/components/navigationV2/components/molecules/navigationBar/hamburgerMenu/index.d.ts +4 -1
  23. package/build/components/navigationV2/components/molecules/navigationBar/index.d.ts +7 -0
  24. package/build/components/navigationV2/components/molecules/navigationBar/index.styled.d.ts +7 -0
  25. package/build/components/navigationV2/hooks/useNavConfig.d.ts +2 -0
  26. package/build/components.js +96 -96
  27. package/build/{constants-f12cecdc.js → constants-2ae8a507.js} +1 -1
  28. package/build/{constants-8c0fa3d8.js → constants-e428740b.js} +1 -0
  29. package/build/constants.js +3 -3
  30. package/build/constantsDomainLocales.js +3 -1
  31. package/build/constantsRiskScreener.js +2 -2
  32. package/build/constantsSite.js +2 -2
  33. package/build/{core-8716c309.js → core-8c21e77e.js} +1 -1
  34. package/build/{dataTransform-d50933fc.js → dataTransform-0a83f209.js} +1 -1
  35. package/build/ecom.js +4 -4
  36. package/build/{editor-895ed269.js → editor-f35db230.js} +11 -11
  37. package/build/embeddedHeathToolCards_babyGrowth.js +23 -23
  38. package/build/embeddedHeathToolCards_babyPoop.js +19 -19
  39. package/build/embeddedHeathToolCards_babyVaccine.js +22 -22
  40. package/build/embeddedHeathToolCards_bmi_bmi.js +25 -25
  41. package/build/embeddedHeathToolCards_bmrBmr.js +25 -25
  42. package/build/embeddedHeathToolCards_dueDate_dueDate.js +22 -22
  43. package/build/embeddedHeathToolCards_ovulation_ovulation.js +22 -22
  44. package/build/embeddedHeathToolCards_pwg_pwg.js +26 -26
  45. package/build/embeddedHeathToolCards_targetHeartRate.js +27 -27
  46. package/build/esm/{InputDate-1be05f25.js → InputDate-cdbcab92.js} +20 -20
  47. package/build/esm/{LastPeriod-afa25d9c.js → LastPeriod-2c6c8737.js} +1 -1
  48. package/build/esm/{Locale-d927add8.js → Locale-e81e6be1.js} +1 -0
  49. package/build/esm/{MobileBottomNavigationIcon-632dcf45.js → MobileBottomNavigationIcon-afba58d2.js} +3 -3
  50. package/build/esm/{Spinner-5d5596cd.js → Spinner-420df6a6.js} +1 -1
  51. package/build/esm/{WhatsApp-4b2c5c41.js → WhatsApp-7765a21e.js} +1 -1
  52. package/build/esm/adapters.js +19 -19
  53. package/build/esm/atoms.js +48 -48
  54. package/build/esm/babyGrowth.js +83 -83
  55. package/build/esm/cache.js +2 -2
  56. package/build/esm/care.js +17 -17
  57. package/build/esm/careBookingSearchBar.js +14 -14
  58. package/build/esm/careBookingSearchBarV2.js +15 -15
  59. package/build/esm/components/atoms/logo/index.d.ts +1 -1
  60. package/build/esm/components/mantine/phone/index.d.ts +2 -0
  61. package/build/esm/components/mantine/phoneInput/PhoneInput.d.ts +17 -0
  62. package/build/esm/components/mantine/phoneInput/index.d.ts +1 -0
  63. package/build/esm/components/molecules/mobileBottomNavigation/index.d.ts +2 -1
  64. package/build/esm/components/navigationV2/components/atoms/searchInput/index.d.ts +2 -1
  65. package/build/esm/components/navigationV2/components/molecules/menuServiceList/index.d.ts +4 -1
  66. package/build/esm/components/navigationV2/components/molecules/menuServiceList/index.styled.d.ts +4 -0
  67. package/build/esm/components/navigationV2/components/molecules/navigationBar/hamburgerMenu/index.d.ts +4 -1
  68. package/build/esm/components/navigationV2/components/molecules/navigationBar/index.d.ts +7 -0
  69. package/build/esm/components/navigationV2/components/molecules/navigationBar/index.styled.d.ts +7 -0
  70. package/build/esm/components/navigationV2/hooks/useNavConfig.d.ts +2 -0
  71. package/build/esm/components.js +96 -96
  72. package/build/esm/{constants-f506bad9.js → constants-275fcb88.js} +1 -0
  73. package/build/esm/{constants-c702d8be.js → constants-94aa96d9.js} +1 -1
  74. package/build/esm/constants.js +3 -3
  75. package/build/esm/constantsDomainLocales.js +3 -1
  76. package/build/esm/constantsRiskScreener.js +2 -2
  77. package/build/esm/constantsSite.js +2 -2
  78. package/build/esm/{core-5541f9cb.js → core-6dc08794.js} +1 -1
  79. package/build/esm/{dataTransform-102fb622.js → dataTransform-68477ec6.js} +1 -1
  80. package/build/esm/ecom.js +4 -4
  81. package/build/esm/{editor-85879f06.js → editor-2e32558d.js} +11 -11
  82. package/build/esm/embeddedHeathToolCards_babyGrowth.js +23 -23
  83. package/build/esm/embeddedHeathToolCards_babyPoop.js +19 -19
  84. package/build/esm/embeddedHeathToolCards_babyVaccine.js +22 -22
  85. package/build/esm/embeddedHeathToolCards_bmi_bmi.js +25 -25
  86. package/build/esm/embeddedHeathToolCards_bmrBmr.js +25 -25
  87. package/build/esm/embeddedHeathToolCards_dueDate_dueDate.js +22 -22
  88. package/build/esm/embeddedHeathToolCards_ovulation_ovulation.js +22 -22
  89. package/build/esm/embeddedHeathToolCards_pwg_pwg.js +26 -26
  90. package/build/esm/embeddedHeathToolCards_targetHeartRate.js +27 -27
  91. package/build/esm/footer.js +21 -21
  92. package/build/esm/gAssets.js +2 -2
  93. package/build/esm/{healthTools-b07e2cc2.js → healthTools-56523caa.js} +1 -1
  94. package/build/esm/healthToolsCardWrapper.js +18 -18
  95. package/build/esm/healthToolsForm.js +33 -33
  96. package/build/esm/hooks.js +13 -13
  97. package/build/esm/i18n-values/zh-CN.js +855 -0
  98. package/build/esm/i18n.js +3 -2
  99. package/build/esm/i18nV2.js +2 -2
  100. package/build/esm/{index-2cb2b2f2.js → index-03d8f7e3.js} +1 -1
  101. package/build/esm/{index-8ac924ea.js → index-0f9b2104.js} +16 -16
  102. package/build/esm/{index-7b312c2d.js → index-10a225a8.js} +1 -1
  103. package/build/esm/{index-b1f0bc19.js → index-1c2c4c91.js} +1 -1
  104. package/build/esm/{index-ee5a0d51.js → index-1c39a42c.js} +6 -6
  105. package/build/esm/{index-6c1bf696.js → index-1ccbc54b.js} +13 -13
  106. package/build/esm/{index-9b8e9496.js → index-1d955ba9.js} +13 -13
  107. package/build/esm/{index-f9ea1c5e.js → index-224ec0ef.js} +31 -31
  108. package/build/esm/{index-eb67f268.js → index-2367690a.js} +2 -2
  109. package/build/esm/{index-f6f5aaed.js → index-2705f23a.js} +3 -3
  110. package/build/esm/{index-25edd9d7.js → index-29c90bd9.js} +6 -6
  111. package/build/esm/{index-2cc73b15.js → index-2b9000ef.js} +25 -25
  112. package/build/esm/{index-9b89c423.js → index-2d853afc.js} +7 -7
  113. package/build/esm/{index-96cf79a5.js → index-2f46ae25.js} +3 -3
  114. package/build/esm/{index-1be24cbb.js → index-3512669f.js} +17 -17
  115. package/build/esm/{index-86b98bc5.js → index-3d18933f.js} +2 -2
  116. package/build/esm/{index-4207fae8.js → index-3df48ed3.js} +1 -1
  117. package/build/esm/{index-7d3b75e2.js → index-42b2d9b5.js} +1 -1
  118. package/build/esm/{index-38f327e6.js → index-43c84715.js} +77 -76
  119. package/build/esm/{index-573c4d89.js → index-460631b6.js} +8 -8
  120. package/build/esm/{index-6b7b7aad.js → index-53b82ba2.js} +2 -2
  121. package/build/esm/{index-be9996fb.js → index-53be8dfc.js} +10 -10
  122. package/build/esm/{index-2a5e1e73.js → index-545ac479.js} +2 -2
  123. package/build/esm/{index-9a7ef01b.js → index-5686720a.js} +3 -3
  124. package/build/esm/{index-bcb550f9.js → index-5982afac.js} +13 -13
  125. package/build/esm/{index-9c4c9365.js → index-59fad4ce.js} +17 -17
  126. package/build/esm/{index-7f714d80.js → index-5ce05096.js} +5 -5
  127. package/build/esm/{index-30737eab.js → index-6a3d5a9f.js} +4 -4
  128. package/build/esm/{index-209b5a1a.js → index-703cfb4e.js} +2 -2
  129. package/build/esm/{index-46eafb3f.js → index-7059ca5e.js} +18 -18
  130. package/build/esm/{index-973ed3dd.js → index-70aa9f56.js} +1 -1
  131. package/build/esm/{index-525293a5.js → index-71a5ffa0.js} +21 -21
  132. package/build/esm/{index-314ad6c6.js → index-76c07803.js} +22 -22
  133. package/build/esm/{index-f5125beb.js → index-8171e454.js} +2 -2
  134. package/build/esm/{index-8d5fcb66.js → index-818c7f46.js} +2 -2
  135. package/build/esm/{index-f451687a.js → index-87d192b2.js} +16 -16
  136. package/build/esm/{index-72d9246b.js → index-987fe49f.js} +7 -7
  137. package/build/esm/{index-e35d4ac3.js → index-9aee0d96.js} +39 -2
  138. package/build/esm/{index-ffa88d3d.js → index-9b198336.js} +36 -27
  139. package/build/esm/{index-3ce47256.js → index-9e37da77.js} +2 -2
  140. package/build/esm/{index-61f79887.js → index-a47193e5.js} +13 -13
  141. package/build/esm/{index-25f136f3.js → index-a662a79a.js} +5 -5
  142. package/build/esm/{index-e54e5100.js → index-a8ce49bc.js} +1 -1
  143. package/build/esm/{index-6f88be69.js → index-af3127cd.js} +15 -15
  144. package/build/esm/{index-eb568042.js → index-b5a5c142.js} +24 -24
  145. package/build/esm/{index-7a817600.js → index-b74d4072.js} +1 -1
  146. package/build/esm/{index-cd6d7b6e.js → index-bc955d3b.js} +3 -3
  147. package/build/esm/{index-4e1591f3.js → index-c247703a.js} +17 -17
  148. package/build/esm/{index-ba2e3ca5.js → index-c2901be7.js} +6 -6
  149. package/build/esm/{index-f61045ba.js → index-c6f30018.js} +16 -16
  150. package/build/esm/{index-995e379c.js → index-c7564fd6.js} +17 -17
  151. package/build/esm/{index-d12ed430.js → index-d3657485.js} +3 -3
  152. package/build/esm/{index-dc10447a.js → index-d5cfa24f.js} +32 -32
  153. package/build/esm/{index-3628228b.js → index-d94ba721.js} +6 -6
  154. package/build/esm/{index-52cf9bca.js → index-e2eeab0e.js} +1 -1
  155. package/build/esm/{index-41253c23.js → index-e632f8a8.js} +2 -2
  156. package/build/esm/{index-5dcca0a4.js → index-ea00e3c8.js} +3 -3
  157. package/build/esm/{index-3aad9cea.js → index-edfd0b23.js} +2 -2
  158. package/build/esm/{index-242e0f6a.js → index-eec11e06.js} +18 -18
  159. package/build/esm/{index-8400de41.js → index-f148371b.js} +2 -2
  160. package/build/esm/{index-3f4e4296.js → index-f31c99fe.js} +2 -2
  161. package/build/esm/{index-bc87cc5d.js → index-fb90c83b.js} +16 -16
  162. package/build/esm/{index-90454f3e.js → index-fd54b79c.js} +6 -6
  163. package/build/esm/{index-3af59329.js → index-fe73aae3.js} +2 -2
  164. package/build/esm/index.js +117 -117
  165. package/build/esm/interfaces/constants/domainLocales.d.ts +2 -0
  166. package/build/esm/interfaces/constants/index.d.ts +1 -1
  167. package/build/esm/interfaces/types/Locale.d.ts +2 -1
  168. package/build/esm/interfaces/types/index.d.ts +1 -1
  169. package/build/esm/{labelSorting-e86057a4.js → labelSorting-51444b7b.js} +4 -4
  170. package/build/esm/lead/LeadGenForm/LeadGenForm.d.ts +41 -0
  171. package/build/esm/lead/LeadGenForm/LeadGenForm.styled.d.ts +5 -0
  172. package/build/esm/lead/LeadGenForm/LeadGenFormPhone.d.ts +17 -0
  173. package/build/esm/lead/LeadGenForm/LeadGenThankYou.d.ts +20 -0
  174. package/build/esm/lead/LeadGenForm/index.d.ts +3 -0
  175. package/build/esm/lead/LeadGenForm/textField/index.d.ts +13 -0
  176. package/build/esm/lead/LeadGenForm/textField/index.styled.d.ts +11 -0
  177. package/build/esm/lead/LeadGenSubscriptionBox/LeadGenSubscriptionBoxContainer.d.ts +25 -0
  178. package/build/esm/lead/LeadGenSubscriptionBox/LeadGenSubscriptionBoxContext.d.ts +25 -0
  179. package/build/esm/lead/LeadGenSubscriptionBox/LeadGenSubscriptionBoxWrapper.d.ts +30 -0
  180. package/build/esm/lead/LeadGenSubscriptionBox/index.d.ts +1 -0
  181. package/build/esm/lead/helpers.d.ts +51 -1
  182. package/build/esm/lead/index.d.ts +2 -1
  183. package/build/esm/lead/layouts/lightbox/formContext.d.ts +2 -1
  184. package/build/esm/lead/services/index.d.ts +14 -0
  185. package/build/esm/lead.css +1 -1
  186. package/build/esm/lead.js +1446 -445
  187. package/build/esm/{logoIcon-6c763619.js → logoIcon-bae46f31.js} +8 -2
  188. package/build/esm/mantine.js +25 -25
  189. package/build/esm/misc.js +17 -17
  190. package/build/esm/miscGetDynamicHealthTool.js +4 -4
  191. package/build/esm/miscGetSocialList.js +8 -8
  192. package/build/esm/miscScreenSizeContext.js +1 -1
  193. package/build/esm/mobileBottomNavigation.js +7 -7
  194. package/build/esm/mobileBottomNavigationIcon.js +5 -5
  195. package/build/esm/molecules.js +73 -73
  196. package/build/esm/moleculesArticleCard.js +6 -6
  197. package/build/esm/moleculesArticleCardV2.js +16 -16
  198. package/build/esm/navigation.js +45 -45
  199. package/build/esm/navigationLogoutPopup.js +9 -9
  200. package/build/esm/navigationProfileButton.js +23 -23
  201. package/build/esm/onboardingV2.js +29 -29
  202. package/build/esm/organisms.js +49 -49
  203. package/build/esm/{post-01520b03.js → post-7006d474.js} +2 -2
  204. package/build/esm/profileNavigation.js +19 -19
  205. package/build/esm/progressBar.js +1 -1
  206. package/build/esm/pwg.js +22 -22
  207. package/build/esm/ssoV2/api/featureFlag.d.ts +2 -1
  208. package/build/esm/ssoV2.js +51 -39
  209. package/build/esm/{store-c179661c.js → store-73a8ca88.js} +4 -4
  210. package/build/esm/subot.js +35 -35
  211. package/build/esm/surveyOrPremiumBanner.js +32 -32
  212. package/build/esm/surveyQuestionCard.js +10 -10
  213. package/build/esm/{surveyThankyouCard-a62b80a7.js → surveyThankyouCard-d078f229.js} +5 -5
  214. package/build/esm/together.js +55 -55
  215. package/build/esm/togetherApiUtils.js +4 -4
  216. package/build/esm/togetherAtoms.js +30 -30
  217. package/build/esm/togetherComponentGlobalContext.js +4 -4
  218. package/build/esm/togetherMolecules.js +50 -50
  219. package/build/esm/togetherMoleculesCardAuthor.js +28 -28
  220. package/build/esm/togetherMoleculesPostImagePreview.js +11 -11
  221. package/build/esm/togetherMoleculesProfileDetail.js +38 -38
  222. package/build/esm/togetherOrganisms.js +49 -49
  223. package/build/esm/togetherRichTextEditor.js +17 -17
  224. package/build/esm/togetherShareBox.js +10 -10
  225. package/build/esm/{treePopoverMenu-e3fc33b7.js → treePopoverMenu-8ca230fc.js} +19 -19
  226. package/build/esm/{types-8a2081ee.js → types-a2d3353b.js} +2 -2
  227. package/build/esm/types.js +2 -2
  228. package/build/esm/{useCategory-a9b43006.js → useCategory-f084e4f1.js} +18 -5
  229. package/build/esm/{useHealthToolCache-948362d0.js → useHealthToolCache-ed95e2c8.js} +1 -1
  230. package/build/esm/{useMantineLocale-3c15894c.js → useMantineLocale-64d31ceb.js} +8 -6
  231. package/build/esm/{usePlacesAutocomplete-7946fe73.js → usePlacesAutocomplete-593e1f26.js} +1 -1
  232. package/build/esm/{useScreenSize-6a9f2903.js → useScreenSize-0e511139.js} +2 -2
  233. package/build/esm/useTogetherAuthRequiredAction.js +9 -9
  234. package/build/esm/{utils-93eb462d.js → utils-99826248.js} +2 -2
  235. package/build/esm/{utils-bbcdef82.js → utils-9ad44422.js} +2 -2
  236. package/build/esm/{utils-f70cc4cf.js → utils-b0b1b32e.js} +3 -3
  237. package/build/esm/{utils-cf5ae490.js → utils-f8656c0e.js} +4 -4
  238. package/build/esm/vaccination.js +21 -21
  239. package/build/footer.js +21 -21
  240. package/build/gAssets.js +2 -2
  241. package/build/{healthTools-ca987aa6.js → healthTools-2aa7cd81.js} +1 -1
  242. package/build/healthToolsCardWrapper.js +18 -18
  243. package/build/healthToolsForm.js +33 -33
  244. package/build/hooks.js +13 -13
  245. package/build/i18n-values/zh-CN.js +866 -0
  246. package/build/i18n.js +2 -1
  247. package/build/i18nV2.js +1 -1
  248. package/build/{index-5e85713a.js → index-01f63c83.js} +2 -2
  249. package/build/{index-be0cd144.js → index-04a01976.js} +31 -31
  250. package/build/{index-e457749d.js → index-09f48d71.js} +13 -13
  251. package/build/{index-d1da64a9.js → index-0b4838e3.js} +16 -16
  252. package/build/{index-09630310.js → index-0e33107b.js} +3 -3
  253. package/build/{index-091758f3.js → index-0fb47027.js} +2 -2
  254. package/build/{index-5824daed.js → index-16912eea.js} +15 -15
  255. package/build/{index-33991059.js → index-16cdf93b.js} +24 -24
  256. package/build/{index-be8112b8.js → index-18451d9b.js} +17 -17
  257. package/build/{index-22b25031.js → index-199cb67f.js} +6 -6
  258. package/build/{index-3ac19d98.js → index-1ef7af7f.js} +17 -17
  259. package/build/{index-0e7c3b7b.js → index-24f79713.js} +2 -2
  260. package/build/{index-25f424ba.js → index-2f8a31c3.js} +1 -1
  261. package/build/{index-134e6a79.js → index-3975d832.js} +2 -2
  262. package/build/{index-57aabe94.js → index-3c5f8dd9.js} +1 -1
  263. package/build/{index-5d52be86.js → index-41bb9be4.js} +3 -3
  264. package/build/{index-61439f2f.js → index-45dc2274.js} +3 -3
  265. package/build/{index-351cf5be.js → index-46e86072.js} +5 -5
  266. package/build/{index-3b1dfe69.js → index-4ba1ce61.js} +16 -16
  267. package/build/{index-bd2cb1d4.js → index-4e86c88c.js} +2 -2
  268. package/build/{index-c4543fc1.js → index-4f18bc3c.js} +3 -3
  269. package/build/{index-13392c59.js → index-52a431ee.js} +32 -32
  270. package/build/{index-989eb0df.js → index-5a928f8c.js} +13 -13
  271. package/build/{index-083a371f.js → index-64494bab.js} +16 -16
  272. package/build/{index-1fa3e793.js → index-672ce628.js} +4 -4
  273. package/build/{index-e9ae6967.js → index-683b72d9.js} +8 -8
  274. package/build/{index-4b1fbf75.js → index-6d0a4738.js} +25 -25
  275. package/build/{index-0905873a.js → index-776f54d2.js} +1 -1
  276. package/build/{index-9be5deab.js → index-799af054.js} +2 -2
  277. package/build/{index-49ee3f02.js → index-7dcdc8c5.js} +36 -27
  278. package/build/{index-fff25ad9.js → index-7ee6aea1.js} +1 -1
  279. package/build/{index-2f4e500b.js → index-867c567c.js} +18 -18
  280. package/build/{index-ab62534b.js → index-8739c23e.js} +22 -22
  281. package/build/{index-e74337a4.js → index-8cb5751d.js} +39 -2
  282. package/build/{index-30902c03.js → index-90bfd9fc.js} +1 -1
  283. package/build/{index-0e64e6d0.js → index-90d2ca14.js} +2 -2
  284. package/build/{index-5bbe6da7.js → index-9e3bc9aa.js} +2 -2
  285. package/build/{index-82dbbfa2.js → index-a4426cc6.js} +1 -1
  286. package/build/{index-d950d2f2.js → index-a5f9dcc5.js} +2 -2
  287. package/build/{index-d8f99427.js → index-a6b0bfd8.js} +1 -1
  288. package/build/{index-eab97524.js → index-a9717f36.js} +2 -2
  289. package/build/{index-d45f9143.js → index-ad4b0633.js} +82 -81
  290. package/build/{index-0f221c92.js → index-b024f10f.js} +6 -6
  291. package/build/{index-9f50e0b0.js → index-b50bf826.js} +17 -17
  292. package/build/{index-100649c8.js → index-b82f8632.js} +3 -3
  293. package/build/{index-3d800867.js → index-b93919db.js} +10 -10
  294. package/build/{index-643f5968.js → index-b9a4e679.js} +1 -1
  295. package/build/{index-001e3aab.js → index-bfc95bf2.js} +2 -2
  296. package/build/{index-d87764dc.js → index-c1db29db.js} +16 -16
  297. package/build/{index-e40c548c.js → index-ce149e65.js} +6 -6
  298. package/build/{index-4288e2c5.js → index-ce4089d7.js} +17 -17
  299. package/build/{index-a7ba96a1.js → index-d0316ea0.js} +6 -6
  300. package/build/{index-4e37f199.js → index-d0feaf39.js} +7 -7
  301. package/build/{index-f2eef731.js → index-d1d0acb8.js} +3 -3
  302. package/build/{index-7dc85584.js → index-d59f5bd4.js} +5 -5
  303. package/build/{index-09f2f7e4.js → index-d67b3162.js} +18 -18
  304. package/build/{index-178d008e.js → index-da25cceb.js} +13 -13
  305. package/build/{index-9744567e.js → index-e2533715.js} +6 -6
  306. package/build/{index-fe684154.js → index-e4bbd518.js} +1 -1
  307. package/build/{index-a2cfd97b.js → index-e66e5a47.js} +7 -7
  308. package/build/{index-befa6d2a.js → index-ea1d4a9c.js} +21 -21
  309. package/build/{index-185ce6b4.js → index-eb495980.js} +2 -2
  310. package/build/{index-9189286d.js → index-f053ec31.js} +2 -2
  311. package/build/{index-612ee15a.js → index-f6fa0c53.js} +13 -13
  312. package/build/index.js +117 -117
  313. package/build/interfaces/constants/domainLocales.d.ts +2 -0
  314. package/build/interfaces/constants/index.d.ts +1 -1
  315. package/build/interfaces/types/Locale.d.ts +2 -1
  316. package/build/interfaces/types/index.d.ts +1 -1
  317. package/build/{labelSorting-41bc37e0.js → labelSorting-65d3238a.js} +4 -4
  318. package/build/lead/LeadGenForm/LeadGenForm.d.ts +41 -0
  319. package/build/lead/LeadGenForm/LeadGenForm.styled.d.ts +5 -0
  320. package/build/lead/LeadGenForm/LeadGenFormPhone.d.ts +17 -0
  321. package/build/lead/LeadGenForm/LeadGenThankYou.d.ts +20 -0
  322. package/build/lead/LeadGenForm/index.d.ts +3 -0
  323. package/build/lead/LeadGenForm/textField/index.d.ts +13 -0
  324. package/build/lead/LeadGenForm/textField/index.styled.d.ts +11 -0
  325. package/build/lead/LeadGenSubscriptionBox/LeadGenSubscriptionBoxContainer.d.ts +25 -0
  326. package/build/lead/LeadGenSubscriptionBox/LeadGenSubscriptionBoxContext.d.ts +25 -0
  327. package/build/lead/LeadGenSubscriptionBox/LeadGenSubscriptionBoxWrapper.d.ts +30 -0
  328. package/build/lead/LeadGenSubscriptionBox/index.d.ts +1 -0
  329. package/build/lead/helpers.d.ts +51 -1
  330. package/build/lead/index.d.ts +2 -1
  331. package/build/lead/layouts/lightbox/formContext.d.ts +2 -1
  332. package/build/lead/services/index.d.ts +14 -0
  333. package/build/lead.css +1 -1
  334. package/build/lead.js +1449 -447
  335. package/build/{logoIcon-2d46e4bd.js → logoIcon-14c4d93f.js} +8 -2
  336. package/build/mantine.js +22 -22
  337. package/build/misc.js +17 -17
  338. package/build/miscGetDynamicHealthTool.js +4 -4
  339. package/build/miscGetSocialList.js +8 -8
  340. package/build/miscScreenSizeContext.js +1 -1
  341. package/build/mobileBottomNavigation.js +7 -7
  342. package/build/mobileBottomNavigationIcon.js +5 -5
  343. package/build/molecules.js +73 -73
  344. package/build/moleculesArticleCard.js +6 -6
  345. package/build/moleculesArticleCardV2.js +16 -16
  346. package/build/navigation.js +45 -45
  347. package/build/navigationLogoutPopup.js +9 -9
  348. package/build/navigationProfileButton.js +23 -23
  349. package/build/onboardingV2.js +28 -28
  350. package/build/organisms.js +49 -49
  351. package/build/{post-a0a22588.js → post-2bc0c79e.js} +2 -2
  352. package/build/profileNavigation.js +19 -19
  353. package/build/progressBar.js +1 -1
  354. package/build/pwg.js +22 -22
  355. package/build/ssoV2/api/featureFlag.d.ts +2 -1
  356. package/build/ssoV2.js +49 -37
  357. package/build/{store-2654a0a3.js → store-b63da343.js} +4 -4
  358. package/build/subot.js +34 -34
  359. package/build/surveyOrPremiumBanner.js +32 -32
  360. package/build/surveyQuestionCard.js +10 -10
  361. package/build/{surveyThankyouCard-8af2b928.js → surveyThankyouCard-cae73387.js} +5 -5
  362. package/build/together.js +55 -55
  363. package/build/togetherApiUtils.js +4 -4
  364. package/build/togetherAtoms.js +30 -30
  365. package/build/togetherComponentGlobalContext.js +4 -4
  366. package/build/togetherMolecules.js +50 -50
  367. package/build/togetherMoleculesCardAuthor.js +28 -28
  368. package/build/togetherMoleculesPostImagePreview.js +11 -11
  369. package/build/togetherMoleculesProfileDetail.js +38 -38
  370. package/build/togetherOrganisms.js +49 -49
  371. package/build/togetherRichTextEditor.js +17 -17
  372. package/build/togetherShareBox.js +10 -10
  373. package/build/{treePopoverMenu-24c2ea1c.js → treePopoverMenu-f58fe25a.js} +19 -19
  374. package/build/{types-6c5d7edc.js → types-920c207f.js} +2 -2
  375. package/build/types.js +2 -2
  376. package/build/{useCategory-2eb594a9.js → useCategory-d99a70ae.js} +18 -5
  377. package/build/{useHealthToolCache-8622b4ca.js → useHealthToolCache-7e49ede9.js} +1 -1
  378. package/build/{useMantineLocale-40d86e3e.js → useMantineLocale-2d5cdb74.js} +8 -6
  379. package/build/{usePlacesAutocomplete-c44af564.js → usePlacesAutocomplete-fcf00957.js} +1 -1
  380. package/build/{useScreenSize-120080ee.js → useScreenSize-7e52c554.js} +2 -2
  381. package/build/useTogetherAuthRequiredAction.js +9 -9
  382. package/build/{utils-c9f3abb6.js → utils-3879b6b6.js} +4 -4
  383. package/build/{utils-4a3363bc.js → utils-5b341688.js} +2 -2
  384. package/build/{utils-5b9afa62.js → utils-6dc46b42.js} +2 -2
  385. package/build/{utils-966e5124.js → utils-f9be611f.js} +3 -3
  386. package/build/vaccination.js +21 -21
  387. package/package.json +3 -3
  388. /package/build/{BMI_BOYS.percentile.monthly-150383cf.js → BMI_BOYS.percentile.monthly-9bcf8edf.js} +0 -0
  389. /package/build/{BMI_BOYS.percentile.weekly-45792ce4.js → BMI_BOYS.percentile.weekly-8dbacd2b.js} +0 -0
  390. /package/build/{BMI_BOYS.percentile.yearly-26c13c33.js → BMI_BOYS.percentile.yearly-03c1089a.js} +0 -0
  391. /package/build/{BMI_BOYS.zscore.monthly-8036c728.js → BMI_BOYS.zscore.monthly-10ac719a.js} +0 -0
  392. /package/build/{BMI_BOYS.zscore.weekly-9c18ecf2.js → BMI_BOYS.zscore.weekly-dfc409c3.js} +0 -0
  393. /package/build/{BMI_BOYS.zscore.yearly-cece39db.js → BMI_BOYS.zscore.yearly-b9988fdc.js} +0 -0
  394. /package/build/{BMI_GIRLS.percentile.monthly-81a332bf.js → BMI_GIRLS.percentile.monthly-4302dfda.js} +0 -0
  395. /package/build/{BMI_GIRLS.percentile.weekly-89ab1c57.js → BMI_GIRLS.percentile.weekly-165ca5b3.js} +0 -0
  396. /package/build/{BMI_GIRLS.percentile.yearly-760eadaa.js → BMI_GIRLS.percentile.yearly-4850d940.js} +0 -0
  397. /package/build/{BMI_GIRLS.zscore.monthly-7ad39a1f.js → BMI_GIRLS.zscore.monthly-20e02ea2.js} +0 -0
  398. /package/build/{BMI_GIRLS.zscore.weekly-e8184e9c.js → BMI_GIRLS.zscore.weekly-256f7ad4.js} +0 -0
  399. /package/build/{BMI_GIRLS.zscore.yearly-34448450.js → BMI_GIRLS.zscore.yearly-df2de894.js} +0 -0
  400. /package/build/{ChevronDown-de11c966.js → ChevronDown-0d4a4b13.js} +0 -0
  401. /package/build/{Close-c45e3619.js → Close-97d050f1.js} +0 -0
  402. /package/build/{Google-73d20cc8.js → Google-78953395.js} +0 -0
  403. /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-6376570f.js → HEAD CIRCUM_BOYS.percentile.monthly-2ad7761e.js} +0 -0
  404. /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-2974b220.js → HEAD CIRCUM_BOYS.percentile.weekly-2853fb77.js} +0 -0
  405. /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-20996890.js → HEAD CIRCUM_BOYS.percentile.yearly-b932ef0c.js} +0 -0
  406. /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-71d4d242.js → HEAD CIRCUM_BOYS.zscore.monthly-df8412f4.js} +0 -0
  407. /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-3853c690.js → HEAD CIRCUM_BOYS.zscore.weekly-dfd69b6a.js} +0 -0
  408. /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-8baa79e6.js → HEAD CIRCUM_BOYS.zscore.yearly-76377aa3.js} +0 -0
  409. /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-1cba6c3b.js → HEAD CIRCUM_GIRLS.percentile.monthly-3b09fc4f.js} +0 -0
  410. /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-6522b123.js → HEAD CIRCUM_GIRLS.percentile.weekly-c58aa845.js} +0 -0
  411. /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-63dd385b.js → HEAD CIRCUM_GIRLS.percentile.yearly-ce1a2751.js} +0 -0
  412. /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-7cdd4692.js → HEAD CIRCUM_GIRLS.zscore.monthly-4548eea7.js} +0 -0
  413. /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-e1e71424.js → HEAD CIRCUM_GIRLS.zscore.weekly-ea307395.js} +0 -0
  414. /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-1bf89be2.js → HEAD CIRCUM_GIRLS.zscore.yearly-e0f60d37.js} +0 -0
  415. /package/build/{HEIGHT_BOYS.percentile.monthly-44f32528.js → HEIGHT_BOYS.percentile.monthly-a7d4858e.js} +0 -0
  416. /package/build/{HEIGHT_BOYS.percentile.weekly-e2e79473.js → HEIGHT_BOYS.percentile.weekly-0662bc79.js} +0 -0
  417. /package/build/{HEIGHT_BOYS.percentile.yearly-ba9795bc.js → HEIGHT_BOYS.percentile.yearly-2153f1aa.js} +0 -0
  418. /package/build/{HEIGHT_BOYS.zscore.monthly-9adfb7f9.js → HEIGHT_BOYS.zscore.monthly-318b111e.js} +0 -0
  419. /package/build/{HEIGHT_BOYS.zscore.weekly-83aa203a.js → HEIGHT_BOYS.zscore.weekly-2a495bbd.js} +0 -0
  420. /package/build/{HEIGHT_BOYS.zscore.yearly-e20aa8e9.js → HEIGHT_BOYS.zscore.yearly-834a819a.js} +0 -0
  421. /package/build/{HEIGHT_GIRLS.percentile.monthly-83537359.js → HEIGHT_GIRLS.percentile.monthly-1b941b6c.js} +0 -0
  422. /package/build/{HEIGHT_GIRLS.percentile.weekly-c4e35839.js → HEIGHT_GIRLS.percentile.weekly-796667eb.js} +0 -0
  423. /package/build/{HEIGHT_GIRLS.percentile.yearly-4c008ad6.js → HEIGHT_GIRLS.percentile.yearly-e5f8b760.js} +0 -0
  424. /package/build/{HEIGHT_GIRLS.zscore.monthly-3d6d261a.js → HEIGHT_GIRLS.zscore.monthly-927dd364.js} +0 -0
  425. /package/build/{HEIGHT_GIRLS.zscore.weekly-e3295bc2.js → HEIGHT_GIRLS.zscore.weekly-9bee6d27.js} +0 -0
  426. /package/build/{HEIGHT_GIRLS.zscore.yearly-36015341.js → HEIGHT_GIRLS.zscore.yearly-5b633bd4.js} +0 -0
  427. /package/build/{Visible-c14812d1.js → Visible-005827ca.js} +0 -0
  428. /package/build/{WEIGHT_BOYS.percentile.monthly-09cf5889.js → WEIGHT_BOYS.percentile.monthly-dc7dd852.js} +0 -0
  429. /package/build/{WEIGHT_BOYS.percentile.weekly-722bf74e.js → WEIGHT_BOYS.percentile.weekly-a9ce4d72.js} +0 -0
  430. /package/build/{WEIGHT_BOYS.percentile.yearly-f0c6d8d9.js → WEIGHT_BOYS.percentile.yearly-6a67adfc.js} +0 -0
  431. /package/build/{WEIGHT_BOYS.zscore.monthly-6edaaa72.js → WEIGHT_BOYS.zscore.monthly-083a40f0.js} +0 -0
  432. /package/build/{WEIGHT_BOYS.zscore.weekly-83e13e95.js → WEIGHT_BOYS.zscore.weekly-561385ba.js} +0 -0
  433. /package/build/{WEIGHT_BOYS.zscore.yearly-bcba90b3.js → WEIGHT_BOYS.zscore.yearly-a9a601fe.js} +0 -0
  434. /package/build/{WEIGHT_GIRLS.percentile.monthly-7b641ac4.js → WEIGHT_GIRLS.percentile.monthly-727d3845.js} +0 -0
  435. /package/build/{WEIGHT_GIRLS.percentile.weekly-2bd1bb97.js → WEIGHT_GIRLS.percentile.weekly-70446525.js} +0 -0
  436. /package/build/{WEIGHT_GIRLS.percentile.yearly-45ec074e.js → WEIGHT_GIRLS.percentile.yearly-6213a7ee.js} +0 -0
  437. /package/build/{WEIGHT_GIRLS.zscore.monthly-f0c833cc.js → WEIGHT_GIRLS.zscore.monthly-27a2b14b.js} +0 -0
  438. /package/build/{WEIGHT_GIRLS.zscore.weekly-ae0fbc3d.js → WEIGHT_GIRLS.zscore.weekly-b4c27420.js} +0 -0
  439. /package/build/{WEIGHT_GIRLS.zscore.yearly-7016234a.js → WEIGHT_GIRLS.zscore.yearly-7e015373.js} +0 -0
  440. /package/build/{animation-0b55b4d6.js → animation-504b9b97.js} +0 -0
  441. /package/build/{constants-ba5f6725.js → constants-5ab61cea.js} +0 -0
  442. /package/build/{constants-36e1f4de.js → constants-d801ede7.js} +0 -0
  443. /package/build/{dataTransform-b9093c49.js → dataTransform-64a30017.js} +0 -0
  444. /package/build/{doctor-9a0a1198.js → doctor-df682ad0.js} +0 -0
  445. /package/build/esm/{BMI_BOYS.percentile.monthly-c2439680.js → BMI_BOYS.percentile.monthly-35ae93a6.js} +0 -0
  446. /package/build/esm/{BMI_BOYS.percentile.weekly-901b47fa.js → BMI_BOYS.percentile.weekly-8442bb09.js} +0 -0
  447. /package/build/esm/{BMI_BOYS.percentile.yearly-82c3ff4e.js → BMI_BOYS.percentile.yearly-ee89b98f.js} +0 -0
  448. /package/build/esm/{BMI_BOYS.zscore.monthly-63019819.js → BMI_BOYS.zscore.monthly-76e1e46a.js} +0 -0
  449. /package/build/esm/{BMI_BOYS.zscore.weekly-828cb536.js → BMI_BOYS.zscore.weekly-b1afea36.js} +0 -0
  450. /package/build/esm/{BMI_BOYS.zscore.yearly-8a6c15c5.js → BMI_BOYS.zscore.yearly-c3b970a1.js} +0 -0
  451. /package/build/esm/{BMI_GIRLS.percentile.monthly-e85373c1.js → BMI_GIRLS.percentile.monthly-f11c33c1.js} +0 -0
  452. /package/build/esm/{BMI_GIRLS.percentile.weekly-50a39997.js → BMI_GIRLS.percentile.weekly-12bdc5de.js} +0 -0
  453. /package/build/esm/{BMI_GIRLS.percentile.yearly-583be1a0.js → BMI_GIRLS.percentile.yearly-09faf3bd.js} +0 -0
  454. /package/build/esm/{BMI_GIRLS.zscore.monthly-2278a10a.js → BMI_GIRLS.zscore.monthly-31eefda1.js} +0 -0
  455. /package/build/esm/{BMI_GIRLS.zscore.weekly-861d40cf.js → BMI_GIRLS.zscore.weekly-4165d9da.js} +0 -0
  456. /package/build/esm/{BMI_GIRLS.zscore.yearly-18bf3737.js → BMI_GIRLS.zscore.yearly-4a244e9d.js} +0 -0
  457. /package/build/esm/{ChevronDown-67b98d5a.js → ChevronDown-6f4b6c47.js} +0 -0
  458. /package/build/esm/{Close-51c8b025.js → Close-ad9b18d7.js} +0 -0
  459. /package/build/esm/{Google-2bae8b21.js → Google-21927259.js} +0 -0
  460. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.monthly-81d1eb42.js → HEAD CIRCUM_BOYS.percentile.monthly-cefa8b74.js} +0 -0
  461. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.weekly-f91f91c4.js → HEAD CIRCUM_BOYS.percentile.weekly-55143bcd.js} +0 -0
  462. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.yearly-2e020928.js → HEAD CIRCUM_BOYS.percentile.yearly-3ba2e12b.js} +0 -0
  463. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.monthly-f7d7f109.js → HEAD CIRCUM_BOYS.zscore.monthly-6fc9c7e4.js} +0 -0
  464. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.weekly-9c34236f.js → HEAD CIRCUM_BOYS.zscore.weekly-66f56ef4.js} +0 -0
  465. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.yearly-2659fe11.js → HEAD CIRCUM_BOYS.zscore.yearly-7a9de915.js} +0 -0
  466. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.monthly-c0d22d6c.js → HEAD CIRCUM_GIRLS.percentile.monthly-8849dcd4.js} +0 -0
  467. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.weekly-79a05d0c.js → HEAD CIRCUM_GIRLS.percentile.weekly-d56be886.js} +0 -0
  468. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.yearly-b8fade45.js → HEAD CIRCUM_GIRLS.percentile.yearly-0d8b607b.js} +0 -0
  469. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.monthly-56e35fe6.js → HEAD CIRCUM_GIRLS.zscore.monthly-0d07cfe5.js} +0 -0
  470. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.weekly-1b9ab47f.js → HEAD CIRCUM_GIRLS.zscore.weekly-093c4f7c.js} +0 -0
  471. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.yearly-a802576b.js → HEAD CIRCUM_GIRLS.zscore.yearly-3eecd83e.js} +0 -0
  472. /package/build/esm/{HEIGHT_BOYS.percentile.monthly-8cf0a281.js → HEIGHT_BOYS.percentile.monthly-6681b998.js} +0 -0
  473. /package/build/esm/{HEIGHT_BOYS.percentile.weekly-6e19eaf5.js → HEIGHT_BOYS.percentile.weekly-32767188.js} +0 -0
  474. /package/build/esm/{HEIGHT_BOYS.percentile.yearly-bcc51755.js → HEIGHT_BOYS.percentile.yearly-d9e903d7.js} +0 -0
  475. /package/build/esm/{HEIGHT_BOYS.zscore.monthly-7a24cdcd.js → HEIGHT_BOYS.zscore.monthly-203835d0.js} +0 -0
  476. /package/build/esm/{HEIGHT_BOYS.zscore.weekly-a831509d.js → HEIGHT_BOYS.zscore.weekly-7b29e734.js} +0 -0
  477. /package/build/esm/{HEIGHT_BOYS.zscore.yearly-bc0ea267.js → HEIGHT_BOYS.zscore.yearly-d7f3e638.js} +0 -0
  478. /package/build/esm/{HEIGHT_GIRLS.percentile.monthly-4ce19444.js → HEIGHT_GIRLS.percentile.monthly-0b9cd9d6.js} +0 -0
  479. /package/build/esm/{HEIGHT_GIRLS.percentile.weekly-3069c4d1.js → HEIGHT_GIRLS.percentile.weekly-156e0ee8.js} +0 -0
  480. /package/build/esm/{HEIGHT_GIRLS.percentile.yearly-de0031ea.js → HEIGHT_GIRLS.percentile.yearly-f8eb3a88.js} +0 -0
  481. /package/build/esm/{HEIGHT_GIRLS.zscore.monthly-cc7bc00a.js → HEIGHT_GIRLS.zscore.monthly-a4f2ed04.js} +0 -0
  482. /package/build/esm/{HEIGHT_GIRLS.zscore.weekly-60e63bf4.js → HEIGHT_GIRLS.zscore.weekly-46fd04f6.js} +0 -0
  483. /package/build/esm/{HEIGHT_GIRLS.zscore.yearly-26bf1806.js → HEIGHT_GIRLS.zscore.yearly-75fc6228.js} +0 -0
  484. /package/build/esm/{Visible-e6799d93.js → Visible-8710d513.js} +0 -0
  485. /package/build/esm/{WEIGHT_BOYS.percentile.monthly-14947f40.js → WEIGHT_BOYS.percentile.monthly-a6c4156c.js} +0 -0
  486. /package/build/esm/{WEIGHT_BOYS.percentile.weekly-efb30492.js → WEIGHT_BOYS.percentile.weekly-9ba529e5.js} +0 -0
  487. /package/build/esm/{WEIGHT_BOYS.percentile.yearly-d7d171dd.js → WEIGHT_BOYS.percentile.yearly-ed36a03d.js} +0 -0
  488. /package/build/esm/{WEIGHT_BOYS.zscore.monthly-c260614b.js → WEIGHT_BOYS.zscore.monthly-288eac1f.js} +0 -0
  489. /package/build/esm/{WEIGHT_BOYS.zscore.weekly-cd1b288c.js → WEIGHT_BOYS.zscore.weekly-b947ceb5.js} +0 -0
  490. /package/build/esm/{WEIGHT_BOYS.zscore.yearly-bb0724a8.js → WEIGHT_BOYS.zscore.yearly-d059e263.js} +0 -0
  491. /package/build/esm/{WEIGHT_GIRLS.percentile.monthly-f42fcd58.js → WEIGHT_GIRLS.percentile.monthly-288d1ac6.js} +0 -0
  492. /package/build/esm/{WEIGHT_GIRLS.percentile.weekly-0b2658d7.js → WEIGHT_GIRLS.percentile.weekly-64a44e2b.js} +0 -0
  493. /package/build/esm/{WEIGHT_GIRLS.percentile.yearly-386efbfb.js → WEIGHT_GIRLS.percentile.yearly-3de74c71.js} +0 -0
  494. /package/build/esm/{WEIGHT_GIRLS.zscore.monthly-0000cf5a.js → WEIGHT_GIRLS.zscore.monthly-2c1ef928.js} +0 -0
  495. /package/build/esm/{WEIGHT_GIRLS.zscore.weekly-52ff0b92.js → WEIGHT_GIRLS.zscore.weekly-76184d8b.js} +0 -0
  496. /package/build/esm/{WEIGHT_GIRLS.zscore.yearly-d9e2b247.js → WEIGHT_GIRLS.zscore.yearly-def78cc1.js} +0 -0
  497. /package/build/esm/{animation-c4bba252.js → animation-9d6764b3.js} +0 -0
  498. /package/build/esm/{constants-d8dcd935.js → constants-05736327.js} +0 -0
  499. /package/build/esm/{constants-17d9e657.js → constants-9d9f4f5c.js} +0 -0
  500. /package/build/esm/{dataTransform-a17b9909.js → dataTransform-0b1f45d6.js} +0 -0
  501. /package/build/esm/{doctor-de3a124e.js → doctor-7e942b88.js} +0 -0
  502. /package/build/esm/{index-2e9e2a69.js → index-48dec582.js} +0 -0
  503. /package/build/esm/{index-8d334024.js → index-74594561.js} +0 -0
  504. /package/build/esm/{index-6bfd30a4.js → index-9dcce42f.js} +0 -0
  505. /package/build/esm/{index-c36be057.js → index-af2d67c7.js} +0 -0
  506. /package/build/esm/{index-7ef48cea.js → index-cefb2fe7.js} +0 -0
  507. /package/build/esm/{index-589d6100.js → index-d23eb4f1.js} +0 -0
  508. /package/build/esm/{index-b65d813d.js → index-da6a5883.js} +0 -0
  509. /package/build/esm/{index-4fb393ab.js → index-fcaac1b0.js} +0 -0
  510. /package/build/esm/{index.styles-8840440f.js → index.styles-b59189ca.js} +0 -0
  511. /package/build/esm/{localizeNumberFormat-2a5bfdff.js → localizeNumberFormat-6048033f.js} +0 -0
  512. /package/build/esm/{normalizeLink-2c11be1c.js → normalizeLink-057e1753.js} +0 -0
  513. /package/build/esm/{number-aa73a17e.js → number-4736f726.js} +0 -0
  514. /package/build/esm/{other-27345fe3.js → other-e24b4153.js} +0 -0
  515. /package/build/esm/{paths-4c89404d.js → paths-f790d1d7.js} +0 -0
  516. /package/build/esm/{translationsContext-90b6afe2.js → translationsContext-75264091.js} +0 -0
  517. /package/build/esm/{tslib.es6-a80c6693.js → tslib.es6-597deede.js} +0 -0
  518. /package/build/esm/{types-e4a41f78.js → types-5e612e53.js} +0 -0
  519. /package/build/esm/{useIsInit-c28f88f7.js → useIsInit-de82c19f.js} +0 -0
  520. /package/build/esm/{useOutsideClick-16056fa9.js → useOutsideClick-7f389bd0.js} +0 -0
  521. /package/build/esm/{useScrollbarSize-0ef2fefd.js → useScrollbarSize-01a30d8b.js} +0 -0
  522. /package/build/esm/{useUniqueId-fa86fb02.js → useUniqueId-ddeb8a5e.js} +0 -0
  523. /package/build/esm/{utils-adf81d95.js → utils-440717e5.js} +0 -0
  524. /package/build/{index-7bfc73a2.js → index-3961bc49.js} +0 -0
  525. /package/build/{index-b6e2d4f0.js → index-3ba5b31a.js} +0 -0
  526. /package/build/{index-98b65317.js → index-48ffbf4e.js} +0 -0
  527. /package/build/{index-e7044450.js → index-590f42c3.js} +0 -0
  528. /package/build/{index-7c19c96f.js → index-5f06dbb6.js} +0 -0
  529. /package/build/{index-78bfba92.js → index-9fb4a20c.js} +0 -0
  530. /package/build/{index-a6920a92.js → index-bfebdd2c.js} +0 -0
  531. /package/build/{index-ea71a000.js → index-d0af9ab7.js} +0 -0
  532. /package/build/{index.styles-fd640cc7.js → index.styles-eccbfb9d.js} +0 -0
  533. /package/build/{localizeNumberFormat-b6b23c88.js → localizeNumberFormat-92b54b29.js} +0 -0
  534. /package/build/{normalizeLink-474417bf.js → normalizeLink-c9631ba6.js} +0 -0
  535. /package/build/{number-7e2345b8.js → number-34e43412.js} +0 -0
  536. /package/build/{other-5fb38535.js → other-0108fca8.js} +0 -0
  537. /package/build/{paths-efafc65e.js → paths-4b0396c7.js} +0 -0
  538. /package/build/{translationsContext-fe4ec033.js → translationsContext-476cde4e.js} +0 -0
  539. /package/build/{tslib.es6-285f11e2.js → tslib.es6-0a1efaa5.js} +0 -0
  540. /package/build/{types-28fe4d86.js → types-7847e0be.js} +0 -0
  541. /package/build/{useIsInit-d90f6e2b.js → useIsInit-5b26f631.js} +0 -0
  542. /package/build/{useOutsideClick-fc4356bf.js → useOutsideClick-38891067.js} +0 -0
  543. /package/build/{useScrollbarSize-79108208.js → useScrollbarSize-363ad3f8.js} +0 -0
  544. /package/build/{useUniqueId-fa47f989.js → useUniqueId-73fe343d.js} +0 -0
  545. /package/build/{utils-7ceb272c.js → utils-5fa7ec2e.js} +0 -0
package/build/esm/lead.js CHANGED
@@ -1,44 +1,45 @@
1
- import { _ as __rest, a as __awaiter } from './tslib.es6-a80c6693.js';
2
- import React__default, { createContext, useMemo, useEffect, useRef, useState, useContext, useCallback } from 'react';
3
- import { createStyles, Box, Button as Button$2, Autocomplete, clsx, Input as Input$1, TextInput, NumberInput as NumberInput$1, Portal, Transition, Overlay } from '@mantine/core';
1
+ import { _ as __rest, a as __awaiter } from './tslib.es6-597deede.js';
2
+ import React__default, { createContext, useMemo, useEffect, useRef, useState, useContext, forwardRef, useCallback, useImperativeHandle, memo } from 'react';
3
+ import { createStyles, Box, Input as Input$1, clsx, Autocomplete, Checkbox as Checkbox$1, Radio as Radio$1, Select as Select$1, TextInput, NumberInput as NumberInput$1, Button as Button$2, Portal, Transition, Overlay } from '@mantine/core';
4
4
  import dayjs from 'dayjs';
5
5
  import debounce from 'lodash/debounce';
6
- import { createFormContext } from '@mantine/form';
7
- import { u as useTranslations } from './index-4207fae8.js';
8
- import { T as TranslationsContext } from './translationsContext-90b6afe2.js';
6
+ import { createFormContext, useForm } from '@mantine/form';
7
+ import { u as useTranslations } from './index-3df48ed3.js';
8
+ import { T as TranslationsContext } from './translationsContext-75264091.js';
9
9
  import { getCookie, setCookie } from './miscCookieHelper.js';
10
- import { b as getWrapperDomWithSelector, a as getPopupWrapperDom } from './utils-adf81d95.js';
11
- import { T as Text } from './index-3af59329.js';
12
- import { S as Select, d as Checkbox, I as Input, R as Radio, P as Phone, N as NumberInput, O as OTP } from './index-ffa88d3d.js';
13
- import { D as DatePicker } from './index-25edd9d7.js';
14
- import { M as MAPPED_LOCALE } from './utils-bbcdef82.js';
15
- import '@mantine/dates';
16
- import { Z as ZINDEX_SSO } from './index-e35d4ac3.js';
17
- import './index-7d3b75e2.js';
18
- import './index-8d334024.js';
19
- import './useMantineLocale-3c15894c.js';
20
- import { B as Button$1 } from './index-7a817600.js';
21
- import './index.styles-8840440f.js';
10
+ import { b as getWrapperDomWithSelector, a as getPopupWrapperDom } from './utils-440717e5.js';
11
+ import { T as Text } from './index-fe73aae3.js';
12
+ import { S as Select, d as Checkbox, I as Input, R as Radio, P as Phone, N as NumberInput, O as OTP } from './index-9b198336.js';
13
+ import { D as DatePicker } from './index-29c90bd9.js';
14
+ import { M as MAPPED_LOCALE } from './utils-9ad44422.js';
15
+ import { DateInput } from '@mantine/dates';
16
+ import { Z as ZINDEX_SSO, I as ISO_FORMAT } from './index-9aee0d96.js';
17
+ import { C as COMMON_DATE_TRANSLATE_KEY } from './index-42b2d9b5.js';
18
+ import './index-74594561.js';
19
+ import './useMantineLocale-64d31ceb.js';
20
+ import { B as Button$1 } from './index-b74d4072.js';
21
+ import './index.styles-b59189ca.js';
22
22
  import { useClickOutside } from '@mantine/hooks';
23
- import './other-27345fe3.js';
24
- import './index-d12ed430.js';
25
- import { u as usePlacesAutocomplete, G as GOOGLE_API_KEY } from './usePlacesAutocomplete-7946fe73.js';
26
- import { B as Button } from './index-86b98bc5.js';
27
- import { H as Heading$1 } from './index-3aad9cea.js';
23
+ import './other-e24b4153.js';
24
+ import './index-d3657485.js';
25
+ import { u as usePlacesAutocomplete, G as GOOGLE_API_KEY } from './usePlacesAutocomplete-593e1f26.js';
26
+ import { B as Button } from './index-3d18933f.js';
27
+ import { H as Heading$1 } from './index-edfd0b23.js';
28
+ import styled from '@emotion/styled';
28
29
  import { v1 } from 'uuid';
29
- import { i as isVideo } from './index-589d6100.js';
30
- import { D as DrawerComponent } from './index-41253c23.js';
31
- import { u as useScreenSize } from './useScreenSize-6a9f2903.js';
32
- import { createPortal } from 'react-dom';
33
30
  import { css } from '@emotion/react';
34
- import styled from '@emotion/styled';
35
31
  import { theme } from './miscTheme.js';
36
- import { C as Close } from './Close-51c8b025.js';
32
+ import { i as isVideo } from './index-d23eb4f1.js';
33
+ import { D as DrawerComponent } from './index-e632f8a8.js';
34
+ import { u as useScreenSize } from './useScreenSize-0e511139.js';
35
+ import { createPortal } from 'react-dom';
36
+ import { I as InputDate } from './InputDate-cdbcab92.js';
37
+ import { C as Close } from './Close-ad9b18d7.js';
37
38
  import '@hhgtech/icons/other';
38
39
  import '@mantine/carousel';
39
- import './Locale-d927add8.js';
40
+ import './Locale-e81e6be1.js';
40
41
  import 'classnames';
41
- import './useUniqueId-fa86fb02.js';
42
+ import './useUniqueId-ddeb8a5e.js';
42
43
  import './constantsSite.js';
43
44
  import '@hhgtech/icons/core';
44
45
  import 'date-fns/locale';
@@ -72,7 +73,7 @@ if (sessionStorage.getItem('insider_object')) {
72
73
  }
73
74
  const docLang = document.documentElement.lang;
74
75
  // TODO: country code
75
- const LEAD_LOCALE_DATA = {
76
+ const LEAD_LOCALE_DATA$1 = {
76
77
  'vi-VN': {
77
78
  popupLang: 'vi',
78
79
  countryCode: 'vn',
@@ -114,7 +115,7 @@ const LEAD_LOCALE_DATA = {
114
115
  countryCodeNumber: 91,
115
116
  },
116
117
  };
117
- const LEAD_LOCALE = LEAD_LOCALE_DATA[docLang] || LEAD_LOCALE_DATA['vi-VN'];
118
+ const LEAD_LOCALE = LEAD_LOCALE_DATA$1[docLang] || LEAD_LOCALE_DATA$1['vi-VN'];
118
119
  function LEAD_RESET_VAR() {
119
120
  // LEAD_CURRENT_URL = location.href.toLowerCase();
120
121
  LEAD_CURRENT_URL =
@@ -135,6 +136,11 @@ const LEAD_TIMEZONE_DATA = {
135
136
  9: 'Asia/Manila', // Philippines / Filipinos Site
136
137
  };
137
138
 
139
+ const LEADGEN_ACTIONS = {
140
+ SHOW: 'SHOW',
141
+ SCROLL: 'SCROLL',
142
+ TIME: 'TIME',
143
+ };
138
144
  const LEADGEN_LAYOUT = {
139
145
  LightBoxA: 'LightBoxA',
140
146
  LightBoxB: 'LightBoxB',
@@ -164,8 +170,10 @@ const LEADGEN_BLOCK = {
164
170
  DropdownBlock: 'DropdownBlock',
165
171
  CheckboxBlock: 'CheckboxBlock',
166
172
  TncBlock: 'TncBlock',
173
+ TitleBlock: 'TitleBlock',
174
+ SubtitleBlock: 'SubtitleBlock',
167
175
  };
168
- const LEADGEN_BLOCK_IN_FORM = [
176
+ const LEADGEN_BLOCK_INPUT = [
169
177
  LEADGEN_BLOCK.TextBlock,
170
178
  LEADGEN_BLOCK.NumberBlock,
171
179
  LEADGEN_BLOCK.DateBlock,
@@ -181,6 +189,48 @@ const LEADGEN_BLOCK_IN_FORM = [
181
189
  LEADGEN_BLOCK.TncBlock,
182
190
  ];
183
191
  const SSO_MAP_LEAD = ['name', 'email', 'birthday', 'phone', 'gender'];
192
+ const LEAD_LOCALE_DATA = {
193
+ 'vi-VN': {
194
+ popupLang: 'vi',
195
+ countryCode: 'vn',
196
+ countryCodeNumber: 84,
197
+ },
198
+ 'id-ID': {
199
+ popupLang: 'id',
200
+ countryCode: 'id',
201
+ countryCodeNumber: 62,
202
+ },
203
+ 'th-TH': {
204
+ popupLang: 'th',
205
+ countryCode: 'th',
206
+ countryCodeNumber: 66,
207
+ },
208
+ 'ms-MY': {
209
+ popupLang: 'ms',
210
+ countryCode: 'my',
211
+ countryCodeNumber: 60,
212
+ },
213
+ 'zh-TW': {
214
+ popupLang: 'zh',
215
+ countryCode: 'tw',
216
+ countryCodeNumber: 886,
217
+ },
218
+ 'km-KH': {
219
+ popupLang: 'km',
220
+ countryCode: 'kh',
221
+ countryCodeNumber: 855,
222
+ },
223
+ 'my-MM': {
224
+ popupLang: 'my',
225
+ countryCode: 'mm',
226
+ countryCodeNumber: 95,
227
+ },
228
+ 'hi-IN': {
229
+ popupLang: 'hi',
230
+ countryCode: 'in',
231
+ countryCodeNumber: 91,
232
+ },
233
+ };
184
234
  const mappingSSOToLead = (userInfoProps) => {
185
235
  var _a, _b;
186
236
  try {
@@ -196,7 +246,7 @@ const mappingSSOToLead = (userInfoProps) => {
196
246
  if (ssoKey === 'birthday') {
197
247
  const dob = dayjs(initValue, 'YYYY-MM-DD', true);
198
248
  if (dob.isValid()) {
199
- user.birthday = dob;
249
+ user.birthday = dob.toDate();
200
250
  }
201
251
  }
202
252
  else if (ssoKey === 'gender') {
@@ -219,6 +269,46 @@ const mappingSSOToLead = (userInfoProps) => {
219
269
  catch (error) {
220
270
  return;
221
271
  }
272
+ };
273
+ const formatCampaignDetail = (campaign) => {
274
+ if (!campaign) {
275
+ return {};
276
+ }
277
+ try {
278
+ const { extra_fields, thank_you_image } = campaign || {};
279
+ const { textBlocks: exTextBlocks, imageBlocks: exImageBlocks, listBlockAdded: exListBlockAdded, listBlockThankyou: exListBlockThankyou, actionBlocks: exActionBlocks, } = extra_fields;
280
+ const textBlocks = JSON.parse(exTextBlocks);
281
+ const imageBlocks = JSON.parse(exImageBlocks);
282
+ const listBlockAdded = JSON.parse(exListBlockAdded);
283
+ const listBlockThankyou = JSON.parse(exListBlockThankyou);
284
+ const actionBlocks = JSON.parse(exActionBlocks);
285
+ const ThankYouBlock = {
286
+ image: { src: thank_you_image },
287
+ };
288
+ listBlockThankyou.forEach((block) => {
289
+ const { name, data } = block || {};
290
+ const { value: htmlText, align, newtab, url } = data || {};
291
+ switch (name) {
292
+ case LEADGEN_BLOCK.TitleBlock: {
293
+ ThankYouBlock.title = { htmlText, align };
294
+ }
295
+ case LEADGEN_BLOCK.SubtitleBlock: {
296
+ ThankYouBlock.description = { htmlText, align };
297
+ }
298
+ case LEADGEN_BLOCK.LinkButtonBlock: {
299
+ ThankYouBlock.button = { htmlText, newtab, url };
300
+ }
301
+ }
302
+ });
303
+ return Object.assign(Object.assign({}, campaign), { extra_fields: Object.assign(Object.assign({}, extra_fields), { textBlocks,
304
+ imageBlocks,
305
+ listBlockAdded,
306
+ listBlockThankyou,
307
+ actionBlocks }), ThankYouBlock });
308
+ }
309
+ catch (error) {
310
+ return {};
311
+ }
222
312
  };
223
313
 
224
314
  class Store {
@@ -229,6 +319,13 @@ class Store {
229
319
  }
230
320
  const leadStore = new Store();
231
321
 
322
+ const LEADGEN_API_METHOD = {
323
+ GET: 'get',
324
+ POST: 'POST',
325
+ };
326
+ const LEADGEN_API_PATH = {
327
+ V2_CAMPAIGN: 'api/v2/campaign',
328
+ };
232
329
  const leadApi = {
233
330
  call(_a) {
234
331
  var { url, data = undefined } = _a, config = __rest(_a, ["url", "data"]);
@@ -332,8 +429,39 @@ const verifyOtpLead = ({ phone, otp, type, }) => {
332
429
  },
333
430
  });
334
431
  };
432
+ const campaignGetByCode = (campaign_code) => {
433
+ return leadApi.call({
434
+ url: `${LEADGEN_API_PATH.V2_CAMPAIGN}/${campaign_code}`,
435
+ method: LEADGEN_API_METHOD.GET,
436
+ });
437
+ };
438
+ const campaignPostLead = ({ data }) => {
439
+ return leadApi.call({
440
+ url: 'api/v2/subscription-box',
441
+ method: LEADGEN_API_METHOD.POST,
442
+ data,
443
+ });
444
+ };
445
+ const campaignPostImpression = ({ code, action, title_article, ga_client_id, cookie_id, extra, url, referrer, }) => {
446
+ return leadApi.call({
447
+ url: `api/campaign/${code}/impression`,
448
+ method: LEADGEN_API_METHOD.POST,
449
+ data: {
450
+ action,
451
+ title_article,
452
+ cookie_id,
453
+ ga_client_id,
454
+ url,
455
+ extra,
456
+ referrer,
457
+ },
458
+ });
459
+ };
335
460
  const Service = {
336
461
  campaignGetById,
462
+ campaignGetByCode,
463
+ campaignPostLead,
464
+ campaignPostImpression,
337
465
  validateEmailOrPhoneOnSubot,
338
466
  validateEmailOrPhoneOnLeadGen,
339
467
  validatePhoneNumberOnLeadGen,
@@ -1125,6 +1253,7 @@ var enPH = {
1125
1253
  "validator.min": "jQuery.validator.format('Please enter a value greater than or equal to {0}.",
1126
1254
  "validator.emailUsed": "Email already in use for this campaign.",
1127
1255
  "validator.phoneUsed": "Your phone number already in use for this campaign.",
1256
+ "validator.dateInvalid": "This date is not valid, please update.",
1128
1257
  "lead.otp.title": "Enter OTP",
1129
1258
  "lead.otp.desc": "We have sent an OTP to your mobile number {phone}",
1130
1259
  "lead.otp.verify": "Verify",
@@ -1133,7 +1262,10 @@ var enPH = {
1133
1262
  "lead.otp.phonePlaceholder": "Enter OTP",
1134
1263
  "lead.empty.title": "Oops, seem your information is empty, do you want to submit the information again?",
1135
1264
  "lead.empty.cancel": "Cancel",
1136
- "lead.empty.submitAgain": "Submit again"
1265
+ "lead.empty.submitAgain": "Submit again",
1266
+ "common.day": "Day",
1267
+ "common.month": "Month",
1268
+ "common.year": "Year"
1137
1269
  };
1138
1270
 
1139
1271
  var hiIN = {
@@ -1144,6 +1276,7 @@ var hiIN = {
1144
1276
  "validator.maxlength": "कृपया {0} अक्षर से अधिक दर्ज न करें",
1145
1277
  "validator.minlength": "कृपया कम से कम {0} अक्षर दर्ज करें",
1146
1278
  "validator.phone": "कृपया एक वैध संख्या दर्ज करें",
1279
+ "validator.dateInvalid": "यह तिथि मान्य नहीं है, कृपया अपडेट करें।",
1147
1280
  "validator.emailUsed": "Email already in use for this campaign.",
1148
1281
  "validator.phoneUsed": "Your phone number already in use for this campaign.",
1149
1282
  "lead.otp.title": "Enter OTP",
@@ -1152,7 +1285,10 @@ var hiIN = {
1152
1285
  "lead.otp.resend": "Resend OTP{timer}",
1153
1286
  "lead.empty.title": "ऊप्स! लगता है आपकी जानकारी खाली है। क्या आप जानकारी फिर से सबमिट करना चाहते हैं?",
1154
1287
  "lead.empty.cancel": "रद्द करें",
1155
- "lead.empty.submitAgain": "फिर से सबमिट करें"
1288
+ "lead.empty.submitAgain": "फिर से सबमिट करें",
1289
+ "common.day": "साल",
1290
+ "common.month": "महीना",
1291
+ "common.year": ""
1156
1292
  };
1157
1293
 
1158
1294
  var idID = {
@@ -1165,6 +1301,7 @@ var idID = {
1165
1301
  "validator.phone": "Tolong daftarkan nomor telepon yang valid",
1166
1302
  "validator.emailUsed": "Email sudah digunakan untuk kampanye ini.",
1167
1303
  "validator.phoneUsed": "Nomor telepon Anda sudah digunakan untuk kampanye ini.",
1304
+ "validator.dateInvalid": "Tanggal ini tidak valid, silakan perbarui",
1168
1305
  "lead.otp.title": "Masukkan OTP",
1169
1306
  "lead.otp.desc": "Kami telah mengirimkan OTP ke nomor ponsel Anda {phone}",
1170
1307
  "lead.otp.verify": "Verifikasi",
@@ -1173,7 +1310,10 @@ var idID = {
1173
1310
  "lead.otp.phonePlaceholder": "Masukkan OTP",
1174
1311
  "lead.empty.title": "Oops, sepertinya informasi Anda kosong. Apakah Anda ingin mengirimkan informasi lagi?",
1175
1312
  "lead.empty.cancel": "Batal",
1176
- "lead.empty.submitAgain": "Kirim lagi"
1313
+ "lead.empty.submitAgain": "Kirim lagi",
1314
+ "common.day": "Hari",
1315
+ "common.month": "Bulan",
1316
+ "common.year": "Tahun"
1177
1317
  };
1178
1318
 
1179
1319
  var kmKH = {
@@ -1186,6 +1326,7 @@ var kmKH = {
1186
1326
  "validator.phone": "សូម​វាយបញ្ចូល​លេខ​ឲ្យ​បាន​ត្រឹមត្រូវ",
1187
1327
  "validator.emailUsed": "អ៊ីមែលត្រូវបានប្រើប្រាស់សម្រាប់យុទ្ធនាការនេះរួចហើយ។",
1188
1328
  "validator.phoneUsed": "លេខទូរស័ព្ទរបស់អ្នកត្រូវបានប្រើប្រាស់សម្រាប់យុទ្ធនាការនេះរួចហើយ។",
1329
+ "validator.dateInvalid": "កាលបរិច្ឆេទនេះមិនត្រឹមត្រូវទេ សូមធ្វើបច្ចុប្បន្នភាព។",
1189
1330
  "lead.otp.title": "បញ្ចូល OTP",
1190
1331
  "lead.otp.desc": "យើងបានផ្ញើ OTP ទៅកាន់លេខទូរសព្ទរបស់អ្នក {phone}",
1191
1332
  "lead.otp.verify": "ផ្ទៀងផ្ទាត់",
@@ -1194,7 +1335,10 @@ var kmKH = {
1194
1335
  "lead.otp.phonePlaceholder": "បញ្ចូល OTP",
1195
1336
  "lead.empty.title": "អូុបស! ហាក់ដូចជាព័ត៌មានរបស់អ្នកទទេ។ តើអ្នកចង់ដាក់ស្នើព័ត៌មានម្តងទៀតទេ?",
1196
1337
  "lead.empty.cancel": "លុប​ចោល",
1197
- "lead.empty.submitAgain": "ដាក់ស្នើម្ដងទៀត"
1338
+ "lead.empty.submitAgain": "ដាក់ស្នើម្ដងទៀត",
1339
+ "common.day": "ឆ្នាំ",
1340
+ "common.month": "ខែ",
1341
+ "common.year": "ថ្ងៃ"
1198
1342
  };
1199
1343
 
1200
1344
  var msMY = {
@@ -1207,6 +1351,7 @@ var msMY = {
1207
1351
  "validator.phone": "Sila masukkan no telefon yang sah.",
1208
1352
  "validator.emailUsed": "Emel sudah digunakan untuk kempen ini.",
1209
1353
  "validator.phoneUsed": "Nombor telefon anda sudah digunakan untuk kempen ini.",
1354
+ "validator.dateInvalid": "Tarikh ini tidak sah, sila kemas kini",
1210
1355
  "lead.otp.title": "Masukkan OTP",
1211
1356
  "lead.otp.desc": "Kami telah menghantar OTP ke nombor telefon bimbit anda {phone}",
1212
1357
  "lead.otp.verify": "Sahkan",
@@ -1215,7 +1360,10 @@ var msMY = {
1215
1360
  "lead.otp.phonePlaceholder": "Masukkan OTP",
1216
1361
  "lead.empty.title": "Oops, nampaknya maklumat anda kosong. Adakah anda ingin menghantar maklumat semula?",
1217
1362
  "lead.empty.cancel": "Batal",
1218
- "lead.empty.submitAgain": "Hantar semula"
1363
+ "lead.empty.submitAgain": "Hantar semula",
1364
+ "common.day": "Hari",
1365
+ "common.month": "Bulan",
1366
+ "common.year": "Tahun"
1219
1367
  };
1220
1368
 
1221
1369
  var myMM = {
@@ -1228,6 +1376,7 @@ var myMM = {
1228
1376
  "validator.phone": "မှန်ကန်သော ဖုန်းနံပါတ်ထည့်သွင်းပါ",
1229
1377
  "validator.emailUsed": "ဤအေကာင့်အတွက် အီးမေးလ်ကို အသုံးပြုပြီးဖြစ်ပါသည်။",
1230
1378
  "validator.phoneUsed": "ဤအေကာင့်အတွက် သင့်ဖုန်းနံပါတ်ကို အသုံးပြုပြီးဖြစ်ပါသည်။",
1379
+ "validator.dateInvalid": "ယနေ့စွဲမှားနေသည်၊ ကျေးဇူးပြု၍ ပြင်ဆင်ပါ။",
1231
1380
  "lead.otp.title": "OTP ကိုထည့်ပါ",
1232
1381
  "lead.otp.desc": "ကျွန်ုပ်တို့သည် OTP ကိုသင့်ဖုန်းနံပါတ် {phone} သို့ပို့ခဲ့သည်",
1233
1382
  "lead.otp.verify": "အတည်ပြုပါ",
@@ -1236,7 +1385,10 @@ var myMM = {
1236
1385
  "lead.otp.phonePlaceholder": "OTP ကိုထည့်ပါ",
1237
1386
  "lead.empty.title": "အုပ်စ်! သင့်အချက်အလက်သည် ဗလာဖြစ်နေသလိုဖြစ်သည်။ ထပ်မံတင်သွင်းလိုပါသလား?",
1238
1387
  "lead.empty.cancel": "မလုပ်ဆောင်ပါ",
1239
- "lead.empty.submitAgain": "ထပ်မံတင်သွင်းပါ"
1388
+ "lead.empty.submitAgain": "ထပ်မံတင်သွင်းပါ",
1389
+ "common.day": "ရက်",
1390
+ "common.month": "လ",
1391
+ "common.year": "နှစ်"
1240
1392
  };
1241
1393
 
1242
1394
  var thTH = {
@@ -1249,6 +1401,7 @@ var thTH = {
1249
1401
  "validator.phone": "กรุณาใส่ตัวเลขที่ถูกต้อง",
1250
1402
  "validator.emailUsed": "อีเมลนี้ถูกใช้สำหรับแคมเปญนี้แล้ว",
1251
1403
  "validator.phoneUsed": "หมายเลขโทรศัพท์ของคุณถูกใช้สำหรับแคมเปญนี้แล้ว",
1404
+ "validator.dateInvalid": "วันที่นี้ไม่ถูกต้อง โปรดอัปเดต",
1252
1405
  "lead.otp.title": "ป้อน OTP",
1253
1406
  "lead.otp.desc": "เราได้ส่ง OTP ไปยังหมายเลขโทรศัพท์มือถือของคุณ {phone}",
1254
1407
  "lead.otp.verify": "ยืนยัน",
@@ -1257,7 +1410,10 @@ var thTH = {
1257
1410
  "lead.otp.phonePlaceholder": "ป้อน OTP",
1258
1411
  "lead.empty.title": "อุ๊ปส์! ดูเหมือนว่าข้อมูลของคุณว่างเปล่า คุณต้องการส่งข้อมูลอีกครั้งหรือไม่?",
1259
1412
  "lead.empty.cancel": "ยกเลิก",
1260
- "lead.empty.submitAgain": "ส่งอีกครั้ง"
1413
+ "lead.empty.submitAgain": "ส่งอีกครั้ง",
1414
+ "common.day": "วัน",
1415
+ "common.month": "เดือน",
1416
+ "common.year": "ปี"
1261
1417
  };
1262
1418
 
1263
1419
  var viVN = {
@@ -1281,6 +1437,7 @@ var viVN = {
1281
1437
  "validator.phone": "Nhập đúng định dạng số điện thoại",
1282
1438
  "validator.emailUsed": "Email này đã được sử dụng.",
1283
1439
  "validator.phoneUsed": "Số điện thoại này đã được sử dụng.",
1440
+ "validator.dateInvalid": "Ngày này không hợp lệ, vui lòng cập nhật.",
1284
1441
  "lead.otp.title": "Nhập OTP",
1285
1442
  "lead.otp.desc": "Chúng tôi đã gửi OTP đến số điện thoại của bạn {phone}",
1286
1443
  "lead.otp.verify": "Xác minh",
@@ -1289,7 +1446,10 @@ var viVN = {
1289
1446
  "lead.otp.phonePlaceholder": "Nhập OTP",
1290
1447
  "lead.empty.title": "Oops, có vẻ như thông tin của bạn đang trống. Bạn có muốn gửi lại thông tin không?",
1291
1448
  "lead.empty.cancel": "Hủy",
1292
- "lead.empty.submitAgain": "Gửi lại"
1449
+ "lead.empty.submitAgain": "Gửi lại",
1450
+ "common.day": "Ngày",
1451
+ "common.month": "Tháng",
1452
+ "common.year": "Năm"
1293
1453
  };
1294
1454
 
1295
1455
  var zhTW = {
@@ -1302,6 +1462,7 @@ var zhTW = {
1302
1462
  "validator.phone": "請填入有效的電話號碼",
1303
1463
  "validator.emailUsed": "此電子郵件已被使用於此活動。",
1304
1464
  "validator.phoneUsed": "您的手機號碼已被使用於此活動。",
1465
+ "validator.dateInvalid": "此日期無效,請更新.",
1305
1466
  "lead.otp.title": "輸入 OTP",
1306
1467
  "lead.otp.desc": "我們已將 OTP 發送到您的手機號碼 {phone}",
1307
1468
  "lead.otp.verify": "驗證",
@@ -1310,7 +1471,10 @@ var zhTW = {
1310
1471
  "lead.otp.phonePlaceholder": "輸入 OTP",
1311
1472
  "lead.empty.title": "哎呀,您的資訊似乎是空的,您想要重新提交資訊嗎?",
1312
1473
  "lead.empty.cancel": "取消",
1313
- "lead.empty.submitAgain": "重新提交"
1474
+ "lead.empty.submitAgain": "重新提交",
1475
+ "common.day": "日",
1476
+ "common.month": "月",
1477
+ "common.year": "年"
1314
1478
  };
1315
1479
 
1316
1480
  const translationsMap = {
@@ -1322,6 +1486,7 @@ const translationsMap = {
1322
1486
  'my-MM': myMM,
1323
1487
  'km-KH': kmKH,
1324
1488
  'zh-TW': zhTW,
1489
+ 'zh-CN': zhTW,
1325
1490
  'th-TH': thTH,
1326
1491
  'tl-PH': enPH,
1327
1492
  };
@@ -1335,188 +1500,1201 @@ const getTranslations = (locale) => {
1335
1500
 
1336
1501
  const LeadGenContext = createContext({});
1337
1502
 
1338
- const useImageSize = (src) => {
1339
- const [width, setWidth] = useState(16);
1340
- const [height, setHeight] = useState(9);
1341
- const [loaded, setLoaded] = useState(false);
1342
- // load src image to get its width and height
1503
+ const LeadGenSubscriptionBoxContext = createContext({});
1504
+ const LeadGenSubscriptionBoxProvider = (props) => {
1505
+ const { campaign_code, apiUrl: apiUrlProps, apiSubotUrl, locale, forceCampaign: forceCampaignProps, children, } = props;
1506
+ const [forceCampaign, setForceCampaign] = useState(forceCampaignProps);
1507
+ const leadGenSubscriptionBoxValue = useMemo(() => (Object.assign(Object.assign({}, props), { forceCampaign })), [campaign_code, locale, forceCampaign]);
1508
+ const translationContextValue = { locale, values: getTranslations(locale) };
1343
1509
  useEffect(() => {
1344
- setLoaded(false);
1345
- if (src) {
1346
- const img = new Image();
1347
- img.addEventListener('load', () => {
1348
- setWidth(img.naturalWidth);
1349
- setHeight(img.naturalHeight);
1350
- setLoaded(true);
1351
- });
1352
- img.addEventListener('error', () => {
1353
- setWidth(16);
1354
- setHeight(9);
1355
- setLoaded(true);
1356
- });
1357
- img.src = src;
1510
+ if (forceCampaignProps) {
1511
+ setForceCampaign(forceCampaignProps);
1512
+ return;
1358
1513
  }
1359
- else {
1360
- setWidth(16);
1361
- setHeight(9);
1362
- setLoaded(true);
1514
+ if (campaign_code) {
1515
+ Service.campaignGetByCode(campaign_code).then((res) => {
1516
+ const { _data } = res || {};
1517
+ const { campaigns } = _data || {};
1518
+ setForceCampaign(formatCampaignDetail(campaigns));
1519
+ });
1363
1520
  }
1364
- }, [src]);
1365
- return {
1366
- loaded,
1367
- width,
1368
- height,
1369
- };
1370
- };
1371
-
1372
- const CloseButton = ({ onClose, containerClassName, svgClassName, }) => (React__default.createElement("button", { onClick: onClose, className: `le-newbuilder-close-button js-modal__close ${containerClassName || ''}` },
1373
- React__default.createElement("svg", { width: "1em", height: "1em", viewBox: "0 0 20 20", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", className: svgClassName },
1374
- React__default.createElement("path", { d: "M9.99981 10.8432L14.0583 14.9017C14.1691 15.0125 14.3083 15.0691 14.476 15.0717C14.6437 15.0743 14.7854 15.0176 14.9013 14.9017C15.0172 14.7858 15.0752 14.6453 15.0752 14.4802C15.0752 14.3151 15.0172 14.1746 14.9013 14.0587L10.8429 10.0002L14.9013 5.9417C15.0121 5.83094 15.0688 5.69172 15.0713 5.52402C15.0739 5.35634 15.0172 5.21456 14.9013 5.09866C14.7854 4.98276 14.6449 4.9248 14.4798 4.9248C14.3147 4.9248 14.1742 4.98276 14.0583 5.09866L9.99981 9.15712L5.94133 5.09866C5.83057 4.98789 5.69135 4.93122 5.52365 4.92866C5.35598 4.92609 5.21419 4.98276 5.09829 5.09866C4.98239 5.21456 4.92444 5.35506 4.92444 5.52018C4.92444 5.6853 4.98239 5.82581 5.09829 5.9417L9.15675 10.0002L5.09829 14.0587C4.98752 14.1694 4.93085 14.3087 4.9283 14.4763C4.92572 14.644 4.98239 14.7858 5.09829 14.9017C5.21419 15.0176 5.3547 15.0756 5.51982 15.0756C5.68493 15.0756 5.82544 15.0176 5.94133 14.9017L9.99981 10.8432Z" }))));
1375
-
1376
- // url: imageBlocks.imageMobile.data.url
1377
- // newTab: imageBlocks.imageMobile.data.newtab
1378
- // imageMobile: campaignShow.image
1379
- // imageDestkop: campaignShow.image_desktop
1380
- const CenterTabLayout = ({ popupId, url, newTab, imageDestkop, imageMobile, onClose, onOtherSubmit, }) => {
1381
- const { width: imageMobileWidth, height: imageMobileHeight, loaded: imageMobileLoaded, } = useImageSize(imageMobile);
1382
- const { width: imageDestkopWidth, height: imageDestkopHeight, loaded: imageDestkopLoaded, } = useImageSize(imageDestkop);
1383
- if (!imageMobileLoaded || !imageDestkopLoaded)
1384
- return null;
1385
- return (React__default.createElement("div", { id: popupId, className: "lead-modal-wrapper", "data-popup-url": location.pathname, "data-popup-type": "center_tab" },
1386
- React__default.createElement("div", { className: "le-center-tab-popup" },
1387
- React__default.createElement("div", { style: { position: 'relative' } },
1388
- React__default.createElement("a", { className: "js-popup-other-submit", href: url, target: newTab ? 'blank' : '_parent', onClick: onOtherSubmit },
1389
- isVideo(imageMobile) ? (React__default.createElement("video", { loop: true, muted: true, autoPlay: true, className: "le-only-mobile" },
1390
- React__default.createElement("source", { src: imageMobile }))) : (React__default.createElement("img", { className: "le-only-mobile", src: imageMobile, style: {
1391
- aspectRatio: `${imageMobileWidth}/${imageMobileHeight}`,
1392
- } })),
1393
- isVideo(imageDestkop) ? (React__default.createElement("video", { loop: true, muted: true, autoPlay: true, className: "le-only-desktop" },
1394
- React__default.createElement("source", { src: imageDestkop }))) : (React__default.createElement("img", { className: "le-only-desktop", src: imageDestkop, style: {
1395
- aspectRatio: `${imageDestkopWidth}/${imageDestkopHeight}`,
1396
- } }))),
1397
- React__default.createElement(CloseButton, { onClose: onClose, containerClassName: "close-button-top-right" })))));
1398
- };
1399
-
1400
- // title: titleText
1401
- // titleAlign: textBlocks.titleBlock.data.align
1402
- // subtitle: textBlocks.subtitleBlock.data.value
1403
- // subtitleAlign: textBlocks.subtitleBlock.data.align
1404
- // url: actionBlocks.linkButtonBlock.data.url
1405
- // urlText: actionBlocks.linkButtonBlock.data.value
1406
- // newTab: actionBlocks.linkButtonBlock.data.newtab
1407
- // imageMobile: campaignShow.image
1408
- // imageDesktop: campaignShow.image_desktop
1409
- const FloatingLayout = ({ popupId, url, title, urlText, titleAlign, subtitle, subtitleAlign, newTab, imageDesktop, imageMobile, onClose, onOtherSubmit, }) => {
1410
- const { width: imageMobileWidth, height: imageMobileHeight, loaded: imageMobileLoaded, } = useImageSize(imageMobile);
1411
- const { width: imageDesktopWidth, height: imageDesktopHeight, loaded: imageDesktopLoaded, } = useImageSize(imageDesktop);
1412
- if (!imageMobileLoaded || !imageDesktopLoaded)
1413
- return null;
1414
- return (React__default.createElement("div", { id: popupId, className: "lead-modal-wrapper lead-floating-wrapper", "data-popup-url": location.pathname, "data-popup-type": "floating" },
1415
- React__default.createElement("aside", { className: "le-only-desktop" },
1416
- React__default.createElement("div", { className: "le-floating-desktop" },
1417
- React__default.createElement("div", { className: "le-floating-desktop-wrap", style: { position: 'relative', background: '#fff' } },
1418
- imageDesktop ? (React__default.createElement("div", null,
1419
- React__default.createElement("img", { style: {
1420
- maxWidth: 120,
1421
- borderTopLeftRadius: 5,
1422
- borderBottomLeftRadius: 5,
1423
- aspectRatio: `${imageDesktopWidth}/${imageDesktopHeight}`,
1424
- }, src: imageDesktop }))) : null,
1425
- React__default.createElement("div", { style: { padding: 20 } },
1426
- React__default.createElement("div", { className: `le-floating-desktop-title le-text-align-${titleAlign}` }, title),
1427
- React__default.createElement("div", { className: `le-floating-desktop-desc le-text-align-${subtitleAlign}` }, subtitle)),
1428
- React__default.createElement("a", { target: newTab ? 'blank' : '_parent', style: { marginLeft: 35, textDecoration: 'none' }, href: url },
1429
- React__default.createElement("button", { className: "le-joinbow-floating-btn js-popup-other-submit", onClick: onOtherSubmit }, urlText)),
1430
- React__default.createElement(CloseButton, { onClose: onClose, containerClassName: "close-button-top-right" })))),
1431
- React__default.createElement("aside", { className: "le-only-mobile" },
1432
- React__default.createElement("div", { className: "le-floating-mobile" },
1433
- React__default.createElement("div", { className: "le-floating-mobile-wrap", style: { position: 'relative', background: '#fff' } },
1434
- React__default.createElement("aside", { style: { display: 'flex', justifyContent: 'space-between' } },
1435
- React__default.createElement("div", null,
1436
- React__default.createElement("div", { className: `le-floating-mobile-title le-text-align-${titleAlign}` }, title),
1437
- React__default.createElement("div", { className: `le-floating-mobile-desc le-text-align-${subtitleAlign}` }, subtitle)),
1438
- imageMobile ? (React__default.createElement("div", null,
1439
- React__default.createElement("img", { style: {
1440
- marginLeft: 15,
1441
- marginTop: 4,
1442
- maxWidth: 100,
1443
- aspectRatio: `${imageMobileWidth}/${imageMobileHeight}`,
1444
- }, src: imageMobile }))) : null),
1445
- React__default.createElement("div", { style: { textAlign: 'center', marginTop: 10 } },
1446
- React__default.createElement("a", { target: newTab ? 'blank' : '_parent', href: url, style: { textDecoration: 'none' } },
1447
- React__default.createElement("button", { className: "le-joinbow-floating-btn js-popup-other-submit", onClick: onOtherSubmit }, urlText))),
1448
- React__default.createElement(CloseButton, { onClose: onClose, containerClassName: "close-button-top-right" }))))));
1449
- };
1450
-
1451
- const ThankyouPopup = ({ title, titleAlign, subtitle, subtitleAlign, link, linkNewTab, linkText, image, }) => {
1452
- const { width: imageWidth, height: imageHeight, loaded: imageLoaded, } = useImageSize(image);
1453
- if (!imageLoaded)
1521
+ }, [campaign_code]);
1522
+ useEffect(() => {
1523
+ leadStore.apiLeadUrl = apiUrlProps;
1524
+ leadStore.apiSubotUrl = apiSubotUrl;
1525
+ return () => {
1526
+ setForceCampaign(null);
1527
+ };
1528
+ }, []);
1529
+ if (!forceCampaign || !(forceCampaign === null || forceCampaign === void 0 ? void 0 : forceCampaign.id)) {
1454
1530
  return null;
1455
- return (React__default.createElement("div", { className: "lead-modal__thank-you leadgen-inner_thankyou" },
1456
- React__default.createElement("div", { style: { width: '100%' } },
1457
- React__default.createElement("img", { src: image, style: {
1458
- maxHeight: 162,
1459
- objectFit: 'cover',
1460
- aspectRatio: `${imageWidth}/${imageHeight}`,
1461
- }, loading: "lazy" }),
1462
- title && (React__default.createElement("h1", { className: `le-thankyou-title le-text-align-${titleAlign}` }, title)),
1463
- subtitle && (React__default.createElement("p", { className: `le-thankyou-subtitle le-text-align-${subtitleAlign}` }, subtitle.split('\n').map((text, idx, list) => {
1464
- const isShowBr = idx < list.length - 1;
1465
- return (React__default.createElement(React__default.Fragment, null,
1466
- text,
1467
- isShowBr && React__default.createElement("br", null)));
1468
- }))),
1469
- linkText && (React__default.createElement("div", null,
1470
- React__default.createElement("a", { href: link, target: linkNewTab ? '_blank' : 'parrent', rel: "noreferrer" },
1471
- React__default.createElement("button", { className: `lead-modal__btn ${LEAD_CLASS}` }, linkText)))))));
1531
+ }
1532
+ return (React__default.createElement(LeadGenSubscriptionBoxContext.Provider, { value: leadGenSubscriptionBoxValue },
1533
+ React__default.createElement(TranslationsContext.Provider, { value: translationContextValue }, children)));
1472
1534
  };
1473
1535
 
1474
- const InlineLayout = ({ content, inlinePosition, }) => {
1475
- const target = useMemo(() => {
1476
- if (!inlinePosition)
1477
- return null;
1478
- const parents = document.querySelectorAll(`[data-url="${location.pathname}"] .body-content`);
1479
- const allChildren = Array.from(parents).reduce((r, p) => {
1480
- return [...r, ...Array.from(p.children)];
1481
- }, []);
1482
- if (allChildren === null || allChildren === void 0 ? void 0 : allChildren.length) {
1483
- // find the third p tag in the body content, some other tags might mix in between
1484
- const allPTags = allChildren.filter((c) => c.nodeName === 'P');
1485
- const allH2Tags = allChildren.filter((c) => c.nodeName === 'H2');
1486
- let target = null;
1487
- switch (inlinePosition) {
1488
- case '1th':
1489
- target = allPTags[0];
1490
- break;
1491
- case '2th':
1492
- target = allPTags[1];
1493
- break;
1494
- case '3th':
1495
- target = allPTags[2];
1496
- break;
1497
- case '4th':
1498
- target = allPTags[3];
1499
- break;
1500
- case '5th':
1501
- target = allPTags[4];
1502
- break;
1503
- case '6th':
1504
- target = allPTags[5];
1505
- break;
1506
- case '7th':
1507
- target = allPTags[6];
1508
- break;
1509
- case '8th':
1510
- target = allPTags[7];
1511
- break;
1512
- case '9th':
1513
- target = allPTags[8];
1514
- break;
1515
- case '10th':
1516
- target = allPTags[9];
1517
- break;
1518
- case '11th':
1519
- target = allPTags[10];
1536
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
1537
+ const customParseFormat = require('dayjs/plugin/customParseFormat');
1538
+ dayjs.extend(customParseFormat);
1539
+ // You can give context variables any name
1540
+ const [LeadFormProvider, useLeadFormContext, useLeadForm] = createFormContext();
1541
+ const useLeadFormConfig = ({ listBlockAdded = [], validatingPhoneRef, validatingEmailRef, campaignId, campaign_subot_id = [], userInfo, format, }) => {
1542
+ var _a;
1543
+ const { t } = useTranslations();
1544
+ const initialValues = useMemo(() => mappingSSOToLead(userInfo), [userInfo === null || userInfo === void 0 ? void 0 : userInfo.id]);
1545
+ const LEAD_LOCALE = LEAD_LOCALE_DATA[(_a = document === null || document === void 0 ? void 0 : document.documentElement) === null || _a === void 0 ? void 0 : _a.lang] ||
1546
+ LEAD_LOCALE_DATA['vi-VN'];
1547
+ const validateObj = useMemo(() => {
1548
+ const InputBlocks = [
1549
+ 'TextBlock',
1550
+ 'NumberBlock',
1551
+ 'EmailBlock',
1552
+ 'PhoneBlock',
1553
+ 'DateBlock',
1554
+ 'CheckboxBlock',
1555
+ 'RadioBlock',
1556
+ 'DropdownBlock',
1557
+ 'PhoneOtpBlock',
1558
+ 'WhatsappOtpBlock',
1559
+ 'ZaloOtpBlock',
1560
+ 'LocationBlock',
1561
+ 'TncBlock',
1562
+ ];
1563
+ // ALL are required and can skip if not touched yet
1564
+ const withSharedCheck = (name, cb,
1565
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1566
+ block) => {
1567
+ return (value) => {
1568
+ var _a;
1569
+ const isBLockRequired = (_a = block === null || block === void 0 ? void 0 : block.data) === null || _a === void 0 ? void 0 : _a.required;
1570
+ if (!formRef.current.isTouched(name))
1571
+ return;
1572
+ if ((typeof value === 'string' && value.trim() === '') ||
1573
+ typeof value === 'undefined' ||
1574
+ (Array.isArray(value) && value.length === 0)) {
1575
+ return isBLockRequired
1576
+ ? t('validator.required')
1577
+ : cb === null || cb === void 0 ? void 0 : cb(value);
1578
+ }
1579
+ return cb === null || cb === void 0 ? void 0 : cb(value);
1580
+ };
1581
+ };
1582
+ return listBlockAdded
1583
+ .filter((b) => InputBlocks.includes(b.name))
1584
+ .reduce((r, b) => {
1585
+ const { name: fieldType, data } = b || {};
1586
+ const { value: fieldName, required } = data || {};
1587
+ const isRequired = required !== null && required !== void 0 ? required : true;
1588
+ if (fieldType === 'NumberBlock') {
1589
+ return Object.assign(Object.assign({}, r), { [fieldName]: withSharedCheck(fieldName, (value) => {
1590
+ if (value && isNaN(Number(value))) {
1591
+ return t('validator.number');
1592
+ }
1593
+ }, b) });
1594
+ }
1595
+ else if (fieldType === 'EmailBlock') {
1596
+ return Object.assign(Object.assign({}, r), { [fieldName]: withSharedCheck(fieldName, (value) => {
1597
+ if (value && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value)) {
1598
+ return t('validator.email');
1599
+ }
1600
+ if (!value)
1601
+ return;
1602
+ validatingEmailRef.current = true;
1603
+ setTimeout(() => {
1604
+ formRef.current.setFieldError(fieldName, 'Validating...');
1605
+ checkUsedEmailOrPhoneWithCache(campaignId, campaign_subot_id, {
1606
+ email: value,
1607
+ })
1608
+ .then((tKey) => {
1609
+ if (tKey) {
1610
+ formRef.current.setFieldError(fieldName, t(tKey));
1611
+ }
1612
+ else {
1613
+ formRef.current.clearFieldError(fieldName);
1614
+ }
1615
+ validatingEmailRef.current = false;
1616
+ })
1617
+ .catch((e) => {
1618
+ console.error(e);
1619
+ formRef.current.setFieldError(fieldName, e.message || 'Something went wrong');
1620
+ validatingEmailRef.current = false;
1621
+ });
1622
+ }, 200);
1623
+ }, b) });
1624
+ }
1625
+ else if (fieldType === 'PhoneBlock' ||
1626
+ fieldType === 'PhoneOtpBlock' ||
1627
+ fieldType === 'ZaloOtpBlock' ||
1628
+ fieldType === 'WhatsappOtpBlock') {
1629
+ return Object.assign(Object.assign({}, r), { [fieldName]: withSharedCheck(fieldName, (value) => {
1630
+ if (value &&
1631
+ window.intlTelInputUtils &&
1632
+ !window.intlTelInputUtils.isValidNumber(String(value), LEAD_LOCALE.countryCode)) {
1633
+ return t('validator.phone');
1634
+ }
1635
+ if (!value)
1636
+ return;
1637
+ validatingPhoneRef.current = true;
1638
+ setTimeout(() => {
1639
+ formRef.current.setFieldError(fieldName, 'Validating...');
1640
+ if (b.data.singleSubmission) {
1641
+ checkUsedPhoneOnlyWithCache(campaignId, value)
1642
+ .then((tKey) => {
1643
+ if (tKey) {
1644
+ formRef.current.setFieldError(fieldName, t(tKey));
1645
+ }
1646
+ else {
1647
+ formRef.current.clearFieldError(fieldName);
1648
+ }
1649
+ validatingPhoneRef.current = false;
1650
+ })
1651
+ .catch((err) => {
1652
+ console.error(err);
1653
+ formRef.current.setFieldError(fieldName, err.message || 'Something went wrong');
1654
+ validatingPhoneRef.current = false;
1655
+ });
1656
+ }
1657
+ else {
1658
+ checkUsedEmailOrPhoneWithCache(campaignId, campaign_subot_id, {
1659
+ phone: value,
1660
+ })
1661
+ .then((tKey) => {
1662
+ if (tKey) {
1663
+ formRef.current.setFieldError(fieldName, t(tKey));
1664
+ }
1665
+ else {
1666
+ formRef.current.clearFieldError(fieldName);
1667
+ }
1668
+ validatingPhoneRef.current = false;
1669
+ })
1670
+ .catch((e) => {
1671
+ console.error(e);
1672
+ formRef.current.setFieldError(fieldName, e.message || 'Something went wrong');
1673
+ validatingPhoneRef.current = false;
1674
+ });
1675
+ }
1676
+ }, 200);
1677
+ }, b) });
1678
+ }
1679
+ else if (fieldType === 'DateBlock') {
1680
+ return Object.assign(Object.assign({}, r), { [fieldName]: withSharedCheck(fieldName, (value) => {
1681
+ if (!isRequired && !value) {
1682
+ return;
1683
+ }
1684
+ const errMsg = t('validator.dateInvalid');
1685
+ const dayInJS = typeof value === 'string'
1686
+ ? dayjs(value, format, true)
1687
+ : dayjs(value);
1688
+ if (!dayInJS.isValid()) {
1689
+ return errMsg;
1690
+ }
1691
+ }, b) });
1692
+ }
1693
+ else if (fieldType === 'TncBlock') {
1694
+ return Object.assign(Object.assign({}, r), { [`TNC-` + b.id]: withSharedCheck('TNC-' + b.id, (value) => {
1695
+ if (isRequired && !value) {
1696
+ return t('validator.required');
1697
+ }
1698
+ }, b) });
1699
+ }
1700
+ else {
1701
+ return Object.assign(Object.assign({}, r), { [fieldName]: withSharedCheck(fieldName, undefined, b) });
1702
+ }
1703
+ }, {});
1704
+ }, [listBlockAdded.map((b) => b.name).join(','), format]);
1705
+ const form = useLeadForm({
1706
+ validateInputOnChange: true,
1707
+ validateInputOnBlur: true,
1708
+ clearInputErrorOnChange: true,
1709
+ validate: validateObj,
1710
+ initialValues,
1711
+ });
1712
+ const formRef = useRef(form);
1713
+ formRef.current = form;
1714
+ return { form, validateObj };
1715
+ };
1716
+
1717
+ const PhoneInput = forwardRef((props, ref) => {
1718
+ const { defaultCountry, id: idProps, name, placeholder, label, labelElement, labelProps, description, descriptionProps, withAsterisk, inputMode, inputContainer, inputWrapperOrder, error, className, classNames, style, styles } = props, restProps = __rest(props, ["defaultCountry", "id", "name", "placeholder", "label", "labelElement", "labelProps", "description", "descriptionProps", "withAsterisk", "inputMode", "inputContainer", "inputWrapperOrder", "error", "className", "classNames", "style", "styles"]);
1719
+ const id = idProps || v1() + name;
1720
+ return (React__default.createElement(Input$1.Wrapper, { size: "md", label: label, labelElement: labelElement, labelProps: Object.assign({ htmlFor: id }, labelProps), description: description, descriptionProps: descriptionProps, withAsterisk: withAsterisk, inputMode: inputMode, inputContainer: inputContainer, inputWrapperOrder: inputWrapperOrder, error: error, "data-invalid": !!error, className: className, classNames: classNames, style: style, styles: styles },
1721
+ React__default.createElement("div", { className: "mantine-Input-wrapper" },
1722
+ React__default.createElement(Phone, Object.assign({}, restProps, { id: id, ref: ref, name: name, spellCheck: false, placeholder: placeholder, defaultCountry: defaultCountry, className: "mantine-Input-input", type: "tel", "data-control": "tel" })))));
1723
+ });
1724
+
1725
+ const StyledLeadGenFormInner = styled.div `
1726
+ display: flex;
1727
+ flex-wrap: wrap;
1728
+ gap: 8px;
1729
+ .leadgen-form_input {
1730
+ width: calc(50% - 4px);
1731
+ }
1732
+
1733
+ .leadgen-form_input_checkbox {
1734
+ width: 100%;
1735
+ }
1736
+ `;
1737
+
1738
+ const cssInputNotShrink$1 = css `
1739
+ height: 100% !important;
1740
+ min-height: calc(var(--container-height, 56px) * 22 / 56);
1741
+ color: ${theme.colors.gray800};
1742
+ font-size: var(--input, 16px);
1743
+ line-height: calc(var(--container-height, 56px) * 22 / 56);
1744
+ border: none !important;
1745
+ border-radius: 0 !important;
1746
+ outline: none !important;
1747
+ box-shadow: none !important;
1748
+ padding: 0;
1749
+ cursor: pointer;
1750
+ opacity: 0;
1751
+
1752
+ ::placeholder {
1753
+ color: ${theme.colors.gray400};
1754
+ }
1755
+ `;
1756
+ const cssInputShrink$1 = css `
1757
+ height: auto !important;
1758
+ cursor: text;
1759
+ opacity: 1;
1760
+ transition: 0.1s ease-in-out all;
1761
+ `;
1762
+ const cssLabelNotShrink$1 = css `
1763
+ position: absolute;
1764
+ top: calc(var(--container-height) / 2);
1765
+ left: var(--space-x, 16px);
1766
+ color: ${theme.colors.gray400};
1767
+ font-size: var(--label-not-shrink, 16px);
1768
+ font-weight: 400;
1769
+ line-height: calc(var(--container-height, 56px) * 18 / 56);
1770
+ margin: 0;
1771
+ z-index: 1;
1772
+ cursor: pointer;
1773
+ transform: translateY(-50%);
1774
+ transition: 0.125s ease-in all;
1775
+ `;
1776
+ const cssLabelShrink$1 = css `
1777
+ color: ${theme.colors.gray600};
1778
+ font-weight: 600;
1779
+ font-size: var(--label-shrink, 12px);
1780
+ top: calc(var(--container-height) * 7 / 56);
1781
+ transform: none;
1782
+ transition: 0.125s ease-out all;
1783
+ `;
1784
+ const cssWrapperInputNotShrink$1 = css `
1785
+ min-height: var(--container-height, 56px);
1786
+ display: flex;
1787
+ align-items: flex-end;
1788
+ border: 1px solid ${theme.colors.gray200};
1789
+ border-radius: 8px;
1790
+ background-color: #fff;
1791
+ padding-inline: var(--space-x, 16px);
1792
+ padding-block: var(--space-y-not-shrink, 16px);
1793
+ cursor: pointer;
1794
+ pointer-events: none;
1795
+
1796
+ &:has(.mantine-Input-rightSection) {
1797
+ padding-right: var(--container-height, 56px);
1798
+ }
1799
+
1800
+ .mantine-Input-icon {
1801
+ display: none;
1802
+ }
1803
+
1804
+ .mantine-NumberInput-control {
1805
+ border-color: ${theme.colors.gray200};
1806
+ }
1807
+ `;
1808
+ const cssWrapperInputShrink$1 = css `
1809
+ height: auto;
1810
+ min-height: var(--container-height, 56px);
1811
+ padding-block: var(--space-y-shrink, 7px);
1812
+ cursor: text;
1813
+ pointer-events: auto;
1814
+ `;
1815
+ const cssInputWrapperError$1 = css `
1816
+ color: ${theme.colors.red800};
1817
+ font-size: 12px;
1818
+ line-height: 1.5;
1819
+ `;
1820
+ const StyledTextFieldContainer$1 = styled.div `
1821
+ --space-x: 16px;
1822
+ --space-y-not-shrink: 16px;
1823
+ --space-y-shrink: 7px;
1824
+ --container-height: 56px;
1825
+ --label-not-shrink: 16px;
1826
+ --label-shrink: 12px;
1827
+ --input: 16px;
1828
+
1829
+ position: relative;
1830
+ min-width: 100px;
1831
+ max-width: 100%;
1832
+ display: inline-block;
1833
+
1834
+ .textField_wrapper {
1835
+ display: inline-block;
1836
+ width: 100%;
1837
+ cursor: pointer;
1838
+ }
1839
+
1840
+ .mantine-InputWrapper-root {
1841
+ &[data-invalid='true'] {
1842
+ .mantine-Input-wrapper {
1843
+ border-color: ${theme.colors.red400};
1844
+ }
1845
+ }
1846
+
1847
+ .mantine-Input-wrapper {
1848
+ &:has([data-invalid]) {
1849
+ border-color: ${theme.colors.red400};
1850
+ }
1851
+ }
1852
+
1853
+ .mantine-InputWrapper-error {
1854
+ font-size: 12px !important;
1855
+ }
1856
+ }
1857
+
1858
+ .mantine-InputWrapper-label {
1859
+ ${cssLabelNotShrink$1}
1860
+ }
1861
+
1862
+ .mantine-Input-wrapper {
1863
+ ${cssWrapperInputNotShrink$1}
1864
+
1865
+ + .mantine-Popover-dropdown[data-position="bottom-start"] {
1866
+ left: 0 !important;
1867
+ }
1868
+ + .mantine-Popover-dropdown[data-position='top-start'] {
1869
+ top: unset !important;
1870
+ left: 0 !important;
1871
+ bottom: 100% !important;
1872
+ }
1873
+ }
1874
+
1875
+ .mantine-Input-input {
1876
+ ${cssInputNotShrink$1}
1877
+ }
1878
+
1879
+ &.textField_shrink,
1880
+ &:focus-within {
1881
+ .mantine-InputWrapper-label {
1882
+ ${cssLabelShrink$1}
1883
+ }
1884
+
1885
+ .mantine-Input-wrapper {
1886
+ ${cssWrapperInputShrink$1}
1887
+ &.mantine-Select-wrapper {
1888
+ .mantine-Select-rightSection {
1889
+ pointer-events: auto !important;
1890
+ }
1891
+ }
1892
+ }
1893
+
1894
+ .mantine-Input-input {
1895
+ ${cssInputShrink$1}
1896
+ }
1897
+
1898
+ &:has(.PhoneInput) {
1899
+ .mantine-InputWrapper-label {
1900
+ left: var(--space-x, 16px);
1901
+ }
1902
+ .PhoneInput {
1903
+ .PhoneInputInput {
1904
+ opacity: 1;
1905
+ }
1906
+ }
1907
+ }
1908
+ }
1909
+
1910
+ .PhoneInput {
1911
+ --phone-select: 75px;
1912
+ --phone-input-space-x: 8px;
1913
+ width: 100%;
1914
+ opacity: 1;
1915
+ border: none;
1916
+ .PhoneInputCountry {
1917
+ background-color: transparent;
1918
+ border: none;
1919
+ padding: 0;
1920
+ width: var(--phone-select, 75px);
1921
+ }
1922
+ .PhoneInputInput {
1923
+ flex: 1;
1924
+ min-width: 0;
1925
+ line-height: 1.5;
1926
+ outline: none !important;
1927
+ border: none;
1928
+ box-shadow: none;
1929
+ padding: 0 var(--phone-input-space-x, 8px);
1930
+ opacity: 0;
1931
+ color: ${theme.colors.gray800} !important;
1932
+ :focus {
1933
+ color: ${theme.colors.gray800} !important;
1934
+ }
1935
+ }
1936
+ }
1937
+
1938
+ &:has(.PhoneInput) {
1939
+ .mantine-InputWrapper-label {
1940
+ left: calc(
1941
+ var(--space-x, 16px) + var(--phone-select, 75px) +
1942
+ var(--phone-input-space-x, 8px)
1943
+ );
1944
+ }
1945
+ }
1946
+ `;
1947
+ const StyledChoiceFieldContainer$1 = styled.div `
1948
+ &.leadgen-form_checkbox,
1949
+ &.leadgen-form_radio {
1950
+ width: 100%;
1951
+ }
1952
+
1953
+ &.leadgen-form_dropdown {
1954
+ width: calc(50% - 12px);
1955
+ }
1956
+
1957
+ .mantine-InputWrapper-root {
1958
+ display: block;
1959
+ .mantine-InputWrapper-error {
1960
+ font-size: 12px !important;
1961
+ }
1962
+ }
1963
+
1964
+ .mantine-InputWrapper-label {
1965
+ margin-bottom: 0.5rem;
1966
+ color: ${theme.colors.gray800};
1967
+ font-size: 16px;
1968
+ font-weight: 400;
1969
+ line-height: 1.5;
1970
+ }
1971
+
1972
+ .mantine-Radio-root,
1973
+ .mantine-Checkbox-root {
1974
+ gap: 8px;
1975
+ min-width: calc(50% - 4px);
1976
+
1977
+ input[type='radio'],
1978
+ input[type='checkbox'] {
1979
+ border-color: ${theme.colors.gray600};
1980
+ width: 18px;
1981
+ height: 18px;
1982
+ }
1983
+ input[type='checkbox'] {
1984
+ border-radius: 4px;
1985
+ }
1986
+
1987
+ &[data-checked='true'] {
1988
+ input[type='radio'],
1989
+ input[type='checkbox'] {
1990
+ border-color: ${theme.colors.primary600};
1991
+ + svg {
1992
+ color: ${theme.colors.primary600};
1993
+ }
1994
+ }
1995
+
1996
+ input[type='radio'] {
1997
+ background-color: white;
1998
+ }
1999
+ }
2000
+
2001
+ .mantine-Checkbox-input {
2002
+ &:checked {
2003
+ border-color: ${theme.colors.primary600};
2004
+ }
2005
+ }
2006
+ }
2007
+
2008
+ .mantine-Radio-inner,
2009
+ .mantine-Checkbox-inner {
2010
+ width: 24px;
2011
+ height: 24px;
2012
+ display: flex;
2013
+ align-items: center;
2014
+ justify-content: center;
2015
+ }
2016
+
2017
+ .mantine-Radio-body,
2018
+ .mantine-Checkbox-body {
2019
+ display: flex;
2020
+ align-items: center;
2021
+ }
2022
+
2023
+ .mantine-Radio-label,
2024
+ .mantine-Checkbox-label {
2025
+ padding-left: 8px;
2026
+ color: ${theme.colors.gray800};
2027
+ font-size: 14px;
2028
+ line-height: 1.4;
2029
+ letter-spacing: -0.2px;
2030
+ }
2031
+
2032
+ .leadgen-choiceContainer {
2033
+ display: flex;
2034
+ flex-wrap: wrap;
2035
+ align-items: flex-start;
2036
+ gap: 8px;
2037
+ }
2038
+
2039
+ .mantine-InputWrapper-error {
2040
+ ${cssInputWrapperError$1}
2041
+ }
2042
+ `;
2043
+
2044
+ const TextField$1 = (props) => {
2045
+ const { shrink: shrinkProps, onChangeShrink, className, children } = props, restProps = __rest(props, ["shrink", "onChangeShrink", "className", "children"]);
2046
+ const containerRef = useClickOutside(() => {
2047
+ if (shrinkProps) {
2048
+ return;
2049
+ }
2050
+ setShrink(false);
2051
+ onChangeShrink === null || onChangeShrink === void 0 ? void 0 : onChangeShrink(false);
2052
+ });
2053
+ const [shrink, setShrink] = useState(shrinkProps);
2054
+ const onClick = useCallback((e) => {
2055
+ setShrink(true);
2056
+ onChangeShrink === null || onChangeShrink === void 0 ? void 0 : onChangeShrink(true);
2057
+ if (shrink) {
2058
+ return;
2059
+ }
2060
+ const $textEl = e.currentTarget.querySelectorAll('input:not([disabled]):not([type="submit"]),select:not([disabled]),textarea:not([disabled])');
2061
+ const $focusEl = $textEl.item($textEl.length - 1);
2062
+ if ($focusEl) {
2063
+ $focusEl.focus();
2064
+ setTimeout(() => {
2065
+ $focusEl.scrollIntoView({
2066
+ behavior: 'auto',
2067
+ block: 'center',
2068
+ inline: 'start',
2069
+ });
2070
+ }, 100);
2071
+ }
2072
+ }, [shrink]);
2073
+ useEffect(() => {
2074
+ setShrink(shrinkProps);
2075
+ }, [shrinkProps]);
2076
+ return (React__default.createElement(StyledTextFieldContainer$1, Object.assign({ shrink: shrink, className: clsx(className, 'textField', { textField_shrink: !!shrink }) }, restProps),
2077
+ React__default.createElement("div", { ref: containerRef, onClick: onClick, className: "textField_wrapper" }, children)));
2078
+ };
2079
+ const ChoiceField$1 = (props) => {
2080
+ const { children, className } = props, restProps = __rest(props, ["children", "className"]);
2081
+ return (React__default.createElement(StyledChoiceFieldContainer$1, Object.assign({ className: clsx(className, 'choiceField') }, restProps), children));
2082
+ };
2083
+
2084
+ const libraries = ['places'];
2085
+ const GoogleLocationBlock = (props) => {
2086
+ var _a;
2087
+ const { inputWrapperOrder = ['label', 'input', 'description', 'error'], defaultValue, value: valueProps, onChange: onChangeProps, locale } = props, restProps = __rest(props, ["inputWrapperOrder", "defaultValue", "value", "onChange", "locale"]);
2088
+ const [LoadScript, setLoadScript] = useState(null);
2089
+ const [value, setValue] = useState(defaultValue || valueProps);
2090
+ const { predictions } = usePlacesAutocomplete(value, '', locale === 'tl-PH' ? 'en' : (_a = locale === null || locale === void 0 ? void 0 : locale.split('-')) === null || _a === void 0 ? void 0 : _a[0]);
2091
+ const onChangeAutocomplete = useCallback((s) => {
2092
+ setValue(s);
2093
+ onChangeProps === null || onChangeProps === void 0 ? void 0 : onChangeProps(s);
2094
+ }, []);
2095
+ const onClickItem = useCallback((item) => {
2096
+ /** For sure get value */
2097
+ setValue(item.value);
2098
+ const predCur = predictions === null || predictions === void 0 ? void 0 : predictions.find(({ description }) => description === item.value);
2099
+ onChangeProps === null || onChangeProps === void 0 ? void 0 : onChangeProps(item.value, predCur === null || predCur === void 0 ? void 0 : predCur.rawData);
2100
+ }, [onChangeProps, predictions]);
2101
+ useEffect(() => {
2102
+ setValue(valueProps);
2103
+ }, [valueProps]);
2104
+ useEffect(() => {
2105
+ var _a, _b, _c;
2106
+ // only load extra google script when not yet loaded
2107
+ if (!((_c = (_b = (_a = window === null || window === void 0 ? void 0 : window.google) === null || _a === void 0 ? void 0 : _a.maps) === null || _b === void 0 ? void 0 : _b.places) === null || _c === void 0 ? void 0 : _c.AutocompleteService) && !LoadScript) {
2108
+ import('@react-google-maps/api').then((m) => {
2109
+ setLoadScript(() => m.LoadScript);
2110
+ });
2111
+ }
2112
+ }, []);
2113
+ return (React__default.createElement(Autocomplete, Object.assign({ defaultValue: defaultValue, value: value, onChange: onChangeAutocomplete, data: predictions.map((pred) => {
2114
+ return { value: pred.description, label: pred.description };
2115
+ }), filter: () => true, onItemSubmit: onClickItem, inputWrapperOrder: inputWrapperOrder, zIndex: ZINDEX_SSO - 9e6 + 2, withinPortal: true, styles: { dropdown: { pointerEvents: 'auto' } }, inputContainer: (children) => {
2116
+ return (React__default.createElement(React__default.Fragment, null,
2117
+ LoadScript && (React__default.createElement(LoadScript, { googleMapsApiKey: GOOGLE_API_KEY, libraries: libraries, loadingElement: React__default.createElement(React__default.Fragment, null), style: { width: '100%' } })),
2118
+ children));
2119
+ } }, restProps)));
2120
+ };
2121
+
2122
+ const LeadGenForm = forwardRef((props, ref) => {
2123
+ const { locale, blocks, scrollToErrorField = true, form: formProps, rules: validate, initialValues, onFinish, onFinishFailed, className, style, } = props;
2124
+ const formRef = useRef(null);
2125
+ const form = formProps || useForm({ initialValues, validate });
2126
+ const middlewareFinish = (values, event) => {
2127
+ onFinish === null || onFinish === void 0 ? void 0 : onFinish(values, event);
2128
+ };
2129
+ const middlewareFinishFailed = (errors, values, events) => {
2130
+ if (scrollToErrorField && errors) {
2131
+ const firstErrorKey = Object.keys(errors)[0];
2132
+ const firstErrorElement = document.querySelector(`[name="${firstErrorKey}"]`);
2133
+ if (firstErrorElement && (firstErrorElement === null || firstErrorElement === void 0 ? void 0 : firstErrorElement.focus)) {
2134
+ setTimeout(() => {
2135
+ firstErrorElement === null || firstErrorElement === void 0 ? void 0 : firstErrorElement.focus();
2136
+ firstErrorElement.scrollIntoView({
2137
+ behavior: 'auto',
2138
+ block: 'center',
2139
+ inline: 'center',
2140
+ });
2141
+ }, 100);
2142
+ }
2143
+ }
2144
+ onFinishFailed === null || onFinishFailed === void 0 ? void 0 : onFinishFailed(errors, values, events);
2145
+ };
2146
+ useEffect(() => {
2147
+ (() => __awaiter(void 0, void 0, void 0, function* () {
2148
+ if (!window.intlTelInputUtils) {
2149
+ yield require('intl-tel-input/build/js/utils');
2150
+ }
2151
+ }))();
2152
+ }, []);
2153
+ useImperativeHandle(ref, () => (Object.assign(Object.assign({}, form), { submit: () => formRef.current.requestSubmit() })), [form, formRef]);
2154
+ if (!blocks || !blocks.length) {
2155
+ return null;
2156
+ }
2157
+ return (React__default.createElement("form", { ref: formRef, onSubmit: form.onSubmit(middlewareFinish, middlewareFinishFailed), className: className, style: style },
2158
+ React__default.createElement(StyledLeadGenFormInner, { className: "leadgen-form_inputs" }, blocks.map((block, idx) => {
2159
+ const { id, name: blockName, data } = block;
2160
+ const { placeholder, value: name, required, listQuestion, valueHTML, isSendMailChimp = false, } = data;
2161
+ const formInputProps = form.getInputProps(name);
2162
+ const { value, error } = formInputProps;
2163
+ const reactKey = `${id}-${idx}`;
2164
+ switch (blockName) {
2165
+ case LEADGEN_BLOCK.TextBlock: {
2166
+ return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
2167
+ React__default.createElement(TextInput, Object.assign({ name: name, spellCheck: false, withAsterisk: required, label: placeholder, placeholder: placeholder, inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, type: "text", "data-control": "text" }, formInputProps))));
2168
+ }
2169
+ case LEADGEN_BLOCK.NumberBlock: {
2170
+ return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
2171
+ React__default.createElement(NumberInput$1, Object.assign({ name: value, spellCheck: false, withAsterisk: required, label: placeholder, placeholder: placeholder, inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, type: "number", "data-control": "number" }, formInputProps))));
2172
+ }
2173
+ case LEADGEN_BLOCK.EmailBlock: {
2174
+ return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
2175
+ React__default.createElement(TextInput, Object.assign({ name: name, spellCheck: false, withAsterisk: required, label: placeholder, placeholder: placeholder, inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, "data-control": "email" }, formInputProps))));
2176
+ }
2177
+ case LEADGEN_BLOCK.PhoneOtpBlock:
2178
+ case LEADGEN_BLOCK.WhatsappOtpBlock:
2179
+ case LEADGEN_BLOCK.ZaloOtpBlock:
2180
+ case LEADGEN_BLOCK.PhoneBlock: {
2181
+ return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
2182
+ React__default.createElement(PhoneInput, Object.assign({ name: name, spellCheck: false, withAsterisk: required, label: placeholder, placeholder: placeholder, inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, defaultCountry: (locale ? MAPPED_LOCALE[locale] || 'VN' : 'VN'), type: "text", "data-control": "text" }, formInputProps))));
2183
+ }
2184
+ case LEADGEN_BLOCK.LocationBlock: {
2185
+ return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
2186
+ React__default.createElement(GoogleLocationBlock, Object.assign({ name: name, withAsterisk: required, label: placeholder, placeholder: placeholder, inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, locale: locale, "data-control": "text" }, formInputProps))));
2187
+ }
2188
+ case LEADGEN_BLOCK.DateBlock: {
2189
+ return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
2190
+ React__default.createElement(DateInput, Object.assign({ locale: (MAPPED_LOCALE === null || MAPPED_LOCALE === void 0 ? void 0 : MAPPED_LOCALE[locale]) || MAPPED_LOCALE['vi-VN'], valueFormat: "DD/MM/YYYY", name: name, withAsterisk: required, label: placeholder, placeholder: placeholder, inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, type: "default", "data-control": "date" }, formInputProps))));
2191
+ }
2192
+ case LEADGEN_BLOCK.DropdownBlock:
2193
+ return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
2194
+ React__default.createElement("div", { style: { display: 'none' }, "data-extra": true, "data-name": value, "data-control": 'dropdown' }),
2195
+ React__default.createElement(Select$1, Object.assign({ name: name, withAsterisk: required, label: placeholder, placeholder: placeholder, data: listQuestion.map((l) => ({
2196
+ value: l.value,
2197
+ label: l.placeholder,
2198
+ })) }, formInputProps))));
2199
+ case LEADGEN_BLOCK.CheckboxBlock: {
2200
+ const formInputCheckboxProps = form.getInputProps(name, {
2201
+ type: 'checkbox',
2202
+ });
2203
+ return (React__default.createElement(ChoiceField$1, { className: "leadgen-form_input leadgen-form_input_checkbox", key: reactKey },
2204
+ isSendMailChimp && (React__default.createElement("div", { style: { display: 'none' }, "data-name": name + '-mailchimp' })),
2205
+ React__default.createElement(Checkbox$1.Group, Object.assign({ size: "md", withAsterisk: required, label: placeholder, value: value, sx: {
2206
+ display: 'flex',
2207
+ flexDirection: 'column',
2208
+ flexWrap: 'wrap',
2209
+ gap: 8,
2210
+ }, inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, inputContainer: (children) => {
2211
+ return (React__default.createElement("div", { className: "leadgen-choiceContainer" }, children));
2212
+ } }, formInputCheckboxProps), listQuestion.map((l, _idx) => (React__default.createElement(Checkbox$1, { name: name, key: _idx, value: l.value, label: l.placeholder, "data-control": "checkbox" }))))));
2213
+ }
2214
+ case LEADGEN_BLOCK.RadioBlock: {
2215
+ return (React__default.createElement(ChoiceField$1, { className: "leadgen-form_input leadgen-form_input_checkbox", key: reactKey },
2216
+ isSendMailChimp && (React__default.createElement("div", { style: { display: 'none' }, "data-name": name + '-mailchimp' })),
2217
+ React__default.createElement(Radio$1.Group, Object.assign({ size: "md", withAsterisk: required, label: placeholder, value: value, spellCheck: true, inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, inputContainer: (children) => {
2218
+ return (React__default.createElement("div", { className: "leadgen-choiceContainer" }, children));
2219
+ } }, formInputProps), listQuestion.map((l, _index) => (React__default.createElement(Radio$1, { name: name, key: _index, value: l.value, label: l.placeholder, "data-control": "radio" }))))));
2220
+ }
2221
+ case 'TncBlock':
2222
+ return (React__default.createElement(ChoiceField$1, { className: "leadgen-form_input leadgen-form_input_checkbox", key: reactKey },
2223
+ React__default.createElement(Input$1.Wrapper, { error: error },
2224
+ React__default.createElement(Checkbox$1, Object.assign({ value: value, name: 'TNC-' + id, label: React__default.createElement("p", { className: "lead-modal__tnc-link", dangerouslySetInnerHTML: { __html: valueHTML } }), className: "tnc-block", "data-control": "checkbox" }, formInputProps)))));
2225
+ default: {
2226
+ return null;
2227
+ }
2228
+ }
2229
+ }))));
2230
+ });
2231
+
2232
+ const LEADGEN_ORDER_INPUT_WRAPPER = ['label', 'input', 'description', 'error'];
2233
+
2234
+ const StyledLeadGenThankYou = styled.div `
2235
+ display: flex;
2236
+ gap: 8px;
2237
+ flex-direction: column;
2238
+ padding-block: 24px;
2239
+
2240
+ .leadgen-image {
2241
+ width: 120px;
2242
+ height: 120px;
2243
+ margin-inline: auto;
2244
+ object-fit: contain;
2245
+ object-position: center;
2246
+ text-align: center;
2247
+ }
2248
+
2249
+ .leadgen-title {
2250
+ margin-block: 0;
2251
+ color: ${theme.colors.gray900};
2252
+ font-weight: 700;
2253
+ font-size: 18px;
2254
+ line-height: 28px;
2255
+ letter-spacing: -0.2px;
2256
+ }
2257
+
2258
+ .leadgen-description {
2259
+ margin-block: 0;
2260
+ color: ${theme.colors.gray600};
2261
+ font-weight: 400;
2262
+ font-size: 14px;
2263
+ line-height: 22px;
2264
+ letter-spacing: -0.2px;
2265
+ text-align: center;
2266
+ }
2267
+
2268
+ > [data-align] {
2269
+ &[data-align='right'] {
2270
+ text-align: right;
2271
+ }
2272
+ &[data-align='center'] {
2273
+ text-align: center;
2274
+ }
2275
+ }
2276
+ `;
2277
+ const LeadGenThankYou = ({ image, title, description, showButton = false, button, className, style, }) => {
2278
+ const { src } = image;
2279
+ const { htmlText: titleText, align: titleAlign } = title;
2280
+ const { htmlText: descriptionText, align: descriptionAlign } = description;
2281
+ const { htmlText: buttonText, newtab, url, onClick } = button;
2282
+ return (React__default.createElement(StyledLeadGenThankYou, { className: className, style: style },
2283
+ React__default.createElement("img", { src: src, alt: "", className: "leadgen-thankyou_image leadgen-image" }),
2284
+ React__default.createElement("p", { className: "leadgen-thankyou_title leadgen-title", "data-align": titleAlign }, titleText),
2285
+ React__default.createElement("p", { className: "leadgen-thankyou_description leadgen-description", "data-align": descriptionAlign }, descriptionText),
2286
+ !!buttonText && showButton && (React__default.createElement(Button$2, { component: url ? 'a' : 'button', target: newtab ? '_blank' : undefined, href: url, size: "lg", variant: "filled", className: "leadgen-thankyoue_btn leadgen-btn", onClick: onClick }, buttonText))));
2287
+ };
2288
+
2289
+ const StyledLeadGenSubscriptionBoxBody = styled.div `
2290
+ margin-top: 16px;
2291
+ .leadgen-btn {
2292
+ margin-top: 16px;
2293
+ }
2294
+ `;
2295
+ const StyledLeadGenSubscriptionBoxHeaderImage = styled.div `
2296
+ margin-top: 3px;
2297
+ margin-right: 20px;
2298
+ width: 44px;
2299
+ height: 44px;
2300
+
2301
+ img {
2302
+ width: 100%;
2303
+ height: 100%;
2304
+ object-fix: contain;
2305
+ onject-position: center;
2306
+ }
2307
+
2308
+ :has(img[src='']) {
2309
+ display: none;
2310
+ }
2311
+ `;
2312
+ const StyledLeadGenSubscriptionBoxHeader = styled.div `
2313
+ display: flex;
2314
+ align-items: center;
2315
+ margin-bottom: 16px;
2316
+ .leadgen-title {
2317
+ margin-bottom: 0;
2318
+ flex: 1;
2319
+ min-width: 0;
2320
+ color: ${theme.colors.gray900};
2321
+ font-size: 18px;
2322
+ font-weight: 600;
2323
+ line-height: 1.4;
2324
+ letter-spacing: -0.8px;
2325
+ }
2326
+ `;
2327
+ const StyledLeadGenSubscriptionBox = styled.div `
2328
+ padding: 16px;
2329
+ border: 1px solid ${theme.colors.neutral100};
2330
+ border-radius: 12px;
2331
+ margin-inline: auto;
2332
+ .leadgen-form_inputs {
2333
+ .leadgen-form_input {
2334
+ width: 100%;
2335
+ }
2336
+ }
2337
+
2338
+ .leadgen-form_input {
2339
+ .mantine-Input-wrapper {
2340
+ max-height: 56px;
2341
+ }
2342
+ }
2343
+
2344
+ @media screen and (min-width: 768px) {
2345
+ .leadgen-subscription_box_body {
2346
+ display: flex;
2347
+ > form {
2348
+ flex: 1;
2349
+ min-width: 0;
2350
+
2351
+ .leadgen-form_inputs {
2352
+ .leadgen-form_input {
2353
+ width: calc(50% - 4px);
2354
+ }
2355
+ }
2356
+ }
2357
+
2358
+ .leadgen-btn {
2359
+ margin-top: 0;
2360
+ margin-left: 8px;
2361
+ width: auto;
2362
+ min-height: 56px;
2363
+ }
2364
+ }
2365
+ }
2366
+ `;
2367
+ const LeadGenSubscriptionBoxWithoutMemo = ({ locale, userInfo, siteId, siteDomain, forceCampaign, campaign_code, article_id, subscription_title: subscriptionTitleProps, }) => {
2368
+ var _a, _b, _c;
2369
+ const refContainer = useRef(null);
2370
+ const validatingEmailRef = useRef(false);
2371
+ const validatingPhoneRef = useRef(false);
2372
+ const { image, extra_fields, id: campaign_id, bot_id: campaign_subot_id = [], ThankYouBlock, } = forceCampaign || {};
2373
+ const { textBlocks, listBlockAdded, actionBlocks } = extra_fields || {};
2374
+ const { submitBlock } = actionBlocks || {};
2375
+ const [loading, setLoading] = useState(false);
2376
+ const [showThankyou, setShowThankyou] = useState(false);
2377
+ const formRef = useRef(null);
2378
+ const { form, validateObj } = useLeadFormConfig({
2379
+ listBlockAdded,
2380
+ campaignId: campaign_id,
2381
+ campaign_subot_id,
2382
+ validatingEmailRef,
2383
+ validatingPhoneRef,
2384
+ userInfo,
2385
+ });
2386
+ const subscription_title = useMemo(() => { var _a, _b; return subscriptionTitleProps || ((_b = (_a = textBlocks === null || textBlocks === void 0 ? void 0 : textBlocks.titleBlock) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.value); }, [subscriptionTitleProps, (_b = (_a = textBlocks === null || textBlocks === void 0 ? void 0 : textBlocks.titleBlock) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.value]);
2387
+ const { image: thankyouImage, title: thankyouTitle, description: thankyouDescription, button: thankyouButton, } = ThankYouBlock || {};
2388
+ const { apiUrl } = useMemo(() => {
2389
+ let apiUrl = leadStore.apiLeadUrl;
2390
+ if (apiUrl.includes('localhost')) {
2391
+ apiUrl = 'https://dev.leadgen.hellobacsi.com/';
2392
+ }
2393
+ return {
2394
+ apiUrl,
2395
+ };
2396
+ }, [siteDomain, siteId]);
2397
+ const url = useMemo(() => location.href.toLowerCase() || '', []);
2398
+ const article_title = useMemo(() => document.title || '', []);
2399
+ const cookie_id = useMemo(() => getCookie('hhg-id') || null, []);
2400
+ const ga_client_id = useMemo(() => getCookie('_ga') || null, []);
2401
+ const leadgenImpression = useCallback(() => {
2402
+ Service.campaignPostImpression({
2403
+ url,
2404
+ action: LEADGEN_ACTIONS.SCROLL,
2405
+ code: campaign_code,
2406
+ title_article: article_title,
2407
+ cookie_id,
2408
+ ga_client_id,
2409
+ extra: { cookie_id, article_id, subscription_title },
2410
+ });
2411
+ }, [
2412
+ article_id,
2413
+ article_title,
2414
+ cookie_id,
2415
+ ga_client_id,
2416
+ campaign_code,
2417
+ subscription_title,
2418
+ ]);
2419
+ const intersectionObserverCallback = useCallback((entries) => {
2420
+ entries.forEach((entry) => {
2421
+ const { isIntersecting, target } = entry;
2422
+ if (isIntersecting && target === refContainer.current) {
2423
+ leadgenImpression();
2424
+ }
2425
+ });
2426
+ }, [leadgenImpression]);
2427
+ const IObserver = new IntersectionObserver(intersectionObserverCallback);
2428
+ const middlewareOnSubmit = useCallback((value) => __awaiter(void 0, void 0, void 0, function* () {
2429
+ const newValue = {
2430
+ url,
2431
+ article_title,
2432
+ cookie_id,
2433
+ ga_client_id,
2434
+ article_id,
2435
+ campaign_id,
2436
+ campaign_code,
2437
+ subscription_title: subscription_title,
2438
+ };
2439
+ listBlockAdded.forEach(({ data: { value: k } }) => {
2440
+ newValue[k] = value[k];
2441
+ });
2442
+ setLoading(true);
2443
+ try {
2444
+ const { _data } = (yield Service.campaignPostLead({ data: newValue })) || {};
2445
+ const { model } = _data;
2446
+ if (model && model.id) {
2447
+ setShowThankyou(true);
2448
+ }
2449
+ }
2450
+ catch (error) {
2451
+ console.log('** Error : ', error);
2452
+ }
2453
+ setLoading(false);
2454
+ }), [
2455
+ url,
2456
+ article_id,
2457
+ article_title,
2458
+ cookie_id,
2459
+ ga_client_id,
2460
+ campaign_code,
2461
+ subscription_title,
2462
+ listBlockAdded,
2463
+ ]);
2464
+ useEffect(() => {
2465
+ if (refContainer.current) {
2466
+ IObserver.observe(refContainer.current);
2467
+ }
2468
+ return () => {
2469
+ IObserver.disconnect();
2470
+ };
2471
+ }, [
2472
+ url,
2473
+ article_id,
2474
+ article_title,
2475
+ ga_client_id,
2476
+ campaign_id,
2477
+ campaign_code,
2478
+ subscription_title,
2479
+ ]);
2480
+ return (React__default.createElement("div", { ref: refContainer },
2481
+ React__default.createElement(StyledLeadGenSubscriptionBox, null,
2482
+ showThankyou && (React__default.createElement(LeadGenThankYou, { image: Object.assign(Object.assign({}, thankyouImage), { src: thankyouImage.src || `${apiUrl}admin/img/thanksyou.png` }), title: thankyouTitle, description: thankyouDescription, button: thankyouButton })),
2483
+ !showThankyou && (React__default.createElement(React__default.Fragment, null,
2484
+ React__default.createElement(StyledLeadGenSubscriptionBoxHeader, null,
2485
+ !!image && (React__default.createElement(StyledLeadGenSubscriptionBoxHeaderImage, null,
2486
+ React__default.createElement("img", { src: image, alt: "" }))),
2487
+ React__default.createElement("p", { className: "leadgen-title" }, subscription_title)),
2488
+ React__default.createElement(StyledLeadGenSubscriptionBoxBody, { className: "leadgen-subscription_box_body" },
2489
+ React__default.createElement(LeadGenForm, { ref: formRef, form: form, rules: validateObj, blocks: listBlockAdded, locale: locale, onFinish: middlewareOnSubmit }),
2490
+ React__default.createElement(Button$2, { disabled: loading, loading: loading, variant: "filled", size: "lg", onClick: () => { var _a; return (_a = formRef.current) === null || _a === void 0 ? void 0 : _a.submit(); }, className: "leadgen-btn leadgen-btn_action", fullWidth: true }, (_c = submitBlock === null || submitBlock === void 0 ? void 0 : submitBlock.data) === null || _c === void 0 ? void 0 : _c.value)))))));
2491
+ };
2492
+ const LeadGenSubscriptionBoxWithMemo = memo(LeadGenSubscriptionBoxWithoutMemo);
2493
+
2494
+ const Container = () => {
2495
+ const context = useContext(LeadGenSubscriptionBoxContext);
2496
+ const {
2497
+ // apiUrl: apiUrlProps,
2498
+ // apiSubotUrl,
2499
+ campaign_code, article_id, subscription_title, locale, siteId, siteDomain, userInfo, forceCampaign, } = context;
2500
+ if (!forceCampaign || !(forceCampaign === null || forceCampaign === void 0 ? void 0 : forceCampaign.id)) {
2501
+ return null;
2502
+ }
2503
+ return (React__default.createElement(LeadGenSubscriptionBoxWithMemo, { locale: locale, userInfo: userInfo, siteId: siteId, siteDomain: siteDomain, forceCampaign: forceCampaign, campaign_code: campaign_code, article_id: article_id, subscription_title: subscription_title }));
2504
+ };
2505
+ Container.displayName = 'LeadGenSubscriptionBox';
2506
+ const LeadGenSubscriptionBoxContainer = (props) => {
2507
+ const { campaign_code } = props;
2508
+ if (!campaign_code) {
2509
+ return null;
2510
+ }
2511
+ return (React__default.createElement(LeadGenSubscriptionBoxProvider, Object.assign({}, props),
2512
+ React__default.createElement(Container, null)));
2513
+ };
2514
+ const LeadGenSubscriptionBox = LeadGenSubscriptionBoxContainer;
2515
+
2516
+ const useImageSize = (src) => {
2517
+ const [width, setWidth] = useState(16);
2518
+ const [height, setHeight] = useState(9);
2519
+ const [loaded, setLoaded] = useState(false);
2520
+ // load src image to get its width and height
2521
+ useEffect(() => {
2522
+ setLoaded(false);
2523
+ if (src) {
2524
+ const img = new Image();
2525
+ img.addEventListener('load', () => {
2526
+ setWidth(img.naturalWidth);
2527
+ setHeight(img.naturalHeight);
2528
+ setLoaded(true);
2529
+ });
2530
+ img.addEventListener('error', () => {
2531
+ setWidth(16);
2532
+ setHeight(9);
2533
+ setLoaded(true);
2534
+ });
2535
+ img.src = src;
2536
+ }
2537
+ else {
2538
+ setWidth(16);
2539
+ setHeight(9);
2540
+ setLoaded(true);
2541
+ }
2542
+ }, [src]);
2543
+ return {
2544
+ loaded,
2545
+ width,
2546
+ height,
2547
+ };
2548
+ };
2549
+
2550
+ const CloseButton = ({ onClose, containerClassName, svgClassName, }) => (React__default.createElement("button", { onClick: onClose, className: `le-newbuilder-close-button js-modal__close ${containerClassName || ''}` },
2551
+ React__default.createElement("svg", { width: "1em", height: "1em", viewBox: "0 0 20 20", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", className: svgClassName },
2552
+ React__default.createElement("path", { d: "M9.99981 10.8432L14.0583 14.9017C14.1691 15.0125 14.3083 15.0691 14.476 15.0717C14.6437 15.0743 14.7854 15.0176 14.9013 14.9017C15.0172 14.7858 15.0752 14.6453 15.0752 14.4802C15.0752 14.3151 15.0172 14.1746 14.9013 14.0587L10.8429 10.0002L14.9013 5.9417C15.0121 5.83094 15.0688 5.69172 15.0713 5.52402C15.0739 5.35634 15.0172 5.21456 14.9013 5.09866C14.7854 4.98276 14.6449 4.9248 14.4798 4.9248C14.3147 4.9248 14.1742 4.98276 14.0583 5.09866L9.99981 9.15712L5.94133 5.09866C5.83057 4.98789 5.69135 4.93122 5.52365 4.92866C5.35598 4.92609 5.21419 4.98276 5.09829 5.09866C4.98239 5.21456 4.92444 5.35506 4.92444 5.52018C4.92444 5.6853 4.98239 5.82581 5.09829 5.9417L9.15675 10.0002L5.09829 14.0587C4.98752 14.1694 4.93085 14.3087 4.9283 14.4763C4.92572 14.644 4.98239 14.7858 5.09829 14.9017C5.21419 15.0176 5.3547 15.0756 5.51982 15.0756C5.68493 15.0756 5.82544 15.0176 5.94133 14.9017L9.99981 10.8432Z" }))));
2553
+
2554
+ // url: imageBlocks.imageMobile.data.url
2555
+ // newTab: imageBlocks.imageMobile.data.newtab
2556
+ // imageMobile: campaignShow.image
2557
+ // imageDestkop: campaignShow.image_desktop
2558
+ const CenterTabLayout = ({ popupId, url, newTab, imageDestkop, imageMobile, onClose, onOtherSubmit, }) => {
2559
+ const { width: imageMobileWidth, height: imageMobileHeight, loaded: imageMobileLoaded, } = useImageSize(imageMobile);
2560
+ const { width: imageDestkopWidth, height: imageDestkopHeight, loaded: imageDestkopLoaded, } = useImageSize(imageDestkop);
2561
+ if (!imageMobileLoaded || !imageDestkopLoaded)
2562
+ return null;
2563
+ return (React__default.createElement("div", { id: popupId, className: "lead-modal-wrapper", "data-popup-url": location.pathname, "data-popup-type": "center_tab" },
2564
+ React__default.createElement("div", { className: "le-center-tab-popup" },
2565
+ React__default.createElement("div", { style: { position: 'relative' } },
2566
+ React__default.createElement("a", { className: "js-popup-other-submit", href: url, target: newTab ? 'blank' : '_parent', onClick: onOtherSubmit },
2567
+ isVideo(imageMobile) ? (React__default.createElement("video", { loop: true, muted: true, autoPlay: true, className: "le-only-mobile" },
2568
+ React__default.createElement("source", { src: imageMobile }))) : (React__default.createElement("img", { className: "le-only-mobile", src: imageMobile, style: {
2569
+ aspectRatio: `${imageMobileWidth}/${imageMobileHeight}`,
2570
+ } })),
2571
+ isVideo(imageDestkop) ? (React__default.createElement("video", { loop: true, muted: true, autoPlay: true, className: "le-only-desktop" },
2572
+ React__default.createElement("source", { src: imageDestkop }))) : (React__default.createElement("img", { className: "le-only-desktop", src: imageDestkop, style: {
2573
+ aspectRatio: `${imageDestkopWidth}/${imageDestkopHeight}`,
2574
+ } }))),
2575
+ React__default.createElement(CloseButton, { onClose: onClose, containerClassName: "close-button-top-right" })))));
2576
+ };
2577
+
2578
+ // title: titleText
2579
+ // titleAlign: textBlocks.titleBlock.data.align
2580
+ // subtitle: textBlocks.subtitleBlock.data.value
2581
+ // subtitleAlign: textBlocks.subtitleBlock.data.align
2582
+ // url: actionBlocks.linkButtonBlock.data.url
2583
+ // urlText: actionBlocks.linkButtonBlock.data.value
2584
+ // newTab: actionBlocks.linkButtonBlock.data.newtab
2585
+ // imageMobile: campaignShow.image
2586
+ // imageDesktop: campaignShow.image_desktop
2587
+ const FloatingLayout = ({ popupId, url, title, urlText, titleAlign, subtitle, subtitleAlign, newTab, imageDesktop, imageMobile, onClose, onOtherSubmit, }) => {
2588
+ const { width: imageMobileWidth, height: imageMobileHeight, loaded: imageMobileLoaded, } = useImageSize(imageMobile);
2589
+ const { width: imageDesktopWidth, height: imageDesktopHeight, loaded: imageDesktopLoaded, } = useImageSize(imageDesktop);
2590
+ if (!imageMobileLoaded || !imageDesktopLoaded)
2591
+ return null;
2592
+ return (React__default.createElement("div", { id: popupId, className: "lead-modal-wrapper lead-floating-wrapper", "data-popup-url": location.pathname, "data-popup-type": "floating" },
2593
+ React__default.createElement("aside", { className: "le-only-desktop" },
2594
+ React__default.createElement("div", { className: "le-floating-desktop" },
2595
+ React__default.createElement("div", { className: "le-floating-desktop-wrap", style: { position: 'relative', background: '#fff' } },
2596
+ imageDesktop ? (React__default.createElement("div", null,
2597
+ React__default.createElement("img", { style: {
2598
+ maxWidth: 120,
2599
+ borderTopLeftRadius: 5,
2600
+ borderBottomLeftRadius: 5,
2601
+ aspectRatio: `${imageDesktopWidth}/${imageDesktopHeight}`,
2602
+ }, src: imageDesktop }))) : null,
2603
+ React__default.createElement("div", { style: { padding: 20 } },
2604
+ React__default.createElement("div", { className: `le-floating-desktop-title le-text-align-${titleAlign}` }, title),
2605
+ React__default.createElement("div", { className: `le-floating-desktop-desc le-text-align-${subtitleAlign}` }, subtitle)),
2606
+ React__default.createElement("a", { target: newTab ? 'blank' : '_parent', style: { marginLeft: 35, textDecoration: 'none' }, href: url },
2607
+ React__default.createElement("button", { className: "le-joinbow-floating-btn js-popup-other-submit", onClick: onOtherSubmit }, urlText)),
2608
+ React__default.createElement(CloseButton, { onClose: onClose, containerClassName: "close-button-top-right" })))),
2609
+ React__default.createElement("aside", { className: "le-only-mobile" },
2610
+ React__default.createElement("div", { className: "le-floating-mobile" },
2611
+ React__default.createElement("div", { className: "le-floating-mobile-wrap", style: { position: 'relative', background: '#fff' } },
2612
+ React__default.createElement("aside", { style: { display: 'flex', justifyContent: 'space-between' } },
2613
+ React__default.createElement("div", null,
2614
+ React__default.createElement("div", { className: `le-floating-mobile-title le-text-align-${titleAlign}` }, title),
2615
+ React__default.createElement("div", { className: `le-floating-mobile-desc le-text-align-${subtitleAlign}` }, subtitle)),
2616
+ imageMobile ? (React__default.createElement("div", null,
2617
+ React__default.createElement("img", { style: {
2618
+ marginLeft: 15,
2619
+ marginTop: 4,
2620
+ maxWidth: 100,
2621
+ aspectRatio: `${imageMobileWidth}/${imageMobileHeight}`,
2622
+ }, src: imageMobile }))) : null),
2623
+ React__default.createElement("div", { style: { textAlign: 'center', marginTop: 10 } },
2624
+ React__default.createElement("a", { target: newTab ? 'blank' : '_parent', href: url, style: { textDecoration: 'none' } },
2625
+ React__default.createElement("button", { className: "le-joinbow-floating-btn js-popup-other-submit", onClick: onOtherSubmit }, urlText))),
2626
+ React__default.createElement(CloseButton, { onClose: onClose, containerClassName: "close-button-top-right" }))))));
2627
+ };
2628
+
2629
+ const ThankyouPopup = ({ title, titleAlign, subtitle, subtitleAlign, link, linkNewTab, linkText, image, }) => {
2630
+ const { width: imageWidth, height: imageHeight, loaded: imageLoaded, } = useImageSize(image);
2631
+ if (!imageLoaded)
2632
+ return null;
2633
+ return (React__default.createElement("div", { className: "lead-modal__thank-you leadgen-inner_thankyou" },
2634
+ React__default.createElement("div", { style: { width: '100%' } },
2635
+ React__default.createElement("img", { src: image, style: {
2636
+ maxHeight: 162,
2637
+ objectFit: 'cover',
2638
+ aspectRatio: `${imageWidth}/${imageHeight}`,
2639
+ }, loading: "lazy" }),
2640
+ title && (React__default.createElement("h1", { className: `le-thankyou-title le-text-align-${titleAlign}` }, title)),
2641
+ subtitle && (React__default.createElement("p", { className: `le-thankyou-subtitle le-text-align-${subtitleAlign}` }, subtitle.split('\n').map((text, idx, list) => {
2642
+ const isShowBr = idx < list.length - 1;
2643
+ return (React__default.createElement(React__default.Fragment, null,
2644
+ text,
2645
+ isShowBr && React__default.createElement("br", null)));
2646
+ }))),
2647
+ linkText && (React__default.createElement("div", null,
2648
+ React__default.createElement("a", { href: link, target: linkNewTab ? '_blank' : 'parrent', rel: "noreferrer" },
2649
+ React__default.createElement("button", { className: `lead-modal__btn ${LEAD_CLASS}` }, linkText)))))));
2650
+ };
2651
+
2652
+ const InlineLayout = ({ content, inlinePosition, }) => {
2653
+ const target = useMemo(() => {
2654
+ if (!inlinePosition)
2655
+ return null;
2656
+ const parents = document.querySelectorAll(`[data-url="${location.pathname}"] .body-content`);
2657
+ const allChildren = Array.from(parents).reduce((r, p) => {
2658
+ return [...r, ...Array.from(p.children)];
2659
+ }, []);
2660
+ if (allChildren === null || allChildren === void 0 ? void 0 : allChildren.length) {
2661
+ // find the third p tag in the body content, some other tags might mix in between
2662
+ const allPTags = allChildren.filter((c) => c.nodeName === 'P');
2663
+ const allH2Tags = allChildren.filter((c) => c.nodeName === 'H2');
2664
+ let target = null;
2665
+ switch (inlinePosition) {
2666
+ case '1th':
2667
+ target = allPTags[0];
2668
+ break;
2669
+ case '2th':
2670
+ target = allPTags[1];
2671
+ break;
2672
+ case '3th':
2673
+ target = allPTags[2];
2674
+ break;
2675
+ case '4th':
2676
+ target = allPTags[3];
2677
+ break;
2678
+ case '5th':
2679
+ target = allPTags[4];
2680
+ break;
2681
+ case '6th':
2682
+ target = allPTags[5];
2683
+ break;
2684
+ case '7th':
2685
+ target = allPTags[6];
2686
+ break;
2687
+ case '8th':
2688
+ target = allPTags[7];
2689
+ break;
2690
+ case '9th':
2691
+ target = allPTags[8];
2692
+ break;
2693
+ case '10th':
2694
+ target = allPTags[9];
2695
+ break;
2696
+ case '11th':
2697
+ target = allPTags[10];
1520
2698
  break;
1521
2699
  case '12th':
1522
2700
  target = allPTags[11];
@@ -1616,211 +2794,6 @@ const EmptyComponent = ({ onClose, onContinue, }) => {
1616
2794
  React__default.createElement(Button$2, { onClick: onContinue, size: "lg", variant: "filled", fullWidth: false, className: "leadgen-btn leadgen-btn_empty_again" }, t('lead.empty.submitAgain')))));
1617
2795
  };
1618
2796
 
1619
- const libraries = ['places'];
1620
- const GoogleLocationBlock = (props) => {
1621
- var _a;
1622
- const { inputWrapperOrder = ['label', 'input', 'description', 'error'], defaultValue, value: valueProps, onChange: onChangeProps, locale } = props, restProps = __rest(props, ["inputWrapperOrder", "defaultValue", "value", "onChange", "locale"]);
1623
- const [LoadScript, setLoadScript] = useState(null);
1624
- const [value, setValue] = useState(defaultValue || valueProps);
1625
- const { predictions } = usePlacesAutocomplete(value, '', locale === 'tl-PH' ? 'en' : (_a = locale === null || locale === void 0 ? void 0 : locale.split('-')) === null || _a === void 0 ? void 0 : _a[0]);
1626
- const onChangeAutocomplete = useCallback((s) => {
1627
- setValue(s);
1628
- onChangeProps === null || onChangeProps === void 0 ? void 0 : onChangeProps(s);
1629
- }, []);
1630
- const onClickItem = useCallback((item) => {
1631
- /** For sure get value */
1632
- setValue(item.value);
1633
- const predCur = predictions === null || predictions === void 0 ? void 0 : predictions.find(({ description }) => description === item.value);
1634
- onChangeProps === null || onChangeProps === void 0 ? void 0 : onChangeProps(item.value, predCur === null || predCur === void 0 ? void 0 : predCur.rawData);
1635
- }, [onChangeProps, predictions]);
1636
- useEffect(() => {
1637
- setValue(valueProps);
1638
- }, [valueProps]);
1639
- useEffect(() => {
1640
- var _a, _b, _c;
1641
- // only load extra google script when not yet loaded
1642
- if (!((_c = (_b = (_a = window === null || window === void 0 ? void 0 : window.google) === null || _a === void 0 ? void 0 : _a.maps) === null || _b === void 0 ? void 0 : _b.places) === null || _c === void 0 ? void 0 : _c.AutocompleteService) && !LoadScript) {
1643
- import('@react-google-maps/api').then((m) => {
1644
- setLoadScript(() => m.LoadScript);
1645
- });
1646
- }
1647
- }, []);
1648
- return (React__default.createElement(Autocomplete, Object.assign({ defaultValue: defaultValue, value: value, onChange: onChangeAutocomplete, data: predictions.map((pred) => {
1649
- return { value: pred.description, label: pred.description };
1650
- }), filter: () => true, onItemSubmit: onClickItem, inputWrapperOrder: inputWrapperOrder, zIndex: ZINDEX_SSO - 9e6 + 2, withinPortal: true, styles: { dropdown: { pointerEvents: 'auto' } }, inputContainer: (children) => {
1651
- return (React__default.createElement(React__default.Fragment, null,
1652
- LoadScript && (React__default.createElement(LoadScript, { googleMapsApiKey: GOOGLE_API_KEY, libraries: libraries, loadingElement: React__default.createElement(React__default.Fragment, null), style: { width: '100%' } })),
1653
- children));
1654
- } }, restProps)));
1655
- };
1656
-
1657
- // You can give context variables any name
1658
- const [LeadFormProvider, useLeadFormContext, useLeadForm] = createFormContext();
1659
- const useLeadFormConfig = ({ listBlockAdded = [], validatingPhoneRef, validatingEmailRef, campaignId, campaign_subot_id = [], userInfo, }) => {
1660
- const { t } = useTranslations();
1661
- const initialValues = useMemo(() => mappingSSOToLead(userInfo), [userInfo === null || userInfo === void 0 ? void 0 : userInfo.id]);
1662
- const validateObj = useMemo(() => {
1663
- const InputBlocks = [
1664
- 'TextBlock',
1665
- 'NumberBlock',
1666
- 'EmailBlock',
1667
- 'PhoneBlock',
1668
- 'DateBlock',
1669
- 'CheckboxBlock',
1670
- 'RadioBlock',
1671
- 'DropdownBlock',
1672
- 'PhoneOtpBlock',
1673
- 'WhatsappOtpBlock',
1674
- 'ZaloOtpBlock',
1675
- 'LocationBlock',
1676
- 'TncBlock',
1677
- ];
1678
- // ALL are required and can skip if not touched yet
1679
- const withSharedCheck = (name, cb,
1680
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1681
- block) => {
1682
- return (value) => {
1683
- var _a;
1684
- const isBLockRequired = (_a = block === null || block === void 0 ? void 0 : block.data) === null || _a === void 0 ? void 0 : _a.required;
1685
- if (!formRef.current.isTouched(name))
1686
- return;
1687
- if ((typeof value === 'string' && value.replace(' ', '') === '') ||
1688
- typeof value === 'undefined' ||
1689
- value === '' ||
1690
- (Array.isArray(value) && value.length === 0)) {
1691
- return isBLockRequired
1692
- ? t('validator.required')
1693
- : cb === null || cb === void 0 ? void 0 : cb(value);
1694
- }
1695
- return cb === null || cb === void 0 ? void 0 : cb(value);
1696
- };
1697
- };
1698
- return listBlockAdded
1699
- .filter((b) => InputBlocks.includes(b.name))
1700
- .reduce((r, b) => {
1701
- var _a;
1702
- const isRequired = (_a = b.data.required) !== null && _a !== void 0 ? _a : true;
1703
- if (b.name === 'NumberBlock') {
1704
- return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, (value) => {
1705
- if (value && isNaN(Number(value))) {
1706
- return t('validator.number');
1707
- }
1708
- }, b) });
1709
- }
1710
- else if (b.name === 'EmailBlock') {
1711
- return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, (value) => {
1712
- if (value && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value)) {
1713
- return t('validator.email');
1714
- }
1715
- if (!value)
1716
- return;
1717
- validatingEmailRef.current = true;
1718
- setTimeout(() => {
1719
- formRef.current.setFieldError(b.data.value, 'Validating...');
1720
- checkUsedEmailOrPhoneWithCache(campaignId, campaign_subot_id, {
1721
- email: value,
1722
- })
1723
- .then((tKey) => {
1724
- if (tKey) {
1725
- formRef.current.setFieldError(b.data.value, t(tKey));
1726
- }
1727
- else {
1728
- formRef.current.clearFieldError(b.data.value);
1729
- }
1730
- validatingEmailRef.current = false;
1731
- })
1732
- .catch((e) => {
1733
- console.error(e);
1734
- formRef.current.setFieldError(b.data.value, e.message || 'Something went wrong');
1735
- validatingEmailRef.current = false;
1736
- });
1737
- }, 200);
1738
- }, b) });
1739
- }
1740
- else if (b.name === 'PhoneBlock' ||
1741
- b.name === 'PhoneOtpBlock' ||
1742
- b.name === 'ZaloOtpBlock' ||
1743
- b.name === 'WhatsappOtpBlock') {
1744
- return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, (value) => {
1745
- if (value &&
1746
- window.intlTelInputUtils &&
1747
- !window.intlTelInputUtils.isValidNumber(String(value), LEAD_LOCALE.countryCode)) {
1748
- return t('validator.phone');
1749
- }
1750
- if (!value)
1751
- return;
1752
- validatingPhoneRef.current = true;
1753
- setTimeout(() => {
1754
- formRef.current.setFieldError(b.data.value, 'Validating...');
1755
- if (b.data.singleSubmission) {
1756
- checkUsedPhoneOnlyWithCache(campaignId, value)
1757
- .then((tKey) => {
1758
- if (tKey) {
1759
- formRef.current.setFieldError(b.data.value, t(tKey));
1760
- }
1761
- else {
1762
- formRef.current.clearFieldError(b.data.value);
1763
- }
1764
- validatingPhoneRef.current = false;
1765
- })
1766
- .catch((err) => {
1767
- console.error(err);
1768
- formRef.current.setFieldError(b.data.value, err.message || 'Something went wrong');
1769
- validatingPhoneRef.current = false;
1770
- });
1771
- }
1772
- else {
1773
- checkUsedEmailOrPhoneWithCache(campaignId, campaign_subot_id, {
1774
- phone: value,
1775
- })
1776
- .then((tKey) => {
1777
- if (tKey) {
1778
- formRef.current.setFieldError(b.data.value, t(tKey));
1779
- }
1780
- else {
1781
- formRef.current.clearFieldError(b.data.value);
1782
- }
1783
- validatingPhoneRef.current = false;
1784
- })
1785
- .catch((e) => {
1786
- console.error(e);
1787
- formRef.current.setFieldError(b.data.value, e.message || 'Something went wrong');
1788
- validatingPhoneRef.current = false;
1789
- });
1790
- }
1791
- }, 200);
1792
- }, b) });
1793
- }
1794
- else if (b.name === 'DateBlock') {
1795
- return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, (value) => {
1796
- if (value && isNaN(Date.parse(value))) {
1797
- return t('validator.date');
1798
- }
1799
- }, b) });
1800
- }
1801
- else if (b.name === 'TncBlock') {
1802
- return Object.assign(Object.assign({}, r), { [`TNC-` + b.id]: withSharedCheck('TNC-' + b.id, (value) => {
1803
- if (isRequired && !value) {
1804
- return t('validator.required');
1805
- }
1806
- }, b) });
1807
- }
1808
- else {
1809
- return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, undefined, b) });
1810
- }
1811
- }, {});
1812
- }, [listBlockAdded.map((b) => b.name).join(',')]);
1813
- const form = useLeadForm({
1814
- validateInputOnChange: true,
1815
- clearInputErrorOnChange: true,
1816
- validate: validateObj,
1817
- initialValues,
1818
- });
1819
- const formRef = useRef(form);
1820
- formRef.current = form;
1821
- return { form, validateObj };
1822
- };
1823
-
1824
2797
  const SubtitleBlock = ({ children, align, }) => (React__default.createElement("p", { className: `lead-modal__description ${'le-text-align-' + (align || '')} ${LEAD_CLASS}` }, children));
1825
2798
 
1826
2799
  const cssInputNotShrink = css `
@@ -1991,6 +2964,14 @@ const StyledTextFieldContainer = styled.div `
1991
2964
  }
1992
2965
  }
1993
2966
 
2967
+ &:focus-within {
2968
+ .mantine-Input-wrapper {
2969
+ transition: 0.25s linear border;
2970
+ border-color: ${theme.colors.primary600};
2971
+ box-shadow: 0 0 4px ${theme.colors.primary200};
2972
+ }
2973
+ }
2974
+
1994
2975
  .PhoneInput {
1995
2976
  --phone-select: 75px;
1996
2977
  --phone-input-space-x: 8px;
@@ -2139,11 +3120,13 @@ const TextField = (props) => {
2139
3120
  const $focusEl = $textEl.item($textEl.length - 1);
2140
3121
  if ($focusEl) {
2141
3122
  $focusEl.focus();
2142
- $focusEl.scrollIntoView({
2143
- behavior: 'auto',
2144
- block: 'center',
2145
- inline: 'start',
2146
- });
3123
+ setTimeout(() => {
3124
+ $focusEl.scrollIntoView({
3125
+ behavior: 'auto',
3126
+ block: 'center',
3127
+ inline: 'start',
3128
+ });
3129
+ }, 100);
2147
3130
  }
2148
3131
  }, [shrink]);
2149
3132
  useEffect(() => {
@@ -2160,8 +3143,14 @@ const ChoiceField = (props) => {
2160
3143
  const TitleBlock = ({ children, align, }) => (React__default.createElement("h2", { className: `lead-modal__title ${'le-text-align-' + (align || '')} ${LEAD_CLASS}` }, children));
2161
3144
 
2162
3145
  const LightboxFields = ({ listBlockAdded, popupId, locale, onClose, onOtherSubmit, }) => {
3146
+ const { t } = useTranslations();
2163
3147
  const form = useLeadFormContext();
2164
3148
  const formValues = form.values;
3149
+ const labelTuples = useMemo(() => {
3150
+ return ((ISO_FORMAT === null || ISO_FORMAT === void 0 ? void 0 : ISO_FORMAT[locale]) || ISO_FORMAT['vi-VN']).dateFormat
3151
+ .split('/')
3152
+ .map((key) => { var _a; return t((_a = COMMON_DATE_TRANSLATE_KEY === null || COMMON_DATE_TRANSLATE_KEY === void 0 ? void 0 : COMMON_DATE_TRANSLATE_KEY[key]) === null || _a === void 0 ? void 0 : _a.id); });
3153
+ }, [locale]);
2165
3154
  return (React__default.createElement(React__default.Fragment, null, listBlockAdded.map((b, index) => {
2166
3155
  var _a;
2167
3156
  const { name = '', data = {}, id } = b || {};
@@ -2211,13 +3200,11 @@ const LightboxFields = ({ listBlockAdded, popupId, locale, onClose, onOtherSubmi
2211
3200
  return (React__default.createElement(TextField, { key: index, shrink: !!formValue, className: "lead-modal__form-control leadgen-form_field" },
2212
3201
  React__default.createElement(GoogleLocationBlock, Object.assign({ withAsterisk: required, name: value, placeholder: placeholder, label: placeholder, "data-control": "text", locale: locale, inputWrapperOrder: ['label', 'input', 'description', 'error'] }, form.getInputProps(value)))));
2213
3202
  }
2214
- case 'DateBlock':
2215
- return (React__default.createElement(TextField, { key: index, shrink: !!formValue, className: "lead-modal__form-control leadgen-form_field" },
2216
- React__default.createElement(DatePicker, Object.assign({ clearable: true, withAsterisk: required, type: "default", name: value, placeholder: placeholder, label: placeholder, inputWrapperOrder: ['label', 'input', 'description', 'error'], inputContainer: (children) => {
2217
- return (React__default.createElement(React__default.Fragment, null,
2218
- children,
2219
- React__default.createElement("input", { type: "hidden", "data-control": "date", name: value, value: formValue })));
2220
- } }, form.getInputProps(value)))));
3203
+ case 'DateBlock': {
3204
+ const _c = form.getInputProps(value), { error } = _c, formInputProps = __rest(_c, ["error"]);
3205
+ return (React__default.createElement(Input$1.Wrapper, { key: index, size: "md", withAsterisk: required, label: placeholder, "data-invalid": !!error, inputWrapperOrder: ['label', 'input', 'description', 'error'], error: error, className: "lead-modal__form-control leadgen-form_field" },
3206
+ React__default.createElement(InputDate, Object.assign({ name: value, error: Boolean(error), locale: locale, "data-extra": true, "data-name": value, "data-control": "date", className: "leadgen-form_field_date", labelTuples: labelTuples }, formInputProps))));
3207
+ }
2221
3208
  case 'LinkButtonBlock':
2222
3209
  return (React__default.createElement("div", { key: index },
2223
3210
  React__default.createElement("a", { target: newtab ? 'blank' : 'parrent', href: url, style: { textDecoration: 'none' } },
@@ -2260,7 +3247,7 @@ const LightboxFields = ({ listBlockAdded, popupId, locale, onClose, onOtherSubmi
2260
3247
  label: l.placeholder,
2261
3248
  })) }, form.getInputProps(value)))));
2262
3249
  case 'TncBlock':
2263
- const _c = form.getInputProps(`TNC-${id}`), { error } = _c, tncInputProps = __rest(_c, ["error"]);
3250
+ const _d = form.getInputProps(`TNC-${id}`), { error } = _d, tncInputProps = __rest(_d, ["error"]);
2264
3251
  return (React__default.createElement(ChoiceField, { className: "leadgen-form_checkbox", key: id },
2265
3252
  React__default.createElement(Input$1.Wrapper, { error: error },
2266
3253
  React__default.createElement(Checkbox, Object.assign({ name: 'TNC-' + id, label: React__default.createElement("p", { className: "lead-modal__tnc-link", dangerouslySetInnerHTML: { __html: data.valueHTML } }), className: "tnc-block", "data-control": "checkbox" }, tncInputProps)))));
@@ -2510,7 +3497,7 @@ const LEADGEN_SHOW_HEADER = [
2510
3497
  LEADGEN_LAYOUT.Slider,
2511
3498
  ];
2512
3499
  const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSubmit, imageMobile, imageDesktop, imageOverlayMobile, imageOverlayDesktop, imageBackground, currentLayout, title, onSubmit, showThankyou, campaignId, campaign_subot_id, locale, showEmpty, setShowEmpty, userInfo, }) => {
2513
- var _a;
3500
+ var _a, _b;
2514
3501
  const { isMobile } = useScreenSize();
2515
3502
  const [open, setOpen] = useState(!!campaignId);
2516
3503
  const [showOtpPhone, setShowOtpPhone] = useState(null);
@@ -2543,7 +3530,7 @@ const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSub
2543
3530
  const isDrawer = isLightBoxB && isMobile;
2544
3531
  const limitFieldsLightBoxB = isLightBoxB && listBlockAdded.length <= LEADGEN_LIMIT_LIGHTBOXB;
2545
3532
  const hasForm = isLightBoxA
2546
- ? listBlockAdded.some((item) => LEADGEN_BLOCK_IN_FORM.some((k) => k === (item === null || item === void 0 ? void 0 : item.name)))
3533
+ ? listBlockAdded.some((item) => LEADGEN_BLOCK_INPUT.some((k) => k === (item === null || item === void 0 ? void 0 : item.name)))
2547
3534
  : true;
2548
3535
  const headerInsideFormContainer = isSlider || isLightBoxA || isFullscreen;
2549
3536
  const showHeader = !!imageMobile || !!imageDesktop;
@@ -2572,14 +3559,25 @@ const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSub
2572
3559
  campaignId,
2573
3560
  campaign_subot_id,
2574
3561
  userInfo,
3562
+ format: (_a = (ISO_FORMAT[locale] || ISO_FORMAT['vi-VN'])) === null || _a === void 0 ? void 0 : _a.dateFormat,
2575
3563
  });
3564
+ const onFocus = (e) => {
3565
+ const target = e.target;
3566
+ target.scrollIntoView({
3567
+ block: 'center',
3568
+ inline: 'nearest',
3569
+ behavior: 'auto',
3570
+ });
3571
+ };
2576
3572
  const middlewareOnSubmit = (e) => {
2577
3573
  e.preventDefault();
2578
3574
  // mark all as touched to allow validation
2579
- form.setTouched(Object.keys(validateObj).reduce((acc, cur) => {
3575
+ const fields = Object.keys(validateObj);
3576
+ const fieldStatus = fields.reduce((acc, cur) => {
2580
3577
  acc[cur] = true;
2581
3578
  return acc;
2582
- }, {}));
3579
+ }, {});
3580
+ form.setTouched(fieldStatus);
2583
3581
  if (validatingEmailRef.current || validatingPhoneRef.current) {
2584
3582
  return;
2585
3583
  }
@@ -2654,7 +3652,10 @@ const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSub
2654
3652
  const renderAfterImageSizes = imageMobileLoaded &&
2655
3653
  imageDesktopLoaded &&
2656
3654
  (isFullscreen ? imageBackgroundLoaded : true);
2657
- const ButtonSubmit = !((_a = actionBlocks === null || actionBlocks === void 0 ? void 0 : actionBlocks.submitBlock) === null || _a === void 0 ? void 0 : _a.isHide) && (React__default.createElement(Button$2, { size: "lg", id: "lead-submit", type: "submit", variant: "filled", className: "leadgen-btn leadgen-btn_action", loading: isSubmitLoading }, popUpSubmitText));
3655
+ const ButtonSubmit = useMemo(() => {
3656
+ var _a;
3657
+ return !((_a = actionBlocks === null || actionBlocks === void 0 ? void 0 : actionBlocks.submitBlock) === null || _a === void 0 ? void 0 : _a.isHide) && (React__default.createElement(Button$2, { size: "lg", id: "lead-submit", type: "submit", variant: "filled", className: "leadgen-btn leadgen-btn_action", loading: isSubmitLoading }, popUpSubmitText));
3658
+ }, [popUpSubmitText, isSubmitLoading, (_b = actionBlocks === null || actionBlocks === void 0 ? void 0 : actionBlocks.submitBlock) === null || _b === void 0 ? void 0 : _b.isHide]);
2658
3659
  const LinkButtonBlock = listBlockAdded.filter(({ name }) => name == LEADGEN_BLOCK.LinkButtonBlock);
2659
3660
  const ButtonLink = !!(LinkButtonBlock === null || LinkButtonBlock === void 0 ? void 0 : LinkButtonBlock.length) && (React__default.createElement(React__default.Fragment, null, LinkButtonBlock.map((item, index) => {
2660
3661
  var _a, _b, _c;
@@ -2668,7 +3669,7 @@ const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSub
2668
3669
  React__default.createElement(HeaderImage, { src: imageMobile, className: "le-only-mobile lead-modal__image" })))));
2669
3670
  const PopupEmpty = showEmpty && (React__default.createElement(EmptyComponent, { onClose: onClose, onContinue: () => setShowEmpty(false) }));
2670
3671
  const PopupForm = (React__default.createElement(LeadFormProvider, { form: form },
2671
- React__default.createElement("form", { ref: formRef, className: "leadgen-form", onSubmit: middlewareOnSubmit },
3672
+ React__default.createElement("form", { ref: formRef, className: "leadgen-form", onFocus: onFocus, onSubmit: middlewareOnSubmit },
2672
3673
  React__default.createElement(FormContainer, { title: title, titleAlign: titleAlign, description: description, descriptionAlign: descriptionAlign, header: headerInsideFormContainer && PopupHeader, footer: hasForm ? ButtonSubmit : ButtonLink, "data-hidden-form": !hasForm },
2673
3674
  React__default.createElement("div", { className: "leadgen-form_inner" },
2674
3675
  React__default.createElement(LightboxFields, { listBlockAdded: listBlockAdded, popupId: popupId, locale: locale, onClose: onClose, onOtherSubmit: onOtherSubmit }))))));
@@ -3587,4 +4588,4 @@ LeadGen.Thankyou = Thankyou;
3587
4588
  LeadGen.OtpForm = OtpBlock$1;
3588
4589
  LeadGen.Close = Close;
3589
4590
 
3590
- export { LeadGen };
4591
+ export { LeadGen, LeadGenSubscriptionBox };