@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/lead.js CHANGED
@@ -2,65 +2,56 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var tslib_es6 = require('./tslib.es6-94e53345.js');
5
+ var tslib_es6 = require('./tslib.es6-32438f57.js');
6
6
  var React = require('react');
7
7
  var core = require('@mantine/core');
8
8
  var debounce = require('lodash/debounce');
9
9
  var form = require('@mantine/form');
10
10
  var dayjs = require('dayjs');
11
- var index = require('./index-c02fde76.js');
11
+ var index = require('./index-0570f20a.js');
12
12
  var miscCookieHelper = require('./miscCookieHelper.js');
13
- var index$1 = require('./index-c0f491cf.js');
14
- var translationsContext = require('./translationsContext-a23cbbd8.js');
15
- var utils$1 = require('./utils-436658bb.js');
16
- var index$2 = require('./index-eb19ca77.js');
17
- var index$3 = require('./index-43a81947.js');
18
- var index$5 = require('./index-cf3274d7.js');
19
- var index$4 = require('./index-63ce41d3.js');
20
- var index$9 = require('./index-c0e9e0bd.js');
21
- require('./index.styles-35e95153.js');
13
+ var translationsProvider = require('./translationsProvider-1a3f4c69.js');
14
+ var index$1 = require('./index-366354c9.js');
15
+ var translationsContext = require('./translationsContext-2057a072.js');
16
+ var utils$1 = require('./utils-4e787da9.js');
17
+ var index$2 = require('./index-f0e815f1.js');
18
+ var index$3 = require('./index-c06fecd6.js');
19
+ var index$5 = require('./index-b2ac64db.js');
20
+ var index$4 = require('./index-048722ab.js');
21
+ var index$9 = require('./index-4e847075.js');
22
+ require('./index.styles-d012f777.js');
22
23
  var hooks = require('@mantine/hooks');
23
- require('./index-7d4d8b55.js');
24
- require('./index-b118a3e7.js');
25
- var utils = require('./utils-9924371b.js');
24
+ require('./index-9ec9f9d4.js');
25
+ require('./index-5ab55624.js');
26
+ var utils = require('./utils-98559d51.js');
26
27
  var dates = require('@mantine/dates');
27
- var index$7 = require('./index-f5ebb62f.js');
28
- var index$c = require('./index-a9ac3b43.js');
29
- require('./index-7b687aa2.js');
30
- var usePlacesAutocomplete = require('./usePlacesAutocomplete-bc5cc972.js');
31
- var index$6 = require('./index-982914eb.js');
32
- var translationsProvider = require('./translationsProvider-c25284a8.js');
33
- var Locale = require('./Locale-43704578.js');
28
+ var index$7 = require('./index-9a36414e.js');
29
+ var index$c = require('./index-2f7adb56.js');
30
+ require('./index-4890570c.js');
31
+ var usePlacesAutocomplete = require('./usePlacesAutocomplete-6bb93dd8.js');
32
+ var index$6 = require('./index-3d4023fb.js');
33
+ var Locale = require('./Locale-f24f8e73.js');
34
34
  var uuid = require('uuid');
35
35
  var constantsDomainLocales = require('./constantsDomainLocales.js');
36
36
  var PhoneInputBase = require('react-phone-number-input');
37
37
  var styled = require('@emotion/styled');
38
38
  var miscTheme = require('./miscTheme.js');
39
- var index$8 = require('./index-ab3cd2a8.js');
40
- var togetherComponentGlobalContext = require('./utils-30f19bbd.js');
41
- var index$a = require('./index-275f5e50.js');
42
- var index$b = require('./index-24ab4b59.js');
43
- var index$d = require('./index-ed151b2b.js');
39
+ var index$8 = require('./index-8c1779dd.js');
40
+ var togetherComponentGlobalContext = require('./utils-8b3db262.js');
41
+ var index$a = require('./index-4183a3a2.js');
42
+ var index$b = require('./index-4cc4e94c.js');
43
+ var index$d = require('./index-eb8ad24a.js');
44
44
  var framerMotion = require('framer-motion');
45
45
  var ReactDOM = require('react-dom');
46
46
  var arrow = require('@hhgtech/icons/arrow');
47
47
  var core$1 = require('@hhgtech/icons/core');
48
- var InputDate = require('./InputDate-bb0fa11c.js');
48
+ var InputDate = require('./InputDate-aa02d9a5.js');
49
49
  var carousel = require('@mantine/carousel');
50
- var utils$2 = require('./utils-7a4f4458.js');
51
- var index$e = require('./index-bfce02ba.js');
52
- var Close = require('./Close-705a7add.js');
50
+ var utils$2 = require('./utils-4b7f1f41.js');
51
+ var index$e = require('./index-69f935ae.js');
52
+ var Close = require('./Close-b1efd086.js');
53
53
  require('./constantsIsProduction.js');
54
- require('./normalizeLink-a18477f5.js');
55
- require('@hhgtech/icons/other');
56
- require('classnames');
57
- require('./useUniqueId-3a53bb99.js');
58
- require('./constantsSite.js');
59
- require('@emotion/react');
60
- require('./shared-916c6ada.js');
61
- require('@mantine/notifications');
62
- require('date-fns/locale');
63
- require('./constantsRiskScreener.js');
54
+ require('./normalizeLink-cb644fd3.js');
64
55
  require('./i18n-values/en-PH.js');
65
56
  require('./i18n-values/hi-IN.js');
66
57
  require('./i18n-values/id-ID.js');
@@ -73,11 +64,20 @@ require('./i18n-values/vi-VN.js');
73
64
  require('./i18n-values/vi-VN_MB.js');
74
65
  require('./i18n-values/zh-SG.js');
75
66
  require('./i18n-values/zh-TW.js');
76
- require('./index-cdf1873d.js');
67
+ require('@hhgtech/icons/other');
68
+ require('classnames');
69
+ require('./useUniqueId-80352f05.js');
70
+ require('./constantsSite.js');
71
+ require('@emotion/react');
72
+ require('./shared-d5ae85ac.js');
73
+ require('@mantine/notifications');
74
+ require('date-fns/locale');
75
+ require('./constantsRiskScreener.js');
76
+ require('./index-a5ed4245.js');
77
77
  require('slugify');
78
78
  require('string-format');
79
79
  require('./togetherApiPaths.js');
80
- require('./constants-e9cca1ba.js');
80
+ require('./constants-87793bc2.js');
81
81
  require('vaul');
82
82
 
83
83
  function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
@@ -725,979 +725,992 @@ const clearCacheUsedEmailOrPhone = () => {
725
725
  validatedCache.phoneOnly = {};
726
726
  };
727
727
 
728
- // You can give context variables any name
729
- const [LeadFormProvider$1, useLeadFormContext$1, useLeadForm$1] = form.createFormContext();
730
- const useLeadFormConfig$1 = ({ listBlockAdded = [], validatingPhoneRef, validatingEmailRef, campaignId, campaign_subot_id = [], userInfo, }) => {
731
- const { t } = index$1.useTranslations();
732
- const initialValues = React.useMemo(() => formatLeadGenFormValue(mappingSSOToLead(userInfo), listBlockAdded), [userInfo === null || userInfo === void 0 ? void 0 : userInfo.id]);
733
- React.useEffect(() => {
734
- if (!window.intlTelInputUtils) {
735
- require('intl-tel-input/build/js/utils');
736
- }
737
- }, []);
738
- const validateObj = React.useMemo(() => {
739
- const InputBlocks = [
740
- 'TextBlock',
741
- 'NumberBlock',
742
- 'EmailBlock',
743
- 'PhoneBlock',
744
- 'DateBlock',
745
- 'CheckboxBlock',
746
- 'RadioBlock',
747
- 'DropdownBlock',
748
- 'PhoneOtpBlock',
749
- 'WhatsappOtpBlock',
750
- 'ZaloOtpBlock',
751
- 'LocationBlock',
752
- 'TncBlock',
753
- ];
754
- // ALL are required and can skip if not touched yet
755
- const withSharedCheck = (name, cb,
756
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
757
- block) => {
758
- return (value) => {
759
- var _a;
760
- const isBLockRequired = (_a = block === null || block === void 0 ? void 0 : block.data) === null || _a === void 0 ? void 0 : _a.required;
761
- if (!formRef.current.isTouched(name))
762
- return;
763
- if (typeof value === 'undefined' ||
764
- value === '' ||
765
- (Array.isArray(value) && value.length === 0)) {
766
- return isBLockRequired
767
- ? t('validator.required')
768
- : cb === null || cb === void 0 ? void 0 : cb(value);
769
- }
770
- return cb === null || cb === void 0 ? void 0 : cb(value);
771
- };
772
- };
773
- return listBlockAdded
774
- .filter((b) => InputBlocks.includes(b.name))
775
- .reduce((r, b) => {
776
- var _a;
777
- const isRequired = (_a = b.data.required) !== null && _a !== void 0 ? _a : true;
778
- if (b.name === 'NumberBlock') {
779
- return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, (value) => {
780
- if (value && isNaN(Number(value))) {
781
- return t('validator.number');
782
- }
783
- }, b) });
784
- }
785
- else if (b.name === 'EmailBlock') {
786
- return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, (value) => {
787
- if (value && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value)) {
788
- return t('validator.email');
789
- }
790
- if (!value)
791
- return;
792
- validatingEmailRef.current = true;
793
- setTimeout(() => {
794
- formRef.current.setFieldError(b.data.value, 'Validating...');
795
- checkUsedEmailOrPhoneWithCache(campaignId, campaign_subot_id, {
796
- email: value,
797
- })
798
- .then((tKey) => {
799
- if (tKey) {
800
- formRef.current.setFieldError(b.data.value, t(tKey));
801
- }
802
- else {
803
- formRef.current.clearFieldError(b.data.value);
804
- }
805
- validatingEmailRef.current = false;
806
- })
807
- .catch((e) => {
808
- console.error(e);
809
- formRef.current.setFieldError(b.data.value, e.message || 'Something went wrong');
810
- validatingEmailRef.current = false;
811
- });
812
- }, 200);
813
- }, b) });
814
- }
815
- else if (b.name === 'PhoneBlock' ||
816
- b.name === 'PhoneOtpBlock' ||
817
- b.name === 'ZaloOtpBlock' ||
818
- b.name === 'WhatsappOtpBlock') {
819
- return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, (value) => {
820
- if (value &&
821
- window.intlTelInputUtils &&
822
- !window.intlTelInputUtils.isValidNumber(String(value), LEAD_LOCALE.countryCode)) {
823
- return t('validator.phone');
824
- }
825
- if (!value)
826
- return;
827
- validatingPhoneRef.current = true;
828
- setTimeout(() => {
829
- formRef.current.setFieldError(b.data.value, 'Validating...');
830
- if (b.data.singleSubmission) {
831
- checkUsedPhoneOnlyWithCache(campaignId, value)
832
- .then((tKey) => {
833
- if (tKey) {
834
- formRef.current.setFieldError(b.data.value, t(tKey));
835
- }
836
- else {
837
- formRef.current.clearFieldError(b.data.value);
838
- }
839
- validatingPhoneRef.current = false;
840
- })
841
- .catch((err) => {
842
- console.error(err);
843
- formRef.current.setFieldError(b.data.value, err.message || 'Something went wrong');
844
- validatingPhoneRef.current = false;
845
- });
846
- }
847
- else {
848
- checkUsedEmailOrPhoneWithCache(campaignId, campaign_subot_id, {
849
- phone: value,
850
- })
851
- .then((tKey) => {
852
- if (tKey) {
853
- formRef.current.setFieldError(b.data.value, t(tKey));
854
- }
855
- else {
856
- formRef.current.clearFieldError(b.data.value);
857
- }
858
- validatingPhoneRef.current = false;
859
- })
860
- .catch((e) => {
861
- console.error(e);
862
- formRef.current.setFieldError(b.data.value, e.message || 'Something went wrong');
863
- validatingPhoneRef.current = false;
864
- });
865
- }
866
- }, 200);
867
- }, b) });
868
- }
869
- else if (b.name === 'DateBlock') {
870
- return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, (value) => {
871
- if (value && isNaN(Date.parse(value))) {
872
- return t('validator.date');
873
- }
874
- }, b) });
875
- }
876
- else if (b.name === 'TncBlock') {
877
- return Object.assign(Object.assign({}, r), { [`TNC-` + b.id]: withSharedCheck('TNC-' + b.id, (value) => {
878
- if (isRequired && !value) {
879
- return t('validator.required');
880
- }
881
- }, b) });
882
- }
883
- else {
884
- return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, undefined, b) });
885
- }
886
- }, {});
887
- }, [listBlockAdded.map((b) => b.name).join(',')]);
888
- const form = useLeadForm$1({
889
- validateInputOnChange: true,
890
- clearInputErrorOnChange: true,
891
- validate: validateObj,
892
- initialValues,
893
- });
894
- const formRef = React.useRef(form);
895
- formRef.current = form;
896
- return { form, validateObj };
728
+ var enPH = {
729
+ "validator.required": "This field is required.",
730
+ "validator.remote": "Please fix this field.",
731
+ "validator.email": "Please enter a valid email address.",
732
+ "validator.phone": "Please input correct phone number.",
733
+ "validator.url": "Please enter a valid URL.",
734
+ "validator.date": "Please enter a valid date.",
735
+ "validator.dateISO": "Please enter a valid date (ISO).",
736
+ "validator.number": "Please enter a valid number.",
737
+ "validator.digits": "Please enter only digits.",
738
+ "validator.creditcard": "Please enter a valid credit card number.",
739
+ "validator.equalTo": "Please enter the same value again.",
740
+ "validator.accept": "Please enter a value with a valid extension.",
741
+ "validator.maxlength": "jQuery.validator.format('Please enter no more than {0} characters.",
742
+ "validator.minlength": "jQuery.validator.format('Please enter at least {0} characters.",
743
+ "validator.rangelength": "jQuery.validator.format('Please enter a value between {0} and {1} characters long.",
744
+ "validator.range": "jQuery.validator.format('Please enter a value between {0} and {1}.",
745
+ "validator.max": "jQuery.validator.format('Please enter a value less than or equal to {0}.",
746
+ "validator.min": "jQuery.validator.format('Please enter a value greater than or equal to {0}.",
747
+ "validator.emailUsed": "Email already in use for this campaign.",
748
+ "validator.phoneUsed": "Your phone number already in use for this campaign.",
749
+ "validator.dateInvalid": "This date is not valid, please update.",
750
+ "lead.otp.title": "Enter OTP",
751
+ "lead.otp.desc": "We have sent an OTP to your mobile number {phone}",
752
+ "lead.otp.verify": "Verify",
753
+ "lead.otp.resend": "Resend OTP{timer}",
754
+ "lead.otp.phoneLabel": "Phone OTP",
755
+ "lead.otp.phonePlaceholder": "Enter OTP",
756
+ "lead.empty.title": "Oops, seem your information is empty, do you want to submit the information again?",
757
+ "lead.empty.cancel": "Cancel",
758
+ "lead.empty.submitAgain": "Submit again",
759
+ "inlineFreebie.freeSample.title": "Free Sample",
760
+ "inlineFreebie.luckyDrawGift.title": "Lucky-draw Gift",
761
+ "inlineFreebie.value": "Value",
762
+ "common.day": "Day",
763
+ "common.month": "Month",
764
+ "common.year": "Year"
897
765
  };
898
766
 
