@hhgtech/hhg-components 1.29.480 → 1.29.481

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 (501) hide show
  1. package/build/{InputDate-bb0fa11c.js → InputDate-aa02d9a5.js} +5 -5
  2. package/build/{LastPeriod-86f8bbbc.js → LastPeriod-543ccfea.js} +1 -1
  3. package/build/{MobileBottomNavigationIcon-03149057.js → MobileBottomNavigationIcon-7f30516d.js} +3 -3
  4. package/build/{Spinner-54ce5d8d.js → Spinner-4e5067bf.js} +1 -1
  5. package/build/{WhatsApp-a45a19f4.js → WhatsApp-cd094714.js} +1 -1
  6. package/build/adapters.js +20 -20
  7. package/build/atoms.js +50 -50
  8. package/build/babyGrowth.js +86 -86
  9. package/build/cache.js +2 -2
  10. package/build/care.js +18 -18
  11. package/build/careBookingSearchBar.js +14 -14
  12. package/build/careBookingSearchBarV2.js +15 -15
  13. package/build/components.js +104 -104
  14. package/build/{constants-133e3edb.js → constants-ec0ad7eb.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-4d146b99.js → core-4caf0281.js} +1 -1
  20. package/build/{dataTransform-afde04a6.js → dataTransform-4f16bc3b.js} +1 -1
  21. package/build/ecom.js +5 -5
  22. package/build/{editor-60c8d83e.js → editor-99238f87.js} +11 -11
  23. package/build/embeddedHeathToolCards_babyGrowth.js +25 -25
  24. package/build/embeddedHeathToolCards_babyPoop.js +22 -22
  25. package/build/embeddedHeathToolCards_babyVaccine.js +24 -24
  26. package/build/embeddedHeathToolCards_bmi_bmi.js +27 -27
  27. package/build/embeddedHeathToolCards_bmrBmr.js +27 -27
  28. package/build/embeddedHeathToolCards_dueDate_dueDate.js +24 -24
  29. package/build/embeddedHeathToolCards_ovulation_ovulation.js +24 -24
  30. package/build/embeddedHeathToolCards_pwg_pwg.js +28 -28
  31. package/build/embeddedHeathToolCards_targetHeartRate.js +29 -29
  32. package/build/esm/{InputDate-e88ffe97.js → InputDate-a808832c.js} +5 -5
  33. package/build/esm/{LastPeriod-3ba1bf50.js → LastPeriod-7df0e40c.js} +1 -1
  34. package/build/esm/{MobileBottomNavigationIcon-e97b9185.js → MobileBottomNavigationIcon-f9a7b2c5.js} +3 -3
  35. package/build/esm/{Spinner-c67ea1b5.js → Spinner-e1d5632b.js} +1 -1
  36. package/build/esm/{WhatsApp-03e37f8e.js → WhatsApp-b750f3fa.js} +1 -1
  37. package/build/esm/adapters.js +20 -20
  38. package/build/esm/atoms.js +50 -50
  39. package/build/esm/babyGrowth.js +86 -86
  40. package/build/esm/cache.js +2 -2
  41. package/build/esm/care.js +18 -18
  42. package/build/esm/careBookingSearchBar.js +14 -14
  43. package/build/esm/careBookingSearchBarV2.js +15 -15
  44. package/build/esm/components.js +104 -104
  45. package/build/esm/{constants-03bfcb16.js → constants-62fa0540.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-b0b9401f.js → core-61f7753e.js} +1 -1
  51. package/build/esm/{dataTransform-1dd53f32.js → dataTransform-06069b17.js} +1 -1
  52. package/build/esm/ecom.js +5 -5
  53. package/build/esm/{editor-96ef1b99.js → editor-5f33212f.js} +11 -11
  54. package/build/esm/embeddedHeathToolCards_babyGrowth.js +25 -25
  55. package/build/esm/embeddedHeathToolCards_babyPoop.js +22 -22
  56. package/build/esm/embeddedHeathToolCards_babyVaccine.js +24 -24
  57. package/build/esm/embeddedHeathToolCards_bmi_bmi.js +27 -27
  58. package/build/esm/embeddedHeathToolCards_bmrBmr.js +27 -27
  59. package/build/esm/embeddedHeathToolCards_dueDate_dueDate.js +24 -24
  60. package/build/esm/embeddedHeathToolCards_ovulation_ovulation.js +24 -24
  61. package/build/esm/embeddedHeathToolCards_pwg_pwg.js +28 -28
  62. package/build/esm/embeddedHeathToolCards_targetHeartRate.js +29 -29
  63. package/build/esm/footer.js +22 -22
  64. package/build/esm/gAssets.js +2 -2
  65. package/build/esm/{healthTools-a3770d0e.js → healthTools-df7d3d42.js} +1 -1
  66. package/build/esm/healthToolsCardWrapper.js +20 -20
  67. package/build/esm/healthToolsForm.js +35 -35
  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-7518aab0.js → index-032b480f.js} +2 -2
  72. package/build/esm/{index-e378930b.js → index-07238cdd.js} +6 -6
  73. package/build/esm/{index-bd777aa0.js → index-09b790a7.js} +3 -3
  74. package/build/esm/{index-06e91e76.js → index-0c3d2686.js} +4 -4
  75. package/build/esm/{index-a188714a.js → index-1132ec9b.js} +17 -17
  76. package/build/esm/{index-46665936.js → index-146a6ed0.js} +1 -1
  77. package/build/esm/{index-6085a3cf.js → index-14b3401c.js} +22 -22
  78. package/build/esm/{index-1b9ab1aa.js → index-16504c90.js} +26 -26
  79. package/build/esm/{index-ce869cbd.js → index-1e726ac4.js} +2 -2
  80. package/build/esm/{index-c4470578.js → index-1e80c3fb.js} +3 -3
  81. package/build/esm/{index-686bafb8.js → index-1f9403e6.js} +5 -5
  82. package/build/esm/{index-03f39a35.js → index-209091c1.js} +6 -6
  83. package/build/esm/{index-c41b2d8f.js → index-2366ac67.js} +16 -16
  84. package/build/esm/{index-fd704960.js → index-23e88e31.js} +14 -14
  85. package/build/esm/{index-01977476.js → index-257784e5.js} +1 -1
  86. package/build/esm/{index-bf38eaf8.js → index-2893c22f.js} +3 -3
  87. package/build/esm/{index-505b85da.js → index-31186afa.js} +1 -1
  88. package/build/esm/{index-f38aca87.js → index-376fae17.js} +2 -2
  89. package/build/esm/{index-fddc927d.js → index-3a3b322f.js} +3 -3
  90. package/build/esm/{index-1161c0c5.js → index-3e76e93c.js} +2 -2
  91. package/build/esm/{index-4e60d0f7.js → index-48481573.js} +3 -3
  92. package/build/esm/{index-9c27c173.js → index-4b3ad3ae.js} +8 -8
  93. package/build/esm/{index-855008bb.js → index-4bdbfe70.js} +32 -32
  94. package/build/esm/{index-d00dd915.js → index-4d4a9120.js} +3 -3
  95. package/build/esm/{index-22ca7c78.js → index-507ba61a.js} +15 -15
  96. package/build/esm/{index-e52557b4.js → index-57916c0e.js} +2 -2
  97. package/build/esm/{index-c40f11bb.js → index-5996b05c.js} +7 -7
  98. package/build/esm/{index-9eedca28.js → index-59ce3a76.js} +15 -15
  99. package/build/esm/{index-e074d1b4.js → index-59ede64d.js} +21 -21
  100. package/build/esm/{index-ecae60b9.js → index-5e8a6d61.js} +2 -2
  101. package/build/esm/{index-7c65e778.js → index-5f919c50.js} +18 -18
  102. package/build/esm/{index-b3535b32.js → index-69e990a8.js} +32 -32
  103. package/build/esm/{index-ed2c52fa.js → index-6d63d999.js} +8 -8
  104. package/build/esm/{index-25d0e579.js → index-6e6a61c1.js} +2 -2
  105. package/build/esm/{index-960e69f4.js → index-711e22b3.js} +2 -2
  106. package/build/esm/{index-a4881f2c.js → index-7958499c.js} +14 -14
  107. package/build/esm/{index-4fe7364c.js → index-81775e00.js} +18 -18
  108. package/build/esm/{index-c62994ce.js → index-82e7dcdf.js} +4 -4
  109. package/build/esm/{index-06fdec2b.js → index-84cc353f.js} +25 -25
  110. package/build/esm/{index-f0d1d2aa.js → index-85185164.js} +9 -9
  111. package/build/esm/{index-6541dd75.js → index-8be82feb.js} +11 -11
  112. package/build/esm/{index-2989085e.js → index-8c0ef0e7.js} +19 -19
  113. package/build/esm/{index-2ff4c7dc.js → index-8e23d685.js} +2 -2
  114. package/build/esm/{index-b527aa6d.js → index-8e7da2c3.js} +1 -1
  115. package/build/esm/{index-80f83f2b.js → index-8f569603.js} +2 -2
  116. package/build/esm/{index-abc5467c.js → index-933ce739.js} +6 -6
  117. package/build/esm/{index-91c9b4a2.js → index-a36a9447.js} +21 -21
  118. package/build/esm/{index-33cf233c.js → index-a4de248d.js} +2 -2
  119. package/build/esm/{index-9e7d2b43.js → index-a56b42ef.js} +2 -2
  120. package/build/esm/{index-83fcc07f.js → index-a871943b.js} +16 -16
  121. package/build/esm/{index-52fff2aa.js → index-a99d6645.js} +6 -6
  122. package/build/esm/{index-786e3c1e.js → index-b0b19577.js} +30 -30
  123. package/build/esm/{index-3b127bcb.js → index-b81e787f.js} +2 -2
  124. package/build/esm/{index-98f4c80f.js → index-c3a52528.js} +1 -1
  125. package/build/esm/{index-5955ea8f.js → index-c7ebd761.js} +7 -7
  126. package/build/esm/{index-d09629fa.js → index-c8465d3a.js} +3 -3
  127. package/build/esm/{index-f21eaeca.js → index-c945f7e2.js} +3 -3
  128. package/build/esm/{index-43632456.js → index-ca6313b7.js} +1 -1
  129. package/build/esm/{index-746b2ace.js → index-da553b67.js} +13 -13
  130. package/build/esm/{index-7deab8c9.js → index-da888d7e.js} +14 -14
  131. package/build/esm/{index-885d7597.js → index-de4985b4.js} +2 -2
  132. package/build/esm/{index-bd2e8f03.js → index-e0d1553d.js} +14 -14
  133. package/build/esm/{index-8cddb75d.js → index-e1dcea6e.js} +2 -2
  134. package/build/esm/{index-6e3994c4.js → index-e46ed082.js} +3 -3
  135. package/build/esm/{index-42699b97.js → index-e863697a.js} +10 -10
  136. package/build/esm/{index-462e639d.js → index-e8e2e7e2.js} +5 -5
  137. package/build/esm/{index-1912a9fa.js → index-eb104df2.js} +1 -1
  138. package/build/esm/{index-1b1f108f.js → index-f1c71313.js} +13 -13
  139. package/build/esm/{index-511a93fd.js → index-f33317d1.js} +16 -16
  140. package/build/esm/{index-71c5ca68.js → index-f4068f14.js} +16 -16
  141. package/build/esm/{index-d10f3693.js → index-f57b5c1f.js} +2 -2
  142. package/build/esm/{index-72c85322.js → index-fde3116a.js} +2 -2
  143. package/build/esm/index.js +124 -124
  144. package/build/esm/{labelSorting-2737baf9.js → labelSorting-cc033bf5.js} +4 -4
  145. package/build/esm/lead/LeadGenTranslationContext.d.ts +13 -2
  146. package/build/esm/lead/index.d.ts +2 -0
  147. package/build/esm/lead.js +990 -977
  148. package/build/esm/{logoIcon-cbbb99c5.js → logoIcon-1376b9f8.js} +2 -2
  149. package/build/esm/mantine.js +27 -27
  150. package/build/esm/misc.js +19 -19
  151. package/build/esm/miscGetDynamicHealthTool.js +4 -4
  152. package/build/esm/miscGetSocialList.js +8 -8
  153. package/build/esm/miscScreenSizeContext.js +1 -1
  154. package/build/esm/mobileBottomNavigation.js +5 -5
  155. package/build/esm/mobileBottomNavigationIcon.js +5 -5
  156. package/build/esm/molecules.js +78 -78
  157. package/build/esm/moleculesArticleCard.js +6 -6
  158. package/build/esm/moleculesArticleCardV2.js +17 -17
  159. package/build/esm/navigation.js +47 -47
  160. package/build/esm/navigationLogoutPopup.js +11 -11
  161. package/build/esm/navigationProfileButton.js +27 -27
  162. package/build/esm/onboardingV2.js +30 -30
  163. package/build/esm/organisms.js +57 -57
  164. package/build/esm/{post-2d20786e.js → post-8eca589f.js} +2 -2
  165. package/build/esm/profileNavigation.js +20 -20
  166. package/build/esm/progressBar.js +1 -1
  167. package/build/esm/pwg.js +23 -23
  168. package/build/esm/ssoV2.js +31 -31
  169. package/build/esm/{store-80c2fbfb.js → store-0d8b6df6.js} +3 -3
  170. package/build/esm/subot.js +40 -40
  171. package/build/esm/surveyOrPremiumBanner.js +34 -34
  172. package/build/esm/surveyQuestionCard.js +11 -11
  173. package/build/esm/{surveyThankyouCard-a7b669ce.js → surveyThankyouCard-65d1a136.js} +5 -5
  174. package/build/esm/together.js +57 -57
  175. package/build/esm/togetherApiUtils.js +4 -4
  176. package/build/esm/togetherAtoms.js +31 -31
  177. package/build/esm/togetherComponentGlobalContext.js +4 -4
  178. package/build/esm/togetherMolecules.js +52 -52
  179. package/build/esm/togetherMoleculesCardAuthor.js +29 -29
  180. package/build/esm/togetherMoleculesPostImagePreview.js +11 -11
  181. package/build/esm/togetherMoleculesProfileDetail.js +40 -40
  182. package/build/esm/togetherOrganisms.js +51 -51
  183. package/build/esm/togetherRichTextEditor.js +18 -18
  184. package/build/esm/togetherShareBox.js +10 -10
  185. package/build/esm/{translationsProvider-85d42d03.js → translationsProvider-ae869aee.js} +1 -1
  186. package/build/esm/{treePopoverMenu-943f6db6.js → treePopoverMenu-587e898a.js} +19 -19
  187. package/build/esm/types.js +2 -2
  188. package/build/esm/{useHealthToolCache-06ca1caa.js → useHealthToolCache-0a28ec43.js} +1 -1
  189. package/build/esm/{usePhoneValidator-54a9a530.js → usePhoneValidator-40b60db1.js} +5 -5
  190. package/build/esm/{usePlacesAutocomplete-98b165da.js → usePlacesAutocomplete-51e606e2.js} +1 -1
  191. package/build/esm/useTogetherAuthRequiredAction.js +10 -10
  192. package/build/esm/{utils-327034d3.js → utils-0152f899.js} +3 -3
  193. package/build/esm/{utils-559a417a.js → utils-33eee6d7.js} +5 -5
  194. package/build/esm/{utils-1f327927.js → utils-72f73e2c.js} +2 -2
  195. package/build/esm/{utils-226e935e.js → utils-a362ad3e.js} +2 -2
  196. package/build/esm/vaccination.js +22 -22
  197. package/build/footer.js +22 -22
  198. package/build/gAssets.js +2 -2
  199. package/build/{healthTools-66895d0e.js → healthTools-4e928273.js} +1 -1
  200. package/build/healthToolsCardWrapper.js +20 -20
  201. package/build/healthToolsForm.js +35 -35
  202. package/build/hooks.js +13 -13
  203. package/build/i18n.js +2 -2
  204. package/build/i18nV2.js +1 -1
  205. package/build/{index-324fea8d.js → index-00ce34fe.js} +2 -2
  206. package/build/{index-d19ef96f.js → index-039f1cdd.js} +2 -2
  207. package/build/{index-5365034f.js → index-03cd71e0.js} +9 -9
  208. package/build/{index-63ce41d3.js → index-048722ab.js} +3 -3
  209. package/build/{index-9d60eb16.js → index-04c7b02e.js} +19 -19
  210. package/build/{index-c02fde76.js → index-0570f20a.js} +4 -4
  211. package/build/{index-12ef6952.js → index-08ca673f.js} +13 -13
  212. package/build/{index-fc127a31.js → index-0e18bc17.js} +11 -11
  213. package/build/{index-e86a2ad0.js → index-0fa224ce.js} +5 -5
  214. package/build/{index-45b62551.js → index-28cbf6d6.js} +26 -26
  215. package/build/{index-e86206d8.js → index-2937f4a2.js} +2 -2
  216. package/build/{index-cc5f966e.js → index-2b16774c.js} +2 -2
  217. package/build/{index-1c586335.js → index-2ecc215c.js} +6 -6
  218. package/build/{index-a9ac3b43.js → index-2f7adb56.js} +1 -1
  219. package/build/{index-af3a6996.js → index-3148672d.js} +14 -14
  220. package/build/{index-3a63afdf.js → index-32c973eb.js} +6 -6
  221. package/build/{index-11e3d3da.js → index-34a55146.js} +13 -13
  222. package/build/{index-c0f491cf.js → index-366354c9.js} +1 -1
  223. package/build/{index-982914eb.js → index-3d4023fb.js} +2 -2
  224. package/build/{index-39e369df.js → index-3ddcceda.js} +5 -5
  225. package/build/{index-e3c26fca.js → index-4097159b.js} +2 -2
  226. package/build/{index-e7c1d4f4.js → index-4101fdc2.js} +2 -2
  227. package/build/{index-275f5e50.js → index-4183a3a2.js} +3 -3
  228. package/build/{index-d0d9f7e4.js → index-487227c1.js} +3 -3
  229. package/build/{index-ac2dcacd.js → index-4ef9e32d.js} +25 -25
  230. package/build/{index-1e5184e3.js → index-4f881245.js} +3 -3
  231. package/build/{index-9104fcca.js → index-536b962f.js} +1 -1
  232. package/build/{index-8a0d79a5.js → index-594a5310.js} +22 -22
  233. package/build/{index-b118a3e7.js → index-5ab55624.js} +3 -3
  234. package/build/{index-e4c517cf.js → index-5b509361.js} +30 -30
  235. package/build/{index-67431953.js → index-64be8d38.js} +14 -14
  236. package/build/{index-9bc25350.js → index-67dba9e9.js} +2 -2
  237. package/build/{index-1925d463.js → index-68051107.js} +15 -15
  238. package/build/{index-bfce02ba.js → index-69f935ae.js} +2 -2
  239. package/build/{index-7af9f62f.js → index-6c769047.js} +16 -16
  240. package/build/{index-609abe05.js → index-6e4020ea.js} +32 -32
  241. package/build/{index-2d63d735.js → index-6f281db1.js} +17 -17
  242. package/build/{index-86119802.js → index-730a49cd.js} +7 -7
  243. package/build/{index-44c3844f.js → index-787cf506.js} +3 -3
  244. package/build/{index-8746197a.js → index-78d3b311.js} +1 -1
  245. package/build/{index-2bb2e101.js → index-7a8db159.js} +2 -2
  246. package/build/{index-8d9f4413.js → index-7fc51c71.js} +32 -32
  247. package/build/{index-ceaae211.js → index-803e0a7c.js} +21 -21
  248. package/build/{index-8284cf62.js → index-83965296.js} +7 -7
  249. package/build/{index-ab3cd2a8.js → index-8c1779dd.js} +2 -2
  250. package/build/{index-a0ed787f.js → index-8dd7dcd9.js} +2 -2
  251. package/build/{index-712315c9.js → index-970be111.js} +16 -16
  252. package/build/{index-f5ebb62f.js → index-9a36414e.js} +2 -2
  253. package/build/{index-7e37b2c5.js → index-9e41dc44.js} +3 -3
  254. package/build/{index-7d4d8b55.js → index-9ec9f9d4.js} +8 -8
  255. package/build/{index-09bd7856.js → index-a3e73281.js} +16 -16
  256. package/build/{index-74d74a1f.js → index-a44ea4a0.js} +2 -2
  257. package/build/{index-23d3cf2d.js → index-a856b835.js} +1 -1
  258. package/build/{index-2078a328.js → index-ab0d74e9.js} +16 -16
  259. package/build/{index-86442923.js → index-ac4131bc.js} +10 -10
  260. package/build/{index-cf3274d7.js → index-b2ac64db.js} +6 -6
  261. package/build/{index-52b42aed.js → index-b8e1973a.js} +18 -18
  262. package/build/{index-c271c56b.js → index-bb307a67.js} +14 -14
  263. package/build/{index-b150e0c3.js → index-bc6437d1.js} +1 -1
  264. package/build/{index-15148331.js → index-bf2cd97d.js} +3 -3
  265. package/build/{index-43a81947.js → index-c06fecd6.js} +8 -8
  266. package/build/{index-3c5b101f.js → index-cdda0a00.js} +21 -21
  267. package/build/{index-2cb066d9.js → index-dbee5fb8.js} +18 -18
  268. package/build/{index-26e0c17d.js → index-e5cfd8f1.js} +15 -15
  269. package/build/{index-ed151b2b.js → index-eb8ad24a.js} +2 -2
  270. package/build/{index-18b02992.js → index-eb99ce41.js} +2 -2
  271. package/build/{index-a7199906.js → index-ebf45408.js} +14 -14
  272. package/build/{index-ac7d8994.js → index-ef150e32.js} +1 -1
  273. package/build/{index-eb19ca77.js → index-f0e815f1.js} +2 -2
  274. package/build/{index-f821c068.js → index-f3413db7.js} +6 -6
  275. package/build/{index-949e50c8.js → index-f3e6d350.js} +4 -4
  276. package/build/{index-26387ef9.js → index-fe41a2b8.js} +3 -3
  277. package/build/index.js +124 -124
  278. package/build/{labelSorting-b852b321.js → labelSorting-9da05440.js} +4 -4
  279. package/build/lead/LeadGenTranslationContext.d.ts +13 -2
  280. package/build/lead/index.d.ts +2 -0
  281. package/build/lead.js +989 -976
  282. package/build/{logoIcon-35b60fa0.js → logoIcon-17e1116c.js} +2 -2
  283. package/build/mantine.js +25 -25
  284. package/build/misc.js +19 -19
  285. package/build/miscGetDynamicHealthTool.js +4 -4
  286. package/build/miscGetSocialList.js +8 -8
  287. package/build/miscScreenSizeContext.js +1 -1
  288. package/build/mobileBottomNavigation.js +5 -5
  289. package/build/mobileBottomNavigationIcon.js +5 -5
  290. package/build/molecules.js +78 -78
  291. package/build/moleculesArticleCard.js +6 -6
  292. package/build/moleculesArticleCardV2.js +17 -17
  293. package/build/navigation.js +47 -47
  294. package/build/navigationLogoutPopup.js +11 -11
  295. package/build/navigationProfileButton.js +27 -27
  296. package/build/onboardingV2.js +29 -29
  297. package/build/organisms.js +57 -57
  298. package/build/{post-847f4cfd.js → post-0ea1554e.js} +2 -2
  299. package/build/profileNavigation.js +20 -20
  300. package/build/progressBar.js +1 -1
  301. package/build/pwg.js +23 -23
  302. package/build/ssoV2.js +29 -29
  303. package/build/{store-3bacbd42.js → store-6620f22f.js} +3 -3
  304. package/build/subot.js +39 -39
  305. package/build/surveyOrPremiumBanner.js +34 -34
  306. package/build/surveyQuestionCard.js +11 -11
  307. package/build/{surveyThankyouCard-13dbbf9b.js → surveyThankyouCard-8f337e64.js} +5 -5
  308. package/build/together.js +57 -57
  309. package/build/togetherApiUtils.js +4 -4
  310. package/build/togetherAtoms.js +31 -31
  311. package/build/togetherComponentGlobalContext.js +4 -4
  312. package/build/togetherMolecules.js +52 -52
  313. package/build/togetherMoleculesCardAuthor.js +29 -29
  314. package/build/togetherMoleculesPostImagePreview.js +11 -11
  315. package/build/togetherMoleculesProfileDetail.js +40 -40
  316. package/build/togetherOrganisms.js +51 -51
  317. package/build/togetherRichTextEditor.js +18 -18
  318. package/build/togetherShareBox.js +10 -10
  319. package/build/{translationsProvider-c25284a8.js → translationsProvider-1a3f4c69.js} +1 -1
  320. package/build/{treePopoverMenu-c1ae2dc6.js → treePopoverMenu-e4d38f15.js} +19 -19
  321. package/build/types.js +2 -2
  322. package/build/{useHealthToolCache-80908122.js → useHealthToolCache-940bbe7c.js} +1 -1
  323. package/build/{usePhoneValidator-55aede3d.js → usePhoneValidator-44dcc6ba.js} +5 -5
  324. package/build/{usePlacesAutocomplete-bc5cc972.js → usePlacesAutocomplete-6bb93dd8.js} +1 -1
  325. package/build/useTogetherAuthRequiredAction.js +10 -10
  326. package/build/{utils-36e9f414.js → utils-1d11608a.js} +2 -2
  327. package/build/{utils-30f19bbd.js → utils-8b3db262.js} +3 -3
  328. package/build/{utils-9924371b.js → utils-98559d51.js} +2 -2
  329. package/build/{utils-8f774628.js → utils-f888ab19.js} +5 -5
  330. package/build/vaccination.js +22 -22
  331. package/package.json +1 -1
  332. /package/build/{BMI_BOYS.percentile.monthly-25ae6364.js → BMI_BOYS.percentile.monthly-3a992204.js} +0 -0
  333. /package/build/{BMI_BOYS.percentile.weekly-6ca4bfee.js → BMI_BOYS.percentile.weekly-95824985.js} +0 -0
  334. /package/build/{BMI_BOYS.percentile.yearly-84310363.js → BMI_BOYS.percentile.yearly-c515fd7c.js} +0 -0
  335. /package/build/{BMI_BOYS.zscore.monthly-d02d77b5.js → BMI_BOYS.zscore.monthly-7bf26547.js} +0 -0
  336. /package/build/{BMI_BOYS.zscore.weekly-b3ce46cc.js → BMI_BOYS.zscore.weekly-80ad437e.js} +0 -0
  337. /package/build/{BMI_BOYS.zscore.yearly-7b275db0.js → BMI_BOYS.zscore.yearly-e990d13d.js} +0 -0
  338. /package/build/{BMI_GIRLS.percentile.monthly-99b4c96b.js → BMI_GIRLS.percentile.monthly-64ee65ee.js} +0 -0
  339. /package/build/{BMI_GIRLS.percentile.weekly-cc0421f0.js → BMI_GIRLS.percentile.weekly-26878366.js} +0 -0
  340. /package/build/{BMI_GIRLS.percentile.yearly-350e61b1.js → BMI_GIRLS.percentile.yearly-a29a6807.js} +0 -0
  341. /package/build/{BMI_GIRLS.zscore.monthly-705a6502.js → BMI_GIRLS.zscore.monthly-bb5f6287.js} +0 -0
  342. /package/build/{BMI_GIRLS.zscore.weekly-fcb2ae31.js → BMI_GIRLS.zscore.weekly-086936f0.js} +0 -0
  343. /package/build/{BMI_GIRLS.zscore.yearly-e1de1854.js → BMI_GIRLS.zscore.yearly-8cbe3c80.js} +0 -0
  344. /package/build/{ChevronDown-6a7b3798.js → ChevronDown-acf6c3ca.js} +0 -0
  345. /package/build/{Close-705a7add.js → Close-b1efd086.js} +0 -0
  346. /package/build/{Google-892a2ecb.js → Google-09868f74.js} +0 -0
  347. /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-1ebd633f.js → HEAD CIRCUM_BOYS.percentile.monthly-c5d44748.js} +0 -0
  348. /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-2ba64f59.js → HEAD CIRCUM_BOYS.percentile.weekly-91fe4021.js} +0 -0
  349. /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-58e8c7f7.js → HEAD CIRCUM_BOYS.percentile.yearly-7fac3788.js} +0 -0
  350. /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-c8699f38.js → HEAD CIRCUM_BOYS.zscore.monthly-c1af3f3e.js} +0 -0
  351. /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-b0039a2d.js → HEAD CIRCUM_BOYS.zscore.weekly-637f5605.js} +0 -0
  352. /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-70f1c1a4.js → HEAD CIRCUM_BOYS.zscore.yearly-e2162e6f.js} +0 -0
  353. /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-61657710.js → HEAD CIRCUM_GIRLS.percentile.monthly-062647ea.js} +0 -0
  354. /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-d42a844e.js → HEAD CIRCUM_GIRLS.percentile.weekly-1c601e28.js} +0 -0
  355. /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-284fb9df.js → HEAD CIRCUM_GIRLS.percentile.yearly-abd22c86.js} +0 -0
  356. /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-34da2f2e.js → HEAD CIRCUM_GIRLS.zscore.monthly-01e63f87.js} +0 -0
  357. /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-ec632ec6.js → HEAD CIRCUM_GIRLS.zscore.weekly-23b492cb.js} +0 -0
  358. /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-16cfdb6a.js → HEAD CIRCUM_GIRLS.zscore.yearly-a02c79c0.js} +0 -0
  359. /package/build/{HEIGHT_BOYS.percentile.monthly-a95c9700.js → HEIGHT_BOYS.percentile.monthly-132a5d71.js} +0 -0
  360. /package/build/{HEIGHT_BOYS.percentile.weekly-d00bf337.js → HEIGHT_BOYS.percentile.weekly-8b59d42e.js} +0 -0
  361. /package/build/{HEIGHT_BOYS.percentile.yearly-904b7317.js → HEIGHT_BOYS.percentile.yearly-fafae744.js} +0 -0
  362. /package/build/{HEIGHT_BOYS.zscore.monthly-3c4969c4.js → HEIGHT_BOYS.zscore.monthly-dbf2290f.js} +0 -0
  363. /package/build/{HEIGHT_BOYS.zscore.weekly-aa2f99cc.js → HEIGHT_BOYS.zscore.weekly-fb350a7f.js} +0 -0
  364. /package/build/{HEIGHT_BOYS.zscore.yearly-77bc064c.js → HEIGHT_BOYS.zscore.yearly-0b977905.js} +0 -0
  365. /package/build/{HEIGHT_GIRLS.percentile.monthly-b27db437.js → HEIGHT_GIRLS.percentile.monthly-0ad4b28b.js} +0 -0
  366. /package/build/{HEIGHT_GIRLS.percentile.weekly-1c71b2c0.js → HEIGHT_GIRLS.percentile.weekly-320ef2a1.js} +0 -0
  367. /package/build/{HEIGHT_GIRLS.percentile.yearly-3939763c.js → HEIGHT_GIRLS.percentile.yearly-8cc9cb9c.js} +0 -0
  368. /package/build/{HEIGHT_GIRLS.zscore.monthly-f054a202.js → HEIGHT_GIRLS.zscore.monthly-65cd5d6d.js} +0 -0
  369. /package/build/{HEIGHT_GIRLS.zscore.weekly-959f96a9.js → HEIGHT_GIRLS.zscore.weekly-b6410bea.js} +0 -0
  370. /package/build/{HEIGHT_GIRLS.zscore.yearly-dadc468b.js → HEIGHT_GIRLS.zscore.yearly-d419996d.js} +0 -0
  371. /package/build/{Locale-43704578.js → Locale-f24f8e73.js} +0 -0
  372. /package/build/{Visible-63d2cb32.js → Visible-19ec28f0.js} +0 -0
  373. /package/build/{WEIGHT_BOYS.percentile.monthly-7cee1d2b.js → WEIGHT_BOYS.percentile.monthly-26b9df83.js} +0 -0
  374. /package/build/{WEIGHT_BOYS.percentile.weekly-7247bce2.js → WEIGHT_BOYS.percentile.weekly-297f757d.js} +0 -0
  375. /package/build/{WEIGHT_BOYS.percentile.yearly-e4a6269e.js → WEIGHT_BOYS.percentile.yearly-7a9cc965.js} +0 -0
  376. /package/build/{WEIGHT_BOYS.zscore.monthly-8bd82e5f.js → WEIGHT_BOYS.zscore.monthly-32d71b0d.js} +0 -0
  377. /package/build/{WEIGHT_BOYS.zscore.weekly-0e0906f7.js → WEIGHT_BOYS.zscore.weekly-98b88378.js} +0 -0
  378. /package/build/{WEIGHT_BOYS.zscore.yearly-c125b6b8.js → WEIGHT_BOYS.zscore.yearly-44fcde90.js} +0 -0
  379. /package/build/{WEIGHT_GIRLS.percentile.monthly-1994f3bb.js → WEIGHT_GIRLS.percentile.monthly-b442170b.js} +0 -0
  380. /package/build/{WEIGHT_GIRLS.percentile.weekly-f7545593.js → WEIGHT_GIRLS.percentile.weekly-68b8a005.js} +0 -0
  381. /package/build/{WEIGHT_GIRLS.percentile.yearly-bceecd14.js → WEIGHT_GIRLS.percentile.yearly-7d24e36d.js} +0 -0
  382. /package/build/{WEIGHT_GIRLS.zscore.monthly-28d1206d.js → WEIGHT_GIRLS.zscore.monthly-5e8d5da8.js} +0 -0
  383. /package/build/{WEIGHT_GIRLS.zscore.weekly-d81696f0.js → WEIGHT_GIRLS.zscore.weekly-de70e63b.js} +0 -0
  384. /package/build/{WEIGHT_GIRLS.zscore.yearly-79fc1fb5.js → WEIGHT_GIRLS.zscore.yearly-0b665e75.js} +0 -0
  385. /package/build/{ageGenerate-775c0d57.js → ageGenerate-7ea42e02.js} +0 -0
  386. /package/build/{animation-43709c17.js → animation-96f630aa.js} +0 -0
  387. /package/build/{constants-9ac6077f.js → constants-58df8a9b.js} +0 -0
  388. /package/build/{constants-e9cca1ba.js → constants-87793bc2.js} +0 -0
  389. /package/build/{constants-30e8ab05.js → constants-d9240b27.js} +0 -0
  390. /package/build/{context-2bf4a853.js → context-a8b8fe05.js} +0 -0
  391. /package/build/{dataTransform-83d5d5b8.js → dataTransform-b57cb178.js} +0 -0
  392. /package/build/esm/{BMI_BOYS.percentile.monthly-537e65b1.js → BMI_BOYS.percentile.monthly-c9a1107a.js} +0 -0
  393. /package/build/esm/{BMI_BOYS.percentile.weekly-1077eb48.js → BMI_BOYS.percentile.weekly-39074931.js} +0 -0
  394. /package/build/esm/{BMI_BOYS.percentile.yearly-f72d4940.js → BMI_BOYS.percentile.yearly-90fbb210.js} +0 -0
  395. /package/build/esm/{BMI_BOYS.zscore.monthly-78e4b8f8.js → BMI_BOYS.zscore.monthly-a98c7c15.js} +0 -0
  396. /package/build/esm/{BMI_BOYS.zscore.weekly-d6009e2b.js → BMI_BOYS.zscore.weekly-10cc4d29.js} +0 -0
  397. /package/build/esm/{BMI_BOYS.zscore.yearly-5c61394c.js → BMI_BOYS.zscore.yearly-c6e8e0a6.js} +0 -0
  398. /package/build/esm/{BMI_GIRLS.percentile.monthly-18e89bb3.js → BMI_GIRLS.percentile.monthly-cf7b0c19.js} +0 -0
  399. /package/build/esm/{BMI_GIRLS.percentile.weekly-dd70f948.js → BMI_GIRLS.percentile.weekly-a1b0d202.js} +0 -0
  400. /package/build/esm/{BMI_GIRLS.percentile.yearly-5a93edf0.js → BMI_GIRLS.percentile.yearly-e18e23d5.js} +0 -0
  401. /package/build/esm/{BMI_GIRLS.zscore.monthly-7af50953.js → BMI_GIRLS.zscore.monthly-c6b08952.js} +0 -0
  402. /package/build/esm/{BMI_GIRLS.zscore.weekly-6e62d9fb.js → BMI_GIRLS.zscore.weekly-0a6c6e84.js} +0 -0
  403. /package/build/esm/{BMI_GIRLS.zscore.yearly-1bb57254.js → BMI_GIRLS.zscore.yearly-9a09a2c4.js} +0 -0
  404. /package/build/esm/{ChevronDown-acb35dbf.js → ChevronDown-86d763fc.js} +0 -0
  405. /package/build/esm/{Close-2a627e81.js → Close-4f6a6063.js} +0 -0
  406. /package/build/esm/{Google-3fa84f52.js → Google-663de247.js} +0 -0
  407. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.monthly-eae7a233.js → HEAD CIRCUM_BOYS.percentile.monthly-ecc112f3.js} +0 -0
  408. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.weekly-6cb7bd28.js → HEAD CIRCUM_BOYS.percentile.weekly-5e65dc2b.js} +0 -0
  409. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.yearly-d5fec723.js → HEAD CIRCUM_BOYS.percentile.yearly-94b7e6c3.js} +0 -0
  410. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.monthly-ce76b795.js → HEAD CIRCUM_BOYS.zscore.monthly-79789749.js} +0 -0
  411. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.weekly-584a2f91.js → HEAD CIRCUM_BOYS.zscore.weekly-d265f453.js} +0 -0
  412. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.yearly-d5d4d1ca.js → HEAD CIRCUM_BOYS.zscore.yearly-e3249df4.js} +0 -0
  413. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.monthly-fea29cf9.js → HEAD CIRCUM_GIRLS.percentile.monthly-121b5c54.js} +0 -0
  414. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.weekly-47e6e338.js → HEAD CIRCUM_GIRLS.percentile.weekly-11810aae.js} +0 -0
  415. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.yearly-b958283a.js → HEAD CIRCUM_GIRLS.percentile.yearly-e68accf3.js} +0 -0
  416. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.monthly-73fab259.js → HEAD CIRCUM_GIRLS.zscore.monthly-c2d4fd03.js} +0 -0
  417. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.weekly-03457132.js → HEAD CIRCUM_GIRLS.zscore.weekly-b1858e8a.js} +0 -0
  418. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.yearly-5c3b2aad.js → HEAD CIRCUM_GIRLS.zscore.yearly-e83a5964.js} +0 -0
  419. /package/build/esm/{HEIGHT_BOYS.percentile.monthly-feb0a4e0.js → HEIGHT_BOYS.percentile.monthly-01a41e72.js} +0 -0
  420. /package/build/esm/{HEIGHT_BOYS.percentile.weekly-6e6e9daa.js → HEIGHT_BOYS.percentile.weekly-37ee1af4.js} +0 -0
  421. /package/build/esm/{HEIGHT_BOYS.percentile.yearly-11bec487.js → HEIGHT_BOYS.percentile.yearly-7ae83b39.js} +0 -0
  422. /package/build/esm/{HEIGHT_BOYS.zscore.monthly-eb3a98e8.js → HEIGHT_BOYS.zscore.monthly-4dbb07b5.js} +0 -0
  423. /package/build/esm/{HEIGHT_BOYS.zscore.weekly-6fd40883.js → HEIGHT_BOYS.zscore.weekly-022ce8d0.js} +0 -0
  424. /package/build/esm/{HEIGHT_BOYS.zscore.yearly-95bbca63.js → HEIGHT_BOYS.zscore.yearly-bdfd3d46.js} +0 -0
  425. /package/build/esm/{HEIGHT_GIRLS.percentile.monthly-e1cfe470.js → HEIGHT_GIRLS.percentile.monthly-bd284619.js} +0 -0
  426. /package/build/esm/{HEIGHT_GIRLS.percentile.weekly-f2008f6e.js → HEIGHT_GIRLS.percentile.weekly-8a339d51.js} +0 -0
  427. /package/build/esm/{HEIGHT_GIRLS.percentile.yearly-4361cb39.js → HEIGHT_GIRLS.percentile.yearly-287fdb04.js} +0 -0
  428. /package/build/esm/{HEIGHT_GIRLS.zscore.monthly-10a6464d.js → HEIGHT_GIRLS.zscore.monthly-50af2f84.js} +0 -0
  429. /package/build/esm/{HEIGHT_GIRLS.zscore.weekly-72eaeea6.js → HEIGHT_GIRLS.zscore.weekly-5de624f3.js} +0 -0
  430. /package/build/esm/{HEIGHT_GIRLS.zscore.yearly-5b0c55b1.js → HEIGHT_GIRLS.zscore.yearly-24fdcc91.js} +0 -0
  431. /package/build/esm/{Locale-71a37261.js → Locale-ae6a3517.js} +0 -0
  432. /package/build/esm/{Visible-a6c749d0.js → Visible-64e07707.js} +0 -0
  433. /package/build/esm/{WEIGHT_BOYS.percentile.monthly-1b43720e.js → WEIGHT_BOYS.percentile.monthly-8402784d.js} +0 -0
  434. /package/build/esm/{WEIGHT_BOYS.percentile.weekly-1648c7c9.js → WEIGHT_BOYS.percentile.weekly-19349d18.js} +0 -0
  435. /package/build/esm/{WEIGHT_BOYS.percentile.yearly-52ccd261.js → WEIGHT_BOYS.percentile.yearly-366e44d1.js} +0 -0
  436. /package/build/esm/{WEIGHT_BOYS.zscore.monthly-76780d89.js → WEIGHT_BOYS.zscore.monthly-4fc6d27f.js} +0 -0
  437. /package/build/esm/{WEIGHT_BOYS.zscore.weekly-81091f30.js → WEIGHT_BOYS.zscore.weekly-706c9911.js} +0 -0
  438. /package/build/esm/{WEIGHT_BOYS.zscore.yearly-1b33d7d5.js → WEIGHT_BOYS.zscore.yearly-67c54073.js} +0 -0
  439. /package/build/esm/{WEIGHT_GIRLS.percentile.monthly-606461e6.js → WEIGHT_GIRLS.percentile.monthly-f1278d3a.js} +0 -0
  440. /package/build/esm/{WEIGHT_GIRLS.percentile.weekly-06e351cc.js → WEIGHT_GIRLS.percentile.weekly-56953b27.js} +0 -0
  441. /package/build/esm/{WEIGHT_GIRLS.percentile.yearly-834d561a.js → WEIGHT_GIRLS.percentile.yearly-b4201709.js} +0 -0
  442. /package/build/esm/{WEIGHT_GIRLS.zscore.monthly-a3c0226c.js → WEIGHT_GIRLS.zscore.monthly-6b87e48b.js} +0 -0
  443. /package/build/esm/{WEIGHT_GIRLS.zscore.weekly-97648c0a.js → WEIGHT_GIRLS.zscore.weekly-571d33b2.js} +0 -0
  444. /package/build/esm/{WEIGHT_GIRLS.zscore.yearly-a6b9aa65.js → WEIGHT_GIRLS.zscore.yearly-7044e88f.js} +0 -0
  445. /package/build/esm/{ageGenerate-d2768189.js → ageGenerate-d9155c35.js} +0 -0
  446. /package/build/esm/{animation-0f11c4f1.js → animation-ad5dd370.js} +0 -0
  447. /package/build/esm/{constants-ae616740.js → constants-2eead44d.js} +0 -0
  448. /package/build/esm/{constants-da65833b.js → constants-9d0f340b.js} +0 -0
  449. /package/build/esm/{constants-a5b04f97.js → constants-bb7365f2.js} +0 -0
  450. /package/build/esm/{context-08069e35.js → context-08e3b1bc.js} +0 -0
  451. /package/build/esm/{dataTransform-a2726ad9.js → dataTransform-f7b0bcb9.js} +0 -0
  452. /package/build/esm/{index-93eac1b0.js → index-0420ac0b.js} +0 -0
  453. /package/build/esm/{index-4022f8d3.js → index-19f8afb9.js} +0 -0
  454. /package/build/esm/{index-bffc77db.js → index-3a624f24.js} +0 -0
  455. /package/build/esm/{index-8cdd53db.js → index-626c4113.js} +0 -0
  456. /package/build/esm/{index-2437b025.js → index-9311ce10.js} +0 -0
  457. /package/build/esm/{index-9db1fa3f.js → index-9e96534d.js} +0 -0
  458. /package/build/esm/{index-1da86aeb.js → index-d6b2f50d.js} +0 -0
  459. /package/build/esm/{index-9f033810.js → index-d973dda2.js} +0 -0
  460. /package/build/esm/{index-01ef2d81.js → index-da2db16e.js} +0 -0
  461. /package/build/esm/{index.styles-4bb9bfe4.js → index.styles-008046cd.js} +0 -0
  462. /package/build/esm/{localizeNumberFormat-4abc7b47.js → localizeNumberFormat-9a095e20.js} +0 -0
  463. /package/build/esm/{normalizeLink-f8289752.js → normalizeLink-bdccd192.js} +0 -0
  464. /package/build/esm/{number-1b874408.js → number-75b8999c.js} +0 -0
  465. /package/build/esm/{paths-4f3051ca.js → paths-e7c84f42.js} +0 -0
  466. /package/build/esm/{shared-8a9d8fab.js → shared-37b0921d.js} +0 -0
  467. /package/build/esm/{translationsContext-15ea5753.js → translationsContext-af917846.js} +0 -0
  468. /package/build/esm/{tslib.es6-7355b732.js → tslib.es6-66838b4c.js} +0 -0
  469. /package/build/esm/{types-2d873ef3.js → types-a8969720.js} +0 -0
  470. /package/build/esm/{types-9cbdf8ea.js → types-bf43a8e8.js} +0 -0
  471. /package/build/esm/{useIsInit-2dd4ee59.js → useIsInit-5da0a0ae.js} +0 -0
  472. /package/build/esm/{useOutsideClick-4bb4446a.js → useOutsideClick-e0be87ad.js} +0 -0
  473. /package/build/esm/{useScrollbarSize-7b64bb55.js → useScrollbarSize-35578f92.js} +0 -0
  474. /package/build/esm/{useUniqueId-f8007ec9.js → useUniqueId-c17e11b4.js} +0 -0
  475. /package/build/esm/{utils-2cf0d99b.js → utils-231a9c1b.js} +0 -0
  476. /package/build/esm/{utils-f84f026e.js → utils-28b75903.js} +0 -0
  477. /package/build/{index-dabb30ee.js → index-1d983f41.js} +0 -0
  478. /package/build/{index-a10c0ac1.js → index-400ac85c.js} +0 -0
  479. /package/build/{index-7b687aa2.js → index-4890570c.js} +0 -0
  480. /package/build/{index-24ab4b59.js → index-4cc4e94c.js} +0 -0
  481. /package/build/{index-c0e9e0bd.js → index-4e847075.js} +0 -0
  482. /package/build/{index-9d22d57f.js → index-649acf51.js} +0 -0
  483. /package/build/{index-fc60eb46.js → index-68feb624.js} +0 -0
  484. /package/build/{index-fb2a7a49.js → index-89e472ae.js} +0 -0
  485. /package/build/{index-cdf1873d.js → index-a5ed4245.js} +0 -0
  486. /package/build/{index.styles-35e95153.js → index.styles-d012f777.js} +0 -0
  487. /package/build/{localizeNumberFormat-ea5992f2.js → localizeNumberFormat-24eb2277.js} +0 -0
  488. /package/build/{normalizeLink-a18477f5.js → normalizeLink-cb644fd3.js} +0 -0
  489. /package/build/{number-5f3a4edf.js → number-3d6a2cda.js} +0 -0
  490. /package/build/{paths-9fdedd08.js → paths-dfe2bf5e.js} +0 -0
  491. /package/build/{shared-916c6ada.js → shared-d5ae85ac.js} +0 -0
  492. /package/build/{translationsContext-a23cbbd8.js → translationsContext-2057a072.js} +0 -0
  493. /package/build/{tslib.es6-94e53345.js → tslib.es6-32438f57.js} +0 -0
  494. /package/build/{types-f95847ff.js → types-28a94c6c.js} +0 -0
  495. /package/build/{types-1bbf3280.js → types-3f6819f7.js} +0 -0
  496. /package/build/{useIsInit-7b7b765e.js → useIsInit-1dbc3cdd.js} +0 -0
  497. /package/build/{useOutsideClick-9c7ff6c7.js → useOutsideClick-8b68180d.js} +0 -0
  498. /package/build/{useScrollbarSize-7de31dff.js → useScrollbarSize-0bd5bd56.js} +0 -0
  499. /package/build/{useUniqueId-3a53bb99.js → useUniqueId-80352f05.js} +0 -0
  500. /package/build/{utils-7a4f4458.js → utils-4b7f1f41.js} +0 -0
  501. /package/build/{utils-436658bb.js → utils-4e787da9.js} +0 -0
