@hhgtech/hhg-components 1.29.358-beta-2 → 1.29.358-beta-3

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 (525) hide show
  1. package/build/{LastPeriod-a8c94819.js → LastPeriod-7ccfd74f.js} +1 -1
  2. package/build/{MobileBottomNavigationIcon-777ebefa.js → MobileBottomNavigationIcon-06d5ae04.js} +3 -3
  3. package/build/{Spinner-ce637760.js → Spinner-257993cc.js} +1 -1
  4. package/build/{WhatsApp-84166109.js → WhatsApp-a9a36fb4.js} +1 -1
  5. package/build/adapters.js +19 -19
  6. package/build/atoms.js +47 -47
  7. package/build/babyGrowth.js +83 -83
  8. package/build/cache.js +2 -2
  9. package/build/care.js +17 -17
  10. package/build/careBookingSearchBar.js +14 -14
  11. package/build/careBookingSearchBarV2.js +15 -15
  12. package/build/components/navigationV2/components/molecules/navigationBar/index.styled.d.ts +0 -2
  13. package/build/components/navigationV2/hooks/useNavConfig.d.ts +0 -1
  14. package/build/components/navigationV2/types.d.ts +1 -1
  15. package/build/components.js +95 -95
  16. package/build/{constants-18511288.js → constants-0bdc9f25.js} +1 -1
  17. package/build/constants.js +3 -3
  18. package/build/constantsDomainLocales.js +1 -1
  19. package/build/constantsRiskScreener.js +2 -2
  20. package/build/constantsSite.js +2 -2
  21. package/build/{core-f2187dd0.js → core-8ac8e02d.js} +1 -1
  22. package/build/{dataTransform-fe34ec8c.js → dataTransform-7e404dc3.js} +1 -1
  23. package/build/ecom.js +4 -4
  24. package/build/{editor-3ecfc25d.js → editor-922f2014.js} +11 -11
  25. package/build/embeddedHeathToolCards_babyGrowth.js +23 -23
  26. package/build/embeddedHeathToolCards_babyPoop.js +19 -19
  27. package/build/embeddedHeathToolCards_babyVaccine.js +22 -22
  28. package/build/embeddedHeathToolCards_bmi_bmi.js +25 -25
  29. package/build/embeddedHeathToolCards_bmrBmr.js +25 -25
  30. package/build/embeddedHeathToolCards_dueDate_dueDate.js +22 -22
  31. package/build/embeddedHeathToolCards_ovulation_ovulation.js +22 -22
  32. package/build/embeddedHeathToolCards_pwg_pwg.js +26 -26
  33. package/build/embeddedHeathToolCards_targetHeartRate.js +27 -27
  34. package/build/esm/{LastPeriod-cf115dcc.js → LastPeriod-4147d211.js} +1 -1
  35. package/build/esm/{MobileBottomNavigationIcon-0779397f.js → MobileBottomNavigationIcon-2be4c6e4.js} +3 -3
  36. package/build/esm/{Spinner-61bc8924.js → Spinner-056dac9a.js} +1 -1
  37. package/build/esm/{WhatsApp-c44d0b90.js → WhatsApp-12d39054.js} +1 -1
  38. package/build/esm/adapters.js +19 -19
  39. package/build/esm/atoms.js +47 -47
  40. package/build/esm/babyGrowth.js +83 -83
  41. package/build/esm/cache.js +2 -2
  42. package/build/esm/care.js +17 -17
  43. package/build/esm/careBookingSearchBar.js +14 -14
  44. package/build/esm/careBookingSearchBarV2.js +15 -15
  45. package/build/esm/components/navigationV2/components/molecules/navigationBar/index.styled.d.ts +0 -2
  46. package/build/esm/components/navigationV2/hooks/useNavConfig.d.ts +0 -1
  47. package/build/esm/components/navigationV2/types.d.ts +1 -1
  48. package/build/esm/components.js +95 -95
  49. package/build/esm/{constants-782dba05.js → constants-aded2345.js} +1 -1
  50. package/build/esm/constants.js +3 -3
  51. package/build/esm/constantsDomainLocales.js +1 -1
  52. package/build/esm/constantsRiskScreener.js +2 -2
  53. package/build/esm/constantsSite.js +2 -2
  54. package/build/esm/{core-ca75f054.js → core-610a0713.js} +1 -1
  55. package/build/esm/{dataTransform-6521f3a6.js → dataTransform-bbbc8727.js} +1 -1
  56. package/build/esm/ecom.js +4 -4
  57. package/build/esm/{editor-09d2defd.js → editor-6f385a58.js} +11 -11
  58. package/build/esm/embeddedHeathToolCards_babyGrowth.js +23 -23
  59. package/build/esm/embeddedHeathToolCards_babyPoop.js +19 -19
  60. package/build/esm/embeddedHeathToolCards_babyVaccine.js +22 -22
  61. package/build/esm/embeddedHeathToolCards_bmi_bmi.js +25 -25
  62. package/build/esm/embeddedHeathToolCards_bmrBmr.js +25 -25
  63. package/build/esm/embeddedHeathToolCards_dueDate_dueDate.js +22 -22
  64. package/build/esm/embeddedHeathToolCards_ovulation_ovulation.js +22 -22
  65. package/build/esm/embeddedHeathToolCards_pwg_pwg.js +26 -26
  66. package/build/esm/embeddedHeathToolCards_targetHeartRate.js +27 -27
  67. package/build/esm/footer.js +21 -21
  68. package/build/esm/gAssets.js +2 -2
  69. package/build/esm/healthToolsCardWrapper.js +18 -18
  70. package/build/esm/healthToolsForm.js +33 -33
  71. package/build/esm/hooks/useCSSFocusPopupHelper.d.ts +0 -1
  72. package/build/esm/hooks.js +13 -13
  73. package/build/esm/i18n.js +2 -2
  74. package/build/esm/i18nV2.js +2 -2
  75. package/build/esm/{index-82b32324.js → index-07b1acba.js} +10 -10
  76. package/build/esm/{index-8e9cc872.js → index-0cc8433c.js} +24 -24
  77. package/build/esm/{index-1de1575d.js → index-11d5337e.js} +2 -2
  78. package/build/esm/{index-0837bc58.js → index-142b28ed.js} +6 -6
  79. package/build/esm/{index-f6690d94.js → index-15db6202.js} +4 -4
  80. package/build/esm/{index-afa718a7.js → index-16e4de05.js} +3 -3
  81. package/build/esm/{index-8d560a79.js → index-1a90a3f6.js} +21 -21
  82. package/build/esm/{index-4056f935.js → index-1d2ff7ef.js} +2 -2
  83. package/build/esm/{index-df0db71b.js → index-2a8407c4.js} +1 -1
  84. package/build/esm/{index-3cda8f59.js → index-2b73d4df.js} +17 -17
  85. package/build/esm/{index-65fea711.js → index-30fd9cd2.js} +18 -18
  86. package/build/esm/{index-5ddb94e4.js → index-364dffea.js} +2 -2
  87. package/build/esm/{index-9c3974db.js → index-3910a2e2.js} +3 -3
  88. package/build/esm/{index-58bb5f33.js → index-4298b53e.js} +2 -2
  89. package/build/esm/{index-83aa11de.js → index-437e6858.js} +1 -1
  90. package/build/esm/{index-058436c4.js → index-494af598.js} +18 -18
  91. package/build/esm/{index-8cbad76d.js → index-53d47678.js} +2 -2
  92. package/build/esm/{index-588acc44.js → index-54536b84.js} +7 -7
  93. package/build/esm/{index-86b86a00.js → index-555d837a.js} +1 -1
  94. package/build/esm/{index-00abc3a4.js → index-576efa85.js} +1 -1
  95. package/build/esm/{index-42e84c71.js → index-5bb7b666.js} +17 -17
  96. package/build/esm/{index-ed4991de.js → index-66b3f2a6.js} +1 -1
  97. package/build/esm/{index-2bfe1955.js → index-671b108f.js} +2 -2
  98. package/build/esm/{index-4e0298e1.js → index-67b04859.js} +6 -6
  99. package/build/esm/{index-b9cd45c9.js → index-724a1b27.js} +3 -3
  100. package/build/esm/{index-6c666af1.js → index-77323900.js} +2 -2
  101. package/build/esm/{index-627a4f4b.js → index-77b5c11e.js} +13 -13
  102. package/build/esm/{index-1cb1ea20.js → index-7b616d88.js} +1 -1
  103. package/build/esm/{index-cff3f861.js → index-7b732ec9.js} +16 -16
  104. package/build/esm/{index-4b210adb.js → index-7c8f3b35.js} +2 -2
  105. package/build/esm/{index-17b7c39c.js → index-84607991.js} +2 -2
  106. package/build/esm/{index-d9a740f5.js → index-856a25a9.js} +16 -16
  107. package/build/esm/{index-1ae052ae.js → index-877935e3.js} +2 -2
  108. package/build/esm/{index-08c781ad.js → index-88949c86.js} +13 -13
  109. package/build/esm/{index-e4ed59c2.js → index-8c6e3c64.js} +6 -6
  110. package/build/esm/{index-038a0780.js → index-93889bf5.js} +31 -31
  111. package/build/esm/{index-cddbd3cb.js → index-9a853af3.js} +22 -22
  112. package/build/esm/{index-f2a58af2.js → index-9adae0cb.js} +42 -69
  113. package/build/esm/{index-c6d2b2bb.js → index-a1718d63.js} +3 -3
  114. package/build/esm/{index-317fdb9e.js → index-a260d04e.js} +11 -18
  115. package/build/esm/{index-021da3d3.js → index-a4b4cee3.js} +6 -6
  116. package/build/esm/{index-9af47657.js → index-a8c3c677.js} +3 -3
  117. package/build/esm/{index-7705e2ab.js → index-aa86dec2.js} +13 -13
  118. package/build/esm/{index-869a5f65.js → index-ac88cfac.js} +6 -6
  119. package/build/esm/{index-d727ef8e.js → index-afc5ac71.js} +15 -15
  120. package/build/esm/{index-abdc8795.js → index-b571e750.js} +3 -3
  121. package/build/esm/{index-5130c494.js → index-bd572333.js} +1 -1
  122. package/build/esm/{index-48e8eac4.js → index-c303ee5b.js} +2 -2
  123. package/build/esm/{index-d4f73c3a.js → index-c4417fc2.js} +16 -16
  124. package/build/esm/{index-609bbec5.js → index-c6694d20.js} +2 -2
  125. package/build/esm/{index-c22d74c9.js → index-c8105b5a.js} +16 -16
  126. package/build/esm/{index-e8c7d06c.js → index-cc86d927.js} +1 -1
  127. package/build/esm/{index-024e389e.js → index-dafbe69f.js} +5 -5
  128. package/build/esm/{index-acd55fd8.js → index-dc3efcdd.js} +2 -2
  129. package/build/esm/{index-51d3b1a2.js → index-e27abaf3.js} +13 -13
  130. package/build/esm/{index-09a55759.js → index-e31e2bce.js} +7 -7
  131. package/build/esm/{index-df34a710.js → index-e438eba2.js} +2 -2
  132. package/build/esm/{index-9b5c27f6.js → index-e45ce5b8.js} +32 -32
  133. package/build/esm/{index-a043265d.js → index-edb08ee4.js} +11 -11
  134. package/build/esm/{index-2e034192.js → index-ee5aca94.js} +16 -16
  135. package/build/esm/{index-61e22014.js → index-f8a5aa70.js} +24 -24
  136. package/build/esm/{index-54e0f691.js → index-fac3aff9.js} +17 -17
  137. package/build/esm/{index-8ad7c579.js → index-fadeb47f.js} +5 -5
  138. package/build/esm/{index-06be24ca.js → index-fd80e3fb.js} +1 -1
  139. package/build/esm/index.js +116 -116
  140. package/build/esm/interfaces/healthTools.d.ts +0 -1
  141. package/build/esm/{labelSorting-b03b3a60.js → labelSorting-7822659b.js} +4 -4
  142. package/build/esm/lead/helpers.d.ts +1 -51
  143. package/build/esm/lead/index.d.ts +1 -2
  144. package/build/esm/lead/layouts/lightbox/formContainer.d.ts +2 -1
  145. package/build/esm/lead/services/index.d.ts +0 -14
  146. package/build/esm/lead.css +1 -1
  147. package/build/esm/lead.js +328 -1233
  148. package/build/esm/{logoIcon-34bb52f9.js → logoIcon-daaec4f0.js} +2 -2
  149. package/build/esm/mantine.js +25 -25
  150. package/build/esm/misc.js +17 -17
  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 +73 -73
  157. package/build/esm/moleculesArticleCard.js +6 -6
  158. package/build/esm/moleculesArticleCardV2.js +16 -16
  159. package/build/esm/navigation.js +45 -45
  160. package/build/esm/navigationLogoutPopup.js +9 -9
  161. package/build/esm/navigationProfileButton.js +23 -23
  162. package/build/esm/onboardingV2.js +29 -29
  163. package/build/esm/organisms.js +49 -49
  164. package/build/esm/{post-7c5a495f.js → post-5eab1c5a.js} +2 -2
  165. package/build/esm/profileNavigation.js +19 -19
  166. package/build/esm/progressBar.js +1 -1
  167. package/build/esm/pwg.js +22 -22
  168. package/build/esm/ssoV2/api/featureFlag.d.ts +1 -2
  169. package/build/esm/ssoV2/index.d.ts +0 -1
  170. package/build/esm/ssoV2/utils.d.ts +0 -6
  171. package/build/esm/ssoV2.js +56 -50
  172. package/build/esm/{store-ee79c592.js → store-3c9c167a.js} +4 -4
  173. package/build/esm/subot.js +42 -43
  174. package/build/esm/surveyOrPremiumBanner.js +31 -31
  175. package/build/esm/surveyQuestionCard.js +10 -10
  176. package/build/esm/{surveyThankyouCard-2dd15fcc.js → surveyThankyouCard-91c1a85d.js} +5 -5
  177. package/build/esm/together.js +55 -55
  178. package/build/esm/togetherApiUtils.js +4 -4
  179. package/build/esm/togetherAtoms.js +30 -30
  180. package/build/esm/togetherComponentGlobalContext.js +4 -4
  181. package/build/esm/togetherMolecules.js +50 -50
  182. package/build/esm/togetherMoleculesCardAuthor.js +28 -28
  183. package/build/esm/togetherMoleculesPostImagePreview.js +11 -11
  184. package/build/esm/togetherMoleculesProfileDetail.js +38 -38
  185. package/build/esm/togetherOrganisms.js +49 -49
  186. package/build/esm/togetherRichTextEditor.js +17 -17
  187. package/build/esm/togetherShareBox.js +10 -10
  188. package/build/esm/{treePopoverMenu-7f1da1b2.js → treePopoverMenu-c3a8e676.js} +19 -19
  189. package/build/esm/{types-a2e79599.js → types-cdbe1e2f.js} +2 -2
  190. package/build/esm/types.js +2 -2
  191. package/build/esm/{useCategory-96e95b37.js → useCategory-841e4ad5.js} +5 -5
  192. package/build/esm/{useHealthToolCache-95003973.js → useHealthToolCache-e5e3d7b4.js} +1 -1
  193. package/build/esm/{useMantineLocale-61a713dc.js → useMantineLocale-5d6ca417.js} +6 -6
  194. package/build/esm/{usePlacesAutocomplete-b79b68b2.js → usePlacesAutocomplete-18305867.js} +1 -1
  195. package/build/esm/{useScreenSize-0a846318.js → useScreenSize-02f86d84.js} +2 -2
  196. package/build/esm/useTogetherAuthRequiredAction.js +9 -9
  197. package/build/esm/{utils-55b98af6.js → utils-a3b9d7d0.js} +2 -2
  198. package/build/esm/{utils-6770dd94.js → utils-b35eb99e.js} +2 -2
  199. package/build/esm/{utils-6cb78a7c.js → utils-c0d9723d.js} +3 -3
  200. package/build/esm/vaccination.js +21 -21
  201. package/build/footer.js +21 -21
  202. package/build/gAssets.js +2 -2
  203. package/build/healthToolsCardWrapper.js +18 -18
  204. package/build/healthToolsForm.js +33 -33
  205. package/build/hooks/useCSSFocusPopupHelper.d.ts +0 -1
  206. package/build/hooks.js +13 -13
  207. package/build/i18n.js +1 -1
  208. package/build/i18nV2.js +1 -1
  209. package/build/{index-f783a9c5.js → index-042f34c3.js} +17 -17
  210. package/build/{index-30fb9508.js → index-094bb00e.js} +17 -17
  211. package/build/{index-c3d630e5.js → index-0d3f91cf.js} +13 -13
  212. package/build/{index-aac02f70.js → index-1182e82c.js} +7 -7
  213. package/build/{index-d3d09dc3.js → index-1a319d43.js} +16 -16
  214. package/build/{index-00bdc95b.js → index-1cb3a39f.js} +2 -2
  215. package/build/{index-c9896e49.js → index-1e35e9df.js} +2 -2
  216. package/build/{index-4c9ecd21.js → index-21c65f60.js} +2 -2
  217. package/build/{index-f8044024.js → index-2805c84a.js} +6 -6
  218. package/build/{index-262e097e.js → index-2e9e93c9.js} +13 -13
  219. package/build/{index-5c3ee7c9.js → index-2ef913ba.js} +16 -16
  220. package/build/{index-def25549.js → index-3101951e.js} +2 -2
  221. package/build/{index-0b304d1c.js → index-35773e92.js} +42 -69
  222. package/build/{index-541b4070.js → index-3700de45.js} +3 -3
  223. package/build/{index-546e0e88.js → index-38ef37dc.js} +18 -18
  224. package/build/{index-f0978941.js → index-3a348fbc.js} +16 -16
  225. package/build/{index-2ff2ede0.js → index-3a58a727.js} +2 -2
  226. package/build/{index-8e3454ef.js → index-3d2e85dc.js} +2 -2
  227. package/build/{index-4bed6382.js → index-3d957292.js} +18 -18
  228. package/build/{index-a237c8c2.js → index-3e7d6cc4.js} +1 -1
  229. package/build/{index-e37d305b.js → index-40e4afae.js} +21 -21
  230. package/build/{index-54dddda5.js → index-493523ed.js} +7 -7
  231. package/build/{index-e1b1535a.js → index-4c8c9745.js} +32 -32
  232. package/build/{index-9fc631a1.js → index-5a4a5e20.js} +3 -3
  233. package/build/{index-9c6ac301.js → index-5dda52df.js} +16 -16
  234. package/build/{index-f0f5ac04.js → index-5f5fa57f.js} +24 -24
  235. package/build/{index-17af813e.js → index-66f3caf8.js} +24 -24
  236. package/build/{index-05b9ca78.js → index-68a15657.js} +2 -2
  237. package/build/{index-69ebebb9.js → index-6e0eb856.js} +17 -17
  238. package/build/{index-823089fd.js → index-6f7de6e0.js} +11 -18
  239. package/build/{index-9f6cd4fd.js → index-79c0a9a3.js} +1 -1
  240. package/build/{index-51cf3755.js → index-7bf79e35.js} +1 -1
  241. package/build/{index-b83196e3.js → index-7e25d40b.js} +31 -31
  242. package/build/{index-bb5836f1.js → index-8167a70c.js} +2 -2
  243. package/build/{index-dfc1fe72.js → index-875caddb.js} +1 -1
  244. package/build/{index-608d527a.js → index-8ba84075.js} +2 -2
  245. package/build/{index-cd924c5a.js → index-94772b72.js} +2 -2
  246. package/build/{index-19ad226f.js → index-94931efa.js} +1 -1
  247. package/build/{index-c4145c0f.js → index-94ce4d47.js} +5 -5
  248. package/build/{index-72ee39d9.js → index-973d5dda.js} +6 -6
  249. package/build/{index-3cca3c12.js → index-a071e634.js} +4 -4
  250. package/build/{index-e1853b05.js → index-a1e35f0e.js} +11 -11
  251. package/build/{index-d2279bdd.js → index-a58e746a.js} +13 -13
  252. package/build/{index-c6a55ea0.js → index-a779c4d4.js} +6 -6
  253. package/build/{index-ad3adb7f.js → index-adf4747d.js} +3 -3
  254. package/build/{index-cc75c3dc.js → index-aee6e489.js} +1 -1
  255. package/build/{index-09a1e5a7.js → index-afc55b28.js} +3 -3
  256. package/build/{index-de39c886.js → index-b4e35303.js} +2 -2
  257. package/build/{index-5833f410.js → index-baa94157.js} +3 -3
  258. package/build/{index-509eb37a.js → index-bda7773d.js} +6 -6
  259. package/build/{index-a5405974.js → index-c0c4b849.js} +2 -2
  260. package/build/{index-5f0e6e1c.js → index-cb770834.js} +2 -2
  261. package/build/{index-8c9cba51.js → index-cb8923b3.js} +1 -1
  262. package/build/{index-03289e9d.js → index-ce3c1f14.js} +3 -3
  263. package/build/{index-868af38d.js → index-ce7025ce.js} +5 -5
  264. package/build/{index-ec74e86f.js → index-d5036718.js} +1 -1
  265. package/build/{index-669c71fb.js → index-e34bc8f7.js} +13 -13
  266. package/build/{index-77e6701c.js → index-e8b60709.js} +2 -2
  267. package/build/{index-ab70e2f6.js → index-eae4cecf.js} +10 -10
  268. package/build/{index-681dd1de.js → index-eb1d7739.js} +6 -6
  269. package/build/{index-2aaa3225.js → index-ee27da23.js} +16 -16
  270. package/build/{index-60452010.js → index-f2ec72dd.js} +22 -22
  271. package/build/{index-85d31740.js → index-fce3baec.js} +15 -15
  272. package/build/{index-fbf149ea.js → index-ff76ed2d.js} +1 -1
  273. package/build/index.js +116 -116
  274. package/build/interfaces/healthTools.d.ts +0 -1
  275. package/build/{labelSorting-8535576c.js → labelSorting-92072462.js} +4 -4
  276. package/build/lead/helpers.d.ts +1 -51
  277. package/build/lead/index.d.ts +1 -2
  278. package/build/lead/layouts/lightbox/formContainer.d.ts +2 -1
  279. package/build/lead/services/index.d.ts +0 -14
  280. package/build/lead.css +1 -1
  281. package/build/lead.js +328 -1234
  282. package/build/{logoIcon-27b0c1ef.js → logoIcon-c3220e78.js} +2 -2
  283. package/build/mantine.js +22 -22
  284. package/build/misc.js +17 -17
  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 +73 -73
  291. package/build/moleculesArticleCard.js +6 -6
  292. package/build/moleculesArticleCardV2.js +16 -16
  293. package/build/navigation.js +45 -45
  294. package/build/navigationLogoutPopup.js +9 -9
  295. package/build/navigationProfileButton.js +23 -23
  296. package/build/onboardingV2.js +28 -28
  297. package/build/organisms.js +49 -49
  298. package/build/{post-085c2816.js → post-11795b83.js} +2 -2
  299. package/build/profileNavigation.js +19 -19
  300. package/build/progressBar.js +1 -1
  301. package/build/pwg.js +22 -22
  302. package/build/ssoV2/api/featureFlag.d.ts +1 -2
  303. package/build/ssoV2/index.d.ts +0 -1
  304. package/build/ssoV2/utils.d.ts +0 -6
  305. package/build/ssoV2.js +71 -65
  306. package/build/{store-86413a51.js → store-9eee7801.js} +4 -4
  307. package/build/subot.js +41 -42
  308. package/build/surveyOrPremiumBanner.js +31 -31
  309. package/build/surveyQuestionCard.js +10 -10
  310. package/build/{surveyThankyouCard-fa11ea1f.js → surveyThankyouCard-e1a87be9.js} +5 -5
  311. package/build/together.js +55 -55
  312. package/build/togetherApiUtils.js +4 -4
  313. package/build/togetherAtoms.js +30 -30
  314. package/build/togetherComponentGlobalContext.js +4 -4
  315. package/build/togetherMolecules.js +50 -50
  316. package/build/togetherMoleculesCardAuthor.js +28 -28
  317. package/build/togetherMoleculesPostImagePreview.js +11 -11
  318. package/build/togetherMoleculesProfileDetail.js +38 -38
  319. package/build/togetherOrganisms.js +49 -49
  320. package/build/togetherRichTextEditor.js +17 -17
  321. package/build/togetherShareBox.js +10 -10
  322. package/build/{treePopoverMenu-ae543b92.js → treePopoverMenu-813ac31d.js} +19 -19
  323. package/build/{types-5dc1e6e3.js → types-57843da8.js} +2 -2
  324. package/build/types.js +2 -2
  325. package/build/{useCategory-c93f5d41.js → useCategory-63720390.js} +5 -5
  326. package/build/{useHealthToolCache-3a1f8d60.js → useHealthToolCache-ac4cd200.js} +1 -1
  327. package/build/{useMantineLocale-fbbbe2fc.js → useMantineLocale-63af12b7.js} +6 -6
  328. package/build/{usePlacesAutocomplete-50b9d0b8.js → usePlacesAutocomplete-4a26eef9.js} +1 -1
  329. package/build/{useScreenSize-71fb3d5d.js → useScreenSize-0c280791.js} +2 -2
  330. package/build/useTogetherAuthRequiredAction.js +9 -9
  331. package/build/{utils-30b4b2b0.js → utils-0e570d56.js} +3 -3
  332. package/build/{utils-cd47b37e.js → utils-88fbaa85.js} +2 -2
  333. package/build/{utils-55eb8342.js → utils-db88e1f0.js} +2 -2
  334. package/build/vaccination.js +21 -21
  335. package/package.json +3 -3
  336. package/build/components/mantine/phoneInput/PhoneInput.d.ts +0 -15
  337. package/build/components/mantine/phoneInput/index.d.ts +0 -1
  338. package/build/esm/components/mantine/phoneInput/PhoneInput.d.ts +0 -15
  339. package/build/esm/components/mantine/phoneInput/index.d.ts +0 -1
  340. package/build/esm/lead/LeadGenForm/LeadGenForm.d.ts +0 -41
  341. package/build/esm/lead/LeadGenForm/LeadGenForm.styled.d.ts +0 -5
  342. package/build/esm/lead/LeadGenForm/LeadGenThankYou.d.ts +0 -20
  343. package/build/esm/lead/LeadGenForm/index.d.ts +0 -1
  344. package/build/esm/lead/LeadGenForm/textField/index.d.ts +0 -13
  345. package/build/esm/lead/LeadGenForm/textField/index.styled.d.ts +0 -11
  346. package/build/esm/lead/LeadGenSubscriptionBox/LeadGenSubscriptionBoxContainer.d.ts +0 -25
  347. package/build/esm/lead/LeadGenSubscriptionBox/LeadGenSubscriptionBoxContext.d.ts +0 -25
  348. package/build/esm/lead/LeadGenSubscriptionBox/LeadGenSubscriptionBoxWrapper.d.ts +0 -30
  349. package/build/esm/lead/LeadGenSubscriptionBox/index.d.ts +0 -1
  350. package/build/esm/utils-38ba72f2.js +0 -56
  351. package/build/lead/LeadGenForm/LeadGenForm.d.ts +0 -41
  352. package/build/lead/LeadGenForm/LeadGenForm.styled.d.ts +0 -5
  353. package/build/lead/LeadGenForm/LeadGenThankYou.d.ts +0 -20
  354. package/build/lead/LeadGenForm/index.d.ts +0 -1
  355. package/build/lead/LeadGenForm/textField/index.d.ts +0 -13
  356. package/build/lead/LeadGenForm/textField/index.styled.d.ts +0 -11
  357. package/build/lead/LeadGenSubscriptionBox/LeadGenSubscriptionBoxContainer.d.ts +0 -25
  358. package/build/lead/LeadGenSubscriptionBox/LeadGenSubscriptionBoxContext.d.ts +0 -25
  359. package/build/lead/LeadGenSubscriptionBox/LeadGenSubscriptionBoxWrapper.d.ts +0 -30
  360. package/build/lead/LeadGenSubscriptionBox/index.d.ts +0 -1
  361. package/build/utils-281a9538.js +0 -62
  362. /package/build/{BMI_BOYS.percentile.monthly-8ecd4b3b.js → BMI_BOYS.percentile.monthly-183d7678.js} +0 -0
  363. /package/build/{BMI_BOYS.percentile.weekly-f18e6c90.js → BMI_BOYS.percentile.weekly-fe01dd09.js} +0 -0
  364. /package/build/{BMI_BOYS.percentile.yearly-76720f40.js → BMI_BOYS.percentile.yearly-19b2c66a.js} +0 -0
  365. /package/build/{BMI_BOYS.zscore.monthly-87d625ec.js → BMI_BOYS.zscore.monthly-fc1f4846.js} +0 -0
  366. /package/build/{BMI_BOYS.zscore.weekly-0839d655.js → BMI_BOYS.zscore.weekly-06c174e7.js} +0 -0
  367. /package/build/{BMI_BOYS.zscore.yearly-e4a8532f.js → BMI_BOYS.zscore.yearly-b268aca6.js} +0 -0
  368. /package/build/{BMI_GIRLS.percentile.monthly-ddc436f1.js → BMI_GIRLS.percentile.monthly-1a611734.js} +0 -0
  369. /package/build/{BMI_GIRLS.percentile.weekly-d09dd7f4.js → BMI_GIRLS.percentile.weekly-fefa6733.js} +0 -0
  370. /package/build/{BMI_GIRLS.percentile.yearly-f9b927e6.js → BMI_GIRLS.percentile.yearly-1959a95b.js} +0 -0
  371. /package/build/{BMI_GIRLS.zscore.monthly-f7d79275.js → BMI_GIRLS.zscore.monthly-ff8697fb.js} +0 -0
  372. /package/build/{BMI_GIRLS.zscore.weekly-764e9229.js → BMI_GIRLS.zscore.weekly-03b1dacc.js} +0 -0
  373. /package/build/{BMI_GIRLS.zscore.yearly-ce598791.js → BMI_GIRLS.zscore.yearly-35f18b18.js} +0 -0
  374. /package/build/{ChevronDown-1dfec847.js → ChevronDown-9b4d47bc.js} +0 -0
  375. /package/build/{Close-3cb8f40f.js → Close-7a4b7517.js} +0 -0
  376. /package/build/{Google-1cf70b3f.js → Google-395d574a.js} +0 -0
  377. /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-6a81319d.js → HEAD CIRCUM_BOYS.percentile.monthly-fd77a2f3.js} +0 -0
  378. /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-91f33e79.js → HEAD CIRCUM_BOYS.percentile.weekly-cb064bfa.js} +0 -0
  379. /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-94173e23.js → HEAD CIRCUM_BOYS.percentile.yearly-71c49c76.js} +0 -0
  380. /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-3b0976ae.js → HEAD CIRCUM_BOYS.zscore.monthly-c556265c.js} +0 -0
  381. /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-9944b64c.js → HEAD CIRCUM_BOYS.zscore.weekly-3ad2d0d2.js} +0 -0
  382. /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-621628ff.js → HEAD CIRCUM_BOYS.zscore.yearly-d1499477.js} +0 -0
  383. /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-0269f294.js → HEAD CIRCUM_GIRLS.percentile.monthly-8db5f10e.js} +0 -0
  384. /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-ef2fbfad.js → HEAD CIRCUM_GIRLS.percentile.weekly-8ed4d425.js} +0 -0
  385. /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-46452ad2.js → HEAD CIRCUM_GIRLS.percentile.yearly-64adbb9d.js} +0 -0
  386. /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-14c02ed9.js → HEAD CIRCUM_GIRLS.zscore.monthly-dd9c7d2e.js} +0 -0
  387. /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-57107844.js → HEAD CIRCUM_GIRLS.zscore.weekly-8bd61433.js} +0 -0
  388. /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-ae975d01.js → HEAD CIRCUM_GIRLS.zscore.yearly-017a7d61.js} +0 -0
  389. /package/build/{HEIGHT_BOYS.percentile.monthly-a9a05f3f.js → HEIGHT_BOYS.percentile.monthly-ad4d6730.js} +0 -0
  390. /package/build/{HEIGHT_BOYS.percentile.weekly-486d98e9.js → HEIGHT_BOYS.percentile.weekly-07af944c.js} +0 -0
  391. /package/build/{HEIGHT_BOYS.percentile.yearly-6cd6244b.js → HEIGHT_BOYS.percentile.yearly-d3b603e0.js} +0 -0
  392. /package/build/{HEIGHT_BOYS.zscore.monthly-6e1da27e.js → HEIGHT_BOYS.zscore.monthly-5b4cea2e.js} +0 -0
  393. /package/build/{HEIGHT_BOYS.zscore.weekly-62c1a866.js → HEIGHT_BOYS.zscore.weekly-284d292f.js} +0 -0
  394. /package/build/{HEIGHT_BOYS.zscore.yearly-e3a2c8a7.js → HEIGHT_BOYS.zscore.yearly-0ac9deed.js} +0 -0
  395. /package/build/{HEIGHT_GIRLS.percentile.monthly-931a2667.js → HEIGHT_GIRLS.percentile.monthly-46a28d9f.js} +0 -0
  396. /package/build/{HEIGHT_GIRLS.percentile.weekly-0ee6c6bf.js → HEIGHT_GIRLS.percentile.weekly-a4ebbab5.js} +0 -0
  397. /package/build/{HEIGHT_GIRLS.percentile.yearly-82d4fb8f.js → HEIGHT_GIRLS.percentile.yearly-a712af6c.js} +0 -0
  398. /package/build/{HEIGHT_GIRLS.zscore.monthly-c492842e.js → HEIGHT_GIRLS.zscore.monthly-4a3d25d8.js} +0 -0
  399. /package/build/{HEIGHT_GIRLS.zscore.weekly-8fb350b2.js → HEIGHT_GIRLS.zscore.weekly-53907131.js} +0 -0
  400. /package/build/{HEIGHT_GIRLS.zscore.yearly-6ac447b9.js → HEIGHT_GIRLS.zscore.yearly-84139e09.js} +0 -0
  401. /package/build/{Locale-b74a18e2.js → Locale-34fa0b01.js} +0 -0
  402. /package/build/{Visible-f7a39209.js → Visible-43f37801.js} +0 -0
  403. /package/build/{WEIGHT_BOYS.percentile.monthly-2708353d.js → WEIGHT_BOYS.percentile.monthly-6778e64d.js} +0 -0
  404. /package/build/{WEIGHT_BOYS.percentile.weekly-4206d8cd.js → WEIGHT_BOYS.percentile.weekly-23c52d7c.js} +0 -0
  405. /package/build/{WEIGHT_BOYS.percentile.yearly-985ce460.js → WEIGHT_BOYS.percentile.yearly-eac2cc63.js} +0 -0
  406. /package/build/{WEIGHT_BOYS.zscore.monthly-0d85c928.js → WEIGHT_BOYS.zscore.monthly-1b248f32.js} +0 -0
  407. /package/build/{WEIGHT_BOYS.zscore.weekly-b25215c1.js → WEIGHT_BOYS.zscore.weekly-a331896d.js} +0 -0
  408. /package/build/{WEIGHT_BOYS.zscore.yearly-8442399d.js → WEIGHT_BOYS.zscore.yearly-a2c11a66.js} +0 -0
  409. /package/build/{WEIGHT_GIRLS.percentile.monthly-919a8e62.js → WEIGHT_GIRLS.percentile.monthly-041c33fc.js} +0 -0
  410. /package/build/{WEIGHT_GIRLS.percentile.weekly-06e5bf3b.js → WEIGHT_GIRLS.percentile.weekly-c847c193.js} +0 -0
  411. /package/build/{WEIGHT_GIRLS.percentile.yearly-66ddd6bb.js → WEIGHT_GIRLS.percentile.yearly-9de43cee.js} +0 -0
  412. /package/build/{WEIGHT_GIRLS.zscore.monthly-8874953a.js → WEIGHT_GIRLS.zscore.monthly-464e0d7c.js} +0 -0
  413. /package/build/{WEIGHT_GIRLS.zscore.weekly-a053709f.js → WEIGHT_GIRLS.zscore.weekly-f97171fc.js} +0 -0
  414. /package/build/{WEIGHT_GIRLS.zscore.yearly-32874bec.js → WEIGHT_GIRLS.zscore.yearly-d7777a5c.js} +0 -0
  415. /package/build/{animation-6018abd1.js → animation-0e910b02.js} +0 -0
  416. /package/build/{constants-297f3adb.js → constants-3ca38c70.js} +0 -0
  417. /package/build/{constants-5ebc25b8.js → constants-6410e403.js} +0 -0
  418. /package/build/{constants-5332133a.js → constants-ab24d47f.js} +0 -0
  419. /package/build/{dataTransform-9ce6f0a0.js → dataTransform-5c161e5f.js} +0 -0
  420. /package/build/{doctor-19f42a47.js → doctor-c3f479a3.js} +0 -0
  421. /package/build/esm/{BMI_BOYS.percentile.monthly-559cd34e.js → BMI_BOYS.percentile.monthly-0520a8ac.js} +0 -0
  422. /package/build/esm/{BMI_BOYS.percentile.weekly-b748074d.js → BMI_BOYS.percentile.weekly-49794473.js} +0 -0
  423. /package/build/esm/{BMI_BOYS.percentile.yearly-70cb2df6.js → BMI_BOYS.percentile.yearly-8c11e918.js} +0 -0
  424. /package/build/esm/{BMI_BOYS.zscore.monthly-a4e5965c.js → BMI_BOYS.zscore.monthly-df6ecb3c.js} +0 -0
  425. /package/build/esm/{BMI_BOYS.zscore.weekly-6a6874de.js → BMI_BOYS.zscore.weekly-b8b935f4.js} +0 -0
  426. /package/build/esm/{BMI_BOYS.zscore.yearly-eaf47070.js → BMI_BOYS.zscore.yearly-3bc152db.js} +0 -0
  427. /package/build/esm/{BMI_GIRLS.percentile.monthly-8ba5ff72.js → BMI_GIRLS.percentile.monthly-3bb093a2.js} +0 -0
  428. /package/build/esm/{BMI_GIRLS.percentile.weekly-8bdfd8da.js → BMI_GIRLS.percentile.weekly-be9efaaa.js} +0 -0
  429. /package/build/esm/{BMI_GIRLS.percentile.yearly-c8e0dc2c.js → BMI_GIRLS.percentile.yearly-56dfdc67.js} +0 -0
  430. /package/build/esm/{BMI_GIRLS.zscore.monthly-0b7abcbc.js → BMI_GIRLS.zscore.monthly-4f95b2af.js} +0 -0
  431. /package/build/esm/{BMI_GIRLS.zscore.weekly-c2d52b27.js → BMI_GIRLS.zscore.weekly-de16f442.js} +0 -0
  432. /package/build/esm/{BMI_GIRLS.zscore.yearly-802d5790.js → BMI_GIRLS.zscore.yearly-0c0d52df.js} +0 -0
  433. /package/build/esm/{ChevronDown-4a0e2900.js → ChevronDown-03fcad35.js} +0 -0
  434. /package/build/esm/{Close-dfe80a9c.js → Close-bf351f60.js} +0 -0
  435. /package/build/esm/{Google-8db94e87.js → Google-59b0e207.js} +0 -0
  436. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.monthly-1d5aef5e.js → HEAD CIRCUM_BOYS.percentile.monthly-8eb2d545.js} +0 -0
  437. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.weekly-d76dec4e.js → HEAD CIRCUM_BOYS.percentile.weekly-cd5aecca.js} +0 -0
  438. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.yearly-e6d1494e.js → HEAD CIRCUM_BOYS.percentile.yearly-de65819a.js} +0 -0
  439. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.monthly-d3687984.js → HEAD CIRCUM_BOYS.zscore.monthly-a2677878.js} +0 -0
  440. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.weekly-70b7fe6d.js → HEAD CIRCUM_BOYS.zscore.weekly-7c753e02.js} +0 -0
  441. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.yearly-4c04d8c6.js → HEAD CIRCUM_BOYS.zscore.yearly-ba916058.js} +0 -0
  442. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.monthly-42fb1f31.js → HEAD CIRCUM_GIRLS.percentile.monthly-dc7fa2da.js} +0 -0
  443. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.weekly-3c7149df.js → HEAD CIRCUM_GIRLS.percentile.weekly-6cf85c72.js} +0 -0
  444. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.yearly-a78160c9.js → HEAD CIRCUM_GIRLS.percentile.yearly-9d1364f4.js} +0 -0
  445. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.monthly-331adb6a.js → HEAD CIRCUM_GIRLS.zscore.monthly-1977d549.js} +0 -0
  446. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.weekly-40f24abf.js → HEAD CIRCUM_GIRLS.zscore.weekly-0fc4eeee.js} +0 -0
  447. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.yearly-b68986e6.js → HEAD CIRCUM_GIRLS.zscore.yearly-386b261e.js} +0 -0
  448. /package/build/esm/{HEIGHT_BOYS.percentile.monthly-84a6dc37.js → HEIGHT_BOYS.percentile.monthly-705e2b1d.js} +0 -0
  449. /package/build/esm/{HEIGHT_BOYS.percentile.weekly-5d911254.js → HEIGHT_BOYS.percentile.weekly-ac015729.js} +0 -0
  450. /package/build/esm/{HEIGHT_BOYS.percentile.yearly-2acebf10.js → HEIGHT_BOYS.percentile.yearly-0247a171.js} +0 -0
  451. /package/build/esm/{HEIGHT_BOYS.zscore.monthly-20581257.js → HEIGHT_BOYS.zscore.monthly-3fb07762.js} +0 -0
  452. /package/build/esm/{HEIGHT_BOYS.zscore.weekly-b0264609.js → HEIGHT_BOYS.zscore.weekly-8e519c0d.js} +0 -0
  453. /package/build/esm/{HEIGHT_BOYS.zscore.yearly-be1e6519.js → HEIGHT_BOYS.zscore.yearly-54e5ad03.js} +0 -0
  454. /package/build/esm/{HEIGHT_GIRLS.percentile.monthly-25d8e2ae.js → HEIGHT_GIRLS.percentile.monthly-1e62e9c0.js} +0 -0
  455. /package/build/esm/{HEIGHT_GIRLS.percentile.weekly-f47301ae.js → HEIGHT_GIRLS.percentile.weekly-2e27d9b3.js} +0 -0
  456. /package/build/esm/{HEIGHT_GIRLS.percentile.yearly-cac216bd.js → HEIGHT_GIRLS.percentile.yearly-f6146fc8.js} +0 -0
  457. /package/build/esm/{HEIGHT_GIRLS.zscore.monthly-24351fa7.js → HEIGHT_GIRLS.zscore.monthly-68be7e21.js} +0 -0
  458. /package/build/esm/{HEIGHT_GIRLS.zscore.weekly-1142b9b3.js → HEIGHT_GIRLS.zscore.weekly-6d68fe78.js} +0 -0
  459. /package/build/esm/{HEIGHT_GIRLS.zscore.yearly-3a97b0e3.js → HEIGHT_GIRLS.zscore.yearly-2d22019b.js} +0 -0
  460. /package/build/esm/{Locale-0fe839f4.js → Locale-559226db.js} +0 -0
  461. /package/build/esm/{Visible-78891ff8.js → Visible-3d7a8862.js} +0 -0
  462. /package/build/esm/{WEIGHT_BOYS.percentile.monthly-cd6c58d1.js → WEIGHT_BOYS.percentile.monthly-30980ace.js} +0 -0
  463. /package/build/esm/{WEIGHT_BOYS.percentile.weekly-5fc8bcb7.js → WEIGHT_BOYS.percentile.weekly-0f580606.js} +0 -0
  464. /package/build/esm/{WEIGHT_BOYS.percentile.yearly-4c20a4cb.js → WEIGHT_BOYS.percentile.yearly-b099b1ec.js} +0 -0
  465. /package/build/esm/{WEIGHT_BOYS.zscore.monthly-0a285cc7.js → WEIGHT_BOYS.zscore.monthly-62e0e893.js} +0 -0
  466. /package/build/esm/{WEIGHT_BOYS.zscore.weekly-6097b85e.js → WEIGHT_BOYS.zscore.weekly-25dd429e.js} +0 -0
  467. /package/build/esm/{WEIGHT_BOYS.zscore.yearly-2c2a3f48.js → WEIGHT_BOYS.zscore.yearly-f1d7c781.js} +0 -0
  468. /package/build/esm/{WEIGHT_GIRLS.percentile.monthly-baccddc8.js → WEIGHT_GIRLS.percentile.monthly-c044c53b.js} +0 -0
  469. /package/build/esm/{WEIGHT_GIRLS.percentile.weekly-179346a5.js → WEIGHT_GIRLS.percentile.weekly-222e516a.js} +0 -0
  470. /package/build/esm/{WEIGHT_GIRLS.percentile.yearly-6b081fdc.js → WEIGHT_GIRLS.percentile.yearly-29caad8c.js} +0 -0
  471. /package/build/esm/{WEIGHT_GIRLS.zscore.monthly-ee266cc0.js → WEIGHT_GIRLS.zscore.monthly-f2bb66de.js} +0 -0
  472. /package/build/esm/{WEIGHT_GIRLS.zscore.weekly-95df1c97.js → WEIGHT_GIRLS.zscore.weekly-68f9cb84.js} +0 -0
  473. /package/build/esm/{WEIGHT_GIRLS.zscore.yearly-8b6014dc.js → WEIGHT_GIRLS.zscore.yearly-0564e539.js} +0 -0
  474. /package/build/esm/{animation-eb0600e7.js → animation-a3e56df8.js} +0 -0
  475. /package/build/esm/{constants-9675deb2.js → constants-2855671a.js} +0 -0
  476. /package/build/esm/{constants-7d3c8038.js → constants-736a1361.js} +0 -0
  477. /package/build/esm/{constants-afd70710.js → constants-a53b1566.js} +0 -0
  478. /package/build/esm/{dataTransform-e5e66b88.js → dataTransform-8dc43cc8.js} +0 -0
  479. /package/build/esm/{doctor-1cfe27db.js → doctor-c0de377a.js} +0 -0
  480. /package/build/esm/{index-3f5277e4.js → index-179f52e7.js} +0 -0
  481. /package/build/esm/{index-d48c45bb.js → index-2156e840.js} +0 -0
  482. /package/build/esm/{index-25ecd1e3.js → index-5b1385be.js} +0 -0
  483. /package/build/esm/{index-d9eea212.js → index-818593cf.js} +0 -0
  484. /package/build/esm/{index-a9d94c38.js → index-8573c079.js} +0 -0
  485. /package/build/esm/{index-9b474e8f.js → index-860e1c86.js} +0 -0
  486. /package/build/esm/{index-02c8be33.js → index-d03a12b1.js} +0 -0
  487. /package/build/esm/{index-f9c95ed3.js → index-e5d9a393.js} +0 -0
  488. /package/build/esm/{index-d71d1838.js → index-fac7fdc2.js} +0 -0
  489. /package/build/esm/{index.styles-7e8e723e.js → index.styles-6c3c23d3.js} +0 -0
  490. /package/build/esm/{localizeNumberFormat-cdbb31df.js → localizeNumberFormat-8b985517.js} +0 -0
  491. /package/build/esm/{normalizeLink-7c0d8cfc.js → normalizeLink-0fa73967.js} +0 -0
  492. /package/build/esm/{number-0d601f08.js → number-aedcb933.js} +0 -0
  493. /package/build/esm/{other-3c2c2888.js → other-acddb230.js} +0 -0
  494. /package/build/esm/{paths-a3da84bc.js → paths-4304a015.js} +0 -0
  495. /package/build/esm/{translationsContext-eadc2f8c.js → translationsContext-d7e74248.js} +0 -0
  496. /package/build/esm/{tslib.es6-3b3bf6ee.js → tslib.es6-ec147d4e.js} +0 -0
  497. /package/build/esm/{types-288df4ca.js → types-7f06cd21.js} +0 -0
  498. /package/build/esm/{useIsInit-7eb2ae3f.js → useIsInit-1ed497e1.js} +0 -0
  499. /package/build/esm/{useOutsideClick-431c9564.js → useOutsideClick-6a434153.js} +0 -0
  500. /package/build/esm/{useScrollbarSize-163a0ea0.js → useScrollbarSize-d4d72843.js} +0 -0
  501. /package/build/esm/{useUniqueId-4f87763e.js → useUniqueId-629ceab2.js} +0 -0
  502. /package/build/esm/{utils-0499e7df.js → utils-cd21d010.js} +0 -0
  503. /package/build/{index-4dab1087.js → index-08b60373.js} +0 -0
  504. /package/build/{index-614f129a.js → index-16ec2ac4.js} +0 -0
  505. /package/build/{index-e19448b3.js → index-329da60e.js} +0 -0
  506. /package/build/{index-dd4c59be.js → index-59e8e1de.js} +0 -0
  507. /package/build/{index-ab4d52ae.js → index-6f04d878.js} +0 -0
  508. /package/build/{index-10b5f5bc.js → index-799db6c5.js} +0 -0
  509. /package/build/{index-72e51fe9.js → index-8cf81c7d.js} +0 -0
  510. /package/build/{index-53b5da60.js → index-a08bddb1.js} +0 -0
  511. /package/build/{index-c1699b1b.js → index-b412132a.js} +0 -0
  512. /package/build/{index.styles-d39cba6b.js → index.styles-35f25c8b.js} +0 -0
  513. /package/build/{localizeNumberFormat-6a4549e3.js → localizeNumberFormat-a54afedd.js} +0 -0
  514. /package/build/{normalizeLink-8b41f1c2.js → normalizeLink-ad96df83.js} +0 -0
  515. /package/build/{number-af95ab59.js → number-19607670.js} +0 -0
  516. /package/build/{other-bff0cdfb.js → other-21a7da43.js} +0 -0
  517. /package/build/{paths-8b748863.js → paths-fcd6b2b0.js} +0 -0
  518. /package/build/{translationsContext-413fe085.js → translationsContext-57f66cea.js} +0 -0
  519. /package/build/{tslib.es6-04a10581.js → tslib.es6-6b1cfb74.js} +0 -0
  520. /package/build/{types-bddff908.js → types-79fb2f7f.js} +0 -0
  521. /package/build/{useIsInit-4b8ffdb6.js → useIsInit-d50d9183.js} +0 -0
  522. /package/build/{useOutsideClick-759d5b83.js → useOutsideClick-93512d0b.js} +0 -0
  523. /package/build/{useScrollbarSize-9a182d81.js → useScrollbarSize-137f544b.js} +0 -0
  524. /package/build/{useUniqueId-373f702e.js → useUniqueId-2b3757d6.js} +0 -0
  525. /package/build/{utils-32810910.js → utils-3477b358.js} +0 -0
