@hhgtech/hhg-components 1.28.21 → 1.28.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (352) hide show
  1. package/build/ChevronDown-2d5d0e3b.js +1 -0
  2. package/build/babyGrowth.js +2 -2
  3. package/build/cache.js +1 -1
  4. package/build/care.js +1 -1
  5. package/build/components/navigationV2/components/atoms/HamburgerIcon.d.ts +1 -3
  6. package/build/components/navigationV2/components/molecules/Categories/index.d.ts +3 -1
  7. package/build/components/navigationV2/components/molecules/menuEcomList/Item/index.d.ts +8 -0
  8. package/build/components/navigationV2/components/molecules/menuEcomList/Item/index.styled.d.ts +1 -0
  9. package/build/components/navigationV2/components/molecules/menuEcomList/ecomSpotlights.d.ts +8 -0
  10. package/build/components/navigationV2/components/molecules/menuEcomList/index.styled.d.ts +2 -0
  11. package/build/components/navigationV2/components/molecules/navigationBar/hamburgerMenu/index.d.ts +1 -3
  12. package/build/components/navigationV2/components/molecules/navigationBar/index.d.ts +2 -3
  13. package/build/components/navigationV2/index.d.ts +5 -0
  14. package/build/components/organisms/index.d.ts +1 -1
  15. package/build/components/organisms/navigationProfileButton/index.d.ts +2 -11
  16. package/build/components/organisms/navigationProfileButton/index.styled.d.ts +1 -1
  17. package/build/components/organisms/navigationProfileButton/profilePopup.d.ts +3 -15
  18. package/build/components/organisms/profileNavigation/icons/booking.d.ts +2 -0
  19. package/build/components/organisms/profileNavigation/icons/community.d.ts +2 -0
  20. package/build/components/organisms/profileNavigation/icons/dot.d.ts +2 -0
  21. package/build/components/organisms/profileNavigation/icons/eShop.d.ts +2 -0
  22. package/build/components/organisms/profileNavigation/icons/help.d.ts +2 -0
  23. package/build/components/organisms/profileNavigation/icons/logOut.d.ts +2 -0
  24. package/build/components/organisms/profileNavigation/icons/myHealth.d.ts +2 -0
  25. package/build/components/organisms/profileNavigation/icons/save.d.ts +2 -0
  26. package/build/components/organisms/profileNavigation/icons/settings.d.ts +2 -0
  27. package/build/components/organisms/profileNavigation/icons/user.d.ts +2 -0
  28. package/build/components/organisms/profileNavigation/index.d.ts +36 -0
  29. package/build/components/organisms/profileNavigation/index.styled.d.ts +9 -0
  30. package/build/components/organisms/profileNavigation/rank.d.ts +7 -0
  31. package/build/components/organisms/profileNavigation/userInfo.d.ts +6 -0
  32. package/build/components.js +1 -1
  33. package/build/{constants-cae8dcfd.js → constants-8bcbbfa4.js} +1 -1
  34. package/build/{constants-0d879f21.js → constants-f4c0aa09.js} +1 -1
  35. package/build/constants.js +1 -1
  36. package/build/{core-42d5ed63.js → core-e13a9991.js} +1 -1
  37. package/build/ecom.js +1 -1
  38. package/build/esm/ChevronDown-85611002.js +1 -0
  39. package/build/esm/babyGrowth.js +2 -2
  40. package/build/esm/cache.js +1 -1
  41. package/build/esm/care.js +1 -1
  42. package/build/esm/components/navigationV2/components/atoms/HamburgerIcon.d.ts +1 -3
  43. package/build/esm/components/navigationV2/components/molecules/Categories/index.d.ts +3 -1
  44. package/build/esm/components/navigationV2/components/molecules/menuEcomList/Item/index.d.ts +8 -0
  45. package/build/esm/components/navigationV2/components/molecules/menuEcomList/Item/index.styled.d.ts +1 -0
  46. package/build/esm/components/navigationV2/components/molecules/menuEcomList/ecomSpotlights.d.ts +8 -0
  47. package/build/esm/components/navigationV2/components/molecules/menuEcomList/index.styled.d.ts +2 -0
  48. package/build/esm/components/navigationV2/components/molecules/navigationBar/hamburgerMenu/index.d.ts +1 -3
  49. package/build/esm/components/navigationV2/components/molecules/navigationBar/index.d.ts +2 -3
  50. package/build/esm/components/navigationV2/index.d.ts +5 -0
  51. package/build/esm/components/organisms/index.d.ts +1 -1
  52. package/build/esm/components/organisms/navigationProfileButton/index.d.ts +2 -11
  53. package/build/esm/components/organisms/navigationProfileButton/index.styled.d.ts +1 -1
  54. package/build/esm/components/organisms/navigationProfileButton/profilePopup.d.ts +3 -15
  55. package/build/esm/components/organisms/profileNavigation/icons/booking.d.ts +2 -0
  56. package/build/esm/components/organisms/profileNavigation/icons/community.d.ts +2 -0
  57. package/build/esm/components/organisms/profileNavigation/icons/dot.d.ts +2 -0
  58. package/build/esm/components/organisms/profileNavigation/icons/eShop.d.ts +2 -0
  59. package/build/esm/components/organisms/profileNavigation/icons/help.d.ts +2 -0
  60. package/build/esm/components/organisms/profileNavigation/icons/logOut.d.ts +2 -0
  61. package/build/esm/components/organisms/profileNavigation/icons/myHealth.d.ts +2 -0
  62. package/build/esm/components/organisms/profileNavigation/icons/save.d.ts +2 -0
  63. package/build/esm/components/organisms/profileNavigation/icons/settings.d.ts +2 -0
  64. package/build/esm/components/organisms/profileNavigation/icons/user.d.ts +2 -0
  65. package/build/esm/components/organisms/profileNavigation/index.d.ts +36 -0
  66. package/build/esm/components/organisms/profileNavigation/index.styled.d.ts +9 -0
  67. package/build/esm/components/organisms/profileNavigation/rank.d.ts +7 -0
  68. package/build/esm/components/organisms/profileNavigation/userInfo.d.ts +6 -0
  69. package/build/esm/components.js +1 -1
  70. package/build/esm/{constants-5e4b6aaa.js → constants-0187e9c1.js} +1 -1
  71. package/build/esm/{constants-b5814512.js → constants-c312beee.js} +2 -2
  72. package/build/esm/constants.js +1 -1
  73. package/build/esm/core-2f7d6a78.js +1 -0
  74. package/build/esm/ecom.js +1 -1
  75. package/build/esm/footer.js +1 -1
  76. package/build/esm/gAssets.js +1 -1
  77. package/build/esm/getDynamicHealthTool-9c7dc42f.js +1 -0
  78. package/build/esm/{getSocialList-593d72cf.js → getSocialList-757a53c6.js} +1 -1
  79. package/build/esm/hooks.js +1 -1
  80. package/build/esm/i18n/translationKeys.d.ts +1 -1
  81. package/build/esm/i18n-values/en-PH.js +1 -1
  82. package/build/esm/i18n-values/hi-IN.js +1 -1
  83. package/build/esm/i18n-values/id-ID.js +1 -1
  84. package/build/esm/i18n-values/km-KH.js +1 -1
  85. package/build/esm/i18n-values/ms-MY.js +1 -1
  86. package/build/esm/i18n-values/my-MM.js +1 -1
  87. package/build/esm/i18n-values/th-TH.js +1 -1
  88. package/build/esm/i18n-values/tl-PH.js +1 -1
  89. package/build/esm/i18n-values/vi-VN.js +1 -1
  90. package/build/esm/i18n-values/vi-VN_MB.js +1 -1
  91. package/build/esm/i18n-values/zh-TW.js +1 -1
  92. package/build/esm/i18n.js +1 -1
  93. package/build/esm/i18nV2.js +1 -1
  94. package/build/esm/{index-3fd6d11d.js → index-034573a6.js} +1 -1
  95. package/build/esm/index-15c600d6.js +3533 -0
  96. package/build/esm/{index-27f79b14.js → index-29bf362b.js} +1 -1
  97. package/build/esm/{index-727605cf.js → index-324430b9.js} +1 -1
  98. package/build/esm/{index-9bb14d7f.js → index-3bc70679.js} +1 -1
  99. package/build/esm/{index-603aec16.js → index-425a92c5.js} +1 -1
  100. package/build/esm/{index-bf7e8cb2.js → index-5a1f52da.js} +1 -1
  101. package/build/esm/{index-e5dce728.js → index-645ef204.js} +6 -6
  102. package/build/esm/{index-f2bbc22b.js → index-6a2a12a1.js} +1 -1
  103. package/build/esm/{index-bfcf3fb0.js → index-77ec342a.js} +1 -1
  104. package/build/esm/{index-fb027c2b.js → index-7fbbc93e.js} +1 -1
  105. package/build/esm/index-84edbddf.js +1755 -0
  106. package/build/esm/{index-0bc7892c.js → index-8b57ae3b.js} +1 -1
  107. package/build/esm/{index-9cdff468.js → index-9a575100.js} +2 -2
  108. package/build/esm/{index-620551b5.js → index-b902806c.js} +1 -1
  109. package/build/esm/{index-f0b1e2fe.js → index-b9920630.js} +1 -1
  110. package/build/esm/index-db3811a7.js +1 -0
  111. package/build/esm/{index-43c43315.js → index-e12c492a.js} +1 -1
  112. package/build/esm/index-fe3254e0.js +1 -0
  113. package/build/esm/index.css +1 -1
  114. package/build/esm/index.js +1 -1
  115. package/build/esm/{index.styled-02ca5623.js → index.styled-6f781392.js} +1 -1
  116. package/build/esm/{index.styled-39bbc781.js → index.styled-7aa83a38.js} +1 -1
  117. package/build/esm/{index.styles-8e66aa69.js → index.styles-1512f2b5.js} +2 -2
  118. package/build/esm/lead.js +1 -1
  119. package/build/esm/mantine.js +1 -1
  120. package/build/esm/misc.js +1 -1
  121. package/build/esm/navigation.js +1 -1
  122. package/build/esm/onboardingV2.js +1 -1
  123. package/build/esm/pwg.js +1 -1
  124. package/build/esm/{routing-cf2d5f19.js → routing-6b724e34.js} +1 -1
  125. package/build/esm/together.js +1 -1
  126. package/build/esm/{types-a4c1b4b0.js → types-2cf3ca1c.js} +1 -1
  127. package/build/esm/types-c4319967.js +788 -0
  128. package/build/esm/types.js +1 -1
  129. package/build/esm/{useCategory-e1c4dd95.js → useCategory-efa124e8.js} +1 -1
  130. package/build/esm/useHealthToolCache-de46a889.js +1 -0
  131. package/build/esm/useRafState-2a610da2.js +1 -0
  132. package/build/esm/{useTranslations-0f3e8009.js → useTranslations-dd0a13ad.js} +1 -1
  133. package/build/esm/{utils-5f9f0861.js → utils-8ef9fdb1.js} +1 -1
  134. package/build/esm/{utils-c9e60f19.js → utils-c9b03900.js} +1 -1
  135. package/build/esm/vaccination.js +1 -1
  136. package/build/footer.js +1 -1
  137. package/build/gAssets.js +1 -1
  138. package/build/getDynamicHealthTool-8b81f63c.js +1 -0
  139. package/build/{getSocialList-ada93645.js → getSocialList-e857f598.js} +1 -1
  140. package/build/hooks.js +1 -1
  141. package/build/i18n/translationKeys.d.ts +1 -1
  142. package/build/i18n-values/en-PH.js +1 -1
  143. package/build/i18n-values/hi-IN.js +1 -1
  144. package/build/i18n-values/id-ID.js +1 -1
  145. package/build/i18n-values/km-KH.js +1 -1
  146. package/build/i18n-values/ms-MY.js +1 -1
  147. package/build/i18n-values/my-MM.js +1 -1
  148. package/build/i18n-values/th-TH.js +1 -1
  149. package/build/i18n-values/tl-PH.js +1 -1
  150. package/build/i18n-values/vi-VN.js +1 -1
  151. package/build/i18n-values/vi-VN_MB.js +1 -1
  152. package/build/i18n-values/zh-TW.js +1 -1
  153. package/build/i18n.js +1 -1
  154. package/build/i18nV2.js +1 -1
  155. package/build/index-02d5c385.js +1 -0
  156. package/build/{index-75705406.js → index-2867dcac.js} +1 -1
  157. package/build/{index-b6de35aa.js → index-2d3213a5.js} +1 -1
  158. package/build/{index-cef0a00f.js → index-2e9c0de0.js} +1 -1
  159. package/build/{index-853b0b56.js → index-31783012.js} +1 -1
  160. package/build/{index-4a6fc7db.js → index-433f3c65.js} +1 -1
  161. package/build/{index-c29cd0ee.js → index-4647ac38.js} +1 -1
  162. package/build/{index-106a0aa4.js → index-472cd02e.js} +1 -1
  163. package/build/{index-22536346.js → index-49ca569a.js} +1 -1
  164. package/build/index-4e95c4ce.js +1 -0
  165. package/build/{index-1df24374.js → index-5d2cb060.js} +1 -1
  166. package/build/{index-71c2b110.js → index-63670e0c.js} +1 -1
  167. package/build/index-66def10e.js +1755 -0
  168. package/build/index-78b4c580.js +3533 -0
  169. package/build/{index-1fbc51d0.js → index-80ed081f.js} +1 -1
  170. package/build/{index-29d8f3e7.js → index-87067120.js} +1 -1
  171. package/build/index-a0d69a3e.js +1 -0
  172. package/build/{index-9e94fdd7.js → index-da51ce3f.js} +1 -1
  173. package/build/{index-8844b145.js → index-ff10154c.js} +1 -1
  174. package/build/index.css +1 -1
  175. package/build/index.js +1 -1
  176. package/build/{index.styled-0e38b245.js → index.styled-8b68590e.js} +1 -1
  177. package/build/{index.styled-24033e81.js → index.styled-f58521f6.js} +1 -1
  178. package/build/{index.styles-ad7903c3.js → index.styles-2679f17e.js} +1 -1
  179. package/build/lead.js +1 -1
  180. package/build/mantine.js +1 -1
  181. package/build/misc.js +1 -1
  182. package/build/navigation.js +1 -1
  183. package/build/onboardingV2.js +1 -1
  184. package/build/pwg.js +2 -2
  185. package/build/{routing-ec743546.js → routing-d4f8bab4.js} +1 -1
  186. package/build/together.js +1 -1
  187. package/build/{types-04be3103.js → types-79e9ebf6.js} +1 -1
  188. package/build/{types-6f7fce81.js → types-f02ad287.js} +68 -68
  189. package/build/types.js +1 -1
  190. package/build/{useCategory-5cbd3135.js → useCategory-de21ce75.js} +1 -1
  191. package/build/useHealthToolCache-1ec3b85b.js +1 -0
  192. package/build/{useRafState-68615887.js → useRafState-de88a13b.js} +1 -1
  193. package/build/{useTranslations-fe507352.js → useTranslations-9940a064.js} +1 -1
  194. package/build/utils-754d3326.js +1 -0
  195. package/build/{utils-381adc93.js → utils-7d5baedb.js} +1 -1
  196. package/build/vaccination.js +1 -1
  197. package/package.json +1 -1
  198. package/build/components/organisms/navigationProfileButton/popupWrapper.d.ts +0 -14
  199. package/build/esm/components/organisms/navigationProfileButton/popupWrapper.d.ts +0 -14
  200. package/build/esm/core-311d7242.js +0 -1
  201. package/build/esm/getDynamicHealthTool-6bf2e69d.js +0 -1
  202. package/build/esm/index-43ced8c4.js +0 -1
  203. package/build/esm/index-4bee5ccb.js +0 -1
  204. package/build/esm/index-8014dff1.js +0 -3533
  205. package/build/esm/index-ca4fdb46.js +0 -1753
  206. package/build/esm/types-c18963c9.js +0 -788
  207. package/build/esm/useHealthToolCache-4f4bec7e.js +0 -1
  208. package/build/esm/useRafState-d6f71b45.js +0 -1
  209. package/build/getDynamicHealthTool-114ddb03.js +0 -1
  210. package/build/index-38dce2a8.js +0 -3533
  211. package/build/index-562ffe13.js +0 -1
  212. package/build/index-6c94c4af.js +0 -1
  213. package/build/index-b1f953f6.js +0 -1
  214. package/build/index-eb28658b.js +0 -1753
  215. package/build/useHealthToolCache-ad666c43.js +0 -1
  216. package/build/utils-76a160ce.js +0 -1
  217. /package/build/{BMI_BOYS.percentile.monthly-943242cd.js → BMI_BOYS.percentile.monthly-a3fbcc30.js} +0 -0
  218. /package/build/{BMI_BOYS.percentile.weekly-348ba55a.js → BMI_BOYS.percentile.weekly-00a054a1.js} +0 -0
  219. /package/build/{BMI_BOYS.percentile.yearly-aaa04db9.js → BMI_BOYS.percentile.yearly-8bc1b868.js} +0 -0
  220. /package/build/{BMI_BOYS.zscore.monthly-f6d07e3b.js → BMI_BOYS.zscore.monthly-ccb51787.js} +0 -0
  221. /package/build/{BMI_BOYS.zscore.weekly-303d8a0e.js → BMI_BOYS.zscore.weekly-79db5fd6.js} +0 -0
  222. /package/build/{BMI_BOYS.zscore.yearly-024c0240.js → BMI_BOYS.zscore.yearly-3df0688a.js} +0 -0
  223. /package/build/{BMI_GIRLS.percentile.monthly-9e09fab0.js → BMI_GIRLS.percentile.monthly-99222d30.js} +0 -0
  224. /package/build/{BMI_GIRLS.percentile.weekly-4423fb86.js → BMI_GIRLS.percentile.weekly-ed7e3ccc.js} +0 -0
  225. /package/build/{BMI_GIRLS.percentile.yearly-d473af49.js → BMI_GIRLS.percentile.yearly-f1054cd5.js} +0 -0
  226. /package/build/{BMI_GIRLS.zscore.monthly-32c50ad7.js → BMI_GIRLS.zscore.monthly-3968e189.js} +0 -0
  227. /package/build/{BMI_GIRLS.zscore.weekly-cd164e3d.js → BMI_GIRLS.zscore.weekly-b61f50fa.js} +0 -0
  228. /package/build/{BMI_GIRLS.zscore.yearly-45434eb3.js → BMI_GIRLS.zscore.yearly-9616687d.js} +0 -0
  229. /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-276b36ea.js → HEAD CIRCUM_BOYS.percentile.monthly-1427d1b8.js} +0 -0
  230. /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-9e1a3595.js → HEAD CIRCUM_BOYS.percentile.weekly-02cedcc7.js} +0 -0
  231. /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-2d20cea8.js → HEAD CIRCUM_BOYS.percentile.yearly-decf814c.js} +0 -0
  232. /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-33424f91.js → HEAD CIRCUM_BOYS.zscore.monthly-76c954a8.js} +0 -0
  233. /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-37907536.js → HEAD CIRCUM_BOYS.zscore.weekly-2b3850fa.js} +0 -0
  234. /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-85993e9b.js → HEAD CIRCUM_BOYS.zscore.yearly-f2cc2c6f.js} +0 -0
  235. /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-d1927886.js → HEAD CIRCUM_GIRLS.percentile.monthly-92f3aa2d.js} +0 -0
  236. /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-ee99ab29.js → HEAD CIRCUM_GIRLS.percentile.weekly-c65d2a6c.js} +0 -0
  237. /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-4a765f28.js → HEAD CIRCUM_GIRLS.percentile.yearly-6fa678da.js} +0 -0
  238. /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-3b459cae.js → HEAD CIRCUM_GIRLS.zscore.monthly-07b25781.js} +0 -0
  239. /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-e6a11767.js → HEAD CIRCUM_GIRLS.zscore.weekly-9b73aff8.js} +0 -0
  240. /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-01897cb8.js → HEAD CIRCUM_GIRLS.zscore.yearly-693f90cd.js} +0 -0
  241. /package/build/{HEIGHT_BOYS.percentile.monthly-d30bfe74.js → HEIGHT_BOYS.percentile.monthly-d2d7898b.js} +0 -0
  242. /package/build/{HEIGHT_BOYS.percentile.weekly-036c0cc0.js → HEIGHT_BOYS.percentile.weekly-4f6f9210.js} +0 -0
  243. /package/build/{HEIGHT_BOYS.percentile.yearly-033a22e5.js → HEIGHT_BOYS.percentile.yearly-e2ef743a.js} +0 -0
  244. /package/build/{HEIGHT_BOYS.zscore.monthly-8f647f0d.js → HEIGHT_BOYS.zscore.monthly-49f9202e.js} +0 -0
  245. /package/build/{HEIGHT_BOYS.zscore.weekly-29ffb508.js → HEIGHT_BOYS.zscore.weekly-aef7df8c.js} +0 -0
  246. /package/build/{HEIGHT_BOYS.zscore.yearly-d9229c2b.js → HEIGHT_BOYS.zscore.yearly-87581894.js} +0 -0
  247. /package/build/{HEIGHT_GIRLS.percentile.monthly-788585cb.js → HEIGHT_GIRLS.percentile.monthly-826096f2.js} +0 -0
  248. /package/build/{HEIGHT_GIRLS.percentile.weekly-e7e66eea.js → HEIGHT_GIRLS.percentile.weekly-3cf78569.js} +0 -0
  249. /package/build/{HEIGHT_GIRLS.percentile.yearly-dc20673b.js → HEIGHT_GIRLS.percentile.yearly-8364b303.js} +0 -0
  250. /package/build/{HEIGHT_GIRLS.zscore.monthly-e5830d69.js → HEIGHT_GIRLS.zscore.monthly-fec2ed12.js} +0 -0
  251. /package/build/{HEIGHT_GIRLS.zscore.weekly-ee4eb471.js → HEIGHT_GIRLS.zscore.weekly-39df1c0b.js} +0 -0
  252. /package/build/{HEIGHT_GIRLS.zscore.yearly-2fea76f2.js → HEIGHT_GIRLS.zscore.yearly-491bd234.js} +0 -0
  253. /package/build/{Onboarding-30aed79e.js → Onboarding-321532f3.js} +0 -0
  254. /package/build/{Visible-d5b3e721.js → Visible-7ee562f5.js} +0 -0
  255. /package/build/{WEIGHT_BOYS.percentile.monthly-3b373855.js → WEIGHT_BOYS.percentile.monthly-dcc2c0f1.js} +0 -0
  256. /package/build/{WEIGHT_BOYS.percentile.weekly-40d48d19.js → WEIGHT_BOYS.percentile.weekly-9ef5093e.js} +0 -0
  257. /package/build/{WEIGHT_BOYS.percentile.yearly-a8ed04d7.js → WEIGHT_BOYS.percentile.yearly-a6d79d20.js} +0 -0
  258. /package/build/{WEIGHT_BOYS.zscore.monthly-bb4515c9.js → WEIGHT_BOYS.zscore.monthly-b9332d62.js} +0 -0
  259. /package/build/{WEIGHT_BOYS.zscore.weekly-e246bbb1.js → WEIGHT_BOYS.zscore.weekly-bbb7ef64.js} +0 -0
  260. /package/build/{WEIGHT_BOYS.zscore.yearly-f8a1009f.js → WEIGHT_BOYS.zscore.yearly-38c85120.js} +0 -0
  261. /package/build/{WEIGHT_GIRLS.percentile.monthly-2a4758e2.js → WEIGHT_GIRLS.percentile.monthly-2e0d42c4.js} +0 -0
  262. /package/build/{WEIGHT_GIRLS.percentile.weekly-945cecc0.js → WEIGHT_GIRLS.percentile.weekly-37c0163c.js} +0 -0
  263. /package/build/{WEIGHT_GIRLS.percentile.yearly-f388f6eb.js → WEIGHT_GIRLS.percentile.yearly-48641f99.js} +0 -0
  264. /package/build/{WEIGHT_GIRLS.zscore.monthly-29e23b56.js → WEIGHT_GIRLS.zscore.monthly-f9900eb2.js} +0 -0
  265. /package/build/{WEIGHT_GIRLS.zscore.weekly-27bfa598.js → WEIGHT_GIRLS.zscore.weekly-2818a7cd.js} +0 -0
  266. /package/build/{WEIGHT_GIRLS.zscore.yearly-ec81d01f.js → WEIGHT_GIRLS.zscore.yearly-8854987c.js} +0 -0
  267. /package/build/{cookieHelper-c4eae752.js → cookieHelper-5a5ad9d8.js} +0 -0
  268. /package/build/{dataTransform-7a7971d2.js → dataTransform-d947b2cd.js} +0 -0
  269. /package/build/esm/{BMI_BOYS.percentile.monthly-6359f2aa.js → BMI_BOYS.percentile.monthly-42a71347.js} +0 -0
  270. /package/build/esm/{BMI_BOYS.percentile.weekly-fe261546.js → BMI_BOYS.percentile.weekly-c438d483.js} +0 -0
  271. /package/build/esm/{BMI_BOYS.percentile.yearly-dfb86f24.js → BMI_BOYS.percentile.yearly-a38980fd.js} +0 -0
  272. /package/build/esm/{BMI_BOYS.zscore.monthly-32b6f269.js → BMI_BOYS.zscore.monthly-57b12fbe.js} +0 -0
  273. /package/build/esm/{BMI_BOYS.zscore.weekly-01f330ec.js → BMI_BOYS.zscore.weekly-2dc304ae.js} +0 -0
  274. /package/build/esm/{BMI_BOYS.zscore.yearly-e5014506.js → BMI_BOYS.zscore.yearly-7e1a3797.js} +0 -0
  275. /package/build/esm/{BMI_GIRLS.percentile.monthly-fa928a13.js → BMI_GIRLS.percentile.monthly-88e2f842.js} +0 -0
  276. /package/build/esm/{BMI_GIRLS.percentile.weekly-ec63366d.js → BMI_GIRLS.percentile.weekly-28db3d3a.js} +0 -0
  277. /package/build/esm/{BMI_GIRLS.percentile.yearly-6f7249a8.js → BMI_GIRLS.percentile.yearly-3f111c39.js} +0 -0
  278. /package/build/esm/{BMI_GIRLS.zscore.monthly-84f48d9d.js → BMI_GIRLS.zscore.monthly-42aa08a0.js} +0 -0
  279. /package/build/esm/{BMI_GIRLS.zscore.weekly-d2aa40f9.js → BMI_GIRLS.zscore.weekly-730cc3fb.js} +0 -0
  280. /package/build/esm/{BMI_GIRLS.zscore.yearly-f7c405d2.js → BMI_GIRLS.zscore.yearly-974e68b4.js} +0 -0
  281. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.monthly-9a7d38e3.js → HEAD CIRCUM_BOYS.percentile.monthly-6735bf8c.js} +0 -0
  282. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.weekly-5f8c3bc2.js → HEAD CIRCUM_BOYS.percentile.weekly-218a2a8a.js} +0 -0
  283. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.yearly-05cfb1a7.js → HEAD CIRCUM_BOYS.percentile.yearly-7c569f10.js} +0 -0
  284. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.monthly-e0d54f1f.js → HEAD CIRCUM_BOYS.zscore.monthly-c530f82d.js} +0 -0
  285. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.weekly-37e62f29.js → HEAD CIRCUM_BOYS.zscore.weekly-2de64796.js} +0 -0
  286. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.yearly-71b64cf9.js → HEAD CIRCUM_BOYS.zscore.yearly-d9646af3.js} +0 -0
  287. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.monthly-e6419ec4.js → HEAD CIRCUM_GIRLS.percentile.monthly-33a7b03d.js} +0 -0
  288. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.weekly-50ff3bb2.js → HEAD CIRCUM_GIRLS.percentile.weekly-e159c306.js} +0 -0
  289. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.yearly-58407ac8.js → HEAD CIRCUM_GIRLS.percentile.yearly-f5b9f524.js} +0 -0
  290. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.monthly-0a3d0392.js → HEAD CIRCUM_GIRLS.zscore.monthly-0bb12d79.js} +0 -0
  291. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.weekly-7704d6f6.js → HEAD CIRCUM_GIRLS.zscore.weekly-f006ab5c.js} +0 -0
  292. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.yearly-20d7b666.js → HEAD CIRCUM_GIRLS.zscore.yearly-7284414f.js} +0 -0
  293. /package/build/esm/{HEIGHT_BOYS.percentile.monthly-2265f5e0.js → HEIGHT_BOYS.percentile.monthly-fbd195d8.js} +0 -0
  294. /package/build/esm/{HEIGHT_BOYS.percentile.weekly-1d6f2675.js → HEIGHT_BOYS.percentile.weekly-f430a5c1.js} +0 -0
  295. /package/build/esm/{HEIGHT_BOYS.percentile.yearly-a16c60e0.js → HEIGHT_BOYS.percentile.yearly-2d2865f4.js} +0 -0
  296. /package/build/esm/{HEIGHT_BOYS.zscore.monthly-74f11cf7.js → HEIGHT_BOYS.zscore.monthly-9c09fe6a.js} +0 -0
  297. /package/build/esm/{HEIGHT_BOYS.zscore.weekly-4e9ad921.js → HEIGHT_BOYS.zscore.weekly-ce50be77.js} +0 -0
  298. /package/build/esm/{HEIGHT_BOYS.zscore.yearly-3c84be19.js → HEIGHT_BOYS.zscore.yearly-a864af3a.js} +0 -0
  299. /package/build/esm/{HEIGHT_GIRLS.percentile.monthly-d69c1bc0.js → HEIGHT_GIRLS.percentile.monthly-ac862726.js} +0 -0
  300. /package/build/esm/{HEIGHT_GIRLS.percentile.weekly-c98c3719.js → HEIGHT_GIRLS.percentile.weekly-b3b073a0.js} +0 -0
  301. /package/build/esm/{HEIGHT_GIRLS.percentile.yearly-7d1c2f8f.js → HEIGHT_GIRLS.percentile.yearly-32f6f664.js} +0 -0
  302. /package/build/esm/{HEIGHT_GIRLS.zscore.monthly-458a3838.js → HEIGHT_GIRLS.zscore.monthly-9521e3b0.js} +0 -0
  303. /package/build/esm/{HEIGHT_GIRLS.zscore.weekly-ee69fddb.js → HEIGHT_GIRLS.zscore.weekly-ab5238fc.js} +0 -0
  304. /package/build/esm/{HEIGHT_GIRLS.zscore.yearly-4ed7d8c4.js → HEIGHT_GIRLS.zscore.yearly-a705e916.js} +0 -0
  305. /package/build/esm/{Onboarding-128f7694.js → Onboarding-776a51ed.js} +0 -0
  306. /package/build/esm/{Visible-0aff5e0b.js → Visible-0463b9e6.js} +0 -0
  307. /package/build/esm/{WEIGHT_BOYS.percentile.monthly-c975b56a.js → WEIGHT_BOYS.percentile.monthly-c9ff5588.js} +0 -0
  308. /package/build/esm/{WEIGHT_BOYS.percentile.weekly-fa671296.js → WEIGHT_BOYS.percentile.weekly-989fafb4.js} +0 -0
  309. /package/build/esm/{WEIGHT_BOYS.percentile.yearly-94ee1ffc.js → WEIGHT_BOYS.percentile.yearly-164f75e1.js} +0 -0
  310. /package/build/esm/{WEIGHT_BOYS.zscore.monthly-980ad564.js → WEIGHT_BOYS.zscore.monthly-b270ca2c.js} +0 -0
  311. /package/build/esm/{WEIGHT_BOYS.zscore.weekly-cfd0319e.js → WEIGHT_BOYS.zscore.weekly-f7e70c1f.js} +0 -0
  312. /package/build/esm/{WEIGHT_BOYS.zscore.yearly-93242e4e.js → WEIGHT_BOYS.zscore.yearly-32dda9e5.js} +0 -0
  313. /package/build/esm/{WEIGHT_GIRLS.percentile.monthly-3701392d.js → WEIGHT_GIRLS.percentile.monthly-718a8734.js} +0 -0
  314. /package/build/esm/{WEIGHT_GIRLS.percentile.weekly-f94367f1.js → WEIGHT_GIRLS.percentile.weekly-402cdbff.js} +0 -0
  315. /package/build/esm/{WEIGHT_GIRLS.percentile.yearly-21712a28.js → WEIGHT_GIRLS.percentile.yearly-942157cf.js} +0 -0
  316. /package/build/esm/{WEIGHT_GIRLS.zscore.monthly-68b0d421.js → WEIGHT_GIRLS.zscore.monthly-08c0f7e5.js} +0 -0
  317. /package/build/esm/{WEIGHT_GIRLS.zscore.weekly-53eb8866.js → WEIGHT_GIRLS.zscore.weekly-80a0dee3.js} +0 -0
  318. /package/build/esm/{WEIGHT_GIRLS.zscore.yearly-ba9c78d9.js → WEIGHT_GIRLS.zscore.yearly-7b8c6a62.js} +0 -0
  319. /package/build/esm/{cookieHelper-f08471b0.js → cookieHelper-df1c13f9.js} +0 -0
  320. /package/build/esm/{dataTransform-9a889a57.js → dataTransform-b9b83d6a.js} +0 -0
  321. /package/build/esm/{index-fc996fc3.js → index-08fb1171.js} +0 -0
  322. /package/build/esm/{index-c93685a5.js → index-2c84d24b.js} +0 -0
  323. /package/build/esm/{index-c4775284.js → index-65e5542a.js} +0 -0
  324. /package/build/esm/{isProduction-526256cd.js → isProduction-f42d4af9.js} +0 -0
  325. /package/build/esm/{localizeNumberFormat-40d6b54f.js → localizeNumberFormat-5d8fed7e.js} +0 -0
  326. /package/build/esm/{normalizeLink-630cc7e1.js → normalizeLink-83bc2fa0.js} +0 -0
  327. /package/build/esm/{number-2748523d.js → number-6083d486.js} +0 -0
  328. /package/build/esm/{paths-d658dd02.js → paths-f457e9f9.js} +0 -0
  329. /package/build/esm/{screenSizeContext-593881b5.js → screenSizeContext-d394cc53.js} +0 -0
  330. /package/build/esm/{theme-2b59bc50.js → theme-e05003ce.js} +0 -0
  331. /package/build/esm/{translationsContext-04bcf678.js → translationsContext-f924f41c.js} +0 -0
  332. /package/build/esm/{tslib.es6-541a264f.js → tslib.es6-d0d7aa00.js} +0 -0
  333. /package/build/esm/{types-fe0f7019.js → types-69c2911d.js} +0 -0
  334. /package/build/esm/{useIsInit-6bede063.js → useIsInit-af8a02c8.js} +0 -0
  335. /package/build/esm/{useOutsideClick-359aeef3.js → useOutsideClick-631f70f3.js} +0 -0
  336. /package/build/esm/{useScrollbarSize-957c3c67.js → useScrollbarSize-934266e1.js} +0 -0
  337. /package/build/{index-867763ec.js → index-5eb6c97e.js} +0 -0
  338. /package/build/{index-11d9951e.js → index-960cb1db.js} +0 -0
  339. /package/build/{index-89f9554a.js → index-d2a44d40.js} +0 -0
  340. /package/build/{isProduction-201ff7b0.js → isProduction-48b088ec.js} +0 -0
  341. /package/build/{localizeNumberFormat-2080e041.js → localizeNumberFormat-232b7837.js} +0 -0
  342. /package/build/{normalizeLink-3765f193.js → normalizeLink-a0154e50.js} +0 -0
  343. /package/build/{number-1de035c4.js → number-98c7d75a.js} +0 -0
  344. /package/build/{paths-855ff49e.js → paths-c1a7d034.js} +0 -0
  345. /package/build/{screenSizeContext-c2712d14.js → screenSizeContext-a1a2dd8f.js} +0 -0
  346. /package/build/{theme-8c73ee47.js → theme-bcfc4bf1.js} +0 -0
  347. /package/build/{translationsContext-1b861397.js → translationsContext-198efa0b.js} +0 -0
  348. /package/build/{tslib.es6-97edf1e8.js → tslib.es6-42b6a4e4.js} +0 -0
  349. /package/build/{types-7692b1e6.js → types-bb264b4a.js} +0 -0
  350. /package/build/{useIsInit-e2e74e93.js → useIsInit-9ccd66c4.js} +0 -0
  351. /package/build/{useOutsideClick-5f6e71c0.js → useOutsideClick-b300ce50.js} +0 -0
  352. /package/build/{useScrollbarSize-4221e3e3.js → useScrollbarSize-523cb659.js} +0 -0