package/build/esm/lead.js CHANGED
@@ -1,62 +1,53 @@
1
- import { _ as __rest, a as __awaiter } from './tslib.es6-7355b732.js';
2
- import React__default, { createContext, useMemo, useEffect, useRef, useState, useContext, useCallback, forwardRef, useImperativeHandle, memo, useLayoutEffect } from 'react';
1
+ import { _ as __rest, a as __awaiter } from './tslib.es6-66838b4c.js';
2
+ import React__default, { createContext, useMemo, useContext, useEffect, useRef, useState, useCallback, forwardRef, useImperativeHandle, memo, useLayoutEffect } from 'react';
3
3
  import { createStyles, Box, useMantineTheme, Button as Button$1, Autocomplete, Input as Input$1, Checkbox as Checkbox$1, Radio as Radio$1, Select as Select$1, Flex, clsx, TextInput, NumberInput as NumberInput$1, rem, AspectRatio, Badge, Tooltip, Portal, Transition, Overlay } from '@mantine/core';
4
4
  import debounce from 'lodash/debounce';
5
5
  import { createFormContext, useForm } from '@mantine/form';
6
6
  import dayjs from 'dayjs';
7
- import { B as BEARER_TOKEN_COOKIE } from './index-06e91e76.js';
7
+ import { B as BEARER_TOKEN_COOKIE } from './index-0c3d2686.js';
8
8
  import { getCookie, setCookie } from './miscCookieHelper.js';