package/build/esm/lead.js CHANGED
@@ -1,44 +1,44 @@
1
- import { _ as __rest, a as __awaiter } from './tslib.es6-3b3bf6ee.js';
2
- import React__default, { createContext, useMemo, useEffect, useRef, useState, useContext, forwardRef, useCallback, useImperativeHandle, memo } from 'react';
3
- import { createStyles, Box, Input as Input$1, clsx, Autocomplete, Checkbox as Checkbox$1, Radio as Radio$1, Select as Select$1, TextInput, NumberInput as NumberInput$1, Button as Button$2, Portal, Transition, Overlay } from '@mantine/core';
1
+ import { _ as __rest, a as __awaiter } from './tslib.es6-ec147d4e.js';
2
+ import React__default, { createContext, useMemo, useEffect, useRef, useState, useContext, useCallback } from 'react';
3
+ import { createStyles, Box, Button as Button$2, Autocomplete, clsx, Input as Input$1, TextInput, NumberInput as NumberInput$1, Portal, Transition, Overlay } from '@mantine/core';
4
4
  import dayjs from 'dayjs';
5
5
  import debounce from 'lodash/debounce';
6
- import { createFormContext, useForm } from '@mantine/form';
7
- import { u as useTranslations } from './index-ed4991de.js';
8
- import { T as TranslationsContext } from './translationsContext-eadc2f8c.js';
6
+ import { createFormContext } from '@mantine/form';
7
+ import { u as useTranslations } from './index-66b3f2a6.js';
8
+ import { T as TranslationsContext } from './translationsContext-d7e74248.js';
9
9
  import { getCookie, setCookie } from './miscCookieHelper.js';
