@hhgtech/hhg-components 1.29.528 → 1.29.529-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 (561) hide show
  1. package/build/{InputDate-e44a5170.js → InputDate-93f8710a.js} +5 -5
  2. package/build/{LastPeriod-acd8425a.js → LastPeriod-2eff4596.js} +1 -1
  3. package/build/{MobileBottomNavigationIcon-391275dc.js → MobileBottomNavigationIcon-1bedc288.js} +3 -3
  4. package/build/{SiteWideBanner-5f5eef6e.js → SiteWideBanner-261649b6.js} +11 -11
  5. package/build/{Spinner-9cb85a18.js → Spinner-3a0c9ab4.js} +1 -1
  6. package/build/{WhatsApp-e2be209d.js → WhatsApp-cf18181b.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/bookingSearchBarV3/SearchResultContent.d.ts +13 -0
  12. package/build/care/components/organisms/bookingSearchBarV3/constants.d.ts +4 -0
  13. package/build/care/components/organisms/bookingSearchBarV3/index.d.ts +42 -0
  14. package/build/care/components/organisms/bookingSearchBarV3/index.styled.d.ts +16 -0
  15. package/build/care/components/organisms/bookingSearchBarV3/reducer.d.ts +166 -0
  16. package/build/care/components/organisms/bookingSearchBarV3/searchInputs/ModalSearchResult.d.ts +8 -0
  17. package/build/care/components/organisms/bookingSearchBarV3/searchInputs/index.d.ts +35 -0
  18. package/build/care/components/organisms/bookingSearchBarV3/searchInputs/index.styled.d.ts +17 -0
  19. package/build/care/components/organisms/bookingSearchBarV3/searchLocation/CustomSelectItem.d.ts +9 -0
  20. package/build/care/components/organisms/bookingSearchBarV3/searchLocation/index.d.ts +16 -0
  21. package/build/care/components/organisms/bookingSearchBarV3/searchLocation/index.styled.d.ts +21 -0
  22. package/build/care/components/organisms/bookingSearchBarV3/searchResult/icons.d.ts +5 -0
  23. package/build/care/components/organisms/bookingSearchBarV3/searchResult/index.d.ts +22 -0
  24. package/build/care/components/organisms/bookingSearchBarV3/searchResult/index.styled.d.ts +21 -0
  25. package/build/care/components/organisms/bookingSearchBarV3/searchResultSpecialties/index.d.ts +12 -0
  26. package/build/care/components/organisms/bookingSearchBarV3/searchResultSpecialties/index.styled.d.ts +16 -0
  27. package/build/care/components/organisms/bookingSearchBarV3/searchSpecialty/CustomSelectItem.d.ts +9 -0
  28. package/build/care/components/organisms/bookingSearchBarV3/searchSpecialty/index.d.ts +15 -0
  29. package/build/care/components/organisms/bookingSearchBarV3/searchSpecialty/index.styled.d.ts +13 -0
  30. package/build/care/components/organisms/bookingSearchBarV3/searchTag/index.d.ts +17 -0
  31. package/build/care/components/organisms/bookingSearchBarV3/searchTag/index.styled.d.ts +13 -0
  32. package/build/care/components/organisms/bookingSearchBarV3/tabSearch/index.d.ts +11 -0
  33. package/build/care/components/organisms/bookingSearchBarV3/tabSearch/index.styled.d.ts +8 -0
  34. package/build/care/components/organisms/bookingSearchBarV3/types.d.ts +17 -0
  35. package/build/care/components/organisms/bookingSearchBarV3/useSearchBarApi.d.ts +21 -0
  36. package/build/care/index.d.ts +1 -0
  37. package/build/care.js +23 -22
  38. package/build/careBookingSearchBar.js +14 -14
  39. package/build/careBookingSearchBarV2.js +19 -19
  40. package/build/components/atoms/inputMB/index.styled.d.ts +3 -3
  41. package/build/components.js +106 -106
  42. package/build/{constants-8187e577.js → constants-02ab5aca.js} +2 -2
  43. package/build/{constants-978bec21.js → constants-cfdfe331.js} +1 -1
  44. package/build/constants.js +3 -3
  45. package/build/constantsDomainLocales.js +1 -1
  46. package/build/constantsRiskScreener.js +2 -2
  47. package/build/constantsSite.js +2 -2
  48. package/build/{core-df6980aa.js → core-b8acccee.js} +1 -1
  49. package/build/{dataTransform-4e9d4b21.js → dataTransform-8938057c.js} +1 -1
  50. package/build/ecom.js +5 -5
  51. package/build/{editor-1410b123.js → editor-0aa1896f.js} +11 -11
  52. package/build/embeddedHeathToolCards_babyGrowth.js +25 -25
  53. package/build/embeddedHeathToolCards_babyPoop.js +22 -22
  54. package/build/embeddedHeathToolCards_babyVaccine.js +24 -24
  55. package/build/embeddedHeathToolCards_bmi_bmi.js +27 -27
  56. package/build/embeddedHeathToolCards_bmrBmr.js +27 -27
  57. package/build/embeddedHeathToolCards_dueDate_dueDate.js +24 -24
  58. package/build/embeddedHeathToolCards_ovulation_ovulation.js +24 -24
  59. package/build/embeddedHeathToolCards_pwg_pwg.js +28 -28
  60. package/build/embeddedHeathToolCards_targetHeartRate.js +29 -29
  61. package/build/esm/{InputDate-8a6cea00.js → InputDate-cb3fb374.js} +5 -5
  62. package/build/esm/{LastPeriod-782d7853.js → LastPeriod-09ea1d5d.js} +1 -1
  63. package/build/esm/{MobileBottomNavigationIcon-fd28ef21.js → MobileBottomNavigationIcon-a23f871b.js} +3 -3
  64. package/build/esm/{SiteWideBanner-93e3d85b.js → SiteWideBanner-9db1131d.js} +11 -11
  65. package/build/esm/{Spinner-ac3cafdf.js → Spinner-97dabe81.js} +1 -1
  66. package/build/esm/{WhatsApp-f00db235.js → WhatsApp-6abfba84.js} +1 -1
  67. package/build/esm/adapters.js +20 -20
  68. package/build/esm/atoms.js +51 -51
  69. package/build/esm/babyGrowth.js +86 -86
  70. package/build/esm/cache.js +2 -2
  71. package/build/esm/care/components/organisms/bookingSearchBarV3/SearchResultContent.d.ts +13 -0
  72. package/build/esm/care/components/organisms/bookingSearchBarV3/constants.d.ts +4 -0
  73. package/build/esm/care/components/organisms/bookingSearchBarV3/index.d.ts +42 -0
  74. package/build/esm/care/components/organisms/bookingSearchBarV3/index.styled.d.ts +16 -0
  75. package/build/esm/care/components/organisms/bookingSearchBarV3/reducer.d.ts +166 -0
  76. package/build/esm/care/components/organisms/bookingSearchBarV3/searchInputs/ModalSearchResult.d.ts +8 -0
  77. package/build/esm/care/components/organisms/bookingSearchBarV3/searchInputs/index.d.ts +35 -0
  78. package/build/esm/care/components/organisms/bookingSearchBarV3/searchInputs/index.styled.d.ts +17 -0
  79. package/build/esm/care/components/organisms/bookingSearchBarV3/searchLocation/CustomSelectItem.d.ts +9 -0
  80. package/build/esm/care/components/organisms/bookingSearchBarV3/searchLocation/index.d.ts +16 -0
  81. package/build/esm/care/components/organisms/bookingSearchBarV3/searchLocation/index.styled.d.ts +21 -0
  82. package/build/esm/care/components/organisms/bookingSearchBarV3/searchResult/icons.d.ts +5 -0
  83. package/build/esm/care/components/organisms/bookingSearchBarV3/searchResult/index.d.ts +22 -0
  84. package/build/esm/care/components/organisms/bookingSearchBarV3/searchResult/index.styled.d.ts +21 -0
  85. package/build/esm/care/components/organisms/bookingSearchBarV3/searchResultSpecialties/index.d.ts +12 -0
  86. package/build/esm/care/components/organisms/bookingSearchBarV3/searchResultSpecialties/index.styled.d.ts +16 -0
  87. package/build/esm/care/components/organisms/bookingSearchBarV3/searchSpecialty/CustomSelectItem.d.ts +9 -0
  88. package/build/esm/care/components/organisms/bookingSearchBarV3/searchSpecialty/index.d.ts +15 -0
  89. package/build/esm/care/components/organisms/bookingSearchBarV3/searchSpecialty/index.styled.d.ts +13 -0
  90. package/build/esm/care/components/organisms/bookingSearchBarV3/searchTag/index.d.ts +17 -0
  91. package/build/esm/care/components/organisms/bookingSearchBarV3/searchTag/index.styled.d.ts +13 -0
  92. package/build/esm/care/components/organisms/bookingSearchBarV3/tabSearch/index.d.ts +11 -0
  93. package/build/esm/care/components/organisms/bookingSearchBarV3/tabSearch/index.styled.d.ts +8 -0
  94. package/build/esm/care/components/organisms/bookingSearchBarV3/types.d.ts +17 -0
  95. package/build/esm/care/components/organisms/bookingSearchBarV3/useSearchBarApi.d.ts +21 -0
  96. package/build/esm/care/index.d.ts +1 -0
  97. package/build/esm/care.js +22 -22
  98. package/build/esm/careBookingSearchBar.js +14 -14
  99. package/build/esm/careBookingSearchBarV2.js +19 -19
  100. package/build/esm/components/atoms/inputMB/index.styled.d.ts +3 -3
  101. package/build/esm/components.js +106 -106
  102. package/build/esm/{constants-1d2564ea.js → constants-0585abda.js} +1 -1
  103. package/build/esm/{constants-ebc698d1.js → constants-5c8e090a.js} +2 -2
  104. package/build/esm/constants.js +3 -3
  105. package/build/esm/constantsDomainLocales.js +1 -1
  106. package/build/esm/constantsRiskScreener.js +2 -2
  107. package/build/esm/constantsSite.js +2 -2
  108. package/build/esm/{core-f02df1ea.js → core-f280bfb7.js} +1 -1
  109. package/build/esm/{dataTransform-7ec80df6.js → dataTransform-a4c4d198.js} +1 -1
  110. package/build/esm/ecom.js +5 -5
  111. package/build/esm/{editor-95beb114.js → editor-46ae846f.js} +11 -11
  112. package/build/esm/embeddedHeathToolCards_babyGrowth.js +25 -25
  113. package/build/esm/embeddedHeathToolCards_babyPoop.js +22 -22
  114. package/build/esm/embeddedHeathToolCards_babyVaccine.js +24 -24
  115. package/build/esm/embeddedHeathToolCards_bmi_bmi.js +27 -27
  116. package/build/esm/embeddedHeathToolCards_bmrBmr.js +27 -27
  117. package/build/esm/embeddedHeathToolCards_dueDate_dueDate.js +24 -24
  118. package/build/esm/embeddedHeathToolCards_ovulation_ovulation.js +24 -24
  119. package/build/esm/embeddedHeathToolCards_pwg_pwg.js +28 -28
  120. package/build/esm/embeddedHeathToolCards_targetHeartRate.js +29 -29
  121. package/build/esm/footer.js +22 -22
  122. package/build/esm/gAssets.js +2 -2
  123. package/build/esm/{healthTools-a478793b.js → healthTools-d1706ea2.js} +1 -1
  124. package/build/esm/healthToolsCardWrapper.js +20 -20
  125. package/build/esm/healthToolsForm.js +35 -35
  126. package/build/esm/hooks.js +14 -14
  127. package/build/esm/i18n.js +2 -2
  128. package/build/esm/i18nV2.js +2 -2
  129. package/build/esm/{index-873a735a.js → index-01f9872d.js} +7 -7
  130. package/build/esm/{index-80102061.js → index-0914004f.js} +3 -3
  131. package/build/esm/{index-6615252e.js → index-0a4fd2fe.js} +2 -2
  132. package/build/esm/{index-0cf4fb1a.js → index-0c31e5b6.js} +22 -22
  133. package/build/esm/{index-e30b89da.js → index-15ebe717.js} +16 -16
  134. package/build/esm/{index-1ef3bd24.js → index-1c22adc6.js} +17 -17
  135. package/build/esm/{index-1d71825a.js → index-1c309056.js} +3 -3
  136. package/build/esm/{index-75a9c5b3.js → index-294e0255.js} +2 -2
  137. package/build/esm/{index-ad9c69f5.js → index-29956cbd.js} +15 -15
  138. package/build/esm/{index-51642785.js → index-2d5dc1ea.js} +1 -1
  139. package/build/esm/{index-6c9ffea1.js → index-33275835.js} +6 -6
  140. package/build/esm/{index-bf75e23b.js → index-38f8e083.js} +2 -2
  141. package/build/esm/{index-d35dccbb.js → index-3c752506.js} +24 -24
  142. package/build/esm/{index-d5f782eb.js → index-3dfd3c89.js} +2 -2
  143. package/build/esm/{index-8ad71dae.js → index-403ea7da.js} +16 -16
  144. package/build/esm/{index-e29051bf.js → index-4597e0c7.js} +32 -32
  145. package/build/esm/{index-b79948be.js → index-46ee8441.js} +6 -6
  146. package/build/esm/{index-49993060.js → index-4a04d25e.js} +2 -2
  147. package/build/esm/{index-90c6261d.js → index-50fe015f.js} +2 -2
  148. package/build/esm/{index-e21fd7e1.js → index-513b59c7.js} +3 -3
  149. package/build/esm/{index-ad0c95a7.js → index-5cbebe59.js} +9 -9
  150. package/build/esm/{index-dc74d2a2.js → index-5fca77ea.js} +2 -2
  151. package/build/esm/{index-cc5f3d4b.js → index-65afb592.js} +9 -9
  152. package/build/esm/{index-0c8a796f.js → index-6632486d.js} +2 -2
  153. package/build/esm/{index-2fc6abb3.js → index-6ad42f98.js} +13 -13
  154. package/build/esm/{index-1c22f471.js → index-6be2580c.js} +2 -2
  155. package/build/esm/{index-d6463809.js → index-6f6782e6.js} +8 -8
  156. package/build/esm/{index-969578b1.js → index-72793c45.js} +13 -13
  157. package/build/esm/{index-3699be44.js → index-78856a79.js} +2 -2
  158. package/build/esm/{index-4e4a4448.js → index-7ab4987e.js} +2 -2
  159. package/build/esm/{index-e8e284f7.js → index-7dfa4cef.js} +1 -1
  160. package/build/esm/{index-4786dd1b.js → index-84923210.js} +4 -4
  161. package/build/esm/{index-9313ba10.js → index-86019d94.js} +5 -5
  162. package/build/esm/{index-a4fb5c60.js → index-89edea71.js} +16 -16
  163. package/build/esm/{index-28c3f888.js → index-8ae1021f.js} +3 -3
  164. package/build/esm/{index-fea9434a.js → index-8b566b15.js} +3 -3
  165. package/build/esm/{index-7061fdca.js → index-8c7798ae.js} +2 -2
  166. package/build/esm/{index-a7cbb0b9.js → index-8d9a544b.js} +1 -1
  167. package/build/esm/{index-29614899.js → index-8f99ebe7.js} +3 -3
  168. package/build/esm/{index-cea40631.js → index-9897533a.js} +33 -33
  169. package/build/esm/{index-14c5e5f8.js → index-9eff77a8.js} +14 -14
  170. package/build/esm/{index-b07e5ab0.js → index-9f33d631.js} +3 -3
  171. package/build/esm/{index-96cfc6d0.js → index-a05a3e52.js} +21 -21
  172. package/build/esm/{index-d1643abc.js → index-a25cb4db.js} +1 -1
  173. package/build/esm/{index-19b57024.js → index-a7c2c44a.js} +18 -18
  174. package/build/esm/{index-18597dc3.js → index-ab69b47b.js} +2 -2
  175. package/build/esm/{index-e102e0b2.js → index-ab6dd7b2.js} +15 -15
  176. package/build/esm/{index-8828f77d.js → index-af0ad684.js} +25 -25
  177. package/build/esm/{index-8d70c74a.js → index-b087a047.js} +4 -4
  178. package/build/esm/index-b3066d7a.js +1942 -0
  179. package/build/esm/{index-ba4cfc72.js → index-b32b0f9c.js} +2 -2
  180. package/build/esm/{index-729cb32a.js → index-b5494dc0.js} +18 -18
  181. package/build/esm/{index-52f5a292.js → index-b74cf15f.js} +15 -15
  182. package/build/esm/{index-72b972f5.js → index-b8257c21.js} +1 -1
  183. package/build/esm/{index-0aac98d9.js → index-b8e57785.js} +32 -32
  184. package/build/esm/{index-5c7ecb24.js → index-c8e8a848.js} +6 -6
  185. package/build/esm/{index-d957287d.js → index-cc2761d7.js} +1 -1
  186. package/build/esm/{index-e670af0e.js → index-ce15abdf.js} +6 -6
  187. package/build/esm/{index-8347736a.js → index-d17ae3b0.js} +3 -3
  188. package/build/esm/{index-73b17150.js → index-d1f4aeb1.js} +1 -1
  189. package/build/esm/{index-7d3b5c77.js → index-d4adbb94.js} +2 -2
  190. package/build/esm/{index-61c5b995.js → index-d9a6d08a.js} +11 -11
  191. package/build/esm/{index-fdb5c913.js → index-e08d57d4.js} +3 -3
  192. package/build/esm/{index-c3579fb3.js → index-e570b8d8.js} +2 -2
  193. package/build/esm/{index-caba5feb.js → index-ed716e00.js} +16 -16
  194. package/build/esm/{index-997d9afe.js → index-ef3a1ff0.js} +14 -14
  195. package/build/esm/{index-b13dc946.js → index-f2246c49.js} +7 -7
  196. package/build/esm/{index-8ff3d8b9.js → index-f890b580.js} +19 -19
  197. package/build/esm/{index-54a358f7.js → index-fda9c1f1.js} +3 -3
  198. package/build/esm/{index-5a3a3f42.js → index-fe9a3a41.js} +14 -14
  199. package/build/esm/{index-1e03896e.js → index-ffacce58.js} +5 -5
  200. package/build/esm/index.js +126 -126
  201. package/build/esm/{labelSorting-0ff4b693.js → labelSorting-b25214f6.js} +4 -4
  202. package/build/esm/lead.js +37 -37
  203. package/build/esm/{logoIcon-a24cf073.js → logoIcon-3d1d8927.js} +2 -2
  204. package/build/esm/mantine.js +27 -27
  205. package/build/esm/misc.js +19 -19
  206. package/build/esm/miscGetDynamicHealthTool.js +4 -4
  207. package/build/esm/miscGetSocialList.js +8 -8
  208. package/build/esm/miscScreenSizeContext.js +1 -1
  209. package/build/esm/mobileBottomNavigation.js +5 -5
  210. package/build/esm/mobileBottomNavigationIcon.js +5 -5
  211. package/build/esm/molecules.js +79 -79
  212. package/build/esm/moleculesArticleCard.js +6 -6
  213. package/build/esm/moleculesArticleCardV2.js +17 -17
  214. package/build/esm/navigation.js +49 -49
  215. package/build/esm/navigationLogoutPopup.js +11 -11
  216. package/build/esm/navigationProfileButton.js +27 -27
  217. package/build/esm/onboardingV2.js +30 -30
  218. package/build/esm/organisms.js +62 -62
  219. package/build/esm/{post-e85d518d.js → post-f9fbdafe.js} +2 -2
  220. package/build/esm/profileNavigation.js +20 -20
  221. package/build/esm/progressBar.js +1 -1
  222. package/build/esm/pwg.js +23 -23
  223. package/build/esm/ssoV2/screens/updateEmail.d.ts +4 -2
  224. package/build/esm/ssoV2/ssoStateManager/store.d.ts +1 -0
  225. package/build/esm/ssoV2.js +88 -70
  226. package/build/esm/{store-58945988.js → store-95a9812e.js} +37 -28
  227. package/build/esm/subot.js +40 -40
  228. package/build/esm/surveyOrPremiumBanner.js +34 -34
  229. package/build/esm/surveyQuestionCard.js +11 -11
  230. package/build/esm/{surveyThankyouCard-020bd785.js → surveyThankyouCard-22a44c5a.js} +5 -5
  231. package/build/esm/together.js +57 -57
  232. package/build/esm/togetherApiUtils.js +6 -6
  233. package/build/esm/togetherAtoms.js +31 -31
  234. package/build/esm/togetherComponentGlobalContext.js +6 -6
  235. package/build/esm/togetherMolecules.js +52 -52
  236. package/build/esm/togetherMoleculesCardAuthor.js +29 -29
  237. package/build/esm/togetherMoleculesPostImagePreview.js +13 -13
  238. package/build/esm/togetherMoleculesProfileDetail.js +40 -40
  239. package/build/esm/togetherOrganisms.js +51 -51
  240. package/build/esm/togetherRichTextEditor.js +20 -20
  241. package/build/esm/togetherShareBox.js +12 -12
  242. package/build/esm/{transform-54db313c.js → transform-963ad2a4.js} +27 -27
  243. package/build/esm/{translationsProvider-74ef088c.js → translationsProvider-c11de9d1.js} +1 -1
  244. package/build/esm/{treePopoverMenu-43e10598.js → treePopoverMenu-13999c6e.js} +19 -19
  245. package/build/esm/types.js +2 -2
  246. package/build/esm/{useCartCareService-78b0a223.js → useCartCareService-6985a53a.js} +1 -1
  247. package/build/esm/{useHealthToolCache-a120abd1.js → useHealthToolCache-3a9d2e47.js} +1 -1
  248. package/build/esm/{usePhoneValidator-6ac61ebc.js → usePhoneValidator-d802c149.js} +5 -5
  249. package/build/esm/{usePlacesAutocomplete-09a0e342.js → usePlacesAutocomplete-5680f5bb.js} +1 -1
  250. package/build/esm/useTogetherAuthRequiredAction.js +10 -10
  251. package/build/esm/{utils-78865776.js → utils-74a8f69f.js} +2 -2
  252. package/build/esm/{utils-9b4e448e.js → utils-84017753.js} +3 -3
  253. package/build/esm/{utils-4560ea01.js → utils-90449570.js} +5 -5
  254. package/build/esm/{utils-e4a74b46.js → utils-cac7bd05.js} +3 -3
  255. package/build/esm/{utils-e56045d9.js → utils-e8fd9273.js} +2 -2
  256. package/build/esm/vaccination.js +22 -22
  257. package/build/footer.js +22 -22
  258. package/build/gAssets.js +2 -2
  259. package/build/{healthTools-4c002c0b.js → healthTools-cc51a5fc.js} +1 -1
  260. package/build/healthToolsCardWrapper.js +20 -20
  261. package/build/healthToolsForm.js +35 -35
  262. package/build/hooks.js +14 -14
  263. package/build/i18n.js +2 -2
  264. package/build/i18nV2.js +1 -1
  265. package/build/{index-a027ddce.js → index-02e045e8.js} +3 -3
  266. package/build/{index-e6ee6bb1.js → index-06b75878.js} +33 -33
  267. package/build/{index-8a641926.js → index-09c48a13.js} +1 -1
  268. package/build/{index-3d073609.js → index-0bafca3b.js} +5 -5
  269. package/build/{index-9175f3dc.js → index-0c383e9e.js} +1 -1
  270. package/build/{index-fea268f5.js → index-0e71f7a9.js} +4 -4
  271. package/build/{index-f104b7d3.js → index-0ffcf757.js} +1 -1
  272. package/build/{index-43597605.js → index-11a7f0b1.js} +9 -9
  273. package/build/{index-0d3129b1.js → index-12cb0fd4.js} +6 -6
  274. package/build/{index-78d490d2.js → index-144e70fe.js} +3 -3
  275. package/build/{index-2c0ceb91.js → index-14b9c725.js} +3 -3
  276. package/build/{index-a0fe3cd0.js → index-1f805a45.js} +2 -2
  277. package/build/{index-3f93a7ef.js → index-228bab01.js} +32 -32
  278. package/build/{index-c037399a.js → index-24b985fa.js} +14 -14
  279. package/build/{index-abed94ee.js → index-24cb1a39.js} +7 -7
  280. package/build/{index-b919614c.js → index-273f9705.js} +1 -1
  281. package/build/{index-9cdb8ffc.js → index-2bb1f6de.js} +5 -5
  282. package/build/{index-68b3b9cc.js → index-2c307d5a.js} +25 -25
  283. package/build/{index-55741379.js → index-2d84f0b4.js} +1 -1
  284. package/build/{index-5057d16f.js → index-2f815469.js} +2 -2
  285. package/build/{index-30398c28.js → index-2f9237cd.js} +4 -4
  286. package/build/{index-8d636c5e.js → index-31ec285e.js} +15 -15
  287. package/build/{index-d08623ad.js → index-35e6955c.js} +16 -16
  288. package/build/index-384b975c.js +1951 -0
  289. package/build/{index-54f20948.js → index-39d35345.js} +1 -1
  290. package/build/{index-e72051d3.js → index-3ecc1113.js} +2 -2
  291. package/build/{index-aa442c73.js → index-41a3388a.js} +2 -2
  292. package/build/{index-94b27427.js → index-49bcfe55.js} +2 -2
  293. package/build/{index-317470d8.js → index-4a671c5a.js} +13 -13
  294. package/build/{index-4f61ac85.js → index-4cae5c26.js} +32 -32
  295. package/build/{index-5bc65809.js → index-54bc5603.js} +6 -6
  296. package/build/{index-034a704f.js → index-5644ca7f.js} +7 -7
  297. package/build/{index-7dbf4343.js → index-5f280f6f.js} +1 -1
  298. package/build/{index-2dc73063.js → index-61f7b016.js} +18 -18
  299. package/build/{index-6699754e.js → index-62da42cf.js} +13 -13
  300. package/build/{index-071fc285.js → index-6554e5ba.js} +3 -3
  301. package/build/{index-f3df57f3.js → index-65d4ab7f.js} +2 -2
  302. package/build/{index-99d8372b.js → index-6731f2f1.js} +2 -2
  303. package/build/{index-d0193408.js → index-677f7e12.js} +19 -19
  304. package/build/{index-ad516504.js → index-6845f9df.js} +3 -3
  305. package/build/{index-015f890f.js → index-6d9db5b4.js} +6 -6
  306. package/build/{index-9368f4ba.js → index-72f930ea.js} +8 -8
  307. package/build/{index-ac37f6c0.js → index-78faf82f.js} +16 -16
  308. package/build/{index-ec50dce8.js → index-7a877e10.js} +3 -3
  309. package/build/{index-8f89038a.js → index-7b37ed99.js} +15 -15
  310. package/build/{index-dab87a70.js → index-8059d636.js} +2 -2
  311. package/build/{index-a1138fdb.js → index-8cbedde4.js} +9 -9
  312. package/build/{index-c0797540.js → index-988586e6.js} +2 -2
  313. package/build/{index-08ce6245.js → index-a4a54068.js} +2 -2
  314. package/build/{index-bda9fc0f.js → index-a5dc52a5.js} +14 -14
  315. package/build/{index-fc3632d1.js → index-aaec4f92.js} +16 -16
  316. package/build/{index-0e60b5c7.js → index-ab4cfded.js} +18 -18
  317. package/build/{index-859d9704.js → index-ab6b3ac3.js} +11 -11
  318. package/build/{index-de56de6f.js → index-b84ae41b.js} +14 -14
  319. package/build/{index-7979a7fd.js → index-bc4537bc.js} +3 -3
  320. package/build/{index-9c06a9f8.js → index-bfe68813.js} +6 -6
  321. package/build/{index-31a7199d.js → index-c0e2c07f.js} +2 -2
  322. package/build/{index-2a0e7ab6.js → index-ca31af29.js} +3 -3
  323. package/build/{index-abacafb1.js → index-cca9fd6d.js} +2 -2
  324. package/build/{index-bb486b2b.js → index-d1e98400.js} +16 -16
  325. package/build/{index-07443896.js → index-d6a51c79.js} +2 -2
  326. package/build/{index-af18e92c.js → index-e7761918.js} +3 -3
  327. package/build/{index-2823f5ed.js → index-e8b8cb6b.js} +3 -3
  328. package/build/{index-4b4ffab8.js → index-edc1348b.js} +22 -22
  329. package/build/{index-9a1a2a20.js → index-f2ab0ab4.js} +24 -24
  330. package/build/{index-8ed68f29.js → index-f3aa68a7.js} +15 -15
  331. package/build/{index-5fdcef88.js → index-f723c49d.js} +2 -2
  332. package/build/{index-c74a66ef.js → index-f824d68f.js} +17 -17
  333. package/build/{index-626df4e1.js → index-f9a2c77c.js} +21 -21
  334. package/build/{index-7922e69e.js → index-fb83b2cc.js} +2 -2
  335. package/build/{index-dd216b8d.js → index-ffe2b143.js} +2 -2
  336. package/build/index.js +127 -126
  337. package/build/{labelSorting-7fc632e0.js → labelSorting-362cd978.js} +4 -4
  338. package/build/lead.js +37 -37
  339. package/build/{logoIcon-bfcdf2f9.js → logoIcon-3f185d9f.js} +2 -2
  340. package/build/mantine.js +25 -25
  341. package/build/misc.js +19 -19
  342. package/build/miscGetDynamicHealthTool.js +4 -4
  343. package/build/miscGetSocialList.js +8 -8
  344. package/build/miscScreenSizeContext.js +1 -1
  345. package/build/mobileBottomNavigation.js +5 -5
  346. package/build/mobileBottomNavigationIcon.js +5 -5
  347. package/build/molecules.js +79 -79
  348. package/build/moleculesArticleCard.js +6 -6
  349. package/build/moleculesArticleCardV2.js +17 -17
  350. package/build/navigation.js +49 -49
  351. package/build/navigationLogoutPopup.js +11 -11
  352. package/build/navigationProfileButton.js +27 -27
  353. package/build/onboardingV2.js +29 -29
  354. package/build/organisms.js +62 -62
  355. package/build/{post-a8461958.js → post-09ea2ae6.js} +2 -2
  356. package/build/profileNavigation.js +20 -20
  357. package/build/progressBar.js +1 -1
  358. package/build/pwg.js +23 -23
  359. package/build/ssoV2/screens/updateEmail.d.ts +4 -2
  360. package/build/ssoV2/ssoStateManager/store.d.ts +1 -0
  361. package/build/ssoV2.js +86 -68
  362. package/build/{store-61cad318.js → store-7b4ece91.js} +37 -28
  363. package/build/subot.js +39 -39
  364. package/build/surveyOrPremiumBanner.js +34 -34
  365. package/build/surveyQuestionCard.js +11 -11
  366. package/build/{surveyThankyouCard-896e9d87.js → surveyThankyouCard-bbc979fa.js} +5 -5
  367. package/build/together.js +57 -57
  368. package/build/togetherApiUtils.js +6 -6
  369. package/build/togetherAtoms.js +31 -31
  370. package/build/togetherComponentGlobalContext.js +6 -6
  371. package/build/togetherMolecules.js +52 -52
  372. package/build/togetherMoleculesCardAuthor.js +29 -29
  373. package/build/togetherMoleculesPostImagePreview.js +13 -13
  374. package/build/togetherMoleculesProfileDetail.js +40 -40
  375. package/build/togetherOrganisms.js +51 -51
  376. package/build/togetherRichTextEditor.js +20 -20
  377. package/build/togetherShareBox.js +12 -12
  378. package/build/{transform-f5678a32.js → transform-32454869.js} +27 -27
  379. package/build/{translationsProvider-7e6db534.js → translationsProvider-1561f904.js} +1 -1
  380. package/build/{treePopoverMenu-d6b74bd6.js → treePopoverMenu-75662739.js} +19 -19
  381. package/build/types.js +2 -2
  382. package/build/{useCartCareService-202114a6.js → useCartCareService-69cdb83f.js} +1 -1
  383. package/build/{useHealthToolCache-25f3cf03.js → useHealthToolCache-5bd11566.js} +1 -1
  384. package/build/{usePhoneValidator-36d897da.js → usePhoneValidator-da86ba48.js} +5 -5
  385. package/build/{usePlacesAutocomplete-437f7caf.js → usePlacesAutocomplete-1326ec25.js} +1 -1
  386. package/build/useTogetherAuthRequiredAction.js +10 -10
  387. package/build/{utils-4d304390.js → utils-035b5dce.js} +3 -3
  388. package/build/{utils-1aeabb49.js → utils-14347fda.js} +2 -2
  389. package/build/{utils-082f61e1.js → utils-a1749bd9.js} +5 -5
  390. package/build/{utils-bc652d73.js → utils-d6b2803d.js} +3 -3
  391. package/build/{utils-b3fa920f.js → utils-eee36594.js} +2 -2
  392. package/build/vaccination.js +22 -22
  393. package/package.json +1 -1
  394. package/build/esm/index-3ecee9df.js +0 -31
  395. package/build/index-4519c910.js +0 -38
  396. /package/build/{BMI_BOYS.percentile.monthly-c8cb7280.js → BMI_BOYS.percentile.monthly-65a2c694.js} +0 -0
  397. /package/build/{BMI_BOYS.percentile.weekly-55ff6bc1.js → BMI_BOYS.percentile.weekly-fcc71ab1.js} +0 -0
  398. /package/build/{BMI_BOYS.percentile.yearly-ae309cc1.js → BMI_BOYS.percentile.yearly-1b892cd3.js} +0 -0
  399. /package/build/{BMI_BOYS.zscore.monthly-51faa333.js → BMI_BOYS.zscore.monthly-7b740191.js} +0 -0
  400. /package/build/{BMI_BOYS.zscore.weekly-c8bc4567.js → BMI_BOYS.zscore.weekly-68ae80be.js} +0 -0
  401. /package/build/{BMI_BOYS.zscore.yearly-3e94c386.js → BMI_BOYS.zscore.yearly-0f534a12.js} +0 -0
  402. /package/build/{BMI_GIRLS.percentile.monthly-2f0f4651.js → BMI_GIRLS.percentile.monthly-50efef41.js} +0 -0
  403. /package/build/{BMI_GIRLS.percentile.weekly-f3d8cc3f.js → BMI_GIRLS.percentile.weekly-9ecc57f6.js} +0 -0
  404. /package/build/{BMI_GIRLS.percentile.yearly-ce01bdfd.js → BMI_GIRLS.percentile.yearly-0dd711be.js} +0 -0
  405. /package/build/{BMI_GIRLS.zscore.monthly-c30a5aa7.js → BMI_GIRLS.zscore.monthly-58e6237c.js} +0 -0
  406. /package/build/{BMI_GIRLS.zscore.weekly-850dcf70.js → BMI_GIRLS.zscore.weekly-2d6e5342.js} +0 -0
  407. /package/build/{BMI_GIRLS.zscore.yearly-c14aaf5e.js → BMI_GIRLS.zscore.yearly-ab6d435d.js} +0 -0
  408. /package/build/{ChevronDown-bd7697c4.js → ChevronDown-9759d6d4.js} +0 -0
  409. /package/build/{Close-d80873df.js → Close-11bb7b10.js} +0 -0
  410. /package/build/{Google-7f8e4f6e.js → Google-18e51c62.js} +0 -0
  411. /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-8faeb896.js → HEAD CIRCUM_BOYS.percentile.monthly-7c2899fc.js} +0 -0
  412. /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-e070074f.js → HEAD CIRCUM_BOYS.percentile.weekly-a1992be3.js} +0 -0
  413. /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-820285f4.js → HEAD CIRCUM_BOYS.percentile.yearly-b3a5a7e2.js} +0 -0
  414. /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-1b0097ec.js → HEAD CIRCUM_BOYS.zscore.monthly-8be96658.js} +0 -0
  415. /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-5686ddfb.js → HEAD CIRCUM_BOYS.zscore.weekly-94673fe3.js} +0 -0
  416. /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-ad150e91.js → HEAD CIRCUM_BOYS.zscore.yearly-fc371a3c.js} +0 -0
  417. /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-076cdb96.js → HEAD CIRCUM_GIRLS.percentile.monthly-fdbe4008.js} +0 -0
  418. /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-7ba0f699.js → HEAD CIRCUM_GIRLS.percentile.weekly-506ed0f2.js} +0 -0
  419. /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-c64aece9.js → HEAD CIRCUM_GIRLS.percentile.yearly-7754a604.js} +0 -0
  420. /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-222ef11f.js → HEAD CIRCUM_GIRLS.zscore.monthly-f164b6c5.js} +0 -0
  421. /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-bffe1fde.js → HEAD CIRCUM_GIRLS.zscore.weekly-e66f7327.js} +0 -0
  422. /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-65836f4a.js → HEAD CIRCUM_GIRLS.zscore.yearly-9acb3e24.js} +0 -0
  423. /package/build/{HEIGHT_BOYS.percentile.monthly-312b0a78.js → HEIGHT_BOYS.percentile.monthly-4d9ecc7c.js} +0 -0
  424. /package/build/{HEIGHT_BOYS.percentile.weekly-d4a02b3a.js → HEIGHT_BOYS.percentile.weekly-30231eb9.js} +0 -0
  425. /package/build/{HEIGHT_BOYS.percentile.yearly-4991623c.js → HEIGHT_BOYS.percentile.yearly-1395c6bc.js} +0 -0
  426. /package/build/{HEIGHT_BOYS.zscore.monthly-cf943dab.js → HEIGHT_BOYS.zscore.monthly-ccd38810.js} +0 -0
  427. /package/build/{HEIGHT_BOYS.zscore.weekly-929ee172.js → HEIGHT_BOYS.zscore.weekly-cb9c900e.js} +0 -0
  428. /package/build/{HEIGHT_BOYS.zscore.yearly-1ad495ec.js → HEIGHT_BOYS.zscore.yearly-3a582afc.js} +0 -0
  429. /package/build/{HEIGHT_GIRLS.percentile.monthly-49d5f51f.js → HEIGHT_GIRLS.percentile.monthly-ea021bff.js} +0 -0
  430. /package/build/{HEIGHT_GIRLS.percentile.weekly-a99518f5.js → HEIGHT_GIRLS.percentile.weekly-0c778c01.js} +0 -0
  431. /package/build/{HEIGHT_GIRLS.percentile.yearly-91a3be34.js → HEIGHT_GIRLS.percentile.yearly-4ea99b4d.js} +0 -0
  432. /package/build/{HEIGHT_GIRLS.zscore.monthly-ba8c8e6e.js → HEIGHT_GIRLS.zscore.monthly-9c652aff.js} +0 -0
  433. /package/build/{HEIGHT_GIRLS.zscore.weekly-50353a52.js → HEIGHT_GIRLS.zscore.weekly-69dcc948.js} +0 -0
  434. /package/build/{HEIGHT_GIRLS.zscore.yearly-d1b5f969.js → HEIGHT_GIRLS.zscore.yearly-21320bd4.js} +0 -0
  435. /package/build/{Locale-daf9aa88.js → Locale-85f7b9a8.js} +0 -0
  436. /package/build/{Visible-2b15fba4.js → Visible-e563038c.js} +0 -0
  437. /package/build/{WEIGHT_BOYS.percentile.monthly-5d6787ce.js → WEIGHT_BOYS.percentile.monthly-ee95bd2d.js} +0 -0
  438. /package/build/{WEIGHT_BOYS.percentile.weekly-1a860b4b.js → WEIGHT_BOYS.percentile.weekly-e1dbafce.js} +0 -0
  439. /package/build/{WEIGHT_BOYS.percentile.yearly-fd57716a.js → WEIGHT_BOYS.percentile.yearly-8310fc27.js} +0 -0
  440. /package/build/{WEIGHT_BOYS.zscore.monthly-a0acd992.js → WEIGHT_BOYS.zscore.monthly-36bb1cb8.js} +0 -0
  441. /package/build/{WEIGHT_BOYS.zscore.weekly-89ef1904.js → WEIGHT_BOYS.zscore.weekly-03b15883.js} +0 -0
  442. /package/build/{WEIGHT_BOYS.zscore.yearly-7da1d40a.js → WEIGHT_BOYS.zscore.yearly-54bf4bbe.js} +0 -0
  443. /package/build/{WEIGHT_GIRLS.percentile.monthly-6f58db3e.js → WEIGHT_GIRLS.percentile.monthly-516b868d.js} +0 -0
  444. /package/build/{WEIGHT_GIRLS.percentile.weekly-86271d0c.js → WEIGHT_GIRLS.percentile.weekly-40bd618a.js} +0 -0
  445. /package/build/{WEIGHT_GIRLS.percentile.yearly-0ef79884.js → WEIGHT_GIRLS.percentile.yearly-9bc8dfee.js} +0 -0
  446. /package/build/{WEIGHT_GIRLS.zscore.monthly-b25a4c9b.js → WEIGHT_GIRLS.zscore.monthly-8a2c9bef.js} +0 -0
  447. /package/build/{WEIGHT_GIRLS.zscore.weekly-370bd448.js → WEIGHT_GIRLS.zscore.weekly-0facc988.js} +0 -0
  448. /package/build/{WEIGHT_GIRLS.zscore.yearly-f9e4eee1.js → WEIGHT_GIRLS.zscore.yearly-37f3cdf1.js} +0 -0
  449. /package/build/{ageGenerate-15148d2a.js → ageGenerate-f36f2e26.js} +0 -0
  450. /package/build/{animation-2da7465d.js → animation-5dd10c52.js} +0 -0
  451. /package/build/{constants-d45110a8.js → constants-1371698c.js} +0 -0
  452. /package/build/{constants-01227b75.js → constants-f5a5e3e9.js} +0 -0
  453. /package/build/{context-e82deb48.js → context-b1fdb578.js} +0 -0
  454. /package/build/{dataTransform-88f89c7a.js → dataTransform-7ae4e690.js} +0 -0
  455. /package/build/esm/{BMI_BOYS.percentile.monthly-59d604f6.js → BMI_BOYS.percentile.monthly-bf3e8564.js} +0 -0
  456. /package/build/esm/{BMI_BOYS.percentile.weekly-fc44a5b7.js → BMI_BOYS.percentile.weekly-d1e9ec54.js} +0 -0
  457. /package/build/esm/{BMI_BOYS.percentile.yearly-9176e4e1.js → BMI_BOYS.percentile.yearly-6b6fed61.js} +0 -0
  458. /package/build/esm/{BMI_BOYS.zscore.monthly-6e573c0b.js → BMI_BOYS.zscore.monthly-38b81bfe.js} +0 -0
  459. /package/build/esm/{BMI_BOYS.zscore.weekly-1745ebd4.js → BMI_BOYS.zscore.weekly-a446b1e5.js} +0 -0
  460. /package/build/esm/{BMI_BOYS.zscore.yearly-1476fb3a.js → BMI_BOYS.zscore.yearly-94fa1e6d.js} +0 -0
  461. /package/build/esm/{BMI_GIRLS.percentile.monthly-d2d35df9.js → BMI_GIRLS.percentile.monthly-3b850cb5.js} +0 -0
  462. /package/build/esm/{BMI_GIRLS.percentile.weekly-6c19387b.js → BMI_GIRLS.percentile.weekly-796b574c.js} +0 -0
  463. /package/build/esm/{BMI_GIRLS.percentile.yearly-06cc8ebe.js → BMI_GIRLS.percentile.yearly-2f3a1e7e.js} +0 -0
  464. /package/build/esm/{BMI_GIRLS.zscore.monthly-fd5ac2e5.js → BMI_GIRLS.zscore.monthly-8fb10f7d.js} +0 -0
  465. /package/build/esm/{BMI_GIRLS.zscore.weekly-f68aa046.js → BMI_GIRLS.zscore.weekly-62a4dbe5.js} +0 -0
  466. /package/build/esm/{BMI_GIRLS.zscore.yearly-0c048503.js → BMI_GIRLS.zscore.yearly-69c07b5e.js} +0 -0
  467. /package/build/esm/{ChevronDown-99190b49.js → ChevronDown-daaa091a.js} +0 -0
  468. /package/build/esm/{Close-4c9c5d81.js → Close-cd4cb99c.js} +0 -0
  469. /package/build/esm/{Google-49452371.js → Google-b64103d0.js} +0 -0
  470. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.monthly-d369c45c.js → HEAD CIRCUM_BOYS.percentile.monthly-84a534f4.js} +0 -0
  471. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.weekly-2c48fafc.js → HEAD CIRCUM_BOYS.percentile.weekly-0e6317ed.js} +0 -0
  472. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.yearly-e794341e.js → HEAD CIRCUM_BOYS.percentile.yearly-8dc09a00.js} +0 -0
  473. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.monthly-407b0528.js → HEAD CIRCUM_BOYS.zscore.monthly-f7b7f4d3.js} +0 -0
  474. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.weekly-771bbb48.js → HEAD CIRCUM_BOYS.zscore.weekly-00e748f3.js} +0 -0
  475. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.yearly-623d50eb.js → HEAD CIRCUM_BOYS.zscore.yearly-192f0e61.js} +0 -0
  476. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.monthly-214f1990.js → HEAD CIRCUM_GIRLS.percentile.monthly-92680448.js} +0 -0
  477. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.weekly-7cbe6fff.js → HEAD CIRCUM_GIRLS.percentile.weekly-7a01c7fe.js} +0 -0
  478. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.yearly-28207825.js → HEAD CIRCUM_GIRLS.percentile.yearly-8dd2aa01.js} +0 -0
  479. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.monthly-9e25b76a.js → HEAD CIRCUM_GIRLS.zscore.monthly-55c16151.js} +0 -0
  480. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.weekly-32881b18.js → HEAD CIRCUM_GIRLS.zscore.weekly-44832872.js} +0 -0
  481. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.yearly-4f8e0a2e.js → HEAD CIRCUM_GIRLS.zscore.yearly-b46ce7d2.js} +0 -0
  482. /package/build/esm/{HEIGHT_BOYS.percentile.monthly-6a5617db.js → HEIGHT_BOYS.percentile.monthly-9937c4a3.js} +0 -0
  483. /package/build/esm/{HEIGHT_BOYS.percentile.weekly-f5400955.js → HEIGHT_BOYS.percentile.weekly-0f3e1872.js} +0 -0
  484. /package/build/esm/{HEIGHT_BOYS.percentile.yearly-7d0b1c6e.js → HEIGHT_BOYS.percentile.yearly-78b136a8.js} +0 -0
  485. /package/build/esm/{HEIGHT_BOYS.zscore.monthly-d03f1410.js → HEIGHT_BOYS.zscore.monthly-89f707b7.js} +0 -0
  486. /package/build/esm/{HEIGHT_BOYS.zscore.weekly-54afffac.js → HEIGHT_BOYS.zscore.weekly-7c047da0.js} +0 -0
  487. /package/build/esm/{HEIGHT_BOYS.zscore.yearly-395598e5.js → HEIGHT_BOYS.zscore.yearly-24bb0c90.js} +0 -0
  488. /package/build/esm/{HEIGHT_GIRLS.percentile.monthly-202e9f0a.js → HEIGHT_GIRLS.percentile.monthly-44bfca68.js} +0 -0
  489. /package/build/esm/{HEIGHT_GIRLS.percentile.weekly-0c2d2912.js → HEIGHT_GIRLS.percentile.weekly-14052ade.js} +0 -0
  490. /package/build/esm/{HEIGHT_GIRLS.percentile.yearly-edbc48dd.js → HEIGHT_GIRLS.percentile.yearly-42bca689.js} +0 -0
  491. /package/build/esm/{HEIGHT_GIRLS.zscore.monthly-6c102061.js → HEIGHT_GIRLS.zscore.monthly-9e7a96b1.js} +0 -0
  492. /package/build/esm/{HEIGHT_GIRLS.zscore.weekly-c068f6e5.js → HEIGHT_GIRLS.zscore.weekly-f3a1bbdd.js} +0 -0
  493. /package/build/esm/{HEIGHT_GIRLS.zscore.yearly-62525f1e.js → HEIGHT_GIRLS.zscore.yearly-b09cbe8e.js} +0 -0
  494. /package/build/esm/{Locale-dd85e540.js → Locale-bde7723e.js} +0 -0
  495. /package/build/esm/{Visible-ca95870e.js → Visible-262501a6.js} +0 -0
  496. /package/build/esm/{WEIGHT_BOYS.percentile.monthly-b0ec8b51.js → WEIGHT_BOYS.percentile.monthly-727a38bf.js} +0 -0
  497. /package/build/esm/{WEIGHT_BOYS.percentile.weekly-cbace597.js → WEIGHT_BOYS.percentile.weekly-a1049334.js} +0 -0
  498. /package/build/esm/{WEIGHT_BOYS.percentile.yearly-bd229dcb.js → WEIGHT_BOYS.percentile.yearly-51ecc876.js} +0 -0
  499. /package/build/esm/{WEIGHT_BOYS.zscore.monthly-8a2526bd.js → WEIGHT_BOYS.zscore.monthly-f18584fe.js} +0 -0
  500. /package/build/esm/{WEIGHT_BOYS.zscore.weekly-010ccb5d.js → WEIGHT_BOYS.zscore.weekly-cc713a38.js} +0 -0
  501. /package/build/esm/{WEIGHT_BOYS.zscore.yearly-807fb74a.js → WEIGHT_BOYS.zscore.yearly-acefa3a6.js} +0 -0
  502. /package/build/esm/{WEIGHT_GIRLS.percentile.monthly-188cf1de.js → WEIGHT_GIRLS.percentile.monthly-1029a058.js} +0 -0
  503. /package/build/esm/{WEIGHT_GIRLS.percentile.weekly-edcf30aa.js → WEIGHT_GIRLS.percentile.weekly-a090637e.js} +0 -0
  504. /package/build/esm/{WEIGHT_GIRLS.percentile.yearly-11916aa1.js → WEIGHT_GIRLS.percentile.yearly-afdbc3e8.js} +0 -0
  505. /package/build/esm/{WEIGHT_GIRLS.zscore.monthly-02e4f36e.js → WEIGHT_GIRLS.zscore.monthly-8a750312.js} +0 -0
  506. /package/build/esm/{WEIGHT_GIRLS.zscore.weekly-f04180c7.js → WEIGHT_GIRLS.zscore.weekly-b4d37963.js} +0 -0
  507. /package/build/esm/{WEIGHT_GIRLS.zscore.yearly-b0f6b466.js → WEIGHT_GIRLS.zscore.yearly-f2a267ff.js} +0 -0
  508. /package/build/esm/{ageGenerate-a19ee554.js → ageGenerate-c9d29857.js} +0 -0
  509. /package/build/esm/{animation-530c8713.js → animation-09bb9be0.js} +0 -0
  510. /package/build/esm/{constants-2a6f0822.js → constants-6301f0d0.js} +0 -0
  511. /package/build/esm/{constants-ebf82e1d.js → constants-9af47b1e.js} +0 -0
  512. /package/build/esm/{context-adea3929.js → context-3dffc612.js} +0 -0
  513. /package/build/esm/{dataTransform-31b69b1f.js → dataTransform-afde61d4.js} +0 -0
  514. /package/build/esm/{index-f3b9047f.js → index-500df0ee.js} +0 -0
  515. /package/build/esm/{index-676cea42.js → index-5cc8df17.js} +0 -0
  516. /package/build/esm/{index-b2a8a256.js → index-6746d426.js} +0 -0
  517. /package/build/esm/{index-10d0027c.js → index-71baf880.js} +0 -0
  518. /package/build/esm/{index-40178353.js → index-b5a44334.js} +0 -0
  519. /package/build/esm/{index-22cb52ac.js → index-dd16e62e.js} +0 -0
  520. /package/build/esm/{index-edde0d78.js → index-e6dffffc.js} +0 -0
  521. /package/build/esm/{index-43a9fa15.js → index-f0b0715c.js} +0 -0
  522. /package/build/esm/{index-52105956.js → index-fe128816.js} +0 -0
  523. /package/build/esm/{index.styles-fc1f3f4c.js → index.styles-d52bf774.js} +0 -0
  524. /package/build/esm/{localizeNumberFormat-02aa10d8.js → localizeNumberFormat-b19d8eec.js} +0 -0
  525. /package/build/esm/{normalizeLink-be7f4c29.js → normalizeLink-6d42a0bc.js} +0 -0
  526. /package/build/esm/{number-323db2e3.js → number-b32624ac.js} +0 -0
  527. /package/build/esm/{paths-57889e7a.js → paths-5c22a210.js} +0 -0
  528. /package/build/esm/{shared-ddb4a7c0.js → shared-560368e5.js} +0 -0
  529. /package/build/esm/{translationsContext-9ccdd735.js → translationsContext-5acae5f5.js} +0 -0
  530. /package/build/esm/{tslib.es6-eac05ee6.js → tslib.es6-7594be27.js} +0 -0
  531. /package/build/esm/{types-f3c62b8e.js → types-55e3660e.js} +0 -0
  532. /package/build/esm/{types-1da79786.js → types-fab32dfb.js} +0 -0
  533. /package/build/esm/{useOutsideClick-7b0e73bb.js → useOutsideClick-82ed3e36.js} +0 -0
  534. /package/build/esm/{useScrollbarSize-cbeb3de3.js → useScrollbarSize-74b70a1e.js} +0 -0
  535. /package/build/esm/{useUniqueId-09a9a15d.js → useUniqueId-37bb9e6d.js} +0 -0
  536. /package/build/esm/{utils-f2c14fb6.js → utils-93701764.js} +0 -0
  537. /package/build/esm/{utils-8fa947f2.js → utils-d5381d49.js} +0 -0
  538. /package/build/{index-a185e6c8.js → index-0bd9253d.js} +0 -0
  539. /package/build/{index-ff0be8db.js → index-1b5bbe05.js} +0 -0
  540. /package/build/{index-0b65a3e1.js → index-3e9bb95c.js} +0 -0
  541. /package/build/{index-6116f62d.js → index-6725888f.js} +0 -0
  542. /package/build/{index-cad29f79.js → index-9dbb13e5.js} +0 -0
  543. /package/build/{index-de2e9a33.js → index-9e3f8c10.js} +0 -0
  544. /package/build/{index-6c22e2d3.js → index-d7620e71.js} +0 -0
  545. /package/build/{index-3658a241.js → index-e003c7c0.js} +0 -0
  546. /package/build/{index-7305ec62.js → index-e935df00.js} +0 -0
  547. /package/build/{index.styles-7654fb59.js → index.styles-a60af306.js} +0 -0
  548. /package/build/{localizeNumberFormat-0c6e5858.js → localizeNumberFormat-035193f3.js} +0 -0
  549. /package/build/{normalizeLink-9cbdcafa.js → normalizeLink-f6cd6ba5.js} +0 -0
  550. /package/build/{number-10ca56f4.js → number-3a577940.js} +0 -0
  551. /package/build/{paths-60d5e970.js → paths-2d3f4bcc.js} +0 -0
  552. /package/build/{shared-7b7b3f13.js → shared-81241070.js} +0 -0
  553. /package/build/{translationsContext-9b0d023d.js → translationsContext-e37d46a0.js} +0 -0
  554. /package/build/{tslib.es6-7d483fc2.js → tslib.es6-1a97736c.js} +0 -0
  555. /package/build/{types-ed1ecac3.js → types-2b3e6454.js} +0 -0
  556. /package/build/{types-9d499822.js → types-efe6793c.js} +0 -0
  557. /package/build/{useOutsideClick-c0a2806b.js → useOutsideClick-9de9db39.js} +0 -0
  558. /package/build/{useScrollbarSize-96b32242.js → useScrollbarSize-454f6b9c.js} +0 -0
  559. /package/build/{useUniqueId-36c15220.js → useUniqueId-0f994efe.js} +0 -0
  560. /package/build/{utils-3b9fef4f.js → utils-7710be1a.js} +0 -0
  561. /package/build/{utils-06f796b5.js → utils-da3d064f.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-e8fd9273.js';
6
+ import { a as useOutsideClick } from './useOutsideClick-82ed3e36.js';
7
+ import { u as useTranslations } from './index-b8257c21.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-9af47b1e.js';
10
+ import styled from '@emotion/styled';
11
+ import { theme } from './miscTheme.js';
12
+ import { M as MediaQueries } from './utils-d5381d49.js';
13
+ import { C as Container } from './index-500df0ee.js';
14
+ import { T as Text } from './index-b32b0f9c.js';
15
+ import { C as ChevronDown } from './ChevronDown-daaa091a.js';
16
+ import { _ as __rest } from './tslib.es6-7594be27.js';
17
+ import { ArrowLeft } from '@hhgtech/icons/arrow';
18
+ import { M as Modal } from './index-d4adbb94.js';
19
+ import { P as PATHS } from './paths-5c22a210.js';
20
+ import { B as Button } from './index-9f33d631.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 };