@hhgtech/hhg-components 1.28.40 → 1.28.42

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/molecules/dropdown/index.styled.d.ts +1 -1
  5. package/build/components/molecules/mobileBottomNavigation/index.d.ts +0 -1
  6. package/build/components.js +1 -1
  7. package/build/{constants-e7c8985f.js → constants-a6c0111d.js} +1 -1
  8. package/build/{constants-20b167d2.js → constants-d873d461.js} +1 -1
  9. package/build/constants.js +1 -1
  10. package/build/core-cad6a42a.js +1 -0
  11. package/build/ecom.js +1 -1
  12. package/build/esm/babyGrowth.js +2 -2
  13. package/build/esm/cache.js +1 -1
  14. package/build/esm/care.js +1 -1
  15. package/build/esm/components/molecules/dropdown/index.styled.d.ts +1 -1
  16. package/build/esm/components/molecules/mobileBottomNavigation/index.d.ts +0 -1
  17. package/build/esm/components.js +1 -1
  18. package/build/esm/{constants-95cb8ea0.js → constants-94c0a69b.js} +1 -1
  19. package/build/esm/{constants-bcabc622.js → constants-da7ec5be.js} +1 -1
  20. package/build/esm/constants.js +1 -1
  21. package/build/esm/{core-ac4e85c7.js → core-5564bd35.js} +1 -1
  22. package/build/esm/ecom.js +1 -1
  23. package/build/esm/footer.js +1 -1
  24. package/build/esm/gAssets.js +1 -1
  25. package/build/esm/{getDynamicHealthTool-00faa2c1.js → getDynamicHealthTool-b607d6c6.js} +1 -1
  26. package/build/esm/{getSocialList-1248c74c.js → getSocialList-4a024369.js} +1 -1
  27. package/build/esm/hooks.js +1 -1
  28. package/build/esm/i18n.js +1 -1
  29. package/build/esm/i18nV2.js +1 -1
  30. package/build/esm/index-0991b8cf.js +1 -0
  31. package/build/esm/{index-d6b66097.js → index-0a136042.js} +1 -1
  32. package/build/esm/index-0aa9ad0c.js +1 -0
  33. package/build/esm/{index-13feb3ef.js → index-1cc8c07f.js} +1 -1
  34. package/build/esm/{index-212c6a21.js → index-313c3975.js} +1 -1
  35. package/build/esm/{index-14780cf0.js → index-3ecb0e1b.js} +1 -1
  36. package/build/esm/{index-02f0f4fe.js → index-42a97c34.js} +1 -1
  37. package/build/esm/{index-15efeba7.js → index-4f30c485.js} +1 -1
  38. package/build/esm/index-53b3e00d.js +1 -0
  39. package/build/esm/{index-e0365fb2.js → index-60dcf229.js} +1 -1
  40. package/build/esm/{index-dde41fb0.js → index-6418e06e.js} +1 -1
  41. package/build/esm/{index-f4f05774.js → index-7b0ad89b.js} +1 -1
  42. package/build/esm/{index-a5e07868.js → index-7ee9c0b8.js} +1 -1
  43. package/build/esm/{index-e751d8c2.js → index-93427f24.js} +1 -1
  44. package/build/esm/{index-eace0e39.js → index-a67f43a3.js} +6 -6
  45. package/build/esm/{index-f2ede565.js → index-a78b0e89.js} +1 -1
  46. package/build/esm/{index-6aeb538e.js → index-b2b39662.js} +2 -2
  47. package/build/esm/{index-428d1aeb.js → index-b9914bcd.js} +1 -1
  48. package/build/esm/{index-19144b5a.js → index-e20fe766.js} +1 -1
  49. package/build/esm/{index-e28d801c.js → index-e61f322e.js} +1 -1
  50. package/build/esm/index-ef79e29b.js +1 -0
  51. package/build/esm/{index-4e8c3bb6.js → index-fffed510.js} +1 -1
  52. package/build/esm/index.js +1 -1
  53. package/build/esm/{index.styled-cadd6706.js → index.styled-a49a0f3b.js} +1 -1
  54. package/build/esm/{index.styled-4a4ab4d3.js → index.styled-a8279a8f.js} +6 -6
  55. package/build/esm/{index.styled-d760ce2f.js → index.styled-c3a130a7.js} +3 -3
  56. package/build/esm/{index.styled-7f374882.js → index.styled-e5302a94.js} +10 -10
  57. package/build/esm/{index.styles-3036321c.js → index.styles-1dc3d7f0.js} +1 -1
  58. package/build/esm/lead.js +1 -1
  59. package/build/esm/mantine.js +1 -1
  60. package/build/esm/misc.js +1 -1
  61. package/build/esm/navigation.js +1 -1
  62. package/build/esm/onboardingV2.js +1 -1
  63. package/build/esm/pwg.js +2 -2
  64. package/build/esm/{routing-0284bf36.js → routing-fd554a2d.js} +1 -1
  65. package/build/esm/subot.js +1 -1
  66. package/build/esm/together.js +1 -1
  67. package/build/esm/{types-553958a6.js → types-102da0af.js} +1 -1
  68. package/build/esm/{types-b8611d30.js → types-3a16ac11.js} +1 -1
  69. package/build/esm/types.js +1 -1
  70. package/build/esm/{useCategory-b6426a83.js → useCategory-90322434.js} +1 -1
  71. package/build/esm/useHealthToolCache-62ebef64.js +1 -0
  72. package/build/esm/{usePlacesAutocomplete-12181fb9.js → usePlacesAutocomplete-3f014212.js} +1 -1
  73. package/build/esm/{useRafState-652131c8.js → useRafState-81a94027.js} +1 -1
  74. package/build/esm/{useTranslations-e0f5679c.js → useTranslations-24b07ae0.js} +1 -1
  75. package/build/esm/{utils-f65c59d5.js → utils-745dd450.js} +1 -1
  76. package/build/esm/{utils-0347b372.js → utils-a52f9e39.js} +1 -1
  77. package/build/esm/vaccination.js +1 -1
  78. package/build/footer.js +1 -1
  79. package/build/gAssets.js +1 -1
  80. package/build/{getDynamicHealthTool-765ca7ef.js → getDynamicHealthTool-b7ff8c1d.js} +1 -1
  81. package/build/{getSocialList-1ec4bb1e.js → getSocialList-0a236994.js} +1 -1
  82. package/build/hooks.js +1 -1
  83. package/build/i18n.js +1 -1
  84. package/build/i18nV2.js +1 -1
  85. package/build/{index-a604bf78.js → index-13cc7058.js} +1 -1
  86. package/build/{index-e387ee43.js → index-27603e69.js} +1 -1
  87. package/build/{index-27fce9f9.js → index-2bd60484.js} +2 -2
  88. package/build/{index-9b5898bd.js → index-2c29760d.js} +1 -1
  89. package/build/{index-1411d846.js → index-33a8dc76.js} +1 -1
  90. package/build/{index-d79b83e7.js → index-401ebaae.js} +3 -3
  91. package/build/{index-8919cdee.js → index-409ce723.js} +1 -1
  92. package/build/index-561ffe5e.js +1 -0
  93. package/build/{index-2e6dbe21.js → index-5d7645f4.js} +1 -1
  94. package/build/{index-16f49c45.js → index-617d9fe6.js} +1 -1
  95. package/build/{index-f0b22b20.js → index-61d2652f.js} +1 -1
  96. package/build/{index-0dfb02fc.js → index-6aa19f43.js} +1 -1
  97. package/build/{index-f65612b1.js → index-7fb79ca8.js} +1 -1
  98. package/build/index-8abf993c.js +1 -0
  99. package/build/{index-417895f0.js → index-bb97d3aa.js} +10 -10
  100. package/build/{index-3b70c7c6.js → index-be033cca.js} +1 -1
  101. package/build/{index-e393d84f.js → index-c2f75945.js} +1 -1
  102. package/build/{index-e94212a5.js → index-cf6588b0.js} +1 -1
  103. package/build/{index-3824cae4.js → index-d1d6f5d2.js} +1 -1
  104. package/build/{index-32a73461.js → index-f27055e5.js} +1 -1
  105. package/build/{index-67c1fe30.js → index-f9a8b64f.js} +1 -1
  106. package/build/{index-48cdf99f.js → index-feb7910d.js} +1 -1
  107. package/build/index.js +1 -1
  108. package/build/{index.styled-6220e760.js → index.styled-064d5fb5.js} +1 -1
  109. package/build/{index.styled-38621c5f.js → index.styled-1526f809.js} +1 -1
  110. package/build/{index.styled-9dd14387.js → index.styled-5a78fece.js} +1 -1
  111. package/build/{index.styled-f6dc3372.js → index.styled-5eceaffe.js} +2 -2
  112. package/build/{index.styles-3ab75ee6.js → index.styles-6c41df33.js} +1 -1
  113. package/build/lead.js +1 -1
  114. package/build/mantine.js +1 -1
  115. package/build/misc.js +1 -1
  116. package/build/navigation.js +1 -1
  117. package/build/onboardingV2.js +1 -1
  118. package/build/pwg.js +3 -3
  119. package/build/{routing-404b0db3.js → routing-8a4fd371.js} +1 -1
  120. package/build/subot.js +1 -1
  121. package/build/together.js +1 -1
  122. package/build/{types-422e65f8.js → types-1bc2093b.js} +1 -1
  123. package/build/{types-af0c33af.js → types-9f5e77b3.js} +1 -1
  124. package/build/types.js +1 -1
  125. package/build/{useCategory-bf09d2fa.js → useCategory-2962476c.js} +1 -1
  126. package/build/useHealthToolCache-94adbaaa.js +1 -0
  127. package/build/{usePlacesAutocomplete-38246a89.js → usePlacesAutocomplete-b062a8cf.js} +1 -1
  128. package/build/{useRafState-816567d2.js → useRafState-0fa7827b.js} +1 -1
  129. package/build/{useTranslations-58ee3b9e.js → useTranslations-fd40a978.js} +1 -1
  130. package/build/{utils-660ff29e.js → utils-4212f446.js} +1 -1
  131. package/build/{utils-119b98c5.js → utils-90a4cf5e.js} +1 -1
  132. package/build/vaccination.js +1 -1
  133. package/package.json +1 -1
  134. package/build/core-ca200210.js +0 -1
  135. package/build/esm/index-1fc7e785.js +0 -1
  136. package/build/esm/index-53ef56cd.js +0 -1
  137. package/build/esm/index-941eb658.js +0 -1
  138. package/build/esm/index-c7ee8e8e.js +0 -1
  139. package/build/esm/useHealthToolCache-9185d66c.js +0 -1
  140. package/build/index-ccd99d7b.js +0 -1
  141. package/build/index-d681911b.js +0 -1
  142. package/build/useHealthToolCache-a13afe89.js +0 -1
  143. /package/build/{BMI_BOYS.percentile.monthly-2be7494b.js → BMI_BOYS.percentile.monthly-32a9c96e.js} +0 -0
  144. /package/build/{BMI_BOYS.percentile.weekly-a476da14.js → BMI_BOYS.percentile.weekly-8e15fb35.js} +0 -0
  145. /package/build/{BMI_BOYS.percentile.yearly-47264daf.js → BMI_BOYS.percentile.yearly-21c21c39.js} +0 -0
  146. /package/build/{BMI_BOYS.zscore.monthly-def07248.js → BMI_BOYS.zscore.monthly-4d05f67f.js} +0 -0
  147. /package/build/{BMI_BOYS.zscore.weekly-5bae230f.js → BMI_BOYS.zscore.weekly-088a0b3f.js} +0 -0
  148. /package/build/{BMI_BOYS.zscore.yearly-13085083.js → BMI_BOYS.zscore.yearly-c1bf1efd.js} +0 -0
  149. /package/build/{BMI_GIRLS.percentile.monthly-f5b552ef.js → BMI_GIRLS.percentile.monthly-c56db0d4.js} +0 -0
  150. /package/build/{BMI_GIRLS.percentile.weekly-078c93d8.js → BMI_GIRLS.percentile.weekly-cc38df86.js} +0 -0
  151. /package/build/{BMI_GIRLS.percentile.yearly-79661652.js → BMI_GIRLS.percentile.yearly-5446dae0.js} +0 -0
  152. /package/build/{BMI_GIRLS.zscore.monthly-8a4e6815.js → BMI_GIRLS.zscore.monthly-afb9fc1c.js} +0 -0
  153. /package/build/{BMI_GIRLS.zscore.weekly-ed0b7994.js → BMI_GIRLS.zscore.weekly-158195cc.js} +0 -0
  154. /package/build/{BMI_GIRLS.zscore.yearly-8d875256.js → BMI_GIRLS.zscore.yearly-fc212813.js} +0 -0
  155. /package/build/{ChevronDown-a220d6bf.js → ChevronDown-761dbd2f.js} +0 -0
  156. /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-81c35b36.js → HEAD CIRCUM_BOYS.percentile.monthly-31374b3e.js} +0 -0
  157. /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-0ade78bd.js → HEAD CIRCUM_BOYS.percentile.weekly-b6e0395b.js} +0 -0
  158. /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-5166fc6d.js → HEAD CIRCUM_BOYS.percentile.yearly-05855b6c.js} +0 -0
  159. /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-105ecbce.js → HEAD CIRCUM_BOYS.zscore.monthly-6be00d6e.js} +0 -0
  160. /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-3c03bbb6.js → HEAD CIRCUM_BOYS.zscore.weekly-5adee436.js} +0 -0
  161. /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-f9c772b7.js → HEAD CIRCUM_BOYS.zscore.yearly-59d8c21e.js} +0 -0
  162. /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-6d84e295.js → HEAD CIRCUM_GIRLS.percentile.monthly-60d12086.js} +0 -0
  163. /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-52253e24.js → HEAD CIRCUM_GIRLS.percentile.weekly-e798b547.js} +0 -0
  164. /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-7f23d028.js → HEAD CIRCUM_GIRLS.percentile.yearly-9a1c41fc.js} +0 -0
  165. /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-9cd318a0.js → HEAD CIRCUM_GIRLS.zscore.monthly-f48693f6.js} +0 -0
  166. /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-ab38e511.js → HEAD CIRCUM_GIRLS.zscore.weekly-d165df1e.js} +0 -0
  167. /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-d3160e92.js → HEAD CIRCUM_GIRLS.zscore.yearly-f7b9a636.js} +0 -0
  168. /package/build/{HEIGHT_BOYS.percentile.monthly-5acc24fe.js → HEIGHT_BOYS.percentile.monthly-df9e41ac.js} +0 -0
  169. /package/build/{HEIGHT_BOYS.percentile.weekly-569a97bd.js → HEIGHT_BOYS.percentile.weekly-f6db5feb.js} +0 -0
  170. /package/build/{HEIGHT_BOYS.percentile.yearly-42642e47.js → HEIGHT_BOYS.percentile.yearly-6ba3c8be.js} +0 -0
  171. /package/build/{HEIGHT_BOYS.zscore.monthly-65dbd7fb.js → HEIGHT_BOYS.zscore.monthly-ecdab661.js} +0 -0
  172. /package/build/{HEIGHT_BOYS.zscore.weekly-0d17c4ae.js → HEIGHT_BOYS.zscore.weekly-05f3f564.js} +0 -0
  173. /package/build/{HEIGHT_BOYS.zscore.yearly-27b8768a.js → HEIGHT_BOYS.zscore.yearly-c2c2bf51.js} +0 -0
  174. /package/build/{HEIGHT_GIRLS.percentile.monthly-cd7488f2.js → HEIGHT_GIRLS.percentile.monthly-9ee09999.js} +0 -0
  175. /package/build/{HEIGHT_GIRLS.percentile.weekly-43ff1254.js → HEIGHT_GIRLS.percentile.weekly-ddc26928.js} +0 -0
  176. /package/build/{HEIGHT_GIRLS.percentile.yearly-43e4aff0.js → HEIGHT_GIRLS.percentile.yearly-f0b005a9.js} +0 -0
  177. /package/build/{HEIGHT_GIRLS.zscore.monthly-31f100f4.js → HEIGHT_GIRLS.zscore.monthly-49e2e356.js} +0 -0
  178. /package/build/{HEIGHT_GIRLS.zscore.weekly-79fb01f3.js → HEIGHT_GIRLS.zscore.weekly-a530dfc0.js} +0 -0
  179. /package/build/{HEIGHT_GIRLS.zscore.yearly-bdfde055.js → HEIGHT_GIRLS.zscore.yearly-9812dd94.js} +0 -0
  180. /package/build/{Subot-9d5418e4.js → Subot-ec653018.js} +0 -0
  181. /package/build/{Visible-5f2e5d2d.js → Visible-5c5574fb.js} +0 -0
  182. /package/build/{WEIGHT_BOYS.percentile.monthly-5e8b69e3.js → WEIGHT_BOYS.percentile.monthly-cc77f014.js} +0 -0
  183. /package/build/{WEIGHT_BOYS.percentile.weekly-f0dc4f4e.js → WEIGHT_BOYS.percentile.weekly-003593cc.js} +0 -0
  184. /package/build/{WEIGHT_BOYS.percentile.yearly-94cb010e.js → WEIGHT_BOYS.percentile.yearly-593e6771.js} +0 -0
  185. /package/build/{WEIGHT_BOYS.zscore.monthly-53bc9947.js → WEIGHT_BOYS.zscore.monthly-604120bb.js} +0 -0
  186. /package/build/{WEIGHT_BOYS.zscore.weekly-6ea5cde9.js → WEIGHT_BOYS.zscore.weekly-5369e63e.js} +0 -0
  187. /package/build/{WEIGHT_BOYS.zscore.yearly-f37e5962.js → WEIGHT_BOYS.zscore.yearly-450ea5c0.js} +0 -0
  188. /package/build/{WEIGHT_GIRLS.percentile.monthly-a0af2262.js → WEIGHT_GIRLS.percentile.monthly-802a56b8.js} +0 -0
  189. /package/build/{WEIGHT_GIRLS.percentile.weekly-1c11854b.js → WEIGHT_GIRLS.percentile.weekly-596be04f.js} +0 -0
  190. /package/build/{WEIGHT_GIRLS.percentile.yearly-c84a146d.js → WEIGHT_GIRLS.percentile.yearly-ac7dd3ce.js} +0 -0
  191. /package/build/{WEIGHT_GIRLS.zscore.monthly-6c42d8ac.js → WEIGHT_GIRLS.zscore.monthly-636e54e9.js} +0 -0
  192. /package/build/{WEIGHT_GIRLS.zscore.weekly-f6ac49b3.js → WEIGHT_GIRLS.zscore.weekly-d8080514.js} +0 -0
  193. /package/build/{WEIGHT_GIRLS.zscore.yearly-53a8fb67.js → WEIGHT_GIRLS.zscore.yearly-10d66f54.js} +0 -0
  194. /package/build/{cookieHelper-24b1f061.js → cookieHelper-78474f32.js} +0 -0
  195. /package/build/{dataTransform-e795262f.js → dataTransform-a6dfa81f.js} +0 -0
  196. /package/build/esm/{BMI_BOYS.percentile.monthly-90e8d51b.js → BMI_BOYS.percentile.monthly-0140c675.js} +0 -0
  197. /package/build/esm/{BMI_BOYS.percentile.weekly-0f155cb8.js → BMI_BOYS.percentile.weekly-efdcd9ab.js} +0 -0
  198. /package/build/esm/{BMI_BOYS.percentile.yearly-24097fcb.js → BMI_BOYS.percentile.yearly-c117e70f.js} +0 -0
  199. /package/build/esm/{BMI_BOYS.zscore.monthly-c874926b.js → BMI_BOYS.zscore.monthly-a6eb3d4d.js} +0 -0
  200. /package/build/esm/{BMI_BOYS.zscore.weekly-f82f54d5.js → BMI_BOYS.zscore.weekly-d2334f06.js} +0 -0
  201. /package/build/esm/{BMI_BOYS.zscore.yearly-e86e6196.js → BMI_BOYS.zscore.yearly-5639e579.js} +0 -0
  202. /package/build/esm/{BMI_GIRLS.percentile.monthly-b5f00f2c.js → BMI_GIRLS.percentile.monthly-8dd16f70.js} +0 -0
  203. /package/build/esm/{BMI_GIRLS.percentile.weekly-0160255f.js → BMI_GIRLS.percentile.weekly-f6f73711.js} +0 -0
  204. /package/build/esm/{BMI_GIRLS.percentile.yearly-49fd6692.js → BMI_GIRLS.percentile.yearly-9c8b1c98.js} +0 -0
  205. /package/build/esm/{BMI_GIRLS.zscore.monthly-c33b9640.js → BMI_GIRLS.zscore.monthly-e4b2b640.js} +0 -0
  206. /package/build/esm/{BMI_GIRLS.zscore.weekly-8dc83438.js → BMI_GIRLS.zscore.weekly-be352af5.js} +0 -0
  207. /package/build/esm/{BMI_GIRLS.zscore.yearly-1dbbb382.js → BMI_GIRLS.zscore.yearly-f1434536.js} +0 -0
  208. /package/build/esm/{ChevronDown-8da7a294.js → ChevronDown-cc905035.js} +0 -0
  209. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.monthly-ebfdafc9.js → HEAD CIRCUM_BOYS.percentile.monthly-fe9b1b50.js} +0 -0
  210. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.weekly-27229ddd.js → HEAD CIRCUM_BOYS.percentile.weekly-f5eddef1.js} +0 -0
  211. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.yearly-ea484f34.js → HEAD CIRCUM_BOYS.percentile.yearly-dc355a88.js} +0 -0
  212. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.monthly-b98df2be.js → HEAD CIRCUM_BOYS.zscore.monthly-4e33dbb1.js} +0 -0
  213. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.weekly-b542bf2d.js → HEAD CIRCUM_BOYS.zscore.weekly-6290590a.js} +0 -0
  214. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.yearly-1f5e4d0b.js → HEAD CIRCUM_BOYS.zscore.yearly-14cd6ac3.js} +0 -0
  215. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.monthly-36881b4b.js → HEAD CIRCUM_GIRLS.percentile.monthly-5dfad4d1.js} +0 -0
  216. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.weekly-0535db6d.js → HEAD CIRCUM_GIRLS.percentile.weekly-639d8dde.js} +0 -0
  217. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.yearly-018ff807.js → HEAD CIRCUM_GIRLS.percentile.yearly-5127bd6e.js} +0 -0
  218. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.monthly-c1dbe313.js → HEAD CIRCUM_GIRLS.zscore.monthly-88a31a5e.js} +0 -0
  219. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.weekly-cd22e813.js → HEAD CIRCUM_GIRLS.zscore.weekly-ad9ada8a.js} +0 -0
  220. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.yearly-6a9ea565.js → HEAD CIRCUM_GIRLS.zscore.yearly-5ee21f32.js} +0 -0
  221. /package/build/esm/{HEIGHT_BOYS.percentile.monthly-8e6a0752.js → HEIGHT_BOYS.percentile.monthly-c479be5b.js} +0 -0
  222. /package/build/esm/{HEIGHT_BOYS.percentile.weekly-ceabde0e.js → HEIGHT_BOYS.percentile.weekly-8d394a65.js} +0 -0
  223. /package/build/esm/{HEIGHT_BOYS.percentile.yearly-28d17801.js → HEIGHT_BOYS.percentile.yearly-1105d4bc.js} +0 -0
  224. /package/build/esm/{HEIGHT_BOYS.zscore.monthly-5ce17623.js → HEIGHT_BOYS.zscore.monthly-ce471f5a.js} +0 -0
  225. /package/build/esm/{HEIGHT_BOYS.zscore.weekly-d758fae7.js → HEIGHT_BOYS.zscore.weekly-6d57ce73.js} +0 -0
  226. /package/build/esm/{HEIGHT_BOYS.zscore.yearly-d11d3f15.js → HEIGHT_BOYS.zscore.yearly-605c6fa0.js} +0 -0
  227. /package/build/esm/{HEIGHT_GIRLS.percentile.monthly-31f4a828.js → HEIGHT_GIRLS.percentile.monthly-b4222a77.js} +0 -0
  228. /package/build/esm/{HEIGHT_GIRLS.percentile.weekly-735778e7.js → HEIGHT_GIRLS.percentile.weekly-fb194d31.js} +0 -0
  229. /package/build/esm/{HEIGHT_GIRLS.percentile.yearly-1eabd968.js → HEIGHT_GIRLS.percentile.yearly-d6c953c1.js} +0 -0
  230. /package/build/esm/{HEIGHT_GIRLS.zscore.monthly-8b8612b9.js → HEIGHT_GIRLS.zscore.monthly-cd1338a9.js} +0 -0
  231. /package/build/esm/{HEIGHT_GIRLS.zscore.weekly-b8a53c59.js → HEIGHT_GIRLS.zscore.weekly-f5dc83bf.js} +0 -0
  232. /package/build/esm/{HEIGHT_GIRLS.zscore.yearly-bc15c84f.js → HEIGHT_GIRLS.zscore.yearly-883d1cb3.js} +0 -0
  233. /package/build/esm/{Subot-7ea674b0.js → Subot-536c3f3b.js} +0 -0
  234. /package/build/esm/{Visible-247d254f.js → Visible-07bc97fb.js} +0 -0
  235. /package/build/esm/{WEIGHT_BOYS.percentile.monthly-f08f1fd2.js → WEIGHT_BOYS.percentile.monthly-3cf32719.js} +0 -0
  236. /package/build/esm/{WEIGHT_BOYS.percentile.weekly-fbaf9e3d.js → WEIGHT_BOYS.percentile.weekly-f6924fc5.js} +0 -0
  237. /package/build/esm/{WEIGHT_BOYS.percentile.yearly-d64145ca.js → WEIGHT_BOYS.percentile.yearly-d4df8252.js} +0 -0
  238. /package/build/esm/{WEIGHT_BOYS.zscore.monthly-f239897a.js → WEIGHT_BOYS.zscore.monthly-3d9a8d06.js} +0 -0
  239. /package/build/esm/{WEIGHT_BOYS.zscore.weekly-1a2e5a33.js → WEIGHT_BOYS.zscore.weekly-c024bd0c.js} +0 -0
  240. /package/build/esm/{WEIGHT_BOYS.zscore.yearly-034538fa.js → WEIGHT_BOYS.zscore.yearly-1dcfb819.js} +0 -0
  241. /package/build/esm/{WEIGHT_GIRLS.percentile.monthly-39819cdb.js → WEIGHT_GIRLS.percentile.monthly-d7ffa946.js} +0 -0
  242. /package/build/esm/{WEIGHT_GIRLS.percentile.weekly-15569768.js → WEIGHT_GIRLS.percentile.weekly-aaded163.js} +0 -0
  243. /package/build/esm/{WEIGHT_GIRLS.percentile.yearly-9f519921.js → WEIGHT_GIRLS.percentile.yearly-2c9b0a45.js} +0 -0
  244. /package/build/esm/{WEIGHT_GIRLS.zscore.monthly-c0a9a7aa.js → WEIGHT_GIRLS.zscore.monthly-8580cd15.js} +0 -0
  245. /package/build/esm/{WEIGHT_GIRLS.zscore.weekly-23c1cce3.js → WEIGHT_GIRLS.zscore.weekly-93b568ba.js} +0 -0
  246. /package/build/esm/{WEIGHT_GIRLS.zscore.yearly-9a088bbf.js → WEIGHT_GIRLS.zscore.yearly-b0ec5b92.js} +0 -0
  247. /package/build/esm/{cookieHelper-0d554a3d.js → cookieHelper-186bd645.js} +0 -0
  248. /package/build/esm/{dataTransform-cf3f3aee.js → dataTransform-c14284c9.js} +0 -0
  249. /package/build/esm/{index-c26145e4.js → index-5d7d7599.js} +0 -0
  250. /package/build/esm/{index-96308c0d.js → index-a0e83cd4.js} +0 -0
  251. /package/build/esm/{index-e4c49b57.js → index-b1b894e8.js} +0 -0
  252. /package/build/esm/{isProduction-d0d81279.js → isProduction-72db2237.js} +0 -0
  253. /package/build/esm/{localizeNumberFormat-1e3158ab.js → localizeNumberFormat-cf3b94f0.js} +0 -0
  254. /package/build/esm/{normalizeLink-409cf3bf.js → normalizeLink-a4622871.js} +0 -0
  255. /package/build/esm/{number-f57dcbd1.js → number-b3dfca43.js} +0 -0
  256. /package/build/esm/{paths-f6ce774b.js → paths-1bcffe54.js} +0 -0
  257. /package/build/esm/{screenSizeContext-8f042934.js → screenSizeContext-2352b7aa.js} +0 -0
  258. /package/build/esm/{theme-c254ba9f.js → theme-b4e6528d.js} +0 -0
  259. /package/build/esm/{translationsContext-f66e3d3d.js → translationsContext-98678f48.js} +0 -0
  260. /package/build/esm/{tslib.es6-1a7e483e.js → tslib.es6-98bf90db.js} +0 -0
  261. /package/build/esm/{types-062901c3.js → types-4bb0566e.js} +0 -0
  262. /package/build/esm/{useIsInit-db1c31df.js → useIsInit-eb1ac6ed.js} +0 -0
  263. /package/build/esm/{useOutsideClick-bfa18062.js → useOutsideClick-3350280e.js} +0 -0
  264. /package/build/esm/{useScrollbarSize-611c8d35.js → useScrollbarSize-7e416060.js} +0 -0
  265. /package/build/{index-1b69057d.js → index-0e5c2cd6.js} +0 -0
  266. /package/build/{index-e6e3941f.js → index-5891a14f.js} +0 -0
  267. /package/build/{index-cd030832.js → index-8c4a05ca.js} +0 -0
  268. /package/build/{isProduction-e1ad6827.js → isProduction-b408dff4.js} +0 -0
  269. /package/build/{localizeNumberFormat-7e1dae02.js → localizeNumberFormat-a33efb52.js} +0 -0
  270. /package/build/{normalizeLink-adb3417c.js → normalizeLink-1e9b5f31.js} +0 -0
  271. /package/build/{number-995e468a.js → number-fb95e04d.js} +0 -0
  272. /package/build/{paths-f7c2f1d1.js → paths-7d068661.js} +0 -0
  273. /package/build/{screenSizeContext-66416462.js → screenSizeContext-e76740a8.js} +0 -0
  274. /package/build/{theme-675875f1.js → theme-2435759c.js} +0 -0
  275. /package/build/{translationsContext-37b57080.js → translationsContext-a922fde7.js} +0 -0
  276. /package/build/{tslib.es6-af7c5340.js → tslib.es6-ecc4123f.js} +0 -0
  277. /package/build/{types-8f4d78a7.js → types-584a24d8.js} +0 -0
  278. /package/build/{useIsInit-3c899c10.js → useIsInit-7ce6650b.js} +0 -0
  279. /package/build/{useOutsideClick-44c908eb.js → useOutsideClick-b2a8f1f4.js} +0 -0
  280. /package/build/{useScrollbarSize-aef8017d.js → useScrollbarSize-be33a74c.js} +0 -0