9
- import { u as useTranslations } from './index-01977476.js';
10
- import { T as TranslationsContext } from './translationsContext-15ea5753.js';
11
- import { M as MediaQueries, b as getWrapperDomWithSelector, a as getPopupWrapperDom } from './utils-2cf0d99b.js';
12
- import { T as Text } from './index-f38aca87.js';
13
- import { S as Select, d as Checkbox, I as Input, R as Radio, P as Phone, N as NumberInput, E as ErrorIcon, O as OTP } from './index-9c27c173.js';
14
- import { D as DatePicker } from './index-abc5467c.js';
15
- import { B as Button } from './index-d09629fa.js';
16
- import { G as GlobalTextStyleNew, C as CustomStylesType, F as FontWeight } from './index-1da86aeb.js';
17
- import './index.styles-4bb9bfe4.js';
9
+ import { t as translationsMap$1 } from './translationsProvider-ae869aee.js';
10
+ import { u as useTranslations } from './index-257784e5.js';
11
+ import { T as TranslationsContext } from './translationsContext-af917846.js';
12
+ import { M as MediaQueries, b as getWrapperDomWithSelector, a as getPopupWrapperDom } from './utils-231a9c1b.js';
13
+ import { T as Text } from './index-376fae17.js';
14
+ import { S as Select, d as Checkbox, I as Input, R as Radio, P as Phone, N as NumberInput, E as ErrorIcon, O as OTP } from './index-4b3ad3ae.js';
15
+ import { D as DatePicker } from './index-933ce739.js';
16
+ import { B as Button } from './index-c8465d3a.js';
17
+ import { G as GlobalTextStyleNew, C as CustomStylesType, F as FontWeight } from './index-d6b2f50d.js';
18
+ import './index.styles-008046cd.js';
18
19
  import { useIntersection } from '@mantine/hooks';
19
- import './index-ed2c52fa.js';
20
- import './index-c4470578.js';
21
- import { M as MAPPED_LOCALE } from './utils-1f327927.js';
20
+ import './index-6d63d999.js';
21
+ import './index-1e80c3fb.js';
22
+ import { M as MAPPED_LOCALE } from './utils-72f73e2c.js';
22
23
  import { DateInput } from '@mantine/dates';
23
- import { L as LOCALE_SPECS, Z as ZINDEX_SSO, I as ISO_FORMAT } from './index-2ff4c7dc.js';
24
- import { C as COMMON_DATE_TRANSLATE_KEY } from './index-505b85da.js';
25
- import './index-01ef2d81.js';
26
- import { u as usePlacesAutocomplete, G as GOOGLE_API_KEY } from './usePlacesAutocomplete-98b165da.js';
27
- import { H as Heading$1 } from './index-ce869cbd.js';
28
- import { t as translationsMap$1 } from './translationsProvider-85d42d03.js';
29
- import { L as LOCALE } from './Locale-71a37261.js';
24
+ import { L as LOCALE_SPECS, Z as ZINDEX_SSO, I as ISO_FORMAT } from './index-8e23d685.js';
25
+ import { C as COMMON_DATE_TRANSLATE_KEY } from './index-31186afa.js';
26
+ import './index-da2db16e.js';
27
+ import { u as usePlacesAutocomplete, G as GOOGLE_API_KEY } from './usePlacesAutocomplete-51e606e2.js';
28
+ import { H as Heading$1 } from './index-1e726ac4.js';
29
+ import { L as LOCALE } from './Locale-ae6a3517.js';
30
30
  import { v1 } from 'uuid';
31
31
  import { domainLocales } from './constantsDomainLocales.js';
32
32
  import { parsePhoneNumber } from 'react-phone-number-input';
33
33
  import styled from '@emotion/styled';
34
34
  import { theme } from './miscTheme.js';
35
- import { u as useTextStyles, C as ChoiceField, T as TextField } from './index-1161c0c5.js';
36
- import { T as TogetherComponentGlobalContext } from './utils-327034d3.js';
37
- import { M as MantineProvider } from './index-d00dd915.js';
38
- import { i as isVideo } from './index-93eac1b0.js';
39
- import { I as ImageWrap, u as useScreenSize } from './index-3b127bcb.js';
35
+ import { u as useTextStyles, C as ChoiceField, T as TextField } from './index-3e76e93c.js';
36
+ import { T as TogetherComponentGlobalContext } from './utils-0152f899.js';
37
+ import { M as MantineProvider } from './index-4d4a9120.js';
38
+ import { i as isVideo } from './index-0420ac0b.js';
39
+ import { I as ImageWrap, u as useScreenSize } from './index-b81e787f.js';
40
40
  import { motion } from 'framer-motion';
41
41
  import { createPortal } from 'react-dom';
42
42
  import { ChevronDown } from '@hhgtech/icons/arrow';
43
43
  import { MapPin } from '@hhgtech/icons/core';
44
- import { I as InputDate } from './InputDate-e88ffe97.js';
44
+ import { I as InputDate } from './InputDate-a808832c.js';
45
45
  import { Carousel } from '@mantine/carousel';
46
- import { c as currencyFormat } from './utils-f84f026e.js';
47
- import { D as DrawerComponent } from './index-72c85322.js';
48
- import { C as Close } from './Close-2a627e81.js';
46
+ import { c as currencyFormat } from './utils-28b75903.js';
47
+ import { D as DrawerComponent } from './index-fde3116a.js';
48
+ import { C as Close } from './Close-4f6a6063.js';
49
49
  import './constantsIsProduction.js';
50
- import './normalizeLink-f8289752.js';
51
- import '@hhgtech/icons/other';
52
- import 'classnames';
53
- import './useUniqueId-f8007ec9.js';
54
- import './constantsSite.js';
55
- import '@emotion/react';
56
- import './shared-8a9d8fab.js';
57
- import '@mantine/notifications';
58
- import 'date-fns/locale';
59
- import './constantsRiskScreener.js';
50
+ import './normalizeLink-bdccd192.js';
60
51
  import './i18n-values/en-PH.js';
61
52
  import './i18n-values/hi-IN.js';
62
53
  import './i18n-values/id-ID.js';
@@ -69,11 +60,20 @@ import './i18n-values/vi-VN.js';
69
60
  import './i18n-values/vi-VN_MB.js';
70
61
  import './i18n-values/zh-SG.js';
71
62
  import './i18n-values/zh-TW.js';
72
- import './index-2437b025.js';
63
+ import '@hhgtech/icons/other';
64
+ import 'classnames';
65
+ import './useUniqueId-c17e11b4.js';
66
+ import './constantsSite.js';
67
+ import '@emotion/react';
68
+ import './shared-37b0921d.js';
69
+ import '@mantine/notifications';
70
+ import 'date-fns/locale';
71
+ import './constantsRiskScreener.js';
72
+ import './index-9311ce10.js';
73
73
  import 'slugify';
74
74
  import 'string-format';
75
75
  import './togetherApiPaths.js';
76
- import './constants-a5b04f97.js';
76
+ import './constants-bb7365f2.js';
77
77
  import 'vaul';
78
78
 
79
79
  const LeadGenComponentContext = createContext({});
@@ -696,979 +696,992 @@ const clearCacheUsedEmailOrPhone = () => {
696
696
  validatedCache.phoneOnly = {};
697
697
  };
698
698
 
699
- // You can give context variables any name
700
- const [LeadFormProvider$1, useLeadFormContext$1, useLeadForm$1] = createFormContext();
701
- const useLeadFormConfig$1 = ({ listBlockAdded = [], validatingPhoneRef, validatingEmailRef, campaignId, campaign_subot_id = [], userInfo, }) => {
702
- const { t } = useTranslations();
703
- const initialValues = useMemo(() => formatLeadGenFormValue(mappingSSOToLead(userInfo), listBlockAdded), [userInfo === null || userInfo === void 0 ? void 0 : userInfo.id]);
704
- useEffect(() => {
705
- if (!window.intlTelInputUtils) {
706
- require('intl-tel-input/build/js/utils');
707
- }
708
- }, []);
709
- const validateObj = useMemo(() => {
710
- const InputBlocks = [
711
- 'TextBlock',
712
- 'NumberBlock',
713
- 'EmailBlock',
714
- 'PhoneBlock',
715
- 'DateBlock',
716
- 'CheckboxBlock',
717
- 'RadioBlock',
718
- 'DropdownBlock',
719
- 'PhoneOtpBlock',
720
- 'WhatsappOtpBlock',
721
- 'ZaloOtpBlock',
722
- 'LocationBlock',
723
- 'TncBlock',
724
- ];
725
- // ALL are required and can skip if not touched yet
726
- const withSharedCheck = (name, cb,
727
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
728
- block) => {
729
- return (value) => {
730
- var _a;
731
- const isBLockRequired = (_a = block === null || block === void 0 ? void 0 : block.data) === null || _a === void 0 ? void 0 : _a.required;
732
- if (!formRef.current.isTouched(name))
733
- return;
734
- if (typeof value === 'undefined' ||
735
- value === '' ||
736
- (Array.isArray(value) && value.length === 0)) {
737
- return isBLockRequired
738
- ? t('validator.required')
739
- : cb === null || cb === void 0 ? void 0 : cb(value);
740
- }
741
- return cb === null || cb === void 0 ? void 0 : cb(value);
742
- };
743
- };
744
- return listBlockAdded
745
- .filter((b) => InputBlocks.includes(b.name))
746
- .reduce((r, b) => {
747
- var _a;
748
- const isRequired = (_a = b.data.required) !== null && _a !== void 0 ? _a : true;
749
- if (b.name === 'NumberBlock') {
750
- return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, (value) => {
751
- if (value && isNaN(Number(value))) {
752
- return t('validator.number');
753
- }
754
- }, b) });
755
- }
756
- else if (b.name === 'EmailBlock') {
757
- return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, (value) => {
758
- if (value && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value)) {
759
- return t('validator.email');
760
- }
761
- if (!value)
762
- return;
763
- validatingEmailRef.current = true;
764
- setTimeout(() => {
765
- formRef.current.setFieldError(b.data.value, 'Validating...');
766
- checkUsedEmailOrPhoneWithCache(campaignId, campaign_subot_id, {
767
- email: value,
768
- })
769
- .then((tKey) => {
770
- if (tKey) {
771
- formRef.current.setFieldError(b.data.value, t(tKey));
772
- }
773
- else {
774
- formRef.current.clearFieldError(b.data.value);
775
- }
776
- validatingEmailRef.current = false;
777
- })
778
- .catch((e) => {
779
- console.error(e);
780
- formRef.current.setFieldError(b.data.value, e.message || 'Something went wrong');
781
- validatingEmailRef.current = false;
782
- });
783
- }, 200);
784
- }, b) });
785
- }
786
- else if (b.name === 'PhoneBlock' ||
787
- b.name === 'PhoneOtpBlock' ||
788
- b.name === 'ZaloOtpBlock' ||
789
- b.name === 'WhatsappOtpBlock') {
790
- return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, (value) => {
791
- if (value &&
792
- window.intlTelInputUtils &&
793
- !window.intlTelInputUtils.isValidNumber(String(value), LEAD_LOCALE.countryCode)) {
794
- return t('validator.phone');
795
- }
796
- if (!value)
797
- return;
798
- validatingPhoneRef.current = true;
799
- setTimeout(() => {
800
- formRef.current.setFieldError(b.data.value, 'Validating...');
801
- if (b.data.singleSubmission) {
802
- checkUsedPhoneOnlyWithCache(campaignId, value)
803
- .then((tKey) => {
804
- if (tKey) {
805
- formRef.current.setFieldError(b.data.value, t(tKey));
806
- }
807
- else {
808
- formRef.current.clearFieldError(b.data.value);
809
- }
810
- validatingPhoneRef.current = false;
811
- })
812
- .catch((err) => {
813
- console.error(err);
814
- formRef.current.setFieldError(b.data.value, err.message || 'Something went wrong');
815
- validatingPhoneRef.current = false;
816
- });
817
- }
818
- else {
819
- checkUsedEmailOrPhoneWithCache(campaignId, campaign_subot_id, {
820
- phone: value,
821
- })
822
- .then((tKey) => {
823
- if (tKey) {
824
- formRef.current.setFieldError(b.data.value, t(tKey));
825
- }
826
- else {
827
- formRef.current.clearFieldError(b.data.value);
828
- }
829
- validatingPhoneRef.current = false;
830
- })
831
- .catch((e) => {
832
- console.error(e);
833
- formRef.current.setFieldError(b.data.value, e.message || 'Something went wrong');
834
- validatingPhoneRef.current = false;
835
- });
836
- }
837
- }, 200);
838
- }, b) });
839
- }
840
- else if (b.name === 'DateBlock') {
841
- return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, (value) => {
842
- if (value && isNaN(Date.parse(value))) {
843
- return t('validator.date');
844
- }
845
- }, b) });
846
- }
847
- else if (b.name === 'TncBlock') {
848
- return Object.assign(Object.assign({}, r), { [`TNC-` + b.id]: withSharedCheck('TNC-' + b.id, (value) => {
849
- if (isRequired && !value) {
850
- return t('validator.required');
851
- }
852
- }, b) });
853
- }
854
- else {
855
- return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, undefined, b) });
856
- }
857
- }, {});
858
- }, [listBlockAdded.map((b) => b.name).join(',')]);
859
- const form = useLeadForm$1({
860
- validateInputOnChange: true,
861
- clearInputErrorOnChange: true,
862
- validate: validateObj,
863
- initialValues,
864
- });
865
- const formRef = useRef(form);
866
- formRef.current = form;
867
- return { form, validateObj };
699
+ var enPH = {
700
+ "validator.required": "This field is required.",
701
+ "validator.remote": "Please fix this field.",
702
+ "validator.email": "Please enter a valid email address.",
703
+ "validator.phone": "Please input correct phone number.",
704
+ "validator.url": "Please enter a valid URL.",
705
+ "validator.date": "Please enter a valid date.",
706
+ "validator.dateISO": "Please enter a valid date (ISO).",
707
+ "validator.number": "Please enter a valid number.",
708
+ "validator.digits": "Please enter only digits.",
709
+ "validator.creditcard": "Please enter a valid credit card number.",
710
+ "validator.equalTo": "Please enter the same value again.",
711
+ "validator.accept": "Please enter a value with a valid extension.",
712
+ "validator.maxlength": "jQuery.validator.format('Please enter no more than {0} characters.",
713
+ "validator.minlength": "jQuery.validator.format('Please enter at least {0} characters.",
714
+ "validator.rangelength": "jQuery.validator.format('Please enter a value between {0} and {1} characters long.",
715
+ "validator.range": "jQuery.validator.format('Please enter a value between {0} and {1}.",
716
+ "validator.max": "jQuery.validator.format('Please enter a value less than or equal to {0}.",
717
+ "validator.min": "jQuery.validator.format('Please enter a value greater than or equal to {0}.",
718
+ "validator.emailUsed": "Email already in use for this campaign.",
719
+ "validator.phoneUsed": "Your phone number already in use for this campaign.",
720
+ "validator.dateInvalid": "This date is not valid, please update.",
721
+ "lead.otp.title": "Enter OTP",
722
+ "lead.otp.desc": "We have sent an OTP to your mobile number {phone}",
723
+ "lead.otp.verify": "Verify",
724
+ "lead.otp.resend": "Resend OTP{timer}",
725
+ "lead.otp.phoneLabel": "Phone OTP",
726
+ "lead.otp.phonePlaceholder": "Enter OTP",
727
+ "lead.empty.title": "Oops, seem your information is empty, do you want to submit the information again?",
728
+ "lead.empty.cancel": "Cancel",
729
+ "lead.empty.submitAgain": "Submit again",
730
+ "inlineFreebie.freeSample.title": "Free Sample",
731
+ "inlineFreebie.luckyDrawGift.title": "Lucky-draw Gift",
732
+ "inlineFreebie.value": "Value",
733
+ "common.day": "Day",
734
+ "common.month": "Month",
735
+ "common.year": "Year"
868
736
  };
869
737
 
