@fluxo-dev/shell-printing 1.0.0 → 25.1.1
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/README.md +7 -0
- package/index.esm.d.ts +1 -0
- package/index.esm.js +4271 -0
- package/package.json +15 -7
- package/src/index.d.ts +2 -0
- package/src/lib/print-server/add-print-server.d.ts +5 -0
- package/src/lib/print-server/add-printer.d.ts +6 -0
- package/src/lib/print-server/index.d.ts +1 -0
- package/src/lib/print-server/manage-print-server.d.ts +4 -0
- package/src/lib/print-server/print-server-list.d.ts +1 -0
- package/src/lib/printer-chooser/index.d.ts +1 -0
- package/src/lib/printer-chooser/printer-chooser.d.ts +6 -0
package/index.esm.js
ADDED
|
@@ -0,0 +1,4271 @@
|
|
|
1
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import React, { forwardRef, createElement as createElement$1, useState, useEffect, useCallback } from 'react';
|
|
3
|
+
import { DataCard } from '@fluxo-dev/ui-components';
|
|
4
|
+
import { PrintServerType, PrintServerManagedType, FluxoClientSys, PrinterManufacturer, PrinterType } from '@fluxo-dev/api-client-base';
|
|
5
|
+
import { Stack, Text, TextInput, Select, NumberInput, Group, Button, LoadingOverlay, Badge, Menu, ActionIcon, Modal, Center, Drawer, Box, Loader } from '@mantine/core';
|
|
6
|
+
import { showNotification } from '@mantine/notifications';
|
|
7
|
+
|
|
8
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
9
|
+
|
|
10
|
+
function getDefaultExportFromCjs (x) {
|
|
11
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
var check = function (it) {
|
|
15
|
+
return it && it.Math === Math && it;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
|
|
19
|
+
var global$e =
|
|
20
|
+
// eslint-disable-next-line es/no-global-this -- safe
|
|
21
|
+
check(typeof globalThis == 'object' && globalThis) ||
|
|
22
|
+
check(typeof window == 'object' && window) ||
|
|
23
|
+
// eslint-disable-next-line no-restricted-globals -- safe
|
|
24
|
+
check(typeof self == 'object' && self) ||
|
|
25
|
+
check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
|
|
26
|
+
check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
|
|
27
|
+
// eslint-disable-next-line no-new-func -- fallback
|
|
28
|
+
(function () { return this; })() || Function('return this')();
|
|
29
|
+
|
|
30
|
+
var objectGetOwnPropertyDescriptor = {};
|
|
31
|
+
|
|
32
|
+
var fails$d = function (exec) {
|
|
33
|
+
try {
|
|
34
|
+
return !!exec();
|
|
35
|
+
} catch (error) {
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
var fails$c = fails$d;
|
|
41
|
+
|
|
42
|
+
// Detect IE8's incomplete defineProperty implementation
|
|
43
|
+
var descriptors = !fails$c(function () {
|
|
44
|
+
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
45
|
+
return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7;
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
var fails$b = fails$d;
|
|
49
|
+
|
|
50
|
+
var functionBindNative = !fails$b(function () {
|
|
51
|
+
// eslint-disable-next-line es/no-function-prototype-bind -- safe
|
|
52
|
+
var test = (function () { /* empty */ }).bind();
|
|
53
|
+
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
54
|
+
return typeof test != 'function' || test.hasOwnProperty('prototype');
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
var NATIVE_BIND$2 = functionBindNative;
|
|
58
|
+
|
|
59
|
+
var call$b = Function.prototype.call;
|
|
60
|
+
|
|
61
|
+
var functionCall = NATIVE_BIND$2 ? call$b.bind(call$b) : function () {
|
|
62
|
+
return call$b.apply(call$b, arguments);
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
var objectPropertyIsEnumerable = {};
|
|
66
|
+
|
|
67
|
+
var $propertyIsEnumerable = {}.propertyIsEnumerable;
|
|
68
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
69
|
+
var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
|
|
70
|
+
|
|
71
|
+
// Nashorn ~ JDK8 bug
|
|
72
|
+
var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
|
|
73
|
+
|
|
74
|
+
// `Object.prototype.propertyIsEnumerable` method implementation
|
|
75
|
+
// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
|
|
76
|
+
objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
|
|
77
|
+
var descriptor = getOwnPropertyDescriptor$1(this, V);
|
|
78
|
+
return !!descriptor && descriptor.enumerable;
|
|
79
|
+
} : $propertyIsEnumerable;
|
|
80
|
+
|
|
81
|
+
var createPropertyDescriptor$4 = function (bitmap, value) {
|
|
82
|
+
return {
|
|
83
|
+
enumerable: !(bitmap & 1),
|
|
84
|
+
configurable: !(bitmap & 2),
|
|
85
|
+
writable: !(bitmap & 4),
|
|
86
|
+
value: value
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
var NATIVE_BIND$1 = functionBindNative;
|
|
91
|
+
|
|
92
|
+
var FunctionPrototype$1 = Function.prototype;
|
|
93
|
+
var call$a = FunctionPrototype$1.call;
|
|
94
|
+
var uncurryThisWithBind = NATIVE_BIND$1 && FunctionPrototype$1.bind.bind(call$a, call$a);
|
|
95
|
+
|
|
96
|
+
var functionUncurryThis = NATIVE_BIND$1 ? uncurryThisWithBind : function (fn) {
|
|
97
|
+
return function () {
|
|
98
|
+
return call$a.apply(fn, arguments);
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
var uncurryThis$e = functionUncurryThis;
|
|
103
|
+
|
|
104
|
+
var toString$5 = uncurryThis$e({}.toString);
|
|
105
|
+
var stringSlice$2 = uncurryThis$e(''.slice);
|
|
106
|
+
|
|
107
|
+
var classofRaw$2 = function (it) {
|
|
108
|
+
return stringSlice$2(toString$5(it), 8, -1);
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
var uncurryThis$d = functionUncurryThis;
|
|
112
|
+
var fails$a = fails$d;
|
|
113
|
+
var classof$3 = classofRaw$2;
|
|
114
|
+
|
|
115
|
+
var $Object$4 = Object;
|
|
116
|
+
var split = uncurryThis$d(''.split);
|
|
117
|
+
|
|
118
|
+
// fallback for non-array-like ES3 and non-enumerable old V8 strings
|
|
119
|
+
var indexedObject = fails$a(function () {
|
|
120
|
+
// throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
|
|
121
|
+
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
122
|
+
return !$Object$4('z').propertyIsEnumerable(0);
|
|
123
|
+
}) ? function (it) {
|
|
124
|
+
return classof$3(it) === 'String' ? split(it, '') : $Object$4(it);
|
|
125
|
+
} : $Object$4;
|
|
126
|
+
|
|
127
|
+
// we can't use just `it == null` since of `document.all` special case
|
|
128
|
+
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
|
|
129
|
+
var isNullOrUndefined$3 = function (it) {
|
|
130
|
+
return it === null || it === undefined;
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
var isNullOrUndefined$2 = isNullOrUndefined$3;
|
|
134
|
+
|
|
135
|
+
var $TypeError$a = TypeError;
|
|
136
|
+
|
|
137
|
+
// `RequireObjectCoercible` abstract operation
|
|
138
|
+
// https://tc39.es/ecma262/#sec-requireobjectcoercible
|
|
139
|
+
var requireObjectCoercible$4 = function (it) {
|
|
140
|
+
if (isNullOrUndefined$2(it)) throw new $TypeError$a("Can't call method on " + it);
|
|
141
|
+
return it;
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
// toObject with fallback for non-array-like ES3 strings
|
|
145
|
+
var IndexedObject = indexedObject;
|
|
146
|
+
var requireObjectCoercible$3 = requireObjectCoercible$4;
|
|
147
|
+
|
|
148
|
+
var toIndexedObject$5 = function (it) {
|
|
149
|
+
return IndexedObject(requireObjectCoercible$3(it));
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
|
|
153
|
+
var documentAll = typeof document == 'object' && document.all;
|
|
154
|
+
|
|
155
|
+
// `IsCallable` abstract operation
|
|
156
|
+
// https://tc39.es/ecma262/#sec-iscallable
|
|
157
|
+
// eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing
|
|
158
|
+
var isCallable$g = typeof documentAll == 'undefined' && documentAll !== undefined ? function (argument) {
|
|
159
|
+
return typeof argument == 'function' || argument === documentAll;
|
|
160
|
+
} : function (argument) {
|
|
161
|
+
return typeof argument == 'function';
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
var isCallable$f = isCallable$g;
|
|
165
|
+
|
|
166
|
+
var isObject$8 = function (it) {
|
|
167
|
+
return typeof it == 'object' ? it !== null : isCallable$f(it);
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
var global$d = global$e;
|
|
171
|
+
var isCallable$e = isCallable$g;
|
|
172
|
+
|
|
173
|
+
var aFunction = function (argument) {
|
|
174
|
+
return isCallable$e(argument) ? argument : undefined;
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
var getBuiltIn$3 = function (namespace, method) {
|
|
178
|
+
return arguments.length < 2 ? aFunction(global$d[namespace]) : global$d[namespace] && global$d[namespace][method];
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
var uncurryThis$c = functionUncurryThis;
|
|
182
|
+
|
|
183
|
+
var objectIsPrototypeOf = uncurryThis$c({}.isPrototypeOf);
|
|
184
|
+
|
|
185
|
+
var engineUserAgent = typeof navigator != 'undefined' && String(navigator.userAgent) || '';
|
|
186
|
+
|
|
187
|
+
var global$c = global$e;
|
|
188
|
+
var userAgent = engineUserAgent;
|
|
189
|
+
|
|
190
|
+
var process$1 = global$c.process;
|
|
191
|
+
var Deno = global$c.Deno;
|
|
192
|
+
var versions = process$1 && process$1.versions || Deno && Deno.version;
|
|
193
|
+
var v8 = versions && versions.v8;
|
|
194
|
+
var match, version;
|
|
195
|
+
|
|
196
|
+
if (v8) {
|
|
197
|
+
match = v8.split('.');
|
|
198
|
+
// in old Chrome, versions of V8 isn't V8 = Chrome / 10
|
|
199
|
+
// but their correct versions are not interesting for us
|
|
200
|
+
version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
|
|
204
|
+
// so check `userAgent` even if `.v8` exists, but 0
|
|
205
|
+
if (!version && userAgent) {
|
|
206
|
+
match = userAgent.match(/Edge\/(\d+)/);
|
|
207
|
+
if (!match || match[1] >= 74) {
|
|
208
|
+
match = userAgent.match(/Chrome\/(\d+)/);
|
|
209
|
+
if (match) version = +match[1];
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
var engineV8Version = version;
|
|
214
|
+
|
|
215
|
+
/* eslint-disable es/no-symbol -- required for testing */
|
|
216
|
+
var V8_VERSION = engineV8Version;
|
|
217
|
+
var fails$9 = fails$d;
|
|
218
|
+
var global$b = global$e;
|
|
219
|
+
|
|
220
|
+
var $String$5 = global$b.String;
|
|
221
|
+
|
|
222
|
+
// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
|
|
223
|
+
var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$9(function () {
|
|
224
|
+
var symbol = Symbol('symbol detection');
|
|
225
|
+
// Chrome 38 Symbol has incorrect toString conversion
|
|
226
|
+
// `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
|
|
227
|
+
// nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will,
|
|
228
|
+
// of course, fail.
|
|
229
|
+
return !$String$5(symbol) || !(Object(symbol) instanceof Symbol) ||
|
|
230
|
+
// Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
|
|
231
|
+
!Symbol.sham && V8_VERSION && V8_VERSION < 41;
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
/* eslint-disable es/no-symbol -- required for testing */
|
|
235
|
+
var NATIVE_SYMBOL$2 = symbolConstructorDetection;
|
|
236
|
+
|
|
237
|
+
var useSymbolAsUid = NATIVE_SYMBOL$2
|
|
238
|
+
&& !Symbol.sham
|
|
239
|
+
&& typeof Symbol.iterator == 'symbol';
|
|
240
|
+
|
|
241
|
+
var getBuiltIn$2 = getBuiltIn$3;
|
|
242
|
+
var isCallable$d = isCallable$g;
|
|
243
|
+
var isPrototypeOf$4 = objectIsPrototypeOf;
|
|
244
|
+
var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
|
|
245
|
+
|
|
246
|
+
var $Object$3 = Object;
|
|
247
|
+
|
|
248
|
+
var isSymbol$2 = USE_SYMBOL_AS_UID$1 ? function (it) {
|
|
249
|
+
return typeof it == 'symbol';
|
|
250
|
+
} : function (it) {
|
|
251
|
+
var $Symbol = getBuiltIn$2('Symbol');
|
|
252
|
+
return isCallable$d($Symbol) && isPrototypeOf$4($Symbol.prototype, $Object$3(it));
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
var $String$4 = String;
|
|
256
|
+
|
|
257
|
+
var tryToString$3 = function (argument) {
|
|
258
|
+
try {
|
|
259
|
+
return $String$4(argument);
|
|
260
|
+
} catch (error) {
|
|
261
|
+
return 'Object';
|
|
262
|
+
}
|
|
263
|
+
};
|
|
264
|
+
|
|
265
|
+
var isCallable$c = isCallable$g;
|
|
266
|
+
var tryToString$2 = tryToString$3;
|
|
267
|
+
|
|
268
|
+
var $TypeError$9 = TypeError;
|
|
269
|
+
|
|
270
|
+
// `Assert: IsCallable(argument) is true`
|
|
271
|
+
var aCallable$6 = function (argument) {
|
|
272
|
+
if (isCallable$c(argument)) return argument;
|
|
273
|
+
throw new $TypeError$9(tryToString$2(argument) + ' is not a function');
|
|
274
|
+
};
|
|
275
|
+
|
|
276
|
+
var aCallable$5 = aCallable$6;
|
|
277
|
+
var isNullOrUndefined$1 = isNullOrUndefined$3;
|
|
278
|
+
|
|
279
|
+
// `GetMethod` abstract operation
|
|
280
|
+
// https://tc39.es/ecma262/#sec-getmethod
|
|
281
|
+
var getMethod$4 = function (V, P) {
|
|
282
|
+
var func = V[P];
|
|
283
|
+
return isNullOrUndefined$1(func) ? undefined : aCallable$5(func);
|
|
284
|
+
};
|
|
285
|
+
|
|
286
|
+
var call$9 = functionCall;
|
|
287
|
+
var isCallable$b = isCallable$g;
|
|
288
|
+
var isObject$7 = isObject$8;
|
|
289
|
+
|
|
290
|
+
var $TypeError$8 = TypeError;
|
|
291
|
+
|
|
292
|
+
// `OrdinaryToPrimitive` abstract operation
|
|
293
|
+
// https://tc39.es/ecma262/#sec-ordinarytoprimitive
|
|
294
|
+
var ordinaryToPrimitive$1 = function (input, pref) {
|
|
295
|
+
var fn, val;
|
|
296
|
+
if (pref === 'string' && isCallable$b(fn = input.toString) && !isObject$7(val = call$9(fn, input))) return val;
|
|
297
|
+
if (isCallable$b(fn = input.valueOf) && !isObject$7(val = call$9(fn, input))) return val;
|
|
298
|
+
if (pref !== 'string' && isCallable$b(fn = input.toString) && !isObject$7(val = call$9(fn, input))) return val;
|
|
299
|
+
throw new $TypeError$8("Can't convert object to primitive value");
|
|
300
|
+
};
|
|
301
|
+
|
|
302
|
+
var sharedStore = {exports: {}};
|
|
303
|
+
|
|
304
|
+
var isPure = false;
|
|
305
|
+
|
|
306
|
+
var global$a = global$e;
|
|
307
|
+
|
|
308
|
+
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
309
|
+
var defineProperty$5 = Object.defineProperty;
|
|
310
|
+
|
|
311
|
+
var defineGlobalProperty$3 = function (key, value) {
|
|
312
|
+
try {
|
|
313
|
+
defineProperty$5(global$a, key, { value: value, configurable: true, writable: true });
|
|
314
|
+
} catch (error) {
|
|
315
|
+
global$a[key] = value;
|
|
316
|
+
} return value;
|
|
317
|
+
};
|
|
318
|
+
|
|
319
|
+
var globalThis$1 = global$e;
|
|
320
|
+
var defineGlobalProperty$2 = defineGlobalProperty$3;
|
|
321
|
+
|
|
322
|
+
var SHARED = '__core-js_shared__';
|
|
323
|
+
var store$3 = sharedStore.exports = globalThis$1[SHARED] || defineGlobalProperty$2(SHARED, {});
|
|
324
|
+
|
|
325
|
+
(store$3.versions || (store$3.versions = [])).push({
|
|
326
|
+
version: '3.36.1',
|
|
327
|
+
mode: 'global',
|
|
328
|
+
copyright: '© 2014-2024 Denis Pushkarev (zloirock.ru)',
|
|
329
|
+
license: 'https://github.com/zloirock/core-js/blob/v3.36.1/LICENSE',
|
|
330
|
+
source: 'https://github.com/zloirock/core-js'
|
|
331
|
+
});
|
|
332
|
+
|
|
333
|
+
var sharedStoreExports = sharedStore.exports;
|
|
334
|
+
|
|
335
|
+
var store$2 = sharedStoreExports;
|
|
336
|
+
|
|
337
|
+
var shared$3 = function (key, value) {
|
|
338
|
+
return store$2[key] || (store$2[key] = value || {});
|
|
339
|
+
};
|
|
340
|
+
|
|
341
|
+
var requireObjectCoercible$2 = requireObjectCoercible$4;
|
|
342
|
+
|
|
343
|
+
var $Object$2 = Object;
|
|
344
|
+
|
|
345
|
+
// `ToObject` abstract operation
|
|
346
|
+
// https://tc39.es/ecma262/#sec-toobject
|
|
347
|
+
var toObject$2 = function (argument) {
|
|
348
|
+
return $Object$2(requireObjectCoercible$2(argument));
|
|
349
|
+
};
|
|
350
|
+
|
|
351
|
+
var uncurryThis$b = functionUncurryThis;
|
|
352
|
+
var toObject$1 = toObject$2;
|
|
353
|
+
|
|
354
|
+
var hasOwnProperty = uncurryThis$b({}.hasOwnProperty);
|
|
355
|
+
|
|
356
|
+
// `HasOwnProperty` abstract operation
|
|
357
|
+
// https://tc39.es/ecma262/#sec-hasownproperty
|
|
358
|
+
// eslint-disable-next-line es/no-object-hasown -- safe
|
|
359
|
+
var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
|
|
360
|
+
return hasOwnProperty(toObject$1(it), key);
|
|
361
|
+
};
|
|
362
|
+
|
|
363
|
+
var uncurryThis$a = functionUncurryThis;
|
|
364
|
+
|
|
365
|
+
var id = 0;
|
|
366
|
+
var postfix = Math.random();
|
|
367
|
+
var toString$4 = uncurryThis$a(1.0.toString);
|
|
368
|
+
|
|
369
|
+
var uid$2 = function (key) {
|
|
370
|
+
return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$4(++id + postfix, 36);
|
|
371
|
+
};
|
|
372
|
+
|
|
373
|
+
var global$9 = global$e;
|
|
374
|
+
var shared$2 = shared$3;
|
|
375
|
+
var hasOwn$b = hasOwnProperty_1;
|
|
376
|
+
var uid$1 = uid$2;
|
|
377
|
+
var NATIVE_SYMBOL$1 = symbolConstructorDetection;
|
|
378
|
+
var USE_SYMBOL_AS_UID = useSymbolAsUid;
|
|
379
|
+
|
|
380
|
+
var Symbol$2 = global$9.Symbol;
|
|
381
|
+
var WellKnownSymbolsStore = shared$2('wks');
|
|
382
|
+
var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$2['for'] || Symbol$2 : Symbol$2 && Symbol$2.withoutSetter || uid$1;
|
|
383
|
+
|
|
384
|
+
var wellKnownSymbol$c = function (name) {
|
|
385
|
+
if (!hasOwn$b(WellKnownSymbolsStore, name)) {
|
|
386
|
+
WellKnownSymbolsStore[name] = NATIVE_SYMBOL$1 && hasOwn$b(Symbol$2, name)
|
|
387
|
+
? Symbol$2[name]
|
|
388
|
+
: createWellKnownSymbol('Symbol.' + name);
|
|
389
|
+
} return WellKnownSymbolsStore[name];
|
|
390
|
+
};
|
|
391
|
+
|
|
392
|
+
var call$8 = functionCall;
|
|
393
|
+
var isObject$6 = isObject$8;
|
|
394
|
+
var isSymbol$1 = isSymbol$2;
|
|
395
|
+
var getMethod$3 = getMethod$4;
|
|
396
|
+
var ordinaryToPrimitive = ordinaryToPrimitive$1;
|
|
397
|
+
var wellKnownSymbol$b = wellKnownSymbol$c;
|
|
398
|
+
|
|
399
|
+
var $TypeError$7 = TypeError;
|
|
400
|
+
var TO_PRIMITIVE = wellKnownSymbol$b('toPrimitive');
|
|
401
|
+
|
|
402
|
+
// `ToPrimitive` abstract operation
|
|
403
|
+
// https://tc39.es/ecma262/#sec-toprimitive
|
|
404
|
+
var toPrimitive$1 = function (input, pref) {
|
|
405
|
+
if (!isObject$6(input) || isSymbol$1(input)) return input;
|
|
406
|
+
var exoticToPrim = getMethod$3(input, TO_PRIMITIVE);
|
|
407
|
+
var result;
|
|
408
|
+
if (exoticToPrim) {
|
|
409
|
+
if (pref === undefined) pref = 'default';
|
|
410
|
+
result = call$8(exoticToPrim, input, pref);
|
|
411
|
+
if (!isObject$6(result) || isSymbol$1(result)) return result;
|
|
412
|
+
throw new $TypeError$7("Can't convert object to primitive value");
|
|
413
|
+
}
|
|
414
|
+
if (pref === undefined) pref = 'number';
|
|
415
|
+
return ordinaryToPrimitive(input, pref);
|
|
416
|
+
};
|
|
417
|
+
|
|
418
|
+
var toPrimitive = toPrimitive$1;
|
|
419
|
+
var isSymbol = isSymbol$2;
|
|
420
|
+
|
|
421
|
+
// `ToPropertyKey` abstract operation
|
|
422
|
+
// https://tc39.es/ecma262/#sec-topropertykey
|
|
423
|
+
var toPropertyKey$2 = function (argument) {
|
|
424
|
+
var key = toPrimitive(argument, 'string');
|
|
425
|
+
return isSymbol(key) ? key : key + '';
|
|
426
|
+
};
|
|
427
|
+
|
|
428
|
+
var global$8 = global$e;
|
|
429
|
+
var isObject$5 = isObject$8;
|
|
430
|
+
|
|
431
|
+
var document$1 = global$8.document;
|
|
432
|
+
// typeof document.createElement is 'object' in old IE
|
|
433
|
+
var EXISTS$1 = isObject$5(document$1) && isObject$5(document$1.createElement);
|
|
434
|
+
|
|
435
|
+
var documentCreateElement$2 = function (it) {
|
|
436
|
+
return EXISTS$1 ? document$1.createElement(it) : {};
|
|
437
|
+
};
|
|
438
|
+
|
|
439
|
+
var DESCRIPTORS$b = descriptors;
|
|
440
|
+
var fails$8 = fails$d;
|
|
441
|
+
var createElement = documentCreateElement$2;
|
|
442
|
+
|
|
443
|
+
// Thanks to IE8 for its funny defineProperty
|
|
444
|
+
var ie8DomDefine = !DESCRIPTORS$b && !fails$8(function () {
|
|
445
|
+
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
446
|
+
return Object.defineProperty(createElement('div'), 'a', {
|
|
447
|
+
get: function () { return 7; }
|
|
448
|
+
}).a !== 7;
|
|
449
|
+
});
|
|
450
|
+
|
|
451
|
+
var DESCRIPTORS$a = descriptors;
|
|
452
|
+
var call$7 = functionCall;
|
|
453
|
+
var propertyIsEnumerableModule = objectPropertyIsEnumerable;
|
|
454
|
+
var createPropertyDescriptor$3 = createPropertyDescriptor$4;
|
|
455
|
+
var toIndexedObject$4 = toIndexedObject$5;
|
|
456
|
+
var toPropertyKey$1 = toPropertyKey$2;
|
|
457
|
+
var hasOwn$a = hasOwnProperty_1;
|
|
458
|
+
var IE8_DOM_DEFINE$1 = ie8DomDefine;
|
|
459
|
+
|
|
460
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
461
|
+
var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
|
|
462
|
+
|
|
463
|
+
// `Object.getOwnPropertyDescriptor` method
|
|
464
|
+
// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
|
|
465
|
+
objectGetOwnPropertyDescriptor.f = DESCRIPTORS$a ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
|
|
466
|
+
O = toIndexedObject$4(O);
|
|
467
|
+
P = toPropertyKey$1(P);
|
|
468
|
+
if (IE8_DOM_DEFINE$1) try {
|
|
469
|
+
return $getOwnPropertyDescriptor$1(O, P);
|
|
470
|
+
} catch (error) { /* empty */ }
|
|
471
|
+
if (hasOwn$a(O, P)) return createPropertyDescriptor$3(!call$7(propertyIsEnumerableModule.f, O, P), O[P]);
|
|
472
|
+
};
|
|
473
|
+
|
|
474
|
+
var objectDefineProperty = {};
|
|
475
|
+
|
|
476
|
+
var DESCRIPTORS$9 = descriptors;
|
|
477
|
+
var fails$7 = fails$d;
|
|
478
|
+
|
|
479
|
+
// V8 ~ Chrome 36-
|
|
480
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=3334
|
|
481
|
+
var v8PrototypeDefineBug = DESCRIPTORS$9 && fails$7(function () {
|
|
482
|
+
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
483
|
+
return Object.defineProperty(function () { /* empty */ }, 'prototype', {
|
|
484
|
+
value: 42,
|
|
485
|
+
writable: false
|
|
486
|
+
}).prototype !== 42;
|
|
487
|
+
});
|
|
488
|
+
|
|
489
|
+
var isObject$4 = isObject$8;
|
|
490
|
+
|
|
491
|
+
var $String$3 = String;
|
|
492
|
+
var $TypeError$6 = TypeError;
|
|
493
|
+
|
|
494
|
+
// `Assert: Type(argument) is Object`
|
|
495
|
+
var anObject$d = function (argument) {
|
|
496
|
+
if (isObject$4(argument)) return argument;
|
|
497
|
+
throw new $TypeError$6($String$3(argument) + ' is not an object');
|
|
498
|
+
};
|
|
499
|
+
|
|
500
|
+
var DESCRIPTORS$8 = descriptors;
|
|
501
|
+
var IE8_DOM_DEFINE = ie8DomDefine;
|
|
502
|
+
var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
|
|
503
|
+
var anObject$c = anObject$d;
|
|
504
|
+
var toPropertyKey = toPropertyKey$2;
|
|
505
|
+
|
|
506
|
+
var $TypeError$5 = TypeError;
|
|
507
|
+
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
508
|
+
var $defineProperty = Object.defineProperty;
|
|
509
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
510
|
+
var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
511
|
+
var ENUMERABLE = 'enumerable';
|
|
512
|
+
var CONFIGURABLE$1 = 'configurable';
|
|
513
|
+
var WRITABLE = 'writable';
|
|
514
|
+
|
|
515
|
+
// `Object.defineProperty` method
|
|
516
|
+
// https://tc39.es/ecma262/#sec-object.defineproperty
|
|
517
|
+
objectDefineProperty.f = DESCRIPTORS$8 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
|
|
518
|
+
anObject$c(O);
|
|
519
|
+
P = toPropertyKey(P);
|
|
520
|
+
anObject$c(Attributes);
|
|
521
|
+
if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
|
|
522
|
+
var current = $getOwnPropertyDescriptor(O, P);
|
|
523
|
+
if (current && current[WRITABLE]) {
|
|
524
|
+
O[P] = Attributes.value;
|
|
525
|
+
Attributes = {
|
|
526
|
+
configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
|
|
527
|
+
enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
|
|
528
|
+
writable: false
|
|
529
|
+
};
|
|
530
|
+
}
|
|
531
|
+
} return $defineProperty(O, P, Attributes);
|
|
532
|
+
} : $defineProperty : function defineProperty(O, P, Attributes) {
|
|
533
|
+
anObject$c(O);
|
|
534
|
+
P = toPropertyKey(P);
|
|
535
|
+
anObject$c(Attributes);
|
|
536
|
+
if (IE8_DOM_DEFINE) try {
|
|
537
|
+
return $defineProperty(O, P, Attributes);
|
|
538
|
+
} catch (error) { /* empty */ }
|
|
539
|
+
if ('get' in Attributes || 'set' in Attributes) throw new $TypeError$5('Accessors not supported');
|
|
540
|
+
if ('value' in Attributes) O[P] = Attributes.value;
|
|
541
|
+
return O;
|
|
542
|
+
};
|
|
543
|
+
|
|
544
|
+
var DESCRIPTORS$7 = descriptors;
|
|
545
|
+
var definePropertyModule$4 = objectDefineProperty;
|
|
546
|
+
var createPropertyDescriptor$2 = createPropertyDescriptor$4;
|
|
547
|
+
|
|
548
|
+
var createNonEnumerableProperty$5 = DESCRIPTORS$7 ? function (object, key, value) {
|
|
549
|
+
return definePropertyModule$4.f(object, key, createPropertyDescriptor$2(1, value));
|
|
550
|
+
} : function (object, key, value) {
|
|
551
|
+
object[key] = value;
|
|
552
|
+
return object;
|
|
553
|
+
};
|
|
554
|
+
|
|
555
|
+
var makeBuiltIn$3 = {exports: {}};
|
|
556
|
+
|
|
557
|
+
var DESCRIPTORS$6 = descriptors;
|
|
558
|
+
var hasOwn$9 = hasOwnProperty_1;
|
|
559
|
+
|
|
560
|
+
var FunctionPrototype = Function.prototype;
|
|
561
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
562
|
+
var getDescriptor = DESCRIPTORS$6 && Object.getOwnPropertyDescriptor;
|
|
563
|
+
|
|
564
|
+
var EXISTS = hasOwn$9(FunctionPrototype, 'name');
|
|
565
|
+
// additional protection from minified / mangled / dropped function names
|
|
566
|
+
var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
|
|
567
|
+
var CONFIGURABLE = EXISTS && (!DESCRIPTORS$6 || (DESCRIPTORS$6 && getDescriptor(FunctionPrototype, 'name').configurable));
|
|
568
|
+
|
|
569
|
+
var functionName = {
|
|
570
|
+
EXISTS: EXISTS,
|
|
571
|
+
PROPER: PROPER,
|
|
572
|
+
CONFIGURABLE: CONFIGURABLE
|
|
573
|
+
};
|
|
574
|
+
|
|
575
|
+
var uncurryThis$9 = functionUncurryThis;
|
|
576
|
+
var isCallable$a = isCallable$g;
|
|
577
|
+
var store$1 = sharedStoreExports;
|
|
578
|
+
|
|
579
|
+
var functionToString = uncurryThis$9(Function.toString);
|
|
580
|
+
|
|
581
|
+
// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
|
|
582
|
+
if (!isCallable$a(store$1.inspectSource)) {
|
|
583
|
+
store$1.inspectSource = function (it) {
|
|
584
|
+
return functionToString(it);
|
|
585
|
+
};
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
var inspectSource$1 = store$1.inspectSource;
|
|
589
|
+
|
|
590
|
+
var global$7 = global$e;
|
|
591
|
+
var isCallable$9 = isCallable$g;
|
|
592
|
+
|
|
593
|
+
var WeakMap$1 = global$7.WeakMap;
|
|
594
|
+
|
|
595
|
+
var weakMapBasicDetection = isCallable$9(WeakMap$1) && /native code/.test(String(WeakMap$1));
|
|
596
|
+
|
|
597
|
+
var shared$1 = shared$3;
|
|
598
|
+
var uid = uid$2;
|
|
599
|
+
|
|
600
|
+
var keys = shared$1('keys');
|
|
601
|
+
|
|
602
|
+
var sharedKey$3 = function (key) {
|
|
603
|
+
return keys[key] || (keys[key] = uid(key));
|
|
604
|
+
};
|
|
605
|
+
|
|
606
|
+
var hiddenKeys$4 = {};
|
|
607
|
+
|
|
608
|
+
var NATIVE_WEAK_MAP = weakMapBasicDetection;
|
|
609
|
+
var global$6 = global$e;
|
|
610
|
+
var isObject$3 = isObject$8;
|
|
611
|
+
var createNonEnumerableProperty$4 = createNonEnumerableProperty$5;
|
|
612
|
+
var hasOwn$8 = hasOwnProperty_1;
|
|
613
|
+
var shared = sharedStoreExports;
|
|
614
|
+
var sharedKey$2 = sharedKey$3;
|
|
615
|
+
var hiddenKeys$3 = hiddenKeys$4;
|
|
616
|
+
|
|
617
|
+
var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
|
|
618
|
+
var TypeError$1 = global$6.TypeError;
|
|
619
|
+
var WeakMap = global$6.WeakMap;
|
|
620
|
+
var set, get, has$1;
|
|
621
|
+
|
|
622
|
+
var enforce = function (it) {
|
|
623
|
+
return has$1(it) ? get(it) : set(it, {});
|
|
624
|
+
};
|
|
625
|
+
|
|
626
|
+
var getterFor = function (TYPE) {
|
|
627
|
+
return function (it) {
|
|
628
|
+
var state;
|
|
629
|
+
if (!isObject$3(it) || (state = get(it)).type !== TYPE) {
|
|
630
|
+
throw new TypeError$1('Incompatible receiver, ' + TYPE + ' required');
|
|
631
|
+
} return state;
|
|
632
|
+
};
|
|
633
|
+
};
|
|
634
|
+
|
|
635
|
+
if (NATIVE_WEAK_MAP || shared.state) {
|
|
636
|
+
var store = shared.state || (shared.state = new WeakMap());
|
|
637
|
+
/* eslint-disable no-self-assign -- prototype methods protection */
|
|
638
|
+
store.get = store.get;
|
|
639
|
+
store.has = store.has;
|
|
640
|
+
store.set = store.set;
|
|
641
|
+
/* eslint-enable no-self-assign -- prototype methods protection */
|
|
642
|
+
set = function (it, metadata) {
|
|
643
|
+
if (store.has(it)) throw new TypeError$1(OBJECT_ALREADY_INITIALIZED);
|
|
644
|
+
metadata.facade = it;
|
|
645
|
+
store.set(it, metadata);
|
|
646
|
+
return metadata;
|
|
647
|
+
};
|
|
648
|
+
get = function (it) {
|
|
649
|
+
return store.get(it) || {};
|
|
650
|
+
};
|
|
651
|
+
has$1 = function (it) {
|
|
652
|
+
return store.has(it);
|
|
653
|
+
};
|
|
654
|
+
} else {
|
|
655
|
+
var STATE = sharedKey$2('state');
|
|
656
|
+
hiddenKeys$3[STATE] = true;
|
|
657
|
+
set = function (it, metadata) {
|
|
658
|
+
if (hasOwn$8(it, STATE)) throw new TypeError$1(OBJECT_ALREADY_INITIALIZED);
|
|
659
|
+
metadata.facade = it;
|
|
660
|
+
createNonEnumerableProperty$4(it, STATE, metadata);
|
|
661
|
+
return metadata;
|
|
662
|
+
};
|
|
663
|
+
get = function (it) {
|
|
664
|
+
return hasOwn$8(it, STATE) ? it[STATE] : {};
|
|
665
|
+
};
|
|
666
|
+
has$1 = function (it) {
|
|
667
|
+
return hasOwn$8(it, STATE);
|
|
668
|
+
};
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
var internalState = {
|
|
672
|
+
set: set,
|
|
673
|
+
get: get,
|
|
674
|
+
has: has$1,
|
|
675
|
+
enforce: enforce,
|
|
676
|
+
getterFor: getterFor
|
|
677
|
+
};
|
|
678
|
+
|
|
679
|
+
var uncurryThis$8 = functionUncurryThis;
|
|
680
|
+
var fails$6 = fails$d;
|
|
681
|
+
var isCallable$8 = isCallable$g;
|
|
682
|
+
var hasOwn$7 = hasOwnProperty_1;
|
|
683
|
+
var DESCRIPTORS$5 = descriptors;
|
|
684
|
+
var CONFIGURABLE_FUNCTION_NAME$1 = functionName.CONFIGURABLE;
|
|
685
|
+
var inspectSource = inspectSource$1;
|
|
686
|
+
var InternalStateModule$2 = internalState;
|
|
687
|
+
|
|
688
|
+
var enforceInternalState = InternalStateModule$2.enforce;
|
|
689
|
+
var getInternalState$1 = InternalStateModule$2.get;
|
|
690
|
+
var $String$2 = String;
|
|
691
|
+
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
692
|
+
var defineProperty$4 = Object.defineProperty;
|
|
693
|
+
var stringSlice$1 = uncurryThis$8(''.slice);
|
|
694
|
+
var replace$2 = uncurryThis$8(''.replace);
|
|
695
|
+
var join = uncurryThis$8([].join);
|
|
696
|
+
|
|
697
|
+
var CONFIGURABLE_LENGTH = DESCRIPTORS$5 && !fails$6(function () {
|
|
698
|
+
return defineProperty$4(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
|
|
699
|
+
});
|
|
700
|
+
|
|
701
|
+
var TEMPLATE = String(String).split('String');
|
|
702
|
+
|
|
703
|
+
var makeBuiltIn$2 = makeBuiltIn$3.exports = function (value, name, options) {
|
|
704
|
+
if (stringSlice$1($String$2(name), 0, 7) === 'Symbol(') {
|
|
705
|
+
name = '[' + replace$2($String$2(name), /^Symbol\(([^)]*)\).*$/, '$1') + ']';
|
|
706
|
+
}
|
|
707
|
+
if (options && options.getter) name = 'get ' + name;
|
|
708
|
+
if (options && options.setter) name = 'set ' + name;
|
|
709
|
+
if (!hasOwn$7(value, 'name') || (CONFIGURABLE_FUNCTION_NAME$1 && value.name !== name)) {
|
|
710
|
+
if (DESCRIPTORS$5) defineProperty$4(value, 'name', { value: name, configurable: true });
|
|
711
|
+
else value.name = name;
|
|
712
|
+
}
|
|
713
|
+
if (CONFIGURABLE_LENGTH && options && hasOwn$7(options, 'arity') && value.length !== options.arity) {
|
|
714
|
+
defineProperty$4(value, 'length', { value: options.arity });
|
|
715
|
+
}
|
|
716
|
+
try {
|
|
717
|
+
if (options && hasOwn$7(options, 'constructor') && options.constructor) {
|
|
718
|
+
if (DESCRIPTORS$5) defineProperty$4(value, 'prototype', { writable: false });
|
|
719
|
+
// in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
|
|
720
|
+
} else if (value.prototype) value.prototype = undefined;
|
|
721
|
+
} catch (error) { /* empty */ }
|
|
722
|
+
var state = enforceInternalState(value);
|
|
723
|
+
if (!hasOwn$7(state, 'source')) {
|
|
724
|
+
state.source = join(TEMPLATE, typeof name == 'string' ? name : '');
|
|
725
|
+
} return value;
|
|
726
|
+
};
|
|
727
|
+
|
|
728
|
+
// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
|
|
729
|
+
// eslint-disable-next-line no-extend-native -- required
|
|
730
|
+
Function.prototype.toString = makeBuiltIn$2(function toString() {
|
|
731
|
+
return isCallable$8(this) && getInternalState$1(this).source || inspectSource(this);
|
|
732
|
+
}, 'toString');
|
|
733
|
+
|
|
734
|
+
var makeBuiltInExports = makeBuiltIn$3.exports;
|
|
735
|
+
|
|
736
|
+
var isCallable$7 = isCallable$g;
|
|
737
|
+
var definePropertyModule$3 = objectDefineProperty;
|
|
738
|
+
var makeBuiltIn$1 = makeBuiltInExports;
|
|
739
|
+
var defineGlobalProperty$1 = defineGlobalProperty$3;
|
|
740
|
+
|
|
741
|
+
var defineBuiltIn$5 = function (O, key, value, options) {
|
|
742
|
+
if (!options) options = {};
|
|
743
|
+
var simple = options.enumerable;
|
|
744
|
+
var name = options.name !== undefined ? options.name : key;
|
|
745
|
+
if (isCallable$7(value)) makeBuiltIn$1(value, name, options);
|
|
746
|
+
if (options.global) {
|
|
747
|
+
if (simple) O[key] = value;
|
|
748
|
+
else defineGlobalProperty$1(key, value);
|
|
749
|
+
} else {
|
|
750
|
+
try {
|
|
751
|
+
if (!options.unsafe) delete O[key];
|
|
752
|
+
else if (O[key]) simple = true;
|
|
753
|
+
} catch (error) { /* empty */ }
|
|
754
|
+
if (simple) O[key] = value;
|
|
755
|
+
else definePropertyModule$3.f(O, key, {
|
|
756
|
+
value: value,
|
|
757
|
+
enumerable: false,
|
|
758
|
+
configurable: !options.nonConfigurable,
|
|
759
|
+
writable: !options.nonWritable
|
|
760
|
+
});
|
|
761
|
+
} return O;
|
|
762
|
+
};
|
|
763
|
+
|
|
764
|
+
var objectGetOwnPropertyNames = {};
|
|
765
|
+
|
|
766
|
+
var ceil = Math.ceil;
|
|
767
|
+
var floor = Math.floor;
|
|
768
|
+
|
|
769
|
+
// `Math.trunc` method
|
|
770
|
+
// https://tc39.es/ecma262/#sec-math.trunc
|
|
771
|
+
// eslint-disable-next-line es/no-math-trunc -- safe
|
|
772
|
+
var mathTrunc = Math.trunc || function trunc(x) {
|
|
773
|
+
var n = +x;
|
|
774
|
+
return (n > 0 ? floor : ceil)(n);
|
|
775
|
+
};
|
|
776
|
+
|
|
777
|
+
var trunc = mathTrunc;
|
|
778
|
+
|
|
779
|
+
// `ToIntegerOrInfinity` abstract operation
|
|
780
|
+
// https://tc39.es/ecma262/#sec-tointegerorinfinity
|
|
781
|
+
var toIntegerOrInfinity$2 = function (argument) {
|
|
782
|
+
var number = +argument;
|
|
783
|
+
// eslint-disable-next-line no-self-compare -- NaN check
|
|
784
|
+
return number !== number || number === 0 ? 0 : trunc(number);
|
|
785
|
+
};
|
|
786
|
+
|
|
787
|
+
var toIntegerOrInfinity$1 = toIntegerOrInfinity$2;
|
|
788
|
+
|
|
789
|
+
var max = Math.max;
|
|
790
|
+
var min$1 = Math.min;
|
|
791
|
+
|
|
792
|
+
// Helper for a popular repeating case of the spec:
|
|
793
|
+
// Let integer be ? ToInteger(index).
|
|
794
|
+
// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
|
|
795
|
+
var toAbsoluteIndex$1 = function (index, length) {
|
|
796
|
+
var integer = toIntegerOrInfinity$1(index);
|
|
797
|
+
return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
|
|
798
|
+
};
|
|
799
|
+
|
|
800
|
+
var toIntegerOrInfinity = toIntegerOrInfinity$2;
|
|
801
|
+
|
|
802
|
+
var min = Math.min;
|
|
803
|
+
|
|
804
|
+
// `ToLength` abstract operation
|
|
805
|
+
// https://tc39.es/ecma262/#sec-tolength
|
|
806
|
+
var toLength$1 = function (argument) {
|
|
807
|
+
var len = toIntegerOrInfinity(argument);
|
|
808
|
+
return len > 0 ? min(len, 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
|
|
809
|
+
};
|
|
810
|
+
|
|
811
|
+
var toLength = toLength$1;
|
|
812
|
+
|
|
813
|
+
// `LengthOfArrayLike` abstract operation
|
|
814
|
+
// https://tc39.es/ecma262/#sec-lengthofarraylike
|
|
815
|
+
var lengthOfArrayLike$2 = function (obj) {
|
|
816
|
+
return toLength(obj.length);
|
|
817
|
+
};
|
|
818
|
+
|
|
819
|
+
var toIndexedObject$3 = toIndexedObject$5;
|
|
820
|
+
var toAbsoluteIndex = toAbsoluteIndex$1;
|
|
821
|
+
var lengthOfArrayLike$1 = lengthOfArrayLike$2;
|
|
822
|
+
|
|
823
|
+
// `Array.prototype.{ indexOf, includes }` methods implementation
|
|
824
|
+
var createMethod$1 = function (IS_INCLUDES) {
|
|
825
|
+
return function ($this, el, fromIndex) {
|
|
826
|
+
var O = toIndexedObject$3($this);
|
|
827
|
+
var length = lengthOfArrayLike$1(O);
|
|
828
|
+
if (length === 0) return !IS_INCLUDES && -1;
|
|
829
|
+
var index = toAbsoluteIndex(fromIndex, length);
|
|
830
|
+
var value;
|
|
831
|
+
// Array#includes uses SameValueZero equality algorithm
|
|
832
|
+
// eslint-disable-next-line no-self-compare -- NaN check
|
|
833
|
+
if (IS_INCLUDES && el !== el) while (length > index) {
|
|
834
|
+
value = O[index++];
|
|
835
|
+
// eslint-disable-next-line no-self-compare -- NaN check
|
|
836
|
+
if (value !== value) return true;
|
|
837
|
+
// Array#indexOf ignores holes, Array#includes - not
|
|
838
|
+
} else for (;length > index; index++) {
|
|
839
|
+
if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
|
|
840
|
+
} return !IS_INCLUDES && -1;
|
|
841
|
+
};
|
|
842
|
+
};
|
|
843
|
+
|
|
844
|
+
var arrayIncludes = {
|
|
845
|
+
// `Array.prototype.includes` method
|
|
846
|
+
// https://tc39.es/ecma262/#sec-array.prototype.includes
|
|
847
|
+
includes: createMethod$1(true),
|
|
848
|
+
// `Array.prototype.indexOf` method
|
|
849
|
+
// https://tc39.es/ecma262/#sec-array.prototype.indexof
|
|
850
|
+
indexOf: createMethod$1(false)
|
|
851
|
+
};
|
|
852
|
+
|
|
853
|
+
var uncurryThis$7 = functionUncurryThis;
|
|
854
|
+
var hasOwn$6 = hasOwnProperty_1;
|
|
855
|
+
var toIndexedObject$2 = toIndexedObject$5;
|
|
856
|
+
var indexOf = arrayIncludes.indexOf;
|
|
857
|
+
var hiddenKeys$2 = hiddenKeys$4;
|
|
858
|
+
|
|
859
|
+
var push = uncurryThis$7([].push);
|
|
860
|
+
|
|
861
|
+
var objectKeysInternal = function (object, names) {
|
|
862
|
+
var O = toIndexedObject$2(object);
|
|
863
|
+
var i = 0;
|
|
864
|
+
var result = [];
|
|
865
|
+
var key;
|
|
866
|
+
for (key in O) !hasOwn$6(hiddenKeys$2, key) && hasOwn$6(O, key) && push(result, key);
|
|
867
|
+
// Don't enum bug & hidden keys
|
|
868
|
+
while (names.length > i) if (hasOwn$6(O, key = names[i++])) {
|
|
869
|
+
~indexOf(result, key) || push(result, key);
|
|
870
|
+
}
|
|
871
|
+
return result;
|
|
872
|
+
};
|
|
873
|
+
|
|
874
|
+
// IE8- don't enum bug keys
|
|
875
|
+
var enumBugKeys$3 = [
|
|
876
|
+
'constructor',
|
|
877
|
+
'hasOwnProperty',
|
|
878
|
+
'isPrototypeOf',
|
|
879
|
+
'propertyIsEnumerable',
|
|
880
|
+
'toLocaleString',
|
|
881
|
+
'toString',
|
|
882
|
+
'valueOf'
|
|
883
|
+
];
|
|
884
|
+
|
|
885
|
+
var internalObjectKeys$1 = objectKeysInternal;
|
|
886
|
+
var enumBugKeys$2 = enumBugKeys$3;
|
|
887
|
+
|
|
888
|
+
var hiddenKeys$1 = enumBugKeys$2.concat('length', 'prototype');
|
|
889
|
+
|
|
890
|
+
// `Object.getOwnPropertyNames` method
|
|
891
|
+
// https://tc39.es/ecma262/#sec-object.getownpropertynames
|
|
892
|
+
// eslint-disable-next-line es/no-object-getownpropertynames -- safe
|
|
893
|
+
objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
|
894
|
+
return internalObjectKeys$1(O, hiddenKeys$1);
|
|
895
|
+
};
|
|
896
|
+
|
|
897
|
+
var objectGetOwnPropertySymbols = {};
|
|
898
|
+
|
|
899
|
+
// eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
|
|
900
|
+
objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
|
|
901
|
+
|
|
902
|
+
var getBuiltIn$1 = getBuiltIn$3;
|
|
903
|
+
var uncurryThis$6 = functionUncurryThis;
|
|
904
|
+
var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
|
|
905
|
+
var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
|
|
906
|
+
var anObject$b = anObject$d;
|
|
907
|
+
|
|
908
|
+
var concat = uncurryThis$6([].concat);
|
|
909
|
+
|
|
910
|
+
// all object keys, includes non-enumerable and symbols
|
|
911
|
+
var ownKeys$1 = getBuiltIn$1('Reflect', 'ownKeys') || function ownKeys(it) {
|
|
912
|
+
var keys = getOwnPropertyNamesModule.f(anObject$b(it));
|
|
913
|
+
var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
|
|
914
|
+
return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
|
|
915
|
+
};
|
|
916
|
+
|
|
917
|
+
var hasOwn$5 = hasOwnProperty_1;
|
|
918
|
+
var ownKeys = ownKeys$1;
|
|
919
|
+
var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
|
|
920
|
+
var definePropertyModule$2 = objectDefineProperty;
|
|
921
|
+
|
|
922
|
+
var copyConstructorProperties$2 = function (target, source, exceptions) {
|
|
923
|
+
var keys = ownKeys(source);
|
|
924
|
+
var defineProperty = definePropertyModule$2.f;
|
|
925
|
+
var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
|
|
926
|
+
for (var i = 0; i < keys.length; i++) {
|
|
927
|
+
var key = keys[i];
|
|
928
|
+
if (!hasOwn$5(target, key) && !(exceptions && hasOwn$5(exceptions, key))) {
|
|
929
|
+
defineProperty(target, key, getOwnPropertyDescriptor(source, key));
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
};
|
|
933
|
+
|
|
934
|
+
var fails$5 = fails$d;
|
|
935
|
+
var isCallable$6 = isCallable$g;
|
|
936
|
+
|
|
937
|
+
var replacement = /#|\.prototype\./;
|
|
938
|
+
|
|
939
|
+
var isForced$1 = function (feature, detection) {
|
|
940
|
+
var value = data[normalize(feature)];
|
|
941
|
+
return value === POLYFILL ? true
|
|
942
|
+
: value === NATIVE ? false
|
|
943
|
+
: isCallable$6(detection) ? fails$5(detection)
|
|
944
|
+
: !!detection;
|
|
945
|
+
};
|
|
946
|
+
|
|
947
|
+
var normalize = isForced$1.normalize = function (string) {
|
|
948
|
+
return String(string).replace(replacement, '.').toLowerCase();
|
|
949
|
+
};
|
|
950
|
+
|
|
951
|
+
var data = isForced$1.data = {};
|
|
952
|
+
var NATIVE = isForced$1.NATIVE = 'N';
|
|
953
|
+
var POLYFILL = isForced$1.POLYFILL = 'P';
|
|
954
|
+
|
|
955
|
+
var isForced_1 = isForced$1;
|
|
956
|
+
|
|
957
|
+
var global$5 = global$e;
|
|
958
|
+
var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
|
|
959
|
+
var createNonEnumerableProperty$3 = createNonEnumerableProperty$5;
|
|
960
|
+
var defineBuiltIn$4 = defineBuiltIn$5;
|
|
961
|
+
var defineGlobalProperty = defineGlobalProperty$3;
|
|
962
|
+
var copyConstructorProperties$1 = copyConstructorProperties$2;
|
|
963
|
+
var isForced = isForced_1;
|
|
964
|
+
|
|
965
|
+
/*
|
|
966
|
+
options.target - name of the target object
|
|
967
|
+
options.global - target is the global object
|
|
968
|
+
options.stat - export as static methods of target
|
|
969
|
+
options.proto - export as prototype methods of target
|
|
970
|
+
options.real - real prototype method for the `pure` version
|
|
971
|
+
options.forced - export even if the native feature is available
|
|
972
|
+
options.bind - bind methods to the target, required for the `pure` version
|
|
973
|
+
options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
|
|
974
|
+
options.unsafe - use the simple assignment of property instead of delete + defineProperty
|
|
975
|
+
options.sham - add a flag to not completely full polyfills
|
|
976
|
+
options.enumerable - export as enumerable property
|
|
977
|
+
options.dontCallGetSet - prevent calling a getter on target
|
|
978
|
+
options.name - the .name of the function if it does not match the key
|
|
979
|
+
*/
|
|
980
|
+
var _export = function (options, source) {
|
|
981
|
+
var TARGET = options.target;
|
|
982
|
+
var GLOBAL = options.global;
|
|
983
|
+
var STATIC = options.stat;
|
|
984
|
+
var FORCED, target, key, targetProperty, sourceProperty, descriptor;
|
|
985
|
+
if (GLOBAL) {
|
|
986
|
+
target = global$5;
|
|
987
|
+
} else if (STATIC) {
|
|
988
|
+
target = global$5[TARGET] || defineGlobalProperty(TARGET, {});
|
|
989
|
+
} else {
|
|
990
|
+
target = global$5[TARGET] && global$5[TARGET].prototype;
|
|
991
|
+
}
|
|
992
|
+
if (target) for (key in source) {
|
|
993
|
+
sourceProperty = source[key];
|
|
994
|
+
if (options.dontCallGetSet) {
|
|
995
|
+
descriptor = getOwnPropertyDescriptor(target, key);
|
|
996
|
+
targetProperty = descriptor && descriptor.value;
|
|
997
|
+
} else targetProperty = target[key];
|
|
998
|
+
FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
|
|
999
|
+
// contained in target
|
|
1000
|
+
if (!FORCED && targetProperty !== undefined) {
|
|
1001
|
+
if (typeof sourceProperty == typeof targetProperty) continue;
|
|
1002
|
+
copyConstructorProperties$1(sourceProperty, targetProperty);
|
|
1003
|
+
}
|
|
1004
|
+
// add a flag to not completely full polyfills
|
|
1005
|
+
if (options.sham || (targetProperty && targetProperty.sham)) {
|
|
1006
|
+
createNonEnumerableProperty$3(sourceProperty, 'sham', true);
|
|
1007
|
+
}
|
|
1008
|
+
defineBuiltIn$4(target, key, sourceProperty, options);
|
|
1009
|
+
}
|
|
1010
|
+
};
|
|
1011
|
+
|
|
1012
|
+
var wellKnownSymbol$a = wellKnownSymbol$c;
|
|
1013
|
+
|
|
1014
|
+
var TO_STRING_TAG$4 = wellKnownSymbol$a('toStringTag');
|
|
1015
|
+
var test = {};
|
|
1016
|
+
|
|
1017
|
+
test[TO_STRING_TAG$4] = 'z';
|
|
1018
|
+
|
|
1019
|
+
var toStringTagSupport = String(test) === '[object z]';
|
|
1020
|
+
|
|
1021
|
+
var TO_STRING_TAG_SUPPORT = toStringTagSupport;
|
|
1022
|
+
var isCallable$5 = isCallable$g;
|
|
1023
|
+
var classofRaw$1 = classofRaw$2;
|
|
1024
|
+
var wellKnownSymbol$9 = wellKnownSymbol$c;
|
|
1025
|
+
|
|
1026
|
+
var TO_STRING_TAG$3 = wellKnownSymbol$9('toStringTag');
|
|
1027
|
+
var $Object$1 = Object;
|
|
1028
|
+
|
|
1029
|
+
// ES3 wrong here
|
|
1030
|
+
var CORRECT_ARGUMENTS = classofRaw$1(function () { return arguments; }()) === 'Arguments';
|
|
1031
|
+
|
|
1032
|
+
// fallback for IE11 Script Access Denied error
|
|
1033
|
+
var tryGet = function (it, key) {
|
|
1034
|
+
try {
|
|
1035
|
+
return it[key];
|
|
1036
|
+
} catch (error) { /* empty */ }
|
|
1037
|
+
};
|
|
1038
|
+
|
|
1039
|
+
// getting tag from ES6+ `Object.prototype.toString`
|
|
1040
|
+
var classof$2 = TO_STRING_TAG_SUPPORT ? classofRaw$1 : function (it) {
|
|
1041
|
+
var O, tag, result;
|
|
1042
|
+
return it === undefined ? 'Undefined' : it === null ? 'Null'
|
|
1043
|
+
// @@toStringTag case
|
|
1044
|
+
: typeof (tag = tryGet(O = $Object$1(it), TO_STRING_TAG$3)) == 'string' ? tag
|
|
1045
|
+
// builtinTag case
|
|
1046
|
+
: CORRECT_ARGUMENTS ? classofRaw$1(O)
|
|
1047
|
+
// ES3 arguments fallback
|
|
1048
|
+
: (result = classofRaw$1(O)) === 'Object' && isCallable$5(O.callee) ? 'Arguments' : result;
|
|
1049
|
+
};
|
|
1050
|
+
|
|
1051
|
+
var classof$1 = classof$2;
|
|
1052
|
+
|
|
1053
|
+
var $String$1 = String;
|
|
1054
|
+
|
|
1055
|
+
var toString$3 = function (argument) {
|
|
1056
|
+
if (classof$1(argument) === 'Symbol') throw new TypeError('Cannot convert a Symbol value to a string');
|
|
1057
|
+
return $String$1(argument);
|
|
1058
|
+
};
|
|
1059
|
+
|
|
1060
|
+
var makeBuiltIn = makeBuiltInExports;
|
|
1061
|
+
var defineProperty$3 = objectDefineProperty;
|
|
1062
|
+
|
|
1063
|
+
var defineBuiltInAccessor$2 = function (target, name, descriptor) {
|
|
1064
|
+
if (descriptor.get) makeBuiltIn(descriptor.get, name, { getter: true });
|
|
1065
|
+
if (descriptor.set) makeBuiltIn(descriptor.set, name, { setter: true });
|
|
1066
|
+
return defineProperty$3.f(target, name, descriptor);
|
|
1067
|
+
};
|
|
1068
|
+
|
|
1069
|
+
var $$5 = _export;
|
|
1070
|
+
var DESCRIPTORS$4 = descriptors;
|
|
1071
|
+
var global$4 = global$e;
|
|
1072
|
+
var uncurryThis$5 = functionUncurryThis;
|
|
1073
|
+
var hasOwn$4 = hasOwnProperty_1;
|
|
1074
|
+
var isCallable$4 = isCallable$g;
|
|
1075
|
+
var isPrototypeOf$3 = objectIsPrototypeOf;
|
|
1076
|
+
var toString$2 = toString$3;
|
|
1077
|
+
var defineBuiltInAccessor$1 = defineBuiltInAccessor$2;
|
|
1078
|
+
var copyConstructorProperties = copyConstructorProperties$2;
|
|
1079
|
+
|
|
1080
|
+
var NativeSymbol = global$4.Symbol;
|
|
1081
|
+
var SymbolPrototype = NativeSymbol && NativeSymbol.prototype;
|
|
1082
|
+
|
|
1083
|
+
if (DESCRIPTORS$4 && isCallable$4(NativeSymbol) && (!('description' in SymbolPrototype) ||
|
|
1084
|
+
// Safari 12 bug
|
|
1085
|
+
NativeSymbol().description !== undefined
|
|
1086
|
+
)) {
|
|
1087
|
+
var EmptyStringDescriptionStore = {};
|
|
1088
|
+
// wrap Symbol constructor for correct work with undefined description
|
|
1089
|
+
var SymbolWrapper = function Symbol() {
|
|
1090
|
+
var description = arguments.length < 1 || arguments[0] === undefined ? undefined : toString$2(arguments[0]);
|
|
1091
|
+
var result = isPrototypeOf$3(SymbolPrototype, this)
|
|
1092
|
+
? new NativeSymbol(description)
|
|
1093
|
+
// in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)'
|
|
1094
|
+
: description === undefined ? NativeSymbol() : NativeSymbol(description);
|
|
1095
|
+
if (description === '') EmptyStringDescriptionStore[result] = true;
|
|
1096
|
+
return result;
|
|
1097
|
+
};
|
|
1098
|
+
|
|
1099
|
+
copyConstructorProperties(SymbolWrapper, NativeSymbol);
|
|
1100
|
+
SymbolWrapper.prototype = SymbolPrototype;
|
|
1101
|
+
SymbolPrototype.constructor = SymbolWrapper;
|
|
1102
|
+
|
|
1103
|
+
var NATIVE_SYMBOL = String(NativeSymbol('description detection')) === 'Symbol(description detection)';
|
|
1104
|
+
var thisSymbolValue = uncurryThis$5(SymbolPrototype.valueOf);
|
|
1105
|
+
var symbolDescriptiveString = uncurryThis$5(SymbolPrototype.toString);
|
|
1106
|
+
var regexp = /^Symbol\((.*)\)[^)]+$/;
|
|
1107
|
+
var replace$1 = uncurryThis$5(''.replace);
|
|
1108
|
+
var stringSlice = uncurryThis$5(''.slice);
|
|
1109
|
+
|
|
1110
|
+
defineBuiltInAccessor$1(SymbolPrototype, 'description', {
|
|
1111
|
+
configurable: true,
|
|
1112
|
+
get: function description() {
|
|
1113
|
+
var symbol = thisSymbolValue(this);
|
|
1114
|
+
if (hasOwn$4(EmptyStringDescriptionStore, symbol)) return '';
|
|
1115
|
+
var string = symbolDescriptiveString(symbol);
|
|
1116
|
+
var desc = NATIVE_SYMBOL ? stringSlice(string, 7, -1) : replace$1(string, regexp, '$1');
|
|
1117
|
+
return desc === '' ? undefined : desc;
|
|
1118
|
+
}
|
|
1119
|
+
});
|
|
1120
|
+
|
|
1121
|
+
$$5({ global: true, constructor: true, forced: true }, {
|
|
1122
|
+
Symbol: SymbolWrapper
|
|
1123
|
+
});
|
|
1124
|
+
}
|
|
1125
|
+
|
|
1126
|
+
var objectDefineProperties = {};
|
|
1127
|
+
|
|
1128
|
+
var internalObjectKeys = objectKeysInternal;
|
|
1129
|
+
var enumBugKeys$1 = enumBugKeys$3;
|
|
1130
|
+
|
|
1131
|
+
// `Object.keys` method
|
|
1132
|
+
// https://tc39.es/ecma262/#sec-object.keys
|
|
1133
|
+
// eslint-disable-next-line es/no-object-keys -- safe
|
|
1134
|
+
var objectKeys$1 = Object.keys || function keys(O) {
|
|
1135
|
+
return internalObjectKeys(O, enumBugKeys$1);
|
|
1136
|
+
};
|
|
1137
|
+
|
|
1138
|
+
var DESCRIPTORS$3 = descriptors;
|
|
1139
|
+
var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
|
|
1140
|
+
var definePropertyModule$1 = objectDefineProperty;
|
|
1141
|
+
var anObject$a = anObject$d;
|
|
1142
|
+
var toIndexedObject$1 = toIndexedObject$5;
|
|
1143
|
+
var objectKeys = objectKeys$1;
|
|
1144
|
+
|
|
1145
|
+
// `Object.defineProperties` method
|
|
1146
|
+
// https://tc39.es/ecma262/#sec-object.defineproperties
|
|
1147
|
+
// eslint-disable-next-line es/no-object-defineproperties -- safe
|
|
1148
|
+
objectDefineProperties.f = DESCRIPTORS$3 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
|
|
1149
|
+
anObject$a(O);
|
|
1150
|
+
var props = toIndexedObject$1(Properties);
|
|
1151
|
+
var keys = objectKeys(Properties);
|
|
1152
|
+
var length = keys.length;
|
|
1153
|
+
var index = 0;
|
|
1154
|
+
var key;
|
|
1155
|
+
while (length > index) definePropertyModule$1.f(O, key = keys[index++], props[key]);
|
|
1156
|
+
return O;
|
|
1157
|
+
};
|
|
1158
|
+
|
|
1159
|
+
var getBuiltIn = getBuiltIn$3;
|
|
1160
|
+
|
|
1161
|
+
var html$1 = getBuiltIn('document', 'documentElement');
|
|
1162
|
+
|
|
1163
|
+
/* global ActiveXObject -- old IE, WSH */
|
|
1164
|
+
var anObject$9 = anObject$d;
|
|
1165
|
+
var definePropertiesModule = objectDefineProperties;
|
|
1166
|
+
var enumBugKeys = enumBugKeys$3;
|
|
1167
|
+
var hiddenKeys = hiddenKeys$4;
|
|
1168
|
+
var html = html$1;
|
|
1169
|
+
var documentCreateElement$1 = documentCreateElement$2;
|
|
1170
|
+
var sharedKey$1 = sharedKey$3;
|
|
1171
|
+
|
|
1172
|
+
var GT = '>';
|
|
1173
|
+
var LT = '<';
|
|
1174
|
+
var PROTOTYPE = 'prototype';
|
|
1175
|
+
var SCRIPT = 'script';
|
|
1176
|
+
var IE_PROTO$1 = sharedKey$1('IE_PROTO');
|
|
1177
|
+
|
|
1178
|
+
var EmptyConstructor = function () { /* empty */ };
|
|
1179
|
+
|
|
1180
|
+
var scriptTag = function (content) {
|
|
1181
|
+
return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
|
|
1182
|
+
};
|
|
1183
|
+
|
|
1184
|
+
// Create object with fake `null` prototype: use ActiveX Object with cleared prototype
|
|
1185
|
+
var NullProtoObjectViaActiveX = function (activeXDocument) {
|
|
1186
|
+
activeXDocument.write(scriptTag(''));
|
|
1187
|
+
activeXDocument.close();
|
|
1188
|
+
var temp = activeXDocument.parentWindow.Object;
|
|
1189
|
+
activeXDocument = null; // avoid memory leak
|
|
1190
|
+
return temp;
|
|
1191
|
+
};
|
|
1192
|
+
|
|
1193
|
+
// Create object with fake `null` prototype: use iframe Object with cleared prototype
|
|
1194
|
+
var NullProtoObjectViaIFrame = function () {
|
|
1195
|
+
// Thrash, waste and sodomy: IE GC bug
|
|
1196
|
+
var iframe = documentCreateElement$1('iframe');
|
|
1197
|
+
var JS = 'java' + SCRIPT + ':';
|
|
1198
|
+
var iframeDocument;
|
|
1199
|
+
iframe.style.display = 'none';
|
|
1200
|
+
html.appendChild(iframe);
|
|
1201
|
+
// https://github.com/zloirock/core-js/issues/475
|
|
1202
|
+
iframe.src = String(JS);
|
|
1203
|
+
iframeDocument = iframe.contentWindow.document;
|
|
1204
|
+
iframeDocument.open();
|
|
1205
|
+
iframeDocument.write(scriptTag('document.F=Object'));
|
|
1206
|
+
iframeDocument.close();
|
|
1207
|
+
return iframeDocument.F;
|
|
1208
|
+
};
|
|
1209
|
+
|
|
1210
|
+
// Check for document.domain and active x support
|
|
1211
|
+
// No need to use active x approach when document.domain is not set
|
|
1212
|
+
// see https://github.com/es-shims/es5-shim/issues/150
|
|
1213
|
+
// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
|
|
1214
|
+
// avoid IE GC bug
|
|
1215
|
+
var activeXDocument;
|
|
1216
|
+
var NullProtoObject = function () {
|
|
1217
|
+
try {
|
|
1218
|
+
activeXDocument = new ActiveXObject('htmlfile');
|
|
1219
|
+
} catch (error) { /* ignore */ }
|
|
1220
|
+
NullProtoObject = typeof document != 'undefined'
|
|
1221
|
+
? document.domain && activeXDocument
|
|
1222
|
+
? NullProtoObjectViaActiveX(activeXDocument) // old IE
|
|
1223
|
+
: NullProtoObjectViaIFrame()
|
|
1224
|
+
: NullProtoObjectViaActiveX(activeXDocument); // WSH
|
|
1225
|
+
var length = enumBugKeys.length;
|
|
1226
|
+
while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
|
|
1227
|
+
return NullProtoObject();
|
|
1228
|
+
};
|
|
1229
|
+
|
|
1230
|
+
hiddenKeys[IE_PROTO$1] = true;
|
|
1231
|
+
|
|
1232
|
+
// `Object.create` method
|
|
1233
|
+
// https://tc39.es/ecma262/#sec-object.create
|
|
1234
|
+
// eslint-disable-next-line es/no-object-create -- safe
|
|
1235
|
+
var objectCreate = Object.create || function create(O, Properties) {
|
|
1236
|
+
var result;
|
|
1237
|
+
if (O !== null) {
|
|
1238
|
+
EmptyConstructor[PROTOTYPE] = anObject$9(O);
|
|
1239
|
+
result = new EmptyConstructor();
|
|
1240
|
+
EmptyConstructor[PROTOTYPE] = null;
|
|
1241
|
+
// add "__proto__" for Object.getPrototypeOf polyfill
|
|
1242
|
+
result[IE_PROTO$1] = O;
|
|
1243
|
+
} else result = NullProtoObject();
|
|
1244
|
+
return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
|
|
1245
|
+
};
|
|
1246
|
+
|
|
1247
|
+
var wellKnownSymbol$8 = wellKnownSymbol$c;
|
|
1248
|
+
var create$2 = objectCreate;
|
|
1249
|
+
var defineProperty$2 = objectDefineProperty.f;
|
|
1250
|
+
|
|
1251
|
+
var UNSCOPABLES = wellKnownSymbol$8('unscopables');
|
|
1252
|
+
var ArrayPrototype$1 = Array.prototype;
|
|
1253
|
+
|
|
1254
|
+
// Array.prototype[@@unscopables]
|
|
1255
|
+
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
|
|
1256
|
+
if (ArrayPrototype$1[UNSCOPABLES] === undefined) {
|
|
1257
|
+
defineProperty$2(ArrayPrototype$1, UNSCOPABLES, {
|
|
1258
|
+
configurable: true,
|
|
1259
|
+
value: create$2(null)
|
|
1260
|
+
});
|
|
1261
|
+
}
|
|
1262
|
+
|
|
1263
|
+
// add a key to Array.prototype[@@unscopables]
|
|
1264
|
+
var addToUnscopables$1 = function (key) {
|
|
1265
|
+
ArrayPrototype$1[UNSCOPABLES][key] = true;
|
|
1266
|
+
};
|
|
1267
|
+
|
|
1268
|
+
var iterators = {};
|
|
1269
|
+
|
|
1270
|
+
var fails$4 = fails$d;
|
|
1271
|
+
|
|
1272
|
+
var correctPrototypeGetter = !fails$4(function () {
|
|
1273
|
+
function F() { /* empty */ }
|
|
1274
|
+
F.prototype.constructor = null;
|
|
1275
|
+
// eslint-disable-next-line es/no-object-getprototypeof -- required for testing
|
|
1276
|
+
return Object.getPrototypeOf(new F()) !== F.prototype;
|
|
1277
|
+
});
|
|
1278
|
+
|
|
1279
|
+
var hasOwn$3 = hasOwnProperty_1;
|
|
1280
|
+
var isCallable$3 = isCallable$g;
|
|
1281
|
+
var toObject = toObject$2;
|
|
1282
|
+
var sharedKey = sharedKey$3;
|
|
1283
|
+
var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
|
|
1284
|
+
|
|
1285
|
+
var IE_PROTO = sharedKey('IE_PROTO');
|
|
1286
|
+
var $Object = Object;
|
|
1287
|
+
var ObjectPrototype = $Object.prototype;
|
|
1288
|
+
|
|
1289
|
+
// `Object.getPrototypeOf` method
|
|
1290
|
+
// https://tc39.es/ecma262/#sec-object.getprototypeof
|
|
1291
|
+
// eslint-disable-next-line es/no-object-getprototypeof -- safe
|
|
1292
|
+
var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function (O) {
|
|
1293
|
+
var object = toObject(O);
|
|
1294
|
+
if (hasOwn$3(object, IE_PROTO)) return object[IE_PROTO];
|
|
1295
|
+
var constructor = object.constructor;
|
|
1296
|
+
if (isCallable$3(constructor) && object instanceof constructor) {
|
|
1297
|
+
return constructor.prototype;
|
|
1298
|
+
} return object instanceof $Object ? ObjectPrototype : null;
|
|
1299
|
+
};
|
|
1300
|
+
|
|
1301
|
+
var fails$3 = fails$d;
|
|
1302
|
+
var isCallable$2 = isCallable$g;
|
|
1303
|
+
var isObject$2 = isObject$8;
|
|
1304
|
+
var getPrototypeOf$2 = objectGetPrototypeOf;
|
|
1305
|
+
var defineBuiltIn$3 = defineBuiltIn$5;
|
|
1306
|
+
var wellKnownSymbol$7 = wellKnownSymbol$c;
|
|
1307
|
+
|
|
1308
|
+
var ITERATOR$6 = wellKnownSymbol$7('iterator');
|
|
1309
|
+
var BUGGY_SAFARI_ITERATORS$1 = false;
|
|
1310
|
+
|
|
1311
|
+
// `%IteratorPrototype%` object
|
|
1312
|
+
// https://tc39.es/ecma262/#sec-%iteratorprototype%-object
|
|
1313
|
+
var IteratorPrototype$4, PrototypeOfArrayIteratorPrototype, arrayIterator;
|
|
1314
|
+
|
|
1315
|
+
/* eslint-disable es/no-array-prototype-keys -- safe */
|
|
1316
|
+
if ([].keys) {
|
|
1317
|
+
arrayIterator = [].keys();
|
|
1318
|
+
// Safari 8 has buggy iterators w/o `next`
|
|
1319
|
+
if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS$1 = true;
|
|
1320
|
+
else {
|
|
1321
|
+
PrototypeOfArrayIteratorPrototype = getPrototypeOf$2(getPrototypeOf$2(arrayIterator));
|
|
1322
|
+
if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype$4 = PrototypeOfArrayIteratorPrototype;
|
|
1323
|
+
}
|
|
1324
|
+
}
|
|
1325
|
+
|
|
1326
|
+
var NEW_ITERATOR_PROTOTYPE = !isObject$2(IteratorPrototype$4) || fails$3(function () {
|
|
1327
|
+
var test = {};
|
|
1328
|
+
// FF44- legacy iterators case
|
|
1329
|
+
return IteratorPrototype$4[ITERATOR$6].call(test) !== test;
|
|
1330
|
+
});
|
|
1331
|
+
|
|
1332
|
+
if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$4 = {};
|
|
1333
|
+
|
|
1334
|
+
// `%IteratorPrototype%[@@iterator]()` method
|
|
1335
|
+
// https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
|
|
1336
|
+
if (!isCallable$2(IteratorPrototype$4[ITERATOR$6])) {
|
|
1337
|
+
defineBuiltIn$3(IteratorPrototype$4, ITERATOR$6, function () {
|
|
1338
|
+
return this;
|
|
1339
|
+
});
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1342
|
+
var iteratorsCore = {
|
|
1343
|
+
IteratorPrototype: IteratorPrototype$4,
|
|
1344
|
+
BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1
|
|
1345
|
+
};
|
|
1346
|
+
|
|
1347
|
+
var defineProperty$1 = objectDefineProperty.f;
|
|
1348
|
+
var hasOwn$2 = hasOwnProperty_1;
|
|
1349
|
+
var wellKnownSymbol$6 = wellKnownSymbol$c;
|
|
1350
|
+
|
|
1351
|
+
var TO_STRING_TAG$2 = wellKnownSymbol$6('toStringTag');
|
|
1352
|
+
|
|
1353
|
+
var setToStringTag$3 = function (target, TAG, STATIC) {
|
|
1354
|
+
if (target && !STATIC) target = target.prototype;
|
|
1355
|
+
if (target && !hasOwn$2(target, TO_STRING_TAG$2)) {
|
|
1356
|
+
defineProperty$1(target, TO_STRING_TAG$2, { configurable: true, value: TAG });
|
|
1357
|
+
}
|
|
1358
|
+
};
|
|
1359
|
+
|
|
1360
|
+
var IteratorPrototype$3 = iteratorsCore.IteratorPrototype;
|
|
1361
|
+
var create$1 = objectCreate;
|
|
1362
|
+
var createPropertyDescriptor$1 = createPropertyDescriptor$4;
|
|
1363
|
+
var setToStringTag$2 = setToStringTag$3;
|
|
1364
|
+
var Iterators$4 = iterators;
|
|
1365
|
+
|
|
1366
|
+
var returnThis$1 = function () { return this; };
|
|
1367
|
+
|
|
1368
|
+
var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
|
|
1369
|
+
var TO_STRING_TAG = NAME + ' Iterator';
|
|
1370
|
+
IteratorConstructor.prototype = create$1(IteratorPrototype$3, { next: createPropertyDescriptor$1(+!ENUMERABLE_NEXT, next) });
|
|
1371
|
+
setToStringTag$2(IteratorConstructor, TO_STRING_TAG, false);
|
|
1372
|
+
Iterators$4[TO_STRING_TAG] = returnThis$1;
|
|
1373
|
+
return IteratorConstructor;
|
|
1374
|
+
};
|
|
1375
|
+
|
|
1376
|
+
var uncurryThis$4 = functionUncurryThis;
|
|
1377
|
+
var aCallable$4 = aCallable$6;
|
|
1378
|
+
|
|
1379
|
+
var functionUncurryThisAccessor = function (object, key, method) {
|
|
1380
|
+
try {
|
|
1381
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
1382
|
+
return uncurryThis$4(aCallable$4(Object.getOwnPropertyDescriptor(object, key)[method]));
|
|
1383
|
+
} catch (error) { /* empty */ }
|
|
1384
|
+
};
|
|
1385
|
+
|
|
1386
|
+
var isObject$1 = isObject$8;
|
|
1387
|
+
|
|
1388
|
+
var isPossiblePrototype$1 = function (argument) {
|
|
1389
|
+
return isObject$1(argument) || argument === null;
|
|
1390
|
+
};
|
|
1391
|
+
|
|
1392
|
+
var isPossiblePrototype = isPossiblePrototype$1;
|
|
1393
|
+
|
|
1394
|
+
var $String = String;
|
|
1395
|
+
var $TypeError$4 = TypeError;
|
|
1396
|
+
|
|
1397
|
+
var aPossiblePrototype$1 = function (argument) {
|
|
1398
|
+
if (isPossiblePrototype(argument)) return argument;
|
|
1399
|
+
throw new $TypeError$4("Can't set " + $String(argument) + ' as a prototype');
|
|
1400
|
+
};
|
|
1401
|
+
|
|
1402
|
+
/* eslint-disable no-proto -- safe */
|
|
1403
|
+
var uncurryThisAccessor = functionUncurryThisAccessor;
|
|
1404
|
+
var isObject = isObject$8;
|
|
1405
|
+
var requireObjectCoercible$1 = requireObjectCoercible$4;
|
|
1406
|
+
var aPossiblePrototype = aPossiblePrototype$1;
|
|
1407
|
+
|
|
1408
|
+
// `Object.setPrototypeOf` method
|
|
1409
|
+
// https://tc39.es/ecma262/#sec-object.setprototypeof
|
|
1410
|
+
// Works with __proto__ only. Old v8 can't work with null proto objects.
|
|
1411
|
+
// eslint-disable-next-line es/no-object-setprototypeof -- safe
|
|
1412
|
+
var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
|
|
1413
|
+
var CORRECT_SETTER = false;
|
|
1414
|
+
var test = {};
|
|
1415
|
+
var setter;
|
|
1416
|
+
try {
|
|
1417
|
+
setter = uncurryThisAccessor(Object.prototype, '__proto__', 'set');
|
|
1418
|
+
setter(test, []);
|
|
1419
|
+
CORRECT_SETTER = test instanceof Array;
|
|
1420
|
+
} catch (error) { /* empty */ }
|
|
1421
|
+
return function setPrototypeOf(O, proto) {
|
|
1422
|
+
requireObjectCoercible$1(O);
|
|
1423
|
+
aPossiblePrototype(proto);
|
|
1424
|
+
if (!isObject(O)) return O;
|
|
1425
|
+
if (CORRECT_SETTER) setter(O, proto);
|
|
1426
|
+
else O.__proto__ = proto;
|
|
1427
|
+
return O;
|
|
1428
|
+
};
|
|
1429
|
+
}() : undefined);
|
|
1430
|
+
|
|
1431
|
+
var $$4 = _export;
|
|
1432
|
+
var call$6 = functionCall;
|
|
1433
|
+
var FunctionName = functionName;
|
|
1434
|
+
var isCallable$1 = isCallable$g;
|
|
1435
|
+
var createIteratorConstructor = iteratorCreateConstructor;
|
|
1436
|
+
var getPrototypeOf$1 = objectGetPrototypeOf;
|
|
1437
|
+
var setPrototypeOf = objectSetPrototypeOf;
|
|
1438
|
+
var setToStringTag$1 = setToStringTag$3;
|
|
1439
|
+
var createNonEnumerableProperty$2 = createNonEnumerableProperty$5;
|
|
1440
|
+
var defineBuiltIn$2 = defineBuiltIn$5;
|
|
1441
|
+
var wellKnownSymbol$5 = wellKnownSymbol$c;
|
|
1442
|
+
var Iterators$3 = iterators;
|
|
1443
|
+
var IteratorsCore = iteratorsCore;
|
|
1444
|
+
|
|
1445
|
+
var PROPER_FUNCTION_NAME$1 = FunctionName.PROPER;
|
|
1446
|
+
var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
|
|
1447
|
+
var IteratorPrototype$2 = IteratorsCore.IteratorPrototype;
|
|
1448
|
+
var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
|
|
1449
|
+
var ITERATOR$5 = wellKnownSymbol$5('iterator');
|
|
1450
|
+
var KEYS = 'keys';
|
|
1451
|
+
var VALUES = 'values';
|
|
1452
|
+
var ENTRIES = 'entries';
|
|
1453
|
+
|
|
1454
|
+
var returnThis = function () { return this; };
|
|
1455
|
+
|
|
1456
|
+
var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
|
|
1457
|
+
createIteratorConstructor(IteratorConstructor, NAME, next);
|
|
1458
|
+
|
|
1459
|
+
var getIterationMethod = function (KIND) {
|
|
1460
|
+
if (KIND === DEFAULT && defaultIterator) return defaultIterator;
|
|
1461
|
+
if (!BUGGY_SAFARI_ITERATORS && KIND && KIND in IterablePrototype) return IterablePrototype[KIND];
|
|
1462
|
+
|
|
1463
|
+
switch (KIND) {
|
|
1464
|
+
case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
|
|
1465
|
+
case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
|
|
1466
|
+
case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1469
|
+
return function () { return new IteratorConstructor(this); };
|
|
1470
|
+
};
|
|
1471
|
+
|
|
1472
|
+
var TO_STRING_TAG = NAME + ' Iterator';
|
|
1473
|
+
var INCORRECT_VALUES_NAME = false;
|
|
1474
|
+
var IterablePrototype = Iterable.prototype;
|
|
1475
|
+
var nativeIterator = IterablePrototype[ITERATOR$5]
|
|
1476
|
+
|| IterablePrototype['@@iterator']
|
|
1477
|
+
|| DEFAULT && IterablePrototype[DEFAULT];
|
|
1478
|
+
var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
|
|
1479
|
+
var anyNativeIterator = NAME === 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
|
|
1480
|
+
var CurrentIteratorPrototype, methods, KEY;
|
|
1481
|
+
|
|
1482
|
+
// fix native
|
|
1483
|
+
if (anyNativeIterator) {
|
|
1484
|
+
CurrentIteratorPrototype = getPrototypeOf$1(anyNativeIterator.call(new Iterable()));
|
|
1485
|
+
if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
|
|
1486
|
+
if (getPrototypeOf$1(CurrentIteratorPrototype) !== IteratorPrototype$2) {
|
|
1487
|
+
if (setPrototypeOf) {
|
|
1488
|
+
setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype$2);
|
|
1489
|
+
} else if (!isCallable$1(CurrentIteratorPrototype[ITERATOR$5])) {
|
|
1490
|
+
defineBuiltIn$2(CurrentIteratorPrototype, ITERATOR$5, returnThis);
|
|
1491
|
+
}
|
|
1492
|
+
}
|
|
1493
|
+
// Set @@toStringTag to native iterators
|
|
1494
|
+
setToStringTag$1(CurrentIteratorPrototype, TO_STRING_TAG, true);
|
|
1495
|
+
}
|
|
1496
|
+
}
|
|
1497
|
+
|
|
1498
|
+
// fix Array.prototype.{ values, @@iterator }.name in V8 / FF
|
|
1499
|
+
if (PROPER_FUNCTION_NAME$1 && DEFAULT === VALUES && nativeIterator && nativeIterator.name !== VALUES) {
|
|
1500
|
+
if (CONFIGURABLE_FUNCTION_NAME) {
|
|
1501
|
+
createNonEnumerableProperty$2(IterablePrototype, 'name', VALUES);
|
|
1502
|
+
} else {
|
|
1503
|
+
INCORRECT_VALUES_NAME = true;
|
|
1504
|
+
defaultIterator = function values() { return call$6(nativeIterator, this); };
|
|
1505
|
+
}
|
|
1506
|
+
}
|
|
1507
|
+
|
|
1508
|
+
// export additional methods
|
|
1509
|
+
if (DEFAULT) {
|
|
1510
|
+
methods = {
|
|
1511
|
+
values: getIterationMethod(VALUES),
|
|
1512
|
+
keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
|
|
1513
|
+
entries: getIterationMethod(ENTRIES)
|
|
1514
|
+
};
|
|
1515
|
+
if (FORCED) for (KEY in methods) {
|
|
1516
|
+
if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
|
|
1517
|
+
defineBuiltIn$2(IterablePrototype, KEY, methods[KEY]);
|
|
1518
|
+
}
|
|
1519
|
+
} else $$4({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
|
|
1520
|
+
}
|
|
1521
|
+
|
|
1522
|
+
// define iterator
|
|
1523
|
+
if (IterablePrototype[ITERATOR$5] !== defaultIterator) {
|
|
1524
|
+
defineBuiltIn$2(IterablePrototype, ITERATOR$5, defaultIterator, { name: DEFAULT });
|
|
1525
|
+
}
|
|
1526
|
+
Iterators$3[NAME] = defaultIterator;
|
|
1527
|
+
|
|
1528
|
+
return methods;
|
|
1529
|
+
};
|
|
1530
|
+
|
|
1531
|
+
// `CreateIterResultObject` abstract operation
|
|
1532
|
+
// https://tc39.es/ecma262/#sec-createiterresultobject
|
|
1533
|
+
var createIterResultObject$2 = function (value, done) {
|
|
1534
|
+
return { value: value, done: done };
|
|
1535
|
+
};
|
|
1536
|
+
|
|
1537
|
+
var toIndexedObject = toIndexedObject$5;
|
|
1538
|
+
var addToUnscopables = addToUnscopables$1;
|
|
1539
|
+
var Iterators$2 = iterators;
|
|
1540
|
+
var InternalStateModule$1 = internalState;
|
|
1541
|
+
var defineProperty = objectDefineProperty.f;
|
|
1542
|
+
var defineIterator = iteratorDefine;
|
|
1543
|
+
var createIterResultObject$1 = createIterResultObject$2;
|
|
1544
|
+
var DESCRIPTORS$2 = descriptors;
|
|
1545
|
+
|
|
1546
|
+
var ARRAY_ITERATOR = 'Array Iterator';
|
|
1547
|
+
var setInternalState$1 = InternalStateModule$1.set;
|
|
1548
|
+
var getInternalState = InternalStateModule$1.getterFor(ARRAY_ITERATOR);
|
|
1549
|
+
|
|
1550
|
+
// `Array.prototype.entries` method
|
|
1551
|
+
// https://tc39.es/ecma262/#sec-array.prototype.entries
|
|
1552
|
+
// `Array.prototype.keys` method
|
|
1553
|
+
// https://tc39.es/ecma262/#sec-array.prototype.keys
|
|
1554
|
+
// `Array.prototype.values` method
|
|
1555
|
+
// https://tc39.es/ecma262/#sec-array.prototype.values
|
|
1556
|
+
// `Array.prototype[@@iterator]` method
|
|
1557
|
+
// https://tc39.es/ecma262/#sec-array.prototype-@@iterator
|
|
1558
|
+
// `CreateArrayIterator` internal method
|
|
1559
|
+
// https://tc39.es/ecma262/#sec-createarrayiterator
|
|
1560
|
+
var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind) {
|
|
1561
|
+
setInternalState$1(this, {
|
|
1562
|
+
type: ARRAY_ITERATOR,
|
|
1563
|
+
target: toIndexedObject(iterated), // target
|
|
1564
|
+
index: 0, // next index
|
|
1565
|
+
kind: kind // kind
|
|
1566
|
+
});
|
|
1567
|
+
// `%ArrayIteratorPrototype%.next` method
|
|
1568
|
+
// https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
|
|
1569
|
+
}, function () {
|
|
1570
|
+
var state = getInternalState(this);
|
|
1571
|
+
var target = state.target;
|
|
1572
|
+
var index = state.index++;
|
|
1573
|
+
if (!target || index >= target.length) {
|
|
1574
|
+
state.target = undefined;
|
|
1575
|
+
return createIterResultObject$1(undefined, true);
|
|
1576
|
+
}
|
|
1577
|
+
switch (state.kind) {
|
|
1578
|
+
case 'keys': return createIterResultObject$1(index, false);
|
|
1579
|
+
case 'values': return createIterResultObject$1(target[index], false);
|
|
1580
|
+
} return createIterResultObject$1([index, target[index]], false);
|
|
1581
|
+
}, 'values');
|
|
1582
|
+
|
|
1583
|
+
// argumentsList[@@iterator] is %ArrayProto_values%
|
|
1584
|
+
// https://tc39.es/ecma262/#sec-createunmappedargumentsobject
|
|
1585
|
+
// https://tc39.es/ecma262/#sec-createmappedargumentsobject
|
|
1586
|
+
var values = Iterators$2.Arguments = Iterators$2.Array;
|
|
1587
|
+
|
|
1588
|
+
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
|
|
1589
|
+
addToUnscopables('keys');
|
|
1590
|
+
addToUnscopables('values');
|
|
1591
|
+
addToUnscopables('entries');
|
|
1592
|
+
|
|
1593
|
+
// V8 ~ Chrome 45- bug
|
|
1594
|
+
if (DESCRIPTORS$2 && values.name !== 'values') try {
|
|
1595
|
+
defineProperty(values, 'name', { value: 'values' });
|
|
1596
|
+
} catch (error) { /* empty */ }
|
|
1597
|
+
|
|
1598
|
+
// `GetIteratorDirect(obj)` abstract operation
|
|
1599
|
+
// https://tc39.es/proposal-iterator-helpers/#sec-getiteratordirect
|
|
1600
|
+
var getIteratorDirect$2 = function (obj) {
|
|
1601
|
+
return {
|
|
1602
|
+
iterator: obj,
|
|
1603
|
+
next: obj.next,
|
|
1604
|
+
done: false
|
|
1605
|
+
};
|
|
1606
|
+
};
|
|
1607
|
+
|
|
1608
|
+
var defineBuiltIn$1 = defineBuiltIn$5;
|
|
1609
|
+
|
|
1610
|
+
var defineBuiltIns$1 = function (target, src, options) {
|
|
1611
|
+
for (var key in src) defineBuiltIn$1(target, key, src[key], options);
|
|
1612
|
+
return target;
|
|
1613
|
+
};
|
|
1614
|
+
|
|
1615
|
+
var call$5 = functionCall;
|
|
1616
|
+
var anObject$8 = anObject$d;
|
|
1617
|
+
var getMethod$2 = getMethod$4;
|
|
1618
|
+
|
|
1619
|
+
var iteratorClose$3 = function (iterator, kind, value) {
|
|
1620
|
+
var innerResult, innerError;
|
|
1621
|
+
anObject$8(iterator);
|
|
1622
|
+
try {
|
|
1623
|
+
innerResult = getMethod$2(iterator, 'return');
|
|
1624
|
+
if (!innerResult) {
|
|
1625
|
+
if (kind === 'throw') throw value;
|
|
1626
|
+
return value;
|
|
1627
|
+
}
|
|
1628
|
+
innerResult = call$5(innerResult, iterator);
|
|
1629
|
+
} catch (error) {
|
|
1630
|
+
innerError = true;
|
|
1631
|
+
innerResult = error;
|
|
1632
|
+
}
|
|
1633
|
+
if (kind === 'throw') throw value;
|
|
1634
|
+
if (innerError) throw innerResult;
|
|
1635
|
+
anObject$8(innerResult);
|
|
1636
|
+
return value;
|
|
1637
|
+
};
|
|
1638
|
+
|
|
1639
|
+
var call$4 = functionCall;
|
|
1640
|
+
var create = objectCreate;
|
|
1641
|
+
var createNonEnumerableProperty$1 = createNonEnumerableProperty$5;
|
|
1642
|
+
var defineBuiltIns = defineBuiltIns$1;
|
|
1643
|
+
var wellKnownSymbol$4 = wellKnownSymbol$c;
|
|
1644
|
+
var InternalStateModule = internalState;
|
|
1645
|
+
var getMethod$1 = getMethod$4;
|
|
1646
|
+
var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
|
|
1647
|
+
var createIterResultObject = createIterResultObject$2;
|
|
1648
|
+
var iteratorClose$2 = iteratorClose$3;
|
|
1649
|
+
|
|
1650
|
+
var TO_STRING_TAG$1 = wellKnownSymbol$4('toStringTag');
|
|
1651
|
+
var ITERATOR_HELPER = 'IteratorHelper';
|
|
1652
|
+
var WRAP_FOR_VALID_ITERATOR = 'WrapForValidIterator';
|
|
1653
|
+
var setInternalState = InternalStateModule.set;
|
|
1654
|
+
|
|
1655
|
+
var createIteratorProxyPrototype = function (IS_ITERATOR) {
|
|
1656
|
+
var getInternalState = InternalStateModule.getterFor(IS_ITERATOR ? WRAP_FOR_VALID_ITERATOR : ITERATOR_HELPER);
|
|
1657
|
+
|
|
1658
|
+
return defineBuiltIns(create(IteratorPrototype$1), {
|
|
1659
|
+
next: function next() {
|
|
1660
|
+
var state = getInternalState(this);
|
|
1661
|
+
// for simplification:
|
|
1662
|
+
// for `%WrapForValidIteratorPrototype%.next` our `nextHandler` returns `IterResultObject`
|
|
1663
|
+
// for `%IteratorHelperPrototype%.next` - just a value
|
|
1664
|
+
if (IS_ITERATOR) return state.nextHandler();
|
|
1665
|
+
try {
|
|
1666
|
+
var result = state.done ? undefined : state.nextHandler();
|
|
1667
|
+
return createIterResultObject(result, state.done);
|
|
1668
|
+
} catch (error) {
|
|
1669
|
+
state.done = true;
|
|
1670
|
+
throw error;
|
|
1671
|
+
}
|
|
1672
|
+
},
|
|
1673
|
+
'return': function () {
|
|
1674
|
+
var state = getInternalState(this);
|
|
1675
|
+
var iterator = state.iterator;
|
|
1676
|
+
state.done = true;
|
|
1677
|
+
if (IS_ITERATOR) {
|
|
1678
|
+
var returnMethod = getMethod$1(iterator, 'return');
|
|
1679
|
+
return returnMethod ? call$4(returnMethod, iterator) : createIterResultObject(undefined, true);
|
|
1680
|
+
}
|
|
1681
|
+
if (state.inner) try {
|
|
1682
|
+
iteratorClose$2(state.inner.iterator, 'normal');
|
|
1683
|
+
} catch (error) {
|
|
1684
|
+
return iteratorClose$2(iterator, 'throw', error);
|
|
1685
|
+
}
|
|
1686
|
+
iteratorClose$2(iterator, 'normal');
|
|
1687
|
+
return createIterResultObject(undefined, true);
|
|
1688
|
+
}
|
|
1689
|
+
});
|
|
1690
|
+
};
|
|
1691
|
+
|
|
1692
|
+
var WrapForValidIteratorPrototype = createIteratorProxyPrototype(true);
|
|
1693
|
+
var IteratorHelperPrototype = createIteratorProxyPrototype(false);
|
|
1694
|
+
|
|
1695
|
+
createNonEnumerableProperty$1(IteratorHelperPrototype, TO_STRING_TAG$1, 'Iterator Helper');
|
|
1696
|
+
|
|
1697
|
+
var iteratorCreateProxy = function (nextHandler, IS_ITERATOR) {
|
|
1698
|
+
var IteratorProxy = function Iterator(record, state) {
|
|
1699
|
+
if (state) {
|
|
1700
|
+
state.iterator = record.iterator;
|
|
1701
|
+
state.next = record.next;
|
|
1702
|
+
} else state = record;
|
|
1703
|
+
state.type = IS_ITERATOR ? WRAP_FOR_VALID_ITERATOR : ITERATOR_HELPER;
|
|
1704
|
+
state.nextHandler = nextHandler;
|
|
1705
|
+
state.counter = 0;
|
|
1706
|
+
state.done = false;
|
|
1707
|
+
setInternalState(this, state);
|
|
1708
|
+
};
|
|
1709
|
+
|
|
1710
|
+
IteratorProxy.prototype = IS_ITERATOR ? WrapForValidIteratorPrototype : IteratorHelperPrototype;
|
|
1711
|
+
|
|
1712
|
+
return IteratorProxy;
|
|
1713
|
+
};
|
|
1714
|
+
|
|
1715
|
+
var anObject$7 = anObject$d;
|
|
1716
|
+
var iteratorClose$1 = iteratorClose$3;
|
|
1717
|
+
|
|
1718
|
+
// call something on iterator step with safe closing on error
|
|
1719
|
+
var callWithSafeIterationClosing$1 = function (iterator, fn, value, ENTRIES) {
|
|
1720
|
+
try {
|
|
1721
|
+
return ENTRIES ? fn(anObject$7(value)[0], value[1]) : fn(value);
|
|
1722
|
+
} catch (error) {
|
|
1723
|
+
iteratorClose$1(iterator, 'throw', error);
|
|
1724
|
+
}
|
|
1725
|
+
};
|
|
1726
|
+
|
|
1727
|
+
var call$3 = functionCall;
|
|
1728
|
+
var aCallable$3 = aCallable$6;
|
|
1729
|
+
var anObject$6 = anObject$d;
|
|
1730
|
+
var getIteratorDirect$1 = getIteratorDirect$2;
|
|
1731
|
+
var createIteratorProxy = iteratorCreateProxy;
|
|
1732
|
+
var callWithSafeIterationClosing = callWithSafeIterationClosing$1;
|
|
1733
|
+
|
|
1734
|
+
var IteratorProxy = createIteratorProxy(function () {
|
|
1735
|
+
var iterator = this.iterator;
|
|
1736
|
+
var result = anObject$6(call$3(this.next, iterator));
|
|
1737
|
+
var done = this.done = !!result.done;
|
|
1738
|
+
if (!done) return callWithSafeIterationClosing(iterator, this.mapper, [result.value, this.counter++], true);
|
|
1739
|
+
});
|
|
1740
|
+
|
|
1741
|
+
// `Iterator.prototype.map` method
|
|
1742
|
+
// https://github.com/tc39/proposal-iterator-helpers
|
|
1743
|
+
var iteratorMap = function map(mapper) {
|
|
1744
|
+
anObject$6(this);
|
|
1745
|
+
aCallable$3(mapper);
|
|
1746
|
+
return new IteratorProxy(getIteratorDirect$1(this), {
|
|
1747
|
+
mapper: mapper
|
|
1748
|
+
});
|
|
1749
|
+
};
|
|
1750
|
+
|
|
1751
|
+
var $$3 = _export;
|
|
1752
|
+
var map = iteratorMap;
|
|
1753
|
+
var IS_PURE = isPure;
|
|
1754
|
+
|
|
1755
|
+
// `Iterator.prototype.map` method
|
|
1756
|
+
// https://github.com/tc39/proposal-iterator-helpers
|
|
1757
|
+
$$3({ target: 'Iterator', proto: true, real: true, forced: IS_PURE }, {
|
|
1758
|
+
map: map
|
|
1759
|
+
});
|
|
1760
|
+
|
|
1761
|
+
// iterable DOM collections
|
|
1762
|
+
// flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
|
|
1763
|
+
var domIterables = {
|
|
1764
|
+
CSSRuleList: 0,
|
|
1765
|
+
CSSStyleDeclaration: 0,
|
|
1766
|
+
CSSValueList: 0,
|
|
1767
|
+
ClientRectList: 0,
|
|
1768
|
+
DOMRectList: 0,
|
|
1769
|
+
DOMStringList: 0,
|
|
1770
|
+
DOMTokenList: 1,
|
|
1771
|
+
DataTransferItemList: 0,
|
|
1772
|
+
FileList: 0,
|
|
1773
|
+
HTMLAllCollection: 0,
|
|
1774
|
+
HTMLCollection: 0,
|
|
1775
|
+
HTMLFormElement: 0,
|
|
1776
|
+
HTMLSelectElement: 0,
|
|
1777
|
+
MediaList: 0,
|
|
1778
|
+
MimeTypeArray: 0,
|
|
1779
|
+
NamedNodeMap: 0,
|
|
1780
|
+
NodeList: 1,
|
|
1781
|
+
PaintRequestList: 0,
|
|
1782
|
+
Plugin: 0,
|
|
1783
|
+
PluginArray: 0,
|
|
1784
|
+
SVGLengthList: 0,
|
|
1785
|
+
SVGNumberList: 0,
|
|
1786
|
+
SVGPathSegList: 0,
|
|
1787
|
+
SVGPointList: 0,
|
|
1788
|
+
SVGStringList: 0,
|
|
1789
|
+
SVGTransformList: 0,
|
|
1790
|
+
SourceBufferList: 0,
|
|
1791
|
+
StyleSheetList: 0,
|
|
1792
|
+
TextTrackCueList: 0,
|
|
1793
|
+
TextTrackList: 0,
|
|
1794
|
+
TouchList: 0
|
|
1795
|
+
};
|
|
1796
|
+
|
|
1797
|
+
// in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`
|
|
1798
|
+
var documentCreateElement = documentCreateElement$2;
|
|
1799
|
+
|
|
1800
|
+
var classList = documentCreateElement('span').classList;
|
|
1801
|
+
var DOMTokenListPrototype$1 = classList && classList.constructor && classList.constructor.prototype;
|
|
1802
|
+
|
|
1803
|
+
var domTokenListPrototype = DOMTokenListPrototype$1 === Object.prototype ? undefined : DOMTokenListPrototype$1;
|
|
1804
|
+
|
|
1805
|
+
var global$3 = global$e;
|
|
1806
|
+
var DOMIterables = domIterables;
|
|
1807
|
+
var DOMTokenListPrototype = domTokenListPrototype;
|
|
1808
|
+
var ArrayIteratorMethods = es_array_iterator;
|
|
1809
|
+
var createNonEnumerableProperty = createNonEnumerableProperty$5;
|
|
1810
|
+
var setToStringTag = setToStringTag$3;
|
|
1811
|
+
var wellKnownSymbol$3 = wellKnownSymbol$c;
|
|
1812
|
+
|
|
1813
|
+
var ITERATOR$4 = wellKnownSymbol$3('iterator');
|
|
1814
|
+
var ArrayValues = ArrayIteratorMethods.values;
|
|
1815
|
+
|
|
1816
|
+
var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
|
|
1817
|
+
if (CollectionPrototype) {
|
|
1818
|
+
// some Chrome versions have non-configurable methods on DOMTokenList
|
|
1819
|
+
if (CollectionPrototype[ITERATOR$4] !== ArrayValues) try {
|
|
1820
|
+
createNonEnumerableProperty(CollectionPrototype, ITERATOR$4, ArrayValues);
|
|
1821
|
+
} catch (error) {
|
|
1822
|
+
CollectionPrototype[ITERATOR$4] = ArrayValues;
|
|
1823
|
+
}
|
|
1824
|
+
setToStringTag(CollectionPrototype, COLLECTION_NAME, true);
|
|
1825
|
+
if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
|
|
1826
|
+
// some Chrome versions have non-configurable methods on DOMTokenList
|
|
1827
|
+
if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {
|
|
1828
|
+
createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
|
|
1829
|
+
} catch (error) {
|
|
1830
|
+
CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
|
|
1831
|
+
}
|
|
1832
|
+
}
|
|
1833
|
+
}
|
|
1834
|
+
};
|
|
1835
|
+
|
|
1836
|
+
for (var COLLECTION_NAME in DOMIterables) {
|
|
1837
|
+
handlePrototype(global$3[COLLECTION_NAME] && global$3[COLLECTION_NAME].prototype, COLLECTION_NAME);
|
|
1838
|
+
}
|
|
1839
|
+
|
|
1840
|
+
handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
|
|
1841
|
+
|
|
1842
|
+
var propTypes = {exports: {}};
|
|
1843
|
+
|
|
1844
|
+
var reactIs = {exports: {}};
|
|
1845
|
+
|
|
1846
|
+
var reactIs_production_min = {};
|
|
1847
|
+
|
|
1848
|
+
/** @license React v16.13.1
|
|
1849
|
+
* react-is.production.min.js
|
|
1850
|
+
*
|
|
1851
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
1852
|
+
*
|
|
1853
|
+
* This source code is licensed under the MIT license found in the
|
|
1854
|
+
* LICENSE file in the root directory of this source tree.
|
|
1855
|
+
*/
|
|
1856
|
+
|
|
1857
|
+
var hasRequiredReactIs_production_min;
|
|
1858
|
+
|
|
1859
|
+
function requireReactIs_production_min () {
|
|
1860
|
+
if (hasRequiredReactIs_production_min) return reactIs_production_min;
|
|
1861
|
+
hasRequiredReactIs_production_min = 1;
|
|
1862
|
+
var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?
|
|
1863
|
+
Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119;
|
|
1864
|
+
function z(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:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}reactIs_production_min.AsyncMode=l;reactIs_production_min.ConcurrentMode=m;reactIs_production_min.ContextConsumer=k;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;
|
|
1865
|
+
reactIs_production_min.Profiler=g;reactIs_production_min.StrictMode=f;reactIs_production_min.Suspense=p;reactIs_production_min.isAsyncMode=function(a){return A(a)||z(a)===l};reactIs_production_min.isConcurrentMode=A;reactIs_production_min.isContextConsumer=function(a){return z(a)===k};reactIs_production_min.isContextProvider=function(a){return z(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(a)===n};reactIs_production_min.isFragment=function(a){return z(a)===e};reactIs_production_min.isLazy=function(a){return z(a)===t};
|
|
1866
|
+
reactIs_production_min.isMemo=function(a){return z(a)===r};reactIs_production_min.isPortal=function(a){return z(a)===d};reactIs_production_min.isProfiler=function(a){return z(a)===g};reactIs_production_min.isStrictMode=function(a){return z(a)===f};reactIs_production_min.isSuspense=function(a){return z(a)===p};
|
|
1867
|
+
reactIs_production_min.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};reactIs_production_min.typeOf=z;
|
|
1868
|
+
return reactIs_production_min;
|
|
1869
|
+
}
|
|
1870
|
+
|
|
1871
|
+
var reactIs_development = {};
|
|
1872
|
+
|
|
1873
|
+
/** @license React v16.13.1
|
|
1874
|
+
* react-is.development.js
|
|
1875
|
+
*
|
|
1876
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
1877
|
+
*
|
|
1878
|
+
* This source code is licensed under the MIT license found in the
|
|
1879
|
+
* LICENSE file in the root directory of this source tree.
|
|
1880
|
+
*/
|
|
1881
|
+
|
|
1882
|
+
var hasRequiredReactIs_development;
|
|
1883
|
+
|
|
1884
|
+
function requireReactIs_development () {
|
|
1885
|
+
if (hasRequiredReactIs_development) return reactIs_development;
|
|
1886
|
+
hasRequiredReactIs_development = 1;
|
|
1887
|
+
|
|
1888
|
+
|
|
1889
|
+
|
|
1890
|
+
if (process.env.NODE_ENV !== "production") {
|
|
1891
|
+
(function() {
|
|
1892
|
+
|
|
1893
|
+
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
1894
|
+
// nor polyfill, then a plain number is used for performance.
|
|
1895
|
+
var hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
|
1896
|
+
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
|
|
1897
|
+
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
|
|
1898
|
+
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
|
|
1899
|
+
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
|
|
1900
|
+
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
|
|
1901
|
+
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
|
1902
|
+
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
|
|
1903
|
+
// (unstable) APIs that have been removed. Can we remove the symbols?
|
|
1904
|
+
|
|
1905
|
+
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
|
|
1906
|
+
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
|
|
1907
|
+
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
|
1908
|
+
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
|
|
1909
|
+
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
|
|
1910
|
+
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
|
1911
|
+
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
|
1912
|
+
var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
|
|
1913
|
+
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
|
|
1914
|
+
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
|
|
1915
|
+
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
|
|
1916
|
+
|
|
1917
|
+
function isValidElementType(type) {
|
|
1918
|
+
return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
1919
|
+
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);
|
|
1920
|
+
}
|
|
1921
|
+
|
|
1922
|
+
function typeOf(object) {
|
|
1923
|
+
if (typeof object === 'object' && object !== null) {
|
|
1924
|
+
var $$typeof = object.$$typeof;
|
|
1925
|
+
|
|
1926
|
+
switch ($$typeof) {
|
|
1927
|
+
case REACT_ELEMENT_TYPE:
|
|
1928
|
+
var type = object.type;
|
|
1929
|
+
|
|
1930
|
+
switch (type) {
|
|
1931
|
+
case REACT_ASYNC_MODE_TYPE:
|
|
1932
|
+
case REACT_CONCURRENT_MODE_TYPE:
|
|
1933
|
+
case REACT_FRAGMENT_TYPE:
|
|
1934
|
+
case REACT_PROFILER_TYPE:
|
|
1935
|
+
case REACT_STRICT_MODE_TYPE:
|
|
1936
|
+
case REACT_SUSPENSE_TYPE:
|
|
1937
|
+
return type;
|
|
1938
|
+
|
|
1939
|
+
default:
|
|
1940
|
+
var $$typeofType = type && type.$$typeof;
|
|
1941
|
+
|
|
1942
|
+
switch ($$typeofType) {
|
|
1943
|
+
case REACT_CONTEXT_TYPE:
|
|
1944
|
+
case REACT_FORWARD_REF_TYPE:
|
|
1945
|
+
case REACT_LAZY_TYPE:
|
|
1946
|
+
case REACT_MEMO_TYPE:
|
|
1947
|
+
case REACT_PROVIDER_TYPE:
|
|
1948
|
+
return $$typeofType;
|
|
1949
|
+
|
|
1950
|
+
default:
|
|
1951
|
+
return $$typeof;
|
|
1952
|
+
}
|
|
1953
|
+
|
|
1954
|
+
}
|
|
1955
|
+
|
|
1956
|
+
case REACT_PORTAL_TYPE:
|
|
1957
|
+
return $$typeof;
|
|
1958
|
+
}
|
|
1959
|
+
}
|
|
1960
|
+
|
|
1961
|
+
return undefined;
|
|
1962
|
+
} // AsyncMode is deprecated along with isAsyncMode
|
|
1963
|
+
|
|
1964
|
+
var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
|
1965
|
+
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
|
1966
|
+
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
1967
|
+
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
1968
|
+
var Element = REACT_ELEMENT_TYPE;
|
|
1969
|
+
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
1970
|
+
var Fragment = REACT_FRAGMENT_TYPE;
|
|
1971
|
+
var Lazy = REACT_LAZY_TYPE;
|
|
1972
|
+
var Memo = REACT_MEMO_TYPE;
|
|
1973
|
+
var Portal = REACT_PORTAL_TYPE;
|
|
1974
|
+
var Profiler = REACT_PROFILER_TYPE;
|
|
1975
|
+
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
1976
|
+
var Suspense = REACT_SUSPENSE_TYPE;
|
|
1977
|
+
var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
|
|
1978
|
+
|
|
1979
|
+
function isAsyncMode(object) {
|
|
1980
|
+
{
|
|
1981
|
+
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
1982
|
+
hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
|
|
1983
|
+
|
|
1984
|
+
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.');
|
|
1985
|
+
}
|
|
1986
|
+
}
|
|
1987
|
+
|
|
1988
|
+
return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
|
|
1989
|
+
}
|
|
1990
|
+
function isConcurrentMode(object) {
|
|
1991
|
+
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
|
|
1992
|
+
}
|
|
1993
|
+
function isContextConsumer(object) {
|
|
1994
|
+
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
1995
|
+
}
|
|
1996
|
+
function isContextProvider(object) {
|
|
1997
|
+
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
1998
|
+
}
|
|
1999
|
+
function isElement(object) {
|
|
2000
|
+
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
2001
|
+
}
|
|
2002
|
+
function isForwardRef(object) {
|
|
2003
|
+
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
2004
|
+
}
|
|
2005
|
+
function isFragment(object) {
|
|
2006
|
+
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
2007
|
+
}
|
|
2008
|
+
function isLazy(object) {
|
|
2009
|
+
return typeOf(object) === REACT_LAZY_TYPE;
|
|
2010
|
+
}
|
|
2011
|
+
function isMemo(object) {
|
|
2012
|
+
return typeOf(object) === REACT_MEMO_TYPE;
|
|
2013
|
+
}
|
|
2014
|
+
function isPortal(object) {
|
|
2015
|
+
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
2016
|
+
}
|
|
2017
|
+
function isProfiler(object) {
|
|
2018
|
+
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
2019
|
+
}
|
|
2020
|
+
function isStrictMode(object) {
|
|
2021
|
+
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
2022
|
+
}
|
|
2023
|
+
function isSuspense(object) {
|
|
2024
|
+
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
2025
|
+
}
|
|
2026
|
+
|
|
2027
|
+
reactIs_development.AsyncMode = AsyncMode;
|
|
2028
|
+
reactIs_development.ConcurrentMode = ConcurrentMode;
|
|
2029
|
+
reactIs_development.ContextConsumer = ContextConsumer;
|
|
2030
|
+
reactIs_development.ContextProvider = ContextProvider;
|
|
2031
|
+
reactIs_development.Element = Element;
|
|
2032
|
+
reactIs_development.ForwardRef = ForwardRef;
|
|
2033
|
+
reactIs_development.Fragment = Fragment;
|
|
2034
|
+
reactIs_development.Lazy = Lazy;
|
|
2035
|
+
reactIs_development.Memo = Memo;
|
|
2036
|
+
reactIs_development.Portal = Portal;
|
|
2037
|
+
reactIs_development.Profiler = Profiler;
|
|
2038
|
+
reactIs_development.StrictMode = StrictMode;
|
|
2039
|
+
reactIs_development.Suspense = Suspense;
|
|
2040
|
+
reactIs_development.isAsyncMode = isAsyncMode;
|
|
2041
|
+
reactIs_development.isConcurrentMode = isConcurrentMode;
|
|
2042
|
+
reactIs_development.isContextConsumer = isContextConsumer;
|
|
2043
|
+
reactIs_development.isContextProvider = isContextProvider;
|
|
2044
|
+
reactIs_development.isElement = isElement;
|
|
2045
|
+
reactIs_development.isForwardRef = isForwardRef;
|
|
2046
|
+
reactIs_development.isFragment = isFragment;
|
|
2047
|
+
reactIs_development.isLazy = isLazy;
|
|
2048
|
+
reactIs_development.isMemo = isMemo;
|
|
2049
|
+
reactIs_development.isPortal = isPortal;
|
|
2050
|
+
reactIs_development.isProfiler = isProfiler;
|
|
2051
|
+
reactIs_development.isStrictMode = isStrictMode;
|
|
2052
|
+
reactIs_development.isSuspense = isSuspense;
|
|
2053
|
+
reactIs_development.isValidElementType = isValidElementType;
|
|
2054
|
+
reactIs_development.typeOf = typeOf;
|
|
2055
|
+
})();
|
|
2056
|
+
}
|
|
2057
|
+
return reactIs_development;
|
|
2058
|
+
}
|
|
2059
|
+
|
|
2060
|
+
var hasRequiredReactIs;
|
|
2061
|
+
|
|
2062
|
+
function requireReactIs () {
|
|
2063
|
+
if (hasRequiredReactIs) return reactIs.exports;
|
|
2064
|
+
hasRequiredReactIs = 1;
|
|
2065
|
+
|
|
2066
|
+
if (process.env.NODE_ENV === 'production') {
|
|
2067
|
+
reactIs.exports = requireReactIs_production_min();
|
|
2068
|
+
} else {
|
|
2069
|
+
reactIs.exports = requireReactIs_development();
|
|
2070
|
+
}
|
|
2071
|
+
return reactIs.exports;
|
|
2072
|
+
}
|
|
2073
|
+
|
|
2074
|
+
/*
|
|
2075
|
+
object-assign
|
|
2076
|
+
(c) Sindre Sorhus
|
|
2077
|
+
@license MIT
|
|
2078
|
+
*/
|
|
2079
|
+
|
|
2080
|
+
var objectAssign;
|
|
2081
|
+
var hasRequiredObjectAssign;
|
|
2082
|
+
|
|
2083
|
+
function requireObjectAssign () {
|
|
2084
|
+
if (hasRequiredObjectAssign) return objectAssign;
|
|
2085
|
+
hasRequiredObjectAssign = 1;
|
|
2086
|
+
/* eslint-disable no-unused-vars */
|
|
2087
|
+
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
2088
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
2089
|
+
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
2090
|
+
|
|
2091
|
+
function toObject(val) {
|
|
2092
|
+
if (val === null || val === undefined) {
|
|
2093
|
+
throw new TypeError('Object.assign cannot be called with null or undefined');
|
|
2094
|
+
}
|
|
2095
|
+
|
|
2096
|
+
return Object(val);
|
|
2097
|
+
}
|
|
2098
|
+
|
|
2099
|
+
function shouldUseNative() {
|
|
2100
|
+
try {
|
|
2101
|
+
if (!Object.assign) {
|
|
2102
|
+
return false;
|
|
2103
|
+
}
|
|
2104
|
+
|
|
2105
|
+
// Detect buggy property enumeration order in older V8 versions.
|
|
2106
|
+
|
|
2107
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
|
|
2108
|
+
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
|
|
2109
|
+
test1[5] = 'de';
|
|
2110
|
+
if (Object.getOwnPropertyNames(test1)[0] === '5') {
|
|
2111
|
+
return false;
|
|
2112
|
+
}
|
|
2113
|
+
|
|
2114
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
|
2115
|
+
var test2 = {};
|
|
2116
|
+
for (var i = 0; i < 10; i++) {
|
|
2117
|
+
test2['_' + String.fromCharCode(i)] = i;
|
|
2118
|
+
}
|
|
2119
|
+
var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
|
|
2120
|
+
return test2[n];
|
|
2121
|
+
});
|
|
2122
|
+
if (order2.join('') !== '0123456789') {
|
|
2123
|
+
return false;
|
|
2124
|
+
}
|
|
2125
|
+
|
|
2126
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
|
2127
|
+
var test3 = {};
|
|
2128
|
+
'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
|
|
2129
|
+
test3[letter] = letter;
|
|
2130
|
+
});
|
|
2131
|
+
if (Object.keys(Object.assign({}, test3)).join('') !==
|
|
2132
|
+
'abcdefghijklmnopqrst') {
|
|
2133
|
+
return false;
|
|
2134
|
+
}
|
|
2135
|
+
|
|
2136
|
+
return true;
|
|
2137
|
+
} catch (err) {
|
|
2138
|
+
// We don't expect any of the above to throw, but better to be safe.
|
|
2139
|
+
return false;
|
|
2140
|
+
}
|
|
2141
|
+
}
|
|
2142
|
+
|
|
2143
|
+
objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
|
|
2144
|
+
var from;
|
|
2145
|
+
var to = toObject(target);
|
|
2146
|
+
var symbols;
|
|
2147
|
+
|
|
2148
|
+
for (var s = 1; s < arguments.length; s++) {
|
|
2149
|
+
from = Object(arguments[s]);
|
|
2150
|
+
|
|
2151
|
+
for (var key in from) {
|
|
2152
|
+
if (hasOwnProperty.call(from, key)) {
|
|
2153
|
+
to[key] = from[key];
|
|
2154
|
+
}
|
|
2155
|
+
}
|
|
2156
|
+
|
|
2157
|
+
if (getOwnPropertySymbols) {
|
|
2158
|
+
symbols = getOwnPropertySymbols(from);
|
|
2159
|
+
for (var i = 0; i < symbols.length; i++) {
|
|
2160
|
+
if (propIsEnumerable.call(from, symbols[i])) {
|
|
2161
|
+
to[symbols[i]] = from[symbols[i]];
|
|
2162
|
+
}
|
|
2163
|
+
}
|
|
2164
|
+
}
|
|
2165
|
+
}
|
|
2166
|
+
|
|
2167
|
+
return to;
|
|
2168
|
+
};
|
|
2169
|
+
return objectAssign;
|
|
2170
|
+
}
|
|
2171
|
+
|
|
2172
|
+
/**
|
|
2173
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
2174
|
+
*
|
|
2175
|
+
* This source code is licensed under the MIT license found in the
|
|
2176
|
+
* LICENSE file in the root directory of this source tree.
|
|
2177
|
+
*/
|
|
2178
|
+
|
|
2179
|
+
var ReactPropTypesSecret_1;
|
|
2180
|
+
var hasRequiredReactPropTypesSecret;
|
|
2181
|
+
|
|
2182
|
+
function requireReactPropTypesSecret () {
|
|
2183
|
+
if (hasRequiredReactPropTypesSecret) return ReactPropTypesSecret_1;
|
|
2184
|
+
hasRequiredReactPropTypesSecret = 1;
|
|
2185
|
+
|
|
2186
|
+
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
|
2187
|
+
|
|
2188
|
+
ReactPropTypesSecret_1 = ReactPropTypesSecret;
|
|
2189
|
+
return ReactPropTypesSecret_1;
|
|
2190
|
+
}
|
|
2191
|
+
|
|
2192
|
+
var has;
|
|
2193
|
+
var hasRequiredHas;
|
|
2194
|
+
|
|
2195
|
+
function requireHas () {
|
|
2196
|
+
if (hasRequiredHas) return has;
|
|
2197
|
+
hasRequiredHas = 1;
|
|
2198
|
+
has = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
2199
|
+
return has;
|
|
2200
|
+
}
|
|
2201
|
+
|
|
2202
|
+
/**
|
|
2203
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
2204
|
+
*
|
|
2205
|
+
* This source code is licensed under the MIT license found in the
|
|
2206
|
+
* LICENSE file in the root directory of this source tree.
|
|
2207
|
+
*/
|
|
2208
|
+
|
|
2209
|
+
var checkPropTypes_1;
|
|
2210
|
+
var hasRequiredCheckPropTypes;
|
|
2211
|
+
|
|
2212
|
+
function requireCheckPropTypes () {
|
|
2213
|
+
if (hasRequiredCheckPropTypes) return checkPropTypes_1;
|
|
2214
|
+
hasRequiredCheckPropTypes = 1;
|
|
2215
|
+
|
|
2216
|
+
var printWarning = function() {};
|
|
2217
|
+
|
|
2218
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2219
|
+
var ReactPropTypesSecret = requireReactPropTypesSecret();
|
|
2220
|
+
var loggedTypeFailures = {};
|
|
2221
|
+
var has = requireHas();
|
|
2222
|
+
|
|
2223
|
+
printWarning = function(text) {
|
|
2224
|
+
var message = 'Warning: ' + text;
|
|
2225
|
+
if (typeof console !== 'undefined') {
|
|
2226
|
+
console.error(message);
|
|
2227
|
+
}
|
|
2228
|
+
try {
|
|
2229
|
+
// --- Welcome to debugging React ---
|
|
2230
|
+
// This error was thrown as a convenience so that you can use this stack
|
|
2231
|
+
// to find the callsite that caused this warning to fire.
|
|
2232
|
+
throw new Error(message);
|
|
2233
|
+
} catch (x) { /**/ }
|
|
2234
|
+
};
|
|
2235
|
+
}
|
|
2236
|
+
|
|
2237
|
+
/**
|
|
2238
|
+
* Assert that the values match with the type specs.
|
|
2239
|
+
* Error messages are memorized and will only be shown once.
|
|
2240
|
+
*
|
|
2241
|
+
* @param {object} typeSpecs Map of name to a ReactPropType
|
|
2242
|
+
* @param {object} values Runtime values that need to be type-checked
|
|
2243
|
+
* @param {string} location e.g. "prop", "context", "child context"
|
|
2244
|
+
* @param {string} componentName Name of the component for error messages.
|
|
2245
|
+
* @param {?Function} getStack Returns the component stack.
|
|
2246
|
+
* @private
|
|
2247
|
+
*/
|
|
2248
|
+
function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
|
|
2249
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2250
|
+
for (var typeSpecName in typeSpecs) {
|
|
2251
|
+
if (has(typeSpecs, typeSpecName)) {
|
|
2252
|
+
var error;
|
|
2253
|
+
// Prop type validation may throw. In case they do, we don't want to
|
|
2254
|
+
// fail the render phase where it didn't fail before. So we log it.
|
|
2255
|
+
// After these have been cleaned up, we'll let them throw.
|
|
2256
|
+
try {
|
|
2257
|
+
// This is intentionally an invariant that gets caught. It's the same
|
|
2258
|
+
// behavior as without this statement except with a better message.
|
|
2259
|
+
if (typeof typeSpecs[typeSpecName] !== 'function') {
|
|
2260
|
+
var err = Error(
|
|
2261
|
+
(componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
|
|
2262
|
+
'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +
|
|
2263
|
+
'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
|
|
2264
|
+
);
|
|
2265
|
+
err.name = 'Invariant Violation';
|
|
2266
|
+
throw err;
|
|
2267
|
+
}
|
|
2268
|
+
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
|
|
2269
|
+
} catch (ex) {
|
|
2270
|
+
error = ex;
|
|
2271
|
+
}
|
|
2272
|
+
if (error && !(error instanceof Error)) {
|
|
2273
|
+
printWarning(
|
|
2274
|
+
(componentName || 'React class') + ': type specification of ' +
|
|
2275
|
+
location + ' `' + typeSpecName + '` is invalid; the type checker ' +
|
|
2276
|
+
'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
|
|
2277
|
+
'You may have forgotten to pass an argument to the type checker ' +
|
|
2278
|
+
'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
|
|
2279
|
+
'shape all require an argument).'
|
|
2280
|
+
);
|
|
2281
|
+
}
|
|
2282
|
+
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
|
2283
|
+
// Only monitor this failure once because there tends to be a lot of the
|
|
2284
|
+
// same error.
|
|
2285
|
+
loggedTypeFailures[error.message] = true;
|
|
2286
|
+
|
|
2287
|
+
var stack = getStack ? getStack() : '';
|
|
2288
|
+
|
|
2289
|
+
printWarning(
|
|
2290
|
+
'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
|
|
2291
|
+
);
|
|
2292
|
+
}
|
|
2293
|
+
}
|
|
2294
|
+
}
|
|
2295
|
+
}
|
|
2296
|
+
}
|
|
2297
|
+
|
|
2298
|
+
/**
|
|
2299
|
+
* Resets warning cache when testing.
|
|
2300
|
+
*
|
|
2301
|
+
* @private
|
|
2302
|
+
*/
|
|
2303
|
+
checkPropTypes.resetWarningCache = function() {
|
|
2304
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2305
|
+
loggedTypeFailures = {};
|
|
2306
|
+
}
|
|
2307
|
+
};
|
|
2308
|
+
|
|
2309
|
+
checkPropTypes_1 = checkPropTypes;
|
|
2310
|
+
return checkPropTypes_1;
|
|
2311
|
+
}
|
|
2312
|
+
|
|
2313
|
+
/**
|
|
2314
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
2315
|
+
*
|
|
2316
|
+
* This source code is licensed under the MIT license found in the
|
|
2317
|
+
* LICENSE file in the root directory of this source tree.
|
|
2318
|
+
*/
|
|
2319
|
+
|
|
2320
|
+
var factoryWithTypeCheckers;
|
|
2321
|
+
var hasRequiredFactoryWithTypeCheckers;
|
|
2322
|
+
|
|
2323
|
+
function requireFactoryWithTypeCheckers () {
|
|
2324
|
+
if (hasRequiredFactoryWithTypeCheckers) return factoryWithTypeCheckers;
|
|
2325
|
+
hasRequiredFactoryWithTypeCheckers = 1;
|
|
2326
|
+
|
|
2327
|
+
var ReactIs = requireReactIs();
|
|
2328
|
+
var assign = requireObjectAssign();
|
|
2329
|
+
|
|
2330
|
+
var ReactPropTypesSecret = requireReactPropTypesSecret();
|
|
2331
|
+
var has = requireHas();
|
|
2332
|
+
var checkPropTypes = requireCheckPropTypes();
|
|
2333
|
+
|
|
2334
|
+
var printWarning = function() {};
|
|
2335
|
+
|
|
2336
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2337
|
+
printWarning = function(text) {
|
|
2338
|
+
var message = 'Warning: ' + text;
|
|
2339
|
+
if (typeof console !== 'undefined') {
|
|
2340
|
+
console.error(message);
|
|
2341
|
+
}
|
|
2342
|
+
try {
|
|
2343
|
+
// --- Welcome to debugging React ---
|
|
2344
|
+
// This error was thrown as a convenience so that you can use this stack
|
|
2345
|
+
// to find the callsite that caused this warning to fire.
|
|
2346
|
+
throw new Error(message);
|
|
2347
|
+
} catch (x) {}
|
|
2348
|
+
};
|
|
2349
|
+
}
|
|
2350
|
+
|
|
2351
|
+
function emptyFunctionThatReturnsNull() {
|
|
2352
|
+
return null;
|
|
2353
|
+
}
|
|
2354
|
+
|
|
2355
|
+
factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
2356
|
+
/* global Symbol */
|
|
2357
|
+
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
|
2358
|
+
var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
|
|
2359
|
+
|
|
2360
|
+
/**
|
|
2361
|
+
* Returns the iterator method function contained on the iterable object.
|
|
2362
|
+
*
|
|
2363
|
+
* Be sure to invoke the function with the iterable as context:
|
|
2364
|
+
*
|
|
2365
|
+
* var iteratorFn = getIteratorFn(myIterable);
|
|
2366
|
+
* if (iteratorFn) {
|
|
2367
|
+
* var iterator = iteratorFn.call(myIterable);
|
|
2368
|
+
* ...
|
|
2369
|
+
* }
|
|
2370
|
+
*
|
|
2371
|
+
* @param {?object} maybeIterable
|
|
2372
|
+
* @return {?function}
|
|
2373
|
+
*/
|
|
2374
|
+
function getIteratorFn(maybeIterable) {
|
|
2375
|
+
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
|
|
2376
|
+
if (typeof iteratorFn === 'function') {
|
|
2377
|
+
return iteratorFn;
|
|
2378
|
+
}
|
|
2379
|
+
}
|
|
2380
|
+
|
|
2381
|
+
/**
|
|
2382
|
+
* Collection of methods that allow declaration and validation of props that are
|
|
2383
|
+
* supplied to React components. Example usage:
|
|
2384
|
+
*
|
|
2385
|
+
* var Props = require('ReactPropTypes');
|
|
2386
|
+
* var MyArticle = React.createClass({
|
|
2387
|
+
* propTypes: {
|
|
2388
|
+
* // An optional string prop named "description".
|
|
2389
|
+
* description: Props.string,
|
|
2390
|
+
*
|
|
2391
|
+
* // A required enum prop named "category".
|
|
2392
|
+
* category: Props.oneOf(['News','Photos']).isRequired,
|
|
2393
|
+
*
|
|
2394
|
+
* // A prop named "dialog" that requires an instance of Dialog.
|
|
2395
|
+
* dialog: Props.instanceOf(Dialog).isRequired
|
|
2396
|
+
* },
|
|
2397
|
+
* render: function() { ... }
|
|
2398
|
+
* });
|
|
2399
|
+
*
|
|
2400
|
+
* A more formal specification of how these methods are used:
|
|
2401
|
+
*
|
|
2402
|
+
* type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
|
|
2403
|
+
* decl := ReactPropTypes.{type}(.isRequired)?
|
|
2404
|
+
*
|
|
2405
|
+
* Each and every declaration produces a function with the same signature. This
|
|
2406
|
+
* allows the creation of custom validation functions. For example:
|
|
2407
|
+
*
|
|
2408
|
+
* var MyLink = React.createClass({
|
|
2409
|
+
* propTypes: {
|
|
2410
|
+
* // An optional string or URI prop named "href".
|
|
2411
|
+
* href: function(props, propName, componentName) {
|
|
2412
|
+
* var propValue = props[propName];
|
|
2413
|
+
* if (propValue != null && typeof propValue !== 'string' &&
|
|
2414
|
+
* !(propValue instanceof URI)) {
|
|
2415
|
+
* return new Error(
|
|
2416
|
+
* 'Expected a string or an URI for ' + propName + ' in ' +
|
|
2417
|
+
* componentName
|
|
2418
|
+
* );
|
|
2419
|
+
* }
|
|
2420
|
+
* }
|
|
2421
|
+
* },
|
|
2422
|
+
* render: function() {...}
|
|
2423
|
+
* });
|
|
2424
|
+
*
|
|
2425
|
+
* @internal
|
|
2426
|
+
*/
|
|
2427
|
+
|
|
2428
|
+
var ANONYMOUS = '<<anonymous>>';
|
|
2429
|
+
|
|
2430
|
+
// Important!
|
|
2431
|
+
// Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
|
|
2432
|
+
var ReactPropTypes = {
|
|
2433
|
+
array: createPrimitiveTypeChecker('array'),
|
|
2434
|
+
bigint: createPrimitiveTypeChecker('bigint'),
|
|
2435
|
+
bool: createPrimitiveTypeChecker('boolean'),
|
|
2436
|
+
func: createPrimitiveTypeChecker('function'),
|
|
2437
|
+
number: createPrimitiveTypeChecker('number'),
|
|
2438
|
+
object: createPrimitiveTypeChecker('object'),
|
|
2439
|
+
string: createPrimitiveTypeChecker('string'),
|
|
2440
|
+
symbol: createPrimitiveTypeChecker('symbol'),
|
|
2441
|
+
|
|
2442
|
+
any: createAnyTypeChecker(),
|
|
2443
|
+
arrayOf: createArrayOfTypeChecker,
|
|
2444
|
+
element: createElementTypeChecker(),
|
|
2445
|
+
elementType: createElementTypeTypeChecker(),
|
|
2446
|
+
instanceOf: createInstanceTypeChecker,
|
|
2447
|
+
node: createNodeChecker(),
|
|
2448
|
+
objectOf: createObjectOfTypeChecker,
|
|
2449
|
+
oneOf: createEnumTypeChecker,
|
|
2450
|
+
oneOfType: createUnionTypeChecker,
|
|
2451
|
+
shape: createShapeTypeChecker,
|
|
2452
|
+
exact: createStrictShapeTypeChecker,
|
|
2453
|
+
};
|
|
2454
|
+
|
|
2455
|
+
/**
|
|
2456
|
+
* inlined Object.is polyfill to avoid requiring consumers ship their own
|
|
2457
|
+
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
|
|
2458
|
+
*/
|
|
2459
|
+
/*eslint-disable no-self-compare*/
|
|
2460
|
+
function is(x, y) {
|
|
2461
|
+
// SameValue algorithm
|
|
2462
|
+
if (x === y) {
|
|
2463
|
+
// Steps 1-5, 7-10
|
|
2464
|
+
// Steps 6.b-6.e: +0 != -0
|
|
2465
|
+
return x !== 0 || 1 / x === 1 / y;
|
|
2466
|
+
} else {
|
|
2467
|
+
// Step 6.a: NaN == NaN
|
|
2468
|
+
return x !== x && y !== y;
|
|
2469
|
+
}
|
|
2470
|
+
}
|
|
2471
|
+
/*eslint-enable no-self-compare*/
|
|
2472
|
+
|
|
2473
|
+
/**
|
|
2474
|
+
* We use an Error-like object for backward compatibility as people may call
|
|
2475
|
+
* PropTypes directly and inspect their output. However, we don't use real
|
|
2476
|
+
* Errors anymore. We don't inspect their stack anyway, and creating them
|
|
2477
|
+
* is prohibitively expensive if they are created too often, such as what
|
|
2478
|
+
* happens in oneOfType() for any type before the one that matched.
|
|
2479
|
+
*/
|
|
2480
|
+
function PropTypeError(message, data) {
|
|
2481
|
+
this.message = message;
|
|
2482
|
+
this.data = data && typeof data === 'object' ? data: {};
|
|
2483
|
+
this.stack = '';
|
|
2484
|
+
}
|
|
2485
|
+
// Make `instanceof Error` still work for returned errors.
|
|
2486
|
+
PropTypeError.prototype = Error.prototype;
|
|
2487
|
+
|
|
2488
|
+
function createChainableTypeChecker(validate) {
|
|
2489
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2490
|
+
var manualPropTypeCallCache = {};
|
|
2491
|
+
var manualPropTypeWarningCount = 0;
|
|
2492
|
+
}
|
|
2493
|
+
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
|
|
2494
|
+
componentName = componentName || ANONYMOUS;
|
|
2495
|
+
propFullName = propFullName || propName;
|
|
2496
|
+
|
|
2497
|
+
if (secret !== ReactPropTypesSecret) {
|
|
2498
|
+
if (throwOnDirectAccess) {
|
|
2499
|
+
// New behavior only for users of `prop-types` package
|
|
2500
|
+
var err = new Error(
|
|
2501
|
+
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
|
2502
|
+
'Use `PropTypes.checkPropTypes()` to call them. ' +
|
|
2503
|
+
'Read more at http://fb.me/use-check-prop-types'
|
|
2504
|
+
);
|
|
2505
|
+
err.name = 'Invariant Violation';
|
|
2506
|
+
throw err;
|
|
2507
|
+
} else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
|
|
2508
|
+
// Old behavior for people using React.PropTypes
|
|
2509
|
+
var cacheKey = componentName + ':' + propName;
|
|
2510
|
+
if (
|
|
2511
|
+
!manualPropTypeCallCache[cacheKey] &&
|
|
2512
|
+
// Avoid spamming the console because they are often not actionable except for lib authors
|
|
2513
|
+
manualPropTypeWarningCount < 3
|
|
2514
|
+
) {
|
|
2515
|
+
printWarning(
|
|
2516
|
+
'You are manually calling a React.PropTypes validation ' +
|
|
2517
|
+
'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
|
|
2518
|
+
'and will throw in the standalone `prop-types` package. ' +
|
|
2519
|
+
'You may be seeing this warning due to a third-party PropTypes ' +
|
|
2520
|
+
'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
|
|
2521
|
+
);
|
|
2522
|
+
manualPropTypeCallCache[cacheKey] = true;
|
|
2523
|
+
manualPropTypeWarningCount++;
|
|
2524
|
+
}
|
|
2525
|
+
}
|
|
2526
|
+
}
|
|
2527
|
+
if (props[propName] == null) {
|
|
2528
|
+
if (isRequired) {
|
|
2529
|
+
if (props[propName] === null) {
|
|
2530
|
+
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
|
|
2531
|
+
}
|
|
2532
|
+
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
|
|
2533
|
+
}
|
|
2534
|
+
return null;
|
|
2535
|
+
} else {
|
|
2536
|
+
return validate(props, propName, componentName, location, propFullName);
|
|
2537
|
+
}
|
|
2538
|
+
}
|
|
2539
|
+
|
|
2540
|
+
var chainedCheckType = checkType.bind(null, false);
|
|
2541
|
+
chainedCheckType.isRequired = checkType.bind(null, true);
|
|
2542
|
+
|
|
2543
|
+
return chainedCheckType;
|
|
2544
|
+
}
|
|
2545
|
+
|
|
2546
|
+
function createPrimitiveTypeChecker(expectedType) {
|
|
2547
|
+
function validate(props, propName, componentName, location, propFullName, secret) {
|
|
2548
|
+
var propValue = props[propName];
|
|
2549
|
+
var propType = getPropType(propValue);
|
|
2550
|
+
if (propType !== expectedType) {
|
|
2551
|
+
// `propValue` being instance of, say, date/regexp, pass the 'object'
|
|
2552
|
+
// check, but we can offer a more precise error message here rather than
|
|
2553
|
+
// 'of type `object`'.
|
|
2554
|
+
var preciseType = getPreciseType(propValue);
|
|
2555
|
+
|
|
2556
|
+
return new PropTypeError(
|
|
2557
|
+
'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),
|
|
2558
|
+
{expectedType: expectedType}
|
|
2559
|
+
);
|
|
2560
|
+
}
|
|
2561
|
+
return null;
|
|
2562
|
+
}
|
|
2563
|
+
return createChainableTypeChecker(validate);
|
|
2564
|
+
}
|
|
2565
|
+
|
|
2566
|
+
function createAnyTypeChecker() {
|
|
2567
|
+
return createChainableTypeChecker(emptyFunctionThatReturnsNull);
|
|
2568
|
+
}
|
|
2569
|
+
|
|
2570
|
+
function createArrayOfTypeChecker(typeChecker) {
|
|
2571
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
2572
|
+
if (typeof typeChecker !== 'function') {
|
|
2573
|
+
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
|
|
2574
|
+
}
|
|
2575
|
+
var propValue = props[propName];
|
|
2576
|
+
if (!Array.isArray(propValue)) {
|
|
2577
|
+
var propType = getPropType(propValue);
|
|
2578
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
|
|
2579
|
+
}
|
|
2580
|
+
for (var i = 0; i < propValue.length; i++) {
|
|
2581
|
+
var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
|
|
2582
|
+
if (error instanceof Error) {
|
|
2583
|
+
return error;
|
|
2584
|
+
}
|
|
2585
|
+
}
|
|
2586
|
+
return null;
|
|
2587
|
+
}
|
|
2588
|
+
return createChainableTypeChecker(validate);
|
|
2589
|
+
}
|
|
2590
|
+
|
|
2591
|
+
function createElementTypeChecker() {
|
|
2592
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
2593
|
+
var propValue = props[propName];
|
|
2594
|
+
if (!isValidElement(propValue)) {
|
|
2595
|
+
var propType = getPropType(propValue);
|
|
2596
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
|
|
2597
|
+
}
|
|
2598
|
+
return null;
|
|
2599
|
+
}
|
|
2600
|
+
return createChainableTypeChecker(validate);
|
|
2601
|
+
}
|
|
2602
|
+
|
|
2603
|
+
function createElementTypeTypeChecker() {
|
|
2604
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
2605
|
+
var propValue = props[propName];
|
|
2606
|
+
if (!ReactIs.isValidElementType(propValue)) {
|
|
2607
|
+
var propType = getPropType(propValue);
|
|
2608
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
|
|
2609
|
+
}
|
|
2610
|
+
return null;
|
|
2611
|
+
}
|
|
2612
|
+
return createChainableTypeChecker(validate);
|
|
2613
|
+
}
|
|
2614
|
+
|
|
2615
|
+
function createInstanceTypeChecker(expectedClass) {
|
|
2616
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
2617
|
+
if (!(props[propName] instanceof expectedClass)) {
|
|
2618
|
+
var expectedClassName = expectedClass.name || ANONYMOUS;
|
|
2619
|
+
var actualClassName = getClassName(props[propName]);
|
|
2620
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
|
|
2621
|
+
}
|
|
2622
|
+
return null;
|
|
2623
|
+
}
|
|
2624
|
+
return createChainableTypeChecker(validate);
|
|
2625
|
+
}
|
|
2626
|
+
|
|
2627
|
+
function createEnumTypeChecker(expectedValues) {
|
|
2628
|
+
if (!Array.isArray(expectedValues)) {
|
|
2629
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2630
|
+
if (arguments.length > 1) {
|
|
2631
|
+
printWarning(
|
|
2632
|
+
'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
|
|
2633
|
+
'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
|
|
2634
|
+
);
|
|
2635
|
+
} else {
|
|
2636
|
+
printWarning('Invalid argument supplied to oneOf, expected an array.');
|
|
2637
|
+
}
|
|
2638
|
+
}
|
|
2639
|
+
return emptyFunctionThatReturnsNull;
|
|
2640
|
+
}
|
|
2641
|
+
|
|
2642
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
2643
|
+
var propValue = props[propName];
|
|
2644
|
+
for (var i = 0; i < expectedValues.length; i++) {
|
|
2645
|
+
if (is(propValue, expectedValues[i])) {
|
|
2646
|
+
return null;
|
|
2647
|
+
}
|
|
2648
|
+
}
|
|
2649
|
+
|
|
2650
|
+
var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
|
|
2651
|
+
var type = getPreciseType(value);
|
|
2652
|
+
if (type === 'symbol') {
|
|
2653
|
+
return String(value);
|
|
2654
|
+
}
|
|
2655
|
+
return value;
|
|
2656
|
+
});
|
|
2657
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
|
|
2658
|
+
}
|
|
2659
|
+
return createChainableTypeChecker(validate);
|
|
2660
|
+
}
|
|
2661
|
+
|
|
2662
|
+
function createObjectOfTypeChecker(typeChecker) {
|
|
2663
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
2664
|
+
if (typeof typeChecker !== 'function') {
|
|
2665
|
+
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
|
|
2666
|
+
}
|
|
2667
|
+
var propValue = props[propName];
|
|
2668
|
+
var propType = getPropType(propValue);
|
|
2669
|
+
if (propType !== 'object') {
|
|
2670
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
|
|
2671
|
+
}
|
|
2672
|
+
for (var key in propValue) {
|
|
2673
|
+
if (has(propValue, key)) {
|
|
2674
|
+
var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
|
|
2675
|
+
if (error instanceof Error) {
|
|
2676
|
+
return error;
|
|
2677
|
+
}
|
|
2678
|
+
}
|
|
2679
|
+
}
|
|
2680
|
+
return null;
|
|
2681
|
+
}
|
|
2682
|
+
return createChainableTypeChecker(validate);
|
|
2683
|
+
}
|
|
2684
|
+
|
|
2685
|
+
function createUnionTypeChecker(arrayOfTypeCheckers) {
|
|
2686
|
+
if (!Array.isArray(arrayOfTypeCheckers)) {
|
|
2687
|
+
process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
|
|
2688
|
+
return emptyFunctionThatReturnsNull;
|
|
2689
|
+
}
|
|
2690
|
+
|
|
2691
|
+
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
2692
|
+
var checker = arrayOfTypeCheckers[i];
|
|
2693
|
+
if (typeof checker !== 'function') {
|
|
2694
|
+
printWarning(
|
|
2695
|
+
'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
|
|
2696
|
+
'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
|
|
2697
|
+
);
|
|
2698
|
+
return emptyFunctionThatReturnsNull;
|
|
2699
|
+
}
|
|
2700
|
+
}
|
|
2701
|
+
|
|
2702
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
2703
|
+
var expectedTypes = [];
|
|
2704
|
+
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
2705
|
+
var checker = arrayOfTypeCheckers[i];
|
|
2706
|
+
var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
|
|
2707
|
+
if (checkerResult == null) {
|
|
2708
|
+
return null;
|
|
2709
|
+
}
|
|
2710
|
+
if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
|
|
2711
|
+
expectedTypes.push(checkerResult.data.expectedType);
|
|
2712
|
+
}
|
|
2713
|
+
}
|
|
2714
|
+
var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';
|
|
2715
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
|
|
2716
|
+
}
|
|
2717
|
+
return createChainableTypeChecker(validate);
|
|
2718
|
+
}
|
|
2719
|
+
|
|
2720
|
+
function createNodeChecker() {
|
|
2721
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
2722
|
+
if (!isNode(props[propName])) {
|
|
2723
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
|
|
2724
|
+
}
|
|
2725
|
+
return null;
|
|
2726
|
+
}
|
|
2727
|
+
return createChainableTypeChecker(validate);
|
|
2728
|
+
}
|
|
2729
|
+
|
|
2730
|
+
function invalidValidatorError(componentName, location, propFullName, key, type) {
|
|
2731
|
+
return new PropTypeError(
|
|
2732
|
+
(componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +
|
|
2733
|
+
'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'
|
|
2734
|
+
);
|
|
2735
|
+
}
|
|
2736
|
+
|
|
2737
|
+
function createShapeTypeChecker(shapeTypes) {
|
|
2738
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
2739
|
+
var propValue = props[propName];
|
|
2740
|
+
var propType = getPropType(propValue);
|
|
2741
|
+
if (propType !== 'object') {
|
|
2742
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
|
2743
|
+
}
|
|
2744
|
+
for (var key in shapeTypes) {
|
|
2745
|
+
var checker = shapeTypes[key];
|
|
2746
|
+
if (typeof checker !== 'function') {
|
|
2747
|
+
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
2748
|
+
}
|
|
2749
|
+
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
|
|
2750
|
+
if (error) {
|
|
2751
|
+
return error;
|
|
2752
|
+
}
|
|
2753
|
+
}
|
|
2754
|
+
return null;
|
|
2755
|
+
}
|
|
2756
|
+
return createChainableTypeChecker(validate);
|
|
2757
|
+
}
|
|
2758
|
+
|
|
2759
|
+
function createStrictShapeTypeChecker(shapeTypes) {
|
|
2760
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
2761
|
+
var propValue = props[propName];
|
|
2762
|
+
var propType = getPropType(propValue);
|
|
2763
|
+
if (propType !== 'object') {
|
|
2764
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
|
2765
|
+
}
|
|
2766
|
+
// We need to check all keys in case some are required but missing from props.
|
|
2767
|
+
var allKeys = assign({}, props[propName], shapeTypes);
|
|
2768
|
+
for (var key in allKeys) {
|
|
2769
|
+
var checker = shapeTypes[key];
|
|
2770
|
+
if (has(shapeTypes, key) && typeof checker !== 'function') {
|
|
2771
|
+
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
2772
|
+
}
|
|
2773
|
+
if (!checker) {
|
|
2774
|
+
return new PropTypeError(
|
|
2775
|
+
'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
|
|
2776
|
+
'\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
|
|
2777
|
+
'\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
|
|
2778
|
+
);
|
|
2779
|
+
}
|
|
2780
|
+
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
|
|
2781
|
+
if (error) {
|
|
2782
|
+
return error;
|
|
2783
|
+
}
|
|
2784
|
+
}
|
|
2785
|
+
return null;
|
|
2786
|
+
}
|
|
2787
|
+
|
|
2788
|
+
return createChainableTypeChecker(validate);
|
|
2789
|
+
}
|
|
2790
|
+
|
|
2791
|
+
function isNode(propValue) {
|
|
2792
|
+
switch (typeof propValue) {
|
|
2793
|
+
case 'number':
|
|
2794
|
+
case 'string':
|
|
2795
|
+
case 'undefined':
|
|
2796
|
+
return true;
|
|
2797
|
+
case 'boolean':
|
|
2798
|
+
return !propValue;
|
|
2799
|
+
case 'object':
|
|
2800
|
+
if (Array.isArray(propValue)) {
|
|
2801
|
+
return propValue.every(isNode);
|
|
2802
|
+
}
|
|
2803
|
+
if (propValue === null || isValidElement(propValue)) {
|
|
2804
|
+
return true;
|
|
2805
|
+
}
|
|
2806
|
+
|
|
2807
|
+
var iteratorFn = getIteratorFn(propValue);
|
|
2808
|
+
if (iteratorFn) {
|
|
2809
|
+
var iterator = iteratorFn.call(propValue);
|
|
2810
|
+
var step;
|
|
2811
|
+
if (iteratorFn !== propValue.entries) {
|
|
2812
|
+
while (!(step = iterator.next()).done) {
|
|
2813
|
+
if (!isNode(step.value)) {
|
|
2814
|
+
return false;
|
|
2815
|
+
}
|
|
2816
|
+
}
|
|
2817
|
+
} else {
|
|
2818
|
+
// Iterator will provide entry [k,v] tuples rather than values.
|
|
2819
|
+
while (!(step = iterator.next()).done) {
|
|
2820
|
+
var entry = step.value;
|
|
2821
|
+
if (entry) {
|
|
2822
|
+
if (!isNode(entry[1])) {
|
|
2823
|
+
return false;
|
|
2824
|
+
}
|
|
2825
|
+
}
|
|
2826
|
+
}
|
|
2827
|
+
}
|
|
2828
|
+
} else {
|
|
2829
|
+
return false;
|
|
2830
|
+
}
|
|
2831
|
+
|
|
2832
|
+
return true;
|
|
2833
|
+
default:
|
|
2834
|
+
return false;
|
|
2835
|
+
}
|
|
2836
|
+
}
|
|
2837
|
+
|
|
2838
|
+
function isSymbol(propType, propValue) {
|
|
2839
|
+
// Native Symbol.
|
|
2840
|
+
if (propType === 'symbol') {
|
|
2841
|
+
return true;
|
|
2842
|
+
}
|
|
2843
|
+
|
|
2844
|
+
// falsy value can't be a Symbol
|
|
2845
|
+
if (!propValue) {
|
|
2846
|
+
return false;
|
|
2847
|
+
}
|
|
2848
|
+
|
|
2849
|
+
// 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
|
|
2850
|
+
if (propValue['@@toStringTag'] === 'Symbol') {
|
|
2851
|
+
return true;
|
|
2852
|
+
}
|
|
2853
|
+
|
|
2854
|
+
// Fallback for non-spec compliant Symbols which are polyfilled.
|
|
2855
|
+
if (typeof Symbol === 'function' && propValue instanceof Symbol) {
|
|
2856
|
+
return true;
|
|
2857
|
+
}
|
|
2858
|
+
|
|
2859
|
+
return false;
|
|
2860
|
+
}
|
|
2861
|
+
|
|
2862
|
+
// Equivalent of `typeof` but with special handling for array and regexp.
|
|
2863
|
+
function getPropType(propValue) {
|
|
2864
|
+
var propType = typeof propValue;
|
|
2865
|
+
if (Array.isArray(propValue)) {
|
|
2866
|
+
return 'array';
|
|
2867
|
+
}
|
|
2868
|
+
if (propValue instanceof RegExp) {
|
|
2869
|
+
// Old webkits (at least until Android 4.0) return 'function' rather than
|
|
2870
|
+
// 'object' for typeof a RegExp. We'll normalize this here so that /bla/
|
|
2871
|
+
// passes PropTypes.object.
|
|
2872
|
+
return 'object';
|
|
2873
|
+
}
|
|
2874
|
+
if (isSymbol(propType, propValue)) {
|
|
2875
|
+
return 'symbol';
|
|
2876
|
+
}
|
|
2877
|
+
return propType;
|
|
2878
|
+
}
|
|
2879
|
+
|
|
2880
|
+
// This handles more types than `getPropType`. Only used for error messages.
|
|
2881
|
+
// See `createPrimitiveTypeChecker`.
|
|
2882
|
+
function getPreciseType(propValue) {
|
|
2883
|
+
if (typeof propValue === 'undefined' || propValue === null) {
|
|
2884
|
+
return '' + propValue;
|
|
2885
|
+
}
|
|
2886
|
+
var propType = getPropType(propValue);
|
|
2887
|
+
if (propType === 'object') {
|
|
2888
|
+
if (propValue instanceof Date) {
|
|
2889
|
+
return 'date';
|
|
2890
|
+
} else if (propValue instanceof RegExp) {
|
|
2891
|
+
return 'regexp';
|
|
2892
|
+
}
|
|
2893
|
+
}
|
|
2894
|
+
return propType;
|
|
2895
|
+
}
|
|
2896
|
+
|
|
2897
|
+
// Returns a string that is postfixed to a warning about an invalid type.
|
|
2898
|
+
// For example, "undefined" or "of type array"
|
|
2899
|
+
function getPostfixForTypeWarning(value) {
|
|
2900
|
+
var type = getPreciseType(value);
|
|
2901
|
+
switch (type) {
|
|
2902
|
+
case 'array':
|
|
2903
|
+
case 'object':
|
|
2904
|
+
return 'an ' + type;
|
|
2905
|
+
case 'boolean':
|
|
2906
|
+
case 'date':
|
|
2907
|
+
case 'regexp':
|
|
2908
|
+
return 'a ' + type;
|
|
2909
|
+
default:
|
|
2910
|
+
return type;
|
|
2911
|
+
}
|
|
2912
|
+
}
|
|
2913
|
+
|
|
2914
|
+
// Returns class name of the object, if any.
|
|
2915
|
+
function getClassName(propValue) {
|
|
2916
|
+
if (!propValue.constructor || !propValue.constructor.name) {
|
|
2917
|
+
return ANONYMOUS;
|
|
2918
|
+
}
|
|
2919
|
+
return propValue.constructor.name;
|
|
2920
|
+
}
|
|
2921
|
+
|
|
2922
|
+
ReactPropTypes.checkPropTypes = checkPropTypes;
|
|
2923
|
+
ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
|
|
2924
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
2925
|
+
|
|
2926
|
+
return ReactPropTypes;
|
|
2927
|
+
};
|
|
2928
|
+
return factoryWithTypeCheckers;
|
|
2929
|
+
}
|
|
2930
|
+
|
|
2931
|
+
/**
|
|
2932
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
2933
|
+
*
|
|
2934
|
+
* This source code is licensed under the MIT license found in the
|
|
2935
|
+
* LICENSE file in the root directory of this source tree.
|
|
2936
|
+
*/
|
|
2937
|
+
|
|
2938
|
+
var factoryWithThrowingShims;
|
|
2939
|
+
var hasRequiredFactoryWithThrowingShims;
|
|
2940
|
+
|
|
2941
|
+
function requireFactoryWithThrowingShims () {
|
|
2942
|
+
if (hasRequiredFactoryWithThrowingShims) return factoryWithThrowingShims;
|
|
2943
|
+
hasRequiredFactoryWithThrowingShims = 1;
|
|
2944
|
+
|
|
2945
|
+
var ReactPropTypesSecret = requireReactPropTypesSecret();
|
|
2946
|
+
|
|
2947
|
+
function emptyFunction() {}
|
|
2948
|
+
function emptyFunctionWithReset() {}
|
|
2949
|
+
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
|
2950
|
+
|
|
2951
|
+
factoryWithThrowingShims = function() {
|
|
2952
|
+
function shim(props, propName, componentName, location, propFullName, secret) {
|
|
2953
|
+
if (secret === ReactPropTypesSecret) {
|
|
2954
|
+
// It is still safe when called from React.
|
|
2955
|
+
return;
|
|
2956
|
+
}
|
|
2957
|
+
var err = new Error(
|
|
2958
|
+
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
|
2959
|
+
'Use PropTypes.checkPropTypes() to call them. ' +
|
|
2960
|
+
'Read more at http://fb.me/use-check-prop-types'
|
|
2961
|
+
);
|
|
2962
|
+
err.name = 'Invariant Violation';
|
|
2963
|
+
throw err;
|
|
2964
|
+
} shim.isRequired = shim;
|
|
2965
|
+
function getShim() {
|
|
2966
|
+
return shim;
|
|
2967
|
+
} // Important!
|
|
2968
|
+
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
|
|
2969
|
+
var ReactPropTypes = {
|
|
2970
|
+
array: shim,
|
|
2971
|
+
bigint: shim,
|
|
2972
|
+
bool: shim,
|
|
2973
|
+
func: shim,
|
|
2974
|
+
number: shim,
|
|
2975
|
+
object: shim,
|
|
2976
|
+
string: shim,
|
|
2977
|
+
symbol: shim,
|
|
2978
|
+
|
|
2979
|
+
any: shim,
|
|
2980
|
+
arrayOf: getShim,
|
|
2981
|
+
element: shim,
|
|
2982
|
+
elementType: shim,
|
|
2983
|
+
instanceOf: getShim,
|
|
2984
|
+
node: shim,
|
|
2985
|
+
objectOf: getShim,
|
|
2986
|
+
oneOf: getShim,
|
|
2987
|
+
oneOfType: getShim,
|
|
2988
|
+
shape: getShim,
|
|
2989
|
+
exact: getShim,
|
|
2990
|
+
|
|
2991
|
+
checkPropTypes: emptyFunctionWithReset,
|
|
2992
|
+
resetWarningCache: emptyFunction
|
|
2993
|
+
};
|
|
2994
|
+
|
|
2995
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
2996
|
+
|
|
2997
|
+
return ReactPropTypes;
|
|
2998
|
+
};
|
|
2999
|
+
return factoryWithThrowingShims;
|
|
3000
|
+
}
|
|
3001
|
+
|
|
3002
|
+
/**
|
|
3003
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
3004
|
+
*
|
|
3005
|
+
* This source code is licensed under the MIT license found in the
|
|
3006
|
+
* LICENSE file in the root directory of this source tree.
|
|
3007
|
+
*/
|
|
3008
|
+
|
|
3009
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3010
|
+
var ReactIs = requireReactIs();
|
|
3011
|
+
|
|
3012
|
+
// By explicitly using `prop-types` you are opting into new development behavior.
|
|
3013
|
+
// http://fb.me/prop-types-in-prod
|
|
3014
|
+
var throwOnDirectAccess = true;
|
|
3015
|
+
propTypes.exports = requireFactoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
|
|
3016
|
+
} else {
|
|
3017
|
+
// By explicitly using `prop-types` you are opting into new production behavior.
|
|
3018
|
+
// http://fb.me/prop-types-in-prod
|
|
3019
|
+
propTypes.exports = requireFactoryWithThrowingShims()();
|
|
3020
|
+
}
|
|
3021
|
+
|
|
3022
|
+
var propTypesExports = propTypes.exports;
|
|
3023
|
+
var PropTypes = /*@__PURE__*/getDefaultExportFromCjs(propTypesExports);
|
|
3024
|
+
|
|
3025
|
+
/**
|
|
3026
|
+
* @tabler/icons-react v2.47.0 - MIT
|
|
3027
|
+
*/
|
|
3028
|
+
|
|
3029
|
+
var defaultAttributes = {
|
|
3030
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3031
|
+
width: 24,
|
|
3032
|
+
height: 24,
|
|
3033
|
+
viewBox: "0 0 24 24",
|
|
3034
|
+
fill: "none",
|
|
3035
|
+
stroke: "currentColor",
|
|
3036
|
+
strokeWidth: 2,
|
|
3037
|
+
strokeLinecap: "round",
|
|
3038
|
+
strokeLinejoin: "round"
|
|
3039
|
+
};
|
|
3040
|
+
|
|
3041
|
+
/**
|
|
3042
|
+
* @tabler/icons-react v2.47.0 - MIT
|
|
3043
|
+
*/
|
|
3044
|
+
|
|
3045
|
+
|
|
3046
|
+
var __defProp = Object.defineProperty;
|
|
3047
|
+
var __defProps = Object.defineProperties;
|
|
3048
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
3049
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3050
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
3051
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
3052
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3053
|
+
var __spreadValues = (a, b) => {
|
|
3054
|
+
for (var prop in b || (b = {}))
|
|
3055
|
+
if (__hasOwnProp.call(b, prop))
|
|
3056
|
+
__defNormalProp(a, prop, b[prop]);
|
|
3057
|
+
if (__getOwnPropSymbols)
|
|
3058
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
3059
|
+
if (__propIsEnum.call(b, prop))
|
|
3060
|
+
__defNormalProp(a, prop, b[prop]);
|
|
3061
|
+
}
|
|
3062
|
+
return a;
|
|
3063
|
+
};
|
|
3064
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
3065
|
+
var __objRest = (source, exclude) => {
|
|
3066
|
+
var target = {};
|
|
3067
|
+
for (var prop in source)
|
|
3068
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
3069
|
+
target[prop] = source[prop];
|
|
3070
|
+
if (source != null && __getOwnPropSymbols)
|
|
3071
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
3072
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
3073
|
+
target[prop] = source[prop];
|
|
3074
|
+
}
|
|
3075
|
+
return target;
|
|
3076
|
+
};
|
|
3077
|
+
var createReactComponent = (iconName, iconNamePascal, iconNode) => {
|
|
3078
|
+
const Component = forwardRef(
|
|
3079
|
+
(_a, ref) => {
|
|
3080
|
+
var _b = _a, { color = "currentColor", size = 24, stroke = 2, children } = _b, rest = __objRest(_b, ["color", "size", "stroke", "children"]);
|
|
3081
|
+
return createElement$1(
|
|
3082
|
+
"svg",
|
|
3083
|
+
__spreadValues(__spreadProps(__spreadValues({
|
|
3084
|
+
ref
|
|
3085
|
+
}, defaultAttributes), {
|
|
3086
|
+
width: size,
|
|
3087
|
+
height: size,
|
|
3088
|
+
stroke: color,
|
|
3089
|
+
strokeWidth: stroke,
|
|
3090
|
+
className: `tabler-icon tabler-icon-${iconName}`
|
|
3091
|
+
}), rest),
|
|
3092
|
+
[...iconNode.map(([tag, attrs]) => createElement$1(tag, attrs)), ...children || []]
|
|
3093
|
+
);
|
|
3094
|
+
}
|
|
3095
|
+
);
|
|
3096
|
+
Component.propTypes = {
|
|
3097
|
+
color: PropTypes.string,
|
|
3098
|
+
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
3099
|
+
stroke: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
|
|
3100
|
+
};
|
|
3101
|
+
Component.displayName = `${iconNamePascal}`;
|
|
3102
|
+
return Component;
|
|
3103
|
+
};
|
|
3104
|
+
|
|
3105
|
+
/**
|
|
3106
|
+
* @tabler/icons-react v2.47.0 - MIT
|
|
3107
|
+
*/
|
|
3108
|
+
|
|
3109
|
+
|
|
3110
|
+
var IconBrandWindows = createReactComponent("brand-windows", "IconBrandWindows", [
|
|
3111
|
+
[
|
|
3112
|
+
"path",
|
|
3113
|
+
{
|
|
3114
|
+
d: "M17.8 20l-12 -1.5c-1 -.1 -1.8 -.9 -1.8 -1.9v-9.2c0 -1 .8 -1.8 1.8 -1.9l12 -1.5c1.2 -.1 2.2 .8 2.2 1.9v12.1c0 1.2 -1.1 2.1 -2.2 1.9z",
|
|
3115
|
+
key: "svg-0"
|
|
3116
|
+
}
|
|
3117
|
+
],
|
|
3118
|
+
["path", { d: "M12 5l0 14", key: "svg-1" }],
|
|
3119
|
+
["path", { d: "M4 12l16 0", key: "svg-2" }]
|
|
3120
|
+
]);
|
|
3121
|
+
|
|
3122
|
+
/**
|
|
3123
|
+
* @tabler/icons-react v2.47.0 - MIT
|
|
3124
|
+
*/
|
|
3125
|
+
|
|
3126
|
+
|
|
3127
|
+
var IconBuildingBridge = createReactComponent("building-bridge", "IconBuildingBridge", [
|
|
3128
|
+
["path", { d: "M6 5l0 14", key: "svg-0" }],
|
|
3129
|
+
["path", { d: "M18 5l0 14", key: "svg-1" }],
|
|
3130
|
+
["path", { d: "M2 15l20 0", key: "svg-2" }],
|
|
3131
|
+
[
|
|
3132
|
+
"path",
|
|
3133
|
+
{
|
|
3134
|
+
d: "M3 8a7.5 7.5 0 0 0 3 -2a6.5 6.5 0 0 0 12 0a7.5 7.5 0 0 0 3 2",
|
|
3135
|
+
key: "svg-3"
|
|
3136
|
+
}
|
|
3137
|
+
],
|
|
3138
|
+
["path", { d: "M12 10l0 5", key: "svg-4" }]
|
|
3139
|
+
]);
|
|
3140
|
+
|
|
3141
|
+
/**
|
|
3142
|
+
* @tabler/icons-react v2.47.0 - MIT
|
|
3143
|
+
*/
|
|
3144
|
+
|
|
3145
|
+
|
|
3146
|
+
var IconCircle = createReactComponent("circle", "IconCircle", [
|
|
3147
|
+
["path", { d: "M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0", key: "svg-0" }]
|
|
3148
|
+
]);
|
|
3149
|
+
|
|
3150
|
+
/**
|
|
3151
|
+
* @tabler/icons-react v2.47.0 - MIT
|
|
3152
|
+
*/
|
|
3153
|
+
|
|
3154
|
+
|
|
3155
|
+
var IconDotsVertical = createReactComponent("dots-vertical", "IconDotsVertical", [
|
|
3156
|
+
["path", { d: "M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0", key: "svg-0" }],
|
|
3157
|
+
["path", { d: "M12 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0", key: "svg-1" }],
|
|
3158
|
+
["path", { d: "M12 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0", key: "svg-2" }]
|
|
3159
|
+
]);
|
|
3160
|
+
|
|
3161
|
+
/**
|
|
3162
|
+
* @tabler/icons-react v2.47.0 - MIT
|
|
3163
|
+
*/
|
|
3164
|
+
|
|
3165
|
+
|
|
3166
|
+
var IconExternalLink = createReactComponent("external-link", "IconExternalLink", [
|
|
3167
|
+
[
|
|
3168
|
+
"path",
|
|
3169
|
+
{
|
|
3170
|
+
d: "M12 6h-6a2 2 0 0 0 -2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-6",
|
|
3171
|
+
key: "svg-0"
|
|
3172
|
+
}
|
|
3173
|
+
],
|
|
3174
|
+
["path", { d: "M11 13l9 -9", key: "svg-1" }],
|
|
3175
|
+
["path", { d: "M15 4h5v5", key: "svg-2" }]
|
|
3176
|
+
]);
|
|
3177
|
+
|
|
3178
|
+
/**
|
|
3179
|
+
* @tabler/icons-react v2.47.0 - MIT
|
|
3180
|
+
*/
|
|
3181
|
+
|
|
3182
|
+
|
|
3183
|
+
var IconLine = createReactComponent("line", "IconLine", [
|
|
3184
|
+
["path", { d: "M6 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0", key: "svg-0" }],
|
|
3185
|
+
["path", { d: "M18 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0", key: "svg-1" }],
|
|
3186
|
+
["path", { d: "M7.5 16.5l9 -9", key: "svg-2" }]
|
|
3187
|
+
]);
|
|
3188
|
+
|
|
3189
|
+
/**
|
|
3190
|
+
* @tabler/icons-react v2.47.0 - MIT
|
|
3191
|
+
*/
|
|
3192
|
+
|
|
3193
|
+
|
|
3194
|
+
var IconManualGearbox = createReactComponent("manual-gearbox", "IconManualGearbox", [
|
|
3195
|
+
["path", { d: "M5 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0", key: "svg-0" }],
|
|
3196
|
+
["path", { d: "M12 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0", key: "svg-1" }],
|
|
3197
|
+
["path", { d: "M19 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0", key: "svg-2" }],
|
|
3198
|
+
["path", { d: "M5 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0", key: "svg-3" }],
|
|
3199
|
+
["path", { d: "M12 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0", key: "svg-4" }],
|
|
3200
|
+
["path", { d: "M5 8l0 8", key: "svg-5" }],
|
|
3201
|
+
["path", { d: "M12 8l0 8", key: "svg-6" }],
|
|
3202
|
+
["path", { d: "M19 8v2a2 2 0 0 1 -2 2h-12", key: "svg-7" }]
|
|
3203
|
+
]);
|
|
3204
|
+
|
|
3205
|
+
/**
|
|
3206
|
+
* @tabler/icons-react v2.47.0 - MIT
|
|
3207
|
+
*/
|
|
3208
|
+
|
|
3209
|
+
|
|
3210
|
+
var IconPlus = createReactComponent("plus", "IconPlus", [
|
|
3211
|
+
["path", { d: "M12 5l0 14", key: "svg-0" }],
|
|
3212
|
+
["path", { d: "M5 12l14 0", key: "svg-1" }]
|
|
3213
|
+
]);
|
|
3214
|
+
|
|
3215
|
+
/**
|
|
3216
|
+
* @tabler/icons-react v2.47.0 - MIT
|
|
3217
|
+
*/
|
|
3218
|
+
|
|
3219
|
+
|
|
3220
|
+
var IconPrinter = createReactComponent("printer", "IconPrinter", [
|
|
3221
|
+
[
|
|
3222
|
+
"path",
|
|
3223
|
+
{
|
|
3224
|
+
d: "M17 17h2a2 2 0 0 0 2 -2v-4a2 2 0 0 0 -2 -2h-14a2 2 0 0 0 -2 2v4a2 2 0 0 0 2 2h2",
|
|
3225
|
+
key: "svg-0"
|
|
3226
|
+
}
|
|
3227
|
+
],
|
|
3228
|
+
["path", { d: "M17 9v-4a2 2 0 0 0 -2 -2h-6a2 2 0 0 0 -2 2v4", key: "svg-1" }],
|
|
3229
|
+
[
|
|
3230
|
+
"path",
|
|
3231
|
+
{
|
|
3232
|
+
d: "M7 13m0 2a2 2 0 0 1 2 -2h6a2 2 0 0 1 2 2v4a2 2 0 0 1 -2 2h-6a2 2 0 0 1 -2 -2z",
|
|
3233
|
+
key: "svg-2"
|
|
3234
|
+
}
|
|
3235
|
+
]
|
|
3236
|
+
]);
|
|
3237
|
+
|
|
3238
|
+
/**
|
|
3239
|
+
* @tabler/icons-react v2.47.0 - MIT
|
|
3240
|
+
*/
|
|
3241
|
+
|
|
3242
|
+
|
|
3243
|
+
var IconRefresh = createReactComponent("refresh", "IconRefresh", [
|
|
3244
|
+
["path", { d: "M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4", key: "svg-0" }],
|
|
3245
|
+
["path", { d: "M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4", key: "svg-1" }]
|
|
3246
|
+
]);
|
|
3247
|
+
|
|
3248
|
+
/**
|
|
3249
|
+
* @tabler/icons-react v2.47.0 - MIT
|
|
3250
|
+
*/
|
|
3251
|
+
|
|
3252
|
+
|
|
3253
|
+
var IconTrash = createReactComponent("trash", "IconTrash", [
|
|
3254
|
+
["path", { d: "M4 7l16 0", key: "svg-0" }],
|
|
3255
|
+
["path", { d: "M10 11l0 6", key: "svg-1" }],
|
|
3256
|
+
["path", { d: "M14 11l0 6", key: "svg-2" }],
|
|
3257
|
+
[
|
|
3258
|
+
"path",
|
|
3259
|
+
{ d: "M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12", key: "svg-3" }
|
|
3260
|
+
],
|
|
3261
|
+
["path", { d: "M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3", key: "svg-4" }]
|
|
3262
|
+
]);
|
|
3263
|
+
|
|
3264
|
+
function AddPrintServer(props) {
|
|
3265
|
+
const [type, setType] = useState(null);
|
|
3266
|
+
const [printSystem, setPrintSystem] = useState(null);
|
|
3267
|
+
const [name, setName] = useState('');
|
|
3268
|
+
const [description, setDescription] = useState('');
|
|
3269
|
+
const [host, setHost] = useState('');
|
|
3270
|
+
const [port, setPort] = useState(631);
|
|
3271
|
+
useEffect(() => {
|
|
3272
|
+
setPrintSystem(null);
|
|
3273
|
+
}, [type]);
|
|
3274
|
+
const isValid = () => {
|
|
3275
|
+
if (type === null) return false;
|
|
3276
|
+
if (name === null || name === '') return false;
|
|
3277
|
+
if (description === null || description === '') return false;
|
|
3278
|
+
if (printSystem === null) return false;
|
|
3279
|
+
if (printSystem === 'ipp' && (host === null || host === '')) return false;
|
|
3280
|
+
if (printSystem === 'ipp' && (port === null || port === '')) return false;
|
|
3281
|
+
return true;
|
|
3282
|
+
};
|
|
3283
|
+
const submit = () => {
|
|
3284
|
+
const command = {
|
|
3285
|
+
type: type === 'direct' ? PrintServerType.Direct : PrintServerType.Remote,
|
|
3286
|
+
name: name,
|
|
3287
|
+
description: description,
|
|
3288
|
+
managedType: printSystem === 'ipp' ? PrintServerManagedType.Ipp : PrintServerManagedType.Windows,
|
|
3289
|
+
ipAddress: host !== null ? host : "",
|
|
3290
|
+
port: port !== "" ? port : 0
|
|
3291
|
+
};
|
|
3292
|
+
FluxoClientSys.Instance.printing.CreatePrintServer(command).then(a => {
|
|
3293
|
+
showNotification({
|
|
3294
|
+
title: 'Print server creato',
|
|
3295
|
+
message: 'Il print server è stato creato con successo',
|
|
3296
|
+
color: 'green'
|
|
3297
|
+
});
|
|
3298
|
+
props.onSaved();
|
|
3299
|
+
}).catch(e => {
|
|
3300
|
+
showNotification({
|
|
3301
|
+
title: 'Errore',
|
|
3302
|
+
message: 'Si è verificato un errore durante la creazione del print server',
|
|
3303
|
+
color: 'red'
|
|
3304
|
+
});
|
|
3305
|
+
});
|
|
3306
|
+
};
|
|
3307
|
+
return jsxs(Stack, {
|
|
3308
|
+
gap: 8,
|
|
3309
|
+
children: [jsx(Text, {
|
|
3310
|
+
size: 'md',
|
|
3311
|
+
children: "Informazioni"
|
|
3312
|
+
}), jsx(TextInput, {
|
|
3313
|
+
label: 'Nome',
|
|
3314
|
+
onChange: v => setName(v.target.value)
|
|
3315
|
+
}), jsx(TextInput, {
|
|
3316
|
+
label: 'Descrizione',
|
|
3317
|
+
onChange: v => setDescription(v.target.value)
|
|
3318
|
+
}), jsx(Text, {
|
|
3319
|
+
size: 'md',
|
|
3320
|
+
children: "Configurazione"
|
|
3321
|
+
}), jsx(Select, {
|
|
3322
|
+
label: 'Tipo',
|
|
3323
|
+
value: type,
|
|
3324
|
+
data: [{
|
|
3325
|
+
label: 'Diretto',
|
|
3326
|
+
value: 'direct'
|
|
3327
|
+
}, {
|
|
3328
|
+
label: 'Remoto',
|
|
3329
|
+
value: 'remote'
|
|
3330
|
+
}],
|
|
3331
|
+
onChange: v => setType(v)
|
|
3332
|
+
}), jsx(Select, {
|
|
3333
|
+
label: 'Sistema di stampa',
|
|
3334
|
+
disabled: type === null,
|
|
3335
|
+
value: printSystem,
|
|
3336
|
+
data: [{
|
|
3337
|
+
label: 'IPP / CUPS',
|
|
3338
|
+
value: 'ipp'
|
|
3339
|
+
}, {
|
|
3340
|
+
label: 'Windows',
|
|
3341
|
+
value: 'windows',
|
|
3342
|
+
disabled: type === 'remote'
|
|
3343
|
+
}],
|
|
3344
|
+
onChange: v => setPrintSystem(v)
|
|
3345
|
+
}), printSystem === 'ipp' && jsxs(Fragment, {
|
|
3346
|
+
children: [jsx(TextInput, {
|
|
3347
|
+
label: 'IPP - Host',
|
|
3348
|
+
placeholder: 'Es: localhost',
|
|
3349
|
+
onChange: v => setHost(v.target.value)
|
|
3350
|
+
}), jsx(NumberInput, {
|
|
3351
|
+
label: 'IPP - Porta',
|
|
3352
|
+
placeholder: 'Es: 631',
|
|
3353
|
+
min: 1,
|
|
3354
|
+
max: 65534,
|
|
3355
|
+
onChange: v => setPort(+v)
|
|
3356
|
+
})]
|
|
3357
|
+
}), jsxs(Group, {
|
|
3358
|
+
align: 'end',
|
|
3359
|
+
justify: 'right',
|
|
3360
|
+
children: [jsx(Button, {
|
|
3361
|
+
onClick: () => props.onCanceled(),
|
|
3362
|
+
variant: 'subtle',
|
|
3363
|
+
children: "Annulla"
|
|
3364
|
+
}), jsx(Button, {
|
|
3365
|
+
onClick: submit,
|
|
3366
|
+
disabled: !isValid(),
|
|
3367
|
+
children: "Salva"
|
|
3368
|
+
})]
|
|
3369
|
+
})]
|
|
3370
|
+
});
|
|
3371
|
+
}
|
|
3372
|
+
|
|
3373
|
+
// a string of all valid unicode whitespaces
|
|
3374
|
+
var whitespaces$2 = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
|
|
3375
|
+
'\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
|
|
3376
|
+
|
|
3377
|
+
var uncurryThis$3 = functionUncurryThis;
|
|
3378
|
+
var requireObjectCoercible = requireObjectCoercible$4;
|
|
3379
|
+
var toString$1 = toString$3;
|
|
3380
|
+
var whitespaces$1 = whitespaces$2;
|
|
3381
|
+
|
|
3382
|
+
var replace = uncurryThis$3(''.replace);
|
|
3383
|
+
var ltrim = RegExp('^[' + whitespaces$1 + ']+');
|
|
3384
|
+
var rtrim = RegExp('(^|[^' + whitespaces$1 + '])[' + whitespaces$1 + ']+$');
|
|
3385
|
+
|
|
3386
|
+
// `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
|
|
3387
|
+
var createMethod = function (TYPE) {
|
|
3388
|
+
return function ($this) {
|
|
3389
|
+
var string = toString$1(requireObjectCoercible($this));
|
|
3390
|
+
if (TYPE & 1) string = replace(string, ltrim, '');
|
|
3391
|
+
if (TYPE & 2) string = replace(string, rtrim, '$1');
|
|
3392
|
+
return string;
|
|
3393
|
+
};
|
|
3394
|
+
};
|
|
3395
|
+
|
|
3396
|
+
var stringTrim = {
|
|
3397
|
+
// `String.prototype.{ trimLeft, trimStart }` methods
|
|
3398
|
+
// https://tc39.es/ecma262/#sec-string.prototype.trimstart
|
|
3399
|
+
start: createMethod(1),
|
|
3400
|
+
// `String.prototype.{ trimRight, trimEnd }` methods
|
|
3401
|
+
// https://tc39.es/ecma262/#sec-string.prototype.trimend
|
|
3402
|
+
end: createMethod(2),
|
|
3403
|
+
// `String.prototype.trim` method
|
|
3404
|
+
// https://tc39.es/ecma262/#sec-string.prototype.trim
|
|
3405
|
+
trim: createMethod(3)
|
|
3406
|
+
};
|
|
3407
|
+
|
|
3408
|
+
var global$2 = global$e;
|
|
3409
|
+
var fails$2 = fails$d;
|
|
3410
|
+
var uncurryThis$2 = functionUncurryThis;
|
|
3411
|
+
var toString = toString$3;
|
|
3412
|
+
var trim = stringTrim.trim;
|
|
3413
|
+
var whitespaces = whitespaces$2;
|
|
3414
|
+
|
|
3415
|
+
var $parseInt$1 = global$2.parseInt;
|
|
3416
|
+
var Symbol$1 = global$2.Symbol;
|
|
3417
|
+
var ITERATOR$3 = Symbol$1 && Symbol$1.iterator;
|
|
3418
|
+
var hex = /^[+-]?0x/i;
|
|
3419
|
+
var exec = uncurryThis$2(hex.exec);
|
|
3420
|
+
var FORCED$1 = $parseInt$1(whitespaces + '08') !== 8 || $parseInt$1(whitespaces + '0x16') !== 22
|
|
3421
|
+
// MS Edge 18- broken with boxed symbols
|
|
3422
|
+
|| (ITERATOR$3 && !fails$2(function () { $parseInt$1(Object(ITERATOR$3)); }));
|
|
3423
|
+
|
|
3424
|
+
// `parseInt` method
|
|
3425
|
+
// https://tc39.es/ecma262/#sec-parseint-string-radix
|
|
3426
|
+
var numberParseInt = FORCED$1 ? function parseInt(string, radix) {
|
|
3427
|
+
var S = trim(toString(string));
|
|
3428
|
+
return $parseInt$1(S, (radix >>> 0) || (exec(hex, S) ? 16 : 10));
|
|
3429
|
+
} : $parseInt$1;
|
|
3430
|
+
|
|
3431
|
+
var $$2 = _export;
|
|
3432
|
+
var $parseInt = numberParseInt;
|
|
3433
|
+
|
|
3434
|
+
// `parseInt` method
|
|
3435
|
+
// https://tc39.es/ecma262/#sec-parseint-string-radix
|
|
3436
|
+
$$2({ global: true, forced: parseInt !== $parseInt }, {
|
|
3437
|
+
parseInt: $parseInt
|
|
3438
|
+
});
|
|
3439
|
+
|
|
3440
|
+
var anObject$5 = anObject$d;
|
|
3441
|
+
|
|
3442
|
+
// `RegExp.prototype.flags` getter implementation
|
|
3443
|
+
// https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
|
|
3444
|
+
var regexpFlags = function () {
|
|
3445
|
+
var that = anObject$5(this);
|
|
3446
|
+
var result = '';
|
|
3447
|
+
if (that.hasIndices) result += 'd';
|
|
3448
|
+
if (that.global) result += 'g';
|
|
3449
|
+
if (that.ignoreCase) result += 'i';
|
|
3450
|
+
if (that.multiline) result += 'm';
|
|
3451
|
+
if (that.dotAll) result += 's';
|
|
3452
|
+
if (that.unicode) result += 'u';
|
|
3453
|
+
if (that.unicodeSets) result += 'v';
|
|
3454
|
+
if (that.sticky) result += 'y';
|
|
3455
|
+
return result;
|
|
3456
|
+
};
|
|
3457
|
+
|
|
3458
|
+
var call$2 = functionCall;
|
|
3459
|
+
var hasOwn$1 = hasOwnProperty_1;
|
|
3460
|
+
var isPrototypeOf$2 = objectIsPrototypeOf;
|
|
3461
|
+
var regExpFlags = regexpFlags;
|
|
3462
|
+
|
|
3463
|
+
var RegExpPrototype$1 = RegExp.prototype;
|
|
3464
|
+
|
|
3465
|
+
var regexpGetFlags = function (R) {
|
|
3466
|
+
var flags = R.flags;
|
|
3467
|
+
return flags === undefined && !('flags' in RegExpPrototype$1) && !hasOwn$1(R, 'flags') && isPrototypeOf$2(RegExpPrototype$1, R)
|
|
3468
|
+
? call$2(regExpFlags, R) : flags;
|
|
3469
|
+
};
|
|
3470
|
+
|
|
3471
|
+
var PROPER_FUNCTION_NAME = functionName.PROPER;
|
|
3472
|
+
var defineBuiltIn = defineBuiltIn$5;
|
|
3473
|
+
var anObject$4 = anObject$d;
|
|
3474
|
+
var $toString = toString$3;
|
|
3475
|
+
var fails$1 = fails$d;
|
|
3476
|
+
var getRegExpFlags = regexpGetFlags;
|
|
3477
|
+
|
|
3478
|
+
var TO_STRING = 'toString';
|
|
3479
|
+
var RegExpPrototype = RegExp.prototype;
|
|
3480
|
+
var nativeToString = RegExpPrototype[TO_STRING];
|
|
3481
|
+
|
|
3482
|
+
var NOT_GENERIC = fails$1(function () { return nativeToString.call({ source: 'a', flags: 'b' }) !== '/a/b'; });
|
|
3483
|
+
// FF44- RegExp#toString has a wrong name
|
|
3484
|
+
var INCORRECT_NAME = PROPER_FUNCTION_NAME && nativeToString.name !== TO_STRING;
|
|
3485
|
+
|
|
3486
|
+
// `RegExp.prototype.toString` method
|
|
3487
|
+
// https://tc39.es/ecma262/#sec-regexp.prototype.tostring
|
|
3488
|
+
if (NOT_GENERIC || INCORRECT_NAME) {
|
|
3489
|
+
defineBuiltIn(RegExpPrototype, TO_STRING, function toString() {
|
|
3490
|
+
var R = anObject$4(this);
|
|
3491
|
+
var pattern = $toString(R.source);
|
|
3492
|
+
var flags = $toString(getRegExpFlags(R));
|
|
3493
|
+
return '/' + pattern + '/' + flags;
|
|
3494
|
+
}, { unsafe: true });
|
|
3495
|
+
}
|
|
3496
|
+
|
|
3497
|
+
function AddPrinter(props) {
|
|
3498
|
+
const [printers, setPrinters] = useState([]);
|
|
3499
|
+
const [printerType, setPrinterType] = useState('managed');
|
|
3500
|
+
const [name, setName] = useState('');
|
|
3501
|
+
const [description, setDescription] = useState('');
|
|
3502
|
+
const [mappedPrinter, setMappedPrinter] = useState('');
|
|
3503
|
+
const [manufacturer, setManufacturer] = useState('');
|
|
3504
|
+
const [ipAddress, setIpAddress] = useState('');
|
|
3505
|
+
const [port, setPort] = useState(631);
|
|
3506
|
+
useEffect(() => {
|
|
3507
|
+
FluxoClientSys.Instance.printing.GetPrintServerPrinters(props.printServerId).then(res => {
|
|
3508
|
+
setPrinters(res);
|
|
3509
|
+
}).catch(e => {
|
|
3510
|
+
showNotification({
|
|
3511
|
+
title: 'Errore',
|
|
3512
|
+
message: `Si è verificato un errore durante il caricamento delle stampanti: ${e.message}`,
|
|
3513
|
+
color: 'red'
|
|
3514
|
+
});
|
|
3515
|
+
});
|
|
3516
|
+
}, []);
|
|
3517
|
+
const isValid = useCallback(() => {
|
|
3518
|
+
if (printerType === null) return false;
|
|
3519
|
+
if (name === null || name === '') return false;
|
|
3520
|
+
if (description === null || description === '') return false;
|
|
3521
|
+
if (printerType === 'managed' && (mappedPrinter === null || mappedPrinter === '')) return false;
|
|
3522
|
+
if (printerType === 'unmanaged' && (manufacturer === null || manufacturer === '')) return false;
|
|
3523
|
+
if (printerType === 'unmanaged' && (ipAddress === null || ipAddress === '')) return false;
|
|
3524
|
+
if (printerType === 'unmanaged' && (port === null || port === '')) return false;
|
|
3525
|
+
return true;
|
|
3526
|
+
}, [printerType, name, description, mappedPrinter, manufacturer, ipAddress, port]);
|
|
3527
|
+
const submit = () => {
|
|
3528
|
+
const command = {
|
|
3529
|
+
name: name,
|
|
3530
|
+
description: description,
|
|
3531
|
+
mappedPrinterName: mappedPrinter !== null ? mappedPrinter : "",
|
|
3532
|
+
ipAddress: ipAddress !== null ? ipAddress : "",
|
|
3533
|
+
port: port !== "" ? port : 0,
|
|
3534
|
+
type: printerType === 'managed' ? PrinterType.Managed : PrinterType.Unmanaged,
|
|
3535
|
+
manufacturer: manufacturer !== null ? parseInt(manufacturer) : 0
|
|
3536
|
+
};
|
|
3537
|
+
FluxoClientSys.Instance.printing.AddPrinter(props.printServerId, command).then(a => {
|
|
3538
|
+
showNotification({
|
|
3539
|
+
title: 'Stampante creata',
|
|
3540
|
+
message: 'La stampante è stata creata con successo',
|
|
3541
|
+
color: 'green'
|
|
3542
|
+
});
|
|
3543
|
+
props.onSaved();
|
|
3544
|
+
}).catch(e => {
|
|
3545
|
+
showNotification({
|
|
3546
|
+
title: 'Errore',
|
|
3547
|
+
message: e.message,
|
|
3548
|
+
color: 'red'
|
|
3549
|
+
});
|
|
3550
|
+
});
|
|
3551
|
+
};
|
|
3552
|
+
return jsxs(Stack, {
|
|
3553
|
+
children: [jsx(TextInput, {
|
|
3554
|
+
label: 'Nome',
|
|
3555
|
+
placeholder: 'Es: Etichettatrice 10x10',
|
|
3556
|
+
onChange: v => setName(v.target.value)
|
|
3557
|
+
}), jsx(TextInput, {
|
|
3558
|
+
label: 'Descrizione',
|
|
3559
|
+
placeholder: 'Es: Bancone area imballaggio',
|
|
3560
|
+
onChange: v => setDescription(v.target.value)
|
|
3561
|
+
}), jsx(Select, {
|
|
3562
|
+
defaultValue: 'managed',
|
|
3563
|
+
onChange: v => setPrinterType(v),
|
|
3564
|
+
label: 'Tipo stampante',
|
|
3565
|
+
data: [{
|
|
3566
|
+
label: 'Stampante gestita',
|
|
3567
|
+
value: 'managed'
|
|
3568
|
+
}, {
|
|
3569
|
+
label: 'Stampante non gestita',
|
|
3570
|
+
value: 'unmanaged'
|
|
3571
|
+
}]
|
|
3572
|
+
}), printerType === 'unmanaged' ? jsxs(Fragment, {
|
|
3573
|
+
children: [jsx(Select, {
|
|
3574
|
+
onChange: v => setManufacturer(v),
|
|
3575
|
+
label: 'Produttore',
|
|
3576
|
+
data: [{
|
|
3577
|
+
label: 'Zebra',
|
|
3578
|
+
value: PrinterManufacturer.Zebra.toString()
|
|
3579
|
+
}]
|
|
3580
|
+
}), jsx(TextInput, {
|
|
3581
|
+
onChange: v => setIpAddress(v.target.value),
|
|
3582
|
+
label: 'Indirizzo IP',
|
|
3583
|
+
placeholder: 'Es: 192.168.1.199'
|
|
3584
|
+
}), jsx(NumberInput, {
|
|
3585
|
+
onChange: v => setPort(+v),
|
|
3586
|
+
label: 'Porta',
|
|
3587
|
+
min: 1,
|
|
3588
|
+
max: 65535,
|
|
3589
|
+
placeholder: 'Es: 9100'
|
|
3590
|
+
})]
|
|
3591
|
+
}) : jsx(Select, {
|
|
3592
|
+
onChange: v => setMappedPrinter(v),
|
|
3593
|
+
leftSection: jsx(IconPrinter, {
|
|
3594
|
+
size: 18
|
|
3595
|
+
}),
|
|
3596
|
+
label: 'Stampante fisica',
|
|
3597
|
+
data: printers
|
|
3598
|
+
}), jsxs(Group, {
|
|
3599
|
+
justify: 'right',
|
|
3600
|
+
children: [jsx(Button, {
|
|
3601
|
+
onClick: () => props.onCanceled(),
|
|
3602
|
+
variant: 'subtle',
|
|
3603
|
+
children: "Annulla"
|
|
3604
|
+
}), jsx(Button, {
|
|
3605
|
+
onClick: submit,
|
|
3606
|
+
disabled: !isValid(),
|
|
3607
|
+
children: "Salva"
|
|
3608
|
+
})]
|
|
3609
|
+
})]
|
|
3610
|
+
});
|
|
3611
|
+
}
|
|
3612
|
+
|
|
3613
|
+
function ManagePrintServer(props) {
|
|
3614
|
+
const [printServer, setPrintServer] = useState();
|
|
3615
|
+
const [printServerLoaded, setPrintServerLoaded] = useState(false);
|
|
3616
|
+
const [addPrinterModalOpened, setAddPrinterModalOpened] = useState(false);
|
|
3617
|
+
const [name, setName] = useState();
|
|
3618
|
+
const [description, setDescription] = useState();
|
|
3619
|
+
useEffect(() => {
|
|
3620
|
+
loadPrintServer();
|
|
3621
|
+
}, []);
|
|
3622
|
+
const loadPrintServer = () => {
|
|
3623
|
+
setPrintServerLoaded(false);
|
|
3624
|
+
FluxoClientSys.Instance.printing.GetPrintServer(props.printServerId).then(res => {
|
|
3625
|
+
setPrintServer(res);
|
|
3626
|
+
setName(res.name);
|
|
3627
|
+
setDescription(res.description);
|
|
3628
|
+
setPrintServerLoaded(true);
|
|
3629
|
+
});
|
|
3630
|
+
};
|
|
3631
|
+
const updatePrintServerInfo = () => {
|
|
3632
|
+
setPrintServerLoaded(false);
|
|
3633
|
+
FluxoClientSys.Instance.printing.UpdatePrintServer(props.printServerId, {
|
|
3634
|
+
name: name,
|
|
3635
|
+
description: description
|
|
3636
|
+
}).then(() => {
|
|
3637
|
+
loadPrintServer();
|
|
3638
|
+
});
|
|
3639
|
+
};
|
|
3640
|
+
return jsxs("div", {
|
|
3641
|
+
children: [jsx(LoadingOverlay, {
|
|
3642
|
+
visible: !printServerLoaded
|
|
3643
|
+
}), jsxs(Stack, {
|
|
3644
|
+
children: [jsxs(Group, {
|
|
3645
|
+
grow: true,
|
|
3646
|
+
children: [jsx(TextInput, {
|
|
3647
|
+
disabled: true,
|
|
3648
|
+
label: 'Tipo',
|
|
3649
|
+
value: (printServer === null || printServer === void 0 ? void 0 : printServer.type) === PrintServerType.Direct ? 'Diretto' : 'Remoto'
|
|
3650
|
+
}), jsx(TextInput, {
|
|
3651
|
+
disabled: true,
|
|
3652
|
+
label: 'Sistema di stampa',
|
|
3653
|
+
value: (printServer === null || printServer === void 0 ? void 0 : printServer.managedType) === PrintServerManagedType.Ipp ? 'IPP / CUPS' : 'Windows'
|
|
3654
|
+
})]
|
|
3655
|
+
}), jsx(TextInput, {
|
|
3656
|
+
label: 'Nome',
|
|
3657
|
+
defaultValue: name,
|
|
3658
|
+
onChange: v => setName(v.target.value)
|
|
3659
|
+
}), jsx(TextInput, {
|
|
3660
|
+
label: 'Descrizione',
|
|
3661
|
+
defaultValue: description,
|
|
3662
|
+
onChange: v => setDescription(v.target.value)
|
|
3663
|
+
}), jsx(Group, {
|
|
3664
|
+
justify: 'right',
|
|
3665
|
+
align: 'center',
|
|
3666
|
+
children: jsx(Button, {
|
|
3667
|
+
onClick: updatePrintServerInfo,
|
|
3668
|
+
disabled: (printServer === null || printServer === void 0 ? void 0 : printServer.name) === name && (printServer === null || printServer === void 0 ? void 0 : printServer.description) === description,
|
|
3669
|
+
leftSection: jsx(IconRefresh, {
|
|
3670
|
+
size: 18
|
|
3671
|
+
}),
|
|
3672
|
+
children: "Aggiorna"
|
|
3673
|
+
})
|
|
3674
|
+
}), jsx(DataCard, {
|
|
3675
|
+
title: 'Stampanti',
|
|
3676
|
+
icon: jsx(IconPrinter, {
|
|
3677
|
+
size: 18
|
|
3678
|
+
}),
|
|
3679
|
+
actions: [{
|
|
3680
|
+
icon: jsx(IconPlus, {
|
|
3681
|
+
size: 18
|
|
3682
|
+
}),
|
|
3683
|
+
label: 'Aggiungi',
|
|
3684
|
+
onClick: () => setAddPrinterModalOpened(true)
|
|
3685
|
+
}],
|
|
3686
|
+
children: (printServer === null || printServer === void 0 ? void 0 : printServer.printers.length) === 0 ? jsxs(Stack, {
|
|
3687
|
+
children: [jsx(Text, {
|
|
3688
|
+
children: "Non ci sono stampanti configurate"
|
|
3689
|
+
}), jsx(Button, {
|
|
3690
|
+
leftSection: jsx(IconPlus, {
|
|
3691
|
+
size: 18
|
|
3692
|
+
}),
|
|
3693
|
+
onClick: () => setAddPrinterModalOpened(true),
|
|
3694
|
+
children: "Aggiungi stampante"
|
|
3695
|
+
})]
|
|
3696
|
+
}) : jsx(Stack, {
|
|
3697
|
+
children: printServer === null || printServer === void 0 ? void 0 : printServer.printers.map((p, i) => {
|
|
3698
|
+
return jsxs(Group, {
|
|
3699
|
+
justify: 'space-between',
|
|
3700
|
+
style: {
|
|
3701
|
+
border: '1px solid #ececec'
|
|
3702
|
+
},
|
|
3703
|
+
p: 8,
|
|
3704
|
+
children: [jsxs(Stack, {
|
|
3705
|
+
gap: 0,
|
|
3706
|
+
children: [jsx(Text, {
|
|
3707
|
+
fw: 900,
|
|
3708
|
+
children: p.name
|
|
3709
|
+
}), jsx(Text, {
|
|
3710
|
+
size: 'xs',
|
|
3711
|
+
children: p.description
|
|
3712
|
+
})]
|
|
3713
|
+
}), jsxs(Group, {
|
|
3714
|
+
children: [p.type === PrinterType.Unmanaged && jsx(Text, {
|
|
3715
|
+
children: p.manufacturer === PrinterManufacturer.Zebra && jsx(Text, {
|
|
3716
|
+
fw: 900,
|
|
3717
|
+
style: {
|
|
3718
|
+
letterSpacing: '0.5px'
|
|
3719
|
+
},
|
|
3720
|
+
children: "ZEBRA"
|
|
3721
|
+
})
|
|
3722
|
+
}), p.type === PrinterType.Managed && jsx(Text, {
|
|
3723
|
+
children: jsx(Text, {
|
|
3724
|
+
fw: 900,
|
|
3725
|
+
style: {
|
|
3726
|
+
letterSpacing: '0.5px'
|
|
3727
|
+
},
|
|
3728
|
+
children: p.mappedPrinterName
|
|
3729
|
+
})
|
|
3730
|
+
}), p.type === PrinterType.Managed ? jsx(Badge, {
|
|
3731
|
+
color: 'blue',
|
|
3732
|
+
children: "Gestita"
|
|
3733
|
+
}) : jsx(Badge, {
|
|
3734
|
+
color: 'yellow',
|
|
3735
|
+
children: "Non gestita"
|
|
3736
|
+
}), jsxs(Menu, {
|
|
3737
|
+
children: [jsx(Menu.Target, {
|
|
3738
|
+
children: jsx(ActionIcon, {
|
|
3739
|
+
children: jsx(IconDotsVertical, {
|
|
3740
|
+
size: 18
|
|
3741
|
+
})
|
|
3742
|
+
})
|
|
3743
|
+
}), jsxs(Menu.Dropdown, {
|
|
3744
|
+
children: [jsx(Menu.Item, {
|
|
3745
|
+
children: "Modifica"
|
|
3746
|
+
}), jsx(Menu.Item, {
|
|
3747
|
+
color: 'red',
|
|
3748
|
+
children: "Elimina"
|
|
3749
|
+
})]
|
|
3750
|
+
})]
|
|
3751
|
+
})]
|
|
3752
|
+
})]
|
|
3753
|
+
}, i);
|
|
3754
|
+
})
|
|
3755
|
+
})
|
|
3756
|
+
}), jsx(Modal, {
|
|
3757
|
+
title: `Aggiungi stampante - ${printServer === null || printServer === void 0 ? void 0 : printServer.name}`,
|
|
3758
|
+
centered: true,
|
|
3759
|
+
opened: addPrinterModalOpened,
|
|
3760
|
+
onClose: () => setAddPrinterModalOpened(false),
|
|
3761
|
+
children: jsx(AddPrinter, {
|
|
3762
|
+
onCanceled: () => setAddPrinterModalOpened(false),
|
|
3763
|
+
onSaved: () => {
|
|
3764
|
+
setAddPrinterModalOpened(false);
|
|
3765
|
+
loadPrintServer();
|
|
3766
|
+
},
|
|
3767
|
+
printServerId: props.printServerId
|
|
3768
|
+
})
|
|
3769
|
+
})]
|
|
3770
|
+
})]
|
|
3771
|
+
});
|
|
3772
|
+
}
|
|
3773
|
+
|
|
3774
|
+
function PrintServerList() {
|
|
3775
|
+
const [printServers, setPrintServers] = React.useState([]);
|
|
3776
|
+
const [addPrintServerModalOpened, setPrintServerModalOpened] = React.useState(false);
|
|
3777
|
+
const [currentPrintServer, setCurrentPrintServer] = React.useState();
|
|
3778
|
+
const [managePrintServerModalOpened, setManagePrintServerModalOpened] = React.useState(false);
|
|
3779
|
+
useEffect(() => {
|
|
3780
|
+
loadPrintServer();
|
|
3781
|
+
}, []);
|
|
3782
|
+
const loadPrintServer = () => {
|
|
3783
|
+
FluxoClientSys.Instance.printing.GetPrintServerList().then(a => {
|
|
3784
|
+
setPrintServers(a);
|
|
3785
|
+
});
|
|
3786
|
+
};
|
|
3787
|
+
return jsxs(DataCard, {
|
|
3788
|
+
title: 'Print server virtuali',
|
|
3789
|
+
actions: [{
|
|
3790
|
+
icon: jsx(IconPlus, {
|
|
3791
|
+
size: 18
|
|
3792
|
+
}),
|
|
3793
|
+
label: 'Nuovo',
|
|
3794
|
+
onClick: () => setPrintServerModalOpened(true)
|
|
3795
|
+
}],
|
|
3796
|
+
children: [jsxs(Stack, {
|
|
3797
|
+
children: [printServers.length === 0 && jsxs(Stack, {
|
|
3798
|
+
mt: 16,
|
|
3799
|
+
mb: 16,
|
|
3800
|
+
children: [jsx(Center, {
|
|
3801
|
+
children: jsx(Text, {
|
|
3802
|
+
size: 'md',
|
|
3803
|
+
children: "Nessun print server virtuale presente"
|
|
3804
|
+
})
|
|
3805
|
+
}), jsx(Center, {
|
|
3806
|
+
children: jsx(Button, {
|
|
3807
|
+
leftSection: jsx(IconPlus, {
|
|
3808
|
+
size: 18
|
|
3809
|
+
}),
|
|
3810
|
+
onClick: () => setPrintServerModalOpened(true),
|
|
3811
|
+
children: "Aggiungi un print server virtuale"
|
|
3812
|
+
})
|
|
3813
|
+
})]
|
|
3814
|
+
}), printServers.map((e, i) => {
|
|
3815
|
+
return jsxs(Group, {
|
|
3816
|
+
align: "center",
|
|
3817
|
+
justify: 'space-between',
|
|
3818
|
+
style: {
|
|
3819
|
+
border: '1px solid #ececec'
|
|
3820
|
+
},
|
|
3821
|
+
p: 8,
|
|
3822
|
+
children: [jsxs(Group, {
|
|
3823
|
+
align: 'center',
|
|
3824
|
+
children: [jsx(IconCircle, {
|
|
3825
|
+
size: 18,
|
|
3826
|
+
color: '#329b0d',
|
|
3827
|
+
fill: '#329b0d',
|
|
3828
|
+
stroke: '#329b0d'
|
|
3829
|
+
}), jsxs(Stack, {
|
|
3830
|
+
gap: 0,
|
|
3831
|
+
children: [jsx(Text, {
|
|
3832
|
+
size: 'sm',
|
|
3833
|
+
fw: 800,
|
|
3834
|
+
children: e.name
|
|
3835
|
+
}), jsx(Text, {
|
|
3836
|
+
size: 'xs',
|
|
3837
|
+
children: e.description
|
|
3838
|
+
})]
|
|
3839
|
+
})]
|
|
3840
|
+
}), jsxs(Group, {
|
|
3841
|
+
justify: 'right',
|
|
3842
|
+
align: 'center',
|
|
3843
|
+
gap: 16,
|
|
3844
|
+
children: [e.managedType === PrintServerManagedType.Ipp && e.type === PrintServerType.Direct && jsxs(Badge, {
|
|
3845
|
+
leftSection: jsx(IconExternalLink, {
|
|
3846
|
+
style: {
|
|
3847
|
+
marginTop: 4
|
|
3848
|
+
},
|
|
3849
|
+
size: 16
|
|
3850
|
+
}),
|
|
3851
|
+
style: {
|
|
3852
|
+
cursor: 'pointer'
|
|
3853
|
+
},
|
|
3854
|
+
color: 'yellow',
|
|
3855
|
+
variant: 'light',
|
|
3856
|
+
onClick: () => window.open(`http://${e.ipAddress}:${e.port}/`, '_blank'),
|
|
3857
|
+
children: [e.ipAddress.toLowerCase(), ":", e.port]
|
|
3858
|
+
}), e.managedType === PrintServerManagedType.Ipp && e.type === PrintServerType.Remote && jsxs(Badge, {
|
|
3859
|
+
color: 'gray',
|
|
3860
|
+
variant: 'light',
|
|
3861
|
+
children: [e.ipAddress.toLowerCase(), ":", e.port]
|
|
3862
|
+
}), e.type === PrintServerType.Direct ? jsx(IconLine, {
|
|
3863
|
+
size: 18
|
|
3864
|
+
}) : jsx(IconBuildingBridge, {
|
|
3865
|
+
size: 18
|
|
3866
|
+
}), e.managedType === PrintServerManagedType.Ipp ? jsx(Text, {
|
|
3867
|
+
size: 'md',
|
|
3868
|
+
fw: 900,
|
|
3869
|
+
style: {
|
|
3870
|
+
letterSpacing: '0.5px'
|
|
3871
|
+
},
|
|
3872
|
+
children: "IPP"
|
|
3873
|
+
}) : jsx(IconBrandWindows, {
|
|
3874
|
+
size: 18
|
|
3875
|
+
}), jsxs(Menu, {
|
|
3876
|
+
children: [jsx(Menu.Target, {
|
|
3877
|
+
children: jsx(IconDotsVertical, {
|
|
3878
|
+
size: 18
|
|
3879
|
+
})
|
|
3880
|
+
}), jsxs(Menu.Dropdown, {
|
|
3881
|
+
children: [jsx(Menu.Item, {
|
|
3882
|
+
leftSection: jsx(IconManualGearbox, {
|
|
3883
|
+
size: 18
|
|
3884
|
+
}),
|
|
3885
|
+
onClick: () => {
|
|
3886
|
+
setCurrentPrintServer(e);
|
|
3887
|
+
setManagePrintServerModalOpened(true);
|
|
3888
|
+
},
|
|
3889
|
+
children: "Gestisci"
|
|
3890
|
+
}), jsx(Menu.Item, {
|
|
3891
|
+
children: "Disattiva"
|
|
3892
|
+
}), jsx(Menu.Item, {
|
|
3893
|
+
children: "Attiva"
|
|
3894
|
+
}), jsx(Menu.Divider, {}), jsx(Menu.Item, {
|
|
3895
|
+
color: 'red',
|
|
3896
|
+
leftSection: jsx(IconTrash, {
|
|
3897
|
+
size: 18
|
|
3898
|
+
}),
|
|
3899
|
+
children: "Elimina"
|
|
3900
|
+
})]
|
|
3901
|
+
})]
|
|
3902
|
+
})]
|
|
3903
|
+
})]
|
|
3904
|
+
}, i);
|
|
3905
|
+
})]
|
|
3906
|
+
}), currentPrintServer && jsx(Drawer, {
|
|
3907
|
+
title: 'Gestisci Print Server Virtuale',
|
|
3908
|
+
size: 'lg',
|
|
3909
|
+
position: 'right',
|
|
3910
|
+
opened: managePrintServerModalOpened,
|
|
3911
|
+
onClose: () => {
|
|
3912
|
+
setManagePrintServerModalOpened(false);
|
|
3913
|
+
loadPrintServer();
|
|
3914
|
+
},
|
|
3915
|
+
children: jsx(ManagePrintServer, {
|
|
3916
|
+
printServerId: currentPrintServer === null || currentPrintServer === void 0 ? void 0 : currentPrintServer.id
|
|
3917
|
+
})
|
|
3918
|
+
}), jsx(Modal, {
|
|
3919
|
+
title: 'Aggiungi Print Server Virtuale',
|
|
3920
|
+
centered: true,
|
|
3921
|
+
opened: addPrintServerModalOpened,
|
|
3922
|
+
onClose: () => setPrintServerModalOpened(false),
|
|
3923
|
+
children: jsx(AddPrintServer, {
|
|
3924
|
+
onCanceled: () => setPrintServerModalOpened(false),
|
|
3925
|
+
onSaved: () => {
|
|
3926
|
+
setPrintServerModalOpened(false);
|
|
3927
|
+
loadPrintServer();
|
|
3928
|
+
}
|
|
3929
|
+
})
|
|
3930
|
+
})]
|
|
3931
|
+
});
|
|
3932
|
+
}
|
|
3933
|
+
|
|
3934
|
+
var isPrototypeOf$1 = objectIsPrototypeOf;
|
|
3935
|
+
|
|
3936
|
+
var $TypeError$3 = TypeError;
|
|
3937
|
+
|
|
3938
|
+
var anInstance$1 = function (it, Prototype) {
|
|
3939
|
+
if (isPrototypeOf$1(Prototype, it)) return it;
|
|
3940
|
+
throw new $TypeError$3('Incorrect invocation');
|
|
3941
|
+
};
|
|
3942
|
+
|
|
3943
|
+
var DESCRIPTORS$1 = descriptors;
|
|
3944
|
+
var definePropertyModule = objectDefineProperty;
|
|
3945
|
+
var createPropertyDescriptor = createPropertyDescriptor$4;
|
|
3946
|
+
|
|
3947
|
+
var createProperty$1 = function (object, key, value) {
|
|
3948
|
+
if (DESCRIPTORS$1) definePropertyModule.f(object, key, createPropertyDescriptor(0, value));
|
|
3949
|
+
else object[key] = value;
|
|
3950
|
+
};
|
|
3951
|
+
|
|
3952
|
+
var $$1 = _export;
|
|
3953
|
+
var global$1 = global$e;
|
|
3954
|
+
var anInstance = anInstance$1;
|
|
3955
|
+
var anObject$3 = anObject$d;
|
|
3956
|
+
var isCallable = isCallable$g;
|
|
3957
|
+
var getPrototypeOf = objectGetPrototypeOf;
|
|
3958
|
+
var defineBuiltInAccessor = defineBuiltInAccessor$2;
|
|
3959
|
+
var createProperty = createProperty$1;
|
|
3960
|
+
var fails = fails$d;
|
|
3961
|
+
var hasOwn = hasOwnProperty_1;
|
|
3962
|
+
var wellKnownSymbol$2 = wellKnownSymbol$c;
|
|
3963
|
+
var IteratorPrototype = iteratorsCore.IteratorPrototype;
|
|
3964
|
+
var DESCRIPTORS = descriptors;
|
|
3965
|
+
|
|
3966
|
+
var CONSTRUCTOR = 'constructor';
|
|
3967
|
+
var ITERATOR$2 = 'Iterator';
|
|
3968
|
+
var TO_STRING_TAG = wellKnownSymbol$2('toStringTag');
|
|
3969
|
+
|
|
3970
|
+
var $TypeError$2 = TypeError;
|
|
3971
|
+
var NativeIterator = global$1[ITERATOR$2];
|
|
3972
|
+
|
|
3973
|
+
// FF56- have non-standard global helper `Iterator`
|
|
3974
|
+
var FORCED = !isCallable(NativeIterator)
|
|
3975
|
+
|| NativeIterator.prototype !== IteratorPrototype
|
|
3976
|
+
// FF44- non-standard `Iterator` passes previous tests
|
|
3977
|
+
|| !fails(function () { NativeIterator({}); });
|
|
3978
|
+
|
|
3979
|
+
var IteratorConstructor = function Iterator() {
|
|
3980
|
+
anInstance(this, IteratorPrototype);
|
|
3981
|
+
if (getPrototypeOf(this) === IteratorPrototype) throw new $TypeError$2('Abstract class Iterator not directly constructable');
|
|
3982
|
+
};
|
|
3983
|
+
|
|
3984
|
+
var defineIteratorPrototypeAccessor = function (key, value) {
|
|
3985
|
+
if (DESCRIPTORS) {
|
|
3986
|
+
defineBuiltInAccessor(IteratorPrototype, key, {
|
|
3987
|
+
configurable: true,
|
|
3988
|
+
get: function () {
|
|
3989
|
+
return value;
|
|
3990
|
+
},
|
|
3991
|
+
set: function (replacement) {
|
|
3992
|
+
anObject$3(this);
|
|
3993
|
+
if (this === IteratorPrototype) throw new $TypeError$2("You can't redefine this property");
|
|
3994
|
+
if (hasOwn(this, key)) this[key] = replacement;
|
|
3995
|
+
else createProperty(this, key, replacement);
|
|
3996
|
+
}
|
|
3997
|
+
});
|
|
3998
|
+
} else IteratorPrototype[key] = value;
|
|
3999
|
+
};
|
|
4000
|
+
|
|
4001
|
+
if (!hasOwn(IteratorPrototype, TO_STRING_TAG)) defineIteratorPrototypeAccessor(TO_STRING_TAG, ITERATOR$2);
|
|
4002
|
+
|
|
4003
|
+
if (FORCED || !hasOwn(IteratorPrototype, CONSTRUCTOR) || IteratorPrototype[CONSTRUCTOR] === Object) {
|
|
4004
|
+
defineIteratorPrototypeAccessor(CONSTRUCTOR, IteratorConstructor);
|
|
4005
|
+
}
|
|
4006
|
+
|
|
4007
|
+
IteratorConstructor.prototype = IteratorPrototype;
|
|
4008
|
+
|
|
4009
|
+
// `Iterator` constructor
|
|
4010
|
+
// https://github.com/tc39/proposal-iterator-helpers
|
|
4011
|
+
$$1({ global: true, constructor: true, forced: FORCED }, {
|
|
4012
|
+
Iterator: IteratorConstructor
|
|
4013
|
+
});
|
|
4014
|
+
|
|
4015
|
+
var classofRaw = classofRaw$2;
|
|
4016
|
+
var uncurryThis$1 = functionUncurryThis;
|
|
4017
|
+
|
|
4018
|
+
var functionUncurryThisClause = function (fn) {
|
|
4019
|
+
// Nashorn bug:
|
|
4020
|
+
// https://github.com/zloirock/core-js/issues/1128
|
|
4021
|
+
// https://github.com/zloirock/core-js/issues/1130
|
|
4022
|
+
if (classofRaw(fn) === 'Function') return uncurryThis$1(fn);
|
|
4023
|
+
};
|
|
4024
|
+
|
|
4025
|
+
var uncurryThis = functionUncurryThisClause;
|
|
4026
|
+
var aCallable$2 = aCallable$6;
|
|
4027
|
+
var NATIVE_BIND = functionBindNative;
|
|
4028
|
+
|
|
4029
|
+
var bind$1 = uncurryThis(uncurryThis.bind);
|
|
4030
|
+
|
|
4031
|
+
// optional / simple context binding
|
|
4032
|
+
var functionBindContext = function (fn, that) {
|
|
4033
|
+
aCallable$2(fn);
|
|
4034
|
+
return that === undefined ? fn : NATIVE_BIND ? bind$1(fn, that) : function (/* ...args */) {
|
|
4035
|
+
return fn.apply(that, arguments);
|
|
4036
|
+
};
|
|
4037
|
+
};
|
|
4038
|
+
|
|
4039
|
+
var wellKnownSymbol$1 = wellKnownSymbol$c;
|
|
4040
|
+
var Iterators$1 = iterators;
|
|
4041
|
+
|
|
4042
|
+
var ITERATOR$1 = wellKnownSymbol$1('iterator');
|
|
4043
|
+
var ArrayPrototype = Array.prototype;
|
|
4044
|
+
|
|
4045
|
+
// check on default Array iterator
|
|
4046
|
+
var isArrayIteratorMethod$1 = function (it) {
|
|
4047
|
+
return it !== undefined && (Iterators$1.Array === it || ArrayPrototype[ITERATOR$1] === it);
|
|
4048
|
+
};
|
|
4049
|
+
|
|
4050
|
+
var classof = classof$2;
|
|
4051
|
+
var getMethod = getMethod$4;
|
|
4052
|
+
var isNullOrUndefined = isNullOrUndefined$3;
|
|
4053
|
+
var Iterators = iterators;
|
|
4054
|
+
var wellKnownSymbol = wellKnownSymbol$c;
|
|
4055
|
+
|
|
4056
|
+
var ITERATOR = wellKnownSymbol('iterator');
|
|
4057
|
+
|
|
4058
|
+
var getIteratorMethod$2 = function (it) {
|
|
4059
|
+
if (!isNullOrUndefined(it)) return getMethod(it, ITERATOR)
|
|
4060
|
+
|| getMethod(it, '@@iterator')
|
|
4061
|
+
|| Iterators[classof(it)];
|
|
4062
|
+
};
|
|
4063
|
+
|
|
4064
|
+
var call$1 = functionCall;
|
|
4065
|
+
var aCallable$1 = aCallable$6;
|
|
4066
|
+
var anObject$2 = anObject$d;
|
|
4067
|
+
var tryToString$1 = tryToString$3;
|
|
4068
|
+
var getIteratorMethod$1 = getIteratorMethod$2;
|
|
4069
|
+
|
|
4070
|
+
var $TypeError$1 = TypeError;
|
|
4071
|
+
|
|
4072
|
+
var getIterator$1 = function (argument, usingIterator) {
|
|
4073
|
+
var iteratorMethod = arguments.length < 2 ? getIteratorMethod$1(argument) : usingIterator;
|
|
4074
|
+
if (aCallable$1(iteratorMethod)) return anObject$2(call$1(iteratorMethod, argument));
|
|
4075
|
+
throw new $TypeError$1(tryToString$1(argument) + ' is not iterable');
|
|
4076
|
+
};
|
|
4077
|
+
|
|
4078
|
+
var bind = functionBindContext;
|
|
4079
|
+
var call = functionCall;
|
|
4080
|
+
var anObject$1 = anObject$d;
|
|
4081
|
+
var tryToString = tryToString$3;
|
|
4082
|
+
var isArrayIteratorMethod = isArrayIteratorMethod$1;
|
|
4083
|
+
var lengthOfArrayLike = lengthOfArrayLike$2;
|
|
4084
|
+
var isPrototypeOf = objectIsPrototypeOf;
|
|
4085
|
+
var getIterator = getIterator$1;
|
|
4086
|
+
var getIteratorMethod = getIteratorMethod$2;
|
|
4087
|
+
var iteratorClose = iteratorClose$3;
|
|
4088
|
+
|
|
4089
|
+
var $TypeError = TypeError;
|
|
4090
|
+
|
|
4091
|
+
var Result = function (stopped, result) {
|
|
4092
|
+
this.stopped = stopped;
|
|
4093
|
+
this.result = result;
|
|
4094
|
+
};
|
|
4095
|
+
|
|
4096
|
+
var ResultPrototype = Result.prototype;
|
|
4097
|
+
|
|
4098
|
+
var iterate$1 = function (iterable, unboundFunction, options) {
|
|
4099
|
+
var that = options && options.that;
|
|
4100
|
+
var AS_ENTRIES = !!(options && options.AS_ENTRIES);
|
|
4101
|
+
var IS_RECORD = !!(options && options.IS_RECORD);
|
|
4102
|
+
var IS_ITERATOR = !!(options && options.IS_ITERATOR);
|
|
4103
|
+
var INTERRUPTED = !!(options && options.INTERRUPTED);
|
|
4104
|
+
var fn = bind(unboundFunction, that);
|
|
4105
|
+
var iterator, iterFn, index, length, result, next, step;
|
|
4106
|
+
|
|
4107
|
+
var stop = function (condition) {
|
|
4108
|
+
if (iterator) iteratorClose(iterator, 'normal', condition);
|
|
4109
|
+
return new Result(true, condition);
|
|
4110
|
+
};
|
|
4111
|
+
|
|
4112
|
+
var callFn = function (value) {
|
|
4113
|
+
if (AS_ENTRIES) {
|
|
4114
|
+
anObject$1(value);
|
|
4115
|
+
return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
|
|
4116
|
+
} return INTERRUPTED ? fn(value, stop) : fn(value);
|
|
4117
|
+
};
|
|
4118
|
+
|
|
4119
|
+
if (IS_RECORD) {
|
|
4120
|
+
iterator = iterable.iterator;
|
|
4121
|
+
} else if (IS_ITERATOR) {
|
|
4122
|
+
iterator = iterable;
|
|
4123
|
+
} else {
|
|
4124
|
+
iterFn = getIteratorMethod(iterable);
|
|
4125
|
+
if (!iterFn) throw new $TypeError(tryToString(iterable) + ' is not iterable');
|
|
4126
|
+
// optimisation for array iterators
|
|
4127
|
+
if (isArrayIteratorMethod(iterFn)) {
|
|
4128
|
+
for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
|
|
4129
|
+
result = callFn(iterable[index]);
|
|
4130
|
+
if (result && isPrototypeOf(ResultPrototype, result)) return result;
|
|
4131
|
+
} return new Result(false);
|
|
4132
|
+
}
|
|
4133
|
+
iterator = getIterator(iterable, iterFn);
|
|
4134
|
+
}
|
|
4135
|
+
|
|
4136
|
+
next = IS_RECORD ? iterable.next : iterator.next;
|
|
4137
|
+
while (!(step = call(next, iterator)).done) {
|
|
4138
|
+
try {
|
|
4139
|
+
result = callFn(step.value);
|
|
4140
|
+
} catch (error) {
|
|
4141
|
+
iteratorClose(iterator, 'throw', error);
|
|
4142
|
+
}
|
|
4143
|
+
if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;
|
|
4144
|
+
} return new Result(false);
|
|
4145
|
+
};
|
|
4146
|
+
|
|
4147
|
+
var $ = _export;
|
|
4148
|
+
var iterate = iterate$1;
|
|
4149
|
+
var aCallable = aCallable$6;
|
|
4150
|
+
var anObject = anObject$d;
|
|
4151
|
+
var getIteratorDirect = getIteratorDirect$2;
|
|
4152
|
+
|
|
4153
|
+
// `Iterator.prototype.find` method
|
|
4154
|
+
// https://github.com/tc39/proposal-iterator-helpers
|
|
4155
|
+
$({ target: 'Iterator', proto: true, real: true }, {
|
|
4156
|
+
find: function find(predicate) {
|
|
4157
|
+
anObject(this);
|
|
4158
|
+
aCallable(predicate);
|
|
4159
|
+
var record = getIteratorDirect(this);
|
|
4160
|
+
var counter = 0;
|
|
4161
|
+
return iterate(record, function (value, stop) {
|
|
4162
|
+
if (predicate(value, counter++)) return stop(value);
|
|
4163
|
+
}, { IS_RECORD: true, INTERRUPTED: true }).result;
|
|
4164
|
+
}
|
|
4165
|
+
});
|
|
4166
|
+
|
|
4167
|
+
function PrinterChooser(props) {
|
|
4168
|
+
const [printServersLoaded, setPrintServersLoaded] = useState(false);
|
|
4169
|
+
const [selectedPrintServer, setSelectedPrintServer] = useState(null);
|
|
4170
|
+
const [selectedPrinter, setSelectedPrinter] = useState(null);
|
|
4171
|
+
const [printServerSelectItems, setPrintServerSelectItems] = useState([]);
|
|
4172
|
+
const [printersSelectItems, setPrintersSelectItems] = useState([]);
|
|
4173
|
+
const [virtualPrintServers, setVirtualPrintServers] = useState([]);
|
|
4174
|
+
const [onPrinting, setOnPrinting] = useState(false);
|
|
4175
|
+
useEffect(() => {
|
|
4176
|
+
FluxoClientSys.Instance.printing.GetPrintServerList().then(printServers => {
|
|
4177
|
+
setVirtualPrintServers(printServers);
|
|
4178
|
+
const printServerSelectItems = printServers.map(printServer => {
|
|
4179
|
+
return {
|
|
4180
|
+
value: printServer.id.toString(),
|
|
4181
|
+
label: printServer.name
|
|
4182
|
+
};
|
|
4183
|
+
});
|
|
4184
|
+
setPrintServerSelectItems(printServerSelectItems);
|
|
4185
|
+
setSelectedPrintServer(printServers[0].id.toString());
|
|
4186
|
+
setPrintServersLoaded(true);
|
|
4187
|
+
});
|
|
4188
|
+
}, []);
|
|
4189
|
+
useEffect(() => {
|
|
4190
|
+
setPrintersSelectItems([]);
|
|
4191
|
+
if (!selectedPrintServer) {
|
|
4192
|
+
return;
|
|
4193
|
+
}
|
|
4194
|
+
const ps = virtualPrintServers.find(ps => ps.id.toString() === selectedPrintServer);
|
|
4195
|
+
if (!ps) return;
|
|
4196
|
+
setPrintersSelectItems(ps === null || ps === void 0 ? void 0 : ps.printers.map(printer => {
|
|
4197
|
+
return {
|
|
4198
|
+
value: printer.id.toString(),
|
|
4199
|
+
label: printer.name
|
|
4200
|
+
};
|
|
4201
|
+
}));
|
|
4202
|
+
if (ps.printers.length > 0) setSelectedPrinter(ps.printers[0].id.toString());
|
|
4203
|
+
}, [selectedPrintServer]);
|
|
4204
|
+
const print = () => {
|
|
4205
|
+
if (!selectedPrinter || !selectedPrintServer) {
|
|
4206
|
+
return;
|
|
4207
|
+
}
|
|
4208
|
+
const command = {
|
|
4209
|
+
reportUrl: props.reportUrl,
|
|
4210
|
+
virtualPrinterId: +selectedPrinter,
|
|
4211
|
+
virtualServerId: +selectedPrintServer
|
|
4212
|
+
};
|
|
4213
|
+
setOnPrinting(true);
|
|
4214
|
+
FluxoClientSys.Instance.reporting.print(command).then(() => {
|
|
4215
|
+
showNotification({
|
|
4216
|
+
title: 'Stampa avviata',
|
|
4217
|
+
message: 'La stampa è stata avviata correttamente',
|
|
4218
|
+
color: 'success'
|
|
4219
|
+
});
|
|
4220
|
+
setOnPrinting(false);
|
|
4221
|
+
props.onPrintFinished();
|
|
4222
|
+
}).catch(err => {
|
|
4223
|
+
showNotification({
|
|
4224
|
+
title: 'Errore',
|
|
4225
|
+
message: err.message,
|
|
4226
|
+
color: 'danger'
|
|
4227
|
+
});
|
|
4228
|
+
setOnPrinting(false);
|
|
4229
|
+
});
|
|
4230
|
+
};
|
|
4231
|
+
return jsx(Fragment, {
|
|
4232
|
+
children: printServersLoaded ? jsxs(Stack, {
|
|
4233
|
+
children: [jsx(Select, {
|
|
4234
|
+
disabled: onPrinting,
|
|
4235
|
+
value: selectedPrintServer,
|
|
4236
|
+
onChange: setSelectedPrintServer,
|
|
4237
|
+
data: printServerSelectItems,
|
|
4238
|
+
label: 'Server di stampa'
|
|
4239
|
+
}), jsx(Select, {
|
|
4240
|
+
disabled: onPrinting,
|
|
4241
|
+
data: printersSelectItems,
|
|
4242
|
+
value: selectedPrinter,
|
|
4243
|
+
onChange: setSelectedPrinter,
|
|
4244
|
+
label: 'Stampante'
|
|
4245
|
+
}), jsxs(Group, {
|
|
4246
|
+
justify: 'right',
|
|
4247
|
+
align: 'center',
|
|
4248
|
+
children: [jsx(Button, {
|
|
4249
|
+
variant: 'subtle',
|
|
4250
|
+
disabled: onPrinting,
|
|
4251
|
+
onClick: props.onCancel,
|
|
4252
|
+
children: "Annulla"
|
|
4253
|
+
}), jsx(Button, {
|
|
4254
|
+
disabled: onPrinting,
|
|
4255
|
+
onClick: print,
|
|
4256
|
+
leftSection: jsx(IconPrinter, {
|
|
4257
|
+
size: 18
|
|
4258
|
+
}),
|
|
4259
|
+
children: "Stampa"
|
|
4260
|
+
})]
|
|
4261
|
+
})]
|
|
4262
|
+
}) : jsx(Box, {
|
|
4263
|
+
h: 171,
|
|
4264
|
+
children: jsx(Center, {
|
|
4265
|
+
children: jsx(Loader, {})
|
|
4266
|
+
})
|
|
4267
|
+
})
|
|
4268
|
+
});
|
|
4269
|
+
}
|
|
4270
|
+
|
|
4271
|
+
export { PrintServerList, PrinterChooser };
|