899
- const Component = ({ campaign, onClose: onCloseProp, onOtherSubmit, onSubmit, showThankyou, setShowThankyou, locale, children, showEmpty, setShowEmpty, userInfo, }) => {
900
- var _a, _b;
901
- const extraFields = campaign.extra_fields;
902
- const campaignId = campaign.id;
903
- const campaign_subot_id = campaign.bot_id || [];
904
- const listBlockAdded = JSON.parse(extraFields.listBlockAdded);
905
- const actionBlocks = JSON.parse(extraFields.actionBlocks);
906
- const textBlocks = JSON.parse(extraFields.textBlocks);
907
- 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) || '';
908
- const description = textBlocks.subtitleBlock.data.value;
909
- const validatingPhoneRef = React.useRef(false);
910
- const validatingEmailRef = React.useRef(false);
911
- const leadFormConfig = useLeadFormConfig$1({
912
- listBlockAdded,
913
- validatingPhoneRef,
914
- validatingEmailRef,
915
- campaignId,
916
- campaign_subot_id,
917
- userInfo,
918
- });
919
- const [showOtpPhone, setShowOtpPhone] = React.useState(null);
920
- const [formRef, setFormRef] = React.useState(null);
921
- const onClose = () => {
922
- if (showOtpPhone) {
923
- setShowOtpPhone(null);
924
- }
925
- else {
926
- onCloseProp === null || onCloseProp === void 0 ? void 0 : onCloseProp();
927
- }
928
- };
929
- React.useEffect(() => {
930
- clearCacheUsedEmailOrPhone();
931
- }, []);
932
- return campaign ? (React__default["default"].createElement(LeadGenComponentContext.Provider, { value: {
933
- campaignId,
934
- campaign_subot_id,
935
- heading,
936
- description,
937
- listBlockAdded,
938
- textBlocks,
939
- actionBlocks,
940
- leadFormConfig,
941
- validatingEmailRef,
942
- validatingPhoneRef,
943
- formRef: { current: formRef },
944
- setFormRef,
945
- locale,
946
- onClose,
947
- onOtherSubmit,
948
- showOtpPhone,
949
- setShowOtpPhone,
950
- onSubmit,
951
- showThankyou,
952
- setShowThankyou,
953
- showEmpty,
954
- setShowEmpty,
955
- } }, children)) : null;
767
+ var hiIN = {
768
+ "validator.required": "इस क्षेत्र की आवश्यकता है।",
769
+ "validator.email": "कृपया एक मान्य ईमेल पता दर्ज करें",
770
+ "validator.number": "कृपया एक वैध संख्या दर्ज करें",
771
+ "validator.digits": "कृपया केवल अंक दर्ज करें",
772
+ "validator.maxlength": "कृपया {0} अक्षर से अधिक दर्ज न करें",
773
+ "validator.minlength": "कृपया कम से कम {0} अक्षर दर्ज करें",
774
+ "validator.phone": "कृपया एक वैध संख्या दर्ज करें",
775
+ "validator.dateInvalid": "यह तिथि मान्य नहीं है, कृपया अपडेट करें।",
776
+ "validator.emailUsed": "Email already in use for this campaign.",
777
+ "validator.phoneUsed": "Your phone number already in use for this campaign.",
778
+ "lead.otp.title": "Enter OTP",
779
+ "lead.otp.desc": "We have sent an OTP to your mobile number {phone}",
780
+ "lead.otp.verify": "Verify",
781
+ "lead.otp.resend": "Resend OTP{timer}",
782
+ "lead.empty.title": "ऊप्स! लगता है आपकी जानकारी खाली है। क्या आप जानकारी फिर से सबमिट करना चाहते हैं?",
783
+ "lead.empty.cancel": "रद्द करें",
784
+ "lead.empty.submitAgain": "फिर से सबमिट करें",
785
+ "inlineFreebie.freeSample.title": "मुफ्त नमूना",
786
+ "inlineFreebie.luckyDrawGift.title": "लकी-ड्रा गिफ्ट",
787
+ "inlineFreebie.value": "मूल्य",
788
+ "common.day": "साल",
789
+ "common.month": "महीना",
790
+ "common.year": ""
956
791
  };
957
792
 
