@hhgtech/hhg-components 1.29.362-beta-8 → 1.29.362-beta-9

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 (507) hide show
  1. package/build/{InputDate-ed815e69.js → InputDate-ed7921e3.js} +3 -3
  2. package/build/{LastPeriod-0e925e18.js → LastPeriod-936d44b5.js} +1 -1
  3. package/build/{MobileBottomNavigationIcon-6656eb92.js → MobileBottomNavigationIcon-137c1c16.js} +3 -3
  4. package/build/{Spinner-2e874e47.js → Spinner-81efdcc9.js} +1 -1
  5. package/build/{WhatsApp-71cef7e5.js → WhatsApp-9b152180.js} +1 -1
  6. package/build/adapters.js +19 -19
  7. package/build/atoms.js +48 -48
  8. package/build/babyGrowth.js +83 -83
  9. package/build/cache.js +2 -2
  10. package/build/care.js +17 -17
  11. package/build/careBookingSearchBar.js +14 -14
  12. package/build/careBookingSearchBarV2.js +15 -15
  13. package/build/components.js +96 -96
  14. package/build/{constants-ec64af5c.js → constants-4aabd47a.js} +1 -1
  15. package/build/constants.js +3 -3
  16. package/build/constantsDomainLocales.js +1 -1
  17. package/build/constantsRiskScreener.js +2 -2
  18. package/build/constantsSite.js +2 -2
  19. package/build/{core-e2cab4f2.js → core-2eda8b78.js} +1 -1
  20. package/build/{dataTransform-d62e7bd6.js → dataTransform-be9e82e8.js} +1 -1
  21. package/build/ecom.js +4 -4
  22. package/build/{editor-40fa527a.js → editor-38627d15.js} +11 -11
  23. package/build/embeddedHeathToolCards_babyGrowth.js +23 -23
  24. package/build/embeddedHeathToolCards_babyPoop.js +19 -19
  25. package/build/embeddedHeathToolCards_babyVaccine.js +22 -22
  26. package/build/embeddedHeathToolCards_bmi_bmi.js +25 -25
  27. package/build/embeddedHeathToolCards_bmrBmr.js +25 -25
  28. package/build/embeddedHeathToolCards_dueDate_dueDate.js +22 -22
  29. package/build/embeddedHeathToolCards_ovulation_ovulation.js +22 -22
  30. package/build/embeddedHeathToolCards_pwg_pwg.js +26 -26
  31. package/build/embeddedHeathToolCards_targetHeartRate.js +27 -27
  32. package/build/esm/{InputDate-0c72b575.js → InputDate-072f7728.js} +3 -3
  33. package/build/esm/{LastPeriod-2dc25d67.js → LastPeriod-3715c174.js} +1 -1
  34. package/build/esm/{MobileBottomNavigationIcon-132bb376.js → MobileBottomNavigationIcon-29b76714.js} +3 -3
  35. package/build/esm/{Spinner-8a284a27.js → Spinner-6fdb59b3.js} +1 -1
  36. package/build/esm/{WhatsApp-cf38d60c.js → WhatsApp-061e59f5.js} +1 -1
  37. package/build/esm/adapters.js +19 -19
  38. package/build/esm/atoms.js +48 -48
  39. package/build/esm/babyGrowth.js +83 -83
  40. package/build/esm/cache.js +2 -2
  41. package/build/esm/care.js +17 -17
  42. package/build/esm/careBookingSearchBar.js +14 -14
  43. package/build/esm/careBookingSearchBarV2.js +15 -15
  44. package/build/esm/components.js +96 -96
  45. package/build/esm/{constants-7c987051.js → constants-80f0ab3e.js} +1 -1
  46. package/build/esm/constants.js +3 -3
  47. package/build/esm/constantsDomainLocales.js +1 -1
  48. package/build/esm/constantsRiskScreener.js +2 -2
  49. package/build/esm/constantsSite.js +2 -2
  50. package/build/esm/{core-13fa163f.js → core-fba06810.js} +1 -1
  51. package/build/esm/{dataTransform-6b6aebe3.js → dataTransform-b1425423.js} +1 -1
  52. package/build/esm/ecom.js +4 -4
  53. package/build/esm/{editor-cfd016aa.js → editor-bb09a20f.js} +11 -11
  54. package/build/esm/embeddedHeathToolCards_babyGrowth.js +23 -23
  55. package/build/esm/embeddedHeathToolCards_babyPoop.js +19 -19
  56. package/build/esm/embeddedHeathToolCards_babyVaccine.js +22 -22
  57. package/build/esm/embeddedHeathToolCards_bmi_bmi.js +25 -25
  58. package/build/esm/embeddedHeathToolCards_bmrBmr.js +25 -25
  59. package/build/esm/embeddedHeathToolCards_dueDate_dueDate.js +22 -22
  60. package/build/esm/embeddedHeathToolCards_ovulation_ovulation.js +22 -22
  61. package/build/esm/embeddedHeathToolCards_pwg_pwg.js +26 -26
  62. package/build/esm/embeddedHeathToolCards_targetHeartRate.js +27 -27
  63. package/build/esm/footer.js +21 -21
  64. package/build/esm/gAssets.js +2 -2
  65. package/build/esm/{healthTools-e03cebcc.js → healthTools-543f33aa.js} +1 -1
  66. package/build/esm/healthToolsCardWrapper.js +18 -18
  67. package/build/esm/healthToolsForm.js +33 -33
  68. package/build/esm/hooks.js +13 -13
  69. package/build/esm/i18n.js +2 -2
  70. package/build/esm/i18nV2.js +2 -2
  71. package/build/esm/{index-baa819d7.js → index-04359180.js} +6 -6
  72. package/build/esm/{index-bbff4c7c.js → index-12f05852.js} +5 -5
  73. package/build/esm/{index-5a9867b1.js → index-1461ac26.js} +32 -32
  74. package/build/esm/{index-68732b1b.js → index-15c1caf0.js} +1 -1
  75. package/build/esm/{index-10d5800e.js → index-163109f0.js} +7 -7
  76. package/build/esm/{index-3b93e008.js → index-17078aa6.js} +4 -4
  77. package/build/esm/{index-e967ea94.js → index-18e12bf2.js} +31 -31
  78. package/build/esm/{index-e15b042f.js → index-19825c11.js} +2 -2
  79. package/build/esm/{index-811f50c4.js → index-1aca6563.js} +2 -2
  80. package/build/esm/{index-b01f63b0.js → index-1ae2d49f.js} +1 -1
  81. package/build/esm/{index-b9f8a7e6.js → index-22712e77.js} +17 -17
  82. package/build/esm/{index-fed32673.js → index-25c4e9a3.js} +13 -13
  83. package/build/esm/{index-2ae580f5.js → index-2c7df8ac.js} +3 -3
  84. package/build/esm/{index-5f1f3f5f.js → index-2e43899a.js} +2 -2
  85. package/build/esm/{index-57194fd1.js → index-2ee7fa41.js} +6 -6
  86. package/build/esm/{index-55ce293c.js → index-39bd1a2e.js} +6 -6
  87. package/build/esm/{index-f5f35249.js → index-3cb4c4db.js} +13 -13
  88. package/build/esm/{index-000520c7.js → index-3f6e0c66.js} +2 -2
  89. package/build/esm/{index-14fe88a8.js → index-3fe6a089.js} +10 -10
  90. package/build/esm/{index-04674fa1.js → index-5257c051.js} +6 -6
  91. package/build/esm/{index-db58dd4b.js → index-57e8887f.js} +1 -1
  92. package/build/esm/{index-cfa5e713.js → index-5ace2cf7.js} +16 -16
  93. package/build/esm/{index-7c22971a.js → index-5ca40c44.js} +1 -1
  94. package/build/esm/{index-ddc34776.js → index-61d8cd5b.js} +6 -6
  95. package/build/esm/{index-b52a02c5.js → index-6281cb90.js} +2 -2
  96. package/build/esm/{index-26e8d911.js → index-64f54f5b.js} +3 -3
  97. package/build/esm/{index-2558c570.js → index-66f22821.js} +21 -21
  98. package/build/esm/{index-fc20b65c.js → index-6b18fc60.js} +24 -24
  99. package/build/esm/{index-be50c797.js → index-71fd886f.js} +2 -2
  100. package/build/esm/{index-b22de55c.js → index-79767a07.js} +3 -3
  101. package/build/esm/{index-44f5e5cf.js → index-7c85702d.js} +2 -2
  102. package/build/esm/{index-82a29730.js → index-7ea65ce2.js} +15 -15
  103. package/build/esm/{index-f7422fbe.js → index-7eaf7161.js} +17 -17
  104. package/build/esm/{index-e66bfe8b.js → index-7eea3504.js} +2 -2
  105. package/build/esm/{index-d726d444.js → index-807d359b.js} +11 -11
  106. package/build/esm/{index-1a616926.js → index-82e120c8.js} +2 -2
  107. package/build/esm/{index-e552116f.js → index-8316c939.js} +32 -32
  108. package/build/esm/{index-d861805b.js → index-85ede26a.js} +3 -3
  109. package/build/esm/{index-9830378f.js → index-9531ddc8.js} +1 -1
  110. package/build/esm/{index-1143f458.js → index-973c9d29.js} +2 -2
  111. package/build/esm/{index-f512a76f.js → index-978dae8b.js} +10 -10
  112. package/build/esm/{index-9d34d99d.js → index-99ccd5be.js} +18 -18
  113. package/build/esm/{index-2bb815c5.js → index-99edc6ab.js} +16 -16
  114. package/build/esm/{index-7fd3d15b.js → index-9c28efae.js} +25 -25
  115. package/build/esm/{index-8ec28ca3.js → index-9c6c885d.js} +7 -7
  116. package/build/esm/{index-f48611da.js → index-9cf03969.js} +2 -2
  117. package/build/esm/{index-4d01e48b.js → index-a876ff83.js} +16 -16
  118. package/build/esm/{index-b04d8adb.js → index-aa8223e5.js} +13 -13
  119. package/build/esm/{index-471a841a.js → index-b4e7973e.js} +16 -16
  120. package/build/esm/{index-d2d014d3.js → index-b644904f.js} +1 -1
  121. package/build/esm/{index-c266e7a6.js → index-beedfca0.js} +3 -3
  122. package/build/esm/{index-82924f86.js → index-bf70ce29.js} +2 -2
  123. package/build/esm/{index-422884df.js → index-ce98b25c.js} +13 -13
  124. package/build/esm/{index-cd1f8612.js → index-d2663949.js} +1 -1
  125. package/build/esm/{index-6dc9d3fa.js → index-ddc5c170.js} +2 -2
  126. package/build/esm/{index-b4c229c1.js → index-e68f040d.js} +18 -18
  127. package/build/esm/{index-704b8298.js → index-f2703eda.js} +17 -17
  128. package/build/esm/{index-b593eb5c.js → index-f4a37052.js} +2 -2
  129. package/build/esm/{index-1ceb06ad.js → index-f5b4965d.js} +17 -17
  130. package/build/esm/{index-79aefe3c.js → index-f5dbca38.js} +22 -22
  131. package/build/esm/{index-58377f2b.js → index-f6e2514f.js} +1 -1
  132. package/build/esm/{index-62203eec.js → index-f7ee723a.js} +5 -5
  133. package/build/esm/{index-9f3ed58a.js → index-f9ce57da.js} +3 -3
  134. package/build/esm/{index-7bcbf42f.js → index-fead23f6.js} +1 -1
  135. package/build/esm/index.js +117 -117
  136. package/build/esm/{labelSorting-850f342c.js → labelSorting-8a08a1a5.js} +4 -4
  137. package/build/esm/lead/helpers.d.ts +1 -51
  138. package/build/esm/lead/index.d.ts +1 -2
  139. package/build/esm/lead/services/index.d.ts +0 -14
  140. package/build/esm/lead.js +303 -1226
  141. package/build/esm/{logoIcon-448886b3.js → logoIcon-49ab70e6.js} +2 -2
  142. package/build/esm/mantine.js +25 -25
  143. package/build/esm/misc.js +17 -17
  144. package/build/esm/miscGetDynamicHealthTool.js +4 -4
  145. package/build/esm/miscGetSocialList.js +8 -8
  146. package/build/esm/miscScreenSizeContext.js +1 -1
  147. package/build/esm/mobileBottomNavigation.js +5 -5
  148. package/build/esm/mobileBottomNavigationIcon.js +5 -5
  149. package/build/esm/molecules.js +73 -73
  150. package/build/esm/moleculesArticleCard.js +6 -6
  151. package/build/esm/moleculesArticleCardV2.js +16 -16
  152. package/build/esm/navigation.js +45 -45
  153. package/build/esm/navigationLogoutPopup.js +9 -9
  154. package/build/esm/navigationProfileButton.js +23 -23
  155. package/build/esm/onboardingV2.js +29 -29
  156. package/build/esm/organisms.js +49 -49
  157. package/build/esm/{post-7e429fcb.js → post-cad6a57e.js} +2 -2
  158. package/build/esm/profileNavigation.js +19 -19
  159. package/build/esm/progressBar.js +1 -1
  160. package/build/esm/pwg.js +22 -22
  161. package/build/esm/ssoV2.js +29 -29
  162. package/build/esm/{store-a629d91c.js → store-e5b1929e.js} +4 -4
  163. package/build/esm/subot.js +46 -42
  164. package/build/esm/surveyOrPremiumBanner.js +32 -32
  165. package/build/esm/surveyQuestionCard.js +10 -10
  166. package/build/esm/{surveyThankyouCard-bb71c6af.js → surveyThankyouCard-52d13658.js} +5 -5
  167. package/build/esm/together.js +55 -55
  168. package/build/esm/togetherApiUtils.js +4 -4
  169. package/build/esm/togetherAtoms.js +30 -30
  170. package/build/esm/togetherComponentGlobalContext.js +4 -4
  171. package/build/esm/togetherMolecules.js +50 -50
  172. package/build/esm/togetherMoleculesCardAuthor.js +28 -28
  173. package/build/esm/togetherMoleculesPostImagePreview.js +11 -11
  174. package/build/esm/togetherMoleculesProfileDetail.js +38 -38
  175. package/build/esm/togetherOrganisms.js +49 -49
  176. package/build/esm/togetherRichTextEditor.js +17 -17
  177. package/build/esm/togetherShareBox.js +10 -10
  178. package/build/esm/{treePopoverMenu-1ffbd0b8.js → treePopoverMenu-d34d9a6c.js} +19 -19
  179. package/build/esm/{types-99a6362e.js → types-29ee1554.js} +2 -2
  180. package/build/esm/types.js +2 -2
  181. package/build/esm/{useCategory-4dfad20e.js → useCategory-35ce742a.js} +5 -5
  182. package/build/esm/{useHealthToolCache-a3910645.js → useHealthToolCache-03737f8f.js} +1 -1
  183. package/build/esm/{useMantineLocale-92d62305.js → useMantineLocale-8089a4f0.js} +6 -6
  184. package/build/esm/{usePlacesAutocomplete-ca4f8ae6.js → usePlacesAutocomplete-8134ba0a.js} +1 -1
  185. package/build/esm/{useScreenSize-fcf1880e.js → useScreenSize-4681ce8d.js} +2 -2
  186. package/build/esm/useTogetherAuthRequiredAction.js +9 -9
  187. package/build/esm/{utils-43a91eb4.js → utils-0acf23f6.js} +4 -4
  188. package/build/esm/{utils-d42c1a54.js → utils-80debbb6.js} +2 -2
  189. package/build/esm/{utils-09119f47.js → utils-8b6b5bf9.js} +2 -2
  190. package/build/esm/{utils-eeed2977.js → utils-c06cb90b.js} +3 -3
  191. package/build/esm/vaccination.js +21 -21
  192. package/build/footer.js +21 -21
  193. package/build/gAssets.js +2 -2
  194. package/build/{healthTools-cc8ec3e2.js → healthTools-951ccadc.js} +1 -1
  195. package/build/healthToolsCardWrapper.js +18 -18
  196. package/build/healthToolsForm.js +33 -33
  197. package/build/hooks.js +13 -13
  198. package/build/i18n.js +1 -1
  199. package/build/i18nV2.js +1 -1
  200. package/build/{index-88f0b514.js → index-012231c0.js} +6 -6
  201. package/build/{index-7e053e4f.js → index-030898d1.js} +22 -22
  202. package/build/{index-6476a831.js → index-03e16604.js} +32 -32
  203. package/build/{index-f5fb2850.js → index-05a7ed61.js} +2 -2
  204. package/build/{index-75dc9b6d.js → index-07e2eef6.js} +13 -13
  205. package/build/{index-92b7a0ad.js → index-0c31f727.js} +1 -1
  206. package/build/{index-f06dcefd.js → index-110cfbd0.js} +2 -2
  207. package/build/{index-896e7124.js → index-13543179.js} +25 -25
  208. package/build/{index-e8aa1fbe.js → index-14e030d1.js} +1 -1
  209. package/build/{index-b9b672e4.js → index-156982e5.js} +18 -18
  210. package/build/{index-b98b75b9.js → index-175dea15.js} +2 -2
  211. package/build/{index-cf6a6344.js → index-189905da.js} +13 -13
  212. package/build/{index-07aaa87c.js → index-24bcd506.js} +17 -17
  213. package/build/{index-fc3523dc.js → index-24f5fe19.js} +6 -6
  214. package/build/{index-d214ffbf.js → index-25b8ae05.js} +1 -1
  215. package/build/{index-5e66be57.js → index-25d67c2b.js} +32 -32
  216. package/build/{index-b1735e47.js → index-2d412dd9.js} +2 -2
  217. package/build/{index-3ddea1a8.js → index-2f07ddf2.js} +3 -3
  218. package/build/{index-2d4248ac.js → index-333597fc.js} +6 -6
  219. package/build/{index-0f865702.js → index-444f7602.js} +31 -31
  220. package/build/{index-69bf99a3.js → index-44c42111.js} +1 -1
  221. package/build/{index-6a7c5038.js → index-47459aca.js} +1 -1
  222. package/build/{index-22f7bd29.js → index-490b42ca.js} +2 -2
  223. package/build/{index-2a4bfbf6.js → index-49b32119.js} +13 -13
  224. package/build/{index-74770d3c.js → index-4a657f60.js} +7 -7
  225. package/build/{index-30873b89.js → index-4af29139.js} +1 -1
  226. package/build/{index-65b346fc.js → index-5ce2a639.js} +17 -17
  227. package/build/{index-bf26c12c.js → index-64516730.js} +1 -1
  228. package/build/{index-406d6d1a.js → index-6a9d73b1.js} +16 -16
  229. package/build/{index-2c90c478.js → index-708a6713.js} +2 -2
  230. package/build/{index-9ee01aba.js → index-75bed57f.js} +10 -10
  231. package/build/{index-8cd37160.js → index-79a8b2df.js} +10 -10
  232. package/build/{index-4753689e.js → index-7c06c51a.js} +3 -3
  233. package/build/{index-bf7c717f.js → index-7c6e4422.js} +5 -5
  234. package/build/{index-0e252273.js → index-83b8d0e4.js} +2 -2
  235. package/build/{index-2b813bf4.js → index-849f7044.js} +1 -1
  236. package/build/{index-3c7ce144.js → index-86d05eab.js} +15 -15
  237. package/build/{index-ab467745.js → index-8c09d72a.js} +16 -16
  238. package/build/{index-64adb34f.js → index-8f913ca7.js} +18 -18
  239. package/build/{index-d92177f4.js → index-9436f6b0.js} +4 -4
  240. package/build/{index-8d8ca341.js → index-96f349a2.js} +2 -2
  241. package/build/{index-1e7cf475.js → index-9729666d.js} +2 -2
  242. package/build/{index-ee8122a6.js → index-9c361cd2.js} +24 -24
  243. package/build/{index-c9fd2346.js → index-a0efdef1.js} +6 -6
  244. package/build/{index-351bcd09.js → index-a85e5574.js} +7 -7
  245. package/build/{index-0c89d671.js → index-b2609f93.js} +11 -11
  246. package/build/{index-063c6179.js → index-b4660279.js} +3 -3
  247. package/build/{index-e5cb07b8.js → index-bab73bde.js} +13 -13
  248. package/build/{index-320b1b1c.js → index-c4355a35.js} +2 -2
  249. package/build/{index-c540b87b.js → index-cc26b9a3.js} +1 -1
  250. package/build/{index-8f23513c.js → index-cd1b8576.js} +6 -6
  251. package/build/{index-b74ea419.js → index-d1f9c355.js} +3 -3
  252. package/build/{index-47d1bf56.js → index-d5dd9a5c.js} +16 -16
  253. package/build/{index-52f9c36f.js → index-d983f880.js} +17 -17
  254. package/build/{index-c18aaa45.js → index-dd9617e1.js} +2 -2
  255. package/build/{index-c67287fb.js → index-de5c1ea9.js} +2 -2
  256. package/build/{index-09af4967.js → index-e2503c51.js} +16 -16
  257. package/build/{index-6eda1ed3.js → index-e282c109.js} +3 -3
  258. package/build/{index-6b79a3d5.js → index-e7c86ffb.js} +3 -3
  259. package/build/{index-0c670ed7.js → index-f133c73f.js} +17 -17
  260. package/build/{index-ebc3b15b.js → index-f2c0ccaa.js} +2 -2
  261. package/build/{index-9c8694cd.js → index-f9e08032.js} +21 -21
  262. package/build/{index-df5932c5.js → index-fa49614b.js} +5 -5
  263. package/build/{index-be2ab020.js → index-fd282012.js} +2 -2
  264. package/build/index.js +117 -117
  265. package/build/{labelSorting-7878e8fb.js → labelSorting-7a243927.js} +4 -4
  266. package/build/lead/helpers.d.ts +1 -51
  267. package/build/lead/index.d.ts +1 -2
  268. package/build/lead/services/index.d.ts +0 -14
  269. package/build/lead.js +303 -1227
  270. package/build/{logoIcon-def5eb91.js → logoIcon-fb4a753d.js} +2 -2
  271. package/build/mantine.js +22 -22
  272. package/build/misc.js +17 -17
  273. package/build/miscGetDynamicHealthTool.js +4 -4
  274. package/build/miscGetSocialList.js +8 -8
  275. package/build/miscScreenSizeContext.js +1 -1
  276. package/build/mobileBottomNavigation.js +5 -5
  277. package/build/mobileBottomNavigationIcon.js +5 -5
  278. package/build/molecules.js +73 -73
  279. package/build/moleculesArticleCard.js +6 -6
  280. package/build/moleculesArticleCardV2.js +16 -16
  281. package/build/navigation.js +45 -45
  282. package/build/navigationLogoutPopup.js +9 -9
  283. package/build/navigationProfileButton.js +23 -23
  284. package/build/onboardingV2.js +28 -28
  285. package/build/organisms.js +49 -49
  286. package/build/{post-486572ec.js → post-4db47c48.js} +2 -2
  287. package/build/profileNavigation.js +19 -19
  288. package/build/progressBar.js +1 -1
  289. package/build/pwg.js +22 -22
  290. package/build/ssoV2.js +27 -27
  291. package/build/{store-5b30b600.js → store-09ba79ae.js} +4 -4
  292. package/build/subot.js +45 -41
  293. package/build/surveyOrPremiumBanner.js +32 -32
  294. package/build/surveyQuestionCard.js +10 -10
  295. package/build/{surveyThankyouCard-e27d73e1.js → surveyThankyouCard-37088085.js} +5 -5
  296. package/build/together.js +55 -55
  297. package/build/togetherApiUtils.js +4 -4
  298. package/build/togetherAtoms.js +30 -30
  299. package/build/togetherComponentGlobalContext.js +4 -4
  300. package/build/togetherMolecules.js +50 -50
  301. package/build/togetherMoleculesCardAuthor.js +28 -28
  302. package/build/togetherMoleculesPostImagePreview.js +11 -11
  303. package/build/togetherMoleculesProfileDetail.js +38 -38
  304. package/build/togetherOrganisms.js +49 -49
  305. package/build/togetherRichTextEditor.js +17 -17
  306. package/build/togetherShareBox.js +10 -10
  307. package/build/{treePopoverMenu-4c2fe441.js → treePopoverMenu-675e6b64.js} +19 -19
  308. package/build/{types-a1acd4dd.js → types-0615a42f.js} +2 -2
  309. package/build/types.js +2 -2
  310. package/build/{useCategory-50062e9e.js → useCategory-33968519.js} +5 -5
  311. package/build/{useHealthToolCache-060b5d7d.js → useHealthToolCache-41f87360.js} +1 -1
  312. package/build/{useMantineLocale-5c517e30.js → useMantineLocale-b2b8456f.js} +6 -6
  313. package/build/{usePlacesAutocomplete-bf93aa2b.js → usePlacesAutocomplete-a70a507c.js} +1 -1
  314. package/build/{useScreenSize-91e41fbf.js → useScreenSize-6c744f22.js} +2 -2
  315. package/build/useTogetherAuthRequiredAction.js +9 -9
  316. package/build/{utils-ec031b53.js → utils-26919fe3.js} +4 -4
  317. package/build/{utils-51cc484b.js → utils-67f8997f.js} +2 -2
  318. package/build/{utils-13998c67.js → utils-a3927db1.js} +2 -2
  319. package/build/{utils-ad28c860.js → utils-dfd8ede1.js} +3 -3
  320. package/build/vaccination.js +21 -21
  321. package/package.json +3 -3
  322. package/build/components/mantine/phoneInput/PhoneInput.d.ts +0 -15
  323. package/build/components/mantine/phoneInput/index.d.ts +0 -1
  324. package/build/esm/components/mantine/phoneInput/PhoneInput.d.ts +0 -15
  325. package/build/esm/components/mantine/phoneInput/index.d.ts +0 -1
  326. package/build/esm/lead/LeadGenForm/LeadGenForm.d.ts +0 -41
  327. package/build/esm/lead/LeadGenForm/LeadGenForm.styled.d.ts +0 -5
  328. package/build/esm/lead/LeadGenForm/LeadGenThankYou.d.ts +0 -20
  329. package/build/esm/lead/LeadGenForm/index.d.ts +0 -1
  330. package/build/esm/lead/LeadGenForm/textField/index.d.ts +0 -13
  331. package/build/esm/lead/LeadGenForm/textField/index.styled.d.ts +0 -11
  332. package/build/esm/lead/LeadGenSubscriptionBox/LeadGenSubscriptionBoxContainer.d.ts +0 -25
  333. package/build/esm/lead/LeadGenSubscriptionBox/LeadGenSubscriptionBoxContext.d.ts +0 -25
  334. package/build/esm/lead/LeadGenSubscriptionBox/LeadGenSubscriptionBoxWrapper.d.ts +0 -30
  335. package/build/esm/lead/LeadGenSubscriptionBox/index.d.ts +0 -1
  336. package/build/lead/LeadGenForm/LeadGenForm.d.ts +0 -41
  337. package/build/lead/LeadGenForm/LeadGenForm.styled.d.ts +0 -5
  338. package/build/lead/LeadGenForm/LeadGenThankYou.d.ts +0 -20
  339. package/build/lead/LeadGenForm/index.d.ts +0 -1
  340. package/build/lead/LeadGenForm/textField/index.d.ts +0 -13
  341. package/build/lead/LeadGenForm/textField/index.styled.d.ts +0 -11
  342. package/build/lead/LeadGenSubscriptionBox/LeadGenSubscriptionBoxContainer.d.ts +0 -25
  343. package/build/lead/LeadGenSubscriptionBox/LeadGenSubscriptionBoxContext.d.ts +0 -25
  344. package/build/lead/LeadGenSubscriptionBox/LeadGenSubscriptionBoxWrapper.d.ts +0 -30
  345. package/build/lead/LeadGenSubscriptionBox/index.d.ts +0 -1
  346. /package/build/{BMI_BOYS.percentile.monthly-4574bde2.js → BMI_BOYS.percentile.monthly-e21bf471.js} +0 -0
  347. /package/build/{BMI_BOYS.percentile.weekly-376636de.js → BMI_BOYS.percentile.weekly-844be72c.js} +0 -0
  348. /package/build/{BMI_BOYS.percentile.yearly-d902537f.js → BMI_BOYS.percentile.yearly-1628dfcb.js} +0 -0
  349. /package/build/{BMI_BOYS.zscore.monthly-8e8361d9.js → BMI_BOYS.zscore.monthly-4dc30031.js} +0 -0
  350. /package/build/{BMI_BOYS.zscore.weekly-334d167a.js → BMI_BOYS.zscore.weekly-12184e3e.js} +0 -0
  351. /package/build/{BMI_BOYS.zscore.yearly-80d209fc.js → BMI_BOYS.zscore.yearly-603df4b4.js} +0 -0
  352. /package/build/{BMI_GIRLS.percentile.monthly-47cb9480.js → BMI_GIRLS.percentile.monthly-23fd6bb8.js} +0 -0
  353. /package/build/{BMI_GIRLS.percentile.weekly-77457e97.js → BMI_GIRLS.percentile.weekly-a4ad7b02.js} +0 -0
  354. /package/build/{BMI_GIRLS.percentile.yearly-917be447.js → BMI_GIRLS.percentile.yearly-c7edde7d.js} +0 -0
  355. /package/build/{BMI_GIRLS.zscore.monthly-89da2e04.js → BMI_GIRLS.zscore.monthly-1191b9ba.js} +0 -0
  356. /package/build/{BMI_GIRLS.zscore.weekly-bac14c29.js → BMI_GIRLS.zscore.weekly-bdb048c0.js} +0 -0
  357. /package/build/{BMI_GIRLS.zscore.yearly-611d673e.js → BMI_GIRLS.zscore.yearly-d4214539.js} +0 -0
  358. /package/build/{ChevronDown-591c6c01.js → ChevronDown-222010c3.js} +0 -0
  359. /package/build/{Close-017f0198.js → Close-375881e5.js} +0 -0
  360. /package/build/{Google-428ef9f0.js → Google-3fce729c.js} +0 -0
  361. /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-b1279c40.js → HEAD CIRCUM_BOYS.percentile.monthly-891bee55.js} +0 -0
  362. /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-ab517f9f.js → HEAD CIRCUM_BOYS.percentile.weekly-236f5055.js} +0 -0
  363. /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-7491ee4a.js → HEAD CIRCUM_BOYS.percentile.yearly-3b2449d4.js} +0 -0
  364. /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-1cb16d5b.js → HEAD CIRCUM_BOYS.zscore.monthly-ff977586.js} +0 -0
  365. /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-c484687e.js → HEAD CIRCUM_BOYS.zscore.weekly-442b9b70.js} +0 -0
  366. /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-584db1b3.js → HEAD CIRCUM_BOYS.zscore.yearly-51595528.js} +0 -0
  367. /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-17d14f65.js → HEAD CIRCUM_GIRLS.percentile.monthly-b06c7829.js} +0 -0
  368. /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-547a1f21.js → HEAD CIRCUM_GIRLS.percentile.weekly-3b2e6bf5.js} +0 -0
  369. /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-16c6281c.js → HEAD CIRCUM_GIRLS.percentile.yearly-8c8976b0.js} +0 -0
  370. /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-50d780c2.js → HEAD CIRCUM_GIRLS.zscore.monthly-e6ea1af5.js} +0 -0
  371. /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-1d000c76.js → HEAD CIRCUM_GIRLS.zscore.weekly-ce88ef80.js} +0 -0
  372. /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-af3fad99.js → HEAD CIRCUM_GIRLS.zscore.yearly-c1d525f8.js} +0 -0
  373. /package/build/{HEIGHT_BOYS.percentile.monthly-4b63d4f9.js → HEIGHT_BOYS.percentile.monthly-1cf99123.js} +0 -0
  374. /package/build/{HEIGHT_BOYS.percentile.weekly-1a931833.js → HEIGHT_BOYS.percentile.weekly-5e005e4c.js} +0 -0
  375. /package/build/{HEIGHT_BOYS.percentile.yearly-90eef67f.js → HEIGHT_BOYS.percentile.yearly-700cf50c.js} +0 -0
  376. /package/build/{HEIGHT_BOYS.zscore.monthly-42f4eb35.js → HEIGHT_BOYS.zscore.monthly-81ddc6df.js} +0 -0
  377. /package/build/{HEIGHT_BOYS.zscore.weekly-64d61ad0.js → HEIGHT_BOYS.zscore.weekly-53c0deff.js} +0 -0
  378. /package/build/{HEIGHT_BOYS.zscore.yearly-a66e2d1a.js → HEIGHT_BOYS.zscore.yearly-adeae0be.js} +0 -0
  379. /package/build/{HEIGHT_GIRLS.percentile.monthly-29626e7b.js → HEIGHT_GIRLS.percentile.monthly-2ccfe634.js} +0 -0
  380. /package/build/{HEIGHT_GIRLS.percentile.weekly-37839bdf.js → HEIGHT_GIRLS.percentile.weekly-f63c7fa9.js} +0 -0
  381. /package/build/{HEIGHT_GIRLS.percentile.yearly-d9bf5fde.js → HEIGHT_GIRLS.percentile.yearly-08df7642.js} +0 -0
  382. /package/build/{HEIGHT_GIRLS.zscore.monthly-94c2de66.js → HEIGHT_GIRLS.zscore.monthly-ab9e56f1.js} +0 -0
  383. /package/build/{HEIGHT_GIRLS.zscore.weekly-06a3c6d9.js → HEIGHT_GIRLS.zscore.weekly-fa44e728.js} +0 -0
  384. /package/build/{HEIGHT_GIRLS.zscore.yearly-edcb96e5.js → HEIGHT_GIRLS.zscore.yearly-22c2611c.js} +0 -0
  385. /package/build/{Locale-d0ae500b.js → Locale-83427e69.js} +0 -0
  386. /package/build/{Visible-a8cd7abb.js → Visible-1836fcb5.js} +0 -0
  387. /package/build/{WEIGHT_BOYS.percentile.monthly-6d2c9ebf.js → WEIGHT_BOYS.percentile.monthly-51177693.js} +0 -0
  388. /package/build/{WEIGHT_BOYS.percentile.weekly-3a89bec4.js → WEIGHT_BOYS.percentile.weekly-683d5004.js} +0 -0
  389. /package/build/{WEIGHT_BOYS.percentile.yearly-7c3d7c6d.js → WEIGHT_BOYS.percentile.yearly-aa12e3a2.js} +0 -0
  390. /package/build/{WEIGHT_BOYS.zscore.monthly-2ee3dcc9.js → WEIGHT_BOYS.zscore.monthly-527d14b4.js} +0 -0
  391. /package/build/{WEIGHT_BOYS.zscore.weekly-c327c6ff.js → WEIGHT_BOYS.zscore.weekly-cab4934f.js} +0 -0
  392. /package/build/{WEIGHT_BOYS.zscore.yearly-fdb16e01.js → WEIGHT_BOYS.zscore.yearly-eca143d6.js} +0 -0
  393. /package/build/{WEIGHT_GIRLS.percentile.monthly-fd46a0db.js → WEIGHT_GIRLS.percentile.monthly-7b1a207b.js} +0 -0
  394. /package/build/{WEIGHT_GIRLS.percentile.weekly-01063408.js → WEIGHT_GIRLS.percentile.weekly-f19a278e.js} +0 -0
  395. /package/build/{WEIGHT_GIRLS.percentile.yearly-49f6c5e0.js → WEIGHT_GIRLS.percentile.yearly-0fe30c63.js} +0 -0
  396. /package/build/{WEIGHT_GIRLS.zscore.monthly-053d9fd7.js → WEIGHT_GIRLS.zscore.monthly-6a836c65.js} +0 -0
  397. /package/build/{WEIGHT_GIRLS.zscore.weekly-875b2bbc.js → WEIGHT_GIRLS.zscore.weekly-21b9aafb.js} +0 -0
  398. /package/build/{WEIGHT_GIRLS.zscore.yearly-55d684c3.js → WEIGHT_GIRLS.zscore.yearly-bc8ef562.js} +0 -0
  399. /package/build/{animation-45a2a965.js → animation-3ade1e75.js} +0 -0
  400. /package/build/{constants-adeff632.js → constants-340f9eb3.js} +0 -0
  401. /package/build/{constants-9fb7b5aa.js → constants-718b0236.js} +0 -0
  402. /package/build/{constants-b2194632.js → constants-7c39d76e.js} +0 -0
  403. /package/build/{dataTransform-c4755036.js → dataTransform-376f6550.js} +0 -0
  404. /package/build/{doctor-02cd37e8.js → doctor-ca697254.js} +0 -0
  405. /package/build/esm/{BMI_BOYS.percentile.monthly-edfac58a.js → BMI_BOYS.percentile.monthly-b259d399.js} +0 -0
  406. /package/build/esm/{BMI_BOYS.percentile.weekly-0673910e.js → BMI_BOYS.percentile.weekly-862e1e2c.js} +0 -0
  407. /package/build/esm/{BMI_BOYS.percentile.yearly-0231c752.js → BMI_BOYS.percentile.yearly-0a066aeb.js} +0 -0
  408. /package/build/esm/{BMI_BOYS.zscore.monthly-616f3b6e.js → BMI_BOYS.zscore.monthly-7b1c6cc7.js} +0 -0
  409. /package/build/esm/{BMI_BOYS.zscore.weekly-b627e271.js → BMI_BOYS.zscore.weekly-66aaa87d.js} +0 -0
  410. /package/build/esm/{BMI_BOYS.zscore.yearly-7eedec1b.js → BMI_BOYS.zscore.yearly-ed889383.js} +0 -0
  411. /package/build/esm/{BMI_GIRLS.percentile.monthly-20516443.js → BMI_GIRLS.percentile.monthly-7d1c9e85.js} +0 -0
  412. /package/build/esm/{BMI_GIRLS.percentile.weekly-60a4d238.js → BMI_GIRLS.percentile.weekly-438d4e14.js} +0 -0
  413. /package/build/esm/{BMI_GIRLS.percentile.yearly-66f2c92d.js → BMI_GIRLS.percentile.yearly-9f0bd73f.js} +0 -0
  414. /package/build/esm/{BMI_GIRLS.zscore.monthly-fb3f5f09.js → BMI_GIRLS.zscore.monthly-54e2f737.js} +0 -0
  415. /package/build/esm/{BMI_GIRLS.zscore.weekly-40a4df1e.js → BMI_GIRLS.zscore.weekly-923eb59a.js} +0 -0
  416. /package/build/esm/{BMI_GIRLS.zscore.yearly-bf498e99.js → BMI_GIRLS.zscore.yearly-259a29e1.js} +0 -0
  417. /package/build/esm/{ChevronDown-aa4fe44c.js → ChevronDown-2bf6d690.js} +0 -0
  418. /package/build/esm/{Close-66566245.js → Close-7777eee7.js} +0 -0
  419. /package/build/esm/{Google-d679c426.js → Google-00c6da40.js} +0 -0
  420. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.monthly-09f37efb.js → HEAD CIRCUM_BOYS.percentile.monthly-d65edc48.js} +0 -0
  421. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.weekly-ee67f3f6.js → HEAD CIRCUM_BOYS.percentile.weekly-80ae446b.js} +0 -0
  422. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.yearly-46986ae2.js → HEAD CIRCUM_BOYS.percentile.yearly-2c3d69af.js} +0 -0
  423. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.monthly-6c9f0ba8.js → HEAD CIRCUM_BOYS.zscore.monthly-406e1ed4.js} +0 -0
  424. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.weekly-9e896d1b.js → HEAD CIRCUM_BOYS.zscore.weekly-deefeda1.js} +0 -0
  425. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.yearly-91c0b53f.js → HEAD CIRCUM_BOYS.zscore.yearly-7b64a8f7.js} +0 -0
  426. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.monthly-2539efcc.js → HEAD CIRCUM_GIRLS.percentile.monthly-c95d6cd4.js} +0 -0
  427. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.weekly-557f3f52.js → HEAD CIRCUM_GIRLS.percentile.weekly-7248e754.js} +0 -0
  428. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.yearly-f26ee32d.js → HEAD CIRCUM_GIRLS.percentile.yearly-81317562.js} +0 -0
  429. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.monthly-59481a15.js → HEAD CIRCUM_GIRLS.zscore.monthly-22703fdb.js} +0 -0
  430. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.weekly-5f7316fc.js → HEAD CIRCUM_GIRLS.zscore.weekly-85cf5634.js} +0 -0
  431. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.yearly-f9c0cbf5.js → HEAD CIRCUM_GIRLS.zscore.yearly-a7b02402.js} +0 -0
  432. /package/build/esm/{HEIGHT_BOYS.percentile.monthly-7490dcfd.js → HEIGHT_BOYS.percentile.monthly-20161ea5.js} +0 -0
  433. /package/build/esm/{HEIGHT_BOYS.percentile.weekly-7e05808b.js → HEIGHT_BOYS.percentile.weekly-0c1ee5e2.js} +0 -0
  434. /package/build/esm/{HEIGHT_BOYS.percentile.yearly-0a2eec9c.js → HEIGHT_BOYS.percentile.yearly-b3bd1a5e.js} +0 -0
  435. /package/build/esm/{HEIGHT_BOYS.zscore.monthly-4b996845.js → HEIGHT_BOYS.zscore.monthly-84357e65.js} +0 -0
  436. /package/build/esm/{HEIGHT_BOYS.zscore.weekly-6dece1b3.js → HEIGHT_BOYS.zscore.weekly-0b3d0d45.js} +0 -0
  437. /package/build/esm/{HEIGHT_BOYS.zscore.yearly-62235bc1.js → HEIGHT_BOYS.zscore.yearly-092355a2.js} +0 -0
  438. /package/build/esm/{HEIGHT_GIRLS.percentile.monthly-59fc6034.js → HEIGHT_GIRLS.percentile.monthly-a92f5b6b.js} +0 -0
  439. /package/build/esm/{HEIGHT_GIRLS.percentile.weekly-f739235f.js → HEIGHT_GIRLS.percentile.weekly-af95cfaf.js} +0 -0
  440. /package/build/esm/{HEIGHT_GIRLS.percentile.yearly-a6b041f2.js → HEIGHT_GIRLS.percentile.yearly-6d313cc8.js} +0 -0
  441. /package/build/esm/{HEIGHT_GIRLS.zscore.monthly-d314a685.js → HEIGHT_GIRLS.zscore.monthly-fa8c2fff.js} +0 -0
  442. /package/build/esm/{HEIGHT_GIRLS.zscore.weekly-08952302.js → HEIGHT_GIRLS.zscore.weekly-e03a954b.js} +0 -0
  443. /package/build/esm/{HEIGHT_GIRLS.zscore.yearly-058a7051.js → HEIGHT_GIRLS.zscore.yearly-74015107.js} +0 -0
  444. /package/build/esm/{Locale-e4426af7.js → Locale-f7e857ca.js} +0 -0
  445. /package/build/esm/{Visible-6eafb32d.js → Visible-40ba379f.js} +0 -0
  446. /package/build/esm/{WEIGHT_BOYS.percentile.monthly-6ac07fb3.js → WEIGHT_BOYS.percentile.monthly-1e3b1109.js} +0 -0
  447. /package/build/esm/{WEIGHT_BOYS.percentile.weekly-92fe1ea5.js → WEIGHT_BOYS.percentile.weekly-1c02c21a.js} +0 -0
  448. /package/build/esm/{WEIGHT_BOYS.percentile.yearly-2fa4e730.js → WEIGHT_BOYS.percentile.yearly-338ac039.js} +0 -0
  449. /package/build/esm/{WEIGHT_BOYS.zscore.monthly-ea7dce1c.js → WEIGHT_BOYS.zscore.monthly-090e330e.js} +0 -0
  450. /package/build/esm/{WEIGHT_BOYS.zscore.weekly-4f22dc35.js → WEIGHT_BOYS.zscore.weekly-336161d9.js} +0 -0
  451. /package/build/esm/{WEIGHT_BOYS.zscore.yearly-aad8c6b9.js → WEIGHT_BOYS.zscore.yearly-a9e1847f.js} +0 -0
  452. /package/build/esm/{WEIGHT_GIRLS.percentile.monthly-3a36616f.js → WEIGHT_GIRLS.percentile.monthly-0b491ff0.js} +0 -0
  453. /package/build/esm/{WEIGHT_GIRLS.percentile.weekly-daeda9a0.js → WEIGHT_GIRLS.percentile.weekly-7c0cad03.js} +0 -0
  454. /package/build/esm/{WEIGHT_GIRLS.percentile.yearly-b08373b3.js → WEIGHT_GIRLS.percentile.yearly-c5a91dbb.js} +0 -0
  455. /package/build/esm/{WEIGHT_GIRLS.zscore.monthly-41a74022.js → WEIGHT_GIRLS.zscore.monthly-475c5cf9.js} +0 -0
  456. /package/build/esm/{WEIGHT_GIRLS.zscore.weekly-44bf9759.js → WEIGHT_GIRLS.zscore.weekly-2fc95c7e.js} +0 -0
  457. /package/build/esm/{WEIGHT_GIRLS.zscore.yearly-ec2e62d5.js → WEIGHT_GIRLS.zscore.yearly-fe120857.js} +0 -0
  458. /package/build/esm/{animation-c7656568.js → animation-ac10a2c3.js} +0 -0
  459. /package/build/esm/{constants-34c6fce0.js → constants-845324ae.js} +0 -0
  460. /package/build/esm/{constants-8fb68445.js → constants-c0913a2b.js} +0 -0
  461. /package/build/esm/{constants-18947394.js → constants-f334b206.js} +0 -0
  462. /package/build/esm/{dataTransform-cb2b1cdf.js → dataTransform-d9b89db6.js} +0 -0
  463. /package/build/esm/{doctor-1952d08b.js → doctor-d6d38f4a.js} +0 -0
  464. /package/build/esm/{index-0efe76fa.js → index-15a6a497.js} +0 -0
  465. /package/build/esm/{index-e08b436a.js → index-5670a545.js} +0 -0
  466. /package/build/esm/{index-1e8b095e.js → index-596bddc7.js} +0 -0
  467. /package/build/esm/{index-7344ec0b.js → index-62cab603.js} +0 -0
  468. /package/build/esm/{index-46cd25fc.js → index-b0b88498.js} +0 -0
  469. /package/build/esm/{index-27a230dc.js → index-b37b0a08.js} +0 -0
  470. /package/build/esm/{index-09e7173d.js → index-c791a367.js} +0 -0
  471. /package/build/esm/{index-16ec52cf.js → index-cd673e10.js} +0 -0
  472. /package/build/esm/{index.styles-ec940ea1.js → index.styles-ccd55f9c.js} +0 -0
  473. /package/build/esm/{localizeNumberFormat-64b40d02.js → localizeNumberFormat-519c73f1.js} +0 -0
  474. /package/build/esm/{normalizeLink-b8cb6cd2.js → normalizeLink-3d1161fe.js} +0 -0
  475. /package/build/esm/{number-f332b46b.js → number-abea4986.js} +0 -0
  476. /package/build/esm/{other-2dbc1309.js → other-a530411a.js} +0 -0
  477. /package/build/esm/{paths-7a9fcbca.js → paths-e136ce4b.js} +0 -0
  478. /package/build/esm/{translationsContext-83438307.js → translationsContext-79df4eb3.js} +0 -0
  479. /package/build/esm/{tslib.es6-f621d9e0.js → tslib.es6-bbcd45f4.js} +0 -0
  480. /package/build/esm/{types-e8e8791c.js → types-ef809cde.js} +0 -0
  481. /package/build/esm/{useIsInit-5c4213d3.js → useIsInit-8c2ed148.js} +0 -0
  482. /package/build/esm/{useOutsideClick-078a8829.js → useOutsideClick-02b20659.js} +0 -0
  483. /package/build/esm/{useScrollbarSize-f95d15d1.js → useScrollbarSize-588f44da.js} +0 -0
  484. /package/build/esm/{useUniqueId-974c0fe0.js → useUniqueId-5c48d35b.js} +0 -0
  485. /package/build/esm/{utils-d8e17ea6.js → utils-bbeadd87.js} +0 -0
  486. /package/build/{index-c60f3be0.js → index-02be1739.js} +0 -0
  487. /package/build/{index-0d914719.js → index-213d644b.js} +0 -0
  488. /package/build/{index-9a4627ab.js → index-31872be9.js} +0 -0
  489. /package/build/{index-af057ce6.js → index-416c7ad4.js} +0 -0
  490. /package/build/{index-b4666df3.js → index-6a2bf58d.js} +0 -0
  491. /package/build/{index-cfdebd4a.js → index-748c8ace.js} +0 -0
  492. /package/build/{index-470f9a5a.js → index-88d33176.js} +0 -0
  493. /package/build/{index-af98e8f7.js → index-b94dbc02.js} +0 -0
  494. /package/build/{index.styles-0f9b69bd.js → index.styles-e1a5b046.js} +0 -0
  495. /package/build/{localizeNumberFormat-b2361d8d.js → localizeNumberFormat-03aef0ba.js} +0 -0
  496. /package/build/{normalizeLink-924b4898.js → normalizeLink-429c492d.js} +0 -0
  497. /package/build/{number-7f7fb60d.js → number-efd222d4.js} +0 -0
  498. /package/build/{other-73c628df.js → other-a0f49391.js} +0 -0
  499. /package/build/{paths-1474d332.js → paths-354ea2c3.js} +0 -0
  500. /package/build/{translationsContext-4732f155.js → translationsContext-e4479e2d.js} +0 -0
  501. /package/build/{tslib.es6-f3ffda09.js → tslib.es6-231073ef.js} +0 -0
  502. /package/build/{types-0dee4492.js → types-18eefd29.js} +0 -0
  503. /package/build/{useIsInit-59dc6297.js → useIsInit-fa5efcbb.js} +0 -0
  504. /package/build/{useOutsideClick-97c19666.js → useOutsideClick-90ac37e4.js} +0 -0
  505. /package/build/{useScrollbarSize-e216fd21.js → useScrollbarSize-2d2c8f4c.js} +0 -0
  506. /package/build/{useUniqueId-48045049.js → useUniqueId-34c70fb4.js} +0 -0
  507. /package/build/{utils-aeae706b.js → utils-81fb64d1.js} +0 -0
