-
Notifications
You must be signed in to change notification settings - Fork 1
/
news.1a89c769af8d68f4fc30.js
319 lines (275 loc) · 27.2 KB
/
news.1a89c769af8d68f4fc30.js
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
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
(this["webpackJsonp"] = this["webpackJsonp"] || []).push([[34],{
/***/ 3161:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(395);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var counterpart__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(578);
/* harmony import */ var counterpart__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(counterpart__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var steem_js_api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3162);
/* harmony import */ var steem_js_api__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(steem_js_api__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var golos_classic_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3182);
/* harmony import */ var golos_classic_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(golos_classic_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var react_translate_component__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1860);
/* harmony import */ var react_translate_component__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_translate_component__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _LoadingIndicator__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1957);
/* harmony import */ var common_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(562);
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var api = void 0;
var query = {
select_authors: ["rudex"],
tag: "rudex",
limit: 20
};
var alignRight = { textAlign: "right" };
var alignLeft = { textAlign: "left" };
var rowHeight = { height: "2rem" };
var bodyCell = { padding: "0.5rem 1rem" };
var headerCell = { padding: "0.85rem 1rem" };
var leftCell = _extends({}, alignLeft, bodyCell);
var rightCell = _extends({}, alignRight, bodyCell);
var leftCellHeader = _extends({}, alignLeft, headerCell);
var rightCellHeader = _extends({}, alignRight, headerCell);
var secondCol = _extends({}, leftCell, { width: "180px" });
var SomethingWentWrong = function SomethingWentWrong() {
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"p",
null,
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_translate_component__WEBPACK_IMPORTED_MODULE_4___default.a, { content: "news.errors.fetch" })
);
};
var ReusableLink = function ReusableLink(_ref) {
var data = _ref.data,
locale = _ref.locale,
url = _ref.url,
_ref$isLink = _ref.isLink,
isLink = _ref$isLink === undefined ? false : _ref$isLink;
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"a",
{
//href={`https://steemit.com${url}`}
//href={`https://golos.id${url}`}
href: locale == "ru" ? "https://golos.id" + url : "https://steemit.com" + url,
rel: "noreferrer noopener",
target: "_blank",
style: { display: "block" },
className: !isLink ? "primary-text" : "external-link"
},
common_utils__WEBPACK_IMPORTED_MODULE_6__["default"].sanitize(data)
);
};
var NewsTable = function NewsTable(_ref2) {
var data = _ref2.data,
width = _ref2.width,
locale = _ref2.locale;
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"table",
{
className: "table table-hover dashboard-table",
style: { fontSize: "0.85rem" }
},
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"thead",
null,
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"tr",
null,
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"th",
{ style: rightCellHeader },
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_translate_component__WEBPACK_IMPORTED_MODULE_4___default.a, {
component: "span",
content: "account.votes.line"
})
),
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"th",
{ style: leftCellHeader },
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_translate_component__WEBPACK_IMPORTED_MODULE_4___default.a, {
component: "span",
content: "explorer.block.date"
})
),
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"th",
{ style: leftCellHeader },
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_translate_component__WEBPACK_IMPORTED_MODULE_4___default.a, { component: "span", content: "news.subject" })
),
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"th",
{ style: leftCellHeader },
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_translate_component__WEBPACK_IMPORTED_MODULE_4___default.a, { component: "span", content: "news.author" })
)
)
),
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"tbody",
null,
data.map(function (singleNews, iter) {
var theAuthor = singleNews.parentAuthor ? singleNews.parentAuthor : singleNews.author;
var formattedDate = counterpart__WEBPACK_IMPORTED_MODULE_1___default.a.localize(new Date(singleNews.created));
var smartTitle = singleNews.title.length * 6 > width - 450 ? singleNews.title.slice(0, Math.floor(width - 450) / 6) + "..." : singleNews.title;
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"tr",
{ key: "" + singleNews.title.slice(0, 10) + iter },
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"td",
{ style: rightCell },
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(ReusableLink, {
data: iter + 1,
locale: locale,
url: singleNews.url
})
),
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"td",
{ style: secondCol },
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(ReusableLink, {
data: formattedDate,
locale: locale,
url: singleNews.url
})
),
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"td",
{ style: leftCell },
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(ReusableLink, {
data: smartTitle,
locale: locale,
url: singleNews.url,
isLink: true
})
),
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"td",
{ style: leftCell },
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(ReusableLink, {
data: theAuthor,
locale: locale,
url: singleNews.url
})
)
);
})
),
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"thead",
null,
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"tr",
{ style: rowHeight },
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", { style: rightCell }),
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", { style: leftCell }),
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", { style: leftCell }),
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", { style: leftCell })
)
)
);
};
var News = function (_React$Component) {
_inherits(News, _React$Component);
function News(props) {
_classCallCheck(this, News);
var _this = _possibleConstructorReturn(this, (News.__proto__ || Object.getPrototypeOf(News)).call(this, props));
_this.state = {
isLoading: true,
isWrong: false,
discussions: [],
width: 1200,
currentLocale: react_translate_component__WEBPACK_IMPORTED_MODULE_4___default.a.getLocale()
};
_this.updateDimensions = _this.updateDimensions.bind(_this);
_this.orderDiscussions = _this.orderDiscussions.bind(_this);
return _this;
}
_createClass(News, [{
key: "updateDimensions",
value: function updateDimensions() {
this.setState({ width: window.innerWidth });
}
}, {
key: "orderDiscussions",
value: function orderDiscussions(discussions) {
var orderedDiscussions = discussions.sort(function (a, b) {
return new Date(b.created) - new Date(a.created);
});
this.setState({ discussions: orderedDiscussions, isLoading: false });
}
}, {
key: "componentDidMount",
value: function componentDidMount() {
var _this2 = this;
this.updateDimensions();
window.addEventListener("resize", this.updateDimensions);
if (this.state.currentLocale === "ru") {
api = golos_classic_js__WEBPACK_IMPORTED_MODULE_3__["api"];
api.setWebSocket("wss://api.golos.id/ws");
} else api = steem_js_api__WEBPACK_IMPORTED_MODULE_2__["api"];
api.getDiscussionsByBlog(query).then(function (discussions) {
_this2.orderDiscussions(discussions);
}).catch(function () {
_this2.setState({ isLoading: false, isWrong: true });
});
}
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
window.removeEventListener("resize", this.updateDimensions);
}
}, {
key: "render",
value: function render() {
var _state = this.state,
isLoading = _state.isLoading,
isWrong = _state.isWrong,
discussions = _state.discussions,
width = _state.width,
currentLocale = _state.currentLocale;
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{ className: "grid-block page-layout" },
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{ className: "grid-block vertical" },
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{ className: "account-tabs" },
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{ className: "tab-content" },
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{ className: "grid-block vertical" },
isWrong && react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(SomethingWentWrong, null),
isLoading ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_LoadingIndicator__WEBPACK_IMPORTED_MODULE_5__["default"], null) : null,
!isWrong && !isLoading && react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(NewsTable, {
width: width,
data: discussions,
locale: currentLocale
})
)
)
)
)
);
}
}]);
return News;
}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);
/* harmony default export */ __webpack_exports__["default"] = (News);
/***/ }),
/***/ 3180:
/***/ (function(module, exports) {
/* (ignored) */
/***/ }),
/***/ 3210:
/***/ (function(module, exports) {
/* (ignored) */
/***/ })
}]);
//# s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2tcIn19XG4gICAgICAgIGNsYXNzTmFtZT17IWlzTGluayA/IFwicHJpbWFyeS10ZXh0XCIgOiBcImV4dGVybmFsLWxpbmtcIn1cbiAgICA+XG4gICAgICAgIHt1dGlscy5zYW5pdGl6ZShkYXRhKX1cbiAgICA8L2E+XG4pO1xuXG5jb25zdCBOZXdzVGFibGUgPSAoe2RhdGEsIHdpZHRoLCBsb2NhbGV9KSA9PiB7XG4gICAgcmV0dXJuIChcbiAgICAgICAgPHRhYmxlXG4gICAgICAgICAgICBjbGFzc05hbWU9XCJ0YWJsZSB0YWJsZS1ob3ZlciBkYXNoYm9hcmQtdGFibGVcIlxuICAgICAgICAgICAgc3R5bGU9e3tmb250U2l6ZTogXCIwLjg1cmVtXCJ9fVxuICAgICAgICA+XG4gICAgICAgICAgICA8dGhlYWQ+XG4gICAgICAgICAgICAgICAgPHRyPlxuICAgICAgICAgICAgICAgICAgICA8dGggc3R5bGU9e3JpZ2h0Q2VsbEhlYWRlcn0+XG4gICAgICAgICAgICAgICAgICAgICAgICA8VHJhbnNsYXRlXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29tcG9uZW50PVwic3BhblwiXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudD1cImFjY291bnQudm90ZXMubGluZVwiXG4gICAgICAgICAgICAgICAgICAgICAgICAvPlxuICAgICAgICAgICAgICAgICAgICA8L3RoPlxuICAgICAgICAgICAgICAgICAgICA8dGggc3R5bGU9e2xlZnRDZWxsSGVhZGVyfT5cbiAgICAgICAgICAgICAgICAgICAgICAgIDxUcmFuc2xhdGVcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb21wb25lbnQ9XCJzcGFuXCJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50PVwiZXhwbG9yZXIuYmxvY2suZGF0ZVwiXG4gICAgICAgICAgICAgICAgICAgICAgICAvPlxuICAgICAgICAgICAgICAgICAgICA8L3RoPlxuICAgICAgICAgICAgICAgICAgICA8dGggc3R5bGU9e2xlZnRDZWxsSGVhZGVyfT5cbiAgICAgICAgICAgICAgICAgICAgICAgIDxUcmFuc2xhdGUgY29tcG9uZW50PVwic3BhblwiIGNvbnRlbnQ9XCJuZXdzLnN1YmplY3RcIiAvPlxuICAgICAgICAgICAgICAgICAgICA8L3RoPlxuICAgICAgICAgICAgICAgICAgICA8dGggc3R5bGU9e2xlZnRDZWxsSGVhZGVyfT5cbiAgICAgICAgICAgICAgICAgICAgICAgIDxUcmFuc2xhdGUgY29tcG9uZW50PVwic3BhblwiIGNvbnRlbnQ9XCJuZXdzLmF1dGhvclwiIC8+XG4gICAgICAgICAgICAgICAgICAgIDwvdGg+XG4gICAgICAgICAgICAgICAgPC90cj5cbiAgICAgICAgICAgIDwvdGhlYWQ+XG4gICAgICAgICAgICA8dGJvZHk+XG4gICAgICAgICAgICAgICAge2RhdGEubWFwKChzaW5nbGVOZXdzLCBpdGVyKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHRoZUF1dGhvciA9IHNpbmdsZU5ld3MucGFyZW50QXV0aG9yXG4gICAgICAgICAgICAgICAgICAgICAgICA/IHNpbmdsZU5ld3MucGFyZW50QXV0aG9yXG4gICAgICAgICAgICAgICAgICAgICAgICA6IHNpbmdsZU5ld3MuYXV0aG9yO1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBmb3JtYXR0ZWREYXRlID0gY291bnRlcnBhcnQubG9jYWxpemUoXG4gICAgICAgICAgICAgICAgICAgICAgICBuZXcgRGF0ZShzaW5nbGVOZXdzLmNyZWF0ZWQpXG4gICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHNtYXJ0VGl0bGUgPVxuICAgICAgICAgICAgICAgICAgICAgICAgc2luZ2xlTmV3cy50aXRsZS5sZW5ndGggKiA2ID4gd2lkdGggLSA0NTBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IGAke3NpbmdsZU5ld3MudGl0bGUuc2xpY2UoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNYXRoLmZsb29yKHdpZHRoIC0gNDUwKSAvIDZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICl9Li4uYFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogc2luZ2xlTmV3cy50aXRsZTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIChcbiAgICAgICAgICAgICAgICAgICAgICAgIDx0ciBrZXk9e2Ake3NpbmdsZU5ld3MudGl0bGUuc2xpY2UoMCwgMTApfSR7aXRlcn1gfT5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8dGQgc3R5bGU9e3JpZ2h0Q2VsbH0+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxSZXVzYWJsZUxpbmtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGE9e2l0ZXIgKyAxfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9jYWxlPXtsb2NhbGV9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw9e3NpbmdsZU5ld3MudXJsfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvdGQ+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPHRkIHN0eWxlPXtzZWNvbmRDb2x9PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8UmV1c2FibGVMaW5rXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhPXtmb3JtYXR0ZWREYXRlfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9jYWxlPXtsb2NhbGV9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw9e3NpbmdsZU5ld3MudXJsfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvdGQ+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPHRkIHN0eWxlPXtsZWZ0Q2VsbH0+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxSZXVzYWJsZUxpbmtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGE9e3NtYXJ0VGl0bGV9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2NhbGU9e2xvY2FsZX1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybD17c2luZ2xlTmV3cy51cmx9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpc0xpbmtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLz5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L3RkPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDx0ZCBzdHlsZT17bGVmdENlbGx9PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8UmV1c2FibGVMaW5rXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhPXt0aGVBdXRob3J9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2NhbGU9e2xvY2FsZX1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybD17c2luZ2xlTmV3cy51cmx9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPC90ZD5cbiAgICAgICAgICAgICAgICAgICAgICAgIDwvdHI+XG4gICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgfSl9XG4gICAgICAgICAgICA8L3Rib2R5PlxuICAgICAgICAgICAgPHRoZWFkPlxuICAgICAgICAgICAgICAgIDx0ciBzdHlsZT17cm93SGVpZ2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pc3RlbmVyKFwicmVzaXplXCIsIHRoaXMudXBkYXRlRGltZW5zaW9ucyk7XG4gICAgfVxuXG4gICAgcmVuZGVyKCkge1xuICAgICAgICBjb25zdCB7XG4gICAgICAgICAgICBpc0xvYWRpbmcsXG4gICAgICAgICAgICBpc1dyb25nLFxuICAgICAgICAgICAgZGlzY3Vzc2lvbnMsXG4gICAgICAgICAgICB3aWR0aCxcbiAgICAgICAgICAgIGN1cnJlbnRMb2NhbGVcbiAgICAgICAgfSA9IHRoaXMuc3RhdGU7XG5cbiAgICAgICAgcmV0dXJuIChcbiAgICAgICAgICAgIDxkaXYgY2xhc3NOYW1lPVwiZ3JpZC1ibG9jayBwYWdlLWxheW91dFwiPlxuICAgICAgICAgICAgICAgIDxkaXYgY2xhc3NOYW1lPVwiZ3JpZC1ibG9jayB2ZXJ0aWNhbFwiPlxuICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzTmFtZT1cImFjY291bnQtdGFic1wiPlxuICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzc05hbWU9XCJ0YWItY29udGVudFwiPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3NOYW1lPVwiZ3JpZC1ibG9jayB2ZXJ0aWNhbFwiPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7aXNXcm9uZyAmJiA8U29tZXRoaW5nV2VudFdyb25nIC8+fVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7aXNMb2FkaW5nID8gPExvYWRpbmdJbmRpY2F0b3IgLz4gOiBudWxsfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IWlzV3JvbmcgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICFpc0xvYWRpbmcgJiYgKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxOZXdzVGFibGVcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC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