958
- const Description = (_a) => {
959
- var rest = tslib_es6.__rest(_a, []);
960
- const { description } = React.useContext(LeadGenComponentContext);
961
- return description ? (React__default["default"].createElement(index$2.Text, Object.assign({ size: "p3" }, rest), description)) : null;
793
+ var idID = {
794
+ "validator.required": "Kolom ini wajib diisi",
795
+ "validator.email": "Tolong daftarkan email yang valid",
796
+ "validator.number": "Tolong daftarkan nomor telepon yang valid",
797
+ "validator.digits": "Tolong masukkan angka saja",
798
+ "validator.maxlength": "Jangan memasukkan lebih dari {0} karakter",
799
+ "validator.minlength": "Tolong ketik sedikitnya {0} karakter",
800
+ "validator.phone": "Tolong daftarkan nomor telepon yang valid",
801
+ "validator.emailUsed": "Email sudah digunakan untuk kampanye ini.",
802
+ "validator.phoneUsed": "Nomor telepon Anda sudah digunakan untuk kampanye ini.",
803
+ "validator.dateInvalid": "Tanggal ini tidak valid, silakan perbarui",
804
+ "lead.otp.title": "Masukkan OTP",
805
+ "lead.otp.desc": "Kami telah mengirimkan OTP ke nomor ponsel Anda {phone}",
806
+ "lead.otp.verify": "Verifikasi",
807
+ "lead.otp.resend": "Kirim Ulang OTP {timer}",
808
+ "lead.otp.phoneLabel": "OTP Telepon",
809
+ "lead.otp.phonePlaceholder": "Masukkan OTP",
810
+ "lead.empty.title": "Oops, sepertinya informasi Anda kosong. Apakah Anda ingin mengirimkan informasi lagi?",
811
+ "lead.empty.cancel": "Batal",
812
+ "lead.empty.submitAgain": "Kirim lagi",
813
+ "inlineFreebie.freeSample.title": "Sampel Gratis",
814
+ "inlineFreebie.luckyDrawGift.title": "Hadiah Undian",
815
+ "inlineFreebie.value": "Nilai",
816
+ "common.day": "Hari",
817
+ "common.month": "Bulan",
818
+ "common.year": "Tahun"
962
819
  };
963
820
 
964
- const LeadGenContext$1 = React.createContext({});
965
-
966
- var useStyles$3 = core.createStyles(() => {
967
- return {
968
- control: {},
969
- };
970
- });
821
+ var kmKH = {
822
+ "validator.required": "ព័ត៌មាន​ចាំបាច់​ដែល​ត្រូវ​បំពេញ",
823
+ "validator.email": "សូម​វាយ​អាសយដ្ឋាន​អ៊ីម៉ែល​ឲ្យ​បាន​ត្រឹមត្រូវ",
824
+ "validator.number": "សូម​វាយបញ្ចូល​លេខ​ឲ្យ​បាន​ត្រឹមត្រូវ",
825
+ "validator.digits": "វាយ​បញ្ចូល​បាន​តែ​លេខ​ប៉ុណ្ណោះ",
826
+ "validator.maxlength": "សូម​វាយ​បញ្ចូលកុំ​ឲ្យ​លើស {0} តួអក្សរ",
827
+ "validator.minlength": "សូម​វាយ​បញ្ចូល​តិច​បំផុត {0} តួអក្ស",
828
+ "validator.phone": "សូម​វាយបញ្ចូល​លេខ​ឲ្យ​បាន​ត្រឹមត្រូវ",
829
+ "validator.emailUsed": "អ៊ីមែលត្រូវបានប្រើប្រាស់សម្រាប់យុទ្ធនាការនេះរួចហើយ។",
830
+ "validator.phoneUsed": "លេខទូរស័ព្ទរបស់អ្នកត្រូវបានប្រើប្រាស់សម្រាប់យុទ្ធនាការនេះរួចហើយ។",
831
+ "validator.dateInvalid": "កាលបរិច្ឆេទនេះមិនត្រឹមត្រូវទេ សូមធ្វើបច្ចុប្បន្នភាព។",
832
+ "lead.otp.title": "បញ្ចូល OTP",
833
+ "lead.otp.desc": "យើងបានផ្ញើ OTP ទៅកាន់លេខទូរសព្ទរបស់អ្នក {phone}",
834
+ "lead.otp.verify": "ផ្ទៀងផ្ទាត់",
835
+ "lead.otp.resend": "ផ្ញើ OTP ម្តងទៀត {timer}",
836
+ "lead.otp.phoneLabel": "OTP ទូរស័ព្ទ",
837
+ "lead.otp.phonePlaceholder": "បញ្ចូល OTP",
838
+ "lead.empty.title": "អូុបស! ហាក់ដូចជាព័ត៌មានរបស់អ្នកទទេ។ តើអ្នកចង់ដាក់ស្នើព័ត៌មានម្តងទៀតទេ?",
839
+ "lead.empty.cancel": "លុប​ចោល",
840
+ "lead.empty.submitAgain": "ដាក់ស្នើម្ដងទៀត",
841
+ "inlineFreebie.freeSample.title": "សំបុត្រស្រង់ពិន័យ",
842
+ "inlineFreebie.luckyDrawGift.title": "សំបុត្រស្រង់ពិន័យ",
843
+ "inlineFreebie.value": "តម្លៃ",
844
+ "common.day": "ឆ្នាំ",
845
+ "common.month": "ខែ",
846
+ "common.year": "ថ្ងៃ"
847
+ };
971
848
 
972
- const libraries$1 = ['places'];
973
- const LocationBlock = ({ name, placeholder, locale, required = true, }) => {
974
- var _a;
975
- const form = useLeadFormContext$1();
976
- const [searchValue, setSearchValue] = React.useState('');
977
- const [address, setAddress] = React.useState('');
978
- const { predictions } = usePlacesAutocomplete.usePlacesAutocomplete(searchValue, '', locale === 'tl-PH' ? 'en' : (_a = locale === null || locale === void 0 ? void 0 : locale.split('-')) === null || _a === void 0 ? void 0 : _a[0]);
979
- const [LoadScript, setLoadScript] = React.useState(null);
980
- const [ready, setReady] = React.useState(false);
981
- const randRef = React.useRef(Math.random().toString(36).substring(7));
982
- const options = React.useMemo(() => {
983
- const _opts = predictions.map((p) => {
984
- return {
985
- value: p.description,
986
- label: p.description,
987
- };
988
- });
989
- const isExist = _opts.find((o) => o.value === address);
990
- if (!address || isExist) {
991
- return _opts;
992
- }
993
- return [{ value: address, label: address }].concat(_opts);
994
- }, [predictions, address]);
995
- React.useEffect(() => {
996
- var _a, _b, _c;
997
- // only load extra google script when not yet loaded
998
- 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)) {
999
- Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('@react-google-maps/api')); }).then((m) => {
1000
- setLoadScript(() => m.LoadScript);
1001
- setTimeout(() => {
1002
- setReady(true);
1003
- }, 200);
1004
- });
1005
- }
1006
- else {
1007
- setReady(true);
1008
- }
1009
- }, []);
1010
- if (!ready)
1011
- return (React__default["default"].createElement("div", { style: {
1012
- height: 73,
1013
- } }));
1014
- return (React__default["default"].createElement(React__default["default"].Fragment, null,
1015
- LoadScript && (React__default["default"].createElement(LoadScript, { googleMapsApiKey: usePlacesAutocomplete.GOOGLE_API_KEY, libraries: libraries$1, loadingElement: React__default["default"].createElement(React__default["default"].Fragment, null) })),
1016
- React__default["default"].createElement("div", { style: { display: 'none' }, "data-extra": true, "data-name": name, "data-control": 'text' }),
1017
- React__default["default"].createElement(index$3.Select, Object.assign({ className: "lead-modal__form-control", label: placeholder, placeholder: placeholder, withAsterisk: required, name: name, data: options, searchValue: searchValue, onSearchChange: (query) => {
1018
- setSearchValue(query);
1019
- }, filter: () => true, clearable: true, searchable: true, onChange: (val) => setAddress(val || ''), icon: React__default["default"].createElement("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none" },
1020
- React__default["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["default"].createElement(React__default["default"].Fragment, null) }, form.getInputProps(name)))));
849
+ var msMY = {
850
+ "validator.required": "Bahagian ini wajib diisi.",
851
+ "validator.email": "Sila masukkan alamat emel yang sah.",
852
+ "validator.number": "Sila masukkan no telefon yang sah.",
853
+ "validator.digits": "Sila masukkan nombor digit sahaja.",
854
+ "validator.maxlength": "Sila masukkan tidak lebih dari {0} aksara",
855
+ "validator.minlength": "Sila masukkan sekurang-kurangnya {0} aksara",
856
+ "validator.phone": "Sila masukkan no telefon yang sah.",
857
+ "validator.emailUsed": "Emel sudah digunakan untuk kempen ini.",
858
+ "validator.phoneUsed": "Nombor telefon anda sudah digunakan untuk kempen ini.",
859
+ "validator.dateInvalid": "Tarikh ini tidak sah, sila kemas kini",
860
+ "lead.otp.title": "Masukkan OTP",
861
+ "lead.otp.desc": "Kami telah menghantar OTP ke nombor telefon bimbit anda {phone}",
862
+ "lead.otp.verify": "Sahkan",
863
+ "lead.otp.resend": "Hantar semula OTP {timer}",
864
+ "lead.otp.phoneLabel": "OTP Telefon",
865
+ "lead.otp.phonePlaceholder": "Masukkan OTP",
866
+ "lead.empty.title": "Oops, nampaknya maklumat anda kosong. Adakah anda ingin menghantar maklumat semula?",
867
+ "lead.empty.cancel": "Batal",
868
+ "lead.empty.submitAgain": "Hantar semula",
869
+ "inlineFreebie.freeSample.title": "Sampel Percuma",
870
+ "inlineFreebie.luckyDrawGift.title": "Hadiah Undian",
871
+ "inlineFreebie.value": "Nilai",
872
+ "common.day": "Hari",
873
+ "common.month": "Bulan",
874
+ "common.year": "Tahun"
1021
875
  };
1022
876
 
1023
- const SubtitleBlock$1 = ({ children, align, }) => (React__default["default"].createElement("p", { className: `lead-modal__description ${'le-text-align-' + (align || '')} ${LEAD_CLASS}` }, children));
877
+ var myMM = {
878
+ "validator.required": "ဒီနေရာမှာ ဖြည့်ဖို့ လိုအပ်ပါတယ်",
879
+ "validator.email": "မှန်ကန်သော အီးမေးလ်လိပ်စာထည့်သွင်းပါ",
880
+ "validator.number": "မှန်ကန်သော ဖုန်းနံပါတ်ထည့်သွင်းပါ",
881
+ "validator.digits": "နံပါတ်များသာဖြည့်ပါ",
882
+ "validator.maxlength": "ကျေးဇူးပြု၍ {0} ထပ်မပိုသော ဂဏန်းများသာဖြည့်ပါ",
883
+ "validator.minlength": "ကျေးဇူးပြု၍ အနည်းဆုံး {0} ဂဏန်းဖြည့်ပါ",
884
+ "validator.phone": "မှန်ကန်သော ဖုန်းနံပါတ်ထည့်သွင်းပါ",
885
+ "validator.emailUsed": "ဤအေကာင့်အတွက် အီးမေးလ်ကို အသုံးပြုပြီးဖြစ်ပါသည်။",
886
+ "validator.phoneUsed": "ဤအေကာင့်အတွက် သင့်ဖုန်းနံပါတ်ကို အသုံးပြုပြီးဖြစ်ပါသည်။",
887
+ "validator.dateInvalid": "ယနေ့စွဲမှားနေသည်၊ ကျေးဇူးပြု၍ ပြင်ဆင်ပါ။",
888
+ "lead.otp.title": "OTP ကိုထည့်ပါ",
889
+ "lead.otp.desc": "ကျွန်ုပ်တို့သည် OTP ကိုသင့်ဖုန်းနံပါတ် {phone} သို့ပို့ခဲ့သည်",
890
+ "lead.otp.verify": "အတည်ပြုပါ",
891
+ "lead.otp.resend": "OTP ကိုထပ်မံပို့ရန် {timer}",
892
+ "lead.otp.phoneLabel": "ဖုန်း OTP",
893
+ "lead.otp.phonePlaceholder": "OTP ကိုထည့်ပါ",
894
+ "lead.empty.title": "အုပ်စ်! သင့်အချက်အလက်သည် ဗလာဖြစ်နေသလိုဖြစ်သည်။ ထပ်မံတင်သွင်းလိုပါသလား?",
895
+ "lead.empty.cancel": "မလုပ်ဆောင်ပါ",
896
+ "lead.empty.submitAgain": "ထပ်မံတင်သွင်းပါ",
897
+ "inlineFreebie.freeSample.title": "အခမဲ့အစားအစာ",
898
+ "inlineFreebie.luckyDrawGift.title": "အခမဲ့အစားအစာ",
899
+ "inlineFreebie.value": "တန်ဖိုး",
900
+ "common.day": "ရက်",
901
+ "common.month": "လ",
902
+ "common.year": "နှစ်"
903
+ };
1024
904
 
1025
- const TitleBlock$1 = ({ children, align, }) => (React__default["default"].createElement("h2", { className: `lead-modal__title ${'le-text-align-' + (align || '')} ${LEAD_CLASS}` }, children));
905
+ var thTH = {
906
+ "validator.required": "ต้องระบุข้อมูลในช่องนี้",
907
+ "validator.email": "กรุณาใส่อีเมล์ที่ถูกต้อง",
908
+ "validator.number": "กรุณาใส่ตัวเลขที่ถูกต้อง",
909
+ "validator.digits": "กรุณาส่เฉพาะตัวเลข",
910
+ "validator.maxlength": "กรุณาใส่ตัวเลขมากกว่า {0} หลัก",
911
+ "validator.minlength": "กรุณาใส่ตัวเลขอย่างน้อย {0} หลัก",
912
+ "validator.phone": "กรุณาใส่ตัวเลขที่ถูกต้อง",
913
+ "validator.emailUsed": "อีเมลนี้ถูกใช้สำหรับแคมเปญนี้แล้ว",
914
+ "validator.phoneUsed": "หมายเลขโทรศัพท์ของคุณถูกใช้สำหรับแคมเปญนี้แล้ว",
915
+ "validator.dateInvalid": "วันที่นี้ไม่ถูกต้อง โปรดอัปเดต",
916
+ "lead.otp.title": "ป้อน OTP",
917
+ "lead.otp.desc": "เราได้ส่ง OTP ไปยังหมายเลขโทรศัพท์มือถือของคุณ {phone}",
918
+ "lead.otp.verify": "ยืนยัน",
919
+ "lead.otp.resend": "ส่ง OTP อีกครั้ง {timer}",
920
+ "lead.otp.phoneLabel": "OTP โทรศัพท์",
921
+ "lead.otp.phonePlaceholder": "ป้อน OTP",
922
+ "lead.empty.title": "อุ๊ปส์! ดูเหมือนว่าข้อมูลของคุณว่างเปล่า คุณต้องการส่งข้อมูลอีกครั้งหรือไม่?",
923
+ "lead.empty.cancel": "ยกเลิก",
924
+ "lead.empty.submitAgain": "ส่งอีกครั้ง",
925
+ "inlineFreebie.freeSample.title": "ตัวอย่างฟรี",
926
+ "inlineFreebie.luckyDrawGift.title": "ของรางวัลที่ถูกรางวัล",
927
+ "inlineFreebie.value": "ค่า",
928
+ "common.day": "วัน",
929
+ "common.month": "เดือน",
930
+ "common.year": "ปี"
931
+ };
1026
932
 
1027
- const Fields = ({ listBlockAdded, popupId, locale, onClose, onOtherSubmit, styles, classNames, popoverProps, }) => {
1028
- const { primaryColor } = React.useContext(LeadGenContext$1);
1029
- const { classes, cx } = useStyles$3(undefined, {
1030
- name: 'LeadGen__Field',
1031
- styles,
1032
- classNames,
1033
- });
1034
- const form = useLeadFormContext$1();
1035
- return (React__default["default"].createElement(React__default["default"].Fragment, null, listBlockAdded.map((b, index) => {
1036
- var _a;
1037
- const { name = '', data = {} } = b || {};
1038
- const { placeholder, value, align, listQuestion, isSendMailChimp = false, newtab, url, } = data;
1039
- const required = (_a = data.required) !== null && _a !== void 0 ? _a : true;
1040
- switch (name) {
1041
- case 'TitleBlock':
1042
- return (React__default["default"].createElement(TitleBlock$1, { key: index, align: align }, value));
1043
- case 'SubtitleBlock':
1044
- return (React__default["default"].createElement(SubtitleBlock$1, { key: index, align: align }, value));
1045
- case 'TextBlock':
1046
- return (React__default["default"].createElement(index$3.Input, Object.assign({ key: index, withAsterisk: required, spellCheck: false, type: "text", placeholder: placeholder, className: cx('leadgen-control', classes.control),
1047
- // onChangeRaw={(e) => inputOnChange('text', e)}
1048
- label: placeholder, "data-control": "text", "data-lead-control": name, "data-is-required": required, name: value }, form.getInputProps(value))));
1049
- case 'NumberBlock':
1050
- return (React__default["default"].createElement(index$3.NumberInput, Object.assign({ key: index, withAsterisk: required, spellCheck: false, type: "number", placeholder: placeholder, className: cx('leadgen-control', classes.control),
1051
- // onChange={(e) => inputOnChange('number', e)}
1052
- label: placeholder, "data-control": "number", "data-lead-control": name, "data-is-required": required, name: value }, form.getInputProps(value))));
1053
- case 'EmailBlock':
1054
- return (React__default["default"].createElement(index$3.Input, Object.assign({ key: index, withAsterisk: required, spellCheck: false,
1055
- // type="email"
1056
- 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))));
1057
- case 'PhoneOtpBlock':
1058
- case 'WhatsappOtpBlock':
1059
- case 'ZaloOtpBlock':
1060
- case 'PhoneBlock': {
1061
- const id = popupId + '-' + value + '-' + index;
1062
- return (React__default["default"].createElement(index$3.Input.Wrapper, Object.assign({ size: "md", withAsterisk: required, key: index, label: placeholder,
1063
- // error={errorField.phone}
1064
- className: cx('leadgen-control', classes.control), labelProps: {
1065
- htmlFor: id,
1066
- } }, form.getInputProps(value)),
1067
- React__default["default"].createElement(index$3.Phone, { name: value, spellCheck: false, type: "tel", placeholder: placeholder, value: form.getInputProps(value).value, onChange: (v) => {
1068
- form.setFieldValue(value, v);
1069
- },
1070
- // onBlur={(e) => inputOnBlur('tel', e)}
1071
- id: id, defaultCountry: (locale ? utils.MAPPED_LOCALE[locale] || 'VN' : 'VN'), "data-control": "tel", "data-lead-control": name, "data-is-required": required })));
1072
- }
1073
- case 'LocationBlock': {
1074
- return (React__default["default"].createElement(LocationBlock, { key: index, name: value, placeholder: placeholder, locale: locale, required: required }));
1075
- }
1076
- case 'DateBlock':
1077
- return (React__default["default"].createElement(React__default["default"].Fragment, null,
1078
- React__default["default"].createElement(index$5.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))),
1079
- React__default["default"].createElement("input", { type: "hidden", name: value, "data-control": "date" })));
1080
- case 'LinkButtonBlock':
1081
- return (React__default["default"].createElement("div", { key: index },
1082
- React__default["default"].createElement("a", { target: newtab ? 'blank' : 'parrent', href: url, style: { textDecoration: 'none' } },
1083
- React__default["default"].createElement(index$4.Button, { type: "button", size: "md", color: primaryColor, className: `lead-modal__btn ${LEAD_CLASS}`, onClick: () => {
1084
- onClose === null || onClose === void 0 ? void 0 : onClose();
1085
- onOtherSubmit === null || onOtherSubmit === void 0 ? void 0 : onOtherSubmit();
1086
- } }, value))));
1087
- case 'CheckboxBlock':
1088
- return (React__default["default"].createElement(React__default["default"].Fragment, null,
1089
- isSendMailChimp && (React__default["default"].createElement("div", { style: {
1090
- display: 'none',
1091
- }, "data-name": value + '-mailchimp' })),
1092
- React__default["default"].createElement(index$3.Checkbox.Group, Object.assign({ withAsterisk: required, className: cx('leadgen-control', classes.control), key: index, label: placeholder, size: "md", sx: {
1093
- display: 'flex',
1094
- flexDirection: 'column',
1095
- gap: 8,
1096
- } }, form.getInputProps(value)), listQuestion.map((l, _index) => (React__default["default"].createElement(index$3.Checkbox, { name: value, key: _index, value: l.value, label: l.placeholder, "data-control": "checkbox", "data-lead-control": name, "data-is-required": required }))))));
1097
- case 'RadioBlock':
1098
- return (React__default["default"].createElement(React__default["default"].Fragment, null,
1099
- isSendMailChimp && (React__default["default"].createElement(index$3.Input, { type: "hidden", name: value + '-mailchimp', value: isSendMailChimp })),
1100
- React__default["default"].createElement(index$3.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["default"].createElement(index$3.Radio, { name: value, key: _index, value: l.value, label: l.placeholder, "data-control": "radio", "data-lead-control": name, "data-is-required": required }))))));
1101
- case 'DropdownBlock':
1102
- return (React__default["default"].createElement(React__default["default"].Fragment, null,
1103
- React__default["default"].createElement("div", { style: { display: 'none' }, "data-extra": true, "data-name": value, "data-control": 'dropdown', "data-lead-control": name, "data-is-required": required }),
1104
- React__default["default"].createElement(index$3.Select, Object.assign({ key: index, className: cx('leadgen-control', classes.control), label: placeholder, withAsterisk: required, name: value, data: listQuestion.map((l) => ({
1105
- value: l.value,
1106
- label: l.placeholder,
1107
- })) }, form.getInputProps(value)))));
1108
- case 'TncBlock':
1109
- const tncInputProps = form.getInputProps('TNC-' + b.id);
1110
- return (React__default["default"].createElement(React__default["default"].Fragment, null,
1111
- React__default["default"].createElement(index$3.Checkbox, Object.assign({ name: 'TNC-' + b.id, key: b.id, label: React__default["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 }))));
1112
- }
1113
- return null;
1114
- })));
933
+ var viVN = {
934
+ "validator.required": "Vui lòng điền mục này",
935
+ "validator.email": "Vui lòng điền email thật.",
936
+ "validator.number": "Vui lòng điền số có thật",
937
+ "validator.digits": "Vui lòng chỉ điền số",
938
+ "validator.maxlength": "Vui lòng điền dưới {0} số",
939
+ "validator.minlength": "Vui lòng điền hơn {0} số",
940
+ "validator.remote": "Hãy sửa cho đúng.",
941
+ "validator.url": "Hãy nhập URL.",
942
+ "validator.date": "Hãy nhập ngày.",
943
+ "validator.dateISO": "Hãy nhập ngày (ISO).",
944
+ "validator.creditcard": "Hãy nhập số thẻ tín dụng.",
945
+ "validator.equalTo": "Hãy nhập thêm lần nữa.",
946
+ "validator.extension": "Phần mở rộng không đúng.",
947
+ "validator.rangelength": "Hãy nhập từ {0} đến {1} kí tự.",
948
+ "validator.range": "Hãy nhập từ {0} đến {1}.",
949
+ "validator.max": "Hãy nhập từ {0} trở xuống.",
950
+ "validator.min": "Hãy nhập từ {0} trở lên.",
951
+ "validator.phone": "Nhập đúng định dạng số điện thoại",
952
+ "validator.emailUsed": "Email này đã được sử dụng.",
953
+ "validator.phoneUsed": "Số điện thoại này đã được sử dụng.",
954
+ "validator.dateInvalid": "Ngày này không hợp lệ, vui lòng cập nhật.",
955
+ "lead.otp.title": "Nhập OTP",
956
+ "lead.otp.desc": "Chúng tôi đã gửi OTP đến số điện thoại của bạn {phone}",
957
+ "lead.otp.verify": "Xác minh",
958
+ "lead.otp.resend": "Gửi lại OTP {timer}",
959
+ "lead.otp.phoneLabel": "Nhập OTP",
960
+ "lead.otp.phonePlaceholder": "Nhập OTP",
961
+ "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?",
962
+ "lead.empty.cancel": "Hủy",
963
+ "lead.empty.submitAgain": "Gửi lại",
964
+ "inlineFreebie.freeSample.title": "Dùng thử miễn phí",
965
+ "inlineFreebie.luckyDrawGift.title": "Phần thưởng may mắn",
966
+ "inlineFreebie.value": "Trị giá",
967
+ "common.day": "Ngày",
968
+ "common.month": "Tháng",
969
+ "common.year": "Năm"
1115
970
  };
1116
971
 
1117
- var useStyles$2 = core.createStyles((theme) => {
1118
- return {
1119
- root: {},
1120
- header: {},
1121
- heading: {},
1122
- description: {},
1123
- term: {
1124
- a: {
1125
- color: theme.fn.primaryColor(),
1126
- },
1127
- },
1128
- controlList: {},
1129
- control: {},
1130
- submitBtn: {},
1131
- submitBtnWrapper: {},
1132
- };
1133
- });
972
+ var zhTW = {
973
+ "validator.required": "此為必填欄位",
974
+ "validator.email": "請填入有效的 email 地址",
975
+ "validator.number": "請填入有效的電話號碼",
976
+ "validator.digits": "此欄位僅能輸入數字",
977
+ "validator.maxlength": "請輸入少於 {0} 位數",
978
+ "validator.minlength": "請輸入至少 {0} 位數",
979
+ "validator.phone": "請填入有效的電話號碼",
980
+ "validator.emailUsed": "此電子郵件已被使用於此活動。",
981
+ "validator.phoneUsed": "您的手機號碼已被使用於此活動。",
982
+ "validator.dateInvalid": "此日期無效,請更新.",
983
+ "lead.otp.title": "輸入 OTP",
984
+ "lead.otp.desc": "我們已將 OTP 發送到您的手機號碼 {phone}",
985
+ "lead.otp.verify": "驗證",
986
+ "lead.otp.resend": "重新發送 OTP {timer}",
987
+ "lead.otp.phoneLabel": "電話 OTP",
988
+ "lead.otp.phonePlaceholder": "輸入 OTP",
989
+ "lead.empty.title": "哎呀,您的資訊似乎是空的,您想要重新提交資訊嗎?",
990
+ "lead.empty.cancel": "取消",
991
+ "lead.empty.submitAgain": "重新提交",
992
+ "inlineFreebie.freeSample.title": "免費試用",
993
+ "inlineFreebie.luckyDrawGift.title": "幸運抽獎禮品",
994
+ "inlineFreebie.value": "價值",
995
+ "common.day": "日",
996
+ "common.month": "月",
997
+ "common.year": "年"
998
+ };
1134
999
 
1135
- const Heading = (_a) => {
1136
- var rest = tslib_es6.__rest(_a, []);
1137
- const { heading } = React.useContext(LeadGenComponentContext);
1138
- return heading ? (React__default["default"].createElement(index$2.Text, Object.assign({ size: "h3" }, rest), heading)) : null;
1000
+ const translationsMap = {
1001
+ 'en-PH': enPH,
1002
+ 'vi-VN': viVN,
1003
+ 'hi-IN': hiIN,
1004
+ 'id-ID': idID,
1005
+ 'ms-MY': msMY,
1006
+ 'my-MM': myMM,
1007
+ 'km-KH': kmKH,
1008
+ 'zh-TW': zhTW,
1009
+ 'zh-SG': zhTW,
1010
+ 'th-TH': thTH,
1011
+ 'tl-PH': enPH,
1012
+ };
1013
+ const getTranslations = (locale) => {
1014
+ const translations = Object.assign(Object.assign({}, translationsProvider.translationsMap[locale]), translationsMap[locale]);
1015
+ if (translations) {
1016
+ return translations;
1017
+ }
1018
+ return translationsMap['en-PH'];
1139
1019
  };
1140
1020
 
1141
- const FormComponent = ({ styles, className, classNames, fillInfo, popoverProps, submitProps, }) => {
1142
- var _a;
1143
- const { primaryColor } = React.useContext(LeadGenContext$1);
1144
- const { listBlockAdded, leadFormConfig: { form, validateObj }, validatingEmailRef, validatingPhoneRef,
1145
- // formRef,
1146
- setFormRef, onClose, onOtherSubmit, actionBlocks, locale, setShowOtpPhone, onSubmit, } = React.useContext(LeadGenComponentContext);
1147
- const { classes, cx } = useStyles$2(undefined, {
1148
- name: 'LeadGen__FormComponent',
1149
- styles,
1150
- classNames,
1151
- });
1152
- const [isSubmitLoading, setIsSubmitLoading] = React.useState(false);
1153
- const popUpSubmitText = actionBlocks.submitBlock.data.value;
1154
- const middlewareOnSubmit = (e) => {
1155
- e.preventDefault();
1156
- // mark all as touched to allow validation
1157
- form.setTouched(Object.keys(validateObj).reduce((acc, cur) => {
1158
- acc[cur] = true;
1159
- return acc;
1160
- }, {}));
1161
- if (validatingEmailRef.current || validatingPhoneRef.current) {
1162
- return;
1021
+ const FormatMessageContext = React.createContext(null);
1022
+ const LeadGenTranslationProvider = ({ locale, formatMessage, children, }) => {
1023
+ const translationContextValue = React.useMemo(() => ({ locale, values: getTranslations(locale) }), [locale]);
1024
+ return (React__default["default"].createElement(FormatMessageContext.Provider, { value: formatMessage || null }, formatMessage ? (children) : (React__default["default"].createElement(translationsContext.TranslationsContext.Provider, { value: translationContextValue }, children))));
1025
+ };
1026
+ const useLeadGenTranslations = () => {
1027
+ const externalFormatMessage = React.useContext(FormatMessageContext);
1028
+ const { t: internalT, locale } = index$1.useTranslations();
1029
+ const t = React.useMemo(() => {
1030
+ if (externalFormatMessage) {
1031
+ return (key, options) => {
1032
+ return externalFormatMessage({ id: key, defaultMessage: key }, options);
1033
+ };
1163
1034
  }
1164
- setTimeout(() => {
1165
- form.onSubmit((v) => {
1166
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
1167
- if (Object.keys(form.errors).length)
1035
+ return internalT;
1036
+ }, [externalFormatMessage, internalT]);
1037
+ return { t, locale };
1038
+ };
1039
+
1040
+ // You can give context variables any name
1041
+ const [LeadFormProvider$1, useLeadFormContext$1, useLeadForm$1] = form.createFormContext();
1042
+ const useLeadFormConfig$1 = ({ listBlockAdded = [], validatingPhoneRef, validatingEmailRef, campaignId, campaign_subot_id = [], userInfo, }) => {
1043
+ const { t } = useLeadGenTranslations();
1044
+ const initialValues = React.useMemo(() => formatLeadGenFormValue(mappingSSOToLead(userInfo), listBlockAdded), [userInfo === null || userInfo === void 0 ? void 0 : userInfo.id]);
1045
+ React.useEffect(() => {
1046
+ if (!window.intlTelInputUtils) {
1047
+ require('intl-tel-input/build/js/utils');
1048
+ }
1049
+ }, []);
1050
+ const validateObj = React.useMemo(() => {
1051
+ const InputBlocks = [
1052
+ 'TextBlock',
1053
+ 'NumberBlock',
1054
+ 'EmailBlock',
1055
+ 'PhoneBlock',
1056
+ 'DateBlock',
1057
+ 'CheckboxBlock',
1058
+ 'RadioBlock',
1059
+ 'DropdownBlock',
1060
+ 'PhoneOtpBlock',
1061
+ 'WhatsappOtpBlock',
1062
+ 'ZaloOtpBlock',
1063
+ 'LocationBlock',
1064
+ 'TncBlock',
1065
+ ];
1066
+ // ALL are required and can skip if not touched yet
1067
+ const withSharedCheck = (name, cb,
1068
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1069
+ block) => {
1070
+ return (value) => {
1071
+ var _a;
1072
+ const isBLockRequired = (_a = block === null || block === void 0 ? void 0 : block.data) === null || _a === void 0 ? void 0 : _a.required;
1073
+ if (!formRef.current.isTouched(name))
1168
1074
  return;
1169
- let newShowOtpPhone = null;
1170
- if (listBlockAdded.findIndex((x) => x.name === 'PhoneOtpBlock') > -1) {
1171
- // not submit yet, open otp
1172
- 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;
1173
- if ((_c = v[fieldName]) === null || _c === void 0 ? void 0 : _c.startsWith('+')) {
1174
- newShowOtpPhone = {
1175
- phone: v[fieldName],
1176
- type: 'phone',
1177
- };
1178
- }
1075
+ if (typeof value === 'undefined' ||
1076
+ value === '' ||
1077
+ (Array.isArray(value) && value.length === 0)) {
1078
+ return isBLockRequired
1079
+ ? t('validator.required')
1080
+ : cb === null || cb === void 0 ? void 0 : cb(value);
1179
1081
  }
1180
- if (listBlockAdded.findIndex((x) => x.name === 'WhatsappOtpBlock') > -1) {
1181
- // not submit yet, open otp
1182
- 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;
1183
- if ((_f = v[fieldName]) === null || _f === void 0 ? void 0 : _f.startsWith('+')) {
1184
- newShowOtpPhone = {
1185
- phone: v[fieldName],
1186
- type: 'whatsapp',
1187
- };
1188
- }
1189
- }
1190
- if (listBlockAdded.findIndex((x) => x.name === 'ZaloOtpBlock') > -1) {
1191
- // not submit yet, open otp
1192
- 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;
1193
- if ((_j = v[fieldName]) === null || _j === void 0 ? void 0 : _j.startsWith('+')) {
1194
- newShowOtpPhone = {
1195
- phone: v[fieldName],
1196
- type: 'zalo',
1197
- };
1198
- }
1199
- }
1200
- if (newShowOtpPhone) {
1201
- setIsSubmitLoading(true);
1202
- Service.sendSMSOtpLead(newShowOtpPhone)
1203
- .then((res) => {
1204
- var _a;
1205
- const respMessage = (_a = res === null || res === void 0 ? void 0 : res._messages) === null || _a === void 0 ? void 0 : _a[0];
1206
- if (respMessage === 'This phone number was verified') {
1207
- onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit();
1082
+ return cb === null || cb === void 0 ? void 0 : cb(value);
1083
+ };
1084
+ };
1085
+ return listBlockAdded
1086
+ .filter((b) => InputBlocks.includes(b.name))
1087
+ .reduce((r, b) => {
1088
+ var _a;
1089
+ const isRequired = (_a = b.data.required) !== null && _a !== void 0 ? _a : true;
1090
+ if (b.name === 'NumberBlock') {
1091
+ return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, (value) => {
1092
+ if (value && isNaN(Number(value))) {
1093
+ return t('validator.number');
1094
+ }
1095
+ }, b) });
1096
+ }
1097
+ else if (b.name === 'EmailBlock') {
1098
+ return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, (value) => {
1099
+ if (value && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value)) {
1100
+ return t('validator.email');
1101
+ }
1102
+ if (!value)
1208
1103
  return;
1104
+ validatingEmailRef.current = true;
1105
+ setTimeout(() => {
1106
+ formRef.current.setFieldError(b.data.value, 'Validating...');
1107
+ checkUsedEmailOrPhoneWithCache(campaignId, campaign_subot_id, {
1108
+ email: value,
1109
+ })
1110
+ .then((tKey) => {
1111
+ if (tKey) {
1112
+ formRef.current.setFieldError(b.data.value, t(tKey));
1113
+ }
1114
+ else {
1115
+ formRef.current.clearFieldError(b.data.value);
1116
+ }
1117
+ validatingEmailRef.current = false;
1118
+ })
1119
+ .catch((e) => {
1120
+ console.error(e);
1121
+ formRef.current.setFieldError(b.data.value, e.message || 'Something went wrong');
1122
+ validatingEmailRef.current = false;
1123
+ });
1124
+ }, 200);
1125
+ }, b) });
1126
+ }
1127
+ else if (b.name === 'PhoneBlock' ||
1128
+ b.name === 'PhoneOtpBlock' ||
1129
+ b.name === 'ZaloOtpBlock' ||
1130
+ b.name === 'WhatsappOtpBlock') {
1131
+ return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, (value) => {
1132
+ if (value &&
1133
+ window.intlTelInputUtils &&
1134
+ !window.intlTelInputUtils.isValidNumber(String(value), LEAD_LOCALE.countryCode)) {
1135
+ return t('validator.phone');
1209
1136
  }
1210
- setShowOtpPhone(newShowOtpPhone);
1211
- })
1212
- .finally(() => {
1213
- setIsSubmitLoading(false);
1214
- });
1215
- return;
1216
- }
1217
- onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit();
1218
- })(e);
1219
- }, 100);
1137
+ if (!value)
1138
+ return;
1139
+ validatingPhoneRef.current = true;
1140
+ setTimeout(() => {
1141
+ formRef.current.setFieldError(b.data.value, 'Validating...');
1142
+ if (b.data.singleSubmission) {
1143
+ checkUsedPhoneOnlyWithCache(campaignId, value)
1144
+ .then((tKey) => {
1145
+ if (tKey) {
1146
+ formRef.current.setFieldError(b.data.value, t(tKey));
1147
+ }
1148
+ else {
1149
+ formRef.current.clearFieldError(b.data.value);
1150
+ }
1151
+ validatingPhoneRef.current = false;
1152
+ })
1153
+ .catch((err) => {
1154
+ console.error(err);
1155
+ formRef.current.setFieldError(b.data.value, err.message || 'Something went wrong');
1156
+ validatingPhoneRef.current = false;
1157
+ });
1158
+ }
1159
+ else {
1160
+ checkUsedEmailOrPhoneWithCache(campaignId, campaign_subot_id, {
1161
+ phone: value,
1162
+ })
1163
+ .then((tKey) => {
1164
+ if (tKey) {
1165
+ formRef.current.setFieldError(b.data.value, t(tKey));
1166
+ }
1167
+ else {
1168
+ formRef.current.clearFieldError(b.data.value);
1169
+ }
1170
+ validatingPhoneRef.current = false;
1171
+ })
1172
+ .catch((e) => {
1173
+ console.error(e);
1174
+ formRef.current.setFieldError(b.data.value, e.message || 'Something went wrong');
1175
+ validatingPhoneRef.current = false;
1176
+ });
1177
+ }
1178
+ }, 200);
1179
+ }, b) });
1180
+ }
1181
+ else if (b.name === 'DateBlock') {
1182
+ return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, (value) => {
1183
+ if (value && isNaN(Date.parse(value))) {
1184
+ return t('validator.date');
1185
+ }
1186
+ }, b) });
1187
+ }
1188
+ else if (b.name === 'TncBlock') {
1189
+ return Object.assign(Object.assign({}, r), { [`TNC-` + b.id]: withSharedCheck('TNC-' + b.id, (value) => {
1190
+ if (isRequired && !value) {
1191
+ return t('validator.required');
1192
+ }
1193
+ }, b) });
1194
+ }
1195
+ else {
1196
+ return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, undefined, b) });
1197
+ }
1198
+ }, {});
1199
+ }, [listBlockAdded.map((b) => b.name).join(',')]);
1200
+ const form = useLeadForm$1({
1201
+ validateInputOnChange: true,
1202
+ clearInputErrorOnChange: true,
1203
+ validate: validateObj,
1204
+ initialValues,
1205
+ });
1206
+ const formRef = React.useRef(form);
1207
+ formRef.current = form;
1208
+ return { form, validateObj };
1209
+ };
1210
+
1211
+ const Component = ({ campaign, onClose: onCloseProp, onOtherSubmit, onSubmit, showThankyou, setShowThankyou, locale, children, showEmpty, setShowEmpty, userInfo, }) => {
1212
+ var _a, _b;
1213
+ const extraFields = campaign.extra_fields;
1214
+ const campaignId = campaign.id;
1215
+ const campaign_subot_id = campaign.bot_id || [];
1216
+ const listBlockAdded = JSON.parse(extraFields.listBlockAdded);
1217
+ const actionBlocks = JSON.parse(extraFields.actionBlocks);
1218
+ const textBlocks = JSON.parse(extraFields.textBlocks);
1219
+ 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) || '';
1220
+ const description = textBlocks.subtitleBlock.data.value;
1221
+ const validatingPhoneRef = React.useRef(false);
1222
+ const validatingEmailRef = React.useRef(false);
1223
+ const leadFormConfig = useLeadFormConfig$1({
1224
+ listBlockAdded,
1225
+ validatingPhoneRef,
1226
+ validatingEmailRef,
1227
+ campaignId,
1228
+ campaign_subot_id,
1229
+ userInfo,
1230
+ });
1231
+ const [showOtpPhone, setShowOtpPhone] = React.useState(null);
1232
+ const [formRef, setFormRef] = React.useState(null);
1233
+ const onClose = () => {
1234
+ if (showOtpPhone) {
1235
+ setShowOtpPhone(null);
1236
+ }
1237
+ else {
1238
+ onCloseProp === null || onCloseProp === void 0 ? void 0 : onCloseProp();
1239
+ }
1220
1240
  };