package/build/esm/lead.js CHANGED
@@ -1,44 +1,44 @@
1
- import { _ as __rest, a as __awaiter } from './tslib.es6-f621d9e0.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';
1
+ import { _ as __rest, a as __awaiter } from './tslib.es6-bbcd45f4.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';
4
4
  import dayjs from 'dayjs';
5
5
  import debounce from 'lodash/debounce';
6
- import { createFormContext, useForm } from '@mantine/form';
7
- import { u as useTranslations } from './index-db58dd4b.js';
8
- import { T as TranslationsContext } from './translationsContext-83438307.js';
6
+ import { createFormContext } from '@mantine/form';
7
+ import { u as useTranslations } from './index-57e8887f.js';
8
+ import { T as TranslationsContext } from './translationsContext-79df4eb3.js';
9
9
  import { getCookie, setCookie } from './miscCookieHelper.js';
10
- import { b as getWrapperDomWithSelector, a as getPopupWrapperDom } from './utils-d8e17ea6.js';
11
- import { T as Text } from './index-1a616926.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-d726d444.js';
13
- import { D as DatePicker } from './index-baa819d7.js';
14
- import { M as MAPPED_LOCALE } from './utils-09119f47.js';
15
- import { DateInput } from '@mantine/dates';
16
- import { Z as ZINDEX_SSO } from './index-82924f86.js';
17
- import './index-7c22971a.js';
18
- import './index-7344ec0b.js';
19
- import './useMantineLocale-92d62305.js';
20
- import { B as Button$1 } from './index-cd1f8612.js';
21
- import './index.styles-ec940ea1.js';
10
+ import { b as getWrapperDomWithSelector, a as getPopupWrapperDom } from './utils-bbeadd87.js';
11
+ import { T as Text } from './index-82e120c8.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-807d359b.js';
13
+ import { D as DatePicker } from './index-04359180.js';
14
+ import { M as MAPPED_LOCALE } from './utils-8b6b5bf9.js';
15
+ import '@mantine/dates';
16
+ import { Z as ZINDEX_SSO } from './index-bf70ce29.js';
17
+ import './index-5ca40c44.js';
18
+ import './index-62cab603.js';
19
+ import './useMantineLocale-8089a4f0.js';
20
+ import { B as Button$1 } from './index-d2663949.js';
21
+ import './index.styles-ccd55f9c.js';
22
22
  import { useClickOutside } from '@mantine/hooks';