10
- import { b as getWrapperDomWithSelector, a as getPopupWrapperDom } from './utils-0499e7df.js';
11
- import { T as Text } from './index-8cbad76d.js';
12
- import { S as Select, d as Checkbox, I as Input, R as Radio, P as Phone, N as NumberInput, O as OTP } from './index-a043265d.js';
13
- import { D as DatePicker } from './index-021da3d3.js';
14
- import { M as MAPPED_LOCALE } from './utils-55b98af6.js';
15
- import { DateInput } from '@mantine/dates';
16
- import { Z as ZINDEX_SSO } from './index-1de1575d.js';
17
- import './index-e8c7d06c.js';
18
- import './index-3f5277e4.js';
19
- import './useMantineLocale-61a713dc.js';
20
- import { B as Button$1 } from './index-5130c494.js';
21
- import './index.styles-7e8e723e.js';
10
+ import { b as getWrapperDomWithSelector, a as getPopupWrapperDom } from './utils-cd21d010.js';
11
+ import { T as Text } from './index-53d47678.js';
12
+ import { S as Select, d as Checkbox, I as Input, R as Radio, P as Phone, N as NumberInput, O as OTP } from './index-edb08ee4.js';
13
+ import { D as DatePicker } from './index-a4b4cee3.js';
14
+ import { M as MAPPED_LOCALE } from './utils-a3b9d7d0.js';
15
+ import '@mantine/dates';
16
+ import { Z as ZINDEX_SSO } from './index-11d5337e.js';
17
+ import './index-cc86d927.js';
18
+ import './index-179f52e7.js';
19
+ import './useMantineLocale-5d6ca417.js';
20
+ import { B as Button$1 } from './index-bd572333.js';
21
+ import './index.styles-6c3c23d3.js';
22
22
  import { useClickOutside } from '@mantine/hooks';