1221
1241
  React.useEffect(() => {
1222
- form === null || form === void 0 ? void 0 : form.setValues(fillInfo);
1223
- }, [fillInfo]);
1224
- return (React__default["default"].createElement(LeadFormProvider$1, { form: form },
1225
- React__default["default"].createElement(core.Box, { component: "form", ref: (el) => el && setFormRef(el), className: cx(className, classes.root), onSubmit: middlewareOnSubmit, styles: styles },
1226
- React__default["default"].createElement("div", { className: classes.header },
1227
- React__default["default"].createElement(Heading, { className: classes.heading }),
1228
- React__default["default"].createElement(Description, { className: classes.description })),
1229
- React__default["default"].createElement("div", { className: classes.controlList },
1230
- React__default["default"].createElement(Fields, { classNames: {
1231
- control: classes.control,
1232
- }, listBlockAdded: listBlockAdded, locale: locale, onClose: onClose, onOtherSubmit: onOtherSubmit, popoverProps: popoverProps })),
1233
- ((_a = actionBlocks === null || actionBlocks === void 0 ? void 0 : actionBlocks.submitBlock) === null || _a === void 0 ? void 0 : _a.isHide) ? null : (React__default["default"].createElement("div", { className: classes.submitBtnWrapper },
1234
- React__default["default"].createElement(index$4.Button, Object.assign({ size: "md", id: "lead-submit", type: "submit", className: classes.submitBtn, loading: isSubmitLoading, color: primaryColor }, submitProps), popUpSubmitText))))));
1235
- };
1236
- const Form = (props) => {
1237
- const { showOtpPhone, showThankyou } = React.useContext(LeadGenComponentContext);
1238
- return showThankyou || showOtpPhone ? null : React__default["default"].createElement(FormComponent, Object.assign({}, props));
1242
+ clearCacheUsedEmailOrPhone();
1243
+ }, []);
1244
+ return campaign ? (React__default["default"].createElement(LeadGenComponentContext.Provider, { value: {
1245
+ campaignId,
1246
+ campaign_subot_id,
1247
+ heading,
1248
+ description,
1249
+ listBlockAdded,
1250
+ textBlocks,
1251
+ actionBlocks,
1252
+ leadFormConfig,
1253
+ validatingEmailRef,
1254
+ validatingPhoneRef,
1255
+ formRef: { current: formRef },
1256
+ setFormRef,
1257
+ locale,
1258
+ onClose,
1259
+ onOtherSubmit,
1260
+ showOtpPhone,
1261
+ setShowOtpPhone,
1262
+ onSubmit,
1263
+ showThankyou,
1264
+ setShowThankyou,
1265
+ showEmpty,
1266
+ setShowEmpty,
1267
+ } }, children)) : null;
1239
1268
  };
