@simai-studio/chat 0.0.0-stage → 1.0.0

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 (261) hide show
  1. package/LICENSE.md +182 -0
  2. package/README.md +65 -2
  3. package/dist/package-receipt.json +1551 -0
  4. package/dist/set.json +105 -0
  5. package/dist/smart/chat-composer/aliases.json +56 -0
  6. package/dist/smart/chat-composer/aliases.json.gz +0 -0
  7. package/dist/smart/chat-composer/component.json +658 -0
  8. package/dist/smart/chat-composer/component.json.gz +0 -0
  9. package/dist/smart/chat-composer/css/chat-composer.css +318 -0
  10. package/dist/smart/chat-composer/css/chat-composer.css.gz +0 -0
  11. package/dist/smart/chat-composer/css/chat-composer.min.css +2 -0
  12. package/dist/smart/chat-composer/css/chat-composer.min.css.gz +0 -0
  13. package/dist/smart/chat-composer/examples.json +531 -0
  14. package/dist/smart/chat-composer/examples.json.gz +0 -0
  15. package/dist/smart/chat-composer/js/chat-composer.js +1023 -0
  16. package/dist/smart/chat-composer/js/chat-composer.js.gz +0 -0
  17. package/dist/smart/chat-composer/js/chat-composer.min.js +75 -0
  18. package/dist/smart/chat-composer/js/chat-composer.min.js.gz +0 -0
  19. package/dist/smart/chat-composer/lang/en.json +31 -0
  20. package/dist/smart/chat-composer/lang/en.json.gz +0 -0
  21. package/dist/smart/chat-composer/lang/ru.json +31 -0
  22. package/dist/smart/chat-composer/lang/ru.json.gz +0 -0
  23. package/dist/smart/chat-composer/probe.json +400 -0
  24. package/dist/smart/chat-composer/probe.json.gz +0 -0
  25. package/dist/smart/chat-composer/smart.manifest.json +625 -0
  26. package/dist/smart/chat-composer/smart.manifest.json.gz +0 -0
  27. package/dist/smart/chat-composer/static/default/busy.html +20 -0
  28. package/dist/smart/chat-composer/static/default/busy.html.gz +0 -0
  29. package/dist/smart/chat-composer/static/default/disabled.html +20 -0
  30. package/dist/smart/chat-composer/static/default/disabled.html.gz +0 -0
  31. package/dist/smart/chat-composer/static/default/files.html +44 -0
  32. package/dist/smart/chat-composer/static/default/files.html.gz +0 -0
  33. package/dist/smart/chat-composer/static/default/near-limit.html +20 -0
  34. package/dist/smart/chat-composer/static/default/near-limit.html.gz +0 -0
  35. package/dist/smart/chat-composer/static/default/reference.html +20 -0
  36. package/dist/smart/chat-composer/static/default/reference.html.gz +0 -0
  37. package/dist/smart/chat-composer/static/sheets.json +88 -0
  38. package/dist/smart/chat-composer/static/sheets.json.gz +0 -0
  39. package/dist/smart/chat-composer/studio.fixture.json +18 -0
  40. package/dist/smart/chat-composer/studio.fixture.json.gz +0 -0
  41. package/dist/smart/chat-composer/studio.scenario.json +37 -0
  42. package/dist/smart/chat-composer/studio.scenario.json.gz +0 -0
  43. package/dist/smart/chat-composer/template/default.css +273 -0
  44. package/dist/smart/chat-composer/template/default.css.gz +0 -0
  45. package/dist/smart/chat-composer/template/default.js +109 -0
  46. package/dist/smart/chat-composer/template/default.js.gz +0 -0
  47. package/dist/smart/chat-composer/template/parts.js +82 -0
  48. package/dist/smart/chat-composer/template/parts.js.gz +0 -0
  49. package/dist/smart/chat-interlocutor/aliases.json +20 -0
  50. package/dist/smart/chat-interlocutor/aliases.json.gz +0 -0
  51. package/dist/smart/chat-interlocutor/component.json +435 -0
  52. package/dist/smart/chat-interlocutor/component.json.gz +0 -0
  53. package/dist/smart/chat-interlocutor/css/chat-interlocutor.css +107 -0
  54. package/dist/smart/chat-interlocutor/css/chat-interlocutor.css.gz +0 -0
  55. package/dist/smart/chat-interlocutor/css/chat-interlocutor.min.css +2 -0
  56. package/dist/smart/chat-interlocutor/css/chat-interlocutor.min.css.gz +0 -0
  57. package/dist/smart/chat-interlocutor/examples.json +379 -0
  58. package/dist/smart/chat-interlocutor/examples.json.gz +0 -0
  59. package/dist/smart/chat-interlocutor/js/chat-interlocutor.js +531 -0
  60. package/dist/smart/chat-interlocutor/js/chat-interlocutor.js.gz +0 -0
  61. package/dist/smart/chat-interlocutor/js/chat-interlocutor.min.js +22 -0
  62. package/dist/smart/chat-interlocutor/js/chat-interlocutor.min.js.gz +0 -0
  63. package/dist/smart/chat-interlocutor/lang/en.json +13 -0
  64. package/dist/smart/chat-interlocutor/lang/en.json.gz +0 -0
  65. package/dist/smart/chat-interlocutor/lang/ru.json +13 -0
  66. package/dist/smart/chat-interlocutor/lang/ru.json.gz +0 -0
  67. package/dist/smart/chat-interlocutor/probe.json +204 -0
  68. package/dist/smart/chat-interlocutor/probe.json.gz +0 -0
  69. package/dist/smart/chat-interlocutor/smart.manifest.json +406 -0
  70. package/dist/smart/chat-interlocutor/smart.manifest.json.gz +0 -0
  71. package/dist/smart/chat-interlocutor/static/default/former.html +10 -0
  72. package/dist/smart/chat-interlocutor/static/default/former.html.gz +0 -0
  73. package/dist/smart/chat-interlocutor/static/default/grouped.html +10 -0
  74. package/dist/smart/chat-interlocutor/static/default/grouped.html.gz +0 -0
  75. package/dist/smart/chat-interlocutor/static/default/reference.html +10 -0
  76. package/dist/smart/chat-interlocutor/static/default/reference.html.gz +0 -0
  77. package/dist/smart/chat-interlocutor/static/default/single.html +10 -0
  78. package/dist/smart/chat-interlocutor/static/default/single.html.gz +0 -0
  79. package/dist/smart/chat-interlocutor/static/sheets.json +105 -0
  80. package/dist/smart/chat-interlocutor/static/sheets.json.gz +0 -0
  81. package/dist/smart/chat-interlocutor/studio.fixture.json +25 -0
  82. package/dist/smart/chat-interlocutor/studio.fixture.json.gz +0 -0
  83. package/dist/smart/chat-interlocutor/studio.scenario.json +41 -0
  84. package/dist/smart/chat-interlocutor/studio.scenario.json.gz +0 -0
  85. package/dist/smart/chat-interlocutor/template/default.css +58 -0
  86. package/dist/smart/chat-interlocutor/template/default.css.gz +0 -0
  87. package/dist/smart/chat-interlocutor/template/default.js +43 -0
  88. package/dist/smart/chat-interlocutor/template/default.js.gz +0 -0
  89. package/dist/smart/chat-message/aliases.json +114 -0
  90. package/dist/smart/chat-message/aliases.json.gz +0 -0
  91. package/dist/smart/chat-message/component.json +822 -0
  92. package/dist/smart/chat-message/component.json.gz +0 -0
  93. package/dist/smart/chat-message/css/chat-message.css +3291 -0
  94. package/dist/smart/chat-message/css/chat-message.css.gz +0 -0
  95. package/dist/smart/chat-message/css/chat-message.min.css +2 -0
  96. package/dist/smart/chat-message/css/chat-message.min.css.gz +0 -0
  97. package/dist/smart/chat-message/examples.json +1604 -0
  98. package/dist/smart/chat-message/examples.json.gz +0 -0
  99. package/dist/smart/chat-message/js/chat-message.js +5498 -0
  100. package/dist/smart/chat-message/js/chat-message.js.gz +0 -0
  101. package/dist/smart/chat-message/js/chat-message.min.js +25 -0
  102. package/dist/smart/chat-message/js/chat-message.min.js.gz +0 -0
  103. package/dist/smart/chat-message/lang/en.json +181 -0
  104. package/dist/smart/chat-message/lang/en.json.gz +0 -0
  105. package/dist/smart/chat-message/lang/ru.json +185 -0
  106. package/dist/smart/chat-message/lang/ru.json.gz +0 -0
  107. package/dist/smart/chat-message/probe.json +1029 -0
  108. package/dist/smart/chat-message/probe.json.gz +0 -0
  109. package/dist/smart/chat-message/smart.manifest.json +814 -0
  110. package/dist/smart/chat-message/smart.manifest.json.gz +0 -0
  111. package/dist/smart/chat-message/static/default/brief-card.html +2 -0
  112. package/dist/smart/chat-message/static/default/brief-card.html.gz +0 -0
  113. package/dist/smart/chat-message/static/default/brief-questions.html +2 -0
  114. package/dist/smart/chat-message/static/default/brief-questions.html.gz +0 -0
  115. package/dist/smart/chat-message/static/default/deliverables.html +2 -0
  116. package/dist/smart/chat-message/static/default/deliverables.html.gz +0 -0
  117. package/dist/smart/chat-message/static/default/document.html +13 -0
  118. package/dist/smart/chat-message/static/default/document.html.gz +0 -0
  119. package/dist/smart/chat-message/static/default/failed.html +2 -0
  120. package/dist/smart/chat-message/static/default/failed.html.gz +0 -0
  121. package/dist/smart/chat-message/static/default/feedback-reason.html +2 -0
  122. package/dist/smart/chat-message/static/default/feedback-reason.html.gz +0 -0
  123. package/dist/smart/chat-message/static/default/limit.html +2 -0
  124. package/dist/smart/chat-message/static/default/limit.html.gz +0 -0
  125. package/dist/smart/chat-message/static/default/proposal.html +42 -0
  126. package/dist/smart/chat-message/static/default/proposal.html.gz +0 -0
  127. package/dist/smart/chat-message/static/default/question.html +18 -0
  128. package/dist/smart/chat-message/static/default/question.html.gz +0 -0
  129. package/dist/smart/chat-message/static/default/reference.html +2 -0
  130. package/dist/smart/chat-message/static/default/reference.html.gz +0 -0
  131. package/dist/smart/chat-message/static/default/steps.html +2 -0
  132. package/dist/smart/chat-message/static/default/steps.html.gz +0 -0
  133. package/dist/smart/chat-message/static/default/stopped.html +2 -0
  134. package/dist/smart/chat-message/static/default/stopped.html.gz +0 -0
  135. package/dist/smart/chat-message/static/default/waiting.html +2 -0
  136. package/dist/smart/chat-message/static/default/waiting.html.gz +0 -0
  137. package/dist/smart/chat-message/static/person/person-own.html +2 -0
  138. package/dist/smart/chat-message/static/person/person-own.html.gz +0 -0
  139. package/dist/smart/chat-message/static/person/person-reply.html +6 -0
  140. package/dist/smart/chat-message/static/person/person-reply.html.gz +0 -0
  141. package/dist/smart/chat-message/static/person/person.html +14 -0
  142. package/dist/smart/chat-message/static/person/person.html.gz +0 -0
  143. package/dist/smart/chat-message/static/sheets.json +398 -0
  144. package/dist/smart/chat-message/static/sheets.json.gz +0 -0
  145. package/dist/smart/chat-message/studio.fixture.json +27 -0
  146. package/dist/smart/chat-message/studio.fixture.json.gz +0 -0
  147. package/dist/smart/chat-message/studio.scenario.json +22 -0
  148. package/dist/smart/chat-message/studio.scenario.json.gz +0 -0
  149. package/dist/smart/chat-message/template/default.css +1895 -0
  150. package/dist/smart/chat-message/template/default.css.gz +0 -0
  151. package/dist/smart/chat-message/template/default.js +27 -0
  152. package/dist/smart/chat-message/template/default.js.gz +0 -0
  153. package/dist/smart/chat-message/template/person.js +11 -0
  154. package/dist/smart/chat-message/template/person.js.gz +0 -0
  155. package/dist/smart/chat-threads/aliases.json +174 -0
  156. package/dist/smart/chat-threads/aliases.json.gz +0 -0
  157. package/dist/smart/chat-threads/component.json +1232 -0
  158. package/dist/smart/chat-threads/component.json.gz +0 -0
  159. package/dist/smart/chat-threads/css/chat-threads.css +150 -0
  160. package/dist/smart/chat-threads/css/chat-threads.css.gz +0 -0
  161. package/dist/smart/chat-threads/css/chat-threads.min.css +2 -0
  162. package/dist/smart/chat-threads/css/chat-threads.min.css.gz +0 -0
  163. package/dist/smart/chat-threads/examples.json +689 -0
  164. package/dist/smart/chat-threads/examples.json.gz +0 -0
  165. package/dist/smart/chat-threads/js/chat-threads.js +859 -0
  166. package/dist/smart/chat-threads/js/chat-threads.js.gz +0 -0
  167. package/dist/smart/chat-threads/js/chat-threads.min.js +39 -0
  168. package/dist/smart/chat-threads/js/chat-threads.min.js.gz +0 -0
  169. package/dist/smart/chat-threads/lang/en.json +18 -0
  170. package/dist/smart/chat-threads/lang/en.json.gz +0 -0
  171. package/dist/smart/chat-threads/lang/ru.json +18 -0
  172. package/dist/smart/chat-threads/lang/ru.json.gz +0 -0
  173. package/dist/smart/chat-threads/probe.json +406 -0
  174. package/dist/smart/chat-threads/probe.json.gz +0 -0
  175. package/dist/smart/chat-threads/smart.manifest.json +1152 -0
  176. package/dist/smart/chat-threads/smart.manifest.json.gz +0 -0
  177. package/dist/smart/chat-threads/static/default/activity.html +139 -0
  178. package/dist/smart/chat-threads/static/default/activity.html.gz +0 -0
  179. package/dist/smart/chat-threads/static/default/activity.skeleton.html +139 -0
  180. package/dist/smart/chat-threads/static/default/activity.skeleton.html.gz +0 -0
  181. package/dist/smart/chat-threads/static/default/archive.html +55 -0
  182. package/dist/smart/chat-threads/static/default/archive.html.gz +0 -0
  183. package/dist/smart/chat-threads/static/default/archive.skeleton.html +55 -0
  184. package/dist/smart/chat-threads/static/default/archive.skeleton.html.gz +0 -0
  185. package/dist/smart/chat-threads/static/default/avatars.html +104 -0
  186. package/dist/smart/chat-threads/static/default/avatars.html.gz +0 -0
  187. package/dist/smart/chat-threads/static/default/avatars.skeleton.html +104 -0
  188. package/dist/smart/chat-threads/static/default/avatars.skeleton.html.gz +0 -0
  189. package/dist/smart/chat-threads/static/default/empty.html +48 -0
  190. package/dist/smart/chat-threads/static/default/empty.html.gz +0 -0
  191. package/dist/smart/chat-threads/static/default/loading.html +48 -0
  192. package/dist/smart/chat-threads/static/default/loading.html.gz +0 -0
  193. package/dist/smart/chat-threads/static/default/people.html +95 -0
  194. package/dist/smart/chat-threads/static/default/people.html.gz +0 -0
  195. package/dist/smart/chat-threads/static/default/people.skeleton.html +95 -0
  196. package/dist/smart/chat-threads/static/default/people.skeleton.html.gz +0 -0
  197. package/dist/smart/chat-threads/static/default/reference.html +114 -0
  198. package/dist/smart/chat-threads/static/default/reference.html.gz +0 -0
  199. package/dist/smart/chat-threads/static/default/reference.skeleton.html +114 -0
  200. package/dist/smart/chat-threads/static/default/reference.skeleton.html.gz +0 -0
  201. package/dist/smart/chat-threads/static/default/ungrouped.html +94 -0
  202. package/dist/smart/chat-threads/static/default/ungrouped.html.gz +0 -0
  203. package/dist/smart/chat-threads/static/default/ungrouped.skeleton.html +94 -0
  204. package/dist/smart/chat-threads/static/default/ungrouped.skeleton.html.gz +0 -0
  205. package/dist/smart/chat-threads/static/sheets.json +422 -0
  206. package/dist/smart/chat-threads/static/sheets.json.gz +0 -0
  207. package/dist/smart/chat-threads/studio.fixture.json +23 -0
  208. package/dist/smart/chat-threads/studio.fixture.json.gz +0 -0
  209. package/dist/smart/chat-threads/template/default.css +113 -0
  210. package/dist/smart/chat-threads/template/default.css.gz +0 -0
  211. package/dist/smart/chat-threads/template/default.js +62 -0
  212. package/dist/smart/chat-threads/template/default.js.gz +0 -0
  213. package/dist/smart/chat-window/aliases.json +395 -0
  214. package/dist/smart/chat-window/aliases.json.gz +0 -0
  215. package/dist/smart/chat-window/component.json +2809 -0
  216. package/dist/smart/chat-window/component.json.gz +0 -0
  217. package/dist/smart/chat-window/css/chat-window.css +1717 -0
  218. package/dist/smart/chat-window/css/chat-window.css.gz +0 -0
  219. package/dist/smart/chat-window/css/chat-window.min.css +2 -0
  220. package/dist/smart/chat-window/css/chat-window.min.css.gz +0 -0
  221. package/dist/smart/chat-window/examples.json +2798 -0
  222. package/dist/smart/chat-window/examples.json.gz +0 -0
  223. package/dist/smart/chat-window/js/chat-window.js +12382 -0
  224. package/dist/smart/chat-window/js/chat-window.js.gz +0 -0
  225. package/dist/smart/chat-window/js/chat-window.min.js +1 -0
  226. package/dist/smart/chat-window/js/chat-window.min.js.gz +0 -0
  227. package/dist/smart/chat-window/lang/en.json +212 -0
  228. package/dist/smart/chat-window/lang/en.json.gz +0 -0
  229. package/dist/smart/chat-window/lang/ru.json +218 -0
  230. package/dist/smart/chat-window/lang/ru.json.gz +0 -0
  231. package/dist/smart/chat-window/probe.json +2023 -0
  232. package/dist/smart/chat-window/probe.json.gz +0 -0
  233. package/dist/smart/chat-window/smart.manifest.json +2835 -0
  234. package/dist/smart/chat-window/smart.manifest.json.gz +0 -0
  235. package/dist/smart/chat-window/static/default/archived.html +97 -0
  236. package/dist/smart/chat-window/static/default/archived.html.gz +0 -0
  237. package/dist/smart/chat-window/static/default/embedded.html +119 -0
  238. package/dist/smart/chat-window/static/default/embedded.html.gz +0 -0
  239. package/dist/smart/chat-window/static/default/greeting.html +119 -0
  240. package/dist/smart/chat-window/static/default/greeting.html.gz +0 -0
  241. package/dist/smart/chat-window/static/default/people.html +110 -0
  242. package/dist/smart/chat-window/static/default/people.html.gz +0 -0
  243. package/dist/smart/chat-window/static/default/proposal.html +157 -0
  244. package/dist/smart/chat-window/static/default/proposal.html.gz +0 -0
  245. package/dist/smart/chat-window/static/default/reference.html +117 -0
  246. package/dist/smart/chat-window/static/default/reference.html.gz +0 -0
  247. package/dist/smart/chat-window/static/default/waiting.html +117 -0
  248. package/dist/smart/chat-window/static/default/waiting.html.gz +0 -0
  249. package/dist/smart/chat-window/static/sheets.json +476 -0
  250. package/dist/smart/chat-window/static/sheets.json.gz +0 -0
  251. package/dist/smart/chat-window/studio.fixture.json +13 -0
  252. package/dist/smart/chat-window/studio.fixture.json.gz +0 -0
  253. package/dist/smart/chat-window/studio.scenario.json +95 -0
  254. package/dist/smart/chat-window/studio.scenario.json.gz +0 -0
  255. package/dist/smart/chat-window/template/default.css +1168 -0
  256. package/dist/smart/chat-window/template/default.css.gz +0 -0
  257. package/dist/smart/chat-window/template/default.js +12 -0
  258. package/dist/smart/chat-window/template/default.js.gz +0 -0
  259. package/dist/smart/rule.js +185 -0
  260. package/dist/smart/rule.js.gz +0 -0
  261. package/package.json +29 -4