23
- import './other-3c2c2888.js';
24
- import './index-afa718a7.js';
25
- import { u as usePlacesAutocomplete, G as GOOGLE_API_KEY } from './usePlacesAutocomplete-b79b68b2.js';
26
- import { B as Button } from './index-4b210adb.js';
27
- import { H as Heading$1 } from './index-17b7c39c.js';
28
- import styled from '@emotion/styled';
23
+ import './other-acddb230.js';
24
+ import './index-16e4de05.js';
25
+ import { u as usePlacesAutocomplete, G as GOOGLE_API_KEY } from './usePlacesAutocomplete-18305867.js';
26
+ import { B as Button } from './index-7c8f3b35.js';
27
+ import { H as Heading$1 } from './index-84607991.js';
29
28
  import { v1 } from 'uuid';
29
+ import { i as isVideo } from './index-d03a12b1.js';
30
+ import { D as DrawerComponent } from './index-4298b53e.js';
31
+ import { u as useScreenSize } from './useScreenSize-02f86d84.js';
32
+ import { createPortal } from 'react-dom';
30
33
  import { css } from '@emotion/react';
34
+ import styled from '@emotion/styled';
31
35
  import { theme } from './miscTheme.js';
32
- import { i as isVideo } from './index-02c8be33.js';
33
- import { D as DrawerComponent } from './index-58bb5f33.js';
34
- import { u as useScreenSize } from './useScreenSize-0a846318.js';
35
- import { createPortal } from 'react-dom';
36
- import { C as Close } from './Close-dfe80a9c.js';
36
+ import { C as Close } from './Close-bf351f60.js';
37
37
  import '@hhgtech/icons/other';
38
38
  import '@mantine/carousel';
39
- import './Locale-0fe839f4.js';
39
+ import './Locale-559226db.js';
40
40
  import 'classnames';
41
- import './useUniqueId-4f87763e.js';
41
+ import './useUniqueId-629ceab2.js';
42
42
  import './constantsSite.js';
43
43
  import '@hhgtech/icons/core';
44
44
  import 'date-fns/locale';
@@ -72,7 +72,7 @@ if (sessionStorage.getItem('insider_object')) {
72
72
  }
73
73
  const docLang = document.documentElement.lang;
74
74
  // TODO: country code