870
- const Component = ({ campaign, onClose: onCloseProp, onOtherSubmit, onSubmit, showThankyou, setShowThankyou, locale, children, showEmpty, setShowEmpty, userInfo, }) => {
871
- var _a, _b;
872
- const extraFields = campaign.extra_fields;
873
- const campaignId = campaign.id;
874
- const campaign_subot_id = campaign.bot_id || [];
875
- const listBlockAdded = JSON.parse(extraFields.listBlockAdded);
876
- const actionBlocks = JSON.parse(extraFields.actionBlocks);
877
- const textBlocks = JSON.parse(extraFields.textBlocks);
878
- const heading = ((_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) || '';
879
- const description = textBlocks.subtitleBlock.data.value;
880
- const validatingPhoneRef = useRef(false);
881
- const validatingEmailRef = useRef(false);
882
- const leadFormConfig = useLeadFormConfig$1({
883
- listBlockAdded,
884
- validatingPhoneRef,
885
- validatingEmailRef,
886
- campaignId,
887
- campaign_subot_id,
888
- userInfo,
889
- });
890
- const [showOtpPhone, setShowOtpPhone] = useState(null);
891
- const [formRef, setFormRef] = useState(null);
892
- const onClose = () => {
893
- if (showOtpPhone) {
894
- setShowOtpPhone(null);
895
- }
896
- else {
897
- onCloseProp === null || onCloseProp === void 0 ? void 0 : onCloseProp();
898
- }
899
- };
900
- useEffect(() => {
901
- clearCacheUsedEmailOrPhone();
902
- }, []);
903
- return campaign ? (React__default.createElement(LeadGenComponentContext.Provider, { value: {
904
- campaignId,
905
- campaign_subot_id,
906
- heading,
907
- description,
908
- listBlockAdded,
909
- textBlocks,
910
- actionBlocks,
911
- leadFormConfig,
912
- validatingEmailRef,
913
- validatingPhoneRef,
914
- formRef: { current: formRef },
915
- setFormRef,
916
- locale,
917
- onClose,
918
- onOtherSubmit,
919
- showOtpPhone,
920
- setShowOtpPhone,
921
- onSubmit,
922
- showThankyou,
923
- setShowThankyou,
924
- showEmpty,
925
- setShowEmpty,
926
- } }, children)) : null;
738
+ var hiIN = {
739
+ "validator.required": "इस क्षेत्र की आवश्यकता है।",
740
+ "validator.email": "कृपया एक मान्य ईमेल पता दर्ज करें",
741
+ "validator.number": "कृपया एक वैध संख्या दर्ज करें",
742
+ "validator.digits": "कृपया केवल अंक दर्ज करें",
743
+ "validator.maxlength": "कृपया {0} अक्षर से अधिक दर्ज न करें",
744
+ "validator.minlength": "कृपया कम से कम {0} अक्षर दर्ज करें",
745
+ "validator.phone": "कृपया एक वैध संख्या दर्ज करें",
746
+ "validator.dateInvalid": "यह तिथि मान्य नहीं है, कृपया अपडेट करें।",
747
+ "validator.emailUsed": "Email already in use for this campaign.",
748
+ "validator.phoneUsed": "Your phone number already in use for this campaign.",
749
+ "lead.otp.title": "Enter OTP",
750
+ "lead.otp.desc": "We have sent an OTP to your mobile number {phone}",
751
+ "lead.otp.verify": "Verify",
752
+ "lead.otp.resend": "Resend OTP{timer}",
753
+ "lead.empty.title": "ऊप्स! लगता है आपकी जानकारी खाली है। क्या आप जानकारी फिर से सबमिट करना चाहते हैं?",
754
+ "lead.empty.cancel": "रद्द करें",
755
+ "lead.empty.submitAgain": "फिर से सबमिट करें",
756
+ "inlineFreebie.freeSample.title": "मुफ्त नमूना",
757
+ "inlineFreebie.luckyDrawGift.title": "लकी-ड्रा गिफ्ट",
758
+ "inlineFreebie.value": "मूल्य",
759
+ "common.day": "साल",
760
+ "common.month": "महीना",
761
+ "common.year": ""
927
762
  };
928
763
 
929
- const Description = (_a) => {
930
- var rest = __rest(_a, []);
931
- const { description } = useContext(LeadGenComponentContext);
932
- return description ? (React__default.createElement(Text, Object.assign({ size: "p3" }, rest), description)) : null;
764
+ var idID = {
765
+ "validator.required": "Kolom ini wajib diisi",
766
+ "validator.email": "Tolong daftarkan email yang valid",
767
+ "validator.number": "Tolong daftarkan nomor telepon yang valid",
768
+ "validator.digits": "Tolong masukkan angka saja",
769
+ "validator.maxlength": "Jangan memasukkan lebih dari {0} karakter",
770
+ "validator.minlength": "Tolong ketik sedikitnya {0} karakter",
771
+ "validator.phone": "Tolong daftarkan nomor telepon yang valid",
772
+ "validator.emailUsed": "Email sudah digunakan untuk kampanye ini.",
773
+ "validator.phoneUsed": "Nomor telepon Anda sudah digunakan untuk kampanye ini.",
774
+ "validator.dateInvalid": "Tanggal ini tidak valid, silakan perbarui",
775
+ "lead.otp.title": "Masukkan OTP",
776
+ "lead.otp.desc": "Kami telah mengirimkan OTP ke nomor ponsel Anda {phone}",
777
+ "lead.otp.verify": "Verifikasi",
778
+ "lead.otp.resend": "Kirim Ulang OTP {timer}",
779
+ "lead.otp.phoneLabel": "OTP Telepon",
780
+ "lead.otp.phonePlaceholder": "Masukkan OTP",
781
+ "lead.empty.title": "Oops, sepertinya informasi Anda kosong. Apakah Anda ingin mengirimkan informasi lagi?",
782
+ "lead.empty.cancel": "Batal",
783
+ "lead.empty.submitAgain": "Kirim lagi",
784
+ "inlineFreebie.freeSample.title": "Sampel Gratis",
785
+ "inlineFreebie.luckyDrawGift.title": "Hadiah Undian",
786
+ "inlineFreebie.value": "Nilai",
787
+ "common.day": "Hari",
788
+ "common.month": "Bulan",
789
+ "common.year": "Tahun"
933
790
  };
934
791
 
935
- const LeadGenContext$1 = createContext({});
936
-
937
- var useStyles$3 = createStyles(() => {
938
- return {
939
- control: {},
940
- };
941
- });
792
+ var kmKH = {
793
+ "validator.required": "ព័ត៌មាន​ចាំបាច់​ដែល​ត្រូវ​បំពេញ",
794
+ "validator.email": "សូម​វាយ​អាសយដ្ឋាន​អ៊ីម៉ែល​ឲ្យ​បាន​ត្រឹមត្រូវ",
795
+ "validator.number": "សូម​វាយបញ្ចូល​លេខ​ឲ្យ​បាន​ត្រឹមត្រូវ",
796
+ "validator.digits": "វាយ​បញ្ចូល​បាន​តែ​លេខ​ប៉ុណ្ណោះ",
797
+ "validator.maxlength": "សូម​វាយ​បញ្ចូលកុំ​ឲ្យ​លើស {0} តួអក្សរ",
798
+ "validator.minlength": "សូម​វាយ​បញ្ចូល​តិច​បំផុត {0} តួអក្ស",
799
+ "validator.phone": "សូម​វាយបញ្ចូល​លេខ​ឲ្យ​បាន​ត្រឹមត្រូវ",
800
+ "validator.emailUsed": "អ៊ីមែលត្រូវបានប្រើប្រាស់សម្រាប់យុទ្ធនាការនេះរួចហើយ។",
801
+ "validator.phoneUsed": "លេខទូរស័ព្ទរបស់អ្នកត្រូវបានប្រើប្រាស់សម្រាប់យុទ្ធនាការនេះរួចហើយ។",
802
+ "validator.dateInvalid": "កាលបរិច្ឆេទនេះមិនត្រឹមត្រូវទេ សូមធ្វើបច្ចុប្បន្នភាព។",
803
+ "lead.otp.title": "បញ្ចូល OTP",
804
+ "lead.otp.desc": "យើងបានផ្ញើ OTP ទៅកាន់លេខទូរសព្ទរបស់អ្នក {phone}",
805
+ "lead.otp.verify": "ផ្ទៀងផ្ទាត់",
806
+ "lead.otp.resend": "ផ្ញើ OTP ម្តងទៀត {timer}",
807
+ "lead.otp.phoneLabel": "OTP ទូរស័ព្ទ",
808
+ "lead.otp.phonePlaceholder": "បញ្ចូល OTP",
809
+ "lead.empty.title": "អូុបស! ហាក់ដូចជាព័ត៌មានរបស់អ្នកទទេ។ តើអ្នកចង់ដាក់ស្នើព័ត៌មានម្តងទៀតទេ?",
810
+ "lead.empty.cancel": "លុប​ចោល",
811
+ "lead.empty.submitAgain": "ដាក់ស្នើម្ដងទៀត",
812
+ "inlineFreebie.freeSample.title": "សំបុត្រស្រង់ពិន័យ",
813
+ "inlineFreebie.luckyDrawGift.title": "សំបុត្រស្រង់ពិន័យ",
814
+ "inlineFreebie.value": "តម្លៃ",
815
+ "common.day": "ឆ្នាំ",
816
+ "common.month": "ខែ",
817
+ "common.year": "ថ្ងៃ"
818
+ };
942
819
 
943
- const libraries$1 = ['places'];
944
- const LocationBlock = ({ name, placeholder, locale, required = true, }) => {
945
- var _a;
946
- const form = useLeadFormContext$1();
947
- const [searchValue, setSearchValue] = useState('');
948
- const [address, setAddress] = useState('');
949
- const { predictions } = usePlacesAutocomplete(searchValue, '', locale === 'tl-PH' ? 'en' : (_a = locale === null || locale === void 0 ? void 0 : locale.split('-')) === null || _a === void 0 ? void 0 : _a[0]);
950
- const [LoadScript, setLoadScript] = useState(null);
951
- const [ready, setReady] = useState(false);
952
- const randRef = useRef(Math.random().toString(36).substring(7));
953
- const options = useMemo(() => {
954
- const _opts = predictions.map((p) => {
955
- return {
956
- value: p.description,
957
- label: p.description,
958
- };
959
- });
960
- const isExist = _opts.find((o) => o.value === address);
961
- if (!address || isExist) {
962
- return _opts;
963
- }
964
- return [{ value: address, label: address }].concat(_opts);
965
- }, [predictions, address]);
966
- useEffect(() => {
967
- var _a, _b, _c;
968
- // only load extra google script when not yet loaded
969
- 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)) {
970
- import('@react-google-maps/api').then((m) => {
971
- setLoadScript(() => m.LoadScript);
972
- setTimeout(() => {
973
- setReady(true);
974
- }, 200);
975
- });
976
- }
977
- else {
978
- setReady(true);
979
- }
980
- }, []);
981
- if (!ready)
982
- return (React__default.createElement("div", { style: {
983
- height: 73,
984
- } }));
985
- return (React__default.createElement(React__default.Fragment, null,
986
- LoadScript && (React__default.createElement(LoadScript, { googleMapsApiKey: GOOGLE_API_KEY, libraries: libraries$1, loadingElement: React__default.createElement(React__default.Fragment, null) })),
987
- React__default.createElement("div", { style: { display: 'none' }, "data-extra": true, "data-name": name, "data-control": 'text' }),
988
- React__default.createElement(Select, Object.assign({ className: "lead-modal__form-control", label: placeholder, placeholder: placeholder, withAsterisk: required, name: name, data: options, searchValue: searchValue, onSearchChange: (query) => {
989
- setSearchValue(query);
990
- }, filter: () => true, clearable: true, searchable: true, onChange: (val) => setAddress(val || ''), icon: React__default.createElement("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none" },
991
- React__default.createElement("path", { d: "M10 9.792q.605 0 1.032-.427.426-.428.426-1.032 0-.603-.426-1.031A1.4 1.4 0 0 0 10 6.875q-.604 0-1.032.427a1.4 1.4 0 0 0-.426 1.031q0 .604.426 1.032.428.426 1.032.427m0 8.083q-.145 0-.292-.042a.7.7 0 0 1-.27-.145Q6.478 15 5.01 12.708 3.54 10.418 3.54 8.5q0-3.021 1.949-4.823T10 1.875t4.51 1.802q1.95 1.802 1.949 4.823 0 1.917-1.468 4.208-1.47 2.292-4.427 4.98a.7.7 0 0 1-.271.145 1 1 0 0 1-.292.042", fill: "#8C8C8C" })), autoComplete: 'no-auto-complete-' + randRef.current, rightSection: React__default.createElement(React__default.Fragment, null) }, form.getInputProps(name)))));
820
+ var msMY = {
821
+ "validator.required": "Bahagian ini wajib diisi.",
822
+ "validator.email": "Sila masukkan alamat emel yang sah.",
823
+ "validator.number": "Sila masukkan no telefon yang sah.",
824
+ "validator.digits": "Sila masukkan nombor digit sahaja.",
825
+ "validator.maxlength": "Sila masukkan tidak lebih dari {0} aksara",
826
+ "validator.minlength": "Sila masukkan sekurang-kurangnya {0} aksara",
827
+ "validator.phone": "Sila masukkan no telefon yang sah.",
828
+ "validator.emailUsed": "Emel sudah digunakan untuk kempen ini.",
829
+ "validator.phoneUsed": "Nombor telefon anda sudah digunakan untuk kempen ini.",
830
+ "validator.dateInvalid": "Tarikh ini tidak sah, sila kemas kini",
831
+ "lead.otp.title": "Masukkan OTP",
832
+ "lead.otp.desc": "Kami telah menghantar OTP ke nombor telefon bimbit anda {phone}",
833
+ "lead.otp.verify": "Sahkan",
834
+ "lead.otp.resend": "Hantar semula OTP {timer}",
835
+ "lead.otp.phoneLabel": "OTP Telefon",
836
+ "lead.otp.phonePlaceholder": "Masukkan OTP",
837
+ "lead.empty.title": "Oops, nampaknya maklumat anda kosong. Adakah anda ingin menghantar maklumat semula?",
838
+ "lead.empty.cancel": "Batal",
839
+ "lead.empty.submitAgain": "Hantar semula",
840
+ "inlineFreebie.freeSample.title": "Sampel Percuma",
841
+ "inlineFreebie.luckyDrawGift.title": "Hadiah Undian",
842
+ "inlineFreebie.value": "Nilai",
843
+ "common.day": "Hari",
844
+ "common.month": "Bulan",
845
+ "common.year": "Tahun"
992
846
  };
993
847
 
994
- const SubtitleBlock$1 = ({ children, align, }) => (React__default.createElement("p", { className: `lead-modal__description ${'le-text-align-' + (align || '')} ${LEAD_CLASS}` }, children));
848
+ var myMM = {
849
+ "validator.required": "ဒီနေရာမှာ ဖြည့်ဖို့ လိုအပ်ပါတယ်",
850
+ "validator.email": "မှန်ကန်သော အီးမေးလ်လိပ်စာထည့်သွင်းပါ",
851
+ "validator.number": "မှန်ကန်သော ဖုန်းနံပါတ်ထည့်သွင်းပါ",
852
+ "validator.digits": "နံပါတ်များသာဖြည့်ပါ",
853
+ "validator.maxlength": "ကျေးဇူးပြု၍ {0} ထပ်မပိုသော ဂဏန်းများသာဖြည့်ပါ",
854
+ "validator.minlength": "ကျေးဇူးပြု၍ အနည်းဆုံး {0} ဂဏန်းဖြည့်ပါ",
855
+ "validator.phone": "မှန်ကန်သော ဖုန်းနံပါတ်ထည့်သွင်းပါ",
856
+ "validator.emailUsed": "ဤအေကာင့်အတွက် အီးမေးလ်ကို အသုံးပြုပြီးဖြစ်ပါသည်။",
857
+ "validator.phoneUsed": "ဤအေကာင့်အတွက် သင့်ဖုန်းနံပါတ်ကို အသုံးပြုပြီးဖြစ်ပါသည်။",
858
+ "validator.dateInvalid": "ယနေ့စွဲမှားနေသည်၊ ကျေးဇူးပြု၍ ပြင်ဆင်ပါ။",
859
+ "lead.otp.title": "OTP ကိုထည့်ပါ",
860
+ "lead.otp.desc": "ကျွန်ုပ်တို့သည် OTP ကိုသင့်ဖုန်းနံပါတ် {phone} သို့ပို့ခဲ့သည်",
861
+ "lead.otp.verify": "အတည်ပြုပါ",
862
+ "lead.otp.resend": "OTP ကိုထပ်မံပို့ရန် {timer}",
863
+ "lead.otp.phoneLabel": "ဖုန်း OTP",
864
+ "lead.otp.phonePlaceholder": "OTP ကိုထည့်ပါ",
865
+ "lead.empty.title": "အုပ်စ်! သင့်အချက်အလက်သည် ဗလာဖြစ်နေသလိုဖြစ်သည်။ ထပ်မံတင်သွင်းလိုပါသလား?",
866
+ "lead.empty.cancel": "မလုပ်ဆောင်ပါ",
867
+ "lead.empty.submitAgain": "ထပ်မံတင်သွင်းပါ",
868
+ "inlineFreebie.freeSample.title": "အခမဲ့အစားအစာ",
869
+ "inlineFreebie.luckyDrawGift.title": "အခမဲ့အစားအစာ",
870
+ "inlineFreebie.value": "တန်ဖိုး",
871
+ "common.day": "ရက်",
872
+ "common.month": "လ",
873
+ "common.year": "နှစ်"
874
+ };
995
875
 
996
- const TitleBlock$1 = ({ children, align, }) => (React__default.createElement("h2", { className: `lead-modal__title ${'le-text-align-' + (align || '')} ${LEAD_CLASS}` }, children));
876
+ var thTH = {
877
+ "validator.required": "ต้องระบุข้อมูลในช่องนี้",
878
+ "validator.email": "กรุณาใส่อีเมล์ที่ถูกต้อง",
879
+ "validator.number": "กรุณาใส่ตัวเลขที่ถูกต้อง",
880
+ "validator.digits": "กรุณาส่เฉพาะตัวเลข",
881
+ "validator.maxlength": "กรุณาใส่ตัวเลขมากกว่า {0} หลัก",
882
+ "validator.minlength": "กรุณาใส่ตัวเลขอย่างน้อย {0} หลัก",
883
+ "validator.phone": "กรุณาใส่ตัวเลขที่ถูกต้อง",
884
+ "validator.emailUsed": "อีเมลนี้ถูกใช้สำหรับแคมเปญนี้แล้ว",
885
+ "validator.phoneUsed": "หมายเลขโทรศัพท์ของคุณถูกใช้สำหรับแคมเปญนี้แล้ว",
886
+ "validator.dateInvalid": "วันที่นี้ไม่ถูกต้อง โปรดอัปเดต",
887
+ "lead.otp.title": "ป้อน OTP",
888
+ "lead.otp.desc": "เราได้ส่ง OTP ไปยังหมายเลขโทรศัพท์มือถือของคุณ {phone}",
889
+ "lead.otp.verify": "ยืนยัน",
890
+ "lead.otp.resend": "ส่ง OTP อีกครั้ง {timer}",
891
+ "lead.otp.phoneLabel": "OTP โทรศัพท์",
892
+ "lead.otp.phonePlaceholder": "ป้อน OTP",
893
+ "lead.empty.title": "อุ๊ปส์! ดูเหมือนว่าข้อมูลของคุณว่างเปล่า คุณต้องการส่งข้อมูลอีกครั้งหรือไม่?",
894
+ "lead.empty.cancel": "ยกเลิก",
895
+ "lead.empty.submitAgain": "ส่งอีกครั้ง",
896
+ "inlineFreebie.freeSample.title": "ตัวอย่างฟรี",
897
+ "inlineFreebie.luckyDrawGift.title": "ของรางวัลที่ถูกรางวัล",
898
+ "inlineFreebie.value": "ค่า",
899
+ "common.day": "วัน",
900
+ "common.month": "เดือน",
901
+ "common.year": "ปี"
902
+ };
997
903
 
998
- const Fields = ({ listBlockAdded, popupId, locale, onClose, onOtherSubmit, styles, classNames, popoverProps, }) => {
999
- const { primaryColor } = useContext(LeadGenContext$1);
1000
- const { classes, cx } = useStyles$3(undefined, {
1001
- name: 'LeadGen__Field',
1002
- styles,
1003
- classNames,
1004
- });
1005
- const form = useLeadFormContext$1();
1006
- return (React__default.createElement(React__default.Fragment, null, listBlockAdded.map((b, index) => {
1007
- var _a;
1008
- const { name = '', data = {} } = b || {};
1009
- const { placeholder, value, align, listQuestion, isSendMailChimp = false, newtab, url, } = data;
1010
- const required = (_a = data.required) !== null && _a !== void 0 ? _a : true;
1011
- switch (name) {
1012
- case 'TitleBlock':
1013
- return (React__default.createElement(TitleBlock$1, { key: index, align: align }, value));
1014
- case 'SubtitleBlock':
1015
- return (React__default.createElement(SubtitleBlock$1, { key: index, align: align }, value));
1016
- case 'TextBlock':
1017
- return (React__default.createElement(Input, Object.assign({ key: index, withAsterisk: required, spellCheck: false, type: "text", placeholder: placeholder, className: cx('leadgen-control', classes.control),
1018
- // onChangeRaw={(e) => inputOnChange('text', e)}
1019
- label: placeholder, "data-control": "text", "data-lead-control": name, "data-is-required": required, name: value }, form.getInputProps(value))));
1020
- case 'NumberBlock':
1021
- return (React__default.createElement(NumberInput, Object.assign({ key: index, withAsterisk: required, spellCheck: false, type: "number", placeholder: placeholder, className: cx('leadgen-control', classes.control),
1022
- // onChange={(e) => inputOnChange('number', e)}
1023
- label: placeholder, "data-control": "number", "data-lead-control": name, "data-is-required": required, name: value }, form.getInputProps(value))));
1024
- case 'EmailBlock':
1025
- return (React__default.createElement(Input, Object.assign({ key: index, withAsterisk: required, spellCheck: false,
1026
- // type="email"
1027
- placeholder: placeholder, className: cx('leadgen-control', classes.control), label: placeholder, "data-control": "email", "data-lead-control": name, "data-is-required": required, name: value }, form.getInputProps(value))));
1028
- case 'PhoneOtpBlock':
1029
- case 'WhatsappOtpBlock':
1030
- case 'ZaloOtpBlock':
1031
- case 'PhoneBlock': {
1032
- const id = popupId + '-' + value + '-' + index;
1033
- return (React__default.createElement(Input.Wrapper, Object.assign({ size: "md", withAsterisk: required, key: index, label: placeholder,
1034
- // error={errorField.phone}
1035
- className: cx('leadgen-control', classes.control), labelProps: {
1036
- htmlFor: id,
1037
- } }, form.getInputProps(value)),
1038
- React__default.createElement(Phone, { name: value, spellCheck: false, type: "tel", placeholder: placeholder, value: form.getInputProps(value).value, onChange: (v) => {
1039
- form.setFieldValue(value, v);
1040
- },
1041
- // onBlur={(e) => inputOnBlur('tel', e)}
1042
- id: id, defaultCountry: (locale ? MAPPED_LOCALE[locale] || 'VN' : 'VN'), "data-control": "tel", "data-lead-control": name, "data-is-required": required })));
1043
- }
1044
- case 'LocationBlock': {
1045
- return (React__default.createElement(LocationBlock, { key: index, name: value, placeholder: placeholder, locale: locale, required: required }));
1046
- }
1047
- case 'DateBlock':
1048
- return (React__default.createElement(React__default.Fragment, null,
1049
- React__default.createElement(DatePicker, Object.assign({ withAsterisk: required, key: index, type: "default", name: value, placeholder: placeholder, className: cx('leadgen-control', classes.control), label: placeholder, "data-control": "date", "data-lead-control": name, "data-is-required": required, popoverProps: popoverProps }, form.getInputProps(value))),
1050
- React__default.createElement("input", { type: "hidden", name: value, "data-control": "date" })));
1051
- case 'LinkButtonBlock':
1052
- return (React__default.createElement("div", { key: index },
1053
- React__default.createElement("a", { target: newtab ? 'blank' : 'parrent', href: url, style: { textDecoration: 'none' } },
1054
- React__default.createElement(Button, { type: "button", size: "md", color: primaryColor, className: `lead-modal__btn ${LEAD_CLASS}`, onClick: () => {
1055
- onClose === null || onClose === void 0 ? void 0 : onClose();
1056
- onOtherSubmit === null || onOtherSubmit === void 0 ? void 0 : onOtherSubmit();
1057
- } }, value))));
1058
- case 'CheckboxBlock':
1059
- return (React__default.createElement(React__default.Fragment, null,
1060
- isSendMailChimp && (React__default.createElement("div", { style: {
1061
- display: 'none',
1062
- }, "data-name": value + '-mailchimp' })),
1063
- React__default.createElement(Checkbox.Group, Object.assign({ withAsterisk: required, className: cx('leadgen-control', classes.control), key: index, label: placeholder, size: "md", sx: {
1064
- display: 'flex',
1065
- flexDirection: 'column',
1066
- gap: 8,
1067
- } }, form.getInputProps(value)), listQuestion.map((l, _index) => (React__default.createElement(Checkbox, { name: value, key: _index, value: l.value, label: l.placeholder, "data-control": "checkbox", "data-lead-control": name, "data-is-required": required }))))));
1068
- case 'RadioBlock':
1069
- return (React__default.createElement(React__default.Fragment, null,
1070
- isSendMailChimp && (React__default.createElement(Input, { type: "hidden", name: value + '-mailchimp', value: isSendMailChimp })),
1071
- React__default.createElement(Radio.Group, Object.assign({ withAsterisk: required, className: cx('leadgen-control', classes.control), key: index, label: placeholder, size: "md" }, form.getInputProps(value)), listQuestion.map((l, _index) => (React__default.createElement(Radio, { name: value, key: _index, value: l.value, label: l.placeholder, "data-control": "radio", "data-lead-control": name, "data-is-required": required }))))));
1072
- case 'DropdownBlock':
1073
- return (React__default.createElement(React__default.Fragment, null,
1074
- React__default.createElement("div", { style: { display: 'none' }, "data-extra": true, "data-name": value, "data-control": 'dropdown', "data-lead-control": name, "data-is-required": required }),
1075
- React__default.createElement(Select, Object.assign({ key: index, className: cx('leadgen-control', classes.control), label: placeholder, withAsterisk: required, name: value, data: listQuestion.map((l) => ({
1076
- value: l.value,
1077
- label: l.placeholder,
1078
- })) }, form.getInputProps(value)))));
1079
- case 'TncBlock':
1080
- const tncInputProps = form.getInputProps('TNC-' + b.id);
1081
- return (React__default.createElement(React__default.Fragment, null,
1082
- React__default.createElement(Checkbox, Object.assign({ name: 'TNC-' + b.id, key: b.id, label: React__default.createElement("p", { className: "lead-modal__tnc-link", dangerouslySetInnerHTML: { __html: data.valueHTML } }), className: "tnc-block", "data-control": "checkbox", "data-lead-control": name, "data-is-required": required }, tncInputProps, { error: tncInputProps.error ? tncInputProps.error : undefined }))));
1083
- }
1084
- return null;
1085
- })));
904
+ var viVN = {
905
+ "validator.required": "Vui lòng điền mục này",
906
+ "validator.email": "Vui lòng điền email thật.",
907
+ "validator.number": "Vui lòng điền số có thật",
908
+ "validator.digits": "Vui lòng chỉ điền số",
909
+ "validator.maxlength": "Vui lòng điền dưới {0} số",
910
+ "validator.minlength": "Vui lòng điền hơn {0} số",
911
+ "validator.remote": "Hãy sửa cho đúng.",
912
+ "validator.url": "Hãy nhập URL.",
913
+ "validator.date": "Hãy nhập ngày.",
914
+ "validator.dateISO": "Hãy nhập ngày (ISO).",
915
+ "validator.creditcard": "Hãy nhập số thẻ tín dụng.",
916
+ "validator.equalTo": "Hãy nhập thêm lần nữa.",
917
+ "validator.extension": "Phần mở rộng không đúng.",
918
+ "validator.rangelength": "Hãy nhập từ {0} đến {1} kí tự.",
919
+ "validator.range": "Hãy nhập từ {0} đến {1}.",
920
+ "validator.max": "Hãy nhập từ {0} trở xuống.",
921
+ "validator.min": "Hãy nhập từ {0} trở lên.",
922
+ "validator.phone": "Nhập đúng định dạng số điện thoại",
923
+ "validator.emailUsed": "Email này đã được sử dụng.",
924
+ "validator.phoneUsed": "Số điện thoại này đã được sử dụng.",
925
+ "validator.dateInvalid": "Ngày này không hợp lệ, vui lòng cập nhật.",
926
+ "lead.otp.title": "Nhập OTP",
927
+ "lead.otp.desc": "Chúng tôi đã gửi OTP đến số điện thoại của bạn {phone}",
928
+ "lead.otp.verify": "Xác minh",
929
+ "lead.otp.resend": "Gửi lại OTP {timer}",
930
+ "lead.otp.phoneLabel": "Nhập OTP",
931
+ "lead.otp.phonePlaceholder": "Nhập OTP",
932
+ "lead.empty.title": "Oops, có vẻ như thông tin của bạn đang trống. Bạn có muốn gửi lại thông tin không?",
933
+ "lead.empty.cancel": "Hủy",
934
+ "lead.empty.submitAgain": "Gửi lại",
935
+ "inlineFreebie.freeSample.title": "Dùng thử miễn phí",
936
+ "inlineFreebie.luckyDrawGift.title": "Phần thưởng may mắn",
937
+ "inlineFreebie.value": "Trị giá",
938
+ "common.day": "Ngày",
939
+ "common.month": "Tháng",
940
+ "common.year": "Năm"
1086
941
  };
1087
942
 
1088
- var useStyles$2 = createStyles((theme) => {
1089
- return {
1090
- root: {},
1091
- header: {},
1092
- heading: {},
1093
- description: {},
1094
- term: {
1095
- a: {
1096
- color: theme.fn.primaryColor(),
1097
- },
1098
- },
1099
- controlList: {},
1100
- control: {},
1101
- submitBtn: {},
1102
- submitBtnWrapper: {},
1103
- };
1104
- });
943
+ var zhTW = {
944
+ "validator.required": "此為必填欄位",
945
+ "validator.email": "請填入有效的 email 地址",
946
+ "validator.number": "請填入有效的電話號碼",
947
+ "validator.digits": "此欄位僅能輸入數字",
948
+ "validator.maxlength": "請輸入少於 {0} 位數",
949
+ "validator.minlength": "請輸入至少 {0} 位數",
950
+ "validator.phone": "請填入有效的電話號碼",
951
+ "validator.emailUsed": "此電子郵件已被使用於此活動。",
952
+ "validator.phoneUsed": "您的手機號碼已被使用於此活動。",
953
+ "validator.dateInvalid": "此日期無效,請更新.",
954
+ "lead.otp.title": "輸入 OTP",
955
+ "lead.otp.desc": "我們已將 OTP 發送到您的手機號碼 {phone}",
956
+ "lead.otp.verify": "驗證",
957
+ "lead.otp.resend": "重新發送 OTP {timer}",
958
+ "lead.otp.phoneLabel": "電話 OTP",
959
+ "lead.otp.phonePlaceholder": "輸入 OTP",
960
+ "lead.empty.title": "哎呀,您的資訊似乎是空的,您想要重新提交資訊嗎?",
961
+ "lead.empty.cancel": "取消",
962
+ "lead.empty.submitAgain": "重新提交",
963
+ "inlineFreebie.freeSample.title": "免費試用",
964
+ "inlineFreebie.luckyDrawGift.title": "幸運抽獎禮品",
965
+ "inlineFreebie.value": "價值",
966
+ "common.day": "日",
967
+ "common.month": "月",
968
+ "common.year": "年"
969
+ };
1105
970
 
1106
- const Heading = (_a) => {
1107
- var rest = __rest(_a, []);
1108
- const { heading } = useContext(LeadGenComponentContext);
1109
- return heading ? (React__default.createElement(Text, Object.assign({ size: "h3" }, rest), heading)) : null;
971
+ const translationsMap = {
972
+ 'en-PH': enPH,
973
+ 'vi-VN': viVN,
974
+ 'hi-IN': hiIN,
975
+ 'id-ID': idID,
976
+ 'ms-MY': msMY,
977
+ 'my-MM': myMM,
978
+ 'km-KH': kmKH,
979
+ 'zh-TW': zhTW,
980
+ 'zh-SG': zhTW,
981
+ 'th-TH': thTH,
982
+ 'tl-PH': enPH,
983
+ };
984
+ const getTranslations = (locale) => {
985
+ const translations = Object.assign(Object.assign({}, translationsMap$1[locale]), translationsMap[locale]);
986
+ if (translations) {
987
+ return translations;
988
+ }
989
+ return translationsMap['en-PH'];
1110
990
  };
1111
991
 
1112
- const FormComponent = ({ styles, className, classNames, fillInfo, popoverProps, submitProps, }) => {
1113
- var _a;
1114
- const { primaryColor } = useContext(LeadGenContext$1);
1115
- const { listBlockAdded, leadFormConfig: { form, validateObj }, validatingEmailRef, validatingPhoneRef,
1116
- // formRef,
1117
- setFormRef, onClose, onOtherSubmit, actionBlocks, locale, setShowOtpPhone, onSubmit, } = useContext(LeadGenComponentContext);
1118
- const { classes, cx } = useStyles$2(undefined, {
1119
- name: 'LeadGen__FormComponent',
1120
- styles,
1121
- classNames,
1122
- });
1123
- const [isSubmitLoading, setIsSubmitLoading] = useState(false);
1124
- const popUpSubmitText = actionBlocks.submitBlock.data.value;
1125
- const middlewareOnSubmit = (e) => {
1126
- e.preventDefault();
1127
- // mark all as touched to allow validation
1128
- form.setTouched(Object.keys(validateObj).reduce((acc, cur) => {
1129
- acc[cur] = true;
1130
- return acc;
1131
- }, {}));
1132
- if (validatingEmailRef.current || validatingPhoneRef.current) {
1133
- return;
992
+ const FormatMessageContext = createContext(null);
993
+ const LeadGenTranslationProvider = ({ locale, formatMessage, children, }) => {
994
+ const translationContextValue = useMemo(() => ({ locale, values: getTranslations(locale) }), [locale]);
995
+ return (React__default.createElement(FormatMessageContext.Provider, { value: formatMessage || null }, formatMessage ? (children) : (React__default.createElement(TranslationsContext.Provider, { value: translationContextValue }, children))));
996
+ };
997
+ const useLeadGenTranslations = () => {
998
+ const externalFormatMessage = useContext(FormatMessageContext);
999
+ const { t: internalT, locale } = useTranslations();
1000
+ const t = useMemo(() => {
1001
+ if (externalFormatMessage) {
1002
+ return (key, options) => {
1003
+ return externalFormatMessage({ id: key, defaultMessage: key }, options);
1004
+ };
1134
1005
  }
1135
- setTimeout(() => {
1136
- form.onSubmit((v) => {
1137
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
1138
- if (Object.keys(form.errors).length)
1006
+ return internalT;
1007
+ }, [externalFormatMessage, internalT]);
1008
+ return { t, locale };
1009
+ };
1010
+
1011
+ // You can give context variables any name
1012
+ const [LeadFormProvider$1, useLeadFormContext$1, useLeadForm$1] = createFormContext();
1013
+ const useLeadFormConfig$1 = ({ listBlockAdded = [], validatingPhoneRef, validatingEmailRef, campaignId, campaign_subot_id = [], userInfo, }) => {
1014
+ const { t } = useLeadGenTranslations();
1015
+ const initialValues = useMemo(() => formatLeadGenFormValue(mappingSSOToLead(userInfo), listBlockAdded), [userInfo === null || userInfo === void 0 ? void 0 : userInfo.id]);
1016
+ useEffect(() => {
1017
+ if (!window.intlTelInputUtils) {
1018
+ require('intl-tel-input/build/js/utils');
1019
+ }
1020
+ }, []);
1021
+ const validateObj = useMemo(() => {
1022
+ const InputBlocks = [
1023
+ 'TextBlock',
1024
+ 'NumberBlock',
1025
+ 'EmailBlock',
1026
+ 'PhoneBlock',
1027
+ 'DateBlock',
1028
+ 'CheckboxBlock',
1029
+ 'RadioBlock',
1030
+ 'DropdownBlock',
1031
+ 'PhoneOtpBlock',
1032
+ 'WhatsappOtpBlock',
1033
+ 'ZaloOtpBlock',
1034
+ 'LocationBlock',
1035
+ 'TncBlock',
1036
+ ];
1037
+ // ALL are required and can skip if not touched yet
1038
+ const withSharedCheck = (name, cb,
1039
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1040
+ block) => {
1041
+ return (value) => {
1042
+ var _a;
1043
+ const isBLockRequired = (_a = block === null || block === void 0 ? void 0 : block.data) === null || _a === void 0 ? void 0 : _a.required;
1044
+ if (!formRef.current.isTouched(name))
1139
1045
  return;
1140
- let newShowOtpPhone = null;
1141
- if (listBlockAdded.findIndex((x) => x.name === 'PhoneOtpBlock') > -1) {
1142
- // not submit yet, open otp
1143
- const fieldName = (_b = (_a = listBlockAdded.find((x) => x.name === 'PhoneOtpBlock')) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.value;
1144
- if ((_c = v[fieldName]) === null || _c === void 0 ? void 0 : _c.startsWith('+')) {
1145
- newShowOtpPhone = {
1146
- phone: v[fieldName],
1147
- type: 'phone',
1148
- };
1149
- }
1046
+ if (typeof value === 'undefined' ||
1047
+ value === '' ||
1048
+ (Array.isArray(value) && value.length === 0)) {
1049
+ return isBLockRequired
1050
+ ? t('validator.required')
1051
+ : cb === null || cb === void 0 ? void 0 : cb(value);
1150
1052
  }
1151
- if (listBlockAdded.findIndex((x) => x.name === 'WhatsappOtpBlock') > -1) {
1152
- // not submit yet, open otp
1153
- const fieldName = (_e = (_d = listBlockAdded.find((x) => x.name === 'WhatsappOtpBlock')) === null || _d === void 0 ? void 0 : _d.data) === null || _e === void 0 ? void 0 : _e.value;
1154
- if ((_f = v[fieldName]) === null || _f === void 0 ? void 0 : _f.startsWith('+')) {
1155
- newShowOtpPhone = {
1156
- phone: v[fieldName],
1157
- type: 'whatsapp',
1158
- };
1159
- }
1160
- }
1161
- if (listBlockAdded.findIndex((x) => x.name === 'ZaloOtpBlock') > -1) {
1162
- // not submit yet, open otp
1163
- const fieldName = (_h = (_g = listBlockAdded.find((x) => x.name === 'ZaloOtpBlock')) === null || _g === void 0 ? void 0 : _g.data) === null || _h === void 0 ? void 0 : _h.value;
1164
- if ((_j = v[fieldName]) === null || _j === void 0 ? void 0 : _j.startsWith('+')) {
1165
- newShowOtpPhone = {
1166
- phone: v[fieldName],
1167
- type: 'zalo',
1168
- };
1169
- }
1170
- }
1171
- if (newShowOtpPhone) {
1172
- setIsSubmitLoading(true);
1173
- Service.sendSMSOtpLead(newShowOtpPhone)
1174
- .then((res) => {
1175
- var _a;
1176
- const respMessage = (_a = res === null || res === void 0 ? void 0 : res._messages) === null || _a === void 0 ? void 0 : _a[0];
1177
- if (respMessage === 'This phone number was verified') {
1178
- onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit();
1053
+ return cb === null || cb === void 0 ? void 0 : cb(value);
1054
+ };
1055
+ };
1056
+ return listBlockAdded
1057
+ .filter((b) => InputBlocks.includes(b.name))
1058
+ .reduce((r, b) => {
1059
+ var _a;
1060
+ const isRequired = (_a = b.data.required) !== null && _a !== void 0 ? _a : true;
1061
+ if (b.name === 'NumberBlock') {
1062
+ return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, (value) => {
1063
+ if (value && isNaN(Number(value))) {
1064
+ return t('validator.number');
1065
+ }
1066
+ }, b) });
1067
+ }
1068
+ else if (b.name === 'EmailBlock') {
1069
+ return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, (value) => {
1070
+ if (value && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value)) {
1071
+ return t('validator.email');
1072
+ }
1073
+ if (!value)
1179
1074
  return;
1075
+ validatingEmailRef.current = true;
1076
+ setTimeout(() => {
1077
+ formRef.current.setFieldError(b.data.value, 'Validating...');
1078
+ checkUsedEmailOrPhoneWithCache(campaignId, campaign_subot_id, {
1079
+ email: value,
1080
+ })
1081
+ .then((tKey) => {
1082
+ if (tKey) {
1083
+ formRef.current.setFieldError(b.data.value, t(tKey));
1084
+ }
1085
+ else {
1086
+ formRef.current.clearFieldError(b.data.value);
1087
+ }
1088
+ validatingEmailRef.current = false;
1089
+ })
1090
+ .catch((e) => {
1091
+ console.error(e);
1092
+ formRef.current.setFieldError(b.data.value, e.message || 'Something went wrong');
1093
+ validatingEmailRef.current = false;
1094
+ });
1095
+ }, 200);
1096
+ }, b) });
1097
+ }
1098
+ else if (b.name === 'PhoneBlock' ||
1099
+ b.name === 'PhoneOtpBlock' ||
1100
+ b.name === 'ZaloOtpBlock' ||
1101
+ b.name === 'WhatsappOtpBlock') {
1102
+ return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, (value) => {
1103
+ if (value &&
1104
+ window.intlTelInputUtils &&
1105
+ !window.intlTelInputUtils.isValidNumber(String(value), LEAD_LOCALE.countryCode)) {
1106
+ return t('validator.phone');
1180
1107
  }
1181
- setShowOtpPhone(newShowOtpPhone);
1182
- })
1183
- .finally(() => {
1184
- setIsSubmitLoading(false);
1185
- });
1186
- return;
1187
- }
1188
- onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit();
1189
- })(e);
1190
- }, 100);
1108
+ if (!value)
1109
+ return;
1110
+ validatingPhoneRef.current = true;
1111
+ setTimeout(() => {
1112
+ formRef.current.setFieldError(b.data.value, 'Validating...');
1113
+ if (b.data.singleSubmission) {
1114
+ checkUsedPhoneOnlyWithCache(campaignId, value)
1115
+ .then((tKey) => {
1116
+ if (tKey) {
1117
+ formRef.current.setFieldError(b.data.value, t(tKey));
1118
+ }
1119
+ else {
1120
+ formRef.current.clearFieldError(b.data.value);
1121
+ }
1122
+ validatingPhoneRef.current = false;
1123
+ })
1124
+ .catch((err) => {
1125
+ console.error(err);
1126
+ formRef.current.setFieldError(b.data.value, err.message || 'Something went wrong');
1127
+ validatingPhoneRef.current = false;
1128
+ });
1129
+ }
1130
+ else {
1131
+ checkUsedEmailOrPhoneWithCache(campaignId, campaign_subot_id, {
1132
+ phone: value,
1133
+ })
1134
+ .then((tKey) => {
1135
+ if (tKey) {
1136
+ formRef.current.setFieldError(b.data.value, t(tKey));
1137
+ }
1138
+ else {
1139
+ formRef.current.clearFieldError(b.data.value);
1140
+ }
1141
+ validatingPhoneRef.current = false;
1142
+ })
1143
+ .catch((e) => {
1144
+ console.error(e);
1145
+ formRef.current.setFieldError(b.data.value, e.message || 'Something went wrong');
1146
+ validatingPhoneRef.current = false;
1147
+ });
1148
+ }
1149
+ }, 200);
1150
+ }, b) });
1151
+ }
1152
+ else if (b.name === 'DateBlock') {
1153
+ return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, (value) => {
1154
+ if (value && isNaN(Date.parse(value))) {
1155
+ return t('validator.date');
1156
+ }
1157
+ }, b) });
1158
+ }
1159
+ else if (b.name === 'TncBlock') {
1160
+ return Object.assign(Object.assign({}, r), { [`TNC-` + b.id]: withSharedCheck('TNC-' + b.id, (value) => {
1161
+ if (isRequired && !value) {
1162
+ return t('validator.required');
1163
+ }
1164
+ }, b) });
1165
+ }
1166
+ else {
1167
+ return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, undefined, b) });
1168
+ }
1169
+ }, {});
1170
+ }, [listBlockAdded.map((b) => b.name).join(',')]);
1171
+ const form = useLeadForm$1({
1172
+ validateInputOnChange: true,
1173
+ clearInputErrorOnChange: true,
1174
+ validate: validateObj,
1175
+ initialValues,
1176
+ });
1177
+ const formRef = useRef(form);
1178
+ formRef.current = form;
1179
+ return { form, validateObj };
1180
+ };
1181
+
1182
+ const Component = ({ campaign, onClose: onCloseProp, onOtherSubmit, onSubmit, showThankyou, setShowThankyou, locale, children, showEmpty, setShowEmpty, userInfo, }) => {
1183
+ var _a, _b;
1184
+ const extraFields = campaign.extra_fields;
1185
+ const campaignId = campaign.id;
1186
+ const campaign_subot_id = campaign.bot_id || [];
1187
+ const listBlockAdded = JSON.parse(extraFields.listBlockAdded);
1188
+ const actionBlocks = JSON.parse(extraFields.actionBlocks);
1189
+ const textBlocks = JSON.parse(extraFields.textBlocks);
1190
+ const heading = ((_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) || '';
1191
+ const description = textBlocks.subtitleBlock.data.value;
1192
+ const validatingPhoneRef = useRef(false);
1193
+ const validatingEmailRef = useRef(false);
1194
+ const leadFormConfig = useLeadFormConfig$1({
1195
+ listBlockAdded,
1196
+ validatingPhoneRef,
1197
+ validatingEmailRef,
1198
+ campaignId,
1199
+ campaign_subot_id,
1200
+ userInfo,
1201
+ });
1202
+ const [showOtpPhone, setShowOtpPhone] = useState(null);
1203
+ const [formRef, setFormRef] = useState(null);
1204
+ const onClose = () => {
1205
+ if (showOtpPhone) {
1206
+ setShowOtpPhone(null);
1207
+ }
1208
+ else {
1209
+ onCloseProp === null || onCloseProp === void 0 ? void 0 : onCloseProp();
1210
+ }
1191
1211
  };
1192
1212
  useEffect(() => {
1193
- form === null || form === void 0 ? void 0 : form.setValues(fillInfo);
1194
- }, [fillInfo]);
1195
- return (React__default.createElement(LeadFormProvider$1, { form: form },
1196
- React__default.createElement(Box, { component: "form", ref: (el) => el && setFormRef(el), className: cx(className, classes.root), onSubmit: middlewareOnSubmit, styles: styles },
1197
- React__default.createElement("div", { className: classes.header },
1198
- React__default.createElement(Heading, { className: classes.heading }),
1199
- React__default.createElement(Description, { className: classes.description })),
1200
- React__default.createElement("div", { className: classes.controlList },
1201
- React__default.createElement(Fields, { classNames: {
1202
- control: classes.control,
1203
- }, listBlockAdded: listBlockAdded, locale: locale, onClose: onClose, onOtherSubmit: onOtherSubmit, popoverProps: popoverProps })),
1204
- ((_a = actionBlocks === null || actionBlocks === void 0 ? void 0 : actionBlocks.submitBlock) === null || _a === void 0 ? void 0 : _a.isHide) ? null : (React__default.createElement("div", { className: classes.submitBtnWrapper },
1205
- React__default.createElement(Button, Object.assign({ size: "md", id: "lead-submit", type: "submit", className: classes.submitBtn, loading: isSubmitLoading, color: primaryColor }, submitProps), popUpSubmitText))))));
1206
- };
1207
- const Form = (props) => {
1208
- const { showOtpPhone, showThankyou } = useContext(LeadGenComponentContext);
1209
- return showThankyou || showOtpPhone ? null : React__default.createElement(FormComponent, Object.assign({}, props));
1213
+ clearCacheUsedEmailOrPhone();
1214
+ }, []);
1215
+ return campaign ? (React__default.createElement(LeadGenComponentContext.Provider, { value: {
1216
+ campaignId,
1217
+ campaign_subot_id,
1218
+ heading,
1219
+ description,
1220
+ listBlockAdded,
1221
+ textBlocks,
1222
+ actionBlocks,
1223
+ leadFormConfig,
1224
+ validatingEmailRef,
1225
+ validatingPhoneRef,
1226
+ formRef: { current: formRef },
1227
+ setFormRef,
1228
+ locale,
1229
+ onClose,
1230
+ onOtherSubmit,
1231
+ showOtpPhone,
1232
+ setShowOtpPhone,
1233
+ onSubmit,
1234
+ showThankyou,
1235
+ setShowThankyou,
1236
+ showEmpty,
1237
+ setShowEmpty,
1238
+ } }, children)) : null;
1210
1239
  };