1240
1269
 
1241
- var useStyles$1 = core.createStyles(() => {
1270
+ const Description = (_a) => {
1271
+ var rest = tslib_es6.__rest(_a, []);
1272
+ const { description } = React.useContext(LeadGenComponentContext);
1273
+ return description ? (React__default["default"].createElement(index$2.Text, Object.assign({ size: "p3" }, rest), description)) : null;
1274
+ };
1275
+
1276
+ const LeadGenContext$1 = React.createContext({});
1277
+
1278
+ var useStyles$3 = core.createStyles(() => {
1242
1279
  return {
1243
- root: {},
1244
- header: {},
1245
- heading: {},
1246
- description: {},
1247
1280
  control: {},
1248
- actions: {},
1249
- submitBtn: {},
1250
- resendOtp: {},
1251
1281
  };
1252
1282
  });
1253
1283
 
1254
- const OtpBlockComponent = ({ otpData, onSuccess, autoSendWhenOpen, className, styles, classNames, }) => {
1255
- const { t } = index$1.useTranslations();
1256
- const phone = otpData.phone;
1257
- const otpType = otpData.type;
1258
- const [otp, setOtp] = React.useState('');
1259
- const [isDirty, setIsDirty] = React.useState(false);
1260
- const [resendTimer, setResendTimer] = React.useState(autoSendWhenOpen ? 0 : 60);
1261
- const inputRef = React.useRef(null);
1262
- const [errorMsg, setErrorMsg] = React.useState();
1263
- const [displayPhone, setDisplayPhone] = React.useState('');
1264
- const formatPhoneNumberIntlRef = React.useRef();
1265
- const [isSubmitLoading, setIsSubmitLoading] = React.useState(false);
1266
- const { classes, cx } = useStyles$1(undefined, {
1267
- name: 'LeadGen__OTP',
1268
- styles,
1269
- classNames,
1270
- });
1271
- React.useEffect(() => {
1272
- (() => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
1273
- var _a;
1274
- if (!formatPhoneNumberIntlRef.current) {
1275
- const res = yield Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('react-phone-number-input')); });
1276
- formatPhoneNumberIntlRef.current = res.formatPhoneNumberIntl;
1277
- }
1278
- setDisplayPhone(((_a = formatPhoneNumberIntlRef.current) === null || _a === void 0 ? void 0 : _a.call(formatPhoneNumberIntlRef, phone)) || phone);
1279
- }))();
1280
- }, [phone]);
1281
- const sendOtp = () => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
1282
- var _a;
1283
- if (!phone) {
1284
- return;
1285
- }
1286
- const res = yield Service.sendSMSOtpLead({
1287
- phone,
1288
- type: otpType,
1289
- });
1290
- const respMessage = (_a = res === null || res === void 0 ? void 0 : res._messages) === null || _a === void 0 ? void 0 : _a[0];
1291
- if (respMessage === 'Send sms successfully' ||
1292
- respMessage === 'Send WhatsApp successfully' ||
1293
- respMessage === 'Send Zalo successfully') {
1294
- setResendTimer(60);
1295
- setTimeout(() => {
1296
- if (inputRef.current) {
1297
- inputRef.current.focus();
1298
- inputRef.current.scrollIntoView({ block: 'center' });
1299
- }
1300
- }, 100);
1301
- }
1302
- else if (respMessage === 'This phone number was verified') {
1303
- onSuccess();
1304
- }
1305
- else {
1306
- setErrorMsg(respMessage || 'Something went wrong!');
1307
- // const defaultError = f({ id: 'notification.comment.somethingWrong' })
1308
- // setStatusVerifyOTP('idle')
1309
- // pushNotifications({
1310
- // title: respMessage || defaultError,
1311
- // message: '',
1312
- // type: 'danger',
1313
- // })
1314
- }
1315
- });
1316
- const submitOtp = () => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
1317
- if (!phone || !otp) {
1318
- return;
1319
- }
1320
- setIsSubmitLoading(true);
1321
- const res = yield Service.verifyOtpLead({
1322
- phone,
1323
- otp,
1324
- type: otpType,
1284
+ const libraries$1 = ['places'];
1285
+ const LocationBlock = ({ name, placeholder, locale, required = true, }) => {
1286
+ var _a;
1287
+ const form = useLeadFormContext$1();
1288
+ const [searchValue, setSearchValue] = React.useState('');
1289
+ const [address, setAddress] = React.useState('');
1290
+ const { predictions } = usePlacesAutocomplete.usePlacesAutocomplete(searchValue, '', locale === 'tl-PH' ? 'en' : (_a = locale === null || locale === void 0 ? void 0 : locale.split('-')) === null || _a === void 0 ? void 0 : _a[0]);
1291
+ const [LoadScript, setLoadScript] = React.useState(null);
1292
+ const [ready, setReady] = React.useState(false);
1293
+ const randRef = React.useRef(Math.random().toString(36).substring(7));
1294
+ const options = React.useMemo(() => {
1295
+ const _opts = predictions.map((p) => {
1296
+ return {
1297
+ value: p.description,
1298
+ label: p.description,
1299
+ };
1325
1300
  });
1326
- const respMessage = res === null || res === void 0 ? void 0 : res._messages[0];
1327
- if (respMessage === 'Verify successfully' ||
1328
- respMessage === 'Verify WhatsApp OTP sucess' ||
1329
- respMessage === 'Verify Zalo OTP sucess') {
1330
- onSuccess();
1301
+ const isExist = _opts.find((o) => o.value === address);
1302
+ if (!address || isExist) {
1303
+ return _opts;
1331
1304
  }
1332
- else if (respMessage === 'This phone number was verified') {
1333
- onSuccess();
1305
+ return [{ value: address, label: address }].concat(_opts);
1306
+ }, [predictions, address]);
1307
+ React.useEffect(() => {
1308
+ var _a, _b, _c;
1309
+ // only load extra google script when not yet loaded
1310
+ 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)) {
1311
+ Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('@react-google-maps/api')); }).then((m) => {
1312
+ setLoadScript(() => m.LoadScript);
1313
+ setTimeout(() => {
1314
+ setReady(true);
1315
+ }, 200);
1316
+ });
1334
1317
  }
1335
1318
  else {
1336
- setErrorMsg(respMessage || 'something Wrong');
1337
- // setIsShowError(true)
1338
- // setStatusVerifyOTP('sent')
1339
- // pushNotifications({
1340
- // title: res?._messages[0] || defaultError,
1341
- // message: '',
1342
- // type: 'danger',
1343
- // })
1344
- }
1345
- setIsSubmitLoading(false);
1346
- });
1347
- React.useEffect(() => {
1348
- setTimeout(() => {
1349
- if (resendTimer > 0) {
1350
- setResendTimer((r) => r - 1);
1351
- }
1352
- }, 1000);
1353
- }, [resendTimer]);
1354
- React.useEffect(() => {
1355
- if (autoSendWhenOpen && !resendTimer) {
1356
- sendOtp();
1319
+ setReady(true);
1357
1320
  }
1358
1321
  }, []);