@@ -0,0 +1,1604 @@
1
+ {
2
+ "examples": [
3
+ {
4
+ "name": "reference",
5
+ "title": "Ответ с разметкой, источниками и отметкой проверки",
6
+ "settings": {
7
+ "message": {
8
+ "id": "msg_03",
9
+ "role": "assistant",
10
+ "status": "completed",
11
+ "verification": "verified",
12
+ "html": "<h2>Отпуск</h2><p>Ежегодный отпуск — <strong>28 календарных дней</strong>[1]. Перенос — по заявлению[2].</p><h3>Части отпуска</h3><p>Одна часть — <em>не меньше 14 дней</em>; правило <del>2019</del> года отменено.</p><h4>Где смотреть</h4><ul><li>Статья <code>ТК РФ 115</code></li><li><a href=\"https://example.com/plan.png\">Изображение: график отпусков</a></li></ul><table><thead><tr><th>Стаж</th><th>Дней</th></tr></thead><tbody><tr><td>до года</td><td>14</td></tr></tbody></table>",
13
+ "text": "Ежегодный отпуск — 28 календарных дней[1]. Перенос — по заявлению[2].",
14
+ "sources": [
15
+ {
16
+ "n": 1,
17
+ "kind": "base",
18
+ "title": "Положение об отпусках",
19
+ "excerpt": "Работнику предоставляется ежегодный основной оплачиваемый отпуск продолжительностью 28 календарных дней. Отпуск может быть разделён на части по соглашению сторон, при этом хотя бы одна из частей должна быть не менее 14 календарных дней."
20
+ },
21
+ {
22
+ "n": 2,
23
+ "kind": "web",
24
+ "title": "Трудовой кодекс, статья 124",
25
+ "url": "https://example.com/tk/124"
26
+ }
27
+ ],
28
+ "summary": {
29
+ "text": "Нашёл 2 источника, проверил ответ"
30
+ }
31
+ }
32
+ },
33
+ "expect": {
34
+ "name": "Помощник",
35
+ "texts": {
36
+ ".sf-chat-markup h2": "Отпуск",
37
+ ".sf-chat-chip--verified": "Проверен по источникам",
38
+ ".sf-chat-message__summary": "Нашёл 2 источника, проверил ответ"
39
+ }
40
+ },
41
+ "studio": {
42
+ "id": "message-reference",
43
+ "title": "Message reference",
44
+ "summary": "Deterministic reference fixture for sf-chat-message: a completed answer with markup, two sources and the verified mark.",
45
+ "props": {
46
+ "message": {
47
+ "id": "msg_03",
48
+ "role": "assistant",
49
+ "status": "completed",
50
+ "verification": "verified",
51
+ "html": "<p>Ежегодный отпуск — <strong>28 календарных дней</strong>[1].</p>",
52
+ "text": "Ежегодный отпуск — 28 календарных дней[1].",
53
+ "sources": [
54
+ {
55
+ "n": 1,
56
+ "kind": "base",
57
+ "title": "Положение об отпусках"
58
+ }
59
+ ]
60
+ }
61
+ },
62
+ "scenario": {}
63
+ }
64
+ },
65
+ {
66
+ "name": "waiting",
67
+ "title": "Ответ пишется: строка этапа",
68
+ "settings": {
69
+ "message": {
70
+ "id": "msg_04",
71
+ "role": "assistant",
72
+ "status": "running",
73
+ "stage": "writing"
74
+ }
75
+ },
76
+ "expect": {
77
+ "name": "Помощник",
78
+ "texts": {
79
+ ".sf-chat-stages__label": "Пишу ответ"
80
+ }
81
+ }
82
+ },
83
+ {
84
+ "name": "stopped",
85
+ "title": "Ожидание остановлено: «Обновить»",
86
+ "settings": {
87
+ "message": {
88
+ "id": "msg_05",
89
+ "role": "assistant",
90
+ "status": "running",
91
+ "stage": "searching"
92
+ },
93
+ "display": {
94
+ "wait": "stopped"
95
+ }
96
+ },
97
+ "expect": {
98
+ "name": "Помощник",
99
+ "texts": {
100
+ ".sf-chat-notice__action": "Обновить"
101
+ }
102
+ }
103
+ },
104
+ {
105
+ "name": "limit",
106
+ "title": "Лимит исчерпан",
107
+ "settings": {
108
+ "message": {
109
+ "id": "msg_06",
110
+ "role": "assistant",
111
+ "status": "limit",
112
+ "text": "Лимит вопросов на месяц исчерпан."
113
+ }
114
+ },
115
+ "expect": {
116
+ "name": "Помощник",
117
+ "texts": {
118
+ ".sf-chat-notice__text": "Лимит вопросов на месяц исчерпан."
119
+ }
120
+ }
121
+ },
122
+ {
123
+ "name": "failed",
124
+ "title": "Ошибка: «Повторить»",
125
+ "settings": {
126
+ "message": {
127
+ "id": "msg_07",
128
+ "role": "assistant",
129
+ "status": "failed",
130
+ "text": "Не удалось получить ответ."
131
+ }
132
+ },
133
+ "expect": {
134
+ "name": "Помощник",
135
+ "texts": {
136
+ ".sf-chat-notice__action": "Повторить"
137
+ }
138
+ }
139
+ },
140
+ {
141
+ "name": "question",
142
+ "title": "Вопрос с файлами",
143
+ "settings": {
144
+ "message": {
145
+ "id": "msg_01",
146
+ "role": "user",
147
+ "text": "Проверьте договор, пожалуйста",
148
+ "attachments": [
149
+ {
150
+ "id": "att_1",
151
+ "name": "Договор.pdf",
152
+ "bytes": 48213,
153
+ "href": "/files/att_1"
154
+ },
155
+ {
156
+ "id": "att_2",
157
+ "name": "Приложение.docx",
158
+ "bytes": 1572864
159
+ }
160
+ ]
161
+ }
162
+ },
163
+ "expect": {
164
+ "name": "Вы",
165
+ "texts": {
166
+ ".sf-chat-message__bubble": "Проверьте договор, пожалуйста",
167
+ ".sf-chat-attachment__link": "Договор.pdf"
168
+ }
169
+ }
170
+ },
171
+ {
172
+ "name": "proposal",
173
+ "title": "Предложение изменения",
174
+ "settings": {
175
+ "message": {
176
+ "id": "msg_08",
177
+ "role": "assistant",
178
+ "status": "completed",
179
+ "text": "Подготовил изменение отпуска.",
180
+ "proposal": {
181
+ "code": "P-17",
182
+ "title": "Перенести отпуск",
183
+ "state": "presented",
184
+ "changes": [
185
+ {
186
+ "field": "Начало",
187
+ "was": "1 июля",
188
+ "will_be": "15 июля"
189
+ }
190
+ ]
191
+ }
192
+ }
193
+ },
194
+ "expect": {
195
+ "name": "Помощник",
196
+ "texts": {
197
+ ".sf-chat-message__plain": "Подготовил изменение отпуска."
198
+ }
199
+ }
200
+ },
201
+ {
202
+ "name": "brief-questions",
203
+ "title": "Уточняющие вопросы с вариантами",
204
+ "settings": {
205
+ "features": {
206
+ "feedback": true,
207
+ "proposals": true,
208
+ "memory": true,
209
+ "brief": true
210
+ },
211
+ "message": {
212
+ "id": "msg_09",
213
+ "role": "assistant",
214
+ "status": "completed",
215
+ "text": "Нужно уточнить.",
216
+ "brief": {
217
+ "decision": "ask",
218
+ "lead": "Чтобы подготовить заявление, уточню два момента.",
219
+ "questions": [
220
+ {
221
+ "text": "С какого числа отпуск?",
222
+ "options": [
223
+ {
224
+ "label": "С 1 июля",
225
+ "detail": "как в графике"
226
+ },
227
+ {
228
+ "label": "С 15 июля"
229
+ }
230
+ ],
231
+ "recommended": 0
232
+ },
233
+ {
234
+ "text": "Нужны ли отпускные заранее?",
235
+ "options": [
236
+ {
237
+ "label": "Да"
238
+ },
239
+ {
240
+ "label": "Нет"
241
+ }
242
+ ],
243
+ "blocking": false
244
+ }
245
+ ]
246
+ }
247
+ },
248
+ "display": {
249
+ "brief": {
250
+ "live": true
251
+ }
252
+ }
253
+ },
254
+ "expect": {
255
+ "name": "Помощник",
256
+ "texts": {
257
+ ".sf-chat-message__plain": "Чтобы подготовить заявление, уточню два момента.",
258
+ ".sf-chat-brief__hint": "Ответьте на обязательные вопросы"
259
+ }
260
+ }
261
+ },
262
+ {
263
+ "name": "brief-card",
264
+ "title": "Карточка «Как я понял задачу»",
265
+ "settings": {
266
+ "features": {
267
+ "feedback": true,
268
+ "proposals": true,
269
+ "memory": true,
270
+ "brief": true
271
+ },
272
+ "message": {
273
+ "id": "msg_10",
274
+ "role": "assistant",
275
+ "status": "completed",
276
+ "text": "Проверьте, правильно ли я понял.",
277
+ "brief": {
278
+ "decision": "card",
279
+ "card": {
280
+ "goal": "Перенести отпуск на две недели",
281
+ "result": "Заявление на перенос",
282
+ "steps": [
283
+ "Найти график",
284
+ "Подготовить заявление"
285
+ ],
286
+ "assumptions": [
287
+ "Руководитель согласен"
288
+ ],
289
+ "confirm": "Да"
290
+ }
291
+ }
292
+ },
293
+ "display": {
294
+ "brief": {
295
+ "live": true
296
+ }
297
+ }
298
+ },
299
+ "expect": {
300
+ "name": "Помощник",
301
+ "texts": {
302
+ ".sf-chat-brief__text": "Как я понял задачу",
303
+ ".sf-chat-brief__send": "Да"
304
+ }
305
+ }
306
+ },
307
+ {
308
+ "name": "feedback-reason",
309
+ "title": "«Не полезно»: что не так",
310
+ "settings": {
311
+ "message": {
312
+ "id": "msg_11",
313
+ "role": "assistant",
314
+ "status": "completed",
315
+ "text": "Отпуск — 28 дней."
316
+ },
317
+ "display": {
318
+ "feedback": {
319
+ "value": "down",
320
+ "asking": true,
321
+ "draft": {
322
+ "reason": null,
323
+ "note": ""
324
+ }
325
+ }
326
+ }
327
+ },
328
+ "expect": {
329
+ "name": "Помощник",
330
+ "texts": {
331
+ ".sf-chat-reason__title": "Что не так с ответом?"
332
+ }
333
+ }
334
+ },
335
+ {
336
+ "name": "person",
337
+ "title": "Сообщение собеседника (шаблон person)",
338
+ "template": "person",
339
+ "attributes": {
340
+ "template": "person"
341
+ },
342
+ "settings": {
343
+ "message": {
344
+ "id": 41,
345
+ "body": "Посмотрите график, пожалуйста",
346
+ "authorName": "Анна Смирнова",
347
+ "canEdit": false,
348
+ "canDelete": false,
349
+ "files": [
350
+ {
351
+ "id": 7,
352
+ "name": "График.xlsx",
353
+ "size": 20480,
354
+ "state": "ready",
355
+ "downloadUrl": "/files/7"
356
+ }
357
+ ]
358
+ },
359
+ "display": {
360
+ "own": false,
361
+ "first": true,
362
+ "last": true,
363
+ "showName": true
364
+ }
365
+ },
366
+ "expect": {
367
+ "name": "Анна Смирнова",
368
+ "texts": {
369
+ ".sf-chat-person__name": "Анна Смирнова",
370
+ ".sf-chat-person__bubble": "Посмотрите график, пожалуйста"
371
+ }
372
+ }
373
+ },
374
+ {
375
+ "name": "person-own",
376
+ "title": "Своё сообщение с действиями (шаблон person)",
377
+ "template": "person",
378
+ "attributes": {
379
+ "template": "person"
380
+ },
381
+ "settings": {
382
+ "message": {
383
+ "id": 42,
384
+ "body": "Хорошо, посмотрю",
385
+ "authorName": "Вы",
386
+ "isEdited": true,
387
+ "canEdit": true,
388
+ "canDelete": true
389
+ },
390
+ "display": {
391
+ "own": true,
392
+ "first": true,
393
+ "last": true
394
+ }
395
+ },
396
+ "expect": {
397
+ "name": "Вы",
398
+ "texts": {
399
+ ".sf-chat-person__bubble": "Хорошо, посмотрю"
400
+ }
401
+ }
402
+ },
403
+ {
404
+ "name": "steps",
405
+ "title": "Ответ со строкой шагов: «Сделано за … · N шагов», свёрнуто (API.md v1.3, предложено)",
406
+ "settings": {
407
+ "message": {
408
+ "id": "msg_20",
409
+ "role": "assistant",
410
+ "status": "completed",
411
+ "html": "<p>Ежегодный отпуск — <strong>28 календарных дней</strong>[1].</p>",
412
+ "text": "Ежегодный отпуск — 28 календарных дней[1].",
413
+ "sources": [
414
+ {
415
+ "n": 1,
416
+ "kind": "base",
417
+ "title": "Положение об отпусках"
418
+ }
419
+ ],
420
+ "finished_at": "2026-10-30T10:01:40Z",
421
+ "steps": [
422
+ {
423
+ "code": "search",
424
+ "label": "Ищу в базе знаний",
425
+ "state": "done",
426
+ "started_at": "2026-10-30T10:00:00Z",
427
+ "finished_at": "2026-10-30T10:00:12Z"
428
+ },
429
+ {
430
+ "code": "read",
431
+ "label": "Читаю положение об отпусках",
432
+ "state": "done",
433
+ "started_at": "2026-10-30T10:00:12Z",
434
+ "finished_at": "2026-10-30T10:00:41Z"
435
+ },
436
+ {
437
+ "code": "check",
438
+ "label": "Проверяю по Трудовому кодексу",
439
+ "state": "done",
440
+ "started_at": "2026-10-30T10:00:41Z",
441
+ "finished_at": "2026-10-30T10:01:20Z"
442
+ },
443
+ {
444
+ "code": "write",
445
+ "label": "Пишу ответ",
446
+ "state": "done",
447
+ "started_at": "2026-10-30T10:01:20Z",
448
+ "finished_at": "2026-10-30T10:01:40Z"
449
+ }
450
+ ]
451
+ }
452
+ },
453
+ "expect": {
454
+ "name": "Помощник",
455
+ "texts": {
456
+ ".sf-chat-steps__line": "Сделано за 1 мин 40 с · 4 шага"
457
+ }
458
+ }
459
+ },
460
+ {
461
+ "name": "deliverables",
462
+ "title": "Ответ с готовыми файлами: «Что готово», «Просмотр» и «Скачать» (API.md v1.3, предложено)",
463
+ "settings": {
464
+ "message": {
465
+ "id": "msg_21",
466
+ "role": "assistant",
467
+ "status": "completed",
468
+ "html": "<p>Подготовил отчёт и график отпусков.</p>",
469
+ "text": "Подготовил отчёт и график отпусков.",
470
+ "attachments": [
471
+ {
472
+ "id": "f1",
473
+ "name": "Отчёт по отпускам.pdf",
474
+ "bytes": 248213,
475
+ "mime": "application/pdf",
476
+ "href": "/files/f1",
477
+ "preview_url": "/files/f1/preview"
478
+ },
479
+ {
480
+ "id": "f2",
481
+ "name": "График.xlsx",
482
+ "bytes": 18432,
483
+ "mime": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
484
+ "href": "/files/f2"
485
+ }
486
+ ]
487
+ }
488
+ },
489
+ "expect": {
490
+ "name": "Помощник",
491
+ "texts": {
492
+ ".sf-chat-deliverables__title": "Что готово",
493
+ ".sf-chat-deliverable__name": "Отчёт по отпускам.pdf"
494
+ }
495
+ }
496
+ },
497
+ {
498
+ "name": "document",
499
+ "title": "Ответ ИИ среди людей: документ с подписью",
500
+ "settings": {
501
+ "message": {
502
+ "id": "m7",
503
+ "role": "assistant",
504
+ "status": "completed",
505
+ "text": "Срок возврата: регламент 30 дней, шаблон 14.",
506
+ "speaker": {
507
+ "kind": "assistant",
508
+ "name": "Mirai"
509
+ },
510
+ "asked_by": {
511
+ "name": "Анны"
512
+ },
513
+ "reactions": [
514
+ {
515
+ "emoji": "👀",
516
+ "count": 1,
517
+ "mine": false
518
+ }
519
+ ]
520
+ },
521
+ "display": {
522
+ "document": true,
523
+ "showAuthor": true,
524
+ "canReact": true,
525
+ "canReply": true
526
+ }
527
+ },
528
+ "expect": {
529
+ "name": "Mirai, ИИ"
530
+ }
531
+ },
532
+ {
533
+ "name": "person-reply",
534
+ "title": "Ответ человека с цитатой и реакцией",
535
+ "template": "person",
536
+ "attributes": {
537
+ "template": "person"
538
+ },
539
+ "settings": {
540
+ "message": {
541
+ "id": 42,
542
+ "body": "Подтверждаю, срок устарел.",
543
+ "authorName": "Ольга Ким",
544
+ "reply_to": {
545
+ "id": 7,
546
+ "author": {
547
+ "name": "Mirai"
548
+ },
549
+ "text": "Срок возврата: регламент 30 дней, шаблон 14."
550
+ },
551
+ "reactions": [
552
+ {
553
+ "emoji": "👍",
554
+ "count": 3,
555
+ "mine": true
556
+ }
557
+ ]
558
+ },
559
+ "display": {
560
+ "own": false,
561
+ "first": true,
562
+ "last": true,
563
+ "showName": true,
564
+ "canReact": true,
565
+ "canReply": true
566
+ }
567
+ },
568
+ "expect": {
569
+ "name": "Ольга Ким"
570
+ }
571
+ }
572
+ ],
573
+ "pages": [
574
+ {
575
+ "name": "conformance",
576
+ "title": "sf-chat-message against component.json (standard simai.smart-component 1.3.9 §12, gate 20); the behaviour simai/ui-chat's tests/browser/staff.test.mjs and sanitize.test.mjs hold for the message view: markup, footnotes and sources, waits and notices, rating and its reason, the task brief, the proposal card, a question's files, the template person, and the sanitizer's acceptance cases",
577
+ "format": "stands/15-scenarios (A4 modal: a page, probes in steps); the runner is ui-source tests/browser/manifest-probes.browser.mjs, run for the package by scripts/run-manifest-probes.mjs",
578
+ "page": {
579
+ "lang": "ru",
580
+ "body": [
581
+ "<main>",
582
+ " <sf-chat-message id=\"d\"></sf-chat-message>",
583
+ " <sf-chat-message id=\"q\" template=\"person\"></sf-chat-message>",
584
+ " <sf-chat-message id=\"a\"></sf-chat-message>",
585
+ " <sf-chat-message id=\"b\"></sf-chat-message>",
586
+ " <sf-chat-message id=\"p\" template=\"person\"></sf-chat-message>",
587
+ " <sf-chat-message id=\"s\"></sf-chat-message>",
588
+ " <section lang=\"en\"><sf-chat-message id=\"e\"></sf-chat-message></section>",
589
+ "</main>"
590
+ ]
591
+ },
592
+ "checks": [
593
+ {
594
+ "id": "p1-markup",
595
+ "title": "the answer's html is drawn sanitized: three heading sizes, del, a table in its scrolling region, an image link with its icon and never loaded, [n] linked only where source n exists and never inside code; an unchecked answer says so under the text",
596
+ "covers": "settings.message, sanitize (h2 h3 h4 del), footnotes, runtime.verification-unverified",
597
+ "steps": [
598
+ {
599
+ "script": "(await customElements.whenDefined('sf-chat-message'), document.querySelector('#a').message = {\"id\":\"m1\",\"role\":\"assistant\",\"status\":\"completed\",\"text\":\"Отпуск — 28 дней.\",\"html\":\"<h2>Отпуск</h2><p>Ежегодный отпуск — <strong>28 календарных дней</strong>[1]. Перенос[2], а [3] — без источника.</p><p><code>a[1]</code> и <del>старое</del></p><h3>Б</h3><h4>В</h4><ul><li><a href=\\\"https://example.com/p.png\\\">Изображение: схема</a></li></ul><table><thead><tr><th>Стаж</th></tr></thead><tbody><tr><td>14</td></tr></tbody></table>\",\"verification\":\"unverified\",\"sources\":[{\"n\":1,\"kind\":\"base\",\"title\":\"Положение\"},{\"n\":2,\"kind\":\"web\",\"title\":\"ТК\",\"url\":\"https://example.com/tk\"}]}, true)",
600
+ "wait": 300,
601
+ "check": "(() => { const m = document.querySelector('#a .sf-chat-markup'); const f = [...m.querySelectorAll('.sf-chat-footnote')].map((b) => b.textContent); const img = m.querySelector('a.sf-chat-markup__image'); return m.querySelector('h2').textContent === 'Отпуск' && m.querySelector('h3') && m.querySelector('h4') && m.querySelector('del').textContent === 'старое' && f.join() === '1,2' && m.querySelector('code').textContent === 'a[1]' && m.textContent.includes('[3]') && img && img.querySelector('sf-icon[icon=image]') && !m.querySelector('img') && m.querySelector('.sf-chat-markup__table[role=region] > table') && document.querySelector('#a article').getAttribute('aria-label') === 'Помощник' && document.querySelector('#a .sf-chat-check--unverified > span').textContent === 'Не полностью проверен — уточните у специалиста'; })()"
602
+ }
603
+ ]
604
+ },
605
+ {
606
+ "id": "p2-sources",
607
+ "title": "a footnote opens the sources at its source and focuses it, sending sf-chat-message-toggle {id, kind: sources, open: true} and the 0.3 sf-chat-action {action: sources}; a long excerpt is folded to «Показать полностью» and opens in place; a web source links out",
608
+ "covers": "events.toggle, aliases sf-chat-action, runtime.sources-more, runtime.sources-less, runtime.sources-chip",
609
+ "steps": [
610
+ {
611
+ "script": "(await customElements.whenDefined('sf-chat-message'), document.querySelector('#a').message = {\"id\":\"m2\",\"role\":\"assistant\",\"status\":\"completed\",\"text\":\"Отпуск — 28 дней.\",\"html\":\"<p>Отпуск 28 дней[1], перенос[2].</p>\",\"verification\":\"verified\",\"sources\":[{\"n\":1,\"kind\":\"base\",\"title\":\"Положение\",\"excerpt\":\"Работнику предоставляется ежегодный основной оплачиваемый отпуск продолжительностью 28 календарных дней. Отпуск может быть разделён на части по соглашению сторон, при этом хотя бы одна из частей должна быть не менее 14 календарных дней.\"},{\"n\":2,\"kind\":\"web\",\"title\":\"ТК\",\"url\":\"https://example.com/tk\"}]}, true)",
612
+ "wait": 300,
613
+ "check": "(() => { const a = document.querySelector('#a'); return a.querySelector('.sf-chat-sources').hidden && a.querySelector('.sf-chat-chip--sources').getAttribute('aria-label') === 'Источники 2' && a.querySelector('.sf-chat-chip--verified') && a.querySelector('a.sf-chat-sources__title').getAttribute('rel') === 'noopener noreferrer nofollow'; })()"
614
+ },
615
+ {
616
+ "user": "click:#a .sf-chat-footnote",
617
+ "expect": {
618
+ "events": [
619
+ {
620
+ "name": "sf-chat-message-toggle",
621
+ "count": 1,
622
+ "detail": {
623
+ "id": "m2",
624
+ "kind": "sources",
625
+ "open": true
626
+ }
627
+ },
628
+ {
629
+ "name": "sf-chat-action",
630
+ "count": 1,
631
+ "detail": {
632
+ "action": "sources",
633
+ "id": "m2",
634
+ "open": true
635
+ }
636
+ }
637
+ ],
638
+ "journal": [
639
+ {
640
+ "from": "sf-chat-action",
641
+ "since": "2026-10-28",
642
+ "remove_after": "2026-12-01"
643
+ }
644
+ ]
645
+ },
646
+ "check": "(() => { const a = document.querySelector('#a'); return !a.querySelector('.sf-chat-sources').hidden && document.activeElement === a.querySelector('#m-m2-source-1') && a.querySelector('.sf-chat-chip--sources').getAttribute('aria-expanded') === 'true'; })()"
647
+ },
648
+ {
649
+ "user": "click:#a .sf-chat-sources__more",
650
+ "check": "(() => { const b = document.querySelector('#a .sf-chat-sources__more'); return b.getAttribute('aria-expanded') === 'true' && b.textContent === 'Свернуть' && !document.querySelector('#a .sf-chat-sources__excerpt--folded'); })()"
651
+ }
652
+ ]
653
+ },
654
+ {
655
+ "id": "p3-rate",
656
+ "title": "«Не полезно» sends sf-chat-message-rate {id, value: down} and the 0.3 feedback; asked why (display.feedback.asking), a reason sends drafted, «Отправить» rate {id, value: down, reason, note} (0.3 feedback-send) and Escape cancel {id, kind: rate} (0.3 feedback-skip)",
657
+ "covers": "events.rate, events.drafted, events.cancel, settings.display, aliases sf-chat-action, runtime.feedback-ask",
658
+ "steps": [
659
+ {
660
+ "script": "(await customElements.whenDefined('sf-chat-message'), document.querySelector('#a').display = {}, document.querySelector('#a').message = {\"id\":\"m3\",\"role\":\"assistant\",\"status\":\"completed\",\"text\":\"Отпуск — 28 дней.\"}, true)",
661
+ "wait": 300
662
+ },
663
+ {
664
+ "user": "click:#a [data-rating=down]",
665
+ "expect": {
666
+ "events": [
667
+ {
668
+ "name": "sf-chat-message-rate",
669
+ "count": 1,
670
+ "detail": {
671
+ "id": "m3",
672
+ "value": "down"
673
+ }
674
+ },
675
+ {
676
+ "name": "sf-chat-action",
677
+ "count": 1,
678
+ "detail": {
679
+ "action": "feedback",
680
+ "id": "m3",
681
+ "value": "down"
682
+ }
683
+ }
684
+ ],
685
+ "journal": [
686
+ {
687
+ "from": "sf-chat-action",
688
+ "since": "2026-10-28",
689
+ "remove_after": "2026-12-01"
690
+ }
691
+ ]
692
+ },
693
+ "check": "document.querySelector('#a [data-rating=down]').getAttribute('aria-pressed') === 'true'"
694
+ },
695
+ {
696
+ "script": "(document.querySelector('#a').display = {feedback: {value: 'down', asking: true, draft: {reason: null, note: ''}}}, true)",
697
+ "wait": 300,
698
+ "check": "document.querySelector('#a .sf-chat-reason__title').textContent === 'Что не так с ответом?'"
699
+ },
700
+ {
701
+ "user": "click:#a [data-reason=wrong]",
702
+ "expect": {
703
+ "events": [
704
+ {
705
+ "name": "sf-chat-message-drafted",
706
+ "count": 1,
707
+ "detail": {
708
+ "id": "m3",
709
+ "reason": "wrong",
710
+ "note": ""
711
+ }
712
+ }
713
+ ]
714
+ },
715
+ "check": "document.querySelector('#a [data-reason=wrong]').getAttribute('aria-pressed') === 'true'"
716
+ },
717
+ {
718
+ "user": "click:#a .sf-chat-reason__actions .sf-button",
719
+ "expect": {
720
+ "events": [
721
+ {
722
+ "name": "sf-chat-message-rate",
723
+ "count": 1,
724
+ "detail": {
725
+ "id": "m3",
726
+ "value": "down",
727
+ "reason": "wrong",
728
+ "note": ""
729
+ }
730
+ },
731
+ {
732
+ "name": "sf-chat-action",
733
+ "count": 1,
734
+ "detail": {
735
+ "action": "feedback-send",
736
+ "id": "m3",
737
+ "reason": "wrong"
738
+ }
739
+ }
740
+ ]
741
+ }
742
+ },
743
+ {
744
+ "script": "(document.querySelector('#a [data-reason=wrong]').focus(), true)",
745
+ "wait": 50
746
+ },
747
+ {
748
+ "user": "keyboard:Escape",
749
+ "expect": {
750
+ "events": [
751
+ {
752
+ "name": "sf-chat-message-cancel",
753
+ "count": 1,
754
+ "detail": {
755
+ "id": "m3",
756
+ "kind": "rate"
757
+ }
758
+ },
759
+ {
760
+ "name": "sf-chat-action",
761
+ "count": 1,
762
+ "detail": {
763
+ "action": "feedback-skip",
764
+ "id": "m3"
765
+ }
766
+ }
767
+ ]
768
+ }
769
+ }
770
+ ]
771
+ },
772
+ {
773
+ "id": "p4-waits-and-notices",
774
+ "title": "a running answer is aria-busy with its stage; a stopped wait offers «Обновить» (sf-chat-message-check, 0.3 check); a limit says when it renews; a failed answer offers «Повторить» (retry {id}, 0.3 retry) until display.retried",
775
+ "covers": "events.check, events.retry, runtime.stage-writing, runtime.limit-resets, display.wait, display.retried",
776
+ "steps": [
777
+ {
778
+ "script": "(await customElements.whenDefined('sf-chat-message'), document.querySelector('#a').display = {}, document.querySelector('#a').message = {id: 'm4', role: 'assistant', status: 'running', stage: 'writing'}, true)",
779
+ "wait": 300,
780
+ "check": "document.querySelector('#a article').getAttribute('aria-busy') === 'true' && document.querySelector('#a .sf-chat-stages__label').textContent === 'Пишу ответ'"
781
+ },
782
+ {
783
+ "script": "(document.querySelector('#a').display = {wait: 'stopped'}, true)",
784
+ "wait": 300,
785
+ "check": "document.querySelector('#a .sf-chat-notice--stopped .sf-chat-notice__text').textContent === 'Ожидание остановлено. Ответ может прийти позже.'"
786
+ },
787
+ {
788
+ "user": "click:#a .sf-chat-notice__action",
789
+ "expect": {
790
+ "events": [
791
+ {
792
+ "name": "sf-chat-message-check",
793
+ "count": 1,
794
+ "detail": {
795
+ "id": "m4"
796
+ }
797
+ },
798
+ {
799
+ "name": "sf-chat-action",
800
+ "count": 1,
801
+ "detail": {
802
+ "action": "check",
803
+ "id": "m4"
804
+ }
805
+ }
806
+ ]
807
+ }
808
+ },
809
+ {
810
+ "script": "(document.querySelector('#a').display = {}, document.querySelector('#a').message = {id: 'm5', role: 'assistant', status: 'limit', text: 'Лимит исчерпан.', limit_resets_at: '2026-11-01T12:00:00Z'}, true)",
811
+ "wait": 300,
812
+ "check": "document.querySelector('#a .sf-chat-notice__more').textContent.startsWith('Лимит обновится ')"
813
+ },
814
+ {
815
+ "script": "(document.querySelector('#a').message = {id: 'm6', role: 'assistant', status: 'failed', text: 'Не удалось.'}, true)",
816
+ "wait": 300,
817
+ "check": "document.querySelector('#a .sf-chat-notice--failed').getAttribute('role') === 'alert'"
818
+ },
819
+ {
820
+ "user": "click:#a .sf-chat-notice__action",
821
+ "expect": {
822
+ "events": [
823
+ {
824
+ "name": "sf-chat-message-retry",
825
+ "count": 1,
826
+ "detail": {
827
+ "id": "m6"
828
+ }
829
+ },
830
+ {
831
+ "name": "sf-chat-action",
832
+ "count": 1,
833
+ "detail": {
834
+ "action": "retry",
835
+ "id": "m6"
836
+ }
837
+ }
838
+ ]
839
+ }
840
+ },
841
+ {
842
+ "script": "(document.querySelector('#a').display = {retried: true}, true)",
843
+ "wait": 300,
844
+ "check": "!document.querySelector('#a .sf-chat-notice__action')"
845
+ }
846
+ ]
847
+ },
848
+ {
849
+ "id": "p5-brief",
850
+ "title": "the brief (features.brief, v1.2): live, two questions answer together — «Ответить» waits for the required one, then sends sf-chat-message-submit {id, text: «С 1 июля; —»} and the 0.3 brief-answer; the lead stands for the html; one question with «Свой вариант» sends the typed words on Enter; the card sends its «Да»; not live it is a record with the taken option marked",
851
+ "covers": "settings.features, display.brief, events.submit, aliases sf-chat-action, runtime.brief-*",
852
+ "steps": [
853
+ {
854
+ "script": "(await customElements.whenDefined('sf-chat-message'), document.querySelector('#b').features = {brief: true}, document.querySelector('#b').display = {brief: {live: true}}, document.querySelector('#b').message = {\"id\":\"m7\",\"role\":\"assistant\",\"status\":\"completed\",\"text\":\"Отпуск — 28 дней.\",\"html\":\"<p>длинный html</p>\",\"brief\":{\"decision\":\"ask\",\"lead\":\"Уточню два момента.\",\"questions\":[{\"text\":\"С какого числа?\",\"options\":[{\"label\":\"С 1 июля\"},{\"label\":\"С 15 июля\"}],\"recommended\":0},{\"text\":\"Отпускные заранее?\",\"options\":[{\"label\":\"Да\"}],\"blocking\":false}]}}, true)",
855
+ "wait": 300,
856
+ "check": "(() => { const b = document.querySelector('#b'); const send = b.querySelector('.sf-chat-brief__actions .sf-chat-brief__send'); return b.querySelector('.sf-chat-message__plain').textContent === 'Уточню два момента.' && !b.querySelector('.sf-chat-markup') && send.disabled && !b.querySelector('.sf-chat-brief__hint').hidden && b.querySelector('.sf-chat-brief__optional').textContent === 'необязательно'; })()"
857
+ },
858
+ {
859
+ "user": "click:#b .sf-chat-brief__question [data-option='0']",
860
+ "check": "!document.querySelector('#b .sf-chat-brief__actions .sf-chat-brief__send').disabled && document.querySelector('#b .sf-chat-brief__hint').hidden"
861
+ },
862
+ {
863
+ "user": "click:#b .sf-chat-brief__actions .sf-chat-brief__send",
864
+ "expect": {
865
+ "events": [
866
+ {
867
+ "name": "sf-chat-message-submit",
868
+ "count": 1,
869
+ "detail": {
870
+ "id": "m7",
871
+ "text": "С 1 июля; —"
872
+ }
873
+ },
874
+ {
875
+ "name": "sf-chat-action",
876
+ "count": 1,
877
+ "detail": {
878
+ "action": "brief-answer",
879
+ "id": "m7",
880
+ "text": "С 1 июля; —"
881
+ }
882
+ }
883
+ ],
884
+ "journal": [
885
+ {
886
+ "from": "sf-chat-action",
887
+ "since": "2026-10-28",
888
+ "remove_after": "2026-12-01"
889
+ }
890
+ ]
891
+ }
892
+ },
893
+ {
894
+ "script": "(document.querySelector('#b').message = {\"id\":\"m8\",\"role\":\"assistant\",\"status\":\"completed\",\"text\":\"Отпуск — 28 дней.\",\"brief\":{\"decision\":\"ask\",\"questions\":[{\"text\":\"С какого числа?\",\"options\":[{\"label\":\"С 1 июля\"}]}]}}, true)",
895
+ "wait": 300
896
+ },
897
+ {
898
+ "user": "click:#b .sf-chat-brief__toggle",
899
+ "check": "(() => { const t = document.querySelector('#b .sf-chat-brief__toggle'); return t.getAttribute('aria-expanded') === 'true' && document.activeElement === document.querySelector('#b .sf-chat-brief__other input'); })()"
900
+ },
901
+ {
902
+ "script": "(document.querySelector('#b .sf-chat-brief__other input').value = 'С 3 августа', true)",
903
+ "wait": 50
904
+ },
905
+ {
906
+ "user": "keyboard:Enter",
907
+ "expect": {
908
+ "events": [
909
+ {
910
+ "name": "sf-chat-message-submit",
911
+ "count": 1,
912
+ "detail": {
913
+ "id": "m8",
914
+ "text": "С 3 августа"
915
+ }
916
+ }
917
+ ]
918
+ }
919
+ },
920
+ {
921
+ "script": "(document.querySelector('#b').message = {\"id\":\"m9\",\"role\":\"assistant\",\"status\":\"completed\",\"text\":\"Отпуск — 28 дней.\",\"brief\":{\"decision\":\"card\",\"card\":{\"goal\":\"Перенести отпуск\",\"steps\":[\"Найти график\"],\"confirm\":\"Да\"}}}, true)",
922
+ "wait": 300,
923
+ "check": "document.querySelector('#b legend.sf-chat-brief__text').textContent === 'Как я понял задачу'"
924
+ },
925
+ {
926
+ "user": "click:#b .sf-chat-brief__send",
927
+ "expect": {
928
+ "events": [
929
+ {
930
+ "name": "sf-chat-message-submit",
931
+ "count": 1,
932
+ "detail": {
933
+ "id": "m9",
934
+ "text": "Да"
935
+ }
936
+ }
937
+ ]
938
+ }
939
+ },
940
+ {
941
+ "script": "(document.querySelector('#b').display = {brief: {live: false, answer: 'С 15 июля'}}, document.querySelector('#b').message = {\"id\":\"m10\",\"role\":\"assistant\",\"status\":\"completed\",\"text\":\"Отпуск — 28 дней.\",\"brief\":{\"decision\":\"ask\",\"questions\":[{\"text\":\"С какого числа?\",\"options\":[{\"label\":\"С 1 июля\"},{\"label\":\"С 15 июля\"}]}]}}, true)",
942
+ "wait": 300,
943
+ "check": "(() => { const b = document.querySelector('#b'); return !b.querySelector('.sf-chat-brief__send') && b.querySelector('.sf-chat-brief--done') && b.querySelector('.sf-chat-chip--chosen').textContent.includes('С 15 июля') && b.querySelectorAll('.sf-chat-chip--chosen').length === 1; })()"
944
+ }
945
+ ]
946
+ },
947
+ {
948
+ "id": "p6-proposal-copy-summary",
949
+ "title": "a proposal is the package's sf-change-confirm with the chat's «Подтвердить» and «Отменить», disabled while busy and kept across redraws; the summary line ends the action row; copy sends sf-chat-message-copied and the 0.3 copy",
950
+ "covers": "proposal (sf-change-confirm), display.busy, events.copied, runtime.proposal-confirm, runtime.proposal-cancel",
951
+ "steps": [
952
+ {
953
+ "script": "(await customElements.whenDefined('sf-chat-message'), document.querySelector('#a').display = {busy: true}, document.querySelector('#a').message = {\"id\":\"m11\",\"role\":\"assistant\",\"status\":\"completed\",\"text\":\"Отпуск — 28 дней.\",\"proposal\":{\"code\":\"P-17\",\"title\":\"Перенести отпуск\",\"state\":\"presented\",\"changes\":[{\"field\":\"Начало\",\"was\":\"1 июля\",\"will_be\":\"15 июля\"}]},\"summary\":{\"text\":\"Нашёл 2 источника\"}}, true)",
954
+ "wait": 400,
955
+ "check": "(() => { const c = document.querySelector('#a sf-confirm-change'); return c.getAttribute('change-id') === 'P-17' && c.getAttribute('accept-text') === 'Подтвердить' && c.getAttribute('decline-text') === 'Отменить' && c.getAttribute('state') === 'open' && c.hasAttribute('disabled') && document.querySelector('#a .sf-chat-message__summary').textContent === 'Нашёл 2 источника'; })()"
956
+ },
957
+ {
958
+ "script": "(window.__card = document.querySelector('#a sf-confirm-change'), document.querySelector('#a').display = {}, true)",
959
+ "wait": 300,
960
+ "check": "document.querySelector('#a sf-confirm-change') === window.__card && !window.__card.hasAttribute('disabled')"
961
+ },
962
+ {
963
+ "user": "click:#a [aria-label='Копировать ответ']",
964
+ "wait": 300,
965
+ "expect": {
966
+ "events": [
967
+ {
968
+ "name": "sf-chat-message-copied",
969
+ "count": 1,
970
+ "detail": {
971
+ "id": "m11"
972
+ }
973
+ },
974
+ {
975
+ "name": "sf-chat-action",
976
+ "count": 1,
977
+ "detail": {
978
+ "action": "copy",
979
+ "id": "m11"
980
+ }
981
+ }
982
+ ]
983
+ }
984
+ }
985
+ ]
986
+ },
987
+ {
988
+ "id": "p7-question-files",
989
+ "title": "a person's question: a bubble and its files as sf-chat-composer's chips; a sent file with href is a download link, checked first — a file gone (404) loses its link and says «Файл недоступен»; a question sent by a button is a note",
990
+ "covers": "message.attachments, runtime.attachment-deleted, runtime.files-download-label, display.note",
991
+ "steps": [
992
+ {
993
+ "script": "(await customElements.whenDefined('sf-chat-message'), document.querySelector('#a').display = {}, document.querySelector('#a').message = {id: 'q1', role: 'user', text: 'Проверьте договор', attachments: [{id: 'att_1', name: 'Удалённый.pdf', bytes: 48213, href: '/sf-chat-message-probe/missing.pdf'}, {id: 'att_2', name: 'Приложение.docx', bytes: 1572864}]}, true)",
994
+ "wait": 300,
995
+ "check": "(() => { const a = document.querySelector('#a'); const link = a.querySelector('.sf-chat-attachment__link'); return a.querySelector('article').getAttribute('aria-label') === 'Вы' && a.querySelector('.sf-chat-message__bubble').textContent === 'Проверьте договор' && link.getAttribute('download') === 'Удалённый.pdf' && link.title === 'Скачать Удалённый.pdf' && a.querySelectorAll('.sf-chat-attachment').length === 2 && a.querySelectorAll('.sf-chat-attachment__meta')[1].textContent === '1,5 МБ'; })()"
996
+ },
997
+ {
998
+ "user": "click:#a .sf-chat-attachment__link",
999
+ "wait": 600,
1000
+ "check": "(() => { const a = document.querySelector('#a'); const meta = a.querySelector('.sf-chat-attachment__meta'); return !a.querySelector('.sf-chat-attachment__link') && meta.textContent === 'Файл недоступен' && meta.getAttribute('role') === 'status'; })()"
1001
+ },
1002
+ {
1003
+ "script": "(document.querySelector('#a').display = {note: 'confirm', code: 'P-17'}, document.querySelector('#a').message = {id: 'q2', role: 'user', text: 'подтверждаю P-17'}, true)",
1004
+ "wait": 300,
1005
+ "check": "document.querySelector('#a .sf-chat-message__note > span').textContent === 'Вы подтвердили изменение · код P-17' && !document.querySelector('#a .sf-chat-message__bubble')"
1006
+ }
1007
+ ]
1008
+ },
1009
+ {
1010
+ "id": "p8-person",
1011
+ "title": "the template person: another's message carries initials and, first in a group, the name; the reader's own offers edit and delete — toggle {kind: edit|delete, open}, the editor saves sf-chat-message-save {id, values: {body}}, the question deletes {ids}; an unsent one retries by its key",
1012
+ "covers": "templates.person, events.toggle, events.save, events.delete, events.retry, runtime.people-*",
1013
+ "steps": [
1014
+ {
1015
+ "script": "(await customElements.whenDefined('sf-chat-message'), document.querySelector('#p').display = {own: false, first: true, showName: true}, document.querySelector('#p').message = {id: 41, body: 'Посмотрите график', authorName: 'Анна Смирнова'}, true)",
1016
+ "wait": 300,
1017
+ "check": "(() => { const p = document.querySelector('#p'); return p.querySelector('article.sf-chat-person').getAttribute('aria-label') === 'Анна Смирнова' && p.querySelector('.sf-chat-person__avatar sf-avatar').getAttribute('text') === 'АС' && p.querySelector('.sf-chat-person__name').textContent === 'Анна Смирнова'; })()"
1018
+ },
1019
+ {
1020
+ "script": "(document.querySelector('#p').display = {own: true, first: true}, document.querySelector('#p').message = {id: 42, body: 'Хорошо', authorName: 'Я', canEdit: true, canDelete: true}, true)",
1021
+ "wait": 300,
1022
+ "check": "document.querySelector('#p .sf-chat-person--own') && document.querySelectorAll('#p .sf-chat-person__tools button').length === 2"
1023
+ },
1024
+ {
1025
+ "user": "click:#p [aria-label='Изменить']",
1026
+ "expect": {
1027
+ "events": [
1028
+ {
1029
+ "name": "sf-chat-message-toggle",
1030
+ "count": 1,
1031
+ "detail": {
1032
+ "id": 42,
1033
+ "kind": "edit",
1034
+ "open": true
1035
+ }
1036
+ },
1037
+ {
1038
+ "name": "sf-chat-action",
1039
+ "count": 0
1040
+ }
1041
+ ]
1042
+ }
1043
+ },
1044
+ {
1045
+ "script": "(document.querySelector('#p').display = {own: true, first: true, editing: {body: 'Хорошо, посмотрю'}}, true)",
1046
+ "wait": 300,
1047
+ "check": "document.activeElement === document.querySelector('#p .sf-chat-person__edit-field')"
1048
+ },
1049
+ {
1050
+ "user": "keyboard:Enter",
1051
+ "expect": {
1052
+ "events": [
1053
+ {
1054
+ "name": "sf-chat-message-save",
1055
+ "count": 1,
1056
+ "detail": {
1057
+ "id": 42,
1058
+ "values": {
1059
+ "body": "Хорошо, посмотрю"
1060
+ }
1061
+ }
1062
+ }
1063
+ ]
1064
+ }
1065
+ },
1066
+ {
1067
+ "script": "(document.querySelector('#p').display = {own: true, first: true, askDelete: true}, true)",
1068
+ "wait": 300,
1069
+ "check": "document.activeElement && document.activeElement.textContent === 'Отмена'"
1070
+ },
1071
+ {
1072
+ "user": "click:#p .sf-chat-person__ask .sf-button--error",
1073
+ "expect": {
1074
+ "events": [
1075
+ {
1076
+ "name": "sf-chat-message-delete",
1077
+ "count": 1,
1078
+ "detail": {
1079
+ "ids": [
1080
+ 42
1081
+ ]
1082
+ }
1083
+ }
1084
+ ]
1085
+ }
1086
+ },
1087
+ {
1088
+ "script": "(document.querySelector('#p').display = {own: true, first: true}, document.querySelector('#p').message = {id: null, body: 'Не ушло', local: {state: 'failed', action: 'send', clientKey: 'k1'}}, true)",
1089
+ "wait": 300
1090
+ },
1091
+ {
1092
+ "user": "click:#p .sf-chat-notice__action",
1093
+ "expect": {
1094
+ "events": [
1095
+ {
1096
+ "name": "sf-chat-message-retry",
1097
+ "count": 1,
1098
+ "detail": {
1099
+ "key": "k1"
1100
+ }
1101
+ }
1102
+ ]
1103
+ }
1104
+ }
1105
+ ]
1106
+ },
1107
+ {
1108
+ "id": "p9-sanitize",
1109
+ "title": "ui-chat's sanitize acceptance through the element (tests/browser/sanitize.test.mjs): the schemes, the OWASP families and nested forbidden elements execute nothing and leave no element or attribute off the list; every scheme vector loses its href and keeps its text; h1 and s are unwrapped; allowed markup and root-relative links stay; code keeps one language class. SF.sanitizeHtml is used when the page has it, else the component's copy",
1110
+ "covers": "sanitize (SF.sanitizeHtml, Core's), security.untrusted_inputs",
1111
+ "steps": [
1112
+ {
1113
+ "script": "(await customElements.whenDefined('sf-chat-message'), window.__alerts = [], window.alert = (value) => window.__alerts.push(value), document.querySelector('#s').message = {\"id\":\"s1\",\"role\":\"assistant\",\"status\":\"completed\",\"text\":\"Отпуск — 28 дней.\",\"html\":\"<a href=\\\"javascript:alert(1)\\\">x</a><a href=\\\" javascript:alert(1)\\\">x</a><a href=\\\"\\tjavascript:alert(1)\\n\\\">x</a><a href=\\\"javascript&#58;alert(1)\\\">x</a><a href=\\\"javascript&colon;alert(1)\\\">x</a><a href=\\\"java&#x09;script:alert(1)\\\">x</a><a href=\\\"java&#0000106script:alert(1)\\\">x</a><a href=\\\"&#x6A;&#x61;&#x76;&#x61;&#x73;&#x63;&#x72;&#x69;&#x70;&#x74;&#x3A;alert(1)\\\">x</a><a href=\\\"jav\\u0000ascript:alert(1)\\\">x</a><a href=\\\"JaVaScRiPt:alert(1)\\\">x</a><a href=\\\" JaVaScRiPt:alert(1)\\\">x</a><a href=\\\"\\tJaVaScRiPt:alert(1)\\n\\\">x</a><a href=\\\"JaVaScRiPt&#58;alert(1)\\\">x</a><a href=\\\"JaVaScRiPt&colon;alert(1)\\\">x</a><a href=\\\"JaVa&#x09;ScRiPt:alert(1)\\\">x</a><a href=\\\"JaVa&#0000106ScRiPt:alert(1)\\\">x</a><a href=\\\"&#x6A;&#x61;&#x76;&#x61;&#x73;&#x63;&#x72;&#x69;&#x70;&#x74;&#x3A;alert(1)\\\">x</a><a href=\\\"JaV\\u0000aScRiPt:alert(1)\\\">x</a><a href=\\\"vbscript:alert(1)\\\">x</a><a href=\\\" vbscript:alert(1)\\\">x</a><a href=\\\"\\tvbscript:alert(1)\\n\\\">x</a><a href=\\\"vbscript&#58;alert(1)\\\">x</a><a href=\\\"vbscript&colon;alert(1)\\\">x</a><a href=\\\"vbsc&#x09;ript:alert(1)\\\">x</a><a href=\\\"vbsc&#0000106ript:alert(1)\\\">x</a><a href=\\\"&#x6A;&#x61;&#x76;&#x61;&#x73;&#x63;&#x72;&#x69;&#x70;&#x74;&#x3A;alert(1)\\\">x</a><a href=\\\"vbs\\u0000cript:alert(1)\\\">x</a><a href=\\\"VBScript:alert(1)\\\">x</a><a href=\\\" VBScript:alert(1)\\\">x</a><a href=\\\"\\tVBScript:alert(1)\\n\\\">x</a><a href=\\\"VBScript&#58;alert(1)\\\">x</a><a href=\\\"VBScript&colon;alert(1)\\\">x</a><a href=\\\"VBSc&#x09;ript:alert(1)\\\">x</a><a href=\\\"VBSc&#0000106ript:alert(1)\\\">x</a><a href=\\\"&#x6A;&#x61;&#x76;&#x61;&#x73;&#x63;&#x72;&#x69;&#x70;&#x74;&#x3A;alert(1)\\\">x</a><a href=\\\"VBS\\u0000cript:alert(1)\\\">x</a><a href=\\\"data:text/html;base64,PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg==\\\">x</a><a href=\\\" data:text/html;base64,PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg==\\\">x</a><a href=\\\"\\tdata:text/html;base64,PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg==\\n\\\">x</a><a href=\\\"data&#58;text/html;base64,PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg==\\\">x</a><a href=\\\"data&colon;text/html;base64,PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg==\\\">x</a><a href=\\\"data&#x09;:text/html;base64,PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg==\\\">x</a><a href=\\\"data&#0000106:text/html;base64,PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg==\\\">x</a><a href=\\\"&#x6A;&#x61;&#x76;&#x61;&#x73;&#x63;&#x72;&#x69;&#x70;&#x74;&#x3A;alert(1)\\\">x</a><a href=\\\"dat\\u0000a:text/html;base64,PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg==\\\">x</a><a href=\\\"DaTa:text/html;base64,PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg==\\\">x</a><a href=\\\" DaTa:text/html;base64,PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg==\\\">x</a><a href=\\\"\\tDaTa:text/html;base64,PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg==\\n\\\">x</a><a href=\\\"DaTa&#58;text/html;base64,PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg==\\\">x</a><a href=\\\"DaTa&colon;text/html;base64,PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg==\\\">x</a><a href=\\\"DaTa&#x09;:text/html;base64,PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg==\\\">x</a><a href=\\\"DaTa&#0000106:text/html;base64,PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg==\\\">x</a><a href=\\\"&#x6A;&#x61;&#x76;&#x61;&#x73;&#x63;&#x72;&#x69;&#x70;&#x74;&#x3A;alert(1)\\\">x</a><a href=\\\"DaT\\u0000a:text/html;base64,PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg==\\\">x</a><SCRIPT SRC=http://xss.rocks/xss.js></SCRIPT><IMG SRC=\\\"javascript:alert('XSS');\\\"><IMG SRC=JaVaScRiPt:alert('XSS')><a onmouseover=\\\"alert(document.cookie)\\\">xxs link</a><IMG \\\"\\\"\\\"><SCRIPT>alert(\\\"XSS\\\")</SCRIPT>\\\"\\\\><IMG SRC=# onmouseover=\\\"alert('xxs')\\\"><IMG SRC=/ onerror=\\\"alert(String.fromCharCode(88,83,83))\\\"></img><IMG SRC=\\\"jav&#x0A;ascript:alert('XSS');\\\"><SCRIPT/XSS SRC=\\\"http://xss.rocks/xss.js\\\"></SCRIPT><BODY onload!#$%&()*~+-_.,:;?@[/|\\\\]^`=alert(\\\"XSS\\\")><<SCRIPT>alert(\\\"XSS\\\");//\\\\<</SCRIPT><iframe src=http://xss.rocks/scriptlet.html <</TITLE><SCRIPT>alert(\\\"XSS\\\");</SCRIPT><INPUT TYPE=\\\"IMAGE\\\" SRC=\\\"javascript:alert('XSS');\\\"><svg/onload=alert('XSS')><BODY ONLOAD=alert('XSS')><BR SIZE=\\\"&{alert('XSS')}\\\"><LINK REL=\\\"stylesheet\\\" HREF=\\\"javascript:alert('XSS');\\\"><STYLE>@import'http://xss.rocks/xss.css';</STYLE><META HTTP-EQUIV=\\\"refresh\\\" CONTENT=\\\"0;url=javascript:alert('XSS');\\\"><IFRAME SRC=\\\"javascript:alert('XSS');\\\"></IFRAME><TABLE BACKGROUND=\\\"javascript:alert('XSS')\\\"><TR><TD BACKGROUND=\\\"javascript:alert('XSS')\\\">x</TD></TR></TABLE><DIV STYLE=\\\"background-image: url(javascript:alert('XSS'))\\\">x</DIV><BASE HREF=\\\"javascript:alert('XSS');//\\\"><OBJECT TYPE=\\\"text/x-scriptlet\\\" DATA=\\\"http://xss.rocks/scriptlet.html\\\"></OBJECT><math><mtext><table><mglyph><style><img src=x onerror=alert(1)><noscript><p title=\\\"</noscript><img src=x onerror=alert(1)>\\\"><form><button formaction=\\\"javascript:alert(1)\\\">x</button></form><iframe srcdoc=\\\"<script>alert(1)</script>\\\"></iframe><details open ontoggle=alert(1)>x</details><template><img src=x onerror=alert(1)></template><p>[1]</p><base href=\\\"javascript:alert(1)//\\\"><a href=\\\"//evil.example/x\\\">x</a><a href=\\\"/\\\\evil.example\\\">x</a><p id=\\\"x\\\" class=\\\"y\\\" style=\\\"color:red\\\" data-x=\\\"1\\\" onclick=\\\"alert(1)\\\" title=\\\"t\\\">x</p><code class=\\\"language-js x\\\" onmouseover=alert(1)>x</code><td colspan=\\\"2 onmouseover=alert(1)\\\" scope=\\\"javascript:alert(1)\\\">x</td><div><span><script>alert(1)</script>текст</span></div><svg><foreignObject><p onclick=\\\"alert(1)\\\">x</p></foreignObject></svg><object><embed><iframe><p>x</p></iframe></embed></object><style><img src=x onerror=alert(1)></style><p>after</p><ul><li><a href=\\\"javascript:alert(1)\\\"><strong>x</strong></a></li></ul>\"}, true)",
1114
+ "wait": 400,
1115
+ "check": "(() => { const m = document.querySelector('#s .sf-chat-markup'); for (const el of m.querySelectorAll('*')) for (const type of ['click', 'mouseover', 'focus', 'toggle']) el.dispatchEvent(new Event(type, {bubbles: true})); const inner = [...m.querySelectorAll('*')].filter((el) => !el.closest('.sf-chat-markup__table') || el.closest('table')); const tags = new Set(inner.map((el) => el.localName)); const okTags = [...tags].every((tag) => ['p', 'a', 'table', 'tbody', 'tr', 'td', 'code', 'br', 'strong', 'ul', 'li'].includes(tag)); const attrs = inner.flatMap((el) => [...el.attributes].map((a) => el.localName + '[' + a.name + '=' + a.value + ']')); return window.__alerts.length === 0 && okTags && attrs.every((one) => /^(a\\[(href=(https?:\\/\\/|mailto:|\\/[^/\\\\])|rel=noopener noreferrer nofollow|target=_blank)|t[dh]\\[(colspan|rowspan)=\\d+\\]|t[dh]\\[scope=(row|col|rowgroup|colgroup)\\]|code\\[class=language-js\\])/.test(one)); })()"
1116
+ },
1117
+ {
1118
+ "script": "(document.querySelector('#s').message = {\"id\":\"s2\",\"role\":\"assistant\",\"status\":\"completed\",\"text\":\"Отпуск — 28 дней.\",\"html\":\"<a href=\\\"javascript:alert(1)\\\">x</a><a href=\\\" javascript:alert(1)\\\">x</a><a href=\\\"\\tjavascript:alert(1)\\n\\\">x</a><a href=\\\"javascript&#58;alert(1)\\\">x</a><a href=\\\"javascript&colon;alert(1)\\\">x</a><a href=\\\"java&#x09;script:alert(1)\\\">x</a><a href=\\\"java&#0000106script:alert(1)\\\">x</a><a href=\\\"&#x6A;&#x61;&#x76;&#x61;&#x73;&#x63;&#x72;&#x69;&#x70;&#x74;&#x3A;alert(1)\\\">x</a><a href=\\\"jav\\u0000ascript:alert(1)\\\">x</a><a href=\\\"JaVaScRiPt:alert(1)\\\">x</a><a href=\\\" JaVaScRiPt:alert(1)\\\">x</a><a href=\\\"\\tJaVaScRiPt:alert(1)\\n\\\">x</a><a href=\\\"JaVaScRiPt&#58;alert(1)\\\">x</a><a href=\\\"JaVaScRiPt&colon;alert(1)\\\">x</a><a href=\\\"JaVa&#x09;ScRiPt:alert(1)\\\">x</a><a href=\\\"JaVa&#0000106ScRiPt:alert(1)\\\">x</a><a href=\\\"&#x6A;&#x61;&#x76;&#x61;&#x73;&#x63;&#x72;&#x69;&#x70;&#x74;&#x3A;alert(1)\\\">x</a><a href=\\\"JaV\\u0000aScRiPt:alert(1)\\\">x</a><a href=\\\"vbscript:alert(1)\\\">x</a><a href=\\\" vbscript:alert(1)\\\">x</a><a href=\\\"\\tvbscript:alert(1)\\n\\\">x</a><a href=\\\"vbscript&#58;alert(1)\\\">x</a><a href=\\\"vbscript&colon;alert(1)\\\">x</a><a href=\\\"vbsc&#x09;ript:alert(1)\\\">x</a><a href=\\\"vbsc&#0000106ript:alert(1)\\\">x</a><a href=\\\"&#x6A;&#x61;&#x76;&#x61;&#x73;&#x63;&#x72;&#x69;&#x70;&#x74;&#x3A;alert(1)\\\">x</a><a href=\\\"vbs\\u0000cript:alert(1)\\\">x</a><a href=\\\"VBScript:alert(1)\\\">x</a><a href=\\\" VBScript:alert(1)\\\">x</a><a href=\\\"\\tVBScript:alert(1)\\n\\\">x</a><a href=\\\"VBScript&#58;alert(1)\\\">x</a><a href=\\\"VBScript&colon;alert(1)\\\">x</a><a href=\\\"VBSc&#x09;ript:alert(1)\\\">x</a><a href=\\\"VBSc&#0000106ript:alert(1)\\\">x</a><a href=\\\"&#x6A;&#x61;&#x76;&#x61;&#x73;&#x63;&#x72;&#x69;&#x70;&#x74;&#x3A;alert(1)\\\">x</a><a href=\\\"VBS\\u0000cript:alert(1)\\\">x</a><a href=\\\"data:text/html;base64,PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg==\\\">x</a><a href=\\\" data:text/html;base64,PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg==\\\">x</a><a href=\\\"\\tdata:text/html;base64,PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg==\\n\\\">x</a><a href=\\\"data&#58;text/html;base64,PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg==\\\">x</a><a href=\\\"data&colon;text/html;base64,PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg==\\\">x</a><a href=\\\"data&#x09;:text/html;base64,PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg==\\\">x</a><a href=\\\"data&#0000106:text/html;base64,PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg==\\\">x</a><a href=\\\"&#x6A;&#x61;&#x76;&#x61;&#x73;&#x63;&#x72;&#x69;&#x70;&#x74;&#x3A;alert(1)\\\">x</a><a href=\\\"dat\\u0000a:text/html;base64,PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg==\\\">x</a><a href=\\\"DaTa:text/html;base64,PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg==\\\">x</a><a href=\\\" DaTa:text/html;base64,PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg==\\\">x</a><a href=\\\"\\tDaTa:text/html;base64,PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg==\\n\\\">x</a><a href=\\\"DaTa&#58;text/html;base64,PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg==\\\">x</a><a href=\\\"DaTa&colon;text/html;base64,PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg==\\\">x</a><a href=\\\"DaTa&#x09;:text/html;base64,PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg==\\\">x</a><a href=\\\"DaTa&#0000106:text/html;base64,PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg==\\\">x</a><a href=\\\"&#x6A;&#x61;&#x76;&#x61;&#x73;&#x63;&#x72;&#x69;&#x70;&#x74;&#x3A;alert(1)\\\">x</a><a href=\\\"DaT\\u0000a:text/html;base64,PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg==\\\">x</a>\"}, true)",
1119
+ "wait": 300,
1120
+ "check": "(() => { const m = document.querySelector('#s .sf-chat-markup'); return m.querySelectorAll('a').length === 0 && m.textContent === \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"; })()"
1121
+ },
1122
+ {
1123
+ "script": "(document.querySelector('#s').message = {\"id\":\"s3\",\"role\":\"assistant\",\"status\":\"completed\",\"text\":\"Отпуск — 28 дней.\",\"html\":\"<h2>A</h2><h3>B</h3><h4>C</h4><p><del>old</del> new</p><h1>D</h1><s>E</s>\"}, true)",
1124
+ "wait": 300,
1125
+ "check": "document.querySelector('#s .sf-chat-markup').innerHTML === '<h2>A</h2><h3>B</h3><h4>C</h4><p><del>old</del> new</p>DE'"
1126
+ },
1127
+ {
1128
+ "script": "(document.querySelector('#s').message = {\"id\":\"s4\",\"role\":\"assistant\",\"status\":\"completed\",\"text\":\"Отпуск — 28 дней.\",\"html\":\"<h3>Итог</h3><p><strong>28</strong> дней, <em>см.</em> <a href=\\\"https://example.gov.ru/tk/125\\\">ТК</a> и <a href=\\\"/app/help\\\">справку</a></p><pre><code class=\\\"language-js\\\">a &lt; b</code></pre><blockquote>цитата</blockquote><ul><li>раз</li></ul><table><thead><tr><th colspan=\\\"2\\\" scope=\\\"col\\\">A</th></tr></thead></table>\"}, true)",
1129
+ "wait": 300,
1130
+ "check": "(() => { const m = document.querySelector('#s .sf-chat-markup'); const html = m.innerHTML; const code = m.querySelector('code.language-js'); return html.startsWith('<h3>Итог</h3><p><strong>28</strong> дней, <em>см.</em> <a href=\"https://example.gov.ru/tk/125\" rel=\"noopener noreferrer nofollow\" target=\"_blank\">ТК</a> и <a href=\"/app/help\" rel=\"noopener noreferrer nofollow\" target=\"_blank\">справку</a></p>') && html.includes('<blockquote>цитата</blockquote><ul><li>раз</li></ul>') && code && code.textContent === 'a < b' && m.querySelector('th[colspan=\"2\"][scope=col]').textContent === 'A'; })()"
1131
+ }
1132
+ ]
1133
+ },
1134
+ {
1135
+ "id": "p10-view-alias",
1136
+ "title": "the 0.3 property view writes display, noted once with its dates; English words follow [lang]",
1137
+ "covers": "aliases view, lang/en.json",
1138
+ "steps": [
1139
+ {
1140
+ "script": "(await customElements.whenDefined('sf-chat-message'), document.querySelector('#e').message = {id: 'e1', role: 'assistant', status: 'running', stage: 'searching'}, document.querySelector('#e').view = {wait: 'delayed'}, true)",
1141
+ "wait": 300,
1142
+ "expect": {
1143
+ "journal": [
1144
+ {
1145
+ "from": "view",
1146
+ "since": "2026-10-28",
1147
+ "remove_after": "2026-12-01"
1148
+ }
1149
+ ]
1150
+ },
1151
+ "check": "document.querySelector('#e').display.wait === 'delayed' && document.querySelector('#e .sf-chat-notice__text').textContent === 'The answer is taking longer than usual' && document.querySelector('#e .sf-chat-notice__action').textContent === 'Refresh'"
1152
+ }
1153
+ ]
1154
+ },
1155
+ {
1156
+ "id": "p11-steps-final",
1157
+ "title": "an answer's steps after it (API.md v1.3, proposed): one folded line «Сделано за 1 мин 40 с · 4 шага» above the answer that opens the list (toggle {kind: steps}); each step with its state said and its own time; a failed answer with a failed step keeps the list open under «Прервано через …»; steps without times have no time; English plural forms",
1158
+ "covers": "message.steps, events.toggle, display.steps_open, runtime.steps-done-in, runtime.steps-stopped-in, runtime.steps-count-*, runtime.time-*",
1159
+ "steps": [
1160
+ {
1161
+ "script": "(await customElements.whenDefined('sf-chat-message'), window.tg = [], document.querySelector('#a').addEventListener('sf-chat-message-toggle', (e) => window.tg.push(e.detail)), document.querySelector('#a').display = {}, document.querySelector('#a').message = {\"id\": \"s1\", \"role\": \"assistant\", \"status\": \"completed\", \"html\": \"<p>Ежегодный отпуск — <strong>28 календарных дней</strong>[1].</p>\", \"text\": \"x\", \"sources\": [{\"n\": 1, \"kind\": \"base\", \"title\": \"Положение об отпусках\"}], \"finished_at\": \"2026-10-30T10:01:40Z\", \"steps\": [{\"code\": \"search\", \"label\": \"Ищу в базе знаний\", \"state\": \"done\", \"started_at\": \"2026-10-30T10:00:00Z\", \"finished_at\": \"2026-10-30T10:00:12Z\"}, {\"code\": \"read\", \"label\": \"Читаю положение об отпусках\", \"state\": \"done\", \"started_at\": \"2026-10-30T10:00:12Z\", \"finished_at\": \"2026-10-30T10:00:41Z\"}, {\"code\": \"check\", \"label\": \"Проверяю по Трудовому кодексу\", \"state\": \"done\", \"started_at\": \"2026-10-30T10:00:41Z\", \"finished_at\": \"2026-10-30T10:01:20Z\"}, {\"code\": \"write\", \"label\": \"Пишу ответ\", \"state\": \"done\", \"started_at\": \"2026-10-30T10:01:20Z\", \"finished_at\": \"2026-10-30T10:01:40Z\"}]}, true)",
1162
+ "wait": 300,
1163
+ "check": "(() => { const a = document.querySelector('#a'); const t = a.querySelector('.sf-chat-steps__toggle'); const list = a.querySelector('.sf-chat-steps__list'); return a.querySelector('.sf-chat-steps__line').textContent === 'Сделано за 1 мин 40 с · 4 шага' && t.getAttribute('aria-expanded') === 'false' && t.getAttribute('aria-controls') === list.id && list.hidden && a.querySelector('.sf-chat-steps').compareDocumentPosition(a.querySelector('.sf-chat-markup')) === 4 && !a.querySelector('.sf-chat-steps__spinner'); })()"
1164
+ },
1165
+ {
1166
+ "user": "click:#a .sf-chat-steps__toggle",
1167
+ "wait": 200,
1168
+ "check": "(() => { const a = document.querySelector('#a'); const items = [...a.querySelectorAll('.sf-chat-steps__item')]; return a.querySelector('.sf-chat-steps__toggle').getAttribute('aria-expanded') === 'true' && !a.querySelector('.sf-chat-steps__list').hidden && items.length === 4 && items[0].querySelector('.sf-chat-steps__label').textContent === 'Ищу в базе знаний' && items[0].querySelector('.sf-chat-steps__took').textContent === '12 с' && items[0].querySelector('.sf-chat-offscreen').textContent === ', готово' && a.querySelector('.sf-chat-steps__list').getAttribute('aria-label') === 'Шаги работы' && window.tg.length === 1 && window.tg[0].kind === 'steps' && window.tg[0].open === true && window.tg[0].id === 's1'; })()"
1169
+ },
1170
+ {
1171
+ "script": "(document.querySelector('#a').display = {}, document.querySelector('#a').message = {\"id\": \"s2\", \"role\": \"assistant\", \"status\": \"failed\", \"text\": \"Не удалось проверить ответ\", \"steps\": [{\"code\": \"search\", \"label\": \"Ищу в базе знаний\", \"state\": \"done\", \"started_at\": \"2026-10-30T10:00:00Z\", \"finished_at\": \"2026-10-30T10:00:12Z\"}, {\"code\": \"check\", \"label\": \"Проверяю по Трудовому кодексу\", \"state\": \"failed\", \"started_at\": \"2026-10-30T10:00:12Z\", \"finished_at\": \"2026-10-30T10:00:40Z\"}], \"finished_at\": \"2026-10-30T10:00:40Z\"}, true)",
1172
+ "wait": 300,
1173
+ "check": "(() => { const a = document.querySelector('#a'); return a.querySelector('.sf-chat-steps__line').textContent === 'Прервано через 40 с · 2 шага' && !a.querySelector('.sf-chat-steps__list').hidden && a.querySelector('.sf-chat-steps__item--failed .sf-chat-offscreen').textContent === ', ошибка' && Boolean(a.querySelector('.sf-chat-notice--failed')); })()"
1174
+ },
1175
+ {
1176
+ "script": "(document.querySelector('#a').display = {steps_open: false}, document.querySelector('#a').message = {\"id\": \"s2\", \"role\": \"assistant\", \"status\": \"failed\", \"text\": \"Не удалось проверить ответ\", \"steps\": [{\"code\": \"search\", \"label\": \"Ищу в базе знаний\", \"state\": \"done\", \"started_at\": \"2026-10-30T10:00:00Z\", \"finished_at\": \"2026-10-30T10:00:12Z\"}, {\"code\": \"check\", \"label\": \"Проверяю по Трудовому кодексу\", \"state\": \"failed\", \"started_at\": \"2026-10-30T10:00:12Z\", \"finished_at\": \"2026-10-30T10:00:40Z\"}], \"finished_at\": \"2026-10-30T10:00:40Z\"}, true)",
1177
+ "wait": 300,
1178
+ "check": "document.querySelector('#a .sf-chat-steps__list').hidden"
1179
+ },
1180
+ {
1181
+ "script": "(document.querySelector('#a').display = {}, document.querySelector('#a').message = {\"id\": \"s3\", \"role\": \"assistant\", \"status\": \"completed\", \"html\": \"<p>Готово.</p>\", \"text\": \"Готово.\", \"steps\": [{\"label\": \"Ищу в базе знаний\", \"state\": \"done\"}]}, document.querySelector('#e').message = {\"id\": \"s4\", \"role\": \"assistant\", \"status\": \"completed\", \"html\": \"<p>Done.</p>\", \"text\": \"Done.\", \"finished_at\": \"2026-10-30T10:00:40Z\", \"steps\": [{\"code\": \"search\", \"label\": \"Ищу в базе знаний\", \"state\": \"done\", \"started_at\": \"2026-10-30T10:00:00Z\", \"finished_at\": \"2026-10-30T10:00:12Z\"}, {\"code\": \"read\", \"label\": \"Читаю положение об отпусках\", \"state\": \"done\", \"started_at\": \"2026-10-30T10:00:12Z\", \"finished_at\": \"2026-10-30T10:00:41Z\"}]}, true)",
1182
+ "wait": 300,
1183
+ "check": "document.querySelector('#a .sf-chat-steps__line').textContent === 'Сделано · 1 шаг' && !document.querySelector('#a .sf-chat-steps__took') && document.querySelector('#e .sf-chat-steps__line').textContent === 'Done in 40 s · 2 steps'"
1184
+ }
1185
+ ]
1186
+ },
1187
+ {
1188
+ "id": "p12-steps-running",
1189
+ "title": "an answer's steps while it is written: «Работаю · 1 мин 12 с · 3 шага» with a spinner instead of the stage line, the time ticking each second from the first step's start, the step at work last in the list; the article stays busy",
1190
+ "covers": "message.steps, runtime.steps-running, runtime.steps-state-running",
1191
+ "steps": [
1192
+ {
1193
+ "script": "(await customElements.whenDefined('sf-chat-message'), window.t0 = Date.now(), document.querySelector('#a').display = {}, document.querySelector('#a').message = {id: 'r1', role: 'assistant', status: 'running', stage: 'writing', created_at: new Date(window.t0 - 80000).toISOString(), steps: [{code: 'a', label: 'Ищу в базе знаний', state: 'done', started_at: new Date(window.t0 - 72000).toISOString(), finished_at: new Date(window.t0 - 60000).toISOString()}, {code: 'c', label: 'Проверяю ссылки', state: 'running', started_at: new Date(window.t0 - 10000).toISOString()}, {code: 'b', label: 'Читаю положение', state: 'done', started_at: new Date(window.t0 - 60000).toISOString(), finished_at: new Date(window.t0 - 10000).toISOString()}]}, true)",
1194
+ "wait": 300,
1195
+ "check": "(() => { const a = document.querySelector('#a'); const items = [...a.querySelectorAll('.sf-chat-steps__item')]; window.l1 = a.querySelector('.sf-chat-steps__line').textContent; return /^Работаю · 1 мин 1[2-4] с · 3 шага$/.test(window.l1) && Boolean(a.querySelector('.sf-chat-steps__toggle .sf-chat-steps__spinner')) && !a.querySelector('.sf-chat-stages') && a.querySelector('article').getAttribute('aria-busy') === 'true' && items.map((one) => one.dataset.code).join('') === 'abc' && items[2].classList.contains('sf-chat-steps__item--running') && items[2].querySelector('.sf-chat-offscreen').textContent === ', выполняется' && Boolean(items[2].querySelector('.sf-chat-steps__spinner')); })()"
1196
+ },
1197
+ {
1198
+ "script": "true",
1199
+ "wait": 1300,
1200
+ "check": "document.querySelector('#a .sf-chat-steps__line').textContent !== window.l1 && /^Работаю · 1 мин 1[3-6] с · 3 шага$/.test(document.querySelector('#a .sf-chat-steps__line').textContent)"
1201
+ }
1202
+ ]
1203
+ },
1204
+ {
1205
+ "id": "p13-no-steps",
1206
+ "title": "without steps nothing changes: a written answer shows its stage line, a finished one no steps line; a stopped wait with steps is the notice with «Обновить», as before",
1207
+ "covers": "message.stage, display.wait",
1208
+ "steps": [
1209
+ {
1210
+ "script": "(await customElements.whenDefined('sf-chat-message'), document.querySelector('#a').display = {}, document.querySelector('#a').message = {id: 'n1', role: 'assistant', status: 'running', stage: 'writing'}, true)",
1211
+ "wait": 300,
1212
+ "check": "document.querySelector('#a .sf-chat-stages__label').textContent === 'Пишу ответ' && !document.querySelector('#a .sf-chat-steps')"
1213
+ },
1214
+ {
1215
+ "script": "(document.querySelector('#a').message = {id: 'n2', role: 'assistant', status: 'completed', html: '<p>Готово.</p>', text: 'Готово.', steps: []}, true)",
1216
+ "wait": 300,
1217
+ "check": "!document.querySelector('#a .sf-chat-steps') && document.querySelector('#a .sf-chat-markup').textContent === 'Готово.'"
1218
+ },
1219
+ {
1220
+ "script": "(document.querySelector('#a').display = {wait: 'stopped'}, document.querySelector('#a').message = {id: 'n3', role: 'assistant', status: 'running', steps: [{label: 'Ищу', state: 'running'}]}, true)",
1221
+ "wait": 300,
1222
+ "check": "!document.querySelector('#a .sf-chat-steps') && Boolean(document.querySelector('#a .sf-chat-notice--stopped'))"
1223
+ }
1224
+ ]
1225
+ },
1226
+ {
1227
+ "id": "p14-preview-asked",
1228
+ "title": "a source with a same-origin preview_url asks for its preview from its footnote and its title (open {id, kind: preview, source} with its locator); not taken, the footnote opens the list as before; taken (the event cancelled), the list stays closed; a source without preview_url, or with one of another origin, asks nothing and opens the list",
1229
+ "covers": "events.open, message.sources[].preview_url, message.sources[].locator, runtime.sources-preview",
1230
+ "steps": [
1231
+ {
1232
+ "script": "(await customElements.whenDefined('sf-chat-message'), window.op = [], window.take = false, window.opWired || (window.opWired = true, document.querySelector('#a').addEventListener('sf-chat-message-open', (e) => { window.op.push(e.detail); if (window.take) e.preventDefault(); })), window.pm = {id: 'v1', role: 'assistant', status: 'completed', html: '<p>Отпуск — 28 дней[1]. Перенос по заявлению[2]. Ещё правило[3].</p>', text: 'x', sources: [{n: 1, kind: 'base', title: 'Положение об отпусках', preview_url: '/kb/vacation', locator: {from: 10, to: 40, line_from: 2}, mime: 'text/html'}, {n: 2, kind: 'base', title: 'Приказ о переносе'}, {n: 3, kind: 'base', title: 'Чужой', preview_url: 'https://elsewhere.example/kb/3'}]}, document.querySelector('#a').display = {}, document.querySelector('#a').message = window.pm, true)",
1233
+ "wait": 300,
1234
+ "check": "(() => { const a = document.querySelector('#a'); const b = a.querySelectorAll('.sf-chat-sources__preview'); return b.length === 1 && b[0].textContent === 'Положение об отпусках' && b[0].getAttribute('aria-label') === 'Открыть источник: Положение об отпусках' && a.querySelectorAll('.sf-chat-footnote').length === 3; })()"
1235
+ },
1236
+ {
1237
+ "user": "click:#a .sf-chat-footnote",
1238
+ "wait": 300,
1239
+ "check": "(() => { const a = document.querySelector('#a'); const one = window.op[0]; return window.op.length === 1 && one.id === 'v1' && one.kind === 'preview' && one.source.n === 1 && one.source.preview_url === '/kb/vacation' && one.source.locator.from === 10 && one.source.locator.to === 40 && one.source.mime === 'text/html' && one.source.kind === 'base' && one.source.title === 'Положение об отпусках' && !a.querySelector('.sf-chat-sources').hidden; })()"
1240
+ },
1241
+ {
1242
+ "script": "(window.take = true, document.querySelector('#a').display = {}, document.querySelector('#a').message = {...window.pm}, document.querySelector('#a .sf-chat-footnote').click(), true)",
1243
+ "wait": 300,
1244
+ "check": "window.op.length === 2 && document.querySelector('#a .sf-chat-sources').hidden"
1245
+ },
1246
+ {
1247
+ "script": "(document.querySelectorAll('#a .sf-chat-footnote')[1].click(), true)",
1248
+ "wait": 300,
1249
+ "check": "window.op.length === 2 && !document.querySelector('#a .sf-chat-sources').hidden && document.querySelector('#a .sf-chat-sources__item--target').id.endsWith('-source-2')"
1250
+ },
1251
+ {
1252
+ "script": "(document.querySelectorAll('#a .sf-chat-footnote')[2].click(), document.querySelector('#a .sf-chat-sources__preview').click(), true)",
1253
+ "wait": 300,
1254
+ "check": "window.op.length === 3 && window.op[2].source.n === 1 && document.querySelector('#a .sf-chat-sources__item--target').id.endsWith('-source-3')"
1255
+ }
1256
+ ]
1257
+ },
1258
+ {
1259
+ "id": "p15-files-made",
1260
+ "title": "an answer's files (API.md v1.3, proposed): «Что готово» with a card per file: icon by type, name, size and extension; «Просмотр» only with a same-origin preview_url (open {kind: preview, source: {kind: file}}), «Скачать» only with a same-origin href, checked first: a file gone says «Файл недоступен»",
1261
+ "covers": "message.attachments (assistant), events.open, runtime.files-ready, runtime.files-preview, runtime.files-download, runtime.attachment-deleted",
1262
+ "steps": [
1263
+ {
1264
+ "script": "(await customElements.whenDefined('sf-chat-message'), window.op = window.op || [], window.take = true, window.opWired || (window.opWired = true, document.querySelector('#a').addEventListener('sf-chat-message-open', (e) => { window.op.push(e.detail); if (window.take) e.preventDefault(); })), document.querySelector('#a').display = {}, document.querySelector('#a').message = {id: 'd1', role: 'assistant', status: 'completed', html: '<p>Готово.</p>', text: 'Готово.', attachments: [{id: 'f1', name: 'Отчёт.pdf', bytes: 248213, mime: 'application/pdf', href: '/sf-chat-message-probe/report.pdf', preview_url: '/sf-chat-message-probe/report'}, {id: 'f2', name: 'График.xlsx', bytes: 18432, href: '/sf-chat-message-probe/missing.xlsx'}, {id: 'f3', name: 'Чужой.zip', bytes: 10, href: 'https://elsewhere.example/f3.zip', preview_url: 'https://elsewhere.example/f3'}]}, true)",
1265
+ "wait": 300,
1266
+ "check": "(() => { const a = document.querySelector('#a'); const cards = [...a.querySelectorAll('.sf-chat-deliverable')]; const icon = (c) => c.querySelector('.sf-chat-deliverable__icon sf-icon').getAttribute('icon'); return a.querySelector('.sf-chat-deliverables__title').textContent === 'Что готово' && a.querySelector('.sf-chat-deliverables').getAttribute('aria-labelledby') === a.querySelector('.sf-chat-deliverables__title').id && cards.length === 3 && cards[0].querySelector('.sf-chat-deliverable__meta').textContent === '242 КБ · PDF' && icon(cards[0]) === 'picture_as_pdf' && icon(cards[1]) === 'table_chart' && icon(cards[2]) === 'folder_zip' && cards[0].querySelector('.sf-chat-deliverable__preview').textContent === 'Просмотр' && cards[0].querySelector('.sf-chat-deliverable__download').getAttribute('href') === '/sf-chat-message-probe/report.pdf' && !cards[1].querySelector('.sf-chat-deliverable__preview') && Boolean(cards[1].querySelector('.sf-chat-deliverable__download')) && !cards[2].querySelector('.sf-chat-deliverable__actions'); })()"
1267
+ },
1268
+ {
1269
+ "script": "(window.opBefore = window.op.length, document.querySelector('#a .sf-chat-deliverable__preview').click(), true)",
1270
+ "wait": 200,
1271
+ "check": "(() => { const one = window.op[window.op.length - 1]; return window.op.length === window.opBefore + 1 && one.kind === 'preview' && one.id === 'd1' && one.source.kind === 'file' && one.source.title === 'Отчёт.pdf' && one.source.preview_url === '/sf-chat-message-probe/report' && one.source.href === '/sf-chat-message-probe/report.pdf'; })()"
1272
+ },
1273
+ {
1274
+ "user": "click:#a .sf-chat-deliverable:nth-child(2) .sf-chat-deliverable__download",
1275
+ "wait": 600,
1276
+ "check": "(() => { const card = document.querySelectorAll('#a .sf-chat-deliverable')[1]; const meta = card.querySelector('.sf-chat-deliverable__meta'); return meta.textContent === 'Файл недоступен' && meta.getAttribute('role') === 'status' && !card.querySelector('.sf-chat-deliverable__download'); })()"
1277
+ }
1278
+ ]
1279
+ },
1280
+ {
1281
+ "id": "p16-person-conflict-divider",
1282
+ "title": "1.2.0: display.conflict draws the message as it is now with «Сообщение уже изменили» over the editor, which keeps the typed text and offers «Оставить их» (toggle {kind: edit, open: false}) and «Заменить своим» (save); a deleted one says «Сообщение уже удалили» and offers «Закрыть» only; Escape takes the delete question back; display.divider unread draws «Новые» before the message in either template; authorAvatar covers the initials",
1283
+ "covers": "settings.display, templates.person, events.save, events.toggle, runtime.divider-unread, runtime.people-conflict",
1284
+ "steps": [
1285
+ {
1286
+ "script": "(await customElements.whenDefined('sf-chat-message'), document.querySelector('#p').message = {id: 42, body: 'Чужая правка', authorName: 'Вы', canEdit: true, canDelete: true}, document.querySelector('#p').display = {own: true, first: true, editing: {body: 'Моя правка'}, conflict: {deleted: false}}, true)",
1287
+ "wait": 400,
1288
+ "check": "(() => { const p = document.querySelector('#p'); return p.querySelector('.sf-chat-person__conflict')?.textContent === 'Сообщение уже изменили' && p.querySelector('.sf-chat-person__bubble--current')?.textContent === 'Чужая правка' && p.querySelector('.sf-chat-person__edit-field').value === 'Моя правка' && p.querySelector('.sf-chat-person__edit-cancel').textContent === 'Оставить их' && p.querySelector('.sf-chat-person__edit-save').textContent === 'Заменить своим' && !p.querySelector('[role=alert]'); })()"
1289
+ },
1290
+ {
1291
+ "user": "click:#p .sf-chat-person__edit-save",
1292
+ "expect": {
1293
+ "events": [
1294
+ {
1295
+ "name": "sf-chat-message-save",
1296
+ "count": 1,
1297
+ "detail": {
1298
+ "id": 42,
1299
+ "values": {
1300
+ "body": "Моя правка"
1301
+ }
1302
+ }
1303
+ }
1304
+ ]
1305
+ }
1306
+ },
1307
+ {
1308
+ "user": "click:#p .sf-chat-person__edit-cancel",
1309
+ "expect": {
1310
+ "events": [
1311
+ {
1312
+ "name": "sf-chat-message-toggle",
1313
+ "count": 1,
1314
+ "detail": {
1315
+ "id": 42,
1316
+ "kind": "edit",
1317
+ "open": false
1318
+ }
1319
+ }
1320
+ ]
1321
+ }
1322
+ },
1323
+ {
1324
+ "script": "(document.querySelector('#p').message = {id: 42, body: '', isDeleted: true, authorName: 'Вы'}, document.querySelector('#p').display = {own: true, first: true, editing: {body: 'Моя правка'}, conflict: {deleted: true}}, true)",
1325
+ "wait": 400,
1326
+ "check": "(() => { const p = document.querySelector('#p'); return Boolean(p.querySelector('.sf-chat-person__bubble--tomb')) && p.querySelector('.sf-chat-person__conflict')?.textContent === 'Сообщение уже удалили' && p.querySelector('.sf-chat-person__edit-field').value === 'Моя правка' && p.querySelector('.sf-chat-person__edit-cancel').textContent === 'Закрыть' && !p.querySelector('.sf-chat-person__edit-save'); })()"
1327
+ },
1328
+ {
1329
+ "script": "(document.querySelector('#p').message = {id: 43, body: 'Хорошо', authorName: 'Вы', canDelete: true}, document.querySelector('#p').display = {own: true, first: true, askDelete: true}, true)",
1330
+ "wait": 400
1331
+ },
1332
+ {
1333
+ "user": "keyboard:Escape",
1334
+ "expect": {
1335
+ "events": [
1336
+ {
1337
+ "name": "sf-chat-message-toggle",
1338
+ "count": 1,
1339
+ "detail": {
1340
+ "id": 43,
1341
+ "kind": "delete",
1342
+ "open": false
1343
+ }
1344
+ }
1345
+ ]
1346
+ }
1347
+ },
1348
+ {
1349
+ "script": "(document.querySelector('#p').message = {id: 44, body: 'Посмотрите', authorName: 'Анна Смирнова', authorAvatar: 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7'}, document.querySelector('#p').display = {own: false, first: true, showName: true, divider: 'unread'}, document.querySelector('#a').display = {divider: 'unread'}, true)",
1350
+ "wait": 400,
1351
+ "check": "(() => { const p = document.querySelector('#p'); const a = document.querySelector('#a'); const line = p.querySelector('.sf-chat-divider'); return line?.textContent === 'Новые' && line.nextElementSibling?.matches('article.sf-chat-person') && p.querySelector('.sf-chat-person__avatar sf-avatar')?.hasAttribute('image-url') && a.querySelector('.sf-chat-divider')?.textContent === 'Новые' && !document.querySelector('#b .sf-chat-divider'); })()"
1352
+ }
1353
+ ]
1354
+ },
1355
+ {
1356
+ "id": "p17-person-day-limit",
1357
+ "title": "1.3.0: display.day draws a day's divider above «Новые» in either template, both role separator named by their words; display.editLimit gives the editor its count past 80 %, its too-long line and a refused save with the typed text kept and no save event; without editLimit the editor neither counts nor refuses",
1358
+ "covers": "settings.display, templates.person, events.save, runtime.people-edit-count, runtime.people-edit-too-long, runtime.people-edit-refused",
1359
+ "steps": [
1360
+ {
1361
+ "script": "(await customElements.whenDefined('sf-chat-message'), window.saves = 0, document.addEventListener('sf-chat-message-save', () => { window.saves += 1; }), document.querySelector('#p').message = {id: 50, body: 'Коротко', authorName: 'Вы', canEdit: true}, document.querySelector('#p').display = {own: true, first: true, day: 'Сегодня', divider: 'unread', editing: {body: 'Коротко'}, editLimit: 10}, document.querySelector('#a').message = {id: 51, role: 'assistant', status: 'completed', text: 'Ответ'}, document.querySelector('#a').display = {day: '28 октября'}, true)",
1362
+ "wait": 400,
1363
+ "check": "(() => { const lines = [...document.querySelectorAll('#p .sf-chat-divider')]; const a = document.querySelector('#a .sf-chat-divider'); const c = document.querySelector('#p .sf-chat-person__edit-count'); return lines.map((one) => one.getAttribute('aria-label')).join() === 'Сегодня,Новые' && lines.every((one) => one.getAttribute('role') === 'separator') && a.textContent === '28 октября' && a.getAttribute('role') === 'separator' && c.hidden; })()"
1364
+ },
1365
+ {
1366
+ "script": "(() => { const f = document.querySelector('#p .sf-chat-person__edit-field'); f.value = 'x'.repeat(9); f.dispatchEvent(new Event('input')); return true; })()",
1367
+ "wait": 50,
1368
+ "check": "document.querySelector('#p .sf-chat-person__edit-count').textContent === '9 из 10'"
1369
+ },
1370
+ {
1371
+ "script": "(() => { const f = document.querySelector('#p .sf-chat-person__edit-field'); f.value = 'x'.repeat(11); f.dispatchEvent(new Event('input')); return true; })()",
1372
+ "wait": 50,
1373
+ "check": "document.querySelector('#p .sf-chat-person__edit-count').textContent === 'Сообщение длиннее 10 знаков'"
1374
+ },
1375
+ {
1376
+ "user": "click:#p .sf-chat-person__edit-save",
1377
+ "wait": 100,
1378
+ "check": "(() => { const r = document.querySelector('#p .sf-chat-person__edit-refused'); return window.saves === 0 && !r.hidden && r.textContent === 'Не сохранено: сообщение длиннее 10 знаков' && document.querySelector('#p .sf-chat-person__edit-count').hidden && document.querySelector('#p .sf-chat-person__edit-field').value === 'x'.repeat(11); })()"
1379
+ },
1380
+ {
1381
+ "script": "(() => { const f = document.querySelector('#p .sf-chat-person__edit-field'); f.value = 'x'.repeat(10); f.dispatchEvent(new Event('input')); return true; })()",
1382
+ "wait": 50,
1383
+ "check": "document.querySelector('#p .sf-chat-person__edit-refused').hidden"
1384
+ },
1385
+ {
1386
+ "user": "click:#p .sf-chat-person__edit-save",
1387
+ "wait": 100,
1388
+ "check": "window.saves === 1"
1389
+ },
1390
+ {
1391
+ "script": "(document.querySelector('#p').display = {own: true, first: true, editing: {body: 'y'.repeat(5000)}}, true)",
1392
+ "wait": 300,
1393
+ "check": "!document.querySelector('#p .sf-chat-divider') && !document.querySelector('#p .sf-chat-person__edit-count') && document.querySelector('#p .sf-chat-person__edit-field').value.length === 5000"
1394
+ },
1395
+ {
1396
+ "user": "click:#p .sf-chat-person__edit-save",
1397
+ "wait": 100,
1398
+ "check": "window.saves === 2 && !document.querySelector('#p .sf-chat-person__edit-refused')"
1399
+ }
1400
+ ]
1401
+ },
1402
+ {
1403
+ "id": "p-doc-who",
1404
+ "title": "1.4.0: a document says who speaks by sign, name and word, never colour alone, with «по просьбе»; no bubble; copy and rating in sight; without display.document the same message is as before",
1405
+ "covers": "settings.display, runtime.speaker-assistant, runtime.speaker-agent, runtime.speaker-bot",
1406
+ "steps": [
1407
+ {
1408
+ "script": "(await customElements.whenDefined('sf-chat-message'), window.d = document.querySelector('#d'), window.q = document.querySelector('#q'), d.message = {id: 'm1', role: 'assistant', status: 'completed', text: 'Готово.', speaker: {kind: 'agent', name: 'Сборщик'}, asked_by: {name: 'Анны'}}, d.display = {document: true, showAuthor: true, canReact: true, canReply: true}, true)",
1409
+ "wait": 300,
1410
+ "check": "(() => { const a = d.querySelector('article'); const who = a.querySelector('.sf-chat-message__who'); return a.getAttribute('aria-label') === 'Сборщик, Агент' && who.querySelector('.sf-chat-message__name').textContent === 'Сборщик' && who.querySelector('sf-badge').getAttribute('text') === 'Агент' && who.querySelector('.sf-chat-message__asked').textContent === 'по просьбе Анны' && a.querySelector('.sf-chat-message__head sf-icon').getAttribute('icon') === 'hub' && !a.querySelector('sf-avatar') && !a.querySelector('.sf-chat-message__bubble') && getComputedStyle(a.querySelector('[data-rating=up]')).opacity === '1' && getComputedStyle(a.querySelector('.sf-chat-message__tool')).opacity === '1' && a.querySelector('.sf-chat-tools__reply') && a.querySelector('.sf-chat-tools__react') && !a.querySelector('.sf-chat-tools__more'); })()"
1411
+ },
1412
+ {
1413
+ "script": "(d.display = {document: true, showAuthor: false}, true)",
1414
+ "wait": 200,
1415
+ "check": "(() => { const a = d.querySelector('article'); return !a.querySelector('.sf-chat-message__head') && !a.querySelector('.sf-chat-message__name') && a.getAttribute('aria-label') === 'Помощник'; })()"
1416
+ },
1417
+ {
1418
+ "script": "(d.display = {}, true)",
1419
+ "wait": 200,
1420
+ "check": "(() => { const a = d.querySelector('article'); return !a.classList.contains('sf-chat-message--document') && !a.querySelector('.sf-chat-message__head, .sf-chat-tools, .sf-chat-message__time, .sf-chat-fold'); })()"
1421
+ }
1422
+ ]
1423
+ },
1424
+ {
1425
+ "id": "p-doc-wait-stop",
1426
+ "title": "1.4.0: a document's wait keeps its stage line and has Stop only with canStop, which says stop {id}",
1427
+ "covers": "events.stop, settings.display",
1428
+ "steps": [
1429
+ {
1430
+ "script": "(await customElements.whenDefined('sf-chat-message'), window.d = document.querySelector('#d'), window.q = document.querySelector('#q'), window.stopped = [], d.addEventListener('sf-chat-message-stop', (event) => window.stopped.push(event.detail.id)), d.message = {id: 'm2', role: 'assistant', status: 'running', stage: 'writing', speaker: {kind: 'assistant', name: 'Mirai'}}, d.display = {document: true, showAuthor: true}, true)",
1431
+ "wait": 200,
1432
+ "check": "d.querySelector('.sf-chat-stages') && d.querySelector('article').getAttribute('aria-busy') === 'true' && !d.querySelector('.sf-chat-message__stop') && d.querySelector('.sf-chat-message__name').textContent === 'Mirai'"
1433
+ },
1434
+ {
1435
+ "script": "(d.display = {document: true, showAuthor: true, canStop: true}, true)",
1436
+ "wait": 200,
1437
+ "check": "!!d.querySelector('.sf-chat-message__stop')"
1438
+ },
1439
+ {
1440
+ "user": "click:#d .sf-chat-message__stop",
1441
+ "wait": 100,
1442
+ "check": "window.stopped.length === 1 && window.stopped[0] === 'm2'"
1443
+ }
1444
+ ]
1445
+ },
1446
+ {
1447
+ "id": "p-doc-fold",
1448
+ "title": "1.4.0: past about 14 lines a document folds, a table stays in sight, «Показать полностью» opens it and says toggle {kind: fold}; a short text has no fold",
1449
+ "covers": "runtime.fold-more, runtime.fold-less, events.toggle",
1450
+ "steps": [
1451
+ {
1452
+ "script": "(await customElements.whenDefined('sf-chat-message'), window.d = document.querySelector('#d'), window.q = document.querySelector('#q'), window.folds = [], d.addEventListener('sf-chat-message-toggle', (event) => { if (event.detail.kind === 'fold') window.folds.push(event.detail.open); }), d.message = {id: 'm3', role: 'assistant', status: 'completed', html: \"<p>\\u041a\\u043e\\u0440\\u043e\\u0442\\u043a\\u043e.</p>\", text: 'Коротко.'}, d.display = {document: true}, true)",
1453
+ "wait": 300,
1454
+ "check": "d.querySelector('.sf-chat-fold').hidden === true"
1455
+ },
1456
+ {
1457
+ "script": "(d.message = {id: 'm4', role: 'assistant', status: 'completed', html: \"<p>\\u0410\\u0431\\u0437\\u0430\\u0446 1. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><p>\\u0410\\u0431\\u0437\\u0430\\u0446 2. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><p>\\u0410\\u0431\\u0437\\u0430\\u0446 3. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><p>\\u0410\\u0431\\u0437\\u0430\\u0446 4. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><p>\\u0410\\u0431\\u0437\\u0430\\u0446 5. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><p>\\u0410\\u0431\\u0437\\u0430\\u0446 6. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><p>\\u0410\\u0431\\u0437\\u0430\\u0446 7. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><p>\\u0410\\u0431\\u0437\\u0430\\u0446 8. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><p>\\u0410\\u0431\\u0437\\u0430\\u0446 9. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><p>\\u0410\\u0431\\u0437\\u0430\\u0446 10. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><p>\\u0410\\u0431\\u0437\\u0430\\u0446 11. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><p>\\u0410\\u0431\\u0437\\u0430\\u0446 12. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><p>\\u0410\\u0431\\u0437\\u0430\\u0446 13. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><p>\\u0410\\u0431\\u0437\\u0430\\u0446 14. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><p>\\u0410\\u0431\\u0437\\u0430\\u0446 15. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><p>\\u0410\\u0431\\u0437\\u0430\\u0446 16. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><p>\\u0410\\u0431\\u0437\\u0430\\u0446 17. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><p>\\u0410\\u0431\\u0437\\u0430\\u0446 18. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><p>\\u0410\\u0431\\u0437\\u0430\\u0446 19. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><p>\\u0410\\u0431\\u0437\\u0430\\u0446 20. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><p>\\u0410\\u0431\\u0437\\u0430\\u0446 21. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><p>\\u0410\\u0431\\u0437\\u0430\\u0446 22. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><p>\\u0410\\u0431\\u0437\\u0430\\u0446 23. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><p>\\u0410\\u0431\\u0437\\u0430\\u0446 24. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><p>\\u0410\\u0431\\u0437\\u0430\\u0446 25. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><p>\\u0410\\u0431\\u0437\\u0430\\u0446 26. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><p>\\u0410\\u0431\\u0437\\u0430\\u0446 27. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><p>\\u0410\\u0431\\u0437\\u0430\\u0446 28. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><p>\\u0410\\u0431\\u0437\\u0430\\u0446 29. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><p>\\u0410\\u0431\\u0437\\u0430\\u0446 30. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><table><thead><tr><th>\\u0421\\u0442\\u0430\\u0436</th></tr></thead><tbody><tr><td>14</td></tr></tbody></table><p>\\u0410\\u0431\\u0437\\u0430\\u0446 1. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><p>\\u0410\\u0431\\u0437\\u0430\\u0446 2. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><p>\\u0410\\u0431\\u0437\\u0430\\u0446 3. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><p>\\u0410\\u0431\\u0437\\u0430\\u0446 4. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><p>\\u0410\\u0431\\u0437\\u0430\\u0446 5. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><p>\\u0410\\u0431\\u0437\\u0430\\u0446 6. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><p>\\u0410\\u0431\\u0437\\u0430\\u0446 7. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><p>\\u0410\\u0431\\u0437\\u0430\\u0446 8. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><p>\\u0410\\u0431\\u0437\\u0430\\u0446 9. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><p>\\u0410\\u0431\\u0437\\u0430\\u0446 10. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><p>\\u0410\\u0431\\u0437\\u0430\\u0446 11. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><p>\\u0410\\u0431\\u0437\\u0430\\u0446 12. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><p>\\u0410\\u0431\\u0437\\u0430\\u0446 13. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><p>\\u0410\\u0431\\u0437\\u0430\\u0446 14. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><p>\\u0410\\u0431\\u0437\\u0430\\u0446 15. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><p>\\u0410\\u0431\\u0437\\u0430\\u0446 16. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><p>\\u0410\\u0431\\u0437\\u0430\\u0446 17. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><p>\\u0410\\u0431\\u0437\\u0430\\u0446 18. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><p>\\u0410\\u0431\\u0437\\u0430\\u0446 19. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><p>\\u0410\\u0431\\u0437\\u0430\\u0446 20. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><p>\\u0410\\u0431\\u0437\\u0430\\u0446 21. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><p>\\u0410\\u0431\\u0437\\u0430\\u0446 22. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><p>\\u0410\\u0431\\u0437\\u0430\\u0446 23. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><p>\\u0410\\u0431\\u0437\\u0430\\u0446 24. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><p>\\u0410\\u0431\\u0437\\u0430\\u0446 25. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><p>\\u0410\\u0431\\u0437\\u0430\\u0446 26. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><p>\\u0410\\u0431\\u0437\\u0430\\u0446 27. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><p>\\u0410\\u0431\\u0437\\u0430\\u0446 28. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><p>\\u0410\\u0431\\u0437\\u0430\\u0446 29. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p><p>\\u0410\\u0431\\u0437\\u0430\\u0446 30. \\u0422\\u0435\\u043a\\u0441\\u0442 \\u043e\\u0442\\u0432\\u0435\\u0442\\u0430, \\u043a\\u043e\\u0442\\u043e\\u0440\\u044b\\u0439 \\u0437\\u0430\\u043d\\u0438\\u043c\\u0430\\u0435\\u0442 \\u0441\\u0442\\u0440\\u043e\\u043a\\u0443.</p>\", text: 'Длинно.'}, true)",
1458
+ "wait": 300,
1459
+ "check": "(() => { const m = d.querySelector('.sf-chat-markup'); const fold = d.querySelector('.sf-chat-fold'); const line = parseFloat(getComputedStyle(m).lineHeight); const shown = [...m.children].filter((one) => !one.hidden && !one.matches('.sf-chat-markup__table')).reduce((sum, one) => sum + one.getBoundingClientRect().height, 0); const table = m.querySelector('.sf-chat-markup__table'); return !fold.hidden && fold.textContent === 'Показать полностью' && fold.getAttribute('aria-expanded') === 'false' && shown <= 15 * line && !table.hidden && table.getBoundingClientRect().height > 0; })()"
1460
+ },
1461
+ {
1462
+ "user": "click:#d .sf-chat-fold",
1463
+ "wait": 150,
1464
+ "check": "(() => { const fold = d.querySelector('.sf-chat-fold'); return fold.textContent === 'Свернуть' && fold.getAttribute('aria-expanded') === 'true' && ![...d.querySelectorAll('.sf-chat-markup > *')].some((one) => one.hidden) && window.folds.join() === 'true'; })()"
1465
+ },
1466
+ {
1467
+ "user": "click:#d .sf-chat-fold",
1468
+ "wait": 150,
1469
+ "check": "d.querySelector('.sf-chat-fold').getAttribute('aria-expanded') === 'false' && [...d.querySelectorAll('.sf-chat-markup > *')].some((one) => one.hidden) && !d.querySelector('.sf-chat-markup__table').hidden && window.folds.join() === 'true,false'"
1470
+ },
1471
+ {
1472
+ "script": "(d.display = {document: true, fold_open: true}, true)",
1473
+ "wait": 300,
1474
+ "check": "d.querySelector('.sf-chat-fold').getAttribute('aria-expanded') === 'true' && ![...d.querySelectorAll('.sf-chat-markup > *')].some((one) => one.hidden)"
1475
+ }
1476
+ ]
1477
+ },
1478
+ {
1479
+ "id": "p-person-avatar",
1480
+ "title": "1.4.0: a person's avatar is sf-avatar with initials, or its picture, not a Tab stop; a picture that fails gives the initials back; the rest of a run keeps the place",
1481
+ "covers": "settings.message, relations",
1482
+ "steps": [
1483
+ {
1484
+ "script": "(await customElements.whenDefined('sf-chat-message'), window.d = document.querySelector('#d'), window.q = document.querySelector('#q'), q.message = {id: 1, body: 'Привет', authorName: 'Анна Смирнова', canEdit: false, canDelete: false}, q.display = {first: true, last: true, showName: true}, await customElements.whenDefined('sf-avatar'), true)",
1485
+ "wait": 400,
1486
+ "check": "(() => { const avatar = q.querySelector('.sf-chat-person__avatar sf-avatar'); return avatar && avatar.getAttribute('text') === 'АС' && avatar.getAttribute('size') === '1/2' && avatar.hasAttribute('inert') && avatar.getAttribute('aria-hidden') === 'true' && avatar.textContent.trim() === 'АС'; })()"
1487
+ },
1488
+ {
1489
+ "script": "(q.message = {id: 1, body: 'Привет', authorName: 'Анна Смирнова', authorAvatar: '/no-such-picture.png'}, true)",
1490
+ "wait": 500,
1491
+ "check": "(() => { const avatar = q.querySelector('.sf-chat-person__avatar sf-avatar'); return !avatar.hasAttribute('image-url') && avatar.textContent.trim() === 'АС'; })()"
1492
+ },
1493
+ {
1494
+ "script": "(q.display = {first: false, last: true}, true)",
1495
+ "wait": 200,
1496
+ "check": "(() => { const place = q.querySelector('.sf-chat-person__avatar'); return place.childElementCount === 0 && place.getBoundingClientRect().width > 0; })()"
1497
+ }
1498
+ ]
1499
+ },
1500
+ {
1501
+ "id": "p-reactions",
1502
+ "title": "1.4.0: pills with their names; a press says react and changes nothing by itself; a pill waiting takes no second press; a pressed pill reads as such; the picker of six, Escape closes it through the host",
1503
+ "covers": "events.react, events.toggle, runtime.reactions-pill, runtime.reactions-pill-mine",
1504
+ "steps": [
1505
+ {
1506
+ "script": "(await customElements.whenDefined('sf-chat-message'), window.d = document.querySelector('#d'), window.q = document.querySelector('#q'), window.reacts = [], window.toggles = [], q.addEventListener('sf-chat-message-react', (event) => window.reacts.push(event.detail)), q.addEventListener('sf-chat-message-toggle', (event) => window.toggles.push(event.detail)), q.message = {id: 5, body: 'Да', authorName: 'Иван', reactions: [{emoji: '👍', count: 3, mine: true}, {emoji: '🎉', count: 1, mine: false}]}, q.display = {first: true, last: true, canReact: true, canReply: true}, true)",
1507
+ "wait": 200,
1508
+ "check": "(() => { const pills = [...q.querySelectorAll('.sf-chat-reaction')]; return pills.length === 2 && pills[0].getAttribute('aria-label') === 'Реакция 👍, 3, ваша' && pills[0].getAttribute('aria-pressed') === 'true' && pills[0].classList.contains('sf-chat-reaction--mine') && pills[1].getAttribute('aria-label') === 'Реакция 🎉, 1' && pills[1].getAttribute('aria-pressed') === 'false' && q.querySelectorAll('.sf-chat-tools button').length === 2; })()"
1509
+ },
1510
+ {
1511
+ "user": "click:#q .sf-chat-reaction[data-emoji='🎉']",
1512
+ "wait": 100,
1513
+ "check": "window.reacts.length === 1 && window.reacts[0].emoji === '🎉' && window.reacts[0].on === true && window.reacts[0].id === 5 && q.querySelector('.sf-chat-reaction[data-emoji=\"🎉\"] .sf-chat-reaction__count').textContent === '1'"
1514
+ },
1515
+ {
1516
+ "script": "(q.display = {first: true, last: true, canReact: true, reacting: '🎉'}, true)",
1517
+ "wait": 200,
1518
+ "check": "(() => { const pill = q.querySelector('.sf-chat-reaction[data-emoji=\"🎉\"]'); pill.click(); return pill.getAttribute('aria-busy') === 'true' && pill.getAttribute('aria-disabled') === 'true' && window.reacts.length === 1; })()"
1519
+ },
1520
+ {
1521
+ "script": "(q.message = {id: 5, body: 'Да', authorName: 'Иван'}, q.display = {first: true, last: true, canReact: true, reacting: '🙂'}, true)",
1522
+ "wait": 200,
1523
+ "check": "(() => { const pill = q.querySelector('.sf-chat-reaction'); return pill.dataset.emoji === '🙂' && !pill.querySelector('.sf-chat-reaction__count') && pill.getAttribute('aria-busy') === 'true'; })()"
1524
+ },
1525
+ {
1526
+ "script": "(q.message = {id: 5, body: 'Да', authorName: 'Иван'}, q.display = {first: true, last: true, canReact: true}, true)",
1527
+ "wait": 200,
1528
+ "check": "!q.querySelector('.sf-chat-reactions')"
1529
+ },
1530
+ {
1531
+ "user": "click:#q .sf-chat-tools__react",
1532
+ "wait": 100,
1533
+ "check": "window.toggles.at(-1).kind === 'react' && window.toggles.at(-1).open === true"
1534
+ },
1535
+ {
1536
+ "script": "(q.display = {first: true, last: true, canReact: true, picker: true}, true)",
1537
+ "wait": 200,
1538
+ "check": "(() => { const six = q.querySelectorAll('.sf-chat-picker button'); return six.length === 6 && document.activeElement === six[0] && six[0].getAttribute('aria-label') === 'Реакция 👍'; })()"
1539
+ },
1540
+ {
1541
+ "user": "keyboard:Escape",
1542
+ "wait": 100,
1543
+ "check": "window.toggles.at(-1).kind === 'react' && window.toggles.at(-1).open === false && window.toggles.at(-1).quiet === false"
1544
+ }
1545
+ ]
1546
+ },
1547
+ {
1548
+ "id": "p-quote",
1549
+ "title": "1.4.0: a quote stands at the top of the bubble: a name and one line; a press says open {kind: quote}; not loaded it says so and asks nothing; deleted it says «Сообщение удалено»; no reply_to, no quote",
1550
+ "covers": "events.open, runtime.reply-not-loaded",
1551
+ "steps": [
1552
+ {
1553
+ "script": "(await customElements.whenDefined('sf-chat-message'), window.d = document.querySelector('#d'), window.q = document.querySelector('#q'), window.opens = [], q.addEventListener('sf-chat-message-open', (event) => window.opens.push(event.detail)), q.message = {id: 6, body: 'Согласна', authorName: 'Ольга', reply_to: {id: 2, author: {name: 'Иван'}, text: 'Посмотрите регламент'}}, q.display = {first: true, last: true}, true)",
1554
+ "wait": 200,
1555
+ "check": "(() => { const bubble = q.querySelector('.sf-chat-person__bubble'); const quote = bubble.firstElementChild; return quote.matches('button.sf-chat-quote') && quote.querySelector('.sf-chat-quote__name').textContent === 'Иван' && quote.querySelector('.sf-chat-quote__text').textContent === 'Посмотрите регламент' && getComputedStyle(quote.querySelector('.sf-chat-quote__text')).whiteSpace === 'nowrap' && bubble.textContent.endsWith('Согласна'); })()"
1556
+ },
1557
+ {
1558
+ "user": "click:#q .sf-chat-quote",
1559
+ "wait": 100,
1560
+ "check": "window.opens.length === 1 && window.opens[0].kind === 'quote' && window.opens[0].target === 2 && window.opens[0].id === 6"
1561
+ },
1562
+ {
1563
+ "script": "(q.display = {first: true, last: true, replyLoaded: false}, true)",
1564
+ "wait": 200,
1565
+ "check": "(() => { const quote = q.querySelector('.sf-chat-quote'); quote.click(); return quote.getAttribute('aria-disabled') === 'true' && quote.title === 'Сообщение не загружено' && window.opens.length === 1; })()"
1566
+ },
1567
+ {
1568
+ "script": "(q.display = {first: true, last: true, replyDeleted: true}, true)",
1569
+ "wait": 200,
1570
+ "check": "q.querySelector('.sf-chat-quote__text').textContent === 'Сообщение удалено'"
1571
+ },
1572
+ {
1573
+ "script": "(q.message = {id: 6, body: 'Согласна', authorName: 'Ольга'}, q.display = {first: true, last: true}, true)",
1574
+ "wait": 200,
1575
+ "check": "!q.querySelector('.sf-chat-quote') && q.querySelector('.sf-chat-person__bubble').childElementCount === 0"
1576
+ }
1577
+ ]
1578
+ },
1579
+ {
1580
+ "id": "p-tools-more",
1581
+ "title": "1.4.0: with reply or reaction offered, edit and delete go under «⋯» and the row is at most three; with neither, the two buttons stay as they were",
1582
+ "covers": "settings.display, relations",
1583
+ "steps": [
1584
+ {
1585
+ "script": "(await customElements.whenDefined('sf-chat-message'), window.d = document.querySelector('#d'), window.q = document.querySelector('#q'), q.message = {id: 8, body: 'Моё', authorName: 'Анна', canEdit: true, canDelete: true}, q.display = {own: true, first: true, last: true}, true)",
1586
+ "wait": 300,
1587
+ "check": "!!q.querySelector('.sf-chat-person__edit') && !!q.querySelector('.sf-chat-person__delete') && !q.querySelector('.sf-chat-tools')"
1588
+ },
1589
+ {
1590
+ "script": "(q.display = {own: true, first: true, last: true, canReact: true, canReply: true}, window.toggles2 = [], q.addEventListener('sf-chat-message-toggle', (event) => window.toggles2.push(event.detail)), true)",
1591
+ "wait": 200,
1592
+ "check": "q.querySelectorAll('.sf-chat-tools > button').length === 3 && !q.querySelector('.sf-chat-person__edit')"
1593
+ },
1594
+ {
1595
+ "user": "click:#q .sf-chat-tools__more",
1596
+ "wait": 300,
1597
+ "check": "q.querySelector('sf-menu-context')?.entries?.map((one) => one.id).join() === 'edit,delete'"
1598
+ }
1599
+ ]
1600
+ }
1601
+ ]
1602
+ }
1603
+ ]
1604
+ }