@hhgtech/hhg-components 1.29.529 → 1.29.531-beta-2

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 (573) hide show
  1. package/build/{InputDate-23aa3aa8.js → InputDate-8ac98be1.js} +5 -5
  2. package/build/{LastPeriod-749419c1.js → LastPeriod-67fb29c1.js} +1 -1
  3. package/build/{MobileBottomNavigationIcon-55051e19.js → MobileBottomNavigationIcon-f02708f2.js} +3 -3
  4. package/build/{SiteWideBanner-6f5828dd.js → SiteWideBanner-45ee6256.js} +11 -11
  5. package/build/{Spinner-e998027f.js → Spinner-9fc58d56.js} +1 -1
  6. package/build/{WhatsApp-70ed9751.js → WhatsApp-3b180109.js} +1 -1
  7. package/build/adapters.js +20 -20
  8. package/build/atoms.js +51 -51
  9. package/build/babyGrowth.js +86 -86
  10. package/build/cache.js +2 -2
  11. package/build/care/components/organisms/bookingSearchBarV2/index.d.ts +1 -1
  12. package/build/care/components/organisms/bookingSearchBarV2/reducer.d.ts +4 -0
  13. package/build/care/components/organisms/bookingSearchBarV2/useSearchBarApi.d.ts +1 -0
  14. package/build/care/components/organisms/bookingSearchBarV3/SearchResultContent.d.ts +13 -0
  15. package/build/care/components/organisms/bookingSearchBarV3/constants.d.ts +4 -0
  16. package/build/care/components/organisms/bookingSearchBarV3/index.d.ts +42 -0
  17. package/build/care/components/organisms/bookingSearchBarV3/index.styled.d.ts +16 -0
  18. package/build/care/components/organisms/bookingSearchBarV3/reducer.d.ts +166 -0
  19. package/build/care/components/organisms/bookingSearchBarV3/searchInputs/ModalSearchResult.d.ts +8 -0
  20. package/build/care/components/organisms/bookingSearchBarV3/searchInputs/index.d.ts +35 -0
  21. package/build/care/components/organisms/bookingSearchBarV3/searchInputs/index.styled.d.ts +17 -0
  22. package/build/care/components/organisms/bookingSearchBarV3/searchLocation/CustomSelectItem.d.ts +9 -0
  23. package/build/care/components/organisms/bookingSearchBarV3/searchLocation/index.d.ts +16 -0
  24. package/build/care/components/organisms/bookingSearchBarV3/searchLocation/index.styled.d.ts +21 -0
  25. package/build/care/components/organisms/bookingSearchBarV3/searchResult/icons.d.ts +5 -0
  26. package/build/care/components/organisms/bookingSearchBarV3/searchResult/index.d.ts +22 -0
  27. package/build/care/components/organisms/bookingSearchBarV3/searchResult/index.styled.d.ts +21 -0
  28. package/build/care/components/organisms/bookingSearchBarV3/searchResultSpecialties/index.d.ts +12 -0
  29. package/build/care/components/organisms/bookingSearchBarV3/searchResultSpecialties/index.styled.d.ts +16 -0
  30. package/build/care/components/organisms/bookingSearchBarV3/searchSpecialty/CustomSelectItem.d.ts +9 -0
  31. package/build/care/components/organisms/bookingSearchBarV3/searchSpecialty/index.d.ts +15 -0
  32. package/build/care/components/organisms/bookingSearchBarV3/searchSpecialty/index.styled.d.ts +13 -0
  33. package/build/care/components/organisms/bookingSearchBarV3/searchTag/index.d.ts +17 -0
  34. package/build/care/components/organisms/bookingSearchBarV3/searchTag/index.styled.d.ts +13 -0
  35. package/build/care/components/organisms/bookingSearchBarV3/tabSearch/index.d.ts +11 -0
  36. package/build/care/components/organisms/bookingSearchBarV3/tabSearch/index.styled.d.ts +8 -0
  37. package/build/care/components/organisms/bookingSearchBarV3/types.d.ts +17 -0
  38. package/build/care/components/organisms/bookingSearchBarV3/useSearchBarApi.d.ts +21 -0
  39. package/build/care/index.d.ts +1 -0
  40. package/build/care.js +23 -22
  41. package/build/careBookingSearchBar.js +14 -14
  42. package/build/careBookingSearchBarV2.js +80 -43
  43. package/build/components/atoms/inputMB/index.styled.d.ts +3 -3
  44. package/build/components/molecules/productDetail/generalInfo/GeneralInfo.d.ts +2 -1
  45. package/build/components/molecules/productDetail/generalInfo/index.styled.d.ts +17 -0
  46. package/build/components/navigationV2/index.d.ts +1 -0
  47. package/build/components.js +106 -106
  48. package/build/{constants-e20852df.js → constants-56907a6e.js} +1 -1
  49. package/build/{constants-3a21c7d8.js → constants-8ba2c2d9.js} +2 -2
  50. package/build/constants.js +3 -3
  51. package/build/constantsDomainLocales.js +1 -1
  52. package/build/constantsRiskScreener.js +2 -2
  53. package/build/constantsSite.js +2 -2
  54. package/build/{core-8316d9b0.js → core-c56cb13e.js} +1 -1
  55. package/build/{dataTransform-d4547b46.js → dataTransform-e14692d1.js} +1 -1
  56. package/build/ecom.js +5 -5
  57. package/build/{editor-69c86729.js → editor-1a32811c.js} +11 -11
  58. package/build/embeddedHeathToolCards_babyGrowth.js +25 -25
  59. package/build/embeddedHeathToolCards_babyPoop.js +22 -22
  60. package/build/embeddedHeathToolCards_babyVaccine.js +24 -24
  61. package/build/embeddedHeathToolCards_bmi_bmi.js +27 -27
  62. package/build/embeddedHeathToolCards_bmrBmr.js +27 -27
  63. package/build/embeddedHeathToolCards_dueDate_dueDate.js +24 -24
  64. package/build/embeddedHeathToolCards_ovulation_ovulation.js +24 -24
  65. package/build/embeddedHeathToolCards_pwg_pwg.js +28 -28
  66. package/build/embeddedHeathToolCards_targetHeartRate.js +29 -29
  67. package/build/esm/{InputDate-3420bfc7.js → InputDate-e2041c8a.js} +5 -5
  68. package/build/esm/{LastPeriod-4500bb2e.js → LastPeriod-cc10634f.js} +1 -1
  69. package/build/esm/{MobileBottomNavigationIcon-e2cda9e5.js → MobileBottomNavigationIcon-e63c2cf5.js} +3 -3
  70. package/build/esm/{SiteWideBanner-87116d0b.js → SiteWideBanner-82d6fde8.js} +11 -11
  71. package/build/esm/{Spinner-3eacd1a4.js → Spinner-01c894ca.js} +1 -1
  72. package/build/esm/{WhatsApp-debd0829.js → WhatsApp-ed941fb0.js} +1 -1
  73. package/build/esm/adapters.js +20 -20
  74. package/build/esm/atoms.js +51 -51
  75. package/build/esm/babyGrowth.js +86 -86
  76. package/build/esm/cache.js +2 -2
  77. package/build/esm/care/components/organisms/bookingSearchBarV2/index.d.ts +1 -1
  78. package/build/esm/care/components/organisms/bookingSearchBarV2/reducer.d.ts +4 -0
  79. package/build/esm/care/components/organisms/bookingSearchBarV2/useSearchBarApi.d.ts +1 -0
  80. package/build/esm/care/components/organisms/bookingSearchBarV3/SearchResultContent.d.ts +13 -0
  81. package/build/esm/care/components/organisms/bookingSearchBarV3/constants.d.ts +4 -0
  82. package/build/esm/care/components/organisms/bookingSearchBarV3/index.d.ts +42 -0
  83. package/build/esm/care/components/organisms/bookingSearchBarV3/index.styled.d.ts +16 -0
  84. package/build/esm/care/components/organisms/bookingSearchBarV3/reducer.d.ts +166 -0
  85. package/build/esm/care/components/organisms/bookingSearchBarV3/searchInputs/ModalSearchResult.d.ts +8 -0
  86. package/build/esm/care/components/organisms/bookingSearchBarV3/searchInputs/index.d.ts +35 -0
  87. package/build/esm/care/components/organisms/bookingSearchBarV3/searchInputs/index.styled.d.ts +17 -0
  88. package/build/esm/care/components/organisms/bookingSearchBarV3/searchLocation/CustomSelectItem.d.ts +9 -0
  89. package/build/esm/care/components/organisms/bookingSearchBarV3/searchLocation/index.d.ts +16 -0
  90. package/build/esm/care/components/organisms/bookingSearchBarV3/searchLocation/index.styled.d.ts +21 -0
  91. package/build/esm/care/components/organisms/bookingSearchBarV3/searchResult/icons.d.ts +5 -0
  92. package/build/esm/care/components/organisms/bookingSearchBarV3/searchResult/index.d.ts +22 -0
  93. package/build/esm/care/components/organisms/bookingSearchBarV3/searchResult/index.styled.d.ts +21 -0
  94. package/build/esm/care/components/organisms/bookingSearchBarV3/searchResultSpecialties/index.d.ts +12 -0
  95. package/build/esm/care/components/organisms/bookingSearchBarV3/searchResultSpecialties/index.styled.d.ts +16 -0
  96. package/build/esm/care/components/organisms/bookingSearchBarV3/searchSpecialty/CustomSelectItem.d.ts +9 -0
  97. package/build/esm/care/components/organisms/bookingSearchBarV3/searchSpecialty/index.d.ts +15 -0
  98. package/build/esm/care/components/organisms/bookingSearchBarV3/searchSpecialty/index.styled.d.ts +13 -0
  99. package/build/esm/care/components/organisms/bookingSearchBarV3/searchTag/index.d.ts +17 -0
  100. package/build/esm/care/components/organisms/bookingSearchBarV3/searchTag/index.styled.d.ts +13 -0
  101. package/build/esm/care/components/organisms/bookingSearchBarV3/tabSearch/index.d.ts +11 -0
  102. package/build/esm/care/components/organisms/bookingSearchBarV3/tabSearch/index.styled.d.ts +8 -0
  103. package/build/esm/care/components/organisms/bookingSearchBarV3/types.d.ts +17 -0
  104. package/build/esm/care/components/organisms/bookingSearchBarV3/useSearchBarApi.d.ts +21 -0
  105. package/build/esm/care/index.d.ts +1 -0
  106. package/build/esm/care.js +22 -22
  107. package/build/esm/careBookingSearchBar.js +14 -14
  108. package/build/esm/careBookingSearchBarV2.js +80 -43
  109. package/build/esm/components/atoms/inputMB/index.styled.d.ts +3 -3
  110. package/build/esm/components/molecules/productDetail/generalInfo/GeneralInfo.d.ts +2 -1
  111. package/build/esm/components/molecules/productDetail/generalInfo/index.styled.d.ts +17 -0
  112. package/build/esm/components/navigationV2/index.d.ts +1 -0
  113. package/build/esm/components.js +106 -106
  114. package/build/esm/{constants-16201577.js → constants-2174749d.js} +1 -1
  115. package/build/esm/{constants-59626435.js → constants-a557b9d0.js} +2 -2
  116. package/build/esm/constants.js +3 -3
  117. package/build/esm/constantsDomainLocales.js +1 -1
  118. package/build/esm/constantsRiskScreener.js +2 -2
  119. package/build/esm/constantsSite.js +2 -2
  120. package/build/esm/{core-5732fbaa.js → core-0d2edfa6.js} +1 -1
  121. package/build/esm/{dataTransform-7672f645.js → dataTransform-4c555860.js} +1 -1
  122. package/build/esm/ecom.js +5 -5
  123. package/build/esm/{editor-67f45072.js → editor-241bbec0.js} +11 -11
  124. package/build/esm/embeddedHeathToolCards_babyGrowth.js +25 -25
  125. package/build/esm/embeddedHeathToolCards_babyPoop.js +22 -22
  126. package/build/esm/embeddedHeathToolCards_babyVaccine.js +24 -24
  127. package/build/esm/embeddedHeathToolCards_bmi_bmi.js +27 -27
  128. package/build/esm/embeddedHeathToolCards_bmrBmr.js +27 -27
  129. package/build/esm/embeddedHeathToolCards_dueDate_dueDate.js +24 -24
  130. package/build/esm/embeddedHeathToolCards_ovulation_ovulation.js +24 -24
  131. package/build/esm/embeddedHeathToolCards_pwg_pwg.js +28 -28
  132. package/build/esm/embeddedHeathToolCards_targetHeartRate.js +29 -29
  133. package/build/esm/footer.js +22 -22
  134. package/build/esm/gAssets.js +2 -2
  135. package/build/esm/{healthTools-42e7a7b9.js → healthTools-08ea20cc.js} +1 -1
  136. package/build/esm/healthToolsCardWrapper.js +20 -20
  137. package/build/esm/healthToolsForm.js +35 -35
  138. package/build/esm/hooks.js +14 -14
  139. package/build/esm/i18n.js +2 -2
  140. package/build/esm/i18nV2.js +2 -2
  141. package/build/esm/{index-e8c2e6c9.js → index-00a2d0a5.js} +3 -3
  142. package/build/esm/{index-7e397e89.js → index-0306126d.js} +1 -1
  143. package/build/esm/{index-ab671c88.js → index-03c7ef3c.js} +16 -16
  144. package/build/esm/{index-2199aed8.js → index-07d7fa7a.js} +14 -14
  145. package/build/esm/{index-273f9554.js → index-0b392883.js} +2 -2
  146. package/build/esm/{index-0de117d1.js → index-0f7518c4.js} +16 -16
  147. package/build/esm/{index-bf6cee2d.js → index-152b43af.js} +24 -24
  148. package/build/esm/{index-c7e7d049.js → index-1612a72d.js} +16 -16
  149. package/build/esm/{index-4a9e91c4.js → index-16d1960b.js} +7 -7
  150. package/build/esm/{index-be1ca808.js → index-17038345.js} +1 -1
  151. package/build/esm/{index-9bc8c421.js → index-17700426.js} +2 -2
  152. package/build/esm/{index-414d2c76.js → index-19289b55.js} +25 -25
  153. package/build/esm/{index-736dd019.js → index-1ccd0230.js} +19 -19
  154. package/build/esm/{index-cd098b14.js → index-1f0bffca.js} +4 -4
  155. package/build/esm/{index-aa78b83c.js → index-21d9c6ab.js} +1 -1
  156. package/build/esm/{index-daf4f774.js → index-2204a055.js} +2 -2
  157. package/build/esm/{index-b7941c48.js → index-25c8c3f5.js} +9 -9
  158. package/build/esm/{index-6fef1f19.js → index-286c0764.js} +5 -5
  159. package/build/esm/{index-04d1ff54.js → index-29acb243.js} +32 -32
  160. package/build/esm/{index-8884c688.js → index-2c5bc0c5.js} +3 -3
  161. package/build/esm/{index-791dd7bb.js → index-31b7b93d.js} +6 -6
  162. package/build/esm/{index-22e24f71.js → index-3787acaa.js} +18 -18
  163. package/build/esm/{index-41fc1e34.js → index-398aff17.js} +5 -5
  164. package/build/esm/{index-e63f53b5.js → index-3abc069c.js} +2 -2
  165. package/build/esm/{index-a57b3df3.js → index-460b42dd.js} +3 -3
  166. package/build/esm/{index-cfaad2c1.js → index-4aa2e2c7.js} +2 -2
  167. package/build/esm/{index-906251f1.js → index-4f1e3d44.js} +2 -2
  168. package/build/esm/{index-43ad9ae9.js → index-50a0d983.js} +16 -16
  169. package/build/esm/{index-0be2132d.js → index-50fab981.js} +2 -2
  170. package/build/esm/{index-ca38a8a8.js → index-5146f064.js} +8 -8
  171. package/build/esm/{index-9123f2b2.js → index-589a8c97.js} +2 -2
  172. package/build/esm/{index-e55ab051.js → index-59c9cb53.js} +14 -14
  173. package/build/esm/{index-82ea6b51.js → index-59edc46c.js} +1 -1
  174. package/build/esm/{index-688bae11.js → index-5c558776.js} +22 -22
  175. package/build/esm/{index-ce4660b7.js → index-5c96b8d4.js} +2 -2
  176. package/build/esm/{index-40680903.js → index-63ab7d6d.js} +9 -9
  177. package/build/esm/{index-7efaa78b.js → index-705d2b85.js} +3 -3
  178. package/build/esm/{index-046f8a94.js → index-742b3969.js} +2 -2
  179. package/build/esm/index-77437793.js +1942 -0
  180. package/build/esm/{index-08e91215.js → index-7a5c2f3a.js} +2 -2
  181. package/build/esm/{index-397555b2.js → index-7d09ad39.js} +13 -13
  182. package/build/esm/{index-1e1be313.js → index-85f40b33.js} +3 -3
  183. package/build/esm/{index-7be2a6c5.js → index-862bf9ac.js} +6 -6
  184. package/build/esm/{index-8c10789d.js → index-8a36560f.js} +15 -15
  185. package/build/esm/{index-1baa4743.js → index-8fc31825.js} +6 -6
  186. package/build/esm/{index-2b169a42.js → index-91b93ece.js} +7 -7
  187. package/build/esm/{index-0e1f889f.js → index-94401d2c.js} +15 -15
  188. package/build/esm/{index-82c660c9.js → index-96004df4.js} +45 -41
  189. package/build/esm/{index-27bcc449.js → index-9cb4dd03.js} +3 -3
  190. package/build/esm/{index-451adb11.js → index-a0427cd0.js} +2 -2
  191. package/build/esm/{index-d43283bc.js → index-a6b5f834.js} +4 -4
  192. package/build/esm/{index-18b703fe.js → index-aa55fa5d.js} +1 -1
  193. package/build/esm/{index-69b65e96.js → index-ab13b8f0.js} +6 -6
  194. package/build/esm/{index-7ff08ba4.js → index-abf25895.js} +3 -3
  195. package/build/esm/{index-988b6c84.js → index-b2aa92d2.js} +3 -3
  196. package/build/esm/{index-4dae24b1.js → index-b64b8736.js} +14 -14
  197. package/build/esm/{index-3dd8edb7.js → index-b940415f.js} +17 -17
  198. package/build/esm/{index-d6b28d0d.js → index-c0fd4b3b.js} +18 -18
  199. package/build/esm/{index-73f941bb.js → index-c10f0000.js} +2 -2
  200. package/build/esm/{index-3429f618.js → index-cb152084.js} +21 -21
  201. package/build/esm/{index-c83a09c0.js → index-d66c2801.js} +2 -2
  202. package/build/esm/{index-fa4f9eb1.js → index-d6c3637f.js} +3 -3
  203. package/build/esm/{index-fbefdc4d.js → index-d959acd0.js} +15 -15
  204. package/build/esm/{index-116875d5.js → index-db03c129.js} +32 -32
  205. package/build/esm/{index-6575cb41.js → index-e13d8115.js} +2 -2
  206. package/build/esm/{index-0605c7c1.js → index-e1e9ae9e.js} +13 -13
  207. package/build/esm/{index-47062fae.js → index-ec3acd03.js} +1 -1
  208. package/build/esm/{index-5c287948.js → index-ef4f86be.js} +1 -1
  209. package/build/esm/{index-16c5d8bd.js → index-f1a11282.js} +11 -11
  210. package/build/esm/{index-4bd0b733.js → index-f1c680bc.js} +2 -2
  211. package/build/esm/{index-8a455ff2.js → index-fc6fd7ab.js} +3 -3
  212. package/build/esm/index.js +126 -126
  213. package/build/esm/{labelSorting-b17abb6e.js → labelSorting-2f22a39f.js} +4 -4
  214. package/build/esm/lead.js +37 -37
  215. package/build/esm/{logoIcon-14a04af1.js → logoIcon-46f36b72.js} +2 -2
  216. package/build/esm/mantine.js +27 -27
  217. package/build/esm/misc.js +19 -19
  218. package/build/esm/miscGetDynamicHealthTool.js +4 -4
  219. package/build/esm/miscGetSocialList.js +8 -8
  220. package/build/esm/miscScreenSizeContext.js +1 -1
  221. package/build/esm/mobileBottomNavigation.js +5 -5
  222. package/build/esm/mobileBottomNavigationIcon.js +5 -5
  223. package/build/esm/molecules.js +79 -79
  224. package/build/esm/moleculesArticleCard.js +6 -6
  225. package/build/esm/moleculesArticleCardV2.js +17 -17
  226. package/build/esm/navigation.js +49 -49
  227. package/build/esm/navigationLogoutPopup.js +11 -11
  228. package/build/esm/navigationProfileButton.js +27 -27
  229. package/build/esm/onboardingV2.js +30 -30
  230. package/build/esm/organisms.js +62 -62
  231. package/build/esm/{post-e76b246c.js → post-47628cc3.js} +2 -2
  232. package/build/esm/profileNavigation.js +20 -20
  233. package/build/esm/progressBar.js +1 -1
  234. package/build/esm/pwg.js +23 -23
  235. package/build/esm/ssoV2/screens/updateEmail.d.ts +4 -2
  236. package/build/esm/ssoV2/ssoStateManager/store.d.ts +1 -0
  237. package/build/esm/ssoV2.js +88 -70
  238. package/build/esm/{store-fc6a5924.js → store-ea24664f.js} +37 -28
  239. package/build/esm/subot.js +40 -40
  240. package/build/esm/surveyOrPremiumBanner.js +34 -34
  241. package/build/esm/surveyQuestionCard.js +11 -11
  242. package/build/esm/{surveyThankyouCard-f74d24de.js → surveyThankyouCard-51a839a5.js} +5 -5
  243. package/build/esm/together.js +57 -57
  244. package/build/esm/togetherApiUtils.js +6 -6
  245. package/build/esm/togetherAtoms.js +31 -31
  246. package/build/esm/togetherComponentGlobalContext.js +6 -6
  247. package/build/esm/togetherMolecules.js +52 -52
  248. package/build/esm/togetherMoleculesCardAuthor.js +29 -29
  249. package/build/esm/togetherMoleculesPostImagePreview.js +13 -13
  250. package/build/esm/togetherMoleculesProfileDetail.js +40 -40
  251. package/build/esm/togetherOrganisms.js +51 -51
  252. package/build/esm/togetherRichTextEditor.js +20 -20
  253. package/build/esm/togetherShareBox.js +12 -12
  254. package/build/esm/{transform-297526f2.js → transform-e17caf97.js} +107 -50
  255. package/build/esm/{translationsProvider-f07172aa.js → translationsProvider-68daa913.js} +1 -1
  256. package/build/esm/{treePopoverMenu-1cc0d3af.js → treePopoverMenu-8cead57a.js} +19 -19
  257. package/build/esm/types.js +2 -2
  258. package/build/esm/{useCartCareService-b9ebe3f2.js → useCartCareService-3f1b32d4.js} +1 -1
  259. package/build/esm/{useHealthToolCache-86f4394b.js → useHealthToolCache-03e9947d.js} +1 -1
  260. package/build/esm/{usePhoneValidator-2ebf8f1e.js → usePhoneValidator-5b2d3637.js} +5 -5
  261. package/build/esm/{usePlacesAutocomplete-4c3a32ba.js → usePlacesAutocomplete-2ee155f5.js} +1 -1
  262. package/build/esm/useTogetherAuthRequiredAction.js +10 -10
  263. package/build/esm/{utils-57635f8e.js → utils-379beb45.js} +3 -3
  264. package/build/esm/{utils-6908ac1c.js → utils-4e8d8e1b.js} +2 -2
  265. package/build/esm/{utils-fdf46ea7.js → utils-89f47b19.js} +3 -3
  266. package/build/esm/{utils-ab3b27b1.js → utils-be6d6cd0.js} +2 -2
  267. package/build/esm/{utils-e0aaeb78.js → utils-e47e8dff.js} +5 -5
  268. package/build/esm/vaccination.js +22 -22
  269. package/build/footer.js +22 -22
  270. package/build/gAssets.js +2 -2
  271. package/build/{healthTools-9fe9dfd9.js → healthTools-7fc798ed.js} +1 -1
  272. package/build/healthToolsCardWrapper.js +20 -20
  273. package/build/healthToolsForm.js +35 -35
  274. package/build/hooks.js +14 -14
  275. package/build/i18n.js +2 -2
  276. package/build/i18nV2.js +1 -1
  277. package/build/{index-83dff660.js → index-002e9fed.js} +1 -1
  278. package/build/{index-eb0f49a0.js → index-05bef6e0.js} +1 -1
  279. package/build/{index-b9b15f54.js → index-061c8466.js} +13 -13
  280. package/build/{index-d6732df0.js → index-0d0f6e42.js} +17 -17
  281. package/build/{index-0f302893.js → index-119fb757.js} +6 -6
  282. package/build/{index-505e45c4.js → index-11e54b2a.js} +45 -41
  283. package/build/{index-afd06067.js → index-125aaba9.js} +6 -6
  284. package/build/{index-15551580.js → index-12b53f3e.js} +9 -9
  285. package/build/{index-4cca0410.js → index-183989e7.js} +2 -2
  286. package/build/{index-788c0611.js → index-199b0459.js} +2 -2
  287. package/build/{index-785cbff4.js → index-1bf0e018.js} +3 -3
  288. package/build/{index-f61200a8.js → index-206a328e.js} +15 -15
  289. package/build/{index-280f6c67.js → index-2faf419a.js} +3 -3
  290. package/build/{index-a5f774be.js → index-3987e4cd.js} +14 -14
  291. package/build/{index-5583ddd8.js → index-3aa59173.js} +1 -1
  292. package/build/{index-a82cd35a.js → index-3ce2be3a.js} +18 -18
  293. package/build/{index-d2bd333a.js → index-42cb09f4.js} +2 -2
  294. package/build/{index-4e2565fc.js → index-49d43f8c.js} +2 -2
  295. package/build/{index-d8d1ca7b.js → index-4bee9299.js} +16 -16
  296. package/build/index-4f1ec26c.js +1951 -0
  297. package/build/{index-eb2e5fda.js → index-51ec6af6.js} +6 -6
  298. package/build/{index-57ab8801.js → index-5224b428.js} +2 -2
  299. package/build/{index-0c879b91.js → index-53b6d8e0.js} +16 -16
  300. package/build/{index-71892a7b.js → index-5e215c19.js} +3 -3
  301. package/build/{index-b6ee1315.js → index-6302c0d3.js} +2 -2
  302. package/build/{index-d4fa0597.js → index-6347f6a6.js} +15 -15
  303. package/build/{index-f1d21d7c.js → index-66afe4db.js} +11 -11
  304. package/build/{index-8a481d36.js → index-6ac2b388.js} +15 -15
  305. package/build/{index-b2c81337.js → index-6b3262a0.js} +4 -4
  306. package/build/{index-77383f92.js → index-6c703e96.js} +13 -13
  307. package/build/{index-c853777a.js → index-6c8467cb.js} +16 -16
  308. package/build/{index-d5924135.js → index-71f92d1f.js} +3 -3
  309. package/build/{index-52f6caec.js → index-7306c60c.js} +2 -2
  310. package/build/{index-a5e72e15.js → index-7930bfef.js} +24 -24
  311. package/build/{index-cb0aa52f.js → index-83f3e70b.js} +21 -21
  312. package/build/{index-1b906d4f.js → index-842e4826.js} +1 -1
  313. package/build/{index-7ab2566d.js → index-87a8d36f.js} +9 -9
  314. package/build/{index-1b1002f1.js → index-90e118bb.js} +16 -16
  315. package/build/{index-e5a568b3.js → index-94168dea.js} +3 -3
  316. package/build/{index-d1ca7674.js → index-95b286eb.js} +7 -7
  317. package/build/{index-46a710ec.js → index-998b5cb7.js} +1 -1
  318. package/build/{index-e3a714d4.js → index-9a689b00.js} +3 -3
  319. package/build/{index-cdfa3535.js → index-9b69f54c.js} +19 -19
  320. package/build/{index-899ad2a2.js → index-9b7f4ba3.js} +5 -5
  321. package/build/{index-aada2704.js → index-a05aac91.js} +7 -7
  322. package/build/{index-64076e02.js → index-a5fe8a1a.js} +6 -6
  323. package/build/{index-35211b73.js → index-afcdf1d6.js} +2 -2
  324. package/build/{index-54f9b1df.js → index-afdd1016.js} +1 -1
  325. package/build/{index-22716e8c.js → index-b2eaf609.js} +8 -8
  326. package/build/{index-1c7debb5.js → index-bab93404.js} +14 -14
  327. package/build/{index-78690e6b.js → index-baf7967c.js} +5 -5
  328. package/build/{index-e161545f.js → index-bb16ab65.js} +32 -32
  329. package/build/{index-ee7a5f96.js → index-bbf9f509.js} +22 -22
  330. package/build/{index-5cc38720.js → index-bc7fb5c4.js} +18 -18
  331. package/build/{index-134db9fe.js → index-c1b30807.js} +2 -2
  332. package/build/{index-3876f3ec.js → index-c41a00bc.js} +1 -1
  333. package/build/{index-ec32e690.js → index-c60db057.js} +3 -3
  334. package/build/{index-e8388cd0.js → index-c7c4397f.js} +2 -2
  335. package/build/{index-b9297c0a.js → index-c7dd8e57.js} +2 -2
  336. package/build/{index-5ddd0abf.js → index-cf94f02f.js} +3 -3
  337. package/build/{index-de28f501.js → index-d4c80dda.js} +2 -2
  338. package/build/{index-c0e68eb1.js → index-e5f3caba.js} +2 -2
  339. package/build/{index-d4b08a69.js → index-e819bc1e.js} +3 -3
  340. package/build/{index-35229d9d.js → index-eb3fa0eb.js} +14 -14
  341. package/build/{index-09d9c4e1.js → index-ee8d1193.js} +2 -2
  342. package/build/{index-0191b011.js → index-ef389873.js} +32 -32
  343. package/build/{index-eca125e1.js → index-f13c51fa.js} +2 -2
  344. package/build/{index-81d0eb08.js → index-f7b8da0f.js} +4 -4
  345. package/build/{index-ae64358d.js → index-f9296f17.js} +25 -25
  346. package/build/{index-a53f780c.js → index-fcdc6a3c.js} +2 -2
  347. package/build/{index-507ed8f1.js → index-ff503ec9.js} +3 -3
  348. package/build/index.js +127 -126
  349. package/build/{labelSorting-c1a564e4.js → labelSorting-3e15783f.js} +4 -4
  350. package/build/lead.js +37 -37
  351. package/build/{logoIcon-ad8866f2.js → logoIcon-45908e83.js} +2 -2
  352. package/build/mantine.js +25 -25
  353. package/build/misc.js +19 -19
  354. package/build/miscGetDynamicHealthTool.js +4 -4
  355. package/build/miscGetSocialList.js +8 -8
  356. package/build/miscScreenSizeContext.js +1 -1
  357. package/build/mobileBottomNavigation.js +5 -5
  358. package/build/mobileBottomNavigationIcon.js +5 -5
  359. package/build/molecules.js +79 -79
  360. package/build/moleculesArticleCard.js +6 -6
  361. package/build/moleculesArticleCardV2.js +17 -17
  362. package/build/navigation.js +49 -49
  363. package/build/navigationLogoutPopup.js +11 -11
  364. package/build/navigationProfileButton.js +27 -27
  365. package/build/onboardingV2.js +29 -29
  366. package/build/organisms.js +62 -62
  367. package/build/{post-9d5daee8.js → post-0069fcf8.js} +2 -2
  368. package/build/profileNavigation.js +20 -20
  369. package/build/progressBar.js +1 -1
  370. package/build/pwg.js +23 -23
  371. package/build/ssoV2/screens/updateEmail.d.ts +4 -2
  372. package/build/ssoV2/ssoStateManager/store.d.ts +1 -0
  373. package/build/ssoV2.js +86 -68
  374. package/build/{store-86e21011.js → store-4d67d273.js} +37 -28
  375. package/build/subot.js +39 -39
  376. package/build/surveyOrPremiumBanner.js +34 -34
  377. package/build/surveyQuestionCard.js +11 -11
  378. package/build/{surveyThankyouCard-610d5b88.js → surveyThankyouCard-232f9bab.js} +5 -5
  379. package/build/together.js +57 -57
  380. package/build/togetherApiUtils.js +6 -6
  381. package/build/togetherAtoms.js +31 -31
  382. package/build/togetherComponentGlobalContext.js +6 -6
  383. package/build/togetherMolecules.js +52 -52
  384. package/build/togetherMoleculesCardAuthor.js +29 -29
  385. package/build/togetherMoleculesPostImagePreview.js +13 -13
  386. package/build/togetherMoleculesProfileDetail.js +40 -40
  387. package/build/togetherOrganisms.js +51 -51
  388. package/build/togetherRichTextEditor.js +20 -20
  389. package/build/togetherShareBox.js +12 -12
  390. package/build/{transform-3290cdc9.js → transform-48175ddc.js} +107 -50
  391. package/build/{translationsProvider-e38e396d.js → translationsProvider-a5b158b5.js} +1 -1
  392. package/build/{treePopoverMenu-6bf3247e.js → treePopoverMenu-fca9506c.js} +19 -19
  393. package/build/types.js +2 -2
  394. package/build/{useCartCareService-d0cfd97e.js → useCartCareService-3abad098.js} +1 -1
  395. package/build/{useHealthToolCache-1d7b3d5c.js → useHealthToolCache-08348579.js} +1 -1
  396. package/build/{usePhoneValidator-58480759.js → usePhoneValidator-1dc81fce.js} +5 -5
  397. package/build/{usePlacesAutocomplete-7b28f0b4.js → usePlacesAutocomplete-c9eaf581.js} +1 -1
  398. package/build/useTogetherAuthRequiredAction.js +10 -10
  399. package/build/{utils-9eece90c.js → utils-0344581f.js} +3 -3
  400. package/build/{utils-d20ab2ad.js → utils-09f5de76.js} +2 -2
  401. package/build/{utils-496193ed.js → utils-16bceda6.js} +3 -3
  402. package/build/{utils-8330c5d1.js → utils-5110973d.js} +2 -2
  403. package/build/{utils-0b3fa7ad.js → utils-55dbe0c1.js} +5 -5
  404. package/build/vaccination.js +22 -22
  405. package/package.json +1 -1
  406. package/build/esm/index-be7ac01b.js +0 -31
  407. package/build/index-dabb369d.js +0 -38
  408. /package/build/{BMI_BOYS.percentile.monthly-6091271d.js → BMI_BOYS.percentile.monthly-6f3bafd3.js} +0 -0
  409. /package/build/{BMI_BOYS.percentile.weekly-27cc9915.js → BMI_BOYS.percentile.weekly-0ac2b355.js} +0 -0
  410. /package/build/{BMI_BOYS.percentile.yearly-10a5e3c0.js → BMI_BOYS.percentile.yearly-c5adedb8.js} +0 -0
  411. /package/build/{BMI_BOYS.zscore.monthly-ea61198c.js → BMI_BOYS.zscore.monthly-ceb37cd6.js} +0 -0
  412. /package/build/{BMI_BOYS.zscore.weekly-d3739585.js → BMI_BOYS.zscore.weekly-721dfcda.js} +0 -0
  413. /package/build/{BMI_BOYS.zscore.yearly-7b0cd2c0.js → BMI_BOYS.zscore.yearly-e673b98e.js} +0 -0
  414. /package/build/{BMI_GIRLS.percentile.monthly-eb6735af.js → BMI_GIRLS.percentile.monthly-cb7b1542.js} +0 -0
  415. /package/build/{BMI_GIRLS.percentile.weekly-a5477a8a.js → BMI_GIRLS.percentile.weekly-1b61a0f3.js} +0 -0
  416. /package/build/{BMI_GIRLS.percentile.yearly-4e7a8798.js → BMI_GIRLS.percentile.yearly-d3f599d5.js} +0 -0
  417. /package/build/{BMI_GIRLS.zscore.monthly-517dff6e.js → BMI_GIRLS.zscore.monthly-a2262b56.js} +0 -0
  418. /package/build/{BMI_GIRLS.zscore.weekly-ddc23d6b.js → BMI_GIRLS.zscore.weekly-07cf3fa6.js} +0 -0
  419. /package/build/{BMI_GIRLS.zscore.yearly-343d6b08.js → BMI_GIRLS.zscore.yearly-5af58bc6.js} +0 -0
  420. /package/build/{ChevronDown-b4e1df18.js → ChevronDown-78142477.js} +0 -0
  421. /package/build/{Close-eef05a78.js → Close-a91b5db8.js} +0 -0
  422. /package/build/{Google-be52306b.js → Google-25b9eb63.js} +0 -0
  423. /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-51174f35.js → HEAD CIRCUM_BOYS.percentile.monthly-92ad296d.js} +0 -0
  424. /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-3630148c.js → HEAD CIRCUM_BOYS.percentile.weekly-00c6ce3c.js} +0 -0
  425. /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-732e6569.js → HEAD CIRCUM_BOYS.percentile.yearly-ef5668a9.js} +0 -0
  426. /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-45229141.js → HEAD CIRCUM_BOYS.zscore.monthly-75112d60.js} +0 -0
  427. /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-4727e70f.js → HEAD CIRCUM_BOYS.zscore.weekly-ac699513.js} +0 -0
  428. /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-41d3693e.js → HEAD CIRCUM_BOYS.zscore.yearly-ab2798c9.js} +0 -0
  429. /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-577f4ed0.js → HEAD CIRCUM_GIRLS.percentile.monthly-7b9ac58a.js} +0 -0
  430. /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-b999e9b0.js → HEAD CIRCUM_GIRLS.percentile.weekly-33e63373.js} +0 -0
  431. /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-d72e0d07.js → HEAD CIRCUM_GIRLS.percentile.yearly-5e180a04.js} +0 -0
  432. /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-74b93dcc.js → HEAD CIRCUM_GIRLS.zscore.monthly-a2006f4e.js} +0 -0
  433. /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-4824747d.js → HEAD CIRCUM_GIRLS.zscore.weekly-e77127d4.js} +0 -0
  434. /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-3d27682b.js → HEAD CIRCUM_GIRLS.zscore.yearly-6ee5ba17.js} +0 -0
  435. /package/build/{HEIGHT_BOYS.percentile.monthly-cf725d3a.js → HEIGHT_BOYS.percentile.monthly-87f96520.js} +0 -0
  436. /package/build/{HEIGHT_BOYS.percentile.weekly-3e534212.js → HEIGHT_BOYS.percentile.weekly-620dc58b.js} +0 -0
  437. /package/build/{HEIGHT_BOYS.percentile.yearly-b5af53e3.js → HEIGHT_BOYS.percentile.yearly-04f7c9ed.js} +0 -0
  438. /package/build/{HEIGHT_BOYS.zscore.monthly-d30d9eaf.js → HEIGHT_BOYS.zscore.monthly-b3ee9fb7.js} +0 -0
  439. /package/build/{HEIGHT_BOYS.zscore.weekly-d20f484c.js → HEIGHT_BOYS.zscore.weekly-d1b93cf2.js} +0 -0
  440. /package/build/{HEIGHT_BOYS.zscore.yearly-93c9733c.js → HEIGHT_BOYS.zscore.yearly-d1c1406a.js} +0 -0
  441. /package/build/{HEIGHT_GIRLS.percentile.monthly-70db582b.js → HEIGHT_GIRLS.percentile.monthly-1a2cf6ef.js} +0 -0
  442. /package/build/{HEIGHT_GIRLS.percentile.weekly-7ed42a82.js → HEIGHT_GIRLS.percentile.weekly-fbe5150d.js} +0 -0
  443. /package/build/{HEIGHT_GIRLS.percentile.yearly-1fd072b5.js → HEIGHT_GIRLS.percentile.yearly-802fd167.js} +0 -0
  444. /package/build/{HEIGHT_GIRLS.zscore.monthly-9a7a62bd.js → HEIGHT_GIRLS.zscore.monthly-b410f775.js} +0 -0
  445. /package/build/{HEIGHT_GIRLS.zscore.weekly-45d8f6ff.js → HEIGHT_GIRLS.zscore.weekly-d76c195e.js} +0 -0
  446. /package/build/{HEIGHT_GIRLS.zscore.yearly-c4dcb07c.js → HEIGHT_GIRLS.zscore.yearly-09a6e6ba.js} +0 -0
  447. /package/build/{Locale-e037603c.js → Locale-1adac20a.js} +0 -0
  448. /package/build/{Visible-1817e8ab.js → Visible-422c1e1e.js} +0 -0
  449. /package/build/{WEIGHT_BOYS.percentile.monthly-d84ca033.js → WEIGHT_BOYS.percentile.monthly-be7f4b3b.js} +0 -0
  450. /package/build/{WEIGHT_BOYS.percentile.weekly-a6485cb1.js → WEIGHT_BOYS.percentile.weekly-86dbe68f.js} +0 -0
  451. /package/build/{WEIGHT_BOYS.percentile.yearly-fac8696b.js → WEIGHT_BOYS.percentile.yearly-ae8df08d.js} +0 -0
  452. /package/build/{WEIGHT_BOYS.zscore.monthly-3a019be0.js → WEIGHT_BOYS.zscore.monthly-e048c201.js} +0 -0
  453. /package/build/{WEIGHT_BOYS.zscore.weekly-6e10f3ac.js → WEIGHT_BOYS.zscore.weekly-3a4aa306.js} +0 -0
  454. /package/build/{WEIGHT_BOYS.zscore.yearly-c3bb2eb6.js → WEIGHT_BOYS.zscore.yearly-775374b3.js} +0 -0
  455. /package/build/{WEIGHT_GIRLS.percentile.monthly-4d8ba075.js → WEIGHT_GIRLS.percentile.monthly-016195eb.js} +0 -0
  456. /package/build/{WEIGHT_GIRLS.percentile.weekly-64c08f21.js → WEIGHT_GIRLS.percentile.weekly-eb9e678f.js} +0 -0
  457. /package/build/{WEIGHT_GIRLS.percentile.yearly-1acd7fe9.js → WEIGHT_GIRLS.percentile.yearly-deba1c91.js} +0 -0
  458. /package/build/{WEIGHT_GIRLS.zscore.monthly-768df209.js → WEIGHT_GIRLS.zscore.monthly-6fa23908.js} +0 -0
  459. /package/build/{WEIGHT_GIRLS.zscore.weekly-4e94e0e4.js → WEIGHT_GIRLS.zscore.weekly-ded0e6cf.js} +0 -0
  460. /package/build/{WEIGHT_GIRLS.zscore.yearly-84aea57f.js → WEIGHT_GIRLS.zscore.yearly-ea5dbbca.js} +0 -0
  461. /package/build/{ageGenerate-bb8dad8f.js → ageGenerate-2e4e2bf5.js} +0 -0
  462. /package/build/{animation-e0f945e9.js → animation-22ea32fd.js} +0 -0
  463. /package/build/{constants-f2a6b105.js → constants-829c91b8.js} +0 -0
  464. /package/build/{constants-78b1514b.js → constants-875ccef1.js} +0 -0
  465. /package/build/{context-c7fe357c.js → context-0697cc8f.js} +0 -0
  466. /package/build/{dataTransform-8d5fcf17.js → dataTransform-adee1ddc.js} +0 -0
  467. /package/build/esm/{BMI_BOYS.percentile.monthly-e427aa19.js → BMI_BOYS.percentile.monthly-15034c0a.js} +0 -0
  468. /package/build/esm/{BMI_BOYS.percentile.weekly-3ee9a2b1.js → BMI_BOYS.percentile.weekly-bafcdea6.js} +0 -0
  469. /package/build/esm/{BMI_BOYS.percentile.yearly-56a16668.js → BMI_BOYS.percentile.yearly-ce0a8928.js} +0 -0
  470. /package/build/esm/{BMI_BOYS.zscore.monthly-2fc06114.js → BMI_BOYS.zscore.monthly-395bcc2f.js} +0 -0
  471. /package/build/esm/{BMI_BOYS.zscore.weekly-2c502e1a.js → BMI_BOYS.zscore.weekly-9a9c6fb7.js} +0 -0
  472. /package/build/esm/{BMI_BOYS.zscore.yearly-4f317f05.js → BMI_BOYS.zscore.yearly-5e86ec5c.js} +0 -0
  473. /package/build/esm/{BMI_GIRLS.percentile.monthly-0c4618d4.js → BMI_GIRLS.percentile.monthly-50f03bc2.js} +0 -0
  474. /package/build/esm/{BMI_GIRLS.percentile.weekly-9129fe41.js → BMI_GIRLS.percentile.weekly-5051450f.js} +0 -0
  475. /package/build/esm/{BMI_GIRLS.percentile.yearly-900dac1f.js → BMI_GIRLS.percentile.yearly-4370e78b.js} +0 -0
  476. /package/build/esm/{BMI_GIRLS.zscore.monthly-c1d3470e.js → BMI_GIRLS.zscore.monthly-0a83b6f0.js} +0 -0
  477. /package/build/esm/{BMI_GIRLS.zscore.weekly-e059c66e.js → BMI_GIRLS.zscore.weekly-d2357001.js} +0 -0
  478. /package/build/esm/{BMI_GIRLS.zscore.yearly-831b845f.js → BMI_GIRLS.zscore.yearly-5c59103f.js} +0 -0
  479. /package/build/esm/{ChevronDown-fb1a6473.js → ChevronDown-0705855b.js} +0 -0
  480. /package/build/esm/{Close-14528d26.js → Close-e8669549.js} +0 -0
  481. /package/build/esm/{Google-83b0c254.js → Google-377917c7.js} +0 -0
  482. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.monthly-c235e1b3.js → HEAD CIRCUM_BOYS.percentile.monthly-32bd81ca.js} +0 -0
  483. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.weekly-e55f916f.js → HEAD CIRCUM_BOYS.percentile.weekly-a7be41bc.js} +0 -0
  484. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.yearly-281dc949.js → HEAD CIRCUM_BOYS.percentile.yearly-2d125456.js} +0 -0
  485. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.monthly-08908154.js → HEAD CIRCUM_BOYS.zscore.monthly-781d164d.js} +0 -0
  486. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.weekly-9e427235.js → HEAD CIRCUM_BOYS.zscore.weekly-099bdc95.js} +0 -0
  487. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.yearly-fa510309.js → HEAD CIRCUM_BOYS.zscore.yearly-4cfec8b7.js} +0 -0
  488. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.monthly-3e6ecd43.js → HEAD CIRCUM_GIRLS.percentile.monthly-502b521d.js} +0 -0
  489. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.weekly-7dd6d29d.js → HEAD CIRCUM_GIRLS.percentile.weekly-7f550316.js} +0 -0
  490. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.yearly-eb6f9c18.js → HEAD CIRCUM_GIRLS.percentile.yearly-ff74b017.js} +0 -0
  491. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.monthly-304e6442.js → HEAD CIRCUM_GIRLS.zscore.monthly-28bc1383.js} +0 -0
  492. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.weekly-e9767e93.js → HEAD CIRCUM_GIRLS.zscore.weekly-57548207.js} +0 -0
  493. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.yearly-fa0664b6.js → HEAD CIRCUM_GIRLS.zscore.yearly-50a37cbb.js} +0 -0
  494. /package/build/esm/{HEIGHT_BOYS.percentile.monthly-eafd4583.js → HEIGHT_BOYS.percentile.monthly-d9b4949a.js} +0 -0
  495. /package/build/esm/{HEIGHT_BOYS.percentile.weekly-7e4a54dc.js → HEIGHT_BOYS.percentile.weekly-8ea34956.js} +0 -0
  496. /package/build/esm/{HEIGHT_BOYS.percentile.yearly-33cf9d37.js → HEIGHT_BOYS.percentile.yearly-241e85b1.js} +0 -0
  497. /package/build/esm/{HEIGHT_BOYS.zscore.monthly-5b18236e.js → HEIGHT_BOYS.zscore.monthly-3db16371.js} +0 -0
  498. /package/build/esm/{HEIGHT_BOYS.zscore.weekly-1e860e78.js → HEIGHT_BOYS.zscore.weekly-b99b15d0.js} +0 -0
  499. /package/build/esm/{HEIGHT_BOYS.zscore.yearly-db583d8c.js → HEIGHT_BOYS.zscore.yearly-4d6ae918.js} +0 -0
  500. /package/build/esm/{HEIGHT_GIRLS.percentile.monthly-3d441b9c.js → HEIGHT_GIRLS.percentile.monthly-bbe4d5ad.js} +0 -0
  501. /package/build/esm/{HEIGHT_GIRLS.percentile.weekly-99a4d6db.js → HEIGHT_GIRLS.percentile.weekly-1e3c7cb4.js} +0 -0
  502. /package/build/esm/{HEIGHT_GIRLS.percentile.yearly-d9c70503.js → HEIGHT_GIRLS.percentile.yearly-566d8a74.js} +0 -0
  503. /package/build/esm/{HEIGHT_GIRLS.zscore.monthly-3aa672a7.js → HEIGHT_GIRLS.zscore.monthly-40ee366e.js} +0 -0
  504. /package/build/esm/{HEIGHT_GIRLS.zscore.weekly-0eb43069.js → HEIGHT_GIRLS.zscore.weekly-6959a69e.js} +0 -0
  505. /package/build/esm/{HEIGHT_GIRLS.zscore.yearly-2141b8b2.js → HEIGHT_GIRLS.zscore.yearly-48d89941.js} +0 -0
  506. /package/build/esm/{Locale-f3ce6f4a.js → Locale-513a56d3.js} +0 -0
  507. /package/build/esm/{Visible-03c5663d.js → Visible-4399c394.js} +0 -0
  508. /package/build/esm/{WEIGHT_BOYS.percentile.monthly-ad14497a.js → WEIGHT_BOYS.percentile.monthly-f0f0dca7.js} +0 -0
  509. /package/build/esm/{WEIGHT_BOYS.percentile.weekly-9ed4f577.js → WEIGHT_BOYS.percentile.weekly-b6d3490b.js} +0 -0
  510. /package/build/esm/{WEIGHT_BOYS.percentile.yearly-5ce6bf8e.js → WEIGHT_BOYS.percentile.yearly-f7590d0b.js} +0 -0
  511. /package/build/esm/{WEIGHT_BOYS.zscore.monthly-2d44e529.js → WEIGHT_BOYS.zscore.monthly-7c8ad09d.js} +0 -0
  512. /package/build/esm/{WEIGHT_BOYS.zscore.weekly-8344f718.js → WEIGHT_BOYS.zscore.weekly-e81d8e7e.js} +0 -0
  513. /package/build/esm/{WEIGHT_BOYS.zscore.yearly-7c342a5c.js → WEIGHT_BOYS.zscore.yearly-6362583e.js} +0 -0
  514. /package/build/esm/{WEIGHT_GIRLS.percentile.monthly-7a4e920e.js → WEIGHT_GIRLS.percentile.monthly-a5426f57.js} +0 -0
  515. /package/build/esm/{WEIGHT_GIRLS.percentile.weekly-eddbada0.js → WEIGHT_GIRLS.percentile.weekly-67d2967e.js} +0 -0
  516. /package/build/esm/{WEIGHT_GIRLS.percentile.yearly-c2018c71.js → WEIGHT_GIRLS.percentile.yearly-1252a3e1.js} +0 -0
  517. /package/build/esm/{WEIGHT_GIRLS.zscore.monthly-07077cb1.js → WEIGHT_GIRLS.zscore.monthly-7f840d95.js} +0 -0
  518. /package/build/esm/{WEIGHT_GIRLS.zscore.weekly-f766a165.js → WEIGHT_GIRLS.zscore.weekly-ab94f655.js} +0 -0
  519. /package/build/esm/{WEIGHT_GIRLS.zscore.yearly-a5f4bd57.js → WEIGHT_GIRLS.zscore.yearly-b4c8806b.js} +0 -0
  520. /package/build/esm/{ageGenerate-446d584f.js → ageGenerate-b304dff5.js} +0 -0
  521. /package/build/esm/{animation-31934930.js → animation-645a041f.js} +0 -0
  522. /package/build/esm/{constants-ea552f1d.js → constants-54537975.js} +0 -0
  523. /package/build/esm/{constants-c8a9d8cb.js → constants-ab5b3288.js} +0 -0
  524. /package/build/esm/{context-6fd811b3.js → context-a56948e4.js} +0 -0
  525. /package/build/esm/{dataTransform-dfbd4ef9.js → dataTransform-f6f71733.js} +0 -0
  526. /package/build/esm/{index-e7c61752.js → index-0d5eb14d.js} +0 -0
  527. /package/build/esm/{index-7eb710d8.js → index-1cdd5014.js} +0 -0
  528. /package/build/esm/{index-5869acf8.js → index-5bda0aa9.js} +0 -0
  529. /package/build/esm/{index-bef0ef2f.js → index-60d180fa.js} +0 -0
  530. /package/build/esm/{index-f7bcc9a8.js → index-880826be.js} +0 -0
  531. /package/build/esm/{index-3857d52d.js → index-c77beec1.js} +0 -0
  532. /package/build/esm/{index-4a0c644c.js → index-cd42f644.js} +0 -0
  533. /package/build/esm/{index-fc6409b1.js → index-ed652b43.js} +0 -0
  534. /package/build/esm/{index-d7bc8ec4.js → index-feb0cc1e.js} +0 -0
  535. /package/build/esm/{index.styles-57582498.js → index.styles-6ff51618.js} +0 -0
  536. /package/build/esm/{localizeNumberFormat-d6a2d9ac.js → localizeNumberFormat-6c5d5402.js} +0 -0
  537. /package/build/esm/{normalizeLink-3a2ee5f5.js → normalizeLink-f1198241.js} +0 -0
  538. /package/build/esm/{number-698551ff.js → number-aa3cb298.js} +0 -0
  539. /package/build/esm/{paths-8f866678.js → paths-94794959.js} +0 -0
  540. /package/build/esm/{shared-d6ce481f.js → shared-52156b38.js} +0 -0
  541. /package/build/esm/{translationsContext-5536e910.js → translationsContext-1f497fa7.js} +0 -0
  542. /package/build/esm/{tslib.es6-cad84cc0.js → tslib.es6-30d8e31a.js} +0 -0
  543. /package/build/esm/{types-3f5b8509.js → types-b0b475e7.js} +0 -0
  544. /package/build/esm/{types-35ea0197.js → types-b3913655.js} +0 -0
  545. /package/build/esm/{useOutsideClick-bbf3c9ae.js → useOutsideClick-d86c5688.js} +0 -0
  546. /package/build/esm/{useScrollbarSize-58d67e9b.js → useScrollbarSize-28e92502.js} +0 -0
  547. /package/build/esm/{useUniqueId-0d9665f4.js → useUniqueId-2544d863.js} +0 -0
  548. /package/build/esm/{utils-23c578aa.js → utils-6914599c.js} +0 -0
  549. /package/build/esm/{utils-2fee1cd2.js → utils-f41e3aed.js} +0 -0
  550. /package/build/{index-e1e5960a.js → index-15b91a78.js} +0 -0
  551. /package/build/{index-4992f6a2.js → index-2f84accd.js} +0 -0
  552. /package/build/{index-65891508.js → index-40cb70ce.js} +0 -0
  553. /package/build/{index-7c27f961.js → index-4818bd87.js} +0 -0
  554. /package/build/{index-c0e3db0e.js → index-7ed64277.js} +0 -0
  555. /package/build/{index-927f36fb.js → index-852b006e.js} +0 -0
  556. /package/build/{index-1ab48613.js → index-9f4d9929.js} +0 -0
  557. /package/build/{index-334e7245.js → index-9f866668.js} +0 -0
  558. /package/build/{index-2ae80422.js → index-f43c9bff.js} +0 -0
  559. /package/build/{index.styles-45a49aa7.js → index.styles-3f914ab2.js} +0 -0
  560. /package/build/{localizeNumberFormat-87d4e8a6.js → localizeNumberFormat-68158370.js} +0 -0
  561. /package/build/{normalizeLink-07a9d7be.js → normalizeLink-82320e77.js} +0 -0
  562. /package/build/{number-bbee4609.js → number-77e3ea04.js} +0 -0
  563. /package/build/{paths-c45bd44a.js → paths-5a50a142.js} +0 -0
  564. /package/build/{shared-476b5033.js → shared-9b1c0775.js} +0 -0
  565. /package/build/{translationsContext-3fd98577.js → translationsContext-a4ddf24e.js} +0 -0
  566. /package/build/{tslib.es6-22cfb2d1.js → tslib.es6-05be08f5.js} +0 -0
  567. /package/build/{types-e3b056c5.js → types-4d3e201f.js} +0 -0
  568. /package/build/{types-37591a90.js → types-afb9a7ee.js} +0 -0
  569. /package/build/{useOutsideClick-53be606b.js → useOutsideClick-8f84b9b3.js} +0 -0
  570. /package/build/{useScrollbarSize-e2c7cb27.js → useScrollbarSize-cfb2c6a4.js} +0 -0
  571. /package/build/{useUniqueId-a93fc94f.js → useUniqueId-dd6a4a8d.js} +0 -0
  572. /package/build/{utils-1bdc7913.js → utils-d7caae82.js} +0 -0
  573. /package/build/{utils-48e32d5d.js → utils-fa1fa7a8.js} +0 -0