1322
+ if (!ready)
1323
+ return (React__default["default"].createElement("div", { style: {
1324
+ height: 73,
1325
+ } }));
1359
1326
  return (React__default["default"].createElement(React__default["default"].Fragment, null,
1360
- React__default["default"].createElement(core.Box, { component: "form", onSubmit: (e) => {
1361
- e.preventDefault();
1362
- submitOtp();
1363
- }, className: cx(classes.root, className) },
1364
- React__default["default"].createElement("div", { className: classes.header },
1365
- React__default["default"].createElement(index$6.Heading, { tag: "h3", className: classes.heading }, t('lead.otp.title')),
1366
- React__default["default"].createElement(index$2.Text, { size: "p3", className: classes.description }, t('lead.otp.desc', { phone: displayPhone }))),
1367
- React__default["default"].createElement(index$3.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) => {
1368
- setIsDirty(true);
1369
- setOtp(v);
1370
- if (isDirty && !v)
1371
- setErrorMsg('OTP is required');
1372
- else
1373
- setErrorMsg(undefined);
1374
- }, error: isDirty ? errorMsg : undefined }),
1375
- React__default["default"].createElement("div", { className: classes.actions },
1376
- React__default["default"].createElement(index$4.Button, { type: "submit", size: "md", color: "primary", className: classes.submitBtn,
1377
- // onClick={() => submitOtp()}
1378
- disabled: !otp, loading: isSubmitLoading }, t('lead.otp.verify')),
1379
- React__default["default"].createElement(index$4.Button, { type: "button", size: "md", color: "transparent", className: classes.resendOtp, onClick: () => {
1380
- sendOtp();
1381
- }, disabled: !!resendTimer }, t('lead.otp.resend', {
1382
- timer: resendTimer ? ` (${resendTimer}s)` : '',
1383
- }))))));
1384
- };
1385
- const OtpBlock$1 = (_a) => {
1386
- var rest = tslib_es6.__rest(_a, []);
1387
- const { showOtpPhone, setShowOtpPhone, onSubmit,
1388
- // formRef,
1389
- // leadFormConfig: { form },
1390
- } = React.useContext(LeadGenComponentContext);
1391
- return showOtpPhone ? (React__default["default"].createElement(OtpBlockComponent, Object.assign({ otpData: showOtpPhone, autoSendWhenOpen: false, onSuccess: () => {
1392
- setShowOtpPhone(null);
1393
- onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit();
1394
- } }, rest))) : null;
1395
- };
1396
-
1397
- const Thankyou = ({ children, }) => {
1398
- const { showThankyou, setShowThankyou } = React.useContext(LeadGenComponentContext);
1399
- return showThankyou
1400
- ? children(showThankyou, () => setShowThankyou(null))
1401
- : null;
1327
+ LoadScript && (React__default["default"].createElement(LoadScript, { googleMapsApiKey: usePlacesAutocomplete.GOOGLE_API_KEY, libraries: libraries$1, loadingElement: React__default["default"].createElement(React__default["default"].Fragment, null) })),
1328
+ React__default["default"].createElement("div", { style: { display: 'none' }, "data-extra": true, "data-name": name, "data-control": 'text' }),
1329
+ React__default["default"].createElement(index$3.Select, Object.assign({ className: "lead-modal__form-control", label: placeholder, placeholder: placeholder, withAsterisk: required, name: name, data: options, searchValue: searchValue, onSearchChange: (query) => {
1330
+ setSearchValue(query);
1331
+ }, filter: () => true, clearable: true, searchable: true, onChange: (val) => setAddress(val || ''), icon: React__default["default"].createElement("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none" },
1332
+ React__default["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["default"].createElement(React__default["default"].Fragment, null) }, form.getInputProps(name)))));
1402
1333
  };
1403
1334
 
1404
- var enPH = {
1405
- "validator.required": "This field is required.",
1406
- "validator.remote": "Please fix this field.",
1407
- "validator.email": "Please enter a valid email address.",
1408
- "validator.phone": "Please input correct phone number.",
1409
- "validator.url": "Please enter a valid URL.",
1410
- "validator.date": "Please enter a valid date.",
1411
- "validator.dateISO": "Please enter a valid date (ISO).",
1412
- "validator.number": "Please enter a valid number.",
1413
- "validator.digits": "Please enter only digits.",
1414
- "validator.creditcard": "Please enter a valid credit card number.",
1415
- "validator.equalTo": "Please enter the same value again.",
1416
- "validator.accept": "Please enter a value with a valid extension.",
1417
- "validator.maxlength": "jQuery.validator.format('Please enter no more than {0} characters.",
1418
- "validator.minlength": "jQuery.validator.format('Please enter at least {0} characters.",
1419
- "validator.rangelength": "jQuery.validator.format('Please enter a value between {0} and {1} characters long.",
1420
- "validator.range": "jQuery.validator.format('Please enter a value between {0} and {1}.",
1421
- "validator.max": "jQuery.validator.format('Please enter a value less than or equal to {0}.",
1422
- "validator.min": "jQuery.validator.format('Please enter a value greater than or equal to {0}.",
1423
- "validator.emailUsed": "Email already in use for this campaign.",
1424
- "validator.phoneUsed": "Your phone number already in use for this campaign.",
1425
- "validator.dateInvalid": "This date is not valid, please update.",
1426
- "lead.otp.title": "Enter OTP",
1427
- "lead.otp.desc": "We have sent an OTP to your mobile number {phone}",
1428
- "lead.otp.verify": "Verify",
1429
- "lead.otp.resend": "Resend OTP{timer}",
1430
- "lead.otp.phoneLabel": "Phone OTP",
1431
- "lead.otp.phonePlaceholder": "Enter OTP",
1432
- "lead.empty.title": "Oops, seem your information is empty, do you want to submit the information again?",
1433
- "lead.empty.cancel": "Cancel",
1434
- "lead.empty.submitAgain": "Submit again",
1435
- "inlineFreebie.freeSample.title": "Free Sample",
1436
- "inlineFreebie.luckyDrawGift.title": "Lucky-draw Gift",
1437
- "inlineFreebie.value": "Value",
1438
- "common.day": "Day",
1439
- "common.month": "Month",
1440
- "common.year": "Year"
1441
- };
1335
+ const SubtitleBlock$1 = ({ children, align, }) => (React__default["default"].createElement("p", { className: `lead-modal__description ${'le-text-align-' + (align || '')} ${LEAD_CLASS}` }, children));
1442
1336
 
1443
- var hiIN = {
1444
- "validator.required": "इस क्षेत्र की आवश्यकता है।",
1445
- "validator.email": "कृपया एक मान्य ईमेल पता दर्ज करें",
1446
- "validator.number": "कृपया एक वैध संख्या दर्ज करें",
1447
- "validator.digits": "कृपया केवल अंक दर्ज करें",
1448
- "validator.maxlength": "कृपया {0} अक्षर से अधिक दर्ज न करें",
1449
- "validator.minlength": "कृपया कम से कम {0} अक्षर दर्ज करें",
1450
- "validator.phone": "कृपया एक वैध संख्या दर्ज करें",
1451
- "validator.dateInvalid": "यह तिथि मान्य नहीं है, कृपया अपडेट करें।",
1452
- "validator.emailUsed": "Email already in use for this campaign.",
1453
- "validator.phoneUsed": "Your phone number already in use for this campaign.",
1454
- "lead.otp.title": "Enter OTP",
1455
- "lead.otp.desc": "We have sent an OTP to your mobile number {phone}",
1456
- "lead.otp.verify": "Verify",
1457
- "lead.otp.resend": "Resend OTP{timer}",
1458
- "lead.empty.title": "ऊप्स! लगता है आपकी जानकारी खाली है। क्या आप जानकारी फिर से सबमिट करना चाहते हैं?",
1459
- "lead.empty.cancel": "रद्द करें",
1460
- "lead.empty.submitAgain": "फिर से सबमिट करें",
1461
- "inlineFreebie.freeSample.title": "मुफ्त नमूना",
1462
- "inlineFreebie.luckyDrawGift.title": "लकी-ड्रा गिफ्ट",
1463
- "inlineFreebie.value": "मूल्य",
1464
- "common.day": "साल",
1465
- "common.month": "महीना",
1466
- "common.year": ""
1467
- };
1337
+ const TitleBlock$1 = ({ children, align, }) => (React__default["default"].createElement("h2", { className: `lead-modal__title ${'le-text-align-' + (align || '')} ${LEAD_CLASS}` }, children));
1468
1338
 
1469
- var idID = {
1470
- "validator.required": "Kolom ini wajib diisi",
1471
- "validator.email": "Tolong daftarkan email yang valid",
1472
- "validator.number": "Tolong daftarkan nomor telepon yang valid",
1473
- "validator.digits": "Tolong masukkan angka saja",
1474
- "validator.maxlength": "Jangan memasukkan lebih dari {0} karakter",
1475
- "validator.minlength": "Tolong ketik sedikitnya {0} karakter",
1476
- "validator.phone": "Tolong daftarkan nomor telepon yang valid",
1477
- "validator.emailUsed": "Email sudah digunakan untuk kampanye ini.",
1478
- "validator.phoneUsed": "Nomor telepon Anda sudah digunakan untuk kampanye ini.",
1479
- "validator.dateInvalid": "Tanggal ini tidak valid, silakan perbarui",
1480
- "lead.otp.title": "Masukkan OTP",
1481
- "lead.otp.desc": "Kami telah mengirimkan OTP ke nomor ponsel Anda {phone}",
1482
- "lead.otp.verify": "Verifikasi",
1483
- "lead.otp.resend": "Kirim Ulang OTP {timer}",
1484
- "lead.otp.phoneLabel": "OTP Telepon",
1485
- "lead.otp.phonePlaceholder": "Masukkan OTP",
1486
- "lead.empty.title": "Oops, sepertinya informasi Anda kosong. Apakah Anda ingin mengirimkan informasi lagi?",
1487
- "lead.empty.cancel": "Batal",
1488
- "lead.empty.submitAgain": "Kirim lagi",
1489
- "inlineFreebie.freeSample.title": "Sampel Gratis",
1490
- "inlineFreebie.luckyDrawGift.title": "Hadiah Undian",
1491
- "inlineFreebie.value": "Nilai",
1492
- "common.day": "Hari",
1493
- "common.month": "Bulan",
1494
- "common.year": "Tahun"
1495
- };
1496
-
1497
- var kmKH = {
1498
- "validator.required": "ព័ត៌មាន​ចាំបាច់​ដែល​ត្រូវ​បំពេញ",
1499
- "validator.email": "សូម​វាយ​អាសយដ្ឋាន​អ៊ីម៉ែល​ឲ្យ​បាន​ត្រឹមត្រូវ",
1500
- "validator.number": "សូម​វាយបញ្ចូល​លេខ​ឲ្យ​បាន​ត្រឹមត្រូវ",
1501
- "validator.digits": "វាយ​បញ្ចូល​បាន​តែ​លេខ​ប៉ុណ្ណោះ",
1502
- "validator.maxlength": "សូម​វាយ​បញ្ចូលកុំ​ឲ្យ​លើស {0} តួអក្សរ",
1503
- "validator.minlength": "សូម​វាយ​បញ្ចូល​តិច​បំផុត {0} តួអក្ស",
1504
- "validator.phone": "សូម​វាយបញ្ចូល​លេខ​ឲ្យ​បាន​ត្រឹមត្រូវ",
1505
- "validator.emailUsed": "អ៊ីមែលត្រូវបានប្រើប្រាស់សម្រាប់យុទ្ធនាការនេះរួចហើយ។",
1506
- "validator.phoneUsed": "លេខទូរស័ព្ទរបស់អ្នកត្រូវបានប្រើប្រាស់សម្រាប់យុទ្ធនាការនេះរួចហើយ។",
1507
- "validator.dateInvalid": "កាលបរិច្ឆេទនេះមិនត្រឹមត្រូវទេ សូមធ្វើបច្ចុប្បន្នភាព។",
1508
- "lead.otp.title": "បញ្ចូល OTP",
1509
- "lead.otp.desc": "យើងបានផ្ញើ OTP ទៅកាន់លេខទូរសព្ទរបស់អ្នក {phone}",
1510
- "lead.otp.verify": "ផ្ទៀងផ្ទាត់",
1511
- "lead.otp.resend": "ផ្ញើ OTP ម្តងទៀត {timer}",
1512
- "lead.otp.phoneLabel": "OTP ទូរស័ព្ទ",
1513
- "lead.otp.phonePlaceholder": "បញ្ចូល OTP",
1514
- "lead.empty.title": "អូុបស! ហាក់ដូចជាព័ត៌មានរបស់អ្នកទទេ។ តើអ្នកចង់ដាក់ស្នើព័ត៌មានម្តងទៀតទេ?",
1515
- "lead.empty.cancel": "លុប​ចោល",
1516
- "lead.empty.submitAgain": "ដាក់ស្នើម្ដងទៀត",
1517
- "inlineFreebie.freeSample.title": "សំបុត្រស្រង់ពិន័យ",
1518
- "inlineFreebie.luckyDrawGift.title": "សំបុត្រស្រង់ពិន័យ",
1519
- "inlineFreebie.value": "តម្លៃ",
1520
- "common.day": "ឆ្នាំ",
1521
- "common.month": "ខែ",
1522
- "common.year": "ថ្ងៃ"
1523
- };
1524
-
1525
- var msMY = {
1526
- "validator.required": "Bahagian ini wajib diisi.",
1527
- "validator.email": "Sila masukkan alamat emel yang sah.",
1528
- "validator.number": "Sila masukkan no telefon yang sah.",
1529
- "validator.digits": "Sila masukkan nombor digit sahaja.",
1530
- "validator.maxlength": "Sila masukkan tidak lebih dari {0} aksara",
1531
- "validator.minlength": "Sila masukkan sekurang-kurangnya {0} aksara",
1532
- "validator.phone": "Sila masukkan no telefon yang sah.",
1533
- "validator.emailUsed": "Emel sudah digunakan untuk kempen ini.",
1534
- "validator.phoneUsed": "Nombor telefon anda sudah digunakan untuk kempen ini.",
1535
- "validator.dateInvalid": "Tarikh ini tidak sah, sila kemas kini",
1536
- "lead.otp.title": "Masukkan OTP",
1537
- "lead.otp.desc": "Kami telah menghantar OTP ke nombor telefon bimbit anda {phone}",
1538
- "lead.otp.verify": "Sahkan",
1539
- "lead.otp.resend": "Hantar semula OTP {timer}",
1540
- "lead.otp.phoneLabel": "OTP Telefon",
1541
- "lead.otp.phonePlaceholder": "Masukkan OTP",
1542
- "lead.empty.title": "Oops, nampaknya maklumat anda kosong. Adakah anda ingin menghantar maklumat semula?",
1543
- "lead.empty.cancel": "Batal",
1544
- "lead.empty.submitAgain": "Hantar semula",
1545
- "inlineFreebie.freeSample.title": "Sampel Percuma",
1546
- "inlineFreebie.luckyDrawGift.title": "Hadiah Undian",
1547
- "inlineFreebie.value": "Nilai",
1548
- "common.day": "Hari",
1549
- "common.month": "Bulan",
1550
- "common.year": "Tahun"
1339
+ const Fields = ({ listBlockAdded, popupId, locale, onClose, onOtherSubmit, styles, classNames, popoverProps, }) => {
1340
+ const { primaryColor } = React.useContext(LeadGenContext$1);
1341
+ const { classes, cx } = useStyles$3(undefined, {
1342
+ name: 'LeadGen__Field',
1343
+ styles,
1344
+ classNames,
1345
+ });
1346
+ const form = useLeadFormContext$1();
1347
+ return (React__default["default"].createElement(React__default["default"].Fragment, null, listBlockAdded.map((b, index) => {
1348
+ var _a;
1349
+ const { name = '', data = {} } = b || {};
1350
+ const { placeholder, value, align, listQuestion, isSendMailChimp = false, newtab, url, } = data;
1351
+ const required = (_a = data.required) !== null && _a !== void 0 ? _a : true;
1352
+ switch (name) {
1353
+ case 'TitleBlock':
1354
+ return (React__default["default"].createElement(TitleBlock$1, { key: index, align: align }, value));
1355
+ case 'SubtitleBlock':
1356
+ return (React__default["default"].createElement(SubtitleBlock$1, { key: index, align: align }, value));
1357
+ case 'TextBlock':
1358
+ return (React__default["default"].createElement(index$3.Input, Object.assign({ key: index, withAsterisk: required, spellCheck: false, type: "text", placeholder: placeholder, className: cx('leadgen-control', classes.control),
1359
+ // onChangeRaw={(e) => inputOnChange('text', e)}
1360
+ label: placeholder, "data-control": "text", "data-lead-control": name, "data-is-required": required, name: value }, form.getInputProps(value))));
1361
+ case 'NumberBlock':
1362
+ return (React__default["default"].createElement(index$3.NumberInput, Object.assign({ key: index, withAsterisk: required, spellCheck: false, type: "number", placeholder: placeholder, className: cx('leadgen-control', classes.control),
1363
+ // onChange={(e) => inputOnChange('number', e)}
1364
+ label: placeholder, "data-control": "number", "data-lead-control": name, "data-is-required": required, name: value }, form.getInputProps(value))));
1365
+ case 'EmailBlock':
1366
+ return (React__default["default"].createElement(index$3.Input, Object.assign({ key: index, withAsterisk: required, spellCheck: false,
1367
+ // type="email"
1368
+ 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))));
1369
+ case 'PhoneOtpBlock':
1370
+ case 'WhatsappOtpBlock':
1371
+ case 'ZaloOtpBlock':
1372
+ case 'PhoneBlock': {
1373
+ const id = popupId + '-' + value + '-' + index;
1374
+ return (React__default["default"].createElement(index$3.Input.Wrapper, Object.assign({ size: "md", withAsterisk: required, key: index, label: placeholder,
1375
+ // error={errorField.phone}
1376
+ className: cx('leadgen-control', classes.control), labelProps: {
1377
+ htmlFor: id,
1378
+ } }, form.getInputProps(value)),
1379
+ React__default["default"].createElement(index$3.Phone, { name: value, spellCheck: false, type: "tel", placeholder: placeholder, value: form.getInputProps(value).value, onChange: (v) => {
1380
+ form.setFieldValue(value, v);
1381
+ },
1382
+ // onBlur={(e) => inputOnBlur('tel', e)}
1383
+ id: id, defaultCountry: (locale ? utils.MAPPED_LOCALE[locale] || 'VN' : 'VN'), "data-control": "tel", "data-lead-control": name, "data-is-required": required })));
1384
+ }
1385
+ case 'LocationBlock': {
1386
+ return (React__default["default"].createElement(LocationBlock, { key: index, name: value, placeholder: placeholder, locale: locale, required: required }));
1387
+ }
1388
+ case 'DateBlock':
1389
+ return (React__default["default"].createElement(React__default["default"].Fragment, null,
1390
+ React__default["default"].createElement(index$5.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))),
1391
+ React__default["default"].createElement("input", { type: "hidden", name: value, "data-control": "date" })));
1392
+ case 'LinkButtonBlock':
1393
+ return (React__default["default"].createElement("div", { key: index },
1394
+ React__default["default"].createElement("a", { target: newtab ? 'blank' : 'parrent', href: url, style: { textDecoration: 'none' } },
1395
+ React__default["default"].createElement(index$4.Button, { type: "button", size: "md", color: primaryColor, className: `lead-modal__btn ${LEAD_CLASS}`, onClick: () => {
1396
+ onClose === null || onClose === void 0 ? void 0 : onClose();
1397
+ onOtherSubmit === null || onOtherSubmit === void 0 ? void 0 : onOtherSubmit();
1398
+ } }, value))));
1399
+ case 'CheckboxBlock':
1400
+ return (React__default["default"].createElement(React__default["default"].Fragment, null,
1401
+ isSendMailChimp && (React__default["default"].createElement("div", { style: {
1402
+ display: 'none',
1403
+ }, "data-name": value + '-mailchimp' })),
1404
+ React__default["default"].createElement(index$3.Checkbox.Group, Object.assign({ withAsterisk: required, className: cx('leadgen-control', classes.control), key: index, label: placeholder, size: "md", sx: {
1405
+ display: 'flex',
1406
+ flexDirection: 'column',
1407
+ gap: 8,
1408
+ } }, form.getInputProps(value)), listQuestion.map((l, _index) => (React__default["default"].createElement(index$3.Checkbox, { name: value, key: _index, value: l.value, label: l.placeholder, "data-control": "checkbox", "data-lead-control": name, "data-is-required": required }))))));
1409
+ case 'RadioBlock':
1410
+ return (React__default["default"].createElement(React__default["default"].Fragment, null,
1411
+ isSendMailChimp && (React__default["default"].createElement(index$3.Input, { type: "hidden", name: value + '-mailchimp', value: isSendMailChimp })),
1412
+ React__default["default"].createElement(index$3.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["default"].createElement(index$3.Radio, { name: value, key: _index, value: l.value, label: l.placeholder, "data-control": "radio", "data-lead-control": name, "data-is-required": required }))))));
1413
+ case 'DropdownBlock':
1414
+ return (React__default["default"].createElement(React__default["default"].Fragment, null,
1415
+ React__default["default"].createElement("div", { style: { display: 'none' }, "data-extra": true, "data-name": value, "data-control": 'dropdown', "data-lead-control": name, "data-is-required": required }),
1416
+ React__default["default"].createElement(index$3.Select, Object.assign({ key: index, className: cx('leadgen-control', classes.control), label: placeholder, withAsterisk: required, name: value, data: listQuestion.map((l) => ({
1417
+ value: l.value,
1418
+ label: l.placeholder,
1419
+ })) }, form.getInputProps(value)))));
1420
+ case 'TncBlock':
1421
+ const tncInputProps = form.getInputProps('TNC-' + b.id);
1422
+ return (React__default["default"].createElement(React__default["default"].Fragment, null,
1423
+ React__default["default"].createElement(index$3.Checkbox, Object.assign({ name: 'TNC-' + b.id, key: b.id, label: React__default["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 }))));
1424
+ }
1425
+ return null;
1426
+ })));
1551
1427
  };
1552
1428
 
1553
- var myMM = {
1554
- "validator.required": "ဒီနေရာမှာ ဖြည့်ဖို့ လိုအပ်ပါတယ်",
1555
- "validator.email": "မှန်ကန်သော အီးမေးလ်လိပ်စာထည့်သွင်းပါ",
1556
- "validator.number": "မှန်ကန်သော ဖုန်းနံပါတ်ထည့်သွင်းပါ",
1557
- "validator.digits": "နံပါတ်များသာဖြည့်ပါ",
1558
- "validator.maxlength": "ကျေးဇူးပြု၍ {0} ထပ်မပိုသော ဂဏန်းများသာဖြည့်ပါ",
1559
- "validator.minlength": "ကျေးဇူးပြု၍ အနည်းဆုံး {0} ဂဏန်းဖြည့်ပါ",
1560
- "validator.phone": "မှန်ကန်သော ဖုန်းနံပါတ်ထည့်သွင်းပါ",
1561
- "validator.emailUsed": "ဤအေကာင့်အတွက် အီးမေးလ်ကို အသုံးပြုပြီးဖြစ်ပါသည်။",
1562
- "validator.phoneUsed": "ဤအေကာင့်အတွက် သင့်ဖုန်းနံပါတ်ကို အသုံးပြုပြီးဖြစ်ပါသည်။",
1563
- "validator.dateInvalid": "ယနေ့စွဲမှားနေသည်၊ ကျေးဇူးပြု၍ ပြင်ဆင်ပါ။",
1564
- "lead.otp.title": "OTP ကိုထည့်ပါ",
1565
- "lead.otp.desc": "ကျွန်ုပ်တို့သည် OTP ကိုသင့်ဖုန်းနံပါတ် {phone} သို့ပို့ခဲ့သည်",
1566
- "lead.otp.verify": "အတည်ပြုပါ",
1567
- "lead.otp.resend": "OTP ကိုထပ်မံပို့ရန် {timer}",
1568
- "lead.otp.phoneLabel": "ဖုန်း OTP",
1569
- "lead.otp.phonePlaceholder": "OTP ကိုထည့်ပါ",
1570
- "lead.empty.title": "အုပ်စ်! သင့်အချက်အလက်သည် ဗလာဖြစ်နေသလိုဖြစ်သည်။ ထပ်မံတင်သွင်းလိုပါသလား?",
1571
- "lead.empty.cancel": "မလုပ်ဆောင်ပါ",
1572
- "lead.empty.submitAgain": "ထပ်မံတင်သွင်းပါ",
1573
- "inlineFreebie.freeSample.title": "အခမဲ့အစားအစာ",
1574
- "inlineFreebie.luckyDrawGift.title": "အခမဲ့အစားအစာ",
1575
- "inlineFreebie.value": "တန်ဖိုး",
1576
- "common.day": "ရက်",
1577
- "common.month": "လ",
1578
- "common.year": "နှစ်"
1579
- };
1429
+ var useStyles$2 = core.createStyles((theme) => {
1430
+ return {
1431
+ root: {},
1432
+ header: {},
1433
+ heading: {},
1434
+ description: {},
1435
+ term: {
1436
+ a: {
1437
+ color: theme.fn.primaryColor(),
1438
+ },
1439
+ },
1440
+ controlList: {},
1441
+ control: {},
1442
+ submitBtn: {},
1443
+ submitBtnWrapper: {},
1444
+ };
1445
+ });
1580
1446
 
1581
- var thTH = {
1582
- "validator.required": "ต้องระบุข้อมูลในช่องนี้",
1583
- "validator.email": "กรุณาใส่อีเมล์ที่ถูกต้อง",
1584
- "validator.number": "กรุณาใส่ตัวเลขที่ถูกต้อง",
1585
- "validator.digits": "กรุณาส่เฉพาะตัวเลข",
1586
- "validator.maxlength": "กรุณาใส่ตัวเลขมากกว่า {0} หลัก",
1587
- "validator.minlength": "กรุณาใส่ตัวเลขอย่างน้อย {0} หลัก",
1588
- "validator.phone": "กรุณาใส่ตัวเลขที่ถูกต้อง",
1589
- "validator.emailUsed": "อีเมลนี้ถูกใช้สำหรับแคมเปญนี้แล้ว",
1590
- "validator.phoneUsed": "หมายเลขโทรศัพท์ของคุณถูกใช้สำหรับแคมเปญนี้แล้ว",
1591
- "validator.dateInvalid": "วันที่นี้ไม่ถูกต้อง โปรดอัปเดต",
1592
- "lead.otp.title": "ป้อน OTP",
1593
- "lead.otp.desc": "เราได้ส่ง OTP ไปยังหมายเลขโทรศัพท์มือถือของคุณ {phone}",
1594
- "lead.otp.verify": "ยืนยัน",
1595
- "lead.otp.resend": "ส่ง OTP อีกครั้ง {timer}",
1596
- "lead.otp.phoneLabel": "OTP โทรศัพท์",
1597
- "lead.otp.phonePlaceholder": "ป้อน OTP",
1598
- "lead.empty.title": "อุ๊ปส์! ดูเหมือนว่าข้อมูลของคุณว่างเปล่า คุณต้องการส่งข้อมูลอีกครั้งหรือไม่?",
1599
- "lead.empty.cancel": "ยกเลิก",
1600
- "lead.empty.submitAgain": "ส่งอีกครั้ง",
1601
- "inlineFreebie.freeSample.title": "ตัวอย่างฟรี",
1602
- "inlineFreebie.luckyDrawGift.title": "ของรางวัลที่ถูกรางวัล",
1603
- "inlineFreebie.value": "ค่า",
1604
- "common.day": "วัน",
1605
- "common.month": "เดือน",
1606
- "common.year": "ปี"
1447
+ const Heading = (_a) => {
1448
+ var rest = tslib_es6.__rest(_a, []);
1449
+ const { heading } = React.useContext(LeadGenComponentContext);
1450
+ return heading ? (React__default["default"].createElement(index$2.Text, Object.assign({ size: "h3" }, rest), heading)) : null;
1607
1451
  };
1608
1452
 
1609
- var viVN = {
1610
- "validator.required": "Vui lòng điền mục này",
1611
- "validator.email": "Vui lòng điền email có thật.",
1612
- "validator.number": "Vui lòng điền số thật",
1613
- "validator.digits": "Vui lòng chỉ điền số",
1614
- "validator.maxlength": "Vui lòng điền dưới {0} số",
1615
- "validator.minlength": "Vui lòng điền hơn {0} số",
1616
- "validator.remote": "Hãy sửa cho đúng.",
1617
- "validator.url": "Hãy nhập URL.",
1618
- "validator.date": "Hãy nhập ngày.",
1619
- "validator.dateISO": "Hãy nhập ngày (ISO).",
1620
- "validator.creditcard": "Hãy nhập số thẻ tín dụng.",
1621
- "validator.equalTo": "Hãy nhập thêm lần nữa.",
1622
- "validator.extension": "Phần mở rộng không đúng.",
1623
- "validator.rangelength": "Hãy nhập từ {0} đến {1} kí tự.",
1624
- "validator.range": "Hãy nhập từ {0} đến {1}.",
1625
- "validator.max": "Hãy nhập từ {0} trở xuống.",
1626
- "validator.min": "Hãy nhập từ {0} trở lên.",
1627
- "validator.phone": "Nhập đúng định dạng số điện thoại",
1628
- "validator.emailUsed": "Email này đã được sử dụng.",
1629
- "validator.phoneUsed": "Số điện thoại này đã được sử dụng.",
1630
- "validator.dateInvalid": "Ngày này không hợp lệ, vui lòng cập nhật.",
1631
- "lead.otp.title": "Nhập OTP",
1632
- "lead.otp.desc": "Chúng tôi đã gửi OTP đến số điện thoại của bạn {phone}",
1633
- "lead.otp.verify": "Xác minh",
1634
- "lead.otp.resend": "Gửi lại OTP {timer}",
1635
- "lead.otp.phoneLabel": "Nhập OTP",
1636
- "lead.otp.phonePlaceholder": "Nhập OTP",
1637
- "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?",
1638
- "lead.empty.cancel": "Hủy",
1639
- "lead.empty.submitAgain": "Gửi lại",
1640
- "inlineFreebie.freeSample.title": "Dùng thử miễn phí",
1641
- "inlineFreebie.luckyDrawGift.title": "Phần thưởng may mắn",
1642
- "inlineFreebie.value": "Trị giá",
1643
- "common.day": "Ngày",
1644
- "common.month": "Tháng",
1645
- "common.year": "Năm"
1453
+ const FormComponent = ({ styles, className, classNames, fillInfo, popoverProps, submitProps, }) => {
1454
+ var _a;
1455
+ const { primaryColor } = React.useContext(LeadGenContext$1);
1456
+ const { listBlockAdded, leadFormConfig: { form, validateObj }, validatingEmailRef, validatingPhoneRef,
1457
+ // formRef,
1458
+ setFormRef, onClose, onOtherSubmit, actionBlocks, locale, setShowOtpPhone, onSubmit, } = React.useContext(LeadGenComponentContext);
1459
+ const { classes, cx } = useStyles$2(undefined, {
1460
+ name: 'LeadGen__FormComponent',
1461
+ styles,
1462
+ classNames,
1463
+ });
1464
+ const [isSubmitLoading, setIsSubmitLoading] = React.useState(false);
1465
+ const popUpSubmitText = actionBlocks.submitBlock.data.value;
1466
+ const middlewareOnSubmit = (e) => {
1467
+ e.preventDefault();
1468
+ // mark all as touched to allow validation
1469
+ form.setTouched(Object.keys(validateObj).reduce((acc, cur) => {
1470
+ acc[cur] = true;
1471
+ return acc;
1472
+ }, {}));
1473
+ if (validatingEmailRef.current || validatingPhoneRef.current) {
1474
+ return;
1475
+ }
1476
+ setTimeout(() => {
1477
+ form.onSubmit((v) => {
1478
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
1479
+ if (Object.keys(form.errors).length)
1480
+ return;
1481
+ let newShowOtpPhone = null;
1482
+ if (listBlockAdded.findIndex((x) => x.name === 'PhoneOtpBlock') > -1) {
1483
+ // not submit yet, open otp
1484
+ 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;
1485
+ if ((_c = v[fieldName]) === null || _c === void 0 ? void 0 : _c.startsWith('+')) {
1486
+ newShowOtpPhone = {
1487
+ phone: v[fieldName],
1488
+ type: 'phone',
1489
+ };
1490
+ }
1491
+ }
1492
+ if (listBlockAdded.findIndex((x) => x.name === 'WhatsappOtpBlock') > -1) {
1493
+ // not submit yet, open otp
1494
+ 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;
1495
+ if ((_f = v[fieldName]) === null || _f === void 0 ? void 0 : _f.startsWith('+')) {
1496
+ newShowOtpPhone = {
1497
+ phone: v[fieldName],
1498
+ type: 'whatsapp',
1499
+ };
1500
+ }
1501
+ }
1502
+ if (listBlockAdded.findIndex((x) => x.name === 'ZaloOtpBlock') > -1) {
1503
+ // not submit yet, open otp
1504
+ 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;
1505
+ if ((_j = v[fieldName]) === null || _j === void 0 ? void 0 : _j.startsWith('+')) {
1506
+ newShowOtpPhone = {
1507
+ phone: v[fieldName],
1508
+ type: 'zalo',
1509
+ };
1510
+ }
1511
+ }
1512
+ if (newShowOtpPhone) {
1513
+ setIsSubmitLoading(true);
1514
+ Service.sendSMSOtpLead(newShowOtpPhone)
1515
+ .then((res) => {
1516
+ var _a;
1517
+ const respMessage = (_a = res === null || res === void 0 ? void 0 : res._messages) === null || _a === void 0 ? void 0 : _a[0];
1518
+ if (respMessage === 'This phone number was verified') {
1519
+ onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit();
1520
+ return;
1521
+ }
1522
+ setShowOtpPhone(newShowOtpPhone);
1523
+ })
1524
+ .finally(() => {
1525
+ setIsSubmitLoading(false);
1526
+ });
1527
+ return;
1528
+ }
1529
+ onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit();
1530
+ })(e);
1531
+ }, 100);
1532
+ };
1533
+ React.useEffect(() => {
1534
+ form === null || form === void 0 ? void 0 : form.setValues(fillInfo);
1535
+ }, [fillInfo]);
1536
+ return (React__default["default"].createElement(LeadFormProvider$1, { form: form },
1537
+ React__default["default"].createElement(core.Box, { component: "form", ref: (el) => el && setFormRef(el), className: cx(className, classes.root), onSubmit: middlewareOnSubmit, styles: styles },
1538
+ React__default["default"].createElement("div", { className: classes.header },
1539
+ React__default["default"].createElement(Heading, { className: classes.heading }),
1540
+ React__default["default"].createElement(Description, { className: classes.description })),
1541
+ React__default["default"].createElement("div", { className: classes.controlList },
1542
+ React__default["default"].createElement(Fields, { classNames: {
1543
+ control: classes.control,
1544
+ }, listBlockAdded: listBlockAdded, locale: locale, onClose: onClose, onOtherSubmit: onOtherSubmit, popoverProps: popoverProps })),
1545
+ ((_a = actionBlocks === null || actionBlocks === void 0 ? void 0 : actionBlocks.submitBlock) === null || _a === void 0 ? void 0 : _a.isHide) ? null : (React__default["default"].createElement("div", { className: classes.submitBtnWrapper },
1546
+ React__default["default"].createElement(index$4.Button, Object.assign({ size: "md", id: "lead-submit", type: "submit", className: classes.submitBtn, loading: isSubmitLoading, color: primaryColor }, submitProps), popUpSubmitText))))));
1547
+ };
1548
+ const Form = (props) => {
1549
+ const { showOtpPhone, showThankyou } = React.useContext(LeadGenComponentContext);
1550
+ return showThankyou || showOtpPhone ? null : React__default["default"].createElement(FormComponent, Object.assign({}, props));
1646
1551
  };
1647
1552
 
1648
- var zhTW = {
1649
- "validator.required": "此為必填欄位",
1650
- "validator.email": "請填入有效的 email 地址",
1651
- "validator.number": "請填入有效的電話號碼",
1652
- "validator.digits": "此欄位僅能輸入數字",
1653
- "validator.maxlength": "請輸入少於 {0} 位數",
1654
- "validator.minlength": "請輸入至少 {0} 位數",
1655
- "validator.phone": "請填入有效的電話號碼",
1656
- "validator.emailUsed": "此電子郵件已被使用於此活動。",
1657
- "validator.phoneUsed": "您的手機號碼已被使用於此活動。",
1658
- "validator.dateInvalid": "此日期無效,請更新.",
1659
- "lead.otp.title": "輸入 OTP",
1660
- "lead.otp.desc": "我們已將 OTP 發送到您的手機號碼 {phone}",
1661
- "lead.otp.verify": "驗證",
1662
- "lead.otp.resend": "重新發送 OTP {timer}",
1663
- "lead.otp.phoneLabel": "電話 OTP",
1664
- "lead.otp.phonePlaceholder": "輸入 OTP",
1665
- "lead.empty.title": "哎呀,您的資訊似乎是空的,您想要重新提交資訊嗎?",
1666
- "lead.empty.cancel": "取消",
1667
- "lead.empty.submitAgain": "重新提交",
1668
- "inlineFreebie.freeSample.title": "免費試用",
1669
- "inlineFreebie.luckyDrawGift.title": "幸運抽獎禮品",
1670
- "inlineFreebie.value": "價值",
1671
- "common.day": "日",
1672
- "common.month": "月",
1673
- "common.year": "年"
1674
- };
1553
+ var useStyles$1 = core.createStyles(() => {
1554
+ return {
1555
+ root: {},
1556
+ header: {},
1557
+ heading: {},
1558
+ description: {},
1559
+ control: {},
1560
+ actions: {},
1561
+ submitBtn: {},
1562
+ resendOtp: {},
1563
+ };
1564
+ });
1675
1565
 
1676
- const translationsMap = {
1677
- 'en-PH': enPH,
1678
- 'vi-VN': viVN,
1679
- 'hi-IN': hiIN,
1680
- 'id-ID': idID,
1681
- 'ms-MY': msMY,
1682
- 'my-MM': myMM,
1683
- 'km-KH': kmKH,
1684
- 'zh-TW': zhTW,
1685
- 'zh-SG': zhTW,
1686
- 'th-TH': thTH,
1687
- 'tl-PH': enPH,
1566
+ const OtpBlockComponent = ({ otpData, onSuccess, autoSendWhenOpen, className, styles, classNames, }) => {
1567
+ const { t } = useLeadGenTranslations();
1568
+ const phone = otpData.phone;
1569
+ const otpType = otpData.type;
1570
+ const [otp, setOtp] = React.useState('');
1571
+ const [isDirty, setIsDirty] = React.useState(false);
1572
+ const [resendTimer, setResendTimer] = React.useState(autoSendWhenOpen ? 0 : 60);
1573
+ const inputRef = React.useRef(null);
1574
+ const [errorMsg, setErrorMsg] = React.useState();
1575
+ const [displayPhone, setDisplayPhone] = React.useState('');
1576
+ const formatPhoneNumberIntlRef = React.useRef();
1577
+ const [isSubmitLoading, setIsSubmitLoading] = React.useState(false);
1578
+ const { classes, cx } = useStyles$1(undefined, {
1579
+ name: 'LeadGen__OTP',
1580
+ styles,
1581
+ classNames,
1582
+ });
1583
+ React.useEffect(() => {
1584
+ (() => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
1585
+ var _a;
1586
+ if (!formatPhoneNumberIntlRef.current) {
1587
+ const res = yield Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('react-phone-number-input')); });
1588
+ formatPhoneNumberIntlRef.current = res.formatPhoneNumberIntl;
1589
+ }
1590
+ setDisplayPhone(((_a = formatPhoneNumberIntlRef.current) === null || _a === void 0 ? void 0 : _a.call(formatPhoneNumberIntlRef, phone)) || phone);
1591
+ }))();
1592
+ }, [phone]);
1593
+ const sendOtp = () => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
1594
+ var _a;
1595
+ if (!phone) {
1596
+ return;
1597
+ }
1598
+ const res = yield Service.sendSMSOtpLead({
1599
+ phone,
1600
+ type: otpType,
1601
+ });
1602
+ const respMessage = (_a = res === null || res === void 0 ? void 0 : res._messages) === null || _a === void 0 ? void 0 : _a[0];
1603
+ if (respMessage === 'Send sms successfully' ||
1604
+ respMessage === 'Send WhatsApp successfully' ||
1605
+ respMessage === 'Send Zalo successfully') {
1606
+ setResendTimer(60);
1607
+ setTimeout(() => {
1608
+ if (inputRef.current) {
1609
+ inputRef.current.focus();
1610
+ inputRef.current.scrollIntoView({ block: 'center' });
1611
+ }
1612
+ }, 100);
1613
+ }
1614
+ else if (respMessage === 'This phone number was verified') {
1615
+ onSuccess();
1616
+ }
1617
+ else {
1618
+ setErrorMsg(respMessage || 'Something went wrong!');
1619
+ // const defaultError = f({ id: 'notification.comment.somethingWrong' })
1620
+ // setStatusVerifyOTP('idle')
1621
+ // pushNotifications({
1622
+ // title: respMessage || defaultError,
1623
+ // message: '',
1624
+ // type: 'danger',
1625
+ // })
1626
+ }
1627
+ });
1628
+ const submitOtp = () => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
1629
+ if (!phone || !otp) {
1630
+ return;
1631
+ }
1632
+ setIsSubmitLoading(true);
1633
+ const res = yield Service.verifyOtpLead({
1634
+ phone,
1635
+ otp,
1636
+ type: otpType,
1637
+ });
1638
+ const respMessage = res === null || res === void 0 ? void 0 : res._messages[0];
1639
+ if (respMessage === 'Verify successfully' ||
1640
+ respMessage === 'Verify WhatsApp OTP sucess' ||
1641
+ respMessage === 'Verify Zalo OTP sucess') {
1642
+ onSuccess();
1643
+ }
1644
+ else if (respMessage === 'This phone number was verified') {
1645
+ onSuccess();
1646
+ }
1647
+ else {
1648
+ setErrorMsg(respMessage || 'something Wrong');
1649
+ // setIsShowError(true)
1650
+ // setStatusVerifyOTP('sent')
1651
+ // pushNotifications({
1652
+ // title: res?._messages[0] || defaultError,
1653
+ // message: '',
1654
+ // type: 'danger',
1655
+ // })
1656
+ }
1657
+ setIsSubmitLoading(false);
1658
+ });
1659
+ React.useEffect(() => {
1660
+ setTimeout(() => {
1661
+ if (resendTimer > 0) {
1662
+ setResendTimer((r) => r - 1);
1663
+ }
1664
+ }, 1000);
1665
+ }, [resendTimer]);
1666
+ React.useEffect(() => {
1667
+ if (autoSendWhenOpen && !resendTimer) {
1668
+ sendOtp();
1669
+ }
1670
+ }, []);
1671
+ return (React__default["default"].createElement(React__default["default"].Fragment, null,
1672
+ React__default["default"].createElement(core.Box, { component: "form", onSubmit: (e) => {
1673
+ e.preventDefault();
1674
+ submitOtp();
1675
+ }, className: cx(classes.root, className) },
1676
+ React__default["default"].createElement("div", { className: classes.header },
1677
+ React__default["default"].createElement(index$6.Heading, { tag: "h3", className: classes.heading }, t('lead.otp.title')),
1678
+ React__default["default"].createElement(index$2.Text, { size: "p3", className: classes.description }, t('lead.otp.desc', { phone: displayPhone }))),
1679
+ React__default["default"].createElement(index$3.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) => {
1680
+ setIsDirty(true);
1681
+ setOtp(v);
1682
+ if (isDirty && !v)
1683
+ setErrorMsg('OTP is required');
1684
+ else
1685
+ setErrorMsg(undefined);
1686
+ }, error: isDirty ? errorMsg : undefined }),
1687
+ React__default["default"].createElement("div", { className: classes.actions },
1688
+ React__default["default"].createElement(index$4.Button, { type: "submit", size: "md", color: "primary", className: classes.submitBtn,
1689
+ // onClick={() => submitOtp()}
1690
+ disabled: !otp, loading: isSubmitLoading }, t('lead.otp.verify')),
1691
+ React__default["default"].createElement(index$4.Button, { type: "button", size: "md", color: "transparent", className: classes.resendOtp, onClick: () => {
1692
+ sendOtp();
1693
+ }, disabled: !!resendTimer }, t('lead.otp.resend', {
1694
+ timer: resendTimer ? ` (${resendTimer}s)` : '',
1695
+ }))))));
1688
1696
  };
