@hhgtech/hhg-components 1.27.159 → 1.27.161
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/README.md +60 -8
- package/build/babyGrowth.js +2 -2
- package/build/cache.js +1 -1
- package/build/care/index.d.ts +1 -0
- package/build/care.js +1 -1
- package/build/components/atoms/index.d.ts +0 -1
- package/build/components.js +1 -1
- package/build/{constants-75aadffb.js → constants-530a0ecf.js} +1 -1
- package/build/{constants-31450bc5.js → constants-729267f0.js} +1 -1
- package/build/constants.js +1 -1
- package/build/core-9c7a3bbf.js +1 -0
- package/build/ecom.js +1 -1
- package/build/esm/babyGrowth.js +2 -2
- package/build/esm/cache.js +1 -1
- package/build/esm/care/index.d.ts +1 -0
- package/build/esm/care.js +1 -1
- package/build/esm/components/atoms/index.d.ts +0 -1
- package/build/esm/components.js +1 -1
- package/build/esm/{constants-531169d2.js → constants-4e77772b.js} +1 -1
- package/build/esm/{constants-b08eda13.js → constants-55308a13.js} +1 -1
- package/build/esm/constants.js +1 -1
- package/build/esm/{core-8a9cbd2a.js → core-54fe1600.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-dc735430.js +1 -0
- package/build/esm/{getSocialList-bcc967f8.js → getSocialList-2c08720a.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-754ac192.js → index-13075213.js} +1 -1
- package/build/esm/index-2778bd37.js +1 -0
- package/build/esm/{index-fa41ceed.js → index-29398213.js} +1 -1
- package/build/esm/index-405d59b7.js +3533 -0
- package/build/esm/{index-97b10ada.js → index-47fa9ddc.js} +1 -1
- package/build/esm/{index-3112b8d2.js → index-502d83d4.js} +4 -4
- package/build/esm/{index-34a8408b.js → index-50a78483.js} +1 -1
- package/build/esm/{index-485d0140.js → index-68a6626d.js} +1 -1
- package/build/esm/index-6a6071e2.js +1 -0
- package/build/esm/{index-c2bcdb0a.js → index-882b7df3.js} +1 -1
- package/build/esm/{index-26c4b35f.js → index-9753cb26.js} +1 -1
- package/build/esm/{index-46237665.js → index-99818d57.js} +1 -1
- package/build/esm/{index-79917dbf.js → index-9fce504e.js} +1 -1
- package/build/esm/{index-5c537ab4.js → index-bb5d98ca.js} +1 -1
- package/build/esm/{index-31afc7f3.js → index-c7bc059b.js} +7 -12
- package/build/esm/index-c9986dbd.js +1 -0
- package/build/esm/{index-59ecbd4b.js → index-d0c43f4c.js} +2 -2
- package/build/esm/{index-5fd57ab2.js → index-f41ce453.js} +1 -1
- package/build/esm/index-fb2f22d1.js +1 -0
- package/build/esm/index.js +1 -1
- package/build/esm/{index.styled-44862bae.js → index.styled-9ca20e58.js} +1 -1
- package/build/esm/{index.styled-83088fd6.js → index.styled-e131ec51.js} +1 -1
- package/build/esm/{index.styles-5dfe0c2d.js → index.styles-0c995338.js} +45 -64
- 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 +1 -1
- package/build/esm/pwg.js +1 -1
- package/build/esm/{routing-7d005a49.js → routing-1b159c4a.js} +1 -1
- package/build/esm/together.js +1 -1
- package/build/esm/{types-d3f309d9.js → types-6c860ae9.js} +28 -9
- package/build/esm/{types-988ffdb6.js → types-b2ec6aab.js} +1 -1
- package/build/esm/types.js +1 -1
- package/build/esm/{useCategory-075626af.js → useCategory-c0a62126.js} +1 -1
- package/build/esm/useHealthToolCache-110c732c.js +1 -0
- package/build/esm/{useRafState-ceea7492.js → useRafState-e60b168e.js} +1 -1
- package/build/esm/{useTranslations-d23e5957.js → useTranslations-8e7471e9.js} +1 -1
- package/build/esm/{utils-fe965c4d.js → utils-33596d98.js} +1 -1
- package/build/esm/{utils-19423dc2.js → utils-923bed56.js} +1 -1
- package/build/esm/vaccination.js +1 -1
- package/build/footer.js +1 -1
- package/build/gAssets.js +1 -1
- package/build/getDynamicHealthTool-6139d439.js +1 -0
- package/build/{getSocialList-345abcd6.js → getSocialList-40644b05.js} +1 -1
- package/build/hooks.js +1 -1
- package/build/i18n.js +1 -1
- package/build/i18nV2.js +1 -1
- package/build/{index-6c3faa7e.js → index-2505994e.js} +1 -1
- package/build/index-309e60ab.js +1 -0
- package/build/index-40f68767.js +1 -0
- package/build/{index-7d8725b3.js → index-4a12c2a8.js} +1 -1
- package/build/{index-c6ad09b1.js → index-4d038478.js} +1 -1
- package/build/index-69fb3903.js +1 -0
- package/build/{index-b7a1b3cb.js → index-76e24325.js} +1 -1
- package/build/{index-b1e5dddc.js → index-7a8b14d4.js} +1 -1
- package/build/{index-db80ba0c.js → index-8232502b.js} +1 -1
- package/build/{index-b99ae263.js → index-9df81ed9.js} +1 -1
- package/build/{index-75d9ef50.js → index-a37938a5.js} +1 -1
- package/build/index-b5c78d4d.js +3533 -0
- package/build/index-c084e8e0.js +113 -0
- package/build/{index-4772af05.js → index-d31e5a7a.js} +1 -1
- package/build/{index-420aa9de.js → index-e2e5c0d6.js} +1 -1
- package/build/{index-55def889.js → index-f03402aa.js} +1 -1
- package/build/{index-8537defc.js → index-f2c966a4.js} +1 -1
- package/build/{index-6ad602c5.js → index-f51aa89f.js} +1 -1
- package/build/{index-48216d9e.js → index-fa36dcfc.js} +1 -1
- package/build/index.js +1 -1
- package/build/{index.styled-01b8561c.js → index.styled-572bd083.js} +1 -1
- package/build/{index.styled-4bfae288.js → index.styled-fb6a5c77.js} +1 -1
- package/build/{index.styles-7b879f73.js → index.styles-99d90a47.js} +47 -66
- 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 +5 -5
- package/build/pwg.js +2 -2
- package/build/{routing-b783336f.js → routing-2be6c855.js} +1 -1
- package/build/together.js +1 -1
- package/build/{types-e3fd1da1.js → types-f14e51e2.js} +1 -1
- package/build/{types-de3c0549.js → types-f71ec22e.js} +21 -2
- package/build/types.js +1 -1
- package/build/{useCategory-a6ac1b1f.js → useCategory-e02bbab5.js} +1 -1
- package/build/{useHealthToolCache-0d190518.js → useHealthToolCache-89d5706e.js} +1 -1
- package/build/{useRafState-18243d6c.js → useRafState-51c4ff7e.js} +1 -1
- package/build/{useTranslations-fec480df.js → useTranslations-d57cfa60.js} +1 -1
- package/build/utils-21b70e2b.js +1 -0
- package/build/{utils-a7094a26.js → utils-3f62b2db.js} +1 -1
- package/build/vaccination.js +1 -1
- package/package.json +4 -3
- package/build/core-b7f657e8.js +0 -1
- package/build/esm/getDynamicHealthTool-ebb00e98.js +0 -1
- package/build/esm/index-313f49bc.js +0 -1
- package/build/esm/index-6b5561fb.js +0 -1
- package/build/esm/index-6d051f86.js +0 -1
- package/build/esm/index-98346b8c.js +0 -1
- package/build/esm/index-d3087357.js +0 -3533
- package/build/esm/misc/callApi/helpers.d.ts +0 -4
- package/build/esm/misc/callApi/index.d.ts +0 -24
- package/build/esm/misc/callApi/instance.d.ts +0 -11
- package/build/esm/misc/callApi/interceptors.d.ts +0 -6
- package/build/esm/useHealthToolCache-5227ddbe.js +0 -1
- package/build/getDynamicHealthTool-24c62518.js +0 -1
- package/build/index-03a10f01.js +0 -1
- package/build/index-916461f6.js +0 -1
- package/build/index-9a389e50.js +0 -3533
- package/build/index-a42027c8.js +0 -118
- package/build/index-f6a8c60a.js +0 -1
- package/build/misc/callApi/helpers.d.ts +0 -4
- package/build/misc/callApi/index.d.ts +0 -24
- package/build/misc/callApi/instance.d.ts +0 -11
- package/build/misc/callApi/interceptors.d.ts +0 -6
- package/build/utils-e78a1e03.js +0 -1
- /package/build/{BMI_BOYS.percentile.monthly-86fc92b6.js → BMI_BOYS.percentile.monthly-0fe75dc6.js} +0 -0
- /package/build/{BMI_BOYS.percentile.weekly-9c7691d5.js → BMI_BOYS.percentile.weekly-d32a6320.js} +0 -0
- /package/build/{BMI_BOYS.percentile.yearly-e2e09c55.js → BMI_BOYS.percentile.yearly-4783dc1f.js} +0 -0
- /package/build/{BMI_BOYS.zscore.monthly-71eef063.js → BMI_BOYS.zscore.monthly-44c85e86.js} +0 -0
- /package/build/{BMI_BOYS.zscore.weekly-35341733.js → BMI_BOYS.zscore.weekly-ba69577e.js} +0 -0
- /package/build/{BMI_BOYS.zscore.yearly-733eaec2.js → BMI_BOYS.zscore.yearly-4b4836cc.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.monthly-75d28c94.js → BMI_GIRLS.percentile.monthly-6140cd94.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.weekly-7e151197.js → BMI_GIRLS.percentile.weekly-fe6dfa19.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.yearly-4a5e10be.js → BMI_GIRLS.percentile.yearly-6286e1d1.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.monthly-8b8dd2f6.js → BMI_GIRLS.zscore.monthly-aa81719b.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.weekly-b353db3c.js → BMI_GIRLS.zscore.weekly-c8c0fcc0.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.yearly-4a9ebd64.js → BMI_GIRLS.zscore.yearly-983def3f.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-e229b6f6.js → HEAD CIRCUM_BOYS.percentile.monthly-7c1c8703.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-d3634bd9.js → HEAD CIRCUM_BOYS.percentile.weekly-0b870250.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-82f68209.js → HEAD CIRCUM_BOYS.percentile.yearly-1ccbc81d.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-3996efc6.js → HEAD CIRCUM_BOYS.zscore.monthly-f640d4d0.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-be4ebfbd.js → HEAD CIRCUM_BOYS.zscore.weekly-5482f634.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-e72242b9.js → HEAD CIRCUM_BOYS.zscore.yearly-e29b3fd9.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-10e7794e.js → HEAD CIRCUM_GIRLS.percentile.monthly-287252fa.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-da0137ff.js → HEAD CIRCUM_GIRLS.percentile.weekly-2ea52420.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-c9612d3b.js → HEAD CIRCUM_GIRLS.percentile.yearly-d5265be0.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-3e5cb09b.js → HEAD CIRCUM_GIRLS.zscore.monthly-64a05054.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-9ccd7ef0.js → HEAD CIRCUM_GIRLS.zscore.weekly-5dab5bf0.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-5e552c88.js → HEAD CIRCUM_GIRLS.zscore.yearly-8dc20701.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.monthly-393957a1.js → HEIGHT_BOYS.percentile.monthly-b783cf1a.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.weekly-daccba5b.js → HEIGHT_BOYS.percentile.weekly-ec990b80.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.yearly-f23d36d8.js → HEIGHT_BOYS.percentile.yearly-614a1951.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.monthly-d2062b80.js → HEIGHT_BOYS.zscore.monthly-495a0b9b.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.weekly-2c68b327.js → HEIGHT_BOYS.zscore.weekly-02c6ce54.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.yearly-2f6bb842.js → HEIGHT_BOYS.zscore.yearly-3ae47f90.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.monthly-47c1a524.js → HEIGHT_GIRLS.percentile.monthly-bef2e359.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.weekly-e3e274fd.js → HEIGHT_GIRLS.percentile.weekly-b56f489e.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.yearly-aea4d47d.js → HEIGHT_GIRLS.percentile.yearly-fd44e47b.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.monthly-1108062c.js → HEIGHT_GIRLS.zscore.monthly-6326e54b.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.weekly-867bf1d8.js → HEIGHT_GIRLS.zscore.weekly-7a825114.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.yearly-6c430c89.js → HEIGHT_GIRLS.zscore.yearly-407d276d.js} +0 -0
- /package/build/{Onboarding-7fe4d4db.js → Onboarding-06a9b342.js} +0 -0
- /package/build/{Visible-89723a09.js → Visible-e848ad3b.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.monthly-d8c6b2bb.js → WEIGHT_BOYS.percentile.monthly-a5f13251.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.weekly-add05ea0.js → WEIGHT_BOYS.percentile.weekly-891ce70e.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.yearly-9b35d955.js → WEIGHT_BOYS.percentile.yearly-0c8b23da.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.monthly-2ccfe61f.js → WEIGHT_BOYS.zscore.monthly-26f7b120.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.weekly-f6b0aad9.js → WEIGHT_BOYS.zscore.weekly-6362ab5d.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.yearly-b3f6f2fe.js → WEIGHT_BOYS.zscore.yearly-1bb66ec7.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.monthly-1caa8605.js → WEIGHT_GIRLS.percentile.monthly-18e18c37.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.weekly-6e0fce65.js → WEIGHT_GIRLS.percentile.weekly-f357be7b.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.yearly-ab90c630.js → WEIGHT_GIRLS.percentile.yearly-baec8082.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.monthly-a90d8080.js → WEIGHT_GIRLS.zscore.monthly-b3094d86.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.weekly-be79d16b.js → WEIGHT_GIRLS.zscore.weekly-5a94465d.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.yearly-3b28ae66.js → WEIGHT_GIRLS.zscore.yearly-e0a3c64a.js} +0 -0
- /package/build/{components → care/components}/atoms/textDivider/index.d.ts +0 -0
- /package/build/{cookieHelper-851ec602.js → cookieHelper-5109a4f2.js} +0 -0
- /package/build/{dataTransform-86066740.js → dataTransform-b61a062d.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.monthly-12cf3653.js → BMI_BOYS.percentile.monthly-a923fb18.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.weekly-cd5c4f2a.js → BMI_BOYS.percentile.weekly-e23d100f.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.yearly-f7cb8621.js → BMI_BOYS.percentile.yearly-9e23931d.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.monthly-3f321a88.js → BMI_BOYS.zscore.monthly-9ce5f05c.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.weekly-b1ccb020.js → BMI_BOYS.zscore.weekly-d570818b.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.yearly-e1442373.js → BMI_BOYS.zscore.yearly-7684e153.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.monthly-3e3dd1a0.js → BMI_GIRLS.percentile.monthly-b8ca45dd.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.weekly-72195163.js → BMI_GIRLS.percentile.weekly-451e30f2.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.yearly-b75f3aa1.js → BMI_GIRLS.percentile.yearly-96f009cc.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.monthly-448c9a07.js → BMI_GIRLS.zscore.monthly-ec53a919.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.weekly-f1184bc5.js → BMI_GIRLS.zscore.weekly-01f847e4.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.yearly-3b0c0841.js → BMI_GIRLS.zscore.yearly-40b42515.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.monthly-adae309b.js → HEAD CIRCUM_BOYS.percentile.monthly-cc05ce46.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.weekly-4abc16d0.js → HEAD CIRCUM_BOYS.percentile.weekly-184b46b0.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.yearly-2b27de3c.js → HEAD CIRCUM_BOYS.percentile.yearly-3fa81fa5.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.monthly-928048d0.js → HEAD CIRCUM_BOYS.zscore.monthly-2b936c65.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.weekly-ee08b060.js → HEAD CIRCUM_BOYS.zscore.weekly-9819fbfe.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.yearly-e2ddf196.js → HEAD CIRCUM_BOYS.zscore.yearly-8775cb4d.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.monthly-b97261c0.js → HEAD CIRCUM_GIRLS.percentile.monthly-a79e2170.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.weekly-1e7b10b0.js → HEAD CIRCUM_GIRLS.percentile.weekly-8abdec4f.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.yearly-001aa75b.js → HEAD CIRCUM_GIRLS.percentile.yearly-31bd302c.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.monthly-fc98dcac.js → HEAD CIRCUM_GIRLS.zscore.monthly-d0c8a30b.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.weekly-acb2c226.js → HEAD CIRCUM_GIRLS.zscore.weekly-78546079.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.yearly-842a2867.js → HEAD CIRCUM_GIRLS.zscore.yearly-8451b740.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.monthly-025c8110.js → HEIGHT_BOYS.percentile.monthly-9104bf98.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.weekly-598512e3.js → HEIGHT_BOYS.percentile.weekly-c4e8cdbb.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.yearly-2b82a8c8.js → HEIGHT_BOYS.percentile.yearly-fbba72e6.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.monthly-e0c2db06.js → HEIGHT_BOYS.zscore.monthly-f8bd1d11.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.weekly-f38a3fab.js → HEIGHT_BOYS.zscore.weekly-843af1e6.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.yearly-510e0fc3.js → HEIGHT_BOYS.zscore.yearly-6e022214.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.monthly-ebd61dd4.js → HEIGHT_GIRLS.percentile.monthly-832c4534.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.weekly-70651097.js → HEIGHT_GIRLS.percentile.weekly-f8b45685.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.yearly-e78a2253.js → HEIGHT_GIRLS.percentile.yearly-b2c3e937.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.monthly-293036dc.js → HEIGHT_GIRLS.zscore.monthly-bf6a523e.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.weekly-3aefb675.js → HEIGHT_GIRLS.zscore.weekly-aec1bc6d.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.yearly-b4f1d366.js → HEIGHT_GIRLS.zscore.yearly-a2085013.js} +0 -0
- /package/build/esm/{Onboarding-a5085557.js → Onboarding-5af7aa41.js} +0 -0
- /package/build/esm/{Visible-244eee23.js → Visible-6fd031d2.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.monthly-b2b0aad1.js → WEIGHT_BOYS.percentile.monthly-83d2c114.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.weekly-44824457.js → WEIGHT_BOYS.percentile.weekly-e0133883.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.yearly-b2d29cea.js → WEIGHT_BOYS.percentile.yearly-734253da.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.monthly-9033a5a4.js → WEIGHT_BOYS.zscore.monthly-b6ac5265.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.weekly-b893d59b.js → WEIGHT_BOYS.zscore.weekly-f166956c.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.yearly-82c340a3.js → WEIGHT_BOYS.zscore.yearly-19007035.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.monthly-26e4a0c2.js → WEIGHT_GIRLS.percentile.monthly-903cb147.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.weekly-18f825e1.js → WEIGHT_GIRLS.percentile.weekly-e141924c.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.yearly-19c9e245.js → WEIGHT_GIRLS.percentile.yearly-61057460.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.monthly-d6cd03de.js → WEIGHT_GIRLS.zscore.monthly-beb59acc.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.weekly-b5887d90.js → WEIGHT_GIRLS.zscore.weekly-d8e3e406.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.yearly-a86cf86b.js → WEIGHT_GIRLS.zscore.yearly-8a3bb4b8.js} +0 -0
- /package/build/esm/{components → care/components}/atoms/textDivider/index.d.ts +0 -0
- /package/build/esm/{cookieHelper-87efe0d2.js → cookieHelper-0382f1df.js} +0 -0
- /package/build/esm/{dataTransform-be97b21f.js → dataTransform-e257cd3d.js} +0 -0
- /package/build/esm/{index-d9fbb64d.js → index-47ab4704.js} +0 -0
- /package/build/esm/{index-dde18580.js → index-5e2209df.js} +0 -0
- /package/build/esm/{index-6798950d.js → index-ad39e5b2.js} +0 -0
- /package/build/esm/{index-2a0d9999.js → index-f8c1d9d6.js} +0 -0
- /package/build/esm/{isProduction-c4e701af.js → isProduction-1597e8ed.js} +0 -0
- /package/build/esm/{localizeNumberFormat-33083aa3.js → localizeNumberFormat-face9bb0.js} +0 -0
- /package/build/esm/{normalizeLink-1ac7cfcc.js → normalizeLink-5d28acbf.js} +0 -0
- /package/build/esm/{number-9b135fc2.js → number-a402108e.js} +0 -0
- /package/build/esm/{paths-00f55271.js → paths-e83a7594.js} +0 -0
- /package/build/esm/{screenSizeContext-e2052d31.js → screenSizeContext-662f92d9.js} +0 -0
- /package/build/esm/{theme-fd087af5.js → theme-fff94356.js} +0 -0
- /package/build/esm/{translationsContext-959b75ab.js → translationsContext-3e91995c.js} +0 -0
- /package/build/esm/{tslib.es6-15a12e4d.js → tslib.es6-d8ba5e0e.js} +0 -0
- /package/build/esm/{types-4cea16bd.js → types-5a01ab34.js} +0 -0
- /package/build/esm/{useIsInit-001e7017.js → useIsInit-e13c4b5b.js} +0 -0
- /package/build/esm/{useOutsideClick-dd2aced6.js → useOutsideClick-554f17ac.js} +0 -0
- /package/build/esm/{useScrollbarSize-83b7328b.js → useScrollbarSize-9c6ef5a1.js} +0 -0
- /package/build/{index-3ddaf646.js → index-11991307.js} +0 -0
- /package/build/{index-1b6775f7.js → index-3d525ada.js} +0 -0
- /package/build/{index-b9ebc729.js → index-7c081df1.js} +0 -0
- /package/build/{index-90515a25.js → index-de379d7d.js} +0 -0
- /package/build/{isProduction-93520986.js → isProduction-19fdda9c.js} +0 -0
- /package/build/{localizeNumberFormat-fe02153f.js → localizeNumberFormat-53cbaaf1.js} +0 -0
- /package/build/{normalizeLink-8e0bf6f7.js → normalizeLink-c3885bca.js} +0 -0
- /package/build/{number-96da5bf3.js → number-dc4d0b00.js} +0 -0
- /package/build/{paths-1394796b.js → paths-79805462.js} +0 -0
- /package/build/{screenSizeContext-fb7c716d.js → screenSizeContext-eb66c071.js} +0 -0
- /package/build/{theme-d7f6b2e4.js → theme-6b7baadc.js} +0 -0
- /package/build/{translationsContext-cb208449.js → translationsContext-20478eec.js} +0 -0
- /package/build/{tslib.es6-4b9d0a36.js → tslib.es6-15853eea.js} +0 -0
- /package/build/{types-b8882b86.js → types-2a73c8cf.js} +0 -0
- /package/build/{useIsInit-887a3738.js → useIsInit-af1d4b28.js} +0 -0
- /package/build/{useOutsideClick-86f33f79.js → useOutsideClick-4b5a27d8.js} +0 -0
- /package/build/{useScrollbarSize-6c49566b.js → useScrollbarSize-55ae5aec.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("./tslib.es6-4b9d0a36.js"),t=require("react"),a=require("@mantine/core"),l=require("./index.styled-01b8561c.js"),o=require("./useTranslations-fec480df.js"),n=require("innertext"),i=require("./theme-d7f6b2e4.js"),r=require("./index-b7a1b3cb.js"),s=require("./index-a42027c8.js");require("@mantine/dates");var d=require("./index-48216d9e.js");require("./Onboarding-7fe4d4db.js");var c=require("./gAssets.js");require("dayjs");var u=require("./screenSizeContext-fb7c716d.js");require("styled-components"),require("./isProduction-93520986.js"),require("@mantine/hooks");var m=require("./index.styles-7b879f73.js"),p=require("./index-75d9ef50.js"),v=require("./index-db80ba0c.js"),g=require("lodash/debounce"),f=require("react-contenteditable");require("./useCategory-a6ac1b1f.js");var h=require("./index-6ad602c5.js"),C=require("react-dom");function y(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function E(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(a){if("default"!==a){var l=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,l.get?l:{enumerable:!0,get:function(){return e[a]}})}})),t.default=e,Object.freeze(t)}require("./constants-31450bc5.js");var w=y(t),k=y(n),b=y(g),P=y(f),T=E(C);const S=({title:o,url:n,image:i,logo:s,className:d,style:c,noRefetch:u})=>{const{data:{locale:p,env:{isMarryBaby:v}}}=t.useContext(m.TogetherComponentGlobalContext),[g,f]=t.useState(!1),h=a.useMantineTheme(),C=t.useRef(u);C.current=u;const[y,E]=t.useState(null);t.useEffect((()=>{e.__awaiter(void 0,void 0,void 0,(function*(){if(!C.current){if(!n)return E(null);E((e=>Object.assign(Object.assign({},e),{isFetching:!0}))),m.callApi(m.getApiPath(m.PATHS.FETCH_PREVIEW,{_locale:p}),"POST",{data:{link:n},headers:{"Content-Type":"application/json"}}).then((e=>{var t,a,l;f(!1),E({title:null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.title,url:n,image:(null===(a=null==e?void 0:e.data)||void 0===a?void 0:a.image)||(null===(l=null==e?void 0:e.data)||void 0===l?void 0:l.logo)})})).catch((()=>{E(null)}))}}))}),[n]);const k=(null==y?void 0:y.image)||i,b=(null==y?void 0:y.title)||o,P=(null==y?void 0:y.logo)||s,T=(null==y?void 0:y.url)||n,S=T.replace("http://","").replace("https://","").split(/[/?#]/)[0],x=t.useRef(!1);return w.default.createElement(l.StyledCardLink,{"data-is-marrybaby":v,className:`${d} no-replace-click`,style:c,color:h.colors[h.primaryColor][0]},w.default.createElement("a",{href:T,target:"_blank",rel:"noreferrer"},k&&w.default.createElement("div",{className:"link-image-wrapper"},!v&&w.default.createElement("img",{className:"link-image-blur",src:k,onError:e=>{x.current||(x.current=!0,e.currentTarget.src=m.DEFAULT_IMG)},loading:"lazy"}),w.default.createElement("img",{className:"link-image",src:k,onError:e=>{x.current||(x.current=!0,e.currentTarget.src=m.DEFAULT_IMG)},loading:"lazy"})),w.default.createElement("div",{className:"link-info-container"},w.default.createElement(r.Text,{size:"n1"},v&&P&&!g&&w.default.createElement("img",{className:"link-logo",src:P,onError:()=>f(!0),loading:"lazy"}),S),w.default.createElement(m.Heading,{tag:"h6"},b))))};const x=({onClick:e,color:a,className:n,style:i})=>{const{data:{env:{isMarryBaby:r}}}=t.useContext(m.TogetherComponentGlobalContext),{t:s}=o.useTranslations();return w.default.createElement(l.LabelSortPin,{label:w.default.createElement(w.default.Fragment,null,r&&w.default.createElement("img",{className:"label-sort-pin-icon",src:"data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cpath d='M3.5 19.9999L7.87 15.6299' stroke='%23FB8C00' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e %3cpath fill-rule='evenodd' clip-rule='evenodd' d='M4.95634 11.294C4.56534 11.685 4.56534 12.318 4.95634 12.708L7.87434 15.626L10.7923 18.544C11.1833 18.935 11.8163 18.935 12.2063 18.544L13.3813 17.369C13.5693 17.181 13.6743 16.927 13.6743 16.662V12.726L16.5743 9.82597L18.8833 9.94897C19.1663 9.96397 19.4433 9.85797 19.6433 9.65797L20.2173 9.08397C20.6083 8.69297 20.6083 8.05997 20.2173 7.66997L15.8313 3.28397C15.4403 2.89297 14.8073 2.89297 14.4173 3.28397L13.8433 3.85797C13.6423 4.05897 13.5363 4.33497 13.5523 4.61797L13.6753 6.92697L10.7753 9.82697H6.83834C6.57334 9.82697 6.31834 9.93197 6.13134 10.12L4.95634 11.294V11.294Z' stroke='%23FB8C00' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e %3cpath d='M16.5699 9.83018L13.6699 6.93018' stroke='%23FB8C00' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e %3c/svg%3e",loading:"lazy"})," ",s("label.pinnedPost")),rightLabel:!r&&w.default.createElement("img",{className:"label-sort-pin-icon",src:"data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cline x1='7.18605' y1='7.68219' x2='3.68219' y2='13.8139' stroke='%23FEA21E' stroke-linecap='round'/%3e%3cpath d='M3.24591 7.78426C3.21275 7.84168 3.20376 7.90993 3.22092 7.97398C3.23808 8.03803 3.27998 8.09264 3.3374 8.12579L8.78429 11.2706C8.90385 11.3396 9.05674 11.2986 9.12578 11.1791C9.71191 10.1641 9.71348 8.97262 9.23682 7.99339L10.8583 5.18521C11.5115 5.00603 12.0982 4.57973 12.4638 3.94629C12.5328 3.82672 12.4919 3.67383 12.3723 3.6048L8.18237 1.18584C8.12494 1.15268 8.0567 1.1437 7.99265 1.16086C7.92861 1.17803 7.874 1.21993 7.84086 1.27736C7.47521 1.91077 7.39934 2.63194 7.57065 3.28723L5.94919 6.09545C4.86323 6.1723 3.83201 6.76934 3.24591 7.78426Z' fill='%23FEA21E' stroke='%23FEA21E' stroke-width='0.5' stroke-linejoin='round'/%3e%3c/svg%3e",loading:"lazy"}),onClick:e,color:"white",className:`label-pinned ${n}`,style:i})},N=e=>({message:e("notification.failure"),type:"danger"});var A="data:image/svg+xml,%3csvg width='16' height='17' viewBox='0 0 16 17' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M8 14.5C11.3137 14.5 14 11.8137 14 8.5C14 5.18629 11.3137 2.5 8 2.5C4.68629 2.5 2 5.18629 2 8.5C2 11.8137 4.68629 14.5 8 14.5Z' fill='%23FE921D'/%3e%3cpath d='M8 5.5V8.5' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M8 11.5H8.00708' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e";const I=(e,a)=>{const[l,o]=t.useState(e||[]);return{onSelectImages:t=>{const n=t.target.files;if(n)if(a&&e){a((e||l).concat(Array.from(n)))}else o((t=>{const l=e||t;return a&&a(l.concat(Array.from(n))),l.concat(Array.from(n))}))},onRemoveImage:t=>{if(a&&e){const l=e;l.splice(t,1),a(l.slice())}else o((l=>{const o=e||l;return o.splice(t,1),a&&a(o.slice()),o.slice()}))},onRemoveAllImages:()=>{a?a([]):o([])},imageSrcs:t.useMemo((()=>(e||l).map((e=>"string"==typeof e?e:URL.createObjectURL(e)))),[e,l]),imageFiles:e||l}};var _="data:image/svg+xml,%3csvg width='24' height='25' viewBox='0 0 24 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 22.9844C17.5228 22.9844 22 18.5072 22 12.9844C22 7.46153 17.5228 2.98438 12 2.98438C6.47715 2.98438 2 7.46153 2 12.9844C2 18.5072 6.47715 22.9844 12 22.9844Z' fill='%23262626'/%3e%3cpath d='M14.8281 10.1562L9.17127 15.8131' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M9.17188 10.1562L14.8287 15.8131' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e";const M=({className:e,style:a,bannedWords:n=[],value:s,onChange:d,onPreviewUrlChange:c,onInvalidUrlsChange:u,onImageFilesChange:p,imageFiles:v,isReplying:g})=>{const{t:f}=o.useTranslations(),[h,C]=t.useState(null),y=t.useRef(null),{onSelectImages:E,onRemoveImage:b,imageSrcs:P}=I(v,p);return t.useEffect((()=>{c&&((null==h?void 0:h.url)?c({title:h.title||"",url:h.url||"",image:h.image||"",description:h.description||""}):c(null))}),[h]),w.default.createElement(l.StyledCreatePostDescription,{className:e,style:a},w.default.createElement(r.Text,{size:"p4",className:"description-label"},f("createPost.popup.description")),w.default.createElement("div",{className:"textarea-control"},w.default.createElement("div",{className:"textarea-wrapper"},w.default.createElement(l.RichTextEditor,{html:s||"",onChange:d,bannedWords:n,onImagePickerClick:()=>{var e;return null===(e=y.current)||void 0===e?void 0:e.click()},onPreviewUrlChange:C,onInvalidUrlsChange:u,isReplying:g}))),w.default.createElement(r.Text,{size:"p4",className:"count-string"},f("character"),": ",k.default(s||"").length),(!P||0===P.length)&&h&&w.default.createElement("div",{className:"link-preview-wrapper"},h.isFetching?w.default.createElement(l.Loading,null):w.default.createElement(w.default.Fragment,null,w.default.createElement(S,{title:h.title,url:h.url||"#",image:h.image,noRefetch:!0}),w.default.createElement("img",{src:_,className:"icon-close",onClick:()=>C(null),loading:"lazy"}))),w.default.createElement("input",{ref:y,type:"file",accept:"image/png, image/gif, image/jpeg",multiple:!0,style:{display:"none"},onChange:E}),P.length>m.MAX_IMAGE_UPLOADS?w.default.createElement("div",{className:"input-notification"},w.default.createElement("img",{src:A,loading:"lazy"}),w.default.createElement(r.Text,{size:"p4",color:i.theme.colors.alertWarning},f("createPost.popup.warningImage"))):null,P.length>0&&w.default.createElement("div",{className:"image-gallery"},P.map(((e,t)=>w.default.createElement("div",{key:t,className:"image-item"},w.default.createElement("img",{src:e,loading:"lazy"}),w.default.createElement("img",{className:"close-btn",src:_,onClick:()=>b(t),loading:"lazy"}))))))},L=(e,t)=>{if(!t)return e;const{limit:a,bannedWords:o=[]}=t,n="number"==typeof a&&a>=0?e.substring(0,a):e;return l.highlightBadWords(n,o)},j=({className:e,style:a,bannedWords:n=[],value:i,onChange:s})=>{var d;const{t:c}=o.useTranslations(),[u,m]=t.useState(""),p=t.useRef(null);t.useEffect((()=>{if(p.current){const e=e=>{var t;e.preventDefault();const a=null===(t=e.clipboardData)||void 0===t?void 0:t.getData("text/plain");document.execCommand("insertHTML",!1,a)},t=p.current;return t.addEventListener("paste",e,{passive:!0}),()=>t.removeEventListener("paste",e)}}),[p]);const g=(null==n?void 0:n.join(","))||"";t.useEffect((()=>{var e;if(g){const t=null===(e=p.current)||void 0===e?void 0:e.innerText;if(t){const e=l.highlightBadWords(t,n);e!==t&&(s&&s(e),m(e))}}}),[g]);const f=t.useCallback(b.default((()=>{if(p.current){const e=L(p.current.innerText,{limit:120,bannedWords:n});s&&s(e),m(e)}}),300),[]);return t.useEffect((()=>{setTimeout((()=>{var e;null===(e=p.current)||void 0===e||e.focus()}),500)}),[]),w.default.createElement(l.StyledCreatePostTitle,{className:e,style:a},w.default.createElement(v.Input,{name:"title",value:i||u,size:"md",label:c("createPost.title"),CustomInput:w.default.createElement(P.default,{innerRef:p,html:i||u,onChange:()=>{if(p.current&&p.current.innerText!==(i||u)){const e=L(p.current.innerText,{bannedWords:n});s&&s(e),m(e),f()}},className:"title-input"})}),w.default.createElement(r.Text,{size:"p4",className:"count-string"},c("createPost.popup.wordCount",{count:(null===(d=p.current)||void 0===d?void 0:d.innerText.length)||0,max:120})))},R=({className:a,style:o,topics:n,communityId:i,onChange:r,isLoading:s,disabled:d,forceTopics:c,selectedTopics:u,noFetch:v,dataEventCategory:g,dataEventAction:f,dataEventLabel:h})=>{const{data:{locale:C,env:{isMarryBaby:y}}}=t.useContext(m.TogetherComponentGlobalContext),[E,k]=t.useState(n?[...n]:[]),[b,P]=t.useState(u?[...u]:[]),[T,S]=t.useState(!1),x=t.useRef(n);x.current=n,t.useEffect((()=>{var t;!i||v||(null===(t=x.current)||void 0===t?void 0:t.length)||(k([]),S(!0),e.__awaiter(void 0,void 0,void 0,(function*(){var e;try{const t=yield m.callApi(m.getApiPath(m.PATHS.TOPIC.LIST,{communityId:i,_locale:C}),"GET"),a=null===(e=null==t?void 0:t.data)||void 0===e?void 0:e.topics;Array.isArray(a)&&k((()=>(null==a?void 0:a.map(p.formatTopic).sort(((e,t)=>(e.order||0)-(t.order||0))))||[]))}catch(e){console.log(e),S(!1)}S(!1)})))}),[i,v]);const N=null==n?void 0:n.map((e=>e.id)).join("-"),A=null==E?void 0:E.map((e=>e.id)).join("-"),I=null==c?void 0:c.map((e=>e.id)).join("-");t.useEffect((()=>{n&&void 0!==N&&N!==A&&k(n)}),[n,N,A]);const _=t.useMemo((()=>E.filter((e=>!(null==c?void 0:c.some((t=>t.id&&t.id===e.id||t.mappedCategoryId&&t.mappedCategoryId===e.mappedCategoryId)))))),[A,I]);return w.default.createElement(l.StyledTopicSelectList,{"data-is-marrybaby":y,className:a,style:o},c.map((e=>w.default.createElement(B,{key:`${e.id}-${e.mappedCategoryId}`,topic:e,disabled:!0,selected:!0,dataEventAction:f,dataEventCategory:g,dataEventLabel:h}))),_.map((e=>w.default.createElement(B,{key:`${e.id}-${e.mappedCategoryId}`,topic:e,disabled:d,selected:(u||b).some((t=>t.id&&t.id===e.id||t.mappedCategoryId&&t.mappedCategoryId===e.mappedCategoryId)),onClick:()=>{const t=u||b,a=t.findIndex((t=>t.id&&t.id===e.id||t.mappedCategoryId&&t.mappedCategoryId===e.mappedCategoryId));-1!==a?t.splice(a,1):t.push(e),r&&u?r(t.slice()):(r&&r(t.slice()),P(t.slice()))},dataEventAction:f,dataEventCategory:g,dataEventLabel:h}))),(s||T)&&w.default.createElement(l.Loading,{className:"topic-spinner"}))},B=t=>{var{topic:a,disabled:l,selected:o,onClick:n}=t,i=e.__rest(t,["topic","disabled","selected","onClick"]);return w.default.createElement("div",Object.assign({className:"tag-item"+(o?" --active":""),"data-disabled":l,onClick:l?void 0:n},i),a.name)},O=({className:e,isMarryBaby:a,style:o,title:n,description:i,acceptText:s,cancelText:d,onAccept:c,onCancel:p,thumbnail:v,isThumbnailIcon:g,onClose:f,acceptBtnTracking:C,acceptBtnProps:y,cancelBtnProps:E})=>{const{data:{env:{isMarryBaby:k}}}=t.useContext(m.TogetherComponentGlobalContext),b="boolean"==typeof a?a:k,[P,S]=t.useState(!1);return t.useEffect((()=>(u.toggleNoScroll(!0),setTimeout((()=>S(!0)),0),()=>u.toggleNoScroll(!1))),[]),"undefined"==typeof window?null:T.createPortal(w.default.createElement(l.StyledPopupDanger,{"data-is-marrybaby":b,className:e,style:o,"data-open":P},w.default.createElement(l.PopupFrame,{className:"popup-frame",isOpen:P,onClose:f},w.default.createElement("div",{className:"confirm-dialog",onClick:e=>e.stopPropagation()},w.default.createElement("div",{className:"confirm-content"},v&&w.default.createElement("div",{className:"thumbnail-container "+(g?"is-icon":"")},w.default.createElement("img",{className:"thumbnail",src:v,loading:"lazy"})),w.default.createElement(m.Heading,{className:"title",tag:"h2"},n),w.default.createElement(r.Text,{className:"desc",size:"lg"},i),w.default.createElement("div",{className:"btn-group"},w.default.createElement(h.Button,Object.assign({theme:b?"marryBaby":"helloSites",size:"md",color:"tertiary",onClick:()=>{null==c||c(),null==f||f()}},y,C),s),w.default.createElement(h.Button,Object.assign({theme:b?"marryBaby":"helloSites",size:"md",onClick:()=>{null==p||p(),null==f||f()}},E),d)))),b&&v&&w.default.createElement("div",{className:"thumbnail-container is-mobile "+(g?"is-icon":"")},w.default.createElement("img",{className:"thumbnail",src:v,loading:"lazy"})))),u.getPopupWrapperDom())};const z=({isReply:a,className:n,onClose:i,replyToName:s,style:d,replyingId:c,replyingUser:u,onPostSuccess:g,post:f,isMarryBaby:C})=>{const{action:{pushNotifications:y,sanitizeFunction:E},data:{userInfo:k,locale:b,env:{isMarryBaby:P}}}=t.useContext(m.TogetherComponentGlobalContext),T="boolean"==typeof C?C:P,{t:x}=o.useTranslations(),{onSelectImages:N,onRemoveImage:A,imageSrcs:M,onRemoveAllImages:L,imageFiles:j}=I(),[R,B]=t.useState(""),{trigger:O}=t.useContext(l.MainInputTriggerContext),[z,D]=t.useState(!1),F=t.useRef(null),U=t.useRef(null),H=t.useRef(null),[W,V]=t.useState([]),[$,G]=t.useState([]),[q,Z]=t.useState(null);return t.useEffect((()=>{var e;null===(e=H.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"start"}),setTimeout((()=>{var e;null===(e=U.current)||void 0===e||e.focus()}),400)}),[O]),w.default.createElement(l.StyledInputCommentBar,{"data-is-reply":a,className:n,style:d},a&&w.default.createElement("div",{className:"reply-to-container"},w.default.createElement(r.Text,{size:"p4"},w.default.createElement("span",{dangerouslySetInnerHTML:{__html:x("inputComment.replyTo",{name:`<span style="color: #2D87F3; cursor: pointer">@${s||""}</span>`})}})),w.default.createElement("img",{src:"data:image/svg+xml,%3csvg width='16' height='17' viewBox='0 0 16 17' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8.00016' cy='8.50004' r='6.66667' fill='white' stroke='%23404040'/%3e%3cpath d='M10 6.5L6 10.5' stroke='%23404040' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M6 6.5L10 10.5' stroke='%23404040' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",className:"icon-close-comment",onClick:()=>i&&i(),loading:"lazy"})),w.default.createElement("div",{className:"input-container",ref:H},w.default.createElement(p.UserAvatar,{className:"avatar-wrapper "+(a?"avatar-wrapper-reply":""),avatar:(null==k?void 0:k.id)?k.avatar:m.DEFAULT_AVATAR_IMG,username:(null==k?void 0:k.name)||(null==k?void 0:k.username)}),w.default.createElement("input",{ref:F,onChange:N,type:"file",multiple:!0,accept:"image/png,image/jpeg",name:"images",style:{display:"none"}}),w.default.createElement(v.Input,{value:R,name:"input",size:"md",className:"input-wrapper",displayIcon:w.default.createElement("img",{src:"data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M10.7543 4.85352H4.49227C4.01776 4.85352 3.56268 5.04201 3.22715 5.37754C2.89162 5.71307 2.70313 6.16815 2.70312 6.64266V19.1667C2.70313 19.6412 2.89162 20.0963 3.22715 20.4318C3.56268 20.7673 4.01776 20.9558 4.49227 20.9558H17.0163C17.4908 20.9558 17.9459 20.7673 18.2814 20.4318C18.6169 20.0963 18.8054 19.6412 18.8054 19.1667V12.9047' stroke='%232D87F3' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M17.4633 3.51187C17.8192 3.15599 18.3019 2.95605 18.8052 2.95605C19.3085 2.95605 19.7912 3.15599 20.147 3.51187C20.5029 3.86775 20.7029 4.35044 20.7029 4.85373C20.7029 5.35702 20.5029 5.83971 20.147 6.19559L11.6486 14.694L8.07031 15.5886L8.96489 12.0103L17.4633 3.51187Z' stroke='%232D87F3' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",loading:"lazy"}),CustomInput:w.default.createElement("div",{className:"as-input"},w.default.createElement(l.RichTextEditor,{className:"textarea",html:R,onChange:B,onImagePickerClick:()=>{var e;return null===(e=F.current)||void 0===e?void 0:e.click()},bannedWords:$,onPreviewUrlChange:Z,onInvalidUrlsChange:V,setEditorRef:e=>U.current=e,isReplying:a}))}),w.default.createElement(h.Button,{theme:T?"marryBaby":"helloSites",className:"send-button",size:"sm",onClick:()=>e.__awaiter(void 0,void 0,void 0,(function*(){var t,o,n,r,s,d,v,h,C;if((null==f?void 0:f.id)&&!z){D(!0);try{const w=e=>{B(""),L(),i&&i();const t=p.formatComment(e.data);"string"==typeof t.images&&(t.images=JSON.parse(t.images)),g&&g(t)},k=yield(({postId:t,message:a,photos:o,link:n,locale:i,sanitizeFunction:r,replyingUserId:s,replyingUserName:d,replyingId:c})=>e.__awaiter(void 0,void 0,void 0,(function*(){const e=new FormData;let u=l.encodePostContent(a.replace(/(\ )+/g," "),r);const p=l.getMentionIdsFromString(u);return o&&o.length>0&&(yield Promise.all(null==o?void 0:o.map((e=>l.uploadAndGetSrc(e,i))))).filter(Boolean).slice(0,m.MAX_IMAGE_UPLOADS).forEach((t=>{e.append("images[]",t)})),n&&e.append("link",n),null==p||p.forEach((t=>{e.append("mention_ids[]",t)})),e.append("post_id",t),c&&e.append("parent_id",c),s&&(p.unshift(s),u=`[mention+id="${s}"+name="${(d||"").replace('"',"'")}"]${u}`,e.append("parent_user_id",String(s))),e.append("content",u),e.append("content",u),e})))(Object.assign({message:R,photos:j,postId:String(f.id),link:null==q?void 0:q.url,sanitizeFunction:E,locale:b},a&&c?{replyingUserId:String((null==u?void 0:u.id)||(null===(t=null==f?void 0:f.author)||void 0===t?void 0:t.id)||""),replyingId:c,replyingUserName:(null==u?void 0:u.name)||(null==u?void 0:u.username)||""}:{})),P=yield a&&c?((t,a)=>e.__awaiter(void 0,void 0,void 0,(function*(){return m.callApiWithAuth(m.getApiPath(m.PATHS.COMMENT.REPLY,{_locale:a}),"POST",{data:t})})))(k,b):((t,a)=>e.__awaiter(void 0,void 0,void 0,(function*(){return m.callApiWithAuth(m.getApiPath(m.PATHS.COMMENT.CREATE,{_locale:a}),"POST",{data:t})})))(k,b),T=null==P?void 0:P.data;(null==T?void 0:T.id)&&!(null===(n=null===(o=null==P?void 0:P.messages)||void 0===o?void 0:o.moderation)||void 0===n?void 0:n.type)?w(P):"banned"===(null===(s=null===(r=null==P?void 0:P.messages)||void 0===r?void 0:r.moderation)||void 0===s?void 0:s.type)?(y({title:x("notification.comment.blocked.title"),message:x("notification.comment.blocked.message"),type:"danger"}),P.messages.moderation.words&&G(P.messages.moderation.words)):"suspect"===(null===(v=null===(d=null==P?void 0:P.messages)||void 0===d?void 0:d.moderation)||void 0===v?void 0:v.type)?(y({title:x("notification.comment.suspect.title"),message:x("notification.comment.suspect.message"),type:"warning"}),B(""),L(),i&&i()):(null===(h=null==P?void 0:P.messages)||void 0===h?void 0:h.find((e=>{var t;return!!(null===(t=null==e?void 0:e.includes)||void 0===t?void 0:t.call(e,"suspend"))})))?(y({message:x("notification.suspend.message"),type:"warning"}),B(""),L(),i&&i()):y({title:"",message:(null===(C=null==P?void 0:P.messages)||void 0===C?void 0:C[0])||x("notification.comment.somethingWrong"),type:"danger"})}catch(e){y({title:"",message:x("notification.comment.somethingWrong"),type:"danger"})}D(!1)}})),isLoading:z,isDisabled:!!(null==W?void 0:W.length)||z||!R||(null==R?void 0:R.length)<2||!R.trim()},w.default.createElement("img",{src:"data:image/svg+xml,%3csvg width='20' height='21' viewBox='0 0 20 21' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M7.5 9.73438L3.75 13.4844L7.5 17.2344' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M16.25 4.73438L16.25 10.3026C16.25 11.1464 15.9208 11.9557 15.3347 12.5524C14.7487 13.1491 13.9538 13.4844 13.125 13.4844L3.75 13.4844' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",className:"icon-enter",loading:"lazy"}))),(null==W?void 0:W.length)?w.default.createElement("div",{className:"error-text"},x("notification.limitUrlDomain")):null,(!M||0===M.length)&&q&&w.default.createElement("div",{className:"link-preview-wrapper"},q.isFetching?w.default.createElement(l.Loading,null):w.default.createElement(w.default.Fragment,null,w.default.createElement(S,{title:q.title,url:q.url||"#",image:q.image,noRefetch:!0}),w.default.createElement("img",{src:_,className:"icon-close",onClick:()=>Z(null),loading:"lazy"}))),M&&M.length>0&&w.default.createElement("div",{className:"preview-images-container"},M.map(((e,t)=>w.default.createElement("div",{key:t,className:"image-src-wrapper"},w.default.createElement("img",{className:"preview-image",src:e,loading:"lazy"}),w.default.createElement("img",{src:_,className:"icon-close-circle",onClick:()=>A(t),loading:"lazy"}))))))};var D="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M8 14C11.3137 14 14 11.3137 14 8C14 4.68629 11.3137 2 8 2C4.68629 2 2 4.68629 2 8C2 11.3137 4.68629 14 8 14Z' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M8 5V8' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M8 11H8.00708' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e";const F=({className:a,style:n,reason:s,reasonText:d,onClose:c,postId:u})=>{const{data:{locale:p,env:{isMarryBaby:v}},action:{pushNotifications:g}}=t.useContext(m.TogetherComponentGlobalContext),{t:f}=o.useTranslations(),[C,y]=t.useState(!1);return w.default.createElement(l.StyledSubmitReportForm,{"data-is-marrybaby":v,className:a,style:n},w.default.createElement("ul",{className:"report-list"},w.default.createElement("li",{className:"report-item"},w.default.createElement("img",{src:D,loading:"lazy"}),w.default.createElement(r.Text,{className:"__label",color:i.theme.colors.gray800,size:"p4"},d))),w.default.createElement(h.Button,{theme:v?"marryBaby":"helloSites",className:"report-submit",size:"lg",color:"primary",isLoading:C,onClick:()=>e.__awaiter(void 0,void 0,void 0,(function*(){if(u&&!C){y(!0);try{const e=yield(({id:e,reason:t,locale:a})=>{const l=new FormData;return l.append("reason",t),m.callApiWithAuth(m.getApiPath(m.PATHS.POST.REPORT,{_locale:a,id:e}),"POST",{data:l})})({id:u,reason:s,locale:p});1===(null==e?void 0:e.status)&&(g({message:"Post reported",type:"success"}),c&&c())}catch(e){}y(!1)}}))},f("submit")))};const U=({className:e,style:n,authorName:i,images:s,onClose:d,onOpenSingleView:c,alt:u})=>{const{t:m}=o.useTranslations(),[p,v]=t.useState(!1);return t.useEffect((()=>{setTimeout((()=>{v(!0)}),0)}),[]),w.default.createElement(a.Portal,null,w.default.createElement(l.StyledImagePreviewPopup,{className:e,style:n,"data-open":p},w.default.createElement("div",{className:"top-bar"},w.default.createElement("img",{className:"icon-arrow-left",src:"data:image/svg+xml,%3csvg width='24' height='25' viewBox='0 0 24 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M10.0508 18.0607L4.00078 12.0367L10.0508 6.01172' stroke='%23262626' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M4.00195 12.0352L19.002 12.0352' stroke='%23262626' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",onClick:d,alt:"go back",loading:"lazy"}),w.default.createElement(r.Text,{size:"p2",weight:"bold",style:{textAlign:"center"}},m("previewPhotos.title",{name:i}))),w.default.createElement("div",{className:"container"},s.map(((e,t)=>w.default.createElement("img",{className:"img-preview",key:t,src:e,onClick:()=>null==c?void 0:c(t),alt:u,loading:"lazy"}))))),",")};var H="data:image/svg+xml,%3csvg width='16' height='17' viewBox='0 0 16 17' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M6 12.8125L10 8.8125L6 4.8125' stroke='white' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e";const W=({initialViewIndex:e,images:o,onClose:n,alt:i})=>{const[r,s]=t.useState(e),[d,c]=t.useState(!1);t.useEffect((()=>{setTimeout((()=>{c(!0)}),0)}),[]);const u=null==o?void 0:o[r],m=0===r,p=!(null==o?void 0:o.length)||r===(null==o?void 0:o.length)-1;return w.default.createElement(a.Portal,null,w.default.createElement(l.StyledImagePreviewContainer,{"data-open":d&&!!u},w.default.createElement(l.StyledImagePreviewTopbar,null,w.default.createElement("img",{src:l.img,className:"icon-close",onClick:n,alt:"close",loading:"lazy"})),u&&r>=0&&w.default.createElement(w.default.Fragment,null,w.default.createElement(l.StyledImagePreviewWrapper,null,w.default.createElement("img",{className:"img-preview",src:u,alt:i,loading:"lazy"}),w.default.createElement(l.StyledArrowWrapper,{"data-disabled":m,onClick:()=>!m&&s(r-1)},w.default.createElement(l.StyledCircleArrow,null,w.default.createElement("img",{src:H,style:{transform:"rotate(180deg)"},alt:"left arrow","data-disabled":m,loading:"lazy"}))),w.default.createElement(l.StyledArrowWrapper,{"data-right":!0,"data-disabled":p,onClick:()=>!p&&s(r+1)},w.default.createElement(l.StyledCircleArrow,null,w.default.createElement("img",{src:H,alt:"right arrow","data-disabled":p,loading:"lazy"})))))))},V=({image:e,showIcon:a=!0})=>{const[o,n]=t.useState(!0);return w.default.createElement(l.StyledWrapper,{"data-is-blurred":o,onClick:e=>o&&e.stopPropagation()},w.default.createElement("img",{loading:"lazy",className:"img-preview",src:e}),w.default.createElement(l.StyledInner,{onClick:e=>{e.stopPropagation(),n(!o)}},a&&w.default.createElement(l.StyledIcon,null,o?w.default.createElement("svg",{width:"22",height:"20",viewBox:"0 0 22 20",fill:"none"},w.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.71 2.5399C1.32 2.1499 1.32 1.5199 1.71 1.1299C2.1 0.739902 2.74 0.739902 3.13 1.1299L19.44 17.4599C19.83 17.8499 19.83 18.4799 19.44 18.8699C19.05 19.2599 18.42 19.2599 18.03 18.8699L15.31 16.1499C13.97 16.6699 12.52 16.9699 11 16.9699C6 16.9699 1.73 13.8599 0 9.4699C0.77 7.4999 2.06 5.7999 3.68 4.5099L1.71 2.5399ZM16 9.4699C16 6.7099 13.76 4.4699 11 4.4699C10.49 4.4699 10 4.5699 9.53 4.7099L7.36 2.5399C8.51 2.1699 9.73 1.9699 11 1.9699C16 1.9699 20.27 5.0799 22 9.4599C21.31 11.2199 20.21 12.7599 18.82 13.9899L15.76 10.9299C15.9 10.4699 16 9.9799 16 9.4699ZM11 14.4699C8.24 14.4699 6 12.2299 6 9.4699C6 8.6999 6.18 7.9699 6.49 7.3299L8.06 8.8999C8.03 9.0799 8 9.2699 8 9.4699C8 11.1299 9.34 12.4699 11 12.4699C11.2 12.4699 11.38 12.4399 11.57 12.3999L13.14 13.9699C12.49 14.2899 11.77 14.4699 11 14.4699ZM13.97 9.1399C13.82 7.7399 12.72 6.6499 11.33 6.4999L13.97 9.1399Z",fill:"white"})):w.default.createElement("svg",{width:"23",height:"16",viewBox:"0 0 23 16",fill:"none"},w.default.createElement("path",{d:"M11.9999 0C5.14188 0 1.88558 5.87864 1.09558 7.55664C0.963582 7.83664 0.963582 8.16141 1.09558 8.44141C1.88558 10.1204 5.14188 16 11.9999 16C18.8339 16 22.0924 10.1629 22.8964 8.46094C23.0344 8.16794 23.0344 7.83206 22.8964 7.53906C22.0924 5.83706 18.8339 0 11.9999 0ZM11.9999 3C14.7609 3 16.9999 5.239 16.9999 8C16.9999 10.761 14.7609 13 11.9999 13C9.23888 13 6.99988 10.761 6.99988 8C6.99988 5.239 9.23888 3 11.9999 3ZM11.9999 5C11.2042 5 10.4412 5.31607 9.87856 5.87868C9.31595 6.44129 8.99988 7.20435 8.99988 8C8.99988 8.79565 9.31595 9.55871 9.87856 10.1213C10.4412 10.6839 11.2042 11 11.9999 11C12.7955 11 13.5586 10.6839 14.1212 10.1213C14.6838 9.55871 14.9999 8.79565 14.9999 8C14.9999 7.20435 14.6838 6.44129 14.1212 5.87868C13.5586 5.31607 12.7955 5 11.9999 5Z",fill:"#2D87F3"})))))},$=({className:e,images:a=[],style:n,authorName:i,isSensitive:r=!1,alt:s})=>{const{data:{env:{isMarryBaby:d}}}=t.useContext(m.TogetherComponentGlobalContext),{t:c}=o.useTranslations(),p="+ "+((a.length||0)-4),[v,g]=t.useState(!1),[f,h]=t.useState(-1),C=a.length>5,y=t.useRef(!1);return t.useEffect((()=>()=>{y.current&&u.toggleNoScroll(!1)}),[]),t.useEffect((()=>{v||f>=0?(u.toggleNoScroll(!0),y.current=!0):(u.toggleNoScroll(!1),y.current=!1)}),[v,f]),w.default.createElement(w.default.Fragment,null,r&&w.default.createElement(l.StyledNotificationBar,{message:c("sensitiveMask.contentWarningDescription"),icon:w.default.createElement("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none"},w.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.00002 0.666748C4.40002 0.666748 0.666687 4.40008 0.666687 9.00008C0.666687 13.6001 4.40002 17.3334 9.00002 17.3334C13.6 17.3334 17.3334 13.6001 17.3334 9.00008C17.3334 4.40008 13.6 0.666748 9.00002 0.666748ZM9.00002 9.83341C8.54169 9.83341 8.16669 9.45841 8.16669 9.00008V5.66675C8.16669 5.20842 8.54169 4.83342 9.00002 4.83342C9.45835 4.83342 9.83335 5.20842 9.83335 5.66675V9.00008C9.83335 9.45841 9.45835 9.83341 9.00002 9.83341ZM8.16669 11.5001V13.1667H9.83335V11.5001H8.16669Z",fill:"#FE921D"}))}),w.default.createElement(l.StyledPostImagePreview,{className:e,style:n,"data-image-count":C?5:a.length||0,"data-is-marrybaby":d,"data-cursor-pointer":!r},null==a?void 0:a.slice(0,5).map(((e,t)=>{const a=4===t&&C;return w.default.createElement("div",{className:"img-wrapper",key:t,onClick:()=>{t>=4&&C?g(!0):h(t)}},r&&w.default.createElement(V,{image:e,showIcon:!a}),!d&&w.default.createElement("img",{loading:"lazy",className:"img-preview-blur",src:e,alt:s}),w.default.createElement("img",{loading:"lazy",className:"img-preview",src:e,alt:s}),a&&w.default.createElement("div",{className:"img-more-overlay"},w.default.createElement(m.Heading,{tag:"h1",as:"h2",color:"white"},p)))}))),v&&w.default.createElement(U,{authorName:i||"",images:a,onClose:()=>g(!1),onOpenSingleView:h,alt:s}),f>=0&&w.default.createElement(W,{images:a,initialViewIndex:f,onClose:()=>h(-1),alt:s}))},G=({url:o,image:n,className:i,style:r,autoPlay:d=!0})=>{const{data:{locale:c}}=t.useContext(m.TogetherComponentGlobalContext),[u,p]=t.useState(null);t.useEffect((()=>{e.__awaiter(void 0,void 0,void 0,(function*(){if(!n){if(!o)return p(null);p((e=>Object.assign(Object.assign({},e),{isFetching:!0}))),m.callApi(m.getApiPath(m.PATHS.FETCH_PREVIEW,{_locale:c}),"POST",{data:{link:o},headers:{"Content-Type":"application/json"}}).then((e=>{var t,a;p({url:o,image:(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.image)||(null===(a=null==e?void 0:e.data)||void 0===a?void 0:a.logo)})})).catch((()=>{p(null)}))}}))}),[o,n]);const v=n||(null==u?void 0:u.image),g=(null==u?void 0:u.url)||o,f=t.useMemo((()=>l.youtubeVidIdGetter(g)),[g]),h=t.useMemo((()=>g.includes("facebook.com")||g.includes("fb.watch")),[g]),C=t.useRef(0),y=t.useRef(0),[E,k]=t.useState(!1);t.useEffect((()=>{const e=()=>{var e;const t=null===(e=b.current)||void 0===e?void 0:e.getBoundingClientRect();let a=!1;t&&(!C.current||Math.abs((C.current-t.width)/(null==t?void 0:t.width))>.2)&&(C.current=Math.floor(t.width),a=!0),t&&(!y.current||Math.abs((y.current-t.height)/(null==t?void 0:t.height))>.2)&&(y.current=Math.floor(t.height),a=!0),a&&k((e=>!e))};return e(),window.addEventListener("resize",e,{passive:!0}),()=>{window.removeEventListener("resize",e)}}),[]);const b=t.useRef(null),P=a.useMantineTheme();return w.default.createElement(l.StyledSocialLinkPreview,{className:`${i} no-replace-click`,style:r,ref:b,color:P.colors[P.primaryColor][0]},n||!f&&!h?w.default.createElement("a",{href:g,target:"_blank",rel:"noreferrer"},w.default.createElement("div",{className:"link-image-wrapper "+((null==u?void 0:u.isFetching)?"fetching":"")},(null==u?void 0:u.isFetching)?w.default.createElement(l.Loading,{className:"loading-spinner"}):w.default.createElement(s.ImageWrap,{className:"link-image",src:v||m.DEFAULT_IMG,backupSrc:m.DEFAULT_IMG,alt:g}))):w.default.createElement("div",{className:"link-image-wrapper"},f?w.default.createElement("iframe",{width:"100%",height:"100%",src:`https://www.youtube.com/embed/${f}?&autoplay=${d?1:0}&mute=1&enablejsapi=1`,frameBorder:"0",allowFullScreen:!0,style:{position:"absolute",top:0,left:0,border:"none",overflow:"hidden"},loading:"lazy"}):h?w.default.createElement("iframe",{key:String(E),src:`https://www.facebook.com/plugins/video.php?href=${encodeURIComponent(g)}&autoplay=${d?1:0}&show_text=false&t=0&width=${C.current}&height=${y.current}`,style:{position:"absolute",top:"50%",left:"50%",border:"none",overflow:"hidden",height:y.current,width:C.current,transform:"translate(-50%, -50%)"},scrolling:"no",frameBorder:"0",allowFullScreen:!0,allow:"autoplay; clipboard-write; encrypted-media; picture-in-picture; web-share",loading:"lazy"}):null))};var q="KsWg8i6",Z="_9tS0EUN",Q="kyyRKlb",K="-Uqqka-";var X="data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cpath d='M5 10C3.9 10 3 10.9 3 12C3 13.1 3.9 14 5 14C6.1 14 7 13.1 7 12C7 10.9 6.1 10 5 10Z' fill='%233E3F58'/%3e %3cpath d='M19 10C17.9 10 17 10.9 17 12C17 13.1 17.9 14 19 14C20.1 14 21 13.1 21 12C21 10.9 20.1 10 19 10Z' fill='%233E3F58'/%3e %3cpath d='M12 10C10.9 10 10 10.9 10 12C10 13.1 10.9 14 12 14C13.1 14 14 13.1 14 12C14 10.9 13.1 10 12 10Z' fill='%233E3F58'/%3e %3c/svg%3e",J="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='%23595959' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 13.3334L8 10.3704L4 13.3334V3.85187C4 3.53754 4.12041 3.23608 4.33474 3.01382C4.54906 2.79155 4.83975 2.66669 5.14286 2.66669H10.8571C11.1602 2.66669 11.4509 2.79155 11.6653 3.01382C11.8796 3.23608 12 3.53754 12 3.85187V13.3334Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",Y="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 13.3334L8 10.3704L4 13.3334V3.85187C4 3.53754 4.12041 3.23608 4.33474 3.01382C4.54906 2.79155 4.83975 2.66669 5.14286 2.66669H10.8571C11.1602 2.66669 11.4509 2.79155 11.6653 3.01382C11.8796 3.23608 12 3.53754 12 3.85187V13.3334Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",ee="data:image/svg+xml,%3csvg width='3' height='13' viewBox='0 0 3 13' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='1.58326' cy='6.41663' r='1.25' transform='rotate(89.9997 1.58326 6.41663)' fill='%23595959'/%3e%3cellipse cx='1.58326' cy='1.41663' rx='1.25' ry='1.25' transform='rotate(89.9997 1.58326 1.41663)' fill='%23595959'/%3e%3cellipse cx='1.58326' cy='11.4166' rx='1.25' ry='1.25' transform='rotate(89.9997 1.58326 11.4166)' fill='%23595959'/%3e%3c/svg%3e",te="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 5.33337C13.1046 5.33337 14 4.43794 14 3.33337C14 2.2288 13.1046 1.33337 12 1.33337C10.8954 1.33337 10 2.2288 10 3.33337C10 4.43794 10.8954 5.33337 12 5.33337Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M4 10C5.10457 10 6 9.10457 6 8C6 6.89543 5.10457 6 4 6C2.89543 6 2 6.89543 2 8C2 9.10457 2.89543 10 4 10Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M12 14.6666C13.1046 14.6666 14 13.7712 14 12.6666C14 11.5621 13.1046 10.6666 12 10.6666C10.8954 10.6666 10 11.5621 10 12.6666C10 13.7712 10.8954 14.6666 12 14.6666Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M5.72668 9.00665L10.28 11.66' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M10.2734 4.33997L5.72668 6.9933' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",ae="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M2 4H3.33333H14' stroke='%23737373' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M5.33334 3.99992V2.66659C5.33334 2.31296 5.47382 1.97382 5.72387 1.72378C5.97392 1.47373 6.31305 1.33325 6.66668 1.33325H9.33334C9.68697 1.33325 10.0261 1.47373 10.2762 1.72378C10.5262 1.97382 10.6667 2.31296 10.6667 2.66659V3.99992M12.6667 3.99992V13.3333C12.6667 13.6869 12.5262 14.026 12.2762 14.2761C12.0261 14.5261 11.687 14.6666 11.3333 14.6666H4.66668C4.31305 14.6666 3.97392 14.5261 3.72387 14.2761C3.47382 14.026 3.33334 13.6869 3.33334 13.3333V3.99992H12.6667Z' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M6.66666 7.33325V11.3333' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M9.33334 7.33325V11.3333' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e";const le=({authorEmail:a,onDeletePost:n,shareUrl:i,post:r,className:s="",popoverClassName:d="",onBookmark:u,onRemoveBookmark:p,onEditPost:v})=>{const{data:{locale:g,userInfo:f,togetherUserId:h,env:{isMarryBaby:C}},action:{pushNotifications:y}}=t.useContext(m.TogetherComponentGlobalContext),{t:E}=o.useTranslations(),[k,b]=t.useState(!1),[P,T]=t.useState(!1),[S,x]=t.useState(!1),{authActionWrapper:N}=l.useTogetherAuthRequiredAction(),A=a&&(null==f?void 0:f.email)&&a===String(null==f?void 0:f.email);return w.default.createElement("div",{className:s,onClick:e=>{e.preventDefault(),e.stopPropagation()}},S&&w.default.createElement(l.SharePopup,{url:i,text:null==r?void 0:r.title,onClose:()=>x(!1)}),P&&w.default.createElement(O,{thumbnail:c.CommonGAssets.getAssetPath("trash-bin.svg"),isThumbnailIcon:!0,title:E("popup.deletePost.title"),description:E("popup.deletePost.description"),acceptText:E("popup.deletePost.accept"),cancelText:E("popup.deletePost.cancel"),onAccept:()=>e.__awaiter(void 0,void 0,void 0,(function*(){if((null==r?void 0:r.id)&&!k){b(!0);try{const t=yield(({id:t,locale:a})=>e.__awaiter(void 0,void 0,void 0,(function*(){if(t)return yield m.callApiWithAuth(m.getApiPath(m.PATHS.POST.DELETE,{id:t,_locale:a}),"DELETE")})))({id:r.id,locale:g});1===(null==t?void 0:t.status)&&(null==n||n())}catch(e){}b(!1)}})),onClose:()=>T(!1)}),w.default.createElement(l.TreePopoverMenu,{className:d,toggleButtonContent:w.default.createElement("img",{src:C?X:ee,loading:"lazy"}),position:"bottom",align:"end",buttonProps:{isLoading:k},data:A?{isShowheader:!1,type:"list",list:[{icon:te,label:E("morePopover.share"),onClick:()=>x(!0)},{icon:"data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M7.16952 3.2356H2.99484C2.6785 3.2356 2.37512 3.36126 2.15143 3.58495C1.92774 3.80863 1.80208 4.11202 1.80208 4.42836V12.7777C1.80208 13.094 1.92774 13.3974 2.15143 13.6211C2.37512 13.8448 2.6785 13.9705 2.99484 13.9705H11.3442C11.6605 13.9705 11.9639 13.8448 12.1876 13.6211C12.4113 13.3974 12.537 13.094 12.537 12.7777V8.60303' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M11.6425 2.341C11.8798 2.10375 12.2016 1.97046 12.5371 1.97046C12.8726 1.97046 13.1944 2.10375 13.4317 2.341C13.6689 2.57826 13.8022 2.90005 13.8022 3.23558C13.8022 3.57111 13.6689 3.89289 13.4317 4.13015L7.76607 9.79578L5.38054 10.3922L5.97692 8.00663L11.6425 2.341Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",label:E("actionPopover.edit"),onClick:v},{icon:ae,label:E("actionPopover.delete"),onClick:()=>{N((()=>T(!0)))}}]}:{isShowheader:!1,type:"list",list:[{icon:te,label:E("morePopover.share"),onClick:()=>x(!0)},{icon:(null==r?void 0:r.bookmarked)?J:Y,label:(null==r?void 0:r.bookmarked)?E("morePopover.unsavePost"):E("morePopover.savePost"),onClick:()=>{N((()=>e.__awaiter(void 0,void 0,void 0,(function*(){if((null==f?void 0:f.id)&&(null==r?void 0:r.id))if(null==r?void 0:r.bookmarked){const e=yield m.callApiWithAuth(m.getApiPath(m.PATHS.BOOKMARK.DELETE,{_locale:g}),"DELETE",{data:{post_id:String(r.id)}});1===(null==e?void 0:e.status)?(y({title:"",message:"Removed saved post",type:"success",displayIcon:Y}),p&&p()):y({title:"",message:"Remove failed",type:"danger",displayIcon:Y})}else{const e=yield m.callApiWithAuth(m.getApiPath(m.PATHS.BOOKMARK.CREATE,{_locale:g}),"POST",{data:{user_id:h||f.id,post_id:r.id}});1===(null==e?void 0:e.status)?(y({title:"",message:"Post saved",type:"success",displayIcon:J}),u&&u()):y({title:"",message:"Post saved failed",type:"danger",displayIcon:Y})}}))))}},{icon:D,label:E("morePopover.report"),subTree:{title:E("morePopover.report.title"),description:E("morePopover.report.description"),isShowheader:!0,type:"list",list:Object.keys(m.REPORT_REASON_MAP).map((e=>({label:m.REPORT_REASON_MAP[e].label,reason:m.REPORT_REASON_MAP[e].reportReasonText,reasonValue:e}))).map((e=>({label:E(e.label),subTree:{title:E("morePopover.reportSubmit.title"),description:E("morePopover.reportSubmit.description"),isShowheader:!0,type:"jsx",jsxRenderer:t=>w.default.createElement(F,{reason:e.reasonValue,reasonText:E(e.reason),postId:null==r?void 0:r.id,onClose:()=>t&&t(!1)})}})))}}]}}))};const oe=({onDeleteComment:a,commentId:n,className:i="",popoverClassName:r=""})=>{const{data:{env:{isMarryBaby:s},locale:d},action:{pushNotifications:c}}=t.useContext(m.TogetherComponentGlobalContext),{t:u}=o.useTranslations(),[p,v]=t.useState(!1),{authActionWrapper:g}=l.useTogetherAuthRequiredAction();return w.default.createElement("div",{className:i,onClick:e=>{e.preventDefault(),e.stopPropagation()}},p&&w.default.createElement(O,{thumbnail:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='17' fill='none'%3e%3cg stroke='%23737373' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' clip-path='url(%23clip0)'%3e%3cpath d='M2 4.008h12M5.333 4.008V2.675a1.333 1.333 0 0 1 1.334-1.333h2.666a1.333 1.333 0 0 1 1.334 1.333v1.333m2 0v9.334a1.333 1.333 0 0 1-1.334 1.333H4.667a1.333 1.333 0 0 1-1.334-1.333V4.008h9.334ZM6.667 7.342v4M9.333 7.342v4'/%3e%3c/g%3e%3cdefs%3e%3cclipPath id='clip0'%3e%3cpath fill='white' d='M0 .008h16v16H0z'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",isThumbnailIcon:!0,title:u("popup.deleteComment.title"),description:u("popup.deleteComment.description"),acceptText:u("popup.deletePost.accept"),cancelText:u("popup.deletePost.cancel"),onAccept:()=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;if(!n)return;const t=yield(({id:e,locale:t})=>m.callApiWithAuth(m.getApiPath(m.PATHS.COMMENT.DELETE,{_locale:t,id:e}),"DELETE"))({id:n,locale:d});1===(null==t?void 0:t.status)?(a&&a(),c({title:"",message:u("notification.success"),type:"success"})):c({title:"",message:(null===(e=null==t?void 0:t.messages)||void 0===e?void 0:e[0])||u("notification.failure"),type:"danger"})})),onClose:()=>v(!1)}),w.default.createElement(l.TreePopoverMenu,{position:"bottom",align:"end",data:{isShowheader:!1,type:"list",list:[{icon:ae,label:u("actionPopover.delete"),onClick:()=>{g((()=>{v(!0)}))}}]},className:r,toggleButtonContent:w.default.createElement("img",{src:s?X:ee,loading:"lazy"}),buttonProps:{}}))};var ne="-dzIuHr";const ie=({userId:e,avatar:a,name:n,role:s,title:d,className:c})=>{const{t:u}=o.useTranslations(),[m,p]=t.useState(!1);return w.default.createElement(w.default.Fragment,null,w.default.createElement(h.Button,{className:`${ne} ${c}`,color:"success",size:"xs",onClick:()=>p(!0),style:{padding:"5px 8px",marginBottom:"12px",borderRadius:"4px"}},w.default.createElement("span",{className:"text"},w.default.createElement(r.Icon.Endorse,{isSolid:!0,size:18,color:i.theme.colors.green800,className:"icon"}),u("cardReply.verifyBy",{name:`${n||""}`}))),w.default.createElement(l.ProfileDetailModal,{open:m,onClose:()=>p(!1),profileModalProps:{zIndex:1e3}},w.default.createElement(l.ProfileDetail,{authorProps:{userId:e,avatar:a,name:n,role:s,title:d},hideQuestionTab:!0})))};const re=({className:a,style:n,comment:i,type:r="comment",level:s=0,replyingId:c,onPostCommentSuccess:u,post:p,onDeleteComment:v,refetchComment:g,hasQuickBookingEnable:f,handleMakeAppointment:C,cardAuthorProps:y,maxChars:E=600,disableShortenContent:k})=>{var b,P,T,x,N,A,I,_,M,L,j,R,B;const{data:{locale:O,userInfo:D,env:{isMarryBaby:F}}}=t.useContext(m.TogetherComponentGlobalContext),{t:U}=o.useTranslations(),[H,W]=t.useState(i||null),{id:V,countLikes:G,content:q,replies:Z=[],images:Q=[],author:K,liked:X,link:J,mentionedUser:Y,mentions:ee}=H,{text:te,replyingTo:ae}=(e=>{try{const t=e.match(/\[@([^\]]+)\]/),a=t?t[0].replace("[@","").replace("]",""):"";return{text:e.replace(/\[@([^\]]+)\]/,"").trim(),replyingTo:a}}catch(e){}return{text:""}})(q),{authActionWrapper:le}=l.useTogetherAuthRequiredAction({_joinCommunityIds:[null===(b=null==p?void 0:p.community)||void 0===b?void 0:b.id],_joinTopicIds:null===(P=null==p?void 0:p.topics)||void 0===P?void 0:P.map((e=>e.id))}),[ne,se]=t.useState(4),de=!!(null==D?void 0:D.id)&&(null==Z?void 0:Z.some((e=>e.author.id===D.id))),ce=e=>{W((t=>{if(!t.replies.find((t=>t.id===e.id))){t.replies.unshift(e);const a=Object.assign(Object.assign({},t),{replies:t.replies.slice(),countReplies:t.countReplies+1});return g&&g(a),a}return t}))},[ue,me]=t.useState(!1),pe=t.useMemo((()=>"comment"===r&&Z&&0!=Z.length?Z.sort(((e,t)=>{const a=new Date(e.createdAt).getTime(),l=new Date(t.createdAt).getTime();return a>l?-1:a<l?1:0})):Z),[r,Z]),ve=(null==Z?void 0:Z.length)||0,ge=String(null==K?void 0:K.email)&&(null==D?void 0:D.email)&&String(null==K?void 0:K.email)===String(null==D?void 0:D.email),fe=(null==K?void 0:K.name)||(null==K?void 0:K.username)||"",he=(null==K?void 0:K.username)||(null==K?void 0:K.name)||"",Ce=null==K?void 0:K.avatar,ye=(null==p?void 0:p.isAnonymous)||null==K?void 0:K.role,Ee=[...(null==p?void 0:p.isAnonymous)?[{id:(null===(T=null==p?void 0:p.author)||void 0===T?void 0:T.id)||0,name:U("cardPost.anonymous")}]:[],...ee||[]],[we,ke]=t.useState(null),[be,Pe]=t.useState(null);t.useEffect((()=>{if(null==K?void 0:K.hospitalId){const t=t=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;const a=yield m.callApi(m.getCarePath(m.CARE_PATHS.GET_HOSPITAL_INFO,{hospital_branch_id:t,website_url:d.domainLocales[O]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.branch)&&ke(null==a?void 0:a._data.branch)}));t(K.hospitalId)}if(null==K?void 0:K.doctorId){const t=t=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;const a=yield m.callApi(m.getCarePath(m.CARE_PATHS.GET_DOCTOR_INFO,{doctorId:t,website_url:d.domainLocales[O]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.doctor)&&Pe(null==a?void 0:a._data.doctor)}));t(K.doctorId)}}),[K.hospitalId,K.doctorId]);const Te=(null==be?void 0:be.valid_outpatient)||(null==be?void 0:be.valid_telemedicine),Se=((null==we?void 0:we.total_available_service)||(null==we?void 0:we.total_available_doctor))>0,xe=f&&(Te||Se),Ne="chatbot"===(null===(x=null==H?void 0:H.author)||void 0===x?void 0:x.type);return w.default.createElement(l.TogetherAuthConfigContextProvider,{defaultParams:{_joinCommunityIds:[null===(N=null==p?void 0:p.community)||void 0===N?void 0:N.id],_joinTopicIds:null===(A=null==p?void 0:p.topics)||void 0===A?void 0:A.map((e=>e.id))}},w.default.createElement(l.StyledCardPost,{className:a,style:n,"data-is-reply":!!s,"data-is-marrybaby":F,"data-has-booking":xe},"reply"===r&&w.default.createElement(l.Divider,{className:"top-divider",type:"solid"}),w.default.createElement("div",{style:{padding:"16px 16px 0"}},w.default.createElement(l.CardAuthor,Object.assign({avatar:Ce,name:fe,username:he,timeText:null==p?void 0:p.createdTime,community:null==p?void 0:p.community,className:"post-author "+(ge?"with-popover":""),type:r,userId:null==K?void 0:K.id,role:ye,expertId:null==K?void 0:K.partnerId,title:null==K?void 0:K.title,doctorId:null==K?void 0:K.doctorId,hospitalId:null==K?void 0:K.hospitalId,hasQuickBooking:xe,handleMakeAppointment:C,isAnonymous:(null==H?void 0:H.isAnonymous)||Boolean(null==p?void 0:p.isAnonymous)&&(null===(I=null==p?void 0:p.author)||void 0===I?void 0:I.username)===(null==K?void 0:K.username),hideBackground:Ne,userType:null==K?void 0:K.type},y)),Boolean(null==H?void 0:H.isVerify)&&!Boolean(null==H?void 0:H.isOppose)&&w.default.createElement(ie,{title:null===(_=null==H?void 0:H.userVerify)||void 0===_?void 0:_.title,name:null===(M=null==H?void 0:H.userVerify)||void 0===M?void 0:M.name,userId:null===(L=null==H?void 0:H.userVerify)||void 0===L?void 0:L.id,role:null===(j=null==H?void 0:H.userVerify)||void 0===j?void 0:j.role,avatar:null===(R=null==H?void 0:H.userVerify)||void 0===R?void 0:R.avatar,className:"verify-tag"})),w.default.createElement(l.PostContent,{className:"post-content-wrapper",replyingTo:ae,mentionedUser:Y,description:te,mentions:Ee,maxChars:E,disableShortenContent:k}),w.default.createElement("span",null),w.default.createElement("span",null),Q&&Q.length>0?w.default.createElement("div",{key:"image-preview",className:"image-preview-wrapper","data-is-reply":!0},w.default.createElement($,{images:Q,authorName:null==K?void 0:K.username})):null,Q&&0!==Q.length||!J?null:w.default.createElement("div",{key:"link-preview",className:"link-preview-wrapper","data-is-reply":!0},w.default.createElement(S,{url:J})),"most-engaging"!==r?w.default.createElement(w.default.Fragment,null,Ne&&w.default.createElement(l.StyledSourceList,{listUrl:null==H?void 0:H.source,categorySlug:null==H?void 0:H.categorySlug}),w.default.createElement(l.CardReactions,{type:l.CardReactionType.reply,loveCount:G,replyCount:ve,className:"post-reaction",liked:X,isReplied:de,hideCommentIcon:"reply"===r||Ne,hasShare:!1,onCommentClick:()=>le((()=>me((e=>!e)))),onCommentCountClick:()=>le((()=>{me(!0)})),onLikeClick:()=>le((()=>e.__awaiter(void 0,void 0,void 0,(function*(){if(V){const t=yield(({commentId:t,setLike:a=!1,locale:l})=>e.__awaiter(void 0,void 0,void 0,(function*(){return m.callApiWithAuth(m.getApiPath(a?m.PATHS.COMMENT.LIKE:m.PATHS.COMMENT.UNLIKE,{_locale:l,id:t}),"GET")})))({commentId:V,setLike:!X,locale:O});1===t.status&&W((e=>Object.assign(Object.assign({},e),{liked:!X,countLikes:e.countLikes+(X?-1:1)})))}}))))}),ue&&w.default.createElement(z,{replyingId:c||H.id,replyToName:fe,isReply:!0,onClose:()=>me(!1),onPostSuccess:e=>{"reply"===r?u&&u(e):ce(e)},post:p,replyingUser:K}),"comment"===r&&Z&&Z.length>0?w.default.createElement("div",{className:"comment-reply-wrapper"},null===(B=null==pe?void 0:pe.slice(0,ne))||void 0===B?void 0:B.map((e=>w.default.createElement(re,{key:e.id,comment:e,type:"reply",className:"comment-reply-item",level:s+1,replyingId:V,onPostCommentSuccess:ce,post:p,onDeleteComment:()=>{W((t=>Object.assign(Object.assign({},t),{replies:t.replies.filter((t=>t.id!==e.id)),countReplies:t.countReplies-1})))},handleMakeAppointment:C,hasQuickBookingEnable:f}))),ve>ne&&w.default.createElement(w.default.Fragment,null,w.default.createElement(l.Divider,{className:"top-divider",type:"solid"}),w.default.createElement(h.Button,{className:"more-cmt",size:"lg",color:"ghost",onClick:()=>se((e=>e+4))},U("comment.seeMoreReplies",{count:ve-ne}),w.default.createElement("img",{className:"chevron-right",src:"data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M6 12L10 8L6 4' stroke='%232D87F3' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",loading:"lazy"})))):null):null,ge&&w.default.createElement(oe,{onDeleteComment:v,className:"popover",commentId:H.id})))},se=(t,a)=>e.__awaiter(void 0,void 0,void 0,(function*(){var e,l,o;const n=yield m.callApiWithOptionalAuth(m.getApiPath(m.PATHS.COMMENT.LIST,{postId:t,_locale:a,sort:"popularity",perPage:1,withoutReply:1}),"GET");return null===(o=null===(l=null===(e=null==n?void 0:n.data)||void 0===e?void 0:e.comments)||void 0===l?void 0:l.map(p.formatComment))||void 0===o?void 0:o[0]}));var de=Object.freeze({__proto__:null});exports.CardLink=S,exports.CardPost=({className:a,style:n,hideViewMoreComment:i,showMostEngaging:r,onCommentClick:s,onCommentCountClick:d,onMostEngagingCommentClick:c,onPostCommentSuccess:u,disableCardLink:p,disableShortenContent:v,onDeletePost:g,onEditPost:f,post:C,mostEngagingComment:y,onDeleteComment:E,showInputComment:b,InlineCommentsComponent:P,hasQuickBookingEnable:T,handleMakeAppointment:A,cardAuthorProps:I})=>{const[_,M]=t.useState(C),[L,j]=t.useState(!1),[R,B]=t.useState(y),{community:O,topics:D,author:F,slug:U,isPin:H,liked:W,photos:V,mentions:q,title:Z,description:Q,previewUrl:K,likesCount:X,commentsCount:J,id:Y,commented:ee}=_,{data:{locale:te,env:{isMarryBaby:ae,togetherBasePath:oe}},action:{pushNotifications:ne}}=t.useContext(m.TogetherComponentGlobalContext),{t:ie}=o.useTranslations(),[de,ce]=t.useState(b),ue=`${oe}/${(null==O?void 0:O.slug)||"_"}/${U||""}`,me=`${m.getCurrentBaseUrl(te)}${ue}`,{authActionWrapper:pe}=l.useTogetherAuthRequiredAction((null==O?void 0:O.slug)?{_joinCommunityIds:[O.id],_joinTopicIds:null==D?void 0:D.map((e=>e.id))}:void 0),[ve,ge]=t.useState(!1);t.useEffect((()=>{ce(b)}),[b]);const fe=(null==F?void 0:F.name)||(null==F?void 0:F.username)||"",he=(null==F?void 0:F.username)||(null==F?void 0:F.name)||"",Ce=null==F?void 0:F.avatar,ye=(null==_?void 0:_.isAnonymous)||null==F?void 0:F.role,[Ee,we]=t.useState(null),[ke,be]=t.useState(null);t.useEffect((()=>{if(null==F?void 0:F.hospitalId){(t=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;const a=yield m.callApi(m.getCarePath(m.CARE_PATHS.GET_HOSPITAL_INFO,{hospital_branch_id:t,website_url:m.domainLocales[te]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.branch)&&we(null==a?void 0:a._data.branch)})))(F.hospitalId)}if(null==F?void 0:F.doctorId){(t=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;const a=yield m.callApi(m.getCarePath(m.CARE_PATHS.GET_DOCTOR_INFO,{doctorId:t,website_url:m.domainLocales[te]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.doctor)&&be(null==a?void 0:a._data.doctor)})))(F.doctorId)}}),[F.hospitalId,F.doctorId]);const Pe=(null==ke?void 0:ke.valid_outpatient)||(null==ke?void 0:ke.valid_telemedicine),Te=((null==Ee?void 0:Ee.total_available_service)||(null==Ee?void 0:Ee.total_available_doctor))>0,Se=T&&(Pe||Te);t.useEffect((()=>{e.__awaiter(void 0,void 0,void 0,(function*(){if(Y&&J&&r&&!(null==y?void 0:y.id)){const e=yield se(Y,te);B(e)}}))}),[Y,te,J,r,null==y?void 0:y.id]),t.useEffect((()=>{B(y)}),[null==y?void 0:y.id]);const xe=t=>e.__awaiter(void 0,void 0,void 0,(function*(){if(J>1&&(null==R?void 0:R.id)&&(null==R?void 0:R.id)===(null==t?void 0:t.id)){const e=yield se(Y,te);B(e)}M((e=>Object.assign(Object.assign({},e),{commentsCount:e.commentsCount-1}))),E&&E(t)}));return w.default.createElement(l.TogetherAuthConfigContextProvider,{defaultParams:(null==O?void 0:O.slug)?{_joinCommunityIds:[O.id],_joinTopicIds:null==D?void 0:D.map((e=>e.id))}:void 0},L&&w.default.createElement(l.SharePopup,{url:me,avatar:m.DEFAULT_IMG,text:Z,onClose:()=>j(!1)}),w.default.createElement(l.StyledCardPost$1,{className:a,style:n,"data-is-marrybaby":ae},H?w.default.createElement(x,{className:"post-pin"}):null,w.default.createElement("div",{style:{position:"relative",padding:"1rem 1rem 0"}},w.default.createElement(l.CardAuthor,Object.assign({avatar:Ce,name:fe,username:he,url:p?void 0:ue,community:O,timeText:null==_?void 0:_.createdTime,className:"post-author",role:ye,userId:null==F?void 0:F.id,expertId:null==F?void 0:F.partnerId,doctorId:null==F?void 0:F.doctorId,hospitalId:null==F?void 0:F.hospitalId,title:null==F?void 0:F.title,hasQuickBooking:Se,handleMakeAppointment:A,"data-testid":"name",isAnonymous:!!(null==_?void 0:_.isAnonymous),extendEle:w.default.createElement(le,{authorEmail:String(null==F?void 0:F.email),onDeletePost:g,shareUrl:me,post:_,className:"popover",onEditPost:f})},I))),w.default.createElement("a",{href:p?void 0:ue,className:"post-content-link-wrapper"},Z&&w.default.createElement(m.Heading,{className:"post-content-title",as:"h2",tag:"h5",fontWeight:"bold","data-testid":"Title of the Post"},k.default(Z)),w.default.createElement(l.PostContent,{className:"post-content-wrapper",description:Q,disableShortenContent:v,mentions:q,"data-testid":"Content of the Post"})),w.default.createElement("span",null),w.default.createElement("span",null),w.default.createElement("div",{key:"tag-topic"},D&&D.length>0?w.default.createElement(l.TagTopic,{topics:D,className:"post-topics"}):null),w.default.createElement("div",{key:"social-preview"},(null==_?void 0:_.introUrl)?w.default.createElement("div",{className:"social-preview-wrapper "+((null==V?void 0:V.length)?"has-image":"")},w.default.createElement(G,{url:_.introUrl,image:_.bannerImage})):null),w.default.createElement("div",{key:"image-preview"},(null==V?void 0:V.length)?w.default.createElement("div",{className:"image-preview-wrapper"},w.default.createElement($,{images:V,authorName:null==F?void 0:F.name})):null),w.default.createElement("div",{key:"link-preview"},(null==_?void 0:_.introUrl)||(null==V?void 0:V.length)||!(null==K?void 0:K.url)?null:w.default.createElement("div",{className:"link-preview-wrapper"},w.default.createElement(S,{title:K.title,url:K.url,image:K.image}))),w.default.createElement(l.CardReactions,{isMarryBaby:ae,type:l.CardReactionType.post,loveCount:X,replyCount:J,className:"post-reaction "+((null==V?void 0:V.length)||(null==K?void 0:K.url)?"hide-top-border":""),liked:ve?!W:W,isReplied:ee,onCommentClick:()=>pe((()=>{s?s():ce((e=>!e))})),onCommentCountClick:()=>{pe((()=>{ae?ce(!0):d?d():!p&&(window.location.href=ue)}))},onShareClick:()=>{j(!0)},onLikeClick:()=>e.__awaiter(void 0,void 0,void 0,(function*(){if(Y&&!ve){ge(!0);try{const t=yield(({id:t,locale:a})=>e.__awaiter(void 0,void 0,void 0,(function*(){if(t)return yield m.callApiWithAuth(m.getApiPath(m.PATHS.POST.LIKE,{id:t,_locale:a}),"GET")})))({id:Y,locale:te});1!==(null==t?void 0:t.status)?ne(N(ie)):M((e=>Object.assign(Object.assign({},e),{likesCount:(e.likesCount||0)+(e.liked?-1:1),liked:!e.liked})))}catch(e){ne(N(ie))}ge(!1)}})),showingMostEngaging:!(!r||!(null==R?void 0:R.id))}),de&&w.default.createElement(z,{isMainCmt:!b,onClose:()=>ce(!1),onPostSuccess:e=>{0!==J||(null==R?void 0:R.id)||B(e),M((e=>Object.assign(Object.assign({},e),{commentsCount:e.commentsCount+1,commented:!0}))),u&&u(e)},post:_}),r&&(null==R?void 0:R.id)?w.default.createElement("div",{className:"most-engaging-wrapper",onClick:e=>{c?(e.stopPropagation(),c()):window.location.href=ue}},w.default.createElement(re,{hasQuickBookingEnable:T,handleMakeAppointment:A,comment:R,post:_,onDeleteComment:()=>{xe&&xe(R)},className:"most-engaging-comment",type:"most-engaging",key:R.id,cardAuthorProps:I}),J>1&&!i&&w.default.createElement(h.Button,{className:"see-more-comments",color:"ghost",size:"md"},ie("comment.seeMoreComments",{count:J-1}))):null,P))},exports.CardPostPopoverMore=le,exports.CardReply=re,exports.CardReplyPopover=oe,exports.CreateNewPostContent=({className:n,style:d,onPostCreatedEdited:v,onClose:g,communities:f=[],forceSelectCommunity:h,forceSelectTopics:C,articleId:y,optionalTopic:E,editPostData:b,defaultCommunity:P,defaultTopics:T,noFetchTopic:S,hideTopicList:x,selectAskDoctor:I,showAskDoctorOptions:_,currentPageUrl:L})=>{const B=!!(null==b?void 0:b.id),{data:{locale:O,env:{isMarryBaby:z}},action:{pushNotifications:D,sanitizeFunction:F}}=t.useContext(m.TogetherComponentGlobalContext),{t:U}=o.useTranslations(),[H,W]=t.useState(!1),[V,$]=t.useState(I),[G,q]=t.useState(!1),[Z,Q]=t.useState(!1),[K,X]=t.useState(!1),[J,Y]=t.useState(""),[ee,te]=t.useState(""),[ae,le]=t.useState(h?{label:h.name,value:`${h.id||""}-${h.mappedCategoryId||""}`}:{label:U("community.choose"),value:""}),[oe,ne]=t.useState([...C]||[]),[ie,re]=t.useState([]),[se,de]=t.useState([]),ce=h||f.find((e=>`${e.id||""}-${e.mappedCategoryId||""}`===ae.value)),ue=h?[h]:f.filter((e=>e.isActive)).sort(((e,t)=>e.name>t.name?1:e.name<t.name?-1:0)),[me,pe]=t.useState(null),[ve,ge]=t.useState([]),fe=J&&!Z&&k.default(ee)&&(E||!E&&oe.length>0)&&ce&&(!ie||ie.length<=m.MAX_IMAGE_UPLOADS)&&!(null==ve?void 0:ve.length)&&!K;t.useEffect((()=>{if(b){const e=b;Y(e.title||""),te(l.decodeMention(l.decodePostUrl(e.description||"","edit"),e.mentions)),le({label:e.community.name,value:`${e.community.id||""}-${e.community.mappedCategoryId||""}`}),ne(e.topics||[]),re(e.photos||[]),W(!!e.isAnonymous||!1),$(!!e.isAskDoctor||!1)}else P&&le({label:P.name,value:`${P.id||""}-${P.mappedCategoryId||""}`}),T&&ne(T)}),[]),t.useEffect((()=>{Q(""!==J&&!/[a-zA-Z]/.test(J))}),[J]);const he=()=>e.__awaiter(void 0,void 0,void 0,(function*(){var t,a,o,n,i,r,s,d,c;if(_&&void 0===V)return q(!0),!1;const f=yield(({title:t,description:a,communityId:o,imageFiles:n,previewUrl:i,topicIds:r,locale:s,sanitizeFunction:d,categoryCommunityId:c,categoryTopicIds:p,introUrl:v,bannerUrl:g,scheduleTime:f,isAnonymous:h,isAskDoctor:C})=>e.__awaiter(void 0,void 0,void 0,(function*(){const e=new FormData,y=l.removeBannedWordWrapper(a),E=l.removeBannedWordWrapper(t),w=l.getMentionIdsFromString(y);if(e.append("title",E),e.append("description",l.encodePostContent(y,d)),c?e.append("category_community",String(c)):o&&e.append("community_id",String(o)),e.append("is_anonymous",h?"1":"0"),e.append("is_question",C?"1":"0"),(null==i?void 0:i.title)&&e.append("preview_title",i.title),(null==i?void 0:i.description)&&e.append("preview_description",i.description),(null==i?void 0:i.url)&&e.append("preview_link",u.safeEncodeURI(i.url)),(null==i?void 0:i.image)&&e.append("preview_image",u.safeEncodeURI(i.image)),null==r||r.forEach((t=>{e.append("topics[]",String(t||""))})),null==p||p.forEach((t=>{e.append("category_topics[]",String(t||""))})),null==n?void 0:n.length){const t=yield Promise.all(n.map(((e,t)=>new Promise((a=>{setTimeout((()=>{a(l.uploadAndGetSrc(e,s))}),2e3*t)})))));null==t||t.filter(Boolean).slice(0,m.MAX_IMAGE_UPLOADS).forEach(((t,a)=>{e.append(`images[${a}]`,t)}))}else e.append("images","");return null==w||w.forEach((t=>{e.append("mention_ids[]",t)})),e.append("intro_url",v||""),e.append("banner",g||""),f&&(e.append("post_type","scheduled"),e.append("schedule_datetime",f)),e})))({title:J,description:ee,communityId:String((null==ce?void 0:ce.id)||""),imageFiles:ie,previewUrl:me,topicIds:null==oe?void 0:oe.map((e=>String(e.id||""))).filter(Boolean),locale:O,sanitizeFunction:F,categoryCommunityId:String((null==ce?void 0:ce.mappedCategoryId)||""),categoryTopicIds:null==oe?void 0:oe.map((e=>String(e.mappedCategoryId||""))).filter(Boolean),isAnonymous:H?1:0,isAskDoctor:V?1:0});let h;y&&f.append("article_id",y),B?(null==b?void 0:b.id)&&(h=yield(({id:t,locale:a,formData:l})=>e.__awaiter(void 0,void 0,void 0,(function*(){return yield m.callApiWithAuth(m.getApiPath(m.PATHS.POST.UPDATE,{id:t,_locale:a}),"POST",{data:l})})))({id:b.id,formData:f,locale:O})):h=yield(({locale:t,formData:a,isArticleComment:l})=>e.__awaiter(void 0,void 0,void 0,(function*(){return yield m.callApiWithAuth(m.getApiPath(l?m.PATHS.POST.CREATE_ARTICLE_COMMENT:m.PATHS.POST.CREATE,{_locale:t}),"POST",{data:a})})))({formData:f,locale:O,isArticleComment:!(null==ce?void 0:ce.id)&&!!(null==ce?void 0:ce.mappedCategoryId)});const C=null==h?void 0:h.data;(null==C?void 0:C.id)&&!(null===(a=null===(t=null==h?void 0:h.messages)||void 0===t?void 0:t.moderation)||void 0===a?void 0:a.type)?(D({message:U("createPost.popup.success"),type:"success"}),(e=>{v&&v(p.formatPost(e),B),g&&g()})(C)):"banned"===(null===(n=null===(o=null==h?void 0:h.messages)||void 0===o?void 0:o.moderation)||void 0===n?void 0:n.type)?(D({title:U("notification.post.blocked.title"),message:U("notification.post.blocked.message"),type:"danger"}),h.messages.moderation.words&&de(h.messages.moderation.words)):"suspect"===(null===(r=null===(i=null==h?void 0:h.messages)||void 0===i?void 0:i.moderation)||void 0===r?void 0:r.type)?(D({title:U("notification.post.suspect.title"),message:U("notification.post.suspect.message"),type:"warning"}),g&&g()):(null===(d=null===(s=null==h?void 0:h.messages)||void 0===s?void 0:s.find)||void 0===d?void 0:d.call(s,(e=>{var t;return!!(null===(t=null==e?void 0:e.includes)||void 0===t?void 0:t.call(e,"suspend"))})))?(D({message:U("notification.suspend.message"),type:"danger"}),g&&g()):D({message:(null===(c=null==h?void 0:h.messages)||void 0===c?void 0:c[0])||U("notification.failure"),type:"danger"})}));return w.default.createElement(l.StyledCreateNewPost,{className:n,style:d},w.default.createElement("div",{className:"input-group-container"},w.default.createElement(j,{className:"input-group",bannedWords:se,value:J,onChange:Y}),Z&&w.default.createElement(l.StyledError,null,w.default.createElement(r.Info,{isSolid:!0,color:i.theme.colors.red700,size:14}),w.default.createElement(r.Text,{size:"p3",as:"span",color:i.theme.colors.red700},U("createPost.popup.specialCharErr"))),w.default.createElement(M,{className:"input-group",bannedWords:se,value:ee,onChange:te,onPreviewUrlChange:pe,onInvalidUrlsChange:ge,onImageFilesChange:re,imageFiles:ie}),_&&w.default.createElement(l.StyledIsQuestion,{"data-is-marry-baby":z},w.default.createElement("div",{className:"switch-label"},w.default.createElement(r.Ask,{isMarryBaby:z,size:z?32:24,color:i.theme.colors.primaryBase,className:"label-icon"}),w.default.createElement("span",{className:"label-txt"},U("createPost.askDoctor"))),w.default.createElement(l.BtnChoice,{value:V,choices:[{label:U("createPost.askDoctorChoice.yes"),value:!0,dataEventCategory:"Together",dataEventAction:"Write Post Click - Ask Doctor",dataEventLabel:L},{label:U("createPost.askDoctorChoice.no"),value:!1}],onChange:e=>{"boolean"==typeof e&&(q(!1),$(e))}})),G&&w.default.createElement(l.StyledError,null,w.default.createElement(r.Info,{isSolid:!0,color:i.theme.colors.red700,size:14}),w.default.createElement(r.Text,{size:"p3",as:"span",color:i.theme.colors.red700},U("createPost.message.askDoctorRequire"))),w.default.createElement("div",{className:"input-group"},w.default.createElement(r.Text,{size:"p4",className:"input-group-label"},U("admin.community")),w.default.createElement(l.Dropdown,{options:(null==ue?void 0:ue.map((e=>({label:e.name,value:`${e.id||""}-${e.mappedCategoryId||""}`}))))||[],id:"community-picker",placeholder:U("community.choose"),value:ae,dropdownLabelTrackingAttributes:{"data-event-category":"Together","data-event-action":"Write Post Click - Choose Community/Topic","data-event-label":L},onChange:e=>{le({label:e.label,value:String(e.value)}),ne([])},disabled:!!h}),w.default.createElement(r.Text,{size:"sm",className:"warning",color:i.theme.colors.gray400},"* ",U("commentPopup.warning.newPost"))),!x&&w.default.createElement("div",{className:"input-group"},w.default.createElement(r.Text,{size:"p4",className:"input-group-label"},U("tab.topic")),w.default.createElement("div",{className:"input-notification"},w.default.createElement("img",{src:ce?"data:image/svg+xml,%3csvg width='16' height='17' viewBox='0 0 16 17' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M8 14.5C11.3137 14.5 14 11.8137 14 8.5C14 5.18629 11.3137 2.5 8 2.5C4.68629 2.5 2 5.18629 2 8.5C2 11.8137 4.68629 14.5 8 14.5Z' fill='%232D87F3'/%3e%3cpath d='M8 5.5V8.5' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M8 11.5H8.00708' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e":A,loading:"lazy"}),w.default.createElement(r.Text,{size:"base",color:i.theme.colors.gray500},U(ce?"createPost.popup.primary":"createPost.popup.warning"))),ce&&w.default.createElement(R,{className:"tag-list",communityId:ce.id,forceTopics:C,onChange:ne,selectedTopics:oe,noFetch:S,dataEventCategory:"Together",dataEventAction:"Write Post Click - Choose Community/Topic",dataEventLabel:L}))),w.default.createElement("div",{className:"form-action"},w.default.createElement("div",{className:"input-group"},w.default.createElement(a.Checkbox,{className:"swich-input-group",labelPosition:"left",name:"PostAnonymous",checked:H,color:z?"pink":void 0,"data-event-category":"Together","data-event-action":"Write Post Click - Incognito","data-event-label":L,label:w.default.createElement("div",{className:"switch-label"},w.default.createElement("img",{className:"label-icon",src:c.CommonGAssets.getAssetPath("anomyous-avatar.svg"),alt:"anomyous avatar",style:{marginRight:"10px",width:"24px"},loading:"lazy"}),w.default.createElement("span",{className:"label-txt"},U("createPost.postAnonymous"))),value:"Post Anonymous",onChange:e=>W(e.currentTarget.checked),styles:{body:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"},label:{display:"flex",alignItems:"center"}}})),w.default.createElement("div",{className:"input-group"},w.default.createElement(s.Button,{className:"submit-btn pointer-event-child-none",size:"lg","data-event-category":"Ask Doctor","data-event-action":"Submit Question","data-event-label":window.location.href,onClick:()=>e.__awaiter(void 0,void 0,void 0,(function*(){if(fe&&!K){X(!0);try{yield he()}catch(e){console.error(e),D(N(U))}X(!1)}})),disabled:!fe,loading:K},U("createPost.popup.submit")))))},exports.CreatePostDescription=M,exports.CreatePostTitle=j,exports.ImagePreviewPopup=U,exports.InputCommentBar=z,exports.LabelPin=x,exports.PopupDanger=O,exports.PostImagePreview=$,exports.PostSingleImageViewPopup=W,exports.SkipQuestionOfExpertBtn=l=>{var{post:n,onSkip:i,btnText:d,currentPageUrl:c}=l,u=e.__rest(l,["post","onSkip","btnText","currentPageUrl"]);const{t:p}=o.useTranslations(),{data:{locale:v},action:{pushNotifications:g}}=t.useContext(m.TogetherComponentGlobalContext),[f,h]=t.useState(!1),[C,y]=t.useState(!1),E=a.useMantineTheme(),k=t.useCallback((()=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;y(!0);const t=yield m.callApiWithAuth(m.getApiPath(m.PATHS.USER.SKIP_QUESTION,{_locale:v,id:null==n?void 0:n.id}),"PUT");1===(null==t?void 0:t.status)?(null==i||i({id:(null==n?void 0:n.id)||"",communityId:(null===(e=null==n?void 0:n.community)||void 0===e?void 0:e.id)||""}),h(!1),g({title:"",message:"Skip success",type:"success"})):g({title:"",message:null==t?void 0:t.messages,type:"danger"}),y(!1)}))),[]);return w.default.createElement(a.Popover,{width:327,withArrow:!0,shadow:"md",opened:f},w.default.createElement(a.Popover.Target,null,w.default.createElement("div",Object.assign({className:`${q} ${(null==u?void 0:u.className)||""}`,onClick:()=>h(!0)},u),d||p("profilePanel.questionNotClear"))),w.default.createElement(a.Popover.Dropdown,null,w.default.createElement("div",null,w.default.createElement("div",{className:Z},p("profilePanel.skipQuestion.heading")),w.default.createElement("div",{className:Q},p("profilePanel.skipQuestion.content")),w.default.createElement("div",{className:K},w.default.createElement(s.Button,{size:"md",variant:"secondary",leftIcon:w.default.createElement(r.Close,{color:E.fn.primaryColor(),size:24}),onClick:()=>h(!1),styles:()=>({leftIcon:{marginRight:0}})}),w.default.createElement(s.Button,{variant:"primary",size:"md",leftIcon:w.default.createElement(r.Check,{color:"white",size:24}),onClick:k,loading:C,"data-event-category":"Together","data-event-action":"Unclear Question Click","data-event-label":c,styles:()=>({leftIcon:{marginRight:0}})})))))},exports.SocialLinkPreview=G,exports.SubmitReportForm=F,exports.TopicSelectList=R,exports.VerifiedTag=ie,exports.types=de;
|
|
1
|
+
"use strict";var e=require("./tslib.es6-15853eea.js"),t=require("react"),a=require("@mantine/core"),l=require("./index.styled-572bd083.js"),o=require("./useTranslations-d57cfa60.js"),n=require("innertext"),i=require("./theme-6b7baadc.js"),r=require("./index-76e24325.js"),s=require("./index-c084e8e0.js");require("@mantine/dates");var d=require("./index-fa36dcfc.js");require("./Onboarding-06a9b342.js");var c=require("./gAssets.js");require("dayjs");var u=require("./screenSizeContext-eb66c071.js");require("styled-components"),require("./isProduction-19fdda9c.js"),require("@mantine/hooks");var m=require("./index.styles-99d90a47.js"),p=require("./index-a37938a5.js"),v=require("./index-8232502b.js"),g=require("lodash/debounce"),f=require("react-contenteditable");require("./useCategory-e02bbab5.js");var h=require("./index-f51aa89f.js"),C=require("react-dom");function y(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function E(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(a){if("default"!==a){var l=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,l.get?l:{enumerable:!0,get:function(){return e[a]}})}})),t.default=e,Object.freeze(t)}require("./constants-729267f0.js");var w=y(t),k=y(n),b=y(g),P=y(f),T=E(C);const S=({title:o,url:n,image:i,logo:s,className:d,style:c,noRefetch:u})=>{const{data:{locale:p,env:{isMarryBaby:v}}}=t.useContext(m.TogetherComponentGlobalContext),[g,f]=t.useState(!1),h=a.useMantineTheme(),C=t.useRef(u);C.current=u;const[y,E]=t.useState(null);t.useEffect((()=>{e.__awaiter(void 0,void 0,void 0,(function*(){if(!C.current){if(!n)return E(null);E((e=>Object.assign(Object.assign({},e),{isFetching:!0}))),m.callApi(m.getApiPath(m.PATHS.FETCH_PREVIEW,{_locale:p}),"POST",{data:{link:n},headers:{"Content-Type":"application/json"}}).then((e=>{var t,a,l;f(!1),E({title:null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.title,url:n,image:(null===(a=null==e?void 0:e.data)||void 0===a?void 0:a.image)||(null===(l=null==e?void 0:e.data)||void 0===l?void 0:l.logo)})})).catch((()=>{E(null)}))}}))}),[n]);const k=(null==y?void 0:y.image)||i,b=(null==y?void 0:y.title)||o,P=(null==y?void 0:y.logo)||s,T=(null==y?void 0:y.url)||n,S=T.replace("http://","").replace("https://","").split(/[/?#]/)[0],x=t.useRef(!1);return w.default.createElement(l.StyledCardLink,{"data-is-marrybaby":v,className:`${d} no-replace-click`,style:c,color:h.colors[h.primaryColor][0]},w.default.createElement("a",{href:T,target:"_blank",rel:"noreferrer"},k&&w.default.createElement("div",{className:"link-image-wrapper"},!v&&w.default.createElement("img",{className:"link-image-blur",src:k,onError:e=>{x.current||(x.current=!0,e.currentTarget.src=m.DEFAULT_IMG)},loading:"lazy"}),w.default.createElement("img",{className:"link-image",src:k,onError:e=>{x.current||(x.current=!0,e.currentTarget.src=m.DEFAULT_IMG)},loading:"lazy"})),w.default.createElement("div",{className:"link-info-container"},w.default.createElement(r.Text,{size:"n1"},v&&P&&!g&&w.default.createElement("img",{className:"link-logo",src:P,onError:()=>f(!0),loading:"lazy"}),S),w.default.createElement(m.Heading,{tag:"h6"},b))))};const x=({onClick:e,color:a,className:n,style:i})=>{const{data:{env:{isMarryBaby:r}}}=t.useContext(m.TogetherComponentGlobalContext),{t:s}=o.useTranslations();return w.default.createElement(l.LabelSortPin,{label:w.default.createElement(w.default.Fragment,null,r&&w.default.createElement("img",{className:"label-sort-pin-icon",src:"data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cpath d='M3.5 19.9999L7.87 15.6299' stroke='%23FB8C00' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e %3cpath fill-rule='evenodd' clip-rule='evenodd' d='M4.95634 11.294C4.56534 11.685 4.56534 12.318 4.95634 12.708L7.87434 15.626L10.7923 18.544C11.1833 18.935 11.8163 18.935 12.2063 18.544L13.3813 17.369C13.5693 17.181 13.6743 16.927 13.6743 16.662V12.726L16.5743 9.82597L18.8833 9.94897C19.1663 9.96397 19.4433 9.85797 19.6433 9.65797L20.2173 9.08397C20.6083 8.69297 20.6083 8.05997 20.2173 7.66997L15.8313 3.28397C15.4403 2.89297 14.8073 2.89297 14.4173 3.28397L13.8433 3.85797C13.6423 4.05897 13.5363 4.33497 13.5523 4.61797L13.6753 6.92697L10.7753 9.82697H6.83834C6.57334 9.82697 6.31834 9.93197 6.13134 10.12L4.95634 11.294V11.294Z' stroke='%23FB8C00' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e %3cpath d='M16.5699 9.83018L13.6699 6.93018' stroke='%23FB8C00' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e %3c/svg%3e",loading:"lazy"})," ",s("label.pinnedPost")),rightLabel:!r&&w.default.createElement("img",{className:"label-sort-pin-icon",src:"data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cline x1='7.18605' y1='7.68219' x2='3.68219' y2='13.8139' stroke='%23FEA21E' stroke-linecap='round'/%3e%3cpath d='M3.24591 7.78426C3.21275 7.84168 3.20376 7.90993 3.22092 7.97398C3.23808 8.03803 3.27998 8.09264 3.3374 8.12579L8.78429 11.2706C8.90385 11.3396 9.05674 11.2986 9.12578 11.1791C9.71191 10.1641 9.71348 8.97262 9.23682 7.99339L10.8583 5.18521C11.5115 5.00603 12.0982 4.57973 12.4638 3.94629C12.5328 3.82672 12.4919 3.67383 12.3723 3.6048L8.18237 1.18584C8.12494 1.15268 8.0567 1.1437 7.99265 1.16086C7.92861 1.17803 7.874 1.21993 7.84086 1.27736C7.47521 1.91077 7.39934 2.63194 7.57065 3.28723L5.94919 6.09545C4.86323 6.1723 3.83201 6.76934 3.24591 7.78426Z' fill='%23FEA21E' stroke='%23FEA21E' stroke-width='0.5' stroke-linejoin='round'/%3e%3c/svg%3e",loading:"lazy"}),onClick:e,color:"white",className:`label-pinned ${n}`,style:i})},N=e=>({message:e("notification.failure"),type:"danger"});var A="data:image/svg+xml,%3csvg width='16' height='17' viewBox='0 0 16 17' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M8 14.5C11.3137 14.5 14 11.8137 14 8.5C14 5.18629 11.3137 2.5 8 2.5C4.68629 2.5 2 5.18629 2 8.5C2 11.8137 4.68629 14.5 8 14.5Z' fill='%23FE921D'/%3e%3cpath d='M8 5.5V8.5' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M8 11.5H8.00708' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e";const I=(e,a)=>{const[l,o]=t.useState(e||[]);return{onSelectImages:t=>{const n=t.target.files;if(n)if(a&&e){a((e||l).concat(Array.from(n)))}else o((t=>{const l=e||t;return a&&a(l.concat(Array.from(n))),l.concat(Array.from(n))}))},onRemoveImage:t=>{if(a&&e){const l=e;l.splice(t,1),a(l.slice())}else o((l=>{const o=e||l;return o.splice(t,1),a&&a(o.slice()),o.slice()}))},onRemoveAllImages:()=>{a?a([]):o([])},imageSrcs:t.useMemo((()=>(e||l).map((e=>"string"==typeof e?e:URL.createObjectURL(e)))),[e,l]),imageFiles:e||l}};var _="data:image/svg+xml,%3csvg width='24' height='25' viewBox='0 0 24 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 22.9844C17.5228 22.9844 22 18.5072 22 12.9844C22 7.46153 17.5228 2.98438 12 2.98438C6.47715 2.98438 2 7.46153 2 12.9844C2 18.5072 6.47715 22.9844 12 22.9844Z' fill='%23262626'/%3e%3cpath d='M14.8281 10.1562L9.17127 15.8131' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M9.17188 10.1562L14.8287 15.8131' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e";const M=({className:e,style:a,bannedWords:n=[],value:s,onChange:d,onPreviewUrlChange:c,onInvalidUrlsChange:u,onImageFilesChange:p,imageFiles:v,isReplying:g})=>{const{t:f}=o.useTranslations(),[h,C]=t.useState(null),y=t.useRef(null),{onSelectImages:E,onRemoveImage:b,imageSrcs:P}=I(v,p);return t.useEffect((()=>{c&&((null==h?void 0:h.url)?c({title:h.title||"",url:h.url||"",image:h.image||"",description:h.description||""}):c(null))}),[h]),w.default.createElement(l.StyledCreatePostDescription,{className:e,style:a},w.default.createElement(r.Text,{size:"p4",className:"description-label"},f("createPost.popup.description")),w.default.createElement("div",{className:"textarea-control"},w.default.createElement("div",{className:"textarea-wrapper"},w.default.createElement(l.RichTextEditor,{html:s||"",onChange:d,bannedWords:n,onImagePickerClick:()=>{var e;return null===(e=y.current)||void 0===e?void 0:e.click()},onPreviewUrlChange:C,onInvalidUrlsChange:u,isReplying:g}))),w.default.createElement(r.Text,{size:"p4",className:"count-string"},f("character"),": ",k.default(s||"").length),(!P||0===P.length)&&h&&w.default.createElement("div",{className:"link-preview-wrapper"},h.isFetching?w.default.createElement(l.Loading,null):w.default.createElement(w.default.Fragment,null,w.default.createElement(S,{title:h.title,url:h.url||"#",image:h.image,noRefetch:!0}),w.default.createElement("img",{src:_,className:"icon-close",onClick:()=>C(null),loading:"lazy"}))),w.default.createElement("input",{ref:y,type:"file",accept:"image/png, image/gif, image/jpeg",multiple:!0,style:{display:"none"},onChange:E}),P.length>m.MAX_IMAGE_UPLOADS?w.default.createElement("div",{className:"input-notification"},w.default.createElement("img",{src:A,loading:"lazy"}),w.default.createElement(r.Text,{size:"p4",color:i.theme.colors.alertWarning},f("createPost.popup.warningImage"))):null,P.length>0&&w.default.createElement("div",{className:"image-gallery"},P.map(((e,t)=>w.default.createElement("div",{key:t,className:"image-item"},w.default.createElement("img",{src:e,loading:"lazy"}),w.default.createElement("img",{className:"close-btn",src:_,onClick:()=>b(t),loading:"lazy"}))))))},L=(e,t)=>{if(!t)return e;const{limit:a,bannedWords:o=[]}=t,n="number"==typeof a&&a>=0?e.substring(0,a):e;return l.highlightBadWords(n,o)},j=({className:e,style:a,bannedWords:n=[],value:i,onChange:s})=>{var d;const{t:c}=o.useTranslations(),[u,m]=t.useState(""),p=t.useRef(null);t.useEffect((()=>{if(p.current){const e=e=>{var t;e.preventDefault();const a=null===(t=e.clipboardData)||void 0===t?void 0:t.getData("text/plain");document.execCommand("insertHTML",!1,a)},t=p.current;return t.addEventListener("paste",e,{passive:!0}),()=>t.removeEventListener("paste",e)}}),[p]);const g=(null==n?void 0:n.join(","))||"";t.useEffect((()=>{var e;if(g){const t=null===(e=p.current)||void 0===e?void 0:e.innerText;if(t){const e=l.highlightBadWords(t,n);e!==t&&(s&&s(e),m(e))}}}),[g]);const f=t.useCallback(b.default((()=>{if(p.current){const e=L(p.current.innerText,{limit:120,bannedWords:n});s&&s(e),m(e)}}),300),[]);return t.useEffect((()=>{setTimeout((()=>{var e;null===(e=p.current)||void 0===e||e.focus()}),500)}),[]),w.default.createElement(l.StyledCreatePostTitle,{className:e,style:a},w.default.createElement(v.Input,{name:"title",value:i||u,size:"md",label:c("createPost.title"),CustomInput:w.default.createElement(P.default,{innerRef:p,html:i||u,onChange:()=>{if(p.current&&p.current.innerText!==(i||u)){const e=L(p.current.innerText,{bannedWords:n});s&&s(e),m(e),f()}},className:"title-input"})}),w.default.createElement(r.Text,{size:"p4",className:"count-string"},c("createPost.popup.wordCount",{count:(null===(d=p.current)||void 0===d?void 0:d.innerText.length)||0,max:120})))},R=({className:a,style:o,topics:n,communityId:i,onChange:r,isLoading:s,disabled:d,forceTopics:c,selectedTopics:u,noFetch:v,dataEventCategory:g,dataEventAction:f,dataEventLabel:h})=>{const{data:{locale:C,env:{isMarryBaby:y}}}=t.useContext(m.TogetherComponentGlobalContext),[E,k]=t.useState(n?[...n]:[]),[b,P]=t.useState(u?[...u]:[]),[T,S]=t.useState(!1),x=t.useRef(n);x.current=n,t.useEffect((()=>{var t;!i||v||(null===(t=x.current)||void 0===t?void 0:t.length)||(k([]),S(!0),e.__awaiter(void 0,void 0,void 0,(function*(){var e;try{const t=yield m.callApi(m.getApiPath(m.PATHS.TOPIC.LIST,{communityId:i,_locale:C}),"GET"),a=null===(e=null==t?void 0:t.data)||void 0===e?void 0:e.topics;Array.isArray(a)&&k((()=>(null==a?void 0:a.map(p.formatTopic).sort(((e,t)=>(e.order||0)-(t.order||0))))||[]))}catch(e){console.log(e),S(!1)}S(!1)})))}),[i,v]);const N=null==n?void 0:n.map((e=>e.id)).join("-"),A=null==E?void 0:E.map((e=>e.id)).join("-"),I=null==c?void 0:c.map((e=>e.id)).join("-");t.useEffect((()=>{n&&void 0!==N&&N!==A&&k(n)}),[n,N,A]);const _=t.useMemo((()=>E.filter((e=>!(null==c?void 0:c.some((t=>t.id&&t.id===e.id||t.mappedCategoryId&&t.mappedCategoryId===e.mappedCategoryId)))))),[A,I]);return w.default.createElement(l.StyledTopicSelectList,{"data-is-marrybaby":y,className:a,style:o},c.map((e=>w.default.createElement(B,{key:`${e.id}-${e.mappedCategoryId}`,topic:e,disabled:!0,selected:!0,dataEventAction:f,dataEventCategory:g,dataEventLabel:h}))),_.map((e=>w.default.createElement(B,{key:`${e.id}-${e.mappedCategoryId}`,topic:e,disabled:d,selected:(u||b).some((t=>t.id&&t.id===e.id||t.mappedCategoryId&&t.mappedCategoryId===e.mappedCategoryId)),onClick:()=>{const t=u||b,a=t.findIndex((t=>t.id&&t.id===e.id||t.mappedCategoryId&&t.mappedCategoryId===e.mappedCategoryId));-1!==a?t.splice(a,1):t.push(e),r&&u?r(t.slice()):(r&&r(t.slice()),P(t.slice()))},dataEventAction:f,dataEventCategory:g,dataEventLabel:h}))),(s||T)&&w.default.createElement(l.Loading,{className:"topic-spinner"}))},B=t=>{var{topic:a,disabled:l,selected:o,onClick:n}=t,i=e.__rest(t,["topic","disabled","selected","onClick"]);return w.default.createElement("div",Object.assign({className:"tag-item"+(o?" --active":""),"data-disabled":l,onClick:l?void 0:n},i),a.name)},O=({className:e,isMarryBaby:a,style:o,title:n,description:i,acceptText:s,cancelText:d,onAccept:c,onCancel:p,thumbnail:v,isThumbnailIcon:g,onClose:f,acceptBtnTracking:C,acceptBtnProps:y,cancelBtnProps:E})=>{const{data:{env:{isMarryBaby:k}}}=t.useContext(m.TogetherComponentGlobalContext),b="boolean"==typeof a?a:k,[P,S]=t.useState(!1);return t.useEffect((()=>(u.toggleNoScroll(!0),setTimeout((()=>S(!0)),0),()=>u.toggleNoScroll(!1))),[]),"undefined"==typeof window?null:T.createPortal(w.default.createElement(l.StyledPopupDanger,{"data-is-marrybaby":b,className:e,style:o,"data-open":P},w.default.createElement(l.PopupFrame,{className:"popup-frame",isOpen:P,onClose:f},w.default.createElement("div",{className:"confirm-dialog",onClick:e=>e.stopPropagation()},w.default.createElement("div",{className:"confirm-content"},v&&w.default.createElement("div",{className:"thumbnail-container "+(g?"is-icon":"")},w.default.createElement("img",{className:"thumbnail",src:v,loading:"lazy"})),w.default.createElement(m.Heading,{className:"title",tag:"h2"},n),w.default.createElement(r.Text,{className:"desc",size:"lg"},i),w.default.createElement("div",{className:"btn-group"},w.default.createElement(h.Button,Object.assign({theme:b?"marryBaby":"helloSites",size:"md",color:"tertiary",onClick:()=>{null==c||c(),null==f||f()}},y,C),s),w.default.createElement(h.Button,Object.assign({theme:b?"marryBaby":"helloSites",size:"md",onClick:()=>{null==p||p(),null==f||f()}},E),d)))),b&&v&&w.default.createElement("div",{className:"thumbnail-container is-mobile "+(g?"is-icon":"")},w.default.createElement("img",{className:"thumbnail",src:v,loading:"lazy"})))),u.getPopupWrapperDom())};const z=({isReply:a,className:n,onClose:i,replyToName:s,style:d,replyingId:c,replyingUser:u,onPostSuccess:g,post:f,isMarryBaby:C})=>{const{action:{pushNotifications:y,sanitizeFunction:E},data:{userInfo:k,locale:b,env:{isMarryBaby:P}}}=t.useContext(m.TogetherComponentGlobalContext),T="boolean"==typeof C?C:P,{t:x}=o.useTranslations(),{onSelectImages:N,onRemoveImage:A,imageSrcs:M,onRemoveAllImages:L,imageFiles:j}=I(),[R,B]=t.useState(""),{trigger:O}=t.useContext(l.MainInputTriggerContext),[z,D]=t.useState(!1),F=t.useRef(null),U=t.useRef(null),H=t.useRef(null),[W,V]=t.useState([]),[$,G]=t.useState([]),[q,Z]=t.useState(null);return t.useEffect((()=>{var e;null===(e=H.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"start"}),setTimeout((()=>{var e;null===(e=U.current)||void 0===e||e.focus()}),400)}),[O]),w.default.createElement(l.StyledInputCommentBar,{"data-is-reply":a,className:n,style:d},a&&w.default.createElement("div",{className:"reply-to-container"},w.default.createElement(r.Text,{size:"p4"},w.default.createElement("span",{dangerouslySetInnerHTML:{__html:x("inputComment.replyTo",{name:`<span style="color: #2D87F3; cursor: pointer">@${s||""}</span>`})}})),w.default.createElement("img",{src:"data:image/svg+xml,%3csvg width='16' height='17' viewBox='0 0 16 17' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8.00016' cy='8.50004' r='6.66667' fill='white' stroke='%23404040'/%3e%3cpath d='M10 6.5L6 10.5' stroke='%23404040' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M6 6.5L10 10.5' stroke='%23404040' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",className:"icon-close-comment",onClick:()=>i&&i(),loading:"lazy"})),w.default.createElement("div",{className:"input-container",ref:H},w.default.createElement(p.UserAvatar,{className:"avatar-wrapper "+(a?"avatar-wrapper-reply":""),avatar:(null==k?void 0:k.id)?k.avatar:m.DEFAULT_AVATAR_IMG,username:(null==k?void 0:k.name)||(null==k?void 0:k.username)}),w.default.createElement("input",{ref:F,onChange:N,type:"file",multiple:!0,accept:"image/png,image/jpeg",name:"images",style:{display:"none"}}),w.default.createElement(v.Input,{value:R,name:"input",size:"md",className:"input-wrapper",displayIcon:w.default.createElement("img",{src:"data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M10.7543 4.85352H4.49227C4.01776 4.85352 3.56268 5.04201 3.22715 5.37754C2.89162 5.71307 2.70313 6.16815 2.70312 6.64266V19.1667C2.70313 19.6412 2.89162 20.0963 3.22715 20.4318C3.56268 20.7673 4.01776 20.9558 4.49227 20.9558H17.0163C17.4908 20.9558 17.9459 20.7673 18.2814 20.4318C18.6169 20.0963 18.8054 19.6412 18.8054 19.1667V12.9047' stroke='%232D87F3' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M17.4633 3.51187C17.8192 3.15599 18.3019 2.95605 18.8052 2.95605C19.3085 2.95605 19.7912 3.15599 20.147 3.51187C20.5029 3.86775 20.7029 4.35044 20.7029 4.85373C20.7029 5.35702 20.5029 5.83971 20.147 6.19559L11.6486 14.694L8.07031 15.5886L8.96489 12.0103L17.4633 3.51187Z' stroke='%232D87F3' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",loading:"lazy"}),CustomInput:w.default.createElement("div",{className:"as-input"},w.default.createElement(l.RichTextEditor,{className:"textarea",html:R,onChange:B,onImagePickerClick:()=>{var e;return null===(e=F.current)||void 0===e?void 0:e.click()},bannedWords:$,onPreviewUrlChange:Z,onInvalidUrlsChange:V,setEditorRef:e=>U.current=e,isReplying:a}))}),w.default.createElement(h.Button,{theme:T?"marryBaby":"helloSites",className:"send-button",size:"sm",onClick:()=>e.__awaiter(void 0,void 0,void 0,(function*(){var t,o,n,r,s,d,v,h,C;if((null==f?void 0:f.id)&&!z){D(!0);try{const w=e=>{B(""),L(),i&&i();const t=p.formatComment(e.data);"string"==typeof t.images&&(t.images=JSON.parse(t.images)),g&&g(t)},k=yield(({postId:t,message:a,photos:o,link:n,locale:i,sanitizeFunction:r,replyingUserId:s,replyingUserName:d,replyingId:c})=>e.__awaiter(void 0,void 0,void 0,(function*(){const e=new FormData;let u=l.encodePostContent(a.replace(/(\ )+/g," "),r);const p=l.getMentionIdsFromString(u);return o&&o.length>0&&(yield Promise.all(null==o?void 0:o.map((e=>l.uploadAndGetSrc(e,i))))).filter(Boolean).slice(0,m.MAX_IMAGE_UPLOADS).forEach((t=>{e.append("images[]",t)})),n&&e.append("link",n),null==p||p.forEach((t=>{e.append("mention_ids[]",t)})),e.append("post_id",t),c&&e.append("parent_id",c),s&&(p.unshift(s),u=`[mention+id="${s}"+name="${(d||"").replace('"',"'")}"]${u}`,e.append("parent_user_id",String(s))),e.append("content",u),e.append("content",u),e})))(Object.assign({message:R,photos:j,postId:String(f.id),link:null==q?void 0:q.url,sanitizeFunction:E,locale:b},a&&c?{replyingUserId:String((null==u?void 0:u.id)||(null===(t=null==f?void 0:f.author)||void 0===t?void 0:t.id)||""),replyingId:c,replyingUserName:(null==u?void 0:u.name)||(null==u?void 0:u.username)||""}:{})),P=yield a&&c?((t,a)=>e.__awaiter(void 0,void 0,void 0,(function*(){return m.callApiWithAuth(m.getApiPath(m.PATHS.COMMENT.REPLY,{_locale:a}),"POST",{data:t})})))(k,b):((t,a)=>e.__awaiter(void 0,void 0,void 0,(function*(){return m.callApiWithAuth(m.getApiPath(m.PATHS.COMMENT.CREATE,{_locale:a}),"POST",{data:t})})))(k,b),T=null==P?void 0:P.data;(null==T?void 0:T.id)&&!(null===(n=null===(o=null==P?void 0:P.messages)||void 0===o?void 0:o.moderation)||void 0===n?void 0:n.type)?w(P):"banned"===(null===(s=null===(r=null==P?void 0:P.messages)||void 0===r?void 0:r.moderation)||void 0===s?void 0:s.type)?(y({title:x("notification.comment.blocked.title"),message:x("notification.comment.blocked.message"),type:"danger"}),P.messages.moderation.words&&G(P.messages.moderation.words)):"suspect"===(null===(v=null===(d=null==P?void 0:P.messages)||void 0===d?void 0:d.moderation)||void 0===v?void 0:v.type)?(y({title:x("notification.comment.suspect.title"),message:x("notification.comment.suspect.message"),type:"warning"}),B(""),L(),i&&i()):(null===(h=null==P?void 0:P.messages)||void 0===h?void 0:h.find((e=>{var t;return!!(null===(t=null==e?void 0:e.includes)||void 0===t?void 0:t.call(e,"suspend"))})))?(y({message:x("notification.suspend.message"),type:"warning"}),B(""),L(),i&&i()):y({title:"",message:(null===(C=null==P?void 0:P.messages)||void 0===C?void 0:C[0])||x("notification.comment.somethingWrong"),type:"danger"})}catch(e){y({title:"",message:x("notification.comment.somethingWrong"),type:"danger"})}D(!1)}})),isLoading:z,isDisabled:!!(null==W?void 0:W.length)||z||!R||(null==R?void 0:R.length)<2||!R.trim()},w.default.createElement("img",{src:"data:image/svg+xml,%3csvg width='20' height='21' viewBox='0 0 20 21' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M7.5 9.73438L3.75 13.4844L7.5 17.2344' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M16.25 4.73438L16.25 10.3026C16.25 11.1464 15.9208 11.9557 15.3347 12.5524C14.7487 13.1491 13.9538 13.4844 13.125 13.4844L3.75 13.4844' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",className:"icon-enter",loading:"lazy"}))),(null==W?void 0:W.length)?w.default.createElement("div",{className:"error-text"},x("notification.limitUrlDomain")):null,(!M||0===M.length)&&q&&w.default.createElement("div",{className:"link-preview-wrapper"},q.isFetching?w.default.createElement(l.Loading,null):w.default.createElement(w.default.Fragment,null,w.default.createElement(S,{title:q.title,url:q.url||"#",image:q.image,noRefetch:!0}),w.default.createElement("img",{src:_,className:"icon-close",onClick:()=>Z(null),loading:"lazy"}))),M&&M.length>0&&w.default.createElement("div",{className:"preview-images-container"},M.map(((e,t)=>w.default.createElement("div",{key:t,className:"image-src-wrapper"},w.default.createElement("img",{className:"preview-image",src:e,loading:"lazy"}),w.default.createElement("img",{src:_,className:"icon-close-circle",onClick:()=>A(t),loading:"lazy"}))))))};var D="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M8 14C11.3137 14 14 11.3137 14 8C14 4.68629 11.3137 2 8 2C4.68629 2 2 4.68629 2 8C2 11.3137 4.68629 14 8 14Z' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M8 5V8' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M8 11H8.00708' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e";const F=({className:a,style:n,reason:s,reasonText:d,onClose:c,postId:u})=>{const{data:{locale:p,env:{isMarryBaby:v}},action:{pushNotifications:g}}=t.useContext(m.TogetherComponentGlobalContext),{t:f}=o.useTranslations(),[C,y]=t.useState(!1);return w.default.createElement(l.StyledSubmitReportForm,{"data-is-marrybaby":v,className:a,style:n},w.default.createElement("ul",{className:"report-list"},w.default.createElement("li",{className:"report-item"},w.default.createElement("img",{src:D,loading:"lazy"}),w.default.createElement(r.Text,{className:"__label",color:i.theme.colors.gray800,size:"p4"},d))),w.default.createElement(h.Button,{theme:v?"marryBaby":"helloSites",className:"report-submit",size:"lg",color:"primary",isLoading:C,onClick:()=>e.__awaiter(void 0,void 0,void 0,(function*(){if(u&&!C){y(!0);try{const e=yield(({id:e,reason:t,locale:a})=>{const l=new FormData;return l.append("reason",t),m.callApiWithAuth(m.getApiPath(m.PATHS.POST.REPORT,{_locale:a,id:e}),"POST",{data:l})})({id:u,reason:s,locale:p});1===(null==e?void 0:e.status)&&(g({message:"Post reported",type:"success"}),c&&c())}catch(e){}y(!1)}}))},f("submit")))};const U=({className:e,style:n,authorName:i,images:s,onClose:d,onOpenSingleView:c,alt:u})=>{const{t:m}=o.useTranslations(),[p,v]=t.useState(!1);return t.useEffect((()=>{setTimeout((()=>{v(!0)}),0)}),[]),w.default.createElement(a.Portal,null,w.default.createElement(l.StyledImagePreviewPopup,{className:e,style:n,"data-open":p},w.default.createElement("div",{className:"top-bar"},w.default.createElement("img",{className:"icon-arrow-left",src:"data:image/svg+xml,%3csvg width='24' height='25' viewBox='0 0 24 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M10.0508 18.0607L4.00078 12.0367L10.0508 6.01172' stroke='%23262626' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M4.00195 12.0352L19.002 12.0352' stroke='%23262626' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",onClick:d,alt:"go back",loading:"lazy"}),w.default.createElement(r.Text,{size:"p2",weight:"bold",style:{textAlign:"center"}},m("previewPhotos.title",{name:i}))),w.default.createElement("div",{className:"container"},s.map(((e,t)=>w.default.createElement("img",{className:"img-preview",key:t,src:e,onClick:()=>null==c?void 0:c(t),alt:u,loading:"lazy"}))))),",")};var H="data:image/svg+xml,%3csvg width='16' height='17' viewBox='0 0 16 17' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M6 12.8125L10 8.8125L6 4.8125' stroke='white' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e";const W=({initialViewIndex:e,images:o,onClose:n,alt:i})=>{const[r,s]=t.useState(e),[d,c]=t.useState(!1);t.useEffect((()=>{setTimeout((()=>{c(!0)}),0)}),[]);const u=null==o?void 0:o[r],m=0===r,p=!(null==o?void 0:o.length)||r===(null==o?void 0:o.length)-1;return w.default.createElement(a.Portal,null,w.default.createElement(l.StyledImagePreviewContainer,{"data-open":d&&!!u},w.default.createElement(l.StyledImagePreviewTopbar,null,w.default.createElement("img",{src:l.img,className:"icon-close",onClick:n,alt:"close",loading:"lazy"})),u&&r>=0&&w.default.createElement(w.default.Fragment,null,w.default.createElement(l.StyledImagePreviewWrapper,null,w.default.createElement("img",{className:"img-preview",src:u,alt:i,loading:"lazy"}),w.default.createElement(l.StyledArrowWrapper,{"data-disabled":m,onClick:()=>!m&&s(r-1)},w.default.createElement(l.StyledCircleArrow,null,w.default.createElement("img",{src:H,style:{transform:"rotate(180deg)"},alt:"left arrow","data-disabled":m,loading:"lazy"}))),w.default.createElement(l.StyledArrowWrapper,{"data-right":!0,"data-disabled":p,onClick:()=>!p&&s(r+1)},w.default.createElement(l.StyledCircleArrow,null,w.default.createElement("img",{src:H,alt:"right arrow","data-disabled":p,loading:"lazy"})))))))},V=({image:e,showIcon:a=!0})=>{const[o,n]=t.useState(!0);return w.default.createElement(l.StyledWrapper,{"data-is-blurred":o,onClick:e=>o&&e.stopPropagation()},w.default.createElement("img",{loading:"lazy",className:"img-preview",src:e}),w.default.createElement(l.StyledInner,{onClick:e=>{e.stopPropagation(),n(!o)}},a&&w.default.createElement(l.StyledIcon,null,o?w.default.createElement("svg",{width:"22",height:"20",viewBox:"0 0 22 20",fill:"none"},w.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.71 2.5399C1.32 2.1499 1.32 1.5199 1.71 1.1299C2.1 0.739902 2.74 0.739902 3.13 1.1299L19.44 17.4599C19.83 17.8499 19.83 18.4799 19.44 18.8699C19.05 19.2599 18.42 19.2599 18.03 18.8699L15.31 16.1499C13.97 16.6699 12.52 16.9699 11 16.9699C6 16.9699 1.73 13.8599 0 9.4699C0.77 7.4999 2.06 5.7999 3.68 4.5099L1.71 2.5399ZM16 9.4699C16 6.7099 13.76 4.4699 11 4.4699C10.49 4.4699 10 4.5699 9.53 4.7099L7.36 2.5399C8.51 2.1699 9.73 1.9699 11 1.9699C16 1.9699 20.27 5.0799 22 9.4599C21.31 11.2199 20.21 12.7599 18.82 13.9899L15.76 10.9299C15.9 10.4699 16 9.9799 16 9.4699ZM11 14.4699C8.24 14.4699 6 12.2299 6 9.4699C6 8.6999 6.18 7.9699 6.49 7.3299L8.06 8.8999C8.03 9.0799 8 9.2699 8 9.4699C8 11.1299 9.34 12.4699 11 12.4699C11.2 12.4699 11.38 12.4399 11.57 12.3999L13.14 13.9699C12.49 14.2899 11.77 14.4699 11 14.4699ZM13.97 9.1399C13.82 7.7399 12.72 6.6499 11.33 6.4999L13.97 9.1399Z",fill:"white"})):w.default.createElement("svg",{width:"23",height:"16",viewBox:"0 0 23 16",fill:"none"},w.default.createElement("path",{d:"M11.9999 0C5.14188 0 1.88558 5.87864 1.09558 7.55664C0.963582 7.83664 0.963582 8.16141 1.09558 8.44141C1.88558 10.1204 5.14188 16 11.9999 16C18.8339 16 22.0924 10.1629 22.8964 8.46094C23.0344 8.16794 23.0344 7.83206 22.8964 7.53906C22.0924 5.83706 18.8339 0 11.9999 0ZM11.9999 3C14.7609 3 16.9999 5.239 16.9999 8C16.9999 10.761 14.7609 13 11.9999 13C9.23888 13 6.99988 10.761 6.99988 8C6.99988 5.239 9.23888 3 11.9999 3ZM11.9999 5C11.2042 5 10.4412 5.31607 9.87856 5.87868C9.31595 6.44129 8.99988 7.20435 8.99988 8C8.99988 8.79565 9.31595 9.55871 9.87856 10.1213C10.4412 10.6839 11.2042 11 11.9999 11C12.7955 11 13.5586 10.6839 14.1212 10.1213C14.6838 9.55871 14.9999 8.79565 14.9999 8C14.9999 7.20435 14.6838 6.44129 14.1212 5.87868C13.5586 5.31607 12.7955 5 11.9999 5Z",fill:"#2D87F3"})))))},$=({className:e,images:a=[],style:n,authorName:i,isSensitive:r=!1,alt:s})=>{const{data:{env:{isMarryBaby:d}}}=t.useContext(m.TogetherComponentGlobalContext),{t:c}=o.useTranslations(),p="+ "+((a.length||0)-4),[v,g]=t.useState(!1),[f,h]=t.useState(-1),C=a.length>5,y=t.useRef(!1);return t.useEffect((()=>()=>{y.current&&u.toggleNoScroll(!1)}),[]),t.useEffect((()=>{v||f>=0?(u.toggleNoScroll(!0),y.current=!0):(u.toggleNoScroll(!1),y.current=!1)}),[v,f]),w.default.createElement(w.default.Fragment,null,r&&w.default.createElement(l.StyledNotificationBar,{message:c("sensitiveMask.contentWarningDescription"),icon:w.default.createElement("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none"},w.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.00002 0.666748C4.40002 0.666748 0.666687 4.40008 0.666687 9.00008C0.666687 13.6001 4.40002 17.3334 9.00002 17.3334C13.6 17.3334 17.3334 13.6001 17.3334 9.00008C17.3334 4.40008 13.6 0.666748 9.00002 0.666748ZM9.00002 9.83341C8.54169 9.83341 8.16669 9.45841 8.16669 9.00008V5.66675C8.16669 5.20842 8.54169 4.83342 9.00002 4.83342C9.45835 4.83342 9.83335 5.20842 9.83335 5.66675V9.00008C9.83335 9.45841 9.45835 9.83341 9.00002 9.83341ZM8.16669 11.5001V13.1667H9.83335V11.5001H8.16669Z",fill:"#FE921D"}))}),w.default.createElement(l.StyledPostImagePreview,{className:e,style:n,"data-image-count":C?5:a.length||0,"data-is-marrybaby":d,"data-cursor-pointer":!r},null==a?void 0:a.slice(0,5).map(((e,t)=>{const a=4===t&&C;return w.default.createElement("div",{className:"img-wrapper",key:t,onClick:()=>{t>=4&&C?g(!0):h(t)}},r&&w.default.createElement(V,{image:e,showIcon:!a}),!d&&w.default.createElement("img",{loading:"lazy",className:"img-preview-blur",src:e,alt:s}),w.default.createElement("img",{loading:"lazy",className:"img-preview",src:e,alt:s}),a&&w.default.createElement("div",{className:"img-more-overlay"},w.default.createElement(m.Heading,{tag:"h1",as:"h2",color:"white"},p)))}))),v&&w.default.createElement(U,{authorName:i||"",images:a,onClose:()=>g(!1),onOpenSingleView:h,alt:s}),f>=0&&w.default.createElement(W,{images:a,initialViewIndex:f,onClose:()=>h(-1),alt:s}))},G=({url:o,image:n,className:i,style:r,autoPlay:d=!0})=>{const{data:{locale:c}}=t.useContext(m.TogetherComponentGlobalContext),[u,p]=t.useState(null);t.useEffect((()=>{e.__awaiter(void 0,void 0,void 0,(function*(){if(!n){if(!o)return p(null);p((e=>Object.assign(Object.assign({},e),{isFetching:!0}))),m.callApi(m.getApiPath(m.PATHS.FETCH_PREVIEW,{_locale:c}),"POST",{data:{link:o},headers:{"Content-Type":"application/json"}}).then((e=>{var t,a;p({url:o,image:(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.image)||(null===(a=null==e?void 0:e.data)||void 0===a?void 0:a.logo)})})).catch((()=>{p(null)}))}}))}),[o,n]);const v=n||(null==u?void 0:u.image),g=(null==u?void 0:u.url)||o,f=t.useMemo((()=>l.youtubeVidIdGetter(g)),[g]),h=t.useMemo((()=>g.includes("facebook.com")||g.includes("fb.watch")),[g]),C=t.useRef(0),y=t.useRef(0),[E,k]=t.useState(!1);t.useEffect((()=>{const e=()=>{var e;const t=null===(e=b.current)||void 0===e?void 0:e.getBoundingClientRect();let a=!1;t&&(!C.current||Math.abs((C.current-t.width)/(null==t?void 0:t.width))>.2)&&(C.current=Math.floor(t.width),a=!0),t&&(!y.current||Math.abs((y.current-t.height)/(null==t?void 0:t.height))>.2)&&(y.current=Math.floor(t.height),a=!0),a&&k((e=>!e))};return e(),window.addEventListener("resize",e,{passive:!0}),()=>{window.removeEventListener("resize",e)}}),[]);const b=t.useRef(null),P=a.useMantineTheme();return w.default.createElement(l.StyledSocialLinkPreview,{className:`${i} no-replace-click`,style:r,ref:b,color:P.colors[P.primaryColor][0]},n||!f&&!h?w.default.createElement("a",{href:g,target:"_blank",rel:"noreferrer"},w.default.createElement("div",{className:"link-image-wrapper "+((null==u?void 0:u.isFetching)?"fetching":"")},(null==u?void 0:u.isFetching)?w.default.createElement(l.Loading,{className:"loading-spinner"}):w.default.createElement(s.ImageWrap,{className:"link-image",src:v||m.DEFAULT_IMG,backupSrc:m.DEFAULT_IMG,alt:g}))):w.default.createElement("div",{className:"link-image-wrapper"},f?w.default.createElement("iframe",{width:"100%",height:"100%",src:`https://www.youtube.com/embed/${f}?&autoplay=${d?1:0}&mute=1&enablejsapi=1`,frameBorder:"0",allowFullScreen:!0,style:{position:"absolute",top:0,left:0,border:"none",overflow:"hidden"},loading:"lazy"}):h?w.default.createElement("iframe",{key:String(E),src:`https://www.facebook.com/plugins/video.php?href=${encodeURIComponent(g)}&autoplay=${d?1:0}&show_text=false&t=0&width=${C.current}&height=${y.current}`,style:{position:"absolute",top:"50%",left:"50%",border:"none",overflow:"hidden",height:y.current,width:C.current,transform:"translate(-50%, -50%)"},scrolling:"no",frameBorder:"0",allowFullScreen:!0,allow:"autoplay; clipboard-write; encrypted-media; picture-in-picture; web-share",loading:"lazy"}):null))};var q="KsWg8i6",Z="_9tS0EUN",Q="kyyRKlb",K="-Uqqka-";var X="data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cpath d='M5 10C3.9 10 3 10.9 3 12C3 13.1 3.9 14 5 14C6.1 14 7 13.1 7 12C7 10.9 6.1 10 5 10Z' fill='%233E3F58'/%3e %3cpath d='M19 10C17.9 10 17 10.9 17 12C17 13.1 17.9 14 19 14C20.1 14 21 13.1 21 12C21 10.9 20.1 10 19 10Z' fill='%233E3F58'/%3e %3cpath d='M12 10C10.9 10 10 10.9 10 12C10 13.1 10.9 14 12 14C13.1 14 14 13.1 14 12C14 10.9 13.1 10 12 10Z' fill='%233E3F58'/%3e %3c/svg%3e",J="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='%23595959' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 13.3334L8 10.3704L4 13.3334V3.85187C4 3.53754 4.12041 3.23608 4.33474 3.01382C4.54906 2.79155 4.83975 2.66669 5.14286 2.66669H10.8571C11.1602 2.66669 11.4509 2.79155 11.6653 3.01382C11.8796 3.23608 12 3.53754 12 3.85187V13.3334Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",Y="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 13.3334L8 10.3704L4 13.3334V3.85187C4 3.53754 4.12041 3.23608 4.33474 3.01382C4.54906 2.79155 4.83975 2.66669 5.14286 2.66669H10.8571C11.1602 2.66669 11.4509 2.79155 11.6653 3.01382C11.8796 3.23608 12 3.53754 12 3.85187V13.3334Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",ee="data:image/svg+xml,%3csvg width='3' height='13' viewBox='0 0 3 13' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='1.58326' cy='6.41663' r='1.25' transform='rotate(89.9997 1.58326 6.41663)' fill='%23595959'/%3e%3cellipse cx='1.58326' cy='1.41663' rx='1.25' ry='1.25' transform='rotate(89.9997 1.58326 1.41663)' fill='%23595959'/%3e%3cellipse cx='1.58326' cy='11.4166' rx='1.25' ry='1.25' transform='rotate(89.9997 1.58326 11.4166)' fill='%23595959'/%3e%3c/svg%3e",te="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 5.33337C13.1046 5.33337 14 4.43794 14 3.33337C14 2.2288 13.1046 1.33337 12 1.33337C10.8954 1.33337 10 2.2288 10 3.33337C10 4.43794 10.8954 5.33337 12 5.33337Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M4 10C5.10457 10 6 9.10457 6 8C6 6.89543 5.10457 6 4 6C2.89543 6 2 6.89543 2 8C2 9.10457 2.89543 10 4 10Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M12 14.6666C13.1046 14.6666 14 13.7712 14 12.6666C14 11.5621 13.1046 10.6666 12 10.6666C10.8954 10.6666 10 11.5621 10 12.6666C10 13.7712 10.8954 14.6666 12 14.6666Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M5.72668 9.00665L10.28 11.66' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M10.2734 4.33997L5.72668 6.9933' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",ae="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M2 4H3.33333H14' stroke='%23737373' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M5.33334 3.99992V2.66659C5.33334 2.31296 5.47382 1.97382 5.72387 1.72378C5.97392 1.47373 6.31305 1.33325 6.66668 1.33325H9.33334C9.68697 1.33325 10.0261 1.47373 10.2762 1.72378C10.5262 1.97382 10.6667 2.31296 10.6667 2.66659V3.99992M12.6667 3.99992V13.3333C12.6667 13.6869 12.5262 14.026 12.2762 14.2761C12.0261 14.5261 11.687 14.6666 11.3333 14.6666H4.66668C4.31305 14.6666 3.97392 14.5261 3.72387 14.2761C3.47382 14.026 3.33334 13.6869 3.33334 13.3333V3.99992H12.6667Z' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M6.66666 7.33325V11.3333' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M9.33334 7.33325V11.3333' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e";const le=({authorEmail:a,onDeletePost:n,shareUrl:i,post:r,className:s="",popoverClassName:d="",onBookmark:u,onRemoveBookmark:p,onEditPost:v})=>{const{data:{locale:g,userInfo:f,togetherUserId:h,env:{isMarryBaby:C}},action:{pushNotifications:y}}=t.useContext(m.TogetherComponentGlobalContext),{t:E}=o.useTranslations(),[k,b]=t.useState(!1),[P,T]=t.useState(!1),[S,x]=t.useState(!1),{authActionWrapper:N}=l.useTogetherAuthRequiredAction(),A=a&&(null==f?void 0:f.email)&&a===String(null==f?void 0:f.email);return w.default.createElement("div",{className:s,onClick:e=>{e.preventDefault(),e.stopPropagation()}},S&&w.default.createElement(l.SharePopup,{url:i,text:null==r?void 0:r.title,onClose:()=>x(!1)}),P&&w.default.createElement(O,{thumbnail:c.CommonGAssets.getAssetPath("trash-bin.svg"),isThumbnailIcon:!0,title:E("popup.deletePost.title"),description:E("popup.deletePost.description"),acceptText:E("popup.deletePost.accept"),cancelText:E("popup.deletePost.cancel"),onAccept:()=>e.__awaiter(void 0,void 0,void 0,(function*(){if((null==r?void 0:r.id)&&!k){b(!0);try{const t=yield(({id:t,locale:a})=>e.__awaiter(void 0,void 0,void 0,(function*(){if(t)return yield m.callApiWithAuth(m.getApiPath(m.PATHS.POST.DELETE,{id:t,_locale:a}),"DELETE")})))({id:r.id,locale:g});1===(null==t?void 0:t.status)&&(null==n||n())}catch(e){}b(!1)}})),onClose:()=>T(!1)}),w.default.createElement(l.TreePopoverMenu,{className:d,toggleButtonContent:w.default.createElement("img",{src:C?X:ee,loading:"lazy"}),position:"bottom",align:"end",buttonProps:{isLoading:k},data:A?{isShowheader:!1,type:"list",list:[{icon:te,label:E("morePopover.share"),onClick:()=>x(!0)},{icon:"data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M7.16952 3.2356H2.99484C2.6785 3.2356 2.37512 3.36126 2.15143 3.58495C1.92774 3.80863 1.80208 4.11202 1.80208 4.42836V12.7777C1.80208 13.094 1.92774 13.3974 2.15143 13.6211C2.37512 13.8448 2.6785 13.9705 2.99484 13.9705H11.3442C11.6605 13.9705 11.9639 13.8448 12.1876 13.6211C12.4113 13.3974 12.537 13.094 12.537 12.7777V8.60303' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M11.6425 2.341C11.8798 2.10375 12.2016 1.97046 12.5371 1.97046C12.8726 1.97046 13.1944 2.10375 13.4317 2.341C13.6689 2.57826 13.8022 2.90005 13.8022 3.23558C13.8022 3.57111 13.6689 3.89289 13.4317 4.13015L7.76607 9.79578L5.38054 10.3922L5.97692 8.00663L11.6425 2.341Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",label:E("actionPopover.edit"),onClick:v},{icon:ae,label:E("actionPopover.delete"),onClick:()=>{N((()=>T(!0)))}}]}:{isShowheader:!1,type:"list",list:[{icon:te,label:E("morePopover.share"),onClick:()=>x(!0)},{icon:(null==r?void 0:r.bookmarked)?J:Y,label:(null==r?void 0:r.bookmarked)?E("morePopover.unsavePost"):E("morePopover.savePost"),onClick:()=>{N((()=>e.__awaiter(void 0,void 0,void 0,(function*(){if((null==f?void 0:f.id)&&(null==r?void 0:r.id))if(null==r?void 0:r.bookmarked){const e=yield m.callApiWithAuth(m.getApiPath(m.PATHS.BOOKMARK.DELETE,{_locale:g}),"DELETE",{data:{post_id:String(r.id)}});1===(null==e?void 0:e.status)?(y({title:"",message:"Removed saved post",type:"success",displayIcon:Y}),p&&p()):y({title:"",message:"Remove failed",type:"danger",displayIcon:Y})}else{const e=yield m.callApiWithAuth(m.getApiPath(m.PATHS.BOOKMARK.CREATE,{_locale:g}),"POST",{data:{user_id:h||f.id,post_id:r.id}});1===(null==e?void 0:e.status)?(y({title:"",message:"Post saved",type:"success",displayIcon:J}),u&&u()):y({title:"",message:"Post saved failed",type:"danger",displayIcon:Y})}}))))}},{icon:D,label:E("morePopover.report"),subTree:{title:E("morePopover.report.title"),description:E("morePopover.report.description"),isShowheader:!0,type:"list",list:Object.keys(m.REPORT_REASON_MAP).map((e=>({label:m.REPORT_REASON_MAP[e].label,reason:m.REPORT_REASON_MAP[e].reportReasonText,reasonValue:e}))).map((e=>({label:E(e.label),subTree:{title:E("morePopover.reportSubmit.title"),description:E("morePopover.reportSubmit.description"),isShowheader:!0,type:"jsx",jsxRenderer:t=>w.default.createElement(F,{reason:e.reasonValue,reasonText:E(e.reason),postId:null==r?void 0:r.id,onClose:()=>t&&t(!1)})}})))}}]}}))};const oe=({onDeleteComment:a,commentId:n,className:i="",popoverClassName:r=""})=>{const{data:{env:{isMarryBaby:s},locale:d},action:{pushNotifications:c}}=t.useContext(m.TogetherComponentGlobalContext),{t:u}=o.useTranslations(),[p,v]=t.useState(!1),{authActionWrapper:g}=l.useTogetherAuthRequiredAction();return w.default.createElement("div",{className:i,onClick:e=>{e.preventDefault(),e.stopPropagation()}},p&&w.default.createElement(O,{thumbnail:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='17' fill='none'%3e%3cg stroke='%23737373' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' clip-path='url(%23clip0)'%3e%3cpath d='M2 4.008h12M5.333 4.008V2.675a1.333 1.333 0 0 1 1.334-1.333h2.666a1.333 1.333 0 0 1 1.334 1.333v1.333m2 0v9.334a1.333 1.333 0 0 1-1.334 1.333H4.667a1.333 1.333 0 0 1-1.334-1.333V4.008h9.334ZM6.667 7.342v4M9.333 7.342v4'/%3e%3c/g%3e%3cdefs%3e%3cclipPath id='clip0'%3e%3cpath fill='white' d='M0 .008h16v16H0z'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",isThumbnailIcon:!0,title:u("popup.deleteComment.title"),description:u("popup.deleteComment.description"),acceptText:u("popup.deletePost.accept"),cancelText:u("popup.deletePost.cancel"),onAccept:()=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;if(!n)return;const t=yield(({id:e,locale:t})=>m.callApiWithAuth(m.getApiPath(m.PATHS.COMMENT.DELETE,{_locale:t,id:e}),"DELETE"))({id:n,locale:d});1===(null==t?void 0:t.status)?(a&&a(),c({title:"",message:u("notification.success"),type:"success"})):c({title:"",message:(null===(e=null==t?void 0:t.messages)||void 0===e?void 0:e[0])||u("notification.failure"),type:"danger"})})),onClose:()=>v(!1)}),w.default.createElement(l.TreePopoverMenu,{position:"bottom",align:"end",data:{isShowheader:!1,type:"list",list:[{icon:ae,label:u("actionPopover.delete"),onClick:()=>{g((()=>{v(!0)}))}}]},className:r,toggleButtonContent:w.default.createElement("img",{src:s?X:ee,loading:"lazy"}),buttonProps:{}}))};var ne="-dzIuHr";const ie=({userId:e,avatar:a,name:n,role:s,title:d,className:c})=>{const{t:u}=o.useTranslations(),[m,p]=t.useState(!1);return w.default.createElement(w.default.Fragment,null,w.default.createElement(h.Button,{className:`${ne} ${c}`,color:"success",size:"xs",onClick:()=>p(!0),style:{padding:"5px 8px",marginBottom:"12px",borderRadius:"4px"}},w.default.createElement("span",{className:"text"},w.default.createElement(r.Icon.Endorse,{isSolid:!0,size:18,color:i.theme.colors.green800,className:"icon"}),u("cardReply.verifyBy",{name:`${n||""}`}))),w.default.createElement(l.ProfileDetailModal,{open:m,onClose:()=>p(!1),profileModalProps:{zIndex:1e3}},w.default.createElement(l.ProfileDetail,{authorProps:{userId:e,avatar:a,name:n,role:s,title:d},hideQuestionTab:!0})))};const re=({className:a,style:n,comment:i,type:r="comment",level:s=0,replyingId:c,onPostCommentSuccess:u,post:p,onDeleteComment:v,refetchComment:g,hasQuickBookingEnable:f,handleMakeAppointment:C,cardAuthorProps:y,maxChars:E=600,disableShortenContent:k})=>{var b,P,T,x,N,A,I,_,M,L,j,R,B;const{data:{locale:O,userInfo:D,env:{isMarryBaby:F}}}=t.useContext(m.TogetherComponentGlobalContext),{t:U}=o.useTranslations(),[H,W]=t.useState(i||null),{id:V,countLikes:G,content:q,replies:Z=[],images:Q=[],author:K,liked:X,link:J,mentionedUser:Y,mentions:ee}=H,{text:te,replyingTo:ae}=(e=>{try{const t=e.match(/\[@([^\]]+)\]/),a=t?t[0].replace("[@","").replace("]",""):"";return{text:e.replace(/\[@([^\]]+)\]/,"").trim(),replyingTo:a}}catch(e){}return{text:""}})(q),{authActionWrapper:le}=l.useTogetherAuthRequiredAction({_joinCommunityIds:[null===(b=null==p?void 0:p.community)||void 0===b?void 0:b.id],_joinTopicIds:null===(P=null==p?void 0:p.topics)||void 0===P?void 0:P.map((e=>e.id))}),[ne,se]=t.useState(4),de=!!(null==D?void 0:D.id)&&(null==Z?void 0:Z.some((e=>e.author.id===D.id))),ce=e=>{W((t=>{if(!t.replies.find((t=>t.id===e.id))){t.replies.unshift(e);const a=Object.assign(Object.assign({},t),{replies:t.replies.slice(),countReplies:t.countReplies+1});return g&&g(a),a}return t}))},[ue,me]=t.useState(!1),pe=t.useMemo((()=>"comment"===r&&Z&&0!=Z.length?Z.sort(((e,t)=>{const a=new Date(e.createdAt).getTime(),l=new Date(t.createdAt).getTime();return a>l?-1:a<l?1:0})):Z),[r,Z]),ve=(null==Z?void 0:Z.length)||0,ge=String(null==K?void 0:K.email)&&(null==D?void 0:D.email)&&String(null==K?void 0:K.email)===String(null==D?void 0:D.email),fe=(null==K?void 0:K.name)||(null==K?void 0:K.username)||"",he=(null==K?void 0:K.username)||(null==K?void 0:K.name)||"",Ce=null==K?void 0:K.avatar,ye=(null==p?void 0:p.isAnonymous)||null==K?void 0:K.role,Ee=[...(null==p?void 0:p.isAnonymous)?[{id:(null===(T=null==p?void 0:p.author)||void 0===T?void 0:T.id)||0,name:U("cardPost.anonymous")}]:[],...ee||[]],[we,ke]=t.useState(null),[be,Pe]=t.useState(null);t.useEffect((()=>{if(null==K?void 0:K.hospitalId){const t=t=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;const a=yield m.callApi(m.getCarePath(m.CARE_PATHS.GET_HOSPITAL_INFO,{hospital_branch_id:t,website_url:d.domainLocales[O]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.branch)&&ke(null==a?void 0:a._data.branch)}));t(K.hospitalId)}if(null==K?void 0:K.doctorId){const t=t=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;const a=yield m.callApi(m.getCarePath(m.CARE_PATHS.GET_DOCTOR_INFO,{doctorId:t,website_url:d.domainLocales[O]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.doctor)&&Pe(null==a?void 0:a._data.doctor)}));t(K.doctorId)}}),[K.hospitalId,K.doctorId]);const Te=(null==be?void 0:be.valid_outpatient)||(null==be?void 0:be.valid_telemedicine),Se=((null==we?void 0:we.total_available_service)||(null==we?void 0:we.total_available_doctor))>0,xe=f&&(Te||Se),Ne="chatbot"===(null===(x=null==H?void 0:H.author)||void 0===x?void 0:x.type);return w.default.createElement(l.TogetherAuthConfigContextProvider,{defaultParams:{_joinCommunityIds:[null===(N=null==p?void 0:p.community)||void 0===N?void 0:N.id],_joinTopicIds:null===(A=null==p?void 0:p.topics)||void 0===A?void 0:A.map((e=>e.id))}},w.default.createElement(l.StyledCardPost,{className:a,style:n,"data-is-reply":!!s,"data-is-marrybaby":F,"data-has-booking":xe},"reply"===r&&w.default.createElement(l.Divider,{className:"top-divider",type:"solid"}),w.default.createElement("div",{style:{padding:"16px 16px 0"}},w.default.createElement(l.CardAuthor,Object.assign({avatar:Ce,name:fe,username:he,timeText:null==p?void 0:p.createdTime,community:null==p?void 0:p.community,className:"post-author "+(ge?"with-popover":""),type:r,userId:null==K?void 0:K.id,role:ye,expertId:null==K?void 0:K.partnerId,title:null==K?void 0:K.title,doctorId:null==K?void 0:K.doctorId,hospitalId:null==K?void 0:K.hospitalId,hasQuickBooking:xe,handleMakeAppointment:C,isAnonymous:(null==H?void 0:H.isAnonymous)||Boolean(null==p?void 0:p.isAnonymous)&&(null===(I=null==p?void 0:p.author)||void 0===I?void 0:I.username)===(null==K?void 0:K.username),hideBackground:Ne,userType:null==K?void 0:K.type},y)),Boolean(null==H?void 0:H.isVerify)&&!Boolean(null==H?void 0:H.isOppose)&&w.default.createElement(ie,{title:null===(_=null==H?void 0:H.userVerify)||void 0===_?void 0:_.title,name:null===(M=null==H?void 0:H.userVerify)||void 0===M?void 0:M.name,userId:null===(L=null==H?void 0:H.userVerify)||void 0===L?void 0:L.id,role:null===(j=null==H?void 0:H.userVerify)||void 0===j?void 0:j.role,avatar:null===(R=null==H?void 0:H.userVerify)||void 0===R?void 0:R.avatar,className:"verify-tag"})),w.default.createElement(l.PostContent,{className:"post-content-wrapper",replyingTo:ae,mentionedUser:Y,description:te,mentions:Ee,maxChars:E,disableShortenContent:k}),w.default.createElement("span",null),w.default.createElement("span",null),Q&&Q.length>0?w.default.createElement("div",{key:"image-preview",className:"image-preview-wrapper","data-is-reply":!0},w.default.createElement($,{images:Q,authorName:null==K?void 0:K.username})):null,Q&&0!==Q.length||!J?null:w.default.createElement("div",{key:"link-preview",className:"link-preview-wrapper","data-is-reply":!0},w.default.createElement(S,{url:J})),"most-engaging"!==r?w.default.createElement(w.default.Fragment,null,Ne&&w.default.createElement(l.StyledSourceList,{listUrl:null==H?void 0:H.source,categorySlug:null==H?void 0:H.categorySlug}),w.default.createElement(l.CardReactions,{type:l.CardReactionType.reply,loveCount:G,replyCount:ve,className:"post-reaction",liked:X,isReplied:de,hideCommentIcon:"reply"===r||Ne,hasShare:!1,onCommentClick:()=>le((()=>me((e=>!e)))),onCommentCountClick:()=>le((()=>{me(!0)})),onLikeClick:()=>le((()=>e.__awaiter(void 0,void 0,void 0,(function*(){if(V){const t=yield(({commentId:t,setLike:a=!1,locale:l})=>e.__awaiter(void 0,void 0,void 0,(function*(){return m.callApiWithAuth(m.getApiPath(a?m.PATHS.COMMENT.LIKE:m.PATHS.COMMENT.UNLIKE,{_locale:l,id:t}),"GET")})))({commentId:V,setLike:!X,locale:O});1===t.status&&W((e=>Object.assign(Object.assign({},e),{liked:!X,countLikes:e.countLikes+(X?-1:1)})))}}))))}),ue&&w.default.createElement(z,{replyingId:c||H.id,replyToName:fe,isReply:!0,onClose:()=>me(!1),onPostSuccess:e=>{"reply"===r?u&&u(e):ce(e)},post:p,replyingUser:K}),"comment"===r&&Z&&Z.length>0?w.default.createElement("div",{className:"comment-reply-wrapper"},null===(B=null==pe?void 0:pe.slice(0,ne))||void 0===B?void 0:B.map((e=>w.default.createElement(re,{key:e.id,comment:e,type:"reply",className:"comment-reply-item",level:s+1,replyingId:V,onPostCommentSuccess:ce,post:p,onDeleteComment:()=>{W((t=>Object.assign(Object.assign({},t),{replies:t.replies.filter((t=>t.id!==e.id)),countReplies:t.countReplies-1})))},handleMakeAppointment:C,hasQuickBookingEnable:f}))),ve>ne&&w.default.createElement(w.default.Fragment,null,w.default.createElement(l.Divider,{className:"top-divider",type:"solid"}),w.default.createElement(h.Button,{className:"more-cmt",size:"lg",color:"ghost",onClick:()=>se((e=>e+4))},U("comment.seeMoreReplies",{count:ve-ne}),w.default.createElement("img",{className:"chevron-right",src:"data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M6 12L10 8L6 4' stroke='%232D87F3' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",loading:"lazy"})))):null):null,ge&&w.default.createElement(oe,{onDeleteComment:v,className:"popover",commentId:H.id})))},se=(t,a)=>e.__awaiter(void 0,void 0,void 0,(function*(){var e,l,o;const n=yield m.callApiWithOptionalAuth(m.getApiPath(m.PATHS.COMMENT.LIST,{postId:t,_locale:a,sort:"popularity",perPage:1,withoutReply:1}),"GET");return null===(o=null===(l=null===(e=null==n?void 0:n.data)||void 0===e?void 0:e.comments)||void 0===l?void 0:l.map(p.formatComment))||void 0===o?void 0:o[0]}));var de=Object.freeze({__proto__:null});exports.CardLink=S,exports.CardPost=({className:a,style:n,hideViewMoreComment:i,showMostEngaging:r,onCommentClick:s,onCommentCountClick:d,onMostEngagingCommentClick:c,onPostCommentSuccess:u,disableCardLink:p,disableShortenContent:v,onDeletePost:g,onEditPost:f,post:C,mostEngagingComment:y,onDeleteComment:E,showInputComment:b,InlineCommentsComponent:P,hasQuickBookingEnable:T,handleMakeAppointment:A,cardAuthorProps:I})=>{const[_,M]=t.useState(C),[L,j]=t.useState(!1),[R,B]=t.useState(y),{community:O,topics:D,author:F,slug:U,isPin:H,liked:W,photos:V,mentions:q,title:Z,description:Q,previewUrl:K,likesCount:X,commentsCount:J,id:Y,commented:ee}=_,{data:{locale:te,env:{isMarryBaby:ae,togetherBasePath:oe}},action:{pushNotifications:ne}}=t.useContext(m.TogetherComponentGlobalContext),{t:ie}=o.useTranslations(),[de,ce]=t.useState(b),ue=`${oe}/${(null==O?void 0:O.slug)||"_"}/${U||""}`,me=`${m.getCurrentBaseUrl(te)}${ue}`,{authActionWrapper:pe}=l.useTogetherAuthRequiredAction((null==O?void 0:O.slug)?{_joinCommunityIds:[O.id],_joinTopicIds:null==D?void 0:D.map((e=>e.id))}:void 0),[ve,ge]=t.useState(!1);t.useEffect((()=>{ce(b)}),[b]);const fe=(null==F?void 0:F.name)||(null==F?void 0:F.username)||"",he=(null==F?void 0:F.username)||(null==F?void 0:F.name)||"",Ce=null==F?void 0:F.avatar,ye=(null==_?void 0:_.isAnonymous)||null==F?void 0:F.role,[Ee,we]=t.useState(null),[ke,be]=t.useState(null);t.useEffect((()=>{if(null==F?void 0:F.hospitalId){(t=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;const a=yield m.callApi(m.getCarePath(m.CARE_PATHS.GET_HOSPITAL_INFO,{hospital_branch_id:t,website_url:m.domainLocales[te]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.branch)&&we(null==a?void 0:a._data.branch)})))(F.hospitalId)}if(null==F?void 0:F.doctorId){(t=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;const a=yield m.callApi(m.getCarePath(m.CARE_PATHS.GET_DOCTOR_INFO,{doctorId:t,website_url:m.domainLocales[te]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.doctor)&&be(null==a?void 0:a._data.doctor)})))(F.doctorId)}}),[F.hospitalId,F.doctorId]);const Pe=(null==ke?void 0:ke.valid_outpatient)||(null==ke?void 0:ke.valid_telemedicine),Te=((null==Ee?void 0:Ee.total_available_service)||(null==Ee?void 0:Ee.total_available_doctor))>0,Se=T&&(Pe||Te);t.useEffect((()=>{e.__awaiter(void 0,void 0,void 0,(function*(){if(Y&&J&&r&&!(null==y?void 0:y.id)){const e=yield se(Y,te);B(e)}}))}),[Y,te,J,r,null==y?void 0:y.id]),t.useEffect((()=>{B(y)}),[null==y?void 0:y.id]);const xe=t=>e.__awaiter(void 0,void 0,void 0,(function*(){if(J>1&&(null==R?void 0:R.id)&&(null==R?void 0:R.id)===(null==t?void 0:t.id)){const e=yield se(Y,te);B(e)}M((e=>Object.assign(Object.assign({},e),{commentsCount:e.commentsCount-1}))),E&&E(t)}));return w.default.createElement(l.TogetherAuthConfigContextProvider,{defaultParams:(null==O?void 0:O.slug)?{_joinCommunityIds:[O.id],_joinTopicIds:null==D?void 0:D.map((e=>e.id))}:void 0},L&&w.default.createElement(l.SharePopup,{url:me,avatar:m.DEFAULT_IMG,text:Z,onClose:()=>j(!1)}),w.default.createElement(l.StyledCardPost$1,{className:a,style:n,"data-is-marrybaby":ae},H?w.default.createElement(x,{className:"post-pin"}):null,w.default.createElement("div",{style:{position:"relative",padding:"1rem 1rem 0"}},w.default.createElement(l.CardAuthor,Object.assign({avatar:Ce,name:fe,username:he,url:p?void 0:ue,community:O,timeText:null==_?void 0:_.createdTime,className:"post-author",role:ye,userId:null==F?void 0:F.id,expertId:null==F?void 0:F.partnerId,doctorId:null==F?void 0:F.doctorId,hospitalId:null==F?void 0:F.hospitalId,title:null==F?void 0:F.title,hasQuickBooking:Se,handleMakeAppointment:A,"data-testid":"name",isAnonymous:!!(null==_?void 0:_.isAnonymous),extendEle:w.default.createElement(le,{authorEmail:String(null==F?void 0:F.email),onDeletePost:g,shareUrl:me,post:_,className:"popover",onEditPost:f})},I))),w.default.createElement("a",{href:p?void 0:ue,className:"post-content-link-wrapper"},Z&&w.default.createElement(m.Heading,{className:"post-content-title",as:"h2",tag:"h5",fontWeight:"bold","data-testid":"Title of the Post"},k.default(Z)),w.default.createElement(l.PostContent,{className:"post-content-wrapper",description:Q,disableShortenContent:v,mentions:q,"data-testid":"Content of the Post"})),w.default.createElement("span",null),w.default.createElement("span",null),w.default.createElement("div",{key:"tag-topic"},D&&D.length>0?w.default.createElement(l.TagTopic,{topics:D,className:"post-topics"}):null),w.default.createElement("div",{key:"social-preview"},(null==_?void 0:_.introUrl)?w.default.createElement("div",{className:"social-preview-wrapper "+((null==V?void 0:V.length)?"has-image":"")},w.default.createElement(G,{url:_.introUrl,image:_.bannerImage})):null),w.default.createElement("div",{key:"image-preview"},(null==V?void 0:V.length)?w.default.createElement("div",{className:"image-preview-wrapper"},w.default.createElement($,{images:V,authorName:null==F?void 0:F.name})):null),w.default.createElement("div",{key:"link-preview"},(null==_?void 0:_.introUrl)||(null==V?void 0:V.length)||!(null==K?void 0:K.url)?null:w.default.createElement("div",{className:"link-preview-wrapper"},w.default.createElement(S,{title:K.title,url:K.url,image:K.image}))),w.default.createElement(l.CardReactions,{isMarryBaby:ae,type:l.CardReactionType.post,loveCount:X,replyCount:J,className:"post-reaction "+((null==V?void 0:V.length)||(null==K?void 0:K.url)?"hide-top-border":""),liked:ve?!W:W,isReplied:ee,onCommentClick:()=>pe((()=>{s?s():ce((e=>!e))})),onCommentCountClick:()=>{pe((()=>{ae?ce(!0):d?d():!p&&(window.location.href=ue)}))},onShareClick:()=>{j(!0)},onLikeClick:()=>e.__awaiter(void 0,void 0,void 0,(function*(){if(Y&&!ve){ge(!0);try{const t=yield(({id:t,locale:a})=>e.__awaiter(void 0,void 0,void 0,(function*(){if(t)return yield m.callApiWithAuth(m.getApiPath(m.PATHS.POST.LIKE,{id:t,_locale:a}),"GET")})))({id:Y,locale:te});1!==(null==t?void 0:t.status)?ne(N(ie)):M((e=>Object.assign(Object.assign({},e),{likesCount:(e.likesCount||0)+(e.liked?-1:1),liked:!e.liked})))}catch(e){ne(N(ie))}ge(!1)}})),showingMostEngaging:!(!r||!(null==R?void 0:R.id))}),de&&w.default.createElement(z,{isMainCmt:!b,onClose:()=>ce(!1),onPostSuccess:e=>{0!==J||(null==R?void 0:R.id)||B(e),M((e=>Object.assign(Object.assign({},e),{commentsCount:e.commentsCount+1,commented:!0}))),u&&u(e)},post:_}),r&&(null==R?void 0:R.id)?w.default.createElement("div",{className:"most-engaging-wrapper",onClick:e=>{c?(e.stopPropagation(),c()):window.location.href=ue}},w.default.createElement(re,{hasQuickBookingEnable:T,handleMakeAppointment:A,comment:R,post:_,onDeleteComment:()=>{xe&&xe(R)},className:"most-engaging-comment",type:"most-engaging",key:R.id,cardAuthorProps:I}),J>1&&!i&&w.default.createElement(h.Button,{className:"see-more-comments",color:"ghost",size:"md"},ie("comment.seeMoreComments",{count:J-1}))):null,P))},exports.CardPostPopoverMore=le,exports.CardReply=re,exports.CardReplyPopover=oe,exports.CreateNewPostContent=({className:n,style:d,onPostCreatedEdited:v,onClose:g,communities:f=[],forceSelectCommunity:h,forceSelectTopics:C,articleId:y,optionalTopic:E,editPostData:b,defaultCommunity:P,defaultTopics:T,noFetchTopic:S,hideTopicList:x,selectAskDoctor:I,showAskDoctorOptions:_,currentPageUrl:L})=>{const B=!!(null==b?void 0:b.id),{data:{locale:O,env:{isMarryBaby:z}},action:{pushNotifications:D,sanitizeFunction:F}}=t.useContext(m.TogetherComponentGlobalContext),{t:U}=o.useTranslations(),[H,W]=t.useState(!1),[V,$]=t.useState(I),[G,q]=t.useState(!1),[Z,Q]=t.useState(!1),[K,X]=t.useState(!1),[J,Y]=t.useState(""),[ee,te]=t.useState(""),[ae,le]=t.useState(h?{label:h.name,value:`${h.id||""}-${h.mappedCategoryId||""}`}:{label:U("community.choose"),value:""}),[oe,ne]=t.useState([...C]||[]),[ie,re]=t.useState([]),[se,de]=t.useState([]),ce=h||f.find((e=>`${e.id||""}-${e.mappedCategoryId||""}`===ae.value)),ue=h?[h]:f.filter((e=>e.isActive)).sort(((e,t)=>e.name>t.name?1:e.name<t.name?-1:0)),[me,pe]=t.useState(null),[ve,ge]=t.useState([]),fe=J&&!Z&&k.default(ee)&&(E||!E&&oe.length>0)&&ce&&(!ie||ie.length<=m.MAX_IMAGE_UPLOADS)&&!(null==ve?void 0:ve.length)&&!K;t.useEffect((()=>{if(b){const e=b;Y(e.title||""),te(l.decodeMention(l.decodePostUrl(e.description||"","edit"),e.mentions)),le({label:e.community.name,value:`${e.community.id||""}-${e.community.mappedCategoryId||""}`}),ne(e.topics||[]),re(e.photos||[]),W(!!e.isAnonymous||!1),$(!!e.isAskDoctor||!1)}else P&&le({label:P.name,value:`${P.id||""}-${P.mappedCategoryId||""}`}),T&&ne(T)}),[]),t.useEffect((()=>{Q(""!==J&&!/[a-zA-Z]/.test(J))}),[J]);const he=()=>e.__awaiter(void 0,void 0,void 0,(function*(){var t,a,o,n,i,r,s,d,c;if(_&&void 0===V)return q(!0),!1;const f=yield(({title:t,description:a,communityId:o,imageFiles:n,previewUrl:i,topicIds:r,locale:s,sanitizeFunction:d,categoryCommunityId:c,categoryTopicIds:p,introUrl:v,bannerUrl:g,scheduleTime:f,isAnonymous:h,isAskDoctor:C})=>e.__awaiter(void 0,void 0,void 0,(function*(){const e=new FormData,y=l.removeBannedWordWrapper(a),E=l.removeBannedWordWrapper(t),w=l.getMentionIdsFromString(y);if(e.append("title",E),e.append("description",l.encodePostContent(y,d)),c?e.append("category_community",String(c)):o&&e.append("community_id",String(o)),e.append("is_anonymous",h?"1":"0"),e.append("is_question",C?"1":"0"),(null==i?void 0:i.title)&&e.append("preview_title",i.title),(null==i?void 0:i.description)&&e.append("preview_description",i.description),(null==i?void 0:i.url)&&e.append("preview_link",u.safeEncodeURI(i.url)),(null==i?void 0:i.image)&&e.append("preview_image",u.safeEncodeURI(i.image)),null==r||r.forEach((t=>{e.append("topics[]",String(t||""))})),null==p||p.forEach((t=>{e.append("category_topics[]",String(t||""))})),null==n?void 0:n.length){const t=yield Promise.all(n.map(((e,t)=>new Promise((a=>{setTimeout((()=>{a(l.uploadAndGetSrc(e,s))}),2e3*t)})))));null==t||t.filter(Boolean).slice(0,m.MAX_IMAGE_UPLOADS).forEach(((t,a)=>{e.append(`images[${a}]`,t)}))}else e.append("images","");return null==w||w.forEach((t=>{e.append("mention_ids[]",t)})),e.append("intro_url",v||""),e.append("banner",g||""),f&&(e.append("post_type","scheduled"),e.append("schedule_datetime",f)),e})))({title:J,description:ee,communityId:String((null==ce?void 0:ce.id)||""),imageFiles:ie,previewUrl:me,topicIds:null==oe?void 0:oe.map((e=>String(e.id||""))).filter(Boolean),locale:O,sanitizeFunction:F,categoryCommunityId:String((null==ce?void 0:ce.mappedCategoryId)||""),categoryTopicIds:null==oe?void 0:oe.map((e=>String(e.mappedCategoryId||""))).filter(Boolean),isAnonymous:H?1:0,isAskDoctor:V?1:0});let h;y&&f.append("article_id",y),B?(null==b?void 0:b.id)&&(h=yield(({id:t,locale:a,formData:l})=>e.__awaiter(void 0,void 0,void 0,(function*(){return yield m.callApiWithAuth(m.getApiPath(m.PATHS.POST.UPDATE,{id:t,_locale:a}),"POST",{data:l})})))({id:b.id,formData:f,locale:O})):h=yield(({locale:t,formData:a,isArticleComment:l})=>e.__awaiter(void 0,void 0,void 0,(function*(){return yield m.callApiWithAuth(m.getApiPath(l?m.PATHS.POST.CREATE_ARTICLE_COMMENT:m.PATHS.POST.CREATE,{_locale:t}),"POST",{data:a})})))({formData:f,locale:O,isArticleComment:!(null==ce?void 0:ce.id)&&!!(null==ce?void 0:ce.mappedCategoryId)});const C=null==h?void 0:h.data;(null==C?void 0:C.id)&&!(null===(a=null===(t=null==h?void 0:h.messages)||void 0===t?void 0:t.moderation)||void 0===a?void 0:a.type)?(D({message:U("createPost.popup.success"),type:"success"}),(e=>{v&&v(p.formatPost(e),B),g&&g()})(C)):"banned"===(null===(n=null===(o=null==h?void 0:h.messages)||void 0===o?void 0:o.moderation)||void 0===n?void 0:n.type)?(D({title:U("notification.post.blocked.title"),message:U("notification.post.blocked.message"),type:"danger"}),h.messages.moderation.words&&de(h.messages.moderation.words)):"suspect"===(null===(r=null===(i=null==h?void 0:h.messages)||void 0===i?void 0:i.moderation)||void 0===r?void 0:r.type)?(D({title:U("notification.post.suspect.title"),message:U("notification.post.suspect.message"),type:"warning"}),g&&g()):(null===(d=null===(s=null==h?void 0:h.messages)||void 0===s?void 0:s.find)||void 0===d?void 0:d.call(s,(e=>{var t;return!!(null===(t=null==e?void 0:e.includes)||void 0===t?void 0:t.call(e,"suspend"))})))?(D({message:U("notification.suspend.message"),type:"danger"}),g&&g()):D({message:(null===(c=null==h?void 0:h.messages)||void 0===c?void 0:c[0])||U("notification.failure"),type:"danger"})}));return w.default.createElement(l.StyledCreateNewPost,{className:n,style:d},w.default.createElement("div",{className:"input-group-container"},w.default.createElement(j,{className:"input-group",bannedWords:se,value:J,onChange:Y}),Z&&w.default.createElement(l.StyledError,null,w.default.createElement(r.Info,{isSolid:!0,color:i.theme.colors.red700,size:14}),w.default.createElement(r.Text,{size:"p3",as:"span",color:i.theme.colors.red700},U("createPost.popup.specialCharErr"))),w.default.createElement(M,{className:"input-group",bannedWords:se,value:ee,onChange:te,onPreviewUrlChange:pe,onInvalidUrlsChange:ge,onImageFilesChange:re,imageFiles:ie}),_&&w.default.createElement(l.StyledIsQuestion,{"data-is-marry-baby":z},w.default.createElement("div",{className:"switch-label"},w.default.createElement(r.Ask,{isMarryBaby:z,size:z?32:24,color:i.theme.colors.primaryBase,className:"label-icon"}),w.default.createElement("span",{className:"label-txt"},U("createPost.askDoctor"))),w.default.createElement(l.BtnChoice,{value:V,choices:[{label:U("createPost.askDoctorChoice.yes"),value:!0,dataEventCategory:"Together",dataEventAction:"Write Post Click - Ask Doctor",dataEventLabel:L},{label:U("createPost.askDoctorChoice.no"),value:!1}],onChange:e=>{"boolean"==typeof e&&(q(!1),$(e))}})),G&&w.default.createElement(l.StyledError,null,w.default.createElement(r.Info,{isSolid:!0,color:i.theme.colors.red700,size:14}),w.default.createElement(r.Text,{size:"p3",as:"span",color:i.theme.colors.red700},U("createPost.message.askDoctorRequire"))),w.default.createElement("div",{className:"input-group"},w.default.createElement(r.Text,{size:"p4",className:"input-group-label"},U("admin.community")),w.default.createElement(l.Dropdown,{options:(null==ue?void 0:ue.map((e=>({label:e.name,value:`${e.id||""}-${e.mappedCategoryId||""}`}))))||[],id:"community-picker",placeholder:U("community.choose"),value:ae,dropdownLabelTrackingAttributes:{"data-event-category":"Together","data-event-action":"Write Post Click - Choose Community/Topic","data-event-label":L},onChange:e=>{le({label:e.label,value:String(e.value)}),ne([])},disabled:!!h}),w.default.createElement(r.Text,{size:"sm",className:"warning",color:i.theme.colors.gray400},"* ",U("commentPopup.warning.newPost"))),!x&&w.default.createElement("div",{className:"input-group"},w.default.createElement(r.Text,{size:"p4",className:"input-group-label"},U("tab.topic")),w.default.createElement("div",{className:"input-notification"},w.default.createElement("img",{src:ce?"data:image/svg+xml,%3csvg width='16' height='17' viewBox='0 0 16 17' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M8 14.5C11.3137 14.5 14 11.8137 14 8.5C14 5.18629 11.3137 2.5 8 2.5C4.68629 2.5 2 5.18629 2 8.5C2 11.8137 4.68629 14.5 8 14.5Z' fill='%232D87F3'/%3e%3cpath d='M8 5.5V8.5' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M8 11.5H8.00708' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e":A,loading:"lazy"}),w.default.createElement(r.Text,{size:"base",color:i.theme.colors.gray500},U(ce?"createPost.popup.primary":"createPost.popup.warning"))),ce&&w.default.createElement(R,{className:"tag-list",communityId:ce.id,forceTopics:C,onChange:ne,selectedTopics:oe,noFetch:S,dataEventCategory:"Together",dataEventAction:"Write Post Click - Choose Community/Topic",dataEventLabel:L}))),w.default.createElement("div",{className:"form-action"},w.default.createElement("div",{className:"input-group"},w.default.createElement(a.Checkbox,{className:"swich-input-group",labelPosition:"left",name:"PostAnonymous",checked:H,color:z?"pink":void 0,"data-event-category":"Together","data-event-action":"Write Post Click - Incognito","data-event-label":L,label:w.default.createElement("div",{className:"switch-label"},w.default.createElement("img",{className:"label-icon",src:c.CommonGAssets.getAssetPath("anomyous-avatar.svg"),alt:"anomyous avatar",style:{marginRight:"10px",width:"24px"},loading:"lazy"}),w.default.createElement("span",{className:"label-txt"},U("createPost.postAnonymous"))),value:"Post Anonymous",onChange:e=>W(e.currentTarget.checked),styles:{body:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"},label:{display:"flex",alignItems:"center"}}})),w.default.createElement("div",{className:"input-group"},w.default.createElement(s.Button,{className:"submit-btn pointer-event-child-none",size:"lg","data-event-category":"Ask Doctor","data-event-action":"Submit Question","data-event-label":window.location.href,onClick:()=>e.__awaiter(void 0,void 0,void 0,(function*(){if(fe&&!K){X(!0);try{yield he()}catch(e){console.error(e),D(N(U))}X(!1)}})),disabled:!fe,loading:K},U("createPost.popup.submit")))))},exports.CreatePostDescription=M,exports.CreatePostTitle=j,exports.ImagePreviewPopup=U,exports.InputCommentBar=z,exports.LabelPin=x,exports.PopupDanger=O,exports.PostImagePreview=$,exports.PostSingleImageViewPopup=W,exports.SkipQuestionOfExpertBtn=l=>{var{post:n,onSkip:i,btnText:d,currentPageUrl:c}=l,u=e.__rest(l,["post","onSkip","btnText","currentPageUrl"]);const{t:p}=o.useTranslations(),{data:{locale:v},action:{pushNotifications:g}}=t.useContext(m.TogetherComponentGlobalContext),[f,h]=t.useState(!1),[C,y]=t.useState(!1),E=a.useMantineTheme(),k=t.useCallback((()=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;y(!0);const t=yield m.callApiWithAuth(m.getApiPath(m.PATHS.USER.SKIP_QUESTION,{_locale:v,id:null==n?void 0:n.id}),"PUT");1===(null==t?void 0:t.status)?(null==i||i({id:(null==n?void 0:n.id)||"",communityId:(null===(e=null==n?void 0:n.community)||void 0===e?void 0:e.id)||""}),h(!1),g({title:"",message:"Skip success",type:"success"})):g({title:"",message:null==t?void 0:t.messages,type:"danger"}),y(!1)}))),[]);return w.default.createElement(a.Popover,{width:327,withArrow:!0,shadow:"md",opened:f},w.default.createElement(a.Popover.Target,null,w.default.createElement("div",Object.assign({className:`${q} ${(null==u?void 0:u.className)||""}`,onClick:()=>h(!0)},u),d||p("profilePanel.questionNotClear"))),w.default.createElement(a.Popover.Dropdown,null,w.default.createElement("div",null,w.default.createElement("div",{className:Z},p("profilePanel.skipQuestion.heading")),w.default.createElement("div",{className:Q},p("profilePanel.skipQuestion.content")),w.default.createElement("div",{className:K},w.default.createElement(s.Button,{size:"md",variant:"secondary",leftIcon:w.default.createElement(r.Close,{color:E.fn.primaryColor(),size:24}),onClick:()=>h(!1),styles:()=>({leftIcon:{marginRight:0}})}),w.default.createElement(s.Button,{variant:"primary",size:"md",leftIcon:w.default.createElement(r.Check,{color:"white",size:24}),onClick:k,loading:C,"data-event-category":"Together","data-event-action":"Unclear Question Click","data-event-label":c,styles:()=>({leftIcon:{marginRight:0}})})))))},exports.SocialLinkPreview=G,exports.SubmitReportForm=F,exports.TopicSelectList=R,exports.VerifiedTag=ie,exports.types=de;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var e=require("./tslib.es6-
|
|
1
|
+
"use strict";var e=require("./tslib.es6-15853eea.js"),t=require("react"),a=require("./useTranslations-d57cfa60.js"),i=require("lodash/debounce"),o=require("./constants-729267f0.js"),l=require("./index-8232502b.js"),n=require("styled-components"),s=require("./index-76e24325.js"),r=require("./theme-6b7baadc.js"),c=require("lodash/shuffle"),d=require("./useOutsideClick-4b5a27d8.js"),u=require("./screenSizeContext-eb66c071.js"),p=require("react-loading-skeleton"),h=require("./paths-79805462.js"),g=require("@mantine/core"),f=require("./index-fa36dcfc.js"),m=require("./cookieHelper-5109a4f2.js"),C=require("./index-11991307.js"),b=require("string-format");function y(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function v(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(a){if("default"!==a){var i=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,i.get?i:{enumerable:!0,get:function(){return e[a]}})}})),t.default=e,Object.freeze(t)}var x=v(t),E=y(t),S=y(i),L=y(n),w=y(c),O=y(p),k=y(b);const I=e=>x.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor"},e),x.createElement("path",{d:"M7.99969 9.38055L5.45236 6.83322C5.17636 6.55722 4.72836 6.55722 4.45236 6.83322C4.17636 7.10922 4.17636 7.55722 4.45236 7.83322L7.52836 10.9092C7.78903 11.1699 8.21103 11.1699 8.47103 10.9092L11.547 7.83322C11.823 7.55722 11.823 7.10922 11.547 6.83322C11.271 6.55722 10.823 6.55722 10.547 6.83322L7.99969 9.38055Z"}));function T(){const[e,a]=t.useState((()=>{if("undefined"==typeof window)return"unset";if(m.getCookie(f.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(f.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(f.USER_GEOLOCATION_COORDINATES_COOKIE,JSON.stringify(t),{minutes:15}),o(t),a("granted")}),(()=>{m.deleteCookie(f.USER_GEOLOCATION_COORDINATES_COOKIE),a("denied")}))}),[]);return t.useMemo((()=>({geoLocationPermission:e,geoLocationCoordinates:i,requestGeoLocation:l})),[e,i])}const j=L.default.div``,M=L.default.div`
|
|
2
2
|
--searchbar-z-index: 305;
|
|
3
3
|
&[data-is-modal='true'] {
|
|
4
4
|
position: fixed;
|
|
@@ -757,4 +757,23 @@
|
|
|
757
757
|
background: rgba(255, 255, 255, 0.64);
|
|
758
758
|
backdrop-filter: blur(12px);
|
|
759
759
|
border-bottom: 1px solid ${r.theme.colors.neutral100};
|
|
760
|
-
`,Ft=({currentTab:e,hideTabBookingSearch:i=[],isMobile:o,setCurrentTab:l})=>{const{t:n}=a.useTranslations(),s=t.useMemo((()=>({root:{overflowY:o?"hidden":"initial",overflowX:o?"auto":"initial"},tabsList:{background:"rgba(255, 255, 255, 0)",borderBottom:"none",flexWrap:"nowrap",".mantine-Tabs-tab":{"&:last-child":{"&:after":{display:"none"}}}},tab:{padding:o?"12px 16px 12px 16px":"15px 40px 15px 40px",borderTop:"2px solid transparent",borderBottom:"none",margin:0,borderRadius:0,position:"relative",width:"auto",'&[data-active="true"]':{borderColor:"#2d87f3",backgroundColor:"#ffffff","&:after":{display:"none"},"&:before":{content:'""',width:"100%",height:"1px",position:"absolute",backgroundColor:"#ffffff",bottom:"-1px"}},"&:hover":{borderColor:"#2d87f3",backgroundColor:"#ffffff","&:before":{content:'""',width:"100%",height:"1px",position:"absolute",backgroundColor:"#ffffff",bottom:"-1px"}},"&:after":{content:'""',width:"1px",height:"24px",backgroundColor:"#E4E8EC",position:"absolute",right:"-1px"}},tabLabel:{color:"#595959",fontSize:o?"14px":"16px",fontWeight:600,lineHeight:o?"22px":"24px"}})),[o]),r=(()=>{const{t:e}=a.useTranslations();return[{value:"hospital",label:e("booking.searchPopup.hospitals")},{value:"doctor",label:e("booking.searchPopup.doctors")},{value:"service",label:e("booking.searchPopup.services")},{value:"specialty",label:e("booking.searchPopup.specialties")}]})(),c=t.useMemo((()=>r.filter((e=>!i.includes(e.value)))||[]),[i,r]);return E.default.createElement(_t,{className:"booking-search-tab"},E.default.createElement(C.Container,null,E.default.createElement(g.Tabs,{value:e,onTabChange:e=>{l(e)},styles:s},E.default.createElement(g.Tabs.List,null,c.map((e=>E.default.createElement(g.Tabs.Tab,{value:e.value,key:e.value},n(e.label))))))))};var $t;!function(e){e.doctor="doctor",e.service="hospital_service",e.hospital="hospital_branch"}($t||($t={}));var Dt;!function(e){e[e.SPECIALTY=1]="SPECIALTY",e[e.DOCTOR=2]="DOCTOR",e[e.CLINIC=3]="CLINIC",e[e.SERVICE=4]="SERVICE"}(Dt||(Dt={}));var Bt=Object.freeze({__proto__:null,get RedirectType(){return Dt}});exports.BookingSearchBar=({isMobile:i,careApiDomain:l,geoLocationPermission:n,geoLocationCoordinates:s,initialSelectedCity:r,initialSearchValue:c="",careFrontDomain:d="/care",isDebug:u=!1,askForGeolocationPermission:p=!1,gaTrackingSearchBar:g,gaTrackingLocationSearch:f,autoCompleteDisabled:m=!1,inputSearchPlaceholder:C="",isOptionAllLocation:b=!1,hideResults:y=[],isNavResultItem:v=!0,routerPush:x,onGeoLocationPermissionChange:L,onSearch:w,onChangeLocation:O})=>{const{t:k,locale:I}=a.useTranslations(),A=t.useRef(null),_=t.useRef(null),[F,$]=t.useState(void 0),[D,B]=t.useState(!1),{geoLocationPermission:V,geoLocationCoordinates:K,requestGeoLocation:H}=T(),[z,G]=t.useReducer(be,fe,(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:I}))),{navigateTo:Z,focused:Q,isLoadingCities:Y,cities:q,searchKeywords:W,geoLocationPermission:J,selectedLocation:X,initialSelectedCity:ee,defaultCity:te,searchResults:ae,isLoadingSearchResults:ie,isMobileModalOpened:oe,inputSearchPlaceholder:le}=z,{fetchCitiesByLocation:ne,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:me.FetchCitiesStart}),fetch(We(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:me.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(h.PATHS.GET_CITY_BY_IP,Object.assign(Object.assign({},a),o))];return"zh-TW"===i&&n.push(l(h.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:me.FetchCitiesByGeoIpComplete,payload:i})})).catch((e=>console.error("error loading cities by location",e)))}),[i,a,e]),fetchCitiesByKeyword:t.useCallback((function(t){return l(h.PATHS.GET_CITIES_LIST,{keyword:t}).then((t=>{e({type:me.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}${h.PATHS.GET_SEARCH_V2}`;e({type:me.FetchSearchResultsStart});const{defaultCity:s,selectedLocation:r,geoLocationCoordinates:c}=l;let d="";if(!r||!s)return void e({type:me.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(We(n,{domain:a,searchType:"global",keyword:t.trim().length>ge[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:me.FetchSearchResultsComplete,payload:t}))).catch((e=>{console.log("error loading search results",{url:n,error:e})})).finally((()=>e({type:me.FetchSearchResultsFinish})))}),[i,a,e])}}({dispatch:G,locale:I,careApiDomain:l}),de=t.useMemo((()=>{var e;return{id:o.ID_OPTION_CURRENT_LOCATION,name:k("booking.searchBar.currentLocation"),slug:null===(e=o.LOCALIZED_SLUGS[I])||void 0===e?void 0:e.CURRENT}}),[k,I]),ue=t.useMemo((()=>S.default(re,400)),[re]),pe=t.useMemo((()=>S.default(ce,400)),[ce]);t.useEffect((()=>{""!==c&&c!==z.searchKeywords&&G({type:me.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?G({type:me.GrantGeoLocationPermission,payload:K}):"denied"===V&&G({type:me.DenyGeoLocationPermission}))}),[J,V,K,n]),t.useEffect((()=>{Z&&(x?x(Z):window.location.href=`${d}${Z}`)}),[Z]);const Ce=t.useCallback((function(){G({type:me.SelectCurrentLocation,payload:de})}),[k,G]);t.useEffect((()=>{var e;"denied"===J||ee||G({type:me.SelectLocation,payload:{name:k("booking.searchBar.allLocations"),id:o.ID_OPTION_ALL_LOCATION,slug:null===(e=o.LOCALIZED_SLUGS[I])||void 0===e?void 0:e.ALL}}),L&&L(J,z.geoLocationCoordinates),i&&"granted"===J&&X&&G({type:me.FocusInputSearch}),ne({coordinates:z.geoLocationCoordinates})}),[J]),t.useEffect((()=>{X&&te&&ce(z.searchKeywords,z)}),[X,te]),t.useEffect((()=>{C!==le&&G({type:me.SetInputSearchPlaceholder,payload:C})}),[C,le]),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"===I&&B(!0),G({type:me.SelectLocation,payload:e}),"ms-MY"!==I&&Ee(),O&&O(e)}),[k,G]);function ve(){"ms-MY"===I&&B(!0),i&&"granted"!==z.geoLocationPermission?H():(Ce(),"ms-MY"!==I&&Ee())}function xe(){var e;A.current&&(null===(e=A.current.querySelector('input[name="search-location"]'))||void 0===e||e.focus())}function Ee(){var e;A.current&&(null===(e=A.current.querySelector('input[name="search-results"]'))||void 0===e||e.focus())}function Se(){G({type:me.CloseMobileModal})}function Le(){return"location"!==Q?null:E.default.createElement(U,{isLoading:Y,cities:q,onLocationClick:ye,onCurrentLocationClick:ve,isLocationLoading:Y,geoLocationPermission:J,selectedLocation:X,isOptionAllLocation:b})}function we(){return"search"!==Q?null:z.autoCompleteDisabled?i?E.default.createElement(ke,{onClick:()=>{w({cityId:z.selectedLocation.id,keyword:W}),Se()}}):null:E.default.createElement(qe,{data:ae,state:z,dispatch:G,isMobile:!1,keyword:W,isLoading:ie,hideResults:y,isNavResultItem:v})}function Oe(){return E.default.createElement(Ie,{isMobile:i,state:z,dispatch:G,debouncedFetchCitiesByKeyword:ue,debouncedFetchSearchResults:pe,focusLocationInput:xe,focusSearchInput:Ee,renderLocationResults:Le,renderSearchResults:we,trackingAttributes:g,locationTrackingAttributes:f,onSearch:w,initalSearchValue:c})}return t.useEffect((()=>{if(window.visualViewport){const e=e=>{const t=e.target;$(null==t?void 0:t.height)};return window.visualViewport.addEventListener("resize",e,{passive:!0}),()=>{window.visualViewport.removeEventListener("resize",e)}}}),[$]),t.useEffect((()=>{if(X&&D&&"ms-MY"===I){const e=`/${X.slug}/hospital`;G({type:me.NavigateTo,payload:e}),B(!1)}}),[D,I,X]),i?E.default.createElement(E.default.Fragment,null,E.default.createElement(P,null),E.default.createElement(N,{ref:_}),E.default.createElement(M,{id:"booking-search-bar",ref:A,"data-is-modal":i&&oe,style:{"--mobile-care-searchbar-height":oe&&F?`${F}px`:"100%"}},oe?E.default.createElement(E.default.Fragment,null,E.default.createElement(R,null,E.default.createElement(he,{headingText:k("booking.searchBar.searchButton"),onLeftClick:Se}),Oe()),Le(),we()):E.default.createElement(se,{onClick:function(){var t;return e.__awaiter(this,void 0,void 0,(function*(){_.current&&_.current.focus(),G({type:me.OpenMobileModal}),yield Promise.resolve(),A.current&&(null===(t=A.current.querySelector('input[name="search-location"]'))||void 0===t||t.focus())}))},focused:Q,value:W,trackingAttributes:g,inputSearchPlaceholder:C}))):E.default.createElement(j,{id:"booking-search-bar",ref:A},Oe())},exports.BookingSearchBarV2=({isMobile:e,careApiDomain:i,geoLocationPermission:l,geoLocationCoordinates:n,initialSelectedCity:s,initialSearchValue:r="",initTypeSearch:c="hospital",initSpecialty:u,careFrontDomain:p="/care",isDebug:f=!1,gaTrackingSearchBar:m,gaTrackingLocationSearch:C,autoCompleteDisabled:b=!1,inputSearchPlaceholder:y="",hideTabBookingSearch:v=[],hideSpecialtySelection:x=!1,hidePopularSearchKeys:L=!1,clientSlug:w="",routerPush:O,onGeoLocationPermissionChange:k,onChangeLocation:I})=>{const{locale:j,t:M}=a.useTranslations(),R=t.useRef(null),N=t.useRef(null),[A,P]=t.useState(c),{geoLocationPermission:_,geoLocationCoordinates:F}=T(),[$,D]=t.useReducer(lt,at,(t=>Object.assign(Object.assign({},t),{isDebug:f,isMobile:e,geoLocationPermission:l||_||"unset",geoLocationCoordinates:n||F||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}=$,{fetchCitiesByLocation:Y,fetchCitiesByKeyword:q,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:it.FetchCitiesStart}),fetch(We(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:it.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(h.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(h.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:it.FetchCitiesByGeoIpComplete,payload:i})})).catch((e=>console.error("error loading cities by location",e)))}),[i,a,e]),fetchCitiesByKeyword:t.useCallback((function(t){return n(h.PATHS.GET_CITIES_LIST,{keyword:t,client:l}).then((t=>{e({type:it.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}${h.PATHS.GET_SEARCH_SPECIALTY}`:`${a}${h.PATHS.GET_SEARCH_V2}`;e({type:it.FetchSearchResultsStart});const{selectedLocation:u,geoLocationCoordinates:p,selectedSpecialty:g}=n;let f="";if(!u)return void e({type:it.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==g?void 0:g.id)>0?null==g?void 0:g.id:"",y=t.trim().length>tt[i]?t.trim():"";return fetch(We(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:it.FetchSearchResultsComplete,payload:{key:s,searches:a||[]}}),c&&e({type:it.UpdateInitialSearchResults,payload:{key:s,searches:a||[]}})})).catch((e=>{console.log("error loading search results",{url:d,error:e})})).finally((()=>e({type:it.FetchSearchResultsFinish})))}),[i,a,e]),fetchAllSpecialties:t.useCallback((function(){const t=`${a}${h.PATHS.GET_SEARCH_SPECIALTY}`;return fetch(We(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:it.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}${h.PATHS.GET_SEARCH_POPULAR_KEY}`;return fetch(We(o,{domain:a,searchType:$t[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:it.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:E.default.createElement(mt,null),slug:ee.DOCTOR},service:{name:M("booking.searchPopup.services"),icon:E.default.createElement(Ct,null),slug:ee.SERVICE},hospital:{name:M("booking.searchPopup.hospitals"),icon:E.default.createElement(bt,null),slug:ee.HOSPITAL},specialty:{name:M("booking.searchPopup.specialties"),icon:E.default.createElement(yt,null),slug:ee.SPECIALTIES}})),[A]),ae=t.useMemo((()=>S.default(q,400)),[q]),ie=t.useMemo((()=>S.default(W,400)),[W]),oe=t.useCallback((function(e){D({type:it.SelectLocation,payload:e}),le(),I&&I(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:it.ClickOutsideInputSearchSpecialty})})),t.useEffect((()=>{var t;"denied"===H||Z||D({type:it.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}}),k&&k(H,$.geoLocationCoordinates),e&&"granted"===H&&z&&D({type:it.FocusInputSearch}),Y({coordinates:$.geoLocationCoordinates})}),[H]),t.useEffect((()=>{const e=u||{name:M("booking.searchBar.allSpecialties"),id:-1,thumbnail:"",total_doctor:0,slug:ee.SPECIALTIES};$.selectedSpecialty||D({type:it.SelectSpecialty,payload:e})}),[u,$.selectedSpecialty]),t.useEffect((()=>{J()}),[]),t.useEffect((()=>{X(A)}),[A]),t.useEffect((()=>{B&&(O?O(B):window.location.href=`${p}${B}`)}),[B]),t.useEffect((()=>{W($.searchKeywords,$,A,w,!0)}),[z,G,A]),E.default.createElement(Je,{ref:R},E.default.createElement(Ft,{currentTab:A,setCurrentTab:P,isMobile:e,hideTabBookingSearch:v}),E.default.createElement(Xe,{className:"booking-search-container"},E.default.createElement(et,null,E.default.createElement("div",{ref:N},E.default.createElement(g.Flex,{gap:"12px",justify:"space-between",align:"center",direction:e?"column":"row",className:"flex-search-input"},"specialty"!==A&&E.default.createElement(Ot,{state:$,isMobile:e,dispatch:D,debouncedFetchCitiesByKeyword:ae,selectedLocation:z,onLocationClick:oe,trackingAttributes:C}),E.default.createElement(xt,{type:A,isMobile:e,state:$,dispatch:D,debouncedFetchSearchResults:ie,initalSearchValue:r,focusSearchInput:le,typeInformation:te,trackingAttributes:m,isLoading:Q,hideSpecialtySelection:x,clientSlug:w}),E.default.createElement(g.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)&&$.selectedSpecialty.id>0&&(a=`&specialtyId=${$.selectedSpecialty.id}`),e="specialty"===A?`/${t}`:`/${z.slug}/${t}`,i&&(e+=`/${i}`),e+=`?q=${K}${a}`,e&&D({type:it.NavigateTo,payload:e})},styles:{root:{height:e?"40px":"48px"}}},M("booking.searchBar.searchButton"))),!L&&"specialty"!==A&&$.popularKeys.length>0&&E.default.createElement(Pt,{type:A,state:$,typeInformation:te,dispatch:D}),"specialty"===A&&"search"===V&&E.default.createElement(Mt,{state:$,isMobile:e,dispatch:D,specialties:(null==U?void 0:U.specialty)||[],isLoading:Q})))))},exports.ChevronDown=I,exports.types=Bt;
|
|
760
|
+
`,Ft=({currentTab:e,hideTabBookingSearch:i=[],isMobile:o,setCurrentTab:l})=>{const{t:n}=a.useTranslations(),s=t.useMemo((()=>({root:{overflowY:o?"hidden":"initial",overflowX:o?"auto":"initial"},tabsList:{background:"rgba(255, 255, 255, 0)",borderBottom:"none",flexWrap:"nowrap",".mantine-Tabs-tab":{"&:last-child":{"&:after":{display:"none"}}}},tab:{padding:o?"12px 16px 12px 16px":"15px 40px 15px 40px",borderTop:"2px solid transparent",borderBottom:"none",margin:0,borderRadius:0,position:"relative",width:"auto",'&[data-active="true"]':{borderColor:"#2d87f3",backgroundColor:"#ffffff","&:after":{display:"none"},"&:before":{content:'""',width:"100%",height:"1px",position:"absolute",backgroundColor:"#ffffff",bottom:"-1px"}},"&:hover":{borderColor:"#2d87f3",backgroundColor:"#ffffff","&:before":{content:'""',width:"100%",height:"1px",position:"absolute",backgroundColor:"#ffffff",bottom:"-1px"}},"&:after":{content:'""',width:"1px",height:"24px",backgroundColor:"#E4E8EC",position:"absolute",right:"-1px"}},tabLabel:{color:"#595959",fontSize:o?"14px":"16px",fontWeight:600,lineHeight:o?"22px":"24px"}})),[o]),r=(()=>{const{t:e}=a.useTranslations();return[{value:"hospital",label:e("booking.searchPopup.hospitals")},{value:"doctor",label:e("booking.searchPopup.doctors")},{value:"service",label:e("booking.searchPopup.services")},{value:"specialty",label:e("booking.searchPopup.specialties")}]})(),c=t.useMemo((()=>r.filter((e=>!i.includes(e.value)))||[]),[i,r]);return E.default.createElement(_t,{className:"booking-search-tab"},E.default.createElement(C.Container,null,E.default.createElement(g.Tabs,{value:e,onTabChange:e=>{l(e)},styles:s},E.default.createElement(g.Tabs.List,null,c.map((e=>E.default.createElement(g.Tabs.Tab,{value:e.value,key:e.value},n(e.label))))))))};var $t;!function(e){e.doctor="doctor",e.service="hospital_service",e.hospital="hospital_branch"}($t||($t={}));const Dt=L.default.div`
|
|
761
|
+
background-color: var(--neutral50);
|
|
762
|
+
padding: 12px 0;
|
|
763
|
+
box-shadow: inset 0px 1px 0px #e4e8ec;
|
|
764
|
+
|
|
765
|
+
> * {
|
|
766
|
+
display: grid;
|
|
767
|
+
grid-template-columns: 32px 1fr;
|
|
768
|
+
align-content: center;
|
|
769
|
+
|
|
770
|
+
p {
|
|
771
|
+
font-weight: 600;
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
.icon-wrapper {
|
|
776
|
+
display: flex;
|
|
777
|
+
align-items: center;
|
|
778
|
+
}
|
|
779
|
+
`;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:g,gaTrackingLocationSearch:f,autoCompleteDisabled:m=!1,inputSearchPlaceholder:C="",isOptionAllLocation:b=!1,hideResults:y=[],isNavResultItem:v=!0,routerPush:x,onGeoLocationPermissionChange:L,onSearch:w,onChangeLocation:O})=>{const{t:k,locale:I}=a.useTranslations(),A=t.useRef(null),_=t.useRef(null),[F,$]=t.useState(void 0),[D,B]=t.useState(!1),{geoLocationPermission:V,geoLocationCoordinates:K,requestGeoLocation:H}=T(),[z,G]=t.useReducer(be,fe,(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:I}))),{navigateTo:Z,focused:Q,isLoadingCities:Y,cities:q,searchKeywords:W,geoLocationPermission:J,selectedLocation:X,initialSelectedCity:ee,defaultCity:te,searchResults:ae,isLoadingSearchResults:ie,isMobileModalOpened:oe,inputSearchPlaceholder:le}=z,{fetchCitiesByLocation:ne,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:me.FetchCitiesStart}),fetch(We(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:me.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(h.PATHS.GET_CITY_BY_IP,Object.assign(Object.assign({},a),o))];return"zh-TW"===i&&n.push(l(h.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:me.FetchCitiesByGeoIpComplete,payload:i})})).catch((e=>console.error("error loading cities by location",e)))}),[i,a,e]),fetchCitiesByKeyword:t.useCallback((function(t){return l(h.PATHS.GET_CITIES_LIST,{keyword:t}).then((t=>{e({type:me.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}${h.PATHS.GET_SEARCH_V2}`;e({type:me.FetchSearchResultsStart});const{defaultCity:s,selectedLocation:r,geoLocationCoordinates:c}=l;let d="";if(!r||!s)return void e({type:me.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(We(n,{domain:a,searchType:"global",keyword:t.trim().length>ge[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:me.FetchSearchResultsComplete,payload:t}))).catch((e=>{console.log("error loading search results",{url:n,error:e})})).finally((()=>e({type:me.FetchSearchResultsFinish})))}),[i,a,e])}}({dispatch:G,locale:I,careApiDomain:l}),de=t.useMemo((()=>{var e;return{id:o.ID_OPTION_CURRENT_LOCATION,name:k("booking.searchBar.currentLocation"),slug:null===(e=o.LOCALIZED_SLUGS[I])||void 0===e?void 0:e.CURRENT}}),[k,I]),ue=t.useMemo((()=>S.default(re,400)),[re]),pe=t.useMemo((()=>S.default(ce,400)),[ce]);t.useEffect((()=>{""!==c&&c!==z.searchKeywords&&G({type:me.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?G({type:me.GrantGeoLocationPermission,payload:K}):"denied"===V&&G({type:me.DenyGeoLocationPermission}))}),[J,V,K,n]),t.useEffect((()=>{Z&&(x?x(Z):window.location.href=`${d}${Z}`)}),[Z]);const Ce=t.useCallback((function(){G({type:me.SelectCurrentLocation,payload:de})}),[k,G]);t.useEffect((()=>{var e;"denied"===J||ee||G({type:me.SelectLocation,payload:{name:k("booking.searchBar.allLocations"),id:o.ID_OPTION_ALL_LOCATION,slug:null===(e=o.LOCALIZED_SLUGS[I])||void 0===e?void 0:e.ALL}}),L&&L(J,z.geoLocationCoordinates),i&&"granted"===J&&X&&G({type:me.FocusInputSearch}),ne({coordinates:z.geoLocationCoordinates})}),[J]),t.useEffect((()=>{X&&te&&ce(z.searchKeywords,z)}),[X,te]),t.useEffect((()=>{C!==le&&G({type:me.SetInputSearchPlaceholder,payload:C})}),[C,le]),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"===I&&B(!0),G({type:me.SelectLocation,payload:e}),"ms-MY"!==I&&Ee(),O&&O(e)}),[k,G]);function ve(){"ms-MY"===I&&B(!0),i&&"granted"!==z.geoLocationPermission?H():(Ce(),"ms-MY"!==I&&Ee())}function xe(){var e;A.current&&(null===(e=A.current.querySelector('input[name="search-location"]'))||void 0===e||e.focus())}function Ee(){var e;A.current&&(null===(e=A.current.querySelector('input[name="search-results"]'))||void 0===e||e.focus())}function Se(){G({type:me.CloseMobileModal})}function Le(){return"location"!==Q?null:E.default.createElement(U,{isLoading:Y,cities:q,onLocationClick:ye,onCurrentLocationClick:ve,isLocationLoading:Y,geoLocationPermission:J,selectedLocation:X,isOptionAllLocation:b})}function we(){return"search"!==Q?null:z.autoCompleteDisabled?i?E.default.createElement(ke,{onClick:()=>{w({cityId:z.selectedLocation.id,keyword:W}),Se()}}):null:E.default.createElement(qe,{data:ae,state:z,dispatch:G,isMobile:!1,keyword:W,isLoading:ie,hideResults:y,isNavResultItem:v})}function Oe(){return E.default.createElement(Ie,{isMobile:i,state:z,dispatch:G,debouncedFetchCitiesByKeyword:ue,debouncedFetchSearchResults:pe,focusLocationInput:xe,focusSearchInput:Ee,renderLocationResults:Le,renderSearchResults:we,trackingAttributes:g,locationTrackingAttributes:f,onSearch:w,initalSearchValue:c})}return t.useEffect((()=>{if(window.visualViewport){const e=e=>{const t=e.target;$(null==t?void 0:t.height)};return window.visualViewport.addEventListener("resize",e,{passive:!0}),()=>{window.visualViewport.removeEventListener("resize",e)}}}),[$]),t.useEffect((()=>{if(X&&D&&"ms-MY"===I){const e=`/${X.slug}/hospital`;G({type:me.NavigateTo,payload:e}),B(!1)}}),[D,I,X]),i?E.default.createElement(E.default.Fragment,null,E.default.createElement(P,null),E.default.createElement(N,{ref:_}),E.default.createElement(M,{id:"booking-search-bar",ref:A,"data-is-modal":i&&oe,style:{"--mobile-care-searchbar-height":oe&&F?`${F}px`:"100%"}},oe?E.default.createElement(E.default.Fragment,null,E.default.createElement(R,null,E.default.createElement(he,{headingText:k("booking.searchBar.searchButton"),onLeftClick:Se}),Oe()),Le(),we()):E.default.createElement(se,{onClick:function(){var t;return e.__awaiter(this,void 0,void 0,(function*(){_.current&&_.current.focus(),G({type:me.OpenMobileModal}),yield Promise.resolve(),A.current&&(null===(t=A.current.querySelector('input[name="search-location"]'))||void 0===t||t.focus())}))},focused:Q,value:W,trackingAttributes:g,inputSearchPlaceholder:C}))):E.default.createElement(j,{id:"booking-search-bar",ref:A},Oe())},exports.BookingSearchBarV2=({isMobile:e,careApiDomain:i,geoLocationPermission:l,geoLocationCoordinates:n,initialSelectedCity:s,initialSearchValue:r="",initTypeSearch:c="hospital",initSpecialty:u,careFrontDomain:p="/care",isDebug:f=!1,gaTrackingSearchBar:m,gaTrackingLocationSearch:C,autoCompleteDisabled:b=!1,inputSearchPlaceholder:y="",hideTabBookingSearch:v=[],hideSpecialtySelection:x=!1,hidePopularSearchKeys:L=!1,clientSlug:w="",routerPush:O,onGeoLocationPermissionChange:k,onChangeLocation:I})=>{const{locale:j,t:M}=a.useTranslations(),R=t.useRef(null),N=t.useRef(null),[A,P]=t.useState(c),{geoLocationPermission:_,geoLocationCoordinates:F}=T(),[$,D]=t.useReducer(lt,at,(t=>Object.assign(Object.assign({},t),{isDebug:f,isMobile:e,geoLocationPermission:l||_||"unset",geoLocationCoordinates:n||F||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}=$,{fetchCitiesByLocation:Y,fetchCitiesByKeyword:q,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:it.FetchCitiesStart}),fetch(We(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:it.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(h.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(h.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:it.FetchCitiesByGeoIpComplete,payload:i})})).catch((e=>console.error("error loading cities by location",e)))}),[i,a,e]),fetchCitiesByKeyword:t.useCallback((function(t){return n(h.PATHS.GET_CITIES_LIST,{keyword:t,client:l}).then((t=>{e({type:it.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}${h.PATHS.GET_SEARCH_SPECIALTY}`:`${a}${h.PATHS.GET_SEARCH_V2}`;e({type:it.FetchSearchResultsStart});const{selectedLocation:u,geoLocationCoordinates:p,selectedSpecialty:g}=n;let f="";if(!u)return void e({type:it.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==g?void 0:g.id)>0?null==g?void 0:g.id:"",y=t.trim().length>tt[i]?t.trim():"";return fetch(We(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:it.FetchSearchResultsComplete,payload:{key:s,searches:a||[]}}),c&&e({type:it.UpdateInitialSearchResults,payload:{key:s,searches:a||[]}})})).catch((e=>{console.log("error loading search results",{url:d,error:e})})).finally((()=>e({type:it.FetchSearchResultsFinish})))}),[i,a,e]),fetchAllSpecialties:t.useCallback((function(){const t=`${a}${h.PATHS.GET_SEARCH_SPECIALTY}`;return fetch(We(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:it.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}${h.PATHS.GET_SEARCH_POPULAR_KEY}`;return fetch(We(o,{domain:a,searchType:$t[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:it.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:E.default.createElement(mt,null),slug:ee.DOCTOR},service:{name:M("booking.searchPopup.services"),icon:E.default.createElement(Ct,null),slug:ee.SERVICE},hospital:{name:M("booking.searchPopup.hospitals"),icon:E.default.createElement(bt,null),slug:ee.HOSPITAL},specialty:{name:M("booking.searchPopup.specialties"),icon:E.default.createElement(yt,null),slug:ee.SPECIALTIES}})),[A]),ae=t.useMemo((()=>S.default(q,400)),[q]),ie=t.useMemo((()=>S.default(W,400)),[W]),oe=t.useCallback((function(e){D({type:it.SelectLocation,payload:e}),le(),I&&I(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:it.ClickOutsideInputSearchSpecialty})})),t.useEffect((()=>{var t;"denied"===H||Z||D({type:it.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}}),k&&k(H,$.geoLocationCoordinates),e&&"granted"===H&&z&&D({type:it.FocusInputSearch}),Y({coordinates:$.geoLocationCoordinates})}),[H]),t.useEffect((()=>{const e=u||{name:M("booking.searchBar.allSpecialties"),id:-1,thumbnail:"",total_doctor:0,slug:ee.SPECIALTIES};$.selectedSpecialty||D({type:it.SelectSpecialty,payload:e})}),[u,$.selectedSpecialty]),t.useEffect((()=>{J()}),[]),t.useEffect((()=>{X(A)}),[A]),t.useEffect((()=>{B&&(O?O(B):window.location.href=`${p}${B}`)}),[B]),t.useEffect((()=>{W($.searchKeywords,$,A,w,!0)}),[z,G,A]),E.default.createElement(Je,{ref:R},E.default.createElement(Ft,{currentTab:A,setCurrentTab:P,isMobile:e,hideTabBookingSearch:v}),E.default.createElement(Xe,{className:"booking-search-container"},E.default.createElement(et,null,E.default.createElement("div",{ref:N},E.default.createElement(g.Flex,{gap:"12px",justify:"space-between",align:"center",direction:e?"column":"row",className:"flex-search-input"},"specialty"!==A&&E.default.createElement(Ot,{state:$,isMobile:e,dispatch:D,debouncedFetchCitiesByKeyword:ae,selectedLocation:z,onLocationClick:oe,trackingAttributes:C}),E.default.createElement(xt,{type:A,isMobile:e,state:$,dispatch:D,debouncedFetchSearchResults:ie,initalSearchValue:r,focusSearchInput:le,typeInformation:te,trackingAttributes:m,isLoading:Q,hideSpecialtySelection:x,clientSlug:w}),E.default.createElement(g.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)&&$.selectedSpecialty.id>0&&(a=`&specialtyId=${$.selectedSpecialty.id}`),e="specialty"===A?`/${t}`:`/${z.slug}/${t}`,i&&(e+=`/${i}`),e+=`?q=${K}${a}`,e&&D({type:it.NavigateTo,payload:e})},styles:{root:{height:e?"40px":"48px"}}},M("booking.searchBar.searchButton"))),!L&&"specialty"!==A&&$.popularKeys.length>0&&E.default.createElement(Pt,{type:A,state:$,typeInformation:te,dispatch:D}),"specialty"===A&&"search"===V&&E.default.createElement(Mt,{state:$,isMobile:e,dispatch:D,specialties:(null==U?void 0:U.specialty)||[],isLoading:Q})))))},exports.ChevronDown=I,exports.TextDivider=({children:e,icon:t,className:a,style:i})=>E.default.createElement(Dt,{style:i,className:a},E.default.createElement(C.Container,null,E.default.createElement("div",{className:"icon-wrapper"},t),E.default.createElement(s.Text,{size:"c1",color:"var(--neutral800)"},e))),exports.types=Vt;
|
package/build/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./Onboarding-
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./Onboarding-06a9b342.js");Object.defineProperty(exports,"BabyGrowthChartDuration",{enumerable:!0,get:function(){return e.BabyGrowthChartDuration}}),Object.defineProperty(exports,"BabyGrowthChartType",{enumerable:!0,get:function(){return e.BabyGrowthChartType}}),Object.defineProperty(exports,"BabyGrowthResultTab",{enumerable:!0,get:function(){return e.BabyGrowthResultTab}}),Object.defineProperty(exports,"Gender",{enumerable:!0,get:function(){return e.Gender}}),Object.defineProperty(exports,"LOCALE",{enumerable:!0,get:function(){return e.LOCALE}}),Object.defineProperty(exports,"OnboardingStep",{enumerable:!0,get:function(){return e.OnboardingStep}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("react"),a=require("./Onboarding-
|
|
1
|
+
"use strict";var e=require("react"),a=require("./Onboarding-06a9b342.js"),n=require("./useTranslations-d57cfa60.js");const t={"vi-VN":"mang-thai","id-ID":"kehamilan","ms-MY":"kehamilan","km-KH":"ពពោះ","en-PH":"pregnancy","tl-PH":"pregnancy","th-TH":"การตั้งครรภ์","my-MM":"pregnancy","zh-TW":"pregnancy","hi-IN":"pregnancy"},b={[a.LOCALE.Vietnam]:{sexualWellness:"suc-khoe-tinh-duc",health:"suc-khoe",healthyEating:"an-uong-lanh-manh",skinHealth:"da-lieu",healthyHabit:"thoi-quen-lanh-manh",drug:"thuoc",womensHealth:"suc-khoe-phu-nu",fitness:"the-duc-the-thao",pregnancy:"mang-thai",parenting:"nuoi-day-con",diabetes:"tieu-duong-dai-thao-duong",healthyMind:"tam-ly-tam-than"},[a.LOCALE.Indonesia]:{pregnancy:"kehamilan",parenting:"parenting",health:"sehat",diabetes:"diabetes",womensHealth:"wanita",drug:"obat-suplemen",sexualWellness:"",healthyEating:"",skinHealth:""},[a.LOCALE.Malaysia]:{pregnancy:"kehamilan",parenting:"keibubapaan",health:"kesihatan",diabetes:"kencing-manis",womensHealth:"kesihatan-wanita",drug:"ubat",sexualWellness:"",healthyEating:"",skinHealth:""},[a.LOCALE.Cambodia]:{pregnancy:"%e1%9e%96%e1%9e%96%e1%9f%84%e1%9f%87",parenting:"%e1%9e%85%e1%9e%b7%e1%9e%89%e1%9f%92%e1%9e%85%e1%9e%b9%e1%9e%98%e1%9e%80%e1%9e%bc%e1%9e%93",health:"%e1%9e%9f%e1%9e%bb%e1%9e%81%e1%9e%97%e1%9e%b6%e1%9e%96%e1%9e%91%e1%9e%bc%e1%9e%91%e1%9f%85",diabetes:"%e1%9e%87%e1%9f%86%e1%9e%84%e1%9e%ba%e1%9e%91%e1%9e%b9%e1%9e%80%e1%9e%93%e1%9f%84%e1%9e%98%e1%9e%95%e1%9f%92%e1%9e%a2%e1%9f%82%e1%9e%98",womensHealth:"%e1%9e%9f%e1%9e%bb%e1%9e%81%e1%9e%97%e1%9e%b6%e1%9e%96%e1%9e%9f%e1%9f%92%e1%9e%8f%e1%9f%92%e1%9e%9a%e1%9e%b8",drug:"%e1%9e%b1%e1%9e%9f%e1%9e%90%e1%9e%93%e1%9e%b7%e1%9e%84%e1%9e%a2%e1%9e%b6%e1%9e%a0%e1%9e%b6%e1%9e%9a%e1%9e%94%e1%9f%86%e1%9e%94%e1%9f%89%e1%9e%93",sexualWellness:"",healthyEating:"",skinHealth:""},[a.LOCALE.PhilippinesEnglish]:{pregnancy:"pregnancy",parenting:"parenting",health:"health",diabetes:"diabetes",womensHealth:"womens-health",drug:"drugs-supplements",sexualWellness:"",healthyEating:"",skinHealth:""},[a.LOCALE.PhilippinesTagalog]:{pregnancy:"pagbubuntis",parenting:"pagiging-magulang",health:"kalusugan",diabetes:"diabetes-fil",womensHealth:"kalusugan-kababaihan",drug:"drugs-at-supplements",sexualWellness:"",healthyEating:"",skinHealth:""},[a.LOCALE.Thailand]:{pregnancy:"%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b8%95%e0%b8%b1%e0%b9%89%e0%b8%87%e0%b8%84%e0%b8%a3%e0%b8%a3%e0%b8%a0%e0%b9%8c",parenting:"%e0%b8%9e%e0%b9%88%e0%b8%ad%e0%b9%81%e0%b8%a1%e0%b9%88%e0%b9%80%e0%b8%a5%e0%b8%b5%e0%b9%89%e0%b8%a2%e0%b8%87%e0%b8%a5%e0%b8%b9%e0%b8%81",health:"%e0%b8%aa%e0%b8%b8%e0%b8%82%e0%b8%a0%e0%b8%b2%e0%b8%9e",diabetes:"%e0%b9%82%e0%b8%a3%e0%b8%84%e0%b9%80%e0%b8%9a%e0%b8%b2%e0%b8%ab%e0%b8%a7%e0%b8%b2%e0%b8%99",womensHealth:"%e0%b8%aa%e0%b8%b8%e0%b8%82%e0%b8%a0%e0%b8%b2%e0%b8%9e%e0%b8%ab%e0%b8%8d%e0%b8%b4%e0%b8%87",drug:"%e0%b8%a2%e0%b8%b2%e0%b9%81%e0%b8%a5%e0%b8%b0%e0%b8%ad%e0%b8%b2%e0%b8%ab%e0%b8%b2%e0%b8%a3%e0%b9%80%e0%b8%aa%e0%b8%a3%e0%b8%b4%e0%b8%a1",sexualWellness:"",healthyEating:"",skinHealth:""},[a.LOCALE.Myanmar]:{pregnancy:"pregnancy",parenting:"parenting",health:"health",diabetes:"diabetes",womensHealth:"womens-health",drug:"drugs-az",sexualWellness:"",healthyEating:"",skinHealth:""},[a.LOCALE.Taiwan]:{pregnancy:"pregnancy",parenting:"parenting",health:"health",diabetes:"diabetes",womensHealth:"womens-health",drug:"drugs-supplement",sexualWellness:"",healthyEating:"",skinHealth:""},[a.LOCALE.India]:{pregnancy:"pregnancy",parenting:"parenting",health:"health",diabetes:"diabetes",womensHealth:"womens-health",diabetesEn:"en-diabetes",drug:"dawaai",sexualWellness:"",healthyEating:"",skinHealth:""}};exports.MAPPED_CATEGORY_SLUGS=b,exports.PREGNANCY_SLUG=t,exports.useCategory=a=>{const{locale:s}=n.useTranslations();return{isPregnancy:e.useMemo((()=>decodeURI(a.replace(/\//gi,"")).includes(t[s])),[]),isParenting:e.useMemo((()=>{var e;return decodeURI(a.replace(/\//gi,"")).includes(null===(e=b[s])||void 0===e?void 0:e.parenting)}),[]),type:e.useMemo((()=>function(e,a){const n=e.split("/");for(const e in a){const t=a[e];if(n.includes(t))return e}return null}(a,b[s])),[a,s])}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("./tslib.es6-
|
|
1
|
+
"use strict";var e=require("./tslib.es6-15853eea.js"),t=require("react"),a=require("./getDynamicHealthTool-6139d439.js");exports.useHealthToolsCache=o=>{const[i,l]=t.useState([]);t.useEffect((()=>{e.__awaiter(void 0,void 0,void 0,(function*(){const e=yield a.getDynamicHealthToolWithCache(o);l(e)}))}),[a.getDynamicHealthToolWithCache,o]);const r=t.useCallback((e=>{var t;return(null===(t=i.find((t=>t.template===e)))||void 0===t?void 0:t.link)||""}),[i]);return{allTools:i,getHealthToolLink:r}};
|