@hhgtech/hhg-components 1.27.63 → 1.27.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/babyGrowth.js +2 -2
- package/build/cache.js +1 -1
- package/build/care.js +1 -1
- package/build/components/atoms/flag/index.d.ts +2 -1
- package/build/components/atoms/icons/Plus.d.ts +0 -1
- package/build/components/mantine/phone/index.helpers.d.ts +0 -2
- package/build/components.js +1 -1
- package/build/constants.js +1 -1
- package/build/{core-3c2534b4.js → core-8fa69c4e.js} +1 -1
- package/build/{dataTransform-34c3a610.js → dataTransform-183f0a89.js} +1 -1
- package/build/ecom.js +1 -1
- package/build/esm/babyGrowth.js +9 -9
- package/build/esm/cache.js +1 -1
- package/build/esm/care.js +1 -1
- package/build/esm/components/atoms/flag/index.d.ts +2 -1
- package/build/esm/components/atoms/icons/Plus.d.ts +0 -1
- package/build/esm/components/mantine/phone/index.helpers.d.ts +0 -2
- package/build/esm/components.js +1 -1
- package/build/esm/constants.js +1 -1
- package/build/esm/{core-fb32fa44.js → core-8d8133c6.js} +1 -1
- package/build/esm/{dataTransform-7728edfe.js → dataTransform-828b0610.js} +1 -1
- package/build/esm/ecom.js +1 -1
- package/build/esm/fixedBottomAdBlock-a8558744.js +1 -0
- package/build/esm/footer.js +1 -1
- package/build/esm/gAssets.js +1 -1
- package/build/esm/{getDynamicHealthTool-278c363e.js → getDynamicHealthTool-a6133467.js} +1 -1
- package/build/esm/{getSocialList-62ecf673.js → getSocialList-89088867.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/icons/index.d.ts +1 -10
- package/build/esm/{index-34ccbed3.js → index-008e6823.js} +1 -1
- package/build/esm/{index-f3cb6311.js → index-0a8511e9.js} +1 -1
- package/build/esm/index-0df71134.js +1 -0
- package/build/esm/{index-1e0399b8.js → index-1664824d.js} +1 -1
- package/build/esm/index-2139478a.js +1 -0
- package/build/esm/{index-bc49d8ed.js → index-388f05d1.js} +2 -2
- package/build/esm/{index-e05f213d.js → index-38959739.js} +1 -1
- package/build/esm/{index-bf3440a9.js → index-3cc4d399.js} +1 -1
- package/build/esm/{index-14497882.js → index-4018e954.js} +1 -1
- package/build/esm/{index-58f1c04c.js → index-49edd755.js} +1 -1
- package/build/esm/{index-65f9a5d1.js → index-5399422b.js} +1 -1
- package/build/esm/index-69a72d60.js +1 -0
- package/build/esm/{index-755fcc76.js → index-84d41c55.js} +4 -4
- package/build/esm/{index-c0310544.js → index-985864ab.js} +1 -1
- package/build/esm/{index-5bfac6f6.js → index-98969c21.js} +1 -1
- package/build/esm/{index-6bf23069.js → index-b0d4c8fa.js} +1 -1
- package/build/esm/{index-f23d2ac2.js → index-c32bc041.js} +1 -1
- package/build/esm/index-cb5ed82e.js +1 -0
- package/build/esm/{index-b3ca9aee.js → index-dac6a1ca.js} +1 -1
- package/build/esm/{index-ae97141b.js → index-ed6a633c.js} +1 -1
- package/build/esm/index-edd38938.js +1 -0
- package/build/esm/{index-d1fcb2f3.js → index-fe1140bf.js} +2 -2
- package/build/esm/index.css +1 -1
- package/build/esm/index.js +1 -1
- package/build/esm/{index.styled-83a48076.js → index.styled-089fb51b.js} +1 -1
- package/build/esm/{index.styled-ece06d74.js → index.styled-bd98c51b.js} +10 -10
- package/build/esm/{index.styled-5622019d.js → index.styled-c0e7c0e2.js} +6 -6
- 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/onboarding.js +1 -1
- package/build/esm/onboardingV2.js +18 -18
- package/build/esm/pwg.js +3 -3
- package/build/esm/{routing-55df71ec.js → routing-efa9ad3e.js} +1 -1
- package/build/esm/{screenSizeContext-73847cbc.js → screenSizeContext-72879ba5.js} +4 -4
- package/build/esm/together.js +1 -1
- package/build/esm/{types-993fae95.js → types-76dc7f4d.js} +9 -9
- package/build/esm/{types-2ddae413.js → types-ccbd2b92.js} +13 -13
- package/build/esm/types.js +1 -1
- package/build/esm/useHealthToolCache-8a255b38.js +1 -0
- package/build/esm/{useRafState-ef4c640a.js → useRafState-9454094a.js} +1 -1
- package/build/esm/{useTranslations-fc5ada3b.js → useTranslations-867f4438.js} +1 -1
- package/build/esm/{utils-2f67c22e.js → utils-4f377733.js} +1 -1
- package/build/esm/utils-b18d6dc0.js +1210 -0
- package/build/esm/vaccination.js +5 -5
- package/build/{fixedBottomAdBlock-ae45b6ce.js → fixedBottomAdBlock-ead8d531.js} +1 -1
- package/build/footer.js +1 -1
- package/build/gAssets.js +1 -1
- package/build/getDynamicHealthTool-5e309a19.js +1 -0
- package/build/{getSocialList-36e95a94.js → getSocialList-5519aeaf.js} +1 -1
- package/build/hooks.js +1 -1
- package/build/i18n.js +1 -1
- package/build/i18nV2.js +1 -1
- package/build/icons/index.d.ts +1 -10
- package/build/{index-dc95faf3.js → index-0adc19ec.js} +1 -1
- package/build/{index-c3406e04.js → index-0ae0e99b.js} +1 -1
- package/build/index-20fcf513.js +1 -0
- package/build/{index-90e7d1fb.js → index-2587fdd8.js} +1 -1
- package/build/{index-66525be3.js → index-2ebedd68.js} +2 -2
- package/build/{index-2a187e8a.js → index-329a8f28.js} +1 -1
- package/build/{index-223774a0.js → index-438678eb.js} +1 -1
- package/build/{index-f0786bb6.js → index-4829ab1b.js} +1 -1
- package/build/{index-2002abf1.js → index-5afb9a33.js} +1 -1
- package/build/{index-96cc1109.js → index-641b8a2d.js} +1 -1
- package/build/{index-bbee939d.js → index-7cf1752e.js} +1 -1
- package/build/index-8cf73a21.js +1 -0
- package/build/{index-af139f2c.js → index-94f2dbb9.js} +1 -1
- package/build/{index-975e823d.js → index-98b81a95.js} +1 -1
- package/build/{index-e607b764.js → index-98bb178d.js} +1 -1
- package/build/{index-124d9ea4.js → index-aab043d9.js} +1 -1
- package/build/{index-82e3c7ee.js → index-b1d4d77c.js} +1 -1
- package/build/{index-da8873b6.js → index-c0ebb986.js} +1 -1
- package/build/{index-0907febb.js → index-c4685109.js} +1 -1
- package/build/{index-7a000b10.js → index-e84a6a14.js} +1 -1
- package/build/{index-79d40f6b.js → index-f8f30578.js} +1 -1
- package/build/index-fa4d381a.js +1 -0
- package/build/index.css +1 -1
- package/build/index.js +1 -1
- package/build/{index.styled-febe5640.js → index.styled-765feecc.js} +1 -1
- package/build/{index.styled-0bda59df.js → index.styled-eb4ccdac.js} +6 -6
- package/build/{index.styled-e6c5ca10.js → index.styled-f5321c72.js} +1 -1
- package/build/lead.js +1 -1
- package/build/mantine.js +1 -1
- package/build/misc.js +1 -1
- package/build/navigation.js +1 -1
- package/build/onboarding.js +1 -1
- package/build/onboardingV2.js +1 -1
- package/build/pwg.js +1 -1
- package/build/{routing-b3267f9f.js → routing-76a29289.js} +1 -1
- package/build/{screenSizeContext-f4df1525.js → screenSizeContext-2ec3be24.js} +3 -3
- package/build/together.js +1 -1
- package/build/{types-edc9df3a.js → types-3ae636c2.js} +1 -1
- package/build/{types-1a74fcda.js → types-db35dc9b.js} +8 -8
- package/build/types.js +1 -1
- package/build/{useHealthToolCache-f0a1ce86.js → useHealthToolCache-68d4bec0.js} +1 -1
- package/build/{useRafState-a4d233e3.js → useRafState-46ab8521.js} +1 -1
- package/build/{useTranslations-9dd72b67.js → useTranslations-7a6dc657.js} +1 -1
- package/build/{utils-4da1dcaa.js → utils-12cf57b1.js} +1 -1
- package/build/{utils-4766eefa.js → utils-7923573b.js} +71 -75
- package/build/vaccination.js +1 -1
- package/package.json +1 -1
- package/build/esm/fixedBottomAdBlock-0f7402ad.js +0 -1
- package/build/esm/icons/Cambodia.d.ts +0 -4
- package/build/esm/icons/India.d.ts +0 -4
- package/build/esm/icons/Indonesia.d.ts +0 -4
- package/build/esm/icons/Malaysia.d.ts +0 -4
- package/build/esm/icons/Myanmar.d.ts +0 -4
- package/build/esm/icons/Phillipines.d.ts +0 -4
- package/build/esm/icons/Taiwan.d.ts +0 -4
- package/build/esm/icons/Thailand.d.ts +0 -4
- package/build/esm/icons/Vietnam.d.ts +0 -4
- package/build/esm/index-159eb35a.js +0 -1
- package/build/esm/index-73a035be.js +0 -1
- package/build/esm/index-be00d57f.js +0 -1
- package/build/esm/index-be7f337b.js +0 -1
- package/build/esm/index-c476cd5f.js +0 -1
- package/build/esm/useHealthToolCache-407fdaf8.js +0 -1
- package/build/esm/utils-80b5125d.js +0 -1214
- package/build/getDynamicHealthTool-79c02fde.js +0 -1
- package/build/icons/Cambodia.d.ts +0 -4
- package/build/icons/India.d.ts +0 -4
- package/build/icons/Indonesia.d.ts +0 -4
- package/build/icons/Malaysia.d.ts +0 -4
- package/build/icons/Myanmar.d.ts +0 -4
- package/build/icons/Phillipines.d.ts +0 -4
- package/build/icons/Taiwan.d.ts +0 -4
- package/build/icons/Thailand.d.ts +0 -4
- package/build/icons/Vietnam.d.ts +0 -4
- package/build/index-851dc200.js +0 -1
- package/build/index-a3975029.js +0 -1
- package/build/index-f3cd3d0d.js +0 -1
- /package/build/{BMI_BOYS.percentile.monthly-7edae6b0.js → BMI_BOYS.percentile.monthly-c93fe05c.js} +0 -0
- /package/build/{BMI_BOYS.percentile.weekly-a2f775b2.js → BMI_BOYS.percentile.weekly-9f4a7360.js} +0 -0
- /package/build/{BMI_BOYS.percentile.yearly-91cf3ea8.js → BMI_BOYS.percentile.yearly-d9717969.js} +0 -0
- /package/build/{BMI_BOYS.zscore.monthly-762a118a.js → BMI_BOYS.zscore.monthly-4891e555.js} +0 -0
- /package/build/{BMI_BOYS.zscore.weekly-020fd45f.js → BMI_BOYS.zscore.weekly-6378d046.js} +0 -0
- /package/build/{BMI_BOYS.zscore.yearly-4ea4a49b.js → BMI_BOYS.zscore.yearly-8258f34c.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.monthly-f59b7fec.js → BMI_GIRLS.percentile.monthly-9c011d42.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.weekly-9e5c0638.js → BMI_GIRLS.percentile.weekly-1aafd7ea.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.yearly-40763bf7.js → BMI_GIRLS.percentile.yearly-c07d8294.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.monthly-3e29e614.js → BMI_GIRLS.zscore.monthly-a52b4325.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.weekly-cec195f2.js → BMI_GIRLS.zscore.weekly-36c16796.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.yearly-c9b7f8cd.js → BMI_GIRLS.zscore.yearly-355dbf5c.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-4dbb11a5.js → HEAD CIRCUM_BOYS.percentile.monthly-950181c5.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-a6677734.js → HEAD CIRCUM_BOYS.percentile.weekly-d0f3d972.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-55bcdc02.js → HEAD CIRCUM_BOYS.percentile.yearly-41578035.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-abb118d5.js → HEAD CIRCUM_BOYS.zscore.monthly-08979c4b.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-07205609.js → HEAD CIRCUM_BOYS.zscore.weekly-e002d31c.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-8b55414d.js → HEAD CIRCUM_BOYS.zscore.yearly-8cb86777.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-24b19a96.js → HEAD CIRCUM_GIRLS.percentile.monthly-da1953ff.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-0ec151cc.js → HEAD CIRCUM_GIRLS.percentile.weekly-c17050f4.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-dffbcde2.js → HEAD CIRCUM_GIRLS.percentile.yearly-89e01428.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-e5eaa3fc.js → HEAD CIRCUM_GIRLS.zscore.monthly-2aac13dc.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-8c79c5cc.js → HEAD CIRCUM_GIRLS.zscore.weekly-9637ef6f.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-f9cbaac6.js → HEAD CIRCUM_GIRLS.zscore.yearly-2ec14e1f.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.monthly-fc39af10.js → HEIGHT_BOYS.percentile.monthly-e8cd8a3a.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.weekly-8c94fb81.js → HEIGHT_BOYS.percentile.weekly-445e58bc.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.yearly-67fda8a7.js → HEIGHT_BOYS.percentile.yearly-0cb23a78.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.monthly-cb92918b.js → HEIGHT_BOYS.zscore.monthly-770d9962.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.weekly-ad926420.js → HEIGHT_BOYS.zscore.weekly-fce9ab91.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.yearly-561a8d44.js → HEIGHT_BOYS.zscore.yearly-172cbce5.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.monthly-69dcd67a.js → HEIGHT_GIRLS.percentile.monthly-f364d029.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.weekly-6e631303.js → HEIGHT_GIRLS.percentile.weekly-370e9f31.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.yearly-f6aebf67.js → HEIGHT_GIRLS.percentile.yearly-6e43d45b.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.monthly-7ed59e9a.js → HEIGHT_GIRLS.zscore.monthly-361a5fd4.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.weekly-b3aebd2f.js → HEIGHT_GIRLS.zscore.weekly-1dce7533.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.yearly-7a7725c6.js → HEIGHT_GIRLS.zscore.yearly-88931eaa.js} +0 -0
- /package/build/{Onboarding-b1ce9fc5.js → Onboarding-f60f1731.js} +0 -0
- /package/build/{Visible-8745c79f.js → Visible-7ffc3ded.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.monthly-b0bd06e4.js → WEIGHT_BOYS.percentile.monthly-db112fdf.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.weekly-68851dae.js → WEIGHT_BOYS.percentile.weekly-cd5cc546.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.yearly-e7a67889.js → WEIGHT_BOYS.percentile.yearly-046061a9.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.monthly-6d49c7c5.js → WEIGHT_BOYS.zscore.monthly-7706845b.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.weekly-122f4e5b.js → WEIGHT_BOYS.zscore.weekly-21c0fa5c.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.yearly-41e6a005.js → WEIGHT_BOYS.zscore.yearly-2c333c17.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.monthly-6cb2e977.js → WEIGHT_GIRLS.percentile.monthly-fb3ca4ea.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.weekly-dae606cb.js → WEIGHT_GIRLS.percentile.weekly-fbaa8120.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.yearly-c60fd86c.js → WEIGHT_GIRLS.percentile.yearly-a54a1048.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.monthly-c64b34bb.js → WEIGHT_GIRLS.zscore.monthly-6b72bfa7.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.weekly-6098ff7d.js → WEIGHT_GIRLS.zscore.weekly-b118ba73.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.yearly-e919f873.js → WEIGHT_GIRLS.zscore.yearly-eaf095db.js} +0 -0
- /package/build/{constants-ca2e8ac5.js → constants-fc06ec88.js} +0 -0
- /package/build/{cookieHelper-c6ee4930.js → cookieHelper-e2a16eef.js} +0 -0
- /package/build/{dataTransform-4352b00a.js → dataTransform-87ccd8ae.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.monthly-bc7f7fa4.js → BMI_BOYS.percentile.monthly-f5493df9.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.weekly-baadb64f.js → BMI_BOYS.percentile.weekly-079676ff.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.yearly-e7349354.js → BMI_BOYS.percentile.yearly-2c8fb9be.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.monthly-1160b3d1.js → BMI_BOYS.zscore.monthly-70f284f6.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.weekly-d5d4e209.js → BMI_BOYS.zscore.weekly-5c8f1872.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.yearly-817441b9.js → BMI_BOYS.zscore.yearly-e60ff028.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.monthly-3be40316.js → BMI_GIRLS.percentile.monthly-53d8478c.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.weekly-8ec5312c.js → BMI_GIRLS.percentile.weekly-5a929114.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.yearly-6a3cf831.js → BMI_GIRLS.percentile.yearly-7c75b3d1.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.monthly-f096052f.js → BMI_GIRLS.zscore.monthly-8fdd3d14.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.weekly-6f787231.js → BMI_GIRLS.zscore.weekly-5bfbecc6.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.yearly-f5703f4e.js → BMI_GIRLS.zscore.yearly-0bf13165.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.monthly-0d3faab4.js → HEAD CIRCUM_BOYS.percentile.monthly-50fa3100.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.weekly-d74d0de6.js → HEAD CIRCUM_BOYS.percentile.weekly-fd874376.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.yearly-4ac4e5a9.js → HEAD CIRCUM_BOYS.percentile.yearly-8892d457.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.monthly-cc6fb183.js → HEAD CIRCUM_BOYS.zscore.monthly-55473372.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.weekly-80b73981.js → HEAD CIRCUM_BOYS.zscore.weekly-b9e4bf5a.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.yearly-a8e52858.js → HEAD CIRCUM_BOYS.zscore.yearly-fe185932.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.monthly-a50ea344.js → HEAD CIRCUM_GIRLS.percentile.monthly-25307c81.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.weekly-6f46a543.js → HEAD CIRCUM_GIRLS.percentile.weekly-d02f0035.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.yearly-0c74c093.js → HEAD CIRCUM_GIRLS.percentile.yearly-f8d756b7.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.monthly-d994c857.js → HEAD CIRCUM_GIRLS.zscore.monthly-f06224ac.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.weekly-f3467ce8.js → HEAD CIRCUM_GIRLS.zscore.weekly-4c10101b.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.yearly-f2d29a69.js → HEAD CIRCUM_GIRLS.zscore.yearly-140a665b.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.monthly-e0b5f9e2.js → HEIGHT_BOYS.percentile.monthly-d4698bd0.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.weekly-fc728215.js → HEIGHT_BOYS.percentile.weekly-281d80ba.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.yearly-75d18b83.js → HEIGHT_BOYS.percentile.yearly-86a463f9.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.monthly-c941cb1e.js → HEIGHT_BOYS.zscore.monthly-dc709a7e.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.weekly-4942fb03.js → HEIGHT_BOYS.zscore.weekly-f91429b3.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.yearly-29ca25df.js → HEIGHT_BOYS.zscore.yearly-490d1d03.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.monthly-b41d4360.js → HEIGHT_GIRLS.percentile.monthly-e819f004.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.weekly-6339978c.js → HEIGHT_GIRLS.percentile.weekly-3cae80a1.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.yearly-cd62e570.js → HEIGHT_GIRLS.percentile.yearly-f1c09b16.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.monthly-5aaf189a.js → HEIGHT_GIRLS.zscore.monthly-6f0a649c.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.weekly-f1611d6e.js → HEIGHT_GIRLS.zscore.weekly-3ed3a4f3.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.yearly-a3085a74.js → HEIGHT_GIRLS.zscore.yearly-2100de16.js} +0 -0
- /package/build/esm/{Onboarding-592dea4f.js → Onboarding-f02d6d21.js} +0 -0
- /package/build/esm/{Visible-9fde4cfe.js → Visible-2886fabc.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.monthly-87df740f.js → WEIGHT_BOYS.percentile.monthly-1820e415.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.weekly-046b8123.js → WEIGHT_BOYS.percentile.weekly-4866156b.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.yearly-6877e8df.js → WEIGHT_BOYS.percentile.yearly-dbffaffe.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.monthly-f42d40ef.js → WEIGHT_BOYS.zscore.monthly-1d27dba3.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.weekly-87a45b3a.js → WEIGHT_BOYS.zscore.weekly-58eb8a55.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.yearly-e8975f8e.js → WEIGHT_BOYS.zscore.yearly-03a20934.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.monthly-2cdf9c46.js → WEIGHT_GIRLS.percentile.monthly-e69188ad.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.weekly-cfd4690b.js → WEIGHT_GIRLS.percentile.weekly-ade03461.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.yearly-d7cc0e9d.js → WEIGHT_GIRLS.percentile.yearly-780f9d37.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.monthly-2b5fd51f.js → WEIGHT_GIRLS.zscore.monthly-7e5e8ace.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.weekly-425d08ee.js → WEIGHT_GIRLS.zscore.weekly-ec1bd19b.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.yearly-157b0732.js → WEIGHT_GIRLS.zscore.yearly-d3ac1363.js} +0 -0
- /package/build/esm/{constants-57b85347.js → constants-d55a1795.js} +0 -0
- /package/build/esm/{cookieHelper-a61f145b.js → cookieHelper-6f4e3a41.js} +0 -0
- /package/build/esm/{dataTransform-ec91d564.js → dataTransform-ae1c1731.js} +0 -0
- /package/build/esm/{index-f32973b6.js → index-60d18ce9.js} +0 -0
- /package/build/esm/{isProduction-2f2a254f.js → isProduction-0c2cae98.js} +0 -0
- /package/build/esm/{localizeNumberFormat-0e4fc477.js → localizeNumberFormat-12572e07.js} +0 -0
- /package/build/esm/{normalizeLink-fbc09916.js → normalizeLink-935cd392.js} +0 -0
- /package/build/esm/{paths-3eb0ea12.js → paths-dbed4a65.js} +0 -0
- /package/build/esm/{theme-1af15451.js → theme-11563c3e.js} +0 -0
- /package/build/esm/{translationsContext-d9be310d.js → translationsContext-9e7b886f.js} +0 -0
- /package/build/esm/{tslib.es6-01eae420.js → tslib.es6-59dde6fd.js} +0 -0
- /package/build/esm/{types-fe86acdb.js → types-8359c3c0.js} +0 -0
- /package/build/esm/{useIsInit-b305c968.js → useIsInit-5c7bb63a.js} +0 -0
- /package/build/esm/{useOutsideClick-f2098c7b.js → useOutsideClick-80d055f7.js} +0 -0
- /package/build/esm/{useScrollbarSize-b1db9f16.js → useScrollbarSize-e1a8f47f.js} +0 -0
- /package/build/esm/{useUniqueId-f61c11f2.js → useUniqueId-cb0fa4a1.js} +0 -0
- /package/build/esm/{utils-5e9f366f.js → utils-3cac945d.js} +0 -0
- /package/build/{index-50c3e071.js → index-ab06984c.js} +0 -0
- /package/build/{isProduction-1f2830f9.js → isProduction-3d2e8fb4.js} +0 -0
- /package/build/{localizeNumberFormat-bf39f666.js → localizeNumberFormat-e4fed0ee.js} +0 -0
- /package/build/{normalizeLink-c2eb5765.js → normalizeLink-81027e41.js} +0 -0
- /package/build/{paths-fc4b2aaa.js → paths-0c90b0af.js} +0 -0
- /package/build/{theme-1b825e83.js → theme-0f334c67.js} +0 -0
- /package/build/{translationsContext-76749ce1.js → translationsContext-ed457050.js} +0 -0
- /package/build/{tslib.es6-3d2a248b.js → tslib.es6-d82afd51.js} +0 -0
- /package/build/{types-8642cda8.js → types-7f987664.js} +0 -0
- /package/build/{useIsInit-0e52464a.js → useIsInit-37600900.js} +0 -0
- /package/build/{useOutsideClick-89067af2.js → useOutsideClick-efe21940.js} +0 -0
- /package/build/{useScrollbarSize-7ae15d80.js → useScrollbarSize-b666e0b9.js} +0 -0
- /package/build/{useUniqueId-72be3b62.js → useUniqueId-c9fd43d1.js} +0 -0
- /package/build/{utils-009745cf.js → utils-f67a089d.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e,_ as t}from"./tslib.es6-
|
|
1
|
+
import{a as e,_ as t}from"./tslib.es6-59dde6fd.js";import*as a from"react";import o,{createContext as n,useContext as i,useState as l,useRef as r,useEffect as s,useMemo as c,useCallback as d}from"react";import{useMantineTheme as m,createStyles as p,Flex as u,Box as g,rem as v,Checkbox as h,Portal as b,Anchor as f,Accordion as y,Popover as w}from"@mantine/core";import{a as x}from"./index-49edd755.js";import{u as E}from"./useTranslations-867f4438.js";import C from"innertext";import{t as k}from"./theme-11563c3e.js";import{d as N,ab as A,ac as T,R as z,ad as P,ae as I,af as S,H as L,ag as M,I as j,ah as B,y as F,V as O,ai as R,aj as V,ak as D,al as U,am as W,an as H,x as Z,ao as q,ap as _,aq as G,ar as Q,as as X,at as K,J as $,au as Y,a3 as J,av as ee,A as te,aw as ae,ax as oe,ay as ne,az as ie,aA as le,aB as re}from"./utils-b18d6dc0.js";import"@mantine/hooks";import{CommonGAssets as se}from"./gAssets.js";import"@mantine/dates";import{D as ce,d as de}from"./index-c32bc041.js";import"./Onboarding-f02d6d21.js";import me from"dayjs";import"./screenSizeContext-72879ba5.js";import pe,{keyframes as ue,css as ge}from"styled-components";import{M as ve,t as he,c as be,a as fe}from"./utils-3cac945d.js";import"./isProduction-0c2cae98.js";import{I as ye}from"./index-84d41c55.js";import{A as we,a as xe,B as Ee,D as Ce}from"./index-cb5ed82e.js";import{e as ke,c as Ne,P as Ae,g as Te,b as ze,h as Pe,i as Ie}from"./dataTransform-828b0610.js";import{T as Se}from"./index-985864ab.js";import{I as Le}from"./index-4018e954.js";import Me from"lodash/debounce";import je from"react-contenteditable";import{B as Be}from"./index-dac6a1ca.js";import{d as Fe,g as Oe}from"./cookieHelper-6f4e3a41.js";import*as Re from"react-dom";import"./index-0a8511e9.js";import{format as Ve}from"date-fns";import"react-day-picker/DayPickerInput";import{U as De}from"./index.styled-bd98c51b.js";import"./index-fe1140bf.js";import"lodash/throttle";import"./types-8359c3c0.js";import"react-hook-form";import"date-fns/locale/en-US";import"date-fns/locale/id";import"date-fns/locale/vi";import"date-fns/locale/zh-TW";import"./index.styled-c0e7c0e2.js";import"uuid";import"./utils-4f377733.js";import"string-format";import Ue from"dayjs/plugin/relativeTime";import{M as We}from"./index-3cc4d399.js";import{a as He}from"./useUniqueId-cb0fa4a1.js";import"./translationsContext-9e7b886f.js";import{g as Ze}from"./routing-efa9ad3e.js";const qe=e=>a.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},e),a.createElement("path",{d:"M3.99403 3.32695C3.86141 3.32698 3.73181 3.36657 3.62181 3.44065C3.5118 3.51472 3.42638 3.61992 3.37648 3.7428C3.32658 3.86567 3.31445 4.00064 3.34165 4.13044C3.36885 4.26024 3.43415 4.37898 3.52919 4.47148L7.05784 8.00013L3.52919 11.5288C3.46521 11.5902 3.41413 11.6638 3.37894 11.7452C3.34375 11.8266 3.32516 11.9142 3.32425 12.0029C3.32335 12.0916 3.34015 12.1796 3.37368 12.2617C3.40721 12.3438 3.45678 12.4185 3.5195 12.4812C3.58222 12.5439 3.65682 12.5935 3.73894 12.627C3.82106 12.6605 3.90904 12.6773 3.99774 12.6764C4.08643 12.6755 4.17405 12.6569 4.25547 12.6217C4.33689 12.5865 4.41047 12.5355 4.4719 12.4715L8.00054 8.94283L11.5292 12.4715C11.5906 12.5355 11.6642 12.5865 11.7456 12.6217C11.827 12.6569 11.9147 12.6755 12.0034 12.6764C12.092 12.6773 12.18 12.6605 12.2621 12.627C12.3443 12.5935 12.4189 12.5439 12.4816 12.4812C12.5443 12.4185 12.5939 12.3439 12.6274 12.2617C12.6609 12.1796 12.6777 12.0916 12.6768 12.0029C12.6759 11.9142 12.6573 11.8266 12.6222 11.7452C12.587 11.6638 12.5359 11.5902 12.4719 11.5288L8.94325 8.00013L12.4719 4.47148C12.5682 4.37784 12.634 4.25728 12.6607 4.1256C12.6873 3.99392 12.6735 3.85726 12.6212 3.73354C12.5688 3.60982 12.4803 3.5048 12.3672 3.43224C12.2542 3.35969 12.1218 3.32299 11.9875 3.32695C11.8143 3.33211 11.6499 3.4045 11.5292 3.52877L8.00054 7.05742L4.4719 3.52877C4.40977 3.46491 4.33548 3.41415 4.2534 3.37948C4.17132 3.34482 4.08313 3.32696 3.99403 3.32695Z"})),_e=n({}),Ge=({children:e,defaultParams:t})=>o.createElement(_e.Provider,{value:{defaultParams:t}},e),Qe=e=>{const{data:{userInfo:t,env:{togetherBasePath:a}}}=i(N),{defaultParams:o}=i(_e)||{},n=null==t?void 0:t.id,l=t&&"number"==typeof t.communities_interacted&&0===t.communities_interacted;return{authActionWrapper:(t,i)=>{const r=Object.assign(Object.assign(Object.assign({},o),e),i);if(!n||l){n||Fe(A),(null==r?void 0:r._joinCommunityIds)&&(localStorage.setItem("to_join_community_ids",JSON.stringify(Array.from(new Set((JSON.parse(localStorage.getItem("to_join_community_ids")||"[]")||[]).concat(r._joinCommunityIds).filter(Boolean))))),null==r||delete r._joinCommunityIds),(null==r?void 0:r._joinTopicIds)&&(localStorage.setItem("to_join_topic_ids",JSON.stringify(Array.from(new Set((JSON.parse(localStorage.getItem("to_join_topic_ids")||"[]")||[]).concat(r._joinTopicIds).filter(Boolean))))),null==r||delete r._joinTopicIds);const e=(null==r?void 0:r._location)||window.location.href;return null==r||delete r._location,window.location.href=T(e,r,a),null}return t&&t()},params:Object.assign(Object.assign({},o),e)}},Xe=pe.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
justify-content: center;
|
|
@@ -6,7 +6,7 @@ import{a as e,_ as t}from"./tslib.es6-01eae420.js";import*as a from"react";impor
|
|
|
6
6
|
button {
|
|
7
7
|
position: relative;
|
|
8
8
|
}
|
|
9
|
-
`,
|
|
9
|
+
`,Ke=ue`
|
|
10
10
|
0% {
|
|
11
11
|
transform: rotate(0deg);
|
|
12
12
|
}
|
|
@@ -29,12 +29,12 @@ import{a as e,_ as t}from"./tslib.es6-01eae420.js";import*as a from"react";impor
|
|
|
29
29
|
width: 24px;
|
|
30
30
|
height: 24px;
|
|
31
31
|
margin-bottom: 0.5rem;
|
|
32
|
-
animation: ${
|
|
32
|
+
animation: ${Ke} 1.2s linear infinite;
|
|
33
33
|
}
|
|
34
34
|
&[data-is-marrybaby='true'] {
|
|
35
35
|
box-shadow: none;
|
|
36
36
|
}
|
|
37
|
-
`;const $e=({className:e,size:t="md"})=>{const{t:a}=E();return o.createElement(
|
|
37
|
+
`;const $e=({className:e,size:t="md"})=>{const{t:a}=E();return o.createElement(Xe,{className:e},o.createElement(Be,{size:t,color:"transparent",isLoading:!0},a("loading")))},Ye=pe.div`
|
|
38
38
|
.link-info-container {
|
|
39
39
|
padding: 0.5rem 1rem;
|
|
40
40
|
background: ${e=>e.color||"#f4faff"};
|
|
@@ -726,7 +726,7 @@ import{a as e,_ as t}from"./tslib.es6-01eae420.js";import*as a from"react";impor
|
|
|
726
726
|
&[data-open='false'] {
|
|
727
727
|
display: none;
|
|
728
728
|
}
|
|
729
|
-
`,
|
|
729
|
+
`,Xt=pe.div`
|
|
730
730
|
.image-container {
|
|
731
731
|
.badge-avatar {
|
|
732
732
|
position: absolute;
|
|
@@ -751,7 +751,7 @@ import{a as e,_ as t}from"./tslib.es6-01eae420.js";import*as a from"react";impor
|
|
|
751
751
|
width: 24px;
|
|
752
752
|
height: 24px;
|
|
753
753
|
}
|
|
754
|
-
`,
|
|
754
|
+
`,Kt=pe.div`
|
|
755
755
|
position: relative;
|
|
756
756
|
z-index: 9;
|
|
757
757
|
.specialty {
|
|
@@ -801,7 +801,7 @@ import{a as e,_ as t}from"./tslib.es6-01eae420.js";import*as a from"react";impor
|
|
|
801
801
|
width: 24px;
|
|
802
802
|
height: 24px;
|
|
803
803
|
}
|
|
804
|
-
`;var Yt="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3e%3cpath fill='%2345A4FF' d='M12 24c6.627 0 12-5.373 12-12S18.627 0 12 0 0 5.373 0 12s5.373 12 12 12Z'/%3e%3cpath fill='%232D87F3' d='M24 12a12.1 12.1 0 0 0-.128-1.758l-5.077-5.077L5.041 18.958l4.858 4.858c.682.12 1.384.184 2.1.184 6.628 0 12-5.373 12-12Z'/%3e%3cpath fill='white' d='M9.014 17.824 5.04 18.959l1.135-3.973 2.368.47.47 2.368Z'/%3e%3cpath fill='%23F7F9FC' d='M8.544 15.456 5.041 18.96l3.972-1.135-.469-2.368Z'/%3e%3cpath fill='%23E4E8EC' d='M6.467 18.552 5.45 17.533 5.04 18.96l1.426-.407Z'/%3e%3cpath fill='%23D2D6DC' d='m5.957 18.043-.916.916 1.426-.407-.51-.509Z'/%3e%3cpath fill='%23FFD658' d='m15.828 5.331 2.837 2.837-9.651 9.652-2.838-2.837 9.652-9.652Z'/%3e%3cpath fill='%23FFC326' d='m7.594 16.404 9.651-9.651 1.419 1.418-9.652 9.652-1.418-1.419Z'/%3e%3cpath fill='%23FF5331' d='m18.312 8.525-2.837-2.838 1.123-1.123c.44-.44 1.154-.44 1.595 0l1.243 1.243c.44.44.44 1.154 0 1.594l-1.124 1.124Z'/%3e%3cpath fill='%23F44D2C' d='m18.816 5.186-1.921 1.92 1.418 1.419 1.124-1.124c.44-.44.44-1.154 0-1.594l-.622-.621Z'/%3e%3c/svg%3e";const Jt={author:Yt,edtior:Yt,expert:"data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='12' cy='12' r='12' fill='%23FFCB37'/%3e%3ccircle cx='12' cy='12' r='10.5' fill='%23FE921D'/%3e%3cpath d='M11.443 5.13654C11.6446 4.63466 12.355 4.63466 12.5566 5.13654L13.9931 8.71375C14.0789 8.92747 14.2795 9.0732 14.5093 9.08878L18.3553 9.34957C18.8949 9.38615 19.1145 10.0619 18.6994 10.4086L15.7412 12.8802C15.5645 13.0279 15.4878 13.2637 15.544 13.4871L16.4845 17.2254C16.6164 17.7499 16.0417 18.1676 15.5836 17.88L12.3188 15.8303C12.1238 15.7079 11.8758 15.7079 11.6808 15.8303L8.41599 17.88C7.95794 18.1676 7.38314 17.7499 7.51509 17.2254L8.45556 13.4871C8.51175 13.2637 8.43513 13.0279 8.25839 12.8802L5.30017 10.4086C4.88514 10.0619 5.10469 9.38615 5.64429 9.34957L9.49031 9.08878C9.7201 9.0732 9.92068 8.92747 10.0065 8.71375L11.443 5.13654Z' fill='white'/%3e%3c/svg%3e","fact-check":"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 16C12.4183 16 16 12.4183 16 8C16 3.58172 12.4183 0 8 0C3.58172 0 0 3.58172 0 8C0 12.4183 3.58172 16 8 16Z' fill='%2300C076'/%3e%3cpath d='M11.9456 5.46631L6.66562 10.2663L4.26562 8.08449' stroke='white' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",medical:qt},ea=({trackingCategory:e="Together",locale:t,isOpen:a=!0,onClose:n,enableAnimation:i=!0,expertId:r,overwriteProfileProps:c,avatarFallback:d=se.getAssetPath("avatar.jpg")})=>{const{t:m}=E(),[p,u]=l(null),[g,v]=l(!1);return s((()=>{if(a&&r&&String(null==p?void 0:p.user_id)!==String(r)){v(!0);try{u(null),z(W(H.GET_EXPERT_BY_ID,{id:r}),"get").then((e=>{u(Object.assign(Object.assign({},null==e?void 0:e.data),c))}))}catch(e){console.error(e)}v(!1)}}),[a,r,null==p?void 0:p.user_id]),o.createElement(o.Fragment,null,o.createElement(Gt,{"data-open":a,"data-animation":i,onClick:e=>e.stopPropagation()},g||!p?o.createElement($e,null):o.createElement("div",{className:"popup-content"},o.createElement("div",{className:"close-button",onClick:n},o.createElement("img",{src:Zt,style:{width:20,height:20},alt:"close-icon",loading:"lazy"})),o.createElement("div",{className:"main-info"},o.createElement("div",{className:"border-banner"}),o.createElement("div",{className:"avatar-title"},o.createElement(
|
|
804
|
+
`;var Yt="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3e%3cpath fill='%2345A4FF' d='M12 24c6.627 0 12-5.373 12-12S18.627 0 12 0 0 5.373 0 12s5.373 12 12 12Z'/%3e%3cpath fill='%232D87F3' d='M24 12a12.1 12.1 0 0 0-.128-1.758l-5.077-5.077L5.041 18.958l4.858 4.858c.682.12 1.384.184 2.1.184 6.628 0 12-5.373 12-12Z'/%3e%3cpath fill='white' d='M9.014 17.824 5.04 18.959l1.135-3.973 2.368.47.47 2.368Z'/%3e%3cpath fill='%23F7F9FC' d='M8.544 15.456 5.041 18.96l3.972-1.135-.469-2.368Z'/%3e%3cpath fill='%23E4E8EC' d='M6.467 18.552 5.45 17.533 5.04 18.96l1.426-.407Z'/%3e%3cpath fill='%23D2D6DC' d='m5.957 18.043-.916.916 1.426-.407-.51-.509Z'/%3e%3cpath fill='%23FFD658' d='m15.828 5.331 2.837 2.837-9.651 9.652-2.838-2.837 9.652-9.652Z'/%3e%3cpath fill='%23FFC326' d='m7.594 16.404 9.651-9.651 1.419 1.418-9.652 9.652-1.418-1.419Z'/%3e%3cpath fill='%23FF5331' d='m18.312 8.525-2.837-2.838 1.123-1.123c.44-.44 1.154-.44 1.595 0l1.243 1.243c.44.44.44 1.154 0 1.594l-1.124 1.124Z'/%3e%3cpath fill='%23F44D2C' d='m18.816 5.186-1.921 1.92 1.418 1.419 1.124-1.124c.44-.44.44-1.154 0-1.594l-.622-.621Z'/%3e%3c/svg%3e";const Jt={author:Yt,edtior:Yt,expert:"data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='12' cy='12' r='12' fill='%23FFCB37'/%3e%3ccircle cx='12' cy='12' r='10.5' fill='%23FE921D'/%3e%3cpath d='M11.443 5.13654C11.6446 4.63466 12.355 4.63466 12.5566 5.13654L13.9931 8.71375C14.0789 8.92747 14.2795 9.0732 14.5093 9.08878L18.3553 9.34957C18.8949 9.38615 19.1145 10.0619 18.6994 10.4086L15.7412 12.8802C15.5645 13.0279 15.4878 13.2637 15.544 13.4871L16.4845 17.2254C16.6164 17.7499 16.0417 18.1676 15.5836 17.88L12.3188 15.8303C12.1238 15.7079 11.8758 15.7079 11.6808 15.8303L8.41599 17.88C7.95794 18.1676 7.38314 17.7499 7.51509 17.2254L8.45556 13.4871C8.51175 13.2637 8.43513 13.0279 8.25839 12.8802L5.30017 10.4086C4.88514 10.0619 5.10469 9.38615 5.64429 9.34957L9.49031 9.08878C9.7201 9.0732 9.92068 8.92747 10.0065 8.71375L11.443 5.13654Z' fill='white'/%3e%3c/svg%3e","fact-check":"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 16C12.4183 16 16 12.4183 16 8C16 3.58172 12.4183 0 8 0C3.58172 0 0 3.58172 0 8C0 12.4183 3.58172 16 8 16Z' fill='%2300C076'/%3e%3cpath d='M11.9456 5.46631L6.66562 10.2663L4.26562 8.08449' stroke='white' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",medical:qt},ea=({trackingCategory:e="Together",locale:t,isOpen:a=!0,onClose:n,enableAnimation:i=!0,expertId:r,overwriteProfileProps:c,avatarFallback:d=se.getAssetPath("avatar.jpg")})=>{const{t:m}=E(),[p,u]=l(null),[g,v]=l(!1);return s((()=>{if(a&&r&&String(null==p?void 0:p.user_id)!==String(r)){v(!0);try{u(null),z(W(H.GET_EXPERT_BY_ID,{id:r}),"get").then((e=>{u(Object.assign(Object.assign({},null==e?void 0:e.data),c))}))}catch(e){console.error(e)}v(!1)}}),[a,r,null==p?void 0:p.user_id]),o.createElement(o.Fragment,null,o.createElement(Gt,{"data-open":a,"data-animation":i,onClick:e=>e.stopPropagation()},g||!p?o.createElement($e,null):o.createElement("div",{className:"popup-content"},o.createElement("div",{className:"close-button",onClick:n},o.createElement("img",{src:Zt,style:{width:20,height:20},alt:"close-icon",loading:"lazy"})),o.createElement("div",{className:"main-info"},o.createElement("div",{className:"border-banner"}),o.createElement("div",{className:"avatar-title"},o.createElement(Xt,null,o.createElement("div",{className:"image-container"},o.createElement("div",{style:{position:"relative"}},o.createElement(ye,{src:null==p?void 0:p.avatar,className:"profile-image",alt:"avatar",backupSrc:d}),o.createElement("img",{className:"badge-avatar",src:Jt[null==p?void 0:p.role],alt:"badge",loading:"lazy"})))),o.createElement(Kt,null,o.createElement(Se,{size:"s3",className:"full-name",type:"semiBold"},null==p?void 0:p.display_name),o.createElement("div",null,o.createElement(Se,{size:"p4",color:k.colors.gray800},null==p?void 0:p.specialty," • "),o.createElement("a",{href:null==p?void 0:p.organisation_url,className:"organisation",target:"_blank",rel:"noreferrer"},o.createElement(Se,{size:"p4",className:"organisation",color:k.colors.gray800,style:{textDecoration:"underline"}},null==p?void 0:p.organisation)))))),o.createElement(Kt,null,o.createElement("div",{className:"experience"},o.createElement(Se,{type:"bold",size:"p4",color:k.colors.gray800,style:{paddingBottom:16}},m("expert.content.description").toUpperCase()),o.createElement("div",{className:"list-items"},!!(null==p?void 0:p.experiences)&&p.experiences.filter((e=>!(!e||!e.title&&!e.organization))).slice(0,3).map(((e,t)=>o.createElement($t,{key:t},o.createElement("img",{className:"bullet-point",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%3ccircle cx='12' cy='12' r='2' fill='%232D87F3'/%3e%3c/svg%3e",alt:"point",loading:"lazy"}),o.createElement("div",{className:"text-contain"},o.createElement(L,{tag:"h6",color:k.colors.gray800},null==e?void 0:e.title),o.createElement(Se,{size:"p2",color:k.colors.gray500},null==e?void 0:e.organization)))))),o.createElement("a",{href:null==p?void 0:p.profile_url,style:{display:"inline-block",paddingTop:24}},o.createElement(Se,{as:"span",size:"s4",color:"#2D87F3","data-event-category":e,"data-event-action":"See Full Doctor Profile","data-event-label":B(t)+(null==p?void 0:p.profile_url)},m("home.seeExpert"))))))),o.createElement(Qt,{"data-open":a,onClick:e=>{e.stopPropagation(),n()}}))},ta=pe.div`
|
|
805
805
|
position: fixed;
|
|
806
806
|
left: 50%;
|
|
807
807
|
width: 343px;
|
|
@@ -959,7 +959,7 @@ import{a as e,_ as t}from"./tslib.es6-01eae420.js";import*as a from"react";impor
|
|
|
959
959
|
width: 24px;
|
|
960
960
|
height: 24px;
|
|
961
961
|
}
|
|
962
|
-
`;const ia=({isOpen:e=!0,onClose:t,enableAnimation:a=!0,hospitalId:n,locale:i,isMobile:r,overwriteProfileProps:d,avatarFallback:m=se.getAssetPath("avatar.jpg"),trackingCategory:p="Together"})=>{const{t:u}=E(),[g,v]=l(null),[h,b]=l(!1);s((()=>{if(e&&n&&String(null==g?void 0:g.id)!==String(n)){b(!0);try{v(null),z(O(R.GET_HOSPITAL_INFO,{hospital_branch_id:n,website_url:V[i]}),"get").then((e=>{v(Object.assign(Object.assign({},null==e?void 0:e._data.branch),d))}))}catch(e){console.error(e)}b(!1)}}),[e,n,null==g?void 0:g.id]);const f=(null==g?void 0:g.specialties)||[],y=c((()=>f.map((e=>e.name))),[f]);return o.createElement(o.Fragment,null,o.createElement(ta,{"data-open":e,"data-animation":a,onClick:e=>e.stopPropagation()},h||!g?o.createElement($e,null):o.createElement("div",{className:"popup-content"},o.createElement("div",{className:"close-button",onClick:t},o.createElement("img",{src:Zt,style:{width:20,height:20},alt:"close-icon",loading:"lazy"})),o.createElement("div",{className:"main-info"},o.createElement("div",{className:"border-banner"}),o.createElement("div",{className:"avatar-title"},o.createElement(oa,null,o.createElement("div",{className:"image-container"},o.createElement("div",{style:{position:"relative"}},o.createElement(ye,{src:null==g?void 0:g.logo,className:"profile-image",alt:"avatar",backupSrc:m}),o.createElement("img",{className:"badge-avatar",src:qt,alt:"badge",loading:"lazy"})))),o.createElement(na,null,o.createElement(Se,{size:"s3",type:"semiBold",className:"full-name"},null==g?void 0:g.name),o.createElement("div",{className:"specialty"},f&&o.createElement(Se,{size:"p4",color:k.colors.gray800},y.join(" • "),"•"),o.createElement("a",{href:D({id:g.id,name:g.name,slug:g.slug,locale:i}),className:"organisation",target:"_blank",rel:"noreferrer"},o.createElement(Se,{size:"p4",className:"organisation",color:k.colors.gray800,style:{textDecoration:"underline"}},null==g?void 0:g.name))))),!r&&o.createElement("a",{href:D({id:g.id,name:g.name,slug:g.slug,locale:i})},o.createElement("div",{className:"btn-wrapper"},o.createElement(Be,{color:"primary",size:"md",className:"btn-booking"},u("careBooking.bookAnAppointment"))))),o.createElement(na,null,o.createElement("div",{className:"experience"},o.createElement(Se,{type:"bold",size:"s3",color:k.colors.gray800,style:{paddingBottom:16}},u("hospital.content.description").toUpperCase()),o.createElement(Se,{size:"p2",color:k.colors.gray500},g.about),r?o.createElement("a",{href:D({id:g.id,name:g.name,slug:g.slug,locale:i})},o.createElement("div",{className:"btn-wrapper"},o.createElement(Be,{color:"primary",size:"md",className:"btn-booking"},u("careBooking.bookAnAppointment")))):o.createElement("a",{href:D({id:g.id,name:g.name,slug:g.slug,locale:i})},o.createElement(Se,{size:"s4",color:"#2D87F3",as:"span","data-event-category":p,"data-event-action":"See Full Hospital Profile","data-event-label":B(i)+D({id:g.id,name:g.name,slug:g.slug,locale:i})},u("home.seeHospital"))))))),o.createElement(aa,{"data-open":e,onClick:e=>{e.stopPropagation(),t()}}))};var la="_2UKyiK1",ra="E5ga-tI",sa="_8Y2nWXX",ca="d0T7kSP";const da=({open:e,onClose:t,children:a,profileModalProps:n})=>{const{t:i}=E();return o.createElement(We,Object.assign({className:la,opened:e,onClose:t,overlayOpacity:.2,overflow:"inside",styles:{inner:{padding:0,justifyContent:"flex-end"},modal:{height:"100%",borderRadius:0},body:{padding:"24px",maxHeight:"100%"},content:{maxHeight:"100%",height:"100%",borderRadius:0}},title:"Profile"},n),o.createElement("div",{className:ra},o.createElement("div",{className:sa},i("profilePanel.modal.heading")),o.createElement("div",{className:ca,onClick:t},o.createElement(qe,null))),a)};me.extend(Ue);const ma=n({}),pa=e=>{const{className:t="",community:a,name:n,username:r,url:c,avatar:d,role:m,title:p,userType:h="user",expertId:b,specialty:f,organisation:y,isMarryBaby:w,doctorId:x,hospitalId:C,hasQuickBooking:A,handleMakeAppointment:T,communityTrackingAttr:z,isAnonymous:P,showDetailPopup:I,subLine:S,authActionWrapper:L,profileProps:M,profileModalProps:j,extendEle:B,avatarProps:F,hideInfo:O,timeText:R,onCloseFromPost:V,avatarIcon:D,badgeIconSize:U,hideBackground:W,children:H,styles:q,dataEventCategory:_,dataEventAction:G,dataEventLabel:Q}=e,{data:{locale:
|
|
962
|
+
`;const ia=({isOpen:e=!0,onClose:t,enableAnimation:a=!0,hospitalId:n,locale:i,isMobile:r,overwriteProfileProps:d,avatarFallback:m=se.getAssetPath("avatar.jpg"),trackingCategory:p="Together"})=>{const{t:u}=E(),[g,v]=l(null),[h,b]=l(!1);s((()=>{if(e&&n&&String(null==g?void 0:g.id)!==String(n)){b(!0);try{v(null),z(O(R.GET_HOSPITAL_INFO,{hospital_branch_id:n,website_url:V[i]}),"get").then((e=>{v(Object.assign(Object.assign({},null==e?void 0:e._data.branch),d))}))}catch(e){console.error(e)}b(!1)}}),[e,n,null==g?void 0:g.id]);const f=(null==g?void 0:g.specialties)||[],y=c((()=>f.map((e=>e.name))),[f]);return o.createElement(o.Fragment,null,o.createElement(ta,{"data-open":e,"data-animation":a,onClick:e=>e.stopPropagation()},h||!g?o.createElement($e,null):o.createElement("div",{className:"popup-content"},o.createElement("div",{className:"close-button",onClick:t},o.createElement("img",{src:Zt,style:{width:20,height:20},alt:"close-icon",loading:"lazy"})),o.createElement("div",{className:"main-info"},o.createElement("div",{className:"border-banner"}),o.createElement("div",{className:"avatar-title"},o.createElement(oa,null,o.createElement("div",{className:"image-container"},o.createElement("div",{style:{position:"relative"}},o.createElement(ye,{src:null==g?void 0:g.logo,className:"profile-image",alt:"avatar",backupSrc:m}),o.createElement("img",{className:"badge-avatar",src:qt,alt:"badge",loading:"lazy"})))),o.createElement(na,null,o.createElement(Se,{size:"s3",type:"semiBold",className:"full-name"},null==g?void 0:g.name),o.createElement("div",{className:"specialty"},f&&o.createElement(Se,{size:"p4",color:k.colors.gray800},y.join(" • "),"•"),o.createElement("a",{href:D({id:g.id,name:g.name,slug:g.slug,locale:i}),className:"organisation",target:"_blank",rel:"noreferrer"},o.createElement(Se,{size:"p4",className:"organisation",color:k.colors.gray800,style:{textDecoration:"underline"}},null==g?void 0:g.name))))),!r&&o.createElement("a",{href:D({id:g.id,name:g.name,slug:g.slug,locale:i})},o.createElement("div",{className:"btn-wrapper"},o.createElement(Be,{color:"primary",size:"md",className:"btn-booking"},u("careBooking.bookAnAppointment"))))),o.createElement(na,null,o.createElement("div",{className:"experience"},o.createElement(Se,{type:"bold",size:"s3",color:k.colors.gray800,style:{paddingBottom:16}},u("hospital.content.description").toUpperCase()),o.createElement(Se,{size:"p2",color:k.colors.gray500},g.about),r?o.createElement("a",{href:D({id:g.id,name:g.name,slug:g.slug,locale:i})},o.createElement("div",{className:"btn-wrapper"},o.createElement(Be,{color:"primary",size:"md",className:"btn-booking"},u("careBooking.bookAnAppointment")))):o.createElement("a",{href:D({id:g.id,name:g.name,slug:g.slug,locale:i})},o.createElement(Se,{size:"s4",color:"#2D87F3",as:"span","data-event-category":p,"data-event-action":"See Full Hospital Profile","data-event-label":B(i)+D({id:g.id,name:g.name,slug:g.slug,locale:i})},u("home.seeHospital"))))))),o.createElement(aa,{"data-open":e,onClick:e=>{e.stopPropagation(),t()}}))};var la="_2UKyiK1",ra="E5ga-tI",sa="_8Y2nWXX",ca="d0T7kSP";const da=({open:e,onClose:t,children:a,profileModalProps:n})=>{const{t:i}=E();return o.createElement(We,Object.assign({className:la,opened:e,onClose:t,overlayOpacity:.2,overflow:"inside",styles:{inner:{padding:0,justifyContent:"flex-end"},modal:{height:"100%",borderRadius:0},body:{padding:"24px",maxHeight:"100%"},content:{maxHeight:"100%",height:"100%",borderRadius:0}},title:"Profile"},n),o.createElement("div",{className:ra},o.createElement("div",{className:sa},i("profilePanel.modal.heading")),o.createElement("div",{className:ca,onClick:t},o.createElement(qe,null))),a)};me.extend(Ue);const ma=n({}),pa=e=>{const{className:t="",community:a,name:n,username:r,url:c,avatar:d,role:m,title:p,userType:h="user",expertId:b,specialty:f,organisation:y,isMarryBaby:w,doctorId:x,hospitalId:C,hasQuickBooking:A,handleMakeAppointment:T,communityTrackingAttr:z,isAnonymous:P,showDetailPopup:I,subLine:S,authActionWrapper:L,profileProps:M,profileModalProps:j,extendEle:B,avatarProps:F,hideInfo:O,timeText:R,onCloseFromPost:V,avatarIcon:D,badgeIconSize:U,hideBackground:W,children:H,styles:q,dataEventCategory:_,dataEventAction:G,dataEventLabel:Q}=e,{data:{locale:X,router:K,env:{isMarryBaby:$,togetherBasePath:Y}}}=i(N),{isMobile:J}=Z(),{t:ee}=E(),{classes:te}=Rt(void 0,{name:"CardAuthor",styles:q}),ae="boolean"==typeof w?w:$,oe=ae?"marryBaby":"helloSites",ne=P?ee("cardPost.anonymous"):n||r||"",ie=P?se.getAssetPath("avatar.jpg"):d,le=P?void 0:m,[re,ce]=l(!1),{asPath:me}=K||{},pe=`https://${de[X]}${me}`,ue=()=>{if(P||"chatbot"===h)return!1;I?ve(!0):c&&(window.location.href=c)};s((()=>{he(re)}),[re]);const[ge,ve]=l(!1),be="expert"===(null==e?void 0:e.role),fe=Boolean(x||C),ye=["expert"===le&&y&&o.createElement("span",null,y),"expert"===le&&f&&o.createElement("span",null,f),!("expert"===le&&f&&y)&&(null==a?void 0:a.name)&&o.createElement("a",Object.assign({href:(null==a?void 0:a.slug)&&a.isActive&&!a.isHidden?`${Y}/${null==a?void 0:a.slug}`:void 0,className:"author-community-name"},z),`${null==a?void 0:a.name}`),R&&o.createElement("span",null,R)].filter(Boolean),[Ee,Ce]=l(null);return s((()=>{ge&&!Ee&&Promise.resolve().then((function(){return Wn})).then((e=>{Ce((()=>e.ProfileDetail))}))}),[ge]),o.createElement(ma.Provider,{value:{handleMakeAppointment:T,doctorId:x,hospitalId:C,currentUrl:pe}},o.createElement(da,{open:ge,onClose:()=>ve(!1),profileModalProps:j},Ee&&o.createElement(Ee,Object.assign({currentPageUrl:Q,authActionWrapper:L,onCloseFromPost:()=>{ve(!1),null==V||V()}},M,{authorProps:Object.assign({userId:null==e?void 0:e.userId,avatar:ie,name:null==e?void 0:e.name,role:null==e?void 0:e.role,title:null==e?void 0:e.title,doctorId:x,hospitalId:C,hasQuickBooking:A},null==M?void 0:M.authorProps)}))),"expert"===le&&b?o.createElement(ea,{isOpen:re,onClose:()=>ce(!1),expertId:b}):null,"expert"===le&&x?o.createElement(_t,{isOpen:re,onClose:()=>ce(!1),doctorId:x,locale:X}):null,"expert"===le&&C?o.createElement(ia,{isOpen:re,onClose:()=>ce(!1),hospitalId:C,locale:X}):null,o.createElement("div",{className:`hhg-card-author ${te.root} ${t} ${be?"expert-author":""}`,"data-background":!W&&be,"data-is-marrybaby":ae},o.createElement(Ot,{dataEventCategory:_,dataEventAction:G,dataEventLabel:Q,onAvatarClick:ue,avatarProps:Object.assign(Object.assign({avatar:P?se.getAssetPath(ae?"anomyous-avatar-1.svg":"anomyous-avatar.svg"):ie,username:ne},F),{style:{cursor:P||!c&&!I?"default":"pointer"}}),avatarIcon:D||be&&o.createElement(kt,{size:U||15})},H?o.createElement("div",{onClick:ue},H):!O&&o.createElement(Ot.Row,null,o.createElement(Ot.ColLeft,null,o.createElement(u,{align:"center",onClick:ue},o.createElement(Ot.MainText,{onClick:ue},ne,"chatbot"===h?o.createElement(o.Fragment,null," ",o.createElement(Nt,{color:k.colors.primaryBase,size:16,style:{display:"inline-block",transform:"translate(0, 2px)"}})):le&&o.createElement(we,{className:te.authorBadge,siteType:oe,role:le,title:p,style:{verticalAlign:"bottom"}}))),S||o.createElement(Ot.SubTextRow,{style:A?{position:"relative"}:{}},ye.map(((e,t)=>o.createElement(o.Fragment,null,0!==t&&o.createElement(Ot.SubDivider,null),o.createElement(Ot.SubText,null,e)))),A&&fe&&o.createElement(g,{sx:{marginTop:v(5)}},o.createElement(xe,{bookingId:x||C,bookingType:x?"doctor":C?"hospital":void 0,size:J?"xs":"sm"})))))),B&&B))};pa.MainText=Ot.MainText,pa.SubText=Ot.SubText,pa.SubTextRow=Ot.SubTextRow,pa.SubDivider=Ot.SubDivider;const ua=e=>({message:e("notification.failure"),type:"danger"}),ga=pe.div`
|
|
963
963
|
position: relative;
|
|
964
964
|
display: flex;
|
|
965
965
|
height: 100%;
|
|
@@ -1411,7 +1411,7 @@ import{a as e,_ as t}from"./tslib.es6-01eae420.js";import*as a from"react";impor
|
|
|
1411
1411
|
}
|
|
1412
1412
|
}
|
|
1413
1413
|
}
|
|
1414
|
-
`;let Ha=null;function Za(e){var t,a;let o=-1;if(void 0!==window.getSelection){const n=window.getSelection();if((null==n?void 0:n.rangeCount)&&(null==n?void 0:n.rangeCount)>0){const n=null===(t=window.getSelection())||void 0===t?void 0:t.getRangeAt(0);if(n){const t=n.cloneRange();t.selectNodeContents(e),t.setEnd(n.endContainer,n.endOffset),o=qa(t.cloneContents().childNodes,o);const i=null===(a=n.endContainer.parentElement)||void 0===a?void 0:a.closest("mocka"),l=n.endContainer.nodeValue||n.endContainer.outerHTML;i&&(null==l?void 0:l.length)&&(o=o-n.endOffset+(i.outerHTML.length-(null==i?void 0:i.outerHTML.lastIndexOf(l))))}}}return o}function qa(e,t){return e.forEach(((a,o)=>{const n=o+1===e.length;if(a.nodeType===Node.ELEMENT_NODE){const e=a.outerHTML;if(!n)return void(t+=e.length);t+=e.indexOf(">")+1,t=qa(a.childNodes,t)}else a.nodeType===Node.TEXT_NODE&&(t+=(a.nodeValue||"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").length)})),t}e(void 0,void 0,void 0,(function*(){if("undefined"==typeof window)return;const e=yield import("react-quill");Ha=e.default;const t=e.Quill||Ha.Quill;t.register("modules/preserveWhiteSpace",class{constructor(e,t){this.quill=e,this.options=t,e.container.style.whiteSpace="pre-line"}});const a=t.import("blots/inline");class o extends a{static create(e){if(!e)return super.create(!1);const t=super.create(e);return o.setNodeConfigurations(t,e),t}static formats(e){return!(!e.innerText||!(e.getAttribute("data-href")||e.getAttribute("data-url")||e.getAttribute("data-error")||e.getAttribute("data-bad-word")))&&{"data-bad-word":e.getAttribute("data-bad-word"),"data-error":e.getAttribute("data-error"),"data-href":e.getAttribute("data-href"),"data-url":e.getAttribute("data-url"),"data-text":e.innerText||e.getAttribute("data-href")}}static setNodeConfigurations(e,t){var a,o;t&&(null===(o=null===(a=null==t?void 0:t["data-text"])||void 0===a?void 0:a.replace(/(\ )+/g," "))||void 0===o?void 0:o.replace(/(\u200c|‌)+/g,""))&&(t["data-bad-word"]&&e.setAttribute("data-bad-word",t["data-bad-word"]),t["data-href"]&&e.setAttribute("data-href",t["data-href"]),t["data-error"]&&e.setAttribute("data-error",t["data-error"]),t["data-url"]&&e.setAttribute("data-url",t["data-url"]))}}o.blotName="mocka1",o.tagName="mocka",t.register(o);class n extends a{static create(e){if(!e)return super.create(!1);const t=super.create(e);return n.setNodeConfigurations(t,e),t}static formats(e){return!(!e.getAttribute("data-name")||!e.getAttribute("data-id"))&&{"data-name":e.getAttribute("data-name"),"data-id":e.getAttribute("data-id")}}static setNodeConfigurations(e,t){var a,o;t&&t["data-id"]&&(null===(o=null===(a=null==t?void 0:t["data-name"])||void 0===a?void 0:a.replace(/(\ )+/g," "))||void 0===o?void 0:o.replace(/(\u200c|‌)+/g,""))&&(t["data-id"]&&e.setAttribute("data-id",t["data-id"]),t["data-name"]&&e.setAttribute("data-name",t["data-name"]))}}n.blotName="mention",n.tagName="mention",t.register(n)}));const _a=(e,t)=>{var a;const{formatUrl:o,bannedWords:n=[]}=t||{},i=e.replace(/<font [^\>]*>(.+)<\/font>/gim,((e,t)=>t.replace(/<u[^\>]*>(.+)<\/u>/gim,"$1"))).replace(Ea,((e,t,a,o)=>{if(o!==a){const e=a.split(" "),n=e.findIndex(((t,a)=>{const n=e.slice(0,a+1).join(" ");return!o.startsWith(n)}));if(0===n)return`@${o}`;{const a=(n<0?e:e.slice(0,n)).join(" "),i=o.slice(a.length).trim();return console.log(n,a,i),`<mention data-id="${t}" data-name="${a}">${a}</mention> ${i} `}}return e}));if(!o)return{value:Ra(i,n)};let l=(e=>e.replace(Ta,((e,t)=>{const a=document.createElement("div");a.innerHTML=e;const o=a.firstChild;return(null==o?void 0:o.innerText)!==(null==o?void 0:o.getAttribute("data-bad-word"))?t:e})))((e=>{var t,a;return null===(a=null===(t=e.replace(/(\ )+/g," "))||void 0===t?void 0:t.replace(/(\u200c|‌)+/g,""))||void 0===a?void 0:a.replace(fa,((e,t,a)=>{var o;const n=null===(o=t.match(/data-href="([^"]*)"/im))||void 0===o?void 0:o[1];return!n||n===a||a.match(ka)?a:n?`<a href="${n}">${a}</a>`:`<a href="${a}">${a}</a>`})).replace(ya,((e,t,a)=>{if('="'!==t&&'data-url="true">'!==t){const e=a.toLowerCase(),t=`${e.startsWith("http")?"":" https://"}${e}`;return za({text:t,url:t,method:"edit"})}return e})).replace(Aa,((e,t,a)=>za({text:a||t,url:t,method:"edit"})))})(i));const r=(e=>{var t;return[...Sa(e),...(null===(t=e.match(fa))||void 0===t?void 0:t.map((e=>{var t,a;const o=null===(t=e.match(/data-href="([^"]*)"/im))||void 0===t?void 0:t[1],n=null===(a=e.match(/>(.*?)<\/mocka>/im))||void 0===a?void 0:a[1];return o||n})))||[]].filter((e=>!!e))})(i);if(r){const e=[];let t="";return r.forEach((t=>{if(t)try{const a=new URL(t);Fa.some((e=>a.origin.endsWith(e)))||e.push(t)}catch(a){e.push(t)}})),e.length>0&&(l=l.replace(new RegExp(`data-url="true">(${e.map(Ma).join("|")})<`,"gi"),'data-error="true" data-url="true">$1<').replace(new RegExp(`data-href="(${e.map(Ma).join("|")})" data-url="true">`,"gi"),'data-href="$1" data-error="true" data-url="true">')),t=null===(a=r.filter((t=>-1===e.indexOf(t))))||void 0===a?void 0:a[0],{invalidUrls:e,previewUrl:t,value:Ra(l,n)}}return{value:Ra(l,n)}},Ga=({html:t,onChange:a,className:n,style:c,onImagePickerClick:m,bannedWords:p=[],onInvalidUrlsChange:u,onPreviewUrlChange:g,setEditorRef:v,isReplying:h})=>{var b,f,y,w;const x=r([]);x.current=p;const[E,C]=l([]),[k,T]=l(null),{data:{locale:S}}=i(N),L=(null==p?void 0:p.join(","))||"";s((()=>{var e,t;const a=null===(t=null===(e=D.current)||void 0===e?void 0:e.getEditor())||void 0===t?void 0:t.root.innerHTML;B(a)}),[L]);const M=e=>{k&&k.url===e||(T({url:e,isFetching:!0}),z(P(I.FETCH_PREVIEW,{_locale:S}),"POST",{data:{link:e}}).then((t=>{var a,o,n,i;T({title:null===(a=null==t?void 0:t.data)||void 0===a?void 0:a.title,description:null===(o=null==t?void 0:t.data)||void 0===o?void 0:o.description,image:(null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.image)||(null===(i=null==t?void 0:t.data)||void 0===i?void 0:i.logo),url:e})})).catch((()=>{T(null)})))},j=r(M);j.current=M;const B=d(Me((e=>{if(e){const t=_a(e,{bannedWords:x.current,formatUrl:!0}),{invalidUrls:o,previewUrl:n,value:i}=t;o&&C(o),n?j.current(n):T(null),i!==e&&(null==a||a(i))}}),500),[]);s((()=>{u&&u(E)}),[E]),s((()=>{g&&((null==k?void 0:k.url)?g({title:k.title||"",url:k.url||"",image:k.image||"",description:k.description||""}):g(null))}),[k]);const F=r(m);F.current=m;const O=He(),R=r({toolbar:{handlers:{image:()=>{var e;return null===(e=F.current)||void 0===e?void 0:e.call(F)},link:()=>!1},container:"#toolbar-"+O},preserveWhiteSpace:!0}),V=r(-1),D=r(null);v&&(null===(f=null===(b=D.current)||void 0===b?void 0:b.getEditor())||void 0===f?void 0:f.root)&&v(null===(w=null===(y=D.current)||void 0===y?void 0:y.getEditor())||void 0===w?void 0:w.root);const U=()=>{var e,t,a,o,n,i,l,r;if(null===(t=null===(e=D.current)||void 0===e?void 0:e.getEditor())||void 0===t?void 0:t.root){const e=Za(null===(o=null===(a=D.current)||void 0===a?void 0:a.getEditor())||void 0===o?void 0:o.root),t=null===(i=null===(n=D.current)||void 0===n?void 0:n.getEditor())||void 0===i?void 0:i.root.innerHTML;if(e>=0&&e<t.length){if(La(t,!0).length<30-(h?1:0)){const e=function(e){var t,a;let o=null;if(void 0!==window.getSelection){const n=window.getSelection();if((null==n?void 0:n.rangeCount)&&(null==n?void 0:n.rangeCount)>0){const n=null===(t=window.getSelection())||void 0===t?void 0:t.getRangeAt(0);if(n){const t=n.cloneRange();t.selectNodeContents(e),t.setEnd(n.endContainer,n.endOffset);const i=(t.endContainer.nodeValue||"").substring(0,n.endOffset),l=i.lastIndexOf("@");if(l+1<i.length&&(0===l||" @"===i.slice(l-1,l+1))){const e=null===(a=i.slice(l+1))||void 0===a?void 0:a.trim();if(e){t.setStart(n.endContainer,l);const a=t.cloneRange();a.setStart(a.endContainer,l),o={name:e,rect:t.getBoundingClientRect(),replaceRange:a}}}}}}return o}(null===(r=null===(l=D.current)||void 0===l?void 0:l.getEditor())||void 0===r?void 0:r.root);e?(K(e.name,e.rect),Y.current=e.replaceRange):(Y.current=null,K("",null))}else Y.current=null,K("",null);V.current=e}}else H([])},[W,H]=l([]),[Z,Q]=l({top:0,left:0}),K=d(Me(((t,a,o)=>e(void 0,void 0,void 0,(function*(){var e,n,i,l;if(!t||!DOMRect)return H([]);const r=yield((null===(e=Oe(A))||void 0===e?void 0:e.length)||0)>0?G(P(I.SEARCH_USER,{_locale:S,name:t}),"get"):_(P(q.SEARCH_USER,{_locale:S,name:t}),"get");te(0),H(null===(i=null===(n=null==r?void 0:r.data)||void 0===n?void 0:n.users)||void 0===i?void 0:i.filter((e=>!(null==o?void 0:o.includes(String(e.id))))));const s=a,c=null===(l=$.current)||void 0===l?void 0:l.getBoundingClientRect();if(s&&c){const e=343,t=256,a={top:s.bottom-c.top,width:"min(343px, 100%)",maxHeight:t};c.width-(s.left-c.left)<e?a.right=0:a.left=s.left-c.left,Q(a)}}))),500),[]),X=(e,t)=>{var a,o,n;if(Y.current){Y.current.deleteContents();const i=document.createElement("mention");i.setAttribute("data-id",e),i.setAttribute("data-name",t),i.innerText=t;const l=document.createTextNode(" ");Y.current.insertNode(l),Y.current.insertNode(i);(null===(o=null===(a=D.current)||void 0===a?void 0:a.getEditor())||void 0===o?void 0:o.root).focus();const r=null===(n=window.getSelection())||void 0===n?void 0:n.getRangeAt(0);null==r||r.setStart(Y.current.endContainer,Y.current.endOffset),null==r||r.setEnd(Y.current.endContainer,Y.current.endOffset)}H([])},$=r(null),Y=r(null),J=r(null),[ee,te]=l(0);return s((()=>{if(J.current){const e=J.current,t=e.children.item(ee);if(t){const a=e.getBoundingClientRect(),o=t.getBoundingClientRect();t.offsetTop<e.scrollTop?e.scrollTop=t.offsetTop:t.offsetTop+o.height>e.scrollTop+a.height&&(e.scrollTop=t.offsetTop-a.height+o.height)}}}),[ee]),s((()=>{const e=function(e){var t;(null===(t=$.current)||void 0===t?void 0:t.contains(e.target))||H([])};return window.addEventListener("click",e,{passive:!0}),()=>{window.removeEventListener("click",e)}}),[]),o.createElement(Wa,{ref:$,className:n,style:c,onKeyDownCapture:e=>{if(null==W?void 0:W.length){let t=!1;if("ArrowDown"===e.key)t=!0,te((e=>e+1>=W.length?0:e+1));else if("Escape"===e.key)t=!0,te(0),H([]);else if("ArrowUp"===e.key)t=!0,te((e=>e-1<0?W.length-1:e-1));else if("Enter"===e.key||"Tab"===e.key){const e=W[ee];e&&(t=!0,X(e.id,e.name))}if(t)return e.preventDefault(),!1}}},o.createElement(Qa,{id:O,onAddLink:(e,t)=>{var o,n;const i=V.current+1,l=null===(n=null===(o=D.current)||void 0===o?void 0:o.getEditor())||void 0===n?void 0:n.root.innerHTML,r=((null==l?void 0:l.substring(0,i))||"")+`<mocka data-href="${t}" data-url="true">${e}</mocka> `+((null==l?void 0:l.substring(i))||"");null==a||a(r),B(r)}}),Ha&&o.createElement(Ha,{ref:D,theme:"snow",value:t,onChange:e=>{null==a||a(e),B(e),U()},onChangeSelection:()=>{U()},modules:R.current,formats:["mocka1","mention","id","key","bold","italic","underline","list","bullet"]}),!!(null==W?void 0:W.length)&&o.createElement("div",{ref:J,className:"mention-search-container",style:Z},W.map(((e,t)=>o.createElement("div",{className:"mention-search-item "+(ee===t?"item-selected":""),key:e.id,onClick:t=>{t.preventDefault(),t.stopPropagation(),X(e.id,e.name)},onMouseEnter:()=>{te(t)}},o.createElement(De,{className:"search-avatar",username:e.name,avatar:e.avatar}),o.createElement("div",null,o.createElement(Se,{size:"p2"},e.name),o.createElement(Se,{size:"p4",color:"#595959"},"@",e.username)))))))},Qa=({onAddLink:e,id:t})=>o.createElement("div",{id:"toolbar-"+t,onClick:e=>{e.preventDefault(),e.stopPropagation()}},o.createElement("span",{className:"ql-formats"},o.createElement("button",{className:"ql-bold",type:"button"}),o.createElement("button",{className:"ql-italic",type:"button"}),o.createElement("button",{className:"ql-underline",type:"button"})),o.createElement("span",{className:"ql-formats"},o.createElement("button",{className:"ql-list",value:"ordered",type:"button"}),o.createElement("button",{className:"ql-list",value:"bullet",type:"button"})),o.createElement("span",{className:"ql-formats"},o.createElement("button",{className:"ql-image",type:"button"}),e&&o.createElement(yt,{className:"link-tool-wrapper",toggleButtonContent:o.createElement("img",{className:"link-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='M9.54545 16H7.09091C6.55368 16 6.02172 15.8965 5.52539 15.6955C5.02905 15.4945 4.57808 15.1999 4.1982 14.8284C3.43101 14.0783 3 13.0609 3 12C3 10.9391 3.43101 9.92172 4.1982 9.17157C4.96539 8.42143 6.00593 8 7.09091 8H9.54545M13.9256 8H16.9091C17.4463 8 17.9783 8.10346 18.4746 8.30448C18.9709 8.5055 19.4219 8.80014 19.8018 9.17157C20.1817 9.54301 20.483 9.98396 20.6886 10.4693C20.8942 10.9546 21 11.4747 21 12C21 12.5253 20.8942 13.0454 20.6886 13.5307C20.483 14.016 20.1817 14.457 19.8018 14.8284C19.4219 15.1999 18.9709 15.4945 18.4746 15.6955C17.9783 15.8965 17.4463 16 16.9091 16H13.9256' stroke='%23737373' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M9 12H15' stroke='%23737373' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",loading:"lazy"}),buttonProps:{size:"md",color:"transparent"},align:"end"},(({setShow:t})=>o.createElement(Xa,{onAddUrl:e,setShow:t}))))),Ka=["notification.limitUrlDomain","notification.urlWrongFormat"],Xa=({onAddUrl:e,setShow:t})=>{const{data:{env:{isMarryBaby:a}}}=i(N),{t:n}=E(),[r,s]=l(""),[c,d]=l(""),[m,p]=l(-1),u=r.trim()&&c.trim()&&m<0;return o.createElement("div",{className:"link-tool-popover"},o.createElement(Le,{name:"url",value:r,size:"md",label:"URL",placeholder:n("placeholder.enterUrlHere"),type:"text",className:"link-input-url",onChange:e=>{s(e),(e=>{const t=Oa(e.trim());try{const e=new URL(t);return e.protocol.startsWith("http")?Fa.some((t=>e.origin.endsWith("/"+t)||e.origin.endsWith("."+t)))?(p(-1),!0):(p(0),!1):(p(1),!1)}catch(e){return p(1),!1}})(e)}}),m>=0&&o.createElement(Se,{size:"c2",className:"error-text"},n(Ka[m])),o.createElement(Le,{name:"text",value:c,size:"md",label:n("createPost.urlText"),placeholder:n("placeholder.enterUrlTextHere"),type:"text",className:"link-input-text",onChange:e=>d(e)}),o.createElement("div",{"data-is-marrybaby":a,className:"link-input-button-wrapper"},o.createElement(Be,{theme:a?"marryBaby":"helloSites",size:"sm",color:"primary",className:"link-input-button",onClick:()=>{u&&(e(c.trim(),Oa(r.trim())),t&&t(!1))},isDisabled:!u},n("insert"))))};var $a="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 Ya=({className:e,style:t,bannedWords:a=[],value:n,onChange:i,onPreviewUrlChange:c,onInvalidUrlsChange:d,onImageFilesChange:m,imageFiles:p,isReplying:u})=>{const{t:g}=E(),[v,h]=l(null),b=r(null),{onSelectImages:f,onRemoveImage:y,imageSrcs:w}=Da(p,m);return s((()=>{c&&((null==v?void 0:v.url)?c({title:v.title||"",url:v.url||"",image:v.image||"",description:v.description||""}):c(null))}),[v]),o.createElement(Ua,{className:e,style:t},o.createElement(Se,{size:"p4",className:"description-label"},g("createPost.popup.description")),o.createElement("div",{className:"textarea-control"},o.createElement("div",{className:"textarea-wrapper"},o.createElement(Ga,{html:n||"",onChange:i,bannedWords:a,onImagePickerClick:()=>{var e;return null===(e=b.current)||void 0===e?void 0:e.click()},onPreviewUrlChange:h,onInvalidUrlsChange:d,isReplying:u}))),o.createElement(Se,{size:"p4",className:"count-string"},g("character"),": ",C(n||"").length),(!w||0===w.length)&&v&&o.createElement("div",{className:"link-preview-wrapper"},v.isFetching?o.createElement($e,null):o.createElement(o.Fragment,null,o.createElement(Je,{title:v.title,url:v.url||"#",image:v.image,noRefetch:!0}),o.createElement("img",{src:$a,className:"icon-close",onClick:()=>h(null),loading:"lazy"}))),o.createElement("input",{ref:b,type:"file",accept:"image/png, image/gif, image/jpeg",multiple:!0,style:{display:"none"},onChange:f}),w.length>Q?o.createElement("div",{className:"input-notification"},o.createElement("img",{src:ba,loading:"lazy"}),o.createElement(Se,{size:"p4",color:k.colors.alertWarning},g("createPost.popup.warningImage"))):null,w.length>0&&o.createElement("div",{className:"image-gallery"},w.map(((e,t)=>o.createElement("div",{key:t,className:"image-item"},o.createElement("img",{src:e,loading:"lazy"}),o.createElement("img",{className:"close-btn",src:$a,onClick:()=>y(t),loading:"lazy"}))))))},Ja=pe.div`
|
|
1414
|
+
`;let Ha=null;function Za(e){var t,a;let o=-1;if(void 0!==window.getSelection){const n=window.getSelection();if((null==n?void 0:n.rangeCount)&&(null==n?void 0:n.rangeCount)>0){const n=null===(t=window.getSelection())||void 0===t?void 0:t.getRangeAt(0);if(n){const t=n.cloneRange();t.selectNodeContents(e),t.setEnd(n.endContainer,n.endOffset),o=qa(t.cloneContents().childNodes,o);const i=null===(a=n.endContainer.parentElement)||void 0===a?void 0:a.closest("mocka"),l=n.endContainer.nodeValue||n.endContainer.outerHTML;i&&(null==l?void 0:l.length)&&(o=o-n.endOffset+(i.outerHTML.length-(null==i?void 0:i.outerHTML.lastIndexOf(l))))}}}return o}function qa(e,t){return e.forEach(((a,o)=>{const n=o+1===e.length;if(a.nodeType===Node.ELEMENT_NODE){const e=a.outerHTML;if(!n)return void(t+=e.length);t+=e.indexOf(">")+1,t=qa(a.childNodes,t)}else a.nodeType===Node.TEXT_NODE&&(t+=(a.nodeValue||"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").length)})),t}e(void 0,void 0,void 0,(function*(){if("undefined"==typeof window)return;const e=yield import("react-quill");Ha=e.default;const t=e.Quill||Ha.Quill;t.register("modules/preserveWhiteSpace",class{constructor(e,t){this.quill=e,this.options=t,e.container.style.whiteSpace="pre-line"}});const a=t.import("blots/inline");class o extends a{static create(e){if(!e)return super.create(!1);const t=super.create(e);return o.setNodeConfigurations(t,e),t}static formats(e){return!(!e.innerText||!(e.getAttribute("data-href")||e.getAttribute("data-url")||e.getAttribute("data-error")||e.getAttribute("data-bad-word")))&&{"data-bad-word":e.getAttribute("data-bad-word"),"data-error":e.getAttribute("data-error"),"data-href":e.getAttribute("data-href"),"data-url":e.getAttribute("data-url"),"data-text":e.innerText||e.getAttribute("data-href")}}static setNodeConfigurations(e,t){var a,o;t&&(null===(o=null===(a=null==t?void 0:t["data-text"])||void 0===a?void 0:a.replace(/(\ )+/g," "))||void 0===o?void 0:o.replace(/(\u200c|‌)+/g,""))&&(t["data-bad-word"]&&e.setAttribute("data-bad-word",t["data-bad-word"]),t["data-href"]&&e.setAttribute("data-href",t["data-href"]),t["data-error"]&&e.setAttribute("data-error",t["data-error"]),t["data-url"]&&e.setAttribute("data-url",t["data-url"]))}}o.blotName="mocka1",o.tagName="mocka",t.register(o);class n extends a{static create(e){if(!e)return super.create(!1);const t=super.create(e);return n.setNodeConfigurations(t,e),t}static formats(e){return!(!e.getAttribute("data-name")||!e.getAttribute("data-id"))&&{"data-name":e.getAttribute("data-name"),"data-id":e.getAttribute("data-id")}}static setNodeConfigurations(e,t){var a,o;t&&t["data-id"]&&(null===(o=null===(a=null==t?void 0:t["data-name"])||void 0===a?void 0:a.replace(/(\ )+/g," "))||void 0===o?void 0:o.replace(/(\u200c|‌)+/g,""))&&(t["data-id"]&&e.setAttribute("data-id",t["data-id"]),t["data-name"]&&e.setAttribute("data-name",t["data-name"]))}}n.blotName="mention",n.tagName="mention",t.register(n)}));const _a=(e,t)=>{var a;const{formatUrl:o,bannedWords:n=[]}=t||{},i=e.replace(/<font [^\>]*>(.+)<\/font>/gim,((e,t)=>t.replace(/<u[^\>]*>(.+)<\/u>/gim,"$1"))).replace(Ea,((e,t,a,o)=>{if(o!==a){const e=a.split(" "),n=e.findIndex(((t,a)=>{const n=e.slice(0,a+1).join(" ");return!o.startsWith(n)}));if(0===n)return`@${o}`;{const a=(n<0?e:e.slice(0,n)).join(" "),i=o.slice(a.length).trim();return console.log(n,a,i),`<mention data-id="${t}" data-name="${a}">${a}</mention> ${i} `}}return e}));if(!o)return{value:Ra(i,n)};let l=(e=>e.replace(Ta,((e,t)=>{const a=document.createElement("div");a.innerHTML=e;const o=a.firstChild;return(null==o?void 0:o.innerText)!==(null==o?void 0:o.getAttribute("data-bad-word"))?t:e})))((e=>{var t,a;return null===(a=null===(t=e.replace(/(\ )+/g," "))||void 0===t?void 0:t.replace(/(\u200c|‌)+/g,""))||void 0===a?void 0:a.replace(fa,((e,t,a)=>{var o;const n=null===(o=t.match(/data-href="([^"]*)"/im))||void 0===o?void 0:o[1];return!n||n===a||a.match(ka)?a:n?`<a href="${n}">${a}</a>`:`<a href="${a}">${a}</a>`})).replace(ya,((e,t,a)=>{if('="'!==t&&'data-url="true">'!==t){const e=a.toLowerCase(),t=`${e.startsWith("http")?"":" https://"}${e}`;return za({text:t,url:t,method:"edit"})}return e})).replace(Aa,((e,t,a)=>za({text:a||t,url:t,method:"edit"})))})(i));const r=(e=>{var t;return[...Sa(e),...(null===(t=e.match(fa))||void 0===t?void 0:t.map((e=>{var t,a;const o=null===(t=e.match(/data-href="([^"]*)"/im))||void 0===t?void 0:t[1],n=null===(a=e.match(/>(.*?)<\/mocka>/im))||void 0===a?void 0:a[1];return o||n})))||[]].filter((e=>!!e))})(i);if(r){const e=[];let t="";return r.forEach((t=>{if(t)try{const a=new URL(t);Fa.some((e=>a.origin.endsWith(e)))||e.push(t)}catch(a){e.push(t)}})),e.length>0&&(l=l.replace(new RegExp(`data-url="true">(${e.map(Ma).join("|")})<`,"gi"),'data-error="true" data-url="true">$1<').replace(new RegExp(`data-href="(${e.map(Ma).join("|")})" data-url="true">`,"gi"),'data-href="$1" data-error="true" data-url="true">')),t=null===(a=r.filter((t=>-1===e.indexOf(t))))||void 0===a?void 0:a[0],{invalidUrls:e,previewUrl:t,value:Ra(l,n)}}return{value:Ra(l,n)}},Ga=({html:t,onChange:a,className:n,style:c,onImagePickerClick:m,bannedWords:p=[],onInvalidUrlsChange:u,onPreviewUrlChange:g,setEditorRef:v,isReplying:h})=>{var b,f,y,w;const x=r([]);x.current=p;const[E,C]=l([]),[k,T]=l(null),{data:{locale:S}}=i(N),L=(null==p?void 0:p.join(","))||"";s((()=>{var e,t;const a=null===(t=null===(e=D.current)||void 0===e?void 0:e.getEditor())||void 0===t?void 0:t.root.innerHTML;B(a)}),[L]);const M=e=>{k&&k.url===e||(T({url:e,isFetching:!0}),z(P(I.FETCH_PREVIEW,{_locale:S}),"POST",{data:{link:e}}).then((t=>{var a,o,n,i;T({title:null===(a=null==t?void 0:t.data)||void 0===a?void 0:a.title,description:null===(o=null==t?void 0:t.data)||void 0===o?void 0:o.description,image:(null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.image)||(null===(i=null==t?void 0:t.data)||void 0===i?void 0:i.logo),url:e})})).catch((()=>{T(null)})))},j=r(M);j.current=M;const B=d(Me((e=>{if(e){const t=_a(e,{bannedWords:x.current,formatUrl:!0}),{invalidUrls:o,previewUrl:n,value:i}=t;o&&C(o),n?j.current(n):T(null),i!==e&&(null==a||a(i))}}),500),[]);s((()=>{u&&u(E)}),[E]),s((()=>{g&&((null==k?void 0:k.url)?g({title:k.title||"",url:k.url||"",image:k.image||"",description:k.description||""}):g(null))}),[k]);const F=r(m);F.current=m;const O=He(),R=r({toolbar:{handlers:{image:()=>{var e;return null===(e=F.current)||void 0===e?void 0:e.call(F)},link:()=>!1},container:"#toolbar-"+O},preserveWhiteSpace:!0}),V=r(-1),D=r(null);v&&(null===(f=null===(b=D.current)||void 0===b?void 0:b.getEditor())||void 0===f?void 0:f.root)&&v(null===(w=null===(y=D.current)||void 0===y?void 0:y.getEditor())||void 0===w?void 0:w.root);const U=()=>{var e,t,a,o,n,i,l,r;if(null===(t=null===(e=D.current)||void 0===e?void 0:e.getEditor())||void 0===t?void 0:t.root){const e=Za(null===(o=null===(a=D.current)||void 0===a?void 0:a.getEditor())||void 0===o?void 0:o.root),t=null===(i=null===(n=D.current)||void 0===n?void 0:n.getEditor())||void 0===i?void 0:i.root.innerHTML;if(e>=0&&e<t.length){if(La(t,!0).length<30-(h?1:0)){const e=function(e){var t,a;let o=null;if(void 0!==window.getSelection){const n=window.getSelection();if((null==n?void 0:n.rangeCount)&&(null==n?void 0:n.rangeCount)>0){const n=null===(t=window.getSelection())||void 0===t?void 0:t.getRangeAt(0);if(n){const t=n.cloneRange();t.selectNodeContents(e),t.setEnd(n.endContainer,n.endOffset);const i=(t.endContainer.nodeValue||"").substring(0,n.endOffset),l=i.lastIndexOf("@");if(l+1<i.length&&(0===l||" @"===i.slice(l-1,l+1))){const e=null===(a=i.slice(l+1))||void 0===a?void 0:a.trim();if(e){t.setStart(n.endContainer,l);const a=t.cloneRange();a.setStart(a.endContainer,l),o={name:e,rect:t.getBoundingClientRect(),replaceRange:a}}}}}}return o}(null===(r=null===(l=D.current)||void 0===l?void 0:l.getEditor())||void 0===r?void 0:r.root);e?(X(e.name,e.rect),Y.current=e.replaceRange):(Y.current=null,X("",null))}else Y.current=null,X("",null);V.current=e}}else H([])},[W,H]=l([]),[Z,Q]=l({top:0,left:0}),X=d(Me(((t,a,o)=>e(void 0,void 0,void 0,(function*(){var e,n,i,l;if(!t||!DOMRect)return H([]);const r=yield((null===(e=Oe(A))||void 0===e?void 0:e.length)||0)>0?G(P(I.SEARCH_USER,{_locale:S,name:t}),"get"):_(P(q.SEARCH_USER,{_locale:S,name:t}),"get");te(0),H(null===(i=null===(n=null==r?void 0:r.data)||void 0===n?void 0:n.users)||void 0===i?void 0:i.filter((e=>!(null==o?void 0:o.includes(String(e.id))))));const s=a,c=null===(l=$.current)||void 0===l?void 0:l.getBoundingClientRect();if(s&&c){const e=343,t=256,a={top:s.bottom-c.top,width:"min(343px, 100%)",maxHeight:t};c.width-(s.left-c.left)<e?a.right=0:a.left=s.left-c.left,Q(a)}}))),500),[]),K=(e,t)=>{var a,o,n;if(Y.current){Y.current.deleteContents();const i=document.createElement("mention");i.setAttribute("data-id",e),i.setAttribute("data-name",t),i.innerText=t;const l=document.createTextNode(" ");Y.current.insertNode(l),Y.current.insertNode(i);(null===(o=null===(a=D.current)||void 0===a?void 0:a.getEditor())||void 0===o?void 0:o.root).focus();const r=null===(n=window.getSelection())||void 0===n?void 0:n.getRangeAt(0);null==r||r.setStart(Y.current.endContainer,Y.current.endOffset),null==r||r.setEnd(Y.current.endContainer,Y.current.endOffset)}H([])},$=r(null),Y=r(null),J=r(null),[ee,te]=l(0);return s((()=>{if(J.current){const e=J.current,t=e.children.item(ee);if(t){const a=e.getBoundingClientRect(),o=t.getBoundingClientRect();t.offsetTop<e.scrollTop?e.scrollTop=t.offsetTop:t.offsetTop+o.height>e.scrollTop+a.height&&(e.scrollTop=t.offsetTop-a.height+o.height)}}}),[ee]),s((()=>{const e=function(e){var t;(null===(t=$.current)||void 0===t?void 0:t.contains(e.target))||H([])};return window.addEventListener("click",e,{passive:!0}),()=>{window.removeEventListener("click",e)}}),[]),o.createElement(Wa,{ref:$,className:n,style:c,onKeyDownCapture:e=>{if(null==W?void 0:W.length){let t=!1;if("ArrowDown"===e.key)t=!0,te((e=>e+1>=W.length?0:e+1));else if("Escape"===e.key)t=!0,te(0),H([]);else if("ArrowUp"===e.key)t=!0,te((e=>e-1<0?W.length-1:e-1));else if("Enter"===e.key||"Tab"===e.key){const e=W[ee];e&&(t=!0,K(e.id,e.name))}if(t)return e.preventDefault(),!1}}},o.createElement(Qa,{id:O,onAddLink:(e,t)=>{var o,n;const i=V.current+1,l=null===(n=null===(o=D.current)||void 0===o?void 0:o.getEditor())||void 0===n?void 0:n.root.innerHTML,r=((null==l?void 0:l.substring(0,i))||"")+`<mocka data-href="${t}" data-url="true">${e}</mocka> `+((null==l?void 0:l.substring(i))||"");null==a||a(r),B(r)}}),Ha&&o.createElement(Ha,{ref:D,theme:"snow",value:t,onChange:e=>{null==a||a(e),B(e),U()},onChangeSelection:()=>{U()},modules:R.current,formats:["mocka1","mention","id","key","bold","italic","underline","list","bullet"]}),!!(null==W?void 0:W.length)&&o.createElement("div",{ref:J,className:"mention-search-container",style:Z},W.map(((e,t)=>o.createElement("div",{className:"mention-search-item "+(ee===t?"item-selected":""),key:e.id,onClick:t=>{t.preventDefault(),t.stopPropagation(),K(e.id,e.name)},onMouseEnter:()=>{te(t)}},o.createElement(De,{className:"search-avatar",username:e.name,avatar:e.avatar}),o.createElement("div",null,o.createElement(Se,{size:"p2"},e.name),o.createElement(Se,{size:"p4",color:"#595959"},"@",e.username)))))))},Qa=({onAddLink:e,id:t})=>o.createElement("div",{id:"toolbar-"+t,onClick:e=>{e.preventDefault(),e.stopPropagation()}},o.createElement("span",{className:"ql-formats"},o.createElement("button",{className:"ql-bold",type:"button"}),o.createElement("button",{className:"ql-italic",type:"button"}),o.createElement("button",{className:"ql-underline",type:"button"})),o.createElement("span",{className:"ql-formats"},o.createElement("button",{className:"ql-list",value:"ordered",type:"button"}),o.createElement("button",{className:"ql-list",value:"bullet",type:"button"})),o.createElement("span",{className:"ql-formats"},o.createElement("button",{className:"ql-image",type:"button"}),e&&o.createElement(yt,{className:"link-tool-wrapper",toggleButtonContent:o.createElement("img",{className:"link-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='M9.54545 16H7.09091C6.55368 16 6.02172 15.8965 5.52539 15.6955C5.02905 15.4945 4.57808 15.1999 4.1982 14.8284C3.43101 14.0783 3 13.0609 3 12C3 10.9391 3.43101 9.92172 4.1982 9.17157C4.96539 8.42143 6.00593 8 7.09091 8H9.54545M13.9256 8H16.9091C17.4463 8 17.9783 8.10346 18.4746 8.30448C18.9709 8.5055 19.4219 8.80014 19.8018 9.17157C20.1817 9.54301 20.483 9.98396 20.6886 10.4693C20.8942 10.9546 21 11.4747 21 12C21 12.5253 20.8942 13.0454 20.6886 13.5307C20.483 14.016 20.1817 14.457 19.8018 14.8284C19.4219 15.1999 18.9709 15.4945 18.4746 15.6955C17.9783 15.8965 17.4463 16 16.9091 16H13.9256' stroke='%23737373' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M9 12H15' stroke='%23737373' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",loading:"lazy"}),buttonProps:{size:"md",color:"transparent"},align:"end"},(({setShow:t})=>o.createElement(Ka,{onAddUrl:e,setShow:t}))))),Xa=["notification.limitUrlDomain","notification.urlWrongFormat"],Ka=({onAddUrl:e,setShow:t})=>{const{data:{env:{isMarryBaby:a}}}=i(N),{t:n}=E(),[r,s]=l(""),[c,d]=l(""),[m,p]=l(-1),u=r.trim()&&c.trim()&&m<0;return o.createElement("div",{className:"link-tool-popover"},o.createElement(Le,{name:"url",value:r,size:"md",label:"URL",placeholder:n("placeholder.enterUrlHere"),type:"text",className:"link-input-url",onChange:e=>{s(e),(e=>{const t=Oa(e.trim());try{const e=new URL(t);return e.protocol.startsWith("http")?Fa.some((t=>e.origin.endsWith("/"+t)||e.origin.endsWith("."+t)))?(p(-1),!0):(p(0),!1):(p(1),!1)}catch(e){return p(1),!1}})(e)}}),m>=0&&o.createElement(Se,{size:"c2",className:"error-text"},n(Xa[m])),o.createElement(Le,{name:"text",value:c,size:"md",label:n("createPost.urlText"),placeholder:n("placeholder.enterUrlTextHere"),type:"text",className:"link-input-text",onChange:e=>d(e)}),o.createElement("div",{"data-is-marrybaby":a,className:"link-input-button-wrapper"},o.createElement(Be,{theme:a?"marryBaby":"helloSites",size:"sm",color:"primary",className:"link-input-button",onClick:()=>{u&&(e(c.trim(),Oa(r.trim())),t&&t(!1))},isDisabled:!u},n("insert"))))};var $a="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 Ya=({className:e,style:t,bannedWords:a=[],value:n,onChange:i,onPreviewUrlChange:c,onInvalidUrlsChange:d,onImageFilesChange:m,imageFiles:p,isReplying:u})=>{const{t:g}=E(),[v,h]=l(null),b=r(null),{onSelectImages:f,onRemoveImage:y,imageSrcs:w}=Da(p,m);return s((()=>{c&&((null==v?void 0:v.url)?c({title:v.title||"",url:v.url||"",image:v.image||"",description:v.description||""}):c(null))}),[v]),o.createElement(Ua,{className:e,style:t},o.createElement(Se,{size:"p4",className:"description-label"},g("createPost.popup.description")),o.createElement("div",{className:"textarea-control"},o.createElement("div",{className:"textarea-wrapper"},o.createElement(Ga,{html:n||"",onChange:i,bannedWords:a,onImagePickerClick:()=>{var e;return null===(e=b.current)||void 0===e?void 0:e.click()},onPreviewUrlChange:h,onInvalidUrlsChange:d,isReplying:u}))),o.createElement(Se,{size:"p4",className:"count-string"},g("character"),": ",C(n||"").length),(!w||0===w.length)&&v&&o.createElement("div",{className:"link-preview-wrapper"},v.isFetching?o.createElement($e,null):o.createElement(o.Fragment,null,o.createElement(Je,{title:v.title,url:v.url||"#",image:v.image,noRefetch:!0}),o.createElement("img",{src:$a,className:"icon-close",onClick:()=>h(null),loading:"lazy"}))),o.createElement("input",{ref:b,type:"file",accept:"image/png, image/gif, image/jpeg",multiple:!0,style:{display:"none"},onChange:f}),w.length>Q?o.createElement("div",{className:"input-notification"},o.createElement("img",{src:ba,loading:"lazy"}),o.createElement(Se,{size:"p4",color:k.colors.alertWarning},g("createPost.popup.warningImage"))):null,w.length>0&&o.createElement("div",{className:"image-gallery"},w.map(((e,t)=>o.createElement("div",{key:t,className:"image-item"},o.createElement("img",{src:e,loading:"lazy"}),o.createElement("img",{className:"close-btn",src:$a,onClick:()=>y(t),loading:"lazy"}))))))},Ja=pe.div`
|
|
1415
1415
|
input:focus,
|
|
1416
1416
|
textarea:focus,
|
|
1417
1417
|
[contenteditable='true'] {
|
|
@@ -1518,7 +1518,7 @@ import{a as e,_ as t}from"./tslib.es6-01eae420.js";import*as a from"react";impor
|
|
|
1518
1518
|
}
|
|
1519
1519
|
}
|
|
1520
1520
|
}
|
|
1521
|
-
`,oo=({className:t,style:a,topics:n,communityId:d,onChange:m,isLoading:p,disabled:u,forceTopics:g,selectedTopics:v,noFetch:h,dataEventCategory:b,dataEventAction:f,dataEventLabel:y})=>{const{data:{locale:w,env:{isMarryBaby:x}}}=i(N),[E,C]=l(n?[...n]:[]),[k,A]=l(v?[...v]:[]),[T,S]=l(!1),L=r(n);L.current=n,s((()=>{var t;!d||h||(null===(t=L.current)||void 0===t?void 0:t.length)||(C([]),S(!0),e(void 0,void 0,void 0,(function*(){var e;try{const t=yield z(P(I.TOPIC.LIST,{communityId:d,_locale:w}),"GET"),a=null===(e=null==t?void 0:t.data)||void 0===e?void 0:e.topics;Array.isArray(a)&&C((()=>(null==a?void 0:a.map(ke).sort(((e,t)=>(e.order||0)-(t.order||0))))||[]))}catch(e){console.log(e),S(!1)}S(!1)})))}),[d,h]);const M=null==n?void 0:n.map((e=>e.id)).join("-"),j=null==E?void 0:E.map((e=>e.id)).join("-"),B=null==g?void 0:g.map((e=>e.id)).join("-");s((()=>{n&&void 0!==M&&M!==j&&C(n)}),[n,M,j]);const F=c((()=>E.filter((e=>!(null==g?void 0:g.some((t=>t.id&&t.id===e.id||t.mappedCategoryId&&t.mappedCategoryId===e.mappedCategoryId)))))),[j,B]);return o.createElement(ao,{"data-is-marrybaby":x,className:t,style:a},g.map((e=>o.createElement(no,{key:`${e.id}-${e.mappedCategoryId}`,topic:e,disabled:!0,selected:!0,dataEventAction:f,dataEventCategory:b,dataEventLabel:y}))),F.map((e=>o.createElement(no,{key:`${e.id}-${e.mappedCategoryId}`,topic:e,disabled:u,selected:(v||k).some((t=>t.id&&t.id===e.id||t.mappedCategoryId&&t.mappedCategoryId===e.mappedCategoryId)),onClick:()=>{const t=v||k,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),m&&v?m(t.slice()):(m&&m(t.slice()),A(t.slice()))},dataEventAction:f,dataEventCategory:b,dataEventLabel:y}))),(p||T)&&o.createElement($e,{className:"topic-spinner"}))},no=e=>{var{topic:a,disabled:n,selected:i,onClick:l}=e,r=t(e,["topic","disabled","selected","onClick"]);return o.createElement("div",Object.assign({className:"tag-item"+(i?" --active":""),"data-disabled":n,onClick:n?void 0:l},r),a.name)},io=({className:t,style:a,onPostCreatedEdited:n,onClose:r,communities:c=[],forceSelectCommunity:d,forceSelectTopics:m,articleId:p,optionalTopic:u,editPostData:g,defaultCommunity:v,defaultTopics:b,noFetchTopic:f,hideTopicList:y,selectAskDoctor:w,showAskDoctorOptions:A,currentPageUrl:T})=>{const z=!!(null==g?void 0:g.id),{data:{locale:S,env:{isMarryBaby:L}},action:{pushNotifications:M,sanitizeFunction:j}}=i(N),{t:B}=E(),[O,R]=l(!1),[V,D]=l(w),[U,W]=l(!1),[H,Z]=l(!1),[q,_]=l(!1),[Y,J]=l(""),[ee,te]=l(""),[ae,oe]=l(d?{label:d.name,value:`${d.id||""}-${d.mappedCategoryId||""}`}:{label:B("community.choose"),value:""}),[ne,ie]=l([...m]||[]),[le,re]=l([]),[ce,de]=l([]),me=d||c.find((e=>`${e.id||""}-${e.mappedCategoryId||""}`===ae.value)),pe=d?[d]:c.filter((e=>e.isActive)).sort(((e,t)=>e.name>t.name?1:e.name<t.name?-1:0)),[ue,ge]=l(null),[ve,he]=l([]),fe=Y&&!H&&C(ee)&&(u||!u&&ne.length>0)&&me&&(!le||le.length<=Q)&&!(null==ve?void 0:ve.length)&&!q;s((()=>{if(g){const e=g;J(e.title||""),te(Ia(Pa(e.description||"","edit"),e.mentions)),oe({label:e.community.name,value:`${e.community.id||""}-${e.community.mappedCategoryId||""}`}),ie(e.topics||[]),re(e.photos||[]),R(!!e.isAnonymous||!1),D(!!e.isAskDoctor||!1)}else v&&oe({label:v.name,value:`${v.id||""}-${v.mappedCategoryId||""}`}),b&&ie(b)}),[]),s((()=>{Z(""!==Y&&!/[a-zA-Z]/.test(Y))}),[Y]);const ye=()=>e(void 0,void 0,void 0,(function*(){var t,a,o,i,l,s,c,d,m;if(A&&void 0===V)return W(!0),!1;const u=yield(({title:t,description:a,communityId:o,imageFiles:n,previewUrl:i,topicIds:l,locale:r,sanitizeFunction:s,categoryCommunityId:c,categoryTopicIds:d,introUrl:m,bannerUrl:p,scheduleTime:u,isAnonymous:g,isAskDoctor:v})=>e(void 0,void 0,void 0,(function*(){const e=new FormData,h=ja(a),b=ja(t),f=La(h);if(e.append("title",b),e.append("description",Ba(h,s)),c?e.append("category_community",String(c)):o&&e.append("community_id",String(o)),e.append("is_anonymous",g?"1":"0"),e.append("is_question",v?"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",be(i.url)),(null==i?void 0:i.image)&&e.append("preview_image",be(i.image)),null==l||l.forEach((t=>{e.append("topics[]",String(t||""))})),null==d||d.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(Va(e,r))}),2e3*t)})))));null==t||t.filter(Boolean).slice(0,Q).forEach(((t,a)=>{e.append(`images[${a}]`,t)}))}else e.append("images","");return null==f||f.forEach((t=>{e.append("mention_ids[]",t)})),e.append("intro_url",m||""),e.append("banner",p||""),u&&(e.append("post_type","scheduled"),e.append("schedule_datetime",u)),e})))({title:Y,description:ee,communityId:String((null==me?void 0:me.id)||""),imageFiles:le,previewUrl:ue,topicIds:null==ne?void 0:ne.map((e=>String(e.id||""))).filter(Boolean),locale:S,sanitizeFunction:j,categoryCommunityId:String((null==me?void 0:me.mappedCategoryId)||""),categoryTopicIds:null==ne?void 0:ne.map((e=>String(e.mappedCategoryId||""))).filter(Boolean),isAnonymous:O?1:0,isAskDoctor:V?1:0});let v;p&&u.append("article_id",p),z?(null==g?void 0:g.id)&&(v=yield(({id:t,locale:a,formData:o})=>e(void 0,void 0,void 0,(function*(){return yield G(P(I.POST.UPDATE,{id:t,_locale:a}),"POST",{data:o})})))({id:g.id,formData:u,locale:S})):v=yield(({locale:t,formData:a,isArticleComment:o})=>e(void 0,void 0,void 0,(function*(){return yield G(P(o?I.POST.CREATE_ARTICLE_COMMENT:I.POST.CREATE,{_locale:t}),"POST",{data:a})})))({formData:u,locale:S,isArticleComment:!(null==me?void 0:me.id)&&!!(null==me?void 0:me.mappedCategoryId)});const h=null==v?void 0:v.data;(null==h?void 0:h.id)&&!(null===(a=null===(t=null==v?void 0:v.messages)||void 0===t?void 0:t.moderation)||void 0===a?void 0:a.type)?(M({message:B("createPost.popup.success"),type:"success"}),(e=>{n&&n(Ne(e),z),r&&r()})(h)):"banned"===(null===(i=null===(o=null==v?void 0:v.messages)||void 0===o?void 0:o.moderation)||void 0===i?void 0:i.type)?(M({title:B("notification.post.blocked.title"),message:B("notification.post.blocked.message"),type:"danger"}),v.messages.moderation.words&&de(v.messages.moderation.words)):"suspect"===(null===(s=null===(l=null==v?void 0:v.messages)||void 0===l?void 0:l.moderation)||void 0===s?void 0:s.type)?(M({title:B("notification.post.suspect.title"),message:B("notification.post.suspect.message"),type:"warning"}),r&&r()):(null===(d=null===(c=null==v?void 0:v.messages)||void 0===c?void 0:c.find)||void 0===d?void 0:d.call(c,(e=>{var t;return!!(null===(t=null==e?void 0:e.includes)||void 0===t?void 0:t.call(e,"suspend"))})))?(M({message:B("notification.suspend.message"),type:"danger"}),r&&r()):M({message:(null===(m=null==v?void 0:v.messages)||void 0===m?void 0:m[0])||B("notification.failure"),type:"danger"})}));return o.createElement(ga,{className:t,style:a},o.createElement("div",{className:"input-group-container"},o.createElement(to,{className:"input-group",bannedWords:ce,value:Y,onChange:J}),H&&o.createElement(ha,null,o.createElement(K,{isSolid:!0,color:k.colors.red700,size:14}),o.createElement(F,{size:"p3",as:"span",color:k.colors.red700},B("createPost.popup.specialCharErr"))),o.createElement(Ya,{className:"input-group",bannedWords:ce,value:ee,onChange:te,onPreviewUrlChange:ge,onInvalidUrlsChange:he,onImageFilesChange:re,imageFiles:le}),A&&o.createElement(va,{"data-is-marry-baby":L},o.createElement("div",{className:"switch-label"},o.createElement(X,{isMarryBaby:L,size:L?32:24,color:k.colors.primaryBase,className:"label-icon"}),o.createElement("span",{className:"label-txt"},B("createPost.askDoctor"))),o.createElement(Ee,{value:V,choices:[{label:B("createPost.askDoctorChoice.yes"),value:!0,dataEventCategory:"Together",dataEventAction:"Write Post Click - Ask Doctor",dataEventLabel:T},{label:B("createPost.askDoctorChoice.no"),value:!1}],onChange:e=>{"boolean"==typeof e&&(W(!1),D(e))}})),U&&o.createElement(ha,null,o.createElement(K,{isSolid:!0,color:k.colors.red700,size:14}),o.createElement(F,{size:"p3",as:"span",color:k.colors.red700},B("createPost.message.askDoctorRequire"))),o.createElement("div",{className:"input-group"},o.createElement(F,{size:"p4",className:"input-group-label"},B("admin.community")),o.createElement(x,{options:(null==pe?void 0:pe.map((e=>({label:e.name,value:`${e.id||""}-${e.mappedCategoryId||""}`}))))||[],id:"community-picker",placeholder:B("community.choose"),value:ae,dropdownLabelTrackingAttributes:{"data-event-category":"Together","data-event-action":"Write Post Click - Choose Community/Topic","data-event-label":T},onChange:e=>{oe({label:e.label,value:String(e.value)}),ie([])},disabled:!!d}),o.createElement(F,{size:"sm",className:"warning",color:k.colors.gray400},"* ",B("commentPopup.warning.newPost"))),!y&&o.createElement("div",{className:"input-group"},o.createElement(F,{size:"p4",className:"input-group-label"},B("tab.topic")),o.createElement("div",{className:"input-notification"},o.createElement("img",{src:me?"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":ba,loading:"lazy"}),o.createElement(F,{size:"base",color:k.colors.gray500},B(me?"createPost.popup.primary":"createPost.popup.warning"))),me&&o.createElement(oo,{className:"tag-list",communityId:me.id,forceTopics:m,onChange:ie,selectedTopics:ne,noFetch:f,dataEventCategory:"Together",dataEventAction:"Write Post Click - Choose Community/Topic",dataEventLabel:T}))),o.createElement("div",{className:"form-action"},o.createElement("div",{className:"input-group"},o.createElement(h,{className:"swich-input-group",labelPosition:"left",name:"PostAnonymous",checked:O,color:L?"pink":void 0,"data-event-category":"Together","data-event-action":"Write Post Click - Incognito","data-event-label":T,label:o.createElement("div",{className:"switch-label"},o.createElement("img",{className:"label-icon",src:se.getAssetPath("anomyous-avatar.svg"),alt:"anomyous avatar",style:{marginRight:"10px",width:"24px"},loading:"lazy"}),o.createElement("span",{className:"label-txt"},B("createPost.postAnonymous"))),value:"Post Anonymous",onChange:e=>R(e.currentTarget.checked),styles:{body:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"},label:{display:"flex",alignItems:"center"}}})),o.createElement("div",{className:"input-group"},o.createElement($,{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(void 0,void 0,void 0,(function*(){if(fe&&!q){_(!0);try{yield ye()}catch(e){console.error(e),M(ua(B))}_(!1)}})),disabled:!fe,loading:q},B("createPost.popup.submit")))))},lo=pe.div`
|
|
1521
|
+
`,oo=({className:t,style:a,topics:n,communityId:d,onChange:m,isLoading:p,disabled:u,forceTopics:g,selectedTopics:v,noFetch:h,dataEventCategory:b,dataEventAction:f,dataEventLabel:y})=>{const{data:{locale:w,env:{isMarryBaby:x}}}=i(N),[E,C]=l(n?[...n]:[]),[k,A]=l(v?[...v]:[]),[T,S]=l(!1),L=r(n);L.current=n,s((()=>{var t;!d||h||(null===(t=L.current)||void 0===t?void 0:t.length)||(C([]),S(!0),e(void 0,void 0,void 0,(function*(){var e;try{const t=yield z(P(I.TOPIC.LIST,{communityId:d,_locale:w}),"GET"),a=null===(e=null==t?void 0:t.data)||void 0===e?void 0:e.topics;Array.isArray(a)&&C((()=>(null==a?void 0:a.map(ke).sort(((e,t)=>(e.order||0)-(t.order||0))))||[]))}catch(e){console.log(e),S(!1)}S(!1)})))}),[d,h]);const M=null==n?void 0:n.map((e=>e.id)).join("-"),j=null==E?void 0:E.map((e=>e.id)).join("-"),B=null==g?void 0:g.map((e=>e.id)).join("-");s((()=>{n&&void 0!==M&&M!==j&&C(n)}),[n,M,j]);const F=c((()=>E.filter((e=>!(null==g?void 0:g.some((t=>t.id&&t.id===e.id||t.mappedCategoryId&&t.mappedCategoryId===e.mappedCategoryId)))))),[j,B]);return o.createElement(ao,{"data-is-marrybaby":x,className:t,style:a},g.map((e=>o.createElement(no,{key:`${e.id}-${e.mappedCategoryId}`,topic:e,disabled:!0,selected:!0,dataEventAction:f,dataEventCategory:b,dataEventLabel:y}))),F.map((e=>o.createElement(no,{key:`${e.id}-${e.mappedCategoryId}`,topic:e,disabled:u,selected:(v||k).some((t=>t.id&&t.id===e.id||t.mappedCategoryId&&t.mappedCategoryId===e.mappedCategoryId)),onClick:()=>{const t=v||k,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),m&&v?m(t.slice()):(m&&m(t.slice()),A(t.slice()))},dataEventAction:f,dataEventCategory:b,dataEventLabel:y}))),(p||T)&&o.createElement($e,{className:"topic-spinner"}))},no=e=>{var{topic:a,disabled:n,selected:i,onClick:l}=e,r=t(e,["topic","disabled","selected","onClick"]);return o.createElement("div",Object.assign({className:"tag-item"+(i?" --active":""),"data-disabled":n,onClick:n?void 0:l},r),a.name)},io=({className:t,style:a,onPostCreatedEdited:n,onClose:r,communities:c=[],forceSelectCommunity:d,forceSelectTopics:m,articleId:p,optionalTopic:u,editPostData:g,defaultCommunity:v,defaultTopics:b,noFetchTopic:f,hideTopicList:y,selectAskDoctor:w,showAskDoctorOptions:A,currentPageUrl:T})=>{const z=!!(null==g?void 0:g.id),{data:{locale:S,env:{isMarryBaby:L}},action:{pushNotifications:M,sanitizeFunction:j}}=i(N),{t:B}=E(),[O,R]=l(!1),[V,D]=l(w),[U,W]=l(!1),[H,Z]=l(!1),[q,_]=l(!1),[Y,J]=l(""),[ee,te]=l(""),[ae,oe]=l(d?{label:d.name,value:`${d.id||""}-${d.mappedCategoryId||""}`}:{label:B("community.choose"),value:""}),[ne,ie]=l([...m]||[]),[le,re]=l([]),[ce,de]=l([]),me=d||c.find((e=>`${e.id||""}-${e.mappedCategoryId||""}`===ae.value)),pe=d?[d]:c.filter((e=>e.isActive)).sort(((e,t)=>e.name>t.name?1:e.name<t.name?-1:0)),[ue,ge]=l(null),[ve,he]=l([]),fe=Y&&!H&&C(ee)&&(u||!u&&ne.length>0)&&me&&(!le||le.length<=Q)&&!(null==ve?void 0:ve.length)&&!q;s((()=>{if(g){const e=g;J(e.title||""),te(Ia(Pa(e.description||"","edit"),e.mentions)),oe({label:e.community.name,value:`${e.community.id||""}-${e.community.mappedCategoryId||""}`}),ie(e.topics||[]),re(e.photos||[]),R(!!e.isAnonymous||!1),D(!!e.isAskDoctor||!1)}else v&&oe({label:v.name,value:`${v.id||""}-${v.mappedCategoryId||""}`}),b&&ie(b)}),[]),s((()=>{Z(""!==Y&&!/[a-zA-Z]/.test(Y))}),[Y]);const ye=()=>e(void 0,void 0,void 0,(function*(){var t,a,o,i,l,s,c,d,m;if(A&&void 0===V)return W(!0),!1;const u=yield(({title:t,description:a,communityId:o,imageFiles:n,previewUrl:i,topicIds:l,locale:r,sanitizeFunction:s,categoryCommunityId:c,categoryTopicIds:d,introUrl:m,bannerUrl:p,scheduleTime:u,isAnonymous:g,isAskDoctor:v})=>e(void 0,void 0,void 0,(function*(){const e=new FormData,h=ja(a),b=ja(t),f=La(h);if(e.append("title",b),e.append("description",Ba(h,s)),c?e.append("category_community",String(c)):o&&e.append("community_id",String(o)),e.append("is_anonymous",g?"1":"0"),e.append("is_question",v?"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",be(i.url)),(null==i?void 0:i.image)&&e.append("preview_image",be(i.image)),null==l||l.forEach((t=>{e.append("topics[]",String(t||""))})),null==d||d.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(Va(e,r))}),2e3*t)})))));null==t||t.filter(Boolean).slice(0,Q).forEach(((t,a)=>{e.append(`images[${a}]`,t)}))}else e.append("images","");return null==f||f.forEach((t=>{e.append("mention_ids[]",t)})),e.append("intro_url",m||""),e.append("banner",p||""),u&&(e.append("post_type","scheduled"),e.append("schedule_datetime",u)),e})))({title:Y,description:ee,communityId:String((null==me?void 0:me.id)||""),imageFiles:le,previewUrl:ue,topicIds:null==ne?void 0:ne.map((e=>String(e.id||""))).filter(Boolean),locale:S,sanitizeFunction:j,categoryCommunityId:String((null==me?void 0:me.mappedCategoryId)||""),categoryTopicIds:null==ne?void 0:ne.map((e=>String(e.mappedCategoryId||""))).filter(Boolean),isAnonymous:O?1:0,isAskDoctor:V?1:0});let v;p&&u.append("article_id",p),z?(null==g?void 0:g.id)&&(v=yield(({id:t,locale:a,formData:o})=>e(void 0,void 0,void 0,(function*(){return yield G(P(I.POST.UPDATE,{id:t,_locale:a}),"POST",{data:o})})))({id:g.id,formData:u,locale:S})):v=yield(({locale:t,formData:a,isArticleComment:o})=>e(void 0,void 0,void 0,(function*(){return yield G(P(o?I.POST.CREATE_ARTICLE_COMMENT:I.POST.CREATE,{_locale:t}),"POST",{data:a})})))({formData:u,locale:S,isArticleComment:!(null==me?void 0:me.id)&&!!(null==me?void 0:me.mappedCategoryId)});const h=null==v?void 0:v.data;(null==h?void 0:h.id)&&!(null===(a=null===(t=null==v?void 0:v.messages)||void 0===t?void 0:t.moderation)||void 0===a?void 0:a.type)?(M({message:B("createPost.popup.success"),type:"success"}),(e=>{n&&n(Ne(e),z),r&&r()})(h)):"banned"===(null===(i=null===(o=null==v?void 0:v.messages)||void 0===o?void 0:o.moderation)||void 0===i?void 0:i.type)?(M({title:B("notification.post.blocked.title"),message:B("notification.post.blocked.message"),type:"danger"}),v.messages.moderation.words&&de(v.messages.moderation.words)):"suspect"===(null===(s=null===(l=null==v?void 0:v.messages)||void 0===l?void 0:l.moderation)||void 0===s?void 0:s.type)?(M({title:B("notification.post.suspect.title"),message:B("notification.post.suspect.message"),type:"warning"}),r&&r()):(null===(d=null===(c=null==v?void 0:v.messages)||void 0===c?void 0:c.find)||void 0===d?void 0:d.call(c,(e=>{var t;return!!(null===(t=null==e?void 0:e.includes)||void 0===t?void 0:t.call(e,"suspend"))})))?(M({message:B("notification.suspend.message"),type:"danger"}),r&&r()):M({message:(null===(m=null==v?void 0:v.messages)||void 0===m?void 0:m[0])||B("notification.failure"),type:"danger"})}));return o.createElement(ga,{className:t,style:a},o.createElement("div",{className:"input-group-container"},o.createElement(to,{className:"input-group",bannedWords:ce,value:Y,onChange:J}),H&&o.createElement(ha,null,o.createElement(X,{isSolid:!0,color:k.colors.red700,size:14}),o.createElement(F,{size:"p3",as:"span",color:k.colors.red700},B("createPost.popup.specialCharErr"))),o.createElement(Ya,{className:"input-group",bannedWords:ce,value:ee,onChange:te,onPreviewUrlChange:ge,onInvalidUrlsChange:he,onImageFilesChange:re,imageFiles:le}),A&&o.createElement(va,{"data-is-marry-baby":L},o.createElement("div",{className:"switch-label"},o.createElement(K,{isMarryBaby:L,size:L?32:24,color:k.colors.primaryBase,className:"label-icon"}),o.createElement("span",{className:"label-txt"},B("createPost.askDoctor"))),o.createElement(Ee,{value:V,choices:[{label:B("createPost.askDoctorChoice.yes"),value:!0,dataEventCategory:"Together",dataEventAction:"Write Post Click - Ask Doctor",dataEventLabel:T},{label:B("createPost.askDoctorChoice.no"),value:!1}],onChange:e=>{"boolean"==typeof e&&(W(!1),D(e))}})),U&&o.createElement(ha,null,o.createElement(X,{isSolid:!0,color:k.colors.red700,size:14}),o.createElement(F,{size:"p3",as:"span",color:k.colors.red700},B("createPost.message.askDoctorRequire"))),o.createElement("div",{className:"input-group"},o.createElement(F,{size:"p4",className:"input-group-label"},B("admin.community")),o.createElement(x,{options:(null==pe?void 0:pe.map((e=>({label:e.name,value:`${e.id||""}-${e.mappedCategoryId||""}`}))))||[],id:"community-picker",placeholder:B("community.choose"),value:ae,dropdownLabelTrackingAttributes:{"data-event-category":"Together","data-event-action":"Write Post Click - Choose Community/Topic","data-event-label":T},onChange:e=>{oe({label:e.label,value:String(e.value)}),ie([])},disabled:!!d}),o.createElement(F,{size:"sm",className:"warning",color:k.colors.gray400},"* ",B("commentPopup.warning.newPost"))),!y&&o.createElement("div",{className:"input-group"},o.createElement(F,{size:"p4",className:"input-group-label"},B("tab.topic")),o.createElement("div",{className:"input-notification"},o.createElement("img",{src:me?"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":ba,loading:"lazy"}),o.createElement(F,{size:"base",color:k.colors.gray500},B(me?"createPost.popup.primary":"createPost.popup.warning"))),me&&o.createElement(oo,{className:"tag-list",communityId:me.id,forceTopics:m,onChange:ie,selectedTopics:ne,noFetch:f,dataEventCategory:"Together",dataEventAction:"Write Post Click - Choose Community/Topic",dataEventLabel:T}))),o.createElement("div",{className:"form-action"},o.createElement("div",{className:"input-group"},o.createElement(h,{className:"swich-input-group",labelPosition:"left",name:"PostAnonymous",checked:O,color:L?"pink":void 0,"data-event-category":"Together","data-event-action":"Write Post Click - Incognito","data-event-label":T,label:o.createElement("div",{className:"switch-label"},o.createElement("img",{className:"label-icon",src:se.getAssetPath("anomyous-avatar.svg"),alt:"anomyous avatar",style:{marginRight:"10px",width:"24px"},loading:"lazy"}),o.createElement("span",{className:"label-txt"},B("createPost.postAnonymous"))),value:"Post Anonymous",onChange:e=>R(e.currentTarget.checked),styles:{body:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"},label:{display:"flex",alignItems:"center"}}})),o.createElement("div",{className:"input-group"},o.createElement($,{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(void 0,void 0,void 0,(function*(){if(fe&&!q){_(!0);try{yield ye()}catch(e){console.error(e),M(ua(B))}_(!1)}})),disabled:!fe,loading:q},B("createPost.popup.submit")))))},lo=pe.div`
|
|
1522
1522
|
[data-type='confirm'] {
|
|
1523
1523
|
width: min(360px, 100%);
|
|
1524
1524
|
height: auto;
|
|
@@ -2598,7 +2598,7 @@ import{a as e,_ as t}from"./tslib.es6-01eae420.js";import*as a from"react";impor
|
|
|
2598
2598
|
justify-content: flex-start;
|
|
2599
2599
|
}
|
|
2600
2600
|
}
|
|
2601
|
-
`,Go=({image:e,showIcon:t=!0})=>{const[a,n]=l(!0);return o.createElement(_o,{"data-is-blurred":a,onClick:e=>a&&e.stopPropagation()},o.createElement("img",{loading:"lazy",className:"img-preview",src:e}),o.createElement(Zo,{onClick:e=>{e.stopPropagation(),n(!a)}},t&&o.createElement(qo,null,a?o.createElement("svg",{width:"22",height:"20",viewBox:"0 0 22 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o.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"})):o.createElement("svg",{width:"23",height:"16",viewBox:"0 0 23 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o.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"})))))},Qo=({className:e,images:t=[],style:a,authorName:n,isSensitive:c=!1,alt:d})=>{const{data:{env:{isMarryBaby:m}}}=i(N),{t:p}=E(),u="+ "+((t.length||0)-4),[g,v]=l(!1),[h,b]=l(-1),f=t.length>5,y=r(!1);return s((()=>()=>{y.current&&he(!1)}),[]),s((()=>{g||h>=0?(he(!0),y.current=!0):(he(!1),y.current=!1)}),[g,h]),o.createElement(o.Fragment,null,c&&o.createElement(jo,{message:p("sensitiveMask.contentWarningDescription"),icon:o.createElement("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o.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"}))}),o.createElement(Lo,{className:e,style:a,"data-image-count":f?5:t.length||0,"data-is-marrybaby":m,"data-cursor-pointer":!c},null==t?void 0:t.slice(0,5).map(((e,t)=>{const a=4===t&&f;return o.createElement("div",{className:"img-wrapper",key:t,onClick:()=>{t>=4&&f?v(!0):b(t)}},c&&o.createElement(Go,{image:e,showIcon:!a}),!m&&o.createElement("img",{loading:"lazy",className:"img-preview-blur",src:e,alt:d}),o.createElement("img",{loading:"lazy",className:"img-preview",src:e,alt:d}),a&&o.createElement("div",{className:"img-more-overlay"},o.createElement(L,{tag:"h1",as:"h2",color:"white"},u)))}))),g&&o.createElement(Bo,{authorName:n||"",images:t,onClose:()=>v(!1),onOpenSingleView:b,alt:d}),h>=0&&o.createElement(Wo,{images:t,initialViewIndex:h,onClose:()=>b(-1),alt:d}))},
|
|
2601
|
+
`,Go=({image:e,showIcon:t=!0})=>{const[a,n]=l(!0);return o.createElement(_o,{"data-is-blurred":a,onClick:e=>a&&e.stopPropagation()},o.createElement("img",{loading:"lazy",className:"img-preview",src:e}),o.createElement(Zo,{onClick:e=>{e.stopPropagation(),n(!a)}},t&&o.createElement(qo,null,a?o.createElement("svg",{width:"22",height:"20",viewBox:"0 0 22 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o.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"})):o.createElement("svg",{width:"23",height:"16",viewBox:"0 0 23 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o.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"})))))},Qo=({className:e,images:t=[],style:a,authorName:n,isSensitive:c=!1,alt:d})=>{const{data:{env:{isMarryBaby:m}}}=i(N),{t:p}=E(),u="+ "+((t.length||0)-4),[g,v]=l(!1),[h,b]=l(-1),f=t.length>5,y=r(!1);return s((()=>()=>{y.current&&he(!1)}),[]),s((()=>{g||h>=0?(he(!0),y.current=!0):(he(!1),y.current=!1)}),[g,h]),o.createElement(o.Fragment,null,c&&o.createElement(jo,{message:p("sensitiveMask.contentWarningDescription"),icon:o.createElement("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o.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"}))}),o.createElement(Lo,{className:e,style:a,"data-image-count":f?5:t.length||0,"data-is-marrybaby":m,"data-cursor-pointer":!c},null==t?void 0:t.slice(0,5).map(((e,t)=>{const a=4===t&&f;return o.createElement("div",{className:"img-wrapper",key:t,onClick:()=>{t>=4&&f?v(!0):b(t)}},c&&o.createElement(Go,{image:e,showIcon:!a}),!m&&o.createElement("img",{loading:"lazy",className:"img-preview-blur",src:e,alt:d}),o.createElement("img",{loading:"lazy",className:"img-preview",src:e,alt:d}),a&&o.createElement("div",{className:"img-more-overlay"},o.createElement(L,{tag:"h1",as:"h2",color:"white"},u)))}))),g&&o.createElement(Bo,{authorName:n||"",images:t,onClose:()=>v(!1),onOpenSingleView:b,alt:d}),h>=0&&o.createElement(Wo,{images:t,initialViewIndex:h,onClose:()=>b(-1),alt:d}))},Xo=pe.div`
|
|
2602
2602
|
.link-info-container {
|
|
2603
2603
|
padding: 0.5rem 1rem;
|
|
2604
2604
|
background: ${e=>e.color||"#f4faff"};
|
|
@@ -2634,7 +2634,7 @@ import{a as e,_ as t}from"./tslib.es6-01eae420.js";import*as a from"react";impor
|
|
|
2634
2634
|
overflow: hidden;
|
|
2635
2635
|
border-radius: 1rem;
|
|
2636
2636
|
}
|
|
2637
|
-
`,Xo=({url:t,image:a,className:n,style:d,autoPlay:p=!0})=>{const{data:{locale:u}}=i(N),[g,v]=l(null);s((()=>{e(void 0,void 0,void 0,(function*(){if(!a){if(!t)return v(null);v((e=>Object.assign(Object.assign({},e),{isFetching:!0}))),z(P(I.FETCH_PREVIEW,{_locale:u}),"POST",{data:{link:t},headers:{"Content-Type":"application/json"}}).then((e=>{var a,o;v({url:t,image:(null===(a=null==e?void 0:e.data)||void 0===a?void 0:a.image)||(null===(o=null==e?void 0:e.data)||void 0===o?void 0:o.logo)})})).catch((()=>{v(null)}))}}))}),[t,a]);const h=a||(null==g?void 0:g.image),b=(null==g?void 0:g.url)||t,f=c((()=>(e=>{var t;return e.includes("youtu")&&(null===(t=/(.*?)(^|\/|v=)([a-z0-9_-]{11})(.*)?/gim.exec(e))||void 0===t?void 0:t[3])||""})(b)),[b]),y=c((()=>b.includes("facebook.com")||b.includes("fb.watch")),[b]),w=r(0),x=r(0),[E,C]=l(!1);s((()=>{const e=()=>{var e;const t=null===(e=k.current)||void 0===e?void 0:e.getBoundingClientRect();let a=!1;t&&(!w.current||Math.abs((w.current-t.width)/(null==t?void 0:t.width))>.2)&&(w.current=Math.floor(t.width),a=!0),t&&(!x.current||Math.abs((x.current-t.height)/(null==t?void 0:t.height))>.2)&&(x.current=Math.floor(t.height),a=!0),a&&C((e=>!e))};return e(),window.addEventListener("resize",e,{passive:!0}),()=>{window.removeEventListener("resize",e)}}),[]);const k=r(null),A=m();return o.createElement(Ko,{className:`${n} no-replace-click`,style:d,ref:k,color:A.colors[A.primaryColor][0]},a||!f&&!y?o.createElement("a",{href:b,target:"_blank",rel:"noreferrer"},o.createElement("div",{className:"link-image-wrapper "+((null==g?void 0:g.isFetching)?"fetching":"")},(null==g?void 0:g.isFetching)?o.createElement($e,{className:"loading-spinner"}):o.createElement(ye,{className:"link-image",src:h||S,backupSrc:S,alt:b}))):o.createElement("div",{className:"link-image-wrapper"},f?o.createElement("iframe",{width:"100%",height:"100%",src:`https://www.youtube.com/embed/${f}?&autoplay=${p?1:0}&mute=1&enablejsapi=1`,frameBorder:"0",allowFullScreen:!0,style:{position:"absolute",top:0,left:0,border:"none",overflow:"hidden"},loading:"lazy"}):y?o.createElement("iframe",{key:String(E),src:`https://www.facebook.com/plugins/video.php?href=${encodeURIComponent(b)}&autoplay=${p?1:0}&show_text=false&t=0&width=${w.current}&height=${x.current}`,style:{position:"absolute",top:"50%",left:"50%",border:"none",overflow:"hidden",height:x.current,width:w.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 $o="PD6nRZX";const Yo=({className:e,size:t="md"})=>{const{t:a}=E();return o.createElement("div",{className:`${$o} ${e}`},o.createElement(Be,{size:t,color:"transparent",isLoading:!0},a("loading")))},Jo=n({});var en="l5fL1xL",tn="L-aGKo7";const an=({children:e,className:t=""})=>o.createElement("div",{className:`${en} ${t}`},e),on=({children:e,className:t=""})=>o.createElement("div",{className:`${tn} ${t}`},e);var nn="eaR8ATZ",ln="xM-7K0a",rn="DZmf3s7";const sn=({src:e,defaultSrc:t=se.getAssetPath("logo/logomark.png"),ratio:a=1,size:n=80,radius:i=8,alt:l,className:r=""})=>o.createElement("div",{className:r},o.createElement("div",{className:rn,style:{width:`${n}px`,height:n*a+"px",borderRadius:`${i}px`}},o.createElement(ye,{src:e,backupSrc:t,alt:l}))),cn=({category:e,title:t,src:a,children:n,className:i=""})=>o.createElement("div",{className:`${nn} ${i}`},o.createElement(sn,{src:a}),o.createElement("div",{className:ln},n||o.createElement("div",null,e&&o.createElement(an,null,e),t&&o.createElement(on,null,t))));cn.CategoryText=an,cn.Title=on;const dn=({featureImage:e,postTitle:t,author:a,categories:n,isReview:i,className:l=""})=>{var r;const s=i?"Medically reviewed by Jobelle Ann Dela Cruz Bigalbal, MD":"Written by Jobelle Ann Dela Cruz Bigalbal, MD";return o.createElement(cn,{src:e,className:l},o.createElement(o.Fragment,null,o.createElement(cn.CategoryText,null,null===(r=null==n?void 0:n[0])||void 0===r?void 0:r.name),o.createElement(cn.Title,null,t),o.createElement(Ot,{avatarProps:Object.assign(Object.assign({},a),{size:32}),subTitle:o.createElement(o.Fragment,null,s,o.createElement(Ot.SubDivider,null),"Dec 12, 2022")})))};var mn={container:"SFSgnOz",header:"Tf3aoVa",heading:"TOt4QXl",headingIcon:"_5XYN1KT",accBodyGroup:"yE-tZRj",accBodyGroupItem:"LXiGuGT",accBodyGroupDesc:"r4rx-6v",subTitle:"XrHh8-C",subIcon:"c5-Yecd",group:"UBj6nWr",groupBody:"_2vptVBd",articleCardLink:"ZPDAwiR",relatedList:"_6wJn-NR",socialItem:"_21XDdFv",mbChevronWrapper:"LSyr3Zo"};const pn=({className:e=""})=>{var t,a,n,l,r;const{t:s}=E(),{info:c,isMarryBaby:d,currentPageUrl:m}=i(Jo),p=null==c?void 0:c.data,g=[{type:"linkedin",icon:se.getAssetPath("linkedin.svg"),url:null===(t=null==c?void 0:c.contact)||void 0===t?void 0:t.linkedin,eventAction:"Doctor Profile - Linkedin"},{type:"instagram",icon:se.getAssetPath("instagram.svg"),url:null===(a=null==c?void 0:c.contact)||void 0===a?void 0:a.instagram,eventAction:"Doctor Profile - Instagram"},{type:"facebook",icon:se.getAssetPath("facebook.svg"),url:null===(n=null==c?void 0:c.contact)||void 0===n?void 0:n.facebook,eventAction:"Doctor Profile - Facebook"},{type:"youtube",icon:se.getAssetPath("youtube.svg"),url:null===(l=null==c?void 0:c.contact)||void 0===l?void 0:l.youtube,eventAction:"Doctor Profile - Youtube"},{type:"tiktok",icon:se.getAssetPath("tiktok.svg"),url:null===(r=null==c?void 0:c.contact)||void 0===r?void 0:r.tiktok,eventAction:"Doctor Profile - TikTok"}],v=[...((null==c?void 0:c.experiences)||[]).length>0?[{key:"experience",heading:s("profilePanel.experience"),iconSrc:se.getAssetPath(d?"award-doc-mb.svg":"award-doc.svg"),eventAction:"Doctor Experience Click",panel:o.createElement("div",{className:mn.accBodyGroup},null==c?void 0:c.experiences.map(((e,t)=>o.createElement("div",{className:mn.accBodyGroupItem,key:String(t)},o.createElement("div",{className:mn.accBodyGroupTitle},e.title),o.createElement("div",{className:mn.accBodyGroupDesc},o.createElement("p",null,e.organization),o.createElement("p",null,e.duration))))))}]:[],...((null==c?void 0:c.educations)||[]).length>0?[{key:"education",heading:s("profilePanel.education"),iconSrc:se.getAssetPath(d?"book-mb.svg":"book.svg"),eventAction:"Doctor Degree Click",panel:o.createElement("div",{className:mn.accBodyGroup},null==c?void 0:c.educations.map(((e,t)=>o.createElement("div",{className:mn.accBodyGroupItem,key:String(t)},o.createElement("div",{className:mn.accBodyGroupTitle},e.schoolName),o.createElement("div",{className:mn.accBodyGroupDesc},o.createElement("p",null,e.study),o.createElement("p",null,e.completedYear))))))}]:[],...((null==c?void 0:c.awards)||[]).length>0?[{key:"awards",heading:s("profilePanel.awards"),iconSrc:se.getAssetPath(d?"award-mb.svg":"award.svg"),eventAction:"Doctor Award Click",panel:o.createElement("div",{className:mn.accBodyGroup},null==c?void 0:c.awards.map(((e,t)=>o.createElement("div",{className:mn.accBodyGroupTitle,key:t},e.title))))}]:[]],h=(null==c?void 0:c.relatedPosts)||[],b=g.filter((e=>e.url));return o.createElement("div",{className:`${mn.container} ${e}`,"data-is-marrybaby":d},v.length>0&&o.createElement(y,{defaultValue:v[0].key,chevron:d?o.createElement("div",{className:mn.mbChevronWrapper},o.createElement(ee,{size:12,color:k.mbColors.midGray})):o.createElement(ee,{color:k.colors.gray400}),styles:{chevron:{"&[data-rotate]":{".minus-path":{display:"block"},".plus-path":{display:"none"}}},content:{display:"flex",flexDirection:"column",gap:"16px",padding:"0"},item:{border:0},control:{paddingLeft:0,"&:hover":{background:"transparent"},"*":{pointerEvents:"none"}}}},v.map((e=>o.createElement(y.Item,{key:e.key,value:e.key},o.createElement(y.Control,{"data-event-category":"Together","data-event-action":e.eventAction,"data-event-label":m},o.createElement("div",{className:mn.header},o.createElement("div",{className:mn.headingIcon},o.createElement("img",{src:e.iconSrc,loading:"lazy"})),o.createElement("div",{className:mn.heading},e.heading))),o.createElement(y.Panel,null,e.panel))))),h.length>0&&o.createElement("div",{className:mn.group},o.createElement("div",{className:mn.subTitle},o.createElement("img",{className:mn.subIcon,src:se.getAssetPath(d?"mb-logo.svg":"logo/circle-solid.svg"),loading:"lazy"}),s("profilePanel.publishedArticles")),o.createElement("div",{className:`${mn.relatedList}`},null==c?void 0:c.relatedPosts.map((e=>o.createElement("a",{key:String(e.id),href:`${window.location.origin}${null==e?void 0:e.permalink}`,className:mn.articleCardLink},o.createElement(dn,Object.assign({className:"article-card"},Object.assign(Object.assign({},e),!e.author&&{author:{displayName:null==p?void 0:p.name,avatar:null==p?void 0:p.avatar}}),{isReview:!0}))))))),b.length>0&&o.createElement("div",{className:mn.group},o.createElement("div",{className:mn.subTitle},o.createElement("img",{className:mn.subIcon,src:se.getAssetPath(d?"social-mb.svg":"social.svg"),loading:"lazy"}),s("profilePanel.socialLinks")),o.createElement("div",{className:mn.groupBody},o.createElement(u,null,g.map(((e,t)=>e.url&&o.createElement("div",{className:mn.socialItem,key:t},o.createElement("a",{href:e.url,target:"_blank",rel:"noreferrer"},o.createElement("img",{src:e.icon,loading:"lazy",width:"32px","data-event-category":"Together","data-event-action":e.eventAction,"data-event-label":m})))))))))};var un={container:"GYUElSy",question:"_3C6QpT1",questionTitle:"_9M9VYL6",community:"_1RuSyv3",questionCard:"_1IG-eEp"};const gn=({post:e,className:t=""})=>{var a,n,l,r,s,c,d,m;const{t:p}=E(),{data:{userInfo:u,env:{togetherBasePath:g}}}=i(N),{authActionWrapper:v,authorProps:h,currentPageUrl:b}=i(Jo),f=`${window.location.origin}${g}/${null===(a=null==e?void 0:e.community)||void 0===a?void 0:a.slug}/${null==e?void 0:e.slug}`;return o.createElement("div",{className:`${un.container} ${t}`},o.createElement("div",{className:un.header},o.createElement("div",{className:un.question},p("profilePanel.question")," ",o.createElement(te,{className:un.questionTitle,href:"#",onClick:()=>{(null==u?void 0:u.id)||null==v||v((()=>window.location.href=f))}},"#",null==e?void 0:e.title)),o.createElement("div",{className:un.community},null===(n=null==e?void 0:e.community)||void 0===n?void 0:n.name," - ",null==e?void 0:e.createdTime)),o.createElement("div",{className:un.questionCard},o.createElement(pa,Object.assign({className:"card-author"},h,{role:"user",avatarIcon:o.createElement(kt,null),subLine:o.createElement(pa.SubTextRow,null,o.createElement(pa.SubText,null,null===(s=null===(r=null===(l=null==e?void 0:e.expertAnswer)||void 0===l?void 0:l.answer)||void 0===r?void 0:r[0])||void 0===s?void 0:s.createdTime))})),o.createElement(To,{className:"post-content-wrapper",description:(null===(m=null===(d=null===(c=null==e?void 0:e.expertAnswer)||void 0===c?void 0:c.answer)||void 0===d?void 0:d[0])||void 0===m?void 0:m.content)||"",mentions:null==e?void 0:e.mentions,"data-testid":"Content of the Post"})),o.createElement($,{variant:"secondary","data-event-category":"Together","data-event-action":"Doctor Reply Click","data-event-label":b,size:"md",onClick:()=>{(null==u?void 0:u.id)?window.location.href=f:null==v||v((()=>window.location.href=f))}},p("profilePanel.anserwing.viewFull")))};var vn="MrdoES3",hn="_8fd7YMs",bn="DomiQfw",fn="-b2qnfL";const yn=({message:e,buttonTxt:t,imgSrc:a,onBtnClick:n})=>{const{siteType:l,isMarryBaby:r}=i(Jo);return o.createElement("div",{className:hn},o.createElement("div",{className:bn},o.createElement("img",{src:a||se.getAssetPath(r?"comments-mb.svg":"comments.svg"),loading:"lazy"})),e&&o.createElement("div",{className:fn},e),t&&o.createElement(Be,{size:"md",theme:l,color:"secondary",onClick:n},t))},wn=({id:t})=>{const{t:a}=E(),{data:{locale:n}}=i(N),{authorProps:r}=i(Jo),[c,d]=l(null),[m,p]=l(!1);return s((()=>{t&&e(void 0,void 0,void 0,(function*(){var e;p(!0);const a=yield z(P(I.USER.LIST_ANSWERS,{_locale:n,id:t}),"GET"),o=((null===(e=null==a?void 0:a.data)||void 0===e?void 0:e.replies)||[]).map(Ne);d(o),p(!1)}))}),[]),o.createElement("div",{className:vn},m?o.createElement(Yo,null):null!==c&&(c.length>0?c.map((e=>o.createElement(gn,{className:"post-card",key:e.id,post:e}))):o.createElement(yn,{message:a("profilePanel.emptyPostMess.content",{name:(null==r?void 0:r.name)||(null==r?void 0:r.username)})})))},xn=e=>{var{size:a,color:n}=e,i=t(e,["size","color"]);return o.createElement("svg",Object.assign({width:a,height:a,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i),o.createElement("path",{d:"M9.99983 9.14326L6.94303 12.2001C6.61183 12.5313 6.07423 12.5313 5.74303 12.2001C5.41183 11.8689 5.41183 11.3313 5.74303 11.0001L9.43423 7.30886C9.74703 6.99606 10.2534 6.99606 10.5654 7.30886L14.2566 11.0001C14.5878 11.3313 14.5878 11.8689 14.2566 12.2001C13.9254 12.5313 13.3878 12.5313 13.0566 12.2001L9.99983 9.14326Z",fill:n}))};xn.defaultProps={size:24,color:k.colors.gray600};var En="toEutn7",Cn="drdisHs";const kn=e=>{var a,n,l,r,{post:s}=e,c=t(e,["post"]);const{data:{env:{togetherBasePath:d}}}=i(N);return o.createElement(o.Fragment,null,o.createElement("div",Object.assign({},c,{className:`${En} ${(null==c?void 0:c.className)||""}`}),o.createElement(pa,{className:"card-author",avatar:null===(a=null==s?void 0:s.author)||void 0===a?void 0:a.avatar,name:(null===(n=null==s?void 0:s.author)||void 0===n?void 0:n.name)||(null===(l=null==s?void 0:s.author)||void 0===l?void 0:l.username),isAnonymous:Boolean(null==s?void 0:s.isAnonymous),subLine:o.createElement(pa.SubTextRow,null,o.createElement(pa.SubText,null,null==s?void 0:s.createdTime))}),o.createElement(te,{href:`${window.location.origin}${d}/${null===(r=null==s?void 0:s.community)||void 0===r?void 0:r.slug}/${null==s?void 0:s.slug}`,className:Cn,rel:"noreferrer"},null==s?void 0:s.title)))};var Nn={accordion:"I-uIJ6E",header:"_41WRsj2",heading:"AcOGL93",headingIcon:"JD3dWJN",panel:"dKAgnS8",chevron:"L2Q9T6m",container:"h-pSmhX"};const An=()=>{var t,a;const{t:n}=E(),{data:{locale:r,userInfo:c}}=i(N),{onSkipQuestion:d,countValues:m,setCountValues:p}=i(Jo),[u,g]=l(),[v,h]=l([]),[b,f]=l(!1),w=null==c?void 0:c.id;s((()=>{w&&e(void 0,void 0,void 0,(function*(){var e;f(!0);const t=yield G(P(I.USER.LIST_QUESTION_NEED_REPLY,{_locale:r}),"GET"),a=[],o=Object.create({});((null===(e=null==t?void 0:t.data)||void 0===e?void 0:e.communities)||[]).filter((e=>((null==e?void 0:e.question)||[]).length>0)).map((e=>{o[e.id]=e.question.map(Ne),delete e.question,a.push(ze(e))})),h(a),g(o),f(!1)}))}),[]);const x=({id:e,communityId:t})=>{if(e&&t&&u){const a=Object.assign(Object.assign({},u),{[t]:[...((null==u?void 0:u[t])||[]).filter((t=>t.id!==e))]});let o=0;Object.keys(a).map((e=>o+=a[e].length||0)),g(a),p(Object.assign(Object.assign({},m),{total_question:o})),null==d||d(o)}};return o.createElement("div",{className:Nn.container},b?o.createElement(Yo,null):(null==m?void 0:m.total_question)>0?v.length>0&&o.createElement(y,{className:Nn.accordion,defaultValue:String((null===(a=v[null===(t=Object.keys(v))||void 0===t?void 0:t[0]])||void 0===a?void 0:a.id)||""),styles:e=>({control:{padding:"16px",border:`1px solid ${e.colors.neutral[1]}`,borderTopLeftRadius:"8px",borderTopRightRadius:"8px",'&[aria-expanded="false"]':{borderBottom:0}},chevron:{width:"32px",height:"32px"},content:{padding:0,border:`1px solid ${e.colors.neutral[1]}`,borderTop:0,borderBottom:0},label:{padding:0},item:{marginBottom:"16px"}}),chevron:o.createElement("div",{className:Nn.chevron},o.createElement(xn,{color:k.colors.gray600,size:20}))},v.map((e=>{const t=u&&(null==u?void 0:u[e.id])||[];return t.length>0&&o.createElement(y.Item,{key:e.id,value:String(e.id)},o.createElement(y.Control,null,o.createElement("div",{className:Nn.header},o.createElement("div",{className:Nn.headingIcon},o.createElement("img",{src:e.thumbnail,loading:"lazy"})),o.createElement("div",{className:Nn.heading},e.name))),o.createElement(y.Panel,null,o.createElement("div",{className:Nn.body},t.map((e=>o.createElement(kn,{className:"question-card",key:e.id,post:e,onSkip:x}))))))}))):o.createElement(yn,{message:n("profilePanel.emptyCareMess.content"),imgSrc:se.getAssetPath("questions.svg")}))};var Tn="GA-zc-O",zn="A18McWD",Pn="IB049vj",In="_8I--vEV";const Sn=({post:e,className:t=""})=>{var a;const{data:{userInfo:n,env:{togetherBasePath:l}}}=i(N),{authActionWrapper:r,authorProps:s}=i(Jo),c=`${window.location.origin}${l}/${null===(a=null==e?void 0:e.community)||void 0===a?void 0:a.slug}/${null==e?void 0:e.slug}`;return o.createElement("div",{className:`${Tn} ${t}`},o.createElement("div",{className:Pn},o.createElement("a",{"data-event-category":"Together","data-event-action":"Click Post","data-event-label":c,className:In,href:c,onClick:e=>{(null==n?void 0:n.id)||(e.preventDefault(),null==r||r((()=>window.location.href=c)))}}),o.createElement(Ot,{className:"card-author",avatarProps:{avatar:null==s?void 0:s.avatar,size:32}},o.createElement(pa.MainText,{className:zn},null==e?void 0:e.title),o.createElement(pa.SubTextRow,null,o.createElement(pa.SubText,null,null==e?void 0:e.createdTime))),o.createElement(To,{className:"post-content-wrapper",description:null==e?void 0:e.description,mentions:null==e?void 0:e.mentions,maxChars:200,"data-testid":"Content of the Post"})))};var Ln="TSMHoEM";const Mn=()=>{const{t:t}=E(),{data:{locale:a}}=i(N),{authorId:n,authorProps:r,isAuthorLogin:c,onCloseFromPost:d}=i(Jo),[m,p]=l(null),[u,g]=l(!1);return s((()=>{n&&e(void 0,void 0,void 0,(function*(){var e;g(!0);const t=yield z(P(I.USER.LIST_POST,{_locale:a,id:n,isAnonymous:0}),"GET"),o=((null===(e=null==t?void 0:t.data)||void 0===e?void 0:e.posts)||[]).map(Ne);p(o),g(!1)}))}),[n]),o.createElement("div",{className:Ln},u?o.createElement(Yo,null):null!==m&&(m.length>0?m.map((e=>o.createElement(Sn,{className:"post-card",key:e.id,post:e}))):o.createElement(yn,{message:t("profilePanel.emptyPostMess.content",{name:(null==r?void 0:r.name)||(null==r?void 0:r.username)||""}),buttonTxt:c&&t("profilePanel.createPost"),onBtnClick:()=>{null==d||d()}})))};var jn="_4Vekw96",Bn="DIJdGcB",Fn="aQSt4-Q";const On=e=>e?{title:null==e?void 0:e.title,organization:null==e?void 0:e.organization,duration:e.duration}:{},Rn=e=>e?{completedYear:null==e?void 0:e.completed_year,schoolName:e.school_name,study:e.study}:{};var Vn,Dn;!function(e){e[e.About=0]="About",e[e.Care=1]="Care",e[e.Answer=2]="Answer",e[e.Posts=3]="Posts"}(Vn||(Vn={})),function(e){e[e.Expert=0]="Expert",e[e.User=1]="User"}(Dn||(Dn={}));const Un=a=>{var n,{authorProps:r,selectedTab:c,authActionWrapper:d,onSkipQuestion:m,onCloseFromPost:p,hideQuestionTab:u,hideAnswerTab:g,showSkipQuestionTag:v,rolesToShowQuestionsTab:h=["expert"],currentPageUrl:b}=a,f=t(a,["authorProps","selectedTab","authActionWrapper","onSkipQuestion","onCloseFromPost","hideQuestionTab","hideAnswerTab","showSkipQuestionTag","rolesToShowQuestionsTab","currentPageUrl"]);const{data:{locale:y,userInfo:w,env:{isMarryBaby:x}}}=i(N),{t:C}=E(),k=null==r?void 0:r.role,A=null==w?void 0:w.role,T=String(null==r?void 0:r.userId),[S,L]=l(),[M,j]=l(!1),[B,F]=l(),O=(null==w?void 0:w._togetherUserId)===(null==r?void 0:r.userId),R=[...-1!==h.indexOf(k)?[{value:Vn.About,text:C("profilePanel.tabs.highlight"),content:o.createElement(pn,{id:T,info:B}),dataEventCategory:"Together",dataEventAction:"Doctor Profile Click",dataEventLabel:b}]:[],{value:Vn.Posts,text:C("profilePanel.tabs.posts"),content:o.createElement(Mn,null),hasCountResult:!0,keyOfCountApi:"post",keyOfResult:"total_post"},...u||-1===h.indexOf(A)||(null==w?void 0:w._togetherUserId)!==(null==r?void 0:r.userId)?[]:[{value:Vn.Care,text:`${C("profilePanel.tabs.care")}`,content:o.createElement(An,null),hasCountResult:!0,keyOfCountApi:"question",keyOfResult:"total_question",dataEventCategory:"Together",dataEventAction:"Doctor Questions Click",dataEventLabel:b}],...g||-1===h.indexOf(k)?[]:[{value:Vn.Answer,text:`${C("profilePanel.tabs.expertAnswer")}`,content:o.createElement(wn,{id:T}),hasCountResult:!0,keyOfCountApi:"reply",keyOfResult:"total_reply",dataEventCategory:"Together",dataEventAction:"Doctor Reply Tab Click",dataEventLabel:b}]],[V,D]=l(null),[U,W]=l(null),H={value:String(U),dataList:V,onTabChange:e=>W(Number(e))},Z=null==R?void 0:R.filter((e=>null==e?void 0:e.hasCountResult));s((()=>{e(void 0,void 0,void 0,(function*(){var e,t,a,o,n,i,l,r,s,d;j(!0);const m=yield Promise.all([z(P(I.USER.DETAIL,{_locale:y,id:T}),"GET"),...Z.map((e=>z(P(I.USER.COUNT_TABS,{_locale:y,id:T,[e.keyOfCountApi]:1}),"GET")))]),[p]=m,u={data:null==p?void 0:p.data,experiences:((null===(t=null===(e=null==p?void 0:p.data)||void 0===e?void 0:e.fields)||void 0===t?void 0:t.experiences)||[]).map(On),relatedPosts:((null===(a=null==p?void 0:p.data)||void 0===a?void 0:a.related_post)||[]).map((e=>Pe(e.post))),educations:((null===(n=null===(o=null==p?void 0:p.data)||void 0===o?void 0:o.fields)||void 0===n?void 0:n.educations)||[]).map(Rn),awards:(null===(l=null===(i=null==p?void 0:p.data)||void 0===i?void 0:i.fields)||void 0===l?void 0:l.awards_accreditations)||[],contact:(null===(s=null===(r=null==p?void 0:p.data)||void 0===r?void 0:r.fields)||void 0===s?void 0:s.contact)||{}};1===(null==p?void 0:p.status)&&F(u);const g=(null==u?void 0:u.relatedPosts)||[],v=Object.keys(u.contact).map((e=>{var t;return""!==(null===(t=null==u?void 0:u.contact)||void 0===t?void 0:t[e])})),h=[...(null==u?void 0:u.experiences)||[],...(null==u?void 0:u.educations)||[],...(null==u?void 0:u.awards)||[]],b=g.length>0||v.length>0||h.length>0,f={},w=Z.map(((e,t)=>{var a,o,n;const i=(null===(n=null===(o=null===(a=m[t+1])||void 0===a?void 0:a.data)||void 0===o?void 0:o.counting)||void 0===n?void 0:n[e.keyOfResult])||0;return i>0?(f[e.keyOfResult]=i,e):-1!==[Vn.Care,Vn.Posts].indexOf(e.value)?e:void 0})).filter(Boolean).map((e=>e.value)),x=R.map((e=>{const t=Object.assign(Object.assign({},e),{text:e.text+(e.keyOfResult?` (${(null==f?void 0:f[e.keyOfResult])||"0"})`:"")});return t.hasCountResult?-1!==w.indexOf(t.value)?t:void 0:t.value===Vn.About?b&&t:t})).filter(Boolean);D(x),W(c||(null===(d=null==x?void 0:x[0])||void 0===d?void 0:d.value)),L(f),j(!1)}))}),[]);const q=null==B?void 0:B.data;return o.createElement(Jo.Provider,{value:{isMarryBaby:x,siteType:x?"marryBaby":"helloSites",authorId:String((null==r?void 0:r.userId)||""),authActionWrapper:d,onSkipQuestion:m,info:B,authorProps:r,onCloseFromPost:p,countValues:S,setCountValues:L,isAuthorLogin:O,showSkipQuestionTag:v,currentPageUrl:b}},o.createElement("div",Object.assign({},f,{className:`${jn} ${(null==f?void 0:f.className)||""}`,"data-is-marrybaby":x}),M?o.createElement(Yo,null):o.createElement(o.Fragment,null,o.createElement(pa,Object.assign({},r,{className:"card-author",showDetailPopup:!1,subLine:"expert"===(null==r?void 0:r.role)?(null==q?void 0:q.specialty)&&(null==q?void 0:q.organisation)&&o.createElement(pa.SubTextRow,null,(null==q?void 0:q.specialty)&&o.createElement(o.Fragment,null,o.createElement(pa.SubText,null,null==q?void 0:q.specialty),o.createElement(pa.SubDivider,null)),o.createElement(pa.SubText,null,null==q?void 0:q.organisation)):(null==q?void 0:q.created_at)&&o.createElement(pa.SubTextRow,null,o.createElement(pa.SubText,null,C("profilePanel.joined")," ",me(null==q?void 0:q.created_at).toNow(!0)))})),"expert"===k&&o.createElement("div",{className:Bn,dangerouslySetInnerHTML:{__html:null===(n=null==B?void 0:B.data)||void 0===n?void 0:n.description}}),null!==V&&null!==U&&(V.length>0?o.createElement("div",{className:Fn},o.createElement(ae,Object.assign({},H))):o.createElement(yn,{message:C("profilePanel.emptyPostMess.content",{text:(null==r?void 0:r.name)||(null==r?void 0:r.username)||""})})))))};var Wn=Object.freeze({__proto__:null,get TabName(){return Vn},get UserType(){return Dn},TabDataInit:{experiences:[],relatedPosts:[],educations:[],awards:[],contact:{},data:{}},ProfileDetail:Un}),Hn="KsWg8i6",Zn="_9tS0EUN",qn="kyyRKlb",_n="-Uqqka-";const Gn=a=>{var{post:n,onSkip:r,btnText:s,currentPageUrl:c}=a,p=t(a,["post","onSkip","btnText","currentPageUrl"]);const{t:u}=E(),{data:{locale:g},action:{pushNotifications:v}}=i(N),[h,b]=l(!1),[f,y]=l(!1),x=m(),C=d((()=>e(void 0,void 0,void 0,(function*(){var e;y(!0);const t=yield G(P(I.USER.SKIP_QUESTION,{_locale:g,id:null==n?void 0:n.id}),"PUT");1===(null==t?void 0:t.status)?(null==r||r({id:(null==n?void 0:n.id)||"",communityId:(null===(e=null==n?void 0:n.community)||void 0===e?void 0:e.id)||""}),b(!1),v({title:"",message:"Skip success",type:"success"})):v({title:"",message:null==t?void 0:t.messages,type:"danger"}),y(!1)}))),[]);return o.createElement(w,{width:327,withArrow:!0,shadow:"md",opened:h},o.createElement(w.Target,null,o.createElement("div",Object.assign({className:`${Hn} ${(null==p?void 0:p.className)||""}`,onClick:()=>b(!0)},p),s||u("profilePanel.questionNotClear"))),o.createElement(w.Dropdown,null,o.createElement("div",null,o.createElement("div",{className:Zn},u("profilePanel.skipQuestion.heading")),o.createElement("div",{className:qn},u("profilePanel.skipQuestion.content")),o.createElement("div",{className:_n},o.createElement($,{size:"md",variant:"secondary",leftIcon:o.createElement(oe,{color:x.fn.primaryColor(),size:24}),onClick:()=>b(!1),styles:()=>({leftIcon:{marginRight:0}})}),o.createElement($,{variant:"primary",size:"md",leftIcon:o.createElement(ne,{color:"white",size:24}),onClick:C,loading:f,"data-event-category":"Together","data-event-action":"Unclear Question Click","data-event-label":c,styles:()=>({leftIcon:{marginRight:0}})})))))};var Qn="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",Kn="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",Xn="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",$n="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",Yn="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",Jn="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 ei=({authorEmail:t,onDeletePost:a,shareUrl:n,post:r,className:s="",popoverClassName:c="",onBookmark:d,onRemoveBookmark:m,onEditPost:p})=>{const{data:{locale:u,userInfo:g,togetherUserId:v,env:{isMarryBaby:h}},action:{pushNotifications:b}}=i(N),{t:f}=E(),[y,w]=l(!1),[x,C]=l(!1),[k,A]=l(!1),{authActionWrapper:T}=Qe(),z=t&&(null==g?void 0:g.email)&&t===String(null==g?void 0:g.email);return o.createElement("div",{className:s,onClick:e=>{e.preventDefault(),e.stopPropagation()}},k&&o.createElement(wo,{url:n,text:null==r?void 0:r.title,onClose:()=>A(!1)}),x&&o.createElement(uo,{thumbnail:se.getAssetPath("trash-bin.svg"),isThumbnailIcon:!0,title:f("popup.deletePost.title"),description:f("popup.deletePost.description"),acceptText:f("popup.deletePost.accept"),cancelText:f("popup.deletePost.cancel"),onAccept:()=>e(void 0,void 0,void 0,(function*(){if((null==r?void 0:r.id)&&!y){w(!0);try{const t=yield(({id:t,locale:a})=>e(void 0,void 0,void 0,(function*(){if(t)return yield G(P(I.POST.DELETE,{id:t,_locale:a}),"DELETE")})))({id:r.id,locale:u});1===(null==t?void 0:t.status)&&(null==a||a())}catch(e){}w(!1)}})),onClose:()=>C(!1)}),o.createElement(wt,{className:c,toggleButtonContent:o.createElement("img",{src:h?Qn:$n,loading:"lazy"}),position:"bottom",align:"end",buttonProps:{isLoading:y},data:z?{isShowheader:!1,type:"list",list:[{icon:Yn,label:f("morePopover.share"),onClick:()=>A(!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:f("actionPopover.edit"),onClick:p},{icon:Jn,label:f("actionPopover.delete"),onClick:()=>{T((()=>C(!0)))}}]}:{isShowheader:!1,type:"list",list:[{icon:Yn,label:f("morePopover.share"),onClick:()=>A(!0)},{icon:(null==r?void 0:r.bookmarked)?Kn:Xn,label:(null==r?void 0:r.bookmarked)?f("morePopover.unsavePost"):f("morePopover.savePost"),onClick:()=>{T((()=>e(void 0,void 0,void 0,(function*(){if((null==g?void 0:g.id)&&(null==r?void 0:r.id))if(null==r?void 0:r.bookmarked){const e=yield G(P(I.BOOKMARK.DELETE,{_locale:u}),"DELETE",{data:{post_id:String(r.id)}});1===(null==e?void 0:e.status)?(b({title:"",message:"Removed saved post",type:"success",displayIcon:Xn}),m&&m()):b({title:"",message:"Remove failed",type:"danger",displayIcon:Xn})}else{const e=yield G(P(I.BOOKMARK.CREATE,{_locale:u}),"POST",{data:{user_id:v||g.id,post_id:r.id}});1===(null==e?void 0:e.status)?(b({title:"",message:"Post saved",type:"success",displayIcon:Kn}),d&&d()):b({title:"",message:"Post saved failed",type:"danger",displayIcon:Xn})}}))))}},{icon:Co,label:f("morePopover.report"),subTree:{title:f("morePopover.report.title"),description:f("morePopover.report.description"),isShowheader:!0,type:"list",list:Object.keys(ie).map((e=>({label:ie[e].label,reason:ie[e].reportReasonText,reasonValue:e}))).map((e=>({label:f(e.label),subTree:{title:f("morePopover.reportSubmit.title"),description:f("morePopover.reportSubmit.description"),isShowheader:!0,type:"jsx",jsxRenderer:t=>o.createElement(ko,{reason:e.reasonValue,reasonText:f(e.reason),postId:null==r?void 0:r.id,onClose:()=>t&&t(!1)})}})))}}]}}))},ti=pe.div`
|
|
2637
|
+
`,Ko=({url:t,image:a,className:n,style:d,autoPlay:p=!0})=>{const{data:{locale:u}}=i(N),[g,v]=l(null);s((()=>{e(void 0,void 0,void 0,(function*(){if(!a){if(!t)return v(null);v((e=>Object.assign(Object.assign({},e),{isFetching:!0}))),z(P(I.FETCH_PREVIEW,{_locale:u}),"POST",{data:{link:t},headers:{"Content-Type":"application/json"}}).then((e=>{var a,o;v({url:t,image:(null===(a=null==e?void 0:e.data)||void 0===a?void 0:a.image)||(null===(o=null==e?void 0:e.data)||void 0===o?void 0:o.logo)})})).catch((()=>{v(null)}))}}))}),[t,a]);const h=a||(null==g?void 0:g.image),b=(null==g?void 0:g.url)||t,f=c((()=>(e=>{var t;return e.includes("youtu")&&(null===(t=/(.*?)(^|\/|v=)([a-z0-9_-]{11})(.*)?/gim.exec(e))||void 0===t?void 0:t[3])||""})(b)),[b]),y=c((()=>b.includes("facebook.com")||b.includes("fb.watch")),[b]),w=r(0),x=r(0),[E,C]=l(!1);s((()=>{const e=()=>{var e;const t=null===(e=k.current)||void 0===e?void 0:e.getBoundingClientRect();let a=!1;t&&(!w.current||Math.abs((w.current-t.width)/(null==t?void 0:t.width))>.2)&&(w.current=Math.floor(t.width),a=!0),t&&(!x.current||Math.abs((x.current-t.height)/(null==t?void 0:t.height))>.2)&&(x.current=Math.floor(t.height),a=!0),a&&C((e=>!e))};return e(),window.addEventListener("resize",e,{passive:!0}),()=>{window.removeEventListener("resize",e)}}),[]);const k=r(null),A=m();return o.createElement(Xo,{className:`${n} no-replace-click`,style:d,ref:k,color:A.colors[A.primaryColor][0]},a||!f&&!y?o.createElement("a",{href:b,target:"_blank",rel:"noreferrer"},o.createElement("div",{className:"link-image-wrapper "+((null==g?void 0:g.isFetching)?"fetching":"")},(null==g?void 0:g.isFetching)?o.createElement($e,{className:"loading-spinner"}):o.createElement(ye,{className:"link-image",src:h||S,backupSrc:S,alt:b}))):o.createElement("div",{className:"link-image-wrapper"},f?o.createElement("iframe",{width:"100%",height:"100%",src:`https://www.youtube.com/embed/${f}?&autoplay=${p?1:0}&mute=1&enablejsapi=1`,frameBorder:"0",allowFullScreen:!0,style:{position:"absolute",top:0,left:0,border:"none",overflow:"hidden"},loading:"lazy"}):y?o.createElement("iframe",{key:String(E),src:`https://www.facebook.com/plugins/video.php?href=${encodeURIComponent(b)}&autoplay=${p?1:0}&show_text=false&t=0&width=${w.current}&height=${x.current}`,style:{position:"absolute",top:"50%",left:"50%",border:"none",overflow:"hidden",height:x.current,width:w.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 $o="PD6nRZX";const Yo=({className:e,size:t="md"})=>{const{t:a}=E();return o.createElement("div",{className:`${$o} ${e}`},o.createElement(Be,{size:t,color:"transparent",isLoading:!0},a("loading")))},Jo=n({});var en="l5fL1xL",tn="L-aGKo7";const an=({children:e,className:t=""})=>o.createElement("div",{className:`${en} ${t}`},e),on=({children:e,className:t=""})=>o.createElement("div",{className:`${tn} ${t}`},e);var nn="eaR8ATZ",ln="xM-7K0a",rn="DZmf3s7";const sn=({src:e,defaultSrc:t=se.getAssetPath("logo/logomark.png"),ratio:a=1,size:n=80,radius:i=8,alt:l,className:r=""})=>o.createElement("div",{className:r},o.createElement("div",{className:rn,style:{width:`${n}px`,height:n*a+"px",borderRadius:`${i}px`}},o.createElement(ye,{src:e,backupSrc:t,alt:l}))),cn=({category:e,title:t,src:a,children:n,className:i=""})=>o.createElement("div",{className:`${nn} ${i}`},o.createElement(sn,{src:a}),o.createElement("div",{className:ln},n||o.createElement("div",null,e&&o.createElement(an,null,e),t&&o.createElement(on,null,t))));cn.CategoryText=an,cn.Title=on;const dn=({featureImage:e,postTitle:t,author:a,categories:n,isReview:i,className:l=""})=>{var r;const s=i?"Medically reviewed by Jobelle Ann Dela Cruz Bigalbal, MD":"Written by Jobelle Ann Dela Cruz Bigalbal, MD";return o.createElement(cn,{src:e,className:l},o.createElement(o.Fragment,null,o.createElement(cn.CategoryText,null,null===(r=null==n?void 0:n[0])||void 0===r?void 0:r.name),o.createElement(cn.Title,null,t),o.createElement(Ot,{avatarProps:Object.assign(Object.assign({},a),{size:32}),subTitle:o.createElement(o.Fragment,null,s,o.createElement(Ot.SubDivider,null),"Dec 12, 2022")})))};var mn={container:"SFSgnOz",header:"Tf3aoVa",heading:"TOt4QXl",headingIcon:"_5XYN1KT",accBodyGroup:"yE-tZRj",accBodyGroupItem:"LXiGuGT",accBodyGroupDesc:"r4rx-6v",subTitle:"XrHh8-C",subIcon:"c5-Yecd",group:"UBj6nWr",groupBody:"_2vptVBd",articleCardLink:"ZPDAwiR",relatedList:"_6wJn-NR",socialItem:"_21XDdFv",mbChevronWrapper:"LSyr3Zo"};const pn=({className:e=""})=>{var t,a,n,l,r;const{t:s}=E(),{info:c,isMarryBaby:d,currentPageUrl:m}=i(Jo),p=null==c?void 0:c.data,g=[{type:"linkedin",icon:se.getAssetPath("linkedin.svg"),url:null===(t=null==c?void 0:c.contact)||void 0===t?void 0:t.linkedin,eventAction:"Doctor Profile - Linkedin"},{type:"instagram",icon:se.getAssetPath("instagram.svg"),url:null===(a=null==c?void 0:c.contact)||void 0===a?void 0:a.instagram,eventAction:"Doctor Profile - Instagram"},{type:"facebook",icon:se.getAssetPath("facebook.svg"),url:null===(n=null==c?void 0:c.contact)||void 0===n?void 0:n.facebook,eventAction:"Doctor Profile - Facebook"},{type:"youtube",icon:se.getAssetPath("youtube.svg"),url:null===(l=null==c?void 0:c.contact)||void 0===l?void 0:l.youtube,eventAction:"Doctor Profile - Youtube"},{type:"tiktok",icon:se.getAssetPath("tiktok.svg"),url:null===(r=null==c?void 0:c.contact)||void 0===r?void 0:r.tiktok,eventAction:"Doctor Profile - TikTok"}],v=[...((null==c?void 0:c.experiences)||[]).length>0?[{key:"experience",heading:s("profilePanel.experience"),iconSrc:se.getAssetPath(d?"award-doc-mb.svg":"award-doc.svg"),eventAction:"Doctor Experience Click",panel:o.createElement("div",{className:mn.accBodyGroup},null==c?void 0:c.experiences.map(((e,t)=>o.createElement("div",{className:mn.accBodyGroupItem,key:String(t)},o.createElement("div",{className:mn.accBodyGroupTitle},e.title),o.createElement("div",{className:mn.accBodyGroupDesc},o.createElement("p",null,e.organization),o.createElement("p",null,e.duration))))))}]:[],...((null==c?void 0:c.educations)||[]).length>0?[{key:"education",heading:s("profilePanel.education"),iconSrc:se.getAssetPath(d?"book-mb.svg":"book.svg"),eventAction:"Doctor Degree Click",panel:o.createElement("div",{className:mn.accBodyGroup},null==c?void 0:c.educations.map(((e,t)=>o.createElement("div",{className:mn.accBodyGroupItem,key:String(t)},o.createElement("div",{className:mn.accBodyGroupTitle},e.schoolName),o.createElement("div",{className:mn.accBodyGroupDesc},o.createElement("p",null,e.study),o.createElement("p",null,e.completedYear))))))}]:[],...((null==c?void 0:c.awards)||[]).length>0?[{key:"awards",heading:s("profilePanel.awards"),iconSrc:se.getAssetPath(d?"award-mb.svg":"award.svg"),eventAction:"Doctor Award Click",panel:o.createElement("div",{className:mn.accBodyGroup},null==c?void 0:c.awards.map(((e,t)=>o.createElement("div",{className:mn.accBodyGroupTitle,key:t},e.title))))}]:[]],h=(null==c?void 0:c.relatedPosts)||[],b=g.filter((e=>e.url));return o.createElement("div",{className:`${mn.container} ${e}`,"data-is-marrybaby":d},v.length>0&&o.createElement(y,{defaultValue:v[0].key,chevron:d?o.createElement("div",{className:mn.mbChevronWrapper},o.createElement(ee,{size:12,color:k.mbColors.midGray})):o.createElement(ee,{color:k.colors.gray400}),styles:{chevron:{"&[data-rotate]":{".minus-path":{display:"block"},".plus-path":{display:"none"}}},content:{display:"flex",flexDirection:"column",gap:"16px",padding:"0"},item:{border:0},control:{paddingLeft:0,"&:hover":{background:"transparent"},"*":{pointerEvents:"none"}}}},v.map((e=>o.createElement(y.Item,{key:e.key,value:e.key},o.createElement(y.Control,{"data-event-category":"Together","data-event-action":e.eventAction,"data-event-label":m},o.createElement("div",{className:mn.header},o.createElement("div",{className:mn.headingIcon},o.createElement("img",{src:e.iconSrc,loading:"lazy"})),o.createElement("div",{className:mn.heading},e.heading))),o.createElement(y.Panel,null,e.panel))))),h.length>0&&o.createElement("div",{className:mn.group},o.createElement("div",{className:mn.subTitle},o.createElement("img",{className:mn.subIcon,src:se.getAssetPath(d?"mb-logo.svg":"logo/circle-solid.svg"),loading:"lazy"}),s("profilePanel.publishedArticles")),o.createElement("div",{className:`${mn.relatedList}`},null==c?void 0:c.relatedPosts.map((e=>o.createElement("a",{key:String(e.id),href:`${window.location.origin}${null==e?void 0:e.permalink}`,className:mn.articleCardLink},o.createElement(dn,Object.assign({className:"article-card"},Object.assign(Object.assign({},e),!e.author&&{author:{displayName:null==p?void 0:p.name,avatar:null==p?void 0:p.avatar}}),{isReview:!0}))))))),b.length>0&&o.createElement("div",{className:mn.group},o.createElement("div",{className:mn.subTitle},o.createElement("img",{className:mn.subIcon,src:se.getAssetPath(d?"social-mb.svg":"social.svg"),loading:"lazy"}),s("profilePanel.socialLinks")),o.createElement("div",{className:mn.groupBody},o.createElement(u,null,g.map(((e,t)=>e.url&&o.createElement("div",{className:mn.socialItem,key:t},o.createElement("a",{href:e.url,target:"_blank",rel:"noreferrer"},o.createElement("img",{src:e.icon,loading:"lazy",width:"32px","data-event-category":"Together","data-event-action":e.eventAction,"data-event-label":m})))))))))};var un={container:"GYUElSy",question:"_3C6QpT1",questionTitle:"_9M9VYL6",community:"_1RuSyv3",questionCard:"_1IG-eEp"};const gn=({post:e,className:t=""})=>{var a,n,l,r,s,c,d,m;const{t:p}=E(),{data:{userInfo:u,env:{togetherBasePath:g}}}=i(N),{authActionWrapper:v,authorProps:h,currentPageUrl:b}=i(Jo),f=`${window.location.origin}${g}/${null===(a=null==e?void 0:e.community)||void 0===a?void 0:a.slug}/${null==e?void 0:e.slug}`;return o.createElement("div",{className:`${un.container} ${t}`},o.createElement("div",{className:un.header},o.createElement("div",{className:un.question},p("profilePanel.question")," ",o.createElement(te,{className:un.questionTitle,href:"#",onClick:()=>{(null==u?void 0:u.id)||null==v||v((()=>window.location.href=f))}},"#",null==e?void 0:e.title)),o.createElement("div",{className:un.community},null===(n=null==e?void 0:e.community)||void 0===n?void 0:n.name," - ",null==e?void 0:e.createdTime)),o.createElement("div",{className:un.questionCard},o.createElement(pa,Object.assign({className:"card-author"},h,{role:"user",avatarIcon:o.createElement(kt,null),subLine:o.createElement(pa.SubTextRow,null,o.createElement(pa.SubText,null,null===(s=null===(r=null===(l=null==e?void 0:e.expertAnswer)||void 0===l?void 0:l.answer)||void 0===r?void 0:r[0])||void 0===s?void 0:s.createdTime))})),o.createElement(To,{className:"post-content-wrapper",description:(null===(m=null===(d=null===(c=null==e?void 0:e.expertAnswer)||void 0===c?void 0:c.answer)||void 0===d?void 0:d[0])||void 0===m?void 0:m.content)||"",mentions:null==e?void 0:e.mentions,"data-testid":"Content of the Post"})),o.createElement($,{variant:"secondary","data-event-category":"Together","data-event-action":"Doctor Reply Click","data-event-label":b,size:"md",onClick:()=>{(null==u?void 0:u.id)?window.location.href=f:null==v||v((()=>window.location.href=f))}},p("profilePanel.anserwing.viewFull")))};var vn="MrdoES3",hn="_8fd7YMs",bn="DomiQfw",fn="-b2qnfL";const yn=({message:e,buttonTxt:t,imgSrc:a,onBtnClick:n})=>{const{siteType:l,isMarryBaby:r}=i(Jo);return o.createElement("div",{className:hn},o.createElement("div",{className:bn},o.createElement("img",{src:a||se.getAssetPath(r?"comments-mb.svg":"comments.svg"),loading:"lazy"})),e&&o.createElement("div",{className:fn},e),t&&o.createElement(Be,{size:"md",theme:l,color:"secondary",onClick:n},t))},wn=({id:t})=>{const{t:a}=E(),{data:{locale:n}}=i(N),{authorProps:r}=i(Jo),[c,d]=l(null),[m,p]=l(!1);return s((()=>{t&&e(void 0,void 0,void 0,(function*(){var e;p(!0);const a=yield z(P(I.USER.LIST_ANSWERS,{_locale:n,id:t}),"GET"),o=((null===(e=null==a?void 0:a.data)||void 0===e?void 0:e.replies)||[]).map(Ne);d(o),p(!1)}))}),[]),o.createElement("div",{className:vn},m?o.createElement(Yo,null):null!==c&&(c.length>0?c.map((e=>o.createElement(gn,{className:"post-card",key:e.id,post:e}))):o.createElement(yn,{message:a("profilePanel.emptyPostMess.content",{name:(null==r?void 0:r.name)||(null==r?void 0:r.username)})})))},xn=e=>{var{size:a,color:n}=e,i=t(e,["size","color"]);return o.createElement("svg",Object.assign({width:a,height:a,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i),o.createElement("path",{d:"M9.99983 9.14326L6.94303 12.2001C6.61183 12.5313 6.07423 12.5313 5.74303 12.2001C5.41183 11.8689 5.41183 11.3313 5.74303 11.0001L9.43423 7.30886C9.74703 6.99606 10.2534 6.99606 10.5654 7.30886L14.2566 11.0001C14.5878 11.3313 14.5878 11.8689 14.2566 12.2001C13.9254 12.5313 13.3878 12.5313 13.0566 12.2001L9.99983 9.14326Z",fill:n}))};xn.defaultProps={size:24,color:k.colors.gray600};var En="toEutn7",Cn="drdisHs";const kn=e=>{var a,n,l,r,{post:s}=e,c=t(e,["post"]);const{data:{env:{togetherBasePath:d}}}=i(N);return o.createElement(o.Fragment,null,o.createElement("div",Object.assign({},c,{className:`${En} ${(null==c?void 0:c.className)||""}`}),o.createElement(pa,{className:"card-author",avatar:null===(a=null==s?void 0:s.author)||void 0===a?void 0:a.avatar,name:(null===(n=null==s?void 0:s.author)||void 0===n?void 0:n.name)||(null===(l=null==s?void 0:s.author)||void 0===l?void 0:l.username),isAnonymous:Boolean(null==s?void 0:s.isAnonymous),subLine:o.createElement(pa.SubTextRow,null,o.createElement(pa.SubText,null,null==s?void 0:s.createdTime))}),o.createElement(te,{href:`${window.location.origin}${d}/${null===(r=null==s?void 0:s.community)||void 0===r?void 0:r.slug}/${null==s?void 0:s.slug}`,className:Cn,rel:"noreferrer"},null==s?void 0:s.title)))};var Nn={accordion:"I-uIJ6E",header:"_41WRsj2",heading:"AcOGL93",headingIcon:"JD3dWJN",panel:"dKAgnS8",chevron:"L2Q9T6m",container:"h-pSmhX"};const An=()=>{var t,a;const{t:n}=E(),{data:{locale:r,userInfo:c}}=i(N),{onSkipQuestion:d,countValues:m,setCountValues:p}=i(Jo),[u,g]=l(),[v,h]=l([]),[b,f]=l(!1),w=null==c?void 0:c.id;s((()=>{w&&e(void 0,void 0,void 0,(function*(){var e;f(!0);const t=yield G(P(I.USER.LIST_QUESTION_NEED_REPLY,{_locale:r}),"GET"),a=[],o=Object.create({});((null===(e=null==t?void 0:t.data)||void 0===e?void 0:e.communities)||[]).filter((e=>((null==e?void 0:e.question)||[]).length>0)).map((e=>{o[e.id]=e.question.map(Ne),delete e.question,a.push(ze(e))})),h(a),g(o),f(!1)}))}),[]);const x=({id:e,communityId:t})=>{if(e&&t&&u){const a=Object.assign(Object.assign({},u),{[t]:[...((null==u?void 0:u[t])||[]).filter((t=>t.id!==e))]});let o=0;Object.keys(a).map((e=>o+=a[e].length||0)),g(a),p(Object.assign(Object.assign({},m),{total_question:o})),null==d||d(o)}};return o.createElement("div",{className:Nn.container},b?o.createElement(Yo,null):(null==m?void 0:m.total_question)>0?v.length>0&&o.createElement(y,{className:Nn.accordion,defaultValue:String((null===(a=v[null===(t=Object.keys(v))||void 0===t?void 0:t[0]])||void 0===a?void 0:a.id)||""),styles:e=>({control:{padding:"16px",border:`1px solid ${e.colors.neutral[1]}`,borderTopLeftRadius:"8px",borderTopRightRadius:"8px",'&[aria-expanded="false"]':{borderBottom:0}},chevron:{width:"32px",height:"32px"},content:{padding:0,border:`1px solid ${e.colors.neutral[1]}`,borderTop:0,borderBottom:0},label:{padding:0},item:{marginBottom:"16px"}}),chevron:o.createElement("div",{className:Nn.chevron},o.createElement(xn,{color:k.colors.gray600,size:20}))},v.map((e=>{const t=u&&(null==u?void 0:u[e.id])||[];return t.length>0&&o.createElement(y.Item,{key:e.id,value:String(e.id)},o.createElement(y.Control,null,o.createElement("div",{className:Nn.header},o.createElement("div",{className:Nn.headingIcon},o.createElement("img",{src:e.thumbnail,loading:"lazy"})),o.createElement("div",{className:Nn.heading},e.name))),o.createElement(y.Panel,null,o.createElement("div",{className:Nn.body},t.map((e=>o.createElement(kn,{className:"question-card",key:e.id,post:e,onSkip:x}))))))}))):o.createElement(yn,{message:n("profilePanel.emptyCareMess.content"),imgSrc:se.getAssetPath("questions.svg")}))};var Tn="GA-zc-O",zn="A18McWD",Pn="IB049vj",In="_8I--vEV";const Sn=({post:e,className:t=""})=>{var a;const{data:{userInfo:n,env:{togetherBasePath:l}}}=i(N),{authActionWrapper:r,authorProps:s}=i(Jo),c=`${window.location.origin}${l}/${null===(a=null==e?void 0:e.community)||void 0===a?void 0:a.slug}/${null==e?void 0:e.slug}`;return o.createElement("div",{className:`${Tn} ${t}`},o.createElement("div",{className:Pn},o.createElement("a",{"data-event-category":"Together","data-event-action":"Click Post","data-event-label":c,className:In,href:c,onClick:e=>{(null==n?void 0:n.id)||(e.preventDefault(),null==r||r((()=>window.location.href=c)))}}),o.createElement(Ot,{className:"card-author",avatarProps:{avatar:null==s?void 0:s.avatar,size:32}},o.createElement(pa.MainText,{className:zn},null==e?void 0:e.title),o.createElement(pa.SubTextRow,null,o.createElement(pa.SubText,null,null==e?void 0:e.createdTime))),o.createElement(To,{className:"post-content-wrapper",description:null==e?void 0:e.description,mentions:null==e?void 0:e.mentions,maxChars:200,"data-testid":"Content of the Post"})))};var Ln="TSMHoEM";const Mn=()=>{const{t:t}=E(),{data:{locale:a}}=i(N),{authorId:n,authorProps:r,isAuthorLogin:c,onCloseFromPost:d}=i(Jo),[m,p]=l(null),[u,g]=l(!1);return s((()=>{n&&e(void 0,void 0,void 0,(function*(){var e;g(!0);const t=yield z(P(I.USER.LIST_POST,{_locale:a,id:n,isAnonymous:0}),"GET"),o=((null===(e=null==t?void 0:t.data)||void 0===e?void 0:e.posts)||[]).map(Ne);p(o),g(!1)}))}),[n]),o.createElement("div",{className:Ln},u?o.createElement(Yo,null):null!==m&&(m.length>0?m.map((e=>o.createElement(Sn,{className:"post-card",key:e.id,post:e}))):o.createElement(yn,{message:t("profilePanel.emptyPostMess.content",{name:(null==r?void 0:r.name)||(null==r?void 0:r.username)||""}),buttonTxt:c&&t("profilePanel.createPost"),onBtnClick:()=>{null==d||d()}})))};var jn="_4Vekw96",Bn="DIJdGcB",Fn="aQSt4-Q";const On=e=>e?{title:null==e?void 0:e.title,organization:null==e?void 0:e.organization,duration:e.duration}:{},Rn=e=>e?{completedYear:null==e?void 0:e.completed_year,schoolName:e.school_name,study:e.study}:{};var Vn,Dn;!function(e){e[e.About=0]="About",e[e.Care=1]="Care",e[e.Answer=2]="Answer",e[e.Posts=3]="Posts"}(Vn||(Vn={})),function(e){e[e.Expert=0]="Expert",e[e.User=1]="User"}(Dn||(Dn={}));const Un=a=>{var n,{authorProps:r,selectedTab:c,authActionWrapper:d,onSkipQuestion:m,onCloseFromPost:p,hideQuestionTab:u,hideAnswerTab:g,showSkipQuestionTag:v,rolesToShowQuestionsTab:h=["expert"],currentPageUrl:b}=a,f=t(a,["authorProps","selectedTab","authActionWrapper","onSkipQuestion","onCloseFromPost","hideQuestionTab","hideAnswerTab","showSkipQuestionTag","rolesToShowQuestionsTab","currentPageUrl"]);const{data:{locale:y,userInfo:w,env:{isMarryBaby:x}}}=i(N),{t:C}=E(),k=null==r?void 0:r.role,A=null==w?void 0:w.role,T=String(null==r?void 0:r.userId),[S,L]=l(),[M,j]=l(!1),[B,F]=l(),O=(null==w?void 0:w._togetherUserId)===(null==r?void 0:r.userId),R=[...-1!==h.indexOf(k)?[{value:Vn.About,text:C("profilePanel.tabs.highlight"),content:o.createElement(pn,{id:T,info:B}),dataEventCategory:"Together",dataEventAction:"Doctor Profile Click",dataEventLabel:b}]:[],{value:Vn.Posts,text:C("profilePanel.tabs.posts"),content:o.createElement(Mn,null),hasCountResult:!0,keyOfCountApi:"post",keyOfResult:"total_post"},...u||-1===h.indexOf(A)||(null==w?void 0:w._togetherUserId)!==(null==r?void 0:r.userId)?[]:[{value:Vn.Care,text:`${C("profilePanel.tabs.care")}`,content:o.createElement(An,null),hasCountResult:!0,keyOfCountApi:"question",keyOfResult:"total_question",dataEventCategory:"Together",dataEventAction:"Doctor Questions Click",dataEventLabel:b}],...g||-1===h.indexOf(k)?[]:[{value:Vn.Answer,text:`${C("profilePanel.tabs.expertAnswer")}`,content:o.createElement(wn,{id:T}),hasCountResult:!0,keyOfCountApi:"reply",keyOfResult:"total_reply",dataEventCategory:"Together",dataEventAction:"Doctor Reply Tab Click",dataEventLabel:b}]],[V,D]=l(null),[U,W]=l(null),H={value:String(U),dataList:V,onTabChange:e=>W(Number(e))},Z=null==R?void 0:R.filter((e=>null==e?void 0:e.hasCountResult));s((()=>{e(void 0,void 0,void 0,(function*(){var e,t,a,o,n,i,l,r,s,d;j(!0);const m=yield Promise.all([z(P(I.USER.DETAIL,{_locale:y,id:T}),"GET"),...Z.map((e=>z(P(I.USER.COUNT_TABS,{_locale:y,id:T,[e.keyOfCountApi]:1}),"GET")))]),[p]=m,u={data:null==p?void 0:p.data,experiences:((null===(t=null===(e=null==p?void 0:p.data)||void 0===e?void 0:e.fields)||void 0===t?void 0:t.experiences)||[]).map(On),relatedPosts:((null===(a=null==p?void 0:p.data)||void 0===a?void 0:a.related_post)||[]).map((e=>Pe(e.post))),educations:((null===(n=null===(o=null==p?void 0:p.data)||void 0===o?void 0:o.fields)||void 0===n?void 0:n.educations)||[]).map(Rn),awards:(null===(l=null===(i=null==p?void 0:p.data)||void 0===i?void 0:i.fields)||void 0===l?void 0:l.awards_accreditations)||[],contact:(null===(s=null===(r=null==p?void 0:p.data)||void 0===r?void 0:r.fields)||void 0===s?void 0:s.contact)||{}};1===(null==p?void 0:p.status)&&F(u);const g=(null==u?void 0:u.relatedPosts)||[],v=Object.keys(u.contact).map((e=>{var t;return""!==(null===(t=null==u?void 0:u.contact)||void 0===t?void 0:t[e])})),h=[...(null==u?void 0:u.experiences)||[],...(null==u?void 0:u.educations)||[],...(null==u?void 0:u.awards)||[]],b=g.length>0||v.length>0||h.length>0,f={},w=Z.map(((e,t)=>{var a,o,n;const i=(null===(n=null===(o=null===(a=m[t+1])||void 0===a?void 0:a.data)||void 0===o?void 0:o.counting)||void 0===n?void 0:n[e.keyOfResult])||0;return i>0?(f[e.keyOfResult]=i,e):-1!==[Vn.Care,Vn.Posts].indexOf(e.value)?e:void 0})).filter(Boolean).map((e=>e.value)),x=R.map((e=>{const t=Object.assign(Object.assign({},e),{text:e.text+(e.keyOfResult?` (${(null==f?void 0:f[e.keyOfResult])||"0"})`:"")});return t.hasCountResult?-1!==w.indexOf(t.value)?t:void 0:t.value===Vn.About?b&&t:t})).filter(Boolean);D(x),W(c||(null===(d=null==x?void 0:x[0])||void 0===d?void 0:d.value)),L(f),j(!1)}))}),[]);const q=null==B?void 0:B.data;return o.createElement(Jo.Provider,{value:{isMarryBaby:x,siteType:x?"marryBaby":"helloSites",authorId:String((null==r?void 0:r.userId)||""),authActionWrapper:d,onSkipQuestion:m,info:B,authorProps:r,onCloseFromPost:p,countValues:S,setCountValues:L,isAuthorLogin:O,showSkipQuestionTag:v,currentPageUrl:b}},o.createElement("div",Object.assign({},f,{className:`${jn} ${(null==f?void 0:f.className)||""}`,"data-is-marrybaby":x}),M?o.createElement(Yo,null):o.createElement(o.Fragment,null,o.createElement(pa,Object.assign({},r,{className:"card-author",showDetailPopup:!1,subLine:"expert"===(null==r?void 0:r.role)?(null==q?void 0:q.specialty)&&(null==q?void 0:q.organisation)&&o.createElement(pa.SubTextRow,null,(null==q?void 0:q.specialty)&&o.createElement(o.Fragment,null,o.createElement(pa.SubText,null,null==q?void 0:q.specialty),o.createElement(pa.SubDivider,null)),o.createElement(pa.SubText,null,null==q?void 0:q.organisation)):(null==q?void 0:q.created_at)&&o.createElement(pa.SubTextRow,null,o.createElement(pa.SubText,null,C("profilePanel.joined")," ",me(null==q?void 0:q.created_at).toNow(!0)))})),"expert"===k&&o.createElement("div",{className:Bn,dangerouslySetInnerHTML:{__html:null===(n=null==B?void 0:B.data)||void 0===n?void 0:n.description}}),null!==V&&null!==U&&(V.length>0?o.createElement("div",{className:Fn},o.createElement(ae,Object.assign({},H))):o.createElement(yn,{message:C("profilePanel.emptyPostMess.content",{text:(null==r?void 0:r.name)||(null==r?void 0:r.username)||""})})))))};var Wn=Object.freeze({__proto__:null,get TabName(){return Vn},get UserType(){return Dn},TabDataInit:{experiences:[],relatedPosts:[],educations:[],awards:[],contact:{},data:{}},ProfileDetail:Un}),Hn="KsWg8i6",Zn="_9tS0EUN",qn="kyyRKlb",_n="-Uqqka-";const Gn=a=>{var{post:n,onSkip:r,btnText:s,currentPageUrl:c}=a,p=t(a,["post","onSkip","btnText","currentPageUrl"]);const{t:u}=E(),{data:{locale:g},action:{pushNotifications:v}}=i(N),[h,b]=l(!1),[f,y]=l(!1),x=m(),C=d((()=>e(void 0,void 0,void 0,(function*(){var e;y(!0);const t=yield G(P(I.USER.SKIP_QUESTION,{_locale:g,id:null==n?void 0:n.id}),"PUT");1===(null==t?void 0:t.status)?(null==r||r({id:(null==n?void 0:n.id)||"",communityId:(null===(e=null==n?void 0:n.community)||void 0===e?void 0:e.id)||""}),b(!1),v({title:"",message:"Skip success",type:"success"})):v({title:"",message:null==t?void 0:t.messages,type:"danger"}),y(!1)}))),[]);return o.createElement(w,{width:327,withArrow:!0,shadow:"md",opened:h},o.createElement(w.Target,null,o.createElement("div",Object.assign({className:`${Hn} ${(null==p?void 0:p.className)||""}`,onClick:()=>b(!0)},p),s||u("profilePanel.questionNotClear"))),o.createElement(w.Dropdown,null,o.createElement("div",null,o.createElement("div",{className:Zn},u("profilePanel.skipQuestion.heading")),o.createElement("div",{className:qn},u("profilePanel.skipQuestion.content")),o.createElement("div",{className:_n},o.createElement($,{size:"md",variant:"secondary",leftIcon:o.createElement(oe,{color:x.fn.primaryColor(),size:24}),onClick:()=>b(!1),styles:()=>({leftIcon:{marginRight:0}})}),o.createElement($,{variant:"primary",size:"md",leftIcon:o.createElement(ne,{color:"white",size:24}),onClick:C,loading:f,"data-event-category":"Together","data-event-action":"Unclear Question Click","data-event-label":c,styles:()=>({leftIcon:{marginRight:0}})})))))};var Qn="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",Xn="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",Kn="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",$n="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",Yn="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",Jn="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 ei=({authorEmail:t,onDeletePost:a,shareUrl:n,post:r,className:s="",popoverClassName:c="",onBookmark:d,onRemoveBookmark:m,onEditPost:p})=>{const{data:{locale:u,userInfo:g,togetherUserId:v,env:{isMarryBaby:h}},action:{pushNotifications:b}}=i(N),{t:f}=E(),[y,w]=l(!1),[x,C]=l(!1),[k,A]=l(!1),{authActionWrapper:T}=Qe(),z=t&&(null==g?void 0:g.email)&&t===String(null==g?void 0:g.email);return o.createElement("div",{className:s,onClick:e=>{e.preventDefault(),e.stopPropagation()}},k&&o.createElement(wo,{url:n,text:null==r?void 0:r.title,onClose:()=>A(!1)}),x&&o.createElement(uo,{thumbnail:se.getAssetPath("trash-bin.svg"),isThumbnailIcon:!0,title:f("popup.deletePost.title"),description:f("popup.deletePost.description"),acceptText:f("popup.deletePost.accept"),cancelText:f("popup.deletePost.cancel"),onAccept:()=>e(void 0,void 0,void 0,(function*(){if((null==r?void 0:r.id)&&!y){w(!0);try{const t=yield(({id:t,locale:a})=>e(void 0,void 0,void 0,(function*(){if(t)return yield G(P(I.POST.DELETE,{id:t,_locale:a}),"DELETE")})))({id:r.id,locale:u});1===(null==t?void 0:t.status)&&(null==a||a())}catch(e){}w(!1)}})),onClose:()=>C(!1)}),o.createElement(wt,{className:c,toggleButtonContent:o.createElement("img",{src:h?Qn:$n,loading:"lazy"}),position:"bottom",align:"end",buttonProps:{isLoading:y},data:z?{isShowheader:!1,type:"list",list:[{icon:Yn,label:f("morePopover.share"),onClick:()=>A(!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:f("actionPopover.edit"),onClick:p},{icon:Jn,label:f("actionPopover.delete"),onClick:()=>{T((()=>C(!0)))}}]}:{isShowheader:!1,type:"list",list:[{icon:Yn,label:f("morePopover.share"),onClick:()=>A(!0)},{icon:(null==r?void 0:r.bookmarked)?Xn:Kn,label:(null==r?void 0:r.bookmarked)?f("morePopover.unsavePost"):f("morePopover.savePost"),onClick:()=>{T((()=>e(void 0,void 0,void 0,(function*(){if((null==g?void 0:g.id)&&(null==r?void 0:r.id))if(null==r?void 0:r.bookmarked){const e=yield G(P(I.BOOKMARK.DELETE,{_locale:u}),"DELETE",{data:{post_id:String(r.id)}});1===(null==e?void 0:e.status)?(b({title:"",message:"Removed saved post",type:"success",displayIcon:Kn}),m&&m()):b({title:"",message:"Remove failed",type:"danger",displayIcon:Kn})}else{const e=yield G(P(I.BOOKMARK.CREATE,{_locale:u}),"POST",{data:{user_id:v||g.id,post_id:r.id}});1===(null==e?void 0:e.status)?(b({title:"",message:"Post saved",type:"success",displayIcon:Xn}),d&&d()):b({title:"",message:"Post saved failed",type:"danger",displayIcon:Kn})}}))))}},{icon:Co,label:f("morePopover.report"),subTree:{title:f("morePopover.report.title"),description:f("morePopover.report.description"),isShowheader:!0,type:"list",list:Object.keys(ie).map((e=>({label:ie[e].label,reason:ie[e].reportReasonText,reasonValue:e}))).map((e=>({label:f(e.label),subTree:{title:f("morePopover.reportSubmit.title"),description:f("morePopover.reportSubmit.description"),isShowheader:!0,type:"jsx",jsxRenderer:t=>o.createElement(ko,{reason:e.reasonValue,reasonText:f(e.reason),postId:null==r?void 0:r.id,onClose:()=>t&&t(!1)})}})))}}]}}))},ti=pe.div`
|
|
2638
2638
|
position: relative;
|
|
2639
2639
|
margin-bottom: 24px;
|
|
2640
2640
|
background: white;
|
|
@@ -3075,4 +3075,4 @@ import{a as e,_ as t}from"./tslib.es6-01eae420.js";import*as a from"react";impor
|
|
|
3075
3075
|
`,Ei=pe(wi)`
|
|
3076
3076
|
margin-top: 12px;
|
|
3077
3077
|
padding: 0.5rem 1rem 1rem;
|
|
3078
|
-
`;var Ci="-dzIuHr";const ki=({userId:e,avatar:t,name:a,role:n,title:i,className:r})=>{const{t:s}=E(),[c,d]=l(!1);return o.createElement(o.Fragment,null,o.createElement(Be,{className:`${Ci} ${r}`,color:"success",size:"xs",onClick:()=>d(!0),style:{padding:"5px 8px",marginBottom:"12px",borderRadius:"4px"}},o.createElement("span",{className:"text"},o.createElement(j.Endorse,{isSolid:!0,size:18,color:k.colors.green800,className:"icon"}),s("cardReply.verifyBy",{name:`${a||""}`}))),o.createElement(da,{open:c,onClose:()=>d(!1),profileModalProps:{zIndex:1e3}},o.createElement(Un,{authorProps:{userId:e,avatar:t,name:a,role:n,title:i},hideQuestionTab:!0})))};const Ni=({className:t,style:a,comment:n,type:r="comment",level:d=0,replyingId:m,onPostCommentSuccess:p,post:u,onDeleteComment:g,refetchComment:v,hasQuickBookingEnable:h,handleMakeAppointment:b,cardAuthorProps:f,maxChars:y=600,disableShortenContent:w})=>{var x,C,k,A,T,S,L,M,j,B,F,V,D;const{data:{locale:U,userInfo:W,env:{isMarryBaby:H}}}=i(N),{t:Z}=E(),[q,_]=l(n||null),{id:Q,countLikes:K,content:X,replies:$=[],images:Y=[],author:J,liked:ee,link:te,mentionedUser:ae,mentions:oe}=q,{text:ne,replyingTo:ie}=(e=>{try{const t=e.match(/\[@([^\]]+)\]/),a=t?t[0].replace("[@","").replace("]",""):"";return{text:e.replace(/\[@([^\]]+)\]/,"").trim(),replyingTo:a}}catch(e){}return{text:""}})(X),{authActionWrapper:le}=Qe({_joinCommunityIds:[null===(x=null==u?void 0:u.community)||void 0===x?void 0:x.id],_joinTopicIds:null===(C=null==u?void 0:u.topics)||void 0===C?void 0:C.map((e=>e.id))}),[re,se]=l(4),ce=!!(null==W?void 0:W.id)&&(null==$?void 0:$.some((e=>e.author.id===W.id))),me=e=>{_((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 v&&v(a),a}return t}))},[pe,ue]=l(!1),ge=c((()=>"comment"===r&&$&&0!=$.length?$.sort(((e,t)=>{const a=new Date(e.createdAt).getTime(),o=new Date(t.createdAt).getTime();return a>o?-1:a<o?1:0})):$),[r,$]),ve=(null==$?void 0:$.length)||0,he=String(null==J?void 0:J.email)&&(null==W?void 0:W.email)&&String(null==J?void 0:J.email)===String(null==W?void 0:W.email),be=(null==J?void 0:J.name)||(null==J?void 0:J.username)||"",fe=(null==J?void 0:J.username)||(null==J?void 0:J.name)||"",ye=null==J?void 0:J.avatar,we=(null==u?void 0:u.isAnonymous)||null==J?void 0:J.role,xe=[...(null==u?void 0:u.isAnonymous)?[{id:(null===(k=null==u?void 0:u.author)||void 0===k?void 0:k.id)||0,name:Z("cardPost.anonymous")}]:[],...oe||[]],[Ee,ke]=l(null),[Ne,Ae]=l(null);s((()=>{if(null==J?void 0:J.hospitalId){const t=t=>e(void 0,void 0,void 0,(function*(){var e;const a=yield z(O(R.GET_HOSPITAL_INFO,{hospital_branch_id:t,website_url:de[U]}),"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(J.hospitalId)}if(null==J?void 0:J.doctorId){const t=t=>e(void 0,void 0,void 0,(function*(){var e;const a=yield z(O(R.GET_DOCTOR_INFO,{doctorId:t,website_url:de[U]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.doctor)&&Ae(null==a?void 0:a._data.doctor)}));t(J.doctorId)}}),[J.hospitalId,J.doctorId]);const Te=(null==Ne?void 0:Ne.valid_outpatient)||(null==Ne?void 0:Ne.valid_telemedicine),ze=((null==Ee?void 0:Ee.total_available_service)||(null==Ee?void 0:Ee.total_available_doctor))>0,Pe=h&&(Te||ze),Ie="chatbot"===(null===(A=null==q?void 0:q.author)||void 0===A?void 0:A.type);return o.createElement(Ge,{defaultParams:{_joinCommunityIds:[null===(T=null==u?void 0:u.community)||void 0===T?void 0:T.id],_joinTopicIds:null===(S=null==u?void 0:u.topics)||void 0===S?void 0:S.map((e=>e.id))}},o.createElement(xi,{className:t,style:a,"data-is-reply":!!d,"data-is-marrybaby":H,"data-has-booking":Pe},"reply"===r&&o.createElement(Ce,{className:"top-divider",type:"solid"}),o.createElement("div",{style:{padding:"16px 16px 0"}},o.createElement(pa,Object.assign({avatar:ye,name:be,username:fe,timeText:null==u?void 0:u.createdTime,community:null==u?void 0:u.community,className:"post-author "+(he?"with-popover":""),type:r,userId:null==J?void 0:J.id,role:we,expertId:null==J?void 0:J.partnerId,title:null==J?void 0:J.title,doctorId:null==J?void 0:J.doctorId,hospitalId:null==J?void 0:J.hospitalId,hasQuickBooking:Pe,handleMakeAppointment:b,isAnonymous:(null==q?void 0:q.isAnonymous)||Boolean(null==u?void 0:u.isAnonymous)&&(null===(L=null==u?void 0:u.author)||void 0===L?void 0:L.username)===(null==J?void 0:J.username),hideBackground:Ie,userType:null==J?void 0:J.type},f)),Boolean(null==q?void 0:q.isVerify)&&!Boolean(null==q?void 0:q.isOppose)&&o.createElement(ki,{title:null===(M=null==q?void 0:q.userVerify)||void 0===M?void 0:M.title,name:null===(j=null==q?void 0:q.userVerify)||void 0===j?void 0:j.name,userId:null===(B=null==q?void 0:q.userVerify)||void 0===B?void 0:B.id,role:null===(F=null==q?void 0:q.userVerify)||void 0===F?void 0:F.role,avatar:null===(V=null==q?void 0:q.userVerify)||void 0===V?void 0:V.avatar,className:"verify-tag"})),o.createElement(To,{className:"post-content-wrapper",replyingTo:ie,mentionedUser:ae,description:ne,mentions:xe,maxChars:y,disableShortenContent:w}),o.createElement("span",null),o.createElement("span",null),Y&&Y.length>0?o.createElement("div",{key:"image-preview",className:"image-preview-wrapper","data-is-reply":!0},o.createElement(Qo,{images:Y,authorName:null==J?void 0:J.username})):null,Y&&0!==Y.length||!te?null:o.createElement("div",{key:"link-preview",className:"link-preview-wrapper","data-is-reply":!0},o.createElement(Je,{url:te})),"most-engaging"!==r?o.createElement(o.Fragment,null,Ie&&o.createElement(Ei,{listUrl:null==q?void 0:q.source,categorySlug:null==q?void 0:q.categorySlug}),o.createElement(mt,{type:it.reply,loveCount:K,replyCount:ve,className:"post-reaction",liked:ee,isReplied:ce,hideCommentIcon:"reply"===r||Ie,hasShare:!1,onCommentClick:()=>le((()=>ue((e=>!e)))),onCommentCountClick:()=>le((()=>{ue(!0)})),onLikeClick:()=>le((()=>e(void 0,void 0,void 0,(function*(){if(Q){const t=yield(({commentId:t,setLike:a=!1,locale:o})=>e(void 0,void 0,void 0,(function*(){return G(P(a?I.COMMENT.LIKE:I.COMMENT.UNLIKE,{_locale:o,id:t}),"GET")})))({commentId:Q,setLike:!ee,locale:U});1===t.status&&_((e=>Object.assign(Object.assign({},e),{liked:!ee,countLikes:e.countLikes+(ee?-1:1)})))}}))))}),pe&&o.createElement(ho,{replyingId:m||q.id,replyToName:be,isReply:!0,onClose:()=>ue(!1),onPostSuccess:e=>{"reply"===r?p&&p(e):me(e)},post:u,replyingUser:J}),"comment"===r&&$&&$.length>0?o.createElement("div",{className:"comment-reply-wrapper"},null===(D=null==ge?void 0:ge.slice(0,re))||void 0===D?void 0:D.map((e=>o.createElement(Ni,{key:e.id,comment:e,type:"reply",className:"comment-reply-item",level:d+1,replyingId:Q,onPostCommentSuccess:me,post:u,onDeleteComment:()=>{_((t=>Object.assign(Object.assign({},t),{replies:t.replies.filter((t=>t.id!==e.id)),countReplies:t.countReplies-1})))},handleMakeAppointment:b,hasQuickBookingEnable:h}))),ve>re&&o.createElement(o.Fragment,null,o.createElement(Ce,{className:"top-divider",type:"solid"}),o.createElement(Be,{className:"more-cmt",size:"lg",color:"ghost",onClick:()=>se((e=>e+4))},Z("comment.seeMoreReplies",{count:ve-re}),o.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,he&&o.createElement(ai,{onDeleteComment:g,className:"popover",commentId:q.id})))},Ai=(t,a)=>e(void 0,void 0,void 0,(function*(){var e,o,n;const i=yield re(P(I.COMMENT.LIST,{postId:t,_locale:a,sort:"popularity",perPage:1,withoutReply:1}),"GET");return null===(n=null===(o=null===(e=null==i?void 0:i.data)||void 0===e?void 0:e.comments)||void 0===o?void 0:o.map(Te))||void 0===n?void 0:n[0]})),Ti=({className:t,style:a,hideViewMoreComment:n,showMostEngaging:r,onCommentClick:c,onCommentCountClick:d,onMostEngagingCommentClick:m,onPostCommentSuccess:p,disableCardLink:u,disableShortenContent:g,onDeletePost:v,onEditPost:h,post:b,mostEngagingComment:f,onDeleteComment:y,showInputComment:w,InlineCommentsComponent:x,hasQuickBookingEnable:k,handleMakeAppointment:A,cardAuthorProps:T})=>{const[M,j]=l(b),[F,D]=l(!1),[U,W]=l(f),{community:H,topics:Z,author:q,slug:_,isPin:Q,liked:K,photos:X,mentions:$,title:Y,description:J,previewUrl:ee,likesCount:te,commentsCount:ae,id:oe,commented:ne}=M,{data:{locale:ie,env:{isMarryBaby:le,togetherBasePath:re}},action:{pushNotifications:se}}=i(N),{t:ce}=E(),[de,me]=l(w),pe=`${re}/${(null==H?void 0:H.slug)||"_"}/${_||""}`,ue=`${B(ie)}${pe}`,{authActionWrapper:ge}=Qe((null==H?void 0:H.slug)?{_joinCommunityIds:[H.id],_joinTopicIds:null==Z?void 0:Z.map((e=>e.id))}:void 0),[ve,he]=l(!1);s((()=>{me(w)}),[w]);const be=(null==q?void 0:q.name)||(null==q?void 0:q.username)||"",fe=(null==q?void 0:q.username)||(null==q?void 0:q.name)||"",ye=null==q?void 0:q.avatar,we=(null==M?void 0:M.isAnonymous)||null==q?void 0:q.role,[xe,Ee]=l(null),[Ce,ke]=l(null);s((()=>{if(null==q?void 0:q.hospitalId){(t=>e(void 0,void 0,void 0,(function*(){var e;const a=yield z(O(R.GET_HOSPITAL_INFO,{hospital_branch_id:t,website_url:V[ie]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.branch)&&Ee(null==a?void 0:a._data.branch)})))(q.hospitalId)}if(null==q?void 0:q.doctorId){(t=>e(void 0,void 0,void 0,(function*(){var e;const a=yield z(O(R.GET_DOCTOR_INFO,{doctorId:t,website_url:V[ie]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.doctor)&&ke(null==a?void 0:a._data.doctor)})))(q.doctorId)}}),[q.hospitalId,q.doctorId]);const Ne=(null==Ce?void 0:Ce.valid_outpatient)||(null==Ce?void 0:Ce.valid_telemedicine),Ae=((null==xe?void 0:xe.total_available_service)||(null==xe?void 0:xe.total_available_doctor))>0,Te=k&&(Ne||Ae);s((()=>{e(void 0,void 0,void 0,(function*(){if(oe&&ae&&r&&!(null==f?void 0:f.id)){const e=yield Ai(oe,ie);W(e)}}))}),[oe,ie,ae,r,null==f?void 0:f.id]),s((()=>{W(f)}),[null==f?void 0:f.id]);const ze=t=>e(void 0,void 0,void 0,(function*(){if(ae>1&&(null==U?void 0:U.id)&&(null==U?void 0:U.id)===(null==t?void 0:t.id)){const e=yield Ai(oe,ie);W(e)}j((e=>Object.assign(Object.assign({},e),{commentsCount:e.commentsCount-1}))),y&&y(t)}));return o.createElement(Ge,{defaultParams:(null==H?void 0:H.slug)?{_joinCommunityIds:[H.id],_joinTopicIds:null==Z?void 0:Z.map((e=>e.id))}:void 0},F&&o.createElement(wo,{url:ue,avatar:S,text:Y,onClose:()=>D(!1)}),o.createElement(ti,{className:t,style:a,"data-is-marrybaby":le},Q?o.createElement(ht,{className:"post-pin"}):null,o.createElement("div",{style:{position:"relative",padding:"1rem 1rem 0"}},o.createElement(pa,Object.assign({avatar:ye,name:be,username:fe,url:u?void 0:pe,community:H,timeText:null==M?void 0:M.createdTime,className:"post-author",role:we,userId:null==q?void 0:q.id,expertId:null==q?void 0:q.partnerId,doctorId:null==q?void 0:q.doctorId,hospitalId:null==q?void 0:q.hospitalId,title:null==q?void 0:q.title,hasQuickBooking:Te,handleMakeAppointment:A,"data-testid":"name",isAnonymous:!!(null==M?void 0:M.isAnonymous),extendEle:o.createElement(ei,{authorEmail:String(null==q?void 0:q.email),onDeletePost:v,shareUrl:ue,post:M,className:"popover",onEditPost:h})},T))),o.createElement("a",{href:u?void 0:pe,className:"post-content-link-wrapper"},Y&&o.createElement(L,{className:"post-content-title",as:"h2",tag:"h5",fontWeight:"bold","data-testid":"Title of the Post"},C(Y)),o.createElement(To,{className:"post-content-wrapper",description:J,disableShortenContent:g,mentions:$,"data-testid":"Content of the Post"})),o.createElement("span",null),o.createElement("span",null),o.createElement("div",{key:"tag-topic"},Z&&Z.length>0?o.createElement(ut,{topics:Z,className:"post-topics"}):null),o.createElement("div",{key:"social-preview"},(null==M?void 0:M.introUrl)?o.createElement("div",{className:"social-preview-wrapper "+((null==X?void 0:X.length)?"has-image":"")},o.createElement(Xo,{url:M.introUrl,image:M.bannerImage})):null),o.createElement("div",{key:"image-preview"},(null==X?void 0:X.length)?o.createElement("div",{className:"image-preview-wrapper"},o.createElement(Qo,{images:X,authorName:null==q?void 0:q.name})):null),o.createElement("div",{key:"link-preview"},(null==M?void 0:M.introUrl)||(null==X?void 0:X.length)||!(null==ee?void 0:ee.url)?null:o.createElement("div",{className:"link-preview-wrapper"},o.createElement(Je,{title:ee.title,url:ee.url,image:ee.image}))),o.createElement(mt,{isMarryBaby:le,type:it.post,loveCount:te,replyCount:ae,className:"post-reaction "+((null==X?void 0:X.length)||(null==ee?void 0:ee.url)?"hide-top-border":""),liked:ve?!K:K,isReplied:ne,onCommentClick:()=>ge((()=>{c?c():me((e=>!e))})),onCommentCountClick:()=>{ge((()=>{le?me(!0):d?d():!u&&(window.location.href=pe)}))},onShareClick:()=>{D(!0)},onLikeClick:()=>e(void 0,void 0,void 0,(function*(){if(oe&&!ve){he(!0);try{const t=yield(({id:t,locale:a})=>e(void 0,void 0,void 0,(function*(){if(t)return yield G(P(I.POST.LIKE,{id:t,_locale:a}),"GET")})))({id:oe,locale:ie});1!==(null==t?void 0:t.status)?se(ua(ce)):j((e=>Object.assign(Object.assign({},e),{likesCount:(e.likesCount||0)+(e.liked?-1:1),liked:!e.liked})))}catch(e){se(ua(ce))}he(!1)}})),showingMostEngaging:!(!r||!(null==U?void 0:U.id))}),de&&o.createElement(ho,{isMainCmt:!w,onClose:()=>me(!1),onPostSuccess:e=>{0!==ae||(null==U?void 0:U.id)||W(e),j((e=>Object.assign(Object.assign({},e),{commentsCount:e.commentsCount+1,commented:!0}))),p&&p(e)},post:M}),r&&(null==U?void 0:U.id)?o.createElement("div",{className:"most-engaging-wrapper",onClick:e=>{m?(e.stopPropagation(),m()):window.location.href=pe}},o.createElement(Ni,{hasQuickBookingEnable:k,handleMakeAppointment:A,comment:U,post:M,onDeleteComment:()=>{ze&&ze(U)},className:"most-engaging-comment",type:"most-engaging",key:U.id,cardAuthorProps:T}),ae>1&&!n&&o.createElement(Be,{className:"see-more-comments",color:"ghost",size:"md"},ce("comment.seeMoreComments",{count:ae-1}))):null,x))};var zi=Object.freeze({__proto__:null});export{Vn as A,Gn as B,Je as C,Ti as D,ei as E,Ni as F,ai as G,yt as H,ho as I,wi as J,qe as K,$e as L,uo as P,wo as S,_e as T,ki as V,Ge as a,mt as b,ut as c,vt as d,ht as e,Ct as f,pa as g,io as h,Ya as i,to as j,ea as k,_t as l,ia as m,oo as n,po as o,ko as p,yo as q,To as r,Bo as s,zi as t,Qe as u,Wo as v,Qo as w,Xo as x,da as y,Un as z};
|
|
3078
|
+
`;var Ci="-dzIuHr";const ki=({userId:e,avatar:t,name:a,role:n,title:i,className:r})=>{const{t:s}=E(),[c,d]=l(!1);return o.createElement(o.Fragment,null,o.createElement(Be,{className:`${Ci} ${r}`,color:"success",size:"xs",onClick:()=>d(!0),style:{padding:"5px 8px",marginBottom:"12px",borderRadius:"4px"}},o.createElement("span",{className:"text"},o.createElement(j.Endorse,{isSolid:!0,size:18,color:k.colors.green800,className:"icon"}),s("cardReply.verifyBy",{name:`${a||""}`}))),o.createElement(da,{open:c,onClose:()=>d(!1),profileModalProps:{zIndex:1e3}},o.createElement(Un,{authorProps:{userId:e,avatar:t,name:a,role:n,title:i},hideQuestionTab:!0})))};const Ni=({className:t,style:a,comment:n,type:r="comment",level:d=0,replyingId:m,onPostCommentSuccess:p,post:u,onDeleteComment:g,refetchComment:v,hasQuickBookingEnable:h,handleMakeAppointment:b,cardAuthorProps:f,maxChars:y=600,disableShortenContent:w})=>{var x,C,k,A,T,S,L,M,j,B,F,V,D;const{data:{locale:U,userInfo:W,env:{isMarryBaby:H}}}=i(N),{t:Z}=E(),[q,_]=l(n||null),{id:Q,countLikes:X,content:K,replies:$=[],images:Y=[],author:J,liked:ee,link:te,mentionedUser:ae,mentions:oe}=q,{text:ne,replyingTo:ie}=(e=>{try{const t=e.match(/\[@([^\]]+)\]/),a=t?t[0].replace("[@","").replace("]",""):"";return{text:e.replace(/\[@([^\]]+)\]/,"").trim(),replyingTo:a}}catch(e){}return{text:""}})(K),{authActionWrapper:le}=Qe({_joinCommunityIds:[null===(x=null==u?void 0:u.community)||void 0===x?void 0:x.id],_joinTopicIds:null===(C=null==u?void 0:u.topics)||void 0===C?void 0:C.map((e=>e.id))}),[re,se]=l(4),ce=!!(null==W?void 0:W.id)&&(null==$?void 0:$.some((e=>e.author.id===W.id))),me=e=>{_((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 v&&v(a),a}return t}))},[pe,ue]=l(!1),ge=c((()=>"comment"===r&&$&&0!=$.length?$.sort(((e,t)=>{const a=new Date(e.createdAt).getTime(),o=new Date(t.createdAt).getTime();return a>o?-1:a<o?1:0})):$),[r,$]),ve=(null==$?void 0:$.length)||0,he=String(null==J?void 0:J.email)&&(null==W?void 0:W.email)&&String(null==J?void 0:J.email)===String(null==W?void 0:W.email),be=(null==J?void 0:J.name)||(null==J?void 0:J.username)||"",fe=(null==J?void 0:J.username)||(null==J?void 0:J.name)||"",ye=null==J?void 0:J.avatar,we=(null==u?void 0:u.isAnonymous)||null==J?void 0:J.role,xe=[...(null==u?void 0:u.isAnonymous)?[{id:(null===(k=null==u?void 0:u.author)||void 0===k?void 0:k.id)||0,name:Z("cardPost.anonymous")}]:[],...oe||[]],[Ee,ke]=l(null),[Ne,Ae]=l(null);s((()=>{if(null==J?void 0:J.hospitalId){const t=t=>e(void 0,void 0,void 0,(function*(){var e;const a=yield z(O(R.GET_HOSPITAL_INFO,{hospital_branch_id:t,website_url:de[U]}),"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(J.hospitalId)}if(null==J?void 0:J.doctorId){const t=t=>e(void 0,void 0,void 0,(function*(){var e;const a=yield z(O(R.GET_DOCTOR_INFO,{doctorId:t,website_url:de[U]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.doctor)&&Ae(null==a?void 0:a._data.doctor)}));t(J.doctorId)}}),[J.hospitalId,J.doctorId]);const Te=(null==Ne?void 0:Ne.valid_outpatient)||(null==Ne?void 0:Ne.valid_telemedicine),ze=((null==Ee?void 0:Ee.total_available_service)||(null==Ee?void 0:Ee.total_available_doctor))>0,Pe=h&&(Te||ze),Ie="chatbot"===(null===(A=null==q?void 0:q.author)||void 0===A?void 0:A.type);return o.createElement(Ge,{defaultParams:{_joinCommunityIds:[null===(T=null==u?void 0:u.community)||void 0===T?void 0:T.id],_joinTopicIds:null===(S=null==u?void 0:u.topics)||void 0===S?void 0:S.map((e=>e.id))}},o.createElement(xi,{className:t,style:a,"data-is-reply":!!d,"data-is-marrybaby":H,"data-has-booking":Pe},"reply"===r&&o.createElement(Ce,{className:"top-divider",type:"solid"}),o.createElement("div",{style:{padding:"16px 16px 0"}},o.createElement(pa,Object.assign({avatar:ye,name:be,username:fe,timeText:null==u?void 0:u.createdTime,community:null==u?void 0:u.community,className:"post-author "+(he?"with-popover":""),type:r,userId:null==J?void 0:J.id,role:we,expertId:null==J?void 0:J.partnerId,title:null==J?void 0:J.title,doctorId:null==J?void 0:J.doctorId,hospitalId:null==J?void 0:J.hospitalId,hasQuickBooking:Pe,handleMakeAppointment:b,isAnonymous:(null==q?void 0:q.isAnonymous)||Boolean(null==u?void 0:u.isAnonymous)&&(null===(L=null==u?void 0:u.author)||void 0===L?void 0:L.username)===(null==J?void 0:J.username),hideBackground:Ie,userType:null==J?void 0:J.type},f)),Boolean(null==q?void 0:q.isVerify)&&!Boolean(null==q?void 0:q.isOppose)&&o.createElement(ki,{title:null===(M=null==q?void 0:q.userVerify)||void 0===M?void 0:M.title,name:null===(j=null==q?void 0:q.userVerify)||void 0===j?void 0:j.name,userId:null===(B=null==q?void 0:q.userVerify)||void 0===B?void 0:B.id,role:null===(F=null==q?void 0:q.userVerify)||void 0===F?void 0:F.role,avatar:null===(V=null==q?void 0:q.userVerify)||void 0===V?void 0:V.avatar,className:"verify-tag"})),o.createElement(To,{className:"post-content-wrapper",replyingTo:ie,mentionedUser:ae,description:ne,mentions:xe,maxChars:y,disableShortenContent:w}),o.createElement("span",null),o.createElement("span",null),Y&&Y.length>0?o.createElement("div",{key:"image-preview",className:"image-preview-wrapper","data-is-reply":!0},o.createElement(Qo,{images:Y,authorName:null==J?void 0:J.username})):null,Y&&0!==Y.length||!te?null:o.createElement("div",{key:"link-preview",className:"link-preview-wrapper","data-is-reply":!0},o.createElement(Je,{url:te})),"most-engaging"!==r?o.createElement(o.Fragment,null,Ie&&o.createElement(Ei,{listUrl:null==q?void 0:q.source,categorySlug:null==q?void 0:q.categorySlug}),o.createElement(mt,{type:it.reply,loveCount:X,replyCount:ve,className:"post-reaction",liked:ee,isReplied:ce,hideCommentIcon:"reply"===r||Ie,hasShare:!1,onCommentClick:()=>le((()=>ue((e=>!e)))),onCommentCountClick:()=>le((()=>{ue(!0)})),onLikeClick:()=>le((()=>e(void 0,void 0,void 0,(function*(){if(Q){const t=yield(({commentId:t,setLike:a=!1,locale:o})=>e(void 0,void 0,void 0,(function*(){return G(P(a?I.COMMENT.LIKE:I.COMMENT.UNLIKE,{_locale:o,id:t}),"GET")})))({commentId:Q,setLike:!ee,locale:U});1===t.status&&_((e=>Object.assign(Object.assign({},e),{liked:!ee,countLikes:e.countLikes+(ee?-1:1)})))}}))))}),pe&&o.createElement(ho,{replyingId:m||q.id,replyToName:be,isReply:!0,onClose:()=>ue(!1),onPostSuccess:e=>{"reply"===r?p&&p(e):me(e)},post:u,replyingUser:J}),"comment"===r&&$&&$.length>0?o.createElement("div",{className:"comment-reply-wrapper"},null===(D=null==ge?void 0:ge.slice(0,re))||void 0===D?void 0:D.map((e=>o.createElement(Ni,{key:e.id,comment:e,type:"reply",className:"comment-reply-item",level:d+1,replyingId:Q,onPostCommentSuccess:me,post:u,onDeleteComment:()=>{_((t=>Object.assign(Object.assign({},t),{replies:t.replies.filter((t=>t.id!==e.id)),countReplies:t.countReplies-1})))},handleMakeAppointment:b,hasQuickBookingEnable:h}))),ve>re&&o.createElement(o.Fragment,null,o.createElement(Ce,{className:"top-divider",type:"solid"}),o.createElement(Be,{className:"more-cmt",size:"lg",color:"ghost",onClick:()=>se((e=>e+4))},Z("comment.seeMoreReplies",{count:ve-re}),o.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,he&&o.createElement(ai,{onDeleteComment:g,className:"popover",commentId:q.id})))},Ai=(t,a)=>e(void 0,void 0,void 0,(function*(){var e,o,n;const i=yield re(P(I.COMMENT.LIST,{postId:t,_locale:a,sort:"popularity",perPage:1,withoutReply:1}),"GET");return null===(n=null===(o=null===(e=null==i?void 0:i.data)||void 0===e?void 0:e.comments)||void 0===o?void 0:o.map(Te))||void 0===n?void 0:n[0]})),Ti=({className:t,style:a,hideViewMoreComment:n,showMostEngaging:r,onCommentClick:c,onCommentCountClick:d,onMostEngagingCommentClick:m,onPostCommentSuccess:p,disableCardLink:u,disableShortenContent:g,onDeletePost:v,onEditPost:h,post:b,mostEngagingComment:f,onDeleteComment:y,showInputComment:w,InlineCommentsComponent:x,hasQuickBookingEnable:k,handleMakeAppointment:A,cardAuthorProps:T})=>{const[M,j]=l(b),[F,D]=l(!1),[U,W]=l(f),{community:H,topics:Z,author:q,slug:_,isPin:Q,liked:X,photos:K,mentions:$,title:Y,description:J,previewUrl:ee,likesCount:te,commentsCount:ae,id:oe,commented:ne}=M,{data:{locale:ie,env:{isMarryBaby:le,togetherBasePath:re}},action:{pushNotifications:se}}=i(N),{t:ce}=E(),[de,me]=l(w),pe=`${re}/${(null==H?void 0:H.slug)||"_"}/${_||""}`,ue=`${B(ie)}${pe}`,{authActionWrapper:ge}=Qe((null==H?void 0:H.slug)?{_joinCommunityIds:[H.id],_joinTopicIds:null==Z?void 0:Z.map((e=>e.id))}:void 0),[ve,he]=l(!1);s((()=>{me(w)}),[w]);const be=(null==q?void 0:q.name)||(null==q?void 0:q.username)||"",fe=(null==q?void 0:q.username)||(null==q?void 0:q.name)||"",ye=null==q?void 0:q.avatar,we=(null==M?void 0:M.isAnonymous)||null==q?void 0:q.role,[xe,Ee]=l(null),[Ce,ke]=l(null);s((()=>{if(null==q?void 0:q.hospitalId){(t=>e(void 0,void 0,void 0,(function*(){var e;const a=yield z(O(R.GET_HOSPITAL_INFO,{hospital_branch_id:t,website_url:V[ie]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.branch)&&Ee(null==a?void 0:a._data.branch)})))(q.hospitalId)}if(null==q?void 0:q.doctorId){(t=>e(void 0,void 0,void 0,(function*(){var e;const a=yield z(O(R.GET_DOCTOR_INFO,{doctorId:t,website_url:V[ie]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.doctor)&&ke(null==a?void 0:a._data.doctor)})))(q.doctorId)}}),[q.hospitalId,q.doctorId]);const Ne=(null==Ce?void 0:Ce.valid_outpatient)||(null==Ce?void 0:Ce.valid_telemedicine),Ae=((null==xe?void 0:xe.total_available_service)||(null==xe?void 0:xe.total_available_doctor))>0,Te=k&&(Ne||Ae);s((()=>{e(void 0,void 0,void 0,(function*(){if(oe&&ae&&r&&!(null==f?void 0:f.id)){const e=yield Ai(oe,ie);W(e)}}))}),[oe,ie,ae,r,null==f?void 0:f.id]),s((()=>{W(f)}),[null==f?void 0:f.id]);const ze=t=>e(void 0,void 0,void 0,(function*(){if(ae>1&&(null==U?void 0:U.id)&&(null==U?void 0:U.id)===(null==t?void 0:t.id)){const e=yield Ai(oe,ie);W(e)}j((e=>Object.assign(Object.assign({},e),{commentsCount:e.commentsCount-1}))),y&&y(t)}));return o.createElement(Ge,{defaultParams:(null==H?void 0:H.slug)?{_joinCommunityIds:[H.id],_joinTopicIds:null==Z?void 0:Z.map((e=>e.id))}:void 0},F&&o.createElement(wo,{url:ue,avatar:S,text:Y,onClose:()=>D(!1)}),o.createElement(ti,{className:t,style:a,"data-is-marrybaby":le},Q?o.createElement(ht,{className:"post-pin"}):null,o.createElement("div",{style:{position:"relative",padding:"1rem 1rem 0"}},o.createElement(pa,Object.assign({avatar:ye,name:be,username:fe,url:u?void 0:pe,community:H,timeText:null==M?void 0:M.createdTime,className:"post-author",role:we,userId:null==q?void 0:q.id,expertId:null==q?void 0:q.partnerId,doctorId:null==q?void 0:q.doctorId,hospitalId:null==q?void 0:q.hospitalId,title:null==q?void 0:q.title,hasQuickBooking:Te,handleMakeAppointment:A,"data-testid":"name",isAnonymous:!!(null==M?void 0:M.isAnonymous),extendEle:o.createElement(ei,{authorEmail:String(null==q?void 0:q.email),onDeletePost:v,shareUrl:ue,post:M,className:"popover",onEditPost:h})},T))),o.createElement("a",{href:u?void 0:pe,className:"post-content-link-wrapper"},Y&&o.createElement(L,{className:"post-content-title",as:"h2",tag:"h5",fontWeight:"bold","data-testid":"Title of the Post"},C(Y)),o.createElement(To,{className:"post-content-wrapper",description:J,disableShortenContent:g,mentions:$,"data-testid":"Content of the Post"})),o.createElement("span",null),o.createElement("span",null),o.createElement("div",{key:"tag-topic"},Z&&Z.length>0?o.createElement(ut,{topics:Z,className:"post-topics"}):null),o.createElement("div",{key:"social-preview"},(null==M?void 0:M.introUrl)?o.createElement("div",{className:"social-preview-wrapper "+((null==K?void 0:K.length)?"has-image":"")},o.createElement(Ko,{url:M.introUrl,image:M.bannerImage})):null),o.createElement("div",{key:"image-preview"},(null==K?void 0:K.length)?o.createElement("div",{className:"image-preview-wrapper"},o.createElement(Qo,{images:K,authorName:null==q?void 0:q.name})):null),o.createElement("div",{key:"link-preview"},(null==M?void 0:M.introUrl)||(null==K?void 0:K.length)||!(null==ee?void 0:ee.url)?null:o.createElement("div",{className:"link-preview-wrapper"},o.createElement(Je,{title:ee.title,url:ee.url,image:ee.image}))),o.createElement(mt,{isMarryBaby:le,type:it.post,loveCount:te,replyCount:ae,className:"post-reaction "+((null==K?void 0:K.length)||(null==ee?void 0:ee.url)?"hide-top-border":""),liked:ve?!X:X,isReplied:ne,onCommentClick:()=>ge((()=>{c?c():me((e=>!e))})),onCommentCountClick:()=>{ge((()=>{le?me(!0):d?d():!u&&(window.location.href=pe)}))},onShareClick:()=>{D(!0)},onLikeClick:()=>e(void 0,void 0,void 0,(function*(){if(oe&&!ve){he(!0);try{const t=yield(({id:t,locale:a})=>e(void 0,void 0,void 0,(function*(){if(t)return yield G(P(I.POST.LIKE,{id:t,_locale:a}),"GET")})))({id:oe,locale:ie});1!==(null==t?void 0:t.status)?se(ua(ce)):j((e=>Object.assign(Object.assign({},e),{likesCount:(e.likesCount||0)+(e.liked?-1:1),liked:!e.liked})))}catch(e){se(ua(ce))}he(!1)}})),showingMostEngaging:!(!r||!(null==U?void 0:U.id))}),de&&o.createElement(ho,{isMainCmt:!w,onClose:()=>me(!1),onPostSuccess:e=>{0!==ae||(null==U?void 0:U.id)||W(e),j((e=>Object.assign(Object.assign({},e),{commentsCount:e.commentsCount+1,commented:!0}))),p&&p(e)},post:M}),r&&(null==U?void 0:U.id)?o.createElement("div",{className:"most-engaging-wrapper",onClick:e=>{m?(e.stopPropagation(),m()):window.location.href=pe}},o.createElement(Ni,{hasQuickBookingEnable:k,handleMakeAppointment:A,comment:U,post:M,onDeleteComment:()=>{ze&&ze(U)},className:"most-engaging-comment",type:"most-engaging",key:U.id,cardAuthorProps:T}),ae>1&&!n&&o.createElement(Be,{className:"see-more-comments",color:"ghost",size:"md"},ce("comment.seeMoreComments",{count:ae-1}))):null,x))};var zi=Object.freeze({__proto__:null});export{Vn as A,Gn as B,Je as C,Ti as D,ei as E,Ni as F,ai as G,yt as H,ho as I,wi as J,qe as K,$e as L,uo as P,wo as S,_e as T,ki as V,Ge as a,mt as b,ut as c,vt as d,ht as e,Ct as f,pa as g,io as h,Ya as i,to as j,ea as k,_t as l,ia as m,oo as n,po as o,ko as p,yo as q,To as r,Bo as s,zi as t,Qe as u,Wo as v,Qo as w,Ko as x,da as y,Un as z};
|