1689
- const getTranslations = (locale) => {
1690
- const translations = Object.assign(Object.assign({}, translationsProvider.translationsMap[locale]), translationsMap[locale]);
1691
- if (translations) {
1692
- return translations;
1693
- }
1694
- return translationsMap['en-PH'];
1697
+ const OtpBlock$1 = (_a) => {
1698
+ var rest = tslib_es6.__rest(_a, []);
1699
+ const { showOtpPhone, setShowOtpPhone, onSubmit,
1700
+ // formRef,
1701
+ // leadFormConfig: { form },
1702
+ } = React.useContext(LeadGenComponentContext);
1703
+ return showOtpPhone ? (React__default["default"].createElement(OtpBlockComponent, Object.assign({ otpData: showOtpPhone, autoSendWhenOpen: false, onSuccess: () => {
1704
+ setShowOtpPhone(null);
1705
+ onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit();
1706
+ } }, rest))) : null;
1695
1707
  };
1696
1708
 
1697
- const LeadGenTranslationProvider = (props) => {
1698
- const { locale, children } = props;
1699
- const translationContextValue = React.useMemo(() => ({ locale, values: getTranslations(locale) }), [locale]);
1700
- return (React__default["default"].createElement(translationsContext.TranslationsContext.Provider, { value: translationContextValue }, children));
1709
+ const Thankyou = ({ children, }) => {
1710
+ const { showThankyou, setShowThankyou } = React.useContext(LeadGenComponentContext);
1711
+ return showThankyou
1712
+ ? children(showThankyou, () => setShowThankyou(null))
1713
+ : null;
1701
1714
  };
1702
1715
 
1703
1716
  // import mockLeadData from './mockLeadData'
@@ -2075,8 +2088,8 @@ const LeadGenContext = React.createContext({
2075
2088
  });
2076
2089
  const LeadGenContextProvider = (props) => {
2077
2090
  const { campaign_code: campaignCodeProps, apiSsoUrl, apiLeadUrl, apiSubotUrl, locale: localeProps, forceCampaign: forceCampaignProps, extraValues, articleId = 1, categoryList, siteDomain: site_domain, children, userInfo } = props, restProps = tslib_es6.__rest(props, ["campaign_code", "apiSsoUrl", "apiLeadUrl", "apiSubotUrl", "locale", "forceCampaign", "extraValues", "articleId", "categoryList", "siteDomain", "children", "userInfo"]);
2078
- const { t } = index$1.useTranslations();
2079
2091
  const [forceCampaign, setForceCampaign] = React.useState(forceCampaignProps);
2092
+ const { t } = useLeadGenTranslations();
2080
2093
  const [subscriptionInfo, setSubscriptionInfo] = React.useState({
2081
2094
  subscriptionIcon: '',
2082
2095
  subscriptionTitle: '',
@@ -2355,8 +2368,7 @@ const LeadGenContextProvider = (props) => {
2355
2368
  apiSubotUrl, locale: localeProps, articleId, categoryId: subscriptionInfo.subcriptionCateId, siteDomain: site_domain, forceCampaign,
2356
2369
  submit,
2357
2370
  submitSubscriptionBox,
2358
- impression }) },
2359
- React__default["default"].createElement(LeadGenTranslationProvider, { locale: locale }, children)));
2371
+ impression }) }, children));
2360
2372
  };
