-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathindex.html
More file actions
226 lines (208 loc) · 130 KB
/
index.html
File metadata and controls
226 lines (208 loc) · 130 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
<!DOCTYPE html>
<html lang="ru">
<head>
<title data-text-id="documentTitle">Онлайн Типограф: исправьте и улучшите ваш текст бесплатно</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Типограф — это умный онлайн-инструмент для автоматического исправления типографики. Расставьте кавычки «ёлочки», тире — длинные и средние, уберите лишние пробелы и исправьте ошибки. Работает с русским и английским языком. Бесплатно и без регистрации.">
<meta name="theme-color" content="#00acc7">
<link rel="icon" href="./icons/favicon.png">
<link rel="apple-touch-icon" href="./icons/touchicon.png">
<link rel="canonical" href="https://typograf.github.io">
<link rel="preconnect" href="https://mc.yandex.ru">
<link rel="manifest" href="./manifest.json">
<meta property="og:url" content="https://typograf.github.io">
<meta property="og:type" content="website">
<meta property="og:title" content="Типограф — помощь с монотонной вёрсткой текстов">
<meta property="og:description" content="Типограф помогает автоматически расставить неразрывные пробелы, исправить мелкие опечатки, привести кавычки к правильному виду, заменить дефисы на тире в нужных местах и многое другое.">
<!--<meta property="og:image" content="">-->
<!--<meta name="twitter:card" content="summary_large_image">-->
<meta property="twitter:domain" content="typograf.github.io">
<meta property="twitter:url" content="https://typograf.github.io">
<meta name="twitter:title" content="Типограф — помощь с монотонной вёрсткой текстов">
<meta name="twitter:description" content="Типограф помогает автоматически расставить неразрывные пробелы, исправить мелкие опечатки, привести кавычки к правильному виду, заменить дефисы на тире в нужных местах и многое другое.">
<!--<meta name="twitter:image" content="">-->
<meta name="google-site-verification" content="I5YVKm7Eoot8FEVveJAgHs2TCfeU7z2zxa8tSpbC3l0">
<meta name="yandex-verification" content="ad40505e6c8ee874">
<style>
.language-selector{color:#007c97;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}
.button{background:#e6e6e6;border-radius:4px;color:#222;cursor:pointer;display:inline-block;padding:8px 18px;text-align:center;transition:background-color .15s linear,transform .1s ease-out;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap}.button:hover{background:#dbdbdb}.button:active{transform:scale(.9658)}.button_type_action{background:#00acc7;color:#fff}.button_type_action:hover{background:#009cb7}.button_width_max{width:100%}
.page_desktop .prefs{width:100%;z-index:100}.page_desktop .prefs__rule{padding-right:1em}.page_mobile .prefs{width:100%}.page_mobile .prefs__controls{text-align:center}.page_mobile .prefs__close{top:28px}.page_mobile .prefs__actions{width:100%}.prefs{background:#fff;bottom:0;box-sizing:border-box;left:0;position:fixed;top:90px;z-index:100}.prefs,.prefs__hidden{visibility:hidden}.prefs_opened{visibility:visible}.prefs__title{float:left;font-size:1.4em;margin:0 0 .5em;padding:0}.prefs__rule-checkbox{margin-right:8px}.prefs__item{border-top:1px solid #e0e0e0;clear:both;padding:1em 20px}.prefs__item_first{border-top:0;padding-top:0}.prefs__item_last{padding-left:10px;padding-right:10px}.prefs__items{bottom:64px;box-sizing:border-box;clear:both;left:0;overflow-y:auto;padding:20px 0;position:absolute;right:0;top:0}.prefs__all-rules{margin:0}.prefs__rules{padding-bottom:30px}.prefs__top{padding:1em 0 0 10px}.prefs__rules-title{font-size:20px;margin-left:10px}.prefs__fieldset{border:1px solid transparent;border-radius:5px;clear:both;margin:1em 0 0;padding:0;transition:border-color .3s ease}.prefs__rule{line-height:30px;margin-left:10px}.prefs__rule:first-child{padding-top:1em}.prefs__rule:last-child{padding-bottom:1em}.prefs .prefs__legend{font-weight:700;margin-left:10px;text-align:left}.prefs__fieldset .prefs__group-rules{display:none}.prefs__fieldset_visible{border:1px solid #e0e0e0}.prefs__html-entities{line-height:1.7;white-space:nowrap}.prefs__html-entities .prefs__only-invisible{margin-left:.8em}.prefs__html-entities .prefs__invisible-symbols{padding-top:.3em}.prefs__html-entities .prefs__html-entities-example-container{color:#999;font-size:13px;padding-top:.3em}.prefs__rule-lang{color:#00acc7;font-size:12px;margin-left:7px;text-transform:uppercase}.prefs__actions{background-color:hsla(0,0%,100%,.8);border-top:1px solid #e0e0e0;bottom:0;box-sizing:border-box;left:0;padding:1em 20px;position:absolute;right:0;text-align:center;z-index:10}.prefs__default{margin-right:10px}body.transition_no .prefs{transition:none}
.header{background:#00acc7;border-bottom:1px solid #008cb7;color:#fff;margin:0;padding:0;width:100%}.header__snow{bottom:0;left:0;overflow:hidden;pointer-events:none;position:absolute;right:0;top:0}.header__title{background:#00acc7;font-family:Arial,Helvetica,sans-serif;font-size:30px;font-weight:400;margin:0;padding:12px 0 5px 20px;text-shadow:0 1px 5px rgba(0,0,0,.2)}.header__subtitle{font-size:13px;margin:3px 0 5px 20px}.header__menu{list-style-type:none;margin:5px 0 0 19px;padding:0;position:relative;top:1px}.header__menu-item{background:#008ca7;border-radius:5px 5px 0 0;color:#fff;cursor:pointer;display:inline-block;margin:0 2px 0 0;padding:7px 15px;text-decoration:none}.header__menu-item_selected{background:#fff;color:#000;cursor:default}.header__menu-item_tab_prefs{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%23fff' fill-rule='evenodd' d='M7.844 11.844a4 4 0 1 1 0-8 4 4 0 0 1 0 8m6-4c0-.029-.004-.058-.004-.087l1.848-.341-.362-1.967-1.852.342a6 6 0 0 0-1.454-2.246l1.068-1.55L11.442.861l-1.069 1.55a5.95 5.95 0 0 0-2.529-.567c-.029 0-.058.004-.087.004L7.416 0 5.449.363l.341 1.851a6 6 0 0 0-2.245 1.454L1.995 2.6.861 4.246l1.55 1.069a5.95 5.95 0 0 0-.567 2.529c0 .029.004.058.004.087L0 8.272l.362 1.967 1.852-.342a6 6 0 0 0 1.454 2.246L2.6 13.693l1.646 1.134 1.069-1.55a5.95 5.95 0 0 0 2.529.567q.043-.002.087-.004l.341 1.848 1.967-.363-.341-1.851a6 6 0 0 0 2.245-1.454l1.55 1.068 1.134-1.646-1.55-1.069a5.95 5.95 0 0 0 .567-2.529'/%3E%3C/svg%3E");background-position:15px;background-repeat:no-repeat;background-size:16px 16px;padding-left:38px}.header__menu-item_tab_prefs.header__menu-item_selected{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M7.844 11.844a4 4 0 1 1 0-8 4 4 0 0 1 0 8m6-4c0-.029-.004-.058-.004-.087l1.848-.341-.362-1.967-1.852.342a6 6 0 0 0-1.454-2.246l1.068-1.55L11.442.861l-1.069 1.55a5.95 5.95 0 0 0-2.529-.567c-.029 0-.058.004-.087.004L7.416 0 5.449.363l.341 1.851a6 6 0 0 0-2.245 1.454L1.995 2.6.861 4.246l1.55 1.069a5.95 5.95 0 0 0-.567 2.529c0 .029.004.058.004.087L0 8.272l.362 1.967 1.852-.342a6 6 0 0 0 1.454 2.246L2.6 13.693l1.646 1.134 1.069-1.55a5.95 5.95 0 0 0 2.529.567q.043-.002.087-.004l.341 1.848 1.967-.363-.341-1.851a6 6 0 0 0 2.245-1.454l1.55 1.068 1.134-1.646-1.55-1.069a5.95 5.95 0 0 0 .567-2.529'/%3E%3C/svg%3E")}.header__menu-item_tab_editor{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 512 512'%3E%3Cpath d='M387.182 0 0 387.181V512h124.818L512 124.819zM104.879 463.858H48.142v-56.735L330.445 124.82l56.735 56.735zM364.486 90.78l22.694-22.694 56.737 56.734-22.696 22.696z'/%3E%3C/svg%3E");background-position:15px;background-repeat:no-repeat;background-size:16px 16px;padding-left:38px}.header__menu-item_tab_editor.header__menu-item_selected{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath d='M387.182 0 0 387.181V512h124.818L512 124.819zM104.879 463.858H48.142v-56.735L330.445 124.82l56.735 56.735zM364.486 90.78l22.694-22.694 56.737 56.734-22.696 22.696z'/%3E%3C/svg%3E")}.header__icon{background-size:100% 100%;display:inline-block;height:23px;left:7px;position:relative;top:3px;width:23px}.header__prefs{bottom:0;color:transparent;cursor:pointer;left:0;position:absolute;right:0;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;z-index:1000}
.textarea{background-color:#fff;border:2px solid rgba(0,0,0,.2);border-radius:4px;box-sizing:border-box;color:#000;outline:none;transition:border-color .15s ease}.textarea::-moz-placeholder{color:#999}.textarea::placeholder{color:#999}.textarea:hover{border-color:rgba(0,0,0,.3)}.textarea:focus{border-color:#00acc7}
.page_desktop .input__text{box-sizing:border-box;height:100%;margin:0;padding:10px;width:100%}.page_desktop .input__head{left:0;min-height:30px;position:absolute;top:-35px;z-index:3}.page_desktop .input__clear{right:25px;top:15px;transition:transform .1s ease}.page_desktop .input__clear:hover{color:#000;transform:scale(1.2)}.page_desktop .input__actions{bottom:-45px;left:0}.page_mobile .input{box-sizing:border-box;margin:0 20px;position:relative}.page_mobile .input__clear{right:15px;top:15px}.page_mobile .input__label{left:1em;position:absolute;top:.9em}.page_mobile .input__execute{box-sizing:border-box;margin-right:20px;width:100%}.page_mobile .input__text{box-sizing:border-box;height:100%;left:0;margin:0;padding:10px;position:absolute;top:0;width:100%}.page_mobile .input__container{bottom:50px;box-sizing:border-box;height:auto;left:0;position:absolute;right:0;top:33px}.page_mobile .input__actions{bottom:5px;display:flex;width:100%}.input{height:100%}.input__head{margin-bottom:3px;white-space:nowrap}.input__text{resize:none}.input__clear{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 612 612'%3E%3Cpath d='M612 36.004 576.521.603 306 270.608 35.478.603 0 36.004l270.522 270.007L0 575.997l35.478 35.4L306 341.411l270.521 269.986 35.479-35.4-270.541-269.986z'/%3E%3C/svg%3E");background-position:50%;background-repeat:no-repeat;background-size:100% 100%;color:#000;cursor:pointer;display:none;height:20px;opacity:.8;position:absolute;transition:color .3s ease;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:20px}.input__actions{min-height:30px;position:absolute;z-index:3}.input__actions .save-file-button{margin-left:5px}
del.diff{background:#fadad7;color:#b30000}del.diff,ins.diff{text-decoration:none}ins.diff{background:#eaf2c2;color:#406619}
.highlight-entity{background:green;opacity:.4}
.page_desktop .result__diff,.page_desktop .result__html{background:#fefefe;border:1px solid #a0a0a0;display:none}.page_desktop .result__diff{overflow-y:auto;white-space:pre-wrap}.page_desktop .result__as{left:-2px;position:relative}.page_desktop .result__diff,.page_desktop .result__html,.page_desktop .result__text{box-sizing:border-box;height:100%;margin:0;padding:10px 10px 10px 18px;resize:none;width:100%}.page_desktop .result__html{overflow-y:auto;position:relative}.page_desktop .result__html:hover:before{border-left-color:#f66}.page_desktop .result__html:before{border-left:1px solid #faa;bottom:8px;content:"";left:17px;position:absolute;top:8px;transition:border-left-color .4s ease;width:0}.page_desktop .result__html p{margin:0 0 1em;padding:0}
.tooltip{border-radius:5px;color:#fff;font-size:16px;left:50%;line-height:20px;max-width:300px;opacity:0;padding:5px 10px;position:fixed;top:50%;transform:translate(-50%,-50%);transition:visibility .3s ease .3s,opacity .3s ease;visibility:hidden}.tooltip_type_ok{background:#00ac51}.tooltip_type_error{background:#ac0051}.tooltip_visible{opacity:1;transition:opacity .3s ease;visibility:visible}
.action-icon:hover{opacity:1}.action-icon{background-position:50%;background-repeat:no-repeat;background-size:100%;cursor:pointer;display:inline-block;height:24px;margin-right:12px;opacity:.7;width:24px}
.copy-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath stroke='none' d='M0 0h24v24H0z'/%3E%3Cpath d='M8 10a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-8a2 2 0 0 1-2-2z'/%3E%3Cpath d='M16 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2'/%3E%3C/svg%3E");background-position:50%;background-repeat:no-repeat;background-size:100% 100%;display:inline-block;height:16px;margin-right:5px;position:relative;top:-2px;vertical-align:middle;width:16px}
.save-file-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath stroke='none' d='M0 0h24v24H0z'/%3E%3Cpath d='M14 3v4a1 1 0 0 0 1 1h4'/%3E%3Cpath d='M11.5 21H7a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7l5 5v5m-5 6h7m-3-3 3 3-3 3'/%3E%3C/svg%3E")}
.share-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath stroke='none' d='M0 0h24v24H0z'/%3E%3Cpath d='M3 12a3 3 0 1 0 6 0 3 3 0 1 0-6 0M15 6a3 3 0 1 0 6 0 3 3 0 1 0-6 0M15 18a3 3 0 1 0 6 0 3 3 0 1 0-6 0M8.7 10.7l6.6-3.4M8.7 13.3l6.6 3.4'/%3E%3C/svg%3E")}
.page_desktop .container{box-sizing:border-box;height:calc(100vh - 250px);margin:50px 0;padding:5px 0;width:100%}.page_mobile .container{bottom:40px;box-sizing:border-box;left:0;padding:5px 0;position:absolute;top:80px;width:100%}
.description{margin:0 20px;max-width:800px}.description p{margin:1em 0}.description h1+p,.description h2+p,.description h3+p{margin-top:0}.description h1{font-size:28px}.description h1,.description h2{font-weight:700;margin:1em 0 5px;padding:0}.description h2{font-size:24px}.description h3{font-size:18px;font-weight:700;margin:1em 0 5px;padding:0}.description h2+h3{margin-top:10px}.description ol,.description ul{margin:.5em 0 1em 20px;padding:0}.description ul{list-style-type:disc}
.page_desktop .table{box-sizing:border-box;height:100%;padding:10px 20px;width:100%}.page_desktop .table__left,.page_desktop .table__right{box-sizing:border-box;height:100%;position:relative;width:50%}.page_desktop .table__left{float:left;padding-right:10px}.page_desktop .table__right{box-sizing:border-box;float:right}
.footer{border-top:1px solid #e0e0e0;box-sizing:border-box;font-size:13px;margin-top:30px;padding:10px 20px;width:100%}.footer__line{display:flex;margin-bottom:10px}.footer__tg-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd' clip-rule='evenodd' image-rendering='optimizeQuality' shape-rendering='geometricPrecision' text-rendering='geometricPrecision' viewBox='0 0 512 512'%3E%3Cpath d='M-5239.92 1594.94c.02 7.81 2.31 120.68 120.76 127.72 0 32.55.03 56.15.03 87.21-8.97.52-77.97-4.49-120.93-42.8l-.13 169.78c1.63 117.84-85.08 189.54-198.44 164.78-195.46-58.47-130.51-348.37 65.75-317.34 0 93.59.05-.03.05 93.59-81.07-11.93-108.19 55.51-86.65 103.81 19.61 43.96 100.34 53.5 128.49-8.53 3.19-12.14 4.79-25.98 4.79-41.52v-337.13z'/%3E%3Cg fill-rule='nonzero'%3E%3Cpath fill='%23d0272c' d='M-4469.99 1933.14c-13.44 70.49-29.86 138.07-78.5 173.37-15.02-106.54 22.04-186.55 39.25-271.5-29.34-49.39 3.53-148.79 65.42-124.29 76.15 30.12-65.95 183.63 29.44 202.8 99.6 20.01 140.26-172.81 78.51-235.51-89.24-90.55-259.76-2.07-238.79 127.57 5.1 31.69 37.84 41.3 13.08 85.04-57.11-12.66-74.15-57.7-71.96-117.76 3.53-98.29 88.32-167.11 173.36-176.63 107.56-12.04 208.5 39.48 222.44 140.65 15.69 114.2-48.55 237.87-163.55 228.98-31.18-2.43-44.26-17.87-68.7-32.72'/%3E%3Cpath fill='%235a3e85' d='m-3756.02 1594.51-33.39 89.04v356.14h122.38v66.82h66.81l66.75-66.82h100.14l133.56-133.51v-311.67zm44.49 44.49h367.26v244.88l-77.92 77.92h-122.4l-66.73 66.73v-66.73h-100.21zm122.42 222.65h44.52V1728.1h-44.52zm122.41 0h44.51V1728.1h-44.51z'/%3E%3Cpath fill='%233caf41' d='M-2698.74 1733.62c-11.72.21-21.62 10.19-21.41 21.58.21 11.81 9.93 21.04 21.98 20.9 12.08-.15 21.24-9.48 21.13-21.54-.1-11.83-9.77-21.16-21.7-20.94m150.41 136.23c-9.29-.07-17.18 7.54-17.56 16.93-.4 10.03 7.4 18.28 17.33 18.3 9.61.03 17.2-7.23 17.55-16.8.37-10.05-7.43-18.36-17.32-18.43m-92.53 18.41c.38-10.01-7.67-18.41-17.7-18.45-9.92-.04-18.24 8.47-17.89 18.33.32 9.43 8.26 17.05 17.77 17.06 9.49.01 17.45-7.4 17.82-16.94m109.84 164.41c-14.63-1.53-30.01 6.91-45.31 8.48-46.63 4.77-88.4-8.23-122.85-40.08-65.51-60.59-56.15-153.5 19.64-203.15 67.36-44.13 166.15-29.42 213.64 31.81 41.45 53.43 36.58 124.36-14.02 169.25-23.61 20.95-13.71 27.63-7.57 51.97-13.6-6.06-28.68-16.73-43.53-18.28m-302.83-319.04c-11.95-.36-21.78 8.78-22.13 20.56-.35 11.94 8.78 21.5 20.82 21.81 11.93.3 21.94-8.84 22.38-20.47.44-11.59-9.66-21.57-21.07-21.9m72.22 213.69c-18.57-2.3-35.48-4.83-52.48-6.27-5.87-.49-12.84.21-17.82 3.02-16.51 9.32-32.34 19.84-51.1 31.56 3.44-15.57 5.67-29.2 9.62-42.32 2.9-9.63 1.55-15-7.33-21.28-115.1-81.26-78.79-230.75 49.97-272.81 100.32-32.78 226.22 24.88 236.57 135.64-96.71 5.05-176.11 70.06-167.43 172.46'/%3E%3Cpath fill='%231e1b1e' d='M-2014.21 1705.12c79.75 0 144.4 65.1 144.4 145.39 0 80.3-64.65 145.39-144.4 145.39s-144.4-65.09-144.4-145.39c0-80.29 64.65-145.39 144.4-145.39m230.6 8.52c39.88 0 72.2 61.27 72.2 136.87.13 18.22-7.61 136.88-72.19 136.88-39.88 0-72.21-61.3-72.21-136.88s32.33-136.87 72.2-136.87m111.61 14.25c14.02 0 25.39 54.9 25.39 122.62 0 67.7-11.37 122.62-25.39 122.62-14.03 0-25.39-54.9-25.39-122.62s11.36-122.62 25.39-122.62'/%3E%3Cpath fill='%23e01e5a' d='M-1229.55 1594.85c-28.14 0-51.13 22.99-51.13 51.13s22.99 51.13 51.13 51.13h51.14v-51.13c0-28.14-22.65-51.13-51.14-51.13m-187.02 323.95c0 28.14 22.99 51.13 51.13 51.13s51.13-22.99 51.13-51.13v-51.13h-51.13c-28.48 0-51.13 22.99-51.13 51.13m136.23 0v136.58c0 28.14 23 51.13 51.14 51.13s51.13-22.99 51.13-51.13V1918.8c0-28.14-22.99-51.13-51.13-51.13-28.49 0-51.14 22.99-51.14 51.13m187.03 187.71c28.14 0 51.13-22.99 51.13-51.13s-22.99-51.13-51.13-51.13h-51.13v51.13c0 28.14 22.99 51.13 51.13 51.13m136.24-136.58c28.14 0 51.13-22.99 51.13-51.13s-22.99-51.13-51.13-51.13h-136.24c-28.14 0-51.13 22.99-51.13 51.13s22.99 51.13 51.13 51.13zm51.13-187.71c0-28.14-22.99-51.13-51.13-51.13s-51.14 22.99-51.14 51.13v51.13h51.14c28.14.35 51.13-22.65 51.13-51.13m-136.24 0v-136.58c0-28.14-22.99-51.13-51.13-51.13s-51.13 22.99-51.13 51.13v136.58c0 28.14 22.99 51.13 51.13 51.13 28.48.35 51.13-22.65 51.13-51.13m-187.37-51.13h-135.89c-28.14 0-51.13 22.99-51.13 51.13s22.99 51.13 51.13 51.13h136.24c28.14 0 51.13-22.99 51.13-51.13-.34-28.14-22.99-51.13-51.48-51.13'/%3E%3Cpath fill='%2323b7ec' d='m512 50.49-80.98 408.28s-11.32 28.31-42.47 14.72L200.84 329.82c25.23-22.68 220.96-198.65 229.52-206.63 13.23-12.35 5.02-19.7-10.36-10.36l-289.11 183.6-111.54-37.55S1.79 252.65.1 239.06c-1.7-13.59 19.82-20.95 19.82-20.95L474.63 39.73S512 23.31 512 50.49'/%3E%3C/g%3E%3C/svg%3E");background-position:50%;background-repeat:no-repeat;background-size:100%;display:inline-block;height:16px;margin-left:-16px;position:absolute;width:16px}.footer__left{float:left}.footer__left .footer__item{margin-left:20px}.footer__left .footer__item:first-child{margin-left:0}.footer__left .footer__item_icon{margin-left:40px}.footer__right{float:right}.footer__right .footer__item{float:right;margin-left:20px}#version{display:inline-block;font-size:10px;margin-left:3px;min-width:2em;position:relative;top:-5px}
.typograf-oa-sp-lbracket{margin-right:.3em}.typograf-oa-lbracket,.typograf-oa-n-lbracket{margin-left:-.3em}.typograf-oa-comma{margin-right:-.2em}.typograf-oa-comma-sp{margin-left:.2em}.typograf-oa-sp-lquote{margin-right:.44em}.typograf-oa-lquote,.typograf-oa-n-lquote{margin-left:-.44em}.typograf-nowrap{white-space:nowrap}body.page_desktop{min-width:800px}body,html{bottom:0;color:#222;left:0;margin:0;padding:0;position:absolute;right:0;top:0}body,button,html,input,option,select,textarea{font-family:Arial,sans-serif;font-size:16px}label{-webkit-user-select:none;-moz-user-select:none;user-select:none}a{color:#007c97;text-decoration:none;white-space:nowrap}.se{display:none}
</style>
</head>
<body class="page_desktop transition_no">
<!--noindex-->
<header class="header">
<div class="header__title" data-text-id="typograf">Типограф</div>
<ul class="header__menu">
<li class="header__menu-item header__menu-item_selected header__menu-item_tab_editor" data-text-id="editor">Редактор</li>
<li class="header__menu-item header__menu-item_tab_prefs" data-text-id="prefs">Настройки</li>
</ul>
</header>
<div class="container">
<div class="prefs" data-nosnippet>
<div class="prefs__items">
<div class="prefs__item prefs__item_first">
<div class="prefs__title" data-text-id="prefs">Настройки</div>
</div>
<div class="prefs__mode prefs__item">
<div class="prefs__html-entities">
<span data-text-id="html-entities">HTML-сущности</span>:<br>
<select class="prefs__set-mode" data-title-id="html-entities">
<option value="default">UTF-8</option>
<option value="name" data-text-id="names">Имена</option>
<option value="digit" data-text-id="digits">Цифры</option>
<option value="js">JS</option>
</select><span class="prefs__invisible-symbols-container"><input type="checkbox" class="prefs__only-invisible" id="invisible-symbols"> <label for="invisible-symbols" data-text-id="invisible-symbols">Для невидимых символов</label></span><br>
<div class="prefs__html-entities-example-container"><span data-text-id="example"></span>: <span class="prefs__html-entities-example"></span></div>
</div>
</div>
<div class="prefs__item prefs__item_last">
<div class="prefs__rules-title" data-text-id="rules">Правила</div>
<div class="prefs__top">
<input type="checkbox" class="prefs__all-rules" id="prefs__all-rules"> <label for="prefs__all-rules" data-text-id="select-all">Выбрать все</label>
</div>
<div class="prefs__rules"></div>
</div>
</div>
<div class="prefs__actions">
<span class="prefs__default button button" data-text-id="default">По умолчанию</span>
</div>
</div>
<div class="input">
<div class="table">
<div class="table__left">
<div class="input__clear" data-title-id="clear" title="Очистить"></div>
<div class="input__head">
<span class="prefs__locale"><span data-text-id="locale">Локаль</span>: <select class="prefs__set-locale" data-title-id="locale"></select></span>
</div>
<textarea autocomplete="off" class="textarea input__text" autofocus="autofocus" spellcheck="true" data-placeholder-id="input-text"></textarea>
</div>
<div class="table__right result">
<div class="input__head">
<span class="result__as">
<input type="radio" class="result__as-text" id="result__as-text" name="view" checked="checked" value="text"><label for="result__as-text" data-text-id="text">Текст</label>
<input type="radio" class="result__as-html" id="result__as-html" name="view" value="html"><label for="result__as-html" style="color: #bf4b15; font-size: 0.9em;"><HTML></label>
<input type="radio" class="result__as-diff" id="result__as-diff" name="view" value="diff"><label for="result__as-diff"><span style="border-bottom: 1px solid rgba(255, 0, 0, .5);" data-text-id="diff-1">Измен</span><span style="border-bottom: 1px solid rgba(0, 255, 0, .5);" data-text-id="diff-2">ения</span></label>
</span>
</div>
<div class="input__actions">
<span class="copy-button button"><span class="copy-icon"></span><span data-text-id="copy">Скопировать</span></span>
<span class="save-file-button button" data-text-id="save">Сохранить</span>
</div>
<textarea autocomplete="off" class="textarea result__text" spellcheck="true" data-placeholder-id="result"></textarea>
<div class="result__html"></div>
<div class="result__diff"></div>
</div>
</div>
</div>
</div>
<!--/noindex-->
<main>
<article class="description">
<h1>Типограф</h1>
<p>Ваш текст почти готов, но выглядит неидеально? Лишние пробелы, прямые кавычки "вот такие", дефисы вместо тире и другие мелкие ошибки могут испортить впечатление от статьи, письма или поста в соцсетях. <strong>Онлайн Типограф</strong> — это ваш цифровой корректор, который за доли секунды приведёт текст в порядок по правилам русской и английской типографики.</p>
<h2>Что может наш Типограф?</h2>
<p>Наш инструмент — это больше, чем просто удаление лишних пробелов. Он проводит комплексное типографирование текста:</p>
<ul>
<li>«Умные» кавычки: автоматически заменяет прямые кавычки "..." на парные «ёлочки» для русского языка и “лапки” для английского.</li>
<li>Правильные тире и дефисы: отличает дефис - от короткого тире – и длинного тире — и расставляет их, согласно правилам.</li>
<li>Чистка пробелов: убирает двойные, тройные и лишние пробелы, а также пробелы в начале и конце строки.</li>
<li>Неразрывные пробелы: проставляет неразрывные пробелы между инициалами и фамилией (например, А. С. Пушкин) и после коротких слов (и, в, о и т. д.), чтобы они не «висели» в конце строки.</li>
<li>Специальные символы: корректно заменяет знаки (c), (tm), (r) на ©, ™, ®.</li>
<li>Математические знаки: заменяет +- на ±, <= на ≤ и т. д.</li>
<li>Форматирование абзацев: убирает лишние переносы строк или, наоборот, формирует корректные абзацы.</li>
<li>Замена буквы «Е» на «Ё».</li>
<li>Форматирование номеров телефонов.</li>
<li>И многое другое.</li>
</ul>
<p>Полный <a target="_blank" href="https://github.com/typograf/typograf/blob/dev/docs/RULES.ru.md">список правил</a> Типографа.</p>
<h2>Для кого создан этот инструмент?</h2>
<ul>
<li>Копирайтеры и редакторы: придайте своим текстам профессиональный лоск перед публикацией.</li>
<li>Веб-мастера и SEO-специалисты: аккуратный текст — это часть качественного контента и юзабилити сайта.</li>
<li>Маркетологи и SMM-менеджеры: создавайте безупречные посты для соцсетей и рассылок.</li>
<li>Все, кто работает с текстом: от деловых писем до личных сообщений.</li>
</ul>
<h2>Как использовать Типограф?</h2>
<ol>
<li>Вставьте свой текст в левое поле.</li>
<!--Нажмите кнопку: Кликните «Типографировать» — преобразование произойдет мгновенно.-->
<li>Готовый, чистый текст появится в правом поле. Просто скопируйте его!</li>
</ol>
<h2>Часто задаваемые вопросы</h2>
<h3>Чем типографирование отличается от проверки орфографии?</h3>
<p>Орфография проверяет правописание слов, а типографика отвечает за визуальное оформление текста: правильные кавычки, тире, пробелы. Это делает текст удобочитаемым и эстетичным.</p>
<h3>Поддерживает ли инструмент английский язык?</h3>
<p>Да! Наш типограф умеет различать язык и применять соответствующие правила. Для английского текста он проставит кавычки-лапки “like this”.</p>
<h3>Безопасно ли использовать Типограф для конфиденциальных текстов?</h3>
<p>Абсолютно. Мы не храним и не передаём ваш текст третьим лицам. Все обработки происходят в вашем браузере в режиме реального времени.</p>
<h3>Почему важно использовать «ёлочки» и длинное тире?</h3>
<p>Это правило современной письменной речи, особенно в вебе. Такой текст выглядит профессионально и показывает вашу внимательность к деталям.</p>
<h3>Есть ли ограничения на размер текста при типографировании?</h3>
<p>Нет. Типографирование происходит в браузере на лету, текст не оправляется на сервер.</p>
<h3>Какие форматы поддерживает Типограф?</h3>
<p>Обычный текст и HTML.</p>
<h3>Как сообщить о баге в Типографе?</h3>
<p>Необходимо <a target="_blank" href="https://github.com/typograf/typograf.github.io/issues/new">завести баг</a> с описанием на Гитхабе.</p>
<h3>У меня есть пожелание по работе Типографа</h3>
<p>Отлично! <a target="_blank" href="https://github.com/typograf/typograf.github.io/issues/new">Заведите задачу</a> с описанием пожелания на Гитхабе.</p>
<h2>Встройте Typograf на свой сайт</h2>
<p>Данный сервис использует npm-пакет <a target="_blank" href="https://www.npmjs.com/package/typograf">typograf</a>, <a href="https://github.com/typograf/typograf" target="_blank">исходный код</a>. Вы также можете бесплатно использовать этот пакет у себя на сайте, в админке, в WPA-приложении, на сервере с Node.js и там, где есть JavaScript.</p>
<h2>Итого</h2>
<p>Не тратьте время на ручную правку! Вставьте свой текст в форму выше и получите идеально оформленный результат мгновенно. Это бесплатно, быстро и не требует регистрации.</p>
</article>
</main>
<footer class="footer">
<div class="footer__left">
<div class="footer__line">
<div class="footer__item">
<span class="extension" data-text-id="extension">Дополнение для</span>
<a rel="noopener" class="extension__link" href="" target="_blank"></a>
</div>
<div class="footer__item footer__item_icon">
<span class="footer__tg-icon"></span><a rel="noopener" href="https://t.me/webtypograf">@webtypograf</a>
</div>
</div>
<div class="footer__line">
<div class="footer__item">
<a href="https://checkdevice.online/?from=typograf.github.io" target="_blank" data-text-id="Check">Проверь</a> <span data-text-id="device-online">устройство онлайн!</span>
</div>
</div>
</div>
<div class="footer__right">
<div class="footer__item">
<span data-text-id="powered-by">На основе</span> <a rel="noopener" href="https://github.com/typograf/typograf/releases/" target="_blank">Typograf <span id="version">7.6.0</span></a>
</div>
<div class="footer__item">
<span class="language-selector"></span>
</div>
</div>
</footer>
<script src="/dist/html-beautify.js?n=1775940675256" async></script>
<script src="/dist/eyo.js?n=1775940675256" async></script>
<script>
/*! typograf | © 2025 Denis Seleznev | MIT License | https://github.com/typograf/typograf */
((e,n)=>{"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"!=typeof globalThis?globalThis:e||self).Typograf=n()})(this,function(){var r=function(){return(r=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var a in n=arguments[t])Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a]);return e}).apply(this,arguments)};function t(e,n,t){if(t||2===arguments.length)for(var r,a=0,o=n.length;a<o;a++)!r&&a in n||((r=r||Array.prototype.slice.call(n,0,a))[a]=n[a]);return e.concat(r||Array.prototype.slice.call(n))}var P=[["iexcl",161],["cent",162],["pound",163],["curren",164],["yen",165],["brvbar",166],["sect",167],["uml",168],["copy",169],["ordf",170],["laquo",171],["not",172],["reg",174],["macr",175],["deg",176],["plusmn",177],["sup2",178],["sup3",179],["acute",180],["micro",181],["para",182],["middot",183],["cedil",184],["sup1",185],["ordm",186],["raquo",187],["frac14",188],["frac12",189],["frac34",190],["iquest",191],["Agrave",192],["Aacute",193],["Acirc",194],["Atilde",195],["Auml",196],["Aring",197],["AElig",198],["Ccedil",199],["Egrave",200],["Eacute",201],["Ecirc",202],["Euml",203],["Igrave",204],["Iacute",205],["Icirc",206],["Iuml",207],["ETH",208],["Ntilde",209],["Ograve",210],["Oacute",211],["Ocirc",212],["Otilde",213],["Ouml",214],["times",215],["Oslash",216],["Ugrave",217],["Uacute",218],["Ucirc",219],["Uuml",220],["Yacute",221],["THORN",222],["szlig",223],["agrave",224],["aacute",225],["acirc",226],["atilde",227],["auml",228],["aring",229],["aelig",230],["ccedil",231],["egrave",232],["eacute",233],["ecirc",234],["euml",235],["igrave",236],["iacute",237],["icirc",238],["iuml",239],["eth",240],["ntilde",241],["ograve",242],["oacute",243],["ocirc",244],["otilde",245],["ouml",246],["divide",247],["oslash",248],["ugrave",249],["uacute",250],["ucirc",251],["uuml",252],["yacute",253],["thorn",254],["yuml",255],["fnof",402],["Alpha",913],["Beta",914],["Gamma",915],["Delta",916],["Epsilon",917],["Zeta",918],["Eta",919],["Theta",920],["Iota",921],["Kappa",922],["Lambda",923],["Mu",924],["Nu",925],["Xi",926],["Omicron",927],["Pi",928],["Rho",929],["Sigma",931],["Tau",932],["Upsilon",933],["Phi",934],["Chi",935],["Psi",936],["Omega",937],["alpha",945],["beta",946],["gamma",947],["delta",948],["epsilon",949],["zeta",950],["eta",951],["theta",952],["iota",953],["kappa",954],["lambda",955],["mu",956],["nu",957],["xi",958],["omicron",959],["pi",960],["rho",961],["sigmaf",962],["sigma",963],["tau",964],["upsilon",965],["phi",966],["chi",967],["psi",968],["omega",969],["thetasym",977],["upsih",978],["piv",982],["bull",8226],["hellip",8230],["prime",8242],["Prime",8243],["oline",8254],["frasl",8260],["weierp",8472],["image",8465],["real",8476],["trade",8482],["alefsym",8501],["larr",8592],["uarr",8593],["rarr",8594],["darr",8595],["harr",8596],["crarr",8629],["lArr",8656],["uArr",8657],["rArr",8658],["dArr",8659],["hArr",8660],["forall",8704],["part",8706],["exist",8707],["empty",8709],["nabla",8711],["isin",8712],["notin",8713],["ni",8715],["prod",8719],["sum",8721],["minus",8722],["lowast",8727],["radic",8730],["prop",8733],["infin",8734],["ang",8736],["and",8743],["or",8744],["cap",8745],["cup",8746],["int",8747],["there4",8756],["sim",8764],["cong",8773],["asymp",8776],["ne",8800],["equiv",8801],["le",8804],["ge",8805],["sub",8834],["sup",8835],["nsub",8836],["sube",8838],["supe",8839],["oplus",8853],["otimes",8855],["perp",8869],["sdot",8901],["lceil",8968],["rceil",8969],["lfloor",8970],["rfloor",8971],["lang",9001],["rang",9002],["spades",9824],["clubs",9827],["hearts",9829],["diams",9830],["loz",9674],["OElig",338],["oelig",339],["Scaron",352],["scaron",353],["Yuml",376],["circ",710],["tilde",732],["ndash",8211],["mdash",8212],["lsquo",8216],["rsquo",8217],["sbquo",8218],["ldquo",8220],["rdquo",8221],["bdquo",8222],["dagger",8224],["Dagger",8225],["permil",8240],["lsaquo",8249],["rsaquo",8250],["euro",8364],["NestedGreaterGreater",8811],["NestedLessLess",8810]],e=[["nbsp",160],["thinsp",8201],["ensp",8194],["emsp",8195],["shy",173],["zwnj",8204],["zwj",8205],["lrm",8206],["rlm",8207]];function n(){var n=this;this.entities=this.prepareEntities(t(t([],P,!0),e,!0)),this.entitiesByName={},this.entitiesByNameEntity={},this.entitiesByDigitEntity={},this.entitiesByJsEntity={},this.entitiesByUtf={},this.entities.forEach(function(e){n.entitiesByName[e.name]=e,n.entitiesByNameEntity[e.type.name]=e,n.entitiesByDigitEntity[e.type.digit]=e,n.entitiesByJsEntity[e.type.js]=e,n.entitiesByUtf[e.utf]=e}),this.invisibleEntities=this.prepareEntities(e)}n.prototype.toUtf=function(e){var t=this;-1!==e.text.search(/&#/)&&(e.text=this.decHexToUtf(e.text)),-1!==e.text.search(/&[a-z]/i)&&(e.text=e.text.replace(/&[a-z\d]{2,31};/gi,function(e){var n=t.entitiesByNameEntity[e];return n?n.utf:e})),-1!==e.text.search(/\\u[\da-f]/i)&&(e.text=e.text.replace(/\\u[\da-f]{4};/gi,function(e){var n=t.entitiesByJsEntity[e.toLowerCase()];return n?n.utf:e}))},n.prototype.decHexToUtf=function(e){return e.replace(/&#(\d{1,6});/gi,function(e,n){return String.fromCharCode(parseInt(n,10))}).replace(/&#x([\da-f]{1,6});/gi,function(e,n){return String.fromCharCode(parseInt(n,16))})},n.prototype.restore=function(e){var n,t=e.prefs.htmlEntity,r=t.type;"default"!==r&&(n=this.entities,(t.onlyInvisible||t.list)&&(n=[],t.onlyInvisible&&(n=n.concat(this.invisibleEntities)),t.list)&&(n=n.concat(this.prepareListParam(t.list))),e.text=this.restoreEntitiesByIndex(e.text,r,n))},n.prototype.getByUtf=function(e,n){switch(n){case"digit":return this.entitiesByDigitEntity[e];case"name":return this.entitiesByNameEntity[e];case"js":return this.entitiesByJsEntity[e]}return e},n.prototype.prepareEntities=function(e){var r=[];return e.forEach(function(e){var n=e[0],e=e[1],t=String.fromCharCode(e);r.push({name:n,utf:t,reUtf:new RegExp(t,"g"),type:{name:"&"+n+";",digit:"&#"+e+";",js:"\\u"+("0000"+e.toString(16)).slice(-4)}})}),r},n.prototype.prepareListParam=function(e){var n=this,t=[];return e.forEach(function(e){e=n.entitiesByName[e];e&&t.push(e)}),t},n.prototype.restoreEntitiesByIndex=function(n,t,e){return e.forEach(function(e){n=n.replace(e.reUtf,e.type[t])}),n};var s=new n,a=[];function o(e){e=(e||"").split("/")[0];e&&"common"!==e&&!i(e)&&(a.push(e),a.sort())}function i(e){return"common"===e||-1!==a.indexOf(e)}function u(e,n){e=e||n;return e?Array.isArray(e)?e:[e]:[]}function c(e){if(!e.length)throw Error('Not defined the property "locale".');e.forEach(function(e){if(!i(e))throw Error('"'.concat(e,'" is not supported locale.'))})}var l={};function z(e){return l[e]}function p(n){Object.keys(n).forEach(function(e){o(e),l[e]=n[e]})}var I=["a","abbr","acronym","b","bdo","big","br","button","cite","code","dfn","em","i","img","input","kbd","label","map","object","q","samp","script","select","small","span","strong","sub","sup","textarea","time","tt","var"],m=new RegExp("(https?|file|ftp)://([a-zA-Z0-9/+-=%&:_.~?]+[a-zA-Z0-9#+]*)","g"),h="\\d+([.,]\\d+)?",C=/\d/;function g(e){return-1<e.search(C)}var d="",f="",O=(b.prototype.add=function(e){this.tags.own.push(this.prepareRegExp(e))},b.prototype.show=function(n,t){for(var e=new RegExp("tf\\d+","g"),r=new RegExp("tf\\d"),a=function(e){return n.safeTags.hidden[t][e]||e},o=0,s=this.tags[t].length;o<s&&(n.text=n.text.replace(e,a),-1!==n.text.search(r));o++);},b.prototype.hide=function(n,e){var t=this,r=(n.safeTags.hidden[e]={},this.pasteLabel.bind(this,n,e));this.tags[e].forEach(function(e){n.text=n.text.replace(t.prepareRegExp(e),r)})},b.prototype.hideHTMLTags=function(e){var n;e.isHTML&&(n=this.pasteLabel.bind(this,e,"html"),e.text=e.text.replace(/<\/?[a-z][^]*?>/gi,n).replace(/<\/?[a-z][^]*?>/gi,n).replace(/&[gl]t;/gi,n))},b.prototype.getPrevLabel=function(e,n){for(var t=n-1;0<=t;t--)if(e[t]===d)return e.slice(t,n+1);return""},b.prototype.getNextLabel=function(e,n){for(var t=n+1;t<e.length;t++)if(e[t]===d)return e.slice(n,t+1);return""},b.prototype.getTagByLabel=function(t,r){var a=null;return this.groups.some(function(e){var n=t.safeTags.hidden[e][r];return a=void 0!==n?{group:e,value:n}:a}),a},b.prototype.getTagInfo=function(e){if(!e)return null;var n={group:e.group};switch(e.group){case"html":n.name=e.value.split(/[<\s>]/)[1],n.isInline=-1<I.indexOf(n.name),n.isClosing=-1<e.value.search(/^<\//);break;case"url":n.isInline=!0;break;case"own":n.isInline=!1}return n},b.prototype.pasteLabel=function(e,n,t){var e=e.safeTags,r="tf"+e.counter+d;return e.hidden[n][r]=t,e.counter++,r},b.prototype.prepareRegExp=function(e){var n,t;return e instanceof RegExp?e:(n=e[0],t=e[2],new RegExp(n+(void 0===t?"[^]*?":t)+e[1],"gi"))},b.prototype.getPrevTagInfo=function(e,n,t){n=this.getPrevLabel(n,t-1);if(n){t=this.getTagByLabel(e,n);if(t)return this.getTagInfo(t)}return null},b.prototype.getNextTagInfo=function(e,n,t){n=this.getNextLabel(n,t+1);if(n){t=this.getTagByLabel(e,n);if(t)return this.getTagInfo(t)}return null},b);function b(){this.groups=["own","html","url"],this.hidden={},this.counter=0;var n=[["\x3c!--","--\x3e"],["<!ENTITY",">"],["<!DOCTYPE",">"],["<\\?xml","\\?>"],["<!\\[CDATA\\[","\\]\\]>"]];["code","kbd","object","pre","samp","script","style","var"].forEach(function(e){n.push(["<".concat(e,"(\\s[^>]*?)?>"),"</".concat(e,">")])}),this.tags={own:[],html:n.map(this.prepareRegExp),url:[m]}}function $(e,n){for(var t="";1==(1&n)&&(t+=e),0!=(n>>>=1);)e+=e;return t}function y(e){return e.replace(/\u00A0/g," ")}function x(e,n){for(var t=0;t<n.length;t++)e=e.replace(n[t][0],n[t][1]);return e}function H(e){return-1!==e.search(/(<\/?[a-z]|<!|&[lg]t;)/i)}function v(e){return"object"==typeof e?JSON.parse(JSON.stringify(e)):e}var j={symbols:110,number:150,space:210,dash:310,punctuation:410,nbsp:510,money:710,date:810,other:910,optalign:1010,typo:1110,html:1210},Q=0,F="default",Y=[],W=[];function R(){var e=t([],Y,!0);return e.sort(function(e,n){return e.index>n.index?1:-1}),e}function X(){return t([],W,!0)}function G(e){var n=e.name.split("/"),t=n[0];return{name:e.name,shortName:n[2],handler:e.handler,queue:e.queue||F,enabled:!0!==e.disabled,locale:t,group:n[1],index:"number"==typeof(t=e).index?t.index:(n=t.name.split("/")[1],void 0===(n=j[n])&&(n=Q),"string"==typeof t.index?n+parseInt(t.index,10):n),settings:e.settings,live:e.live,htmlAttrs:e.htmlAttrs}}function J(e){return{type:(null==e?void 0:e.type)||"default",list:null==e?void 0:e.list,onlyInvisible:Boolean(null==e?void 0:e.onlyInvisible)}}function K(e){return e||"LF"}S.addRule=function(e){o((e=G(e=e)).locale),Y.push(e)},S.addRules=function(e){var n=this;e.forEach(function(e){n.addRule(e)})},S.addInnerRule=function(e){W.push(G(e))},S.addInnerRules=function(e){var n=this;e.forEach(function(e){n.addInnerRule(e)})},S.getRule=function(n){var t=null;return R().some(function(e){return e.name===n&&(t=e,!0)}),t},S.getRules=R,S.getInnerRules=X,S.getLocales=function(){return a},S.addLocale=function(e){o(e)},S.hasLocale=i,S.setData=function(e){p(e)},S.getData=function(e){return l[e]},S.prototype.execute=function(e,n){var t;return(e=""+e)?(t=this.prefs,n=n,t=r({},t),n&&("locale"in n&&(t.locale=u(n.locale)),"htmlEntity"in n&&(t.htmlEntity=J(n.htmlEntity)),"lineEnding"in n&&(t.lineEnding=K(n.lineEnding)),"processingSeparateParts"in n&&(t.processingSeparateParts=n.processingSeparateParts),"ruleFilter"in n)&&(t.ruleFilter=n.ruleFilter),c((n=t).locale),t=this.prepareContext(e,n),this.process(t)):""},S.prototype.getSetting=function(e,n){return this.settings[e]&&this.settings[e][n]},S.prototype.setSetting=function(e,n,t){this.settings[e]=this.settings[e]||{},this.settings[e][n]=t},S.prototype.isEnabledRule=function(e){return!1!==this.enabledRules[e]},S.prototype.isDisabledRule=function(e){return!this.enabledRules[e]},S.prototype.enableRule=function(e){return this.enable(e,!0)},S.prototype.disableRule=function(e){return this.enable(e,!1)},S.prototype.addSafeTag=function(e,n,t){e=e instanceof RegExp?e:[e,n,t];this.safeTags.add(e)},S.prototype.prepareContext=function(e,t){return{text:e,isHTML:H(e),prefs:t,getData:function(n){return"char"===n?t.locale.map(function(e){return l[e+"/"+n]}).join(""):z(t.locale[0]+"/"+n)},safeTags:this.safeTags}},S.prototype.splitBySeparateParts=function(a){var o,e,s;return a.isHTML&&!1!==a.prefs.processingSeparateParts?(o=[],e=new RegExp("<("+this.separatePartsTags.join("|")+")(\\s[^>]*?)?>[^]*?</\\1>","gi"),s=0,a.text.replace(e,function(e,n,t,r){return s!==r&&o.push((s?f:"")+a.text.slice(s,r)+f),o.push(e),s=r+e.length,e}),o.push(s?f+a.text.slice(s,a.text.length):a.text),o):[a.text]},S.prototype.process=function(n){var e,t=this,r=(n.text=n.text.replace(/\r\n?/g,"\n"),this.executeRules(n,"start"),this.safeTags.hide(n,"own"),this.executeRules(n,"hide-safe-tags-own"),this.safeTags.hide(n,"html"),this.executeRules(n,"hide-safe-tags-html"),n.isHTML),a=new RegExp(f,"g");return n.text=this.splitBySeparateParts(n).map(function(e){return n.text=e,n.isHTML=H(e),t.safeTags.hideHTMLTags(n),t.safeTags.hide(n,"url"),t.executeRules(n,"hide-safe-tags-url"),t.executeRules(n,"hide-safe-tags"),s.toUtf(n),n.prefs.live&&(n.text=y(n.text)),t.executeRules(n,"utf"),t.executeRules(n),s.restore(n),t.executeRules(n,"html-entities"),t.safeTags.show(n,"url"),t.executeRules(n,"show-safe-tags-url"),n.text.replace(a,"")}).join(""),n.isHTML=r,this.safeTags.show(n,"html"),this.executeRules(n,"show-safe-tags-html"),this.safeTags.show(n,"own"),this.executeRules(n,"show-safe-tags-own"),this.executeRules(n,"end"),r=n.text,"CRLF"===(e=n.prefs.lineEnding)?r.replace(/\n/g,"\r\n"):"CR"===e?r.replace(/\n/g,"\r"):r},S.prototype.executeRules=function(n,e){var t=this,r=this.rulesByQueues[e=void 0===e?F:e],e=this.innerRulesByQueues[e];e&&e.forEach(function(e){t.ruleIterator(n,e)}),r&&r.forEach(function(e){t.ruleIterator(n,e)})},S.prototype.ruleIterator=function(e,n){!0===e.prefs.live&&!1===n.live||!1===e.prefs.live&&!0===n.live||"common"!==n.locale&&n.locale!==e.prefs.locale[0]||!this.isEnabledRule(n.name)||e.prefs.ruleFilter&&!e.prefs.ruleFilter(n)||(this.onBeforeRule&&this.onBeforeRule(n.name,e),e.text=n.handler.call(this,e.text,this.settings[n.name],e),this.onAfterRule&&this.onAfterRule(n.name,e))},S.prototype.prepareRuleSettings=function(e){this.settings[e.name]=v(e.settings),this.enabledRules[e.name]=e.enabled},S.prototype.enable=function(e,n){var t=this;Array.isArray(e)?e.forEach(function(e){t.enableByMask(e,n)}):this.enableByMask(e,n)},S.prototype.enableByMask=function(e,n){var t,r=this;e&&(-1!==e.search(/\*/)?(t=new RegExp(e.replace(/\//g,"\\/").replace(/\*/g,".*")),this.rules.forEach(function(e){e=e.name;t.test(e)&&(r.enabledRules[e]=n)})):this.enabledRules[e]=n)},S.groups=[],S.titles={},S.version="7.6.0";var w=S;function S(e){var n=this;this.rules=[],this.innerRules=[],this.rulesByQueues={},this.innerRulesByQueues={},this.separatePartsTags=["title","p","h[1-6]","select","legend"],this.prefs={locale:u((e=e).locale),lineEnding:K(e.lineEnding),live:Boolean(e.live),ruleFilter:e.ruleFilter,enableRule:e.enableRule,disableRule:e.disableRule,processingSeparateParts:e.processingSeparateParts,htmlEntity:J(e.htmlEntity)},c(this.prefs.locale),this.safeTags=new O,this.settings={},this.enabledRules={},this.innerRulesByQueues={},this.innerRules=X(),this.innerRules.forEach(function(e){n.innerRulesByQueues[e.queue]=n.innerRulesByQueues[e.queue]||[],n.innerRulesByQueues[e.queue].push(e)}),this.rulesByQueues={},this.rules=R(),this.rules.forEach(function(e){n.prepareRuleSettings(e),n.rulesByQueues[e.queue]=n.rulesByQueues[e.queue]||[],n.rulesByQueues[e.queue].push(e)}),this.prefs.disableRule&&this.disableRule(this.prefs.disableRule),this.prefs.enableRule&&this.enableRule(this.prefs.enableRule)}[{"common/char":"a-z","common/dash":"--?|‒|–|—","common/quote":'«‹»›„“‟”"'},{"be/char":"абвгдежзйклмнопрстуфхцчшыьэюяёіўґ","be/quote":{left:"«“",right:"»”"}},{"bg/char":"абвгдежзийклмнопрстуфхцчшщъьюя","bg/quote":{left:"„’",right:"“’"}},{"ca/char":"abcdefghijlmnopqrstuvxyzàçèéíïòóúü","ca/quote":{left:"«“",right:"»”"}},{"cs/char":"a-záéíóúýčďěňřšťůž","cs/quote":{left:"„‚",right:"“‘"}},{"da/char":"a-zåæø","da/quote":{left:"»›",right:"«‹"}},{"de/char":"a-zßäöü","de/quote":{left:"„‚",right:"“‘"}},{"el/char":"ΐάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώϲάέήίόύώ","el/quote":{left:"«“",right:"»”"}},{"en-GB/char":"a-z","en-GB/quote":{left:"‘“",right:"’”"},"en-GB/shortWord":"a|an|and|as|at|bar|but|by|for|if|in|nor|not|of|off|on|or|out|per|pro|so|the|to|up|via|yet"},{"en-US/char":"a-z","en-US/quote":{left:"“‘",right:"”’"},"en-US/shortWord":"a|an|and|as|at|bar|but|by|for|if|in|nor|not|of|off|on|or|out|per|pro|so|the|to|up|via|yet"},{"eo/char":"abcdefghijklmnoprstuvzĉĝĥĵŝŭ","eo/quote":{left:"“‘",right:"”’"}},{"es/char":"a-záéíñóúü","es/quote":{left:"«“",right:"»”"}},{"et/char":"abdefghijklmnoprstuvzäõöüšž","et/quote":{left:"„«",right:"“»"}},{"fi/char":"abcdefghijklmnopqrstuvyöäå","fi/quote":{left:"”’",right:"”’"}},{"fr/char":"a-zàâçèéêëîïôûüœæ","fr/quote":{left:"«‹",right:"»›",spacing:!0}},{"ga/char":"abcdefghilmnoprstuvwxyzáéíóú","ga/quote":{left:"“‘",right:"”’"}},{"hu/char":"a-záäéíóöúüőű","hu/quote":{left:"„»",right:"”«"}},{"it/char":"a-zàéèìòù","it/quote":{left:"«“",right:"»”"},"it/shortWord":"a|da|di|in|la|il|lo|e|o|se|su|che|come|ma|è|ho|ha|sa"},{"lv/char":"abcdefghijklmnopqrstuvxzæœ","lv/quote":{left:"«„",right:"»“"}},{"nl/char":"a-zäçèéêëîïñöûü","nl/quote":{left:"‘“",right:"’”"}},{"no/char":"a-zåæèéêòóôø","no/quote":{left:"«’",right:"»’"}},{"pl/char":"abcdefghijklmnoprstuvwxyzóąćęłńśźż","pl/quote":{left:"„«",right:"”»"}},{"ro/char":"abcdefghijklmnoprstuvxzîășț","ro/quote":{left:"„«",right:"”»"}},{"ru/char":"а-яё","ru/dashBefore":"(^| |\\n)","ru/dashAfter":"(?=[ ,.?:!]|$)","ru/dashAfterDe":"(?=[,.?:!]|[ ][^А-ЯЁ]|$)","ru/l":"а-яёa-z","ru/L":"А-ЯЁA-Z","ru/month":"январь|февраль|март|апрель|май|июнь|июль|август|сентябрь|октябрь|ноябрь|декабрь","ru/monthGenCase":"января|февраля|марта|апреля|мая|июня|июля|августа|сентября|октября|ноября|декабря","ru/monthPreCase":"январе|феврале|марте|апреле|мае|июне|июле|августе|сентябре|октябре|ноябре|декабре","ru/quote":{left:"«„‚",right:"»“‘",removeDuplicateQuotes:!0},"ru/shortMonth":"янв|фев|мар|апр|ма[ейя]|июн|июл|авг|сен|окт|ноя|дек","ru/shortWord":"а|без|в|во|если|да|до|для|за|и|или|из|к|ко|как|ли|на|но|не|ни|о|об|обо|от|по|про|при|под|с|со|то|у","ru/weekday":"понедельник|вторник|среда|четверг|пятница|суббота|воскресенье"},{"sk/char":"abcdefghijklmnoprstuvwxyzáäéíóôúýčďľňŕšťž","sk/quote":{left:"„‚",right:"“‘"}},{"sl/char":"a-zčšž","sl/quote":{left:"„‚",right:"“‘"}},{"sr/char":"abcdefghijklmnoprstuvzćčđšž","sr/quote":{left:"„’",right:"”’"}},{"sv/char":"a-zäåéö","sv/quote":{left:"”’",right:"”’"}},{"tr/char":"abcdefghijklmnoprstuvyzâçîöûüğış","tr/quote":{left:"“‘",right:"”’"}},{"uk/char":"абвгдежзийклмнопрстуфхцчшщьюяєіїґ","uk/quote":{left:"«„",right:"»“"}}].forEach(p);var V={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},E={name:"common/html/escape",index:"+100",queue:"end",handler:function(e){return e.replace(/[&<>"'/]/g,function(e){return V[e]})},disabled:!0},Z=new RegExp("<("+["address","article","aside","blockquote","canvas","dd","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","li","main","nav","noscript","ol","output","p","pre","section","table","tfoot","ul","video"].join("|")+")[>\\s]"),E=(w.addRules([{name:"common/html/e-mail",queue:"end",handler:function(e,n,t){return t.isHTML?e:e.replace(/(^|[\s;(])([\w\-.]{2,64})@([\w\-.]{2,64})\.([a-z]{2,64})([)\s.,!?]|$)/gi,'$1<a href="mailto:$2@$3.$4">$2@$3.$4</a>$5')},disabled:!0,htmlAttrs:!1},E,{name:"common/html/nbr",index:"+10",queue:"end",handler:function(e){return e.replace(/([^\n>])\n(?=[^\n])/g,"$1<br/>\n")},disabled:!0,htmlAttrs:!1},{name:"common/html/p",index:"+5",queue:"end",handler:function(e){e=e.split("\n\n");return e.forEach(function(e,n,t){!e.trim()||Z.test(e)||(t[n]=e.replace(/^(\s*)/,"$1<p>").replace(/(\s*)$/,"</p>$1"))}),e.join("\n\n")},disabled:!0,htmlAttrs:!1},{name:"common/html/processingAttrs",queue:"hide-safe-tags-own",handler:function(e,n,t){var s=this,r=new RegExp("(^|\\s)("+n.attrs.join("|")+")=(\"[^\"]*?\"|'[^']*?')","gi"),i=v(t.prefs);return i.ruleFilter=function(e){return!1!==e.htmlAttrs},e.replace(/(<[-\w]+\s)([^>]+?)(?=>)/g,function(e,n,t){return n+t.replace(r,function(e,n,t,r){var a=r[0],o=r[r.length-1],r=r.slice(1,-1);return n+t+"="+a+s.execute(r,i)+o})})},settings:{attrs:["title","placeholder"]},disabled:!0,htmlAttrs:!1},{name:"common/html/quot",queue:"hide-safe-tags",handler:function(e){return e.replace(/"/g,'"')}},{name:"common/html/stripTags",index:"+99",queue:"end",handler:function(e){return e.replace(/<[^>]+>/g,"")},disabled:!0},{name:"common/html/url",queue:"end",handler:function(e,n,t){return t.isHTML?e:e.replace(m,function(e,n,t){t=t.replace(/([^/]+\/?)(\?|#)$/,"$1").replace(/^([^/]+)\/$/,"$1"),"http"===n?t=t.replace(/^([^/]+)(:80)([^\d]|\/|$)/,"$1$3"):"https"===n&&(t=t.replace(/^([^/]+)(:443)([^\d]|\/|$)/,"$1$3"));var r=t,t=n+"://"+t,a='<a href="'+t+'">';return"http"===n||"https"===n?(r=r.replace(/^www\./,""),a+("http"===n?r:n+"://"+r)+"</a>"):a+t+"</a>"})},disabled:!0,htmlAttrs:!1}]),{name:"common/nbsp/afterNumber",handler:function(e,n,t){t=t.getData("char");return e.replace(new RegExp("(^|\\s)(\\d{1,5}) (["+t+"]+)","gi"),"$1$2 $3")},disabled:!0});function _(e,n,t,r){return n+t.replace(/([^\u00A0])\u00A0([^\u00A0])/g,"$1 $2")+r}w.addRules([E,{name:"common/nbsp/afterParagraphMark",handler:function(e){return e.replace(/¶ ?(?=\d)/g,"¶ ")}},{name:"common/nbsp/afterSectionMark",handler:function(e,n,t){t=t.prefs.locale[0];return e.replace(/§[ \u00A0\u2009]?(?=\d|I|V|X)/g,"ru"===t?"§ ":"§ ")}},{name:"common/nbsp/afterShortWord",handler:function(e,n,t){var n=n.lengthShortWord,r=l["common/quote"],t=t.getData("char"),r=new RegExp("(^|["+(" ("+r)+"])(["+t+"]{1,"+n+"}) ","gim");return e.replace(r,"$1$2 ").replace(r,"$1$2 ")},settings:{lengthShortWord:2}},{name:"common/nbsp/afterShortWordByList",handler:function(e,n,t){var r=l["common/quote"],t=t.getData("shortWord"),r=new RegExp("(^|["+(" ("+r)+"])("+t+") ","gim");return e.replace(r,"$1$2 ").replace(r,"$1$2 ")}},{name:"common/nbsp/beforeShortLastNumber",handler:function(e,n,t){var r=t.getData("quote"),t=t.getData("char"),a=t.toUpperCase(),t=new RegExp("(["+t+a+"]) (?=\\d{1,"+n.lengthLastNumber+"}[-+−%'\""+r.right+")]?([.!?…]( ["+a+"]|$)|$))","gm");return e.replace(t,"$1 ")},live:!1,settings:{lengthLastNumber:2}},{name:"common/nbsp/beforeShortLastWord",handler:function(e,n,t){var t=t.getData("char"),r=t.toUpperCase(),t=new RegExp("(["+t+"\\d]) (["+t+r+"]{1,"+n.lengthLastWord+"}[.!?…])( ["+r+"]|$)","g");return e.replace(t,"$1 $2$3")},settings:{lengthLastWord:3}},{name:"common/nbsp/dpi",handler:function(e){return e.replace(/(\d) ?(lpi|dpi)(?!\w)/,"$1 $2")}},{name:"common/nbsp/nowrap",queue:"end",handler:function(e){return e.replace(/(<nowrap>)(.*?)(<\/nowrap>)/g,_).replace(/(<nobr>)(.*?)(<\/nobr>)/g,_)}},{name:"common/nbsp/replaceNbsp",queue:"utf",live:!1,handler:y,disabled:!0}]);E={name:"common/number/digitGrouping",index:"310",disabled:!0,handler:function(e,a){return e.replace(new RegExp("(^ ?|\\D |".concat(d,")(\\d{1,3}([ ]\\d{3})+)(?! ?[\\d-])"),"gm"),function(e,n,t){return n+t.replace(/\s/g,a.space)}).replace(/(\d{5,}([.,]\d+)?)/g,function(e,n){var t=n.match(/[.,]/),n=t?n.split(t):[n],r=n[0],n=n[1],r=r.replace(/(\d)(?=(\d{3})+([^\d]|$))/g,"$1"+a.space);return t?r+t+n:r})},settings:{space:" "}},w.addRules([E,{name:"common/number/fraction",handler:function(e){return e.replace(/(^|\D)1\/2(\D|$)/g,"$1½$2").replace(/(^|\D)1\/4(\D|$)/g,"$1¼$2").replace(/(^|\D)3\/4(\D|$)/g,"$1¾$2")}},{name:"common/number/mathSigns",handler:function(e){return x(e,[[/!=/g,"≠"],[/<=/g,"≤"],[/(^|[^=])>=/g,"$1≥"],[/<=>/g,"⇔"],[/<</g,"≪"],[/>>/g,"≫"],[/~=/g,"≅"],[/(^|[^+])\+-/g,"$1±"]])}},{name:"common/number/times",handler:function(e){return e.replace(/(\d)[ \u00A0]?[xх][ \u00A0]?(\d)/g,"$1×$2")}}]),w.addRules([{name:"common/other/delBOM",queue:"start",index:-1,handler:function(e){return 65279===e.charCodeAt(0)?e.slice(1):e}},{name:"common/other/repeatWord",handler:function(e,n,t){var r=l["common/quote"],t=t.getData("char"),r="[;:,.?! \n"+r+"]",t=new RegExp("("+r+"|^)(["+t+"]{"+n.min+",})[ ]\\2("+r+"|$)","gi");return e.replace(t,"$1$2$3")},settings:{min:2},disabled:!0}]),E={name:"common/punctuation/apostrophe",handler:function(e,n,t){t="(["+t.getData("char")+"])",t=new RegExp(t+"'"+t,"gi");return e.replace(t,"$1’$2")}};function U(){this.bufferQuotes={left:"",right:""},this.beforeLeft=" \n\t [(",this.afterRight=" \n\t !?.:;#*,…)\\]"}U.prototype.process=function(e){var n,t,r=e.context.text;return this.count(r).total&&(n=e.settings,(t=e.settings.left[0]===e.settings.right[0])&&(e.settings=v(e.settings),e.settings.left=this.bufferQuotes.left.slice(0,e.settings.left.length),e.settings.right=this.bufferQuotes.right.slice(0,e.settings.right.length)),e.settings.spacing&&(r=this.removeSpacing(r,e.settings)),r=this.set(r,e),e.settings.spacing&&(r=this.setSpacing(r,e.settings)),e.settings.removeDuplicateQuotes&&(r=this.removeDuplicates(r,e.settings)),t)&&(r=this.returnOriginalQuotes(r,n,e.settings),e.settings=n),r},U.prototype.returnOriginalQuotes=function(e,n,t){for(var r={},a=0;a<t.left.length;a++)r[t.left[a]]=n.left[a],r[t.right[a]]=n.right[a];return e.replace(new RegExp("["+t.left+t.right+"]","g"),function(e){return r[e]})},U.prototype.count=function(e){var n={total:0};return e.replace(new RegExp("["+l["common/quote"]+"]","g"),function(e){return n[e]||(n[e]=0),n[e]++,n.total++,e}),n},U.prototype.removeDuplicates=function(e,n){var t=n.left[0],r=n.left[1]||t,n=n.right[0];return t!==r?e:e.replace(new RegExp(t+t,"g"),t).replace(new RegExp(n+n,"g"),n)},U.prototype.removeSpacing=function(e,n){for(var t=0,r=n.left.length;t<r;t++){var a=n.left[t],o=n.right[t];e=e.replace(new RegExp(a+"([ ])","g"),a).replace(new RegExp("([ ])"+o,"g"),o)}return e},U.prototype.setSpacing=function(e,n){for(var t=0,r=n.left.length;t<r;t++){var a=n.left[t],o=n.right[t];e=e.replace(new RegExp(a+"([^ ])","g"),a+" $1").replace(new RegExp("([^ ])"+o,"g"),"$1 "+o)}return e},U.prototype.set=function(e,n){var t=l["common/quote"],r=n.settings.left[0],a=n.settings.left[1]||r,o=n.settings.right[0],s=new RegExp("(^|["+this.beforeLeft+"])(["+t+"]+)(?=[^\\s"+d+"])","gim"),t=new RegExp("([^\\s])(["+t+"]+)(?=["+this.afterRight+"]|$)","gim");return e=e.replace(s,function(e,n,t){return n+$(r,t.length)}).replace(t,function(e,n,t){return n+$(o,t.length)}),e=this.setAboveTags(e,n),e=r!==a?this.setInner(e,n.settings):e},U.prototype.setAboveTags=function(o,s){var i=this,u=s.settings.left[0],c=s.settings.right[0];return o.replace(new RegExp("(^|.)(["+l["common/quote"]+"])(.|$)","gm"),function(e,n,t,r,a){return n!==d&&r!==d?e:n===d&&r===d?'"'===t?n+i.getAboveTwoTags(o,a+1,s)+r:e:n===d?(t=-1<i.afterRight.indexOf(r),e=s.safeTags.getPrevTagInfo(s.context,o,a+1),t&&e&&"html"===e.group?n+(e.isClosing?c:u)+r:n+(!r||t?c:u)+r):(e=-1<i.beforeLeft.indexOf(n),t=s.safeTags.getNextTagInfo(s.context,o,a+1),e&&t&&"html"===t.group?n+(t.isClosing?c:u)+r:n+(!n||e?u:c)+r)})},U.prototype.getAboveTwoTags=function(e,n,t){var r=t.safeTags.getPrevTagInfo(t.context,e,n),a=t.safeTags.getNextTagInfo(t.context,e,n);if(r&&"html"===r.group){if(!r.isClosing)return t.settings.left[0];if(a&&a.isClosing&&r.isClosing)return t.settings.right[0]}return e[n]},U.prototype.setInner=function(e,n){for(var t=n.left[0],r=n.right[0],a=this.getMaxLevel(e,t,r,n.left.length),o=0,s="",i=0,u=e.length;i<u;i++){var c=e[i];c===t?(s+=n.left[a-1<o?a-1:o],a<++o&&(o=a)):c===r?(--o<0&&(o=0),s+=n.right[o]):('"'===c&&(o=0),s+=c)}return s},U.prototype.getMaxLevel=function(e,n,t,r){e=this.count(e);return e[n]===e[t]?r:Math.min(r,2)};var ee=new U,ne={},k=(a.forEach(function(e){ne[e]=v(l[e+"/quote"])}),{name:"common/punctuation/quote",handler:function(e,n,t){n=n[t.prefs.locale[0]];return n?ee.process({context:t,settings:n,safeTags:this.safeTags}):e},settings:ne}),E=(w.addRules([E,{name:"common/punctuation/delDoublePunctuation",handler:function(e){return e.replace(/(^|[^,]),,(?!,)/g,"$1,").replace(/(^|[^:])::(?!:)/g,"$1:").replace(/(^|[^!?.])\.\.(?!\.)/g,"$1.").replace(/(^|[^;]);;(?!;)/g,"$1;").replace(/(^|[^?])\?\?(?!\?)/g,"$1?")}},{name:"common/punctuation/hellip",handler:function(e,n,t){return"ru"===t.prefs.locale[0]?e.replace(/(^|[^.])\.{3,4}(?=[^.]|$)/g,"$1…"):e.replace(/(^|[^.])\.{3}(\.?)(?=[^.]|$)/g,"$1…$2")}},k,{name:"common/punctuation/quoteLink",queue:"show-safe-tags-html",index:"+5",handler:function(e,n,t){var t=this.getSetting("common/punctuation/quote",t.prefs.locale[0]),r=s.getByUtf(t.left[0]),a=s.getByUtf(t.right[0]),o=(o=s.getByUtf(t.left[1]))?"|"+o:"",t=(t=s.getByUtf(t.right[1]))?"|"+t:"",r=new RegExp("(<[aA]\\s[^>]*?>)("+r+o+")([^]*?)("+a+t+")(</[aA]>)","g");return e.replace(r,"$2$1$3$5$4")}}]),{name:"common/space/beforeBracket",handler:function(e,n,t){t=t.getData("char"),t=new RegExp("(["+t+".!?,;…)])\\(","gi");return e.replace(t,"$1 (")}}),k={name:"common/space/delRepeatN",index:"-1",handler:function(e,n){var n=n.maxConsecutiveLineBreaks,t=new RegExp("\n{".concat(n+1,",}"),"g"),n=$("\n",n);return e.replace(t,n)},settings:{maxConsecutiveLineBreaks:2}},q={name:"common/space/trimLeft",index:"-4",handler:String.prototype.trimLeft?function(e){return e.trimLeft()}:function(e){return e.replace(/^[\s\uFEFF\xA0]+/g,"")}},te={name:"common/space/trimRight",index:"-3",live:!1,handler:String.prototype.trimRight?function(e){return e.trimRight()}:function(e){return e.replace(/[\s\uFEFF\xA0]+$/g,"")}},re=new RegExp('(\\D):([^)",:.?\\s\\/\\\\])',"g"),B={name:"common/space/afterColon",handler:function(e){return e.replace(re,"$1: $2")}},T={name:"common/space/afterComma",handler:function(e,n,t){t=t.getData("quote"),t="string"==typeof t?t:t.right;return e.replace(new RegExp('(.),([^)",:.?\\s\\/\\\\'+t+"])","g"),function(e,n,t){return g(n)&&g(t)?e:n+", "+t})}},ae=new RegExp("\\?([^).…!;?\\s[\\])"+l["common/quote"]+"])","g"),A={name:"common/space/afterQuestionMark",handler:function(e){return e.replace(ae,"? $1")}},oe=new RegExp("!([^).…!;?\\s[\\])"+l["common/quote"]+"])","g"),L={name:"common/space/afterExclamationMark",handler:function(e){return e.replace(oe,"! $1")}},se=new RegExp(";([^).…!;?\\s[\\])"+l["common/quote"]+"])","g"),B=(w.addRules([B,T,A,L,{name:"common/space/afterSemicolon",handler:function(e){return e.replace(se,"; $1")}},E,{name:"common/space/bracket",handler:function(e){return e.replace(/(\() +/g,"(").replace(/ +\)/g,")")}},{name:"common/space/delBeforeDot",handler:function(e){return e.replace(/(^|[^!?:;,.…]) (\.|\.\.\.)(\s|$)/g,"$1$2$3")}},{name:"common/space/delBeforePercent",handler:function(e){return e.replace(/(\d)( |\u00A0)(%|‰|‱)/g,"$1$3")}},{name:"common/space/delBeforePunctuation",handler:function(e){return e.replace(/(^|[^!?:;,.…]) ([!?:;,])(?!\))/g,"$1$2")}},{name:"common/space/delBetweenExclamationMarks",handler:function(e){return e.replace(/([!?]) (?=[!?])/g,"$1")}},{name:"common/space/delLeadingBlanks",handler:function(e){return e.replace(/^[ \t]+/gm,"")},disabled:!0},k,{name:"common/space/delRepeatSpace",index:"-1",handler:function(e){return e.replace(/([^\n \t])[ \t]{2,}(?![\n \t])/g,"$1 ")}},{name:"common/space/delTrailingBlanks",index:"-3",handler:function(e){return e.replace(/[ \t]+\n/g,"\n")}},{name:"common/space/insertFinalNewline",queue:"end",handler:function(e){return"\n"===e[e.length-1]?e:e+"\n"},live:!1,disabled:!0},{name:"common/space/replaceTab",index:"-5",handler:function(e){return e.replace(/\t/g," ")}},{name:"common/space/squareBracket",handler:function(e){return e.replace(/(\[) +/g,"[").replace(/ +\]/g,"]")}},q,te]),{name:"common/symbols/arrow",handler:function(e){return x(e,[[/(^|[^-])->(?!>)/g,"$1→"],[/(^|[^<])<-(?!-)/g,"$1←"]])}}),T=(w.addRules([B,{name:"common/symbols/cf",handler:function(e){var n=new RegExp('(^|[\\s(\\[+≈±−—–\\-])(\\d+(?:[.,]\\d+)?)[ ]?(C|F)([\\W\\s.,:!?")\\]]|$)',"mg");return e.replace(n,"$1$2 °$3$4")}},{name:"common/symbols/copy",handler:function(e){return x(e,[[/\(r\)/gi,"®"],[/(copyright )?\((c|с)\)/gi,"©"],[/\(tm\)/gi,"™"]])}}]),{name:"en-US/dash/main",index:"-5",handler:function(e){var n=l["common/dash"],t="[ ".concat(" ","]"),r="[ ".concat(" ","\n]"),t=new RegExp("".concat(t,"(").concat(n,")(").concat(r,")"),"g");return e.replace(t,"".concat(" ").concat("—","$2"))}}),A=(w.addRules([T]),{name:"ru/dash/centuries",handler:function(e,n){var t=new RegExp("(X|I|V)[ | ]?"+("("+l["common/dash"]+")")+"[ | ]?(X|I|V)","g");return e.replace(t,"$1"+n.dash+"$3")},settings:{dash:"–"}}),L=(w.addRules([A,{name:"ru/dash/daysMonth",handler:function(e,n){var t=new RegExp("(^|\\s)([123]?\\d)("+l["common/dash"]+")([123]?\\d)[ ]("+l["ru/monthGenCase"]+")","g");return e.replace(t,"$1$2"+n.dash+"$4 $5")},settings:{dash:"–"}},{name:"ru/dash/de",handler:function(e){var n=new RegExp("([a-яё]+) де"+l["ru/dashAfterDe"],"g");return e.replace(n,"$1-де")},disabled:!0},{name:"ru/dash/decade",handler:function(e,n){var t=new RegExp("(^|\\s)(\\d{3}|\\d)0("+l["common/dash"]+")(\\d{3}|\\d)0(-е[ ])(?=г\\.?[ ]?г|год)","g");return e.replace(t,"$1$20"+n.dash+"$40$5")},settings:{dash:"–"}},{name:"ru/dash/directSpeech",handler:function(e){var n=l["common/dash"],t=new RegExp('(["»‘“,])[ | ]?('.concat(n,")[ | ]"),"g"),r=new RegExp("(^|".concat(d,")(").concat(n,")( | )"),"gm"),n=new RegExp("([.…?!])[ ](".concat(n,")[ ]"),"g");return e.replace(t,"$1 — ").replace(r,"$1— ").replace(n,"$1 — ")}},{name:"ru/dash/izpod",handler:function(e){var n=new RegExp(l["ru/dashBefore"]+"(И|и)з под"+l["ru/dashAfter"],"g");return e.replace(n,"$1$2з-под")}},{name:"ru/dash/izza",handler:function(e){var n=new RegExp(l["ru/dashBefore"]+"(И|и)з за"+l["ru/dashAfter"],"g");return e.replace(n,"$1$2з-за")}},{name:"ru/dash/ka",handler:function(e){var n=new RegExp("([a-яё]+) ка(сь)?"+l["ru/dashAfter"],"g");return e.replace(n,"$1-ка$2")}},{name:"ru/dash/koe",handler:function(e){var n=new RegExp(l["ru/dashBefore"]+"([Кк]о[ей])\\s([а-яё]{3,})"+l["ru/dashAfter"],"g");return e.replace(n,"$1$2-$3")}},{name:"ru/dash/main",index:"-5",handler:function(e){var n=new RegExp("([ ])("+l["common/dash"]+")([ \\n])","g");return e.replace(n," —$3")}},{name:"ru/dash/month",handler:function(e,n){var t="("+l["ru/month"]+")",r="("+l["ru/monthPreCase"]+")",a=l["common/dash"],t=new RegExp(t+" ?("+a+") ?"+t,"gi"),a=new RegExp(r+" ?("+a+") ?"+r,"gi"),r="$1"+n.dash+"$3";return e.replace(t,r).replace(a,r)},settings:{dash:"–"}},{name:"ru/dash/surname",handler:function(e){var n=new RegExp("([А-ЯЁ][а-яё]+)\\s-([а-яё]{1,3})(?![^а-яё]|$)","g");return e.replace(n,"$1 —$2")}},{name:"ru/dash/taki",handler:function(e){var n=new RegExp("(верно|довольно|опять|прямо|так|вс[её]|действительно|неужели)\\s(таки)"+l["ru/dashAfter"],"g");return e.replace(n,"$1-$2")}},{name:"ru/dash/time",handler:function(e,n){var t=new RegExp(l["ru/dashBefore"]+"(\\d?\\d:[0-5]\\d)"+l["common/dash"]+"(\\d?\\d:[0-5]\\d)"+l["ru/dashAfter"],"g");return e.replace(t,"$1$2"+n.dash+"$3")},settings:{dash:"–"}},{name:"ru/dash/to",handler:function(e){var n=new RegExp("(^|[^А-ЯЁа-яё\\w])([Оо]ткуда|[Кк]уда|[Гг]де|[Кк]огда|[Зз]ачем|[Пп]очему|[Кк]ак|[Кк]ако[ейм]|[Кк]акая|[Кк]аки[емх]|[Кк]акими|[Кк]акую|[Чч]то|[Чч]его|[Чч]е[йм]|[Чч]ьим?|[Кк]то|[Кк]ого|[Кк]ому|[Кк]ем)( | -|- )(то|либо|нибудь)"+l["ru/dashAfter"],"g");return e.replace(n,function(e,n,t,r,a){r=t+r+a;return"как то"===r||"Как то"===r?e:n+t+"-"+a})}},{name:"ru/dash/kakto",handler:function(e){var n=new RegExp("(^|[^А-ЯЁа-яё\\w])([Кк]ак) то"+l["ru/dashAfter"],"g");return e.replace(n,"$1$2-то")}},{name:"ru/dash/weekday",handler:function(e,n){var t="("+l["ru/weekday"]+")",t=new RegExp(t+" ?("+l["common/dash"]+") ?"+t,"gi");return e.replace(t,"$1"+n.dash+"$3")},settings:{dash:"–"}},{name:"ru/dash/years",handler:function(e,o){var n=new RegExp("(\\D|^)(\\d{4})[ ]?("+l["common/dash"]+")[ ]?(\\d{4})(?=[ ]?г)","g");return e.replace(n,function(e,n,t,r,a){return parseInt(t,10)<parseInt(a,10)?n+t+o.dash+a:e})},settings:{dash:"–"}}]),"(-|\\.|\\/)"),E="(-|\\/)",ie=new RegExp("(^|\\D)(\\d{4})"+L+"(\\d{2})"+L+"(\\d{2})(\\D|$)","gi"),ue=new RegExp("(^|\\D)(\\d{2})"+E+"(\\d{2})"+E+"(\\d{4})(\\D|$)","gi"),k=(w.addRules([{name:"ru/date/fromISO",handler:function(e){return e.replace(ie,"$1$6.$4.$2$7").replace(ue,"$1$4.$2.$6$7")}},{name:"ru/date/weekday",handler:function(e){var n=new RegExp("(\\d)( | )("+l["ru/monthGenCase"]+"),( | )("+l["ru/weekday"]+")","gi");return e.replace(n,function(e,n,t,r,a,o){return n+t+r.toLowerCase()+","+a+o.toLowerCase()})}}]),{name:"ru/money/currency",handler:function(e){var n="([$€¥Ұ£₤₽])",t=new RegExp("(^|[\\D]{2})"+n+" ?("+h+"([ ]\\d{3})*)([ ]?(тыс\\.|млн|млрд|трлн))?","gm"),n=new RegExp("(^|[\\D])("+h+") ?"+n,"gm");return e.replace(t,function(e,n,t,r,a,o,s,i){return n+r+(i?" "+i:"")+" "+t}).replace(n,"$1$2 $4")},disabled:!0});function ce(e,n,t,r){return"дд"===t&&"мм"===r||-1<["рф","ру","рус","орг","укр","бг","срб"].indexOf(r)?e:n+t+". "+r+"."}w.addRules([k,{name:"ru/money/ruble",handler:function(e){var n="$1 ₽",t="(\\d+)( | )?(р|руб)\\.",r=new RegExp("^"+t+"$","g"),a=new RegExp(t+"(?=[!?,:;])","g"),t=new RegExp(t+"(?=\\s+[A-ЯЁ])","g");return e.replace(r,n).replace(a,n).replace(t,n+".")},disabled:!0}]);var le={2:"²","²":"²",3:"³","³":"³","":""};w.addRules([{name:"ru/nbsp/abbr",handler:function(e){var n=new RegExp("(^|\\s|".concat(d,")([а-яё]{1,3})\\. ?([а-яё]{1,3})\\."),"g");return e.replace(n,ce).replace(n,ce)}},{name:"ru/nbsp/addr",handler:function(e){return e.replace(/(\s|^)(дом|д\.|кв\.|под\.|п-д) *(\d+)/gi,"$1$2 $3").replace(/(\s|^)(мкр-н|мк-н|мкр\.|мкрн)\s/gi,"$1$2 ").replace(/(\s|^)(эт\.) *(-?\d+)/gi,"$1$2 $3").replace(/(\s|^)(\d+) +этаж([^а-яё]|$)/gi,"$1$2 этаж$3").replace(/(\s|^)литер\s([А-Я]|$)/gi,"$1литер $2").replace(/(\s|^)(обл|кр|ст|пос|с|д|ул|пер|пр|пр-т|просп|пл|бул|б-р|наб|ш|туп|оф|комн?|уч|вл|влад|стр|кор)\. *([а-яёa-z\d]+)/gi,"$1$2. $3").replace(/(\D[ \u00A0]|^)г\. ?([А-ЯЁ])/gm,"$1г. $2")}},{name:"ru/nbsp/afterNumberSign",handler:function(e){return e.replace(/№[ \u00A0\u2009]?(\d|п\/п)/g,"№ $1")}},{name:"ru/nbsp/beforeParticle",index:"+5",handler:function(e){var n="(ли|ль|же|ж|бы|б)",t=new RegExp("([А-ЯЁа-яё]) "+n+'(?=[,;:?!"‘“»])',"g"),n=new RegExp("([А-ЯЁа-яё])[ ]"+n+"[ ]","g");return e.replace(t,"$1 $2").replace(n,"$1 $2 ")}},{name:"ru/nbsp/centuries",handler:function(e){var n=l["common/dash"],t="(^|\\s)([VIX]+)",r='(?=[,;:?!"‘“»]|$)',a=new RegExp(t+"[ ]?в\\.?"+r,"gm"),t=new RegExp(t+"("+n+")([VIX]+)[ ]?в\\.?([ ]?в\\.?)?"+r,"gm");return e.replace(a,"$1$2 в.").replace(t,"$1$2$3$4 вв.")}},{name:"ru/nbsp/dayMonth",handler:function(e){var n=new RegExp("(\\d{1,2}) ("+l["ru/shortMonth"]+")","gi");return e.replace(n,"$1 $2")}},{name:"ru/nbsp/initials",handler:function(e){var n=new RegExp("(^|[( "+l["ru/quote"].left+d+'"])([А-ЯЁ])\\.[ ]?([А-ЯЁ])\\.[ ]?([А-ЯЁ][а-яё]+)',"gm");return e.replace(n,"$1$2. $3. $4")}},{name:"ru/nbsp/m",index:"+5",handler:function(e){var n=new RegExp("(^|[\\s,.\\(])(\\d+)[ ]?(мм?|см|км|дм|гм|mm?|km|cm|dm)([23²³])?([\\s\\).!?,;]|$)","gm");return e.replace(n,function(e,n,t,r,a,o){return n+t+" "+r+le[a||""]+(" "===o?" ":o)})}},{name:"ru/nbsp/mln",handler:function(e){return e.replace(/(\d) ?(тыс|млн|млрд|трлн)(\.|\s|$)/gi,"$1 $2$3")}},{name:"ru/nbsp/ooo",handler:function(e){return e.replace(/(^|[^a-яёA-ЯЁ])(ООО|ОАО|ЗАО|НИИ|ПБОЮЛ) /g,"$1$2 ")}},{name:"ru/nbsp/page",handler:function(e){var n=new RegExp("(^|[)\\s])(стр|гл|рис|илл?|ст|п|c)\\. *(\\d+)([\\s.,?!;:]|$)","gim");return e.replace(n,"$1$2. $3$4")}},{name:"ru/nbsp/ps",handler:function(e){var n=new RegExp("(^|\\s|".concat(d,")[pз]\\.[ ]?([pз]\\.[ ]?)?[sы]\\.:? "),"gim");return e.replace(n,function(e,n,t){return n+(t?"P. P. S. ":"P. S. ")})}},{name:"ru/nbsp/rubleKopek",handler:function(e){return e.replace(/(\d) ?(?=(руб|коп)\.)/g,"$1 ")}},{name:"ru/nbsp/see",handler:function(e){var n=new RegExp("(^|\\s|".concat(d,"|\\()(см|им)\\.[ ]?([а-яё0-9a-z]+)([\\s.,?!]|$)"),"gi");return e.replace(n,function(e,n,t,r,a){return(" "===n?" ":n)+t+". "+r+a})}},{name:"ru/nbsp/year",handler:function(e){return e.replace(/(^|\D)(\d{4}) ?г([ ,;.\n]|$)/g,"$1$2 г$3")}},{name:"ru/nbsp/years",index:"+5",handler:function(e){var n=new RegExp("(^|\\D)(\\d{4})("+l["common/dash"]+')(\\d{4})[ ]?г\\.?([ ]?г\\.)?(?=[,;:?!"‘“»\\s]|$)',"gm");return e.replace(n,"$1$2$3$4 гг.")}}]);function D(e,n){n=new RegExp('<span class="('+n.join("|")+')">([^]*?)</span>',"g");return e.replace(n,"$2")}function N(e,n){return e.replace(/<title>[^]*?<\/title>/i,function(e){return D(e,n)})}w.addRules([{name:"ru/number/comma",handler:function(e){return e.replace(/(^|\s)(\d+)\.(\d+[\u00A0\u2009\u202F ]*?[%‰°×x])/gim,"$1$2,$3")}},{name:"ru/number/ordinals",handler:function(e,n,t){t=t.getData("char"),t=new RegExp("(\\d[%‰]?)-(ый|ой|ая|ое|ые|ым|ом|ых|ого|ому|ыми)(?!["+t+"])","g");return e.replace(t,function(e,n,t){return n+"-"+{"ой":"й","ый":"й","ая":"я","ое":"е","ые":"е","ым":"м","ом":"м","ых":"х","ого":"го","ому":"му","ыми":"ми"}[t]})}}]);var pe=["typograf-oa-lbracket","typograf-oa-n-lbracket","typograf-oa-sp-lbracket"],q="ru/optalign/bracket",te={name:q,queue:"start",handler:function(e){return D(e,pe)},htmlAttrs:!1},B={name:q,queue:"end",handler:function(e){return N(e,pe)},htmlAttrs:!1},me=["typograf-oa-comma","typograf-oa-comma-sp"],T="ru/optalign/comma",A={name:T,queue:"start",handler:function(e){return D(e,me)},htmlAttrs:!1},L={name:T,queue:"end",handler:function(e){return N(e,me)},htmlAttrs:!1},he=["typograf-oa-lquote","typograf-oa-n-lquote","typograf-oa-sp-lquote"],E="ru/optalign/quote",k={name:E,queue:"start",handler:function(e){return D(e,he)},htmlAttrs:!1},ge={name:E,queue:"end",handler:function(e){return N(e,he)},htmlAttrs:!1},M=(w.addRules([{name:q,handler:function(e){return e.replace(/( |\u00A0)\(/g,'<span class="typograf-oa-sp-lbracket">$1</span><span class="typograf-oa-lbracket">(</span>').replace(/^\(/gm,'<span class="typograf-oa-n-lbracket">(</span>')},disabled:!0,htmlAttrs:!1},{name:T,handler:function(e,n,t){t=t.getData("char"),t=new RegExp("(["+t+"\\d́]+), ","gi");return e.replace(t,'$1<span class="typograf-oa-comma">,</span><span class="typograf-oa-comma-sp"> </span>')},disabled:!0,htmlAttrs:!1},{name:E,handler:function(e){var n=this.getSetting("common/punctuation/quote","ru"),n="(["+n.left[0]+(n.left[1]||"")+"])",t=new RegExp("(^|\n\n|)("+n+")","g"),n=new RegExp("([^\n])([ \n])("+n+")","gi");return e.replace(t,'$1<span class="typograf-oa-n-lquote">$2</span>').replace(n,'$1<span class="typograf-oa-sp-lquote">$2</span><span class="typograf-oa-lquote">$3</span>')},disabled:!0,htmlAttrs:!1}]),w.addInnerRules([te,B,A,L,k,ge]),[]);function de(e){var n,t,r=e[0],a="";if(e.length<8)return fe(e);if(10<e.length)if("+"===r){if("7"!==e[1])return e;n=!0,e=e.substr(2)}else"8"===r&&(t=!0,e=e.substr(1));for(var o=8;2<=o;o--){var s=+e.substr(0,o);if(-1<M.indexOf(s)){a=e.substr(0,o),e=e.substr(o);break}}return a||(a=e.substr(0,5),e=e.substr(5)),(n?"+7 ":"")+(t?"8 ":"")+(e=>{var n=+e,t=e.length,r=[e],a=!1;if(3<t)switch(t){case 4:r=[e.substr(0,2),e.substr(2,2)];break;case 5:r=[e.substr(0,3),e.substr(3,3)];break;case 6:r=[e.substr(0,2),e.substr(2,2),e.substr(4,2)]}else a=900<n&&n<=999||495==n||499==n||800==n;return t=r.join("-"),a?t:"("+t+")"})(a)+" "+fe(e)}function fe(e){var n="";return e.length%2&&(n=e[0],n+=e.length<=5?"-":"",e=e.substr(1,e.length-1)),n+e.split(/(?=(?:\d\d)+$)/).join("-")}function be(e){return e.replace(/[^\d+]/g,"")}[4162,416332,8512,851111,4722,4725,391379,8442,4732,4152,4154451,4154459,4154455,41544513,8142,8332,8612,8622,3525,812,8342,8152,3812,4862,3422,342633,8112,9142,8452,3432,3434,3435,4812,8432,8439,3822,4872,3412,3511,3512,3022,4112,4852,4855,3852,3854,8182,818,90,3472,4741,4764,4832,4922,8172,8202,8722,4932,493,3952,3951,3953,411533,4842,3842,3843,8212,4942,"39131-39179","39190-39199",391,4712,4742,8362,495,499,4966,4964,4967,498,8312,8313,3832,383612,3532,8412,4232,423370,423630,8632,8642,8482,4242,8672,8652,4752,4822,482502,4826300,3452,8422,4212,3466,3462,8712,8352,800,"901-934","936-939","950-953",958,"960-969","977-989","991-997",999].forEach(function(e){if("string"==typeof e)for(var n=e.split("-"),t=+n[0];t<=+n[1];t++)M.push(t);else M.push(e)});w.addRules([{name:"ru/other/accent",handler:function(e){return e.replace(/([а-яё])([АЕЁИОУЫЭЮЯ])([^А-ЯЁ\w]|$)/g,function(e,n,t,r){return n+t.toLowerCase()+"́"+r})},disabled:!0},{name:"ru/other/phone-number",live:!1,handler:function(e){var n=new RegExp("(^|,| |)(\\+7[\\d\\(\\) -]{10,18})(?=,|;||$)","gm");return e.replace(n,function(e,n,t){t=be(t);return 12===t.length?n+de(t):e}).replace(/(^|[^а-яё])([☎☏✆📠📞📱]|т\.|тел\.|ф\.|моб\.|факс|сотовый|мобильный|телефон)(:?\s*?)([+\d(][\d \u00A0\-()]{3,}\d)/gi,function(e,n,t,r,a){a=be(a);return 5<=a.length?n+t+r+de(a):e})}}]);var q={name:"ru/punctuation/ano",handler:function(e){var n=new RegExp("([^«„[(!?,:;\\-‒–—\\s])(\\s+)(а|но)(?= | |\\n)","g");return e.replace(n,"$1,$2$3")}},$e=(w.addRules([q,{name:"ru/punctuation/exclamation",handler:function(e){return e.replace(/(^|[^!])!{2}($|[^!])/gm,"$1!$2").replace(/(^|[^!])!{4}($|[^!])/gm,"$1!!!$2")},live:!1},{name:"ru/punctuation/exclamationQuestion",index:"+5",handler:function(e){var n=new RegExp("(^|[^!])!\\?([^?]|$)","g");return e.replace(n,"$1?!$2")}},{name:"ru/punctuation/hellipQuestion",handler:function(e){return e.replace(/(^|[^.])(\.\.\.|…),/g,"$1…").replace(/(!|\?)(\.\.\.|…)(?=[^.]|$)/g,"$1..")}}]),w.addRules([{name:"ru/space/afterHellip",handler:function(e){return e.replace(/([а-яё])(\.\.\.|…)([А-ЯЁ])/g,"$1$2 $3").replace(/([?!]\.\.)([а-яёa-z])/gi,"$1 $2")}},{name:"ru/space/year",handler:function(e,n,t){t=t.getData("char"),t=new RegExp("(^| | )(\\d{3,4})(год([ауе]|ом)?)([^"+t+"]|$)","g");return e.replace(t,"$1$2 $3$5")}}]),w.addRules([{name:"ru/symbols/NN",handler:function(e){return e.replace(/№№/g,"№")}}]),{A:"А",a:"а",B:"В",E:"Е",e:"е",K:"К",M:"М",H:"Н",O:"О",o:"о",P:"Р",p:"р",C:"С",c:"с",T:"Т",y:"у",X:"Х",x:"х"}),ye=Object.keys($e).join("");w.addRules([{name:"ru/typo/switchingKeyboardLayout",handler:function(e){var n=new RegExp("(["+ye+"]{1,3})(?=[А-ЯЁа-яё]+?)","g");return e.replace(n,function(e,n){for(var t="",r=0;r<n.length;r++)t+=$e[n[r]];return t})}}]);return w.titles={"common/html/e-mail":{"en-US":"Placement of links for e-mail",ru:"Расстановка ссылок для эл. почты"},"common/html/escape":{"en-US":"Escaping HTML",ru:"Экранирование HTML"},"common/html/nbr":{"en-US":"Replacement line break on <br/>",ru:"Замена перевода строки на <br/>"},"common/html/p":{"en-US":"Placement of paragraph",ru:"Расстановка абзацев"},"common/html/processingAttrs":{"en-US":"Processing HTML attributes",ru:"Типографирование HTML-атрибутов"},"common/html/quot":{common:'" → "'},"common/html/stripTags":{"en-US":"Removing HTML-tags",ru:"Удаление HTML-тегов"},"common/html/url":{"en-US":"Placement of links",ru:"Расстановка ссылок"},"common/nbsp/afterNumber":{"en-US":"Non-breaking space between number and word",ru:"Нераз. пробел между числом и словом"},"common/nbsp/afterParagraphMark":{"en-US":"Non-breaking space after ¶",ru:"Нераз. пробел после ¶"},"common/nbsp/afterSectionMark":{"en-US":"Non-breaking space after §",ru:"Нераз. узкий пробел после §"},"common/nbsp/afterShortWord":{"en-US":"Non-breaking space after short word",ru:"Нераз. пробел после короткого слова"},"common/nbsp/afterShortWordByList":{"en-US":"Non-breaking space after conjunctions, articles and prepositions",ru:"Нераз. пробел после союзов, артиклей и предлогов"},"common/nbsp/beforeShortLastNumber":{"en-US":"Non-breaking space before number (maximum 2 digits) at end of sentence",ru:"Нераз. пробел перед числом (не более 2 цифр) в конце предложения"},"common/nbsp/beforeShortLastWord":{"en-US":"Non-breaking space before last short word in sentence",ru:"Нераз. пробел перед последним коротким словом в предложении"},"common/nbsp/dpi":{"en-US":"Non-breaking space before lpi and dpi",ru:"Нераз. пробел перед lpi и dpi"},"common/nbsp/nowrap":{"en-US":"Replace non-breaking space to normal space in tags nowrap and nobr",ru:"Заменять нераз. пробел на обычный пробел в тегах nowrap и nobr"},"common/nbsp/replaceNbsp":{"en-US":"Replacing non-breaking space on normal before text correction",ru:"Замена неразрывного пробела на обычный перед типографированием"},"common/number/digitGrouping":{"en-US":"Divide into groups numbers with many digits",ru:"Разбивать длинные числа по разрядам"},"common/number/fraction":{common:"1/2 → ½, 1/4 → ¼, 3/4 → ¾"},"common/number/mathSigns":{common:"!= → ≠, <= → ≤, >= → ≥, ~= → ≅, +- → ±"},"common/number/times":{common:"x → × (10 x 5 → 10×5)"},"common/other/delBOM":{"en-US":"Delete character BOM (Byte Order Mark)",ru:"Удаление символа BOM (Byte Order Mark)"},"common/other/repeatWord":{"en-US":"Removing repeat words",ru:"Удаление повтора слова"},"common/punctuation/apostrophe":{"en-US":"Placement of correct apostrophe",ru:"Расстановка правильного апострофа"},"common/punctuation/delDoublePunctuation":{"en-US":"Removing double punctuation",ru:"Удаление двойной пунктуации"},"common/punctuation/hellip":{"en-US":"Replacement of three points by ellipsis",ru:"Замена трёх точек на многоточие"},"common/punctuation/quote":{"en-US":"Placement of quotation marks in texts",ru:"Расстановка кавычек правильного вида"},"common/punctuation/quoteLink":{"en-US":"Removal quotes outside a link",ru:"Вынос кавычек за пределы ссылки"},"common/space/afterColon":{"en-US":"space after colon",ru:"Пробел после двоеточия"},"common/space/afterComma":{"en-US":"space after comma",ru:"Пробел после запятой"},"common/space/afterExclamationMark":{"en-US":"space after exclamation mark",ru:"Пробел после знака восклицания"},"common/space/afterQuestionMark":{"en-US":"space after question mark",ru:"Пробел после знака вопроса"},"common/space/afterSemicolon":{"en-US":"space after semicolon",ru:"Пробел после точки с запятой"},"common/space/beforeBracket":{"en-US":"Space before opening bracket",ru:"Пробел перед открывающей скобкой"},"common/space/bracket":{"en-US":"Remove extra spaces after opening and before closing bracket",ru:"Удаление лишних пробелов после открывающей и перед закрывающей скобкой"},"common/space/delBeforeDot":{"en-US":"Remove space before dot",ru:"Удаление пробела перед точкой"},"common/space/delBeforePercent":{"en-US":"Remove space before %, ‰ and ‱",ru:"Удаление пробела перед %, ‰ и ‱"},"common/space/delBeforePunctuation":{"en-US":"Remove spaces before punctuation",ru:"Удаление пробелов перед знаками пунктуации"},"common/space/delBetweenExclamationMarks":{"en-US":"Remove spaces before exclamation marks",ru:"Удаление пробелов между знаками восклицания"},"common/space/delLeadingBlanks":{"en-US":"Remove spaces at start of line",ru:"Удаление пробелов в начале строки"},"common/space/delRepeatN":{"en-US":"Remove duplicate line breaks",ru:"Удаление повторяющихся переносов строки"},"common/space/delRepeatSpace":{"en-US":"Removing duplicate spaces between characters",ru:"Удаление повторяющихся пробелов между символами"},"common/space/delTrailingBlanks":{"en-US":"Remove spaces at end of line",ru:"Удаление пробелов в конце строки"},"common/space/insertFinalNewline":{"en-US":"Insert final newline",ru:"Вставить в конце текста перевод строки"},"common/space/replaceTab":{"en-US":"Replacement of tab to 4 spaces",ru:"Замена таба на 4 пробела"},"common/space/squareBracket":{"en-US":"Remove extra spaces after opening and before closing square bracket",ru:"Удаление лишних пробелов после открывающей и перед закрывающей квадратной скобкой"},"common/space/trimLeft":{"en-US":"Remove spaces and line breaks in beginning of text",ru:"Удаление пробелов и переносов строк в начале текста"},"common/space/trimRight":{"en-US":"Remove spaces and line breaks at end of text",ru:"Удаление пробелов и переносов строк в конце текста"},"common/symbols/arrow":{common:"-> → →, <- → ←"},"common/symbols/cf":{"en-US":"Adding ° to C and F",ru:"Добавление ° к C и F"},"common/symbols/copy":{common:"(c) → ©, (tm) → ™, (r) → ®"},"en-US/dash/main":{"en-US":"Replace hyphens surrounded by spaces with an em-dash",ru:"Замена дефиса на длинное тире"},"ru/dash/centuries":{"en-US":"Hyphen to dash in centuries",ru:"Замена дефиса на тире в веках"},"ru/dash/daysMonth":{"en-US":"Dash between days of one month",ru:"Тире между днями одного месяца"},"ru/dash/de":{"en-US":"Hyphen before “де”",ru:"Дефис перед «де»"},"ru/dash/decade":{"en-US":"Dash in decade",ru:"Тире в десятилетиях, 80—90-е гг."},"ru/dash/directSpeech":{"en-US":"Dash in direct speech",ru:"Тире в прямой речи"},"ru/dash/izpod":{"en-US":"Hyphen between “из-под”",ru:"Дефис между «из-под»"},"ru/dash/izza":{"en-US":"Hyphen between “из-за”",ru:"Дефис между «из-за»"},"ru/dash/ka":{"en-US":"Hyphen before “ка” and “кась”",ru:"Дефис перед «ка» и «кась»"},"ru/dash/kakto":{"en-US":"Hyphen for “как то”",ru:"Дефис для «как то»"},"ru/dash/koe":{"en-US":"Hyphen after “кое” and “кой”",ru:"Дефис после «кое» и «кой»"},"ru/dash/main":{"en-US":"Replacement hyphen with dash",ru:"Замена дефиса на тире"},"ru/dash/month":{"en-US":"Dash between months",ru:"Тире между месяцами"},"ru/dash/surname":{"en-US":"Acronyms with a dash",ru:"Сокращения с помощью тире"},"ru/dash/taki":{"en-US":"Hyphen between “верно-таки” and etc.",ru:"Дефис между «верно-таки» и т. д."},"ru/dash/time":{"en-US":"Dash in time intervals",ru:"Тире в интервалах времени"},"ru/dash/to":{"en-US":"Hyphen before “то”, “либо”, “нибудь”",ru:"Дефис перед «то», «либо», «нибудь»"},"ru/dash/weekday":{"en-US":"Dash between the days of the week",ru:"Тире между днями недели"},"ru/dash/years":{"en-US":"Hyphen to dash in years",ru:"Замена дефиса на тире в годах"},"ru/date/fromISO":{"en-US":"Converting dates YYYY-MM-DD type DD.MM.YYYY",ru:"Преобразование дат YYYY-MM-DD к виду DD.MM.YYYY"},"ru/date/weekday":{common:"2 Мая, Понедельник → 2 мая, понедельник"},"ru/money/currency":{"en-US":"Currency symbol ($, €, ¥, Ұ, £ and ₤) after the number, $100 → 100 $",ru:"Символ валюты ($, €, ¥, Ұ, £ и ₤) после числа, $100 → 100 $"},"ru/money/ruble":{common:"1 руб. → 1 ₽"},"ru/nbsp/abbr":{"en-US":"Non-breaking space in abbreviations, e.g. “т. д.”",ru:"Нераз. пробел в сокращениях, например, в «т. д.»"},"ru/nbsp/addr":{"en-US":"Placement of non-breaking space after “г.”, “обл.”, “ул.”, “пр.”, “кв.” et al.",ru:"Расстановка нераз. пробела после «г.», «обл.», «ул.», «пр.», «кв.» и др."},"ru/nbsp/afterNumberSign":{"en-US":"Non-breaking thin space after №",ru:"Нераз. узкий пробел после №"},"ru/nbsp/beforeParticle":{"en-US":"Non-breaking space before “ли”, “ль”, “же”, “бы”, “б”",ru:"Нераз. пробел перед «ли», «ль», «же», «бы», «б»"},"ru/nbsp/centuries":{"en-US":"Remove spaces and extra points in “вв.”",ru:"Удаление пробелов и лишних точек в «вв.»"},"ru/nbsp/dayMonth":{"en-US":"Non-breaking space between number and month",ru:"Нераз. пробел между числом и месяцем"},"ru/nbsp/initials":{"en-US":"Binding of initials to the name",ru:"Привязка инициалов к фамилии"},"ru/nbsp/m":{"en-US":"m2 → м², m3 → м³ and non-breaking space",ru:"м2 → м², м3 → м³ и нераз. пробел"},"ru/nbsp/mln":{"en-US":"Non-breaking space between number and “тыс.”, “млн”, “млрд” and “трлн”",ru:"Неразр. пробел между числом и «тыс.», «млн», «млрд» и «трлн»"},"ru/nbsp/ooo":{"en-US":"Non-breaking space after “OOO, ОАО, ЗАО, НИИ, ПБОЮЛ”",ru:"Нераз. пробел после OOO, ОАО, ЗАО, НИИ и ПБОЮЛ"},"ru/nbsp/page":{"en-US":"Non-breaking space after “стр.”, “гл.”, “рис.”, “илл.”",ru:"Нераз. пробел после «стр.», «гл.», «рис.», «илл.»"},"ru/nbsp/ps":{"en-US":"Non-breaking space in P. S. and P. P. S.",ru:"Нераз. пробел в P. S. и P. P. S."},"ru/nbsp/rubleKopek":{"en-US":"Not once. space before the “rub” and “cop.”",ru:"Нераз. пробел перед «руб.» и «коп.»"},"ru/nbsp/see":{"en-US":"Non-breaking space after abbreviation «см.» and «им.»",ru:"Нераз. пробел после сокращений «см.» и «им.»"},"ru/nbsp/year":{"en-US":"Non-breaking space before XXXX г. (2012 г.)",ru:"Нераз. пробел после XXXX г. (2012 г.)"},"ru/nbsp/years":{"en-US":"г.г. → гг. and non-breaking space",ru:"г.г. → гг. и нераз. пробел"},"ru/number/comma":{"en-US":"Commas in numbers",ru:"Замена точки на запятую в числах"},"ru/number/ordinals":{common:"N-ый, -ой, -ая, -ое, -ые, -ым, -ом, -ых → N-й, -я, -е, -м, -х (25-й)"},"ru/optalign/bracket":{"en-US":"for opening bracket",ru:"для открывающей скобки"},"ru/optalign/comma":{"en-US":"for comma",ru:"для запятой"},"ru/optalign/quote":{"en-US":"for opening quotation marks",ru:"для открывающей кавычки"},"ru/other/accent":{"en-US":"Replacement capital letters to lowercase with addition of accent",ru:"Замена заглавной буквы на строчную с добавлением ударения"},"ru/other/phone-number":{"en-US":"Formatting phone numbers",ru:"Форматирование телефонных номеров"},"ru/punctuation/ano":{"en-US":"Placement of commas before “а” and “но”",ru:"Расстановка запятых перед «а» и «но»"},"ru/punctuation/exclamation":{common:"!! → !"},"ru/punctuation/exclamationQuestion":{common:"!? → ?!"},"ru/punctuation/hellipQuestion":{common:"«?…» → «?..», «!…» → «!..», «…,» → «…»"},"ru/space/afterHellip":{"en-US":"Space after “...”, “!..” and “?..”",ru:"Пробел после «...», «!..» и «?..»"},"ru/space/year":{"en-US":"Space between number and word “год”",ru:"Пробел между числом и словом «год»"},"ru/symbols/NN":{common:"№№ → №"},"ru/typo/switchingKeyboardLayout":{"en-US":"Replacement of Latin letters in Russian. Typos occur when you switch keyboard layouts",ru:"Замена латинских букв на русские. Опечатки, возникающие при переключении клавиатурной раскладки"}},w.groups=[{name:"punctuation",title:{"en-US":"Punctuation",ru:"Пунктуация"}},{name:"optalign",title:{"en-US":"Hanging punctuation",ru:"Висячая пунктуация"}},{name:"dash",title:{"en-US":"Dash and hyphen",ru:"Тире и дефис"}},{name:"nbsp",title:{"en-US":"Non-breaking space",ru:"Неразрывный пробел"}},{name:"space",title:{"en-US":"Space and line ending",ru:"Пробел и окончание строки"}},{name:"html",title:{"en-US":"HTML",ru:"HTML"}},{name:"date",title:{"en-US":"Date",ru:"Дата"}},{name:"money",title:{"en-US":"Money",ru:"Деньги"}},{name:"number",title:{"en-US":"Numbers and mathematical expressions",ru:"Числа и математические выражения"}},{name:"symbols",title:{"en-US":"Symbols and signs",ru:"Символы и знаки"}},{name:"typo",title:{"en-US":"Typos",ru:"Опечатки"}},{name:"other",title:{"en-US":"Other",ru:"Прочее"}}],w});
</script>
<script>
!function(){"use strict";var e="undefined"!=typeof document,t="undefined"!=typeof window,n="undefined"!=typeof navigator,o="undefined"!=typeof screen;function s(){return t&&window.location?window.location.href:""}function i(){return e?document.referrer:""}function r(e,t){return(e||"").slice(0,t)}function a(){return Math.floor(Math.random()*(1<<30))}function l(e,t,n){(n||0===n)&&e.push(t+":"+(!0===n?"1":n))}function u(s,i){var u=[];s&&Object.keys(s).forEach(function(e){return l(u,e,s[e])}),l(u,"rn",a()),l(u,"c",!!n&&navigator.cookieEnabled),l(u,"s",o?[screen.width,screen.height,screen.colorDepth].join("x"):""),l(u,"sk",t&&window.devicePixelRatio||1),l(u,"w",t?[window.innerWidth,window.innerHeight].join("x"):""),l(u,"en",e&&"string"==typeof document.charset?document.charset.toLowerCase():"");var c=Math.round(Date.now()/1e3);return l(u,"et",c),l(u,"st",c),l(u,"t",r(i,512)),u.join(":")}function c(e){return r(e,1024)}function d(e,t){var n="https://mc.yandex.ru/watch/"+e+"?"+function(e){return Object.keys(e).filter(function(t){return e[t]||0===e[t]}).map(function(t){return encodeURIComponent(t)+"="+encodeURIComponent(e[t])}).join("&")}(t);"undefined"!=typeof navigator&&navigator.sendBeacon&&navigator.sendBeacon(n," ")||("undefined"!=typeof fetch?fetch(n,{credentials:"include"}).catch(function(){}):"undefined"!=typeof Image&&((new Image).src=n))}function h(e){var t=e.browserInfo,n=e.counterId,o=e.pageParams,s=e.params,i={"browser-info":u(t,o.title),rn:a(),ut:o.ut};o.url&&(i["page-url"]=c(o.url)),o.referrer&&(i["page-ref"]=c(o.referrer)),s&&(i["site-info"]=JSON.stringify(s)),d(n,i)}function m(t,n,o){h({browserInfo:{pv:!0,ar:!0},counterId:t,pageParams:{referrer:i(),title:e?document.title:"",url:s()},params:o})}function p(e,n,o){var r,a;n?(r=s(),a="goal://".concat(t&&window.location?window.location.hostname:"","/").concat(n)):(r=i(),a=s()),h({browserInfo:{ar:!0},counterId:e,pageParams:{referrer:r,url:a},params:o})}const f="28700106";function g(e,t){p(f,e,t),console.info("metrika: reachGoal",e,t)}function v(e){return"en"===e||"en-US"===e?["en-US"]:[e,"en-US"]}let y,S={};function b(e){const t=S[e];if(!t)return console.error(`Not found key "${e}" in getText().`),"";const n=t[y];return void 0===n?(console.error(`Not found key "${e}", lang "${y}" in getText().`),""):n}function x(e){S=Object.assign(Object.assign({},S),e)}function w(e){y=e}function C(){Array.from(document.querySelectorAll("[data-text-id]")).forEach(e=>{e.dataset.textId&&(e.innerHTML=b(e.dataset.textId))}),Array.from(document.querySelectorAll("[data-value-id]")).forEach(e=>{e.dataset.valueId&&(e.value=b(e.dataset.valueId))}),Array.from(document.querySelectorAll("[data-title-id]")).forEach(e=>{e.dataset.titleId&&(e.title=b(e.dataset.titleId))}),Array.from(document.querySelectorAll("[data-placeholder-id]")).forEach(e=>{e.dataset.placeholderId&&(e.placeholder=b(e.dataset.placeholderId))})}function I(e){return function(){const e=window.location.hash.replace(/^#!/,""),t={};return e.split("&").forEach(e=>{const[n,o]=e.split("=");if(void 0!==o)try{t[n]=window.decodeURIComponent(o)}catch(e){t[n]=o}}),t}()[e]}function k(){return"#!prefs"===window.location.hash}const E={getItem(e,t){let n=null;if(window.localStorage)try{const t=window.localStorage.getItem(e);"string"==typeof t&&(n=JSON.parse(t))}catch(e){console.log(e)}else console.warn("LocalStorage is unsupported.");return null===n?t:n},setItem(e,t){if(window.localStorage)try{window.localStorage.setItem(e,JSON.stringify(t))}catch(e){console.log(e)}else console.warn("LocalStorage is unsupported.")}},T={disabled:[],enabled:[]};const U=new class{constructor(){this.languageInner="",this.localeInner="",this.rulesInner=T,this.onlyInvisibleInner=!1,this.textInner="",this.languageInner=E.getItem("settings.langUI","ru"),"en"===this.languageInner&&(this.languageInner="en-US"),this.localeInner=E.getItem("settings.locale","ru");const e=E.getItem("settings.rules",T);e&&Array.isArray(e.disabled)&&Array.isArray(e.enabled)&&(this.rulesInner=e),this.modeInner=E.getItem("settings.mode","default"),this.onlyInvisibleInner=E.getItem("settings.onlyInvisible",!1),this.textInner=E.getItem("text","")}get locale(){return this.localeInner}set locale(e){this.localeInner=e,E.setItem("settings.locale",e)}get mode(){return this.modeInner}set mode(e){this.modeInner=e,E.setItem("settings.mode",e)}get onlyInvisible(){return this.onlyInvisibleInner}set onlyInvisible(e){this.onlyInvisibleInner=e,E.setItem("settings.onlyInvisible",e)}get language(){return this.languageInner}set language(e){this.languageInner=e,E.setItem("settings.langUI",e)}get text(){return this.textInner}set text(e){this.textInner=e,E.setItem("text",e)}get rules(){return this.rulesInner}set rules(e){this.rulesInner=e,E.setItem("settings.rules",e)}},_=window.Typograf,R={};function L(e){const t=R[e];return t&&t.index}_.groups.forEach((e,t)=>{R[e.name]=Object.assign({index:t},e)});class A{constructor(e){this.currentIndex=0,this.dom=document.querySelector(".language-selector");const{defaultLanguage:t,languages:n,onChange:o}=e;this.languages=n,this.onChange=o,this.dom.addEventListener("click",()=>{this.selectNextLanguage(),this.onChange(this.getValue())}),this.setValue(t)}setValue(e){this.languages.some((t,n)=>t.value===e&&(this.dom.innerText=t.title,this.dom.dataset.textId=t.value,this.currentIndex=n,!0))}getValue(){return this.languages[this.currentIndex].value}selectNextLanguage(){this.currentIndex++,this.currentIndex>=this.languages.length&&(this.currentIndex=0),this.setValue(this.languages[this.currentIndex].value)}}function M(e){return(e||"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function N(e){return-1!==(e||"").search(/(<\/?[a-z]|<!|&[lg]t;)/i)}function q(e){e&&(e.style.display="none")}function O(e){e&&(e.style.display="SPAN"===e.tagName?"inline-block":"block")}const P={be:"🇧🇾",bg:"🇧🇬",ca:"🏳️",cs:"🇨🇿",da:"🇩🇰",de:"🇩🇪",el:"🇬🇷","en-GB":"🏴","en-US":"🇺🇸",eo:"🏳️",es:"🇪🇸",et:"🇪🇪",fi:"🇫🇮",fr:"🇫🇷",ga:"🇮🇪",hu:"🇭🇺",it:"🇮🇹",lv:"🇱🇻 ",nl:"🇳🇱",no:"🇳🇴",pl:"🇵🇱",ro:"🇷🇴",ru:"🇷🇺",sk:"🇸🇰",sl:"🇸🇮",sr:"🇷🇸",sv:"🇸🇪",tr:"🇹🇷 ",uk:"🇺🇦"},H=["ru","en-US"],D=new _({locale:H,disableRule:"*",enableRule:["common/nbsp/*","ru/nbsp/*"]}),j=new _({locale:H,disableRule:"*",enableRule:["common/nbsp/*","common/punctuation/quote"]});class z{constructor(e){this.params=e,this.dom=document.querySelector(".prefs"),this.domSetLocale=document.querySelector(".prefs__set-locale"),this.domAllRules=document.querySelector(".prefs__all-rules"),this.domDefault=document.querySelector(".prefs__default"),this.domRules=document.querySelector(".prefs__rules"),this.domSetMode=document.querySelector(".prefs__set-mode"),this.domOnlyInvisible=document.querySelector(".prefs__only-invisible"),this.domHtmlEntitiesExample=document.querySelector(".prefs__html-entities-example"),this.domInvisibleSymbolsContainer=document.querySelector(".prefs__invisible-symbols-container"),this.handleChangeLocale=()=>{const e=this.domSetLocale.value;this.locale=e,this.save(),g("select-locale",{changeLocale:e})},this.handleModeChange=()=>{this.mode=this.domSetMode.value,this.onlyInvisible=this.domOnlyInvisible.checked,this.updateInvisibleSymbols(),this.save(),g("settings-select-html-entity")},this.locale=this.params.getLocale(),this.mode=this.params.getMode(),this.onlyInvisible=this.params.getOnlyInvisible(),this.createRules(),this.createLocaleContent(),this.updateUI(),this.bindEvents()}show(){this.dom.classList.add("prefs_opened"),this.synchronizeMainCheckbox(),g("settings-open")}hide(){this.dom.classList.remove("prefs_opened"),g("settings-close")}toggle(){this.opened()?this.hide():this.show()}opened(){return this.dom.classList.contains("prefs_opened")}save(){const e=[],t=[];_.getRules().forEach(n=>{this.params.typograf.isEnabledRule(n.name)?e.push(n.name):t.push(n.name)}),this.synchronizeMainCheckbox(),this.params.onChange({rules:{enabled:e,disabled:t},onlyInvisible:this.onlyInvisible,mode:this.mode,locale:this.locale})}handleDefaultClick(){this.getCheckboxes().forEach(e=>{const t=e.dataset.id;t&&_.getRules().some(n=>{if(t===n.name){const o=n.enabled;return e.checked=o,o?this.params.typograf.enableRule(t):this.params.typograf.disableRule(t),!0}return!1})}),this.setCheckedAllRules(void 0),this.mode="default",this.onlyInvisible=!0,this.updateUI(),this.save(),g("settings-default")}setCheckedAllRules(e){this.domAllRules.checked=Boolean(e),this.domAllRules.indeterminate=void 0===e}updateInvisibleSymbols(){let e=j.execute(b("html-entities-example"),{htmlEntity:{type:this.mode,onlyInvisible:this.onlyInvisible}});e=M(e).replace(/(&#?[\da-z_-]+;|\\u[\da-f]{4})/gi,'<span style="color: green;">$1</span>'),this.domHtmlEntitiesExample.innerHTML=e,"digit"===this.mode||"name"===this.mode||"js"===this.mode?O(this.domInvisibleSymbolsContainer):q(this.domInvisibleSymbolsContainer)}sortByGroupIndex(e){e.sort((e,t)=>{if(!e.name||!t.name)return-1;const n=L(e.group),o=L(t.group);return n>o?1:n===o?0:-1})}splitGroups(e){let t,n;const o=[];return e.forEach(e=>{const s=e.group;s!==t&&(t=s,n=[],o.push(n)),n.push(e)}),o}sortGroupsByTitle(e,t){e.forEach(e=>{e.sort((e,n)=>{const o=_.titles[e.name],s=_.titles[n.name];return o&&s?(o[t]||o.common)>(s[t]||s.common)?1:-1:1})})}getSortedGroups(e,t){const n=[];e.forEach(e=>{e.live||n.push(e)}),this.sortByGroupIndex(n);const o=this.splitGroups(n);return this.sortGroupsByTitle(o,t),o}createRules(){this.domRules.innerHTML="";const e=this.params.getLanguage();this.getSortedGroups(_.getRules(),e).forEach(t=>{const n=t[0].group,o=D.execute(function(e,t){const n=R[e];return n&&n.title[t]}(n,e),{locale:v(e)}),s=document.createElement("fieldset");s.className="prefs__fieldset";const i=document.createElement("legend");i.className="prefs__legend button",i.innerText=o,i.dataset.textId=n,s.appendChild(i),this.createRulesForGroup(s,t,e),this.domRules.appendChild(s)})}getRuleTitle(e,t){const n=_.titles[e];if(!n||!n[t]&&!n.common)return console.warn('Not found title for name "'+e+'".'),"";return D.execute(M(n[t]||n.common),{locale:v(t)})}createRulesForGroup(e,t,n){const o=document.createElement("div");o.className="prefs__group-rules",t.forEach(e=>{const{name:t,locale:s}=e,i=this.getRuleTitle(t,n),r=document.createElement("div");r.className="prefs__rule",r.title=t;const a="setting-"+t,l=document.createElement("input");l.type="checkbox",l.className="prefs__rule-checkbox",l.checked=this.params.typograf.isEnabledRule(t),l.id=a,l.dataset.id=t,r.appendChild(l);const u=document.createElement("label");if(u.htmlFor=a,u.dataset.textId=t,u.innerHTML=i,"common"!==s){const e=document.createElement("span");e.className="prefs__rule-lang",e.innerText=s,u.appendChild(e)}r.appendChild(u),o.appendChild(r)}),e.appendChild(o)}getCheckboxes(){return Array.from(document.querySelectorAll(".prefs__rule-checkbox"))}handleRuleClick(e){this.getCheckboxes().forEach(t=>{const n=t.dataset.id;n&&e.dataset.id===n&&(t.checked?this.params.typograf.enableRule(n):this.params.typograf.disableRule(n))}),this.save(),g("settings-click-rule")}handleLegendClick(e){const t=function(e,t){var n;if(!e)return null;let o=e;for(;!o||!(null===(n=o.classList)||void 0===n?void 0:n.contains(t));)o=o.parentNode;return o||null}(e,"prefs__fieldset");if(!t)return;t.classList.toggle("prefs__fieldset_visible");const n=t.querySelector(".prefs__group-rules");var o;n&&(function(e){return!e||!e.offsetHeight||"none"===e.style.display}(o=n)?O(o):q(o),g("settings-click-group-rule"))}selectAll(){const e=this.domAllRules.checked;this.getCheckboxes().forEach(t=>{const n=t.dataset.id;n&&(t.checked=e,e?this.params.typograf.enableRule(n):this.params.typograf.disableRule(n))}),this.save(),g("settings-select-all-rules")}synchronizeMainCheckbox(){let e,t=0;const n=this.getCheckboxes();n.forEach(e=>{e.checked&&t++}),e=t===n.length||!!t&&void 0,this.setCheckedAllRules(e)}updateUI(){this.domSetLocale.value=this.locale,this.domSetMode.value=this.mode||"default",this.domOnlyInvisible.checked=this.onlyInvisible,this.updateInvisibleSymbols()}createLocaleContent(){const e=_.getLocales().sort((e,t)=>b("locale-"+e)>b("locale-"+t)?1:-1);this.domSetLocale.innerHTML="",e.forEach(e=>{const t=document.createElement("option");t.value=e,t.dataset.textId=`locale-${e}`;const n=_.getData(`${e}/quote`),o=n.left+n.right.split("").reverse().join("");t.innerText=(P[e]||"")+" "+b("locale-"+e)+" "+o,this.domSetLocale.appendChild(t)})}bindEvents(){this.domSetLocale.addEventListener("change",this.handleChangeLocale),this.domSetMode.addEventListener("change",this.handleModeChange),this.domOnlyInvisible.addEventListener("change",this.handleModeChange),this.domAllRules.addEventListener("click",()=>{this.selectAll()}),this.domDefault.addEventListener("click",()=>{this.handleDefaultClick()}),this.domRules.addEventListener("click",e=>{const t=e.target;e.target&&(t.classList.contains("prefs__legend")?this.handleLegendClick(t):t.classList.contains("prefs__rule-checkbox")&&this.handleRuleClick(t))})}}class B{constructor(e){this.params=e,this.dom=document.querySelector(".header"),this.editor=document.querySelector(".header__menu-item_tab_editor"),this.prefs=document.querySelector(".header__menu-item_tab_prefs"),this.handleTabEditor=()=>{this.params.onClick("editor"),this.editor.classList.add("header__menu-item_selected"),this.prefs.classList.remove("header__menu-item_selected"),document.body.style.overflowY="visible"},this.handleTabPrefs=()=>{this.params.onClick("prefs"),this.prefs.classList.add("header__menu-item_selected"),this.editor.classList.remove("header__menu-item_selected"),document.body.style.overflowY="hidden"},this.editor.addEventListener("click",this.handleTabEditor),this.prefs.addEventListener("click",this.handleTabPrefs),k()&&setTimeout(()=>{this.handleTabPrefs()},0),this.snow=document.createElement("div"),this.snow.className="header__snow",this.dom.appendChild(this.snow)}}class G{constructor(e){this.params=e,this.domText=document.querySelector(".input__text"),this.domClear=document.querySelector(".input__clear"),this.domExecute=document.querySelector(".input__execute"),this.updateClear=()=>{this.getValue().length>0?O(this.domClear):q(this.domClear)},this.handleInput=()=>{this.params.onChange()},this.bindEvents();const{value:t}=e;t&&(this.setValue(t),setTimeout(()=>{this.handleInput()},0))}setValue(e){this.domText.value=e,this.updateClear()}getValue(){return this.domText.value}bindEvents(){this.domClear&&this.domClear.addEventListener("click",()=>{this.setValue(""),this.domText.focus(),this.params.onChange()}),this.params.isMobile?this.domExecute&&this.domExecute.addEventListener("click",()=>{this.params.onChange()}):this.domText.addEventListener("input",this.handleInput),this.domText.addEventListener("input",this.updateClear)}}function F(e,t,n){var o={}.atBegin;return function(e,t,n){var o,s=n||{},i=s.noTrailing,r=void 0!==i&&i,a=s.noLeading,l=void 0!==a&&a,u=s.debounceMode,c=void 0===u?void 0:u,d=!1,h=0;function m(){o&&clearTimeout(o)}function p(){for(var n=arguments.length,s=new Array(n),i=0;i<n;i++)s[i]=arguments[i];var a=this,u=Date.now()-h;function p(){h=Date.now(),t.apply(a,s)}function f(){o=void 0}d||(l||!c||o||p(),m(),void 0===c&&u>e?l?(h=Date.now(),r||(o=setTimeout(c?f:p,e))):p():!0!==r&&(o=setTimeout(c?f:p,void 0===c?e-u:e)))}return p.cancel=function(e){var t=(e||{}).upcomingOnly,n=void 0!==t&&t;m(),d=!n},p}(e,t,{debounceMode:!1!==(void 0!==o&&o)})}function $(){}function V(e,t,n,o,s){for(var i,r=[];t;)r.push(t),i=t.previousComponent,delete t.previousComponent,t=i;r.reverse();for(var a=0,l=r.length,u=0,c=0;a<l;a++){var d=r[a];if(d.removed){if(d.value=e.join(o.slice(c,c+d.count)),c+=d.count,a&&r[a-1].added){var h=r[a-1];r[a-1]=r[a],r[a]=h}}else{if(!d.added&&s){var m=n.slice(u,u+d.count);m=m.map(function(e,t){var n=o[c+t];return n.length>e.length?n:e}),d.value=e.join(m)}else d.value=e.join(n.slice(u,u+d.count));u+=d.count,d.added||(c+=d.count)}}var p=r[l-1];return l>1&&"string"==typeof p.value&&(p.added||p.removed)&&e.equals("",p.value)&&(r[l-2].value+=p.value,r.pop()),r}$.prototype={diff:function(e,t){var n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=o.callback;"function"==typeof o&&(s=o,o={}),this.options=o;var i=this;function r(e){return s?(setTimeout(function(){s(void 0,e)},0),!0):e}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e));var a=(t=this.removeEmpty(this.tokenize(t))).length,l=e.length,u=1,c=a+l;o.maxEditLength&&(c=Math.min(c,o.maxEditLength));var d=null!==(n=o.timeout)&&void 0!==n?n:1/0,h=Date.now()+d,m=[{oldPos:-1,lastComponent:void 0}],p=this.extractCommon(m[0],t,e,0);if(m[0].oldPos+1>=l&&p+1>=a)return r([{value:this.join(t),count:t.length}]);var f=-1/0,g=1/0;function v(){for(var n=Math.max(f,-u);n<=Math.min(g,u);n+=2){var o=void 0,s=m[n-1],c=m[n+1];s&&(m[n-1]=void 0);var d=!1;if(c){var h=c.oldPos-n;d=c&&0<=h&&h<a}var v=s&&s.oldPos+1<l;if(d||v){if(o=!v||d&&s.oldPos+1<c.oldPos?i.addToPath(c,!0,void 0,0):i.addToPath(s,void 0,!0,1),p=i.extractCommon(o,t,e,n),o.oldPos+1>=l&&p+1>=a)return r(V(i,o.lastComponent,t,e,i.useLongestToken));m[n]=o,o.oldPos+1>=l&&(g=Math.min(g,n-1)),p+1>=a&&(f=Math.max(f,n+1))}else m[n]=void 0}u++}if(s)!function e(){setTimeout(function(){if(u>c||Date.now()>h)return s();v()||e()},0)}();else for(;u<=c&&Date.now()<=h;){var y=v();if(y)return y}},addToPath:function(e,t,n,o){var s=e.lastComponent;return s&&s.added===t&&s.removed===n?{oldPos:e.oldPos+o,lastComponent:{count:s.count+1,added:t,removed:n,previousComponent:s.previousComponent}}:{oldPos:e.oldPos+o,lastComponent:{count:1,added:t,removed:n,previousComponent:s}}},extractCommon:function(e,t,n,o){for(var s=t.length,i=n.length,r=e.oldPos,a=r-o,l=0;a+1<s&&r+1<i&&this.equals(t[a+1],n[r+1]);)a++,r++,l++;return l&&(e.lastComponent={count:l,previousComponent:e.lastComponent}),e.oldPos=r,a},equals:function(e,t){return this.options.comparator?this.options.comparator(e,t):e===t||this.options.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t},castInput:function(e){return e},tokenize:function(e){return e.split("")},join:function(e){return e.join("")}};var J=new $;var Y=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,K=/\S/,W=new $;W.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!K.test(e)&&!K.test(t)},W.tokenize=function(e){for(var t=e.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),n=0;n<t.length-1;n++)!t[n+1]&&t[n+2]&&Y.test(t[n])&&Y.test(t[n+2])&&(t[n]+=t[n+2],t.splice(n+1,2),n--);return t};var Z=new $;function Q(e){return Q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Q(e)}Z.tokenize=function(e){this.options.stripTrailingCr&&(e=e.replace(/\r\n/g,"\n"));var t=[],n=e.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(var o=0;o<n.length;o++){var s=n[o];o%2&&!this.options.newlineIsToken?t[t.length-1]+=s:(this.options.ignoreWhitespace&&(s=s.trim()),t.push(s))}return t},(new $).tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)},(new $).tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};var X=Object.prototype.toString,ee=new $;function te(e,t,n,o,s){var i,r;for(t=t||[],n=n||[],o&&(e=o(s,e)),i=0;i<t.length;i+=1)if(t[i]===e)return n[i];if("[object Array]"===X.call(e)){for(t.push(e),r=new Array(e.length),n.push(r),i=0;i<e.length;i+=1)r[i]=te(e[i],t,n,o,s);return t.pop(),n.pop(),r}if(e&&e.toJSON&&(e=e.toJSON()),"object"===Q(e)&&null!==e){t.push(e),r={},n.push(r);var a,l=[];for(a in e)e.hasOwnProperty(a)&&l.push(a);for(l.sort(),i=0;i<l.length;i+=1)r[a=l[i]]=te(e[a],t,n,o,a);t.pop(),n.pop()}else r=e;return r}ee.useLongestToken=!0,ee.tokenize=Z.tokenize,ee.castInput=function(e){var t=this.options,n=t.undefinedReplacement,o=t.stringifyReplacer,s=void 0===o?function(e,t){return void 0===t?n:t}:o;return"string"==typeof e?e:JSON.stringify(te(e,null,null,s),s," ")},ee.equals=function(e,t){return $.prototype.equals.call(ee,e.replace(/,([\r\n])/g,"$1"),t.replace(/,([\r\n])/g,"$1"))};var ne=new $;function oe(e,t){return(n=e,o=t,J.diff(n,o,s)).map(e=>{const t=M(e.value),n=function(e){let t="";return" "===e?t="NO-BREAK SPACE":" "===e?t="NARROW NO-BREAK SPACE":"‑"===e&&(t="NON-BREAKING HYPHEN"),t}(e.value);let o;return o=e.added?`<ins class="diff" title="${n}">${t}</ins>`:e.removed?`<del class="diff" title="${n}">${t}</del>`:t,o}).join("");var n,o,s}ne.tokenize=function(e){return e.slice()},ne.join=ne.removeEmpty=function(e){return e};class se{constructor(){this.domTextContainer=document.querySelector(".result__text"),this.domHtmlContainer=document.querySelector(".result__html"),this.domDiffContainer=document.querySelector(".result__diff"),this.domTextRadio=document.querySelector(".result__as-text"),this.domHtmlRadio=document.querySelector(".result__as-html"),this.domDiffRadio=document.querySelector(".result__as-diff"),this.lastResult="",this.update=(e,t)=>{var n;t!==this.lastResult&&(this.domTextContainer&&(this.domTextContainer.value=t),this.domHtmlContainer&&(this.domHtmlContainer.innerHTML=(n=t,[[/(\u00A0| | )/g," ","NO-BREAK SPACE"],[/(\u202F| )/g," ","NARROW NO-BREAK SPACE"],[/(\u2011|‑)/g,"‑","NON-BREAKING HYPHEN"]].forEach(e=>{const[t,o,s]=e;n=n.replace(t,`<span class="entity-highlight" title="${s}">${o}</span>`)}),n)),this.domDiffContainer&&(this.domDiffContainer.innerHTML=oe(e,t))),this.lastResult=t},this.updateWithDebounce=F(250,this.update),this.domTextRadio&&(this.domTextRadio.checked=!0),this.bindEvents(),this.setType("text")}setType(e){this.type=e,q(this.domTextContainer),q(this.domHtmlContainer),q(this.domDiffContainer),"diff"===e?(O(this.domDiffContainer),this.domDiffRadio&&(this.domDiffRadio.checked=!0)):"html"===e?(O(this.domHtmlContainer),this.domHtmlRadio&&(this.domHtmlRadio.checked=!0)):(O(this.domTextContainer),this.domTextRadio&&(this.domTextRadio.checked=!0))}bindEvents(){var e,t,n;null===(e=this.domTextRadio)||void 0===e||e.addEventListener("click",()=>{this.type="text",this.setType(this.type)}),null===(t=this.domHtmlRadio)||void 0===t||t.addEventListener("click",()=>{this.type="html",this.setType(this.type)}),null===(n=this.domDiffRadio)||void 0===n||n.addEventListener("click",()=>{this.type="diff",this.setType(this.type)})}}function ie(e){return ie="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ie(e)}class re{constructor(e){this.timeout=(null==e?void 0:e.timeout)||3e3,this.dom=document.createElement("div"),document.body.appendChild(this.dom)}show(e){const t=e.type||"ok";this.dom.className=`tooltip tooltip_visible tooltip_type_${t}`,this.dom.innerText=e.text,e.autocloseable&&(window.clearTimeout(this.timer),this.timer=window.setTimeout(()=>this.hide(),this.timeout))}hide(){window.clearTimeout(this.timer),this.dom.classList.remove("tooltip_visible")}}class ae{constructor(e){this.params=e,this.dom=document.querySelector(".copy-button")||document.querySelector(".copy-icon"),this.tooltip=new re,this.dom&&this.dom.addEventListener("click",()=>{!function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).target,n=void 0===t?document.body:t;if("string"!=typeof e)throw new TypeError("Expected parameter `text` to be a `string`, got `".concat(ie(e),"`."));var o=document.createElement("textarea"),s=document.activeElement;o.value=e,o.setAttribute("readonly",""),o.style.all="unset",o.style.contain="strict",o.style.position="absolute",o.style.left="-9999px",o.style.width="2em",o.style.height="2em",o.style.padding="0",o.style.border="none",o.style.outline="none",o.style.boxShadow="none",o.style.background="transparent",o.style.fontSize="12pt",o.style.whiteSpace="pre";var i=document.getSelection(),r=i.rangeCount>0&&i.getRangeAt(0);n.append(o),o.select(),o.selectionStart=0,o.selectionEnd=e.length;var a=!1;try{a=document.execCommand("copy")}catch(e){}return o.remove(),r&&(i.removeAllRanges(),i.addRange(r)),s&&s.focus(),a}(this.params.getText())?this.tooltip.show({text:b("notSupportCopy"),type:"error",autocloseable:!0}):this.tooltip.show({text:b("copied"),type:"ok",autocloseable:!0}),this.params.onClick()})}}function le(e){if(!window.Blob)return!1;const t=new Blob([e],{type:"text/plain"}),n=document.createElement("a");return n.download=function(e){const t=N(e)?"html":"txt",n=function(e){return(e||"").replace(/<\/?[^>]+(>|$)/g,"")}(e).replace(/\s+/g," ").trim();return(function(e,t){return e?e.length>t?e.substr(0,t):e:""}(n,32)||"text")+"."+t}(e),n.innerHTML="Download File",window.webkitURL?n.href=window.webkitURL.createObjectURL(t):(n.href=window.URL.createObjectURL(t),n.onclick=function(){document.body.removeChild(n)},n.style.display="none",document.body.appendChild(n)),n.click(),!0}class ue{constructor(e){this.params=e,this.dom=document.querySelector(".save-file-icon")||document.querySelector(".save-file-button"),this.dom&&this.dom.addEventListener("click",()=>{le(this.params.getText())?this.params.onClick():b("notSupportSave")})}}class ce{constructor(e){this.params=e,this.dom=document.querySelector(".share-icon"),this.canShare()?this.dom&&this.dom.addEventListener("click",()=>{this.shareText(this.params.getText()),this.params.onClick()}):q(this.dom)}canShare(){return!(!navigator.canShare||!navigator.canShare({text:"Hello"}))}shareText(e){navigator.share({text:e,title:"Typograf"})}}const de=(navigator.userAgent.search(" OPR/")>-1?"opera":void 0!==window.InstallTrigger?"firefox":navigator.userAgent.search("YaBrowser")>-1?"yabro":"chrome")||"chrome",he={yabro:{url:"https://addons.opera.com/ru/extensions/details/red-typography/",name:"Яндекс.Браузера"},firefox:{url:"https://addons.mozilla.org/ru/firefox/addon/typografy/",name:"Mozilla Firefox"},opera:{url:"https://addons.opera.com/ru/extensions/details/red-typography/",name:"Opera"},chrome:{url:"https://chrome.google.com/webstore/detail/red-typography/dgmmkhdeghobfcedlnmgbncknnfjhnmo",name:"Google Chrome"}}[de],me=document.querySelector(".extension__link");me&&(me.href=he.url,me.innerText=he.name,me.dataset.textId=de);const pe={documentTitle:{"en-US":"Typograf",ru:"Типограф — помощь с монотонной вёрсткой текстов"},typograf:{"en-US":"Typograf",ru:"Типограф"},"to-typograf":{"en-US":"Make beautiful",ru:"Сделать красиво"},close:{"en-US":"Close",ru:"Закрыть"},extension:{"en-US":"Extension for",ru:"Дополнение для"},prefs:{"en-US":"Settings",ru:"Настройки"},editor:{"en-US":"Editor",ru:"Редактор"},"lang-rule":{"en-US":"Language rules",ru:"Язык правил"},"lang-ui":{"en-US":"UI language",ru:"Язык интерфейса"},"html-entities":{"en-US":"HTML entities",ru:"HTML-сущности"},example:{"en-US":"Example",ru:"Пример"},"html-entities-example":{"en-US":'"A Z"',ru:'"А Я"'},"invisible-symbols":{"en-US":"for invisible symbols",ru:"для невидимых символов"},names:{"en-US":"Names",ru:"Имена"},digits:{"en-US":"Digits",ru:"Цифры"},copy:{"en-US":"Copy",ru:"Скопировать"},share:{"en-US":"Share",ru:"Поделиться"},copied:{"en-US":"Copied",ru:"Скопировано"},save:{"en-US":"Save",ru:"Сохранить"},notSupportCopy:{"en-US":"Your browser does not support copy text.",ru:"Ваш браузер не поддерживает копирование текста."},notSupportSave:{"en-US":"Your browser does not support save text to a file.",ru:"Ваш браузер не поддерживает сохранение текста в файл."},"select-all":{"en-US":"Select all",ru:"Выбрать всё"},default:{"en-US":"Default",ru:"По умолчанию"},"text:":{"en-US":"Text:",ru:"Текст:"},clear:{"en-US":"Clear",ru:"Очистить"},text:{"en-US":"Text",ru:"Текст"},html:{"en-US":"HTML",ru:"HTML"},"diff-1":{"en-US":"Diffe",ru:"Измен"},"diff-2":{"en-US":"rences",ru:"ения"},"input-text":{"en-US":"Input text, HTML or JSON",ru:"Введите текст, HTML или JSON"},result:{"en-US":"Result",ru:"Оттипографированный текст"},locale:{"en-US":"Locale",ru:"Локаль"},"full-version":{"en-US":"Full version",ru:"Полная версия"},"mobile-version":{"en-US":"Mobile version",ru:"Мобильная версия"},"report-error":{"en-US":"Report a error",ru:"Сообщить об ошибке"},"powered-by":{"en-US":"Powered by",ru:"На основе"},ru:{"en-US":"Russian",ru:"Русский"},"en-US":{"en-US":"English",ru:"Английский"},"locale-be":{"en-US":"Belarusian",ru:"Белорусская"},"locale-bg":{"en-US":"Bulgarian",ru:"Болгарская"},"locale-ca":{"en-US":"Catalan",ru:"Каталанская"},"locale-cs":{"en-US":"Czech",ru:"Чешская"},"locale-da":{"en-US":"Danish",ru:"Датская"},"locale-de":{"en-US":"German",ru:"Немецкая"},"locale-el":{"en-US":"Greek",ru:"Греческая"},"locale-en-GB":{"en-US":"English UK",ru:"Английская"},"locale-en-US":{"en-US":"English US",ru:"Американская"},"locale-eo":{"en-US":"Esperanto",ru:"Эсперанто"},"locale-es":{"en-US":"Spanish",ru:"Испанская"},"locale-et":{"en-US":"Estonian",ru:"Эстонская"},"locale-fi":{"en-US":"Finnish",ru:"Финская"},"locale-fr":{"en-US":"French",ru:"Французская"},"locale-ga":{"en-US":"Irish",ru:"Ирландская"},"locale-hu":{"en-US":"Hungarian",ru:"Венгерская"},"locale-it":{"en-US":"Italian",ru:"Итальянская"},"locale-lv":{"en-US":"Latvian",ru:"Латвийская"},"locale-nl":{"en-US":"Dutch",ru:"Голландская"},"locale-no":{"en-US":"Norwegian",ru:"Норвежская"},"locale-pl":{"en-US":"Polish",ru:"Польская"},"locale-ro":{"en-US":"Romanian",ru:"Румынская"},"locale-ru":{"en-US":"Russian",ru:"Русская"},"locale-sk":{"en-US":"Slovak",ru:"Словацкая"},"locale-sl":{"en-US":"Slovenian",ru:"Словенская"},"locale-sr":{"en-US":"Serbian",ru:"Сербская"},"locale-sv":{"en-US":"Swedish",ru:"Шведская"},"locale-tr":{"en-US":"Turkish",ru:"Турецкая"},"locale-uk":{"en-US":"Ukrainian",ru:"Украинская"},rules:{"en-US":"Rules",ru:"Правила"},yabro:{"en-US":"Yandex.Browser",ru:"Яндекс.Браузера"},chrome:{"en-US":"Google Chrome",ru:"Google Chrome"},opera:{"en-US":"Opera",ru:"Opera"},firefox:{"en-US":"Mozilla Firefox",ru:"Mozilla Firefox"},Check:{"en-US":"Check",ru:"Проверь"},"device-online":{"en-US":"device online!",ru:"устройство онлайн!"}},fe={name:"ru/other/eyo",handler:e=>window.safeEyo?window.safeEyo.restore(e):e},ge={"en-US":"Replacing the letter “E” with “Ё”",ru:"Замена буквы «Е» на «Ё»"};function ve(){const e={};_.titles[fe.name]=ge,Object.keys(_.titles).forEach(t=>{let n=_.titles[t];n.common&&(n={"en-US":n.common,ru:n.common}),e[t]=n}),x(e);const t={};_.groups.forEach(e=>{t[e.name]=e.title}),x(t)}m(f),setTimeout(()=>{h({browserInfo:{ar:!0,nb:!0},counterId:f,pageParams:{}})},15e3),window.addEventListener("error",e=>{var t,n;if(!e)return;const o=["JS errors",e.message||(null===(t=e.error)||void 0===t?void 0:t.message)||"no_message",(null===(n=e.error)||void 0===n?void 0:n.stack)||e.filename+":"+e.lineno+":"+e.colno||"no_stack"],s={};let i,r=s;for(i=0;i<o.length-1;i++)r=r[o[i]]={};var a;r[o[i]]=1,function(e,t){t&&h({browserInfo:{ar:!0,pa:!0},counterId:e,pageParams:{},params:t})}(f,a=s),console.info("metrika: params",a)}),console.info("metrika: hit"),w(U.language),x(pe),ve(),_.addRule(fe),C(),window.addEventListener("beforeinstallprompt",e=>{}),new class{constructor(){if(this.lastText={value:"",result:""},this.isMobile=document.body.classList.contains("page_mobile"),this.typograf=new _({locale:["ru"]}),this.handlePrefsClick=e=>{"prefs"===e?(this.prefs.show(),window.location.hash="#!prefs"):setTimeout(()=>{this.prefs.hide(),window.location.hash="",this.execute()},0)},document.body.classList.remove("transition_no"),this.input=new G({value:U.text,isMobile:this.isMobile,onChange:()=>{U.text=this.input.getValue(),this.execute()}}),this.initActionIcons(),new B({onClick:this.handlePrefsClick}),this.prefs=new z({typograf:this.typograf,getLanguage:()=>U.language,getMode:()=>U.mode,getLocale:()=>U.locale,getOnlyInvisible:()=>U.onlyInvisible,onChange:e=>{U.locale=e.locale,U.mode=e.mode,U.onlyInvisible=e.onlyInvisible,U.rules=e.rules,this.execute()}}),new A({defaultLanguage:U.language,languages:[{value:"ru",title:b("ru")},{value:"en-US",title:b("en-US")}],onChange:e=>{w(e),U.language=e,C(),g("switch-lang")}}),this.result=new se,this.prepareRules(),!this.isMobile){const e=I("text");e&&this.setValue(e)}this.execute(),k()&&setTimeout(()=>{this.handlePrefsClick("prefs")},0)}initActionIcons(){new ae({getText:()=>this.getResultForAction(),onClick:()=>g("copy-text")}),new ue({getText:()=>this.getResultForAction(),onClick:()=>g("save-text")}),new ce({getText:()=>this.getResultForAction(),onClick:()=>g("share-text")})}getResultForAction(){return this.isMobile?this.input.getValue():this.lastText.result}prepareRules(){const{rules:e}=U;this.typograf.enableRule(e.enabled),this.typograf.disableRule(e.disabled)}typografy(e){if(function(e){if(-1===e.search(/[{}[\]]/))return!1;try{return JSON.parse(e),!0}catch(e){return!1}}(e))return function(e,t){try{const n=JSON.parse(e);return JSON.stringify(n,(e,n)=>"string"==typeof n?t(n):n,2)}catch(t){return e}}(e,e=>this.typograf.execute(e,this.getTypografSettings()));{let t=this.typograf.execute(e,this.getTypografSettings());return N(t)&&window.html_beautify&&(t=window.html_beautify(t)),t}}execute(){const e=this.input.getValue(),t=this.typografy(e);this.lastText={value:e,result:t},this.isMobile?this.input.setValue(this.lastText.result):this.lastText.value.length<1e4?this.result.update(this.lastText.value,this.lastText.result):this.result.updateWithDebounce(this.lastText.value,this.lastText.result)}getTypografSettings(){return{locale:v(U.locale),htmlEntity:{type:U.mode,onlyInvisible:U.onlyInvisible}}}setValue(e){this.input.setValue(e),!this.isMobile&&this.prefs.opened()}}}();
</script>
</body>
</html>