@hhgtech/hhg-components 1.27.40 → 1.27.41

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 (280) hide show
  1. package/build/babyGrowth.js +2 -2
  2. package/build/cache.js +1 -1
  3. package/build/care.js +1 -1
  4. package/build/components/atoms/icons/User.d.ts +4 -0
  5. package/build/components/atoms/icons/index.d.ts +1 -0
  6. package/build/components/navigationV2/components/molecules/navigationBar/index.d.ts +2 -2
  7. package/build/components/navigationV2/hooks/useNavConfig.d.ts +2 -1
  8. package/build/components/navigationV2/index.d.ts +1 -1
  9. package/build/components/organisms/navigationProfileButton/index.d.ts +1 -2
  10. package/build/components.js +1 -1
  11. package/build/constants.js +1 -1
  12. package/build/{core-4d6381fc.js → core-b10ec2ae.js} +1 -1
  13. package/build/{dataTransform-662982af.js → dataTransform-b54393ce.js} +1 -1
  14. package/build/ecom.js +1 -1
  15. package/build/esm/babyGrowth.js +2 -2
  16. package/build/esm/cache.js +1 -1
  17. package/build/esm/care.js +1 -1
  18. package/build/esm/components/atoms/icons/User.d.ts +4 -0
  19. package/build/esm/components/atoms/icons/index.d.ts +1 -0
  20. package/build/esm/components/navigationV2/components/molecules/navigationBar/index.d.ts +2 -2
  21. package/build/esm/components/navigationV2/hooks/useNavConfig.d.ts +2 -1
  22. package/build/esm/components/navigationV2/index.d.ts +1 -1
  23. package/build/esm/components/organisms/navigationProfileButton/index.d.ts +1 -2
  24. package/build/esm/components.js +1 -1
  25. package/build/esm/constants.js +1 -1
  26. package/build/esm/{core-02ca893a.js → core-8b54d2b3.js} +1 -1
  27. package/build/esm/{dataTransform-4a1ba820.js → dataTransform-2634aa2a.js} +1 -1
  28. package/build/esm/ecom.js +1 -1
  29. package/build/esm/{fixedBottomAdBlock-c9a03142.js → fixedBottomAdBlock-252cc4da.js} +1 -1
  30. package/build/esm/footer.js +1 -1
  31. package/build/esm/gAssets.js +1 -1
  32. package/build/esm/{getDynamicHealthTool-802ee52c.js → getDynamicHealthTool-20a6fc1a.js} +1 -1
  33. package/build/esm/{getSocialList-a6458c2d.js → getSocialList-d9b72a6c.js} +1 -1
  34. package/build/esm/hooks.js +1 -1
  35. package/build/esm/i18n.js +1 -1
  36. package/build/esm/i18nV2.js +1 -1
  37. package/build/esm/index-011d54c2.js +1 -0
  38. package/build/esm/{index-558a5045.js → index-089be81e.js} +1 -1
  39. package/build/esm/{index-28798038.js → index-0d7aacfc.js} +1 -1
  40. package/build/esm/{index-c00bfd23.js → index-0f123066.js} +1 -1
  41. package/build/esm/{index-3e66a614.js → index-14ebdde4.js} +1 -1
  42. package/build/esm/{index-4d579ab7.js → index-17611c49.js} +37 -37
  43. package/build/esm/{index-4f316d87.js → index-1bb8266d.js} +1 -1
  44. package/build/esm/{index-ba146661.js → index-325afc4d.js} +1 -1
  45. package/build/esm/{index-62bc7c5e.js → index-35fd0aad.js} +1 -1
  46. package/build/esm/{index-b0993261.js → index-592a2e0b.js} +1 -1
  47. package/build/esm/index-63e0b5be.js +1 -0
  48. package/build/esm/{index-47122181.js → index-72719df9.js} +1 -1
  49. package/build/esm/{index-c4d88a81.js → index-87850dfe.js} +1 -1
  50. package/build/esm/{index-c7fe4301.js → index-8804431d.js} +1 -1
  51. package/build/esm/{index-2dcc67f8.js → index-88b68e0d.js} +2 -2
  52. package/build/esm/{index-17695220.js → index-88e355f5.js} +1 -1
  53. package/build/esm/{index-54a83a0e.js → index-8c0064ee.js} +1 -1
  54. package/build/esm/{index-c42054ea.js → index-9075d01a.js} +1 -1
  55. package/build/esm/{index-60389692.js → index-9ff96da9.js} +1 -1
  56. package/build/esm/{index-a30cdd1b.js → index-ac45d84b.js} +1 -1
  57. package/build/esm/{index-9f03353e.js → index-bcca0486.js} +2 -2
  58. package/build/esm/{index-21bed750.js → index-d4681c97.js} +1 -1
  59. package/build/esm/index-e5a33e01.js +1 -0
  60. package/build/esm/index-f16a050a.js +1 -0
  61. package/build/esm/{index-11483079.js → index-f7380130.js} +1 -1
  62. package/build/esm/index.css +1 -1
  63. package/build/esm/index.js +1 -1
  64. package/build/esm/{index.styled-01db228b.js → index.styled-a7d5bf58.js} +3 -7
  65. package/build/esm/{index.styled-069379fa.js → index.styled-a912953b.js} +6 -6
  66. package/build/esm/{index.styled-ad1cb88f.js → index.styled-ef3fcbbd.js} +4 -4
  67. package/build/esm/lead.js +1 -1
  68. package/build/esm/mantine.js +1 -1
  69. package/build/esm/misc.js +1 -1
  70. package/build/esm/navigation.js +1 -1
  71. package/build/esm/onboarding.js +1 -1
  72. package/build/esm/onboardingV2.js +1 -1
  73. package/build/esm/pwg.js +3 -3
  74. package/build/esm/{routing-f0e3f53b.js → routing-afe38f18.js} +1 -1
  75. package/build/esm/{screenSizeContext-f04e5151.js → screenSizeContext-652dbbd3.js} +1 -1
  76. package/build/esm/together.js +1 -1
  77. package/build/esm/{types-b6a35eba.js → types-0c764805.js} +1 -1
  78. package/build/esm/{types-b443428b.js → types-52299e0a.js} +13 -13
  79. package/build/esm/types.js +1 -1
  80. package/build/esm/useHealthToolCache-bce82a83.js +1 -0
  81. package/build/esm/{useRafState-e29026ec.js → useRafState-5631654e.js} +1 -1
  82. package/build/esm/{useTranslations-e8922a21.js → useTranslations-fff3d6f3.js} +1 -1
  83. package/build/esm/{utils-7c4cec34.js → utils-d0688954.js} +1 -1
  84. package/build/esm/vaccination.js +5 -5
  85. package/build/{fixedBottomAdBlock-b817be79.js → fixedBottomAdBlock-461f5e67.js} +1 -1
  86. package/build/footer.js +1 -1
  87. package/build/gAssets.js +1 -1
  88. package/build/getDynamicHealthTool-aedc0c75.js +1 -0
  89. package/build/{getSocialList-21c552f9.js → getSocialList-621a067b.js} +1 -1
  90. package/build/hooks.js +1 -1
  91. package/build/i18n.js +1 -1
  92. package/build/i18nV2.js +1 -1
  93. package/build/{index-e44666f8.js → index-00c4bebd.js} +1 -1
  94. package/build/{index-d3889844.js → index-02570863.js} +3 -3
  95. package/build/{index-3b35a761.js → index-07621a50.js} +34 -34
  96. package/build/{index-bbdb6eea.js → index-0e3e677c.js} +1 -1
  97. package/build/{index-2bac14f0.js → index-1430772b.js} +1 -1
  98. package/build/{index-975fd4f6.js → index-2d82157a.js} +1 -1
  99. package/build/{index-ae26eb00.js → index-33aec72e.js} +1 -1
  100. package/build/{index-417b5acc.js → index-35583c17.js} +1 -1
  101. package/build/{index-13b06da6.js → index-46b6bc5b.js} +1 -1
  102. package/build/{index-36fc880d.js → index-5e573539.js} +1 -1
  103. package/build/{index-dd8da762.js → index-60543e5a.js} +1 -1
  104. package/build/{index-26b5edf8.js → index-646eaae8.js} +1 -1
  105. package/build/{index-522a80ca.js → index-6838613c.js} +1 -1
  106. package/build/{index-e4ec737c.js → index-715541db.js} +1 -1
  107. package/build/{index-8d31aad0.js → index-7f0e772f.js} +1 -1
  108. package/build/{index-df4c0544.js → index-9461eb92.js} +3 -3
  109. package/build/{index-d918f37f.js → index-a2b3af0a.js} +1 -1
  110. package/build/{index-4cd02f8b.js → index-b2422084.js} +1 -1
  111. package/build/{index-e3d4c5c6.js → index-b348c352.js} +1 -1
  112. package/build/{index-1120f5c4.js → index-b9c6af73.js} +1 -1
  113. package/build/{index-1d867f9c.js → index-c936e2ee.js} +1 -1
  114. package/build/{index-1857f791.js → index-cb6bbe76.js} +1 -1
  115. package/build/{index-f35b56aa.js → index-d26e6639.js} +1 -1
  116. package/build/{index-0294926d.js → index-eeceda3e.js} +1 -1
  117. package/build/index-fa16facd.js +1 -0
  118. package/build/index.css +1 -1
  119. package/build/index.js +1 -1
  120. package/build/{index.styled-67e62dda.js → index.styled-1609c259.js} +3 -3
  121. package/build/{index.styled-2efe285e.js → index.styled-b688c9b5.js} +3 -7
  122. package/build/{index.styled-fa21423c.js → index.styled-d9ba0def.js} +6 -6
  123. package/build/lead.js +1 -1
  124. package/build/mantine.js +1 -1
  125. package/build/misc.js +1 -1
  126. package/build/navigation.js +1 -1
  127. package/build/onboarding.js +1 -1
  128. package/build/onboardingV2.js +1 -1
  129. package/build/pwg.js +2 -2
  130. package/build/{routing-749550f2.js → routing-7eac9db6.js} +1 -1
  131. package/build/{screenSizeContext-d1b0e534.js → screenSizeContext-0a57febc.js} +10 -10
  132. package/build/together.js +1 -1
  133. package/build/{types-54321d87.js → types-2ace3ae4.js} +1 -1
  134. package/build/{types-f3855282.js → types-99b3498c.js} +1 -1
  135. package/build/types.js +1 -1
  136. package/build/{useHealthToolCache-c42d8e50.js → useHealthToolCache-e3aaede8.js} +1 -1
  137. package/build/{useRafState-0cf20a55.js → useRafState-fa18dd8f.js} +1 -1
  138. package/build/{useTranslations-d1aa4cb7.js → useTranslations-167bae1d.js} +1 -1
  139. package/build/{utils-7f11e4d7.js → utils-09eb347b.js} +1 -1
  140. package/build/vaccination.js +1 -1
  141. package/package.json +1 -1
  142. package/build/esm/index-2636551d.js +0 -1
  143. package/build/esm/index-5ef75a1c.js +0 -1
  144. package/build/esm/index-cf0eff36.js +0 -1
  145. package/build/esm/index-ed7d5094.js +0 -1
  146. package/build/esm/useHealthToolCache-b272adc2.js +0 -1
  147. package/build/getDynamicHealthTool-637af31d.js +0 -1
  148. package/build/index-9694d8ec.js +0 -1
  149. /package/build/{BMI_BOYS.percentile.monthly-665f61c8.js → BMI_BOYS.percentile.monthly-881a5da3.js} +0 -0
  150. /package/build/{BMI_BOYS.percentile.weekly-7ff1e3ba.js → BMI_BOYS.percentile.weekly-ce769d3e.js} +0 -0
  151. /package/build/{BMI_BOYS.percentile.yearly-1a7ce690.js → BMI_BOYS.percentile.yearly-32b2fa5f.js} +0 -0
  152. /package/build/{BMI_BOYS.zscore.monthly-88f16419.js → BMI_BOYS.zscore.monthly-cab2ba32.js} +0 -0
  153. /package/build/{BMI_BOYS.zscore.weekly-57c69c44.js → BMI_BOYS.zscore.weekly-7c5f2209.js} +0 -0
  154. /package/build/{BMI_BOYS.zscore.yearly-c7365150.js → BMI_BOYS.zscore.yearly-7dd4c0cb.js} +0 -0
  155. /package/build/{BMI_GIRLS.percentile.monthly-38562d66.js → BMI_GIRLS.percentile.monthly-5165978c.js} +0 -0
  156. /package/build/{BMI_GIRLS.percentile.weekly-8aa03f20.js → BMI_GIRLS.percentile.weekly-2daea17e.js} +0 -0
  157. /package/build/{BMI_GIRLS.percentile.yearly-4201c415.js → BMI_GIRLS.percentile.yearly-33aca5d0.js} +0 -0
  158. /package/build/{BMI_GIRLS.zscore.monthly-3a682e6a.js → BMI_GIRLS.zscore.monthly-36b78ee6.js} +0 -0
  159. /package/build/{BMI_GIRLS.zscore.weekly-b9a1a6d8.js → BMI_GIRLS.zscore.weekly-9ed66ddb.js} +0 -0
  160. /package/build/{BMI_GIRLS.zscore.yearly-0db35587.js → BMI_GIRLS.zscore.yearly-1b1a966b.js} +0 -0
  161. /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-24d10181.js → HEAD CIRCUM_BOYS.percentile.monthly-b3281a12.js} +0 -0
  162. /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-7ede6d34.js → HEAD CIRCUM_BOYS.percentile.weekly-cc444356.js} +0 -0
  163. /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-7e9cd9a4.js → HEAD CIRCUM_BOYS.percentile.yearly-03e1bcb6.js} +0 -0
  164. /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-2431f3c3.js → HEAD CIRCUM_BOYS.zscore.monthly-520b0762.js} +0 -0
  165. /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-46c25363.js → HEAD CIRCUM_BOYS.zscore.weekly-500aae97.js} +0 -0
  166. /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-96d8aa99.js → HEAD CIRCUM_BOYS.zscore.yearly-523c331a.js} +0 -0
  167. /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-35c166a8.js → HEAD CIRCUM_GIRLS.percentile.monthly-1a01e536.js} +0 -0
  168. /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-0af6475a.js → HEAD CIRCUM_GIRLS.percentile.weekly-bc284355.js} +0 -0
  169. /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-3f296ee6.js → HEAD CIRCUM_GIRLS.percentile.yearly-be75881d.js} +0 -0
  170. /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-9d3f26b6.js → HEAD CIRCUM_GIRLS.zscore.monthly-8c94c9cf.js} +0 -0
  171. /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-c82d546f.js → HEAD CIRCUM_GIRLS.zscore.weekly-f94787d0.js} +0 -0
  172. /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-639c6626.js → HEAD CIRCUM_GIRLS.zscore.yearly-f0a4bf39.js} +0 -0
  173. /package/build/{HEIGHT_BOYS.percentile.monthly-fc785b1b.js → HEIGHT_BOYS.percentile.monthly-5e53a738.js} +0 -0
  174. /package/build/{HEIGHT_BOYS.percentile.weekly-d30b8307.js → HEIGHT_BOYS.percentile.weekly-f79b64ed.js} +0 -0
  175. /package/build/{HEIGHT_BOYS.percentile.yearly-28c03ef8.js → HEIGHT_BOYS.percentile.yearly-28a7f6d1.js} +0 -0
  176. /package/build/{HEIGHT_BOYS.zscore.monthly-1c45da5d.js → HEIGHT_BOYS.zscore.monthly-20a32e65.js} +0 -0
  177. /package/build/{HEIGHT_BOYS.zscore.weekly-0e4d3375.js → HEIGHT_BOYS.zscore.weekly-e0b207bf.js} +0 -0
  178. /package/build/{HEIGHT_BOYS.zscore.yearly-4d7e7050.js → HEIGHT_BOYS.zscore.yearly-6ba1ee09.js} +0 -0
  179. /package/build/{HEIGHT_GIRLS.percentile.monthly-5e538ead.js → HEIGHT_GIRLS.percentile.monthly-c139b340.js} +0 -0
  180. /package/build/{HEIGHT_GIRLS.percentile.weekly-dd5abde7.js → HEIGHT_GIRLS.percentile.weekly-cd491c57.js} +0 -0
  181. /package/build/{HEIGHT_GIRLS.percentile.yearly-55dcf383.js → HEIGHT_GIRLS.percentile.yearly-1b55edf0.js} +0 -0
  182. /package/build/{HEIGHT_GIRLS.zscore.monthly-21518fb7.js → HEIGHT_GIRLS.zscore.monthly-129db46c.js} +0 -0
  183. /package/build/{HEIGHT_GIRLS.zscore.weekly-7fbdae12.js → HEIGHT_GIRLS.zscore.weekly-dcb6aa7b.js} +0 -0
  184. /package/build/{HEIGHT_GIRLS.zscore.yearly-3b36c196.js → HEIGHT_GIRLS.zscore.yearly-41a7497c.js} +0 -0
  185. /package/build/{Onboarding-2e1153c9.js → Onboarding-135c0b06.js} +0 -0
  186. /package/build/{Visible-ccc6c2fc.js → Visible-2c616ff0.js} +0 -0
  187. /package/build/{WEIGHT_BOYS.percentile.monthly-1aced979.js → WEIGHT_BOYS.percentile.monthly-703eff4a.js} +0 -0
  188. /package/build/{WEIGHT_BOYS.percentile.weekly-655caaa7.js → WEIGHT_BOYS.percentile.weekly-3e2d2801.js} +0 -0
  189. /package/build/{WEIGHT_BOYS.percentile.yearly-888eeae0.js → WEIGHT_BOYS.percentile.yearly-9e2e3b2a.js} +0 -0
  190. /package/build/{WEIGHT_BOYS.zscore.monthly-2c8180b7.js → WEIGHT_BOYS.zscore.monthly-6983b0de.js} +0 -0
  191. /package/build/{WEIGHT_BOYS.zscore.weekly-c077f0c9.js → WEIGHT_BOYS.zscore.weekly-ccfab51c.js} +0 -0
  192. /package/build/{WEIGHT_BOYS.zscore.yearly-acca7067.js → WEIGHT_BOYS.zscore.yearly-5741ca17.js} +0 -0
  193. /package/build/{WEIGHT_GIRLS.percentile.monthly-4252fe54.js → WEIGHT_GIRLS.percentile.monthly-c754b741.js} +0 -0
  194. /package/build/{WEIGHT_GIRLS.percentile.weekly-147de3ba.js → WEIGHT_GIRLS.percentile.weekly-7ebf3596.js} +0 -0
  195. /package/build/{WEIGHT_GIRLS.percentile.yearly-3a1e9071.js → WEIGHT_GIRLS.percentile.yearly-30aa086e.js} +0 -0
  196. /package/build/{WEIGHT_GIRLS.zscore.monthly-327e349e.js → WEIGHT_GIRLS.zscore.monthly-e36364c3.js} +0 -0
  197. /package/build/{WEIGHT_GIRLS.zscore.weekly-83a86e1b.js → WEIGHT_GIRLS.zscore.weekly-c5cd2bf5.js} +0 -0
  198. /package/build/{WEIGHT_GIRLS.zscore.yearly-64db5314.js → WEIGHT_GIRLS.zscore.yearly-42acc2e1.js} +0 -0
  199. /package/build/{constants-a2e6e376.js → constants-ec416ac4.js} +0 -0
  200. /package/build/{cookieHelper-5513c98c.js → cookieHelper-410d0413.js} +0 -0
  201. /package/build/{dataTransform-98d15b93.js → dataTransform-5d9a6b00.js} +0 -0
  202. /package/build/esm/{BMI_BOYS.percentile.monthly-1a1a55b5.js → BMI_BOYS.percentile.monthly-ada753bf.js} +0 -0
  203. /package/build/esm/{BMI_BOYS.percentile.weekly-41912e93.js → BMI_BOYS.percentile.weekly-2b5d102a.js} +0 -0
  204. /package/build/esm/{BMI_BOYS.percentile.yearly-6e49270c.js → BMI_BOYS.percentile.yearly-c5658ce6.js} +0 -0
  205. /package/build/esm/{BMI_BOYS.zscore.monthly-3c369f7e.js → BMI_BOYS.zscore.monthly-b6da3806.js} +0 -0
  206. /package/build/esm/{BMI_BOYS.zscore.weekly-863420f7.js → BMI_BOYS.zscore.weekly-3caee281.js} +0 -0
  207. /package/build/esm/{BMI_BOYS.zscore.yearly-b4813775.js → BMI_BOYS.zscore.yearly-feddf343.js} +0 -0
  208. /package/build/esm/{BMI_GIRLS.percentile.monthly-7285b202.js → BMI_GIRLS.percentile.monthly-eea07fff.js} +0 -0
  209. /package/build/esm/{BMI_GIRLS.percentile.weekly-4da1269c.js → BMI_GIRLS.percentile.weekly-a2ef6b6f.js} +0 -0
  210. /package/build/esm/{BMI_GIRLS.percentile.yearly-0112116a.js → BMI_GIRLS.percentile.yearly-37e8e0cc.js} +0 -0
  211. /package/build/esm/{BMI_GIRLS.zscore.monthly-1bb1ba8d.js → BMI_GIRLS.zscore.monthly-7e3e01e4.js} +0 -0
  212. /package/build/esm/{BMI_GIRLS.zscore.weekly-8664fab7.js → BMI_GIRLS.zscore.weekly-6d7296d9.js} +0 -0
  213. /package/build/esm/{BMI_GIRLS.zscore.yearly-6ff04461.js → BMI_GIRLS.zscore.yearly-71669ef3.js} +0 -0
  214. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.monthly-9e11fba7.js → HEAD CIRCUM_BOYS.percentile.monthly-f5e2a111.js} +0 -0
  215. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.weekly-4d029ac6.js → HEAD CIRCUM_BOYS.percentile.weekly-0b46dcbe.js} +0 -0
  216. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.yearly-410671a3.js → HEAD CIRCUM_BOYS.percentile.yearly-75383413.js} +0 -0
  217. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.monthly-be0d10d9.js → HEAD CIRCUM_BOYS.zscore.monthly-3aa9ec12.js} +0 -0
  218. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.weekly-1809b3be.js → HEAD CIRCUM_BOYS.zscore.weekly-59f8a34f.js} +0 -0
  219. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.yearly-f7a542c7.js → HEAD CIRCUM_BOYS.zscore.yearly-f283a357.js} +0 -0
  220. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.monthly-d2a76ece.js → HEAD CIRCUM_GIRLS.percentile.monthly-80746e50.js} +0 -0
  221. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.weekly-8dc94aea.js → HEAD CIRCUM_GIRLS.percentile.weekly-824aaf4b.js} +0 -0
  222. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.yearly-e1493bb0.js → HEAD CIRCUM_GIRLS.percentile.yearly-cc53f716.js} +0 -0
  223. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.monthly-adba86ee.js → HEAD CIRCUM_GIRLS.zscore.monthly-75e69a5a.js} +0 -0
  224. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.weekly-162313ce.js → HEAD CIRCUM_GIRLS.zscore.weekly-2b5889e5.js} +0 -0
  225. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.yearly-ab73f82b.js → HEAD CIRCUM_GIRLS.zscore.yearly-2fed667c.js} +0 -0
  226. /package/build/esm/{HEIGHT_BOYS.percentile.monthly-57d344c4.js → HEIGHT_BOYS.percentile.monthly-c38e5875.js} +0 -0
  227. /package/build/esm/{HEIGHT_BOYS.percentile.weekly-9a9c9dd6.js → HEIGHT_BOYS.percentile.weekly-9ab4943e.js} +0 -0
  228. /package/build/esm/{HEIGHT_BOYS.percentile.yearly-96d23aae.js → HEIGHT_BOYS.percentile.yearly-28645f8b.js} +0 -0
  229. /package/build/esm/{HEIGHT_BOYS.zscore.monthly-1dcd600b.js → HEIGHT_BOYS.zscore.monthly-bdd00bec.js} +0 -0
  230. /package/build/esm/{HEIGHT_BOYS.zscore.weekly-a5e08e6b.js → HEIGHT_BOYS.zscore.weekly-8c4a7ac6.js} +0 -0
  231. /package/build/esm/{HEIGHT_BOYS.zscore.yearly-4a5f7787.js → HEIGHT_BOYS.zscore.yearly-862de2b0.js} +0 -0
  232. /package/build/esm/{HEIGHT_GIRLS.percentile.monthly-1bd5b5e5.js → HEIGHT_GIRLS.percentile.monthly-c79b69dd.js} +0 -0
  233. /package/build/esm/{HEIGHT_GIRLS.percentile.weekly-c1d22ae7.js → HEIGHT_GIRLS.percentile.weekly-e8ae31aa.js} +0 -0
  234. /package/build/esm/{HEIGHT_GIRLS.percentile.yearly-96e65776.js → HEIGHT_GIRLS.percentile.yearly-8704adbf.js} +0 -0
  235. /package/build/esm/{HEIGHT_GIRLS.zscore.monthly-e9f601b7.js → HEIGHT_GIRLS.zscore.monthly-b8ef49ea.js} +0 -0
  236. /package/build/esm/{HEIGHT_GIRLS.zscore.weekly-385e2467.js → HEIGHT_GIRLS.zscore.weekly-ebd27fcd.js} +0 -0
  237. /package/build/esm/{HEIGHT_GIRLS.zscore.yearly-21eea465.js → HEIGHT_GIRLS.zscore.yearly-39c673fe.js} +0 -0
  238. /package/build/esm/{Onboarding-82fe006a.js → Onboarding-b0d0d68e.js} +0 -0
  239. /package/build/esm/{Visible-ea837d9c.js → Visible-bec483b3.js} +0 -0
  240. /package/build/esm/{WEIGHT_BOYS.percentile.monthly-f8782488.js → WEIGHT_BOYS.percentile.monthly-7bed6c8e.js} +0 -0
  241. /package/build/esm/{WEIGHT_BOYS.percentile.weekly-c64eb2e5.js → WEIGHT_BOYS.percentile.weekly-c9c12539.js} +0 -0
  242. /package/build/esm/{WEIGHT_BOYS.percentile.yearly-e0eb69e0.js → WEIGHT_BOYS.percentile.yearly-eda62e55.js} +0 -0
  243. /package/build/esm/{WEIGHT_BOYS.zscore.monthly-c4b70e0c.js → WEIGHT_BOYS.zscore.monthly-ecf73450.js} +0 -0
  244. /package/build/esm/{WEIGHT_BOYS.zscore.weekly-73e87d36.js → WEIGHT_BOYS.zscore.weekly-e9432ca4.js} +0 -0
  245. /package/build/esm/{WEIGHT_BOYS.zscore.yearly-b3e40415.js → WEIGHT_BOYS.zscore.yearly-da2c3ecd.js} +0 -0
  246. /package/build/esm/{WEIGHT_GIRLS.percentile.monthly-737c40b6.js → WEIGHT_GIRLS.percentile.monthly-2caf902a.js} +0 -0
  247. /package/build/esm/{WEIGHT_GIRLS.percentile.weekly-eb29742d.js → WEIGHT_GIRLS.percentile.weekly-2579509a.js} +0 -0
  248. /package/build/esm/{WEIGHT_GIRLS.percentile.yearly-283125d2.js → WEIGHT_GIRLS.percentile.yearly-43743ee0.js} +0 -0
  249. /package/build/esm/{WEIGHT_GIRLS.zscore.monthly-29dc2544.js → WEIGHT_GIRLS.zscore.monthly-f637d0b6.js} +0 -0
  250. /package/build/esm/{WEIGHT_GIRLS.zscore.weekly-58ff6f4f.js → WEIGHT_GIRLS.zscore.weekly-a9c25991.js} +0 -0
  251. /package/build/esm/{WEIGHT_GIRLS.zscore.yearly-39db7b7b.js → WEIGHT_GIRLS.zscore.yearly-60394d48.js} +0 -0
  252. /package/build/esm/{constants-430e6a70.js → constants-e99b0a37.js} +0 -0
  253. /package/build/esm/{cookieHelper-ca7c9c03.js → cookieHelper-238e7958.js} +0 -0
  254. /package/build/esm/{dataTransform-eb227e06.js → dataTransform-202b5b34.js} +0 -0
  255. /package/build/esm/{index-725753ec.js → index-07300d64.js} +0 -0
  256. /package/build/esm/{isProduction-3f988439.js → isProduction-b84be401.js} +0 -0
  257. /package/build/esm/{localizeNumberFormat-2757b4e5.js → localizeNumberFormat-55d7f559.js} +0 -0
  258. /package/build/esm/{normalizeLink-fe194059.js → normalizeLink-a3c058f6.js} +0 -0
  259. /package/build/esm/{theme-d9e20331.js → theme-4d9b8565.js} +0 -0
  260. /package/build/esm/{translationsContext-1ad41874.js → translationsContext-a95596a3.js} +0 -0
  261. /package/build/esm/{tslib.es6-473ccb87.js → tslib.es6-43b52c70.js} +0 -0
  262. /package/build/esm/{types-23d48290.js → types-dd20cb68.js} +0 -0
  263. /package/build/esm/{useIsInit-128a3658.js → useIsInit-39a6f61e.js} +0 -0
  264. /package/build/esm/{useOutsideClick-9cc4571b.js → useOutsideClick-0e683dd8.js} +0 -0
  265. /package/build/esm/{useScrollbarSize-bc5bd840.js → useScrollbarSize-0c8e6ab6.js} +0 -0
  266. /package/build/esm/{useUniqueId-89d4734d.js → useUniqueId-f2d1092b.js} +0 -0
  267. /package/build/esm/{utils-edae1592.js → utils-0f812a66.js} +0 -0
  268. /package/build/{index-45076ff1.js → index-95ee8f16.js} +0 -0
  269. /package/build/{isProduction-97400a13.js → isProduction-439d4f86.js} +0 -0
  270. /package/build/{localizeNumberFormat-5cf1db73.js → localizeNumberFormat-87c02d49.js} +0 -0
  271. /package/build/{normalizeLink-07cc43a5.js → normalizeLink-8ccad0ef.js} +0 -0
  272. /package/build/{theme-15c2274e.js → theme-d476b1ab.js} +0 -0
  273. /package/build/{translationsContext-2ec169e7.js → translationsContext-8020e3fc.js} +0 -0
  274. /package/build/{tslib.es6-b2067099.js → tslib.es6-ffd4b7f9.js} +0 -0
  275. /package/build/{types-9e20c7f5.js → types-fa6f9121.js} +0 -0
  276. /package/build/{useIsInit-30d2f777.js → useIsInit-a55ca56c.js} +0 -0
  277. /package/build/{useOutsideClick-9b9afb41.js → useOutsideClick-660ad13a.js} +0 -0
  278. /package/build/{useScrollbarSize-c0f8aa26.js → useScrollbarSize-db9eadec.js} +0 -0
  279. /package/build/{useUniqueId-065bf36d.js → useUniqueId-b1b19b1c.js} +0 -0
  280. /package/build/{utils-2f188a97.js → utils-60e2d478.js} +0 -0