1211
1240
 
1212
- var useStyles$1 = createStyles(() => {
1241
+ const Description = (_a) => {
1242
+ var rest = __rest(_a, []);
1243
+ const { description } = useContext(LeadGenComponentContext);
1244
+ return description ? (React__default.createElement(Text, Object.assign({ size: "p3" }, rest), description)) : null;
1245
+ };
1246
+
1247
+ const LeadGenContext$1 = createContext({});
1248
+
1249
+ var useStyles$3 = createStyles(() => {
1213
1250
  return {
1214
- root: {},
1215
- header: {},
1216
- heading: {},
1217
- description: {},
1218
1251
  control: {},
1219
- actions: {},
1220
- submitBtn: {},
1221
- resendOtp: {},
1222
1252
  };
1223
1253
  });
1224
1254
 
1225
- const OtpBlockComponent = ({ otpData, onSuccess, autoSendWhenOpen, className, styles, classNames, }) => {
1226
- const { t } = useTranslations();
1227
- const phone = otpData.phone;
1228
- const otpType = otpData.type;
1229
- const [otp, setOtp] = useState('');
1230
- const [isDirty, setIsDirty] = useState(false);
1231
- const [resendTimer, setResendTimer] = useState(autoSendWhenOpen ? 0 : 60);
1232
- const inputRef = useRef(null);
1233
- const [errorMsg, setErrorMsg] = useState();
1234
- const [displayPhone, setDisplayPhone] = useState('');
1235
- const formatPhoneNumberIntlRef = useRef();
1236
- const [isSubmitLoading, setIsSubmitLoading] = useState(false);
1237
- const { classes, cx } = useStyles$1(undefined, {
1238
- name: 'LeadGen__OTP',
1239
- styles,
1240
- classNames,
1241
- });
1242
- useEffect(() => {
1243
- (() => __awaiter(void 0, void 0, void 0, function* () {
1244
- var _a;
1245
- if (!formatPhoneNumberIntlRef.current) {
1246
- const res = yield import('react-phone-number-input');
1247
- formatPhoneNumberIntlRef.current = res.formatPhoneNumberIntl;
1248
- }
1249
- setDisplayPhone(((_a = formatPhoneNumberIntlRef.current) === null || _a === void 0 ? void 0 : _a.call(formatPhoneNumberIntlRef, phone)) || phone);
1250
- }))();
1251
- }, [phone]);
1252
- const sendOtp = () => __awaiter(void 0, void 0, void 0, function* () {
1253
- var _a;
1254
- if (!phone) {
1255
- return;
1256
- }
1257
- const res = yield Service.sendSMSOtpLead({
1258
- phone,
1259
- type: otpType,
1260
- });
1261
- const respMessage = (_a = res === null || res === void 0 ? void 0 : res._messages) === null || _a === void 0 ? void 0 : _a[0];
1262
- if (respMessage === 'Send sms successfully' ||
1263
- respMessage === 'Send WhatsApp successfully' ||
1264
- respMessage === 'Send Zalo successfully') {
1265
- setResendTimer(60);
1266
- setTimeout(() => {
1267
- if (inputRef.current) {
1268
- inputRef.current.focus();
1269
- inputRef.current.scrollIntoView({ block: 'center' });
1270
- }
1271
- }, 100);
1272
- }
1273
- else if (respMessage === 'This phone number was verified') {
1274
- onSuccess();
1275
- }
1276
- else {
1277
- setErrorMsg(respMessage || 'Something went wrong!');
1278
- // const defaultError = f({ id: 'notification.comment.somethingWrong' })
1279
- // setStatusVerifyOTP('idle')
1280
- // pushNotifications({
1281
- // title: respMessage || defaultError,
1282
- // message: '',
1283
- // type: 'danger',
1284
- // })
1285
- }
1286
- });
1287
- const submitOtp = () => __awaiter(void 0, void 0, void 0, function* () {
1288
- if (!phone || !otp) {
1289
- return;
1290
- }
1291
- setIsSubmitLoading(true);
1292
- const res = yield Service.verifyOtpLead({
1293
- phone,
1294
- otp,
1295
- type: otpType,
1255
+ const libraries$1 = ['places'];
1256
+ const LocationBlock = ({ name, placeholder, locale, required = true, }) => {
1257
+ var _a;
1258
+ const form = useLeadFormContext$1();
1259
+ const [searchValue, setSearchValue] = useState('');
1260
+ const [address, setAddress] = useState('');
1261
+ const { predictions } = usePlacesAutocomplete(searchValue, '', locale === 'tl-PH' ? 'en' : (_a = locale === null || locale === void 0 ? void 0 : locale.split('-')) === null || _a === void 0 ? void 0 : _a[0]);
1262
+ const [LoadScript, setLoadScript] = useState(null);
1263
+ const [ready, setReady] = useState(false);
1264
+ const randRef = useRef(Math.random().toString(36).substring(7));
1265
+ const options = useMemo(() => {
1266
+ const _opts = predictions.map((p) => {
1267
+ return {
1268
+ value: p.description,
1269
+ label: p.description,
1270
+ };
1296
1271
  });
1297
- const respMessage = res === null || res === void 0 ? void 0 : res._messages[0];
1298
- if (respMessage === 'Verify successfully' ||
1299
- respMessage === 'Verify WhatsApp OTP sucess' ||
1300
- respMessage === 'Verify Zalo OTP sucess') {
1301
- onSuccess();
1272
+ const isExist = _opts.find((o) => o.value === address);
1273
+ if (!address || isExist) {
1274
+ return _opts;
1302
1275
  }
1303
- else if (respMessage === 'This phone number was verified') {
1304
- onSuccess();
1276
+ return [{ value: address, label: address }].concat(_opts);
1277
+ }, [predictions, address]);
1278
+ useEffect(() => {
1279
+ var _a, _b, _c;
1280
+ // only load extra google script when not yet loaded
1281
+ 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)) {
1282
+ import('@react-google-maps/api').then((m) => {
1283
+ setLoadScript(() => m.LoadScript);
1284
+ setTimeout(() => {
1285
+ setReady(true);
1286
+ }, 200);
1287
+ });
1305
1288
  }
1306
1289
  else {
1307
- setErrorMsg(respMessage || 'something Wrong');
1308
- // setIsShowError(true)
1309
- // setStatusVerifyOTP('sent')
1310
- // pushNotifications({
1311
- // title: res?._messages[0] || defaultError,
1312
- // message: '',
1313
- // type: 'danger',
1314
- // })
1315
- }
1316
- setIsSubmitLoading(false);
1317
- });
1318
- useEffect(() => {
1319
- setTimeout(() => {
1320
- if (resendTimer > 0) {
1321
- setResendTimer((r) => r - 1);
1322
- }
1323
- }, 1000);
1324
- }, [resendTimer]);
1325
- useEffect(() => {
1326
- if (autoSendWhenOpen && !resendTimer) {
1327
- sendOtp();
1290
+ setReady(true);
1328
1291
  }
1329
1292
  }, []);
1293
+ if (!ready)
1294
+ return (React__default.createElement("div", { style: {
1295
+ height: 73,
1296
+ } }));
1330
1297
  return (React__default.createElement(React__default.Fragment, null,
1331
- React__default.createElement(Box, { component: "form", onSubmit: (e) => {
1332
- e.preventDefault();
1333
- submitOtp();
1334
- }, className: cx(classes.root, className) },
1335
- React__default.createElement("div", { className: classes.header },
1336
- React__default.createElement(Heading$1, { tag: "h3", className: classes.heading }, t('lead.otp.title')),
1337
- React__default.createElement(Text, { size: "p3", className: classes.description }, t('lead.otp.desc', { phone: displayPhone }))),
1338
- React__default.createElement(Input, { ref: inputRef, name: '_' + name + '-otp', spellCheck: false, type: "number", placeholder: t('lead.otp.phonePlaceholder'), className: classes.control, label: t('lead.otp.phoneLabel'), "data-control": "otp", withAsterisk: true, pattern: "[0-9]*", value: otp, maxLength: 6, onChange: (v) => {
1339
- setIsDirty(true);
1340
- setOtp(v);
1341
- if (isDirty && !v)
1342
- setErrorMsg('OTP is required');
1343
- else
1344
- setErrorMsg(undefined);
1345
- }, error: isDirty ? errorMsg : undefined }),
1346
- React__default.createElement("div", { className: classes.actions },
1347
- React__default.createElement(Button, { type: "submit", size: "md", color: "primary", className: classes.submitBtn,
1348
- // onClick={() => submitOtp()}
1349
- disabled: !otp, loading: isSubmitLoading }, t('lead.otp.verify')),
1350
- React__default.createElement(Button, { type: "button", size: "md", color: "transparent", className: classes.resendOtp, onClick: () => {
1351
- sendOtp();
1352
- }, disabled: !!resendTimer }, t('lead.otp.resend', {
1353
- timer: resendTimer ? ` (${resendTimer}s)` : '',
1354
- }))))));
1355
- };
1356
- const OtpBlock$1 = (_a) => {
1357
- var rest = __rest(_a, []);
1358
- const { showOtpPhone, setShowOtpPhone, onSubmit,
1359
- // formRef,
1360
- // leadFormConfig: { form },
1361
- } = useContext(LeadGenComponentContext);
1362
- return showOtpPhone ? (React__default.createElement(OtpBlockComponent, Object.assign({ otpData: showOtpPhone, autoSendWhenOpen: false, onSuccess: () => {
1363
- setShowOtpPhone(null);
1364
- onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit();
1365
- } }, rest))) : null;
1366
- };
1367
-
1368
- const Thankyou = ({ children, }) => {
1369
- const { showThankyou, setShowThankyou } = useContext(LeadGenComponentContext);
1370
- return showThankyou
1371
- ? children(showThankyou, () => setShowThankyou(null))
1372
- : null;
1298
+ LoadScript && (React__default.createElement(LoadScript, { googleMapsApiKey: GOOGLE_API_KEY, libraries: libraries$1, loadingElement: React__default.createElement(React__default.Fragment, null) })),
1299
+ React__default.createElement("div", { style: { display: 'none' }, "data-extra": true, "data-name": name, "data-control": 'text' }),
1300
+ React__default.createElement(Select, Object.assign({ className: "lead-modal__form-control", label: placeholder, placeholder: placeholder, withAsterisk: required, name: name, data: options, searchValue: searchValue, onSearchChange: (query) => {
1301
+ setSearchValue(query);
1302
+ }, filter: () => true, clearable: true, searchable: true, onChange: (val) => setAddress(val || ''), icon: React__default.createElement("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none" },
1303
+ React__default.createElement("path", { d: "M10 9.792q.605 0 1.032-.427.426-.428.426-1.032 0-.603-.426-1.031A1.4 1.4 0 0 0 10 6.875q-.604 0-1.032.427a1.4 1.4 0 0 0-.426 1.031q0 .604.426 1.032.428.426 1.032.427m0 8.083q-.145 0-.292-.042a.7.7 0 0 1-.27-.145Q6.478 15 5.01 12.708 3.54 10.418 3.54 8.5q0-3.021 1.949-4.823T10 1.875t4.51 1.802q1.95 1.802 1.949 4.823 0 1.917-1.468 4.208-1.47 2.292-4.427 4.98a.7.7 0 0 1-.271.145 1 1 0 0 1-.292.042", fill: "#8C8C8C" })), autoComplete: 'no-auto-complete-' + randRef.current, rightSection: React__default.createElement(React__default.Fragment, null) }, form.getInputProps(name)))));
1373
1304
  };
1374
1305
 
1375
- var enPH = {
1376
- "validator.required": "This field is required.",
1377
- "validator.remote": "Please fix this field.",
1378
- "validator.email": "Please enter a valid email address.",
1379
- "validator.phone": "Please input correct phone number.",
1380
- "validator.url": "Please enter a valid URL.",
1381
- "validator.date": "Please enter a valid date.",
1382
- "validator.dateISO": "Please enter a valid date (ISO).",
1383
- "validator.number": "Please enter a valid number.",
1384
- "validator.digits": "Please enter only digits.",
1385
- "validator.creditcard": "Please enter a valid credit card number.",
1386
- "validator.equalTo": "Please enter the same value again.",
1387
- "validator.accept": "Please enter a value with a valid extension.",
1388
- "validator.maxlength": "jQuery.validator.format('Please enter no more than {0} characters.",
1389
- "validator.minlength": "jQuery.validator.format('Please enter at least {0} characters.",
1390
- "validator.rangelength": "jQuery.validator.format('Please enter a value between {0} and {1} characters long.",
1391
- "validator.range": "jQuery.validator.format('Please enter a value between {0} and {1}.",
1392
- "validator.max": "jQuery.validator.format('Please enter a value less than or equal to {0}.",
1393
- "validator.min": "jQuery.validator.format('Please enter a value greater than or equal to {0}.",
1394
- "validator.emailUsed": "Email already in use for this campaign.",
1395
- "validator.phoneUsed": "Your phone number already in use for this campaign.",
1396
- "validator.dateInvalid": "This date is not valid, please update.",
1397
- "lead.otp.title": "Enter OTP",
1398
- "lead.otp.desc": "We have sent an OTP to your mobile number {phone}",
1399
- "lead.otp.verify": "Verify",
1400
- "lead.otp.resend": "Resend OTP{timer}",
1401
- "lead.otp.phoneLabel": "Phone OTP",
1402
- "lead.otp.phonePlaceholder": "Enter OTP",
1403
- "lead.empty.title": "Oops, seem your information is empty, do you want to submit the information again?",
1404
- "lead.empty.cancel": "Cancel",
1405
- "lead.empty.submitAgain": "Submit again",
1406
- "inlineFreebie.freeSample.title": "Free Sample",
1407
- "inlineFreebie.luckyDrawGift.title": "Lucky-draw Gift",
1408
- "inlineFreebie.value": "Value",
1409
- "common.day": "Day",
1410
- "common.month": "Month",
1411
- "common.year": "Year"
1412
- };
1306
+ const SubtitleBlock$1 = ({ children, align, }) => (React__default.createElement("p", { className: `lead-modal__description ${'le-text-align-' + (align || '')} ${LEAD_CLASS}` }, children));
1413
1307
 
1414
- var hiIN = {
1415
- "validator.required": "इस क्षेत्र की आवश्यकता है।",
1416
- "validator.email": "कृपया एक मान्य ईमेल पता दर्ज करें",
1417
- "validator.number": "कृपया एक वैध संख्या दर्ज करें",
1418
- "validator.digits": "कृपया केवल अंक दर्ज करें",
1419
- "validator.maxlength": "कृपया {0} अक्षर से अधिक दर्ज न करें",
1420
- "validator.minlength": "कृपया कम से कम {0} अक्षर दर्ज करें",
1421
- "validator.phone": "कृपया एक वैध संख्या दर्ज करें",
1422
- "validator.dateInvalid": "यह तिथि मान्य नहीं है, कृपया अपडेट करें।",
1423
- "validator.emailUsed": "Email already in use for this campaign.",
1424
- "validator.phoneUsed": "Your phone number already in use for this campaign.",
1425
- "lead.otp.title": "Enter OTP",
1426
- "lead.otp.desc": "We have sent an OTP to your mobile number {phone}",
1427
- "lead.otp.verify": "Verify",
1428
- "lead.otp.resend": "Resend OTP{timer}",
1429
- "lead.empty.title": "ऊप्स! लगता है आपकी जानकारी खाली है। क्या आप जानकारी फिर से सबमिट करना चाहते हैं?",
1430
- "lead.empty.cancel": "रद्द करें",
1431
- "lead.empty.submitAgain": "फिर से सबमिट करें",
1432
- "inlineFreebie.freeSample.title": "मुफ्त नमूना",
1433
- "inlineFreebie.luckyDrawGift.title": "लकी-ड्रा गिफ्ट",
1434
- "inlineFreebie.value": "मूल्य",
1435
- "common.day": "साल",
1436
- "common.month": "महीना",
1437
- "common.year": ""
1438
- };
1308
+ const TitleBlock$1 = ({ children, align, }) => (React__default.createElement("h2", { className: `lead-modal__title ${'le-text-align-' + (align || '')} ${LEAD_CLASS}` }, children));
1439
1309
 
1440
- var idID = {
1441
- "validator.required": "Kolom ini wajib diisi",
1442
- "validator.email": "Tolong daftarkan email yang valid",
1443
- "validator.number": "Tolong daftarkan nomor telepon yang valid",
1444
- "validator.digits": "Tolong masukkan angka saja",
1445
- "validator.maxlength": "Jangan memasukkan lebih dari {0} karakter",
1446
- "validator.minlength": "Tolong ketik sedikitnya {0} karakter",
1447
- "validator.phone": "Tolong daftarkan nomor telepon yang valid",
1448
- "validator.emailUsed": "Email sudah digunakan untuk kampanye ini.",
1449
- "validator.phoneUsed": "Nomor telepon Anda sudah digunakan untuk kampanye ini.",
1450
- "validator.dateInvalid": "Tanggal ini tidak valid, silakan perbarui",
1451
- "lead.otp.title": "Masukkan OTP",
1452
- "lead.otp.desc": "Kami telah mengirimkan OTP ke nomor ponsel Anda {phone}",
1453
- "lead.otp.verify": "Verifikasi",
1454
- "lead.otp.resend": "Kirim Ulang OTP {timer}",
1455
- "lead.otp.phoneLabel": "OTP Telepon",
1456
- "lead.otp.phonePlaceholder": "Masukkan OTP",
1457
- "lead.empty.title": "Oops, sepertinya informasi Anda kosong. Apakah Anda ingin mengirimkan informasi lagi?",
1458
- "lead.empty.cancel": "Batal",
1459
- "lead.empty.submitAgain": "Kirim lagi",
1460
- "inlineFreebie.freeSample.title": "Sampel Gratis",
1461
- "inlineFreebie.luckyDrawGift.title": "Hadiah Undian",
1462
- "inlineFreebie.value": "Nilai",
1463
- "common.day": "Hari",
1464
- "common.month": "Bulan",
1465
- "common.year": "Tahun"
1466
- };
1467
-
1468
- var kmKH = {
1469
- "validator.required": "ព័ត៌មាន​ចាំបាច់​ដែល​ត្រូវ​បំពេញ",
1470
- "validator.email": "សូម​វាយ​អាសយដ្ឋាន​អ៊ីម៉ែល​ឲ្យ​បាន​ត្រឹមត្រូវ",
1471
- "validator.number": "សូម​វាយបញ្ចូល​លេខ​ឲ្យ​បាន​ត្រឹមត្រូវ",
1472
- "validator.digits": "វាយ​បញ្ចូល​បាន​តែ​លេខ​ប៉ុណ្ណោះ",
1473
- "validator.maxlength": "សូម​វាយ​បញ្ចូលកុំ​ឲ្យ​លើស {0} តួអក្សរ",
1474
- "validator.minlength": "សូម​វាយ​បញ្ចូល​តិច​បំផុត {0} តួអក្ស",
1475
- "validator.phone": "សូម​វាយបញ្ចូល​លេខ​ឲ្យ​បាន​ត្រឹមត្រូវ",
1476
- "validator.emailUsed": "អ៊ីមែលត្រូវបានប្រើប្រាស់សម្រាប់យុទ្ធនាការនេះរួចហើយ។",
1477
- "validator.phoneUsed": "លេខទូរស័ព្ទរបស់អ្នកត្រូវបានប្រើប្រាស់សម្រាប់យុទ្ធនាការនេះរួចហើយ។",
1478
- "validator.dateInvalid": "កាលបរិច្ឆេទនេះមិនត្រឹមត្រូវទេ សូមធ្វើបច្ចុប្បន្នភាព។",
1479
- "lead.otp.title": "បញ្ចូល OTP",
1480
- "lead.otp.desc": "យើងបានផ្ញើ OTP ទៅកាន់លេខទូរសព្ទរបស់អ្នក {phone}",
1481
- "lead.otp.verify": "ផ្ទៀងផ្ទាត់",
1482
- "lead.otp.resend": "ផ្ញើ OTP ម្តងទៀត {timer}",
1483
- "lead.otp.phoneLabel": "OTP ទូរស័ព្ទ",
1484
- "lead.otp.phonePlaceholder": "បញ្ចូល OTP",
1485
- "lead.empty.title": "អូុបស! ហាក់ដូចជាព័ត៌មានរបស់អ្នកទទេ។ តើអ្នកចង់ដាក់ស្នើព័ត៌មានម្តងទៀតទេ?",
1486
- "lead.empty.cancel": "លុប​ចោល",
1487
- "lead.empty.submitAgain": "ដាក់ស្នើម្ដងទៀត",
1488
- "inlineFreebie.freeSample.title": "សំបុត្រស្រង់ពិន័យ",
1489
- "inlineFreebie.luckyDrawGift.title": "សំបុត្រស្រង់ពិន័យ",
1490
- "inlineFreebie.value": "តម្លៃ",
1491
- "common.day": "ឆ្នាំ",
1492
- "common.month": "ខែ",
1493
- "common.year": "ថ្ងៃ"
1494
- };
1495
-
1496
- var msMY = {
1497
- "validator.required": "Bahagian ini wajib diisi.",
1498
- "validator.email": "Sila masukkan alamat emel yang sah.",
1499
- "validator.number": "Sila masukkan no telefon yang sah.",
1500
- "validator.digits": "Sila masukkan nombor digit sahaja.",
1501
- "validator.maxlength": "Sila masukkan tidak lebih dari {0} aksara",
1502
- "validator.minlength": "Sila masukkan sekurang-kurangnya {0} aksara",
1503
- "validator.phone": "Sila masukkan no telefon yang sah.",
1504
- "validator.emailUsed": "Emel sudah digunakan untuk kempen ini.",
1505
- "validator.phoneUsed": "Nombor telefon anda sudah digunakan untuk kempen ini.",
1506
- "validator.dateInvalid": "Tarikh ini tidak sah, sila kemas kini",
1507
- "lead.otp.title": "Masukkan OTP",
1508
- "lead.otp.desc": "Kami telah menghantar OTP ke nombor telefon bimbit anda {phone}",
1509
- "lead.otp.verify": "Sahkan",
1510
- "lead.otp.resend": "Hantar semula OTP {timer}",
1511
- "lead.otp.phoneLabel": "OTP Telefon",
1512
- "lead.otp.phonePlaceholder": "Masukkan OTP",
1513
- "lead.empty.title": "Oops, nampaknya maklumat anda kosong. Adakah anda ingin menghantar maklumat semula?",
1514
- "lead.empty.cancel": "Batal",
1515
- "lead.empty.submitAgain": "Hantar semula",
1516
- "inlineFreebie.freeSample.title": "Sampel Percuma",
1517
- "inlineFreebie.luckyDrawGift.title": "Hadiah Undian",
1518
- "inlineFreebie.value": "Nilai",
1519
- "common.day": "Hari",
1520
- "common.month": "Bulan",
1521
- "common.year": "Tahun"
1310
+ const Fields = ({ listBlockAdded, popupId, locale, onClose, onOtherSubmit, styles, classNames, popoverProps, }) => {
1311
+ const { primaryColor } = useContext(LeadGenContext$1);
1312
+ const { classes, cx } = useStyles$3(undefined, {
1313
+ name: 'LeadGen__Field',
1314
+ styles,
1315
+ classNames,
1316
+ });
1317
+ const form = useLeadFormContext$1();
1318
+ return (React__default.createElement(React__default.Fragment, null, listBlockAdded.map((b, index) => {
1319
+ var _a;
1320
+ const { name = '', data = {} } = b || {};
1321
+ const { placeholder, value, align, listQuestion, isSendMailChimp = false, newtab, url, } = data;
1322
+ const required = (_a = data.required) !== null && _a !== void 0 ? _a : true;
1323
+ switch (name) {
1324
+ case 'TitleBlock':
1325
+ return (React__default.createElement(TitleBlock$1, { key: index, align: align }, value));
1326
+ case 'SubtitleBlock':
1327
+ return (React__default.createElement(SubtitleBlock$1, { key: index, align: align }, value));
1328
+ case 'TextBlock':
1329
+ return (React__default.createElement(Input, Object.assign({ key: index, withAsterisk: required, spellCheck: false, type: "text", placeholder: placeholder, className: cx('leadgen-control', classes.control),
1330
+ // onChangeRaw={(e) => inputOnChange('text', e)}
1331
+ label: placeholder, "data-control": "text", "data-lead-control": name, "data-is-required": required, name: value }, form.getInputProps(value))));
1332
+ case 'NumberBlock':
1333
+ return (React__default.createElement(NumberInput, Object.assign({ key: index, withAsterisk: required, spellCheck: false, type: "number", placeholder: placeholder, className: cx('leadgen-control', classes.control),
1334
+ // onChange={(e) => inputOnChange('number', e)}
1335
+ label: placeholder, "data-control": "number", "data-lead-control": name, "data-is-required": required, name: value }, form.getInputProps(value))));
1336
+ case 'EmailBlock':
1337
+ return (React__default.createElement(Input, Object.assign({ key: index, withAsterisk: required, spellCheck: false,
1338
+ // type="email"
1339
+ placeholder: placeholder, className: cx('leadgen-control', classes.control), label: placeholder, "data-control": "email", "data-lead-control": name, "data-is-required": required, name: value }, form.getInputProps(value))));
1340
+ case 'PhoneOtpBlock':
1341
+ case 'WhatsappOtpBlock':
1342
+ case 'ZaloOtpBlock':
1343
+ case 'PhoneBlock': {
1344
+ const id = popupId + '-' + value + '-' + index;
1345
+ return (React__default.createElement(Input.Wrapper, Object.assign({ size: "md", withAsterisk: required, key: index, label: placeholder,
1346
+ // error={errorField.phone}
1347
+ className: cx('leadgen-control', classes.control), labelProps: {
1348
+ htmlFor: id,
1349
+ } }, form.getInputProps(value)),
1350
+ React__default.createElement(Phone, { name: value, spellCheck: false, type: "tel", placeholder: placeholder, value: form.getInputProps(value).value, onChange: (v) => {
1351
+ form.setFieldValue(value, v);
1352
+ },
1353
+ // onBlur={(e) => inputOnBlur('tel', e)}
1354
+ id: id, defaultCountry: (locale ? MAPPED_LOCALE[locale] || 'VN' : 'VN'), "data-control": "tel", "data-lead-control": name, "data-is-required": required })));
1355
+ }
1356
+ case 'LocationBlock': {
1357
+ return (React__default.createElement(LocationBlock, { key: index, name: value, placeholder: placeholder, locale: locale, required: required }));
1358
+ }
1359
+ case 'DateBlock':
1360
+ return (React__default.createElement(React__default.Fragment, null,
1361
+ React__default.createElement(DatePicker, Object.assign({ withAsterisk: required, key: index, type: "default", name: value, placeholder: placeholder, className: cx('leadgen-control', classes.control), label: placeholder, "data-control": "date", "data-lead-control": name, "data-is-required": required, popoverProps: popoverProps }, form.getInputProps(value))),
1362
+ React__default.createElement("input", { type: "hidden", name: value, "data-control": "date" })));
1363
+ case 'LinkButtonBlock':
1364
+ return (React__default.createElement("div", { key: index },
1365
+ React__default.createElement("a", { target: newtab ? 'blank' : 'parrent', href: url, style: { textDecoration: 'none' } },
1366
+ React__default.createElement(Button, { type: "button", size: "md", color: primaryColor, className: `lead-modal__btn ${LEAD_CLASS}`, onClick: () => {
1367
+ onClose === null || onClose === void 0 ? void 0 : onClose();
1368
+ onOtherSubmit === null || onOtherSubmit === void 0 ? void 0 : onOtherSubmit();
1369
+ } }, value))));
1370
+ case 'CheckboxBlock':
1371
+ return (React__default.createElement(React__default.Fragment, null,
1372
+ isSendMailChimp && (React__default.createElement("div", { style: {
1373
+ display: 'none',
1374
+ }, "data-name": value + '-mailchimp' })),
1375
+ React__default.createElement(Checkbox.Group, Object.assign({ withAsterisk: required, className: cx('leadgen-control', classes.control), key: index, label: placeholder, size: "md", sx: {
1376
+ display: 'flex',
1377
+ flexDirection: 'column',
1378
+ gap: 8,
1379
+ } }, form.getInputProps(value)), listQuestion.map((l, _index) => (React__default.createElement(Checkbox, { name: value, key: _index, value: l.value, label: l.placeholder, "data-control": "checkbox", "data-lead-control": name, "data-is-required": required }))))));
1380
+ case 'RadioBlock':
1381
+ return (React__default.createElement(React__default.Fragment, null,
1382
+ isSendMailChimp && (React__default.createElement(Input, { type: "hidden", name: value + '-mailchimp', value: isSendMailChimp })),
1383
+ React__default.createElement(Radio.Group, Object.assign({ withAsterisk: required, className: cx('leadgen-control', classes.control), key: index, label: placeholder, size: "md" }, form.getInputProps(value)), listQuestion.map((l, _index) => (React__default.createElement(Radio, { name: value, key: _index, value: l.value, label: l.placeholder, "data-control": "radio", "data-lead-control": name, "data-is-required": required }))))));
1384
+ case 'DropdownBlock':
1385
+ return (React__default.createElement(React__default.Fragment, null,
1386
+ React__default.createElement("div", { style: { display: 'none' }, "data-extra": true, "data-name": value, "data-control": 'dropdown', "data-lead-control": name, "data-is-required": required }),
1387
+ React__default.createElement(Select, Object.assign({ key: index, className: cx('leadgen-control', classes.control), label: placeholder, withAsterisk: required, name: value, data: listQuestion.map((l) => ({
1388
+ value: l.value,
1389
+ label: l.placeholder,
1390
+ })) }, form.getInputProps(value)))));
1391
+ case 'TncBlock':
1392
+ const tncInputProps = form.getInputProps('TNC-' + b.id);
1393
+ return (React__default.createElement(React__default.Fragment, null,
1394
+ React__default.createElement(Checkbox, Object.assign({ name: 'TNC-' + b.id, key: b.id, label: React__default.createElement("p", { className: "lead-modal__tnc-link", dangerouslySetInnerHTML: { __html: data.valueHTML } }), className: "tnc-block", "data-control": "checkbox", "data-lead-control": name, "data-is-required": required }, tncInputProps, { error: tncInputProps.error ? tncInputProps.error : undefined }))));
1395
+ }
1396
+ return null;
1397
+ })));
1522
1398
  };
1523
1399
 
1524
- var myMM = {
1525
- "validator.required": "ဒီနေရာမှာ ဖြည့်ဖို့ လိုအပ်ပါတယ်",
1526
- "validator.email": "မှန်ကန်သော အီးမေးလ်လိပ်စာထည့်သွင်းပါ",
1527
- "validator.number": "မှန်ကန်သော ဖုန်းနံပါတ်ထည့်သွင်းပါ",
1528
- "validator.digits": "နံပါတ်များသာဖြည့်ပါ",
1529
- "validator.maxlength": "ကျေးဇူးပြု၍ {0} ထပ်မပိုသော ဂဏန်းများသာဖြည့်ပါ",
1530
- "validator.minlength": "ကျေးဇူးပြု၍ အနည်းဆုံး {0} ဂဏန်းဖြည့်ပါ",
1531
- "validator.phone": "မှန်ကန်သော ဖုန်းနံပါတ်ထည့်သွင်းပါ",
1532
- "validator.emailUsed": "ဤအေကာင့်အတွက် အီးမေးလ်ကို အသုံးပြုပြီးဖြစ်ပါသည်။",
1533
- "validator.phoneUsed": "ဤအေကာင့်အတွက် သင့်ဖုန်းနံပါတ်ကို အသုံးပြုပြီးဖြစ်ပါသည်။",
1534
- "validator.dateInvalid": "ယနေ့စွဲမှားနေသည်၊ ကျေးဇူးပြု၍ ပြင်ဆင်ပါ။",
1535
- "lead.otp.title": "OTP ကိုထည့်ပါ",
1536
- "lead.otp.desc": "ကျွန်ုပ်တို့သည် OTP ကိုသင့်ဖုန်းနံပါတ် {phone} သို့ပို့ခဲ့သည်",
1537
- "lead.otp.verify": "အတည်ပြုပါ",
1538
- "lead.otp.resend": "OTP ကိုထပ်မံပို့ရန် {timer}",
1539
- "lead.otp.phoneLabel": "ဖုန်း OTP",
1540
- "lead.otp.phonePlaceholder": "OTP ကိုထည့်ပါ",
1541
- "lead.empty.title": "အုပ်စ်! သင့်အချက်အလက်သည် ဗလာဖြစ်နေသလိုဖြစ်သည်။ ထပ်မံတင်သွင်းလိုပါသလား?",
1542
- "lead.empty.cancel": "မလုပ်ဆောင်ပါ",
1543
- "lead.empty.submitAgain": "ထပ်မံတင်သွင်းပါ",
1544
- "inlineFreebie.freeSample.title": "အခမဲ့အစားအစာ",
1545
- "inlineFreebie.luckyDrawGift.title": "အခမဲ့အစားအစာ",
1546
- "inlineFreebie.value": "တန်ဖိုး",
1547
- "common.day": "ရက်",
1548
- "common.month": "လ",
1549
- "common.year": "နှစ်"
1550
- };
1400
+ var useStyles$2 = createStyles((theme) => {
1401
+ return {
1402
+ root: {},
1403
+ header: {},
1404
+ heading: {},
1405
+ description: {},
1406
+ term: {
1407
+ a: {
1408
+ color: theme.fn.primaryColor(),
1409
+ },
1410
+ },
1411
+ controlList: {},
1412
+ control: {},
1413
+ submitBtn: {},
1414
+ submitBtnWrapper: {},
1415
+ };
1416
+ });
1551
1417
 
1552
- var thTH = {
1553
- "validator.required": "ต้องระบุข้อมูลในช่องนี้",
1554
- "validator.email": "กรุณาใส่อีเมล์ที่ถูกต้อง",
1555
- "validator.number": "กรุณาใส่ตัวเลขที่ถูกต้อง",
1556
- "validator.digits": "กรุณาส่เฉพาะตัวเลข",
1557
- "validator.maxlength": "กรุณาใส่ตัวเลขมากกว่า {0} หลัก",
1558
- "validator.minlength": "กรุณาใส่ตัวเลขอย่างน้อย {0} หลัก",
1559
- "validator.phone": "กรุณาใส่ตัวเลขที่ถูกต้อง",
1560
- "validator.emailUsed": "อีเมลนี้ถูกใช้สำหรับแคมเปญนี้แล้ว",
1561
- "validator.phoneUsed": "หมายเลขโทรศัพท์ของคุณถูกใช้สำหรับแคมเปญนี้แล้ว",
1562
- "validator.dateInvalid": "วันที่นี้ไม่ถูกต้อง โปรดอัปเดต",
1563
- "lead.otp.title": "ป้อน OTP",
1564
- "lead.otp.desc": "เราได้ส่ง OTP ไปยังหมายเลขโทรศัพท์มือถือของคุณ {phone}",
1565
- "lead.otp.verify": "ยืนยัน",
1566
- "lead.otp.resend": "ส่ง OTP อีกครั้ง {timer}",
1567
- "lead.otp.phoneLabel": "OTP โทรศัพท์",
1568
- "lead.otp.phonePlaceholder": "ป้อน OTP",
1569
- "lead.empty.title": "อุ๊ปส์! ดูเหมือนว่าข้อมูลของคุณว่างเปล่า คุณต้องการส่งข้อมูลอีกครั้งหรือไม่?",
1570
- "lead.empty.cancel": "ยกเลิก",
1571
- "lead.empty.submitAgain": "ส่งอีกครั้ง",
1572
- "inlineFreebie.freeSample.title": "ตัวอย่างฟรี",
1573
- "inlineFreebie.luckyDrawGift.title": "ของรางวัลที่ถูกรางวัล",
1574
- "inlineFreebie.value": "ค่า",
1575
- "common.day": "วัน",
1576
- "common.month": "เดือน",
1577
- "common.year": "ปี"
1418
+ const Heading = (_a) => {
1419
+ var rest = __rest(_a, []);
1420
+ const { heading } = useContext(LeadGenComponentContext);
1421
+ return heading ? (React__default.createElement(Text, Object.assign({ size: "h3" }, rest), heading)) : null;
1578
1422
  };
1579
1423
 
1580
- var viVN = {
1581
- "validator.required": "Vui lòng điền mục này",
1582
- "validator.email": "Vui lòng điền email có thật.",
1583
- "validator.number": "Vui lòng điền số thật",
1584
- "validator.digits": "Vui lòng chỉ điền số",
1585
- "validator.maxlength": "Vui lòng điền dưới {0} số",
1586
- "validator.minlength": "Vui lòng điền hơn {0} số",
1587
- "validator.remote": "Hãy sửa cho đúng.",
1588
- "validator.url": "Hãy nhập URL.",
1589
- "validator.date": "Hãy nhập ngày.",
1590
- "validator.dateISO": "Hãy nhập ngày (ISO).",
1591
- "validator.creditcard": "Hãy nhập số thẻ tín dụng.",
1592
- "validator.equalTo": "Hãy nhập thêm lần nữa.",
1593
- "validator.extension": "Phần mở rộng không đúng.",
1594
- "validator.rangelength": "Hãy nhập từ {0} đến {1} kí tự.",
1595
- "validator.range": "Hãy nhập từ {0} đến {1}.",
1596
- "validator.max": "Hãy nhập từ {0} trở xuống.",
1597
- "validator.min": "Hãy nhập từ {0} trở lên.",
1598
- "validator.phone": "Nhập đúng định dạng số điện thoại",
1599
- "validator.emailUsed": "Email này đã được sử dụng.",
1600
- "validator.phoneUsed": "Số điện thoại này đã được sử dụng.",
1601
- "validator.dateInvalid": "Ngày này không hợp lệ, vui lòng cập nhật.",
1602
- "lead.otp.title": "Nhập OTP",
1603
- "lead.otp.desc": "Chúng tôi đã gửi OTP đến số điện thoại của bạn {phone}",
1604
- "lead.otp.verify": "Xác minh",
1605
- "lead.otp.resend": "Gửi lại OTP {timer}",
1606
- "lead.otp.phoneLabel": "Nhập OTP",
1607
- "lead.otp.phonePlaceholder": "Nhập OTP",
1608
- "lead.empty.title": "Oops, vẻ như thông tin của bạn đang trống. Bạn có muốn gửi lại thông tin không?",
1609
- "lead.empty.cancel": "Hủy",
1610
- "lead.empty.submitAgain": "Gửi lại",
1611
- "inlineFreebie.freeSample.title": "Dùng thử miễn phí",
1612
- "inlineFreebie.luckyDrawGift.title": "Phần thưởng may mắn",
1613
- "inlineFreebie.value": "Trị giá",
1614
- "common.day": "Ngày",
1615
- "common.month": "Tháng",
1616
- "common.year": "Năm"
1424
+ const FormComponent = ({ styles, className, classNames, fillInfo, popoverProps, submitProps, }) => {
1425
+ var _a;
1426
+ const { primaryColor } = useContext(LeadGenContext$1);
1427
+ const { listBlockAdded, leadFormConfig: { form, validateObj }, validatingEmailRef, validatingPhoneRef,
1428
+ // formRef,
1429
+ setFormRef, onClose, onOtherSubmit, actionBlocks, locale, setShowOtpPhone, onSubmit, } = useContext(LeadGenComponentContext);
1430
+ const { classes, cx } = useStyles$2(undefined, {
1431
+ name: 'LeadGen__FormComponent',
1432
+ styles,
1433
+ classNames,
1434
+ });
1435
+ const [isSubmitLoading, setIsSubmitLoading] = useState(false);
1436
+ const popUpSubmitText = actionBlocks.submitBlock.data.value;
1437
+ const middlewareOnSubmit = (e) => {
1438
+ e.preventDefault();
1439
+ // mark all as touched to allow validation
1440
+ form.setTouched(Object.keys(validateObj).reduce((acc, cur) => {
1441
+ acc[cur] = true;
1442
+ return acc;
1443
+ }, {}));
1444
+ if (validatingEmailRef.current || validatingPhoneRef.current) {
1445
+ return;
1446
+ }
1447
+ setTimeout(() => {
1448
+ form.onSubmit((v) => {
1449
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
1450
+ if (Object.keys(form.errors).length)
1451
+ return;
1452
+ let newShowOtpPhone = null;
1453
+ if (listBlockAdded.findIndex((x) => x.name === 'PhoneOtpBlock') > -1) {
1454
+ // not submit yet, open otp
1455
+ const fieldName = (_b = (_a = listBlockAdded.find((x) => x.name === 'PhoneOtpBlock')) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.value;
1456
+ if ((_c = v[fieldName]) === null || _c === void 0 ? void 0 : _c.startsWith('+')) {
1457
+ newShowOtpPhone = {
1458
+ phone: v[fieldName],
1459
+ type: 'phone',
1460
+ };
1461
+ }
1462
+ }
1463
+ if (listBlockAdded.findIndex((x) => x.name === 'WhatsappOtpBlock') > -1) {
1464
+ // not submit yet, open otp
1465
+ const fieldName = (_e = (_d = listBlockAdded.find((x) => x.name === 'WhatsappOtpBlock')) === null || _d === void 0 ? void 0 : _d.data) === null || _e === void 0 ? void 0 : _e.value;
1466
+ if ((_f = v[fieldName]) === null || _f === void 0 ? void 0 : _f.startsWith('+')) {
1467
+ newShowOtpPhone = {
1468
+ phone: v[fieldName],
1469
+ type: 'whatsapp',
1470
+ };
1471
+ }
1472
+ }
1473
+ if (listBlockAdded.findIndex((x) => x.name === 'ZaloOtpBlock') > -1) {
1474
+ // not submit yet, open otp
1475
+ const fieldName = (_h = (_g = listBlockAdded.find((x) => x.name === 'ZaloOtpBlock')) === null || _g === void 0 ? void 0 : _g.data) === null || _h === void 0 ? void 0 : _h.value;
1476
+ if ((_j = v[fieldName]) === null || _j === void 0 ? void 0 : _j.startsWith('+')) {
1477
+ newShowOtpPhone = {
1478
+ phone: v[fieldName],
1479
+ type: 'zalo',
1480
+ };
1481
+ }
1482
+ }
1483
+ if (newShowOtpPhone) {
1484
+ setIsSubmitLoading(true);
1485
+ Service.sendSMSOtpLead(newShowOtpPhone)
1486
+ .then((res) => {
1487
+ var _a;
1488
+ const respMessage = (_a = res === null || res === void 0 ? void 0 : res._messages) === null || _a === void 0 ? void 0 : _a[0];
1489
+ if (respMessage === 'This phone number was verified') {
1490
+ onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit();
1491
+ return;
1492
+ }
1493
+ setShowOtpPhone(newShowOtpPhone);
1494
+ })
1495
+ .finally(() => {
1496
+ setIsSubmitLoading(false);
1497
+ });
1498
+ return;
1499
+ }
1500
+ onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit();
1501
+ })(e);
1502
+ }, 100);
1503
+ };
1504
+ useEffect(() => {
1505
+ form === null || form === void 0 ? void 0 : form.setValues(fillInfo);
1506
+ }, [fillInfo]);
1507
+ return (React__default.createElement(LeadFormProvider$1, { form: form },
1508
+ React__default.createElement(Box, { component: "form", ref: (el) => el && setFormRef(el), className: cx(className, classes.root), onSubmit: middlewareOnSubmit, styles: styles },
1509
+ React__default.createElement("div", { className: classes.header },
1510
+ React__default.createElement(Heading, { className: classes.heading }),
1511
+ React__default.createElement(Description, { className: classes.description })),
1512
+ React__default.createElement("div", { className: classes.controlList },
1513
+ React__default.createElement(Fields, { classNames: {
1514
+ control: classes.control,
1515
+ }, listBlockAdded: listBlockAdded, locale: locale, onClose: onClose, onOtherSubmit: onOtherSubmit, popoverProps: popoverProps })),
1516
+ ((_a = actionBlocks === null || actionBlocks === void 0 ? void 0 : actionBlocks.submitBlock) === null || _a === void 0 ? void 0 : _a.isHide) ? null : (React__default.createElement("div", { className: classes.submitBtnWrapper },
1517
+ React__default.createElement(Button, Object.assign({ size: "md", id: "lead-submit", type: "submit", className: classes.submitBtn, loading: isSubmitLoading, color: primaryColor }, submitProps), popUpSubmitText))))));
1518
+ };
1519
+ const Form = (props) => {
1520
+ const { showOtpPhone, showThankyou } = useContext(LeadGenComponentContext);
1521
+ return showThankyou || showOtpPhone ? null : React__default.createElement(FormComponent, Object.assign({}, props));
1617
1522
  };
1618
1523
 
1619
- var zhTW = {
1620
- "validator.required": "此為必填欄位",
1621
- "validator.email": "請填入有效的 email 地址",
1622
- "validator.number": "請填入有效的電話號碼",
1623
- "validator.digits": "此欄位僅能輸入數字",
1624
- "validator.maxlength": "請輸入少於 {0} 位數",
1625
- "validator.minlength": "請輸入至少 {0} 位數",
1626
- "validator.phone": "請填入有效的電話號碼",
1627
- "validator.emailUsed": "此電子郵件已被使用於此活動。",
1628
- "validator.phoneUsed": "您的手機號碼已被使用於此活動。",
1629
- "validator.dateInvalid": "此日期無效,請更新.",
1630
- "lead.otp.title": "輸入 OTP",
1631
- "lead.otp.desc": "我們已將 OTP 發送到您的手機號碼 {phone}",
1632
- "lead.otp.verify": "驗證",
1633
- "lead.otp.resend": "重新發送 OTP {timer}",
1634
- "lead.otp.phoneLabel": "電話 OTP",
1635
- "lead.otp.phonePlaceholder": "輸入 OTP",
1636
- "lead.empty.title": "哎呀,您的資訊似乎是空的,您想要重新提交資訊嗎?",
1637
- "lead.empty.cancel": "取消",
1638
- "lead.empty.submitAgain": "重新提交",
1639
- "inlineFreebie.freeSample.title": "免費試用",
1640
- "inlineFreebie.luckyDrawGift.title": "幸運抽獎禮品",
1641
- "inlineFreebie.value": "價值",
1642
- "common.day": "日",
1643
- "common.month": "月",
1644
- "common.year": "年"
1645
- };
1524
+ var useStyles$1 = createStyles(() => {
1525
+ return {
1526
+ root: {},
1527
+ header: {},
1528
+ heading: {},
1529
+ description: {},
1530
+ control: {},
1531
+ actions: {},
1532
+ submitBtn: {},
1533
+ resendOtp: {},
1534
+ };
1535
+ });
1646
1536
 
1647
- const translationsMap = {
1648
- 'en-PH': enPH,
1649
- 'vi-VN': viVN,
1650
- 'hi-IN': hiIN,
1651
- 'id-ID': idID,
1652
- 'ms-MY': msMY,
1653
- 'my-MM': myMM,
1654
- 'km-KH': kmKH,
1655
- 'zh-TW': zhTW,
1656
- 'zh-SG': zhTW,
1657
- 'th-TH': thTH,
1658
- 'tl-PH': enPH,
1537
+ const OtpBlockComponent = ({ otpData, onSuccess, autoSendWhenOpen, className, styles, classNames, }) => {
1538
+ const { t } = useLeadGenTranslations();
1539
+ const phone = otpData.phone;
1540
+ const otpType = otpData.type;
1541
+ const [otp, setOtp] = useState('');
1542
+ const [isDirty, setIsDirty] = useState(false);
1543
+ const [resendTimer, setResendTimer] = useState(autoSendWhenOpen ? 0 : 60);
1544
+ const inputRef = useRef(null);
1545
+ const [errorMsg, setErrorMsg] = useState();
1546
+ const [displayPhone, setDisplayPhone] = useState('');
1547
+ const formatPhoneNumberIntlRef = useRef();
1548
+ const [isSubmitLoading, setIsSubmitLoading] = useState(false);
1549
+ const { classes, cx } = useStyles$1(undefined, {
1550
+ name: 'LeadGen__OTP',
1551
+ styles,
1552
+ classNames,
1553
+ });
1554
+ useEffect(() => {
1555
+ (() => __awaiter(void 0, void 0, void 0, function* () {
1556
+ var _a;
1557
+ if (!formatPhoneNumberIntlRef.current) {
1558
+ const res = yield import('react-phone-number-input');
1559
+ formatPhoneNumberIntlRef.current = res.formatPhoneNumberIntl;
1560
+ }
1561
+ setDisplayPhone(((_a = formatPhoneNumberIntlRef.current) === null || _a === void 0 ? void 0 : _a.call(formatPhoneNumberIntlRef, phone)) || phone);
1562
+ }))();
1563
+ }, [phone]);
1564
+ const sendOtp = () => __awaiter(void 0, void 0, void 0, function* () {
1565
+ var _a;
1566
+ if (!phone) {
1567
+ return;
1568
+ }
1569
+ const res = yield Service.sendSMSOtpLead({
1570
+ phone,
1571
+ type: otpType,
1572
+ });
1573
+ const respMessage = (_a = res === null || res === void 0 ? void 0 : res._messages) === null || _a === void 0 ? void 0 : _a[0];
1574
+ if (respMessage === 'Send sms successfully' ||
1575
+ respMessage === 'Send WhatsApp successfully' ||
1576
+ respMessage === 'Send Zalo successfully') {
1577
+ setResendTimer(60);
1578
+ setTimeout(() => {
1579
+ if (inputRef.current) {
1580
+ inputRef.current.focus();
1581
+ inputRef.current.scrollIntoView({ block: 'center' });
1582
+ }
1583
+ }, 100);
1584
+ }
1585
+ else if (respMessage === 'This phone number was verified') {
1586
+ onSuccess();
1587
+ }
1588
+ else {
1589
+ setErrorMsg(respMessage || 'Something went wrong!');
1590
+ // const defaultError = f({ id: 'notification.comment.somethingWrong' })
1591
+ // setStatusVerifyOTP('idle')
1592
+ // pushNotifications({
1593
+ // title: respMessage || defaultError,
1594
+ // message: '',
1595
+ // type: 'danger',
1596
+ // })
1597
+ }
1598
+ });
1599
+ const submitOtp = () => __awaiter(void 0, void 0, void 0, function* () {
1600
+ if (!phone || !otp) {
1601
+ return;
1602
+ }
1603
+ setIsSubmitLoading(true);
1604
+ const res = yield Service.verifyOtpLead({
1605
+ phone,
1606
+ otp,
1607
+ type: otpType,
1608
+ });
1609
+ const respMessage = res === null || res === void 0 ? void 0 : res._messages[0];
1610
+ if (respMessage === 'Verify successfully' ||
1611
+ respMessage === 'Verify WhatsApp OTP sucess' ||
1612
+ respMessage === 'Verify Zalo OTP sucess') {
1613
+ onSuccess();
1614
+ }
1615
+ else if (respMessage === 'This phone number was verified') {
1616
+ onSuccess();
1617
+ }
1618
+ else {
1619
+ setErrorMsg(respMessage || 'something Wrong');
1620
+ // setIsShowError(true)
1621
+ // setStatusVerifyOTP('sent')
1622
+ // pushNotifications({
1623
+ // title: res?._messages[0] || defaultError,
1624
+ // message: '',
1625
+ // type: 'danger',
1626
+ // })
1627
+ }
1628
+ setIsSubmitLoading(false);
1629
+ });
1630
+ useEffect(() => {
1631
+ setTimeout(() => {
1632
+ if (resendTimer > 0) {
1633
+ setResendTimer((r) => r - 1);
1634
+ }
1635
+ }, 1000);
1636
+ }, [resendTimer]);
1637
+ useEffect(() => {
1638
+ if (autoSendWhenOpen && !resendTimer) {
1639
+ sendOtp();
1640
+ }
1641
+ }, []);
1642
+ return (React__default.createElement(React__default.Fragment, null,
1643
+ React__default.createElement(Box, { component: "form", onSubmit: (e) => {
1644
+ e.preventDefault();
1645
+ submitOtp();
1646
+ }, className: cx(classes.root, className) },
1647
+ React__default.createElement("div", { className: classes.header },
1648
+ React__default.createElement(Heading$1, { tag: "h3", className: classes.heading }, t('lead.otp.title')),
1649
+ React__default.createElement(Text, { size: "p3", className: classes.description }, t('lead.otp.desc', { phone: displayPhone }))),
1650
+ React__default.createElement(Input, { ref: inputRef, name: '_' + name + '-otp', spellCheck: false, type: "number", placeholder: t('lead.otp.phonePlaceholder'), className: classes.control, label: t('lead.otp.phoneLabel'), "data-control": "otp", withAsterisk: true, pattern: "[0-9]*", value: otp, maxLength: 6, onChange: (v) => {
1651
+ setIsDirty(true);
1652
+ setOtp(v);
1653
+ if (isDirty && !v)
1654
+ setErrorMsg('OTP is required');
1655
+ else
1656
+ setErrorMsg(undefined);
1657
+ }, error: isDirty ? errorMsg : undefined }),
1658
+ React__default.createElement("div", { className: classes.actions },
1659
+ React__default.createElement(Button, { type: "submit", size: "md", color: "primary", className: classes.submitBtn,
1660
+ // onClick={() => submitOtp()}
1661
+ disabled: !otp, loading: isSubmitLoading }, t('lead.otp.verify')),
1662
+ React__default.createElement(Button, { type: "button", size: "md", color: "transparent", className: classes.resendOtp, onClick: () => {
1663
+ sendOtp();
1664
+ }, disabled: !!resendTimer }, t('lead.otp.resend', {
1665
+ timer: resendTimer ? ` (${resendTimer}s)` : '',
1666
+ }))))));
1659
1667
  };
1660
- const getTranslations = (locale) => {
1661
- const translations = Object.assign(Object.assign({}, translationsMap$1[locale]), translationsMap[locale]);
1662
- if (translations) {
1663
- return translations;
1664
- }
1665
- return translationsMap['en-PH'];
1668
+ const OtpBlock$1 = (_a) => {
1669
+ var rest = __rest(_a, []);
1670
+ const { showOtpPhone, setShowOtpPhone, onSubmit,
1671
+ // formRef,
1672
+ // leadFormConfig: { form },
1673
+ } = useContext(LeadGenComponentContext);
1674
+ return showOtpPhone ? (React__default.createElement(OtpBlockComponent, Object.assign({ otpData: showOtpPhone, autoSendWhenOpen: false, onSuccess: () => {
1675
+ setShowOtpPhone(null);
1676
+ onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit();
1677
+ } }, rest))) : null;
1666
1678
  };
1667
1679
 
1668
- const LeadGenTranslationProvider = (props) => {
1669
- const { locale, children } = props;
1670
- const translationContextValue = useMemo(() => ({ locale, values: getTranslations(locale) }), [locale]);
1671
- return (React__default.createElement(TranslationsContext.Provider, { value: translationContextValue }, children));
1680
+ const Thankyou = ({ children, }) => {
1681
+ const { showThankyou, setShowThankyou } = useContext(LeadGenComponentContext);
1682
+ return showThankyou
1683
+ ? children(showThankyou, () => setShowThankyou(null))
1684
+ : null;
1672
1685
  };
1673
1686
 
1674
1687
  // import mockLeadData from './mockLeadData'
@@ -2046,8 +2059,8 @@ const LeadGenContext = createContext({
2046
2059
  });
2047
2060
  const LeadGenContextProvider = (props) => {
2048
2061
  const { campaign_code: campaignCodeProps, apiSsoUrl, apiLeadUrl, apiSubotUrl, locale: localeProps, forceCampaign: forceCampaignProps, extraValues, articleId = 1, categoryList, siteDomain: site_domain, children, userInfo } = props, restProps = __rest(props, ["campaign_code", "apiSsoUrl", "apiLeadUrl", "apiSubotUrl", "locale", "forceCampaign", "extraValues", "articleId", "categoryList", "siteDomain", "children", "userInfo"]);
2049
- const { t } = useTranslations();
2050
2062
  const [forceCampaign, setForceCampaign] = useState(forceCampaignProps);
2063
+ const { t } = useLeadGenTranslations();
2051
2064
  const [subscriptionInfo, setSubscriptionInfo] = useState({
2052
2065
  subscriptionIcon: '',
2053
2066
  subscriptionTitle: '',
@@ -2326,8 +2339,7 @@ const LeadGenContextProvider = (props) => {
2326
2339
  apiSubotUrl, locale: localeProps, articleId, categoryId: subscriptionInfo.subcriptionCateId, siteDomain: site_domain, forceCampaign,
2327
2340
  submit,
2328
2341
  submitSubscriptionBox,
2329
- impression }) },
2330
- React__default.createElement(LeadGenTranslationProvider, { locale: locale }, children)));
2342
+ impression }) }, children));
2331
2343
  };
2332
2344
  const useLeadGenContext = () => {
2333
2345
  const context = useContext(LeadGenContext);
@@ -2387,7 +2399,7 @@ dayjs.extend(customParseFormat);
2387
2399
  const [LeadFormProvider, useLeadFormContext, useLeadForm] = createFormContext();
2388
2400
  const useLeadFormConfig = ({ listBlockAdded = [], validatingPhoneRef, validatingEmailRef, campaignId, campaign_subot_id = [], userInfo, format, }) => {
2389
2401
  var _a;
2390
- const { t } = useTranslations();
2402
+ const { t } = useLeadGenTranslations();
2391
2403
  const initialValues = useMemo(() => formatLeadGenFormValue(mappingSSOToLead(userInfo), listBlockAdded), [userInfo === null || userInfo === void 0 ? void 0 : userInfo.id]);
2392
2404
  const LEAD_LOCALE = LEAD_LOCALE_DATA$1[(_a = document === null || document === void 0 ? void 0 : document.documentElement) === null || _a === void 0 ? void 0 : _a.lang] ||
2393
2405
  LEAD_LOCALE_DATA$1['vi-VN'];
@@ -3155,8 +3167,9 @@ const LeadGenSubscriptionBoxContainer = (props) => {
3155
3167
  return null;
3156
3168
  }
3157
3169
  return (React__default.createElement(MantineProvider, { locale: locale, customStyleType: CustomStylesType.LEADGEN },
3158
- React__default.createElement(LeadGenContextProvider, Object.assign({}, props, { apiLeadUrl: apiUrl, apiSubotUrl: apiSubotUrl }),
3159
- React__default.createElement(Container, null))));
3170
+ React__default.createElement(LeadGenTranslationProvider, { locale: locale },
3171
+ React__default.createElement(LeadGenContextProvider, Object.assign({}, props, { apiLeadUrl: apiUrl, apiSubotUrl: apiSubotUrl }),
3172
+ React__default.createElement(Container, null)))));
3160
3173
  };
3161
3174
  const LeadGenSubscriptionBox = LeadGenSubscriptionBoxContainer;
3162
3175
 
@@ -4001,7 +4014,7 @@ const EmptyIcon = (props) => {
4001
4014
  };
4002
4015
 
4003
4016
  const EmptyComponent = ({ onClose, onContinue, }) => {
4004
- const { t } = useTranslations();
4017
+ const { t } = useLeadGenTranslations();
4005
4018
  return (React__default.createElement("div", { className: "leadgen-empty" },
4006
4019
  React__default.createElement("div", { className: "leadgen-empty_body" },
4007
4020
  React__default.createElement("div", { className: "leadgen-empty_wrapper" },
@@ -4017,7 +4030,7 @@ const SubtitleBlock = ({ children, align, }) => (React__default.createElement("p
4017
4030
  const TitleBlock = ({ children, align, }) => (React__default.createElement("h2", { className: `lead-modal__title ${'le-text-align-' + (align || '')} ${LEAD_CLASS}` }, children));
4018
4031
 
4019
4032
  const LightboxFields = ({ listBlockAdded, popupId, locale, hasSubmitBtn, isSubmitLoading, disabledButtonSubmit, }) => {
4020
- const { t } = useTranslations();
4033
+ const { t } = useLeadGenTranslations();
4021
4034
  const { setRedirectUrl } = useContext(LeadGenContext$1);
4022
4035
  const form = useLeadFormContext();
4023
4036
  const formValues = form.values;
@@ -4343,7 +4356,7 @@ const HeaderImage = ({ src, ratio = 3 / 2, className, style, }) => {
4343
4356
 
4344
4357
  const OtpBlock = ({ otpData, onSuccess, autoSendWhenOpen, }) => {
4345
4358
  const { primaryColor } = useContext(LeadGenContext$1);
4346
- const { t } = useTranslations();
4359
+ const { t } = useLeadGenTranslations();
4347
4360
  const phone = otpData.phone;
4348
4361
  const otpType = otpData.type;
4349
4362
  const [otp, setOtp] = useState('');
@@ -4556,7 +4569,7 @@ const StyledImageWrap = styled.div `
4556
4569
  `;
4557
4570
 
4558
4571
  const FreebieLuckyGiftItem = ({ isHostedByClient, locale, data: { image, name, desc, prize_value, prize_unit, cta_button, winning_slot, }, }) => {
4559
- const { t } = useTranslations();
4572
+ const { t } = useLeadGenTranslations();
4560
4573
  console.log(prize_value, prize_unit, locale);
4561
4574
  const formattedPrice = prize_value && prize_unit
4562
4575
  ? currencyFormat(prize_value, locale, prize_unit)
@@ -4608,7 +4621,7 @@ const FreebieCarousel = ({ isHostedByClient, data, locale, }) => {
4608
4621
  const { classes } = useStyles(undefined, {
4609
4622
  name: 'Carousel',
4610
4623
  });
4611
- const { t } = useTranslations();
4624
+ const { t } = useLeadGenTranslations();
4612
4625
  const freeSample = data.filter((item) => item.type === EFreebieType.SAMPLE);
4613
4626
  const luckyGift = data.filter((item) => item.type === EFreebieType.LUCKY_DRAW);
4614
4627
  const isHasLuckyGift = luckyGift.length > 0;
@@ -5383,7 +5396,7 @@ const formatTrackingData = (params) => {
5383
5396
  };
5384
5397
 
5385
5398
  // mount css
5386
- const _LeadGen = ({ apiUrl: apiUrlProp, siteDomain, siteId, locale, primaryColor, apiSubotUrl, DEBUG_URL, forceCampaign, children, extraPayloadValues = [], excludeExitRulesHandler, userInfo, onClose: onCloseProps, onSubmit: onSubmitProps, }) => {
5399
+ const _LeadGen = ({ apiUrl: apiUrlProp, siteDomain, siteId, locale, primaryColor, apiSubotUrl, DEBUG_URL, forceCampaign, children, extraPayloadValues = [], excludeExitRulesHandler, userInfo, onClose: onCloseProps, onSubmit: onSubmitProps, formatMessage, }) => {
5387
5400
  var _a, _b;
5388
5401
  const scrollEventHandlerRef = useRef();
5389
5402
  const leadStartTimeRef = useRef(Date.now());
@@ -5738,7 +5751,7 @@ const _LeadGen = ({ apiUrl: apiUrlProp, siteDomain, siteId, locale, primaryColor
5738
5751
  redirectUrl,
5739
5752
  setRedirectUrl,
5740
5753
  } },
5741
- React__default.createElement(TranslationsContext.Provider, { value: { locale, values: getTranslations(locale) } },
5754
+ React__default.createElement(LeadGenTranslationProvider, { locale: locale, formatMessage: formatMessage },
5742
5755
  React__default.createElement(MantineProvider, { locale: locale, customStyleType: CustomStylesType.LEADGEN }, children ? (React__default.createElement(Component, { campaign: showCampaign, onSubmit: onSubmit, onClose: onClose, showThankyou: showThankyou, setShowThankyou: setShowThankyou, locale: locale, showEmpty: showEmpty, setShowEmpty: setShowEmpty, userInfo: userInfo }, children)) : (React__default.createElement(Portal, { target: getPopupWrapperDom() },
5743
5756
  React__default.createElement(Box, { sx: { position: 'fixed', zIndex: ZINDEX_SSO - 9e6 } },
5744
5757
  React__default.createElement(Transition, { mounted: Boolean(((_b = showCampaign === null || showCampaign === void 0 ? void 0 : showCampaign.extra_fields) === null || _b === void 0 ? void 0 : _b.popupVersion) === '2.1'), transition: "fade", duration: 600, timingFunction: "ease", exitDuration: 200 }, (styles) => {