@hhgtech/hhg-components 1.28.39 → 1.28.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/babyGrowth.js +2 -2
- package/build/cache.js +1 -1
- package/build/care/components/organisms/bookingSearchBarV2/searchInputs/index.d.ts +2 -1
- package/build/care.js +1 -1
- package/build/components/molecules/dropdown/index.styled.d.ts +1 -1
- package/build/components.js +1 -1
- package/build/{constants-57d89069.js → constants-55a2b4cb.js} +1 -1
- package/build/{constants-82348c13.js → constants-d67df371.js} +1 -1
- package/build/constants.js +1 -1
- package/build/{core-081bdce5.js → core-3dfeee83.js} +1 -1
- package/build/ecom.js +1 -1
- package/build/esm/babyGrowth.js +4 -4
- package/build/esm/cache.js +1 -1
- package/build/esm/care/components/organisms/bookingSearchBarV2/searchInputs/index.d.ts +2 -1
- package/build/esm/care.js +1 -1
- package/build/esm/components/molecules/dropdown/index.styled.d.ts +1 -1
- package/build/esm/components.js +1 -1
- package/build/esm/{constants-0d46ae1d.js → constants-8dc38f9e.js} +1 -1
- package/build/esm/{constants-039f36fe.js → constants-fe146bd1.js} +1 -1
- package/build/esm/constants.js +1 -1
- package/build/esm/{core-3c0d6b0f.js → core-a3b3b447.js} +1 -1
- package/build/esm/ecom.js +1 -1
- package/build/esm/footer.js +1 -1
- package/build/esm/gAssets.js +1 -1
- package/build/esm/{getDynamicHealthTool-d874b77f.js → getDynamicHealthTool-781262ca.js} +1 -1
- package/build/esm/{getSocialList-5ea15cba.js → getSocialList-f4d07c8e.js} +1 -1
- package/build/esm/hooks.js +1 -1
- package/build/esm/i18n.js +1 -1
- package/build/esm/i18nV2.js +1 -1
- package/build/esm/{index-434197c4.js → index-00d3e532.js} +1 -1
- package/build/esm/{index-14839883.js → index-27df5763.js} +1 -1
- package/build/esm/{index-282bbb6d.js → index-2e1d6359.js} +1 -1
- package/build/esm/{index-20b84b31.js → index-53b0f26d.js} +1 -1
- package/build/esm/{index-7d0179b5.js → index-5d380017.js} +1 -1
- package/build/esm/{index-6795099e.js → index-5f2067d5.js} +1 -1
- package/build/esm/index-68094777.js +1 -0
- package/build/esm/{index-1be91706.js → index-70655f2a.js} +1 -1
- package/build/esm/{index-8db07311.js → index-76a540e6.js} +1 -1
- package/build/esm/{index-fa32b4d8.js → index-8118170d.js} +1 -1
- package/build/esm/{index-e17cd802.js → index-81be61aa.js} +1 -1
- package/build/esm/{index-f1ff7dac.js → index-8680e894.js} +1 -1
- package/build/esm/index-8951aade.js +1 -0
- package/build/esm/{index-1ac72931.js → index-8b7c8eb1.js} +1 -1
- package/build/esm/{index-dff74895.js → index-a954e49f.js} +1 -1
- package/build/esm/{index-5ecfac85.js → index-ad6cd88d.js} +1 -1
- package/build/esm/{index-0e6dbcc0.js → index-b735052e.js} +1 -1
- package/build/esm/{index-5761cc3d.js → index-b98d1a30.js} +1 -1
- package/build/esm/{index-8dfb1724.js → index-bed044a7.js} +1 -1
- package/build/esm/{index-622dbaca.js → index-d51eb02e.js} +1 -1
- package/build/esm/{index-c70696a6.js → index-dd278d18.js} +7 -7
- package/build/esm/{index-3d1ca95c.js → index-fc00d32b.js} +1 -1
- package/build/esm/index.js +1 -1
- package/build/esm/{index.styled-e26007df.js → index.styled-2daeb250.js} +6 -6
- package/build/esm/{index.styled-ede7c10d.js → index.styled-5882c35f.js} +1 -1
- package/build/esm/{index.styled-90fe28c0.js → index.styled-6252f77a.js} +1 -1
- package/build/esm/{index.styled-a1854a4a.js → index.styled-886c957e.js} +76 -76
- package/build/esm/{index.styles-95837b62.js → index.styles-874ee5cd.js} +5 -5
- package/build/esm/lead.js +1 -1
- package/build/esm/mantine.js +1 -1
- package/build/esm/misc.js +1 -1
- package/build/esm/navigation.js +1 -1
- package/build/esm/onboardingV2.js +9 -9
- package/build/esm/pwg.js +3 -3
- package/build/esm/{routing-7c32cdb3.js → routing-be087f5b.js} +1 -1
- package/build/esm/subot.js +1 -1
- package/build/esm/together.js +1 -1
- package/build/esm/{types-d466572e.js → types-1267dbbc.js} +1 -1
- package/build/esm/{types-c5a3b173.js → types-94add167.js} +7 -7
- package/build/esm/types.js +1 -1
- package/build/esm/{useCategory-702b6604.js → useCategory-440b7f9a.js} +1 -1
- package/build/esm/useHealthToolCache-1f203ca0.js +1 -0
- package/build/esm/{usePlacesAutocomplete-d14c4671.js → usePlacesAutocomplete-8e10c310.js} +1 -1
- package/build/esm/{useRafState-1ba3edb3.js → useRafState-4a14b267.js} +1 -1
- package/build/esm/{useTranslations-51dc4ab8.js → useTranslations-6b1653a2.js} +1 -1
- package/build/esm/{utils-b2a0d664.js → utils-1e95a4d1.js} +1 -1
- package/build/esm/{utils-8849cc57.js → utils-ab72b62f.js} +1 -1
- package/build/esm/vaccination.js +11 -11
- package/build/footer.js +1 -1
- package/build/gAssets.js +1 -1
- package/build/getDynamicHealthTool-398ca351.js +1 -0
- package/build/{getSocialList-55a29d3a.js → getSocialList-30296f8a.js} +1 -1
- package/build/hooks.js +1 -1
- package/build/i18n.js +1 -1
- package/build/i18nV2.js +1 -1
- package/build/index-0a124e5f.js +1 -0
- package/build/{index-e23393d6.js → index-11eb8c8c.js} +1 -1
- package/build/{index-cbb25109.js → index-19ab75f5.js} +10 -10
- package/build/{index-543b2956.js → index-1b06cb3e.js} +1 -1
- package/build/{index-80a776c5.js → index-1f4a8940.js} +1 -1
- package/build/{index-5a09ea5b.js → index-5cb3e60f.js} +1 -1
- package/build/{index-511b99c0.js → index-5d9cc019.js} +1 -1
- package/build/{index-e4732cde.js → index-77319653.js} +1 -1
- package/build/index-8673af8a.js +1 -0
- package/build/{index-dd161fb0.js → index-95cd2806.js} +1 -1
- package/build/{index-557f79d9.js → index-9d548edc.js} +1 -1
- package/build/{index-1cc9c0e2.js → index-a25f5546.js} +1 -1
- package/build/{index-505a6231.js → index-a74cf615.js} +3 -3
- package/build/{index-9686d73a.js → index-aeb0ae12.js} +1 -1
- package/build/{index-192c3976.js → index-b0fae554.js} +1 -1
- package/build/{index-70fc6801.js → index-b9a7f78c.js} +1 -1
- package/build/{index-5537eb8b.js → index-bb56ac1b.js} +1 -1
- package/build/{index-8a4e8200.js → index-be8bd1aa.js} +1 -1
- package/build/{index-f20a3b0b.js → index-dd2f12d8.js} +1 -1
- package/build/{index-566d616e.js → index-e2e01405.js} +1 -1
- package/build/{index-cda192d8.js → index-ef0f4c83.js} +1 -1
- package/build/{index-2744bd7d.js → index-f7640569.js} +1 -1
- package/build/index.js +1 -1
- package/build/{index.styled-95722c0d.js → index.styled-4108cde2.js} +1 -1
- package/build/{index.styled-edaa5fca.js → index.styled-44a88d2d.js} +1 -1
- package/build/index.styled-56b27702.js +50 -0
- package/build/{index.styled-bf702a00.js → index.styled-d9e7dba1.js} +1 -1
- package/build/{index.styles-eee657e0.js → index.styles-d3b67125.js} +1 -1
- package/build/lead.js +1 -1
- package/build/mantine.js +1 -1
- package/build/misc.js +1 -1
- package/build/navigation.js +1 -1
- package/build/onboardingV2.js +1 -1
- package/build/pwg.js +2 -2
- package/build/{routing-d19d8856.js → routing-1e951b79.js} +1 -1
- package/build/subot.js +1 -1
- package/build/together.js +1 -1
- package/build/{types-e7648820.js → types-eeedddb1.js} +9 -9
- package/build/{types-ec42e31c.js → types-f3bf297f.js} +1 -1
- package/build/types.js +1 -1
- package/build/{useCategory-15d34903.js → useCategory-eea8836a.js} +1 -1
- package/build/{useHealthToolCache-af770568.js → useHealthToolCache-cf34e8b1.js} +1 -1
- package/build/{usePlacesAutocomplete-24621567.js → usePlacesAutocomplete-ce74a3d9.js} +1 -1
- package/build/{useRafState-80bb67ea.js → useRafState-05392c62.js} +1 -1
- package/build/{useTranslations-2e112ad4.js → useTranslations-7f12251c.js} +1 -1
- package/build/{utils-6f3d330e.js → utils-00a7b97a.js} +1 -1
- package/build/utils-86f4b1f3.js +1 -0
- package/build/vaccination.js +1 -1
- package/package.json +1 -1
- package/build/esm/index-65d31851.js +0 -1
- package/build/esm/index-c7136b2d.js +0 -1
- package/build/esm/useHealthToolCache-1290f2b9.js +0 -1
- package/build/getDynamicHealthTool-12e2540d.js +0 -1
- package/build/index-86314983.js +0 -1
- package/build/index-b983594e.js +0 -1
- package/build/index.styled-7c52b155.js +0 -50
- package/build/utils-a167e7a3.js +0 -1
- /package/build/{BMI_BOYS.percentile.monthly-1abf1841.js → BMI_BOYS.percentile.monthly-a0d59c80.js} +0 -0
- /package/build/{BMI_BOYS.percentile.weekly-a8aff425.js → BMI_BOYS.percentile.weekly-e1b9c439.js} +0 -0
- /package/build/{BMI_BOYS.percentile.yearly-c73321bb.js → BMI_BOYS.percentile.yearly-8b8cc180.js} +0 -0
- /package/build/{BMI_BOYS.zscore.monthly-69a99c2a.js → BMI_BOYS.zscore.monthly-6b9e2b9d.js} +0 -0
- /package/build/{BMI_BOYS.zscore.weekly-f990fa6a.js → BMI_BOYS.zscore.weekly-0266f3d0.js} +0 -0
- /package/build/{BMI_BOYS.zscore.yearly-ed65c22b.js → BMI_BOYS.zscore.yearly-0a6c0714.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.monthly-4c7cb156.js → BMI_GIRLS.percentile.monthly-b92651f5.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.weekly-d570954a.js → BMI_GIRLS.percentile.weekly-642d38d3.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.yearly-61a85bc5.js → BMI_GIRLS.percentile.yearly-29d10559.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.monthly-f20b70e4.js → BMI_GIRLS.zscore.monthly-8ecfee03.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.weekly-178a1989.js → BMI_GIRLS.zscore.weekly-7eb8315e.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.yearly-88ad18e5.js → BMI_GIRLS.zscore.yearly-75127200.js} +0 -0
- /package/build/{ChevronDown-3037c172.js → ChevronDown-2eede824.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-56a4402b.js → HEAD CIRCUM_BOYS.percentile.monthly-90eb2bd6.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-ccf3c87f.js → HEAD CIRCUM_BOYS.percentile.weekly-4aed1c5b.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-2b9916f6.js → HEAD CIRCUM_BOYS.percentile.yearly-694366d9.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-bc3fdf65.js → HEAD CIRCUM_BOYS.zscore.monthly-dde69bd2.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-a3275cbb.js → HEAD CIRCUM_BOYS.zscore.weekly-14591739.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-424de02b.js → HEAD CIRCUM_BOYS.zscore.yearly-5731ed20.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-31cf5774.js → HEAD CIRCUM_GIRLS.percentile.monthly-f361d369.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-56bc87df.js → HEAD CIRCUM_GIRLS.percentile.weekly-9fd785d7.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-d495ae77.js → HEAD CIRCUM_GIRLS.percentile.yearly-9c7b567a.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-389b52dc.js → HEAD CIRCUM_GIRLS.zscore.monthly-4a6f37b4.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-545c913f.js → HEAD CIRCUM_GIRLS.zscore.weekly-ccff7ad3.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-25153e42.js → HEAD CIRCUM_GIRLS.zscore.yearly-c083a5da.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.monthly-a0167766.js → HEIGHT_BOYS.percentile.monthly-eec60602.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.weekly-fe6c86b4.js → HEIGHT_BOYS.percentile.weekly-013e3c41.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.yearly-b5f70609.js → HEIGHT_BOYS.percentile.yearly-a93bc668.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.monthly-69050519.js → HEIGHT_BOYS.zscore.monthly-95bd39db.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.weekly-086ed503.js → HEIGHT_BOYS.zscore.weekly-230c4ec5.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.yearly-ea1fd110.js → HEIGHT_BOYS.zscore.yearly-92bd30b0.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.monthly-04393cf7.js → HEIGHT_GIRLS.percentile.monthly-1dcdcb29.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.weekly-309dd221.js → HEIGHT_GIRLS.percentile.weekly-836fe160.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.yearly-3fe7b9fc.js → HEIGHT_GIRLS.percentile.yearly-2c506c97.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.monthly-a274d11d.js → HEIGHT_GIRLS.zscore.monthly-72e99c05.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.weekly-832a2702.js → HEIGHT_GIRLS.zscore.weekly-679708d2.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.yearly-e1250f72.js → HEIGHT_GIRLS.zscore.yearly-5e1ed085.js} +0 -0
- /package/build/{Subot-b76ccc9c.js → Subot-6070090a.js} +0 -0
- /package/build/{Visible-a902bc5d.js → Visible-97fdcb84.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.monthly-6aee36d0.js → WEIGHT_BOYS.percentile.monthly-b186f11d.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.weekly-84a9ddf3.js → WEIGHT_BOYS.percentile.weekly-29e9e425.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.yearly-6a5235a6.js → WEIGHT_BOYS.percentile.yearly-c6acc443.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.monthly-7b87e89a.js → WEIGHT_BOYS.zscore.monthly-74db320f.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.weekly-7dc34a8b.js → WEIGHT_BOYS.zscore.weekly-d0e93c78.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.yearly-8cde12c0.js → WEIGHT_BOYS.zscore.yearly-fe926c67.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.monthly-c1117e84.js → WEIGHT_GIRLS.percentile.monthly-d295e838.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.weekly-5da1d720.js → WEIGHT_GIRLS.percentile.weekly-c0cfc1ec.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.yearly-a23ec4ec.js → WEIGHT_GIRLS.percentile.yearly-425bc702.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.monthly-2f26e279.js → WEIGHT_GIRLS.zscore.monthly-b276e14a.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.weekly-8b0a38e9.js → WEIGHT_GIRLS.zscore.weekly-6259a761.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.yearly-8bad89fe.js → WEIGHT_GIRLS.zscore.yearly-61d76228.js} +0 -0
- /package/build/{cookieHelper-edf24fec.js → cookieHelper-50f349a8.js} +0 -0
- /package/build/{dataTransform-e2f61d60.js → dataTransform-57927b35.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.monthly-b9ab85f0.js → BMI_BOYS.percentile.monthly-e4505b15.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.weekly-ef82192f.js → BMI_BOYS.percentile.weekly-b013d877.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.yearly-183654c8.js → BMI_BOYS.percentile.yearly-9c039626.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.monthly-6eda6e64.js → BMI_BOYS.zscore.monthly-a7b0ea3d.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.weekly-2e5db2e4.js → BMI_BOYS.zscore.weekly-b82813b8.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.yearly-89b97ccc.js → BMI_BOYS.zscore.yearly-db29f80a.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.monthly-c2dca76b.js → BMI_GIRLS.percentile.monthly-7e170f4c.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.weekly-3db696ed.js → BMI_GIRLS.percentile.weekly-dc3cd239.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.yearly-d3831386.js → BMI_GIRLS.percentile.yearly-2b2f9527.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.monthly-9cef6f5e.js → BMI_GIRLS.zscore.monthly-f966c405.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.weekly-78f3bce3.js → BMI_GIRLS.zscore.weekly-dd6e2237.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.yearly-50c1c22d.js → BMI_GIRLS.zscore.yearly-c7c05089.js} +0 -0
- /package/build/esm/{ChevronDown-38081c52.js → ChevronDown-48e13c4f.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.monthly-768e0230.js → HEAD CIRCUM_BOYS.percentile.monthly-de572089.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.weekly-68c28fef.js → HEAD CIRCUM_BOYS.percentile.weekly-22fde075.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.yearly-79c477be.js → HEAD CIRCUM_BOYS.percentile.yearly-acf497dc.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.monthly-c22a6bb8.js → HEAD CIRCUM_BOYS.zscore.monthly-5e0383bb.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.weekly-fa0c45de.js → HEAD CIRCUM_BOYS.zscore.weekly-cbffaac5.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.yearly-fd828878.js → HEAD CIRCUM_BOYS.zscore.yearly-e8f566d5.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.monthly-0e370871.js → HEAD CIRCUM_GIRLS.percentile.monthly-70692043.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.weekly-f4708552.js → HEAD CIRCUM_GIRLS.percentile.weekly-38c30ebd.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.yearly-dfb103cf.js → HEAD CIRCUM_GIRLS.percentile.yearly-b60f18aa.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.monthly-3ee0be1b.js → HEAD CIRCUM_GIRLS.zscore.monthly-c4979e55.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.weekly-44bcc793.js → HEAD CIRCUM_GIRLS.zscore.weekly-45f350f3.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.yearly-a1027497.js → HEAD CIRCUM_GIRLS.zscore.yearly-cecec861.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.monthly-02e472da.js → HEIGHT_BOYS.percentile.monthly-df51d068.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.weekly-0680ad0c.js → HEIGHT_BOYS.percentile.weekly-dccf4b38.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.yearly-6f8aae30.js → HEIGHT_BOYS.percentile.yearly-8a701ad8.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.monthly-c4cd5e14.js → HEIGHT_BOYS.zscore.monthly-dfc95b22.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.weekly-44a38e55.js → HEIGHT_BOYS.zscore.weekly-c75310ec.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.yearly-07fc5764.js → HEIGHT_BOYS.zscore.yearly-967076a6.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.monthly-747f685b.js → HEIGHT_GIRLS.percentile.monthly-e130c053.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.weekly-f8a8a438.js → HEIGHT_GIRLS.percentile.weekly-b22650c5.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.yearly-19c6a95d.js → HEIGHT_GIRLS.percentile.yearly-62993fa6.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.monthly-a70d26ec.js → HEIGHT_GIRLS.zscore.monthly-602da367.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.weekly-80c3120b.js → HEIGHT_GIRLS.zscore.weekly-053b19bc.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.yearly-55b48c0f.js → HEIGHT_GIRLS.zscore.yearly-c8ee8767.js} +0 -0
- /package/build/esm/{Subot-f581f4df.js → Subot-36ac5f94.js} +0 -0
- /package/build/esm/{Visible-773a840f.js → Visible-fa814ffe.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.monthly-c7365e22.js → WEIGHT_BOYS.percentile.monthly-642abc40.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.weekly-5d62ee47.js → WEIGHT_BOYS.percentile.weekly-26521de2.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.yearly-90eef9c4.js → WEIGHT_BOYS.percentile.yearly-b3cc9f47.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.monthly-39cb41e2.js → WEIGHT_BOYS.zscore.monthly-8ec285f3.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.weekly-1fd3816a.js → WEIGHT_BOYS.zscore.weekly-3d07dba8.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.yearly-91994e22.js → WEIGHT_BOYS.zscore.yearly-99e6bf03.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.monthly-8803f9b5.js → WEIGHT_GIRLS.percentile.monthly-afe58712.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.weekly-ec6c8a49.js → WEIGHT_GIRLS.percentile.weekly-154459dc.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.yearly-0e9334c7.js → WEIGHT_GIRLS.percentile.yearly-ad483573.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.monthly-031167a3.js → WEIGHT_GIRLS.zscore.monthly-c9363f7d.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.weekly-36d7530c.js → WEIGHT_GIRLS.zscore.weekly-736b742e.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.yearly-93c90f87.js → WEIGHT_GIRLS.zscore.yearly-d1a28c31.js} +0 -0
- /package/build/esm/{cookieHelper-1491c7ea.js → cookieHelper-bf1be72d.js} +0 -0
- /package/build/esm/{dataTransform-9bceddac.js → dataTransform-c10d68f3.js} +0 -0
- /package/build/esm/{index-2f243424.js → index-0e3fc8b7.js} +0 -0
- /package/build/esm/{index-0797d3cb.js → index-bc94a926.js} +0 -0
- /package/build/esm/{index-bbf78608.js → index-f4b93c10.js} +0 -0
- /package/build/esm/{isProduction-d8d94564.js → isProduction-f464a698.js} +0 -0
- /package/build/esm/{localizeNumberFormat-3657ce11.js → localizeNumberFormat-079a6b93.js} +0 -0
- /package/build/esm/{normalizeLink-7259b86a.js → normalizeLink-15cf45d1.js} +0 -0
- /package/build/esm/{number-a14a26d2.js → number-42359818.js} +0 -0
- /package/build/esm/{paths-80d2b4f2.js → paths-7c55394d.js} +0 -0
- /package/build/esm/{screenSizeContext-f9a53919.js → screenSizeContext-c38ade0a.js} +0 -0
- /package/build/esm/{theme-9d69f1a2.js → theme-57e98706.js} +0 -0
- /package/build/esm/{translationsContext-a929820e.js → translationsContext-b6ff3279.js} +0 -0
- /package/build/esm/{tslib.es6-7b491686.js → tslib.es6-98b62e2b.js} +0 -0
- /package/build/esm/{types-c4843c87.js → types-8c6df085.js} +0 -0
- /package/build/esm/{useIsInit-36546b9c.js → useIsInit-6b7cbee2.js} +0 -0
- /package/build/esm/{useOutsideClick-78141983.js → useOutsideClick-878679f9.js} +0 -0
- /package/build/esm/{useScrollbarSize-30b1bee4.js → useScrollbarSize-3959071b.js} +0 -0
- /package/build/{index-af3f2c07.js → index-435fff10.js} +0 -0
- /package/build/{index-0251e5f0.js → index-5e5d6e08.js} +0 -0
- /package/build/{index-ff51ac26.js → index-f2286b64.js} +0 -0
- /package/build/{isProduction-fa856154.js → isProduction-f6daa4d4.js} +0 -0
- /package/build/{localizeNumberFormat-118c54b5.js → localizeNumberFormat-41f06af6.js} +0 -0
- /package/build/{normalizeLink-b898d874.js → normalizeLink-7a96ca0b.js} +0 -0
- /package/build/{number-e86b559d.js → number-1963bb93.js} +0 -0
- /package/build/{paths-bbbcac69.js → paths-d3a2028a.js} +0 -0
- /package/build/{screenSizeContext-478cce5e.js → screenSizeContext-1a577828.js} +0 -0
- /package/build/{theme-1481c80b.js → theme-c252ab3b.js} +0 -0
- /package/build/{translationsContext-e83c75a5.js → translationsContext-8f763486.js} +0 -0
- /package/build/{tslib.es6-524ea691.js → tslib.es6-a447d75e.js} +0 -0
- /package/build/{types-5ceae17e.js → types-51f2e864.js} +0 -0
- /package/build/{useIsInit-b0daf2cf.js → useIsInit-8be47ce0.js} +0 -0
- /package/build/{useOutsideClick-abc52969.js → useOutsideClick-99a300bf.js} +0 -0
- /package/build/{useScrollbarSize-251ab8f8.js → useScrollbarSize-af06cacb.js} +0 -0
package/build/subot.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("./Subot-b76ccc9c.js"),i=require("./tslib.es6-524ea691.js"),n=require("./index-511b99c0.js"),o=require("js-cookie"),a=require("fastdom"),l=require("fastdom/extensions/fastdom-promised"),r=require("./index.styled-edaa5fca.js"),d=require("./index.styles-eee657e0.js");require("./index-505a6231.js");var s=require("@mantine/core"),c=require("./index-70fc6801.js");require("./translationsContext-e83c75a5.js");var u=require("string-format");require("innertext");var p=require("./theme-1481c80b.js"),m=require("./index-8a4e8200.js");require("@mantine/dates"),require("./gAssets.js");var f=require("dayjs"),v=require("./screenSizeContext-478cce5e.js"),g=require("styled-components"),b=require("./isProduction-fa856154.js");require("@mantine/hooks"),require("./constants-82348c13.js"),require("lodash/debounce"),require("react-contenteditable"),require("react-dom"),require("./useCategory-15d34903.js");var h=require("uuid"),y=require("hex-rgb"),E=require("classnames");require("@linaria/react"),require("./utils-6f3d330e.js");var x=require("./index-0251e5f0.js");require("./index.styled-95722c0d.js"),require("./index-ff51ac26.js");var C=require("./index-dd161fb0.js"),N=require("framer-motion"),T=require("remarkable");require("date-fns"),require("react-day-picker/DayPickerInput"),require("./index-cbb25109.js"),require("lodash/throttle"),require("html-react-parser"),require("./types-5ceae17e.js");var w=require("react-hook-form");require("./index.styled-bf702a00.js"),require("date-fns/locale/en-US"),require("date-fns/locale/id"),require("date-fns/locale/vi"),require("date-fns/locale/zh-TW"),require("./index.styled-7c52b155.js"),require("./utils-a167e7a3.js"),require("@mantine/form"),require("lodash/flatten"),require("lodash/uniqBy"),require("./constants-57d89069.js");var _=require("react-intersection-observer"),I=require("dayjs/plugin/isSameOrBefore"),k=require("./index-f20a3b0b.js"),S=require("lodash/isEmpty"),O=require("react-phone-number-input"),A=require("@react-google-maps/api"),P=require("./usePlacesAutocomplete-24621567.js");function M(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("date-fns/locale"),require("./useTranslations-2e112ad4.js"),require("./number-e86b559d.js"),require("./index-1cc9c0e2.js"),require("./routing-d19d8856.js"),require("dayjs/plugin/relativeTime"),require("./paths-bbbcac69.js"),require("./index-557f79d9.js"),require("./cookieHelper-edf24fec.js"),require("react-keyed-flatten-children"),require("slugify"),require("@mantine/carousel"),require("./index-5537eb8b.js"),require("@hookform/resolvers/yup"),require("./index-566d616e.js"),require("./index-2744bd7d.js"),require("./index-b983594e.js");var j=M(e),B=M(o),R=M(a),L=M(l),U=M(u),D=M(f),F=M(g),q=M(y),H=M(E),z=M(I),Y=M(S),G=M(O);const Q=R.default.extend(L.default),V={POST_VERIFY_SMS_OTP:"sms/update-phone",POST_SEND_OTP:"sms/otp",POST_SEND_OTP_WHATSAPP:"whatsapp/otp",POST_VERIFY_OTP:"sms/verify",POST_VERIFY_OTP_WHATSAPP:"sms/verify-whatsapp",GET_LANDING_PAGE_FIRST_NODE:"landing_page/bot",GET_LANDING_PAGE_NEXT_NODE:"landing_page/messages",POST_LANDING_PAGE_IMPRESSION:"landing_page/impressions",POST_LANDING_PAGE_CLICK:"landing_page/clicks",GET_INLINE_FIRST_NODE:"bots",GET_INLINE_MESSAGE:"inline/messages",GET_INLINE_IMPRESSION:"inline/impressions",GET_INLINE_CLICK:"inline/clicks",GET_SUBOT_LOG:"log/bot/{botId}/{cookieId}/{accountId}?type={type}",POST_SUBOT_CREATE_LOG:"log/bot",FETCH_URL_DATA:"preview",GET_VOUCHER_QUANTITY:"vouchers/total_quantity?search={search}&client_id={clientId}"},X={cached:{},clearCached:e=>{console.log(X.cached),Object.keys(X.cached).filter((t=>t.startsWith(e))).forEach((e=>{console.log(e),X.cached[e]=void 0}))},withCached:(e,t)=>i.__awaiter(void 0,void 0,void 0,(function*(){if("waitingTheFirstResponse"===X.cached[e])return new Promise((t=>{const i=(new Date).getTime(),n=setInterval((()=>{(new Date).getTime()-i>3e3&&clearInterval(n),"object"==typeof X.cached[e]&&(t(X.cached[e]),clearInterval(n))}),100)}));if("object"==typeof X.cached[e])return X.cached[e];X.cached[e]="waitingTheFirstResponse";try{const i=yield t();return X.cached[e]=i,setTimeout((()=>{X.cached[e]=void 0}),18e5),i}catch(t){return X.cached[e]=void 0,Promise.reject(t)}}))},K=(e,t)=>{const{subotApiUrl:i}=null===d.GlobalData||void 0===d.GlobalData?void 0:d.GlobalData.env;return(i.endsWith("frontend/api/")?i:i+"frontend/api/")+U.default(e,Object.assign({},t))},W=e=>i.__awaiter(void 0,void 0,void 0,(function*(){try{return yield d.callApi(K(V.GET_INLINE_MESSAGE),"POST",{data:e})}catch(e){}})),J=e=>{var t;if(1===(null==e?void 0:e._status)&&(null===(t=null==e?void 0:e._data)||void 0===t?void 0:t.extra_settings))try{const t=JSON.parse(e._data.extra_settings);e._data.extra_settings="object"==typeof t?t:{sync_data_friso_campaign:!1}}catch(t){e._data.extra_settings={sync_data_friso_campaign:!1}}return e},Z=e=>i.__awaiter(void 0,void 0,void 0,(function*(){try{return yield X.withCached("SubotInlineFirstNode",(()=>i.__awaiter(void 0,void 0,void 0,(function*(){const t=yield d.callApi(K(V.GET_INLINE_FIRST_NODE)+`/${e}`,"GET");return J(t),t}))))}catch(e){return null}})),$=e=>i.__awaiter(void 0,void 0,void 0,(function*(){try{return yield d.callApi(K(V.GET_INLINE_CLICK),"POST",{data:e})}catch(e){}})),ee=e=>i.__awaiter(void 0,void 0,void 0,(function*(){try{return yield d.callApi(K(V.GET_INLINE_IMPRESSION),"POST",{data:e})}catch(e){}})),te=["form_submit_meta","selected_actions","current_selected","current_keys","current_polls"],ie=["bot_id","node_id","action_id","action_value","current_score","gtm_id","ga_client_id","is_new","title_url","url","window_id",...te],ne=(e,t)=>(Object.keys(t).map((i=>{const n=t[i];if("source"!==i){if(ie.includes(i))if(te.includes(i))try{e[i]=JSON.parse(n)}catch(e){}else e[i]="account_id"!==i&&"current_score"!==i&&"bot_id"!==i?n:parseInt(n)}else e.is_new="first_login"===n})),e),oe=e=>[{id:h.v4(),label:JSON.stringify({title:"",description:""}),type:t.NodeIntentType.SSO_INTENT,url:""},{id:h.v4(),label:JSON.stringify({title:e({id:"subot.myHealth.title",defaultMessage:"My Health"}),description:e({id:"subot.myHealth.description",defaultMessage:"Personal identifiers (like your name) will always be removed to protect your privacy. "})}),type:t.NodeIntentType.SSO_INTENT,url:"/images/subot/my-health.svg"},{id:h.v4(),label:JSON.stringify({title:e({id:"subot.saveData.title",defaultMessage:"Save Data"}),description:e({id:"subot.saveData.description",defaultMessage:"Hellobacsi would like to learn from your data to provide better healthcare for you"})}),type:t.NodeIntentType.SSO_INTENT,url:"/images/subot/file-storage.svg"},{id:h.v4(),label:JSON.stringify({title:e({id:"subot.productYourIdentifiers.title",defaultMessage:"Protect your identifiers"}),description:e({id:"subot.productYourIdentifiers.description",defaultMessage:"Personal identifiers (like your name) will always be removed to protect your privacy. "})}),type:t.NodeIntentType.SSO_INTENT,url:"/images/subot/shield.svg"}];function ae(e){const t=e.condition,i=e.finished,n=e.timeout||3e3,o=(new Date).getTime(),a=setInterval((()=>{((new Date).getTime()-o>n||t())&&(clearInterval(a),i())}),300)}const le=e=>d.cookie.parse(e||"")["hhg-id"]||B.default.get("hhg-id")||"",re=e=>{if(e)return B.default.set("hhg-id",e),e;const t=le();if(t)return t;const i=h.v4();return B.default.set("hhg-id",i),i},de=e=>{const t=d.cookie.parse(e||"")[n.BEARER_TOKEN_COOKIE]||B.default.get(n.BEARER_TOKEN_COOKIE)||"";try{const e=t.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),i=decodeURIComponent(atob(e).split("").map((function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join(""));return JSON.parse(i).sub}catch(e){return""}},se=e=>{const t=d.cookie.parse(e||"")[n.BEARER_TOKEN_COOKIE]||B.default.get(n.BEARER_TOKEN_COOKIE)||"";try{const e=t.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),i=decodeURIComponent(atob(e).split("").map((function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join("")),n=JSON.parse(i);return{email:n.email,id:n.sub}}catch(e){return{email:"",id:0}}},ce=h.v4(),ue=()=>ce,pe=(e,t)=>!t&&("undefined"!=typeof window&&("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname))?"http://localhost":`https://${b.isProduction?"":"discover."}${n.domainLocales[e]}`,me=e=>{const t=e||("undefined"==typeof navigator?"":navigator.userAgent);return!(!/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)&&!/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substring(0,4)))},fe=e=>{const t=document.createElement("a");t.href=e,t.target="_blank",t.click()},ve=e=>{try{return e.dynamic_score||{}}catch(e){return{}}},ge=(e,i,n,o)=>{const a=ve(e[0]);if(!i)return{};const l=e.findIndex((e=>e.id==i)),r=e.reduce(((e,r,d)=>{var s,c;if(d>l)return e;const u=r,p=n&&u.id===i?{action_id:n}:u._message;let m=0;const f=null===(s=u.actions)||void 0===s?void 0:s.find((e=>e.id===(null==p?void 0:p.action_id)));m+=(null==f?void 0:f.score)||0;const v=void 0!==a[u.id],g=n&&u.id===i?o:null==p?void 0:p.form_submit_meta;if(v&&u.type===t.NodeType.FORM&&g){const e=a[u.id].action_id,t=null===(c=u.actions)||void 0===c?void 0:c.find((t=>t.id===e)),i=null==t?void 0:t.key,n=g.find((e=>e.key===i&&"number"===e.control));if(a[u.id].number&&["+","-","x","/"].includes(a[u.id].operator)&&(null==n?void 0:n.value)&&Number(n.value)){const e=Number(n.value),t=a[u.id].operator,i=a[u.id].number;let o=0;"+"===t&&(o=e+i),"-"===t&&(o=e-i),"x"===t&&(o=e*i),"/"===t&&(o=e/i),isNaN(o)||(m+=o)}}return e+m}),0);return{current_total_dynamic_score:r}},be=(e,i)=>{const n=ve(i[0]);if(0===Object.keys(n).length)return e;const o=i.filter((e=>e.type===t.NodeType.FORM));return Object.keys(n).forEach((t=>{var i,a,l;const r=o.find((e=>e.id===t)),d=null===(i=null==r?void 0:r.actions)||void 0===i?void 0:i.find((e=>{var i;return e.id===(null===(i=n[t])||void 0===i?void 0:i.action_id)})),s=null==d?void 0:d.key,c=null===(l=null===(a=null==r?void 0:r._message)||void 0===a?void 0:a.form_submit_meta)||void 0===l?void 0:l.find((e=>e.key===s&&"number"===e.control));if(n[t].number&&["+","-","x","/"].includes(n[t].operator)&&(null==c?void 0:c.value)&&Number(c.value)){const i=Number(c.value),o=n[t].operator,a=n[t].number;let l=0;if("+"===o&&(l=i+a),"-"===o&&(l=i-a),"x"===o&&(l=i*a),"/"===o&&(l=i/a),e.includes(`{{var:${s}}}`)){const t=new RegExp(`{{var:${s}}}`,"g");e=e.replace(t,String(Math.floor(100*l)/100))}}})),e},he="other",ye="stateInlineSSO",Ee=()=>{try{const e=window.next.router.components["/[...slug]"].props.pageProps;return"services-connection"===e.template?{project_id:"care-path",user_funnel:e.spotlight.additionalSlugActive||"",audience_name:e.spotlight.groupIdActive||""}:{}}catch(e){return{}}},xe=e=>{const i=e.filter((e=>"Unified Questions"===e.name)).reduce(((e,i)=>{var n,o,a,l,r,d,s,c,u,p,m,f,v,g,b,h,y,E,x,C,N;if(i.actions&&(null===(n=i._message)||void 0===n?void 0:n.action_id)&&(null===(o=i._message)||void 0===o?void 0:o.action_value)){const n=i._message.action_value;if(i.type===t.NodeType.FORM){const t=["address","province","district","commune"],n=((null===(a=i._message)||void 0===a?void 0:a.form_submit_meta)||[]).filter((e=>!t.includes(e.control))),o=((null===(l=i._message)||void 0===l?void 0:l.form_submit_meta)||[]).filter((e=>t.includes(e.control))).reduce(((e,t)=>(e[t.control]=t,e)),{}),m=[null===(r=o.address)||void 0===r?void 0:r.value,null===(d=o.commune)||void 0===d?void 0:d.value,null===(s=o.district)||void 0===s?void 0:s.value,null===(c=o.province)||void 0===c?void 0:c.value].filter(Boolean).join(", ");m&&o.address?e.push({attribute:o.address.key,value:m,label_question:(null===(p=null===(u=i.intents)||void 0===u?void 0:u[0])||void 0===p?void 0:p.label)||""}):n.forEach((t=>{var n,o;e.push({attribute:t.key,value:t.value,label_question:(null===(o=null===(n=i.intents)||void 0===n?void 0:n[0])||void 0===o?void 0:o.label)||""})}))}if(i.type===t.NodeType.TEXT)if(i.is_multi_select){const t=Object.keys(i._message.selected_actions||{}),n=i.actions.filter((e=>e.label&&t.includes(e.id))).map((e=>e.label));t.length&&e.push({attribute:i.actions[0].key||"",value:n,label_question:(null===(f=null===(m=i.intents)||void 0===m?void 0:m[0])||void 0===f?void 0:f.label)||""})}else{const o=i._message.action_id,a=i.actions.find((e=>e.id===o)),l=null==a?void 0:a.label,r=null===(b=null===(g=null===(v=i._message)||void 0===v?void 0:v.form_submit_meta)||void 0===g?void 0:g.find((e=>e.key===he)))||void 0===b?void 0:b.value,d=(null==a?void 0:a.type)===t.NodeActionType.USER_CHOICE_TEXT_BY_INPUT;l&&o&&e.push({attribute:n,value:d&&r?r:l,label_question:(null===(y=null===(h=i.intents)||void 0===h?void 0:h[0])||void 0===y?void 0:y.label)||""})}if(i.type===t.NodeType.POLL){const t=i.id,n=(null===(x=null===(E=i._message)||void 0===E?void 0:E.current_polls)||void 0===x?void 0:x[t])||[],o=i.actions.filter((e=>e.label&&n.includes(e.id))).map((e=>e.label));n.length&&e.push({attribute:i.actions[0].key||"",value:o,label_question:(null===(N=null===(C=i.intents)||void 0===C?void 0:C[0])||void 0===N?void 0:N.label)||""})}}return e}),[]);return i},Ce=(e,i)=>{var n;try{if("ACUVUE"!==(null===(n=i.extra_settings)||void 0===n?void 0:n.subot_type))return;let o="",a="",l="",r=se().email;if((e||[]).forEach((e=>{var i,n,d;const s=e._message;if(!s)return;const c=null===(i=e.actions)||void 0===i?void 0:i.find((e=>e.id===s.action_id));if("voucher_product"===s.action_value?o=(null==c?void 0:c.label)||"":"voucher_color"===s.action_value&&(a=(null==c?void 0:c.label)||""),e.type===t.NodeType.FORM){const e=null===(n=s.form_submit_meta)||void 0===n?void 0:n.find((e=>"voucher_size"===e.key)),t=null===(d=s.form_submit_meta)||void 0===d?void 0:d.find((e=>"email"===e.control));e&&(l=e.value),t&&(r=t.value)}})),"ACUVUE® OASYS (1-DAY) WITH HYDRALUXE®"===o&&r)return{email:r,voucherName:o};if(o&&a&&l&&r)return{email:r,voucherName:`${o}|${a}|${l}`}}catch(e){console.log("ExtractVoucherAnswer",e)}},Ne=({nodes:e,activeId:o,params:a,accountIdFromLogs:l})=>i.__awaiter(void 0,void 0,void 0,(function*(){try{let i="in_progress";const r=e[e.length-1];(null==r?void 0:r.type)&&t.NodeFinalTypes.includes(r.type)&&(i="complete");const s=e.slice(1),c={activeId:o,params:a,nodes:s,tracking:Object.assign(Object.assign({},Ee()),{full_url:window.location.href}),unifiedAnswers:xe(s),voucherAnswers:Ce(s,e[0])},u={cookie_id:re(),account_id:l||de()||null,bot_id:e[0].id,flow_uuid:e[0].flow_uuid,data:JSON.stringify(c),status:i,type:"inline",market:n.MAP_DOMAIN_BY_LOCALE[d.locale]};yield d.callApi(K(V.POST_SUBOT_CREATE_LOG),"POST",{data:u})}catch(e){}})),Te=(e,t)=>{try{const[i,n,o]=q.default(e,{format:"array"});return`rgba(${i}, ${n}, ${o}, ${t})`}catch(e){return}},we=e.createContext({activeId:"",params:{},listNodes:[],loading:!0,getParams:()=>({}),onNext:()=>null,onPrev:()=>null,onSubmit:()=>null,onStartOver:()=>null,onChange:()=>null,isShowFooter:!1,setIsShowFooter:()=>null,setLoading:()=>null,userInfo:null}),_e=({children:o,articleLink:a,subotId:l,isFullContainer:r,bgColor:s,primaryColor:c,isDisabledAnimationOnMobile:u,onCloseMobile:p,userInfo:m})=>{const{formatMessage:f,action:{pushNotifications:v}}=e.useContext(d.TogetherComponentGlobalContext),g=e.useRef(null),b=e.useRef(null),[h,y]=e.useState(!0),[E,x]=e.useState(""),[C,N]=e.useState([]),[T,w]=e.useState(!1),[_,I]=e.useState({});e.useEffect((()=>{const e=s||"#e3f2ff",t=c||"#2d87f3",i=(new Date).getTime(),n=setInterval((()=>{const o=g.current,a=(new Date).getTime();o&&(Q.mutate((()=>{o.style.setProperty("--subot-inline-bg-color",e),o.style.setProperty("--subot-inline-primary-color",t),o.style.setProperty("--subot-inline-primary-color-hover",Te(t,.9)||t),o.style.setProperty("--subot-inline-primary-color-100",Te(t,.1)||"#e3f2ff"),o.style.setProperty("--subot-inline-primary-color-300",Te(t,.3)||"#bcdeff")})),clearInterval(n)),a-i>18e4&&clearInterval(n)}),100);return()=>{clearInterval(n)}}),[s,c]);const k=e.useCallback((()=>{const e=window.gaData,t=window.location.origin+n.basePath+("tl-PH"===(null===d.GlobalData||void 0===d.GlobalData?void 0:d.GlobalData.locale)?a.replace("fil/",""):a),i={bot_id:l,account_id:de()||null,action_id:"",action_value:"",cookie_id:re(),current_score:0,current_keys:[],current_selected:[],form_submit_meta:[],gtm_id:e?Object.keys(e)[0]:"",ga_client_id:B.default.get("_ga")||"",is_new:!1,mode:"inline",node_id:"",selected_actions:{},title_url:document.title||"",url:t.replace("http://localhost:6006","https://discover.hellobacsi.com").replace("http://localhost","https://discover.hellobacsi.com").replace("dev.","discover.").replace("staging.hellohealthgroup.com","discover.hellodoctor.com.ph").replace("https://hellohealthgroup.com","https://hellodoctor.com.ph"),window_id:ue()};return ne(i,null===d.GlobalData||void 0===d.GlobalData?void 0:d.GlobalData.router.query)}),[]),S=e.useCallback((()=>{var e;null===(e=g.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"start",inline:"center"})}),[]),O=e.useCallback(((e,n=!0)=>i.__awaiter(void 0,void 0,void 0,(function*(){var o;if(!e||!e.url||!e.bot_id)return;let a="",l=[];y(!0);const r=yield Z(e.bot_id);1===(null==r?void 0:r._status)&&(a=null==r?void 0:r._data.id.toString(),l.push(null==r?void 0:r._data,null==r?void 0:r._data.first_node));const s=n?yield(c=l[0],i.__awaiter(void 0,void 0,void 0,(function*(){var e,t;try{if(!c)return null;const i=yield d.callApi(K(V.GET_SUBOT_LOG,{botId:c.id,cookieId:re(),accountId:de()||"",type:"inline"}),"GET");if(!(null===(e=null==i?void 0:i._data)||void 0===e?void 0:e.data)||"inline"!==(null===(t=null==i?void 0:i._data)||void 0===t?void 0:t.type))return null;const n=JSON.parse(i._data.data),o=n.nodes,a="in_progress"===i._data.status,l="complete"===i._data.status;return a||l?{nodes:[c,...o],activeId:n.activeId,params:Object.assign(Object.assign({},n.params),{account_id:de()||n.params.account_id||null})}:null}catch(e){return null}}))):null;var c;s&&(l=s.nodes,a=s.activeId,b.current=(null===(o=s.params)||void 0===o?void 0:o.account_id)||0);const u=((e,{getParams:i})=>{try{if(!de())return null;const n=JSON.parse(localStorage.getItem(ye)||""),o=18e5;return(null==n?void 0:n.botId)===e&&n.listNodes&&n.activeId&&n.createdAt+o>Date.now()&&(localStorage.removeItem(ye),n.listNodes.slice(-1)[0].position===t.NodePosition.SSO)?{listNodes:n.listNodes,activeId:n.activeId,params:Object.assign(Object.assign(Object.assign({},i()),n.params),{account_id:de()||null,cookie_id:re(n.params.cookie_id)})}:null}catch(e){return null}})(e.bot_id,{getParams:k});if(u&&u.params.action_id&&u.params.action_value){const e=yield W(u.params);1===(null==e?void 0:e._status)&&(null==e?void 0:e._data.node)&&(a=null==e?void 0:e._data.node.id,l=u.listNodes,l[l.length-1]=null==e?void 0:e._data.node,Ne({nodes:l,activeId:a,params:u.params,accountIdFromLogs:b.current}),setTimeout((()=>{S()}),100))}const p=(null==u?void 0:u.params)||(null==s?void 0:s.params)||e,[m,f]=((e,t,i)=>{if(!(null==e?void 0:e.subot_field_type))return[t,i];const n=i.find((e=>e.id==t));return n&&n.hasOwnProperty("first_node")&&i.length>1?[i[1].id,i]:[t,i]})(l[0],a,l);y(!1),x(m),N(f),I(Object.assign(Object.assign({},e),p))}))),[]),A=e.useCallback(((e,t)=>{const i=document.querySelector(`.si-revamp-event-submission[data-bot-id="${l}"]`);i&&i.click();let n=E,o=[...C];if(null==t?void 0:t.node_id){const e=o.findIndex((({id:e})=>e==t.node_id));-1!==e&&(o[e]._message=Object.assign(Object.assign({},o[e]._message),t),o=[...o.slice(0,e+1)])}if(y(!0),e){const t=o.findIndex((({id:t})=>t==(null==e?void 0:e.id)));if(-1===t)o=[...o,Object.assign({},e)];else{const i=Object.assign(Object.assign(Object.assign({},o[t]),e),{_message:Object.assign(Object.assign({},o[t]._message),null==e?void 0:e._message)});o=[...o.slice(0,t),Object.assign({},i),...o.slice(t+1)]}n=e.id}setTimeout((()=>{N(o),x(n),y(!1),Ne({nodes:o,activeId:n,params:_,accountIdFromLogs:b.current})}),250)}),[C,E]),P=e.useCallback((e=>i.__awaiter(void 0,void 0,void 0,(function*(){if(null==e?void 0:e.node_id){const t=Object.assign(Object.assign({},e),ge(C,E,e.action_id)),n=yield W(t);if(y(!1),1===(null==n?void 0:n._status)){const e=null==n?void 0:n._data,{node:o}=e,a=i.__rest(e,["node"]),l=Object.assign(Object.assign({},o),{_message:Object.assign(Object.assign({},a),{node_id:o.id})});return void(-1!==C.findIndex((e=>e.id===l.id))?A(l):A(l,t))}v({title:f({id:"notification.comment.somethingWrong"}),message:"",type:"danger"})}const t=C.find((e=>e.id==E));t&&t.hasOwnProperty("first_node")&&(x(C[1].id.toString()),Ne({nodes:C,activeId:C[1].id.toString(),params:k(),accountIdFromLogs:b.current}))}))),[A,C]),M=e.useCallback((()=>{const e=C.findIndex((({id:e})=>e==E));if(e&&-1!==e&&e>1){const t=C[e-1];x(t.id),Ne({nodes:C,activeId:t.id,params:_,accountIdFromLogs:b.current})}}),[C,E]),R=e.useCallback((()=>{const e=k();O(e,!1);const t=C[0],i=C[1];Ne({nodes:[t,i],activeId:String(t.id),params:e,accountIdFromLogs:b.current})}),[k,O,C]),L=e.useCallback((e=>{N((t=>e&&(null==e?void 0:e.node_id)&&(null==e?void 0:e.node_id)==E?t.map((t=>{const i=t;return i.id===E?Object.assign(Object.assign({},t),{_message:i._message?Object.assign(Object.assign({},i._message),e):e}):t})):t))}),[E]);e.useEffect((()=>{if(B.default.get(n.GA_TOKEN_COOKIE)){const e=k();O(e)}else ae({condition:()=>Boolean(B.default.get(n.GA_TOKEN_COOKIE)),finished:()=>{const e=k();O(e)}})}),[]),e.useEffect((()=>{if(!C.length)return;C.find((e=>e.id==E))&&E||x(l+"")}),[E,C]);const U=e.useMemo((()=>({activeId:E,params:_,listNodes:C,loading:h,setLoading:y,getParams:k,onNext:P,onPrev:M,onSubmit:A,onStartOver:R,onChange:L,isShowFooter:T,setIsShowFooter:w,isFullContainer:r,isDisabledAnimationOnMobile:u,onCloseMobile:p,userInfo:m})),[E,P,M,A,L,R,T,_,C,h,y,k,r,u,p,m]);return C.length?j.default.createElement(we.Provider,{value:U},j.default.createElement("div",{ref:g},o)):null},Ie=e=>j.default.createElement("svg",Object.assign({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),j.default.createElement("path",{d:"M5.99105 4.99067C5.79212 4.99072 5.59772 5.0501 5.43271 5.16121C5.2677 5.27233 5.13958 5.43013 5.06472 5.61444C4.98986 5.79875 4.97167 6.0012 5.01248 6.1959C5.05328 6.39061 5.15122 6.56872 5.29379 6.70747L10.5868 12.0004L5.29379 17.2934C5.19781 17.3855 5.12119 17.4959 5.0684 17.618C5.01562 17.7402 4.98773 17.8716 4.98638 18.0046C4.98503 18.1377 5.01023 18.2697 5.06052 18.3928C5.11081 18.516 5.18517 18.6279 5.27925 18.722C5.37333 18.8161 5.48523 18.8904 5.60841 18.9407C5.73159 18.991 5.86356 19.0162 5.9966 19.0149C6.12964 19.0135 6.26108 18.9856 6.38321 18.9328C6.50533 18.8801 6.6157 18.8034 6.70785 18.7075L12.0008 13.4145L17.2938 18.7075C17.3859 18.8034 17.4963 18.8801 17.6184 18.9328C17.7406 18.9856 17.872 19.0135 18.005 19.0149C18.1381 19.0162 18.27 18.991 18.3932 18.9407C18.5164 18.8904 18.6283 18.8161 18.7224 18.722C18.8165 18.6279 18.8908 18.516 18.9411 18.3928C18.9914 18.2697 19.0166 18.1377 19.0153 18.0047C19.0139 17.8716 18.986 17.7402 18.9332 17.618C18.8804 17.4959 18.8038 17.3855 18.7078 17.2934L13.4149 12.0004L18.7078 6.70747C18.8524 6.567 18.951 6.38616 18.991 6.18864C19.031 5.99112 19.0103 5.78614 18.9318 5.60055C18.8532 5.41497 18.7205 5.25744 18.5509 5.14861C18.3812 5.03978 18.1827 4.98473 17.9813 4.99067C17.7215 4.99841 17.4749 5.10699 17.2938 5.2934L12.0008 10.5864L6.70785 5.2934C6.61466 5.19761 6.50321 5.12146 6.3801 5.06947C6.25698 5.01747 6.1247 4.99068 5.99105 4.99067Z",fill:"#595959"})),ke="480px",Se=F.default.div`
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("./Subot-6070090a.js"),i=require("./tslib.es6-a447d75e.js"),n=require("./index-5d9cc019.js"),o=require("js-cookie"),a=require("fastdom"),l=require("fastdom/extensions/fastdom-promised"),r=require("./index.styled-44a88d2d.js"),d=require("./index.styles-d3b67125.js");require("./index-a74cf615.js");var s=require("@mantine/core"),c=require("./index-b9a7f78c.js");require("./translationsContext-8f763486.js");var u=require("string-format");require("innertext");var p=require("./theme-c252ab3b.js"),m=require("./index-be8bd1aa.js");require("@mantine/dates"),require("./gAssets.js");var f=require("dayjs"),v=require("./screenSizeContext-1a577828.js"),g=require("styled-components"),b=require("./isProduction-f6daa4d4.js");require("@mantine/hooks"),require("./constants-d67df371.js"),require("lodash/debounce"),require("react-contenteditable"),require("react-dom"),require("./useCategory-eea8836a.js");var h=require("uuid"),y=require("hex-rgb"),E=require("classnames");require("@linaria/react"),require("./utils-00a7b97a.js");var x=require("./index-5e5d6e08.js");require("./index.styled-4108cde2.js"),require("./index-f2286b64.js");var C=require("./index-95cd2806.js"),N=require("framer-motion"),T=require("remarkable");require("date-fns"),require("react-day-picker/DayPickerInput"),require("./index-19ab75f5.js"),require("lodash/throttle"),require("html-react-parser"),require("./types-51f2e864.js");var w=require("react-hook-form");require("./index.styled-d9e7dba1.js"),require("date-fns/locale/en-US"),require("date-fns/locale/id"),require("date-fns/locale/vi"),require("date-fns/locale/zh-TW"),require("./index.styled-56b27702.js"),require("./utils-86f4b1f3.js"),require("@mantine/form"),require("lodash/flatten"),require("lodash/uniqBy"),require("./constants-55a2b4cb.js");var _=require("react-intersection-observer"),I=require("dayjs/plugin/isSameOrBefore"),k=require("./index-dd2f12d8.js"),S=require("lodash/isEmpty"),O=require("react-phone-number-input"),A=require("@react-google-maps/api"),P=require("./usePlacesAutocomplete-ce74a3d9.js");function M(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("date-fns/locale"),require("./useTranslations-7f12251c.js"),require("./number-1963bb93.js"),require("./index-a25f5546.js"),require("./routing-1e951b79.js"),require("dayjs/plugin/relativeTime"),require("./paths-d3a2028a.js"),require("./index-9d548edc.js"),require("./cookieHelper-50f349a8.js"),require("react-keyed-flatten-children"),require("slugify"),require("@mantine/carousel"),require("./index-bb56ac1b.js"),require("@hookform/resolvers/yup"),require("./index-e2e01405.js"),require("./index-f7640569.js"),require("./index-8673af8a.js");var j=M(e),B=M(o),R=M(a),L=M(l),U=M(u),D=M(f),F=M(g),q=M(y),H=M(E),z=M(I),Y=M(S),G=M(O);const Q=R.default.extend(L.default),V={POST_VERIFY_SMS_OTP:"sms/update-phone",POST_SEND_OTP:"sms/otp",POST_SEND_OTP_WHATSAPP:"whatsapp/otp",POST_VERIFY_OTP:"sms/verify",POST_VERIFY_OTP_WHATSAPP:"sms/verify-whatsapp",GET_LANDING_PAGE_FIRST_NODE:"landing_page/bot",GET_LANDING_PAGE_NEXT_NODE:"landing_page/messages",POST_LANDING_PAGE_IMPRESSION:"landing_page/impressions",POST_LANDING_PAGE_CLICK:"landing_page/clicks",GET_INLINE_FIRST_NODE:"bots",GET_INLINE_MESSAGE:"inline/messages",GET_INLINE_IMPRESSION:"inline/impressions",GET_INLINE_CLICK:"inline/clicks",GET_SUBOT_LOG:"log/bot/{botId}/{cookieId}/{accountId}?type={type}",POST_SUBOT_CREATE_LOG:"log/bot",FETCH_URL_DATA:"preview",GET_VOUCHER_QUANTITY:"vouchers/total_quantity?search={search}&client_id={clientId}"},X={cached:{},clearCached:e=>{console.log(X.cached),Object.keys(X.cached).filter((t=>t.startsWith(e))).forEach((e=>{console.log(e),X.cached[e]=void 0}))},withCached:(e,t)=>i.__awaiter(void 0,void 0,void 0,(function*(){if("waitingTheFirstResponse"===X.cached[e])return new Promise((t=>{const i=(new Date).getTime(),n=setInterval((()=>{(new Date).getTime()-i>3e3&&clearInterval(n),"object"==typeof X.cached[e]&&(t(X.cached[e]),clearInterval(n))}),100)}));if("object"==typeof X.cached[e])return X.cached[e];X.cached[e]="waitingTheFirstResponse";try{const i=yield t();return X.cached[e]=i,setTimeout((()=>{X.cached[e]=void 0}),18e5),i}catch(t){return X.cached[e]=void 0,Promise.reject(t)}}))},K=(e,t)=>{const{subotApiUrl:i}=null===d.GlobalData||void 0===d.GlobalData?void 0:d.GlobalData.env;return(i.endsWith("frontend/api/")?i:i+"frontend/api/")+U.default(e,Object.assign({},t))},W=e=>i.__awaiter(void 0,void 0,void 0,(function*(){try{return yield d.callApi(K(V.GET_INLINE_MESSAGE),"POST",{data:e})}catch(e){}})),J=e=>{var t;if(1===(null==e?void 0:e._status)&&(null===(t=null==e?void 0:e._data)||void 0===t?void 0:t.extra_settings))try{const t=JSON.parse(e._data.extra_settings);e._data.extra_settings="object"==typeof t?t:{sync_data_friso_campaign:!1}}catch(t){e._data.extra_settings={sync_data_friso_campaign:!1}}return e},Z=e=>i.__awaiter(void 0,void 0,void 0,(function*(){try{return yield X.withCached("SubotInlineFirstNode",(()=>i.__awaiter(void 0,void 0,void 0,(function*(){const t=yield d.callApi(K(V.GET_INLINE_FIRST_NODE)+`/${e}`,"GET");return J(t),t}))))}catch(e){return null}})),$=e=>i.__awaiter(void 0,void 0,void 0,(function*(){try{return yield d.callApi(K(V.GET_INLINE_CLICK),"POST",{data:e})}catch(e){}})),ee=e=>i.__awaiter(void 0,void 0,void 0,(function*(){try{return yield d.callApi(K(V.GET_INLINE_IMPRESSION),"POST",{data:e})}catch(e){}})),te=["form_submit_meta","selected_actions","current_selected","current_keys","current_polls"],ie=["bot_id","node_id","action_id","action_value","current_score","gtm_id","ga_client_id","is_new","title_url","url","window_id",...te],ne=(e,t)=>(Object.keys(t).map((i=>{const n=t[i];if("source"!==i){if(ie.includes(i))if(te.includes(i))try{e[i]=JSON.parse(n)}catch(e){}else e[i]="account_id"!==i&&"current_score"!==i&&"bot_id"!==i?n:parseInt(n)}else e.is_new="first_login"===n})),e),oe=e=>[{id:h.v4(),label:JSON.stringify({title:"",description:""}),type:t.NodeIntentType.SSO_INTENT,url:""},{id:h.v4(),label:JSON.stringify({title:e({id:"subot.myHealth.title",defaultMessage:"My Health"}),description:e({id:"subot.myHealth.description",defaultMessage:"Personal identifiers (like your name) will always be removed to protect your privacy. "})}),type:t.NodeIntentType.SSO_INTENT,url:"/images/subot/my-health.svg"},{id:h.v4(),label:JSON.stringify({title:e({id:"subot.saveData.title",defaultMessage:"Save Data"}),description:e({id:"subot.saveData.description",defaultMessage:"Hellobacsi would like to learn from your data to provide better healthcare for you"})}),type:t.NodeIntentType.SSO_INTENT,url:"/images/subot/file-storage.svg"},{id:h.v4(),label:JSON.stringify({title:e({id:"subot.productYourIdentifiers.title",defaultMessage:"Protect your identifiers"}),description:e({id:"subot.productYourIdentifiers.description",defaultMessage:"Personal identifiers (like your name) will always be removed to protect your privacy. "})}),type:t.NodeIntentType.SSO_INTENT,url:"/images/subot/shield.svg"}];function ae(e){const t=e.condition,i=e.finished,n=e.timeout||3e3,o=(new Date).getTime(),a=setInterval((()=>{((new Date).getTime()-o>n||t())&&(clearInterval(a),i())}),300)}const le=e=>d.cookie.parse(e||"")["hhg-id"]||B.default.get("hhg-id")||"",re=e=>{if(e)return B.default.set("hhg-id",e),e;const t=le();if(t)return t;const i=h.v4();return B.default.set("hhg-id",i),i},de=e=>{const t=d.cookie.parse(e||"")[n.BEARER_TOKEN_COOKIE]||B.default.get(n.BEARER_TOKEN_COOKIE)||"";try{const e=t.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),i=decodeURIComponent(atob(e).split("").map((function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join(""));return JSON.parse(i).sub}catch(e){return""}},se=e=>{const t=d.cookie.parse(e||"")[n.BEARER_TOKEN_COOKIE]||B.default.get(n.BEARER_TOKEN_COOKIE)||"";try{const e=t.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),i=decodeURIComponent(atob(e).split("").map((function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join("")),n=JSON.parse(i);return{email:n.email,id:n.sub}}catch(e){return{email:"",id:0}}},ce=h.v4(),ue=()=>ce,pe=(e,t)=>!t&&("undefined"!=typeof window&&("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname))?"http://localhost":`https://${b.isProduction?"":"discover."}${n.domainLocales[e]}`,me=e=>{const t=e||("undefined"==typeof navigator?"":navigator.userAgent);return!(!/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)&&!/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substring(0,4)))},fe=e=>{const t=document.createElement("a");t.href=e,t.target="_blank",t.click()},ve=e=>{try{return e.dynamic_score||{}}catch(e){return{}}},ge=(e,i,n,o)=>{const a=ve(e[0]);if(!i)return{};const l=e.findIndex((e=>e.id==i)),r=e.reduce(((e,r,d)=>{var s,c;if(d>l)return e;const u=r,p=n&&u.id===i?{action_id:n}:u._message;let m=0;const f=null===(s=u.actions)||void 0===s?void 0:s.find((e=>e.id===(null==p?void 0:p.action_id)));m+=(null==f?void 0:f.score)||0;const v=void 0!==a[u.id],g=n&&u.id===i?o:null==p?void 0:p.form_submit_meta;if(v&&u.type===t.NodeType.FORM&&g){const e=a[u.id].action_id,t=null===(c=u.actions)||void 0===c?void 0:c.find((t=>t.id===e)),i=null==t?void 0:t.key,n=g.find((e=>e.key===i&&"number"===e.control));if(a[u.id].number&&["+","-","x","/"].includes(a[u.id].operator)&&(null==n?void 0:n.value)&&Number(n.value)){const e=Number(n.value),t=a[u.id].operator,i=a[u.id].number;let o=0;"+"===t&&(o=e+i),"-"===t&&(o=e-i),"x"===t&&(o=e*i),"/"===t&&(o=e/i),isNaN(o)||(m+=o)}}return e+m}),0);return{current_total_dynamic_score:r}},be=(e,i)=>{const n=ve(i[0]);if(0===Object.keys(n).length)return e;const o=i.filter((e=>e.type===t.NodeType.FORM));return Object.keys(n).forEach((t=>{var i,a,l;const r=o.find((e=>e.id===t)),d=null===(i=null==r?void 0:r.actions)||void 0===i?void 0:i.find((e=>{var i;return e.id===(null===(i=n[t])||void 0===i?void 0:i.action_id)})),s=null==d?void 0:d.key,c=null===(l=null===(a=null==r?void 0:r._message)||void 0===a?void 0:a.form_submit_meta)||void 0===l?void 0:l.find((e=>e.key===s&&"number"===e.control));if(n[t].number&&["+","-","x","/"].includes(n[t].operator)&&(null==c?void 0:c.value)&&Number(c.value)){const i=Number(c.value),o=n[t].operator,a=n[t].number;let l=0;if("+"===o&&(l=i+a),"-"===o&&(l=i-a),"x"===o&&(l=i*a),"/"===o&&(l=i/a),e.includes(`{{var:${s}}}`)){const t=new RegExp(`{{var:${s}}}`,"g");e=e.replace(t,String(Math.floor(100*l)/100))}}})),e},he="other",ye="stateInlineSSO",Ee=()=>{try{const e=window.next.router.components["/[...slug]"].props.pageProps;return"services-connection"===e.template?{project_id:"care-path",user_funnel:e.spotlight.additionalSlugActive||"",audience_name:e.spotlight.groupIdActive||""}:{}}catch(e){return{}}},xe=e=>{const i=e.filter((e=>"Unified Questions"===e.name)).reduce(((e,i)=>{var n,o,a,l,r,d,s,c,u,p,m,f,v,g,b,h,y,E,x,C,N;if(i.actions&&(null===(n=i._message)||void 0===n?void 0:n.action_id)&&(null===(o=i._message)||void 0===o?void 0:o.action_value)){const n=i._message.action_value;if(i.type===t.NodeType.FORM){const t=["address","province","district","commune"],n=((null===(a=i._message)||void 0===a?void 0:a.form_submit_meta)||[]).filter((e=>!t.includes(e.control))),o=((null===(l=i._message)||void 0===l?void 0:l.form_submit_meta)||[]).filter((e=>t.includes(e.control))).reduce(((e,t)=>(e[t.control]=t,e)),{}),m=[null===(r=o.address)||void 0===r?void 0:r.value,null===(d=o.commune)||void 0===d?void 0:d.value,null===(s=o.district)||void 0===s?void 0:s.value,null===(c=o.province)||void 0===c?void 0:c.value].filter(Boolean).join(", ");m&&o.address?e.push({attribute:o.address.key,value:m,label_question:(null===(p=null===(u=i.intents)||void 0===u?void 0:u[0])||void 0===p?void 0:p.label)||""}):n.forEach((t=>{var n,o;e.push({attribute:t.key,value:t.value,label_question:(null===(o=null===(n=i.intents)||void 0===n?void 0:n[0])||void 0===o?void 0:o.label)||""})}))}if(i.type===t.NodeType.TEXT)if(i.is_multi_select){const t=Object.keys(i._message.selected_actions||{}),n=i.actions.filter((e=>e.label&&t.includes(e.id))).map((e=>e.label));t.length&&e.push({attribute:i.actions[0].key||"",value:n,label_question:(null===(f=null===(m=i.intents)||void 0===m?void 0:m[0])||void 0===f?void 0:f.label)||""})}else{const o=i._message.action_id,a=i.actions.find((e=>e.id===o)),l=null==a?void 0:a.label,r=null===(b=null===(g=null===(v=i._message)||void 0===v?void 0:v.form_submit_meta)||void 0===g?void 0:g.find((e=>e.key===he)))||void 0===b?void 0:b.value,d=(null==a?void 0:a.type)===t.NodeActionType.USER_CHOICE_TEXT_BY_INPUT;l&&o&&e.push({attribute:n,value:d&&r?r:l,label_question:(null===(y=null===(h=i.intents)||void 0===h?void 0:h[0])||void 0===y?void 0:y.label)||""})}if(i.type===t.NodeType.POLL){const t=i.id,n=(null===(x=null===(E=i._message)||void 0===E?void 0:E.current_polls)||void 0===x?void 0:x[t])||[],o=i.actions.filter((e=>e.label&&n.includes(e.id))).map((e=>e.label));n.length&&e.push({attribute:i.actions[0].key||"",value:o,label_question:(null===(N=null===(C=i.intents)||void 0===C?void 0:C[0])||void 0===N?void 0:N.label)||""})}}return e}),[]);return i},Ce=(e,i)=>{var n;try{if("ACUVUE"!==(null===(n=i.extra_settings)||void 0===n?void 0:n.subot_type))return;let o="",a="",l="",r=se().email;if((e||[]).forEach((e=>{var i,n,d;const s=e._message;if(!s)return;const c=null===(i=e.actions)||void 0===i?void 0:i.find((e=>e.id===s.action_id));if("voucher_product"===s.action_value?o=(null==c?void 0:c.label)||"":"voucher_color"===s.action_value&&(a=(null==c?void 0:c.label)||""),e.type===t.NodeType.FORM){const e=null===(n=s.form_submit_meta)||void 0===n?void 0:n.find((e=>"voucher_size"===e.key)),t=null===(d=s.form_submit_meta)||void 0===d?void 0:d.find((e=>"email"===e.control));e&&(l=e.value),t&&(r=t.value)}})),"ACUVUE® OASYS (1-DAY) WITH HYDRALUXE®"===o&&r)return{email:r,voucherName:o};if(o&&a&&l&&r)return{email:r,voucherName:`${o}|${a}|${l}`}}catch(e){console.log("ExtractVoucherAnswer",e)}},Ne=({nodes:e,activeId:o,params:a,accountIdFromLogs:l})=>i.__awaiter(void 0,void 0,void 0,(function*(){try{let i="in_progress";const r=e[e.length-1];(null==r?void 0:r.type)&&t.NodeFinalTypes.includes(r.type)&&(i="complete");const s=e.slice(1),c={activeId:o,params:a,nodes:s,tracking:Object.assign(Object.assign({},Ee()),{full_url:window.location.href}),unifiedAnswers:xe(s),voucherAnswers:Ce(s,e[0])},u={cookie_id:re(),account_id:l||de()||null,bot_id:e[0].id,flow_uuid:e[0].flow_uuid,data:JSON.stringify(c),status:i,type:"inline",market:n.MAP_DOMAIN_BY_LOCALE[d.locale]};yield d.callApi(K(V.POST_SUBOT_CREATE_LOG),"POST",{data:u})}catch(e){}})),Te=(e,t)=>{try{const[i,n,o]=q.default(e,{format:"array"});return`rgba(${i}, ${n}, ${o}, ${t})`}catch(e){return}},we=e.createContext({activeId:"",params:{},listNodes:[],loading:!0,getParams:()=>({}),onNext:()=>null,onPrev:()=>null,onSubmit:()=>null,onStartOver:()=>null,onChange:()=>null,isShowFooter:!1,setIsShowFooter:()=>null,setLoading:()=>null,userInfo:null}),_e=({children:o,articleLink:a,subotId:l,isFullContainer:r,bgColor:s,primaryColor:c,isDisabledAnimationOnMobile:u,onCloseMobile:p,userInfo:m})=>{const{formatMessage:f,action:{pushNotifications:v}}=e.useContext(d.TogetherComponentGlobalContext),g=e.useRef(null),b=e.useRef(null),[h,y]=e.useState(!0),[E,x]=e.useState(""),[C,N]=e.useState([]),[T,w]=e.useState(!1),[_,I]=e.useState({});e.useEffect((()=>{const e=s||"#e3f2ff",t=c||"#2d87f3",i=(new Date).getTime(),n=setInterval((()=>{const o=g.current,a=(new Date).getTime();o&&(Q.mutate((()=>{o.style.setProperty("--subot-inline-bg-color",e),o.style.setProperty("--subot-inline-primary-color",t),o.style.setProperty("--subot-inline-primary-color-hover",Te(t,.9)||t),o.style.setProperty("--subot-inline-primary-color-100",Te(t,.1)||"#e3f2ff"),o.style.setProperty("--subot-inline-primary-color-300",Te(t,.3)||"#bcdeff")})),clearInterval(n)),a-i>18e4&&clearInterval(n)}),100);return()=>{clearInterval(n)}}),[s,c]);const k=e.useCallback((()=>{const e=window.gaData,t=window.location.origin+n.basePath+("tl-PH"===(null===d.GlobalData||void 0===d.GlobalData?void 0:d.GlobalData.locale)?a.replace("fil/",""):a),i={bot_id:l,account_id:de()||null,action_id:"",action_value:"",cookie_id:re(),current_score:0,current_keys:[],current_selected:[],form_submit_meta:[],gtm_id:e?Object.keys(e)[0]:"",ga_client_id:B.default.get("_ga")||"",is_new:!1,mode:"inline",node_id:"",selected_actions:{},title_url:document.title||"",url:t.replace("http://localhost:6006","https://discover.hellobacsi.com").replace("http://localhost","https://discover.hellobacsi.com").replace("dev.","discover.").replace("staging.hellohealthgroup.com","discover.hellodoctor.com.ph").replace("https://hellohealthgroup.com","https://hellodoctor.com.ph"),window_id:ue()};return ne(i,null===d.GlobalData||void 0===d.GlobalData?void 0:d.GlobalData.router.query)}),[]),S=e.useCallback((()=>{var e;null===(e=g.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"start",inline:"center"})}),[]),O=e.useCallback(((e,n=!0)=>i.__awaiter(void 0,void 0,void 0,(function*(){var o;if(!e||!e.url||!e.bot_id)return;let a="",l=[];y(!0);const r=yield Z(e.bot_id);1===(null==r?void 0:r._status)&&(a=null==r?void 0:r._data.id.toString(),l.push(null==r?void 0:r._data,null==r?void 0:r._data.first_node));const s=n?yield(c=l[0],i.__awaiter(void 0,void 0,void 0,(function*(){var e,t;try{if(!c)return null;const i=yield d.callApi(K(V.GET_SUBOT_LOG,{botId:c.id,cookieId:re(),accountId:de()||"",type:"inline"}),"GET");if(!(null===(e=null==i?void 0:i._data)||void 0===e?void 0:e.data)||"inline"!==(null===(t=null==i?void 0:i._data)||void 0===t?void 0:t.type))return null;const n=JSON.parse(i._data.data),o=n.nodes,a="in_progress"===i._data.status,l="complete"===i._data.status;return a||l?{nodes:[c,...o],activeId:n.activeId,params:Object.assign(Object.assign({},n.params),{account_id:de()||n.params.account_id||null})}:null}catch(e){return null}}))):null;var c;s&&(l=s.nodes,a=s.activeId,b.current=(null===(o=s.params)||void 0===o?void 0:o.account_id)||0);const u=((e,{getParams:i})=>{try{if(!de())return null;const n=JSON.parse(localStorage.getItem(ye)||""),o=18e5;return(null==n?void 0:n.botId)===e&&n.listNodes&&n.activeId&&n.createdAt+o>Date.now()&&(localStorage.removeItem(ye),n.listNodes.slice(-1)[0].position===t.NodePosition.SSO)?{listNodes:n.listNodes,activeId:n.activeId,params:Object.assign(Object.assign(Object.assign({},i()),n.params),{account_id:de()||null,cookie_id:re(n.params.cookie_id)})}:null}catch(e){return null}})(e.bot_id,{getParams:k});if(u&&u.params.action_id&&u.params.action_value){const e=yield W(u.params);1===(null==e?void 0:e._status)&&(null==e?void 0:e._data.node)&&(a=null==e?void 0:e._data.node.id,l=u.listNodes,l[l.length-1]=null==e?void 0:e._data.node,Ne({nodes:l,activeId:a,params:u.params,accountIdFromLogs:b.current}),setTimeout((()=>{S()}),100))}const p=(null==u?void 0:u.params)||(null==s?void 0:s.params)||e,[m,f]=((e,t,i)=>{if(!(null==e?void 0:e.subot_field_type))return[t,i];const n=i.find((e=>e.id==t));return n&&n.hasOwnProperty("first_node")&&i.length>1?[i[1].id,i]:[t,i]})(l[0],a,l);y(!1),x(m),N(f),I(Object.assign(Object.assign({},e),p))}))),[]),A=e.useCallback(((e,t)=>{const i=document.querySelector(`.si-revamp-event-submission[data-bot-id="${l}"]`);i&&i.click();let n=E,o=[...C];if(null==t?void 0:t.node_id){const e=o.findIndex((({id:e})=>e==t.node_id));-1!==e&&(o[e]._message=Object.assign(Object.assign({},o[e]._message),t),o=[...o.slice(0,e+1)])}if(y(!0),e){const t=o.findIndex((({id:t})=>t==(null==e?void 0:e.id)));if(-1===t)o=[...o,Object.assign({},e)];else{const i=Object.assign(Object.assign(Object.assign({},o[t]),e),{_message:Object.assign(Object.assign({},o[t]._message),null==e?void 0:e._message)});o=[...o.slice(0,t),Object.assign({},i),...o.slice(t+1)]}n=e.id}setTimeout((()=>{N(o),x(n),y(!1),Ne({nodes:o,activeId:n,params:_,accountIdFromLogs:b.current})}),250)}),[C,E]),P=e.useCallback((e=>i.__awaiter(void 0,void 0,void 0,(function*(){if(null==e?void 0:e.node_id){const t=Object.assign(Object.assign({},e),ge(C,E,e.action_id)),n=yield W(t);if(y(!1),1===(null==n?void 0:n._status)){const e=null==n?void 0:n._data,{node:o}=e,a=i.__rest(e,["node"]),l=Object.assign(Object.assign({},o),{_message:Object.assign(Object.assign({},a),{node_id:o.id})});return void(-1!==C.findIndex((e=>e.id===l.id))?A(l):A(l,t))}v({title:f({id:"notification.comment.somethingWrong"}),message:"",type:"danger"})}const t=C.find((e=>e.id==E));t&&t.hasOwnProperty("first_node")&&(x(C[1].id.toString()),Ne({nodes:C,activeId:C[1].id.toString(),params:k(),accountIdFromLogs:b.current}))}))),[A,C]),M=e.useCallback((()=>{const e=C.findIndex((({id:e})=>e==E));if(e&&-1!==e&&e>1){const t=C[e-1];x(t.id),Ne({nodes:C,activeId:t.id,params:_,accountIdFromLogs:b.current})}}),[C,E]),R=e.useCallback((()=>{const e=k();O(e,!1);const t=C[0],i=C[1];Ne({nodes:[t,i],activeId:String(t.id),params:e,accountIdFromLogs:b.current})}),[k,O,C]),L=e.useCallback((e=>{N((t=>e&&(null==e?void 0:e.node_id)&&(null==e?void 0:e.node_id)==E?t.map((t=>{const i=t;return i.id===E?Object.assign(Object.assign({},t),{_message:i._message?Object.assign(Object.assign({},i._message),e):e}):t})):t))}),[E]);e.useEffect((()=>{if(B.default.get(n.GA_TOKEN_COOKIE)){const e=k();O(e)}else ae({condition:()=>Boolean(B.default.get(n.GA_TOKEN_COOKIE)),finished:()=>{const e=k();O(e)}})}),[]),e.useEffect((()=>{if(!C.length)return;C.find((e=>e.id==E))&&E||x(l+"")}),[E,C]);const U=e.useMemo((()=>({activeId:E,params:_,listNodes:C,loading:h,setLoading:y,getParams:k,onNext:P,onPrev:M,onSubmit:A,onStartOver:R,onChange:L,isShowFooter:T,setIsShowFooter:w,isFullContainer:r,isDisabledAnimationOnMobile:u,onCloseMobile:p,userInfo:m})),[E,P,M,A,L,R,T,_,C,h,y,k,r,u,p,m]);return C.length?j.default.createElement(we.Provider,{value:U},j.default.createElement("div",{ref:g},o)):null},Ie=e=>j.default.createElement("svg",Object.assign({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),j.default.createElement("path",{d:"M5.99105 4.99067C5.79212 4.99072 5.59772 5.0501 5.43271 5.16121C5.2677 5.27233 5.13958 5.43013 5.06472 5.61444C4.98986 5.79875 4.97167 6.0012 5.01248 6.1959C5.05328 6.39061 5.15122 6.56872 5.29379 6.70747L10.5868 12.0004L5.29379 17.2934C5.19781 17.3855 5.12119 17.4959 5.0684 17.618C5.01562 17.7402 4.98773 17.8716 4.98638 18.0046C4.98503 18.1377 5.01023 18.2697 5.06052 18.3928C5.11081 18.516 5.18517 18.6279 5.27925 18.722C5.37333 18.8161 5.48523 18.8904 5.60841 18.9407C5.73159 18.991 5.86356 19.0162 5.9966 19.0149C6.12964 19.0135 6.26108 18.9856 6.38321 18.9328C6.50533 18.8801 6.6157 18.8034 6.70785 18.7075L12.0008 13.4145L17.2938 18.7075C17.3859 18.8034 17.4963 18.8801 17.6184 18.9328C17.7406 18.9856 17.872 19.0135 18.005 19.0149C18.1381 19.0162 18.27 18.991 18.3932 18.9407C18.5164 18.8904 18.6283 18.8161 18.7224 18.722C18.8165 18.6279 18.8908 18.516 18.9411 18.3928C18.9914 18.2697 19.0166 18.1377 19.0153 18.0047C19.0139 17.8716 18.986 17.7402 18.9332 17.618C18.8804 17.4959 18.8038 17.3855 18.7078 17.2934L13.4149 12.0004L18.7078 6.70747C18.8524 6.567 18.951 6.38616 18.991 6.18864C19.031 5.99112 19.0103 5.78614 18.9318 5.60055C18.8532 5.41497 18.7205 5.25744 18.5509 5.14861C18.3812 5.03978 18.1827 4.98473 17.9813 4.99067C17.7215 4.99841 17.4749 5.10699 17.2938 5.2934L12.0008 10.5864L6.70785 5.2934C6.61466 5.19761 6.50321 5.12146 6.3801 5.06947C6.25698 5.01747 6.1247 4.99068 5.99105 4.99067Z",fill:"#595959"})),ke="480px",Se=F.default.div`
|
|
2
2
|
position: relative;
|
|
3
3
|
|
|
4
4
|
.si-inline-revamp-container {
|
package/build/together.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./index.styled-
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./index.styled-44a88d2d.js"),r=require("./index-a74cf615.js"),t=require("./types-f3bf297f.js"),o=require("./index.styles-d3b67125.js");require("react"),require("@mantine/core"),require("./tslib.es6-a447d75e.js"),require("./useTranslations-7f12251c.js"),require("./translationsContext-8f763486.js"),require("string-format"),require("./index-b9a7f78c.js"),require("./theme-c252ab3b.js"),require("dayjs"),require("./screenSizeContext-1a577828.js"),require("styled-components"),require("lodash/throttle"),require("./index-5d9cc019.js"),require("date-fns/locale"),require("./Subot-6070090a.js"),require("./isProduction-f6daa4d4.js"),require("./gAssets.js"),require("./index-be8bd1aa.js"),require("@mantine/hooks"),require("@mantine/carousel"),require("classnames"),require("@mantine/dates"),require("./number-1963bb93.js"),require("date-fns"),require("./index-dd2f12d8.js"),require("./index-a25f5546.js"),require("./constants-d67df371.js"),require("./routing-1e951b79.js"),require("dayjs/plugin/relativeTime"),require("./paths-d3a2028a.js"),require("lodash/debounce"),require("./useCategory-eea8836a.js"),require("./index-9d548edc.js"),require("innertext"),require("./cookieHelper-50f349a8.js"),require("react-contenteditable"),require("react-dom"),require("@linaria/react"),require("./utils-00a7b97a.js"),require("./index.styled-4108cde2.js"),require("./index-f2286b64.js"),require("./index-1f4a8940.js"),require("react-keyed-flatten-children"),require("slugify"),exports.CardAuthor=e.CardAuthor,exports.CardReactions=e.CardReactions,exports.LabelSortPin=e.LabelSortPin,exports.LabelSorting=e.LabelSorting,exports.PopoverMenu=e.PopoverMenu,exports.PopupDoctor=e.PopupDoctor,exports.PopupExpert=e.PopupExpert,exports.PopupFrame=e.PopupFrame,exports.PopupHospital=e.PopupHospital,exports.PostContent=e.PostContent,exports.ProfileDetail=e.ProfileDetail,exports.ProfileDetailModal=e.ProfileDetailModal,exports.ShareBox=e.ShareBox,exports.SharePopup=e.SharePopup,exports.SourceList=e.SourceList,Object.defineProperty(exports,"TabNameInProfileDetail",{enumerable:!0,get:function(){return e.TabName}}),exports.TagTopic=e.TagTopic,exports.TogetherAuthConfigContext=e.TogetherAuthConfigContext,exports.TogetherAuthConfigContextProvider=e.TogetherAuthConfigContextProvider,exports.useTogetherAuthRequiredAction=e.useTogetherAuthRequiredAction,exports.TogetherDataTransforms=r.dataTransform,exports.UserAvatar=r.UserAvatar,exports.CardLink=t.CardLink,exports.CardPost=t.CardPost,exports.CardPostPopoverMore=t.CardPostPopoverMore,exports.CardReply=t.CardReply,exports.CardReplyPopover=t.CardReplyPopover,exports.CreateNewPostContent=t.CreateNewPostContent,exports.CreatePostDescription=t.CreatePostDescription,exports.CreatePostTitle=t.CreatePostTitle,exports.ImagePreviewPopup=t.ImagePreviewPopup,exports.InputCommentBar=t.InputCommentBar,exports.LabelPin=t.LabelPin,exports.PopupDanger=t.PopupDanger,exports.PostImagePreview=t.PostImagePreview,exports.PostSingleImageViewPopup=t.PostSingleImageViewPopup,exports.SkipQuestionOfExpertBtn=t.SkipQuestionOfExpertBtn,exports.SocialLinkPreview=t.SocialLinkPreview,exports.SubmitReportForm=t.SubmitReportForm,exports.TogetherTypes=t.types,exports.TopicSelectList=t.TopicSelectList,exports.VerifiedTag=t.VerifiedTag,exports.DefaultComponentGlobalContextData=o.DefaultComponentGlobalContextData,Object.defineProperty(exports,"GlobalData",{enumerable:!0,get:function(){return o.GlobalData}}),exports.TogetherComponentGlobalContext=o.TogetherComponentGlobalContext,exports.TogetherComponentGlobalContextProvider=o.TogetherComponentGlobalContextProvider,exports.TogetherConstants=o.constants;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var e=require("./tslib.es6-
|
|
1
|
+
"use strict";var e=require("./tslib.es6-a447d75e.js"),t=require("react"),a=require("./useTranslations-7f12251c.js"),i=require("lodash/debounce"),o=require("./constants-d67df371.js"),l=require("./index-a25f5546.js"),n=require("styled-components"),s=require("./index-b9a7f78c.js"),r=require("./theme-c252ab3b.js"),c=require("lodash/shuffle"),d=require("./useOutsideClick-99a300bf.js"),u=require("./screenSizeContext-1a577828.js");require("dayjs");var p=require("./index-5d9cc019.js");require("./isProduction-f6daa4d4.js"),require("./Subot-6070090a.js"),require("./gAssets.js");var h=require("react-loading-skeleton"),g=require("./paths-d3a2028a.js"),f=require("@mantine/core"),m=require("./cookieHelper-50f349a8.js"),C=require("./index-5e5d6e08.js"),b=require("./ChevronDown-2eede824.js"),y=require("string-format");function v(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var x=v(t),E=v(i),S=v(n),L=v(c),w=v(h),O=v(y);function k(){const[e,a]=t.useState((()=>{if("undefined"==typeof window)return"unset";if(m.getCookie(p.USER_GEOLOCATION_COORDINATES_COOKIE))return"granted";const e=!location.protocol.includes("https")&&"localhost"!==location.hostname;return!navigator.geolocation||e?"denied":"unset"})),[i,o]=t.useState((()=>{if("undefined"==typeof window)return null;const e=m.getCookie(p.USER_GEOLOCATION_COORDINATES_COOKIE);if(e)try{return JSON.parse(e)}catch(e){console.log(e)}return null})),l=t.useCallback((function(){navigator.geolocation&&navigator.geolocation.getCurrentPosition((e=>{const t={lat:""+Math.round(1e7*e.coords.latitude)/1e7,lng:""+Math.round(1e7*e.coords.longitude)/1e7};m.setCookie(p.USER_GEOLOCATION_COORDINATES_COOKIE,JSON.stringify(t),{minutes:15}),o(t),a("granted")}),(()=>{m.deleteCookie(p.USER_GEOLOCATION_COORDINATES_COOKIE),a("denied")}))}),[]);return t.useMemo((()=>({geoLocationPermission:e,geoLocationCoordinates:i,requestGeoLocation:l})),[e,i])}const I=S.default.div``,T=S.default.div`
|
|
2
2
|
--searchbar-z-index: 305;
|
|
3
3
|
&[data-is-modal='true'] {
|
|
4
4
|
position: fixed;
|
|
@@ -75,11 +75,11 @@
|
|
|
75
75
|
top: 0;
|
|
76
76
|
box-shadow: initial;
|
|
77
77
|
}
|
|
78
|
-
`,
|
|
78
|
+
`,K=S.default.ul`
|
|
79
79
|
width: 100%;
|
|
80
80
|
max-height: 600px;
|
|
81
81
|
overflow-y: auto;
|
|
82
|
-
`,
|
|
82
|
+
`,V=S.default(P)`
|
|
83
83
|
width: 12px;
|
|
84
84
|
height: 18px;
|
|
85
85
|
`,H=S.default.li`
|
|
@@ -124,7 +124,7 @@
|
|
|
124
124
|
&:first-child {
|
|
125
125
|
padding-top: 18px;
|
|
126
126
|
}
|
|
127
|
-
`,G=({cities:e,isLoading:t,onLocationClick:i,selectedLocation:l})=>{const{t:n,locale:c}=a.useTranslations();return x.default.createElement(B,{"data-testid":"location-search-results"},x.default.createElement(
|
|
127
|
+
`,G=({cities:e,isLoading:t,onLocationClick:i,selectedLocation:l})=>{const{t:n,locale:c}=a.useTranslations();return x.default.createElement(B,{"data-testid":"location-search-results"},x.default.createElement(K,null,t?x.default.createElement(z,{count:5}):!e||e.length<1?x.default.createElement(x.default.Fragment,null,x.default.createElement(H,{"data-is-denied":"true"},x.default.createElement(s.Text,{size:"sm",color:"#ccc"},n("booking.searchBar.noResults")))):x.default.createElement(x.default.Fragment,null,x.default.createElement(H,{key:"all-location",role:"button",tabIndex:0,onClick:()=>{var e;i&&i({name:n("booking.searchBar.allLocations"),id:o.ID_OPTION_ALL_LOCATION,slug:null===(e=o.LOCALIZED_SLUGS[c])||void 0===e?void 0:e.ALL})}},x.default.createElement(V,{color:r.theme.colors.neutral400}),x.default.createElement(s.Text,{size:"md"},n("booking.searchBar.allLocations"))),e.map((e=>x.default.createElement(H,{key:e.id,onClick:t=>{t.nativeEvent.stopImmediatePropagation(),i&&i(e)},role:"button",tabIndex:0,"aria-label":`Select ${e.name} as location`,isSelected:(null==l?void 0:l.id)===e.id},x.default.createElement(V,{color:r.theme.colors.neutral400}),x.default.createElement(s.Text,{size:"md"},e.name)))))))},Z="TYPE_CHARACTER",U="REMOVE_CHARACTER",Q="REMOVE_ALL",q="REMOVE_LAST_VISIBLE_NODE",Y="PAUSE_FOR",W="CHANGE_DELETE_SPEED",J="CHANGE_DELAY",X="PASTE_STRING",ee=(e,t)=>Math.floor(Math.random()*(t-e+1))+e,te="TEXT_NODE";class ae{constructor(e){this.state={lastFrameTime:null,pauseUntil:null,eventQueue:[],eventLoop:null,eventLoopPaused:!1,reverseCalledEvents:[],calledEvents:[],visibleNodes:[],initialOptions:null},this.options={strings:null,delay:"natural",pauseFor:1500,deleteSpeed:"natural",loop:!1,autoStart:!1,stringSplitter:null,onCreateTextNode:null,onRemoveNode:null},this.start=()=>(this.state.eventLoopPaused=!1,this.runEventLoop(),this),this.pause=()=>(this.state.eventLoopPaused=!0,this),this.stop=()=>(this.state.eventLoop&&(window.cancelAnimationFrame(this.state.eventLoop),this.state.eventLoop=null),this),this.pauseFor=e=>(this.addEventToQueue(Y,{ms:e}),this),this.typeOutAllStrings=()=>"string"==typeof this.options.strings?(this.typeString(this.options.strings).pauseFor(this.options.pauseFor),this):(this.options.strings.forEach((e=>{this.typeString(e).pauseFor(this.options.pauseFor).deleteAll(this.options.deleteSpeed)})),this),this.typeString=(e,t=null)=>{if(e){const{stringSplitter:a}=this.options||{},i="function"==typeof a?a(e):e.split("");this.typeCharacters(i,t)}return this},this.pasteString=(e,t=null)=>(e&&this.addEventToQueue(X,{character:e,node:t}),this),this.deleteAll=(e="natural")=>(this.addEventToQueue(Q,{speed:e}),this),this.changeDeleteSpeed=e=>{if(!e)throw new Error("Must provide new delete speed");return this.addEventToQueue(W,{speed:e}),this},this.changeDelay=e=>{if(!e)throw new Error("Must provide new delay");return this.addEventToQueue(J,{delay:e}),this},this.deleteChars=e=>{if(!e)throw new Error("Must provide amount of characters to delete");for(let t=0;t<e;t++)this.addEventToQueue(U);return this},this.typeCharacters=(e,t=null)=>{if(!e||!Array.isArray(e))throw new Error("Characters must be an array");return e.forEach((e=>{this.addEventToQueue(Z,{character:e,node:t})})),this},this.removeCharacters=e=>{if(!e||!Array.isArray(e))throw new Error("Characters must be an array");return e.forEach((()=>{this.addEventToQueue(U)})),this},this.addEventToQueue=(e,t,a=!1)=>this.addEventToStateProperty(e,t,a,"eventQueue"),this.addReverseCalledEvent=(e,t,a=!1)=>{const{loop:i}=this.options;return i?this.addEventToStateProperty(e,t,a,"reverseCalledEvents"):this},this.addEventToStateProperty=(e,t,a=!1,i)=>{const o={eventName:e,eventArgs:t||{}};return this.state[i]=a?[o,...this.state[i]]:[...this.state[i],o],this},this.runEventLoop=()=>{this.state.lastFrameTime||(this.state.lastFrameTime=Date.now());const e=Date.now(),t=e-this.state.lastFrameTime;if(!this.state.eventQueue.length){if(!this.options.loop)return;this.state.eventQueue=[...this.state.calledEvents],this.state.calledEvents=[],this.options=Object.assign({},this.state.initialOptions)}if(this.state.eventLoop=window.requestAnimationFrame(this.runEventLoop),this.state.eventLoopPaused)return;if(this.state.pauseUntil){if(e<this.state.pauseUntil)return;this.state.pauseUntil=null}const a=[...this.state.eventQueue],i=a.shift();let o=0;if(o=i.eventName===q||i.eventName===U?"natural"===this.options.deleteSpeed?ee(40,80):this.options.deleteSpeed:"natural"===this.options.delay?ee(120,160):this.options.delay,t<=o)return;const{eventName:l,eventArgs:n}=i;switch(l){case X:case Z:{const{character:e}=n,t=document.createTextNode(e);let a=t;this.options.onCreateTextNode&&"function"==typeof this.options.onCreateTextNode&&(a=this.options.onCreateTextNode(e,t)),this.state.visibleNodes=[...this.state.visibleNodes,{type:te,character:e,node:a}];break}case U:a.unshift({eventName:q,eventArgs:{removingCharacterNode:!0}});break;case Y:{const{ms:e}=i.eventArgs;this.state.pauseUntil=Date.now()+parseInt(e);break}case Q:{const{visibleNodes:e}=this.state,{speed:t}=n,i=[];t&&i.push({eventName:W,eventArgs:{speed:t,temp:!0}});for(let t=0,a=e.length;t<a;t++)i.push({eventName:q,eventArgs:{removingCharacterNode:!1}});t&&i.push({eventName:W,eventArgs:{speed:this.options.deleteSpeed,temp:!0}}),a.unshift(...i);break}case q:if(this.state.visibleNodes.length){const{node:e,character:t}=this.state.visibleNodes.pop();this.options.onRemoveNode&&"function"==typeof this.options.onRemoveNode&&this.options.onRemoveNode({node:e,character:t}),e&&e.parentNode.removeChild(e)}break;case W:this.options.deleteSpeed=i.eventArgs.speed;break;case J:this.options.delay=i.eventArgs.delay}this.options.loop&&(i.eventName===q||i.eventArgs&&i.eventArgs.temp||(this.state.calledEvents=[...this.state.calledEvents,i])),this.state.eventQueue=a,this.state.lastFrameTime=e},e&&(this.options=Object.assign(Object.assign({},this.options),e)),this.state.initialOptions=Object.assign({},this.options),this.init()}init(){this.addEventToQueue(Q,null,!0),!0===this.options.autoStart&&this.options.strings&&this.typeOutAllStrings().start()}}function ie({inputRef:e,wrapperRef:i,disabled:o}){const{t:l,locale:n}=a.useTranslations(),s=t.useMemo((()=>{if(o)return[];const e=["booking.searchBar.placeholder.hospital","booking.searchBar.placeholder.doctor"];return"zh-TW"!==n&&e.push("booking.searchBar.placeholder.specialty","booking.searchBar.placeholder.service"),L.default(e).map((e=>l(e)))}),[l,n]);function r(e){const t=d();return t&&(t.placeholder=t.placeholder+e),null}function c(){const e=d();e&&(e.placeholder=e.placeholder.slice(0,-1))}function d(){return e&&e.current?e.current:i&&i.current&&i.current.querySelector("input")||null}t.useEffect((()=>{if(o)return;const e=d();e&&(e.placeholder="",new ae({strings:s,autoStart:!0,loop:!0,delay:32,deleteSpeed:32,pauseFor:1500,onCreateTextNode:r,onRemoveNode:c}))}),[e,i])}const oe=S.default.div`
|
|
128
128
|
user-select: none;
|
|
129
129
|
input {
|
|
130
130
|
pointer-events: none;
|
|
@@ -315,16 +315,16 @@
|
|
|
315
315
|
font-size: 14px;
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
|
-
`,
|
|
318
|
+
`,Ke=S.default.figure`
|
|
319
319
|
max-width: var(--graphicSize);
|
|
320
320
|
min-width: var(--graphicSize);
|
|
321
|
-
`,
|
|
321
|
+
`,Ve=S.default.svg`
|
|
322
322
|
margin: 0 auto;
|
|
323
323
|
display: block;
|
|
324
324
|
`,He=S.default.div`
|
|
325
325
|
display: grid;
|
|
326
326
|
place-items: center;
|
|
327
|
-
`,ze={doctors:({width:e,height:t})=>x.default.createElement("svg",{width:e||32,height:t||32,viewBox:"0 0 32 32",fill:"none"},x.default.createElement("g",{clipPath:"url(#clip0_14712_400114)"},x.default.createElement("rect",{width:"32",height:"32",rx:"16",fill:"#E4E8EC"}),x.default.createElement("path",{d:"M22.065 9.58305C22.1108 9.80952 22.1431 10.0396 22.1614 10.2722C22.3769 13.0522 22.5858 16.1276 22.5727 17.618C22.5306 20.5688 19.708 21.1325 19.4564 21.1769L19.4495 21.5357L19.5228 23.9014C20.8688 23.9341 22.203 24.1759 23.4772 24.6196C24.5264 24.9739 25.4827 25.5591 26.2757 26.332C27.0688 27.105 27.6783 28.0461 28.0594 29.0858L31.9886 39.2068C31.91 39.3048 30.6939 39.6356 29.4888 39.944C30.1695 42.3315 30.4582 44.8142 30.3432 47.2953C30.2991 48.2666 30.1816 49.264 29.7245 50.1211C29.4508 50.6342 29.0319 51.0912 28.5296 51.3753C28.5099 51.4347 28.4864 51.4928 28.4593 51.5495C28.4293 51.6146 28.3908 51.6756 28.3448 51.7307C28.3293 51.7772 28.3232 51.8406 28.3162 51.9135C28.3004 52.0779 28.2799 52.2909 28.1362 52.4685C28.001 52.6373 27.8519 52.7945 27.6905 52.9386C27.6905 52.9386 27.092 52.9667 26.4133 52.9845L26.458 58.4088H5.7492L6.30965 52.9523L5.66093 53.1637C5.07664 53.3528 4.45628 53.4028 3.84925 53.3099C3.24222 53.2169 2.66526 52.9835 2.1643 52.6283C1.61489 52.2388 1.17445 51.715 0.884966 51.1068C0.595484 50.4987 0.46662 49.8266 0.510669 49.1545L0.644528 47.1369L1.41503 38.3366L1.81323 38.4135L-0.914307 37.8437L-0.402886 36.5663C-0.407359 36.5645 -0.411803 36.5627 -0.416214 36.5608C-0.410804 36.56 -0.40538 36.5594 -0.399946 36.5589L2.05995 30.4146C3.00034 28.0825 4.7421 26.1624 6.97187 24.9999C8.56171 24.176 10.3028 23.6861 12.0882 23.5597L11.788 16.5865C11.1882 16.6507 10.0095 16.5266 9.96087 14.954C9.91229 13.3824 11.0457 13.3171 11.6507 13.3961L11.6445 13.2523C11.5785 12.8433 11.5088 12.439 11.4577 12.2132C11.3782 11.8628 11.2611 11.4953 11.1419 11.1207C10.8794 10.2967 10.6061 9.43855 10.697 8.65293C10.697 8.65293 10.6909 8.00438 11.4565 7.24044C11.3707 6.86644 11.3686 6.47786 11.4507 6.10258C11.5366 5.70965 11.7125 5.34199 11.9645 5.02848C12.2165 4.71497 12.5377 4.46414 12.9029 4.29569C13.2682 4.12725 13.6675 4.04577 14.0696 4.05766C14.2277 4.06393 14.3849 4.08493 14.5418 4.10589C14.7932 4.13945 15.0439 4.17294 15.2971 4.14581C15.7708 4.09409 16.177 3.83884 16.5862 3.58167C16.8357 3.42492 17.0863 3.26745 17.354 3.15494C17.9119 2.93744 18.5266 2.91281 19.1002 3.08497C19.6738 3.25713 20.1733 3.61619 20.5192 4.105C20.5943 4.21716 20.6621 4.33678 20.7298 4.45631C20.9035 4.76299 21.077 5.06915 21.373 5.24769C21.5927 5.38236 21.8482 5.42658 22.1057 5.47114C22.2633 5.49842 22.4216 5.52582 22.5728 5.57417C23.0267 5.71015 23.3999 6.0411 23.6319 6.45436C23.6327 6.40753 23.6317 6.36062 23.629 6.31374C23.6502 6.3657 23.6623 6.42092 23.6649 6.47698C23.6661 6.49165 23.667 6.50632 23.6677 6.521C23.8246 6.82609 23.9058 7.17114 23.8885 7.51347C23.8544 7.93447 23.7053 8.33801 23.4574 8.68001C23.2096 9.02201 22.8725 9.28933 22.483 9.45278C22.3469 9.50712 22.2071 9.55061 22.065 9.58305Z",fill:"white"})),x.default.createElement("defs",null,x.default.createElement("clipPath",{id:"clip0_14712_400114"},x.default.createElement("rect",{width:"32",height:"32",rx:"16",fill:"white"})))),services:({width:e,height:t})=>x.default.createElement("svg",{width:e||30,height:t||30,viewBox:"0 0 30 30",fill:"none"},x.default.createElement("circle",{cx:"15",cy:"15",r:"15",fill:"#F7F9FC"}),x.default.createElement("path",{d:"M14.9998 6.66663C12.2752 6.66663 9.85335 7.97848 8.33317 9.99996H10.5988C11.8 8.94527 13.3625 8.33329 14.9998 8.33329C16.6372 8.33329 18.1997 8.94527 19.4009 9.99996H21.6665C20.1463 7.97848 17.7244 6.66663 14.9998 6.66663ZM7.7863 10.8333C7.07666 13.0403 6.6665 15.5989 6.6665 18.3333C6.6665 20.0846 6.82601 21.7675 7.13525 23.3333H22.8644C23.1737 21.7675 23.3332 20.0846 23.3332 18.3333C23.3332 15.5989 22.923 13.0403 22.2134 10.8333H7.7863ZM14.9998 13.3333C17.3013 13.3333 19.1665 15.1985 19.1665 17.5C19.1665 19.8014 17.3013 21.6666 14.9998 21.6666C12.6984 21.6666 10.8332 19.8014 10.8332 17.5C10.8332 15.1985 12.6984 13.3333 14.9998 13.3333ZM14.1665 15V16.6666H12.4998V18.3333H14.1665V20H15.8332V18.3333H17.4998V16.6666H15.8332V15H14.1665Z",fill:"#BFC5CC"}))},Ge=({type:e,item:a,imageUrl:i,className:o,onClickItem:l})=>{const n=t.useMemo((()=>{const t=ze[e]||$;return x.default.createElement(t,{width:32,height:"services"===e?32:24})}),[e]);return x.default.createElement(Fe,{onClick:()=>l&&l(a),onKeyDown:e=>{"Enter"!==e.key&&"Space"!==e.key||l&&l(a)},tabIndex:0,role:"button",className:o},x.default.createElement(
|
|
327
|
+
`,ze={doctors:({width:e,height:t})=>x.default.createElement("svg",{width:e||32,height:t||32,viewBox:"0 0 32 32",fill:"none"},x.default.createElement("g",{clipPath:"url(#clip0_14712_400114)"},x.default.createElement("rect",{width:"32",height:"32",rx:"16",fill:"#E4E8EC"}),x.default.createElement("path",{d:"M22.065 9.58305C22.1108 9.80952 22.1431 10.0396 22.1614 10.2722C22.3769 13.0522 22.5858 16.1276 22.5727 17.618C22.5306 20.5688 19.708 21.1325 19.4564 21.1769L19.4495 21.5357L19.5228 23.9014C20.8688 23.9341 22.203 24.1759 23.4772 24.6196C24.5264 24.9739 25.4827 25.5591 26.2757 26.332C27.0688 27.105 27.6783 28.0461 28.0594 29.0858L31.9886 39.2068C31.91 39.3048 30.6939 39.6356 29.4888 39.944C30.1695 42.3315 30.4582 44.8142 30.3432 47.2953C30.2991 48.2666 30.1816 49.264 29.7245 50.1211C29.4508 50.6342 29.0319 51.0912 28.5296 51.3753C28.5099 51.4347 28.4864 51.4928 28.4593 51.5495C28.4293 51.6146 28.3908 51.6756 28.3448 51.7307C28.3293 51.7772 28.3232 51.8406 28.3162 51.9135C28.3004 52.0779 28.2799 52.2909 28.1362 52.4685C28.001 52.6373 27.8519 52.7945 27.6905 52.9386C27.6905 52.9386 27.092 52.9667 26.4133 52.9845L26.458 58.4088H5.7492L6.30965 52.9523L5.66093 53.1637C5.07664 53.3528 4.45628 53.4028 3.84925 53.3099C3.24222 53.2169 2.66526 52.9835 2.1643 52.6283C1.61489 52.2388 1.17445 51.715 0.884966 51.1068C0.595484 50.4987 0.46662 49.8266 0.510669 49.1545L0.644528 47.1369L1.41503 38.3366L1.81323 38.4135L-0.914307 37.8437L-0.402886 36.5663C-0.407359 36.5645 -0.411803 36.5627 -0.416214 36.5608C-0.410804 36.56 -0.40538 36.5594 -0.399946 36.5589L2.05995 30.4146C3.00034 28.0825 4.7421 26.1624 6.97187 24.9999C8.56171 24.176 10.3028 23.6861 12.0882 23.5597L11.788 16.5865C11.1882 16.6507 10.0095 16.5266 9.96087 14.954C9.91229 13.3824 11.0457 13.3171 11.6507 13.3961L11.6445 13.2523C11.5785 12.8433 11.5088 12.439 11.4577 12.2132C11.3782 11.8628 11.2611 11.4953 11.1419 11.1207C10.8794 10.2967 10.6061 9.43855 10.697 8.65293C10.697 8.65293 10.6909 8.00438 11.4565 7.24044C11.3707 6.86644 11.3686 6.47786 11.4507 6.10258C11.5366 5.70965 11.7125 5.34199 11.9645 5.02848C12.2165 4.71497 12.5377 4.46414 12.9029 4.29569C13.2682 4.12725 13.6675 4.04577 14.0696 4.05766C14.2277 4.06393 14.3849 4.08493 14.5418 4.10589C14.7932 4.13945 15.0439 4.17294 15.2971 4.14581C15.7708 4.09409 16.177 3.83884 16.5862 3.58167C16.8357 3.42492 17.0863 3.26745 17.354 3.15494C17.9119 2.93744 18.5266 2.91281 19.1002 3.08497C19.6738 3.25713 20.1733 3.61619 20.5192 4.105C20.5943 4.21716 20.6621 4.33678 20.7298 4.45631C20.9035 4.76299 21.077 5.06915 21.373 5.24769C21.5927 5.38236 21.8482 5.42658 22.1057 5.47114C22.2633 5.49842 22.4216 5.52582 22.5728 5.57417C23.0267 5.71015 23.3999 6.0411 23.6319 6.45436C23.6327 6.40753 23.6317 6.36062 23.629 6.31374C23.6502 6.3657 23.6623 6.42092 23.6649 6.47698C23.6661 6.49165 23.667 6.50632 23.6677 6.521C23.8246 6.82609 23.9058 7.17114 23.8885 7.51347C23.8544 7.93447 23.7053 8.33801 23.4574 8.68001C23.2096 9.02201 22.8725 9.28933 22.483 9.45278C22.3469 9.50712 22.2071 9.55061 22.065 9.58305Z",fill:"white"})),x.default.createElement("defs",null,x.default.createElement("clipPath",{id:"clip0_14712_400114"},x.default.createElement("rect",{width:"32",height:"32",rx:"16",fill:"white"})))),services:({width:e,height:t})=>x.default.createElement("svg",{width:e||30,height:t||30,viewBox:"0 0 30 30",fill:"none"},x.default.createElement("circle",{cx:"15",cy:"15",r:"15",fill:"#F7F9FC"}),x.default.createElement("path",{d:"M14.9998 6.66663C12.2752 6.66663 9.85335 7.97848 8.33317 9.99996H10.5988C11.8 8.94527 13.3625 8.33329 14.9998 8.33329C16.6372 8.33329 18.1997 8.94527 19.4009 9.99996H21.6665C20.1463 7.97848 17.7244 6.66663 14.9998 6.66663ZM7.7863 10.8333C7.07666 13.0403 6.6665 15.5989 6.6665 18.3333C6.6665 20.0846 6.82601 21.7675 7.13525 23.3333H22.8644C23.1737 21.7675 23.3332 20.0846 23.3332 18.3333C23.3332 15.5989 22.923 13.0403 22.2134 10.8333H7.7863ZM14.9998 13.3333C17.3013 13.3333 19.1665 15.1985 19.1665 17.5C19.1665 19.8014 17.3013 21.6666 14.9998 21.6666C12.6984 21.6666 10.8332 19.8014 10.8332 17.5C10.8332 15.1985 12.6984 13.3333 14.9998 13.3333ZM14.1665 15V16.6666H12.4998V18.3333H14.1665V20H15.8332V18.3333H17.4998V16.6666H15.8332V15H14.1665Z",fill:"#BFC5CC"}))},Ge=({type:e,item:a,imageUrl:i,className:o,onClickItem:l})=>{const n=t.useMemo((()=>{const t=ze[e]||$;return x.default.createElement(t,{width:32,height:"services"===e?32:24})}),[e]);return x.default.createElement(Fe,{onClick:()=>l&&l(a),onKeyDown:e=>{"Enter"!==e.key&&"Space"!==e.key||l&&l(a)},tabIndex:0,role:"button",className:o},x.default.createElement(Ke,null,"hospitals"===e?x.default.createElement(Ve,{width:"12",height:"16",viewBox:"0 0 12 16"},x.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.75 5.94873C0.75 3.04623 3.0975 0.69873 6 0.69873C8.9025 0.69873 11.25 3.04623 11.25 5.94873C11.25 9.07623 7.935 13.3887 6.5775 15.0312C6.2775 15.3912 5.73 15.3912 5.43 15.0312C4.065 13.3887 0.75 9.07623 0.75 5.94873ZM4.125 5.94873C4.125 6.98373 4.965 7.82373 6 7.82373C7.035 7.82373 7.875 6.98373 7.875 5.94873C7.875 4.91373 7.035 4.07373 6 4.07373C4.965 4.07373 4.125 4.91373 4.125 5.94873Z",fill:"#9AA2AC"})):x.default.createElement(De,{type:e},i?x.default.createElement("img",{src:i,width:32,height:"services"===e?32:24,loading:"lazy"}):n)),x.default.createElement(Be,{color:r.theme.colors.gray800,size:"p3"},a.name))},Ze=({type:e,data:i,state:l,dispatch:n,itemsToShow:c,itemsToShowDesktop:d,isMobile:u,isLoading:p,keyword:h,isNavResultItem:g})=>{const[f,m]=t.useState(!1),{t:C,locale:b}=a.useTranslations(),{selectedLocation:y,searchKeywords:v}=l,E=t.useMemo((()=>o.LOCALIZED_SLUGS[b]),[b]),S="ms-MY"===b,L=t.useMemo((()=>({doctors:{name:C("booking.searchPopup.doctors"),icon:x.default.createElement(ke,null),slug:E.DOCTOR},services:{name:C("booking.searchPopup.services"),icon:x.default.createElement(Ie,null),slug:E.SERVICE},hospitals:{name:C("booking.searchPopup.hospitals"),icon:x.default.createElement(Te,null),slug:E.HOSPITAL},specialties:{name:C("booking.searchPopup.specialties"),icon:x.default.createElement(je,null),slug:E.SPECIALTIES}})),[e,E]),O=t.useMemo((()=>L[e].slug),[L]),k=u?c:d;function I(t){let a="";switch(e){case"specialties":a=`/${y.slug}/${L.doctors.slug}/${t.slug}`;break;case"services":a=`/${y.slug}/${O}/${t.slug}`;break;case"doctors":case"hospitals":a=`/${O}/${t.slug}-${t.id}`}a&&n({type:ge.SelectSearchResult,payload:{name:t.name,url:a}})}function T(t){return x.default.createElement(Ge,{key:t.id,item:t,type:e,imageUrl:t.logo||t.avatar||t.thumbnail,className:g?"":"not-nav",onClickItem:g&&I})}return x.default.createElement("section",null,x.default.createElement(Me,null,x.default.createElement(Re,null,L[e].icon,x.default.createElement(Ne,null,L[e].name)),(h.trim().length<=pe[b]||S)&&x.default.createElement(Ae,{onClick:function(){let t="";switch(e){case"specialties":t=`/${O}`;break;case"services":case"doctors":case"hospitals":t=`/${y.slug}/${O}`}t&&n({type:ge.NavigateTo,payload:t})}},x.default.createElement(s.Text,{size:"p3",color:r.theme.colors.primaryBase},C("booking.searchPopup.seeAll")))),(p||i&&i.length>0)&&x.default.createElement(Pe,null,x.default.createElement(_e,null,p&&Array(2).fill(void 0).map(((t,a)=>x.default.createElement(Fe,{key:e+"loading"+a},x.default.createElement(Ke,null,x.default.createElement(He,null,x.default.createElement(w.default,{height:14,width:"hospitals"===e?12:32,style:{maxWidth:"var(--graphicSize)",minHeight:"var(--graphicSize)"}}))),x.default.createElement(w.default,{width:120,height:24})))),!p&&i&&i.length>0&&i.slice(0,k).map(T)),x.default.createElement(_e,{isShown:f,isMore:!0},i.slice(k,-1).map(T)),"specialties"===e&&k<i.length&&!p&&x.default.createElement("button",{onClick:()=>m(!f)},x.default.createElement($e,{size:"p3",color:r.theme.colors.primaryBase},C(f?"booking.searchPopup.seeLessSpecialties":"booking.searchPopup.seeMoreSpecialties"))),"specialties"!==e&&(k<i.length||S)&&!p&&h.trim().length>pe[b]&&x.default.createElement("button",{onClick:function(){const{slug:t}=L[e],a=`/${y.slug}/${t}?q=${v}`;n({type:ge.NavigateTo,payload:a})}},x.default.createElement($e,{size:"p3",color:r.theme.colors.primaryBase},C(`booking.searchPopup.searchIn.${e}`,{name:h})))),!p&&0===(null==i?void 0:i.length)&&x.default.createElement(Pe,null,x.default.createElement(s.Text,{size:"sm",color:r.theme.colors.gray400},C("booking.searchBar.noResults"))))},Ue=S.default.section`
|
|
328
328
|
background-color: white;
|
|
329
329
|
border-radius: 4px;
|
|
330
330
|
position: absolute;
|
|
@@ -563,7 +563,7 @@
|
|
|
563
563
|
&[data-is-denied='true'] {
|
|
564
564
|
cursor: not-allowed;
|
|
565
565
|
}
|
|
566
|
-
`,ft=()=>x.default.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},x.default.createElement("path",{d:"M8.98307 14.3333C7.87196 14.3333 6.92752 13.9445 6.14974 13.1667C5.37196 12.3889 4.98307 11.4445 4.98307 10.3333V9.96668C4.08307 9.85557 3.33041 9.45557 2.72507 8.76668C2.1193 8.07779 1.81641 7.26668 1.81641 6.33334V3.10001C1.81641 2.93334 1.87463 2.79157 1.99107 2.67468C2.10796 2.55823 2.24974 2.50001 2.41641 2.50001H3.81641V2.33334C3.81641 2.1889 3.86374 2.06934 3.95841 1.97468C4.05263 1.88045 4.17196 1.83334 4.31641 1.83334C4.46085 1.83334 4.58041 1.88045 4.67507 1.97468C4.7693 2.06934 4.81641 2.1889 4.81641 2.33334V3.66668C4.81641 3.81112 4.7693 3.93045 4.67507 4.02468C4.58041 4.11934 4.46085 4.16668 4.31641 4.16668C4.17196 4.16668 4.05263 4.11934 3.95841 4.02468C3.86374 3.93045 3.81641 3.81112 3.81641 3.66668V3.50001H2.81641V6.33334C2.81641 7.06668 3.07752 7.69445 3.59974 8.21668C4.12196 8.7389 4.74974 9.00001 5.48307 9.00001C6.21641 9.00001 6.84418 8.7389 7.36641 8.21668C7.88863 7.69445 8.14974 7.06668 8.14974 6.33334V3.50001H7.14974V3.66668C7.14974 3.81112 7.10263 3.93045 7.00841 4.02468C6.91374 4.11934 6.79418 4.16668 6.64974 4.16668C6.5053 4.16668 6.38596 4.11934 6.29174 4.02468C6.19707 3.93045 6.14974 3.81112 6.14974 3.66668V2.33334C6.14974 2.1889 6.19707 2.06934 6.29174 1.97468C6.38596 1.88045 6.5053 1.83334 6.64974 1.83334C6.79418 1.83334 6.91374 1.88045 7.00841 1.97468C7.10263 2.06934 7.14974 2.1889 7.14974 2.33334V2.50001H8.54974C8.71641 2.50001 8.85818 2.55823 8.97507 2.67468C9.09152 2.79157 9.14974 2.93334 9.14974 3.10001V6.33334C9.14974 7.26668 8.84707 8.07779 8.24174 8.76668C7.63596 9.45557 6.88307 9.85557 5.98307 9.96668V10.3333C5.98307 11.1667 6.27485 11.8751 6.85841 12.4587C7.44152 13.0418 8.14974 13.3333 8.98307 13.3333C9.81641 13.3333 10.5249 13.0418 11.1084 12.4587C11.6915 11.8751 11.9831 11.1667 11.9831 10.3333V9.25001C11.6386 9.1389 11.3526 8.93601 11.1251 8.64134C10.8971 8.34712 10.7831 8.01112 10.7831 7.63334C10.7831 7.15557 10.9497 6.75001 11.2831 6.41668C11.6164 6.08334 12.0164 5.91668 12.4831 5.91668C12.9609 5.91668 13.3664 6.08334 13.6997 6.41668C14.0331 6.75001 14.1997 7.15557 14.1997 7.63334C14.1997 8.01112 14.086 8.34712 13.8584 8.64134C13.6304 8.93601 13.3386 9.1389 12.9831 9.25001V10.3333C12.9831 11.4445 12.5942 12.3889 11.8164 13.1667C11.0386 13.9445 10.0942 14.3333 8.98307 14.3333ZM12.4831 8.33334C12.6831 8.33334 12.8526 8.26401 12.9917 8.12534C13.1304 7.98623 13.1997 7.82223 13.1997 7.63334C13.1997 7.43334 13.1304 7.26401 12.9917 7.12534C12.8526 6.98623 12.6831 6.91668 12.4831 6.91668C12.2831 6.91668 12.1164 6.98623 11.9831 7.12534C11.8497 7.26401 11.7831 7.43334 11.7831 7.63334C11.7831 7.82223 11.8497 7.98623 11.9831 8.12534C12.1164 8.26401 12.2831 8.33334 12.4831 8.33334Z",fill:"#595959"})),mt=()=>x.default.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},x.default.createElement("path",{d:"M6.86836 9.26489V10.2386C6.86836 10.509 6.96294 10.7389 7.15209 10.9283C7.34124 11.1176 7.57093 11.2122 7.84114 11.2122C8.11135 11.2122 8.34133 11.1176 8.53106 10.9283C8.7208 10.7389 8.81567 10.509 8.81567 10.2386V9.26489H9.78936C10.0598 9.26489 10.2897 9.17031 10.479 8.98116C10.6684 8.79201 10.763 8.56233 10.763 8.29211C10.763 8.0219 10.6684 7.79192 10.479 7.60219C10.2897 7.41245 10.0598 7.31758 9.78936 7.31758H8.81567V6.34389C8.81567 6.07343 8.72109 5.84354 8.53194 5.65422C8.34279 5.4649 8.11311 5.37024 7.84289 5.37024C7.57268 5.37024 7.3427 5.4649 7.15297 5.65422C6.96323 5.84354 6.86836 6.07343 6.86836 6.34389V7.31758H5.89467C5.62421 7.31758 5.39432 7.41216 5.205 7.60131C5.01568 7.79046 4.92102 8.02014 4.92102 8.29036C4.92102 8.56057 5.01568 8.79055 5.205 8.98028C5.39432 9.17002 5.62421 9.26489 5.89467 9.26489H6.86836ZM3.40809 14.1333C3.02086 14.1333 2.68938 13.9954 2.41364 13.7196C2.13788 13.4439 2 13.1124 2 12.7252V6.07426C2 5.85132 2.04987 5.64011 2.14961 5.44063C2.24936 5.24116 2.38723 5.07689 2.56323 4.94782L6.99718 1.61486C7.24323 1.42712 7.52444 1.33325 7.84081 1.33325C8.15718 1.33325 8.43919 1.42712 8.68685 1.61486L13.1208 4.94782C13.2968 5.07689 13.4347 5.24116 13.5344 5.44063C13.6342 5.64011 13.684 5.85132 13.684 6.07426V12.7252C13.684 13.1124 13.5462 13.4439 13.2704 13.7196C12.9947 13.9954 12.6632 14.1333 12.2759 14.1333H3.40809ZM3.40809 12.9649H12.2759C12.3459 12.9649 12.4033 12.9424 12.4482 12.8974C12.4932 12.8525 12.5156 12.7951 12.5156 12.7252V6.07426C12.5156 6.03431 12.5069 5.99811 12.4894 5.96566C12.4719 5.9332 12.4482 5.90449 12.4183 5.87953L7.98433 2.55406C7.94438 2.51911 7.89694 2.50164 7.84202 2.50164C7.78709 2.50164 7.73965 2.51911 7.69971 2.55406L3.26576 5.87953C3.2358 5.90449 3.21209 5.9332 3.1946 5.96566C3.17712 5.99811 3.16839 6.03431 3.16839 6.07426V12.7252C3.16839 12.7951 3.19086 12.8525 3.2358 12.8974C3.28075 12.9424 3.33818 12.9649 3.40809 12.9649Z",fill:"#595959"})),Ct=()=>x.default.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},x.default.createElement("path",{d:"M7.99984 8.00004C8.3665 8.00004 8.68039 7.86949 8.9415 7.60837C9.20261 7.34726 9.33317 7.03337 9.33317 6.66671C9.33317 6.30004 9.20261 5.98615 8.9415 5.72504C8.68039 5.46393 8.3665 5.33337 7.99984 5.33337C7.63317 5.33337 7.31928 5.46393 7.05817 5.72504C6.79706 5.98615 6.6665 6.30004 6.6665 6.66671C6.6665 7.03337 6.79706 7.34726 7.05817 7.60837C7.31928 7.86949 7.63317 8.00004 7.99984 8.00004ZM7.99984 12.9C9.35539 11.6556 10.3609 10.525 11.0165 9.50837C11.6721 8.49171 11.9998 7.58893 11.9998 6.80004C11.9998 5.58893 11.6137 4.59726 10.8415 3.82504C10.0693 3.05282 9.12206 2.66671 7.99984 2.66671C6.87761 2.66671 5.93039 3.05282 5.15817 3.82504C4.38595 4.59726 3.99984 5.58893 3.99984 6.80004C3.99984 7.58893 4.32761 8.49171 4.98317 9.50837C5.63873 10.525 6.64428 11.6556 7.99984 12.9ZM7.99984 14.4167C7.91095 14.4167 7.82206 14.4 7.73317 14.3667C7.64428 14.3334 7.5665 14.2889 7.49984 14.2334C5.87761 12.8 4.6665 11.4695 3.8665 10.2417C3.0665 9.01393 2.6665 7.86671 2.6665 6.80004C2.6665 5.13337 3.20261 3.8056 4.27484 2.81671C5.34706 1.82782 6.58873 1.33337 7.99984 1.33337C9.41095 1.33337 10.6526 1.82782 11.7248 2.81671C12.7971 3.8056 13.3332 5.13337 13.3332 6.80004C13.3332 7.86671 12.9332 9.01393 12.1332 10.2417C11.3332 11.4695 10.1221 12.8 8.49984 14.2334C8.43317 14.2889 8.35539 14.3334 8.2665 14.3667C8.17761 14.4 8.08873 14.4167 7.99984 14.4167Z",fill:"#8C8C8C"})),bt=()=>x.default.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16"},x.default.createElement("path",{d:"M3.83333 0.5C2.94928 0.5 2.10143 0.851189 1.47631 1.47631C0.851189 2.10143 0.5 2.94928 0.5 3.83333C0.5 4.71739 0.851189 5.56523 1.47631 6.19036C2.10143 6.81548 2.94928 7.16667 3.83333 7.16667C4.71739 7.16667 5.56523 6.81548 6.19036 6.19036C6.81548 5.56523 7.16667 4.71739 7.16667 3.83333C7.16667 2.94928 6.81548 2.10143 6.19036 1.47631C5.56523 0.851189 4.71739 0.5 3.83333 0.5V0.5ZM10.5 0.5C9.57917 0.5 8.83333 1.24583 8.83333 2.16667V5.5C8.83333 6.42083 9.57917 7.16667 10.5 7.16667H13.8333C14.7542 7.16667 15.5 6.42083 15.5 5.5V2.16667C15.5 1.24583 14.7542 0.5 13.8333 0.5H10.5ZM3.83333 8.83333C2.94928 8.83333 2.10143 9.18452 1.47631 9.80964C0.851189 10.4348 0.5 11.2826 0.5 12.1667C0.5 13.0507 0.851189 13.8986 1.47631 14.5237C2.10143 15.1488 2.94928 15.5 3.83333 15.5C4.71739 15.5 5.56523 15.1488 6.19036 14.5237C6.81548 13.8986 7.16667 13.0507 7.16667 12.1667C7.16667 11.2826 6.81548 10.4348 6.19036 9.80964C5.56523 9.18452 4.71739 8.83333 3.83333 8.83333V8.83333ZM12.1667 8.83333C11.2826 8.83333 10.4348 9.18452 9.80964 9.80964C9.18452 10.4348 8.83333 11.2826 8.83333 12.1667C8.83333 13.0507 9.18452 13.8986 9.80964 14.5237C10.4348 15.1488 11.2826 15.5 12.1667 15.5C13.0507 15.5 13.8986 15.1488 14.5237 14.5237C15.1488 13.8986 15.5 13.0507 15.5 12.1667C15.5 11.2826 15.1488 10.4348 14.5237 9.80964C13.8986 9.18452 13.0507 8.83333 12.1667 8.83333V8.83333Z",fill:"#9AA2AC"})),yt=({state:e,isMobile:i,debouncedFetchSearchResults:l,selectedLocation:n,onSpecialtyClick:r,dispatch:c})=>{var u;const{t:p,locale:h}=a.useTranslations(),g=t.useRef(null),m=t.useMemo((()=>o.LOCALIZED_SLUGS[h]),[h]),C=t.useMemo((()=>({wrapper:{"&:after":{content:'""',width:"1px",height:"20px",backgroundColor:"#E4E8EC",position:"absolute",right:0,top:"13px"}},input:{border:i?"border: 1px solid #d9d9d9":"none",height:i?"40px":"46px !important",paddingRight:"30px","&:focus":{boxShadow:i?"box-shadow: 0px 0px 0px 2px #91caff":"none"}},rightSection:{width:"30px",svg:{fontSize:"20px"}}})),[i]),y=t.useCallback((function(e){console.log(e)}),[l,c]);return d.useOutsideClick(g,(()=>{c({type:at.ClickOutsideInputSpecialty})})),x.default.createElement(pt,{ref:g},x.default.createElement(f.Input.Wrapper,null,x.default.createElement(f.Input,{size:i?"md":"lg",placeholder:p("booking.searchPopup.specialties"),value:(null===(u=null==e?void 0:e.selectedSpecialty)||void 0===u?void 0:u.name)||"",rightSection:x.default.createElement(b.ChevronDown,null),styles:C,onFocus:()=>c({type:at.FocusInputSpecialty}),onChange:e=>{y(e.target.value)}})),"specialty"===e.focused&&x.default.createElement(ht,null,x.default.createElement(gt,{key:"all-location",role:"button",tabIndex:0,onClick:()=>{r&&r({name:p("booking.searchBar.allSpecialties"),id:-1,thumbnail:"",total_doctor:0,slug:m.SPECIALTIES})}},x.default.createElement("div",{className:"image-item"},x.default.createElement(bt,null)),x.default.createElement(s.Text,{size:"md"},p("booking.searchBar.allSpecialties"))),e.allSpecialties.map((e=>x.default.createElement(gt,{key:e.id,onClick:t=>{t.nativeEvent.stopImmediatePropagation(),r&&r(Object.assign(Object.assign({},e),{total_doctor:0}))},role:"button",tabIndex:0,"aria-label":`Select ${e.name} as location`,isSelected:(null==n?void 0:n.id)===e.id},x.default.createElement("div",{className:"image-item"},x.default.createElement("img",{src:e.thumbnail,alt:e.name})),x.default.createElement(s.Text,{size:"md"},e.name))))))},vt=({state:e,type:i,isMobile:o,isLoading:l,initalSearchValue:n,typeInformation:r,debouncedFetchSearchResults:c,trackingAttributes:u,hideSpecialtySelection:p=!1,clientSlug:h="",focusSearchInput:g,onSearch:m,dispatch:C})=>{var b;const{t:y}=a.useTranslations(),v=t.useRef(null),E=t.useMemo((()=>u?{"data-event-category":u.dataEventCategory,"data-event-action":u.dataEventAction,"data-event-label":u.dataEventLabel}:{}),[u]),S=t.useMemo((()=>"doctor"===i?y("booking.searchBar.placeholder.doctor"):"service"===i?y("booking.searchBar.placeholder.service"):"hospital"===i?y("booking.searchBar.placeholder.hospital"):"specialty"===i?y("booking.searchBar.placeholder.specialty"):""),[i]),L=t.useMemo((()=>({root:{flex:1,"&.hide-specialty-selection":{".mantine-Input-rightSection":{display:"none"},input:{paddingLeft:"48px"},".mantine-Input-icon":{left:"0"}}}})),[]),w=t.useMemo((()=>({icon:{left:"165px"},input:{color:"#262626",'&[data-with-icon="true"]':{paddingLeft:"205px",paddingRight:"16px"}},rightSection:{left:0,width:"165px",padding:"1px"}})),[]),O=t.useMemo((()=>({input:{color:"#262626"}})),[]);d.useOutsideClick(v,(()=>{C({type:at.ClickOutsideInputSearch})}));const k=t.useCallback((function(t){C({type:at.ChangeInputSearch,payload:t}),"function"!=typeof m&&(t.trim().length>et[e.locale]||n||0===t.trim().length?c(t.trim(),e,i,h):(c.cancel(),C({type:at.DisplayInitialSearchResults})))}),[C,e,i]),I=t.useCallback((function(e){C({type:at.SelectSpecialty,payload:e}),g()}),[C]);return x.default.createElement(lt,{ref:v},"specialty"===i?x.default.createElement(f.Input.Wrapper,{styles:L},x.default.createElement(f.Input,{icon:x.default.createElement(s.Icon.Search,null),size:o?"md":"lg",placeholder:S,styles:O,value:e.searchKeywords,onFocus:()=>C({type:at.FocusInputSearchSpecialty}),onChange:e=>{k(e.target.value)}})):x.default.createElement(x.default.Fragment,null,"service"===i?x.default.createElement(f.Input.Wrapper,{styles:L},x.default.createElement(f.Input,{icon:x.default.createElement(s.Icon.Search,null),size:o?"md":"lg",name:"search-results",placeholder:S,onFocus:()=>C({type:at.FocusInputSearch}),value:e.searchKeywords,onChange:e=>{k(e.target.value)}})):x.default.createElement(x.default.Fragment,null,o&&!p?x.default.createElement(x.default.Fragment,null,x.default.createElement(yt,{state:e,isMobile:o,dispatch:C,debouncedFetchSearchResults:c,onSpecialtyClick:I}),x.default.createElement(f.Input.Wrapper,{styles:L},x.default.createElement(f.Input,{icon:x.default.createElement(s.Icon.Search,null),size:"md",placeholder:S,value:e.searchKeywords,name:"search-results",onFocus:()=>C({type:at.FocusInputSearch}),onChange:e=>{k(e.target.value)}}))):x.default.createElement(f.Input.Wrapper,{styles:L,className:p?"hide-specialty-selection":""},x.default.createElement(f.Input,Object.assign({icon:x.default.createElement(s.Icon.Search,null),size:"lg",placeholder:S,styles:w,name:"search-results",autoComplete:"off",value:e.searchKeywords,onChange:e=>{k(e.target.value)},onFocus:()=>C({type:at.FocusInputSearch})},E,{rightSection:p?x.default.createElement(x.default.Fragment,null):x.default.createElement(yt,{state:e,isMobile:o,dispatch:C,debouncedFetchSearchResults:c,onSpecialtyClick:I})})))),"search"===e.focused&&x.default.createElement(nt,null,x.default.createElement(ut,{type:i,state:e,results:(null===(b=e.searchResults)||void 0===b?void 0:b[i])||[],location:e.selectedLocation.name,dispatch:C,isLoading:l,typeInformation:r,clientSlug:h}))))},xt=S.default.div`
|
|
566
|
+
`,ft=()=>x.default.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},x.default.createElement("path",{d:"M8.98307 14.3333C7.87196 14.3333 6.92752 13.9445 6.14974 13.1667C5.37196 12.3889 4.98307 11.4445 4.98307 10.3333V9.96668C4.08307 9.85557 3.33041 9.45557 2.72507 8.76668C2.1193 8.07779 1.81641 7.26668 1.81641 6.33334V3.10001C1.81641 2.93334 1.87463 2.79157 1.99107 2.67468C2.10796 2.55823 2.24974 2.50001 2.41641 2.50001H3.81641V2.33334C3.81641 2.1889 3.86374 2.06934 3.95841 1.97468C4.05263 1.88045 4.17196 1.83334 4.31641 1.83334C4.46085 1.83334 4.58041 1.88045 4.67507 1.97468C4.7693 2.06934 4.81641 2.1889 4.81641 2.33334V3.66668C4.81641 3.81112 4.7693 3.93045 4.67507 4.02468C4.58041 4.11934 4.46085 4.16668 4.31641 4.16668C4.17196 4.16668 4.05263 4.11934 3.95841 4.02468C3.86374 3.93045 3.81641 3.81112 3.81641 3.66668V3.50001H2.81641V6.33334C2.81641 7.06668 3.07752 7.69445 3.59974 8.21668C4.12196 8.7389 4.74974 9.00001 5.48307 9.00001C6.21641 9.00001 6.84418 8.7389 7.36641 8.21668C7.88863 7.69445 8.14974 7.06668 8.14974 6.33334V3.50001H7.14974V3.66668C7.14974 3.81112 7.10263 3.93045 7.00841 4.02468C6.91374 4.11934 6.79418 4.16668 6.64974 4.16668C6.5053 4.16668 6.38596 4.11934 6.29174 4.02468C6.19707 3.93045 6.14974 3.81112 6.14974 3.66668V2.33334C6.14974 2.1889 6.19707 2.06934 6.29174 1.97468C6.38596 1.88045 6.5053 1.83334 6.64974 1.83334C6.79418 1.83334 6.91374 1.88045 7.00841 1.97468C7.10263 2.06934 7.14974 2.1889 7.14974 2.33334V2.50001H8.54974C8.71641 2.50001 8.85818 2.55823 8.97507 2.67468C9.09152 2.79157 9.14974 2.93334 9.14974 3.10001V6.33334C9.14974 7.26668 8.84707 8.07779 8.24174 8.76668C7.63596 9.45557 6.88307 9.85557 5.98307 9.96668V10.3333C5.98307 11.1667 6.27485 11.8751 6.85841 12.4587C7.44152 13.0418 8.14974 13.3333 8.98307 13.3333C9.81641 13.3333 10.5249 13.0418 11.1084 12.4587C11.6915 11.8751 11.9831 11.1667 11.9831 10.3333V9.25001C11.6386 9.1389 11.3526 8.93601 11.1251 8.64134C10.8971 8.34712 10.7831 8.01112 10.7831 7.63334C10.7831 7.15557 10.9497 6.75001 11.2831 6.41668C11.6164 6.08334 12.0164 5.91668 12.4831 5.91668C12.9609 5.91668 13.3664 6.08334 13.6997 6.41668C14.0331 6.75001 14.1997 7.15557 14.1997 7.63334C14.1997 8.01112 14.086 8.34712 13.8584 8.64134C13.6304 8.93601 13.3386 9.1389 12.9831 9.25001V10.3333C12.9831 11.4445 12.5942 12.3889 11.8164 13.1667C11.0386 13.9445 10.0942 14.3333 8.98307 14.3333ZM12.4831 8.33334C12.6831 8.33334 12.8526 8.26401 12.9917 8.12534C13.1304 7.98623 13.1997 7.82223 13.1997 7.63334C13.1997 7.43334 13.1304 7.26401 12.9917 7.12534C12.8526 6.98623 12.6831 6.91668 12.4831 6.91668C12.2831 6.91668 12.1164 6.98623 11.9831 7.12534C11.8497 7.26401 11.7831 7.43334 11.7831 7.63334C11.7831 7.82223 11.8497 7.98623 11.9831 8.12534C12.1164 8.26401 12.2831 8.33334 12.4831 8.33334Z",fill:"#595959"})),mt=()=>x.default.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},x.default.createElement("path",{d:"M6.86836 9.26489V10.2386C6.86836 10.509 6.96294 10.7389 7.15209 10.9283C7.34124 11.1176 7.57093 11.2122 7.84114 11.2122C8.11135 11.2122 8.34133 11.1176 8.53106 10.9283C8.7208 10.7389 8.81567 10.509 8.81567 10.2386V9.26489H9.78936C10.0598 9.26489 10.2897 9.17031 10.479 8.98116C10.6684 8.79201 10.763 8.56233 10.763 8.29211C10.763 8.0219 10.6684 7.79192 10.479 7.60219C10.2897 7.41245 10.0598 7.31758 9.78936 7.31758H8.81567V6.34389C8.81567 6.07343 8.72109 5.84354 8.53194 5.65422C8.34279 5.4649 8.11311 5.37024 7.84289 5.37024C7.57268 5.37024 7.3427 5.4649 7.15297 5.65422C6.96323 5.84354 6.86836 6.07343 6.86836 6.34389V7.31758H5.89467C5.62421 7.31758 5.39432 7.41216 5.205 7.60131C5.01568 7.79046 4.92102 8.02014 4.92102 8.29036C4.92102 8.56057 5.01568 8.79055 5.205 8.98028C5.39432 9.17002 5.62421 9.26489 5.89467 9.26489H6.86836ZM3.40809 14.1333C3.02086 14.1333 2.68938 13.9954 2.41364 13.7196C2.13788 13.4439 2 13.1124 2 12.7252V6.07426C2 5.85132 2.04987 5.64011 2.14961 5.44063C2.24936 5.24116 2.38723 5.07689 2.56323 4.94782L6.99718 1.61486C7.24323 1.42712 7.52444 1.33325 7.84081 1.33325C8.15718 1.33325 8.43919 1.42712 8.68685 1.61486L13.1208 4.94782C13.2968 5.07689 13.4347 5.24116 13.5344 5.44063C13.6342 5.64011 13.684 5.85132 13.684 6.07426V12.7252C13.684 13.1124 13.5462 13.4439 13.2704 13.7196C12.9947 13.9954 12.6632 14.1333 12.2759 14.1333H3.40809ZM3.40809 12.9649H12.2759C12.3459 12.9649 12.4033 12.9424 12.4482 12.8974C12.4932 12.8525 12.5156 12.7951 12.5156 12.7252V6.07426C12.5156 6.03431 12.5069 5.99811 12.4894 5.96566C12.4719 5.9332 12.4482 5.90449 12.4183 5.87953L7.98433 2.55406C7.94438 2.51911 7.89694 2.50164 7.84202 2.50164C7.78709 2.50164 7.73965 2.51911 7.69971 2.55406L3.26576 5.87953C3.2358 5.90449 3.21209 5.9332 3.1946 5.96566C3.17712 5.99811 3.16839 6.03431 3.16839 6.07426V12.7252C3.16839 12.7951 3.19086 12.8525 3.2358 12.8974C3.28075 12.9424 3.33818 12.9649 3.40809 12.9649Z",fill:"#595959"})),Ct=()=>x.default.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},x.default.createElement("path",{d:"M7.99984 8.00004C8.3665 8.00004 8.68039 7.86949 8.9415 7.60837C9.20261 7.34726 9.33317 7.03337 9.33317 6.66671C9.33317 6.30004 9.20261 5.98615 8.9415 5.72504C8.68039 5.46393 8.3665 5.33337 7.99984 5.33337C7.63317 5.33337 7.31928 5.46393 7.05817 5.72504C6.79706 5.98615 6.6665 6.30004 6.6665 6.66671C6.6665 7.03337 6.79706 7.34726 7.05817 7.60837C7.31928 7.86949 7.63317 8.00004 7.99984 8.00004ZM7.99984 12.9C9.35539 11.6556 10.3609 10.525 11.0165 9.50837C11.6721 8.49171 11.9998 7.58893 11.9998 6.80004C11.9998 5.58893 11.6137 4.59726 10.8415 3.82504C10.0693 3.05282 9.12206 2.66671 7.99984 2.66671C6.87761 2.66671 5.93039 3.05282 5.15817 3.82504C4.38595 4.59726 3.99984 5.58893 3.99984 6.80004C3.99984 7.58893 4.32761 8.49171 4.98317 9.50837C5.63873 10.525 6.64428 11.6556 7.99984 12.9ZM7.99984 14.4167C7.91095 14.4167 7.82206 14.4 7.73317 14.3667C7.64428 14.3334 7.5665 14.2889 7.49984 14.2334C5.87761 12.8 4.6665 11.4695 3.8665 10.2417C3.0665 9.01393 2.6665 7.86671 2.6665 6.80004C2.6665 5.13337 3.20261 3.8056 4.27484 2.81671C5.34706 1.82782 6.58873 1.33337 7.99984 1.33337C9.41095 1.33337 10.6526 1.82782 11.7248 2.81671C12.7971 3.8056 13.3332 5.13337 13.3332 6.80004C13.3332 7.86671 12.9332 9.01393 12.1332 10.2417C11.3332 11.4695 10.1221 12.8 8.49984 14.2334C8.43317 14.2889 8.35539 14.3334 8.2665 14.3667C8.17761 14.4 8.08873 14.4167 7.99984 14.4167Z",fill:"#8C8C8C"})),bt=()=>x.default.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16"},x.default.createElement("path",{d:"M3.83333 0.5C2.94928 0.5 2.10143 0.851189 1.47631 1.47631C0.851189 2.10143 0.5 2.94928 0.5 3.83333C0.5 4.71739 0.851189 5.56523 1.47631 6.19036C2.10143 6.81548 2.94928 7.16667 3.83333 7.16667C4.71739 7.16667 5.56523 6.81548 6.19036 6.19036C6.81548 5.56523 7.16667 4.71739 7.16667 3.83333C7.16667 2.94928 6.81548 2.10143 6.19036 1.47631C5.56523 0.851189 4.71739 0.5 3.83333 0.5V0.5ZM10.5 0.5C9.57917 0.5 8.83333 1.24583 8.83333 2.16667V5.5C8.83333 6.42083 9.57917 7.16667 10.5 7.16667H13.8333C14.7542 7.16667 15.5 6.42083 15.5 5.5V2.16667C15.5 1.24583 14.7542 0.5 13.8333 0.5H10.5ZM3.83333 8.83333C2.94928 8.83333 2.10143 9.18452 1.47631 9.80964C0.851189 10.4348 0.5 11.2826 0.5 12.1667C0.5 13.0507 0.851189 13.8986 1.47631 14.5237C2.10143 15.1488 2.94928 15.5 3.83333 15.5C4.71739 15.5 5.56523 15.1488 6.19036 14.5237C6.81548 13.8986 7.16667 13.0507 7.16667 12.1667C7.16667 11.2826 6.81548 10.4348 6.19036 9.80964C5.56523 9.18452 4.71739 8.83333 3.83333 8.83333V8.83333ZM12.1667 8.83333C11.2826 8.83333 10.4348 9.18452 9.80964 9.80964C9.18452 10.4348 8.83333 11.2826 8.83333 12.1667C8.83333 13.0507 9.18452 13.8986 9.80964 14.5237C10.4348 15.1488 11.2826 15.5 12.1667 15.5C13.0507 15.5 13.8986 15.1488 14.5237 14.5237C15.1488 13.8986 15.5 13.0507 15.5 12.1667C15.5 11.2826 15.1488 10.4348 14.5237 9.80964C13.8986 9.18452 13.0507 8.83333 12.1667 8.83333V8.83333Z",fill:"#9AA2AC"})),yt=({state:e,isMobile:i,debouncedFetchSearchResults:l,selectedLocation:n,onSpecialtyClick:r,dispatch:c})=>{var u;const{t:p,locale:h}=a.useTranslations(),g=t.useRef(null),m=t.useMemo((()=>o.LOCALIZED_SLUGS[h]),[h]),C=t.useMemo((()=>({wrapper:{"&:after":{content:'""',width:"1px",height:"20px",backgroundColor:"#E4E8EC",position:"absolute",right:0,top:"13px"}},input:{border:i?"border: 1px solid #d9d9d9":"none",height:i?"40px":"46px !important",paddingRight:"30px","&:focus":{boxShadow:i?"box-shadow: 0px 0px 0px 2px #91caff":"none"}},rightSection:{width:"30px",svg:{fontSize:"20px"}}})),[i]),y=t.useCallback((function(e){console.log(e)}),[l,c]);return d.useOutsideClick(g,(()=>{c({type:at.ClickOutsideInputSpecialty})})),x.default.createElement(pt,{ref:g},x.default.createElement(f.Input.Wrapper,null,x.default.createElement(f.Input,{size:i?"md":"lg",placeholder:p("booking.searchPopup.specialties"),value:(null===(u=null==e?void 0:e.selectedSpecialty)||void 0===u?void 0:u.name)||"",rightSection:x.default.createElement(b.ChevronDown,null),styles:C,onFocus:()=>c({type:at.FocusInputSpecialty}),onChange:e=>{y(e.target.value)}})),"specialty"===e.focused&&x.default.createElement(ht,null,x.default.createElement(gt,{key:"all-location",role:"button",tabIndex:0,onClick:()=>{r&&r({name:p("booking.searchBar.allSpecialties"),id:-1,thumbnail:"",total_doctor:0,slug:m.SPECIALTIES})}},x.default.createElement("div",{className:"image-item"},x.default.createElement(bt,null)),x.default.createElement(s.Text,{size:"md"},p("booking.searchBar.allSpecialties"))),e.allSpecialties.map((e=>x.default.createElement(gt,{key:e.id,onClick:t=>{t.nativeEvent.stopImmediatePropagation(),r&&r(Object.assign(Object.assign({},e),{total_doctor:0}))},role:"button",tabIndex:0,"aria-label":`Select ${e.name} as location`,isSelected:(null==n?void 0:n.id)===e.id},x.default.createElement("div",{className:"image-item"},x.default.createElement("img",{src:e.thumbnail,alt:e.name})),x.default.createElement(s.Text,{size:"md"},e.name))))))},vt=({state:e,type:i,isMobile:o,isLoading:l,initalSearchValue:n,typeInformation:r,debouncedFetchSearchResults:c,trackingAttributes:u,hideSpecialtySelection:p=!1,clientSlug:h="",focusSearchInput:g,onSearch:m,onEnterSearch:C,dispatch:b})=>{var y;const{t:v}=a.useTranslations(),E=t.useRef(null),S=t.useMemo((()=>u?{"data-event-category":u.dataEventCategory,"data-event-action":u.dataEventAction,"data-event-label":u.dataEventLabel}:{}),[u]),L=t.useMemo((()=>"doctor"===i?v("booking.searchBar.placeholder.doctor"):"service"===i?v("booking.searchBar.placeholder.service"):"hospital"===i?v("booking.searchBar.placeholder.hospital"):"specialty"===i?v("booking.searchBar.placeholder.specialty"):""),[i]),w=t.useMemo((()=>({root:{flex:1,"&.hide-specialty-selection":{".mantine-Input-rightSection":{display:"none"},input:{paddingLeft:"48px"},".mantine-Input-icon":{left:"0"}}}})),[]),O=t.useMemo((()=>({icon:{left:"165px"},input:{color:"#262626",'&[data-with-icon="true"]':{paddingLeft:"205px",paddingRight:"16px"}},rightSection:{left:0,width:"165px",padding:"1px"}})),[]),k=t.useMemo((()=>({input:{color:"#262626"}})),[]);d.useOutsideClick(E,(()=>{b({type:at.ClickOutsideInputSearch})}));const I=t.useCallback((function(t){b({type:at.ChangeInputSearch,payload:t}),"function"!=typeof m&&(t.trim().length>et[e.locale]||n||0===t.trim().length?c(t.trim(),e,i,h):(c.cancel(),b({type:at.DisplayInitialSearchResults})))}),[b,e,i]),T=t.useCallback((function(e){b({type:at.SelectSpecialty,payload:e}),g()}),[b]),j=t.useCallback((e=>{13===e.keyCode&&(e.stopPropagation(),e.preventDefault(),C&&C())}),[C]);return x.default.createElement(lt,{ref:E},"specialty"===i?x.default.createElement(f.Input.Wrapper,{styles:w},x.default.createElement(f.Input,{icon:x.default.createElement(s.Icon.Search,null),size:o?"md":"lg",placeholder:L,styles:k,value:e.searchKeywords,onFocus:()=>b({type:at.FocusInputSearchSpecialty}),onChange:e=>{I(e.target.value)},onKeyDown:j})):x.default.createElement(x.default.Fragment,null,"service"===i?x.default.createElement(f.Input.Wrapper,{styles:w},x.default.createElement(f.Input,{icon:x.default.createElement(s.Icon.Search,null),size:o?"md":"lg",name:"search-results",placeholder:L,onFocus:()=>b({type:at.FocusInputSearch}),value:e.searchKeywords,onChange:e=>{I(e.target.value)},onKeyDown:j})):x.default.createElement(x.default.Fragment,null,o&&!p?x.default.createElement(x.default.Fragment,null,x.default.createElement(yt,{state:e,isMobile:o,dispatch:b,debouncedFetchSearchResults:c,onSpecialtyClick:T}),x.default.createElement(f.Input.Wrapper,{styles:w},x.default.createElement(f.Input,{icon:x.default.createElement(s.Icon.Search,null),size:"md",placeholder:L,value:e.searchKeywords,name:"search-results",onFocus:()=>b({type:at.FocusInputSearch}),onChange:e=>{I(e.target.value)},onKeyDown:j}))):x.default.createElement(f.Input.Wrapper,{styles:w,className:p?"hide-specialty-selection":""},x.default.createElement(f.Input,Object.assign({icon:x.default.createElement(s.Icon.Search,null),size:"lg",placeholder:L,styles:O,name:"search-results",autoComplete:"off",value:e.searchKeywords,onChange:e=>{I(e.target.value)},onFocus:()=>b({type:at.FocusInputSearch}),onKeyDown:j},S,{rightSection:p?x.default.createElement(x.default.Fragment,null):x.default.createElement(yt,{state:e,isMobile:o,dispatch:b,debouncedFetchSearchResults:c,onSpecialtyClick:T})})))),"search"===e.focused&&x.default.createElement(nt,null,x.default.createElement(ut,{type:i,state:e,results:(null===(y=e.searchResults)||void 0===y?void 0:y[i])||[],location:e.selectedLocation.name,dispatch:b,isLoading:l,typeInformation:r,clientSlug:h}))))},xt=S.default.div`
|
|
567
567
|
position: relative;
|
|
568
568
|
|
|
569
569
|
${u.MediaQueries.mbDown} {
|
|
@@ -782,4 +782,4 @@
|
|
|
782
782
|
display: flex;
|
|
783
783
|
align-items: center;
|
|
784
784
|
}
|
|
785
|
-
`;var Bt;!function(e){e[e.SPECIALTY=1]="SPECIALTY",e[e.DOCTOR=2]="DOCTOR",e[e.CLINIC=3]="CLINIC",e[e.SERVICE=4]="SERVICE"}(Bt||(Bt={}));var Vt=Object.freeze({__proto__:null,get RedirectType(){return Bt}});exports.BookingSearchBar=({isMobile:i,careApiDomain:l,geoLocationPermission:n,geoLocationCoordinates:s,initialSelectedCity:r,initialSearchValue:c="",careFrontDomain:d="/care",isDebug:u=!1,askForGeolocationPermission:p=!1,gaTrackingSearchBar:h,gaTrackingLocationSearch:f,autoCompleteDisabled:m=!1,inputSearchPlaceholder:C="",isOptionAllLocation:b=!1,hideResults:y=[],isNavResultItem:v=!0,routerPush:S,onGeoLocationPermissionChange:L,onSearch:w,onChangeLocation:O})=>{const{t:R,locale:A}=a.useTranslations(),P=t.useRef(null),_=t.useRef(null),[$,F]=t.useState(void 0),[D,B]=t.useState(!1),{geoLocationPermission:V,geoLocationCoordinates:K,requestGeoLocation:H}=k(),[z,Z]=t.useReducer(me,he,(e=>Object.assign(Object.assign({},e),{isDebug:u,isMobile:i,geoLocationPermission:n||V||"unset",geoLocationCoordinates:s||K||null,searchKeywords:c,initialSelectedCity:r||null,selectedLocation:r||e.selectedLocation||null,searchLocationKeywords:(null==r?void 0:r.name)||e.searchLocationKeywords,autoCompleteDisabled:m,inputSearchPlaceholder:C,locale:A}))),{navigateTo:U,focused:Q,isLoadingCities:q,cities:Y,searchKeywords:W,geoLocationPermission:J,selectedLocation:X,initialSelectedCity:ee,defaultCity:te,searchResults:ae,isLoadingSearchResults:ie,isMobileModalOpened:oe,inputSearchPlaceholder:ne}=z,{fetchCitiesByLocation:se,fetchCitiesByKeyword:re,fetchSearchResults:ce}=function({dispatch:e,careApiDomain:a,locale:i="vi-VN"}){const l=t.useCallback((function(t,o={}){const l=`${a}${t}`;return e({type:ge.FetchCitiesStart}),fetch(qe(l,o,i),{method:"GET"}).then((e=>e.json())).then((e=>1===e._status&&e._data?null==e?void 0:e._data:(console.log("error loading cities",e),Promise.reject(e)))).finally((()=>e({type:ge.FetchCitiesFinish})))}),[i]);return{fetchCitiesByLocation:t.useCallback((function({coordinates:t}){let a={};const o={};t&&(a={lat:t.lat,lng:t.lng}),"ms-MY"===i&&(o.noPaging=1);const n=[l(g.PATHS.GET_CITY_BY_IP,Object.assign(Object.assign({},a),o))];return"zh-TW"===i&&n.push(l(g.PATHS.GET_CITIES_LIST,{noPaging:1})),Promise.all(n).then((([t,a])=>{const i=Object.assign({},t);if(a){const e=i.cities.map((e=>e.id));i.cities=i.cities.concat(a.cities.filter((t=>!e.includes(t.id))))}e({type:ge.FetchCitiesByGeoIpComplete,payload:i})})).catch((e=>console.error("error loading cities by location",e)))}),[i,a,e]),fetchCitiesByKeyword:t.useCallback((function(t){return l(g.PATHS.GET_CITIES_LIST,{keyword:t}).then((t=>{e({type:ge.FetchCitiesByKeywordComplete,payload:t.cities})})).catch((e=>console.error("error loading cities by keyword",e)))}),[i,a,e]),fetchSearchResults:t.useCallback((function(t,l){const n=`${a}${g.PATHS.GET_SEARCH_V2}`;e({type:ge.FetchSearchResultsStart});const{defaultCity:s,selectedLocation:r,geoLocationCoordinates:c}=l;let d="";if(!r||!s)return void e({type:ge.FetchSearchResultsFinish});r.id===o.ID_OPTION_CURRENT_LOCATION?c||(d=s.id):d=r.id===o.ID_OPTION_ALL_LOCATION?"":r.id;const u=(null==c?void 0:c.lat)||"",p=(null==c?void 0:c.lng)||"";return fetch(qe(n,{domain:a,searchType:"global",keyword:t.trim().length>pe[i]?t.trim():"",city:d===o.ID_OPTION_CURRENT_LOCATION?"":d,lat:u,lng:p},i),{method:"GET",headers:{accept:"version=2.0.0.0"}}).then((e=>e.json())).then((e=>1===e._status&&e._data?null==e?void 0:e._data:Promise.reject(e))).then((t=>e({type:ge.FetchSearchResultsComplete,payload:t}))).catch((e=>{console.log("error loading search results",{url:n,error:e})})).finally((()=>e({type:ge.FetchSearchResultsFinish})))}),[i,a,e])}}({dispatch:Z,locale:A,careApiDomain:l}),de=t.useMemo((()=>{var e;return{id:o.ID_OPTION_CURRENT_LOCATION,name:R("booking.searchBar.currentLocation"),slug:null===(e=o.LOCALIZED_SLUGS[A])||void 0===e?void 0:e.CURRENT}}),[R,A]),fe=t.useMemo((()=>E.default(re,400)),[re]),Ce=t.useMemo((()=>E.default(ce,400)),[ce]);t.useEffect((()=>{""!==c&&c!==z.searchKeywords&&Z({type:ge.UpdateInitialSearchValue,payload:c})}),[c]),t.useEffect((()=>{p&&(null==X?void 0:X.id)===o.ID_OPTION_CURRENT_LOCATION&&"unset"===J&&H()}),[p,X,J]),t.useEffect((()=>{n||J===V||("granted"===V&&K?Z({type:ge.GrantGeoLocationPermission,payload:K}):"denied"===V&&Z({type:ge.DenyGeoLocationPermission}))}),[J,V,K,n]),t.useEffect((()=>{U&&(S?S(U):window.location.href=`${d}${U}`)}),[U]);const be=t.useCallback((function(){Z({type:ge.SelectCurrentLocation,payload:de})}),[R,Z]);t.useEffect((()=>{var e;"denied"===J||ee||Z({type:ge.SelectLocation,payload:{name:R("booking.searchBar.allLocations"),id:o.ID_OPTION_ALL_LOCATION,slug:null===(e=o.LOCALIZED_SLUGS[A])||void 0===e?void 0:e.ALL}}),L&&L(J,z.geoLocationCoordinates),i&&"granted"===J&&X&&Z({type:ge.FocusInputSearch}),se({coordinates:z.geoLocationCoordinates})}),[J]),t.useEffect((()=>{X&&te&&ce(z.searchKeywords,z)}),[X,te]),t.useEffect((()=>{C!==ne&&Z({type:ge.SetInputSearchPlaceholder,payload:C})}),[C,ne]),t.useEffect((()=>{oe?document.body.classList.add("care-popup-open"):document.body.classList.remove("care-popup-open")}),[oe]);const ye=t.useCallback((function(e){"ms-MY"===A&&B(!0),Z({type:ge.SelectLocation,payload:e}),"ms-MY"!==A&&Ee(),O&&O(e)}),[R,Z]);function ve(){"ms-MY"===A&&B(!0),i&&"granted"!==z.geoLocationPermission?H():(be(),"ms-MY"!==A&&Ee())}function xe(){var e;P.current&&(null===(e=P.current.querySelector('input[name="search-location"]'))||void 0===e||e.focus())}function Ee(){var e;P.current&&(null===(e=P.current.querySelector('input[name="search-results"]'))||void 0===e||e.focus())}function Se(){Z({type:ge.CloseMobileModal})}function Le(){return"location"!==Q?null:x.default.createElement(G,{isLoading:q,cities:Y,onLocationClick:ye,onCurrentLocationClick:ve,isLocationLoading:q,geoLocationPermission:J,selectedLocation:X,isOptionAllLocation:b})}function ke(){return"search"!==Q?null:z.autoCompleteDisabled?i?x.default.createElement(we,{onClick:()=>{w({cityId:z.selectedLocation.id,keyword:W}),Se()}}):null:x.default.createElement(Qe,{data:ae,state:z,dispatch:Z,isMobile:!1,keyword:W,isLoading:ie,hideResults:y,isNavResultItem:v})}function Ie(){return x.default.createElement(Oe,{isMobile:i,state:z,dispatch:Z,debouncedFetchCitiesByKeyword:fe,debouncedFetchSearchResults:Ce,focusLocationInput:xe,focusSearchInput:Ee,renderLocationResults:Le,renderSearchResults:ke,trackingAttributes:h,locationTrackingAttributes:f,onSearch:w,initalSearchValue:c})}return t.useEffect((()=>{if(window.visualViewport){const e=e=>{const t=e.target;F(null==t?void 0:t.height)};return window.visualViewport.addEventListener("resize",e,{passive:!0}),()=>{window.visualViewport.removeEventListener("resize",e)}}}),[F]),t.useEffect((()=>{if(X&&D&&"ms-MY"===A){const e=`/${X.slug}/hospital`;Z({type:ge.NavigateTo,payload:e}),B(!1)}}),[D,A,X]),i?x.default.createElement(x.default.Fragment,null,x.default.createElement(N,null),x.default.createElement(M,{ref:_}),x.default.createElement(T,{id:"booking-search-bar",ref:P,"data-is-modal":i&&oe,style:{"--mobile-care-searchbar-height":oe&&$?`${$}px`:"100%"}},oe?x.default.createElement(x.default.Fragment,null,x.default.createElement(j,null,x.default.createElement(ue,{headingText:R("booking.searchBar.searchButton"),onLeftClick:Se}),Ie()),Le(),ke()):x.default.createElement(le,{onClick:function(){var t;return e.__awaiter(this,void 0,void 0,(function*(){_.current&&_.current.focus(),Z({type:ge.OpenMobileModal}),yield Promise.resolve(),P.current&&(null===(t=P.current.querySelector('input[name="search-location"]'))||void 0===t||t.focus())}))},focused:Q,value:W,trackingAttributes:h,inputSearchPlaceholder:C}))):x.default.createElement(I,{id:"booking-search-bar",ref:P},Ie())},exports.BookingSearchBarV2=({isMobile:e,careApiDomain:i,geoLocationPermission:l,geoLocationCoordinates:n,initialSelectedCity:s,initialSearchValue:r="",initTypeSearch:c="hospital",initSpecialty:u,careFrontDomain:p="/care",isDebug:h=!1,gaTrackingSearchBar:m,gaTrackingLocationSearch:C,autoCompleteDisabled:b=!1,inputSearchPlaceholder:y="",hideTabBookingSearch:v=[],hideSpecialtySelection:S=!1,hidePopularSearchKeys:L=!1,clientSlug:w="",routerPush:O,onGeoLocationPermissionChange:I,onChangeLocation:T})=>{const{locale:j,t:M}=a.useTranslations(),R=t.useRef(null),N=t.useRef(null),[A,P]=t.useState(c),{geoLocationPermission:_,geoLocationCoordinates:$}=k(),[F,D]=t.useReducer(ot,tt,(t=>Object.assign(Object.assign({},t),{isDebug:h,isMobile:e,geoLocationPermission:l||_||"unset",geoLocationCoordinates:n||$||null,searchKeywords:r,initialSelectedCity:s||null,selectedLocation:s||t.selectedLocation||null,searchLocationKeywords:(null==s?void 0:s.name)||t.searchLocationKeywords,autoCompleteDisabled:b,inputSearchPlaceholder:y,locale:j}))),{navigateTo:B,focusedSpecialty:V,searchKeywords:K,geoLocationPermission:H,selectedLocation:z,selectedSpecialty:G,initialSelectedCity:Z,searchResults:U,isLoadingSearchResults:Q}=F,{fetchCitiesByLocation:q,fetchCitiesByKeyword:Y,fetchSearchResults:W,fetchAllSpecialties:J,fetchPopularKeys:X}=function({dispatch:e,careApiDomain:a,locale:i="vi-VN",client:l=""}){const n=t.useCallback((function(t,o={}){const l=`${a}${t}`;return e({type:at.FetchCitiesStart}),fetch(qe(l,o,i),{method:"GET"}).then((e=>e.json())).then((e=>1===e._status&&e._data?null==e?void 0:e._data:(console.log("error loading cities",e),Promise.reject(e)))).finally((()=>e({type:at.FetchCitiesFinish})))}),[i]);return{fetchCitiesByLocation:t.useCallback((function({coordinates:t}){let a={};const s={};t&&(a={lat:t.lat,lng:t.lng}),"ms-MY"===i&&(s.noPaging=1);const r=[n(g.PATHS.GET_CITY_BY_IP,Object.assign(Object.assign(Object.assign({},a),s),{client:o.CLIENT_KEY.MSD===l?"":l}))];return"zh-TW"===i&&r.push(n(g.PATHS.GET_CITIES_LIST,{noPaging:1,client:o.CLIENT_KEY.MSD===l?"":l})),Promise.all(r).then((([t,a])=>{const i=Object.assign({},t);if(a){const e=i.cities.map((e=>e.id));i.cities=i.cities.concat(a.cities.filter((t=>!e.includes(t.id))))}e({type:at.FetchCitiesByGeoIpComplete,payload:i})})).catch((e=>console.error("error loading cities by location",e)))}),[i,a,e]),fetchCitiesByKeyword:t.useCallback((function(t){return n(g.PATHS.GET_CITIES_LIST,{keyword:t,client:l}).then((t=>{e({type:at.FetchCitiesByKeywordComplete,payload:t.cities})})).catch((e=>console.error("error loading cities by keyword",e)))}),[i,a,e]),fetchSearchResults:t.useCallback((function(t,n,s,r,c){const d="specialty"===s?`${a}${g.PATHS.GET_SEARCH_SPECIALTY}`:`${a}${g.PATHS.GET_SEARCH_V2}`;e({type:at.FetchSearchResultsStart});const{selectedLocation:u,geoLocationCoordinates:p,selectedSpecialty:h}=n;let f="";if(!u)return void e({type:at.FetchSearchResultsFinish});f=u.id===o.ID_OPTION_ALL_LOCATION?"":u.id;const m=(null==p?void 0:p.lat)||"",C=(null==p?void 0:p.lng)||"",b=(null==h?void 0:h.id)>0?null==h?void 0:h.id:"",y=t.trim().length>et[i]?t.trim():"";return fetch(qe(d,{domain:a,searchType:s||"global",keyword:y,city:f===o.ID_OPTION_CURRENT_LOCATION?"":f,lat:m,lng:C,specialty_id:b,client_slug:o.CLIENT_KEY.MSD===r?"":r,msd:o.CLIENT_KEY.MSD===l?1:""},i),{method:"GET",headers:{accept:"version=2.0.0.0"}}).then((e=>e.json())).then((e=>1===e._status&&e._data?null==e?void 0:e._data:Promise.reject(e))).then((t=>{let a=[];"specialty"!==s&&(a=t.searches),"specialty"===s&&(a=y?t.specialties:t.default),e({type:at.FetchSearchResultsComplete,payload:{key:s,searches:a||[]}}),c&&e({type:at.UpdateInitialSearchResults,payload:{key:s,searches:a||[]}})})).catch((e=>{console.log("error loading search results",{url:d,error:e})})).finally((()=>e({type:at.FetchSearchResultsFinish})))}),[i,a,e]),fetchAllSpecialties:t.useCallback((function(){const t=`${a}${g.PATHS.GET_SEARCH_SPECIALTY}`;return fetch(qe(t,{domain:a,searchType:"",msd:o.CLIENT_KEY.MSD===l?1:""},i),{method:"GET",headers:{accept:"version=2.0.0.0"}}).then((e=>e.json())).then((e=>1===e._status&&e._data?null==e?void 0:e._data:Promise.reject(e))).then((t=>{e({type:at.FetchAllSpecialties,payload:t.specialties||[]})})).catch((e=>{console.log("error loading search results",{url:t,error:e})}))}),[i,a,e]),fetchPopularKeys:t.useCallback((function(t){const o=`${a}${g.PATHS.GET_SEARCH_POPULAR_KEY}`;return fetch(qe(o,{domain:a,searchType:Ft[t],sort_by:"display_order",sort_order:"asc"},i)).then((e=>e.json())).then((e=>1===e._status&&e._data?null==e?void 0:e._data:Promise.reject(e))).then((t=>{e({type:at.FetchPopularKeys,payload:t.popular_searches||[]})})).catch((e=>{console.log("error loading search results",{url:o,error:e})}))}),[i,a,e])}}({dispatch:D,locale:j,careApiDomain:i,client:w}),ee=t.useMemo((()=>o.LOCALIZED_SLUGS[j]),[j]),te=t.useMemo((()=>({doctor:{name:M("booking.searchPopup.doctors"),icon:x.default.createElement(ft,null),slug:ee.DOCTOR},service:{name:M("booking.searchPopup.services"),icon:x.default.createElement(mt,null),slug:ee.SERVICE},hospital:{name:M("booking.searchPopup.hospitals"),icon:x.default.createElement(Ct,null),slug:ee.HOSPITAL},specialty:{name:M("booking.searchPopup.specialties"),icon:x.default.createElement(bt,null),slug:ee.SPECIALTIES}})),[A]),ae=t.useMemo((()=>E.default(Y,400)),[Y]),ie=t.useMemo((()=>E.default(W,400)),[W]),oe=t.useCallback((function(e){D({type:at.SelectLocation,payload:e}),le(),T&&T(e)}),[M,D]);function le(){var e;R.current&&(null===(e=R.current.querySelector('input[name="search-results"]'))||void 0===e||e.focus())}return d.useOutsideClick(N,(()=>{D({type:at.ClickOutsideInputSearchSpecialty})})),t.useEffect((()=>{var t;"denied"===H||Z||D({type:at.SelectLocation,payload:{name:M("booking.searchBar.allLocations"),id:o.ID_OPTION_ALL_LOCATION,slug:null===(t=o.LOCALIZED_SLUGS[j])||void 0===t?void 0:t.ALL}}),I&&I(H,F.geoLocationCoordinates),e&&"granted"===H&&z&&D({type:at.FocusInputSearch}),q({coordinates:F.geoLocationCoordinates})}),[H]),t.useEffect((()=>{const e=u||{name:M("booking.searchBar.allSpecialties"),id:-1,thumbnail:"",total_doctor:0,slug:ee.SPECIALTIES};F.selectedSpecialty||D({type:at.SelectSpecialty,payload:e})}),[u,F.selectedSpecialty]),t.useEffect((()=>{J()}),[]),t.useEffect((()=>{X(A)}),[A]),t.useEffect((()=>{B&&(O?O(B):window.location.href=`${p}${B}`)}),[B]),t.useEffect((()=>{W(F.searchKeywords,F,A,w,!0)}),[z,G,A]),x.default.createElement(Ye,{ref:R},x.default.createElement($t,{currentTab:A,setCurrentTab:P,isMobile:e,hideTabBookingSearch:v}),x.default.createElement(We,{className:"booking-search-container"},x.default.createElement(Je,null,x.default.createElement(Xe,null,x.default.createElement("div",{ref:N},x.default.createElement(f.Flex,{gap:"12px",justify:"space-between",align:"center",direction:e?"column":"row",className:"flex-search-input"},"specialty"!==A&&x.default.createElement(wt,{state:F,isMobile:e,dispatch:D,debouncedFetchCitiesByKeyword:ae,selectedLocation:z,onLocationClick:oe,trackingAttributes:C}),x.default.createElement(vt,{type:A,isMobile:e,state:F,dispatch:D,debouncedFetchSearchResults:ie,initalSearchValue:r,focusSearchInput:le,typeInformation:te,trackingAttributes:m,isLoading:Q,hideSpecialtySelection:S,clientSlug:w}),x.default.createElement(f.Button,{size:e?"md":"lg",color:"#2D87F3",fullWidth:e,variant:"filled",onClick:function(){let e="";const{slug:t}=te[A];let a="";const i=o.MAPPING_CLIENT_WITH_SLUG[j][w];("doctor"===A||"hospital"===A)&&F.selectedSpecialty.id>0&&(a=`&specialtyId=${F.selectedSpecialty.id}`),e="specialty"===A?`/${t}`:`/${z.slug}/${t}`,i&&(e+=`/${i}`),e+=`?q=${K}${a}`,e&&D({type:at.NavigateTo,payload:e})},styles:{root:{height:e?"40px":"48px"}}},M("booking.searchBar.searchButton"))),!L&&"specialty"!==A&&F.popularKeys.length>0&&x.default.createElement(At,{type:A,state:F,typeInformation:te,dispatch:D}),"specialty"===A&&"search"===V&&x.default.createElement(jt,{state:F,isMobile:e,dispatch:D,specialties:(null==U?void 0:U.specialty)||[],isLoading:Q}))))))},exports.TextDivider=({children:e,icon:t,className:a,style:i})=>x.default.createElement(Dt,{style:i,className:a},x.default.createElement(C.Container,null,x.default.createElement("div",{className:"icon-wrapper"},t),x.default.createElement(s.Text,{size:"c1",color:"var(--neutral800)"},e))),exports.types=Vt;
|
|
785
|
+
`;var Bt;!function(e){e[e.SPECIALTY=1]="SPECIALTY",e[e.DOCTOR=2]="DOCTOR",e[e.CLINIC=3]="CLINIC",e[e.SERVICE=4]="SERVICE"}(Bt||(Bt={}));var Kt=Object.freeze({__proto__:null,get RedirectType(){return Bt}});exports.BookingSearchBar=({isMobile:i,careApiDomain:l,geoLocationPermission:n,geoLocationCoordinates:s,initialSelectedCity:r,initialSearchValue:c="",careFrontDomain:d="/care",isDebug:u=!1,askForGeolocationPermission:p=!1,gaTrackingSearchBar:h,gaTrackingLocationSearch:f,autoCompleteDisabled:m=!1,inputSearchPlaceholder:C="",isOptionAllLocation:b=!1,hideResults:y=[],isNavResultItem:v=!0,routerPush:S,onGeoLocationPermissionChange:L,onSearch:w,onChangeLocation:O})=>{const{t:R,locale:A}=a.useTranslations(),P=t.useRef(null),_=t.useRef(null),[$,F]=t.useState(void 0),[D,B]=t.useState(!1),{geoLocationPermission:K,geoLocationCoordinates:V,requestGeoLocation:H}=k(),[z,Z]=t.useReducer(me,he,(e=>Object.assign(Object.assign({},e),{isDebug:u,isMobile:i,geoLocationPermission:n||K||"unset",geoLocationCoordinates:s||V||null,searchKeywords:c,initialSelectedCity:r||null,selectedLocation:r||e.selectedLocation||null,searchLocationKeywords:(null==r?void 0:r.name)||e.searchLocationKeywords,autoCompleteDisabled:m,inputSearchPlaceholder:C,locale:A}))),{navigateTo:U,focused:Q,isLoadingCities:q,cities:Y,searchKeywords:W,geoLocationPermission:J,selectedLocation:X,initialSelectedCity:ee,defaultCity:te,searchResults:ae,isLoadingSearchResults:ie,isMobileModalOpened:oe,inputSearchPlaceholder:ne}=z,{fetchCitiesByLocation:se,fetchCitiesByKeyword:re,fetchSearchResults:ce}=function({dispatch:e,careApiDomain:a,locale:i="vi-VN"}){const l=t.useCallback((function(t,o={}){const l=`${a}${t}`;return e({type:ge.FetchCitiesStart}),fetch(qe(l,o,i),{method:"GET"}).then((e=>e.json())).then((e=>1===e._status&&e._data?null==e?void 0:e._data:(console.log("error loading cities",e),Promise.reject(e)))).finally((()=>e({type:ge.FetchCitiesFinish})))}),[i]);return{fetchCitiesByLocation:t.useCallback((function({coordinates:t}){let a={};const o={};t&&(a={lat:t.lat,lng:t.lng}),"ms-MY"===i&&(o.noPaging=1);const n=[l(g.PATHS.GET_CITY_BY_IP,Object.assign(Object.assign({},a),o))];return"zh-TW"===i&&n.push(l(g.PATHS.GET_CITIES_LIST,{noPaging:1})),Promise.all(n).then((([t,a])=>{const i=Object.assign({},t);if(a){const e=i.cities.map((e=>e.id));i.cities=i.cities.concat(a.cities.filter((t=>!e.includes(t.id))))}e({type:ge.FetchCitiesByGeoIpComplete,payload:i})})).catch((e=>console.error("error loading cities by location",e)))}),[i,a,e]),fetchCitiesByKeyword:t.useCallback((function(t){return l(g.PATHS.GET_CITIES_LIST,{keyword:t}).then((t=>{e({type:ge.FetchCitiesByKeywordComplete,payload:t.cities})})).catch((e=>console.error("error loading cities by keyword",e)))}),[i,a,e]),fetchSearchResults:t.useCallback((function(t,l){const n=`${a}${g.PATHS.GET_SEARCH_V2}`;e({type:ge.FetchSearchResultsStart});const{defaultCity:s,selectedLocation:r,geoLocationCoordinates:c}=l;let d="";if(!r||!s)return void e({type:ge.FetchSearchResultsFinish});r.id===o.ID_OPTION_CURRENT_LOCATION?c||(d=s.id):d=r.id===o.ID_OPTION_ALL_LOCATION?"":r.id;const u=(null==c?void 0:c.lat)||"",p=(null==c?void 0:c.lng)||"";return fetch(qe(n,{domain:a,searchType:"global",keyword:t.trim().length>pe[i]?t.trim():"",city:d===o.ID_OPTION_CURRENT_LOCATION?"":d,lat:u,lng:p},i),{method:"GET",headers:{accept:"version=2.0.0.0"}}).then((e=>e.json())).then((e=>1===e._status&&e._data?null==e?void 0:e._data:Promise.reject(e))).then((t=>e({type:ge.FetchSearchResultsComplete,payload:t}))).catch((e=>{console.log("error loading search results",{url:n,error:e})})).finally((()=>e({type:ge.FetchSearchResultsFinish})))}),[i,a,e])}}({dispatch:Z,locale:A,careApiDomain:l}),de=t.useMemo((()=>{var e;return{id:o.ID_OPTION_CURRENT_LOCATION,name:R("booking.searchBar.currentLocation"),slug:null===(e=o.LOCALIZED_SLUGS[A])||void 0===e?void 0:e.CURRENT}}),[R,A]),fe=t.useMemo((()=>E.default(re,400)),[re]),Ce=t.useMemo((()=>E.default(ce,400)),[ce]);t.useEffect((()=>{""!==c&&c!==z.searchKeywords&&Z({type:ge.UpdateInitialSearchValue,payload:c})}),[c]),t.useEffect((()=>{p&&(null==X?void 0:X.id)===o.ID_OPTION_CURRENT_LOCATION&&"unset"===J&&H()}),[p,X,J]),t.useEffect((()=>{n||J===K||("granted"===K&&V?Z({type:ge.GrantGeoLocationPermission,payload:V}):"denied"===K&&Z({type:ge.DenyGeoLocationPermission}))}),[J,K,V,n]),t.useEffect((()=>{U&&(S?S(U):window.location.href=`${d}${U}`)}),[U]);const be=t.useCallback((function(){Z({type:ge.SelectCurrentLocation,payload:de})}),[R,Z]);t.useEffect((()=>{var e;"denied"===J||ee||Z({type:ge.SelectLocation,payload:{name:R("booking.searchBar.allLocations"),id:o.ID_OPTION_ALL_LOCATION,slug:null===(e=o.LOCALIZED_SLUGS[A])||void 0===e?void 0:e.ALL}}),L&&L(J,z.geoLocationCoordinates),i&&"granted"===J&&X&&Z({type:ge.FocusInputSearch}),se({coordinates:z.geoLocationCoordinates})}),[J]),t.useEffect((()=>{X&&te&&ce(z.searchKeywords,z)}),[X,te]),t.useEffect((()=>{C!==ne&&Z({type:ge.SetInputSearchPlaceholder,payload:C})}),[C,ne]),t.useEffect((()=>{oe?document.body.classList.add("care-popup-open"):document.body.classList.remove("care-popup-open")}),[oe]);const ye=t.useCallback((function(e){"ms-MY"===A&&B(!0),Z({type:ge.SelectLocation,payload:e}),"ms-MY"!==A&&Ee(),O&&O(e)}),[R,Z]);function ve(){"ms-MY"===A&&B(!0),i&&"granted"!==z.geoLocationPermission?H():(be(),"ms-MY"!==A&&Ee())}function xe(){var e;P.current&&(null===(e=P.current.querySelector('input[name="search-location"]'))||void 0===e||e.focus())}function Ee(){var e;P.current&&(null===(e=P.current.querySelector('input[name="search-results"]'))||void 0===e||e.focus())}function Se(){Z({type:ge.CloseMobileModal})}function Le(){return"location"!==Q?null:x.default.createElement(G,{isLoading:q,cities:Y,onLocationClick:ye,onCurrentLocationClick:ve,isLocationLoading:q,geoLocationPermission:J,selectedLocation:X,isOptionAllLocation:b})}function ke(){return"search"!==Q?null:z.autoCompleteDisabled?i?x.default.createElement(we,{onClick:()=>{w({cityId:z.selectedLocation.id,keyword:W}),Se()}}):null:x.default.createElement(Qe,{data:ae,state:z,dispatch:Z,isMobile:!1,keyword:W,isLoading:ie,hideResults:y,isNavResultItem:v})}function Ie(){return x.default.createElement(Oe,{isMobile:i,state:z,dispatch:Z,debouncedFetchCitiesByKeyword:fe,debouncedFetchSearchResults:Ce,focusLocationInput:xe,focusSearchInput:Ee,renderLocationResults:Le,renderSearchResults:ke,trackingAttributes:h,locationTrackingAttributes:f,onSearch:w,initalSearchValue:c})}return t.useEffect((()=>{if(window.visualViewport){const e=e=>{const t=e.target;F(null==t?void 0:t.height)};return window.visualViewport.addEventListener("resize",e,{passive:!0}),()=>{window.visualViewport.removeEventListener("resize",e)}}}),[F]),t.useEffect((()=>{if(X&&D&&"ms-MY"===A){const e=`/${X.slug}/hospital`;Z({type:ge.NavigateTo,payload:e}),B(!1)}}),[D,A,X]),i?x.default.createElement(x.default.Fragment,null,x.default.createElement(N,null),x.default.createElement(M,{ref:_}),x.default.createElement(T,{id:"booking-search-bar",ref:P,"data-is-modal":i&&oe,style:{"--mobile-care-searchbar-height":oe&&$?`${$}px`:"100%"}},oe?x.default.createElement(x.default.Fragment,null,x.default.createElement(j,null,x.default.createElement(ue,{headingText:R("booking.searchBar.searchButton"),onLeftClick:Se}),Ie()),Le(),ke()):x.default.createElement(le,{onClick:function(){var t;return e.__awaiter(this,void 0,void 0,(function*(){_.current&&_.current.focus(),Z({type:ge.OpenMobileModal}),yield Promise.resolve(),P.current&&(null===(t=P.current.querySelector('input[name="search-location"]'))||void 0===t||t.focus())}))},focused:Q,value:W,trackingAttributes:h,inputSearchPlaceholder:C}))):x.default.createElement(I,{id:"booking-search-bar",ref:P},Ie())},exports.BookingSearchBarV2=({isMobile:e,careApiDomain:i,geoLocationPermission:l,geoLocationCoordinates:n,initialSelectedCity:s,initialSearchValue:r="",initTypeSearch:c="hospital",initSpecialty:u,careFrontDomain:p="/care",isDebug:h=!1,gaTrackingSearchBar:m,gaTrackingLocationSearch:C,autoCompleteDisabled:b=!1,inputSearchPlaceholder:y="",hideTabBookingSearch:v=[],hideSpecialtySelection:S=!1,hidePopularSearchKeys:L=!1,clientSlug:w="",routerPush:O,onGeoLocationPermissionChange:I,onChangeLocation:T})=>{const{locale:j,t:M}=a.useTranslations(),R=t.useRef(null),N=t.useRef(null),[A,P]=t.useState(c),{geoLocationPermission:_,geoLocationCoordinates:$}=k(),[F,D]=t.useReducer(ot,tt,(t=>Object.assign(Object.assign({},t),{isDebug:h,isMobile:e,geoLocationPermission:l||_||"unset",geoLocationCoordinates:n||$||null,searchKeywords:r,initialSelectedCity:s||null,selectedLocation:s||t.selectedLocation||null,searchLocationKeywords:(null==s?void 0:s.name)||t.searchLocationKeywords,autoCompleteDisabled:b,inputSearchPlaceholder:y,locale:j}))),{navigateTo:B,focusedSpecialty:K,searchKeywords:V,geoLocationPermission:H,selectedLocation:z,selectedSpecialty:G,initialSelectedCity:Z,searchResults:U,isLoadingSearchResults:Q}=F,{fetchCitiesByLocation:q,fetchCitiesByKeyword:Y,fetchSearchResults:W,fetchAllSpecialties:J,fetchPopularKeys:X}=function({dispatch:e,careApiDomain:a,locale:i="vi-VN",client:l=""}){const n=t.useCallback((function(t,o={}){const l=`${a}${t}`;return e({type:at.FetchCitiesStart}),fetch(qe(l,o,i),{method:"GET"}).then((e=>e.json())).then((e=>1===e._status&&e._data?null==e?void 0:e._data:(console.log("error loading cities",e),Promise.reject(e)))).finally((()=>e({type:at.FetchCitiesFinish})))}),[i]);return{fetchCitiesByLocation:t.useCallback((function({coordinates:t}){let a={};const s={};t&&(a={lat:t.lat,lng:t.lng}),"ms-MY"===i&&(s.noPaging=1);const r=[n(g.PATHS.GET_CITY_BY_IP,Object.assign(Object.assign(Object.assign({},a),s),{client:o.CLIENT_KEY.MSD===l?"":l}))];return"zh-TW"===i&&r.push(n(g.PATHS.GET_CITIES_LIST,{noPaging:1,client:o.CLIENT_KEY.MSD===l?"":l})),Promise.all(r).then((([t,a])=>{const i=Object.assign({},t);if(a){const e=i.cities.map((e=>e.id));i.cities=i.cities.concat(a.cities.filter((t=>!e.includes(t.id))))}e({type:at.FetchCitiesByGeoIpComplete,payload:i})})).catch((e=>console.error("error loading cities by location",e)))}),[i,a,e]),fetchCitiesByKeyword:t.useCallback((function(t){return n(g.PATHS.GET_CITIES_LIST,{keyword:t,client:l}).then((t=>{e({type:at.FetchCitiesByKeywordComplete,payload:t.cities})})).catch((e=>console.error("error loading cities by keyword",e)))}),[i,a,e]),fetchSearchResults:t.useCallback((function(t,n,s,r,c){const d="specialty"===s?`${a}${g.PATHS.GET_SEARCH_SPECIALTY}`:`${a}${g.PATHS.GET_SEARCH_V2}`;e({type:at.FetchSearchResultsStart});const{selectedLocation:u,geoLocationCoordinates:p,selectedSpecialty:h}=n;let f="";if(!u)return void e({type:at.FetchSearchResultsFinish});f=u.id===o.ID_OPTION_ALL_LOCATION?"":u.id;const m=(null==p?void 0:p.lat)||"",C=(null==p?void 0:p.lng)||"",b=(null==h?void 0:h.id)>0?null==h?void 0:h.id:"",y=t.trim().length>et[i]?t.trim():"";return fetch(qe(d,{domain:a,searchType:s||"global",keyword:y,city:f===o.ID_OPTION_CURRENT_LOCATION?"":f,lat:m,lng:C,specialty_id:b,client_slug:o.CLIENT_KEY.MSD===r?"":r,msd:o.CLIENT_KEY.MSD===l?1:""},i),{method:"GET",headers:{accept:"version=2.0.0.0"}}).then((e=>e.json())).then((e=>1===e._status&&e._data?null==e?void 0:e._data:Promise.reject(e))).then((t=>{let a=[];"specialty"!==s&&(a=t.searches),"specialty"===s&&(a=y?t.specialties:t.default),e({type:at.FetchSearchResultsComplete,payload:{key:s,searches:a||[]}}),c&&e({type:at.UpdateInitialSearchResults,payload:{key:s,searches:a||[]}})})).catch((e=>{console.log("error loading search results",{url:d,error:e})})).finally((()=>e({type:at.FetchSearchResultsFinish})))}),[i,a,e]),fetchAllSpecialties:t.useCallback((function(){const t=`${a}${g.PATHS.GET_SEARCH_SPECIALTY}`;return fetch(qe(t,{domain:a,searchType:"",msd:o.CLIENT_KEY.MSD===l?1:""},i),{method:"GET",headers:{accept:"version=2.0.0.0"}}).then((e=>e.json())).then((e=>1===e._status&&e._data?null==e?void 0:e._data:Promise.reject(e))).then((t=>{e({type:at.FetchAllSpecialties,payload:t.specialties||[]})})).catch((e=>{console.log("error loading search results",{url:t,error:e})}))}),[i,a,e]),fetchPopularKeys:t.useCallback((function(t){const o=`${a}${g.PATHS.GET_SEARCH_POPULAR_KEY}`;return fetch(qe(o,{domain:a,searchType:Ft[t],sort_by:"display_order",sort_order:"asc"},i)).then((e=>e.json())).then((e=>1===e._status&&e._data?null==e?void 0:e._data:Promise.reject(e))).then((t=>{e({type:at.FetchPopularKeys,payload:t.popular_searches||[]})})).catch((e=>{console.log("error loading search results",{url:o,error:e})}))}),[i,a,e])}}({dispatch:D,locale:j,careApiDomain:i,client:w}),ee=t.useMemo((()=>o.LOCALIZED_SLUGS[j]),[j]),te=t.useMemo((()=>({doctor:{name:M("booking.searchPopup.doctors"),icon:x.default.createElement(ft,null),slug:ee.DOCTOR},service:{name:M("booking.searchPopup.services"),icon:x.default.createElement(mt,null),slug:ee.SERVICE},hospital:{name:M("booking.searchPopup.hospitals"),icon:x.default.createElement(Ct,null),slug:ee.HOSPITAL},specialty:{name:M("booking.searchPopup.specialties"),icon:x.default.createElement(bt,null),slug:ee.SPECIALTIES}})),[A]),ae=t.useMemo((()=>E.default(Y,400)),[Y]),ie=t.useMemo((()=>E.default(W,400)),[W]),oe=t.useCallback((function(e){D({type:at.SelectLocation,payload:e}),le(),T&&T(e)}),[M,D]);function le(){var e;R.current&&(null===(e=R.current.querySelector('input[name="search-results"]'))||void 0===e||e.focus())}function ne(){let e="";const{slug:t}=te[A];let a="";const i=o.MAPPING_CLIENT_WITH_SLUG[j][w];("doctor"===A||"hospital"===A)&&F.selectedSpecialty.id>0&&(a=`&specialtyId=${F.selectedSpecialty.id}`),e="specialty"===A?`/${t}`:`/${z.slug}/${t}`,i&&(e+=`/${i}`),e+=`?q=${V}${a}`,e&&D({type:at.NavigateTo,payload:e})}return d.useOutsideClick(N,(()=>{D({type:at.ClickOutsideInputSearchSpecialty})})),t.useEffect((()=>{var t;"denied"===H||Z||D({type:at.SelectLocation,payload:{name:M("booking.searchBar.allLocations"),id:o.ID_OPTION_ALL_LOCATION,slug:null===(t=o.LOCALIZED_SLUGS[j])||void 0===t?void 0:t.ALL}}),I&&I(H,F.geoLocationCoordinates),e&&"granted"===H&&z&&D({type:at.FocusInputSearch}),q({coordinates:F.geoLocationCoordinates})}),[H]),t.useEffect((()=>{const e=u||{name:M("booking.searchBar.allSpecialties"),id:-1,thumbnail:"",total_doctor:0,slug:ee.SPECIALTIES};F.selectedSpecialty||D({type:at.SelectSpecialty,payload:e})}),[u,F.selectedSpecialty]),t.useEffect((()=>{J()}),[]),t.useEffect((()=>{X(A)}),[A]),t.useEffect((()=>{B&&(O?O(B):window.location.href=`${p}${B}`)}),[B]),t.useEffect((()=>{W(F.searchKeywords,F,A,w,!0)}),[z,G,A]),x.default.createElement(Ye,{ref:R},x.default.createElement($t,{currentTab:A,setCurrentTab:P,isMobile:e,hideTabBookingSearch:v}),x.default.createElement(We,{className:"booking-search-container"},x.default.createElement(Je,null,x.default.createElement(Xe,null,x.default.createElement("div",{ref:N},x.default.createElement(f.Flex,{gap:"12px",justify:"space-between",align:"center",direction:e?"column":"row",className:"flex-search-input"},"specialty"!==A&&x.default.createElement(wt,{state:F,isMobile:e,dispatch:D,debouncedFetchCitiesByKeyword:ae,selectedLocation:z,onLocationClick:oe,trackingAttributes:C}),x.default.createElement(vt,{type:A,isMobile:e,state:F,dispatch:D,debouncedFetchSearchResults:ie,initalSearchValue:r,focusSearchInput:le,onEnterSearch:ne,typeInformation:te,trackingAttributes:m,isLoading:Q,hideSpecialtySelection:S,clientSlug:w}),x.default.createElement(f.Button,{size:e?"md":"lg",color:"#2D87F3",fullWidth:e,variant:"filled",onClick:ne,styles:{root:{height:e?"40px":"48px"}}},M("booking.searchBar.searchButton"))),!L&&"specialty"!==A&&F.popularKeys.length>0&&x.default.createElement(At,{type:A,state:F,typeInformation:te,dispatch:D}),"specialty"===A&&"search"===K&&x.default.createElement(jt,{state:F,isMobile:e,dispatch:D,specialties:(null==U?void 0:U.specialty)||[],isLoading:Q}))))))},exports.TextDivider=({children:e,icon:t,className:a,style:i})=>x.default.createElement(Dt,{style:i,className:a},x.default.createElement(C.Container,null,x.default.createElement("div",{className:"icon-wrapper"},t),x.default.createElement(s.Text,{size:"c1",color:"var(--neutral800)"},e))),exports.types=Kt;
|