package/build/esm/lead.js CHANGED
@@ -1 +1 @@
1
- import{_ as e,a as t}from"./tslib.es6-1a7e483e.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{B as m}from"./index-19144b5a.js";import{CommonGAssets as u}from"./gAssets.js";import{Portal as p,Box as h,Transition as g,Overlay as v}from"@mantine/core";import{T as b}from"./index-e751d8c2.js";import"@linaria/react";import{S as f,d as y,c as k,R as _,P as E,N as w}from"./index-02f0f4fe.js";import{H as C}from"./index.styles-3036321c.js";import"./constants-bcabc622.js";import"./Subot-7ea674b0.js";import"./utils-0347b372.js";import{l as N,k as T}from"./screenSizeContext-8f042934.js";import{D as S}from"./index-c7ee8e8e.js";import x from"dayjs";import"styled-components";import{t as O}from"./theme-c254ba9f.js";import"./index-13feb3ef.js";import"./isProduction-d0d81279.js";import{T as P}from"./translationsContext-f66e3d3d.js";import"string-format";import"@mantine/hooks";import"./index.styled-d760ce2f.js";import"./index-c26145e4.js";import"./useCategory-b6426a83.js";import{M as B}from"./utils-f65c59d5.js";import"@mantine/dates";import{u as j,G as L}from"./usePlacesAutocomplete-12181fb9.js";import{createFormContext as $}from"@mantine/form";import{u as A}from"./useTranslations-e0f5679c.js";import{createPortal as I}from"react-dom";import{g as D,s as U}from"./cookieHelper-0d554a3d.js";import"date-fns/locale";import"@mantine/carousel";import"classnames";import"react-keyed-flatten-children";import"slugify";import"lodash/throttle";const R=1,H=2;let M="https://dev.leadgen.hellobacsi.com/";const F=1,W=2;let V="";M.includes("localhost")&&(M="https://dev.leadgen.hellobacsi.com/"),location.hostname.includes("marrybaby.vn")&&(V="pink");let q="https://"+location.hostname+location.pathname+location.search;q=q.toLowerCase(),sessionStorage.getItem("insider_object")&&(window.insider_object=JSON.parse(sessionStorage.getItem("insider_object")));const J={"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}},Y=J[document.documentElement.lang]||J["vi-VN"];const z={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 G={"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 K={"en-PH":G,"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":G},Q=e=>{const t=K[e];return t||K["en-PH"]},X=l({}),Z=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}},ee=({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",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"}))),te=({popupId:e,url:t,newTab:l,imageDestkop:n,imageMobile:o,onClose:i,onOtherSubmit:r})=>{const{width:s,height:d,loaded:c}=Z(o),{width:m,height:u,loaded:p}=Z(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(ee,{onClose:i,containerClassName:"close-button-top-right"})))):null},ae=({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}=Z(c),{width:v,height:b,loaded:f}=Z(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(ee,{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(ee,{onClose:m,containerClassName:"close-button-top-right"}))))):null};const le=new class{constructor(){this.apiLeadUrl="https://dev.leadgen.hellobacsi.com/",this.apiSubotUrl="https://staging-service-subot.hellohealthgroup.com/"}},ne={call(t){var{url:a,data:l}=t,n=e(t,["url","data"]);return n.body=JSON.stringify(l),n.headers={"Content-Type":"application/json"},fetch(`${le.apiLeadUrl}${a}`,n).then((e=>e.json())).catch((()=>({})))}},oe={call(t){var{url:a,data:l}=t,n=e(t,["url","data"]);return n.body=JSON.stringify(l),n.headers={"Content-Type":"application/json"},fetch(`${le.apiSubotUrl}${a}`,n).then((e=>e.json())).catch((()=>({})))}},ie=({bot_id:e,email:t,phone:a})=>{let l=a;return l&&l.startsWith("0")&&(l=l.substring(1)),oe.call({url:"frontend/api/subot-campaign/check",method:"post",data:{bot_id:e,email:t,phone:l}})},re=({campaign_id:e,email:t,phone:a})=>{let l=a;return l&&l.startsWith("0")&&(l=l.substring(1)),ne.call({url:"api/subot-campaign/check",method:"post",data:{campaign_id:e,email:t,phone:l}})},se=({phone:e,type:t})=>ne.call({url:"phone"===t?"api/sms/otp":"api/sms/whatsapp_otp",method:"post",data:{phone_number:"phone"===t?e.replace("+",""):e}}),de=({phone:e,otp:t,type:a})=>ne.call({url:"phone"===a?"api/sms/verify":"api/sms/whatsapp_verify",method:"post",data:{otp_code:t,phone_number:"phone"===a?e.replace("+",""):e}}),ce={email:{},phone:{}},me=(e,a,l)=>t(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(ce[n][o]){if(ce[n][o].value)return i;if(!ce[n][o].value&&ce[n][o].expire>Date.now())return""}const r=yield((e,a,l)=>t(void 0,void 0,void 0,(function*(){const t="email"in l?"email":"phone",n="email"in l?l.email:l.phone,o="email"in l?"validator.emailUsed":"validator.phoneUsed",i=yield re({campaign_id:[e],[t]:n});return"SubmitLeadWithBotId_ERR_001"===i._errorCode||"SubmitLeadWithBotId_ERR_002"===i._errorCode||a.length&&"CheckSuBotLeadTool_ERR_001"===(yield ie({bot_id:a,[t]:n}))._errorCode?o:void 0})))(e,a,l);return ce[n][o]=r?{value:!0}:{value:!1,expire:Date.now()+6e4},r})),[ue,pe,he]=$(),ge=["places"],ve=({name:e,placeholder:t,locale:l})=>{var s;const d=pe(),[c,m]=n(""),[u,p]=n(""),{predictions:h}=j(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,y]=n(!1),k=r(Math.random().toString(36).substring(7)),_=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)?y(!0):import("@react-google-maps/api").then((e=>{v((()=>e.LoadScript)),setTimeout((()=>{y(!0)}),200)}))}),[]),b?a.createElement(a.Fragment,null,g&&a.createElement(g,{googleMapsApiKey:L,libraries:ge,loadingElement:a.createElement(a.Fragment,null)}),a.createElement("div",{style:{display:"none"},"data-extra":!0,"data-name":e,"data-control":"text"}),a.createElement(f,Object.assign({className:"lead-modal__form-control",label:t,placeholder:t,withAsterisk:!0,name:e,data:_,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"},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-"+k.current,rightSection:a.createElement(a.Fragment,null)},d.getInputProps(e)))):a.createElement("div",{style:{height:73}})},be=({children:e,align:t})=>a.createElement("p",{className:`lead-modal__description ${"le-text-align-"+(t||"")} ${V}`},e),fe=({children:e,align:t})=>a.createElement("h2",{className:`lead-modal__title ${"le-text-align-"+(t||"")} ${V}`},e),ye=({listBlockAdded:e,popupId:t,locale:l,onClose:n,onOtherSubmit:o})=>{const i=pe();return a.createElement(a.Fragment,null,e.map(((e,r)=>{const{name:s="",data:d={}}=e||{},{placeholder:c,value:u,align:p,listQuestion:h,isSendMailChimp:g=!1,newtab:v,url:b}=d;switch(s){case"TitleBlock":return a.createElement(fe,{key:r,align:p},u);case"SubtitleBlock":return a.createElement(be,{key:r,align:p},u);case"TextBlock":return a.createElement(k,Object.assign({key:r,withAsterisk:!0,spellCheck:!1,type:"text",placeholder:c,className:"lead-modal__form-control",label:c,"data-control":"text",name:u},i.getInputProps(u)));case"NumberBlock":return a.createElement(w,Object.assign({key:r,withAsterisk:!0,spellCheck:!1,type:"number",placeholder:c,className:"lead-modal__form-control",label:c,"data-control":"number",name:u},i.getInputProps(u)));case"EmailBlock":return a.createElement(k,Object.assign({key:r,withAsterisk:!0,spellCheck:!1,placeholder:c,className:"lead-modal__form-control",label:c,"data-control":"email",name:u},i.getInputProps(u)));case"PhoneOtpBlock":case"WhatsappOtpBlock":case"PhoneBlock":{const e=t+"-"+u+"-"+r;return a.createElement(k.Wrapper,Object.assign({size:"md",withAsterisk:!0,key:r,label:c,className:"lead-modal__form-control",labelProps:{htmlFor:e}},i.getInputProps(u)),a.createElement(E,{name:u,spellCheck:!1,type:"tel",placeholder:c,onChange:e=>{i.setFieldValue(u,e)},id:e,defaultCountry:l&&B[l]||"VN","data-control":"tel"}))}case"LocationBlock":return a.createElement(ve,{key:r,name:u,placeholder:c,locale:l});case"DateBlock":return a.createElement(a.Fragment,null,a.createElement(S,Object.assign({withAsterisk:!0,key:r,type:"default",name:u,placeholder:c,className:"lead-modal__form-control",label:c,"data-control":"date"},i.getInputProps(u))),a.createElement("input",{type:"hidden",name:u,"data-control":"date"}));case"LinkButtonBlock":return a.createElement("div",{key:r},a.createElement("a",{target:v?"blank":"parrent",href:b,style:{textDecoration:"none"}},a.createElement(m,{type:"button",size:"md",className:`lead-modal__btn ${V}`,onClick:()=>{null==n||n(),null==o||o()}},u)));case"CheckboxBlock":return a.createElement(a.Fragment,null,g&&a.createElement("div",{style:{display:"none"},"data-name":u+"-mailchimp"}),a.createElement(y.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(u)),h.map(((e,t)=>a.createElement(y,{name:u,key:t,value:e.value,label:e.placeholder,"data-control":"checkbox"})))));case"RadioBlock":return a.createElement(a.Fragment,null,g&&a.createElement(k,{type:"hidden",name:u+"-mailchimp",value:g}),a.createElement(_.Group,Object.assign({withAsterisk:!0,className:"lead-modal__form-control",key:r,label:c,size:"md"},i.getInputProps(u)),h.map(((e,t)=>a.createElement(_,{name:u,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":u,"data-control":"dropdown"}),a.createElement(f,Object.assign({key:r,className:"lead-modal__form-control",label:c,withAsterisk:!0,name:u,data:h.map((e=>({value:e.value,label:e.placeholder})))},i.getInputProps(u))));case"TncBlock":const s=i.getInputProps("TNC-"+e.id);return a.createElement(a.Fragment,null,a.createElement(y,Object.assign({name:"TNC-"+e.id,key:e.id,label:a.createElement("p",{className:"lead-modal__tnc-link",dangerouslySetInnerHTML:{__html:d.valueHTML}}),className:"tnc-block","data-control":"checkbox"},s,{error:s.error?a.createElement(a.Fragment,null):void 0})))}return null})))},ke=({otpData:e,onSuccess:l,autoSendWhenOpen:i})=>{const{t:s}=A(),d=e.phone,c=e.type,[u,p]=n(""),[h,g]=n(!1),[v,f]=n(i?0:60),y=r(null),[_,E]=n(),[w,N]=n(""),T=r(),[S,x]=n(!1);o((()=>{t(void 0,void 0,void 0,(function*(){var e;if(!T.current){const e=yield import("react-phone-number-input");T.current=e.formatPhoneNumberIntl}N((null===(e=T.current)||void 0===e?void 0:e.call(T,d))||d)}))}),[d]);const P=()=>t(void 0,void 0,void 0,(function*(){var e;if(!d)return;const t=yield se({phone:d,type:c}),a=null===(e=null==t?void 0:t._messages)||void 0===e?void 0:e[0];"Send sms successfully"===a||"Send WhatsApp successfully"===a?(f(60),setTimeout((()=>{y.current&&(y.current.focus(),y.current.scrollIntoView({block:"center"}))}),100)):"This phone number was verified"===a?l():E(a||"Something went wrong!")}));return o((()=>{setTimeout((()=>{v>0&&f((e=>e-1))}),1e3)}),[v]),o((()=>{i&&!v&&P()}),[]),a.createElement(a.Fragment,null,a.createElement("form",{onSubmit:e=>{e.preventDefault(),t(void 0,void 0,void 0,(function*(){if(!d||!u)return;x(!0);const e=yield de({phone:d,otp:u,type:c}),t=null==e?void 0:e._messages[0];"Verify successfully"===t||"Verify WhatsApp OTP sucess"===t||"This phone number was verified"===t?l():E(t||"something Wrong"),x(!1)}))},className:"lead-phone-otp-form"},a.createElement(C,{tag:"h3",fontWeight:"bold",style:{marginBottom:4}},s("lead.otp.title")),a.createElement(b,{size:"p1",color:O.colors.gray600},s("lead.otp.desc",{phone:w})),a.createElement(k,{ref:y,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:u,maxLength:6,onChange:e=>{g(!0),p(e),E(h&&!e?"OTP is required":void 0)},error:h?_:void 0}),a.createElement(m,{size:"md",color:"primary",className:`lead-modal__btn ${V}`,disabled:!u,isLoading:S},s("lead.otp.verify")),a.createElement(m,{type:"button",size:"md",color:"transparent",className:`lead-modal__btn lead-phone-otp-button ${V}`,onClick:()=>{P()},disabled:!!v},s("lead.otp.resend",{timer:v?` (${v}s)`:""}))))},_e=({title:e,titleAlign:t,subtitle:l,subtitleAlign:n,link:o,linkNewTab:i,linkText:r,image:s})=>{const{width:d,height:c,loaded:m}=Z(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}`},loading:"lazy"}),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 ${V}`},r))))):null},Ee=({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?I(e,a):null},we=({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=>I(e,N(t,"sidebar-lead-modal-wrapper")))))},Ce=({popupId:e,extraFields:t,onClose:l,onOtherSubmit:s,imageMobile:d,imageDesktop:c,imageOverlayMobile:p,imageOverlayDesktop:h,imageBackground:g,currentLayout:v,title:b,onSubmit:f,showThankyou:y,campaignId:k,campaign_subot_id:_,locale:E})=>{var w,C,N;const T=JSON.parse(t.listBlockAdded),S=JSON.parse(t.actionBlocks),x=JSON.parse(t.textBlocks),O=S.submitBlock.data.url,P=S.submitBlock.data.text,B=S.submitBlock.data.text2,j=S.submitBlock.data.value,L=location.pathname,$=v.includes("Inline")||"Sidebar"===v,I="Slider"===v,[D,U]=n(!0),[R,H]=n(null),[M,F]=n(!1),W=r(),q=()=>{R?H(null):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"),ce.email={},ce.phone={}}),[]);const J=r(!1),z=r(!1),{form:G,validateObj:K}=(({listBlockAdded:e=[],validatingPhoneRef:t,validatingEmailRef:a,campaignId:l,campaign_subot_id:n=[]})=>{const{t:o}=A(),s=i((()=>{const i=["TextBlock","NumberBlock","EmailBlock","PhoneBlock","DateBlock","CheckboxBlock","RadioBlock","DropdownBlock","PhoneOtpBlock","WhatsappOtpBlock","LocationBlock","TncBlock"],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..."),me(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||"WhatsappOtpBlock"===i.name?Object.assign(Object.assign({},e),{[i.data.value]:r(i.data.value,(e=>{if(window.intlTelInputUtils&&!window.intlTelInputUtils.isValidNumber(String(e),Y.countryCode))return o("validator.phone");t.current=!0,setTimeout((()=>{c.current.setFieldError(i.data.value,"Validating..."),me(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")}))}):"TncBlock"===i.name?Object.assign(Object.assign({},e),{["TNC-"+i.id]:r("TNC-"+i.id)}):Object.assign(Object.assign({},e),{[i.data.value]:r(i.data.value)})),{})}),[e.map((e=>e.name)).join(",")]),d=he({validateInputOnChange:!0,clearInputErrorOnChange:!0,validate:s}),c=r(d);return c.current=d,{form:d,validateObj:s}})({listBlockAdded:T,validatingPhoneRef:J,validatingEmailRef:z,campaignId:k,campaign_subot_id:_}),{width:Q,height:X,loaded:te}=Z(g),{width:ae,height:le,loaded:ne}=Z(d),{width:oe,height:ie,loaded:re}=Z(c),de=ne&&re&&("Fullscreen"!=v||te),pe=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 ${p?`\n .le-newbuilder-overlay {\n background: url(${p}) ;\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 ${$?"le-buider-inline":""} ${I?"le-buider-slider":""}`},"Fullscreen"==v?a.createElement("img",{className:"le-only-desktop le-fullscreen-img",draggable:!1,src:g||"",style:{aspectRatio:`${Q}/${X}`}}):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(_e,{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:u.getAssetPath("lead-otp-thumb.png"),draggable:"false",alt:"",style:{width:"100%",minHeight:"150px",backgroundColor:"#f2f2f2"},loading:"lazy"}):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:`${ae}/${le}`},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:{objectFit:"cover",aspectRatio:`${oe}/${ie}`},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:`${ae}/${le}`}}):null))),R&&a.createElement(ke,{otpData:R,autoSendWhenOpen:!1,onSuccess:()=>{H(null),null==f||f(W.current,G.values)}}),a.createElement("div",{"data-hidden":!!R,className:"lead-modal__body le-newbuilder-overlay"},a.createElement(ue,{form:G},a.createElement("form",{ref:W,className:`lead-modal__form ${e}`,onSubmit:e=>{e.preventDefault(),G.setTouched(Object.keys(K).reduce(((e,t)=>(e[t]=!0,e)),{})),z.current||J.current||setTimeout((()=>{G.onSubmit((e=>{var t,a,l,n,o,i;if(Object.keys(G.errors).length)return;let r=null;if(T.findIndex((e=>"PhoneOtpBlock"===e.name))>-1){const n=null===(a=null===(t=T.find((e=>"PhoneOtpBlock"===e.name)))||void 0===t?void 0:t.data)||void 0===a?void 0:a.value;(null===(l=e[n])||void 0===l?void 0:l.startsWith("+"))&&(r={phone:e[n],type:"phone"})}if(T.findIndex((e=>"WhatsappOtpBlock"===e.name))>-1){const t=null===(o=null===(n=T.find((e=>"WhatsappOtpBlock"===e.name)))||void 0===n?void 0:n.data)||void 0===o?void 0:o.value;(null===(i=e[t])||void 0===i?void 0:i.startsWith("+"))&&(r={phone:e[t],type:"whatsapp"})}if(r)return F(!0),void se(r).then((t=>{var a;"This phone number was verified"!==(null===(a=null==t?void 0:t._messages)||void 0===a?void 0:a[0])?H(r):null==f||f(W.current,e)})).finally((()=>{F(!1)}));null==f||f(W.current,e)}))(e)}),100)}},a.createElement("div",{style:{marginBottom:20}},a.createElement("h2",{className:`lead-modal__title ${"le-text-align-"+(null===(w=x.titleBlock.data)||void 0===w?void 0:w.align)} ${V}`},b),a.createElement("p",{className:`lead-modal__description ${"le-text-align-"+(null===(C=x.titleBlock.data)||void 0===C?void 0:C.align)} ${V}`},x.subtitleBlock.data.value)),a.createElement("div",{className:"lead-modal__form-control-wrapper"},a.createElement(ye,{listBlockAdded:T,popupId:e,locale:E,onClose:q,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 ${V}`},a.createElement("div",{className:"lead-modal__checkbox"},a.createElement("input",{id:"lead-term-checkbox",className:`lead-modal__checkbox__input ${V}`,type:"checkbox","aria-label":"Checkbox label",checked:D,onChange:e=>U(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"}},B)))),a.createElement(m,{size:"md",id:"lead-submit",type:"submit",className:`lead-modal__btn ${V}`,disabled:!D,isLoading:M},j))))))),!v.includes("Inline")&&a.createElement(ee,{onClose:q,containerClassName:"close-button-top-right"}))));return de?v.includes("LightBox")||"Fullscreen"==v||"Slider"==v?pe:"Sidebar"==v?a.createElement(we,{content:pe}):v.includes("Inline")?a.createElement(Ee,{content:pe,inlinePosition:t.popupInlinePosition}):null:null},Ne=({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}=Z(i),{width:h,height:g,loaded:v}=Z(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(ee,{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(ee,{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(ee,{containerClassName:"close-button-top-right",svgClassName:"le-mobile-btn",onClose:o}))))):null},Te=({popupId:e,url:t,newTab:l,image:n,onClose:o,onOtherSubmit:i})=>{const{width:r,height:s,loaded:d}=Z(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(ee,{onClose:o,containerClassName:"close-button-top-right"})))):null},Se=[],xe=[],Oe=[],Pe=[],Be=[],je=[];const Le=(e="UTC")=>{const t=new Date;return new Date(t.toLocaleString("en-US",{timeZone:e}))},$e=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 Ae=e=>!function(e){var t;const a=Number(null===(t=e.rules.find((e=>"exclude_sponsored"==e.rule)))||void 0===t?void 0:t.value);return!(!Boolean(document.querySelector(".hhg-disclaimer-text"))||!a||(Pe.push(e),0))}(e)&&(!!function(e){var t,a;try{const l=null===(t=e.rules.find((e=>"exclude_sponsored_list"==e.rule)))||void 0===t?void 0:t.value,n=l instanceof Array?l:JSON.parse(l),o=Number(null===(a=document.querySelector("[data-sponsored-id]"))||void 0===a?void 0:a.getAttribute("data-sponsored-id"));return!o||o<=0||0===n.length||(!!n.find((e=>e.id==o))||(Be.push({id:e.id,rules:e.rules}),!1))}catch(e){return!0}}(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=$e(a),o=$e(l);if(!n||!o)return!0;const i=(null===(t=e.site)||void 0===t?void 0:t.id)||1;return!(Le(z[i]).getTime()>o.getTime()&&(Oe.push(e),1))}(e):0===e.formatted_status&&(Se.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=$e(l),i=$e(n);if(!o||!i)return!1;const r=Le(z[a]).getTime();return r<=i.getTime()&&r>=o.getTime()&&(xe.push(e),!0)})(e)))),Ie=e=>{var t;try{const a=(e,t,a)=>{const l=t.split(":"),n=a.split(":"),o=new Date;o.setHours(Number(l[0]),Number(l[1]),0,0);const i=new Date;return i.setHours(Number(n[0]),Number(n[1]),0,0),e>=o&&e<=i},l=null===(t=e.rules.find((e=>"appearance_time"==e.rule)))||void 0===t?void 0:t.value,n=l.startTime,o=l.endTime||"23:59";return!n||(!!a(new Date,n,o)||(je.push(e),!1))}catch(e){return!0}};let De=null;function Ue({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:D("_ga")||null})}).then((e=>e.json())).then((e=>{var t,n,i,r;if(Re("List campagin: ",e),q="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(Ae))||[]).filter(Ie);D("hhg-id")||(U("hhg-id",c(),{domain:"."+a,path:"/"}),Re("😍 Set HHG ID cookie"));let d=[];d=/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==F)))):s.filter((e=>e.device_types.some((e=>e.id==W)))),Re("👓 campaignsDevice",d),Re("--listCampaignScheduled",Se),Re("--listCampaignScheduledToActivated",xe),Re("--listCampaignActiveButExpired",Oe),Re("--listCampaignExcludeSonsored",Pe),Re("--listCampaignDifferentSponsor",Be),Re("--listCampaignNotDisplayInRangeOfTime",je);let m=d.map(((e,t)=>e.targets.filter((e=>e.type==R)).map((e=>Object.assign(Object.assign({},e),{campaignIndex:t}))))).flat(1);m=m.filter((e=>{var t;const a=new URL(String(e.target).toLowerCase());if("exact_match"==e.option)return Boolean(o===(null===(t=a.href)||void 0===t?void 0:t.toLowerCase()));if("start_with"==e.option){if(o.includes(String(e.target).toLowerCase())){const t=e.sub_target.filter((e=>"excluding"==e.option)).map((e=>{var t;return null===(t=e.value)||void 0===t?void 0:t.toLowerCase()}));return!t.includes(o.split("?")[0])}return!1}}));const u=Array.from(document.getElementsByTagName("META")).filter((e=>"article:tag"==e.getAttribute("property"))).map((e=>e.content));let p=[],h=[];u&&u.length&&(p=d.map(((e,t)=>e.targets.filter((e=>e.type==H)).map((e=>Object.assign(Object.assign({},e),{campaignIndex:t}))))).flat(1),h=p.filter((e=>u.includes(e.target))));const g=[...m,...h],v=document.cookie.split("; ").map((e=>e.split("=")[0])),b=v.filter((e=>e.includes("lead_submited")));Re("--listCampaignCodeSubmited",b);const f=v.filter((e=>e.includes("lead_closed")));Re("--listCampaignCodeClosed",f);const y=[...b,...f],k=(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})(g.filter((e=>!y.some((t=>t.includes(d[e.campaignIndex].code))))));if(Re("--listCampaignValid : ",k),k&&k.length){const e=d[k[0].campaignIndex];Re("CAMPAIGN_SHOW",e);const{rules:t}=e,a=Number(null===(i=t.find((e=>"time"==e.rule)))||void 0===i?void 0:i.value);Re("timeoutRule",a);const n=Number(null===(r=t.find((e=>"scroll"==e.rule)))||void 0===r?void 0:r.value);Re("scrollRule",n);let o="TIME";if(Number.isInteger(a)&&(o="TIME",Re("✨ SHOW AWESOME POPUP AFTER: ",a," seconds"),De&&clearTimeout(De),De=setTimeout((()=>{null==l||l(e,o)}),1e3*a)),Number.isInteger(n)){o="SCROLL",Re("✨ SHOW AWESOME AFTER: SCROLL",n," %");const t=document.querySelector(`[data-url="${location.pathname}"]`)||document.querySelector("body"),a=t.getBoundingClientRect().top,i=t.offsetHeight;Re("👓 Element check scroll: ",t);const r=function(){const t=window.pageYOffset||document.documentElement.scrollTop;let s=0;t>=a&&(s=Math.round((t-a)/(i-innerHeight)*100)),Re("---Scroll",s,n),s>=n&&(window.removeEventListener("scroll",r),null==l||l(e,o))};window.addEventListener("scroll",r,{passive:!0})}}else Re("🚧 No lead campaigns on current URL, tags")}})).catch((e=>{Re("Lead error: ",e)}))}const Re=(...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 He=({campaign:e,action:t,onSubmit:l,onClose:n,showThankyou:i,locale:d})=>{var m,u;const{apiUrl:p,siteDomain:h}=s(X);o((()=>{const e=D("_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:D("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 T=(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:{}},x=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}(T);if(O){Re("⚡️ 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 Re("⚡️ No META TAG for categoryLevel, not show popup",O),null;S[O]={value:t.content,value_en:a.content},T=T.replace(`{{category_${O}}}`,t.content),Re("⚡️ Set categoryData ",O)}else Re("⚡️ No categoryLevel",O);const P=()=>{var t,a,l,o;if(Re("👌 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&&(Re("⛔ Popup never show again!"),U(`lead_submited_${f}`,`target_${g.popupVersion}`,{domain:"."+h,path:"/"})),1==r&&(Re(`⌛ Popup will show again after ${i} days!`),U(`lead_submited_${f}`,`target_${g.popupVersion}`,{domain:"."+h,days:i,path:"/"}));const s=D("_ga")||null,d={url:location.href.toLowerCase(),title_article:document.title,meta:[],cookie_id:D("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&&Re(e)})).catch((e=>{Re("Error:",e)})),null==n||n()};return"CenterTab"===E?a.createElement(te,{popupId:x.current,url:w.imageMobile.data.url,newTab:w.imageMobile.data.newtab,imageMobile:v,imageDestkop:b,onClose:n,onOtherSubmit:P}):"Tab"===E?a.createElement(Te,{popupId:x.current,url:w.imageMobile.data.url,newTab:w.imageMobile.data.newtab,image:v,onClose:n,onOtherSubmit:P}):"Floating"===E?a.createElement(ae,{popupId:x.current,title:T,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(Ce,{popupId:x.current,extraFields:g,onClose:n,onOtherSubmit:P,imageMobile:v,imageDesktop:b,imageBackground:y,currentLayout:E,title:T,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(Ne,{popupId:x.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},Me=({apiUrl:e,siteDomain:l,siteId:s,locale:c,apiSubotUrl:m,DEBUG_URL:u})=>{var b;const f=r(),y=r(Date.now()),{apiUrl:k}=i((()=>{let t=e;return t.includes("localhost")&&(t="https://dev.leadgen.hellobacsi.com/"),{apiUrl:t}}),[e,l,s]),[_,E]=n(null),[w,C]=n(""),[N,S]=n(null);o((()=>{le.apiLeadUrl=k,le.apiSubotUrl=m}),[k,m]);const O=(e,t)=>{E(e),C(t)},B=()=>{var e,t;if(!_)return;Re(`👋👋👋 CLOSE POPUP ${_.code} 👋👋👋`);const a=Number(null===(e=_.rules.find((e=>"show_again_after_exit"==e.rule)))||void 0===e?void 0:e.value),n=Number(null===(t=_.rules.find((e=>"days_to_show_again"==e.rule)))||void 0===t?void 0:t.value);0==a&&U(`lead_closed_${_.code}`,`target_${null==_?void 0:_.extra_fields.popupVersion}`,n?{domain:"."+l,days:n,path:"/"}:{domain:"."+l,path:"/"}),document.body.classList.remove("noscroll"),fetch(`${k}api/campaign/${_.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:D("hhg-id"),duration:Math.ceil((Date.now()-y.current)/1e3)})}),E(null),S(null)};o((()=>{if(window.next){const e=d((e=>{Re("--🌻 routeChangeComplete",e,Date.now());const t=location.pathname;B(),document.querySelectorAll(`[data-popup-url="${t}"]`).length?Re("🔥 This URL page has show popup!"):(Re("--Process checkShowPopup"),Ue({leadApi:k,leadDomain:l,leadSiteId:s,onShowPopup:O,DEBUG_URL:u})),f.current&&window.removeEventListener("scroll",f.current)}),500);window.next.router.events.on("routeChangeComplete",e)}Ue({leadApi:k,leadDomain:l,leadSiteId:s,onShowPopup:O,DEBUG_URL:u})}),[]);const j=(e,a,n,o)=>t(void 0,void 0,void 0,(function*(){var t,i,r,s,d,c,m,u,p,h,g;if(!a)return;Re("submitHandler",n,o);const v=Object.keys(a).map((e=>({name:e,value:String(a[e])}))),b=D("_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((t=>{var a,l;const n=(null===(a=e.querySelector(`*[name="${t.name}"][data-control]`))||void 0===a?void 0:a.getAttribute("data-control"))||(null===(l=e.querySelector(`*[data-extra][data-name="${t.name}"]`))||void 0===l?void 0:l.getAttribute("data-control"))||"text",o="tel"===n?window.intlTelInputUtils.formatNumber(String(t.value),null==Y?void 0:Y.countryCodeNumber,2).replace(/\s+/g,""):"date"===n?x(t.value).format("YYYY-MM-DD"):t.value;return{key:t.name,value:o,control:n}})),cookie_id:D("hhg-id"),ga_client_id:b};n&&o[n].value_en&&(f.category=o[n].value_en);const y=Number((null===(i=null===(t=_.rules)||void 0===t?void 0:t.find((e=>"days_to_show_again"===e.rule)))||void 0===i?void 0:i.value)||7),E=Number((null===(s=null===(r=_.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==E&&(Re("⛔ Popup never show again!"),U(`lead_submited_${_.code}`,`target_${null==_?void 0:_.extra_fields.targetType}`,{domain:"."+l,path:"/"})),1==E&&(Re(`⌛ Popup will show again after ${y} days!`),U(`lead_submited_${_.code}`,`target_${null==_?void 0:_.extra_fields.targetType}`,{domain:"."+l,days:y,path:"/"})),fetch(`${k}api/campaign/${_.code}/lead`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(f)}),"notshow"==(null==_?void 0:_.extra_fields.popupShowThankYou))return B(),void document.body.classList.remove("noscroll");let w=!0;const C=_.thank_you_image||`${k}admin/img/thanksyou.png`;let N,T,O=(null==_?void 0:_.extra_fields.popupThankyouTitle)||"Thank you.",P=(null==_?void 0:_.extra_fields.popupThankyouDesc)||"We appreciate your time!",j="",L="",$="";if("2.1"==(null==_?void 0:_.extra_fields.popupVersion)){const e=_.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));O=(null===(d=null==a?void 0:a.data)||void 0===d?void 0:d.value)||"",j=(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)||"",L=(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)||"",T=(null===(h=null==n?void 0:n.data)||void 0===h?void 0:h.newtab)||!1,$=(null===(g=null==n?void 0:n.data)||void 0===g?void 0:g.url)||"";const o=_.extra_fields.currentLayout;["SkinA","SkinB","Floating","Tab","CenterTab"].includes(o)&&(w=!1)}S(w?{title:O,titleAlign:j,subtitle:P,subtitleAlign:L,link:$,linkNewTab:T,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((()=>{_&&(y.current=Date.now())}),[_]),a.createElement(X.Provider,{value:{apiUrl:k,siteDomain:l,siteId:s,locale:c}},a.createElement(P.Provider,{value:{locale:c,values:Q(c)}},a.createElement(p,{target:T()},a.createElement(h,{sx:{position:"fixed",zIndex:9999999999}},a.createElement(g,{mounted:Boolean("2.1"===(null===(b=null==_?void 0:_.extra_fields)||void 0===b?void 0:b.popupVersion)),transition:"fade",duration:600,timingFunction:"ease"},(e=>{var t;return a.createElement(h,{style:e},"2.1"===(null===(t=null==_?void 0:_.extra_fields)||void 0===t?void 0:t.popupVersion)&&a.createElement(a.Fragment,null,!!_.extra_fields.currentLayout&&!_.extra_fields.currentLayout.includes("Inline")&&!_.extra_fields.currentLayout.includes("Sidebar")&&a.createElement(v,{color:"#000",opacity:.5,center:!0,zIndex:400,pos:"fixed",onClick:()=>B()}),a.createElement(He,{campaign:_,action:w,onSubmit:j,onClose:B,showThankyou:N,locale:c})))}))))))};export{Me as LeadGen};
1
+ import{_ as e,a as t}from"./tslib.es6-98bf90db.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{B as m}from"./index-e20fe766.js";import{CommonGAssets as u}from"./gAssets.js";import{Portal as p,Box as h,Transition as g,Overlay as v}from"@mantine/core";import{T as b}from"./index-93427f24.js";import"@linaria/react";import{S as y,d as f,c as k,R as _,P as E,N as w}from"./index-42a97c34.js";import{H as C}from"./index.styles-1dc3d7f0.js";import"./constants-da7ec5be.js";import"./Subot-536c3f3b.js";import"./utils-a52f9e39.js";import{l as N,k as T}from"./screenSizeContext-2352b7aa.js";import{D as S}from"./index-0aa9ad0c.js";import x from"dayjs";import"styled-components";import{t as O}from"./theme-b4e6528d.js";import"./index-1cc8c07f.js";import"./isProduction-72db2237.js";import{T as P}from"./translationsContext-98678f48.js";import"string-format";import"@mantine/hooks";import"./index.styled-c3a130a7.js";import"./index-5d7d7599.js";import"./useCategory-90322434.js";import{M as B}from"./utils-745dd450.js";import"@mantine/dates";import{u as j,G as L}from"./usePlacesAutocomplete-3f014212.js";import{createFormContext as $}from"@mantine/form";import{u as A}from"./useTranslations-24b07ae0.js";import{createPortal as I}from"react-dom";import{g as D,s as U}from"./cookieHelper-186bd645.js";import"date-fns/locale";import"@mantine/carousel";import"classnames";import"react-keyed-flatten-children";import"slugify";import"lodash/throttle";const R=1,H=2;let M="https://dev.leadgen.hellobacsi.com/";const F=1,W=2;let V="";M.includes("localhost")&&(M="https://dev.leadgen.hellobacsi.com/"),location.hostname.includes("marrybaby.vn")&&(V="pink");let q="https://"+location.hostname+location.pathname+location.search;q=q.toLowerCase(),sessionStorage.getItem("insider_object")&&(window.insider_object=JSON.parse(sessionStorage.getItem("insider_object")));const J={"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}},Y=J[document.documentElement.lang]||J["vi-VN"];const z={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 G={"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 K={"en-PH":G,"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":G},Q=e=>{const t=K[e];return t||K["en-PH"]},X=l({}),Z=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}},ee=({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",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"}))),te=({popupId:e,url:t,newTab:l,imageDestkop:n,imageMobile:o,onClose:i,onOtherSubmit:r})=>{const{width:s,height:d,loaded:c}=Z(o),{width:m,height:u,loaded:p}=Z(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(ee,{onClose:i,containerClassName:"close-button-top-right"})))):null},ae=({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}=Z(c),{width:v,height:b,loaded:y}=Z(d);return g&&y?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(ee,{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(ee,{onClose:m,containerClassName:"close-button-top-right"}))))):null};const le=new class{constructor(){this.apiLeadUrl="https://dev.leadgen.hellobacsi.com/",this.apiSubotUrl="https://staging-service-subot.hellohealthgroup.com/"}},ne={call(t){var{url:a,data:l}=t,n=e(t,["url","data"]);return n.body=JSON.stringify(l),n.headers={"Content-Type":"application/json"},fetch(`${le.apiLeadUrl}${a}`,n).then((e=>e.json())).catch((()=>({})))}},oe={call(t){var{url:a,data:l}=t,n=e(t,["url","data"]);return n.body=JSON.stringify(l),n.headers={"Content-Type":"application/json"},fetch(`${le.apiSubotUrl}${a}`,n).then((e=>e.json())).catch((()=>({})))}},ie=({bot_id:e,email:t,phone:a})=>{let l=a;return l&&l.startsWith("0")&&(l=l.substring(1)),oe.call({url:"frontend/api/subot-campaign/check",method:"post",data:{bot_id:e,email:t,phone:l}})},re=({campaign_id:e,email:t,phone:a})=>{let l=a;return l&&l.startsWith("0")&&(l=l.substring(1)),ne.call({url:"api/subot-campaign/check",method:"post",data:{campaign_id:e,email:t,phone:l}})},se=({phone:e,type:t})=>ne.call({url:"phone"===t?"api/sms/otp":"api/sms/whatsapp_otp",method:"post",data:{phone_number:"phone"===t?e.replace("+",""):e}}),de=({phone:e,otp:t,type:a})=>ne.call({url:"phone"===a?"api/sms/verify":"api/sms/whatsapp_verify",method:"post",data:{otp_code:t,phone_number:"phone"===a?e.replace("+",""):e}}),ce={email:{},phone:{}},me=(e,a,l)=>t(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(ce[n][o]){if(ce[n][o].value)return i;if(!ce[n][o].value&&ce[n][o].expire>Date.now())return""}const r=yield((e,a,l)=>t(void 0,void 0,void 0,(function*(){const t="email"in l?"email":"phone",n="email"in l?l.email:l.phone,o="email"in l?"validator.emailUsed":"validator.phoneUsed",i=yield re({campaign_id:[e],[t]:n});return"SubmitLeadWithBotId_ERR_001"===i._errorCode||"SubmitLeadWithBotId_ERR_002"===i._errorCode||a.length&&"CheckSuBotLeadTool_ERR_001"===(yield ie({bot_id:a,[t]:n}))._errorCode?o:void 0})))(e,a,l);return ce[n][o]=r?{value:!0}:{value:!1,expire:Date.now()+6e4},r})),[ue,pe,he]=$(),ge=["places"],ve=({name:e,placeholder:t,locale:l})=>{var s;const d=pe(),[c,m]=n(""),[u,p]=n(""),{predictions:h}=j(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),k=r(Math.random().toString(36).substring(7)),_=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:L,libraries:ge,loadingElement:a.createElement(a.Fragment,null)}),a.createElement("div",{style:{display:"none"},"data-extra":!0,"data-name":e,"data-control":"text"}),a.createElement(y,Object.assign({className:"lead-modal__form-control",label:t,placeholder:t,withAsterisk:!0,name:e,data:_,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"},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-"+k.current,rightSection:a.createElement(a.Fragment,null)},d.getInputProps(e)))):a.createElement("div",{style:{height:73}})},be=({children:e,align:t})=>a.createElement("p",{className:`lead-modal__description ${"le-text-align-"+(t||"")} ${V}`},e),ye=({children:e,align:t})=>a.createElement("h2",{className:`lead-modal__title ${"le-text-align-"+(t||"")} ${V}`},e),fe=({listBlockAdded:e,popupId:t,locale:l,onClose:n,onOtherSubmit:o})=>{const i=pe();return a.createElement(a.Fragment,null,e.map(((e,r)=>{const{name:s="",data:d={}}=e||{},{placeholder:c,value:u,align:p,listQuestion:h,isSendMailChimp:g=!1,newtab:v,url:b}=d;switch(s){case"TitleBlock":return a.createElement(ye,{key:r,align:p},u);case"SubtitleBlock":return a.createElement(be,{key:r,align:p},u);case"TextBlock":return a.createElement(k,Object.assign({key:r,withAsterisk:!0,spellCheck:!1,type:"text",placeholder:c,className:"lead-modal__form-control",label:c,"data-control":"text",name:u},i.getInputProps(u)));case"NumberBlock":return a.createElement(w,Object.assign({key:r,withAsterisk:!0,spellCheck:!1,type:"number",placeholder:c,className:"lead-modal__form-control",label:c,"data-control":"number",name:u},i.getInputProps(u)));case"EmailBlock":return a.createElement(k,Object.assign({key:r,withAsterisk:!0,spellCheck:!1,placeholder:c,className:"lead-modal__form-control",label:c,"data-control":"email",name:u},i.getInputProps(u)));case"PhoneOtpBlock":case"WhatsappOtpBlock":case"PhoneBlock":{const e=t+"-"+u+"-"+r;return a.createElement(k.Wrapper,Object.assign({size:"md",withAsterisk:!0,key:r,label:c,className:"lead-modal__form-control",labelProps:{htmlFor:e}},i.getInputProps(u)),a.createElement(E,{name:u,spellCheck:!1,type:"tel",placeholder:c,onChange:e=>{i.setFieldValue(u,e)},id:e,defaultCountry:l&&B[l]||"VN","data-control":"tel"}))}case"LocationBlock":return a.createElement(ve,{key:r,name:u,placeholder:c,locale:l});case"DateBlock":return a.createElement(a.Fragment,null,a.createElement(S,Object.assign({withAsterisk:!0,key:r,type:"default",name:u,placeholder:c,className:"lead-modal__form-control",label:c,"data-control":"date"},i.getInputProps(u))),a.createElement("input",{type:"hidden",name:u,"data-control":"date"}));case"LinkButtonBlock":return a.createElement("div",{key:r},a.createElement("a",{target:v?"blank":"parrent",href:b,style:{textDecoration:"none"}},a.createElement(m,{type:"button",size:"md",className:`lead-modal__btn ${V}`,onClick:()=>{null==n||n(),null==o||o()}},u)));case"CheckboxBlock":return a.createElement(a.Fragment,null,g&&a.createElement("div",{style:{display:"none"},"data-name":u+"-mailchimp"}),a.createElement(f.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(u)),h.map(((e,t)=>a.createElement(f,{name:u,key:t,value:e.value,label:e.placeholder,"data-control":"checkbox"})))));case"RadioBlock":return a.createElement(a.Fragment,null,g&&a.createElement(k,{type:"hidden",name:u+"-mailchimp",value:g}),a.createElement(_.Group,Object.assign({withAsterisk:!0,className:"lead-modal__form-control",key:r,label:c,size:"md"},i.getInputProps(u)),h.map(((e,t)=>a.createElement(_,{name:u,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":u,"data-control":"dropdown"}),a.createElement(y,Object.assign({key:r,className:"lead-modal__form-control",label:c,withAsterisk:!0,name:u,data:h.map((e=>({value:e.value,label:e.placeholder})))},i.getInputProps(u))));case"TncBlock":const s=i.getInputProps("TNC-"+e.id);return a.createElement(a.Fragment,null,a.createElement(f,Object.assign({name:"TNC-"+e.id,key:e.id,label:a.createElement("p",{className:"lead-modal__tnc-link",dangerouslySetInnerHTML:{__html:d.valueHTML}}),className:"tnc-block","data-control":"checkbox"},s,{error:s.error?a.createElement(a.Fragment,null):void 0})))}return null})))},ke=({otpData:e,onSuccess:l,autoSendWhenOpen:i})=>{const{t:s}=A(),d=e.phone,c=e.type,[u,p]=n(""),[h,g]=n(!1),[v,y]=n(i?0:60),f=r(null),[_,E]=n(),[w,N]=n(""),T=r(),[S,x]=n(!1);o((()=>{t(void 0,void 0,void 0,(function*(){var e;if(!T.current){const e=yield import("react-phone-number-input");T.current=e.formatPhoneNumberIntl}N((null===(e=T.current)||void 0===e?void 0:e.call(T,d))||d)}))}),[d]);const P=()=>t(void 0,void 0,void 0,(function*(){var e;if(!d)return;const t=yield se({phone:d,type:c}),a=null===(e=null==t?void 0:t._messages)||void 0===e?void 0:e[0];"Send sms successfully"===a||"Send WhatsApp successfully"===a?(y(60),setTimeout((()=>{f.current&&(f.current.focus(),f.current.scrollIntoView({block:"center"}))}),100)):"This phone number was verified"===a?l():E(a||"Something went wrong!")}));return o((()=>{setTimeout((()=>{v>0&&y((e=>e-1))}),1e3)}),[v]),o((()=>{i&&!v&&P()}),[]),a.createElement(a.Fragment,null,a.createElement("form",{onSubmit:e=>{e.preventDefault(),t(void 0,void 0,void 0,(function*(){if(!d||!u)return;x(!0);const e=yield de({phone:d,otp:u,type:c}),t=null==e?void 0:e._messages[0];"Verify successfully"===t||"Verify WhatsApp OTP sucess"===t||"This phone number was verified"===t?l():E(t||"something Wrong"),x(!1)}))},className:"lead-phone-otp-form"},a.createElement(C,{tag:"h3",fontWeight:"bold",style:{marginBottom:4}},s("lead.otp.title")),a.createElement(b,{size:"p1",color:O.colors.gray600},s("lead.otp.desc",{phone:w})),a.createElement(k,{ref:f,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:u,maxLength:6,onChange:e=>{g(!0),p(e),E(h&&!e?"OTP is required":void 0)},error:h?_:void 0}),a.createElement(m,{size:"md",color:"primary",className:`lead-modal__btn ${V}`,disabled:!u,isLoading:S},s("lead.otp.verify")),a.createElement(m,{type:"button",size:"md",color:"transparent",className:`lead-modal__btn lead-phone-otp-button ${V}`,onClick:()=>{P()},disabled:!!v},s("lead.otp.resend",{timer:v?` (${v}s)`:""}))))},_e=({title:e,titleAlign:t,subtitle:l,subtitleAlign:n,link:o,linkNewTab:i,linkText:r,image:s})=>{const{width:d,height:c,loaded:m}=Z(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}`},loading:"lazy"}),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 ${V}`},r))))):null},Ee=({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?I(e,a):null},we=({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=>I(e,N(t,"sidebar-lead-modal-wrapper")))))},Ce=({popupId:e,extraFields:t,onClose:l,onOtherSubmit:s,imageMobile:d,imageDesktop:c,imageOverlayMobile:p,imageOverlayDesktop:h,imageBackground:g,currentLayout:v,title:b,onSubmit:y,showThankyou:f,campaignId:k,campaign_subot_id:_,locale:E})=>{var w,C,N;const T=JSON.parse(t.listBlockAdded),S=JSON.parse(t.actionBlocks),x=JSON.parse(t.textBlocks),O=S.submitBlock.data.url,P=S.submitBlock.data.text,B=S.submitBlock.data.text2,j=S.submitBlock.data.value,L=location.pathname,$=v.includes("Inline")||"Sidebar"===v,I="Slider"===v,[D,U]=n(!0),[R,H]=n(null),[M,F]=n(!1),W=r(),q=()=>{R?H(null):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"),ce.email={},ce.phone={}}),[]);const J=r(!1),z=r(!1),{form:G,validateObj:K}=(({listBlockAdded:e=[],validatingPhoneRef:t,validatingEmailRef:a,campaignId:l,campaign_subot_id:n=[]})=>{const{t:o}=A(),s=i((()=>{const i=["TextBlock","NumberBlock","EmailBlock","PhoneBlock","DateBlock","CheckboxBlock","RadioBlock","DropdownBlock","PhoneOtpBlock","WhatsappOtpBlock","LocationBlock","TncBlock"],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..."),me(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||"WhatsappOtpBlock"===i.name?Object.assign(Object.assign({},e),{[i.data.value]:r(i.data.value,(e=>{if(window.intlTelInputUtils&&!window.intlTelInputUtils.isValidNumber(String(e),Y.countryCode))return o("validator.phone");t.current=!0,setTimeout((()=>{c.current.setFieldError(i.data.value,"Validating..."),me(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")}))}):"TncBlock"===i.name?Object.assign(Object.assign({},e),{["TNC-"+i.id]:r("TNC-"+i.id)}):Object.assign(Object.assign({},e),{[i.data.value]:r(i.data.value)})),{})}),[e.map((e=>e.name)).join(",")]),d=he({validateInputOnChange:!0,clearInputErrorOnChange:!0,validate:s}),c=r(d);return c.current=d,{form:d,validateObj:s}})({listBlockAdded:T,validatingPhoneRef:J,validatingEmailRef:z,campaignId:k,campaign_subot_id:_}),{width:Q,height:X,loaded:te}=Z(g),{width:ae,height:le,loaded:ne}=Z(d),{width:oe,height:ie,loaded:re}=Z(c),de=ne&&re&&("Fullscreen"!=v||te),pe=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 ${p?`\n .le-newbuilder-overlay {\n background: url(${p}) ;\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 ${$?"le-buider-inline":""} ${I?"le-buider-slider":""}`},"Fullscreen"==v?a.createElement("img",{className:"le-only-desktop le-fullscreen-img",draggable:!1,src:g||"",style:{aspectRatio:`${Q}/${X}`}}):null,a.createElement("div",{className:`lead-modal__wrapper le-newbuilder-wrap-${v}`},a.createElement("div",{className:`lead-modal__content le-newbuilder-${v}`},f?a.createElement(_e,{title:f.title,titleAlign:f.titleAlign,subtitle:f.subtitle,subtitleAlign:f.subtitleAlign,link:f.link,linkNewTab:f.linkNewTab,linkText:f.linkText,image:f.image}):a.createElement(a.Fragment,null,a.createElement("header",{className:"lead-modal__header"},R?a.createElement("img",{src:u.getAssetPath("lead-otp-thumb.png"),draggable:"false",alt:"",style:{width:"100%",minHeight:"150px",backgroundColor:"#f2f2f2"},loading:"lazy"}):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:`${ae}/${le}`},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:{objectFit:"cover",aspectRatio:`${oe}/${ie}`},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:`${ae}/${le}`}}):null))),R&&a.createElement(ke,{otpData:R,autoSendWhenOpen:!1,onSuccess:()=>{H(null),null==y||y(W.current,G.values)}}),a.createElement("div",{"data-hidden":!!R,className:"lead-modal__body le-newbuilder-overlay"},a.createElement(ue,{form:G},a.createElement("form",{ref:W,className:`lead-modal__form ${e}`,onSubmit:e=>{e.preventDefault(),G.setTouched(Object.keys(K).reduce(((e,t)=>(e[t]=!0,e)),{})),z.current||J.current||setTimeout((()=>{G.onSubmit((e=>{var t,a,l,n,o,i;if(Object.keys(G.errors).length)return;let r=null;if(T.findIndex((e=>"PhoneOtpBlock"===e.name))>-1){const n=null===(a=null===(t=T.find((e=>"PhoneOtpBlock"===e.name)))||void 0===t?void 0:t.data)||void 0===a?void 0:a.value;(null===(l=e[n])||void 0===l?void 0:l.startsWith("+"))&&(r={phone:e[n],type:"phone"})}if(T.findIndex((e=>"WhatsappOtpBlock"===e.name))>-1){const t=null===(o=null===(n=T.find((e=>"WhatsappOtpBlock"===e.name)))||void 0===n?void 0:n.data)||void 0===o?void 0:o.value;(null===(i=e[t])||void 0===i?void 0:i.startsWith("+"))&&(r={phone:e[t],type:"whatsapp"})}if(r)return F(!0),void se(r).then((t=>{var a;"This phone number was verified"!==(null===(a=null==t?void 0:t._messages)||void 0===a?void 0:a[0])?H(r):null==y||y(W.current,e)})).finally((()=>{F(!1)}));null==y||y(W.current,e)}))(e)}),100)}},a.createElement("div",{style:{marginBottom:20}},a.createElement("h2",{className:`lead-modal__title ${"le-text-align-"+(null===(w=x.titleBlock.data)||void 0===w?void 0:w.align)} ${V}`},b),a.createElement("p",{className:`lead-modal__description ${"le-text-align-"+(null===(C=x.titleBlock.data)||void 0===C?void 0:C.align)} ${V}`},x.subtitleBlock.data.value)),a.createElement("div",{className:"lead-modal__form-control-wrapper"},a.createElement(fe,{listBlockAdded:T,popupId:e,locale:E,onClose:q,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 ${V}`},a.createElement("div",{className:"lead-modal__checkbox"},a.createElement("input",{id:"lead-term-checkbox",className:`lead-modal__checkbox__input ${V}`,type:"checkbox","aria-label":"Checkbox label",checked:D,onChange:e=>U(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"}},B)))),a.createElement(m,{size:"md",id:"lead-submit",type:"submit",className:`lead-modal__btn ${V}`,disabled:!D,isLoading:M},j))))))),!v.includes("Inline")&&a.createElement(ee,{onClose:q,containerClassName:"close-button-top-right"}))));return de?v.includes("LightBox")||"Fullscreen"==v||"Slider"==v?pe:"Sidebar"==v?a.createElement(we,{content:pe}):v.includes("Inline")?a.createElement(Ee,{content:pe,inlinePosition:t.popupInlinePosition}):null:null},Ne=({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}=Z(i),{width:h,height:g,loaded:v}=Z(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(ee,{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(ee,{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(ee,{containerClassName:"close-button-top-right",svgClassName:"le-mobile-btn",onClose:o}))))):null},Te=({popupId:e,url:t,newTab:l,image:n,onClose:o,onOtherSubmit:i})=>{const{width:r,height:s,loaded:d}=Z(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(ee,{onClose:o,containerClassName:"close-button-top-right"})))):null},Se=[],xe=[],Oe=[],Pe=[],Be=[],je=[];const Le=(e="UTC")=>{const t=new Date;return new Date(t.toLocaleString("en-US",{timeZone:e}))},$e=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 Ae=e=>!function(e){var t;const a=Number(null===(t=e.rules.find((e=>"exclude_sponsored"==e.rule)))||void 0===t?void 0:t.value);return!(!Boolean(document.querySelector(".hhg-disclaimer-text"))||!a||(Pe.push(e),0))}(e)&&(!!function(e){var t,a;try{const l=null===(t=e.rules.find((e=>"exclude_sponsored_list"==e.rule)))||void 0===t?void 0:t.value,n=l instanceof Array?l:JSON.parse(l),o=Number(null===(a=document.querySelector("[data-sponsored-id]"))||void 0===a?void 0:a.getAttribute("data-sponsored-id"));return!o||o<=0||0===n.length||(!!n.find((e=>e.id==o))||(Be.push({id:e.id,rules:e.rules}),!1))}catch(e){return!0}}(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=$e(a),o=$e(l);if(!n||!o)return!0;const i=(null===(t=e.site)||void 0===t?void 0:t.id)||1;return!(Le(z[i]).getTime()>o.getTime()&&(Oe.push(e),1))}(e):0===e.formatted_status&&(Se.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=$e(l),i=$e(n);if(!o||!i)return!1;const r=Le(z[a]).getTime();return r<=i.getTime()&&r>=o.getTime()&&(xe.push(e),!0)})(e)))),Ie=e=>{var t;try{const a=(e,t,a)=>{const l=t.split(":"),n=a.split(":"),o=new Date;o.setHours(Number(l[0]),Number(l[1]),0,0);const i=new Date;return i.setHours(Number(n[0]),Number(n[1]),0,0),e>=o&&e<=i},l=null===(t=e.rules.find((e=>"appearance_time"==e.rule)))||void 0===t?void 0:t.value,n=l.startTime,o=l.endTime||"23:59";return!n||(!!a(new Date,n,o)||(je.push(e),!1))}catch(e){return!0}};let De=null;function Ue({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:D("_ga")||null})}).then((e=>e.json())).then((e=>{var t,n,i,r;if(Re("List campagin: ",e),q="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(Ae))||[]).filter(Ie);D("hhg-id")||(U("hhg-id",c(),{domain:"."+a,path:"/"}),Re("😍 Set HHG ID cookie"));let d=[];d=/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==F)))):s.filter((e=>e.device_types.some((e=>e.id==W)))),Re("👓 campaignsDevice",d),Re("--listCampaignScheduled",Se),Re("--listCampaignScheduledToActivated",xe),Re("--listCampaignActiveButExpired",Oe),Re("--listCampaignExcludeSonsored",Pe),Re("--listCampaignDifferentSponsor",Be),Re("--listCampaignNotDisplayInRangeOfTime",je);let m=d.map(((e,t)=>e.targets.filter((e=>e.type==R)).map((e=>Object.assign(Object.assign({},e),{campaignIndex:t}))))).flat(1);m=m.filter((e=>{var t;const a=new URL(String(e.target).toLowerCase());if("exact_match"==e.option)return Boolean(o===(null===(t=a.href)||void 0===t?void 0:t.toLowerCase()));if("start_with"==e.option){if(o.includes(String(e.target).toLowerCase())){const t=e.sub_target.filter((e=>"excluding"==e.option)).map((e=>{var t;return null===(t=e.value)||void 0===t?void 0:t.toLowerCase()}));return!t.includes(o.split("?")[0])}return!1}}));const u=Array.from(document.getElementsByTagName("META")).filter((e=>"article:tag"==e.getAttribute("property"))).map((e=>e.content));let p=[],h=[];u&&u.length&&(p=d.map(((e,t)=>e.targets.filter((e=>e.type==H)).map((e=>Object.assign(Object.assign({},e),{campaignIndex:t}))))).flat(1),h=p.filter((e=>u.includes(e.target))));const g=[...m,...h],v=document.cookie.split("; ").map((e=>e.split("=")[0])),b=v.filter((e=>e.includes("lead_submited")));Re("--listCampaignCodeSubmited",b);const y=v.filter((e=>e.includes("lead_closed")));Re("--listCampaignCodeClosed",y);const f=[...b,...y],k=(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})(g.filter((e=>!f.some((t=>t.includes(d[e.campaignIndex].code))))));if(Re("--listCampaignValid : ",k),k&&k.length){const e=d[k[0].campaignIndex];Re("CAMPAIGN_SHOW",e);const{rules:t}=e,a=Number(null===(i=t.find((e=>"time"==e.rule)))||void 0===i?void 0:i.value);Re("timeoutRule",a);const n=Number(null===(r=t.find((e=>"scroll"==e.rule)))||void 0===r?void 0:r.value);Re("scrollRule",n);let o="TIME";if(Number.isInteger(a)&&(o="TIME",Re("✨ SHOW AWESOME POPUP AFTER: ",a," seconds"),De&&clearTimeout(De),De=setTimeout((()=>{null==l||l(e,o)}),1e3*a)),Number.isInteger(n)){o="SCROLL",Re("✨ SHOW AWESOME AFTER: SCROLL",n," %");const t=document.querySelector(`[data-url="${location.pathname}"]`)||document.querySelector("body"),a=t.getBoundingClientRect().top,i=t.offsetHeight;Re("👓 Element check scroll: ",t);const r=function(){const t=window.pageYOffset||document.documentElement.scrollTop;let s=0;t>=a&&(s=Math.round((t-a)/(i-innerHeight)*100)),Re("---Scroll",s,n),s>=n&&(window.removeEventListener("scroll",r),null==l||l(e,o))};window.addEventListener("scroll",r,{passive:!0})}}else Re("🚧 No lead campaigns on current URL, tags")}})).catch((e=>{Re("Lead error: ",e)}))}const Re=(...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 He=({campaign:e,action:t,onSubmit:l,onClose:n,showThankyou:i,locale:d})=>{var m,u;const{apiUrl:p,siteDomain:h}=s(X);o((()=>{const e=D("_ga")||null;fetch(`${p}api/campaign/${y}/impression`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:t,url:location.href.toLowerCase(),title_article:document.title,cookie_id:D("hhg-id"),ga_client_id:e})})}),[]);const{extra_fields:g,image:v,image_desktop:b,code:y,image_background:f,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 T=(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:{}},x=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}(T);if(O){Re("⚡️ 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 Re("⚡️ No META TAG for categoryLevel, not show popup",O),null;S[O]={value:t.content,value_en:a.content},T=T.replace(`{{category_${O}}}`,t.content),Re("⚡️ Set categoryData ",O)}else Re("⚡️ No categoryLevel",O);const P=()=>{var t,a,l,o;if(Re("👌 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&&(Re("⛔ Popup never show again!"),U(`lead_submited_${y}`,`target_${g.popupVersion}`,{domain:"."+h,path:"/"})),1==r&&(Re(`⌛ Popup will show again after ${i} days!`),U(`lead_submited_${y}`,`target_${g.popupVersion}`,{domain:"."+h,days:i,path:"/"}));const s=D("_ga")||null,d={url:location.href.toLowerCase(),title_article:document.title,meta:[],cookie_id:D("hhg-id"),ga_client_id:s};O&&(d.category=S[O].value_en),fetch(`${p}api/campaign/${y}/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&&Re(e)})).catch((e=>{Re("Error:",e)})),null==n||n()};return"CenterTab"===E?a.createElement(te,{popupId:x.current,url:w.imageMobile.data.url,newTab:w.imageMobile.data.newtab,imageMobile:v,imageDestkop:b,onClose:n,onOtherSubmit:P}):"Tab"===E?a.createElement(Te,{popupId:x.current,url:w.imageMobile.data.url,newTab:w.imageMobile.data.newtab,image:v,onClose:n,onOtherSubmit:P}):"Floating"===E?a.createElement(ae,{popupId:x.current,title:T,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(Ce,{popupId:x.current,extraFields:g,onClose:n,onOtherSubmit:P,imageMobile:v,imageDesktop:b,imageBackground:f,currentLayout:E,title:T,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(Ne,{popupId:x.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},Me=({apiUrl:e,siteDomain:l,siteId:s,locale:c,apiSubotUrl:m,DEBUG_URL:u})=>{var b;const y=r(),f=r(Date.now()),{apiUrl:k}=i((()=>{let t=e;return t.includes("localhost")&&(t="https://dev.leadgen.hellobacsi.com/"),{apiUrl:t}}),[e,l,s]),[_,E]=n(null),[w,C]=n(""),[N,S]=n(null);o((()=>{le.apiLeadUrl=k,le.apiSubotUrl=m}),[k,m]);const O=(e,t)=>{E(e),C(t)},B=()=>{var e,t;if(!_)return;Re(`👋👋👋 CLOSE POPUP ${_.code} 👋👋👋`);const a=Number(null===(e=_.rules.find((e=>"show_again_after_exit"==e.rule)))||void 0===e?void 0:e.value),n=Number(null===(t=_.rules.find((e=>"days_to_show_again"==e.rule)))||void 0===t?void 0:t.value);0==a&&U(`lead_closed_${_.code}`,`target_${null==_?void 0:_.extra_fields.popupVersion}`,n?{domain:"."+l,days:n,path:"/"}:{domain:"."+l,path:"/"}),document.body.classList.remove("noscroll"),fetch(`${k}api/campaign/${_.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:D("hhg-id"),duration:Math.ceil((Date.now()-f.current)/1e3)})}),E(null),S(null)};o((()=>{if(window.next){const e=d((e=>{Re("--🌻 routeChangeComplete",e,Date.now());const t=location.pathname;B(),document.querySelectorAll(`[data-popup-url="${t}"]`).length?Re("🔥 This URL page has show popup!"):(Re("--Process checkShowPopup"),Ue({leadApi:k,leadDomain:l,leadSiteId:s,onShowPopup:O,DEBUG_URL:u})),y.current&&window.removeEventListener("scroll",y.current)}),500);window.next.router.events.on("routeChangeComplete",e)}Ue({leadApi:k,leadDomain:l,leadSiteId:s,onShowPopup:O,DEBUG_URL:u})}),[]);const j=(e,a,n,o)=>t(void 0,void 0,void 0,(function*(){var t,i,r,s,d,c,m,u,p,h,g;if(!a)return;Re("submitHandler",n,o);const v=Object.keys(a).map((e=>({name:e,value:String(a[e])}))),b=D("_ga")||null;window.intlTelInputUtils||(yield require("intl-tel-input/build/js/utils"));const y={url:location.href.toLowerCase(),title_article:document.title,meta:v.map((t=>{var a,l;const n=(null===(a=e.querySelector(`*[name="${t.name}"][data-control]`))||void 0===a?void 0:a.getAttribute("data-control"))||(null===(l=e.querySelector(`*[data-extra][data-name="${t.name}"]`))||void 0===l?void 0:l.getAttribute("data-control"))||"text",o="tel"===n?window.intlTelInputUtils.formatNumber(String(t.value),null==Y?void 0:Y.countryCodeNumber,2).replace(/\s+/g,""):"date"===n?x(t.value).format("YYYY-MM-DD"):t.value;return{key:t.name,value:o,control:n}})),cookie_id:D("hhg-id"),ga_client_id:b};n&&o[n].value_en&&(y.category=o[n].value_en);const f=Number((null===(i=null===(t=_.rules)||void 0===t?void 0:t.find((e=>"days_to_show_again"===e.rule)))||void 0===i?void 0:i.value)||7),E=Number((null===(s=null===(r=_.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==E&&(Re("⛔ Popup never show again!"),U(`lead_submited_${_.code}`,`target_${null==_?void 0:_.extra_fields.targetType}`,{domain:"."+l,path:"/"})),1==E&&(Re(`⌛ Popup will show again after ${f} days!`),U(`lead_submited_${_.code}`,`target_${null==_?void 0:_.extra_fields.targetType}`,{domain:"."+l,days:f,path:"/"})),fetch(`${k}api/campaign/${_.code}/lead`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(y)}),"notshow"==(null==_?void 0:_.extra_fields.popupShowThankYou))return B(),void document.body.classList.remove("noscroll");let w=!0;const C=_.thank_you_image||`${k}admin/img/thanksyou.png`;let N,T,O=(null==_?void 0:_.extra_fields.popupThankyouTitle)||"Thank you.",P=(null==_?void 0:_.extra_fields.popupThankyouDesc)||"We appreciate your time!",j="",L="",$="";if("2.1"==(null==_?void 0:_.extra_fields.popupVersion)){const e=_.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));O=(null===(d=null==a?void 0:a.data)||void 0===d?void 0:d.value)||"",j=(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)||"",L=(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)||"",T=(null===(h=null==n?void 0:n.data)||void 0===h?void 0:h.newtab)||!1,$=(null===(g=null==n?void 0:n.data)||void 0===g?void 0:g.url)||"";const o=_.extra_fields.currentLayout;["SkinA","SkinB","Floating","Tab","CenterTab"].includes(o)&&(w=!1)}S(w?{title:O,titleAlign:j,subtitle:P,subtitleAlign:L,link:$,linkNewTab:T,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((()=>{_&&(f.current=Date.now())}),[_]),a.createElement(X.Provider,{value:{apiUrl:k,siteDomain:l,siteId:s,locale:c}},a.createElement(P.Provider,{value:{locale:c,values:Q(c)}},a.createElement(p,{target:T()},a.createElement(h,{sx:{position:"fixed",zIndex:9999999999}},a.createElement(g,{mounted:Boolean("2.1"===(null===(b=null==_?void 0:_.extra_fields)||void 0===b?void 0:b.popupVersion)),transition:"fade",duration:600,timingFunction:"ease"},(e=>{var t;return a.createElement(h,{style:e},"2.1"===(null===(t=null==_?void 0:_.extra_fields)||void 0===t?void 0:t.popupVersion)&&a.createElement(a.Fragment,null,!!_.extra_fields.currentLayout&&!_.extra_fields.currentLayout.includes("Inline")&&!_.extra_fields.currentLayout.includes("Sidebar")&&a.createElement(v,{color:"#000",opacity:.5,center:!0,zIndex:400,pos:"fixed",onClick:()=>B()}),a.createElement(He,{campaign:_,action:w,onSubmit:j,onClose:B,showThankyou:N,locale:c})))}))))))};export{Me as LeadGen};
@@ -1 +1 @@
1
- import{k as f,l as u,m as x}from"./index-02f0f4fe.js";export{o as Accordion,A as Anchor,b as AspectRatio,a as Avatar,n as Breadcrumbs,B as Button,p as Carousel,i as CentralCarousel,d as Checkbox,e as ChipButton,c as Input,M as MAPPED_LOCALE,O as OTP,P as Phone,s as Popover,R as Radio,S as Select,T as Tabs,q as emotionCache,r as getHeadingStyles,m as getMantineThemeOverride,t as themeColors,l as useMantineLocale}from"./index-02f0f4fe.js";export{D as DatePicker}from"./index-c7ee8e8e.js";import{T as h}from"./index-e751d8c2.js";export{O as OTHER_THEME_CONFIG,T as Text}from"./index-e751d8c2.js";export{I as Indicator}from"./index-53ef56cd.js";import g,{useMemo as j}from"react";export{M as Modal}from"./index-f2ede565.js";import{_ as v}from"./tslib.es6-1a7e483e.js";import{Badge as E,Spoiler as y,LoadingOverlay as C,MantineProvider as H,clsx as w,Title as N,Text as k,Button as L}from"@mantine/core";import{t as z}from"./theme-c254ba9f.js";import{u as _}from"./useTranslations-e0f5679c.js";export{S as Slider}from"./index-f4f05774.js";export{S as Switch}from"./index-96308c0d.js";import"@mantine/hooks";import"./gAssets.js";import"./index-13feb3ef.js";import"date-fns/locale";import"./Subot-7ea674b0.js";import"./isProduction-d0d81279.js";import"dayjs";import"./screenSizeContext-8f042934.js";import"styled-components";import"lodash/throttle";import"@mantine/carousel";import"classnames";import"@mantine/dates";import"./translationsContext-f66e3d3d.js";import"string-format";import"./index-19144b5a.js";const F=e=>g.createElement(f,Object.assign({minRows:2,maxRows:4},e)),G=e=>{var{color:t=z.colors.primaryBase,styles:s}=e,a=v(e,["color","styles"]);return g.createElement(E,Object.assign({variant:"filled",color:t,styles:Object.assign({root:{borderRadius:"2px",background:t,textTransform:"unset"}},s)},a))},J=e=>{var{children:t,line:s,lineHeight:a,trackingAttributes:o,maxHeight:r,customExpandFn:i}=e,n=v(e,["children","line","lineHeight","trackingAttributes","maxHeight","customExpandFn"]);const{t:l}=_(),c=j((()=>r||(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 m=j((()=>o?{"data-event-category":o.dataEventCategory,"data-event-action":o.dataEventAction,"data-event-label":o.dataEventLabel}:{}),[o]);return g.createElement(y,Object.assign({showLabel:g.createElement(h,Object.assign({size:"p3",color:z.colors.primaryBase},m,{onClick:i}),l("articlePage.readMore")),hideLabel:g.createElement(h,Object.assign({size:"p3",color:z.colors.primaryBase},m),l("articlePage.showLess"))},n,{maxHeight:c}),t)};const U=e=>(function(e=!1){g.useEffect((()=>{if(e){const e=window.getComputedStyle(document.body).overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}}}),[e])}(e.visible),g.createElement(C,Object.assign({loaderProps:{color:z.colors.primaryBase}},e))),V=e=>{var{children:t,locale:s,template:a="hb"}=e,o=v(e,["children","locale","template"]);return u(s),g.createElement(H,Object.assign({theme:x(s,a)},o),t)};var Y="MON6sfi",Z="pS-tJD7",K="s3tJ9-5",Q="fNsZr1b",W="uuxV74v",X="YohjTDU";function $(e){const{icon:t,title:s,description:a,button:o,buttonProps:r,style:i,className:n}=e,l=r||{},{size:c="lg",variant:m="outline"}=l,d=v(l,["size","variant"]),p=t;return g.createElement("div",{className:w("result",Y,n),style:i},p&&g.createElement("div",{className:w("resultIconContainer",Z)},g.createElement(p,{className:w("resultIcon",K)})),g.createElement(N,{order:3,size:"h3",className:w("resultTitle",Q)},s),g.createElement(k,{className:w("resultDescription",W)},a),o&&g.createElement(L,Object.assign({},d,{size:c,variant:m,className:w("resultButton",X,d.className)}),o))}export{G as Badge,U as LoadingOverlay,V as MantineProvider,$ as Result,J as Spoiler,F as TextArea};
1
+ import{k as u,l as f,m as x}from"./index-42a97c34.js";export{o as Accordion,A as Anchor,b as AspectRatio,a as Avatar,n as Breadcrumbs,B as Button,p as Carousel,i as CentralCarousel,d as Checkbox,e as ChipButton,c as Input,M as MAPPED_LOCALE,O as OTP,P as Phone,s as Popover,R as Radio,S as Select,T as Tabs,q as emotionCache,r as getHeadingStyles,m as getMantineThemeOverride,t as themeColors,l as useMantineLocale}from"./index-42a97c34.js";export{D as DatePicker}from"./index-0aa9ad0c.js";import{T as h}from"./index-93427f24.js";export{O as OTHER_THEME_CONFIG,T as Text}from"./index-93427f24.js";export{I as Indicator}from"./index-ef79e29b.js";import g,{useMemo as j}from"react";export{M as Modal}from"./index-a78b0e89.js";import{_ as v}from"./tslib.es6-98bf90db.js";import{Badge as E,Spoiler as y,LoadingOverlay as C,MantineProvider as H,clsx as w,Title as N,Text as k,Button as L}from"@mantine/core";import{t as z}from"./theme-b4e6528d.js";import{u as _}from"./useTranslations-24b07ae0.js";export{S as Slider}from"./index-7b0ad89b.js";export{S as Switch}from"./index-a0e83cd4.js";import"@mantine/hooks";import"./gAssets.js";import"./index-1cc8c07f.js";import"date-fns/locale";import"./Subot-536c3f3b.js";import"./isProduction-72db2237.js";import"dayjs";import"./screenSizeContext-2352b7aa.js";import"styled-components";import"lodash/throttle";import"@mantine/carousel";import"classnames";import"@mantine/dates";import"./translationsContext-98678f48.js";import"string-format";import"./index-e20fe766.js";const F=e=>g.createElement(u,Object.assign({minRows:2,maxRows:4},e)),G=e=>{var{color:t=z.colors.primaryBase,styles:a}=e,s=v(e,["color","styles"]);return g.createElement(E,Object.assign({variant:"filled",color:t,styles:Object.assign({root:{borderRadius:"2px",background:t,textTransform:"unset"}},a)},s))},J=e=>{var{children:t,line:a,lineHeight:s,trackingAttributes:o,maxHeight:r,customExpandFn:i}=e,n=v(e,["children","line","lineHeight","trackingAttributes","maxHeight","customExpandFn"]);const{t:l}=_(),c=j((()=>r||(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 m=j((()=>o?{"data-event-category":o.dataEventCategory,"data-event-action":o.dataEventAction,"data-event-label":o.dataEventLabel}:{}),[o]);return g.createElement(y,Object.assign({showLabel:g.createElement(h,Object.assign({size:"p3",color:z.colors.primaryBase},m,{onClick:i}),l("articlePage.readMore")),hideLabel:g.createElement(h,Object.assign({size:"p3",color:z.colors.primaryBase},m),l("articlePage.showLess"))},n,{maxHeight:c}),t)};const U=e=>(function(e=!1){g.useEffect((()=>{if(e){const e=window.getComputedStyle(document.body).overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}}}),[e])}(e.visible),g.createElement(C,Object.assign({loaderProps:{color:z.colors.primaryBase}},e))),V=e=>{var{children:t,locale:a,template:s="hb"}=e,o=v(e,["children","locale","template"]);return f(a),g.createElement(H,Object.assign({theme:x(a,s)},o),t)};var Y="MON6sfi",Z="pS-tJD7",K="s3tJ9-5",Q="fNsZr1b",W="uuxV74v",X="YohjTDU";function $(e){const{icon:t,title:a,description:s,button:o,buttonProps:r,style:i,className:n}=e,l=r||{},{size:c="lg",variant:m="outline"}=l,d=v(l,["size","variant"]),p=t;return g.createElement("div",{className:w("result",Y,n),style:i},p&&g.createElement("div",{className:w("resultIconContainer",Z)},g.createElement(p,{className:w("resultIcon",K)})),g.createElement(N,{order:3,size:"h3",className:w("resultTitle",Q)},a),g.createElement(k,{className:w("resultDescription",W)},s),o&&g.createElement(L,Object.assign({},d,{size:c,variant:m,className:w("resultButton",X,d.className)}),o))}export{G as Badge,U as LoadingOverlay,V as MantineProvider,$ as Result,J as Spoiler,F as TextArea};
package/build/esm/misc.js CHANGED
@@ -1 +1 @@
1
- export{a as ageGenerate,c as convertLocalizedStringToNumber,l as localizeNumberFormat}from"./localizeNumberFormat-1e3158ab.js";export{B as Breakpoints,M as MediaQueries,S as ScreenSizeContext,q as ScreenSizeContextProvider,h as fadeIn,i as formatUrlWithPageParam,j as getBoundariesFromMediaQueryKey,k as getPopupWrapperDom,p as getWindowSizeGroups,l as getWrapperDomWithSelector,m as makeParams,o as safeEncodeURI,a as slideInDown,b as slideInLeft,c as slideInRight,s as slideInUp,e as slideOutDown,f as slideOutLeft,g as slideOutRight,d as slideOutUp,n as startCase,t as toggleNoScroll}from"./screenSizeContext-8f042934.js";export{d as deleteCookie,g as getCookie,s as setCookie}from"./cookieHelper-0d554a3d.js";import"react";import"styled-components";export{M as MBTheme,t as theme}from"./theme-c254ba9f.js";export{a as abbreviateNumber}from"./number-f57dcbd1.js";export{d as getCareApiDomain,g as getCurrentBaseUrl,a as getCurrentSsoUrl,c as getDiscoverApiDomain,b as getTogetherApiDomain}from"./routing-0284bf36.js";export{f as formatHealthTool,g as getDynamicHealthTool,a as getDynamicHealthToolWithCache}from"./getDynamicHealthTool-00faa2c1.js";export{g as getSocialList}from"./getSocialList-1248c74c.js";export{f as formatPill}from"./dataTransform-cf3f3aee.js";import"dayjs";import"lodash/throttle";import"./index-13feb3ef.js";import"date-fns/locale";import"./Subot-7ea674b0.js";import"./isProduction-d0d81279.js";import"./tslib.es6-1a7e483e.js";import"./core-ac4e85c7.js";import"./normalizeLink-409cf3bf.js";import"./gAssets.js";
1
+ export{a as ageGenerate,c as convertLocalizedStringToNumber,l as localizeNumberFormat}from"./localizeNumberFormat-cf3b94f0.js";export{B as Breakpoints,M as MediaQueries,S as ScreenSizeContext,q as ScreenSizeContextProvider,h as fadeIn,i as formatUrlWithPageParam,j as getBoundariesFromMediaQueryKey,k as getPopupWrapperDom,p as getWindowSizeGroups,l as getWrapperDomWithSelector,m as makeParams,o as safeEncodeURI,a as slideInDown,b as slideInLeft,c as slideInRight,s as slideInUp,e as slideOutDown,f as slideOutLeft,g as slideOutRight,d as slideOutUp,n as startCase,t as toggleNoScroll}from"./screenSizeContext-2352b7aa.js";export{d as deleteCookie,g as getCookie,s as setCookie}from"./cookieHelper-186bd645.js";import"react";import"styled-components";export{M as MBTheme,t as theme}from"./theme-b4e6528d.js";export{a as abbreviateNumber}from"./number-b3dfca43.js";export{d as getCareApiDomain,g as getCurrentBaseUrl,a as getCurrentSsoUrl,c as getDiscoverApiDomain,b as getTogetherApiDomain}from"./routing-fd554a2d.js";export{f as formatHealthTool,g as getDynamicHealthTool,a as getDynamicHealthToolWithCache}from"./getDynamicHealthTool-b607d6c6.js";export{g as getSocialList}from"./getSocialList-4a024369.js";export{f as formatPill}from"./dataTransform-c14284c9.js";import"dayjs";import"lodash/throttle";import"./index-1cc8c07f.js";import"date-fns/locale";import"./Subot-536c3f3b.js";import"./isProduction-72db2237.js";import"./tslib.es6-98bf90db.js";import"./core-5564bd35.js";import"./normalizeLink-a4622871.js";import"./gAssets.js";
@@ -1 +1 @@
1
- import"./tslib.es6-1a7e483e.js";import"react";import"./core-ac4e85c7.js";export{N as NavigationV2,g as getNavMenuContent,a as getNavMenuContentWithCache}from"./index-d6b66097.js";import"./index-13feb3ef.js";import"./normalizeLink-409cf3bf.js";import"./routing-0284bf36.js";import"./index-dde41fb0.js";import"./index.styled-7f374882.js";import"./isProduction-d0d81279.js";import"./index-02f0f4fe.js";import"@mantine/core";import"@mantine/hooks";import"./theme-c254ba9f.js";import"./gAssets.js";import"date-fns/locale";import"./Subot-7ea674b0.js";import"dayjs";import"./screenSizeContext-8f042934.js";import"styled-components";import"lodash/throttle";import"@mantine/carousel";import"./index-e751d8c2.js";import"./useTranslations-e0f5679c.js";import"./translationsContext-f66e3d3d.js";import"string-format";import"classnames";import"./index-15efeba7.js";import"@linaria/react";import"./utils-0347b372.js";import"@mantine/dates";import"./constants-95cb8ea0.js";import"lodash/debounce";import"./useCategory-b6426a83.js";import"./ChevronDown-8da7a294.js";import"./index-19144b5a.js";import"./constants-bcabc622.js";import"./index.styles-3036321c.js";import"react-keyed-flatten-children";import"./cookieHelper-0d554a3d.js";import"slugify";import"./index-53ef56cd.js";import"./useIsInit-db1c31df.js";import"./index.styled-d760ce2f.js";import"./index-c26145e4.js";import"./index-e4c49b57.js";import"dayjs/plugin/relativeTime";
1
+ import"./tslib.es6-98bf90db.js";import"react";import"./core-5564bd35.js";export{N as NavigationV2,g as getNavMenuContent,a as getNavMenuContentWithCache}from"./index-0a136042.js";import"./index-1cc8c07f.js";import"./normalizeLink-a4622871.js";import"./routing-fd554a2d.js";import"./index-6418e06e.js";import"./index.styled-e5302a94.js";import"./isProduction-72db2237.js";import"./index-42a97c34.js";import"@mantine/core";import"@mantine/hooks";import"./theme-b4e6528d.js";import"./gAssets.js";import"date-fns/locale";import"./Subot-536c3f3b.js";import"dayjs";import"./screenSizeContext-2352b7aa.js";import"styled-components";import"lodash/throttle";import"@mantine/carousel";import"./index-93427f24.js";import"./useTranslations-24b07ae0.js";import"./translationsContext-98678f48.js";import"string-format";import"classnames";import"./index-4f30c485.js";import"@linaria/react";import"./utils-a52f9e39.js";import"@mantine/dates";import"./constants-94c0a69b.js";import"lodash/debounce";import"./useCategory-90322434.js";import"./ChevronDown-cc905035.js";import"./index-e20fe766.js";import"./constants-da7ec5be.js";import"./index.styles-1dc3d7f0.js";import"react-keyed-flatten-children";import"./cookieHelper-186bd645.js";import"slugify";import"./index-ef79e29b.js";import"./useIsInit-eb1ac6ed.js";import"./index.styled-c3a130a7.js";import"./index-5d7d7599.js";import"./index-b1b894e8.js";import"dayjs/plugin/relativeTime";
@@ -1,4 +1,4 @@
1
- import e,{createContext as t,forwardRef as n,useContext as r,useImperativeHandle as o,useState as a,useRef as i,useEffect as l,useMemo as s,Fragment as m}from"react";import{_ as d,a as c}from"./tslib.es6-1a7e483e.js";import{Box as p,Input as u,Grid as g,Title as b,Container as h,Flex as E,rem as f,Stack as L,AspectRatio as v}from"@mantine/core";import{P as y,c as C,R as x,O as w,d as S,u as j,B as P}from"./index-02f0f4fe.js";import{D as O}from"./index-c7ee8e8e.js";import{T as k,I as F}from"./index-e751d8c2.js";import"dayjs";import{M as z,k as B}from"./screenSizeContext-8f042934.js";import N from"styled-components";import{t as T}from"./theme-c254ba9f.js";import{L as I}from"./index-13feb3ef.js";import"./isProduction-d0d81279.js";import"./Subot-7ea674b0.js";import{CommonGAssets as D}from"./gAssets.js";import{u as A}from"./useTranslations-e0f5679c.js";import{useInterval as Z,useCounter as _}from"@mantine/hooks";import{A as V}from"./index-4e8c3bb6.js";import"lodash/debounce";import"./useCategory-b6426a83.js";import{V as q}from"./Visible-247d254f.js";import{createFormContext as $,yupResolver as H}from"@mantine/form";import{M as W,h as U}from"./utils-f65c59d5.js";export{M as MAPPED_LOCALE}from"./utils-f65c59d5.js";import"@linaria/react";import{H as Y}from"./index.styles-3036321c.js";import"./constants-bcabc622.js";import{L as R}from"./utils-0347b372.js";import"@mantine/dates";import"./index.styled-d760ce2f.js";import"./index-c26145e4.js";import*as G from"yup";import{createPortal as K}from"react-dom";import"./translationsContext-f66e3d3d.js";import"string-format";import J from"lodash/throttle";import{B as Q}from"./index-19144b5a.js";import{T as X}from"./index-1fc7e785.js";import{format as ee}from"date-fns";import te from"react-keyed-flatten-children";import"@mantine/carousel";import"classnames";import"date-fns/locale";import"./cookieHelper-0d554a3d.js";import"slugify";const ne=t({currentStep:0,setCurrentStep:()=>!1,setMaxStep:()=>!1,nextStep:()=>!1,prevStep:()=>!1,isMarryBaby:!1,siteType:"helloSites",sharedData:{},setSharedData:()=>!1}),[re,oe,ae]=$(),ie=N(p)`
1
+ import e,{createContext as t,forwardRef as n,useContext as r,useImperativeHandle as o,useState as a,useRef as i,useEffect as l,useMemo as s,Fragment as m}from"react";import{_ as d,a as c}from"./tslib.es6-98bf90db.js";import{Box as p,Input as u,Grid as g,Title as b,Container as h,Flex as E,rem as f,Stack as L,AspectRatio as v}from"@mantine/core";import{P as y,c as C,R as x,O as w,d as S,u as j,B as P}from"./index-42a97c34.js";import{D as O}from"./index-0aa9ad0c.js";import{T as k,I as F}from"./index-93427f24.js";import"dayjs";import{M as z,k as B}from"./screenSizeContext-2352b7aa.js";import N from"styled-components";import{t as T}from"./theme-b4e6528d.js";import{L as I}from"./index-1cc8c07f.js";import"./isProduction-72db2237.js";import"./Subot-536c3f3b.js";import{CommonGAssets as D}from"./gAssets.js";import{u as A}from"./useTranslations-24b07ae0.js";import{useInterval as Z,useCounter as _}from"@mantine/hooks";import{A as V}from"./index-fffed510.js";import"lodash/debounce";import"./useCategory-90322434.js";import{V as q}from"./Visible-07bc97fb.js";import{createFormContext as $,yupResolver as H}from"@mantine/form";import{M as W,h as U}from"./utils-745dd450.js";export{M as MAPPED_LOCALE}from"./utils-745dd450.js";import"@linaria/react";import{H as Y}from"./index.styles-1dc3d7f0.js";import"./constants-da7ec5be.js";import{L as R}from"./utils-a52f9e39.js";import"@mantine/dates";import"./index.styled-c3a130a7.js";import"./index-5d7d7599.js";import*as G from"yup";import{createPortal as K}from"react-dom";import"./translationsContext-98678f48.js";import"string-format";import J from"lodash/throttle";import{B as Q}from"./index-e20fe766.js";import{T as X}from"./index-0991b8cf.js";import{format as ee}from"date-fns";import te from"react-keyed-flatten-children";import"@mantine/carousel";import"classnames";import"date-fns/locale";import"./cookieHelper-186bd645.js";import"slugify";const ne=t({currentStep:0,setCurrentStep:()=>!1,setMaxStep:()=>!1,nextStep:()=>!1,prevStep:()=>!1,isMarryBaby:!1,siteType:"helloSites",sharedData:{},setSharedData:()=>!1}),[re,oe,ae]=$(),ie=N(p)`
2
2
  .phone-input {
3
3
  width: 100%;
4
4
  margin-bottom: 32px;
package/build/esm/pwg.js CHANGED
@@ -1,4 +1,4 @@
1
- import e,{useMemo as t,useState as r,useRef as a}from"react";import{M as o,a as l}from"./index-14780cf0.js";import{T as n}from"./index-e751d8c2.js";import{P as i}from"./index-428d1aeb.js";import{u as s}from"./useTranslations-e0f5679c.js";import{t as c}from"./theme-c254ba9f.js";import{ResponsiveContainer as m,AreaChart as d,CartesianGrid as p,Tooltip as g,XAxis as y,YAxis as u,Area as b,ReferenceDot as f}from"recharts";import{C as h}from"./index-c26145e4.js";import{a as x}from"./useOutsideClick-bfa18062.js";import E from"styled-components";import{_ as k}from"./tslib.es6-1a7e483e.js";import"./index.styled-d760ce2f.js";import"@mantine/core";import"dayjs";import"./screenSizeContext-8f042934.js";import"lodash/throttle";import"./index-13feb3ef.js";import"date-fns/locale";import"./Subot-7ea674b0.js";import"./isProduction-d0d81279.js";import"./gAssets.js";import"./index.styled-4a4ab4d3.js";import"./index-02f0f4fe.js";import"@mantine/hooks";import"@mantine/carousel";import"classnames";import"./index-1fc7e785.js";import"@mantine/dates";import"./translationsContext-f66e3d3d.js";import"string-format";const w=t=>{const{x:r,y:a,payload:o,activeWeek:l}=t;return l===o.value?e.createElement("g",{transform:`translate(${r},${a})`},e.createElement("circle",{r:12,fill:"marryBaby"===t.siteType?c.mbColors.pink:c.colors.primaryBase}),e.createElement("text",{textAnchor:"middle",alignmentBaseline:"central",fill:c.colors.white,fontFamily:"Inter",fontWeight:"600",fontSize:"12px"},o.value)):e.createElement("g",{transform:`translate(${r},${a})`},e.createElement("text",{textAnchor:"middle",alignmentBaseline:"central",fill:c.colors.gray600,fontFamily:"Inter",fontWeight:"400",fontSize:"12px"},o.value))},v=E.div`
1
+ import e,{useMemo as t,useState as r,useRef as a}from"react";import{M as o,a as l}from"./index-3ecb0e1b.js";import{T as n}from"./index-93427f24.js";import{P as i}from"./index-b9914bcd.js";import{u as s}from"./useTranslations-24b07ae0.js";import{t as c}from"./theme-b4e6528d.js";import{ResponsiveContainer as m,AreaChart as d,CartesianGrid as p,Tooltip as g,XAxis as y,YAxis as u,Area as b,ReferenceDot as h}from"recharts";import{C as f}from"./index-5d7d7599.js";import{a as x}from"./useOutsideClick-3350280e.js";import E from"styled-components";import{_ as k}from"./tslib.es6-98bf90db.js";import"./index.styled-c3a130a7.js";import"@mantine/core";import"dayjs";import"./screenSizeContext-2352b7aa.js";import"lodash/throttle";import"./index-1cc8c07f.js";import"date-fns/locale";import"./Subot-536c3f3b.js";import"./isProduction-72db2237.js";import"./gAssets.js";import"./index.styled-a8279a8f.js";import"./index-42a97c34.js";import"@mantine/hooks";import"@mantine/carousel";import"classnames";import"./index-0991b8cf.js";import"@mantine/dates";import"./translationsContext-98678f48.js";import"string-format";const w=t=>{const{x:r,y:a,payload:o,activeWeek:l}=t;return l===o.value?e.createElement("g",{transform:`translate(${r},${a})`},e.createElement("circle",{r:12,fill:"marryBaby"===t.siteType?c.mbColors.pink:c.colors.primaryBase}),e.createElement("text",{textAnchor:"middle",alignmentBaseline:"central",fill:c.colors.white,fontFamily:"Inter",fontWeight:"600",fontSize:"12px"},o.value)):e.createElement("g",{transform:`translate(${r},${a})`},e.createElement("text",{textAnchor:"middle",alignmentBaseline:"central",fill:c.colors.gray600,fontFamily:"Inter",fontWeight:"400",fontSize:"12px"},o.value))},v=E.div`
2
2
  /* position: absolute; */
3
3
  display: flex;
4
4
  flex-direction: column;
@@ -55,7 +55,7 @@ import e,{useMemo as t,useState as r,useRef as a}from"react";import{M as o,a as
55
55
  align-items: center;
56
56
  gap: 4px;
57
57
  }
58
- `,T=[{name:"overweight",backgroundColor:c.colors.yellow50,color:c.colors.yellow900},{name:"underweight",backgroundColor:c.colors.yellow50,color:c.colors.yellow900},{name:"healthy",backgroundColor:c.colors.green50,color:c.colors.green900}],B=r=>{var a,o,l,i,s;const{payload:m,active:d}=r,p=null===(a=null==m?void 0:m[0])||void 0===a?void 0:a.payload;if(!p||!p.toolTipLabel||!d)return null;const{backgroundColor:g,color:y}=t((()=>T.find((e=>e.name===p.status))),[null==p?void 0:p.status]);return e.createElement(v,null,e.createElement("div",null,null===(o=p.toolTipLabel)||void 0===o?void 0:o[0]," ",null===(l=p.toolTipLabel)||void 0===l?void 0:l[1]),e.createElement("div",null,(null===(i=p.toolTipLabel)||void 0===i?void 0:i[2])&&e.createElement(n,{as:"span",size:"s3",color:c.colors.gray800,weight:"semiBold"},null===(s=p.toolTipLabel)||void 0===s?void 0:s[2]),e.createElement("div",{className:"risk",style:{backgroundColor:g}},e.createElement(n,{size:"n1",color:y},p.translatedStatus))))},W=({weightByWeek:e,weightBefore:t,toolTipLabel:r,status:a,activeWeek:o,t:l})=>{const n=l(`bmi.result.${a}`);return e.map((e=>Object.assign({name:e.week,min:t+e.min,difference:e.max-e.min,max:t+e.max},e.week===o?{toolTipLabel:r,translatedStatus:n,status:a}:{})))},S=({weightBefore:l,weightByWeek:i,activeWeek:E,currentWeight:k,toolTipLabel:v=[],status:C,withLine:T=!1,siteType:S})=>{const{t:z}=s(),L="marryBaby"===S,F=t((()=>W({weightByWeek:i,weightBefore:l,toolTipLabel:v,status:C,activeWeek:E,t:z})),[i,l,v,C,E]),[I,M]=r(!1),N=a(null);return x(N,(()=>M(!1))),e.createElement(j,null,L?e.createElement(o,{type:"bodytext-3",color:c.mbColors.dark}," ",z("babyGrowth.weight")," ",z("pregnancyWeightGain.weightInput.desc")):e.createElement(n,{size:"n1",color:c.colors.gray500},z("babyGrowth.weight")," ",z("pregnancyWeightGain.weightInput.desc")),Array.isArray(F)&&F.length>0&&e.createElement(j,null,e.createElement(m,{height:388,className:"chart"},e.createElement(d,{data:F,margin:{top:16,right:0,left:0}},e.createElement(p,{stroke:c.colors.neutral100}),e.createElement(g,{trigger:"click",content:t=>e.createElement(B,Object.assign({active:!T&&I&&void 0!==E&&void 0!==k},t))}),e.createElement(y,{type:"number",scale:"linear",ticks:Array.from({length:40},((e,t)=>t+1)),dataKey:"name",tickLine:!1,tickMargin:12,tick:t=>e.createElement(w,Object.assign({},t,{activeWeek:E,siteType:S})),domain:["dataMin","dataMax"],interval:"preserveStartEnd",tickCount:1,allowDecimals:!1}),e.createElement(u,{domain:[e=>Math.max(e,l-10||e),e=>Math.max(e,l+20||e)],type:"number",scale:"auto",interval:"preserveStartEnd",tickLine:!1,tickMargin:7,width:45,tickCount:10,allowDecimals:!0,tickFormatter:e=>String(Math.round(100*(e+Number.EPSILON))/100),tick:{fontFamily:"Inter",fontWeight:400,fontSize:12,color:c.colors.gray600}}),e.createElement(b,{connectNulls:!0,type:"monotone",dataKey:"min",stackId:"1",stroke:"transparent",fill:"transparent"}),e.createElement(b,{connectNulls:!0,type:"monotone",dataKey:"difference",stackId:"1",stroke:"transparent",fill:L?c.mbColors.tonePink:c.colors.primary100}),void 0!==E&&void 0!==k&&e.createElement(f,{onClick:()=>M(!0),x:0===E?1:E,y:k,r:4,shape:e.createElement(h,{ref:N,r:4}),fill:L?c.mbColors.pink:c.colors.primaryBase,stroke:L?c.mbColors.pink:c.colors.primaryBase}))),e.createElement("div",{className:"custom-chart-label"},e.createElement("i",null),L?e.createElement(o,{type:"bodytext-3",color:c.mbColors.dark},z("pregnancy.week")):e.createElement(n,{size:"n1",color:c.colors.gray500},z("pregnancy.week")))))},z=t=>{var{color:r}=t,a=k(t,["color"]);return e.createElement("svg",Object.assign({width:"8",height:"8",viewBox:"0 0 8 8",fill:"none"},a),e.createElement("circle",{cx:"4",cy:"4",r:"4",fill:r||c.colors.primaryBase}))},L=({idealWeight:t,siteType:r})=>{const{t:a}=s(),l="marryBaby"===r;return e.createElement(C,null,e.createElement("div",null,l?e.createElement(e.Fragment,null,e.createElement(z,{color:c.mbColors.lightPink}),e.createElement(o,{type:"bodytext-3",color:c.mbColors.dark},a("pregnancyTool.weightSuggested")," ",e.createElement(n,{size:"n1",color:c.colors.gray800,weight:"bold",as:"span"},t))):e.createElement(e.Fragment,null,e.createElement(z,{color:c.colors.primary100}),e.createElement(n,{size:"n1",color:c.colors.gray600},e.createElement(n,{size:"n1",as:"span"},a("pregnancyTool.weightSuggested")," "),e.createElement(n,{size:"n1",color:c.colors.gray800,weight:"bold",as:"span"},t)))),e.createElement("div",null,l?e.createElement(e.Fragment,null,e.createElement(z,{color:c.mbColors.pink}),e.createElement(o,{type:"bodytext-3",color:c.mbColors.dark},a("pwg.placeholder.weight"))):e.createElement(e.Fragment,null,e.createElement(z,null),e.createElement(n,{size:"n1",color:c.colors.gray600},a("pwg.placeholder.weight")))))},F=E.div`
58
+ `,T=[{name:"overweight",backgroundColor:c.colors.yellow50,color:c.colors.yellow900},{name:"underweight",backgroundColor:c.colors.yellow50,color:c.colors.yellow900},{name:"healthy",backgroundColor:c.colors.green50,color:c.colors.green900}],B=r=>{var a,o,l,i,s;const{payload:m,active:d}=r,p=null===(a=null==m?void 0:m[0])||void 0===a?void 0:a.payload;if(!p||!p.toolTipLabel||!d)return null;const{backgroundColor:g,color:y}=t((()=>T.find((e=>e.name===p.status))),[null==p?void 0:p.status]);return e.createElement(v,null,e.createElement("div",null,null===(o=p.toolTipLabel)||void 0===o?void 0:o[0]," ",null===(l=p.toolTipLabel)||void 0===l?void 0:l[1]),e.createElement("div",null,(null===(i=p.toolTipLabel)||void 0===i?void 0:i[2])&&e.createElement(n,{as:"span",size:"s3",color:c.colors.gray800,weight:"semiBold"},null===(s=p.toolTipLabel)||void 0===s?void 0:s[2]),e.createElement("div",{className:"risk",style:{backgroundColor:g}},e.createElement(n,{size:"n1",color:y},p.translatedStatus))))},W=({weightByWeek:e,weightBefore:t,toolTipLabel:r,status:a,activeWeek:o,t:l})=>{const n=l(`bmi.result.${a}`);return e.map((e=>Object.assign({name:e.week,min:t+e.min,difference:e.max-e.min,max:t+e.max},e.week===o?{toolTipLabel:r,translatedStatus:n,status:a}:{})))},S=({weightBefore:l,weightByWeek:i,activeWeek:E,currentWeight:k,toolTipLabel:v=[],status:C,withLine:T=!1,siteType:S})=>{const{t:z}=s(),L="marryBaby"===S,F=t((()=>W({weightByWeek:i,weightBefore:l,toolTipLabel:v,status:C,activeWeek:E,t:z})),[i,l,v,C,E]),[I,M]=r(!1),N=a(null);return x(N,(()=>M(!1))),e.createElement(j,null,L?e.createElement(o,{type:"bodytext-3",color:c.mbColors.dark}," ",z("babyGrowth.weight")," ",z("pregnancyWeightGain.weightInput.desc")):e.createElement(n,{size:"n1",color:c.colors.gray500},z("babyGrowth.weight")," ",z("pregnancyWeightGain.weightInput.desc")),Array.isArray(F)&&F.length>0&&e.createElement(j,null,e.createElement(m,{height:388,className:"chart"},e.createElement(d,{data:F,margin:{top:16,right:0,left:0}},e.createElement(p,{stroke:c.colors.neutral100}),e.createElement(g,{trigger:"click",content:t=>e.createElement(B,Object.assign({active:!T&&I&&void 0!==E&&void 0!==k},t))}),e.createElement(y,{type:"number",scale:"linear",ticks:Array.from({length:40},((e,t)=>t+1)),dataKey:"name",tickLine:!1,tickMargin:12,tick:t=>e.createElement(w,Object.assign({},t,{activeWeek:E,siteType:S})),domain:["dataMin","dataMax"],interval:"preserveStartEnd",tickCount:1,allowDecimals:!1}),e.createElement(u,{domain:[e=>Math.max(e,l-10||e),e=>Math.max(e,l+20||e)],type:"number",scale:"auto",interval:"preserveStartEnd",tickLine:!1,tickMargin:7,width:45,tickCount:10,allowDecimals:!0,tickFormatter:e=>String(Math.round(100*(e+Number.EPSILON))/100),tick:{fontFamily:"Inter",fontWeight:400,fontSize:12,color:c.colors.gray600}}),e.createElement(b,{connectNulls:!0,type:"monotone",dataKey:"min",stackId:"1",stroke:"transparent",fill:"transparent"}),e.createElement(b,{connectNulls:!0,type:"monotone",dataKey:"difference",stackId:"1",stroke:"transparent",fill:L?c.mbColors.tonePink:c.colors.primary100}),void 0!==E&&void 0!==k&&e.createElement(h,{onClick:()=>M(!0),x:0===E?1:E,y:k,r:4,shape:e.createElement(f,{ref:N,r:4}),fill:L?c.mbColors.pink:c.colors.primaryBase,stroke:L?c.mbColors.pink:c.colors.primaryBase}))),e.createElement("div",{className:"custom-chart-label"},e.createElement("i",null),L?e.createElement(o,{type:"bodytext-3",color:c.mbColors.dark},z("pregnancy.week")):e.createElement(n,{size:"n1",color:c.colors.gray500},z("pregnancy.week")))))},z=t=>{var{color:r}=t,a=k(t,["color"]);return e.createElement("svg",Object.assign({width:"8",height:"8",viewBox:"0 0 8 8",fill:"none"},a),e.createElement("circle",{cx:"4",cy:"4",r:"4",fill:r||c.colors.primaryBase}))},L=({idealWeight:t,siteType:r})=>{const{t:a}=s(),l="marryBaby"===r;return e.createElement(C,null,e.createElement("div",null,l?e.createElement(e.Fragment,null,e.createElement(z,{color:c.mbColors.lightPink}),e.createElement(o,{type:"bodytext-3",color:c.mbColors.dark},a("pregnancyTool.weightSuggested")," ",e.createElement(n,{size:"n1",color:c.colors.gray800,weight:"bold",as:"span"},t))):e.createElement(e.Fragment,null,e.createElement(z,{color:c.colors.primary100}),e.createElement(n,{size:"n1",color:c.colors.gray600},e.createElement(n,{size:"n1",as:"span"},a("pregnancyTool.weightSuggested")," "),e.createElement(n,{size:"n1",color:c.colors.gray800,weight:"bold",as:"span"},t)))),e.createElement("div",null,l?e.createElement(e.Fragment,null,e.createElement(z,{color:c.mbColors.pink}),e.createElement(o,{type:"bodytext-3",color:c.mbColors.dark},a("pwg.placeholder.weight"))):e.createElement(e.Fragment,null,e.createElement(z,null),e.createElement(n,{size:"n1",color:c.colors.gray600},a("pwg.placeholder.weight")))))},F=E.div`
59
59
  display: flex;
60
60
  flex-direction: column;
61
61
  align-items: center;
@@ -1 +1 @@
1
- import{d as e}from"./index-13feb3ef.js";import{i as s}from"./isProduction-d0d81279.js";const t=(t,o)=>{if("undefined"!=typeof window)return window.location.origin;const r="development"===process.env.NEXT_PUBLIC_DEPLOY_ENV;return r?"http://localhost:3000":`https://${!r&&!s?o?"fe.":"discover.":o?"www.":""}${e[o?"vi-VN_MB":t]}`},o=(t,o)=>process.env.UNIFY_SSO_API||`https://${s?"id.":"staging-id."}${e[o?"vi-VN_MB":t]}`,r=()=>process.env.UNIFY_INTERNAL_TOGETHER_API||process.env.UNIFY_TOGETHER_API||`https://${s?"together.":"staging-together."}hellohealthgroup.com`,n=t=>process.env.UNIFY_DISCOVER_API||`https://${s?"wp.":"staging."}${e[t]}`,i=()=>process.env.UNIFY_INTERNAL_CARE_API||process.env.UNIFY_CARE_API||`https://${s?"health-care.":"service-health-care."}hellohealthgroup.com`;export{o as a,r as b,n as c,i as d,t as g};
1
+ import{d as e}from"./index-1cc8c07f.js";import{i as s}from"./isProduction-72db2237.js";const t=(t,o)=>{if("undefined"!=typeof window)return window.location.origin;const r="development"===process.env.NEXT_PUBLIC_DEPLOY_ENV;return r?"http://localhost:3000":`https://${!r&&!s?o?"fe.":"discover.":o?"www.":""}${e[o?"vi-VN_MB":t]}`},o=(t,o)=>process.env.UNIFY_SSO_API||`https://${s?"id.":"staging-id."}${e[o?"vi-VN_MB":t]}`,r=()=>process.env.UNIFY_INTERNAL_TOGETHER_API||process.env.UNIFY_TOGETHER_API||`https://${s?"together.":"staging-together."}hellohealthgroup.com`,n=t=>process.env.UNIFY_DISCOVER_API||`https://${s?"wp.":"staging."}${e[t]}`,c=()=>process.env.UNIFY_INTERNAL_CARE_API||process.env.UNIFY_CARE_API||`https://${s?"health-care.":"service-health-care."}hellohealthgroup.com`;export{o as a,r as b,n as c,c as d,t as g};
@@ -1,4 +1,4 @@
1
- import e,{createContext as t,useContext as i,useRef as n,useState as o,useEffect as a,useCallback as l,useMemo as r,forwardRef as s,memo as d,useImperativeHandle as c}from"react";import{e as u,c as m,N as p,d as v,f as g,g as b,E as h,L as f,F as y}from"./Subot-7ea674b0.js";import{a as E,_ as x}from"./tslib.es6-1a7e483e.js";import{B as C,d as w,M as k,e as S,G as I,f as N,A as _,g as T}from"./index-13feb3ef.js";import O from"js-cookie";import j from"fastdom";import A from"fastdom/extensions/fastdom-promised";import{D as B}from"./index.styled-cadd6706.js";import{G as P,N as M,a9 as R,aa as U,b as L,ab as D}from"./index.styles-3036321c.js";import"./index-dde41fb0.js";import{Box as F,Textarea as H}from"@mantine/core";import{I as z,T as Y}from"./index-e751d8c2.js";import"./translationsContext-f66e3d3d.js";import q from"string-format";import"innertext";import{t as G}from"./theme-c254ba9f.js";import{B as V,S as X}from"./index-02f0f4fe.js";import"@mantine/dates";import"./gAssets.js";import Q from"dayjs";import{M as K}from"./screenSizeContext-8f042934.js";import W from"styled-components";import{i as J}from"./isProduction-d0d81279.js";import"@mantine/hooks";import"./constants-bcabc622.js";import"lodash/debounce";import"react-contenteditable";import"react-dom";import"./useCategory-b6426a83.js";import{v4 as Z}from"uuid";import $ from"hex-rgb";import ee from"classnames";import"@linaria/react";import"./utils-0347b372.js";import{C as te}from"./index-e4c49b57.js";import"./index.styled-d760ce2f.js";import"./index-c26145e4.js";import{D as ie,L as ne}from"./index-6aeb538e.js";import{motion as oe}from"framer-motion";import{Remarkable as ae}from"remarkable";import"date-fns";import"react-day-picker/DayPickerInput";import"./index-eace0e39.js";import"lodash/throttle";import"html-react-parser";import"./types-062901c3.js";import{Controller as le,useForm as re}from"react-hook-form";import"./index.styled-7f374882.js";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-4a4ab4d3.js";import"./utils-f65c59d5.js";import"@mantine/form";import"lodash/flatten";import"lodash/uniqBy";import"./constants-95cb8ea0.js";import{useInView as se}from"react-intersection-observer";import de from"dayjs/plugin/isSameOrBefore";import{B as ce}from"./index-19144b5a.js";import ue from"lodash/isEmpty";import me,{getCountryCallingCode as pe,isPossiblePhoneNumber as ve,parsePhoneNumber as ge}from"react-phone-number-input";import{LoadScript as be}from"@react-google-maps/api";import{u as he,G as fe,a as ye}from"./usePlacesAutocomplete-12181fb9.js";import"date-fns/locale";import"./useTranslations-e0f5679c.js";import"./number-f57dcbd1.js";import"./index-a5e07868.js";import"./routing-0284bf36.js";import"dayjs/plugin/relativeTime";import"./paths-f6ce774b.js";import"./index-f2ede565.js";import"./cookieHelper-0d554a3d.js";import"react-keyed-flatten-children";import"slugify";import"@mantine/carousel";import"./index-15efeba7.js";import"@hookform/resolvers/yup";import"./index-f4f05774.js";import"./index-14780cf0.js";import"./index-1fc7e785.js";const Ee=j.extend(A),xe={POST_VERIFY_SMS_OTP:"sms/update-phone",POST_SEND_OTP:"sms/otp",POST_SEND_OTP_WHATSAPP:"whatsapp/otp",POST_VERIFY_OTP:"sms/verify",POST_VERIFY_OTP_WHATSAPP:"sms/verify-whatsapp",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",GET_INLINE_FIRST_NODE:"bots",GET_INLINE_MESSAGE:"inline/messages",GET_INLINE_IMPRESSION:"inline/impressions",GET_INLINE_CLICK:"inline/clicks",GET_SUBOT_LOG:"log/bot/{botId}/{cookieId}/{accountId}?type={type}",POST_SUBOT_CREATE_LOG:"log/bot",FETCH_URL_DATA:"preview",GET_VOUCHER_QUANTITY:"vouchers/total_quantity?search={search}&client_id={clientId}"},Ce={cached:{},clearCached:e=>{console.log(Ce.cached),Object.keys(Ce.cached).filter((t=>t.startsWith(e))).forEach((e=>{console.log(e),Ce.cached[e]=void 0}))},withCached:(e,t)=>E(void 0,void 0,void 0,(function*(){if("waitingTheFirstResponse"===Ce.cached[e])return new Promise((t=>{const i=(new Date).getTime(),n=setInterval((()=>{(new Date).getTime()-i>3e3&&clearInterval(n),"object"==typeof Ce.cached[e]&&(t(Ce.cached[e]),clearInterval(n))}),100)}));if("object"==typeof Ce.cached[e])return Ce.cached[e];Ce.cached[e]="waitingTheFirstResponse";try{const i=yield t();return Ce.cached[e]=i,setTimeout((()=>{Ce.cached[e]=void 0}),18e5),i}catch(t){return Ce.cached[e]=void 0,Promise.reject(t)}}))},we=(e,t)=>{const{subotApiUrl:i}=null==P?void 0:P.env;return(i.endsWith("frontend/api/")?i:i+"frontend/api/")+q(e,Object.assign({},t))},ke=e=>E(void 0,void 0,void 0,(function*(){try{return yield M(we(xe.GET_INLINE_MESSAGE),"POST",{data:e})}catch(e){}})),Se=e=>{var t;if(1===(null==e?void 0:e._status)&&(null===(t=null==e?void 0:e._data)||void 0===t?void 0:t.extra_settings))try{const t=JSON.parse(e._data.extra_settings);e._data.extra_settings="object"==typeof t?t:{sync_data_friso_campaign:!1}}catch(t){e._data.extra_settings={sync_data_friso_campaign:!1}}return e},Ie=e=>E(void 0,void 0,void 0,(function*(){try{return yield Ce.withCached("SubotInlineFirstNode",(()=>E(void 0,void 0,void 0,(function*(){const t=yield M(we(xe.GET_INLINE_FIRST_NODE)+`/${e}`,"GET");return Se(t),t}))))}catch(e){return null}})),Ne=e=>E(void 0,void 0,void 0,(function*(){try{return yield M(we(xe.GET_INLINE_CLICK),"POST",{data:e})}catch(e){}})),_e=e=>E(void 0,void 0,void 0,(function*(){try{return yield M(we(xe.GET_INLINE_IMPRESSION),"POST",{data:e})}catch(e){}})),Te=["form_submit_meta","selected_actions","current_selected","current_keys","current_polls"],Oe=["bot_id","node_id","action_id","action_value","current_score","gtm_id","ga_client_id","is_new","title_url","url","window_id",...Te],je=(e,t)=>(Object.keys(t).map((i=>{const n=t[i];if("source"!==i){if(Oe.includes(i))if(Te.includes(i))try{e[i]=JSON.parse(n)}catch(e){}else e[i]="account_id"!==i&&"current_score"!==i&&"bot_id"!==i?n:parseInt(n)}else e.is_new="first_login"===n})),e),Ae=e=>[{id:Z(),label:JSON.stringify({title:"",description:""}),type:u.SSO_INTENT,url:""},{id:Z(),label:JSON.stringify({title:e({id:"subot.myHealth.title",defaultMessage:"My Health"}),description:e({id:"subot.myHealth.description",defaultMessage:"Personal identifiers (like your name) will always be removed to protect your privacy. "})}),type:u.SSO_INTENT,url:"/images/subot/my-health.svg"},{id:Z(),label:JSON.stringify({title:e({id:"subot.saveData.title",defaultMessage:"Save Data"}),description:e({id:"subot.saveData.description",defaultMessage:"Hellobacsi would like to learn from your data to provide better healthcare for you"})}),type:u.SSO_INTENT,url:"/images/subot/file-storage.svg"},{id:Z(),label:JSON.stringify({title:e({id:"subot.productYourIdentifiers.title",defaultMessage:"Protect your identifiers"}),description:e({id:"subot.productYourIdentifiers.description",defaultMessage:"Personal identifiers (like your name) will always be removed to protect your privacy. "})}),type:u.SSO_INTENT,url:"/images/subot/shield.svg"}];function Be(e){const t=e.condition,i=e.finished,n=e.timeout||3e3,o=(new Date).getTime(),a=setInterval((()=>{((new Date).getTime()-o>n||t())&&(clearInterval(a),i())}),300)}const Pe=e=>R.parse(e||"")["hhg-id"]||O.get("hhg-id")||"",Me=e=>{if(e)return O.set("hhg-id",e),e;const t=Pe();if(t)return t;const i=Z();return O.set("hhg-id",i),i},Re=e=>{const t=R.parse(e||"")[C]||O.get(C)||"";try{const e=t.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),i=decodeURIComponent(atob(e).split("").map((function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join(""));return JSON.parse(i).sub}catch(e){return""}},Ue=e=>{const t=R.parse(e||"")[C]||O.get(C)||"";try{const e=t.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),i=decodeURIComponent(atob(e).split("").map((function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join("")),n=JSON.parse(i);return{email:n.email,id:n.sub}}catch(e){return{email:"",id:0}}},Le=Z(),De=()=>Le,Fe=(e,t)=>!t&&("undefined"!=typeof window&&("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname))?"http://localhost":`https://${J?"":"discover."}${w[e]}`,He=e=>{const t=e||("undefined"==typeof navigator?"":navigator.userAgent);return!(!/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)&&!/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substring(0,4)))},ze=e=>{const t=document.createElement("a");t.href=e,t.target="_blank",t.click()},Ye=30,qe=e=>{try{return e.dynamic_score||{}}catch(e){return{}}},Ge=(e,t,i,n)=>{const o=qe(e[0]);if(!t)return{};const a=e.findIndex((e=>e.id==t)),l=e.reduce(((e,l,r)=>{var s,d;if(r>a)return e;const c=l,u=i&&c.id===t?{action_id:i}:c._message;let p=0;const v=null===(s=c.actions)||void 0===s?void 0:s.find((e=>e.id===(null==u?void 0:u.action_id)));p+=(null==v?void 0:v.score)||0;const g=void 0!==o[c.id],b=i&&c.id===t?n:null==u?void 0:u.form_submit_meta;if(g&&c.type===m.FORM&&b){const e=o[c.id].action_id,t=null===(d=c.actions)||void 0===d?void 0:d.find((t=>t.id===e)),i=null==t?void 0:t.key,n=b.find((e=>e.key===i&&"number"===e.control));if(o[c.id].number&&["+","-","x","/"].includes(o[c.id].operator)&&(null==n?void 0:n.value)&&Number(n.value)){const e=Number(n.value),t=o[c.id].operator,i=o[c.id].number;let a=0;"+"===t&&(a=e+i),"-"===t&&(a=e-i),"x"===t&&(a=e*i),"/"===t&&(a=e/i),isNaN(a)||(p+=a)}}return e+p}),0);return{current_total_dynamic_score:l}},Ve=(e,t)=>{const i=qe(t[0]);if(0===Object.keys(i).length)return e;const n=t.filter((e=>e.type===m.FORM));return Object.keys(i).forEach((t=>{var o,a,l;const r=n.find((e=>e.id===t)),s=null===(o=null==r?void 0:r.actions)||void 0===o?void 0:o.find((e=>{var n;return e.id===(null===(n=i[t])||void 0===n?void 0:n.action_id)})),d=null==s?void 0:s.key,c=null===(l=null===(a=null==r?void 0:r._message)||void 0===a?void 0:a.form_submit_meta)||void 0===l?void 0:l.find((e=>e.key===d&&"number"===e.control));if(i[t].number&&["+","-","x","/"].includes(i[t].operator)&&(null==c?void 0:c.value)&&Number(c.value)){const n=Number(c.value),o=i[t].operator,a=i[t].number;let l=0;if("+"===o&&(l=n+a),"-"===o&&(l=n-a),"x"===o&&(l=n*a),"/"===o&&(l=n/a),e.includes(`{{var:${d}}}`)){const t=new RegExp(`{{var:${d}}}`,"g");e=e.replace(t,String(Math.floor(100*l)/100))}}})),e},Xe="other",Qe="stateInlineSSO",Ke=()=>{try{const e=window.next.router.components["/[...slug]"].props.pageProps;return"services-connection"===e.template?{project_id:"care-path",user_funnel:e.spotlight.additionalSlugActive||"",audience_name:e.spotlight.groupIdActive||""}:{}}catch(e){return{}}},We=e=>{const t=e.filter((e=>"Unified Questions"===e.name)).reduce(((e,t)=>{var i,n,o,a,l,r,s,d,c,u,p,v,b,h,f,y,E,x,C,w,k;if(t.actions&&(null===(i=t._message)||void 0===i?void 0:i.action_id)&&(null===(n=t._message)||void 0===n?void 0:n.action_value)){const i=t._message.action_value;if(t.type===m.FORM){const i=["address","province","district","commune"],n=((null===(o=t._message)||void 0===o?void 0:o.form_submit_meta)||[]).filter((e=>!i.includes(e.control))),m=((null===(a=t._message)||void 0===a?void 0:a.form_submit_meta)||[]).filter((e=>i.includes(e.control))).reduce(((e,t)=>(e[t.control]=t,e)),{}),p=[null===(l=m.address)||void 0===l?void 0:l.value,null===(r=m.commune)||void 0===r?void 0:r.value,null===(s=m.district)||void 0===s?void 0:s.value,null===(d=m.province)||void 0===d?void 0:d.value].filter(Boolean).join(", ");p&&m.address?e.push({attribute:m.address.key,value:p,label_question:(null===(u=null===(c=t.intents)||void 0===c?void 0:c[0])||void 0===u?void 0:u.label)||""}):n.forEach((i=>{var n,o;e.push({attribute:i.key,value:i.value,label_question:(null===(o=null===(n=t.intents)||void 0===n?void 0:n[0])||void 0===o?void 0:o.label)||""})}))}if(t.type===m.TEXT)if(t.is_multi_select){const i=Object.keys(t._message.selected_actions||{}),n=t.actions.filter((e=>e.label&&i.includes(e.id))).map((e=>e.label));i.length&&e.push({attribute:t.actions[0].key||"",value:n,label_question:(null===(v=null===(p=t.intents)||void 0===p?void 0:p[0])||void 0===v?void 0:v.label)||""})}else{const n=t._message.action_id,o=t.actions.find((e=>e.id===n)),a=null==o?void 0:o.label,l=null===(f=null===(h=null===(b=t._message)||void 0===b?void 0:b.form_submit_meta)||void 0===h?void 0:h.find((e=>e.key===Xe)))||void 0===f?void 0:f.value,r=(null==o?void 0:o.type)===g.USER_CHOICE_TEXT_BY_INPUT;a&&n&&e.push({attribute:i,value:r&&l?l:a,label_question:(null===(E=null===(y=t.intents)||void 0===y?void 0:y[0])||void 0===E?void 0:E.label)||""})}if(t.type===m.POLL){const i=t.id,n=(null===(C=null===(x=t._message)||void 0===x?void 0:x.current_polls)||void 0===C?void 0:C[i])||[],o=t.actions.filter((e=>e.label&&n.includes(e.id))).map((e=>e.label));n.length&&e.push({attribute:t.actions[0].key||"",value:o,label_question:(null===(k=null===(w=t.intents)||void 0===w?void 0:w[0])||void 0===k?void 0:k.label)||""})}}return e}),[]);return t},Je=(e,t)=>{var i;try{if("ACUVUE"!==(null===(i=t.extra_settings)||void 0===i?void 0:i.subot_type))return;let n="",o="",a="",l=Ue().email;if((e||[]).forEach((e=>{var t,i,r;const s=e._message;if(!s)return;const d=null===(t=e.actions)||void 0===t?void 0:t.find((e=>e.id===s.action_id));if("voucher_product"===s.action_value?n=(null==d?void 0:d.label)||"":"voucher_color"===s.action_value&&(o=(null==d?void 0:d.label)||""),e.type===m.FORM){const e=null===(i=s.form_submit_meta)||void 0===i?void 0:i.find((e=>"voucher_size"===e.key)),t=null===(r=s.form_submit_meta)||void 0===r?void 0:r.find((e=>"email"===e.control));e&&(a=e.value),t&&(l=t.value)}})),"ACUVUE® OASYS (1-DAY) WITH HYDRALUXE®"===n&&l)return{email:l,voucherName:n};if(n&&o&&a&&l)return{email:l,voucherName:`${n}|${o}|${a}`}}catch(e){console.log("ExtractVoucherAnswer",e)}},Ze=({nodes:e,activeId:t,params:i,accountIdFromLogs:n})=>E(void 0,void 0,void 0,(function*(){try{let o="in_progress";const a=e[e.length-1];(null==a?void 0:a.type)&&v.includes(a.type)&&(o="complete");const l=e.slice(1),r={activeId:t,params:i,nodes:l,tracking:Object.assign(Object.assign({},Ke()),{full_url:window.location.href}),unifiedAnswers:We(l),voucherAnswers:Je(l,e[0])},s={cookie_id:Me(),account_id:n||Re()||null,bot_id:e[0].id,flow_uuid:e[0].flow_uuid,data:JSON.stringify(r),status:o,type:"inline",market:k[U]};yield M(we(xe.POST_SUBOT_CREATE_LOG),"POST",{data:s})}catch(e){}})),$e=(e,t)=>{try{const[i,n,o]=$(e,{format:"array"});return`rgba(${i}, ${n}, ${o}, ${t})`}catch(e){return}},et=t({activeId:"",params:{},listNodes:[],loading:!0,getParams:()=>({}),onNext:()=>null,onPrev:()=>null,onSubmit:()=>null,onStartOver:()=>null,onChange:()=>null,isShowFooter:!1,setIsShowFooter:()=>null,setLoading:()=>null,userInfo:null}),tt=({children:t,articleLink:s,subotId:d,isFullContainer:c,bgColor:u,primaryColor:m,isDisabledAnimationOnMobile:v,onCloseMobile:g,userInfo:b})=>{const{formatMessage:h,action:{pushNotifications:f}}=i(L),y=n(null),C=n(null),[w,k]=o(!0),[N,_]=o(""),[T,j]=o([]),[A,B]=o(!1),[R,U]=o({});a((()=>{const e=u||"#e3f2ff",t=m||"#2d87f3",i=(new Date).getTime(),n=setInterval((()=>{const o=y.current,a=(new Date).getTime();o&&(Ee.mutate((()=>{o.style.setProperty("--subot-inline-bg-color",e),o.style.setProperty("--subot-inline-primary-color",t),o.style.setProperty("--subot-inline-primary-color-hover",$e(t,.9)||t),o.style.setProperty("--subot-inline-primary-color-100",$e(t,.1)||"#e3f2ff"),o.style.setProperty("--subot-inline-primary-color-300",$e(t,.3)||"#bcdeff")})),clearInterval(n)),a-i>18e4&&clearInterval(n)}),100);return()=>{clearInterval(n)}}),[u,m]);const D=l((()=>{const e=window.gaData,t=window.location.origin+S+("tl-PH"===(null==P?void 0:P.locale)?s.replace("fil/",""):s),i={bot_id:d,account_id:Re()||null,action_id:"",action_value:"",cookie_id:Me(),current_score:0,current_keys:[],current_selected:[],form_submit_meta:[],gtm_id:e?Object.keys(e)[0]:"",ga_client_id:O.get("_ga")||"",is_new:!1,mode:"inline",node_id:"",selected_actions:{},title_url:document.title||"",url:t.replace("http://localhost:6006","https://discover.hellobacsi.com").replace("http://localhost","https://discover.hellobacsi.com").replace("dev.","discover.").replace("staging.hellohealthgroup.com","discover.hellodoctor.com.ph").replace("https://hellohealthgroup.com","https://hellodoctor.com.ph"),window_id:De()};return je(i,null==P?void 0:P.router.query)}),[]),F=l((()=>{var e;null===(e=y.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"start",inline:"center"})}),[]),H=l(((e,t=!0)=>E(void 0,void 0,void 0,(function*(){var i;if(!e||!e.url||!e.bot_id)return;let n="",o=[];k(!0);const a=yield Ie(e.bot_id);1===(null==a?void 0:a._status)&&(n=null==a?void 0:a._data.id.toString(),o.push(null==a?void 0:a._data,null==a?void 0:a._data.first_node));const l=t?yield(r=o[0],E(void 0,void 0,void 0,(function*(){var e,t;try{if(!r)return null;const i=yield M(we(xe.GET_SUBOT_LOG,{botId:r.id,cookieId:Me(),accountId:Re()||"",type:"inline"}),"GET");if(!(null===(e=null==i?void 0:i._data)||void 0===e?void 0:e.data)||"inline"!==(null===(t=null==i?void 0:i._data)||void 0===t?void 0:t.type))return null;const n=JSON.parse(i._data.data),o=n.nodes,a="in_progress"===i._data.status,l="complete"===i._data.status;return a||l?{nodes:[r,...o],activeId:n.activeId,params:Object.assign(Object.assign({},n.params),{account_id:Re()||n.params.account_id||null})}:null}catch(e){return null}}))):null;var r;l&&(o=l.nodes,n=l.activeId,C.current=(null===(i=l.params)||void 0===i?void 0:i.account_id)||0);const s=((e,{getParams:t})=>{try{if(!Re())return null;const i=JSON.parse(localStorage.getItem(Qe)||""),n=18e5;return(null==i?void 0:i.botId)===e&&i.listNodes&&i.activeId&&i.createdAt+n>Date.now()&&(localStorage.removeItem(Qe),i.listNodes.slice(-1)[0].position===p.SSO)?{listNodes:i.listNodes,activeId:i.activeId,params:Object.assign(Object.assign(Object.assign({},t()),i.params),{account_id:Re()||null,cookie_id:Me(i.params.cookie_id)})}:null}catch(e){return null}})(e.bot_id,{getParams:D});if(s&&s.params.action_id&&s.params.action_value){const e=yield ke(s.params);1===(null==e?void 0:e._status)&&(null==e?void 0:e._data.node)&&(n=null==e?void 0:e._data.node.id,o=s.listNodes,o[o.length-1]=null==e?void 0:e._data.node,Ze({nodes:o,activeId:n,params:s.params,accountIdFromLogs:C.current}),setTimeout((()=>{F()}),100))}const d=(null==s?void 0:s.params)||(null==l?void 0:l.params)||e,[c,u]=((e,t,i)=>{if(!(null==e?void 0:e.subot_field_type))return[t,i];const n=i.find((e=>e.id==t));return n&&n.hasOwnProperty("first_node")&&i.length>1?[i[1].id,i]:[t,i]})(o[0],n,o);k(!1),_(c),j(u),U(Object.assign(Object.assign({},e),d))}))),[]),z=l(((e,t)=>{const i=document.querySelector(`.si-revamp-event-submission[data-bot-id="${d}"]`);i&&i.click();let n=N,o=[...T];if(null==t?void 0:t.node_id){const e=o.findIndex((({id:e})=>e==t.node_id));-1!==e&&(o[e]._message=Object.assign(Object.assign({},o[e]._message),t),o=[...o.slice(0,e+1)])}if(k(!0),e){const t=o.findIndex((({id:t})=>t==(null==e?void 0:e.id)));if(-1===t)o=[...o,Object.assign({},e)];else{const i=Object.assign(Object.assign(Object.assign({},o[t]),e),{_message:Object.assign(Object.assign({},o[t]._message),null==e?void 0:e._message)});o=[...o.slice(0,t),Object.assign({},i),...o.slice(t+1)]}n=e.id}setTimeout((()=>{j(o),_(n),k(!1),Ze({nodes:o,activeId:n,params:R,accountIdFromLogs:C.current})}),250)}),[T,N]),Y=l((e=>E(void 0,void 0,void 0,(function*(){if(null==e?void 0:e.node_id){const t=Object.assign(Object.assign({},e),Ge(T,N,e.action_id)),i=yield ke(t);if(k(!1),1===(null==i?void 0:i._status)){const e=null==i?void 0:i._data,{node:n}=e,o=x(e,["node"]),a=Object.assign(Object.assign({},n),{_message:Object.assign(Object.assign({},o),{node_id:n.id})});return void(-1!==T.findIndex((e=>e.id===a.id))?z(a):z(a,t))}f({title:h({id:"notification.comment.somethingWrong"}),message:"",type:"danger"})}const t=T.find((e=>e.id==N));t&&t.hasOwnProperty("first_node")&&(_(T[1].id.toString()),Ze({nodes:T,activeId:T[1].id.toString(),params:D(),accountIdFromLogs:C.current}))}))),[z,T]),q=l((()=>{const e=T.findIndex((({id:e})=>e==N));if(e&&-1!==e&&e>1){const t=T[e-1];_(t.id),Ze({nodes:T,activeId:t.id,params:R,accountIdFromLogs:C.current})}}),[T,N]),G=l((()=>{const e=D();H(e,!1);const t=T[0],i=T[1];Ze({nodes:[t,i],activeId:String(t.id),params:e,accountIdFromLogs:C.current})}),[D,H,T]),V=l((e=>{j((t=>e&&(null==e?void 0:e.node_id)&&(null==e?void 0:e.node_id)==N?t.map((t=>{const i=t;return i.id===N?Object.assign(Object.assign({},t),{_message:i._message?Object.assign(Object.assign({},i._message),e):e}):t})):t))}),[N]);a((()=>{if(O.get(I)){const e=D();H(e)}else Be({condition:()=>Boolean(O.get(I)),finished:()=>{const e=D();H(e)}})}),[]),a((()=>{if(!T.length)return;T.find((e=>e.id==N))&&N||_(d+"")}),[N,T]);const X=r((()=>({activeId:N,params:R,listNodes:T,loading:w,setLoading:k,getParams:D,onNext:Y,onPrev:q,onSubmit:z,onStartOver:G,onChange:V,isShowFooter:A,setIsShowFooter:B,isFullContainer:c,isDisabledAnimationOnMobile:v,onCloseMobile:g,userInfo:b})),[N,Y,q,z,V,G,A,R,T,w,k,D,c,v,g,b]);return T.length?e.createElement(et.Provider,{value:X},e.createElement("div",{ref:y},t)):null},it=t=>e.createElement("svg",Object.assign({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M5.99105 4.99067C5.79212 4.99072 5.59772 5.0501 5.43271 5.16121C5.2677 5.27233 5.13958 5.43013 5.06472 5.61444C4.98986 5.79875 4.97167 6.0012 5.01248 6.1959C5.05328 6.39061 5.15122 6.56872 5.29379 6.70747L10.5868 12.0004L5.29379 17.2934C5.19781 17.3855 5.12119 17.4959 5.0684 17.618C5.01562 17.7402 4.98773 17.8716 4.98638 18.0046C4.98503 18.1377 5.01023 18.2697 5.06052 18.3928C5.11081 18.516 5.18517 18.6279 5.27925 18.722C5.37333 18.8161 5.48523 18.8904 5.60841 18.9407C5.73159 18.991 5.86356 19.0162 5.9966 19.0149C6.12964 19.0135 6.26108 18.9856 6.38321 18.9328C6.50533 18.8801 6.6157 18.8034 6.70785 18.7075L12.0008 13.4145L17.2938 18.7075C17.3859 18.8034 17.4963 18.8801 17.6184 18.9328C17.7406 18.9856 17.872 19.0135 18.005 19.0149C18.1381 19.0162 18.27 18.991 18.3932 18.9407C18.5164 18.8904 18.6283 18.8161 18.7224 18.722C18.8165 18.6279 18.8908 18.516 18.9411 18.3928C18.9914 18.2697 19.0166 18.1377 19.0153 18.0047C19.0139 17.8716 18.986 17.7402 18.9332 17.618C18.8804 17.4959 18.8038 17.3855 18.7078 17.2934L13.4149 12.0004L18.7078 6.70747C18.8524 6.567 18.951 6.38616 18.991 6.18864C19.031 5.99112 19.0103 5.78614 18.9318 5.60055C18.8532 5.41497 18.7205 5.25744 18.5509 5.14861C18.3812 5.03978 18.1827 4.98473 17.9813 4.99067C17.7215 4.99841 17.4749 5.10699 17.2938 5.2934L12.0008 10.5864L6.70785 5.2934C6.61466 5.19761 6.50321 5.12146 6.3801 5.06947C6.25698 5.01747 6.1247 4.99068 5.99105 4.99067Z",fill:"#595959"})),nt="480px",ot=W.div`
1
+ import e,{createContext as t,useContext as i,useRef as n,useState as o,useEffect as a,useCallback as l,useMemo as r,forwardRef as s,memo as d,useImperativeHandle as c}from"react";import{e as u,c as m,N as p,d as v,f as g,g as b,E as h,L as f,F as y}from"./Subot-536c3f3b.js";import{a as E,_ as x}from"./tslib.es6-98bf90db.js";import{B as C,d as w,M as k,e as S,G as I,f as N,A as _,g as T}from"./index-1cc8c07f.js";import O from"js-cookie";import j from"fastdom";import A from"fastdom/extensions/fastdom-promised";import{D as B}from"./index.styled-a49a0f3b.js";import{G as P,N as M,a9 as R,aa as U,b as L,ab as D}from"./index.styles-1dc3d7f0.js";import"./index-6418e06e.js";import{Box as F,Textarea as H}from"@mantine/core";import{I as z,T as Y}from"./index-93427f24.js";import"./translationsContext-98678f48.js";import q from"string-format";import"innertext";import{t as G}from"./theme-b4e6528d.js";import{B as V,S as X}from"./index-42a97c34.js";import"@mantine/dates";import"./gAssets.js";import Q from"dayjs";import{M as K}from"./screenSizeContext-2352b7aa.js";import W from"styled-components";import{i as J}from"./isProduction-72db2237.js";import"@mantine/hooks";import"./constants-da7ec5be.js";import"lodash/debounce";import"react-contenteditable";import"react-dom";import"./useCategory-90322434.js";import{v4 as Z}from"uuid";import $ from"hex-rgb";import ee from"classnames";import"@linaria/react";import"./utils-a52f9e39.js";import{C as te}from"./index-b1b894e8.js";import"./index.styled-c3a130a7.js";import"./index-5d7d7599.js";import{D as ie,L as ne}from"./index-b2b39662.js";import{motion as oe}from"framer-motion";import{Remarkable as ae}from"remarkable";import"date-fns";import"react-day-picker/DayPickerInput";import"./index-a67f43a3.js";import"lodash/throttle";import"html-react-parser";import"./types-4bb0566e.js";import{Controller as le,useForm as re}from"react-hook-form";import"./index.styled-e5302a94.js";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-a8279a8f.js";import"./utils-745dd450.js";import"@mantine/form";import"lodash/flatten";import"lodash/uniqBy";import"./constants-94c0a69b.js";import{useInView as se}from"react-intersection-observer";import de from"dayjs/plugin/isSameOrBefore";import{B as ce}from"./index-e20fe766.js";import ue from"lodash/isEmpty";import me,{getCountryCallingCode as pe,isPossiblePhoneNumber as ve,parsePhoneNumber as ge}from"react-phone-number-input";import{LoadScript as be}from"@react-google-maps/api";import{u as he,G as fe,a as ye}from"./usePlacesAutocomplete-3f014212.js";import"date-fns/locale";import"./useTranslations-24b07ae0.js";import"./number-b3dfca43.js";import"./index-7ee9c0b8.js";import"./routing-fd554a2d.js";import"dayjs/plugin/relativeTime";import"./paths-1bcffe54.js";import"./index-a78b0e89.js";import"./cookieHelper-186bd645.js";import"react-keyed-flatten-children";import"slugify";import"@mantine/carousel";import"./index-4f30c485.js";import"@hookform/resolvers/yup";import"./index-7b0ad89b.js";import"./index-3ecb0e1b.js";import"./index-0991b8cf.js";const Ee=j.extend(A),xe={POST_VERIFY_SMS_OTP:"sms/update-phone",POST_SEND_OTP:"sms/otp",POST_SEND_OTP_WHATSAPP:"whatsapp/otp",POST_VERIFY_OTP:"sms/verify",POST_VERIFY_OTP_WHATSAPP:"sms/verify-whatsapp",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",GET_INLINE_FIRST_NODE:"bots",GET_INLINE_MESSAGE:"inline/messages",GET_INLINE_IMPRESSION:"inline/impressions",GET_INLINE_CLICK:"inline/clicks",GET_SUBOT_LOG:"log/bot/{botId}/{cookieId}/{accountId}?type={type}",POST_SUBOT_CREATE_LOG:"log/bot",FETCH_URL_DATA:"preview",GET_VOUCHER_QUANTITY:"vouchers/total_quantity?search={search}&client_id={clientId}"},Ce={cached:{},clearCached:e=>{console.log(Ce.cached),Object.keys(Ce.cached).filter((t=>t.startsWith(e))).forEach((e=>{console.log(e),Ce.cached[e]=void 0}))},withCached:(e,t)=>E(void 0,void 0,void 0,(function*(){if("waitingTheFirstResponse"===Ce.cached[e])return new Promise((t=>{const i=(new Date).getTime(),n=setInterval((()=>{(new Date).getTime()-i>3e3&&clearInterval(n),"object"==typeof Ce.cached[e]&&(t(Ce.cached[e]),clearInterval(n))}),100)}));if("object"==typeof Ce.cached[e])return Ce.cached[e];Ce.cached[e]="waitingTheFirstResponse";try{const i=yield t();return Ce.cached[e]=i,setTimeout((()=>{Ce.cached[e]=void 0}),18e5),i}catch(t){return Ce.cached[e]=void 0,Promise.reject(t)}}))},we=(e,t)=>{const{subotApiUrl:i}=null==P?void 0:P.env;return(i.endsWith("frontend/api/")?i:i+"frontend/api/")+q(e,Object.assign({},t))},ke=e=>E(void 0,void 0,void 0,(function*(){try{return yield M(we(xe.GET_INLINE_MESSAGE),"POST",{data:e})}catch(e){}})),Se=e=>{var t;if(1===(null==e?void 0:e._status)&&(null===(t=null==e?void 0:e._data)||void 0===t?void 0:t.extra_settings))try{const t=JSON.parse(e._data.extra_settings);e._data.extra_settings="object"==typeof t?t:{sync_data_friso_campaign:!1}}catch(t){e._data.extra_settings={sync_data_friso_campaign:!1}}return e},Ie=e=>E(void 0,void 0,void 0,(function*(){try{return yield Ce.withCached("SubotInlineFirstNode",(()=>E(void 0,void 0,void 0,(function*(){const t=yield M(we(xe.GET_INLINE_FIRST_NODE)+`/${e}`,"GET");return Se(t),t}))))}catch(e){return null}})),Ne=e=>E(void 0,void 0,void 0,(function*(){try{return yield M(we(xe.GET_INLINE_CLICK),"POST",{data:e})}catch(e){}})),_e=e=>E(void 0,void 0,void 0,(function*(){try{return yield M(we(xe.GET_INLINE_IMPRESSION),"POST",{data:e})}catch(e){}})),Te=["form_submit_meta","selected_actions","current_selected","current_keys","current_polls"],Oe=["bot_id","node_id","action_id","action_value","current_score","gtm_id","ga_client_id","is_new","title_url","url","window_id",...Te],je=(e,t)=>(Object.keys(t).map((i=>{const n=t[i];if("source"!==i){if(Oe.includes(i))if(Te.includes(i))try{e[i]=JSON.parse(n)}catch(e){}else e[i]="account_id"!==i&&"current_score"!==i&&"bot_id"!==i?n:parseInt(n)}else e.is_new="first_login"===n})),e),Ae=e=>[{id:Z(),label:JSON.stringify({title:"",description:""}),type:u.SSO_INTENT,url:""},{id:Z(),label:JSON.stringify({title:e({id:"subot.myHealth.title",defaultMessage:"My Health"}),description:e({id:"subot.myHealth.description",defaultMessage:"Personal identifiers (like your name) will always be removed to protect your privacy. "})}),type:u.SSO_INTENT,url:"/images/subot/my-health.svg"},{id:Z(),label:JSON.stringify({title:e({id:"subot.saveData.title",defaultMessage:"Save Data"}),description:e({id:"subot.saveData.description",defaultMessage:"Hellobacsi would like to learn from your data to provide better healthcare for you"})}),type:u.SSO_INTENT,url:"/images/subot/file-storage.svg"},{id:Z(),label:JSON.stringify({title:e({id:"subot.productYourIdentifiers.title",defaultMessage:"Protect your identifiers"}),description:e({id:"subot.productYourIdentifiers.description",defaultMessage:"Personal identifiers (like your name) will always be removed to protect your privacy. "})}),type:u.SSO_INTENT,url:"/images/subot/shield.svg"}];function Be(e){const t=e.condition,i=e.finished,n=e.timeout||3e3,o=(new Date).getTime(),a=setInterval((()=>{((new Date).getTime()-o>n||t())&&(clearInterval(a),i())}),300)}const Pe=e=>R.parse(e||"")["hhg-id"]||O.get("hhg-id")||"",Me=e=>{if(e)return O.set("hhg-id",e),e;const t=Pe();if(t)return t;const i=Z();return O.set("hhg-id",i),i},Re=e=>{const t=R.parse(e||"")[C]||O.get(C)||"";try{const e=t.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),i=decodeURIComponent(atob(e).split("").map((function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join(""));return JSON.parse(i).sub}catch(e){return""}},Ue=e=>{const t=R.parse(e||"")[C]||O.get(C)||"";try{const e=t.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),i=decodeURIComponent(atob(e).split("").map((function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join("")),n=JSON.parse(i);return{email:n.email,id:n.sub}}catch(e){return{email:"",id:0}}},Le=Z(),De=()=>Le,Fe=(e,t)=>!t&&("undefined"!=typeof window&&("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname))?"http://localhost":`https://${J?"":"discover."}${w[e]}`,He=e=>{const t=e||("undefined"==typeof navigator?"":navigator.userAgent);return!(!/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)&&!/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substring(0,4)))},ze=e=>{const t=document.createElement("a");t.href=e,t.target="_blank",t.click()},Ye=30,qe=e=>{try{return e.dynamic_score||{}}catch(e){return{}}},Ge=(e,t,i,n)=>{const o=qe(e[0]);if(!t)return{};const a=e.findIndex((e=>e.id==t)),l=e.reduce(((e,l,r)=>{var s,d;if(r>a)return e;const c=l,u=i&&c.id===t?{action_id:i}:c._message;let p=0;const v=null===(s=c.actions)||void 0===s?void 0:s.find((e=>e.id===(null==u?void 0:u.action_id)));p+=(null==v?void 0:v.score)||0;const g=void 0!==o[c.id],b=i&&c.id===t?n:null==u?void 0:u.form_submit_meta;if(g&&c.type===m.FORM&&b){const e=o[c.id].action_id,t=null===(d=c.actions)||void 0===d?void 0:d.find((t=>t.id===e)),i=null==t?void 0:t.key,n=b.find((e=>e.key===i&&"number"===e.control));if(o[c.id].number&&["+","-","x","/"].includes(o[c.id].operator)&&(null==n?void 0:n.value)&&Number(n.value)){const e=Number(n.value),t=o[c.id].operator,i=o[c.id].number;let a=0;"+"===t&&(a=e+i),"-"===t&&(a=e-i),"x"===t&&(a=e*i),"/"===t&&(a=e/i),isNaN(a)||(p+=a)}}return e+p}),0);return{current_total_dynamic_score:l}},Ve=(e,t)=>{const i=qe(t[0]);if(0===Object.keys(i).length)return e;const n=t.filter((e=>e.type===m.FORM));return Object.keys(i).forEach((t=>{var o,a,l;const r=n.find((e=>e.id===t)),s=null===(o=null==r?void 0:r.actions)||void 0===o?void 0:o.find((e=>{var n;return e.id===(null===(n=i[t])||void 0===n?void 0:n.action_id)})),d=null==s?void 0:s.key,c=null===(l=null===(a=null==r?void 0:r._message)||void 0===a?void 0:a.form_submit_meta)||void 0===l?void 0:l.find((e=>e.key===d&&"number"===e.control));if(i[t].number&&["+","-","x","/"].includes(i[t].operator)&&(null==c?void 0:c.value)&&Number(c.value)){const n=Number(c.value),o=i[t].operator,a=i[t].number;let l=0;if("+"===o&&(l=n+a),"-"===o&&(l=n-a),"x"===o&&(l=n*a),"/"===o&&(l=n/a),e.includes(`{{var:${d}}}`)){const t=new RegExp(`{{var:${d}}}`,"g");e=e.replace(t,String(Math.floor(100*l)/100))}}})),e},Xe="other",Qe="stateInlineSSO",Ke=()=>{try{const e=window.next.router.components["/[...slug]"].props.pageProps;return"services-connection"===e.template?{project_id:"care-path",user_funnel:e.spotlight.additionalSlugActive||"",audience_name:e.spotlight.groupIdActive||""}:{}}catch(e){return{}}},We=e=>{const t=e.filter((e=>"Unified Questions"===e.name)).reduce(((e,t)=>{var i,n,o,a,l,r,s,d,c,u,p,v,b,h,f,y,E,x,C,w,k;if(t.actions&&(null===(i=t._message)||void 0===i?void 0:i.action_id)&&(null===(n=t._message)||void 0===n?void 0:n.action_value)){const i=t._message.action_value;if(t.type===m.FORM){const i=["address","province","district","commune"],n=((null===(o=t._message)||void 0===o?void 0:o.form_submit_meta)||[]).filter((e=>!i.includes(e.control))),m=((null===(a=t._message)||void 0===a?void 0:a.form_submit_meta)||[]).filter((e=>i.includes(e.control))).reduce(((e,t)=>(e[t.control]=t,e)),{}),p=[null===(l=m.address)||void 0===l?void 0:l.value,null===(r=m.commune)||void 0===r?void 0:r.value,null===(s=m.district)||void 0===s?void 0:s.value,null===(d=m.province)||void 0===d?void 0:d.value].filter(Boolean).join(", ");p&&m.address?e.push({attribute:m.address.key,value:p,label_question:(null===(u=null===(c=t.intents)||void 0===c?void 0:c[0])||void 0===u?void 0:u.label)||""}):n.forEach((i=>{var n,o;e.push({attribute:i.key,value:i.value,label_question:(null===(o=null===(n=t.intents)||void 0===n?void 0:n[0])||void 0===o?void 0:o.label)||""})}))}if(t.type===m.TEXT)if(t.is_multi_select){const i=Object.keys(t._message.selected_actions||{}),n=t.actions.filter((e=>e.label&&i.includes(e.id))).map((e=>e.label));i.length&&e.push({attribute:t.actions[0].key||"",value:n,label_question:(null===(v=null===(p=t.intents)||void 0===p?void 0:p[0])||void 0===v?void 0:v.label)||""})}else{const n=t._message.action_id,o=t.actions.find((e=>e.id===n)),a=null==o?void 0:o.label,l=null===(f=null===(h=null===(b=t._message)||void 0===b?void 0:b.form_submit_meta)||void 0===h?void 0:h.find((e=>e.key===Xe)))||void 0===f?void 0:f.value,r=(null==o?void 0:o.type)===g.USER_CHOICE_TEXT_BY_INPUT;a&&n&&e.push({attribute:i,value:r&&l?l:a,label_question:(null===(E=null===(y=t.intents)||void 0===y?void 0:y[0])||void 0===E?void 0:E.label)||""})}if(t.type===m.POLL){const i=t.id,n=(null===(C=null===(x=t._message)||void 0===x?void 0:x.current_polls)||void 0===C?void 0:C[i])||[],o=t.actions.filter((e=>e.label&&n.includes(e.id))).map((e=>e.label));n.length&&e.push({attribute:t.actions[0].key||"",value:o,label_question:(null===(k=null===(w=t.intents)||void 0===w?void 0:w[0])||void 0===k?void 0:k.label)||""})}}return e}),[]);return t},Je=(e,t)=>{var i;try{if("ACUVUE"!==(null===(i=t.extra_settings)||void 0===i?void 0:i.subot_type))return;let n="",o="",a="",l=Ue().email;if((e||[]).forEach((e=>{var t,i,r;const s=e._message;if(!s)return;const d=null===(t=e.actions)||void 0===t?void 0:t.find((e=>e.id===s.action_id));if("voucher_product"===s.action_value?n=(null==d?void 0:d.label)||"":"voucher_color"===s.action_value&&(o=(null==d?void 0:d.label)||""),e.type===m.FORM){const e=null===(i=s.form_submit_meta)||void 0===i?void 0:i.find((e=>"voucher_size"===e.key)),t=null===(r=s.form_submit_meta)||void 0===r?void 0:r.find((e=>"email"===e.control));e&&(a=e.value),t&&(l=t.value)}})),"ACUVUE® OASYS (1-DAY) WITH HYDRALUXE®"===n&&l)return{email:l,voucherName:n};if(n&&o&&a&&l)return{email:l,voucherName:`${n}|${o}|${a}`}}catch(e){console.log("ExtractVoucherAnswer",e)}},Ze=({nodes:e,activeId:t,params:i,accountIdFromLogs:n})=>E(void 0,void 0,void 0,(function*(){try{let o="in_progress";const a=e[e.length-1];(null==a?void 0:a.type)&&v.includes(a.type)&&(o="complete");const l=e.slice(1),r={activeId:t,params:i,nodes:l,tracking:Object.assign(Object.assign({},Ke()),{full_url:window.location.href}),unifiedAnswers:We(l),voucherAnswers:Je(l,e[0])},s={cookie_id:Me(),account_id:n||Re()||null,bot_id:e[0].id,flow_uuid:e[0].flow_uuid,data:JSON.stringify(r),status:o,type:"inline",market:k[U]};yield M(we(xe.POST_SUBOT_CREATE_LOG),"POST",{data:s})}catch(e){}})),$e=(e,t)=>{try{const[i,n,o]=$(e,{format:"array"});return`rgba(${i}, ${n}, ${o}, ${t})`}catch(e){return}},et=t({activeId:"",params:{},listNodes:[],loading:!0,getParams:()=>({}),onNext:()=>null,onPrev:()=>null,onSubmit:()=>null,onStartOver:()=>null,onChange:()=>null,isShowFooter:!1,setIsShowFooter:()=>null,setLoading:()=>null,userInfo:null}),tt=({children:t,articleLink:s,subotId:d,isFullContainer:c,bgColor:u,primaryColor:m,isDisabledAnimationOnMobile:v,onCloseMobile:g,userInfo:b})=>{const{formatMessage:h,action:{pushNotifications:f}}=i(L),y=n(null),C=n(null),[w,k]=o(!0),[N,_]=o(""),[T,j]=o([]),[A,B]=o(!1),[R,U]=o({});a((()=>{const e=u||"#e3f2ff",t=m||"#2d87f3",i=(new Date).getTime(),n=setInterval((()=>{const o=y.current,a=(new Date).getTime();o&&(Ee.mutate((()=>{o.style.setProperty("--subot-inline-bg-color",e),o.style.setProperty("--subot-inline-primary-color",t),o.style.setProperty("--subot-inline-primary-color-hover",$e(t,.9)||t),o.style.setProperty("--subot-inline-primary-color-100",$e(t,.1)||"#e3f2ff"),o.style.setProperty("--subot-inline-primary-color-300",$e(t,.3)||"#bcdeff")})),clearInterval(n)),a-i>18e4&&clearInterval(n)}),100);return()=>{clearInterval(n)}}),[u,m]);const D=l((()=>{const e=window.gaData,t=window.location.origin+S+("tl-PH"===(null==P?void 0:P.locale)?s.replace("fil/",""):s),i={bot_id:d,account_id:Re()||null,action_id:"",action_value:"",cookie_id:Me(),current_score:0,current_keys:[],current_selected:[],form_submit_meta:[],gtm_id:e?Object.keys(e)[0]:"",ga_client_id:O.get("_ga")||"",is_new:!1,mode:"inline",node_id:"",selected_actions:{},title_url:document.title||"",url:t.replace("http://localhost:6006","https://discover.hellobacsi.com").replace("http://localhost","https://discover.hellobacsi.com").replace("dev.","discover.").replace("staging.hellohealthgroup.com","discover.hellodoctor.com.ph").replace("https://hellohealthgroup.com","https://hellodoctor.com.ph"),window_id:De()};return je(i,null==P?void 0:P.router.query)}),[]),F=l((()=>{var e;null===(e=y.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"start",inline:"center"})}),[]),H=l(((e,t=!0)=>E(void 0,void 0,void 0,(function*(){var i;if(!e||!e.url||!e.bot_id)return;let n="",o=[];k(!0);const a=yield Ie(e.bot_id);1===(null==a?void 0:a._status)&&(n=null==a?void 0:a._data.id.toString(),o.push(null==a?void 0:a._data,null==a?void 0:a._data.first_node));const l=t?yield(r=o[0],E(void 0,void 0,void 0,(function*(){var e,t;try{if(!r)return null;const i=yield M(we(xe.GET_SUBOT_LOG,{botId:r.id,cookieId:Me(),accountId:Re()||"",type:"inline"}),"GET");if(!(null===(e=null==i?void 0:i._data)||void 0===e?void 0:e.data)||"inline"!==(null===(t=null==i?void 0:i._data)||void 0===t?void 0:t.type))return null;const n=JSON.parse(i._data.data),o=n.nodes,a="in_progress"===i._data.status,l="complete"===i._data.status;return a||l?{nodes:[r,...o],activeId:n.activeId,params:Object.assign(Object.assign({},n.params),{account_id:Re()||n.params.account_id||null})}:null}catch(e){return null}}))):null;var r;l&&(o=l.nodes,n=l.activeId,C.current=(null===(i=l.params)||void 0===i?void 0:i.account_id)||0);const s=((e,{getParams:t})=>{try{if(!Re())return null;const i=JSON.parse(localStorage.getItem(Qe)||""),n=18e5;return(null==i?void 0:i.botId)===e&&i.listNodes&&i.activeId&&i.createdAt+n>Date.now()&&(localStorage.removeItem(Qe),i.listNodes.slice(-1)[0].position===p.SSO)?{listNodes:i.listNodes,activeId:i.activeId,params:Object.assign(Object.assign(Object.assign({},t()),i.params),{account_id:Re()||null,cookie_id:Me(i.params.cookie_id)})}:null}catch(e){return null}})(e.bot_id,{getParams:D});if(s&&s.params.action_id&&s.params.action_value){const e=yield ke(s.params);1===(null==e?void 0:e._status)&&(null==e?void 0:e._data.node)&&(n=null==e?void 0:e._data.node.id,o=s.listNodes,o[o.length-1]=null==e?void 0:e._data.node,Ze({nodes:o,activeId:n,params:s.params,accountIdFromLogs:C.current}),setTimeout((()=>{F()}),100))}const d=(null==s?void 0:s.params)||(null==l?void 0:l.params)||e,[c,u]=((e,t,i)=>{if(!(null==e?void 0:e.subot_field_type))return[t,i];const n=i.find((e=>e.id==t));return n&&n.hasOwnProperty("first_node")&&i.length>1?[i[1].id,i]:[t,i]})(o[0],n,o);k(!1),_(c),j(u),U(Object.assign(Object.assign({},e),d))}))),[]),z=l(((e,t)=>{const i=document.querySelector(`.si-revamp-event-submission[data-bot-id="${d}"]`);i&&i.click();let n=N,o=[...T];if(null==t?void 0:t.node_id){const e=o.findIndex((({id:e})=>e==t.node_id));-1!==e&&(o[e]._message=Object.assign(Object.assign({},o[e]._message),t),o=[...o.slice(0,e+1)])}if(k(!0),e){const t=o.findIndex((({id:t})=>t==(null==e?void 0:e.id)));if(-1===t)o=[...o,Object.assign({},e)];else{const i=Object.assign(Object.assign(Object.assign({},o[t]),e),{_message:Object.assign(Object.assign({},o[t]._message),null==e?void 0:e._message)});o=[...o.slice(0,t),Object.assign({},i),...o.slice(t+1)]}n=e.id}setTimeout((()=>{j(o),_(n),k(!1),Ze({nodes:o,activeId:n,params:R,accountIdFromLogs:C.current})}),250)}),[T,N]),Y=l((e=>E(void 0,void 0,void 0,(function*(){if(null==e?void 0:e.node_id){const t=Object.assign(Object.assign({},e),Ge(T,N,e.action_id)),i=yield ke(t);if(k(!1),1===(null==i?void 0:i._status)){const e=null==i?void 0:i._data,{node:n}=e,o=x(e,["node"]),a=Object.assign(Object.assign({},n),{_message:Object.assign(Object.assign({},o),{node_id:n.id})});return void(-1!==T.findIndex((e=>e.id===a.id))?z(a):z(a,t))}f({title:h({id:"notification.comment.somethingWrong"}),message:"",type:"danger"})}const t=T.find((e=>e.id==N));t&&t.hasOwnProperty("first_node")&&(_(T[1].id.toString()),Ze({nodes:T,activeId:T[1].id.toString(),params:D(),accountIdFromLogs:C.current}))}))),[z,T]),q=l((()=>{const e=T.findIndex((({id:e})=>e==N));if(e&&-1!==e&&e>1){const t=T[e-1];_(t.id),Ze({nodes:T,activeId:t.id,params:R,accountIdFromLogs:C.current})}}),[T,N]),G=l((()=>{const e=D();H(e,!1);const t=T[0],i=T[1];Ze({nodes:[t,i],activeId:String(t.id),params:e,accountIdFromLogs:C.current})}),[D,H,T]),V=l((e=>{j((t=>e&&(null==e?void 0:e.node_id)&&(null==e?void 0:e.node_id)==N?t.map((t=>{const i=t;return i.id===N?Object.assign(Object.assign({},t),{_message:i._message?Object.assign(Object.assign({},i._message),e):e}):t})):t))}),[N]);a((()=>{if(O.get(I)){const e=D();H(e)}else Be({condition:()=>Boolean(O.get(I)),finished:()=>{const e=D();H(e)}})}),[]),a((()=>{if(!T.length)return;T.find((e=>e.id==N))&&N||_(d+"")}),[N,T]);const X=r((()=>({activeId:N,params:R,listNodes:T,loading:w,setLoading:k,getParams:D,onNext:Y,onPrev:q,onSubmit:z,onStartOver:G,onChange:V,isShowFooter:A,setIsShowFooter:B,isFullContainer:c,isDisabledAnimationOnMobile:v,onCloseMobile:g,userInfo:b})),[N,Y,q,z,V,G,A,R,T,w,k,D,c,v,g,b]);return T.length?e.createElement(et.Provider,{value:X},e.createElement("div",{ref:y},t)):null},it=t=>e.createElement("svg",Object.assign({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M5.99105 4.99067C5.79212 4.99072 5.59772 5.0501 5.43271 5.16121C5.2677 5.27233 5.13958 5.43013 5.06472 5.61444C4.98986 5.79875 4.97167 6.0012 5.01248 6.1959C5.05328 6.39061 5.15122 6.56872 5.29379 6.70747L10.5868 12.0004L5.29379 17.2934C5.19781 17.3855 5.12119 17.4959 5.0684 17.618C5.01562 17.7402 4.98773 17.8716 4.98638 18.0046C4.98503 18.1377 5.01023 18.2697 5.06052 18.3928C5.11081 18.516 5.18517 18.6279 5.27925 18.722C5.37333 18.8161 5.48523 18.8904 5.60841 18.9407C5.73159 18.991 5.86356 19.0162 5.9966 19.0149C6.12964 19.0135 6.26108 18.9856 6.38321 18.9328C6.50533 18.8801 6.6157 18.8034 6.70785 18.7075L12.0008 13.4145L17.2938 18.7075C17.3859 18.8034 17.4963 18.8801 17.6184 18.9328C17.7406 18.9856 17.872 19.0135 18.005 19.0149C18.1381 19.0162 18.27 18.991 18.3932 18.9407C18.5164 18.8904 18.6283 18.8161 18.7224 18.722C18.8165 18.6279 18.8908 18.516 18.9411 18.3928C18.9914 18.2697 19.0166 18.1377 19.0153 18.0047C19.0139 17.8716 18.986 17.7402 18.9332 17.618C18.8804 17.4959 18.8038 17.3855 18.7078 17.2934L13.4149 12.0004L18.7078 6.70747C18.8524 6.567 18.951 6.38616 18.991 6.18864C19.031 5.99112 19.0103 5.78614 18.9318 5.60055C18.8532 5.41497 18.7205 5.25744 18.5509 5.14861C18.3812 5.03978 18.1827 4.98473 17.9813 4.99067C17.7215 4.99841 17.4749 5.10699 17.2938 5.2934L12.0008 10.5864L6.70785 5.2934C6.61466 5.19761 6.50321 5.12146 6.3801 5.06947C6.25698 5.01747 6.1247 4.99068 5.99105 4.99067Z",fill:"#595959"})),nt="480px",ot=W.div`
2
2
  position: relative;
3
3
 
4
4
  .si-inline-revamp-container {