75
- const LEAD_LOCALE_DATA$1 = {
75
+ const LEAD_LOCALE_DATA = {
76
76
  'vi-VN': {
77
77
  popupLang: 'vi',
78
78
  countryCode: 'vn',
@@ -114,7 +114,7 @@ const LEAD_LOCALE_DATA$1 = {
114
114
  countryCodeNumber: 91,
115
115
  },
116
116
  };
117
- const LEAD_LOCALE = LEAD_LOCALE_DATA$1[docLang] || LEAD_LOCALE_DATA$1['vi-VN'];
117
+ const LEAD_LOCALE = LEAD_LOCALE_DATA[docLang] || LEAD_LOCALE_DATA['vi-VN'];
118
118
  function LEAD_RESET_VAR() {
119
119
  // LEAD_CURRENT_URL = location.href.toLowerCase();
120
120
  LEAD_CURRENT_URL =
@@ -135,11 +135,6 @@ const LEAD_TIMEZONE_DATA = {
135
135
  9: 'Asia/Manila', // Philippines / Filipinos Site
136
136
  };
137
137
 
138
- const LEADGEN_ACTIONS = {
139
- SHOW: 'SHOW',
140
- SCROLL: 'SCROLL',
141
- TIME: 'TIME',
142
- };
143
138
  const LEADGEN_LAYOUT = {
144
139
  LightBoxA: 'LightBoxA',
145
140
  LightBoxB: 'LightBoxB',
@@ -169,10 +164,8 @@ const LEADGEN_BLOCK = {
169
164
  DropdownBlock: 'DropdownBlock',
170
165
  CheckboxBlock: 'CheckboxBlock',
171
166
  TncBlock: 'TncBlock',
172
- TitleBlock: 'TitleBlock',
173
- SubtitleBlock: 'SubtitleBlock',
174
167
  };
175
- const LEADGEN_BLOCK_INPUT = [
168
+ const LEADGEN_BLOCK_IN_FORM = [
176
169
  LEADGEN_BLOCK.TextBlock,
177
170
  LEADGEN_BLOCK.NumberBlock,
178
171
  LEADGEN_BLOCK.DateBlock,
@@ -188,48 +181,6 @@ const LEADGEN_BLOCK_INPUT = [
188
181
  LEADGEN_BLOCK.TncBlock,
189
182
  ];
190
183
  const SSO_MAP_LEAD = ['name', 'email', 'birthday', 'phone', 'gender'];
191
- const LEAD_LOCALE_DATA = {
192
- 'vi-VN': {
193
- popupLang: 'vi',
194
- countryCode: 'vn',
195
- countryCodeNumber: 84,
196
- },
197
- 'id-ID': {
198
- popupLang: 'id',
199
- countryCode: 'id',
200
- countryCodeNumber: 62,
201
- },
202
- 'th-TH': {
203
- popupLang: 'th',
204
- countryCode: 'th',
205
- countryCodeNumber: 66,
206
- },
207
- 'ms-MY': {
208
- popupLang: 'ms',
209
- countryCode: 'my',
210
- countryCodeNumber: 60,
211
- },
212
- 'zh-TW': {
213
- popupLang: 'zh',
214
- countryCode: 'tw',
215
- countryCodeNumber: 886,
216
- },
217
- 'km-KH': {
218
- popupLang: 'km',
219
- countryCode: 'kh',
220
- countryCodeNumber: 855,
221
- },
222
- 'my-MM': {
223
- popupLang: 'my',
224
- countryCode: 'mm',
225
- countryCodeNumber: 95,
226
- },
227
- 'hi-IN': {
228
- popupLang: 'hi',
229
- countryCode: 'in',
230
- countryCodeNumber: 91,
231
- },
232
- };
233
184
  const mappingSSOToLead = (userInfoProps) => {
234
185
  var _a, _b;
235
186
  try {
@@ -245,7 +196,7 @@ const mappingSSOToLead = (userInfoProps) => {
245
196
  if (ssoKey === 'birthday') {
246
197
  const dob = dayjs(initValue, 'YYYY-MM-DD', true);
247
198
  if (dob.isValid()) {
248
- user.birthday = dob.toDate();
199
+ user.birthday = dob;
249
200
  }
250
201
  }
251
202
  else if (ssoKey === 'gender') {
@@ -268,46 +219,6 @@ const mappingSSOToLead = (userInfoProps) => {
268
219
  catch (error) {
269
220
  return;
270
221
  }
271
- };
272
- const formatCampaignDetail = (campaign) => {
273
- if (!campaign) {
274
- return {};
275
- }
276
- try {
277
- const { extra_fields, thank_you_image } = campaign || {};
278
- const { textBlocks: exTextBlocks, imageBlocks: exImageBlocks, listBlockAdded: exListBlockAdded, listBlockThankyou: exListBlockThankyou, actionBlocks: exActionBlocks, } = extra_fields;
279
- const textBlocks = JSON.parse(exTextBlocks);
280
- const imageBlocks = JSON.parse(exImageBlocks);
281
- const listBlockAdded = JSON.parse(exListBlockAdded);
282
- const listBlockThankyou = JSON.parse(exListBlockThankyou);
283
- const actionBlocks = JSON.parse(exActionBlocks);
284
- const ThankYouBlock = {
285
- image: { src: thank_you_image },
286
- };
287
- listBlockThankyou.forEach((block) => {
288
- const { name, data } = block || {};
289
- const { value: htmlText, align, newtab, url } = data || {};
290
- switch (name) {
291
- case LEADGEN_BLOCK.TitleBlock: {
292
- ThankYouBlock.title = { htmlText, align };
293
- }
294
- case LEADGEN_BLOCK.SubtitleBlock: {
295
- ThankYouBlock.description = { htmlText, align };
296
- }
297
- case LEADGEN_BLOCK.LinkButtonBlock: {
298
- ThankYouBlock.button = { htmlText, newtab, url };
299
- }
300
- }
301
- });
302
- return Object.assign(Object.assign({}, campaign), { extra_fields: Object.assign(Object.assign({}, extra_fields), { textBlocks,
303
- imageBlocks,
304
- listBlockAdded,
305
- listBlockThankyou,
306
- actionBlocks }), ThankYouBlock });
307
- }
308
- catch (error) {
309
- return {};
310
- }
311
222
  };
312
223
 
313
224
  class Store {
@@ -318,13 +229,6 @@ class Store {
318
229
  }
319
230
  const leadStore = new Store();
320
231
 
321
- const LEADGEN_API_METHOD = {
322
- GET: 'get',
323
- POST: 'POST',
324
- };
325
- const LEADGEN_API_PATH = {
326
- V2_CAMPAIGN: 'api/v2/campaign',
327
- };
328
232
  const leadApi = {
329
233
  call(_a) {
330
234
  var { url, data = undefined } = _a, config = __rest(_a, ["url", "data"]);
@@ -428,39 +332,8 @@ const verifyOtpLead = ({ phone, otp, type, }) => {
428
332
  },
429
333
  });
430
334
  };
431
- const campaignGetByCode = (campaign_code) => {
432
- return leadApi.call({
433
- url: `${LEADGEN_API_PATH.V2_CAMPAIGN}/${campaign_code}`,
434
- method: LEADGEN_API_METHOD.GET,
435
- });
436
- };
437
- const campaignPostLead = ({ data }) => {
438
- return leadApi.call({
439
- url: 'api/v2/subscription-box',
440
- method: LEADGEN_API_METHOD.POST,
441
- data,
442
- });
443
- };
444
- const campaignPostImpression = ({ code, action, title_article, ga_client_id, cookie_id, extra, url, referrer, }) => {
445
- return leadApi.call({
446
- url: `api/campaign/${code}/impression`,
447
- method: LEADGEN_API_METHOD.POST,
448
- data: {
449
- action,
450
- title_article,
451
- cookie_id,
452
- ga_client_id,
453
- url,
454
- extra,
455
- referrer,
456
- },
457
- });
458
- };
459
335
  const Service = {
460
336
  campaignGetById,
461
- campaignGetByCode,
462
- campaignPostLead,
463
- campaignPostImpression,
464
337
  validateEmailOrPhoneOnSubot,
465
338
  validateEmailOrPhoneOnLeadGen,
466
339
  validatePhoneNumberOnLeadGen,
@@ -1462,1065 +1335,66 @@ const getTranslations = (locale) => {
1462
1335
 
1463
1336
  const LeadGenContext = createContext({});
1464
1337
 
1465
- const LeadGenSubscriptionBoxContext = createContext({});
1466
- const LeadGenSubscriptionBoxProvider = (props) => {
1467
- const { campaign_code, apiUrl: apiUrlProps, apiSubotUrl, locale, forceCampaign: forceCampaignProps, children, } = props;
1468
- const [forceCampaign, setForceCampaign] = useState(forceCampaignProps);
1469
- const leadGenSubscriptionBoxValue = useMemo(() => (Object.assign(Object.assign({}, props), { forceCampaign })), [campaign_code, locale, forceCampaign]);
1470
- const translationContextValue = { locale, values: getTranslations(locale) };
1338
+ const useImageSize = (src) => {
1339
+ const [width, setWidth] = useState(16);
1340
+ const [height, setHeight] = useState(9);
1341
+ const [loaded, setLoaded] = useState(false);
1342
+ // load src image to get its width and height
1471
1343
  useEffect(() => {
1472
- if (forceCampaignProps) {
1473
- setForceCampaign(forceCampaignProps);
1474
- return;
1475
- }
1476
- if (campaign_code) {
1477
- Service.campaignGetByCode(campaign_code).then((res) => {
1478
- const { _data } = res || {};
1479
- const { campaigns } = _data || {};
1480
- setForceCampaign(formatCampaignDetail(campaigns));
1344
+ setLoaded(false);
1345
+ if (src) {
1346
+ const img = new Image();
1347
+ img.addEventListener('load', () => {
1348
+ setWidth(img.naturalWidth);
1349
+ setHeight(img.naturalHeight);
1350
+ setLoaded(true);
1351
+ });
1352
+ img.addEventListener('error', () => {
1353
+ setWidth(16);
1354
+ setHeight(9);
1355
+ setLoaded(true);
1481
1356
  });
1357
+ img.src = src;
1482
1358
  }
1483
- }, [campaign_code]);
1484
- useEffect(() => {
1485
- leadStore.apiLeadUrl = apiUrlProps;
1486
- leadStore.apiSubotUrl = apiSubotUrl;
1487
- return () => {
1488
- setForceCampaign(null);
1489
- };
1490
- }, []);
1491
- if (!forceCampaign || !(forceCampaign === null || forceCampaign === void 0 ? void 0 : forceCampaign.id)) {
1359
+ else {
1360
+ setWidth(16);
1361
+ setHeight(9);
1362
+ setLoaded(true);
1363
+ }
1364
+ }, [src]);
1365
+ return {
1366
+ loaded,
1367
+ width,
1368
+ height,
1369
+ };
1370
+ };
1371
+
1372
+ const CloseButton = ({ onClose, containerClassName, svgClassName, }) => (React__default.createElement("button", { onClick: onClose, className: `le-newbuilder-close-button js-modal__close ${containerClassName || ''}` },
1373
+ React__default.createElement("svg", { width: "1em", height: "1em", viewBox: "0 0 20 20", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", className: svgClassName },
1374
+ React__default.createElement("path", { d: "M9.99981 10.8432L14.0583 14.9017C14.1691 15.0125 14.3083 15.0691 14.476 15.0717C14.6437 15.0743 14.7854 15.0176 14.9013 14.9017C15.0172 14.7858 15.0752 14.6453 15.0752 14.4802C15.0752 14.3151 15.0172 14.1746 14.9013 14.0587L10.8429 10.0002L14.9013 5.9417C15.0121 5.83094 15.0688 5.69172 15.0713 5.52402C15.0739 5.35634 15.0172 5.21456 14.9013 5.09866C14.7854 4.98276 14.6449 4.9248 14.4798 4.9248C14.3147 4.9248 14.1742 4.98276 14.0583 5.09866L9.99981 9.15712L5.94133 5.09866C5.83057 4.98789 5.69135 4.93122 5.52365 4.92866C5.35598 4.92609 5.21419 4.98276 5.09829 5.09866C4.98239 5.21456 4.92444 5.35506 4.92444 5.52018C4.92444 5.6853 4.98239 5.82581 5.09829 5.9417L9.15675 10.0002L5.09829 14.0587C4.98752 14.1694 4.93085 14.3087 4.9283 14.4763C4.92572 14.644 4.98239 14.7858 5.09829 14.9017C5.21419 15.0176 5.3547 15.0756 5.51982 15.0756C5.68493 15.0756 5.82544 15.0176 5.94133 14.9017L9.99981 10.8432Z" }))));
1375
+
1376
+ // url: imageBlocks.imageMobile.data.url
1377
+ // newTab: imageBlocks.imageMobile.data.newtab
1378
+ // imageMobile: campaignShow.image
1379
+ // imageDestkop: campaignShow.image_desktop
1380
+ const CenterTabLayout = ({ popupId, url, newTab, imageDestkop, imageMobile, onClose, onOtherSubmit, }) => {
1381
+ const { width: imageMobileWidth, height: imageMobileHeight, loaded: imageMobileLoaded, } = useImageSize(imageMobile);
1382
+ const { width: imageDestkopWidth, height: imageDestkopHeight, loaded: imageDestkopLoaded, } = useImageSize(imageDestkop);
1383
+ if (!imageMobileLoaded || !imageDestkopLoaded)
1492
1384
  return null;
1493
- }
1494
- return (React__default.createElement(LeadGenSubscriptionBoxContext.Provider, { value: leadGenSubscriptionBoxValue },
1495
- React__default.createElement(TranslationsContext.Provider, { value: translationContextValue }, children)));
1496
- };
1497
-
1498
- // You can give context variables any name
1499
- const [LeadFormProvider, useLeadFormContext, useLeadForm] = createFormContext();
1500
- const useLeadFormConfig = ({ listBlockAdded = [], validatingPhoneRef, validatingEmailRef, campaignId, campaign_subot_id = [], userInfo, }) => {
1501
- var _a;
1502
- const { t } = useTranslations();
1503
- const initialValues = useMemo(() => mappingSSOToLead(userInfo), [userInfo === null || userInfo === void 0 ? void 0 : userInfo.id]);
1504
- const LEAD_LOCALE = LEAD_LOCALE_DATA[(_a = document === null || document === void 0 ? void 0 : document.documentElement) === null || _a === void 0 ? void 0 : _a.lang] ||
1505
- LEAD_LOCALE_DATA['vi-VN'];
1506
- const validateObj = useMemo(() => {
1507
- const InputBlocks = [
1508
- 'TextBlock',
1509
- 'NumberBlock',
1510
- 'EmailBlock',
1511
- 'PhoneBlock',
1512
- 'DateBlock',
1513
- 'CheckboxBlock',
1514
- 'RadioBlock',
1515
- 'DropdownBlock',
1516
- 'PhoneOtpBlock',
1517
- 'WhatsappOtpBlock',
1518
- 'ZaloOtpBlock',
1519
- 'LocationBlock',
1520
- 'TncBlock',
1521
- ];
1522
- // ALL are required and can skip if not touched yet
1523
- const withSharedCheck = (name, cb,
1524
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1525
- block) => {
1526
- return (value) => {
1527
- var _a;
1528
- const isBLockRequired = (_a = block === null || block === void 0 ? void 0 : block.data) === null || _a === void 0 ? void 0 : _a.required;
1529
- if (!formRef.current.isTouched(name))
1530
- return;
1531
- if ((typeof value === 'string' && value.replace(' ', '') === '') ||
1532
- typeof value === 'undefined' ||
1533
- value === '' ||
1534
- (Array.isArray(value) && value.length === 0)) {
1535
- return isBLockRequired
1536
- ? t('validator.required')
1537
- : cb === null || cb === void 0 ? void 0 : cb(value);
1538
- }
1539
- return cb === null || cb === void 0 ? void 0 : cb(value);
1540
- };
1541
- };
1542
- return listBlockAdded
1543
- .filter((b) => InputBlocks.includes(b.name))
1544
- .reduce((r, b) => {
1545
- var _a;
1546
- const isRequired = (_a = b.data.required) !== null && _a !== void 0 ? _a : true;
1547
- if (b.name === 'NumberBlock') {
1548
- return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, (value) => {
1549
- if (value && isNaN(Number(value))) {
1550
- return t('validator.number');
1551
- }
1552
- }, b) });
1553
- }
1554
- else if (b.name === 'EmailBlock') {
1555
- return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, (value) => {
1556
- if (value && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value)) {
1557
- return t('validator.email');
1558
- }
1559
- if (!value)
1560
- return;
1561
- validatingEmailRef.current = true;
1562
- setTimeout(() => {
1563
- formRef.current.setFieldError(b.data.value, 'Validating...');
1564
- checkUsedEmailOrPhoneWithCache(campaignId, campaign_subot_id, {
1565
- email: value,
1566
- })
1567
- .then((tKey) => {
1568
- if (tKey) {
1569
- formRef.current.setFieldError(b.data.value, t(tKey));
1570
- }
1571
- else {
1572
- formRef.current.clearFieldError(b.data.value);
1573
- }
1574
- validatingEmailRef.current = false;
1575
- })
1576
- .catch((e) => {
1577
- console.error(e);
1578
- formRef.current.setFieldError(b.data.value, e.message || 'Something went wrong');
1579
- validatingEmailRef.current = false;
1580
- });
1581
- }, 200);
1582
- }, b) });
1583
- }
1584
- else if (b.name === 'PhoneBlock' ||
1585
- b.name === 'PhoneOtpBlock' ||
1586
- b.name === 'ZaloOtpBlock' ||
1587
- b.name === 'WhatsappOtpBlock') {
1588
- return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, (value) => {
1589
- if (value &&
1590
- window.intlTelInputUtils &&
1591
- !window.intlTelInputUtils.isValidNumber(String(value), LEAD_LOCALE.countryCode)) {
1592
- return t('validator.phone');
1593
- }
1594
- if (!value)
1595
- return;
1596
- validatingPhoneRef.current = true;
1597
- setTimeout(() => {
1598
- formRef.current.setFieldError(b.data.value, 'Validating...');
1599
- if (b.data.singleSubmission) {
1600
- checkUsedPhoneOnlyWithCache(campaignId, value)
1601
- .then((tKey) => {
1602
- if (tKey) {
1603
- formRef.current.setFieldError(b.data.value, t(tKey));
1604
- }
1605
- else {
1606
- formRef.current.clearFieldError(b.data.value);
1607
- }
1608
- validatingPhoneRef.current = false;
1609
- })
1610
- .catch((err) => {
1611
- console.error(err);
1612
- formRef.current.setFieldError(b.data.value, err.message || 'Something went wrong');
1613
- validatingPhoneRef.current = false;
1614
- });
1615
- }
1616
- else {
1617
- checkUsedEmailOrPhoneWithCache(campaignId, campaign_subot_id, {
1618
- phone: value,
1619
- })
1620
- .then((tKey) => {
1621
- if (tKey) {
1622
- formRef.current.setFieldError(b.data.value, t(tKey));
1623
- }
1624
- else {
1625
- formRef.current.clearFieldError(b.data.value);
1626
- }
1627
- validatingPhoneRef.current = false;
1628
- })
1629
- .catch((e) => {
1630
- console.error(e);
1631
- formRef.current.setFieldError(b.data.value, e.message || 'Something went wrong');
1632
- validatingPhoneRef.current = false;
1633
- });
1634
- }
1635
- }, 200);
1636
- }, b) });
1637
- }
1638
- else if (b.name === 'DateBlock') {
1639
- return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, (value) => {
1640
- if (value && isNaN(Date.parse(value))) {
1641
- return t('validator.date');
1642
- }
1643
- }, b) });
1644
- }
1645
- else if (b.name === 'TncBlock') {
1646
- return Object.assign(Object.assign({}, r), { [`TNC-` + b.id]: withSharedCheck('TNC-' + b.id, (value) => {
1647
- if (isRequired && !value) {
1648
- return t('validator.required');
1649
- }
1650
- }, b) });
1651
- }
1652
- else {
1653
- return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, undefined, b) });
1654
- }
1655
- }, {});
1656
- }, [listBlockAdded.map((b) => b.name).join(',')]);
1657
- const form = useLeadForm({
1658
- validateInputOnChange: true,
1659
- clearInputErrorOnChange: true,
1660
- validate: validateObj,
1661
- initialValues,
1662
- });
1663
- const formRef = useRef(form);
1664
- formRef.current = form;
1665
- return { form, validateObj };
1666
- };
1667
-
1668
- const PhoneInput = forwardRef((props, ref) => {
1669
- const { defaultCountry, id: idProps, name, placeholder, label, labelElement, labelProps, description, descriptionProps, withAsterisk, inputMode, inputContainer, inputWrapperOrder, error, className, classNames, style, styles } = props, restProps = __rest(props, ["defaultCountry", "id", "name", "placeholder", "label", "labelElement", "labelProps", "description", "descriptionProps", "withAsterisk", "inputMode", "inputContainer", "inputWrapperOrder", "error", "className", "classNames", "style", "styles"]);
1670
- const id = idProps || v1() + name;
1671
- return (React__default.createElement(Input$1.Wrapper, { size: "md", label: label, labelElement: labelElement, labelProps: Object.assign({ htmlFor: id }, labelProps), description: description, descriptionProps: descriptionProps, withAsterisk: withAsterisk, inputMode: inputMode, inputContainer: inputContainer, inputWrapperOrder: inputWrapperOrder, error: error, "data-invalid": !!error, className: className, classNames: classNames, style: style, styles: styles },
1672
- React__default.createElement("div", { className: "mantine-Input-wrapper" },
1673
- React__default.createElement(Phone, Object.assign({}, restProps, { id: id, ref: ref, name: name, spellCheck: false, placeholder: placeholder, defaultCountry: defaultCountry, className: "mantine-Input-input", type: "tel", "data-control": "tel" })))));
1674
- });
1675
-
1676
- const StyledLeadGenFormInner = styled.div `
1677
- display: flex;
1678
- flex-wrap: wrap;
1679
- gap: 8px;
1680
- .leadgen-form_input {
1681
- width: calc(50% - 4px);
1682
- }
1683
-
1684
- .leadgen-form_input_checkbox {
1685
- width: 100%;
1686
- }
1687
- `;
1688
-
1689
- const cssInputNotShrink$1 = css `
1690
- height: 100% !important;
1691
- min-height: calc(var(--container-height, 56px) * 22 / 56);
1692
- color: ${theme.colors.gray800};
1693
- font-size: var(--input, 16px);
1694
- line-height: calc(var(--container-height, 56px) * 22 / 56);
1695
- border: none !important;
1696
- border-radius: 0 !important;
1697
- outline: none !important;
1698
- box-shadow: none !important;
1699
- padding: 0;
1700
- cursor: pointer;
1701
- opacity: 0;
1702
-
1703
- ::placeholder {
1704
- color: ${theme.colors.gray400};
1705
- }
1706
- `;
1707
- const cssInputShrink$1 = css `
1708
- height: auto !important;
1709
- cursor: text;
1710
- opacity: 1;
1711
- transition: 0.1s ease-in-out all;
1712
- `;
1713
- const cssLabelNotShrink$1 = css `
1714
- position: absolute;
1715
- top: calc(var(--container-height) / 2);
1716
- left: var(--space-x, 16px);
1717
- color: ${theme.colors.gray400};
1718
- font-size: var(--label-not-shrink, 16px);
1719
- font-weight: 400;
1720
- line-height: calc(var(--container-height, 56px) * 18 / 56);
1721
- margin: 0;
1722
- z-index: 1;
1723
- cursor: pointer;
1724
- transform: translateY(-50%);
1725
- transition: 0.125s ease-in all;
1726
- `;
1727
- const cssLabelShrink$1 = css `
1728
- color: ${theme.colors.gray600};
1729
- font-weight: 600;
1730
- font-size: var(--label-shrink, 12px);
1731
- top: calc(var(--container-height) * 7 / 56);
1732
- transform: none;
1733
- transition: 0.125s ease-out all;
1734
- `;
1735
- const cssWrapperInputNotShrink$1 = css `
1736
- min-height: var(--container-height, 56px);
1737
- display: flex;
1738
- align-items: flex-end;
1739
- border: 1px solid ${theme.colors.gray200};
1740
- border-radius: 8px;
1741
- background-color: #fff;
1742
- padding-inline: var(--space-x, 16px);
1743
- padding-block: var(--space-y-not-shrink, 16px);
1744
- cursor: pointer;
1745
- pointer-events: none;
1746
-
1747
- &:has(.mantine-Input-rightSection) {
1748
- padding-right: var(--container-height, 56px);
1749
- }
1750
-
1751
- .mantine-Input-icon {
1752
- display: none;
1753
- }
1754
-
1755
- .mantine-NumberInput-control {
1756
- border-color: ${theme.colors.gray200};
1757
- }
1758
- `;
1759
- const cssWrapperInputShrink$1 = css `
1760
- height: auto;
1761
- min-height: var(--container-height, 56px);
1762
- padding-block: var(--space-y-shrink, 7px);
1763
- cursor: text;
1764
- pointer-events: auto;
1765
- `;
1766
- const cssInputWrapperError$1 = css `
1767
- color: ${theme.colors.red800};
1768
- font-size: 12px;
1769
- line-height: 1.5;
1770
- `;
1771
- const StyledTextFieldContainer$1 = styled.div `
1772
- --space-x: 16px;
1773
- --space-y-not-shrink: 16px;
1774
- --space-y-shrink: 7px;
1775
- --container-height: 56px;
1776
- --label-not-shrink: 16px;
1777
- --label-shrink: 12px;
1778
- --input: 16px;
1779
-
1780
- position: relative;
1781
- min-width: 100px;
1782
- max-width: 100%;
1783
- display: inline-block;
1784
-
1785
- .textField_wrapper {
1786
- display: inline-block;
1787
- width: 100%;
1788
- cursor: pointer;
1789
- }
1790
-
1791
- .mantine-InputWrapper-root {
1792
- &[data-invalid='true'] {
1793
- .mantine-Input-wrapper {
1794
- border-color: ${theme.colors.red400};
1795
- }
1796
- }
1797
-
1798
- .mantine-Input-wrapper {
1799
- &:has([data-invalid]) {
1800
- border-color: ${theme.colors.red400};
1801
- }
1802
- }
1803
- }
1804
-
1805
- .mantine-InputWrapper-label {
1806
- ${cssLabelNotShrink$1}
1807
- }
1808
-
1809
- .mantine-Input-wrapper {
1810
- ${cssWrapperInputNotShrink$1}
1811
-
1812
- + .mantine-Popover-dropdown[data-position="bottom-start"] {
1813
- left: 0 !important;
1814
- }
1815
- + .mantine-Popover-dropdown[data-position='top-start'] {
1816
- top: unset !important;
1817
- left: 0 !important;
1818
- bottom: 100% !important;
1819
- }
1820
- }
1821
-
1822
- .mantine-Input-input {
1823
- ${cssInputNotShrink$1}
1824
- }
1825
-
1826
- &.textField_shrink,
1827
- &:focus-within {
1828
- .mantine-InputWrapper-label {
1829
- ${cssLabelShrink$1}
1830
- }
1831
-
1832
- .mantine-Input-wrapper {
1833
- ${cssWrapperInputShrink$1}
1834
- &.mantine-Select-wrapper {
1835
- .mantine-Select-rightSection {
1836
- pointer-events: auto !important;
1837
- }
1838
- }
1839
- }
1840
-
1841
- .mantine-Input-input {
1842
- ${cssInputShrink$1}
1843
- }
1844
-
1845
- &:has(.PhoneInput) {
1846
- .mantine-InputWrapper-label {
1847
- left: var(--space-x, 16px);
1848
- }
1849
- .PhoneInput {
1850
- .PhoneInputInput {
1851
- opacity: 1;
1852
- }
1853
- }
1854
- }
1855
- }
1856
-
1857
- .PhoneInput {
1858
- --phone-select: 75px;
1859
- --phone-input-space-x: 8px;
1860
- width: 100%;
1861
- opacity: 1;
1862
- border: none;
1863
- .PhoneInputCountry {
1864
- background-color: transparent;
1865
- border: none;
1866
- padding: 0;
1867
- width: var(--phone-select, 75px);
1868
- }
1869
- .PhoneInputInput {
1870
- flex: 1;
1871
- min-width: 0;
1872
- line-height: 1.5;
1873
- outline: none !important;
1874
- border: none;
1875
- box-shadow: none;
1876
- padding: 0 var(--phone-input-space-x, 8px);
1877
- opacity: 0;
1878
- color: ${theme.colors.gray800} !important;
1879
- :focus {
1880
- color: ${theme.colors.gray800} !important;
1881
- }
1882
- }
1883
- }
1884
-
1885
- &:has(.PhoneInput) {
1886
- .mantine-InputWrapper-label {
1887
- left: calc(
1888
- var(--space-x, 16px) + var(--phone-select, 75px) +
1889
- var(--phone-input-space-x, 8px)
1890
- );
1891
- }
1892
- }
1893
- `;
1894
- const StyledChoiceFieldContainer$1 = styled.div `
1895
- &.leadgen-form_checkbox,
1896
- &.leadgen-form_radio {
1897
- width: 100%;
1898
- }
1899
-
1900
- &.leadgen-form_dropdown {
1901
- width: calc(50% - 12px);
1902
- }
1903
-
1904
- .mantine-InputWrapper-root {
1905
- display: block;
1906
- }
1907
-
1908
- .mantine-InputWrapper-label {
1909
- margin-bottom: 0.5rem;
1910
- color: ${theme.colors.gray800};
1911
- font-size: 16px;
1912
- font-weight: 400;
1913
- line-height: 1.5;
1914
- }
1915
-
1916
- .mantine-Radio-root,
1917
- .mantine-Checkbox-root {
1918
- gap: 8px;
1919
- min-width: calc(50% - 4px);
1920
-
1921
- input[type='radio'],
1922
- input[type='checkbox'] {
1923
- border-color: ${theme.colors.gray600};
1924
- width: 18px;
1925
- height: 18px;
1926
- }
1927
- input[type='checkbox'] {
1928
- border-radius: 4px;
1929
- }
1930
-
1931
- &[data-checked='true'] {
1932
- input[type='radio'],
1933
- input[type='checkbox'] {
1934
- border-color: ${theme.colors.primary600};
1935
- + svg {
1936
- color: ${theme.colors.primary600};
1937
- }
1938
- }
1939
-
1940
- input[type='radio'] {
1941
- background-color: white;
1942
- }
1943
- }
1944
-
1945
- .mantine-Checkbox-input {
1946
- &:checked {
1947
- border-color: ${theme.colors.primary600};
1948
- }
1949
- }
1950
- }
1951
-
1952
- .mantine-Radio-inner,
1953
- .mantine-Checkbox-inner {
1954
- width: 24px;
1955
- height: 24px;
1956
- display: flex;
1957
- align-items: center;
1958
- justify-content: center;
1959
- }
1960
-
1961
- .mantine-Radio-body,
1962
- .mantine-Checkbox-body {
1963
- display: flex;
1964
- align-items: center;
1965
- }
1966
-
1967
- .mantine-Radio-label,
1968
- .mantine-Checkbox-label {
1969
- padding-left: 8px;
1970
- color: ${theme.colors.gray800};
1971
- font-size: 14px;
1972
- line-height: 1.4;
1973
- letter-spacing: -0.2px;
1974
- }
1975
-
1976
- .leadgen-choiceContainer {
1977
- display: flex;
1978
- flex-wrap: wrap;
1979
- align-items: flex-start;
1980
- gap: 8px;
1981
- }
1982
-
1983
- .mantine-InputWrapper-error {
1984
- ${cssInputWrapperError$1}
1985
- }
1986
- `;
1987
-
1988
- const TextField$1 = (props) => {
1989
- const { shrink: shrinkProps, onChangeShrink, className, children } = props, restProps = __rest(props, ["shrink", "onChangeShrink", "className", "children"]);
1990
- const containerRef = useClickOutside(() => {
1991
- if (shrinkProps) {
1992
- return;
1993
- }
1994
- setShrink(false);
1995
- onChangeShrink === null || onChangeShrink === void 0 ? void 0 : onChangeShrink(false);
1996
- });
1997
- const [shrink, setShrink] = useState(shrinkProps);
1998
- const onClick = useCallback((e) => {
1999
- setShrink(true);
2000
- onChangeShrink === null || onChangeShrink === void 0 ? void 0 : onChangeShrink(true);
2001
- if (shrink) {
2002
- return;
2003
- }
2004
- const $textEl = e.currentTarget.querySelectorAll('input:not([disabled]):not([type="submit"]),select:not([disabled]),textarea:not([disabled])');
2005
- const $focusEl = $textEl.item($textEl.length - 1);
2006
- if ($focusEl) {
2007
- $focusEl.focus();
2008
- setTimeout(() => {
2009
- $focusEl.scrollIntoView({
2010
- behavior: 'auto',
2011
- block: 'center',
2012
- inline: 'start',
2013
- });
2014
- }, 100);
2015
- }
2016
- }, [shrink]);
2017
- useEffect(() => {
2018
- setShrink(shrinkProps);
2019
- }, [shrinkProps]);
2020
- return (React__default.createElement(StyledTextFieldContainer$1, Object.assign({ shrink: shrink, className: clsx(className, 'textField', { textField_shrink: !!shrink }) }, restProps),
2021
- React__default.createElement("div", { ref: containerRef, onClick: onClick, className: "textField_wrapper" }, children)));
2022
- };
2023
- const ChoiceField$1 = (props) => {
2024
- const { children, className } = props, restProps = __rest(props, ["children", "className"]);
2025
- return (React__default.createElement(StyledChoiceFieldContainer$1, Object.assign({ className: clsx(className, 'choiceField') }, restProps), children));
2026
- };
2027
-
2028
- const libraries = ['places'];
2029
- const GoogleLocationBlock = (props) => {
2030
- var _a;
2031
- const { inputWrapperOrder = ['label', 'input', 'description', 'error'], defaultValue, value: valueProps, onChange: onChangeProps, locale } = props, restProps = __rest(props, ["inputWrapperOrder", "defaultValue", "value", "onChange", "locale"]);
2032
- const [LoadScript, setLoadScript] = useState(null);
2033
- const [value, setValue] = useState(defaultValue || valueProps);
2034
- const { predictions } = usePlacesAutocomplete(value, '', locale === 'tl-PH' ? 'en' : (_a = locale === null || locale === void 0 ? void 0 : locale.split('-')) === null || _a === void 0 ? void 0 : _a[0]);
2035
- const onChangeAutocomplete = useCallback((s) => {
2036
- setValue(s);
2037
- onChangeProps === null || onChangeProps === void 0 ? void 0 : onChangeProps(s);
2038
- }, []);
2039
- const onClickItem = useCallback((item) => {
2040
- /** For sure get value */
2041
- setValue(item.value);
2042
- const predCur = predictions === null || predictions === void 0 ? void 0 : predictions.find(({ description }) => description === item.value);
2043
- onChangeProps === null || onChangeProps === void 0 ? void 0 : onChangeProps(item.value, predCur === null || predCur === void 0 ? void 0 : predCur.rawData);
2044
- }, [onChangeProps, predictions]);
2045
- useEffect(() => {
2046
- setValue(valueProps);
2047
- }, [valueProps]);
2048
- useEffect(() => {
2049
- var _a, _b, _c;
2050
- // only load extra google script when not yet loaded
2051
- if (!((_c = (_b = (_a = window === null || window === void 0 ? void 0 : window.google) === null || _a === void 0 ? void 0 : _a.maps) === null || _b === void 0 ? void 0 : _b.places) === null || _c === void 0 ? void 0 : _c.AutocompleteService) && !LoadScript) {
2052
- import('@react-google-maps/api').then((m) => {
2053
- setLoadScript(() => m.LoadScript);
2054
- });
2055
- }
2056
- }, []);
2057
- return (React__default.createElement(Autocomplete, Object.assign({ defaultValue: defaultValue, value: value, onChange: onChangeAutocomplete, data: predictions.map((pred) => {
2058
- return { value: pred.description, label: pred.description };
2059
- }), filter: () => true, onItemSubmit: onClickItem, inputWrapperOrder: inputWrapperOrder, zIndex: ZINDEX_SSO - 9e6 + 2, withinPortal: true, styles: { dropdown: { pointerEvents: 'auto' } }, inputContainer: (children) => {
2060
- return (React__default.createElement(React__default.Fragment, null,
2061
- LoadScript && (React__default.createElement(LoadScript, { googleMapsApiKey: GOOGLE_API_KEY, libraries: libraries, loadingElement: React__default.createElement(React__default.Fragment, null), style: { width: '100%' } })),
2062
- children));
2063
- } }, restProps)));
2064
- };
2065
-
2066
- const LEADGEN_ORDER_INPUT_WRAPPER = [
2067
- 'label',
2068
- 'input',
2069
- 'description',
2070
- 'error',
2071
- ];
2072
- const LeadGenForm = forwardRef((props, ref) => {
2073
- const { locale, blocks, scrollToErrorField = true, form: formProps, rules: validate, initialValues, onFinish, onFinishFailed, className, style, } = props;
2074
- const formRef = useRef(null);
2075
- const form = formProps || useForm({ initialValues, validate });
2076
- const middlewareFinish = (values, event) => {
2077
- onFinish === null || onFinish === void 0 ? void 0 : onFinish(values, event);
2078
- };
2079
- const middlewareFinishFailed = (errors, values, events) => {
2080
- if (scrollToErrorField && errors) {
2081
- const firstErrorKey = Object.keys(errors)[0];
2082
- const firstErrorElement = document.querySelector(`[name="${firstErrorKey}"]`);
2083
- if (firstErrorElement && (firstErrorElement === null || firstErrorElement === void 0 ? void 0 : firstErrorElement.focus)) {
2084
- setTimeout(() => {
2085
- firstErrorElement === null || firstErrorElement === void 0 ? void 0 : firstErrorElement.focus();
2086
- firstErrorElement.scrollIntoView({
2087
- behavior: 'auto',
2088
- block: 'center',
2089
- inline: 'center',
2090
- });
2091
- }, 100);
2092
- }
2093
- }
2094
- onFinishFailed === null || onFinishFailed === void 0 ? void 0 : onFinishFailed(errors, values, events);
2095
- };
2096
- useEffect(() => {
2097
- (() => __awaiter(void 0, void 0, void 0, function* () {
2098
- if (!window.intlTelInputUtils) {
2099
- yield require('intl-tel-input/build/js/utils');
2100
- }
2101
- }))();
2102
- }, []);
2103
- useImperativeHandle(ref, () => (Object.assign(Object.assign({}, form), { submit: () => formRef.current.requestSubmit() })), [form, formRef]);
2104
- if (!blocks || !blocks.length) {
2105
- return null;
2106
- }
2107
- return (React__default.createElement("form", { ref: formRef, onSubmit: form.onSubmit(middlewareFinish, middlewareFinishFailed), className: className, style: style },
2108
- React__default.createElement(StyledLeadGenFormInner, { className: "leadgen-form_inputs" }, blocks.map((block, idx) => {
2109
- const { id, name: blockName, data } = block;
2110
- const { placeholder, value: name, required, listQuestion, valueHTML, isSendMailChimp = false, } = data;
2111
- const formInputProps = form.getInputProps(name);
2112
- const { value, error } = formInputProps;
2113
- const reactKey = `${id}-${idx}`;
2114
- switch (blockName) {
2115
- case LEADGEN_BLOCK.TextBlock: {
2116
- return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
2117
- React__default.createElement(TextInput, Object.assign({ name: name, spellCheck: false, withAsterisk: required, label: placeholder, placeholder: placeholder, inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, type: "text", "data-control": "text" }, formInputProps))));
2118
- }
2119
- case LEADGEN_BLOCK.NumberBlock: {
2120
- return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
2121
- React__default.createElement(NumberInput$1, Object.assign({ name: value, spellCheck: false, withAsterisk: required, label: placeholder, placeholder: placeholder, inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, type: "number", "data-control": "number" }, formInputProps))));
2122
- }
2123
- case LEADGEN_BLOCK.EmailBlock: {
2124
- return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
2125
- React__default.createElement(TextInput, Object.assign({ name: name, spellCheck: false, withAsterisk: required, label: placeholder, placeholder: placeholder, inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, "data-control": "email" }, formInputProps))));
2126
- }
2127
- case LEADGEN_BLOCK.PhoneOtpBlock:
2128
- case LEADGEN_BLOCK.WhatsappOtpBlock:
2129
- case LEADGEN_BLOCK.ZaloOtpBlock:
2130
- case LEADGEN_BLOCK.PhoneBlock: {
2131
- return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
2132
- React__default.createElement(PhoneInput, Object.assign({ name: name, spellCheck: false, withAsterisk: required, label: placeholder, placeholder: placeholder, inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, defaultCountry: (locale ? MAPPED_LOCALE[locale] || 'VN' : 'VN'), type: "text", "data-control": "text" }, formInputProps))));
2133
- }
2134
- case LEADGEN_BLOCK.LocationBlock: {
2135
- return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
2136
- React__default.createElement(GoogleLocationBlock, Object.assign({ name: name, withAsterisk: required, label: placeholder, placeholder: placeholder, inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, locale: locale, "data-control": "text" }, formInputProps))));
2137
- }
2138
- case LEADGEN_BLOCK.DateBlock: {
2139
- return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
2140
- React__default.createElement(DateInput, Object.assign({ locale: (MAPPED_LOCALE === null || MAPPED_LOCALE === void 0 ? void 0 : MAPPED_LOCALE[locale]) || MAPPED_LOCALE['vi-VN'], valueFormat: "DD/MM/YYYY", name: name, withAsterisk: required, label: placeholder, placeholder: placeholder, inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, type: "default", "data-control": "date" }, formInputProps))));
2141
- }
2142
- case LEADGEN_BLOCK.DropdownBlock:
2143
- return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
2144
- React__default.createElement("div", { style: { display: 'none' }, "data-extra": true, "data-name": value, "data-control": 'dropdown' }),
2145
- React__default.createElement(Select$1, Object.assign({ name: name, withAsterisk: required, label: placeholder, placeholder: placeholder, data: listQuestion.map((l) => ({
2146
- value: l.value,
2147
- label: l.placeholder,
2148
- })) }, formInputProps))));
2149
- case LEADGEN_BLOCK.CheckboxBlock: {
2150
- const formInputCheckboxProps = form.getInputProps(name, {
2151
- type: 'checkbox',
2152
- });
2153
- return (React__default.createElement(ChoiceField$1, { className: "leadgen-form_input leadgen-form_input_checkbox", key: reactKey },
2154
- isSendMailChimp && (React__default.createElement("div", { style: { display: 'none' }, "data-name": name + '-mailchimp' })),
2155
- React__default.createElement(Checkbox$1.Group, Object.assign({ size: "md", withAsterisk: required, label: placeholder, value: value, sx: {
2156
- display: 'flex',
2157
- flexDirection: 'column',
2158
- flexWrap: 'wrap',
2159
- gap: 8,
2160
- }, inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, inputContainer: (children) => {
2161
- return (React__default.createElement("div", { className: "leadgen-choiceContainer" }, children));
2162
- } }, formInputCheckboxProps), listQuestion.map((l, _idx) => (React__default.createElement(Checkbox$1, { name: name, key: _idx, value: l.value, label: l.placeholder, "data-control": "checkbox" }))))));
2163
- }
2164
- case LEADGEN_BLOCK.RadioBlock: {
2165
- return (React__default.createElement(ChoiceField$1, { className: "leadgen-form_input leadgen-form_input_checkbox", key: reactKey },
2166
- isSendMailChimp && (React__default.createElement("div", { style: { display: 'none' }, "data-name": name + '-mailchimp' })),
2167
- React__default.createElement(Radio$1.Group, Object.assign({ size: "md", withAsterisk: required, label: placeholder, value: value, spellCheck: true, inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, inputContainer: (children) => {
2168
- return (React__default.createElement("div", { className: "leadgen-choiceContainer" }, children));
2169
- } }, formInputProps), listQuestion.map((l, _index) => (React__default.createElement(Radio$1, { name: name, key: _index, value: l.value, label: l.placeholder, "data-control": "radio" }))))));
2170
- }
2171
- case 'TncBlock':
2172
- return (React__default.createElement(ChoiceField$1, { className: "leadgen-form_input leadgen-form_input_checkbox", key: reactKey },
2173
- React__default.createElement(Input$1.Wrapper, { error: error },
2174
- React__default.createElement(Checkbox$1, Object.assign({ value: value, name: 'TNC-' + id, label: React__default.createElement("p", { className: "lead-modal__tnc-link", dangerouslySetInnerHTML: { __html: valueHTML } }), className: "tnc-block", "data-control": "checkbox" }, formInputProps)))));
2175
- default: {
2176
- return null;
2177
- }
2178
- }
2179
- }))));
2180
- });
2181
-
2182
- const StyledLeadGenThankYou = styled.div `
2183
- display: flex;
2184
- gap: 8px;
2185
- flex-direction: column;
2186
- padding-block: 24px;
2187
-
2188
- .leadgen-image {
2189
- width: 120px;
2190
- height: 120px;
2191
- margin-inline: auto;
2192
- object-fit: contain;
2193
- object-position: center;
2194
- text-align: center;
2195
- }
2196
-
2197
- .leadgen-title {
2198
- margin-block: 0;
2199
- color: ${theme.colors.gray900};
2200
- font-weight: 700;
2201
- font-size: 18px;
2202
- line-height: 28px;
2203
- letter-spacing: -0.2px;
2204
- }
2205
-
2206
- .leadgen-description {
2207
- margin-block: 0;
2208
- color: ${theme.colors.gray600};
2209
- font-weight: 400;
2210
- font-size: 14px;
2211
- line-height: 22px;
2212
- letter-spacing: -0.2px;
2213
- text-align: center;
2214
- }
2215
-
2216
- > [data-align] {
2217
- &[data-align='right'] {
2218
- text-align: right;
2219
- }
2220
- &[data-align='center'] {
2221
- text-align: center;
2222
- }
2223
- }
2224
- `;
2225
- const LeadGenThankYou = ({ image, title, description, showButton = false, button, className, style, }) => {
2226
- const { src } = image;
2227
- const { htmlText: titleText, align: titleAlign } = title;
2228
- const { htmlText: descriptionText, align: descriptionAlign } = description;
2229
- const { htmlText: buttonText, newtab, url, onClick } = button;
2230
- return (React__default.createElement(StyledLeadGenThankYou, { className: className, style: style },
2231
- React__default.createElement("img", { src: src, alt: "", className: "leadgen-thankyou_image leadgen-image" }),
2232
- React__default.createElement("p", { className: "leadgen-thankyou_title leadgen-title", "data-align": titleAlign }, titleText),
2233
- React__default.createElement("p", { className: "leadgen-thankyou_description leadgen-description", "data-align": descriptionAlign }, descriptionText),
2234
- !!buttonText && showButton && (React__default.createElement(Button$2, { component: url ? 'a' : 'button', target: newtab ? '_blank' : undefined, href: url, size: "lg", variant: "filled", className: "leadgen-thankyoue_btn leadgen-btn", onClick: onClick }, buttonText))));
2235
- };
2236
-
2237
- const StyledLeadGenSubscriptionBoxBody = styled.div `
2238
- margin-top: 16px;
2239
- .leadgen-btn {
2240
- margin-top: 16px;
2241
- }
2242
- `;
2243
- const StyledLeadGenSubscriptionBoxHeaderImage = styled.div `
2244
- margin-top: 3px;
2245
- margin-right: 20px;
2246
- width: 44px;
2247
- height: 44px;
2248
-
2249
- img {
2250
- width: 100%;
2251
- height: 100%;
2252
- object-fix: contain;
2253
- onject-position: center;
2254
- }
2255
-
2256
- :has(img[src='']) {
2257
- display: none;
2258
- }
2259
- `;
2260
- const StyledLeadGenSubscriptionBoxHeader = styled.div `
2261
- display: flex;
2262
- align-items: center;
2263
- margin-bottom: 16px;
2264
- .leadgen-title {
2265
- margin-bottom: 0;
2266
- flex: 1;
2267
- min-width: 0;
2268
- color: ${theme.colors.gray900};
2269
- font-size: 18px;
2270
- font-weight: 600;
2271
- line-height: 1.4;
2272
- letter-spacing: -0.8px;
2273
- }
2274
- `;
2275
- const StyledLeadGenSubscriptionBox = styled.div `
2276
- padding: 16px;
2277
- border: 1px solid ${theme.colors.neutral100};
2278
- border-radius: 12px;
2279
- margin-inline: auto;
2280
- .leadgen-form_inputs {
2281
- .leadgen-form_input {
2282
- width: 100%;
2283
- }
2284
- }
2285
-
2286
- .leadgen-form_input {
2287
- .mantine-Input-wrapper {
2288
- max-height: 56px;
2289
- }
2290
- }
2291
-
2292
- @media screen and (min-width: 768px) {
2293
- .leadgen-subscription_box_body {
2294
- display: flex;
2295
- > form {
2296
- flex: 1;
2297
- min-width: 0;
2298
-
2299
- .leadgen-form_inputs {
2300
- .leadgen-form_input {
2301
- width: calc(50% - 4px);
2302
- }
2303
- }
2304
- }
2305
-
2306
- .leadgen-btn {
2307
- margin-top: 0;
2308
- margin-left: 8px;
2309
- width: auto;
2310
- min-height: 56px;
2311
- }
2312
- }
2313
- }
2314
- `;
2315
- const LeadGenSubscriptionBoxWithoutMemo = ({ locale, userInfo, siteId, siteDomain, forceCampaign, campaign_code, article_id, subscription_title: subscriptionTitleProps, }) => {
2316
- var _a, _b, _c;
2317
- const refContainer = useRef(null);
2318
- const validatingEmailRef = useRef(false);
2319
- const validatingPhoneRef = useRef(false);
2320
- const { image, extra_fields, id: campaign_id, bot_id: campaign_subot_id = [], ThankYouBlock, } = forceCampaign || {};
2321
- const { textBlocks, listBlockAdded, actionBlocks } = extra_fields || {};
2322
- const { submitBlock } = actionBlocks || {};
2323
- const [loading, setLoading] = useState(false);
2324
- const [showThankyou, setShowThankyou] = useState(false);
2325
- const formRef = useRef(null);
2326
- const { form, validateObj } = useLeadFormConfig({
2327
- listBlockAdded,
2328
- campaignId: campaign_id,
2329
- campaign_subot_id,
2330
- validatingEmailRef,
2331
- validatingPhoneRef,
2332
- userInfo,
2333
- });
2334
- const subscription_title = useMemo(() => { var _a, _b; return subscriptionTitleProps || ((_b = (_a = textBlocks === null || textBlocks === void 0 ? void 0 : textBlocks.titleBlock) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.value); }, [subscriptionTitleProps, (_b = (_a = textBlocks === null || textBlocks === void 0 ? void 0 : textBlocks.titleBlock) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.value]);
2335
- const { image: thankyouImage, title: thankyouTitle, description: thankyouDescription, button: thankyouButton, } = ThankYouBlock || {};
2336
- const { apiUrl } = useMemo(() => {
2337
- let apiUrl = leadStore.apiLeadUrl;
2338
- if (apiUrl.includes('localhost')) {
2339
- apiUrl = 'https://dev.leadgen.hellobacsi.com/';
2340
- }
2341
- return {
2342
- apiUrl,
2343
- };
2344
- }, [siteDomain, siteId]);
2345
- const url = useMemo(() => location.href.toLowerCase() || '', []);
2346
- const article_title = useMemo(() => document.title || '', []);
2347
- const cookie_id = useMemo(() => getCookie('hhg-id') || null, []);
2348
- const ga_client_id = useMemo(() => getCookie('_ga') || null, []);
2349
- const leadgenImpression = useCallback(() => {
2350
- Service.campaignPostImpression({
2351
- url,
2352
- action: LEADGEN_ACTIONS.SCROLL,
2353
- code: campaign_code,
2354
- title_article: article_title,
2355
- cookie_id,
2356
- ga_client_id,
2357
- extra: { cookie_id, article_id, subscription_title },
2358
- });
2359
- }, [
2360
- article_id,
2361
- article_title,
2362
- cookie_id,
2363
- ga_client_id,
2364
- campaign_code,
2365
- subscription_title,
2366
- ]);
2367
- const intersectionObserverCallback = useCallback((entries) => {
2368
- entries.forEach((entry) => {
2369
- const { isIntersecting, target } = entry;
2370
- if (isIntersecting && target === refContainer.current) {
2371
- leadgenImpression();
2372
- }
2373
- });
2374
- }, [leadgenImpression]);
2375
- const IObserver = new IntersectionObserver(intersectionObserverCallback);
2376
- const middlewareOnSubmit = useCallback((value) => __awaiter(void 0, void 0, void 0, function* () {
2377
- const newValue = {
2378
- url,
2379
- article_title,
2380
- cookie_id,
2381
- ga_client_id,
2382
- article_id,
2383
- campaign_id,
2384
- campaign_code,
2385
- subscription_title: subscription_title,
2386
- };
2387
- listBlockAdded.forEach(({ data: { value: k } }) => {
2388
- newValue[k] = value[k];
2389
- });
2390
- setLoading(true);
2391
- try {
2392
- const { _data } = (yield Service.campaignPostLead({ data: newValue })) || {};
2393
- const { model } = _data;
2394
- if (model && model.id) {
2395
- setShowThankyou(true);
2396
- }
2397
- }
2398
- catch (error) {
2399
- console.log('** Error : ', error);
2400
- }
2401
- setLoading(false);
2402
- }), [
2403
- url,
2404
- article_id,
2405
- article_title,
2406
- cookie_id,
2407
- ga_client_id,
2408
- campaign_code,
2409
- subscription_title,
2410
- listBlockAdded,
2411
- ]);
2412
- useEffect(() => {
2413
- if (refContainer.current) {
2414
- IObserver.observe(refContainer.current);
2415
- }
2416
- return () => {
2417
- IObserver.disconnect();
2418
- };
2419
- }, [
2420
- url,
2421
- article_id,
2422
- article_title,
2423
- ga_client_id,
2424
- campaign_id,
2425
- campaign_code,
2426
- subscription_title,
2427
- ]);
2428
- return (React__default.createElement("div", { ref: refContainer },
2429
- React__default.createElement(StyledLeadGenSubscriptionBox, null,
2430
- showThankyou && (React__default.createElement(LeadGenThankYou, { image: Object.assign(Object.assign({}, thankyouImage), { src: thankyouImage.src || `${apiUrl}admin/img/thanksyou.png` }), title: thankyouTitle, description: thankyouDescription, button: thankyouButton })),
2431
- !showThankyou && (React__default.createElement(React__default.Fragment, null,
2432
- React__default.createElement(StyledLeadGenSubscriptionBoxHeader, null,
2433
- !!image && (React__default.createElement(StyledLeadGenSubscriptionBoxHeaderImage, null,
2434
- React__default.createElement("img", { src: image, alt: "" }))),
2435
- React__default.createElement("p", { className: "leadgen-title" }, subscription_title)),
2436
- React__default.createElement(StyledLeadGenSubscriptionBoxBody, { className: "leadgen-subscription_box_body" },
2437
- React__default.createElement(LeadGenForm, { ref: formRef, form: form, rules: validateObj, blocks: listBlockAdded, locale: locale, onFinish: middlewareOnSubmit }),
2438
- React__default.createElement(Button$2, { disabled: loading, loading: loading, variant: "filled", size: "lg", onClick: () => { var _a; return (_a = formRef.current) === null || _a === void 0 ? void 0 : _a.submit(); }, className: "leadgen-btn leadgen-btn_action", fullWidth: true }, (_c = submitBlock === null || submitBlock === void 0 ? void 0 : submitBlock.data) === null || _c === void 0 ? void 0 : _c.value)))))));
2439
- };
2440
- const LeadGenSubscriptionBoxWithMemo = memo(LeadGenSubscriptionBoxWithoutMemo);
2441
-
2442
- const Container = () => {
2443
- const context = useContext(LeadGenSubscriptionBoxContext);
2444
- const {
2445
- // apiUrl: apiUrlProps,
2446
- // apiSubotUrl,
2447
- campaign_code, article_id, subscription_title, locale, siteId, siteDomain, userInfo, forceCampaign, } = context;
2448
- if (!forceCampaign || !(forceCampaign === null || forceCampaign === void 0 ? void 0 : forceCampaign.id)) {
2449
- return null;
2450
- }
2451
- return (React__default.createElement(LeadGenSubscriptionBoxWithMemo, { locale: locale, userInfo: userInfo, siteId: siteId, siteDomain: siteDomain, forceCampaign: forceCampaign, campaign_code: campaign_code, article_id: article_id, subscription_title: subscription_title }));
2452
- };
2453
- Container.displayName = 'LeadGenSubscriptionBox';
2454
- const LeadGenSubscriptionBoxContainer = (props) => {
2455
- const { campaign_code } = props;
2456
- if (!campaign_code) {
2457
- return null;
2458
- }
2459
- return (React__default.createElement(LeadGenSubscriptionBoxProvider, Object.assign({}, props),
2460
- React__default.createElement(Container, null)));
2461
- };
2462
- const LeadGenSubscriptionBox = LeadGenSubscriptionBoxContainer;
2463
-
2464
- const useImageSize = (src) => {
2465
- const [width, setWidth] = useState(16);
2466
- const [height, setHeight] = useState(9);
2467
- const [loaded, setLoaded] = useState(false);
2468
- // load src image to get its width and height
2469
- useEffect(() => {
2470
- setLoaded(false);
2471
- if (src) {
2472
- const img = new Image();
2473
- img.addEventListener('load', () => {
2474
- setWidth(img.naturalWidth);
2475
- setHeight(img.naturalHeight);
2476
- setLoaded(true);
2477
- });
2478
- img.addEventListener('error', () => {
2479
- setWidth(16);
2480
- setHeight(9);
2481
- setLoaded(true);
2482
- });
2483
- img.src = src;
2484
- }
2485
- else {
2486
- setWidth(16);
2487
- setHeight(9);
2488
- setLoaded(true);
2489
- }
2490
- }, [src]);
2491
- return {
2492
- loaded,
2493
- width,
2494
- height,
2495
- };
2496
- };
2497
-
2498
- const CloseButton = ({ onClose, containerClassName, svgClassName, }) => (React__default.createElement("button", { onClick: onClose, className: `le-newbuilder-close-button js-modal__close ${containerClassName || ''}` },
2499
- React__default.createElement("svg", { width: "1em", height: "1em", viewBox: "0 0 20 20", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", className: svgClassName },
2500
- React__default.createElement("path", { d: "M9.99981 10.8432L14.0583 14.9017C14.1691 15.0125 14.3083 15.0691 14.476 15.0717C14.6437 15.0743 14.7854 15.0176 14.9013 14.9017C15.0172 14.7858 15.0752 14.6453 15.0752 14.4802C15.0752 14.3151 15.0172 14.1746 14.9013 14.0587L10.8429 10.0002L14.9013 5.9417C15.0121 5.83094 15.0688 5.69172 15.0713 5.52402C15.0739 5.35634 15.0172 5.21456 14.9013 5.09866C14.7854 4.98276 14.6449 4.9248 14.4798 4.9248C14.3147 4.9248 14.1742 4.98276 14.0583 5.09866L9.99981 9.15712L5.94133 5.09866C5.83057 4.98789 5.69135 4.93122 5.52365 4.92866C5.35598 4.92609 5.21419 4.98276 5.09829 5.09866C4.98239 5.21456 4.92444 5.35506 4.92444 5.52018C4.92444 5.6853 4.98239 5.82581 5.09829 5.9417L9.15675 10.0002L5.09829 14.0587C4.98752 14.1694 4.93085 14.3087 4.9283 14.4763C4.92572 14.644 4.98239 14.7858 5.09829 14.9017C5.21419 15.0176 5.3547 15.0756 5.51982 15.0756C5.68493 15.0756 5.82544 15.0176 5.94133 14.9017L9.99981 10.8432Z" }))));
2501
-
2502
- // url: imageBlocks.imageMobile.data.url
2503
- // newTab: imageBlocks.imageMobile.data.newtab
2504
- // imageMobile: campaignShow.image
2505
- // imageDestkop: campaignShow.image_desktop
2506
- const CenterTabLayout = ({ popupId, url, newTab, imageDestkop, imageMobile, onClose, onOtherSubmit, }) => {
2507
- const { width: imageMobileWidth, height: imageMobileHeight, loaded: imageMobileLoaded, } = useImageSize(imageMobile);
2508
- const { width: imageDestkopWidth, height: imageDestkopHeight, loaded: imageDestkopLoaded, } = useImageSize(imageDestkop);
2509
- if (!imageMobileLoaded || !imageDestkopLoaded)
2510
- return null;
2511
- return (React__default.createElement("div", { id: popupId, className: "lead-modal-wrapper", "data-popup-url": location.pathname, "data-popup-type": "center_tab" },
2512
- React__default.createElement("div", { className: "le-center-tab-popup" },
2513
- React__default.createElement("div", { style: { position: 'relative' } },
2514
- React__default.createElement("a", { className: "js-popup-other-submit", href: url, target: newTab ? 'blank' : '_parent', onClick: onOtherSubmit },
2515
- isVideo(imageMobile) ? (React__default.createElement("video", { loop: true, muted: true, autoPlay: true, className: "le-only-mobile" },
2516
- React__default.createElement("source", { src: imageMobile }))) : (React__default.createElement("img", { className: "le-only-mobile", src: imageMobile, style: {
2517
- aspectRatio: `${imageMobileWidth}/${imageMobileHeight}`,
2518
- } })),
2519
- isVideo(imageDestkop) ? (React__default.createElement("video", { loop: true, muted: true, autoPlay: true, className: "le-only-desktop" },
2520
- React__default.createElement("source", { src: imageDestkop }))) : (React__default.createElement("img", { className: "le-only-desktop", src: imageDestkop, style: {
2521
- aspectRatio: `${imageDestkopWidth}/${imageDestkopHeight}`,
2522
- } }))),
2523
- React__default.createElement(CloseButton, { onClose: onClose, containerClassName: "close-button-top-right" })))));
1385
+ return (React__default.createElement("div", { id: popupId, className: "lead-modal-wrapper", "data-popup-url": location.pathname, "data-popup-type": "center_tab" },
1386
+ React__default.createElement("div", { className: "le-center-tab-popup" },
1387
+ React__default.createElement("div", { style: { position: 'relative' } },
1388
+ React__default.createElement("a", { className: "js-popup-other-submit", href: url, target: newTab ? 'blank' : '_parent', onClick: onOtherSubmit },
1389
+ isVideo(imageMobile) ? (React__default.createElement("video", { loop: true, muted: true, autoPlay: true, className: "le-only-mobile" },
1390
+ React__default.createElement("source", { src: imageMobile }))) : (React__default.createElement("img", { className: "le-only-mobile", src: imageMobile, style: {
1391
+ aspectRatio: `${imageMobileWidth}/${imageMobileHeight}`,
1392
+ } })),
1393
+ isVideo(imageDestkop) ? (React__default.createElement("video", { loop: true, muted: true, autoPlay: true, className: "le-only-desktop" },
1394
+ React__default.createElement("source", { src: imageDestkop }))) : (React__default.createElement("img", { className: "le-only-desktop", src: imageDestkop, style: {
1395
+ aspectRatio: `${imageDestkopWidth}/${imageDestkopHeight}`,
1396
+ } }))),
1397
+ React__default.createElement(CloseButton, { onClose: onClose, containerClassName: "close-button-top-right" })))));
2524
1398
  };
2525
1399
 
2526
1400
  // title: titleText
@@ -2742,6 +1616,211 @@ const EmptyComponent = ({ onClose, onContinue, }) => {
2742
1616
  React__default.createElement(Button$2, { onClick: onContinue, size: "lg", variant: "filled", fullWidth: false, className: "leadgen-btn leadgen-btn_empty_again" }, t('lead.empty.submitAgain')))));
2743
1617
  };