2361
2373
  const useLeadGenContext = () => {
2362
2374
  const context = React.useContext(LeadGenContext);
@@ -2416,7 +2428,7 @@ dayjs__default["default"].extend(customParseFormat);
2416
2428
  const [LeadFormProvider, useLeadFormContext, useLeadForm] = form.createFormContext();
2417
2429
  const useLeadFormConfig = ({ listBlockAdded = [], validatingPhoneRef, validatingEmailRef, campaignId, campaign_subot_id = [], userInfo, format, }) => {
2418
2430
  var _a;
2419
- const { t } = index$1.useTranslations();
2431
+ const { t } = useLeadGenTranslations();
2420
2432
  const initialValues = React.useMemo(() => formatLeadGenFormValue(mappingSSOToLead(userInfo), listBlockAdded), [userInfo === null || userInfo === void 0 ? void 0 : userInfo.id]);
2421
2433
  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] ||
2422
2434
  LEAD_LOCALE_DATA$1['vi-VN'];
@@ -3184,8 +3196,9 @@ const LeadGenSubscriptionBoxContainer = (props) => {
3184
3196
  return null;
3185
3197
  }
3186
3198
  return (React__default["default"].createElement(index$a.MantineProvider, { locale: locale, customStyleType: index$9.CustomStylesType.LEADGEN },
3187
- React__default["default"].createElement(LeadGenContextProvider, Object.assign({}, props, { apiLeadUrl: apiUrl, apiSubotUrl: apiSubotUrl }),
3188
- React__default["default"].createElement(Container, null))));
3199
+ React__default["default"].createElement(LeadGenTranslationProvider, { locale: locale },
3200
+ React__default["default"].createElement(LeadGenContextProvider, Object.assign({}, props, { apiLeadUrl: apiUrl, apiSubotUrl: apiSubotUrl }),
3201
+ React__default["default"].createElement(Container, null)))));
3189
3202
  };
3190
3203
  const LeadGenSubscriptionBox = LeadGenSubscriptionBoxContainer;
3191
3204
 
@@ -4030,7 +4043,7 @@ const EmptyIcon = (props) => {
4030
4043
  };
4031
4044
 
4032
4045
  const EmptyComponent = ({ onClose, onContinue, }) => {
4033
- const { t } = index$1.useTranslations();
4046
+ const { t } = useLeadGenTranslations();
4034
4047
  return (React__default["default"].createElement("div", { className: "leadgen-empty" },
4035
4048
  React__default["default"].createElement("div", { className: "leadgen-empty_body" },
4036
4049
  React__default["default"].createElement("div", { className: "leadgen-empty_wrapper" },
@@ -4046,7 +4059,7 @@ const SubtitleBlock = ({ children, align, }) => (React__default["default"].creat
4046
4059
  const TitleBlock = ({ children, align, }) => (React__default["default"].createElement("h2", { className: `lead-modal__title ${'le-text-align-' + (align || '')} ${LEAD_CLASS}` }, children));
4047
4060
 
4048
4061
  const LightboxFields = ({ listBlockAdded, popupId, locale, hasSubmitBtn, isSubmitLoading, disabledButtonSubmit, }) => {
4049
- const { t } = index$1.useTranslations();
4062
+ const { t } = useLeadGenTranslations();
4050
4063
  const { setRedirectUrl } = React.useContext(LeadGenContext$1);
4051
4064
  const form = useLeadFormContext();
4052
4065
  const formValues = form.values;
@@ -4372,7 +4385,7 @@ const HeaderImage = ({ src, ratio = 3 / 2, className, style, }) => {
4372
4385
 
4373
4386
  const OtpBlock = ({ otpData, onSuccess, autoSendWhenOpen, }) => {
4374
4387
  const { primaryColor } = React.useContext(LeadGenContext$1);
4375
- const { t } = index$1.useTranslations();
4388
+ const { t } = useLeadGenTranslations();
4376
4389
  const phone = otpData.phone;
4377
4390
  const otpType = otpData.type;
4378
4391
  const [otp, setOtp] = React.useState('');
@@ -4585,7 +4598,7 @@ const StyledImageWrap = styled__default["default"].div `
4585
4598
  `;
4586
4599
 
4587
4600
  const FreebieLuckyGiftItem = ({ isHostedByClient, locale, data: { image, name, desc, prize_value, prize_unit, cta_button, winning_slot, }, }) => {
4588
- const { t } = index$1.useTranslations();
4601
+ const { t } = useLeadGenTranslations();
4589
4602
  console.log(prize_value, prize_unit, locale);
4590
4603
  const formattedPrice = prize_value && prize_unit
4591
4604
  ? utils$2.currencyFormat(prize_value, locale, prize_unit)
@@ -4637,7 +4650,7 @@ const FreebieCarousel = ({ isHostedByClient, data, locale, }) => {
4637
4650
  const { classes } = useStyles(undefined, {
4638
4651
  name: 'Carousel',
4639
4652
  });
4640
- const { t } = index$1.useTranslations();
4653
+ const { t } = useLeadGenTranslations();
4641
4654
  const freeSample = data.filter((item) => item.type === EFreebieType.SAMPLE);
4642
4655
  const luckyGift = data.filter((item) => item.type === EFreebieType.LUCKY_DRAW);
4643
4656
  const isHasLuckyGift = luckyGift.length > 0;
@@ -5412,7 +5425,7 @@ const formatTrackingData = (params) => {
5412
5425
  };
5413
5426
 
5414
5427
  // mount css
5415
- const _LeadGen = ({ apiUrl: apiUrlProp, siteDomain, siteId, locale, primaryColor, apiSubotUrl, DEBUG_URL, forceCampaign, children, extraPayloadValues = [], excludeExitRulesHandler, userInfo, onClose: onCloseProps, onSubmit: onSubmitProps, }) => {
5428
+ const _LeadGen = ({ apiUrl: apiUrlProp, siteDomain, siteId, locale, primaryColor, apiSubotUrl, DEBUG_URL, forceCampaign, children, extraPayloadValues = [], excludeExitRulesHandler, userInfo, onClose: onCloseProps, onSubmit: onSubmitProps, formatMessage, }) => {
5416
5429
  var _a, _b;
5417
5430
  const scrollEventHandlerRef = React.useRef();
5418
5431
  const leadStartTimeRef = React.useRef(Date.now());
@@ -5767,7 +5780,7 @@ const _LeadGen = ({ apiUrl: apiUrlProp, siteDomain, siteId, locale, primaryColor
5767
5780
  redirectUrl,
5768
5781
  setRedirectUrl,
5769
5782
  } },
5770
- React__default["default"].createElement(translationsContext.TranslationsContext.Provider, { value: { locale, values: getTranslations(locale) } },
5783
+ React__default["default"].createElement(LeadGenTranslationProvider, { locale: locale, formatMessage: formatMessage },
5771
5784
  React__default["default"].createElement(index$a.MantineProvider, { locale: locale, customStyleType: index$9.CustomStylesType.LEADGEN }, children ? (React__default["default"].createElement(Component, { campaign: showCampaign, onSubmit: onSubmit, onClose: onClose, showThankyou: showThankyou, setShowThankyou: setShowThankyou, locale: locale, showEmpty: showEmpty, setShowEmpty: setShowEmpty, userInfo: userInfo }, children)) : (React__default["default"].createElement(core.Portal, { target: utils$1.getPopupWrapperDom() },
5772
5785
  React__default["default"].createElement(core.Box, { sx: { position: 'fixed', zIndex: index$7.ZINDEX_SSO - 9e6 } },
5773
5786
  React__default["default"].createElement(core.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) => {