23
- import './other-2dbc1309.js';
24
- import './index-9f3ed58a.js';
25
- import { u as usePlacesAutocomplete, G as GOOGLE_API_KEY } from './usePlacesAutocomplete-ca4f8ae6.js';
26
- import { B as Button } from './index-be50c797.js';
27
- import { H as Heading$1 } from './index-e15b042f.js';
28
- import styled from '@emotion/styled';
23
+ import './other-a530411a.js';
24
+ import './index-f9ce57da.js';
25
+ import { u as usePlacesAutocomplete, G as GOOGLE_API_KEY } from './usePlacesAutocomplete-8134ba0a.js';
26
+ import { B as Button } from './index-71fd886f.js';
27
+ import { H as Heading$1 } from './index-19825c11.js';
29
28
  import { v1 } from 'uuid';
29
+ import { i as isVideo } from './index-cd673e10.js';
30
+ import { D as DrawerComponent } from './index-f4a37052.js';
31
+ import { u as useScreenSize } from './useScreenSize-4681ce8d.js';
32
+ import { createPortal } from 'react-dom';
30
33
  import { css } from '@emotion/react';
34
+ import styled from '@emotion/styled';
31
35
  import { theme } from './miscTheme.js';
32
- import { i as isVideo } from './index-16ec52cf.js';
33
- import { D as DrawerComponent } from './index-b593eb5c.js';
34
- import { u as useScreenSize } from './useScreenSize-fcf1880e.js';
35
- import { createPortal } from 'react-dom';
36
- import { C as Close } from './Close-66566245.js';
36
+ import { C as Close } from './Close-7777eee7.js';
37
37
  import '@hhgtech/icons/other';