2744
1618
 
1619
+ const libraries = ['places'];
1620
+ const GoogleLocationBlock = (props) => {
1621
+ var _a;
1622
+ const { inputWrapperOrder = ['label', 'input', 'description', 'error'], defaultValue, value: valueProps, onChange: onChangeProps, locale } = props, restProps = __rest(props, ["inputWrapperOrder", "defaultValue", "value", "onChange", "locale"]);
1623
+ const [LoadScript, setLoadScript] = useState(null);
1624
+ const [value, setValue] = useState(defaultValue || valueProps);
1625
+ const { predictions } = usePlacesAutocomplete(value, '', locale === 'tl-PH' ? 'en' : (_a = locale === null || locale === void 0 ? void 0 : locale.split('-')) === null || _a === void 0 ? void 0 : _a[0]);
1626
+ const onChangeAutocomplete = useCallback((s) => {
1627
+ setValue(s);
1628
+ onChangeProps === null || onChangeProps === void 0 ? void 0 : onChangeProps(s);
1629
+ }, []);
1630
+ const onClickItem = useCallback((item) => {
1631
+ /** For sure get value */
1632
+ setValue(item.value);
1633
+ const predCur = predictions === null || predictions === void 0 ? void 0 : predictions.find(({ description }) => description === item.value);
1634
+ onChangeProps === null || onChangeProps === void 0 ? void 0 : onChangeProps(item.value, predCur === null || predCur === void 0 ? void 0 : predCur.rawData);
1635
+ }, [onChangeProps, predictions]);
1636
+ useEffect(() => {
1637
+ setValue(valueProps);
1638
+ }, [valueProps]);
1639
+ useEffect(() => {
1640
+ var _a, _b, _c;
1641
+ // only load extra google script when not yet loaded
1642
+ if (!((_c = (_b = (_a = window === null || window === void 0 ? void 0 : window.google) === null || _a === void 0 ? void 0 : _a.maps) === null || _b === void 0 ? void 0 : _b.places) === null || _c === void 0 ? void 0 : _c.AutocompleteService) && !LoadScript) {
1643
+ import('@react-google-maps/api').then((m) => {
1644
+ setLoadScript(() => m.LoadScript);
1645
+ });
1646
+ }
1647
+ }, []);
1648
+ return (React__default.createElement(Autocomplete, Object.assign({ defaultValue: defaultValue, value: value, onChange: onChangeAutocomplete, data: predictions.map((pred) => {
1649
+ return { value: pred.description, label: pred.description };
1650
+ }), filter: () => true, onItemSubmit: onClickItem, inputWrapperOrder: inputWrapperOrder, zIndex: ZINDEX_SSO - 9e6 + 2, withinPortal: true, styles: { dropdown: { pointerEvents: 'auto' } }, inputContainer: (children) => {
1651
+ return (React__default.createElement(React__default.Fragment, null,
1652
+ LoadScript && (React__default.createElement(LoadScript, { googleMapsApiKey: GOOGLE_API_KEY, libraries: libraries, loadingElement: React__default.createElement(React__default.Fragment, null), style: { width: '100%' } })),
1653
+ children));
1654
+ } }, restProps)));
1655
+ };
1656
+
1657
+ // You can give context variables any name
1658
+ const [LeadFormProvider, useLeadFormContext, useLeadForm] = createFormContext();
1659
+ const useLeadFormConfig = ({ listBlockAdded = [], validatingPhoneRef, validatingEmailRef, campaignId, campaign_subot_id = [], userInfo, }) => {
1660
+ const { t } = useTranslations();
1661
+ const initialValues = useMemo(() => mappingSSOToLead(userInfo), [userInfo === null || userInfo === void 0 ? void 0 : userInfo.id]);
1662
+ const validateObj = useMemo(() => {
1663
+ const InputBlocks = [
1664
+ 'TextBlock',
1665
+ 'NumberBlock',
1666
+ 'EmailBlock',
1667
+ 'PhoneBlock',
1668
+ 'DateBlock',
1669
+ 'CheckboxBlock',
1670
+ 'RadioBlock',
1671
+ 'DropdownBlock',
1672
+ 'PhoneOtpBlock',
1673
+ 'WhatsappOtpBlock',
1674
+ 'ZaloOtpBlock',
1675
+ 'LocationBlock',
1676
+ 'TncBlock',
1677
+ ];
1678
+ // ALL are required and can skip if not touched yet
1679
+ const withSharedCheck = (name, cb,
1680
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1681
+ block) => {
1682
+ return (value) => {
1683
+ var _a;
1684
+ const isBLockRequired = (_a = block === null || block === void 0 ? void 0 : block.data) === null || _a === void 0 ? void 0 : _a.required;
1685
+ if (!formRef.current.isTouched(name))
1686
+ return;
1687
+ if ((typeof value === 'string' && value.replace(' ', '') === '') ||
1688
+ typeof value === 'undefined' ||
1689
+ value === '' ||
1690
+ (Array.isArray(value) && value.length === 0)) {
1691
+ return isBLockRequired
1692
+ ? t('validator.required')
1693
+ : cb === null || cb === void 0 ? void 0 : cb(value);
1694
+ }
1695
+ return cb === null || cb === void 0 ? void 0 : cb(value);
1696
+ };
1697
+ };
1698
+ return listBlockAdded
1699
+ .filter((b) => InputBlocks.includes(b.name))
1700
+ .reduce((r, b) => {
1701
+ var _a;
1702
+ const isRequired = (_a = b.data.required) !== null && _a !== void 0 ? _a : true;
1703
+ if (b.name === 'NumberBlock') {
1704
+ return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, (value) => {
1705
+ if (value && isNaN(Number(value))) {
1706
+ return t('validator.number');
1707
+ }
1708
+ }, b) });
1709
+ }
1710
+ else if (b.name === 'EmailBlock') {
1711
+ return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, (value) => {
1712
+ if (value && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value)) {
1713
+ return t('validator.email');
1714
+ }
1715
+ if (!value)
1716
+ return;
1717
+ validatingEmailRef.current = true;
1718
+ setTimeout(() => {
1719
+ formRef.current.setFieldError(b.data.value, 'Validating...');
1720
+ checkUsedEmailOrPhoneWithCache(campaignId, campaign_subot_id, {
1721
+ email: value,
1722
+ })
1723
+ .then((tKey) => {
1724
+ if (tKey) {
1725
+ formRef.current.setFieldError(b.data.value, t(tKey));
1726
+ }
1727
+ else {
1728
+ formRef.current.clearFieldError(b.data.value);
1729
+ }
1730
+ validatingEmailRef.current = false;
1731
+ })
1732
+ .catch((e) => {
1733
+ console.error(e);
1734
+ formRef.current.setFieldError(b.data.value, e.message || 'Something went wrong');
1735
+ validatingEmailRef.current = false;
1736
+ });
1737
+ }, 200);
1738
+ }, b) });
1739
+ }
1740
+ else if (b.name === 'PhoneBlock' ||
1741
+ b.name === 'PhoneOtpBlock' ||
1742
+ b.name === 'ZaloOtpBlock' ||
1743
+ b.name === 'WhatsappOtpBlock') {
1744
+ return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, (value) => {
1745
+ if (value &&
1746
+ window.intlTelInputUtils &&
1747
+ !window.intlTelInputUtils.isValidNumber(String(value), LEAD_LOCALE.countryCode)) {
1748
+ return t('validator.phone');
1749
+ }
1750
+ if (!value)
1751
+ return;
1752
+ validatingPhoneRef.current = true;
1753
+ setTimeout(() => {
1754
+ formRef.current.setFieldError(b.data.value, 'Validating...');
1755
+ if (b.data.singleSubmission) {
1756
+ checkUsedPhoneOnlyWithCache(campaignId, value)
1757
+ .then((tKey) => {
1758
+ if (tKey) {
1759
+ formRef.current.setFieldError(b.data.value, t(tKey));
1760
+ }
1761
+ else {
1762
+ formRef.current.clearFieldError(b.data.value);
1763
+ }
1764
+ validatingPhoneRef.current = false;
1765
+ })
1766
+ .catch((err) => {
1767
+ console.error(err);
1768
+ formRef.current.setFieldError(b.data.value, err.message || 'Something went wrong');
1769
+ validatingPhoneRef.current = false;
1770
+ });
1771
+ }
1772
+ else {
1773
+ checkUsedEmailOrPhoneWithCache(campaignId, campaign_subot_id, {
1774
+ phone: value,
1775
+ })
1776
+ .then((tKey) => {
1777
+ if (tKey) {
1778
+ formRef.current.setFieldError(b.data.value, t(tKey));
1779
+ }
1780
+ else {
1781
+ formRef.current.clearFieldError(b.data.value);
1782
+ }
1783
+ validatingPhoneRef.current = false;
1784
+ })
1785
+ .catch((e) => {
1786
+ console.error(e);
1787
+ formRef.current.setFieldError(b.data.value, e.message || 'Something went wrong');
1788
+ validatingPhoneRef.current = false;
1789
+ });
1790
+ }
1791
+ }, 200);
1792
+ }, b) });
1793
+ }
1794
+ else if (b.name === 'DateBlock') {
1795
+ return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, (value) => {
1796
+ if (value && isNaN(Date.parse(value))) {
1797
+ return t('validator.date');
1798
+ }
1799
+ }, b) });
1800
+ }
1801
+ else if (b.name === 'TncBlock') {
1802
+ return Object.assign(Object.assign({}, r), { [`TNC-` + b.id]: withSharedCheck('TNC-' + b.id, (value) => {
1803
+ if (isRequired && !value) {
1804
+ return t('validator.required');
1805
+ }
1806
+ }, b) });
1807
+ }
1808
+ else {
1809
+ return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, undefined, b) });
1810
+ }
1811
+ }, {});
1812
+ }, [listBlockAdded.map((b) => b.name).join(',')]);
1813
+ const form = useLeadForm({
1814
+ validateInputOnChange: true,
1815
+ clearInputErrorOnChange: true,
1816
+ validate: validateObj,
1817
+ initialValues,
1818
+ });
1819
+ const formRef = useRef(form);
1820
+ formRef.current = form;
1821
+ return { form, validateObj };
1822
+ };
1823
+
2745
1824
  const SubtitleBlock = ({ children, align, }) => (React__default.createElement("p", { className: `lead-modal__description ${'le-text-align-' + (align || '')} ${LEAD_CLASS}` }, children));