@@ -1 +1 @@
1
- "use strict";var e=require("./tslib.es6-97edf1e8.js"),t=require("react"),a=require("@mantine/core"),l=require("./index.styled-0e38b245.js"),o=require("./useTranslations-fe507352.js"),n=require("innertext"),i=require("./theme-8c73ee47.js"),r=require("./index-106a0aa4.js"),s=require("./index-22536346.js");require("@mantine/dates");var d=require("./index-1fbc51d0.js");require("./Onboarding-30aed79e.js");var c=require("./gAssets.js");require("dayjs");var u=require("./screenSizeContext-c2712d14.js");require("styled-components"),require("./isProduction-201ff7b0.js"),require("@mantine/hooks");var m=require("./index.styles-ad7903c3.js"),p=require("./index-c29cd0ee.js"),v=require("./index-29d8f3e7.js"),g=require("lodash/debounce"),f=require("react-contenteditable");require("./useCategory-5cbd3135.js");var h=require("./index-cef0a00f.js"),C=require("react-dom");function y(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function E(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(a){if("default"!==a){var l=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,l.get?l:{enumerable:!0,get:function(){return e[a]}})}})),t.default=e,Object.freeze(t)}require("./constants-cae8dcfd.js");var w=y(t),k=y(n),b=y(g),P=y(f),T=E(C);const S=({title:o,url:n,image:i,logo:s,className:d,style:c,noRefetch:u})=>{const{data:{locale:p,env:{isMarryBaby:v}}}=t.useContext(m.TogetherComponentGlobalContext),[g,f]=t.useState(!1),h=a.useMantineTheme(),C=t.useRef(u);C.current=u;const[y,E]=t.useState(null);t.useEffect((()=>{e.__awaiter(void 0,void 0,void 0,(function*(){if(!C.current){if(!n)return E(null);E((e=>Object.assign(Object.assign({},e),{isFetching:!0}))),m.callApi(m.getApiPath(m.PATHS.FETCH_PREVIEW,{_locale:p}),"POST",{data:{link:n},headers:{"Content-Type":"application/json"}}).then((e=>{var t,a,l;f(!1),E({title:null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.title,url:n,image:(null===(a=null==e?void 0:e.data)||void 0===a?void 0:a.image)||(null===(l=null==e?void 0:e.data)||void 0===l?void 0:l.logo)})})).catch((()=>{E(null)}))}}))}),[n]);const k=(null==y?void 0:y.image)||i,b=(null==y?void 0:y.title)||o,P=(null==y?void 0:y.logo)||s,T=(null==y?void 0:y.url)||n,S=T.replace("http://","").replace("https://","").split(/[/?#]/)[0],x=t.useRef(!1);return w.default.createElement(l.StyledCardLink,{"data-is-marrybaby":v,className:`${d} no-replace-click`,style:c,color:h.colors[h.primaryColor][0]},w.default.createElement("a",{href:T,target:"_blank",rel:"noreferrer"},k&&w.default.createElement("div",{className:"link-image-wrapper"},!v&&w.default.createElement("img",{className:"link-image-blur",src:k,onError:e=>{x.current||(x.current=!0,e.currentTarget.src=m.DEFAULT_IMG)},loading:"lazy"}),w.default.createElement("img",{className:"link-image",src:k,onError:e=>{x.current||(x.current=!0,e.currentTarget.src=m.DEFAULT_IMG)},loading:"lazy"})),w.default.createElement("div",{className:"link-info-container"},w.default.createElement(r.Text,{size:"n1"},v&&P&&!g&&w.default.createElement("img",{className:"link-logo",src:P,onError:()=>f(!0),loading:"lazy"}),S),w.default.createElement(m.Heading,{tag:"h6"},b))))};const x=({onClick:e,color:a,className:n,style:i})=>{const{data:{env:{isMarryBaby:r}}}=t.useContext(m.TogetherComponentGlobalContext),{t:s}=o.useTranslations();return w.default.createElement(l.LabelSortPin,{label:w.default.createElement(w.default.Fragment,null,r&&w.default.createElement("img",{className:"label-sort-pin-icon",src:"data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cpath d='M3.5 19.9999L7.87 15.6299' stroke='%23FB8C00' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e %3cpath fill-rule='evenodd' clip-rule='evenodd' d='M4.95634 11.294C4.56534 11.685 4.56534 12.318 4.95634 12.708L7.87434 15.626L10.7923 18.544C11.1833 18.935 11.8163 18.935 12.2063 18.544L13.3813 17.369C13.5693 17.181 13.6743 16.927 13.6743 16.662V12.726L16.5743 9.82597L18.8833 9.94897C19.1663 9.96397 19.4433 9.85797 19.6433 9.65797L20.2173 9.08397C20.6083 8.69297 20.6083 8.05997 20.2173 7.66997L15.8313 3.28397C15.4403 2.89297 14.8073 2.89297 14.4173 3.28397L13.8433 3.85797C13.6423 4.05897 13.5363 4.33497 13.5523 4.61797L13.6753 6.92697L10.7753 9.82697H6.83834C6.57334 9.82697 6.31834 9.93197 6.13134 10.12L4.95634 11.294V11.294Z' stroke='%23FB8C00' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e %3cpath d='M16.5699 9.83018L13.6699 6.93018' stroke='%23FB8C00' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e %3c/svg%3e",loading:"lazy"})," ",s("label.pinnedPost")),rightLabel:!r&&w.default.createElement("img",{className:"label-sort-pin-icon",src:"data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cline x1='7.18605' y1='7.68219' x2='3.68219' y2='13.8139' stroke='%23FEA21E' stroke-linecap='round'/%3e%3cpath d='M3.24591 7.78426C3.21275 7.84168 3.20376 7.90993 3.22092 7.97398C3.23808 8.03803 3.27998 8.09264 3.3374 8.12579L8.78429 11.2706C8.90385 11.3396 9.05674 11.2986 9.12578 11.1791C9.71191 10.1641 9.71348 8.97262 9.23682 7.99339L10.8583 5.18521C11.5115 5.00603 12.0982 4.57973 12.4638 3.94629C12.5328 3.82672 12.4919 3.67383 12.3723 3.6048L8.18237 1.18584C8.12494 1.15268 8.0567 1.1437 7.99265 1.16086C7.92861 1.17803 7.874 1.21993 7.84086 1.27736C7.47521 1.91077 7.39934 2.63194 7.57065 3.28723L5.94919 6.09545C4.86323 6.1723 3.83201 6.76934 3.24591 7.78426Z' fill='%23FEA21E' stroke='%23FEA21E' stroke-width='0.5' stroke-linejoin='round'/%3e%3c/svg%3e",loading:"lazy"}),onClick:e,color:"white",className:`label-pinned ${n}`,style:i})},N=e=>({message:e("notification.failure"),type:"danger"});var A="data:image/svg+xml,%3csvg width='16' height='17' viewBox='0 0 16 17' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M8 14.5C11.3137 14.5 14 11.8137 14 8.5C14 5.18629 11.3137 2.5 8 2.5C4.68629 2.5 2 5.18629 2 8.5C2 11.8137 4.68629 14.5 8 14.5Z' fill='%23FE921D'/%3e%3cpath d='M8 5.5V8.5' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M8 11.5H8.00708' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e";const I=(e,a)=>{const[l,o]=t.useState(e||[]);return{onSelectImages:t=>{const n=t.target.files;if(n)if(a&&e){a((e||l).concat(Array.from(n)))}else o((t=>{const l=e||t;return a&&a(l.concat(Array.from(n))),l.concat(Array.from(n))}))},onRemoveImage:t=>{if(a&&e){const l=e;l.splice(t,1),a(l.slice())}else o((l=>{const o=e||l;return o.splice(t,1),a&&a(o.slice()),o.slice()}))},onRemoveAllImages:()=>{a?a([]):o([])},imageSrcs:t.useMemo((()=>(e||l).map((e=>"string"==typeof e?e:URL.createObjectURL(e)))),[e,l]),imageFiles:e||l}};var _="data:image/svg+xml,%3csvg width='24' height='25' viewBox='0 0 24 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 22.9844C17.5228 22.9844 22 18.5072 22 12.9844C22 7.46153 17.5228 2.98438 12 2.98438C6.47715 2.98438 2 7.46153 2 12.9844C2 18.5072 6.47715 22.9844 12 22.9844Z' fill='%23262626'/%3e%3cpath d='M14.8281 10.1562L9.17127 15.8131' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M9.17188 10.1562L14.8287 15.8131' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e";const M=({className:e,style:a,bannedWords:n=[],value:s,onChange:d,onPreviewUrlChange:c,onInvalidUrlsChange:u,onImageFilesChange:p,imageFiles:v,isReplying:g})=>{const{t:f}=o.useTranslations(),[h,C]=t.useState(null),y=t.useRef(null),{onSelectImages:E,onRemoveImage:b,imageSrcs:P}=I(v,p);return t.useEffect((()=>{c&&((null==h?void 0:h.url)?c({title:h.title||"",url:h.url||"",image:h.image||"",description:h.description||""}):c(null))}),[h]),w.default.createElement(l.StyledCreatePostDescription,{className:e,style:a},w.default.createElement(r.Text,{size:"p4",className:"description-label"},f("createPost.popup.description")),w.default.createElement("div",{className:"textarea-control"},w.default.createElement("div",{className:"textarea-wrapper"},w.default.createElement(l.RichTextEditor,{html:s||"",onChange:d,bannedWords:n,onImagePickerClick:()=>{var e;return null===(e=y.current)||void 0===e?void 0:e.click()},onPreviewUrlChange:C,onInvalidUrlsChange:u,isReplying:g}))),w.default.createElement(r.Text,{size:"p4",className:"count-string"},f("character"),": ",k.default(s||"").length),(!P||0===P.length)&&h&&w.default.createElement("div",{className:"link-preview-wrapper"},h.isFetching?w.default.createElement(l.Loading,null):w.default.createElement(w.default.Fragment,null,w.default.createElement(S,{title:h.title,url:h.url||"#",image:h.image,noRefetch:!0}),w.default.createElement("img",{src:_,className:"icon-close",onClick:()=>C(null),loading:"lazy"}))),w.default.createElement("input",{ref:y,type:"file",accept:"image/png, image/gif, image/jpeg",multiple:!0,style:{display:"none"},onChange:E}),P.length>m.MAX_IMAGE_UPLOADS?w.default.createElement("div",{className:"input-notification"},w.default.createElement("img",{src:A,loading:"lazy"}),w.default.createElement(r.Text,{size:"p4",color:i.theme.colors.alertWarning},f("createPost.popup.warningImage"))):null,P.length>0&&w.default.createElement("div",{className:"image-gallery"},P.map(((e,t)=>w.default.createElement("div",{key:t,className:"image-item"},w.default.createElement("img",{src:e,loading:"lazy"}),w.default.createElement("img",{className:"close-btn",src:_,onClick:()=>b(t),loading:"lazy"}))))))},L=(e,t)=>{if(!t)return e;const{limit:a,bannedWords:o=[]}=t,n="number"==typeof a&&a>=0?e.substring(0,a):e;return l.highlightBadWords(n,o)},j=({className:e,style:a,bannedWords:n=[],value:i,onChange:s})=>{var d;const{t:c}=o.useTranslations(),[u,m]=t.useState(""),p=t.useRef(null);t.useEffect((()=>{if(p.current){const e=e=>{var t;e.preventDefault();const a=null===(t=e.clipboardData)||void 0===t?void 0:t.getData("text/plain");document.execCommand("insertHTML",!1,a)},t=p.current;return t.addEventListener("paste",e,{passive:!0}),()=>t.removeEventListener("paste",e)}}),[p]);const g=(null==n?void 0:n.join(","))||"";t.useEffect((()=>{var e;if(g){const t=null===(e=p.current)||void 0===e?void 0:e.innerText;if(t){const e=l.highlightBadWords(t,n);e!==t&&(s&&s(e),m(e))}}}),[g]);const f=t.useCallback(b.default((()=>{if(p.current){const e=L(p.current.innerText,{limit:120,bannedWords:n});s&&s(e),m(e)}}),300),[]);return t.useEffect((()=>{setTimeout((()=>{var e;null===(e=p.current)||void 0===e||e.focus()}),500)}),[]),w.default.createElement(l.StyledCreatePostTitle,{className:e,style:a},w.default.createElement(v.Input,{name:"title",value:i||u,size:"md",label:c("createPost.title"),CustomInput:w.default.createElement(P.default,{innerRef:p,html:i||u,onChange:()=>{if(p.current&&p.current.innerText!==(i||u)){const e=L(p.current.innerText,{bannedWords:n});s&&s(e),m(e),f()}},className:"title-input"})}),w.default.createElement(r.Text,{size:"p4",className:"count-string"},c("createPost.popup.wordCount",{count:(null===(d=p.current)||void 0===d?void 0:d.innerText.length)||0,max:120})))},R=({className:a,style:o,topics:n,communityId:i,onChange:r,isLoading:s,disabled:d,forceTopics:c,selectedTopics:u,noFetch:v,dataEventCategory:g,dataEventAction:f,dataEventLabel:h})=>{const{data:{locale:C,env:{isMarryBaby:y}}}=t.useContext(m.TogetherComponentGlobalContext),[E,k]=t.useState(n?[...n]:[]),[b,P]=t.useState(u?[...u]:[]),[T,S]=t.useState(!1),x=t.useRef(n);x.current=n,t.useEffect((()=>{var t;!i||v||(null===(t=x.current)||void 0===t?void 0:t.length)||(k([]),S(!0),e.__awaiter(void 0,void 0,void 0,(function*(){var e;try{const t=yield m.callApi(m.getApiPath(m.PATHS.TOPIC.LIST,{communityId:i,_locale:C}),"GET"),a=null===(e=null==t?void 0:t.data)||void 0===e?void 0:e.topics;Array.isArray(a)&&k((()=>(null==a?void 0:a.map(p.formatTopic).sort(((e,t)=>(e.order||0)-(t.order||0))))||[]))}catch(e){console.log(e),S(!1)}S(!1)})))}),[i,v]);const N=null==n?void 0:n.map((e=>e.id)).join("-"),A=null==E?void 0:E.map((e=>e.id)).join("-"),I=null==c?void 0:c.map((e=>e.id)).join("-");t.useEffect((()=>{n&&void 0!==N&&N!==A&&k(n)}),[n,N,A]);const _=t.useMemo((()=>E.filter((e=>!(null==c?void 0:c.some((t=>t.id&&t.id===e.id||t.mappedCategoryId&&t.mappedCategoryId===e.mappedCategoryId)))))),[A,I]);return w.default.createElement(l.StyledTopicSelectList,{"data-is-marrybaby":y,className:a,style:o},c.map((e=>w.default.createElement(B,{key:`${e.id}-${e.mappedCategoryId}`,topic:e,disabled:!0,selected:!0,dataEventAction:f,dataEventCategory:g,dataEventLabel:h}))),_.map((e=>w.default.createElement(B,{key:`${e.id}-${e.mappedCategoryId}`,topic:e,disabled:d,selected:(u||b).some((t=>t.id&&t.id===e.id||t.mappedCategoryId&&t.mappedCategoryId===e.mappedCategoryId)),onClick:()=>{const t=u||b,a=t.findIndex((t=>t.id&&t.id===e.id||t.mappedCategoryId&&t.mappedCategoryId===e.mappedCategoryId));-1!==a?t.splice(a,1):t.push(e),r&&u?r(t.slice()):(r&&r(t.slice()),P(t.slice()))},dataEventAction:f,dataEventCategory:g,dataEventLabel:h}))),(s||T)&&w.default.createElement(l.Loading,{className:"topic-spinner"}))},B=t=>{var{topic:a,disabled:l,selected:o,onClick:n}=t,i=e.__rest(t,["topic","disabled","selected","onClick"]);return w.default.createElement("div",Object.assign({className:"tag-item"+(o?" --active":""),"data-disabled":l,onClick:l?void 0:n},i),a.name)},O=({className:e,isMarryBaby:a,style:o,title:n,description:i,acceptText:s,cancelText:d,onAccept:c,onCancel:p,thumbnail:v,isThumbnailIcon:g,onClose:f,acceptBtnTracking:C,acceptBtnProps:y,cancelBtnProps:E})=>{const{data:{env:{isMarryBaby:k}}}=t.useContext(m.TogetherComponentGlobalContext),b="boolean"==typeof a?a:k,[P,S]=t.useState(!1);return t.useEffect((()=>(u.toggleNoScroll(!0),setTimeout((()=>S(!0)),0),()=>u.toggleNoScroll(!1))),[]),"undefined"==typeof window?null:T.createPortal(w.default.createElement(l.StyledPopupDanger,{"data-is-marrybaby":b,className:e,style:o,"data-open":P},w.default.createElement(l.PopupFrame,{className:"popup-frame",isOpen:P,onClose:f},w.default.createElement("div",{className:"confirm-dialog",onClick:e=>e.stopPropagation()},w.default.createElement("div",{className:"confirm-content"},v&&w.default.createElement("div",{className:"thumbnail-container "+(g?"is-icon":"")},w.default.createElement("img",{className:"thumbnail",src:v,loading:"lazy"})),w.default.createElement(m.Heading,{className:"title",tag:"h2"},n),w.default.createElement(r.Text,{className:"desc",size:"lg"},i),w.default.createElement("div",{className:"btn-group"},w.default.createElement(h.Button,Object.assign({theme:b?"marryBaby":"helloSites",size:"md",color:"tertiary",onClick:()=>{null==c||c(),null==f||f()}},y,C),s),w.default.createElement(h.Button,Object.assign({theme:b?"marryBaby":"helloSites",size:"md",onClick:()=>{null==p||p(),null==f||f()}},E),d)))),b&&v&&w.default.createElement("div",{className:"thumbnail-container is-mobile "+(g?"is-icon":"")},w.default.createElement("img",{className:"thumbnail",src:v,loading:"lazy"})))),u.getPopupWrapperDom())};const z=({isReply:a,className:n,onClose:i,replyToName:s,style:d,replyingId:c,replyingUser:u,onPostSuccess:g,post:f,isMarryBaby:C})=>{const{action:{pushNotifications:y,sanitizeFunction:E},data:{userInfo:k,locale:b,env:{isMarryBaby:P}}}=t.useContext(m.TogetherComponentGlobalContext),T="boolean"==typeof C?C:P,{t:x}=o.useTranslations(),{onSelectImages:N,onRemoveImage:A,imageSrcs:M,onRemoveAllImages:L,imageFiles:j}=I(),[R,B]=t.useState(""),{trigger:O}=t.useContext(l.MainInputTriggerContext),[z,D]=t.useState(!1),F=t.useRef(null),U=t.useRef(null),H=t.useRef(null),[W,V]=t.useState([]),[$,G]=t.useState([]),[q,Z]=t.useState(null);return t.useEffect((()=>{var e;null===(e=H.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"start"}),setTimeout((()=>{var e;null===(e=U.current)||void 0===e||e.focus()}),400)}),[O]),w.default.createElement(l.StyledInputCommentBar,{"data-is-reply":a,className:n,style:d},a&&w.default.createElement("div",{className:"reply-to-container"},w.default.createElement(r.Text,{size:"p4"},w.default.createElement("span",{dangerouslySetInnerHTML:{__html:x("inputComment.replyTo",{name:`<span style="color: #2D87F3; cursor: pointer">@${s||""}</span>`})}})),w.default.createElement("img",{src:"data:image/svg+xml,%3csvg width='16' height='17' viewBox='0 0 16 17' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8.00016' cy='8.50004' r='6.66667' fill='white' stroke='%23404040'/%3e%3cpath d='M10 6.5L6 10.5' stroke='%23404040' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M6 6.5L10 10.5' stroke='%23404040' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",className:"icon-close-comment",onClick:()=>i&&i(),loading:"lazy"})),w.default.createElement("div",{className:"input-container",ref:H},w.default.createElement(p.UserAvatar,{className:"avatar-wrapper "+(a?"avatar-wrapper-reply":""),avatar:(null==k?void 0:k.id)?k.avatar:m.DEFAULT_AVATAR_IMG,username:(null==k?void 0:k.name)||(null==k?void 0:k.username)}),w.default.createElement("input",{ref:F,onChange:N,type:"file",multiple:!0,accept:"image/png,image/jpeg",name:"images",style:{display:"none"}}),w.default.createElement(v.Input,{value:R,name:"input",size:"md",className:"input-wrapper",displayIcon:w.default.createElement("img",{src:"data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M10.7543 4.85352H4.49227C4.01776 4.85352 3.56268 5.04201 3.22715 5.37754C2.89162 5.71307 2.70313 6.16815 2.70312 6.64266V19.1667C2.70313 19.6412 2.89162 20.0963 3.22715 20.4318C3.56268 20.7673 4.01776 20.9558 4.49227 20.9558H17.0163C17.4908 20.9558 17.9459 20.7673 18.2814 20.4318C18.6169 20.0963 18.8054 19.6412 18.8054 19.1667V12.9047' stroke='%232D87F3' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M17.4633 3.51187C17.8192 3.15599 18.3019 2.95605 18.8052 2.95605C19.3085 2.95605 19.7912 3.15599 20.147 3.51187C20.5029 3.86775 20.7029 4.35044 20.7029 4.85373C20.7029 5.35702 20.5029 5.83971 20.147 6.19559L11.6486 14.694L8.07031 15.5886L8.96489 12.0103L17.4633 3.51187Z' stroke='%232D87F3' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",loading:"lazy"}),CustomInput:w.default.createElement("div",{className:"as-input"},w.default.createElement(l.RichTextEditor,{className:"textarea",html:R,onChange:B,onImagePickerClick:()=>{var e;return null===(e=F.current)||void 0===e?void 0:e.click()},bannedWords:$,onPreviewUrlChange:Z,onInvalidUrlsChange:V,setEditorRef:e=>U.current=e,isReplying:a}))}),w.default.createElement(h.Button,{theme:T?"marryBaby":"helloSites",className:"send-button",size:"sm",onClick:()=>e.__awaiter(void 0,void 0,void 0,(function*(){var t,o,n,r,s,d,v,h,C;if((null==f?void 0:f.id)&&!z){D(!0);try{const w=e=>{B(""),L(),i&&i();const t=p.formatComment(e.data);"string"==typeof t.images&&(t.images=JSON.parse(t.images)),g&&g(t)},k=yield(({postId:t,message:a,photos:o,link:n,locale:i,sanitizeFunction:r,replyingUserId:s,replyingUserName:d,replyingId:c})=>e.__awaiter(void 0,void 0,void 0,(function*(){const e=new FormData;let u=l.encodePostContent(a.replace(/(\&nbsp;)+/g," "),r);const p=l.getMentionIdsFromString(u);return o&&o.length>0&&(yield Promise.all(null==o?void 0:o.map((e=>l.uploadAndGetSrc(e,i))))).filter(Boolean).slice(0,m.MAX_IMAGE_UPLOADS).forEach((t=>{e.append("images[]",t)})),n&&e.append("link",n),null==p||p.forEach((t=>{e.append("mention_ids[]",t)})),e.append("post_id",t),c&&e.append("parent_id",c),s&&(p.unshift(s),u=`[mention+id="${s}"+name="${(d||"").replace('"',"'")}"]${u}`,e.append("parent_user_id",String(s))),e.append("content",u),e.append("content",u),e})))(Object.assign({message:R,photos:j,postId:String(f.id),link:null==q?void 0:q.url,sanitizeFunction:E,locale:b},a&&c?{replyingUserId:String((null==u?void 0:u.id)||(null===(t=null==f?void 0:f.author)||void 0===t?void 0:t.id)||""),replyingId:c,replyingUserName:(null==u?void 0:u.name)||(null==u?void 0:u.username)||""}:{})),P=yield a&&c?((t,a)=>e.__awaiter(void 0,void 0,void 0,(function*(){return m.callApiWithAuth(m.getApiPath(m.PATHS.COMMENT.REPLY,{_locale:a}),"POST",{data:t})})))(k,b):((t,a)=>e.__awaiter(void 0,void 0,void 0,(function*(){return m.callApiWithAuth(m.getApiPath(m.PATHS.COMMENT.CREATE,{_locale:a}),"POST",{data:t})})))(k,b),T=null==P?void 0:P.data;(null==T?void 0:T.id)&&!(null===(n=null===(o=null==P?void 0:P.messages)||void 0===o?void 0:o.moderation)||void 0===n?void 0:n.type)?w(P):"banned"===(null===(s=null===(r=null==P?void 0:P.messages)||void 0===r?void 0:r.moderation)||void 0===s?void 0:s.type)?(y({title:x("notification.comment.blocked.title"),message:x("notification.comment.blocked.message"),type:"danger"}),P.messages.moderation.words&&G(P.messages.moderation.words)):"suspect"===(null===(v=null===(d=null==P?void 0:P.messages)||void 0===d?void 0:d.moderation)||void 0===v?void 0:v.type)?(y({title:x("notification.comment.suspect.title"),message:x("notification.comment.suspect.message"),type:"warning"}),B(""),L(),i&&i()):(null===(h=null==P?void 0:P.messages)||void 0===h?void 0:h.find((e=>{var t;return!!(null===(t=null==e?void 0:e.includes)||void 0===t?void 0:t.call(e,"suspend"))})))?(y({message:x("notification.suspend.message"),type:"warning"}),B(""),L(),i&&i()):y({title:"",message:(null===(C=null==P?void 0:P.messages)||void 0===C?void 0:C[0])||x("notification.comment.somethingWrong"),type:"danger"})}catch(e){y({title:"",message:x("notification.comment.somethingWrong"),type:"danger"})}D(!1)}})),isLoading:z,isDisabled:!!(null==W?void 0:W.length)||z||!R||(null==R?void 0:R.length)<2||!R.trim()},w.default.createElement("img",{src:"data:image/svg+xml,%3csvg width='20' height='21' viewBox='0 0 20 21' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M7.5 9.73438L3.75 13.4844L7.5 17.2344' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M16.25 4.73438L16.25 10.3026C16.25 11.1464 15.9208 11.9557 15.3347 12.5524C14.7487 13.1491 13.9538 13.4844 13.125 13.4844L3.75 13.4844' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",className:"icon-enter",loading:"lazy"}))),(null==W?void 0:W.length)?w.default.createElement("div",{className:"error-text"},x("notification.limitUrlDomain")):null,(!M||0===M.length)&&q&&w.default.createElement("div",{className:"link-preview-wrapper"},q.isFetching?w.default.createElement(l.Loading,null):w.default.createElement(w.default.Fragment,null,w.default.createElement(S,{title:q.title,url:q.url||"#",image:q.image,noRefetch:!0}),w.default.createElement("img",{src:_,className:"icon-close",onClick:()=>Z(null),loading:"lazy"}))),M&&M.length>0&&w.default.createElement("div",{className:"preview-images-container"},M.map(((e,t)=>w.default.createElement("div",{key:t,className:"image-src-wrapper"},w.default.createElement("img",{className:"preview-image",src:e,loading:"lazy"}),w.default.createElement("img",{src:_,className:"icon-close-circle",onClick:()=>A(t),loading:"lazy"}))))))};var D="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M8 14C11.3137 14 14 11.3137 14 8C14 4.68629 11.3137 2 8 2C4.68629 2 2 4.68629 2 8C2 11.3137 4.68629 14 8 14Z' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M8 5V8' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M8 11H8.00708' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e";const F=({className:a,style:n,reason:s,reasonText:d,onClose:c,postId:u})=>{const{data:{locale:p,env:{isMarryBaby:v}},action:{pushNotifications:g}}=t.useContext(m.TogetherComponentGlobalContext),{t:f}=o.useTranslations(),[C,y]=t.useState(!1);return w.default.createElement(l.StyledSubmitReportForm,{"data-is-marrybaby":v,className:a,style:n},w.default.createElement("ul",{className:"report-list"},w.default.createElement("li",{className:"report-item"},w.default.createElement("img",{src:D,loading:"lazy"}),w.default.createElement(r.Text,{className:"__label",color:i.theme.colors.gray800,size:"p4"},d))),w.default.createElement(h.Button,{theme:v?"marryBaby":"helloSites",className:"report-submit",size:"lg",color:"primary",isLoading:C,onClick:()=>e.__awaiter(void 0,void 0,void 0,(function*(){if(u&&!C){y(!0);try{const e=yield(({id:e,reason:t,locale:a})=>{const l=new FormData;return l.append("reason",t),m.callApiWithAuth(m.getApiPath(m.PATHS.POST.REPORT,{_locale:a,id:e}),"POST",{data:l})})({id:u,reason:s,locale:p});1===(null==e?void 0:e.status)&&(g({message:"Post reported",type:"success"}),c&&c())}catch(e){}y(!1)}}))},f("submit")))};const U=({className:e,style:n,authorName:i,images:s,onClose:d,onOpenSingleView:c,alt:u})=>{const{t:m}=o.useTranslations(),[p,v]=t.useState(!1);return t.useEffect((()=>{setTimeout((()=>{v(!0)}),0)}),[]),w.default.createElement(a.Portal,null,w.default.createElement(l.StyledImagePreviewPopup,{className:e,style:n,"data-open":p},w.default.createElement("div",{className:"top-bar"},w.default.createElement("img",{className:"icon-arrow-left",src:"data:image/svg+xml,%3csvg width='24' height='25' viewBox='0 0 24 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M10.0508 18.0607L4.00078 12.0367L10.0508 6.01172' stroke='%23262626' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M4.00195 12.0352L19.002 12.0352' stroke='%23262626' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",onClick:d,alt:"go back",loading:"lazy"}),w.default.createElement(r.Text,{size:"p2",weight:"bold",style:{textAlign:"center"}},m("previewPhotos.title",{name:i}))),w.default.createElement("div",{className:"container"},s.map(((e,t)=>w.default.createElement("img",{className:"img-preview",key:t,src:e,onClick:()=>null==c?void 0:c(t),alt:u,loading:"lazy"}))))),",")};var H="data:image/svg+xml,%3csvg width='16' height='17' viewBox='0 0 16 17' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M6 12.8125L10 8.8125L6 4.8125' stroke='white' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e";const W=({initialViewIndex:e,images:o,onClose:n,alt:i})=>{const[r,s]=t.useState(e),[d,c]=t.useState(!1);t.useEffect((()=>{setTimeout((()=>{c(!0)}),0)}),[]);const u=null==o?void 0:o[r],m=0===r,p=!(null==o?void 0:o.length)||r===(null==o?void 0:o.length)-1;return w.default.createElement(a.Portal,null,w.default.createElement(l.StyledImagePreviewContainer,{"data-open":d&&!!u},w.default.createElement(l.StyledImagePreviewTopbar,null,w.default.createElement("img",{src:l.img,className:"icon-close",onClick:n,alt:"close",loading:"lazy"})),u&&r>=0&&w.default.createElement(w.default.Fragment,null,w.default.createElement(l.StyledImagePreviewWrapper,null,w.default.createElement("img",{className:"img-preview",src:u,alt:i,loading:"lazy"}),w.default.createElement(l.StyledArrowWrapper,{"data-disabled":m,onClick:()=>!m&&s(r-1)},w.default.createElement(l.StyledCircleArrow,null,w.default.createElement("img",{src:H,style:{transform:"rotate(180deg)"},alt:"left arrow","data-disabled":m,loading:"lazy"}))),w.default.createElement(l.StyledArrowWrapper,{"data-right":!0,"data-disabled":p,onClick:()=>!p&&s(r+1)},w.default.createElement(l.StyledCircleArrow,null,w.default.createElement("img",{src:H,alt:"right arrow","data-disabled":p,loading:"lazy"})))))))},V=({image:e,showIcon:a=!0})=>{const[o,n]=t.useState(!0);return w.default.createElement(l.StyledWrapper,{"data-is-blurred":o,onClick:e=>o&&e.stopPropagation()},w.default.createElement("img",{loading:"lazy",className:"img-preview",src:e}),w.default.createElement(l.StyledInner,{onClick:e=>{e.stopPropagation(),n(!o)}},a&&w.default.createElement(l.StyledIcon,null,o?w.default.createElement("svg",{width:"22",height:"20",viewBox:"0 0 22 20",fill:"none"},w.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.71 2.5399C1.32 2.1499 1.32 1.5199 1.71 1.1299C2.1 0.739902 2.74 0.739902 3.13 1.1299L19.44 17.4599C19.83 17.8499 19.83 18.4799 19.44 18.8699C19.05 19.2599 18.42 19.2599 18.03 18.8699L15.31 16.1499C13.97 16.6699 12.52 16.9699 11 16.9699C6 16.9699 1.73 13.8599 0 9.4699C0.77 7.4999 2.06 5.7999 3.68 4.5099L1.71 2.5399ZM16 9.4699C16 6.7099 13.76 4.4699 11 4.4699C10.49 4.4699 10 4.5699 9.53 4.7099L7.36 2.5399C8.51 2.1699 9.73 1.9699 11 1.9699C16 1.9699 20.27 5.0799 22 9.4599C21.31 11.2199 20.21 12.7599 18.82 13.9899L15.76 10.9299C15.9 10.4699 16 9.9799 16 9.4699ZM11 14.4699C8.24 14.4699 6 12.2299 6 9.4699C6 8.6999 6.18 7.9699 6.49 7.3299L8.06 8.8999C8.03 9.0799 8 9.2699 8 9.4699C8 11.1299 9.34 12.4699 11 12.4699C11.2 12.4699 11.38 12.4399 11.57 12.3999L13.14 13.9699C12.49 14.2899 11.77 14.4699 11 14.4699ZM13.97 9.1399C13.82 7.7399 12.72 6.6499 11.33 6.4999L13.97 9.1399Z",fill:"white"})):w.default.createElement("svg",{width:"23",height:"16",viewBox:"0 0 23 16",fill:"none"},w.default.createElement("path",{d:"M11.9999 0C5.14188 0 1.88558 5.87864 1.09558 7.55664C0.963582 7.83664 0.963582 8.16141 1.09558 8.44141C1.88558 10.1204 5.14188 16 11.9999 16C18.8339 16 22.0924 10.1629 22.8964 8.46094C23.0344 8.16794 23.0344 7.83206 22.8964 7.53906C22.0924 5.83706 18.8339 0 11.9999 0ZM11.9999 3C14.7609 3 16.9999 5.239 16.9999 8C16.9999 10.761 14.7609 13 11.9999 13C9.23888 13 6.99988 10.761 6.99988 8C6.99988 5.239 9.23888 3 11.9999 3ZM11.9999 5C11.2042 5 10.4412 5.31607 9.87856 5.87868C9.31595 6.44129 8.99988 7.20435 8.99988 8C8.99988 8.79565 9.31595 9.55871 9.87856 10.1213C10.4412 10.6839 11.2042 11 11.9999 11C12.7955 11 13.5586 10.6839 14.1212 10.1213C14.6838 9.55871 14.9999 8.79565 14.9999 8C14.9999 7.20435 14.6838 6.44129 14.1212 5.87868C13.5586 5.31607 12.7955 5 11.9999 5Z",fill:"#2D87F3"})))))},$=({className:e,images:a=[],style:n,authorName:i,isSensitive:r=!1,alt:s})=>{const{data:{env:{isMarryBaby:d}}}=t.useContext(m.TogetherComponentGlobalContext),{t:c}=o.useTranslations(),p="+ "+((a.length||0)-4),[v,g]=t.useState(!1),[f,h]=t.useState(-1),C=a.length>5,y=t.useRef(!1);return t.useEffect((()=>()=>{y.current&&u.toggleNoScroll(!1)}),[]),t.useEffect((()=>{v||f>=0?(u.toggleNoScroll(!0),y.current=!0):(u.toggleNoScroll(!1),y.current=!1)}),[v,f]),w.default.createElement(w.default.Fragment,null,r&&w.default.createElement(l.StyledNotificationBar,{message:c("sensitiveMask.contentWarningDescription"),icon:w.default.createElement("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none"},w.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.00002 0.666748C4.40002 0.666748 0.666687 4.40008 0.666687 9.00008C0.666687 13.6001 4.40002 17.3334 9.00002 17.3334C13.6 17.3334 17.3334 13.6001 17.3334 9.00008C17.3334 4.40008 13.6 0.666748 9.00002 0.666748ZM9.00002 9.83341C8.54169 9.83341 8.16669 9.45841 8.16669 9.00008V5.66675C8.16669 5.20842 8.54169 4.83342 9.00002 4.83342C9.45835 4.83342 9.83335 5.20842 9.83335 5.66675V9.00008C9.83335 9.45841 9.45835 9.83341 9.00002 9.83341ZM8.16669 11.5001V13.1667H9.83335V11.5001H8.16669Z",fill:"#FE921D"}))}),w.default.createElement(l.StyledPostImagePreview,{className:e,style:n,"data-image-count":C?5:a.length||0,"data-is-marrybaby":d,"data-cursor-pointer":!r},null==a?void 0:a.slice(0,5).map(((e,t)=>{const a=4===t&&C;return w.default.createElement("div",{className:"img-wrapper",key:t,onClick:()=>{t>=4&&C?g(!0):h(t)}},r&&w.default.createElement(V,{image:e,showIcon:!a}),!d&&w.default.createElement("img",{loading:"lazy",className:"img-preview-blur",src:e,alt:s}),w.default.createElement("img",{loading:"lazy",className:"img-preview",src:e,alt:s}),a&&w.default.createElement("div",{className:"img-more-overlay"},w.default.createElement(m.Heading,{tag:"h1",as:"h2",color:"white"},p)))}))),v&&w.default.createElement(U,{authorName:i||"",images:a,onClose:()=>g(!1),onOpenSingleView:h,alt:s}),f>=0&&w.default.createElement(W,{images:a,initialViewIndex:f,onClose:()=>h(-1),alt:s}))},G=({url:o,image:n,className:i,style:r,autoPlay:d=!0})=>{const{data:{locale:c}}=t.useContext(m.TogetherComponentGlobalContext),[u,p]=t.useState(null);t.useEffect((()=>{e.__awaiter(void 0,void 0,void 0,(function*(){if(!n){if(!o)return p(null);p((e=>Object.assign(Object.assign({},e),{isFetching:!0}))),m.callApi(m.getApiPath(m.PATHS.FETCH_PREVIEW,{_locale:c}),"POST",{data:{link:o},headers:{"Content-Type":"application/json"}}).then((e=>{var t,a;p({url:o,image:(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.image)||(null===(a=null==e?void 0:e.data)||void 0===a?void 0:a.logo)})})).catch((()=>{p(null)}))}}))}),[o,n]);const v=n||(null==u?void 0:u.image),g=(null==u?void 0:u.url)||o,f=t.useMemo((()=>l.youtubeVidIdGetter(g)),[g]),h=t.useMemo((()=>g.includes("facebook.com")||g.includes("fb.watch")),[g]),C=t.useRef(0),y=t.useRef(0),[E,k]=t.useState(!1);t.useEffect((()=>{const e=()=>{var e;const t=null===(e=b.current)||void 0===e?void 0:e.getBoundingClientRect();let a=!1;t&&(!C.current||Math.abs((C.current-t.width)/(null==t?void 0:t.width))>.2)&&(C.current=Math.floor(t.width),a=!0),t&&(!y.current||Math.abs((y.current-t.height)/(null==t?void 0:t.height))>.2)&&(y.current=Math.floor(t.height),a=!0),a&&k((e=>!e))};return e(),window.addEventListener("resize",e,{passive:!0}),()=>{window.removeEventListener("resize",e)}}),[]);const b=t.useRef(null),P=a.useMantineTheme();return w.default.createElement(l.StyledSocialLinkPreview,{className:`${i} no-replace-click`,style:r,ref:b,color:P.colors[P.primaryColor][0]},n||!f&&!h?w.default.createElement("a",{href:g,target:"_blank",rel:"noreferrer"},w.default.createElement("div",{className:"link-image-wrapper "+((null==u?void 0:u.isFetching)?"fetching":"")},(null==u?void 0:u.isFetching)?w.default.createElement(l.Loading,{className:"loading-spinner"}):w.default.createElement(s.ImageWrap,{className:"link-image",src:v||m.DEFAULT_IMG,backupSrc:m.DEFAULT_IMG,alt:g}))):w.default.createElement("div",{className:"link-image-wrapper"},f?w.default.createElement("iframe",{width:"100%",height:"100%",src:`https://www.youtube.com/embed/${f}?&autoplay=${d?1:0}&mute=1&enablejsapi=1`,frameBorder:"0",allowFullScreen:!0,style:{position:"absolute",top:0,left:0,border:"none",overflow:"hidden"},loading:"lazy"}):h?w.default.createElement("iframe",{key:String(E),src:`https://www.facebook.com/plugins/video.php?href=${encodeURIComponent(g)}&autoplay=${d?1:0}&show_text=false&t=0&width=${C.current}&height=${y.current}`,style:{position:"absolute",top:"50%",left:"50%",border:"none",overflow:"hidden",height:y.current,width:C.current,transform:"translate(-50%, -50%)"},scrolling:"no",frameBorder:"0",allowFullScreen:!0,allow:"autoplay; clipboard-write; encrypted-media; picture-in-picture; web-share",loading:"lazy"}):null))};var q="KsWg8i6",Z="_9tS0EUN",Q="kyyRKlb",K="-Uqqka-";var X="data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cpath d='M5 10C3.9 10 3 10.9 3 12C3 13.1 3.9 14 5 14C6.1 14 7 13.1 7 12C7 10.9 6.1 10 5 10Z' fill='%233E3F58'/%3e %3cpath d='M19 10C17.9 10 17 10.9 17 12C17 13.1 17.9 14 19 14C20.1 14 21 13.1 21 12C21 10.9 20.1 10 19 10Z' fill='%233E3F58'/%3e %3cpath d='M12 10C10.9 10 10 10.9 10 12C10 13.1 10.9 14 12 14C13.1 14 14 13.1 14 12C14 10.9 13.1 10 12 10Z' fill='%233E3F58'/%3e %3c/svg%3e",J="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='%23595959' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 13.3334L8 10.3704L4 13.3334V3.85187C4 3.53754 4.12041 3.23608 4.33474 3.01382C4.54906 2.79155 4.83975 2.66669 5.14286 2.66669H10.8571C11.1602 2.66669 11.4509 2.79155 11.6653 3.01382C11.8796 3.23608 12 3.53754 12 3.85187V13.3334Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",Y="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 13.3334L8 10.3704L4 13.3334V3.85187C4 3.53754 4.12041 3.23608 4.33474 3.01382C4.54906 2.79155 4.83975 2.66669 5.14286 2.66669H10.8571C11.1602 2.66669 11.4509 2.79155 11.6653 3.01382C11.8796 3.23608 12 3.53754 12 3.85187V13.3334Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",ee="data:image/svg+xml,%3csvg width='3' height='13' viewBox='0 0 3 13' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='1.58326' cy='6.41663' r='1.25' transform='rotate(89.9997 1.58326 6.41663)' fill='%23595959'/%3e%3cellipse cx='1.58326' cy='1.41663' rx='1.25' ry='1.25' transform='rotate(89.9997 1.58326 1.41663)' fill='%23595959'/%3e%3cellipse cx='1.58326' cy='11.4166' rx='1.25' ry='1.25' transform='rotate(89.9997 1.58326 11.4166)' fill='%23595959'/%3e%3c/svg%3e",te="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 5.33337C13.1046 5.33337 14 4.43794 14 3.33337C14 2.2288 13.1046 1.33337 12 1.33337C10.8954 1.33337 10 2.2288 10 3.33337C10 4.43794 10.8954 5.33337 12 5.33337Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M4 10C5.10457 10 6 9.10457 6 8C6 6.89543 5.10457 6 4 6C2.89543 6 2 6.89543 2 8C2 9.10457 2.89543 10 4 10Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M12 14.6666C13.1046 14.6666 14 13.7712 14 12.6666C14 11.5621 13.1046 10.6666 12 10.6666C10.8954 10.6666 10 11.5621 10 12.6666C10 13.7712 10.8954 14.6666 12 14.6666Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M5.72668 9.00665L10.28 11.66' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M10.2734 4.33997L5.72668 6.9933' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",ae="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M2 4H3.33333H14' stroke='%23737373' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M5.33334 3.99992V2.66659C5.33334 2.31296 5.47382 1.97382 5.72387 1.72378C5.97392 1.47373 6.31305 1.33325 6.66668 1.33325H9.33334C9.68697 1.33325 10.0261 1.47373 10.2762 1.72378C10.5262 1.97382 10.6667 2.31296 10.6667 2.66659V3.99992M12.6667 3.99992V13.3333C12.6667 13.6869 12.5262 14.026 12.2762 14.2761C12.0261 14.5261 11.687 14.6666 11.3333 14.6666H4.66668C4.31305 14.6666 3.97392 14.5261 3.72387 14.2761C3.47382 14.026 3.33334 13.6869 3.33334 13.3333V3.99992H12.6667Z' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M6.66666 7.33325V11.3333' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M9.33334 7.33325V11.3333' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e";const le=({authorEmail:a,onDeletePost:n,shareUrl:i,post:r,className:s="",popoverClassName:d="",onBookmark:u,onRemoveBookmark:p,onEditPost:v})=>{const{data:{locale:g,userInfo:f,togetherUserId:h,env:{isMarryBaby:C}},action:{pushNotifications:y}}=t.useContext(m.TogetherComponentGlobalContext),{t:E}=o.useTranslations(),[k,b]=t.useState(!1),[P,T]=t.useState(!1),[S,x]=t.useState(!1),{authActionWrapper:N}=l.useTogetherAuthRequiredAction(),A=a&&(null==f?void 0:f.email)&&a===String(null==f?void 0:f.email);return w.default.createElement("div",{className:s,onClick:e=>{e.preventDefault(),e.stopPropagation()}},S&&w.default.createElement(l.SharePopup,{url:i,text:null==r?void 0:r.title,onClose:()=>x(!1)}),P&&w.default.createElement(O,{thumbnail:c.CommonGAssets.getAssetPath("trash-bin.svg"),isThumbnailIcon:!0,title:E("popup.deletePost.title"),description:E("popup.deletePost.description"),acceptText:E("popup.deletePost.accept"),cancelText:E("popup.deletePost.cancel"),onAccept:()=>e.__awaiter(void 0,void 0,void 0,(function*(){if((null==r?void 0:r.id)&&!k){b(!0);try{const t=yield(({id:t,locale:a})=>e.__awaiter(void 0,void 0,void 0,(function*(){if(t)return yield m.callApiWithAuth(m.getApiPath(m.PATHS.POST.DELETE,{id:t,_locale:a}),"DELETE")})))({id:r.id,locale:g});1===(null==t?void 0:t.status)&&(null==n||n())}catch(e){}b(!1)}})),onClose:()=>T(!1)}),w.default.createElement(l.TreePopoverMenu,{className:d,toggleButtonContent:w.default.createElement("img",{src:C?X:ee,loading:"lazy"}),position:"bottom",align:"end",buttonProps:{isLoading:k},data:A?{isShowheader:!1,type:"list",list:[{icon:te,label:E("morePopover.share"),onClick:()=>x(!0)},{icon:"data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M7.16952 3.2356H2.99484C2.6785 3.2356 2.37512 3.36126 2.15143 3.58495C1.92774 3.80863 1.80208 4.11202 1.80208 4.42836V12.7777C1.80208 13.094 1.92774 13.3974 2.15143 13.6211C2.37512 13.8448 2.6785 13.9705 2.99484 13.9705H11.3442C11.6605 13.9705 11.9639 13.8448 12.1876 13.6211C12.4113 13.3974 12.537 13.094 12.537 12.7777V8.60303' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M11.6425 2.341C11.8798 2.10375 12.2016 1.97046 12.5371 1.97046C12.8726 1.97046 13.1944 2.10375 13.4317 2.341C13.6689 2.57826 13.8022 2.90005 13.8022 3.23558C13.8022 3.57111 13.6689 3.89289 13.4317 4.13015L7.76607 9.79578L5.38054 10.3922L5.97692 8.00663L11.6425 2.341Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",label:E("actionPopover.edit"),onClick:v},{icon:ae,label:E("actionPopover.delete"),onClick:()=>{N((()=>T(!0)))}}]}:{isShowheader:!1,type:"list",list:[{icon:te,label:E("morePopover.share"),onClick:()=>x(!0)},{icon:(null==r?void 0:r.bookmarked)?J:Y,label:(null==r?void 0:r.bookmarked)?E("morePopover.unsavePost"):E("morePopover.savePost"),onClick:()=>{N((()=>e.__awaiter(void 0,void 0,void 0,(function*(){if((null==f?void 0:f.id)&&(null==r?void 0:r.id))if(null==r?void 0:r.bookmarked){const e=yield m.callApiWithAuth(m.getApiPath(m.PATHS.BOOKMARK.DELETE,{_locale:g}),"DELETE",{data:{post_id:String(r.id)}});1===(null==e?void 0:e.status)?(y({title:"",message:"Removed saved post",type:"success",displayIcon:Y}),p&&p()):y({title:"",message:"Remove failed",type:"danger",displayIcon:Y})}else{const e=yield m.callApiWithAuth(m.getApiPath(m.PATHS.BOOKMARK.CREATE,{_locale:g}),"POST",{data:{user_id:h||f.id,post_id:r.id}});1===(null==e?void 0:e.status)?(y({title:"",message:"Post saved",type:"success",displayIcon:J}),u&&u()):y({title:"",message:"Post saved failed",type:"danger",displayIcon:Y})}}))))}},{icon:D,label:E("morePopover.report"),subTree:{title:E("morePopover.report.title"),description:E("morePopover.report.description"),isShowheader:!0,type:"list",list:Object.keys(m.REPORT_REASON_MAP).map((e=>({label:m.REPORT_REASON_MAP[e].label,reason:m.REPORT_REASON_MAP[e].reportReasonText,reasonValue:e}))).map((e=>({label:E(e.label),subTree:{title:E("morePopover.reportSubmit.title"),description:E("morePopover.reportSubmit.description"),isShowheader:!0,type:"jsx",jsxRenderer:t=>w.default.createElement(F,{reason:e.reasonValue,reasonText:E(e.reason),postId:null==r?void 0:r.id,onClose:()=>t&&t(!1)})}})))}}]}}))};const oe=({onDeleteComment:a,commentId:n,className:i="",popoverClassName:r=""})=>{const{data:{env:{isMarryBaby:s},locale:d},action:{pushNotifications:c}}=t.useContext(m.TogetherComponentGlobalContext),{t:u}=o.useTranslations(),[p,v]=t.useState(!1),{authActionWrapper:g}=l.useTogetherAuthRequiredAction();return w.default.createElement("div",{className:i,onClick:e=>{e.preventDefault(),e.stopPropagation()}},p&&w.default.createElement(O,{thumbnail:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='17' fill='none'%3e%3cg stroke='%23737373' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' clip-path='url(%23clip0)'%3e%3cpath d='M2 4.008h12M5.333 4.008V2.675a1.333 1.333 0 0 1 1.334-1.333h2.666a1.333 1.333 0 0 1 1.334 1.333v1.333m2 0v9.334a1.333 1.333 0 0 1-1.334 1.333H4.667a1.333 1.333 0 0 1-1.334-1.333V4.008h9.334ZM6.667 7.342v4M9.333 7.342v4'/%3e%3c/g%3e%3cdefs%3e%3cclipPath id='clip0'%3e%3cpath fill='white' d='M0 .008h16v16H0z'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",isThumbnailIcon:!0,title:u("popup.deleteComment.title"),description:u("popup.deleteComment.description"),acceptText:u("popup.deletePost.accept"),cancelText:u("popup.deletePost.cancel"),onAccept:()=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;if(!n)return;const t=yield(({id:e,locale:t})=>m.callApiWithAuth(m.getApiPath(m.PATHS.COMMENT.DELETE,{_locale:t,id:e}),"DELETE"))({id:n,locale:d});1===(null==t?void 0:t.status)?(a&&a(),c({title:"",message:u("notification.success"),type:"success"})):c({title:"",message:(null===(e=null==t?void 0:t.messages)||void 0===e?void 0:e[0])||u("notification.failure"),type:"danger"})})),onClose:()=>v(!1)}),w.default.createElement(l.TreePopoverMenu,{position:"bottom",align:"end",data:{isShowheader:!1,type:"list",list:[{icon:ae,label:u("actionPopover.delete"),onClick:()=>{g((()=>{v(!0)}))}}]},className:r,toggleButtonContent:w.default.createElement("img",{src:s?X:ee,loading:"lazy"}),buttonProps:{}}))};var ne="-dzIuHr";const ie=({userId:e,avatar:a,name:n,role:s,title:d,className:c})=>{const{t:u}=o.useTranslations(),[m,p]=t.useState(!1);return w.default.createElement(w.default.Fragment,null,w.default.createElement(h.Button,{className:`${ne} ${c}`,color:"success",size:"xs",onClick:()=>p(!0),style:{padding:"5px 8px",marginBottom:"12px",borderRadius:"4px"}},w.default.createElement("span",{className:"text"},w.default.createElement(r.Icon.Endorse,{isSolid:!0,size:18,color:i.theme.colors.green800,className:"icon"}),u("cardReply.verifyBy",{name:`${n||""}`}))),w.default.createElement(l.ProfileDetailModal,{open:m,onClose:()=>p(!1),profileModalProps:{zIndex:1e3}},w.default.createElement(l.ProfileDetail,{authorProps:{userId:e,avatar:a,name:n,role:s,title:d},hideQuestionTab:!0})))};const re=({className:a,style:n,comment:i,type:r="comment",level:s=0,replyingId:c,onPostCommentSuccess:u,post:p,onDeleteComment:v,refetchComment:g,hasQuickBookingEnable:f,handleMakeAppointment:C,cardAuthorProps:y,maxChars:E=600,disableShortenContent:k})=>{var b,P,T,x,N,A,I,_,M,L,j,R,B;const{data:{locale:O,userInfo:D,env:{isMarryBaby:F}}}=t.useContext(m.TogetherComponentGlobalContext),{t:U}=o.useTranslations(),[H,W]=t.useState(i||null),{id:V,countLikes:G,content:q,replies:Z=[],images:Q=[],author:K,liked:X,link:J,mentionedUser:Y,mentions:ee}=H,{text:te,replyingTo:ae}=(e=>{try{const t=e.match(/\[@([^\]]+)\]/),a=t?t[0].replace("[@","").replace("]",""):"";return{text:e.replace(/\[@([^\]]+)\]/,"").trim(),replyingTo:a}}catch(e){}return{text:""}})(q),{authActionWrapper:le}=l.useTogetherAuthRequiredAction({_joinCommunityIds:[null===(b=null==p?void 0:p.community)||void 0===b?void 0:b.id],_joinTopicIds:null===(P=null==p?void 0:p.topics)||void 0===P?void 0:P.map((e=>e.id))}),[ne,se]=t.useState(4),de=!!(null==D?void 0:D.id)&&(null==Z?void 0:Z.some((e=>e.author.id===D.id))),ce=e=>{W((t=>{if(!t.replies.find((t=>t.id===e.id))){t.replies.unshift(e);const a=Object.assign(Object.assign({},t),{replies:t.replies.slice(),countReplies:t.countReplies+1});return g&&g(a),a}return t}))},[ue,me]=t.useState(!1),pe=t.useMemo((()=>"comment"===r&&Z&&0!=Z.length?Z.sort(((e,t)=>{const a=new Date(e.createdAt).getTime(),l=new Date(t.createdAt).getTime();return a>l?-1:a<l?1:0})):Z),[r,Z]),ve=(null==Z?void 0:Z.length)||0,ge=String(null==K?void 0:K.email)&&(null==D?void 0:D.email)&&String(null==K?void 0:K.email)===String(null==D?void 0:D.email),fe=(null==K?void 0:K.name)||(null==K?void 0:K.username)||"",he=(null==K?void 0:K.username)||(null==K?void 0:K.name)||"",Ce=null==K?void 0:K.avatar,ye=(null==p?void 0:p.isAnonymous)||null==K?void 0:K.role,Ee=[...(null==p?void 0:p.isAnonymous)?[{id:(null===(T=null==p?void 0:p.author)||void 0===T?void 0:T.id)||0,name:U("cardPost.anonymous")}]:[],...ee||[]],[we,ke]=t.useState(null),[be,Pe]=t.useState(null);t.useEffect((()=>{if(null==K?void 0:K.hospitalId){const t=t=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;const a=yield m.callApi(m.getCarePath(m.CARE_PATHS.GET_HOSPITAL_INFO,{hospital_branch_id:t,website_url:d.domainLocales[O]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.branch)&&ke(null==a?void 0:a._data.branch)}));t(K.hospitalId)}if(null==K?void 0:K.doctorId){const t=t=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;const a=yield m.callApi(m.getCarePath(m.CARE_PATHS.GET_DOCTOR_INFO,{doctorId:t,website_url:d.domainLocales[O]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.doctor)&&Pe(null==a?void 0:a._data.doctor)}));t(K.doctorId)}}),[K.hospitalId,K.doctorId]);const Te=(null==be?void 0:be.valid_outpatient)||(null==be?void 0:be.valid_telemedicine),Se=((null==we?void 0:we.total_available_service)||(null==we?void 0:we.total_available_doctor))>0,xe=f&&(Te||Se),Ne="chatbot"===(null===(x=null==H?void 0:H.author)||void 0===x?void 0:x.type);return w.default.createElement(l.TogetherAuthConfigContextProvider,{defaultParams:{_joinCommunityIds:[null===(N=null==p?void 0:p.community)||void 0===N?void 0:N.id],_joinTopicIds:null===(A=null==p?void 0:p.topics)||void 0===A?void 0:A.map((e=>e.id))}},w.default.createElement(l.StyledCardPost,{className:a,style:n,"data-is-reply":!!s,"data-is-marrybaby":F,"data-has-booking":xe},"reply"===r&&w.default.createElement(l.Divider,{className:"top-divider",type:"solid"}),w.default.createElement("div",{style:{padding:"16px 16px 0"}},w.default.createElement(l.CardAuthor,Object.assign({avatar:Ce,name:fe,username:he,timeText:null==p?void 0:p.createdTime,community:null==p?void 0:p.community,className:"post-author "+(ge?"with-popover":""),type:r,userId:null==K?void 0:K.id,role:ye,expertId:null==K?void 0:K.partnerId,title:null==K?void 0:K.title,doctorId:null==K?void 0:K.doctorId,hospitalId:null==K?void 0:K.hospitalId,hasQuickBooking:xe,handleMakeAppointment:C,isAnonymous:(null==H?void 0:H.isAnonymous)||Boolean(null==p?void 0:p.isAnonymous)&&(null===(I=null==p?void 0:p.author)||void 0===I?void 0:I.username)===(null==K?void 0:K.username),hideBackground:Ne,userType:null==K?void 0:K.type},y)),Boolean(null==H?void 0:H.isVerify)&&!Boolean(null==H?void 0:H.isOppose)&&w.default.createElement(ie,{title:null===(_=null==H?void 0:H.userVerify)||void 0===_?void 0:_.title,name:null===(M=null==H?void 0:H.userVerify)||void 0===M?void 0:M.name,userId:null===(L=null==H?void 0:H.userVerify)||void 0===L?void 0:L.id,role:null===(j=null==H?void 0:H.userVerify)||void 0===j?void 0:j.role,avatar:null===(R=null==H?void 0:H.userVerify)||void 0===R?void 0:R.avatar,className:"verify-tag"})),w.default.createElement(l.PostContent,{className:"post-content-wrapper",replyingTo:ae,mentionedUser:Y,description:te,mentions:Ee,maxChars:E,disableShortenContent:k}),w.default.createElement("span",null),w.default.createElement("span",null),Q&&Q.length>0?w.default.createElement("div",{key:"image-preview",className:"image-preview-wrapper","data-is-reply":!0},w.default.createElement($,{images:Q,authorName:null==K?void 0:K.username})):null,Q&&0!==Q.length||!J?null:w.default.createElement("div",{key:"link-preview",className:"link-preview-wrapper","data-is-reply":!0},w.default.createElement(S,{url:J})),"most-engaging"!==r?w.default.createElement(w.default.Fragment,null,Ne&&w.default.createElement(l.StyledSourceList,{listUrl:null==H?void 0:H.source,categorySlug:null==H?void 0:H.categorySlug}),w.default.createElement(l.CardReactions,{type:l.CardReactionType.reply,loveCount:G,replyCount:ve,className:"post-reaction",liked:X,isReplied:de,hideCommentIcon:"reply"===r||Ne,hasShare:!1,onCommentClick:()=>le((()=>me((e=>!e)))),onCommentCountClick:()=>le((()=>{me(!0)})),onLikeClick:()=>le((()=>e.__awaiter(void 0,void 0,void 0,(function*(){if(V){const t=yield(({commentId:t,setLike:a=!1,locale:l})=>e.__awaiter(void 0,void 0,void 0,(function*(){return m.callApiWithAuth(m.getApiPath(a?m.PATHS.COMMENT.LIKE:m.PATHS.COMMENT.UNLIKE,{_locale:l,id:t}),"GET")})))({commentId:V,setLike:!X,locale:O});1===t.status&&W((e=>Object.assign(Object.assign({},e),{liked:!X,countLikes:e.countLikes+(X?-1:1)})))}}))))}),ue&&w.default.createElement(z,{replyingId:c||H.id,replyToName:fe,isReply:!0,onClose:()=>me(!1),onPostSuccess:e=>{"reply"===r?u&&u(e):ce(e)},post:p,replyingUser:K}),"comment"===r&&Z&&Z.length>0?w.default.createElement("div",{className:"comment-reply-wrapper"},null===(B=null==pe?void 0:pe.slice(0,ne))||void 0===B?void 0:B.map((e=>w.default.createElement(re,{key:e.id,comment:e,type:"reply",className:"comment-reply-item",level:s+1,replyingId:V,onPostCommentSuccess:ce,post:p,onDeleteComment:()=>{W((t=>Object.assign(Object.assign({},t),{replies:t.replies.filter((t=>t.id!==e.id)),countReplies:t.countReplies-1})))},handleMakeAppointment:C,hasQuickBookingEnable:f}))),ve>ne&&w.default.createElement(w.default.Fragment,null,w.default.createElement(l.Divider,{className:"top-divider",type:"solid"}),w.default.createElement(h.Button,{className:"more-cmt",size:"lg",color:"ghost",onClick:()=>se((e=>e+4))},U("comment.seeMoreReplies",{count:ve-ne}),w.default.createElement("img",{className:"chevron-right",src:"data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M6 12L10 8L6 4' stroke='%232D87F3' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",loading:"lazy"})))):null):null,ge&&w.default.createElement(oe,{onDeleteComment:v,className:"popover",commentId:H.id})))},se=(t,a)=>e.__awaiter(void 0,void 0,void 0,(function*(){var e,l,o;const n=yield m.callApiWithOptionalAuth(m.getApiPath(m.PATHS.COMMENT.LIST,{postId:t,_locale:a,sort:"popularity",perPage:1,withoutReply:1}),"GET");return null===(o=null===(l=null===(e=null==n?void 0:n.data)||void 0===e?void 0:e.comments)||void 0===l?void 0:l.map(p.formatComment))||void 0===o?void 0:o[0]}));var de=Object.freeze({__proto__:null});exports.CardLink=S,exports.CardPost=({className:a,style:n,hideViewMoreComment:i,showMostEngaging:r,onCommentClick:s,onCommentCountClick:d,onMostEngagingCommentClick:c,onPostCommentSuccess:u,disableCardLink:p,disableShortenContent:v,onDeletePost:g,onEditPost:f,post:C,mostEngagingComment:y,onDeleteComment:E,showInputComment:b,InlineCommentsComponent:P,hasQuickBookingEnable:T,handleMakeAppointment:A,cardAuthorProps:I})=>{const[_,M]=t.useState(C),[L,j]=t.useState(!1),[R,B]=t.useState(y),{community:O,topics:D,author:F,slug:U,isPin:H,liked:W,photos:V,mentions:q,title:Z,description:Q,previewUrl:K,likesCount:X,commentsCount:J,id:Y,commented:ee}=_,{data:{locale:te,env:{isMarryBaby:ae,togetherBasePath:oe}},action:{pushNotifications:ne}}=t.useContext(m.TogetherComponentGlobalContext),{t:ie}=o.useTranslations(),[de,ce]=t.useState(b),ue=`${oe}/${(null==O?void 0:O.slug)||"_"}/${U||""}`,me=`${m.getCurrentBaseUrl(te)}${ue}`,{authActionWrapper:pe}=l.useTogetherAuthRequiredAction((null==O?void 0:O.slug)?{_joinCommunityIds:[O.id],_joinTopicIds:null==D?void 0:D.map((e=>e.id))}:void 0),[ve,ge]=t.useState(!1);t.useEffect((()=>{ce(b)}),[b]);const fe=(null==F?void 0:F.name)||(null==F?void 0:F.username)||"",he=(null==F?void 0:F.username)||(null==F?void 0:F.name)||"",Ce=null==F?void 0:F.avatar,ye=(null==_?void 0:_.isAnonymous)||null==F?void 0:F.role,[Ee,we]=t.useState(null),[ke,be]=t.useState(null);t.useEffect((()=>{if(null==F?void 0:F.hospitalId){(t=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;const a=yield m.callApi(m.getCarePath(m.CARE_PATHS.GET_HOSPITAL_INFO,{hospital_branch_id:t,website_url:m.domainLocales[te]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.branch)&&we(null==a?void 0:a._data.branch)})))(F.hospitalId)}if(null==F?void 0:F.doctorId){(t=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;const a=yield m.callApi(m.getCarePath(m.CARE_PATHS.GET_DOCTOR_INFO,{doctorId:t,website_url:m.domainLocales[te]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.doctor)&&be(null==a?void 0:a._data.doctor)})))(F.doctorId)}}),[F.hospitalId,F.doctorId]);const Pe=(null==ke?void 0:ke.valid_outpatient)||(null==ke?void 0:ke.valid_telemedicine),Te=((null==Ee?void 0:Ee.total_available_service)||(null==Ee?void 0:Ee.total_available_doctor))>0,Se=T&&(Pe||Te);t.useEffect((()=>{e.__awaiter(void 0,void 0,void 0,(function*(){if(Y&&J&&r&&!(null==y?void 0:y.id)){const e=yield se(Y,te);B(e)}}))}),[Y,te,J,r,null==y?void 0:y.id]),t.useEffect((()=>{B(y)}),[null==y?void 0:y.id]);const xe=t=>e.__awaiter(void 0,void 0,void 0,(function*(){if(J>1&&(null==R?void 0:R.id)&&(null==R?void 0:R.id)===(null==t?void 0:t.id)){const e=yield se(Y,te);B(e)}M((e=>Object.assign(Object.assign({},e),{commentsCount:e.commentsCount-1}))),E&&E(t)}));return w.default.createElement(l.TogetherAuthConfigContextProvider,{defaultParams:(null==O?void 0:O.slug)?{_joinCommunityIds:[O.id],_joinTopicIds:null==D?void 0:D.map((e=>e.id))}:void 0},L&&w.default.createElement(l.SharePopup,{url:me,avatar:m.DEFAULT_IMG,text:Z,onClose:()=>j(!1)}),w.default.createElement(l.StyledCardPost$1,{className:a,style:n,"data-is-marrybaby":ae},H?w.default.createElement(x,{className:"post-pin"}):null,w.default.createElement("div",{style:{position:"relative",padding:"1rem 1rem 0"}},w.default.createElement(l.CardAuthor,Object.assign({avatar:Ce,name:fe,username:he,url:p?void 0:ue,community:O,timeText:null==_?void 0:_.createdTime,className:"post-author",role:ye,userId:null==F?void 0:F.id,expertId:null==F?void 0:F.partnerId,doctorId:null==F?void 0:F.doctorId,hospitalId:null==F?void 0:F.hospitalId,title:null==F?void 0:F.title,hasQuickBooking:Se,handleMakeAppointment:A,"data-testid":"name",isAnonymous:!!(null==_?void 0:_.isAnonymous),extendEle:w.default.createElement(le,{authorEmail:String(null==F?void 0:F.email),onDeletePost:g,shareUrl:me,post:_,className:"popover",onEditPost:f})},I))),w.default.createElement("a",{href:p?void 0:ue,className:"post-content-link-wrapper"},Z&&w.default.createElement(m.Heading,{className:"post-content-title",as:"h2",tag:"h5",fontWeight:"bold","data-testid":"Title of the Post"},k.default(Z)),w.default.createElement(l.PostContent,{className:"post-content-wrapper",description:Q,disableShortenContent:v,mentions:q,"data-testid":"Content of the Post"})),w.default.createElement("span",null),w.default.createElement("span",null),w.default.createElement("div",{key:"tag-topic"},D&&D.length>0?w.default.createElement(l.TagTopic,{topics:D,className:"post-topics"}):null),w.default.createElement("div",{key:"social-preview"},(null==_?void 0:_.introUrl)?w.default.createElement("div",{className:"social-preview-wrapper "+((null==V?void 0:V.length)?"has-image":"")},w.default.createElement(G,{url:_.introUrl,image:_.bannerImage})):null),w.default.createElement("div",{key:"image-preview"},(null==V?void 0:V.length)?w.default.createElement("div",{className:"image-preview-wrapper"},w.default.createElement($,{images:V,authorName:null==F?void 0:F.name})):null),w.default.createElement("div",{key:"link-preview"},(null==_?void 0:_.introUrl)||(null==V?void 0:V.length)||!(null==K?void 0:K.url)?null:w.default.createElement("div",{className:"link-preview-wrapper"},w.default.createElement(S,{title:K.title,url:K.url,image:K.image}))),w.default.createElement(l.CardReactions,{isMarryBaby:ae,type:l.CardReactionType.post,loveCount:X,replyCount:J,className:"post-reaction "+((null==V?void 0:V.length)||(null==K?void 0:K.url)?"hide-top-border":""),liked:ve?!W:W,isReplied:ee,onCommentClick:()=>pe((()=>{s?s():ce((e=>!e))})),onCommentCountClick:()=>{pe((()=>{ae?ce(!0):d?d():!p&&(window.location.href=ue)}))},onShareClick:()=>{j(!0)},onLikeClick:()=>e.__awaiter(void 0,void 0,void 0,(function*(){if(Y&&!ve){ge(!0);try{const t=yield(({id:t,locale:a})=>e.__awaiter(void 0,void 0,void 0,(function*(){if(t)return yield m.callApiWithAuth(m.getApiPath(m.PATHS.POST.LIKE,{id:t,_locale:a}),"GET")})))({id:Y,locale:te});1!==(null==t?void 0:t.status)?ne(N(ie)):M((e=>Object.assign(Object.assign({},e),{likesCount:(e.likesCount||0)+(e.liked?-1:1),liked:!e.liked})))}catch(e){ne(N(ie))}ge(!1)}})),showingMostEngaging:!(!r||!(null==R?void 0:R.id))}),de&&w.default.createElement(z,{isMainCmt:!b,onClose:()=>ce(!1),onPostSuccess:e=>{0!==J||(null==R?void 0:R.id)||B(e),M((e=>Object.assign(Object.assign({},e),{commentsCount:e.commentsCount+1,commented:!0}))),u&&u(e)},post:_}),r&&(null==R?void 0:R.id)?w.default.createElement("div",{className:"most-engaging-wrapper",onClick:e=>{c?(e.stopPropagation(),c()):window.location.href=ue}},w.default.createElement(re,{hasQuickBookingEnable:T,handleMakeAppointment:A,comment:R,post:_,onDeleteComment:()=>{xe&&xe(R)},className:"most-engaging-comment",type:"most-engaging",key:R.id,cardAuthorProps:I}),J>1&&!i&&w.default.createElement(h.Button,{className:"see-more-comments",color:"ghost",size:"md"},ie("comment.seeMoreComments",{count:J-1}))):null,P))},exports.CardPostPopoverMore=le,exports.CardReply=re,exports.CardReplyPopover=oe,exports.CreateNewPostContent=({className:n,style:d,onPostCreatedEdited:v,onClose:g,communities:f=[],forceSelectCommunity:h,forceSelectTopics:C,articleId:y,optionalTopic:E,editPostData:b,defaultCommunity:P,defaultTopics:T,noFetchTopic:S,hideTopicList:x,selectAskDoctor:I,showAskDoctorOptions:_,currentPageUrl:L})=>{const B=!!(null==b?void 0:b.id),{data:{locale:O,env:{isMarryBaby:z}},action:{pushNotifications:D,sanitizeFunction:F}}=t.useContext(m.TogetherComponentGlobalContext),{t:U}=o.useTranslations(),[H,W]=t.useState(!1),[V,$]=t.useState(I),[G,q]=t.useState(!1),[Z,Q]=t.useState(!1),[K,X]=t.useState(!1),[J,Y]=t.useState(""),[ee,te]=t.useState(""),[ae,le]=t.useState(h?{label:h.name,value:`${h.id||""}-${h.mappedCategoryId||""}`}:{label:U("community.choose"),value:""}),[oe,ne]=t.useState([...C]||[]),[ie,re]=t.useState([]),[se,de]=t.useState([]),ce=h||f.find((e=>`${e.id||""}-${e.mappedCategoryId||""}`===ae.value)),ue=h?[h]:f.filter((e=>e.isActive)).sort(((e,t)=>e.name>t.name?1:e.name<t.name?-1:0)),[me,pe]=t.useState(null),[ve,ge]=t.useState([]),fe=J&&!Z&&k.default(ee)&&(E||!E&&oe.length>0)&&ce&&(!ie||ie.length<=m.MAX_IMAGE_UPLOADS)&&!(null==ve?void 0:ve.length)&&!K;t.useEffect((()=>{if(b){const e=b;Y(e.title||""),te(l.decodeMention(l.decodePostUrl(e.description||"","edit"),e.mentions)),le({label:e.community.name,value:`${e.community.id||""}-${e.community.mappedCategoryId||""}`}),ne(e.topics||[]),re(e.photos||[]),W(!!e.isAnonymous||!1),$(!!e.isAskDoctor||!1)}else P&&le({label:P.name,value:`${P.id||""}-${P.mappedCategoryId||""}`}),T&&ne(T)}),[]),t.useEffect((()=>{Q(""!==J&&!/[a-zA-Z]/.test(J))}),[J]);const he=()=>e.__awaiter(void 0,void 0,void 0,(function*(){var t,a,o,n,i,r,s,d,c;if(_&&void 0===V)return q(!0),!1;const f=yield(({title:t,description:a,communityId:o,imageFiles:n,previewUrl:i,topicIds:r,locale:s,sanitizeFunction:d,categoryCommunityId:c,categoryTopicIds:p,introUrl:v,bannerUrl:g,scheduleTime:f,isAnonymous:h,isAskDoctor:C})=>e.__awaiter(void 0,void 0,void 0,(function*(){const e=new FormData,y=l.removeBannedWordWrapper(a),E=l.removeBannedWordWrapper(t),w=l.getMentionIdsFromString(y);if(e.append("title",E),e.append("description",l.encodePostContent(y,d)),c?e.append("category_community",String(c)):o&&e.append("community_id",String(o)),e.append("is_anonymous",h?"1":"0"),e.append("is_question",C?"1":"0"),(null==i?void 0:i.title)&&e.append("preview_title",i.title),(null==i?void 0:i.description)&&e.append("preview_description",i.description),(null==i?void 0:i.url)&&e.append("preview_link",u.safeEncodeURI(i.url)),(null==i?void 0:i.image)&&e.append("preview_image",u.safeEncodeURI(i.image)),null==r||r.forEach((t=>{e.append("topics[]",String(t||""))})),null==p||p.forEach((t=>{e.append("category_topics[]",String(t||""))})),null==n?void 0:n.length){const t=yield Promise.all(n.map(((e,t)=>new Promise((a=>{setTimeout((()=>{a(l.uploadAndGetSrc(e,s))}),2e3*t)})))));null==t||t.filter(Boolean).slice(0,m.MAX_IMAGE_UPLOADS).forEach(((t,a)=>{e.append(`images[${a}]`,t)}))}else e.append("images","");return null==w||w.forEach((t=>{e.append("mention_ids[]",t)})),e.append("intro_url",v||""),e.append("banner",g||""),f&&(e.append("post_type","scheduled"),e.append("schedule_datetime",f)),e})))({title:J,description:ee,communityId:String((null==ce?void 0:ce.id)||""),imageFiles:ie,previewUrl:me,topicIds:null==oe?void 0:oe.map((e=>String(e.id||""))).filter(Boolean),locale:O,sanitizeFunction:F,categoryCommunityId:String((null==ce?void 0:ce.mappedCategoryId)||""),categoryTopicIds:null==oe?void 0:oe.map((e=>String(e.mappedCategoryId||""))).filter(Boolean),isAnonymous:H?1:0,isAskDoctor:V?1:0});let h;y&&f.append("article_id",y),B?(null==b?void 0:b.id)&&(h=yield(({id:t,locale:a,formData:l})=>e.__awaiter(void 0,void 0,void 0,(function*(){return yield m.callApiWithAuth(m.getApiPath(m.PATHS.POST.UPDATE,{id:t,_locale:a}),"POST",{data:l})})))({id:b.id,formData:f,locale:O})):h=yield(({locale:t,formData:a,isArticleComment:l})=>e.__awaiter(void 0,void 0,void 0,(function*(){return yield m.callApiWithAuth(m.getApiPath(l?m.PATHS.POST.CREATE_ARTICLE_COMMENT:m.PATHS.POST.CREATE,{_locale:t}),"POST",{data:a})})))({formData:f,locale:O,isArticleComment:!(null==ce?void 0:ce.id)&&!!(null==ce?void 0:ce.mappedCategoryId)});const C=null==h?void 0:h.data;(null==C?void 0:C.id)&&!(null===(a=null===(t=null==h?void 0:h.messages)||void 0===t?void 0:t.moderation)||void 0===a?void 0:a.type)?(D({message:U("createPost.popup.success"),type:"success"}),(e=>{v&&v(p.formatPost(e),B),g&&g()})(C)):"banned"===(null===(n=null===(o=null==h?void 0:h.messages)||void 0===o?void 0:o.moderation)||void 0===n?void 0:n.type)?(D({title:U("notification.post.blocked.title"),message:U("notification.post.blocked.message"),type:"danger"}),h.messages.moderation.words&&de(h.messages.moderation.words)):"suspect"===(null===(r=null===(i=null==h?void 0:h.messages)||void 0===i?void 0:i.moderation)||void 0===r?void 0:r.type)?(D({title:U("notification.post.suspect.title"),message:U("notification.post.suspect.message"),type:"warning"}),g&&g()):(null===(d=null===(s=null==h?void 0:h.messages)||void 0===s?void 0:s.find)||void 0===d?void 0:d.call(s,(e=>{var t;return!!(null===(t=null==e?void 0:e.includes)||void 0===t?void 0:t.call(e,"suspend"))})))?(D({message:U("notification.suspend.message"),type:"danger"}),g&&g()):D({message:(null===(c=null==h?void 0:h.messages)||void 0===c?void 0:c[0])||U("notification.failure"),type:"danger"})}));return w.default.createElement(l.StyledCreateNewPost,{className:n,style:d},w.default.createElement("div",{className:"input-group-container"},w.default.createElement(j,{className:"input-group",bannedWords:se,value:J,onChange:Y}),Z&&w.default.createElement(l.StyledError,null,w.default.createElement(r.Info,{isSolid:!0,color:i.theme.colors.red700,size:14}),w.default.createElement(r.Text,{size:"p3",as:"span",color:i.theme.colors.red700},U("createPost.popup.specialCharErr"))),w.default.createElement(M,{className:"input-group",bannedWords:se,value:ee,onChange:te,onPreviewUrlChange:pe,onInvalidUrlsChange:ge,onImageFilesChange:re,imageFiles:ie}),_&&w.default.createElement(l.StyledIsQuestion,{"data-is-marry-baby":z},w.default.createElement("div",{className:"switch-label"},w.default.createElement(r.Ask,{isMarryBaby:z,size:z?32:24,color:i.theme.colors.primaryBase,className:"label-icon"}),w.default.createElement("span",{className:"label-txt"},U("createPost.askDoctor"))),w.default.createElement(l.BtnChoice,{value:V,choices:[{label:U("createPost.askDoctorChoice.yes"),value:!0,dataEventCategory:"Together",dataEventAction:"Write Post Click - Ask Doctor",dataEventLabel:L},{label:U("createPost.askDoctorChoice.no"),value:!1}],onChange:e=>{"boolean"==typeof e&&(q(!1),$(e))}})),G&&w.default.createElement(l.StyledError,null,w.default.createElement(r.Info,{isSolid:!0,color:i.theme.colors.red700,size:14}),w.default.createElement(r.Text,{size:"p3",as:"span",color:i.theme.colors.red700},U("createPost.message.askDoctorRequire"))),w.default.createElement("div",{className:"input-group"},w.default.createElement(r.Text,{size:"p4",className:"input-group-label"},U("admin.community")),w.default.createElement(l.Dropdown,{options:(null==ue?void 0:ue.map((e=>({label:e.name,value:`${e.id||""}-${e.mappedCategoryId||""}`}))))||[],id:"community-picker",placeholder:U("community.choose"),value:ae,dropdownLabelTrackingAttributes:{"data-event-category":"Together","data-event-action":"Write Post Click - Choose Community/Topic","data-event-label":L},onChange:e=>{le({label:e.label,value:String(e.value)}),ne([])},disabled:!!h}),w.default.createElement(r.Text,{size:"sm",className:"warning",color:i.theme.colors.gray400},"* ",U("commentPopup.warning.newPost"))),!x&&w.default.createElement("div",{className:"input-group"},w.default.createElement(r.Text,{size:"p4",className:"input-group-label"},U("tab.topic")),w.default.createElement("div",{className:"input-notification"},w.default.createElement("img",{src:ce?"data:image/svg+xml,%3csvg width='16' height='17' viewBox='0 0 16 17' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M8 14.5C11.3137 14.5 14 11.8137 14 8.5C14 5.18629 11.3137 2.5 8 2.5C4.68629 2.5 2 5.18629 2 8.5C2 11.8137 4.68629 14.5 8 14.5Z' fill='%232D87F3'/%3e%3cpath d='M8 5.5V8.5' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M8 11.5H8.00708' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e":A,loading:"lazy"}),w.default.createElement(r.Text,{size:"base",color:i.theme.colors.gray500},U(ce?"createPost.popup.primary":"createPost.popup.warning"))),ce&&w.default.createElement(R,{className:"tag-list",communityId:ce.id,forceTopics:C,onChange:ne,selectedTopics:oe,noFetch:S,dataEventCategory:"Together",dataEventAction:"Write Post Click - Choose Community/Topic",dataEventLabel:L}))),w.default.createElement("div",{className:"form-action"},w.default.createElement("div",{className:"input-group"},w.default.createElement(a.Checkbox,{className:"swich-input-group",labelPosition:"left",name:"PostAnonymous",checked:H,color:z?"pink":void 0,"data-event-category":"Together","data-event-action":"Write Post Click - Incognito","data-event-label":L,label:w.default.createElement("div",{className:"switch-label"},w.default.createElement("img",{className:"label-icon",src:c.CommonGAssets.getAssetPath("anomyous-avatar.svg"),alt:"anomyous avatar",style:{marginRight:"10px",width:"24px"},loading:"lazy"}),w.default.createElement("span",{className:"label-txt"},U("createPost.postAnonymous"))),value:"Post Anonymous",onChange:e=>W(e.currentTarget.checked),styles:{body:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"},label:{display:"flex",alignItems:"center"}}})),w.default.createElement("div",{className:"input-group"},w.default.createElement(s.Button,{className:"submit-btn pointer-event-child-none",size:"lg","data-event-category":"Ask Doctor","data-event-action":"Submit Question","data-event-label":window.location.href,onClick:()=>e.__awaiter(void 0,void 0,void 0,(function*(){if(fe&&!K){X(!0);try{yield he()}catch(e){console.error(e),D(N(U))}X(!1)}})),disabled:!fe,loading:K},U("createPost.popup.submit")))))},exports.CreatePostDescription=M,exports.CreatePostTitle=j,exports.ImagePreviewPopup=U,exports.InputCommentBar=z,exports.LabelPin=x,exports.PopupDanger=O,exports.PostImagePreview=$,exports.PostSingleImageViewPopup=W,exports.SkipQuestionOfExpertBtn=l=>{var{post:n,onSkip:i,btnText:d,currentPageUrl:c}=l,u=e.__rest(l,["post","onSkip","btnText","currentPageUrl"]);const{t:p}=o.useTranslations(),{data:{locale:v},action:{pushNotifications:g}}=t.useContext(m.TogetherComponentGlobalContext),[f,h]=t.useState(!1),[C,y]=t.useState(!1),E=a.useMantineTheme(),k=t.useCallback((()=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;y(!0);const t=yield m.callApiWithAuth(m.getApiPath(m.PATHS.USER.SKIP_QUESTION,{_locale:v,id:null==n?void 0:n.id}),"PUT");1===(null==t?void 0:t.status)?(null==i||i({id:(null==n?void 0:n.id)||"",communityId:(null===(e=null==n?void 0:n.community)||void 0===e?void 0:e.id)||""}),h(!1),g({title:"",message:"Skip success",type:"success"})):g({title:"",message:null==t?void 0:t.messages,type:"danger"}),y(!1)}))),[]);return w.default.createElement(a.Popover,{width:327,withArrow:!0,shadow:"md",opened:f},w.default.createElement(a.Popover.Target,null,w.default.createElement("div",Object.assign({className:`${q} ${(null==u?void 0:u.className)||""}`,onClick:()=>h(!0)},u),d||p("profilePanel.questionNotClear"))),w.default.createElement(a.Popover.Dropdown,null,w.default.createElement("div",null,w.default.createElement("div",{className:Z},p("profilePanel.skipQuestion.heading")),w.default.createElement("div",{className:Q},p("profilePanel.skipQuestion.content")),w.default.createElement("div",{className:K},w.default.createElement(s.Button,{size:"md",variant:"secondary",leftIcon:w.default.createElement(r.Close,{color:E.fn.primaryColor(),size:24}),onClick:()=>h(!1),styles:()=>({leftIcon:{marginRight:0}})}),w.default.createElement(s.Button,{variant:"primary",size:"md",leftIcon:w.default.createElement(r.Check,{color:"white",size:24}),onClick:k,loading:C,"data-event-category":"Together","data-event-action":"Unclear Question Click","data-event-label":c,styles:()=>({leftIcon:{marginRight:0}})})))))},exports.SocialLinkPreview=G,exports.SubmitReportForm=F,exports.TopicSelectList=R,exports.VerifiedTag=ie,exports.types=de;
1
+ "use strict";var e=require("./tslib.es6-42b6a4e4.js"),t=require("react"),a=require("@mantine/core"),l=require("./index.styled-8b68590e.js"),o=require("./useTranslations-9940a064.js"),n=require("innertext"),i=require("./theme-bcfc4bf1.js"),r=require("./index-472cd02e.js"),s=require("./index-49ca569a.js");require("@mantine/dates");var d=require("./index-80ed081f.js");require("./Onboarding-321532f3.js");var c=require("./gAssets.js");require("dayjs");var u=require("./screenSizeContext-a1a2dd8f.js");require("styled-components"),require("./isProduction-48b088ec.js"),require("@mantine/hooks");var m=require("./index.styles-2679f17e.js"),p=require("./index-4647ac38.js"),v=require("./index-87067120.js"),g=require("lodash/debounce"),f=require("react-contenteditable");require("./useCategory-de21ce75.js");var h=require("./index-2e9c0de0.js"),C=require("react-dom");function y(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function E(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(a){if("default"!==a){var l=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,l.get?l:{enumerable:!0,get:function(){return e[a]}})}})),t.default=e,Object.freeze(t)}require("./constants-8bcbbfa4.js");var w=y(t),k=y(n),b=y(g),P=y(f),T=E(C);const S=({title:o,url:n,image:i,logo:s,className:d,style:c,noRefetch:u})=>{const{data:{locale:p,env:{isMarryBaby:v}}}=t.useContext(m.TogetherComponentGlobalContext),[g,f]=t.useState(!1),h=a.useMantineTheme(),C=t.useRef(u);C.current=u;const[y,E]=t.useState(null);t.useEffect((()=>{e.__awaiter(void 0,void 0,void 0,(function*(){if(!C.current){if(!n)return E(null);E((e=>Object.assign(Object.assign({},e),{isFetching:!0}))),m.callApi(m.getApiPath(m.PATHS.FETCH_PREVIEW,{_locale:p}),"POST",{data:{link:n},headers:{"Content-Type":"application/json"}}).then((e=>{var t,a,l;f(!1),E({title:null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.title,url:n,image:(null===(a=null==e?void 0:e.data)||void 0===a?void 0:a.image)||(null===(l=null==e?void 0:e.data)||void 0===l?void 0:l.logo)})})).catch((()=>{E(null)}))}}))}),[n]);const k=(null==y?void 0:y.image)||i,b=(null==y?void 0:y.title)||o,P=(null==y?void 0:y.logo)||s,T=(null==y?void 0:y.url)||n,S=T.replace("http://","").replace("https://","").split(/[/?#]/)[0],x=t.useRef(!1);return w.default.createElement(l.StyledCardLink,{"data-is-marrybaby":v,className:`${d} no-replace-click`,style:c,color:h.colors[h.primaryColor][0]},w.default.createElement("a",{href:T,target:"_blank",rel:"noreferrer"},k&&w.default.createElement("div",{className:"link-image-wrapper"},!v&&w.default.createElement("img",{className:"link-image-blur",src:k,onError:e=>{x.current||(x.current=!0,e.currentTarget.src=m.DEFAULT_IMG)},loading:"lazy"}),w.default.createElement("img",{className:"link-image",src:k,onError:e=>{x.current||(x.current=!0,e.currentTarget.src=m.DEFAULT_IMG)},loading:"lazy"})),w.default.createElement("div",{className:"link-info-container"},w.default.createElement(r.Text,{size:"n1"},v&&P&&!g&&w.default.createElement("img",{className:"link-logo",src:P,onError:()=>f(!0),loading:"lazy"}),S),w.default.createElement(m.Heading,{tag:"h6"},b))))};const x=({onClick:e,color:a,className:n,style:i})=>{const{data:{env:{isMarryBaby:r}}}=t.useContext(m.TogetherComponentGlobalContext),{t:s}=o.useTranslations();return w.default.createElement(l.LabelSortPin,{label:w.default.createElement(w.default.Fragment,null,r&&w.default.createElement("img",{className:"label-sort-pin-icon",src:"data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cpath d='M3.5 19.9999L7.87 15.6299' stroke='%23FB8C00' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e %3cpath fill-rule='evenodd' clip-rule='evenodd' d='M4.95634 11.294C4.56534 11.685 4.56534 12.318 4.95634 12.708L7.87434 15.626L10.7923 18.544C11.1833 18.935 11.8163 18.935 12.2063 18.544L13.3813 17.369C13.5693 17.181 13.6743 16.927 13.6743 16.662V12.726L16.5743 9.82597L18.8833 9.94897C19.1663 9.96397 19.4433 9.85797 19.6433 9.65797L20.2173 9.08397C20.6083 8.69297 20.6083 8.05997 20.2173 7.66997L15.8313 3.28397C15.4403 2.89297 14.8073 2.89297 14.4173 3.28397L13.8433 3.85797C13.6423 4.05897 13.5363 4.33497 13.5523 4.61797L13.6753 6.92697L10.7753 9.82697H6.83834C6.57334 9.82697 6.31834 9.93197 6.13134 10.12L4.95634 11.294V11.294Z' stroke='%23FB8C00' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e %3cpath d='M16.5699 9.83018L13.6699 6.93018' stroke='%23FB8C00' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e %3c/svg%3e",loading:"lazy"})," ",s("label.pinnedPost")),rightLabel:!r&&w.default.createElement("img",{className:"label-sort-pin-icon",src:"data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cline x1='7.18605' y1='7.68219' x2='3.68219' y2='13.8139' stroke='%23FEA21E' stroke-linecap='round'/%3e%3cpath d='M3.24591 7.78426C3.21275 7.84168 3.20376 7.90993 3.22092 7.97398C3.23808 8.03803 3.27998 8.09264 3.3374 8.12579L8.78429 11.2706C8.90385 11.3396 9.05674 11.2986 9.12578 11.1791C9.71191 10.1641 9.71348 8.97262 9.23682 7.99339L10.8583 5.18521C11.5115 5.00603 12.0982 4.57973 12.4638 3.94629C12.5328 3.82672 12.4919 3.67383 12.3723 3.6048L8.18237 1.18584C8.12494 1.15268 8.0567 1.1437 7.99265 1.16086C7.92861 1.17803 7.874 1.21993 7.84086 1.27736C7.47521 1.91077 7.39934 2.63194 7.57065 3.28723L5.94919 6.09545C4.86323 6.1723 3.83201 6.76934 3.24591 7.78426Z' fill='%23FEA21E' stroke='%23FEA21E' stroke-width='0.5' stroke-linejoin='round'/%3e%3c/svg%3e",loading:"lazy"}),onClick:e,color:"white",className:`label-pinned ${n}`,style:i})},N=e=>({message:e("notification.failure"),type:"danger"});var A="data:image/svg+xml,%3csvg width='16' height='17' viewBox='0 0 16 17' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M8 14.5C11.3137 14.5 14 11.8137 14 8.5C14 5.18629 11.3137 2.5 8 2.5C4.68629 2.5 2 5.18629 2 8.5C2 11.8137 4.68629 14.5 8 14.5Z' fill='%23FE921D'/%3e%3cpath d='M8 5.5V8.5' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M8 11.5H8.00708' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e";const I=(e,a)=>{const[l,o]=t.useState(e||[]);return{onSelectImages:t=>{const n=t.target.files;if(n)if(a&&e){a((e||l).concat(Array.from(n)))}else o((t=>{const l=e||t;return a&&a(l.concat(Array.from(n))),l.concat(Array.from(n))}))},onRemoveImage:t=>{if(a&&e){const l=e;l.splice(t,1),a(l.slice())}else o((l=>{const o=e||l;return o.splice(t,1),a&&a(o.slice()),o.slice()}))},onRemoveAllImages:()=>{a?a([]):o([])},imageSrcs:t.useMemo((()=>(e||l).map((e=>"string"==typeof e?e:URL.createObjectURL(e)))),[e,l]),imageFiles:e||l}};var _="data:image/svg+xml,%3csvg width='24' height='25' viewBox='0 0 24 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 22.9844C17.5228 22.9844 22 18.5072 22 12.9844C22 7.46153 17.5228 2.98438 12 2.98438C6.47715 2.98438 2 7.46153 2 12.9844C2 18.5072 6.47715 22.9844 12 22.9844Z' fill='%23262626'/%3e%3cpath d='M14.8281 10.1562L9.17127 15.8131' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M9.17188 10.1562L14.8287 15.8131' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e";const M=({className:e,style:a,bannedWords:n=[],value:s,onChange:d,onPreviewUrlChange:c,onInvalidUrlsChange:u,onImageFilesChange:p,imageFiles:v,isReplying:g})=>{const{t:f}=o.useTranslations(),[h,C]=t.useState(null),y=t.useRef(null),{onSelectImages:E,onRemoveImage:b,imageSrcs:P}=I(v,p);return t.useEffect((()=>{c&&((null==h?void 0:h.url)?c({title:h.title||"",url:h.url||"",image:h.image||"",description:h.description||""}):c(null))}),[h]),w.default.createElement(l.StyledCreatePostDescription,{className:e,style:a},w.default.createElement(r.Text,{size:"p4",className:"description-label"},f("createPost.popup.description")),w.default.createElement("div",{className:"textarea-control"},w.default.createElement("div",{className:"textarea-wrapper"},w.default.createElement(l.RichTextEditor,{html:s||"",onChange:d,bannedWords:n,onImagePickerClick:()=>{var e;return null===(e=y.current)||void 0===e?void 0:e.click()},onPreviewUrlChange:C,onInvalidUrlsChange:u,isReplying:g}))),w.default.createElement(r.Text,{size:"p4",className:"count-string"},f("character"),": ",k.default(s||"").length),(!P||0===P.length)&&h&&w.default.createElement("div",{className:"link-preview-wrapper"},h.isFetching?w.default.createElement(l.Loading,null):w.default.createElement(w.default.Fragment,null,w.default.createElement(S,{title:h.title,url:h.url||"#",image:h.image,noRefetch:!0}),w.default.createElement("img",{src:_,className:"icon-close",onClick:()=>C(null),loading:"lazy"}))),w.default.createElement("input",{ref:y,type:"file",accept:"image/png, image/gif, image/jpeg",multiple:!0,style:{display:"none"},onChange:E}),P.length>m.MAX_IMAGE_UPLOADS?w.default.createElement("div",{className:"input-notification"},w.default.createElement("img",{src:A,loading:"lazy"}),w.default.createElement(r.Text,{size:"p4",color:i.theme.colors.alertWarning},f("createPost.popup.warningImage"))):null,P.length>0&&w.default.createElement("div",{className:"image-gallery"},P.map(((e,t)=>w.default.createElement("div",{key:t,className:"image-item"},w.default.createElement("img",{src:e,loading:"lazy"}),w.default.createElement("img",{className:"close-btn",src:_,onClick:()=>b(t),loading:"lazy"}))))))},L=(e,t)=>{if(!t)return e;const{limit:a,bannedWords:o=[]}=t,n="number"==typeof a&&a>=0?e.substring(0,a):e;return l.highlightBadWords(n,o)},j=({className:e,style:a,bannedWords:n=[],value:i,onChange:s})=>{var d;const{t:c}=o.useTranslations(),[u,m]=t.useState(""),p=t.useRef(null);t.useEffect((()=>{if(p.current){const e=e=>{var t;e.preventDefault();const a=null===(t=e.clipboardData)||void 0===t?void 0:t.getData("text/plain");document.execCommand("insertHTML",!1,a)},t=p.current;return t.addEventListener("paste",e,{passive:!0}),()=>t.removeEventListener("paste",e)}}),[p]);const g=(null==n?void 0:n.join(","))||"";t.useEffect((()=>{var e;if(g){const t=null===(e=p.current)||void 0===e?void 0:e.innerText;if(t){const e=l.highlightBadWords(t,n);e!==t&&(s&&s(e),m(e))}}}),[g]);const f=t.useCallback(b.default((()=>{if(p.current){const e=L(p.current.innerText,{limit:120,bannedWords:n});s&&s(e),m(e)}}),300),[]);return t.useEffect((()=>{setTimeout((()=>{var e;null===(e=p.current)||void 0===e||e.focus()}),500)}),[]),w.default.createElement(l.StyledCreatePostTitle,{className:e,style:a},w.default.createElement(v.Input,{name:"title",value:i||u,size:"md",label:c("createPost.title"),CustomInput:w.default.createElement(P.default,{innerRef:p,html:i||u,onChange:()=>{if(p.current&&p.current.innerText!==(i||u)){const e=L(p.current.innerText,{bannedWords:n});s&&s(e),m(e),f()}},className:"title-input"})}),w.default.createElement(r.Text,{size:"p4",className:"count-string"},c("createPost.popup.wordCount",{count:(null===(d=p.current)||void 0===d?void 0:d.innerText.length)||0,max:120})))},R=({className:a,style:o,topics:n,communityId:i,onChange:r,isLoading:s,disabled:d,forceTopics:c,selectedTopics:u,noFetch:v,dataEventCategory:g,dataEventAction:f,dataEventLabel:h})=>{const{data:{locale:C,env:{isMarryBaby:y}}}=t.useContext(m.TogetherComponentGlobalContext),[E,k]=t.useState(n?[...n]:[]),[b,P]=t.useState(u?[...u]:[]),[T,S]=t.useState(!1),x=t.useRef(n);x.current=n,t.useEffect((()=>{var t;!i||v||(null===(t=x.current)||void 0===t?void 0:t.length)||(k([]),S(!0),e.__awaiter(void 0,void 0,void 0,(function*(){var e;try{const t=yield m.callApi(m.getApiPath(m.PATHS.TOPIC.LIST,{communityId:i,_locale:C}),"GET"),a=null===(e=null==t?void 0:t.data)||void 0===e?void 0:e.topics;Array.isArray(a)&&k((()=>(null==a?void 0:a.map(p.formatTopic).sort(((e,t)=>(e.order||0)-(t.order||0))))||[]))}catch(e){console.log(e),S(!1)}S(!1)})))}),[i,v]);const N=null==n?void 0:n.map((e=>e.id)).join("-"),A=null==E?void 0:E.map((e=>e.id)).join("-"),I=null==c?void 0:c.map((e=>e.id)).join("-");t.useEffect((()=>{n&&void 0!==N&&N!==A&&k(n)}),[n,N,A]);const _=t.useMemo((()=>E.filter((e=>!(null==c?void 0:c.some((t=>t.id&&t.id===e.id||t.mappedCategoryId&&t.mappedCategoryId===e.mappedCategoryId)))))),[A,I]);return w.default.createElement(l.StyledTopicSelectList,{"data-is-marrybaby":y,className:a,style:o},c.map((e=>w.default.createElement(B,{key:`${e.id}-${e.mappedCategoryId}`,topic:e,disabled:!0,selected:!0,dataEventAction:f,dataEventCategory:g,dataEventLabel:h}))),_.map((e=>w.default.createElement(B,{key:`${e.id}-${e.mappedCategoryId}`,topic:e,disabled:d,selected:(u||b).some((t=>t.id&&t.id===e.id||t.mappedCategoryId&&t.mappedCategoryId===e.mappedCategoryId)),onClick:()=>{const t=u||b,a=t.findIndex((t=>t.id&&t.id===e.id||t.mappedCategoryId&&t.mappedCategoryId===e.mappedCategoryId));-1!==a?t.splice(a,1):t.push(e),r&&u?r(t.slice()):(r&&r(t.slice()),P(t.slice()))},dataEventAction:f,dataEventCategory:g,dataEventLabel:h}))),(s||T)&&w.default.createElement(l.Loading,{className:"topic-spinner"}))},B=t=>{var{topic:a,disabled:l,selected:o,onClick:n}=t,i=e.__rest(t,["topic","disabled","selected","onClick"]);return w.default.createElement("div",Object.assign({className:"tag-item"+(o?" --active":""),"data-disabled":l,onClick:l?void 0:n},i),a.name)},O=({className:e,isMarryBaby:a,style:o,title:n,description:i,acceptText:s,cancelText:d,onAccept:c,onCancel:p,thumbnail:v,isThumbnailIcon:g,onClose:f,acceptBtnTracking:C,acceptBtnProps:y,cancelBtnProps:E})=>{const{data:{env:{isMarryBaby:k}}}=t.useContext(m.TogetherComponentGlobalContext),b="boolean"==typeof a?a:k,[P,S]=t.useState(!1);return t.useEffect((()=>(u.toggleNoScroll(!0),setTimeout((()=>S(!0)),0),()=>u.toggleNoScroll(!1))),[]),"undefined"==typeof window?null:T.createPortal(w.default.createElement(l.StyledPopupDanger,{"data-is-marrybaby":b,className:e,style:o,"data-open":P},w.default.createElement(l.PopupFrame,{className:"popup-frame",isOpen:P,onClose:f},w.default.createElement("div",{className:"confirm-dialog",onClick:e=>e.stopPropagation()},w.default.createElement("div",{className:"confirm-content"},v&&w.default.createElement("div",{className:"thumbnail-container "+(g?"is-icon":"")},w.default.createElement("img",{className:"thumbnail",src:v,loading:"lazy"})),w.default.createElement(m.Heading,{className:"title",tag:"h2"},n),w.default.createElement(r.Text,{className:"desc",size:"lg"},i),w.default.createElement("div",{className:"btn-group"},w.default.createElement(h.Button,Object.assign({theme:b?"marryBaby":"helloSites",size:"md",color:"tertiary",onClick:()=>{null==c||c(),null==f||f()}},y,C),s),w.default.createElement(h.Button,Object.assign({theme:b?"marryBaby":"helloSites",size:"md",onClick:()=>{null==p||p(),null==f||f()}},E),d)))),b&&v&&w.default.createElement("div",{className:"thumbnail-container is-mobile "+(g?"is-icon":"")},w.default.createElement("img",{className:"thumbnail",src:v,loading:"lazy"})))),u.getPopupWrapperDom())};const z=({isReply:a,className:n,onClose:i,replyToName:s,style:d,replyingId:c,replyingUser:u,onPostSuccess:g,post:f,isMarryBaby:C})=>{const{action:{pushNotifications:y,sanitizeFunction:E},data:{userInfo:k,locale:b,env:{isMarryBaby:P}}}=t.useContext(m.TogetherComponentGlobalContext),T="boolean"==typeof C?C:P,{t:x}=o.useTranslations(),{onSelectImages:N,onRemoveImage:A,imageSrcs:M,onRemoveAllImages:L,imageFiles:j}=I(),[R,B]=t.useState(""),{trigger:O}=t.useContext(l.MainInputTriggerContext),[z,D]=t.useState(!1),F=t.useRef(null),U=t.useRef(null),H=t.useRef(null),[W,V]=t.useState([]),[$,G]=t.useState([]),[q,Z]=t.useState(null);return t.useEffect((()=>{var e;null===(e=H.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"start"}),setTimeout((()=>{var e;null===(e=U.current)||void 0===e||e.focus()}),400)}),[O]),w.default.createElement(l.StyledInputCommentBar,{"data-is-reply":a,className:n,style:d},a&&w.default.createElement("div",{className:"reply-to-container"},w.default.createElement(r.Text,{size:"p4"},w.default.createElement("span",{dangerouslySetInnerHTML:{__html:x("inputComment.replyTo",{name:`<span style="color: #2D87F3; cursor: pointer">@${s||""}</span>`})}})),w.default.createElement("img",{src:"data:image/svg+xml,%3csvg width='16' height='17' viewBox='0 0 16 17' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8.00016' cy='8.50004' r='6.66667' fill='white' stroke='%23404040'/%3e%3cpath d='M10 6.5L6 10.5' stroke='%23404040' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M6 6.5L10 10.5' stroke='%23404040' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",className:"icon-close-comment",onClick:()=>i&&i(),loading:"lazy"})),w.default.createElement("div",{className:"input-container",ref:H},w.default.createElement(p.UserAvatar,{className:"avatar-wrapper "+(a?"avatar-wrapper-reply":""),avatar:(null==k?void 0:k.id)?k.avatar:m.DEFAULT_AVATAR_IMG,username:(null==k?void 0:k.name)||(null==k?void 0:k.username)}),w.default.createElement("input",{ref:F,onChange:N,type:"file",multiple:!0,accept:"image/png,image/jpeg",name:"images",style:{display:"none"}}),w.default.createElement(v.Input,{value:R,name:"input",size:"md",className:"input-wrapper",displayIcon:w.default.createElement("img",{src:"data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M10.7543 4.85352H4.49227C4.01776 4.85352 3.56268 5.04201 3.22715 5.37754C2.89162 5.71307 2.70313 6.16815 2.70312 6.64266V19.1667C2.70313 19.6412 2.89162 20.0963 3.22715 20.4318C3.56268 20.7673 4.01776 20.9558 4.49227 20.9558H17.0163C17.4908 20.9558 17.9459 20.7673 18.2814 20.4318C18.6169 20.0963 18.8054 19.6412 18.8054 19.1667V12.9047' stroke='%232D87F3' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M17.4633 3.51187C17.8192 3.15599 18.3019 2.95605 18.8052 2.95605C19.3085 2.95605 19.7912 3.15599 20.147 3.51187C20.5029 3.86775 20.7029 4.35044 20.7029 4.85373C20.7029 5.35702 20.5029 5.83971 20.147 6.19559L11.6486 14.694L8.07031 15.5886L8.96489 12.0103L17.4633 3.51187Z' stroke='%232D87F3' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",loading:"lazy"}),CustomInput:w.default.createElement("div",{className:"as-input"},w.default.createElement(l.RichTextEditor,{className:"textarea",html:R,onChange:B,onImagePickerClick:()=>{var e;return null===(e=F.current)||void 0===e?void 0:e.click()},bannedWords:$,onPreviewUrlChange:Z,onInvalidUrlsChange:V,setEditorRef:e=>U.current=e,isReplying:a}))}),w.default.createElement(h.Button,{theme:T?"marryBaby":"helloSites",className:"send-button",size:"sm",onClick:()=>e.__awaiter(void 0,void 0,void 0,(function*(){var t,o,n,r,s,d,v,h,C;if((null==f?void 0:f.id)&&!z){D(!0);try{const w=e=>{B(""),L(),i&&i();const t=p.formatComment(e.data);"string"==typeof t.images&&(t.images=JSON.parse(t.images)),g&&g(t)},k=yield(({postId:t,message:a,photos:o,link:n,locale:i,sanitizeFunction:r,replyingUserId:s,replyingUserName:d,replyingId:c})=>e.__awaiter(void 0,void 0,void 0,(function*(){const e=new FormData;let u=l.encodePostContent(a.replace(/(\&nbsp;)+/g," "),r);const p=l.getMentionIdsFromString(u);return o&&o.length>0&&(yield Promise.all(null==o?void 0:o.map((e=>l.uploadAndGetSrc(e,i))))).filter(Boolean).slice(0,m.MAX_IMAGE_UPLOADS).forEach((t=>{e.append("images[]",t)})),n&&e.append("link",n),null==p||p.forEach((t=>{e.append("mention_ids[]",t)})),e.append("post_id",t),c&&e.append("parent_id",c),s&&(p.unshift(s),u=`[mention+id="${s}"+name="${(d||"").replace('"',"'")}"]${u}`,e.append("parent_user_id",String(s))),e.append("content",u),e.append("content",u),e})))(Object.assign({message:R,photos:j,postId:String(f.id),link:null==q?void 0:q.url,sanitizeFunction:E,locale:b},a&&c?{replyingUserId:String((null==u?void 0:u.id)||(null===(t=null==f?void 0:f.author)||void 0===t?void 0:t.id)||""),replyingId:c,replyingUserName:(null==u?void 0:u.name)||(null==u?void 0:u.username)||""}:{})),P=yield a&&c?((t,a)=>e.__awaiter(void 0,void 0,void 0,(function*(){return m.callApiWithAuth(m.getApiPath(m.PATHS.COMMENT.REPLY,{_locale:a}),"POST",{data:t})})))(k,b):((t,a)=>e.__awaiter(void 0,void 0,void 0,(function*(){return m.callApiWithAuth(m.getApiPath(m.PATHS.COMMENT.CREATE,{_locale:a}),"POST",{data:t})})))(k,b),T=null==P?void 0:P.data;(null==T?void 0:T.id)&&!(null===(n=null===(o=null==P?void 0:P.messages)||void 0===o?void 0:o.moderation)||void 0===n?void 0:n.type)?w(P):"banned"===(null===(s=null===(r=null==P?void 0:P.messages)||void 0===r?void 0:r.moderation)||void 0===s?void 0:s.type)?(y({title:x("notification.comment.blocked.title"),message:x("notification.comment.blocked.message"),type:"danger"}),P.messages.moderation.words&&G(P.messages.moderation.words)):"suspect"===(null===(v=null===(d=null==P?void 0:P.messages)||void 0===d?void 0:d.moderation)||void 0===v?void 0:v.type)?(y({title:x("notification.comment.suspect.title"),message:x("notification.comment.suspect.message"),type:"warning"}),B(""),L(),i&&i()):(null===(h=null==P?void 0:P.messages)||void 0===h?void 0:h.find((e=>{var t;return!!(null===(t=null==e?void 0:e.includes)||void 0===t?void 0:t.call(e,"suspend"))})))?(y({message:x("notification.suspend.message"),type:"warning"}),B(""),L(),i&&i()):y({title:"",message:(null===(C=null==P?void 0:P.messages)||void 0===C?void 0:C[0])||x("notification.comment.somethingWrong"),type:"danger"})}catch(e){y({title:"",message:x("notification.comment.somethingWrong"),type:"danger"})}D(!1)}})),isLoading:z,isDisabled:!!(null==W?void 0:W.length)||z||!R||(null==R?void 0:R.length)<2||!R.trim()},w.default.createElement("img",{src:"data:image/svg+xml,%3csvg width='20' height='21' viewBox='0 0 20 21' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M7.5 9.73438L3.75 13.4844L7.5 17.2344' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M16.25 4.73438L16.25 10.3026C16.25 11.1464 15.9208 11.9557 15.3347 12.5524C14.7487 13.1491 13.9538 13.4844 13.125 13.4844L3.75 13.4844' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",className:"icon-enter",loading:"lazy"}))),(null==W?void 0:W.length)?w.default.createElement("div",{className:"error-text"},x("notification.limitUrlDomain")):null,(!M||0===M.length)&&q&&w.default.createElement("div",{className:"link-preview-wrapper"},q.isFetching?w.default.createElement(l.Loading,null):w.default.createElement(w.default.Fragment,null,w.default.createElement(S,{title:q.title,url:q.url||"#",image:q.image,noRefetch:!0}),w.default.createElement("img",{src:_,className:"icon-close",onClick:()=>Z(null),loading:"lazy"}))),M&&M.length>0&&w.default.createElement("div",{className:"preview-images-container"},M.map(((e,t)=>w.default.createElement("div",{key:t,className:"image-src-wrapper"},w.default.createElement("img",{className:"preview-image",src:e,loading:"lazy"}),w.default.createElement("img",{src:_,className:"icon-close-circle",onClick:()=>A(t),loading:"lazy"}))))))};var D="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M8 14C11.3137 14 14 11.3137 14 8C14 4.68629 11.3137 2 8 2C4.68629 2 2 4.68629 2 8C2 11.3137 4.68629 14 8 14Z' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M8 5V8' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M8 11H8.00708' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e";const F=({className:a,style:n,reason:s,reasonText:d,onClose:c,postId:u})=>{const{data:{locale:p,env:{isMarryBaby:v}},action:{pushNotifications:g}}=t.useContext(m.TogetherComponentGlobalContext),{t:f}=o.useTranslations(),[C,y]=t.useState(!1);return w.default.createElement(l.StyledSubmitReportForm,{"data-is-marrybaby":v,className:a,style:n},w.default.createElement("ul",{className:"report-list"},w.default.createElement("li",{className:"report-item"},w.default.createElement("img",{src:D,loading:"lazy"}),w.default.createElement(r.Text,{className:"__label",color:i.theme.colors.gray800,size:"p4"},d))),w.default.createElement(h.Button,{theme:v?"marryBaby":"helloSites",className:"report-submit",size:"lg",color:"primary",isLoading:C,onClick:()=>e.__awaiter(void 0,void 0,void 0,(function*(){if(u&&!C){y(!0);try{const e=yield(({id:e,reason:t,locale:a})=>{const l=new FormData;return l.append("reason",t),m.callApiWithAuth(m.getApiPath(m.PATHS.POST.REPORT,{_locale:a,id:e}),"POST",{data:l})})({id:u,reason:s,locale:p});1===(null==e?void 0:e.status)&&(g({message:"Post reported",type:"success"}),c&&c())}catch(e){}y(!1)}}))},f("submit")))};const U=({className:e,style:n,authorName:i,images:s,onClose:d,onOpenSingleView:c,alt:u})=>{const{t:m}=o.useTranslations(),[p,v]=t.useState(!1);return t.useEffect((()=>{setTimeout((()=>{v(!0)}),0)}),[]),w.default.createElement(a.Portal,null,w.default.createElement(l.StyledImagePreviewPopup,{className:e,style:n,"data-open":p},w.default.createElement("div",{className:"top-bar"},w.default.createElement("img",{className:"icon-arrow-left",src:"data:image/svg+xml,%3csvg width='24' height='25' viewBox='0 0 24 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M10.0508 18.0607L4.00078 12.0367L10.0508 6.01172' stroke='%23262626' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M4.00195 12.0352L19.002 12.0352' stroke='%23262626' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",onClick:d,alt:"go back",loading:"lazy"}),w.default.createElement(r.Text,{size:"p2",weight:"bold",style:{textAlign:"center"}},m("previewPhotos.title",{name:i}))),w.default.createElement("div",{className:"container"},s.map(((e,t)=>w.default.createElement("img",{className:"img-preview",key:t,src:e,onClick:()=>null==c?void 0:c(t),alt:u,loading:"lazy"}))))),",")};var H="data:image/svg+xml,%3csvg width='16' height='17' viewBox='0 0 16 17' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M6 12.8125L10 8.8125L6 4.8125' stroke='white' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e";const W=({initialViewIndex:e,images:o,onClose:n,alt:i})=>{const[r,s]=t.useState(e),[d,c]=t.useState(!1);t.useEffect((()=>{setTimeout((()=>{c(!0)}),0)}),[]);const u=null==o?void 0:o[r],m=0===r,p=!(null==o?void 0:o.length)||r===(null==o?void 0:o.length)-1;return w.default.createElement(a.Portal,null,w.default.createElement(l.StyledImagePreviewContainer,{"data-open":d&&!!u},w.default.createElement(l.StyledImagePreviewTopbar,null,w.default.createElement("img",{src:l.img,className:"icon-close",onClick:n,alt:"close",loading:"lazy"})),u&&r>=0&&w.default.createElement(w.default.Fragment,null,w.default.createElement(l.StyledImagePreviewWrapper,null,w.default.createElement("img",{className:"img-preview",src:u,alt:i,loading:"lazy"}),w.default.createElement(l.StyledArrowWrapper,{"data-disabled":m,onClick:()=>!m&&s(r-1)},w.default.createElement(l.StyledCircleArrow,null,w.default.createElement("img",{src:H,style:{transform:"rotate(180deg)"},alt:"left arrow","data-disabled":m,loading:"lazy"}))),w.default.createElement(l.StyledArrowWrapper,{"data-right":!0,"data-disabled":p,onClick:()=>!p&&s(r+1)},w.default.createElement(l.StyledCircleArrow,null,w.default.createElement("img",{src:H,alt:"right arrow","data-disabled":p,loading:"lazy"})))))))},V=({image:e,showIcon:a=!0})=>{const[o,n]=t.useState(!0);return w.default.createElement(l.StyledWrapper,{"data-is-blurred":o,onClick:e=>o&&e.stopPropagation()},w.default.createElement("img",{loading:"lazy",className:"img-preview",src:e}),w.default.createElement(l.StyledInner,{onClick:e=>{e.stopPropagation(),n(!o)}},a&&w.default.createElement(l.StyledIcon,null,o?w.default.createElement("svg",{width:"22",height:"20",viewBox:"0 0 22 20",fill:"none"},w.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.71 2.5399C1.32 2.1499 1.32 1.5199 1.71 1.1299C2.1 0.739902 2.74 0.739902 3.13 1.1299L19.44 17.4599C19.83 17.8499 19.83 18.4799 19.44 18.8699C19.05 19.2599 18.42 19.2599 18.03 18.8699L15.31 16.1499C13.97 16.6699 12.52 16.9699 11 16.9699C6 16.9699 1.73 13.8599 0 9.4699C0.77 7.4999 2.06 5.7999 3.68 4.5099L1.71 2.5399ZM16 9.4699C16 6.7099 13.76 4.4699 11 4.4699C10.49 4.4699 10 4.5699 9.53 4.7099L7.36 2.5399C8.51 2.1699 9.73 1.9699 11 1.9699C16 1.9699 20.27 5.0799 22 9.4599C21.31 11.2199 20.21 12.7599 18.82 13.9899L15.76 10.9299C15.9 10.4699 16 9.9799 16 9.4699ZM11 14.4699C8.24 14.4699 6 12.2299 6 9.4699C6 8.6999 6.18 7.9699 6.49 7.3299L8.06 8.8999C8.03 9.0799 8 9.2699 8 9.4699C8 11.1299 9.34 12.4699 11 12.4699C11.2 12.4699 11.38 12.4399 11.57 12.3999L13.14 13.9699C12.49 14.2899 11.77 14.4699 11 14.4699ZM13.97 9.1399C13.82 7.7399 12.72 6.6499 11.33 6.4999L13.97 9.1399Z",fill:"white"})):w.default.createElement("svg",{width:"23",height:"16",viewBox:"0 0 23 16",fill:"none"},w.default.createElement("path",{d:"M11.9999 0C5.14188 0 1.88558 5.87864 1.09558 7.55664C0.963582 7.83664 0.963582 8.16141 1.09558 8.44141C1.88558 10.1204 5.14188 16 11.9999 16C18.8339 16 22.0924 10.1629 22.8964 8.46094C23.0344 8.16794 23.0344 7.83206 22.8964 7.53906C22.0924 5.83706 18.8339 0 11.9999 0ZM11.9999 3C14.7609 3 16.9999 5.239 16.9999 8C16.9999 10.761 14.7609 13 11.9999 13C9.23888 13 6.99988 10.761 6.99988 8C6.99988 5.239 9.23888 3 11.9999 3ZM11.9999 5C11.2042 5 10.4412 5.31607 9.87856 5.87868C9.31595 6.44129 8.99988 7.20435 8.99988 8C8.99988 8.79565 9.31595 9.55871 9.87856 10.1213C10.4412 10.6839 11.2042 11 11.9999 11C12.7955 11 13.5586 10.6839 14.1212 10.1213C14.6838 9.55871 14.9999 8.79565 14.9999 8C14.9999 7.20435 14.6838 6.44129 14.1212 5.87868C13.5586 5.31607 12.7955 5 11.9999 5Z",fill:"#2D87F3"})))))},$=({className:e,images:a=[],style:n,authorName:i,isSensitive:r=!1,alt:s})=>{const{data:{env:{isMarryBaby:d}}}=t.useContext(m.TogetherComponentGlobalContext),{t:c}=o.useTranslations(),p="+ "+((a.length||0)-4),[v,g]=t.useState(!1),[f,h]=t.useState(-1),C=a.length>5,y=t.useRef(!1);return t.useEffect((()=>()=>{y.current&&u.toggleNoScroll(!1)}),[]),t.useEffect((()=>{v||f>=0?(u.toggleNoScroll(!0),y.current=!0):(u.toggleNoScroll(!1),y.current=!1)}),[v,f]),w.default.createElement(w.default.Fragment,null,r&&w.default.createElement(l.StyledNotificationBar,{message:c("sensitiveMask.contentWarningDescription"),icon:w.default.createElement("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none"},w.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.00002 0.666748C4.40002 0.666748 0.666687 4.40008 0.666687 9.00008C0.666687 13.6001 4.40002 17.3334 9.00002 17.3334C13.6 17.3334 17.3334 13.6001 17.3334 9.00008C17.3334 4.40008 13.6 0.666748 9.00002 0.666748ZM9.00002 9.83341C8.54169 9.83341 8.16669 9.45841 8.16669 9.00008V5.66675C8.16669 5.20842 8.54169 4.83342 9.00002 4.83342C9.45835 4.83342 9.83335 5.20842 9.83335 5.66675V9.00008C9.83335 9.45841 9.45835 9.83341 9.00002 9.83341ZM8.16669 11.5001V13.1667H9.83335V11.5001H8.16669Z",fill:"#FE921D"}))}),w.default.createElement(l.StyledPostImagePreview,{className:e,style:n,"data-image-count":C?5:a.length||0,"data-is-marrybaby":d,"data-cursor-pointer":!r},null==a?void 0:a.slice(0,5).map(((e,t)=>{const a=4===t&&C;return w.default.createElement("div",{className:"img-wrapper",key:t,onClick:()=>{t>=4&&C?g(!0):h(t)}},r&&w.default.createElement(V,{image:e,showIcon:!a}),!d&&w.default.createElement("img",{loading:"lazy",className:"img-preview-blur",src:e,alt:s}),w.default.createElement("img",{loading:"lazy",className:"img-preview",src:e,alt:s}),a&&w.default.createElement("div",{className:"img-more-overlay"},w.default.createElement(m.Heading,{tag:"h1",as:"h2",color:"white"},p)))}))),v&&w.default.createElement(U,{authorName:i||"",images:a,onClose:()=>g(!1),onOpenSingleView:h,alt:s}),f>=0&&w.default.createElement(W,{images:a,initialViewIndex:f,onClose:()=>h(-1),alt:s}))},G=({url:o,image:n,className:i,style:r,autoPlay:d=!0})=>{const{data:{locale:c}}=t.useContext(m.TogetherComponentGlobalContext),[u,p]=t.useState(null);t.useEffect((()=>{e.__awaiter(void 0,void 0,void 0,(function*(){if(!n){if(!o)return p(null);p((e=>Object.assign(Object.assign({},e),{isFetching:!0}))),m.callApi(m.getApiPath(m.PATHS.FETCH_PREVIEW,{_locale:c}),"POST",{data:{link:o},headers:{"Content-Type":"application/json"}}).then((e=>{var t,a;p({url:o,image:(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.image)||(null===(a=null==e?void 0:e.data)||void 0===a?void 0:a.logo)})})).catch((()=>{p(null)}))}}))}),[o,n]);const v=n||(null==u?void 0:u.image),g=(null==u?void 0:u.url)||o,f=t.useMemo((()=>l.youtubeVidIdGetter(g)),[g]),h=t.useMemo((()=>g.includes("facebook.com")||g.includes("fb.watch")),[g]),C=t.useRef(0),y=t.useRef(0),[E,k]=t.useState(!1);t.useEffect((()=>{const e=()=>{var e;const t=null===(e=b.current)||void 0===e?void 0:e.getBoundingClientRect();let a=!1;t&&(!C.current||Math.abs((C.current-t.width)/(null==t?void 0:t.width))>.2)&&(C.current=Math.floor(t.width),a=!0),t&&(!y.current||Math.abs((y.current-t.height)/(null==t?void 0:t.height))>.2)&&(y.current=Math.floor(t.height),a=!0),a&&k((e=>!e))};return e(),window.addEventListener("resize",e,{passive:!0}),()=>{window.removeEventListener("resize",e)}}),[]);const b=t.useRef(null),P=a.useMantineTheme();return w.default.createElement(l.StyledSocialLinkPreview,{className:`${i} no-replace-click`,style:r,ref:b,color:P.colors[P.primaryColor][0]},n||!f&&!h?w.default.createElement("a",{href:g,target:"_blank",rel:"noreferrer"},w.default.createElement("div",{className:"link-image-wrapper "+((null==u?void 0:u.isFetching)?"fetching":"")},(null==u?void 0:u.isFetching)?w.default.createElement(l.Loading,{className:"loading-spinner"}):w.default.createElement(s.ImageWrap,{className:"link-image",src:v||m.DEFAULT_IMG,backupSrc:m.DEFAULT_IMG,alt:g}))):w.default.createElement("div",{className:"link-image-wrapper"},f?w.default.createElement("iframe",{width:"100%",height:"100%",src:`https://www.youtube.com/embed/${f}?&autoplay=${d?1:0}&mute=1&enablejsapi=1`,frameBorder:"0",allowFullScreen:!0,style:{position:"absolute",top:0,left:0,border:"none",overflow:"hidden"},loading:"lazy"}):h?w.default.createElement("iframe",{key:String(E),src:`https://www.facebook.com/plugins/video.php?href=${encodeURIComponent(g)}&autoplay=${d?1:0}&show_text=false&t=0&width=${C.current}&height=${y.current}`,style:{position:"absolute",top:"50%",left:"50%",border:"none",overflow:"hidden",height:y.current,width:C.current,transform:"translate(-50%, -50%)"},scrolling:"no",frameBorder:"0",allowFullScreen:!0,allow:"autoplay; clipboard-write; encrypted-media; picture-in-picture; web-share",loading:"lazy"}):null))};var q="KsWg8i6",Z="_9tS0EUN",Q="kyyRKlb",K="-Uqqka-";var X="data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cpath d='M5 10C3.9 10 3 10.9 3 12C3 13.1 3.9 14 5 14C6.1 14 7 13.1 7 12C7 10.9 6.1 10 5 10Z' fill='%233E3F58'/%3e %3cpath d='M19 10C17.9 10 17 10.9 17 12C17 13.1 17.9 14 19 14C20.1 14 21 13.1 21 12C21 10.9 20.1 10 19 10Z' fill='%233E3F58'/%3e %3cpath d='M12 10C10.9 10 10 10.9 10 12C10 13.1 10.9 14 12 14C13.1 14 14 13.1 14 12C14 10.9 13.1 10 12 10Z' fill='%233E3F58'/%3e %3c/svg%3e",J="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='%23595959' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 13.3334L8 10.3704L4 13.3334V3.85187C4 3.53754 4.12041 3.23608 4.33474 3.01382C4.54906 2.79155 4.83975 2.66669 5.14286 2.66669H10.8571C11.1602 2.66669 11.4509 2.79155 11.6653 3.01382C11.8796 3.23608 12 3.53754 12 3.85187V13.3334Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",Y="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 13.3334L8 10.3704L4 13.3334V3.85187C4 3.53754 4.12041 3.23608 4.33474 3.01382C4.54906 2.79155 4.83975 2.66669 5.14286 2.66669H10.8571C11.1602 2.66669 11.4509 2.79155 11.6653 3.01382C11.8796 3.23608 12 3.53754 12 3.85187V13.3334Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",ee="data:image/svg+xml,%3csvg width='3' height='13' viewBox='0 0 3 13' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='1.58326' cy='6.41663' r='1.25' transform='rotate(89.9997 1.58326 6.41663)' fill='%23595959'/%3e%3cellipse cx='1.58326' cy='1.41663' rx='1.25' ry='1.25' transform='rotate(89.9997 1.58326 1.41663)' fill='%23595959'/%3e%3cellipse cx='1.58326' cy='11.4166' rx='1.25' ry='1.25' transform='rotate(89.9997 1.58326 11.4166)' fill='%23595959'/%3e%3c/svg%3e",te="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 5.33337C13.1046 5.33337 14 4.43794 14 3.33337C14 2.2288 13.1046 1.33337 12 1.33337C10.8954 1.33337 10 2.2288 10 3.33337C10 4.43794 10.8954 5.33337 12 5.33337Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M4 10C5.10457 10 6 9.10457 6 8C6 6.89543 5.10457 6 4 6C2.89543 6 2 6.89543 2 8C2 9.10457 2.89543 10 4 10Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M12 14.6666C13.1046 14.6666 14 13.7712 14 12.6666C14 11.5621 13.1046 10.6666 12 10.6666C10.8954 10.6666 10 11.5621 10 12.6666C10 13.7712 10.8954 14.6666 12 14.6666Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M5.72668 9.00665L10.28 11.66' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M10.2734 4.33997L5.72668 6.9933' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",ae="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M2 4H3.33333H14' stroke='%23737373' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M5.33334 3.99992V2.66659C5.33334 2.31296 5.47382 1.97382 5.72387 1.72378C5.97392 1.47373 6.31305 1.33325 6.66668 1.33325H9.33334C9.68697 1.33325 10.0261 1.47373 10.2762 1.72378C10.5262 1.97382 10.6667 2.31296 10.6667 2.66659V3.99992M12.6667 3.99992V13.3333C12.6667 13.6869 12.5262 14.026 12.2762 14.2761C12.0261 14.5261 11.687 14.6666 11.3333 14.6666H4.66668C4.31305 14.6666 3.97392 14.5261 3.72387 14.2761C3.47382 14.026 3.33334 13.6869 3.33334 13.3333V3.99992H12.6667Z' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M6.66666 7.33325V11.3333' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M9.33334 7.33325V11.3333' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e";const le=({authorEmail:a,onDeletePost:n,shareUrl:i,post:r,className:s="",popoverClassName:d="",onBookmark:u,onRemoveBookmark:p,onEditPost:v})=>{const{data:{locale:g,userInfo:f,togetherUserId:h,env:{isMarryBaby:C}},action:{pushNotifications:y}}=t.useContext(m.TogetherComponentGlobalContext),{t:E}=o.useTranslations(),[k,b]=t.useState(!1),[P,T]=t.useState(!1),[S,x]=t.useState(!1),{authActionWrapper:N}=l.useTogetherAuthRequiredAction(),A=a&&(null==f?void 0:f.email)&&a===String(null==f?void 0:f.email);return w.default.createElement("div",{className:s,onClick:e=>{e.preventDefault(),e.stopPropagation()}},S&&w.default.createElement(l.SharePopup,{url:i,text:null==r?void 0:r.title,onClose:()=>x(!1)}),P&&w.default.createElement(O,{thumbnail:c.CommonGAssets.getAssetPath("trash-bin.svg"),isThumbnailIcon:!0,title:E("popup.deletePost.title"),description:E("popup.deletePost.description"),acceptText:E("popup.deletePost.accept"),cancelText:E("popup.deletePost.cancel"),onAccept:()=>e.__awaiter(void 0,void 0,void 0,(function*(){if((null==r?void 0:r.id)&&!k){b(!0);try{const t=yield(({id:t,locale:a})=>e.__awaiter(void 0,void 0,void 0,(function*(){if(t)return yield m.callApiWithAuth(m.getApiPath(m.PATHS.POST.DELETE,{id:t,_locale:a}),"DELETE")})))({id:r.id,locale:g});1===(null==t?void 0:t.status)&&(null==n||n())}catch(e){}b(!1)}})),onClose:()=>T(!1)}),w.default.createElement(l.TreePopoverMenu,{className:d,toggleButtonContent:w.default.createElement("img",{src:C?X:ee,loading:"lazy"}),position:"bottom",align:"end",buttonProps:{isLoading:k},data:A?{isShowheader:!1,type:"list",list:[{icon:te,label:E("morePopover.share"),onClick:()=>x(!0)},{icon:"data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M7.16952 3.2356H2.99484C2.6785 3.2356 2.37512 3.36126 2.15143 3.58495C1.92774 3.80863 1.80208 4.11202 1.80208 4.42836V12.7777C1.80208 13.094 1.92774 13.3974 2.15143 13.6211C2.37512 13.8448 2.6785 13.9705 2.99484 13.9705H11.3442C11.6605 13.9705 11.9639 13.8448 12.1876 13.6211C12.4113 13.3974 12.537 13.094 12.537 12.7777V8.60303' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M11.6425 2.341C11.8798 2.10375 12.2016 1.97046 12.5371 1.97046C12.8726 1.97046 13.1944 2.10375 13.4317 2.341C13.6689 2.57826 13.8022 2.90005 13.8022 3.23558C13.8022 3.57111 13.6689 3.89289 13.4317 4.13015L7.76607 9.79578L5.38054 10.3922L5.97692 8.00663L11.6425 2.341Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",label:E("actionPopover.edit"),onClick:v},{icon:ae,label:E("actionPopover.delete"),onClick:()=>{N((()=>T(!0)))}}]}:{isShowheader:!1,type:"list",list:[{icon:te,label:E("morePopover.share"),onClick:()=>x(!0)},{icon:(null==r?void 0:r.bookmarked)?J:Y,label:(null==r?void 0:r.bookmarked)?E("morePopover.unsavePost"):E("morePopover.savePost"),onClick:()=>{N((()=>e.__awaiter(void 0,void 0,void 0,(function*(){if((null==f?void 0:f.id)&&(null==r?void 0:r.id))if(null==r?void 0:r.bookmarked){const e=yield m.callApiWithAuth(m.getApiPath(m.PATHS.BOOKMARK.DELETE,{_locale:g}),"DELETE",{data:{post_id:String(r.id)}});1===(null==e?void 0:e.status)?(y({title:"",message:"Removed saved post",type:"success",displayIcon:Y}),p&&p()):y({title:"",message:"Remove failed",type:"danger",displayIcon:Y})}else{const e=yield m.callApiWithAuth(m.getApiPath(m.PATHS.BOOKMARK.CREATE,{_locale:g}),"POST",{data:{user_id:h||f.id,post_id:r.id}});1===(null==e?void 0:e.status)?(y({title:"",message:"Post saved",type:"success",displayIcon:J}),u&&u()):y({title:"",message:"Post saved failed",type:"danger",displayIcon:Y})}}))))}},{icon:D,label:E("morePopover.report"),subTree:{title:E("morePopover.report.title"),description:E("morePopover.report.description"),isShowheader:!0,type:"list",list:Object.keys(m.REPORT_REASON_MAP).map((e=>({label:m.REPORT_REASON_MAP[e].label,reason:m.REPORT_REASON_MAP[e].reportReasonText,reasonValue:e}))).map((e=>({label:E(e.label),subTree:{title:E("morePopover.reportSubmit.title"),description:E("morePopover.reportSubmit.description"),isShowheader:!0,type:"jsx",jsxRenderer:t=>w.default.createElement(F,{reason:e.reasonValue,reasonText:E(e.reason),postId:null==r?void 0:r.id,onClose:()=>t&&t(!1)})}})))}}]}}))};const oe=({onDeleteComment:a,commentId:n,className:i="",popoverClassName:r=""})=>{const{data:{env:{isMarryBaby:s},locale:d},action:{pushNotifications:c}}=t.useContext(m.TogetherComponentGlobalContext),{t:u}=o.useTranslations(),[p,v]=t.useState(!1),{authActionWrapper:g}=l.useTogetherAuthRequiredAction();return w.default.createElement("div",{className:i,onClick:e=>{e.preventDefault(),e.stopPropagation()}},p&&w.default.createElement(O,{thumbnail:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='17' fill='none'%3e%3cg stroke='%23737373' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' clip-path='url(%23clip0)'%3e%3cpath d='M2 4.008h12M5.333 4.008V2.675a1.333 1.333 0 0 1 1.334-1.333h2.666a1.333 1.333 0 0 1 1.334 1.333v1.333m2 0v9.334a1.333 1.333 0 0 1-1.334 1.333H4.667a1.333 1.333 0 0 1-1.334-1.333V4.008h9.334ZM6.667 7.342v4M9.333 7.342v4'/%3e%3c/g%3e%3cdefs%3e%3cclipPath id='clip0'%3e%3cpath fill='white' d='M0 .008h16v16H0z'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",isThumbnailIcon:!0,title:u("popup.deleteComment.title"),description:u("popup.deleteComment.description"),acceptText:u("popup.deletePost.accept"),cancelText:u("popup.deletePost.cancel"),onAccept:()=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;if(!n)return;const t=yield(({id:e,locale:t})=>m.callApiWithAuth(m.getApiPath(m.PATHS.COMMENT.DELETE,{_locale:t,id:e}),"DELETE"))({id:n,locale:d});1===(null==t?void 0:t.status)?(a&&a(),c({title:"",message:u("notification.success"),type:"success"})):c({title:"",message:(null===(e=null==t?void 0:t.messages)||void 0===e?void 0:e[0])||u("notification.failure"),type:"danger"})})),onClose:()=>v(!1)}),w.default.createElement(l.TreePopoverMenu,{position:"bottom",align:"end",data:{isShowheader:!1,type:"list",list:[{icon:ae,label:u("actionPopover.delete"),onClick:()=>{g((()=>{v(!0)}))}}]},className:r,toggleButtonContent:w.default.createElement("img",{src:s?X:ee,loading:"lazy"}),buttonProps:{}}))};var ne="-dzIuHr";const ie=({userId:e,avatar:a,name:n,role:s,title:d,className:c})=>{const{t:u}=o.useTranslations(),[m,p]=t.useState(!1);return w.default.createElement(w.default.Fragment,null,w.default.createElement(h.Button,{className:`${ne} ${c}`,color:"success",size:"xs",onClick:()=>p(!0),style:{padding:"5px 8px",marginBottom:"12px",borderRadius:"4px"}},w.default.createElement("span",{className:"text"},w.default.createElement(r.Icon.Endorse,{isSolid:!0,size:18,color:i.theme.colors.green800,className:"icon"}),u("cardReply.verifyBy",{name:`${n||""}`}))),w.default.createElement(l.ProfileDetailModal,{open:m,onClose:()=>p(!1),profileModalProps:{zIndex:1e3}},w.default.createElement(l.ProfileDetail,{authorProps:{userId:e,avatar:a,name:n,role:s,title:d},hideQuestionTab:!0})))};const re=({className:a,style:n,comment:i,type:r="comment",level:s=0,replyingId:c,onPostCommentSuccess:u,post:p,onDeleteComment:v,refetchComment:g,hasQuickBookingEnable:f,handleMakeAppointment:C,cardAuthorProps:y,maxChars:E=600,disableShortenContent:k})=>{var b,P,T,x,N,A,I,_,M,L,j,R,B;const{data:{locale:O,userInfo:D,env:{isMarryBaby:F}}}=t.useContext(m.TogetherComponentGlobalContext),{t:U}=o.useTranslations(),[H,W]=t.useState(i||null),{id:V,countLikes:G,content:q,replies:Z=[],images:Q=[],author:K,liked:X,link:J,mentionedUser:Y,mentions:ee}=H,{text:te,replyingTo:ae}=(e=>{try{const t=e.match(/\[@([^\]]+)\]/),a=t?t[0].replace("[@","").replace("]",""):"";return{text:e.replace(/\[@([^\]]+)\]/,"").trim(),replyingTo:a}}catch(e){}return{text:""}})(q),{authActionWrapper:le}=l.useTogetherAuthRequiredAction({_joinCommunityIds:[null===(b=null==p?void 0:p.community)||void 0===b?void 0:b.id],_joinTopicIds:null===(P=null==p?void 0:p.topics)||void 0===P?void 0:P.map((e=>e.id))}),[ne,se]=t.useState(4),de=!!(null==D?void 0:D.id)&&(null==Z?void 0:Z.some((e=>e.author.id===D.id))),ce=e=>{W((t=>{if(!t.replies.find((t=>t.id===e.id))){t.replies.unshift(e);const a=Object.assign(Object.assign({},t),{replies:t.replies.slice(),countReplies:t.countReplies+1});return g&&g(a),a}return t}))},[ue,me]=t.useState(!1),pe=t.useMemo((()=>"comment"===r&&Z&&0!=Z.length?Z.sort(((e,t)=>{const a=new Date(e.createdAt).getTime(),l=new Date(t.createdAt).getTime();return a>l?-1:a<l?1:0})):Z),[r,Z]),ve=(null==Z?void 0:Z.length)||0,ge=String(null==K?void 0:K.email)&&(null==D?void 0:D.email)&&String(null==K?void 0:K.email)===String(null==D?void 0:D.email),fe=(null==K?void 0:K.name)||(null==K?void 0:K.username)||"",he=(null==K?void 0:K.username)||(null==K?void 0:K.name)||"",Ce=null==K?void 0:K.avatar,ye=(null==p?void 0:p.isAnonymous)||null==K?void 0:K.role,Ee=[...(null==p?void 0:p.isAnonymous)?[{id:(null===(T=null==p?void 0:p.author)||void 0===T?void 0:T.id)||0,name:U("cardPost.anonymous")}]:[],...ee||[]],[we,ke]=t.useState(null),[be,Pe]=t.useState(null);t.useEffect((()=>{if(null==K?void 0:K.hospitalId){const t=t=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;const a=yield m.callApi(m.getCarePath(m.CARE_PATHS.GET_HOSPITAL_INFO,{hospital_branch_id:t,website_url:d.domainLocales[O]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.branch)&&ke(null==a?void 0:a._data.branch)}));t(K.hospitalId)}if(null==K?void 0:K.doctorId){const t=t=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;const a=yield m.callApi(m.getCarePath(m.CARE_PATHS.GET_DOCTOR_INFO,{doctorId:t,website_url:d.domainLocales[O]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.doctor)&&Pe(null==a?void 0:a._data.doctor)}));t(K.doctorId)}}),[K.hospitalId,K.doctorId]);const Te=(null==be?void 0:be.valid_outpatient)||(null==be?void 0:be.valid_telemedicine),Se=((null==we?void 0:we.total_available_service)||(null==we?void 0:we.total_available_doctor))>0,xe=f&&(Te||Se),Ne="chatbot"===(null===(x=null==H?void 0:H.author)||void 0===x?void 0:x.type);return w.default.createElement(l.TogetherAuthConfigContextProvider,{defaultParams:{_joinCommunityIds:[null===(N=null==p?void 0:p.community)||void 0===N?void 0:N.id],_joinTopicIds:null===(A=null==p?void 0:p.topics)||void 0===A?void 0:A.map((e=>e.id))}},w.default.createElement(l.StyledCardPost,{className:a,style:n,"data-is-reply":!!s,"data-is-marrybaby":F,"data-has-booking":xe},"reply"===r&&w.default.createElement(l.Divider,{className:"top-divider",type:"solid"}),w.default.createElement("div",{style:{padding:"16px 16px 0"}},w.default.createElement(l.CardAuthor,Object.assign({avatar:Ce,name:fe,username:he,timeText:null==p?void 0:p.createdTime,community:null==p?void 0:p.community,className:"post-author "+(ge?"with-popover":""),type:r,userId:null==K?void 0:K.id,role:ye,expertId:null==K?void 0:K.partnerId,title:null==K?void 0:K.title,doctorId:null==K?void 0:K.doctorId,hospitalId:null==K?void 0:K.hospitalId,hasQuickBooking:xe,handleMakeAppointment:C,isAnonymous:(null==H?void 0:H.isAnonymous)||Boolean(null==p?void 0:p.isAnonymous)&&(null===(I=null==p?void 0:p.author)||void 0===I?void 0:I.username)===(null==K?void 0:K.username),hideBackground:Ne,userType:null==K?void 0:K.type},y)),Boolean(null==H?void 0:H.isVerify)&&!Boolean(null==H?void 0:H.isOppose)&&w.default.createElement(ie,{title:null===(_=null==H?void 0:H.userVerify)||void 0===_?void 0:_.title,name:null===(M=null==H?void 0:H.userVerify)||void 0===M?void 0:M.name,userId:null===(L=null==H?void 0:H.userVerify)||void 0===L?void 0:L.id,role:null===(j=null==H?void 0:H.userVerify)||void 0===j?void 0:j.role,avatar:null===(R=null==H?void 0:H.userVerify)||void 0===R?void 0:R.avatar,className:"verify-tag"})),w.default.createElement(l.PostContent,{className:"post-content-wrapper",replyingTo:ae,mentionedUser:Y,description:te,mentions:Ee,maxChars:E,disableShortenContent:k}),w.default.createElement("span",null),w.default.createElement("span",null),Q&&Q.length>0?w.default.createElement("div",{key:"image-preview",className:"image-preview-wrapper","data-is-reply":!0},w.default.createElement($,{images:Q,authorName:null==K?void 0:K.username})):null,Q&&0!==Q.length||!J?null:w.default.createElement("div",{key:"link-preview",className:"link-preview-wrapper","data-is-reply":!0},w.default.createElement(S,{url:J})),"most-engaging"!==r?w.default.createElement(w.default.Fragment,null,Ne&&w.default.createElement(l.StyledSourceList,{listUrl:null==H?void 0:H.source,categorySlug:null==H?void 0:H.categorySlug}),w.default.createElement(l.CardReactions,{type:l.CardReactionType.reply,loveCount:G,replyCount:ve,className:"post-reaction",liked:X,isReplied:de,hideCommentIcon:"reply"===r||Ne,hasShare:!1,onCommentClick:()=>le((()=>me((e=>!e)))),onCommentCountClick:()=>le((()=>{me(!0)})),onLikeClick:()=>le((()=>e.__awaiter(void 0,void 0,void 0,(function*(){if(V){const t=yield(({commentId:t,setLike:a=!1,locale:l})=>e.__awaiter(void 0,void 0,void 0,(function*(){return m.callApiWithAuth(m.getApiPath(a?m.PATHS.COMMENT.LIKE:m.PATHS.COMMENT.UNLIKE,{_locale:l,id:t}),"GET")})))({commentId:V,setLike:!X,locale:O});1===t.status&&W((e=>Object.assign(Object.assign({},e),{liked:!X,countLikes:e.countLikes+(X?-1:1)})))}}))))}),ue&&w.default.createElement(z,{replyingId:c||H.id,replyToName:fe,isReply:!0,onClose:()=>me(!1),onPostSuccess:e=>{"reply"===r?u&&u(e):ce(e)},post:p,replyingUser:K}),"comment"===r&&Z&&Z.length>0?w.default.createElement("div",{className:"comment-reply-wrapper"},null===(B=null==pe?void 0:pe.slice(0,ne))||void 0===B?void 0:B.map((e=>w.default.createElement(re,{key:e.id,comment:e,type:"reply",className:"comment-reply-item",level:s+1,replyingId:V,onPostCommentSuccess:ce,post:p,onDeleteComment:()=>{W((t=>Object.assign(Object.assign({},t),{replies:t.replies.filter((t=>t.id!==e.id)),countReplies:t.countReplies-1})))},handleMakeAppointment:C,hasQuickBookingEnable:f}))),ve>ne&&w.default.createElement(w.default.Fragment,null,w.default.createElement(l.Divider,{className:"top-divider",type:"solid"}),w.default.createElement(h.Button,{className:"more-cmt",size:"lg",color:"ghost",onClick:()=>se((e=>e+4))},U("comment.seeMoreReplies",{count:ve-ne}),w.default.createElement("img",{className:"chevron-right",src:"data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M6 12L10 8L6 4' stroke='%232D87F3' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",loading:"lazy"})))):null):null,ge&&w.default.createElement(oe,{onDeleteComment:v,className:"popover",commentId:H.id})))},se=(t,a)=>e.__awaiter(void 0,void 0,void 0,(function*(){var e,l,o;const n=yield m.callApiWithOptionalAuth(m.getApiPath(m.PATHS.COMMENT.LIST,{postId:t,_locale:a,sort:"popularity",perPage:1,withoutReply:1}),"GET");return null===(o=null===(l=null===(e=null==n?void 0:n.data)||void 0===e?void 0:e.comments)||void 0===l?void 0:l.map(p.formatComment))||void 0===o?void 0:o[0]}));var de=Object.freeze({__proto__:null});exports.CardLink=S,exports.CardPost=({className:a,style:n,hideViewMoreComment:i,showMostEngaging:r,onCommentClick:s,onCommentCountClick:d,onMostEngagingCommentClick:c,onPostCommentSuccess:u,disableCardLink:p,disableShortenContent:v,onDeletePost:g,onEditPost:f,post:C,mostEngagingComment:y,onDeleteComment:E,showInputComment:b,InlineCommentsComponent:P,hasQuickBookingEnable:T,handleMakeAppointment:A,cardAuthorProps:I})=>{const[_,M]=t.useState(C),[L,j]=t.useState(!1),[R,B]=t.useState(y),{community:O,topics:D,author:F,slug:U,isPin:H,liked:W,photos:V,mentions:q,title:Z,description:Q,previewUrl:K,likesCount:X,commentsCount:J,id:Y,commented:ee}=_,{data:{locale:te,env:{isMarryBaby:ae,togetherBasePath:oe}},action:{pushNotifications:ne}}=t.useContext(m.TogetherComponentGlobalContext),{t:ie}=o.useTranslations(),[de,ce]=t.useState(b),ue=`${oe}/${(null==O?void 0:O.slug)||"_"}/${U||""}`,me=`${m.getCurrentBaseUrl(te)}${ue}`,{authActionWrapper:pe}=l.useTogetherAuthRequiredAction((null==O?void 0:O.slug)?{_joinCommunityIds:[O.id],_joinTopicIds:null==D?void 0:D.map((e=>e.id))}:void 0),[ve,ge]=t.useState(!1);t.useEffect((()=>{ce(b)}),[b]);const fe=(null==F?void 0:F.name)||(null==F?void 0:F.username)||"",he=(null==F?void 0:F.username)||(null==F?void 0:F.name)||"",Ce=null==F?void 0:F.avatar,ye=(null==_?void 0:_.isAnonymous)||null==F?void 0:F.role,[Ee,we]=t.useState(null),[ke,be]=t.useState(null);t.useEffect((()=>{if(null==F?void 0:F.hospitalId){(t=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;const a=yield m.callApi(m.getCarePath(m.CARE_PATHS.GET_HOSPITAL_INFO,{hospital_branch_id:t,website_url:m.domainLocales[te]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.branch)&&we(null==a?void 0:a._data.branch)})))(F.hospitalId)}if(null==F?void 0:F.doctorId){(t=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;const a=yield m.callApi(m.getCarePath(m.CARE_PATHS.GET_DOCTOR_INFO,{doctorId:t,website_url:m.domainLocales[te]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.doctor)&&be(null==a?void 0:a._data.doctor)})))(F.doctorId)}}),[F.hospitalId,F.doctorId]);const Pe=(null==ke?void 0:ke.valid_outpatient)||(null==ke?void 0:ke.valid_telemedicine),Te=((null==Ee?void 0:Ee.total_available_service)||(null==Ee?void 0:Ee.total_available_doctor))>0,Se=T&&(Pe||Te);t.useEffect((()=>{e.__awaiter(void 0,void 0,void 0,(function*(){if(Y&&J&&r&&!(null==y?void 0:y.id)){const e=yield se(Y,te);B(e)}}))}),[Y,te,J,r,null==y?void 0:y.id]),t.useEffect((()=>{B(y)}),[null==y?void 0:y.id]);const xe=t=>e.__awaiter(void 0,void 0,void 0,(function*(){if(J>1&&(null==R?void 0:R.id)&&(null==R?void 0:R.id)===(null==t?void 0:t.id)){const e=yield se(Y,te);B(e)}M((e=>Object.assign(Object.assign({},e),{commentsCount:e.commentsCount-1}))),E&&E(t)}));return w.default.createElement(l.TogetherAuthConfigContextProvider,{defaultParams:(null==O?void 0:O.slug)?{_joinCommunityIds:[O.id],_joinTopicIds:null==D?void 0:D.map((e=>e.id))}:void 0},L&&w.default.createElement(l.SharePopup,{url:me,avatar:m.DEFAULT_IMG,text:Z,onClose:()=>j(!1)}),w.default.createElement(l.StyledCardPost$1,{className:a,style:n,"data-is-marrybaby":ae},H?w.default.createElement(x,{className:"post-pin"}):null,w.default.createElement("div",{style:{position:"relative",padding:"1rem 1rem 0"}},w.default.createElement(l.CardAuthor,Object.assign({avatar:Ce,name:fe,username:he,url:p?void 0:ue,community:O,timeText:null==_?void 0:_.createdTime,className:"post-author",role:ye,userId:null==F?void 0:F.id,expertId:null==F?void 0:F.partnerId,doctorId:null==F?void 0:F.doctorId,hospitalId:null==F?void 0:F.hospitalId,title:null==F?void 0:F.title,hasQuickBooking:Se,handleMakeAppointment:A,"data-testid":"name",isAnonymous:!!(null==_?void 0:_.isAnonymous),extendEle:w.default.createElement(le,{authorEmail:String(null==F?void 0:F.email),onDeletePost:g,shareUrl:me,post:_,className:"popover",onEditPost:f})},I))),w.default.createElement("a",{href:p?void 0:ue,className:"post-content-link-wrapper"},Z&&w.default.createElement(m.Heading,{className:"post-content-title",as:"h2",tag:"h5",fontWeight:"bold","data-testid":"Title of the Post"},k.default(Z)),w.default.createElement(l.PostContent,{className:"post-content-wrapper",description:Q,disableShortenContent:v,mentions:q,"data-testid":"Content of the Post"})),w.default.createElement("span",null),w.default.createElement("span",null),w.default.createElement("div",{key:"tag-topic"},D&&D.length>0?w.default.createElement(l.TagTopic,{topics:D,className:"post-topics"}):null),w.default.createElement("div",{key:"social-preview"},(null==_?void 0:_.introUrl)?w.default.createElement("div",{className:"social-preview-wrapper "+((null==V?void 0:V.length)?"has-image":"")},w.default.createElement(G,{url:_.introUrl,image:_.bannerImage})):null),w.default.createElement("div",{key:"image-preview"},(null==V?void 0:V.length)?w.default.createElement("div",{className:"image-preview-wrapper"},w.default.createElement($,{images:V,authorName:null==F?void 0:F.name})):null),w.default.createElement("div",{key:"link-preview"},(null==_?void 0:_.introUrl)||(null==V?void 0:V.length)||!(null==K?void 0:K.url)?null:w.default.createElement("div",{className:"link-preview-wrapper"},w.default.createElement(S,{title:K.title,url:K.url,image:K.image}))),w.default.createElement(l.CardReactions,{isMarryBaby:ae,type:l.CardReactionType.post,loveCount:X,replyCount:J,className:"post-reaction "+((null==V?void 0:V.length)||(null==K?void 0:K.url)?"hide-top-border":""),liked:ve?!W:W,isReplied:ee,onCommentClick:()=>pe((()=>{s?s():ce((e=>!e))})),onCommentCountClick:()=>{pe((()=>{ae?ce(!0):d?d():!p&&(window.location.href=ue)}))},onShareClick:()=>{j(!0)},onLikeClick:()=>e.__awaiter(void 0,void 0,void 0,(function*(){if(Y&&!ve){ge(!0);try{const t=yield(({id:t,locale:a})=>e.__awaiter(void 0,void 0,void 0,(function*(){if(t)return yield m.callApiWithAuth(m.getApiPath(m.PATHS.POST.LIKE,{id:t,_locale:a}),"GET")})))({id:Y,locale:te});1!==(null==t?void 0:t.status)?ne(N(ie)):M((e=>Object.assign(Object.assign({},e),{likesCount:(e.likesCount||0)+(e.liked?-1:1),liked:!e.liked})))}catch(e){ne(N(ie))}ge(!1)}})),showingMostEngaging:!(!r||!(null==R?void 0:R.id))}),de&&w.default.createElement(z,{isMainCmt:!b,onClose:()=>ce(!1),onPostSuccess:e=>{0!==J||(null==R?void 0:R.id)||B(e),M((e=>Object.assign(Object.assign({},e),{commentsCount:e.commentsCount+1,commented:!0}))),u&&u(e)},post:_}),r&&(null==R?void 0:R.id)?w.default.createElement("div",{className:"most-engaging-wrapper",onClick:e=>{c?(e.stopPropagation(),c()):window.location.href=ue}},w.default.createElement(re,{hasQuickBookingEnable:T,handleMakeAppointment:A,comment:R,post:_,onDeleteComment:()=>{xe&&xe(R)},className:"most-engaging-comment",type:"most-engaging",key:R.id,cardAuthorProps:I}),J>1&&!i&&w.default.createElement(h.Button,{className:"see-more-comments",color:"ghost",size:"md"},ie("comment.seeMoreComments",{count:J-1}))):null,P))},exports.CardPostPopoverMore=le,exports.CardReply=re,exports.CardReplyPopover=oe,exports.CreateNewPostContent=({className:n,style:d,onPostCreatedEdited:v,onClose:g,communities:f=[],forceSelectCommunity:h,forceSelectTopics:C,articleId:y,optionalTopic:E,editPostData:b,defaultCommunity:P,defaultTopics:T,noFetchTopic:S,hideTopicList:x,selectAskDoctor:I,showAskDoctorOptions:_,currentPageUrl:L})=>{const B=!!(null==b?void 0:b.id),{data:{locale:O,env:{isMarryBaby:z}},action:{pushNotifications:D,sanitizeFunction:F}}=t.useContext(m.TogetherComponentGlobalContext),{t:U}=o.useTranslations(),[H,W]=t.useState(!1),[V,$]=t.useState(I),[G,q]=t.useState(!1),[Z,Q]=t.useState(!1),[K,X]=t.useState(!1),[J,Y]=t.useState(""),[ee,te]=t.useState(""),[ae,le]=t.useState(h?{label:h.name,value:`${h.id||""}-${h.mappedCategoryId||""}`}:{label:U("community.choose"),value:""}),[oe,ne]=t.useState([...C]||[]),[ie,re]=t.useState([]),[se,de]=t.useState([]),ce=h||f.find((e=>`${e.id||""}-${e.mappedCategoryId||""}`===ae.value)),ue=h?[h]:f.filter((e=>e.isActive)).sort(((e,t)=>e.name>t.name?1:e.name<t.name?-1:0)),[me,pe]=t.useState(null),[ve,ge]=t.useState([]),fe=J&&!Z&&k.default(ee)&&(E||!E&&oe.length>0)&&ce&&(!ie||ie.length<=m.MAX_IMAGE_UPLOADS)&&!(null==ve?void 0:ve.length)&&!K;t.useEffect((()=>{if(b){const e=b;Y(e.title||""),te(l.decodeMention(l.decodePostUrl(e.description||"","edit"),e.mentions)),le({label:e.community.name,value:`${e.community.id||""}-${e.community.mappedCategoryId||""}`}),ne(e.topics||[]),re(e.photos||[]),W(!!e.isAnonymous||!1),$(!!e.isAskDoctor||!1)}else P&&le({label:P.name,value:`${P.id||""}-${P.mappedCategoryId||""}`}),T&&ne(T)}),[]),t.useEffect((()=>{Q(""!==J&&!/[a-zA-Z]/.test(J))}),[J]);const he=()=>e.__awaiter(void 0,void 0,void 0,(function*(){var t,a,o,n,i,r,s,d,c;if(_&&void 0===V)return q(!0),!1;const f=yield(({title:t,description:a,communityId:o,imageFiles:n,previewUrl:i,topicIds:r,locale:s,sanitizeFunction:d,categoryCommunityId:c,categoryTopicIds:p,introUrl:v,bannerUrl:g,scheduleTime:f,isAnonymous:h,isAskDoctor:C})=>e.__awaiter(void 0,void 0,void 0,(function*(){const e=new FormData,y=l.removeBannedWordWrapper(a),E=l.removeBannedWordWrapper(t),w=l.getMentionIdsFromString(y);if(e.append("title",E),e.append("description",l.encodePostContent(y,d)),c?e.append("category_community",String(c)):o&&e.append("community_id",String(o)),e.append("is_anonymous",h?"1":"0"),e.append("is_question",C?"1":"0"),(null==i?void 0:i.title)&&e.append("preview_title",i.title),(null==i?void 0:i.description)&&e.append("preview_description",i.description),(null==i?void 0:i.url)&&e.append("preview_link",u.safeEncodeURI(i.url)),(null==i?void 0:i.image)&&e.append("preview_image",u.safeEncodeURI(i.image)),null==r||r.forEach((t=>{e.append("topics[]",String(t||""))})),null==p||p.forEach((t=>{e.append("category_topics[]",String(t||""))})),null==n?void 0:n.length){const t=yield Promise.all(n.map(((e,t)=>new Promise((a=>{setTimeout((()=>{a(l.uploadAndGetSrc(e,s))}),2e3*t)})))));null==t||t.filter(Boolean).slice(0,m.MAX_IMAGE_UPLOADS).forEach(((t,a)=>{e.append(`images[${a}]`,t)}))}else e.append("images","");return null==w||w.forEach((t=>{e.append("mention_ids[]",t)})),e.append("intro_url",v||""),e.append("banner",g||""),f&&(e.append("post_type","scheduled"),e.append("schedule_datetime",f)),e})))({title:J,description:ee,communityId:String((null==ce?void 0:ce.id)||""),imageFiles:ie,previewUrl:me,topicIds:null==oe?void 0:oe.map((e=>String(e.id||""))).filter(Boolean),locale:O,sanitizeFunction:F,categoryCommunityId:String((null==ce?void 0:ce.mappedCategoryId)||""),categoryTopicIds:null==oe?void 0:oe.map((e=>String(e.mappedCategoryId||""))).filter(Boolean),isAnonymous:H?1:0,isAskDoctor:V?1:0});let h;y&&f.append("article_id",y),B?(null==b?void 0:b.id)&&(h=yield(({id:t,locale:a,formData:l})=>e.__awaiter(void 0,void 0,void 0,(function*(){return yield m.callApiWithAuth(m.getApiPath(m.PATHS.POST.UPDATE,{id:t,_locale:a}),"POST",{data:l})})))({id:b.id,formData:f,locale:O})):h=yield(({locale:t,formData:a,isArticleComment:l})=>e.__awaiter(void 0,void 0,void 0,(function*(){return yield m.callApiWithAuth(m.getApiPath(l?m.PATHS.POST.CREATE_ARTICLE_COMMENT:m.PATHS.POST.CREATE,{_locale:t}),"POST",{data:a})})))({formData:f,locale:O,isArticleComment:!(null==ce?void 0:ce.id)&&!!(null==ce?void 0:ce.mappedCategoryId)});const C=null==h?void 0:h.data;(null==C?void 0:C.id)&&!(null===(a=null===(t=null==h?void 0:h.messages)||void 0===t?void 0:t.moderation)||void 0===a?void 0:a.type)?(D({message:U("createPost.popup.success"),type:"success"}),(e=>{v&&v(p.formatPost(e),B),g&&g()})(C)):"banned"===(null===(n=null===(o=null==h?void 0:h.messages)||void 0===o?void 0:o.moderation)||void 0===n?void 0:n.type)?(D({title:U("notification.post.blocked.title"),message:U("notification.post.blocked.message"),type:"danger"}),h.messages.moderation.words&&de(h.messages.moderation.words)):"suspect"===(null===(r=null===(i=null==h?void 0:h.messages)||void 0===i?void 0:i.moderation)||void 0===r?void 0:r.type)?(D({title:U("notification.post.suspect.title"),message:U("notification.post.suspect.message"),type:"warning"}),g&&g()):(null===(d=null===(s=null==h?void 0:h.messages)||void 0===s?void 0:s.find)||void 0===d?void 0:d.call(s,(e=>{var t;return!!(null===(t=null==e?void 0:e.includes)||void 0===t?void 0:t.call(e,"suspend"))})))?(D({message:U("notification.suspend.message"),type:"danger"}),g&&g()):D({message:(null===(c=null==h?void 0:h.messages)||void 0===c?void 0:c[0])||U("notification.failure"),type:"danger"})}));return w.default.createElement(l.StyledCreateNewPost,{className:n,style:d},w.default.createElement("div",{className:"input-group-container"},w.default.createElement(j,{className:"input-group",bannedWords:se,value:J,onChange:Y}),Z&&w.default.createElement(l.StyledError,null,w.default.createElement(r.Info,{isSolid:!0,color:i.theme.colors.red700,size:14}),w.default.createElement(r.Text,{size:"p3",as:"span",color:i.theme.colors.red700},U("createPost.popup.specialCharErr"))),w.default.createElement(M,{className:"input-group",bannedWords:se,value:ee,onChange:te,onPreviewUrlChange:pe,onInvalidUrlsChange:ge,onImageFilesChange:re,imageFiles:ie}),_&&w.default.createElement(l.StyledIsQuestion,{"data-is-marry-baby":z},w.default.createElement("div",{className:"switch-label"},w.default.createElement(r.Ask,{isMarryBaby:z,size:z?32:24,color:i.theme.colors.primaryBase,className:"label-icon"}),w.default.createElement("span",{className:"label-txt"},U("createPost.askDoctor"))),w.default.createElement(l.BtnChoice,{value:V,choices:[{label:U("createPost.askDoctorChoice.yes"),value:!0,dataEventCategory:"Together",dataEventAction:"Write Post Click - Ask Doctor",dataEventLabel:L},{label:U("createPost.askDoctorChoice.no"),value:!1}],onChange:e=>{"boolean"==typeof e&&(q(!1),$(e))}})),G&&w.default.createElement(l.StyledError,null,w.default.createElement(r.Info,{isSolid:!0,color:i.theme.colors.red700,size:14}),w.default.createElement(r.Text,{size:"p3",as:"span",color:i.theme.colors.red700},U("createPost.message.askDoctorRequire"))),w.default.createElement("div",{className:"input-group"},w.default.createElement(r.Text,{size:"p4",className:"input-group-label"},U("admin.community")),w.default.createElement(l.Dropdown,{options:(null==ue?void 0:ue.map((e=>({label:e.name,value:`${e.id||""}-${e.mappedCategoryId||""}`}))))||[],id:"community-picker",placeholder:U("community.choose"),value:ae,dropdownLabelTrackingAttributes:{"data-event-category":"Together","data-event-action":"Write Post Click - Choose Community/Topic","data-event-label":L},onChange:e=>{le({label:e.label,value:String(e.value)}),ne([])},disabled:!!h}),w.default.createElement(r.Text,{size:"sm",className:"warning",color:i.theme.colors.gray400},"* ",U("commentPopup.warning.newPost"))),!x&&w.default.createElement("div",{className:"input-group"},w.default.createElement(r.Text,{size:"p4",className:"input-group-label"},U("tab.topic")),w.default.createElement("div",{className:"input-notification"},w.default.createElement("img",{src:ce?"data:image/svg+xml,%3csvg width='16' height='17' viewBox='0 0 16 17' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M8 14.5C11.3137 14.5 14 11.8137 14 8.5C14 5.18629 11.3137 2.5 8 2.5C4.68629 2.5 2 5.18629 2 8.5C2 11.8137 4.68629 14.5 8 14.5Z' fill='%232D87F3'/%3e%3cpath d='M8 5.5V8.5' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M8 11.5H8.00708' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e":A,loading:"lazy"}),w.default.createElement(r.Text,{size:"base",color:i.theme.colors.gray500},U(ce?"createPost.popup.primary":"createPost.popup.warning"))),ce&&w.default.createElement(R,{className:"tag-list",communityId:ce.id,forceTopics:C,onChange:ne,selectedTopics:oe,noFetch:S,dataEventCategory:"Together",dataEventAction:"Write Post Click - Choose Community/Topic",dataEventLabel:L}))),w.default.createElement("div",{className:"form-action"},w.default.createElement("div",{className:"input-group"},w.default.createElement(a.Checkbox,{className:"swich-input-group",labelPosition:"left",name:"PostAnonymous",checked:H,color:z?"pink":void 0,"data-event-category":"Together","data-event-action":"Write Post Click - Incognito","data-event-label":L,label:w.default.createElement("div",{className:"switch-label"},w.default.createElement("img",{className:"label-icon",src:c.CommonGAssets.getAssetPath("anomyous-avatar.svg"),alt:"anomyous avatar",style:{marginRight:"10px",width:"24px"},loading:"lazy"}),w.default.createElement("span",{className:"label-txt"},U("createPost.postAnonymous"))),value:"Post Anonymous",onChange:e=>W(e.currentTarget.checked),styles:{body:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"},label:{display:"flex",alignItems:"center"}}})),w.default.createElement("div",{className:"input-group"},w.default.createElement(s.Button,{className:"submit-btn pointer-event-child-none",size:"lg","data-event-category":"Ask Doctor","data-event-action":"Submit Question","data-event-label":window.location.href,onClick:()=>e.__awaiter(void 0,void 0,void 0,(function*(){if(fe&&!K){X(!0);try{yield he()}catch(e){console.error(e),D(N(U))}X(!1)}})),disabled:!fe,loading:K},U("createPost.popup.submit")))))},exports.CreatePostDescription=M,exports.CreatePostTitle=j,exports.ImagePreviewPopup=U,exports.InputCommentBar=z,exports.LabelPin=x,exports.PopupDanger=O,exports.PostImagePreview=$,exports.PostSingleImageViewPopup=W,exports.SkipQuestionOfExpertBtn=l=>{var{post:n,onSkip:i,btnText:d,currentPageUrl:c}=l,u=e.__rest(l,["post","onSkip","btnText","currentPageUrl"]);const{t:p}=o.useTranslations(),{data:{locale:v},action:{pushNotifications:g}}=t.useContext(m.TogetherComponentGlobalContext),[f,h]=t.useState(!1),[C,y]=t.useState(!1),E=a.useMantineTheme(),k=t.useCallback((()=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;y(!0);const t=yield m.callApiWithAuth(m.getApiPath(m.PATHS.USER.SKIP_QUESTION,{_locale:v,id:null==n?void 0:n.id}),"PUT");1===(null==t?void 0:t.status)?(null==i||i({id:(null==n?void 0:n.id)||"",communityId:(null===(e=null==n?void 0:n.community)||void 0===e?void 0:e.id)||""}),h(!1),g({title:"",message:"Skip success",type:"success"})):g({title:"",message:null==t?void 0:t.messages,type:"danger"}),y(!1)}))),[]);return w.default.createElement(a.Popover,{width:327,withArrow:!0,shadow:"md",opened:f},w.default.createElement(a.Popover.Target,null,w.default.createElement("div",Object.assign({className:`${q} ${(null==u?void 0:u.className)||""}`,onClick:()=>h(!0)},u),d||p("profilePanel.questionNotClear"))),w.default.createElement(a.Popover.Dropdown,null,w.default.createElement("div",null,w.default.createElement("div",{className:Z},p("profilePanel.skipQuestion.heading")),w.default.createElement("div",{className:Q},p("profilePanel.skipQuestion.content")),w.default.createElement("div",{className:K},w.default.createElement(s.Button,{size:"md",variant:"secondary",leftIcon:w.default.createElement(r.Close,{color:E.fn.primaryColor(),size:24}),onClick:()=>h(!1),styles:()=>({leftIcon:{marginRight:0}})}),w.default.createElement(s.Button,{variant:"primary",size:"md",leftIcon:w.default.createElement(r.Check,{color:"white",size:24}),onClick:k,loading:C,"data-event-category":"Together","data-event-action":"Unclear Question Click","data-event-label":c,styles:()=>({leftIcon:{marginRight:0}})})))))},exports.SocialLinkPreview=G,exports.SubmitReportForm=F,exports.TopicSelectList=R,exports.VerifiedTag=ie,exports.types=de;