acsi-core 0.9.9 → 0.9.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/containers/PDF/views/PDFViewer.d.ts +3 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.js +120 -649
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +106 -637
- package/dist/index.modern.js.map +1 -1
- package/dist/utils/sanitizeSrc.d.ts +7 -0
- package/package.json +2 -1
- package/dist/components/UpdateNotifier.d.ts +0 -3
- package/dist/configs/api_removed.d.ts +0 -3
- package/dist/utils/configLoader.d.ts +0 -2
- package/dist/utils/hooks/useServiceWorker.d.ts +0 -1
package/dist/index.modern.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import { createBrowserHistory } from 'history';
|
|
2
|
+
import Cookies from 'js-cookie';
|
|
3
|
+
export { default as Cookies } from 'js-cookie';
|
|
4
|
+
export { default as DOMPurify } from 'dompurify';
|
|
1
5
|
import { createAction, createReducer, configureStore } from '@reduxjs/toolkit';
|
|
2
6
|
import React, { useState, useRef, useEffect, useCallback, Fragment } from 'react';
|
|
3
7
|
import { useGoogleLogin } from '@react-oauth/google';
|
|
@@ -8,12 +12,12 @@ import { Link } from 'react-router-dom';
|
|
|
8
12
|
import { FormGroup, Input, Label, Modal, ModalHeader, ModalBody, ModalFooter, Tooltip, Row, Col, Button, Pagination, PaginationItem, PaginationLink } from 'reactstrap';
|
|
9
13
|
import ReactSelect, { components } from 'react-select';
|
|
10
14
|
import ReactMarkdown from 'react-markdown';
|
|
15
|
+
import remarkGfm from 'remark-gfm';
|
|
11
16
|
import remarkMath from 'remark-math';
|
|
12
17
|
import rehypeKatex from 'rehype-katex';
|
|
18
|
+
import remarkRehype from 'remark-rehype';
|
|
13
19
|
import rehypeRaw from 'rehype-raw';
|
|
14
20
|
import 'katex/dist/katex.min.css';
|
|
15
|
-
import Cookies from 'js-cookie';
|
|
16
|
-
export { default as Cookies } from 'js-cookie';
|
|
17
21
|
import moment from 'moment';
|
|
18
22
|
import { toast } from 'react-toastify';
|
|
19
23
|
export { ToastContainer, toast } from 'react-toastify';
|
|
@@ -25,592 +29,6 @@ import { init as init$1, replayIntegration } from '@sentry/react';
|
|
|
25
29
|
import { FaCaretDown } from 'react-icons/fa';
|
|
26
30
|
import CreatableSelect from 'react-select/creatable';
|
|
27
31
|
|
|
28
|
-
function _extends() {
|
|
29
|
-
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
30
|
-
for (var e = 1; e < arguments.length; e++) {
|
|
31
|
-
var t = arguments[e];
|
|
32
|
-
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
33
|
-
}
|
|
34
|
-
return n;
|
|
35
|
-
}, _extends.apply(null, arguments);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function isAbsolute(pathname) {
|
|
39
|
-
return pathname.charAt(0) === '/';
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
// About 1.5x faster than the two-arg version of Array#splice()
|
|
43
|
-
function spliceOne(list, index) {
|
|
44
|
-
for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) {
|
|
45
|
-
list[i] = list[k];
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
list.pop();
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// This implementation is based heavily on node's url.parse
|
|
52
|
-
function resolvePathname(to, from) {
|
|
53
|
-
if (from === undefined) from = '';
|
|
54
|
-
|
|
55
|
-
var toParts = (to && to.split('/')) || [];
|
|
56
|
-
var fromParts = (from && from.split('/')) || [];
|
|
57
|
-
|
|
58
|
-
var isToAbs = to && isAbsolute(to);
|
|
59
|
-
var isFromAbs = from && isAbsolute(from);
|
|
60
|
-
var mustEndAbs = isToAbs || isFromAbs;
|
|
61
|
-
|
|
62
|
-
if (to && isAbsolute(to)) {
|
|
63
|
-
// to is absolute
|
|
64
|
-
fromParts = toParts;
|
|
65
|
-
} else if (toParts.length) {
|
|
66
|
-
// to is relative, drop the filename
|
|
67
|
-
fromParts.pop();
|
|
68
|
-
fromParts = fromParts.concat(toParts);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
if (!fromParts.length) return '/';
|
|
72
|
-
|
|
73
|
-
var hasTrailingSlash;
|
|
74
|
-
if (fromParts.length) {
|
|
75
|
-
var last = fromParts[fromParts.length - 1];
|
|
76
|
-
hasTrailingSlash = last === '.' || last === '..' || last === '';
|
|
77
|
-
} else {
|
|
78
|
-
hasTrailingSlash = false;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
var up = 0;
|
|
82
|
-
for (var i = fromParts.length; i >= 0; i--) {
|
|
83
|
-
var part = fromParts[i];
|
|
84
|
-
|
|
85
|
-
if (part === '.') {
|
|
86
|
-
spliceOne(fromParts, i);
|
|
87
|
-
} else if (part === '..') {
|
|
88
|
-
spliceOne(fromParts, i);
|
|
89
|
-
up++;
|
|
90
|
-
} else if (up) {
|
|
91
|
-
spliceOne(fromParts, i);
|
|
92
|
-
up--;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
if (!mustEndAbs) for (; up--; up) fromParts.unshift('..');
|
|
97
|
-
|
|
98
|
-
if (
|
|
99
|
-
mustEndAbs &&
|
|
100
|
-
fromParts[0] !== '' &&
|
|
101
|
-
(!fromParts[0] || !isAbsolute(fromParts[0]))
|
|
102
|
-
)
|
|
103
|
-
fromParts.unshift('');
|
|
104
|
-
|
|
105
|
-
var result = fromParts.join('/');
|
|
106
|
-
|
|
107
|
-
if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';
|
|
108
|
-
|
|
109
|
-
return result;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
var isProduction = process.env.NODE_ENV === 'production';
|
|
113
|
-
function warning(condition, message) {
|
|
114
|
-
if (!isProduction) {
|
|
115
|
-
if (condition) {
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
var text = "Warning: " + message;
|
|
120
|
-
|
|
121
|
-
if (typeof console !== 'undefined') {
|
|
122
|
-
console.warn(text);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
try {
|
|
126
|
-
throw Error(text);
|
|
127
|
-
} catch (x) {}
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
var isProduction$1 = process.env.NODE_ENV === 'production';
|
|
132
|
-
var prefix = 'Invariant failed';
|
|
133
|
-
function invariant(condition, message) {
|
|
134
|
-
if (condition) {
|
|
135
|
-
return;
|
|
136
|
-
}
|
|
137
|
-
if (isProduction$1) {
|
|
138
|
-
throw new Error(prefix);
|
|
139
|
-
}
|
|
140
|
-
var provided = typeof message === 'function' ? message() : message;
|
|
141
|
-
var value = provided ? "".concat(prefix, ": ").concat(provided) : prefix;
|
|
142
|
-
throw new Error(value);
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
function addLeadingSlash(path) {
|
|
146
|
-
return path.charAt(0) === '/' ? path : '/' + path;
|
|
147
|
-
}
|
|
148
|
-
function hasBasename(path, prefix) {
|
|
149
|
-
return path.toLowerCase().indexOf(prefix.toLowerCase()) === 0 && '/?#'.indexOf(path.charAt(prefix.length)) !== -1;
|
|
150
|
-
}
|
|
151
|
-
function stripBasename(path, prefix) {
|
|
152
|
-
return hasBasename(path, prefix) ? path.substr(prefix.length) : path;
|
|
153
|
-
}
|
|
154
|
-
function stripTrailingSlash(path) {
|
|
155
|
-
return path.charAt(path.length - 1) === '/' ? path.slice(0, -1) : path;
|
|
156
|
-
}
|
|
157
|
-
function parsePath(path) {
|
|
158
|
-
var pathname = path || '/';
|
|
159
|
-
var search = '';
|
|
160
|
-
var hash = '';
|
|
161
|
-
var hashIndex = pathname.indexOf('#');
|
|
162
|
-
|
|
163
|
-
if (hashIndex !== -1) {
|
|
164
|
-
hash = pathname.substr(hashIndex);
|
|
165
|
-
pathname = pathname.substr(0, hashIndex);
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
var searchIndex = pathname.indexOf('?');
|
|
169
|
-
|
|
170
|
-
if (searchIndex !== -1) {
|
|
171
|
-
search = pathname.substr(searchIndex);
|
|
172
|
-
pathname = pathname.substr(0, searchIndex);
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
return {
|
|
176
|
-
pathname: pathname,
|
|
177
|
-
search: search === '?' ? '' : search,
|
|
178
|
-
hash: hash === '#' ? '' : hash
|
|
179
|
-
};
|
|
180
|
-
}
|
|
181
|
-
function createPath(location) {
|
|
182
|
-
var pathname = location.pathname,
|
|
183
|
-
search = location.search,
|
|
184
|
-
hash = location.hash;
|
|
185
|
-
var path = pathname || '/';
|
|
186
|
-
if (search && search !== '?') path += search.charAt(0) === '?' ? search : "?" + search;
|
|
187
|
-
if (hash && hash !== '#') path += hash.charAt(0) === '#' ? hash : "#" + hash;
|
|
188
|
-
return path;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
function createLocation(path, state, key, currentLocation) {
|
|
192
|
-
var location;
|
|
193
|
-
|
|
194
|
-
if (typeof path === 'string') {
|
|
195
|
-
// Two-arg form: push(path, state)
|
|
196
|
-
location = parsePath(path);
|
|
197
|
-
location.state = state;
|
|
198
|
-
} else {
|
|
199
|
-
// One-arg form: push(location)
|
|
200
|
-
location = _extends({}, path);
|
|
201
|
-
if (location.pathname === undefined) location.pathname = '';
|
|
202
|
-
|
|
203
|
-
if (location.search) {
|
|
204
|
-
if (location.search.charAt(0) !== '?') location.search = '?' + location.search;
|
|
205
|
-
} else {
|
|
206
|
-
location.search = '';
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
if (location.hash) {
|
|
210
|
-
if (location.hash.charAt(0) !== '#') location.hash = '#' + location.hash;
|
|
211
|
-
} else {
|
|
212
|
-
location.hash = '';
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
if (state !== undefined && location.state === undefined) location.state = state;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
try {
|
|
219
|
-
location.pathname = decodeURI(location.pathname);
|
|
220
|
-
} catch (e) {
|
|
221
|
-
if (e instanceof URIError) {
|
|
222
|
-
throw new URIError('Pathname "' + location.pathname + '" could not be decoded. ' + 'This is likely caused by an invalid percent-encoding.');
|
|
223
|
-
} else {
|
|
224
|
-
throw e;
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
if (key) location.key = key;
|
|
229
|
-
|
|
230
|
-
if (currentLocation) {
|
|
231
|
-
// Resolve incomplete/relative pathname relative to current location.
|
|
232
|
-
if (!location.pathname) {
|
|
233
|
-
location.pathname = currentLocation.pathname;
|
|
234
|
-
} else if (location.pathname.charAt(0) !== '/') {
|
|
235
|
-
location.pathname = resolvePathname(location.pathname, currentLocation.pathname);
|
|
236
|
-
}
|
|
237
|
-
} else {
|
|
238
|
-
// When there is no prior location and pathname is empty, set it to /
|
|
239
|
-
if (!location.pathname) {
|
|
240
|
-
location.pathname = '/';
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
return location;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
function createTransitionManager() {
|
|
248
|
-
var prompt = null;
|
|
249
|
-
|
|
250
|
-
function setPrompt(nextPrompt) {
|
|
251
|
-
process.env.NODE_ENV !== "production" ? warning(prompt == null, 'A history supports only one prompt at a time') : void 0;
|
|
252
|
-
prompt = nextPrompt;
|
|
253
|
-
return function () {
|
|
254
|
-
if (prompt === nextPrompt) prompt = null;
|
|
255
|
-
};
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
function confirmTransitionTo(location, action, getUserConfirmation, callback) {
|
|
259
|
-
// TODO: If another transition starts while we're still confirming
|
|
260
|
-
// the previous one, we may end up in a weird state. Figure out the
|
|
261
|
-
// best way to handle this.
|
|
262
|
-
if (prompt != null) {
|
|
263
|
-
var result = typeof prompt === 'function' ? prompt(location, action) : prompt;
|
|
264
|
-
|
|
265
|
-
if (typeof result === 'string') {
|
|
266
|
-
if (typeof getUserConfirmation === 'function') {
|
|
267
|
-
getUserConfirmation(result, callback);
|
|
268
|
-
} else {
|
|
269
|
-
process.env.NODE_ENV !== "production" ? warning(false, 'A history needs a getUserConfirmation function in order to use a prompt message') : void 0;
|
|
270
|
-
callback(true);
|
|
271
|
-
}
|
|
272
|
-
} else {
|
|
273
|
-
// Return false from a transition hook to cancel the transition.
|
|
274
|
-
callback(result !== false);
|
|
275
|
-
}
|
|
276
|
-
} else {
|
|
277
|
-
callback(true);
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
var listeners = [];
|
|
282
|
-
|
|
283
|
-
function appendListener(fn) {
|
|
284
|
-
var isActive = true;
|
|
285
|
-
|
|
286
|
-
function listener() {
|
|
287
|
-
if (isActive) fn.apply(void 0, arguments);
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
listeners.push(listener);
|
|
291
|
-
return function () {
|
|
292
|
-
isActive = false;
|
|
293
|
-
listeners = listeners.filter(function (item) {
|
|
294
|
-
return item !== listener;
|
|
295
|
-
});
|
|
296
|
-
};
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
function notifyListeners() {
|
|
300
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
301
|
-
args[_key] = arguments[_key];
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
listeners.forEach(function (listener) {
|
|
305
|
-
return listener.apply(void 0, args);
|
|
306
|
-
});
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
return {
|
|
310
|
-
setPrompt: setPrompt,
|
|
311
|
-
confirmTransitionTo: confirmTransitionTo,
|
|
312
|
-
appendListener: appendListener,
|
|
313
|
-
notifyListeners: notifyListeners
|
|
314
|
-
};
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
|
|
318
|
-
function getConfirmation(message, callback) {
|
|
319
|
-
callback(window.confirm(message)); // eslint-disable-line no-alert
|
|
320
|
-
}
|
|
321
|
-
/**
|
|
322
|
-
* Returns true if the HTML5 history API is supported. Taken from Modernizr.
|
|
323
|
-
*
|
|
324
|
-
* https://github.com/Modernizr/Modernizr/blob/master/LICENSE
|
|
325
|
-
* https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js
|
|
326
|
-
* changed to avoid false negatives for Windows Phones: https://github.com/reactjs/react-router/issues/586
|
|
327
|
-
*/
|
|
328
|
-
|
|
329
|
-
function supportsHistory() {
|
|
330
|
-
var ua = window.navigator.userAgent;
|
|
331
|
-
if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) return false;
|
|
332
|
-
return window.history && 'pushState' in window.history;
|
|
333
|
-
}
|
|
334
|
-
/**
|
|
335
|
-
* Returns true if browser fires popstate on hash change.
|
|
336
|
-
* IE10 and IE11 do not.
|
|
337
|
-
*/
|
|
338
|
-
|
|
339
|
-
function supportsPopStateOnHashChange() {
|
|
340
|
-
return window.navigator.userAgent.indexOf('Trident') === -1;
|
|
341
|
-
}
|
|
342
|
-
/**
|
|
343
|
-
* Returns true if a given popstate event is an extraneous WebKit event.
|
|
344
|
-
* Accounts for the fact that Chrome on iOS fires real popstate events
|
|
345
|
-
* containing undefined state when pressing the back button.
|
|
346
|
-
*/
|
|
347
|
-
|
|
348
|
-
function isExtraneousPopstateEvent(event) {
|
|
349
|
-
return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
var PopStateEvent = 'popstate';
|
|
353
|
-
var HashChangeEvent = 'hashchange';
|
|
354
|
-
|
|
355
|
-
function getHistoryState() {
|
|
356
|
-
try {
|
|
357
|
-
return window.history.state || {};
|
|
358
|
-
} catch (e) {
|
|
359
|
-
// IE 11 sometimes throws when accessing window.history.state
|
|
360
|
-
// See https://github.com/ReactTraining/history/pull/289
|
|
361
|
-
return {};
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
/**
|
|
365
|
-
* Creates a history object that uses the HTML5 history API including
|
|
366
|
-
* pushState, replaceState, and the popstate event.
|
|
367
|
-
*/
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
function createBrowserHistory(props) {
|
|
371
|
-
if (props === void 0) {
|
|
372
|
-
props = {};
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
!canUseDOM ? process.env.NODE_ENV !== "production" ? invariant(false, 'Browser history needs a DOM') : invariant(false) : void 0;
|
|
376
|
-
var globalHistory = window.history;
|
|
377
|
-
var canUseHistory = supportsHistory();
|
|
378
|
-
var needsHashChangeListener = !supportsPopStateOnHashChange();
|
|
379
|
-
var _props = props,
|
|
380
|
-
_props$forceRefresh = _props.forceRefresh,
|
|
381
|
-
forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,
|
|
382
|
-
_props$getUserConfirm = _props.getUserConfirmation,
|
|
383
|
-
getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,
|
|
384
|
-
_props$keyLength = _props.keyLength,
|
|
385
|
-
keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;
|
|
386
|
-
var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';
|
|
387
|
-
|
|
388
|
-
function getDOMLocation(historyState) {
|
|
389
|
-
var _ref = historyState || {},
|
|
390
|
-
key = _ref.key,
|
|
391
|
-
state = _ref.state;
|
|
392
|
-
|
|
393
|
-
var _window$location = window.location,
|
|
394
|
-
pathname = _window$location.pathname,
|
|
395
|
-
search = _window$location.search,
|
|
396
|
-
hash = _window$location.hash;
|
|
397
|
-
var path = pathname + search + hash;
|
|
398
|
-
process.env.NODE_ENV !== "production" ? warning(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path "' + path + '" to begin with "' + basename + '".') : void 0;
|
|
399
|
-
if (basename) path = stripBasename(path, basename);
|
|
400
|
-
return createLocation(path, state, key);
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
function createKey() {
|
|
404
|
-
return Math.random().toString(36).substr(2, keyLength);
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
var transitionManager = createTransitionManager();
|
|
408
|
-
|
|
409
|
-
function setState(nextState) {
|
|
410
|
-
_extends(history, nextState);
|
|
411
|
-
|
|
412
|
-
history.length = globalHistory.length;
|
|
413
|
-
transitionManager.notifyListeners(history.location, history.action);
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
function handlePopState(event) {
|
|
417
|
-
// Ignore extraneous popstate events in WebKit.
|
|
418
|
-
if (isExtraneousPopstateEvent(event)) return;
|
|
419
|
-
handlePop(getDOMLocation(event.state));
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
function handleHashChange() {
|
|
423
|
-
handlePop(getDOMLocation(getHistoryState()));
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
var forceNextPop = false;
|
|
427
|
-
|
|
428
|
-
function handlePop(location) {
|
|
429
|
-
if (forceNextPop) {
|
|
430
|
-
forceNextPop = false;
|
|
431
|
-
setState();
|
|
432
|
-
} else {
|
|
433
|
-
var action = 'POP';
|
|
434
|
-
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
|
435
|
-
if (ok) {
|
|
436
|
-
setState({
|
|
437
|
-
action: action,
|
|
438
|
-
location: location
|
|
439
|
-
});
|
|
440
|
-
} else {
|
|
441
|
-
revertPop(location);
|
|
442
|
-
}
|
|
443
|
-
});
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
function revertPop(fromLocation) {
|
|
448
|
-
var toLocation = history.location; // TODO: We could probably make this more reliable by
|
|
449
|
-
// keeping a list of keys we've seen in sessionStorage.
|
|
450
|
-
// Instead, we just default to 0 for keys we don't know.
|
|
451
|
-
|
|
452
|
-
var toIndex = allKeys.indexOf(toLocation.key);
|
|
453
|
-
if (toIndex === -1) toIndex = 0;
|
|
454
|
-
var fromIndex = allKeys.indexOf(fromLocation.key);
|
|
455
|
-
if (fromIndex === -1) fromIndex = 0;
|
|
456
|
-
var delta = toIndex - fromIndex;
|
|
457
|
-
|
|
458
|
-
if (delta) {
|
|
459
|
-
forceNextPop = true;
|
|
460
|
-
go(delta);
|
|
461
|
-
}
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
var initialLocation = getDOMLocation(getHistoryState());
|
|
465
|
-
var allKeys = [initialLocation.key]; // Public interface
|
|
466
|
-
|
|
467
|
-
function createHref(location) {
|
|
468
|
-
return basename + createPath(location);
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
function push(path, state) {
|
|
472
|
-
process.env.NODE_ENV !== "production" ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;
|
|
473
|
-
var action = 'PUSH';
|
|
474
|
-
var location = createLocation(path, state, createKey(), history.location);
|
|
475
|
-
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
|
476
|
-
if (!ok) return;
|
|
477
|
-
var href = createHref(location);
|
|
478
|
-
var key = location.key,
|
|
479
|
-
state = location.state;
|
|
480
|
-
|
|
481
|
-
if (canUseHistory) {
|
|
482
|
-
globalHistory.pushState({
|
|
483
|
-
key: key,
|
|
484
|
-
state: state
|
|
485
|
-
}, null, href);
|
|
486
|
-
|
|
487
|
-
if (forceRefresh) {
|
|
488
|
-
window.location.href = href;
|
|
489
|
-
} else {
|
|
490
|
-
var prevIndex = allKeys.indexOf(history.location.key);
|
|
491
|
-
var nextKeys = allKeys.slice(0, prevIndex + 1);
|
|
492
|
-
nextKeys.push(location.key);
|
|
493
|
-
allKeys = nextKeys;
|
|
494
|
-
setState({
|
|
495
|
-
action: action,
|
|
496
|
-
location: location
|
|
497
|
-
});
|
|
498
|
-
}
|
|
499
|
-
} else {
|
|
500
|
-
process.env.NODE_ENV !== "production" ? warning(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : void 0;
|
|
501
|
-
window.location.href = href;
|
|
502
|
-
}
|
|
503
|
-
});
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
function replace(path, state) {
|
|
507
|
-
process.env.NODE_ENV !== "production" ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;
|
|
508
|
-
var action = 'REPLACE';
|
|
509
|
-
var location = createLocation(path, state, createKey(), history.location);
|
|
510
|
-
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
|
511
|
-
if (!ok) return;
|
|
512
|
-
var href = createHref(location);
|
|
513
|
-
var key = location.key,
|
|
514
|
-
state = location.state;
|
|
515
|
-
|
|
516
|
-
if (canUseHistory) {
|
|
517
|
-
globalHistory.replaceState({
|
|
518
|
-
key: key,
|
|
519
|
-
state: state
|
|
520
|
-
}, null, href);
|
|
521
|
-
|
|
522
|
-
if (forceRefresh) {
|
|
523
|
-
window.location.replace(href);
|
|
524
|
-
} else {
|
|
525
|
-
var prevIndex = allKeys.indexOf(history.location.key);
|
|
526
|
-
if (prevIndex !== -1) allKeys[prevIndex] = location.key;
|
|
527
|
-
setState({
|
|
528
|
-
action: action,
|
|
529
|
-
location: location
|
|
530
|
-
});
|
|
531
|
-
}
|
|
532
|
-
} else {
|
|
533
|
-
process.env.NODE_ENV !== "production" ? warning(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : void 0;
|
|
534
|
-
window.location.replace(href);
|
|
535
|
-
}
|
|
536
|
-
});
|
|
537
|
-
}
|
|
538
|
-
|
|
539
|
-
function go(n) {
|
|
540
|
-
globalHistory.go(n);
|
|
541
|
-
}
|
|
542
|
-
|
|
543
|
-
function goBack() {
|
|
544
|
-
go(-1);
|
|
545
|
-
}
|
|
546
|
-
|
|
547
|
-
function goForward() {
|
|
548
|
-
go(1);
|
|
549
|
-
}
|
|
550
|
-
|
|
551
|
-
var listenerCount = 0;
|
|
552
|
-
|
|
553
|
-
function checkDOMListeners(delta) {
|
|
554
|
-
listenerCount += delta;
|
|
555
|
-
|
|
556
|
-
if (listenerCount === 1 && delta === 1) {
|
|
557
|
-
window.addEventListener(PopStateEvent, handlePopState);
|
|
558
|
-
if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);
|
|
559
|
-
} else if (listenerCount === 0) {
|
|
560
|
-
window.removeEventListener(PopStateEvent, handlePopState);
|
|
561
|
-
if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);
|
|
562
|
-
}
|
|
563
|
-
}
|
|
564
|
-
|
|
565
|
-
var isBlocked = false;
|
|
566
|
-
|
|
567
|
-
function block(prompt) {
|
|
568
|
-
if (prompt === void 0) {
|
|
569
|
-
prompt = false;
|
|
570
|
-
}
|
|
571
|
-
|
|
572
|
-
var unblock = transitionManager.setPrompt(prompt);
|
|
573
|
-
|
|
574
|
-
if (!isBlocked) {
|
|
575
|
-
checkDOMListeners(1);
|
|
576
|
-
isBlocked = true;
|
|
577
|
-
}
|
|
578
|
-
|
|
579
|
-
return function () {
|
|
580
|
-
if (isBlocked) {
|
|
581
|
-
isBlocked = false;
|
|
582
|
-
checkDOMListeners(-1);
|
|
583
|
-
}
|
|
584
|
-
|
|
585
|
-
return unblock();
|
|
586
|
-
};
|
|
587
|
-
}
|
|
588
|
-
|
|
589
|
-
function listen(listener) {
|
|
590
|
-
var unlisten = transitionManager.appendListener(listener);
|
|
591
|
-
checkDOMListeners(1);
|
|
592
|
-
return function () {
|
|
593
|
-
checkDOMListeners(-1);
|
|
594
|
-
unlisten();
|
|
595
|
-
};
|
|
596
|
-
}
|
|
597
|
-
|
|
598
|
-
var history = {
|
|
599
|
-
length: globalHistory.length,
|
|
600
|
-
action: 'POP',
|
|
601
|
-
location: initialLocation,
|
|
602
|
-
createHref: createHref,
|
|
603
|
-
push: push,
|
|
604
|
-
replace: replace,
|
|
605
|
-
go: go,
|
|
606
|
-
goBack: goBack,
|
|
607
|
-
goForward: goForward,
|
|
608
|
-
block: block,
|
|
609
|
-
listen: listen
|
|
610
|
-
};
|
|
611
|
-
return history;
|
|
612
|
-
}
|
|
613
|
-
|
|
614
32
|
var setLoading = createAction("common/setLoading");
|
|
615
33
|
var setLoadingPage = createAction("common/setLoadingPage");
|
|
616
34
|
var setAlert = createAction("common/setAlert");
|
|
@@ -710,14 +128,14 @@ function _createForOfIteratorHelperLoose(r, e) {
|
|
|
710
128
|
}
|
|
711
129
|
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
712
130
|
}
|
|
713
|
-
function _extends
|
|
714
|
-
return _extends
|
|
131
|
+
function _extends() {
|
|
132
|
+
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
715
133
|
for (var e = 1; e < arguments.length; e++) {
|
|
716
134
|
var t = arguments[e];
|
|
717
135
|
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
718
136
|
}
|
|
719
137
|
return n;
|
|
720
|
-
}, _extends
|
|
138
|
+
}, _extends.apply(null, arguments);
|
|
721
139
|
}
|
|
722
140
|
function _objectWithoutPropertiesLoose(r, e) {
|
|
723
141
|
if (null == r) return {};
|
|
@@ -863,7 +281,7 @@ var CoreSelect = function CoreSelect(props) {
|
|
|
863
281
|
onChange(name, newValue);
|
|
864
282
|
};
|
|
865
283
|
var controlStyle = function controlStyle(base, state) {
|
|
866
|
-
var styles = _extends
|
|
284
|
+
var styles = _extends({}, base, {
|
|
867
285
|
fontSize: "14px",
|
|
868
286
|
fontWeight: "400",
|
|
869
287
|
padding: "0 4px",
|
|
@@ -892,7 +310,7 @@ var CoreSelect = function CoreSelect(props) {
|
|
|
892
310
|
return styles;
|
|
893
311
|
};
|
|
894
312
|
var inputStyles = function inputStyles(base) {
|
|
895
|
-
var styles = _extends
|
|
313
|
+
var styles = _extends({}, base, {
|
|
896
314
|
margin: "0",
|
|
897
315
|
padding: "0",
|
|
898
316
|
color: "inherit"
|
|
@@ -900,13 +318,13 @@ var CoreSelect = function CoreSelect(props) {
|
|
|
900
318
|
return styles;
|
|
901
319
|
};
|
|
902
320
|
var placeholderStyles = function placeholderStyles(base) {
|
|
903
|
-
var styles = _extends
|
|
321
|
+
var styles = _extends({}, base, {
|
|
904
322
|
color: COLORS.lightGray
|
|
905
323
|
});
|
|
906
324
|
return styles;
|
|
907
325
|
};
|
|
908
326
|
var dropdownIndicatorStyles = function dropdownIndicatorStyles(base) {
|
|
909
|
-
var styles = _extends
|
|
327
|
+
var styles = _extends({}, base, {
|
|
910
328
|
position: "relative",
|
|
911
329
|
top: "-4px",
|
|
912
330
|
padding: "8px 0"
|
|
@@ -914,7 +332,7 @@ var CoreSelect = function CoreSelect(props) {
|
|
|
914
332
|
return styles;
|
|
915
333
|
};
|
|
916
334
|
var valueContainerStyles = function valueContainerStyles(base) {
|
|
917
|
-
var styles = _extends
|
|
335
|
+
var styles = _extends({}, base, {
|
|
918
336
|
height: isMulti ? undefined : "32px",
|
|
919
337
|
position: "relative",
|
|
920
338
|
top: "-3px"
|
|
@@ -922,11 +340,11 @@ var CoreSelect = function CoreSelect(props) {
|
|
|
922
340
|
return styles;
|
|
923
341
|
};
|
|
924
342
|
var singleValueStyles = function singleValueStyles(base) {
|
|
925
|
-
var styles = _extends
|
|
343
|
+
var styles = _extends({}, base);
|
|
926
344
|
return styles;
|
|
927
345
|
};
|
|
928
346
|
var optionStyles = function optionStyles(base, state) {
|
|
929
|
-
var styles = _extends
|
|
347
|
+
var styles = _extends({}, base, {
|
|
930
348
|
padding: "8px",
|
|
931
349
|
borderRadius: "8px",
|
|
932
350
|
cursor: "pointer",
|
|
@@ -940,13 +358,13 @@ var CoreSelect = function CoreSelect(props) {
|
|
|
940
358
|
return styles;
|
|
941
359
|
};
|
|
942
360
|
var indicatorsContainerStyles = function indicatorsContainerStyles(base) {
|
|
943
|
-
var styles = _extends
|
|
361
|
+
var styles = _extends({}, base, {
|
|
944
362
|
display: type === "no-outline" ? "none" : "block"
|
|
945
363
|
});
|
|
946
364
|
return styles;
|
|
947
365
|
};
|
|
948
366
|
var multiValueStyles = function multiValueStyles(base) {
|
|
949
|
-
var styles = _extends
|
|
367
|
+
var styles = _extends({}, base, {
|
|
950
368
|
backgroundColor: COLORS.lightBlue,
|
|
951
369
|
borderRadius: "4px",
|
|
952
370
|
padding: "2px 8px",
|
|
@@ -958,14 +376,14 @@ var CoreSelect = function CoreSelect(props) {
|
|
|
958
376
|
return styles;
|
|
959
377
|
};
|
|
960
378
|
var multiValueRemoveStyles = function multiValueRemoveStyles(base) {
|
|
961
|
-
var styles = _extends
|
|
379
|
+
var styles = _extends({}, base, {
|
|
962
380
|
color: COLORS.lightGray,
|
|
963
381
|
cursor: "pointer"
|
|
964
382
|
});
|
|
965
383
|
return styles;
|
|
966
384
|
};
|
|
967
385
|
var multiValueLabelStyles = function multiValueLabelStyles(base) {
|
|
968
|
-
var styles = _extends
|
|
386
|
+
var styles = _extends({}, base, {
|
|
969
387
|
color: COLORS.blackText,
|
|
970
388
|
fontWeight: "400",
|
|
971
389
|
fontSize: "13px",
|
|
@@ -1404,7 +822,7 @@ var CoreSelectCompact = function CoreSelectCompact(props) {
|
|
|
1404
822
|
onChange(name, newValue);
|
|
1405
823
|
};
|
|
1406
824
|
var controlStyle = function controlStyle(base, state) {
|
|
1407
|
-
var styles = _extends
|
|
825
|
+
var styles = _extends({}, base, {
|
|
1408
826
|
fontSize: "14px",
|
|
1409
827
|
fontWeight: "400",
|
|
1410
828
|
backgroundColor: state.isDisabled ? "transparent" : error ? COLORS.lightYellow : COLORS.white,
|
|
@@ -1425,7 +843,7 @@ var CoreSelectCompact = function CoreSelectCompact(props) {
|
|
|
1425
843
|
return styles;
|
|
1426
844
|
};
|
|
1427
845
|
var inputStyles = function inputStyles(base) {
|
|
1428
|
-
var styles = _extends
|
|
846
|
+
var styles = _extends({}, base, {
|
|
1429
847
|
margin: "0",
|
|
1430
848
|
padding: "0",
|
|
1431
849
|
color: "inherit",
|
|
@@ -1435,37 +853,37 @@ var CoreSelectCompact = function CoreSelectCompact(props) {
|
|
|
1435
853
|
return styles;
|
|
1436
854
|
};
|
|
1437
855
|
var placeholderStyles = function placeholderStyles(base) {
|
|
1438
|
-
var styles = _extends
|
|
856
|
+
var styles = _extends({}, base, {
|
|
1439
857
|
color: COLORS.lightGray
|
|
1440
858
|
});
|
|
1441
859
|
return styles;
|
|
1442
860
|
};
|
|
1443
861
|
var dropdownIndicatorStyles = function dropdownIndicatorStyles(base) {
|
|
1444
|
-
var styles = _extends
|
|
862
|
+
var styles = _extends({}, base, {
|
|
1445
863
|
position: "relative",
|
|
1446
864
|
padding: "2px 0"
|
|
1447
865
|
});
|
|
1448
866
|
return styles;
|
|
1449
867
|
};
|
|
1450
868
|
var indicatorsContainerStyles = function indicatorsContainerStyles(base) {
|
|
1451
|
-
var styles = _extends
|
|
869
|
+
var styles = _extends({}, base, {
|
|
1452
870
|
display: isShowDropdown && !isMulti ? "block" : "none"
|
|
1453
871
|
});
|
|
1454
872
|
return styles;
|
|
1455
873
|
};
|
|
1456
874
|
var valueContainerStyles = function valueContainerStyles(base) {
|
|
1457
|
-
var styles = _extends
|
|
875
|
+
var styles = _extends({}, base, {
|
|
1458
876
|
height: isMulti ? undefined : "26px",
|
|
1459
877
|
position: "relative"
|
|
1460
878
|
});
|
|
1461
879
|
return styles;
|
|
1462
880
|
};
|
|
1463
881
|
var singleValueStyles = function singleValueStyles(base) {
|
|
1464
|
-
var styles = _extends
|
|
882
|
+
var styles = _extends({}, base);
|
|
1465
883
|
return styles;
|
|
1466
884
|
};
|
|
1467
885
|
var optionStyles = function optionStyles(base, state) {
|
|
1468
|
-
var styles = _extends
|
|
886
|
+
var styles = _extends({}, base, {
|
|
1469
887
|
padding: "8px",
|
|
1470
888
|
borderRadius: "8px",
|
|
1471
889
|
cursor: "pointer",
|
|
@@ -1480,7 +898,7 @@ var CoreSelectCompact = function CoreSelectCompact(props) {
|
|
|
1480
898
|
return styles;
|
|
1481
899
|
};
|
|
1482
900
|
var multiValueStyles = function multiValueStyles(base) {
|
|
1483
|
-
var styles = _extends
|
|
901
|
+
var styles = _extends({}, base, {
|
|
1484
902
|
backgroundColor: COLORS.lightBlue,
|
|
1485
903
|
borderRadius: "4px",
|
|
1486
904
|
padding: "0 4px",
|
|
@@ -1492,14 +910,14 @@ var CoreSelectCompact = function CoreSelectCompact(props) {
|
|
|
1492
910
|
return styles;
|
|
1493
911
|
};
|
|
1494
912
|
var multiValueRemoveStyles = function multiValueRemoveStyles(base) {
|
|
1495
|
-
var styles = _extends
|
|
913
|
+
var styles = _extends({}, base, {
|
|
1496
914
|
color: COLORS.lightGray,
|
|
1497
915
|
cursor: "pointer"
|
|
1498
916
|
});
|
|
1499
917
|
return styles;
|
|
1500
918
|
};
|
|
1501
919
|
var multiValueLabelStyles = function multiValueLabelStyles(base) {
|
|
1502
|
-
var styles = _extends
|
|
920
|
+
var styles = _extends({}, base, {
|
|
1503
921
|
color: COLORS.blackText,
|
|
1504
922
|
fontWeight: "400",
|
|
1505
923
|
fontSize: "13px",
|
|
@@ -2073,33 +1491,40 @@ var LatexExtractor = /*#__PURE__*/function () {
|
|
|
2073
1491
|
LatexExtractor.LATEX_COMMANDS = ['\\frac', '\\sqrt', '\\sum', '\\prod', '\\int', '\\oint', '\\lim', '\\sin', '\\cos', '\\tan', '\\log', '\\ln', '\\exp', '\\alpha', '\\beta', '\\gamma', '\\delta', '\\epsilon', '\\varepsilon', '\\zeta', '\\eta', '\\theta', '\\vartheta', '\\iota', '\\kappa', '\\lambda', '\\mu', '\\nu', '\\xi', '\\pi', '\\varpi', '\\rho', '\\varrho', '\\sigma', '\\varsigma', '\\tau', "\\upsilon", '\\phi', '\\varphi', '\\chi', '\\psi', '\\omega', '\\Gamma', '\\Delta', '\\Theta', '\\Lambda', '\\Xi', '\\Pi', '\\Sigma', "\\Upsilon", '\\Phi', '\\Psi', '\\Omega', '\\to', '\\gets', '\\mapsto', '\\implies', '\\iff', '\\leftrightarrow', '\\longleftarrow', '\\longrightarrow', '\\longleftrightarrow', '\\Leftarrow', '\\Rightarrow', '\\Leftrightarrow', '\\le', '\\ge', '\\leq', '\\geq', '\\lt', '\\gt', '\\neq', '\\approx', '\\equiv', '\\sim', '\\cong', '\\leqslant', '\\geqslant', '\\parallel', '\\perp', '\\in', '\\notin', '\\subset', '\\subseteq', '\\cup', '\\cap', '\\emptyset', '\\forall', '\\exists', '\\nexists', '\\wedge', '\\vee', '\\neg', '\\partial', '\\nabla', '\\infty', '\\pm', '\\mp', '\\vec', '\\overrightarrow', "\\underrightarrow", '\\overline', "\\underline", '\\widehat', '\\widetilde', '\\overbrace', "\\underbrace", '\\mathbb', '\\mathrm', '\\mathcal', '\\mathfrak', '\\mathscr', '\\text', '\\textbf', '\\textit', '\\left', '\\right', '\\lfloor', '\\rfloor', '\\lceil', '\\rceil', '\\langle', '\\rangle', '\\cdot', '\\times', '\\div', '\\parallel', '\\angle', '\\bot', '\\newline', '\\ldots', '\\cdots', '\\vdots', '\\ddots'];
|
|
2074
1492
|
LatexExtractor.LATEX_PATTERNS = [/[a-zA-Z0-9]_\{[^}]*\}/g, /[a-zA-Z0-9]\^\{[^}]*\}/g, /\\[a-zA-Z]+\s*\{[^}]*\}(?:\s*\{[^}]*\})*/g, /\\[a-zA-Z]+(?![a-zA-Z])/g, /\\frac\s*\{[^}]*\}\s*\{[^}]*\}/g, /\\sqrt(?:\[[^\]]*\])?\s*\{[^}]*\}/g, /\\vec\s*\{[^}]*\}/g, /\\(?:alpha|beta|gamma|delta|epsilon|varepsilon|zeta|eta|theta|vartheta|iota|kappa|lambda|mu|nu|xi|pi|varpi|rho|varrho|sigma|varsigma|tau|upsilon|phi|varphi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)(?![a-zA-Z])/g, /[a-zA-Z0-9_{}\\]+\s*=\s*[a-zA-Z0-9_{}\\+\-*/^().\s]+/g, /\\Delta\s*[a-zA-Z]/g, /[a-zA-Z]+_\{[a-zA-Z0-9]+\}/g, /[a-zA-Z0-9_{}\\]+\s*[+\-*/]\s*[a-zA-Z0-9_{}\\().\s]+/g, /,\s*([a-zA-Z0-9_{}\\]+(?:\s*[=+\-*/^]\s*[a-zA-Z0-9_{}\\().\s]*)*)/g, /([a-zA-Z0-9_{}\\]+(?:\s*[=+\-*/^]\s*[a-zA-Z0-9_{}\\().\s]*)*)\s*,/g, /\bto\s+([a-zA-Z0-9_{}\\]+(?:\s*[=+\-*/^~≈]\s*[a-zA-Z0-9_{}\\().\s]*)*)/g, /([a-zA-Z0-9_{}\\]+(?:\s*[=+\-*/^~≈]\s*[a-zA-Z0-9_{}\\().\s]*)*)\s+to\b/g];
|
|
2075
1493
|
|
|
1494
|
+
var _excluded$3 = ["node"];
|
|
2076
1495
|
var MarkdownRenderer = function MarkdownRenderer(_ref) {
|
|
2077
1496
|
var content = _ref.content;
|
|
2078
1497
|
var formattedContent = formatContent(content);
|
|
2079
1498
|
return React.createElement("span", null, React.createElement(ReactMarkdown, {
|
|
2080
|
-
remarkPlugins: [remarkMath],
|
|
2081
|
-
rehypePlugins: [rehypeKatex, rehypeRaw]
|
|
1499
|
+
remarkPlugins: [remarkMath, remarkGfm, remarkRehype],
|
|
1500
|
+
rehypePlugins: [rehypeKatex, rehypeRaw],
|
|
1501
|
+
components: {
|
|
1502
|
+
p: function p(_ref2) {
|
|
1503
|
+
var props = _objectWithoutPropertiesLoose(_ref2, _excluded$3);
|
|
1504
|
+
return React.createElement("span", Object.assign({}, props));
|
|
1505
|
+
}
|
|
1506
|
+
}
|
|
2082
1507
|
}, formattedContent));
|
|
2083
1508
|
};
|
|
2084
1509
|
function formatContent(content) {
|
|
2085
1510
|
if (!content || content.trim() === "") {
|
|
2086
1511
|
return content;
|
|
2087
1512
|
}
|
|
2088
|
-
var processedContent = content.replace(/\s*\\\\\s*/g,
|
|
1513
|
+
var processedContent = content.replace(/\s*\\\\\s*/g, "\n");
|
|
2089
1514
|
var lines = processedContent.split("\n");
|
|
2090
1515
|
var result = [];
|
|
2091
1516
|
var i = 0;
|
|
2092
1517
|
while (i < lines.length) {
|
|
2093
1518
|
var line = lines[i].trim();
|
|
2094
|
-
if (line ===
|
|
2095
|
-
result.push(
|
|
1519
|
+
if (line === "") {
|
|
1520
|
+
result.push("");
|
|
2096
1521
|
i++;
|
|
2097
1522
|
continue;
|
|
2098
1523
|
}
|
|
2099
1524
|
var isEquationLabel = /\\textit\{.*(?:Relevant|Derived).*equation.*\}/i.test(line) || /^(?:Relevant|Derived)\s+equation:\s*$/i.test(line);
|
|
2100
1525
|
if (isEquationLabel) {
|
|
2101
1526
|
var processedLabel = line;
|
|
2102
|
-
if (line.includes(
|
|
1527
|
+
if (line.includes("\\textit{") && !line.startsWith("$")) {
|
|
2103
1528
|
processedLabel = "$" + line + "$";
|
|
2104
1529
|
}
|
|
2105
1530
|
result.push(processedLabel);
|
|
@@ -3013,7 +2438,7 @@ function kindOf(val) {
|
|
|
3013
2438
|
}
|
|
3014
2439
|
|
|
3015
2440
|
// src/utils/warning.ts
|
|
3016
|
-
function warning
|
|
2441
|
+
function warning(message) {
|
|
3017
2442
|
if (typeof console !== "undefined" && typeof console.error === "function") {
|
|
3018
2443
|
console.error(message);
|
|
3019
2444
|
}
|
|
@@ -3066,7 +2491,7 @@ function combineReducers(reducers) {
|
|
|
3066
2491
|
const key = reducerKeys[i];
|
|
3067
2492
|
if (process.env.NODE_ENV !== "production") {
|
|
3068
2493
|
if (typeof reducers[key] === "undefined") {
|
|
3069
|
-
warning
|
|
2494
|
+
warning(`No reducer provided for key "${key}"`);
|
|
3070
2495
|
}
|
|
3071
2496
|
}
|
|
3072
2497
|
if (typeof reducers[key] === "function") {
|
|
@@ -3091,7 +2516,7 @@ function combineReducers(reducers) {
|
|
|
3091
2516
|
if (process.env.NODE_ENV !== "production") {
|
|
3092
2517
|
const warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);
|
|
3093
2518
|
if (warningMessage) {
|
|
3094
|
-
warning
|
|
2519
|
+
warning(warningMessage);
|
|
3095
2520
|
}
|
|
3096
2521
|
}
|
|
3097
2522
|
let hasChanged = false;
|
|
@@ -3472,7 +2897,7 @@ var useAmplitude = function useAmplitude() {
|
|
|
3472
2897
|
var savedUserProperties = useRef({});
|
|
3473
2898
|
var hasTrackedInitialSession = useRef(false);
|
|
3474
2899
|
var setUserProperties = useCallback(function (properties) {
|
|
3475
|
-
savedUserProperties.current = _extends
|
|
2900
|
+
savedUserProperties.current = _extends({}, savedUserProperties.current, properties);
|
|
3476
2901
|
var identify$1 = new Identify();
|
|
3477
2902
|
Object.entries(properties).forEach(function (_ref) {
|
|
3478
2903
|
var key = _ref[0],
|
|
@@ -3484,7 +2909,7 @@ var useAmplitude = function useAmplitude() {
|
|
|
3484
2909
|
var trackEvent = useCallback(function (_ref2) {
|
|
3485
2910
|
var eventName = _ref2.eventName,
|
|
3486
2911
|
eventProperties = _ref2.eventProperties;
|
|
3487
|
-
track(eventName, _extends
|
|
2912
|
+
track(eventName, _extends({}, savedUserProperties.current, eventProperties, {
|
|
3488
2913
|
timestamp: new Date().toISOString()
|
|
3489
2914
|
}));
|
|
3490
2915
|
}, []);
|
|
@@ -3671,7 +3096,7 @@ var getErrorMessage = function getErrorMessage(error, defaultErrorMessage) {
|
|
|
3671
3096
|
|
|
3672
3097
|
var customStyles = {
|
|
3673
3098
|
control: function control(baseStyles, state) {
|
|
3674
|
-
return _extends
|
|
3099
|
+
return _extends({}, baseStyles, {
|
|
3675
3100
|
fontSize: "14px",
|
|
3676
3101
|
fontWeight: 700,
|
|
3677
3102
|
color: styleGlobal.darker,
|
|
@@ -3686,21 +3111,21 @@ var customStyles = {
|
|
|
3686
3111
|
});
|
|
3687
3112
|
},
|
|
3688
3113
|
input: function input(baseStyles, _) {
|
|
3689
|
-
return _extends
|
|
3114
|
+
return _extends({}, baseStyles, {
|
|
3690
3115
|
fontSize: "14px",
|
|
3691
3116
|
fontWeight: 700,
|
|
3692
3117
|
color: styleGlobal.darker
|
|
3693
3118
|
});
|
|
3694
3119
|
},
|
|
3695
3120
|
singleValue: function singleValue(baseStyles) {
|
|
3696
|
-
return _extends
|
|
3121
|
+
return _extends({}, baseStyles, {
|
|
3697
3122
|
fontSize: "14px",
|
|
3698
3123
|
fontWeight: 700,
|
|
3699
3124
|
color: styleGlobal.darker
|
|
3700
3125
|
});
|
|
3701
3126
|
},
|
|
3702
3127
|
option: function option(baseStyles, state) {
|
|
3703
|
-
return _extends
|
|
3128
|
+
return _extends({}, baseStyles, {
|
|
3704
3129
|
backgroundColor: state.isSelected ? styleGlobal.dark : state.isFocused ? styleGlobal.light : 'white',
|
|
3705
3130
|
"&:active": {
|
|
3706
3131
|
backgroundColor: state.isSelected ? styleGlobal.dark : state.isFocused ? styleGlobal.less_dark : baseStyles.backgroundColor
|
|
@@ -3724,7 +3149,7 @@ var CustomOption = function CustomOption(props) {
|
|
|
3724
3149
|
}, props.data.label));
|
|
3725
3150
|
};
|
|
3726
3151
|
|
|
3727
|
-
var _excluded$
|
|
3152
|
+
var _excluded$4 = ["isDefault", "defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
|
|
3728
3153
|
var CustomSelect = function CustomSelect(_ref) {
|
|
3729
3154
|
var isDefault = _ref.isDefault,
|
|
3730
3155
|
options = _ref.options,
|
|
@@ -3732,7 +3157,7 @@ var CustomSelect = function CustomSelect(_ref) {
|
|
|
3732
3157
|
scrollBottom = _ref.scrollBottom,
|
|
3733
3158
|
value = _ref.value,
|
|
3734
3159
|
isMulti = _ref.isMulti,
|
|
3735
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
3160
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$4);
|
|
3736
3161
|
var initialValues = Array.isArray(value) ? options.filter(function (i) {
|
|
3737
3162
|
return value.includes(i.value);
|
|
3738
3163
|
}) : isMulti ? options === null || options === void 0 ? void 0 : options.filter(function (i) {
|
|
@@ -3759,7 +3184,7 @@ var CustomSelect = function CustomSelect(_ref) {
|
|
|
3759
3184
|
}, rest));
|
|
3760
3185
|
};
|
|
3761
3186
|
|
|
3762
|
-
var _excluded$
|
|
3187
|
+
var _excluded$5 = ["isDefault", "defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
|
|
3763
3188
|
var CustomAsyncSelect = function CustomAsyncSelect(_ref) {
|
|
3764
3189
|
var isDefault = _ref.isDefault,
|
|
3765
3190
|
options = _ref.options,
|
|
@@ -3767,7 +3192,7 @@ var CustomAsyncSelect = function CustomAsyncSelect(_ref) {
|
|
|
3767
3192
|
scrollBottom = _ref.scrollBottom,
|
|
3768
3193
|
value = _ref.value,
|
|
3769
3194
|
isMulti = _ref.isMulti,
|
|
3770
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
3195
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$5);
|
|
3771
3196
|
var initialValues = Array.isArray(value) ? options.filter(function (i) {
|
|
3772
3197
|
return value.includes(i.value);
|
|
3773
3198
|
}) : isMulti ? options.filter(function (i) {
|
|
@@ -3794,14 +3219,14 @@ var CustomAsyncSelect = function CustomAsyncSelect(_ref) {
|
|
|
3794
3219
|
}, rest));
|
|
3795
3220
|
};
|
|
3796
3221
|
|
|
3797
|
-
var _excluded$
|
|
3222
|
+
var _excluded$6 = ["defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
|
|
3798
3223
|
var CustomCreatable = function CustomCreatable(_ref) {
|
|
3799
3224
|
var options = _ref.options,
|
|
3800
3225
|
isDisabled = _ref.isDisabled,
|
|
3801
3226
|
scrollBottom = _ref.scrollBottom,
|
|
3802
3227
|
value = _ref.value,
|
|
3803
3228
|
isMulti = _ref.isMulti,
|
|
3804
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
3229
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$6);
|
|
3805
3230
|
var initialValues = Array.isArray(value) ? options.filter(function (i) {
|
|
3806
3231
|
return value.includes(i.value);
|
|
3807
3232
|
}) : isMulti ? options.filter(function (i) {
|
|
@@ -3828,7 +3253,7 @@ var CustomCreatable = function CustomCreatable(_ref) {
|
|
|
3828
3253
|
}, rest));
|
|
3829
3254
|
};
|
|
3830
3255
|
|
|
3831
|
-
var _excluded$
|
|
3256
|
+
var _excluded$7 = ["defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
|
|
3832
3257
|
var CustomSelectOption = function CustomSelectOption(_ref) {
|
|
3833
3258
|
var defaultValue = _ref.defaultValue,
|
|
3834
3259
|
options = _ref.options,
|
|
@@ -3836,7 +3261,7 @@ var CustomSelectOption = function CustomSelectOption(_ref) {
|
|
|
3836
3261
|
scrollBottom = _ref.scrollBottom,
|
|
3837
3262
|
value = _ref.value,
|
|
3838
3263
|
isMulti = _ref.isMulti,
|
|
3839
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
3264
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$7);
|
|
3840
3265
|
var initialValues = defaultValue !== null && typeof defaultValue !== "undefined" ? options.find(function (option) {
|
|
3841
3266
|
return option.value === defaultValue;
|
|
3842
3267
|
}) || null : null;
|
|
@@ -3868,7 +3293,51 @@ var utcToLocalTime = (function (time, FORMAT) {
|
|
|
3868
3293
|
}
|
|
3869
3294
|
});
|
|
3870
3295
|
|
|
3296
|
+
var sanitizeSrc = function sanitizeSrc(url) {
|
|
3297
|
+
if (!url || typeof url !== 'string') {
|
|
3298
|
+
return null;
|
|
3299
|
+
}
|
|
3300
|
+
url = url.trim().replace(/[\s\n\r\t]+/g, '');
|
|
3301
|
+
if (url.length > 2048) {
|
|
3302
|
+
return null;
|
|
3303
|
+
}
|
|
3304
|
+
var dangerousProtocols = ['javascript:', 'data:text/html', 'vbscript:', 'file:', 'about:', 'blob:'];
|
|
3305
|
+
var lowerUrl = url.toLowerCase();
|
|
3306
|
+
for (var _i = 0, _dangerousProtocols = dangerousProtocols; _i < _dangerousProtocols.length; _i++) {
|
|
3307
|
+
var protocol = _dangerousProtocols[_i];
|
|
3308
|
+
if (lowerUrl.startsWith(protocol)) {
|
|
3309
|
+
return null;
|
|
3310
|
+
}
|
|
3311
|
+
}
|
|
3312
|
+
var decoded = decodeURIComponent(url);
|
|
3313
|
+
var decodedLower = decoded.toLowerCase();
|
|
3314
|
+
for (var _i2 = 0, _dangerousProtocols2 = dangerousProtocols; _i2 < _dangerousProtocols2.length; _i2++) {
|
|
3315
|
+
var _protocol = _dangerousProtocols2[_i2];
|
|
3316
|
+
if (decodedLower.includes(_protocol)) {
|
|
3317
|
+
return null;
|
|
3318
|
+
}
|
|
3319
|
+
}
|
|
3320
|
+
try {
|
|
3321
|
+
if (url.startsWith('data:')) {
|
|
3322
|
+
if (/^data:image\/(png|jpeg|jpg|gif|webp|bmp|ico);base64,[A-Za-z0-9+/]+=*$/.test(url)) {
|
|
3323
|
+
return url;
|
|
3324
|
+
}
|
|
3325
|
+
return null;
|
|
3326
|
+
}
|
|
3327
|
+
var parsed = new URL(url, window.location.origin);
|
|
3328
|
+
if (parsed.protocol !== 'http:' && parsed.protocol !== 'https:') {
|
|
3329
|
+
return null;
|
|
3330
|
+
}
|
|
3331
|
+
if (parsed.username || parsed.password) {
|
|
3332
|
+
return null;
|
|
3333
|
+
}
|
|
3334
|
+
return parsed.href;
|
|
3335
|
+
} catch (error) {
|
|
3336
|
+
return null;
|
|
3337
|
+
}
|
|
3338
|
+
};
|
|
3339
|
+
|
|
3871
3340
|
var historyCore = createBrowserHistory();
|
|
3872
3341
|
|
|
3873
|
-
export { ACCESS_TOKEN, AmplitudeEvent, BASE_URL, CommonDialog, ConfirmDialog, CoreButton, CoreInput$1 as CoreCheckbox, CoreError, CoreInput, CoreInputCompact, CoreModal, CoreRadio, CoreRange, CoreSearch, CoreSelect, CoreSelectCompact, CoreTextArea, CoreTitleInput, CoreTooltip, CustomAsyncSelect, CustomCreatable, CustomPagination, CustomSelect, CustomSelectOption, DATE_TIME_MIN_VALUE, LayoutContext, Loading, Login, MarkdownRenderer as MarkdownLatexRender, NotFound, OPENSALT_BASE_URL, ORGANIZATION_TEAM, ORGANIZATION_TENANT, Role, api, apiUpload, firstCheckToken, getAccessToken, getErrorMessage, getImageUrl, historyCore, initSentry, initializeAmplitude, setAddTenant, setAlert, setIsRefetchSidebar, setLoading, setLoadingPage, setMenuCollapse, setTeam, setTenant, setUser, store, useAmplitude, useGoogleSignOut, utcToLocalTime };
|
|
3342
|
+
export { ACCESS_TOKEN, AmplitudeEvent, BASE_URL, CommonDialog, ConfirmDialog, CoreButton, CoreInput$1 as CoreCheckbox, CoreError, CoreInput, CoreInputCompact, CoreModal, CoreRadio, CoreRange, CoreSearch, CoreSelect, CoreSelectCompact, CoreTextArea, CoreTitleInput, CoreTooltip, CustomAsyncSelect, CustomCreatable, CustomPagination, CustomSelect, CustomSelectOption, DATE_TIME_MIN_VALUE, LayoutContext, Loading, Login, MarkdownRenderer as MarkdownLatexRender, NotFound, OPENSALT_BASE_URL, ORGANIZATION_TEAM, ORGANIZATION_TENANT, Role, api, apiUpload, firstCheckToken, getAccessToken, getErrorMessage, getImageUrl, historyCore, initSentry, initializeAmplitude, sanitizeSrc, setAddTenant, setAlert, setIsRefetchSidebar, setLoading, setLoadingPage, setMenuCollapse, setTeam, setTenant, setUser, store, useAmplitude, useGoogleSignOut, utcToLocalTime };
|
|
3874
3343
|
//# sourceMappingURL=index.modern.js.map
|