@bigbinary/neeto-fields-frontend 1.3.20 → 1.3.22
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 +2 -0
- package/dist/index.cjs.js +2534 -449
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +2520 -436
- package/dist/index.js.map +1 -1
- package/package.json +85 -79
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useEffect, useRef, useState, useMemo, useLayoutEffect, useCallback, createContext, memo, useReducer, useContext } from 'react';
|
|
2
|
-
import { useFuncDebounce, useOnClickOutside, withT, useMutationWithInvalidation, useQueryParams, handleMetaClick } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
2
|
+
import { useFuncDebounce, useOnClickOutside, withT, useMutationWithInvalidation, isMetaKeyPressed, useQueryParams, handleMetaClick } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
3
3
|
import { Checkbox as Checkbox$1, TimePicker, DatePicker, Input, Select as Select$1, Textarea, Typography, Pane, Label, Button as Button$1, Tab, Alert, NoData, Table, Spinner } from '@bigbinary/neetoui';
|
|
4
|
-
import { isNotEmpty, renameKeys, capitalize, findBy, noop as noop$1, filterBy, toLabelAndValue, slugify, humanize, countBy } from '@bigbinary/neeto-cist';
|
|
4
|
+
import { isNotEmpty, renameKeys, capitalize, findBy, noop as noop$1, filterBy, toLabelAndValue, slugify, humanize, countBy, isPresent } from '@bigbinary/neeto-cist';
|
|
5
5
|
import { values, isNotNil, isNil, isEmpty, prop, pluck, clone, pipe, mergeAll, omit, map, pick, assoc, not, any, head } from 'ramda';
|
|
6
6
|
import { useFormikContext, useField, FieldArray } from 'formik';
|
|
7
7
|
import { t } from 'i18next';
|
|
@@ -15,7 +15,9 @@ import Container from '@bigbinary/neeto-molecules/Container';
|
|
|
15
15
|
import PageLoader from '@bigbinary/neeto-molecules/PageLoader';
|
|
16
16
|
import { useQuery } from 'react-query';
|
|
17
17
|
import axios from 'axios';
|
|
18
|
+
import require$$0 from 'util';
|
|
18
19
|
import { v4 } from 'uuid';
|
|
20
|
+
import { buildFiltersFromURL, Bar } from '@bigbinary/neeto-filters-frontend';
|
|
19
21
|
import { Link, useHistory } from 'react-router-dom';
|
|
20
22
|
import MenuBar from '@bigbinary/neeto-molecules/MenuBar';
|
|
21
23
|
import MoreDropdown from '@bigbinary/neeto-molecules/MoreDropdown';
|
|
@@ -40,14 +42,14 @@ function _extends() {
|
|
|
40
42
|
return _extends.apply(this, arguments);
|
|
41
43
|
}
|
|
42
44
|
|
|
43
|
-
function _typeof$1(
|
|
45
|
+
function _typeof$1(o) {
|
|
44
46
|
"@babel/helpers - typeof";
|
|
45
47
|
|
|
46
|
-
return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (
|
|
47
|
-
return typeof
|
|
48
|
-
} : function (
|
|
49
|
-
return
|
|
50
|
-
}, _typeof$1(
|
|
48
|
+
return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
49
|
+
return typeof o;
|
|
50
|
+
} : function (o) {
|
|
51
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
52
|
+
}, _typeof$1(o);
|
|
51
53
|
}
|
|
52
54
|
|
|
53
55
|
function _toPrimitive(input, hint) {
|
|
@@ -147,31 +149,31 @@ function _arrayWithHoles(arr) {
|
|
|
147
149
|
if (Array.isArray(arr)) return arr;
|
|
148
150
|
}
|
|
149
151
|
|
|
150
|
-
function _iterableToArrayLimit(
|
|
151
|
-
var
|
|
152
|
-
if (null !=
|
|
153
|
-
var
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
152
|
+
function _iterableToArrayLimit(r, l) {
|
|
153
|
+
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
154
|
+
if (null != t) {
|
|
155
|
+
var e,
|
|
156
|
+
n,
|
|
157
|
+
i,
|
|
158
|
+
u,
|
|
159
|
+
a = [],
|
|
160
|
+
f = !0,
|
|
161
|
+
o = !1;
|
|
160
162
|
try {
|
|
161
|
-
if (
|
|
162
|
-
if (Object(
|
|
163
|
-
|
|
164
|
-
} else for (; !(
|
|
165
|
-
} catch (
|
|
166
|
-
|
|
163
|
+
if (i = (t = t.call(r)).next, 0 === l) {
|
|
164
|
+
if (Object(t) !== t) return;
|
|
165
|
+
f = !1;
|
|
166
|
+
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
167
|
+
} catch (r) {
|
|
168
|
+
o = !0, n = r;
|
|
167
169
|
} finally {
|
|
168
170
|
try {
|
|
169
|
-
if (!
|
|
171
|
+
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
|
|
170
172
|
} finally {
|
|
171
|
-
if (
|
|
173
|
+
if (o) throw n;
|
|
172
174
|
}
|
|
173
175
|
}
|
|
174
|
-
return
|
|
176
|
+
return a;
|
|
175
177
|
}
|
|
176
178
|
}
|
|
177
179
|
|
|
@@ -225,14 +227,14 @@ var _typeof = {exports: {}};
|
|
|
225
227
|
_typeof.exports;
|
|
226
228
|
|
|
227
229
|
(function (module) {
|
|
228
|
-
function _typeof(
|
|
230
|
+
function _typeof(o) {
|
|
229
231
|
"@babel/helpers - typeof";
|
|
230
232
|
|
|
231
|
-
return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (
|
|
232
|
-
return typeof
|
|
233
|
-
} : function (
|
|
234
|
-
return
|
|
235
|
-
}, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(
|
|
233
|
+
return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
234
|
+
return typeof o;
|
|
235
|
+
} : function (o) {
|
|
236
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
237
|
+
}, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(o);
|
|
236
238
|
}
|
|
237
239
|
module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
238
240
|
} (_typeof));
|
|
@@ -245,304 +247,304 @@ regeneratorRuntime$1.exports;
|
|
|
245
247
|
var _typeof = _typeofExports["default"];
|
|
246
248
|
function _regeneratorRuntime() {
|
|
247
249
|
module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
|
|
248
|
-
return
|
|
250
|
+
return e;
|
|
249
251
|
}, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
250
|
-
var
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
252
|
+
var t,
|
|
253
|
+
e = {},
|
|
254
|
+
r = Object.prototype,
|
|
255
|
+
n = r.hasOwnProperty,
|
|
256
|
+
o = Object.defineProperty || function (t, e, r) {
|
|
257
|
+
t[e] = r.value;
|
|
255
258
|
},
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
function define(
|
|
261
|
-
return Object.defineProperty(
|
|
262
|
-
value:
|
|
259
|
+
i = "function" == typeof Symbol ? Symbol : {},
|
|
260
|
+
a = i.iterator || "@@iterator",
|
|
261
|
+
c = i.asyncIterator || "@@asyncIterator",
|
|
262
|
+
u = i.toStringTag || "@@toStringTag";
|
|
263
|
+
function define(t, e, r) {
|
|
264
|
+
return Object.defineProperty(t, e, {
|
|
265
|
+
value: r,
|
|
263
266
|
enumerable: !0,
|
|
264
267
|
configurable: !0,
|
|
265
268
|
writable: !0
|
|
266
|
-
}),
|
|
269
|
+
}), t[e];
|
|
267
270
|
}
|
|
268
271
|
try {
|
|
269
272
|
define({}, "");
|
|
270
|
-
} catch (
|
|
271
|
-
define = function define(
|
|
272
|
-
return
|
|
273
|
+
} catch (t) {
|
|
274
|
+
define = function define(t, e, r) {
|
|
275
|
+
return t[e] = r;
|
|
273
276
|
};
|
|
274
277
|
}
|
|
275
|
-
function wrap(
|
|
276
|
-
var
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
return
|
|
280
|
-
value: makeInvokeMethod(
|
|
281
|
-
}),
|
|
278
|
+
function wrap(t, e, r, n) {
|
|
279
|
+
var i = e && e.prototype instanceof Generator ? e : Generator,
|
|
280
|
+
a = Object.create(i.prototype),
|
|
281
|
+
c = new Context(n || []);
|
|
282
|
+
return o(a, "_invoke", {
|
|
283
|
+
value: makeInvokeMethod(t, r, c)
|
|
284
|
+
}), a;
|
|
282
285
|
}
|
|
283
|
-
function tryCatch(
|
|
286
|
+
function tryCatch(t, e, r) {
|
|
284
287
|
try {
|
|
285
288
|
return {
|
|
286
289
|
type: "normal",
|
|
287
|
-
arg:
|
|
290
|
+
arg: t.call(e, r)
|
|
288
291
|
};
|
|
289
|
-
} catch (
|
|
292
|
+
} catch (t) {
|
|
290
293
|
return {
|
|
291
294
|
type: "throw",
|
|
292
|
-
arg:
|
|
295
|
+
arg: t
|
|
293
296
|
};
|
|
294
297
|
}
|
|
295
298
|
}
|
|
296
|
-
|
|
297
|
-
var
|
|
299
|
+
e.wrap = wrap;
|
|
300
|
+
var h = "suspendedStart",
|
|
301
|
+
l = "suspendedYield",
|
|
302
|
+
f = "executing",
|
|
303
|
+
s = "completed",
|
|
304
|
+
y = {};
|
|
298
305
|
function Generator() {}
|
|
299
306
|
function GeneratorFunction() {}
|
|
300
307
|
function GeneratorFunctionPrototype() {}
|
|
301
|
-
var
|
|
302
|
-
define(
|
|
308
|
+
var p = {};
|
|
309
|
+
define(p, a, function () {
|
|
303
310
|
return this;
|
|
304
311
|
});
|
|
305
|
-
var
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
var
|
|
309
|
-
function defineIteratorMethods(
|
|
310
|
-
["next", "throw", "return"].forEach(function (
|
|
311
|
-
define(
|
|
312
|
-
return this._invoke(
|
|
312
|
+
var d = Object.getPrototypeOf,
|
|
313
|
+
v = d && d(d(values([])));
|
|
314
|
+
v && v !== r && n.call(v, a) && (p = v);
|
|
315
|
+
var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
|
|
316
|
+
function defineIteratorMethods(t) {
|
|
317
|
+
["next", "throw", "return"].forEach(function (e) {
|
|
318
|
+
define(t, e, function (t) {
|
|
319
|
+
return this._invoke(e, t);
|
|
313
320
|
});
|
|
314
321
|
});
|
|
315
322
|
}
|
|
316
|
-
function AsyncIterator(
|
|
317
|
-
function invoke(
|
|
318
|
-
var
|
|
319
|
-
if ("throw" !==
|
|
320
|
-
var
|
|
321
|
-
|
|
322
|
-
return
|
|
323
|
-
invoke("next",
|
|
324
|
-
}, function (
|
|
325
|
-
invoke("throw",
|
|
326
|
-
}) :
|
|
327
|
-
|
|
328
|
-
}, function (
|
|
329
|
-
return invoke("throw",
|
|
323
|
+
function AsyncIterator(t, e) {
|
|
324
|
+
function invoke(r, o, i, a) {
|
|
325
|
+
var c = tryCatch(t[r], t, o);
|
|
326
|
+
if ("throw" !== c.type) {
|
|
327
|
+
var u = c.arg,
|
|
328
|
+
h = u.value;
|
|
329
|
+
return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
|
|
330
|
+
invoke("next", t, i, a);
|
|
331
|
+
}, function (t) {
|
|
332
|
+
invoke("throw", t, i, a);
|
|
333
|
+
}) : e.resolve(h).then(function (t) {
|
|
334
|
+
u.value = t, i(u);
|
|
335
|
+
}, function (t) {
|
|
336
|
+
return invoke("throw", t, i, a);
|
|
330
337
|
});
|
|
331
338
|
}
|
|
332
|
-
|
|
339
|
+
a(c.arg);
|
|
333
340
|
}
|
|
334
|
-
var
|
|
335
|
-
|
|
336
|
-
value: function value(
|
|
341
|
+
var r;
|
|
342
|
+
o(this, "_invoke", {
|
|
343
|
+
value: function value(t, n) {
|
|
337
344
|
function callInvokeWithMethodAndArg() {
|
|
338
|
-
return new
|
|
339
|
-
invoke(
|
|
345
|
+
return new e(function (e, r) {
|
|
346
|
+
invoke(t, n, e, r);
|
|
340
347
|
});
|
|
341
348
|
}
|
|
342
|
-
return
|
|
349
|
+
return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
343
350
|
}
|
|
344
351
|
});
|
|
345
352
|
}
|
|
346
|
-
function makeInvokeMethod(
|
|
347
|
-
var
|
|
348
|
-
return function (
|
|
349
|
-
if (
|
|
350
|
-
if (
|
|
351
|
-
if ("throw" ===
|
|
352
|
-
return
|
|
353
|
+
function makeInvokeMethod(e, r, n) {
|
|
354
|
+
var o = h;
|
|
355
|
+
return function (i, a) {
|
|
356
|
+
if (o === f) throw new Error("Generator is already running");
|
|
357
|
+
if (o === s) {
|
|
358
|
+
if ("throw" === i) throw a;
|
|
359
|
+
return {
|
|
360
|
+
value: t,
|
|
361
|
+
done: !0
|
|
362
|
+
};
|
|
353
363
|
}
|
|
354
|
-
for (
|
|
355
|
-
var
|
|
356
|
-
if (
|
|
357
|
-
var
|
|
358
|
-
if (
|
|
359
|
-
if (
|
|
360
|
-
return
|
|
364
|
+
for (n.method = i, n.arg = a;;) {
|
|
365
|
+
var c = n.delegate;
|
|
366
|
+
if (c) {
|
|
367
|
+
var u = maybeInvokeDelegate(c, n);
|
|
368
|
+
if (u) {
|
|
369
|
+
if (u === y) continue;
|
|
370
|
+
return u;
|
|
361
371
|
}
|
|
362
372
|
}
|
|
363
|
-
if ("next" ===
|
|
364
|
-
if (
|
|
365
|
-
|
|
366
|
-
} else "return" ===
|
|
367
|
-
|
|
368
|
-
var
|
|
369
|
-
if ("normal" ===
|
|
370
|
-
if (
|
|
373
|
+
if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
|
|
374
|
+
if (o === h) throw o = s, n.arg;
|
|
375
|
+
n.dispatchException(n.arg);
|
|
376
|
+
} else "return" === n.method && n.abrupt("return", n.arg);
|
|
377
|
+
o = f;
|
|
378
|
+
var p = tryCatch(e, r, n);
|
|
379
|
+
if ("normal" === p.type) {
|
|
380
|
+
if (o = n.done ? s : l, p.arg === y) continue;
|
|
371
381
|
return {
|
|
372
|
-
value:
|
|
373
|
-
done:
|
|
382
|
+
value: p.arg,
|
|
383
|
+
done: n.done
|
|
374
384
|
};
|
|
375
385
|
}
|
|
376
|
-
"throw" ===
|
|
386
|
+
"throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
|
|
377
387
|
}
|
|
378
388
|
};
|
|
379
389
|
}
|
|
380
|
-
function maybeInvokeDelegate(
|
|
381
|
-
var
|
|
382
|
-
|
|
383
|
-
if (
|
|
384
|
-
var
|
|
385
|
-
if ("throw" ===
|
|
386
|
-
var
|
|
387
|
-
return
|
|
390
|
+
function maybeInvokeDelegate(e, r) {
|
|
391
|
+
var n = r.method,
|
|
392
|
+
o = e.iterator[n];
|
|
393
|
+
if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
|
|
394
|
+
var i = tryCatch(o, e.iterator, r.arg);
|
|
395
|
+
if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
|
|
396
|
+
var a = i.arg;
|
|
397
|
+
return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
|
|
388
398
|
}
|
|
389
|
-
function pushTryEntry(
|
|
390
|
-
var
|
|
391
|
-
tryLoc:
|
|
399
|
+
function pushTryEntry(t) {
|
|
400
|
+
var e = {
|
|
401
|
+
tryLoc: t[0]
|
|
392
402
|
};
|
|
393
|
-
1 in
|
|
403
|
+
1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
|
|
394
404
|
}
|
|
395
|
-
function resetTryEntry(
|
|
396
|
-
var
|
|
397
|
-
|
|
405
|
+
function resetTryEntry(t) {
|
|
406
|
+
var e = t.completion || {};
|
|
407
|
+
e.type = "normal", delete e.arg, t.completion = e;
|
|
398
408
|
}
|
|
399
|
-
function Context(
|
|
409
|
+
function Context(t) {
|
|
400
410
|
this.tryEntries = [{
|
|
401
411
|
tryLoc: "root"
|
|
402
|
-
}],
|
|
412
|
+
}], t.forEach(pushTryEntry, this), this.reset(!0);
|
|
403
413
|
}
|
|
404
|
-
function values(
|
|
405
|
-
if (
|
|
406
|
-
var
|
|
407
|
-
if (
|
|
408
|
-
if ("function" == typeof
|
|
409
|
-
if (!isNaN(
|
|
410
|
-
var
|
|
411
|
-
|
|
412
|
-
for (; ++
|
|
413
|
-
return next.value =
|
|
414
|
+
function values(e) {
|
|
415
|
+
if (e || "" === e) {
|
|
416
|
+
var r = e[a];
|
|
417
|
+
if (r) return r.call(e);
|
|
418
|
+
if ("function" == typeof e.next) return e;
|
|
419
|
+
if (!isNaN(e.length)) {
|
|
420
|
+
var o = -1,
|
|
421
|
+
i = function next() {
|
|
422
|
+
for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
|
|
423
|
+
return next.value = t, next.done = !0, next;
|
|
414
424
|
};
|
|
415
|
-
return
|
|
425
|
+
return i.next = i;
|
|
416
426
|
}
|
|
417
427
|
}
|
|
418
|
-
|
|
419
|
-
next: doneResult
|
|
420
|
-
};
|
|
421
|
-
}
|
|
422
|
-
function doneResult() {
|
|
423
|
-
return {
|
|
424
|
-
value: undefined,
|
|
425
|
-
done: !0
|
|
426
|
-
};
|
|
428
|
+
throw new TypeError(_typeof(e) + " is not iterable");
|
|
427
429
|
}
|
|
428
|
-
return GeneratorFunction.prototype = GeneratorFunctionPrototype,
|
|
430
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
|
|
429
431
|
value: GeneratorFunctionPrototype,
|
|
430
432
|
configurable: !0
|
|
431
|
-
}),
|
|
433
|
+
}), o(GeneratorFunctionPrototype, "constructor", {
|
|
432
434
|
value: GeneratorFunction,
|
|
433
435
|
configurable: !0
|
|
434
|
-
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype,
|
|
435
|
-
var
|
|
436
|
-
return !!
|
|
437
|
-
},
|
|
438
|
-
return Object.setPrototypeOf ? Object.setPrototypeOf(
|
|
439
|
-
},
|
|
436
|
+
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
|
|
437
|
+
var e = "function" == typeof t && t.constructor;
|
|
438
|
+
return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
|
|
439
|
+
}, e.mark = function (t) {
|
|
440
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
|
|
441
|
+
}, e.awrap = function (t) {
|
|
440
442
|
return {
|
|
441
|
-
__await:
|
|
443
|
+
__await: t
|
|
442
444
|
};
|
|
443
|
-
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype,
|
|
445
|
+
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
|
|
444
446
|
return this;
|
|
445
|
-
}),
|
|
446
|
-
void 0 ===
|
|
447
|
-
var
|
|
448
|
-
return
|
|
449
|
-
return
|
|
447
|
+
}), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
|
|
448
|
+
void 0 === i && (i = Promise);
|
|
449
|
+
var a = new AsyncIterator(wrap(t, r, n, o), i);
|
|
450
|
+
return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
|
|
451
|
+
return t.done ? t.value : a.next();
|
|
450
452
|
});
|
|
451
|
-
}, defineIteratorMethods(
|
|
453
|
+
}, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
|
|
452
454
|
return this;
|
|
453
|
-
}), define(
|
|
455
|
+
}), define(g, "toString", function () {
|
|
454
456
|
return "[object Generator]";
|
|
455
|
-
}),
|
|
456
|
-
var
|
|
457
|
-
|
|
458
|
-
for (var
|
|
459
|
-
return
|
|
460
|
-
for (;
|
|
461
|
-
var
|
|
462
|
-
if (
|
|
457
|
+
}), e.keys = function (t) {
|
|
458
|
+
var e = Object(t),
|
|
459
|
+
r = [];
|
|
460
|
+
for (var n in e) r.push(n);
|
|
461
|
+
return r.reverse(), function next() {
|
|
462
|
+
for (; r.length;) {
|
|
463
|
+
var t = r.pop();
|
|
464
|
+
if (t in e) return next.value = t, next.done = !1, next;
|
|
463
465
|
}
|
|
464
466
|
return next.done = !0, next;
|
|
465
467
|
};
|
|
466
|
-
},
|
|
468
|
+
}, e.values = values, Context.prototype = {
|
|
467
469
|
constructor: Context,
|
|
468
|
-
reset: function reset(
|
|
469
|
-
if (this.prev = 0, this.next = 0, this.sent = this._sent =
|
|
470
|
+
reset: function reset(e) {
|
|
471
|
+
if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
|
|
470
472
|
},
|
|
471
473
|
stop: function stop() {
|
|
472
474
|
this.done = !0;
|
|
473
|
-
var
|
|
474
|
-
if ("throw" ===
|
|
475
|
+
var t = this.tryEntries[0].completion;
|
|
476
|
+
if ("throw" === t.type) throw t.arg;
|
|
475
477
|
return this.rval;
|
|
476
478
|
},
|
|
477
|
-
dispatchException: function dispatchException(
|
|
478
|
-
if (this.done) throw
|
|
479
|
-
var
|
|
480
|
-
function handle(
|
|
481
|
-
return
|
|
479
|
+
dispatchException: function dispatchException(e) {
|
|
480
|
+
if (this.done) throw e;
|
|
481
|
+
var r = this;
|
|
482
|
+
function handle(n, o) {
|
|
483
|
+
return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
|
|
482
484
|
}
|
|
483
|
-
for (var
|
|
484
|
-
var
|
|
485
|
-
|
|
486
|
-
if ("root" ===
|
|
487
|
-
if (
|
|
488
|
-
var
|
|
489
|
-
|
|
490
|
-
if (
|
|
491
|
-
if (this.prev <
|
|
492
|
-
if (this.prev <
|
|
493
|
-
} else if (
|
|
494
|
-
if (this.prev <
|
|
485
|
+
for (var o = this.tryEntries.length - 1; o >= 0; --o) {
|
|
486
|
+
var i = this.tryEntries[o],
|
|
487
|
+
a = i.completion;
|
|
488
|
+
if ("root" === i.tryLoc) return handle("end");
|
|
489
|
+
if (i.tryLoc <= this.prev) {
|
|
490
|
+
var c = n.call(i, "catchLoc"),
|
|
491
|
+
u = n.call(i, "finallyLoc");
|
|
492
|
+
if (c && u) {
|
|
493
|
+
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
494
|
+
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
495
|
+
} else if (c) {
|
|
496
|
+
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
495
497
|
} else {
|
|
496
|
-
if (!
|
|
497
|
-
if (this.prev <
|
|
498
|
+
if (!u) throw new Error("try statement without catch or finally");
|
|
499
|
+
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
498
500
|
}
|
|
499
501
|
}
|
|
500
502
|
}
|
|
501
503
|
},
|
|
502
|
-
abrupt: function abrupt(
|
|
503
|
-
for (var
|
|
504
|
-
var
|
|
505
|
-
if (
|
|
506
|
-
var
|
|
504
|
+
abrupt: function abrupt(t, e) {
|
|
505
|
+
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
|
|
506
|
+
var o = this.tryEntries[r];
|
|
507
|
+
if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
|
|
508
|
+
var i = o;
|
|
507
509
|
break;
|
|
508
510
|
}
|
|
509
511
|
}
|
|
510
|
-
|
|
511
|
-
var
|
|
512
|
-
return
|
|
512
|
+
i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
|
|
513
|
+
var a = i ? i.completion : {};
|
|
514
|
+
return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
|
|
513
515
|
},
|
|
514
|
-
complete: function complete(
|
|
515
|
-
if ("throw" ===
|
|
516
|
-
return "break" ===
|
|
516
|
+
complete: function complete(t, e) {
|
|
517
|
+
if ("throw" === t.type) throw t.arg;
|
|
518
|
+
return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
|
|
517
519
|
},
|
|
518
|
-
finish: function finish(
|
|
519
|
-
for (var
|
|
520
|
-
var
|
|
521
|
-
if (
|
|
520
|
+
finish: function finish(t) {
|
|
521
|
+
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
522
|
+
var r = this.tryEntries[e];
|
|
523
|
+
if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
|
|
522
524
|
}
|
|
523
525
|
},
|
|
524
|
-
"catch": function _catch(
|
|
525
|
-
for (var
|
|
526
|
-
var
|
|
527
|
-
if (
|
|
528
|
-
var
|
|
529
|
-
if ("throw" ===
|
|
530
|
-
var
|
|
531
|
-
resetTryEntry(
|
|
526
|
+
"catch": function _catch(t) {
|
|
527
|
+
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
528
|
+
var r = this.tryEntries[e];
|
|
529
|
+
if (r.tryLoc === t) {
|
|
530
|
+
var n = r.completion;
|
|
531
|
+
if ("throw" === n.type) {
|
|
532
|
+
var o = n.arg;
|
|
533
|
+
resetTryEntry(r);
|
|
532
534
|
}
|
|
533
|
-
return
|
|
535
|
+
return o;
|
|
534
536
|
}
|
|
535
537
|
}
|
|
536
538
|
throw new Error("illegal catch attempt");
|
|
537
539
|
},
|
|
538
|
-
delegateYield: function delegateYield(
|
|
540
|
+
delegateYield: function delegateYield(e, r, n) {
|
|
539
541
|
return this.delegate = {
|
|
540
|
-
iterator: values(
|
|
541
|
-
resultName:
|
|
542
|
-
nextLoc:
|
|
543
|
-
}, "next" === this.method && (this.arg =
|
|
542
|
+
iterator: values(e),
|
|
543
|
+
resultName: r,
|
|
544
|
+
nextLoc: n
|
|
545
|
+
}, "next" === this.method && (this.arg = t), y;
|
|
544
546
|
}
|
|
545
|
-
},
|
|
547
|
+
}, e;
|
|
546
548
|
}
|
|
547
549
|
module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
548
550
|
} (regeneratorRuntime$1));
|
|
@@ -788,8 +790,8 @@ var getValueFromBool = function getValueFromBool(value) {
|
|
|
788
790
|
};
|
|
789
791
|
|
|
790
792
|
var _excluded$6 = ["name", "id", "kind", "data", "individualSubmit", "formRef", "formRefs", "disabled", "isRequiredColumnName", "isInline", "onBlur"];
|
|
791
|
-
function ownKeys$g(
|
|
792
|
-
function _objectSpread$g(
|
|
793
|
+
function ownKeys$g(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
794
|
+
function _objectSpread$g(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$g(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$g(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
793
795
|
var useFormikFields = function useFormikFields(_ref) {
|
|
794
796
|
var name = _ref.name,
|
|
795
797
|
fieldId = _ref.id,
|
|
@@ -1095,151 +1097,2199 @@ var TextArea = function TextArea(props) {
|
|
|
1095
1097
|
}));
|
|
1096
1098
|
};
|
|
1097
1099
|
|
|
1098
|
-
function ownKeys$f(
|
|
1099
|
-
function _objectSpread$f(
|
|
1100
|
-
var standardComponents = {
|
|
1101
|
-
text: Text,
|
|
1102
|
-
regex: Text,
|
|
1103
|
-
textarea: TextArea,
|
|
1104
|
-
text_area: TextArea,
|
|
1105
|
-
// TODO: Remove text-area after integration in all hosts.
|
|
1106
|
-
number: Number$1,
|
|
1107
|
-
monetary: Number$1,
|
|
1108
|
-
integer: Number$1,
|
|
1109
|
-
decimal: Number$1,
|
|
1110
|
-
date: DateOrTime,
|
|
1111
|
-
time: DateOrTime,
|
|
1112
|
-
datetime: DateOrTime,
|
|
1113
|
-
single_option: SingleOption,
|
|
1114
|
-
multi_option: MultiOption,
|
|
1115
|
-
date_range: RangePicker,
|
|
1116
|
-
time_range: RangePicker,
|
|
1117
|
-
checkbox: Checkbox
|
|
1118
|
-
};
|
|
1119
|
-
var getFieldInput = function getFieldInput(_ref) {
|
|
1120
|
-
var field = _ref.field,
|
|
1121
|
-
_ref$customComponents = _ref.customComponents,
|
|
1122
|
-
customComponents = _ref$customComponents === void 0 ? {} : _ref$customComponents;
|
|
1123
|
-
var Component = customComponents[field.kind] || standardComponents[field.kind];
|
|
1124
|
-
if (Component) {
|
|
1125
|
-
return Component;
|
|
1126
|
-
}
|
|
1127
|
-
return null;
|
|
1128
|
-
};
|
|
1129
|
-
var removeItemsWithNullData = function removeItemsWithNullData(fieldValues) {
|
|
1130
|
-
return fieldValues.filter(function (item) {
|
|
1131
|
-
return !isNil(prop("data", item));
|
|
1132
|
-
});
|
|
1133
|
-
};
|
|
1134
|
-
var removeNoiseFromValues = function removeNoiseFromValues(fieldValues) {
|
|
1135
|
-
return map(pick(["id", "fieldId", "data"]), fieldValues);
|
|
1100
|
+
function ownKeys$f(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1101
|
+
function _objectSpread$f(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$f(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$f(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1102
|
+
var standardComponents = {
|
|
1103
|
+
text: Text,
|
|
1104
|
+
regex: Text,
|
|
1105
|
+
textarea: TextArea,
|
|
1106
|
+
text_area: TextArea,
|
|
1107
|
+
// TODO: Remove text-area after integration in all hosts.
|
|
1108
|
+
number: Number$1,
|
|
1109
|
+
monetary: Number$1,
|
|
1110
|
+
integer: Number$1,
|
|
1111
|
+
decimal: Number$1,
|
|
1112
|
+
date: DateOrTime,
|
|
1113
|
+
time: DateOrTime,
|
|
1114
|
+
datetime: DateOrTime,
|
|
1115
|
+
single_option: SingleOption,
|
|
1116
|
+
multi_option: MultiOption,
|
|
1117
|
+
date_range: RangePicker,
|
|
1118
|
+
time_range: RangePicker,
|
|
1119
|
+
checkbox: Checkbox
|
|
1120
|
+
};
|
|
1121
|
+
var getFieldInput = function getFieldInput(_ref) {
|
|
1122
|
+
var field = _ref.field,
|
|
1123
|
+
_ref$customComponents = _ref.customComponents,
|
|
1124
|
+
customComponents = _ref$customComponents === void 0 ? {} : _ref$customComponents;
|
|
1125
|
+
var Component = customComponents[field.kind] || standardComponents[field.kind];
|
|
1126
|
+
if (Component) {
|
|
1127
|
+
return Component;
|
|
1128
|
+
}
|
|
1129
|
+
return null;
|
|
1130
|
+
};
|
|
1131
|
+
var removeItemsWithNullData = function removeItemsWithNullData(fieldValues) {
|
|
1132
|
+
return fieldValues.filter(function (item) {
|
|
1133
|
+
return !isNil(prop("data", item));
|
|
1134
|
+
});
|
|
1135
|
+
};
|
|
1136
|
+
var removeNoiseFromValues = function removeNoiseFromValues(fieldValues) {
|
|
1137
|
+
return map(pick(["id", "fieldId", "data"]), fieldValues);
|
|
1138
|
+
};
|
|
1139
|
+
var transformValues = function transformValues(_ref2) {
|
|
1140
|
+
var formikValues = _ref2.values,
|
|
1141
|
+
fields = _ref2.fields;
|
|
1142
|
+
var allFieldValues = clone(formikValues);
|
|
1143
|
+
var neetoFieldValues = [];
|
|
1144
|
+
fields.forEach(function (_ref3) {
|
|
1145
|
+
var id = _ref3.id,
|
|
1146
|
+
name = _ref3.name;
|
|
1147
|
+
var fieldPath = escapeString("".concat(name, "-").concat(id));
|
|
1148
|
+
neetoFieldValues.push(allFieldValues[fieldPath]);
|
|
1149
|
+
delete allFieldValues[fieldPath];
|
|
1150
|
+
});
|
|
1151
|
+
var cleanedFieldValues = pipe(removeItemsWithNullData, removeNoiseFromValues)(neetoFieldValues);
|
|
1152
|
+
return _objectSpread$f(_objectSpread$f({}, allFieldValues), {}, {
|
|
1153
|
+
fieldValuesAttributes: cleanedFieldValues
|
|
1154
|
+
});
|
|
1155
|
+
};
|
|
1156
|
+
var getDefaultInitialValue = function getDefaultInitialValue(kind) {
|
|
1157
|
+
switch (kind) {
|
|
1158
|
+
case KINDS.checkbox:
|
|
1159
|
+
return false;
|
|
1160
|
+
case KINDS.multiOption:
|
|
1161
|
+
case KINDS.dateRange:
|
|
1162
|
+
case KINDS.timeRange:
|
|
1163
|
+
return [];
|
|
1164
|
+
default:
|
|
1165
|
+
return "";
|
|
1166
|
+
}
|
|
1167
|
+
};
|
|
1168
|
+
var getInitialFieldValue = function getInitialFieldValue(_ref4) {
|
|
1169
|
+
var field = _ref4.field,
|
|
1170
|
+
_ref4$fieldValues = _ref4.fieldValues,
|
|
1171
|
+
fieldValues = _ref4$fieldValues === void 0 ? [] : _ref4$fieldValues,
|
|
1172
|
+
_ref4$isIndividualFie = _ref4.isIndividualFieldForm,
|
|
1173
|
+
isIndividualFieldForm = _ref4$isIndividualFie === void 0 ? false : _ref4$isIndividualFie;
|
|
1174
|
+
var existingFieldValueData = findBy({
|
|
1175
|
+
fieldId: field.id
|
|
1176
|
+
}, fieldValues);
|
|
1177
|
+
var keyInData = field.kind === KINDS.multiOption ? "values" : "value";
|
|
1178
|
+
var newFieldValueData = {
|
|
1179
|
+
fieldId: field.id,
|
|
1180
|
+
data: isIndividualFieldForm ? _defineProperty({}, keyInData, getDefaultInitialValue(field.kind)) : null
|
|
1181
|
+
};
|
|
1182
|
+
return _defineProperty({}, escapeString("".concat(field.name, "-").concat(field.id)), existingFieldValueData || newFieldValueData);
|
|
1183
|
+
};
|
|
1184
|
+
var getAllInitialFieldValues = function getAllInitialFieldValues(fields) {
|
|
1185
|
+
var fieldValues = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
1186
|
+
return getNonSystemFields(fields).map(function (field) {
|
|
1187
|
+
return getInitialFieldValue({
|
|
1188
|
+
field: field,
|
|
1189
|
+
fieldValues: fieldValues
|
|
1190
|
+
});
|
|
1191
|
+
});
|
|
1192
|
+
};
|
|
1193
|
+
var mergeInitialValues = function mergeInitialValues(_ref7) {
|
|
1194
|
+
var initialValues = _ref7.initialValues,
|
|
1195
|
+
fields = _ref7.fields;
|
|
1196
|
+
var initialValue = mergeAll([initialValues].concat(_toConsumableArray(getAllInitialFieldValues(fields, initialValues === null || initialValues === void 0 ? void 0 : initialValues.fieldValues))));
|
|
1197
|
+
return omit(["fieldValues"], initialValue);
|
|
1198
|
+
};
|
|
1199
|
+
var getNonSystemFields = function getNonSystemFields(fields) {
|
|
1200
|
+
return filterBy({
|
|
1201
|
+
isSystem: false
|
|
1202
|
+
}, fields);
|
|
1203
|
+
};
|
|
1204
|
+
var escapeString = function escapeString(string) {
|
|
1205
|
+
return string.replace(/[^a-zA-Z0-9_]/g, function (match) {
|
|
1206
|
+
var charCode = match.charCodeAt(0);
|
|
1207
|
+
return "_".concat(charCode, "_");
|
|
1208
|
+
});
|
|
1209
|
+
};
|
|
1210
|
+
var neetoFieldsUtils = {
|
|
1211
|
+
mergeInitialValues: mergeInitialValues,
|
|
1212
|
+
transformValues: transformValues
|
|
1213
|
+
};
|
|
1214
|
+
|
|
1215
|
+
function ownKeys$e(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1216
|
+
function _objectSpread$e(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$e(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$e(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1217
|
+
var FieldInputs = withT(function (_ref) {
|
|
1218
|
+
var t = _ref.t,
|
|
1219
|
+
_ref$customComponents = _ref.customComponents,
|
|
1220
|
+
customComponents = _ref$customComponents === void 0 ? {} : _ref$customComponents,
|
|
1221
|
+
fields = _ref.fields,
|
|
1222
|
+
formRef = _ref.formRef,
|
|
1223
|
+
disabled = _ref.disabled,
|
|
1224
|
+
isRequiredColumnName = _ref.isRequiredColumnName;
|
|
1225
|
+
return getNonSystemFields(fields).map(function (field) {
|
|
1226
|
+
var Field = getFieldInput({
|
|
1227
|
+
field: field,
|
|
1228
|
+
customComponents: customComponents
|
|
1229
|
+
});
|
|
1230
|
+
if (Field) {
|
|
1231
|
+
return /*#__PURE__*/React.createElement(Field, _extends({
|
|
1232
|
+
key: field.id
|
|
1233
|
+
}, _objectSpread$e(_objectSpread$e({}, field), {}, {
|
|
1234
|
+
disabled: disabled,
|
|
1235
|
+
formRef: formRef,
|
|
1236
|
+
isRequiredColumnName: isRequiredColumnName
|
|
1237
|
+
})));
|
|
1238
|
+
}
|
|
1239
|
+
return /*#__PURE__*/React.createElement(Typography, {
|
|
1240
|
+
key: field.id,
|
|
1241
|
+
style: "body2"
|
|
1242
|
+
}, t("neetoFields.messages.invalidKind"));
|
|
1243
|
+
});
|
|
1244
|
+
});
|
|
1245
|
+
|
|
1246
|
+
/* eslint complexity: [2, 18], max-statements: [2, 33] */
|
|
1247
|
+
var shams = function hasSymbols() {
|
|
1248
|
+
if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
|
|
1249
|
+
if (typeof Symbol.iterator === 'symbol') { return true; }
|
|
1250
|
+
|
|
1251
|
+
var obj = {};
|
|
1252
|
+
var sym = Symbol('test');
|
|
1253
|
+
var symObj = Object(sym);
|
|
1254
|
+
if (typeof sym === 'string') { return false; }
|
|
1255
|
+
|
|
1256
|
+
if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
|
|
1257
|
+
if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
|
|
1258
|
+
|
|
1259
|
+
// temp disabled per https://github.com/ljharb/object.assign/issues/17
|
|
1260
|
+
// if (sym instanceof Symbol) { return false; }
|
|
1261
|
+
// temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
|
|
1262
|
+
// if (!(symObj instanceof Symbol)) { return false; }
|
|
1263
|
+
|
|
1264
|
+
// if (typeof Symbol.prototype.toString !== 'function') { return false; }
|
|
1265
|
+
// if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
|
|
1266
|
+
|
|
1267
|
+
var symVal = 42;
|
|
1268
|
+
obj[sym] = symVal;
|
|
1269
|
+
for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop
|
|
1270
|
+
if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
|
|
1271
|
+
|
|
1272
|
+
if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
|
|
1273
|
+
|
|
1274
|
+
var syms = Object.getOwnPropertySymbols(obj);
|
|
1275
|
+
if (syms.length !== 1 || syms[0] !== sym) { return false; }
|
|
1276
|
+
|
|
1277
|
+
if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
|
|
1278
|
+
|
|
1279
|
+
if (typeof Object.getOwnPropertyDescriptor === 'function') {
|
|
1280
|
+
var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
|
|
1281
|
+
if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
|
|
1282
|
+
}
|
|
1283
|
+
|
|
1284
|
+
return true;
|
|
1285
|
+
};
|
|
1286
|
+
|
|
1287
|
+
var origSymbol = typeof Symbol !== 'undefined' && Symbol;
|
|
1288
|
+
var hasSymbolSham = shams;
|
|
1289
|
+
|
|
1290
|
+
var hasSymbols$1 = function hasNativeSymbols() {
|
|
1291
|
+
if (typeof origSymbol !== 'function') { return false; }
|
|
1292
|
+
if (typeof Symbol !== 'function') { return false; }
|
|
1293
|
+
if (typeof origSymbol('foo') !== 'symbol') { return false; }
|
|
1294
|
+
if (typeof Symbol('bar') !== 'symbol') { return false; }
|
|
1295
|
+
|
|
1296
|
+
return hasSymbolSham();
|
|
1297
|
+
};
|
|
1298
|
+
|
|
1299
|
+
var test = {
|
|
1300
|
+
foo: {}
|
|
1301
|
+
};
|
|
1302
|
+
|
|
1303
|
+
var $Object = Object;
|
|
1304
|
+
|
|
1305
|
+
var hasProto$1 = function hasProto() {
|
|
1306
|
+
return { __proto__: test }.foo === test.foo && !({ __proto__: null } instanceof $Object);
|
|
1307
|
+
};
|
|
1308
|
+
|
|
1309
|
+
/* eslint no-invalid-this: 1 */
|
|
1310
|
+
|
|
1311
|
+
var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
|
|
1312
|
+
var slice = Array.prototype.slice;
|
|
1313
|
+
var toStr$1 = Object.prototype.toString;
|
|
1314
|
+
var funcType = '[object Function]';
|
|
1315
|
+
|
|
1316
|
+
var implementation$1 = function bind(that) {
|
|
1317
|
+
var target = this;
|
|
1318
|
+
if (typeof target !== 'function' || toStr$1.call(target) !== funcType) {
|
|
1319
|
+
throw new TypeError(ERROR_MESSAGE + target);
|
|
1320
|
+
}
|
|
1321
|
+
var args = slice.call(arguments, 1);
|
|
1322
|
+
|
|
1323
|
+
var bound;
|
|
1324
|
+
var binder = function () {
|
|
1325
|
+
if (this instanceof bound) {
|
|
1326
|
+
var result = target.apply(
|
|
1327
|
+
this,
|
|
1328
|
+
args.concat(slice.call(arguments))
|
|
1329
|
+
);
|
|
1330
|
+
if (Object(result) === result) {
|
|
1331
|
+
return result;
|
|
1332
|
+
}
|
|
1333
|
+
return this;
|
|
1334
|
+
} else {
|
|
1335
|
+
return target.apply(
|
|
1336
|
+
that,
|
|
1337
|
+
args.concat(slice.call(arguments))
|
|
1338
|
+
);
|
|
1339
|
+
}
|
|
1340
|
+
};
|
|
1341
|
+
|
|
1342
|
+
var boundLength = Math.max(0, target.length - args.length);
|
|
1343
|
+
var boundArgs = [];
|
|
1344
|
+
for (var i = 0; i < boundLength; i++) {
|
|
1345
|
+
boundArgs.push('$' + i);
|
|
1346
|
+
}
|
|
1347
|
+
|
|
1348
|
+
bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);
|
|
1349
|
+
|
|
1350
|
+
if (target.prototype) {
|
|
1351
|
+
var Empty = function Empty() {};
|
|
1352
|
+
Empty.prototype = target.prototype;
|
|
1353
|
+
bound.prototype = new Empty();
|
|
1354
|
+
Empty.prototype = null;
|
|
1355
|
+
}
|
|
1356
|
+
|
|
1357
|
+
return bound;
|
|
1358
|
+
};
|
|
1359
|
+
|
|
1360
|
+
var implementation = implementation$1;
|
|
1361
|
+
|
|
1362
|
+
var functionBind = Function.prototype.bind || implementation;
|
|
1363
|
+
|
|
1364
|
+
var bind$1 = functionBind;
|
|
1365
|
+
|
|
1366
|
+
var src = bind$1.call(Function.call, Object.prototype.hasOwnProperty);
|
|
1367
|
+
|
|
1368
|
+
var undefined$1;
|
|
1369
|
+
|
|
1370
|
+
var $SyntaxError = SyntaxError;
|
|
1371
|
+
var $Function = Function;
|
|
1372
|
+
var $TypeError$1 = TypeError;
|
|
1373
|
+
|
|
1374
|
+
// eslint-disable-next-line consistent-return
|
|
1375
|
+
var getEvalledConstructor = function (expressionSyntax) {
|
|
1376
|
+
try {
|
|
1377
|
+
return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')();
|
|
1378
|
+
} catch (e) {}
|
|
1379
|
+
};
|
|
1380
|
+
|
|
1381
|
+
var $gOPD = Object.getOwnPropertyDescriptor;
|
|
1382
|
+
if ($gOPD) {
|
|
1383
|
+
try {
|
|
1384
|
+
$gOPD({}, '');
|
|
1385
|
+
} catch (e) {
|
|
1386
|
+
$gOPD = null; // this is IE 8, which has a broken gOPD
|
|
1387
|
+
}
|
|
1388
|
+
}
|
|
1389
|
+
|
|
1390
|
+
var throwTypeError = function () {
|
|
1391
|
+
throw new $TypeError$1();
|
|
1392
|
+
};
|
|
1393
|
+
var ThrowTypeError = $gOPD
|
|
1394
|
+
? (function () {
|
|
1395
|
+
try {
|
|
1396
|
+
// eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
|
|
1397
|
+
arguments.callee; // IE 8 does not throw here
|
|
1398
|
+
return throwTypeError;
|
|
1399
|
+
} catch (calleeThrows) {
|
|
1400
|
+
try {
|
|
1401
|
+
// IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
|
|
1402
|
+
return $gOPD(arguments, 'callee').get;
|
|
1403
|
+
} catch (gOPDthrows) {
|
|
1404
|
+
return throwTypeError;
|
|
1405
|
+
}
|
|
1406
|
+
}
|
|
1407
|
+
}())
|
|
1408
|
+
: throwTypeError;
|
|
1409
|
+
|
|
1410
|
+
var hasSymbols = hasSymbols$1();
|
|
1411
|
+
var hasProto = hasProto$1();
|
|
1412
|
+
|
|
1413
|
+
var getProto = Object.getPrototypeOf || (
|
|
1414
|
+
hasProto
|
|
1415
|
+
? function (x) { return x.__proto__; } // eslint-disable-line no-proto
|
|
1416
|
+
: null
|
|
1417
|
+
);
|
|
1418
|
+
|
|
1419
|
+
var needsEval = {};
|
|
1420
|
+
|
|
1421
|
+
var TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined$1 : getProto(Uint8Array);
|
|
1422
|
+
|
|
1423
|
+
var INTRINSICS = {
|
|
1424
|
+
'%AggregateError%': typeof AggregateError === 'undefined' ? undefined$1 : AggregateError,
|
|
1425
|
+
'%Array%': Array,
|
|
1426
|
+
'%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined$1 : ArrayBuffer,
|
|
1427
|
+
'%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined$1,
|
|
1428
|
+
'%AsyncFromSyncIteratorPrototype%': undefined$1,
|
|
1429
|
+
'%AsyncFunction%': needsEval,
|
|
1430
|
+
'%AsyncGenerator%': needsEval,
|
|
1431
|
+
'%AsyncGeneratorFunction%': needsEval,
|
|
1432
|
+
'%AsyncIteratorPrototype%': needsEval,
|
|
1433
|
+
'%Atomics%': typeof Atomics === 'undefined' ? undefined$1 : Atomics,
|
|
1434
|
+
'%BigInt%': typeof BigInt === 'undefined' ? undefined$1 : BigInt,
|
|
1435
|
+
'%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined$1 : BigInt64Array,
|
|
1436
|
+
'%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined$1 : BigUint64Array,
|
|
1437
|
+
'%Boolean%': Boolean,
|
|
1438
|
+
'%DataView%': typeof DataView === 'undefined' ? undefined$1 : DataView,
|
|
1439
|
+
'%Date%': Date,
|
|
1440
|
+
'%decodeURI%': decodeURI,
|
|
1441
|
+
'%decodeURIComponent%': decodeURIComponent,
|
|
1442
|
+
'%encodeURI%': encodeURI,
|
|
1443
|
+
'%encodeURIComponent%': encodeURIComponent,
|
|
1444
|
+
'%Error%': Error,
|
|
1445
|
+
'%eval%': eval, // eslint-disable-line no-eval
|
|
1446
|
+
'%EvalError%': EvalError,
|
|
1447
|
+
'%Float32Array%': typeof Float32Array === 'undefined' ? undefined$1 : Float32Array,
|
|
1448
|
+
'%Float64Array%': typeof Float64Array === 'undefined' ? undefined$1 : Float64Array,
|
|
1449
|
+
'%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined$1 : FinalizationRegistry,
|
|
1450
|
+
'%Function%': $Function,
|
|
1451
|
+
'%GeneratorFunction%': needsEval,
|
|
1452
|
+
'%Int8Array%': typeof Int8Array === 'undefined' ? undefined$1 : Int8Array,
|
|
1453
|
+
'%Int16Array%': typeof Int16Array === 'undefined' ? undefined$1 : Int16Array,
|
|
1454
|
+
'%Int32Array%': typeof Int32Array === 'undefined' ? undefined$1 : Int32Array,
|
|
1455
|
+
'%isFinite%': isFinite,
|
|
1456
|
+
'%isNaN%': isNaN,
|
|
1457
|
+
'%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined$1,
|
|
1458
|
+
'%JSON%': typeof JSON === 'object' ? JSON : undefined$1,
|
|
1459
|
+
'%Map%': typeof Map === 'undefined' ? undefined$1 : Map,
|
|
1460
|
+
'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined$1 : getProto(new Map()[Symbol.iterator]()),
|
|
1461
|
+
'%Math%': Math,
|
|
1462
|
+
'%Number%': Number,
|
|
1463
|
+
'%Object%': Object,
|
|
1464
|
+
'%parseFloat%': parseFloat,
|
|
1465
|
+
'%parseInt%': parseInt,
|
|
1466
|
+
'%Promise%': typeof Promise === 'undefined' ? undefined$1 : Promise,
|
|
1467
|
+
'%Proxy%': typeof Proxy === 'undefined' ? undefined$1 : Proxy,
|
|
1468
|
+
'%RangeError%': RangeError,
|
|
1469
|
+
'%ReferenceError%': ReferenceError,
|
|
1470
|
+
'%Reflect%': typeof Reflect === 'undefined' ? undefined$1 : Reflect,
|
|
1471
|
+
'%RegExp%': RegExp,
|
|
1472
|
+
'%Set%': typeof Set === 'undefined' ? undefined$1 : Set,
|
|
1473
|
+
'%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined$1 : getProto(new Set()[Symbol.iterator]()),
|
|
1474
|
+
'%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined$1 : SharedArrayBuffer,
|
|
1475
|
+
'%String%': String,
|
|
1476
|
+
'%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined$1,
|
|
1477
|
+
'%Symbol%': hasSymbols ? Symbol : undefined$1,
|
|
1478
|
+
'%SyntaxError%': $SyntaxError,
|
|
1479
|
+
'%ThrowTypeError%': ThrowTypeError,
|
|
1480
|
+
'%TypedArray%': TypedArray,
|
|
1481
|
+
'%TypeError%': $TypeError$1,
|
|
1482
|
+
'%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined$1 : Uint8Array,
|
|
1483
|
+
'%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined$1 : Uint8ClampedArray,
|
|
1484
|
+
'%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined$1 : Uint16Array,
|
|
1485
|
+
'%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined$1 : Uint32Array,
|
|
1486
|
+
'%URIError%': URIError,
|
|
1487
|
+
'%WeakMap%': typeof WeakMap === 'undefined' ? undefined$1 : WeakMap,
|
|
1488
|
+
'%WeakRef%': typeof WeakRef === 'undefined' ? undefined$1 : WeakRef,
|
|
1489
|
+
'%WeakSet%': typeof WeakSet === 'undefined' ? undefined$1 : WeakSet
|
|
1490
|
+
};
|
|
1491
|
+
|
|
1492
|
+
if (getProto) {
|
|
1493
|
+
try {
|
|
1494
|
+
null.error; // eslint-disable-line no-unused-expressions
|
|
1495
|
+
} catch (e) {
|
|
1496
|
+
// https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229
|
|
1497
|
+
var errorProto = getProto(getProto(e));
|
|
1498
|
+
INTRINSICS['%Error.prototype%'] = errorProto;
|
|
1499
|
+
}
|
|
1500
|
+
}
|
|
1501
|
+
|
|
1502
|
+
var doEval = function doEval(name) {
|
|
1503
|
+
var value;
|
|
1504
|
+
if (name === '%AsyncFunction%') {
|
|
1505
|
+
value = getEvalledConstructor('async function () {}');
|
|
1506
|
+
} else if (name === '%GeneratorFunction%') {
|
|
1507
|
+
value = getEvalledConstructor('function* () {}');
|
|
1508
|
+
} else if (name === '%AsyncGeneratorFunction%') {
|
|
1509
|
+
value = getEvalledConstructor('async function* () {}');
|
|
1510
|
+
} else if (name === '%AsyncGenerator%') {
|
|
1511
|
+
var fn = doEval('%AsyncGeneratorFunction%');
|
|
1512
|
+
if (fn) {
|
|
1513
|
+
value = fn.prototype;
|
|
1514
|
+
}
|
|
1515
|
+
} else if (name === '%AsyncIteratorPrototype%') {
|
|
1516
|
+
var gen = doEval('%AsyncGenerator%');
|
|
1517
|
+
if (gen && getProto) {
|
|
1518
|
+
value = getProto(gen.prototype);
|
|
1519
|
+
}
|
|
1520
|
+
}
|
|
1521
|
+
|
|
1522
|
+
INTRINSICS[name] = value;
|
|
1523
|
+
|
|
1524
|
+
return value;
|
|
1525
|
+
};
|
|
1526
|
+
|
|
1527
|
+
var LEGACY_ALIASES = {
|
|
1528
|
+
'%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
|
|
1529
|
+
'%ArrayPrototype%': ['Array', 'prototype'],
|
|
1530
|
+
'%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
|
|
1531
|
+
'%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],
|
|
1532
|
+
'%ArrayProto_keys%': ['Array', 'prototype', 'keys'],
|
|
1533
|
+
'%ArrayProto_values%': ['Array', 'prototype', 'values'],
|
|
1534
|
+
'%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],
|
|
1535
|
+
'%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],
|
|
1536
|
+
'%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],
|
|
1537
|
+
'%BooleanPrototype%': ['Boolean', 'prototype'],
|
|
1538
|
+
'%DataViewPrototype%': ['DataView', 'prototype'],
|
|
1539
|
+
'%DatePrototype%': ['Date', 'prototype'],
|
|
1540
|
+
'%ErrorPrototype%': ['Error', 'prototype'],
|
|
1541
|
+
'%EvalErrorPrototype%': ['EvalError', 'prototype'],
|
|
1542
|
+
'%Float32ArrayPrototype%': ['Float32Array', 'prototype'],
|
|
1543
|
+
'%Float64ArrayPrototype%': ['Float64Array', 'prototype'],
|
|
1544
|
+
'%FunctionPrototype%': ['Function', 'prototype'],
|
|
1545
|
+
'%Generator%': ['GeneratorFunction', 'prototype'],
|
|
1546
|
+
'%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],
|
|
1547
|
+
'%Int8ArrayPrototype%': ['Int8Array', 'prototype'],
|
|
1548
|
+
'%Int16ArrayPrototype%': ['Int16Array', 'prototype'],
|
|
1549
|
+
'%Int32ArrayPrototype%': ['Int32Array', 'prototype'],
|
|
1550
|
+
'%JSONParse%': ['JSON', 'parse'],
|
|
1551
|
+
'%JSONStringify%': ['JSON', 'stringify'],
|
|
1552
|
+
'%MapPrototype%': ['Map', 'prototype'],
|
|
1553
|
+
'%NumberPrototype%': ['Number', 'prototype'],
|
|
1554
|
+
'%ObjectPrototype%': ['Object', 'prototype'],
|
|
1555
|
+
'%ObjProto_toString%': ['Object', 'prototype', 'toString'],
|
|
1556
|
+
'%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],
|
|
1557
|
+
'%PromisePrototype%': ['Promise', 'prototype'],
|
|
1558
|
+
'%PromiseProto_then%': ['Promise', 'prototype', 'then'],
|
|
1559
|
+
'%Promise_all%': ['Promise', 'all'],
|
|
1560
|
+
'%Promise_reject%': ['Promise', 'reject'],
|
|
1561
|
+
'%Promise_resolve%': ['Promise', 'resolve'],
|
|
1562
|
+
'%RangeErrorPrototype%': ['RangeError', 'prototype'],
|
|
1563
|
+
'%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],
|
|
1564
|
+
'%RegExpPrototype%': ['RegExp', 'prototype'],
|
|
1565
|
+
'%SetPrototype%': ['Set', 'prototype'],
|
|
1566
|
+
'%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],
|
|
1567
|
+
'%StringPrototype%': ['String', 'prototype'],
|
|
1568
|
+
'%SymbolPrototype%': ['Symbol', 'prototype'],
|
|
1569
|
+
'%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],
|
|
1570
|
+
'%TypedArrayPrototype%': ['TypedArray', 'prototype'],
|
|
1571
|
+
'%TypeErrorPrototype%': ['TypeError', 'prototype'],
|
|
1572
|
+
'%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],
|
|
1573
|
+
'%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],
|
|
1574
|
+
'%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],
|
|
1575
|
+
'%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],
|
|
1576
|
+
'%URIErrorPrototype%': ['URIError', 'prototype'],
|
|
1577
|
+
'%WeakMapPrototype%': ['WeakMap', 'prototype'],
|
|
1578
|
+
'%WeakSetPrototype%': ['WeakSet', 'prototype']
|
|
1579
|
+
};
|
|
1580
|
+
|
|
1581
|
+
var bind = functionBind;
|
|
1582
|
+
var hasOwn$1 = src;
|
|
1583
|
+
var $concat$1 = bind.call(Function.call, Array.prototype.concat);
|
|
1584
|
+
var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
|
|
1585
|
+
var $replace$1 = bind.call(Function.call, String.prototype.replace);
|
|
1586
|
+
var $strSlice = bind.call(Function.call, String.prototype.slice);
|
|
1587
|
+
var $exec = bind.call(Function.call, RegExp.prototype.exec);
|
|
1588
|
+
|
|
1589
|
+
/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
|
|
1590
|
+
var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
|
|
1591
|
+
var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
|
|
1592
|
+
var stringToPath = function stringToPath(string) {
|
|
1593
|
+
var first = $strSlice(string, 0, 1);
|
|
1594
|
+
var last = $strSlice(string, -1);
|
|
1595
|
+
if (first === '%' && last !== '%') {
|
|
1596
|
+
throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`');
|
|
1597
|
+
} else if (last === '%' && first !== '%') {
|
|
1598
|
+
throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`');
|
|
1599
|
+
}
|
|
1600
|
+
var result = [];
|
|
1601
|
+
$replace$1(string, rePropName, function (match, number, quote, subString) {
|
|
1602
|
+
result[result.length] = quote ? $replace$1(subString, reEscapeChar, '$1') : number || match;
|
|
1603
|
+
});
|
|
1604
|
+
return result;
|
|
1605
|
+
};
|
|
1606
|
+
/* end adaptation */
|
|
1607
|
+
|
|
1608
|
+
var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
|
|
1609
|
+
var intrinsicName = name;
|
|
1610
|
+
var alias;
|
|
1611
|
+
if (hasOwn$1(LEGACY_ALIASES, intrinsicName)) {
|
|
1612
|
+
alias = LEGACY_ALIASES[intrinsicName];
|
|
1613
|
+
intrinsicName = '%' + alias[0] + '%';
|
|
1614
|
+
}
|
|
1615
|
+
|
|
1616
|
+
if (hasOwn$1(INTRINSICS, intrinsicName)) {
|
|
1617
|
+
var value = INTRINSICS[intrinsicName];
|
|
1618
|
+
if (value === needsEval) {
|
|
1619
|
+
value = doEval(intrinsicName);
|
|
1620
|
+
}
|
|
1621
|
+
if (typeof value === 'undefined' && !allowMissing) {
|
|
1622
|
+
throw new $TypeError$1('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
|
|
1623
|
+
}
|
|
1624
|
+
|
|
1625
|
+
return {
|
|
1626
|
+
alias: alias,
|
|
1627
|
+
name: intrinsicName,
|
|
1628
|
+
value: value
|
|
1629
|
+
};
|
|
1630
|
+
}
|
|
1631
|
+
|
|
1632
|
+
throw new $SyntaxError('intrinsic ' + name + ' does not exist!');
|
|
1633
|
+
};
|
|
1634
|
+
|
|
1635
|
+
var getIntrinsic = function GetIntrinsic(name, allowMissing) {
|
|
1636
|
+
if (typeof name !== 'string' || name.length === 0) {
|
|
1637
|
+
throw new $TypeError$1('intrinsic name must be a non-empty string');
|
|
1638
|
+
}
|
|
1639
|
+
if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
|
|
1640
|
+
throw new $TypeError$1('"allowMissing" argument must be a boolean');
|
|
1641
|
+
}
|
|
1642
|
+
|
|
1643
|
+
if ($exec(/^%?[^%]*%?$/, name) === null) {
|
|
1644
|
+
throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');
|
|
1645
|
+
}
|
|
1646
|
+
var parts = stringToPath(name);
|
|
1647
|
+
var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
|
|
1648
|
+
|
|
1649
|
+
var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);
|
|
1650
|
+
var intrinsicRealName = intrinsic.name;
|
|
1651
|
+
var value = intrinsic.value;
|
|
1652
|
+
var skipFurtherCaching = false;
|
|
1653
|
+
|
|
1654
|
+
var alias = intrinsic.alias;
|
|
1655
|
+
if (alias) {
|
|
1656
|
+
intrinsicBaseName = alias[0];
|
|
1657
|
+
$spliceApply(parts, $concat$1([0, 1], alias));
|
|
1658
|
+
}
|
|
1659
|
+
|
|
1660
|
+
for (var i = 1, isOwn = true; i < parts.length; i += 1) {
|
|
1661
|
+
var part = parts[i];
|
|
1662
|
+
var first = $strSlice(part, 0, 1);
|
|
1663
|
+
var last = $strSlice(part, -1);
|
|
1664
|
+
if (
|
|
1665
|
+
(
|
|
1666
|
+
(first === '"' || first === "'" || first === '`')
|
|
1667
|
+
|| (last === '"' || last === "'" || last === '`')
|
|
1668
|
+
)
|
|
1669
|
+
&& first !== last
|
|
1670
|
+
) {
|
|
1671
|
+
throw new $SyntaxError('property names with quotes must have matching quotes');
|
|
1672
|
+
}
|
|
1673
|
+
if (part === 'constructor' || !isOwn) {
|
|
1674
|
+
skipFurtherCaching = true;
|
|
1675
|
+
}
|
|
1676
|
+
|
|
1677
|
+
intrinsicBaseName += '.' + part;
|
|
1678
|
+
intrinsicRealName = '%' + intrinsicBaseName + '%';
|
|
1679
|
+
|
|
1680
|
+
if (hasOwn$1(INTRINSICS, intrinsicRealName)) {
|
|
1681
|
+
value = INTRINSICS[intrinsicRealName];
|
|
1682
|
+
} else if (value != null) {
|
|
1683
|
+
if (!(part in value)) {
|
|
1684
|
+
if (!allowMissing) {
|
|
1685
|
+
throw new $TypeError$1('base intrinsic for ' + name + ' exists, but the property is not available.');
|
|
1686
|
+
}
|
|
1687
|
+
return void undefined$1;
|
|
1688
|
+
}
|
|
1689
|
+
if ($gOPD && (i + 1) >= parts.length) {
|
|
1690
|
+
var desc = $gOPD(value, part);
|
|
1691
|
+
isOwn = !!desc;
|
|
1692
|
+
|
|
1693
|
+
// By convention, when a data property is converted to an accessor
|
|
1694
|
+
// property to emulate a data property that does not suffer from
|
|
1695
|
+
// the override mistake, that accessor's getter is marked with
|
|
1696
|
+
// an `originalValue` property. Here, when we detect this, we
|
|
1697
|
+
// uphold the illusion by pretending to see that original data
|
|
1698
|
+
// property, i.e., returning the value rather than the getter
|
|
1699
|
+
// itself.
|
|
1700
|
+
if (isOwn && 'get' in desc && !('originalValue' in desc.get)) {
|
|
1701
|
+
value = desc.get;
|
|
1702
|
+
} else {
|
|
1703
|
+
value = value[part];
|
|
1704
|
+
}
|
|
1705
|
+
} else {
|
|
1706
|
+
isOwn = hasOwn$1(value, part);
|
|
1707
|
+
value = value[part];
|
|
1708
|
+
}
|
|
1709
|
+
|
|
1710
|
+
if (isOwn && !skipFurtherCaching) {
|
|
1711
|
+
INTRINSICS[intrinsicRealName] = value;
|
|
1712
|
+
}
|
|
1713
|
+
}
|
|
1714
|
+
}
|
|
1715
|
+
return value;
|
|
1716
|
+
};
|
|
1717
|
+
|
|
1718
|
+
var callBind$1 = {exports: {}};
|
|
1719
|
+
|
|
1720
|
+
callBind$1.exports;
|
|
1721
|
+
|
|
1722
|
+
(function (module) {
|
|
1723
|
+
|
|
1724
|
+
var bind = functionBind;
|
|
1725
|
+
var GetIntrinsic = getIntrinsic;
|
|
1726
|
+
|
|
1727
|
+
var $apply = GetIntrinsic('%Function.prototype.apply%');
|
|
1728
|
+
var $call = GetIntrinsic('%Function.prototype.call%');
|
|
1729
|
+
var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);
|
|
1730
|
+
|
|
1731
|
+
var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);
|
|
1732
|
+
var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
|
|
1733
|
+
var $max = GetIntrinsic('%Math.max%');
|
|
1734
|
+
|
|
1735
|
+
if ($defineProperty) {
|
|
1736
|
+
try {
|
|
1737
|
+
$defineProperty({}, 'a', { value: 1 });
|
|
1738
|
+
} catch (e) {
|
|
1739
|
+
// IE 8 has a broken defineProperty
|
|
1740
|
+
$defineProperty = null;
|
|
1741
|
+
}
|
|
1742
|
+
}
|
|
1743
|
+
|
|
1744
|
+
module.exports = function callBind(originalFunction) {
|
|
1745
|
+
var func = $reflectApply(bind, $call, arguments);
|
|
1746
|
+
if ($gOPD && $defineProperty) {
|
|
1747
|
+
var desc = $gOPD(func, 'length');
|
|
1748
|
+
if (desc.configurable) {
|
|
1749
|
+
// original length, plus the receiver, minus any additional arguments (after the receiver)
|
|
1750
|
+
$defineProperty(
|
|
1751
|
+
func,
|
|
1752
|
+
'length',
|
|
1753
|
+
{ value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }
|
|
1754
|
+
);
|
|
1755
|
+
}
|
|
1756
|
+
}
|
|
1757
|
+
return func;
|
|
1758
|
+
};
|
|
1759
|
+
|
|
1760
|
+
var applyBind = function applyBind() {
|
|
1761
|
+
return $reflectApply(bind, $apply, arguments);
|
|
1762
|
+
};
|
|
1763
|
+
|
|
1764
|
+
if ($defineProperty) {
|
|
1765
|
+
$defineProperty(module.exports, 'apply', { value: applyBind });
|
|
1766
|
+
} else {
|
|
1767
|
+
module.exports.apply = applyBind;
|
|
1768
|
+
}
|
|
1769
|
+
} (callBind$1));
|
|
1770
|
+
|
|
1771
|
+
var callBindExports = callBind$1.exports;
|
|
1772
|
+
|
|
1773
|
+
var GetIntrinsic$1 = getIntrinsic;
|
|
1774
|
+
|
|
1775
|
+
var callBind = callBindExports;
|
|
1776
|
+
|
|
1777
|
+
var $indexOf = callBind(GetIntrinsic$1('String.prototype.indexOf'));
|
|
1778
|
+
|
|
1779
|
+
var callBound$1 = function callBoundIntrinsic(name, allowMissing) {
|
|
1780
|
+
var intrinsic = GetIntrinsic$1(name, !!allowMissing);
|
|
1781
|
+
if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
|
|
1782
|
+
return callBind(intrinsic);
|
|
1783
|
+
}
|
|
1784
|
+
return intrinsic;
|
|
1785
|
+
};
|
|
1786
|
+
|
|
1787
|
+
var util_inspect = require$$0.inspect;
|
|
1788
|
+
|
|
1789
|
+
var hasMap = typeof Map === 'function' && Map.prototype;
|
|
1790
|
+
var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;
|
|
1791
|
+
var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;
|
|
1792
|
+
var mapForEach = hasMap && Map.prototype.forEach;
|
|
1793
|
+
var hasSet = typeof Set === 'function' && Set.prototype;
|
|
1794
|
+
var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null;
|
|
1795
|
+
var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null;
|
|
1796
|
+
var setForEach = hasSet && Set.prototype.forEach;
|
|
1797
|
+
var hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype;
|
|
1798
|
+
var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;
|
|
1799
|
+
var hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype;
|
|
1800
|
+
var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;
|
|
1801
|
+
var hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype;
|
|
1802
|
+
var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;
|
|
1803
|
+
var booleanValueOf = Boolean.prototype.valueOf;
|
|
1804
|
+
var objectToString = Object.prototype.toString;
|
|
1805
|
+
var functionToString = Function.prototype.toString;
|
|
1806
|
+
var $match = String.prototype.match;
|
|
1807
|
+
var $slice = String.prototype.slice;
|
|
1808
|
+
var $replace = String.prototype.replace;
|
|
1809
|
+
var $toUpperCase = String.prototype.toUpperCase;
|
|
1810
|
+
var $toLowerCase = String.prototype.toLowerCase;
|
|
1811
|
+
var $test = RegExp.prototype.test;
|
|
1812
|
+
var $concat = Array.prototype.concat;
|
|
1813
|
+
var $join = Array.prototype.join;
|
|
1814
|
+
var $arrSlice = Array.prototype.slice;
|
|
1815
|
+
var $floor = Math.floor;
|
|
1816
|
+
var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;
|
|
1817
|
+
var gOPS = Object.getOwnPropertySymbols;
|
|
1818
|
+
var symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;
|
|
1819
|
+
var hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object';
|
|
1820
|
+
// ie, `has-tostringtag/shams
|
|
1821
|
+
var toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol')
|
|
1822
|
+
? Symbol.toStringTag
|
|
1823
|
+
: null;
|
|
1824
|
+
var isEnumerable = Object.prototype.propertyIsEnumerable;
|
|
1825
|
+
|
|
1826
|
+
var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || (
|
|
1827
|
+
[].__proto__ === Array.prototype // eslint-disable-line no-proto
|
|
1828
|
+
? function (O) {
|
|
1829
|
+
return O.__proto__; // eslint-disable-line no-proto
|
|
1830
|
+
}
|
|
1831
|
+
: null
|
|
1832
|
+
);
|
|
1833
|
+
|
|
1834
|
+
function addNumericSeparator(num, str) {
|
|
1835
|
+
if (
|
|
1836
|
+
num === Infinity
|
|
1837
|
+
|| num === -Infinity
|
|
1838
|
+
|| num !== num
|
|
1839
|
+
|| (num && num > -1000 && num < 1000)
|
|
1840
|
+
|| $test.call(/e/, str)
|
|
1841
|
+
) {
|
|
1842
|
+
return str;
|
|
1843
|
+
}
|
|
1844
|
+
var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
|
|
1845
|
+
if (typeof num === 'number') {
|
|
1846
|
+
var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num)
|
|
1847
|
+
if (int !== num) {
|
|
1848
|
+
var intStr = String(int);
|
|
1849
|
+
var dec = $slice.call(str, intStr.length + 1);
|
|
1850
|
+
return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, '');
|
|
1851
|
+
}
|
|
1852
|
+
}
|
|
1853
|
+
return $replace.call(str, sepRegex, '$&_');
|
|
1854
|
+
}
|
|
1855
|
+
|
|
1856
|
+
var utilInspect = util_inspect;
|
|
1857
|
+
var inspectCustom = utilInspect.custom;
|
|
1858
|
+
var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;
|
|
1859
|
+
|
|
1860
|
+
var objectInspect = function inspect_(obj, options, depth, seen) {
|
|
1861
|
+
var opts = options || {};
|
|
1862
|
+
|
|
1863
|
+
if (has$3(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) {
|
|
1864
|
+
throw new TypeError('option "quoteStyle" must be "single" or "double"');
|
|
1865
|
+
}
|
|
1866
|
+
if (
|
|
1867
|
+
has$3(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number'
|
|
1868
|
+
? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity
|
|
1869
|
+
: opts.maxStringLength !== null
|
|
1870
|
+
)
|
|
1871
|
+
) {
|
|
1872
|
+
throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
|
|
1873
|
+
}
|
|
1874
|
+
var customInspect = has$3(opts, 'customInspect') ? opts.customInspect : true;
|
|
1875
|
+
if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') {
|
|
1876
|
+
throw new TypeError('option "customInspect", if provided, must be `true`, `false`, or `\'symbol\'`');
|
|
1877
|
+
}
|
|
1878
|
+
|
|
1879
|
+
if (
|
|
1880
|
+
has$3(opts, 'indent')
|
|
1881
|
+
&& opts.indent !== null
|
|
1882
|
+
&& opts.indent !== '\t'
|
|
1883
|
+
&& !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)
|
|
1884
|
+
) {
|
|
1885
|
+
throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
|
|
1886
|
+
}
|
|
1887
|
+
if (has$3(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') {
|
|
1888
|
+
throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');
|
|
1889
|
+
}
|
|
1890
|
+
var numericSeparator = opts.numericSeparator;
|
|
1891
|
+
|
|
1892
|
+
if (typeof obj === 'undefined') {
|
|
1893
|
+
return 'undefined';
|
|
1894
|
+
}
|
|
1895
|
+
if (obj === null) {
|
|
1896
|
+
return 'null';
|
|
1897
|
+
}
|
|
1898
|
+
if (typeof obj === 'boolean') {
|
|
1899
|
+
return obj ? 'true' : 'false';
|
|
1900
|
+
}
|
|
1901
|
+
|
|
1902
|
+
if (typeof obj === 'string') {
|
|
1903
|
+
return inspectString(obj, opts);
|
|
1904
|
+
}
|
|
1905
|
+
if (typeof obj === 'number') {
|
|
1906
|
+
if (obj === 0) {
|
|
1907
|
+
return Infinity / obj > 0 ? '0' : '-0';
|
|
1908
|
+
}
|
|
1909
|
+
var str = String(obj);
|
|
1910
|
+
return numericSeparator ? addNumericSeparator(obj, str) : str;
|
|
1911
|
+
}
|
|
1912
|
+
if (typeof obj === 'bigint') {
|
|
1913
|
+
var bigIntStr = String(obj) + 'n';
|
|
1914
|
+
return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;
|
|
1915
|
+
}
|
|
1916
|
+
|
|
1917
|
+
var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;
|
|
1918
|
+
if (typeof depth === 'undefined') { depth = 0; }
|
|
1919
|
+
if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') {
|
|
1920
|
+
return isArray$3(obj) ? '[Array]' : '[Object]';
|
|
1921
|
+
}
|
|
1922
|
+
|
|
1923
|
+
var indent = getIndent(opts, depth);
|
|
1924
|
+
|
|
1925
|
+
if (typeof seen === 'undefined') {
|
|
1926
|
+
seen = [];
|
|
1927
|
+
} else if (indexOf(seen, obj) >= 0) {
|
|
1928
|
+
return '[Circular]';
|
|
1929
|
+
}
|
|
1930
|
+
|
|
1931
|
+
function inspect(value, from, noIndent) {
|
|
1932
|
+
if (from) {
|
|
1933
|
+
seen = $arrSlice.call(seen);
|
|
1934
|
+
seen.push(from);
|
|
1935
|
+
}
|
|
1936
|
+
if (noIndent) {
|
|
1937
|
+
var newOpts = {
|
|
1938
|
+
depth: opts.depth
|
|
1939
|
+
};
|
|
1940
|
+
if (has$3(opts, 'quoteStyle')) {
|
|
1941
|
+
newOpts.quoteStyle = opts.quoteStyle;
|
|
1942
|
+
}
|
|
1943
|
+
return inspect_(value, newOpts, depth + 1, seen);
|
|
1944
|
+
}
|
|
1945
|
+
return inspect_(value, opts, depth + 1, seen);
|
|
1946
|
+
}
|
|
1947
|
+
|
|
1948
|
+
if (typeof obj === 'function' && !isRegExp$1(obj)) { // in older engines, regexes are callable
|
|
1949
|
+
var name = nameOf(obj);
|
|
1950
|
+
var keys = arrObjKeys(obj, inspect);
|
|
1951
|
+
return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');
|
|
1952
|
+
}
|
|
1953
|
+
if (isSymbol(obj)) {
|
|
1954
|
+
var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj);
|
|
1955
|
+
return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString;
|
|
1956
|
+
}
|
|
1957
|
+
if (isElement(obj)) {
|
|
1958
|
+
var s = '<' + $toLowerCase.call(String(obj.nodeName));
|
|
1959
|
+
var attrs = obj.attributes || [];
|
|
1960
|
+
for (var i = 0; i < attrs.length; i++) {
|
|
1961
|
+
s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts);
|
|
1962
|
+
}
|
|
1963
|
+
s += '>';
|
|
1964
|
+
if (obj.childNodes && obj.childNodes.length) { s += '...'; }
|
|
1965
|
+
s += '</' + $toLowerCase.call(String(obj.nodeName)) + '>';
|
|
1966
|
+
return s;
|
|
1967
|
+
}
|
|
1968
|
+
if (isArray$3(obj)) {
|
|
1969
|
+
if (obj.length === 0) { return '[]'; }
|
|
1970
|
+
var xs = arrObjKeys(obj, inspect);
|
|
1971
|
+
if (indent && !singleLineValues(xs)) {
|
|
1972
|
+
return '[' + indentedJoin(xs, indent) + ']';
|
|
1973
|
+
}
|
|
1974
|
+
return '[ ' + $join.call(xs, ', ') + ' ]';
|
|
1975
|
+
}
|
|
1976
|
+
if (isError(obj)) {
|
|
1977
|
+
var parts = arrObjKeys(obj, inspect);
|
|
1978
|
+
if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) {
|
|
1979
|
+
return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';
|
|
1980
|
+
}
|
|
1981
|
+
if (parts.length === 0) { return '[' + String(obj) + ']'; }
|
|
1982
|
+
return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';
|
|
1983
|
+
}
|
|
1984
|
+
if (typeof obj === 'object' && customInspect) {
|
|
1985
|
+
if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) {
|
|
1986
|
+
return utilInspect(obj, { depth: maxDepth - depth });
|
|
1987
|
+
} else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {
|
|
1988
|
+
return obj.inspect();
|
|
1989
|
+
}
|
|
1990
|
+
}
|
|
1991
|
+
if (isMap(obj)) {
|
|
1992
|
+
var mapParts = [];
|
|
1993
|
+
if (mapForEach) {
|
|
1994
|
+
mapForEach.call(obj, function (value, key) {
|
|
1995
|
+
mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj));
|
|
1996
|
+
});
|
|
1997
|
+
}
|
|
1998
|
+
return collectionOf('Map', mapSize.call(obj), mapParts, indent);
|
|
1999
|
+
}
|
|
2000
|
+
if (isSet(obj)) {
|
|
2001
|
+
var setParts = [];
|
|
2002
|
+
if (setForEach) {
|
|
2003
|
+
setForEach.call(obj, function (value) {
|
|
2004
|
+
setParts.push(inspect(value, obj));
|
|
2005
|
+
});
|
|
2006
|
+
}
|
|
2007
|
+
return collectionOf('Set', setSize.call(obj), setParts, indent);
|
|
2008
|
+
}
|
|
2009
|
+
if (isWeakMap(obj)) {
|
|
2010
|
+
return weakCollectionOf('WeakMap');
|
|
2011
|
+
}
|
|
2012
|
+
if (isWeakSet(obj)) {
|
|
2013
|
+
return weakCollectionOf('WeakSet');
|
|
2014
|
+
}
|
|
2015
|
+
if (isWeakRef(obj)) {
|
|
2016
|
+
return weakCollectionOf('WeakRef');
|
|
2017
|
+
}
|
|
2018
|
+
if (isNumber(obj)) {
|
|
2019
|
+
return markBoxed(inspect(Number(obj)));
|
|
2020
|
+
}
|
|
2021
|
+
if (isBigInt(obj)) {
|
|
2022
|
+
return markBoxed(inspect(bigIntValueOf.call(obj)));
|
|
2023
|
+
}
|
|
2024
|
+
if (isBoolean(obj)) {
|
|
2025
|
+
return markBoxed(booleanValueOf.call(obj));
|
|
2026
|
+
}
|
|
2027
|
+
if (isString(obj)) {
|
|
2028
|
+
return markBoxed(inspect(String(obj)));
|
|
2029
|
+
}
|
|
2030
|
+
if (!isDate(obj) && !isRegExp$1(obj)) {
|
|
2031
|
+
var ys = arrObjKeys(obj, inspect);
|
|
2032
|
+
var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
|
|
2033
|
+
var protoTag = obj instanceof Object ? '' : 'null prototype';
|
|
2034
|
+
var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : '';
|
|
2035
|
+
var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : '';
|
|
2036
|
+
var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : '');
|
|
2037
|
+
if (ys.length === 0) { return tag + '{}'; }
|
|
2038
|
+
if (indent) {
|
|
2039
|
+
return tag + '{' + indentedJoin(ys, indent) + '}';
|
|
2040
|
+
}
|
|
2041
|
+
return tag + '{ ' + $join.call(ys, ', ') + ' }';
|
|
2042
|
+
}
|
|
2043
|
+
return String(obj);
|
|
2044
|
+
};
|
|
2045
|
+
|
|
2046
|
+
function wrapQuotes(s, defaultStyle, opts) {
|
|
2047
|
+
var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '"' : "'";
|
|
2048
|
+
return quoteChar + s + quoteChar;
|
|
2049
|
+
}
|
|
2050
|
+
|
|
2051
|
+
function quote(s) {
|
|
2052
|
+
return $replace.call(String(s), /"/g, '"');
|
|
2053
|
+
}
|
|
2054
|
+
|
|
2055
|
+
function isArray$3(obj) { return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
|
2056
|
+
function isDate(obj) { return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
|
2057
|
+
function isRegExp$1(obj) { return toStr(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
|
2058
|
+
function isError(obj) { return toStr(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
|
2059
|
+
function isString(obj) { return toStr(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
|
2060
|
+
function isNumber(obj) { return toStr(obj) === '[object Number]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
|
2061
|
+
function isBoolean(obj) { return toStr(obj) === '[object Boolean]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
|
2062
|
+
|
|
2063
|
+
// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives
|
|
2064
|
+
function isSymbol(obj) {
|
|
2065
|
+
if (hasShammedSymbols) {
|
|
2066
|
+
return obj && typeof obj === 'object' && obj instanceof Symbol;
|
|
2067
|
+
}
|
|
2068
|
+
if (typeof obj === 'symbol') {
|
|
2069
|
+
return true;
|
|
2070
|
+
}
|
|
2071
|
+
if (!obj || typeof obj !== 'object' || !symToString) {
|
|
2072
|
+
return false;
|
|
2073
|
+
}
|
|
2074
|
+
try {
|
|
2075
|
+
symToString.call(obj);
|
|
2076
|
+
return true;
|
|
2077
|
+
} catch (e) {}
|
|
2078
|
+
return false;
|
|
2079
|
+
}
|
|
2080
|
+
|
|
2081
|
+
function isBigInt(obj) {
|
|
2082
|
+
if (!obj || typeof obj !== 'object' || !bigIntValueOf) {
|
|
2083
|
+
return false;
|
|
2084
|
+
}
|
|
2085
|
+
try {
|
|
2086
|
+
bigIntValueOf.call(obj);
|
|
2087
|
+
return true;
|
|
2088
|
+
} catch (e) {}
|
|
2089
|
+
return false;
|
|
2090
|
+
}
|
|
2091
|
+
|
|
2092
|
+
var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; };
|
|
2093
|
+
function has$3(obj, key) {
|
|
2094
|
+
return hasOwn.call(obj, key);
|
|
2095
|
+
}
|
|
2096
|
+
|
|
2097
|
+
function toStr(obj) {
|
|
2098
|
+
return objectToString.call(obj);
|
|
2099
|
+
}
|
|
2100
|
+
|
|
2101
|
+
function nameOf(f) {
|
|
2102
|
+
if (f.name) { return f.name; }
|
|
2103
|
+
var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/);
|
|
2104
|
+
if (m) { return m[1]; }
|
|
2105
|
+
return null;
|
|
2106
|
+
}
|
|
2107
|
+
|
|
2108
|
+
function indexOf(xs, x) {
|
|
2109
|
+
if (xs.indexOf) { return xs.indexOf(x); }
|
|
2110
|
+
for (var i = 0, l = xs.length; i < l; i++) {
|
|
2111
|
+
if (xs[i] === x) { return i; }
|
|
2112
|
+
}
|
|
2113
|
+
return -1;
|
|
2114
|
+
}
|
|
2115
|
+
|
|
2116
|
+
function isMap(x) {
|
|
2117
|
+
if (!mapSize || !x || typeof x !== 'object') {
|
|
2118
|
+
return false;
|
|
2119
|
+
}
|
|
2120
|
+
try {
|
|
2121
|
+
mapSize.call(x);
|
|
2122
|
+
try {
|
|
2123
|
+
setSize.call(x);
|
|
2124
|
+
} catch (s) {
|
|
2125
|
+
return true;
|
|
2126
|
+
}
|
|
2127
|
+
return x instanceof Map; // core-js workaround, pre-v2.5.0
|
|
2128
|
+
} catch (e) {}
|
|
2129
|
+
return false;
|
|
2130
|
+
}
|
|
2131
|
+
|
|
2132
|
+
function isWeakMap(x) {
|
|
2133
|
+
if (!weakMapHas || !x || typeof x !== 'object') {
|
|
2134
|
+
return false;
|
|
2135
|
+
}
|
|
2136
|
+
try {
|
|
2137
|
+
weakMapHas.call(x, weakMapHas);
|
|
2138
|
+
try {
|
|
2139
|
+
weakSetHas.call(x, weakSetHas);
|
|
2140
|
+
} catch (s) {
|
|
2141
|
+
return true;
|
|
2142
|
+
}
|
|
2143
|
+
return x instanceof WeakMap; // core-js workaround, pre-v2.5.0
|
|
2144
|
+
} catch (e) {}
|
|
2145
|
+
return false;
|
|
2146
|
+
}
|
|
2147
|
+
|
|
2148
|
+
function isWeakRef(x) {
|
|
2149
|
+
if (!weakRefDeref || !x || typeof x !== 'object') {
|
|
2150
|
+
return false;
|
|
2151
|
+
}
|
|
2152
|
+
try {
|
|
2153
|
+
weakRefDeref.call(x);
|
|
2154
|
+
return true;
|
|
2155
|
+
} catch (e) {}
|
|
2156
|
+
return false;
|
|
2157
|
+
}
|
|
2158
|
+
|
|
2159
|
+
function isSet(x) {
|
|
2160
|
+
if (!setSize || !x || typeof x !== 'object') {
|
|
2161
|
+
return false;
|
|
2162
|
+
}
|
|
2163
|
+
try {
|
|
2164
|
+
setSize.call(x);
|
|
2165
|
+
try {
|
|
2166
|
+
mapSize.call(x);
|
|
2167
|
+
} catch (m) {
|
|
2168
|
+
return true;
|
|
2169
|
+
}
|
|
2170
|
+
return x instanceof Set; // core-js workaround, pre-v2.5.0
|
|
2171
|
+
} catch (e) {}
|
|
2172
|
+
return false;
|
|
2173
|
+
}
|
|
2174
|
+
|
|
2175
|
+
function isWeakSet(x) {
|
|
2176
|
+
if (!weakSetHas || !x || typeof x !== 'object') {
|
|
2177
|
+
return false;
|
|
2178
|
+
}
|
|
2179
|
+
try {
|
|
2180
|
+
weakSetHas.call(x, weakSetHas);
|
|
2181
|
+
try {
|
|
2182
|
+
weakMapHas.call(x, weakMapHas);
|
|
2183
|
+
} catch (s) {
|
|
2184
|
+
return true;
|
|
2185
|
+
}
|
|
2186
|
+
return x instanceof WeakSet; // core-js workaround, pre-v2.5.0
|
|
2187
|
+
} catch (e) {}
|
|
2188
|
+
return false;
|
|
2189
|
+
}
|
|
2190
|
+
|
|
2191
|
+
function isElement(x) {
|
|
2192
|
+
if (!x || typeof x !== 'object') { return false; }
|
|
2193
|
+
if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) {
|
|
2194
|
+
return true;
|
|
2195
|
+
}
|
|
2196
|
+
return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function';
|
|
2197
|
+
}
|
|
2198
|
+
|
|
2199
|
+
function inspectString(str, opts) {
|
|
2200
|
+
if (str.length > opts.maxStringLength) {
|
|
2201
|
+
var remaining = str.length - opts.maxStringLength;
|
|
2202
|
+
var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');
|
|
2203
|
+
return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;
|
|
2204
|
+
}
|
|
2205
|
+
// eslint-disable-next-line no-control-regex
|
|
2206
|
+
var s = $replace.call($replace.call(str, /(['\\])/g, '\\$1'), /[\x00-\x1f]/g, lowbyte);
|
|
2207
|
+
return wrapQuotes(s, 'single', opts);
|
|
2208
|
+
}
|
|
2209
|
+
|
|
2210
|
+
function lowbyte(c) {
|
|
2211
|
+
var n = c.charCodeAt(0);
|
|
2212
|
+
var x = {
|
|
2213
|
+
8: 'b',
|
|
2214
|
+
9: 't',
|
|
2215
|
+
10: 'n',
|
|
2216
|
+
12: 'f',
|
|
2217
|
+
13: 'r'
|
|
2218
|
+
}[n];
|
|
2219
|
+
if (x) { return '\\' + x; }
|
|
2220
|
+
return '\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16));
|
|
2221
|
+
}
|
|
2222
|
+
|
|
2223
|
+
function markBoxed(str) {
|
|
2224
|
+
return 'Object(' + str + ')';
|
|
2225
|
+
}
|
|
2226
|
+
|
|
2227
|
+
function weakCollectionOf(type) {
|
|
2228
|
+
return type + ' { ? }';
|
|
2229
|
+
}
|
|
2230
|
+
|
|
2231
|
+
function collectionOf(type, size, entries, indent) {
|
|
2232
|
+
var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', ');
|
|
2233
|
+
return type + ' (' + size + ') {' + joinedEntries + '}';
|
|
2234
|
+
}
|
|
2235
|
+
|
|
2236
|
+
function singleLineValues(xs) {
|
|
2237
|
+
for (var i = 0; i < xs.length; i++) {
|
|
2238
|
+
if (indexOf(xs[i], '\n') >= 0) {
|
|
2239
|
+
return false;
|
|
2240
|
+
}
|
|
2241
|
+
}
|
|
2242
|
+
return true;
|
|
2243
|
+
}
|
|
2244
|
+
|
|
2245
|
+
function getIndent(opts, depth) {
|
|
2246
|
+
var baseIndent;
|
|
2247
|
+
if (opts.indent === '\t') {
|
|
2248
|
+
baseIndent = '\t';
|
|
2249
|
+
} else if (typeof opts.indent === 'number' && opts.indent > 0) {
|
|
2250
|
+
baseIndent = $join.call(Array(opts.indent + 1), ' ');
|
|
2251
|
+
} else {
|
|
2252
|
+
return null;
|
|
2253
|
+
}
|
|
2254
|
+
return {
|
|
2255
|
+
base: baseIndent,
|
|
2256
|
+
prev: $join.call(Array(depth + 1), baseIndent)
|
|
2257
|
+
};
|
|
2258
|
+
}
|
|
2259
|
+
|
|
2260
|
+
function indentedJoin(xs, indent) {
|
|
2261
|
+
if (xs.length === 0) { return ''; }
|
|
2262
|
+
var lineJoiner = '\n' + indent.prev + indent.base;
|
|
2263
|
+
return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\n' + indent.prev;
|
|
2264
|
+
}
|
|
2265
|
+
|
|
2266
|
+
function arrObjKeys(obj, inspect) {
|
|
2267
|
+
var isArr = isArray$3(obj);
|
|
2268
|
+
var xs = [];
|
|
2269
|
+
if (isArr) {
|
|
2270
|
+
xs.length = obj.length;
|
|
2271
|
+
for (var i = 0; i < obj.length; i++) {
|
|
2272
|
+
xs[i] = has$3(obj, i) ? inspect(obj[i], obj) : '';
|
|
2273
|
+
}
|
|
2274
|
+
}
|
|
2275
|
+
var syms = typeof gOPS === 'function' ? gOPS(obj) : [];
|
|
2276
|
+
var symMap;
|
|
2277
|
+
if (hasShammedSymbols) {
|
|
2278
|
+
symMap = {};
|
|
2279
|
+
for (var k = 0; k < syms.length; k++) {
|
|
2280
|
+
symMap['$' + syms[k]] = syms[k];
|
|
2281
|
+
}
|
|
2282
|
+
}
|
|
2283
|
+
|
|
2284
|
+
for (var key in obj) { // eslint-disable-line no-restricted-syntax
|
|
2285
|
+
if (!has$3(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
|
|
2286
|
+
if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
|
|
2287
|
+
if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) {
|
|
2288
|
+
// this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section
|
|
2289
|
+
continue; // eslint-disable-line no-restricted-syntax, no-continue
|
|
2290
|
+
} else if ($test.call(/[^\w$]/, key)) {
|
|
2291
|
+
xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));
|
|
2292
|
+
} else {
|
|
2293
|
+
xs.push(key + ': ' + inspect(obj[key], obj));
|
|
2294
|
+
}
|
|
2295
|
+
}
|
|
2296
|
+
if (typeof gOPS === 'function') {
|
|
2297
|
+
for (var j = 0; j < syms.length; j++) {
|
|
2298
|
+
if (isEnumerable.call(obj, syms[j])) {
|
|
2299
|
+
xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj));
|
|
2300
|
+
}
|
|
2301
|
+
}
|
|
2302
|
+
}
|
|
2303
|
+
return xs;
|
|
2304
|
+
}
|
|
2305
|
+
|
|
2306
|
+
var GetIntrinsic = getIntrinsic;
|
|
2307
|
+
var callBound = callBound$1;
|
|
2308
|
+
var inspect = objectInspect;
|
|
2309
|
+
|
|
2310
|
+
var $TypeError = GetIntrinsic('%TypeError%');
|
|
2311
|
+
var $WeakMap = GetIntrinsic('%WeakMap%', true);
|
|
2312
|
+
var $Map = GetIntrinsic('%Map%', true);
|
|
2313
|
+
|
|
2314
|
+
var $weakMapGet = callBound('WeakMap.prototype.get', true);
|
|
2315
|
+
var $weakMapSet = callBound('WeakMap.prototype.set', true);
|
|
2316
|
+
var $weakMapHas = callBound('WeakMap.prototype.has', true);
|
|
2317
|
+
var $mapGet = callBound('Map.prototype.get', true);
|
|
2318
|
+
var $mapSet = callBound('Map.prototype.set', true);
|
|
2319
|
+
var $mapHas = callBound('Map.prototype.has', true);
|
|
2320
|
+
|
|
2321
|
+
/*
|
|
2322
|
+
* This function traverses the list returning the node corresponding to the
|
|
2323
|
+
* given key.
|
|
2324
|
+
*
|
|
2325
|
+
* That node is also moved to the head of the list, so that if it's accessed
|
|
2326
|
+
* again we don't need to traverse the whole list. By doing so, all the recently
|
|
2327
|
+
* used nodes can be accessed relatively quickly.
|
|
2328
|
+
*/
|
|
2329
|
+
var listGetNode = function (list, key) { // eslint-disable-line consistent-return
|
|
2330
|
+
for (var prev = list, curr; (curr = prev.next) !== null; prev = curr) {
|
|
2331
|
+
if (curr.key === key) {
|
|
2332
|
+
prev.next = curr.next;
|
|
2333
|
+
curr.next = list.next;
|
|
2334
|
+
list.next = curr; // eslint-disable-line no-param-reassign
|
|
2335
|
+
return curr;
|
|
2336
|
+
}
|
|
2337
|
+
}
|
|
2338
|
+
};
|
|
2339
|
+
|
|
2340
|
+
var listGet = function (objects, key) {
|
|
2341
|
+
var node = listGetNode(objects, key);
|
|
2342
|
+
return node && node.value;
|
|
2343
|
+
};
|
|
2344
|
+
var listSet = function (objects, key, value) {
|
|
2345
|
+
var node = listGetNode(objects, key);
|
|
2346
|
+
if (node) {
|
|
2347
|
+
node.value = value;
|
|
2348
|
+
} else {
|
|
2349
|
+
// Prepend the new node to the beginning of the list
|
|
2350
|
+
objects.next = { // eslint-disable-line no-param-reassign
|
|
2351
|
+
key: key,
|
|
2352
|
+
next: objects.next,
|
|
2353
|
+
value: value
|
|
2354
|
+
};
|
|
2355
|
+
}
|
|
2356
|
+
};
|
|
2357
|
+
var listHas = function (objects, key) {
|
|
2358
|
+
return !!listGetNode(objects, key);
|
|
2359
|
+
};
|
|
2360
|
+
|
|
2361
|
+
var sideChannel = function getSideChannel() {
|
|
2362
|
+
var $wm;
|
|
2363
|
+
var $m;
|
|
2364
|
+
var $o;
|
|
2365
|
+
var channel = {
|
|
2366
|
+
assert: function (key) {
|
|
2367
|
+
if (!channel.has(key)) {
|
|
2368
|
+
throw new $TypeError('Side channel does not contain ' + inspect(key));
|
|
2369
|
+
}
|
|
2370
|
+
},
|
|
2371
|
+
get: function (key) { // eslint-disable-line consistent-return
|
|
2372
|
+
if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
|
|
2373
|
+
if ($wm) {
|
|
2374
|
+
return $weakMapGet($wm, key);
|
|
2375
|
+
}
|
|
2376
|
+
} else if ($Map) {
|
|
2377
|
+
if ($m) {
|
|
2378
|
+
return $mapGet($m, key);
|
|
2379
|
+
}
|
|
2380
|
+
} else {
|
|
2381
|
+
if ($o) { // eslint-disable-line no-lonely-if
|
|
2382
|
+
return listGet($o, key);
|
|
2383
|
+
}
|
|
2384
|
+
}
|
|
2385
|
+
},
|
|
2386
|
+
has: function (key) {
|
|
2387
|
+
if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
|
|
2388
|
+
if ($wm) {
|
|
2389
|
+
return $weakMapHas($wm, key);
|
|
2390
|
+
}
|
|
2391
|
+
} else if ($Map) {
|
|
2392
|
+
if ($m) {
|
|
2393
|
+
return $mapHas($m, key);
|
|
2394
|
+
}
|
|
2395
|
+
} else {
|
|
2396
|
+
if ($o) { // eslint-disable-line no-lonely-if
|
|
2397
|
+
return listHas($o, key);
|
|
2398
|
+
}
|
|
2399
|
+
}
|
|
2400
|
+
return false;
|
|
2401
|
+
},
|
|
2402
|
+
set: function (key, value) {
|
|
2403
|
+
if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
|
|
2404
|
+
if (!$wm) {
|
|
2405
|
+
$wm = new $WeakMap();
|
|
2406
|
+
}
|
|
2407
|
+
$weakMapSet($wm, key, value);
|
|
2408
|
+
} else if ($Map) {
|
|
2409
|
+
if (!$m) {
|
|
2410
|
+
$m = new $Map();
|
|
2411
|
+
}
|
|
2412
|
+
$mapSet($m, key, value);
|
|
2413
|
+
} else {
|
|
2414
|
+
if (!$o) {
|
|
2415
|
+
/*
|
|
2416
|
+
* Initialize the linked list as an empty node, so that we don't have
|
|
2417
|
+
* to special-case handling of the first node: we can always refer to
|
|
2418
|
+
* it as (previous node).next, instead of something like (list).head
|
|
2419
|
+
*/
|
|
2420
|
+
$o = { key: {}, next: null };
|
|
2421
|
+
}
|
|
2422
|
+
listSet($o, key, value);
|
|
2423
|
+
}
|
|
2424
|
+
}
|
|
2425
|
+
};
|
|
2426
|
+
return channel;
|
|
2427
|
+
};
|
|
2428
|
+
|
|
2429
|
+
var replace = String.prototype.replace;
|
|
2430
|
+
var percentTwenties = /%20/g;
|
|
2431
|
+
|
|
2432
|
+
var Format = {
|
|
2433
|
+
RFC1738: 'RFC1738',
|
|
2434
|
+
RFC3986: 'RFC3986'
|
|
2435
|
+
};
|
|
2436
|
+
|
|
2437
|
+
var formats$3 = {
|
|
2438
|
+
'default': Format.RFC3986,
|
|
2439
|
+
formatters: {
|
|
2440
|
+
RFC1738: function (value) {
|
|
2441
|
+
return replace.call(value, percentTwenties, '+');
|
|
2442
|
+
},
|
|
2443
|
+
RFC3986: function (value) {
|
|
2444
|
+
return String(value);
|
|
2445
|
+
}
|
|
2446
|
+
},
|
|
2447
|
+
RFC1738: Format.RFC1738,
|
|
2448
|
+
RFC3986: Format.RFC3986
|
|
2449
|
+
};
|
|
2450
|
+
|
|
2451
|
+
var formats$2 = formats$3;
|
|
2452
|
+
|
|
2453
|
+
var has$2 = Object.prototype.hasOwnProperty;
|
|
2454
|
+
var isArray$2 = Array.isArray;
|
|
2455
|
+
|
|
2456
|
+
var hexTable = (function () {
|
|
2457
|
+
var array = [];
|
|
2458
|
+
for (var i = 0; i < 256; ++i) {
|
|
2459
|
+
array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());
|
|
2460
|
+
}
|
|
2461
|
+
|
|
2462
|
+
return array;
|
|
2463
|
+
}());
|
|
2464
|
+
|
|
2465
|
+
var compactQueue = function compactQueue(queue) {
|
|
2466
|
+
while (queue.length > 1) {
|
|
2467
|
+
var item = queue.pop();
|
|
2468
|
+
var obj = item.obj[item.prop];
|
|
2469
|
+
|
|
2470
|
+
if (isArray$2(obj)) {
|
|
2471
|
+
var compacted = [];
|
|
2472
|
+
|
|
2473
|
+
for (var j = 0; j < obj.length; ++j) {
|
|
2474
|
+
if (typeof obj[j] !== 'undefined') {
|
|
2475
|
+
compacted.push(obj[j]);
|
|
2476
|
+
}
|
|
2477
|
+
}
|
|
2478
|
+
|
|
2479
|
+
item.obj[item.prop] = compacted;
|
|
2480
|
+
}
|
|
2481
|
+
}
|
|
2482
|
+
};
|
|
2483
|
+
|
|
2484
|
+
var arrayToObject = function arrayToObject(source, options) {
|
|
2485
|
+
var obj = options && options.plainObjects ? Object.create(null) : {};
|
|
2486
|
+
for (var i = 0; i < source.length; ++i) {
|
|
2487
|
+
if (typeof source[i] !== 'undefined') {
|
|
2488
|
+
obj[i] = source[i];
|
|
2489
|
+
}
|
|
2490
|
+
}
|
|
2491
|
+
|
|
2492
|
+
return obj;
|
|
2493
|
+
};
|
|
2494
|
+
|
|
2495
|
+
var merge = function merge(target, source, options) {
|
|
2496
|
+
/* eslint no-param-reassign: 0 */
|
|
2497
|
+
if (!source) {
|
|
2498
|
+
return target;
|
|
2499
|
+
}
|
|
2500
|
+
|
|
2501
|
+
if (typeof source !== 'object') {
|
|
2502
|
+
if (isArray$2(target)) {
|
|
2503
|
+
target.push(source);
|
|
2504
|
+
} else if (target && typeof target === 'object') {
|
|
2505
|
+
if ((options && (options.plainObjects || options.allowPrototypes)) || !has$2.call(Object.prototype, source)) {
|
|
2506
|
+
target[source] = true;
|
|
2507
|
+
}
|
|
2508
|
+
} else {
|
|
2509
|
+
return [target, source];
|
|
2510
|
+
}
|
|
2511
|
+
|
|
2512
|
+
return target;
|
|
2513
|
+
}
|
|
2514
|
+
|
|
2515
|
+
if (!target || typeof target !== 'object') {
|
|
2516
|
+
return [target].concat(source);
|
|
2517
|
+
}
|
|
2518
|
+
|
|
2519
|
+
var mergeTarget = target;
|
|
2520
|
+
if (isArray$2(target) && !isArray$2(source)) {
|
|
2521
|
+
mergeTarget = arrayToObject(target, options);
|
|
2522
|
+
}
|
|
2523
|
+
|
|
2524
|
+
if (isArray$2(target) && isArray$2(source)) {
|
|
2525
|
+
source.forEach(function (item, i) {
|
|
2526
|
+
if (has$2.call(target, i)) {
|
|
2527
|
+
var targetItem = target[i];
|
|
2528
|
+
if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {
|
|
2529
|
+
target[i] = merge(targetItem, item, options);
|
|
2530
|
+
} else {
|
|
2531
|
+
target.push(item);
|
|
2532
|
+
}
|
|
2533
|
+
} else {
|
|
2534
|
+
target[i] = item;
|
|
2535
|
+
}
|
|
2536
|
+
});
|
|
2537
|
+
return target;
|
|
2538
|
+
}
|
|
2539
|
+
|
|
2540
|
+
return Object.keys(source).reduce(function (acc, key) {
|
|
2541
|
+
var value = source[key];
|
|
2542
|
+
|
|
2543
|
+
if (has$2.call(acc, key)) {
|
|
2544
|
+
acc[key] = merge(acc[key], value, options);
|
|
2545
|
+
} else {
|
|
2546
|
+
acc[key] = value;
|
|
2547
|
+
}
|
|
2548
|
+
return acc;
|
|
2549
|
+
}, mergeTarget);
|
|
2550
|
+
};
|
|
2551
|
+
|
|
2552
|
+
var assign = function assignSingleSource(target, source) {
|
|
2553
|
+
return Object.keys(source).reduce(function (acc, key) {
|
|
2554
|
+
acc[key] = source[key];
|
|
2555
|
+
return acc;
|
|
2556
|
+
}, target);
|
|
2557
|
+
};
|
|
2558
|
+
|
|
2559
|
+
var decode = function (str, decoder, charset) {
|
|
2560
|
+
var strWithoutPlus = str.replace(/\+/g, ' ');
|
|
2561
|
+
if (charset === 'iso-8859-1') {
|
|
2562
|
+
// unescape never throws, no try...catch needed:
|
|
2563
|
+
return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);
|
|
2564
|
+
}
|
|
2565
|
+
// utf-8
|
|
2566
|
+
try {
|
|
2567
|
+
return decodeURIComponent(strWithoutPlus);
|
|
2568
|
+
} catch (e) {
|
|
2569
|
+
return strWithoutPlus;
|
|
2570
|
+
}
|
|
2571
|
+
};
|
|
2572
|
+
|
|
2573
|
+
var encode = function encode(str, defaultEncoder, charset, kind, format) {
|
|
2574
|
+
// This code was originally written by Brian White (mscdex) for the io.js core querystring library.
|
|
2575
|
+
// It has been adapted here for stricter adherence to RFC 3986
|
|
2576
|
+
if (str.length === 0) {
|
|
2577
|
+
return str;
|
|
2578
|
+
}
|
|
2579
|
+
|
|
2580
|
+
var string = str;
|
|
2581
|
+
if (typeof str === 'symbol') {
|
|
2582
|
+
string = Symbol.prototype.toString.call(str);
|
|
2583
|
+
} else if (typeof str !== 'string') {
|
|
2584
|
+
string = String(str);
|
|
2585
|
+
}
|
|
2586
|
+
|
|
2587
|
+
if (charset === 'iso-8859-1') {
|
|
2588
|
+
return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {
|
|
2589
|
+
return '%26%23' + parseInt($0.slice(2), 16) + '%3B';
|
|
2590
|
+
});
|
|
2591
|
+
}
|
|
2592
|
+
|
|
2593
|
+
var out = '';
|
|
2594
|
+
for (var i = 0; i < string.length; ++i) {
|
|
2595
|
+
var c = string.charCodeAt(i);
|
|
2596
|
+
|
|
2597
|
+
if (
|
|
2598
|
+
c === 0x2D // -
|
|
2599
|
+
|| c === 0x2E // .
|
|
2600
|
+
|| c === 0x5F // _
|
|
2601
|
+
|| c === 0x7E // ~
|
|
2602
|
+
|| (c >= 0x30 && c <= 0x39) // 0-9
|
|
2603
|
+
|| (c >= 0x41 && c <= 0x5A) // a-z
|
|
2604
|
+
|| (c >= 0x61 && c <= 0x7A) // A-Z
|
|
2605
|
+
|| (format === formats$2.RFC1738 && (c === 0x28 || c === 0x29)) // ( )
|
|
2606
|
+
) {
|
|
2607
|
+
out += string.charAt(i);
|
|
2608
|
+
continue;
|
|
2609
|
+
}
|
|
2610
|
+
|
|
2611
|
+
if (c < 0x80) {
|
|
2612
|
+
out = out + hexTable[c];
|
|
2613
|
+
continue;
|
|
2614
|
+
}
|
|
2615
|
+
|
|
2616
|
+
if (c < 0x800) {
|
|
2617
|
+
out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);
|
|
2618
|
+
continue;
|
|
2619
|
+
}
|
|
2620
|
+
|
|
2621
|
+
if (c < 0xD800 || c >= 0xE000) {
|
|
2622
|
+
out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);
|
|
2623
|
+
continue;
|
|
2624
|
+
}
|
|
2625
|
+
|
|
2626
|
+
i += 1;
|
|
2627
|
+
c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
|
|
2628
|
+
/* eslint operator-linebreak: [2, "before"] */
|
|
2629
|
+
out += hexTable[0xF0 | (c >> 18)]
|
|
2630
|
+
+ hexTable[0x80 | ((c >> 12) & 0x3F)]
|
|
2631
|
+
+ hexTable[0x80 | ((c >> 6) & 0x3F)]
|
|
2632
|
+
+ hexTable[0x80 | (c & 0x3F)];
|
|
2633
|
+
}
|
|
2634
|
+
|
|
2635
|
+
return out;
|
|
2636
|
+
};
|
|
2637
|
+
|
|
2638
|
+
var compact = function compact(value) {
|
|
2639
|
+
var queue = [{ obj: { o: value }, prop: 'o' }];
|
|
2640
|
+
var refs = [];
|
|
2641
|
+
|
|
2642
|
+
for (var i = 0; i < queue.length; ++i) {
|
|
2643
|
+
var item = queue[i];
|
|
2644
|
+
var obj = item.obj[item.prop];
|
|
2645
|
+
|
|
2646
|
+
var keys = Object.keys(obj);
|
|
2647
|
+
for (var j = 0; j < keys.length; ++j) {
|
|
2648
|
+
var key = keys[j];
|
|
2649
|
+
var val = obj[key];
|
|
2650
|
+
if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {
|
|
2651
|
+
queue.push({ obj: obj, prop: key });
|
|
2652
|
+
refs.push(val);
|
|
2653
|
+
}
|
|
2654
|
+
}
|
|
2655
|
+
}
|
|
2656
|
+
|
|
2657
|
+
compactQueue(queue);
|
|
2658
|
+
|
|
2659
|
+
return value;
|
|
2660
|
+
};
|
|
2661
|
+
|
|
2662
|
+
var isRegExp = function isRegExp(obj) {
|
|
2663
|
+
return Object.prototype.toString.call(obj) === '[object RegExp]';
|
|
2664
|
+
};
|
|
2665
|
+
|
|
2666
|
+
var isBuffer = function isBuffer(obj) {
|
|
2667
|
+
if (!obj || typeof obj !== 'object') {
|
|
2668
|
+
return false;
|
|
2669
|
+
}
|
|
2670
|
+
|
|
2671
|
+
return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
|
|
2672
|
+
};
|
|
2673
|
+
|
|
2674
|
+
var combine = function combine(a, b) {
|
|
2675
|
+
return [].concat(a, b);
|
|
2676
|
+
};
|
|
2677
|
+
|
|
2678
|
+
var maybeMap = function maybeMap(val, fn) {
|
|
2679
|
+
if (isArray$2(val)) {
|
|
2680
|
+
var mapped = [];
|
|
2681
|
+
for (var i = 0; i < val.length; i += 1) {
|
|
2682
|
+
mapped.push(fn(val[i]));
|
|
2683
|
+
}
|
|
2684
|
+
return mapped;
|
|
2685
|
+
}
|
|
2686
|
+
return fn(val);
|
|
2687
|
+
};
|
|
2688
|
+
|
|
2689
|
+
var utils$2 = {
|
|
2690
|
+
arrayToObject: arrayToObject,
|
|
2691
|
+
assign: assign,
|
|
2692
|
+
combine: combine,
|
|
2693
|
+
compact: compact,
|
|
2694
|
+
decode: decode,
|
|
2695
|
+
encode: encode,
|
|
2696
|
+
isBuffer: isBuffer,
|
|
2697
|
+
isRegExp: isRegExp,
|
|
2698
|
+
maybeMap: maybeMap,
|
|
2699
|
+
merge: merge
|
|
2700
|
+
};
|
|
2701
|
+
|
|
2702
|
+
var getSideChannel = sideChannel;
|
|
2703
|
+
var utils$1 = utils$2;
|
|
2704
|
+
var formats$1 = formats$3;
|
|
2705
|
+
var has$1 = Object.prototype.hasOwnProperty;
|
|
2706
|
+
|
|
2707
|
+
var arrayPrefixGenerators = {
|
|
2708
|
+
brackets: function brackets(prefix) {
|
|
2709
|
+
return prefix + '[]';
|
|
2710
|
+
},
|
|
2711
|
+
comma: 'comma',
|
|
2712
|
+
indices: function indices(prefix, key) {
|
|
2713
|
+
return prefix + '[' + key + ']';
|
|
2714
|
+
},
|
|
2715
|
+
repeat: function repeat(prefix) {
|
|
2716
|
+
return prefix;
|
|
2717
|
+
}
|
|
2718
|
+
};
|
|
2719
|
+
|
|
2720
|
+
var isArray$1 = Array.isArray;
|
|
2721
|
+
var push = Array.prototype.push;
|
|
2722
|
+
var pushToArray = function (arr, valueOrArray) {
|
|
2723
|
+
push.apply(arr, isArray$1(valueOrArray) ? valueOrArray : [valueOrArray]);
|
|
2724
|
+
};
|
|
2725
|
+
|
|
2726
|
+
var toISO = Date.prototype.toISOString;
|
|
2727
|
+
|
|
2728
|
+
var defaultFormat = formats$1['default'];
|
|
2729
|
+
var defaults$1 = {
|
|
2730
|
+
addQueryPrefix: false,
|
|
2731
|
+
allowDots: false,
|
|
2732
|
+
charset: 'utf-8',
|
|
2733
|
+
charsetSentinel: false,
|
|
2734
|
+
delimiter: '&',
|
|
2735
|
+
encode: true,
|
|
2736
|
+
encoder: utils$1.encode,
|
|
2737
|
+
encodeValuesOnly: false,
|
|
2738
|
+
format: defaultFormat,
|
|
2739
|
+
formatter: formats$1.formatters[defaultFormat],
|
|
2740
|
+
// deprecated
|
|
2741
|
+
indices: false,
|
|
2742
|
+
serializeDate: function serializeDate(date) {
|
|
2743
|
+
return toISO.call(date);
|
|
2744
|
+
},
|
|
2745
|
+
skipNulls: false,
|
|
2746
|
+
strictNullHandling: false
|
|
2747
|
+
};
|
|
2748
|
+
|
|
2749
|
+
var isNonNullishPrimitive = function isNonNullishPrimitive(v) {
|
|
2750
|
+
return typeof v === 'string'
|
|
2751
|
+
|| typeof v === 'number'
|
|
2752
|
+
|| typeof v === 'boolean'
|
|
2753
|
+
|| typeof v === 'symbol'
|
|
2754
|
+
|| typeof v === 'bigint';
|
|
2755
|
+
};
|
|
2756
|
+
|
|
2757
|
+
var sentinel = {};
|
|
2758
|
+
|
|
2759
|
+
var stringify$1 = function stringify(
|
|
2760
|
+
object,
|
|
2761
|
+
prefix,
|
|
2762
|
+
generateArrayPrefix,
|
|
2763
|
+
commaRoundTrip,
|
|
2764
|
+
strictNullHandling,
|
|
2765
|
+
skipNulls,
|
|
2766
|
+
encoder,
|
|
2767
|
+
filter,
|
|
2768
|
+
sort,
|
|
2769
|
+
allowDots,
|
|
2770
|
+
serializeDate,
|
|
2771
|
+
format,
|
|
2772
|
+
formatter,
|
|
2773
|
+
encodeValuesOnly,
|
|
2774
|
+
charset,
|
|
2775
|
+
sideChannel
|
|
2776
|
+
) {
|
|
2777
|
+
var obj = object;
|
|
2778
|
+
|
|
2779
|
+
var tmpSc = sideChannel;
|
|
2780
|
+
var step = 0;
|
|
2781
|
+
var findFlag = false;
|
|
2782
|
+
while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) {
|
|
2783
|
+
// Where object last appeared in the ref tree
|
|
2784
|
+
var pos = tmpSc.get(object);
|
|
2785
|
+
step += 1;
|
|
2786
|
+
if (typeof pos !== 'undefined') {
|
|
2787
|
+
if (pos === step) {
|
|
2788
|
+
throw new RangeError('Cyclic object value');
|
|
2789
|
+
} else {
|
|
2790
|
+
findFlag = true; // Break while
|
|
2791
|
+
}
|
|
2792
|
+
}
|
|
2793
|
+
if (typeof tmpSc.get(sentinel) === 'undefined') {
|
|
2794
|
+
step = 0;
|
|
2795
|
+
}
|
|
2796
|
+
}
|
|
2797
|
+
|
|
2798
|
+
if (typeof filter === 'function') {
|
|
2799
|
+
obj = filter(prefix, obj);
|
|
2800
|
+
} else if (obj instanceof Date) {
|
|
2801
|
+
obj = serializeDate(obj);
|
|
2802
|
+
} else if (generateArrayPrefix === 'comma' && isArray$1(obj)) {
|
|
2803
|
+
obj = utils$1.maybeMap(obj, function (value) {
|
|
2804
|
+
if (value instanceof Date) {
|
|
2805
|
+
return serializeDate(value);
|
|
2806
|
+
}
|
|
2807
|
+
return value;
|
|
2808
|
+
});
|
|
2809
|
+
}
|
|
2810
|
+
|
|
2811
|
+
if (obj === null) {
|
|
2812
|
+
if (strictNullHandling) {
|
|
2813
|
+
return encoder && !encodeValuesOnly ? encoder(prefix, defaults$1.encoder, charset, 'key', format) : prefix;
|
|
2814
|
+
}
|
|
2815
|
+
|
|
2816
|
+
obj = '';
|
|
2817
|
+
}
|
|
2818
|
+
|
|
2819
|
+
if (isNonNullishPrimitive(obj) || utils$1.isBuffer(obj)) {
|
|
2820
|
+
if (encoder) {
|
|
2821
|
+
var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults$1.encoder, charset, 'key', format);
|
|
2822
|
+
return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults$1.encoder, charset, 'value', format))];
|
|
2823
|
+
}
|
|
2824
|
+
return [formatter(prefix) + '=' + formatter(String(obj))];
|
|
2825
|
+
}
|
|
2826
|
+
|
|
2827
|
+
var values = [];
|
|
2828
|
+
|
|
2829
|
+
if (typeof obj === 'undefined') {
|
|
2830
|
+
return values;
|
|
2831
|
+
}
|
|
2832
|
+
|
|
2833
|
+
var objKeys;
|
|
2834
|
+
if (generateArrayPrefix === 'comma' && isArray$1(obj)) {
|
|
2835
|
+
// we need to join elements in
|
|
2836
|
+
if (encodeValuesOnly && encoder) {
|
|
2837
|
+
obj = utils$1.maybeMap(obj, encoder);
|
|
2838
|
+
}
|
|
2839
|
+
objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];
|
|
2840
|
+
} else if (isArray$1(filter)) {
|
|
2841
|
+
objKeys = filter;
|
|
2842
|
+
} else {
|
|
2843
|
+
var keys = Object.keys(obj);
|
|
2844
|
+
objKeys = sort ? keys.sort(sort) : keys;
|
|
2845
|
+
}
|
|
2846
|
+
|
|
2847
|
+
var adjustedPrefix = commaRoundTrip && isArray$1(obj) && obj.length === 1 ? prefix + '[]' : prefix;
|
|
2848
|
+
|
|
2849
|
+
for (var j = 0; j < objKeys.length; ++j) {
|
|
2850
|
+
var key = objKeys[j];
|
|
2851
|
+
var value = typeof key === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key];
|
|
2852
|
+
|
|
2853
|
+
if (skipNulls && value === null) {
|
|
2854
|
+
continue;
|
|
2855
|
+
}
|
|
2856
|
+
|
|
2857
|
+
var keyPrefix = isArray$1(obj)
|
|
2858
|
+
? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, key) : adjustedPrefix
|
|
2859
|
+
: adjustedPrefix + (allowDots ? '.' + key : '[' + key + ']');
|
|
2860
|
+
|
|
2861
|
+
sideChannel.set(object, step);
|
|
2862
|
+
var valueSideChannel = getSideChannel();
|
|
2863
|
+
valueSideChannel.set(sentinel, sideChannel);
|
|
2864
|
+
pushToArray(values, stringify(
|
|
2865
|
+
value,
|
|
2866
|
+
keyPrefix,
|
|
2867
|
+
generateArrayPrefix,
|
|
2868
|
+
commaRoundTrip,
|
|
2869
|
+
strictNullHandling,
|
|
2870
|
+
skipNulls,
|
|
2871
|
+
generateArrayPrefix === 'comma' && encodeValuesOnly && isArray$1(obj) ? null : encoder,
|
|
2872
|
+
filter,
|
|
2873
|
+
sort,
|
|
2874
|
+
allowDots,
|
|
2875
|
+
serializeDate,
|
|
2876
|
+
format,
|
|
2877
|
+
formatter,
|
|
2878
|
+
encodeValuesOnly,
|
|
2879
|
+
charset,
|
|
2880
|
+
valueSideChannel
|
|
2881
|
+
));
|
|
2882
|
+
}
|
|
2883
|
+
|
|
2884
|
+
return values;
|
|
1136
2885
|
};
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
2886
|
+
|
|
2887
|
+
var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
|
|
2888
|
+
if (!opts) {
|
|
2889
|
+
return defaults$1;
|
|
2890
|
+
}
|
|
2891
|
+
|
|
2892
|
+
if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {
|
|
2893
|
+
throw new TypeError('Encoder has to be a function.');
|
|
2894
|
+
}
|
|
2895
|
+
|
|
2896
|
+
var charset = opts.charset || defaults$1.charset;
|
|
2897
|
+
if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
|
|
2898
|
+
throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
|
|
2899
|
+
}
|
|
2900
|
+
|
|
2901
|
+
var format = formats$1['default'];
|
|
2902
|
+
if (typeof opts.format !== 'undefined') {
|
|
2903
|
+
if (!has$1.call(formats$1.formatters, opts.format)) {
|
|
2904
|
+
throw new TypeError('Unknown format option provided.');
|
|
2905
|
+
}
|
|
2906
|
+
format = opts.format;
|
|
2907
|
+
}
|
|
2908
|
+
var formatter = formats$1.formatters[format];
|
|
2909
|
+
|
|
2910
|
+
var filter = defaults$1.filter;
|
|
2911
|
+
if (typeof opts.filter === 'function' || isArray$1(opts.filter)) {
|
|
2912
|
+
filter = opts.filter;
|
|
2913
|
+
}
|
|
2914
|
+
|
|
2915
|
+
return {
|
|
2916
|
+
addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults$1.addQueryPrefix,
|
|
2917
|
+
allowDots: typeof opts.allowDots === 'undefined' ? defaults$1.allowDots : !!opts.allowDots,
|
|
2918
|
+
charset: charset,
|
|
2919
|
+
charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults$1.charsetSentinel,
|
|
2920
|
+
delimiter: typeof opts.delimiter === 'undefined' ? defaults$1.delimiter : opts.delimiter,
|
|
2921
|
+
encode: typeof opts.encode === 'boolean' ? opts.encode : defaults$1.encode,
|
|
2922
|
+
encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults$1.encoder,
|
|
2923
|
+
encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults$1.encodeValuesOnly,
|
|
2924
|
+
filter: filter,
|
|
2925
|
+
format: format,
|
|
2926
|
+
formatter: formatter,
|
|
2927
|
+
serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults$1.serializeDate,
|
|
2928
|
+
skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults$1.skipNulls,
|
|
2929
|
+
sort: typeof opts.sort === 'function' ? opts.sort : null,
|
|
2930
|
+
strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults$1.strictNullHandling
|
|
2931
|
+
};
|
|
1153
2932
|
};
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
2933
|
+
|
|
2934
|
+
var stringify_1 = function (object, opts) {
|
|
2935
|
+
var obj = object;
|
|
2936
|
+
var options = normalizeStringifyOptions(opts);
|
|
2937
|
+
|
|
2938
|
+
var objKeys;
|
|
2939
|
+
var filter;
|
|
2940
|
+
|
|
2941
|
+
if (typeof options.filter === 'function') {
|
|
2942
|
+
filter = options.filter;
|
|
2943
|
+
obj = filter('', obj);
|
|
2944
|
+
} else if (isArray$1(options.filter)) {
|
|
2945
|
+
filter = options.filter;
|
|
2946
|
+
objKeys = filter;
|
|
2947
|
+
}
|
|
2948
|
+
|
|
2949
|
+
var keys = [];
|
|
2950
|
+
|
|
2951
|
+
if (typeof obj !== 'object' || obj === null) {
|
|
2952
|
+
return '';
|
|
2953
|
+
}
|
|
2954
|
+
|
|
2955
|
+
var arrayFormat;
|
|
2956
|
+
if (opts && opts.arrayFormat in arrayPrefixGenerators) {
|
|
2957
|
+
arrayFormat = opts.arrayFormat;
|
|
2958
|
+
} else if (opts && 'indices' in opts) {
|
|
2959
|
+
arrayFormat = opts.indices ? 'indices' : 'repeat';
|
|
2960
|
+
} else {
|
|
2961
|
+
arrayFormat = 'indices';
|
|
2962
|
+
}
|
|
2963
|
+
|
|
2964
|
+
var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
|
|
2965
|
+
if (opts && 'commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {
|
|
2966
|
+
throw new TypeError('`commaRoundTrip` must be a boolean, or absent');
|
|
2967
|
+
}
|
|
2968
|
+
var commaRoundTrip = generateArrayPrefix === 'comma' && opts && opts.commaRoundTrip;
|
|
2969
|
+
|
|
2970
|
+
if (!objKeys) {
|
|
2971
|
+
objKeys = Object.keys(obj);
|
|
2972
|
+
}
|
|
2973
|
+
|
|
2974
|
+
if (options.sort) {
|
|
2975
|
+
objKeys.sort(options.sort);
|
|
2976
|
+
}
|
|
2977
|
+
|
|
2978
|
+
var sideChannel = getSideChannel();
|
|
2979
|
+
for (var i = 0; i < objKeys.length; ++i) {
|
|
2980
|
+
var key = objKeys[i];
|
|
2981
|
+
|
|
2982
|
+
if (options.skipNulls && obj[key] === null) {
|
|
2983
|
+
continue;
|
|
2984
|
+
}
|
|
2985
|
+
pushToArray(keys, stringify$1(
|
|
2986
|
+
obj[key],
|
|
2987
|
+
key,
|
|
2988
|
+
generateArrayPrefix,
|
|
2989
|
+
commaRoundTrip,
|
|
2990
|
+
options.strictNullHandling,
|
|
2991
|
+
options.skipNulls,
|
|
2992
|
+
options.encode ? options.encoder : null,
|
|
2993
|
+
options.filter,
|
|
2994
|
+
options.sort,
|
|
2995
|
+
options.allowDots,
|
|
2996
|
+
options.serializeDate,
|
|
2997
|
+
options.format,
|
|
2998
|
+
options.formatter,
|
|
2999
|
+
options.encodeValuesOnly,
|
|
3000
|
+
options.charset,
|
|
3001
|
+
sideChannel
|
|
3002
|
+
));
|
|
3003
|
+
}
|
|
3004
|
+
|
|
3005
|
+
var joined = keys.join(options.delimiter);
|
|
3006
|
+
var prefix = options.addQueryPrefix === true ? '?' : '';
|
|
3007
|
+
|
|
3008
|
+
if (options.charsetSentinel) {
|
|
3009
|
+
if (options.charset === 'iso-8859-1') {
|
|
3010
|
+
// encodeURIComponent('✓'), the "numeric entity" representation of a checkmark
|
|
3011
|
+
prefix += 'utf8=%26%2310003%3B&';
|
|
3012
|
+
} else {
|
|
3013
|
+
// encodeURIComponent('✓')
|
|
3014
|
+
prefix += 'utf8=%E2%9C%93&';
|
|
3015
|
+
}
|
|
3016
|
+
}
|
|
3017
|
+
|
|
3018
|
+
return joined.length > 0 ? prefix + joined : '';
|
|
1165
3019
|
};
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
3020
|
+
|
|
3021
|
+
var utils = utils$2;
|
|
3022
|
+
|
|
3023
|
+
var has = Object.prototype.hasOwnProperty;
|
|
3024
|
+
var isArray = Array.isArray;
|
|
3025
|
+
|
|
3026
|
+
var defaults = {
|
|
3027
|
+
allowDots: false,
|
|
3028
|
+
allowPrototypes: false,
|
|
3029
|
+
allowSparse: false,
|
|
3030
|
+
arrayLimit: 20,
|
|
3031
|
+
charset: 'utf-8',
|
|
3032
|
+
charsetSentinel: false,
|
|
3033
|
+
comma: false,
|
|
3034
|
+
decoder: utils.decode,
|
|
3035
|
+
delimiter: '&',
|
|
3036
|
+
depth: 5,
|
|
3037
|
+
ignoreQueryPrefix: false,
|
|
3038
|
+
interpretNumericEntities: false,
|
|
3039
|
+
parameterLimit: 1000,
|
|
3040
|
+
parseArrays: true,
|
|
3041
|
+
plainObjects: false,
|
|
3042
|
+
strictNullHandling: false
|
|
1181
3043
|
};
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
field: field,
|
|
1187
|
-
fieldValues: fieldValues
|
|
3044
|
+
|
|
3045
|
+
var interpretNumericEntities = function (str) {
|
|
3046
|
+
return str.replace(/&#(\d+);/g, function ($0, numberStr) {
|
|
3047
|
+
return String.fromCharCode(parseInt(numberStr, 10));
|
|
1188
3048
|
});
|
|
1189
|
-
});
|
|
1190
3049
|
};
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
3050
|
+
|
|
3051
|
+
var parseArrayValue = function (val, options) {
|
|
3052
|
+
if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {
|
|
3053
|
+
return val.split(',');
|
|
3054
|
+
}
|
|
3055
|
+
|
|
3056
|
+
return val;
|
|
1196
3057
|
};
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
3058
|
+
|
|
3059
|
+
// This is what browsers will submit when the ✓ character occurs in an
|
|
3060
|
+
// application/x-www-form-urlencoded body and the encoding of the page containing
|
|
3061
|
+
// the form is iso-8859-1, or when the submitted form has an accept-charset
|
|
3062
|
+
// attribute of iso-8859-1. Presumably also with other charsets that do not contain
|
|
3063
|
+
// the ✓ character, such as us-ascii.
|
|
3064
|
+
var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('✓')
|
|
3065
|
+
|
|
3066
|
+
// These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.
|
|
3067
|
+
var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')
|
|
3068
|
+
|
|
3069
|
+
var parseValues = function parseQueryStringValues(str, options) {
|
|
3070
|
+
var obj = { __proto__: null };
|
|
3071
|
+
|
|
3072
|
+
var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
|
|
3073
|
+
var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
|
|
3074
|
+
var parts = cleanStr.split(options.delimiter, limit);
|
|
3075
|
+
var skipIndex = -1; // Keep track of where the utf8 sentinel was found
|
|
3076
|
+
var i;
|
|
3077
|
+
|
|
3078
|
+
var charset = options.charset;
|
|
3079
|
+
if (options.charsetSentinel) {
|
|
3080
|
+
for (i = 0; i < parts.length; ++i) {
|
|
3081
|
+
if (parts[i].indexOf('utf8=') === 0) {
|
|
3082
|
+
if (parts[i] === charsetSentinel) {
|
|
3083
|
+
charset = 'utf-8';
|
|
3084
|
+
} else if (parts[i] === isoSentinel) {
|
|
3085
|
+
charset = 'iso-8859-1';
|
|
3086
|
+
}
|
|
3087
|
+
skipIndex = i;
|
|
3088
|
+
i = parts.length; // The eslint settings do not allow break;
|
|
3089
|
+
}
|
|
3090
|
+
}
|
|
3091
|
+
}
|
|
3092
|
+
|
|
3093
|
+
for (i = 0; i < parts.length; ++i) {
|
|
3094
|
+
if (i === skipIndex) {
|
|
3095
|
+
continue;
|
|
3096
|
+
}
|
|
3097
|
+
var part = parts[i];
|
|
3098
|
+
|
|
3099
|
+
var bracketEqualsPos = part.indexOf(']=');
|
|
3100
|
+
var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;
|
|
3101
|
+
|
|
3102
|
+
var key, val;
|
|
3103
|
+
if (pos === -1) {
|
|
3104
|
+
key = options.decoder(part, defaults.decoder, charset, 'key');
|
|
3105
|
+
val = options.strictNullHandling ? null : '';
|
|
3106
|
+
} else {
|
|
3107
|
+
key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');
|
|
3108
|
+
val = utils.maybeMap(
|
|
3109
|
+
parseArrayValue(part.slice(pos + 1), options),
|
|
3110
|
+
function (encodedVal) {
|
|
3111
|
+
return options.decoder(encodedVal, defaults.decoder, charset, 'value');
|
|
3112
|
+
}
|
|
3113
|
+
);
|
|
3114
|
+
}
|
|
3115
|
+
|
|
3116
|
+
if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {
|
|
3117
|
+
val = interpretNumericEntities(val);
|
|
3118
|
+
}
|
|
3119
|
+
|
|
3120
|
+
if (part.indexOf('[]=') > -1) {
|
|
3121
|
+
val = isArray(val) ? [val] : val;
|
|
3122
|
+
}
|
|
3123
|
+
|
|
3124
|
+
if (has.call(obj, key)) {
|
|
3125
|
+
obj[key] = utils.combine(obj[key], val);
|
|
3126
|
+
} else {
|
|
3127
|
+
obj[key] = val;
|
|
3128
|
+
}
|
|
3129
|
+
}
|
|
3130
|
+
|
|
3131
|
+
return obj;
|
|
3132
|
+
};
|
|
3133
|
+
|
|
3134
|
+
var parseObject = function (chain, val, options, valuesParsed) {
|
|
3135
|
+
var leaf = valuesParsed ? val : parseArrayValue(val, options);
|
|
3136
|
+
|
|
3137
|
+
for (var i = chain.length - 1; i >= 0; --i) {
|
|
3138
|
+
var obj;
|
|
3139
|
+
var root = chain[i];
|
|
3140
|
+
|
|
3141
|
+
if (root === '[]' && options.parseArrays) {
|
|
3142
|
+
obj = [].concat(leaf);
|
|
3143
|
+
} else {
|
|
3144
|
+
obj = options.plainObjects ? Object.create(null) : {};
|
|
3145
|
+
var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
|
|
3146
|
+
var index = parseInt(cleanRoot, 10);
|
|
3147
|
+
if (!options.parseArrays && cleanRoot === '') {
|
|
3148
|
+
obj = { 0: leaf };
|
|
3149
|
+
} else if (
|
|
3150
|
+
!isNaN(index)
|
|
3151
|
+
&& root !== cleanRoot
|
|
3152
|
+
&& String(index) === cleanRoot
|
|
3153
|
+
&& index >= 0
|
|
3154
|
+
&& (options.parseArrays && index <= options.arrayLimit)
|
|
3155
|
+
) {
|
|
3156
|
+
obj = [];
|
|
3157
|
+
obj[index] = leaf;
|
|
3158
|
+
} else if (cleanRoot !== '__proto__') {
|
|
3159
|
+
obj[cleanRoot] = leaf;
|
|
3160
|
+
}
|
|
3161
|
+
}
|
|
3162
|
+
|
|
3163
|
+
leaf = obj;
|
|
3164
|
+
}
|
|
3165
|
+
|
|
3166
|
+
return leaf;
|
|
1201
3167
|
};
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
3168
|
+
|
|
3169
|
+
var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
|
|
3170
|
+
if (!givenKey) {
|
|
3171
|
+
return;
|
|
3172
|
+
}
|
|
3173
|
+
|
|
3174
|
+
// Transform dot notation to bracket notation
|
|
3175
|
+
var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
|
|
3176
|
+
|
|
3177
|
+
// The regex chunks
|
|
3178
|
+
|
|
3179
|
+
var brackets = /(\[[^[\]]*])/;
|
|
3180
|
+
var child = /(\[[^[\]]*])/g;
|
|
3181
|
+
|
|
3182
|
+
// Get the parent
|
|
3183
|
+
|
|
3184
|
+
var segment = options.depth > 0 && brackets.exec(key);
|
|
3185
|
+
var parent = segment ? key.slice(0, segment.index) : key;
|
|
3186
|
+
|
|
3187
|
+
// Stash the parent if it exists
|
|
3188
|
+
|
|
3189
|
+
var keys = [];
|
|
3190
|
+
if (parent) {
|
|
3191
|
+
// If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties
|
|
3192
|
+
if (!options.plainObjects && has.call(Object.prototype, parent)) {
|
|
3193
|
+
if (!options.allowPrototypes) {
|
|
3194
|
+
return;
|
|
3195
|
+
}
|
|
3196
|
+
}
|
|
3197
|
+
|
|
3198
|
+
keys.push(parent);
|
|
3199
|
+
}
|
|
3200
|
+
|
|
3201
|
+
// Loop through children appending to the array until we hit depth
|
|
3202
|
+
|
|
3203
|
+
var i = 0;
|
|
3204
|
+
while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {
|
|
3205
|
+
i += 1;
|
|
3206
|
+
if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
|
|
3207
|
+
if (!options.allowPrototypes) {
|
|
3208
|
+
return;
|
|
3209
|
+
}
|
|
3210
|
+
}
|
|
3211
|
+
keys.push(segment[1]);
|
|
3212
|
+
}
|
|
3213
|
+
|
|
3214
|
+
// If there's a remainder, just add whatever is left
|
|
3215
|
+
|
|
3216
|
+
if (segment) {
|
|
3217
|
+
keys.push('[' + key.slice(segment.index) + ']');
|
|
3218
|
+
}
|
|
3219
|
+
|
|
3220
|
+
return parseObject(keys, val, options, valuesParsed);
|
|
1207
3221
|
};
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
3222
|
+
|
|
3223
|
+
var normalizeParseOptions = function normalizeParseOptions(opts) {
|
|
3224
|
+
if (!opts) {
|
|
3225
|
+
return defaults;
|
|
3226
|
+
}
|
|
3227
|
+
|
|
3228
|
+
if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') {
|
|
3229
|
+
throw new TypeError('Decoder has to be a function.');
|
|
3230
|
+
}
|
|
3231
|
+
|
|
3232
|
+
if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
|
|
3233
|
+
throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
|
|
3234
|
+
}
|
|
3235
|
+
var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;
|
|
3236
|
+
|
|
3237
|
+
return {
|
|
3238
|
+
allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,
|
|
3239
|
+
allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,
|
|
3240
|
+
allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse,
|
|
3241
|
+
arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,
|
|
3242
|
+
charset: charset,
|
|
3243
|
+
charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
|
|
3244
|
+
comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,
|
|
3245
|
+
decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,
|
|
3246
|
+
delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,
|
|
3247
|
+
// eslint-disable-next-line no-implicit-coercion, no-extra-parens
|
|
3248
|
+
depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,
|
|
3249
|
+
ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
|
|
3250
|
+
interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,
|
|
3251
|
+
parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,
|
|
3252
|
+
parseArrays: opts.parseArrays !== false,
|
|
3253
|
+
plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,
|
|
3254
|
+
strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling
|
|
3255
|
+
};
|
|
1211
3256
|
};
|
|
1212
3257
|
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
customComponents = _ref$customComponents === void 0 ? {} : _ref$customComponents,
|
|
1219
|
-
fields = _ref.fields,
|
|
1220
|
-
formRef = _ref.formRef,
|
|
1221
|
-
disabled = _ref.disabled,
|
|
1222
|
-
isRequiredColumnName = _ref.isRequiredColumnName;
|
|
1223
|
-
return getNonSystemFields(fields).map(function (field) {
|
|
1224
|
-
var Field = getFieldInput({
|
|
1225
|
-
field: field,
|
|
1226
|
-
customComponents: customComponents
|
|
1227
|
-
});
|
|
1228
|
-
if (Field) {
|
|
1229
|
-
return /*#__PURE__*/React.createElement(Field, _extends({
|
|
1230
|
-
key: field.id
|
|
1231
|
-
}, _objectSpread$e(_objectSpread$e({}, field), {}, {
|
|
1232
|
-
disabled: disabled,
|
|
1233
|
-
formRef: formRef,
|
|
1234
|
-
isRequiredColumnName: isRequiredColumnName
|
|
1235
|
-
})));
|
|
3258
|
+
var parse$1 = function (str, opts) {
|
|
3259
|
+
var options = normalizeParseOptions(opts);
|
|
3260
|
+
|
|
3261
|
+
if (str === '' || str === null || typeof str === 'undefined') {
|
|
3262
|
+
return options.plainObjects ? Object.create(null) : {};
|
|
1236
3263
|
}
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
3264
|
+
|
|
3265
|
+
var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
|
|
3266
|
+
var obj = options.plainObjects ? Object.create(null) : {};
|
|
3267
|
+
|
|
3268
|
+
// Iterate over the keys and setup the new object
|
|
3269
|
+
|
|
3270
|
+
var keys = Object.keys(tempObj);
|
|
3271
|
+
for (var i = 0; i < keys.length; ++i) {
|
|
3272
|
+
var key = keys[i];
|
|
3273
|
+
var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string');
|
|
3274
|
+
obj = utils.merge(obj, newObj, options);
|
|
3275
|
+
}
|
|
3276
|
+
|
|
3277
|
+
if (options.allowSparse === true) {
|
|
3278
|
+
return obj;
|
|
3279
|
+
}
|
|
3280
|
+
|
|
3281
|
+
return utils.compact(obj);
|
|
3282
|
+
};
|
|
3283
|
+
|
|
3284
|
+
var stringify = stringify_1;
|
|
3285
|
+
var parse = parse$1;
|
|
3286
|
+
var formats = formats$3;
|
|
3287
|
+
|
|
3288
|
+
var lib = {
|
|
3289
|
+
formats: formats,
|
|
3290
|
+
parse: parse,
|
|
3291
|
+
stringify: stringify
|
|
3292
|
+
};
|
|
1243
3293
|
|
|
1244
3294
|
var NEETO_FIELDS_URL = "/neeto_fields_engine/api/v1";
|
|
1245
3295
|
var FIELDS_URL = "".concat(NEETO_FIELDS_URL, "/fields");
|
|
@@ -1251,8 +3301,8 @@ var FIELDS_REORDER_URL = "".concat(FIELDS_URL, "/reorder");
|
|
|
1251
3301
|
var CONFIGS_URL = "".concat(NEETO_FIELDS_URL, "/configs");
|
|
1252
3302
|
var INFO_ICON_SIZE = 16;
|
|
1253
3303
|
|
|
1254
|
-
function ownKeys$d(
|
|
1255
|
-
function _objectSpread$d(
|
|
3304
|
+
function ownKeys$d(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3305
|
+
function _objectSpread$d(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$d(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$d(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1256
3306
|
var fieldUrl = function fieldUrl(fieldId) {
|
|
1257
3307
|
return buildUrl(FIELD_URL, {
|
|
1258
3308
|
fieldId: fieldId
|
|
@@ -1267,7 +3317,7 @@ var fetch$1 = function fetch(_ref) {
|
|
|
1267
3317
|
var resourceType = _ref.resourceType,
|
|
1268
3318
|
ownerId = _ref.ownerId,
|
|
1269
3319
|
state = _ref.state,
|
|
1270
|
-
|
|
3320
|
+
filters = _ref.filters,
|
|
1271
3321
|
_ref$pageProps = _ref.pageProps,
|
|
1272
3322
|
pageProps = _ref$pageProps === void 0 ? {} : _ref$pageProps;
|
|
1273
3323
|
return axios.get(FIELDS_URL, {
|
|
@@ -1275,8 +3325,13 @@ var fetch$1 = function fetch(_ref) {
|
|
|
1275
3325
|
resourceType: resourceType,
|
|
1276
3326
|
ownerId: ownerId,
|
|
1277
3327
|
state: state,
|
|
1278
|
-
|
|
1279
|
-
}, pageProps)
|
|
3328
|
+
filters: filters
|
|
3329
|
+
}, pageProps),
|
|
3330
|
+
paramsSerializer: function paramsSerializer(params) {
|
|
3331
|
+
return lib.stringify(params, {
|
|
3332
|
+
arrayFormat: "brackets"
|
|
3333
|
+
});
|
|
3334
|
+
}
|
|
1280
3335
|
});
|
|
1281
3336
|
};
|
|
1282
3337
|
var create$1 = function create(payload) {
|
|
@@ -1336,8 +3391,8 @@ var QUERY_KEYS = {
|
|
|
1336
3391
|
var DEFAULT_STALE_TIME = 3600000; // 1 hour
|
|
1337
3392
|
|
|
1338
3393
|
var _excluded$4 = ["prefixQueryKeys"];
|
|
1339
|
-
function ownKeys$c(
|
|
1340
|
-
function _objectSpread$c(
|
|
3394
|
+
function ownKeys$c(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3395
|
+
function _objectSpread$c(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$c(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$c(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1341
3396
|
var FIELDS = QUERY_KEYS.FIELDS,
|
|
1342
3397
|
DEPENDENCIES = QUERY_KEYS.DEPENDENCIES;
|
|
1343
3398
|
var useFetchFields = function useFetchFields(_ref, options) {
|
|
@@ -1392,8 +3447,8 @@ var useReorderFields = function useReorderFields() {
|
|
|
1392
3447
|
});
|
|
1393
3448
|
};
|
|
1394
3449
|
|
|
1395
|
-
function ownKeys$b(
|
|
1396
|
-
function _objectSpread$b(
|
|
3450
|
+
function ownKeys$b(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3451
|
+
function _objectSpread$b(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$b(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$b(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1397
3452
|
var arrangeOptionsDisplayOrder = function arrangeOptionsDisplayOrder(options) {
|
|
1398
3453
|
return options.map(function (option, index) {
|
|
1399
3454
|
return _objectSpread$b(_objectSpread$b({}, option), {}, {
|
|
@@ -1629,12 +3684,23 @@ var AdditionalInputs = function AdditionalInputs() {
|
|
|
1629
3684
|
var addOption = function addOption(arrayHelpers) {
|
|
1630
3685
|
return arrayHelpers.push(getDefaultOption());
|
|
1631
3686
|
};
|
|
3687
|
+
var handleKeyDown = function handleKeyDown(event, arrayHelpers) {
|
|
3688
|
+
var _inputs;
|
|
3689
|
+
if (event.key !== "Enter" || isMetaKeyPressed(event)) return;
|
|
3690
|
+
var form = event.target.form;
|
|
3691
|
+
var inputs = _toConsumableArray(form.querySelectorAll("#neeto-fields-dropdown-options-wrapper input"));
|
|
3692
|
+
var currentIndex = inputs.indexOf(event.target);
|
|
3693
|
+
currentIndex >= inputs.length - 1 ? addOption(arrayHelpers) : (_inputs = inputs[currentIndex + 1]) === null || _inputs === void 0 ? void 0 : _inputs.focus();
|
|
3694
|
+
event.preventDefault();
|
|
3695
|
+
event.stopPropagation();
|
|
3696
|
+
};
|
|
1632
3697
|
if (isDropdown(kind.value)) {
|
|
1633
3698
|
return /*#__PURE__*/React.createElement(FieldArray, {
|
|
1634
3699
|
name: "data"
|
|
1635
3700
|
}, function (arrayHelpers) {
|
|
1636
3701
|
return /*#__PURE__*/React.createElement("div", {
|
|
1637
|
-
className: "flex w-full flex-col gap-y-4"
|
|
3702
|
+
className: "flex w-full flex-col gap-y-4",
|
|
3703
|
+
id: "neeto-fields-dropdown-options-wrapper"
|
|
1638
3704
|
}, /*#__PURE__*/React.createElement(Label, {
|
|
1639
3705
|
required: true
|
|
1640
3706
|
}, t("neetoFields.titles.dropdownOptions")), isNotEmpty(options) && Array.isArray(options) && options.map(function (_, index) {
|
|
@@ -1654,7 +3720,10 @@ var AdditionalInputs = function AdditionalInputs() {
|
|
|
1654
3720
|
onClick: function onClick() {
|
|
1655
3721
|
return removeOption(arrayHelpers, index);
|
|
1656
3722
|
}
|
|
1657
|
-
})
|
|
3723
|
+
}),
|
|
3724
|
+
onKeyDown: function onKeyDown(event) {
|
|
3725
|
+
return handleKeyDown(event, arrayHelpers);
|
|
3726
|
+
}
|
|
1658
3727
|
})));
|
|
1659
3728
|
}), /*#__PURE__*/React.createElement(Button$1, {
|
|
1660
3729
|
fullWidth: true,
|
|
@@ -1744,8 +3813,8 @@ var FieldForm = function FieldForm(_ref) {
|
|
|
1744
3813
|
};
|
|
1745
3814
|
|
|
1746
3815
|
var _excluded$3 = ["resourceType", "allowedKinds", "ownerId", "additionalValidations", "initialValues", "onClose", "onMutationSuccess"];
|
|
1747
|
-
function ownKeys$a(
|
|
1748
|
-
function _objectSpread$a(
|
|
3816
|
+
function ownKeys$a(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3817
|
+
function _objectSpread$a(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$a(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$a(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1749
3818
|
|
|
1750
3819
|
/** @type {React.FC<import("types").AddProps>} */
|
|
1751
3820
|
|
|
@@ -1801,8 +3870,8 @@ var Add = function Add(_ref) {
|
|
|
1801
3870
|
};
|
|
1802
3871
|
|
|
1803
3872
|
var _excluded$2 = ["fieldId", "allowedKinds", "ownerId", "additionalValidations", "initialValues", "onClose", "onMutationSuccess"];
|
|
1804
|
-
function ownKeys$9(
|
|
1805
|
-
function _objectSpread$9(
|
|
3873
|
+
function ownKeys$9(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3874
|
+
function _objectSpread$9(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$9(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$9(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1806
3875
|
|
|
1807
3876
|
/** @type {React.FC<import("types").EditProps>} */
|
|
1808
3877
|
|
|
@@ -1834,7 +3903,7 @@ var Edit = function Edit(_ref) {
|
|
|
1834
3903
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1835
3904
|
args[_key] = arguments[_key];
|
|
1836
3905
|
}
|
|
1837
|
-
onMutationSuccess === null || onMutationSuccess === void 0
|
|
3906
|
+
onMutationSuccess === null || onMutationSuccess === void 0 || onMutationSuccess.apply(void 0, args);
|
|
1838
3907
|
onClose();
|
|
1839
3908
|
}
|
|
1840
3909
|
}),
|
|
@@ -1880,8 +3949,8 @@ var Edit = function Edit(_ref) {
|
|
|
1880
3949
|
};
|
|
1881
3950
|
|
|
1882
3951
|
var _excluded$1 = ["isOpen", "selectedField"];
|
|
1883
|
-
function ownKeys$8(
|
|
1884
|
-
function _objectSpread$8(
|
|
3952
|
+
function ownKeys$8(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3953
|
+
function _objectSpread$8(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$8(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$8(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1885
3954
|
|
|
1886
3955
|
/** @type {React.FC<import("types").FieldsPaneProps>} */
|
|
1887
3956
|
|
|
@@ -2443,7 +4512,7 @@ var buildDefaultColumns = function buildDefaultColumns(_ref2) {
|
|
|
2443
4512
|
key: "name",
|
|
2444
4513
|
dataIndex: "name",
|
|
2445
4514
|
title: t("neetoFields.titles.fieldName"),
|
|
2446
|
-
width: "
|
|
4515
|
+
width: "300px",
|
|
2447
4516
|
render: function render(name, field) {
|
|
2448
4517
|
return /*#__PURE__*/React.createElement("div", {
|
|
2449
4518
|
className: "flex items-center justify-between gap-x-3"
|
|
@@ -2471,11 +4540,12 @@ var buildDefaultColumns = function buildDefaultColumns(_ref2) {
|
|
|
2471
4540
|
render: function render(kind) {
|
|
2472
4541
|
return DISPLAY_KINDS[kind];
|
|
2473
4542
|
},
|
|
2474
|
-
width: "
|
|
4543
|
+
width: "300px"
|
|
2475
4544
|
}, {
|
|
2476
4545
|
key: "isRequired",
|
|
2477
4546
|
dataIndex: "isRequired",
|
|
2478
4547
|
title: t("neetoFields.titles.required"),
|
|
4548
|
+
width: "300px",
|
|
2479
4549
|
render: function render(boolVal) {
|
|
2480
4550
|
return boolVal ? t("neetoFields.common.yes") : t("neetoFields.common.no");
|
|
2481
4551
|
}
|
|
@@ -2498,7 +4568,7 @@ var renderMenuBarItems = function renderMenuBarItems(_ref3) {
|
|
|
2498
4568
|
label: humanize(item.name),
|
|
2499
4569
|
description: t("neetoFields.messages.manageTitleForResource", {
|
|
2500
4570
|
title: title,
|
|
2501
|
-
resource: humanize(item.name)
|
|
4571
|
+
resource: humanize(item.name)
|
|
2502
4572
|
}),
|
|
2503
4573
|
onClick: handleBlockClick({
|
|
2504
4574
|
resource: item.id
|
|
@@ -2517,7 +4587,7 @@ var renderMenuBarItems = function renderMenuBarItems(_ref3) {
|
|
|
2517
4587
|
label: itemLabel,
|
|
2518
4588
|
description: t("neetoFields.messages.manageTitleForResource", {
|
|
2519
4589
|
title: title,
|
|
2520
|
-
resource: itemLabel
|
|
4590
|
+
resource: itemLabel
|
|
2521
4591
|
}),
|
|
2522
4592
|
onClick: handleBlockClick({
|
|
2523
4593
|
resource: value
|
|
@@ -2618,16 +4688,16 @@ var configsApi = {
|
|
|
2618
4688
|
fetchConfigs: fetchConfigs
|
|
2619
4689
|
};
|
|
2620
4690
|
|
|
2621
|
-
function ownKeys$7(
|
|
2622
|
-
function _objectSpread$7(
|
|
4691
|
+
function ownKeys$7(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4692
|
+
function _objectSpread$7(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$7(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$7(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2623
4693
|
var useFetchConfigs = function useFetchConfigs(options) {
|
|
2624
4694
|
return useQuery([QUERY_KEYS.CONFIGS], configsApi.fetchConfigs, _objectSpread$7({
|
|
2625
4695
|
staleTime: DEFAULT_STALE_TIME
|
|
2626
4696
|
}, options));
|
|
2627
4697
|
};
|
|
2628
4698
|
|
|
2629
|
-
function ownKeys$6(
|
|
2630
|
-
function _objectSpread$6(
|
|
4699
|
+
function ownKeys$6(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4700
|
+
function _objectSpread$6(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$6(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$6(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2631
4701
|
var useFieldsDashboard = function useFieldsDashboard(_ref) {
|
|
2632
4702
|
var buildColumnData = _ref.buildColumnData,
|
|
2633
4703
|
isOwnerBased = _ref.isOwnerBased,
|
|
@@ -2660,13 +4730,17 @@ var useFieldsDashboard = function useFieldsDashboard(_ref) {
|
|
|
2660
4730
|
pageProps = _useState10[0],
|
|
2661
4731
|
setPageProps = _useState10[1];
|
|
2662
4732
|
var _useQueryParams = useQueryParams(),
|
|
2663
|
-
searchTerm = _useQueryParams.
|
|
4733
|
+
searchTerm = _useQueryParams.searchTerm,
|
|
4734
|
+
resource = _useQueryParams.resource,
|
|
4735
|
+
state = _useQueryParams.state;
|
|
2664
4736
|
var history = useHistory();
|
|
2665
4737
|
var _useTranslation = useTranslation(),
|
|
2666
4738
|
t = _useTranslation.t;
|
|
2667
|
-
var
|
|
2668
|
-
|
|
2669
|
-
|
|
4739
|
+
var searchKeywordProps = {
|
|
4740
|
+
key: "search_term",
|
|
4741
|
+
node: "name",
|
|
4742
|
+
value: searchTerm
|
|
4743
|
+
};
|
|
2670
4744
|
var ownerId = isOwnerBased ? resource : undefined;
|
|
2671
4745
|
var _useFetchConfigs = useFetchConfigs({
|
|
2672
4746
|
enabled: !resources
|
|
@@ -2678,12 +4752,15 @@ var useFieldsDashboard = function useFieldsDashboard(_ref) {
|
|
|
2678
4752
|
_useFetchConfigs$data4 = _useFetchConfigs$data2.resourceTypes,
|
|
2679
4753
|
resourceTypes = _useFetchConfigs$data4 === void 0 ? [] : _useFetchConfigs$data4,
|
|
2680
4754
|
isConfigsLoading = _useFetchConfigs.isLoading;
|
|
4755
|
+
var filters = useMemo(function () {
|
|
4756
|
+
return buildFiltersFromURL([searchKeywordProps]);
|
|
4757
|
+
}, [searchTerm]);
|
|
2681
4758
|
var fieldParams = {
|
|
2682
4759
|
resourceType: !isOwnerBased ? resource : undefined,
|
|
2683
4760
|
ownerId: ownerId,
|
|
2684
4761
|
state: state || FIELD_STATES.active,
|
|
2685
|
-
|
|
2686
|
-
|
|
4762
|
+
pageProps: pageProps,
|
|
4763
|
+
filters: filters
|
|
2687
4764
|
};
|
|
2688
4765
|
var _useFetchFields = useFetchFields(fieldParams, {
|
|
2689
4766
|
enabled: !!resource,
|
|
@@ -2756,7 +4833,7 @@ var useFieldsDashboard = function useFieldsDashboard(_ref) {
|
|
|
2756
4833
|
};
|
|
2757
4834
|
if (!isConfigsLoading && isNil(resource)) {
|
|
2758
4835
|
var _menuItems$, _menuItems$2;
|
|
2759
|
-
queryParams.resource = isOwnerBased ? menuItems === null || menuItems === void 0
|
|
4836
|
+
queryParams.resource = isOwnerBased ? menuItems === null || menuItems === void 0 || (_menuItems$ = menuItems[0]) === null || _menuItems$ === void 0 ? void 0 : _menuItems$.id : menuItems === null || menuItems === void 0 || (_menuItems$2 = menuItems[0]) === null || _menuItems$2 === void 0 ? void 0 : _menuItems$2.value;
|
|
2760
4837
|
}
|
|
2761
4838
|
if (!isConfigsLoading && isNil(state)) {
|
|
2762
4839
|
queryParams.state = FIELD_STATES.active;
|
|
@@ -2767,7 +4844,7 @@ var useFieldsDashboard = function useFieldsDashboard(_ref) {
|
|
|
2767
4844
|
};
|
|
2768
4845
|
var isScreenLoading = isFieldsLoading || isConfigsLoading;
|
|
2769
4846
|
var showCountSubheader = count > 0 && !showStateFilter;
|
|
2770
|
-
var
|
|
4847
|
+
var searchInputProps = {
|
|
2771
4848
|
placeholder: t("neetoFields.placeholders.searchFields"),
|
|
2772
4849
|
className: "w-44"
|
|
2773
4850
|
};
|
|
@@ -2839,7 +4916,8 @@ var useFieldsDashboard = function useFieldsDashboard(_ref) {
|
|
|
2839
4916
|
handleAlertClose: handleAlertClose,
|
|
2840
4917
|
handleClosePane: handleClosePane,
|
|
2841
4918
|
handleReorderPaneClose: handleReorderPaneClose,
|
|
2842
|
-
|
|
4919
|
+
searchInputProps: searchInputProps,
|
|
4920
|
+
searchKeywordProps: searchKeywordProps,
|
|
2843
4921
|
stateFilterTabs: stateFilterTabs,
|
|
2844
4922
|
menuBarItems: menuBarItems,
|
|
2845
4923
|
reorderable: reorderable,
|
|
@@ -2884,8 +4962,8 @@ var DeleteAlert = function DeleteAlert(_ref) {
|
|
|
2884
4962
|
});
|
|
2885
4963
|
};
|
|
2886
4964
|
|
|
2887
|
-
function ownKeys$5(
|
|
2888
|
-
function _objectSpread$5(
|
|
4965
|
+
function ownKeys$5(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4966
|
+
function _objectSpread$5(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$5(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$5(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2889
4967
|
var FieldsTable = function FieldsTable(_ref) {
|
|
2890
4968
|
var totalCount = _ref.totalCount,
|
|
2891
4969
|
isFetched = _ref.isFetched,
|
|
@@ -2987,21 +5065,21 @@ var ActionBlock = function ActionBlock(_ref) {
|
|
|
2987
5065
|
}));
|
|
2988
5066
|
};
|
|
2989
5067
|
|
|
2990
|
-
var _excluded = ["
|
|
5068
|
+
var _excluded = ["searchInputProps", "breadcrumbs", "title", "helpDocUrl"];
|
|
2991
5069
|
var Header = function Header(_ref) {
|
|
2992
|
-
var
|
|
5070
|
+
var searchInputProps = _ref.searchInputProps,
|
|
2993
5071
|
breadcrumbs = _ref.breadcrumbs,
|
|
2994
5072
|
title = _ref.title,
|
|
2995
5073
|
helpDocUrl = _ref.helpDocUrl,
|
|
2996
5074
|
actionBlockProps = _objectWithoutProperties(_ref, _excluded);
|
|
2997
5075
|
return /*#__PURE__*/React.createElement(NeetoUIHeader, {
|
|
2998
|
-
size: "small",
|
|
2999
5076
|
breadcrumbs: breadcrumbs,
|
|
3000
|
-
searchProps: searchProps,
|
|
3001
5077
|
actionBlock: /*#__PURE__*/React.createElement(ActionBlock, actionBlockProps),
|
|
5078
|
+
searchProps: searchInputProps,
|
|
5079
|
+
size: "small",
|
|
3002
5080
|
title: /*#__PURE__*/React.createElement(TitleWithHelpLink, {
|
|
3003
|
-
|
|
3004
|
-
|
|
5081
|
+
title: title,
|
|
5082
|
+
helpUrl: helpDocUrl
|
|
3005
5083
|
})
|
|
3006
5084
|
});
|
|
3007
5085
|
};
|
|
@@ -7249,8 +9327,8 @@ function normalizeLocalDisabled(localDisabled, globalDisabled) {
|
|
|
7249
9327
|
|
|
7250
9328
|
[KeyboardCode.Down, KeyboardCode.Right, KeyboardCode.Up, KeyboardCode.Left];
|
|
7251
9329
|
|
|
7252
|
-
function ownKeys$4(
|
|
7253
|
-
function _objectSpread$4(
|
|
9330
|
+
function ownKeys$4(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
9331
|
+
function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7254
9332
|
var FieldBlock = function FieldBlock(_ref) {
|
|
7255
9333
|
var field = _ref.field,
|
|
7256
9334
|
index = _ref.index,
|
|
@@ -7276,12 +9354,12 @@ var FieldBlock = function FieldBlock(_ref) {
|
|
|
7276
9354
|
}, _objectSpread$4(_objectSpread$4({
|
|
7277
9355
|
style: style
|
|
7278
9356
|
}, attributes), listeners), {
|
|
7279
|
-
className: "neeto-ui-text-gray-800 mb-3 flex items-center space-x-4 font-medium",
|
|
9357
|
+
className: "neeto-ui-text-gray-800 mb-3 flex w-full items-center space-x-4 font-medium",
|
|
7280
9358
|
"data-cy": "reorder-field-block"
|
|
7281
9359
|
}), /*#__PURE__*/React.createElement("div", {
|
|
7282
9360
|
className: "neeto-ui-bg-gray-100 neeto-ui-text-gray-700 neeto-ui-rounded-sm flex h-6 w-6 flex-shrink-0 items-center justify-center p-1"
|
|
7283
9361
|
}, index - systemFieldsCount + 1), /*#__PURE__*/React.createElement("div", {
|
|
7284
|
-
className: "neeto-ui-border-gray-400 neeto-ui-bg-white neeto-ui-rounded neeto-ui-shadow-xs flex
|
|
9362
|
+
className: "neeto-ui-border-gray-400 neeto-ui-bg-white neeto-ui-rounded neeto-ui-shadow-xs flex flex-grow items-center space-x-4 border border-solid p-3"
|
|
7285
9363
|
}, /*#__PURE__*/React.createElement(Reorder, null), /*#__PURE__*/React.createElement("div", {
|
|
7286
9364
|
"data-cy": "reorder-field-block-name"
|
|
7287
9365
|
}, field.name)));
|
|
@@ -7358,7 +9436,7 @@ var ReorderPane = function ReorderPane(_ref) {
|
|
|
7358
9436
|
"data-cy": "reorder-pane-message",
|
|
7359
9437
|
style: "body2"
|
|
7360
9438
|
}, t("neetoFields.messages.reorderFields")), /*#__PURE__*/React.createElement("div", {
|
|
7361
|
-
className: "flex flex-col items-center"
|
|
9439
|
+
className: "flex w-full flex-col items-center"
|
|
7362
9440
|
}, /*#__PURE__*/React.createElement(DndContext, {
|
|
7363
9441
|
collisionDetection: closestCenter,
|
|
7364
9442
|
onDragEnd: handleDragEnd
|
|
@@ -7391,16 +9469,19 @@ var ReorderPane = function ReorderPane(_ref) {
|
|
|
7391
9469
|
|
|
7392
9470
|
// eslint-disable-next-line @bigbinary/neeto/no-dumb-components-with-use-translation
|
|
7393
9471
|
var Subheader = function Subheader(_ref) {
|
|
7394
|
-
var count = _ref.count
|
|
9472
|
+
var count = _ref.count,
|
|
9473
|
+
searchKeywordProps = _ref.searchKeywordProps;
|
|
7395
9474
|
var _useTranslation = useTranslation(),
|
|
7396
9475
|
t = _useTranslation.t;
|
|
7397
9476
|
return /*#__PURE__*/React.createElement(NeetoUISubHeader, {
|
|
7398
|
-
leftActionBlock: /*#__PURE__*/React.createElement(Typography, {
|
|
9477
|
+
leftActionBlock: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Typography, {
|
|
7399
9478
|
className: "neeto-ui-gray-800 mr-4 font-semibold",
|
|
7400
9479
|
"data-cy": "neeto-fields-subheader-text",
|
|
7401
9480
|
style: "h4"
|
|
7402
9481
|
}, t("neetoFields.titles.fieldWithCount", {
|
|
7403
9482
|
count: count
|
|
9483
|
+
})), /*#__PURE__*/React.createElement(Bar, {
|
|
9484
|
+
keyword: searchKeywordProps
|
|
7404
9485
|
}))
|
|
7405
9486
|
});
|
|
7406
9487
|
};
|
|
@@ -7467,7 +9548,8 @@ var FieldsDashboard = function FieldsDashboard(_ref) {
|
|
|
7467
9548
|
handleAlertClose = _useFieldsDashboard.handleAlertClose,
|
|
7468
9549
|
handleClosePane = _useFieldsDashboard.handleClosePane,
|
|
7469
9550
|
handleReorderPaneClose = _useFieldsDashboard.handleReorderPaneClose,
|
|
7470
|
-
|
|
9551
|
+
searchInputProps = _useFieldsDashboard.searchInputProps,
|
|
9552
|
+
searchKeywordProps = _useFieldsDashboard.searchKeywordProps,
|
|
7471
9553
|
stateFilterTabs = _useFieldsDashboard.stateFilterTabs,
|
|
7472
9554
|
menuBarItems = _useFieldsDashboard.menuBarItems,
|
|
7473
9555
|
reorderable = _useFieldsDashboard.reorderable,
|
|
@@ -7478,17 +9560,19 @@ var FieldsDashboard = function FieldsDashboard(_ref) {
|
|
|
7478
9560
|
reorderable: reorderable,
|
|
7479
9561
|
breadcrumbs: breadcrumbs,
|
|
7480
9562
|
helpDocUrl: helpDocUrl,
|
|
7481
|
-
|
|
9563
|
+
searchInputProps: searchInputProps,
|
|
7482
9564
|
setIsPaneOpen: setIsPaneOpen,
|
|
7483
9565
|
setIsReorderPaneOpen: setIsReorderPaneOpen,
|
|
7484
9566
|
title: headerDisplayTitle
|
|
7485
9567
|
};
|
|
9568
|
+
var showSubheader = showCountSubheader || isPresent(searchKeywordProps.value);
|
|
7486
9569
|
return /*#__PURE__*/React.createElement(React.Fragment, null, isMenuBarNeeded && /*#__PURE__*/React.createElement(Menubar, {
|
|
7487
9570
|
menuBarItems: menuBarItems,
|
|
7488
9571
|
title: title
|
|
7489
|
-
}), /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(Header, headerProps),
|
|
7490
|
-
count: count
|
|
7491
|
-
|
|
9572
|
+
}), /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(Header, headerProps), showSubheader && /*#__PURE__*/React.createElement(Subheader, {
|
|
9573
|
+
count: count,
|
|
9574
|
+
searchKeywordProps: searchKeywordProps
|
|
9575
|
+
}), showStateFilter && stateFilterTabs, isScreenLoading ? /*#__PURE__*/React.createElement("div", {
|
|
7492
9576
|
className: "flex h-screen w-full flex-grow items-center justify-center"
|
|
7493
9577
|
}, /*#__PURE__*/React.createElement(PageLoader, null)) : /*#__PURE__*/React.createElement(FieldsTable, {
|
|
7494
9578
|
columnData: columnData,
|
|
@@ -7566,8 +9650,8 @@ var fieldValuesApi = {
|
|
|
7566
9650
|
update: update
|
|
7567
9651
|
};
|
|
7568
9652
|
|
|
7569
|
-
function ownKeys$3(
|
|
7570
|
-
function _objectSpread$3(
|
|
9653
|
+
function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
9654
|
+
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7571
9655
|
var useCreateFieldValue = function useCreateFieldValue(options) {
|
|
7572
9656
|
return useMutationWithInvalidation(fieldValuesApi.create, _objectSpread$3({
|
|
7573
9657
|
keysToInvalidate: [[QUERY_KEYS.FIELD_VALUES]]
|
|
@@ -7677,8 +9761,8 @@ var DEAFULT_BLOCK_NAVIGATION_ALERT_PROPS = {
|
|
|
7677
9761
|
cancelButtonLabel: t("neetoFields.messages.blockNavigationAlert.cancelButtonLabel")
|
|
7678
9762
|
};
|
|
7679
9763
|
|
|
7680
|
-
function ownKeys$2(
|
|
7681
|
-
function _objectSpread$2(
|
|
9764
|
+
function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
9765
|
+
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7682
9766
|
var BlockNavigation = function BlockNavigation(_ref) {
|
|
7683
9767
|
var blockNavigation = _ref.blockNavigation,
|
|
7684
9768
|
blockNavigationAlertProps = _ref.blockNavigationAlertProps;
|
|
@@ -7724,8 +9808,8 @@ var FieldValueInputWrapper = function FieldValueInputWrapper(_ref) {
|
|
|
7724
9808
|
}, children);
|
|
7725
9809
|
};
|
|
7726
9810
|
|
|
7727
|
-
function ownKeys$1(
|
|
7728
|
-
function _objectSpread$1(
|
|
9811
|
+
function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
9812
|
+
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7729
9813
|
var FieldValuesContainer = function FieldValuesContainer(_ref) {
|
|
7730
9814
|
var _ref$resourceType = _ref.resourceType,
|
|
7731
9815
|
resourceType = _ref$resourceType === void 0 ? "" : _ref$resourceType,
|
|
@@ -7819,10 +9903,10 @@ var FieldValuesContainer = function FieldValuesContainer(_ref) {
|
|
|
7819
9903
|
};
|
|
7820
9904
|
|
|
7821
9905
|
var renderDataAsText = function renderDataAsText(field, fieldValues) {
|
|
7822
|
-
var _findBy,
|
|
9906
|
+
var _findBy, _findBy2, _findBy3;
|
|
7823
9907
|
var fieldValueData = (_findBy = findBy({
|
|
7824
9908
|
fieldId: field.id
|
|
7825
|
-
}, fieldValues)) === null || _findBy === void 0
|
|
9909
|
+
}, fieldValues)) === null || _findBy === void 0 || (_findBy = _findBy.data) === null || _findBy === void 0 ? void 0 : _findBy.value;
|
|
7826
9910
|
switch (field.kind) {
|
|
7827
9911
|
case KINDS.date:
|
|
7828
9912
|
return fieldValueData && dateFormat.date(fieldValueData);
|
|
@@ -7841,7 +9925,7 @@ var renderDataAsText = function renderDataAsText(field, fieldValues) {
|
|
|
7841
9925
|
case KINDS.multiOption:
|
|
7842
9926
|
fieldValueData = (_findBy3 = findBy({
|
|
7843
9927
|
fieldId: field.id
|
|
7844
|
-
}, fieldValues)) === null || _findBy3 === void 0
|
|
9928
|
+
}, fieldValues)) === null || _findBy3 === void 0 || (_findBy3 = _findBy3.data) === null || _findBy3 === void 0 ? void 0 : _findBy3.values;
|
|
7845
9929
|
return fieldValueData && fieldValueData.map(function (optionId) {
|
|
7846
9930
|
var _findBy4;
|
|
7847
9931
|
return (_findBy4 = findBy({
|
|
@@ -7855,8 +9939,8 @@ var renderDataAsText = function renderDataAsText(field, fieldValues) {
|
|
|
7855
9939
|
}
|
|
7856
9940
|
};
|
|
7857
9941
|
|
|
7858
|
-
function ownKeys(
|
|
7859
|
-
function _objectSpread(
|
|
9942
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
9943
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7860
9944
|
var InlineFieldValueInput = function InlineFieldValueInput(_ref) {
|
|
7861
9945
|
var field = _ref.field,
|
|
7862
9946
|
fieldValues = _ref.fieldValues,
|