@hhgtech/hhg-components 1.29.87 → 1.29.89

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 (459) hide show
  1. package/build/{LastPeriod-671d5143.js → LastPeriod-c8c46da3.js} +1 -1
  2. package/build/MobileBottomNavigationIcon-efacfc0c.js +193 -0
  3. package/build/{WhatsApp-07eb4e4a.js → WhatsApp-8a1d6d0c.js} +1 -1
  4. package/build/adapters.js +18 -16
  5. package/build/atoms.js +47 -45
  6. package/build/babyGrowth.js +82 -80
  7. package/build/cache.js +2 -2
  8. package/build/care.js +28 -25
  9. package/build/careBookingSearchBar.js +1594 -0
  10. package/build/careBookingSearchBarV2.js +1665 -0
  11. package/build/components.js +125 -115
  12. package/build/{constants-970e6cf6.js → constants-f5c5e2ae.js} +1 -1
  13. package/build/constants.js +3 -3
  14. package/build/constantsDomainLocales.js +1 -1
  15. package/build/constantsRiskScreener.js +2 -2
  16. package/build/constantsSite.js +2 -2
  17. package/build/{core-bcde5ba8.js → core-58a245c5.js} +1 -1
  18. package/build/{dataTransform-567bc0c2.js → dataTransform-9ec385e3.js} +1 -1
  19. package/build/ecom.js +4 -4
  20. package/build/editor-40386fe7.js +986 -0
  21. package/build/embeddedHeathToolCards_babyGrowth.js +22 -20
  22. package/build/embeddedHeathToolCards_babyPoop.js +18 -16
  23. package/build/embeddedHeathToolCards_babyVaccine.js +21 -19
  24. package/build/embeddedHeathToolCards_bmi_bmi.js +25 -23
  25. package/build/embeddedHeathToolCards_bmrBmr.js +25 -23
  26. package/build/embeddedHeathToolCards_dueDate_dueDate.js +21 -19
  27. package/build/embeddedHeathToolCards_ovulation_ovulation.js +21 -19
  28. package/build/embeddedHeathToolCards_pwg_pwg.js +26 -24
  29. package/build/embeddedHeathToolCards_targetHeartRate.js +27 -25
  30. package/build/esm/{LastPeriod-ebfcf053.js → LastPeriod-46d6c03f.js} +1 -1
  31. package/build/esm/MobileBottomNavigationIcon-ae6490d7.js +185 -0
  32. package/build/esm/{WhatsApp-c6c8eded.js → WhatsApp-ed8ce0f2.js} +1 -1
  33. package/build/esm/adapters.js +18 -16
  34. package/build/esm/atoms.js +44 -42
  35. package/build/esm/babyGrowth.js +82 -80
  36. package/build/esm/cache.js +2 -2
  37. package/build/esm/care.js +26 -23
  38. package/build/esm/careBookingSearchBar.js +1582 -0
  39. package/build/esm/careBookingSearchBarV2.js +1655 -0
  40. package/build/esm/components.js +93 -83
  41. package/build/esm/{constants-bdf5e358.js → constants-e9ebe043.js} +1 -1
  42. package/build/esm/constants.js +3 -3
  43. package/build/esm/constantsDomainLocales.js +1 -1
  44. package/build/esm/constantsRiskScreener.js +2 -2
  45. package/build/esm/constantsSite.js +2 -2
  46. package/build/esm/{core-b4f1131e.js → core-6d8629c2.js} +1 -1
  47. package/build/esm/{dataTransform-ad9d785b.js → dataTransform-2023858d.js} +2 -2
  48. package/build/esm/ecom.js +4 -4
  49. package/build/esm/editor-82c3d476.js +959 -0
  50. package/build/esm/embeddedHeathToolCards_babyGrowth.js +22 -20
  51. package/build/esm/embeddedHeathToolCards_babyPoop.js +18 -16
  52. package/build/esm/embeddedHeathToolCards_babyVaccine.js +21 -19
  53. package/build/esm/embeddedHeathToolCards_bmi_bmi.js +25 -23
  54. package/build/esm/embeddedHeathToolCards_bmrBmr.js +25 -23
  55. package/build/esm/embeddedHeathToolCards_dueDate_dueDate.js +21 -19
  56. package/build/esm/embeddedHeathToolCards_ovulation_ovulation.js +21 -19
  57. package/build/esm/embeddedHeathToolCards_pwg_pwg.js +26 -24
  58. package/build/esm/embeddedHeathToolCards_targetHeartRate.js +27 -25
  59. package/build/esm/{fixedBottomAdBlock-e5747eb3.js → fixedBottomAdBlock-2af1606f.js} +26 -662
  60. package/build/esm/footer.js +20 -18
  61. package/build/esm/gAssets.js +2 -2
  62. package/build/esm/healthToolsCardWrapper.js +17 -15
  63. package/build/esm/healthToolsForm.js +33 -31
  64. package/build/esm/hooks.js +15 -15
  65. package/build/esm/i18n.js +2 -2
  66. package/build/esm/i18nV2.js +2 -2
  67. package/build/esm/{index-9d2cc0b2.js → index-04ba5caa.js} +1 -1
  68. package/build/esm/{index-8f953b02.js → index-082a24ae.js} +12 -11
  69. package/build/esm/{index-46a2a5d7.js → index-1313a7ac.js} +12 -11
  70. package/build/esm/{index-1322446c.js → index-13783871.js} +2 -2
  71. package/build/esm/{index-3685677f.js → index-16a4f1c7.js} +16 -15
  72. package/build/esm/{index-cc650c45.js → index-19f27bd3.js} +2 -2
  73. package/build/esm/{index-7c6e33e0.js → index-1a2bc551.js} +2 -2
  74. package/build/esm/{index-029c478e.js → index-275c8526.js} +14 -13
  75. package/build/esm/{index-e7c62f10.js → index-277566f7.js} +1 -1
  76. package/build/esm/{index-240e2930.js → index-2ac50d8f.js} +15 -14
  77. package/build/esm/{index-0f6906bb.js → index-2c4a2d31.js} +1 -1
  78. package/build/esm/{index-69dd7596.js → index-32a968a1.js} +6 -6
  79. package/build/esm/{index-0025652b.js → index-346fd194.js} +21 -19
  80. package/build/esm/{index-d4941998.js → index-38b87b21.js} +12 -11
  81. package/build/esm/{index-27a9a555.js → index-46c22744.js} +6 -6
  82. package/build/esm/index-4cf37916.js +22 -0
  83. package/build/esm/{index-5407e81e.js → index-4d27d02e.js} +15 -14
  84. package/build/esm/{index-dbb0b265.js → index-52d04cc5.js} +7 -7
  85. package/build/esm/index-538ca8aa.js +860 -0
  86. package/build/esm/{index-691f32bb.js → index-57da0f13.js} +16 -88
  87. package/build/esm/{index-2449d246.js → index-5e17f985.js} +16 -15
  88. package/build/esm/{index-ffd3c918.js → index-605eed95.js} +35 -800
  89. package/build/esm/{index-b1022535.js → index-628c5e84.js} +2 -2
  90. package/build/esm/{index-0cc19c33.js → index-64b1cd5c.js} +1 -1
  91. package/build/esm/index-673fd5bd.js +1264 -0
  92. package/build/esm/{index-804dcc5a.js → index-70883b48.js} +17 -16
  93. package/build/esm/{index-32114d1a.js → index-71c8b83f.js} +3 -142
  94. package/build/esm/{index-1f077f71.js → index-72c269cf.js} +3 -3
  95. package/build/esm/index-7ad9db02.js +1030 -0
  96. package/build/esm/{index-394c352b.js → index-7ca4ec53.js} +15 -14
  97. package/build/esm/{index-f56ad865.js → index-7decdf27.js} +1 -1
  98. package/build/esm/index-7e95ba03.js +144 -0
  99. package/build/esm/{index-0dd98ba5.js → index-84b3ef3d.js} +3 -3
  100. package/build/esm/{index-4e0ef954.js → index-8b9c7b45.js} +3 -3
  101. package/build/esm/{index-b97f14ca.js → index-930b0a77.js} +16 -15
  102. package/build/esm/{index-79b8f3a0.js → index-93c8863d.js} +2 -2
  103. package/build/esm/{index-16ed17c9.js → index-949f771c.js} +6 -6
  104. package/build/esm/{index-22dbd9d2.js → index-99551970.js} +2 -2
  105. package/build/esm/{index-bf7b2785.js → index-9c268a93.js} +2 -2
  106. package/build/esm/{index-8801ddf9.js → index-9d7d3a53.js} +4 -4
  107. package/build/esm/{index-02019218.js → index-9e220aaa.js} +2 -2
  108. package/build/esm/{index-f4468b77.js → index-a424a33d.js} +3 -3
  109. package/build/esm/{index-b4866578.js → index-a54b6536.js} +14 -13
  110. package/build/esm/{index-53ca94ab.js → index-b09ced58.js} +1 -1
  111. package/build/esm/{index-b13c7add.js → index-b5ed732f.js} +5 -5
  112. package/build/esm/{index-68f3752c.js → index-b867d267.js} +1 -1
  113. package/build/esm/{index-d72f98d1.js → index-c4b04b5f.js} +1 -1
  114. package/build/esm/{index-7aa8728c.js → index-c5286b89.js} +12 -11
  115. package/build/esm/{index-151b9162.js → index-cbb45a5d.js} +2 -2
  116. package/build/esm/{index-2e4a2f44.js → index-d4dcfb68.js} +2 -2
  117. package/build/esm/{index-d7019532.js → index-dec46974.js} +20 -17
  118. package/build/esm/index-e19da15e.js +468 -0
  119. package/build/esm/{index-63825539.js → index-e1d35fec.js} +7 -6
  120. package/build/esm/{index-5eda6b48.js → index-e477c2a3.js} +23 -19
  121. package/build/esm/{index-d0d73bc9.js → index-ed292946.js} +2 -2
  122. package/build/esm/index-f3f06437.js +281 -0
  123. package/build/esm/index.js +118 -98
  124. package/build/esm/index.styles-25454e9c.js +62 -0
  125. package/build/esm/interfaces/types/Subot.d.ts +3 -3
  126. package/build/esm/{labelSorting-eaf1959d.js → labelSorting-27ecf45e.js} +4 -4
  127. package/build/esm/lead.js +22 -20
  128. package/build/esm/{logoIcon-cb9c1f10.js → logoIcon-ef6d9e4c.js} +2 -2
  129. package/build/esm/mantine.js +24 -22
  130. package/build/esm/misc.js +18 -18
  131. package/build/esm/miscGetDynamicHealthTool.js +7 -7
  132. package/build/esm/miscGetSocialList.js +12 -12
  133. package/build/esm/miscScreenSizeContext.js +1 -1
  134. package/build/esm/mobileBottomNavigation.js +19 -0
  135. package/build/esm/mobileBottomNavigationIcon.js +10 -0
  136. package/build/esm/molecules.js +71 -64
  137. package/build/esm/moleculesArticleCard.js +85 -0
  138. package/build/esm/moleculesArticleCardV2.js +171 -0
  139. package/build/esm/navigation.js +40 -35
  140. package/build/esm/navigationLogoutPopup.js +116 -0
  141. package/build/esm/navigationProfileButton.js +43 -0
  142. package/build/esm/{normalizeLink-c66d19ce.js → normalizeLink-d756e5e6.js} +1 -1
  143. package/build/esm/onboardingV2.js +27 -25
  144. package/build/esm/organisms.js +46 -41
  145. package/build/esm/post-86117110.js +267 -0
  146. package/build/esm/profileNavigation.js +441 -0
  147. package/build/esm/progressBar.js +250 -0
  148. package/build/esm/pwg.js +21 -19
  149. package/build/esm/{routing-f3629b7f.js → routing-b81b8f17.js} +1 -1
  150. package/build/esm/subot.js +29 -27
  151. package/build/esm/surveyOrPremiumBanner.js +30 -28
  152. package/build/esm/surveyQuestionCard.js +10 -10
  153. package/build/esm/{surveyThankyouCard-169d4956.js → surveyThankyouCard-1b30aa0b.js} +5 -5
  154. package/build/esm/together.js +53 -44
  155. package/build/esm/togetherApiUtils.js +4 -4
  156. package/build/esm/togetherAtoms.js +29 -26
  157. package/build/esm/togetherComponentGlobalContext.js +4 -4
  158. package/build/esm/togetherMolecules.js +56 -47
  159. package/build/esm/togetherMoleculesCardAuthor.js +41 -0
  160. package/build/esm/togetherMoleculesPostImagePreview.js +21 -0
  161. package/build/esm/togetherMoleculesProfileDetail.js +53 -0
  162. package/build/esm/togetherOrganisms.js +53 -44
  163. package/build/esm/togetherRichTextEditor.js +27 -0
  164. package/build/esm/togetherShareBox.js +305 -0
  165. package/build/esm/{treePopoverMenu-32a26245.js → treePopoverMenu-04ded0ef.js} +18 -17
  166. package/build/esm/types-3eb97d85.js +44 -0
  167. package/build/esm/types.js +2 -2
  168. package/build/esm/{useCategory-0995f0b4.js → useCategory-391ffab0.js} +5 -5
  169. package/build/esm/{useHealthToolCache-7387a56d.js → useHealthToolCache-931ab3ca.js} +1 -1
  170. package/build/esm/{useMantineLocale-7d4ef853.js → useMantineLocale-b29ca68b.js} +5 -5
  171. package/build/esm/{usePlacesAutocomplete-7f23b876.js → usePlacesAutocomplete-91226a4d.js} +1 -1
  172. package/build/esm/useTogetherAuthRequiredAction.js +4 -4
  173. package/build/esm/{useTranslations-12762455.js → useTranslations-b66d9f2b.js} +1 -1
  174. package/build/esm/utils-92e2bc22.js +206 -0
  175. package/build/esm/{utils-24afe0f1.js → utils-f4b925d7.js} +2 -2
  176. package/build/esm/{utils-aa5734af.js → utils-f873578b.js} +4 -4
  177. package/build/esm/vaccination.js +20 -18
  178. package/build/{fixedBottomAdBlock-4db856c1.js → fixedBottomAdBlock-605a8692.js} +49 -691
  179. package/build/footer.js +20 -18
  180. package/build/gAssets.js +2 -2
  181. package/build/healthToolsCardWrapper.js +17 -15
  182. package/build/healthToolsForm.js +33 -31
  183. package/build/hooks.js +15 -15
  184. package/build/i18n.js +1 -1
  185. package/build/i18nV2.js +1 -1
  186. package/build/{index-a91bff81.js → index-0afde39e.js} +2 -2
  187. package/build/{index-5d3563a4.js → index-0cb2de9d.js} +3 -3
  188. package/build/{index-922333dc.js → index-188e2316.js} +15 -14
  189. package/build/index-1b06e81f.js +151 -0
  190. package/build/{index-46a71da2.js → index-1cdccd4e.js} +2 -2
  191. package/build/index-27e50de1.js +478 -0
  192. package/build/{index-ad9d0b0a.js → index-32abfb15.js} +12 -11
  193. package/build/{index-82a0b931.js → index-36723718.js} +6 -6
  194. package/build/{index-ce1b7f76.js → index-36ba9947.js} +2 -2
  195. package/build/{index-c09c64b7.js → index-3c593ede.js} +6 -6
  196. package/build/{index-0450bf33.js → index-4bf6b5da.js} +24 -99
  197. package/build/{index-281daa83.js → index-4fd69136.js} +16 -15
  198. package/build/{index-4c15723a.js → index-526cee72.js} +6 -6
  199. package/build/{index-b64c981f.js → index-549b9e8c.js} +1 -1
  200. package/build/{index-5e984f33.js → index-5b52b076.js} +38 -34
  201. package/build/{index-776f2478.js → index-5dbd317c.js} +34 -33
  202. package/build/index-5dcd87b7.js +289 -0
  203. package/build/{index-169bae02.js → index-648aac83.js} +2 -2
  204. package/build/{index-34ca22f2.js → index-6b7b4292.js} +3 -3
  205. package/build/{index-743255db.js → index-6b95442c.js} +2 -2
  206. package/build/{index-a5526d77.js → index-6b9e8dda.js} +3 -3
  207. package/build/{index-e256aef8.js → index-767f9ac6.js} +2 -2
  208. package/build/{index-deec7e58.js → index-7ce45455.js} +16 -15
  209. package/build/{index-6223ea5f.js → index-81ff6094.js} +7 -7
  210. package/build/{index-0236dd90.js → index-86ecfc48.js} +3 -3
  211. package/build/{index-ddc36398.js → index-8a19ce1b.js} +96 -864
  212. package/build/{index-e3bbbf6e.js → index-8d9663db.js} +9 -8
  213. package/build/{index-ffc38f11.js → index-9151d357.js} +2 -2
  214. package/build/index-922020ed.js +1045 -0
  215. package/build/{index-ac40492f.js → index-a76596ef.js} +1 -1
  216. package/build/{index-0485f54b.js → index-a839c6ca.js} +3 -3
  217. package/build/{index-477ad803.js → index-a8705384.js} +1 -1
  218. package/build/{index-418220e9.js → index-aad249ab.js} +2 -2
  219. package/build/{index-d4801d2c.js → index-af48fea3.js} +5 -5
  220. package/build/{index-41b74c44.js → index-b04c5212.js} +16 -15
  221. package/build/{index-7072811b.js → index-b4fd3100.js} +1 -1
  222. package/build/{index-d903234f.js → index-be0a9d63.js} +17 -16
  223. package/build/{index-b502b7a7.js → index-be262a50.js} +2 -2
  224. package/build/index-becfec7a.js +1307 -0
  225. package/build/index-bf3796aa.js +870 -0
  226. package/build/{index-8a509409.js → index-cc4ce0c4.js} +1 -1
  227. package/build/{index-e6f93e28.js → index-cd0db938.js} +34 -31
  228. package/build/{index-e2ca51d6.js → index-d0610b0f.js} +14 -13
  229. package/build/{index-28f47f15.js → index-d393d57e.js} +1 -1
  230. package/build/{index-538200cd.js → index-d471ff2d.js} +1 -1
  231. package/build/{index-4e5179a2.js → index-d5d9ceb9.js} +15 -14
  232. package/build/{index-cd94cd77.js → index-de26b5d1.js} +12 -11
  233. package/build/{index-3efdbdaf.js → index-dec3abcf.js} +15 -14
  234. package/build/{index-b2757afe.js → index-e018af91.js} +31 -29
  235. package/build/index-e8dc7fdb.js +29 -0
  236. package/build/{index-a0ee5e9f.js → index-f30e56f1.js} +12 -11
  237. package/build/{index-b7e7f5d7.js → index-f6b32484.js} +12 -11
  238. package/build/{index-8e183dab.js → index-f91ed3be.js} +4 -4
  239. package/build/{index-38d090ba.js → index-faa2908c.js} +3 -143
  240. package/build/{index-212720b1.js → index-fbb369ff.js} +1 -1
  241. package/build/{index-3c06bcfd.js → index-fde11604.js} +2 -2
  242. package/build/index.js +182 -162
  243. package/build/index.styles-9031f6d6.js +65 -0
  244. package/build/interfaces/types/Subot.d.ts +3 -3
  245. package/build/{labelSorting-8542da52.js → labelSorting-11165c8e.js} +4 -4
  246. package/build/lead.js +22 -20
  247. package/build/{logoIcon-bd143b65.js → logoIcon-f3283bfd.js} +2 -2
  248. package/build/mantine.js +20 -18
  249. package/build/misc.js +18 -18
  250. package/build/miscGetDynamicHealthTool.js +7 -7
  251. package/build/miscGetSocialList.js +12 -12
  252. package/build/miscScreenSizeContext.js +1 -1
  253. package/build/mobileBottomNavigation.js +27 -0
  254. package/build/mobileBottomNavigationIcon.js +18 -0
  255. package/build/molecules.js +76 -69
  256. package/build/moleculesArticleCard.js +93 -0
  257. package/build/moleculesArticleCardV2.js +180 -0
  258. package/build/navigation.js +40 -35
  259. package/build/navigationLogoutPopup.js +125 -0
  260. package/build/navigationProfileButton.js +51 -0
  261. package/build/onboardingV2.js +29 -27
  262. package/build/organisms.js +49 -44
  263. package/build/post-0fec66f4.js +303 -0
  264. package/build/profileNavigation.js +450 -0
  265. package/build/progressBar.js +260 -0
  266. package/build/pwg.js +21 -19
  267. package/build/{routing-90dba95d.js → routing-7a9c8608.js} +1 -1
  268. package/build/subot.js +28 -26
  269. package/build/surveyOrPremiumBanner.js +30 -28
  270. package/build/surveyQuestionCard.js +10 -10
  271. package/build/{surveyThankyouCard-9aad36f8.js → surveyThankyouCard-db73c893.js} +5 -5
  272. package/build/together.js +77 -68
  273. package/build/togetherApiUtils.js +4 -4
  274. package/build/togetherAtoms.js +29 -26
  275. package/build/togetherComponentGlobalContext.js +4 -4
  276. package/build/togetherMolecules.js +79 -70
  277. package/build/togetherMoleculesCardAuthor.js +49 -0
  278. package/build/togetherMoleculesPostImagePreview.js +29 -0
  279. package/build/togetherMoleculesProfileDetail.js +70 -0
  280. package/build/togetherOrganisms.js +53 -44
  281. package/build/togetherRichTextEditor.js +36 -0
  282. package/build/togetherShareBox.js +314 -0
  283. package/build/{treePopoverMenu-3f7e6767.js → treePopoverMenu-61ebd05c.js} +18 -17
  284. package/build/types-57052089.js +52 -0
  285. package/build/types.js +2 -2
  286. package/build/{useCategory-a808e6a6.js → useCategory-d9f73b82.js} +5 -5
  287. package/build/{useHealthToolCache-42222cc2.js → useHealthToolCache-4b5bfb11.js} +1 -1
  288. package/build/{useMantineLocale-8df90961.js → useMantineLocale-cc272195.js} +5 -5
  289. package/build/{usePlacesAutocomplete-4e21e680.js → usePlacesAutocomplete-a0156f14.js} +1 -1
  290. package/build/useTogetherAuthRequiredAction.js +4 -4
  291. package/build/{useTranslations-6363932f.js → useTranslations-8a9fa84d.js} +1 -1
  292. package/build/{utils-87deb74b.js → utils-251b2841.js} +3 -3
  293. package/build/{utils-4058dee5.js → utils-c29214c6.js} +2 -2
  294. package/build/utils-f47b2d2d.js +229 -0
  295. package/build/vaccination.js +24 -22
  296. package/package.json +1 -1
  297. package/build/esm/index-43aaedbb.js +0 -5060
  298. package/build/esm/types-996bf08e.js +0 -3433
  299. package/build/index-05199dd8.js +0 -5123
  300. package/build/types-89c90eb3.js +0 -3447
  301. /package/build/{BMI_BOYS.percentile.monthly-00dc2939.js → BMI_BOYS.percentile.monthly-5f29289b.js} +0 -0
  302. /package/build/{BMI_BOYS.percentile.weekly-eebf395b.js → BMI_BOYS.percentile.weekly-53584232.js} +0 -0
  303. /package/build/{BMI_BOYS.percentile.yearly-fa98b4c9.js → BMI_BOYS.percentile.yearly-84aaf8fb.js} +0 -0
  304. /package/build/{BMI_BOYS.zscore.monthly-cc66463f.js → BMI_BOYS.zscore.monthly-76d7fd0e.js} +0 -0
  305. /package/build/{BMI_BOYS.zscore.weekly-e1c85879.js → BMI_BOYS.zscore.weekly-ed3d66f2.js} +0 -0
  306. /package/build/{BMI_BOYS.zscore.yearly-88d58724.js → BMI_BOYS.zscore.yearly-7e74f0e8.js} +0 -0
  307. /package/build/{BMI_GIRLS.percentile.monthly-82aff448.js → BMI_GIRLS.percentile.monthly-6973d8b0.js} +0 -0
  308. /package/build/{BMI_GIRLS.percentile.weekly-c5767e28.js → BMI_GIRLS.percentile.weekly-a873a4e6.js} +0 -0
  309. /package/build/{BMI_GIRLS.percentile.yearly-e45d9106.js → BMI_GIRLS.percentile.yearly-e86761bb.js} +0 -0
  310. /package/build/{BMI_GIRLS.zscore.monthly-120aa581.js → BMI_GIRLS.zscore.monthly-9a12fa84.js} +0 -0
  311. /package/build/{BMI_GIRLS.zscore.weekly-2f64347e.js → BMI_GIRLS.zscore.weekly-5936ed5b.js} +0 -0
  312. /package/build/{BMI_GIRLS.zscore.yearly-ed842624.js → BMI_GIRLS.zscore.yearly-d40d8356.js} +0 -0
  313. /package/build/{ChevronDown-89002c32.js → ChevronDown-a6775d48.js} +0 -0
  314. /package/build/{Close-5e8e15ce.js → Close-9fa735bc.js} +0 -0
  315. /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-b1965149.js → HEAD CIRCUM_BOYS.percentile.monthly-873a839f.js} +0 -0
  316. /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-7c8df376.js → HEAD CIRCUM_BOYS.percentile.weekly-bbe3965d.js} +0 -0
  317. /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-ebafd6df.js → HEAD CIRCUM_BOYS.percentile.yearly-645dfc78.js} +0 -0
  318. /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-b5a0cdd1.js → HEAD CIRCUM_BOYS.zscore.monthly-9fe137bf.js} +0 -0
  319. /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-4c32261f.js → HEAD CIRCUM_BOYS.zscore.weekly-2ccb15fb.js} +0 -0
  320. /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-7642a6b6.js → HEAD CIRCUM_BOYS.zscore.yearly-48aed724.js} +0 -0
  321. /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-37a5b7b2.js → HEAD CIRCUM_GIRLS.percentile.monthly-d99d6d30.js} +0 -0
  322. /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-909278a6.js → HEAD CIRCUM_GIRLS.percentile.weekly-8a49b504.js} +0 -0
  323. /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-bd7732f5.js → HEAD CIRCUM_GIRLS.percentile.yearly-d747b0cd.js} +0 -0
  324. /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-5a1dc106.js → HEAD CIRCUM_GIRLS.zscore.monthly-8ef18721.js} +0 -0
  325. /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-19531ac2.js → HEAD CIRCUM_GIRLS.zscore.weekly-853cca20.js} +0 -0
  326. /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-3e9b57e2.js → HEAD CIRCUM_GIRLS.zscore.yearly-4d5b2175.js} +0 -0
  327. /package/build/{HEIGHT_BOYS.percentile.monthly-75d3928f.js → HEIGHT_BOYS.percentile.monthly-070590b8.js} +0 -0
  328. /package/build/{HEIGHT_BOYS.percentile.weekly-49d0eac1.js → HEIGHT_BOYS.percentile.weekly-56741428.js} +0 -0
  329. /package/build/{HEIGHT_BOYS.percentile.yearly-ca043db8.js → HEIGHT_BOYS.percentile.yearly-9c81f767.js} +0 -0
  330. /package/build/{HEIGHT_BOYS.zscore.monthly-0ef5a0b0.js → HEIGHT_BOYS.zscore.monthly-729982c3.js} +0 -0
  331. /package/build/{HEIGHT_BOYS.zscore.weekly-897641f9.js → HEIGHT_BOYS.zscore.weekly-ddb206fb.js} +0 -0
  332. /package/build/{HEIGHT_BOYS.zscore.yearly-2f57ee05.js → HEIGHT_BOYS.zscore.yearly-5fc7ea6a.js} +0 -0
  333. /package/build/{HEIGHT_GIRLS.percentile.monthly-35a2bd2b.js → HEIGHT_GIRLS.percentile.monthly-8cbc8d18.js} +0 -0
  334. /package/build/{HEIGHT_GIRLS.percentile.weekly-6682008a.js → HEIGHT_GIRLS.percentile.weekly-7145e94f.js} +0 -0
  335. /package/build/{HEIGHT_GIRLS.percentile.yearly-1490cd28.js → HEIGHT_GIRLS.percentile.yearly-ab0e4f4e.js} +0 -0
  336. /package/build/{HEIGHT_GIRLS.zscore.monthly-ab0ba051.js → HEIGHT_GIRLS.zscore.monthly-b851b1d7.js} +0 -0
  337. /package/build/{HEIGHT_GIRLS.zscore.weekly-8cd489df.js → HEIGHT_GIRLS.zscore.weekly-98aef3cf.js} +0 -0
  338. /package/build/{HEIGHT_GIRLS.zscore.yearly-547aa680.js → HEIGHT_GIRLS.zscore.yearly-65d990f7.js} +0 -0
  339. /package/build/{Locale-126bf6bd.js → Locale-07aceee9.js} +0 -0
  340. /package/build/{Visible-7090d851.js → Visible-ddeaf4cc.js} +0 -0
  341. /package/build/{WEIGHT_BOYS.percentile.monthly-2c6444a6.js → WEIGHT_BOYS.percentile.monthly-0ce96694.js} +0 -0
  342. /package/build/{WEIGHT_BOYS.percentile.weekly-d43234b7.js → WEIGHT_BOYS.percentile.weekly-b5397f20.js} +0 -0
  343. /package/build/{WEIGHT_BOYS.percentile.yearly-361c6438.js → WEIGHT_BOYS.percentile.yearly-80cccd42.js} +0 -0
  344. /package/build/{WEIGHT_BOYS.zscore.monthly-1a56d8b2.js → WEIGHT_BOYS.zscore.monthly-12907f1f.js} +0 -0
  345. /package/build/{WEIGHT_BOYS.zscore.weekly-b1548cdf.js → WEIGHT_BOYS.zscore.weekly-a1af17eb.js} +0 -0
  346. /package/build/{WEIGHT_BOYS.zscore.yearly-17b0334c.js → WEIGHT_BOYS.zscore.yearly-2649ff58.js} +0 -0
  347. /package/build/{WEIGHT_GIRLS.percentile.monthly-64e137c6.js → WEIGHT_GIRLS.percentile.monthly-222d7201.js} +0 -0
  348. /package/build/{WEIGHT_GIRLS.percentile.weekly-98c2fb5d.js → WEIGHT_GIRLS.percentile.weekly-2997b740.js} +0 -0
  349. /package/build/{WEIGHT_GIRLS.percentile.yearly-533341f7.js → WEIGHT_GIRLS.percentile.yearly-3dc5928a.js} +0 -0
  350. /package/build/{WEIGHT_GIRLS.zscore.monthly-d17a0d64.js → WEIGHT_GIRLS.zscore.monthly-742b7617.js} +0 -0
  351. /package/build/{WEIGHT_GIRLS.zscore.weekly-36a412aa.js → WEIGHT_GIRLS.zscore.weekly-5ee1ca40.js} +0 -0
  352. /package/build/{WEIGHT_GIRLS.zscore.yearly-68f9f66b.js → WEIGHT_GIRLS.zscore.yearly-d6ca7d60.js} +0 -0
  353. /package/build/{animation-fce92928.js → animation-a1ed71d8.js} +0 -0
  354. /package/build/{cart-d32faa71.js → cart-7bc1b943.js} +0 -0
  355. /package/build/{constants-83e17a08.js → constants-4cad9f4d.js} +0 -0
  356. /package/build/{constants-ef1d9e50.js → constants-81b95117.js} +0 -0
  357. /package/build/{constants-6b5e2780.js → constants-c3b9c9a9.js} +0 -0
  358. /package/build/{dataTransform-64f3ba4c.js → dataTransform-867c472c.js} +0 -0
  359. /package/build/{doctor-2a2b78b0.js → doctor-dca6d1b2.js} +0 -0
  360. /package/build/esm/{BMI_BOYS.percentile.monthly-71f6615e.js → BMI_BOYS.percentile.monthly-2388d98f.js} +0 -0
  361. /package/build/esm/{BMI_BOYS.percentile.weekly-8729108b.js → BMI_BOYS.percentile.weekly-8ebe6955.js} +0 -0
  362. /package/build/esm/{BMI_BOYS.percentile.yearly-fe8dc27c.js → BMI_BOYS.percentile.yearly-3a97e95b.js} +0 -0
  363. /package/build/esm/{BMI_BOYS.zscore.monthly-aa14f52a.js → BMI_BOYS.zscore.monthly-f7572dcd.js} +0 -0
  364. /package/build/esm/{BMI_BOYS.zscore.weekly-6857bca0.js → BMI_BOYS.zscore.weekly-d6281906.js} +0 -0
  365. /package/build/esm/{BMI_BOYS.zscore.yearly-05894e8d.js → BMI_BOYS.zscore.yearly-fbebaaca.js} +0 -0
  366. /package/build/esm/{BMI_GIRLS.percentile.monthly-99639eee.js → BMI_GIRLS.percentile.monthly-a75c8880.js} +0 -0
  367. /package/build/esm/{BMI_GIRLS.percentile.weekly-241a8c86.js → BMI_GIRLS.percentile.weekly-652bc9af.js} +0 -0
  368. /package/build/esm/{BMI_GIRLS.percentile.yearly-a7d673ad.js → BMI_GIRLS.percentile.yearly-8bcb5a6e.js} +0 -0
  369. /package/build/esm/{BMI_GIRLS.zscore.monthly-ac552c64.js → BMI_GIRLS.zscore.monthly-ecbe2982.js} +0 -0
  370. /package/build/esm/{BMI_GIRLS.zscore.weekly-d3bd5cf8.js → BMI_GIRLS.zscore.weekly-3abed735.js} +0 -0
  371. /package/build/esm/{BMI_GIRLS.zscore.yearly-68c40e02.js → BMI_GIRLS.zscore.yearly-d88a34a0.js} +0 -0
  372. /package/build/esm/{ChevronDown-1c6ac70a.js → ChevronDown-dfd91883.js} +0 -0
  373. /package/build/esm/{Close-9dbbc4f5.js → Close-b8fc27b1.js} +0 -0
  374. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.monthly-e844f279.js → HEAD CIRCUM_BOYS.percentile.monthly-ff980a90.js} +0 -0
  375. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.weekly-c0ea6fc4.js → HEAD CIRCUM_BOYS.percentile.weekly-eb86eac9.js} +0 -0
  376. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.yearly-58273474.js → HEAD CIRCUM_BOYS.percentile.yearly-27ed6504.js} +0 -0
  377. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.monthly-867569e0.js → HEAD CIRCUM_BOYS.zscore.monthly-0d345597.js} +0 -0
  378. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.weekly-1c2e6c46.js → HEAD CIRCUM_BOYS.zscore.weekly-c182ab46.js} +0 -0
  379. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.yearly-4d2f300f.js → HEAD CIRCUM_BOYS.zscore.yearly-d45dbce1.js} +0 -0
  380. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.monthly-5d75244f.js → HEAD CIRCUM_GIRLS.percentile.monthly-61919e45.js} +0 -0
  381. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.weekly-73bd9176.js → HEAD CIRCUM_GIRLS.percentile.weekly-51fa8f98.js} +0 -0
  382. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.yearly-d1a55615.js → HEAD CIRCUM_GIRLS.percentile.yearly-c1fa6006.js} +0 -0
  383. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.monthly-4d365a9f.js → HEAD CIRCUM_GIRLS.zscore.monthly-4dfc55d8.js} +0 -0
  384. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.weekly-41370dfb.js → HEAD CIRCUM_GIRLS.zscore.weekly-b21b5bf1.js} +0 -0
  385. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.yearly-06ac6807.js → HEAD CIRCUM_GIRLS.zscore.yearly-c42836fa.js} +0 -0
  386. /package/build/esm/{HEIGHT_BOYS.percentile.monthly-3b18440a.js → HEIGHT_BOYS.percentile.monthly-24ff8afa.js} +0 -0
  387. /package/build/esm/{HEIGHT_BOYS.percentile.weekly-01a65af3.js → HEIGHT_BOYS.percentile.weekly-2be7b66e.js} +0 -0
  388. /package/build/esm/{HEIGHT_BOYS.percentile.yearly-c8203619.js → HEIGHT_BOYS.percentile.yearly-ac02aa2d.js} +0 -0
  389. /package/build/esm/{HEIGHT_BOYS.zscore.monthly-a3319613.js → HEIGHT_BOYS.zscore.monthly-b43667dc.js} +0 -0
  390. /package/build/esm/{HEIGHT_BOYS.zscore.weekly-981efa8b.js → HEIGHT_BOYS.zscore.weekly-abcfcf3a.js} +0 -0
  391. /package/build/esm/{HEIGHT_BOYS.zscore.yearly-a98e3bc6.js → HEIGHT_BOYS.zscore.yearly-71598c16.js} +0 -0
  392. /package/build/esm/{HEIGHT_GIRLS.percentile.monthly-6959773b.js → HEIGHT_GIRLS.percentile.monthly-7f9d679c.js} +0 -0
  393. /package/build/esm/{HEIGHT_GIRLS.percentile.weekly-128bb11e.js → HEIGHT_GIRLS.percentile.weekly-6ce1d4e7.js} +0 -0
  394. /package/build/esm/{HEIGHT_GIRLS.percentile.yearly-29a94e1c.js → HEIGHT_GIRLS.percentile.yearly-c398fd6b.js} +0 -0
  395. /package/build/esm/{HEIGHT_GIRLS.zscore.monthly-dd466c09.js → HEIGHT_GIRLS.zscore.monthly-8d33bc28.js} +0 -0
  396. /package/build/esm/{HEIGHT_GIRLS.zscore.weekly-b602fae7.js → HEIGHT_GIRLS.zscore.weekly-eb44c302.js} +0 -0
  397. /package/build/esm/{HEIGHT_GIRLS.zscore.yearly-358063df.js → HEIGHT_GIRLS.zscore.yearly-10b4d1fe.js} +0 -0
  398. /package/build/esm/{Locale-f781df87.js → Locale-b86a7a92.js} +0 -0
  399. /package/build/esm/{Visible-46717d08.js → Visible-69da852f.js} +0 -0
  400. /package/build/esm/{WEIGHT_BOYS.percentile.monthly-00996ab0.js → WEIGHT_BOYS.percentile.monthly-fd349fe7.js} +0 -0
  401. /package/build/esm/{WEIGHT_BOYS.percentile.weekly-c3c6f755.js → WEIGHT_BOYS.percentile.weekly-d5e52d60.js} +0 -0
  402. /package/build/esm/{WEIGHT_BOYS.percentile.yearly-c4571ef6.js → WEIGHT_BOYS.percentile.yearly-929119b3.js} +0 -0
  403. /package/build/esm/{WEIGHT_BOYS.zscore.monthly-b5eaafd1.js → WEIGHT_BOYS.zscore.monthly-3f0f08cd.js} +0 -0
  404. /package/build/esm/{WEIGHT_BOYS.zscore.weekly-b058aef3.js → WEIGHT_BOYS.zscore.weekly-b9fd3298.js} +0 -0
  405. /package/build/esm/{WEIGHT_BOYS.zscore.yearly-4557bb07.js → WEIGHT_BOYS.zscore.yearly-9945948d.js} +0 -0
  406. /package/build/esm/{WEIGHT_GIRLS.percentile.monthly-094c8315.js → WEIGHT_GIRLS.percentile.monthly-1e83ae51.js} +0 -0
  407. /package/build/esm/{WEIGHT_GIRLS.percentile.weekly-59bd62f7.js → WEIGHT_GIRLS.percentile.weekly-c3531852.js} +0 -0
  408. /package/build/esm/{WEIGHT_GIRLS.percentile.yearly-7064def2.js → WEIGHT_GIRLS.percentile.yearly-3c0040b0.js} +0 -0
  409. /package/build/esm/{WEIGHT_GIRLS.zscore.monthly-3e264c0b.js → WEIGHT_GIRLS.zscore.monthly-3baeda15.js} +0 -0
  410. /package/build/esm/{WEIGHT_GIRLS.zscore.weekly-8402d0e1.js → WEIGHT_GIRLS.zscore.weekly-2d8e6618.js} +0 -0
  411. /package/build/esm/{WEIGHT_GIRLS.zscore.yearly-58908f5c.js → WEIGHT_GIRLS.zscore.yearly-826f5bdd.js} +0 -0
  412. /package/build/esm/{animation-12f6a99a.js → animation-7207941a.js} +0 -0
  413. /package/build/esm/{cart-5cbf8fde.js → cart-4f482601.js} +0 -0
  414. /package/build/esm/{constants-c65d5e73.js → constants-0497b893.js} +0 -0
  415. /package/build/esm/{constants-7447b364.js → constants-af02be2a.js} +0 -0
  416. /package/build/esm/{constants-28f21bf7.js → constants-f7943ab2.js} +0 -0
  417. /package/build/esm/{dataTransform-4564c01a.js → dataTransform-610e61bf.js} +0 -0
  418. /package/build/esm/{doctor-a6dcb5b0.js → doctor-63e09ada.js} +0 -0
  419. /package/build/esm/{index-d1c6a5eb.js → index-20192854.js} +0 -0
  420. /package/build/esm/{index-3dfef0e2.js → index-20199246.js} +0 -0
  421. /package/build/esm/{index-7149c324.js → index-5364f2db.js} +0 -0
  422. /package/build/esm/{index-9d1a8bc8.js → index-56d0ac47.js} +0 -0
  423. /package/build/esm/{index-e2a19de9.js → index-9f076f64.js} +0 -0
  424. /package/build/esm/{index-31ca33d1.js → index-a2506e52.js} +0 -0
  425. /package/build/esm/{index-b503d8ca.js → index-c130afdc.js} +0 -0
  426. /package/build/esm/{index-5bd25778.js → index-c9467e39.js} +0 -0
  427. /package/build/esm/{localizeNumberFormat-fe248dc9.js → localizeNumberFormat-3bf28240.js} +0 -0
  428. /package/build/esm/{number-59fe2c76.js → number-d26abebe.js} +0 -0
  429. /package/build/esm/{other-8082eeb8.js → other-08d0b30e.js} +0 -0
  430. /package/build/esm/{paths-a31c249e.js → paths-ce59b252.js} +0 -0
  431. /package/build/esm/{translationsContext-f05845a3.js → translationsContext-8afb0ce3.js} +0 -0
  432. /package/build/esm/{tslib.es6-2813a841.js → tslib.es6-e0840efa.js} +0 -0
  433. /package/build/esm/{types-e1b0b130.js → types-41242882.js} +0 -0
  434. /package/build/esm/{useIsInit-6417c32d.js → useIsInit-f59c6bd2.js} +0 -0
  435. /package/build/esm/{useOutsideClick-cabe5b52.js → useOutsideClick-12815e56.js} +0 -0
  436. /package/build/esm/{useScrollbarSize-93f9665c.js → useScrollbarSize-431cf33c.js} +0 -0
  437. /package/build/esm/{useUniqueId-0c237f04.js → useUniqueId-8f710187.js} +0 -0
  438. /package/build/esm/{utils-5ac430a2.js → utils-8a1f05c9.js} +0 -0
  439. /package/build/{index-9a3d05f1.js → index-017f99b2.js} +0 -0
  440. /package/build/{index-ddd1ae54.js → index-1a6a94cd.js} +0 -0
  441. /package/build/{index-126368b4.js → index-668f591b.js} +0 -0
  442. /package/build/{index-eae45243.js → index-70abc2ac.js} +0 -0
  443. /package/build/{index-1fab78b5.js → index-c6b0831a.js} +0 -0
  444. /package/build/{index-d0ba8956.js → index-ce2d2850.js} +0 -0
  445. /package/build/{index-31ba7c80.js → index-e3e72aed.js} +0 -0
  446. /package/build/{index-b895e598.js → index-f70c0edf.js} +0 -0
  447. /package/build/{localizeNumberFormat-52a8a959.js → localizeNumberFormat-30e7f015.js} +0 -0
  448. /package/build/{normalizeLink-8a458cb4.js → normalizeLink-c1b2b407.js} +0 -0
  449. /package/build/{number-8f639a87.js → number-20d56f69.js} +0 -0
  450. /package/build/{other-fcf0cbba.js → other-eedaf6ca.js} +0 -0
  451. /package/build/{paths-822d5ab1.js → paths-4c182009.js} +0 -0
  452. /package/build/{translationsContext-1fe0412c.js → translationsContext-cd046df4.js} +0 -0
  453. /package/build/{tslib.es6-d6f7eba3.js → tslib.es6-f3c387c0.js} +0 -0
  454. /package/build/{types-7b239cb4.js → types-2614ec58.js} +0 -0
  455. /package/build/{useIsInit-3c23a980.js → useIsInit-e56642e4.js} +0 -0
  456. /package/build/{useOutsideClick-dcf05d21.js → useOutsideClick-f18dfe3f.js} +0 -0
  457. /package/build/{useScrollbarSize-e144fad0.js → useScrollbarSize-4aaa4dd1.js} +0 -0
  458. /package/build/{useUniqueId-47d33d64.js → useUniqueId-621ec272.js} +0 -0
  459. /package/build/{utils-03c7b063.js → utils-ae9740c0.js} +0 -0