@@ -0,0 +1,1942 @@
1
+ import React__default, { useMemo, useRef, useState, useCallback, forwardRef, useImperativeHandle, useReducer, useEffect } from 'react';
2
+ import { Search } from '@hhgtech/icons/core';
3
+ import { Skeleton, clsx, Box, Input, rem, ScrollArea, useMantineTheme, Stack, Flex, Text as Text$1, Select, Divider, Tabs } from '@mantine/core';
4
+ import { useDisclosure } from '@mantine/hooks';
5
+ import { P as PinIcon, i as checkMarkIconUrl, h as getApiPath, u as useGeolocation } from './utils-be6d6cd0.js';
6
+ import { a as useOutsideClick } from './useOutsideClick-d86c5688.js';
7
+ import { u as useTranslations } from './index-59edc46c.js';
8
+ import debounce from 'lodash/debounce';
9
+ import { a as ID_OPTION_CURRENT_LOCATION, L as LOCALIZED_SLUGS, I as ID_OPTION_ALL_LOCATION, S as SLUG_VACIN_ID, C as CLIENT_KEY, M as MAPPING_CLIENT_WITH_SLUG } from './constants-54537975.js';
10
+ import styled from '@emotion/styled';
11
+ import { theme } from './miscTheme.js';
12
+ import { M as MediaQueries } from './utils-6914599c.js';
13
+ import { C as Container } from './index-ed652b43.js';
14
+ import { T as Text } from './index-0b392883.js';
15
+ import { C as ChevronDown } from './ChevronDown-0705855b.js';
16
+ import { _ as __rest } from './tslib.es6-30d8e31a.js';
17
+ import { ArrowLeft } from '@hhgtech/icons/arrow';
18
+ import { M as Modal } from './index-589a8c97.js';
19
+ import { P as PATHS } from './paths-94794959.js';
20
+ import { B as Button } from './index-2c5bc0c5.js';
21
+
22
+ const StyledSearchBarWrapper = styled.div ``;
23
+ const StyleWrapperContainer = styled.div `
24
+ background-color: ${theme.colors.neutral50};
25
+ padding-bottom: 1px;
26
+ ${MediaQueries.mbDown} {
27
+ padding: 0;
28
+ }
29
+ `;
30
+ const StyleSearchInputContainer = styled(Container) `
31
+ padding: 0 16px;
32
+
33
+ ${MediaQueries.mbDown} {
34
+ padding: 0;
35
+ }
36
+ `;
37
+ const StyleSearchContent = styled.div `
38
+ padding: 24px 56px;
39
+ border-radius: 16px;
40
+ background-color: ${theme.colors.white};
41
+ box-shadow: 0px 0px 1px 0px rgba(0, 0, 0, 0.04),
42
+ 0px 0px 2px 0px rgba(0, 0, 0, 0.06), 0px 4px 8px 0px rgba(0, 0, 0, 0.04);
43
+
44
+ ${MediaQueries.mbDown} {
45
+ padding: 16px;
46
+ border-radius: 0;
47
+ }
48
+
49
+ .flex-search-input {
50
+ flex-direction: row;
51
+ ${MediaQueries.mbDown} {
52
+ flex-direction: column;
53
+ }
54
+ }
55
+ `;
56
+
57
+ const SEARCH_KEYWORD_MIN_LENGTH = {
58
+ 'en-PH': 3,
59
+ 'tl-PH': 2,
60
+ 'id-ID': 3,
61
+ 'vi-VN': 2,
62
+ 'zh-TW': 0,
63
+ 'ms-MY': 2,
64
+ 'th-TH': 2,
65
+ };
66
+
67
+ const initialState = {
68
+ isMobile: false,
69
+ isDebug: false,
70
+ navigateTo: null,
71
+ geoLocationPermission: 'unset',
72
+ geoLocationCoordinates: null,
73
+ focused: 'none',
74
+ focusedSpecialty: 'none',
75
+ searchLocationKeywords: '',
76
+ searchSpecialtyKeywords: '',
77
+ searchKeywords: '',
78
+ selectedLocation: null,
79
+ selectedSpecialty: null,
80
+ defaultCity: null,
81
+ initialCities: [],
82
+ cities: [],
83
+ searchResults: {},
84
+ initialSearchResults: {},
85
+ isLoadingCities: false,
86
+ isLoadingSearchResults: false,
87
+ isMobileModalOpened: false,
88
+ initialSelectedCity: null,
89
+ autoCompleteDisabled: false,
90
+ inputSearchPlaceholder: '',
91
+ locale: 'vi-VN',
92
+ allSpecialties: [],
93
+ popularKeys: [],
94
+ };
95
+ var ActionTypes;
96
+ (function (ActionTypes) {
97
+ ActionTypes["NavigateTo"] = "navigate to url";
98
+ ActionTypes["ClickOutsideInputLocation"] = "click outside input location";
99
+ ActionTypes["ClickOutsideInputSearch"] = "click outside input search";
100
+ ActionTypes["ClickOutsideInputSearchSpecialty"] = "click outside input search specialty";
101
+ ActionTypes["ClickOutsideInputSpecialty"] = "click outside input specialty";
102
+ ActionTypes["SelectCurrentLocation"] = "select current location";
103
+ ActionTypes["FocusInputLocation"] = "focus input location";
104
+ ActionTypes["FocusInputSearch"] = "focus input search";
105
+ ActionTypes["FocusInputSearchSpecialty"] = "focus input search specialty";
106
+ ActionTypes["ChangeInputLocation"] = "change input location";
107
+ ActionTypes["ChangeInputSearch"] = "change input search";
108
+ ActionTypes["ClearInputLocation"] = "clear input location";
109
+ ActionTypes["ClearInputSearch"] = "clear input search";
110
+ ActionTypes["SelectLocation"] = "select location";
111
+ ActionTypes["SelectSpecialty"] = "select specialty";
112
+ ActionTypes["FetchCitiesStart"] = "fetch cities start";
113
+ ActionTypes["FetchCitiesFinish"] = "fetch cities finish";
114
+ ActionTypes["FetchSearchResultsStart"] = "fetch search results start";
115
+ ActionTypes["FetchSearchResultsComplete"] = "fetch search results complete";
116
+ ActionTypes["FetchSearchResultsFinish"] = "fetch search results finish";
117
+ ActionTypes["FetchCitiesByGeoIpComplete"] = "fetch cities by geo IP finish";
118
+ ActionTypes["FetchCitiesByKeywordComplete"] = "fetch cities by keyword finish";
119
+ ActionTypes["DisplayInitialCities"] = "display initial cities";
120
+ ActionTypes["DisplayInitialSearchResults"] = "display initial search results";
121
+ ActionTypes["UpdateInitialSearchResults"] = "update initial search results";
122
+ ActionTypes["GrantGeoLocationPermission"] = "grant geolocation permission";
123
+ ActionTypes["DenyGeoLocationPermission"] = "deny geolocation permission";
124
+ ActionTypes["OpenMobileModal"] = "open mobile modal";
125
+ ActionTypes["CloseMobileModal"] = "close mobile modal";
126
+ ActionTypes["UpdateInitialSearchValue"] = "update initial search value";
127
+ ActionTypes["SelectSearchResult"] = "select search result";
128
+ ActionTypes["SetInputSearchPlaceholder"] = "set input search placeholder";
129
+ ActionTypes["FocusInputSpecialty"] = "focus input specialty";
130
+ ActionTypes["FetchAllSpecialties"] = "fetch all specialty";
131
+ ActionTypes["FetchPopularKeys"] = "fetch popular key by type";
132
+ })(ActionTypes || (ActionTypes = {}));
133
+ function resetSearchLocationKeywords(state) {
134
+ const { selectedLocation, searchLocationKeywords } = state;
135
+ if (selectedLocation && searchLocationKeywords !== selectedLocation.name) {
136
+ return Object.assign(Object.assign({}, state), { searchLocationKeywords: selectedLocation.name });
137
+ }
138
+ return state;
139
+ }
140
+ function reducer(state, action) {
141
+ var _a, _b;
142
+ if (state.isDebug) {
143
+ console.log('bookingSearchBarV3', { action, state });
144
+ }
145
+ switch (action.type) {
146
+ case ActionTypes.NavigateTo:
147
+ return Object.assign(Object.assign({}, state), { navigateTo: action.payload, focused: 'none', isMobileModalOpened: false });
148
+ case ActionTypes.ClickOutsideInputLocation: {
149
+ if (state.focused !== 'location') {
150
+ return state;
151
+ }
152
+ return resetSearchLocationKeywords(Object.assign(Object.assign({}, state), { focused: 'none' }));
153
+ }
154
+ case ActionTypes.ClickOutsideInputSpecialty: {
155
+ if (state.focused !== 'specialty') {
156
+ return state;
157
+ }
158
+ return resetSearchLocationKeywords(Object.assign(Object.assign({}, state), { focused: 'none' }));
159
+ }
160
+ case ActionTypes.ClickOutsideInputSearch: {
161
+ if (state.focused !== 'search') {
162
+ return state;
163
+ }
164
+ return Object.assign(Object.assign({}, state), { focused: 'none' });
165
+ }
166
+ case ActionTypes.ClickOutsideInputSearchSpecialty: {
167
+ if (state.focusedSpecialty !== 'search') {
168
+ return state;
169
+ }
170
+ return Object.assign(Object.assign({}, state), { focusedSpecialty: 'none' });
171
+ }
172
+ case ActionTypes.FocusInputLocation: {
173
+ const nextState = Object.assign(Object.assign({}, state), { focused: 'location' });
174
+ if (((_a = state.selectedLocation) === null || _a === void 0 ? void 0 : _a.id) === ID_OPTION_CURRENT_LOCATION) {
175
+ nextState.searchLocationKeywords = '';
176
+ }
177
+ return nextState;
178
+ }
179
+ case ActionTypes.FocusInputSpecialty: {
180
+ const nextState = Object.assign(Object.assign({}, state), { focused: 'specialty' });
181
+ if (((_b = state.selectedLocation) === null || _b === void 0 ? void 0 : _b.id) === ID_OPTION_CURRENT_LOCATION) {
182
+ nextState.searchLocationKeywords = '';
183
+ }
184
+ return nextState;
185
+ }
186
+ case ActionTypes.FocusInputSearch:
187
+ const nextState = Object.assign(Object.assign({}, state), { focused: 'search' });
188
+ if (state.isMobile) {
189
+ return resetSearchLocationKeywords(nextState);
190
+ }
191
+ return nextState;
192
+ case ActionTypes.FocusInputSearchSpecialty: {
193
+ const nextState = Object.assign(Object.assign({}, state), { focusedSpecialty: 'search' });
194
+ return nextState;
195
+ }
196
+ case ActionTypes.ChangeInputLocation:
197
+ return Object.assign(Object.assign({}, state), { searchLocationKeywords: action.payload });
198
+ case ActionTypes.ChangeInputSearch: {
199
+ const keyword = action.payload;
200
+ return Object.assign(Object.assign({}, state), { searchKeywords: keyword, isLoadingSearchResults: keyword.trim().length > SEARCH_KEYWORD_MIN_LENGTH[state.locale] });
201
+ }
202
+ case ActionTypes.SelectCurrentLocation:
203
+ return Object.assign(Object.assign({}, state), { focused: 'none', selectedLocation: action.payload, searchLocationKeywords: action.payload.name });
204
+ case ActionTypes.ClearInputLocation:
205
+ return Object.assign(Object.assign({}, state), { focused: 'location', cities: state.initialCities, searchLocationKeywords: '' });
206
+ case ActionTypes.ClearInputSearch:
207
+ return Object.assign(Object.assign({}, state), { focused: 'search', searchKeywords: '' });
208
+ case ActionTypes.SelectLocation:
209
+ return Object.assign(Object.assign({}, state), { focused: 'none', selectedLocation: action.payload, searchLocationKeywords: action.payload.name, searchResults: {} });
210
+ case ActionTypes.SelectSpecialty:
211
+ return Object.assign(Object.assign({}, state), { focused: 'none', selectedSpecialty: action.payload, searchResults: {} });
212
+ case ActionTypes.SelectSearchResult:
213
+ return Object.assign(Object.assign({}, state), { searchKeywords: action.payload.name, isMobileModalOpened: false, focused: 'none', navigateTo: action.payload.url });
214
+ case ActionTypes.FetchCitiesStart:
215
+ return Object.assign(Object.assign({}, state), { isLoadingCities: true });
216
+ case ActionTypes.FetchCitiesFinish:
217
+ return Object.assign(Object.assign({}, state), { isLoadingCities: false });
218
+ case ActionTypes.FetchSearchResultsStart:
219
+ return Object.assign(Object.assign({}, state), { isLoadingSearchResults: true });
220
+ case ActionTypes.FetchSearchResultsFinish:
221
+ return Object.assign(Object.assign({}, state), { isLoadingSearchResults: false });
222
+ case ActionTypes.FetchSearchResultsComplete: {
223
+ const nextState = Object.assign(Object.assign({}, state), { searchResults: Object.assign(Object.assign({}, state.searchResults), { [action.payload.key]: action.payload.searches }) });
224
+ return nextState;
225
+ }
226
+ case ActionTypes.FetchCitiesByGeoIpComplete: {
227
+ let { cities } = action.payload;
228
+ const { default: defaultCity } = action.payload;
229
+ cities = cities.filter((c) => c.id !== defaultCity.id);
230
+ if (defaultCity) {
231
+ cities.unshift(defaultCity);
232
+ }
233
+ if (state.initialSelectedCity &&
234
+ !cities.find((c) => c.id === state.initialSelectedCity.id)) {
235
+ cities.unshift(state.initialSelectedCity);
236
+ }
237
+ const nextState = Object.assign(Object.assign({}, state), { defaultCity, initialCities: cities, cities });
238
+ if (state.geoLocationPermission === 'denied' &&
239
+ !state.initialSelectedCity) {
240
+ nextState.selectedLocation = defaultCity;
241
+ nextState.searchLocationKeywords = defaultCity.name;
242
+ }
243
+ return nextState;
244
+ }
245
+ case ActionTypes.FetchCitiesByKeywordComplete:
246
+ return Object.assign(Object.assign({}, state), { cities: action.payload });
247
+ case ActionTypes.DisplayInitialCities:
248
+ return Object.assign(Object.assign({}, state), { cities: state.initialCities });
249
+ case ActionTypes.DisplayInitialSearchResults: {
250
+ const trimmed = state.searchKeywords.trim();
251
+ const minLen = SEARCH_KEYWORD_MIN_LENGTH[state.locale];
252
+ const shouldShowEmpty = trimmed.length > 0 && trimmed.length <= minLen;
253
+ return Object.assign(Object.assign({}, state), { searchResults: shouldShowEmpty ? {} : state.initialSearchResults, isLoadingSearchResults: false });
254
+ }
255
+ case ActionTypes.UpdateInitialSearchResults:
256
+ return Object.assign(Object.assign({}, state), { initialSearchResults: Object.assign(Object.assign({}, state.initialSearchResults), { [action.payload.key]: action.payload.searches }) });
257
+ case ActionTypes.GrantGeoLocationPermission:
258
+ return Object.assign(Object.assign({}, state), { geoLocationPermission: 'granted', geoLocationCoordinates: action.payload });
259
+ case ActionTypes.DenyGeoLocationPermission:
260
+ return Object.assign(Object.assign({}, state), { geoLocationPermission: 'denied', geoLocationCoordinates: null });
261
+ case ActionTypes.OpenMobileModal:
262
+ return Object.assign(Object.assign({}, state), { isMobileModalOpened: true });
263
+ case ActionTypes.CloseMobileModal:
264
+ return Object.assign(Object.assign({}, state), { isMobileModalOpened: false });
265
+ case ActionTypes.UpdateInitialSearchValue:
266
+ return Object.assign(Object.assign({}, state), { searchKeywords: action.payload });
267
+ case ActionTypes.SetInputSearchPlaceholder:
268
+ return Object.assign(Object.assign({}, state), { inputSearchPlaceholder: action.payload });
269
+ case ActionTypes.FetchAllSpecialties:
270
+ return Object.assign(Object.assign({}, state), { allSpecialties: action.payload });
271
+ case ActionTypes.FetchPopularKeys:
272
+ return Object.assign(Object.assign({}, state), { popularKeys: action.payload });
273
+ default:
274
+ return state;
275
+ }
276
+ }
277
+
278
+ const StyleSearchInputsWrapper = styled.div `
279
+ flex: 1;
280
+ position: relative;
281
+
282
+ ${MediaQueries.mbDown} {
283
+ width: 100%;
284
+ }
285
+ `;
286
+ const StyleSearchBarContainer = styled.div `
287
+ background: #f7f9fc;
288
+ border-radius: 12px;
289
+ height: 48px;
290
+ display: flex;
291
+ align-items: center;
292
+ padding: 4px 12px 4px 4px;
293
+ gap: 16px;
294
+
295
+ ${MediaQueries.mbDown} {
296
+ height: 48px;
297
+ width: 100%;
298
+ }
299
+ `;
300
+ const StyleSearchIconWrapper = styled.div `
301
+ display: flex;
302
+ align-items: center;
303
+ flex-shrink: 0;
304
+ color: #8c8c8c;
305
+
306
+ svg {
307
+ width: 18px;
308
+ height: 18px;
309
+ }
310
+ `;
311
+ const StyleResultWrapper = styled.div `
312
+ position: absolute;
313
+ top: calc(100% + 2px);
314
+ width: 100%;
315
+ border-radius: 4px;
316
+ background: ${theme.colors.white};
317
+ box-shadow: 0px 8px 40px 0px rgba(0, 0, 0, 0.1);
318
+ z-index: 10;
319
+
320
+ ${MediaQueries.mbDown} {
321
+ width: calc(100% + 64px);
322
+ left: -32px;
323
+ }
324
+ `;
325
+
326
+ const StyledSearchResultWrapper = styled.div ``;
327
+ styled.div `
328
+ display: flex;
329
+ justify-content: space-between;
330
+ align-item: center;
331
+ padding: 9px 14px 9px 22px;
332
+ background: #f7f9fc;
333
+
334
+ .title {
335
+ color: ${theme.colors.gray800};
336
+ font-size: 14px;
337
+ font-weight: 600;
338
+ line-height: 22px;
339
+ }
340
+
341
+ .btn-see-all {
342
+ color: ${theme.colors.blue600};
343
+ font-size: 14px;
344
+ line-height: 22px;
345
+ cursor: pointer;
346
+ }
347
+ `;
348
+ const StyleResultBody = styled.div `
349
+ padding: 10px 16px;
350
+ max-height: 400px;
351
+ overflow: auto;
352
+ `;
353
+ const StyleResultItem = styled.div `
354
+ display: flex;
355
+ gap: 12px;
356
+ align-items: center;
357
+ cursor: pointer;
358
+
359
+ ${MediaQueries.mbUp} {
360
+ &:hover {
361
+ background-color: ${theme.colors.blue50};
362
+ }
363
+ }
364
+
365
+ .image-item {
366
+ flex: 0 0 48px;
367
+ width: 48px;
368
+ height: 48px;
369
+ border-radius: 50%;
370
+
371
+ img {
372
+ object-fit: contain;
373
+ width: 100%;
374
+ height: 100%;
375
+ border-radius: 50%;
376
+ }
377
+ }
378
+ .infor {
379
+ overflow: hidden;
380
+ padding: 12px 0;
381
+ flex: 1;
382
+ border-bottom: 1px solid ${theme.colors.neutral100};
383
+ .title {
384
+ color: ${theme.colors.gray800};
385
+ font-size: 16px;
386
+ font-weight: 600;
387
+ line-height: 24px;
388
+ }
389
+ .description {
390
+ overflow: hidden;
391
+ color: ${theme.colors.gray600};
392
+ text-overflow: ellipsis;
393
+ white-space: nowrap;
394
+ font-size: 12px;
395
+ line-height: 18px;
396
+ display: flex;
397
+ gap: 8px;
398
+ align-items: center;
399
+ margin-top: 5px;
400
+
401
+ svg {
402
+ flex: 0 0 16px;
403
+ }
404
+
405
+ .sub-description {
406
+ overflow: hidden;
407
+ white-space: nowrap;
408
+ text-overflow: ellipsis;
409
+ flex: 1;
410
+ }
411
+ }
412
+ }
413
+
414
+ &.last-item {
415
+ .infor {
416
+ border-bottom: none;
417
+ }
418
+ }
419
+ `;
420
+ styled.div `
421
+ padding: 0 16px 16px;
422
+
423
+ .search-detail-btn {
424
+ color: ${theme.colors.blue600};
425
+ font-size: 14px;
426
+ line-height: 22px;
427
+ cursor: pointer;
428
+ }
429
+ `;
430
+
431
+ const SearchResult = ({ state, type, results,
432
+ // location,
433
+ isLoading, typeInformation,
434
+ // clientSlug = '',
435
+ dispatch, }) => {
436
+ const { t } = useTranslations();
437
+ const { selectedLocation } = state;
438
+ const typeSlug = useMemo(() => typeInformation[type].slug, [typeInformation, type]);
439
+ const handleOnClick = (item) => {
440
+ let url = '';
441
+ switch (type) {
442
+ case 'service':
443
+ url = `/${selectedLocation.slug}/${typeSlug}/${item.slug}`;
444
+ break;
445
+ case 'doctor':
446
+ case 'hospital':
447
+ url = `/${typeSlug}/${item.slug}-${item.id}`;
448
+ break;
449
+ }
450
+ if (url) {
451
+ dispatch({
452
+ type: ActionTypes.NavigateTo,
453
+ payload: url,
454
+ });
455
+ }
456
+ };
457
+ // const handleSeeAll = () => {
458
+ // let url = `/${selectedLocation.slug}/${typeSlug}`
459
+ // const slugClientUrl = MAPPING_CLIENT_WITH_SLUG[locale][clientSlug]
460
+ // if (slugClientUrl) {
461
+ // url += `/${slugClientUrl}`
462
+ // }
463
+ // if (
464
+ // (type === 'doctor' || type === 'hospital') &&
465
+ // state.selectedSpecialty.id > 0
466
+ // ) {
467
+ // url += `?specialtyId=${state.selectedSpecialty.id}`
468
+ // }
469
+ // if (url) {
470
+ // dispatch({ type: ActionTypes.NavigateTo, payload: url })
471
+ // }
472
+ // }
473
+ if (results === null)
474
+ return null;
475
+ return (React__default.createElement(StyledSearchResultWrapper, null,
476
+ React__default.createElement(StyleResultBody, { className: "search-results__body" },
477
+ isLoading && (React__default.createElement("div", { className: "skeleton-result" }, Array(3)
478
+ .fill(undefined)
479
+ .map((_, i) => (React__default.createElement(StyleResultItem, { key: type + 'loading' + i, className: i === 2 ? 'last-item' : '' },
480
+ React__default.createElement("div", { className: "image-item" },
481
+ React__default.createElement(Skeleton, { height: 48, circle: true, mb: "xl", animate: true })),
482
+ React__default.createElement("div", { className: "infor" },
483
+ React__default.createElement("div", { className: "title" },
484
+ React__default.createElement(Skeleton, { height: 8, mt: 10, radius: "xl", animate: true })),
485
+ React__default.createElement("div", { className: "description" },
486
+ React__default.createElement("div", { className: "sub-description" },
487
+ React__default.createElement(Skeleton, { height: 8, mt: 10, radius: "xl", width: "80%", animate: true }))))))))),
488
+ !isLoading && results && results.length > 0 && (React__default.createElement(React__default.Fragment, null, results.map((item, index) => {
489
+ var _a, _b;
490
+ const isLastItem = (results.length > 4 && index === 3) ||
491
+ (results.length <= 4 && index === results.length - 1);
492
+ let subDescription = '';
493
+ if (type === 'hospital') {
494
+ subDescription = (item === null || item === void 0 ? void 0 : item.address) || '';
495
+ }
496
+ if (type === 'doctor') {
497
+ subDescription = ((_a = item === null || item === void 0 ? void 0 : item.specialties) === null || _a === void 0 ? void 0 : _a.join(', ')) || '';
498
+ }
499
+ if (type === 'service') {
500
+ subDescription = ((_b = item === null || item === void 0 ? void 0 : item.hospital_branch) === null || _b === void 0 ? void 0 : _b.name) || '';
501
+ }
502
+ if (index >= 4) {
503
+ return React__default.createElement(React__default.Fragment, null);
504
+ }
505
+ return (React__default.createElement(StyleResultItem, { key: item.id, className: clsx(isLastItem ? 'last-item' : '', 'result-item'), onClick: () => handleOnClick(item) },
506
+ React__default.createElement("div", { className: "image-item" },
507
+ React__default.createElement("img", { src: item.logo || item.avatar, alt: item.name })),
508
+ React__default.createElement("div", { className: "infor" },
509
+ React__default.createElement("div", { className: "title" }, item.name),
510
+ React__default.createElement("div", { className: "description" },
511
+ typeInformation[type].icon,
512
+ React__default.createElement("div", { className: "sub-description" }, subDescription)))));
513
+ }))),
514
+ !isLoading && (results === null || results === void 0 ? void 0 : results.length) === 0 && (React__default.createElement(Text, { size: "sm", color: theme.colors.gray400, className: "noresult-block" }, t('booking.searchBar.noResults'))))));
515
+ };
516
+
517
+ const SearchResultContent = ({ state, type, isLoading, clientSlug, typeInformation, dispatch, }) => {
518
+ var _a;
519
+ if (state.focused !== 'search')
520
+ return null;
521
+ return (React__default.createElement(SearchResult, { type: type, state: state, results: ((_a = state.searchResults) === null || _a === void 0 ? void 0 : _a[type]) || null, location: state.selectedLocation.name, dispatch: dispatch, isLoading: isLoading, typeInformation: typeInformation, clientSlug: clientSlug }));
522
+ };
523
+
524
+ const StyleSearchSpecialtyWrapper = styled.div `
525
+ position: relative;
526
+ flex-shrink: 0;
527
+
528
+ ${MediaQueries.mbDown} {
529
+ width: 100%;
530
+ display: flex;
531
+ flex-direction: column;
532
+ gap: 12px;
533
+ }
534
+
535
+ &.compact {
536
+ ${MediaQueries.mbDown} {
537
+ width: auto;
538
+ display: block;
539
+ }
540
+ }
541
+ `;
542
+ const StyleDropdownPanel = styled.div `
543
+ position: absolute;
544
+ top: calc(100% + 4px);
545
+ left: 0;
546
+ min-width: 264px;
547
+ background: white;
548
+ border-radius: 12px;
549
+ box-shadow: 0px 0px 1px 0px rgba(0, 0, 0, 0.04),
550
+ 0px 2px 8px 0px rgba(0, 0, 0, 0.04), 0px 10px 16px 0px rgba(0, 0, 0, 0.04);
551
+ z-index: 10;
552
+ overflow: hidden;
553
+
554
+ &.mobile {
555
+ min-width: 280px;
556
+ }
557
+ `;
558
+ const StyledSpecialtyItem = styled.div `
559
+ cursor: pointer;
560
+ padding: 12px 16px;
561
+ display: flex;
562
+ align-items: center;
563
+ gap: 12px;
564
+ outline: none;
565
+
566
+ .image-item {
567
+ display: flex;
568
+ align-items: center;
569
+ justify-content: center;
570
+ width: 24px;
571
+ height: 24px;
572
+ flex-shrink: 0;
573
+
574
+ img {
575
+ width: 100%;
576
+ height: 100%;
577
+ object-fit: contain;
578
+ }
579
+
580
+ svg {
581
+ width: 24px;
582
+ height: 24px;
583
+ }
584
+ }
585
+
586
+ .item-label {
587
+ font-size: 15px;
588
+ font-weight: 400;
589
+ line-height: 24px;
590
+ letter-spacing: -0.3px;
591
+ color: ${theme.colors.gray800};
592
+ }
593
+
594
+ &:hover {
595
+ background-color: ${theme.colors.neutral50};
596
+ }
597
+
598
+ &.selected {
599
+ background-color: ${theme.colors.neutral50};
600
+ }
601
+
602
+ &:last-child {
603
+ border-bottom-left-radius: 12px;
604
+ border-bottom-right-radius: 12px;
605
+ }
606
+ `;
607
+
608
+ const DoctorIcon = () => (React__default.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" },
609
+ React__default.createElement("path", { d: "M8.983 14.333q-1.666 0-2.833-1.166Q4.983 12 4.983 10.333v-.366a3.48 3.48 0 0 1-2.258-1.2 3.57 3.57 0 0 1-.909-2.434V3.1a.58.58 0 0 1 .175-.425.58.58 0 0 1 .425-.175h1.4v-.167a.486.486 0 0 1 .5-.5q.217 0 .36.142a.5.5 0 0 1 .14.358v1.334a.485.485 0 0 1-.5.5.484.484 0 0 1-.5-.5V3.5h-1v2.833q0 1.1.784 1.884Q4.383 9 5.483 9t1.883-.783.784-1.884V3.5h-1v.167a.485.485 0 0 1-.5.5.484.484 0 0 1-.5-.5V2.333a.486.486 0 0 1 .5-.5q.217 0 .358.142a.5.5 0 0 1 .142.358V2.5h1.4a.58.58 0 0 1 .425.175.58.58 0 0 1 .175.425v3.233q0 1.4-.908 2.434a3.5 3.5 0 0 1-2.259 1.2v.366q0 1.25.875 2.126a2.9 2.9 0 0 0 2.125.874q1.25 0 2.125-.874a2.9 2.9 0 0 0 .875-2.126V9.25a1.74 1.74 0 0 1-.858-.609 1.6 1.6 0 0 1-.342-1.008q0-.716.5-1.216t1.2-.5q.716 0 1.217.5.5.5.5 1.216 0 .567-.342 1.008t-.875.609v1.083q0 1.667-1.167 2.834-1.166 1.166-2.833 1.166m3.5-6q.3 0 .509-.208a.67.67 0 0 0 .208-.492q0-.3-.208-.508a.7.7 0 0 0-.509-.208q-.3 0-.5.208a.7.7 0 0 0-.2.508q0 .284.2.492t.5.208", fill: "#595959" })));
610
+ const ServiceIcon = () => (React__default.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" },
611
+ React__default.createElement("path", { d: "M6.868 9.265v.974q0 .405.284.69.284.283.69.283t.69-.284.284-.69v-.973h.973q.405 0 .69-.284a.94.94 0 0 0 .284-.689.94.94 0 0 0-.284-.69.94.94 0 0 0-.69-.284h-.973v-.974a.94.94 0 0 0-.284-.69.94.94 0 0 0-.69-.284.94.94 0 0 0-.689.284.94.94 0 0 0-.285.69v.974h-.973a.94.94 0 0 0-.69.283.94.94 0 0 0-.284.69q0 .405.284.69.285.284.69.284zm-3.46 4.868q-.581 0-.994-.413A1.36 1.36 0 0 1 2 12.725v-6.65a1.4 1.4 0 0 1 .563-1.127l4.434-3.333q.369-.282.844-.282.474 0 .846.282l4.434 3.333q.264.193.413.493.15.3.15.633v6.651q0 .58-.414.995a1.36 1.36 0 0 1-.994.413zm0-1.168h8.868q.105 0 .172-.068a.23.23 0 0 0 .068-.172v-6.65a.2.2 0 0 0-.027-.11.3.3 0 0 0-.07-.085L7.983 2.554a.2.2 0 0 0-.142-.052.2.2 0 0 0-.142.052L3.266 5.88a.3.3 0 0 0-.071.086.2.2 0 0 0-.027.108v6.651q0 .105.068.172a.23.23 0 0 0 .172.068", fill: "#595959" })));
612
+ const HospitalIcon = () => (React__default.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" },
613
+ React__default.createElement("path", { d: "M8 8q.55 0 .941-.392.393-.391.392-.941 0-.55-.392-.942A1.28 1.28 0 0 0 8 5.333q-.55 0-.942.392a1.28 1.28 0 0 0-.391.942q0 .55.391.941Q7.45 8 8 8m0 4.9q2.032-1.866 3.017-3.392Q12 7.983 12 6.8q0-1.817-1.158-2.975Q9.682 2.667 8 2.667T5.158 3.825Q4 4.983 4 6.8q0 1.184.983 2.708Q5.966 11.034 8 12.9m0 1.517a.8.8 0 0 1-.5-.183q-2.433-2.151-3.633-3.992T2.667 6.8q0-2.5 1.608-3.983Q5.883 1.332 8 1.333q2.116 0 3.725 1.484T13.333 6.8q0 1.6-1.2 3.442-1.2 1.841-3.633 3.991a.8.8 0 0 1-.5.184", fill: "#8C8C8C" })));
614
+ const SpecialtyIcon = () => (React__default.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16" },
615
+ React__default.createElement("path", { d: "M3.833.5a3.333 3.333 0 1 0 0 6.667 3.333 3.333 0 0 0 0-6.667M10.5.5c-.92 0-1.667.746-1.667 1.667V5.5c0 .92.746 1.667 1.667 1.667h3.333c.921 0 1.667-.746 1.667-1.667V2.167C15.5 1.246 14.754.5 13.833.5zM3.833 8.833a3.333 3.333 0 1 0 0 6.667 3.333 3.333 0 0 0 0-6.667m8.334 0a3.333 3.333 0 1 0 0 6.667 3.333 3.333 0 0 0 0-6.667", fill: "#9AA2AC" })));
616
+
617
+ const SearchSpecialty = ({ state, isMobile, onSpecialtyClick, dispatch, isCompact = false, }) => {
618
+ const { t, locale } = useTranslations();
619
+ const inputSpecialtyWrapperRef = useRef(null);
620
+ const searchInputRef = useRef(null);
621
+ const slugs = useMemo(() => LOCALIZED_SLUGS[locale], [locale]);
622
+ const [searchValue, setSearchValue] = useState('');
623
+ const [opened, { close, toggle }] = useDisclosure(false);
624
+ useOutsideClick(inputSpecialtyWrapperRef, () => {
625
+ close();
626
+ setSearchValue('');
627
+ dispatch({ type: ActionTypes.ClickOutsideInputSpecialty });
628
+ });
629
+ const specialtyData = useMemo(() => [
630
+ {
631
+ name: t('booking.searchBar.allSpecialties'),
632
+ id: -1,
633
+ thumbnail: '',
634
+ total_doctor: 0,
635
+ slug: slugs.SPECIALTIES,
636
+ },
637
+ ...state.allSpecialties,
638
+ ], [state.allSpecialties, t, slugs.SPECIALTIES]);
639
+ const filteredData = useMemo(() => {
640
+ if (!searchValue.trim())
641
+ return specialtyData;
642
+ return specialtyData.filter((s) => s.name.toLowerCase().includes(searchValue.toLowerCase().trim()));
643
+ }, [specialtyData, searchValue]);
644
+ const selectedLabel = useMemo(() => {
645
+ if (!state.selectedSpecialty)
646
+ return '';
647
+ return state.selectedSpecialty.name;
648
+ }, [state.selectedSpecialty]);
649
+ const handleSelect = useCallback((item) => {
650
+ onSpecialtyClick({
651
+ id: item.id,
652
+ name: item.name,
653
+ slug: item.slug,
654
+ thumbnail: item.thumbnail || '',
655
+ total_doctor: 0,
656
+ });
657
+ close();
658
+ setSearchValue('');
659
+ }, [onSpecialtyClick, close]);
660
+ const handleToggle = useCallback(() => {
661
+ toggle();
662
+ if (opened) {
663
+ setSearchValue('');
664
+ }
665
+ }, [toggle, opened]);
666
+ return (React__default.createElement(StyleSearchSpecialtyWrapper, { ref: inputSpecialtyWrapperRef, className: isCompact ? 'compact' : '' },
667
+ React__default.createElement(Box, { onClick: handleToggle, className: opened ? 'dropdown-trigger-open' : '', sx: {
668
+ cursor: 'pointer',
669
+ position: 'relative',
670
+ width: isCompact ? (isMobile ? 96 : 160) : '100%',
671
+ flexShrink: 0,
672
+ } },
673
+ React__default.createElement(Input, { readOnly: true, value: selectedLabel, placeholder: t('booking.searchPopup.specialties'), rightSection: React__default.createElement(ChevronDown, { style: { width: 20, height: 20 } }), styles: Object.assign({ input: {
674
+ cursor: 'pointer',
675
+ outline: 'none',
676
+ '&:focus': {
677
+ outline: 'none',
678
+ },
679
+ '&:not(.mantine-Textarea-input)': {
680
+ height: isCompact ? 40 : isMobile ? 40 : 46,
681
+ fontSize: isCompact ? rem(14) : isMobile ? rem(14) : rem(16),
682
+ paddingLeft: isCompact ? 12 : 16,
683
+ paddingRight: 30,
684
+ background: isCompact ? 'white' : 'transparent',
685
+ border: isCompact
686
+ ? `1px solid ${theme.colors.gray200}`
687
+ : 'none',
688
+ borderRadius: 8,
689
+ letterSpacing: '-0.2px',
690
+ color: theme.colors.gray800,
691
+ textOverflow: 'ellipsis',
692
+ overflow: 'hidden',
693
+ whiteSpace: 'nowrap',
694
+ },
695
+ }, rightSection: {
696
+ width: 30,
697
+ pointerEvents: 'none',
698
+ } }, (!isCompact && {
699
+ wrapper: {
700
+ position: 'relative',
701
+ '&:after': {
702
+ content: '""',
703
+ width: '1px',
704
+ height: '20px',
705
+ backgroundColor: theme.colors.neutral100,
706
+ position: 'absolute',
707
+ right: 0,
708
+ top: '50%',
709
+ transform: 'translateY(-50%)',
710
+ },
711
+ },
712
+ })) })),
713
+ opened && (React__default.createElement(StyleDropdownPanel, { className: isMobile ? 'mobile' : '' },
714
+ React__default.createElement(Box, { sx: { padding: '12px 12px 8px' } },
715
+ React__default.createElement(Input, { ref: searchInputRef, icon: React__default.createElement(Search, { size: 18, color: theme.colors.gray300 }), placeholder: t('booking.searchBar.placeholder.specialty'), value: searchValue, onChange: (e) => setSearchValue(e.target.value), size: "md", styles: {
716
+ input: {
717
+ height: 40,
718
+ fontSize: rem(15),
719
+ paddingLeft: 36,
720
+ '&::placeholder': {
721
+ color: theme.colors.gray400,
722
+ },
723
+ },
724
+ icon: {
725
+ width: 36,
726
+ },
727
+ } })),
728
+ React__default.createElement(ScrollArea.Autosize, { mah: 300 }, filteredData.length === 0 ? (React__default.createElement(Box, { sx: {
729
+ padding: '12px 16px',
730
+ color: theme.colors.gray400,
731
+ fontSize: 14,
732
+ } }, t('common.noResult'))) : (filteredData.map((specialty) => {
733
+ var _a, _b;
734
+ return (React__default.createElement(StyledSpecialtyItem, { key: specialty.id, tabIndex: 0, role: "option", "aria-selected": ((_a = state.selectedSpecialty) === null || _a === void 0 ? void 0 : _a.id) === specialty.id, className: ((_b = state.selectedSpecialty) === null || _b === void 0 ? void 0 : _b.id) === specialty.id
735
+ ? 'selected'
736
+ : '', onClick: () => handleSelect(specialty), onKeyDown: (e) => {
737
+ if (e.key === 'Enter' || e.key === ' ') {
738
+ e.preventDefault();
739
+ handleSelect(specialty);
740
+ }
741
+ } },
742
+ React__default.createElement("div", { className: "image-item" }, specialty.thumbnail ? (React__default.createElement("img", { src: specialty.thumbnail, alt: specialty.name })) : (React__default.createElement(SpecialtyIcon, null))),
743
+ React__default.createElement("span", { className: "item-label" }, specialty.name)));
744
+ })))))));
745
+ };
746
+
747
+ const SearchInputs = forwardRef(({ state, type, isMobile, isLoading, initalSearchValue, typeInformation, debouncedFetchSearchResults, trackingAttributes, hideSpecialtySelection = false, clientSlug = '', onSearch, onFocusInput, onEnterSearch, dispatch, onlyShowSearchBox, onChangeSpecialty, }, ref) => {
748
+ const { t } = useTranslations();
749
+ const inputSearchWrapperRef = useRef(null);
750
+ const internalInputRef = useRef(null);
751
+ useImperativeHandle(ref, () => ({
752
+ focus: () => {
753
+ var _a;
754
+ (_a = internalInputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
755
+ },
756
+ }));
757
+ const gaAttributes = useMemo(() => {
758
+ if (trackingAttributes) {
759
+ return {
760
+ 'data-event-category': trackingAttributes.dataEventCategory,
761
+ 'data-event-action': trackingAttributes.dataEventAction,
762
+ 'data-event-label': trackingAttributes.dataEventLabel,
763
+ };
764
+ }
765
+ else {
766
+ return {};
767
+ }
768
+ }, [trackingAttributes]);
769
+ const placeholderSearch = useMemo(() => {
770
+ if (type === 'doctor')
771
+ return t('booking.searchBar.placeholder.doctor');
772
+ if (type === 'service')
773
+ return t('booking.searchBar.placeholder.service');
774
+ if (type === 'hospital')
775
+ return t('booking.searchBar.placeholder.hospital');
776
+ if (type === 'specialty')
777
+ return t('booking.searchBar.placeholder.specialty');
778
+ return '';
779
+ }, [type, t]);
780
+ const showSpecialtyInSearchBar = type !== 'specialty' &&
781
+ type !== 'service' &&
782
+ !hideSpecialtySelection &&
783
+ !onlyShowSearchBox;
784
+ const styleInputUnstyled = useMemo(() => ({
785
+ input: {
786
+ border: 'none',
787
+ background: 'transparent',
788
+ height: '100%',
789
+ fontSize: rem(16),
790
+ color: theme.colors.gray800,
791
+ padding: '0',
792
+ '&::placeholder': {
793
+ color: theme.colors.gray400,
794
+ },
795
+ '&:focus': {
796
+ outline: 'none',
797
+ boxShadow: 'none',
798
+ },
799
+ [isMobile ? '@media (max-width: 767px)' : '']: isMobile
800
+ ? {
801
+ fontSize: rem(16),
802
+ }
803
+ : {},
804
+ },
805
+ wrapper: {
806
+ flex: 1,
807
+ },
808
+ }), [isMobile]);
809
+ useOutsideClick(inputSearchWrapperRef, () => {
810
+ !isMobile && dispatch({ type: ActionTypes.ClickOutsideInputSearch });
811
+ });
812
+ const handleSearchInputChange = useCallback(function handleSearchInputChange(value) {
813
+ dispatch({ type: ActionTypes.ChangeInputSearch, payload: value });
814
+ if (typeof onSearch === 'function') {
815
+ return;
816
+ }
817
+ if (value.trim().length > SEARCH_KEYWORD_MIN_LENGTH[state.locale] ||
818
+ initalSearchValue ||
819
+ value.trim().length === 0) {
820
+ debouncedFetchSearchResults(value.trim(), state, type, clientSlug);
821
+ }
822
+ }, [
823
+ dispatch,
824
+ state,
825
+ type,
826
+ initalSearchValue,
827
+ debouncedFetchSearchResults,
828
+ clientSlug,
829
+ onSearch,
830
+ ]);
831
+ const handleSpecialtyClick = useCallback(function handleSpecialtyClick(specialty) {
832
+ var _a;
833
+ dispatch({ type: ActionTypes.SelectSpecialty, payload: specialty });
834
+ onChangeSpecialty === null || onChangeSpecialty === void 0 ? void 0 : onChangeSpecialty(specialty);
835
+ !isMobile && ((_a = internalInputRef.current) === null || _a === void 0 ? void 0 : _a.focus());
836
+ }, [dispatch, onChangeSpecialty]);
837
+ const inputOnKeyDown = useCallback((e) => {
838
+ if (e.key === 'Enter') {
839
+ e.stopPropagation();
840
+ e.preventDefault();
841
+ onEnterSearch && onEnterSearch();
842
+ }
843
+ }, [onEnterSearch]);
844
+ return (React__default.createElement(StyleSearchInputsWrapper, { ref: inputSearchWrapperRef },
845
+ React__default.createElement(StyleSearchBarContainer, null,
846
+ showSpecialtyInSearchBar && (React__default.createElement(SearchSpecialty, { state: state, isMobile: isMobile, dispatch: dispatch, debouncedFetchSearchResults: debouncedFetchSearchResults, onSpecialtyClick: handleSpecialtyClick, isCompact: true })),
847
+ React__default.createElement(StyleSearchIconWrapper, null,
848
+ React__default.createElement(Search, null)),
849
+ React__default.createElement(Input, Object.assign({ ref: internalInputRef, variant: "unstyled", size: isMobile ? 'md' : 'lg', placeholder: placeholderSearch, styles: styleInputUnstyled, value: state.searchKeywords, name: "search-results", autoComplete: "off", onFocus: () => {
850
+ dispatch({ type: ActionTypes.FocusInputSearch });
851
+ onFocusInput === null || onFocusInput === void 0 ? void 0 : onFocusInput();
852
+ }, onChange: (event) => {
853
+ handleSearchInputChange(event.target.value);
854
+ }, onKeyDown: inputOnKeyDown }, gaAttributes))),
855
+ !isMobile && type !== 'specialty' && (React__default.createElement(StyleResultWrapper, null,
856
+ React__default.createElement(SearchResultContent, { type: type, state: state, dispatch: dispatch, isLoading: isLoading, typeInformation: typeInformation, clientSlug: clientSlug })))));
857
+ });
858
+ SearchInputs.displayName = 'SearchInputs';
859
+
860
+ const ModalSearchResult = (_a) => {
861
+ var { searchInputEle, closeModal, children } = _a, props = __rest(_a, ["searchInputEle", "closeModal", "children"]);
862
+ const theme = useMantineTheme();
863
+ return (React__default.createElement(Modal, Object.assign({}, props, { zIndex: 310, fullScreen: true, styles: {
864
+ content: {
865
+ borderRadius: 0,
866
+ height: '100%',
867
+ '.search-results__body': { padding: 0 },
868
+ '.result-item': {
869
+ paddingLeft: 16,
870
+ paddingRight: 16,
871
+ },
872
+ '.noresult-block': {
873
+ padding: 16,
874
+ },
875
+ '.skeleton-result': {
876
+ padding: 16,
877
+ },
878
+ },
879
+ header: { display: 'none' },
880
+ } }),
881
+ React__default.createElement(Stack, { spacing: 16, sx: { paddingTop: 16 } },
882
+ React__default.createElement(Flex, { align: 'center', gap: 12 },
883
+ React__default.createElement(ArrowLeft, { size: 28, onClick: closeModal, color: theme.fn.primaryColor() }),
884
+ React__default.createElement(Box, { sx: { width: '100%' } }, searchInputEle)),
885
+ children)));
886
+ };
887
+
888
+ const StyleSearchLocationWrapper = styled.div `
889
+ position: relative;
890
+ width: 240px;
891
+ flex-shrink: 0;
892
+
893
+ ${MediaQueries.mbDown} {
894
+ width: 100%;
895
+ }
896
+ `;
897
+ styled.div `
898
+ position: absolute;
899
+ top: calc(100% + 2px);
900
+ width: 100%;
901
+ border-radius: 4px;
902
+ background: ${theme.colors.white};
903
+ box-shadow: 0px 8px 40px 0px rgba(0, 0, 0, 0.1);
904
+ z-index: 10;
905
+
906
+ ${MediaQueries.mbDown} {
907
+ width: calc(100% + 64px);
908
+ left: -32px;
909
+ }
910
+ `;
911
+ const StyledLocationItem = styled.div `
912
+ position: relative;
913
+ cursor: pointer;
914
+ padding: 12px 18px;
915
+ display: flex;
916
+ align-items: center;
917
+ gap: 14px;
918
+ overflow: hidden;
919
+
920
+ & + li::before {
921
+ content: '';
922
+ position: absolute;
923
+ left: 18px;
924
+ right: 18px;
925
+ top: 0;
926
+ height: 1px;
927
+ background-color: ${theme.colors.neutral100};
928
+ }
929
+
930
+ &:not([data-is-denied='true']):hover {
931
+ background-color: ${theme.colors.neutral50};
932
+ }
933
+
934
+ &:last-child:hover {
935
+ border-bottom-right-radius: 6px;
936
+ border-bottom-left-radius: 6px;
937
+ }
938
+
939
+ &:first-child:hover {
940
+ border-top-right-radius: 6px;
941
+ border-top-left-radius: 6px;
942
+ }
943
+
944
+ &[data-is-denied='true'] {
945
+ cursor: not-allowed;
946
+ }
947
+ `;
948
+ const StyledPinIcon = styled(PinIcon) `
949
+ width: 12px;
950
+ height: 18px;
951
+ flex: 0 0 12px;
952
+ `;
953
+
954
+ const CustomSelectItem = forwardRef((_a, ref) => {
955
+ var { label, value } = _a, others = __rest(_a, ["label", "value"]);
956
+ return (React__default.createElement("div", Object.assign({ ref: ref }, others),
957
+ React__default.createElement(StyledLocationItem, { key: value, role: "button", tabIndex: 0, "aria-label": `Select ${label} as location`, className: "location-item" },
958
+ React__default.createElement(StyledPinIcon, { color: theme.colors.neutral400 }),
959
+ React__default.createElement(Text$1, { size: "md" }, label))));
960
+ });
961
+
962
+ const SearchLocation = ({ state, debouncedFetchCitiesByKeyword, selectedLocation, trackingAttributes, onLocationClick, dispatch, }) => {
963
+ var _a;
964
+ const { t, locale } = useTranslations();
965
+ const inputLocationWrapperRef = useRef(null);
966
+ const citiesData = useMemo(() => {
967
+ var _a;
968
+ return [
969
+ {
970
+ name: t('booking.searchBar.allLocations'),
971
+ id: ID_OPTION_ALL_LOCATION,
972
+ slug: (_a = LOCALIZED_SLUGS[locale]) === null || _a === void 0 ? void 0 : _a.ALL,
973
+ },
974
+ ...state.cities,
975
+ ];
976
+ }, [state.cities, t, locale]);
977
+ const gaAttributes = useMemo(() => {
978
+ if (trackingAttributes) {
979
+ return {
980
+ 'data-event-category': trackingAttributes.dataEventCategory,
981
+ 'data-event-action': trackingAttributes.dataEventAction,
982
+ 'data-event-label': trackingAttributes.dataEventLabel,
983
+ };
984
+ }
985
+ return {};
986
+ }, [trackingAttributes]);
987
+ const handleSearchLocationInputChange = useCallback(function handleSearchLocationInputChange(value) {
988
+ dispatch({ type: ActionTypes.ChangeInputLocation, payload: value });
989
+ if (value.trim().length > SEARCH_KEYWORD_MIN_LENGTH[state.locale]) {
990
+ debouncedFetchCitiesByKeyword(value.trim());
991
+ }
992
+ else {
993
+ debouncedFetchCitiesByKeyword.cancel();
994
+ dispatch({ type: ActionTypes.DisplayInitialCities });
995
+ }
996
+ }, [debouncedFetchCitiesByKeyword, dispatch, state.locale]);
997
+ useOutsideClick(inputLocationWrapperRef, () => {
998
+ dispatch({ type: ActionTypes.ClickOutsideInputLocation });
999
+ });
1000
+ const stateValue = (_a = selectedLocation === null || selectedLocation === void 0 ? void 0 : selectedLocation.id) !== null && _a !== void 0 ? _a : null;
1001
+ const defaultValue = stateValue === null ? undefined : String(stateValue);
1002
+ return (React__default.createElement(StyleSearchLocationWrapper, { ref: inputLocationWrapperRef },
1003
+ React__default.createElement(Select, Object.assign({ key: defaultValue !== null && defaultValue !== void 0 ? defaultValue : 'no-selected-location', defaultValue: defaultValue, placeholder: t('booking.searchBar.allLocations'), searchable: true, onSearchChange: (value) => {
1004
+ handleSearchLocationInputChange(value);
1005
+ }, onFocus: () => {
1006
+ dispatch({ type: ActionTypes.DisplayInitialCities });
1007
+ }, onDropdownClose: () => {
1008
+ debouncedFetchCitiesByKeyword.cancel();
1009
+ dispatch({ type: ActionTypes.DisplayInitialCities });
1010
+ }, nothingFound: t('common.noResult'), maxDropdownHeight: 340, dropdownPosition: "bottom", icon: React__default.createElement("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
1011
+ React__default.createElement("path", { d: "M9.99908 10.8332C11.2264 10.8332 12.2213 9.83764 12.2213 8.61097C12.2213 7.3843 11.2264 6.38875 9.99908 6.38875C8.77174 6.38875 7.77686 7.3843 7.77686 8.61097C7.77686 9.83764 8.77174 10.8332 9.99908 10.8332Z", stroke: "#111111", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }),
1012
+ React__default.createElement("path", { d: "M9.99919 18.0554C11.7584 17.4999 16.6659 13.611 16.6659 8.61097C16.6659 4.93097 13.6811 1.94431 9.99919 1.94431C6.3173 1.94431 3.33252 4.93097 3.33252 8.61097C3.33252 13.611 8.23996 17.4999 9.99919 18.0554Z", stroke: "#111111", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })), rightSection: React__default.createElement(ChevronDown, { style: { width: 20, height: 20 } }) }, gaAttributes, { styles: () => ({
1013
+ item: {
1014
+ padding: 0,
1015
+ '&[data-selected]': {
1016
+ '&, &:hover': {
1017
+ backgroundColor: '#F7F9FC',
1018
+ color: 'inherit',
1019
+ },
1020
+ '.location-item': {
1021
+ '&::after': {
1022
+ content: checkMarkIconUrl,
1023
+ top: '50%',
1024
+ right: 19,
1025
+ position: 'absolute',
1026
+ transform: 'translateY(-50%)',
1027
+ },
1028
+ },
1029
+ },
1030
+ '&[data-hovered]': {
1031
+ backgroundColor: 'transparent',
1032
+ },
1033
+ },
1034
+ root: {
1035
+ width: '100%',
1036
+ },
1037
+ wrapper: {
1038
+ width: '100%',
1039
+ },
1040
+ input: {
1041
+ '&:not(.mantine-Textarea-input)': {
1042
+ height: 48,
1043
+ fontSize: rem(15),
1044
+ fontWeight: 400,
1045
+ letterSpacing: '-0.3px',
1046
+ color: theme.colors.gray1000,
1047
+ paddingLeft: 44,
1048
+ paddingRight: 40,
1049
+ background: 'white',
1050
+ border: `1px solid ${theme.colors.gray200}`,
1051
+ borderRadius: 12,
1052
+ },
1053
+ },
1054
+ icon: {
1055
+ width: 44,
1056
+ paddingLeft: 12,
1057
+ },
1058
+ rightSection: {
1059
+ width: 40,
1060
+ paddingRight: 12,
1061
+ },
1062
+ itemsWrapper: {
1063
+ padding: 0,
1064
+ },
1065
+ dropdown: {
1066
+ left: '0 !important',
1067
+ border: 0,
1068
+ marginTop: 4,
1069
+ borderRadius: 12,
1070
+ overflow: 'hidden',
1071
+ boxShadow: '0px 0px 1px 0px rgba(0, 0, 0, 0.04), 0px 2px 8px 0px rgba(0, 0, 0, 0.04), 0px 10px 16px 0px rgba(0, 0, 0, 0.04)',
1072
+ '& ::-webkit-scrollbar': {
1073
+ width: '6px',
1074
+ height: '6px',
1075
+ },
1076
+ },
1077
+ }), itemComponent: CustomSelectItem, filter: () => true, onChange: (value) => {
1078
+ if (value == null)
1079
+ return;
1080
+ const city = citiesData.find((i) => String(i.id) === value);
1081
+ if (!city)
1082
+ return;
1083
+ onLocationClick(city);
1084
+ debouncedFetchCitiesByKeyword.cancel();
1085
+ dispatch({ type: ActionTypes.DisplayInitialCities });
1086
+ setTimeout(() => {
1087
+ var _a, _b;
1088
+ (_b = (_a = inputLocationWrapperRef.current) === null || _a === void 0 ? void 0 : _a.querySelector('input')) === null || _b === void 0 ? void 0 : _b.blur();
1089
+ }, 0);
1090
+ }, data: citiesData.map((city) => ({
1091
+ value: String(city.id),
1092
+ label: city.name,
1093
+ city,
1094
+ })) }))));
1095
+ };
1096
+
1097
+ const StyleSpecialtiesWrapper = styled.div `
1098
+ display: flex;
1099
+ flex-wrap: wrap;
1100
+ row-gap: 8px;
1101
+ column-gap: 20px;
1102
+ ${MediaQueries.mbDown} {
1103
+ margin-top: 12px;
1104
+ }
1105
+ `;
1106
+ const StyleSpecialtyItem = styled.div `
1107
+ display: flex;
1108
+ align-items: center;
1109
+ border-radius: 8px;
1110
+ border: 1px solid ${theme.colors.neutral100};
1111
+ background: ${theme.colors.white};
1112
+ padding: 8px 12px 8px 8px;
1113
+ flex: 0 0 calc(33.3% - 13px);
1114
+ gap: 12px;
1115
+ cursor: pointer;
1116
+
1117
+ &:hover {
1118
+ background: ${theme.colors.blue50};
1119
+ }
1120
+
1121
+ ${MediaQueries.tdDown} {
1122
+ flex: 0 0 calc(50% - 10px);
1123
+ }
1124
+
1125
+ ${MediaQueries.mbDown} {
1126
+ flex: 0 0 100%;
1127
+ border: none;
1128
+ }
1129
+
1130
+ .image-item {
1131
+ display: flex;
1132
+ align-items: center;
1133
+ width: 40px;
1134
+ height: 40px;
1135
+
1136
+ img {
1137
+ width: 100%;
1138
+ object-fit: cover;
1139
+ }
1140
+ }
1141
+
1142
+ .infor {
1143
+ flex: 1;
1144
+ .title {
1145
+ color: ${theme.colors.gray800};
1146
+ font-size: 14px;
1147
+ font-style: normal;
1148
+ font-weight: 400;
1149
+ line-height: 22px;
1150
+ }
1151
+
1152
+ .description {
1153
+ color: ${theme.colors.gray600};
1154
+ font-size: 12px;
1155
+ font-weight: 400;
1156
+ line-height: 18px;
1157
+ }
1158
+ }
1159
+ `;
1160
+ const StyleDivider = styled(Divider) `
1161
+ margin: 24px 0 !important;
1162
+ `;
1163
+ const StyleShowMore = styled.div `
1164
+ display: flex;
1165
+ justify-content: center;
1166
+ margin-top: 24px;
1167
+ .show-more {
1168
+ border-radius: 4px;
1169
+ border: 1px solid ${theme.colors.neutral200};
1170
+ padding: 12px 16px;
1171
+ cursor: pointer;
1172
+ display: inline-block;
1173
+ color: ${theme.colors.gray800};
1174
+ font-size: 16px;
1175
+ font-weight: 600;
1176
+ line-height: 24px;
1177
+
1178
+ ${MediaQueries.mbDown} {
1179
+ width: 100%;
1180
+ text-align: center;
1181
+ }
1182
+ }
1183
+ `;
1184
+
1185
+ const SearchResultSpecialties = ({ state, isMobile, specialties, isLoading, dispatch, }) => {
1186
+ const { t, locale } = useTranslations();
1187
+ const { selectedLocation } = state;
1188
+ const slugs = useMemo(() => LOCALIZED_SLUGS[locale], [locale]);
1189
+ const handleOnClick = (specialtySlug) => {
1190
+ let url = '';
1191
+ if (specialtySlug === SLUG_VACIN_ID) {
1192
+ url = `/${selectedLocation.slug}/${slugs.HOSPITAL}/${CLIENT_KEY.GSK}/`;
1193
+ dispatch({ type: ActionTypes.ClickOutsideInputSearchSpecialty });
1194
+ }
1195
+ else {
1196
+ url = `/${selectedLocation.slug}/${slugs.DOCTOR}/${specialtySlug}`;
1197
+ }
1198
+ dispatch({ type: ActionTypes.NavigateTo, payload: url });
1199
+ };
1200
+ const handleShowMore = () => {
1201
+ const url = `/${slugs.SPECIALTIES}`;
1202
+ dispatch({ type: ActionTypes.NavigateTo, payload: url });
1203
+ };
1204
+ const showSeeMore = useMemo(() => {
1205
+ return (specialties.length >= 9 ||
1206
+ state.searchKeywords.trim().length <=
1207
+ SEARCH_KEYWORD_MIN_LENGTH[state.locale]);
1208
+ }, [state.searchKeywords, specialties]);
1209
+ return (React__default.createElement(React__default.Fragment, null,
1210
+ !isMobile && React__default.createElement(StyleDivider, { color: "#E4E8EC" }),
1211
+ React__default.createElement(StyleSpecialtiesWrapper, null,
1212
+ specialties.length > 0 && !isLoading && (React__default.createElement(React__default.Fragment, null, specialties.map((specialty, index) => {
1213
+ if (index >= 9) {
1214
+ return React__default.createElement(React__default.Fragment, null);
1215
+ }
1216
+ return (React__default.createElement(StyleSpecialtyItem, { key: specialty.id, onClick: () => handleOnClick(specialty.slug) },
1217
+ React__default.createElement("div", { className: "image-item" },
1218
+ React__default.createElement("img", { src: specialty.thumbnail, alt: specialty.name })),
1219
+ React__default.createElement("div", { className: "infor" },
1220
+ React__default.createElement("div", { className: "title" }, specialty.name))));
1221
+ }))),
1222
+ specialties.length === 0 && !isLoading && (React__default.createElement(Text, { size: "sm", color: theme.colors.gray400 }, t('booking.searchBar.noResults'))),
1223
+ isLoading &&
1224
+ Array(6)
1225
+ .fill(undefined)
1226
+ .map((_, i) => (React__default.createElement(StyleSpecialtyItem, { key: 'loading' + i },
1227
+ React__default.createElement("div", { className: "image-item" },
1228
+ React__default.createElement(Skeleton, { height: 40, animate: true })),
1229
+ React__default.createElement("div", { className: "infor" },
1230
+ React__default.createElement("div", { className: "title" },
1231
+ React__default.createElement(Skeleton, { height: 20, radius: "sm", animate: true }))))))),
1232
+ showSeeMore && (React__default.createElement(StyleShowMore, null,
1233
+ React__default.createElement("div", { className: "show-more", onClick: handleShowMore }, t('home.seeAll'))))));
1234
+ };
1235
+
1236
+ const StyleSearchTagWrapper = styled.div `
1237
+ display: flex;
1238
+ gap: 5px;
1239
+ margin-top: 16px;
1240
+ flex-wrap: wrap;
1241
+ `;
1242
+ const StyleTagItem = styled.div `
1243
+ color: ${theme.colors.gray600};
1244
+ font-size: 14px;
1245
+ font-weight: 600;
1246
+ line-height: 22px;
1247
+ padding: 4px 12px;
1248
+ background: ${theme.colors.white};
1249
+ border-radius: 32px;
1250
+ cursor: pointer;
1251
+ border: 1px solid ${theme.colors.white};
1252
+ margin-bottom: 5px;
1253
+ border-color: ${theme.colors.neutral100};
1254
+ background: #f7f9fc;
1255
+
1256
+ &.view-all {
1257
+ border-radius: 32px;
1258
+ border-color: ${theme.colors.blue50};
1259
+ background: ${theme.colors.blue50};
1260
+ color: ${theme.colors.blue600};
1261
+
1262
+ &:hover {
1263
+ border-color: ${theme.colors.blue50};
1264
+ background: ${theme.colors.blue50};
1265
+ color: ${theme.colors.blue600};
1266
+ }
1267
+ }
1268
+
1269
+ &:hover {
1270
+ border-color: ${theme.colors.neutral100};
1271
+ background: #f7f9fc;
1272
+ }
1273
+ `;
1274
+ const StyleTagLabel = styled.div `
1275
+ color: ${theme.colors.gray600};
1276
+ font-size: 14px;
1277
+ font-weight: 600;
1278
+ line-height: 22px;
1279
+ padding: 4px 0;
1280
+ background: ${theme.colors.white};
1281
+ border-radius: 32px;
1282
+ border: 1px solid ${theme.colors.white};
1283
+ margin-bottom: 5px;
1284
+ margin-right: 7px;
1285
+ `;
1286
+
1287
+ const SearchTag = ({ state, type, typeInformation, dispatch }) => {
1288
+ const { t } = useTranslations();
1289
+ const { selectedLocation } = state;
1290
+ const typeSlug = useMemo(() => typeInformation[type].slug, [typeInformation, type]);
1291
+ const handleViewAll = () => {
1292
+ const url = `/${selectedLocation.slug}/${typeSlug}`;
1293
+ if (url) {
1294
+ dispatch({ type: ActionTypes.NavigateTo, payload: url });
1295
+ }
1296
+ };
1297
+ const handleClickKeyword = (keyword) => {
1298
+ if (keyword.url) {
1299
+ window.location.href = keyword.url;
1300
+ }
1301
+ };
1302
+ return (React__default.createElement(StyleSearchTagWrapper, null,
1303
+ React__default.createElement(StyleTagLabel, null, t('booking.searchBar.popularKey')),
1304
+ state.popularKeys.map((item) => {
1305
+ return (React__default.createElement(StyleTagItem, { key: item.id, onClick: () => handleClickKeyword(item) }, item.keyword));
1306
+ }),
1307
+ React__default.createElement(StyleTagItem, { className: "view-all", onClick: handleViewAll }, t('booking.searchBar.viewAll'))));
1308
+ };
1309
+
1310
+ const StyledTabWrapper = styled.div `
1311
+ background: rgba(255, 255, 255, 0.64);
1312
+ backdrop-filter: blur(12px);
1313
+ border-bottom: 1px solid ${theme.colors.neutral100};
1314
+ `;
1315
+ const StyleTabContainer = styled(Container) `
1316
+ padding: 0 16px;
1317
+ `;
1318
+
1319
+ const TabSearch = ({ currentTab, hideTabBookingSearch = [], hideSpecialtyTab, isMobile, setCurrentTab, }) => {
1320
+ const { t } = useTranslations();
1321
+ const stylesTabs = useMemo(() => {
1322
+ return {
1323
+ root: {
1324
+ overflowY: isMobile ? 'hidden' : 'initial',
1325
+ overflowX: isMobile ? 'auto' : 'initial',
1326
+ },
1327
+ tabsList: {
1328
+ background: 'rgba(255, 255, 255, 0)',
1329
+ borderBottom: 'none',
1330
+ flexWrap: 'nowrap',
1331
+ '.mantine-Tabs-tab': {
1332
+ '&:last-child': {
1333
+ '&:after': {
1334
+ display: 'none',
1335
+ },
1336
+ },
1337
+ },
1338
+ },
1339
+ tab: {
1340
+ padding: isMobile ? '12px 16px 12px 16px' : '15px 40px 15px 40px',
1341
+ borderTop: '2px solid transparent',
1342
+ borderBottom: 'none',
1343
+ margin: 0,
1344
+ borderRadius: 0,
1345
+ position: 'relative',
1346
+ width: 'auto',
1347
+ '&[data-active="true"]': {
1348
+ borderColor: '#2d87f3',
1349
+ backgroundColor: '#ffffff',
1350
+ '&:after': {
1351
+ display: 'none',
1352
+ },
1353
+ '&:before': {
1354
+ content: '""',
1355
+ width: '100%',
1356
+ height: '1px',
1357
+ position: 'absolute',
1358
+ backgroundColor: '#ffffff',
1359
+ bottom: '-1px',
1360
+ },
1361
+ },
1362
+ '&:hover': {
1363
+ borderColor: '#2d87f3',
1364
+ backgroundColor: '#ffffff',
1365
+ '&:before': {
1366
+ content: '""',
1367
+ width: '100%',
1368
+ height: '1px',
1369
+ position: 'absolute',
1370
+ backgroundColor: '#ffffff',
1371
+ bottom: '-1px',
1372
+ },
1373
+ },
1374
+ '&:after': {
1375
+ content: '""',
1376
+ width: '1px',
1377
+ height: '24px',
1378
+ backgroundColor: '#E4E8EC',
1379
+ position: 'absolute',
1380
+ right: '-1px',
1381
+ },
1382
+ },
1383
+ tabLabel: {
1384
+ color: '#595959',
1385
+ fontSize: isMobile ? '14px' : '16px',
1386
+ fontWeight: 600,
1387
+ lineHeight: isMobile ? '22px' : '24px',
1388
+ },
1389
+ };
1390
+ }, [isMobile]);
1391
+ const tabConfig = useMemo(() => [
1392
+ {
1393
+ value: 'hospital',
1394
+ label: t('booking.searchPopup.hospitals'),
1395
+ },
1396
+ {
1397
+ value: 'doctor',
1398
+ label: t('booking.searchPopup.doctors'),
1399
+ },
1400
+ {
1401
+ value: 'service',
1402
+ label: t('booking.searchPopup.services'),
1403
+ },
1404
+ ...(!hideSpecialtyTab
1405
+ ? [
1406
+ {
1407
+ value: 'specialty',
1408
+ label: t('booking.searchPopup.specialties'),
1409
+ },
1410
+ ]
1411
+ : []),
1412
+ ], [hideSpecialtyTab]);
1413
+ const activeTabs = useMemo(() => {
1414
+ return (tabConfig.filter((item) => !hideTabBookingSearch.includes(item.value)) ||
1415
+ []);
1416
+ }, [hideTabBookingSearch, tabConfig]);
1417
+ return (React__default.createElement(StyledTabWrapper, { className: "booking-search-tab" },
1418
+ React__default.createElement(StyleTabContainer, null,
1419
+ React__default.createElement(Tabs, { value: currentTab, onTabChange: (tab) => {
1420
+ setCurrentTab(tab);
1421
+ }, styles: stylesTabs },
1422
+ React__default.createElement(Tabs.List, null, activeTabs.map((tab) => {
1423
+ return (React__default.createElement(Tabs.Tab, { value: tab.value, key: tab.value }, tab.label));
1424
+ }))))));
1425
+ };
1426
+
1427
+ var TypePopularKeySearch;
1428
+ (function (TypePopularKeySearch) {
1429
+ TypePopularKeySearch["doctor"] = "doctor";
1430
+ TypePopularKeySearch["service"] = "hospital_service";
1431
+ TypePopularKeySearch["hospital"] = "hospital_branch";
1432
+ })(TypePopularKeySearch || (TypePopularKeySearch = {}));
1433
+
1434
+ const ignoreCacarSpecialty = (specialties) => {
1435
+ return specialties.filter((item) => {
1436
+ if (typeof item === 'string') {
1437
+ return item !== 'cacar-api';
1438
+ }
1439
+ return (item === null || item === void 0 ? void 0 : item.id) !== 232;
1440
+ });
1441
+ };
1442
+ function useSearchBarApi({ dispatch, careApiDomain, locale = 'vi-VN', client = '', }) {
1443
+ const fetchCitiesApi = useCallback(function fetchCitiesApi(path, params = {}) {
1444
+ const url = `${careApiDomain}${path}`;
1445
+ dispatch({ type: ActionTypes.FetchCitiesStart });
1446
+ return fetch(getApiPath(url, params, locale), { method: 'GET' })
1447
+ .then((res) => res.json())
1448
+ .then((data) => {
1449
+ if (data._status !== 1 || !data._data) {
1450
+ console.log('error loading cities', data);
1451
+ return Promise.reject(data);
1452
+ }
1453
+ return data === null || data === void 0 ? void 0 : data._data;
1454
+ })
1455
+ .finally(() => dispatch({ type: ActionTypes.FetchCitiesFinish }));
1456
+ }, [locale]);
1457
+ const fetchCitiesByLocation = useCallback(function fetchCitiesByLocation({ coordinates }) {
1458
+ let params = {};
1459
+ const moreParams = {};
1460
+ if (coordinates) {
1461
+ params = {
1462
+ lat: coordinates.lat,
1463
+ lng: coordinates.lng,
1464
+ };
1465
+ }
1466
+ if (locale === 'ms-MY') {
1467
+ moreParams.noPaging = 1;
1468
+ }
1469
+ const requests = [
1470
+ fetchCitiesApi(PATHS.GET_CITY_BY_IP, Object.assign(Object.assign(Object.assign({}, params), moreParams), { hospitalActive: 1, client: CLIENT_KEY.MSD === client ? '' : client })),
1471
+ ];
1472
+ if (locale === 'zh-TW') {
1473
+ requests.push(fetchCitiesApi(PATHS.GET_CITIES_LIST, {
1474
+ noPaging: 1,
1475
+ hospitalActive: 1,
1476
+ client: CLIENT_KEY.MSD === client ? '' : client,
1477
+ }));
1478
+ }
1479
+ else {
1480
+ requests.push(fetchCitiesApi(PATHS.GET_CITIES_LIST, {
1481
+ noPaging: 1,
1482
+ hospitalActive: 1,
1483
+ }));
1484
+ }
1485
+ return Promise.all(requests)
1486
+ .then(([data1, data2]) => {
1487
+ const data = Object.assign({}, data1);
1488
+ if (data2) {
1489
+ const citiesIds = data.cities.map((c) => c.id);
1490
+ data.cities = data.cities.concat(data2.cities.filter((c) => !citiesIds.includes(c.id)));
1491
+ }
1492
+ dispatch({
1493
+ type: ActionTypes.FetchCitiesByGeoIpComplete,
1494
+ payload: data,
1495
+ });
1496
+ })
1497
+ .catch((err) => console.error('error loading cities by location', err));
1498
+ }, [locale, careApiDomain, dispatch]);
1499
+ const fetchCitiesByKeyword = useCallback(function fetchCitiesByKeyword(keyword) {
1500
+ return fetchCitiesApi(PATHS.GET_CITIES_LIST, {
1501
+ keyword,
1502
+ client,
1503
+ })
1504
+ .then((data) => {
1505
+ dispatch({
1506
+ type: ActionTypes.FetchCitiesByKeywordComplete,
1507
+ payload: data.cities,
1508
+ });
1509
+ })
1510
+ .catch((err) => console.error('error loading cities by keyword', err));
1511
+ }, [locale, careApiDomain, dispatch]);
1512
+ const fetchSearchResults = useCallback(function fetchSearchResults(searchKeywords, state, searchType, clientSlug, cacheResult) {
1513
+ const url = searchType === 'specialty'
1514
+ ? `${careApiDomain}${PATHS.GET_SEARCH_SPECIALTY}`
1515
+ : `${careApiDomain}${PATHS.GET_SEARCH_V2}`;
1516
+ dispatch({ type: ActionTypes.FetchSearchResultsStart });
1517
+ const { selectedLocation, geoLocationCoordinates, selectedSpecialty } = state;
1518
+ let cityId = '';
1519
+ if (!selectedLocation) {
1520
+ dispatch({ type: ActionTypes.FetchSearchResultsFinish });
1521
+ return;
1522
+ }
1523
+ if (selectedLocation.id === ID_OPTION_ALL_LOCATION) {
1524
+ cityId = '';
1525
+ }
1526
+ else {
1527
+ cityId = selectedLocation.id;
1528
+ }
1529
+ const lat = (geoLocationCoordinates === null || geoLocationCoordinates === void 0 ? void 0 : geoLocationCoordinates.lat) || '';
1530
+ const lng = (geoLocationCoordinates === null || geoLocationCoordinates === void 0 ? void 0 : geoLocationCoordinates.lng) || '';
1531
+ const specialty_id = (selectedSpecialty === null || selectedSpecialty === void 0 ? void 0 : selectedSpecialty.id) > 0 ? selectedSpecialty === null || selectedSpecialty === void 0 ? void 0 : selectedSpecialty.id : '';
1532
+ const keyword = searchKeywords.trim().length > SEARCH_KEYWORD_MIN_LENGTH[locale]
1533
+ ? searchKeywords.trim()
1534
+ : '';
1535
+ return fetch(getApiPath(url, Object.assign({ domain: careApiDomain, searchType: searchType || 'global', keyword: keyword, city: cityId === ID_OPTION_CURRENT_LOCATION ? '' : cityId, lat,
1536
+ lng,
1537
+ specialty_id, client_slug: CLIENT_KEY.MSD === clientSlug ? '' : clientSlug, msd: CLIENT_KEY.MSD === client ? 1 : '' }, (searchType === 'doctor' && {
1538
+ skipBooking: 1,
1539
+ })), locale), {
1540
+ method: 'GET',
1541
+ headers: {
1542
+ accept: 'version=2.0.0.0',
1543
+ },
1544
+ })
1545
+ .then((res) => res.json())
1546
+ .then((data) => {
1547
+ if (data._status !== 1 || !data._data) {
1548
+ return Promise.reject(data);
1549
+ }
1550
+ return data === null || data === void 0 ? void 0 : data._data;
1551
+ })
1552
+ .then((results) => {
1553
+ let searchesResult = [];
1554
+ if (searchType !== 'specialty') {
1555
+ if (searchType === 'doctor') {
1556
+ searchesResult = results.searches.map((item) => {
1557
+ return Object.assign(Object.assign({}, item), { specialties: ignoreCacarSpecialty((item === null || item === void 0 ? void 0 : item.specialties) || []) });
1558
+ });
1559
+ }
1560
+ else {
1561
+ searchesResult = results.searches;
1562
+ }
1563
+ }
1564
+ if (searchType === 'specialty') {
1565
+ if (keyword) {
1566
+ searchesResult = ignoreCacarSpecialty((results === null || results === void 0 ? void 0 : results.specialties) || []);
1567
+ }
1568
+ else {
1569
+ searchesResult = ignoreCacarSpecialty((results === null || results === void 0 ? void 0 : results.default) || []);
1570
+ }
1571
+ }
1572
+ dispatch({
1573
+ type: ActionTypes.FetchSearchResultsComplete,
1574
+ payload: {
1575
+ key: searchType,
1576
+ searches: searchesResult || [],
1577
+ },
1578
+ });
1579
+ if (cacheResult) {
1580
+ dispatch({
1581
+ type: ActionTypes.UpdateInitialSearchResults,
1582
+ payload: {
1583
+ key: searchType,
1584
+ searches: searchesResult || [],
1585
+ },
1586
+ });
1587
+ }
1588
+ })
1589
+ .catch((error) => {
1590
+ console.log('error loading search results', { url, error });
1591
+ })
1592
+ .finally(() => dispatch({ type: ActionTypes.FetchSearchResultsFinish }));
1593
+ }, [locale, careApiDomain, dispatch]);
1594
+ const fetchAllSpecialties = useCallback(function fetchSearchSpecialties() {
1595
+ const url = `${careApiDomain}${PATHS.GET_SEARCH_SPECIALTY}`;
1596
+ return fetch(getApiPath(url, {
1597
+ domain: careApiDomain,
1598
+ searchType: '',
1599
+ msd: CLIENT_KEY.MSD === client ? 1 : '',
1600
+ }, locale), {
1601
+ method: 'GET',
1602
+ headers: {
1603
+ accept: 'version=2.0.0.0',
1604
+ },
1605
+ })
1606
+ .then((res) => res.json())
1607
+ .then((data) => {
1608
+ if (data._status !== 1 || !data._data) {
1609
+ return Promise.reject(data);
1610
+ }
1611
+ return data === null || data === void 0 ? void 0 : data._data;
1612
+ })
1613
+ .then((results) => {
1614
+ dispatch({
1615
+ type: ActionTypes.FetchAllSpecialties,
1616
+ payload: ignoreCacarSpecialty(results.specialties || []),
1617
+ });
1618
+ })
1619
+ .catch((error) => {
1620
+ console.log('error loading search results', { url, error });
1621
+ });
1622
+ }, [locale, careApiDomain, dispatch]);
1623
+ const fetchPopularKeys = useCallback(function fetchPopularKeys(searchType) {
1624
+ const url = `${careApiDomain}${PATHS.GET_SEARCH_POPULAR_KEY}`;
1625
+ return fetch(getApiPath(url, {
1626
+ domain: careApiDomain,
1627
+ searchType: TypePopularKeySearch[searchType],
1628
+ sort_by: 'display_order',
1629
+ sort_order: 'asc',
1630
+ }, locale))
1631
+ .then((res) => res.json())
1632
+ .then((data) => {
1633
+ if (data._status !== 1 || !data._data) {
1634
+ return Promise.reject(data);
1635
+ }
1636
+ return data === null || data === void 0 ? void 0 : data._data;
1637
+ })
1638
+ .then((results) => {
1639
+ dispatch({
1640
+ type: ActionTypes.FetchPopularKeys,
1641
+ payload: results.popular_searches || [],
1642
+ });
1643
+ })
1644
+ .catch((error) => {
1645
+ console.log('error loading search results', { url, error });
1646
+ });
1647
+ }, [locale, careApiDomain, dispatch]);
1648
+ return {
1649
+ fetchCitiesByLocation,
1650
+ fetchCitiesByKeyword,
1651
+ fetchSearchResults,
1652
+ fetchAllSpecialties,
1653
+ fetchPopularKeys,
1654
+ };
1655
+ }
1656
+
1657
+ const BookingSearchBarV3 = ({ isMobile, careApiDomain, geoLocationPermission: geoLocationPermissionFromProps, geoLocationCoordinates: geoLocationCoordinatesFromProps, initialSelectedCity: initialSelectedCityFromProps, initialSearchValue = '', initTypeSearch = 'hospital', initSpecialty, careFrontDomain = '/care', isDebug = false,
1658
+ // askForGeolocationPermission = false,
1659
+ gaTrackingSearchBar, gaTrackingLocationSearch, autoCompleteDisabled = false, inputSearchPlaceholder = '', hideTabBookingSearch = [], hideSpecialtySelection = false, hideSpecialtyTab = false, hidePopularSearchKeys = false, clientSlug = '',
1660
+ // isOptionAllLocation = false,
1661
+ // hideResults = [],
1662
+ // isNavResultItem = true,
1663
+ triggerSearchWhenChangeFilter, routerPush, onGeoLocationPermissionChange,
1664
+ // onSearch,
1665
+ onChangeLocation, }) => {
1666
+ var _a;
1667
+ const { locale, t } = useTranslations();
1668
+ const wrapperRef = useRef(null);
1669
+ const searchInputDesktopRef = useRef(null);
1670
+ const searchInputMobileRef = useRef(null);
1671
+ const inputSearchSpecialtyWrapperRef = useRef(null);
1672
+ const [currentTab, setCurrentTab] = useState(initTypeSearch);
1673
+ const { geoLocationPermission: geoLocationPermissionFromHook, geoLocationCoordinates: geoLocationCoordinatesFromHook, } = useGeolocation();
1674
+ const [state, dispatch] = useReducer(reducer, initialState, (s) => (Object.assign(Object.assign({}, s), { isDebug,
1675
+ isMobile, geoLocationPermission: geoLocationPermissionFromProps ||
1676
+ geoLocationPermissionFromHook ||
1677
+ 'unset', geoLocationCoordinates: geoLocationCoordinatesFromProps ||
1678
+ geoLocationCoordinatesFromHook ||
1679
+ null, searchKeywords: initialSearchValue, initialSelectedCity: initialSelectedCityFromProps || null, selectedLocation: initialSelectedCityFromProps || s.selectedLocation || null, searchLocationKeywords: (initialSelectedCityFromProps === null || initialSelectedCityFromProps === void 0 ? void 0 : initialSelectedCityFromProps.name) || s.searchLocationKeywords, autoCompleteDisabled,
1680
+ inputSearchPlaceholder,
1681
+ locale })));
1682
+ const { navigateTo, focusedSpecialty,
1683
+ // isLoadingCities,
1684
+ // cities,
1685
+ searchKeywords, geoLocationPermission, selectedLocation,
1686
+ // selectedSpecialty,
1687
+ initialSelectedCity,
1688
+ // defaultCity,
1689
+ searchResults, isLoadingSearchResults,
1690
+ // isMobileModalOpened,
1691
+ // inputSearchPlaceholder,
1692
+ // allSpecialties,
1693
+ } = state;
1694
+ const { fetchCitiesByLocation, fetchCitiesByKeyword, fetchSearchResults, fetchAllSpecialties, fetchPopularKeys, } = useSearchBarApi({
1695
+ dispatch,
1696
+ locale,
1697
+ careApiDomain,
1698
+ client: clientSlug,
1699
+ });
1700
+ const slugs = useMemo(() => LOCALIZED_SLUGS[locale], [locale]);
1701
+ const [opened, { close, open }] = useDisclosure(false);
1702
+ const typeInformation = useMemo(() => {
1703
+ return Object.assign({ doctor: {
1704
+ name: t('booking.searchPopup.doctors'),
1705
+ icon: React__default.createElement(DoctorIcon, null),
1706
+ slug: slugs.DOCTOR,
1707
+ }, service: {
1708
+ name: t('booking.searchPopup.services'),
1709
+ icon: React__default.createElement(ServiceIcon, null),
1710
+ slug: slugs.SERVICE,
1711
+ }, hospital: {
1712
+ name: t('booking.searchPopup.hospitals'),
1713
+ icon: React__default.createElement(HospitalIcon, null),
1714
+ slug: slugs.HOSPITAL,
1715
+ } }, (!hideSpecialtyTab && {
1716
+ specialty: {
1717
+ name: t('booking.searchPopup.specialties'),
1718
+ icon: React__default.createElement(SpecialtyIcon, null),
1719
+ slug: slugs.SPECIALTIES,
1720
+ },
1721
+ }));
1722
+ }, [currentTab]);
1723
+ const debouncedFetchCitiesByKeyword = useMemo(() => debounce(fetchCitiesByKeyword, 400), [fetchCitiesByKeyword]);
1724
+ const debouncedFetchSearchResults = useMemo(() => debounce(fetchSearchResults, 400), [fetchSearchResults]);
1725
+ // function focusSearchInput() {
1726
+ // if (wrapperRef.current) {
1727
+ // wrapperRef.current
1728
+ // .querySelector<HTMLInputElement>('input[name="search-results"]')
1729
+ // ?.focus()
1730
+ // }
1731
+ // }
1732
+ const onClickSearchByKeyword = useCallback(function onClickSearchByKeyword({ locationSlug, specialtyId, } = {}) {
1733
+ var _a;
1734
+ close();
1735
+ let url = '';
1736
+ const { slug: typeSlug } = typeInformation[currentTab];
1737
+ let moreParams = '';
1738
+ const slugClientUrl = MAPPING_CLIENT_WITH_SLUG[locale][clientSlug];
1739
+ const selectedSpecialtyId = specialtyId || ((_a = state.selectedSpecialty) === null || _a === void 0 ? void 0 : _a.id) || -1;
1740
+ const selectedLocationSlug = locationSlug || (selectedLocation === null || selectedLocation === void 0 ? void 0 : selectedLocation.slug) || '';
1741
+ if ((currentTab === 'doctor' || currentTab === 'hospital') &&
1742
+ selectedSpecialtyId > 0) {
1743
+ moreParams = `&specialtyId=${selectedSpecialtyId}`;
1744
+ }
1745
+ if (currentTab === 'specialty') {
1746
+ url = `/${typeSlug}`;
1747
+ }
1748
+ else {
1749
+ url = `/${selectedLocationSlug}/${typeSlug}`;
1750
+ }
1751
+ if (slugClientUrl) {
1752
+ url += `/${slugClientUrl}`;
1753
+ }
1754
+ url += `?q=${searchKeywords}${moreParams}`;
1755
+ if (url) {
1756
+ dispatch({ type: ActionTypes.NavigateTo, payload: url });
1757
+ }
1758
+ }, [
1759
+ clientSlug,
1760
+ close,
1761
+ currentTab,
1762
+ dispatch,
1763
+ locale,
1764
+ searchKeywords,
1765
+ selectedLocation === null || selectedLocation === void 0 ? void 0 : selectedLocation.slug,
1766
+ (_a = state.selectedSpecialty) === null || _a === void 0 ? void 0 : _a.id,
1767
+ typeInformation,
1768
+ ]);
1769
+ const handleLocationClick = useCallback(function handleLocationClick(city) {
1770
+ triggerSearchWhenChangeFilter &&
1771
+ onClickSearchByKeyword({ locationSlug: city.slug });
1772
+ dispatch({ type: ActionTypes.SelectLocation, payload: city });
1773
+ if (onChangeLocation) {
1774
+ onChangeLocation(city);
1775
+ }
1776
+ }, [
1777
+ dispatch,
1778
+ isMobile,
1779
+ onChangeLocation,
1780
+ onClickSearchByKeyword,
1781
+ triggerSearchWhenChangeFilter,
1782
+ ]);
1783
+ useOutsideClick(inputSearchSpecialtyWrapperRef, () => {
1784
+ !isMobile &&
1785
+ dispatch({ type: ActionTypes.ClickOutsideInputSearchSpecialty });
1786
+ });
1787
+ useEffect(() => {
1788
+ var _a;
1789
+ if (geoLocationPermission !== 'denied' && !initialSelectedCity) {
1790
+ dispatch({
1791
+ type: ActionTypes.SelectLocation,
1792
+ payload: {
1793
+ name: t('booking.searchBar.allLocations'),
1794
+ id: ID_OPTION_ALL_LOCATION,
1795
+ slug: (_a = LOCALIZED_SLUGS[locale]) === null || _a === void 0 ? void 0 : _a.ALL,
1796
+ },
1797
+ });
1798
+ }
1799
+ if (onGeoLocationPermissionChange) {
1800
+ onGeoLocationPermissionChange(geoLocationPermission, state.geoLocationCoordinates);
1801
+ }
1802
+ if (isMobile && geoLocationPermission === 'granted' && selectedLocation) {
1803
+ dispatch({ type: ActionTypes.FocusInputSearch });
1804
+ }
1805
+ fetchCitiesByLocation({ coordinates: state.geoLocationCoordinates });
1806
+ }, [geoLocationPermission]);
1807
+ useEffect(() => {
1808
+ var _a;
1809
+ const defaultSpecialty = initSpecialty
1810
+ ? initSpecialty
1811
+ : {
1812
+ name: t('booking.searchBar.allSpecialties'),
1813
+ id: -1,
1814
+ thumbnail: '',
1815
+ total_doctor: 0,
1816
+ slug: slugs.SPECIALTIES,
1817
+ };
1818
+ if (initSpecialty) {
1819
+ if (((_a = state.selectedSpecialty) === null || _a === void 0 ? void 0 : _a.id) !== initSpecialty.id) {
1820
+ dispatch({
1821
+ type: ActionTypes.SelectSpecialty,
1822
+ payload: initSpecialty,
1823
+ });
1824
+ }
1825
+ return;
1826
+ }
1827
+ if (!state.selectedSpecialty ||
1828
+ state.selectedSpecialty.id !== defaultSpecialty.id) {
1829
+ dispatch({
1830
+ type: ActionTypes.SelectSpecialty,
1831
+ payload: defaultSpecialty,
1832
+ });
1833
+ }
1834
+ }, [initSpecialty, slugs.SPECIALTIES, t]);
1835
+ useEffect(() => {
1836
+ fetchAllSpecialties();
1837
+ }, []);
1838
+ useEffect(() => {
1839
+ fetchPopularKeys(currentTab);
1840
+ }, [currentTab]);
1841
+ useEffect(() => {
1842
+ if (navigateTo) {
1843
+ if (routerPush) {
1844
+ routerPush(navigateTo);
1845
+ }
1846
+ else {
1847
+ window.location.href = `${careFrontDomain}${navigateTo}`;
1848
+ }
1849
+ }
1850
+ }, [navigateTo]);
1851
+ useEffect(() => {
1852
+ fetchSearchResults(state.searchKeywords, state, currentTab, clientSlug, true);
1853
+ }, [currentTab]);
1854
+ useEffect(() => {
1855
+ if (opened && isMobile) {
1856
+ const timer = setTimeout(() => {
1857
+ var _a;
1858
+ (_a = searchInputMobileRef.current) === null || _a === void 0 ? void 0 : _a.focus();
1859
+ }, 150);
1860
+ return () => clearTimeout(timer);
1861
+ }
1862
+ }, [opened, isMobile]);
1863
+ const searchInputsProps = {
1864
+ type: currentTab,
1865
+ isMobile: isMobile,
1866
+ state: state,
1867
+ dispatch: dispatch,
1868
+ debouncedFetchSearchResults: debouncedFetchSearchResults,
1869
+ initalSearchValue: initialSearchValue,
1870
+ // focusSearchInput: focusSearchInput,
1871
+ onEnterSearch: onClickSearchByKeyword,
1872
+ typeInformation: typeInformation,
1873
+ trackingAttributes: gaTrackingSearchBar,
1874
+ isLoading: isLoadingSearchResults,
1875
+ hideSpecialtySelection: hideSpecialtySelection || hideSpecialtyTab,
1876
+ clientSlug: clientSlug,
1877
+ triggerSearchWhenChangeFilter,
1878
+ onChangeSpecialty: (specialty) => triggerSearchWhenChangeFilter &&
1879
+ onClickSearchByKeyword({ specialtyId: specialty.id }),
1880
+ };
1881
+ return (React__default.createElement(React__default.Fragment, null,
1882
+ React__default.createElement(StyledSearchBarWrapper, { ref: wrapperRef },
1883
+ React__default.createElement(TabSearch, { currentTab: currentTab, setCurrentTab: setCurrentTab, isMobile: isMobile, hideTabBookingSearch: hideTabBookingSearch, hideSpecialtyTab: hideSpecialtyTab }),
1884
+ React__default.createElement(StyleWrapperContainer, { className: "booking-search-container" },
1885
+ React__default.createElement(StyleSearchInputContainer, null,
1886
+ React__default.createElement(StyleSearchContent, { className: "booking-search-content" },
1887
+ React__default.createElement("div", { ref: inputSearchSpecialtyWrapperRef },
1888
+ React__default.createElement(Flex, { gap: "12px", align: "center", className: "flex-search-input" },
1889
+ React__default.createElement(SearchInputs, Object.assign({}, searchInputsProps, { ref: searchInputDesktopRef, onFocusInput: () => isMobile && open() })),
1890
+ currentTab !== 'specialty' && (React__default.createElement(SearchLocation, { state: state, isMobile: isMobile, dispatch: dispatch, debouncedFetchCitiesByKeyword: debouncedFetchCitiesByKeyword, selectedLocation: selectedLocation, onLocationClick: handleLocationClick, trackingAttributes: gaTrackingLocationSearch })),
1891
+ !isMobile && (React__default.createElement(Button, { size: "lg", variant: "primary", onClick: () => onClickSearchByKeyword(), styles: {
1892
+ root: {
1893
+ height: '48px',
1894
+ minWidth: '120px',
1895
+ borderRadius: '12px',
1896
+ },
1897
+ } }, t('booking.searchBar.searchButton')))),
1898
+ !hidePopularSearchKeys &&
1899
+ currentTab !== 'specialty' &&
1900
+ state.popularKeys.length > 0 && (React__default.createElement(SearchTag, { type: currentTab, state: state, typeInformation: typeInformation, dispatch: dispatch })),
1901
+ currentTab === 'specialty' &&
1902
+ focusedSpecialty === 'search' && (React__default.createElement(SearchResultSpecialties, { state: state, isMobile: isMobile, dispatch: dispatch, specialties: (searchResults === null || searchResults === void 0 ? void 0 : searchResults.specialty) || [], isLoading: isLoadingSearchResults }))))))),
1903
+ isMobile && (React__default.createElement(ModalSearchResult, { keepMounted: true, opened: opened, onClose: close, closeModal: close, searchInputEle: React__default.createElement(Flex, { align: 'center', gap: 8 },
1904
+ React__default.createElement(SearchInputs, Object.assign({}, searchInputsProps, { onlyShowSearchBox: true, ref: searchInputMobileRef })),
1905
+ React__default.createElement(Button, { variant: "primary", leftIcon: React__default.createElement(Search, { size: 20, color: '#fff' }), onClick: () => onClickSearchByKeyword(), styles: {
1906
+ root: {
1907
+ borderRadius: '12px',
1908
+ },
1909
+ } })) },
1910
+ React__default.createElement(Box, { sx: {
1911
+ marginLeft: -16,
1912
+ marginRight: -16,
1913
+ } },
1914
+ React__default.createElement(SearchResultContent, { type: currentTab, state: state, dispatch: dispatch, isLoading: isLoadingSearchResults, typeInformation: typeInformation, clientSlug: clientSlug }))))));
1915
+ };
1916
+
1917
+ const StyledTextDivider = styled.div `
1918
+ background-color: var(--neutral50);
1919
+ padding: 12px 0;
1920
+ box-shadow: inset 0px 1px 0px #e4e8ec;
1921
+
1922
+ > * {
1923
+ display: grid;
1924
+ grid-template-columns: 32px 1fr;
1925
+ align-content: center;
1926
+
1927
+ p {
1928
+ font-weight: 600;
1929
+ }
1930
+ }
1931
+
1932
+ .icon-wrapper {
1933
+ display: flex;
1934
+ align-items: center;
1935
+ }
1936
+ `;
1937
+ const TextDivider = ({ children, icon, className, style }) => (React__default.createElement(StyledTextDivider, { style: style, className: className },
1938
+ React__default.createElement(Container, null,
1939
+ React__default.createElement("div", { className: "icon-wrapper" }, icon),
1940
+ React__default.createElement(Text, { size: "c1", color: "var(--neutral800)" }, children))));
1941
+
1942
+ export { BookingSearchBarV3 as B, TextDivider as T };