38
38
  import '@mantine/carousel';
39
- import './Locale-e4426af7.js';
39
+ import './Locale-f7e857ca.js';
40
40
  import 'classnames';
41
- import './useUniqueId-974c0fe0.js';
41
+ import './useUniqueId-5c48d35b.js';
42
42
  import './constantsSite.js';
43
43
  import '@hhgtech/icons/core';
44
44
  import 'date-fns/locale';
@@ -72,7 +72,7 @@ if (sessionStorage.getItem('insider_object')) {
72
72
  }
73
73
  const docLang = document.documentElement.lang;
74
74
  // TODO: country code
75
- const LEAD_LOCALE_DATA$1 = {
75
+ const LEAD_LOCALE_DATA = {
76
76
  'vi-VN': {
77
77
  popupLang: 'vi',
78
78
  countryCode: 'vn',
@@ -114,7 +114,7 @@ const LEAD_LOCALE_DATA$1 = {
114
114
  countryCodeNumber: 91,
115
115
  },
116
116
  };
117
- const LEAD_LOCALE = LEAD_LOCALE_DATA$1[docLang] || LEAD_LOCALE_DATA$1['vi-VN'];
117
+ const LEAD_LOCALE = LEAD_LOCALE_DATA[docLang] || LEAD_LOCALE_DATA['vi-VN'];
118
118
  function LEAD_RESET_VAR() {
119
119
  // LEAD_CURRENT_URL = location.href.toLowerCase();
120
120
  LEAD_CURRENT_URL =
@@ -135,11 +135,6 @@ const LEAD_TIMEZONE_DATA = {
135
135
  9: 'Asia/Manila', // Philippines / Filipinos Site
136
136
  };
137
137
 
138
- const LEADGEN_ACTIONS = {
139
- SHOW: 'SHOW',
140
- SCROLL: 'SCROLL',
141
- TIME: 'TIME',
142
- };
143
138
  const LEADGEN_LAYOUT = {
144
139
  LightBoxA: 'LightBoxA',
145
140
  LightBoxB: 'LightBoxB',
@@ -169,10 +164,8 @@ const LEADGEN_BLOCK = {
169
164
  DropdownBlock: 'DropdownBlock',
170
165
  CheckboxBlock: 'CheckboxBlock',
171
166
  TncBlock: 'TncBlock',
172
- TitleBlock: 'TitleBlock',
173
- SubtitleBlock: 'SubtitleBlock',
174
167
  };
175
- const LEADGEN_BLOCK_INPUT = [
168
+ const LEADGEN_BLOCK_IN_FORM = [
176
169
  LEADGEN_BLOCK.TextBlock,
177
170
  LEADGEN_BLOCK.NumberBlock,
178
171
  LEADGEN_BLOCK.DateBlock,
@@ -188,48 +181,6 @@ const LEADGEN_BLOCK_INPUT = [
188
181
  LEADGEN_BLOCK.TncBlock,
189
182
  ];
190
183
  const SSO_MAP_LEAD = ['name', 'email', 'birthday', 'phone', 'gender'];
191
- const LEAD_LOCALE_DATA = {
192
- 'vi-VN': {
193
- popupLang: 'vi',
194
- countryCode: 'vn',
195
- countryCodeNumber: 84,
196
- },
197
- 'id-ID': {
198
- popupLang: 'id',
199
- countryCode: 'id',
200
- countryCodeNumber: 62,
201
- },
202
- 'th-TH': {
203
- popupLang: 'th',
204
- countryCode: 'th',
205
- countryCodeNumber: 66,
206
- },
207
- 'ms-MY': {
208
- popupLang: 'ms',
209
- countryCode: 'my',
210
- countryCodeNumber: 60,
211
- },
212
- 'zh-TW': {
213
- popupLang: 'zh',
214
- countryCode: 'tw',
215
- countryCodeNumber: 886,
216
- },
217
- 'km-KH': {
218
- popupLang: 'km',
219
- countryCode: 'kh',
220
- countryCodeNumber: 855,
221
- },
222
- 'my-MM': {
223
- popupLang: 'my',
224
- countryCode: 'mm',
225
- countryCodeNumber: 95,
226
- },
227
- 'hi-IN': {
228
- popupLang: 'hi',
229
- countryCode: 'in',
230
- countryCodeNumber: 91,
231
- },
232
- };
233
184
  const mappingSSOToLead = (userInfoProps) => {
234
185
  var _a, _b;
235
186
  try {
@@ -245,7 +196,7 @@ const mappingSSOToLead = (userInfoProps) => {
245
196
  if (ssoKey === 'birthday') {
246
197
  const dob = dayjs(initValue, 'YYYY-MM-DD', true);
247
198
  if (dob.isValid()) {
248
- user.birthday = dob.toDate();
199
+ user.birthday = dob;
249
200
  }
250
201
  }
251
202
  else if (ssoKey === 'gender') {
@@ -268,46 +219,6 @@ const mappingSSOToLead = (userInfoProps) => {
268
219
  catch (error) {
269
220
  return;
270
221
  }
271
- };
272
- const formatCampaignDetail = (campaign) => {
273
- if (!campaign) {
274
- return {};
275
- }
276
- try {
277
- const { extra_fields, thank_you_image } = campaign || {};
278
- const { textBlocks: exTextBlocks, imageBlocks: exImageBlocks, listBlockAdded: exListBlockAdded, listBlockThankyou: exListBlockThankyou, actionBlocks: exActionBlocks, } = extra_fields;
279
- const textBlocks = JSON.parse(exTextBlocks);
280
- const imageBlocks = JSON.parse(exImageBlocks);
281
- const listBlockAdded = JSON.parse(exListBlockAdded);
282
- const listBlockThankyou = JSON.parse(exListBlockThankyou);
283
- const actionBlocks = JSON.parse(exActionBlocks);
284
- const ThankYouBlock = {
285
- image: { src: thank_you_image },
286
- };
287
- listBlockThankyou.forEach((block) => {
288
- const { name, data } = block || {};
289
- const { value: htmlText, align, newtab, url } = data || {};
290
- switch (name) {
291
- case LEADGEN_BLOCK.TitleBlock: {
292
- ThankYouBlock.title = { htmlText, align };
293
- }
294
- case LEADGEN_BLOCK.SubtitleBlock: {
295
- ThankYouBlock.description = { htmlText, align };
296
- }
297
- case LEADGEN_BLOCK.LinkButtonBlock: {
298
- ThankYouBlock.button = { htmlText, newtab, url };
299
- }
300
- }
301
- });
302
- return Object.assign(Object.assign({}, campaign), { extra_fields: Object.assign(Object.assign({}, extra_fields), { textBlocks,
303
- imageBlocks,
304
- listBlockAdded,
305
- listBlockThankyou,
306
- actionBlocks }), ThankYouBlock });
307
- }
308
- catch (error) {
309
- return {};
310
- }
311
222
  };
312
223
 
313
224
  class Store {
@@ -318,13 +229,6 @@ class Store {
318
229
  }
319
230
  const leadStore = new Store();
320
231
 
321
- const LEADGEN_API_METHOD = {
322
- GET: 'get',
323
- POST: 'POST',
324
- };
325
- const LEADGEN_API_PATH = {
326
- V2_CAMPAIGN: 'api/v2/campaign',
327
- };
328
232
  const leadApi = {
329
233
  call(_a) {
330
234
  var { url, data = undefined } = _a, config = __rest(_a, ["url", "data"]);
@@ -428,39 +332,8 @@ const verifyOtpLead = ({ phone, otp, type, }) => {
428
332
  },
429
333
  });
430
334
  };
431
- const campaignGetByCode = (campaign_code) => {
432
- return leadApi.call({
433
- url: `${LEADGEN_API_PATH.V2_CAMPAIGN}/${campaign_code}`,
434
- method: LEADGEN_API_METHOD.GET,
435
- });
436
- };
437
- const campaignPostLead = ({ data }) => {
438
- return leadApi.call({
439
- url: 'api/v2/subscription-box',
440
- method: LEADGEN_API_METHOD.POST,
441
- data,
442
- });
443
- };
444
- const campaignPostImpression = ({ code, action, title_article, ga_client_id, cookie_id, extra, url, referrer, }) => {
445
- return leadApi.call({
446
- url: `api/campaign/${code}/impression`,
447
- method: LEADGEN_API_METHOD.POST,
448
- data: {
449
- action,
450
- title_article,
451
- cookie_id,
452
- ga_client_id,
453
- url,
454
- extra,
455
- referrer,
456
- },
457
- });
458
- };
459
335
  const Service = {
460
336
  campaignGetById,
461
- campaignGetByCode,
462
- campaignPostLead,
463
- campaignPostImpression,
464
337
  validateEmailOrPhoneOnSubot,
465
338
  validateEmailOrPhoneOnLeadGen,
466
339
  validatePhoneNumberOnLeadGen,
@@ -1462,1065 +1335,66 @@ const getTranslations = (locale) => {
1462
1335
 
1463
1336
  const LeadGenContext = createContext({});
1464
1337
 
1465
- const LeadGenSubscriptionBoxContext = createContext({});
1466
- const LeadGenSubscriptionBoxProvider = (props) => {
1467
- const { campaign_code, apiUrl: apiUrlProps, apiSubotUrl, locale, forceCampaign: forceCampaignProps, children, } = props;
1468
- const [forceCampaign, setForceCampaign] = useState(forceCampaignProps);
1469
- const leadGenSubscriptionBoxValue = useMemo(() => (Object.assign(Object.assign({}, props), { forceCampaign })), [campaign_code, locale, forceCampaign]);
1470
- const translationContextValue = { locale, values: getTranslations(locale) };
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
1471
1343
  useEffect(() => {
1472
- if (forceCampaignProps) {
1473
- setForceCampaign(forceCampaignProps);
1474
- return;
1475
- }
1476
- if (campaign_code) {
1477
- Service.campaignGetByCode(campaign_code).then((res) => {
1478
- const { _data } = res || {};
1479
- const { campaigns } = _data || {};
1480
- setForceCampaign(formatCampaignDetail(campaigns));
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);
1481
1356
  });
1357
+ img.src = src;
1482
1358
  }
1483
- }, [campaign_code]);
1484
- useEffect(() => {
1485
- leadStore.apiLeadUrl = apiUrlProps;
1486
- leadStore.apiSubotUrl = apiSubotUrl;
1487
- return () => {
1488
- setForceCampaign(null);
1489
- };
1490
- }, []);
1491
- if (!forceCampaign || !(forceCampaign === null || forceCampaign === void 0 ? void 0 : forceCampaign.id)) {
1359
+ else {
1360
+ setWidth(16);
1361
+ setHeight(9);
1362
+ setLoaded(true);
1363
+ }
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)
1492
1384
  return null;
1493
- }
1494
- return (React__default.createElement(LeadGenSubscriptionBoxContext.Provider, { value: leadGenSubscriptionBoxValue },
1495
- React__default.createElement(TranslationsContext.Provider, { value: translationContextValue }, children)));
1496
- };
1497
-
1498
- // You can give context variables any name
1499
- const [LeadFormProvider, useLeadFormContext, useLeadForm] = createFormContext();
1500
- const useLeadFormConfig = ({ listBlockAdded = [], validatingPhoneRef, validatingEmailRef, campaignId, campaign_subot_id = [], userInfo, }) => {
1501
- var _a;
1502
- const { t } = useTranslations();
1503
- const initialValues = useMemo(() => mappingSSOToLead(userInfo), [userInfo === null || userInfo === void 0 ? void 0 : userInfo.id]);
1504
- const LEAD_LOCALE = LEAD_LOCALE_DATA[(_a = document === null || document === void 0 ? void 0 : document.documentElement) === null || _a === void 0 ? void 0 : _a.lang] ||
1505
- LEAD_LOCALE_DATA['vi-VN'];
1506
- const validateObj = useMemo(() => {
1507
- const InputBlocks = [
1508
- 'TextBlock',
1509
- 'NumberBlock',
1510
- 'EmailBlock',
1511
- 'PhoneBlock',
1512
- 'DateBlock',
1513
- 'CheckboxBlock',
1514
- 'RadioBlock',
1515
- 'DropdownBlock',
1516
- 'PhoneOtpBlock',
1517
- 'WhatsappOtpBlock',
1518
- 'ZaloOtpBlock',
1519
- 'LocationBlock',
1520
- 'TncBlock',
1521
- ];
1522
- // ALL are required and can skip if not touched yet
1523
- const withSharedCheck = (name, cb,
1524
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1525
- block) => {
1526
- return (value) => {
1527
- var _a;
1528
- const isBLockRequired = (_a = block === null || block === void 0 ? void 0 : block.data) === null || _a === void 0 ? void 0 : _a.required;
1529
- if (!formRef.current.isTouched(name))
1530
- return;
1531
- if ((typeof value === 'string' && value.replace(' ', '') === '') ||
1532
- typeof value === 'undefined' ||
1533
- value === '' ||
1534
- (Array.isArray(value) && value.length === 0)) {
1535
- return isBLockRequired
1536
- ? t('validator.required')
1537
- : cb === null || cb === void 0 ? void 0 : cb(value);
1538
- }
1539
- return cb === null || cb === void 0 ? void 0 : cb(value);
1540
- };
1541
- };
1542
- return listBlockAdded
1543
- .filter((b) => InputBlocks.includes(b.name))
1544
- .reduce((r, b) => {
1545
- var _a;
1546
- const isRequired = (_a = b.data.required) !== null && _a !== void 0 ? _a : true;
1547
- if (b.name === 'NumberBlock') {
1548
- return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, (value) => {
1549
- if (value && isNaN(Number(value))) {
1550
- return t('validator.number');
1551
- }
1552
- }, b) });
1553
- }
1554
- else if (b.name === 'EmailBlock') {
1555
- return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, (value) => {
1556
- if (value && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value)) {
1557
- return t('validator.email');
1558
- }
1559
- if (!value)
1560
- return;
1561
- validatingEmailRef.current = true;
1562
- setTimeout(() => {
1563
- formRef.current.setFieldError(b.data.value, 'Validating...');
1564
- checkUsedEmailOrPhoneWithCache(campaignId, campaign_subot_id, {
1565
- email: value,
1566
- })
1567
- .then((tKey) => {
1568
- if (tKey) {
1569
- formRef.current.setFieldError(b.data.value, t(tKey));
1570
- }
1571
- else {
1572
- formRef.current.clearFieldError(b.data.value);
1573
- }
1574
- validatingEmailRef.current = false;
1575
- })
1576
- .catch((e) => {
1577
- console.error(e);
1578
- formRef.current.setFieldError(b.data.value, e.message || 'Something went wrong');
1579
- validatingEmailRef.current = false;
1580
- });
1581
- }, 200);
1582
- }, b) });
1583
- }
1584
- else if (b.name === 'PhoneBlock' ||
1585
- b.name === 'PhoneOtpBlock' ||
1586
- b.name === 'ZaloOtpBlock' ||
1587
- b.name === 'WhatsappOtpBlock') {
1588
- return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, (value) => {
1589
- if (value &&
1590
- window.intlTelInputUtils &&
1591
- !window.intlTelInputUtils.isValidNumber(String(value), LEAD_LOCALE.countryCode)) {
1592
- return t('validator.phone');
1593
- }
1594
- if (!value)
1595
- return;
1596
- validatingPhoneRef.current = true;
1597
- setTimeout(() => {
1598
- formRef.current.setFieldError(b.data.value, 'Validating...');
1599
- if (b.data.singleSubmission) {
1600
- checkUsedPhoneOnlyWithCache(campaignId, value)
1601
- .then((tKey) => {
1602
- if (tKey) {
1603
- formRef.current.setFieldError(b.data.value, t(tKey));
1604
- }
1605
- else {
1606
- formRef.current.clearFieldError(b.data.value);
1607
- }
1608
- validatingPhoneRef.current = false;
1609
- })
1610
- .catch((err) => {
1611
- console.error(err);
1612
- formRef.current.setFieldError(b.data.value, err.message || 'Something went wrong');
1613
- validatingPhoneRef.current = false;
1614
- });
1615
- }
1616
- else {
1617
- checkUsedEmailOrPhoneWithCache(campaignId, campaign_subot_id, {
1618
- phone: value,
1619
- })
1620
- .then((tKey) => {
1621
- if (tKey) {
1622
- formRef.current.setFieldError(b.data.value, t(tKey));
1623
- }
1624
- else {
1625
- formRef.current.clearFieldError(b.data.value);
1626
- }
1627
- validatingPhoneRef.current = false;
1628
- })
1629
- .catch((e) => {
1630
- console.error(e);
1631
- formRef.current.setFieldError(b.data.value, e.message || 'Something went wrong');
1632
- validatingPhoneRef.current = false;
1633
- });
1634
- }
1635
- }, 200);
1636
- }, b) });
1637
- }
1638
- else if (b.name === 'DateBlock') {
1639
- return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, (value) => {
1640
- if (value && isNaN(Date.parse(value))) {
1641
- return t('validator.date');
1642
- }
1643
- }, b) });
1644
- }
1645
- else if (b.name === 'TncBlock') {
1646
- return Object.assign(Object.assign({}, r), { [`TNC-` + b.id]: withSharedCheck('TNC-' + b.id, (value) => {
1647
- if (isRequired && !value) {
1648
- return t('validator.required');
1649
- }
1650
- }, b) });
1651
- }
1652
- else {
1653
- return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, undefined, b) });
1654
- }
1655
- }, {});
1656
- }, [listBlockAdded.map((b) => b.name).join(',')]);
1657
- const form = useLeadForm({
1658
- validateInputOnChange: true,
1659
- clearInputErrorOnChange: true,
1660
- validate: validateObj,
1661
- initialValues,
1662
- });
1663
- const formRef = useRef(form);
1664
- formRef.current = form;
1665
- return { form, validateObj };
1666
- };
1667
-
1668
- const PhoneInput = forwardRef((props, ref) => {
1669
- 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"]);
1670
- const id = idProps || v1() + name;
1671
- 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 },
1672
- React__default.createElement("div", { className: "mantine-Input-wrapper" },
1673
- 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" })))));
1674
- });
1675
-
1676
- const StyledLeadGenFormInner = styled.div `
1677
- display: flex;
1678
- flex-wrap: wrap;
1679
- gap: 8px;
1680
- .leadgen-form_input {
1681
- width: calc(50% - 4px);
1682
- }
1683
-
1684
- .leadgen-form_input_checkbox {
1685
- width: 100%;
1686
- }
1687
- `;
1688
-
1689
- const cssInputNotShrink$1 = css `
1690
- height: 100% !important;
1691
- min-height: calc(var(--container-height, 56px) * 22 / 56);
1692
- color: ${theme.colors.gray800};
1693
- font-size: var(--input, 16px);
1694
- line-height: calc(var(--container-height, 56px) * 22 / 56);
1695
- border: none !important;
1696
- border-radius: 0 !important;
1697
- outline: none !important;
1698
- box-shadow: none !important;
1699
- padding: 0;
1700
- cursor: pointer;
1701
- opacity: 0;
1702
-
1703
- ::placeholder {
1704
- color: ${theme.colors.gray400};
1705
- }
1706
- `;
1707
- const cssInputShrink$1 = css `
1708
- height: auto !important;
1709
- cursor: text;
1710
- opacity: 1;
1711
- transition: 0.1s ease-in-out all;
1712
- `;
1713
- const cssLabelNotShrink$1 = css `
1714
- position: absolute;
1715
- top: calc(var(--container-height) / 2);
1716
- left: var(--space-x, 16px);
1717
- color: ${theme.colors.gray400};
1718
- font-size: var(--label-not-shrink, 16px);
1719
- font-weight: 400;
1720
- line-height: calc(var(--container-height, 56px) * 18 / 56);
1721
- margin: 0;
1722
- z-index: 1;
1723
- cursor: pointer;
1724
- transform: translateY(-50%);
1725
- transition: 0.125s ease-in all;
1726
- `;
1727
- const cssLabelShrink$1 = css `
1728
- color: ${theme.colors.gray600};
1729
- font-weight: 600;
1730
- font-size: var(--label-shrink, 12px);
1731
- top: calc(var(--container-height) * 7 / 56);
1732
- transform: none;
1733
- transition: 0.125s ease-out all;
1734
- `;
1735
- const cssWrapperInputNotShrink$1 = css `
1736
- min-height: var(--container-height, 56px);
1737
- display: flex;
1738
- align-items: flex-end;
1739
- border: 1px solid ${theme.colors.gray200};
1740
- border-radius: 8px;
1741
- background-color: #fff;
1742
- padding-inline: var(--space-x, 16px);
1743
- padding-block: var(--space-y-not-shrink, 16px);
1744
- cursor: pointer;
1745
- pointer-events: none;
1746
-
1747
- &:has(.mantine-Input-rightSection) {
1748
- padding-right: var(--container-height, 56px);
1749
- }
1750
-
1751
- .mantine-Input-icon {
1752
- display: none;
1753
- }
1754
-
1755
- .mantine-NumberInput-control {
1756
- border-color: ${theme.colors.gray200};
1757
- }
1758
- `;
1759
- const cssWrapperInputShrink$1 = css `
1760
- height: auto;
1761
- min-height: var(--container-height, 56px);
1762
- padding-block: var(--space-y-shrink, 7px);
1763
- cursor: text;
1764
- pointer-events: auto;
1765
- `;
1766
- const cssInputWrapperError$1 = css `
1767
- color: ${theme.colors.red800};
1768
- font-size: 12px;
1769
- line-height: 1.5;
1770
- `;
1771
- const StyledTextFieldContainer$1 = styled.div `
1772
- --space-x: 16px;
1773
- --space-y-not-shrink: 16px;
1774
- --space-y-shrink: 7px;
1775
- --container-height: 56px;
1776
- --label-not-shrink: 16px;
1777
- --label-shrink: 12px;
1778
- --input: 16px;
1779
-
1780
- position: relative;
1781
- min-width: 100px;
1782
- max-width: 100%;
1783
- display: inline-block;
1784
-
1785
- .textField_wrapper {
1786
- display: inline-block;
1787
- width: 100%;
1788
- cursor: pointer;
1789
- }
1790
-
1791
- .mantine-InputWrapper-root {
1792
- &[data-invalid='true'] {
1793
- .mantine-Input-wrapper {
1794
- border-color: ${theme.colors.red400};
1795
- }
1796
- }
1797
-
1798
- .mantine-Input-wrapper {
1799
- &:has([data-invalid]) {
1800
- border-color: ${theme.colors.red400};
1801
- }
1802
- }
1803
- }
1804
-
1805
- .mantine-InputWrapper-label {
1806
- ${cssLabelNotShrink$1}
1807
- }
1808
-
1809
- .mantine-Input-wrapper {
1810
- ${cssWrapperInputNotShrink$1}
1811
-
1812
- + .mantine-Popover-dropdown[data-position="bottom-start"] {
1813
- left: 0 !important;
1814
- }
1815
- + .mantine-Popover-dropdown[data-position='top-start'] {
1816
- top: unset !important;
1817
- left: 0 !important;
1818
- bottom: 100% !important;
1819
- }
1820
- }
1821
-
1822
- .mantine-Input-input {
1823
- ${cssInputNotShrink$1}
1824
- }
1825
-
1826
- &.textField_shrink,
1827
- &:focus-within {
1828
- .mantine-InputWrapper-label {
1829
- ${cssLabelShrink$1}
1830
- }
1831
-
1832
- .mantine-Input-wrapper {
1833
- ${cssWrapperInputShrink$1}
1834
- &.mantine-Select-wrapper {
1835
- .mantine-Select-rightSection {
1836
- pointer-events: auto !important;
1837
- }
1838
- }
1839
- }
1840
-
1841
- .mantine-Input-input {
1842
- ${cssInputShrink$1}
1843
- }
1844
-
1845
- &:has(.PhoneInput) {
1846
- .mantine-InputWrapper-label {
1847
- left: var(--space-x, 16px);
1848
- }
1849
- .PhoneInput {
1850
- .PhoneInputInput {
1851
- opacity: 1;
1852
- }
1853
- }
1854
- }
1855
- }
1856
-
1857
- .PhoneInput {
1858
- --phone-select: 75px;
1859
- --phone-input-space-x: 8px;
1860
- width: 100%;
1861
- opacity: 1;
1862
- border: none;
1863
- .PhoneInputCountry {
1864
- background-color: transparent;
1865
- border: none;
1866
- padding: 0;
1867
- width: var(--phone-select, 75px);
1868
- }
1869
- .PhoneInputInput {
1870
- flex: 1;
1871
- min-width: 0;
1872
- line-height: 1.5;
1873
- outline: none !important;
1874
- border: none;
1875
- box-shadow: none;
1876
- padding: 0 var(--phone-input-space-x, 8px);
1877
- opacity: 0;
1878
- color: ${theme.colors.gray800} !important;
1879
- :focus {
1880
- color: ${theme.colors.gray800} !important;
1881
- }
1882
- }
1883
- }
1884
-
1885
- &:has(.PhoneInput) {
1886
- .mantine-InputWrapper-label {
1887
- left: calc(
1888
- var(--space-x, 16px) + var(--phone-select, 75px) +
1889
- var(--phone-input-space-x, 8px)
1890
- );
1891
- }
1892
- }
1893
- `;
1894
- const StyledChoiceFieldContainer$1 = styled.div `
1895
- &.leadgen-form_checkbox,
1896
- &.leadgen-form_radio {
1897
- width: 100%;
1898
- }
1899
-
1900
- &.leadgen-form_dropdown {
1901
- width: calc(50% - 12px);
1902
- }
1903
-
1904
- .mantine-InputWrapper-root {
1905
- display: block;
1906
- }
1907
-
1908
- .mantine-InputWrapper-label {
1909
- margin-bottom: 0.5rem;
1910
- color: ${theme.colors.gray800};
1911
- font-size: 16px;
1912
- font-weight: 400;
1913
- line-height: 1.5;
1914
- }
1915
-
1916
- .mantine-Radio-root,
1917
- .mantine-Checkbox-root {
1918
- gap: 8px;
1919
- min-width: calc(50% - 4px);
1920
-
1921
- input[type='radio'],
1922
- input[type='checkbox'] {
1923
- border-color: ${theme.colors.gray600};
1924
- width: 18px;
1925
- height: 18px;
1926
- }
1927
- input[type='checkbox'] {
1928
- border-radius: 4px;
1929
- }
1930
-
1931
- &[data-checked='true'] {
1932
- input[type='radio'],
1933
- input[type='checkbox'] {
1934
- border-color: ${theme.colors.primary600};
1935
- + svg {
1936
- color: ${theme.colors.primary600};
1937
- }
1938
- }
1939
-
1940
- input[type='radio'] {
1941
- background-color: white;
1942
- }
1943
- }
1944
-
1945
- .mantine-Checkbox-input {
1946
- &:checked {
1947
- border-color: ${theme.colors.primary600};
1948
- }
1949
- }
1950
- }
1951
-
1952
- .mantine-Radio-inner,
1953
- .mantine-Checkbox-inner {
1954
- width: 24px;
1955
- height: 24px;
1956
- display: flex;
1957
- align-items: center;
1958
- justify-content: center;
1959
- }
1960
-
1961
- .mantine-Radio-body,
1962
- .mantine-Checkbox-body {
1963
- display: flex;
1964
- align-items: center;
1965
- }
1966
-
1967
- .mantine-Radio-label,
1968
- .mantine-Checkbox-label {
1969
- padding-left: 8px;
1970
- color: ${theme.colors.gray800};
1971
- font-size: 14px;
1972
- line-height: 1.4;
1973
- letter-spacing: -0.2px;
1974
- }
1975
-
1976
- .leadgen-choiceContainer {
1977
- display: flex;
1978
- flex-wrap: wrap;
1979
- align-items: flex-start;
1980
- gap: 8px;
1981
- }
1982
-
1983
- .mantine-InputWrapper-error {
1984
- ${cssInputWrapperError$1}
1985
- }
1986
- `;
1987
-
1988
- const TextField$1 = (props) => {
1989
- const { shrink: shrinkProps, onChangeShrink, className, children } = props, restProps = __rest(props, ["shrink", "onChangeShrink", "className", "children"]);
1990
- const containerRef = useClickOutside(() => {
1991
- if (shrinkProps) {
1992
- return;
1993
- }
1994
- setShrink(false);
1995
- onChangeShrink === null || onChangeShrink === void 0 ? void 0 : onChangeShrink(false);
1996
- });
1997
- const [shrink, setShrink] = useState(shrinkProps);
1998
- const onClick = useCallback((e) => {
1999
- setShrink(true);
2000
- onChangeShrink === null || onChangeShrink === void 0 ? void 0 : onChangeShrink(true);
2001
- if (shrink) {
2002
- return;
2003
- }
2004
- const $textEl = e.currentTarget.querySelectorAll('input:not([disabled]):not([type="submit"]),select:not([disabled]),textarea:not([disabled])');
2005
- const $focusEl = $textEl.item($textEl.length - 1);
2006
- if ($focusEl) {
2007
- $focusEl.focus();
2008
- setTimeout(() => {
2009
- $focusEl.scrollIntoView({
2010
- behavior: 'auto',
2011
- block: 'center',
2012
- inline: 'start',
2013
- });
2014
- }, 100);
2015
- }
2016
- }, [shrink]);
2017
- useEffect(() => {
2018
- setShrink(shrinkProps);
2019
- }, [shrinkProps]);
2020
- return (React__default.createElement(StyledTextFieldContainer$1, Object.assign({ shrink: shrink, className: clsx(className, 'textField', { textField_shrink: !!shrink }) }, restProps),
2021
- React__default.createElement("div", { ref: containerRef, onClick: onClick, className: "textField_wrapper" }, children)));
2022
- };
2023
- const ChoiceField$1 = (props) => {
2024
- const { children, className } = props, restProps = __rest(props, ["children", "className"]);
2025
- return (React__default.createElement(StyledChoiceFieldContainer$1, Object.assign({ className: clsx(className, 'choiceField') }, restProps), children));
2026
- };
2027
-
2028
- const libraries = ['places'];
2029
- const GoogleLocationBlock = (props) => {
2030
- var _a;
2031
- const { inputWrapperOrder = ['label', 'input', 'description', 'error'], defaultValue, value: valueProps, onChange: onChangeProps, locale } = props, restProps = __rest(props, ["inputWrapperOrder", "defaultValue", "value", "onChange", "locale"]);
2032
- const [LoadScript, setLoadScript] = useState(null);
2033
- const [value, setValue] = useState(defaultValue || valueProps);
2034
- 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]);
2035
- const onChangeAutocomplete = useCallback((s) => {
2036
- setValue(s);
2037
- onChangeProps === null || onChangeProps === void 0 ? void 0 : onChangeProps(s);
2038
- }, []);
2039
- const onClickItem = useCallback((item) => {
2040
- /** For sure get value */
2041
- setValue(item.value);
2042
- const predCur = predictions === null || predictions === void 0 ? void 0 : predictions.find(({ description }) => description === item.value);
2043
- onChangeProps === null || onChangeProps === void 0 ? void 0 : onChangeProps(item.value, predCur === null || predCur === void 0 ? void 0 : predCur.rawData);
2044
- }, [onChangeProps, predictions]);
2045
- useEffect(() => {
2046
- setValue(valueProps);
2047
- }, [valueProps]);
2048
- useEffect(() => {
2049
- var _a, _b, _c;
2050
- // only load extra google script when not yet loaded
2051
- 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) {
2052
- import('@react-google-maps/api').then((m) => {
2053
- setLoadScript(() => m.LoadScript);
2054
- });
2055
- }
2056
- }, []);
2057
- return (React__default.createElement(Autocomplete, Object.assign({ defaultValue: defaultValue, value: value, onChange: onChangeAutocomplete, data: predictions.map((pred) => {
2058
- return { value: pred.description, label: pred.description };
2059
- }), filter: () => true, onItemSubmit: onClickItem, inputWrapperOrder: inputWrapperOrder, zIndex: ZINDEX_SSO - 9e6 + 2, withinPortal: true, styles: { dropdown: { pointerEvents: 'auto' } }, inputContainer: (children) => {
2060
- return (React__default.createElement(React__default.Fragment, null,
2061
- LoadScript && (React__default.createElement(LoadScript, { googleMapsApiKey: GOOGLE_API_KEY, libraries: libraries, loadingElement: React__default.createElement(React__default.Fragment, null), style: { width: '100%' } })),
2062
- children));
2063
- } }, restProps)));
2064
- };
2065
-
2066
- const LEADGEN_ORDER_INPUT_WRAPPER = [
2067
- 'label',
2068
- 'input',
2069
- 'description',
2070
- 'error',
2071
- ];
2072
- const LeadGenForm = forwardRef((props, ref) => {
2073
- const { locale, blocks, scrollToErrorField = true, form: formProps, rules: validate, initialValues, onFinish, onFinishFailed, className, style, } = props;
2074
- const formRef = useRef(null);
2075
- const form = formProps || useForm({ initialValues, validate });
2076
- const middlewareFinish = (values, event) => {
2077
- onFinish === null || onFinish === void 0 ? void 0 : onFinish(values, event);
2078
- };
2079
- const middlewareFinishFailed = (errors, values, events) => {
2080
- if (scrollToErrorField && errors) {
2081
- const firstErrorKey = Object.keys(errors)[0];
2082
- const firstErrorElement = document.querySelector(`[name="${firstErrorKey}"]`);
2083
- if (firstErrorElement && (firstErrorElement === null || firstErrorElement === void 0 ? void 0 : firstErrorElement.focus)) {
2084
- setTimeout(() => {
2085
- firstErrorElement === null || firstErrorElement === void 0 ? void 0 : firstErrorElement.focus();
2086
- firstErrorElement.scrollIntoView({
2087
- behavior: 'auto',
2088
- block: 'center',
2089
- inline: 'center',
2090
- });
2091
- }, 100);
2092
- }
2093
- }
2094
- onFinishFailed === null || onFinishFailed === void 0 ? void 0 : onFinishFailed(errors, values, events);
2095
- };
2096
- useEffect(() => {
2097
- (() => __awaiter(void 0, void 0, void 0, function* () {
2098
- if (!window.intlTelInputUtils) {
2099
- yield require('intl-tel-input/build/js/utils');
2100
- }
2101
- }))();
2102
- }, []);
2103
- useImperativeHandle(ref, () => (Object.assign(Object.assign({}, form), { submit: () => formRef.current.requestSubmit() })), [form, formRef]);
2104
- if (!blocks || !blocks.length) {
2105
- return null;
2106
- }
2107
- return (React__default.createElement("form", { ref: formRef, onSubmit: form.onSubmit(middlewareFinish, middlewareFinishFailed), className: className, style: style },
2108
- React__default.createElement(StyledLeadGenFormInner, { className: "leadgen-form_inputs" }, blocks.map((block, idx) => {
2109
- const { id, name: blockName, data } = block;
2110
- const { placeholder, value: name, required, listQuestion, valueHTML, isSendMailChimp = false, } = data;
2111
- const formInputProps = form.getInputProps(name);
2112
- const { value, error } = formInputProps;
2113
- const reactKey = `${id}-${idx}`;
2114
- switch (blockName) {
2115
- case LEADGEN_BLOCK.TextBlock: {
2116
- return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
2117
- 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))));
2118
- }
2119
- case LEADGEN_BLOCK.NumberBlock: {
2120
- return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
2121
- 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))));
2122
- }
2123
- case LEADGEN_BLOCK.EmailBlock: {
2124
- return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
2125
- 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))));
2126
- }
2127
- case LEADGEN_BLOCK.PhoneOtpBlock:
2128
- case LEADGEN_BLOCK.WhatsappOtpBlock:
2129
- case LEADGEN_BLOCK.ZaloOtpBlock:
2130
- case LEADGEN_BLOCK.PhoneBlock: {
2131
- return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
2132
- 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))));
2133
- }
2134
- case LEADGEN_BLOCK.LocationBlock: {
2135
- return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
2136
- 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))));
2137
- }
2138
- case LEADGEN_BLOCK.DateBlock: {
2139
- return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
2140
- 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))));
2141
- }
2142
- case LEADGEN_BLOCK.DropdownBlock:
2143
- return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
2144
- React__default.createElement("div", { style: { display: 'none' }, "data-extra": true, "data-name": value, "data-control": 'dropdown' }),
2145
- React__default.createElement(Select$1, Object.assign({ name: name, withAsterisk: required, label: placeholder, placeholder: placeholder, data: listQuestion.map((l) => ({
2146
- value: l.value,
2147
- label: l.placeholder,
2148
- })) }, formInputProps))));
2149
- case LEADGEN_BLOCK.CheckboxBlock: {
2150
- const formInputCheckboxProps = form.getInputProps(name, {
2151
- type: 'checkbox',
2152
- });
2153
- return (React__default.createElement(ChoiceField$1, { className: "leadgen-form_input leadgen-form_input_checkbox", key: reactKey },
2154
- isSendMailChimp && (React__default.createElement("div", { style: { display: 'none' }, "data-name": name + '-mailchimp' })),
2155
- React__default.createElement(Checkbox$1.Group, Object.assign({ size: "md", withAsterisk: required, label: placeholder, value: value, sx: {
2156
- display: 'flex',
2157
- flexDirection: 'column',
2158
- flexWrap: 'wrap',
2159
- gap: 8,
2160
- }, inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, inputContainer: (children) => {
2161
- return (React__default.createElement("div", { className: "leadgen-choiceContainer" }, children));
2162
- } }, formInputCheckboxProps), listQuestion.map((l, _idx) => (React__default.createElement(Checkbox$1, { name: name, key: _idx, value: l.value, label: l.placeholder, "data-control": "checkbox" }))))));
2163
- }
2164
- case LEADGEN_BLOCK.RadioBlock: {
2165
- return (React__default.createElement(ChoiceField$1, { className: "leadgen-form_input leadgen-form_input_checkbox", key: reactKey },
2166
- isSendMailChimp && (React__default.createElement("div", { style: { display: 'none' }, "data-name": name + '-mailchimp' })),
2167
- 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) => {
2168
- return (React__default.createElement("div", { className: "leadgen-choiceContainer" }, children));
2169
- } }, formInputProps), listQuestion.map((l, _index) => (React__default.createElement(Radio$1, { name: name, key: _index, value: l.value, label: l.placeholder, "data-control": "radio" }))))));
2170
- }
2171
- case 'TncBlock':
2172
- return (React__default.createElement(ChoiceField$1, { className: "leadgen-form_input leadgen-form_input_checkbox", key: reactKey },
2173
- React__default.createElement(Input$1.Wrapper, { error: error },
2174
- 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)))));
2175
- default: {
2176
- return null;
2177
- }
2178
- }
2179
- }))));
2180
- });
2181
-
2182
- const StyledLeadGenThankYou = styled.div `
2183
- display: flex;
2184
- gap: 8px;
2185
- flex-direction: column;
2186
- padding-block: 24px;
2187
-
2188
- .leadgen-image {
2189
- width: 120px;
2190
- height: 120px;
2191
- margin-inline: auto;
2192
- object-fit: contain;
2193
- object-position: center;
2194
- text-align: center;
2195
- }
2196
-
2197
- .leadgen-title {
2198
- margin-block: 0;
2199
- color: ${theme.colors.gray900};
2200
- font-weight: 700;
2201
- font-size: 18px;
2202
- line-height: 28px;
2203
- letter-spacing: -0.2px;
2204
- }
2205
-
2206
- .leadgen-description {
2207
- margin-block: 0;
2208
- color: ${theme.colors.gray600};
2209
- font-weight: 400;
2210
- font-size: 14px;
2211
- line-height: 22px;
2212
- letter-spacing: -0.2px;
2213
- text-align: center;
2214
- }
2215
-
2216
- > [data-align] {
2217
- &[data-align='right'] {
2218
- text-align: right;
2219
- }
2220
- &[data-align='center'] {
2221
- text-align: center;
2222
- }
2223
- }
2224
- `;
2225
- const LeadGenThankYou = ({ image, title, description, showButton = false, button, className, style, }) => {
2226
- const { src } = image;
2227
- const { htmlText: titleText, align: titleAlign } = title;
2228
- const { htmlText: descriptionText, align: descriptionAlign } = description;
2229
- const { htmlText: buttonText, newtab, url, onClick } = button;
2230
- return (React__default.createElement(StyledLeadGenThankYou, { className: className, style: style },
2231
- React__default.createElement("img", { src: src, alt: "", className: "leadgen-thankyou_image leadgen-image" }),
2232
- React__default.createElement("p", { className: "leadgen-thankyou_title leadgen-title", "data-align": titleAlign }, titleText),
2233
- React__default.createElement("p", { className: "leadgen-thankyou_description leadgen-description", "data-align": descriptionAlign }, descriptionText),
2234
- !!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))));
2235
- };
2236
-
2237
- const StyledLeadGenSubscriptionBoxBody = styled.div `
2238
- margin-top: 16px;
2239
- .leadgen-btn {
2240
- margin-top: 16px;
2241
- }
2242
- `;
2243
- const StyledLeadGenSubscriptionBoxHeaderImage = styled.div `
2244
- margin-top: 3px;
2245
- margin-right: 20px;
2246
- width: 44px;
2247
- height: 44px;
2248
-
2249
- img {
2250
- width: 100%;
2251
- height: 100%;
2252
- object-fix: contain;
2253
- onject-position: center;
2254
- }
2255
-
2256
- :has(img[src='']) {
2257
- display: none;
2258
- }
2259
- `;
2260
- const StyledLeadGenSubscriptionBoxHeader = styled.div `
2261
- display: flex;
2262
- align-items: center;
2263
- margin-bottom: 16px;
2264
- .leadgen-title {
2265
- margin-bottom: 0;
2266
- flex: 1;
2267
- min-width: 0;
2268
- color: ${theme.colors.gray900};
2269
- font-size: 18px;
2270
- font-weight: 600;
2271
- line-height: 1.4;
2272
- letter-spacing: -0.8px;
2273
- }
2274
- `;
2275
- const StyledLeadGenSubscriptionBox = styled.div `
2276
- padding: 16px;
2277
- border: 1px solid ${theme.colors.neutral100};
2278
- border-radius: 12px;
2279
- margin-inline: auto;
2280
- .leadgen-form_inputs {
2281
- .leadgen-form_input {
2282
- width: 100%;
2283
- }
2284
- }
2285
-
2286
- .leadgen-form_input {
2287
- .mantine-Input-wrapper {
2288
- max-height: 56px;
2289
- }
2290
- }
2291
-
2292
- @media screen and (min-width: 768px) {
2293
- .leadgen-subscription_box_body {
2294
- display: flex;
2295
- > form {
2296
- flex: 1;
2297
- min-width: 0;
2298
-
2299
- .leadgen-form_inputs {
2300
- .leadgen-form_input {
2301
- width: calc(50% - 4px);
2302
- }
2303
- }
2304
- }
2305
-
2306
- .leadgen-btn {
2307
- margin-top: 0;
2308
- margin-left: 8px;
2309
- width: auto;
2310
- min-height: 56px;
2311
- }
2312
- }
2313
- }
2314
- `;
2315
- const LeadGenSubscriptionBoxWithoutMemo = ({ locale, userInfo, siteId, siteDomain, forceCampaign, campaign_code, article_id, subscription_title: subscriptionTitleProps, }) => {
2316
- var _a, _b, _c;
2317
- const refContainer = useRef(null);
2318
- const validatingEmailRef = useRef(false);
2319
- const validatingPhoneRef = useRef(false);
2320
- const { image, extra_fields, id: campaign_id, bot_id: campaign_subot_id = [], ThankYouBlock, } = forceCampaign || {};
2321
- const { textBlocks, listBlockAdded, actionBlocks } = extra_fields || {};
2322
- const { submitBlock } = actionBlocks || {};
2323
- const [loading, setLoading] = useState(false);
2324
- const [showThankyou, setShowThankyou] = useState(false);
2325
- const formRef = useRef(null);
2326
- const { form, validateObj } = useLeadFormConfig({
2327
- listBlockAdded,
2328
- campaignId: campaign_id,
2329
- campaign_subot_id,
2330
- validatingEmailRef,
2331
- validatingPhoneRef,
2332
- userInfo,
2333
- });
2334
- 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]);
2335
- const { image: thankyouImage, title: thankyouTitle, description: thankyouDescription, button: thankyouButton, } = ThankYouBlock || {};
2336
- const { apiUrl } = useMemo(() => {
2337
- let apiUrl = leadStore.apiLeadUrl;
2338
- if (apiUrl.includes('localhost')) {
2339
- apiUrl = 'https://dev.leadgen.hellobacsi.com/';
2340
- }
2341
- return {
2342
- apiUrl,
2343
- };
2344
- }, [siteDomain, siteId]);
2345
- const url = useMemo(() => location.href.toLowerCase() || '', []);
2346
- const article_title = useMemo(() => document.title || '', []);
2347
- const cookie_id = useMemo(() => getCookie('hhg-id') || null, []);
2348
- const ga_client_id = useMemo(() => getCookie('_ga') || null, []);
2349
- const leadgenImpression = useCallback(() => {
2350
- Service.campaignPostImpression({
2351
- url,
2352
- action: LEADGEN_ACTIONS.SCROLL,
2353
- code: campaign_code,
2354
- title_article: article_title,
2355
- cookie_id,
2356
- ga_client_id,
2357
- extra: { cookie_id, article_id, subscription_title },
2358
- });
2359
- }, [
2360
- article_id,
2361
- article_title,
2362
- cookie_id,
2363
- ga_client_id,
2364
- campaign_code,
2365
- subscription_title,
2366
- ]);
2367
- const intersectionObserverCallback = useCallback((entries) => {
2368
- entries.forEach((entry) => {
2369
- const { isIntersecting, target } = entry;
2370
- if (isIntersecting && target === refContainer.current) {
2371
- leadgenImpression();
2372
- }
2373
- });
2374
- }, [leadgenImpression]);
2375
- const IObserver = new IntersectionObserver(intersectionObserverCallback);
2376
- const middlewareOnSubmit = useCallback((value) => __awaiter(void 0, void 0, void 0, function* () {
2377
- const newValue = {
2378
- url,
2379
- article_title,
2380
- cookie_id,
2381
- ga_client_id,
2382
- article_id,
2383
- campaign_id,
2384
- campaign_code,
2385
- subscription_title: subscription_title,
2386
- };
2387
- listBlockAdded.forEach(({ data: { value: k } }) => {
2388
- newValue[k] = value[k];
2389
- });
2390
- setLoading(true);
2391
- try {
2392
- const { _data } = (yield Service.campaignPostLead({ data: newValue })) || {};
2393
- const { model } = _data;
2394
- if (model && model.id) {
2395
- setShowThankyou(true);
2396
- }
2397
- }
2398
- catch (error) {
2399
- console.log('** Error : ', error);
2400
- }
2401
- setLoading(false);
2402
- }), [
2403
- url,
2404
- article_id,
2405
- article_title,
2406
- cookie_id,
2407
- ga_client_id,
2408
- campaign_code,
2409
- subscription_title,
2410
- listBlockAdded,
2411
- ]);
2412
- useEffect(() => {
2413
- if (refContainer.current) {
2414
- IObserver.observe(refContainer.current);
2415
- }
2416
- return () => {
2417
- IObserver.disconnect();
2418
- };
2419
- }, [
2420
- url,
2421
- article_id,
2422
- article_title,
2423
- ga_client_id,
2424
- campaign_id,
2425
- campaign_code,
2426
- subscription_title,
2427
- ]);
2428
- return (React__default.createElement("div", { ref: refContainer },
2429
- React__default.createElement(StyledLeadGenSubscriptionBox, null,
2430
- 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 })),
2431
- !showThankyou && (React__default.createElement(React__default.Fragment, null,
2432
- React__default.createElement(StyledLeadGenSubscriptionBoxHeader, null,
2433
- !!image && (React__default.createElement(StyledLeadGenSubscriptionBoxHeaderImage, null,
2434
- React__default.createElement("img", { src: image, alt: "" }))),
2435
- React__default.createElement("p", { className: "leadgen-title" }, subscription_title)),
2436
- React__default.createElement(StyledLeadGenSubscriptionBoxBody, { className: "leadgen-subscription_box_body" },
2437
- React__default.createElement(LeadGenForm, { ref: formRef, form: form, rules: validateObj, blocks: listBlockAdded, locale: locale, onFinish: middlewareOnSubmit }),
2438
- 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)))))));
2439
- };
2440
- const LeadGenSubscriptionBoxWithMemo = memo(LeadGenSubscriptionBoxWithoutMemo);
2441
-
2442
- const Container = () => {
2443
- const context = useContext(LeadGenSubscriptionBoxContext);
2444
- const {
2445
- // apiUrl: apiUrlProps,
2446
- // apiSubotUrl,
2447
- campaign_code, article_id, subscription_title, locale, siteId, siteDomain, userInfo, forceCampaign, } = context;
2448
- if (!forceCampaign || !(forceCampaign === null || forceCampaign === void 0 ? void 0 : forceCampaign.id)) {
2449
- return null;
2450
- }
2451
- 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 }));
2452
- };
2453
- Container.displayName = 'LeadGenSubscriptionBox';
2454
- const LeadGenSubscriptionBoxContainer = (props) => {
2455
- const { campaign_code } = props;
2456
- if (!campaign_code) {
2457
- return null;
2458
- }
2459
- return (React__default.createElement(LeadGenSubscriptionBoxProvider, Object.assign({}, props),
2460
- React__default.createElement(Container, null)));
2461
- };
2462
- const LeadGenSubscriptionBox = LeadGenSubscriptionBoxContainer;
2463
-
2464
- const useImageSize = (src) => {
2465
- const [width, setWidth] = useState(16);
2466
- const [height, setHeight] = useState(9);
2467
- const [loaded, setLoaded] = useState(false);
2468
- // load src image to get its width and height
2469
- useEffect(() => {
2470
- setLoaded(false);
2471
- if (src) {
2472
- const img = new Image();
2473
- img.addEventListener('load', () => {
2474
- setWidth(img.naturalWidth);
2475
- setHeight(img.naturalHeight);
2476
- setLoaded(true);
2477
- });
2478
- img.addEventListener('error', () => {
2479
- setWidth(16);
2480
- setHeight(9);
2481
- setLoaded(true);
2482
- });
2483
- img.src = src;
2484
- }
2485
- else {
2486
- setWidth(16);
2487
- setHeight(9);
2488
- setLoaded(true);
2489
- }
2490
- }, [src]);
2491
- return {
2492
- loaded,
2493
- width,
2494
- height,
2495
- };
2496
- };
2497
-
2498
- const CloseButton = ({ onClose, containerClassName, svgClassName, }) => (React__default.createElement("button", { onClick: onClose, className: `le-newbuilder-close-button js-modal__close ${containerClassName || ''}` },
2499
- React__default.createElement("svg", { width: "1em", height: "1em", viewBox: "0 0 20 20", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", className: svgClassName },
2500
- 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" }))));
2501
-
2502
- // url: imageBlocks.imageMobile.data.url
2503
- // newTab: imageBlocks.imageMobile.data.newtab
2504
- // imageMobile: campaignShow.image
2505
- // imageDestkop: campaignShow.image_desktop
2506
- const CenterTabLayout = ({ popupId, url, newTab, imageDestkop, imageMobile, onClose, onOtherSubmit, }) => {
2507
- const { width: imageMobileWidth, height: imageMobileHeight, loaded: imageMobileLoaded, } = useImageSize(imageMobile);
2508
- const { width: imageDestkopWidth, height: imageDestkopHeight, loaded: imageDestkopLoaded, } = useImageSize(imageDestkop);
2509
- if (!imageMobileLoaded || !imageDestkopLoaded)
2510
- return null;
2511
- return (React__default.createElement("div", { id: popupId, className: "lead-modal-wrapper", "data-popup-url": location.pathname, "data-popup-type": "center_tab" },
2512
- React__default.createElement("div", { className: "le-center-tab-popup" },
2513
- React__default.createElement("div", { style: { position: 'relative' } },
2514
- React__default.createElement("a", { className: "js-popup-other-submit", href: url, target: newTab ? 'blank' : '_parent', onClick: onOtherSubmit },
2515
- isVideo(imageMobile) ? (React__default.createElement("video", { loop: true, muted: true, autoPlay: true, className: "le-only-mobile" },
2516
- React__default.createElement("source", { src: imageMobile }))) : (React__default.createElement("img", { className: "le-only-mobile", src: imageMobile, style: {
2517
- aspectRatio: `${imageMobileWidth}/${imageMobileHeight}`,
2518
- } })),
2519
- isVideo(imageDestkop) ? (React__default.createElement("video", { loop: true, muted: true, autoPlay: true, className: "le-only-desktop" },
2520
- React__default.createElement("source", { src: imageDestkop }))) : (React__default.createElement("img", { className: "le-only-desktop", src: imageDestkop, style: {
2521
- aspectRatio: `${imageDestkopWidth}/${imageDestkopHeight}`,
2522
- } }))),
2523
- React__default.createElement(CloseButton, { onClose: onClose, containerClassName: "close-button-top-right" })))));
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" })))));
2524
1398
  };
2525
1399
 
2526
1400
  // title: titleText
@@ -2742,6 +1616,211 @@ const EmptyComponent = ({ onClose, onContinue, }) => {
2742
1616
  React__default.createElement(Button$2, { onClick: onContinue, size: "lg", variant: "filled", fullWidth: false, className: "leadgen-btn leadgen-btn_empty_again" }, t('lead.empty.submitAgain')))));
2743
1617
  };
2744
1618
 
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
+
2745
1824
  const SubtitleBlock = ({ children, align, }) => (React__default.createElement("p", { className: `lead-modal__description ${'le-text-align-' + (align || '')} ${LEAD_CLASS}` }, children));
2746
1825
 
2747
1826
  const cssInputNotShrink = css `
@@ -3060,13 +2139,11 @@ const TextField = (props) => {
3060
2139
  const $focusEl = $textEl.item($textEl.length - 1);
3061
2140
  if ($focusEl) {
3062
2141
  $focusEl.focus();
3063
- setTimeout(() => {
3064
- $focusEl.scrollIntoView({
3065
- behavior: 'auto',
3066
- block: 'center',
3067
- inline: 'start',
3068
- });
3069
- }, 100);
2142
+ $focusEl.scrollIntoView({
2143
+ behavior: 'auto',
2144
+ block: 'center',
2145
+ inline: 'start',
2146
+ });
3070
2147
  }
3071
2148
  }, [shrink]);
3072
2149
  useEffect(() => {
@@ -3466,7 +2543,7 @@ const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSub
3466
2543
  const isDrawer = isLightBoxB && isMobile;
3467
2544
  const limitFieldsLightBoxB = isLightBoxB && listBlockAdded.length <= LEADGEN_LIMIT_LIGHTBOXB;
3468
2545
  const hasForm = isLightBoxA
3469
- ? listBlockAdded.some((item) => LEADGEN_BLOCK_INPUT.some((k) => k === (item === null || item === void 0 ? void 0 : item.name)))
2546
+ ? listBlockAdded.some((item) => LEADGEN_BLOCK_IN_FORM.some((k) => k === (item === null || item === void 0 ? void 0 : item.name)))
3470
2547
  : true;
3471
2548
  const headerInsideFormContainer = isSlider || isLightBoxA || isFullscreen;
3472
2549
  const showHeader = !!imageMobile || !!imageDesktop;
@@ -4510,4 +3587,4 @@ LeadGen.Thankyou = Thankyou;
4510
3587
  LeadGen.OtpForm = OtpBlock$1;
4511
3588
  LeadGen.Close = Close;
4512
3589
 
4513
- export { LeadGen, LeadGenSubscriptionBox };
3590
+ export { LeadGen };