@pie-element/matrix 2.0.1-next.0 → 2.0.2-esm.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/configure/package.json +4 -4
- package/controller/package.json +1 -1
- package/esm/configure.css +847 -0
- package/esm/configure.js +2178 -0
- package/esm/configure.js.map +1 -0
- package/esm/controller.css +847 -0
- package/esm/controller.js +112 -0
- package/esm/controller.js.map +1 -0
- package/esm/element.css +847 -0
- package/esm/element.js +1275 -0
- package/esm/element.js.map +1 -0
- package/package.json +22 -5
package/esm/configure.js
ADDED
|
@@ -0,0 +1,2178 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import React__default, { useRef, useDebugValue, useContext, createElement, useState } from 'react';
|
|
3
|
+
import ReactDOM from 'react-dom';
|
|
4
|
+
import debug from 'debug';
|
|
5
|
+
import { ModelUpdatedEvent, InsertSoundEvent, DeleteSoundEvent } from '@pie-framework/pie-configure-events';
|
|
6
|
+
import PropTypes from 'prop-types';
|
|
7
|
+
import EditableHtml from '@pie-lib/editable-html';
|
|
8
|
+
import { layout, InputContainer, settings } from '@pie-lib/config-ui';
|
|
9
|
+
import { withStyles } from '@material-ui/core/styles';
|
|
10
|
+
import AddIcon from '@material-ui/icons/Add';
|
|
11
|
+
import RemoveIcon from '@material-ui/icons/Remove';
|
|
12
|
+
import Radio from '@material-ui/core/Radio';
|
|
13
|
+
import RadioGroup from '@material-ui/core/RadioGroup';
|
|
14
|
+
import FormControlLabel from '@material-ui/core/FormControlLabel';
|
|
15
|
+
import { color } from '@pie-lib/render-ui';
|
|
16
|
+
import KeyboardArrowDownIcon from '@material-ui/icons/KeyboardArrowDown';
|
|
17
|
+
import Menu from '@material-ui/core/Menu';
|
|
18
|
+
import MenuItem from '@material-ui/core/MenuItem';
|
|
19
|
+
import { TextField } from '@material-ui/core';
|
|
20
|
+
import defaults from 'lodash/defaults';
|
|
21
|
+
|
|
22
|
+
function _extends() {
|
|
23
|
+
_extends = Object.assign || function (target) {
|
|
24
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
25
|
+
var source = arguments[i];
|
|
26
|
+
|
|
27
|
+
for (var key in source) {
|
|
28
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
29
|
+
target[key] = source[key];
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return target;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
return _extends.apply(this, arguments);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
var reactIs$1 = {exports: {}};
|
|
41
|
+
|
|
42
|
+
var reactIs_production_min = {};
|
|
43
|
+
|
|
44
|
+
/** @license React v16.13.1
|
|
45
|
+
* react-is.production.min.js
|
|
46
|
+
*
|
|
47
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
48
|
+
*
|
|
49
|
+
* This source code is licensed under the MIT license found in the
|
|
50
|
+
* LICENSE file in the root directory of this source tree.
|
|
51
|
+
*/
|
|
52
|
+
var b$1="function"===typeof Symbol&&Symbol.for,c=b$1?Symbol.for("react.element"):60103,d=b$1?Symbol.for("react.portal"):60106,e=b$1?Symbol.for("react.fragment"):60107,f=b$1?Symbol.for("react.strict_mode"):60108,g$1=b$1?Symbol.for("react.profiler"):60114,h=b$1?Symbol.for("react.provider"):60109,k$1=b$1?Symbol.for("react.context"):60110,l=b$1?Symbol.for("react.async_mode"):60111,m=b$1?Symbol.for("react.concurrent_mode"):60111,n=b$1?Symbol.for("react.forward_ref"):60112,p=b$1?Symbol.for("react.suspense"):60113,q$1=b$1?
|
|
53
|
+
Symbol.for("react.suspense_list"):60120,r=b$1?Symbol.for("react.memo"):60115,t=b$1?Symbol.for("react.lazy"):60116,v$1=b$1?Symbol.for("react.block"):60121,w$1=b$1?Symbol.for("react.fundamental"):60117,x$1=b$1?Symbol.for("react.responder"):60118,y=b$1?Symbol.for("react.scope"):60119;
|
|
54
|
+
function z$1(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g$1:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k$1:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A$1(a){return z$1(a)===m}reactIs_production_min.AsyncMode=l;reactIs_production_min.ConcurrentMode=m;reactIs_production_min.ContextConsumer=k$1;reactIs_production_min.ContextProvider=h;reactIs_production_min.Element=c;reactIs_production_min.ForwardRef=n;reactIs_production_min.Fragment=e;reactIs_production_min.Lazy=t;reactIs_production_min.Memo=r;reactIs_production_min.Portal=d;
|
|
55
|
+
reactIs_production_min.Profiler=g$1;reactIs_production_min.StrictMode=f;reactIs_production_min.Suspense=p;reactIs_production_min.isAsyncMode=function(a){return A$1(a)||z$1(a)===l};reactIs_production_min.isConcurrentMode=A$1;reactIs_production_min.isContextConsumer=function(a){return z$1(a)===k$1};reactIs_production_min.isContextProvider=function(a){return z$1(a)===h};reactIs_production_min.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};reactIs_production_min.isForwardRef=function(a){return z$1(a)===n};reactIs_production_min.isFragment=function(a){return z$1(a)===e};reactIs_production_min.isLazy=function(a){return z$1(a)===t};
|
|
56
|
+
reactIs_production_min.isMemo=function(a){return z$1(a)===r};reactIs_production_min.isPortal=function(a){return z$1(a)===d};reactIs_production_min.isProfiler=function(a){return z$1(a)===g$1};reactIs_production_min.isStrictMode=function(a){return z$1(a)===f};reactIs_production_min.isSuspense=function(a){return z$1(a)===p};
|
|
57
|
+
reactIs_production_min.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g$1||a===f||a===p||a===q$1||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k$1||a.$$typeof===n||a.$$typeof===w$1||a.$$typeof===x$1||a.$$typeof===y||a.$$typeof===v$1)};reactIs_production_min.typeOf=z$1;
|
|
58
|
+
|
|
59
|
+
var reactIs_development = {};
|
|
60
|
+
|
|
61
|
+
/** @license React v16.13.1
|
|
62
|
+
* react-is.development.js
|
|
63
|
+
*
|
|
64
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
65
|
+
*
|
|
66
|
+
* This source code is licensed under the MIT license found in the
|
|
67
|
+
* LICENSE file in the root directory of this source tree.
|
|
68
|
+
*/
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
if (process.env.NODE_ENV !== "production") {
|
|
73
|
+
(function() {
|
|
74
|
+
|
|
75
|
+
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
76
|
+
// nor polyfill, then a plain number is used for performance.
|
|
77
|
+
var hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
|
78
|
+
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
|
|
79
|
+
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
|
|
80
|
+
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
|
|
81
|
+
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
|
|
82
|
+
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
|
|
83
|
+
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
|
84
|
+
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
|
|
85
|
+
// (unstable) APIs that have been removed. Can we remove the symbols?
|
|
86
|
+
|
|
87
|
+
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
|
|
88
|
+
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
|
|
89
|
+
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
|
90
|
+
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
|
|
91
|
+
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
|
|
92
|
+
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
|
93
|
+
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
|
94
|
+
var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
|
|
95
|
+
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
|
|
96
|
+
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
|
|
97
|
+
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
|
|
98
|
+
|
|
99
|
+
function isValidElementType(type) {
|
|
100
|
+
return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
101
|
+
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function typeOf(object) {
|
|
105
|
+
if (typeof object === 'object' && object !== null) {
|
|
106
|
+
var $$typeof = object.$$typeof;
|
|
107
|
+
|
|
108
|
+
switch ($$typeof) {
|
|
109
|
+
case REACT_ELEMENT_TYPE:
|
|
110
|
+
var type = object.type;
|
|
111
|
+
|
|
112
|
+
switch (type) {
|
|
113
|
+
case REACT_ASYNC_MODE_TYPE:
|
|
114
|
+
case REACT_CONCURRENT_MODE_TYPE:
|
|
115
|
+
case REACT_FRAGMENT_TYPE:
|
|
116
|
+
case REACT_PROFILER_TYPE:
|
|
117
|
+
case REACT_STRICT_MODE_TYPE:
|
|
118
|
+
case REACT_SUSPENSE_TYPE:
|
|
119
|
+
return type;
|
|
120
|
+
|
|
121
|
+
default:
|
|
122
|
+
var $$typeofType = type && type.$$typeof;
|
|
123
|
+
|
|
124
|
+
switch ($$typeofType) {
|
|
125
|
+
case REACT_CONTEXT_TYPE:
|
|
126
|
+
case REACT_FORWARD_REF_TYPE:
|
|
127
|
+
case REACT_LAZY_TYPE:
|
|
128
|
+
case REACT_MEMO_TYPE:
|
|
129
|
+
case REACT_PROVIDER_TYPE:
|
|
130
|
+
return $$typeofType;
|
|
131
|
+
|
|
132
|
+
default:
|
|
133
|
+
return $$typeof;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
case REACT_PORTAL_TYPE:
|
|
139
|
+
return $$typeof;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
return undefined;
|
|
144
|
+
} // AsyncMode is deprecated along with isAsyncMode
|
|
145
|
+
|
|
146
|
+
var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
|
147
|
+
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
|
148
|
+
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
149
|
+
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
150
|
+
var Element = REACT_ELEMENT_TYPE;
|
|
151
|
+
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
152
|
+
var Fragment = REACT_FRAGMENT_TYPE;
|
|
153
|
+
var Lazy = REACT_LAZY_TYPE;
|
|
154
|
+
var Memo = REACT_MEMO_TYPE;
|
|
155
|
+
var Portal = REACT_PORTAL_TYPE;
|
|
156
|
+
var Profiler = REACT_PROFILER_TYPE;
|
|
157
|
+
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
158
|
+
var Suspense = REACT_SUSPENSE_TYPE;
|
|
159
|
+
var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
|
|
160
|
+
|
|
161
|
+
function isAsyncMode(object) {
|
|
162
|
+
{
|
|
163
|
+
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
164
|
+
hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
|
|
165
|
+
|
|
166
|
+
console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
|
|
171
|
+
}
|
|
172
|
+
function isConcurrentMode(object) {
|
|
173
|
+
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
|
|
174
|
+
}
|
|
175
|
+
function isContextConsumer(object) {
|
|
176
|
+
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
177
|
+
}
|
|
178
|
+
function isContextProvider(object) {
|
|
179
|
+
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
180
|
+
}
|
|
181
|
+
function isElement(object) {
|
|
182
|
+
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
183
|
+
}
|
|
184
|
+
function isForwardRef(object) {
|
|
185
|
+
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
186
|
+
}
|
|
187
|
+
function isFragment(object) {
|
|
188
|
+
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
189
|
+
}
|
|
190
|
+
function isLazy(object) {
|
|
191
|
+
return typeOf(object) === REACT_LAZY_TYPE;
|
|
192
|
+
}
|
|
193
|
+
function isMemo(object) {
|
|
194
|
+
return typeOf(object) === REACT_MEMO_TYPE;
|
|
195
|
+
}
|
|
196
|
+
function isPortal(object) {
|
|
197
|
+
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
198
|
+
}
|
|
199
|
+
function isProfiler(object) {
|
|
200
|
+
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
201
|
+
}
|
|
202
|
+
function isStrictMode(object) {
|
|
203
|
+
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
204
|
+
}
|
|
205
|
+
function isSuspense(object) {
|
|
206
|
+
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
reactIs_development.AsyncMode = AsyncMode;
|
|
210
|
+
reactIs_development.ConcurrentMode = ConcurrentMode;
|
|
211
|
+
reactIs_development.ContextConsumer = ContextConsumer;
|
|
212
|
+
reactIs_development.ContextProvider = ContextProvider;
|
|
213
|
+
reactIs_development.Element = Element;
|
|
214
|
+
reactIs_development.ForwardRef = ForwardRef;
|
|
215
|
+
reactIs_development.Fragment = Fragment;
|
|
216
|
+
reactIs_development.Lazy = Lazy;
|
|
217
|
+
reactIs_development.Memo = Memo;
|
|
218
|
+
reactIs_development.Portal = Portal;
|
|
219
|
+
reactIs_development.Profiler = Profiler;
|
|
220
|
+
reactIs_development.StrictMode = StrictMode;
|
|
221
|
+
reactIs_development.Suspense = Suspense;
|
|
222
|
+
reactIs_development.isAsyncMode = isAsyncMode;
|
|
223
|
+
reactIs_development.isConcurrentMode = isConcurrentMode;
|
|
224
|
+
reactIs_development.isContextConsumer = isContextConsumer;
|
|
225
|
+
reactIs_development.isContextProvider = isContextProvider;
|
|
226
|
+
reactIs_development.isElement = isElement;
|
|
227
|
+
reactIs_development.isForwardRef = isForwardRef;
|
|
228
|
+
reactIs_development.isFragment = isFragment;
|
|
229
|
+
reactIs_development.isLazy = isLazy;
|
|
230
|
+
reactIs_development.isMemo = isMemo;
|
|
231
|
+
reactIs_development.isPortal = isPortal;
|
|
232
|
+
reactIs_development.isProfiler = isProfiler;
|
|
233
|
+
reactIs_development.isStrictMode = isStrictMode;
|
|
234
|
+
reactIs_development.isSuspense = isSuspense;
|
|
235
|
+
reactIs_development.isValidElementType = isValidElementType;
|
|
236
|
+
reactIs_development.typeOf = typeOf;
|
|
237
|
+
})();
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
if (process.env.NODE_ENV === 'production') {
|
|
241
|
+
reactIs$1.exports = reactIs_production_min;
|
|
242
|
+
} else {
|
|
243
|
+
reactIs$1.exports = reactIs_development;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
function stylis_min (W) {
|
|
247
|
+
function M(d, c, e, h, a) {
|
|
248
|
+
for (var m = 0, b = 0, v = 0, n = 0, q, g, x = 0, K = 0, k, u = k = q = 0, l = 0, r = 0, I = 0, t = 0, B = e.length, J = B - 1, y, f = '', p = '', F = '', G = '', C; l < B;) {
|
|
249
|
+
g = e.charCodeAt(l);
|
|
250
|
+
l === J && 0 !== b + n + v + m && (0 !== b && (g = 47 === b ? 10 : 47), n = v = m = 0, B++, J++);
|
|
251
|
+
|
|
252
|
+
if (0 === b + n + v + m) {
|
|
253
|
+
if (l === J && (0 < r && (f = f.replace(N, '')), 0 < f.trim().length)) {
|
|
254
|
+
switch (g) {
|
|
255
|
+
case 32:
|
|
256
|
+
case 9:
|
|
257
|
+
case 59:
|
|
258
|
+
case 13:
|
|
259
|
+
case 10:
|
|
260
|
+
break;
|
|
261
|
+
|
|
262
|
+
default:
|
|
263
|
+
f += e.charAt(l);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
g = 59;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
switch (g) {
|
|
270
|
+
case 123:
|
|
271
|
+
f = f.trim();
|
|
272
|
+
q = f.charCodeAt(0);
|
|
273
|
+
k = 1;
|
|
274
|
+
|
|
275
|
+
for (t = ++l; l < B;) {
|
|
276
|
+
switch (g = e.charCodeAt(l)) {
|
|
277
|
+
case 123:
|
|
278
|
+
k++;
|
|
279
|
+
break;
|
|
280
|
+
|
|
281
|
+
case 125:
|
|
282
|
+
k--;
|
|
283
|
+
break;
|
|
284
|
+
|
|
285
|
+
case 47:
|
|
286
|
+
switch (g = e.charCodeAt(l + 1)) {
|
|
287
|
+
case 42:
|
|
288
|
+
case 47:
|
|
289
|
+
a: {
|
|
290
|
+
for (u = l + 1; u < J; ++u) {
|
|
291
|
+
switch (e.charCodeAt(u)) {
|
|
292
|
+
case 47:
|
|
293
|
+
if (42 === g && 42 === e.charCodeAt(u - 1) && l + 2 !== u) {
|
|
294
|
+
l = u + 1;
|
|
295
|
+
break a;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
break;
|
|
299
|
+
|
|
300
|
+
case 10:
|
|
301
|
+
if (47 === g) {
|
|
302
|
+
l = u + 1;
|
|
303
|
+
break a;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
l = u;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
break;
|
|
315
|
+
|
|
316
|
+
case 91:
|
|
317
|
+
g++;
|
|
318
|
+
|
|
319
|
+
case 40:
|
|
320
|
+
g++;
|
|
321
|
+
|
|
322
|
+
case 34:
|
|
323
|
+
case 39:
|
|
324
|
+
for (; l++ < J && e.charCodeAt(l) !== g;) {
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
if (0 === k) break;
|
|
330
|
+
l++;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
k = e.substring(t, l);
|
|
334
|
+
0 === q && (q = (f = f.replace(ca, '').trim()).charCodeAt(0));
|
|
335
|
+
|
|
336
|
+
switch (q) {
|
|
337
|
+
case 64:
|
|
338
|
+
0 < r && (f = f.replace(N, ''));
|
|
339
|
+
g = f.charCodeAt(1);
|
|
340
|
+
|
|
341
|
+
switch (g) {
|
|
342
|
+
case 100:
|
|
343
|
+
case 109:
|
|
344
|
+
case 115:
|
|
345
|
+
case 45:
|
|
346
|
+
r = c;
|
|
347
|
+
break;
|
|
348
|
+
|
|
349
|
+
default:
|
|
350
|
+
r = O;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
k = M(c, r, k, g, a + 1);
|
|
354
|
+
t = k.length;
|
|
355
|
+
0 < A && (r = X(O, f, I), C = H(3, k, r, c, D, z, t, g, a, h), f = r.join(''), void 0 !== C && 0 === (t = (k = C.trim()).length) && (g = 0, k = ''));
|
|
356
|
+
if (0 < t) switch (g) {
|
|
357
|
+
case 115:
|
|
358
|
+
f = f.replace(da, ea);
|
|
359
|
+
|
|
360
|
+
case 100:
|
|
361
|
+
case 109:
|
|
362
|
+
case 45:
|
|
363
|
+
k = f + '{' + k + '}';
|
|
364
|
+
break;
|
|
365
|
+
|
|
366
|
+
case 107:
|
|
367
|
+
f = f.replace(fa, '$1 $2');
|
|
368
|
+
k = f + '{' + k + '}';
|
|
369
|
+
k = 1 === w || 2 === w && L('@' + k, 3) ? '@-webkit-' + k + '@' + k : '@' + k;
|
|
370
|
+
break;
|
|
371
|
+
|
|
372
|
+
default:
|
|
373
|
+
k = f + k, 112 === h && (k = (p += k, ''));
|
|
374
|
+
} else k = '';
|
|
375
|
+
break;
|
|
376
|
+
|
|
377
|
+
default:
|
|
378
|
+
k = M(c, X(c, f, I), k, h, a + 1);
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
F += k;
|
|
382
|
+
k = I = r = u = q = 0;
|
|
383
|
+
f = '';
|
|
384
|
+
g = e.charCodeAt(++l);
|
|
385
|
+
break;
|
|
386
|
+
|
|
387
|
+
case 125:
|
|
388
|
+
case 59:
|
|
389
|
+
f = (0 < r ? f.replace(N, '') : f).trim();
|
|
390
|
+
if (1 < (t = f.length)) switch (0 === u && (q = f.charCodeAt(0), 45 === q || 96 < q && 123 > q) && (t = (f = f.replace(' ', ':')).length), 0 < A && void 0 !== (C = H(1, f, c, d, D, z, p.length, h, a, h)) && 0 === (t = (f = C.trim()).length) && (f = '\x00\x00'), q = f.charCodeAt(0), g = f.charCodeAt(1), q) {
|
|
391
|
+
case 0:
|
|
392
|
+
break;
|
|
393
|
+
|
|
394
|
+
case 64:
|
|
395
|
+
if (105 === g || 99 === g) {
|
|
396
|
+
G += f + e.charAt(l);
|
|
397
|
+
break;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
default:
|
|
401
|
+
58 !== f.charCodeAt(t - 1) && (p += P(f, q, g, f.charCodeAt(2)));
|
|
402
|
+
}
|
|
403
|
+
I = r = u = q = 0;
|
|
404
|
+
f = '';
|
|
405
|
+
g = e.charCodeAt(++l);
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
switch (g) {
|
|
410
|
+
case 13:
|
|
411
|
+
case 10:
|
|
412
|
+
47 === b ? b = 0 : 0 === 1 + q && 107 !== h && 0 < f.length && (r = 1, f += '\x00');
|
|
413
|
+
0 < A * Y && H(0, f, c, d, D, z, p.length, h, a, h);
|
|
414
|
+
z = 1;
|
|
415
|
+
D++;
|
|
416
|
+
break;
|
|
417
|
+
|
|
418
|
+
case 59:
|
|
419
|
+
case 125:
|
|
420
|
+
if (0 === b + n + v + m) {
|
|
421
|
+
z++;
|
|
422
|
+
break;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
default:
|
|
426
|
+
z++;
|
|
427
|
+
y = e.charAt(l);
|
|
428
|
+
|
|
429
|
+
switch (g) {
|
|
430
|
+
case 9:
|
|
431
|
+
case 32:
|
|
432
|
+
if (0 === n + m + b) switch (x) {
|
|
433
|
+
case 44:
|
|
434
|
+
case 58:
|
|
435
|
+
case 9:
|
|
436
|
+
case 32:
|
|
437
|
+
y = '';
|
|
438
|
+
break;
|
|
439
|
+
|
|
440
|
+
default:
|
|
441
|
+
32 !== g && (y = ' ');
|
|
442
|
+
}
|
|
443
|
+
break;
|
|
444
|
+
|
|
445
|
+
case 0:
|
|
446
|
+
y = '\\0';
|
|
447
|
+
break;
|
|
448
|
+
|
|
449
|
+
case 12:
|
|
450
|
+
y = '\\f';
|
|
451
|
+
break;
|
|
452
|
+
|
|
453
|
+
case 11:
|
|
454
|
+
y = '\\v';
|
|
455
|
+
break;
|
|
456
|
+
|
|
457
|
+
case 38:
|
|
458
|
+
0 === n + b + m && (r = I = 1, y = '\f' + y);
|
|
459
|
+
break;
|
|
460
|
+
|
|
461
|
+
case 108:
|
|
462
|
+
if (0 === n + b + m + E && 0 < u) switch (l - u) {
|
|
463
|
+
case 2:
|
|
464
|
+
112 === x && 58 === e.charCodeAt(l - 3) && (E = x);
|
|
465
|
+
|
|
466
|
+
case 8:
|
|
467
|
+
111 === K && (E = K);
|
|
468
|
+
}
|
|
469
|
+
break;
|
|
470
|
+
|
|
471
|
+
case 58:
|
|
472
|
+
0 === n + b + m && (u = l);
|
|
473
|
+
break;
|
|
474
|
+
|
|
475
|
+
case 44:
|
|
476
|
+
0 === b + v + n + m && (r = 1, y += '\r');
|
|
477
|
+
break;
|
|
478
|
+
|
|
479
|
+
case 34:
|
|
480
|
+
case 39:
|
|
481
|
+
0 === b && (n = n === g ? 0 : 0 === n ? g : n);
|
|
482
|
+
break;
|
|
483
|
+
|
|
484
|
+
case 91:
|
|
485
|
+
0 === n + b + v && m++;
|
|
486
|
+
break;
|
|
487
|
+
|
|
488
|
+
case 93:
|
|
489
|
+
0 === n + b + v && m--;
|
|
490
|
+
break;
|
|
491
|
+
|
|
492
|
+
case 41:
|
|
493
|
+
0 === n + b + m && v--;
|
|
494
|
+
break;
|
|
495
|
+
|
|
496
|
+
case 40:
|
|
497
|
+
if (0 === n + b + m) {
|
|
498
|
+
if (0 === q) switch (2 * x + 3 * K) {
|
|
499
|
+
case 533:
|
|
500
|
+
break;
|
|
501
|
+
|
|
502
|
+
default:
|
|
503
|
+
q = 1;
|
|
504
|
+
}
|
|
505
|
+
v++;
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
break;
|
|
509
|
+
|
|
510
|
+
case 64:
|
|
511
|
+
0 === b + v + n + m + u + k && (k = 1);
|
|
512
|
+
break;
|
|
513
|
+
|
|
514
|
+
case 42:
|
|
515
|
+
case 47:
|
|
516
|
+
if (!(0 < n + m + v)) switch (b) {
|
|
517
|
+
case 0:
|
|
518
|
+
switch (2 * g + 3 * e.charCodeAt(l + 1)) {
|
|
519
|
+
case 235:
|
|
520
|
+
b = 47;
|
|
521
|
+
break;
|
|
522
|
+
|
|
523
|
+
case 220:
|
|
524
|
+
t = l, b = 42;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
break;
|
|
528
|
+
|
|
529
|
+
case 42:
|
|
530
|
+
47 === g && 42 === x && t + 2 !== l && (33 === e.charCodeAt(t + 2) && (p += e.substring(t, l + 1)), y = '', b = 0);
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
0 === b && (f += y);
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
K = x;
|
|
538
|
+
x = g;
|
|
539
|
+
l++;
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
t = p.length;
|
|
543
|
+
|
|
544
|
+
if (0 < t) {
|
|
545
|
+
r = c;
|
|
546
|
+
if (0 < A && (C = H(2, p, r, d, D, z, t, h, a, h), void 0 !== C && 0 === (p = C).length)) return G + p + F;
|
|
547
|
+
p = r.join(',') + '{' + p + '}';
|
|
548
|
+
|
|
549
|
+
if (0 !== w * E) {
|
|
550
|
+
2 !== w || L(p, 2) || (E = 0);
|
|
551
|
+
|
|
552
|
+
switch (E) {
|
|
553
|
+
case 111:
|
|
554
|
+
p = p.replace(ha, ':-moz-$1') + p;
|
|
555
|
+
break;
|
|
556
|
+
|
|
557
|
+
case 112:
|
|
558
|
+
p = p.replace(Q, '::-webkit-input-$1') + p.replace(Q, '::-moz-$1') + p.replace(Q, ':-ms-input-$1') + p;
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
E = 0;
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
return G + p + F;
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
function X(d, c, e) {
|
|
569
|
+
var h = c.trim().split(ia);
|
|
570
|
+
c = h;
|
|
571
|
+
var a = h.length,
|
|
572
|
+
m = d.length;
|
|
573
|
+
|
|
574
|
+
switch (m) {
|
|
575
|
+
case 0:
|
|
576
|
+
case 1:
|
|
577
|
+
var b = 0;
|
|
578
|
+
|
|
579
|
+
for (d = 0 === m ? '' : d[0] + ' '; b < a; ++b) {
|
|
580
|
+
c[b] = Z(d, c[b], e).trim();
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
break;
|
|
584
|
+
|
|
585
|
+
default:
|
|
586
|
+
var v = b = 0;
|
|
587
|
+
|
|
588
|
+
for (c = []; b < a; ++b) {
|
|
589
|
+
for (var n = 0; n < m; ++n) {
|
|
590
|
+
c[v++] = Z(d[n] + ' ', h[b], e).trim();
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
return c;
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
function Z(d, c, e) {
|
|
600
|
+
var h = c.charCodeAt(0);
|
|
601
|
+
33 > h && (h = (c = c.trim()).charCodeAt(0));
|
|
602
|
+
|
|
603
|
+
switch (h) {
|
|
604
|
+
case 38:
|
|
605
|
+
return c.replace(F, '$1' + d.trim());
|
|
606
|
+
|
|
607
|
+
case 58:
|
|
608
|
+
return d.trim() + c.replace(F, '$1' + d.trim());
|
|
609
|
+
|
|
610
|
+
default:
|
|
611
|
+
if (0 < 1 * e && 0 < c.indexOf('\f')) return c.replace(F, (58 === d.charCodeAt(0) ? '' : '$1') + d.trim());
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
return d + c;
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
function P(d, c, e, h) {
|
|
618
|
+
var a = d + ';',
|
|
619
|
+
m = 2 * c + 3 * e + 4 * h;
|
|
620
|
+
|
|
621
|
+
if (944 === m) {
|
|
622
|
+
d = a.indexOf(':', 9) + 1;
|
|
623
|
+
var b = a.substring(d, a.length - 1).trim();
|
|
624
|
+
b = a.substring(0, d).trim() + b + ';';
|
|
625
|
+
return 1 === w || 2 === w && L(b, 1) ? '-webkit-' + b + b : b;
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
if (0 === w || 2 === w && !L(a, 1)) return a;
|
|
629
|
+
|
|
630
|
+
switch (m) {
|
|
631
|
+
case 1015:
|
|
632
|
+
return 97 === a.charCodeAt(10) ? '-webkit-' + a + a : a;
|
|
633
|
+
|
|
634
|
+
case 951:
|
|
635
|
+
return 116 === a.charCodeAt(3) ? '-webkit-' + a + a : a;
|
|
636
|
+
|
|
637
|
+
case 963:
|
|
638
|
+
return 110 === a.charCodeAt(5) ? '-webkit-' + a + a : a;
|
|
639
|
+
|
|
640
|
+
case 1009:
|
|
641
|
+
if (100 !== a.charCodeAt(4)) break;
|
|
642
|
+
|
|
643
|
+
case 969:
|
|
644
|
+
case 942:
|
|
645
|
+
return '-webkit-' + a + a;
|
|
646
|
+
|
|
647
|
+
case 978:
|
|
648
|
+
return '-webkit-' + a + '-moz-' + a + a;
|
|
649
|
+
|
|
650
|
+
case 1019:
|
|
651
|
+
case 983:
|
|
652
|
+
return '-webkit-' + a + '-moz-' + a + '-ms-' + a + a;
|
|
653
|
+
|
|
654
|
+
case 883:
|
|
655
|
+
if (45 === a.charCodeAt(8)) return '-webkit-' + a + a;
|
|
656
|
+
if (0 < a.indexOf('image-set(', 11)) return a.replace(ja, '$1-webkit-$2') + a;
|
|
657
|
+
break;
|
|
658
|
+
|
|
659
|
+
case 932:
|
|
660
|
+
if (45 === a.charCodeAt(4)) switch (a.charCodeAt(5)) {
|
|
661
|
+
case 103:
|
|
662
|
+
return '-webkit-box-' + a.replace('-grow', '') + '-webkit-' + a + '-ms-' + a.replace('grow', 'positive') + a;
|
|
663
|
+
|
|
664
|
+
case 115:
|
|
665
|
+
return '-webkit-' + a + '-ms-' + a.replace('shrink', 'negative') + a;
|
|
666
|
+
|
|
667
|
+
case 98:
|
|
668
|
+
return '-webkit-' + a + '-ms-' + a.replace('basis', 'preferred-size') + a;
|
|
669
|
+
}
|
|
670
|
+
return '-webkit-' + a + '-ms-' + a + a;
|
|
671
|
+
|
|
672
|
+
case 964:
|
|
673
|
+
return '-webkit-' + a + '-ms-flex-' + a + a;
|
|
674
|
+
|
|
675
|
+
case 1023:
|
|
676
|
+
if (99 !== a.charCodeAt(8)) break;
|
|
677
|
+
b = a.substring(a.indexOf(':', 15)).replace('flex-', '').replace('space-between', 'justify');
|
|
678
|
+
return '-webkit-box-pack' + b + '-webkit-' + a + '-ms-flex-pack' + b + a;
|
|
679
|
+
|
|
680
|
+
case 1005:
|
|
681
|
+
return ka.test(a) ? a.replace(aa, ':-webkit-') + a.replace(aa, ':-moz-') + a : a;
|
|
682
|
+
|
|
683
|
+
case 1e3:
|
|
684
|
+
b = a.substring(13).trim();
|
|
685
|
+
c = b.indexOf('-') + 1;
|
|
686
|
+
|
|
687
|
+
switch (b.charCodeAt(0) + b.charCodeAt(c)) {
|
|
688
|
+
case 226:
|
|
689
|
+
b = a.replace(G, 'tb');
|
|
690
|
+
break;
|
|
691
|
+
|
|
692
|
+
case 232:
|
|
693
|
+
b = a.replace(G, 'tb-rl');
|
|
694
|
+
break;
|
|
695
|
+
|
|
696
|
+
case 220:
|
|
697
|
+
b = a.replace(G, 'lr');
|
|
698
|
+
break;
|
|
699
|
+
|
|
700
|
+
default:
|
|
701
|
+
return a;
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
return '-webkit-' + a + '-ms-' + b + a;
|
|
705
|
+
|
|
706
|
+
case 1017:
|
|
707
|
+
if (-1 === a.indexOf('sticky', 9)) break;
|
|
708
|
+
|
|
709
|
+
case 975:
|
|
710
|
+
c = (a = d).length - 10;
|
|
711
|
+
b = (33 === a.charCodeAt(c) ? a.substring(0, c) : a).substring(d.indexOf(':', 7) + 1).trim();
|
|
712
|
+
|
|
713
|
+
switch (m = b.charCodeAt(0) + (b.charCodeAt(7) | 0)) {
|
|
714
|
+
case 203:
|
|
715
|
+
if (111 > b.charCodeAt(8)) break;
|
|
716
|
+
|
|
717
|
+
case 115:
|
|
718
|
+
a = a.replace(b, '-webkit-' + b) + ';' + a;
|
|
719
|
+
break;
|
|
720
|
+
|
|
721
|
+
case 207:
|
|
722
|
+
case 102:
|
|
723
|
+
a = a.replace(b, '-webkit-' + (102 < m ? 'inline-' : '') + 'box') + ';' + a.replace(b, '-webkit-' + b) + ';' + a.replace(b, '-ms-' + b + 'box') + ';' + a;
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
return a + ';';
|
|
727
|
+
|
|
728
|
+
case 938:
|
|
729
|
+
if (45 === a.charCodeAt(5)) switch (a.charCodeAt(6)) {
|
|
730
|
+
case 105:
|
|
731
|
+
return b = a.replace('-items', ''), '-webkit-' + a + '-webkit-box-' + b + '-ms-flex-' + b + a;
|
|
732
|
+
|
|
733
|
+
case 115:
|
|
734
|
+
return '-webkit-' + a + '-ms-flex-item-' + a.replace(ba, '') + a;
|
|
735
|
+
|
|
736
|
+
default:
|
|
737
|
+
return '-webkit-' + a + '-ms-flex-line-pack' + a.replace('align-content', '').replace(ba, '') + a;
|
|
738
|
+
}
|
|
739
|
+
break;
|
|
740
|
+
|
|
741
|
+
case 973:
|
|
742
|
+
case 989:
|
|
743
|
+
if (45 !== a.charCodeAt(3) || 122 === a.charCodeAt(4)) break;
|
|
744
|
+
|
|
745
|
+
case 931:
|
|
746
|
+
case 953:
|
|
747
|
+
if (!0 === la.test(d)) return 115 === (b = d.substring(d.indexOf(':') + 1)).charCodeAt(0) ? P(d.replace('stretch', 'fill-available'), c, e, h).replace(':fill-available', ':stretch') : a.replace(b, '-webkit-' + b) + a.replace(b, '-moz-' + b.replace('fill-', '')) + a;
|
|
748
|
+
break;
|
|
749
|
+
|
|
750
|
+
case 962:
|
|
751
|
+
if (a = '-webkit-' + a + (102 === a.charCodeAt(5) ? '-ms-' + a : '') + a, 211 === e + h && 105 === a.charCodeAt(13) && 0 < a.indexOf('transform', 10)) return a.substring(0, a.indexOf(';', 27) + 1).replace(ma, '$1-webkit-$2') + a;
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
return a;
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
function L(d, c) {
|
|
758
|
+
var e = d.indexOf(1 === c ? ':' : '{'),
|
|
759
|
+
h = d.substring(0, 3 !== c ? e : 10);
|
|
760
|
+
e = d.substring(e + 1, d.length - 1);
|
|
761
|
+
return R(2 !== c ? h : h.replace(na, '$1'), e, c);
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
function ea(d, c) {
|
|
765
|
+
var e = P(c, c.charCodeAt(0), c.charCodeAt(1), c.charCodeAt(2));
|
|
766
|
+
return e !== c + ';' ? e.replace(oa, ' or ($1)').substring(4) : '(' + c + ')';
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
function H(d, c, e, h, a, m, b, v, n, q) {
|
|
770
|
+
for (var g = 0, x = c, w; g < A; ++g) {
|
|
771
|
+
switch (w = S[g].call(B, d, x, e, h, a, m, b, v, n, q)) {
|
|
772
|
+
case void 0:
|
|
773
|
+
case !1:
|
|
774
|
+
case !0:
|
|
775
|
+
case null:
|
|
776
|
+
break;
|
|
777
|
+
|
|
778
|
+
default:
|
|
779
|
+
x = w;
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
if (x !== c) return x;
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
function T(d) {
|
|
787
|
+
switch (d) {
|
|
788
|
+
case void 0:
|
|
789
|
+
case null:
|
|
790
|
+
A = S.length = 0;
|
|
791
|
+
break;
|
|
792
|
+
|
|
793
|
+
default:
|
|
794
|
+
if ('function' === typeof d) S[A++] = d;else if ('object' === typeof d) for (var c = 0, e = d.length; c < e; ++c) {
|
|
795
|
+
T(d[c]);
|
|
796
|
+
} else Y = !!d | 0;
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
return T;
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
function U(d) {
|
|
803
|
+
d = d.prefix;
|
|
804
|
+
void 0 !== d && (R = null, d ? 'function' !== typeof d ? w = 1 : (w = 2, R = d) : w = 0);
|
|
805
|
+
return U;
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
function B(d, c) {
|
|
809
|
+
var e = d;
|
|
810
|
+
33 > e.charCodeAt(0) && (e = e.trim());
|
|
811
|
+
V = e;
|
|
812
|
+
e = [V];
|
|
813
|
+
|
|
814
|
+
if (0 < A) {
|
|
815
|
+
var h = H(-1, c, e, e, D, z, 0, 0, 0, 0);
|
|
816
|
+
void 0 !== h && 'string' === typeof h && (c = h);
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
var a = M(O, e, c, 0, 0);
|
|
820
|
+
0 < A && (h = H(-2, a, e, e, D, z, a.length, 0, 0, 0), void 0 !== h && (a = h));
|
|
821
|
+
V = '';
|
|
822
|
+
E = 0;
|
|
823
|
+
z = D = 1;
|
|
824
|
+
return a;
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
var ca = /^\0+/g,
|
|
828
|
+
N = /[\0\r\f]/g,
|
|
829
|
+
aa = /: */g,
|
|
830
|
+
ka = /zoo|gra/,
|
|
831
|
+
ma = /([,: ])(transform)/g,
|
|
832
|
+
ia = /,\r+?/g,
|
|
833
|
+
F = /([\t\r\n ])*\f?&/g,
|
|
834
|
+
fa = /@(k\w+)\s*(\S*)\s*/,
|
|
835
|
+
Q = /::(place)/g,
|
|
836
|
+
ha = /:(read-only)/g,
|
|
837
|
+
G = /[svh]\w+-[tblr]{2}/,
|
|
838
|
+
da = /\(\s*(.*)\s*\)/g,
|
|
839
|
+
oa = /([\s\S]*?);/g,
|
|
840
|
+
ba = /-self|flex-/g,
|
|
841
|
+
na = /[^]*?(:[rp][el]a[\w-]+)[^]*/,
|
|
842
|
+
la = /stretch|:\s*\w+\-(?:conte|avail)/,
|
|
843
|
+
ja = /([^-])(image-set\()/,
|
|
844
|
+
z = 1,
|
|
845
|
+
D = 1,
|
|
846
|
+
E = 0,
|
|
847
|
+
w = 1,
|
|
848
|
+
O = [],
|
|
849
|
+
S = [],
|
|
850
|
+
A = 0,
|
|
851
|
+
R = null,
|
|
852
|
+
Y = 0,
|
|
853
|
+
V = '';
|
|
854
|
+
B.use = T;
|
|
855
|
+
B.set = U;
|
|
856
|
+
void 0 !== W && U(W);
|
|
857
|
+
return B;
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
var unitlessKeys = {
|
|
861
|
+
animationIterationCount: 1,
|
|
862
|
+
borderImageOutset: 1,
|
|
863
|
+
borderImageSlice: 1,
|
|
864
|
+
borderImageWidth: 1,
|
|
865
|
+
boxFlex: 1,
|
|
866
|
+
boxFlexGroup: 1,
|
|
867
|
+
boxOrdinalGroup: 1,
|
|
868
|
+
columnCount: 1,
|
|
869
|
+
columns: 1,
|
|
870
|
+
flex: 1,
|
|
871
|
+
flexGrow: 1,
|
|
872
|
+
flexPositive: 1,
|
|
873
|
+
flexShrink: 1,
|
|
874
|
+
flexNegative: 1,
|
|
875
|
+
flexOrder: 1,
|
|
876
|
+
gridRow: 1,
|
|
877
|
+
gridRowEnd: 1,
|
|
878
|
+
gridRowSpan: 1,
|
|
879
|
+
gridRowStart: 1,
|
|
880
|
+
gridColumn: 1,
|
|
881
|
+
gridColumnEnd: 1,
|
|
882
|
+
gridColumnSpan: 1,
|
|
883
|
+
gridColumnStart: 1,
|
|
884
|
+
msGridRow: 1,
|
|
885
|
+
msGridRowSpan: 1,
|
|
886
|
+
msGridColumn: 1,
|
|
887
|
+
msGridColumnSpan: 1,
|
|
888
|
+
fontWeight: 1,
|
|
889
|
+
lineHeight: 1,
|
|
890
|
+
opacity: 1,
|
|
891
|
+
order: 1,
|
|
892
|
+
orphans: 1,
|
|
893
|
+
tabSize: 1,
|
|
894
|
+
widows: 1,
|
|
895
|
+
zIndex: 1,
|
|
896
|
+
zoom: 1,
|
|
897
|
+
WebkitLineClamp: 1,
|
|
898
|
+
// SVG-related properties
|
|
899
|
+
fillOpacity: 1,
|
|
900
|
+
floodOpacity: 1,
|
|
901
|
+
stopOpacity: 1,
|
|
902
|
+
strokeDasharray: 1,
|
|
903
|
+
strokeDashoffset: 1,
|
|
904
|
+
strokeMiterlimit: 1,
|
|
905
|
+
strokeOpacity: 1,
|
|
906
|
+
strokeWidth: 1
|
|
907
|
+
};
|
|
908
|
+
|
|
909
|
+
function memoize(fn) {
|
|
910
|
+
var cache = {};
|
|
911
|
+
return function (arg) {
|
|
912
|
+
if (cache[arg] === undefined) cache[arg] = fn(arg);
|
|
913
|
+
return cache[arg];
|
|
914
|
+
};
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23
|
|
918
|
+
|
|
919
|
+
var index = memoize(function (prop) {
|
|
920
|
+
return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111
|
|
921
|
+
/* o */
|
|
922
|
+
&& prop.charCodeAt(1) === 110
|
|
923
|
+
/* n */
|
|
924
|
+
&& prop.charCodeAt(2) < 91;
|
|
925
|
+
}
|
|
926
|
+
/* Z+1 */
|
|
927
|
+
);
|
|
928
|
+
|
|
929
|
+
var reactIs = reactIs$1.exports;
|
|
930
|
+
|
|
931
|
+
/**
|
|
932
|
+
* Copyright 2015, Yahoo! Inc.
|
|
933
|
+
* Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
|
|
934
|
+
*/
|
|
935
|
+
var REACT_STATICS = {
|
|
936
|
+
childContextTypes: true,
|
|
937
|
+
contextType: true,
|
|
938
|
+
contextTypes: true,
|
|
939
|
+
defaultProps: true,
|
|
940
|
+
displayName: true,
|
|
941
|
+
getDefaultProps: true,
|
|
942
|
+
getDerivedStateFromError: true,
|
|
943
|
+
getDerivedStateFromProps: true,
|
|
944
|
+
mixins: true,
|
|
945
|
+
propTypes: true,
|
|
946
|
+
type: true
|
|
947
|
+
};
|
|
948
|
+
var KNOWN_STATICS = {
|
|
949
|
+
name: true,
|
|
950
|
+
length: true,
|
|
951
|
+
prototype: true,
|
|
952
|
+
caller: true,
|
|
953
|
+
callee: true,
|
|
954
|
+
arguments: true,
|
|
955
|
+
arity: true
|
|
956
|
+
};
|
|
957
|
+
var FORWARD_REF_STATICS = {
|
|
958
|
+
'$$typeof': true,
|
|
959
|
+
render: true,
|
|
960
|
+
defaultProps: true,
|
|
961
|
+
displayName: true,
|
|
962
|
+
propTypes: true
|
|
963
|
+
};
|
|
964
|
+
var MEMO_STATICS = {
|
|
965
|
+
'$$typeof': true,
|
|
966
|
+
compare: true,
|
|
967
|
+
defaultProps: true,
|
|
968
|
+
displayName: true,
|
|
969
|
+
propTypes: true,
|
|
970
|
+
type: true
|
|
971
|
+
};
|
|
972
|
+
var TYPE_STATICS = {};
|
|
973
|
+
TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;
|
|
974
|
+
TYPE_STATICS[reactIs.Memo] = MEMO_STATICS;
|
|
975
|
+
|
|
976
|
+
function getStatics(component) {
|
|
977
|
+
// React v16.11 and below
|
|
978
|
+
if (reactIs.isMemo(component)) {
|
|
979
|
+
return MEMO_STATICS;
|
|
980
|
+
} // React v16.12 and above
|
|
981
|
+
|
|
982
|
+
|
|
983
|
+
return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
var defineProperty = Object.defineProperty;
|
|
987
|
+
var getOwnPropertyNames = Object.getOwnPropertyNames;
|
|
988
|
+
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
989
|
+
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
990
|
+
var getPrototypeOf = Object.getPrototypeOf;
|
|
991
|
+
var objectPrototype = Object.prototype;
|
|
992
|
+
function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
|
|
993
|
+
if (typeof sourceComponent !== 'string') {
|
|
994
|
+
// don't hoist over string (html) components
|
|
995
|
+
if (objectPrototype) {
|
|
996
|
+
var inheritedComponent = getPrototypeOf(sourceComponent);
|
|
997
|
+
|
|
998
|
+
if (inheritedComponent && inheritedComponent !== objectPrototype) {
|
|
999
|
+
hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
|
|
1003
|
+
var keys = getOwnPropertyNames(sourceComponent);
|
|
1004
|
+
|
|
1005
|
+
if (getOwnPropertySymbols) {
|
|
1006
|
+
keys = keys.concat(getOwnPropertySymbols(sourceComponent));
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
var targetStatics = getStatics(targetComponent);
|
|
1010
|
+
var sourceStatics = getStatics(sourceComponent);
|
|
1011
|
+
|
|
1012
|
+
for (var i = 0; i < keys.length; ++i) {
|
|
1013
|
+
var key = keys[i];
|
|
1014
|
+
|
|
1015
|
+
if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {
|
|
1016
|
+
var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
|
|
1017
|
+
|
|
1018
|
+
try {
|
|
1019
|
+
// Avoid failures from read-only properties
|
|
1020
|
+
defineProperty(targetComponent, key, descriptor);
|
|
1021
|
+
} catch (e) {}
|
|
1022
|
+
}
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
return targetComponent;
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
var hoistNonReactStatics_cjs = hoistNonReactStatics;
|
|
1030
|
+
|
|
1031
|
+
function v(){return (v=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r]);}return e}).apply(this,arguments)}var g=function(e,t){for(var n=[e[0]],r=0,o=t.length;r<o;r+=1)n.push(t[r],e[r+1]);return n},S=function(t){return null!==t&&"object"==typeof t&&"[object Object]"===(t.toString?t.toString():Object.prototype.toString.call(t))&&!reactIs$1.exports.typeOf(t)},w=Object.freeze([]),E=Object.freeze({});function b(e){return "function"==typeof e}function _$5(e){return "production"!==process.env.NODE_ENV&&"string"==typeof e&&e||e.displayName||e.name||"Component"}function N(e){return e&&"string"==typeof e.styledComponentId}var A="undefined"!=typeof process&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",I="undefined"!=typeof window&&"HTMLElement"in window,P=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==process.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&process.env.REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env.SC_DISABLE_SPEEDY&&""!==process.env.SC_DISABLE_SPEEDY?"false"!==process.env.SC_DISABLE_SPEEDY&&process.env.SC_DISABLE_SPEEDY:"production"!==process.env.NODE_ENV),R="production"!==process.env.NODE_ENV?{1:"Cannot create styled-component for component: %s.\n\n",2:"Can't collect styles once you've consumed a `ServerStyleSheet`'s styles! `ServerStyleSheet` is a one off instance for each server-side render cycle.\n\n- Are you trying to reuse it across renders?\n- Are you accidentally calling collectStyles twice?\n\n",3:"Streaming SSR is only supported in a Node.js environment; Please do not try to call this method in the browser.\n\n",4:"The `StyleSheetManager` expects a valid target or sheet prop!\n\n- Does this error occur on the client and is your target falsy?\n- Does this error occur on the server and is the sheet falsy?\n\n",5:"The clone method cannot be used on the client!\n\n- Are you running in a client-like environment on the server?\n- Are you trying to run SSR on the client?\n\n",6:"Trying to insert a new style tag, but the given Node is unmounted!\n\n- Are you using a custom target that isn't mounted?\n- Does your document not have a valid head element?\n- Have you accidentally removed a style tag manually?\n\n",7:'ThemeProvider: Please return an object from your "theme" prop function, e.g.\n\n```js\ntheme={() => ({})}\n```\n\n',8:'ThemeProvider: Please make your "theme" prop an object.\n\n',9:"Missing document `<head>`\n\n",10:"Cannot find a StyleSheet instance. Usually this happens if there are multiple copies of styled-components loaded at once. Check out this issue for how to troubleshoot and fix the common cases where this situation can happen: https://github.com/styled-components/styled-components/issues/1941#issuecomment-417862021\n\n",11:"_This error was replaced with a dev-time warning, it will be deleted for v4 final._ [createGlobalStyle] received children which will not be rendered. Please use the component without passing children elements.\n\n",12:"It seems you are interpolating a keyframe declaration (%s) into an untagged string. This was supported in styled-components v3, but is not longer supported in v4 as keyframes are now injected on-demand. Please wrap your string in the css\\`\\` helper which ensures the styles are injected correctly. See https://www.styled-components.com/docs/api#css\n\n",13:"%s is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.\n\n",14:'ThemeProvider: "theme" prop is required.\n\n',15:"A stylis plugin has been supplied that is not named. We need a name for each plugin to be able to prevent styling collisions between different stylis configurations within the same app. Before you pass your plugin to `<StyleSheetManager stylisPlugins={[]}>`, please make sure each plugin is uniquely-named, e.g.\n\n```js\nObject.defineProperty(importedPlugin, 'name', { value: 'some-unique-name' });\n```\n\n",16:"Reached the limit of how many styled components may be created at group %s.\nYou may only create up to 1,073,741,824 components. If you're creating components dynamically,\nas for instance in your render method then you may be running into this limitation.\n\n",17:"CSSStyleSheet could not be found on HTMLStyleElement.\nHas styled-components' style tag been unmounted or altered by another script?\n"}:{};function D(){for(var e=arguments.length<=0?void 0:arguments[0],t=[],n=1,r=arguments.length;n<r;n+=1)t.push(n<0||arguments.length<=n?void 0:arguments[n]);return t.forEach((function(t){e=e.replace(/%[a-z]/,t);})),e}function j(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw "production"===process.env.NODE_ENV?new Error("An error occurred. See https://git.io/JUIaE#"+e+" for more information."+(n.length>0?" Args: "+n.join(", "):"")):new Error(D.apply(void 0,[R[e]].concat(n)).trim())}var T=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e;}var t=e.prototype;return t.indexOfGroup=function(e){for(var t=0,n=0;n<e;n++)t+=this.groupSizes[n];return t},t.insertRules=function(e,t){if(e>=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,o=r;e>=o;)(o<<=1)<0&&j(16,""+e);this.groupSizes=new Uint32Array(o),this.groupSizes.set(n),this.length=o;for(var s=r;s<o;s++)this.groupSizes[s]=0;}for(var i=this.indexOfGroup(e+1),a=0,c=t.length;a<c;a++)this.tag.insertRule(i,t[a])&&(this.groupSizes[e]++,i++);},t.clearGroup=function(e){if(e<this.length){var t=this.groupSizes[e],n=this.indexOfGroup(e),r=n+t;this.groupSizes[e]=0;for(var o=n;o<r;o++)this.tag.deleteRule(n);}},t.getGroup=function(e){var t="";if(e>=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),o=r+n,s=r;s<o;s++)t+=this.tag.getRule(s)+"/*!sc*/\n";return t},e}(),x=new Map,k=new Map,V=1,B=function(e){if(x.has(e))return x.get(e);for(;k.has(V);)V++;var t=V++;return "production"!==process.env.NODE_ENV&&((0|t)<0||t>1<<30)&&j(16,""+t),x.set(e,t),k.set(t,e),t},z=function(e){return k.get(e)},M=function(e,t){t>=V&&(V=t+1),x.set(e,t),k.set(t,e);},G="style["+A+'][data-styled-version="5.3.3"]',L=new RegExp("^"+A+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),F=function(e,t,n){for(var r,o=n.split(","),s=0,i=o.length;s<i;s++)(r=o[s])&&e.registerName(t,r);},Y=function(e,t){for(var n=(t.textContent||"").split("/*!sc*/\n"),r=[],o=0,s=n.length;o<s;o++){var i=n[o].trim();if(i){var a=i.match(L);if(a){var c=0|parseInt(a[1],10),u=a[2];0!==c&&(M(u,c),F(e,u,a[3]),e.getTag().insertRules(c,r)),r.length=0;}else r.push(i);}}},q=function(){return "undefined"!=typeof window&&void 0!==window.__webpack_nonce__?window.__webpack_nonce__:null},H=function(e){var t=document.head,n=e||t,r=document.createElement("style"),o=function(e){for(var t=e.childNodes,n=t.length;n>=0;n--){var r=t[n];if(r&&1===r.nodeType&&r.hasAttribute(A))return r}}(n),s=void 0!==o?o.nextSibling:null;r.setAttribute(A,"active"),r.setAttribute("data-styled-version","5.3.3");var i=q();return i&&r.setAttribute("nonce",i),n.insertBefore(r,s),r},$=function(){function e(e){var t=this.element=H(e);t.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,r=t.length;n<r;n++){var o=t[n];if(o.ownerNode===e)return o}j(17);}(t),this.length=0;}var t=e.prototype;return t.insertRule=function(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch(e){return !1}},t.deleteRule=function(e){this.sheet.deleteRule(e),this.length--;},t.getRule=function(e){var t=this.sheet.cssRules[e];return void 0!==t&&"string"==typeof t.cssText?t.cssText:""},e}(),W=function(){function e(e){var t=this.element=H(e);this.nodes=t.childNodes,this.length=0;}var t=e.prototype;return t.insertRule=function(e,t){if(e<=this.length&&e>=0){var n=document.createTextNode(t),r=this.nodes[e];return this.element.insertBefore(n,r||null),this.length++,!0}return !1},t.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--;},t.getRule=function(e){return e<this.length?this.nodes[e].textContent:""},e}(),U=function(){function e(e){this.rules=[],this.length=0;}var t=e.prototype;return t.insertRule=function(e,t){return e<=this.length&&(this.rules.splice(e,0,t),this.length++,!0)},t.deleteRule=function(e){this.rules.splice(e,1),this.length--;},t.getRule=function(e){return e<this.length?this.rules[e]:""},e}(),J=I,X={isServer:!I,useCSSOMInjection:!P},Z=function(){function e(e,t,n){void 0===e&&(e=E),void 0===t&&(t={}),this.options=v({},X,{},e),this.gs=t,this.names=new Map(n),this.server=!!e.isServer,!this.server&&I&&J&&(J=!1,function(e){for(var t=document.querySelectorAll(G),n=0,r=t.length;n<r;n++){var o=t[n];o&&"active"!==o.getAttribute(A)&&(Y(e,o),o.parentNode&&o.parentNode.removeChild(o));}}(this));}e.registerId=function(e){return B(e)};var t=e.prototype;return t.reconstructWithOptions=function(t,n){return void 0===n&&(n=!0),new e(v({},this.options,{},t),this.gs,n&&this.names||void 0)},t.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},t.getTag=function(){return this.tag||(this.tag=(n=(t=this.options).isServer,r=t.useCSSOMInjection,o=t.target,e=n?new U(o):r?new $(o):new W(o),new T(e)));var e,t,n,r,o;},t.hasNameForId=function(e,t){return this.names.has(e)&&this.names.get(e).has(t)},t.registerName=function(e,t){if(B(e),this.names.has(e))this.names.get(e).add(t);else {var n=new Set;n.add(t),this.names.set(e,n);}},t.insertRules=function(e,t,n){this.registerName(e,t),this.getTag().insertRules(B(e),n);},t.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear();},t.clearRules=function(e){this.getTag().clearGroup(B(e)),this.clearNames(e);},t.clearTag=function(){this.tag=void 0;},t.toString=function(){return function(e){for(var t=e.getTag(),n=t.length,r="",o=0;o<n;o++){var s=z(o);if(void 0!==s){var i=e.names.get(s),a=t.getGroup(o);if(i&&a&&i.size){var c=A+".g"+o+'[id="'+s+'"]',u="";void 0!==i&&i.forEach((function(e){e.length>0&&(u+=e+",");})),r+=""+a+c+'{content:"'+u+'"}/*!sc*/\n';}}}return r}(this)},e}(),K=/(a)(d)/gi,Q=function(e){return String.fromCharCode(e+(e>25?39:97))};function ee(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=Q(t%52)+n;return (Q(t%52)+n).replace(K,"$1-$2")}var te=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},ne=function(e){return te(5381,e)};function re(e){for(var t=0;t<e.length;t+=1){var n=e[t];if(b(n)&&!N(n))return !1}return !0}var oe=ne("5.3.3"),se=function(){function e(e,t,n){this.rules=e,this.staticRulesId="",this.isStatic="production"===process.env.NODE_ENV&&(void 0===n||n.isStatic)&&re(e),this.componentId=t,this.baseHash=te(oe,t),this.baseStyle=n,Z.registerId(t);}return e.prototype.generateAndInjectStyles=function(e,t,n){var r=this.componentId,o=[];if(this.baseStyle&&o.push(this.baseStyle.generateAndInjectStyles(e,t,n)),this.isStatic&&!n.hash)if(this.staticRulesId&&t.hasNameForId(r,this.staticRulesId))o.push(this.staticRulesId);else {var s=Ne(this.rules,e,t,n).join(""),i=ee(te(this.baseHash,s)>>>0);if(!t.hasNameForId(r,i)){var a=n(s,"."+i,void 0,r);t.insertRules(r,i,a);}o.push(i),this.staticRulesId=i;}else {for(var c=this.rules.length,u=te(this.baseHash,n.hash),l="",d=0;d<c;d++){var h=this.rules[d];if("string"==typeof h)l+=h,"production"!==process.env.NODE_ENV&&(u=te(u,h+d));else if(h){var p=Ne(h,e,t,n),f=Array.isArray(p)?p.join(""):p;u=te(u,f+d),l+=f;}}if(l){var m=ee(u>>>0);if(!t.hasNameForId(r,m)){var y=n(l,"."+m,void 0,r);t.insertRules(r,m,y);}o.push(m);}}return o.join(" ")},e}(),ie=/^\s*\/\/.*$/gm,ae=[":","[",".","#"];function ce(e){var t,n,r,o,s=void 0===e?E:e,i=s.options,a=void 0===i?E:i,c=s.plugins,u=void 0===c?w:c,l=new stylis_min(a),d=[],h=function(e){function t(t){if(t)try{e(t+"}");}catch(e){}}return function(n,r,o,s,i,a,c,u,l,d){switch(n){case 1:if(0===l&&64===r.charCodeAt(0))return e(r+";"),"";break;case 2:if(0===u)return r+"/*|*/";break;case 3:switch(u){case 102:case 112:return e(o[0]+r),"";default:return r+(0===d?"/*|*/":"")}case-2:r.split("/*|*/}").forEach(t);}}}((function(e){d.push(e);})),f=function(e,r,s){return 0===r&&-1!==ae.indexOf(s[n.length])||s.match(o)?e:"."+t};function m(e,s,i,a){void 0===a&&(a="&");var c=e.replace(ie,""),u=s&&i?i+" "+s+" { "+c+" }":c;return t=a,n=s,r=new RegExp("\\"+n+"\\b","g"),o=new RegExp("(\\"+n+"\\b){2,}"),l(i||!s?"":s,u)}return l.use([].concat(u,[function(e,t,o){2===e&&o.length&&o[0].lastIndexOf(n)>0&&(o[0]=o[0].replace(r,f));},h,function(e){if(-2===e){var t=d;return d=[],t}}])),m.hash=u.length?u.reduce((function(e,t){return t.name||j(15),te(e,t.name)}),5381).toString():"",m}var ue=React__default.createContext();ue.Consumer;var de=React__default.createContext(),he=(de.Consumer,new Z),pe=ce();function fe(){return useContext(ue)||he}function me(){return useContext(de)||pe}var ve=function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=pe);var r=n.name+t.hash;e.hasNameForId(n.id,r)||e.insertRules(n.id,r,t(n.rules,r,"@keyframes"));},this.toString=function(){return j(12,String(n.name))},this.name=e,this.id="sc-keyframes-"+e,this.rules=t;}return e.prototype.getName=function(e){return void 0===e&&(e=pe),this.name+e.hash},e}(),ge=/([A-Z])/,Se=/([A-Z])/g,we=/^ms-/,Ee=function(e){return "-"+e.toLowerCase()};function be(e){return ge.test(e)?e.replace(Se,Ee).replace(we,"-ms-"):e}var _e=function(e){return null==e||!1===e||""===e};function Ne(e,n,r,o){if(Array.isArray(e)){for(var s,i=[],a=0,c=e.length;a<c;a+=1)""!==(s=Ne(e[a],n,r,o))&&(Array.isArray(s)?i.push.apply(i,s):i.push(s));return i}if(_e(e))return "";if(N(e))return "."+e.styledComponentId;if(b(e)){if("function"!=typeof(l=e)||l.prototype&&l.prototype.isReactComponent||!n)return e;var u=e(n);return "production"!==process.env.NODE_ENV&&reactIs$1.exports.isElement(u)&&console.warn(_$5(e)+" is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details."),Ne(u,n,r,o)}var l;return e instanceof ve?r?(e.inject(r,o),e.getName(o)):e:S(e)?function e(t,n){var r,o,s=[];for(var i in t)t.hasOwnProperty(i)&&!_e(t[i])&&(Array.isArray(t[i])&&t[i].isCss||b(t[i])?s.push(be(i)+":",t[i],";"):S(t[i])?s.push.apply(s,e(t[i],i)):s.push(be(i)+": "+(r=i,null==(o=t[i])||"boolean"==typeof o||""===o?"":"number"!=typeof o||0===o||r in unitlessKeys?String(o).trim():o+"px")+";"));return n?[n+" {"].concat(s,["}"]):s}(e):e.toString()}var Ae=function(e){return Array.isArray(e)&&(e.isCss=!0),e};function Ce(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return b(e)||S(e)?Ae(Ne(g(w,[e].concat(n)))):0===n.length&&1===e.length&&"string"==typeof e[0]?e:Ae(Ne(g(e,n)))}var Ie=/invalid hook call/i,Pe=new Set,Oe=function(e,t){if("production"!==process.env.NODE_ENV){var n="The component "+e+(t?' with the id of "'+t+'"':"")+" has been created dynamically.\nYou may see this warning because you've called styled inside another component.\nTo resolve this only create new StyledComponents outside of any render method and function component.",r=console.error;try{var o=!0;console.error=function(e){if(Ie.test(e))o=!1,Pe.delete(n);else {for(var t=arguments.length,s=new Array(t>1?t-1:0),i=1;i<t;i++)s[i-1]=arguments[i];r.apply(void 0,[e].concat(s));}},useRef(),o&&!Pe.has(n)&&(console.warn(n),Pe.add(n));}catch(e){Ie.test(e.message)&&Pe.delete(n);}finally{console.error=r;}}},Re=function(e,t,n){return void 0===n&&(n=E),e.theme!==n.theme&&e.theme||t||n.theme},De=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,je=/(^-|-$)/g;function Te(e){return e.replace(De,"-").replace(je,"")}var xe=function(e){return ee(ne(e)>>>0)};function ke(e){return "string"==typeof e&&("production"===process.env.NODE_ENV||e.charAt(0)===e.charAt(0).toLowerCase())}var Ve=function(e){return "function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)},Be=function(e){return "__proto__"!==e&&"constructor"!==e&&"prototype"!==e};function ze(e,t,n){var r=e[n];Ve(t)&&Ve(r)?Me(r,t):e[n]=t;}function Me(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];for(var o=0,s=n;o<s.length;o++){var i=s[o];if(Ve(i))for(var a in i)Be(a)&&ze(e,i[a],a);}return e}var Ge=React__default.createContext();Ge.Consumer;var Ye={};function qe(e,t,n){var o=N(e),i=!ke(e),a=t.attrs,c=void 0===a?w:a,d=t.componentId,h=void 0===d?function(e,t){var n="string"!=typeof e?"sc":Te(e);Ye[n]=(Ye[n]||0)+1;var r=n+"-"+xe("5.3.3"+n+Ye[n]);return t?t+"-"+r:r}(t.displayName,t.parentComponentId):d,p=t.displayName,f=void 0===p?function(e){return ke(e)?"styled."+e:"Styled("+_$5(e)+")"}(e):p,g=t.displayName&&t.componentId?Te(t.displayName)+"-"+t.componentId:t.componentId||h,S=o&&e.attrs?Array.prototype.concat(e.attrs,c).filter(Boolean):c,A=t.shouldForwardProp;o&&e.shouldForwardProp&&(A=t.shouldForwardProp?function(n,r,o){return e.shouldForwardProp(n,r,o)&&t.shouldForwardProp(n,r,o)}:e.shouldForwardProp);var C,I=new se(n,g,o?e.componentStyle:void 0),P=I.isStatic&&0===c.length,O=function(e,t){return function(e,t,n,r){var o=e.attrs,i=e.componentStyle,a=e.defaultProps,c=e.foldedComponentIds,d=e.shouldForwardProp,h=e.styledComponentId,p=e.target;"production"!==process.env.NODE_ENV&&useDebugValue(h);var f=function(e,t,n){void 0===e&&(e=E);var r=v({},t,{theme:e}),o={};return n.forEach((function(e){var t,n,s,i=e;for(t in b(i)&&(i=i(r)),i)r[t]=o[t]="className"===t?(n=o[t],s=i[t],n&&s?n+" "+s:n||s):i[t];})),[r,o]}(Re(t,useContext(Ge),a)||E,t,o),y=f[0],g=f[1],S=function(e,t,n,r){var o=fe(),s=me(),i=t?e.generateAndInjectStyles(E,o,s):e.generateAndInjectStyles(n,o,s);return "production"!==process.env.NODE_ENV&&useDebugValue(i),"production"!==process.env.NODE_ENV&&!t&&r&&r(i),i}(i,r,y,"production"!==process.env.NODE_ENV?e.warnTooManyClasses:void 0),w=n,_=g.$as||t.$as||g.as||t.as||p,N=ke(_),A=g!==t?v({},t,{},g):t,C={};for(var I in A)"$"!==I[0]&&"as"!==I&&("forwardedAs"===I?C.as=A[I]:(d?d(I,index,_):!N||index(I))&&(C[I]=A[I]));return t.style&&g.style!==t.style&&(C.style=v({},t.style,{},g.style)),C.className=Array.prototype.concat(c,h,S!==h?S:null,t.className,g.className).filter(Boolean).join(" "),C.ref=w,createElement(_,C)}(C,e,t,P)};return O.displayName=f,(C=React__default.forwardRef(O)).attrs=S,C.componentStyle=I,C.displayName=f,C.shouldForwardProp=A,C.foldedComponentIds=o?Array.prototype.concat(e.foldedComponentIds,e.styledComponentId):w,C.styledComponentId=g,C.target=o?e.target:e,C.withComponent=function(e){var r=t.componentId,o=function(e,t){if(null==e)return {};var n,r,o={},s=Object.keys(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(t,["componentId"]),s=r&&r+"-"+(ke(e)?e:Te(_$5(e)));return qe(e,v({},o,{attrs:S,componentId:s}),n)},Object.defineProperty(C,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=o?Me({},e.defaultProps,t):t;}}),"production"!==process.env.NODE_ENV&&(Oe(f,g),C.warnTooManyClasses=function(e,t){var n={},r=!1;return function(o){if(!r&&(n[o]=!0,Object.keys(n).length>=200)){var s=t?' with the id of "'+t+'"':"";console.warn("Over 200 classes were generated for component "+e+s+".\nConsider using the attrs method, together with a style object for frequently changed styles.\nExample:\n const Component = styled.div.attrs(props => ({\n style: {\n background: props.background,\n },\n }))`width: 100%;`\n\n <Component />"),r=!0,n={};}}}(f,g)),C.toString=function(){return "."+C.styledComponentId},i&&hoistNonReactStatics_cjs(C,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),C}var He=function(e){return function e(t,r,o){if(void 0===o&&(o=E),!reactIs$1.exports.isValidElementType(r))return j(1,String(r));var s=function(){return t(r,o,Ce.apply(void 0,arguments))};return s.withConfig=function(n){return e(t,r,v({},o,{},n))},s.attrs=function(n){return e(t,r,v({},o,{attrs:Array.prototype.concat(o.attrs,n).filter(Boolean)}))},s}(qe,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach((function(e){He[e]=He(e);}));"production"!==process.env.NODE_ENV&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product&&console.warn("It looks like you've imported 'styled-components' on React Native.\nPerhaps you're looking to import 'styled-components/native'?\nRead more about this at https://www.styled-components.com/docs/basics#react-native"),"production"!==process.env.NODE_ENV&&"test"!==process.env.NODE_ENV&&"undefined"!=typeof window&&(window["__styled-components-init__"]=window["__styled-components-init__"]||0,1===window["__styled-components-init__"]&&console.warn("It looks like there are several instances of 'styled-components' initialized in this application. This may cause dynamic styles to not render properly, errors during the rehydration process, a missing theme prop, and makes your application bigger without good reason.\n\nSee https://s-c.sh/2BAXzed for more info."),window["__styled-components-init__"]+=1);var styled = He;
|
|
1032
|
+
|
|
1033
|
+
let _$4 = t => t,
|
|
1034
|
+
_t$4,
|
|
1035
|
+
_t2$2,
|
|
1036
|
+
_t3$2,
|
|
1037
|
+
_t4$2;
|
|
1038
|
+
const ColumnsWrapper = styled.div(_t$4 || (_t$4 = _$4`
|
|
1039
|
+
display: flex;
|
|
1040
|
+
flex-direction: column;
|
|
1041
|
+
align-items: center;
|
|
1042
|
+
`));
|
|
1043
|
+
const ColumnsHeader = styled.p(_t2$2 || (_t2$2 = _$4`
|
|
1044
|
+
margin: 10px 0;
|
|
1045
|
+
color: #c3c3c3;
|
|
1046
|
+
font-size: 12px;
|
|
1047
|
+
`));
|
|
1048
|
+
const NumberInputFormGroupWrapper = styled.div(_t3$2 || (_t3$2 = _$4`
|
|
1049
|
+
display: flex;
|
|
1050
|
+
align-items: center;
|
|
1051
|
+
justify-content: space-between;
|
|
1052
|
+
width: 110px;
|
|
1053
|
+
`));
|
|
1054
|
+
const IconWrapper$1 = styled.div(_t4$2 || (_t4$2 = _$4`
|
|
1055
|
+
cursor: pointer;
|
|
1056
|
+
`));
|
|
1057
|
+
|
|
1058
|
+
const MATRIX_LABEL_TYPE = {
|
|
1059
|
+
agreement: 'agreement',
|
|
1060
|
+
frequency: 'frequency',
|
|
1061
|
+
yesNo: 'yesNo',
|
|
1062
|
+
importance: 'importance',
|
|
1063
|
+
likelihood: 'likelihood',
|
|
1064
|
+
like: 'like',
|
|
1065
|
+
custom: 'custom'
|
|
1066
|
+
};
|
|
1067
|
+
|
|
1068
|
+
const MatrixColumnsSizeHeaderInput = ({
|
|
1069
|
+
model,
|
|
1070
|
+
onChangeModel
|
|
1071
|
+
}) => {
|
|
1072
|
+
const onIncrementColumnsSize = () => {
|
|
1073
|
+
onChangeModel(_extends({}, model, {
|
|
1074
|
+
columnLabels: [...model.columnLabels, `COLUMN ${model.columnLabels.length + 1}`],
|
|
1075
|
+
labelType: MATRIX_LABEL_TYPE.custom
|
|
1076
|
+
}));
|
|
1077
|
+
};
|
|
1078
|
+
|
|
1079
|
+
const onDecrementColumnsSize = () => {
|
|
1080
|
+
const columnLabelsLength = model.columnLabels.length;
|
|
1081
|
+
|
|
1082
|
+
if (columnLabelsLength <= 1) {
|
|
1083
|
+
return;
|
|
1084
|
+
}
|
|
1085
|
+
|
|
1086
|
+
const columnLabelsNext = [...model.columnLabels];
|
|
1087
|
+
columnLabelsNext.pop();
|
|
1088
|
+
|
|
1089
|
+
const matrixValuesClone = _extends({}, model.matrixValues);
|
|
1090
|
+
|
|
1091
|
+
model.rowLabels.forEach((rowLabel, rowIndex) => {
|
|
1092
|
+
delete matrixValuesClone[`${rowIndex}-${columnLabelsLength - 1}`];
|
|
1093
|
+
});
|
|
1094
|
+
onChangeModel(_extends({}, model, {
|
|
1095
|
+
columnLabels: columnLabelsNext,
|
|
1096
|
+
matrixValues: matrixValuesClone,
|
|
1097
|
+
labelType: MATRIX_LABEL_TYPE.custom
|
|
1098
|
+
}));
|
|
1099
|
+
};
|
|
1100
|
+
|
|
1101
|
+
return /*#__PURE__*/React__default.createElement(ColumnsWrapper, null, /*#__PURE__*/React__default.createElement(ColumnsHeader, null, "Matrix Columns"), /*#__PURE__*/React__default.createElement(NumberInputFormGroupWrapper, null, /*#__PURE__*/React__default.createElement(IconWrapper$1, null, /*#__PURE__*/React__default.createElement(RemoveIcon, {
|
|
1102
|
+
onClick: onDecrementColumnsSize
|
|
1103
|
+
})), /*#__PURE__*/React__default.createElement("p", null, model.columnLabels.length), /*#__PURE__*/React__default.createElement(IconWrapper$1, null, /*#__PURE__*/React__default.createElement(AddIcon, {
|
|
1104
|
+
onClick: onIncrementColumnsSize
|
|
1105
|
+
}))));
|
|
1106
|
+
};
|
|
1107
|
+
|
|
1108
|
+
MatrixColumnsSizeHeaderInput.propTypes = {
|
|
1109
|
+
model: PropTypes.object.isRequired,
|
|
1110
|
+
onChangeModel: PropTypes.func.isRequired
|
|
1111
|
+
};
|
|
1112
|
+
|
|
1113
|
+
const MatrixColumnsRowInput = ({
|
|
1114
|
+
model,
|
|
1115
|
+
onChangeModel
|
|
1116
|
+
}) => {
|
|
1117
|
+
const onIncrementSize = () => {
|
|
1118
|
+
onChangeModel(_extends({}, model, {
|
|
1119
|
+
rowLabels: [...model.rowLabels, `STATEMENT ${model.rowLabels.length + 1}`],
|
|
1120
|
+
labelType: MATRIX_LABEL_TYPE.custom
|
|
1121
|
+
}));
|
|
1122
|
+
};
|
|
1123
|
+
|
|
1124
|
+
const onDecrementSize = () => {
|
|
1125
|
+
const rowLabelsLength = model.rowLabels.length;
|
|
1126
|
+
|
|
1127
|
+
if (rowLabelsLength <= 1) {
|
|
1128
|
+
return;
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
const rowLabelsNext = [...model.rowLabels];
|
|
1132
|
+
rowLabelsNext.pop();
|
|
1133
|
+
|
|
1134
|
+
const matrixValuesClone = _extends({}, model.matrixValues);
|
|
1135
|
+
|
|
1136
|
+
model.columnLabels.forEach((columnLabel, columnIndex) => {
|
|
1137
|
+
delete matrixValuesClone[`${rowLabelsLength - 1}-${columnIndex}`];
|
|
1138
|
+
});
|
|
1139
|
+
onChangeModel(_extends({}, model, {
|
|
1140
|
+
rowLabels: rowLabelsNext,
|
|
1141
|
+
matrixValues: matrixValuesClone,
|
|
1142
|
+
labelType: MATRIX_LABEL_TYPE.custom
|
|
1143
|
+
}));
|
|
1144
|
+
};
|
|
1145
|
+
|
|
1146
|
+
return /*#__PURE__*/React__default.createElement(ColumnsWrapper, null, /*#__PURE__*/React__default.createElement(ColumnsHeader, null, "Matrix Rows"), /*#__PURE__*/React__default.createElement(NumberInputFormGroupWrapper, null, /*#__PURE__*/React__default.createElement(IconWrapper$1, null, /*#__PURE__*/React__default.createElement(RemoveIcon, {
|
|
1147
|
+
onClick: onDecrementSize
|
|
1148
|
+
})), /*#__PURE__*/React__default.createElement("p", null, model.rowLabels.length), /*#__PURE__*/React__default.createElement(IconWrapper$1, null, /*#__PURE__*/React__default.createElement(AddIcon, {
|
|
1149
|
+
onClick: onIncrementSize
|
|
1150
|
+
}))));
|
|
1151
|
+
};
|
|
1152
|
+
|
|
1153
|
+
MatrixColumnsRowInput.propTypes = {
|
|
1154
|
+
model: PropTypes.object.isRequired,
|
|
1155
|
+
onChangeModel: PropTypes.func.isRequired
|
|
1156
|
+
};
|
|
1157
|
+
|
|
1158
|
+
const AGREEMENT_3 = ['Disagree', 'Unsure', 'Agree'];
|
|
1159
|
+
const AGREEMENT_5 = ['Strongly Disagree', ...AGREEMENT_3, 'Strongly Agree'];
|
|
1160
|
+
const AGREEMENT_7 = ['Extremely Disagree', ...AGREEMENT_5, 'Extremely Agree'];
|
|
1161
|
+
const FREQUENCY_3 = ['Infrequently', 'Unsure', 'Frequently'];
|
|
1162
|
+
const FREQUENCY_5 = ['Very Infrequently', ...FREQUENCY_3, 'Very Frequently'];
|
|
1163
|
+
const FREQUENCY_7 = ['Never', ...FREQUENCY_5, 'Always'];
|
|
1164
|
+
const YES_NO_3 = ['No', 'Unsure', 'Yes'];
|
|
1165
|
+
const YES_NO_5 = ['No', 'Not really', 'Unsure', 'Sometimes', 'Yes'];
|
|
1166
|
+
const YES_NO_7 = ['No', 'Rarely', 'Not really', 'Unsure', 'Sometimes', 'Very Often', 'Always'];
|
|
1167
|
+
const LIKELIHOOD_3 = ['Not Likely', 'Unsure', 'Likely'];
|
|
1168
|
+
const LIKELIHOOD_5 = ['Very Unlikely', ...LIKELIHOOD_3, 'Very Likely'];
|
|
1169
|
+
const LIKELIHOOD_7 = ['Extremely Unlikely', ...LIKELIHOOD_5, 'Extremely Likely'];
|
|
1170
|
+
const IMPORTANCE_3 = ['Not Important', 'Unsure', 'Important'];
|
|
1171
|
+
const IMPORTANCE_5 = ['Very Not Important', ...IMPORTANCE_3, 'Very Important'];
|
|
1172
|
+
const IMPORTANCE_7 = ['Extremely Not Important', ...IMPORTANCE_5, 'Extremely Important'];
|
|
1173
|
+
const LIKE_3 = ['Dislike', 'Unsure', 'Like'];
|
|
1174
|
+
const LIKE_5 = ['Really Dislike', ...LIKE_3, 'Really Like'];
|
|
1175
|
+
const LIKE_7 = ['Extremely Dislike', ...LIKE_5, 'Extremely Like'];
|
|
1176
|
+
const config = {
|
|
1177
|
+
agreement_3: AGREEMENT_3,
|
|
1178
|
+
agreement_5: AGREEMENT_5,
|
|
1179
|
+
agreement_7: AGREEMENT_7,
|
|
1180
|
+
frequency_3: FREQUENCY_3,
|
|
1181
|
+
frequency_5: FREQUENCY_5,
|
|
1182
|
+
frequency_7: FREQUENCY_7,
|
|
1183
|
+
yesNo_3: YES_NO_3,
|
|
1184
|
+
yesNo_5: YES_NO_5,
|
|
1185
|
+
yesNo_7: YES_NO_7,
|
|
1186
|
+
likelihood_3: LIKELIHOOD_3,
|
|
1187
|
+
likelihood_5: LIKELIHOOD_5,
|
|
1188
|
+
likelihood_7: LIKELIHOOD_7,
|
|
1189
|
+
importance_3: IMPORTANCE_3,
|
|
1190
|
+
importance_5: IMPORTANCE_5,
|
|
1191
|
+
importance_7: IMPORTANCE_7,
|
|
1192
|
+
like_3: LIKE_3,
|
|
1193
|
+
like_5: LIKE_5,
|
|
1194
|
+
like_7: LIKE_7
|
|
1195
|
+
};
|
|
1196
|
+
|
|
1197
|
+
const generateColumnLabels = (labelType, size) => {
|
|
1198
|
+
return config[`${labelType}_${size}`];
|
|
1199
|
+
};
|
|
1200
|
+
|
|
1201
|
+
let _$3 = t => t,
|
|
1202
|
+
_t$3;
|
|
1203
|
+
const Flex = styled.div(_t$3 || (_t$3 = _$3`
|
|
1204
|
+
display: flex;
|
|
1205
|
+
`));
|
|
1206
|
+
|
|
1207
|
+
const styles$2 = theme => ({
|
|
1208
|
+
customColor: {
|
|
1209
|
+
color: `${color.tertiary()} !important`
|
|
1210
|
+
}
|
|
1211
|
+
});
|
|
1212
|
+
|
|
1213
|
+
const MatrixLabelTypeHeaderInput = ({
|
|
1214
|
+
model,
|
|
1215
|
+
onChangeModel,
|
|
1216
|
+
classes
|
|
1217
|
+
}) => {
|
|
1218
|
+
const onChangeLabelType = e => {
|
|
1219
|
+
const labelType = e.target.value;
|
|
1220
|
+
|
|
1221
|
+
const modelNew = _extends({}, model, {
|
|
1222
|
+
labelType
|
|
1223
|
+
});
|
|
1224
|
+
|
|
1225
|
+
if (labelType !== MATRIX_LABEL_TYPE.custom) {
|
|
1226
|
+
modelNew.columnLabels = generateColumnLabels(labelType, model.columnLabels.length);
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
onChangeModel(modelNew);
|
|
1230
|
+
};
|
|
1231
|
+
|
|
1232
|
+
const isMatrixTypeSelectionEnabled = [3, 5, 7].includes(model.columnLabels.length);
|
|
1233
|
+
return /*#__PURE__*/React__default.createElement(ColumnsWrapper, null, /*#__PURE__*/React__default.createElement(ColumnsHeader, null, "Matrix Type"), /*#__PURE__*/React__default.createElement(Flex, null, /*#__PURE__*/React__default.createElement(RadioGroup, {
|
|
1234
|
+
"aria-label": "matrixLabelType",
|
|
1235
|
+
name: "matrixLabelType",
|
|
1236
|
+
value: model.labelType,
|
|
1237
|
+
onChange: onChangeLabelType
|
|
1238
|
+
}, /*#__PURE__*/React__default.createElement(FormControlLabel, {
|
|
1239
|
+
disabled: !isMatrixTypeSelectionEnabled,
|
|
1240
|
+
value: MATRIX_LABEL_TYPE.agreement,
|
|
1241
|
+
control: /*#__PURE__*/React__default.createElement(Radio, {
|
|
1242
|
+
className: classes.customColor
|
|
1243
|
+
}),
|
|
1244
|
+
label: "Agreement"
|
|
1245
|
+
}), /*#__PURE__*/React__default.createElement(FormControlLabel, {
|
|
1246
|
+
disabled: !isMatrixTypeSelectionEnabled,
|
|
1247
|
+
value: MATRIX_LABEL_TYPE.frequency,
|
|
1248
|
+
control: /*#__PURE__*/React__default.createElement(Radio, {
|
|
1249
|
+
className: classes.customColor
|
|
1250
|
+
}),
|
|
1251
|
+
label: "Frequency"
|
|
1252
|
+
}), /*#__PURE__*/React__default.createElement(FormControlLabel, {
|
|
1253
|
+
disabled: !isMatrixTypeSelectionEnabled,
|
|
1254
|
+
value: MATRIX_LABEL_TYPE.yesNo,
|
|
1255
|
+
control: /*#__PURE__*/React__default.createElement(Radio, {
|
|
1256
|
+
className: classes.customColor
|
|
1257
|
+
}),
|
|
1258
|
+
label: "Yes/No"
|
|
1259
|
+
})), /*#__PURE__*/React__default.createElement(RadioGroup, {
|
|
1260
|
+
"aria-label": "matrixLabelType",
|
|
1261
|
+
name: "matrixLabelType",
|
|
1262
|
+
value: model.labelType,
|
|
1263
|
+
onChange: onChangeLabelType
|
|
1264
|
+
}, /*#__PURE__*/React__default.createElement(FormControlLabel, {
|
|
1265
|
+
disabled: !isMatrixTypeSelectionEnabled,
|
|
1266
|
+
value: MATRIX_LABEL_TYPE.importance,
|
|
1267
|
+
control: /*#__PURE__*/React__default.createElement(Radio, {
|
|
1268
|
+
className: classes.customColor
|
|
1269
|
+
}),
|
|
1270
|
+
label: "Importance"
|
|
1271
|
+
}), /*#__PURE__*/React__default.createElement(FormControlLabel, {
|
|
1272
|
+
disabled: !isMatrixTypeSelectionEnabled,
|
|
1273
|
+
value: MATRIX_LABEL_TYPE.likelihood,
|
|
1274
|
+
control: /*#__PURE__*/React__default.createElement(Radio, {
|
|
1275
|
+
className: classes.customColor
|
|
1276
|
+
}),
|
|
1277
|
+
label: "Likelihood"
|
|
1278
|
+
}), /*#__PURE__*/React__default.createElement(FormControlLabel, {
|
|
1279
|
+
disabled: !isMatrixTypeSelectionEnabled,
|
|
1280
|
+
value: MATRIX_LABEL_TYPE.like,
|
|
1281
|
+
control: /*#__PURE__*/React__default.createElement(Radio, {
|
|
1282
|
+
className: classes.customColor
|
|
1283
|
+
}),
|
|
1284
|
+
label: "Like"
|
|
1285
|
+
})), /*#__PURE__*/React__default.createElement(RadioGroup, {
|
|
1286
|
+
"aria-label": "matrixLabelType",
|
|
1287
|
+
name: "matrixLabelType",
|
|
1288
|
+
value: model.labelType,
|
|
1289
|
+
onChange: onChangeLabelType
|
|
1290
|
+
}, /*#__PURE__*/React__default.createElement(FormControlLabel, {
|
|
1291
|
+
value: MATRIX_LABEL_TYPE.custom,
|
|
1292
|
+
control: /*#__PURE__*/React__default.createElement(Radio, {
|
|
1293
|
+
className: classes.customColor
|
|
1294
|
+
}),
|
|
1295
|
+
label: "Custom"
|
|
1296
|
+
}))));
|
|
1297
|
+
};
|
|
1298
|
+
|
|
1299
|
+
MatrixLabelTypeHeaderInput.propTypes = {
|
|
1300
|
+
model: PropTypes.object.isRequired,
|
|
1301
|
+
onChangeModel: PropTypes.func.isRequired
|
|
1302
|
+
};
|
|
1303
|
+
var MatrixLabelTypeHeaderInput$1 = withStyles(styles$2)(MatrixLabelTypeHeaderInput);
|
|
1304
|
+
|
|
1305
|
+
let _$2 = t => t,
|
|
1306
|
+
_t$2;
|
|
1307
|
+
const InputWrapper$1 = styled.div(_t$2 || (_t$2 = _$2`
|
|
1308
|
+
width: 100%;
|
|
1309
|
+
height: 100%;
|
|
1310
|
+
input[type='number'] {
|
|
1311
|
+
-moz-appearance: textfield;
|
|
1312
|
+
}
|
|
1313
|
+
|
|
1314
|
+
input::-webkit-outer-spin-button,
|
|
1315
|
+
input::-webkit-inner-spin-button {
|
|
1316
|
+
-webkit-appearance: none;
|
|
1317
|
+
}
|
|
1318
|
+
`));
|
|
1319
|
+
const styles$1 = {
|
|
1320
|
+
InputPropsClass: {
|
|
1321
|
+
fontSize: '16px',
|
|
1322
|
+
textAlign: 'center!important',
|
|
1323
|
+
padding: '0!important',
|
|
1324
|
+
margin: '5px 0',
|
|
1325
|
+
'&$cssFocused $notchedOutline': {
|
|
1326
|
+
borderColor: 'green !important',
|
|
1327
|
+
borderWidth: '1px !important'
|
|
1328
|
+
},
|
|
1329
|
+
'&:hover $notchedOutline': {
|
|
1330
|
+
borderColor: 'gray !important'
|
|
1331
|
+
}
|
|
1332
|
+
},
|
|
1333
|
+
inputPropsClass: {
|
|
1334
|
+
fontSize: '16px',
|
|
1335
|
+
textAlign: 'center',
|
|
1336
|
+
padding: '0',
|
|
1337
|
+
margin: '5px 0'
|
|
1338
|
+
},
|
|
1339
|
+
cssFocused: {},
|
|
1340
|
+
notchedOutline: {
|
|
1341
|
+
borderWidth: '1px !important',
|
|
1342
|
+
borderColor: '#d6d6d6 !important'
|
|
1343
|
+
}
|
|
1344
|
+
};
|
|
1345
|
+
const NumericInput = withStyles(styles$1)(props => {
|
|
1346
|
+
const {
|
|
1347
|
+
classes,
|
|
1348
|
+
onFieldUpdate,
|
|
1349
|
+
name,
|
|
1350
|
+
placeholder,
|
|
1351
|
+
fieldValue
|
|
1352
|
+
} = props;
|
|
1353
|
+
|
|
1354
|
+
const onFieldUpdateWrapper = e => {
|
|
1355
|
+
onFieldUpdate(e.target.value);
|
|
1356
|
+
};
|
|
1357
|
+
|
|
1358
|
+
return /*#__PURE__*/React.createElement(InputWrapper$1, null, /*#__PURE__*/React.createElement(TextField, {
|
|
1359
|
+
name: name,
|
|
1360
|
+
value: fieldValue.value,
|
|
1361
|
+
inputProps: {
|
|
1362
|
+
className: classes.inputPropsClass
|
|
1363
|
+
},
|
|
1364
|
+
InputProps: {
|
|
1365
|
+
classes: {
|
|
1366
|
+
root: classes.InputPropsClass,
|
|
1367
|
+
focused: classes.cssFocused,
|
|
1368
|
+
notchedOutline: classes.notchedOutline
|
|
1369
|
+
}
|
|
1370
|
+
},
|
|
1371
|
+
inputRef: fieldValue.ref,
|
|
1372
|
+
type: "number",
|
|
1373
|
+
placeholder: placeholder,
|
|
1374
|
+
onChange: onFieldUpdateWrapper,
|
|
1375
|
+
variant: "outlined"
|
|
1376
|
+
}));
|
|
1377
|
+
});
|
|
1378
|
+
NumericInput.propTypes = {
|
|
1379
|
+
name: PropTypes.string.isRequired,
|
|
1380
|
+
placeholder: PropTypes.string.isRequired,
|
|
1381
|
+
fieldValue: PropTypes.object.isRequired,
|
|
1382
|
+
classes: PropTypes.object,
|
|
1383
|
+
onFieldUpdate: PropTypes.func.isRequired
|
|
1384
|
+
};
|
|
1385
|
+
|
|
1386
|
+
var isNumeric = (value => {
|
|
1387
|
+
return /^-?\d+$/.test(value);
|
|
1388
|
+
});
|
|
1389
|
+
|
|
1390
|
+
let _$1 = t => t,
|
|
1391
|
+
_t$1,
|
|
1392
|
+
_t2$1,
|
|
1393
|
+
_t3$1,
|
|
1394
|
+
_t4$1,
|
|
1395
|
+
_t5$1,
|
|
1396
|
+
_t6$1,
|
|
1397
|
+
_t7$1,
|
|
1398
|
+
_t8$1;
|
|
1399
|
+
const MatrixEditableButtonWrapper = styled.div(_t$1 || (_t$1 = _$1`
|
|
1400
|
+
width: 100%;
|
|
1401
|
+
height: 50px;
|
|
1402
|
+
margin: 1px;
|
|
1403
|
+
background: #04b26e;
|
|
1404
|
+
border-radius: 5px;
|
|
1405
|
+
color: white;
|
|
1406
|
+
font-size: 14px;
|
|
1407
|
+
white-space: nowrap;
|
|
1408
|
+
display: flex;
|
|
1409
|
+
align-items: center;
|
|
1410
|
+
justify-content: space-between;
|
|
1411
|
+
`));
|
|
1412
|
+
const MatrixEditableButtonContent = styled.div(_t2$1 || (_t2$1 = _$1`
|
|
1413
|
+
padding: 0 5px 0 12px;
|
|
1414
|
+
width: 100%;
|
|
1415
|
+
display: flex;
|
|
1416
|
+
align-items: center;
|
|
1417
|
+
overflow: hidden;
|
|
1418
|
+
`));
|
|
1419
|
+
const MatrixEditableButtonText = styled.p(_t3$1 || (_t3$1 = _$1`
|
|
1420
|
+
margin: 0;
|
|
1421
|
+
padding: 3px 0 3px 4px;
|
|
1422
|
+
cursor: pointer;
|
|
1423
|
+
width: 100%;
|
|
1424
|
+
|
|
1425
|
+
white-space: nowrap;
|
|
1426
|
+
overflow: hidden;
|
|
1427
|
+
text-overflow: ellipsis;
|
|
1428
|
+
|
|
1429
|
+
:hover {
|
|
1430
|
+
background: #00985d;
|
|
1431
|
+
}
|
|
1432
|
+
|
|
1433
|
+
transition: all 0.1s ease-in-out;
|
|
1434
|
+
`));
|
|
1435
|
+
const MatrixEditableButtonActions = styled.div(_t4$1 || (_t4$1 = _$1`
|
|
1436
|
+
padding: 0 3px;
|
|
1437
|
+
height: 100%;
|
|
1438
|
+
cursor: pointer;
|
|
1439
|
+
display: flex;
|
|
1440
|
+
align-items: center;
|
|
1441
|
+
border-left: 3px solid #00985d;
|
|
1442
|
+
:hover {
|
|
1443
|
+
background: #00985d;
|
|
1444
|
+
border-top-right-radius: 5px;
|
|
1445
|
+
border-bottom-right-radius: 5px;
|
|
1446
|
+
}
|
|
1447
|
+
transition: all 0.1s ease-in-out;
|
|
1448
|
+
`));
|
|
1449
|
+
const IconWrapper = styled.div(_t5$1 || (_t5$1 = _$1`
|
|
1450
|
+
font-size: 18px;
|
|
1451
|
+
`));
|
|
1452
|
+
const InputWrapper = styled.input(_t6$1 || (_t6$1 = _$1`
|
|
1453
|
+
margin: 0;
|
|
1454
|
+
padding: 0 0 0 4px;
|
|
1455
|
+
font-size: 14px;
|
|
1456
|
+
border: none;
|
|
1457
|
+
outline: none;
|
|
1458
|
+
color: white;
|
|
1459
|
+
width: 50px;
|
|
1460
|
+
width: 100%;
|
|
1461
|
+
background: #00985d;
|
|
1462
|
+
height: 22px;
|
|
1463
|
+
display: flex;
|
|
1464
|
+
align-items: center;
|
|
1465
|
+
`));
|
|
1466
|
+
const SetScoresToWrapper = styled.div(_t7$1 || (_t7$1 = _$1`
|
|
1467
|
+
display: flex;
|
|
1468
|
+
align-items: center;
|
|
1469
|
+
`));
|
|
1470
|
+
const SetScoresToInputWrapper = styled.div(_t8$1 || (_t8$1 = _$1`
|
|
1471
|
+
width: 50px;
|
|
1472
|
+
margin-left: 10px;
|
|
1473
|
+
`));
|
|
1474
|
+
const ACTION_TYPE = {
|
|
1475
|
+
clear: 'clear',
|
|
1476
|
+
sortAscending: 'sortAscending',
|
|
1477
|
+
sortDescending: 'sortDescending',
|
|
1478
|
+
set: 'set'
|
|
1479
|
+
};
|
|
1480
|
+
|
|
1481
|
+
const MatrixLabelEditableButton = props => {
|
|
1482
|
+
const {
|
|
1483
|
+
onLabelUpdate,
|
|
1484
|
+
value,
|
|
1485
|
+
resourceIndex,
|
|
1486
|
+
onAction,
|
|
1487
|
+
spellCheck
|
|
1488
|
+
} = props;
|
|
1489
|
+
const [labelValue, setLabelValue] = useState(null);
|
|
1490
|
+
const [scoreValue, setScoreValue] = useState('');
|
|
1491
|
+
const [showInput, setShowInput] = useState(false);
|
|
1492
|
+
const [anchorEl, setAnchorEl] = React__default.useState(null);
|
|
1493
|
+
const [scoresToRef] = React__default.useState( /*#__PURE__*/React__default.createRef());
|
|
1494
|
+
const open = Boolean(anchorEl);
|
|
1495
|
+
|
|
1496
|
+
const onActionClick = event => {
|
|
1497
|
+
setAnchorEl(event.currentTarget);
|
|
1498
|
+
};
|
|
1499
|
+
|
|
1500
|
+
const handleClose = e => {
|
|
1501
|
+
e.stopPropagation();
|
|
1502
|
+
setAnchorEl(null);
|
|
1503
|
+
setScoreValue('');
|
|
1504
|
+
};
|
|
1505
|
+
|
|
1506
|
+
const onClearScores = e => {
|
|
1507
|
+
handleClose(e);
|
|
1508
|
+
onAction({
|
|
1509
|
+
resourceIndex,
|
|
1510
|
+
actionType: ACTION_TYPE.clear
|
|
1511
|
+
});
|
|
1512
|
+
};
|
|
1513
|
+
|
|
1514
|
+
const onSetScoresAscending = e => {
|
|
1515
|
+
handleClose(e);
|
|
1516
|
+
onAction({
|
|
1517
|
+
resourceIndex,
|
|
1518
|
+
actionType: ACTION_TYPE.sortAscending
|
|
1519
|
+
});
|
|
1520
|
+
};
|
|
1521
|
+
|
|
1522
|
+
const onSetScoresDescending = e => {
|
|
1523
|
+
handleClose(e);
|
|
1524
|
+
onAction({
|
|
1525
|
+
resourceIndex,
|
|
1526
|
+
actionType: ACTION_TYPE.sortDescending
|
|
1527
|
+
});
|
|
1528
|
+
};
|
|
1529
|
+
|
|
1530
|
+
const onSetScores = value => {
|
|
1531
|
+
if (!isNumeric(value)) {
|
|
1532
|
+
setScoreValue('');
|
|
1533
|
+
return;
|
|
1534
|
+
}
|
|
1535
|
+
|
|
1536
|
+
const scoreValueNew = parseInt(value, 10);
|
|
1537
|
+
setScoreValue(scoreValueNew);
|
|
1538
|
+
onAction({
|
|
1539
|
+
resourceIndex,
|
|
1540
|
+
actionType: ACTION_TYPE.set,
|
|
1541
|
+
setValue: scoreValueNew
|
|
1542
|
+
});
|
|
1543
|
+
};
|
|
1544
|
+
|
|
1545
|
+
const onBlur = () => {
|
|
1546
|
+
const labeValueTrimmed = labelValue.trim();
|
|
1547
|
+
|
|
1548
|
+
if (labeValueTrimmed) {
|
|
1549
|
+
onLabelUpdate(labeValueTrimmed);
|
|
1550
|
+
}
|
|
1551
|
+
|
|
1552
|
+
setLabelValue(null);
|
|
1553
|
+
setShowInput(false);
|
|
1554
|
+
};
|
|
1555
|
+
|
|
1556
|
+
const onShowInput = () => {
|
|
1557
|
+
setShowInput(true);
|
|
1558
|
+
setLabelValue(value);
|
|
1559
|
+
};
|
|
1560
|
+
|
|
1561
|
+
const onSetScoreToFocus = () => {
|
|
1562
|
+
scoresToRef.current.focus();
|
|
1563
|
+
};
|
|
1564
|
+
|
|
1565
|
+
return /*#__PURE__*/React__default.createElement(MatrixEditableButtonWrapper, null, /*#__PURE__*/React__default.createElement(MatrixEditableButtonContent, null, showInput ? /*#__PURE__*/React__default.createElement(InputWrapper, {
|
|
1566
|
+
autoFocus: true,
|
|
1567
|
+
value: labelValue,
|
|
1568
|
+
onChange: e => setLabelValue(e.target.value),
|
|
1569
|
+
onBlur: onBlur,
|
|
1570
|
+
spellCheck: spellCheck
|
|
1571
|
+
}) : /*#__PURE__*/React__default.createElement(MatrixEditableButtonText, {
|
|
1572
|
+
onClick: onShowInput
|
|
1573
|
+
}, value)), /*#__PURE__*/React__default.createElement(MatrixEditableButtonActions, {
|
|
1574
|
+
onClick: onActionClick
|
|
1575
|
+
}, /*#__PURE__*/React__default.createElement(IconWrapper, null, /*#__PURE__*/React__default.createElement(KeyboardArrowDownIcon, {
|
|
1576
|
+
fontSize: "inherit"
|
|
1577
|
+
})), /*#__PURE__*/React__default.createElement(Menu, {
|
|
1578
|
+
anchorEl: anchorEl,
|
|
1579
|
+
open: open,
|
|
1580
|
+
onClose: handleClose
|
|
1581
|
+
}, /*#__PURE__*/React__default.createElement(MenuItem, {
|
|
1582
|
+
key: "item1",
|
|
1583
|
+
selected: false,
|
|
1584
|
+
onClick: onClearScores
|
|
1585
|
+
}, "Clear Scores"), /*#__PURE__*/React__default.createElement(MenuItem, {
|
|
1586
|
+
key: "item2",
|
|
1587
|
+
selected: false,
|
|
1588
|
+
onClick: onSetScoresAscending
|
|
1589
|
+
}, "Set Scores Ascending"), /*#__PURE__*/React__default.createElement(MenuItem, {
|
|
1590
|
+
key: "item3",
|
|
1591
|
+
selected: false,
|
|
1592
|
+
onClick: onSetScoresDescending
|
|
1593
|
+
}, "Set Scores Descending"), /*#__PURE__*/React__default.createElement(MenuItem, {
|
|
1594
|
+
key: "item4",
|
|
1595
|
+
selected: false
|
|
1596
|
+
}, /*#__PURE__*/React__default.createElement(SetScoresToWrapper, null, /*#__PURE__*/React__default.createElement("p", {
|
|
1597
|
+
onClick: onSetScoreToFocus
|
|
1598
|
+
}, "Set Scores To"), /*#__PURE__*/React__default.createElement(SetScoresToInputWrapper, null, /*#__PURE__*/React__default.createElement(NumericInput, {
|
|
1599
|
+
onFieldUpdate: onSetScores,
|
|
1600
|
+
name: 'setScoreTo',
|
|
1601
|
+
placeholder: "#",
|
|
1602
|
+
fieldValue: {
|
|
1603
|
+
value: scoreValue,
|
|
1604
|
+
ref: scoresToRef
|
|
1605
|
+
}
|
|
1606
|
+
})))))));
|
|
1607
|
+
};
|
|
1608
|
+
|
|
1609
|
+
MatrixLabelEditableButton.propTypes = {
|
|
1610
|
+
value: PropTypes.string.isRequired,
|
|
1611
|
+
resourceIndex: PropTypes.number.isRequired,
|
|
1612
|
+
onLabelUpdate: PropTypes.func.isRequired,
|
|
1613
|
+
onAction: PropTypes.func.isRequired,
|
|
1614
|
+
spellCheck: PropTypes.bool
|
|
1615
|
+
};
|
|
1616
|
+
|
|
1617
|
+
let _ = t => t,
|
|
1618
|
+
_t,
|
|
1619
|
+
_t2,
|
|
1620
|
+
_t3,
|
|
1621
|
+
_t4,
|
|
1622
|
+
_t5,
|
|
1623
|
+
_t6,
|
|
1624
|
+
_t7,
|
|
1625
|
+
_t8,
|
|
1626
|
+
_t9,
|
|
1627
|
+
_t10,
|
|
1628
|
+
_t11;
|
|
1629
|
+
const columnWidth = '120px';
|
|
1630
|
+
const ScoringContainer = styled.div(_t || (_t = _`
|
|
1631
|
+
display: grid;
|
|
1632
|
+
grid-template-columns: min-content min-content auto;
|
|
1633
|
+
`));
|
|
1634
|
+
const MatrixColumns = styled.div(_t2 || (_t2 = _`
|
|
1635
|
+
display: flex;
|
|
1636
|
+
justify-content: space-between;
|
|
1637
|
+
padding: 5px;
|
|
1638
|
+
`));
|
|
1639
|
+
const ColumnLabelWrapper = styled.div(_t3 || (_t3 = _`
|
|
1640
|
+
width: ${0};
|
|
1641
|
+
display: flex;
|
|
1642
|
+
align-items: center;
|
|
1643
|
+
justify-content: center;
|
|
1644
|
+
`), columnWidth);
|
|
1645
|
+
const RowLabelWrapper = styled.div(_t4 || (_t4 = _`
|
|
1646
|
+
width: 200px;
|
|
1647
|
+
display: flex;
|
|
1648
|
+
align-items: center;
|
|
1649
|
+
justify-content: center;
|
|
1650
|
+
`));
|
|
1651
|
+
const ValueRowWrapper = styled.div(_t5 || (_t5 = _`
|
|
1652
|
+
display: flex;
|
|
1653
|
+
justify-content: space-between;
|
|
1654
|
+
`));
|
|
1655
|
+
const ValueItemWrapper = styled.div(_t6 || (_t6 = _`
|
|
1656
|
+
width: ${0};
|
|
1657
|
+
height: 50px;
|
|
1658
|
+
margin: 1px;
|
|
1659
|
+
display: flex;
|
|
1660
|
+
align-items: center;
|
|
1661
|
+
justify-content: center;
|
|
1662
|
+
`), columnWidth);
|
|
1663
|
+
const ScoringRows = styled.div(_t7 || (_t7 = _`
|
|
1664
|
+
display: flex;
|
|
1665
|
+
flex-direction: column;
|
|
1666
|
+
justify-content: space-between;
|
|
1667
|
+
padding: 5px;
|
|
1668
|
+
`));
|
|
1669
|
+
const ScoringNumberInputWrapper = styled.div(_t8 || (_t8 = _`
|
|
1670
|
+
width: 60px;
|
|
1671
|
+
justify-self: center;
|
|
1672
|
+
align-self: center;
|
|
1673
|
+
`));
|
|
1674
|
+
const GridSeparatorHorizontal = styled.div(_t9 || (_t9 = _`
|
|
1675
|
+
background: gray;
|
|
1676
|
+
width: 100%;
|
|
1677
|
+
height: 1px;
|
|
1678
|
+
`));
|
|
1679
|
+
const GridSeparatorVertical = styled.div(_t10 || (_t10 = _`
|
|
1680
|
+
background: gray;
|
|
1681
|
+
width: 1px;
|
|
1682
|
+
height: 100%;
|
|
1683
|
+
`));
|
|
1684
|
+
const Content = styled.div(_t11 || (_t11 = _`
|
|
1685
|
+
padding: 5px;
|
|
1686
|
+
`));
|
|
1687
|
+
|
|
1688
|
+
const MatrixValues = props => {
|
|
1689
|
+
const {
|
|
1690
|
+
model,
|
|
1691
|
+
onChangeModel
|
|
1692
|
+
} = props;
|
|
1693
|
+
const {
|
|
1694
|
+
rowLabels,
|
|
1695
|
+
columnLabels,
|
|
1696
|
+
matrixValues,
|
|
1697
|
+
spellCheckEnabled
|
|
1698
|
+
} = model;
|
|
1699
|
+
|
|
1700
|
+
const onSetMatrixValue = (matrixValueIndex, value) => {
|
|
1701
|
+
const matrixValuesClone = _extends({}, matrixValues);
|
|
1702
|
+
|
|
1703
|
+
if (isNumeric(value)) {
|
|
1704
|
+
matrixValuesClone[matrixValueIndex] = parseInt(value, 10);
|
|
1705
|
+
} else {
|
|
1706
|
+
delete matrixValuesClone[matrixValueIndex];
|
|
1707
|
+
}
|
|
1708
|
+
|
|
1709
|
+
onChangeModel(_extends({}, model, {
|
|
1710
|
+
matrixValues: matrixValuesClone
|
|
1711
|
+
}));
|
|
1712
|
+
};
|
|
1713
|
+
|
|
1714
|
+
const onSetColumnLabel = (index, labelValue) => {
|
|
1715
|
+
const columnLabelsClone = [...columnLabels];
|
|
1716
|
+
columnLabelsClone[index] = labelValue;
|
|
1717
|
+
onChangeModel(_extends({}, model, {
|
|
1718
|
+
columnLabels: columnLabelsClone
|
|
1719
|
+
}));
|
|
1720
|
+
};
|
|
1721
|
+
|
|
1722
|
+
const onSetRowLabel = (index, labelValue) => {
|
|
1723
|
+
const rowLabelsClone = [...rowLabels];
|
|
1724
|
+
rowLabelsClone[index] = labelValue;
|
|
1725
|
+
onChangeModel(_extends({}, model, {
|
|
1726
|
+
rowLabels: rowLabelsClone
|
|
1727
|
+
}));
|
|
1728
|
+
};
|
|
1729
|
+
|
|
1730
|
+
const onActionByColumn = ({
|
|
1731
|
+
resourceIndex,
|
|
1732
|
+
actionType,
|
|
1733
|
+
setValue
|
|
1734
|
+
}) => {
|
|
1735
|
+
const columnLabelIndex = resourceIndex;
|
|
1736
|
+
|
|
1737
|
+
const matrixValuesClone = _extends({}, matrixValues);
|
|
1738
|
+
|
|
1739
|
+
rowLabels.forEach((rowLabel, rowLabelIndex) => {
|
|
1740
|
+
switch (actionType) {
|
|
1741
|
+
case ACTION_TYPE.clear:
|
|
1742
|
+
delete matrixValuesClone[`${rowLabelIndex}-${columnLabelIndex}`];
|
|
1743
|
+
break;
|
|
1744
|
+
|
|
1745
|
+
case ACTION_TYPE.sortAscending:
|
|
1746
|
+
matrixValuesClone[`${rowLabelIndex}-${columnLabelIndex}`] = rowLabelIndex + 1;
|
|
1747
|
+
break;
|
|
1748
|
+
|
|
1749
|
+
case ACTION_TYPE.sortDescending:
|
|
1750
|
+
matrixValuesClone[`${rowLabelIndex}-${columnLabelIndex}`] = rowLabels.length - rowLabelIndex;
|
|
1751
|
+
break;
|
|
1752
|
+
|
|
1753
|
+
case ACTION_TYPE.set:
|
|
1754
|
+
matrixValuesClone[`${rowLabelIndex}-${columnLabelIndex}`] = setValue;
|
|
1755
|
+
break;
|
|
1756
|
+
|
|
1757
|
+
default:
|
|
1758
|
+
throw 'Incorrect actionType';
|
|
1759
|
+
}
|
|
1760
|
+
});
|
|
1761
|
+
onChangeModel(_extends({}, model, {
|
|
1762
|
+
matrixValues: matrixValuesClone
|
|
1763
|
+
}));
|
|
1764
|
+
};
|
|
1765
|
+
|
|
1766
|
+
const onActionByRow = ({
|
|
1767
|
+
resourceIndex,
|
|
1768
|
+
actionType,
|
|
1769
|
+
setValue
|
|
1770
|
+
}) => {
|
|
1771
|
+
const rowLabelIndex = resourceIndex;
|
|
1772
|
+
|
|
1773
|
+
const matrixValuesClone = _extends({}, matrixValues);
|
|
1774
|
+
|
|
1775
|
+
columnLabels.forEach((columnLabel, columnLabelIndex) => {
|
|
1776
|
+
switch (actionType) {
|
|
1777
|
+
case ACTION_TYPE.clear:
|
|
1778
|
+
delete matrixValuesClone[`${rowLabelIndex}-${columnLabelIndex}`];
|
|
1779
|
+
break;
|
|
1780
|
+
|
|
1781
|
+
case ACTION_TYPE.sortAscending:
|
|
1782
|
+
matrixValuesClone[`${rowLabelIndex}-${columnLabelIndex}`] = rowLabelIndex + 1;
|
|
1783
|
+
break;
|
|
1784
|
+
|
|
1785
|
+
case ACTION_TYPE.sortDescending:
|
|
1786
|
+
matrixValuesClone[`${rowLabelIndex}-${columnLabelIndex}`] = rowLabels.length - rowLabelIndex;
|
|
1787
|
+
break;
|
|
1788
|
+
|
|
1789
|
+
case ACTION_TYPE.set:
|
|
1790
|
+
matrixValuesClone[`${rowLabelIndex}-${columnLabelIndex}`] = setValue;
|
|
1791
|
+
break;
|
|
1792
|
+
|
|
1793
|
+
default:
|
|
1794
|
+
throw 'Incorrect actionType';
|
|
1795
|
+
}
|
|
1796
|
+
});
|
|
1797
|
+
onChangeModel(_extends({}, model, {
|
|
1798
|
+
matrixValues: matrixValuesClone
|
|
1799
|
+
}));
|
|
1800
|
+
};
|
|
1801
|
+
|
|
1802
|
+
return /*#__PURE__*/React__default.createElement(ScoringContainer, null, /*#__PURE__*/React__default.createElement("div", null), /*#__PURE__*/React__default.createElement(GridSeparatorVertical, null), /*#__PURE__*/React__default.createElement(MatrixColumns, null, columnLabels.map((value, columnLabelIndex) => /*#__PURE__*/React__default.createElement(ColumnLabelWrapper, {
|
|
1803
|
+
key: columnLabelIndex
|
|
1804
|
+
}, /*#__PURE__*/React__default.createElement(MatrixLabelEditableButton, {
|
|
1805
|
+
resourceIndex: columnLabelIndex,
|
|
1806
|
+
onAction: onActionByColumn,
|
|
1807
|
+
value: value,
|
|
1808
|
+
onLabelUpdate: labelValue => onSetColumnLabel(columnLabelIndex, labelValue),
|
|
1809
|
+
spellCheck: spellCheckEnabled
|
|
1810
|
+
})))), /*#__PURE__*/React__default.createElement(GridSeparatorHorizontal, null), /*#__PURE__*/React__default.createElement(GridSeparatorVertical, null), /*#__PURE__*/React__default.createElement(GridSeparatorHorizontal, null), /*#__PURE__*/React__default.createElement(ScoringRows, null, rowLabels.map((value, rowLabelIndex) => /*#__PURE__*/React__default.createElement(RowLabelWrapper, {
|
|
1811
|
+
key: rowLabelIndex
|
|
1812
|
+
}, /*#__PURE__*/React__default.createElement(MatrixLabelEditableButton, {
|
|
1813
|
+
resourceIndex: rowLabelIndex,
|
|
1814
|
+
onAction: onActionByRow,
|
|
1815
|
+
value: value,
|
|
1816
|
+
onLabelUpdate: labelValue => onSetRowLabel(rowLabelIndex, labelValue),
|
|
1817
|
+
spellCheck: spellCheckEnabled
|
|
1818
|
+
})))), /*#__PURE__*/React__default.createElement(GridSeparatorVertical, null), /*#__PURE__*/React__default.createElement(Content, null, rowLabels.map((row, rowIndex) => {
|
|
1819
|
+
return /*#__PURE__*/React__default.createElement(ValueRowWrapper, {
|
|
1820
|
+
key: rowIndex
|
|
1821
|
+
}, columnLabels.map((column, entryIndex) => {
|
|
1822
|
+
const matrixValueIndex = `${rowIndex}-${entryIndex}`;
|
|
1823
|
+
return /*#__PURE__*/React__default.createElement(ValueItemWrapper, {
|
|
1824
|
+
key: entryIndex
|
|
1825
|
+
}, /*#__PURE__*/React__default.createElement(ScoringNumberInputWrapper, null, /*#__PURE__*/React__default.createElement(NumericInput, {
|
|
1826
|
+
onFieldUpdate: e => onSetMatrixValue(matrixValueIndex, e),
|
|
1827
|
+
name: matrixValueIndex,
|
|
1828
|
+
placeholder: "#",
|
|
1829
|
+
fieldValue: {
|
|
1830
|
+
value: isNumeric(matrixValues[matrixValueIndex]) ? matrixValues[matrixValueIndex] : ''
|
|
1831
|
+
}
|
|
1832
|
+
})));
|
|
1833
|
+
}));
|
|
1834
|
+
})));
|
|
1835
|
+
};
|
|
1836
|
+
|
|
1837
|
+
MatrixValues.propTypes = {
|
|
1838
|
+
model: PropTypes.object.isRequired,
|
|
1839
|
+
onChangeModel: PropTypes.func.isRequired
|
|
1840
|
+
};
|
|
1841
|
+
|
|
1842
|
+
const {
|
|
1843
|
+
Panel,
|
|
1844
|
+
toggle,
|
|
1845
|
+
radio
|
|
1846
|
+
} = settings;
|
|
1847
|
+
|
|
1848
|
+
const styles = theme => ({
|
|
1849
|
+
promptHolder: {
|
|
1850
|
+
width: '100%',
|
|
1851
|
+
paddingTop: theme.spacing.unit * 2,
|
|
1852
|
+
marginBottom: theme.spacing.unit * 2
|
|
1853
|
+
},
|
|
1854
|
+
matrixHeaderOptionsHolder: {
|
|
1855
|
+
display: 'flex',
|
|
1856
|
+
flexWrap: 'wrap',
|
|
1857
|
+
width: '100%',
|
|
1858
|
+
paddingBottom: theme.spacing.unit * 2.5,
|
|
1859
|
+
justifyContent: 'space-around'
|
|
1860
|
+
},
|
|
1861
|
+
errorText: {
|
|
1862
|
+
fontSize: theme.typography.fontSize - 2,
|
|
1863
|
+
color: theme.palette.error.main,
|
|
1864
|
+
paddingTop: theme.spacing.unit
|
|
1865
|
+
}
|
|
1866
|
+
});
|
|
1867
|
+
|
|
1868
|
+
const Design = withStyles(styles)(props => {
|
|
1869
|
+
const {
|
|
1870
|
+
classes,
|
|
1871
|
+
model,
|
|
1872
|
+
configuration,
|
|
1873
|
+
onPromptChanged,
|
|
1874
|
+
imageSupport,
|
|
1875
|
+
uploadSoundSupport,
|
|
1876
|
+
onChangeModel,
|
|
1877
|
+
onConfigurationChanged,
|
|
1878
|
+
onTeacherInstructionsChanged
|
|
1879
|
+
} = props;
|
|
1880
|
+
const {
|
|
1881
|
+
baseInputConfiguration = {},
|
|
1882
|
+
contentDimensions = {},
|
|
1883
|
+
prompt = {},
|
|
1884
|
+
scoringType = {},
|
|
1885
|
+
settingsPanelDisabled,
|
|
1886
|
+
spellCheck = {},
|
|
1887
|
+
teacherInstructions = {}
|
|
1888
|
+
} = configuration || {};
|
|
1889
|
+
const {
|
|
1890
|
+
errors = {},
|
|
1891
|
+
extraCSSRules,
|
|
1892
|
+
teacherInstructionsEnabled,
|
|
1893
|
+
spellCheckEnabled
|
|
1894
|
+
} = model || {};
|
|
1895
|
+
const {
|
|
1896
|
+
prompt: promptError,
|
|
1897
|
+
teacherInstructions: teacherInstructionsError
|
|
1898
|
+
} = errors;
|
|
1899
|
+
const panelProperties = {
|
|
1900
|
+
teacherInstructionsEnabled: teacherInstructions.settings && toggle(teacherInstructions.label),
|
|
1901
|
+
spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label),
|
|
1902
|
+
scoringType: scoringType.settings && radio(scoringType.label, ['auto', 'rubric'])
|
|
1903
|
+
};
|
|
1904
|
+
|
|
1905
|
+
const getPluginProps = (props = {}) => _extends({}, baseInputConfiguration, props);
|
|
1906
|
+
|
|
1907
|
+
return /*#__PURE__*/React__default.createElement(layout.ConfigLayout, {
|
|
1908
|
+
extraCSSRules: extraCSSRules,
|
|
1909
|
+
dimensions: contentDimensions,
|
|
1910
|
+
hideSettings: settingsPanelDisabled,
|
|
1911
|
+
settings: /*#__PURE__*/React__default.createElement(Panel, {
|
|
1912
|
+
model: model,
|
|
1913
|
+
onChangeModel: onChangeModel,
|
|
1914
|
+
configuration: configuration,
|
|
1915
|
+
onChangeConfiguration: onConfigurationChanged,
|
|
1916
|
+
groups: {
|
|
1917
|
+
Properties: panelProperties
|
|
1918
|
+
}
|
|
1919
|
+
})
|
|
1920
|
+
}, teacherInstructionsEnabled && /*#__PURE__*/React__default.createElement(InputContainer, {
|
|
1921
|
+
label: teacherInstructions.label,
|
|
1922
|
+
className: classes.promptHolder
|
|
1923
|
+
}, /*#__PURE__*/React__default.createElement(EditableHtml, {
|
|
1924
|
+
className: classes.prompt,
|
|
1925
|
+
markup: model.teacherInstructions || '',
|
|
1926
|
+
onChange: onTeacherInstructionsChanged,
|
|
1927
|
+
imageSupport: imageSupport,
|
|
1928
|
+
error: teacherInstructionsError,
|
|
1929
|
+
pluginProps: getPluginProps(teacherInstructions == null ? void 0 : teacherInstructions.inputConfiguration),
|
|
1930
|
+
nonEmpty: false,
|
|
1931
|
+
spellCheck: spellCheckEnabled,
|
|
1932
|
+
uploadSoundSupport: uploadSoundSupport
|
|
1933
|
+
}), teacherInstructionsError && /*#__PURE__*/React__default.createElement("div", {
|
|
1934
|
+
className: classes.errorText
|
|
1935
|
+
}, teacherInstructionsError)), /*#__PURE__*/React__default.createElement(InputContainer, {
|
|
1936
|
+
label: prompt.label,
|
|
1937
|
+
className: classes.promptHolder
|
|
1938
|
+
}, /*#__PURE__*/React__default.createElement(EditableHtml, {
|
|
1939
|
+
className: classes.prompt,
|
|
1940
|
+
markup: model.prompt,
|
|
1941
|
+
onChange: onPromptChanged,
|
|
1942
|
+
imageSupport: imageSupport,
|
|
1943
|
+
error: promptError,
|
|
1944
|
+
pluginProps: getPluginProps(prompt == null ? void 0 : prompt.inputConfiguration),
|
|
1945
|
+
nonEmpty: !prompt.settings,
|
|
1946
|
+
spellCheck: spellCheckEnabled,
|
|
1947
|
+
uploadSoundSupport: uploadSoundSupport,
|
|
1948
|
+
disableUnderline: true
|
|
1949
|
+
}), promptError && /*#__PURE__*/React__default.createElement("div", {
|
|
1950
|
+
className: classes.errorText
|
|
1951
|
+
}, promptError)), /*#__PURE__*/React__default.createElement("div", {
|
|
1952
|
+
className: classes.matrixHeaderOptionsHolder
|
|
1953
|
+
}, /*#__PURE__*/React__default.createElement(MatrixColumnsRowInput, {
|
|
1954
|
+
model: model,
|
|
1955
|
+
onChangeModel: onChangeModel
|
|
1956
|
+
}), /*#__PURE__*/React__default.createElement(MatrixColumnsSizeHeaderInput, {
|
|
1957
|
+
model: model,
|
|
1958
|
+
onChangeModel: onChangeModel
|
|
1959
|
+
}), /*#__PURE__*/React__default.createElement(MatrixLabelTypeHeaderInput$1, {
|
|
1960
|
+
model: model,
|
|
1961
|
+
onChangeModel: onChangeModel
|
|
1962
|
+
})), /*#__PURE__*/React__default.createElement(MatrixValues, {
|
|
1963
|
+
model: model,
|
|
1964
|
+
onChangeModel: onChangeModel
|
|
1965
|
+
}));
|
|
1966
|
+
});
|
|
1967
|
+
class Main extends React__default.Component {
|
|
1968
|
+
constructor(...args) {
|
|
1969
|
+
super(...args);
|
|
1970
|
+
|
|
1971
|
+
this.onPromptChanged = prompt => {
|
|
1972
|
+
this.props.onModelChanged(_extends({}, this.props.model, {
|
|
1973
|
+
prompt
|
|
1974
|
+
}));
|
|
1975
|
+
};
|
|
1976
|
+
|
|
1977
|
+
this.onChangeModel = data => {
|
|
1978
|
+
this.props.onModelChanged(_extends({}, this.props.model, data));
|
|
1979
|
+
};
|
|
1980
|
+
|
|
1981
|
+
this.onTeacherInstructionsChanged = teacherInstructions => {
|
|
1982
|
+
this.props.onModelChanged(_extends({}, this.props.model, {
|
|
1983
|
+
teacherInstructions
|
|
1984
|
+
}));
|
|
1985
|
+
};
|
|
1986
|
+
}
|
|
1987
|
+
|
|
1988
|
+
render() {
|
|
1989
|
+
return /*#__PURE__*/React__default.createElement(Design, _extends({}, this.props, {
|
|
1990
|
+
onChangeModel: this.props.onModelChanged,
|
|
1991
|
+
onPromptChanged: this.onPromptChanged,
|
|
1992
|
+
onTeacherInstructionsChanged: this.onTeacherInstructionsChanged
|
|
1993
|
+
}));
|
|
1994
|
+
}
|
|
1995
|
+
|
|
1996
|
+
}
|
|
1997
|
+
Main.propTypes = {
|
|
1998
|
+
model: PropTypes.object.isRequired,
|
|
1999
|
+
disableSidePanel: PropTypes.bool,
|
|
2000
|
+
onModelChanged: PropTypes.func.isRequired,
|
|
2001
|
+
onConfigurationChanged: PropTypes.func.isRequired,
|
|
2002
|
+
classes: PropTypes.object.isRequired,
|
|
2003
|
+
imageSupport: PropTypes.shape({
|
|
2004
|
+
add: PropTypes.func.isRequired,
|
|
2005
|
+
delete: PropTypes.func.isRequired
|
|
2006
|
+
})
|
|
2007
|
+
};
|
|
2008
|
+
const Styled = withStyles(styles)(Main);
|
|
2009
|
+
|
|
2010
|
+
/** NOTE: teacherInstructions, studentInstructions, rationale & scoringType
|
|
2011
|
+
* functionalities are not defined yet - the value for those can belong to
|
|
2012
|
+
* model or to configure
|
|
2013
|
+
*/
|
|
2014
|
+
var sensibleDefaults = {
|
|
2015
|
+
model: {
|
|
2016
|
+
columnLabels: ['COLUMN 1', 'COLUMN 2', 'COLUMN 3'],
|
|
2017
|
+
labelType: 'agreement',
|
|
2018
|
+
matrixValues: {},
|
|
2019
|
+
prompt: '',
|
|
2020
|
+
promptEnabled: true,
|
|
2021
|
+
rowLabels: ['STATEMENT 1', 'STATEMENT 2'],
|
|
2022
|
+
teacherInstructions: '',
|
|
2023
|
+
teacherInstructionsEnabled: true
|
|
2024
|
+
},
|
|
2025
|
+
configuration: {
|
|
2026
|
+
baseInputConfiguration: {
|
|
2027
|
+
audio: {
|
|
2028
|
+
disabled: false
|
|
2029
|
+
},
|
|
2030
|
+
video: {
|
|
2031
|
+
disabled: false
|
|
2032
|
+
},
|
|
2033
|
+
image: {
|
|
2034
|
+
disabled: false
|
|
2035
|
+
},
|
|
2036
|
+
textAlign: {
|
|
2037
|
+
disabled: true
|
|
2038
|
+
},
|
|
2039
|
+
showParagraphs: {
|
|
2040
|
+
disabled: false
|
|
2041
|
+
},
|
|
2042
|
+
separateParagraphs: {
|
|
2043
|
+
disabled: true
|
|
2044
|
+
}
|
|
2045
|
+
},
|
|
2046
|
+
prompt: {
|
|
2047
|
+
settings: true,
|
|
2048
|
+
label: 'Prompt',
|
|
2049
|
+
inputConfiguration: {
|
|
2050
|
+
audio: {
|
|
2051
|
+
disabled: false
|
|
2052
|
+
},
|
|
2053
|
+
video: {
|
|
2054
|
+
disabled: false
|
|
2055
|
+
},
|
|
2056
|
+
image: {
|
|
2057
|
+
disabled: false
|
|
2058
|
+
}
|
|
2059
|
+
},
|
|
2060
|
+
required: false
|
|
2061
|
+
},
|
|
2062
|
+
settingsPanelDisabled: false,
|
|
2063
|
+
spellCheck: {
|
|
2064
|
+
label: 'Spellcheck',
|
|
2065
|
+
settings: false,
|
|
2066
|
+
enabled: true
|
|
2067
|
+
},
|
|
2068
|
+
teacherInstructions: {
|
|
2069
|
+
settings: true,
|
|
2070
|
+
label: 'Teacher Instructions',
|
|
2071
|
+
inputConfiguration: {
|
|
2072
|
+
audio: {
|
|
2073
|
+
disabled: false
|
|
2074
|
+
},
|
|
2075
|
+
video: {
|
|
2076
|
+
disabled: false
|
|
2077
|
+
},
|
|
2078
|
+
image: {
|
|
2079
|
+
disabled: false
|
|
2080
|
+
}
|
|
2081
|
+
},
|
|
2082
|
+
required: false
|
|
2083
|
+
}
|
|
2084
|
+
}
|
|
2085
|
+
};
|
|
2086
|
+
|
|
2087
|
+
const log = debug('matrix:configure');
|
|
2088
|
+
|
|
2089
|
+
const prepareCustomizationObject = (config, model) => {
|
|
2090
|
+
const configuration = defaults(config, sensibleDefaults.configuration);
|
|
2091
|
+
return {
|
|
2092
|
+
configuration,
|
|
2093
|
+
model
|
|
2094
|
+
};
|
|
2095
|
+
};
|
|
2096
|
+
|
|
2097
|
+
class Matrix extends HTMLElement {
|
|
2098
|
+
constructor() {
|
|
2099
|
+
super();
|
|
2100
|
+
this._model = Matrix.createDefaultModel();
|
|
2101
|
+
this._configuration = sensibleDefaults.configuration;
|
|
2102
|
+
this.onModelChanged = this.onModelChanged.bind(this);
|
|
2103
|
+
this.onConfigurationChanged = this.onConfigurationChanged.bind(this);
|
|
2104
|
+
}
|
|
2105
|
+
|
|
2106
|
+
set model(s) {
|
|
2107
|
+
this._model = Matrix.createDefaultModel(s);
|
|
2108
|
+
|
|
2109
|
+
this._render();
|
|
2110
|
+
}
|
|
2111
|
+
|
|
2112
|
+
set configuration(c) {
|
|
2113
|
+
const info = prepareCustomizationObject(c, this._model);
|
|
2114
|
+
this.onModelChanged(info.model);
|
|
2115
|
+
this._configuration = info.configuration;
|
|
2116
|
+
|
|
2117
|
+
this._render();
|
|
2118
|
+
}
|
|
2119
|
+
|
|
2120
|
+
set disableSidePanel(s) {
|
|
2121
|
+
this._disableSidePanel = s;
|
|
2122
|
+
|
|
2123
|
+
this._render();
|
|
2124
|
+
}
|
|
2125
|
+
|
|
2126
|
+
dispatchModelUpdated(reset) {
|
|
2127
|
+
const resetValue = !!reset;
|
|
2128
|
+
this.dispatchEvent(new ModelUpdatedEvent(this._model, resetValue));
|
|
2129
|
+
}
|
|
2130
|
+
|
|
2131
|
+
onModelChanged(m, reset) {
|
|
2132
|
+
this._model = m;
|
|
2133
|
+
|
|
2134
|
+
this._render();
|
|
2135
|
+
|
|
2136
|
+
this.dispatchModelUpdated(reset);
|
|
2137
|
+
}
|
|
2138
|
+
|
|
2139
|
+
onConfigurationChanged(c) {
|
|
2140
|
+
this._configuration = prepareCustomizationObject(c, this._model).configuration;
|
|
2141
|
+
|
|
2142
|
+
if (this._model) {
|
|
2143
|
+
this.onModelChanged(this._model);
|
|
2144
|
+
}
|
|
2145
|
+
|
|
2146
|
+
this._render();
|
|
2147
|
+
}
|
|
2148
|
+
|
|
2149
|
+
insertSound(handler) {
|
|
2150
|
+
this.dispatchEvent(new InsertSoundEvent(handler));
|
|
2151
|
+
}
|
|
2152
|
+
|
|
2153
|
+
onDeleteSound(src, done) {
|
|
2154
|
+
this.dispatchEvent(new DeleteSoundEvent(src, done));
|
|
2155
|
+
}
|
|
2156
|
+
|
|
2157
|
+
_render() {
|
|
2158
|
+
log('_render');
|
|
2159
|
+
let element = /*#__PURE__*/React__default.createElement(Styled, {
|
|
2160
|
+
model: this._model,
|
|
2161
|
+
configuration: this._configuration,
|
|
2162
|
+
onModelChanged: this.onModelChanged,
|
|
2163
|
+
onConfigurationChanged: this.onConfigurationChanged,
|
|
2164
|
+
disableSidePanel: this._disableSidePanel,
|
|
2165
|
+
uploadSoundSupport: {
|
|
2166
|
+
add: this.insertSound.bind(this),
|
|
2167
|
+
delete: this.onDeleteSound.bind(this)
|
|
2168
|
+
}
|
|
2169
|
+
});
|
|
2170
|
+
ReactDOM.render(element, this);
|
|
2171
|
+
}
|
|
2172
|
+
|
|
2173
|
+
}
|
|
2174
|
+
|
|
2175
|
+
Matrix.createDefaultModel = (model = {}) => _extends({}, sensibleDefaults.model, model);
|
|
2176
|
+
|
|
2177
|
+
export { Matrix as default };
|
|
2178
|
+
//# sourceMappingURL=configure.js.map
|