@@ -1,4 +1,4 @@
1
- import{M as e}from"./utils-edae1592.js";import t from"styled-components";import{t as i}from"./theme-d9e20331.js";import{Q as o}from"./index-4d579ab7.js";import a,{useMemo as r,createContext as n,useState as l,useEffect as s,memo as p,useContext as d}from"react";import{u as c}from"./useTranslations-e8922a21.js";import{CommonGAssets as m}from"./gAssets.js";import{a as g,_ as h}from"./tslib.es6-473ccb87.js";import{C as u,b,T as x,E as f,d as y}from"./index-a30cdd1b.js";import{g as v}from"./cookieHelper-ca7c9c03.js";import _ from"slugify";import w from"string-format";import{i as E}from"./isProduction-3f988439.js";import{g as T,a as O,b as A,c as I}from"./routing-f0e3f53b.js";import L from"dayjs";import $ from"dayjs/plugin/relativeTime";const S=t.div`
1
+ import{M as e}from"./utils-0f812a66.js";import t from"styled-components";import{t as i}from"./theme-4d9b8565.js";import{O as o}from"./index-17611c49.js";import a,{useMemo as r,createContext as n,useState as l,useEffect as s,memo as p,useContext as d}from"react";import{u as c}from"./useTranslations-fff3d6f3.js";import{CommonGAssets as m}from"./gAssets.js";import{a as g,_ as h}from"./tslib.es6-43b52c70.js";import{C as u,b,T as x,E as f,d as y}from"./index-ac45d84b.js";import{g as v}from"./cookieHelper-238e7958.js";import _ from"slugify";import w from"string-format";import{i as E}from"./isProduction-b84be401.js";import{g as T,a as O,b as A,c as I}from"./routing-afe38f18.js";import L from"dayjs";import $ from"dayjs/plugin/relativeTime";const S=t.div`
2
2
  position: fixed;
3
3
  left: 50%;
4
4
 
@@ -396,8 +396,6 @@ import{M as e}from"./utils-edae1592.js";import t from"styled-components";import{
396
396
  }
397
397
  }
