@meduza/ui-kit-2 0.3.1 → 0.4.1

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 (188) hide show
  1. package/dist/AnnouncementInText/AnnouncementInText.types.d.ts +4 -4
  2. package/dist/AnnouncementInText/index.d.ts +3 -3
  3. package/dist/BookmarkButton/BookmarkButton.types.d.ts +6 -6
  4. package/dist/BookmarkButton/index.d.ts +3 -3
  5. package/dist/Button/Button.d.ts +3 -3
  6. package/dist/Button/Button.types.d.ts +16 -16
  7. package/dist/Button/ButtonLoader.d.ts +2 -2
  8. package/dist/Button/index.d.ts +2 -2
  9. package/dist/CardTitle/CardTitle.types.d.ts +10 -10
  10. package/dist/CardTitle/index.d.ts +3 -3
  11. package/dist/ChapterBlock/ChapterBlock.types.d.ts +7 -7
  12. package/dist/ChapterBlock/index.d.ts +3 -3
  13. package/dist/Cover/Cover.types.d.ts +24 -24
  14. package/dist/Cover/index.d.ts +3 -3
  15. package/dist/DocumentItemsCount/DocumentItemsCount.types.d.ts +6 -7
  16. package/dist/DocumentItemsCount/index.d.ts +3 -3
  17. package/dist/DonatesTeaser/DonatesTeaser.types.d.ts +4 -4
  18. package/dist/DonatesTeaser/index.d.ts +3 -3
  19. package/dist/DotsOnImage/DotsOnImage.types.d.ts +46 -46
  20. package/dist/DotsOnImage/index.d.ts +3 -3
  21. package/dist/Dropdown/Dropdown.types.d.ts +5 -6
  22. package/dist/Dropdown/index.d.ts +4 -4
  23. package/dist/EmbedBlock/EmbedBlock.d.ts +3 -3
  24. package/dist/EmbedBlock/EmbedBlock.types.d.ts +12 -11
  25. package/dist/EmbedBlock/EmbedGif.d.ts +3 -3
  26. package/dist/EmbedBlock/IframeBlock.d.ts +3 -3
  27. package/dist/EmbedBlock/index.d.ts +3 -3
  28. package/dist/Footnote/Footnote.types.d.ts +5 -5
  29. package/dist/Footnote/index.d.ts +3 -3
  30. package/dist/GroupedBlock/GroupedBlock.types.d.ts +4 -4
  31. package/dist/GroupedBlock/index.d.ts +3 -3
  32. package/dist/HalfBlock/HalfBlock.types.d.ts +4 -4
  33. package/dist/HalfBlock/index.d.ts +3 -3
  34. package/dist/Image/Image.types.d.ts +35 -35
  35. package/dist/Image/RenderPicture.d.ts +4 -4
  36. package/dist/Image/index.d.ts +3 -3
  37. package/dist/ImportantLead/ImportantLead.types.d.ts +4 -4
  38. package/dist/ImportantLead/index.d.ts +3 -3
  39. package/dist/Lazy/Lazy.types.d.ts +4 -5
  40. package/dist/Lazy/index.d.ts +3 -3
  41. package/dist/ListBlock/ListBlock.types.d.ts +9 -10
  42. package/dist/ListBlock/index.d.ts +3 -3
  43. package/dist/MaterialNote/MaterialNote.types.d.ts +13 -13
  44. package/dist/MaterialNote/index.d.ts +3 -3
  45. package/dist/MaterialTitle/MaterialTitle.types.d.ts +4 -4
  46. package/dist/MaterialTitle/index.d.ts +5 -5
  47. package/dist/MediaCaption/MediaCaption.types.d.ts +5 -5
  48. package/dist/MediaCaption/index.d.ts +3 -3
  49. package/dist/Meta/Meta.types.d.ts +19 -19
  50. package/dist/Meta/MetaContainer.d.ts +3 -3
  51. package/dist/Meta/index.d.ts +3 -3
  52. package/dist/MetaItem/MetaItem.types.d.ts +7 -7
  53. package/dist/MetaItem/index.d.ts +3 -3
  54. package/dist/MetaItemLive/MetaItemLive.types.d.ts +3 -3
  55. package/dist/MetaItemLive/index.d.ts +3 -3
  56. package/dist/Popover/Popover.types.d.ts +5 -5
  57. package/dist/Popover/index.d.ts +3 -3
  58. package/dist/QuoteBlock/QuoteBlock.types.d.ts +6 -6
  59. package/dist/QuoteBlock/index.d.ts +3 -3
  60. package/dist/RawHtmlBlock/RawHtmlBlock.types.d.ts +17 -17
  61. package/dist/RawHtmlBlock/index.d.ts +3 -3
  62. package/dist/RelatedBlock/RelatedBlock.types.d.ts +17 -17
  63. package/dist/RelatedBlock/index.d.ts +3 -3
  64. package/dist/RelatedRichBlock/RelatedRichBlock.types.d.ts +4 -4
  65. package/dist/RelatedRichBlock/index.d.ts +3 -3
  66. package/dist/RenderBlocks/RenderBlocks.types.d.ts +11 -11
  67. package/dist/RenderBlocks/index.d.ts +3 -3
  68. package/dist/RichTitle/RichTitle.types.d.ts +12 -13
  69. package/dist/RichTitle/index.d.ts +3 -3
  70. package/dist/SensitiveBlock/SensitiveBlock.types.d.ts +15 -15
  71. package/dist/SensitiveBlock/index.d.ts +3 -3
  72. package/dist/ShopRelatedBlock/ShopRelatedBlock.types.d.ts +4 -4
  73. package/dist/ShopRelatedBlock/index.d.ts +3 -3
  74. package/dist/SimpleBlock/SimpleBlock.types.d.ts +4 -4
  75. package/dist/SimpleBlock/index.d.ts +3 -3
  76. package/dist/SimpleTitle/SimpleTitle.types.d.ts +9 -9
  77. package/dist/SimpleTitle/index.d.ts +3 -3
  78. package/dist/SourceBlock/SourceBlock.types.d.ts +15 -15
  79. package/dist/SourceBlock/index.d.ts +3 -3
  80. package/dist/Spoiler/Spoiler.types.d.ts +4 -4
  81. package/dist/Spoiler/index.d.ts +3 -3
  82. package/dist/SvgSymbol/SvgSymbol.types.d.ts +8 -8
  83. package/dist/SvgSymbol/icons.d.ts +167 -167
  84. package/dist/SvgSymbol/index.d.ts +3 -3
  85. package/dist/Switcher/Switcher.types.d.ts +12 -12
  86. package/dist/Switcher/index.d.ts +3 -3
  87. package/dist/Table/Table.types.d.ts +25 -25
  88. package/dist/Table/index.d.ts +3 -3
  89. package/dist/Tag/Tag.types.d.ts +12 -12
  90. package/dist/Tag/index.d.ts +3 -3
  91. package/dist/Timestamp/Timestamp.types.d.ts +5 -5
  92. package/dist/Timestamp/index.d.ts +4 -4
  93. package/dist/Toolbar/Toolbar.d.ts +3 -3
  94. package/dist/Toolbar/Toolbar.types.d.ts +7 -8
  95. package/dist/Toolbar/ToolbarItem.d.ts +3 -3
  96. package/dist/Toolbar/index.d.ts +2 -2
  97. package/dist/ToolbarButton/ToolbarButton.types.d.ts +10 -10
  98. package/dist/ToolbarButton/index.d.ts +3 -3
  99. package/dist/Tooltip/Tooltip.d.ts +3 -3
  100. package/dist/Tooltip/Tooltip.types.d.ts +8 -8
  101. package/dist/Tooltip/TooltipFooter.d.ts +3 -3
  102. package/dist/Tooltip/index.d.ts +2 -2
  103. package/dist/constants.d.ts +41 -41
  104. package/dist/index.d.ts +45 -45
  105. package/dist/index.js +2 -2
  106. package/dist/types.d.ts +20 -20
  107. package/dist/ui-kit.css +3443 -3655
  108. package/dist/uikit.cjs.development.js +2706 -0
  109. package/dist/uikit.cjs.development.js.map +1 -0
  110. package/dist/uikit.cjs.production.min.js +2 -0
  111. package/dist/uikit.cjs.production.min.js.map +1 -0
  112. package/dist/uikit.esm.js +2652 -0
  113. package/dist/uikit.esm.js.map +1 -0
  114. package/dist/utils/BlockContext.d.ts +8 -8
  115. package/dist/utils/DangerousHtml.d.ts +8 -8
  116. package/dist/utils/capitalizeFirstLetter.d.ts +1 -1
  117. package/dist/utils/converCase.d.ts +2 -2
  118. package/dist/utils/generateGradient.d.ts +2 -2
  119. package/dist/utils/getElementPositionRelativeToViewport.d.ts +2 -2
  120. package/dist/utils/makeClassName.d.ts +3 -3
  121. package/dist/utils/makeStyleContext.d.ts +3 -3
  122. package/dist/utils/pluralize.d.ts +2 -2
  123. package/dist/utils/postMessage.d.ts +2 -2
  124. package/dist/utils/viewportSize.d.ts +6 -6
  125. package/package.json +68 -68
  126. package/src/BookmarkButton/BookmarkButton.css +4 -3
  127. package/src/BookmarkButton/BookmarkButton.module.css +4 -3
  128. package/src/Button/Button.module.css +29 -19
  129. package/src/Cover/Cover.module.css +15 -13
  130. package/src/EmbedBlock/EmbedBlock.types.ts +1 -0
  131. package/src/Toolbar/Toolbar.module.css +13 -12
  132. package/src/Toolbar/Toolbar.stories.tsx +1 -3
  133. package/src/ToolbarButton/ToolbarButton.module.css +8 -7
  134. package/src/ToolbarButton/ToolbarButton.stories.tsx +1 -3
  135. package/src/ToolbarButton/ToolbarButton.test.tsx +1 -3
  136. package/src/Tooltip/Tooltip.module.css +13 -6
  137. package/dist/AnnouncementInText/AnnouncementInText.stories.d.ts +0 -10
  138. package/dist/BookmarkButton/BookmarkButton.stories.d.ts +0 -10
  139. package/dist/Button/Button.stories.d.ts +0 -10
  140. package/dist/CardTitle/CardTitle.stories.d.ts +0 -10
  141. package/dist/ChapterBlock/ChapterBlock.stories.d.ts +0 -10
  142. package/dist/Cover/Cover.stories.d.ts +0 -10
  143. package/dist/DocumentItemsCount/DocumentItemsCount.stories.d.ts +0 -10
  144. package/dist/DonatesTeaser/DonatesTeaser.stories.d.ts +0 -10
  145. package/dist/DotsOnImage/DotsOnImage.stories.d.ts +0 -10
  146. package/dist/Dropdown/Dropdown.stories.d.ts +0 -10
  147. package/dist/EmbedBlock/EmbedBlock.stories.d.ts +0 -10
  148. package/dist/Footnote/Footnote.stories.d.ts +0 -10
  149. package/dist/GroupedBlock/GroupedBlock.stories.d.ts +0 -10
  150. package/dist/HalfBlock/HalfBlock.stories.d.ts +0 -10
  151. package/dist/Image/Image.stories.d.ts +0 -10
  152. package/dist/ImportantLead/ImportantLead.stories.d.ts +0 -10
  153. package/dist/Lazy/Lazy.stories.d.ts +0 -10
  154. package/dist/ListBlock/ListBlock.stories.d.ts +0 -11
  155. package/dist/MaterialNote/MaterialNote.stories.d.ts +0 -11
  156. package/dist/MaterialTitle/MaterialTitle.stories.d.ts +0 -10
  157. package/dist/MediaCaption/MediaCaption.stories.d.ts +0 -10
  158. package/dist/Meta/Meta.stories.d.ts +0 -10
  159. package/dist/MetaItem/MetaItem.stories.d.ts +0 -10
  160. package/dist/MetaItemLive/MetaItemLive.stories.d.ts +0 -10
  161. package/dist/Popover/Popover.stories.d.ts +0 -10
  162. package/dist/QuoteBlock/QuoteBlock.stories.d.ts +0 -10
  163. package/dist/RawHtmlBlock/RawHtmlBlock.stories.d.ts +0 -10
  164. package/dist/RelatedBlock/RelatedBlock.stories.d.ts +0 -10
  165. package/dist/RelatedRichBlock/RelatedRichBlock.stories.d.ts +0 -10
  166. package/dist/RenderBlocks/RenderBlocks.stories.d.ts +0 -10
  167. package/dist/RichTitle/RichTitle.stories.d.ts +0 -10
  168. package/dist/SensitiveBlock/SensitiveBlock.stories.d.ts +0 -10
  169. package/dist/ShopRelatedBlock/ShopRelatedBlock.stories.d.ts +0 -10
  170. package/dist/SimpleBlock/SimpleBlock.stories.d.ts +0 -10
  171. package/dist/SimpleTitle/SimpleTitle.stories.d.ts +0 -10
  172. package/dist/SourceBlock/SourceBlock.stories.d.ts +0 -10
  173. package/dist/Spoiler/Spoiler.stories.d.ts +0 -10
  174. package/dist/SvgSymbol/SvgSymbol.stories.d.ts +0 -10
  175. package/dist/Switcher/Switcher.stories.d.ts +0 -10
  176. package/dist/Table/Table.stories.d.ts +0 -10
  177. package/dist/Tag/Tag.stories.d.ts +0 -10
  178. package/dist/Timestamp/Timestamp.stories.d.ts +0 -10
  179. package/dist/Toolbar/Toolbar.stories.d.ts +0 -10
  180. package/dist/ToolbarButton/ToolbarButton.stories.d.ts +0 -10
  181. package/dist/Tooltip/Tooltip.stories.d.ts +0 -10
  182. package/dist/_storybook/PreviewWrapper/index.d.ts +0 -6
  183. package/dist/ui-kit-2.cjs.development.js +0 -2906
  184. package/dist/ui-kit-2.cjs.development.js.map +0 -1
  185. package/dist/ui-kit-2.cjs.production.min.js +0 -2
  186. package/dist/ui-kit-2.cjs.production.min.js.map +0 -1
  187. package/dist/ui-kit-2.esm.js +0 -2849
  188. package/dist/ui-kit-2.esm.js.map +0 -1