2746
1825
 
2747
1826
  const cssInputNotShrink = css `
@@ -3060,13 +2139,11 @@ const TextField = (props) => {
3060
2139
  const $focusEl = $textEl.item($textEl.length - 1);
3061
2140
  if ($focusEl) {
3062
2141
  $focusEl.focus();
3063
- setTimeout(() => {
3064
- $focusEl.scrollIntoView({
3065
- behavior: 'auto',
3066
- block: 'center',
3067
- inline: 'start',
3068
- });
3069
- }, 100);
2142
+ $focusEl.scrollIntoView({
2143
+ behavior: 'auto',
2144
+ block: 'center',
2145
+ inline: 'start',
2146
+ });
3070
2147
  }
3071
2148
  }, [shrink]);
3072
2149
  useEffect(() => {
@@ -3200,6 +2277,17 @@ const StyledFormContainer = styled.div `
3200
2277
  flex-direction: column;
3201
2278
  }
3202
2279
 
2280
+ .leadgen-form_inner {
2281
+ display: flex;
2282
+ flex-direction: column;
2283
+ flex: 1;
2284
+ min-height: 0;
2285
+
2286
+ &:has(.leadgen-header) {
2287
+ display: block;
2288
+ }
2289
+ }
2290
+
3203
2291
  .leadgen-form_body {
3204
2292
  flex: 1;
3205
2293
  min-height: 0;
@@ -3239,16 +2327,22 @@ const StyledFormContainer = styled.div `
3239
2327
  *
3240
2328
  */
3241
2329
  const FormContainer = (_a) => {
3242
- var { title, titleAlign, description, descriptionAlign, className, style, children, footer } = _a, restProps = __rest(_a, ["title", "titleAlign", "description", "descriptionAlign", "className", "style", "children", "footer"]);
2330
+ var { title, titleAlign, description, descriptionAlign, className, style, children, header, footer } = _a, restProps = __rest(_a, ["title", "titleAlign", "description", "descriptionAlign", "className", "style", "children", "header", "footer"]);
2331
+ const HeaderContent = (React__default.createElement("div", { className: "leadgen-form_header" },
2332
+ React__default.createElement("h2", { title: title, className: "leadgen-title", "data-align": titleAlign }, title),
2333
+ !!description && (React__default.createElement("p", { title: description, className: "leadgen-description", "data-align": descriptionAlign, dangerouslySetInnerHTML: { __html: description } }))));
3243
2334
  if (!title && !description) {
3244
2335
  return null;
3245
2336
  }
3246
2337
  return (React__default.createElement(StyledFormContainer, Object.assign({ className: clsx(className, 'leadgen-form_container'), style: style }, restProps),
3247
2338
  React__default.createElement("div", { className: "leadgen-form_wrapper" },
3248
- React__default.createElement("div", { className: "leadgen-form_header" },
3249
- React__default.createElement("h2", { title: title, className: "leadgen-title", "data-align": titleAlign }, title),
3250
- React__default.createElement("p", { title: description, className: "leadgen-description", "data-align": descriptionAlign, dangerouslySetInnerHTML: { __html: description } })),
3251
- React__default.createElement("div", { className: "leadgen-form_body" }, children),
2339
+ !!header && (React__default.createElement("div", { className: "leadgen-form_scrollable" },
2340
+ header,
2341
+ HeaderContent,
2342
+ React__default.createElement("div", { className: "leadgen-form_body" }, children))),
2343
+ !header && (React__default.createElement(React__default.Fragment, null,
2344
+ HeaderContent,
2345
+ React__default.createElement("div", { className: "leadgen-form_body" }, children))),
3252
2346
  React__default.createElement("div", { className: "leadgen-form_footer" }, footer))));
3253
2347
  };
3254
2348
 
@@ -3450,8 +2544,9 @@ const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSub
3450
2544
  const isDrawer = isLightBoxB && isMobile;
3451
2545
  const limitFieldsLightBoxB = isLightBoxB && listBlockAdded.length <= LEADGEN_LIMIT_LIGHTBOXB;
3452
2546
  const hasForm = isLightBoxA
3453
- ? listBlockAdded.some((item) => LEADGEN_BLOCK_INPUT.some((k) => k === (item === null || item === void 0 ? void 0 : item.name)))
2547
+ ? listBlockAdded.some((item) => LEADGEN_BLOCK_IN_FORM.some((k) => k === (item === null || item === void 0 ? void 0 : item.name)))
3454
2548
  : true;
2549
+ const headerInsideFormContainer = isSlider || isLightBoxA || isFullscreen;
3455
2550
  const showHeader = !!imageMobile || !!imageDesktop;
3456
2551
  const onlyHeader = !title && !description;
3457
2552
  const showButtonClose = !isInline;
@@ -3575,7 +2670,7 @@ const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSub
3575
2670
  const PopupEmpty = showEmpty && (React__default.createElement(EmptyComponent, { onClose: onClose, onContinue: () => setShowEmpty(false) }));
3576
2671
  const PopupForm = (React__default.createElement(LeadFormProvider, { form: form },
3577
2672
  React__default.createElement("form", { ref: formRef, className: "leadgen-form", onSubmit: middlewareOnSubmit },
3578
- React__default.createElement(FormContainer, { title: title, titleAlign: titleAlign, description: description, descriptionAlign: descriptionAlign, footer: hasForm ? ButtonSubmit : ButtonLink, "data-hidden-form": !hasForm },
2673
+ React__default.createElement(FormContainer, { title: title, titleAlign: titleAlign, description: description, descriptionAlign: descriptionAlign, header: headerInsideFormContainer && PopupHeader, footer: hasForm ? ButtonSubmit : ButtonLink, "data-hidden-form": !hasForm },
3579
2674
  React__default.createElement("div", { className: "leadgen-form_inner" },
3580
2675
  React__default.createElement(LightboxFields, { listBlockAdded: listBlockAdded, popupId: popupId, locale: locale, onClose: onClose, onOtherSubmit: onOtherSubmit }))))));
3581
2676
  const PopupOtp = showOtpPhone && (React__default.createElement(OtpBlock, { otpData: showOtpPhone, autoSendWhenOpen: false, onSuccess: () => {
@@ -3586,7 +2681,7 @@ const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSub
3586
2681
  const PopupContent = (React__default.createElement("div", { className: clsx('leadgen-content', {
3587
2682
  'leadgen-content_small': limitFieldsLightBoxB,
3588
2683
  }) },
3589
- PopupHeader,
2684
+ !headerInsideFormContainer && PopupHeader,
3590
2685
  !onlyHeader && (React__default.createElement("div", { className: "leadgen-inner" },
3591
2686
  PopupThankYou,
3592
2687
  !showThankyou && (React__default.createElement(React__default.Fragment, null,
@@ -4493,4 +3588,4 @@ LeadGen.Thankyou = Thankyou;
4493
3588
  LeadGen.OtpForm = OtpBlock$1;
4494
3589
  LeadGen.Close = Close;
4495
3590
 
4496
- export { LeadGen, LeadGenSubscriptionBox };
3591
+ export { LeadGen };