@@ -0,0 +1,1264 @@
1
+ import React__default, { useState, useMemo, useContext, useEffect, createContext, useRef } from 'react';
2
+ import { B as Button } from './index-9c268a93.js';
3
+ import { H as Heading } from './index-1a2bc551.js';
4
+ import { T as Text } from './index-99551970.js';
5
+ import { c as safeEncodeURI, M as MediaQueries, t as toggleNoScroll, a as getPopupWrapperDom } from './utils-8a1f05c9.js';
6
+ import * as ReactDOM from 'react-dom';
7
+ import { b as callApiWithAuth, d as getApiPath, T as TogetherComponentGlobalContext, c as callApi } from './utils-f873578b.js';
8
+ import styled from '@emotion/styled';
9
+ import { theme } from './miscTheme.js';
10
+ import { a as __awaiter } from './tslib.es6-e0840efa.js';
11
+ import { I as Input } from './index-d4dcfb68.js';
12
+ import { u as useTranslations } from './useTranslations-b66d9f2b.js';
13
+ import { e as formatComment } from './dataTransform-2023858d.js';
14
+ import { M as MAX_IMAGE_UPLOADS, a as DEFAULT_AVATAR_IMG, D as DEFAULT_IMG } from './constants-0497b893.js';
15
+ import { PATHS } from './togetherApiPaths.js';
16
+ import { r as removeBannedWordWrapper, g as getMentionIdsFromString, e as encodePostContent, u as uploadAndGetSrc, y as youtubeVidIdGetter } from './post-86117110.js';
17
+ import { C as CardLink } from './index-7e95ba03.js';
18
+ import { L as Loading } from './index-7ad9db02.js';
19
+ import { U as UserAvatar } from './index-93c8863d.js';
20
+ import { R as RichTextEditor } from './editor-82c3d476.js';
21
+ import { Portal, useMantineTheme } from '@mantine/core';
22
+ import { FullScreen } from '@hhgtech/icons/other';
23
+ import { P as Popup } from './index-04ba5caa.js';
24
+ import { C as CloseIcon } from './index-e19da15e.js';
25
+ import { ShareBox } from './togetherShareBox.js';
26
+ import { I as ImageWrap } from './index-4cf37916.js';
27
+
28
+ const getDefaultFailNoti = (t) => ({
29
+ message: t('notification.failure'),
30
+ type: 'danger',
31
+ });
32
+
33
+ const likeUnlikePost = ({ id, locale, }) => __awaiter(void 0, void 0, void 0, function* () {
34
+ if (!id)
35
+ return;
36
+ const res = yield callApiWithAuth(getApiPath(PATHS.POST.LIKE, {
37
+ id,
38
+ _locale: locale,
39
+ }), 'GET');
40
+ return res;
41
+ });
42
+ const deletePost = ({ id, locale, }) => __awaiter(void 0, void 0, void 0, function* () {
43
+ if (!id)
44
+ return;
45
+ const res = yield callApiWithAuth(getApiPath(PATHS.POST.DELETE, {
46
+ id,
47
+ _locale: locale,
48
+ }), 'DELETE');
49
+ return res;
50
+ });
51
+ const getPostFormData = ({ title, description, communityId, imageFiles, previewUrl, topicIds, locale, sanitizeFunction, categoryCommunityId, categoryTopicIds,
52
+ // admin only
53
+ introUrl, bannerUrl, scheduleTime, isAnonymous, isAskDoctor, }) => __awaiter(void 0, void 0, void 0, function* () {
54
+ const bodyFormData = new FormData();
55
+ const submitDescription = removeBannedWordWrapper(description);
56
+ const submitTitle = removeBannedWordWrapper(title);
57
+ const mentionIds = getMentionIdsFromString(submitDescription);
58
+ bodyFormData.append('title', submitTitle);
59
+ bodyFormData.append('description', encodePostContent(submitDescription, sanitizeFunction));
60
+ if (categoryCommunityId) {
61
+ bodyFormData.append('category_community', String(categoryCommunityId));
62
+ }
63
+ else if (communityId) {
64
+ bodyFormData.append('community_id', String(communityId));
65
+ }
66
+ bodyFormData.append('is_anonymous', isAnonymous ? '1' : '0');
67
+ bodyFormData.append('is_question', isAskDoctor ? '1' : '0');
68
+ (previewUrl === null || previewUrl === void 0 ? void 0 : previewUrl.title) && bodyFormData.append('preview_title', previewUrl.title);
69
+ (previewUrl === null || previewUrl === void 0 ? void 0 : previewUrl.description) &&
70
+ bodyFormData.append('preview_description', previewUrl.description);
71
+ (previewUrl === null || previewUrl === void 0 ? void 0 : previewUrl.url) &&
72
+ bodyFormData.append('preview_link', safeEncodeURI(previewUrl.url));
73
+ (previewUrl === null || previewUrl === void 0 ? void 0 : previewUrl.image) &&
74
+ bodyFormData.append('preview_image', safeEncodeURI(previewUrl.image));
75
+ topicIds === null || topicIds === void 0 ? void 0 : topicIds.forEach((topicId) => {
76
+ bodyFormData.append('topics[]', String(topicId || ''));
77
+ });
78
+ categoryTopicIds === null || categoryTopicIds === void 0 ? void 0 : categoryTopicIds.forEach((topicId) => {
79
+ bodyFormData.append('category_topics[]', String(topicId || ''));
80
+ });
81
+ if (!!(imageFiles === null || imageFiles === void 0 ? void 0 : imageFiles.length)) {
82
+ const imageSrcs = yield Promise.all(imageFiles.map((file, index) => new Promise((resolve) => {
83
+ setTimeout(() => {
84
+ resolve(uploadAndGetSrc(file, locale));
85
+ }, index * 2000);
86
+ })));
87
+ imageSrcs === null || imageSrcs === void 0 ? void 0 : imageSrcs.filter(Boolean).slice(0, MAX_IMAGE_UPLOADS).forEach((imageFile, index) => {
88
+ bodyFormData.append(`images[${index}]`, imageFile);
89
+ });
90
+ }
91
+ else {
92
+ bodyFormData.append(`images`, '');
93
+ }
94
+ mentionIds === null || mentionIds === void 0 ? void 0 : mentionIds.forEach((mentionId) => {
95
+ bodyFormData.append(`mention_ids[]`, mentionId);
96
+ });
97
+ // Admin only
98
+ bodyFormData.append('intro_url', introUrl || '');
99
+ bodyFormData.append('banner', bannerUrl || '');
100
+ if (scheduleTime) {
101
+ bodyFormData.append('post_type', 'scheduled');
102
+ bodyFormData.append('schedule_datetime', scheduleTime);
103
+ }
104
+ return bodyFormData;
105
+ });
106
+ const createPost = ({ locale, formData, isArticleComment, }) => __awaiter(void 0, void 0, void 0, function* () {
107
+ const res = yield callApiWithAuth(getApiPath(isArticleComment ? PATHS.POST.CREATE_ARTICLE_COMMENT : PATHS.POST.CREATE, {
108
+ _locale: locale,
109
+ }), 'POST', {
110
+ data: formData,
111
+ });
112
+ return res;
113
+ });
114
+ const editPost = ({ id, locale, formData, }) => __awaiter(void 0, void 0, void 0, function* () {
115
+ const res = yield callApiWithAuth(getApiPath(PATHS.POST.UPDATE, {
116
+ id,
117
+ _locale: locale,
118
+ }), 'POST', {
119
+ data: formData,
120
+ });
121
+ return res;
122
+ });
123
+ const reportPost = ({ id, reason, locale, }) => {
124
+ const formData = new FormData();
125
+ formData.append('reason', reason);
126
+ return callApiWithAuth(getApiPath(PATHS.POST.REPORT, {
127
+ _locale: locale,
128
+ id,
129
+ }), 'POST', {
130
+ data: formData,
131
+ });
132
+ };
133
+
134
+ const useImagePicker = (imageFilesProp, onImageFilesChange) => {
135
+ const [imageFiles, setImageFiles] = useState(imageFilesProp || []);
136
+ const imageSrcs = useMemo(() => (imageFilesProp || imageFiles).map((file) => typeof file === 'string' ? file : URL.createObjectURL(file)), [imageFilesProp, imageFiles]);
137
+ const onSelectImages = (e) => {
138
+ const files = e.target.files;
139
+ if (files) {
140
+ if (onImageFilesChange && imageFilesProp) {
141
+ const _files = imageFilesProp || imageFiles;
142
+ onImageFilesChange(_files.concat(Array.from(files)));
143
+ }
144
+ else
145
+ setImageFiles((imgs) => {
146
+ const _imgs = imageFilesProp || imgs;
147
+ onImageFilesChange &&
148
+ onImageFilesChange(_imgs.concat(Array.from(files)));
149
+ return _imgs.concat(Array.from(files));
150
+ });
151
+ }
152
+ };
153
+ const onRemoveImage = (index) => {
154
+ if (onImageFilesChange && imageFilesProp) {
155
+ const _files = imageFilesProp;
156
+ _files.splice(index, 1);
157
+ onImageFilesChange(_files.slice());
158
+ }
159
+ else {
160
+ setImageFiles((imgs) => {
161
+ const _imgs = imageFilesProp || imgs;
162
+ _imgs.splice(index, 1);
163
+ onImageFilesChange && onImageFilesChange(_imgs.slice());
164
+ return _imgs.slice();
165
+ });
166
+ }
167
+ };
168
+ const onRemoveAllImages = () => {
169
+ onImageFilesChange ? onImageFilesChange([]) : setImageFiles([]);
170
+ };
171
+ return {
172
+ onSelectImages,
173
+ onRemoveImage,
174
+ onRemoveAllImages,
175
+ imageSrcs,
176
+ imageFiles: imageFilesProp || imageFiles,
177
+ };
178
+ };
179
+
180
+ var img$4 = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='25' fill='none'%3e%3cpath fill='%23262626' d='M12 22.984c5.523 0 10-4.477 10-10s-4.477-10-10-10-10 4.478-10 10 4.477 10 10 10'/%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m14.828 10.156-5.657 5.657M9.172 10.156l5.657 5.657'/%3e%3c/svg%3e";
181
+ var IconCloseCircle = img$4;
182
+
183
+ const StyledPopupDanger = styled.div `
184
+ [data-type='confirm'] {
185
+ width: min(360px, 100%);
186
+ height: auto;
187
+ &[data-open='false'] {
188
+ top: calc(-100% - 500px);
189
+ }
190
+ }
191
+ z-index: 600;
192
+
193
+ .header {
194
+ display: none !important;
195
+ }
196
+
197
+ .confirm-dialog {
198
+ position: relative;
199
+ overflow: auto;
200
+ width: 100%;
201
+ padding-top: 44px;
202
+ background: #fff;
203
+ border-radius: ${theme.borderRadius};
204
+
205
+ .confirm-content {
206
+ display: flex;
207
+ flex-direction: column;
208
+ align-items: center;
209
+ padding: 0 16px 16px;
210
+ text-align: center;
211
+
212
+ .title {
213
+ margin-bottom: 8px;
214
+ font-size: 24px;
215
+ line-height: 32px;
216
+ word-break: break-word;
217
+ overflow-wrap: break-word;
218
+ }
219
+
220
+ .desc {
221
+ margin-bottom: 24px;
222
+ color: ${theme.colors.gray500};
223
+ font-size: 18px;
224
+ line-height: 24px;
225
+ text-align: center;
226
+ word-break: break-word;
227
+ overflow-wrap: break-word;
228
+ }
229
+
230
+ .btn-group {
231
+ display: flex;
232
+ flex-wrap: wrap;
233
+ align-items: center;
234
+ justify-content: center;
235
+
236
+ button {
237
+ margin: 0 4px 0.5rem;
238
+ }
239
+ }
240
+ }
241
+ }
242
+ .thumbnail-container {
243
+ width: 80px;
244
+ height: 80px;
245
+ margin-bottom: 32px;
246
+ .thumbnail {
247
+ width: 100%;
248
+ height: 100%;
249
+ }
250
+ &.is-icon {
251
+ display: flex;
252
+ align-items: center;
253
+ justify-content: center;
254
+ background: #e0e9fc;
255
+ border-radius: 1rem;
256
+ .thumbnail {
257
+ width: 40px;
258
+ height: 40px;
259
+ }
260
+ }
261
+ }
262
+ &[data-is-marrybaby='true'] {
263
+ .popup-frame {
264
+ > div:first-child {
265
+ overflow: hidden;
266
+ border-radius: 1rem;
267
+ &[data-open='true'] {
268
+ ${MediaQueries.mbDown} {
269
+ top: 100%;
270
+ transform: translate(-50%, -100%);
271
+ max-width: unset;
272
+ width: 100%;
273
+ background: unset;
274
+ overflow: unset;
275
+ }
276
+ }
277
+ }
278
+ .popup-content {
279
+ .close-button {
280
+ ${MediaQueries.mbDown} {
281
+ display: none;
282
+ }
283
+ }
284
+ .confirm-dialog {
285
+ ${MediaQueries.mbDown} {
286
+ background: unset;
287
+ position: relative;
288
+ overflow-x: hidden;
289
+ &::before {
290
+ content: '';
291
+ width: 200%;
292
+ background: #fff;
293
+ position: absolute;
294
+ left: 50%;
295
+ top: 0;
296
+ transform: translateX(-50%);
297
+ z-index: -1;
298
+ height: 100%;
299
+ border-top-left-radius: 100%;
300
+ border-top-right-radius: 100%;
301
+ }
302
+ }
303
+ .confirm-content {
304
+ padding: 0 40px 40px;
305
+ ${MediaQueries.mbDown} {
306
+ padding-left: 1.5rem;
307
+ padding-right: 1.5rem;
308
+ }
309
+ .btn-group {
310
+ width: 100%;
311
+ justify-content: space-between;
312
+ button {
313
+ flex: 1;
314
+ margin: 0;
315
+ &:first-child {
316
+ margin-right: 0.5rem;
317
+ }
318
+ }
319
+ }
320
+ }
321
+ }
322
+ }
323
+ .thumbnail-container {
324
+ ${MediaQueries.mbDown} {
325
+ display: none;
326
+ }
327
+ &.is-icon {
328
+ background: #ffeaf1;
329
+ border-radius: 24px;
330
+ }
331
+ &.is-mobile {
332
+ position: absolute;
333
+ top: 0;
334
+ left: 50%;
335
+ display: none;
336
+ width: 48px;
337
+ height: 48px;
338
+ transform: translate(-50%, -50%);
339
+ &.is-icon {
340
+ border-radius: 1rem;
341
+ .thumbnail {
342
+ width: 24px;
343
+ height: 24px;
344
+ }
345
+ }
346
+ ${MediaQueries.mbDown} {
347
+ display: flex;
348
+ }
349
+ }
350
+ }
351
+ }
352
+ }
353
+ `;
354
+
355
+ const StyledPopupFrame = styled.div `
356
+ [data-type='confirm'] {
357
+ max-width: 468px;
358
+ /* height: 486px; */
359
+ padding: 0;
360
+
361
+ .popup-content {
362
+ display: flex;
363
+ flex-direction: column;
364
+ padding: 0;
365
+
366
+ .close-button {
367
+ top: 16px;
368
+ right: 16px;
369
+ width: 24px;
370
+ height: 24px;
371
+ z-index: 5;
372
+ }
373
+
374
+ .header {
375
+ display: flex;
376
+ height: 56px;
377
+ align-items: center;
378
+ padding: 16px 56px 16px 32px;
379
+ border-bottom: 1px solid ${theme.colors.neutral100};
380
+ font-weight: 900;
381
+ width: 100%;
382
+ justify-content: space-between;
383
+ }
384
+
385
+ .content {
386
+ overflow: auto;
387
+ flex: 1;
388
+ .topic-list-wrapper {
389
+ padding: 1rem;
390
+ }
391
+ }
392
+ }
393
+ }
394
+
395
+ > div&[data-open='true'] {
396
+ z-index: 250;
397
+ &:last-child {
398
+ z-index: 200;
399
+ }
400
+ }
401
+
402
+ ${(props) => props.isExpand &&
403
+ `
404
+ & > div[data-open] {
405
+ width: 100%;
406
+ height: 100%;
407
+ max-width: none;
408
+ max-height: none;
409
+ }
410
+ `}
411
+
412
+ ${(props) => props.hasFullscreen &&
413
+ `
414
+ & > div[data-open] {
415
+ transition: all 0.5s ease-in-out, width 0s, height 0s;
416
+ }
417
+ `}
418
+ `;
419
+ const StyledFSBtn = styled.div `
420
+ cursor: pointer;
421
+ display: flex;
422
+ align-items: center;
423
+ `;
424
+
425
+ const PopupFrame = ({ className, style, closeIcon, heading = '', children, isOpen = false, hasFullscreen = false, onClose = () => null, }) => {
426
+ const [expand, setExpand] = useState(false);
427
+ return (React__default.createElement(StyledPopupFrame, { className: className, style: style, isExpand: expand, hasFullscreen: hasFullscreen },
428
+ React__default.createElement(Popup, { type: "confirm", onClose: onClose, isOpen: isOpen, closeIcon: closeIcon || React__default.createElement("img", { src: CloseIcon, loading: "lazy" }), enableAnimation: !hasFullscreen },
429
+ React__default.createElement("div", { className: "header" },
430
+ React__default.createElement(Heading, { tag: "h5" }, heading),
431
+ hasFullscreen && (React__default.createElement(StyledFSBtn, { onClick: () => setExpand(!expand) },
432
+ React__default.createElement(FullScreen, { size: 14, isExpand: expand })))),
433
+ React__default.createElement("div", { className: "content" }, typeof children === 'function' ? children(expand) : children))));
434
+ };
435
+
436
+ const PopupDanger = ({ className, isMarryBaby: isMarryBabyProp, style, title, description, acceptText, cancelText, onAccept, onCancel, thumbnail, isThumbnailIcon, onClose, acceptBtnTracking, acceptBtnProps, cancelBtnProps, }) => {
437
+ const { data: { env: { isMarryBaby: isMarryBabyContext }, }, } = useContext(TogetherComponentGlobalContext);
438
+ const isMarryBaby = typeof isMarryBabyProp === 'boolean' ? isMarryBabyProp : isMarryBabyContext;
439
+ const [isOpen, setIsOpen] = useState(false);
440
+ useEffect(() => {
441
+ toggleNoScroll(true);
442
+ setTimeout(() => setIsOpen(true), 0);
443
+ return () => toggleNoScroll(false);
444
+ }, []);
445
+ if (typeof window === 'undefined')
446
+ return null;
447
+ return ReactDOM.createPortal(React__default.createElement(StyledPopupDanger, { "data-is-marrybaby": isMarryBaby, className: className, style: style, "data-open": isOpen },
448
+ React__default.createElement(PopupFrame, { className: "popup-frame", isOpen: isOpen, onClose: onClose },
449
+ React__default.createElement("div", { className: "confirm-dialog", onClick: (e) => e.stopPropagation() },
450
+ React__default.createElement("div", { className: "confirm-content" },
451
+ thumbnail && (React__default.createElement("div", { className: `thumbnail-container ${isThumbnailIcon ? 'is-icon' : ''}` },
452
+ React__default.createElement("img", { className: "thumbnail", src: thumbnail, loading: "lazy" }))),
453
+ React__default.createElement(Heading, { className: "title", tag: "h2" }, title),
454
+ React__default.createElement(Text, { className: "desc", size: "lg" }, description),
455
+ React__default.createElement("div", { className: "btn-group" },
456
+ React__default.createElement(Button, Object.assign({ theme: isMarryBaby ? 'marryBaby' : 'helloSites', size: "md", color: "tertiary", onClick: () => {
457
+ onAccept === null || onAccept === void 0 ? void 0 : onAccept();
458
+ onClose === null || onClose === void 0 ? void 0 : onClose();
459
+ } }, acceptBtnProps, acceptBtnTracking), acceptText),
460
+ React__default.createElement(Button, Object.assign({ theme: isMarryBaby ? 'marryBaby' : 'helloSites', size: "md", onClick: () => {
461
+ onCancel === null || onCancel === void 0 ? void 0 : onCancel();
462
+ onClose === null || onClose === void 0 ? void 0 : onClose();
463
+ } }, cancelBtnProps), cancelText)))),
464
+ isMarryBaby && thumbnail && (React__default.createElement("div", { className: `thumbnail-container is-mobile ${isThumbnailIcon ? 'is-icon' : ''}` },
465
+ React__default.createElement("img", { className: "thumbnail", src: thumbnail, loading: "lazy" }))))), getPopupWrapperDom());
466
+ };
467
+
468
+ const StyledInputCommentBar = styled.div `
469
+ padding: 1rem;
470
+ border-top: 1px solid #f2f2f2;
471
+ &[data-is-reply='true'] {
472
+ padding-right: 0;
473
+ padding-left: 0;
474
+ border-top: 1px solid #e4e8ec;
475
+ margin-right: 1rem;
476
+ margin-left: 1rem;
477
+ }
478
+ .error-text {
479
+ padding: 1rem;
480
+ color: ${theme.colors.red700};
481
+ }
482
+ .reply-to-container {
483
+ display: flex;
484
+ justify-content: space-between;
485
+ padding-bottom: 0.75rem;
486
+ margin-top: -0.25rem;
487
+ .icon-close-comment {
488
+ width: 16px;
489
+ height: 16px;
490
+ cursor: pointer;
491
+ }
492
+ a {
493
+ text-decoration: none;
494
+ }
495
+ }
496
+ .input-container {
497
+ display: flex;
498
+ align-items: center;
499
+ .avatar-wrapper {
500
+ display: flex;
501
+ flex-shrink: 0;
502
+ align-items: center;
503
+ margin-right: 0.5rem;
504
+ &.avatar-wrapper-reply {
505
+ width: 32px;
506
+ height: 32px;
507
+ .avatar {
508
+ width: 32px;
509
+ height: 32px;
510
+ }
511
+ }
512
+ }
513
+ .input-wrapper {
514
+ margin-right: 0.5rem;
515
+ &[data-has-error] {
516
+ .as-input {
517
+ border-color: ${theme.colors.red700};
518
+ }
519
+ }
520
+
521
+ .as-input {
522
+ .textarea {
523
+ width: 100%;
524
+ max-height: 225px;
525
+ min-height: 75px;
526
+ .ql-toolbar {
527
+ padding: 0;
528
+ }
529
+ .ql-editor {
530
+ padding-left: 0;
531
+ padding-right: 0;
532
+ }
533
+ .quill {
534
+ height: 0;
535
+ }
536
+ }
537
+ width: 100%;
538
+ padding: 12px 16px;
539
+ border: solid 1px ${theme.colors.gray200};
540
+ border-radius: ${theme.borderRadius};
541
+
542
+ &:active,
543
+ &:focus {
544
+ border-color: ${theme.colors.primaryBase};
545
+ box-shadow: 0px 0px 2px 2px ${theme.colors.primary200};
546
+ }
547
+
548
+ &:disabled {
549
+ background-color: ${theme.colors.gray100};
550
+ cursor: not-allowed;
551
+ }
552
+
553
+ span {
554
+ &[data-error='true'] {
555
+ color: red;
556
+ text-decoration: underline;
557
+ }
558
+ }
559
+ }
560
+
561
+ &[data-has-action-icon] {
562
+ .as-input {
563
+ padding: 12px 48px 12px 16px;
564
+ }
565
+ }
566
+ &[data-has-display-icon] {
567
+ .as-input {
568
+ padding: 12px 16px 12px 48px;
569
+ }
570
+ }
571
+
572
+ &[data-has-action-icon][data-has-display-icon] {
573
+ .as-input {
574
+ padding: 12px 48px;
575
+ }
576
+ }
577
+
578
+ &[data-size='lg'] {
579
+ .as-input {
580
+ font-size: 16px;
581
+ font-weight: ${theme.sizes.fwRegular};
582
+ ${MediaQueries.mbDown} {
583
+ font-size: 22px;
584
+ line-height: 1.2;
585
+ }
586
+
587
+ ${MediaQueries.mbUp} {
588
+ font-size: 26px;
589
+ line-height: 1.2;
590
+ }
591
+ }
592
+ }
593
+ &[data-size='md'] {
594
+ .as-input {
595
+ font-weight: ${theme.sizes.fwRegular};
596
+ line-height: 22px;
597
+ ${MediaQueries.mbDown} {
598
+ font-size: 14px;
599
+ line-height: 1.2;
600
+ }
601
+
602
+ ${MediaQueries.mbUp} {
603
+ font-size: 16px;
604
+ line-height: 1.2;
605
+ }
606
+ }
607
+ }
608
+ &[data-size='sm'] {
609
+ .as-input {
610
+ font-weight: ${theme.sizes.fwRegular};
611
+ line-height: 20px;
612
+ ${MediaQueries.mbDown} {
613
+ font-size: 13px;
614
+ line-height: 1.5;
615
+ }
616
+
617
+ ${MediaQueries.mbUp} {
618
+ font-size: 13px;
619
+ line-height: 1.5;
620
+ }
621
+ }
622
+ }
623
+ }
624
+ .images-input-label {
625
+ height: 100%;
626
+ cursor: pointer;
627
+ .icon-images-input {
628
+ width: 24px;
629
+ height: 24px;
630
+ vertical-align: middle;
631
+ }
632
+ }
633
+ .send-button {
634
+ display: flex;
635
+ width: 40px;
636
+ height: 40px;
637
+ flex-shrink: 0;
638
+ align-items: center;
639
+ justify-content: center;
640
+ padding: 0;
641
+ border: none;
642
+ &.send-button-post {
643
+ background: ${theme.colors.neutral100};
644
+ border-radius: 50%;
645
+ }
646
+ .icon-enter {
647
+ width: 20px;
648
+ height: 20px;
649
+ vertical-align: middle;
650
+ }
651
+ &[data-is-loading='true'] {
652
+ > div {
653
+ display: flex;
654
+ align-items: center;
655
+ justify-content: center;
656
+ }
657
+ }
658
+ }
659
+ }
660
+ .preview-images-container {
661
+ margin-top: 1rem;
662
+ .image-src-wrapper {
663
+ position: relative;
664
+ width: 100%;
665
+ padding-top: 66.67%;
666
+ &:not(:last-child) {
667
+ margin-bottom: 1rem;
668
+ }
669
+ .preview-image {
670
+ position: absolute;
671
+ top: 0;
672
+ left: 0;
673
+ width: 100%;
674
+ height: 100%;
675
+ object-fit: cover;
676
+ }
677
+ .icon-close-circle {
678
+ position: absolute;
679
+ top: 10px;
680
+ right: 10px;
681
+ width: 20px;
682
+ height: 20px;
683
+ cursor: pointer;
684
+ }
685
+ }
686
+ }
687
+ `;
688
+
689
+ const MainInputTriggerContext = createContext({});
690
+
691
+ var img$3 = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='17' fill='none'%3e%3ccircle cx='8' cy='8.5' r='6.667' fill='white' stroke='%23404040'/%3e%3cpath stroke='%23404040' stroke-linecap='round' stroke-linejoin='round' d='m10 6.5-4 4M6 6.5l4 4'/%3e%3c/svg%3e";
692
+ var IconCloseCircleLine = img$3;
693
+
694
+ var img$2 = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='20' height='21' fill='none'%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m7.5 9.734-3.75 3.75 3.75 3.75'/%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M16.25 4.734v5.569c0 .843-.33 1.653-.915 2.25a3.1 3.1 0 0 1-2.21.931H3.75'/%3e%3c/svg%3e";
695
+ var IconEnter = img$2;
696
+
697
+ var img$1 = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3e%3cpath stroke='%232D87F3' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.75' d='M10.754 4.854H4.492a1.79 1.79 0 0 0-1.789 1.789v12.524a1.79 1.79 0 0 0 1.79 1.789h12.523a1.79 1.79 0 0 0 1.79-1.79v-6.261'/%3e%3cpath stroke='%232D87F3' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.75' d='M17.463 3.512a1.898 1.898 0 0 1 2.684 2.684l-8.498 8.498-3.579.895.895-3.579z'/%3e%3c/svg%3e";
698
+ var IconTabEditPrimary = img$1;
699
+
700
+ const getCommentFormBody = ({ postId, message, photos, link, locale, sanitizeFunction, replyingUserId, replyingUserName, replyingId, }) => __awaiter(void 0, void 0, void 0, function* () {
701
+ const formData = new FormData();
702
+ let submitText = encodePostContent(message.replace(/(\ )+/g, ' '), sanitizeFunction);
703
+ const mentionIds = getMentionIdsFromString(submitText);
704
+ if (photos && photos.length > 0) {
705
+ const imageSrcs = yield Promise.all(photos === null || photos === void 0 ? void 0 : photos.map((file) => uploadAndGetSrc(file, locale)));
706
+ imageSrcs
707
+ .filter(Boolean)
708
+ .slice(0, MAX_IMAGE_UPLOADS)
709
+ .forEach((photo) => {
710
+ formData.append('images[]', photo);
711
+ });
712
+ }
713
+ if (link)
714
+ formData.append('link', link);
715
+ mentionIds === null || mentionIds === void 0 ? void 0 : mentionIds.forEach((mentionId) => {
716
+ formData.append(`mention_ids[]`, mentionId);
717
+ });
718
+ formData.append('post_id', postId);
719
+ replyingId && formData.append('parent_id', replyingId);
720
+ if (replyingUserId) {
721
+ mentionIds.unshift(replyingUserId);
722
+ submitText = `[mention+id="${replyingUserId}"+name="${(replyingUserName || '').replace('"', "'")}"]${submitText}`;
723
+ formData.append('parent_user_id', String(replyingUserId));
724
+ }
725
+ formData.append('content', submitText);
726
+ formData.append('content', submitText);
727
+ return formData;
728
+ });
729
+ const submitComment = (formData, locale) => __awaiter(void 0, void 0, void 0, function* () {
730
+ return callApiWithAuth(getApiPath(PATHS.COMMENT.CREATE, {
731
+ _locale: locale,
732
+ }), 'POST', {
733
+ data: formData,
734
+ });
735
+ });
736
+ const decodeCommentBody = (s) => {
737
+ try {
738
+ const authorRegex = s.match(/\[@([^\]]+)\]/);
739
+ const replyingTo = authorRegex
740
+ ? authorRegex[0].replace('[@', '').replace(']', '')
741
+ : '';
742
+ const text = s.replace(/\[@([^\]]+)\]/, '');
743
+ return {
744
+ text: text.trim(),
745
+ replyingTo,
746
+ };
747
+ }
748
+ catch (e) { }
749
+ return {
750
+ text: '',
751
+ };
752
+ };
753
+ const submitReply = (formData, locale) => __awaiter(void 0, void 0, void 0, function* () {
754
+ return callApiWithAuth(getApiPath(PATHS.COMMENT.REPLY, {
755
+ _locale: locale,
756
+ }), 'POST', {
757
+ data: formData,
758
+ });
759
+ });
760
+ const likeUnlikeComment = ({ commentId, setLike = false, locale, }) => __awaiter(void 0, void 0, void 0, function* () {
761
+ return callApiWithAuth(getApiPath(setLike ? PATHS.COMMENT.LIKE : PATHS.COMMENT.UNLIKE, {
762
+ _locale: locale,
763
+ id: commentId,
764
+ }), 'GET');
765
+ });
766
+ const deleteComment = ({ id, locale, }) => {
767
+ return callApiWithAuth(getApiPath(PATHS.COMMENT.DELETE, {
768
+ _locale: locale,
769
+ id: id,
770
+ }), 'DELETE');
771
+ };
772
+
773
+ const InputCommentBar = ({ isReply, className, onClose, replyToName, style, replyingId, replyingUser, onPostSuccess, post, isMarryBaby: isMarryBabyProp, }) => {
774
+ const { action: { pushNotifications, sanitizeFunction }, data: { userInfo, locale, env: { isMarryBaby: isMarryBabyContext }, }, } = useContext(TogetherComponentGlobalContext);
775
+ const isMarryBaby = typeof isMarryBabyProp === 'boolean' ? isMarryBabyProp : isMarryBabyContext;
776
+ const { t } = useTranslations();
777
+ const { onSelectImages, onRemoveImage, imageSrcs, onRemoveAllImages, imageFiles, } = useImagePicker();
778
+ const [text, setText] = useState('');
779
+ const { trigger } = useContext(MainInputTriggerContext);
780
+ const [isSubmitLoading, setIsSubmitLoading] = useState(false);
781
+ const imagePicker = useRef(null);
782
+ const contentEditable = useRef(null);
783
+ const mainInput = useRef(null);
784
+ const [invalidUrls, setInvalidUrls] = useState([]);
785
+ const [bannedWords, setBannedWords] = useState([]);
786
+ const [previewUrl, setPreviewUrl] = useState(null);
787
+ const onSubmitComment = () => __awaiter(void 0, void 0, void 0, function* () {
788
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
789
+ if (!(post === null || post === void 0 ? void 0 : post.id) || isSubmitLoading)
790
+ return;
791
+ setIsSubmitLoading(true);
792
+ try {
793
+ const handleSuccess = (res) => {
794
+ setText('');
795
+ onRemoveAllImages();
796
+ onClose && onClose();
797
+ const newComment = formatComment(res.data);
798
+ if (typeof newComment.images === 'string') {
799
+ newComment.images = JSON.parse(newComment.images);
800
+ }
801
+ onPostSuccess && onPostSuccess(newComment);
802
+ };
803
+ const formBody = yield getCommentFormBody(Object.assign({ message: text, photos: imageFiles, postId: String(post.id), link: previewUrl === null || previewUrl === void 0 ? void 0 : previewUrl.url, sanitizeFunction,
804
+ locale }, (isReply && replyingId
805
+ ? {
806
+ replyingUserId: String((replyingUser === null || replyingUser === void 0 ? void 0 : replyingUser.id) || ((_a = post === null || post === void 0 ? void 0 : post.author) === null || _a === void 0 ? void 0 : _a.id) || ''),
807
+ replyingId,
808
+ replyingUserName: (replyingUser === null || replyingUser === void 0 ? void 0 : replyingUser.name) || (replyingUser === null || replyingUser === void 0 ? void 0 : replyingUser.username) || '',
809
+ }
810
+ : {})));
811
+ const res = yield (isReply && replyingId
812
+ ? submitReply(formBody, locale)
813
+ : submitComment(formBody, locale));
814
+ const resData = res === null || res === void 0 ? void 0 : res.data;
815
+ if ((resData === null || resData === void 0 ? void 0 : resData.id) && !((_c = (_b = res === null || res === void 0 ? void 0 : res.messages) === null || _b === void 0 ? void 0 : _b.moderation) === null || _c === void 0 ? void 0 : _c.type)) {
816
+ handleSuccess(res);
817
+ }
818
+ else {
819
+ if (((_e = (_d = res === null || res === void 0 ? void 0 : res.messages) === null || _d === void 0 ? void 0 : _d.moderation) === null || _e === void 0 ? void 0 : _e.type) === 'banned') {
820
+ pushNotifications({
821
+ title: t('notification.comment.blocked.title'),
822
+ message: t('notification.comment.blocked.message'),
823
+ type: 'danger',
824
+ });
825
+ if (res.messages.moderation.words) {
826
+ setBannedWords(res.messages.moderation.words);
827
+ }
828
+ }
829
+ else if (((_g = (_f = res === null || res === void 0 ? void 0 : res.messages) === null || _f === void 0 ? void 0 : _f.moderation) === null || _g === void 0 ? void 0 : _g.type) === 'suspect') {
830
+ pushNotifications({
831
+ title: t('notification.comment.suspect.title'),
832
+ message: t('notification.comment.suspect.message'),
833
+ type: 'warning',
834
+ });
835
+ setText('');
836
+ onRemoveAllImages();
837
+ onClose && onClose();
838
+ }
839
+ else if ((_h = res === null || res === void 0 ? void 0 : res.messages) === null || _h === void 0 ? void 0 : _h.find((m) => { var _a; return !!((_a = m === null || m === void 0 ? void 0 : m.includes) === null || _a === void 0 ? void 0 : _a.call(m, 'suspend')); })) {
840
+ pushNotifications({
841
+ message: t('notification.suspend.message'),
842
+ type: 'warning',
843
+ });
844
+ setText('');
845
+ onRemoveAllImages();
846
+ onClose && onClose();
847
+ }
848
+ else {
849
+ pushNotifications({
850
+ title: '',
851
+ message: ((_j = res === null || res === void 0 ? void 0 : res.messages) === null || _j === void 0 ? void 0 : _j[0]) || t('notification.comment.somethingWrong'),
852
+ type: 'danger',
853
+ });
854
+ }
855
+ }
856
+ }
857
+ catch (e) {
858
+ pushNotifications({
859
+ title: '',
860
+ message: t('notification.comment.somethingWrong'),
861
+ type: 'danger',
862
+ });
863
+ }
864
+ setIsSubmitLoading(false);
865
+ });
866
+ useEffect(() => {
867
+ var _a;
868
+ (_a = mainInput.current) === null || _a === void 0 ? void 0 : _a.scrollIntoView({
869
+ behavior: 'smooth',
870
+ block: 'start',
871
+ });
872
+ setTimeout(() => {
873
+ var _a;
874
+ (_a = contentEditable.current) === null || _a === void 0 ? void 0 : _a.focus();
875
+ }, 400);
876
+ }, [trigger]);
877
+ return (React__default.createElement(StyledInputCommentBar, { "data-is-reply": isReply, className: className, style: style },
878
+ isReply && (React__default.createElement("div", { className: "reply-to-container" },
879
+ React__default.createElement(Text, { size: "p4" },
880
+ React__default.createElement("span", { dangerouslySetInnerHTML: {
881
+ __html: t('inputComment.replyTo', {
882
+ name: `<span style="color: #2D87F3; cursor: pointer">@${replyToName || ''}</span>`,
883
+ }),
884
+ } })),
885
+ React__default.createElement("img", { src: IconCloseCircleLine, className: "icon-close-comment", onClick: () => onClose && onClose(), loading: "lazy" }))),
886
+ React__default.createElement("div", { className: "input-container", ref: mainInput },
887
+ React__default.createElement(UserAvatar, { className: `avatar-wrapper ${isReply ? 'avatar-wrapper-reply' : ''}`, avatar: (userInfo === null || userInfo === void 0 ? void 0 : userInfo.id) ? userInfo.avatar : DEFAULT_AVATAR_IMG, username: (userInfo === null || userInfo === void 0 ? void 0 : userInfo.name) || (userInfo === null || userInfo === void 0 ? void 0 : userInfo.username) }),
888
+ React__default.createElement("input", { ref: imagePicker, onChange: onSelectImages, type: "file", multiple: true, accept: "image/png,image/jpeg", name: "images", style: { display: 'none' } }),
889
+ React__default.createElement(Input
890
+ // actionIcon={
891
+ // !isPost ? (
892
+ // <label className="images-input-label">
893
+ // <img
894
+ // className="icon-images-input"
895
+ // src="./svg/icon-image-input.svg"
896
+ // />
897
+ // <input
898
+ // onChange={onSelectImages}
899
+ // type="file"
900
+ // multiple
901
+ // accept="image/png,image/jpeg"
902
+ // name="images"
903
+ // style={{ display: 'none' }}
904
+ // />
905
+ // </label>
906
+ // ) : undefined
907
+ // }
908
+ , {
909
+ // actionIcon={
910
+ // !isPost ? (
911
+ // <label className="images-input-label">
912
+ // <img
913
+ // className="icon-images-input"
914
+ // src="./svg/icon-image-input.svg"
915
+ // />
916
+ // <input
917
+ // onChange={onSelectImages}
918
+ // type="file"
919
+ // multiple
920
+ // accept="image/png,image/jpeg"
921
+ // name="images"
922
+ // style={{ display: 'none' }}
923
+ // />
924
+ // </label>
925
+ // ) : undefined
926
+ // }
927
+ value: text, name: "input", size: "md", className: "input-wrapper", displayIcon: React__default.createElement("img", { src: IconTabEditPrimary, loading: "lazy" }), CustomInput: React__default.createElement("div", { className: "as-input" },
928
+ React__default.createElement(RichTextEditor, { className: "textarea", html: text, onChange: setText, onImagePickerClick: () => { var _a; return (_a = imagePicker.current) === null || _a === void 0 ? void 0 : _a.click(); }, bannedWords: bannedWords, onPreviewUrlChange: setPreviewUrl, onInvalidUrlsChange: setInvalidUrls, setEditorRef: (div) => (contentEditable.current = div), isReplying: isReply })) }),
929
+ React__default.createElement(Button, { theme: isMarryBaby ? 'marryBaby' : 'helloSites', className: "send-button", size: "sm", onClick: onSubmitComment, isLoading: isSubmitLoading, isDisabled: !!(invalidUrls === null || invalidUrls === void 0 ? void 0 : invalidUrls.length) ||
930
+ isSubmitLoading ||
931
+ !text ||
932
+ (text === null || text === void 0 ? void 0 : text.length) < 2 ||
933
+ !text.trim() },
934
+ React__default.createElement("img", { src: IconEnter, className: "icon-enter", loading: "lazy" }))),
935
+ !!(invalidUrls === null || invalidUrls === void 0 ? void 0 : invalidUrls.length) ? (React__default.createElement("div", { className: "error-text" }, t('notification.limitUrlDomain'))) : null,
936
+ (!imageSrcs || imageSrcs.length === 0) && previewUrl && (React__default.createElement("div", { className: "link-preview-wrapper" }, previewUrl.isFetching ? (React__default.createElement(Loading, null)) : (React__default.createElement(React__default.Fragment, null,
937
+ React__default.createElement(CardLink, { title: previewUrl.title, url: previewUrl.url || '#', image: previewUrl.image, noRefetch: true }),
938
+ React__default.createElement("img", { src: IconCloseCircle, className: "icon-close", onClick: () => setPreviewUrl(null), loading: "lazy" }))))),
939
+ imageSrcs && imageSrcs.length > 0 && (React__default.createElement("div", { className: "preview-images-container" }, imageSrcs.map((src, index) => (React__default.createElement("div", { key: index, className: "image-src-wrapper" },
940
+ React__default.createElement("img", { className: "preview-image", src: src, loading: "lazy" }),
941
+ React__default.createElement("img", { src: IconCloseCircle, className: "icon-close-circle", onClick: () => onRemoveImage(index), loading: "lazy" }))))))));
942
+ };
943
+
944
+ const SharePopup = ({ trackingCategory, className, style, url, avatar, text, onClose, }) => {
945
+ const { data: { env: { isMarryBaby }, }, } = useContext(TogetherComponentGlobalContext);
946
+ const { t } = useTranslations();
947
+ const [isOpen, setIsOpen] = useState(false);
948
+ useEffect(() => {
949
+ toggleNoScroll(true);
950
+ setTimeout(() => setIsOpen(true), 0);
951
+ return () => toggleNoScroll(false);
952
+ }, []);
953
+ return (React__default.createElement(Portal, null,
954
+ React__default.createElement(StyledSharePopup, { "data-is-marrybaby": isMarryBaby, className: className, style: style },
955
+ React__default.createElement(PopupFrame, { className: "share-popup", isOpen: isOpen, onClose: onClose, heading: t('bottomBar.share') },
956
+ isMarryBaby ? (React__default.createElement(Text, { className: "share-mb-text", size: "sm" }, t('article.shareOn'))) : (React__default.createElement("div", { className: "custom-share__header" },
957
+ avatar && (React__default.createElement("div", { className: "custom-share__header-image" },
958
+ React__default.createElement("img", { src: avatar, loading: "lazy" }))),
959
+ React__default.createElement("div", { className: "custom-share__header-info" },
960
+ React__default.createElement(Heading, { tag: "h4" }, text),
961
+ React__default.createElement(Text, { className: "desc", size: "md" }, url)))),
962
+ isOpen && (React__default.createElement(ShareBox, { trackingCategory: trackingCategory, shareUrl: url ||
963
+ (typeof window !== 'undefined' ? window.location.href : ''), title: text }))))));
964
+ };
965
+ const StyledSharePopup = styled.div `
966
+ .share-popup {
967
+ > div:first-child {
968
+ height: unset;
969
+ }
970
+ .close-button {
971
+ display: none;
972
+ }
973
+ .popup-content .header {
974
+ display: none;
975
+ }
976
+ }
977
+ .custom-share__header {
978
+ display: flex;
979
+ flex-wrap: no-wrap;
980
+ align-items: center;
981
+ padding: 1rem;
982
+ border-bottom: 1px solid ${theme.colors.neutral100};
983
+ margin-bottom: 16px;
984
+
985
+ .custom-share__header-image {
986
+ width: 38px;
987
+ height: 38px;
988
+ flex-shrink: 0;
989
+ & > img {
990
+ width: 100%;
991
+ height: 100%;
992
+ object-fit: cover;
993
+ object-position: center;
994
+ }
995
+ }
996
+
997
+ .custom-share__header-info {
998
+ flex: 1;
999
+ padding: 0 8px;
1000
+ word-break: break-word;
1001
+
1002
+ [data-tag='h4'] {
1003
+ margin-bottom: 8px;
1004
+ font-size: 14px;
1005
+ font-weight: bold;
1006
+ line-height: 14px;
1007
+ }
1008
+
1009
+ [data-size='md'] {
1010
+ color: #a5a5a5;
1011
+ font-size: 14px;
1012
+ line-height: 14px;
1013
+ }
1014
+ }
1015
+ }
1016
+
1017
+ &[data-is-marrybaby='true'] {
1018
+ .share-popup {
1019
+ > div:first-child {
1020
+ overflow: hidden;
1021
+ border-radius: 1rem;
1022
+ &[data-open='true'] {
1023
+ ${MediaQueries.mbDown} {
1024
+ max-width: unset;
1025
+ width: 100%;
1026
+ top: 100%;
1027
+ transform: translate(-50%, -100%);
1028
+ border-bottom-left-radius: 0;
1029
+ border-bottom-right-radius: 0;
1030
+ }
1031
+ }
1032
+ }
1033
+ .close-button {
1034
+ display: block;
1035
+ }
1036
+ .popup-content {
1037
+ .header {
1038
+ display: block;
1039
+ padding: 1rem;
1040
+ background-color: rgb(243, 243, 243);
1041
+ }
1042
+ .content {
1043
+ padding-bottom: 1rem;
1044
+ }
1045
+ }
1046
+ .share-mb-text {
1047
+ margin: 1rem 1rem 0.5rem;
1048
+ }
1049
+ }
1050
+ }
1051
+ `;
1052
+
1053
+ const StyledSubmitReportForm = styled.div `
1054
+ padding: 0 8px;
1055
+ margin-top: 18px;
1056
+
1057
+ .report-list {
1058
+ margin-bottom: 18px;
1059
+
1060
+ .report-item {
1061
+ display: flex;
1062
+ align-items: center;
1063
+ margin-bottom: 10px;
1064
+ font-weight: 600;
1065
+
1066
+ & > img {
1067
+ width: 12px;
1068
+ height: 12px;
1069
+ margin-right: 8px;
1070
+ }
1071
+
1072
+ .__label {
1073
+ font-size: 14px;
1074
+ }
1075
+ }
1076
+ }
1077
+
1078
+ .report-submit {
1079
+ width: 100%;
1080
+ }
1081
+ &[data-is-marrybaby='true'] {
1082
+ padding: 0 1rem 1rem;
1083
+ }
1084
+ `;
1085
+
1086
+ var img = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3e%3cpath stroke='%23737373' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12M8 5v3M8 11h.007'/%3e%3c/svg%3e";
1087
+ var IconAlertCircle = img;
1088
+
1089
+ const SubmitReportForm = ({ className, style, reason, reasonText, onClose, postId, }) => {
1090
+ const { data: { locale, env: { isMarryBaby }, }, action: { pushNotifications }, } = useContext(TogetherComponentGlobalContext);
1091
+ const { t } = useTranslations();
1092
+ const [loading, setLoading] = useState(false);
1093
+ return (React__default.createElement(StyledSubmitReportForm, { "data-is-marrybaby": isMarryBaby, className: className, style: style },
1094
+ React__default.createElement("ul", { className: "report-list" },
1095
+ React__default.createElement("li", { className: "report-item" },
1096
+ React__default.createElement("img", { src: IconAlertCircle, loading: "lazy" }),
1097
+ React__default.createElement(Text, { className: "__label", color: theme.colors.gray800, size: "p4" }, reasonText))),
1098
+ React__default.createElement(Button, { theme: isMarryBaby ? 'marryBaby' : 'helloSites', className: "report-submit", size: "lg", color: "primary", isLoading: loading, onClick: () => __awaiter(void 0, void 0, void 0, function* () {
1099
+ if (!postId || loading)
1100
+ return;
1101
+ setLoading(true);
1102
+ try {
1103
+ const res = yield reportPost({
1104
+ id: postId,
1105
+ reason,
1106
+ locale,
1107
+ });
1108
+ if ((res === null || res === void 0 ? void 0 : res.status) === 1) {
1109
+ pushNotifications({
1110
+ message: 'Post reported',
1111
+ type: 'success',
1112
+ });
1113
+ onClose && onClose();
1114
+ }
1115
+ }
1116
+ catch (_a) { }
1117
+ setLoading(false);
1118
+ }) }, t('submit'))));
1119
+ };
1120
+
1121
+ const StyledSocialLinkPreview = styled.div `
1122
+ .link-info-container {
1123
+ padding: 0.5rem 1rem;
1124
+ background: ${(props) => props.color || '#f4faff'};
1125
+ }
1126
+ .link-image-wrapper {
1127
+ position: relative;
1128
+ overflow: hidden;
1129
+ width: 100%;
1130
+ padding-top: 56.25%;
1131
+ &.fetching {
1132
+ background: lightgray;
1133
+ }
1134
+ .loading-spinner {
1135
+ position: absolute;
1136
+ top: 50%;
1137
+ left: 50%;
1138
+ transform: translate(-50%, -50%);
1139
+ }
1140
+ .link-image {
1141
+ position: absolute;
1142
+ top: 0;
1143
+ left: 0;
1144
+ width: 100%;
1145
+ height: 100%;
1146
+ object-fit: cover;
1147
+ object-position: center;
1148
+ }
1149
+ }
1150
+ a {
1151
+ text-decoration: none;
1152
+ }
1153
+ &[data-is-marrybaby='true'] {
1154
+ overflow: hidden;
1155
+ border-radius: 1rem;
1156
+ }
1157
+ `;
1158
+
1159
+ const SocialLinkPreview = ({ url, image, className, style, baseUrl = '', autoPlay = true, }) => {
1160
+ const { data: { locale }, } = useContext(TogetherComponentGlobalContext);
1161
+ const [previewData, setPreviewData] = useState(null);
1162
+ useEffect(() => {
1163
+ (() => __awaiter(void 0, void 0, void 0, function* () {
1164
+ if (image)
1165
+ return;
1166
+ if (!url)
1167
+ return setPreviewData(null);
1168
+ setPreviewData((_data) => (Object.assign(Object.assign({}, _data), { isFetching: true })));
1169
+ // fetch('./api/fetch-meta?url=' + encodeURIComponent(url))
1170
+ // .then((res) => res.json())
1171
+ // .then((res) =>
1172
+ // setPreviewData({
1173
+ // url,
1174
+ // image: res?.image || res?.logo,
1175
+ // }),
1176
+ // )
1177
+ callApi(getApiPath(PATHS.FETCH_PREVIEW, {
1178
+ _locale: locale,
1179
+ }, undefined, baseUrl), 'POST', {
1180
+ data: {
1181
+ link: url,
1182
+ },
1183
+ headers: {
1184
+ 'Content-Type': 'application/json',
1185
+ },
1186
+ }, !!baseUrl)
1187
+ .then((res) => {
1188
+ var _a, _b;
1189
+ setPreviewData({
1190
+ url,
1191
+ image: ((_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.image) || ((_b = res === null || res === void 0 ? void 0 : res.data) === null || _b === void 0 ? void 0 : _b.logo),
1192
+ });
1193
+ })
1194
+ .catch(() => {
1195
+ setPreviewData(null);
1196
+ });
1197
+ }))();
1198
+ }, [url, image]);
1199
+ const displayImage = image || (previewData === null || previewData === void 0 ? void 0 : previewData.image);
1200
+ const displayUrl = (previewData === null || previewData === void 0 ? void 0 : previewData.url) || url;
1201
+ const youtubeVidId = useMemo(() => {
1202
+ return youtubeVidIdGetter(displayUrl);
1203
+ }, [displayUrl]);
1204
+ const facebookVidId = useMemo(() => {
1205
+ return (displayUrl.includes('facebook.com') || displayUrl.includes('fb.watch'));
1206
+ }, [displayUrl]);
1207
+ const responsiveWidth = useRef(0);
1208
+ const responsiveHeight = useRef(0);
1209
+ const [forceRerenderFB, setForceRerenderFB] = useState(false);
1210
+ // FACEBOOK Video is not responsive for desktop browser
1211
+ // => hack: set size to same as container, if size change too large, re-render facebook iframe with new config
1212
+ useEffect(() => {
1213
+ const handleResize = () => {
1214
+ var _a;
1215
+ const containerRect = (_a = containerRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
1216
+ let toChangeSize = false;
1217
+ if (containerRect &&
1218
+ (!responsiveWidth.current ||
1219
+ Math.abs((responsiveWidth.current - containerRect.width) /
1220
+ (containerRect === null || containerRect === void 0 ? void 0 : containerRect.width)) > 0.2)) {
1221
+ responsiveWidth.current = Math.floor(containerRect.width);
1222
+ toChangeSize = true;
1223
+ }
1224
+ if (containerRect &&
1225
+ (!responsiveHeight.current ||
1226
+ Math.abs((responsiveHeight.current - containerRect.height) /
1227
+ (containerRect === null || containerRect === void 0 ? void 0 : containerRect.height)) > 0.2)) {
1228
+ responsiveHeight.current = Math.floor(containerRect.height);
1229
+ toChangeSize = true;
1230
+ }
1231
+ if (toChangeSize) {
1232
+ setForceRerenderFB((v) => !v);
1233
+ }
1234
+ };
1235
+ handleResize();
1236
+ window.addEventListener('resize', handleResize, {
1237
+ passive: true,
1238
+ });
1239
+ return () => {
1240
+ window.removeEventListener('resize', handleResize);
1241
+ };
1242
+ }, []);
1243
+ const containerRef = useRef(null);
1244
+ const _theme = useMantineTheme();
1245
+ return (React__default.createElement(StyledSocialLinkPreview, { className: `${className} no-replace-click`, style: style, ref: containerRef, color: _theme.colors[_theme.primaryColor][0] }, !image && (youtubeVidId || facebookVidId) ? (React__default.createElement("div", { className: "link-image-wrapper" }, youtubeVidId ? (React__default.createElement("iframe", { width: "100%", height: "100%", src: `https://www.youtube.com/embed/${youtubeVidId}?&autoplay=${autoPlay ? 1 : 0}&mute=1&enablejsapi=1`, frameBorder: "0", allowFullScreen: true, style: {
1246
+ position: 'absolute',
1247
+ top: 0,
1248
+ left: 0,
1249
+ border: 'none',
1250
+ overflow: 'hidden',
1251
+ }, loading: "lazy" })) : facebookVidId ? (React__default.createElement("iframe", { key: String(forceRerenderFB), src: `https://www.facebook.com/plugins/video.php?href=${encodeURIComponent(displayUrl)}&autoplay=${autoPlay ? 1 : 0}&show_text=false&t=0&width=${responsiveWidth.current}&height=${responsiveHeight.current}`, style: {
1252
+ position: 'absolute',
1253
+ top: '50%',
1254
+ left: '50%',
1255
+ border: 'none',
1256
+ overflow: 'hidden',
1257
+ height: responsiveHeight.current,
1258
+ width: responsiveWidth.current,
1259
+ transform: 'translate(-50%, -50%)',
1260
+ }, scrolling: "no", frameBorder: "0", allowFullScreen: true, allow: "autoplay; clipboard-write; encrypted-media; picture-in-picture; web-share", loading: "lazy" })) : null)) : (React__default.createElement("a", { href: displayUrl, target: "_blank", rel: "noreferrer" },
1261
+ React__default.createElement("div", { className: `link-image-wrapper ${(previewData === null || previewData === void 0 ? void 0 : previewData.isFetching) ? 'fetching' : ''}` }, (previewData === null || previewData === void 0 ? void 0 : previewData.isFetching) ? (React__default.createElement(Loading, { className: "loading-spinner" })) : (React__default.createElement(ImageWrap, { className: "link-image", src: displayImage || DEFAULT_IMG, backupSrc: DEFAULT_IMG, alt: displayUrl })))))));
1262
+ };
1263
+
1264
+ export { InputCommentBar as I, PopupDanger as P, SharePopup as S, PopupFrame as a, SubmitReportForm as b, SocialLinkPreview as c, IconCloseCircle as d, getPostFormData as e, editPost as f, getDefaultFailNoti as g, createPost as h, deletePost as i, IconAlertCircle as j, deleteComment as k, decodeCommentBody as l, likeUnlikeComment as m, likeUnlikePost as n, useImagePicker as u };