398
398
  .login-btn {
399
- padding-left: 10px;
400
- padding-right: 10px;
401
399
  display: none;
402
400
  ${e.mbUp} {
403
401
  display: block;
@@ -473,7 +471,7 @@ import{M as e}from"./utils-edae1592.js";import t from"styled-components";import{
473
471
  * Copyright(c) 2012-2014 Roman Shtylman
474
472
  * Copyright(c) 2015 Douglas Christopher Wilson
475
473
  * MIT Licensed
476
- */;var be=function(e,t){if("string"!=typeof e)throw new TypeError("argument str must be a string");var i={},o=(t||{}).decode||ve,a=0;for(;a<e.length;){var r=e.indexOf("=",a);if(-1===r)break;var n=e.indexOf(";",a);if(-1===n)n=e.length;else if(n<r){a=e.lastIndexOf(";",r-1)+1;continue}var l=e.slice(a,r).trim();if(void 0===i[l]){var s=e.slice(r+1,n).trim();34===s.charCodeAt(0)&&(s=s.slice(1,-1)),i[l]=we(s,o)}a=n+1}return i},xe=function(e,t,i){var o=i||{},a=o.encode||_e;if("function"!=typeof a)throw new TypeError("option encode is invalid");if(!ye.test(e))throw new TypeError("argument name is invalid");var r=a(t);if(r&&!ye.test(r))throw new TypeError("argument val is invalid");var n=e+"="+r;if(null!=o.maxAge){var l=o.maxAge-0;if(isNaN(l)||!isFinite(l))throw new TypeError("option maxAge is invalid");n+="; Max-Age="+Math.floor(l)}if(o.domain){if(!ye.test(o.domain))throw new TypeError("option domain is invalid");n+="; Domain="+o.domain}if(o.path){if(!ye.test(o.path))throw new TypeError("option path is invalid");n+="; Path="+o.path}if(o.expires){var s=o.expires;if(!function(e){return"[object Date]"===fe.call(e)||e instanceof Date}(s)||isNaN(s.valueOf()))throw new TypeError("option expires is invalid");n+="; Expires="+s.toUTCString()}o.httpOnly&&(n+="; HttpOnly");o.secure&&(n+="; Secure");if(o.priority){switch("string"==typeof o.priority?o.priority.toLowerCase():o.priority){case"low":n+="; Priority=Low";break;case"medium":n+="; Priority=Medium";break;case"high":n+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(o.sameSite){switch("string"==typeof o.sameSite?o.sameSite.toLowerCase():o.sameSite){case!0:n+="; SameSite=Strict";break;case"lax":n+="; SameSite=Lax";break;case"strict":n+="; SameSite=Strict";break;case"none":n+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return n},fe=Object.prototype.toString,ye=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function ve(e){return-1!==e.indexOf("%")?decodeURIComponent(e):e}function _e(e){return encodeURIComponent(e)}function we(e,t){try{return t(e)}catch(t){return e}}var Ee={parse:be,serialize:xe};const Te={BASE_API_PATH:"/",PROFILE:"profile?website_url={website_url}",SEARCH_USER:"profile/search?website_url={website_url}&name={name}",FETCH_PREVIEW:"fetch/preview?website_url={website_url}",FETCH_POST_OR_TOPIC:"fetch/{slug}?website_url={website_url}&community_slug={communitySlug}",POST:{LIST:"post?website_url={website_url}&slug={slug}&pin={pin}&page={page}&community_id={communityId}&topic_id={topicId}&sort_by={sort}&id={id}",DETAIL_BY_ID_OR_SLUG:"post/{idSlug}?website_url={website_url}",CREATE:"post/create?website_url={website_url}",LIKE:"post/{id}/like?website_url={website_url}",DELETE:"post/{id}/delete?website_url={website_url}",REPORT:"post/{id}/report?website_url={website_url}",UPDATE:"post/{id}/update?website_url={website_url}",FOLLOW:"post/{id}/follow?website_url={website_url}",CREATE_ARTICLE_COMMENT:"article-comment/create?website_url={website_url}"},COMMENT:{LIST:"comment?website_url={website_url}&post_id={postId}&page={page}&sort_by={sort}&items_per_page={perPage}&_without_reply={withoutReply}",CREATE:"comment/create?website_url={website_url}",REPLY:"comment/reply?website_url={website_url}",DELETE:"comment/{id}/delete?website_url={website_url}",LIKE:"comment/{id}/like?website_url={website_url}",UNLIKE:"comment/{id}/unlike?website_url={website_url}",IMAGE_UPLOAD:"comment/image/upload?website_url={website_url}"},COMMUNITY:{LIST:"community?website_url={website_url}&page={page}",DETAIL_BY_ID_OR_SLUG:"community/{idSlug}?website_url={website_url}",JOIN:"community/join?website_url={website_url}",LEAVE:"community/leave?website_url={website_url}"},TOPIC:{LIST:"topic?website_url={website_url}&community_slug={communitySlug}&community_id={communityId}&page={page}",DETAIL_BY_ID_OR_SLUG:"topic/{idSlug}?website_url={website_url}&community_slug={communitySlug}&community_id={communityId}",HEALTH_TOOLS:"tools?topic_id={topicId}&website_url={website_url}",SUBOTS:"subots?topic_id={topicId}&website_url={website_url}",SUGGESTED_POSTS:"suggested-posts?topic_id={topicId}&website_url={website_url}&page={page}",JOIN:"topic/join?website_url={website_url}",LEAVE:"topic/leave?website_url={website_url}"},BOOKMARK:{LIST:"bookmark?user_id={userId}&website_url={website_url}",CREATE:"bookmark/create?website_url={website_url}",DELETE:"bookmark/delete?website_url={website_url}"},UPLOAD_IMAGE:"auth/comment/image/upload?website_url={website_url}",GET_DUE_DATE_INFO:"health-tools/due-date-calculator/info",USER:{DETAIL:"profile/user/detail?website_url={website_url}&user_id={id}",COUNT_TABS:"profile/user/counting?website_url={website_url}&user_id={id}&total_post={post}&total_comment={comment}&total_community={community}&total_reply={reply}&total_question={question}",LIST_POST:"profile/user/posts?website_url={website_url}&user_id={id}&is_anonymous={isAnonymous}&paging=none",LIST_QUESTION_NEED_REPLY:"questions/no-reply?website_url={website_url}",LIST_QUESTION:"question/{id}?website_url={website_url}&is_reply={isReply}&is_question={isQuestion}&is_ignore={isIgnore}&group_by={groupBy}",SKIP_QUESTION:"questions/ignore?website_url={website_url}&question_id={id}",LIST_ANSWERS:"replied/{id}?website_url={website_url}&paging=1&items_per_page={pageSize}"}},Oe={GET_DOCTOR_INFO:"api/doctors/{doctorId}?site={website_url}",GET_HOSPITAL_INFO:"api/hospital/branch/{hospital_branch_id}?site={website_url}"},Ae={BASE_API_PATH:"/",GET_SEARCH_ARTICLES:"search?s={keyword}&page={page}",GET_ALL_CATEGORIES:"categories?type=all",GET_HOMEPAGE_POSTS:"home/trending-post?type={type}",GET_HOMEPAGE_LATEST_POSTS:"articles?page=1&_islatest=1",GET_ARTICLE_DETAIL:"article/{slug}?skip_ids={skipIds}&_isrelated={isRelated}",GET_CATEGORY_DETAIL:"category/{slug}",GET_CATEGORY_OR_ARTICLE_DETAIL:"fetch/{fullSlug}",GET_PREVIEW_ARTICLE:"fetch/{fullSlug}?preview_nonce={nonce}&preview=true",GET_ARTICLE_OF_CATEGORY:"articles?category_id={categoryId}&page={currentPage}",GET_PAGE_STATIC:"page/{slug}",GET_ALL_HEALTH_TOOLS:"healthtools",GET_ALL_MARRYBABY_HEALTH_TOOLS:"health-tools",GET_HEALTH_TOOLS_BY_CATEGORY:"healthtools?_hasgroup=1",GET_AUTHOR:"author/{slug}",GET_ALL_EXPERTS:"experts",GET_ALL_EXPERTS_PAGING:"experts?page={page}",GET_EXPERT:"expert/{slug}",GET_EXPERT_POST:"expert/article?page={page}",POST_ARTICLE_FEEDBACK:"article/feedback/{id}",GET_AZ_DRUGS:"category/a-z/{category}",GET_HOMEPAGE_MEDICAL_REVIEWED:"home/medical-reviewed",GET_ARTICLES_BY_IDS:"articles?ids={ids}",GET_ARTICLE_OF_CATEGORY_NO_EXPLAINERS:"articles?category_id={categoryId}&page={currentPage}&skip_ids={ids}",GET_EXPERT_OF_CATEGORY:"category/expert/?id={id}",GET_DUE_DATE_INFO:"health-tools/due-date-calculator/info",GET_DUE_DATE_ALL_WEEKS:"health-tools/due-date-calculator/all",GET_DUE_DATE_SUGGESTED_ARTICLES:"health-tools/due-date-calculator/result?from_week={from}&to_week={to}",GET_PROFILE:"user/profile",GET_ADMIN_PROFILE:"GET_ADMIN_PROFILE",GET_FEATURE:"feature",POST_NEW_FEATURE:"feature/update",CREATE_BOOKMARK:"bookmark/create",DELETE_BOOKMARK:"bookmark/delete",DELETE_ALL_BOOKMARK:"bookmark/delete-all",GET_ALL_BOOKMARK:"bookmark",SSO_USER_PROFILE:"user",SSO_USER_BOOKMARKS:"user/bookmarks",SSO_USER_PASSWORD:"user/settings/password",SSO_USER_EMAIL:"user/settings/update-email",SSO_CLOSE_ACCOUNT:"user/settings/close-account",SSO_HELP:"user/settings/help",GET_HEALTH_TOOL_OVULATION_INFO:"health-tools/ovulation-calculator/info",GET_HEALTH_TOOL_OVULATION_SUGGESTED_ARTICLES:"health-tools/ovulation-calculator/result?method={method}",GET_HEALTH_TOOL_BMI_INFO:"health-tools/bmi-calculator/info",GET_HEALTH_TOOL_BMI_RESULT:"health-tools/bmi-calculator/result?gender={gender}&bmi={bmi}&age={age}",GET_HEALTH_TOOL_BMR_INFO:"health-tools/bmr-calculator/info",GET_HEALTH_TOOL_BMR_RESULT:"health-tools/bmr-calculator/result?kcals={kcals}&gender={gender}&age={age}",GET_HEALTH_TOOL_PWG_INFO:"health-tools/preweight-gain-calculator/info",GET_HEALTH_TOOL_THR_INFO:"health-tools/target-heart-rate/info",GET_HEALTH_TOOL_BABY_GROWTH_INFO:"health-tools/baby-growth-tracking/info",POST_UPDATE_LOCATION:"tracking/geo/",GET_SIDIS_DUE_DATE:"frontend/tools/due_date",GET_SIDIS_OVULATION:"frontend/tools/ovulation",GET_SIDIS_BMI:"frontend/tools/bmi",GET_SIDIS_BMR:"frontend/tools/bmr",POST_LOGOUT:"user/logout",OVULATION_CREATE_EVENT:"ovulation/event?method={method}&day={day}&cycle={cycle}&period={period}&token={token}&user_id={user_id}",GET_ALL_SPOTLIGHT:"spotlights?per_page={perPage}&order_by={orderBy}",SSO_UPDATE_FIRST_TIME_BOOKMARK:"bookmark/update-first-time",POST_COMMENT_NOTIFICATION:"comment/notification",GET_ABOUT_US_DATA:"about",POST_LEAD_IMPRESSION:"campaign/{campaignCode}/impression",POST_LEAD_POPUP_EXIT:"campaign/{campaignCode}/popup_exit",POST_LEAD_LEAD:"campaign/{campaignCode}/lead",POST_SSO_VERIFY_TOKEN:"verify-id-token",GET_LANDING_PAGE_FIRST_NODE:"landing_page/bot",GET_LANDING_PAGE_NEXT_NODE:"landing_page/messages",POST_LANDING_PAGE_IMPRESSION:"landing_page/impressions",POST_LANDING_PAGE_CLICK:"landing_page/clicks",FETCH_URL_DATA:"preview",GET_SPOTLIGHT_LANDING:"spotlight/{slug}",GET_FOOTER_INFO:"footer",CHECK_SSO_EMAIL:"member/check-email",GET_HOMEPAGE_SITEWIDE_BANNER:"home/sitewide-banner",GET_DYNAMIC_FOOTER:"menu/footer",GET_EXPERTS:"experts?page={page}&number={perPage}&s={search}",GET_EXPERT_BY_ID:"expert/{id}"},Ie={SEARCH_USER:"admin/profile/search?website_url={website_url}&name={name}",COMMENT:{IMAGE_UPLOAD:"admin/comment/image/upload?website_url={website_url}"}},Le={locale:"vi-VN",env:{isMarryBaby:!1,togetherBasePath:"/community"},router:{basePath:"",asPath:"/"}},$e=n({data:Le,action:{pushNotifications:e=>e,sanitizeFunction:e=>e}});let Se=Le;const ke=({locale:e="vi-VN",children:t,userInfo:i,router:o,env:r={isMarryBaby:!1,togetherBasePath:"/community"},sanitizeFunction:n=(e=>e),pushNotifications:p=(()=>!1)})=>{const[d,c]=l();return Se={userInfo:i,locale:e,togetherUserId:d,router:o,env:r},s((()=>{(null==i?void 0:i.id)&&Ve(Ue(Te.PROFILE,{_locale:e}),"GET").then((e=>{var t;c(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.id)}))}),[null==i?void 0:i.id]),a.createElement($e.Provider,{value:{data:{userInfo:i,locale:e,togetherUserId:d,router:o,env:r},action:{pushNotifications:p,sanitizeFunction:n}}},t)},Re={"vi-VN":"hellobacsi.com","id-ID":"hellosehat.com","ms-MY":"hellodoktor.com","km-KH":"hellokrupet.com","en-PH":"hellodoctor.com.ph","th-TH":"hellokhunmor.com","my-MM":"hellosayarwon.com","zh-TW":"helloyishi.com.tw","hi-IN":"helloswasthya.com"},De={"vi-VN":"marrybaby.vn"},Pe=process.env.NEXT_PUBLIC_DEPLOY_LOCALE||"vi-VN",Ce=e=>{const{env:{isMarryBaby:t}}=Se;return`https://${t?De[e]:Re[e]}`},Ne=e=>{const t=e.indexOf("?");return t>=0?e.slice(0,t+1)+e.slice(t+1).replace(/[^=&]+=(&|$)/g,"").replace(/&$/,""):e},Be=e=>{const{env:{isMarryBaby:t}}=Se;if("undefined"!=typeof window)return window.location.origin;const i="staging"===process.env.NEXT_PUBLIC_DEPLOY_ENV;return"development"===process.env.NEXT_PUBLIC_DEPLOY_ENV?"http://localhost:3000":`https://${i?t?"fe.":"discover.":t?"www.":""}${Re[e]}`},Ue=(e,t,i)=>{let o="";i&&(o=Object.keys(i).map((e=>e+"="+i[e])).join("&"));const{togetherBaseApiUrl:a=""}=(null==Se?void 0:Se.env)||{};let r=w(e,Object.assign(Object.assign({},(null==t?void 0:t._locale)?{website_url:Ce(String(t._locale))}:{}),t));return r+=`${r.includes("?")?"&":"?"}${o}`,a+"api/v1/"+Ne(r)},Ge=(e,t,i)=>{const{discoverBaseApiUrl:o="",discoverBaseProdApiUrl:a=""}=(null==Se?void 0:Se.env)||{};return(!E&&i?a:o)+"wp-json/api/"+Ne(w(e,Object.assign({},t)))},Me=(e,t,i)=>{const{marryBabyApiUrl:o="",marryBabyProdApiUrl:a=""}=(null==Se?void 0:Se.env)||{};return(i&&!E?a:o)+"wp-json/api/"+Ne(w(e,Object.assign({},t)))},He=(e,t)=>{const{careBaseApiUrl:i=""}=(null==Se?void 0:Se.env)||{};return(i||"https://service-health-care.hellohealthgroup.com/")+Ne(w(e,Object.assign({},t)))},ze=e=>((null==e?void 0:e.data)&&(e.data instanceof FormData?e.body=e.data:"object"==typeof e.data&&(e.body=JSON.stringify(e.data)),delete e.data),e),je=(e,t,i,o=!1)=>g(void 0,void 0,void 0,(function*(){var a,r,n,l;try{const a=yield fetch(o?e:(l=e,encodeURI(l).replace(/%5B/g,"[").replace(/%5D/g,"]")),Object.assign(Object.assign({method:t},ze(i)),{headers:Object.assign({},null==i?void 0:i.headers)})).then((e=>e.json()));if(a)return a}catch(t){return console.log(t),console.log({url:e,status:null===(a=null==t?void 0:t.response)||void 0===a?void 0:a.status,statusText:null===(r=null==t?void 0:t.response)||void 0===r?void 0:r.statusText}),(null===(n=null==t?void 0:t.response)||void 0===n?void 0:n.data)||null}return null})),Fe=(e,t="GET",i,o)=>g(void 0,void 0,void 0,(function*(){var a,r,n,l,s,p;try{const l="string"==typeof e?e:e.url,s="string"==typeof e?e:e.backupUrl,p=Ee.parse(o||""),d=p[B]||v(B);if(!d||!d.length)return je(s||l,t,i);try{const e=yield fetch(l,Object.assign(Object.assign({method:t},ze(i)),{headers:Object.assign({Authorization:"Bearer "+d},null==i?void 0:i.headers)})).then((e=>e.json()));if(null===(a=null==e?void 0:e.messages)||void 0===a?void 0:a.find((e=>"Unauthenticated"===(null==e?void 0:e.toLowerCase()))))return je(s||l,t,i);if(e)return e}catch(e){return console.log({status:null===(r=null==e?void 0:e.response)||void 0===r?void 0:r.status,statusText:null===(n=null==e?void 0:e.response)||void 0===n?void 0:n.statusText}),je(s||l,t,i)}}catch(e){return console.log({status:null===(l=null==e?void 0:e.response)||void 0===l?void 0:l.status,statusText:null===(s=null==e?void 0:e.response)||void 0===s?void 0:s.statusText}),(null===(p=null==e?void 0:e.response)||void 0===p?void 0:p.data)||null}return null})),Ve=(e,t,i,o)=>g(void 0,void 0,void 0,(function*(){try{const a=Ee.parse(o||""),r=a[B]||v(B);if(r&&r.length){const o=yield fetch(e,Object.assign(Object.assign({method:t},ze(i)),{headers:Object.assign({Authorization:"Bearer "+r},null==i?void 0:i.headers)})).then((e=>e.json()));if(o)return o}}catch(e){return null}return null})),Ye=(e,t,i,o)=>g(void 0,void 0,void 0,(function*(){try{const a=Ee.parse(o||""),r=a[U]||v(U);if(r&&r.length){const o=yield fetch(e,Object.assign(Object.assign({method:t},ze(i)),{headers:Object.assign({Authorization:"Bearer "+r},null==i?void 0:i.headers)})).then((e=>e.json()));if(o)return o}}catch(e){return null}return null}));function Ke(e,t,i){const o=new RegExp("([?&])"+t+"=.*?(&|$)","i"),a=-1!==e.indexOf("?")?"&":"?";return e.match(o)?e.replace(o,"$1"+t+"="+i+"$2"):e+a+t+"="+i}const We=(e,t,i="/community")=>{const o=e||("undefined"!=typeof window?window.location.href:"/");let a="undefined"!=typeof window?window.location.origin:"";a||e&&(e.startsWith("http://")||e.startsWith("https://"))&&(a=e.split("/").slice(0,3).join("/"));return((e,t)=>{const{publicSSO:i}=Se.env,o=e||window.location.href;return t&&Object.keys(t).map((e=>{Ke(o,e,t[e])})),Ke(o,"source","communities"),i?`${i}?returnUrl=${encodeURIComponent(o.toString())}`:o})(`${a}${i}/on-boarding?return=${encodeURIComponent(o)}`,t)},Xe=(e,t,i,o)=>i&&t?`${i}-${t}`:`${_(e||"",{lower:!0,locale:o||Pe})}-${t}`,qe=({name:e,id:t,locale:i})=>{var o;return`/care/${null===(o=z[i||"vi-VN"])||void 0===o?void 0:o.DOCTOR}/${Xe(e,t)}`},Ze=({name:e,id:t,slug:i,locale:o})=>{var a;return`/care/${null===(a=z[o||"vi-VN"])||void 0===a?void 0:a.HOSPITAL}/${Xe(e,t,i)}`},Je=a.createContext({}),Qe=e=>{var{children:t}=e,i=h(e,["children"]);const[o,n]=a.useState((()=>i.currentUrl||`https://${"marryBaby"===i.siteType?De[i.locale||"en-PH"]:y[i.locale||"en-PH"]}${"together"===i.projectType?"/community":"ecom"===i.projectType?"/ecom":"care"===i.projectType?"/care":""}/`));s((()=>{const e=()=>{n(window.location.href)};return window.addEventListener("popstate",e),e(),()=>{window.removeEventListener("popstate",e)}}),[]);const l=(({locale:e,projectType:t,isMobile:i,siteType:o})=>r((()=>{const a=!(!i&&"profile"===t),r="discover"===t||"marryBaby"===t||"profile"===t&&"marryBaby"===o,n="marryBaby"!==o&&"marryBaby"!==t&&u.includes(e),l="marryBaby"!==t&&"discover"===t&&"marryBaby"!==o&&b.includes(e),s="marryBaby"===t||x.includes(e),p="marryBaby"!==o&&f.includes(e),d="ecom"===t;let c=T(e,"marryBaby"===o);"undefined"!=typeof window&&(c.includes("//id.")&&(c=c.replace("id.","")),c.includes("//staging-id.")&&(c=c.replace("staging-id.","discover.")));return{enableProfileNavigatorMenu:a,enableSearchBar:r,enableNavCare:n,enableNavCareBooking:l,enableNavTogether:s,enableNavEcom:p,enableProfileEcom:d,enableProfileMyHealth:!0,enableNavDiscover:!0,enableNavHealthTools:!0,enableProfileMySaved:!0,statics:{HOME_PAGE_URL:c,CARE_URL_FE:`${c}/care`,TOGETHER_URL_FE:`${c}/community`,SSO_URL:O(e,"marryBaby"===o),TOGETHER_API:A(),DISCOVER_API:I(e)}}}),[e,t,i]))({locale:i.locale,projectType:i.projectType,isMobile:i.isMobile,siteType:i.siteType});return a.createElement(Je.Provider,{value:Object.assign(Object.assign({},i),{configs:Object.assign(Object.assign({},l),i.configs),currentUrl:i.currentUrl||o})},t)},et=t.div`
474
+ */;var be=function(e,t){if("string"!=typeof e)throw new TypeError("argument str must be a string");var i={},o=(t||{}).decode||ve,a=0;for(;a<e.length;){var r=e.indexOf("=",a);if(-1===r)break;var n=e.indexOf(";",a);if(-1===n)n=e.length;else if(n<r){a=e.lastIndexOf(";",r-1)+1;continue}var l=e.slice(a,r).trim();if(void 0===i[l]){var s=e.slice(r+1,n).trim();34===s.charCodeAt(0)&&(s=s.slice(1,-1)),i[l]=we(s,o)}a=n+1}return i},xe=function(e,t,i){var o=i||{},a=o.encode||_e;if("function"!=typeof a)throw new TypeError("option encode is invalid");if(!ye.test(e))throw new TypeError("argument name is invalid");var r=a(t);if(r&&!ye.test(r))throw new TypeError("argument val is invalid");var n=e+"="+r;if(null!=o.maxAge){var l=o.maxAge-0;if(isNaN(l)||!isFinite(l))throw new TypeError("option maxAge is invalid");n+="; Max-Age="+Math.floor(l)}if(o.domain){if(!ye.test(o.domain))throw new TypeError("option domain is invalid");n+="; Domain="+o.domain}if(o.path){if(!ye.test(o.path))throw new TypeError("option path is invalid");n+="; Path="+o.path}if(o.expires){var s=o.expires;if(!function(e){return"[object Date]"===fe.call(e)||e instanceof Date}(s)||isNaN(s.valueOf()))throw new TypeError("option expires is invalid");n+="; Expires="+s.toUTCString()}o.httpOnly&&(n+="; HttpOnly");o.secure&&(n+="; Secure");if(o.priority){switch("string"==typeof o.priority?o.priority.toLowerCase():o.priority){case"low":n+="; Priority=Low";break;case"medium":n+="; Priority=Medium";break;case"high":n+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(o.sameSite){switch("string"==typeof o.sameSite?o.sameSite.toLowerCase():o.sameSite){case!0:n+="; SameSite=Strict";break;case"lax":n+="; SameSite=Lax";break;case"strict":n+="; SameSite=Strict";break;case"none":n+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return n},fe=Object.prototype.toString,ye=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function ve(e){return-1!==e.indexOf("%")?decodeURIComponent(e):e}function _e(e){return encodeURIComponent(e)}function we(e,t){try{return t(e)}catch(t){return e}}var Ee={parse:be,serialize:xe};const Te={BASE_API_PATH:"/",PROFILE:"profile?website_url={website_url}",SEARCH_USER:"profile/search?website_url={website_url}&name={name}",FETCH_PREVIEW:"fetch/preview?website_url={website_url}",FETCH_POST_OR_TOPIC:"fetch/{slug}?website_url={website_url}&community_slug={communitySlug}",POST:{LIST:"post?website_url={website_url}&slug={slug}&pin={pin}&page={page}&community_id={communityId}&topic_id={topicId}&sort_by={sort}&id={id}",DETAIL_BY_ID_OR_SLUG:"post/{idSlug}?website_url={website_url}",CREATE:"post/create?website_url={website_url}",LIKE:"post/{id}/like?website_url={website_url}",DELETE:"post/{id}/delete?website_url={website_url}",REPORT:"post/{id}/report?website_url={website_url}",UPDATE:"post/{id}/update?website_url={website_url}",FOLLOW:"post/{id}/follow?website_url={website_url}",CREATE_ARTICLE_COMMENT:"article-comment/create?website_url={website_url}"},COMMENT:{LIST:"comment?website_url={website_url}&post_id={postId}&page={page}&sort_by={sort}&items_per_page={perPage}&_without_reply={withoutReply}",CREATE:"comment/create?website_url={website_url}",REPLY:"comment/reply?website_url={website_url}",DELETE:"comment/{id}/delete?website_url={website_url}",LIKE:"comment/{id}/like?website_url={website_url}",UNLIKE:"comment/{id}/unlike?website_url={website_url}",IMAGE_UPLOAD:"comment/image/upload?website_url={website_url}"},COMMUNITY:{LIST:"community?website_url={website_url}&page={page}",DETAIL_BY_ID_OR_SLUG:"community/{idSlug}?website_url={website_url}",JOIN:"community/join?website_url={website_url}",LEAVE:"community/leave?website_url={website_url}"},TOPIC:{LIST:"topic?website_url={website_url}&community_slug={communitySlug}&community_id={communityId}&page={page}",DETAIL_BY_ID_OR_SLUG:"topic/{idSlug}?website_url={website_url}&community_slug={communitySlug}&community_id={communityId}",HEALTH_TOOLS:"tools?topic_id={topicId}&website_url={website_url}",SUBOTS:"subots?topic_id={topicId}&website_url={website_url}",SUGGESTED_POSTS:"suggested-posts?topic_id={topicId}&website_url={website_url}&page={page}",JOIN:"topic/join?website_url={website_url}",LEAVE:"topic/leave?website_url={website_url}"},BOOKMARK:{LIST:"bookmark?user_id={userId}&website_url={website_url}",CREATE:"bookmark/create?website_url={website_url}",DELETE:"bookmark/delete?website_url={website_url}"},UPLOAD_IMAGE:"auth/comment/image/upload?website_url={website_url}",GET_DUE_DATE_INFO:"health-tools/due-date-calculator/info",USER:{DETAIL:"profile/user/detail?website_url={website_url}&user_id={id}",COUNT_TABS:"profile/user/counting?website_url={website_url}&user_id={id}&total_post={post}&total_comment={comment}&total_community={community}&total_reply={reply}&total_question={question}",LIST_POST:"profile/user/posts?website_url={website_url}&user_id={id}&is_anonymous={isAnonymous}&paging=none",LIST_QUESTION_NEED_REPLY:"questions/no-reply?website_url={website_url}",LIST_QUESTION:"question/{id}?website_url={website_url}&is_reply={isReply}&is_question={isQuestion}&is_ignore={isIgnore}&group_by={groupBy}",SKIP_QUESTION:"questions/ignore?website_url={website_url}&question_id={id}",LIST_ANSWERS:"replied/{id}?website_url={website_url}&paging=1&items_per_page={pageSize}"}},Oe={GET_DOCTOR_INFO:"api/doctors/{doctorId}?site={website_url}",GET_HOSPITAL_INFO:"api/hospital/branch/{hospital_branch_id}?site={website_url}"},Ae={BASE_API_PATH:"/",GET_SEARCH_ARTICLES:"search?s={keyword}&page={page}",GET_ALL_CATEGORIES:"categories?type=all",GET_HOMEPAGE_POSTS:"home/trending-post?type={type}",GET_HOMEPAGE_LATEST_POSTS:"articles?page=1&_islatest=1",GET_ARTICLE_DETAIL:"article/{slug}?skip_ids={skipIds}&_isrelated={isRelated}",GET_CATEGORY_DETAIL:"category/{slug}",GET_CATEGORY_OR_ARTICLE_DETAIL:"fetch/{fullSlug}",GET_PREVIEW_ARTICLE:"fetch/{fullSlug}?preview_nonce={nonce}&preview=true",GET_ARTICLE_OF_CATEGORY:"articles?category_id={categoryId}&page={currentPage}",GET_PAGE_STATIC:"page/{slug}",GET_ALL_HEALTH_TOOLS:"healthtools",GET_ALL_MARRYBABY_HEALTH_TOOLS:"health-tools",GET_HEALTH_TOOLS_BY_CATEGORY:"healthtools?_hasgroup=1",GET_AUTHOR:"author/{slug}",GET_ALL_EXPERTS:"experts",GET_ALL_EXPERTS_PAGING:"experts?page={page}",GET_EXPERT:"expert/{slug}",GET_EXPERT_POST:"expert/article?page={page}",POST_ARTICLE_FEEDBACK:"article/feedback/{id}",GET_AZ_DRUGS:"category/a-z/{category}",GET_HOMEPAGE_MEDICAL_REVIEWED:"home/medical-reviewed",GET_ARTICLES_BY_IDS:"articles?ids={ids}",GET_ARTICLE_OF_CATEGORY_NO_EXPLAINERS:"articles?category_id={categoryId}&page={currentPage}&skip_ids={ids}",GET_EXPERT_OF_CATEGORY:"category/expert/?id={id}",GET_DUE_DATE_INFO:"health-tools/due-date-calculator/info",GET_DUE_DATE_ALL_WEEKS:"health-tools/due-date-calculator/all",GET_DUE_DATE_SUGGESTED_ARTICLES:"health-tools/due-date-calculator/result?from_week={from}&to_week={to}",GET_PROFILE:"user/profile",GET_ADMIN_PROFILE:"GET_ADMIN_PROFILE",GET_FEATURE:"feature",POST_NEW_FEATURE:"feature/update",CREATE_BOOKMARK:"bookmark/create",DELETE_BOOKMARK:"bookmark/delete",DELETE_ALL_BOOKMARK:"bookmark/delete-all",GET_ALL_BOOKMARK:"bookmark",SSO_USER_PROFILE:"user",SSO_USER_BOOKMARKS:"user/bookmarks",SSO_USER_PASSWORD:"user/settings/password",SSO_USER_EMAIL:"user/settings/update-email",SSO_CLOSE_ACCOUNT:"user/settings/close-account",SSO_HELP:"user/settings/help",GET_HEALTH_TOOL_OVULATION_INFO:"health-tools/ovulation-calculator/info",GET_HEALTH_TOOL_OVULATION_SUGGESTED_ARTICLES:"health-tools/ovulation-calculator/result?method={method}",GET_HEALTH_TOOL_BMI_INFO:"health-tools/bmi-calculator/info",GET_HEALTH_TOOL_BMI_RESULT:"health-tools/bmi-calculator/result?gender={gender}&bmi={bmi}&age={age}",GET_HEALTH_TOOL_BMR_INFO:"health-tools/bmr-calculator/info",GET_HEALTH_TOOL_BMR_RESULT:"health-tools/bmr-calculator/result?kcals={kcals}&gender={gender}&age={age}",GET_HEALTH_TOOL_PWG_INFO:"health-tools/preweight-gain-calculator/info",GET_HEALTH_TOOL_THR_INFO:"health-tools/target-heart-rate/info",GET_HEALTH_TOOL_BABY_GROWTH_INFO:"health-tools/baby-growth-tracking/info",POST_UPDATE_LOCATION:"tracking/geo/",GET_SIDIS_DUE_DATE:"frontend/tools/due_date",GET_SIDIS_OVULATION:"frontend/tools/ovulation",GET_SIDIS_BMI:"frontend/tools/bmi",GET_SIDIS_BMR:"frontend/tools/bmr",POST_LOGOUT:"user/logout",OVULATION_CREATE_EVENT:"ovulation/event?method={method}&day={day}&cycle={cycle}&period={period}&token={token}&user_id={user_id}",GET_ALL_SPOTLIGHT:"spotlights?per_page={perPage}&order_by={orderBy}",SSO_UPDATE_FIRST_TIME_BOOKMARK:"bookmark/update-first-time",POST_COMMENT_NOTIFICATION:"comment/notification",GET_ABOUT_US_DATA:"about",POST_LEAD_IMPRESSION:"campaign/{campaignCode}/impression",POST_LEAD_POPUP_EXIT:"campaign/{campaignCode}/popup_exit",POST_LEAD_LEAD:"campaign/{campaignCode}/lead",POST_SSO_VERIFY_TOKEN:"verify-id-token",GET_LANDING_PAGE_FIRST_NODE:"landing_page/bot",GET_LANDING_PAGE_NEXT_NODE:"landing_page/messages",POST_LANDING_PAGE_IMPRESSION:"landing_page/impressions",POST_LANDING_PAGE_CLICK:"landing_page/clicks",FETCH_URL_DATA:"preview",GET_SPOTLIGHT_LANDING:"spotlight/{slug}",GET_FOOTER_INFO:"footer",CHECK_SSO_EMAIL:"member/check-email",GET_HOMEPAGE_SITEWIDE_BANNER:"home/sitewide-banner",GET_DYNAMIC_FOOTER:"menu/footer",GET_EXPERTS:"experts?page={page}&number={perPage}&s={search}",GET_EXPERT_BY_ID:"expert/{id}"},Ie={SEARCH_USER:"admin/profile/search?website_url={website_url}&name={name}",COMMENT:{IMAGE_UPLOAD:"admin/comment/image/upload?website_url={website_url}"}},Le={locale:"vi-VN",env:{isMarryBaby:!1,togetherBasePath:"/community"},router:{basePath:"",asPath:"/"}},$e=n({data:Le,action:{pushNotifications:e=>e,sanitizeFunction:e=>e}});let Se=Le;const ke=({locale:e="vi-VN",children:t,userInfo:i,router:o,env:r={isMarryBaby:!1,togetherBasePath:"/community"},sanitizeFunction:n=(e=>e),pushNotifications:p=(()=>!1)})=>{const[d,c]=l();return Se={userInfo:i,locale:e,togetherUserId:d,router:o,env:r},s((()=>{(null==i?void 0:i.id)&&Ve(Ue(Te.PROFILE,{_locale:e}),"GET").then((e=>{var t;c(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.id)}))}),[null==i?void 0:i.id]),a.createElement($e.Provider,{value:{data:{userInfo:i,locale:e,togetherUserId:d,router:o,env:r},action:{pushNotifications:p,sanitizeFunction:n}}},t)},Re={"vi-VN":"hellobacsi.com","id-ID":"hellosehat.com","ms-MY":"hellodoktor.com","km-KH":"hellokrupet.com","en-PH":"hellodoctor.com.ph","th-TH":"hellokhunmor.com","my-MM":"hellosayarwon.com","zh-TW":"helloyishi.com.tw","hi-IN":"helloswasthya.com"},De={"vi-VN":"marrybaby.vn"},Pe=process.env.NEXT_PUBLIC_DEPLOY_LOCALE||"vi-VN",Ce=e=>{const{env:{isMarryBaby:t}}=Se;return`https://${t?De[e]:Re[e]}`},Ne=e=>{const t=e.indexOf("?");return t>=0?e.slice(0,t+1)+e.slice(t+1).replace(/[^=&]+=(&|$)/g,"").replace(/&$/,""):e},Be=e=>{const{env:{isMarryBaby:t}}=Se;if("undefined"!=typeof window)return window.location.origin;const i="staging"===process.env.NEXT_PUBLIC_DEPLOY_ENV;return"development"===process.env.NEXT_PUBLIC_DEPLOY_ENV?"http://localhost:3000":`https://${i?t?"fe.":"discover.":t?"www.":""}${Re[e]}`},Ue=(e,t,i)=>{let o="";i&&(o=Object.keys(i).map((e=>e+"="+i[e])).join("&"));const{togetherBaseApiUrl:a=""}=(null==Se?void 0:Se.env)||{};let r=w(e,Object.assign(Object.assign({},(null==t?void 0:t._locale)?{website_url:Ce(String(t._locale))}:{}),t));return r+=`${r.includes("?")?"&":"?"}${o}`,a+"api/v1/"+Ne(r)},Ge=(e,t,i)=>{const{discoverBaseApiUrl:o="",discoverBaseProdApiUrl:a=""}=(null==Se?void 0:Se.env)||{};return(!E&&i?a:o)+"wp-json/api/"+Ne(w(e,Object.assign({},t)))},Me=(e,t,i)=>{const{marryBabyApiUrl:o="",marryBabyProdApiUrl:a=""}=(null==Se?void 0:Se.env)||{};return(i&&!E?a:o)+"wp-json/api/"+Ne(w(e,Object.assign({},t)))},He=(e,t)=>{const{careBaseApiUrl:i=""}=(null==Se?void 0:Se.env)||{};return(i||"https://service-health-care.hellohealthgroup.com/")+Ne(w(e,Object.assign({},t)))},ze=e=>((null==e?void 0:e.data)&&(e.data instanceof FormData?e.body=e.data:"object"==typeof e.data&&(e.body=JSON.stringify(e.data)),delete e.data),e),je=(e,t,i,o=!1)=>g(void 0,void 0,void 0,(function*(){var a,r,n,l;try{const a=yield fetch(o?e:(l=e,encodeURI(l).replace(/%5B/g,"[").replace(/%5D/g,"]")),Object.assign(Object.assign({method:t},ze(i)),{headers:Object.assign({},null==i?void 0:i.headers)})).then((e=>e.json()));if(a)return a}catch(t){return console.log(t),console.log({url:e,status:null===(a=null==t?void 0:t.response)||void 0===a?void 0:a.status,statusText:null===(r=null==t?void 0:t.response)||void 0===r?void 0:r.statusText}),(null===(n=null==t?void 0:t.response)||void 0===n?void 0:n.data)||null}return null})),Fe=(e,t="GET",i,o)=>g(void 0,void 0,void 0,(function*(){var a,r,n,l,s,p;try{const l="string"==typeof e?e:e.url,s="string"==typeof e?e:e.backupUrl,p=Ee.parse(o||""),d=p[B]||v(B);if(!d||!d.length)return je(s||l,t,i);try{const e=yield fetch(l,Object.assign(Object.assign({method:t},ze(i)),{headers:Object.assign({Authorization:"Bearer "+d},null==i?void 0:i.headers)})).then((e=>e.json()));if(null===(a=null==e?void 0:e.messages)||void 0===a?void 0:a.find((e=>"Unauthenticated"===(null==e?void 0:e.toLowerCase()))))return je(s||l,t,i);if(e)return e}catch(e){return console.log({status:null===(r=null==e?void 0:e.response)||void 0===r?void 0:r.status,statusText:null===(n=null==e?void 0:e.response)||void 0===n?void 0:n.statusText}),je(s||l,t,i)}}catch(e){return console.log({status:null===(l=null==e?void 0:e.response)||void 0===l?void 0:l.status,statusText:null===(s=null==e?void 0:e.response)||void 0===s?void 0:s.statusText}),(null===(p=null==e?void 0:e.response)||void 0===p?void 0:p.data)||null}return null})),Ve=(e,t,i,o)=>g(void 0,void 0,void 0,(function*(){try{const a=Ee.parse(o||""),r=a[B]||v(B);if(r&&r.length){const o=yield fetch(e,Object.assign(Object.assign({method:t},ze(i)),{headers:Object.assign({Authorization:"Bearer "+r},null==i?void 0:i.headers)})).then((e=>e.json()));if(o)return o}}catch(e){return null}return null})),Ye=(e,t,i,o)=>g(void 0,void 0,void 0,(function*(){try{const a=Ee.parse(o||""),r=a[U]||v(U);if(r&&r.length){const o=yield fetch(e,Object.assign(Object.assign({method:t},ze(i)),{headers:Object.assign({Authorization:"Bearer "+r},null==i?void 0:i.headers)})).then((e=>e.json()));if(o)return o}}catch(e){return null}return null}));function Ke(e,t,i){const o=new RegExp("([?&])"+t+"=.*?(&|$)","i"),a=-1!==e.indexOf("?")?"&":"?";return e.match(o)?e.replace(o,"$1"+t+"="+i+"$2"):e+a+t+"="+i}const We=(e,t,i="/community")=>{const o=e||("undefined"!=typeof window?window.location.href:"/");let a="undefined"!=typeof window?window.location.origin:"";a||e&&(e.startsWith("http://")||e.startsWith("https://"))&&(a=e.split("/").slice(0,3).join("/"));return((e,t)=>{const{publicSSO:i}=Se.env,o=e||window.location.href;return t&&Object.keys(t).map((e=>{Ke(o,e,t[e])})),Ke(o,"source","communities"),i?`${i}?returnUrl=${encodeURIComponent(o.toString())}`:o})(`${a}${i}/on-boarding?return=${encodeURIComponent(o)}`,t)},Xe=(e,t,i,o)=>i&&t?`${i}-${t}`:`${_(e||"",{lower:!0,locale:o||Pe})}-${t}`,qe=({name:e,id:t,locale:i})=>{var o;return`/care/${null===(o=z[i||"vi-VN"])||void 0===o?void 0:o.DOCTOR}/${Xe(e,t)}`},Ze=({name:e,id:t,slug:i,locale:o})=>{var a;return`/care/${null===(a=z[o||"vi-VN"])||void 0===a?void 0:a.HOSPITAL}/${Xe(e,t,i)}`},Je=a.createContext({}),Qe=e=>{var{children:t}=e,i=h(e,["children"]);const[o,n]=a.useState((()=>i.currentUrl||`https://${"marryBaby"===i.siteType?De[i.locale||"en-PH"]:y[i.locale||"en-PH"]}${"together"===i.projectType?"/community":"ecom"===i.projectType?"/ecom":"care"===i.projectType?"/care":""}/`));s((()=>{const e=()=>{n(window.location.href)};return window.addEventListener("popstate",e),e(),()=>{window.removeEventListener("popstate",e)}}),[]);const l=(({locale:e,projectType:t,isMobile:i,siteType:o,enableBookingBtn:a})=>r((()=>{const r=!(!i&&"profile"===t),n="discover"===t||"marryBaby"===t||"profile"===t&&"marryBaby"===o,l="marryBaby"!==o&&"marryBaby"!==t&&u.includes(e),s=a&&"marryBaby"!==t&&"discover"===t&&"marryBaby"!==o&&b.includes(e),p="marryBaby"===t||x.includes(e),d="marryBaby"!==o&&f.includes(e),c="ecom"===t;let m=T(e,"marryBaby"===o);"undefined"!=typeof window&&(m.includes("//id.")&&(m=m.replace("id.","")),m.includes("//staging-id.")&&(m=m.replace("staging-id.","discover.")));return{enableProfileNavigatorMenu:r,enableSearchBar:n,enableNavCare:l,enableNavCareBooking:s,enableNavTogether:p,enableNavEcom:d,enableProfileEcom:c,enableProfileMyHealth:!0,enableNavDiscover:!0,enableNavHealthTools:!0,enableProfileMySaved:!0,statics:{HOME_PAGE_URL:m,CARE_URL_FE:`${m}/care`,TOGETHER_URL_FE:`${m}/community`,SSO_URL:O(e,"marryBaby"===o),TOGETHER_API:A(),DISCOVER_API:I(e)}}}),[e,t,i]))({locale:i.locale,projectType:i.projectType,isMobile:i.isMobile,siteType:i.siteType,enableBookingBtn:i.enableBookingBtn});return a.createElement(Je.Provider,{value:Object.assign(Object.assign({},i),{configs:Object.assign(Object.assign({},l),i.configs),currentUrl:i.currentUrl||o})},t)},et=t.div`
477
475
  position: fixed;
478
476
  z-index: 201;
479
477
  top: calc(100% + 1px); // border 1px
@@ -1785,6 +1783,7 @@ import{M as e}from"./utils-edae1592.js";import t from"styled-components";import{
1785
1783
  align-items: center;
1786
1784
  height: 100%;
1787
1785
  flex-shrink: 0;
1786
+ gap: 26px;
1788
1787
  ${e.tdDown} {
1789
1788
  flex-shrink: 0.6;
1790
1789
  }
@@ -1803,9 +1802,6 @@ import{M as e}from"./utils-edae1592.js";import t from"styled-components";import{
1803
1802
  text-decoration: none;
1804
1803
  }
1805
1804
  }
1806
- &[data-site-type='marryBaby'] {
1807
- gap: 26px;
1808
- }
1809
1805
  `;t.div`
1810
1806
  .fake-search-input {
1811
1807
  pointer-events: none;
@@ -1,4 +1,4 @@
1
- import"dayjs";import"./screenSizeContext-f04e5151.js";import"react";import t from"styled-components";import{t as o}from"./theme-d9e20331.js";import"./index-a30cdd1b.js";import{M as i}from"./utils-edae1592.js";import"./isProduction-3f988439.js";import"./Onboarding-82fe006a.js";import"./gAssets.js";import{b as p}from"./index-2dcc67f8.js";const r=t.div`
1
+ import"dayjs";import"./screenSizeContext-652dbbd3.js";import"react";import t from"styled-components";import{t as o}from"./theme-4d9b8565.js";import"./index-ac45d84b.js";import{M as i}from"./utils-0f812a66.js";import"./isProduction-b84be401.js";import"./Onboarding-b0d0d68e.js";import"./gAssets.js";import{b as p}from"./index-88b68e0d.js";const r=t.div`
2
2
  position: fixed;
3
3
  inset: 0;
4
4
  z-index: 1000;
@@ -11,7 +11,7 @@ import"dayjs";import"./screenSizeContext-f04e5151.js";import"react";import t fro
11
11
  width: 100%;
12
12
  height: calc(100% - 25px);
13
13
  }
14
- `,e=t.div`
14
+ `,a=t.div`
15
15
  padding: 16px;
16
16
  ${i.mbUp} {
17
17
  padding: 48px 24px 24px;
@@ -24,7 +24,7 @@ import"dayjs";import"./screenSizeContext-f04e5151.js";import"react";import t fro
24
24
  margin-top: -1rem;
25
25
  }
26
26
  }
27
- `,a=t.div`
27
+ `,e=t.div`
28
28
  width: 640px;
29
29
  padding: 16px 16px 0 16px;
30
30
  display: none;
@@ -60,7 +60,7 @@ import"dayjs";import"./screenSizeContext-f04e5151.js";import"react";import t fro
60
60
  height: 100vh;
61
61
  }
62
62
  }
63
- `,x=t(p)`
63
+ `,b=t(p)`
64
64
  .phone-input {
65
65
  width: 100%;
66
66
  margin-bottom: 32px;
@@ -77,7 +77,7 @@ import"dayjs";import"./screenSizeContext-f04e5151.js";import"react";import t fro
77
77
  border-radius: 0 4px 4px 0;
78
78
  }
79
79
  }
80
- `,b=t.div`
80
+ `,x=t.div`
81
81
  .phone-input {
82
82
  width: 100%;
83
83
  margin-bottom: 32px;
@@ -127,4 +127,4 @@ import"dayjs";import"./screenSizeContext-f04e5151.js";import"react";import t fro
127
127
  margin-bottom: 3px;
128
128
  margin-left: 3px;
129
129
  }
130
- `;export{b as S,x as a,g as b,r as c,n as d,e,a as f,d as g,m as h,s as i};
130
+ `;export{x as S,b as a,g as b,r as c,n as d,a as e,e as f,d as g,m as h,s as i};
@@ -1,4 +1,4 @@
1
- import{_ as e}from"./tslib.es6-473ccb87.js";import t,{useMemo as o}from"react";import{L as n}from"./Onboarding-82fe006a.js";import{CommonGAssets as i}from"./gAssets.js";import{t as r}from"./theme-d9e20331.js";import a from"styled-components";import{I as s}from"./index-3e66a614.js";import{T as l}from"./index-17695220.js";import{C as c}from"./index-11483079.js";const d=a.div`
1
+ import{_ as e}from"./tslib.es6-43b52c70.js";import t,{useMemo as o}from"react";import{L as n}from"./Onboarding-b0d0d68e.js";import{CommonGAssets as i}from"./gAssets.js";import{t as r}from"./theme-4d9b8565.js";import a from"styled-components";import{I as s}from"./index-14ebdde4.js";import{T as l}from"./index-88e355f5.js";import{C as c}from"./index-f7380130.js";const d=a.div`
2
2
  display: inline-flex;
3
3
  overflow: hidden;
4
4
  width: ${e=>e.size}px;
@@ -36,9 +36,9 @@ import{_ as e}from"./tslib.es6-473ccb87.js";import t,{useMemo as o}from"react";i
36
36
  & > * {
37
37
  pointer-events: none;
38
38
  }
39
- `,m=[n.Myanmar,n.Taiwan],g=a((n=>{var{icon:a,name:c,className:g,locale:b="en-PH",dataEventCategory:x,dataEventAction:h,dataEventLabel:v,onSelect:f}=n,u=e(n,["icon","name","className","locale","dataEventCategory","dataEventAction","dataEventLabel","onSelect"]);const w=o((()=>null==g?void 0:g.includes("selected-week-pill")),[g]);return t.createElement(p,Object.assign({onClick:f,className:g?"week-pill".concat(" non-pointer-event-child ",g):"week-pill non-pointer-event-child","data-event-category":x,"data-event-action":h,"data-event-label":v},u),t.createElement(d,{size:64,iconSize:40,backgroundColor:r.colors.white},t.createElement(s,{src:a||i.getAssetPath("week_default.png"),alt:`week ${c}`})),w?t.createElement(l,Object.assign({type:"semiBold",size:"n1",color:r.colors.gray800},m.includes(b)&&{style:{fontSize:"10px"}}),c):t.createElement(l,Object.assign({size:"n1",color:r.colors.gray600},m.includes(b)&&{style:{fontSize:"10px"}}),c))}))`
39
+ `,m=[n.Myanmar,n.Taiwan],b=a((n=>{var{icon:a,name:c,className:b,locale:g="en-PH",dataEventCategory:x,dataEventAction:h,dataEventLabel:v,onSelect:f}=n,u=e(n,["icon","name","className","locale","dataEventCategory","dataEventAction","dataEventLabel","onSelect"]);const w=o((()=>null==b?void 0:b.includes("selected-week-pill")),[b]);return t.createElement(p,Object.assign({onClick:f,className:b?"week-pill".concat(" non-pointer-event-child ",b):"week-pill non-pointer-event-child","data-event-category":x,"data-event-action":h,"data-event-label":v},u),t.createElement(d,{size:64,iconSize:40,backgroundColor:r.colors.white},t.createElement(s,{src:a||i.getAssetPath("week_default.png"),alt:`week ${c}`})),w?t.createElement(l,Object.assign({type:"semiBold",size:"n1",color:r.colors.gray800},m.includes(g)&&{style:{fontSize:"10px"}}),c):t.createElement(l,Object.assign({size:"n1",color:r.colors.gray600},m.includes(g)&&{style:{fontSize:"10px"}}),c))}))`
40
40
  box-shadow: 0px 0px 24px rgba(0, 0, 0, 0.08);
41
- `,b=a(c.Slide)`
41
+ `,g=a(c.Slide)`
42
42
  cursor: pointer;
43
43
  > div * {
44
44
  pointer-events: none;
@@ -47,4 +47,4 @@ import{_ as e}from"./tslib.es6-473ccb87.js";import t,{useMemo as o}from"react";i
47
47
  .centerred-pill-wrapper {
48
48
  padding: 16px 0;
49
49
  }
50
- `;export{x as S,b as a,g as b};
50
+ `;export{x as S,g as a,b};
package/build/esm/lead.js CHANGED
@@ -1 +1 @@
1
- import{a as e,_ as t}from"./tslib.es6-473ccb87.js";import a,{createContext as l,useState as n,useEffect as o,useMemo as i,useRef as r,useContext as s}from"react";import d from"lodash/debounce";import{v1 as c}from"uuid";import{H as m}from"./index-4d579ab7.js";import{B as u}from"./index-c42054ea.js";import{CommonGAssets as p}from"./gAssets.js";import{Portal as h,Box as g,Transition as v,Overlay as b}from"@mantine/core";import"./index-ba146661.js";import{b as f,a as y}from"./utils-edae1592.js";import{t as k}from"./theme-d9e20331.js";import"./index-3e66a614.js";import{T as _}from"./translationsContext-1ad41874.js";import"string-format";import"./index-62bc7c5e.js";import"innertext";import"@mantine/hooks";import"@mantine/dates";import"./index-a30cdd1b.js";import"./Onboarding-82fe006a.js";import{h as E,R as w,p as C,o as N,N as x}from"./index-c4d88a81.js";import S from"dayjs";import"./screenSizeContext-f04e5151.js";import"styled-components";import"./isProduction-3f988439.js";import"./index-11483079.js";import"date-fns";import"react-day-picker/DayPickerInput";import"./index.styled-01db228b.js";import{createPortal as T}from"react-dom";import"./index-9f03353e.js";import"lodash/throttle";import"./types-23d48290.js";import"react-hook-form";import"date-fns/locale/en-US";import"date-fns/locale/id";import"date-fns/locale/vi";import"date-fns/locale/zh-TW";import"./index.styled-ad1cb88f.js";import{M as O}from"./utils-7c4cec34.js";import{D as P}from"./index-cf0eff36.js";import{S as j}from"./index-28798038.js";import"./index-2dcc67f8.js";import"./index.styled-069379fa.js";import{createFormContext as B}from"@mantine/form";import"yup";import{u as $}from"./useTranslations-e8922a21.js";import{T as L}from"./index-17695220.js";import{g as I,s as A}from"./cookieHelper-ca7c9c03.js";import"./useUniqueId-89d4734d.js";import"react-keyed-flatten-children";import"date-fns/locale";import"./index-558a5045.js";import"./index-c7fe4301.js";import"@hookform/resolvers/yup";import"./index-47122181.js";import"./index-60389692.js";import"@mantine/carousel";import"slugify";import"./routing-f0e3f53b.js";import"dayjs/plugin/relativeTime";const U=1,D=2;let R="https://dev.leadgen.hellobacsi.com/";const H=1,M=2;let F="";R.includes("localhost")&&(R="https://dev.leadgen.hellobacsi.com/"),location.hostname.includes("marrybaby.vn")&&(F="pink");let W="https://"+location.hostname+location.pathname+location.search;W=W.toLowerCase(),sessionStorage.getItem("insider_object")&&(window.insider_object=JSON.parse(sessionStorage.getItem("insider_object")));const V={"vi-VN":{popupLang:"vi",countryCode:"vn",countryCodeNumber:84},"id-ID":{popupLang:"id",countryCode:"id",countryCodeNumber:62},"th-TH":{popupLang:"th",countryCode:"th",countryCodeNumber:66},"ms-MY":{popupLang:"ms",countryCode:"my",countryCodeNumber:60},"zh-TW":{popupLang:"zh",countryCode:"tw",countryCodeNumber:886},"km-KH":{popupLang:"km",countryCode:"kh",countryCodeNumber:855},"my-MM":{popupLang:"my",countryCode:"mm",countryCodeNumber:95},"hi-IN":{popupLang:"hi",countryCode:"in",countryCodeNumber:91}},q=V[document.documentElement.lang]||V["vi-VN"];const Y={1:"Asia/Ho_Chi_Minh",10:"Asia/Ho_Chi_Minh",11:"Asia/Ho_Chi_Minh",12:"Asia/Ho_Chi_Minh",2:"Asia/Jakarta",3:"Asia/Bangkok",4:"Asia/Phnom_Penh",5:"Asia/Kuala_Lumpur",6:"Asia/Taipei",7:"Asia/Yangon",8:"Asia/Kolkata",9:"Asia/Manila"};var J={"validator.required":"This field is required.","validator.remote":"Please fix this field.","validator.email":"Please enter a valid email address.","validator.phone":"Please input correct phone number.","validator.url":"Please enter a valid URL.","validator.date":"Please enter a valid date.","validator.dateISO":"Please enter a valid date (ISO).","validator.number":"Please enter a valid number.","validator.digits":"Please enter only digits.","validator.creditcard":"Please enter a valid credit card number.","validator.equalTo":"Please enter the same value again.","validator.accept":"Please enter a value with a valid extension.","validator.maxlength":"jQuery.validator.format('Please enter no more than {0} characters.","validator.minlength":"jQuery.validator.format('Please enter at least {0} characters.","validator.rangelength":"jQuery.validator.format('Please enter a value between {0} and {1} characters long.","validator.range":"jQuery.validator.format('Please enter a value between {0} and {1}.","validator.max":"jQuery.validator.format('Please enter a value less than or equal to {0}.","validator.min":"jQuery.validator.format('Please enter a value greater than or equal to {0}.","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"};const z={"en-PH":J,"vi-VN":{"validator.required":"Vui lòng điền mục này","validator.email":"Vui lòng điền email có thật.","validator.number":"Vui lòng điền số có thật","validator.digits":"Vui lòng chỉ điền số","validator.maxlength":"Vui lòng điền dưới {0} số","validator.minlength":"Vui lòng điền hơn {0} số","validator.remote":"Hãy sửa cho đúng.","validator.url":"Hãy nhập URL.","validator.date":"Hãy nhập ngày.","validator.dateISO":"Hãy nhập ngày (ISO).","validator.creditcard":"Hãy nhập số thẻ tín dụng.","validator.equalTo":"Hãy nhập thêm lần nữa.","validator.extension":"Phần mở rộng không đúng.","validator.rangelength":"Hãy nhập từ {0} đến {1} kí tự.","validator.range":"Hãy nhập từ {0} đến {1}.","validator.max":"Hãy nhập từ {0} trở xuống.","validator.min":"Hãy nhập từ {0} trở lên.","validator.phone":"Nhập đúng định dạng số điện thoại","validator.emailUsed":"Email này đã được sử dụng cho chiến dịch.","validator.phoneUsed":"Số điện thoại này đã được sử dụng cho chiến dịch.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"hi-IN":{"validator.required":"इस क्षेत्र की आवश्यकता है।","validator.email":"कृपया एक मान्य ईमेल पता दर्ज करें","validator.number":"कृपया एक वैध संख्या दर्ज करें","validator.digits":"कृपया केवल अंक दर्ज करें","validator.maxlength":"कृपया {0} अक्षर से अधिक दर्ज न करें","validator.minlength":"कृपया कम से कम {0} अक्षर दर्ज करें","validator.phone":"कृपया एक वैध संख्या दर्ज करें","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"id-ID":{"validator.required":"Kolom ini wajib diisi","validator.email":"Tolong daftarkan email yang valid","validator.number":"Tolong daftarkan nomor telepon yang valid","validator.digits":"Tolong masukkan angka saja","validator.maxlength":"Jangan memasukkan lebih dari {0} karakter","validator.minlength":"Tolong ketik sedikitnya {0} karakter","validator.phone":"Tolong daftarkan nomor telepon yang valid","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"ms-MY":{"validator.required":"Bahagian ini wajib diisi.","validator.email":"Sila masukkan alamat emel yang sah.","validator.number":"Sila masukkan no telefon yang sah.","validator.digits":"Sila masukkan nombor digit sahaja.","validator.maxlength":"Sila masukkan tidak lebih dari {0} aksara","validator.minlength":"Sila masukkan sekurang-kurangnya {0} aksara","validator.phone":"Sila masukkan no telefon yang sah.","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"my-MM":{"validator.required":"ဒီနေရာမှာ ဖြည့်ဖို့ လိုအပ်ပါတယ်","validator.email":"မှန်ကန်သော အီးမေးလ်လိပ်စာထည့်သွင်းပါ","validator.number":"မှန်ကန်သော ဖုန်းနံပါတ်ထည့်သွင်းပါ","validator.digits":"နံပါတ်များသာဖြည့်ပါ","validator.maxlength":"ကျေးဇူးပြု၍ {0} ထပ်မပိုသော ဂဏန်းများသာဖြည့်ပါ","validator.minlength":"ကျေးဇူးပြု၍ အနည်းဆုံး {0} ဂဏန်းဖြည့်ပါ","validator.phone":"မှန်ကန်သော ဖုန်းနံပါတ်ထည့်သွင်းပါ","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"km-KH":{"validator.required":"ព័ត៌មាន​ចាំបាច់​ដែល​ត្រូវ​បំពេញ","validator.email":"សូម​វាយ​អាសយដ្ឋាន​អ៊ីម៉ែល​ឲ្យ​បាន​ត្រឹមត្រូវ","validator.number":"សូម​វាយបញ្ចូល​លេខ​ឲ្យ​បាន​ត្រឹមត្រូវ","validator.digits":"វាយ​បញ្ចូល​បាន​តែ​លេខ​ប៉ុណ្ណោះ","validator.maxlength":"សូម​វាយ​បញ្ចូលកុំ​ឲ្យ​លើស {0} តួអក្សរ","validator.minlength":"សូម​វាយ​បញ្ចូល​តិច​បំផុត {0} តួអក្ស","validator.phone":"សូម​វាយបញ្ចូល​លេខ​ឲ្យ​បាន​ត្រឹមត្រូវ","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"zh-TW":{"validator.required":"此為必填欄位","validator.email":"請填入有效的 email 地址","validator.number":"請填入有效的電話號碼","validator.digits":"此欄位僅能輸入數字","validator.maxlength":"請輸入少於 {0} 位數","validator.minlength":"請輸入至少 {0} 位數","validator.phone":"請填入有效的電話號碼","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"th-TH":{"validator.required":"ต้องระบุข้อมูลในช่องนี้","validator.email":"กรุณาใส่อีเมล์ที่ถูกต้อง","validator.number":"กรุณาใส่ตัวเลขที่ถูกต้อง","validator.digits":"กรุณาส่เฉพาะตัวเลข","validator.maxlength":"กรุณาใส่ตัวเลขมากกว่า {0} หลัก","validator.minlength":"กรุณาใส่ตัวเลขอย่างน้อย {0} หลัก","validator.phone":"กรุณาใส่ตัวเลขที่ถูกต้อง","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"tl-PH":J},G=e=>{const t=z[e];return t||z["en-PH"]},K=l({}),Q=e=>{const[t,a]=n(16),[l,i]=n(9),[r,s]=n(!1);return o((()=>{if(s(!1),e){const t=new Image;t.addEventListener("load",(()=>{a(t.naturalWidth),i(t.naturalHeight),s(!0)})),t.addEventListener("error",(()=>{a(16),i(9),s(!0)})),t.src=e}else a(16),i(9),s(!0)}),[e]),{loaded:r,width:t,height:l}},X=({onClose:e,containerClassName:t,svgClassName:l})=>a.createElement("button",{onClick:e,className:`le-newbuilder-close-button js-modal__close ${t||""}`},a.createElement("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:l},a.createElement("circle",{cx:"16",cy:"16",r:"16",fill:"white"}),a.createElement("path",{d:"M16 17.05L10.925 22.125C10.7917 22.2584 10.621 22.329 10.413 22.337C10.2044 22.3457 10.025 22.275 9.87502 22.125C9.72502 21.975 9.65002 21.8 9.65002 21.6C9.65002 21.4 9.72502 21.225 9.87502 21.075L14.95 16L9.87502 10.925C9.74169 10.7917 9.67102 10.6207 9.66302 10.412C9.65436 10.204 9.72502 10.025 9.87502 9.87502C10.025 9.72502 10.2 9.65002 10.4 9.65002C10.6 9.65002 10.775 9.72502 10.925 9.87502L16 14.95L21.075 9.87502C21.2084 9.74169 21.3794 9.67069 21.588 9.66202C21.796 9.65402 21.975 9.72502 22.125 9.87502C22.275 10.025 22.35 10.2 22.35 10.4C22.35 10.6 22.275 10.775 22.125 10.925L17.05 16L22.125 21.075C22.2584 21.2084 22.329 21.379 22.337 21.587C22.3457 21.7957 22.275 21.975 22.125 22.125C21.975 22.275 21.8 22.35 21.6 22.35C21.4 22.35 21.225 22.275 21.075 22.125L16 17.05Z",fill:"#595959"}))),Z=({popupId:e,url:t,newTab:l,imageDestkop:n,imageMobile:o,onClose:i,onOtherSubmit:r})=>{const{width:s,height:d,loaded:c}=Q(o),{width:m,height:u,loaded:p}=Q(n);return c&&p?a.createElement("div",{id:e,className:"lead-modal-wrapper","data-popup-url":location.pathname,"data-popup-type":"center_tab"},a.createElement("div",{className:"le-center-tab-popup"},a.createElement("div",{style:{position:"relative"}},a.createElement("a",{className:"js-popup-other-submit",href:t,target:l?"blank":"_parent",onClick:r},a.createElement("img",{className:"le-only-mobile",src:o,style:{aspectRatio:`${s}/${d}`}}),a.createElement("img",{className:"le-only-desktop",src:n,style:{aspectRatio:`${m}/${u}`}})),a.createElement(X,{onClose:i,containerClassName:"close-button-top-right"})))):null},ee=({popupId:e,url:t,title:l,urlText:n,titleAlign:o,subtitle:i,subtitleAlign:r,newTab:s,imageDesktop:d,imageMobile:c,onClose:m,onOtherSubmit:u})=>{const{width:p,height:h,loaded:g}=Q(c),{width:v,height:b,loaded:f}=Q(d);return g&&f?a.createElement("div",{id:e,className:"lead-modal-wrapper lead-floating-wrapper","data-popup-url":location.pathname,"data-popup-type":"floating"},a.createElement("aside",{className:"le-only-desktop"},a.createElement("div",{className:"le-floating-desktop"},a.createElement("div",{className:"le-floating-desktop-wrap",style:{position:"relative",background:"#fff"}},d?a.createElement("div",null,a.createElement("img",{style:{maxWidth:120,borderTopLeftRadius:5,borderBottomLeftRadius:5,aspectRatio:`${v}/${b}`},src:d})):null,a.createElement("div",{style:{padding:20}},a.createElement("div",{className:`le-floating-desktop-title le-text-align-${o}`},l),a.createElement("div",{className:`le-floating-desktop-desc le-text-align-${r}`},i)),a.createElement("a",{target:s?"blank":"_parent",style:{marginLeft:35,textDecoration:"none"},href:t},a.createElement("button",{className:"le-joinbow-floating-btn js-popup-other-submit",onClick:u},n)),a.createElement(X,{onClose:m,containerClassName:"close-button-top-right"})))),a.createElement("aside",{className:"le-only-mobile"},a.createElement("div",{className:"le-floating-mobile"},a.createElement("div",{className:"le-floating-mobile-wrap",style:{position:"relative",background:"#fff"}},a.createElement("aside",{style:{display:"flex",justifyContent:"space-between"}},a.createElement("div",null,a.createElement("div",{className:`le-floating-mobile-title le-text-align-${o}`},l),a.createElement("div",{className:`le-floating-mobile-desc le-text-align-${r}`},i)),c?a.createElement("div",null,a.createElement("img",{style:{marginLeft:15,marginTop:4,maxWidth:100,aspectRatio:`${p}/${h}`},src:c})):null),a.createElement("div",{style:{textAlign:"center",marginTop:10}},a.createElement("a",{target:s?"blank":"_parent",href:t,style:{textDecoration:"none"}},a.createElement("button",{className:"le-joinbow-floating-btn js-popup-other-submit",onClick:u},n))),a.createElement(X,{onClose:m,containerClassName:"close-button-top-right"}))))):null},te="undefined"==typeof window,ae={VN:"vi",ID:"id",TH:"th",MY:"ms",TW:"zh-TW",KH:"km",MM:"my",IN:"hi",PH:"en"},le=(t="",a="",l="",i=500)=>{const[r,s]=n([]),[d,c]=n(!1);return o((()=>{let n;return t?n=window.setTimeout((()=>e(void 0,void 0,void 0,(function*(){var n;if(t)try{c(!0);const o=yield((t="",a="",l="vi")=>e(void 0,void 0,void 0,(function*(){return new Promise(((e,n)=>{if(!t)return n("Need valid text input");if(te)return n("Need valid window object");try{(new window.google.maps.places.AutocompleteService).getPlacePredictions(Object.assign(Object.assign({input:t},a?{componentRestrictions:{country:a}}:{}),{language:ae[l]}),e)}catch(e){n(e)}}))})))(t,a,l);s(!(n=o)||n.length<1?[]:n.map((e=>({placeId:e.place_id,description:e.description}))))}catch(e){console.error(e)}finally{c(!1)}else s([])}))),i):r.length&&s([]),()=>{window.clearTimeout(n)}}),[t,i,a]),{isLoading:d,predictions:r}};const ne=new class{constructor(){this.apiLeadUrl="https://dev.leadgen.hellobacsi.com/",this.apiSubotUrl="https://staging-service-subot.hellohealthgroup.com/"}},oe={call(e){var{url:a,data:l}=e,n=t(e,["url","data"]);return n.body=JSON.stringify(l),n.headers={"Content-Type":"application/json"},fetch(`${ne.apiLeadUrl}${a}`,n).then((e=>e.json())).catch((()=>({})))}},ie={call(e){var{url:a,data:l}=e,n=t(e,["url","data"]);return n.body=JSON.stringify(l),n.headers={"Content-Type":"application/json"},fetch(`${ne.apiSubotUrl}${a}`,n).then((e=>e.json())).catch((()=>({})))}},re=({bot_id:e,email:t,phone:a})=>{let l=a;return l&&l.startsWith("0")&&(l=l.substring(1)),ie.call({url:"frontend/api/subot-campaign/check",method:"post",data:{bot_id:e,email:t,phone:l}})},se=({campaign_id:e,email:t,phone:a})=>{let l=a;return l&&l.startsWith("0")&&(l=l.substring(1)),oe.call({url:"api/subot-campaign/check",method:"post",data:{campaign_id:e,email:t,phone:l}})},de=({phone:e})=>oe.call({url:"api/sms/otp",method:"post",data:{phone_number:e.replace("+","")}}),ce=({phone:e,otp:t})=>oe.call({url:"api/sms/verify",method:"post",data:{otp_code:t,phone_number:e.replace("+","")}}),me={email:{},phone:{}},ue=(t,a,l)=>e(void 0,void 0,void 0,(function*(){const n="email"in l?"email":"phone",o="email"in l?l.email:l.phone,i="email"in l?"validator.emailUsed":"validator.phoneUsed";if(me[n][o]){if(me[n][o].value)return i;if(!me[n][o].value&&me[n][o].expire>Date.now())return""}const r=yield((t,a,l)=>e(void 0,void 0,void 0,(function*(){const e="email"in l?"email":"phone",n="email"in l?l.email:l.phone,o="email"in l?"validator.emailUsed":"validator.phoneUsed",i=yield se({campaign_id:[t],[e]:n});return"SubmitLeadWithBotId_ERR_001"===i._errorCode||"SubmitLeadWithBotId_ERR_002"===i._errorCode||a.length&&"CheckSuBotLeadTool_ERR_001"===(yield re({bot_id:a,[e]:n}))._errorCode?o:void 0})))(t,a,l);return me[n][o]=r?{value:!0}:{value:!1,expire:Date.now()+6e4},r})),[pe,he,ge]=B(),ve=["places"],be=({name:e,placeholder:t,locale:l})=>{var s;const d=he(),[c,m]=n(""),[u,p]=n(""),{predictions:h}=le(c,"","tl-PH"===l?"en":null===(s=null==l?void 0:l.split("-"))||void 0===s?void 0:s[0]),[g,v]=n(null),[b,f]=n(!1),y=r(Math.random().toString(36).substring(7)),k=i((()=>{const e=h.map((e=>({value:e.description,label:e.description}))),t=e.find((e=>e.value===u));return!u||t?e:[{value:u,label:u}].concat(e)}),[h,u]);return o((()=>{var e,t,a;(null===(a=null===(t=null===(e=null===window||void 0===window?void 0:window.google)||void 0===e?void 0:e.maps)||void 0===t?void 0:t.places)||void 0===a?void 0:a.AutocompleteService)?f(!0):import("@react-google-maps/api").then((e=>{v((()=>e.LoadScript)),setTimeout((()=>{f(!0)}),200)}))}),[]),b?a.createElement(a.Fragment,null,g&&a.createElement(g,{googleMapsApiKey:"AIzaSyD9AbNa4AFwr8eNVs90G1YhQLhfWJ6KncU",libraries:ve,loadingElement:a.createElement(a.Fragment,null)}),a.createElement("div",{style:{display:"none"},"data-extra":!0,"data-name":e,"data-control":"text"}),a.createElement(j,Object.assign({className:"lead-modal__form-control",label:t,placeholder:t,withAsterisk:!0,name:e,data:k,searchValue:c,onSearchChange:e=>{m(e)},filter:()=>!0,clearable:!0,searchable:!0,onChange:e=>p(e||""),icon:a.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a.createElement("path",{d:"M9.99999 9.79167C10.4028 9.79167 10.7467 9.64944 11.0317 9.365C11.3161 9.08 11.4583 8.73611 11.4583 8.33333C11.4583 7.93056 11.3161 7.58667 11.0317 7.30167C10.7467 7.01722 10.4028 6.875 9.99999 6.875C9.59721 6.875 9.25332 7.01722 8.96832 7.30167C8.68388 7.58667 8.54166 7.93056 8.54166 8.33333C8.54166 8.73611 8.68388 9.08 8.96832 9.365C9.25332 9.64944 9.59721 9.79167 9.99999 9.79167ZM9.99999 17.875C9.90277 17.875 9.80555 17.8611 9.70832 17.8333C9.6111 17.8056 9.52082 17.7569 9.43749 17.6875C7.46527 15.8958 5.98971 14.2361 5.01082 12.7083C4.03138 11.1806 3.54166 9.77778 3.54166 8.5C3.54166 6.48611 4.1911 4.87833 5.48999 3.67667C6.78832 2.47556 8.29166 1.875 9.99999 1.875C11.7083 1.875 13.2119 2.47556 14.5108 3.67667C15.8092 4.87833 16.4583 6.48611 16.4583 8.5C16.4583 9.77778 15.9689 11.1806 14.99 12.7083C14.0105 14.2361 12.5347 15.8958 10.5625 17.6875C10.4792 17.7569 10.3889 17.8056 10.2917 17.8333C10.1944 17.8611 10.0972 17.875 9.99999 17.875Z",fill:"#8C8C8C"})),autoComplete:"no-auto-complete-"+y.current,rightSection:a.createElement(a.Fragment,null)},d.getInputProps(e)))):a.createElement("div",{style:{height:73}})},fe=({children:e,align:t})=>a.createElement("p",{className:`lead-modal__description ${"le-text-align-"+(t||"")} ${F}`},e),ye=({children:e,align:t})=>a.createElement("h2",{className:`lead-modal__title ${"le-text-align-"+(t||"")} ${F}`},e),ke=({listBlockAdded:e,popupId:t,locale:l,onClose:n,onOtherSubmit:o})=>{const i=he();return a.createElement(a.Fragment,null,e.map(((e,r)=>{const{name:s="",data:d={}}=e||{},{placeholder:c,value:m,align:p,listQuestion:h,isSendMailChimp:g=!1,newtab:v,url:b}=d;switch(s){case"TitleBlock":return a.createElement(ye,{key:r,align:p},m);case"SubtitleBlock":return a.createElement(fe,{key:r,align:p},m);case"TextBlock":return a.createElement(E,Object.assign({key:r,withAsterisk:!0,spellCheck:!1,type:"text",placeholder:c,className:"lead-modal__form-control",label:c,"data-control":"text",name:m},i.getInputProps(m)));case"NumberBlock":return a.createElement(x,Object.assign({key:r,withAsterisk:!0,spellCheck:!1,type:"number",placeholder:c,className:"lead-modal__form-control",label:c,"data-control":"number",name:m},i.getInputProps(m)));case"EmailBlock":return a.createElement(E,Object.assign({key:r,withAsterisk:!0,spellCheck:!1,placeholder:c,className:"lead-modal__form-control",label:c,"data-control":"email",name:m},i.getInputProps(m)));case"PhoneOtpBlock":case"PhoneBlock":{const e=t+"-"+m+"-"+r;return a.createElement(E.Wrapper,Object.assign({size:"md",withAsterisk:!0,key:r,label:c,className:"lead-modal__form-control",labelProps:{htmlFor:e}},i.getInputProps(m)),a.createElement(N,{name:m,spellCheck:!1,type:"tel",placeholder:c,onChange:e=>{i.setFieldValue(m,e)},id:e,defaultCountry:l&&O[l]||"VN","data-control":"tel"}))}case"LocationBlock":return a.createElement(be,{key:r,name:m,placeholder:c,locale:l});case"DateBlock":return a.createElement(P,Object.assign({withAsterisk:!0,key:r,type:"default",name:m,placeholder:c,className:"lead-modal__form-control",label:c,"data-control":"date"},i.getInputProps(m)));case"LinkButtonBlock":return a.createElement("div",{key:r},a.createElement("a",{target:v?"blank":"parrent",href:b,style:{textDecoration:"none"}},a.createElement(u,{type:"button",size:"md",className:`lead-modal__btn ${F}`,onClick:()=>{null==n||n(),null==o||o()}},m)));case"CheckboxBlock":return a.createElement(a.Fragment,null,g&&a.createElement("div",{style:{display:"none"},"data-name":m+"-mailchimp"}),a.createElement(C.Group,Object.assign({withAsterisk:!0,className:"lead-modal__form-control",key:r,label:c,size:"md",sx:{display:"flex",flexDirection:"column",gap:8}},i.getInputProps(m)),h.map(((e,t)=>a.createElement(C,{name:m,key:t,value:e.value,label:e.placeholder,"data-control":"checkbox"})))));case"RadioBlock":return a.createElement(a.Fragment,null,g&&a.createElement(E,{type:"hidden",name:m+"-mailchimp",value:g}),a.createElement(w.Group,Object.assign({withAsterisk:!0,className:"lead-modal__form-control",key:r,label:c,size:"md"},i.getInputProps(m)),h.map(((e,t)=>a.createElement(w,{name:m,key:t,value:e.value,label:e.placeholder,"data-control":"radio"})))));case"DropdownBlock":return a.createElement(a.Fragment,null,a.createElement("div",{style:{display:"none"},"data-extra":!0,"data-name":m,"data-control":"dropdown"}),a.createElement(j,Object.assign({key:r,className:"lead-modal__form-control",label:c,withAsterisk:!0,name:m,data:h.map((e=>({value:e.value,label:e.placeholder})))},i.getInputProps(m))))}return null})))},_e=({phone:t,onSuccess:l,autoSendWhenOpen:i})=>{const{t:s}=$(),[d,c]=n(""),[p,h]=n(!1),[g,v]=n(0),b=r(null),[f,y]=n(),[_,w]=n(""),C=r();o((()=>{e(void 0,void 0,void 0,(function*(){var e;if(!C.current){const e=yield import("react-phone-number-input");C.current=e.formatPhoneNumberIntl}w((null===(e=C.current)||void 0===e?void 0:e.call(C,t))||t)}))}),[t]);const N=()=>e(void 0,void 0,void 0,(function*(){var e;if(!t)return;const a=yield de({phone:t}),n=null===(e=null==a?void 0:a._messages)||void 0===e?void 0:e[0];"Send sms successfully"===n?(v(60),setTimeout((()=>{b.current&&(b.current.focus(),b.current.scrollIntoView({block:"center"}))}),100)):"This phone number was verified"===n?l():y(n||"something Wrong")}));return o((()=>{setTimeout((()=>{g>0&&v((e=>e-1))}),1e3)}),[g]),o((()=>{i&&!g&&N()}),[]),a.createElement(a.Fragment,null,a.createElement("form",{onSubmit:a=>{a.preventDefault(),e(void 0,void 0,void 0,(function*(){if(!t||!d)return;const e=yield ce({phone:t,otp:d}),a=null==e?void 0:e._messages[0];"Verify successfully"===a||"This phone number was verified"===a?l():y(a||"something Wrong")}))},className:"lead-phone-otp-form"},a.createElement(m,{tag:"h3",fontWeight:"bold",style:{marginBottom:4}},s("lead.otp.title")),a.createElement(L,{size:"p1",color:k.colors.gray600},s("lead.otp.desc",{phone:_})),a.createElement(E,{ref:b,name:"_"+name+"-otp",spellCheck:!1,type:"number",placeholder:"Enter OTP",className:"lead-modal__form-control",label:"Phone OTP","data-control":"otp",withAsterisk:!0,pattern:"[0-9]*",value:d,onChange:e=>{h(!0),c(e),y(p&&!e?"OTP is required":void 0)},error:p?f:void 0}),a.createElement(u,{size:"md",color:"primary",className:`lead-modal__btn ${F}`,disabled:!d},s("lead.otp.verify")),a.createElement(u,{type:"button",size:"md",color:"transparent",className:`lead-modal__btn lead-phone-otp-button ${F}`,onClick:()=>{N()},disabled:!!g},s("lead.otp.resend",{timer:g?` (${g}s)`:""}))))},Ee=({title:e,titleAlign:t,subtitle:l,subtitleAlign:n,link:o,linkNewTab:i,linkText:r,image:s})=>{const{width:d,height:c,loaded:m}=Q(s);return m?a.createElement("div",{className:"lead-modal__thank-you"},a.createElement("div",{style:{width:"100%"}},a.createElement("img",{src:s,style:{maxHeight:162,objectFit:"cover",aspectRatio:`${d}/${c}`}}),e&&a.createElement("h1",{className:`le-thankyou-title le-text-align-${t}`},e),l&&a.createElement("p",{className:`le-thankyou-subtitle le-text-align-${n}`},l),r&&a.createElement("div",null,a.createElement("a",{href:o,target:i?"_blank":"parrent",rel:"noreferrer"},a.createElement("button",{className:`lead-modal__btn ${F}`},r))))):null},we=({content:e,inlinePosition:t})=>{const a=i((()=>{if(!t)return null;const e=document.querySelectorAll(`[data-url="${location.pathname}"] .body-content`),a=Array.from(e).reduce(((e,t)=>[...e,...Array.from(t.children)]),[]);if(null==a?void 0:a.length){const e=a.filter((e=>"P"===e.nodeName)),l=a.filter((e=>"H2"===e.nodeName));let n=null;switch(t){case"1th":n=e[0];break;case"2th":n=e[1];break;case"3th":n=e[2];break;case"4th":n=e[3];break;case"5th":n=e[4];break;case"6th":n=e[5];break;case"7th":n=e[6];break;case"8th":n=e[7];break;case"9th":n=e[8];break;case"10th":n=e[9];break;case"11th":n=e[10];break;case"12th":n=e[11];break;case"lastP":n=e[e.length-1];break;case"1thH2":n=l[0];break;case"2thH2":n=l[1];break;case"3thH2":n=l[2];break;case"4thH2":n=l[3];break;case"5thH2":n=l[4];break;case"6thH2":n=l[5];break;case"7thH2":n=l[6];break;case"8thH2":n=l[7];break;case"9thH2":n=l[8];break;case"10thH2":n=l[9];break;case"lastH2":n=l[l.length-1]}if(n){if(n.parentElement.querySelector(".inline-lead-wrapper"))return n.parentElement.querySelector(".inline-lead-wrapper");{const e=document.createElement("div");return e.classList.add("inline-lead-wrapper"),n.nextElementSibling?n.parentElement.insertBefore(e,n.nextElementSibling):n.parentElement.appendChild(e),e}}}}),[t]);return t&&a?T(e,a):null},Ce=({content:e})=>{const t=i((()=>{const e=Array.from(document.querySelectorAll(".hc2-sidebar-with-ads,.page-main-col .right-col.f-right,.hhg-lead-sidebar"));return e.forEach((e=>{if(e.querySelector(".sidebar-lead-modal-wrapper"))return;const t=document.createElement("div");t.classList.add("sidebar-lead-modal-wrapper"),e.prepend(t)})),e.map((e=>e.querySelector(".sidebar-lead-modal-wrapper")))}),[]);return a.createElement(a.Fragment,null,t.map((t=>T(e,f(t,"sidebar-lead-modal-wrapper")))))},Ne=({popupId:e,extraFields:t,onClose:l,onOtherSubmit:s,imageMobile:d,imageDesktop:c,imageOverlayMobile:m,imageOverlayDesktop:h,imageBackground:g,currentLayout:v,title:b,onSubmit:f,showThankyou:y,campaignId:k,campaign_subot_id:_,locale:E})=>{var w,C,N;const x=JSON.parse(t.listBlockAdded),S=JSON.parse(t.actionBlocks),T=JSON.parse(t.textBlocks),O=S.submitBlock.data.url,P=S.submitBlock.data.text,j=S.submitBlock.data.text2,B=S.submitBlock.data.value,L=location.pathname,I=v.includes("Inline")||"Sidebar"===v,A="Slider"===v,[U,D]=n(!0),[R,H]=n(""),M=r(),W=()=>{R?H(""):null==l||l()};if(window.innerWidth<769&&["Fullscreen","Slider"].includes(v))return console.log("😎 Not show fullscreen, slider on mobile "),null;o((()=>{(v.includes("LightBox")||"Fullscreen"==v)&&document.body.classList.add("noscroll"),window.intlTelInputUtils||require("intl-tel-input/build/js/utils"),me.email={},me.phone={}}),[]);const V=r(!1),Y=r(!1),{form:J,validateObj:z}=(({listBlockAdded:e=[],validatingPhoneRef:t,validatingEmailRef:a,campaignId:l,campaign_subot_id:n=[]})=>{const{t:o}=$(),s=i((()=>{const i=["TextBlock","NumberBlock","EmailBlock","PhoneBlock","DateBlock","CheckboxBlock","RadioBlock","DropdownBlock","PhoneOtpBlock","LocationBlock"],r=(e,t)=>a=>{if(c.current.isTouched(e))return void 0===a||""===a||Array.isArray(a)&&0===a.length?o("validator.required"):null==t?void 0:t(a)};return e.filter((e=>i.includes(e.name))).reduce(((e,i)=>"NumberBlock"===i.name?Object.assign(Object.assign({},e),{[i.data.value]:r(i.data.value,(e=>{if(isNaN(Number(e)))return o("validator.number")}))}):"EmailBlock"===i.name?Object.assign(Object.assign({},e),{[i.data.value]:r(i.data.value,(e=>{if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e))return o("validator.email");a.current=!0,setTimeout((()=>{c.current.setFieldError(i.data.value,"Validating..."),ue(l,n,{email:e}).then((e=>{e?c.current.setFieldError(i.data.value,o(e)):c.current.clearFieldError(i.data.value),a.current=!1})).catch((e=>{console.error(e),c.current.setFieldError(i.data.value,e.message||"Something went wrong"),a.current=!1}))}),200)}))}):"PhoneBlock"===i.name||"PhoneOtpBlock"===i.name?Object.assign(Object.assign({},e),{[i.data.value]:r(i.data.value,(e=>{if(window.intlTelInputUtils&&!window.intlTelInputUtils.isValidNumber(String(e),q.countryCode))return o("validator.phone");t.current=!0,setTimeout((()=>{c.current.setFieldError(i.data.value,"Validating..."),ue(l,n,{phone:e}).then((e=>{e?c.current.setFieldError(i.data.value,o(e)):c.current.clearFieldError(i.data.value),t.current=!1})).catch((e=>{console.error(e),c.current.setFieldError(i.data.value,e.message||"Something went wrong"),t.current=!1}))}),200)}))}):"DateBlock"===i.name?Object.assign(Object.assign({},e),{[i.data.value]:r(i.data.value,(e=>{if(isNaN(Date.parse(e)))return o("validator.date")}))}):Object.assign(Object.assign({},e),{[i.data.value]:r(i.data.value)})),{})}),[e.map((e=>e.name)).join(",")]),d=ge({validateInputOnChange:!0,clearInputErrorOnChange:!0,validate:s}),c=r(d);return c.current=d,{form:d,validateObj:s}})({listBlockAdded:x,validatingPhoneRef:V,validatingEmailRef:Y,campaignId:k,campaign_subot_id:_}),{width:G,height:K,loaded:Z}=Q(g),{width:ee,height:te,loaded:ae}=Q(d),{width:le,height:ne,loaded:oe}=Q(c),ie=ae&&oe&&("Fullscreen"!=v||Z),re=a.createElement(a.Fragment,null,a.createElement("style",{dangerouslySetInnerHTML:{__html:`\n .le-newbuilder-overlay {\n background-repeat: no-repeat;\n background-size: cover;\n }\n ${m?`\n .le-newbuilder-overlay {\n background: url(${m}) ;\n }`:""}\n ${h?`\n @media screen and (min-width:768px) {\n .le-newbuilder-overlay {\n background: url(${h}) ;\n }\n }`:""}`}}),a.createElement("div",{id:e,"data-popup-url":L,"data-popup-type":"lightbox-inline",className:`lead-modal lead-modal-wrapper modal--animate-scale ${I?"le-buider-inline":""} ${A?"le-buider-slider":""}`},"Fullscreen"==v?a.createElement("img",{className:"le-only-desktop le-fullscreen-img",draggable:!1,src:g||"",style:{aspectRatio:`${G}/${K}`}}):null,a.createElement("div",{className:`lead-modal__wrapper le-newbuilder-wrap-${v}`},a.createElement("div",{className:`lead-modal__content le-newbuilder-${v}`},y?a.createElement(Ee,{title:y.title,titleAlign:y.titleAlign,subtitle:y.subtitle,subtitleAlign:y.subtitleAlign,link:y.link,linkNewTab:y.linkNewTab,linkText:y.linkText,image:y.image}):a.createElement(a.Fragment,null,a.createElement("header",{className:"lead-modal__header"},R?a.createElement("img",{src:p.getAssetPath("lead-otp-thumb.png"),draggable:"false",alt:"",style:{width:"100%"}}):a.createElement(a.Fragment,null,["LightBoxA","InlineA","Sidebar","Slider"].includes(v)?d?a.createElement("img",{draggable:"false",className:"lead-modal__image lead-modal-image-cover",src:d,style:{aspectRatio:`${ee}/${te}`},alt:""}):null:a.createElement(a.Fragment,null,c?a.createElement("img",{draggable:"false",className:"le-only-desktop lead-modal__image lead-modal-image-cover",style:{height:"100%",objectFit:"cover",aspectRatio:`${le}/${ne}`},src:c,alt:""}):null,d?a.createElement("img",{draggable:"false",className:"le-only-mobile lead-modal__image lead-modal-image-cover",src:d,alt:"",style:{aspectRatio:`${ee}/${te}`}}):null))),R&&a.createElement(_e,{phone:R,autoSendWhenOpen:!0,onSuccess:()=>{null==f||f(M.current,J.values)}}),a.createElement("div",{"data-hidden":!!R,className:"lead-modal__body le-newbuilder-overlay"},a.createElement(pe,{form:J},a.createElement("form",{ref:M,className:`lead-modal__form ${e}`,onSubmit:e=>{e.preventDefault(),J.setTouched(Object.keys(z).reduce(((e,t)=>(e[t]=!0,e)),{})),Y.current||V.current||setTimeout((()=>{J.onSubmit((e=>{var t,a,l;if(!Object.keys(J.errors).length){if(x.findIndex((e=>"PhoneOtpBlock"===e.name))>-1){const n=null===(a=null===(t=x.find((e=>"PhoneOtpBlock"===e.name)))||void 0===t?void 0:t.data)||void 0===a?void 0:a.value;if(null===(l=e[n])||void 0===l?void 0:l.startsWith("+84"))return void H(e[n])}null==f||f(M.current,e)}}))(e)}),100)}},a.createElement("div",{style:{marginBottom:20}},a.createElement("h2",{className:`lead-modal__title ${"le-text-align-"+(null===(w=T.titleBlock.data)||void 0===w?void 0:w.align)} ${F}`},b),a.createElement("p",{className:`lead-modal__description ${"le-text-align-"+(null===(C=T.titleBlock.data)||void 0===C?void 0:C.align)} ${F}`},T.subtitleBlock.data.value)),a.createElement("div",{className:"lead-modal__form-control-wrapper"},a.createElement(ke,{listBlockAdded:x,popupId:e,locale:E,onClose:W,onOtherSubmit:s})),(null===(N=null==S?void 0:S.submitBlock)||void 0===N?void 0:N.isHide)?null:a.createElement(a.Fragment,null,a.createElement("div",{className:`lead-modal__checkbox-wrapper ${F}`},a.createElement("div",{className:"lead-modal__checkbox"},a.createElement("input",{id:"lead-term-checkbox",className:`lead-modal__checkbox__input ${F}`,type:"checkbox","aria-label":"Checkbox label",checked:U,onChange:e=>D(e.currentTarget.checked)}),a.createElement("div",{className:"lead-modal__checkbox__control","aria-hidden":"true"})),a.createElement("label",{htmlFor:"checkbox",className:"lead-modal__checkbox__label"},P," ",a.createElement("span",{style:{fontWeight:"bold"}},a.createElement("a",{target:"blank",href:O||"https://hellobacsi.com/chinh-sach",rel:"noopener noreferrer",style:{textDecoration:"none"}},j)))),a.createElement(u,{size:"md",id:"lead-submit",type:"submit",className:`lead-modal__btn ${F}`,disabled:!U},B))))))),!v.includes("Inline")&&a.createElement(X,{onClose:W,containerClassName:"close-button-top-right"}))));return ie?v.includes("LightBox")||"Fullscreen"==v||"Slider"==v?re:"Sidebar"==v?a.createElement(Ce,{content:re}):v.includes("Inline")?a.createElement(we,{content:re,inlinePosition:t.popupInlinePosition}):null:null},xe=({popupId:e,link:t,linkText:l,linkNewTab:n,onClose:o,imageMobile:i,imageDesktop:r,currentLayout:s,onOtherSubmit:d})=>{const c=location.pathname,{width:m,height:u,loaded:p}=Q(i),{width:h,height:g,loaded:v}=Q(r);return p&&v?a.createElement("div",{id:e,className:"lead-modal-wrapper","data-popup-url":c,"data-popup-type":"skin_ab"},"SkinA"==s?a.createElement("aside",{className:"le-only-desktop"},a.createElement("div",{className:"le-skin-a-desktop"},a.createElement("div",{style:{position:"relative"}},a.createElement("img",{src:r,style:{aspectRatio:`${h}/${g}`}}),a.createElement("a",{style:{position:"absolute",top:"75%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center",width:"calc(100% - 15px)"},href:t,target:n?"blank":"_parent"},a.createElement("button",{onClick:d,className:"le-joinbow-btn js-popup-other-submit"},l)),a.createElement(X,{onClose:o,containerClassName:"close-button-top-right"})))):"SkinB"==s?a.createElement("aside",{className:"le-only-desktop"},a.createElement("div",{className:""},a.createElement("div",{style:{position:"relative",zIndex:1e4}},a.createElement("img",{src:r,style:{width:"100%",aspectRatio:`${h}/${g}`}}),a.createElement("a",{style:{position:"absolute",top:"75%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center",width:"100%"},href:t,target:n?"blank":"_parent"},a.createElement("button",{onClick:d,className:"le-joinbow-btn-mobile js-popup-other-submit"},l)),a.createElement(X,{containerClassName:"close-button-top-right",onClose:o})))):null,a.createElement("aside",{className:"le-only-mobile"},a.createElement("div",{className:"le-skin-mobile"},a.createElement("div",{style:{position:"relative"}},a.createElement("img",{src:i,style:{width:"100%",aspectRatio:`${m}/${u}`}}),a.createElement("a",{style:{position:"absolute",top:"82%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center",maxWidth:"calc(100% - 15px)"},href:t,target:n?"blank":"_parent"},a.createElement("button",{onClick:d,className:"le-joinbow-btn-mobile js-popup-other-submit"},l)),a.createElement(X,{containerClassName:"close-button-top-right",svgClassName:"le-mobile-btn",onClose:o}))))):null},Se=({popupId:e,url:t,newTab:l,image:n,onClose:o,onOtherSubmit:i})=>{const{width:r,height:s,loaded:d}=Q(n);return d?a.createElement("div",{id:e,className:"lead-modal-wrapper","data-popup-url":location.pathname,"data-popup-type":"tab"},a.createElement("div",{className:"le-tab-popup"},a.createElement("div",{style:{position:"relative"}},a.createElement("a",{href:t,target:l?"blank":"_parent",onClick:i},a.createElement("img",{className:"js-popup-other-submit",src:n,style:{aspectRatio:`${r}/${s}`}})),a.createElement(X,{onClose:o,containerClassName:"close-button-top-right"})))):null},Te=[],Oe=[],Pe=[];const je=(e="UTC")=>{const t=new Date;return new Date(t.toLocaleString("en-US",{timeZone:e}))},Be=e=>{try{const[t,a]=e.split(" "),[l,n,o]=t.split("-").map(Number),[i,r,s]=a.split(":").map(Number);return new Date(l,n-1,o,i,r,s)}catch(e){return null}};const $e=e=>1===e.formatted_status?function(e){var t;if(1===e.forever)return!0;const a=e.started_at,l=e.ended_at,n=Be(a),o=Be(l);if(!n||!o)return!0;const i=(null===(t=e.site)||void 0===t?void 0:t.id)||1;return!(je(Y[i]).getTime()>o.getTime()&&(Pe.push(e),1))}(e):0===e.formatted_status&&(Te.push(e),(e=>{var t;const a=(null===(t=e.site)||void 0===t?void 0:t.id)||1,l=e.started_at,n=e.ended_at,o=Be(l),i=Be(n);if(!o||!i)return!1;const r=je(Y[a]).getTime();return r<=i.getTime()&&r>=o.getTime()&&(Oe.push(e),!0)})(e));let Le=null;function Ie({leadApi:e,leadSiteId:t,leadDomain:a,onShowPopup:l,DEBUG_URL:n}){const o=n||("https://"+location.hostname+location.pathname+location.search).toLowerCase();fetch(e+"api/campaign/"+t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:o,ga_client_id:I("_ga")||null})}).then((e=>e.json())).then((e=>{var t,n,i,r,s;if(Ae("List campagin: ",e),W="https://"+location.hostname+location.pathname+location.search,1==e._status){const d=(null===(n=null===(t=e._data)||void 0===t?void 0:t.campaigns)||void 0===n?void 0:n.filter($e))||[];I("hhg-id")||(A("hhg-id",c(),{domain:"."+a,path:"/"}),Ae("😍 Set HHG ID cookie"));let m=[];m=/Android|webOS|iPhone|iPad|iPod|BlackBerry|BB|PlayBook|IEMobile|Windows Phone|Kindle|Silk|Opera Mini/i.test(navigator.userAgent)?d.filter((e=>e.device_types.some((e=>e.id==H)))):d.filter((e=>e.device_types.some((e=>e.id==M)))),Ae("👓 campaignsDevice",m),Ae("--listCampaignScheduled",Te),Ae("--listCampaignScheduledToActivated",Oe),Ae("--listCampaignActiveButExpired",Pe);let u=m.map(((e,t)=>e.targets.filter((e=>e.type==U)).map((e=>Object.assign(Object.assign({},e),{campaignIndex:t}))))).flat(1);u=u.filter((e=>{const t=new URL(String(e.target).toLowerCase());if("exact_match"==e.option)return Boolean(o===t.href);if("start_with"==e.option){if(o.includes(String(e.target))){return!e.sub_target.filter((e=>"excluding"==e.option)).map((e=>e.value)).includes(o.split("?")[0])}return!1}}));const p=Array.from(document.getElementsByTagName("META")).filter((e=>"article:tag"==e.getAttribute("property"))).map((e=>e.content));let h=[],g=[];p&&p.length&&(h=m.map(((e,t)=>e.targets.filter((e=>e.type==D)).map((e=>Object.assign(Object.assign({},e),{campaignIndex:t}))))).flat(1),g=h.filter((e=>p.includes(e.target))));const v=[...u,...g],b=document.cookie.split("; ").map((e=>e.split("=")[0])),f=b.filter((e=>e.includes("lead_submited")));Ae("--listCampaignCodeSubmited",f);const y=b.filter((e=>e.includes("lead_closed")));Ae("--listCampaignCodeClosed",y);const k=[...f,...y],_=(e=>{const t=[...e];for(let e=t.length-1;e>0;e--){const a=Math.floor(Math.random()*(e+1)),l=t[e];t[e]=t[a],t[a]=l}return t})(v.filter((e=>!k.some((t=>t.includes(m[e.campaignIndex].code))))));if(Ae("--listCampaignValid : ",_),_&&_.length){const e=m[_[0].campaignIndex];Ae("CAMPAIGN_SHOW",e);const{rules:t}=e,a=Number(null===(i=t.find((e=>"time"==e.rule)))||void 0===i?void 0:i.value);Ae("timeoutRule",a);const n=Number(null===(r=t.find((e=>"scroll"==e.rule)))||void 0===r?void 0:r.value);Ae("scrollRule",n);const o=Number(null===(s=t.find((e=>"exclude_sponsored"==e.rule)))||void 0===s?void 0:s.value);Ae("excludeSponsored",o);const d=Boolean(document.querySelector(".hhg-disclaimer-text"));if(Ae("💎 LEAD current page isSponsored",d),d&&o)return;let c="TIME";if(Number.isInteger(a)&&(c="TIME",Ae("✨ SHOW AWESOME POPUP AFTER: ",a," seconds"),Le&&clearTimeout(Le),Le=setTimeout((()=>{null==l||l(e,c)}),1e3*a)),Number.isInteger(n)){c="SCROLL",Ae("✨ SHOW AWESOME AFTER: SCROLL",n," %");const t=document.querySelector(`[data-url="${location.pathname}"]`)||document.querySelector("body"),a=t.getBoundingClientRect().top,o=t.offsetHeight;Ae("👓 Element check scroll: ",t);const i=function(){const t=window.pageYOffset||document.documentElement.scrollTop;let r=0;t>=a&&(r=Math.round((t-a)/(o-innerHeight)*100)),Ae("---Scroll",r,n),r>=n&&(window.removeEventListener("scroll",i),null==l||l(e,c))};window.addEventListener("scroll",i,{passive:!0})}}else Ae("🚧 No lead campaigns on current URL, tags")}})).catch((e=>{Ae("Lead error: ",e)}))}const Ae=(...e)=>{("production"!==process.env.NODE_ENV||process.env.NEXT_PUBLIC_DEPLOY_ENV&&"production"!==process.env.NEXT_PUBLIC_DEPLOY_ENV||"undefined"!=typeof localStorage&&"true"===localStorage.getItem("hhg_debug"))&&console.log(...e)};const Ue=({campaign:e,action:t,onSubmit:l,onClose:n,showThankyou:i,locale:d})=>{var m,u;const{apiUrl:p,siteDomain:h}=s(K);o((()=>{const e=I("_ga")||null;fetch(`${p}api/campaign/${f}/impression`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:t,url:location.href.toLowerCase(),title_article:document.title,cookie_id:I("hhg-id"),ga_client_id:e})})}),[]);const{extra_fields:g,image:v,image_desktop:b,code:f,image_background:y,image_overlay_mobile:k,image_overlay_desktop:_}=e||{},{currentLayout:E}=g,w=g.imageBlocks?JSON.parse(g.imageBlocks):{},C=JSON.parse(g.actionBlocks),N=JSON.parse(g.textBlocks);let x=(null===(u=null===(m=null==N?void 0:N.titleBlock)||void 0===m?void 0:m.data)||void 0===u?void 0:u.value)||"";const S={1:{},2:{},3:{}},T=r("lead-modal-"+c()),O=function(e="Xin chao {{category_2}} extra"){if(e.includes("{{category_")){const t=11,a=e.search("{{category_");return+e.charAt(t+a)}return null}(x);if(O){Ae("⚡️ Has categoryLevel",O);const e=Array.from(document.getElementsByTagName("META")),t=e.find((e=>e.name===`content_category_${O}`)),a=e.find((e=>e.name===`content_category_en_${O}`));if(!t||!a)return Ae("⚡️ No META TAG for categoryLevel, not show popup",O),null;S[O]={value:t.content,value_en:a.content},x=x.replace(`{{category_${O}}}`,t.content),Ae("⚡️ Set categoryData ",O)}else Ae("⚡️ No categoryLevel",O);const P=()=>{var t,a,l,o;if(Ae("👌 Other submit click"),document.body.classList.remove("noscroll"),E.includes("Skin")){const e=document.querySelector("#masthead");e&&(e.style.top="0px !important;")}const i=Number(null!==(a=null===(t=e.rules.find((e=>"days_to_show_again"==e.rule)))||void 0===t?void 0:t.value)&&void 0!==a?a:7),r=Number(null!==(o=null===(l=e.rules.find((e=>"show_again_after_submit"==e.rule)))||void 0===l?void 0:l.value)&&void 0!==o?o:0);0===r&&(Ae("⛔ Popup never show again!"),A(`lead_submited_${f}`,`target_${g.popupVersion}`,{domain:"."+h,path:"/"})),1==r&&(Ae(`⌛ Popup will show again after ${i} days!`),A(`lead_submited_${f}`,`target_${g.popupVersion}`,{domain:"."+h,days:i,path:"/"}));const s=I("_ga")||null,d={url:location.href.toLowerCase(),title_article:document.title,meta:[],cookie_id:I("hhg-id"),ga_client_id:s};O&&(d.category=S[O].value_en),fetch(`${p}api/campaign/${f}/lead`,{method:"POST",body:JSON.stringify(d),headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"}}).then((e=>e.json())).then((e=>{"error"===e.status&&Ae(e)})).catch((e=>{Ae("Error:",e)})),null==n||n()};return"CenterTab"===E?a.createElement(Z,{popupId:T.current,url:w.imageMobile.data.url,newTab:w.imageMobile.data.newtab,imageMobile:v,imageDestkop:b,onClose:n,onOtherSubmit:P}):"Tab"===E?a.createElement(Se,{popupId:T.current,url:w.imageMobile.data.url,newTab:w.imageMobile.data.newtab,image:v,onClose:n,onOtherSubmit:P}):"Floating"===E?a.createElement(ee,{popupId:T.current,title:x,titleAlign:N.titleBlock.data.align,subtitle:N.subtitleBlock.data.value,subtitleAlign:N.subtitleBlock.data.align,url:C.linkButtonBlock.data.url,urlText:C.linkButtonBlock.data.value,newTab:C.linkButtonBlock.data.newtab,imageMobile:v,imageDesktop:b,onClose:n,onOtherSubmit:P}):E.includes("LightBox")||E.includes("Inline")||"Fullscreen"==E||"Sidebar"==E||"Slider"==E?a.createElement(Ne,{popupId:T.current,extraFields:g,onClose:n,onOtherSubmit:P,imageMobile:v,imageDesktop:b,imageBackground:y,currentLayout:E,title:x,onSubmit:(e,t)=>l(e,t,O,S),key:E,imageOverlayDesktop:_,imageOverlayMobile:k,showThankyou:i,campaignId:e.id,campaign_subot_id:e.bot_id||[],locale:d}):E.includes("Skin")?a.createElement(xe,{popupId:T.current,link:C.linkButtonBlock.data.url,linkNewTab:!!C.linkButtonBlock.data.newtab,linkText:C.linkButtonBlock.data.value,onClose:n,onOtherSubmit:P,imageMobile:v,imageDesktop:b,currentLayout:E}):null},De=({apiUrl:t,siteDomain:l,siteId:s,locale:c,apiSubotUrl:m,DEBUG_URL:u})=>{var p;const f=r(),k=r(Date.now()),{apiUrl:E}=i((()=>{let e=t;return e.includes("localhost")&&(e="https://dev.leadgen.hellobacsi.com/"),{apiUrl:e}}),[t,l,s]),[w,C]=n(null),[N,x]=n(""),[T,O]=n(null);o((()=>{ne.apiLeadUrl=E,ne.apiSubotUrl=m}),[E,m]);const P=(e,t)=>{C(e),x(t)},j=()=>{var e,t;if(!w)return;Ae(`👋👋👋 CLOSE POPUP ${w.code} 👋👋👋`);const a=Number(null===(e=w.rules.find((e=>"show_again_after_exit"==e.rule)))||void 0===e?void 0:e.value),n=Number(null===(t=w.rules.find((e=>"days_to_show_again"==e.rule)))||void 0===t?void 0:t.value);0==a&&A(`lead_closed_${w.code}`,`target_${null==w?void 0:w.extra_fields.popupVersion}`,n?{domain:"."+l,days:n,path:"/"}:{domain:"."+l,path:"/"}),document.body.classList.remove("noscroll"),fetch(`${E}api/campaign/${w.code}/popup_exit`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"CLICK",url:location.href.toLowerCase(),title_article:document.title,cookie_id:I("hhg-id"),duration:Math.ceil((Date.now()-k.current)/1e3)})}),C(null),O(null)};o((()=>{if(window.next){const e=d((e=>{Ae("--🌻 routeChangeComplete",e,Date.now());const t=location.pathname;j(),document.querySelectorAll(`[data-popup-url="${t}"]`).length?Ae("🔥 This URL page has show popup!"):(Ae("--Process checkShowPopup"),Ie({leadApi:E,leadDomain:l,leadSiteId:s,onShowPopup:P,DEBUG_URL:u})),f.current&&window.removeEventListener("scroll",f.current)}),500);window.next.router.events.on("routeChangeComplete",e)}Ie({leadApi:E,leadDomain:l,leadSiteId:s,onShowPopup:P,DEBUG_URL:u})}),[]);const B=(t,a,n,o)=>e(void 0,void 0,void 0,(function*(){var e,i,r,s,d,c,m,u,p,h,g;if(!a)return;Ae("submitHandler",n,o);const v=Object.keys(a).map((e=>({name:e,value:String(a[e])}))),b=I("_ga")||null;window.intlTelInputUtils||(yield require("intl-tel-input/build/js/utils"));const f={url:location.href.toLowerCase(),title_article:document.title,meta:v.map((e=>{var a,l;const n=(null===(a=t.querySelector(`*[name="${e.name}"]`))||void 0===a?void 0:a.getAttribute("data-control"))||(null===(l=t.querySelector(`*[data-extra][data-name="${e.name}"]`))||void 0===l?void 0:l.getAttribute("data-control"))||"text",o="tel"===n?window.intlTelInputUtils.formatNumber(String(e.value),null==q?void 0:q.countryCodeNumber,2).replace(/\s+/g,""):"date"===n?S(e.value).format("YYYY-MM-DD"):e.value;return{key:e.name,value:o,control:n,is_sent_mailchimp:t.querySelector(`div[data-name="${e.name}-mailchimp"]`)?"true":"false"}})),cookie_id:I("hhg-id"),ga_client_id:b};n&&o[n].value_en&&(f.category=o[n].value_en);const y=Number((null===(i=null===(e=w.rules)||void 0===e?void 0:e.find((e=>"days_to_show_again"===e.rule)))||void 0===i?void 0:i.value)||7),k=Number((null===(s=null===(r=w.rules)||void 0===r?void 0:r.find((e=>"show_again_after_submit"===e.rule)))||void 0===s?void 0:s.value)||0);if(0==k&&(Ae("⛔ Popup never show again!"),A(`lead_submited_${w.code}`,`target_${null==w?void 0:w.extra_fields.targetType}`,{domain:"."+l,path:"/"})),1==k&&(Ae(`⌛ Popup will show again after ${y} days!`),A(`lead_submited_${w.code}`,`target_${null==w?void 0:w.extra_fields.targetType}`,{domain:"."+l,days:y,path:"/"})),fetch(`${E}api/campaign/${w.code}/lead`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(f)}),"notshow"==(null==w?void 0:w.extra_fields.popupShowThankYou))return j(),void document.body.classList.remove("noscroll");let _=!0;const C=w.thank_you_image||`${E}admin/img/thanksyou.png`;let N,x,T=(null==w?void 0:w.extra_fields.popupThankyouTitle)||"Thank you.",P=(null==w?void 0:w.extra_fields.popupThankyouDesc)||"We appreciate your time!",B="",$="",L="";if("2.1"==(null==w?void 0:w.extra_fields.popupVersion)){const e=w.extra_fields,t=JSON.parse(e.listBlockThankyou),a=t.find((e=>"TitleBlock"==e.name)),l=t.find((e=>"SubtitleBlock"==e.name)),n=t.find((e=>"LinkButtonBlock"==e.name));T=(null===(d=null==a?void 0:a.data)||void 0===d?void 0:d.value)||"",B=(null===(c=null==a?void 0:a.data)||void 0===c?void 0:c.align)||"",P=(null===(m=null==l?void 0:l.data)||void 0===m?void 0:m.value)||"",$=(null===(u=null==l?void 0:l.data)||void 0===u?void 0:u.align)||"",N=(null===(p=null==n?void 0:n.data)||void 0===p?void 0:p.value)||"",x=(null===(h=null==n?void 0:n.data)||void 0===h?void 0:h.newtab)||!1,L=(null===(g=null==n?void 0:n.data)||void 0===g?void 0:g.url)||"";const o=w.extra_fields.currentLayout;["SkinA","SkinB","Floating","Tab","CenterTab"].includes(o)&&(_=!1)}O(_?{title:T,titleAlign:B,subtitle:P,subtitleAlign:$,link:L,linkNewTab:x,linkText:N,image:C}:null),sessionStorage.getItem("insider_object")?window.insider_object=JSON.parse(sessionStorage.getItem("insider_object")):window.insider_object={user:{email:"",phone_number:"",gdpr_optin:!0,sms_optin:!0,email_optin:!0}},v.map((e=>{const t=e.name,a=e.value;"tel"==t?window.insider_object.user.phone_number=a:"email"==t&&(window.insider_object.user.email=a)})),sessionStorage.setItem("insider_object",JSON.stringify(window.insider_object))}));return o((()=>{w&&(k.current=Date.now())}),[w]),a.createElement(K.Provider,{value:{apiUrl:E,siteDomain:l,siteId:s,locale:c}},a.createElement(_.Provider,{value:{locale:c,values:G(c)}},a.createElement(h,{target:y()},a.createElement(g,{sx:{position:"fixed",zIndex:600}},a.createElement(v,{mounted:Boolean("2.1"===(null===(p=null==w?void 0:w.extra_fields)||void 0===p?void 0:p.popupVersion)),transition:"fade",duration:600,timingFunction:"ease"},(e=>{var t;return a.createElement(g,{style:e},"2.1"===(null===(t=null==w?void 0:w.extra_fields)||void 0===t?void 0:t.popupVersion)&&a.createElement(a.Fragment,null,!!w.extra_fields.currentLayout&&!w.extra_fields.currentLayout.includes("Inline")&&!w.extra_fields.currentLayout.includes("Sidebar")&&a.createElement(b,{color:"#000",opacity:.5,center:!0,zIndex:400,pos:"fixed",onClick:()=>j()}),a.createElement(Ue,{campaign:w,action:N,onSubmit:B,onClose:j,showThankyou:T,locale:c})))}))))))};export{De as LeadGen};
1
+ import{a as e,_ as t}from"./tslib.es6-43b52c70.js";import a,{createContext as l,useState as n,useEffect as o,useMemo as i,useRef as r,useContext as d}from"react";import s from"lodash/debounce";import{v1 as c}from"uuid";import{H as m}from"./index-17611c49.js";import{B as u}from"./index-9075d01a.js";import{CommonGAssets as p}from"./gAssets.js";import{Portal as h,Box as g,Transition as v,Overlay as b}from"@mantine/core";import"./index-325afc4d.js";import{b as f,a as y}from"./utils-0f812a66.js";import{t as k}from"./theme-4d9b8565.js";import"./index-14ebdde4.js";import{T as _}from"./translationsContext-a95596a3.js";import"string-format";import"./index-35fd0aad.js";import"innertext";import"@mantine/hooks";import"@mantine/dates";import"./index-ac45d84b.js";import"./Onboarding-b0d0d68e.js";import{h as E,R as w,p as C,o as N,N as x}from"./index-87850dfe.js";import S from"dayjs";import"./screenSizeContext-652dbbd3.js";import"styled-components";import"./isProduction-b84be401.js";import"./index-f7380130.js";import"date-fns";import"react-day-picker/DayPickerInput";import"./index.styled-a7d5bf58.js";import{createPortal as T}from"react-dom";import"./index-bcca0486.js";import"lodash/throttle";import"./types-dd20cb68.js";import"react-hook-form";import"date-fns/locale/en-US";import"date-fns/locale/id";import"date-fns/locale/vi";import"date-fns/locale/zh-TW";import"./index.styled-ef3fcbbd.js";import{M as O}from"./utils-d0688954.js";import{D as P}from"./index-e5a33e01.js";import{S as j}from"./index-0d7aacfc.js";import"./index-88b68e0d.js";import"./index.styled-a912953b.js";import{createFormContext as B}from"@mantine/form";import"yup";import{u as $}from"./useTranslations-fff3d6f3.js";import{T as L}from"./index-88e355f5.js";import{g as I,s as A}from"./cookieHelper-238e7958.js";import"./useUniqueId-f2d1092b.js";import"react-keyed-flatten-children";import"date-fns/locale";import"./index-089be81e.js";import"./index-8804431d.js";import"@hookform/resolvers/yup";import"./index-72719df9.js";import"./index-9ff96da9.js";import"@mantine/carousel";import"slugify";import"./routing-afe38f18.js";import"dayjs/plugin/relativeTime";const U=1,D=2;let R="https://dev.leadgen.hellobacsi.com/";const H=1,M=2;let F="";R.includes("localhost")&&(R="https://dev.leadgen.hellobacsi.com/"),location.hostname.includes("marrybaby.vn")&&(F="pink");let W="https://"+location.hostname+location.pathname+location.search;W=W.toLowerCase(),sessionStorage.getItem("insider_object")&&(window.insider_object=JSON.parse(sessionStorage.getItem("insider_object")));const V={"vi-VN":{popupLang:"vi",countryCode:"vn",countryCodeNumber:84},"id-ID":{popupLang:"id",countryCode:"id",countryCodeNumber:62},"th-TH":{popupLang:"th",countryCode:"th",countryCodeNumber:66},"ms-MY":{popupLang:"ms",countryCode:"my",countryCodeNumber:60},"zh-TW":{popupLang:"zh",countryCode:"tw",countryCodeNumber:886},"km-KH":{popupLang:"km",countryCode:"kh",countryCodeNumber:855},"my-MM":{popupLang:"my",countryCode:"mm",countryCodeNumber:95},"hi-IN":{popupLang:"hi",countryCode:"in",countryCodeNumber:91}},q=V[document.documentElement.lang]||V["vi-VN"];const Y={1:"Asia/Ho_Chi_Minh",10:"Asia/Ho_Chi_Minh",11:"Asia/Ho_Chi_Minh",12:"Asia/Ho_Chi_Minh",2:"Asia/Jakarta",3:"Asia/Bangkok",4:"Asia/Phnom_Penh",5:"Asia/Kuala_Lumpur",6:"Asia/Taipei",7:"Asia/Yangon",8:"Asia/Kolkata",9:"Asia/Manila"};var J={"validator.required":"This field is required.","validator.remote":"Please fix this field.","validator.email":"Please enter a valid email address.","validator.phone":"Please input correct phone number.","validator.url":"Please enter a valid URL.","validator.date":"Please enter a valid date.","validator.dateISO":"Please enter a valid date (ISO).","validator.number":"Please enter a valid number.","validator.digits":"Please enter only digits.","validator.creditcard":"Please enter a valid credit card number.","validator.equalTo":"Please enter the same value again.","validator.accept":"Please enter a value with a valid extension.","validator.maxlength":"jQuery.validator.format('Please enter no more than {0} characters.","validator.minlength":"jQuery.validator.format('Please enter at least {0} characters.","validator.rangelength":"jQuery.validator.format('Please enter a value between {0} and {1} characters long.","validator.range":"jQuery.validator.format('Please enter a value between {0} and {1}.","validator.max":"jQuery.validator.format('Please enter a value less than or equal to {0}.","validator.min":"jQuery.validator.format('Please enter a value greater than or equal to {0}.","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"};const z={"en-PH":J,"vi-VN":{"validator.required":"Vui lòng điền mục này","validator.email":"Vui lòng điền email có thật.","validator.number":"Vui lòng điền số có thật","validator.digits":"Vui lòng chỉ điền số","validator.maxlength":"Vui lòng điền dưới {0} số","validator.minlength":"Vui lòng điền hơn {0} số","validator.remote":"Hãy sửa cho đúng.","validator.url":"Hãy nhập URL.","validator.date":"Hãy nhập ngày.","validator.dateISO":"Hãy nhập ngày (ISO).","validator.creditcard":"Hãy nhập số thẻ tín dụng.","validator.equalTo":"Hãy nhập thêm lần nữa.","validator.extension":"Phần mở rộng không đúng.","validator.rangelength":"Hãy nhập từ {0} đến {1} kí tự.","validator.range":"Hãy nhập từ {0} đến {1}.","validator.max":"Hãy nhập từ {0} trở xuống.","validator.min":"Hãy nhập từ {0} trở lên.","validator.phone":"Nhập đúng định dạng số điện thoại","validator.emailUsed":"Email này đã được sử dụng cho chiến dịch.","validator.phoneUsed":"Số điện thoại này đã được sử dụng cho chiến dịch.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"hi-IN":{"validator.required":"इस क्षेत्र की आवश्यकता है।","validator.email":"कृपया एक मान्य ईमेल पता दर्ज करें","validator.number":"कृपया एक वैध संख्या दर्ज करें","validator.digits":"कृपया केवल अंक दर्ज करें","validator.maxlength":"कृपया {0} अक्षर से अधिक दर्ज न करें","validator.minlength":"कृपया कम से कम {0} अक्षर दर्ज करें","validator.phone":"कृपया एक वैध संख्या दर्ज करें","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"id-ID":{"validator.required":"Kolom ini wajib diisi","validator.email":"Tolong daftarkan email yang valid","validator.number":"Tolong daftarkan nomor telepon yang valid","validator.digits":"Tolong masukkan angka saja","validator.maxlength":"Jangan memasukkan lebih dari {0} karakter","validator.minlength":"Tolong ketik sedikitnya {0} karakter","validator.phone":"Tolong daftarkan nomor telepon yang valid","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"ms-MY":{"validator.required":"Bahagian ini wajib diisi.","validator.email":"Sila masukkan alamat emel yang sah.","validator.number":"Sila masukkan no telefon yang sah.","validator.digits":"Sila masukkan nombor digit sahaja.","validator.maxlength":"Sila masukkan tidak lebih dari {0} aksara","validator.minlength":"Sila masukkan sekurang-kurangnya {0} aksara","validator.phone":"Sila masukkan no telefon yang sah.","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"my-MM":{"validator.required":"ဒီနေရာမှာ ဖြည့်ဖို့ လိုအပ်ပါတယ်","validator.email":"မှန်ကန်သော အီးမေးလ်လိပ်စာထည့်သွင်းပါ","validator.number":"မှန်ကန်သော ဖုန်းနံပါတ်ထည့်သွင်းပါ","validator.digits":"နံပါတ်များသာဖြည့်ပါ","validator.maxlength":"ကျေးဇူးပြု၍ {0} ထပ်မပိုသော ဂဏန်းများသာဖြည့်ပါ","validator.minlength":"ကျေးဇူးပြု၍ အနည်းဆုံး {0} ဂဏန်းဖြည့်ပါ","validator.phone":"မှန်ကန်သော ဖုန်းနံပါတ်ထည့်သွင်းပါ","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"km-KH":{"validator.required":"ព័ត៌មាន​ចាំបាច់​ដែល​ត្រូវ​បំពេញ","validator.email":"សូម​វាយ​អាសយដ្ឋាន​អ៊ីម៉ែល​ឲ្យ​បាន​ត្រឹមត្រូវ","validator.number":"សូម​វាយបញ្ចូល​លេខ​ឲ្យ​បាន​ត្រឹមត្រូវ","validator.digits":"វាយ​បញ្ចូល​បាន​តែ​លេខ​ប៉ុណ្ណោះ","validator.maxlength":"សូម​វាយ​បញ្ចូលកុំ​ឲ្យ​លើស {0} តួអក្សរ","validator.minlength":"សូម​វាយ​បញ្ចូល​តិច​បំផុត {0} តួអក្ស","validator.phone":"សូម​វាយបញ្ចូល​លេខ​ឲ្យ​បាន​ត្រឹមត្រូវ","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"zh-TW":{"validator.required":"此為必填欄位","validator.email":"請填入有效的 email 地址","validator.number":"請填入有效的電話號碼","validator.digits":"此欄位僅能輸入數字","validator.maxlength":"請輸入少於 {0} 位數","validator.minlength":"請輸入至少 {0} 位數","validator.phone":"請填入有效的電話號碼","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"th-TH":{"validator.required":"ต้องระบุข้อมูลในช่องนี้","validator.email":"กรุณาใส่อีเมล์ที่ถูกต้อง","validator.number":"กรุณาใส่ตัวเลขที่ถูกต้อง","validator.digits":"กรุณาส่เฉพาะตัวเลข","validator.maxlength":"กรุณาใส่ตัวเลขมากกว่า {0} หลัก","validator.minlength":"กรุณาใส่ตัวเลขอย่างน้อย {0} หลัก","validator.phone":"กรุณาใส่ตัวเลขที่ถูกต้อง","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"tl-PH":J},G=e=>{const t=z[e];return t||z["en-PH"]},K=l({}),Q=e=>{const[t,a]=n(16),[l,i]=n(9),[r,d]=n(!1);return o((()=>{if(d(!1),e){const t=new Image;t.addEventListener("load",(()=>{a(t.naturalWidth),i(t.naturalHeight),d(!0)})),t.addEventListener("error",(()=>{a(16),i(9),d(!0)})),t.src=e}else a(16),i(9),d(!0)}),[e]),{loaded:r,width:t,height:l}},X=({onClose:e,containerClassName:t,svgClassName:l})=>a.createElement("button",{onClick:e,className:`le-newbuilder-close-button js-modal__close ${t||""}`},a.createElement("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:l},a.createElement("circle",{cx:"16",cy:"16",r:"16",fill:"white"}),a.createElement("path",{d:"M16 17.05L10.925 22.125C10.7917 22.2584 10.621 22.329 10.413 22.337C10.2044 22.3457 10.025 22.275 9.87502 22.125C9.72502 21.975 9.65002 21.8 9.65002 21.6C9.65002 21.4 9.72502 21.225 9.87502 21.075L14.95 16L9.87502 10.925C9.74169 10.7917 9.67102 10.6207 9.66302 10.412C9.65436 10.204 9.72502 10.025 9.87502 9.87502C10.025 9.72502 10.2 9.65002 10.4 9.65002C10.6 9.65002 10.775 9.72502 10.925 9.87502L16 14.95L21.075 9.87502C21.2084 9.74169 21.3794 9.67069 21.588 9.66202C21.796 9.65402 21.975 9.72502 22.125 9.87502C22.275 10.025 22.35 10.2 22.35 10.4C22.35 10.6 22.275 10.775 22.125 10.925L17.05 16L22.125 21.075C22.2584 21.2084 22.329 21.379 22.337 21.587C22.3457 21.7957 22.275 21.975 22.125 22.125C21.975 22.275 21.8 22.35 21.6 22.35C21.4 22.35 21.225 22.275 21.075 22.125L16 17.05Z",fill:"#595959"}))),Z=({popupId:e,url:t,newTab:l,imageDestkop:n,imageMobile:o,onClose:i,onOtherSubmit:r})=>{const{width:d,height:s,loaded:c}=Q(o),{width:m,height:u,loaded:p}=Q(n);return c&&p?a.createElement("div",{id:e,className:"lead-modal-wrapper","data-popup-url":location.pathname,"data-popup-type":"center_tab"},a.createElement("div",{className:"le-center-tab-popup"},a.createElement("div",{style:{position:"relative"}},a.createElement("a",{className:"js-popup-other-submit",href:t,target:l?"blank":"_parent",onClick:r},a.createElement("img",{className:"le-only-mobile",src:o,style:{aspectRatio:`${d}/${s}`}}),a.createElement("img",{className:"le-only-desktop",src:n,style:{aspectRatio:`${m}/${u}`}})),a.createElement(X,{onClose:i,containerClassName:"close-button-top-right"})))):null},ee=({popupId:e,url:t,title:l,urlText:n,titleAlign:o,subtitle:i,subtitleAlign:r,newTab:d,imageDesktop:s,imageMobile:c,onClose:m,onOtherSubmit:u})=>{const{width:p,height:h,loaded:g}=Q(c),{width:v,height:b,loaded:f}=Q(s);return g&&f?a.createElement("div",{id:e,className:"lead-modal-wrapper lead-floating-wrapper","data-popup-url":location.pathname,"data-popup-type":"floating"},a.createElement("aside",{className:"le-only-desktop"},a.createElement("div",{className:"le-floating-desktop"},a.createElement("div",{className:"le-floating-desktop-wrap",style:{position:"relative",background:"#fff"}},s?a.createElement("div",null,a.createElement("img",{style:{maxWidth:120,borderTopLeftRadius:5,borderBottomLeftRadius:5,aspectRatio:`${v}/${b}`},src:s})):null,a.createElement("div",{style:{padding:20}},a.createElement("div",{className:`le-floating-desktop-title le-text-align-${o}`},l),a.createElement("div",{className:`le-floating-desktop-desc le-text-align-${r}`},i)),a.createElement("a",{target:d?"blank":"_parent",style:{marginLeft:35,textDecoration:"none"},href:t},a.createElement("button",{className:"le-joinbow-floating-btn js-popup-other-submit",onClick:u},n)),a.createElement(X,{onClose:m,containerClassName:"close-button-top-right"})))),a.createElement("aside",{className:"le-only-mobile"},a.createElement("div",{className:"le-floating-mobile"},a.createElement("div",{className:"le-floating-mobile-wrap",style:{position:"relative",background:"#fff"}},a.createElement("aside",{style:{display:"flex",justifyContent:"space-between"}},a.createElement("div",null,a.createElement("div",{className:`le-floating-mobile-title le-text-align-${o}`},l),a.createElement("div",{className:`le-floating-mobile-desc le-text-align-${r}`},i)),c?a.createElement("div",null,a.createElement("img",{style:{marginLeft:15,marginTop:4,maxWidth:100,aspectRatio:`${p}/${h}`},src:c})):null),a.createElement("div",{style:{textAlign:"center",marginTop:10}},a.createElement("a",{target:d?"blank":"_parent",href:t,style:{textDecoration:"none"}},a.createElement("button",{className:"le-joinbow-floating-btn js-popup-other-submit",onClick:u},n))),a.createElement(X,{onClose:m,containerClassName:"close-button-top-right"}))))):null},te="undefined"==typeof window,ae={VN:"vi",ID:"id",TH:"th",MY:"ms",TW:"zh-TW",KH:"km",MM:"my",IN:"hi",PH:"en"},le=(t="",a="",l="",i=500)=>{const[r,d]=n([]),[s,c]=n(!1);return o((()=>{let n;return t?n=window.setTimeout((()=>e(void 0,void 0,void 0,(function*(){var n;if(t)try{c(!0);const o=yield((t="",a="",l="vi")=>e(void 0,void 0,void 0,(function*(){return new Promise(((e,n)=>{if(!t)return n("Need valid text input");if(te)return n("Need valid window object");try{(new window.google.maps.places.AutocompleteService).getPlacePredictions(Object.assign(Object.assign({input:t},a?{componentRestrictions:{country:a}}:{}),{language:ae[l]}),e)}catch(e){n(e)}}))})))(t,a,l);d(!(n=o)||n.length<1?[]:n.map((e=>({placeId:e.place_id,description:e.description}))))}catch(e){console.error(e)}finally{c(!1)}else d([])}))),i):r.length&&d([]),()=>{window.clearTimeout(n)}}),[t,i,a]),{isLoading:s,predictions:r}};const ne=new class{constructor(){this.apiLeadUrl="https://dev.leadgen.hellobacsi.com/",this.apiSubotUrl="https://staging-service-subot.hellohealthgroup.com/"}},oe={call(e){var{url:a,data:l}=e,n=t(e,["url","data"]);return n.body=JSON.stringify(l),n.headers={"Content-Type":"application/json"},fetch(`${ne.apiLeadUrl}${a}`,n).then((e=>e.json())).catch((()=>({})))}},ie={call(e){var{url:a,data:l}=e,n=t(e,["url","data"]);return n.body=JSON.stringify(l),n.headers={"Content-Type":"application/json"},fetch(`${ne.apiSubotUrl}${a}`,n).then((e=>e.json())).catch((()=>({})))}},re=({bot_id:e,email:t,phone:a})=>{let l=a;return l&&l.startsWith("0")&&(l=l.substring(1)),ie.call({url:"frontend/api/subot-campaign/check",method:"post",data:{bot_id:e,email:t,phone:l}})},de=({campaign_id:e,email:t,phone:a})=>{let l=a;return l&&l.startsWith("0")&&(l=l.substring(1)),oe.call({url:"api/subot-campaign/check",method:"post",data:{campaign_id:e,email:t,phone:l}})},se=({phone:e})=>oe.call({url:"api/sms/otp",method:"post",data:{phone_number:e.replace("+","")}}),ce=({phone:e,otp:t})=>oe.call({url:"api/sms/verify",method:"post",data:{otp_code:t,phone_number:e.replace("+","")}}),me={email:{},phone:{}},ue=(t,a,l)=>e(void 0,void 0,void 0,(function*(){const n="email"in l?"email":"phone",o="email"in l?l.email:l.phone,i="email"in l?"validator.emailUsed":"validator.phoneUsed";if(me[n][o]){if(me[n][o].value)return i;if(!me[n][o].value&&me[n][o].expire>Date.now())return""}const r=yield((t,a,l)=>e(void 0,void 0,void 0,(function*(){const e="email"in l?"email":"phone",n="email"in l?l.email:l.phone,o="email"in l?"validator.emailUsed":"validator.phoneUsed",i=yield de({campaign_id:[t],[e]:n});return"SubmitLeadWithBotId_ERR_001"===i._errorCode||"SubmitLeadWithBotId_ERR_002"===i._errorCode||a.length&&"CheckSuBotLeadTool_ERR_001"===(yield re({bot_id:a,[e]:n}))._errorCode?o:void 0})))(t,a,l);return me[n][o]=r?{value:!0}:{value:!1,expire:Date.now()+6e4},r})),[pe,he,ge]=B(),ve=["places"],be=({name:e,placeholder:t,locale:l})=>{var d;const s=he(),[c,m]=n(""),[u,p]=n(""),{predictions:h}=le(c,"","tl-PH"===l?"en":null===(d=null==l?void 0:l.split("-"))||void 0===d?void 0:d[0]),[g,v]=n(null),[b,f]=n(!1),y=r(Math.random().toString(36).substring(7)),k=i((()=>{const e=h.map((e=>({value:e.description,label:e.description}))),t=e.find((e=>e.value===u));return!u||t?e:[{value:u,label:u}].concat(e)}),[h,u]);return o((()=>{var e,t,a;(null===(a=null===(t=null===(e=null===window||void 0===window?void 0:window.google)||void 0===e?void 0:e.maps)||void 0===t?void 0:t.places)||void 0===a?void 0:a.AutocompleteService)?f(!0):import("@react-google-maps/api").then((e=>{v((()=>e.LoadScript)),setTimeout((()=>{f(!0)}),200)}))}),[]),b?a.createElement(a.Fragment,null,g&&a.createElement(g,{googleMapsApiKey:"AIzaSyD9AbNa4AFwr8eNVs90G1YhQLhfWJ6KncU",libraries:ve,loadingElement:a.createElement(a.Fragment,null)}),a.createElement("div",{style:{display:"none"},"data-extra":!0,"data-name":e,"data-control":"text"}),a.createElement(j,Object.assign({className:"lead-modal__form-control",label:t,placeholder:t,withAsterisk:!0,name:e,data:k,searchValue:c,onSearchChange:e=>{m(e)},filter:()=>!0,clearable:!0,searchable:!0,onChange:e=>p(e||""),icon:a.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a.createElement("path",{d:"M9.99999 9.79167C10.4028 9.79167 10.7467 9.64944 11.0317 9.365C11.3161 9.08 11.4583 8.73611 11.4583 8.33333C11.4583 7.93056 11.3161 7.58667 11.0317 7.30167C10.7467 7.01722 10.4028 6.875 9.99999 6.875C9.59721 6.875 9.25332 7.01722 8.96832 7.30167C8.68388 7.58667 8.54166 7.93056 8.54166 8.33333C8.54166 8.73611 8.68388 9.08 8.96832 9.365C9.25332 9.64944 9.59721 9.79167 9.99999 9.79167ZM9.99999 17.875C9.90277 17.875 9.80555 17.8611 9.70832 17.8333C9.6111 17.8056 9.52082 17.7569 9.43749 17.6875C7.46527 15.8958 5.98971 14.2361 5.01082 12.7083C4.03138 11.1806 3.54166 9.77778 3.54166 8.5C3.54166 6.48611 4.1911 4.87833 5.48999 3.67667C6.78832 2.47556 8.29166 1.875 9.99999 1.875C11.7083 1.875 13.2119 2.47556 14.5108 3.67667C15.8092 4.87833 16.4583 6.48611 16.4583 8.5C16.4583 9.77778 15.9689 11.1806 14.99 12.7083C14.0105 14.2361 12.5347 15.8958 10.5625 17.6875C10.4792 17.7569 10.3889 17.8056 10.2917 17.8333C10.1944 17.8611 10.0972 17.875 9.99999 17.875Z",fill:"#8C8C8C"})),autoComplete:"no-auto-complete-"+y.current,rightSection:a.createElement(a.Fragment,null)},s.getInputProps(e)))):a.createElement("div",{style:{height:73}})},fe=({children:e,align:t})=>a.createElement("p",{className:`lead-modal__description ${"le-text-align-"+(t||"")} ${F}`},e),ye=({children:e,align:t})=>a.createElement("h2",{className:`lead-modal__title ${"le-text-align-"+(t||"")} ${F}`},e),ke=({listBlockAdded:e,popupId:t,locale:l,onClose:n,onOtherSubmit:o})=>{const i=he();return a.createElement(a.Fragment,null,e.map(((e,r)=>{const{name:d="",data:s={}}=e||{},{placeholder:c,value:m,align:p,listQuestion:h,isSendMailChimp:g=!1,newtab:v,url:b}=s;switch(d){case"TitleBlock":return a.createElement(ye,{key:r,align:p},m);case"SubtitleBlock":return a.createElement(fe,{key:r,align:p},m);case"TextBlock":return a.createElement(E,Object.assign({key:r,withAsterisk:!0,spellCheck:!1,type:"text",placeholder:c,className:"lead-modal__form-control",label:c,"data-control":"text",name:m},i.getInputProps(m)));case"NumberBlock":return a.createElement(x,Object.assign({key:r,withAsterisk:!0,spellCheck:!1,type:"number",placeholder:c,className:"lead-modal__form-control",label:c,"data-control":"number",name:m},i.getInputProps(m)));case"EmailBlock":return a.createElement(E,Object.assign({key:r,withAsterisk:!0,spellCheck:!1,placeholder:c,className:"lead-modal__form-control",label:c,"data-control":"email",name:m},i.getInputProps(m)));case"PhoneOtpBlock":case"PhoneBlock":{const e=t+"-"+m+"-"+r;return a.createElement(E.Wrapper,Object.assign({size:"md",withAsterisk:!0,key:r,label:c,className:"lead-modal__form-control",labelProps:{htmlFor:e}},i.getInputProps(m)),a.createElement(N,{name:m,spellCheck:!1,type:"tel",placeholder:c,onChange:e=>{i.setFieldValue(m,e)},id:e,defaultCountry:l&&O[l]||"VN","data-control":"tel"}))}case"LocationBlock":return a.createElement(be,{key:r,name:m,placeholder:c,locale:l});case"DateBlock":return a.createElement(P,Object.assign({withAsterisk:!0,key:r,type:"default",name:m,placeholder:c,className:"lead-modal__form-control",label:c,"data-control":"date"},i.getInputProps(m)));case"LinkButtonBlock":return a.createElement("div",{key:r},a.createElement("a",{target:v?"blank":"parrent",href:b,style:{textDecoration:"none"}},a.createElement(u,{type:"button",size:"md",className:`lead-modal__btn ${F}`,onClick:()=>{null==n||n(),null==o||o()}},m)));case"CheckboxBlock":return a.createElement(a.Fragment,null,g&&a.createElement("div",{style:{display:"none"},"data-name":m+"-mailchimp"}),a.createElement(C.Group,Object.assign({withAsterisk:!0,className:"lead-modal__form-control",key:r,label:c,size:"md",sx:{display:"flex",flexDirection:"column",gap:8}},i.getInputProps(m)),h.map(((e,t)=>a.createElement(C,{name:m,key:t,value:e.value,label:e.placeholder,"data-control":"checkbox"})))));case"RadioBlock":return a.createElement(a.Fragment,null,g&&a.createElement(E,{type:"hidden",name:m+"-mailchimp",value:g}),a.createElement(w.Group,Object.assign({withAsterisk:!0,className:"lead-modal__form-control",key:r,label:c,size:"md"},i.getInputProps(m)),h.map(((e,t)=>a.createElement(w,{name:m,key:t,value:e.value,label:e.placeholder,"data-control":"radio"})))));case"DropdownBlock":return a.createElement(a.Fragment,null,a.createElement("div",{style:{display:"none"},"data-extra":!0,"data-name":m,"data-control":"dropdown"}),a.createElement(j,Object.assign({key:r,className:"lead-modal__form-control",label:c,withAsterisk:!0,name:m,data:h.map((e=>({value:e.value,label:e.placeholder})))},i.getInputProps(m))))}return null})))},_e=({phone:t,onSuccess:l,autoSendWhenOpen:i})=>{const{t:d}=$(),[s,c]=n(""),[p,h]=n(!1),[g,v]=n(0),b=r(null),[f,y]=n(),[_,w]=n(""),C=r();o((()=>{e(void 0,void 0,void 0,(function*(){var e;if(!C.current){const e=yield import("react-phone-number-input");C.current=e.formatPhoneNumberIntl}w((null===(e=C.current)||void 0===e?void 0:e.call(C,t))||t)}))}),[t]);const N=()=>e(void 0,void 0,void 0,(function*(){var e;if(!t)return;const a=yield se({phone:t}),n=null===(e=null==a?void 0:a._messages)||void 0===e?void 0:e[0];"Send sms successfully"===n?(v(60),setTimeout((()=>{b.current&&(b.current.focus(),b.current.scrollIntoView({block:"center"}))}),100)):"This phone number was verified"===n?l():y(n||"something Wrong")}));return o((()=>{setTimeout((()=>{g>0&&v((e=>e-1))}),1e3)}),[g]),o((()=>{i&&!g&&N()}),[]),a.createElement(a.Fragment,null,a.createElement("form",{onSubmit:a=>{a.preventDefault(),e(void 0,void 0,void 0,(function*(){if(!t||!s)return;const e=yield ce({phone:t,otp:s}),a=null==e?void 0:e._messages[0];"Verify successfully"===a||"This phone number was verified"===a?l():y(a||"something Wrong")}))},className:"lead-phone-otp-form"},a.createElement(m,{tag:"h3",fontWeight:"bold",style:{marginBottom:4}},d("lead.otp.title")),a.createElement(L,{size:"p1",color:k.colors.gray600},d("lead.otp.desc",{phone:_})),a.createElement(E,{ref:b,name:"_"+name+"-otp",spellCheck:!1,type:"number",placeholder:"Enter OTP",className:"lead-modal__form-control",label:"Phone OTP","data-control":"otp",withAsterisk:!0,pattern:"[0-9]*",value:s,onChange:e=>{h(!0),c(e),y(p&&!e?"OTP is required":void 0)},error:p?f:void 0}),a.createElement(u,{size:"md",color:"primary",className:`lead-modal__btn ${F}`,disabled:!s},d("lead.otp.verify")),a.createElement(u,{type:"button",size:"md",color:"transparent",className:`lead-modal__btn lead-phone-otp-button ${F}`,onClick:()=>{N()},disabled:!!g},d("lead.otp.resend",{timer:g?` (${g}s)`:""}))))},Ee=({title:e,titleAlign:t,subtitle:l,subtitleAlign:n,link:o,linkNewTab:i,linkText:r,image:d})=>{const{width:s,height:c,loaded:m}=Q(d);return m?a.createElement("div",{className:"lead-modal__thank-you"},a.createElement("div",{style:{width:"100%"}},a.createElement("img",{src:d,style:{maxHeight:162,objectFit:"cover",aspectRatio:`${s}/${c}`}}),e&&a.createElement("h1",{className:`le-thankyou-title le-text-align-${t}`},e),l&&a.createElement("p",{className:`le-thankyou-subtitle le-text-align-${n}`},l),r&&a.createElement("div",null,a.createElement("a",{href:o,target:i?"_blank":"parrent",rel:"noreferrer"},a.createElement("button",{className:`lead-modal__btn ${F}`},r))))):null},we=({content:e,inlinePosition:t})=>{const a=i((()=>{if(!t)return null;const e=document.querySelectorAll(`[data-url="${location.pathname}"] .body-content`),a=Array.from(e).reduce(((e,t)=>[...e,...Array.from(t.children)]),[]);if(null==a?void 0:a.length){const e=a.filter((e=>"P"===e.nodeName)),l=a.filter((e=>"H2"===e.nodeName));let n=null;switch(t){case"1th":n=e[0];break;case"2th":n=e[1];break;case"3th":n=e[2];break;case"4th":n=e[3];break;case"5th":n=e[4];break;case"6th":n=e[5];break;case"7th":n=e[6];break;case"8th":n=e[7];break;case"9th":n=e[8];break;case"10th":n=e[9];break;case"11th":n=e[10];break;case"12th":n=e[11];break;case"lastP":n=e[e.length-1];break;case"1thH2":n=l[0];break;case"2thH2":n=l[1];break;case"3thH2":n=l[2];break;case"4thH2":n=l[3];break;case"5thH2":n=l[4];break;case"6thH2":n=l[5];break;case"7thH2":n=l[6];break;case"8thH2":n=l[7];break;case"9thH2":n=l[8];break;case"10thH2":n=l[9];break;case"lastH2":n=l[l.length-1]}if(n){if(n.parentElement.querySelector(".inline-lead-wrapper"))return n.parentElement.querySelector(".inline-lead-wrapper");{const e=document.createElement("div");return e.classList.add("inline-lead-wrapper"),n.nextElementSibling?n.parentElement.insertBefore(e,n.nextElementSibling):n.parentElement.appendChild(e),e}}}}),[t]);return t&&a?T(e,a):null},Ce=({content:e})=>{const t=i((()=>{const e=Array.from(document.querySelectorAll(".hc2-sidebar-with-ads,.page-main-col .right-col.f-right,.hhg-lead-sidebar"));return e.forEach((e=>{if(e.querySelector(".sidebar-lead-modal-wrapper"))return;const t=document.createElement("div");t.classList.add("sidebar-lead-modal-wrapper"),e.prepend(t)})),e.map((e=>e.querySelector(".sidebar-lead-modal-wrapper")))}),[]);return a.createElement(a.Fragment,null,t.map((t=>T(e,f(t,"sidebar-lead-modal-wrapper")))))},Ne=({popupId:e,extraFields:t,onClose:l,onOtherSubmit:d,imageMobile:s,imageDesktop:c,imageOverlayMobile:m,imageOverlayDesktop:h,imageBackground:g,currentLayout:v,title:b,onSubmit:f,showThankyou:y,campaignId:k,campaign_subot_id:_,locale:E})=>{var w,C,N;const x=JSON.parse(t.listBlockAdded),S=JSON.parse(t.actionBlocks),T=JSON.parse(t.textBlocks),O=S.submitBlock.data.url,P=S.submitBlock.data.text,j=S.submitBlock.data.text2,B=S.submitBlock.data.value,L=location.pathname,I=v.includes("Inline")||"Sidebar"===v,A="Slider"===v,[U,D]=n(!0),[R,H]=n(""),M=r(),W=()=>{R?H(""):null==l||l()};if(window.innerWidth<769&&["Fullscreen","Slider"].includes(v))return console.log("😎 Not show fullscreen, slider on mobile "),null;o((()=>{(v.includes("LightBox")||"Fullscreen"==v)&&document.body.classList.add("noscroll"),window.intlTelInputUtils||require("intl-tel-input/build/js/utils"),me.email={},me.phone={}}),[]);const V=r(!1),Y=r(!1),{form:J,validateObj:z}=(({listBlockAdded:e=[],validatingPhoneRef:t,validatingEmailRef:a,campaignId:l,campaign_subot_id:n=[]})=>{const{t:o}=$(),d=i((()=>{const i=["TextBlock","NumberBlock","EmailBlock","PhoneBlock","DateBlock","CheckboxBlock","RadioBlock","DropdownBlock","PhoneOtpBlock","LocationBlock"],r=(e,t)=>a=>{if(c.current.isTouched(e))return void 0===a||""===a||Array.isArray(a)&&0===a.length?o("validator.required"):null==t?void 0:t(a)};return e.filter((e=>i.includes(e.name))).reduce(((e,i)=>"NumberBlock"===i.name?Object.assign(Object.assign({},e),{[i.data.value]:r(i.data.value,(e=>{if(isNaN(Number(e)))return o("validator.number")}))}):"EmailBlock"===i.name?Object.assign(Object.assign({},e),{[i.data.value]:r(i.data.value,(e=>{if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e))return o("validator.email");a.current=!0,setTimeout((()=>{c.current.setFieldError(i.data.value,"Validating..."),ue(l,n,{email:e}).then((e=>{e?c.current.setFieldError(i.data.value,o(e)):c.current.clearFieldError(i.data.value),a.current=!1})).catch((e=>{console.error(e),c.current.setFieldError(i.data.value,e.message||"Something went wrong"),a.current=!1}))}),200)}))}):"PhoneBlock"===i.name||"PhoneOtpBlock"===i.name?Object.assign(Object.assign({},e),{[i.data.value]:r(i.data.value,(e=>{if(window.intlTelInputUtils&&!window.intlTelInputUtils.isValidNumber(String(e),q.countryCode))return o("validator.phone");t.current=!0,setTimeout((()=>{c.current.setFieldError(i.data.value,"Validating..."),ue(l,n,{phone:e}).then((e=>{e?c.current.setFieldError(i.data.value,o(e)):c.current.clearFieldError(i.data.value),t.current=!1})).catch((e=>{console.error(e),c.current.setFieldError(i.data.value,e.message||"Something went wrong"),t.current=!1}))}),200)}))}):"DateBlock"===i.name?Object.assign(Object.assign({},e),{[i.data.value]:r(i.data.value,(e=>{if(isNaN(Date.parse(e)))return o("validator.date")}))}):Object.assign(Object.assign({},e),{[i.data.value]:r(i.data.value)})),{})}),[e.map((e=>e.name)).join(",")]),s=ge({validateInputOnChange:!0,clearInputErrorOnChange:!0,validate:d}),c=r(s);return c.current=s,{form:s,validateObj:d}})({listBlockAdded:x,validatingPhoneRef:V,validatingEmailRef:Y,campaignId:k,campaign_subot_id:_}),{width:G,height:K,loaded:Z}=Q(g),{width:ee,height:te,loaded:ae}=Q(s),{width:le,height:ne,loaded:oe}=Q(c),ie=ae&&oe&&("Fullscreen"!=v||Z),re=a.createElement(a.Fragment,null,a.createElement("style",{dangerouslySetInnerHTML:{__html:`\n .le-newbuilder-overlay {\n background-repeat: no-repeat;\n background-size: cover;\n }\n ${m?`\n .le-newbuilder-overlay {\n background: url(${m}) ;\n }`:""}\n ${h?`\n @media screen and (min-width:768px) {\n .le-newbuilder-overlay {\n background: url(${h}) ;\n }\n }`:""}`}}),a.createElement("div",{id:e,"data-popup-url":L,"data-popup-type":"lightbox-inline",className:`lead-modal lead-modal-wrapper modal--animate-scale ${I?"le-buider-inline":""} ${A?"le-buider-slider":""}`},"Fullscreen"==v?a.createElement("img",{className:"le-only-desktop le-fullscreen-img",draggable:!1,src:g||"",style:{aspectRatio:`${G}/${K}`}}):null,a.createElement("div",{className:`lead-modal__wrapper le-newbuilder-wrap-${v}`},a.createElement("div",{className:`lead-modal__content le-newbuilder-${v}`},y?a.createElement(Ee,{title:y.title,titleAlign:y.titleAlign,subtitle:y.subtitle,subtitleAlign:y.subtitleAlign,link:y.link,linkNewTab:y.linkNewTab,linkText:y.linkText,image:y.image}):a.createElement(a.Fragment,null,a.createElement("header",{className:"lead-modal__header"},R?a.createElement("img",{src:p.getAssetPath("lead-otp-thumb.png"),draggable:"false",alt:"",style:{width:"100%"}}):a.createElement(a.Fragment,null,["LightBoxA","InlineA","Sidebar","Slider"].includes(v)?s?a.createElement("img",{draggable:"false",className:"lead-modal__image lead-modal-image-cover",src:s,style:{aspectRatio:`${ee}/${te}`},alt:""}):null:a.createElement(a.Fragment,null,c?a.createElement("img",{draggable:"false",className:"le-only-desktop lead-modal__image lead-modal-image-cover",style:{height:"100%",objectFit:"cover",aspectRatio:`${le}/${ne}`},src:c,alt:""}):null,s?a.createElement("img",{draggable:"false",className:"le-only-mobile lead-modal__image lead-modal-image-cover",src:s,alt:"",style:{aspectRatio:`${ee}/${te}`}}):null))),R&&a.createElement(_e,{phone:R,autoSendWhenOpen:!0,onSuccess:()=>{null==f||f(M.current,J.values)}}),a.createElement("div",{"data-hidden":!!R,className:"lead-modal__body le-newbuilder-overlay"},a.createElement(pe,{form:J},a.createElement("form",{ref:M,className:`lead-modal__form ${e}`,onSubmit:e=>{e.preventDefault(),J.setTouched(Object.keys(z).reduce(((e,t)=>(e[t]=!0,e)),{})),Y.current||V.current||setTimeout((()=>{J.onSubmit((e=>{var t,a,l;if(!Object.keys(J.errors).length){if(x.findIndex((e=>"PhoneOtpBlock"===e.name))>-1){const n=null===(a=null===(t=x.find((e=>"PhoneOtpBlock"===e.name)))||void 0===t?void 0:t.data)||void 0===a?void 0:a.value;if(null===(l=e[n])||void 0===l?void 0:l.startsWith("+84"))return void H(e[n])}null==f||f(M.current,e)}}))(e)}),100)}},a.createElement("div",{style:{marginBottom:20}},a.createElement("h2",{className:`lead-modal__title ${"le-text-align-"+(null===(w=T.titleBlock.data)||void 0===w?void 0:w.align)} ${F}`},b),a.createElement("p",{className:`lead-modal__description ${"le-text-align-"+(null===(C=T.titleBlock.data)||void 0===C?void 0:C.align)} ${F}`},T.subtitleBlock.data.value)),a.createElement("div",{className:"lead-modal__form-control-wrapper"},a.createElement(ke,{listBlockAdded:x,popupId:e,locale:E,onClose:W,onOtherSubmit:d})),(null===(N=null==S?void 0:S.submitBlock)||void 0===N?void 0:N.isHide)?null:a.createElement(a.Fragment,null,a.createElement("div",{className:`lead-modal__checkbox-wrapper ${F}`},a.createElement("div",{className:"lead-modal__checkbox"},a.createElement("input",{id:"lead-term-checkbox",className:`lead-modal__checkbox__input ${F}`,type:"checkbox","aria-label":"Checkbox label",checked:U,onChange:e=>D(e.currentTarget.checked)}),a.createElement("div",{className:"lead-modal__checkbox__control","aria-hidden":"true"})),a.createElement("label",{htmlFor:"checkbox",className:"lead-modal__checkbox__label"},P," ",a.createElement("span",{style:{fontWeight:"bold"}},a.createElement("a",{target:"blank",href:O||"https://hellobacsi.com/chinh-sach",rel:"noopener noreferrer",style:{textDecoration:"none"}},j)))),a.createElement(u,{size:"md",id:"lead-submit",type:"submit",className:`lead-modal__btn ${F}`,disabled:!U},B))))))),!v.includes("Inline")&&a.createElement(X,{onClose:W,containerClassName:"close-button-top-right"}))));return ie?v.includes("LightBox")||"Fullscreen"==v||"Slider"==v?re:"Sidebar"==v?a.createElement(Ce,{content:re}):v.includes("Inline")?a.createElement(we,{content:re,inlinePosition:t.popupInlinePosition}):null:null},xe=({popupId:e,link:t,linkText:l,linkNewTab:n,onClose:o,imageMobile:i,imageDesktop:r,currentLayout:d,onOtherSubmit:s})=>{const c=location.pathname,{width:m,height:u,loaded:p}=Q(i),{width:h,height:g,loaded:v}=Q(r);return p&&v?a.createElement("div",{id:e,className:"lead-modal-wrapper","data-popup-url":c,"data-popup-type":"skin_ab"},"SkinA"==d?a.createElement("aside",{className:"le-only-desktop"},a.createElement("div",{className:"le-skin-a-desktop"},a.createElement("div",{style:{position:"relative"}},a.createElement("img",{src:r,style:{aspectRatio:`${h}/${g}`}}),a.createElement("a",{style:{position:"absolute",top:"75%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center",width:"calc(100% - 15px)"},href:t,target:n?"blank":"_parent"},a.createElement("button",{onClick:s,className:"le-joinbow-btn js-popup-other-submit"},l)),a.createElement(X,{onClose:o,containerClassName:"close-button-top-right"})))):"SkinB"==d?a.createElement("aside",{className:"le-only-desktop"},a.createElement("div",{className:""},a.createElement("div",{style:{position:"relative",zIndex:1e4}},a.createElement("img",{src:r,style:{width:"100%",aspectRatio:`${h}/${g}`}}),a.createElement("a",{style:{position:"absolute",top:"75%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center",width:"100%"},href:t,target:n?"blank":"_parent"},a.createElement("button",{onClick:s,className:"le-joinbow-btn-mobile js-popup-other-submit"},l)),a.createElement(X,{containerClassName:"close-button-top-right",onClose:o})))):null,a.createElement("aside",{className:"le-only-mobile"},a.createElement("div",{className:"le-skin-mobile"},a.createElement("div",{style:{position:"relative"}},a.createElement("img",{src:i,style:{width:"100%",aspectRatio:`${m}/${u}`}}),a.createElement("a",{style:{position:"absolute",top:"82%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center",maxWidth:"calc(100% - 15px)"},href:t,target:n?"blank":"_parent"},a.createElement("button",{onClick:s,className:"le-joinbow-btn-mobile js-popup-other-submit"},l)),a.createElement(X,{containerClassName:"close-button-top-right",svgClassName:"le-mobile-btn",onClose:o}))))):null},Se=({popupId:e,url:t,newTab:l,image:n,onClose:o,onOtherSubmit:i})=>{const{width:r,height:d,loaded:s}=Q(n);return s?a.createElement("div",{id:e,className:"lead-modal-wrapper","data-popup-url":location.pathname,"data-popup-type":"tab"},a.createElement("div",{className:"le-tab-popup"},a.createElement("div",{style:{position:"relative"}},a.createElement("a",{href:t,target:l?"blank":"_parent",onClick:i},a.createElement("img",{className:"js-popup-other-submit",src:n,style:{aspectRatio:`${r}/${d}`}})),a.createElement(X,{onClose:o,containerClassName:"close-button-top-right"})))):null},Te=[],Oe=[],Pe=[];const je=(e="UTC")=>{const t=new Date;return new Date(t.toLocaleString("en-US",{timeZone:e}))},Be=e=>{try{const[t,a]=e.split(" "),[l,n,o]=t.split("-").map(Number),[i,r,d]=a.split(":").map(Number);return new Date(l,n-1,o,i,r,d)}catch(e){return null}};const $e=e=>1===e.formatted_status?function(e){var t;if(1===e.forever)return!0;const a=e.started_at,l=e.ended_at,n=Be(a),o=Be(l);if(!n||!o)return!0;const i=(null===(t=e.site)||void 0===t?void 0:t.id)||1;return!(je(Y[i]).getTime()>o.getTime()&&(Pe.push(e),1))}(e):0===e.formatted_status&&(Te.push(e),(e=>{var t;const a=(null===(t=e.site)||void 0===t?void 0:t.id)||1,l=e.started_at,n=e.ended_at,o=Be(l),i=Be(n);if(!o||!i)return!1;const r=je(Y[a]).getTime();return r<=i.getTime()&&r>=o.getTime()&&(Oe.push(e),!0)})(e));let Le=null;function Ie({leadApi:e,leadSiteId:t,leadDomain:a,onShowPopup:l,DEBUG_URL:n}){const o=n||("https://"+location.hostname+location.pathname+location.search).toLowerCase();fetch(e+"api/campaign/"+t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:o,ga_client_id:I("_ga")||null})}).then((e=>e.json())).then((e=>{var t,n,i,r,d;if(Ae("List campagin: ",e),W="https://"+location.hostname+location.pathname+location.search,1==e._status){const s=(null===(n=null===(t=e._data)||void 0===t?void 0:t.campaigns)||void 0===n?void 0:n.filter($e))||[];I("hhg-id")||(A("hhg-id",c(),{domain:"."+a,path:"/"}),Ae("😍 Set HHG ID cookie"));let m=[];m=/Android|webOS|iPhone|iPad|iPod|BlackBerry|BB|PlayBook|IEMobile|Windows Phone|Kindle|Silk|Opera Mini/i.test(navigator.userAgent)?s.filter((e=>e.device_types.some((e=>e.id==H)))):s.filter((e=>e.device_types.some((e=>e.id==M)))),Ae("👓 campaignsDevice",m),Ae("--listCampaignScheduled",Te),Ae("--listCampaignScheduledToActivated",Oe),Ae("--listCampaignActiveButExpired",Pe);let u=m.map(((e,t)=>e.targets.filter((e=>e.type==U)).map((e=>Object.assign(Object.assign({},e),{campaignIndex:t}))))).flat(1);u=u.filter((e=>{const t=new URL(String(e.target).toLowerCase());if("exact_match"==e.option)return Boolean(o===t.href);if("start_with"==e.option){if(o.includes(String(e.target))){return!e.sub_target.filter((e=>"excluding"==e.option)).map((e=>e.value)).includes(o.split("?")[0])}return!1}}));const p=Array.from(document.getElementsByTagName("META")).filter((e=>"article:tag"==e.getAttribute("property"))).map((e=>e.content));let h=[],g=[];p&&p.length&&(h=m.map(((e,t)=>e.targets.filter((e=>e.type==D)).map((e=>Object.assign(Object.assign({},e),{campaignIndex:t}))))).flat(1),g=h.filter((e=>p.includes(e.target))));const v=[...u,...g],b=document.cookie.split("; ").map((e=>e.split("=")[0])),f=b.filter((e=>e.includes("lead_submited")));Ae("--listCampaignCodeSubmited",f);const y=b.filter((e=>e.includes("lead_closed")));Ae("--listCampaignCodeClosed",y);const k=[...f,...y],_=(e=>{const t=[...e];for(let e=t.length-1;e>0;e--){const a=Math.floor(Math.random()*(e+1)),l=t[e];t[e]=t[a],t[a]=l}return t})(v.filter((e=>!k.some((t=>t.includes(m[e.campaignIndex].code))))));if(Ae("--listCampaignValid : ",_),_&&_.length){const e=m[_[0].campaignIndex];Ae("CAMPAIGN_SHOW",e);const{rules:t}=e,a=Number(null===(i=t.find((e=>"time"==e.rule)))||void 0===i?void 0:i.value);Ae("timeoutRule",a);const n=Number(null===(r=t.find((e=>"scroll"==e.rule)))||void 0===r?void 0:r.value);Ae("scrollRule",n);const o=Number(null===(d=t.find((e=>"exclude_sponsored"==e.rule)))||void 0===d?void 0:d.value);Ae("excludeSponsored",o);const s=Boolean(document.querySelector(".hhg-disclaimer-text"));if(Ae("💎 LEAD current page isSponsored",s),s&&o)return;let c="TIME";if(Number.isInteger(a)&&(c="TIME",Ae("✨ SHOW AWESOME POPUP AFTER: ",a," seconds"),Le&&clearTimeout(Le),Le=setTimeout((()=>{null==l||l(e,c)}),1e3*a)),Number.isInteger(n)){c="SCROLL",Ae("✨ SHOW AWESOME AFTER: SCROLL",n," %");const t=document.querySelector(`[data-url="${location.pathname}"]`)||document.querySelector("body"),a=t.getBoundingClientRect().top,o=t.offsetHeight;Ae("👓 Element check scroll: ",t);const i=function(){const t=window.pageYOffset||document.documentElement.scrollTop;let r=0;t>=a&&(r=Math.round((t-a)/(o-innerHeight)*100)),Ae("---Scroll",r,n),r>=n&&(window.removeEventListener("scroll",i),null==l||l(e,c))};window.addEventListener("scroll",i,{passive:!0})}}else Ae("🚧 No lead campaigns on current URL, tags")}})).catch((e=>{Ae("Lead error: ",e)}))}const Ae=(...e)=>{("production"!==process.env.NODE_ENV||process.env.NEXT_PUBLIC_DEPLOY_ENV&&"production"!==process.env.NEXT_PUBLIC_DEPLOY_ENV||"undefined"!=typeof localStorage&&"true"===localStorage.getItem("hhg_debug"))&&console.log(...e)};const Ue=({campaign:e,action:t,onSubmit:l,onClose:n,showThankyou:i,locale:s})=>{var m,u;const{apiUrl:p,siteDomain:h}=d(K);o((()=>{const e=I("_ga")||null;fetch(`${p}api/campaign/${f}/impression`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:t,url:location.href.toLowerCase(),title_article:document.title,cookie_id:I("hhg-id"),ga_client_id:e})})}),[]);const{extra_fields:g,image:v,image_desktop:b,code:f,image_background:y,image_overlay_mobile:k,image_overlay_desktop:_}=e||{},{currentLayout:E}=g,w=g.imageBlocks?JSON.parse(g.imageBlocks):{},C=JSON.parse(g.actionBlocks),N=JSON.parse(g.textBlocks);let x=(null===(u=null===(m=null==N?void 0:N.titleBlock)||void 0===m?void 0:m.data)||void 0===u?void 0:u.value)||"";const S={1:{},2:{},3:{}},T=r("lead-modal-"+c()),O=function(e="Xin chao {{category_2}} extra"){if(e.includes("{{category_")){const t=11,a=e.search("{{category_");return+e.charAt(t+a)}return null}(x);if(O){Ae("⚡️ Has categoryLevel",O);const e=Array.from(document.getElementsByTagName("META")),t=e.find((e=>e.name===`content_category_${O}`)),a=e.find((e=>e.name===`content_category_en_${O}`));if(!t||!a)return Ae("⚡️ No META TAG for categoryLevel, not show popup",O),null;S[O]={value:t.content,value_en:a.content},x=x.replace(`{{category_${O}}}`,t.content),Ae("⚡️ Set categoryData ",O)}else Ae("⚡️ No categoryLevel",O);const P=()=>{var t,a,l,o;if(Ae("👌 Other submit click"),document.body.classList.remove("noscroll"),E.includes("Skin")){const e=document.querySelector("#masthead");e&&(e.style.top="0px !important;")}const i=Number(null!==(a=null===(t=e.rules.find((e=>"days_to_show_again"==e.rule)))||void 0===t?void 0:t.value)&&void 0!==a?a:7),r=Number(null!==(o=null===(l=e.rules.find((e=>"show_again_after_submit"==e.rule)))||void 0===l?void 0:l.value)&&void 0!==o?o:0);0===r&&(Ae("⛔ Popup never show again!"),A(`lead_submited_${f}`,`target_${g.popupVersion}`,{domain:"."+h,path:"/"})),1==r&&(Ae(`⌛ Popup will show again after ${i} days!`),A(`lead_submited_${f}`,`target_${g.popupVersion}`,{domain:"."+h,days:i,path:"/"}));const d=I("_ga")||null,s={url:location.href.toLowerCase(),title_article:document.title,meta:[],cookie_id:I("hhg-id"),ga_client_id:d};O&&(s.category=S[O].value_en),fetch(`${p}api/campaign/${f}/lead`,{method:"POST",body:JSON.stringify(s),headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"}}).then((e=>e.json())).then((e=>{"error"===e.status&&Ae(e)})).catch((e=>{Ae("Error:",e)})),null==n||n()};return"CenterTab"===E?a.createElement(Z,{popupId:T.current,url:w.imageMobile.data.url,newTab:w.imageMobile.data.newtab,imageMobile:v,imageDestkop:b,onClose:n,onOtherSubmit:P}):"Tab"===E?a.createElement(Se,{popupId:T.current,url:w.imageMobile.data.url,newTab:w.imageMobile.data.newtab,image:v,onClose:n,onOtherSubmit:P}):"Floating"===E?a.createElement(ee,{popupId:T.current,title:x,titleAlign:N.titleBlock.data.align,subtitle:N.subtitleBlock.data.value,subtitleAlign:N.subtitleBlock.data.align,url:C.linkButtonBlock.data.url,urlText:C.linkButtonBlock.data.value,newTab:C.linkButtonBlock.data.newtab,imageMobile:v,imageDesktop:b,onClose:n,onOtherSubmit:P}):E.includes("LightBox")||E.includes("Inline")||"Fullscreen"==E||"Sidebar"==E||"Slider"==E?a.createElement(Ne,{popupId:T.current,extraFields:g,onClose:n,onOtherSubmit:P,imageMobile:v,imageDesktop:b,imageBackground:y,currentLayout:E,title:x,onSubmit:(e,t)=>l(e,t,O,S),key:E,imageOverlayDesktop:_,imageOverlayMobile:k,showThankyou:i,campaignId:e.id,campaign_subot_id:e.bot_id||[],locale:s}):E.includes("Skin")?a.createElement(xe,{popupId:T.current,link:C.linkButtonBlock.data.url,linkNewTab:!!C.linkButtonBlock.data.newtab,linkText:C.linkButtonBlock.data.value,onClose:n,onOtherSubmit:P,imageMobile:v,imageDesktop:b,currentLayout:E}):null},De=({apiUrl:t,siteDomain:l,siteId:d,locale:c,apiSubotUrl:m,DEBUG_URL:u})=>{var p;const f=r(),k=r(Date.now()),{apiUrl:E}=i((()=>{let e=t;return e.includes("localhost")&&(e="https://dev.leadgen.hellobacsi.com/"),{apiUrl:e}}),[t,l,d]),[w,C]=n(null),[N,x]=n(""),[T,O]=n(null);o((()=>{ne.apiLeadUrl=E,ne.apiSubotUrl=m}),[E,m]);const P=(e,t)=>{C(e),x(t)},j=()=>{var e,t;if(!w)return;Ae(`👋👋👋 CLOSE POPUP ${w.code} 👋👋👋`);const a=Number(null===(e=w.rules.find((e=>"show_again_after_exit"==e.rule)))||void 0===e?void 0:e.value),n=Number(null===(t=w.rules.find((e=>"days_to_show_again"==e.rule)))||void 0===t?void 0:t.value);0==a&&A(`lead_closed_${w.code}`,`target_${null==w?void 0:w.extra_fields.popupVersion}`,n?{domain:"."+l,days:n,path:"/"}:{domain:"."+l,path:"/"}),document.body.classList.remove("noscroll"),fetch(`${E}api/campaign/${w.code}/popup_exit`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"CLICK",url:location.href.toLowerCase(),title_article:document.title,cookie_id:I("hhg-id"),duration:Math.ceil((Date.now()-k.current)/1e3)})}),C(null),O(null)};o((()=>{if(window.next){const e=s((e=>{Ae("--🌻 routeChangeComplete",e,Date.now());const t=location.pathname;j(),document.querySelectorAll(`[data-popup-url="${t}"]`).length?Ae("🔥 This URL page has show popup!"):(Ae("--Process checkShowPopup"),Ie({leadApi:E,leadDomain:l,leadSiteId:d,onShowPopup:P,DEBUG_URL:u})),f.current&&window.removeEventListener("scroll",f.current)}),500);window.next.router.events.on("routeChangeComplete",e)}Ie({leadApi:E,leadDomain:l,leadSiteId:d,onShowPopup:P,DEBUG_URL:u})}),[]);const B=(t,a,n,o)=>e(void 0,void 0,void 0,(function*(){var e,i,r,d,s,c,m,u,p,h,g;if(!a)return;Ae("submitHandler",n,o);const v=Object.keys(a).map((e=>({name:e,value:String(a[e])}))),b=I("_ga")||null;window.intlTelInputUtils||(yield require("intl-tel-input/build/js/utils"));const f={url:location.href.toLowerCase(),title_article:document.title,meta:v.map((e=>{var a,l;const n=(null===(a=t.querySelector(`*[name="${e.name}"]`))||void 0===a?void 0:a.getAttribute("data-control"))||(null===(l=t.querySelector(`*[data-extra][data-name="${e.name}"]`))||void 0===l?void 0:l.getAttribute("data-control"))||"text",o="tel"===n?window.intlTelInputUtils.formatNumber(String(e.value),null==q?void 0:q.countryCodeNumber,2).replace(/\s+/g,""):"date"===n?S(e.value).format("YYYY-MM-DD"):e.value;return{key:e.name,value:o,control:n,is_sent_mailchimp:t.querySelector(`div[data-name="${e.name}-mailchimp"]`)?"true":"false"}})),cookie_id:I("hhg-id"),ga_client_id:b};n&&o[n].value_en&&(f.category=o[n].value_en);const y=Number((null===(i=null===(e=w.rules)||void 0===e?void 0:e.find((e=>"days_to_show_again"===e.rule)))||void 0===i?void 0:i.value)||7),k=Number((null===(d=null===(r=w.rules)||void 0===r?void 0:r.find((e=>"show_again_after_submit"===e.rule)))||void 0===d?void 0:d.value)||0);if(0==k&&(Ae("⛔ Popup never show again!"),A(`lead_submited_${w.code}`,`target_${null==w?void 0:w.extra_fields.targetType}`,{domain:"."+l,path:"/"})),1==k&&(Ae(`⌛ Popup will show again after ${y} days!`),A(`lead_submited_${w.code}`,`target_${null==w?void 0:w.extra_fields.targetType}`,{domain:"."+l,days:y,path:"/"})),fetch(`${E}api/campaign/${w.code}/lead`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(f)}),"notshow"==(null==w?void 0:w.extra_fields.popupShowThankYou))return j(),void document.body.classList.remove("noscroll");let _=!0;const C=w.thank_you_image||`${E}admin/img/thanksyou.png`;let N,x,T=(null==w?void 0:w.extra_fields.popupThankyouTitle)||"Thank you.",P=(null==w?void 0:w.extra_fields.popupThankyouDesc)||"We appreciate your time!",B="",$="",L="";if("2.1"==(null==w?void 0:w.extra_fields.popupVersion)){const e=w.extra_fields,t=JSON.parse(e.listBlockThankyou),a=t.find((e=>"TitleBlock"==e.name)),l=t.find((e=>"SubtitleBlock"==e.name)),n=t.find((e=>"LinkButtonBlock"==e.name));T=(null===(s=null==a?void 0:a.data)||void 0===s?void 0:s.value)||"",B=(null===(c=null==a?void 0:a.data)||void 0===c?void 0:c.align)||"",P=(null===(m=null==l?void 0:l.data)||void 0===m?void 0:m.value)||"",$=(null===(u=null==l?void 0:l.data)||void 0===u?void 0:u.align)||"",N=(null===(p=null==n?void 0:n.data)||void 0===p?void 0:p.value)||"",x=(null===(h=null==n?void 0:n.data)||void 0===h?void 0:h.newtab)||!1,L=(null===(g=null==n?void 0:n.data)||void 0===g?void 0:g.url)||"";const o=w.extra_fields.currentLayout;["SkinA","SkinB","Floating","Tab","CenterTab"].includes(o)&&(_=!1)}O(_?{title:T,titleAlign:B,subtitle:P,subtitleAlign:$,link:L,linkNewTab:x,linkText:N,image:C}:null),sessionStorage.getItem("insider_object")?window.insider_object=JSON.parse(sessionStorage.getItem("insider_object")):window.insider_object={user:{email:"",phone_number:"",gdpr_optin:!0,sms_optin:!0,email_optin:!0}},v.map((e=>{const t=e.name,a=e.value;"tel"==t?window.insider_object.user.phone_number=a:"email"==t&&(window.insider_object.user.email=a)})),sessionStorage.setItem("insider_object",JSON.stringify(window.insider_object))}));return o((()=>{w&&(k.current=Date.now())}),[w]),a.createElement(K.Provider,{value:{apiUrl:E,siteDomain:l,siteId:d,locale:c}},a.createElement(_.Provider,{value:{locale:c,values:G(c)}},a.createElement(h,{target:y()},a.createElement(g,{sx:{position:"fixed",zIndex:600}},a.createElement(v,{mounted:Boolean("2.1"===(null===(p=null==w?void 0:w.extra_fields)||void 0===p?void 0:p.popupVersion)),transition:"fade",duration:600,timingFunction:"ease"},(e=>{var t;return a.createElement(g,{style:e},"2.1"===(null===(t=null==w?void 0:w.extra_fields)||void 0===t?void 0:t.popupVersion)&&a.createElement(a.Fragment,null,!!w.extra_fields.currentLayout&&!w.extra_fields.currentLayout.includes("Inline")&&!w.extra_fields.currentLayout.includes("Sidebar")&&a.createElement(b,{color:"#000",opacity:.5,center:!0,zIndex:400,pos:"fixed",onClick:()=>j()}),a.createElement(Ue,{campaign:w,action:N,onSubmit:B,onClose:j,showThankyou:T,locale:c})))}))))))};export{De as LeadGen};
@@ -1 +1 @@
1
- export{S as Select}from"./index-28798038.js";export{D as DatePicker}from"./index-cf0eff36.js";import{q as a,r as i,s as l}from"./index-c4d88a81.js";export{w as Accordion,A as Anchor,g as AspectRatio,f as Avatar,v as Breadcrumbs,B as Button,x as Carousel,p as Checkbox,h as Input,n as MAPPED_LOCALE,E as OTHER_THEME_CONFIG,O as OTP,o as Phone,F as Popover,R as Radio,k as Tabs,e as Text,y as emotionCache,z as getHeadingStyles,s as getMantineThemeOverride,t as themeColors,r as useMantineLocale}from"./index-c4d88a81.js";export{I as Indicator}from"./index-ed7d5094.js";import c,{useMemo as m}from"react";export{M as Modal}from"./index-21bed750.js";import{_ as d}from"./tslib.es6-473ccb87.js";import{Badge as u,Spoiler as j,LoadingOverlay as b,MantineProvider as H,clsx as P,Title as T,Text as N,Button as L}from"@mantine/core";import{t as _}from"./theme-d9e20331.js";import{T as G}from"./index-17695220.js";import{u as q}from"./useTranslations-e8922a21.js";export{C as CentralCarousel}from"./index-11483079.js";export{S as Slider}from"./index-60389692.js";export{S as Switch}from"./index-725753ec.js";import"@mantine/hooks";import"./gAssets.js";import"./index-a30cdd1b.js";import"date-fns/locale";import"./Onboarding-82fe006a.js";import"./isProduction-3f988439.js";import"@mantine/dates";import"dayjs";import"./utils-edae1592.js";import"styled-components";import"@mantine/carousel";import"./screenSizeContext-f04e5151.js";import"lodash/throttle";import"./index-4d579ab7.js";import"./index-3e66a614.js";import"./index-ba146661.js";import"./useUniqueId-89d4734d.js";import"react-keyed-flatten-children";import"./translationsContext-1ad41874.js";import"string-format";import"./index-c42054ea.js";const J=e=>c.createElement(a,Object.assign({minRows:2,maxRows:4},e)),U=e=>{var{color:t=_.colors.primaryBase,styles:s}=e,a=d(e,["color","styles"]);return c.createElement(u,Object.assign({variant:"filled",color:t,styles:Object.assign({root:{borderRadius:"2px",background:t,textTransform:"unset"}},s)},a))},V=e=>{var{children:t,line:s,lineHeight:a,trackingAttributes:r,maxHeight:o,customExpandFn:i}=e,n=d(e,["children","line","lineHeight","trackingAttributes","maxHeight","customExpandFn"]);const{t:l}=q(),p=m((()=>o||(s&&a?s*a:(console.error("[HHG-Comp]:[Spoiler] Please provide maxHeight, or line with lineHeight"),0))),[]);t||console.error("[HHG-Comp]:[Spoiler] Please provide children");const u=m((()=>r?{"data-event-category":r.dataEventCategory,"data-event-action":r.dataEventAction,"data-event-label":r.dataEventLabel}:{}),[r]);return c.createElement(j,Object.assign({showLabel:c.createElement(G,Object.assign({size:"p3",color:_.colors.primaryBase},u,{onClick:i}),l("articlePage.readMore")),hideLabel:c.createElement(G,Object.assign({size:"p3",color:_.colors.primaryBase},u),l("articlePage.showLess"))},n,{maxHeight:p}),t)};const Y=e=>(function(e=!1){c.useEffect((()=>{if(e){const e=window.getComputedStyle(document.body).overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}}}),[e])}(e.visible),c.createElement(b,Object.assign({loaderProps:{color:_.colors.primaryBase}},e))),Z=e=>{var{children:t,locale:s,template:a="hb"}=e,r=d(e,["children","locale","template"]);return i(s),c.createElement(H,Object.assign({theme:l(s,a)},r),t)};var K="MON6sfi",Q="pS-tJD7",W="s3tJ9-5",X="fNsZr1b",$="uuxV74v",ee="YohjTDU";function te(e){const{icon:t,title:s,description:a,button:r,buttonProps:o,style:i,className:n}=e,l=o||{},{size:m="lg",variant:p="outline"}=l,u=d(l,["size","variant"]),x=t;return c.createElement("div",{className:P("result",K,n),style:i},x&&c.createElement("div",{className:P("resultIconContainer",Q)},c.createElement(x,{className:P("resultIcon",W)})),c.createElement(T,{order:3,size:"h3",className:P("resultTitle",X)},s),c.createElement(N,{className:P("resultDescription",$)},a),r&&c.createElement(L,Object.assign({},u,{size:m,variant:p,className:P("resultButton",ee,u.className)}),r))}export{U as Badge,Y as LoadingOverlay,Z as MantineProvider,te as Result,V as Spoiler,J as TextArea};
1
+ export{S as Select}from"./index-0d7aacfc.js";export{D as DatePicker}from"./index-e5a33e01.js";import{q as a,r as i,s as l}from"./index-87850dfe.js";export{w as Accordion,A as Anchor,g as AspectRatio,f as Avatar,v as Breadcrumbs,B as Button,x as Carousel,p as Checkbox,h as Input,n as MAPPED_LOCALE,E as OTHER_THEME_CONFIG,O as OTP,o as Phone,F as Popover,R as Radio,k as Tabs,e as Text,y as emotionCache,z as getHeadingStyles,s as getMantineThemeOverride,t as themeColors,r as useMantineLocale}from"./index-87850dfe.js";export{I as Indicator}from"./index-f16a050a.js";import c,{useMemo as m}from"react";export{M as Modal}from"./index-d4681c97.js";import{_ as d}from"./tslib.es6-43b52c70.js";import{Badge as u,Spoiler as b,LoadingOverlay as j,MantineProvider as H,clsx as P,Title as T,Text as N,Button as L}from"@mantine/core";import{t as _}from"./theme-4d9b8565.js";import{T as G}from"./index-88e355f5.js";import{u as q}from"./useTranslations-fff3d6f3.js";export{C as CentralCarousel}from"./index-f7380130.js";export{S as Slider}from"./index-9ff96da9.js";export{S as Switch}from"./index-07300d64.js";import"@mantine/hooks";import"./gAssets.js";import"./index-ac45d84b.js";import"date-fns/locale";import"./Onboarding-b0d0d68e.js";import"./isProduction-b84be401.js";import"@mantine/dates";import"dayjs";import"./utils-0f812a66.js";import"styled-components";import"@mantine/carousel";import"./screenSizeContext-652dbbd3.js";import"lodash/throttle";import"./index-17611c49.js";import"./index-14ebdde4.js";import"./index-325afc4d.js";import"./useUniqueId-f2d1092b.js";import"react-keyed-flatten-children";import"./translationsContext-a95596a3.js";import"string-format";import"./index-9075d01a.js";const J=e=>c.createElement(a,Object.assign({minRows:2,maxRows:4},e)),U=e=>{var{color:t=_.colors.primaryBase,styles:a}=e,s=d(e,["color","styles"]);return c.createElement(u,Object.assign({variant:"filled",color:t,styles:Object.assign({root:{borderRadius:"2px",background:t,textTransform:"unset"}},a)},s))},V=e=>{var{children:t,line:a,lineHeight:s,trackingAttributes:r,maxHeight:o,customExpandFn:i}=e,n=d(e,["children","line","lineHeight","trackingAttributes","maxHeight","customExpandFn"]);const{t:l}=q(),p=m((()=>o||(a&&s?a*s:(console.error("[HHG-Comp]:[Spoiler] Please provide maxHeight, or line with lineHeight"),0))),[]);t||console.error("[HHG-Comp]:[Spoiler] Please provide children");const f=m((()=>r?{"data-event-category":r.dataEventCategory,"data-event-action":r.dataEventAction,"data-event-label":r.dataEventLabel}:{}),[r]);return c.createElement(b,Object.assign({showLabel:c.createElement(G,Object.assign({size:"p3",color:_.colors.primaryBase},f,{onClick:i}),l("articlePage.readMore")),hideLabel:c.createElement(G,Object.assign({size:"p3",color:_.colors.primaryBase},f),l("articlePage.showLess"))},n,{maxHeight:p}),t)};const Y=e=>(function(e=!1){c.useEffect((()=>{if(e){const e=window.getComputedStyle(document.body).overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}}}),[e])}(e.visible),c.createElement(j,Object.assign({loaderProps:{color:_.colors.primaryBase}},e))),Z=e=>{var{children:t,locale:a,template:s="hb"}=e,r=d(e,["children","locale","template"]);return i(a),c.createElement(H,Object.assign({theme:l(a,s)},r),t)};var K="MON6sfi",Q="pS-tJD7",W="s3tJ9-5",X="fNsZr1b",$="uuxV74v",ee="YohjTDU";function te(e){const{icon:t,title:a,description:s,button:r,buttonProps:o,style:i,className:n}=e,l=o||{},{size:m="lg",variant:p="outline"}=l,f=d(l,["size","variant"]),u=t;return c.createElement("div",{className:P("result",K,n),style:i},u&&c.createElement("div",{className:P("resultIconContainer",Q)},c.createElement(u,{className:P("resultIcon",W)})),c.createElement(T,{order:3,size:"h3",className:P("resultTitle",X)},a),c.createElement(N,{className:P("resultDescription",$)},s),r&&c.createElement(L,Object.assign({},f,{size:m,variant:p,className:P("resultButton",ee,f.className)}),r))}export{U as Badge,Y as LoadingOverlay,Z as MantineProvider,te as Result,V as Spoiler,J as TextArea};
package/build/esm/misc.js CHANGED
@@ -1 +1 @@
1
- export{a as ageGenerate,c as convertLocalizedStringToNumber,l as localizeNumberFormat}from"./localizeNumberFormat-2757b4e5.js";export{S as ScreenSizeContext,j as ScreenSizeContextProvider,h as fadeIn,i as getWindowSizeGroups,a as slideInDown,b as slideInLeft,c as slideInRight,s as slideInUp,e as slideOutDown,f as slideOutLeft,g as slideOutRight,d as slideOutUp}from"./screenSizeContext-f04e5151.js";export{d as deleteCookie,g as getCookie,s as setCookie}from"./cookieHelper-ca7c9c03.js";import"react";import"styled-components";export{M as MBTheme,t as theme}from"./theme-d9e20331.js";export{a as abbreviateNumber,f as formatPill}from"./dataTransform-eb227e06.js";export{d as getCareApiDomain,g as getCurrentBaseUrl,a as getCurrentSsoUrl,c as getDiscoverApiDomain,b as getTogetherApiDomain}from"./routing-f0e3f53b.js";export{B as Breakpoints,M as MediaQueries,f as formatUrlWithPageParam,g as getBoundariesFromMediaQueryKey,a as getPopupWrapperDom,b as getWrapperDomWithSelector,m as makeParams,c as safeEncodeURI,s as startCase,t as toggleNoScroll}from"./utils-edae1592.js";export{f as formatHealthTool,g as getDynamicHealthTool,a as getDynamicHealthToolWithCache}from"./getDynamicHealthTool-802ee52c.js";export{g as getSocialList}from"./getSocialList-a6458c2d.js";import"dayjs";import"lodash/throttle";import"./index-a30cdd1b.js";import"date-fns/locale";import"./Onboarding-82fe006a.js";import"./isProduction-3f988439.js";import"./tslib.es6-473ccb87.js";import"./core-02ca893a.js";import"./normalizeLink-fe194059.js";import"./gAssets.js";
1
+ export{a as ageGenerate,c as convertLocalizedStringToNumber,l as localizeNumberFormat}from"./localizeNumberFormat-55d7f559.js";export{S as ScreenSizeContext,j as ScreenSizeContextProvider,h as fadeIn,i as getWindowSizeGroups,a as slideInDown,b as slideInLeft,c as slideInRight,s as slideInUp,e as slideOutDown,f as slideOutLeft,g as slideOutRight,d as slideOutUp}from"./screenSizeContext-652dbbd3.js";export{d as deleteCookie,g as getCookie,s as setCookie}from"./cookieHelper-238e7958.js";import"react";import"styled-components";export{M as MBTheme,t as theme}from"./theme-4d9b8565.js";export{a as abbreviateNumber,f as formatPill}from"./dataTransform-202b5b34.js";export{d as getCareApiDomain,g as getCurrentBaseUrl,a as getCurrentSsoUrl,c as getDiscoverApiDomain,b as getTogetherApiDomain}from"./routing-afe38f18.js";export{B as Breakpoints,M as MediaQueries,f as formatUrlWithPageParam,g as getBoundariesFromMediaQueryKey,a as getPopupWrapperDom,b as getWrapperDomWithSelector,m as makeParams,c as safeEncodeURI,s as startCase,t as toggleNoScroll}from"./utils-0f812a66.js";export{f as formatHealthTool,g as getDynamicHealthTool,a as getDynamicHealthToolWithCache}from"./getDynamicHealthTool-20a6fc1a.js";export{g as getSocialList}from"./getSocialList-d9b72a6c.js";import"dayjs";import"lodash/throttle";import"./index-ac45d84b.js";import"date-fns/locale";import"./Onboarding-b0d0d68e.js";import"./isProduction-b84be401.js";import"./tslib.es6-43b52c70.js";import"./core-8b54d2b3.js";import"./normalizeLink-a3c058f6.js";import"./gAssets.js";
@@ -1 +1 @@
1
- import"./tslib.es6-473ccb87.js";import"react";import"./core-02ca893a.js";export{N as NavigationV2,g as getNavMenuContent,a as getNavMenuContentWithCache}from"./index-b0993261.js";import"./index-a30cdd1b.js";import"./normalizeLink-fe194059.js";import"./routing-f0e3f53b.js";import"./dataTransform-4a1ba820.js";import"./index.styled-01db228b.js";import"./isProduction-3f988439.js";import"./gAssets.js";import"date-fns/locale";import"./Onboarding-82fe006a.js";import"./index-3e66a614.js";import"styled-components";import"./useUniqueId-89d4734d.js";import"./index-17695220.js";import"./index-558a5045.js";import"./index-4d579ab7.js";import"./theme-d9e20331.js";import"./utils-edae1592.js";import"@mantine/core";import"./index-ba146661.js";import"dayjs";import"./screenSizeContext-f04e5151.js";import"lodash/throttle";import"react-keyed-flatten-children";import"./useTranslations-e8922a21.js";import"./translationsContext-1ad41874.js";import"string-format";import"./index-c4d88a81.js";import"@mantine/carousel";import"@mantine/hooks";import"./cookieHelper-ca7c9c03.js";import"./index-c42054ea.js";import"./constants-430e6a70.js";import"@mantine/dates";import"./index-ed7d5094.js";import"./index-11483079.js";import"lodash/debounce";import"./useIsInit-128a3658.js";import"slugify";import"dayjs/plugin/relativeTime";
1
+ import"./tslib.es6-43b52c70.js";import"react";import"./core-8b54d2b3.js";export{N as NavigationV2,g as getNavMenuContent,a as getNavMenuContentWithCache}from"./index-592a2e0b.js";import"./index-ac45d84b.js";import"./normalizeLink-a3c058f6.js";import"./routing-afe38f18.js";import"./dataTransform-2634aa2a.js";import"./index.styled-a7d5bf58.js";import"./isProduction-b84be401.js";import"./gAssets.js";import"date-fns/locale";import"./Onboarding-b0d0d68e.js";import"./index-14ebdde4.js";import"styled-components";import"./useUniqueId-f2d1092b.js";import"./index-88e355f5.js";import"./index-089be81e.js";import"./index-17611c49.js";import"./theme-4d9b8565.js";import"./utils-0f812a66.js";import"@mantine/core";import"./index-325afc4d.js";import"dayjs";import"./screenSizeContext-652dbbd3.js";import"lodash/throttle";import"react-keyed-flatten-children";import"./useTranslations-fff3d6f3.js";import"./translationsContext-a95596a3.js";import"string-format";import"./index-87850dfe.js";import"@mantine/carousel";import"@mantine/hooks";import"./cookieHelper-238e7958.js";import"./index-9075d01a.js";import"./constants-e99b0a37.js";import"@mantine/dates";import"./index-f16a050a.js";import"./index-f7380130.js";import"lodash/debounce";import"./useIsInit-39a6f61e.js";import"slugify";import"dayjs/plugin/relativeTime";