@@ -1,2849 +0,0 @@
1
- import React, { useState, useEffect, useContext, useRef, useCallback } from 'react';
2
- import { useInView } from 'react-intersection-observer';
3
- import dayjs from 'dayjs';
4
- import 'dayjs/locale/ru';
5
- import relativeTime from 'dayjs/plugin/relativeTime';
6
- import { Link } from 'react-router-dom';
7
-
8
- var makeClassName = function makeClassName(list) {
9
- return list.filter(function (_ref) {
10
- var active = _ref[1];
11
- return active;
12
- }).map(function (_ref2) {
13
- var className = _ref2[0];
14
- return className;
15
- }).join(' ');
16
- };
17
-
18
- var ButtonLoader = function ButtonLoader() {
19
- return React.createElement("svg", {
20
- width: "30px",
21
- height: "30px",
22
- viewBox: "0 0 30 30",
23
- xmlns: "http://www.w3.org/2000/svg"
24
- }, React.createElement("g", null, React.createElement("path", {
25
- d: "M15 0C6.716 0 0 6.716 0 15c0 8.284 6.716 15 15 15 8.284 0 15-6.716 15-15 0-8.284-6.716-15-15-15zm0 2c7.18 0 13 5.82 13 13s-5.82 13-13 13S2 22.18 2 15 7.82 2 15 2z",
26
- opacity: "0.3"
27
- })), React.createElement("g", {
28
- fillRule: "evenodd"
29
- }, React.createElement("animateTransform", {
30
- attributeName: "transform",
31
- type: "rotate",
32
- from: "0 15 15",
33
- to: "360 15 15",
34
- dur: "1000ms",
35
- repeatCount: "indefinite"
36
- }), React.createElement("path", {
37
- d: "M15 0c8.18 0 14.83 6.547 14.997 14.686L30 15h-2c0-7.077-5.655-12.833-12.693-12.996L15 2V0z"
38
- })));
39
- };
40
-
41
- var styles = {"root":"Button-module_root__RpsiW","gold":"Button-module_gold__ZMYg-","isLoading":"Button-module_isLoading__1g6QO","gray":"Button-module_gray__3IM54","sand":"Button-module_sand__2AqVq","dark":"Button-module_dark__I0uXx","light":"Button-module_light__1Y4hG","black":"Button-module_black__3sG3Y","red":"Button-module_red__3Niou","default":"Button-module_default__28Vo_","isInSpoiler":"Button-module_isInSpoiler__2Yl8c","ghost":"Button-module_ghost__3awCW","isInDropdown":"Button-module_isInDropdown__1ogKL","loader":"Button-module_loader__2pl6d","isFancy":"Button-module_isFancy__3FPVR"};
42
-
43
- var Button = function Button(_ref) {
44
- var _ref$theme = _ref.theme,
45
- theme = _ref$theme === void 0 ? 'gold' : _ref$theme,
46
- _ref$size = _ref.size,
47
- size = _ref$size === void 0 ? 'default' : _ref$size,
48
- _ref$state = _ref.state,
49
- state = _ref$state === void 0 ? 'isDefault' : _ref$state,
50
- _ref$styleContext = _ref.styleContext,
51
- styleContext = _ref$styleContext === void 0 ? 'isInToolbar' : _ref$styleContext,
52
- appearance = _ref.appearance,
53
- _ref$disabled = _ref.disabled,
54
- disabled = _ref$disabled === void 0 ? false : _ref$disabled,
55
- onClick = _ref.onClick,
56
- children = _ref.children;
57
-
58
- var handleClick = function handleClick() {
59
- if (disabled || !onClick) {
60
- return;
61
- }
62
-
63
- onClick();
64
- };
65
-
66
- return React.createElement("button", {
67
- "data-testid": "button",
68
- className: makeClassName([[styles.root, true], [styles[size], !!size], [styles[theme], !!theme], [styles[appearance], !!appearance], [styles[state], !!state && !!styles[state]], [styles[styleContext], !!styleContext]]),
69
- disabled: disabled,
70
- onClick: handleClick,
71
- type: "button"
72
- }, state === 'isLoading' ? React.createElement("span", {
73
- className: styles.loader
74
- }, React.createElement(ButtonLoader, null)) : children);
75
- };
76
-
77
- var icons = {
78
- meduzaLogo: {
79
- width: 544,
80
- height: 115,
81
- content: '<path d="M59.1008614,49.65632 L59.1008614,106.01472 L84.9480411,114.24 L84.9480411,49.65632 L101.574882,49.65632 L101.574882,106.01472 L127.270909,114.24 L144.048902,91.392 L127.422062,91.392 L127.422062,35.7952 L101.726035,26.80832 L84.9480411,46.60992 L84.9480411,35.7952 L59.2520145,26.80832 L42.4740206,46.60992 L42.4740206,35.7952 L16.7779939,26.80832 L0,49.65632 L16.6268408,49.65632 L16.6268408,106.01472 L42.4740206,114.24 L42.4740206,49.65632 L59.1008614,49.65632 L59.1008614,49.65632 Z M336.61795,91.392 L336.61795,35.0336 L310.770769,26.80832 L310.770769,105.25312 L336.466796,114.24 L353.24479,94.4384 L353.24479,105.25312 L378.940817,114.24 L395.71881,91.392 L379.091969,91.392 L379.091969,35.0336 L353.24479,26.80832 L353.24479,91.392 L336.61795,91.392 L336.61795,91.392 Z M527.373159,38.08 L502.130592,26.80832 L472.202278,41.1264 L502.130592,52.39808 L461.016949,72.352 L461.016949,104.94848 L486.86413,114.24 L502.130592,94.28608 L502.130592,105.25312 L527.977771,114.24 L544,91.23968 L527.373159,91.23968 L527.373159,38.08 L527.373159,38.08 Z M177.453737,114.24 L207.079744,102.35904 L177.453737,91.23968 L177.453737,75.24608 L216.300083,56.3584 L194.231731,26.80832 L151.606557,47.37152 L151.606557,103.12064 L177.453737,114.24 L177.453737,114.24 Z M455.424284,89.56416 L423.984441,79.968 L453.459295,42.19264 L416.577937,26.80832 L397.230341,51.48416 L428.821339,61.23264 L398.741873,98.85568 L436.076687,114.24 L455.424284,89.56416 L455.424284,89.56416 Z M486.86413,91.392 L486.86413,68.84864 L502.130592,61.53728 L502.130592,91.392 L486.86413,91.392 L486.86413,91.392 Z M177.453737,41.58336 L190.452904,59.55712 L177.453737,65.80224 L177.453737,41.58336 L177.453737,41.58336 Z M222.95082,103.12064 L248.797999,114.24 L291.27202,97.18016 L291.27202,29.7024 L222.95082,0 L222.95082,26.30784 L265.424841,43.21536 L265.424841,97.33248 L248.797999,91.23968 L248.797999,43.71584 L222.95082,51.94112 L222.95082,103.12064 L222.95082,103.12064 Z" />'
82
- },
83
- menu: {
84
- width: 24,
85
- height: 24,
86
- content: '<path d="M2 21h20M2 12h20M2 3h20" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" vector-effect="non-scaling-stroke" />'
87
- },
88
- fb: {
89
- width: 16,
90
- height: 18,
91
- content: '<path d="M15.117 1H.883A.883.883 0 0 0 0 1.883v14.234A.883.883 0 0 0 .883 17h7.663v-6.196H6.461V8.389h2.085V6.61a2.91 2.91 0 0 1 3.106-3.192c.622-.003 1.244.03 1.863.095v2.16h-1.279c-1.002 0-1.196.476-1.196 1.176v1.541h2.39l-.31 2.415h-2.08V17h4.077a.883.883 0 0 0 .883-.883V1.883A.883.883 0 0 0 15.117 1" />'
92
- },
93
- tw: {
94
- width: 20,
95
- height: 18,
96
- content: '<path d="M20 3.1c-.7.3-1.5.6-2.4.7.8-.5 1.5-1.4 1.8-2.4-.8.5-1.7.8-2.6 1-.7-.8-1.8-1.4-3-1.4-2.3 0-4.1 1.9-4.1 4.3 0 .3 0 .7.1 1-3.3-.1-6.4-1.8-8.4-4.4-.3.6-.5 1.4-.5 2.2 0 1.5.7 2.8 1.8 3.6-.7 0-1.3-.2-1.9-.5v.1c0 2.1 1.4 3.8 3.3 4.2-.3.1-.7.2-1.1.2-.3 0-.5 0-.8-.1.5 1.7 2 2.9 3.8 3-1.3 1-3.1 1.6-5 1.6-.3 0-.7 0-1-.1C1.8 17.3 4 18 6.3 18 13.8 18 18 11.5 18 5.8v-.6c.8-.5 1.5-1.2 2-2.1" fill-rule="nonzero"/>'
97
- },
98
- vk: {
99
- width: 20,
100
- height: 18,
101
- content: '<path d="M16.517 9.851s2.587-3.768 2.886-5.058c.1-.396-.1-.694-.498-.694h-2.288c-.498 0-.697.199-.896.595 0 0-1.194 2.678-2.686 4.364-.498.496-.697.694-.995.694-.2 0-.299-.198-.299-.694V4.793c0-.595-.1-.793-.597-.793H7.463c-.2 0-.398.198-.398.397 0 .595.796.694.796 2.28v3.174c0 .595 0 .893-.299.893-.796 0-2.686-2.777-3.681-5.851-.2-.595-.398-.794-.995-.794H.597C.299 4.1 0 4.298 0 4.694c0 .595.697 3.471 3.483 7.34C5.373 14.611 7.86 16 10.05 16c1.393 0 1.691-.198 1.691-.793v-1.984c0-.496.2-.694.498-.694s.895.1 2.189 1.388C15.92 15.405 16.02 16 16.915 16h2.587c.299 0 .498-.1.498-.595 0-.595-.796-1.587-1.89-2.876-.498-.595-1.195-1.29-1.493-1.686-.398-.397-.299-.595-.1-.992" fill-rule="nonzero"/>'
102
- },
103
- ok: {
104
- width: 9,
105
- height: 18,
106
- content: '<path d="M4.5 2c-2.2 0-4 1.8-4 4s1.8 4 4 4 4-1.8 4-4-1.8-4-4-4m0 5.7c-.9 0-1.6-.8-1.6-1.7 0-.9.7-1.6 1.6-1.6.9 0 1.7.7 1.7 1.7 0 .8-.8 1.6-1.7 1.6" fill-rule="nonzero"/> <path d="M6.127 12.982a9.194 9.194 0 0 0 2.307-.904c.602-.301.703-1.004.402-1.507-.301-.502-1.104-.703-1.605-.401-1.605 1.004-3.812 1.004-5.417 0-.502-.302-1.304-.201-1.605.3-.401.604-.2 1.206.401 1.608a9.194 9.194 0 0 0 2.307.904L.61 15.092c-.502.401-.502 1.104 0 1.607a1.357 1.357 0 0 0 1.705 0l2.207-2.11L6.73 16.7a1.357 1.357 0 0 0 1.705 0c.502-.402.502-1.105 0-1.608l-2.307-2.109" fill-rule="nonzero"/>'
107
- },
108
- tg: {
109
- width: 18,
110
- height: 18,
111
- content: '<path d="M9 18c-5 0-9-4-9-9s4-9 9-9 9 4 9 9-4 9-9 9zm-1.5-7.4c1.1 1 2 3.3 2 3.3.4.2.7.1.8-.4l2.1-7.4c.1-.6-.2-.8-.6-.7L4 8.3c-.6.2-.6.5-.1.7 0 .1 2.4.6 3.6 1.6z" fill-rule="nonzero"/>'
112
- },
113
- meduzaSymbol: {
114
- width: 24,
115
- height: 18,
116
- content: '<path d="M10.026233,17.0968697 L13.9737671,18.3530831 L13.9737671,10.9855851 L13.9737671,8.48948164 L16.5131165,8.48948164 L16.5131165,17.0968697 L20.4375656,18.3530831 L23,14.8636014 L20.4606507,14.8636014 L20.4606507,6.37252945 L16.5362015,5 L13.9737671,8.02421743 L13.9737671,6.37252945 L10.049318,5 L7.48688354,8.02421743 L7.48688354,6.37252945 L3.56243443,5 L1,8.48948164 L3.53934943,8.48948164 L3.53934943,17.0968697 L7.48688354,18.3530831 L7.48688354,8.48948164 L10.026233,8.48948164 L10.026233,17.0968697 Z" />'
117
- },
118
- backward: {
119
- width: 25,
120
- height: 27,
121
- content: '<path d="M13 0v2.01c6.672.263 12 5.754 12 12.49C25 21.404 19.404 27 12.5 27S0 21.404 0 14.5c0-3.493 1.441-6.758 3.936-9.105a.75.75 0 111.028 1.092A10.965 10.965 0 001.5 14.5c0 6.075 4.925 11 11 11s11-4.925 11-11c0-5.907-4.656-10.727-10.499-10.989L13 6 8 3l5-3zm3.295 11.33v1.25h-3.16v1.63c.32-.32.86-.56 1.47-.56 1.13 0 2.14.81 2.14 2.16 0 1.42-1.06 2.31-2.67 2.31-1.16 0-2-.38-2.57-1l.79-.99c.45.47 1.07.73 1.77.73.79 0 1.24-.45 1.24-.99 0-.59-.44-.99-1.2-.99-.55 0-1 .16-1.4.54l-.99-.26v-3.83h4.58zm-5.94 0V18h-1.42v-4.84l-1.11 1.13-.81-.85 2.1-2.11h1.24z" fill-rule="nonzero"/>'
122
- },
123
- forward: {
124
- width: 25,
125
- height: 27,
126
- content: '<path d="M12 0l5 3-5 3V3.511C6.157 3.773 1.5 8.592 1.5 14.5c0 6.075 4.925 11 11 11s11-4.925 11-11c0-3.075-1.267-5.946-3.464-8.013a.75.75 0 011.028-1.092A12.465 12.465 0 0125 14.5C25 21.404 19.404 27 12.5 27S0 21.404 0 14.5C0 7.764 5.328 2.272 12 2.01V0zm4.295 11.33v1.25h-3.16v1.63c.32-.32.86-.56 1.47-.56 1.13 0 2.14.81 2.14 2.16 0 1.42-1.06 2.31-2.67 2.31-1.16 0-2-.38-2.57-1l.79-.99c.45.47 1.07.73 1.77.73.79 0 1.24-.45 1.24-.99 0-.59-.44-.99-1.2-.99-.55 0-1 .16-1.4.54l-.99-.26v-3.83h4.58zm-5.94 0V18h-1.42v-4.84l-1.11 1.13-.81-.85 2.1-2.11h1.24z" fill-rule="nonzero"/>'
127
- },
128
- download: {
129
- width: 25,
130
- height: 27,
131
- content: '<path d="M12.5 2C19.404 2 25 7.596 25 14.5S19.404 27 12.5 27 0 21.404 0 14.5 5.596 2 12.5 2zm0 1.5c-6.075 0-11 4.925-11 11s4.925 11 11 11 11-4.925 11-11-4.925-11-11-11zm6 15.75a.75.75 0 01.102 1.493l-.102.007h-12a.75.75 0 01-.102-1.493l.102-.007h12zm-6-12a.75.75 0 01.743.648L13.25 8v7.598l1.834-1.222a.75.75 0 11.832 1.248l-3 2a.75.75 0 01-.832 0l-3-2a.75.75 0 11.832-1.248l1.834 1.223V8a.75.75 0 01.648-.743l.102-.007z" fill-rule="nonzero" fill="currentColor" />'
132
- },
133
- play: {
134
- width: 62,
135
- height: 62,
136
- content: '<path d="M24.35 41.772a.5.5 0 0 1-.739-.439V20.667a.5.5 0 0 1 .74-.44l18.944 10.334a.5.5 0 0 1 0 .878L24.351 41.772z" fill-rule="nonzero"/>'
137
- },
138
- pause: {
139
- width: 22,
140
- height: 22,
141
- content: '<path d="M12.832 4h2.8c.276 0 .5.224.5.5v12.394c0 .277-.224.5-.5.5h-2.8c-.276 0-.5-.223-.5-.5V4.5c0-.276.224-.5.5-.5zM6.5 4h2.8c.277 0 .5.224.5.5v12.394c0 .277-.223.5-.5.5H6.5c-.276 0-.5-.223-.5-.5V4.5c0-.276.224-.5.5-.5z" />'
142
- },
143
- speedHalf: {
144
- width: 25,
145
- height: 27,
146
- content: '<path d="M7.212 15.198V12.29l-.676.724L6 12.406 7.35 11h.825v4.198h-.963zM8.056 18H7.3l4.23-7h.765l-4.24 7zm2.99 0v-.735c1.717-1.27 2.134-1.679 2.134-2.14 0-.389-.288-.578-.665-.578-.467 0-.884.263-1.083.525l-.496-.64c.417-.493 1.053-.693 1.599-.693.913 0 1.599.462 1.599 1.312 0 .682-.556 1.28-1.708 2.14h1.737V18h-3.118zm5.998-2.918l-1.39 1.48-.567-.577 1.4-1.49-1.4-1.48.566-.588 1.39 1.49 1.4-1.49.557.588-1.4 1.48 1.4 1.49-.556.577-1.4-1.48z" /><path d="M12.5 27C19.404 27 25 21.404 25 14.5S19.404 2 12.5 2 0 7.596 0 14.5 5.596 27 12.5 27zm0-1.5c-6.075 0-11-4.925-11-11s4.925-11 11-11 11 4.925 11 11-4.925 11-11 11z" />'
147
- },
148
- speedOne: {
149
- width: 25,
150
- height: 27,
151
- content: '<path d="M9.955 18v-4.84l-1.11 1.13-.81-.85 2.1-2.11h1.24V18h-1.42zm4.6-2.78l-1.4 1.41-.57-.55 1.41-1.42-1.41-1.41.57-.56 1.4 1.42 1.41-1.42.56.56-1.41 1.41 1.41 1.42-.56.55-1.41-1.41z" fill-rule="nonzero"/><path d="M12.5 27C19.404 27 25 21.404 25 14.5S19.404 2 12.5 2 0 7.596 0 14.5 5.596 27 12.5 27zm0-1.5c-6.075 0-11-4.925-11-11s4.925-11 11-11 11 4.925 11 11-4.925 11-11 11z" fill-rule="nonzero"/>'
152
- },
153
- speedOneHalf: {
154
- width: 25,
155
- height: 27,
156
- content: '<path d="M5.62 18v-4.84l-1.11 1.13-.81-.85 2.1-2.11h1.24V18H5.62zm3.37-2.67v-2.77l-.68.69-.54-.58 1.36-1.34h.83v4h-.97zM9.84 18h-.76l4.26-6.67h.77L9.84 18zm3.01 0v-.7c1.73-1.21 2.15-1.6 2.15-2.04 0-.37-.29-.55-.67-.55-.47 0-.89.25-1.09.5l-.5-.61c.42-.47 1.06-.66 1.61-.66.92 0 1.61.44 1.61 1.25 0 .65-.56 1.22-1.72 2.04h1.75V18h-3.14zm6.04-2.78l-1.4 1.41-.57-.55 1.41-1.42-1.41-1.41.57-.56 1.4 1.42 1.41-1.42.56.56-1.41 1.41 1.41 1.42-.56.55-1.41-1.41z" fill-rule="nonzero"/><path d="M12.5 27C19.404 27 25 21.404 25 14.5S19.404 2 12.5 2 0 7.596 0 14.5 5.596 27 12.5 27zm0-1.5c-6.075 0-11-4.925-11-11s4.925-11 11-11 11 4.925 11 11-4.925 11-11 11z" fill-rule="nonzero"/>'
157
- },
158
- speedTwo: {
159
- width: 25,
160
- height: 27,
161
- content: '<path d="M7.147 18v-1.158c2.685-2.078 3.471-2.792 3.471-3.64 0-.6-.52-.9-1.061-.9-.748 0-1.318.311-1.76.797L7 12.127C7.64 11.352 8.613 11 9.527 11c1.396 0 2.507.827 2.507 2.202 0 1.18-.924 2.203-2.625 3.506h2.675V18H7.147zm7.916-2.874l-1.377 1.457-.56-.568 1.386-1.468-1.386-1.458.56-.58 1.377 1.469 1.386-1.468.551.579-1.386 1.458L17 16.015l-.55.568-1.387-1.457z" fill-rule="nonzero"/><path d="M12.5 27C19.404 27 25 21.404 25 14.5S19.404 2 12.5 2 0 7.596 0 14.5 5.596 27 12.5 27zm0-1.5c-6.075 0-11-4.925-11-11s4.925-11 11-11 11 4.925 11 11-4.925 11-11 11z" fill-rule="nonzero"/>'
162
- },
163
- podcastBookmark: {
164
- width: 25,
165
- height: 27,
166
- content: '<path d="M12.5 27C19.404 27 25 21.404 25 14.5S19.404 2 12.5 2 0 7.596 0 14.5 5.596 27 12.5 27zm0-1.5c-6.075 0-11-4.925-11-11s4.925-11 11-11 11 4.925 11 11-4.925 11-11 11z" /> <path d="M17.071 8.25H8a.75.75 0 00-.75.75v11.545l.007.104a.75.75 0 001.228.468l4.05-3.437 4.051 3.437a.75.75 0 001.235-.572V9a.75.75 0 00-.75-.75zm-.75 1.499v9.176l-3.3-2.8-.098-.07a.75.75 0 00-.873.07l-3.3 2.799V9.749h7.571z" data-stroke="true" /> <path d="M17.071 8.25H8a.75.75 0 00-.75.75v11.545l.007.104a.75.75 0 001.228.468l4.05-3.437 4.051 3.437a.75.75 0 001.235-.572V9a.75.75 0 00-.75-.75z" data-fill="true" />'
167
- },
168
- reaction: {
169
- width: 16,
170
- height: 16,
171
- content: '<path data-theme="light" fill="#D09959" d="M1 2h14v12H1z"/> <path d="M0 1.778C0 .8.8 0 1.778 0h12.444C15.2 0 16 .8 16 1.778v12.444C16 15.2 15.2 16 14.222 16H1.778C.8 16 0 15.2 0 14.222V1.778zM6.8 11.7l2.5.8V6.2h1.6v5.5l2.5.8 1.6-2.3h-1.6V4.8L10.9 4 9.3 5.9V4.8L6.8 4 5.1 5.9V4.8L2.6 4 1 6.2h1.6v5.5l2.5.8V6.2h1.7v5.5z" />'
172
- },
173
- cross: {
174
- width: 18,
175
- height: 18,
176
- content: '<path fill="none" fill-rule="evenodd" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" vector-effect="non-scaling-stroke" d="M2 2l14 14M16 2L2 16" />'
177
- },
178
- link: {
179
- width: 24,
180
- height: 24,
181
- content: '<path d="M9.158 18.928c-1.065 0-2.13-.405-2.94-1.215-1.624-1.623-1.624-4.262 0-5.884l.643-.645c.327-.326.854-.326 1.18 0 .325.326.325.853 0 1.178l-.645.645c-.972.972-.972 2.554 0 3.526.973.972 2.554.973 3.526 0l2.842-2.84c.97-.972.97-2.555 0-3.527-.325-.325-.325-.854 0-1.18.325-.324.853-.324 1.178 0 1.623 1.625 1.623 4.264 0 5.885l-2.84 2.84c-.81.81-1.877 1.216-2.942 1.216" /> <path d="M10.578 14.184c-.213 0-.426-.082-.59-.244-.784-.785-1.217-1.83-1.217-2.94 0-1.113.433-2.158 1.22-2.944l2.84-2.84c1.622-1.62 4.26-1.62 5.883 0 1.622 1.623 1.622 4.262 0 5.883l-.645.643c-.325.326-.852.326-1.178 0-.325-.325-.325-.852 0-1.178l.645-.644c.972-.97.972-2.554 0-3.526s-2.556-.972-3.527 0l-2.84 2.842c-.47.47-.73 1.096-.73 1.762 0 .667.26 1.293.73 1.763.325.327.325.854 0 1.18-.163.162-.376.244-.59.244" />'
182
- },
183
- search: {
184
- width: 16,
185
- height: 16,
186
- content: '<g transform="translate(2 1)" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" vector-effect="non-scaling-stroke"><circle cx="5.5" cy="5.5" r="5.5"/><path d="M11.37 13.442l-.995-1.272"/></g>'
187
- },
188
- card: {
189
- width: 15,
190
- height: 15,
191
- content: '<path d="M9 5.5a.5.5 0 0 1 .5.5v5a.5.5 0 0 1-.5.5H4a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5h5zm-.5 1h-4v4h4v-4zm2.5-3a.5.5 0 0 1 .5.5v5a.5.5 0 1 1-1 0V4.5H6a.5.5 0 0 1 0-1h5z" fill-rule="nonzero"/>'
192
- },
193
- podcast: {
194
- width: 15,
195
- height: 15,
196
- content: '<path d="M5.252 11.432A.5.5 0 0 1 4.5 11V4a.5.5 0 0 1 .752-.432l6 3.5a.5.5 0 0 1 0 .864l-6 3.5zm.248-1.303L10.008 7.5 5.5 4.87v5.26z" fill-rule="nonzero" />'
197
- },
198
- arrow: {
199
- width: 12,
200
- height: 12,
201
- content: '<path d="M3 7l3 3.5L9 7M6 10V1" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.2" vector-effect="non-scaling-stroke" />'
202
- },
203
- brent: {
204
- width: 9,
205
- height: 12,
206
- content: '<g fill="#999" fill-rule="nonzero"><path d="M4.332 0l.528.606c2.528 2.902 3.804 5.07 3.804 6.634A4.332 4.332 0 110 7.24C0 5.676 1.276 3.508 3.804.606L4.332 0zm0 2.143l-.176.212C2.313 4.589 1.4 6.248 1.4 7.24a2.932 2.932 0 105.864 0c0-.992-.914-2.651-2.756-4.885l-.176-.212z"/><path d="M2.973 7.475c0 .415.417.863.835.924l.097.008v.7c-.79 0-1.548-.716-1.626-1.5l-.006-.132h.7z"/></g> '
207
- },
208
- user: {
209
- width: 16,
210
- height: 16,
211
- content: '<path fill="currentColor" fill-rule="nonzero" d="M8 1a4.25 4.25 0 012.676 7.552 6.751 6.751 0 014.074 6.198.75.75 0 11-1.5 0 5.25 5.25 0 00-10.5 0 .75.75 0 11-1.5 0 6.752 6.752 0 014.074-6.199A4.25 4.25 0 018 1zm0 1.5A2.75 2.75 0 108 8a2.75 2.75 0 000-5.5z" />'
212
- },
213
- bookmark: {
214
- width: 17,
215
- height: 21,
216
- content: '<path d="M16 20l-7.5-6.333L1 20V1h15z" stroke="currentColor" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"/>'
217
- },
218
- shareBookmark: {
219
- width: 11,
220
- height: 15,
221
- content: '<path clip-rule="evenodd" d="M10 14 5.5 9.667 1 14V1h9v13Z" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/>'
222
- },
223
- receipt: {
224
- width: 10,
225
- height: 13,
226
- content: '<g fill="currentColor" fill-rule="nonzero"><path d="M10 0H0v13l2-1.74 1.5 1.305L5 11.26l1.5 1.305L8 11.26 10 13V0zM9 .997v9.81l-1-.87-1.5 1.304L5 9.937 3.5 11.24 2 9.937l-1 .87V.996h8z"/><path d="M7 3v1H3V3zM7 6v1H3V6z"/></g>'
227
- },
228
- read: {
229
- width: 15,
230
- height: 15,
231
- content: '<g fill="none" fill-rule="evenodd"><path opacity=".98" d="M0 0h15v15H0z"/><path d="M13.085 1.694a.513.513 0 01.855.56l-.051.077-3.163 3.975a.514.514 0 01-.73.075l-.068-.069-1.812-2.208a.512.512 0 01.729-.716l.065.066 1.409 1.718 2.766-3.478z" fill="#6EAC65" fill-rule="nonzero"/><path d="M6.454 12.997l-.06-.01-.078-.023a.49.49 0 01-.266-.24l.011.015a2.349 2.349 0 00-.535-.607c-.89-.745-2.117-.917-3.813-.12a.5.5 0 01-.706-.37L1 11.558V4.568a.5.5 0 01.287-.453c2.053-.963 3.695-.733 4.88.26.327.272.556.548.698.77l.084.144.018.04.022.076.01.071L7 11.233l.126-.09c.95-.656 2.16-.857 3.608-.417l.266.087v-2.81a.5.5 0 01.41-.491l.09-.008a.5.5 0 01.492.41l.008.09v3.555a.5.5 0 01-.713.452c-1.696-.796-2.922-.624-3.813.12a2.533 2.533 0 00-.497.544l-.038.064a.486.486 0 01-.485.258zm-4.29-8.17L2 4.892v5.92c1.637-.572 2.977-.348 4 .42l.002-5.58a2.605 2.605 0 00-.476-.513c-.81-.677-1.897-.88-3.362-.314z" fill="currentColor" fill-rule="nonzero"/></g>'
232
- },
233
- listened: {
234
- width: 15,
235
- height: 15,
236
- content: '<g fill-rule="nonzero"><path d="M4.978 4.354a.5.5 0 01-.332.624c-1.197.367-2.064 1.527-2.14 2.897l-.005.167a.749.749 0 01.999.708v3a.75.75 0 01-1.458.248L2 12a1 1 0 01-1-1v-1a1 1 0 01.5-.866V8.072c0-1.886 1.172-3.535 2.854-4.05a.5.5 0 01.624.332zM10 7a.5.5 0 01.492.41l.008.09.001 1.634a1 1 0 01.492.745L11 10v1a1 1 0 01-.883.993L10 12l-.042-.002a.75.75 0 01-1.451-.146L8.5 11.75v-3a.75.75 0 011.001-.707L9.5 7.5l.008-.09A.5.5 0 0110 7z" fill="currentColor" /><path d="M11.585 1.194a.513.513 0 01.855.56l-.051.077-3.163 3.975a.514.514 0 01-.73.075l-.068-.069-1.812-2.208a.512.512 0 01.729-.716l.065.066 1.409 1.718 2.766-3.478z" fill="#6EAC65" /></g>'
237
- },
238
- magic: {
239
- width: 15,
240
- height: 15,
241
- content: '<g fill-rule="evenodd" clip-rule="evenodd"> <path d="M7.804.4a.6.6 0 0 1 .6.6v2.035a.6.6 0 0 1-1.2 0V1a.6.6 0 0 1 .6-.6ZM7.804 10.577a.6.6 0 0 1 .6.6v2.035a.6.6 0 1 1-1.2 0v-2.035a.6.6 0 0 1 .6-.6ZM14.636 7.106a.6.6 0 0 1-.6.6h-2.078a.6.6 0 1 1 0-1.2h2.078a.6.6 0 0 1 .6.6ZM4.25 7.106a.6.6 0 0 1-.6.6H1.573a.6.6 0 0 1 0-1.2H3.65a.6.6 0 0 1 .6.6ZM12.639 2.37a.585.585 0 0 1 0 .84l-1.442 1.412a.615.615 0 0 1-.857 0 .585.585 0 0 1 0-.84l1.442-1.412a.615.615 0 0 1 .857 0ZM12.639 11.843a.615.615 0 0 1-.857 0L10.34 10.43a.585.585 0 0 1 0-.84.615.615 0 0 1 .857 0l1.442 1.413a.585.585 0 0 1 0 .84ZM5.269 4.621a.615.615 0 0 1-.858 0L2.97 3.208a.585.585 0 0 1 0-.84.615.615 0 0 1 .858 0l1.442 1.413a.585.585 0 0 1 0 .84ZM8.926 6.074a.6.6 0 0 1 0 .849l-.863.863-.849-.849.863-.863a.6.6 0 0 1 .849 0ZM7.348 8.5l-5.924 5.924a.6.6 0 1 1-.848-.848L6.5 7.652l.848.848Z"/> </g>'
242
- }
243
- };
244
-
245
- var styles$1 = {"root":"SvgSymbol-module_root__2CsRW","small":"SvgSymbol-module_small__2g6oR","normal":"SvgSymbol-module_normal__9lFn1","medium":"SvgSymbol-module_medium__2eF5L","large":"SvgSymbol-module_large__2kQrt","adaptive":"SvgSymbol-module_adaptive__3_68T","fb":"SvgSymbol-module_fb__1whmw","vk":"SvgSymbol-module_vk__3VEuu","ok":"SvgSymbol-module_ok__2_1Qb","tw":"SvgSymbol-module_tw__2VRG5","tg":"SvgSymbol-module_tg__2xe2f","magic":"SvgSymbol-module_magic__TYq9U","reaction":"SvgSymbol-module_reaction__rrJvf","card":"SvgSymbol-module_card__1XAqw","podcast":"SvgSymbol-module_podcast__3oPoo","read":"SvgSymbol-module_read__2V82i","listened":"SvgSymbol-module_listened__1oMFV","menu":"SvgSymbol-module_menu__2iYFt","cross":"SvgSymbol-module_cross__J2lCN","isInFeature":"SvgSymbol-module_isInFeature__cDeTI","isInCard":"SvgSymbol-module_isInCard__pKq4e","isInTopicBlockItem":"SvgSymbol-module_isInTopicBlockItem__3Te91","isInPageStatic":"SvgSymbol-module_isInPageStatic__H31Rd","isInMaterialMeta":"SvgSymbol-module_isInMaterialMeta__2IbAw","isInAudioPlayer":"SvgSymbol-module_isInAudioPlayer__2xlzW","isInEpisodeBlock":"SvgSymbol-module_isInEpisodeBlock__2vY3o","isInButtonPlaybackRate":"SvgSymbol-module_isInButtonPlaybackRate__1L3TW","isInButtonBackward":"SvgSymbol-module_isInButtonBackward__1Grf9","isInButtonForward":"SvgSymbol-module_isInButtonForward__D1AFL","isInToolbar":"SvgSymbol-module_isInToolbar__3SaIh","play":"SvgSymbol-module_play__pM-qY","meduzaLogo":"SvgSymbol-module_meduzaLogo__2Ouzp","arrow":"SvgSymbol-module_arrow__11naX","oil":"SvgSymbol-module_oil__hvHE5","search":"SvgSymbol-module_search__VK6p3","user":"SvgSymbol-module_user__1MGim","bookmark":"SvgSymbol-module_bookmark__2z7tX","shareBookmark":"SvgSymbol-module_shareBookmark__QEJOS","receipt":"SvgSymbol-module_receipt__3Eqow","isInHeader":"SvgSymbol-module_isInHeader__1QHjL"};
246
-
247
- var SvgSymbol = function SvgSymbol(_ref) {
248
- var icon = _ref.icon,
249
- size = _ref.size,
250
- styleContext = _ref.styleContext;
251
- var data = icons[icon];
252
- return React.createElement("svg", {
253
- "data-testid": "svg-symbol",
254
- xmlns: "http://www.w3.org/2000/svg",
255
- xmlnsXlink: "http://www.w3.org/1999/xlink",
256
- className: makeClassName([[styles$1.root, true], [styles$1[size], !!styles$1[size]], [styles$1[icon], !!styles$1[icon]], [styles$1[styleContext], !!styles$1[styleContext]]]),
257
- width: data.width,
258
- height: data.height,
259
- viewBox: "0 0 " + data.width + " " + data.height,
260
- dangerouslySetInnerHTML: {
261
- __html: data.content
262
- }
263
- });
264
- };
265
-
266
- var styles$2 = {"root":"Switcher-module_root__1Env1","dark":"Switcher-module_dark__1IzaH","control":"Switcher-module_control__1NTvY","input":"Switcher-module_input__jaMVF","knob":"Switcher-module_knob__3kEy5","children":"Switcher-module_children__147JP","left":"Switcher-module_left__2coeE","right":"Switcher-module_right__yWG7h","isInPanel":"Switcher-module_isInPanel__TumqY","isInMenu":"Switcher-module_isInMenu__3XJYj","isInLive":"Switcher-module_isInLive__2cLui"};
267
-
268
- var Switcher = function Switcher(_ref) {
269
- var enabled = _ref.enabled,
270
- children = _ref.children,
271
- _ref$childrenPosition = _ref.childrenPosition,
272
- childrenPosition = _ref$childrenPosition === void 0 ? 'left' : _ref$childrenPosition,
273
- onChange = _ref.onChange,
274
- styleContext = _ref.styleContext,
275
- _ref$theme = _ref.theme,
276
- theme = _ref$theme === void 0 ? 'light' : _ref$theme;
277
- return React.createElement("label", {
278
- "data-testid": "switcher",
279
- className: makeClassName([[styles$2.root, true], [styles$2[theme], !!styles$2[theme]], [styles$2[styleContext], !!styles$2[styleContext]]])
280
- }, children && childrenPosition === 'left' && React.createElement("div", {
281
- className: makeClassName([[styles$2.children, true], [styles$2.left, true]])
282
- }, children), React.createElement("input", {
283
- className: styles$2.input,
284
- type: "checkbox",
285
- checked: enabled,
286
- onChange: onChange
287
- }), React.createElement("span", {
288
- className: styles$2.control
289
- }, React.createElement("span", {
290
- className: styles$2.knob
291
- })), children && childrenPosition === 'right' && React.createElement("div", {
292
- className: makeClassName([[styles$2.children, true], [styles$2.right, true]])
293
- }, children));
294
- };
295
-
296
- var makeStyleContext = function makeStyleContext(classNames, styleContext, styles) {
297
- var context = Array.isArray(styleContext) ? styleContext.filter(function (ctx) {
298
- return styles[ctx];
299
- }).map(function (ctx) {
300
- return [[styles[ctx]], true];
301
- }) : [[styles[styleContext], !!styleContext && !!styles[styleContext]]];
302
- return classNames.concat(context);
303
- };
304
-
305
- var BlockContext = /*#__PURE__*/React.createContext({
306
- lightBox: null
307
- });
308
- var BlockProvider = BlockContext.Provider;
309
-
310
- var POST_MESSAGE_PREFIX = 'mdzKitMsg';
311
-
312
- var postMessage = function postMessage(category, element, action) {
313
- var target = window.top;
314
- var msg = POST_MESSAGE_PREFIX + "=" + JSON.stringify({
315
- category: category,
316
- element: element,
317
- action: action
318
- });
319
-
320
- if (typeof target !== 'undefined') {
321
- target.postMessage(msg, '*');
322
- }
323
- };
324
-
325
- var styles$3 = {"root":"Lazy-module_root__2Z72l"};
326
-
327
- var Lazy = function Lazy(_ref) {
328
- var children = _ref.children,
329
- threshold = _ref.threshold;
330
-
331
- var _useInView = useInView({
332
- threshold: threshold || 0
333
- }),
334
- ref = _useInView[0],
335
- inView = _useInView[1],
336
- entry = _useInView[2];
337
-
338
- var _useState = useState(false),
339
- visible = _useState[0],
340
- setVisible = _useState[1];
341
-
342
- useEffect(function () {
343
- if (entry && entry.boundingClientRect && entry.boundingClientRect.y < 0) {
344
- setVisible(true);
345
- }
346
- }, [entry]);
347
- useEffect(function () {
348
- if (inView) {
349
- setVisible(true);
350
- }
351
- }, [inView]);
352
- return React.createElement("div", {
353
- className: makeClassName([[styles$3.root, true], [styles$3.visible, visible]]),
354
- ref: ref,
355
- "data-testid": "lazy"
356
- }, visible && children);
357
- };
358
-
359
- var MediaQuerySizes = {
360
- MOBILE: 512,
361
- PORTRAIT_TABLET: 768,
362
- LANDSCAPE_TABLET: 1024,
363
- DESKTOP: 1010,
364
- WIDE_DESKTOP: 1200
365
- };
366
- var imageBreakpoints = {
367
- 325: '(min-width: 0)',
368
- 520: '(min-width: 325px)',
369
- 600: '(min-width: 600px)',
370
- 650: '(min-width: 650px)',
371
- 980: '(min-width: 1000px)',
372
- 1335: '(min-width: 1000px)'
373
- };
374
- var imageConditionalKeys = {
375
- xs: [325],
376
- superFull: [1335, 650, 520, 325],
377
- full: [980, 650, 520, 325],
378
- "default": [650, 520, 325],
379
- narrow: [600, 325]
380
- };
381
- var SocialLabels = {
382
- ru: {
383
- tg: 'Телеграм',
384
- fb: 'Фейсбук',
385
- tw: 'Твиттер',
386
- pdf: 'PDF',
387
- unblock: 'Magic link',
388
- bookmark: 'В закладки',
389
- reaction: 'Напишите нам'
390
- },
391
- en: {
392
- tg: 'Telegram',
393
- fb: 'Fb',
394
- tw: 'Twitter',
395
- pdf: 'PDF',
396
- unblock: 'Magic link',
397
- bookmark: 'Add to bookmarks'
398
- }
399
- };
400
-
401
- var toCamel = function toCamel(s) {
402
- return s.replace(/([_][a-z])/gi, function (str) {
403
- return str.toUpperCase().replace('_', '');
404
- });
405
- };
406
- var toCapitalize = function toCapitalize(s) {
407
- return s[0].toUpperCase() + s.slice(1);
408
- };
409
-
410
- var RenderPicture = function RenderPicture(_ref) {
411
- var source = _ref.source,
412
- fallbackSource = _ref.fallbackSource,
413
- optimized = _ref.optimized,
414
- alt = _ref.alt,
415
- display = _ref.display,
416
- _onLoad = _ref.onLoad;
417
-
418
- var _useState = useState(false),
419
- fallback = _useState[0],
420
- setFallback = _useState[1];
421
-
422
- useEffect(function () {
423
- setFallback(!window.HTMLPictureElement);
424
- }, []);
425
- var keys = imageConditionalKeys[toCamel(display)] || imageConditionalKeys["default"];
426
- return React.createElement("picture", null, source && React.createElement("source", {
427
- media: "(min-width: 325px)",
428
- srcSet: source[1] + " 2x"
429
- }), optimized && !optimized.w325 && React.createElement("source", {
430
- media: "(min-width: 0)",
431
- srcSet: "" + optimized.original
432
- }), optimized && keys.map(function (key) {
433
- var breakpoint = optimized["w" + key];
434
-
435
- if (!breakpoint) {
436
- return null;
437
- }
438
-
439
- return React.createElement(React.Fragment, {
440
- key: key
441
- }, React.createElement("source", {
442
- type: "image/webp",
443
- media: imageBreakpoints[key],
444
- srcSet: breakpoint['2x_webp'] + " 2x, " + breakpoint['1x_webp'] + " 1x "
445
- }), React.createElement("source", {
446
- type: "image/png",
447
- media: imageBreakpoints[key],
448
- srcSet: breakpoint['2x'] + " 2x, " + breakpoint['1x'] + " 1x "
449
- }));
450
- }), React.createElement("img", {
451
- src: fallback ? fallbackSource : 'data:image/gif;base64,R0lGODlhAQABAPAAAPLy8gAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==',
452
- alt: alt,
453
- onLoad: function onLoad() {
454
- return _onLoad(true);
455
- }
456
- }));
457
- };
458
-
459
- var styles$4 = {"root":"Image-module_root__1vsA_","isLoaded":"Image-module_isLoaded__3XhU5","wrapper":"Image-module_wrapper__3fLjs","fullscreen":"Image-module_fullscreen__29apx","dark":"Image-module_dark__3o0nU"};
460
-
461
- var Image = function Image(_ref) {
462
- var alt = _ref.alt,
463
- display = _ref.display,
464
- optimized = _ref.optimized,
465
- width = _ref.width,
466
- height = _ref.height,
467
- source = _ref.source,
468
- lazy = _ref.lazy,
469
- ratio = _ref.ratio,
470
- styleContext = _ref.styleContext,
471
- _ref$fullscreen = _ref.fullscreen,
472
- fullscreen = _ref$fullscreen === void 0 ? true : _ref$fullscreen;
473
-
474
- var _useContext = useContext(BlockContext),
475
- lightBox = _useContext.lightBox;
476
-
477
- var _useState = useState(lazy ? false : true),
478
- isLoaded = _useState[0],
479
- setIsLoaded = _useState[1];
480
-
481
- var handleClick = function handleClick() {
482
- if (!lightBox || !fullscreen || optimized && !optimized.original) {
483
- return;
484
- }
485
-
486
- postMessage('', 'fullscreen_click', 'click');
487
- lightBox.show(optimized, width, height, alt);
488
- };
489
-
490
- var blockStyles = {
491
- maxWidth: width <= 649 ? width : '100%'
492
- };
493
- var pictureStyles = {
494
- paddingBottom: 100 / (ratio || width / height) + "%"
495
- };
496
- /* fallback w325 url until w6 was released */
497
-
498
- var fallbackSource = source && source[0] || optimized.w325 && optimized.w325['1x'] || optimized.original;
499
- var classNames = [[styles$4.root, true], [styles$4.isLoaded, isLoaded], [styles$4.fullscreen, lightBox && optimized && optimized.original && fullscreen]];
500
-
501
- if (styleContext) {
502
- classNames = makeStyleContext(classNames, styleContext, styles$4);
503
- }
504
-
505
- return React.createElement("div", {
506
- className: makeClassName(classNames),
507
- style: blockStyles,
508
- "data-testid": "image"
509
- }, React.createElement("div", {
510
- className: styles$4.wrapper,
511
- style: pictureStyles,
512
- onClick: function onClick() {
513
- return handleClick();
514
- },
515
- onKeyPress: function onKeyPress() {
516
- return handleClick();
517
- },
518
- role: "button",
519
- tabIndex: 0
520
- }, lazy ? React.createElement(React.Fragment, null, React.createElement(Lazy, {
521
- threshold: 0.25
522
- }, React.createElement(RenderPicture, {
523
- fallbackSource: fallbackSource,
524
- source: source,
525
- optimized: optimized,
526
- alt: alt,
527
- display: display,
528
- onLoad: setIsLoaded
529
- })), React.createElement("noscript", null, React.createElement("img", {
530
- src: fallbackSource,
531
- alt: alt
532
- }))) : React.createElement(RenderPicture, {
533
- fallbackSource: fallbackSource,
534
- source: source,
535
- optimized: optimized,
536
- alt: alt,
537
- display: display,
538
- onLoad: setIsLoaded
539
- })));
540
- };
541
-
542
- var styles$5 = {"root":"Popover-module_root__1v6f_","fadeOut":"Popover-module_fadeOut__3EZhx","visible":"Popover-module_visible__eK5ZQ","fadeIn":"Popover-module_fadeIn__AkrSN","overlay":"Popover-module_overlay__2SBL0","container":"Popover-module_container__FnZT-","disappear":"Popover-module_disappear__3Q9LI","dismiss":"Popover-module_dismiss__3RnLj","background":"Popover-module_background__1KKaP","appear":"Popover-module_appear__37vPd","body":"Popover-module_body__3h5UO"};
543
-
544
- var Popover = function Popover(_ref) {
545
- var children = _ref.children,
546
- onClose = _ref.onClose;
547
-
548
- var _useState = useState(true),
549
- visible = _useState[0],
550
- setVisible = _useState[1];
551
-
552
- var handleClose = function handleClose() {
553
- setVisible(false);
554
- setTimeout(onClose, 350);
555
- };
556
-
557
- var handleScroll = function handleScroll() {
558
- handleClose();
559
- };
560
-
561
- var escFunction = function escFunction(event) {
562
- if (event.key === 'Escape') {
563
- handleClose();
564
- }
565
- };
566
-
567
- useEffect(function () {
568
- document.body.dataset.popover = 'true';
569
- window.addEventListener('keydown', escFunction, false);
570
- window.addEventListener('scroll', handleScroll, false);
571
- return function () {
572
- document.body.removeAttribute('data-popover');
573
- window.removeEventListener('keydown', escFunction, false);
574
- window.removeEventListener('scroll', handleScroll, false);
575
- };
576
- }, [visible]);
577
- /* eslint-disable jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions */
578
-
579
- return React.createElement("div", {
580
- "data-testid": "popover",
581
- className: makeClassName([[styles$5.root, true], [styles$5.visible, visible]])
582
- }, React.createElement("div", {
583
- className: styles$5.overlay,
584
- onClick: function onClick() {
585
- return handleClose();
586
- }
587
- }), React.createElement("div", {
588
- className: styles$5.container
589
- }, React.createElement("button", {
590
- type: "button",
591
- className: styles$5.dismiss,
592
- onClick: function onClick() {
593
- return handleClose();
594
- },
595
- "aria-label": "dismiss"
596
- }), React.createElement("svg", {
597
- width: "100%",
598
- className: styles$5.background
599
- }, React.createElement("defs", null, React.createElement("mask", {
600
- id: "myMask",
601
- x: "0",
602
- y: "0",
603
- width: "100%",
604
- height: "100%"
605
- }, React.createElement("rect", {
606
- fill: "white",
607
- y: "0",
608
- width: "100%",
609
- height: "100%",
610
- x: "0"
611
- }), React.createElement("svg", {
612
- x: "50%",
613
- overflow: "visible"
614
- }, React.createElement("g", {
615
- transform: "translate(-12 0)"
616
- }, React.createElement("path", {
617
- d: "M4.61852778e-14,9.76996262e-15 L9.84597532,5.80270273 C11.0992017,6.54128882 12.6546044,6.54128882 13.9078308,5.80270273 L23.7538061,9.76996262e-15 L4.61852778e-14,9.76996262e-15 Z"
618
- }))))), React.createElement("rect", {
619
- fill: "#F7F7F7",
620
- id: "base-mask",
621
- mask: "url(#myMask)",
622
- x: "0",
623
- y: "0",
624
- width: "100%",
625
- height: "100%"
626
- })), React.createElement("div", {
627
- className: styles$5.body
628
- }, children)));
629
- };
630
-
631
- var styles$6 = {"root":"Footnote-module_root__2a0-B","body":"Footnote-module_body__259Ly","dismiss":"Footnote-module_dismiss__1HKG5"};
632
-
633
- var Footnote = function Footnote(_ref) {
634
- var children = _ref.children,
635
- onClose = _ref.onClose;
636
- return React.createElement("div", {
637
- "data-testid": "footnote",
638
- className: makeClassName([[styles$6.root, true]])
639
- }, React.createElement("button", {
640
- className: styles$6.dismiss,
641
- type: "button",
642
- onClick: function onClick() {
643
- return onClose();
644
- }
645
- }, React.createElement(SvgSymbol, {
646
- icon: "cross",
647
- size: "unset"
648
- })), React.createElement("div", {
649
- className: styles$6.body
650
- }, children));
651
- };
652
-
653
- var viewportSize = (function () {
654
- return {
655
- width: window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth,
656
- height: window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight
657
- };
658
- });
659
-
660
- var styles$7 = {"root":"DotsOnImage-module_root__2XP3Q","isVisible":"DotsOnImage-module_isVisible__Wqqqt","marker":"DotsOnImage-module_marker__lH5cP","show":"DotsOnImage-module_show__2TMBv","dot":"DotsOnImage-module_dot__H1wua","isActive":"DotsOnImage-module_isActive__3hh31","popover":"DotsOnImage-module_popover__35Cpj","isRight":"DotsOnImage-module_isRight__2RsJe","isTop":"DotsOnImage-module_isTop__3zmSK","isLeft":"DotsOnImage-module_isLeft__3quc9","isBottom":"DotsOnImage-module_isBottom__3Nk1T"};
661
-
662
- var DotsOnImage = function DotsOnImage(_ref) {
663
- var _ref$block = _ref.block,
664
- optimized = _ref$block.optimized,
665
- width = _ref$block.width,
666
- height = _ref$block.height,
667
- credit = _ref$block.credit,
668
- display = _ref$block.display,
669
- dots = _ref$block.dots;
670
-
671
- var _useState = useState(1),
672
- ratio = _useState[0],
673
- setRatio = _useState[1];
674
-
675
- var _useInView = useInView(),
676
- ref = _useInView[0],
677
- inView = _useInView[1],
678
- entry = _useInView[2];
679
-
680
- var container = useRef(null);
681
-
682
- var _useState2 = useState({
683
- title: null,
684
- body: null,
685
- show: false,
686
- id: null
687
- }),
688
- popover = _useState2[0],
689
- setPopover = _useState2[1];
690
-
691
- var _useState3 = useState(false),
692
- visible = _useState3[0],
693
- setVisible = _useState3[1];
694
-
695
- var defaultWidth = 375;
696
- useEffect(function () {
697
- if (entry && entry.boundingClientRect && entry.boundingClientRect.y < 0) {
698
- setVisible(true);
699
- }
700
- }, [entry]);
701
- useEffect(function () {
702
- if (inView) {
703
- setVisible(true);
704
- }
705
- }, [inView]);
706
- useEffect(function () {
707
- if (popover.id) {
708
- document.addEventListener('click', handleClickOutside);
709
- } else {
710
- document.removeEventListener('click', handleClickOutside);
711
- }
712
-
713
- return function () {
714
- return document.removeEventListener('click', handleClickOutside);
715
- };
716
- }, [popover]);
717
- useEffect(function () {
718
- setDotSize();
719
- window.addEventListener('resize', setDotSize);
720
- return function () {
721
- return document.removeEventListener('resize', setDotSize);
722
- };
723
- }, [visible]);
724
-
725
- var setDotSize = function setDotSize() {
726
- var width = window.innerWidth;
727
-
728
- if (width < defaultWidth) {
729
- var _ratio = width / defaultWidth;
730
-
731
- setRatio(_ratio);
732
- } else {
733
- setRatio(1);
734
- }
735
- };
736
-
737
- var handleClickOutside = function handleClickOutside(event) {
738
- var path = event.composedPath();
739
-
740
- if (path.indexOf(container.current) === -1) {
741
- setPopover({
742
- show: false
743
- });
744
- }
745
- };
746
-
747
- var handleDotClick = function handleDotClick(dot) {
748
- var shouldShow = dot.id !== popover.id;
749
- var side = dot.position.x > 50 ? 'isLeft' : 'isRight';
750
- var align = dot.position.y > 50 ? 'isBottom' : 'isTop';
751
- var style = {
752
- top: dot.position.y + "%",
753
- left: dot.position.x + "%"
754
- };
755
- setPopover({
756
- title: dot.title,
757
- body: dot.body,
758
- show: shouldShow,
759
- id: shouldShow ? dot.id : null,
760
- style: style,
761
- side: side,
762
- align: align
763
- });
764
- };
765
-
766
- return React.createElement("div", {
767
- className: makeClassName([[styles$7.root, true], [styles$7.isVisible, visible]]),
768
- "data-testid": "dots-on-image",
769
- ref: ref
770
- }, React.createElement(Image, {
771
- fullscreen: false,
772
- optimized: optimized,
773
- width: width,
774
- height: height,
775
- alt: credit,
776
- display: display
777
- }), React.createElement("div", {
778
- ref: container
779
- }, dots.map(function (dot) {
780
- return React.createElement("div", {
781
- className: styles$7.dot,
782
- key: dot.id,
783
- style: {
784
- top: dot.position.y + "%",
785
- left: dot.position.x + "%",
786
- transform: "scale(" + ratio + ") translate(-" + 50 / ratio + "%, -" + 50 / ratio + "%)"
787
- }
788
- }, React.createElement("button", {
789
- className: makeClassName([[styles$7.marker, true], [styles$7.isActive, dot.id === popover.id]]),
790
- type: "button",
791
- style: {
792
- backgroundColor: dot.icon.color
793
- },
794
- onClick: function onClick() {
795
- return handleDotClick(dot);
796
- }
797
- }, dot.icon.type === 'svg' && React.createElement("div", {
798
- dangerouslySetInnerHTML: {
799
- __html: dot.icon.svg_string
800
- }
801
- }), dot.icon.type === 'number' && dot.icon.number));
802
- }), popover.show && React.createElement(React.Fragment, null, viewportSize().width >= MediaQuerySizes.LANDSCAPE_TABLET ? React.createElement("div", {
803
- className: makeClassName([[styles$7.popover, true], [styles$7[popover.side], !!popover.side], [styles$7[popover.align], !!popover.align]]),
804
- style: popover.style
805
- }, React.createElement(Footnote, {
806
- onClose: function onClose() {
807
- setPopover({
808
- show: false
809
- });
810
- }
811
- }, popover.title && React.createElement("h3", null, popover.title), React.createElement("div", {
812
- dangerouslySetInnerHTML: {
813
- __html: popover.body
814
- }
815
- }))) : React.createElement(Popover, {
816
- onClose: function onClose() {
817
- setPopover({
818
- show: false
819
- });
820
- }
821
- }, popover.title && React.createElement("h3", null, popover.title), React.createElement("div", {
822
- dangerouslySetInnerHTML: {
823
- __html: popover.body
824
- }
825
- })))));
826
- };
827
-
828
- var styles$8 = {"root":"Tag-module_root__3IqWC","small":"Tag-module_small__2IAb7","large":"Tag-module_large__22z_o","dark":"Tag-module_dark__sgnt1","light":"Tag-module_light__1zUhp","gold":"Tag-module_gold__2ksA7","gray":"Tag-module_gray__mGAO_","inherit":"Tag-module_inherit__2QB5U","is1to1":"Tag-module_is1to1__3EDbC","is1to2":"Tag-module_is1to2__3xbC6","isInSuperBlock":"Tag-module_isInSuperBlock__38JE0","is1to3":"Tag-module_is1to3__3j5K-","is1to4":"Tag-module_is1to4__2vq4r","slide":"Tag-module_slide__2nMDw","game":"Tag-module_game__3j5yG","podcastMaterial":"Tag-module_podcastMaterial__3v92z","richRelated":"Tag-module_richRelated__2vbQQ","card":"Tag-module_card__1EAeF","live":"Tag-module_live__rwXuR","episode":"Tag-module_episode__3o6gg","podcast":"Tag-module_podcast__VPoll","rich":"Tag-module_rich__2URd9","isInDynamicBlock":"Tag-module_isInDynamicBlock__1YM9I","mobile":"Tag-module_mobile__QQxuv","desktop":"Tag-module_desktop__1Bjsy"};
829
-
830
- var Tag = function Tag(_ref) {
831
- var children = _ref.children,
832
- _ref$size = _ref.size,
833
- size = _ref$size === void 0 ? 'small' : _ref$size,
834
- _ref$theme = _ref.theme,
835
- theme = _ref$theme === void 0 ? 'gold' : _ref$theme,
836
- styleContext = _ref.styleContext,
837
- correlation = _ref.correlation,
838
- onlyOn = _ref.onlyOn;
839
- var classNames = [[styles$8.root, true], [styles$8[size], !!size && !!styles$8[size]], [styles$8[theme], !!theme && !!styles$8[theme]], [styles$8[onlyOn], !!onlyOn && !!styles$8[onlyOn]], [styles$8[correlation], !!correlation && !!styles$8[correlation]]];
840
-
841
- if (styleContext) {
842
- classNames = makeStyleContext(classNames, styleContext, styles$8);
843
- }
844
-
845
- return React.createElement("div", {
846
- "data-testid": "tag",
847
- className: makeClassName(classNames)
848
- }, children);
849
- };
850
-
851
- var styles$9 = {"root":"MediaCaption-module_root__KqTdw","caption":"MediaCaption-module_caption__1hr7Y","credit":"MediaCaption-module_credit__3ehAP","dark":"MediaCaption-module_dark__3tL1u","video":"MediaCaption-module_video__1KZ6k","picture":"MediaCaption-module_picture__3AAMH","desktop":"MediaCaption-module_desktop__3Saev","isDark":"MediaCaption-module_isDark__38TtC"};
852
-
853
- var MediaCaption = function MediaCaption(_ref) {
854
- var credit = _ref.credit,
855
- caption = _ref.caption,
856
- styleContext = _ref.styleContext;
857
- var classNames = [[styles$9.root, true]];
858
-
859
- if (styleContext) {
860
- classNames = makeStyleContext(classNames, styleContext, styles$9);
861
- }
862
-
863
- return React.createElement("div", {
864
- "data-testid": "media-caption",
865
- className: makeClassName(classNames)
866
- }, caption && React.createElement("div", {
867
- className: styles$9.caption,
868
- dangerouslySetInnerHTML: {
869
- __html: caption
870
- }
871
- }), credit && React.createElement("div", {
872
- className: styles$9.credit,
873
- dangerouslySetInnerHTML: {
874
- __html: credit
875
- }
876
- }));
877
- };
878
-
879
- var styles$a = {"root":"Table-module_root__1VsG6","card":"Table-module_card__3gbok","table":"Table-module_table__nZIkV","slide":"Table-module_slide__nSGPC","wrapper":"Table-module_wrapper__1YTKM","tracks":"Table-module_tracks__2wrDB","default":"Table-module_default__3CGeE","full":"Table-module_full__S5pDB","row":"Table-module_row__3TH83","cell":"Table-module_cell__EFKDW","fixedColumn":"Table-module_fixedColumn__E1hN5","white":"Table-module_white__gzvo0","gray":"Table-module_gray__3da6S","pink":"Table-module_pink__3oH1l","blue":"Table-module_blue__GM27F","yellow":"Table-module_yellow__2jhvA","orange":"Table-module_orange__1c-oM","green":"Table-module_green__13OIM","violet":"Table-module_violet__2W-kO","header":"Table-module_header__1exlo","s":"Table-module_s__Vl_Eg","m":"Table-module_m__29G9r","l":"Table-module_l__1ZSMc","xs":"Table-module_xs__au2Oe"};
880
-
881
- var Table = function Table(_ref) {
882
- var styleContext = _ref.styleContext,
883
- _ref$block = _ref.block,
884
- rows = _ref$block.rows,
885
- options = _ref$block.options,
886
- display = _ref$block.display,
887
- columnsWidth = _ref$block.columns_widths,
888
- tableCredit = _ref$block.table_credit;
889
- var colors = {
890
- '#ffffff': 'white',
891
- '#f5f5f5': 'gray',
892
- '#feeeee': 'pink',
893
- '#e6f3ff': 'blue',
894
- '#fffde6': 'yellow',
895
- '#fff9f2': 'orange',
896
- '#e7f2ef': 'green',
897
- '#f4f0f8': 'violet'
898
- };
899
- var classNames = [[styles$a.root, true], [styles$a[display], !!display && !!styles$a[display]]];
900
-
901
- if (styleContext) {
902
- classNames = makeStyleContext(classNames, styleContext, styles$a);
903
- }
904
-
905
- return React.createElement("div", {
906
- "data-testid": "table",
907
- className: makeClassName(classNames)
908
- }, React.createElement("div", {
909
- className: styles$a.wrapper
910
- }, React.createElement("div", {
911
- className: styles$a.table
912
- }, React.createElement("div", {
913
- className: styles$a.tracks
914
- }, rows.map(function (row, i) {
915
- return React.createElement("div", {
916
- key: row.key,
917
- className: styles$a.row
918
- }, row.cells.map(function (cell, j) {
919
- return React.createElement("div", {
920
- key: cell.key,
921
- className: makeClassName([[styles$a.cell, true], [styles$a.header, options.header && i === 0], [styles$a[colors[cell.color]], true], [styles$a[columnsWidth[j]], true], [styles$a.fixedColumn, options.fixed_first_column && j === 0]]),
922
- dangerouslySetInnerHTML: {
923
- __html: cell.val
924
- }
925
- });
926
- }));
927
- })))), tableCredit && React.createElement(MediaCaption, {
928
- credit: tableCredit,
929
- styleContext: styleContext
930
- }));
931
- };
932
-
933
- var styles$b = {"root":"MaterialNote-module_root__1AcYe","dark":"MaterialNote-module_dark__xCry-","note_credit":"MaterialNote-module_note_credit__PuFyX","note_caption":"MaterialNote-module_note_caption__1ezSo","center":"MaterialNote-module_center__18RxI","default":"MaterialNote-module_default__1lQPl","card":"MaterialNote-module_card__OWXbQ","slide":"MaterialNote-module_slide__1ZBBq","game":"MaterialNote-module_game__cADMe","gameSurvey":"MaterialNote-module_gameSurvey__3SiG-"};
934
-
935
- var MaterialNote = function MaterialNote(_ref) {
936
- var data = _ref.block.data,
937
- styleContext = _ref.styleContext;
938
- var classNames = [[styles$b.root, true]];
939
-
940
- if (styleContext) {
941
- classNames = makeStyleContext(classNames, styleContext, styles$b);
942
- }
943
-
944
- return React.createElement(React.Fragment, null, React.createElement("div", {
945
- "data-testid": "material-note",
946
- className: makeClassName(classNames)
947
- }, data && data.map(function (item) {
948
- return React.createElement("p", {
949
- className: styles$b[item.type],
950
- key: item.id,
951
- dangerouslySetInnerHTML: {
952
- __html: item.data
953
- }
954
- });
955
- })));
956
- };
957
-
958
- var styles$c = {"root":"BookmarkButton-module_root__3KmuY","control":"BookmarkButton-module_control__1A0ea","dark":"BookmarkButton-module_dark__1cwyi","light":"BookmarkButton-module_light__1uQyH","isInBookmarks":"BookmarkButton-module_isInBookmarks__1_5kB","isInGrid":"BookmarkButton-module_isInGrid__2pQ2B"};
959
-
960
- var BookmarkButton = function BookmarkButton(_ref) {
961
- var styleContext = _ref.styleContext,
962
- theme = _ref.theme,
963
- isInBookmarks = _ref.isInBookmarks,
964
- _onClick = _ref.onClick;
965
- var classNames = [[styles$c.root, true], [styles$c.isInBookmarks, isInBookmarks], [styles$c[theme], !!theme && !!styles$c[theme]]];
966
-
967
- if (styleContext) {
968
- classNames = makeStyleContext(classNames, styleContext, styles$c);
969
- }
970
-
971
- return React.createElement("div", {
972
- "data-testid": "bookmark-button",
973
- className: makeClassName(classNames)
974
- }, React.createElement("button", {
975
- className: styles$c.control,
976
- onClick: function onClick() {
977
- return _onClick();
978
- },
979
- type: "button"
980
- }, React.createElement(SvgSymbol, {
981
- icon: "bookmark",
982
- size: "unset"
983
- })));
984
- };
985
-
986
- var styles$d = {"root":"MaterialTitle-module_root__18ku-","primary":"MaterialTitle-module_primary__2Sfmx","secondary":"MaterialTitle-module_secondary__3uDp4"};
987
-
988
- var Primary = function Primary(_ref) {
989
- var children = _ref.children;
990
- return React.createElement("span", {
991
- className: styles$d.primary
992
- }, children);
993
- };
994
- var Secondary = function Secondary(_ref2) {
995
- var children = _ref2.children;
996
- return React.createElement("span", {
997
- className: styles$d.secondary
998
- }, children);
999
- };
1000
- var MaterialTitle = function MaterialTitle(_ref3) {
1001
- var children = _ref3.children;
1002
- return React.createElement("h1", {
1003
- className: styles$d.root,
1004
- "data-testid": "material-title"
1005
- }, children);
1006
- };
1007
-
1008
- var styles$e = {"root":"Dropdown-module_root__11PNk","active":"Dropdown-module_active__3IwAl","menu":"Dropdown-module_menu__3PIqD","isInAudioPanel":"Dropdown-module_isInAudioPanel__1zv7F"};
1009
-
1010
- var Menu = function Menu(_ref) {
1011
- var children = _ref.children;
1012
- return React.createElement("div", {
1013
- "data-testid": "dropdown",
1014
- className: styles$e.menu
1015
- }, children);
1016
- };
1017
- var Dropdown = function Dropdown(_ref2) {
1018
- var children = _ref2.children,
1019
- active = _ref2.active,
1020
- styleContext = _ref2.styleContext;
1021
- var classNames = [[styles$e.root, true], [styles$e.active, !!active && !!styles$e.active]];
1022
-
1023
- if (styleContext) {
1024
- classNames = makeStyleContext(classNames, styleContext, styles$e);
1025
- }
1026
-
1027
- return React.createElement("div", {
1028
- "data-testid": "dropdown",
1029
- className: makeClassName(classNames)
1030
- }, children);
1031
- };
1032
-
1033
- var styles$f = {"root":"Toolbar-module_root__2HF2r","list":"Toolbar-module_list__1n5ny","item":"Toolbar-module_item__36x7d","isInTopbar":"Toolbar-module_isInTopbar__223iP","center":"Toolbar-module_center__3_H8M","game":"Toolbar-module_game__5-jY_","gameSurvey":"Toolbar-module_gameSurvey__1hQEz","slide":"Toolbar-module_slide__2HmGc","card":"Toolbar-module_card__1VbvB","isDark":"Toolbar-module_isDark__k1U0i","dark":"Toolbar-module_dark__2Ejc9"};
1034
-
1035
- var ToolbarItem = function ToolbarItem(_ref) {
1036
- var children = _ref.children;
1037
- return React.createElement("li", {
1038
- className: styles$f.item
1039
- }, children);
1040
- };
1041
-
1042
- var Toolbar = function Toolbar(_ref) {
1043
- var children = _ref.children,
1044
- styleContext = _ref.styleContext;
1045
- var classNames = [[styles$f.root, true]];
1046
-
1047
- if (styleContext) {
1048
- classNames = makeStyleContext(classNames, styleContext, styles$f);
1049
- }
1050
-
1051
- return React.createElement("div", {
1052
- "data-testid": "toolbar",
1053
- className: makeClassName(classNames)
1054
- }, React.createElement("ul", {
1055
- className: styles$f.list
1056
- }, children));
1057
- };
1058
-
1059
- var styles$g = {"root":"Meta-module_root__12AG7","rich":"Meta-module_rich__1XBtZ","podcast":"Meta-module_podcast__1m4zo","episode":"Meta-module_episode__1K2Xv","simple":"Meta-module_simple__3vUiI","slide":"Meta-module_slide__3g6fG","card":"Meta-module_card__LE1RK","game":"Meta-module_game__3aNlZ","isInMaterial":"Meta-module_isInMaterial__zaYMy","isInSearchItem":"Meta-module_isInSearchItem__1wbpx","isInMediaBlock":"Meta-module_isInMediaBlock__3xfPF","center":"Meta-module_center__3BBPr","half":"Meta-module_half__1xRkT","podcastMaterial":"Meta-module_podcastMaterial__2fHAt","light":"Meta-module_light__2baE-","dark":"Meta-module_dark__24y9m","isDark":"Meta-module_isDark__3g22f","hasSource":"Meta-module_hasSource__2lXiN","bookmark":"Meta-module_bookmark__3ot3k","mobile":"Meta-module_mobile__22LGV","desktop":"Meta-module_desktop__1ZGUS"};
1060
-
1061
- var Meta = function Meta(_ref) {
1062
- var hasSource = _ref.hasSource,
1063
- theme = _ref.theme,
1064
- children = _ref.children,
1065
- onlyOn = _ref.onlyOn,
1066
- styleContext = _ref.styleContext;
1067
- var classNames = [[styles$g.root, true], [styles$g[theme], !!theme && !!styles$g[theme]], [styles$g[onlyOn], !!onlyOn], [styles$g.hasSource, hasSource]];
1068
-
1069
- if (styleContext) {
1070
- classNames = makeStyleContext(classNames, styleContext, styles$g);
1071
- }
1072
-
1073
- return React.createElement("div", {
1074
- "data-testid": "meta",
1075
- className: makeClassName(classNames)
1076
- }, children);
1077
- };
1078
-
1079
- var styles$h = {"root":"Timestamp-module_root__coOvT"};
1080
-
1081
- var Timestamp = function Timestamp(_ref) {
1082
- var publishedAt = _ref.publishedAt,
1083
- _ref$locale = _ref.locale,
1084
- locale = _ref$locale === void 0 ? 'ru' : _ref$locale,
1085
- type = _ref.type;
1086
- var published;
1087
- var timeFormat = locale === 'ru' ? 'HH:mm, D MMMM YYYY' : 'h:mm a, MMMM D, YYYY';
1088
- var preparedPublishedAt = publishedAt * 1000;
1089
- dayjs.locale(locale);
1090
- dayjs.extend(relativeTime);
1091
-
1092
- if (type === 'fromNow') {
1093
- published = dayjs(preparedPublishedAt).fromNow();
1094
- } else if (type === 'format') {
1095
- published = dayjs(preparedPublishedAt).format('HH:mm');
1096
- } else if (type === 'date') {
1097
- published = dayjs(preparedPublishedAt).format(timeFormat);
1098
- } else {
1099
- throw new Error('Unknown time type');
1100
- }
1101
-
1102
- return React.createElement("time", {
1103
- suppressHydrationWarning: true,
1104
- "data-testid": "timestamp",
1105
- className: styles$h.root
1106
- }, published);
1107
- };
1108
-
1109
- var DangerousHTML = function DangerousHTML(_ref) {
1110
- var _ref$className = _ref.className,
1111
- className = _ref$className === void 0 ? '' : _ref$className,
1112
- _ref$tagName = _ref.tagName,
1113
- TagName = _ref$tagName === void 0 ? 'div' : _ref$tagName,
1114
- html = _ref.html;
1115
- var element = useRef(null);
1116
-
1117
- var _useState = useState(false),
1118
- canRenderHtml = _useState[0],
1119
- setCanRenderHtml = _useState[1];
1120
-
1121
- useEffect(function () {
1122
- setCanRenderHtml(true);
1123
- }, []);
1124
- var replaceScriptElementsRecursive = useCallback(function (node) {
1125
- if (node.tagName === 'SCRIPT' && (!node.id || node.id.indexOf('script-') !== 0)) {
1126
- var script = document.createElement('script');
1127
- script.id = "script-" + Math.random().toString(16).slice(2);
1128
- script.innerHTML = node.innerHTML;
1129
- var attrs = node.attributes;
1130
-
1131
- for (var i = 0; i < attrs.length; i += 1) {
1132
- var _attrs$i = attrs[i],
1133
- name = _attrs$i.name,
1134
- value = _attrs$i.value;
1135
- script.setAttribute(name, value);
1136
- }
1137
-
1138
- node.parentElement.replaceChild(script, node);
1139
- } else {
1140
- var _i = 0;
1141
- var children = node.childNodes;
1142
-
1143
- while (_i < children.length) {
1144
- replaceScriptElementsRecursive(children[_i]);
1145
- _i += 1;
1146
- }
1147
- }
1148
- }, []);
1149
- var prepareAnchors = useCallback(function () {
1150
- var anchors = Array.from(element.current.querySelectorAll('a'));
1151
- anchors.forEach(function (a) {
1152
- a.setAttribute('target', '_blank');
1153
- });
1154
- }, []);
1155
- useEffect(function () {
1156
- if (canRenderHtml && html.indexOf('script') > -1 && element.current.firstElementChild) {
1157
- element.current.firstElementChild.innerHTML = html;
1158
- replaceScriptElementsRecursive(element.current.firstElementChild);
1159
- prepareAnchors();
1160
- }
1161
- }, [canRenderHtml, element, html, replaceScriptElementsRecursive, prepareAnchors]);
1162
- return React.createElement("div", {
1163
- ref: element
1164
- }, React.createElement(TagName, {
1165
- className: className,
1166
- dangerouslySetInnerHTML: {
1167
- __html: html
1168
- }
1169
- }));
1170
- };
1171
-
1172
- var styles$i = {"root":"EmbedBlock-module_root__28k9U","object":"EmbedBlock-module_object__2_UZ7","objectWrap":"EmbedBlock-module_objectWrap__1aDVd","gameEmbed":"EmbedBlock-module_gameEmbed__AZQSo","proportional":"EmbedBlock-module_proportional__3lAv4","default":"EmbedBlock-module_default__LSDny","xs":"EmbedBlock-module_xs__1hFgW","full":"EmbedBlock-module_full__1TEjx","super_full":"EmbedBlock-module_super_full__1Fn9A","figure":"EmbedBlock-module_figure__vAvcN","dark":"EmbedBlock-module_dark__1be2G","isInGroupedBlock":"EmbedBlock-module_isInGroupedBlock__3r_i-","control":"EmbedBlock-module_control__xr8dZ","raw_html":"EmbedBlock-module_raw_html__MQoAA","mobileFullwidth":"EmbedBlock-module_mobileFullwidth__QFFLH","isInCard":"EmbedBlock-module_isInCard__37rtq","isInSlide":"EmbedBlock-module_isInSlide__2ea5q","cc":"EmbedBlock-module_cc__1BQ5g","isInSensitiveBlock":"EmbedBlock-module_isInSensitiveBlock__3wWYF","isInAnswer":"EmbedBlock-module_isInAnswer__tLlgs","picture":"EmbedBlock-module_picture__186q0","wrapper":"EmbedBlock-module_wrapper__33XvX","mobile":"EmbedBlock-module_mobile__1P-eo","desktop":"EmbedBlock-module_desktop__SF5a_"};
1173
-
1174
- var EmbedGif = function EmbedGif(_ref) {
1175
- var gif = _ref.gif,
1176
- mp4Url = _ref.mp4Url,
1177
- style = _ref.style;
1178
-
1179
- var _useState = useState(false),
1180
- videoFrozen = _useState[0],
1181
- setVideoFrozen = _useState[1];
1182
-
1183
- var videoElem = useRef(null);
1184
-
1185
- var handleVideoTouch = function handleVideoTouch() {
1186
- videoElem.current.play();
1187
- setVideoFrozen(false);
1188
- };
1189
-
1190
- var handleVideoError = function handleVideoError() {
1191
- var video = videoElem.current;
1192
- video.setAttribute('poster', video.dataset.gif);
1193
- setVideoFrozen(false);
1194
- };
1195
-
1196
- useEffect(function () {
1197
- var video = videoElem.current;
1198
-
1199
- var _viewportSize = viewportSize(),
1200
- viewportWidth = _viewportSize.width;
1201
-
1202
- if (viewportWidth >= MediaQuerySizes.MOBILE) {
1203
- video.setAttribute('autoplay', true);
1204
- video.play();
1205
- } else {
1206
- setVideoFrozen(true);
1207
- video.pause();
1208
- video.addEventListener('touchstart', handleVideoTouch);
1209
- }
1210
-
1211
- video.addEventListener('error', handleVideoError);
1212
- return function () {
1213
- video.removeEventListener('touchstart', handleVideoTouch);
1214
- video.removeEventListener('error', handleVideoError);
1215
- };
1216
- }, []);
1217
- return React.createElement("div", {
1218
- className: styles$i.figure
1219
- }, React.createElement("div", {
1220
- className: styles$i.objectWrap,
1221
- style: style,
1222
- "data-frozen": videoFrozen
1223
- }, React.createElement("video", {
1224
- playsInline: true,
1225
- muted: true,
1226
- loop: true,
1227
- autoPlay: true,
1228
- preload: "metadata",
1229
- "data-gif": gif,
1230
- ref: videoElem
1231
- }, React.createElement("source", {
1232
- src: "https://meduza.io" + mp4Url,
1233
- type: "video/mp4"
1234
- }))));
1235
- };
1236
-
1237
- var EmbedBlock = function EmbedBlock(_ref) {
1238
- var block = _ref.block,
1239
- _ref$block = _ref.block,
1240
- data = _ref$block.data,
1241
- _ref$block$data = _ref$block.data,
1242
- html = _ref$block$data.html,
1243
- display = _ref$block$data.display,
1244
- onlyOn = _ref$block$data.only_on,
1245
- provider = _ref$block$data.provider,
1246
- cc = _ref$block$data.cc,
1247
- optimized = _ref$block$data.optimized,
1248
- small = _ref$block$data.small_url,
1249
- large = _ref$block$data.large_url,
1250
- gifUrl = _ref$block$data.gif_url,
1251
- mp4Url = _ref$block$data.mp4_url,
1252
- styleContext = _ref.styleContext,
1253
- children = _ref.children;
1254
-
1255
- var _useState = useState(false),
1256
- isPopoverShown = _useState[0],
1257
- setIsPopoverShown = _useState[1];
1258
-
1259
- var style = {};
1260
- var isProportional = block.data.height && block.data.width;
1261
- var fullWidthProviders = ['youtube', 'vimeo', 'onetv', 'coub', 'meduza', 'facebook_video'];
1262
- var mobileFullwidth = fullWidthProviders.indexOf(provider) > -1 || block.type === 'dots_on_image';
1263
-
1264
- var renderCC = function renderCC(context) {
1265
- return React.createElement(MediaCaption, {
1266
- credit: data.credit,
1267
- caption: data.caption,
1268
- styleContext: context || styleContext
1269
- });
1270
- };
1271
-
1272
- var renderEmbed = function renderEmbed(style) {
1273
- switch (block.type) {
1274
- case 'gif':
1275
- {
1276
- return React.createElement(EmbedGif, {
1277
- gif: gifUrl,
1278
- mp4Url: mp4Url,
1279
- style: style
1280
- });
1281
- }
1282
-
1283
- case 'image':
1284
- {
1285
- return React.createElement("div", {
1286
- className: styles$i.figure
1287
- }, React.createElement(Image, {
1288
- source: !optimized && [small, large],
1289
- optimized: block.data.optimized,
1290
- width: block.data.width,
1291
- height: block.data.height,
1292
- alt: block.data.caption,
1293
- display: block.data.display,
1294
- lazy: block.data.lazy,
1295
- styleContext: styleContext
1296
- }));
1297
- }
1298
-
1299
- case 'game_embed':
1300
- {
1301
- return React.createElement("div", {
1302
- className: styles$i.gameEmbed
1303
- }, React.createElement("iframe", {
1304
- src: block.data.game_src,
1305
- id: block.data.game_id,
1306
- title: "Game embed"
1307
- }));
1308
- }
1309
-
1310
- case 'dots_on_image':
1311
- {
1312
- return React.createElement("div", {
1313
- className: styles$i.figure
1314
- }, React.createElement(DotsOnImage, {
1315
- block: data
1316
- }));
1317
- }
1318
-
1319
- default:
1320
- {
1321
- return React.createElement("div", {
1322
- className: styles$i.object
1323
- }, React.createElement("div", {
1324
- className: styles$i.wrapper,
1325
- style: style
1326
- }, React.createElement(DangerousHTML, {
1327
- className: styles$i.objectWrap,
1328
- html: html
1329
- })));
1330
- }
1331
- }
1332
- };
1333
-
1334
- if (isProportional) {
1335
- style.paddingBottom = block.data.height / block.data.width * 100 + "%";
1336
- style.height = 0;
1337
- }
1338
-
1339
- var classNames = [[styles$i.root, true], [styles$i.cc, cc], [styles$i[display], !!display && styles$i[display]], [styles$i[provider], !!provider && !!styles$i[provider]], [styles$i[onlyOn], !!onlyOn && styles$i[onlyOn]], [styles$i.mobileFullwidth, mobileFullwidth], [styles$i.proportional, isProportional]]; // Убираем из контекста все, что не начинается с приставки isIn,
1340
- // чтобы не применились лишние модификаторы
1341
- // TODO: в w6 модификаторы должны передаваться явно
1342
-
1343
- if (styleContext && Array.isArray(styleContext)) {
1344
- var filteredContext = styleContext.filter(function (key) {
1345
- return key.startsWith('isIn') && styles$i[key];
1346
- }).reduce(function (acc, key) {
1347
- acc.push(key);
1348
- return acc;
1349
- }, []);
1350
- classNames = makeStyleContext(classNames, filteredContext, styles$i);
1351
- }
1352
-
1353
- return React.createElement("figure", {
1354
- className: makeClassName(classNames)
1355
- }, children && React.createElement("div", {
1356
- className: styles$i.object
1357
- }, React.createElement("div", {
1358
- className: styles$i.wrapper,
1359
- style: style
1360
- }, React.createElement("div", {
1361
- className: styles$i.objectWrap
1362
- }, children))), !children && renderEmbed(style), cc === 'default' && React.createElement("figcaption", null, renderCC()), cc === 'button' && React.createElement("button", {
1363
- className: styles$i.control,
1364
- type: "button",
1365
- "aria-label": "Open",
1366
- onClick: function onClick() {
1367
- setIsPopoverShown(!isPopoverShown);
1368
- }
1369
- }), cc === 'button' && isPopoverShown && React.createElement(Popover, {
1370
- onClose: function onClose() {
1371
- setIsPopoverShown(false);
1372
- }
1373
- }, renderCC('isInPopover')));
1374
- };
1375
-
1376
- var IframeBlock = function IframeBlock(_ref) {
1377
- var block = _ref.block,
1378
- id = _ref.block.id,
1379
- styleContext = _ref.styleContext,
1380
- _ref$lang = _ref.lang,
1381
- lang = _ref$lang === void 0 ? 'ru' : _ref$lang;
1382
- var element = useRef(null);
1383
-
1384
- var renderIframe = function renderIframe() {
1385
- var rootEl = document.createElement('div');
1386
- var contentEl = document.createElement('div');
1387
- var scriptEl = document.createElement('script');
1388
- var style = document.createElement('style');
1389
- var range = document.createRange();
1390
- range.setStart(contentEl, 0);
1391
- contentEl.setAttribute('id', 'content');
1392
- scriptEl.textContent = "\n function getDocHeight() {\n var doc = document;\n var body = doc.body;\n var html = doc.documentElement;\n var height = Math.max( body.scrollHeight, body.offsetHeight,\n html.clientHeight, html.scrollHeight, html.offsetHeight );\n\n doc.body.style.margin=\"0\";\n\n return document.getElementById('content') ? document.getElementById('content').offsetHeight : height;\n }\n\n function sendDocHeightMsg() {\n var height = getDocHeight();\n var message = JSON.stringify({\n action: {\n type: \"UPDATE_HEIGHT\",\n payload: {\n id: \"" + block.id + "\",\n height: height\n }\n }\n });\n parent.postMessage(\"mdzMaterialEmbedHeight=\" + message, '*');\n }\n\n setInterval(sendDocHeightMsg, 300);\n ";
1393
- style.type = 'text/css';
1394
- style.innerHTML = block.type === 'embed_code' ? '.twitter-tweet { padding-top: 15px; margin: 0 !important; }' : '.twitter-tweet { margin: 0 !important; } .fb-post { display: block; } .instagram-media { min-width: 0 !important; }';
1395
- contentEl.appendChild(range.createContextualFragment(block.data.html));
1396
- rootEl.appendChild(scriptEl);
1397
- rootEl.appendChild(contentEl);
1398
- contentEl.appendChild(style);
1399
- var frame = element.current.querySelector('iframe').contentDocument;
1400
- frame.open();
1401
- frame.close();
1402
- frame.documentElement.setAttribute('lang', lang);
1403
- frame.body.appendChild(rootEl);
1404
- };
1405
-
1406
- useEffect(function () {
1407
- renderIframe();
1408
- }, []);
1409
- return React.createElement(EmbedBlock, {
1410
- block: block,
1411
- styleContext: styleContext
1412
- }, React.createElement("div", {
1413
- ref: element,
1414
- dangerouslySetInnerHTML: {
1415
- __html: "<iframe id=" + id + " frameBorder=\"0\" scrolling=\"no\"></iframe>"
1416
- }
1417
- }));
1418
- };
1419
-
1420
- var EmbedBlockContainer = function EmbedBlockContainer(_ref) {
1421
- var block = _ref.block,
1422
- styleContext = _ref.styleContext,
1423
- lang = _ref.lang;
1424
-
1425
- if (block.data && block.data.wrap_with_iframe) {
1426
- return React.createElement(IframeBlock, {
1427
- block: block,
1428
- styleContext: styleContext,
1429
- lang: lang
1430
- });
1431
- }
1432
-
1433
- return React.createElement(EmbedBlock, {
1434
- block: block,
1435
- styleContext: styleContext
1436
- });
1437
- };
1438
-
1439
- var styles$j = {"root":"QuoteBlock-module_root__2GrcC","center":"QuoteBlock-module_center__cTFNy"};
1440
-
1441
- var QuoteBlock = function QuoteBlock(_ref) {
1442
- var data = _ref.block.data,
1443
- styleContext = _ref.styleContext;
1444
- var classNames = [[styles$j.root, true]];
1445
-
1446
- if (styleContext) {
1447
- classNames = makeStyleContext(classNames, styleContext, styles$j);
1448
- }
1449
-
1450
- return React.createElement("div", {
1451
- "data-testid": "quote-block",
1452
- className: makeClassName(classNames)
1453
- }, React.createElement("p", {
1454
- dangerouslySetInnerHTML: {
1455
- __html: data
1456
- }
1457
- }));
1458
- };
1459
-
1460
- var styles$k = {"root":"CardTitle-module_root__1uqqF","index":"CardTitle-module_index__4FsTf","title":"CardTitle-module_title__2iTI6","mobile":"CardTitle-module_mobile__1_kij","desktop":"CardTitle-module_desktop__1l3_n"};
1461
-
1462
- var CardTitle = function CardTitle(_ref) {
1463
- var _ref$block$data = _ref.block.data,
1464
- onlyOn = _ref$block$data.only_on,
1465
- index = _ref$block$data.index,
1466
- text = _ref$block$data.text,
1467
- styleContext = _ref.styleContext;
1468
- return React.createElement("div", {
1469
- "data-testid": "card-title",
1470
- className: makeClassName([[styles$k.root, true], [styles$k[onlyOn], !!onlyOn], [styles$k[styleContext], !!styleContext && !!styles$k[styleContext]]])
1471
- }, React.createElement("div", {
1472
- className: styles$k.index
1473
- }, index), React.createElement("h3", {
1474
- className: styles$k.title
1475
- }, text));
1476
- };
1477
-
1478
- var styles$l = {"root":"ChapterBlock-module_root__1WyVn","subtitle":"ChapterBlock-module_subtitle__3TXll","mobile":"ChapterBlock-module_mobile__CiO0w","desktop":"ChapterBlock-module_desktop__tk1Nk"};
1479
-
1480
- var ChapterBlock = function ChapterBlock(_ref) {
1481
- var _ref$block = _ref.block,
1482
- data = _ref$block.data,
1483
- onlyOn = _ref$block.only_on,
1484
- styleContext = _ref.styleContext;
1485
- return React.createElement("div", {
1486
- "data-testid": "chapter-block",
1487
- className: makeClassName([[styles$l.root, true], [styles$l[onlyOn], !!onlyOn]])
1488
- }, React.createElement("div", {
1489
- className: makeClassName([[styles$l.subtitle, true], [styles$l[styleContext], !!styleContext && !!styles$l[styleContext]]]),
1490
- dangerouslySetInnerHTML: {
1491
- __html: data
1492
- }
1493
- }));
1494
- };
1495
-
1496
- var generateGradient = function generateGradient(color, type) {
1497
- var steps = {
1498
- mediaBlockBottom: [[0, 7], [0.08, 12], [0.16, 17], [0.22, 21], [0.32, 26], [0.42, 32], [0.52, 38], [0.62, 47], [0.72, 57], [0.82, 65], [1, 82]],
1499
- mediaBlockTop: [[0.5, 0], [0, 97]]
1500
- };
1501
- var gradient = steps[type].map(function (i) {
1502
- return "rgba(" + color + ", " + i[0] + ") " + i[1] + "%";
1503
- });
1504
- return "linear-gradient(-180deg, " + gradient + ")";
1505
- };
1506
-
1507
- var styles$m = {"root":"SimpleTitle-module_root__2jVQN","mobile":"SimpleTitle-module_mobile__11gBz","desktop":"SimpleTitle-module_desktop__3yXgy"};
1508
-
1509
- var SimpleTitle = function SimpleTitle(_ref) {
1510
- var _ref$block = _ref.block,
1511
- first = _ref$block.data.first,
1512
- onlyOn = _ref$block.only_on,
1513
- styleContext = _ref.styleContext;
1514
- var classNames = [[styles$m.root, true], [styles$m[onlyOn], true]];
1515
-
1516
- if (styleContext) {
1517
- classNames = makeStyleContext(classNames, styleContext, styles$m);
1518
- }
1519
-
1520
- return React.createElement("h1", {
1521
- "data-testid": "simple-title",
1522
- className: makeClassName(classNames)
1523
- }, first);
1524
- };
1525
-
1526
- var styles$n = {"root":"RichTitle-module_root__BK_WT","slide":"RichTitle-module_slide__1A-gB","game":"RichTitle-module_game__1g8Bn","podcastMaterial":"RichTitle-module_podcastMaterial__T3Cv3","half":"RichTitle-module_half__10GRI","featured":"RichTitle-module_featured__wJfaQ","isInMediaBlock":"RichTitle-module_isInMediaBlock__3RDw4","mobile":"RichTitle-module_mobile__1Cb6E","desktop":"RichTitle-module_desktop__2ixSQ"};
1527
-
1528
- var RichTitle = function RichTitle(_ref) {
1529
- var _ref$block = _ref.block,
1530
- onlyOn = _ref$block.only_on,
1531
- _ref$block$data = _ref$block.data,
1532
- featured = _ref$block$data.featured,
1533
- first = _ref$block$data.first,
1534
- second = _ref$block$data.second,
1535
- _ref$block$data$as = _ref$block$data.as,
1536
- TagName = _ref$block$data$as === void 0 ? 'h1' : _ref$block$data$as,
1537
- styleContext = _ref.styleContext;
1538
- var classNames = [[styles$n.root, true], [styles$n[onlyOn], true], [styles$n.featured, !!featured]];
1539
-
1540
- if (styleContext) {
1541
- classNames = makeStyleContext(classNames, styleContext, styles$n);
1542
- }
1543
-
1544
- return React.createElement(TagName, {
1545
- "data-testid": "rich-title",
1546
- className: makeClassName(classNames)
1547
- }, first, second && React.createElement("span", null, " ", second));
1548
- };
1549
-
1550
- var styles$o = {"p":"SimpleBlock-module_p__Q3azD","h2":"SimpleBlock-module_h2__S0LRs","h3":"SimpleBlock-module_h3__2Kv7Y","h4":"SimpleBlock-module_h4__2TJO3","lead":"SimpleBlock-module_lead__35nXx","lead_hr":"SimpleBlock-module_lead_hr__1yD5v","context_p":"SimpleBlock-module_context_p__33saY","blockquote":"SimpleBlock-module_blockquote__pwpcX","game":"SimpleBlock-module_game__2sjgl","slide":"SimpleBlock-module_slide__Aqgfu","dark":"SimpleBlock-module_dark__1J_ov","divider":"SimpleBlock-module_divider__tnCGQ","isInIntro":"SimpleBlock-module_isInIntro__DfutD","center":"SimpleBlock-module_center__2rjif","isInImportantLead":"SimpleBlock-module_isInImportantLead__3VGzT","podcastMaterial":"SimpleBlock-module_podcastMaterial__1YeaD","isInAnswer":"SimpleBlock-module_isInAnswer__3aX6X","mobile":"SimpleBlock-module_mobile__Ckgek","desktop":"SimpleBlock-module_desktop__2se2o","isDark":"SimpleBlock-module_isDark__22q5s"};
1551
-
1552
- var SimpleBlock = function SimpleBlock(_ref) {
1553
- var _ref$block = _ref.block,
1554
- data = _ref$block.data,
1555
- type = _ref$block.type,
1556
- onlyOn = _ref$block.only_on,
1557
- styleContext = _ref.styleContext;
1558
- var TagName;
1559
- var classNames = [[styles$o[type], !!type && !!styles$o[type]], [styles$o[onlyOn], true]];
1560
-
1561
- if (styleContext) {
1562
- classNames = makeStyleContext(classNames, styleContext, styles$o);
1563
- }
1564
-
1565
- switch (type) {
1566
- case 'context_p':
1567
- case 'lead':
1568
- case 'note_caption':
1569
- case 'note_credit':
1570
- {
1571
- TagName = 'p';
1572
- break;
1573
- }
1574
-
1575
- case 'divider':
1576
- return React.createElement("hr", {
1577
- className: makeClassName(classNames)
1578
- });
1579
-
1580
- case 'lead_hr':
1581
- {
1582
- TagName = 'div';
1583
- break;
1584
- }
1585
-
1586
- default:
1587
- TagName = type;
1588
- }
1589
-
1590
- return React.createElement(TagName, {
1591
- className: makeClassName(classNames),
1592
- dangerouslySetInnerHTML: {
1593
- __html: data
1594
- }
1595
- });
1596
- };
1597
-
1598
- var styles$p = {"root":"ListBlock-module_root__3Q3Ga","ol":"ListBlock-module_ol__21CgV","ul":"ListBlock-module_ul__2MRrS","center":"ListBlock-module_center__tdIwd","isInImportantLead":"ListBlock-module_isInImportantLead__UP0ic","dark":"ListBlock-module_dark__3E3tV","mobile":"ListBlock-module_mobile__2-nuV","desktop":"ListBlock-module_desktop__1EE0g"};
1599
-
1600
- var ListBlock = function ListBlock(_ref) {
1601
- var _ref$block = _ref.block,
1602
- type = _ref$block.type,
1603
- data = _ref$block.data,
1604
- onlyOn = _ref$block.only_on,
1605
- styleContext = _ref.styleContext;
1606
- var TagName = type;
1607
- var classNames = [[styles$p.root, true], [styles$p[onlyOn], true], [styles$p[type], !!type && !!styles$p[type]]];
1608
-
1609
- if (styleContext) {
1610
- classNames = makeStyleContext(classNames, styleContext, styles$p);
1611
- }
1612
-
1613
- return React.createElement(TagName, {
1614
- className: makeClassName(classNames),
1615
- "data-testid": "list-block"
1616
- }, data.map(function (item, index) {
1617
- return React.createElement("li", {
1618
- key: index,
1619
- dangerouslySetInnerHTML: {
1620
- __html: item
1621
- }
1622
- });
1623
- }));
1624
- };
1625
-
1626
- var styles$q = {"root":"RelatedBlock-module_root__IKcQq","header":"RelatedBlock-module_header__2SuWP","items":"RelatedBlock-module_items__2V-Ap","rich":"RelatedBlock-module_rich__ddaHq","first":"RelatedBlock-module_first__BKItW","simple":"RelatedBlock-module_simple__29HVO","center":"RelatedBlock-module_center__1LmW8","isInSlideMaterial":"RelatedBlock-module_isInSlideMaterial__2YSYG","mobile":"RelatedBlock-module_mobile__2XM5a","desktop":"RelatedBlock-module_desktop__2mXeq"};
1627
-
1628
- var RelatedBlock = function RelatedBlock(_ref) {
1629
- var _ref$block = _ref.block,
1630
- _ref$block$data = _ref$block.data,
1631
- title = _ref$block$data.title,
1632
- related = _ref$block$data.related,
1633
- onlyOn = _ref$block.only_on,
1634
- styleContext = _ref.styleContext;
1635
- var classNames = [[styles$q.root, true], [styles$q[onlyOn], true]];
1636
-
1637
- if (styleContext) {
1638
- classNames = makeStyleContext(classNames, styleContext, styles$q);
1639
- }
1640
-
1641
- return React.createElement("div", {
1642
- "data-testid": "related-block",
1643
- className: makeClassName(classNames)
1644
- }, React.createElement("h3", {
1645
- className: styles$q.header
1646
- }, title), React.createElement("ul", {
1647
- className: styles$q.items
1648
- }, related.map(function (item, index) {
1649
- return React.createElement("li", {
1650
- key: item.id || index,
1651
- className: styles$q[item.layout]
1652
- }, React.createElement(Link, {
1653
- to: item.full_url || "/" + item.url
1654
- }, React.createElement("span", {
1655
- className: styles$q.first
1656
- }, item.title), item.second_title && ' ', item.second_title && React.createElement("span", null, item.second_title)));
1657
- })));
1658
- };
1659
-
1660
- var styles$r = {"root":"SourceBlock-module_root__1P3XD","text":"SourceBlock-module_text__Si4vm","origin":"SourceBlock-module_origin__l3JbO","center":"SourceBlock-module_center__3P93B","mobile":"SourceBlock-module_mobile__2gw4S","desktop":"SourceBlock-module_desktop__DecT6","isDark":"SourceBlock-module_isDark__3hEEp"};
1661
-
1662
- var SourceBlock = function SourceBlock(_ref) {
1663
- var _ref$block = _ref.block,
1664
- onlyOn = _ref$block.only_on,
1665
- _ref$block$data = _ref$block.data,
1666
- quote = _ref$block$data.quote,
1667
- origin = _ref$block$data.origin,
1668
- url = _ref$block$data.url,
1669
- styleContext = _ref.styleContext;
1670
- var classNames = [[styles$r.root, true], [styles$r[onlyOn], true]];
1671
-
1672
- if (styleContext) {
1673
- classNames = makeStyleContext(classNames, styleContext, styles$r);
1674
- }
1675
-
1676
- return React.createElement("blockquote", {
1677
- "data-testid": "source-block",
1678
- cite: url,
1679
- className: makeClassName(classNames)
1680
- }, React.createElement("a", {
1681
- className: styles$r.text,
1682
- href: url,
1683
- target: "_blank",
1684
- rel: "noopener noreferrer"
1685
- }, quote.map(function (item, index) {
1686
- return React.createElement("p", {
1687
- key: index,
1688
- dangerouslySetInnerHTML: {
1689
- __html: item.data
1690
- }
1691
- });
1692
- }), React.createElement("footer", null, React.createElement("cite", {
1693
- className: styles$r.origin
1694
- }, origin))));
1695
- };
1696
-
1697
- var styles$s = {"root":"SensitiveBlock-module_root__2iJbD","container":"SensitiveBlock-module_container__1Wtix","overlay":"SensitiveBlock-module_overlay__hfDVS","content":"SensitiveBlock-module_content__sNpxZ","button":"SensitiveBlock-module_button__3BGZK","default":"SensitiveBlock-module_default__2HgmZ","full":"SensitiveBlock-module_full__3Hph9","media":"SensitiveBlock-module_media__3wnlo","super_full":"SensitiveBlock-module_super_full__14UOv","visible":"SensitiveBlock-module_visible__1B-NV","isInCard":"SensitiveBlock-module_isInCard__1L-lu","isInSlide":"SensitiveBlock-module_isInSlide__f_Ql2"};
1698
-
1699
- var SensitiveBlock = function SensitiveBlock(_ref) {
1700
- var block = _ref.block,
1701
- _ref$block = _ref.block,
1702
- cc = _ref$block.cc,
1703
- caption = _ref$block.caption,
1704
- credit = _ref$block.credit,
1705
- blurredImage = _ref$block.blurred_image,
1706
- display = _ref.block.item.data.display,
1707
- styleContext = _ref.styleContext;
1708
-
1709
- var _useState = useState(false),
1710
- visible = _useState[0],
1711
- isVisible = _useState[1];
1712
-
1713
- var handleClick = function handleClick() {
1714
- isVisible(true);
1715
- };
1716
-
1717
- var classNames = [[styles$s.root, true], [styles$s.visible, visible], [styles$s[display], display && styles$s[display]]];
1718
- var context = ['isInSensitiveBlock'];
1719
-
1720
- if (styleContext) {
1721
- classNames = makeStyleContext(classNames, styleContext, styles$s);
1722
- context = [].concat(styleContext, ['isInSensitiveBlock']);
1723
- }
1724
-
1725
- return React.createElement("div", {
1726
- "data-testid": "sensitive-block",
1727
- className: makeClassName(classNames)
1728
- }, React.createElement("div", {
1729
- className: styles$s.container
1730
- }, React.createElement("div", {
1731
- className: styles$s.overlay,
1732
- style: {
1733
- backgroundImage: "url(" + blurredImage + ")"
1734
- }
1735
- }, React.createElement("div", {
1736
- className: styles$s.content
1737
- }, React.createElement("p", {
1738
- dangerouslySetInnerHTML: {
1739
- __html: block.title
1740
- }
1741
- }), React.createElement("div", {
1742
- className: styles$s.button
1743
- }, React.createElement(Button, {
1744
- onClick: function onClick() {
1745
- return handleClick();
1746
- },
1747
- theme: "light"
1748
- }, block.button.text)))), React.createElement("div", {
1749
- className: styles$s.media
1750
- }, React.createElement(EmbedBlockContainer, {
1751
- block: block.item,
1752
- styleContext: context
1753
- }))), cc && React.createElement("figcaption", {
1754
- className: styles$s.figcaption
1755
- }, React.createElement(MediaCaption, {
1756
- credit: credit,
1757
- caption: caption,
1758
- styleContext: styleContext
1759
- })));
1760
- };
1761
-
1762
- var styles$t = {"root":"GroupedBlock-module_root__2qfQA","hasFigcaption":"GroupedBlock-module_hasFigcaption__2_mcf","item":"GroupedBlock-module_item__3sz9_","items":"GroupedBlock-module_items__2DV2X","figcaption":"GroupedBlock-module_figcaption__2Q_wf","default":"GroupedBlock-module_default__3ylw_","full":"GroupedBlock-module_full__1dzQR","super_full":"GroupedBlock-module_super_full__1PU72","mobile":"GroupedBlock-module_mobile__3n8Ub","desktop":"GroupedBlock-module_desktop__6ZRpA"};
1763
-
1764
- var GroupedBlock = function GroupedBlock(_ref) {
1765
- var block = _ref.block,
1766
- onlyOn = _ref.block.only_on,
1767
- styleContext = _ref.styleContext;
1768
- var maxHeight = Math.min.apply(Math, block.data.map(function (item) {
1769
- return item.data && item.data.height || item.item && item.item.data.height;
1770
- }));
1771
- var normalizedBoxesWidth = block.data.map(function (item) {
1772
- var width = item.data && item.data.width || item.item && item.item.data.heigh;
1773
- var height = item.data && item.data.height || item.item && item.item.data.heigh;
1774
- return width / (height / maxHeight);
1775
- });
1776
- var sumWidth = normalizedBoxesWidth.reduce(function (sum, x) {
1777
- return sum + x;
1778
- });
1779
- var classNames = [[styles$t.root, true], [styles$t[onlyOn], true], [styles$t.hasFigcaption, block.cc === 'default'], [styles$t[block.display], !!block.display && styles$t[block.display]]];
1780
-
1781
- if (styleContext) {
1782
- classNames = makeStyleContext(classNames, styleContext, styles$t);
1783
- }
1784
-
1785
- return React.createElement("div", {
1786
- "data-testid": "grouped-block",
1787
- className: makeClassName(classNames)
1788
- }, React.createElement("div", {
1789
- className: styles$t.items
1790
- }, block.data.map(function (item, index) {
1791
- var percentWidth = normalizedBoxesWidth[index] / sumWidth * 100;
1792
- return React.createElement("div", {
1793
- className: styles$t.item,
1794
- key: item.id,
1795
- style: {
1796
- width: percentWidth + "%"
1797
- }
1798
- }, item.type === 'sensitive' ? React.createElement(SensitiveBlock, {
1799
- block: item,
1800
- styleContext: ['isInGroupedBlock']
1801
- }) : React.createElement(EmbedBlockContainer, {
1802
- block: item,
1803
- styleContext: ['isInGroupedBlock']
1804
- }));
1805
- })), block.cc && React.createElement("figcaption", {
1806
- className: styles$t.figcaption
1807
- }, React.createElement(MediaCaption, {
1808
- credit: block.credit,
1809
- caption: block.caption,
1810
- styleContext: styleContext
1811
- })));
1812
- };
1813
-
1814
- var styles$u = {"root":"MetaItem-module_root__2VQom","hasBullets":"MetaItem-module_hasBullets__CkQPI","hasSource":"MetaItem-module_hasSource__1DmCI","listened":"MetaItem-module_listened__lwvAO","read":"MetaItem-module_read__5eAIG","datetime":"MetaItem-module_datetime__3tOWm"};
1815
-
1816
- var MetaItem = function MetaItem(_ref) {
1817
- var hasSource = _ref.hasSource,
1818
- type = _ref.type,
1819
- children = _ref.children,
1820
- bullets = _ref.bullets;
1821
- var classNames = [[styles$u.root, true], [styles$u[type], !!type && !!styles$u[type]], [styles$u.hasSource, !!hasSource], [styles$u.hasBullets, !!bullets]];
1822
- return React.createElement("div", {
1823
- "data-testid": "meta-item",
1824
- className: makeClassName(classNames)
1825
- }, children);
1826
- };
1827
-
1828
- var styles$v = {"root":"MetaItemLive-module_root__2mpD3","gold":"MetaItemLive-module_gold__3yZEV","frame":"MetaItemLive-module_frame__1H_Ha","liveMiddle":"MetaItemLive-module_liveMiddle__wyuV3","liveFirstWave":"MetaItemLive-module_liveFirstWave__3dbvz","liveSecondWave":"MetaItemLive-module_liveSecondWave__12g57"};
1829
-
1830
- var MetaItemLive = function MetaItemLive(_ref) {
1831
- var _ref$theme = _ref.theme,
1832
- theme = _ref$theme === void 0 ? 'gold' : _ref$theme;
1833
- var classNames = [[styles$v.root, true], [styles$v[theme], !!theme && styles$v[theme]]];
1834
- return React.createElement("div", {
1835
- "data-testid": "meta-item-live",
1836
- "data-meta": "live",
1837
- className: makeClassName(classNames)
1838
- }, React.createElement("div", {
1839
- className: styles$v.frame
1840
- }));
1841
- };
1842
-
1843
- var pluralize = function pluralize(number, one, two, five) {
1844
- var n = Math.abs(number);
1845
- n %= 100;
1846
-
1847
- if (n >= 5 && n <= 20) {
1848
- return five;
1849
- }
1850
-
1851
- n %= 10;
1852
-
1853
- if (n === 1) {
1854
- return one;
1855
- }
1856
-
1857
- if (n >= 2 && n <= 4) {
1858
- return two;
1859
- }
1860
-
1861
- return five;
1862
- };
1863
-
1864
- var styles$w = {"root":"DocumentItemsCount-module_root__P3q-z","items":"DocumentItemsCount-module_items__3pfxW"};
1865
-
1866
- var DocumentItemsCount = function DocumentItemsCount(_ref) {
1867
- var type = _ref.type,
1868
- _ref$lang = _ref.lang,
1869
- lang = _ref$lang === void 0 ? 'ru' : _ref$lang,
1870
- items = _ref.items,
1871
- children = _ref.children;
1872
- var i18n = {
1873
- ru: {
1874
- card: {
1875
- one: 'карточка',
1876
- two: 'карточки',
1877
- five: 'карточек'
1878
- },
1879
- podcast: {
1880
- one: 'эпизод',
1881
- two: 'эпизода',
1882
- five: 'эпизодов'
1883
- }
1884
- },
1885
- en: {
1886
- card: {
1887
- one: 'card',
1888
- two: 'cards',
1889
- five: 'cards'
1890
- },
1891
- podcast: {
1892
- one: 'episode',
1893
- two: 'episodes',
1894
- five: 'episodes'
1895
- }
1896
- }
1897
- };
1898
- var itemsCount = items + " " + pluralize(items, i18n[lang][type].one, i18n[lang][type].two, i18n[lang][type].five);
1899
- return React.createElement("div", {
1900
- "data-testid": "document-items-count",
1901
- className: styles$w.root
1902
- }, children, React.createElement("span", {
1903
- className: styles$w.items
1904
- }, itemsCount));
1905
- };
1906
-
1907
- var MetaContainer = function MetaContainer(_ref) {
1908
- var lang = _ref.lang,
1909
- block = _ref.block,
1910
- isRead = _ref.isRead,
1911
- isListened = _ref.isListened,
1912
- bookmarkAction = _ref.bookmarkAction,
1913
- isInBookmarks = _ref.isInBookmarks,
1914
- _ref$block$data = _ref.block.data,
1915
- components = _ref$block$data.components,
1916
- theme = _ref$block$data.theme,
1917
- styleContext = _ref.styleContext;
1918
- var themeColor = styleContext && styleContext.indexOf('dark') !== -1 ? 'light' : 'unset';
1919
- var isPodcast = styleContext && styleContext.indexOf('podcast') !== -1;
1920
- var isSlides = styleContext && styleContext.indexOf('slide') !== -1;
1921
- var context = [];
1922
-
1923
- if (styleContext && Array.isArray(styleContext)) {
1924
- context = styleContext.filter(function (item) {
1925
- return item !== 'dark';
1926
- });
1927
- }
1928
-
1929
- var hasSource = !!components.find(function (item) {
1930
- return item.type === 'source_name';
1931
- });
1932
- return React.createElement(Meta, {
1933
- styleContext: context,
1934
- theme: theme || themeColor,
1935
- onlyOn: block.only_on,
1936
- hasSource: hasSource
1937
- }, components.map(function (component) {
1938
- switch (component.type) {
1939
- case 'source_name':
1940
- {
1941
- return React.createElement(MetaItem, {
1942
- hasSource: hasSource,
1943
- bullets: true,
1944
- key: component.id
1945
- }, React.createElement(React.Fragment, null, lang === 'ru' ? 'Источник: ' : 'Source: ', component.url && React.createElement("a", {
1946
- href: component.url,
1947
- rel: "noopener noreferrer",
1948
- target: "_blank"
1949
- }, component.text), !component.url && component.text));
1950
- }
1951
-
1952
- case 'duration':
1953
- {
1954
- return React.createElement(MetaItem, {
1955
- hasSource: hasSource,
1956
- bullets: true,
1957
- key: component.id
1958
- }, React.createElement(React.Fragment, null, React.createElement(SvgSymbol, {
1959
- icon: "podcast",
1960
- size: "small"
1961
- }), component.text));
1962
- }
1963
-
1964
- case 'datetime':
1965
- {
1966
- var format = component.format && toCamel(component.format) || 'date';
1967
- return React.createElement(MetaItem, {
1968
- hasSource: hasSource,
1969
- bullets: true,
1970
- key: component.id,
1971
- type: "datetime"
1972
- }, React.createElement(Timestamp, {
1973
- publishedAt: component.datetime,
1974
- type: format || 'date',
1975
- locale: lang
1976
- }));
1977
- }
1978
-
1979
- case 'items_count':
1980
- {
1981
- return React.createElement(MetaItem, {
1982
- hasSource: hasSource,
1983
- bullets: true,
1984
- key: component.id
1985
- }, React.createElement(DocumentItemsCount, {
1986
- items: component.count,
1987
- type: isPodcast ? 'podcast' : 'card',
1988
- lang: lang
1989
- }, React.createElement(SvgSymbol, {
1990
- icon: "card",
1991
- size: "unset"
1992
- })));
1993
- }
1994
-
1995
- case 'broadcast_active':
1996
- {
1997
- return React.createElement(MetaItem, {
1998
- hasSource: hasSource,
1999
- bullets: true,
2000
- key: component.id
2001
- }, React.createElement(React.Fragment, null, React.createElement(MetaItemLive, null), " \u041F\u0440\u044F\u043C\u043E\u0439 \u044D\u0444\u0438\u0440"));
2002
- }
2003
-
2004
- case 'broadcast':
2005
- {
2006
- return React.createElement(MetaItem, {
2007
- hasSource: hasSource,
2008
- bullets: true,
2009
- key: component.id
2010
- }, React.createElement(React.Fragment, null, component.with_icon && React.createElement(MetaItemLive, null), component.label));
2011
- }
2012
-
2013
- default:
2014
- {
2015
- return null;
2016
- }
2017
- }
2018
- }), (isRead || isListened) && React.createElement(MetaItem, {
2019
- hasSource: hasSource,
2020
- bullets: true,
2021
- type: isListened ? 'listened' : 'read'
2022
- }, React.createElement(SvgSymbol, {
2023
- icon: isListened ? 'listened' : 'read',
2024
- size: "unset"
2025
- })), isSlides && lang === 'ru' && React.createElement("div", {
2026
- className: styles$g.bookmark
2027
- }, React.createElement(BookmarkButton, {
2028
- isInBookmarks: isInBookmarks,
2029
- onClick: function onClick() {
2030
- return bookmarkAction('bookmark', 'top');
2031
- }
2032
- })));
2033
- };
2034
-
2035
- var styles$x = {"root":"DonatesTeaser-module_root__3rtaJ","main":"DonatesTeaser-module_main__YBt6p","title":"DonatesTeaser-module_title__hs-yr","text":"DonatesTeaser-module_text__ro-QA","cta":"DonatesTeaser-module_cta__1orPb","center":"DonatesTeaser-module_center__2Ynx9","isInCard":"DonatesTeaser-module_isInCard__HrFh8","isInSlide":"DonatesTeaser-module_isInSlide__1vC4Z","ru":"DonatesTeaser-module_ru__3Gr0n","en":"DonatesTeaser-module_en__2HSwc"};
2036
-
2037
- var DonatesTeaser = function DonatesTeaser(_ref) {
2038
- var styleContext = _ref.styleContext,
2039
- _ref$lang = _ref.lang,
2040
- lang = _ref$lang === void 0 ? 'ru' : _ref$lang;
2041
- var classNames = [[styles$x.root, true], [styles$x[lang], styles$x[lang]]];
2042
-
2043
- if (styleContext) {
2044
- classNames = makeStyleContext(classNames, styleContext, styles$x);
2045
- }
2046
-
2047
- var data = {
2048
- ru: {
2049
- title: '«Медуза». Работаем 24/7. И&nbsp;только&nbsp;в&nbsp;интересах читателей',
2050
- subtitle: 'Нам срочно нужна ваша поддержка',
2051
- button: 'Хочу помочь',
2052
- href: 'https://support.meduza.io/'
2053
- },
2054
- en: {
2055
- title: 'Meduza, working 24/7, always&nbsp;for our readers',
2056
- subtitle: 'We&nbsp;need&nbsp;your&nbsp;help like never&nbsp;before',
2057
- button: 'Okay!',
2058
- href: 'https://support.meduza.io/en'
2059
- }
2060
- };
2061
- return React.createElement("div", {
2062
- "data-testid": "donates-teaser",
2063
- className: makeClassName(classNames)
2064
- }, React.createElement("div", {
2065
- className: styles$x.main
2066
- }, React.createElement("h3", {
2067
- className: styles$x.title
2068
- }, React.createElement("span", {
2069
- dangerouslySetInnerHTML: {
2070
- __html: data[lang].title
2071
- }
2072
- }), " ", React.createElement("span", {
2073
- className: styles$x.text,
2074
- dangerouslySetInnerHTML: {
2075
- __html: data[lang].subtitle
2076
- }
2077
- }))), React.createElement("div", {
2078
- className: styles$x.cta
2079
- }, React.createElement("a", {
2080
- href: data[lang].href,
2081
- target: "_blank",
2082
- rel: "noreferrer"
2083
- }, React.createElement("span", null, data[lang].button))));
2084
- };
2085
-
2086
- var styles$y = {"root":"AnnouncementInText-module_root__3zM9x","body":"AnnouncementInText-module_body__1yI8T","title":"AnnouncementInText-module_title__29CXr","footer":"AnnouncementInText-module_footer__1fyWt","button":"AnnouncementInText-module_button__2dEXa","link":"AnnouncementInText-module_link__1GxOy","center":"AnnouncementInText-module_center__3VLl2","isInCard":"AnnouncementInText-module_isInCard__2Xq_I","isInSlide":"AnnouncementInText-module_isInSlide__1PsC2","ru":"AnnouncementInText-module_ru__3vDy7","en":"AnnouncementInText-module_en__1Mgvm"};
2087
-
2088
- var AnnouncementInText = function AnnouncementInText(_ref) {
2089
- var styleContext = _ref.styleContext,
2090
- _ref$lang = _ref.lang,
2091
- lang = _ref$lang === void 0 ? 'ru' : _ref$lang;
2092
- var classNames = [[styles$y.root, true], [styles$y[lang], styles$y[lang]]];
2093
-
2094
- if (styleContext) {
2095
- classNames = makeStyleContext(classNames, styleContext, styles$y);
2096
- }
2097
-
2098
- var data = {
2099
- ru: {
2100
- title: '&laquo;Медуза&raquo; заблокирована в&nbsp;России. Мы&nbsp;были к&nbsp;этому готовы&nbsp;&mdash; и&nbsp;продолжаем работать. Несмотря&nbsp;ни&nbsp;на&nbsp;что',
2101
- text: '<p>Нам нужна ваша помощь как никогда. Прямо сейчас. Дальше всем нам будет еще труднее. Мы&nbsp;независимое издание и&nbsp;работаем только в&nbsp;интересах читателей.</p>',
2102
- button: 'Хочу помочь',
2103
- href: 'https://mdza.io/yiNxPZ7Bs-k'
2104
- },
2105
- en: {
2106
- title: 'Meduza has been blocked in Russia. We&nbsp;were ready for this and our work continues, no matter what, but we need your support like never before. ',
2107
- text: '<p>We need it now. Tomorrow could be too late. We are an independent publication, and we work only in the interests of our readers. Many&nbsp;of&nbsp;our&nbsp;readers in Russia can no longer contribute, so we turn to you, our audience around the world.</p>',
2108
- button: 'I want to help',
2109
- href: 'https://support.meduza.io/en'
2110
- }
2111
- };
2112
- var localeData = data[lang];
2113
- return React.createElement("div", {
2114
- "data-testid": "announcement-in-text",
2115
- className: makeClassName(classNames)
2116
- }, React.createElement("div", {
2117
- className: styles$y.body
2118
- }, React.createElement("h3", {
2119
- className: styles$y.title,
2120
- dangerouslySetInnerHTML: {
2121
- __html: localeData.title
2122
- }
2123
- }), React.createElement("div", {
2124
- dangerouslySetInnerHTML: {
2125
- __html: localeData.text
2126
- }
2127
- })), React.createElement("div", {
2128
- className: styles$y.footer
2129
- }, React.createElement("a", {
2130
- className: styles$y.link,
2131
- href: localeData.href,
2132
- target: "_blank",
2133
- rel: "noreferrer"
2134
- }, React.createElement("span", null, localeData.button)), React.createElement("span", {
2135
- className: styles$y.button
2136
- }, React.createElement("span", null, localeData.button))));
2137
- };
2138
-
2139
- var RenderBlocks = function RenderBlocks(_ref) {
2140
- var block = _ref.block,
2141
- styleContext = _ref.styleContext,
2142
- lang = _ref.lang,
2143
- isRead = _ref.isRead,
2144
- isListened = _ref.isListened,
2145
- bookmarkAction = _ref.bookmarkAction,
2146
- isInBookmarks = _ref.isInBookmarks;
2147
-
2148
- switch (block.type) {
2149
- case 'tag':
2150
- {
2151
- return React.createElement(Tag, {
2152
- size: "large",
2153
- onlyOn: block.only_on,
2154
- theme: block.data.theme,
2155
- styleContext: styleContext
2156
- }, block.data.text);
2157
- }
2158
-
2159
- case 'simple_title':
2160
- {
2161
- return React.createElement(SimpleTitle, {
2162
- block: block,
2163
- styleContext: styleContext
2164
- });
2165
- }
2166
-
2167
- case 'rich_title':
2168
- {
2169
- return React.createElement(RichTitle, {
2170
- block: block,
2171
- styleContext: styleContext
2172
- });
2173
- }
2174
-
2175
- case 'meta':
2176
- {
2177
- return React.createElement(MetaContainer, {
2178
- block: block,
2179
- lang: block.data.lang,
2180
- styleContext: styleContext,
2181
- isRead: isRead,
2182
- isListened: isListened,
2183
- isInBookmarks: isInBookmarks,
2184
- bookmarkAction: bookmarkAction
2185
- });
2186
- }
2187
-
2188
- case 'h1':
2189
- case 'h2':
2190
- case 'h3':
2191
- case 'h4':
2192
- case 'blockquote':
2193
- case 'p':
2194
- case 'context_p':
2195
- case 'divider':
2196
- case 'lead':
2197
- case 'lead_hr':
2198
- {
2199
- return React.createElement(SimpleBlock, {
2200
- block: block,
2201
- styleContext: styleContext
2202
- });
2203
- }
2204
-
2205
- case 'quote':
2206
- return React.createElement(QuoteBlock, {
2207
- block: block,
2208
- styleContext: styleContext
2209
- });
2210
-
2211
- case 'ol':
2212
- case 'ul':
2213
- {
2214
- return React.createElement(ListBlock, {
2215
- block: block,
2216
- styleContext: styleContext
2217
- });
2218
- }
2219
-
2220
- case 'chapter-subtitle':
2221
- {
2222
- return React.createElement(ChapterBlock, {
2223
- block: block,
2224
- styleContext: styleContext
2225
- });
2226
- }
2227
-
2228
- case 'card_title':
2229
- {
2230
- return React.createElement(CardTitle, {
2231
- block: block,
2232
- styleContext: styleContext
2233
- });
2234
- }
2235
-
2236
- case 'related':
2237
- {
2238
- return React.createElement(RelatedBlock, {
2239
- block: block,
2240
- styleContext: styleContext
2241
- });
2242
- }
2243
-
2244
- case 'source':
2245
- return React.createElement(SourceBlock, {
2246
- block: block,
2247
- styleContext: styleContext
2248
- });
2249
-
2250
- case 'table':
2251
- return React.createElement(Table, {
2252
- block: block,
2253
- styleContext: styleContext
2254
- });
2255
-
2256
- case 'sensitive':
2257
- return React.createElement(SensitiveBlock, {
2258
- block: block,
2259
- styleContext: styleContext
2260
- });
2261
-
2262
- case 'embed':
2263
- case 'embed_code':
2264
- case 'game_embed':
2265
- case 'image':
2266
- case 'dots_on_image':
2267
- case 'gif':
2268
- return React.createElement(EmbedBlockContainer, {
2269
- block: block,
2270
- styleContext: styleContext,
2271
- lang: lang
2272
- });
2273
-
2274
- case 'grouped':
2275
- return React.createElement(GroupedBlock, {
2276
- block: block,
2277
- styleContext: styleContext
2278
- });
2279
-
2280
- case 'donation':
2281
- return React.createElement(DonatesTeaser, {
2282
- styleContext: styleContext,
2283
- lang: lang
2284
- });
2285
-
2286
- case 'material_note':
2287
- return React.createElement(MaterialNote, {
2288
- block: block,
2289
- styleContext: styleContext
2290
- });
2291
-
2292
- case 'announcement_in_text':
2293
- return React.createElement(AnnouncementInText, {
2294
- styleContext: styleContext,
2295
- lang: lang
2296
- });
2297
-
2298
- default:
2299
- {
2300
- return null;
2301
- }
2302
- }
2303
- };
2304
-
2305
- var styles$z = {"root":"Cover-module_root__18Z8J","body":"Cover-module_body__1xs8e","image":"Cover-module_image__2f3Qc","rich":"Cover-module_rich__1fAGA","dark":"Cover-module_dark__2Ac-w","light":"Cover-module_light__FUp5X","control":"Cover-module_control__VXbhi","isInDynamicBlock":"Cover-module_isInDynamicBlock__3eghb","mobile":"Cover-module_mobile__5DKa1","desktop":"Cover-module_desktop__2mrOc"};
2306
-
2307
- var Cover = function Cover(_ref) {
2308
- var _ref$block = _ref.block,
2309
- onlyOn = _ref$block.only_on,
2310
- _ref$block$data = _ref$block.data,
2311
- blocks = _ref$block$data.blocks,
2312
- _ref$block$data$cover = _ref$block$data.cover,
2313
- credit = _ref$block$data$cover.credit,
2314
- caption = _ref$block$data$cover.caption,
2315
- urls = _ref$block$data$cover.urls,
2316
- mobileRatio = _ref$block$data$cover.mobile_ratio,
2317
- gradients = _ref$block$data$cover.gradients,
2318
- cc = _ref$block$data$cover.cc,
2319
- styleContext = _ref.styleContext;
2320
-
2321
- var _useState = useState(false),
2322
- isPopoverShown = _useState[0],
2323
- setIsPopoverShown = _useState[1];
2324
-
2325
- var style = {};
2326
- var classNames = [[styles$z.root, true], [styles$z[onlyOn], !!onlyOn && !!styles$z[onlyOn]]];
2327
-
2328
- if (styleContext) {
2329
- classNames = makeStyleContext(classNames, styleContext, styles$z);
2330
- }
2331
-
2332
- if (gradients) {
2333
- var theme = [gradients.text_rgb === '0,0,0' ? 'dark' : 'light'];
2334
- classNames = makeStyleContext(classNames, theme, styles$z);
2335
- style.backgroundImage = generateGradient(gradients.bg_rgb, 'mediaBlockBottom');
2336
- }
2337
-
2338
- var renderCC = function renderCC(context) {
2339
- return React.createElement(MediaCaption, {
2340
- credit: credit,
2341
- caption: caption,
2342
- styleContext: context || styleContext
2343
- });
2344
- };
2345
-
2346
- return React.createElement("div", {
2347
- "data-testid": "cover",
2348
- className: makeClassName(classNames)
2349
- }, React.createElement("div", {
2350
- className: styles$z.image
2351
- }, React.createElement(Image, {
2352
- optimized: urls,
2353
- ratio: mobileRatio,
2354
- display: "narrow"
2355
- })), React.createElement("div", {
2356
- className: styles$z.body,
2357
- style: style
2358
- }, blocks.map(function (item) {
2359
- return React.createElement(RenderBlocks, {
2360
- key: item.id,
2361
- block: item,
2362
- styleContext: styleContext
2363
- });
2364
- })), cc === 'button' && React.createElement("button", {
2365
- className: styles$z.control,
2366
- type: "button",
2367
- "aria-label": "Open",
2368
- onClick: function onClick() {
2369
- setIsPopoverShown(!isPopoverShown);
2370
- }
2371
- }), cc === 'button' && isPopoverShown && React.createElement(Popover, {
2372
- onClose: function onClose() {
2373
- setIsPopoverShown(false);
2374
- }
2375
- }, renderCC('isInPopover')));
2376
- };
2377
-
2378
- var styles$A = {"root":"HalfBlock-module_root__2frv2","main":"HalfBlock-module_main__2XX73","body":"HalfBlock-module_body__3MnEN","footer":"HalfBlock-module_footer__1C0yp","image":"HalfBlock-module_image__2lYel","mobile":"HalfBlock-module_mobile__2latf","desktop":"HalfBlock-module_desktop__3B1Ej"};
2379
-
2380
- var HalfBlock = function HalfBlock(_ref) {
2381
- var _ref$block = _ref.block,
2382
- onlyOn = _ref$block.only_on,
2383
- data = _ref$block.data,
2384
- _ref$block$data$cover = _ref$block.data.cover,
2385
- optimized = _ref$block$data$cover.optimized,
2386
- ratio = _ref$block$data$cover.ratio,
2387
- credit = _ref$block$data$cover.credit,
2388
- caption = _ref$block$data$cover.caption,
2389
- styleContext = _ref.styleContext;
2390
- var classNames = [[styles$A.root, true], [styles$A[onlyOn], true]];
2391
-
2392
- if (styleContext) {
2393
- classNames = makeStyleContext(classNames, styleContext, styles$A);
2394
- }
2395
-
2396
- return React.createElement("div", {
2397
- "data-testid": "half-block",
2398
- className: makeClassName(classNames)
2399
- }, React.createElement("div", {
2400
- className: styles$A.main
2401
- }, React.createElement("div", {
2402
- className: styles$A.image
2403
- }, React.createElement(Image, {
2404
- optimized: optimized,
2405
- ratio: ratio,
2406
- display: "super_full"
2407
- })), React.createElement("div", {
2408
- className: styles$A.body
2409
- }, data.blocks.map(function (item) {
2410
- return React.createElement(RenderBlocks, {
2411
- key: item.id,
2412
- block: item,
2413
- styleContext: ['rich']
2414
- });
2415
- }))), React.createElement("div", {
2416
- className: styles$A.footer
2417
- }, React.createElement(MediaCaption, {
2418
- credit: credit,
2419
- caption: caption,
2420
- styleContext: styleContext
2421
- })));
2422
- };
2423
-
2424
- var styles$B = {"root":"ImportantLead-module_root__2BdT3","slide":"ImportantLead-module_slide__3kQ9x","mobile":"ImportantLead-module_mobile__3BXbm","desktop":"ImportantLead-module_desktop__3Zljc"};
2425
-
2426
- var ImportantLead = function ImportantLead(_ref) {
2427
- var _ref$block = _ref.block,
2428
- onlyOn = _ref$block.only_on,
2429
- data = _ref$block.data,
2430
- styleContext = _ref.styleContext;
2431
- var classNames = [[styles$B.root, true], [styles$B[onlyOn], !!onlyOn]];
2432
-
2433
- if (styleContext) {
2434
- classNames = makeStyleContext(classNames, styleContext, styles$B);
2435
- }
2436
-
2437
- return React.createElement("div", {
2438
- "data-testid": "important-lead",
2439
- className: makeClassName(classNames)
2440
- }, data.map(function (item) {
2441
- return React.createElement(RenderBlocks, {
2442
- key: item.id,
2443
- block: item,
2444
- styleContext: "isInImportantLead"
2445
- });
2446
- }));
2447
- };
2448
-
2449
- var styles$C = {"root":"Spoiler-module_root__1OfSR","header":"Spoiler-module_header__1rZUs","body":"Spoiler-module_body__Q1e_c","spoiled":"Spoiler-module_spoiled__1A5r4","footer":"Spoiler-module_footer__23mh7","spoilerSticky":"Spoiler-module_spoilerSticky__3Kd30","spoilerStickyBg":"Spoiler-module_spoilerStickyBg__nYdlo","center":"Spoiler-module_center__tq1m0","full":"Spoiler-module_full__1QFqR","default":"Spoiler-module_default__2Kjx8","mobile":"Spoiler-module_mobile__2BPt8","desktop":"Spoiler-module_desktop__1BIFJ"};
2450
-
2451
- var Spoiler = function Spoiler(_ref) {
2452
- var _ref$block = _ref.block,
2453
- display = _ref$block.display,
2454
- button = _ref$block.button,
2455
- onlyOn = _ref$block.only_on,
2456
- buttonTitle = _ref$block.btn_title,
2457
- title = _ref$block.title,
2458
- blocks = _ref$block.blocks,
2459
- styleContext = _ref.styleContext;
2460
-
2461
- var _useState = useState(false),
2462
- spoiled = _useState[0],
2463
- setSpoiled = _useState[1];
2464
-
2465
- var ref = useRef(null);
2466
-
2467
- var handleButtonClick = function handleButtonClick() {
2468
- setSpoiled(!spoiled);
2469
-
2470
- if (spoiled) {
2471
- postMessage('', 'closeSpoiler', 'click');
2472
- var rect = ref.current.getBoundingClientRect();
2473
-
2474
- if (rect.top < 0) {
2475
- ref.current.scrollIntoView({
2476
- behavior: 'smooth'
2477
- });
2478
- }
2479
- } else {
2480
- postMessage('', 'openSpoiler', 'click');
2481
- }
2482
- };
2483
-
2484
- var classNames = [[styles$C.root, true], [styles$C[onlyOn], !!onlyOn], [styles$C[display], !!display && styles$C[display]], [[styles$C.spoiled], !!spoiled]];
2485
- var context = ['center'];
2486
-
2487
- if (styleContext) {
2488
- classNames = makeStyleContext(classNames, styleContext, styles$C);
2489
- }
2490
-
2491
- var buttonCollapse = button ? button.collapse : 'Свернуть';
2492
- var buttonExpande = button ? button.expand : buttonTitle;
2493
- return React.createElement("div", {
2494
- ref: ref,
2495
- className: makeClassName(classNames),
2496
- "data-testid": "spoiler"
2497
- }, React.createElement("div", {
2498
- className: styles$C.header
2499
- }, title && React.createElement("h3", null, title)), React.createElement("div", {
2500
- className: styles$C.body
2501
- }, blocks.map(function (item) {
2502
- return React.createElement(RenderBlocks, {
2503
- key: item.id,
2504
- block: item,
2505
- styleContext: context
2506
- });
2507
- })), React.createElement("div", {
2508
- className: styles$C.footer
2509
- }, React.createElement(Button, {
2510
- size: "default",
2511
- theme: "gray",
2512
- onClick: function onClick() {
2513
- return handleButtonClick();
2514
- },
2515
- styleContext: "isInSpoiler"
2516
- }, spoiled ? buttonCollapse : buttonExpande, React.createElement(SvgSymbol, {
2517
- icon: "arrow"
2518
- }))));
2519
- };
2520
-
2521
- var styles$D = {"root":"RelatedRichBlock-module_root__3NYmj","wrapper":"RelatedRichBlock-module_wrapper__1eLIQ","overlay":"RelatedRichBlock-module_overlay__3XSg_","overlayHeader":"RelatedRichBlock-module_overlayHeader__2Nmbv","body":"RelatedRichBlock-module_body__1ZHZS","isRich":"RelatedRichBlock-module_isRich__1LnA4","hasGradient":"RelatedRichBlock-module_hasGradient__27LOk","picture":"RelatedRichBlock-module_picture__128HJ","isCard":"RelatedRichBlock-module_isCard__2naDz","cover":"RelatedRichBlock-module_cover__3yygp","tag":"RelatedRichBlock-module_tag__3OLyG","center":"RelatedRichBlock-module_center__197sx","dark":"RelatedRichBlock-module_dark__3Y1fE","light":"RelatedRichBlock-module_light__2mUxL","mobile":"RelatedRichBlock-module_mobile__JpCS4","desktop":"RelatedRichBlock-module_desktop__trL0D"};
2522
-
2523
- /* eslint-disable react/jsx-no-target-blank */
2524
- var RelatedRichBlock = function RelatedRichBlock(_ref) {
2525
- var _ref$block = _ref.block,
2526
- onlyOn = _ref$block.only_on,
2527
- _ref$block$data = _ref$block.data,
2528
- blocks = _ref$block$data.blocks,
2529
- url = _ref$block$data.url,
2530
- _ref$block$data$cover = _ref$block$data.cover,
2531
- urls = _ref$block$data$cover.urls,
2532
- gradients = _ref$block$data$cover.gradients,
2533
- tag = _ref$block$data$cover.tag,
2534
- layout = _ref$block$data$cover.layout,
2535
- ratio = _ref$block$data$cover.ratio,
2536
- styleContext = _ref.styleContext;
2537
- var style = {};
2538
- var styleHeader = {};
2539
- var cardType = "is" + toCapitalize(layout);
2540
-
2541
- var _useInView = useInView({
2542
- threshold: 0,
2543
- triggerOnce: true
2544
- }),
2545
- ref = _useInView[0],
2546
- inView = _useInView[1];
2547
-
2548
- useEffect(function () {
2549
- if (inView) {
2550
- if (onlyOn === 'mobile' && window.innerWidth <= 511 || onlyOn === 'desktop' && window.innerWidth >= 512 || !onlyOn) {
2551
- postMessage('richRelated', url, 'view');
2552
- }
2553
- }
2554
- }, [inView]);
2555
-
2556
- var handleClick = function handleClick() {
2557
- postMessage('richRelated', url, 'click');
2558
- };
2559
-
2560
- var classNames = [[styles$D.root, true], [styles$D[cardType], !!layout && !!styles$D[cardType]], [styles$D.hasGradient, !!gradients], [styles$D[onlyOn], !!onlyOn && !!styles$D[onlyOn]]];
2561
- var context = ['isInMediaBlock'];
2562
-
2563
- if (styleContext) {
2564
- classNames = makeStyleContext(classNames, styleContext, styles$D);
2565
- context = [].concat(styleContext, ['isInMediaBlock']);
2566
- }
2567
-
2568
- if (gradients) {
2569
- styleHeader.backgroundImage = generateGradient(gradients.bg_rgb, 'mediaBlockTop');
2570
- var theme = [gradients.text_rgb === '0,0,0' ? 'dark' : 'light'];
2571
- classNames = makeStyleContext(classNames, theme, styles$D);
2572
-
2573
- if (onlyOn === 'desktop') {
2574
- style.backgroundImage = generateGradient(gradients.bg_rgb, 'mediaBlockBottom');
2575
- }
2576
- }
2577
-
2578
- return React.createElement(Link, {
2579
- "data-testid": "related-rich-block",
2580
- className: makeClassName(classNames),
2581
- to: "/" + url,
2582
- onClick: function onClick() {
2583
- return handleClick();
2584
- },
2585
- ref: ref
2586
- }, layout === 'rich' && React.createElement(React.Fragment, null, React.createElement("div", {
2587
- className: styles$D.overlay,
2588
- style: style
2589
- }), React.createElement("div", {
2590
- className: styles$D.overlayHeader,
2591
- style: styleHeader
2592
- })), React.createElement("div", {
2593
- className: styles$D.tag
2594
- }, React.createElement(Tag, {
2595
- size: "small",
2596
- theme: "inherit",
2597
- styleContext: "richRelated"
2598
- }, tag)), React.createElement("div", {
2599
- className: styles$D.cover
2600
- }, React.createElement("div", {
2601
- className: styles$D.picture
2602
- }, React.createElement(Image, {
2603
- optimized: urls,
2604
- ratio: ratio,
2605
- display: "narrow"
2606
- }))), React.createElement("div", {
2607
- className: styles$D.body
2608
- }, blocks.map(function (item) {
2609
- return React.createElement(RenderBlocks, {
2610
- key: item.id,
2611
- block: item,
2612
- styleContext: context
2613
- });
2614
- })));
2615
- };
2616
-
2617
- var styles$E = {"root":"ShopRelatedBlock-module_root__x4vdk","wrapper":"ShopRelatedBlock-module_wrapper__3jQp9","overlay":"ShopRelatedBlock-module_overlay__15S5a","overlayHeader":"ShopRelatedBlock-module_overlayHeader__2IXK-","body":"ShopRelatedBlock-module_body__3ipYj","hasGradient":"ShopRelatedBlock-module_hasGradient__1pghj","picture":"ShopRelatedBlock-module_picture__1bu9H","tag":"ShopRelatedBlock-module_tag__2vTKm","center":"ShopRelatedBlock-module_center__2H85-","title":"ShopRelatedBlock-module_title__1ZIW0","price":"ShopRelatedBlock-module_price__2cVXM","dark":"ShopRelatedBlock-module_dark__3Gfbc","light":"ShopRelatedBlock-module_light__1y8Qy","mobile":"ShopRelatedBlock-module_mobile__AleU0","desktop":"ShopRelatedBlock-module_desktop__2--zA"};
2618
-
2619
- /* eslint-disable react/jsx-no-target-blank */
2620
- var ShopRelatedBlock = function ShopRelatedBlock(_ref) {
2621
- var _ref$block = _ref.block,
2622
- onlyOn = _ref$block.only_on,
2623
- _ref$block$data = _ref$block.data,
2624
- url = _ref$block$data.url,
2625
- _ref$block$data$cover = _ref$block$data.cover,
2626
- urls = _ref$block$data$cover.urls,
2627
- gradients = _ref$block$data$cover.gradients,
2628
- tag = _ref$block$data$cover.tag,
2629
- layout = _ref$block$data$cover.layout,
2630
- ratio = _ref$block$data$cover.ratio,
2631
- firstTitle = _ref$block$data$cover.first_title,
2632
- secondTitle = _ref$block$data$cover.second_title,
2633
- styleContext = _ref.styleContext;
2634
- var style = {};
2635
- var styleHeader = {};
2636
-
2637
- var _useInView = useInView({
2638
- threshold: 0,
2639
- triggerOnce: true
2640
- }),
2641
- ref = _useInView[0],
2642
- inView = _useInView[1];
2643
-
2644
- useEffect(function () {
2645
- if (inView) {
2646
- if (onlyOn === 'mobile' && window.innerWidth <= 511 || onlyOn === 'desktop' && window.innerWidth >= 512 || !onlyOn) {
2647
- postMessage('productRelated', url, 'view');
2648
- }
2649
- }
2650
- }, [inView]);
2651
-
2652
- var handleClick = function handleClick() {
2653
- postMessage('productRelated', url, 'click');
2654
- };
2655
-
2656
- var classNames = [[styles$E.root, true], [styles$E.hasGradient, !!gradients], [styles$E[onlyOn], !!onlyOn && !!styles$E[onlyOn]]];
2657
-
2658
- if (styleContext) {
2659
- classNames = makeStyleContext(classNames, styleContext, styles$E);
2660
- }
2661
-
2662
- if (gradients) {
2663
- styleHeader.backgroundImage = generateGradient(gradients.bg_rgb, 'mediaBlockTop');
2664
- var theme = [gradients.text_rgb === '0,0,0' ? 'dark' : 'light'];
2665
- classNames = makeStyleContext(classNames, theme, styles$E);
2666
-
2667
- if (onlyOn === 'desktop') {
2668
- style.backgroundImage = generateGradient(gradients.bg_rgb, 'mediaBlockBottom');
2669
- }
2670
- }
2671
-
2672
- return React.createElement("a", {
2673
- "data-testid": "related-rich-block",
2674
- className: makeClassName(classNames),
2675
- href: url,
2676
- target: "_blank",
2677
- onClick: function onClick() {
2678
- return handleClick();
2679
- },
2680
- ref: ref
2681
- }, layout === 'rich' && React.createElement(React.Fragment, null, React.createElement("div", {
2682
- className: styles$E.overlay,
2683
- style: style
2684
- }), React.createElement("div", {
2685
- className: styles$E.overlayHeader,
2686
- style: styleHeader
2687
- })), React.createElement("div", {
2688
- className: styles$E.tag
2689
- }, React.createElement(Tag, {
2690
- size: "small",
2691
- theme: "inherit",
2692
- styleContext: "richRelated"
2693
- }, tag)), React.createElement("div", {
2694
- className: styles$E.cover
2695
- }, React.createElement("div", {
2696
- className: styles$E.picture
2697
- }, React.createElement(Image, {
2698
- optimized: urls,
2699
- ratio: ratio,
2700
- display: "narrow"
2701
- }))), React.createElement("div", {
2702
- className: styles$E.body
2703
- }, React.createElement("h2", {
2704
- className: styles$E.title
2705
- }, firstTitle, React.createElement("span", {
2706
- className: styles$E.price
2707
- }, secondTitle))));
2708
- };
2709
-
2710
- var RawHtmlBlock = function RawHtmlBlock(_ref) {
2711
- var block = _ref.block,
2712
- styleContext = _ref.styleContext,
2713
- isRead = _ref.isRead,
2714
- isListened = _ref.isListened,
2715
- isInBookmarks = _ref.isInBookmarks,
2716
- bookmarkAction = _ref.bookmarkAction,
2717
- lightBox = _ref.lightBox,
2718
- lang = _ref.lang;
2719
- var context = {
2720
- lightBox: lightBox || null
2721
- };
2722
-
2723
- switch (block.type) {
2724
- case 'important_lead':
2725
- {
2726
- return React.createElement(ImportantLead, {
2727
- block: block,
2728
- styleContext: styleContext
2729
- });
2730
- }
2731
-
2732
- case 'spoiler':
2733
- {
2734
- return React.createElement(BlockProvider, {
2735
- value: context
2736
- }, React.createElement(Spoiler, {
2737
- block: block,
2738
- styleContext: styleContext
2739
- }));
2740
- }
2741
-
2742
- case 'cover':
2743
- {
2744
- return React.createElement(Cover, {
2745
- block: block,
2746
- styleContext: styleContext
2747
- });
2748
- }
2749
-
2750
- case 'half':
2751
- {
2752
- return React.createElement(HalfBlock, {
2753
- block: block,
2754
- styleContext: styleContext
2755
- });
2756
- }
2757
-
2758
- case 'related_rich':
2759
- {
2760
- return React.createElement(RelatedRichBlock, {
2761
- block: block,
2762
- styleContext: styleContext
2763
- });
2764
- }
2765
-
2766
- case 'related_shop':
2767
- {
2768
- return React.createElement(ShopRelatedBlock, {
2769
- block: block,
2770
- styleContext: styleContext
2771
- });
2772
- }
2773
-
2774
- default:
2775
- {
2776
- return React.createElement(BlockProvider, {
2777
- value: context
2778
- }, React.createElement(RenderBlocks, {
2779
- block: block,
2780
- styleContext: styleContext,
2781
- isRead: isRead,
2782
- isListened: isListened,
2783
- isInBookmarks: isInBookmarks,
2784
- bookmarkAction: bookmarkAction,
2785
- lang: lang
2786
- }));
2787
- }
2788
- }
2789
- };
2790
-
2791
- var styles$F = {"root":"ToolbarButton-module_root__xN-fq","isDark":"ToolbarButton-module_isDark__2q5U7","dark":"ToolbarButton-module_dark__GrIOr","bookmark":"ToolbarButton-module_bookmark__3369b","isActive":"ToolbarButton-module_isActive__3NLAE","icon":"ToolbarButton-module_icon__4wCid","text":"ToolbarButton-module_text__32m6s"};
2792
-
2793
- var ToolbarButton = function ToolbarButton(_ref) {
2794
- var type = _ref.type,
2795
- theme = _ref.theme,
2796
- isActive = _ref.isActive,
2797
- _ref$lang = _ref.lang,
2798
- lang = _ref$lang === void 0 ? 'ru' : _ref$lang,
2799
- text = _ref.text,
2800
- icon = _ref.icon,
2801
- _onClick = _ref.onClick;
2802
- var classNames = [[styles$F.root, true], [styles$F[type], !!styles$F[type]], [styles$F[theme], !!styles$F[theme] && !!theme], [styles$F.isActive, !!isActive]];
2803
- var label = SocialLabels[lang][type];
2804
- return React.createElement("button", {
2805
- "data-testid": "toolbar-button",
2806
- className: makeClassName(classNames),
2807
- type: "button",
2808
- onClick: function onClick(event) {
2809
- return _onClick(event, type);
2810
- }
2811
- }, icon && React.createElement("div", {
2812
- className: styles$F.icon
2813
- }, React.createElement(SvgSymbol, {
2814
- size: "medium",
2815
- icon: icon,
2816
- styleContext: "isInToolbar"
2817
- })), React.createElement("span", {
2818
- className: styles$F.text
2819
- }, text || label));
2820
- };
2821
-
2822
- var styles$G = {"root":"Tooltip-module_root__2ErmQ","isCenterBottom":"Tooltip-module_isCenterBottom__3qg-Z","isLeftBottom":"Tooltip-module_isLeftBottom__2d0hw","isCenterTop":"Tooltip-module_isCenterTop__3gKNn","isLeftTop":"Tooltip-module_isLeftTop__2_Evh","body":"Tooltip-module_body__es5-o","footer":"Tooltip-module_footer__1nYQ1"};
2823
-
2824
- var capitalizeFirstLetter = function capitalizeFirstLetter(string) {
2825
- return string.charAt(0).toUpperCase() + string.slice(1);
2826
- };
2827
-
2828
- var Tooltip = function Tooltip(_ref) {
2829
- var children = _ref.children,
2830
- position = _ref.position;
2831
- var x = position[0],
2832
- y = position[1];
2833
- var positionClass = "is" + capitalizeFirstLetter(x) + capitalizeFirstLetter(y);
2834
- return React.createElement("div", {
2835
- className: makeClassName([[styles$G.root, true], [styles$G[positionClass], true]])
2836
- }, React.createElement("div", {
2837
- className: styles$G.body
2838
- }, children));
2839
- };
2840
-
2841
- var TooltipFooter = function TooltipFooter(_ref) {
2842
- var children = _ref.children;
2843
- return React.createElement("div", {
2844
- className: styles$G.footer
2845
- }, children);
2846
- };
2847
-
2848
- export { AnnouncementInText, BookmarkButton, Button, ButtonLoader, CardTitle, ChapterBlock, Cover, DocumentItemsCount, DonatesTeaser, DotsOnImage, Dropdown, EmbedBlockContainer, Footnote, GroupedBlock, HalfBlock, Image, ImportantLead, Lazy, ListBlock, MaterialNote, MaterialTitle, MediaCaption, Menu, Meta, MetaItem, MetaItemLive, Popover, Primary, QuoteBlock, RawHtmlBlock, RelatedBlock, RelatedRichBlock, RenderBlocks, RichTitle, Secondary, SensitiveBlock, ShopRelatedBlock, SimpleBlock, SimpleTitle, SourceBlock, Spoiler, SvgSymbol, Switcher, Table, Tag, Timestamp, Toolbar, ToolbarButton, ToolbarItem, Tooltip, TooltipFooter };
2849
- //# sourceMappingURL=ui-kit-2.esm.js.map