vue-intergrall-plugins 0.0.160 → 0.0.161
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/vue-intergrall-plugins.esm.js +4231 -282
- package/dist/vue-intergrall-plugins.min.js +1 -1
- package/dist/vue-intergrall-plugins.ssr.js +4170 -293
- package/package.json +1 -1
- package/src/lib-components/Chat/BtnFiles.vue +1 -1
- package/src/lib-components/Chat/StandardMessages.vue +69 -38
- package/src/lib-components/Chat/TextFooter.vue +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';var vue=require('vue'),
|
|
1
|
+
'use strict';var vue=require('vue'),http=require('http'),https=require('https'),url=require('url'),stream=require('stream'),assert=require('assert'),tty=require('tty'),util=require('util'),os=require('os'),zlib=require('zlib');function _interopDefaultLegacy(e){return e&&typeof e==='object'&&'default'in e?e:{'default':e}}var vue__default=/*#__PURE__*/_interopDefaultLegacy(vue);var http__default=/*#__PURE__*/_interopDefaultLegacy(http);var https__default=/*#__PURE__*/_interopDefaultLegacy(https);var url__default=/*#__PURE__*/_interopDefaultLegacy(url);var stream__default=/*#__PURE__*/_interopDefaultLegacy(stream);var assert__default=/*#__PURE__*/_interopDefaultLegacy(assert);var tty__default=/*#__PURE__*/_interopDefaultLegacy(tty);var util__default=/*#__PURE__*/_interopDefaultLegacy(util);var os__default=/*#__PURE__*/_interopDefaultLegacy(os);var zlib__default=/*#__PURE__*/_interopDefaultLegacy(zlib);function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
2
2
|
try {
|
|
3
3
|
var info = gen[key](arg);
|
|
4
4
|
var value = info.value;
|
|
@@ -235,29 +235,30 @@ var applyStyles$1 = {
|
|
|
235
235
|
requires: ['computeStyles']
|
|
236
236
|
};function getBasePlacement(placement) {
|
|
237
237
|
return placement.split('-')[0];
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
includeScale) {
|
|
238
|
+
}var max = Math.max;
|
|
239
|
+
var min = Math.min;
|
|
240
|
+
var round = Math.round;function getBoundingClientRect(element, includeScale) {
|
|
241
|
+
if (includeScale === void 0) {
|
|
242
|
+
includeScale = false;
|
|
243
|
+
}
|
|
241
244
|
|
|
242
245
|
var rect = element.getBoundingClientRect();
|
|
243
246
|
var scaleX = 1;
|
|
244
|
-
var scaleY = 1;
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
// }
|
|
260
|
-
// }
|
|
247
|
+
var scaleY = 1;
|
|
248
|
+
|
|
249
|
+
if (isHTMLElement(element) && includeScale) {
|
|
250
|
+
var offsetHeight = element.offsetHeight;
|
|
251
|
+
var offsetWidth = element.offsetWidth; // Do not attempt to divide by 0, otherwise we get `Infinity` as scale
|
|
252
|
+
// Fallback to 1 in case both values are `0`
|
|
253
|
+
|
|
254
|
+
if (offsetWidth > 0) {
|
|
255
|
+
scaleX = round(rect.width) / offsetWidth || 1;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
if (offsetHeight > 0) {
|
|
259
|
+
scaleY = round(rect.height) / offsetHeight || 1;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
261
262
|
|
|
262
263
|
return {
|
|
263
264
|
width: rect.width / scaleX,
|
|
@@ -394,10 +395,12 @@ function getOffsetParent(element) {
|
|
|
394
395
|
return offsetParent || getContainingBlock(element) || window;
|
|
395
396
|
}function getMainAxisFromPlacement(placement) {
|
|
396
397
|
return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';
|
|
397
|
-
}
|
|
398
|
-
var min = Math.min;
|
|
399
|
-
var round = Math.round;function within(min$1, value, max$1) {
|
|
398
|
+
}function within(min$1, value, max$1) {
|
|
400
399
|
return max(min$1, min(value, max$1));
|
|
400
|
+
}
|
|
401
|
+
function withinMaxClamp(min, value, max) {
|
|
402
|
+
var v = within(min, value, max);
|
|
403
|
+
return v > max ? max : v;
|
|
401
404
|
}function getFreshSideObject() {
|
|
402
405
|
return {
|
|
403
406
|
top: 0,
|
|
@@ -509,8 +512,8 @@ function roundOffsetsByDPR(_ref) {
|
|
|
509
512
|
var win = window;
|
|
510
513
|
var dpr = win.devicePixelRatio || 1;
|
|
511
514
|
return {
|
|
512
|
-
x: round(
|
|
513
|
-
y: round(
|
|
515
|
+
x: round(x * dpr) / dpr || 0,
|
|
516
|
+
y: round(y * dpr) / dpr || 0
|
|
514
517
|
};
|
|
515
518
|
}
|
|
516
519
|
|
|
@@ -525,14 +528,23 @@ function mapToStyles(_ref2) {
|
|
|
525
528
|
position = _ref2.position,
|
|
526
529
|
gpuAcceleration = _ref2.gpuAcceleration,
|
|
527
530
|
adaptive = _ref2.adaptive,
|
|
528
|
-
roundOffsets = _ref2.roundOffsets
|
|
529
|
-
|
|
530
|
-
var
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
531
|
+
roundOffsets = _ref2.roundOffsets,
|
|
532
|
+
isFixed = _ref2.isFixed;
|
|
533
|
+
var _offsets$x = offsets.x,
|
|
534
|
+
x = _offsets$x === void 0 ? 0 : _offsets$x,
|
|
535
|
+
_offsets$y = offsets.y,
|
|
536
|
+
y = _offsets$y === void 0 ? 0 : _offsets$y;
|
|
537
|
+
|
|
538
|
+
var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({
|
|
539
|
+
x: x,
|
|
540
|
+
y: y
|
|
541
|
+
}) : {
|
|
542
|
+
x: x,
|
|
543
|
+
y: y
|
|
544
|
+
};
|
|
535
545
|
|
|
546
|
+
x = _ref3.x;
|
|
547
|
+
y = _ref3.y;
|
|
536
548
|
var hasX = offsets.hasOwnProperty('x');
|
|
537
549
|
var hasY = offsets.hasOwnProperty('y');
|
|
538
550
|
var sideX = left;
|
|
@@ -557,16 +569,18 @@ function mapToStyles(_ref2) {
|
|
|
557
569
|
offsetParent = offsetParent;
|
|
558
570
|
|
|
559
571
|
if (placement === top || (placement === left || placement === right) && variation === end) {
|
|
560
|
-
sideY = bottom;
|
|
561
|
-
|
|
562
|
-
|
|
572
|
+
sideY = bottom;
|
|
573
|
+
var offsetY = isFixed && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]
|
|
574
|
+
offsetParent[heightProp];
|
|
575
|
+
y -= offsetY - popperRect.height;
|
|
563
576
|
y *= gpuAcceleration ? 1 : -1;
|
|
564
577
|
}
|
|
565
578
|
|
|
566
579
|
if (placement === left || (placement === top || placement === bottom) && variation === end) {
|
|
567
|
-
sideX = right;
|
|
568
|
-
|
|
569
|
-
|
|
580
|
+
sideX = right;
|
|
581
|
+
var offsetX = isFixed && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]
|
|
582
|
+
offsetParent[widthProp];
|
|
583
|
+
x -= offsetX - popperRect.width;
|
|
570
584
|
x *= gpuAcceleration ? 1 : -1;
|
|
571
585
|
}
|
|
572
586
|
}
|
|
@@ -575,6 +589,17 @@ function mapToStyles(_ref2) {
|
|
|
575
589
|
position: position
|
|
576
590
|
}, adaptive && unsetSides);
|
|
577
591
|
|
|
592
|
+
var _ref4 = roundOffsets === true ? roundOffsetsByDPR({
|
|
593
|
+
x: x,
|
|
594
|
+
y: y
|
|
595
|
+
}) : {
|
|
596
|
+
x: x,
|
|
597
|
+
y: y
|
|
598
|
+
};
|
|
599
|
+
|
|
600
|
+
x = _ref4.x;
|
|
601
|
+
y = _ref4.y;
|
|
602
|
+
|
|
578
603
|
if (gpuAcceleration) {
|
|
579
604
|
var _Object$assign;
|
|
580
605
|
|
|
@@ -584,9 +609,9 @@ function mapToStyles(_ref2) {
|
|
|
584
609
|
return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2));
|
|
585
610
|
}
|
|
586
611
|
|
|
587
|
-
function computeStyles(
|
|
588
|
-
var state =
|
|
589
|
-
options =
|
|
612
|
+
function computeStyles(_ref5) {
|
|
613
|
+
var state = _ref5.state,
|
|
614
|
+
options = _ref5.options;
|
|
590
615
|
var _options$gpuAccelerat = options.gpuAcceleration,
|
|
591
616
|
gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,
|
|
592
617
|
_options$adaptive = options.adaptive,
|
|
@@ -599,7 +624,8 @@ function computeStyles(_ref4) {
|
|
|
599
624
|
variation: getVariation(state.placement),
|
|
600
625
|
popper: state.elements.popper,
|
|
601
626
|
popperRect: state.rects.popper,
|
|
602
|
-
gpuAcceleration: gpuAcceleration
|
|
627
|
+
gpuAcceleration: gpuAcceleration,
|
|
628
|
+
isFixed: state.options.strategy === 'fixed'
|
|
603
629
|
};
|
|
604
630
|
|
|
605
631
|
if (state.modifiersData.popperOffsets != null) {
|
|
@@ -833,7 +859,7 @@ function listScrollParents(element, list) {
|
|
|
833
859
|
}
|
|
834
860
|
|
|
835
861
|
function getClientRectFromMixedType(element, clippingParent) {
|
|
836
|
-
return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) :
|
|
862
|
+
return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
|
|
837
863
|
} // A "clipping parent" is an overflowable container with the characteristic of
|
|
838
864
|
// clipping (or hiding) overflowing elements with a position different from
|
|
839
865
|
// `initial`
|
|
@@ -1328,6 +1354,14 @@ var popperOffsets$1 = {
|
|
|
1328
1354
|
var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {
|
|
1329
1355
|
placement: state.placement
|
|
1330
1356
|
})) : tetherOffset;
|
|
1357
|
+
var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? {
|
|
1358
|
+
mainAxis: tetherOffsetValue,
|
|
1359
|
+
altAxis: tetherOffsetValue
|
|
1360
|
+
} : Object.assign({
|
|
1361
|
+
mainAxis: 0,
|
|
1362
|
+
altAxis: 0
|
|
1363
|
+
}, tetherOffsetValue);
|
|
1364
|
+
var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;
|
|
1331
1365
|
var data = {
|
|
1332
1366
|
x: 0,
|
|
1333
1367
|
y: 0
|
|
@@ -1337,13 +1371,15 @@ var popperOffsets$1 = {
|
|
|
1337
1371
|
return;
|
|
1338
1372
|
}
|
|
1339
1373
|
|
|
1340
|
-
if (checkMainAxis
|
|
1374
|
+
if (checkMainAxis) {
|
|
1375
|
+
var _offsetModifierState$;
|
|
1376
|
+
|
|
1341
1377
|
var mainSide = mainAxis === 'y' ? top : left;
|
|
1342
1378
|
var altSide = mainAxis === 'y' ? bottom : right;
|
|
1343
1379
|
var len = mainAxis === 'y' ? 'height' : 'width';
|
|
1344
1380
|
var offset = popperOffsets[mainAxis];
|
|
1345
|
-
var min$1 =
|
|
1346
|
-
var max$1 =
|
|
1381
|
+
var min$1 = offset + overflow[mainSide];
|
|
1382
|
+
var max$1 = offset - overflow[altSide];
|
|
1347
1383
|
var additive = tether ? -popperRect[len] / 2 : 0;
|
|
1348
1384
|
var minLen = variation === start ? referenceRect[len] : popperRect[len];
|
|
1349
1385
|
var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go
|
|
@@ -1363,36 +1399,45 @@ var popperOffsets$1 = {
|
|
|
1363
1399
|
// width or height)
|
|
1364
1400
|
|
|
1365
1401
|
var arrowLen = within(0, referenceRect[len], arrowRect[len]);
|
|
1366
|
-
var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin -
|
|
1367
|
-
var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax +
|
|
1402
|
+
var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;
|
|
1403
|
+
var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;
|
|
1368
1404
|
var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
|
|
1369
1405
|
var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
|
|
1370
|
-
var offsetModifierValue =
|
|
1371
|
-
var tetherMin =
|
|
1372
|
-
var tetherMax =
|
|
1406
|
+
var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;
|
|
1407
|
+
var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;
|
|
1408
|
+
var tetherMax = offset + maxOffset - offsetModifierValue;
|
|
1409
|
+
var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset, tether ? max(max$1, tetherMax) : max$1);
|
|
1410
|
+
popperOffsets[mainAxis] = preventedOffset;
|
|
1411
|
+
data[mainAxis] = preventedOffset - offset;
|
|
1412
|
+
}
|
|
1373
1413
|
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
popperOffsets[mainAxis] = preventedOffset;
|
|
1377
|
-
data[mainAxis] = preventedOffset - offset;
|
|
1378
|
-
}
|
|
1414
|
+
if (checkAltAxis) {
|
|
1415
|
+
var _offsetModifierState$2;
|
|
1379
1416
|
|
|
1380
|
-
|
|
1381
|
-
var _mainSide = mainAxis === 'x' ? top : left;
|
|
1417
|
+
var _mainSide = mainAxis === 'x' ? top : left;
|
|
1382
1418
|
|
|
1383
|
-
|
|
1419
|
+
var _altSide = mainAxis === 'x' ? bottom : right;
|
|
1384
1420
|
|
|
1385
|
-
|
|
1421
|
+
var _offset = popperOffsets[altAxis];
|
|
1386
1422
|
|
|
1387
|
-
|
|
1423
|
+
var _len = altAxis === 'y' ? 'height' : 'width';
|
|
1388
1424
|
|
|
1389
|
-
|
|
1425
|
+
var _min = _offset + overflow[_mainSide];
|
|
1390
1426
|
|
|
1391
|
-
|
|
1427
|
+
var _max = _offset - overflow[_altSide];
|
|
1392
1428
|
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1429
|
+
var isOriginSide = [top, left].indexOf(basePlacement) !== -1;
|
|
1430
|
+
|
|
1431
|
+
var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;
|
|
1432
|
+
|
|
1433
|
+
var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;
|
|
1434
|
+
|
|
1435
|
+
var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;
|
|
1436
|
+
|
|
1437
|
+
var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);
|
|
1438
|
+
|
|
1439
|
+
popperOffsets[altAxis] = _preventedOffset;
|
|
1440
|
+
data[altAxis] = _preventedOffset - _offset;
|
|
1396
1441
|
}
|
|
1397
1442
|
|
|
1398
1443
|
state.modifiersData[name] = data;
|
|
@@ -1418,8 +1463,8 @@ var preventOverflow$1 = {
|
|
|
1418
1463
|
}
|
|
1419
1464
|
}function isElementScaled(element) {
|
|
1420
1465
|
var rect = element.getBoundingClientRect();
|
|
1421
|
-
var scaleX = rect.width / element.offsetWidth || 1;
|
|
1422
|
-
var scaleY = rect.height / element.offsetHeight || 1;
|
|
1466
|
+
var scaleX = round(rect.width) / element.offsetWidth || 1;
|
|
1467
|
+
var scaleY = round(rect.height) / element.offsetHeight || 1;
|
|
1423
1468
|
return scaleX !== 1 || scaleY !== 1;
|
|
1424
1469
|
} // Returns the composite rect of an element relative to its offsetParent.
|
|
1425
1470
|
// Composite means it takes into account transforms as well as layout.
|
|
@@ -1431,9 +1476,9 @@ function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
|
|
|
1431
1476
|
}
|
|
1432
1477
|
|
|
1433
1478
|
var isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
1434
|
-
isHTMLElement(offsetParent) && isElementScaled(offsetParent);
|
|
1479
|
+
var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);
|
|
1435
1480
|
var documentElement = getDocumentElement(offsetParent);
|
|
1436
|
-
var rect = getBoundingClientRect(elementOrVirtualElement);
|
|
1481
|
+
var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled);
|
|
1437
1482
|
var scroll = {
|
|
1438
1483
|
scrollLeft: 0,
|
|
1439
1484
|
scrollTop: 0
|
|
@@ -1450,7 +1495,7 @@ function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
|
|
|
1450
1495
|
}
|
|
1451
1496
|
|
|
1452
1497
|
if (isHTMLElement(offsetParent)) {
|
|
1453
|
-
offsets = getBoundingClientRect(offsetParent);
|
|
1498
|
+
offsets = getBoundingClientRect(offsetParent, true);
|
|
1454
1499
|
offsets.x += offsetParent.clientLeft;
|
|
1455
1500
|
offsets.y += offsetParent.clientTop;
|
|
1456
1501
|
} else if (documentElement) {
|
|
@@ -2175,7 +2220,7 @@ if (!compatible) {
|
|
|
2175
2220
|
|
|
2176
2221
|
var HANDLER = '_vue_clickaway_handler';
|
|
2177
2222
|
|
|
2178
|
-
function bind(el, binding, vnode) {
|
|
2223
|
+
function bind$1(el, binding, vnode) {
|
|
2179
2224
|
unbind(el);
|
|
2180
2225
|
|
|
2181
2226
|
var vm = vnode.context;
|
|
@@ -2218,10 +2263,10 @@ function unbind(el) {
|
|
|
2218
2263
|
}
|
|
2219
2264
|
|
|
2220
2265
|
var directive = {
|
|
2221
|
-
bind: bind,
|
|
2266
|
+
bind: bind$1,
|
|
2222
2267
|
update: function(el, binding) {
|
|
2223
2268
|
if (binding.value === binding.oldValue) return;
|
|
2224
|
-
bind(el, binding);
|
|
2269
|
+
bind$1(el, binding);
|
|
2225
2270
|
},
|
|
2226
2271
|
unbind: unbind,
|
|
2227
2272
|
};
|
|
@@ -3443,10 +3488,7 @@ var script$j = {
|
|
|
3443
3488
|
this.openFiles = !this.openFiles;
|
|
3444
3489
|
},
|
|
3445
3490
|
openSelectFileHandler: function openSelectFileHandler(type) {
|
|
3446
|
-
if (type == "system")
|
|
3447
|
-
this.$emit("open-file-system", true);
|
|
3448
|
-
return false;
|
|
3449
|
-
}
|
|
3491
|
+
if (type == "system") return this.$emit("open-file-system");
|
|
3450
3492
|
|
|
3451
3493
|
if (this.fileSettings.multiple) {
|
|
3452
3494
|
type = 'both';
|
|
@@ -3764,7 +3806,7 @@ var __vue_staticRenderFns__$j = [];
|
|
|
3764
3806
|
|
|
3765
3807
|
var __vue_inject_styles__$j = function __vue_inject_styles__(inject) {
|
|
3766
3808
|
if (!inject) return;
|
|
3767
|
-
inject("data-v-
|
|
3809
|
+
inject("data-v-6af671cf_0", {
|
|
3768
3810
|
source: ".fade-enter-active,.fade-leave-active{transition:opacity .3s}.fade-enter,.fade-leave-to{opacity:0}.files-counter{position:absolute;top:unset;transform:translate(17.5px,-15px);background-color:#888;z-index:1;font-size:.5rem;width:15px;height:15px;border-radius:50%;display:flex;justify-content:center;align-items:center;cursor:pointer;opacity:.9;transition:all .3s;color:#fff;font-weight:900}.files-counter:hover{opacity:1}",
|
|
3769
3811
|
map: undefined,
|
|
3770
3812
|
media: undefined
|
|
@@ -3776,7 +3818,7 @@ var __vue_inject_styles__$j = function __vue_inject_styles__(inject) {
|
|
|
3776
3818
|
var __vue_scope_id__$j = undefined;
|
|
3777
3819
|
/* module identifier */
|
|
3778
3820
|
|
|
3779
|
-
var __vue_module_identifier__$j = "data-v-
|
|
3821
|
+
var __vue_module_identifier__$j = "data-v-6af671cf";
|
|
3780
3822
|
/* functional template */
|
|
3781
3823
|
|
|
3782
3824
|
var __vue_is_functional_template__$j = false;
|
|
@@ -3919,218 +3961,4013 @@ var __vue_component__$o = /*#__PURE__*/normalizeComponent({
|
|
|
3919
3961
|
staticRenderFns: __vue_staticRenderFns__$h
|
|
3920
3962
|
}, __vue_inject_styles__$h, __vue_script__$h, __vue_scope_id__$h, __vue_is_functional_template__$h, __vue_module_identifier__$h, false, undefined, undefined, undefined);
|
|
3921
3963
|
|
|
3922
|
-
var BtnStandardMessages = __vue_component__$o;
|
|
3923
|
-
|
|
3924
|
-
var
|
|
3925
|
-
var
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3964
|
+
var BtnStandardMessages = __vue_component__$o;var bind = function bind(fn, thisArg) {
|
|
3965
|
+
return function wrap() {
|
|
3966
|
+
var args = new Array(arguments.length);
|
|
3967
|
+
for (var i = 0; i < args.length; i++) {
|
|
3968
|
+
args[i] = arguments[i];
|
|
3969
|
+
}
|
|
3970
|
+
return fn.apply(thisArg, args);
|
|
3971
|
+
};
|
|
3972
|
+
};// utils is a library of generic helper functions non-specific to axios
|
|
3973
|
+
|
|
3974
|
+
var toString = Object.prototype.toString;
|
|
3975
|
+
|
|
3976
|
+
/**
|
|
3977
|
+
* Determine if a value is an Array
|
|
3978
|
+
*
|
|
3979
|
+
* @param {Object} val The value to test
|
|
3980
|
+
* @returns {boolean} True if value is an Array, otherwise false
|
|
3981
|
+
*/
|
|
3982
|
+
function isArray(val) {
|
|
3983
|
+
return Array.isArray(val);
|
|
3984
|
+
}
|
|
3929
3985
|
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
// Authorization: "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdGQiOiJNS1VJNnhZdm1xSWVFaWpuMXJwMERkZzQ0ZjFzd3dpbTRsNXd3WWFrVUJtd3d4YjQ0YXd3ZVJ1U2lUeUxxVTEiLCJtYW5hZ2VyIjoiTUtVd0J6YzFnVkIzaWNlNE5yU01lbU5aekI1MkExTzdtNXdhdmQyYnd3eGI0NGF3d3d3eGI0NGF3d3FVU2NoIiwibnJvcyI6WyI0MSJdLCJhdXRoIjoiTUtVVnAxTWR3d2ltNGw1d3dYTnNjWDg5R3V4c1RsZUVqdGdpNjhoNk1JUzl6d0xBTGVRbjhUUCIsImlhdCI6MTY0NjMzOTkyOCwiZXhwIjoxNjQ2NDI2MzI4fQ.QNu0uO3qV-Lqvu8Xww1F_x8Bwnjlm175IVdM89EgPM0"
|
|
3940
|
-
// }
|
|
3986
|
+
/**
|
|
3987
|
+
* Determine if a value is undefined
|
|
3988
|
+
*
|
|
3989
|
+
* @param {Object} val The value to test
|
|
3990
|
+
* @returns {boolean} True if the value is undefined, otherwise false
|
|
3991
|
+
*/
|
|
3992
|
+
function isUndefined(val) {
|
|
3993
|
+
return typeof val === 'undefined';
|
|
3994
|
+
}
|
|
3941
3995
|
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
|
|
3950
|
-
|
|
3951
|
-
|
|
3952
|
-
}));
|
|
3996
|
+
/**
|
|
3997
|
+
* Determine if a value is a Buffer
|
|
3998
|
+
*
|
|
3999
|
+
* @param {Object} val The value to test
|
|
4000
|
+
* @returns {boolean} True if value is a Buffer, otherwise false
|
|
4001
|
+
*/
|
|
4002
|
+
function isBuffer(val) {
|
|
4003
|
+
return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
|
|
4004
|
+
&& typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);
|
|
4005
|
+
}
|
|
3953
4006
|
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
4007
|
+
/**
|
|
4008
|
+
* Determine if a value is an ArrayBuffer
|
|
4009
|
+
*
|
|
4010
|
+
* @param {Object} val The value to test
|
|
4011
|
+
* @returns {boolean} True if value is an ArrayBuffer, otherwise false
|
|
4012
|
+
*/
|
|
4013
|
+
function isArrayBuffer(val) {
|
|
4014
|
+
return toString.call(val) === '[object ArrayBuffer]';
|
|
4015
|
+
}
|
|
3959
4016
|
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
|
|
4017
|
+
/**
|
|
4018
|
+
* Determine if a value is a FormData
|
|
4019
|
+
*
|
|
4020
|
+
* @param {Object} val The value to test
|
|
4021
|
+
* @returns {boolean} True if value is an FormData, otherwise false
|
|
4022
|
+
*/
|
|
4023
|
+
function isFormData(val) {
|
|
4024
|
+
return toString.call(val) === '[object FormData]';
|
|
4025
|
+
}
|
|
4026
|
+
|
|
4027
|
+
/**
|
|
4028
|
+
* Determine if a value is a view on an ArrayBuffer
|
|
4029
|
+
*
|
|
4030
|
+
* @param {Object} val The value to test
|
|
4031
|
+
* @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
|
|
4032
|
+
*/
|
|
4033
|
+
function isArrayBufferView(val) {
|
|
4034
|
+
var result;
|
|
4035
|
+
if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
|
|
4036
|
+
result = ArrayBuffer.isView(val);
|
|
4037
|
+
} else {
|
|
4038
|
+
result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));
|
|
3968
4039
|
}
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
mixins: [standardMessages],
|
|
3972
|
-
props: {
|
|
3973
|
-
dictionary: {
|
|
3974
|
-
type: Object,
|
|
3975
|
-
default: {},
|
|
3976
|
-
required: false
|
|
3977
|
-
},
|
|
3978
|
-
backgroundColor: {
|
|
3979
|
-
type: String,
|
|
3980
|
-
default: '#fff',
|
|
3981
|
-
required: false
|
|
3982
|
-
},
|
|
3983
|
-
token_cliente: {
|
|
3984
|
-
type: String,
|
|
3985
|
-
default: '',
|
|
3986
|
-
required: false
|
|
3987
|
-
},
|
|
3988
|
-
message: {
|
|
3989
|
-
type: String,
|
|
3990
|
-
default: '',
|
|
3991
|
-
required: false
|
|
3992
|
-
},
|
|
3993
|
-
messageType: {
|
|
3994
|
-
type: [Number, String],
|
|
3995
|
-
default: 1,
|
|
3996
|
-
required: false
|
|
3997
|
-
}
|
|
3998
|
-
},
|
|
3999
|
-
data: function data() {
|
|
4000
|
-
return {
|
|
4001
|
-
placement: "top",
|
|
4002
|
-
formatted_messages_1: [{
|
|
4003
|
-
cod: "T",
|
|
4004
|
-
value: "Todos"
|
|
4005
|
-
}],
|
|
4006
|
-
key_1: "T",
|
|
4007
|
-
formatted_messages_2: [],
|
|
4008
|
-
key_2: "",
|
|
4009
|
-
formatted_messages_3: [],
|
|
4010
|
-
key_3: ""
|
|
4011
|
-
};
|
|
4012
|
-
},
|
|
4013
|
-
mounted: function mounted() {
|
|
4014
|
-
this.receiveValueFormattedMessage(this.key_1, 2);
|
|
4015
|
-
},
|
|
4016
|
-
methods: {
|
|
4017
|
-
calculateSelectPosition: function calculateSelectPosition(dropdownList, component, sizes) {
|
|
4018
|
-
dropdownList.style.width = sizes.width;
|
|
4019
|
-
var popper = createPopper(component.$refs.toggle, dropdownList, {
|
|
4020
|
-
placement: this.placement
|
|
4021
|
-
});
|
|
4022
|
-
return function () {
|
|
4023
|
-
return popper.destroy();
|
|
4024
|
-
};
|
|
4025
|
-
},
|
|
4026
|
-
inputSelectKey1: function inputSelectKey1() {
|
|
4027
|
-
if (!this.key_1) {
|
|
4028
|
-
if (this.formatted_messages_2.length) this.formatted_messages_2 = [];
|
|
4029
|
-
if (this.key_2) this.key_2 = "";
|
|
4030
|
-
return;
|
|
4031
|
-
}
|
|
4040
|
+
return result;
|
|
4041
|
+
}
|
|
4032
4042
|
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
|
|
4036
|
-
|
|
4037
|
-
|
|
4038
|
-
|
|
4039
|
-
|
|
4040
|
-
|
|
4043
|
+
/**
|
|
4044
|
+
* Determine if a value is a String
|
|
4045
|
+
*
|
|
4046
|
+
* @param {Object} val The value to test
|
|
4047
|
+
* @returns {boolean} True if value is a String, otherwise false
|
|
4048
|
+
*/
|
|
4049
|
+
function isString(val) {
|
|
4050
|
+
return typeof val === 'string';
|
|
4051
|
+
}
|
|
4041
4052
|
|
|
4042
|
-
|
|
4043
|
-
|
|
4044
|
-
|
|
4045
|
-
|
|
4053
|
+
/**
|
|
4054
|
+
* Determine if a value is a Number
|
|
4055
|
+
*
|
|
4056
|
+
* @param {Object} val The value to test
|
|
4057
|
+
* @returns {boolean} True if value is a Number, otherwise false
|
|
4058
|
+
*/
|
|
4059
|
+
function isNumber(val) {
|
|
4060
|
+
return typeof val === 'number';
|
|
4061
|
+
}
|
|
4046
4062
|
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
|
|
4053
|
-
|
|
4063
|
+
/**
|
|
4064
|
+
* Determine if a value is an Object
|
|
4065
|
+
*
|
|
4066
|
+
* @param {Object} val The value to test
|
|
4067
|
+
* @returns {boolean} True if value is an Object, otherwise false
|
|
4068
|
+
*/
|
|
4069
|
+
function isObject(val) {
|
|
4070
|
+
return val !== null && typeof val === 'object';
|
|
4071
|
+
}
|
|
4054
4072
|
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
|
|
4065
|
-
var success = false;
|
|
4066
|
-
if (Array.isArray(messageData)) success = true;
|
|
4067
|
-
if (!success) this.$toasted.global.emConstrucao({
|
|
4068
|
-
msg: messageData ? messageData.msg : "Nao foi possível obter mensagens"
|
|
4069
|
-
});
|
|
4073
|
+
/**
|
|
4074
|
+
* Determine if a value is a plain Object
|
|
4075
|
+
*
|
|
4076
|
+
* @param {Object} val The value to test
|
|
4077
|
+
* @return {boolean} True if value is a plain Object, otherwise false
|
|
4078
|
+
*/
|
|
4079
|
+
function isPlainObject(val) {
|
|
4080
|
+
if (toString.call(val) !== '[object Object]') {
|
|
4081
|
+
return false;
|
|
4082
|
+
}
|
|
4070
4083
|
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
this.formatted_messages_2.push(messageData);
|
|
4075
|
-
this.key_2 = this.formatted_messages_2[0];
|
|
4076
|
-
} else {
|
|
4077
|
-
this.formatted_messages_2 = messageData;
|
|
4084
|
+
var prototype = Object.getPrototypeOf(val);
|
|
4085
|
+
return prototype === null || prototype === Object.prototype;
|
|
4086
|
+
}
|
|
4078
4087
|
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4088
|
+
/**
|
|
4089
|
+
* Determine if a value is a Date
|
|
4090
|
+
*
|
|
4091
|
+
* @param {Object} val The value to test
|
|
4092
|
+
* @returns {boolean} True if value is a Date, otherwise false
|
|
4093
|
+
*/
|
|
4094
|
+
function isDate(val) {
|
|
4095
|
+
return toString.call(val) === '[object Date]';
|
|
4096
|
+
}
|
|
4086
4097
|
|
|
4087
|
-
|
|
4098
|
+
/**
|
|
4099
|
+
* Determine if a value is a File
|
|
4100
|
+
*
|
|
4101
|
+
* @param {Object} val The value to test
|
|
4102
|
+
* @returns {boolean} True if value is a File, otherwise false
|
|
4103
|
+
*/
|
|
4104
|
+
function isFile(val) {
|
|
4105
|
+
return toString.call(val) === '[object File]';
|
|
4106
|
+
}
|
|
4088
4107
|
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
this.formatted_messages_3.push(this.dictionary.msg_erro_sem_msg_formatada);
|
|
4099
|
-
this.key_3 = this.formatted_messages_3[0];
|
|
4100
|
-
} else {
|
|
4101
|
-
this.formatted_messages_3 = messageData;
|
|
4108
|
+
/**
|
|
4109
|
+
* Determine if a value is a Blob
|
|
4110
|
+
*
|
|
4111
|
+
* @param {Object} val The value to test
|
|
4112
|
+
* @returns {boolean} True if value is a Blob, otherwise false
|
|
4113
|
+
*/
|
|
4114
|
+
function isBlob(val) {
|
|
4115
|
+
return toString.call(val) === '[object Blob]';
|
|
4116
|
+
}
|
|
4102
4117
|
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4118
|
+
/**
|
|
4119
|
+
* Determine if a value is a Function
|
|
4120
|
+
*
|
|
4121
|
+
* @param {Object} val The value to test
|
|
4122
|
+
* @returns {boolean} True if value is a Function, otherwise false
|
|
4123
|
+
*/
|
|
4124
|
+
function isFunction(val) {
|
|
4125
|
+
return toString.call(val) === '[object Function]';
|
|
4126
|
+
}
|
|
4110
4127
|
|
|
4111
|
-
|
|
4128
|
+
/**
|
|
4129
|
+
* Determine if a value is a Stream
|
|
4130
|
+
*
|
|
4131
|
+
* @param {Object} val The value to test
|
|
4132
|
+
* @returns {boolean} True if value is a Stream, otherwise false
|
|
4133
|
+
*/
|
|
4134
|
+
function isStream(val) {
|
|
4135
|
+
return isObject(val) && isFunction(val.pipe);
|
|
4136
|
+
}
|
|
4112
4137
|
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
|
|
4138
|
+
/**
|
|
4139
|
+
* Determine if a value is a URLSearchParams object
|
|
4140
|
+
*
|
|
4141
|
+
* @param {Object} val The value to test
|
|
4142
|
+
* @returns {boolean} True if value is a URLSearchParams object, otherwise false
|
|
4143
|
+
*/
|
|
4144
|
+
function isURLSearchParams(val) {
|
|
4145
|
+
return toString.call(val) === '[object URLSearchParams]';
|
|
4146
|
+
}
|
|
4147
|
+
|
|
4148
|
+
/**
|
|
4149
|
+
* Trim excess whitespace off the beginning and end of a string
|
|
4150
|
+
*
|
|
4151
|
+
* @param {String} str The String to trim
|
|
4152
|
+
* @returns {String} The String freed of excess whitespace
|
|
4153
|
+
*/
|
|
4154
|
+
function trim(str) {
|
|
4155
|
+
return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, '');
|
|
4156
|
+
}
|
|
4157
|
+
|
|
4158
|
+
/**
|
|
4159
|
+
* Determine if we're running in a standard browser environment
|
|
4160
|
+
*
|
|
4161
|
+
* This allows axios to run in a web worker, and react-native.
|
|
4162
|
+
* Both environments support XMLHttpRequest, but not fully standard globals.
|
|
4163
|
+
*
|
|
4164
|
+
* web workers:
|
|
4165
|
+
* typeof window -> undefined
|
|
4166
|
+
* typeof document -> undefined
|
|
4167
|
+
*
|
|
4168
|
+
* react-native:
|
|
4169
|
+
* navigator.product -> 'ReactNative'
|
|
4170
|
+
* nativescript
|
|
4171
|
+
* navigator.product -> 'NativeScript' or 'NS'
|
|
4172
|
+
*/
|
|
4173
|
+
function isStandardBrowserEnv() {
|
|
4174
|
+
if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||
|
|
4175
|
+
navigator.product === 'NativeScript' ||
|
|
4176
|
+
navigator.product === 'NS')) {
|
|
4177
|
+
return false;
|
|
4178
|
+
}
|
|
4179
|
+
return (
|
|
4180
|
+
typeof window !== 'undefined' &&
|
|
4181
|
+
typeof document !== 'undefined'
|
|
4182
|
+
);
|
|
4183
|
+
}
|
|
4184
|
+
|
|
4185
|
+
/**
|
|
4186
|
+
* Iterate over an Array or an Object invoking a function for each item.
|
|
4187
|
+
*
|
|
4188
|
+
* If `obj` is an Array callback will be called passing
|
|
4189
|
+
* the value, index, and complete array for each item.
|
|
4190
|
+
*
|
|
4191
|
+
* If 'obj' is an Object callback will be called passing
|
|
4192
|
+
* the value, key, and complete object for each property.
|
|
4193
|
+
*
|
|
4194
|
+
* @param {Object|Array} obj The object to iterate
|
|
4195
|
+
* @param {Function} fn The callback to invoke for each item
|
|
4196
|
+
*/
|
|
4197
|
+
function forEach(obj, fn) {
|
|
4198
|
+
// Don't bother if no value provided
|
|
4199
|
+
if (obj === null || typeof obj === 'undefined') {
|
|
4200
|
+
return;
|
|
4201
|
+
}
|
|
4202
|
+
|
|
4203
|
+
// Force an array if not already something iterable
|
|
4204
|
+
if (typeof obj !== 'object') {
|
|
4205
|
+
/*eslint no-param-reassign:0*/
|
|
4206
|
+
obj = [obj];
|
|
4207
|
+
}
|
|
4208
|
+
|
|
4209
|
+
if (isArray(obj)) {
|
|
4210
|
+
// Iterate over array values
|
|
4211
|
+
for (var i = 0, l = obj.length; i < l; i++) {
|
|
4212
|
+
fn.call(null, obj[i], i, obj);
|
|
4213
|
+
}
|
|
4214
|
+
} else {
|
|
4215
|
+
// Iterate over object keys
|
|
4216
|
+
for (var key in obj) {
|
|
4217
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
4218
|
+
fn.call(null, obj[key], key, obj);
|
|
4219
|
+
}
|
|
4220
|
+
}
|
|
4221
|
+
}
|
|
4222
|
+
}
|
|
4223
|
+
|
|
4224
|
+
/**
|
|
4225
|
+
* Accepts varargs expecting each argument to be an object, then
|
|
4226
|
+
* immutably merges the properties of each object and returns result.
|
|
4227
|
+
*
|
|
4228
|
+
* When multiple objects contain the same key the later object in
|
|
4229
|
+
* the arguments list will take precedence.
|
|
4230
|
+
*
|
|
4231
|
+
* Example:
|
|
4232
|
+
*
|
|
4233
|
+
* ```js
|
|
4234
|
+
* var result = merge({foo: 123}, {foo: 456});
|
|
4235
|
+
* console.log(result.foo); // outputs 456
|
|
4236
|
+
* ```
|
|
4237
|
+
*
|
|
4238
|
+
* @param {Object} obj1 Object to merge
|
|
4239
|
+
* @returns {Object} Result of all merge properties
|
|
4240
|
+
*/
|
|
4241
|
+
function merge(/* obj1, obj2, obj3, ... */) {
|
|
4242
|
+
var result = {};
|
|
4243
|
+
function assignValue(val, key) {
|
|
4244
|
+
if (isPlainObject(result[key]) && isPlainObject(val)) {
|
|
4245
|
+
result[key] = merge(result[key], val);
|
|
4246
|
+
} else if (isPlainObject(val)) {
|
|
4247
|
+
result[key] = merge({}, val);
|
|
4248
|
+
} else if (isArray(val)) {
|
|
4249
|
+
result[key] = val.slice();
|
|
4250
|
+
} else {
|
|
4251
|
+
result[key] = val;
|
|
4252
|
+
}
|
|
4253
|
+
}
|
|
4254
|
+
|
|
4255
|
+
for (var i = 0, l = arguments.length; i < l; i++) {
|
|
4256
|
+
forEach(arguments[i], assignValue);
|
|
4257
|
+
}
|
|
4258
|
+
return result;
|
|
4259
|
+
}
|
|
4260
|
+
|
|
4261
|
+
/**
|
|
4262
|
+
* Extends object a by mutably adding to it the properties of object b.
|
|
4263
|
+
*
|
|
4264
|
+
* @param {Object} a The object to be extended
|
|
4265
|
+
* @param {Object} b The object to copy properties from
|
|
4266
|
+
* @param {Object} thisArg The object to bind function to
|
|
4267
|
+
* @return {Object} The resulting value of object a
|
|
4268
|
+
*/
|
|
4269
|
+
function extend(a, b, thisArg) {
|
|
4270
|
+
forEach(b, function assignValue(val, key) {
|
|
4271
|
+
if (thisArg && typeof val === 'function') {
|
|
4272
|
+
a[key] = bind(val, thisArg);
|
|
4273
|
+
} else {
|
|
4274
|
+
a[key] = val;
|
|
4275
|
+
}
|
|
4276
|
+
});
|
|
4277
|
+
return a;
|
|
4278
|
+
}
|
|
4279
|
+
|
|
4280
|
+
/**
|
|
4281
|
+
* Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
|
|
4282
|
+
*
|
|
4283
|
+
* @param {string} content with BOM
|
|
4284
|
+
* @return {string} content value without BOM
|
|
4285
|
+
*/
|
|
4286
|
+
function stripBOM(content) {
|
|
4287
|
+
if (content.charCodeAt(0) === 0xFEFF) {
|
|
4288
|
+
content = content.slice(1);
|
|
4289
|
+
}
|
|
4290
|
+
return content;
|
|
4291
|
+
}
|
|
4292
|
+
|
|
4293
|
+
var utils = {
|
|
4294
|
+
isArray: isArray,
|
|
4295
|
+
isArrayBuffer: isArrayBuffer,
|
|
4296
|
+
isBuffer: isBuffer,
|
|
4297
|
+
isFormData: isFormData,
|
|
4298
|
+
isArrayBufferView: isArrayBufferView,
|
|
4299
|
+
isString: isString,
|
|
4300
|
+
isNumber: isNumber,
|
|
4301
|
+
isObject: isObject,
|
|
4302
|
+
isPlainObject: isPlainObject,
|
|
4303
|
+
isUndefined: isUndefined,
|
|
4304
|
+
isDate: isDate,
|
|
4305
|
+
isFile: isFile,
|
|
4306
|
+
isBlob: isBlob,
|
|
4307
|
+
isFunction: isFunction,
|
|
4308
|
+
isStream: isStream,
|
|
4309
|
+
isURLSearchParams: isURLSearchParams,
|
|
4310
|
+
isStandardBrowserEnv: isStandardBrowserEnv,
|
|
4311
|
+
forEach: forEach,
|
|
4312
|
+
merge: merge,
|
|
4313
|
+
extend: extend,
|
|
4314
|
+
trim: trim,
|
|
4315
|
+
stripBOM: stripBOM
|
|
4316
|
+
};function encode(val) {
|
|
4317
|
+
return encodeURIComponent(val).
|
|
4318
|
+
replace(/%3A/gi, ':').
|
|
4319
|
+
replace(/%24/g, '$').
|
|
4320
|
+
replace(/%2C/gi, ',').
|
|
4321
|
+
replace(/%20/g, '+').
|
|
4322
|
+
replace(/%5B/gi, '[').
|
|
4323
|
+
replace(/%5D/gi, ']');
|
|
4324
|
+
}
|
|
4325
|
+
|
|
4326
|
+
/**
|
|
4327
|
+
* Build a URL by appending params to the end
|
|
4328
|
+
*
|
|
4329
|
+
* @param {string} url The base of the url (e.g., http://www.google.com)
|
|
4330
|
+
* @param {object} [params] The params to be appended
|
|
4331
|
+
* @returns {string} The formatted url
|
|
4332
|
+
*/
|
|
4333
|
+
var buildURL = function buildURL(url, params, paramsSerializer) {
|
|
4334
|
+
/*eslint no-param-reassign:0*/
|
|
4335
|
+
if (!params) {
|
|
4336
|
+
return url;
|
|
4337
|
+
}
|
|
4338
|
+
|
|
4339
|
+
var serializedParams;
|
|
4340
|
+
if (paramsSerializer) {
|
|
4341
|
+
serializedParams = paramsSerializer(params);
|
|
4342
|
+
} else if (utils.isURLSearchParams(params)) {
|
|
4343
|
+
serializedParams = params.toString();
|
|
4344
|
+
} else {
|
|
4345
|
+
var parts = [];
|
|
4346
|
+
|
|
4347
|
+
utils.forEach(params, function serialize(val, key) {
|
|
4348
|
+
if (val === null || typeof val === 'undefined') {
|
|
4349
|
+
return;
|
|
4350
|
+
}
|
|
4351
|
+
|
|
4352
|
+
if (utils.isArray(val)) {
|
|
4353
|
+
key = key + '[]';
|
|
4354
|
+
} else {
|
|
4355
|
+
val = [val];
|
|
4356
|
+
}
|
|
4357
|
+
|
|
4358
|
+
utils.forEach(val, function parseValue(v) {
|
|
4359
|
+
if (utils.isDate(v)) {
|
|
4360
|
+
v = v.toISOString();
|
|
4361
|
+
} else if (utils.isObject(v)) {
|
|
4362
|
+
v = JSON.stringify(v);
|
|
4363
|
+
}
|
|
4364
|
+
parts.push(encode(key) + '=' + encode(v));
|
|
4365
|
+
});
|
|
4366
|
+
});
|
|
4367
|
+
|
|
4368
|
+
serializedParams = parts.join('&');
|
|
4369
|
+
}
|
|
4370
|
+
|
|
4371
|
+
if (serializedParams) {
|
|
4372
|
+
var hashmarkIndex = url.indexOf('#');
|
|
4373
|
+
if (hashmarkIndex !== -1) {
|
|
4374
|
+
url = url.slice(0, hashmarkIndex);
|
|
4375
|
+
}
|
|
4376
|
+
|
|
4377
|
+
url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
|
|
4378
|
+
}
|
|
4379
|
+
|
|
4380
|
+
return url;
|
|
4381
|
+
};function InterceptorManager() {
|
|
4382
|
+
this.handlers = [];
|
|
4383
|
+
}
|
|
4384
|
+
|
|
4385
|
+
/**
|
|
4386
|
+
* Add a new interceptor to the stack
|
|
4387
|
+
*
|
|
4388
|
+
* @param {Function} fulfilled The function to handle `then` for a `Promise`
|
|
4389
|
+
* @param {Function} rejected The function to handle `reject` for a `Promise`
|
|
4390
|
+
*
|
|
4391
|
+
* @return {Number} An ID used to remove interceptor later
|
|
4392
|
+
*/
|
|
4393
|
+
InterceptorManager.prototype.use = function use(fulfilled, rejected, options) {
|
|
4394
|
+
this.handlers.push({
|
|
4395
|
+
fulfilled: fulfilled,
|
|
4396
|
+
rejected: rejected,
|
|
4397
|
+
synchronous: options ? options.synchronous : false,
|
|
4398
|
+
runWhen: options ? options.runWhen : null
|
|
4399
|
+
});
|
|
4400
|
+
return this.handlers.length - 1;
|
|
4401
|
+
};
|
|
4402
|
+
|
|
4403
|
+
/**
|
|
4404
|
+
* Remove an interceptor from the stack
|
|
4405
|
+
*
|
|
4406
|
+
* @param {Number} id The ID that was returned by `use`
|
|
4407
|
+
*/
|
|
4408
|
+
InterceptorManager.prototype.eject = function eject(id) {
|
|
4409
|
+
if (this.handlers[id]) {
|
|
4410
|
+
this.handlers[id] = null;
|
|
4411
|
+
}
|
|
4412
|
+
};
|
|
4413
|
+
|
|
4414
|
+
/**
|
|
4415
|
+
* Iterate over all the registered interceptors
|
|
4416
|
+
*
|
|
4417
|
+
* This method is particularly useful for skipping over any
|
|
4418
|
+
* interceptors that may have become `null` calling `eject`.
|
|
4419
|
+
*
|
|
4420
|
+
* @param {Function} fn The function to call for each interceptor
|
|
4421
|
+
*/
|
|
4422
|
+
InterceptorManager.prototype.forEach = function forEach(fn) {
|
|
4423
|
+
utils.forEach(this.handlers, function forEachHandler(h) {
|
|
4424
|
+
if (h !== null) {
|
|
4425
|
+
fn(h);
|
|
4426
|
+
}
|
|
4427
|
+
});
|
|
4428
|
+
};
|
|
4429
|
+
|
|
4430
|
+
var InterceptorManager_1 = InterceptorManager;var normalizeHeaderName = function normalizeHeaderName(headers, normalizedName) {
|
|
4431
|
+
utils.forEach(headers, function processHeader(value, name) {
|
|
4432
|
+
if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
|
|
4433
|
+
headers[normalizedName] = value;
|
|
4434
|
+
delete headers[name];
|
|
4435
|
+
}
|
|
4436
|
+
});
|
|
4437
|
+
};/**
|
|
4438
|
+
* Update an Error with the specified config, error code, and response.
|
|
4439
|
+
*
|
|
4440
|
+
* @param {Error} error The error to update.
|
|
4441
|
+
* @param {Object} config The config.
|
|
4442
|
+
* @param {string} [code] The error code (for example, 'ECONNABORTED').
|
|
4443
|
+
* @param {Object} [request] The request.
|
|
4444
|
+
* @param {Object} [response] The response.
|
|
4445
|
+
* @returns {Error} The error.
|
|
4446
|
+
*/
|
|
4447
|
+
var enhanceError = function enhanceError(error, config, code, request, response) {
|
|
4448
|
+
error.config = config;
|
|
4449
|
+
if (code) {
|
|
4450
|
+
error.code = code;
|
|
4451
|
+
}
|
|
4452
|
+
|
|
4453
|
+
error.request = request;
|
|
4454
|
+
error.response = response;
|
|
4455
|
+
error.isAxiosError = true;
|
|
4456
|
+
|
|
4457
|
+
error.toJSON = function toJSON() {
|
|
4458
|
+
return {
|
|
4459
|
+
// Standard
|
|
4460
|
+
message: this.message,
|
|
4461
|
+
name: this.name,
|
|
4462
|
+
// Microsoft
|
|
4463
|
+
description: this.description,
|
|
4464
|
+
number: this.number,
|
|
4465
|
+
// Mozilla
|
|
4466
|
+
fileName: this.fileName,
|
|
4467
|
+
lineNumber: this.lineNumber,
|
|
4468
|
+
columnNumber: this.columnNumber,
|
|
4469
|
+
stack: this.stack,
|
|
4470
|
+
// Axios
|
|
4471
|
+
config: this.config,
|
|
4472
|
+
code: this.code,
|
|
4473
|
+
status: this.response && this.response.status ? this.response.status : null
|
|
4474
|
+
};
|
|
4475
|
+
};
|
|
4476
|
+
return error;
|
|
4477
|
+
};/**
|
|
4478
|
+
* Create an Error with the specified message, config, error code, request and response.
|
|
4479
|
+
*
|
|
4480
|
+
* @param {string} message The error message.
|
|
4481
|
+
* @param {Object} config The config.
|
|
4482
|
+
* @param {string} [code] The error code (for example, 'ECONNABORTED').
|
|
4483
|
+
* @param {Object} [request] The request.
|
|
4484
|
+
* @param {Object} [response] The response.
|
|
4485
|
+
* @returns {Error} The created error.
|
|
4486
|
+
*/
|
|
4487
|
+
var createError = function createError(message, config, code, request, response) {
|
|
4488
|
+
var error = new Error(message);
|
|
4489
|
+
return enhanceError(error, config, code, request, response);
|
|
4490
|
+
};/**
|
|
4491
|
+
* Resolve or reject a Promise based on response status.
|
|
4492
|
+
*
|
|
4493
|
+
* @param {Function} resolve A function that resolves the promise.
|
|
4494
|
+
* @param {Function} reject A function that rejects the promise.
|
|
4495
|
+
* @param {object} response The response.
|
|
4496
|
+
*/
|
|
4497
|
+
var settle = function settle(resolve, reject, response) {
|
|
4498
|
+
var validateStatus = response.config.validateStatus;
|
|
4499
|
+
if (!response.status || !validateStatus || validateStatus(response.status)) {
|
|
4500
|
+
resolve(response);
|
|
4501
|
+
} else {
|
|
4502
|
+
reject(createError(
|
|
4503
|
+
'Request failed with status code ' + response.status,
|
|
4504
|
+
response.config,
|
|
4505
|
+
null,
|
|
4506
|
+
response.request,
|
|
4507
|
+
response
|
|
4508
|
+
));
|
|
4509
|
+
}
|
|
4510
|
+
};var cookies = (
|
|
4511
|
+
utils.isStandardBrowserEnv() ?
|
|
4512
|
+
|
|
4513
|
+
// Standard browser envs support document.cookie
|
|
4514
|
+
(function standardBrowserEnv() {
|
|
4515
|
+
return {
|
|
4516
|
+
write: function write(name, value, expires, path, domain, secure) {
|
|
4517
|
+
var cookie = [];
|
|
4518
|
+
cookie.push(name + '=' + encodeURIComponent(value));
|
|
4519
|
+
|
|
4520
|
+
if (utils.isNumber(expires)) {
|
|
4521
|
+
cookie.push('expires=' + new Date(expires).toGMTString());
|
|
4522
|
+
}
|
|
4523
|
+
|
|
4524
|
+
if (utils.isString(path)) {
|
|
4525
|
+
cookie.push('path=' + path);
|
|
4526
|
+
}
|
|
4527
|
+
|
|
4528
|
+
if (utils.isString(domain)) {
|
|
4529
|
+
cookie.push('domain=' + domain);
|
|
4530
|
+
}
|
|
4531
|
+
|
|
4532
|
+
if (secure === true) {
|
|
4533
|
+
cookie.push('secure');
|
|
4534
|
+
}
|
|
4535
|
+
|
|
4536
|
+
document.cookie = cookie.join('; ');
|
|
4537
|
+
},
|
|
4538
|
+
|
|
4539
|
+
read: function read(name) {
|
|
4540
|
+
var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
|
|
4541
|
+
return (match ? decodeURIComponent(match[3]) : null);
|
|
4542
|
+
},
|
|
4543
|
+
|
|
4544
|
+
remove: function remove(name) {
|
|
4545
|
+
this.write(name, '', Date.now() - 86400000);
|
|
4546
|
+
}
|
|
4547
|
+
};
|
|
4548
|
+
})() :
|
|
4549
|
+
|
|
4550
|
+
// Non standard browser env (web workers, react-native) lack needed support.
|
|
4551
|
+
(function nonStandardBrowserEnv() {
|
|
4552
|
+
return {
|
|
4553
|
+
write: function write() {},
|
|
4554
|
+
read: function read() { return null; },
|
|
4555
|
+
remove: function remove() {}
|
|
4556
|
+
};
|
|
4557
|
+
})()
|
|
4558
|
+
);/**
|
|
4559
|
+
* Determines whether the specified URL is absolute
|
|
4560
|
+
*
|
|
4561
|
+
* @param {string} url The URL to test
|
|
4562
|
+
* @returns {boolean} True if the specified URL is absolute, otherwise false
|
|
4563
|
+
*/
|
|
4564
|
+
var isAbsoluteURL = function isAbsoluteURL(url) {
|
|
4565
|
+
// A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
|
|
4566
|
+
// RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
|
|
4567
|
+
// by any combination of letters, digits, plus, period, or hyphen.
|
|
4568
|
+
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
|
|
4569
|
+
};/**
|
|
4570
|
+
* Creates a new URL by combining the specified URLs
|
|
4571
|
+
*
|
|
4572
|
+
* @param {string} baseURL The base URL
|
|
4573
|
+
* @param {string} relativeURL The relative URL
|
|
4574
|
+
* @returns {string} The combined URL
|
|
4575
|
+
*/
|
|
4576
|
+
var combineURLs = function combineURLs(baseURL, relativeURL) {
|
|
4577
|
+
return relativeURL
|
|
4578
|
+
? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')
|
|
4579
|
+
: baseURL;
|
|
4580
|
+
};/**
|
|
4581
|
+
* Creates a new URL by combining the baseURL with the requestedURL,
|
|
4582
|
+
* only when the requestedURL is not already an absolute URL.
|
|
4583
|
+
* If the requestURL is absolute, this function returns the requestedURL untouched.
|
|
4584
|
+
*
|
|
4585
|
+
* @param {string} baseURL The base URL
|
|
4586
|
+
* @param {string} requestedURL Absolute or relative URL to combine
|
|
4587
|
+
* @returns {string} The combined full path
|
|
4588
|
+
*/
|
|
4589
|
+
var buildFullPath = function buildFullPath(baseURL, requestedURL) {
|
|
4590
|
+
if (baseURL && !isAbsoluteURL(requestedURL)) {
|
|
4591
|
+
return combineURLs(baseURL, requestedURL);
|
|
4592
|
+
}
|
|
4593
|
+
return requestedURL;
|
|
4594
|
+
};// Headers whose duplicates are ignored by node
|
|
4595
|
+
// c.f. https://nodejs.org/api/http.html#http_message_headers
|
|
4596
|
+
var ignoreDuplicateOf = [
|
|
4597
|
+
'age', 'authorization', 'content-length', 'content-type', 'etag',
|
|
4598
|
+
'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
|
|
4599
|
+
'last-modified', 'location', 'max-forwards', 'proxy-authorization',
|
|
4600
|
+
'referer', 'retry-after', 'user-agent'
|
|
4601
|
+
];
|
|
4602
|
+
|
|
4603
|
+
/**
|
|
4604
|
+
* Parse headers into an object
|
|
4605
|
+
*
|
|
4606
|
+
* ```
|
|
4607
|
+
* Date: Wed, 27 Aug 2014 08:58:49 GMT
|
|
4608
|
+
* Content-Type: application/json
|
|
4609
|
+
* Connection: keep-alive
|
|
4610
|
+
* Transfer-Encoding: chunked
|
|
4611
|
+
* ```
|
|
4612
|
+
*
|
|
4613
|
+
* @param {String} headers Headers needing to be parsed
|
|
4614
|
+
* @returns {Object} Headers parsed into an object
|
|
4615
|
+
*/
|
|
4616
|
+
var parseHeaders = function parseHeaders(headers) {
|
|
4617
|
+
var parsed = {};
|
|
4618
|
+
var key;
|
|
4619
|
+
var val;
|
|
4620
|
+
var i;
|
|
4621
|
+
|
|
4622
|
+
if (!headers) { return parsed; }
|
|
4623
|
+
|
|
4624
|
+
utils.forEach(headers.split('\n'), function parser(line) {
|
|
4625
|
+
i = line.indexOf(':');
|
|
4626
|
+
key = utils.trim(line.substr(0, i)).toLowerCase();
|
|
4627
|
+
val = utils.trim(line.substr(i + 1));
|
|
4628
|
+
|
|
4629
|
+
if (key) {
|
|
4630
|
+
if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {
|
|
4631
|
+
return;
|
|
4632
|
+
}
|
|
4633
|
+
if (key === 'set-cookie') {
|
|
4634
|
+
parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);
|
|
4635
|
+
} else {
|
|
4636
|
+
parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
|
|
4637
|
+
}
|
|
4638
|
+
}
|
|
4639
|
+
});
|
|
4640
|
+
|
|
4641
|
+
return parsed;
|
|
4642
|
+
};var isURLSameOrigin = (
|
|
4643
|
+
utils.isStandardBrowserEnv() ?
|
|
4644
|
+
|
|
4645
|
+
// Standard browser envs have full support of the APIs needed to test
|
|
4646
|
+
// whether the request URL is of the same origin as current location.
|
|
4647
|
+
(function standardBrowserEnv() {
|
|
4648
|
+
var msie = /(msie|trident)/i.test(navigator.userAgent);
|
|
4649
|
+
var urlParsingNode = document.createElement('a');
|
|
4650
|
+
var originURL;
|
|
4651
|
+
|
|
4652
|
+
/**
|
|
4653
|
+
* Parse a URL to discover it's components
|
|
4654
|
+
*
|
|
4655
|
+
* @param {String} url The URL to be parsed
|
|
4656
|
+
* @returns {Object}
|
|
4657
|
+
*/
|
|
4658
|
+
function resolveURL(url) {
|
|
4659
|
+
var href = url;
|
|
4660
|
+
|
|
4661
|
+
if (msie) {
|
|
4662
|
+
// IE needs attribute set twice to normalize properties
|
|
4663
|
+
urlParsingNode.setAttribute('href', href);
|
|
4664
|
+
href = urlParsingNode.href;
|
|
4665
|
+
}
|
|
4666
|
+
|
|
4667
|
+
urlParsingNode.setAttribute('href', href);
|
|
4668
|
+
|
|
4669
|
+
// urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
|
|
4670
|
+
return {
|
|
4671
|
+
href: urlParsingNode.href,
|
|
4672
|
+
protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
|
|
4673
|
+
host: urlParsingNode.host,
|
|
4674
|
+
search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
|
|
4675
|
+
hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
|
|
4676
|
+
hostname: urlParsingNode.hostname,
|
|
4677
|
+
port: urlParsingNode.port,
|
|
4678
|
+
pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
|
|
4679
|
+
urlParsingNode.pathname :
|
|
4680
|
+
'/' + urlParsingNode.pathname
|
|
4681
|
+
};
|
|
4682
|
+
}
|
|
4683
|
+
|
|
4684
|
+
originURL = resolveURL(window.location.href);
|
|
4685
|
+
|
|
4686
|
+
/**
|
|
4687
|
+
* Determine if a URL shares the same origin as the current location
|
|
4688
|
+
*
|
|
4689
|
+
* @param {String} requestURL The URL to test
|
|
4690
|
+
* @returns {boolean} True if URL shares the same origin, otherwise false
|
|
4691
|
+
*/
|
|
4692
|
+
return function isURLSameOrigin(requestURL) {
|
|
4693
|
+
var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
|
|
4694
|
+
return (parsed.protocol === originURL.protocol &&
|
|
4695
|
+
parsed.host === originURL.host);
|
|
4696
|
+
};
|
|
4697
|
+
})() :
|
|
4698
|
+
|
|
4699
|
+
// Non standard browser envs (web workers, react-native) lack needed support.
|
|
4700
|
+
(function nonStandardBrowserEnv() {
|
|
4701
|
+
return function isURLSameOrigin() {
|
|
4702
|
+
return true;
|
|
4703
|
+
};
|
|
4704
|
+
})()
|
|
4705
|
+
);/**
|
|
4706
|
+
* A `Cancel` is an object that is thrown when an operation is canceled.
|
|
4707
|
+
*
|
|
4708
|
+
* @class
|
|
4709
|
+
* @param {string=} message The message.
|
|
4710
|
+
*/
|
|
4711
|
+
function Cancel(message) {
|
|
4712
|
+
this.message = message;
|
|
4713
|
+
}
|
|
4714
|
+
|
|
4715
|
+
Cancel.prototype.toString = function toString() {
|
|
4716
|
+
return 'Cancel' + (this.message ? ': ' + this.message : '');
|
|
4717
|
+
};
|
|
4718
|
+
|
|
4719
|
+
Cancel.prototype.__CANCEL__ = true;
|
|
4720
|
+
|
|
4721
|
+
var Cancel_1 = Cancel;var defaults$1 = defaults_1;var xhr = function xhrAdapter(config) {
|
|
4722
|
+
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
4723
|
+
var requestData = config.data;
|
|
4724
|
+
var requestHeaders = config.headers;
|
|
4725
|
+
var responseType = config.responseType;
|
|
4726
|
+
var onCanceled;
|
|
4727
|
+
function done() {
|
|
4728
|
+
if (config.cancelToken) {
|
|
4729
|
+
config.cancelToken.unsubscribe(onCanceled);
|
|
4730
|
+
}
|
|
4731
|
+
|
|
4732
|
+
if (config.signal) {
|
|
4733
|
+
config.signal.removeEventListener('abort', onCanceled);
|
|
4734
|
+
}
|
|
4735
|
+
}
|
|
4736
|
+
|
|
4737
|
+
if (utils.isFormData(requestData)) {
|
|
4738
|
+
delete requestHeaders['Content-Type']; // Let the browser set it
|
|
4739
|
+
}
|
|
4740
|
+
|
|
4741
|
+
var request = new XMLHttpRequest();
|
|
4742
|
+
|
|
4743
|
+
// HTTP basic authentication
|
|
4744
|
+
if (config.auth) {
|
|
4745
|
+
var username = config.auth.username || '';
|
|
4746
|
+
var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';
|
|
4747
|
+
requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);
|
|
4748
|
+
}
|
|
4749
|
+
|
|
4750
|
+
var fullPath = buildFullPath(config.baseURL, config.url);
|
|
4751
|
+
request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
|
|
4752
|
+
|
|
4753
|
+
// Set the request timeout in MS
|
|
4754
|
+
request.timeout = config.timeout;
|
|
4755
|
+
|
|
4756
|
+
function onloadend() {
|
|
4757
|
+
if (!request) {
|
|
4758
|
+
return;
|
|
4759
|
+
}
|
|
4760
|
+
// Prepare the response
|
|
4761
|
+
var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;
|
|
4762
|
+
var responseData = !responseType || responseType === 'text' || responseType === 'json' ?
|
|
4763
|
+
request.responseText : request.response;
|
|
4764
|
+
var response = {
|
|
4765
|
+
data: responseData,
|
|
4766
|
+
status: request.status,
|
|
4767
|
+
statusText: request.statusText,
|
|
4768
|
+
headers: responseHeaders,
|
|
4769
|
+
config: config,
|
|
4770
|
+
request: request
|
|
4771
|
+
};
|
|
4772
|
+
|
|
4773
|
+
settle(function _resolve(value) {
|
|
4774
|
+
resolve(value);
|
|
4775
|
+
done();
|
|
4776
|
+
}, function _reject(err) {
|
|
4777
|
+
reject(err);
|
|
4778
|
+
done();
|
|
4779
|
+
}, response);
|
|
4780
|
+
|
|
4781
|
+
// Clean up request
|
|
4782
|
+
request = null;
|
|
4783
|
+
}
|
|
4784
|
+
|
|
4785
|
+
if ('onloadend' in request) {
|
|
4786
|
+
// Use onloadend if available
|
|
4787
|
+
request.onloadend = onloadend;
|
|
4788
|
+
} else {
|
|
4789
|
+
// Listen for ready state to emulate onloadend
|
|
4790
|
+
request.onreadystatechange = function handleLoad() {
|
|
4791
|
+
if (!request || request.readyState !== 4) {
|
|
4792
|
+
return;
|
|
4793
|
+
}
|
|
4794
|
+
|
|
4795
|
+
// The request errored out and we didn't get a response, this will be
|
|
4796
|
+
// handled by onerror instead
|
|
4797
|
+
// With one exception: request that using file: protocol, most browsers
|
|
4798
|
+
// will return status as 0 even though it's a successful request
|
|
4799
|
+
if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
|
|
4800
|
+
return;
|
|
4801
|
+
}
|
|
4802
|
+
// readystate handler is calling before onerror or ontimeout handlers,
|
|
4803
|
+
// so we should call onloadend on the next 'tick'
|
|
4804
|
+
setTimeout(onloadend);
|
|
4805
|
+
};
|
|
4806
|
+
}
|
|
4807
|
+
|
|
4808
|
+
// Handle browser request cancellation (as opposed to a manual cancellation)
|
|
4809
|
+
request.onabort = function handleAbort() {
|
|
4810
|
+
if (!request) {
|
|
4811
|
+
return;
|
|
4812
|
+
}
|
|
4813
|
+
|
|
4814
|
+
reject(createError('Request aborted', config, 'ECONNABORTED', request));
|
|
4815
|
+
|
|
4816
|
+
// Clean up request
|
|
4817
|
+
request = null;
|
|
4818
|
+
};
|
|
4819
|
+
|
|
4820
|
+
// Handle low level network errors
|
|
4821
|
+
request.onerror = function handleError() {
|
|
4822
|
+
// Real errors are hidden from us by the browser
|
|
4823
|
+
// onerror should only fire if it's a network error
|
|
4824
|
+
reject(createError('Network Error', config, null, request));
|
|
4825
|
+
|
|
4826
|
+
// Clean up request
|
|
4827
|
+
request = null;
|
|
4828
|
+
};
|
|
4829
|
+
|
|
4830
|
+
// Handle timeout
|
|
4831
|
+
request.ontimeout = function handleTimeout() {
|
|
4832
|
+
var timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';
|
|
4833
|
+
var transitional = config.transitional || defaults$1.transitional;
|
|
4834
|
+
if (config.timeoutErrorMessage) {
|
|
4835
|
+
timeoutErrorMessage = config.timeoutErrorMessage;
|
|
4836
|
+
}
|
|
4837
|
+
reject(createError(
|
|
4838
|
+
timeoutErrorMessage,
|
|
4839
|
+
config,
|
|
4840
|
+
transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',
|
|
4841
|
+
request));
|
|
4842
|
+
|
|
4843
|
+
// Clean up request
|
|
4844
|
+
request = null;
|
|
4845
|
+
};
|
|
4846
|
+
|
|
4847
|
+
// Add xsrf header
|
|
4848
|
+
// This is only done if running in a standard browser environment.
|
|
4849
|
+
// Specifically not if we're in a web worker, or react-native.
|
|
4850
|
+
if (utils.isStandardBrowserEnv()) {
|
|
4851
|
+
// Add xsrf header
|
|
4852
|
+
var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?
|
|
4853
|
+
cookies.read(config.xsrfCookieName) :
|
|
4854
|
+
undefined;
|
|
4855
|
+
|
|
4856
|
+
if (xsrfValue) {
|
|
4857
|
+
requestHeaders[config.xsrfHeaderName] = xsrfValue;
|
|
4858
|
+
}
|
|
4859
|
+
}
|
|
4860
|
+
|
|
4861
|
+
// Add headers to the request
|
|
4862
|
+
if ('setRequestHeader' in request) {
|
|
4863
|
+
utils.forEach(requestHeaders, function setRequestHeader(val, key) {
|
|
4864
|
+
if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {
|
|
4865
|
+
// Remove Content-Type if data is undefined
|
|
4866
|
+
delete requestHeaders[key];
|
|
4867
|
+
} else {
|
|
4868
|
+
// Otherwise add header to the request
|
|
4869
|
+
request.setRequestHeader(key, val);
|
|
4870
|
+
}
|
|
4871
|
+
});
|
|
4872
|
+
}
|
|
4873
|
+
|
|
4874
|
+
// Add withCredentials to request if needed
|
|
4875
|
+
if (!utils.isUndefined(config.withCredentials)) {
|
|
4876
|
+
request.withCredentials = !!config.withCredentials;
|
|
4877
|
+
}
|
|
4878
|
+
|
|
4879
|
+
// Add responseType to request if needed
|
|
4880
|
+
if (responseType && responseType !== 'json') {
|
|
4881
|
+
request.responseType = config.responseType;
|
|
4882
|
+
}
|
|
4883
|
+
|
|
4884
|
+
// Handle progress if needed
|
|
4885
|
+
if (typeof config.onDownloadProgress === 'function') {
|
|
4886
|
+
request.addEventListener('progress', config.onDownloadProgress);
|
|
4887
|
+
}
|
|
4888
|
+
|
|
4889
|
+
// Not all browsers support upload events
|
|
4890
|
+
if (typeof config.onUploadProgress === 'function' && request.upload) {
|
|
4891
|
+
request.upload.addEventListener('progress', config.onUploadProgress);
|
|
4892
|
+
}
|
|
4893
|
+
|
|
4894
|
+
if (config.cancelToken || config.signal) {
|
|
4895
|
+
// Handle cancellation
|
|
4896
|
+
// eslint-disable-next-line func-names
|
|
4897
|
+
onCanceled = function(cancel) {
|
|
4898
|
+
if (!request) {
|
|
4899
|
+
return;
|
|
4900
|
+
}
|
|
4901
|
+
reject(!cancel || (cancel && cancel.type) ? new Cancel_1('canceled') : cancel);
|
|
4902
|
+
request.abort();
|
|
4903
|
+
request = null;
|
|
4904
|
+
};
|
|
4905
|
+
|
|
4906
|
+
config.cancelToken && config.cancelToken.subscribe(onCanceled);
|
|
4907
|
+
if (config.signal) {
|
|
4908
|
+
config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);
|
|
4909
|
+
}
|
|
4910
|
+
}
|
|
4911
|
+
|
|
4912
|
+
if (!requestData) {
|
|
4913
|
+
requestData = null;
|
|
4914
|
+
}
|
|
4915
|
+
|
|
4916
|
+
// Send the request
|
|
4917
|
+
request.send(requestData);
|
|
4918
|
+
});
|
|
4919
|
+
};function createCommonjsModule(fn, basedir, module) {
|
|
4920
|
+
return module = {
|
|
4921
|
+
path: basedir,
|
|
4922
|
+
exports: {},
|
|
4923
|
+
require: function (path, base) {
|
|
4924
|
+
return commonjsRequire(path, (base === undefined || base === null) ? module.path : base);
|
|
4925
|
+
}
|
|
4926
|
+
}, fn(module, module.exports), module.exports;
|
|
4927
|
+
}
|
|
4928
|
+
|
|
4929
|
+
function commonjsRequire () {
|
|
4930
|
+
throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
|
|
4931
|
+
}/**
|
|
4932
|
+
* Helpers.
|
|
4933
|
+
*/
|
|
4934
|
+
|
|
4935
|
+
var s = 1000;
|
|
4936
|
+
var m = s * 60;
|
|
4937
|
+
var h = m * 60;
|
|
4938
|
+
var d = h * 24;
|
|
4939
|
+
var w = d * 7;
|
|
4940
|
+
var y = d * 365.25;
|
|
4941
|
+
|
|
4942
|
+
/**
|
|
4943
|
+
* Parse or format the given `val`.
|
|
4944
|
+
*
|
|
4945
|
+
* Options:
|
|
4946
|
+
*
|
|
4947
|
+
* - `long` verbose formatting [false]
|
|
4948
|
+
*
|
|
4949
|
+
* @param {String|Number} val
|
|
4950
|
+
* @param {Object} [options]
|
|
4951
|
+
* @throws {Error} throw an error if val is not a non-empty string or a number
|
|
4952
|
+
* @return {String|Number}
|
|
4953
|
+
* @api public
|
|
4954
|
+
*/
|
|
4955
|
+
|
|
4956
|
+
var ms = function(val, options) {
|
|
4957
|
+
options = options || {};
|
|
4958
|
+
var type = typeof val;
|
|
4959
|
+
if (type === 'string' && val.length > 0) {
|
|
4960
|
+
return parse(val);
|
|
4961
|
+
} else if (type === 'number' && isFinite(val)) {
|
|
4962
|
+
return options.long ? fmtLong(val) : fmtShort(val);
|
|
4963
|
+
}
|
|
4964
|
+
throw new Error(
|
|
4965
|
+
'val is not a non-empty string or a valid number. val=' +
|
|
4966
|
+
JSON.stringify(val)
|
|
4967
|
+
);
|
|
4968
|
+
};
|
|
4969
|
+
|
|
4970
|
+
/**
|
|
4971
|
+
* Parse the given `str` and return milliseconds.
|
|
4972
|
+
*
|
|
4973
|
+
* @param {String} str
|
|
4974
|
+
* @return {Number}
|
|
4975
|
+
* @api private
|
|
4976
|
+
*/
|
|
4977
|
+
|
|
4978
|
+
function parse(str) {
|
|
4979
|
+
str = String(str);
|
|
4980
|
+
if (str.length > 100) {
|
|
4981
|
+
return;
|
|
4982
|
+
}
|
|
4983
|
+
var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
|
|
4984
|
+
str
|
|
4985
|
+
);
|
|
4986
|
+
if (!match) {
|
|
4987
|
+
return;
|
|
4988
|
+
}
|
|
4989
|
+
var n = parseFloat(match[1]);
|
|
4990
|
+
var type = (match[2] || 'ms').toLowerCase();
|
|
4991
|
+
switch (type) {
|
|
4992
|
+
case 'years':
|
|
4993
|
+
case 'year':
|
|
4994
|
+
case 'yrs':
|
|
4995
|
+
case 'yr':
|
|
4996
|
+
case 'y':
|
|
4997
|
+
return n * y;
|
|
4998
|
+
case 'weeks':
|
|
4999
|
+
case 'week':
|
|
5000
|
+
case 'w':
|
|
5001
|
+
return n * w;
|
|
5002
|
+
case 'days':
|
|
5003
|
+
case 'day':
|
|
5004
|
+
case 'd':
|
|
5005
|
+
return n * d;
|
|
5006
|
+
case 'hours':
|
|
5007
|
+
case 'hour':
|
|
5008
|
+
case 'hrs':
|
|
5009
|
+
case 'hr':
|
|
5010
|
+
case 'h':
|
|
5011
|
+
return n * h;
|
|
5012
|
+
case 'minutes':
|
|
5013
|
+
case 'minute':
|
|
5014
|
+
case 'mins':
|
|
5015
|
+
case 'min':
|
|
5016
|
+
case 'm':
|
|
5017
|
+
return n * m;
|
|
5018
|
+
case 'seconds':
|
|
5019
|
+
case 'second':
|
|
5020
|
+
case 'secs':
|
|
5021
|
+
case 'sec':
|
|
5022
|
+
case 's':
|
|
5023
|
+
return n * s;
|
|
5024
|
+
case 'milliseconds':
|
|
5025
|
+
case 'millisecond':
|
|
5026
|
+
case 'msecs':
|
|
5027
|
+
case 'msec':
|
|
5028
|
+
case 'ms':
|
|
5029
|
+
return n;
|
|
5030
|
+
default:
|
|
5031
|
+
return undefined;
|
|
5032
|
+
}
|
|
5033
|
+
}
|
|
5034
|
+
|
|
5035
|
+
/**
|
|
5036
|
+
* Short format for `ms`.
|
|
5037
|
+
*
|
|
5038
|
+
* @param {Number} ms
|
|
5039
|
+
* @return {String}
|
|
5040
|
+
* @api private
|
|
5041
|
+
*/
|
|
5042
|
+
|
|
5043
|
+
function fmtShort(ms) {
|
|
5044
|
+
var msAbs = Math.abs(ms);
|
|
5045
|
+
if (msAbs >= d) {
|
|
5046
|
+
return Math.round(ms / d) + 'd';
|
|
5047
|
+
}
|
|
5048
|
+
if (msAbs >= h) {
|
|
5049
|
+
return Math.round(ms / h) + 'h';
|
|
5050
|
+
}
|
|
5051
|
+
if (msAbs >= m) {
|
|
5052
|
+
return Math.round(ms / m) + 'm';
|
|
5053
|
+
}
|
|
5054
|
+
if (msAbs >= s) {
|
|
5055
|
+
return Math.round(ms / s) + 's';
|
|
5056
|
+
}
|
|
5057
|
+
return ms + 'ms';
|
|
5058
|
+
}
|
|
5059
|
+
|
|
5060
|
+
/**
|
|
5061
|
+
* Long format for `ms`.
|
|
5062
|
+
*
|
|
5063
|
+
* @param {Number} ms
|
|
5064
|
+
* @return {String}
|
|
5065
|
+
* @api private
|
|
5066
|
+
*/
|
|
5067
|
+
|
|
5068
|
+
function fmtLong(ms) {
|
|
5069
|
+
var msAbs = Math.abs(ms);
|
|
5070
|
+
if (msAbs >= d) {
|
|
5071
|
+
return plural(ms, msAbs, d, 'day');
|
|
5072
|
+
}
|
|
5073
|
+
if (msAbs >= h) {
|
|
5074
|
+
return plural(ms, msAbs, h, 'hour');
|
|
5075
|
+
}
|
|
5076
|
+
if (msAbs >= m) {
|
|
5077
|
+
return plural(ms, msAbs, m, 'minute');
|
|
5078
|
+
}
|
|
5079
|
+
if (msAbs >= s) {
|
|
5080
|
+
return plural(ms, msAbs, s, 'second');
|
|
5081
|
+
}
|
|
5082
|
+
return ms + ' ms';
|
|
5083
|
+
}
|
|
5084
|
+
|
|
5085
|
+
/**
|
|
5086
|
+
* Pluralization helper.
|
|
5087
|
+
*/
|
|
5088
|
+
|
|
5089
|
+
function plural(ms, msAbs, n, name) {
|
|
5090
|
+
var isPlural = msAbs >= n * 1.5;
|
|
5091
|
+
return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
|
|
5092
|
+
}/**
|
|
5093
|
+
* This is the common logic for both the Node.js and web browser
|
|
5094
|
+
* implementations of `debug()`.
|
|
5095
|
+
*/
|
|
5096
|
+
|
|
5097
|
+
function setup(env) {
|
|
5098
|
+
createDebug.debug = createDebug;
|
|
5099
|
+
createDebug.default = createDebug;
|
|
5100
|
+
createDebug.coerce = coerce;
|
|
5101
|
+
createDebug.disable = disable;
|
|
5102
|
+
createDebug.enable = enable;
|
|
5103
|
+
createDebug.enabled = enabled;
|
|
5104
|
+
createDebug.humanize = ms;
|
|
5105
|
+
createDebug.destroy = destroy;
|
|
5106
|
+
|
|
5107
|
+
Object.keys(env).forEach(key => {
|
|
5108
|
+
createDebug[key] = env[key];
|
|
5109
|
+
});
|
|
5110
|
+
|
|
5111
|
+
/**
|
|
5112
|
+
* The currently active debug mode names, and names to skip.
|
|
5113
|
+
*/
|
|
5114
|
+
|
|
5115
|
+
createDebug.names = [];
|
|
5116
|
+
createDebug.skips = [];
|
|
5117
|
+
|
|
5118
|
+
/**
|
|
5119
|
+
* Map of special "%n" handling functions, for the debug "format" argument.
|
|
5120
|
+
*
|
|
5121
|
+
* Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
|
|
5122
|
+
*/
|
|
5123
|
+
createDebug.formatters = {};
|
|
5124
|
+
|
|
5125
|
+
/**
|
|
5126
|
+
* Selects a color for a debug namespace
|
|
5127
|
+
* @param {String} namespace The namespace string for the for the debug instance to be colored
|
|
5128
|
+
* @return {Number|String} An ANSI color code for the given namespace
|
|
5129
|
+
* @api private
|
|
5130
|
+
*/
|
|
5131
|
+
function selectColor(namespace) {
|
|
5132
|
+
let hash = 0;
|
|
5133
|
+
|
|
5134
|
+
for (let i = 0; i < namespace.length; i++) {
|
|
5135
|
+
hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
|
|
5136
|
+
hash |= 0; // Convert to 32bit integer
|
|
5137
|
+
}
|
|
5138
|
+
|
|
5139
|
+
return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
|
|
5140
|
+
}
|
|
5141
|
+
createDebug.selectColor = selectColor;
|
|
5142
|
+
|
|
5143
|
+
/**
|
|
5144
|
+
* Create a debugger with the given `namespace`.
|
|
5145
|
+
*
|
|
5146
|
+
* @param {String} namespace
|
|
5147
|
+
* @return {Function}
|
|
5148
|
+
* @api public
|
|
5149
|
+
*/
|
|
5150
|
+
function createDebug(namespace) {
|
|
5151
|
+
let prevTime;
|
|
5152
|
+
let enableOverride = null;
|
|
5153
|
+
let namespacesCache;
|
|
5154
|
+
let enabledCache;
|
|
5155
|
+
|
|
5156
|
+
function debug(...args) {
|
|
5157
|
+
// Disabled?
|
|
5158
|
+
if (!debug.enabled) {
|
|
5159
|
+
return;
|
|
5160
|
+
}
|
|
5161
|
+
|
|
5162
|
+
const self = debug;
|
|
5163
|
+
|
|
5164
|
+
// Set `diff` timestamp
|
|
5165
|
+
const curr = Number(new Date());
|
|
5166
|
+
const ms = curr - (prevTime || curr);
|
|
5167
|
+
self.diff = ms;
|
|
5168
|
+
self.prev = prevTime;
|
|
5169
|
+
self.curr = curr;
|
|
5170
|
+
prevTime = curr;
|
|
5171
|
+
|
|
5172
|
+
args[0] = createDebug.coerce(args[0]);
|
|
5173
|
+
|
|
5174
|
+
if (typeof args[0] !== 'string') {
|
|
5175
|
+
// Anything else let's inspect with %O
|
|
5176
|
+
args.unshift('%O');
|
|
5177
|
+
}
|
|
5178
|
+
|
|
5179
|
+
// Apply any `formatters` transformations
|
|
5180
|
+
let index = 0;
|
|
5181
|
+
args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
|
|
5182
|
+
// If we encounter an escaped % then don't increase the array index
|
|
5183
|
+
if (match === '%%') {
|
|
5184
|
+
return '%';
|
|
5185
|
+
}
|
|
5186
|
+
index++;
|
|
5187
|
+
const formatter = createDebug.formatters[format];
|
|
5188
|
+
if (typeof formatter === 'function') {
|
|
5189
|
+
const val = args[index];
|
|
5190
|
+
match = formatter.call(self, val);
|
|
5191
|
+
|
|
5192
|
+
// Now we need to remove `args[index]` since it's inlined in the `format`
|
|
5193
|
+
args.splice(index, 1);
|
|
5194
|
+
index--;
|
|
5195
|
+
}
|
|
5196
|
+
return match;
|
|
5197
|
+
});
|
|
5198
|
+
|
|
5199
|
+
// Apply env-specific formatting (colors, etc.)
|
|
5200
|
+
createDebug.formatArgs.call(self, args);
|
|
5201
|
+
|
|
5202
|
+
const logFn = self.log || createDebug.log;
|
|
5203
|
+
logFn.apply(self, args);
|
|
5204
|
+
}
|
|
5205
|
+
|
|
5206
|
+
debug.namespace = namespace;
|
|
5207
|
+
debug.useColors = createDebug.useColors();
|
|
5208
|
+
debug.color = createDebug.selectColor(namespace);
|
|
5209
|
+
debug.extend = extend;
|
|
5210
|
+
debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.
|
|
5211
|
+
|
|
5212
|
+
Object.defineProperty(debug, 'enabled', {
|
|
5213
|
+
enumerable: true,
|
|
5214
|
+
configurable: false,
|
|
5215
|
+
get: () => {
|
|
5216
|
+
if (enableOverride !== null) {
|
|
5217
|
+
return enableOverride;
|
|
5218
|
+
}
|
|
5219
|
+
if (namespacesCache !== createDebug.namespaces) {
|
|
5220
|
+
namespacesCache = createDebug.namespaces;
|
|
5221
|
+
enabledCache = createDebug.enabled(namespace);
|
|
5222
|
+
}
|
|
5223
|
+
|
|
5224
|
+
return enabledCache;
|
|
5225
|
+
},
|
|
5226
|
+
set: v => {
|
|
5227
|
+
enableOverride = v;
|
|
5228
|
+
}
|
|
5229
|
+
});
|
|
5230
|
+
|
|
5231
|
+
// Env-specific initialization logic for debug instances
|
|
5232
|
+
if (typeof createDebug.init === 'function') {
|
|
5233
|
+
createDebug.init(debug);
|
|
5234
|
+
}
|
|
5235
|
+
|
|
5236
|
+
return debug;
|
|
5237
|
+
}
|
|
5238
|
+
|
|
5239
|
+
function extend(namespace, delimiter) {
|
|
5240
|
+
const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
|
|
5241
|
+
newDebug.log = this.log;
|
|
5242
|
+
return newDebug;
|
|
5243
|
+
}
|
|
5244
|
+
|
|
5245
|
+
/**
|
|
5246
|
+
* Enables a debug mode by namespaces. This can include modes
|
|
5247
|
+
* separated by a colon and wildcards.
|
|
5248
|
+
*
|
|
5249
|
+
* @param {String} namespaces
|
|
5250
|
+
* @api public
|
|
5251
|
+
*/
|
|
5252
|
+
function enable(namespaces) {
|
|
5253
|
+
createDebug.save(namespaces);
|
|
5254
|
+
createDebug.namespaces = namespaces;
|
|
5255
|
+
|
|
5256
|
+
createDebug.names = [];
|
|
5257
|
+
createDebug.skips = [];
|
|
5258
|
+
|
|
5259
|
+
let i;
|
|
5260
|
+
const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
|
|
5261
|
+
const len = split.length;
|
|
5262
|
+
|
|
5263
|
+
for (i = 0; i < len; i++) {
|
|
5264
|
+
if (!split[i]) {
|
|
5265
|
+
// ignore empty strings
|
|
5266
|
+
continue;
|
|
5267
|
+
}
|
|
5268
|
+
|
|
5269
|
+
namespaces = split[i].replace(/\*/g, '.*?');
|
|
5270
|
+
|
|
5271
|
+
if (namespaces[0] === '-') {
|
|
5272
|
+
createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
|
|
5273
|
+
} else {
|
|
5274
|
+
createDebug.names.push(new RegExp('^' + namespaces + '$'));
|
|
5275
|
+
}
|
|
5276
|
+
}
|
|
5277
|
+
}
|
|
5278
|
+
|
|
5279
|
+
/**
|
|
5280
|
+
* Disable debug output.
|
|
5281
|
+
*
|
|
5282
|
+
* @return {String} namespaces
|
|
5283
|
+
* @api public
|
|
5284
|
+
*/
|
|
5285
|
+
function disable() {
|
|
5286
|
+
const namespaces = [
|
|
5287
|
+
...createDebug.names.map(toNamespace),
|
|
5288
|
+
...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)
|
|
5289
|
+
].join(',');
|
|
5290
|
+
createDebug.enable('');
|
|
5291
|
+
return namespaces;
|
|
5292
|
+
}
|
|
5293
|
+
|
|
5294
|
+
/**
|
|
5295
|
+
* Returns true if the given mode name is enabled, false otherwise.
|
|
5296
|
+
*
|
|
5297
|
+
* @param {String} name
|
|
5298
|
+
* @return {Boolean}
|
|
5299
|
+
* @api public
|
|
5300
|
+
*/
|
|
5301
|
+
function enabled(name) {
|
|
5302
|
+
if (name[name.length - 1] === '*') {
|
|
5303
|
+
return true;
|
|
5304
|
+
}
|
|
5305
|
+
|
|
5306
|
+
let i;
|
|
5307
|
+
let len;
|
|
5308
|
+
|
|
5309
|
+
for (i = 0, len = createDebug.skips.length; i < len; i++) {
|
|
5310
|
+
if (createDebug.skips[i].test(name)) {
|
|
5311
|
+
return false;
|
|
5312
|
+
}
|
|
5313
|
+
}
|
|
5314
|
+
|
|
5315
|
+
for (i = 0, len = createDebug.names.length; i < len; i++) {
|
|
5316
|
+
if (createDebug.names[i].test(name)) {
|
|
5317
|
+
return true;
|
|
5318
|
+
}
|
|
5319
|
+
}
|
|
5320
|
+
|
|
5321
|
+
return false;
|
|
5322
|
+
}
|
|
5323
|
+
|
|
5324
|
+
/**
|
|
5325
|
+
* Convert regexp to namespace
|
|
5326
|
+
*
|
|
5327
|
+
* @param {RegExp} regxep
|
|
5328
|
+
* @return {String} namespace
|
|
5329
|
+
* @api private
|
|
5330
|
+
*/
|
|
5331
|
+
function toNamespace(regexp) {
|
|
5332
|
+
return regexp.toString()
|
|
5333
|
+
.substring(2, regexp.toString().length - 2)
|
|
5334
|
+
.replace(/\.\*\?$/, '*');
|
|
5335
|
+
}
|
|
5336
|
+
|
|
5337
|
+
/**
|
|
5338
|
+
* Coerce `val`.
|
|
5339
|
+
*
|
|
5340
|
+
* @param {Mixed} val
|
|
5341
|
+
* @return {Mixed}
|
|
5342
|
+
* @api private
|
|
5343
|
+
*/
|
|
5344
|
+
function coerce(val) {
|
|
5345
|
+
if (val instanceof Error) {
|
|
5346
|
+
return val.stack || val.message;
|
|
5347
|
+
}
|
|
5348
|
+
return val;
|
|
5349
|
+
}
|
|
5350
|
+
|
|
5351
|
+
/**
|
|
5352
|
+
* XXX DO NOT USE. This is a temporary stub function.
|
|
5353
|
+
* XXX It WILL be removed in the next major release.
|
|
5354
|
+
*/
|
|
5355
|
+
function destroy() {
|
|
5356
|
+
console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
|
|
5357
|
+
}
|
|
5358
|
+
|
|
5359
|
+
createDebug.enable(createDebug.load());
|
|
5360
|
+
|
|
5361
|
+
return createDebug;
|
|
5362
|
+
}
|
|
5363
|
+
|
|
5364
|
+
var common = setup;var browser = createCommonjsModule(function (module, exports) {
|
|
5365
|
+
/* eslint-env browser */
|
|
5366
|
+
|
|
5367
|
+
/**
|
|
5368
|
+
* This is the web browser implementation of `debug()`.
|
|
5369
|
+
*/
|
|
5370
|
+
|
|
5371
|
+
exports.formatArgs = formatArgs;
|
|
5372
|
+
exports.save = save;
|
|
5373
|
+
exports.load = load;
|
|
5374
|
+
exports.useColors = useColors;
|
|
5375
|
+
exports.storage = localstorage();
|
|
5376
|
+
exports.destroy = (() => {
|
|
5377
|
+
let warned = false;
|
|
5378
|
+
|
|
5379
|
+
return () => {
|
|
5380
|
+
if (!warned) {
|
|
5381
|
+
warned = true;
|
|
5382
|
+
console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
|
|
5383
|
+
}
|
|
5384
|
+
};
|
|
5385
|
+
})();
|
|
5386
|
+
|
|
5387
|
+
/**
|
|
5388
|
+
* Colors.
|
|
5389
|
+
*/
|
|
5390
|
+
|
|
5391
|
+
exports.colors = [
|
|
5392
|
+
'#0000CC',
|
|
5393
|
+
'#0000FF',
|
|
5394
|
+
'#0033CC',
|
|
5395
|
+
'#0033FF',
|
|
5396
|
+
'#0066CC',
|
|
5397
|
+
'#0066FF',
|
|
5398
|
+
'#0099CC',
|
|
5399
|
+
'#0099FF',
|
|
5400
|
+
'#00CC00',
|
|
5401
|
+
'#00CC33',
|
|
5402
|
+
'#00CC66',
|
|
5403
|
+
'#00CC99',
|
|
5404
|
+
'#00CCCC',
|
|
5405
|
+
'#00CCFF',
|
|
5406
|
+
'#3300CC',
|
|
5407
|
+
'#3300FF',
|
|
5408
|
+
'#3333CC',
|
|
5409
|
+
'#3333FF',
|
|
5410
|
+
'#3366CC',
|
|
5411
|
+
'#3366FF',
|
|
5412
|
+
'#3399CC',
|
|
5413
|
+
'#3399FF',
|
|
5414
|
+
'#33CC00',
|
|
5415
|
+
'#33CC33',
|
|
5416
|
+
'#33CC66',
|
|
5417
|
+
'#33CC99',
|
|
5418
|
+
'#33CCCC',
|
|
5419
|
+
'#33CCFF',
|
|
5420
|
+
'#6600CC',
|
|
5421
|
+
'#6600FF',
|
|
5422
|
+
'#6633CC',
|
|
5423
|
+
'#6633FF',
|
|
5424
|
+
'#66CC00',
|
|
5425
|
+
'#66CC33',
|
|
5426
|
+
'#9900CC',
|
|
5427
|
+
'#9900FF',
|
|
5428
|
+
'#9933CC',
|
|
5429
|
+
'#9933FF',
|
|
5430
|
+
'#99CC00',
|
|
5431
|
+
'#99CC33',
|
|
5432
|
+
'#CC0000',
|
|
5433
|
+
'#CC0033',
|
|
5434
|
+
'#CC0066',
|
|
5435
|
+
'#CC0099',
|
|
5436
|
+
'#CC00CC',
|
|
5437
|
+
'#CC00FF',
|
|
5438
|
+
'#CC3300',
|
|
5439
|
+
'#CC3333',
|
|
5440
|
+
'#CC3366',
|
|
5441
|
+
'#CC3399',
|
|
5442
|
+
'#CC33CC',
|
|
5443
|
+
'#CC33FF',
|
|
5444
|
+
'#CC6600',
|
|
5445
|
+
'#CC6633',
|
|
5446
|
+
'#CC9900',
|
|
5447
|
+
'#CC9933',
|
|
5448
|
+
'#CCCC00',
|
|
5449
|
+
'#CCCC33',
|
|
5450
|
+
'#FF0000',
|
|
5451
|
+
'#FF0033',
|
|
5452
|
+
'#FF0066',
|
|
5453
|
+
'#FF0099',
|
|
5454
|
+
'#FF00CC',
|
|
5455
|
+
'#FF00FF',
|
|
5456
|
+
'#FF3300',
|
|
5457
|
+
'#FF3333',
|
|
5458
|
+
'#FF3366',
|
|
5459
|
+
'#FF3399',
|
|
5460
|
+
'#FF33CC',
|
|
5461
|
+
'#FF33FF',
|
|
5462
|
+
'#FF6600',
|
|
5463
|
+
'#FF6633',
|
|
5464
|
+
'#FF9900',
|
|
5465
|
+
'#FF9933',
|
|
5466
|
+
'#FFCC00',
|
|
5467
|
+
'#FFCC33'
|
|
5468
|
+
];
|
|
5469
|
+
|
|
5470
|
+
/**
|
|
5471
|
+
* Currently only WebKit-based Web Inspectors, Firefox >= v31,
|
|
5472
|
+
* and the Firebug extension (any Firefox version) are known
|
|
5473
|
+
* to support "%c" CSS customizations.
|
|
5474
|
+
*
|
|
5475
|
+
* TODO: add a `localStorage` variable to explicitly enable/disable colors
|
|
5476
|
+
*/
|
|
5477
|
+
|
|
5478
|
+
// eslint-disable-next-line complexity
|
|
5479
|
+
function useColors() {
|
|
5480
|
+
// NB: In an Electron preload script, document will be defined but not fully
|
|
5481
|
+
// initialized. Since we know we're in Chrome, we'll just detect this case
|
|
5482
|
+
// explicitly
|
|
5483
|
+
if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
|
|
5484
|
+
return true;
|
|
5485
|
+
}
|
|
5486
|
+
|
|
5487
|
+
// Internet Explorer and Edge do not support colors.
|
|
5488
|
+
if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
|
|
5489
|
+
return false;
|
|
5490
|
+
}
|
|
5491
|
+
|
|
5492
|
+
// Is webkit? http://stackoverflow.com/a/16459606/376773
|
|
5493
|
+
// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
|
|
5494
|
+
return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
|
|
5495
|
+
// Is firebug? http://stackoverflow.com/a/398120/376773
|
|
5496
|
+
(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
|
|
5497
|
+
// Is firefox >= v31?
|
|
5498
|
+
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
|
|
5499
|
+
(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
|
|
5500
|
+
// Double check webkit in userAgent just in case we are in a worker
|
|
5501
|
+
(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
|
|
5502
|
+
}
|
|
5503
|
+
|
|
5504
|
+
/**
|
|
5505
|
+
* Colorize log arguments if enabled.
|
|
5506
|
+
*
|
|
5507
|
+
* @api public
|
|
5508
|
+
*/
|
|
5509
|
+
|
|
5510
|
+
function formatArgs(args) {
|
|
5511
|
+
args[0] = (this.useColors ? '%c' : '') +
|
|
5512
|
+
this.namespace +
|
|
5513
|
+
(this.useColors ? ' %c' : ' ') +
|
|
5514
|
+
args[0] +
|
|
5515
|
+
(this.useColors ? '%c ' : ' ') +
|
|
5516
|
+
'+' + module.exports.humanize(this.diff);
|
|
5517
|
+
|
|
5518
|
+
if (!this.useColors) {
|
|
5519
|
+
return;
|
|
5520
|
+
}
|
|
5521
|
+
|
|
5522
|
+
const c = 'color: ' + this.color;
|
|
5523
|
+
args.splice(1, 0, c, 'color: inherit');
|
|
5524
|
+
|
|
5525
|
+
// The final "%c" is somewhat tricky, because there could be other
|
|
5526
|
+
// arguments passed either before or after the %c, so we need to
|
|
5527
|
+
// figure out the correct index to insert the CSS into
|
|
5528
|
+
let index = 0;
|
|
5529
|
+
let lastC = 0;
|
|
5530
|
+
args[0].replace(/%[a-zA-Z%]/g, match => {
|
|
5531
|
+
if (match === '%%') {
|
|
5532
|
+
return;
|
|
5533
|
+
}
|
|
5534
|
+
index++;
|
|
5535
|
+
if (match === '%c') {
|
|
5536
|
+
// We only are interested in the *last* %c
|
|
5537
|
+
// (the user may have provided their own)
|
|
5538
|
+
lastC = index;
|
|
5539
|
+
}
|
|
5540
|
+
});
|
|
5541
|
+
|
|
5542
|
+
args.splice(lastC, 0, c);
|
|
5543
|
+
}
|
|
5544
|
+
|
|
5545
|
+
/**
|
|
5546
|
+
* Invokes `console.debug()` when available.
|
|
5547
|
+
* No-op when `console.debug` is not a "function".
|
|
5548
|
+
* If `console.debug` is not available, falls back
|
|
5549
|
+
* to `console.log`.
|
|
5550
|
+
*
|
|
5551
|
+
* @api public
|
|
5552
|
+
*/
|
|
5553
|
+
exports.log = console.debug || console.log || (() => {});
|
|
5554
|
+
|
|
5555
|
+
/**
|
|
5556
|
+
* Save `namespaces`.
|
|
5557
|
+
*
|
|
5558
|
+
* @param {String} namespaces
|
|
5559
|
+
* @api private
|
|
5560
|
+
*/
|
|
5561
|
+
function save(namespaces) {
|
|
5562
|
+
try {
|
|
5563
|
+
if (namespaces) {
|
|
5564
|
+
exports.storage.setItem('debug', namespaces);
|
|
5565
|
+
} else {
|
|
5566
|
+
exports.storage.removeItem('debug');
|
|
5567
|
+
}
|
|
5568
|
+
} catch (error) {
|
|
5569
|
+
// Swallow
|
|
5570
|
+
// XXX (@Qix-) should we be logging these?
|
|
5571
|
+
}
|
|
5572
|
+
}
|
|
5573
|
+
|
|
5574
|
+
/**
|
|
5575
|
+
* Load `namespaces`.
|
|
5576
|
+
*
|
|
5577
|
+
* @return {String} returns the previously persisted debug modes
|
|
5578
|
+
* @api private
|
|
5579
|
+
*/
|
|
5580
|
+
function load() {
|
|
5581
|
+
let r;
|
|
5582
|
+
try {
|
|
5583
|
+
r = exports.storage.getItem('debug');
|
|
5584
|
+
} catch (error) {
|
|
5585
|
+
// Swallow
|
|
5586
|
+
// XXX (@Qix-) should we be logging these?
|
|
5587
|
+
}
|
|
5588
|
+
|
|
5589
|
+
// If debug isn't set in LS, and we're in Electron, try to load $DEBUG
|
|
5590
|
+
if (!r && typeof process !== 'undefined' && 'env' in process) {
|
|
5591
|
+
r = process.env.DEBUG;
|
|
5592
|
+
}
|
|
5593
|
+
|
|
5594
|
+
return r;
|
|
5595
|
+
}
|
|
5596
|
+
|
|
5597
|
+
/**
|
|
5598
|
+
* Localstorage attempts to return the localstorage.
|
|
5599
|
+
*
|
|
5600
|
+
* This is necessary because safari throws
|
|
5601
|
+
* when a user disables cookies/localstorage
|
|
5602
|
+
* and you attempt to access it.
|
|
5603
|
+
*
|
|
5604
|
+
* @return {LocalStorage}
|
|
5605
|
+
* @api private
|
|
5606
|
+
*/
|
|
5607
|
+
|
|
5608
|
+
function localstorage() {
|
|
5609
|
+
try {
|
|
5610
|
+
// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
|
|
5611
|
+
// The Browser also has localStorage in the global context.
|
|
5612
|
+
return localStorage;
|
|
5613
|
+
} catch (error) {
|
|
5614
|
+
// Swallow
|
|
5615
|
+
// XXX (@Qix-) should we be logging these?
|
|
5616
|
+
}
|
|
5617
|
+
}
|
|
5618
|
+
|
|
5619
|
+
module.exports = common(exports);
|
|
5620
|
+
|
|
5621
|
+
const {formatters} = module.exports;
|
|
5622
|
+
|
|
5623
|
+
/**
|
|
5624
|
+
* Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
|
|
5625
|
+
*/
|
|
5626
|
+
|
|
5627
|
+
formatters.j = function (v) {
|
|
5628
|
+
try {
|
|
5629
|
+
return JSON.stringify(v);
|
|
5630
|
+
} catch (error) {
|
|
5631
|
+
return '[UnexpectedJSONParseError]: ' + error.message;
|
|
5632
|
+
}
|
|
5633
|
+
};
|
|
5634
|
+
});var hasFlag = (flag, argv) => {
|
|
5635
|
+
argv = argv || process.argv;
|
|
5636
|
+
const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');
|
|
5637
|
+
const pos = argv.indexOf(prefix + flag);
|
|
5638
|
+
const terminatorPos = argv.indexOf('--');
|
|
5639
|
+
return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
|
|
5640
|
+
};const env = process.env;
|
|
5641
|
+
|
|
5642
|
+
let forceColor;
|
|
5643
|
+
if (hasFlag('no-color') ||
|
|
5644
|
+
hasFlag('no-colors') ||
|
|
5645
|
+
hasFlag('color=false')) {
|
|
5646
|
+
forceColor = false;
|
|
5647
|
+
} else if (hasFlag('color') ||
|
|
5648
|
+
hasFlag('colors') ||
|
|
5649
|
+
hasFlag('color=true') ||
|
|
5650
|
+
hasFlag('color=always')) {
|
|
5651
|
+
forceColor = true;
|
|
5652
|
+
}
|
|
5653
|
+
if ('FORCE_COLOR' in env) {
|
|
5654
|
+
forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0;
|
|
5655
|
+
}
|
|
5656
|
+
|
|
5657
|
+
function translateLevel(level) {
|
|
5658
|
+
if (level === 0) {
|
|
5659
|
+
return false;
|
|
5660
|
+
}
|
|
5661
|
+
|
|
5662
|
+
return {
|
|
5663
|
+
level,
|
|
5664
|
+
hasBasic: true,
|
|
5665
|
+
has256: level >= 2,
|
|
5666
|
+
has16m: level >= 3
|
|
5667
|
+
};
|
|
5668
|
+
}
|
|
5669
|
+
|
|
5670
|
+
function supportsColor(stream) {
|
|
5671
|
+
if (forceColor === false) {
|
|
5672
|
+
return 0;
|
|
5673
|
+
}
|
|
5674
|
+
|
|
5675
|
+
if (hasFlag('color=16m') ||
|
|
5676
|
+
hasFlag('color=full') ||
|
|
5677
|
+
hasFlag('color=truecolor')) {
|
|
5678
|
+
return 3;
|
|
5679
|
+
}
|
|
5680
|
+
|
|
5681
|
+
if (hasFlag('color=256')) {
|
|
5682
|
+
return 2;
|
|
5683
|
+
}
|
|
5684
|
+
|
|
5685
|
+
if (stream && !stream.isTTY && forceColor !== true) {
|
|
5686
|
+
return 0;
|
|
5687
|
+
}
|
|
5688
|
+
|
|
5689
|
+
const min = forceColor ? 1 : 0;
|
|
5690
|
+
|
|
5691
|
+
if (process.platform === 'win32') {
|
|
5692
|
+
// Node.js 7.5.0 is the first version of Node.js to include a patch to
|
|
5693
|
+
// libuv that enables 256 color output on Windows. Anything earlier and it
|
|
5694
|
+
// won't work. However, here we target Node.js 8 at minimum as it is an LTS
|
|
5695
|
+
// release, and Node.js 7 is not. Windows 10 build 10586 is the first Windows
|
|
5696
|
+
// release that supports 256 colors. Windows 10 build 14931 is the first release
|
|
5697
|
+
// that supports 16m/TrueColor.
|
|
5698
|
+
const osRelease = os__default["default"].release().split('.');
|
|
5699
|
+
if (
|
|
5700
|
+
Number(process.versions.node.split('.')[0]) >= 8 &&
|
|
5701
|
+
Number(osRelease[0]) >= 10 &&
|
|
5702
|
+
Number(osRelease[2]) >= 10586
|
|
5703
|
+
) {
|
|
5704
|
+
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
5705
|
+
}
|
|
5706
|
+
|
|
5707
|
+
return 1;
|
|
5708
|
+
}
|
|
5709
|
+
|
|
5710
|
+
if ('CI' in env) {
|
|
5711
|
+
if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
|
|
5712
|
+
return 1;
|
|
5713
|
+
}
|
|
5714
|
+
|
|
5715
|
+
return min;
|
|
5716
|
+
}
|
|
5717
|
+
|
|
5718
|
+
if ('TEAMCITY_VERSION' in env) {
|
|
5719
|
+
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
5720
|
+
}
|
|
5721
|
+
|
|
5722
|
+
if (env.COLORTERM === 'truecolor') {
|
|
5723
|
+
return 3;
|
|
5724
|
+
}
|
|
5725
|
+
|
|
5726
|
+
if ('TERM_PROGRAM' in env) {
|
|
5727
|
+
const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
|
|
5728
|
+
|
|
5729
|
+
switch (env.TERM_PROGRAM) {
|
|
5730
|
+
case 'iTerm.app':
|
|
5731
|
+
return version >= 3 ? 3 : 2;
|
|
5732
|
+
case 'Apple_Terminal':
|
|
5733
|
+
return 2;
|
|
5734
|
+
// No default
|
|
5735
|
+
}
|
|
5736
|
+
}
|
|
5737
|
+
|
|
5738
|
+
if (/-256(color)?$/i.test(env.TERM)) {
|
|
5739
|
+
return 2;
|
|
5740
|
+
}
|
|
5741
|
+
|
|
5742
|
+
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
|
|
5743
|
+
return 1;
|
|
5744
|
+
}
|
|
5745
|
+
|
|
5746
|
+
if ('COLORTERM' in env) {
|
|
5747
|
+
return 1;
|
|
5748
|
+
}
|
|
5749
|
+
|
|
5750
|
+
if (env.TERM === 'dumb') {
|
|
5751
|
+
return min;
|
|
5752
|
+
}
|
|
5753
|
+
|
|
5754
|
+
return min;
|
|
5755
|
+
}
|
|
5756
|
+
|
|
5757
|
+
function getSupportLevel(stream) {
|
|
5758
|
+
const level = supportsColor(stream);
|
|
5759
|
+
return translateLevel(level);
|
|
5760
|
+
}
|
|
5761
|
+
|
|
5762
|
+
var supportsColor_1 = {
|
|
5763
|
+
supportsColor: getSupportLevel,
|
|
5764
|
+
stdout: getSupportLevel(process.stdout),
|
|
5765
|
+
stderr: getSupportLevel(process.stderr)
|
|
5766
|
+
};var node = createCommonjsModule(function (module, exports) {
|
|
5767
|
+
/**
|
|
5768
|
+
* Module dependencies.
|
|
5769
|
+
*/
|
|
5770
|
+
|
|
5771
|
+
|
|
5772
|
+
|
|
5773
|
+
|
|
5774
|
+
/**
|
|
5775
|
+
* This is the Node.js implementation of `debug()`.
|
|
5776
|
+
*/
|
|
5777
|
+
|
|
5778
|
+
exports.init = init;
|
|
5779
|
+
exports.log = log;
|
|
5780
|
+
exports.formatArgs = formatArgs;
|
|
5781
|
+
exports.save = save;
|
|
5782
|
+
exports.load = load;
|
|
5783
|
+
exports.useColors = useColors;
|
|
5784
|
+
exports.destroy = util__default["default"].deprecate(
|
|
5785
|
+
() => {},
|
|
5786
|
+
'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'
|
|
5787
|
+
);
|
|
5788
|
+
|
|
5789
|
+
/**
|
|
5790
|
+
* Colors.
|
|
5791
|
+
*/
|
|
5792
|
+
|
|
5793
|
+
exports.colors = [6, 2, 3, 4, 5, 1];
|
|
5794
|
+
|
|
5795
|
+
try {
|
|
5796
|
+
// Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)
|
|
5797
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
5798
|
+
const supportsColor = supportsColor_1;
|
|
5799
|
+
|
|
5800
|
+
if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
|
|
5801
|
+
exports.colors = [
|
|
5802
|
+
20,
|
|
5803
|
+
21,
|
|
5804
|
+
26,
|
|
5805
|
+
27,
|
|
5806
|
+
32,
|
|
5807
|
+
33,
|
|
5808
|
+
38,
|
|
5809
|
+
39,
|
|
5810
|
+
40,
|
|
5811
|
+
41,
|
|
5812
|
+
42,
|
|
5813
|
+
43,
|
|
5814
|
+
44,
|
|
5815
|
+
45,
|
|
5816
|
+
56,
|
|
5817
|
+
57,
|
|
5818
|
+
62,
|
|
5819
|
+
63,
|
|
5820
|
+
68,
|
|
5821
|
+
69,
|
|
5822
|
+
74,
|
|
5823
|
+
75,
|
|
5824
|
+
76,
|
|
5825
|
+
77,
|
|
5826
|
+
78,
|
|
5827
|
+
79,
|
|
5828
|
+
80,
|
|
5829
|
+
81,
|
|
5830
|
+
92,
|
|
5831
|
+
93,
|
|
5832
|
+
98,
|
|
5833
|
+
99,
|
|
5834
|
+
112,
|
|
5835
|
+
113,
|
|
5836
|
+
128,
|
|
5837
|
+
129,
|
|
5838
|
+
134,
|
|
5839
|
+
135,
|
|
5840
|
+
148,
|
|
5841
|
+
149,
|
|
5842
|
+
160,
|
|
5843
|
+
161,
|
|
5844
|
+
162,
|
|
5845
|
+
163,
|
|
5846
|
+
164,
|
|
5847
|
+
165,
|
|
5848
|
+
166,
|
|
5849
|
+
167,
|
|
5850
|
+
168,
|
|
5851
|
+
169,
|
|
5852
|
+
170,
|
|
5853
|
+
171,
|
|
5854
|
+
172,
|
|
5855
|
+
173,
|
|
5856
|
+
178,
|
|
5857
|
+
179,
|
|
5858
|
+
184,
|
|
5859
|
+
185,
|
|
5860
|
+
196,
|
|
5861
|
+
197,
|
|
5862
|
+
198,
|
|
5863
|
+
199,
|
|
5864
|
+
200,
|
|
5865
|
+
201,
|
|
5866
|
+
202,
|
|
5867
|
+
203,
|
|
5868
|
+
204,
|
|
5869
|
+
205,
|
|
5870
|
+
206,
|
|
5871
|
+
207,
|
|
5872
|
+
208,
|
|
5873
|
+
209,
|
|
5874
|
+
214,
|
|
5875
|
+
215,
|
|
5876
|
+
220,
|
|
5877
|
+
221
|
|
5878
|
+
];
|
|
5879
|
+
}
|
|
5880
|
+
} catch (error) {
|
|
5881
|
+
// Swallow - we only care if `supports-color` is available; it doesn't have to be.
|
|
5882
|
+
}
|
|
5883
|
+
|
|
5884
|
+
/**
|
|
5885
|
+
* Build up the default `inspectOpts` object from the environment variables.
|
|
5886
|
+
*
|
|
5887
|
+
* $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
|
|
5888
|
+
*/
|
|
5889
|
+
|
|
5890
|
+
exports.inspectOpts = Object.keys(process.env).filter(key => {
|
|
5891
|
+
return /^debug_/i.test(key);
|
|
5892
|
+
}).reduce((obj, key) => {
|
|
5893
|
+
// Camel-case
|
|
5894
|
+
const prop = key
|
|
5895
|
+
.substring(6)
|
|
5896
|
+
.toLowerCase()
|
|
5897
|
+
.replace(/_([a-z])/g, (_, k) => {
|
|
5898
|
+
return k.toUpperCase();
|
|
5899
|
+
});
|
|
5900
|
+
|
|
5901
|
+
// Coerce string value into JS value
|
|
5902
|
+
let val = process.env[key];
|
|
5903
|
+
if (/^(yes|on|true|enabled)$/i.test(val)) {
|
|
5904
|
+
val = true;
|
|
5905
|
+
} else if (/^(no|off|false|disabled)$/i.test(val)) {
|
|
5906
|
+
val = false;
|
|
5907
|
+
} else if (val === 'null') {
|
|
5908
|
+
val = null;
|
|
5909
|
+
} else {
|
|
5910
|
+
val = Number(val);
|
|
5911
|
+
}
|
|
5912
|
+
|
|
5913
|
+
obj[prop] = val;
|
|
5914
|
+
return obj;
|
|
5915
|
+
}, {});
|
|
5916
|
+
|
|
5917
|
+
/**
|
|
5918
|
+
* Is stdout a TTY? Colored output is enabled when `true`.
|
|
5919
|
+
*/
|
|
5920
|
+
|
|
5921
|
+
function useColors() {
|
|
5922
|
+
return 'colors' in exports.inspectOpts ?
|
|
5923
|
+
Boolean(exports.inspectOpts.colors) :
|
|
5924
|
+
tty__default["default"].isatty(process.stderr.fd);
|
|
5925
|
+
}
|
|
5926
|
+
|
|
5927
|
+
/**
|
|
5928
|
+
* Adds ANSI color escape codes if enabled.
|
|
5929
|
+
*
|
|
5930
|
+
* @api public
|
|
5931
|
+
*/
|
|
5932
|
+
|
|
5933
|
+
function formatArgs(args) {
|
|
5934
|
+
const {namespace: name, useColors} = this;
|
|
5935
|
+
|
|
5936
|
+
if (useColors) {
|
|
5937
|
+
const c = this.color;
|
|
5938
|
+
const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c);
|
|
5939
|
+
const prefix = ` ${colorCode};1m${name} \u001B[0m`;
|
|
5940
|
+
|
|
5941
|
+
args[0] = prefix + args[0].split('\n').join('\n' + prefix);
|
|
5942
|
+
args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m');
|
|
5943
|
+
} else {
|
|
5944
|
+
args[0] = getDate() + name + ' ' + args[0];
|
|
5945
|
+
}
|
|
5946
|
+
}
|
|
5947
|
+
|
|
5948
|
+
function getDate() {
|
|
5949
|
+
if (exports.inspectOpts.hideDate) {
|
|
5950
|
+
return '';
|
|
5951
|
+
}
|
|
5952
|
+
return new Date().toISOString() + ' ';
|
|
5953
|
+
}
|
|
5954
|
+
|
|
5955
|
+
/**
|
|
5956
|
+
* Invokes `util.format()` with the specified arguments and writes to stderr.
|
|
5957
|
+
*/
|
|
5958
|
+
|
|
5959
|
+
function log(...args) {
|
|
5960
|
+
return process.stderr.write(util__default["default"].format(...args) + '\n');
|
|
5961
|
+
}
|
|
5962
|
+
|
|
5963
|
+
/**
|
|
5964
|
+
* Save `namespaces`.
|
|
5965
|
+
*
|
|
5966
|
+
* @param {String} namespaces
|
|
5967
|
+
* @api private
|
|
5968
|
+
*/
|
|
5969
|
+
function save(namespaces) {
|
|
5970
|
+
if (namespaces) {
|
|
5971
|
+
process.env.DEBUG = namespaces;
|
|
5972
|
+
} else {
|
|
5973
|
+
// If you set a process.env field to null or undefined, it gets cast to the
|
|
5974
|
+
// string 'null' or 'undefined'. Just delete instead.
|
|
5975
|
+
delete process.env.DEBUG;
|
|
5976
|
+
}
|
|
5977
|
+
}
|
|
5978
|
+
|
|
5979
|
+
/**
|
|
5980
|
+
* Load `namespaces`.
|
|
5981
|
+
*
|
|
5982
|
+
* @return {String} returns the previously persisted debug modes
|
|
5983
|
+
* @api private
|
|
5984
|
+
*/
|
|
5985
|
+
|
|
5986
|
+
function load() {
|
|
5987
|
+
return process.env.DEBUG;
|
|
5988
|
+
}
|
|
5989
|
+
|
|
5990
|
+
/**
|
|
5991
|
+
* Init logic for `debug` instances.
|
|
5992
|
+
*
|
|
5993
|
+
* Create a new `inspectOpts` object in case `useColors` is set
|
|
5994
|
+
* differently for a particular `debug` instance.
|
|
5995
|
+
*/
|
|
5996
|
+
|
|
5997
|
+
function init(debug) {
|
|
5998
|
+
debug.inspectOpts = {};
|
|
5999
|
+
|
|
6000
|
+
const keys = Object.keys(exports.inspectOpts);
|
|
6001
|
+
for (let i = 0; i < keys.length; i++) {
|
|
6002
|
+
debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
|
|
6003
|
+
}
|
|
6004
|
+
}
|
|
6005
|
+
|
|
6006
|
+
module.exports = common(exports);
|
|
6007
|
+
|
|
6008
|
+
const {formatters} = module.exports;
|
|
6009
|
+
|
|
6010
|
+
/**
|
|
6011
|
+
* Map %o to `util.inspect()`, all on a single line.
|
|
6012
|
+
*/
|
|
6013
|
+
|
|
6014
|
+
formatters.o = function (v) {
|
|
6015
|
+
this.inspectOpts.colors = this.useColors;
|
|
6016
|
+
return util__default["default"].inspect(v, this.inspectOpts)
|
|
6017
|
+
.split('\n')
|
|
6018
|
+
.map(str => str.trim())
|
|
6019
|
+
.join(' ');
|
|
6020
|
+
};
|
|
6021
|
+
|
|
6022
|
+
/**
|
|
6023
|
+
* Map %O to `util.inspect()`, allowing multiple lines if needed.
|
|
6024
|
+
*/
|
|
6025
|
+
|
|
6026
|
+
formatters.O = function (v) {
|
|
6027
|
+
this.inspectOpts.colors = this.useColors;
|
|
6028
|
+
return util__default["default"].inspect(v, this.inspectOpts);
|
|
6029
|
+
};
|
|
6030
|
+
});var src = createCommonjsModule(function (module) {
|
|
6031
|
+
/**
|
|
6032
|
+
* Detect Electron renderer / nwjs process, which is node, but we should
|
|
6033
|
+
* treat as a browser.
|
|
6034
|
+
*/
|
|
6035
|
+
|
|
6036
|
+
if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {
|
|
6037
|
+
module.exports = browser;
|
|
6038
|
+
} else {
|
|
6039
|
+
module.exports = node;
|
|
6040
|
+
}
|
|
6041
|
+
});var debug;
|
|
6042
|
+
|
|
6043
|
+
var debug_1 = function () {
|
|
6044
|
+
if (!debug) {
|
|
6045
|
+
try {
|
|
6046
|
+
/* eslint global-require: off */
|
|
6047
|
+
debug = src("follow-redirects");
|
|
6048
|
+
}
|
|
6049
|
+
catch (error) { /* */ }
|
|
6050
|
+
if (typeof debug !== "function") {
|
|
6051
|
+
debug = function () { /* */ };
|
|
6052
|
+
}
|
|
6053
|
+
}
|
|
6054
|
+
debug.apply(null, arguments);
|
|
6055
|
+
};var URL = url__default["default"].URL;
|
|
6056
|
+
|
|
6057
|
+
|
|
6058
|
+
var Writable = stream__default["default"].Writable;
|
|
6059
|
+
|
|
6060
|
+
|
|
6061
|
+
|
|
6062
|
+
// Create handlers that pass events from native requests
|
|
6063
|
+
var events = ["abort", "aborted", "connect", "error", "socket", "timeout"];
|
|
6064
|
+
var eventHandlers = Object.create(null);
|
|
6065
|
+
events.forEach(function (event) {
|
|
6066
|
+
eventHandlers[event] = function (arg1, arg2, arg3) {
|
|
6067
|
+
this._redirectable.emit(event, arg1, arg2, arg3);
|
|
6068
|
+
};
|
|
6069
|
+
});
|
|
6070
|
+
|
|
6071
|
+
// Error types with codes
|
|
6072
|
+
var RedirectionError = createErrorType(
|
|
6073
|
+
"ERR_FR_REDIRECTION_FAILURE",
|
|
6074
|
+
"Redirected request failed"
|
|
6075
|
+
);
|
|
6076
|
+
var TooManyRedirectsError = createErrorType(
|
|
6077
|
+
"ERR_FR_TOO_MANY_REDIRECTS",
|
|
6078
|
+
"Maximum number of redirects exceeded"
|
|
6079
|
+
);
|
|
6080
|
+
var MaxBodyLengthExceededError = createErrorType(
|
|
6081
|
+
"ERR_FR_MAX_BODY_LENGTH_EXCEEDED",
|
|
6082
|
+
"Request body larger than maxBodyLength limit"
|
|
6083
|
+
);
|
|
6084
|
+
var WriteAfterEndError = createErrorType(
|
|
6085
|
+
"ERR_STREAM_WRITE_AFTER_END",
|
|
6086
|
+
"write after end"
|
|
6087
|
+
);
|
|
6088
|
+
|
|
6089
|
+
// An HTTP(S) request that can be redirected
|
|
6090
|
+
function RedirectableRequest(options, responseCallback) {
|
|
6091
|
+
// Initialize the request
|
|
6092
|
+
Writable.call(this);
|
|
6093
|
+
this._sanitizeOptions(options);
|
|
6094
|
+
this._options = options;
|
|
6095
|
+
this._ended = false;
|
|
6096
|
+
this._ending = false;
|
|
6097
|
+
this._redirectCount = 0;
|
|
6098
|
+
this._redirects = [];
|
|
6099
|
+
this._requestBodyLength = 0;
|
|
6100
|
+
this._requestBodyBuffers = [];
|
|
6101
|
+
|
|
6102
|
+
// Attach a callback if passed
|
|
6103
|
+
if (responseCallback) {
|
|
6104
|
+
this.on("response", responseCallback);
|
|
6105
|
+
}
|
|
6106
|
+
|
|
6107
|
+
// React to responses of native requests
|
|
6108
|
+
var self = this;
|
|
6109
|
+
this._onNativeResponse = function (response) {
|
|
6110
|
+
self._processResponse(response);
|
|
6111
|
+
};
|
|
6112
|
+
|
|
6113
|
+
// Perform the first request
|
|
6114
|
+
this._performRequest();
|
|
6115
|
+
}
|
|
6116
|
+
RedirectableRequest.prototype = Object.create(Writable.prototype);
|
|
6117
|
+
|
|
6118
|
+
RedirectableRequest.prototype.abort = function () {
|
|
6119
|
+
abortRequest(this._currentRequest);
|
|
6120
|
+
this.emit("abort");
|
|
6121
|
+
};
|
|
6122
|
+
|
|
6123
|
+
// Writes buffered data to the current native request
|
|
6124
|
+
RedirectableRequest.prototype.write = function (data, encoding, callback) {
|
|
6125
|
+
// Writing is not allowed if end has been called
|
|
6126
|
+
if (this._ending) {
|
|
6127
|
+
throw new WriteAfterEndError();
|
|
6128
|
+
}
|
|
6129
|
+
|
|
6130
|
+
// Validate input and shift parameters if necessary
|
|
6131
|
+
if (!(typeof data === "string" || typeof data === "object" && ("length" in data))) {
|
|
6132
|
+
throw new TypeError("data should be a string, Buffer or Uint8Array");
|
|
6133
|
+
}
|
|
6134
|
+
if (typeof encoding === "function") {
|
|
6135
|
+
callback = encoding;
|
|
6136
|
+
encoding = null;
|
|
6137
|
+
}
|
|
6138
|
+
|
|
6139
|
+
// Ignore empty buffers, since writing them doesn't invoke the callback
|
|
6140
|
+
// https://github.com/nodejs/node/issues/22066
|
|
6141
|
+
if (data.length === 0) {
|
|
6142
|
+
if (callback) {
|
|
6143
|
+
callback();
|
|
6144
|
+
}
|
|
6145
|
+
return;
|
|
6146
|
+
}
|
|
6147
|
+
// Only write when we don't exceed the maximum body length
|
|
6148
|
+
if (this._requestBodyLength + data.length <= this._options.maxBodyLength) {
|
|
6149
|
+
this._requestBodyLength += data.length;
|
|
6150
|
+
this._requestBodyBuffers.push({ data: data, encoding: encoding });
|
|
6151
|
+
this._currentRequest.write(data, encoding, callback);
|
|
6152
|
+
}
|
|
6153
|
+
// Error when we exceed the maximum body length
|
|
6154
|
+
else {
|
|
6155
|
+
this.emit("error", new MaxBodyLengthExceededError());
|
|
6156
|
+
this.abort();
|
|
6157
|
+
}
|
|
6158
|
+
};
|
|
6159
|
+
|
|
6160
|
+
// Ends the current native request
|
|
6161
|
+
RedirectableRequest.prototype.end = function (data, encoding, callback) {
|
|
6162
|
+
// Shift parameters if necessary
|
|
6163
|
+
if (typeof data === "function") {
|
|
6164
|
+
callback = data;
|
|
6165
|
+
data = encoding = null;
|
|
6166
|
+
}
|
|
6167
|
+
else if (typeof encoding === "function") {
|
|
6168
|
+
callback = encoding;
|
|
6169
|
+
encoding = null;
|
|
6170
|
+
}
|
|
6171
|
+
|
|
6172
|
+
// Write data if needed and end
|
|
6173
|
+
if (!data) {
|
|
6174
|
+
this._ended = this._ending = true;
|
|
6175
|
+
this._currentRequest.end(null, null, callback);
|
|
6176
|
+
}
|
|
6177
|
+
else {
|
|
6178
|
+
var self = this;
|
|
6179
|
+
var currentRequest = this._currentRequest;
|
|
6180
|
+
this.write(data, encoding, function () {
|
|
6181
|
+
self._ended = true;
|
|
6182
|
+
currentRequest.end(null, null, callback);
|
|
6183
|
+
});
|
|
6184
|
+
this._ending = true;
|
|
6185
|
+
}
|
|
6186
|
+
};
|
|
6187
|
+
|
|
6188
|
+
// Sets a header value on the current native request
|
|
6189
|
+
RedirectableRequest.prototype.setHeader = function (name, value) {
|
|
6190
|
+
this._options.headers[name] = value;
|
|
6191
|
+
this._currentRequest.setHeader(name, value);
|
|
6192
|
+
};
|
|
6193
|
+
|
|
6194
|
+
// Clears a header value on the current native request
|
|
6195
|
+
RedirectableRequest.prototype.removeHeader = function (name) {
|
|
6196
|
+
delete this._options.headers[name];
|
|
6197
|
+
this._currentRequest.removeHeader(name);
|
|
6198
|
+
};
|
|
6199
|
+
|
|
6200
|
+
// Global timeout for all underlying requests
|
|
6201
|
+
RedirectableRequest.prototype.setTimeout = function (msecs, callback) {
|
|
6202
|
+
var self = this;
|
|
6203
|
+
|
|
6204
|
+
// Destroys the socket on timeout
|
|
6205
|
+
function destroyOnTimeout(socket) {
|
|
6206
|
+
socket.setTimeout(msecs);
|
|
6207
|
+
socket.removeListener("timeout", socket.destroy);
|
|
6208
|
+
socket.addListener("timeout", socket.destroy);
|
|
6209
|
+
}
|
|
6210
|
+
|
|
6211
|
+
// Sets up a timer to trigger a timeout event
|
|
6212
|
+
function startTimer(socket) {
|
|
6213
|
+
if (self._timeout) {
|
|
6214
|
+
clearTimeout(self._timeout);
|
|
6215
|
+
}
|
|
6216
|
+
self._timeout = setTimeout(function () {
|
|
6217
|
+
self.emit("timeout");
|
|
6218
|
+
clearTimer();
|
|
6219
|
+
}, msecs);
|
|
6220
|
+
destroyOnTimeout(socket);
|
|
6221
|
+
}
|
|
6222
|
+
|
|
6223
|
+
// Stops a timeout from triggering
|
|
6224
|
+
function clearTimer() {
|
|
6225
|
+
// Clear the timeout
|
|
6226
|
+
if (self._timeout) {
|
|
6227
|
+
clearTimeout(self._timeout);
|
|
6228
|
+
self._timeout = null;
|
|
6229
|
+
}
|
|
6230
|
+
|
|
6231
|
+
// Clean up all attached listeners
|
|
6232
|
+
self.removeListener("abort", clearTimer);
|
|
6233
|
+
self.removeListener("error", clearTimer);
|
|
6234
|
+
self.removeListener("response", clearTimer);
|
|
6235
|
+
if (callback) {
|
|
6236
|
+
self.removeListener("timeout", callback);
|
|
6237
|
+
}
|
|
6238
|
+
if (!self.socket) {
|
|
6239
|
+
self._currentRequest.removeListener("socket", startTimer);
|
|
6240
|
+
}
|
|
6241
|
+
}
|
|
6242
|
+
|
|
6243
|
+
// Attach callback if passed
|
|
6244
|
+
if (callback) {
|
|
6245
|
+
this.on("timeout", callback);
|
|
6246
|
+
}
|
|
6247
|
+
|
|
6248
|
+
// Start the timer if or when the socket is opened
|
|
6249
|
+
if (this.socket) {
|
|
6250
|
+
startTimer(this.socket);
|
|
6251
|
+
}
|
|
6252
|
+
else {
|
|
6253
|
+
this._currentRequest.once("socket", startTimer);
|
|
6254
|
+
}
|
|
6255
|
+
|
|
6256
|
+
// Clean up on events
|
|
6257
|
+
this.on("socket", destroyOnTimeout);
|
|
6258
|
+
this.on("abort", clearTimer);
|
|
6259
|
+
this.on("error", clearTimer);
|
|
6260
|
+
this.on("response", clearTimer);
|
|
6261
|
+
|
|
6262
|
+
return this;
|
|
6263
|
+
};
|
|
6264
|
+
|
|
6265
|
+
// Proxy all other public ClientRequest methods
|
|
6266
|
+
[
|
|
6267
|
+
"flushHeaders", "getHeader",
|
|
6268
|
+
"setNoDelay", "setSocketKeepAlive",
|
|
6269
|
+
].forEach(function (method) {
|
|
6270
|
+
RedirectableRequest.prototype[method] = function (a, b) {
|
|
6271
|
+
return this._currentRequest[method](a, b);
|
|
6272
|
+
};
|
|
6273
|
+
});
|
|
6274
|
+
|
|
6275
|
+
// Proxy all public ClientRequest properties
|
|
6276
|
+
["aborted", "connection", "socket"].forEach(function (property) {
|
|
6277
|
+
Object.defineProperty(RedirectableRequest.prototype, property, {
|
|
6278
|
+
get: function () { return this._currentRequest[property]; },
|
|
6279
|
+
});
|
|
6280
|
+
});
|
|
6281
|
+
|
|
6282
|
+
RedirectableRequest.prototype._sanitizeOptions = function (options) {
|
|
6283
|
+
// Ensure headers are always present
|
|
6284
|
+
if (!options.headers) {
|
|
6285
|
+
options.headers = {};
|
|
6286
|
+
}
|
|
6287
|
+
|
|
6288
|
+
// Since http.request treats host as an alias of hostname,
|
|
6289
|
+
// but the url module interprets host as hostname plus port,
|
|
6290
|
+
// eliminate the host property to avoid confusion.
|
|
6291
|
+
if (options.host) {
|
|
6292
|
+
// Use hostname if set, because it has precedence
|
|
6293
|
+
if (!options.hostname) {
|
|
6294
|
+
options.hostname = options.host;
|
|
6295
|
+
}
|
|
6296
|
+
delete options.host;
|
|
6297
|
+
}
|
|
6298
|
+
|
|
6299
|
+
// Complete the URL object when necessary
|
|
6300
|
+
if (!options.pathname && options.path) {
|
|
6301
|
+
var searchPos = options.path.indexOf("?");
|
|
6302
|
+
if (searchPos < 0) {
|
|
6303
|
+
options.pathname = options.path;
|
|
6304
|
+
}
|
|
6305
|
+
else {
|
|
6306
|
+
options.pathname = options.path.substring(0, searchPos);
|
|
6307
|
+
options.search = options.path.substring(searchPos);
|
|
6308
|
+
}
|
|
6309
|
+
}
|
|
6310
|
+
};
|
|
6311
|
+
|
|
6312
|
+
|
|
6313
|
+
// Executes the next native request (initial or redirect)
|
|
6314
|
+
RedirectableRequest.prototype._performRequest = function () {
|
|
6315
|
+
// Load the native protocol
|
|
6316
|
+
var protocol = this._options.protocol;
|
|
6317
|
+
var nativeProtocol = this._options.nativeProtocols[protocol];
|
|
6318
|
+
if (!nativeProtocol) {
|
|
6319
|
+
this.emit("error", new TypeError("Unsupported protocol " + protocol));
|
|
6320
|
+
return;
|
|
6321
|
+
}
|
|
6322
|
+
|
|
6323
|
+
// If specified, use the agent corresponding to the protocol
|
|
6324
|
+
// (HTTP and HTTPS use different types of agents)
|
|
6325
|
+
if (this._options.agents) {
|
|
6326
|
+
var scheme = protocol.substr(0, protocol.length - 1);
|
|
6327
|
+
this._options.agent = this._options.agents[scheme];
|
|
6328
|
+
}
|
|
6329
|
+
|
|
6330
|
+
// Create the native request
|
|
6331
|
+
var request = this._currentRequest =
|
|
6332
|
+
nativeProtocol.request(this._options, this._onNativeResponse);
|
|
6333
|
+
this._currentUrl = url__default["default"].format(this._options);
|
|
6334
|
+
|
|
6335
|
+
// Set up event handlers
|
|
6336
|
+
request._redirectable = this;
|
|
6337
|
+
for (var e = 0; e < events.length; e++) {
|
|
6338
|
+
request.on(events[e], eventHandlers[events[e]]);
|
|
6339
|
+
}
|
|
6340
|
+
|
|
6341
|
+
// End a redirected request
|
|
6342
|
+
// (The first request must be ended explicitly with RedirectableRequest#end)
|
|
6343
|
+
if (this._isRedirect) {
|
|
6344
|
+
// Write the request entity and end.
|
|
6345
|
+
var i = 0;
|
|
6346
|
+
var self = this;
|
|
6347
|
+
var buffers = this._requestBodyBuffers;
|
|
6348
|
+
(function writeNext(error) {
|
|
6349
|
+
// Only write if this request has not been redirected yet
|
|
6350
|
+
/* istanbul ignore else */
|
|
6351
|
+
if (request === self._currentRequest) {
|
|
6352
|
+
// Report any write errors
|
|
6353
|
+
/* istanbul ignore if */
|
|
6354
|
+
if (error) {
|
|
6355
|
+
self.emit("error", error);
|
|
6356
|
+
}
|
|
6357
|
+
// Write the next buffer if there are still left
|
|
6358
|
+
else if (i < buffers.length) {
|
|
6359
|
+
var buffer = buffers[i++];
|
|
6360
|
+
/* istanbul ignore else */
|
|
6361
|
+
if (!request.finished) {
|
|
6362
|
+
request.write(buffer.data, buffer.encoding, writeNext);
|
|
6363
|
+
}
|
|
6364
|
+
}
|
|
6365
|
+
// End the request if `end` has been called on us
|
|
6366
|
+
else if (self._ended) {
|
|
6367
|
+
request.end();
|
|
6368
|
+
}
|
|
6369
|
+
}
|
|
6370
|
+
}());
|
|
6371
|
+
}
|
|
6372
|
+
};
|
|
6373
|
+
|
|
6374
|
+
// Processes a response from the current native request
|
|
6375
|
+
RedirectableRequest.prototype._processResponse = function (response) {
|
|
6376
|
+
// Store the redirected response
|
|
6377
|
+
var statusCode = response.statusCode;
|
|
6378
|
+
if (this._options.trackRedirects) {
|
|
6379
|
+
this._redirects.push({
|
|
6380
|
+
url: this._currentUrl,
|
|
6381
|
+
headers: response.headers,
|
|
6382
|
+
statusCode: statusCode,
|
|
6383
|
+
});
|
|
6384
|
+
}
|
|
6385
|
+
|
|
6386
|
+
// RFC7231§6.4: The 3xx (Redirection) class of status code indicates
|
|
6387
|
+
// that further action needs to be taken by the user agent in order to
|
|
6388
|
+
// fulfill the request. If a Location header field is provided,
|
|
6389
|
+
// the user agent MAY automatically redirect its request to the URI
|
|
6390
|
+
// referenced by the Location field value,
|
|
6391
|
+
// even if the specific status code is not understood.
|
|
6392
|
+
|
|
6393
|
+
// If the response is not a redirect; return it as-is
|
|
6394
|
+
var location = response.headers.location;
|
|
6395
|
+
if (!location || this._options.followRedirects === false ||
|
|
6396
|
+
statusCode < 300 || statusCode >= 400) {
|
|
6397
|
+
response.responseUrl = this._currentUrl;
|
|
6398
|
+
response.redirects = this._redirects;
|
|
6399
|
+
this.emit("response", response);
|
|
6400
|
+
|
|
6401
|
+
// Clean up
|
|
6402
|
+
this._requestBodyBuffers = [];
|
|
6403
|
+
return;
|
|
6404
|
+
}
|
|
6405
|
+
|
|
6406
|
+
// The response is a redirect, so abort the current request
|
|
6407
|
+
abortRequest(this._currentRequest);
|
|
6408
|
+
// Discard the remainder of the response to avoid waiting for data
|
|
6409
|
+
response.destroy();
|
|
6410
|
+
|
|
6411
|
+
// RFC7231§6.4: A client SHOULD detect and intervene
|
|
6412
|
+
// in cyclical redirections (i.e., "infinite" redirection loops).
|
|
6413
|
+
if (++this._redirectCount > this._options.maxRedirects) {
|
|
6414
|
+
this.emit("error", new TooManyRedirectsError());
|
|
6415
|
+
return;
|
|
6416
|
+
}
|
|
6417
|
+
|
|
6418
|
+
// RFC7231§6.4: Automatic redirection needs to done with
|
|
6419
|
+
// care for methods not known to be safe, […]
|
|
6420
|
+
// RFC7231§6.4.2–3: For historical reasons, a user agent MAY change
|
|
6421
|
+
// the request method from POST to GET for the subsequent request.
|
|
6422
|
+
if ((statusCode === 301 || statusCode === 302) && this._options.method === "POST" ||
|
|
6423
|
+
// RFC7231§6.4.4: The 303 (See Other) status code indicates that
|
|
6424
|
+
// the server is redirecting the user agent to a different resource […]
|
|
6425
|
+
// A user agent can perform a retrieval request targeting that URI
|
|
6426
|
+
// (a GET or HEAD request if using HTTP) […]
|
|
6427
|
+
(statusCode === 303) && !/^(?:GET|HEAD)$/.test(this._options.method)) {
|
|
6428
|
+
this._options.method = "GET";
|
|
6429
|
+
// Drop a possible entity and headers related to it
|
|
6430
|
+
this._requestBodyBuffers = [];
|
|
6431
|
+
removeMatchingHeaders(/^content-/i, this._options.headers);
|
|
6432
|
+
}
|
|
6433
|
+
|
|
6434
|
+
// Drop the Host header, as the redirect might lead to a different host
|
|
6435
|
+
var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers);
|
|
6436
|
+
|
|
6437
|
+
// If the redirect is relative, carry over the host of the last request
|
|
6438
|
+
var currentUrlParts = url__default["default"].parse(this._currentUrl);
|
|
6439
|
+
var currentHost = currentHostHeader || currentUrlParts.host;
|
|
6440
|
+
var currentUrl = /^\w+:/.test(location) ? this._currentUrl :
|
|
6441
|
+
url__default["default"].format(Object.assign(currentUrlParts, { host: currentHost }));
|
|
6442
|
+
|
|
6443
|
+
// Determine the URL of the redirection
|
|
6444
|
+
var redirectUrl;
|
|
6445
|
+
try {
|
|
6446
|
+
redirectUrl = url__default["default"].resolve(currentUrl, location);
|
|
6447
|
+
}
|
|
6448
|
+
catch (cause) {
|
|
6449
|
+
this.emit("error", new RedirectionError(cause));
|
|
6450
|
+
return;
|
|
6451
|
+
}
|
|
6452
|
+
|
|
6453
|
+
// Create the redirected request
|
|
6454
|
+
debug_1("redirecting to", redirectUrl);
|
|
6455
|
+
this._isRedirect = true;
|
|
6456
|
+
var redirectUrlParts = url__default["default"].parse(redirectUrl);
|
|
6457
|
+
Object.assign(this._options, redirectUrlParts);
|
|
6458
|
+
|
|
6459
|
+
// Drop confidential headers when redirecting to a less secure protocol
|
|
6460
|
+
// or to a different domain that is not a superdomain
|
|
6461
|
+
if (redirectUrlParts.protocol !== currentUrlParts.protocol &&
|
|
6462
|
+
redirectUrlParts.protocol !== "https:" ||
|
|
6463
|
+
redirectUrlParts.host !== currentHost &&
|
|
6464
|
+
!isSubdomain(redirectUrlParts.host, currentHost)) {
|
|
6465
|
+
removeMatchingHeaders(/^(?:authorization|cookie)$/i, this._options.headers);
|
|
6466
|
+
}
|
|
6467
|
+
|
|
6468
|
+
// Evaluate the beforeRedirect callback
|
|
6469
|
+
if (typeof this._options.beforeRedirect === "function") {
|
|
6470
|
+
var responseDetails = { headers: response.headers };
|
|
6471
|
+
try {
|
|
6472
|
+
this._options.beforeRedirect.call(null, this._options, responseDetails);
|
|
6473
|
+
}
|
|
6474
|
+
catch (err) {
|
|
6475
|
+
this.emit("error", err);
|
|
6476
|
+
return;
|
|
6477
|
+
}
|
|
6478
|
+
this._sanitizeOptions(this._options);
|
|
6479
|
+
}
|
|
6480
|
+
|
|
6481
|
+
// Perform the redirected request
|
|
6482
|
+
try {
|
|
6483
|
+
this._performRequest();
|
|
6484
|
+
}
|
|
6485
|
+
catch (cause) {
|
|
6486
|
+
this.emit("error", new RedirectionError(cause));
|
|
6487
|
+
}
|
|
6488
|
+
};
|
|
6489
|
+
|
|
6490
|
+
// Wraps the key/value object of protocols with redirect functionality
|
|
6491
|
+
function wrap(protocols) {
|
|
6492
|
+
// Default settings
|
|
6493
|
+
var exports = {
|
|
6494
|
+
maxRedirects: 21,
|
|
6495
|
+
maxBodyLength: 10 * 1024 * 1024,
|
|
6496
|
+
};
|
|
6497
|
+
|
|
6498
|
+
// Wrap each protocol
|
|
6499
|
+
var nativeProtocols = {};
|
|
6500
|
+
Object.keys(protocols).forEach(function (scheme) {
|
|
6501
|
+
var protocol = scheme + ":";
|
|
6502
|
+
var nativeProtocol = nativeProtocols[protocol] = protocols[scheme];
|
|
6503
|
+
var wrappedProtocol = exports[scheme] = Object.create(nativeProtocol);
|
|
6504
|
+
|
|
6505
|
+
// Executes a request, following redirects
|
|
6506
|
+
function request(input, options, callback) {
|
|
6507
|
+
// Parse parameters
|
|
6508
|
+
if (typeof input === "string") {
|
|
6509
|
+
var urlStr = input;
|
|
6510
|
+
try {
|
|
6511
|
+
input = urlToOptions(new URL(urlStr));
|
|
6512
|
+
}
|
|
6513
|
+
catch (err) {
|
|
6514
|
+
/* istanbul ignore next */
|
|
6515
|
+
input = url__default["default"].parse(urlStr);
|
|
6516
|
+
}
|
|
6517
|
+
}
|
|
6518
|
+
else if (URL && (input instanceof URL)) {
|
|
6519
|
+
input = urlToOptions(input);
|
|
6520
|
+
}
|
|
6521
|
+
else {
|
|
6522
|
+
callback = options;
|
|
6523
|
+
options = input;
|
|
6524
|
+
input = { protocol: protocol };
|
|
6525
|
+
}
|
|
6526
|
+
if (typeof options === "function") {
|
|
6527
|
+
callback = options;
|
|
6528
|
+
options = null;
|
|
6529
|
+
}
|
|
6530
|
+
|
|
6531
|
+
// Set defaults
|
|
6532
|
+
options = Object.assign({
|
|
6533
|
+
maxRedirects: exports.maxRedirects,
|
|
6534
|
+
maxBodyLength: exports.maxBodyLength,
|
|
6535
|
+
}, input, options);
|
|
6536
|
+
options.nativeProtocols = nativeProtocols;
|
|
6537
|
+
|
|
6538
|
+
assert__default["default"].equal(options.protocol, protocol, "protocol mismatch");
|
|
6539
|
+
debug_1("options", options);
|
|
6540
|
+
return new RedirectableRequest(options, callback);
|
|
6541
|
+
}
|
|
6542
|
+
|
|
6543
|
+
// Executes a GET request, following redirects
|
|
6544
|
+
function get(input, options, callback) {
|
|
6545
|
+
var wrappedRequest = wrappedProtocol.request(input, options, callback);
|
|
6546
|
+
wrappedRequest.end();
|
|
6547
|
+
return wrappedRequest;
|
|
6548
|
+
}
|
|
6549
|
+
|
|
6550
|
+
// Expose the properties on the wrapped protocol
|
|
6551
|
+
Object.defineProperties(wrappedProtocol, {
|
|
6552
|
+
request: { value: request, configurable: true, enumerable: true, writable: true },
|
|
6553
|
+
get: { value: get, configurable: true, enumerable: true, writable: true },
|
|
6554
|
+
});
|
|
6555
|
+
});
|
|
6556
|
+
return exports;
|
|
6557
|
+
}
|
|
6558
|
+
|
|
6559
|
+
/* istanbul ignore next */
|
|
6560
|
+
function noop() { /* empty */ }
|
|
6561
|
+
|
|
6562
|
+
// from https://github.com/nodejs/node/blob/master/lib/internal/url.js
|
|
6563
|
+
function urlToOptions(urlObject) {
|
|
6564
|
+
var options = {
|
|
6565
|
+
protocol: urlObject.protocol,
|
|
6566
|
+
hostname: urlObject.hostname.startsWith("[") ?
|
|
6567
|
+
/* istanbul ignore next */
|
|
6568
|
+
urlObject.hostname.slice(1, -1) :
|
|
6569
|
+
urlObject.hostname,
|
|
6570
|
+
hash: urlObject.hash,
|
|
6571
|
+
search: urlObject.search,
|
|
6572
|
+
pathname: urlObject.pathname,
|
|
6573
|
+
path: urlObject.pathname + urlObject.search,
|
|
6574
|
+
href: urlObject.href,
|
|
6575
|
+
};
|
|
6576
|
+
if (urlObject.port !== "") {
|
|
6577
|
+
options.port = Number(urlObject.port);
|
|
6578
|
+
}
|
|
6579
|
+
return options;
|
|
6580
|
+
}
|
|
6581
|
+
|
|
6582
|
+
function removeMatchingHeaders(regex, headers) {
|
|
6583
|
+
var lastValue;
|
|
6584
|
+
for (var header in headers) {
|
|
6585
|
+
if (regex.test(header)) {
|
|
6586
|
+
lastValue = headers[header];
|
|
6587
|
+
delete headers[header];
|
|
6588
|
+
}
|
|
6589
|
+
}
|
|
6590
|
+
return (lastValue === null || typeof lastValue === "undefined") ?
|
|
6591
|
+
undefined : String(lastValue).trim();
|
|
6592
|
+
}
|
|
6593
|
+
|
|
6594
|
+
function createErrorType(code, defaultMessage) {
|
|
6595
|
+
function CustomError(cause) {
|
|
6596
|
+
Error.captureStackTrace(this, this.constructor);
|
|
6597
|
+
if (!cause) {
|
|
6598
|
+
this.message = defaultMessage;
|
|
6599
|
+
}
|
|
6600
|
+
else {
|
|
6601
|
+
this.message = defaultMessage + ": " + cause.message;
|
|
6602
|
+
this.cause = cause;
|
|
6603
|
+
}
|
|
6604
|
+
}
|
|
6605
|
+
CustomError.prototype = new Error();
|
|
6606
|
+
CustomError.prototype.constructor = CustomError;
|
|
6607
|
+
CustomError.prototype.name = "Error [" + code + "]";
|
|
6608
|
+
CustomError.prototype.code = code;
|
|
6609
|
+
return CustomError;
|
|
6610
|
+
}
|
|
6611
|
+
|
|
6612
|
+
function abortRequest(request) {
|
|
6613
|
+
for (var e = 0; e < events.length; e++) {
|
|
6614
|
+
request.removeListener(events[e], eventHandlers[events[e]]);
|
|
6615
|
+
}
|
|
6616
|
+
request.on("error", noop);
|
|
6617
|
+
request.abort();
|
|
6618
|
+
}
|
|
6619
|
+
|
|
6620
|
+
function isSubdomain(subdomain, domain) {
|
|
6621
|
+
const dot = subdomain.length - domain.length - 1;
|
|
6622
|
+
return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain);
|
|
6623
|
+
}
|
|
6624
|
+
|
|
6625
|
+
// Exports
|
|
6626
|
+
var followRedirects = wrap({ http: http__default["default"], https: https__default["default"] });
|
|
6627
|
+
var wrap_1 = wrap;
|
|
6628
|
+
followRedirects.wrap = wrap_1;var data = {
|
|
6629
|
+
"version": "0.26.0"
|
|
6630
|
+
};var httpFollow = followRedirects.http;
|
|
6631
|
+
var httpsFollow = followRedirects.https;
|
|
6632
|
+
|
|
6633
|
+
|
|
6634
|
+
var VERSION$1 = data.version;
|
|
6635
|
+
|
|
6636
|
+
|
|
6637
|
+
|
|
6638
|
+
|
|
6639
|
+
|
|
6640
|
+
var isHttps = /https:?/;
|
|
6641
|
+
|
|
6642
|
+
/**
|
|
6643
|
+
*
|
|
6644
|
+
* @param {http.ClientRequestArgs} options
|
|
6645
|
+
* @param {AxiosProxyConfig} proxy
|
|
6646
|
+
* @param {string} location
|
|
6647
|
+
*/
|
|
6648
|
+
function setProxy(options, proxy, location) {
|
|
6649
|
+
options.hostname = proxy.host;
|
|
6650
|
+
options.host = proxy.host;
|
|
6651
|
+
options.port = proxy.port;
|
|
6652
|
+
options.path = location;
|
|
6653
|
+
|
|
6654
|
+
// Basic proxy authorization
|
|
6655
|
+
if (proxy.auth) {
|
|
6656
|
+
var base64 = Buffer.from(proxy.auth.username + ':' + proxy.auth.password, 'utf8').toString('base64');
|
|
6657
|
+
options.headers['Proxy-Authorization'] = 'Basic ' + base64;
|
|
6658
|
+
}
|
|
6659
|
+
|
|
6660
|
+
// If a proxy is used, any redirects must also pass through the proxy
|
|
6661
|
+
options.beforeRedirect = function beforeRedirect(redirection) {
|
|
6662
|
+
redirection.headers.host = redirection.host;
|
|
6663
|
+
setProxy(redirection, proxy, redirection.href);
|
|
6664
|
+
};
|
|
6665
|
+
}
|
|
6666
|
+
|
|
6667
|
+
/*eslint consistent-return:0*/
|
|
6668
|
+
var http_1 = function httpAdapter(config) {
|
|
6669
|
+
return new Promise(function dispatchHttpRequest(resolvePromise, rejectPromise) {
|
|
6670
|
+
var onCanceled;
|
|
6671
|
+
function done() {
|
|
6672
|
+
if (config.cancelToken) {
|
|
6673
|
+
config.cancelToken.unsubscribe(onCanceled);
|
|
6674
|
+
}
|
|
6675
|
+
|
|
6676
|
+
if (config.signal) {
|
|
6677
|
+
config.signal.removeEventListener('abort', onCanceled);
|
|
6678
|
+
}
|
|
6679
|
+
}
|
|
6680
|
+
var resolve = function resolve(value) {
|
|
6681
|
+
done();
|
|
6682
|
+
resolvePromise(value);
|
|
6683
|
+
};
|
|
6684
|
+
var rejected = false;
|
|
6685
|
+
var reject = function reject(value) {
|
|
6686
|
+
done();
|
|
6687
|
+
rejected = true;
|
|
6688
|
+
rejectPromise(value);
|
|
6689
|
+
};
|
|
6690
|
+
var data = config.data;
|
|
6691
|
+
var headers = config.headers;
|
|
6692
|
+
var headerNames = {};
|
|
6693
|
+
|
|
6694
|
+
Object.keys(headers).forEach(function storeLowerName(name) {
|
|
6695
|
+
headerNames[name.toLowerCase()] = name;
|
|
6696
|
+
});
|
|
6697
|
+
|
|
6698
|
+
// Set User-Agent (required by some servers)
|
|
6699
|
+
// See https://github.com/axios/axios/issues/69
|
|
6700
|
+
if ('user-agent' in headerNames) {
|
|
6701
|
+
// User-Agent is specified; handle case where no UA header is desired
|
|
6702
|
+
if (!headers[headerNames['user-agent']]) {
|
|
6703
|
+
delete headers[headerNames['user-agent']];
|
|
6704
|
+
}
|
|
6705
|
+
// Otherwise, use specified value
|
|
6706
|
+
} else {
|
|
6707
|
+
// Only set header if it hasn't been set in config
|
|
6708
|
+
headers['User-Agent'] = 'axios/' + VERSION$1;
|
|
6709
|
+
}
|
|
6710
|
+
|
|
6711
|
+
if (data && !utils.isStream(data)) {
|
|
6712
|
+
if (Buffer.isBuffer(data)) ; else if (utils.isArrayBuffer(data)) {
|
|
6713
|
+
data = Buffer.from(new Uint8Array(data));
|
|
6714
|
+
} else if (utils.isString(data)) {
|
|
6715
|
+
data = Buffer.from(data, 'utf-8');
|
|
6716
|
+
} else {
|
|
6717
|
+
return reject(createError(
|
|
6718
|
+
'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream',
|
|
6719
|
+
config
|
|
6720
|
+
));
|
|
6721
|
+
}
|
|
6722
|
+
|
|
6723
|
+
if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) {
|
|
6724
|
+
return reject(createError('Request body larger than maxBodyLength limit', config));
|
|
6725
|
+
}
|
|
6726
|
+
|
|
6727
|
+
// Add Content-Length header if data exists
|
|
6728
|
+
if (!headerNames['content-length']) {
|
|
6729
|
+
headers['Content-Length'] = data.length;
|
|
6730
|
+
}
|
|
6731
|
+
}
|
|
6732
|
+
|
|
6733
|
+
// HTTP basic authentication
|
|
6734
|
+
var auth = undefined;
|
|
6735
|
+
if (config.auth) {
|
|
6736
|
+
var username = config.auth.username || '';
|
|
6737
|
+
var password = config.auth.password || '';
|
|
6738
|
+
auth = username + ':' + password;
|
|
6739
|
+
}
|
|
6740
|
+
|
|
6741
|
+
// Parse url
|
|
6742
|
+
var fullPath = buildFullPath(config.baseURL, config.url);
|
|
6743
|
+
var parsed = url__default["default"].parse(fullPath);
|
|
6744
|
+
var protocol = parsed.protocol || 'http:';
|
|
6745
|
+
|
|
6746
|
+
if (!auth && parsed.auth) {
|
|
6747
|
+
var urlAuth = parsed.auth.split(':');
|
|
6748
|
+
var urlUsername = urlAuth[0] || '';
|
|
6749
|
+
var urlPassword = urlAuth[1] || '';
|
|
6750
|
+
auth = urlUsername + ':' + urlPassword;
|
|
6751
|
+
}
|
|
6752
|
+
|
|
6753
|
+
if (auth && headerNames.authorization) {
|
|
6754
|
+
delete headers[headerNames.authorization];
|
|
6755
|
+
}
|
|
6756
|
+
|
|
6757
|
+
var isHttpsRequest = isHttps.test(protocol);
|
|
6758
|
+
var agent = isHttpsRequest ? config.httpsAgent : config.httpAgent;
|
|
6759
|
+
|
|
6760
|
+
try {
|
|
6761
|
+
buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\?/, '');
|
|
6762
|
+
} catch (err) {
|
|
6763
|
+
var customErr = new Error(err.message);
|
|
6764
|
+
customErr.config = config;
|
|
6765
|
+
customErr.url = config.url;
|
|
6766
|
+
customErr.exists = true;
|
|
6767
|
+
reject(customErr);
|
|
6768
|
+
}
|
|
6769
|
+
|
|
6770
|
+
var options = {
|
|
6771
|
+
path: buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\?/, ''),
|
|
6772
|
+
method: config.method.toUpperCase(),
|
|
6773
|
+
headers: headers,
|
|
6774
|
+
agent: agent,
|
|
6775
|
+
agents: { http: config.httpAgent, https: config.httpsAgent },
|
|
6776
|
+
auth: auth
|
|
6777
|
+
};
|
|
6778
|
+
|
|
6779
|
+
if (config.socketPath) {
|
|
6780
|
+
options.socketPath = config.socketPath;
|
|
6781
|
+
} else {
|
|
6782
|
+
options.hostname = parsed.hostname;
|
|
6783
|
+
options.port = parsed.port;
|
|
6784
|
+
}
|
|
6785
|
+
|
|
6786
|
+
var proxy = config.proxy;
|
|
6787
|
+
if (!proxy && proxy !== false) {
|
|
6788
|
+
var proxyEnv = protocol.slice(0, -1) + '_proxy';
|
|
6789
|
+
var proxyUrl = process.env[proxyEnv] || process.env[proxyEnv.toUpperCase()];
|
|
6790
|
+
if (proxyUrl) {
|
|
6791
|
+
var parsedProxyUrl = url__default["default"].parse(proxyUrl);
|
|
6792
|
+
var noProxyEnv = process.env.no_proxy || process.env.NO_PROXY;
|
|
6793
|
+
var shouldProxy = true;
|
|
6794
|
+
|
|
6795
|
+
if (noProxyEnv) {
|
|
6796
|
+
var noProxy = noProxyEnv.split(',').map(function trim(s) {
|
|
6797
|
+
return s.trim();
|
|
6798
|
+
});
|
|
6799
|
+
|
|
6800
|
+
shouldProxy = !noProxy.some(function proxyMatch(proxyElement) {
|
|
6801
|
+
if (!proxyElement) {
|
|
6802
|
+
return false;
|
|
6803
|
+
}
|
|
6804
|
+
if (proxyElement === '*') {
|
|
6805
|
+
return true;
|
|
6806
|
+
}
|
|
6807
|
+
if (proxyElement[0] === '.' &&
|
|
6808
|
+
parsed.hostname.substr(parsed.hostname.length - proxyElement.length) === proxyElement) {
|
|
6809
|
+
return true;
|
|
6810
|
+
}
|
|
6811
|
+
|
|
6812
|
+
return parsed.hostname === proxyElement;
|
|
6813
|
+
});
|
|
6814
|
+
}
|
|
6815
|
+
|
|
6816
|
+
if (shouldProxy) {
|
|
6817
|
+
proxy = {
|
|
6818
|
+
host: parsedProxyUrl.hostname,
|
|
6819
|
+
port: parsedProxyUrl.port,
|
|
6820
|
+
protocol: parsedProxyUrl.protocol
|
|
6821
|
+
};
|
|
6822
|
+
|
|
6823
|
+
if (parsedProxyUrl.auth) {
|
|
6824
|
+
var proxyUrlAuth = parsedProxyUrl.auth.split(':');
|
|
6825
|
+
proxy.auth = {
|
|
6826
|
+
username: proxyUrlAuth[0],
|
|
6827
|
+
password: proxyUrlAuth[1]
|
|
6828
|
+
};
|
|
6829
|
+
}
|
|
6830
|
+
}
|
|
6831
|
+
}
|
|
6832
|
+
}
|
|
6833
|
+
|
|
6834
|
+
if (proxy) {
|
|
6835
|
+
options.headers.host = parsed.hostname + (parsed.port ? ':' + parsed.port : '');
|
|
6836
|
+
setProxy(options, proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path);
|
|
6837
|
+
}
|
|
6838
|
+
|
|
6839
|
+
var transport;
|
|
6840
|
+
var isHttpsProxy = isHttpsRequest && (proxy ? isHttps.test(proxy.protocol) : true);
|
|
6841
|
+
if (config.transport) {
|
|
6842
|
+
transport = config.transport;
|
|
6843
|
+
} else if (config.maxRedirects === 0) {
|
|
6844
|
+
transport = isHttpsProxy ? https__default["default"] : http__default["default"];
|
|
6845
|
+
} else {
|
|
6846
|
+
if (config.maxRedirects) {
|
|
6847
|
+
options.maxRedirects = config.maxRedirects;
|
|
6848
|
+
}
|
|
6849
|
+
transport = isHttpsProxy ? httpsFollow : httpFollow;
|
|
6850
|
+
}
|
|
6851
|
+
|
|
6852
|
+
if (config.maxBodyLength > -1) {
|
|
6853
|
+
options.maxBodyLength = config.maxBodyLength;
|
|
6854
|
+
}
|
|
6855
|
+
|
|
6856
|
+
if (config.insecureHTTPParser) {
|
|
6857
|
+
options.insecureHTTPParser = config.insecureHTTPParser;
|
|
6858
|
+
}
|
|
6859
|
+
|
|
6860
|
+
// Create the request
|
|
6861
|
+
var req = transport.request(options, function handleResponse(res) {
|
|
6862
|
+
if (req.aborted) return;
|
|
6863
|
+
|
|
6864
|
+
// uncompress the response body transparently if required
|
|
6865
|
+
var stream = res;
|
|
6866
|
+
|
|
6867
|
+
// return the last request in case of redirects
|
|
6868
|
+
var lastRequest = res.req || req;
|
|
6869
|
+
|
|
6870
|
+
|
|
6871
|
+
// if no content, is HEAD request or decompress disabled we should not decompress
|
|
6872
|
+
if (res.statusCode !== 204 && lastRequest.method !== 'HEAD' && config.decompress !== false) {
|
|
6873
|
+
switch (res.headers['content-encoding']) {
|
|
6874
|
+
/*eslint default-case:0*/
|
|
6875
|
+
case 'gzip':
|
|
6876
|
+
case 'compress':
|
|
6877
|
+
case 'deflate':
|
|
6878
|
+
// add the unzipper to the body stream processing pipeline
|
|
6879
|
+
stream = stream.pipe(zlib__default["default"].createUnzip());
|
|
6880
|
+
|
|
6881
|
+
// remove the content-encoding in order to not confuse downstream operations
|
|
6882
|
+
delete res.headers['content-encoding'];
|
|
6883
|
+
break;
|
|
6884
|
+
}
|
|
6885
|
+
}
|
|
6886
|
+
|
|
6887
|
+
var response = {
|
|
6888
|
+
status: res.statusCode,
|
|
6889
|
+
statusText: res.statusMessage,
|
|
6890
|
+
headers: res.headers,
|
|
6891
|
+
config: config,
|
|
6892
|
+
request: lastRequest
|
|
6893
|
+
};
|
|
6894
|
+
|
|
6895
|
+
if (config.responseType === 'stream') {
|
|
6896
|
+
response.data = stream;
|
|
6897
|
+
settle(resolve, reject, response);
|
|
6898
|
+
} else {
|
|
6899
|
+
var responseBuffer = [];
|
|
6900
|
+
var totalResponseBytes = 0;
|
|
6901
|
+
stream.on('data', function handleStreamData(chunk) {
|
|
6902
|
+
responseBuffer.push(chunk);
|
|
6903
|
+
totalResponseBytes += chunk.length;
|
|
6904
|
+
|
|
6905
|
+
// make sure the content length is not over the maxContentLength if specified
|
|
6906
|
+
if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) {
|
|
6907
|
+
// stream.destoy() emit aborted event before calling reject() on Node.js v16
|
|
6908
|
+
rejected = true;
|
|
6909
|
+
stream.destroy();
|
|
6910
|
+
reject(createError('maxContentLength size of ' + config.maxContentLength + ' exceeded',
|
|
6911
|
+
config, null, lastRequest));
|
|
6912
|
+
}
|
|
6913
|
+
});
|
|
6914
|
+
|
|
6915
|
+
stream.on('aborted', function handlerStreamAborted() {
|
|
6916
|
+
if (rejected) {
|
|
6917
|
+
return;
|
|
6918
|
+
}
|
|
6919
|
+
stream.destroy();
|
|
6920
|
+
reject(createError('error request aborted', config, 'ERR_REQUEST_ABORTED', lastRequest));
|
|
6921
|
+
});
|
|
6922
|
+
|
|
6923
|
+
stream.on('error', function handleStreamError(err) {
|
|
6924
|
+
if (req.aborted) return;
|
|
6925
|
+
reject(enhanceError(err, config, null, lastRequest));
|
|
6926
|
+
});
|
|
6927
|
+
|
|
6928
|
+
stream.on('end', function handleStreamEnd() {
|
|
6929
|
+
try {
|
|
6930
|
+
var responseData = responseBuffer.length === 1 ? responseBuffer[0] : Buffer.concat(responseBuffer);
|
|
6931
|
+
if (config.responseType !== 'arraybuffer') {
|
|
6932
|
+
responseData = responseData.toString(config.responseEncoding);
|
|
6933
|
+
if (!config.responseEncoding || config.responseEncoding === 'utf8') {
|
|
6934
|
+
responseData = utils.stripBOM(responseData);
|
|
6935
|
+
}
|
|
6936
|
+
}
|
|
6937
|
+
response.data = responseData;
|
|
6938
|
+
} catch (err) {
|
|
6939
|
+
reject(enhanceError(err, config, err.code, response.request, response));
|
|
6940
|
+
}
|
|
6941
|
+
settle(resolve, reject, response);
|
|
6942
|
+
});
|
|
6943
|
+
}
|
|
6944
|
+
});
|
|
6945
|
+
|
|
6946
|
+
// Handle errors
|
|
6947
|
+
req.on('error', function handleRequestError(err) {
|
|
6948
|
+
if (req.aborted && err.code !== 'ERR_FR_TOO_MANY_REDIRECTS') return;
|
|
6949
|
+
reject(enhanceError(err, config, null, req));
|
|
6950
|
+
});
|
|
6951
|
+
|
|
6952
|
+
// set tcp keep alive to prevent drop connection by peer
|
|
6953
|
+
req.on('socket', function handleRequestSocket(socket) {
|
|
6954
|
+
// default interval of sending ack packet is 1 minute
|
|
6955
|
+
socket.setKeepAlive(true, 1000 * 60);
|
|
6956
|
+
});
|
|
6957
|
+
|
|
6958
|
+
// Handle request timeout
|
|
6959
|
+
if (config.timeout) {
|
|
6960
|
+
// This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types.
|
|
6961
|
+
var timeout = parseInt(config.timeout, 10);
|
|
6962
|
+
|
|
6963
|
+
if (isNaN(timeout)) {
|
|
6964
|
+
reject(createError(
|
|
6965
|
+
'error trying to parse `config.timeout` to int',
|
|
6966
|
+
config,
|
|
6967
|
+
'ERR_PARSE_TIMEOUT',
|
|
6968
|
+
req
|
|
6969
|
+
));
|
|
6970
|
+
|
|
6971
|
+
return;
|
|
6972
|
+
}
|
|
6973
|
+
|
|
6974
|
+
// Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system.
|
|
6975
|
+
// And timer callback will be fired, and abort() will be invoked before connection, then get "socket hang up" and code ECONNRESET.
|
|
6976
|
+
// At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up.
|
|
6977
|
+
// And then these socket which be hang up will devoring CPU little by little.
|
|
6978
|
+
// ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect.
|
|
6979
|
+
req.setTimeout(timeout, function handleRequestTimeout() {
|
|
6980
|
+
req.abort();
|
|
6981
|
+
var timeoutErrorMessage = '';
|
|
6982
|
+
if (config.timeoutErrorMessage) {
|
|
6983
|
+
timeoutErrorMessage = config.timeoutErrorMessage;
|
|
6984
|
+
} else {
|
|
6985
|
+
timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';
|
|
6986
|
+
}
|
|
6987
|
+
var transitional = config.transitional || defaults$1.transitional;
|
|
6988
|
+
reject(createError(
|
|
6989
|
+
timeoutErrorMessage,
|
|
6990
|
+
config,
|
|
6991
|
+
transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',
|
|
6992
|
+
req
|
|
6993
|
+
));
|
|
6994
|
+
});
|
|
6995
|
+
}
|
|
6996
|
+
|
|
6997
|
+
if (config.cancelToken || config.signal) {
|
|
6998
|
+
// Handle cancellation
|
|
6999
|
+
// eslint-disable-next-line func-names
|
|
7000
|
+
onCanceled = function(cancel) {
|
|
7001
|
+
if (req.aborted) return;
|
|
7002
|
+
|
|
7003
|
+
req.abort();
|
|
7004
|
+
reject(!cancel || (cancel && cancel.type) ? new Cancel_1('canceled') : cancel);
|
|
7005
|
+
};
|
|
7006
|
+
|
|
7007
|
+
config.cancelToken && config.cancelToken.subscribe(onCanceled);
|
|
7008
|
+
if (config.signal) {
|
|
7009
|
+
config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);
|
|
7010
|
+
}
|
|
7011
|
+
}
|
|
7012
|
+
|
|
7013
|
+
|
|
7014
|
+
// Send the request
|
|
7015
|
+
if (utils.isStream(data)) {
|
|
7016
|
+
data.on('error', function handleStreamError(err) {
|
|
7017
|
+
reject(enhanceError(err, config, null, req));
|
|
7018
|
+
}).pipe(req);
|
|
7019
|
+
} else {
|
|
7020
|
+
req.end(data);
|
|
7021
|
+
}
|
|
7022
|
+
});
|
|
7023
|
+
};var DEFAULT_CONTENT_TYPE = {
|
|
7024
|
+
'Content-Type': 'application/x-www-form-urlencoded'
|
|
7025
|
+
};
|
|
7026
|
+
|
|
7027
|
+
function setContentTypeIfUnset(headers, value) {
|
|
7028
|
+
if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {
|
|
7029
|
+
headers['Content-Type'] = value;
|
|
7030
|
+
}
|
|
7031
|
+
}
|
|
7032
|
+
|
|
7033
|
+
function getDefaultAdapter() {
|
|
7034
|
+
var adapter;
|
|
7035
|
+
if (typeof XMLHttpRequest !== 'undefined') {
|
|
7036
|
+
// For browsers use XHR adapter
|
|
7037
|
+
adapter = xhr;
|
|
7038
|
+
} else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {
|
|
7039
|
+
// For node use HTTP adapter
|
|
7040
|
+
adapter = http_1;
|
|
7041
|
+
}
|
|
7042
|
+
return adapter;
|
|
7043
|
+
}
|
|
7044
|
+
|
|
7045
|
+
function stringifySafely(rawValue, parser, encoder) {
|
|
7046
|
+
if (utils.isString(rawValue)) {
|
|
7047
|
+
try {
|
|
7048
|
+
(parser || JSON.parse)(rawValue);
|
|
7049
|
+
return utils.trim(rawValue);
|
|
7050
|
+
} catch (e) {
|
|
7051
|
+
if (e.name !== 'SyntaxError') {
|
|
7052
|
+
throw e;
|
|
7053
|
+
}
|
|
7054
|
+
}
|
|
7055
|
+
}
|
|
7056
|
+
|
|
7057
|
+
return (encoder || JSON.stringify)(rawValue);
|
|
7058
|
+
}
|
|
7059
|
+
|
|
7060
|
+
var defaults = {
|
|
7061
|
+
|
|
7062
|
+
transitional: {
|
|
7063
|
+
silentJSONParsing: true,
|
|
7064
|
+
forcedJSONParsing: true,
|
|
7065
|
+
clarifyTimeoutError: false
|
|
7066
|
+
},
|
|
7067
|
+
|
|
7068
|
+
adapter: getDefaultAdapter(),
|
|
7069
|
+
|
|
7070
|
+
transformRequest: [function transformRequest(data, headers) {
|
|
7071
|
+
normalizeHeaderName(headers, 'Accept');
|
|
7072
|
+
normalizeHeaderName(headers, 'Content-Type');
|
|
7073
|
+
|
|
7074
|
+
if (utils.isFormData(data) ||
|
|
7075
|
+
utils.isArrayBuffer(data) ||
|
|
7076
|
+
utils.isBuffer(data) ||
|
|
7077
|
+
utils.isStream(data) ||
|
|
7078
|
+
utils.isFile(data) ||
|
|
7079
|
+
utils.isBlob(data)
|
|
7080
|
+
) {
|
|
7081
|
+
return data;
|
|
7082
|
+
}
|
|
7083
|
+
if (utils.isArrayBufferView(data)) {
|
|
7084
|
+
return data.buffer;
|
|
7085
|
+
}
|
|
7086
|
+
if (utils.isURLSearchParams(data)) {
|
|
7087
|
+
setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');
|
|
7088
|
+
return data.toString();
|
|
7089
|
+
}
|
|
7090
|
+
if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) {
|
|
7091
|
+
setContentTypeIfUnset(headers, 'application/json');
|
|
7092
|
+
return stringifySafely(data);
|
|
7093
|
+
}
|
|
7094
|
+
return data;
|
|
7095
|
+
}],
|
|
7096
|
+
|
|
7097
|
+
transformResponse: [function transformResponse(data) {
|
|
7098
|
+
var transitional = this.transitional || defaults.transitional;
|
|
7099
|
+
var silentJSONParsing = transitional && transitional.silentJSONParsing;
|
|
7100
|
+
var forcedJSONParsing = transitional && transitional.forcedJSONParsing;
|
|
7101
|
+
var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';
|
|
7102
|
+
|
|
7103
|
+
if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {
|
|
7104
|
+
try {
|
|
7105
|
+
return JSON.parse(data);
|
|
7106
|
+
} catch (e) {
|
|
7107
|
+
if (strictJSONParsing) {
|
|
7108
|
+
if (e.name === 'SyntaxError') {
|
|
7109
|
+
throw enhanceError(e, this, 'E_JSON_PARSE');
|
|
7110
|
+
}
|
|
7111
|
+
throw e;
|
|
7112
|
+
}
|
|
7113
|
+
}
|
|
7114
|
+
}
|
|
7115
|
+
|
|
7116
|
+
return data;
|
|
7117
|
+
}],
|
|
7118
|
+
|
|
7119
|
+
/**
|
|
7120
|
+
* A timeout in milliseconds to abort a request. If set to 0 (default) a
|
|
7121
|
+
* timeout is not created.
|
|
7122
|
+
*/
|
|
7123
|
+
timeout: 0,
|
|
7124
|
+
|
|
7125
|
+
xsrfCookieName: 'XSRF-TOKEN',
|
|
7126
|
+
xsrfHeaderName: 'X-XSRF-TOKEN',
|
|
7127
|
+
|
|
7128
|
+
maxContentLength: -1,
|
|
7129
|
+
maxBodyLength: -1,
|
|
7130
|
+
|
|
7131
|
+
validateStatus: function validateStatus(status) {
|
|
7132
|
+
return status >= 200 && status < 300;
|
|
7133
|
+
},
|
|
7134
|
+
|
|
7135
|
+
headers: {
|
|
7136
|
+
common: {
|
|
7137
|
+
'Accept': 'application/json, text/plain, */*'
|
|
7138
|
+
}
|
|
7139
|
+
}
|
|
7140
|
+
};
|
|
7141
|
+
|
|
7142
|
+
utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
|
|
7143
|
+
defaults.headers[method] = {};
|
|
7144
|
+
});
|
|
7145
|
+
|
|
7146
|
+
utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
|
|
7147
|
+
defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
|
|
7148
|
+
});
|
|
7149
|
+
|
|
7150
|
+
var defaults_1 = defaults;/**
|
|
7151
|
+
* Transform the data for a request or a response
|
|
7152
|
+
*
|
|
7153
|
+
* @param {Object|String} data The data to be transformed
|
|
7154
|
+
* @param {Array} headers The headers for the request or response
|
|
7155
|
+
* @param {Array|Function} fns A single function or Array of functions
|
|
7156
|
+
* @returns {*} The resulting transformed data
|
|
7157
|
+
*/
|
|
7158
|
+
var transformData = function transformData(data, headers, fns) {
|
|
7159
|
+
var context = this || defaults$1;
|
|
7160
|
+
/*eslint no-param-reassign:0*/
|
|
7161
|
+
utils.forEach(fns, function transform(fn) {
|
|
7162
|
+
data = fn.call(context, data, headers);
|
|
7163
|
+
});
|
|
7164
|
+
|
|
7165
|
+
return data;
|
|
7166
|
+
};var isCancel = function isCancel(value) {
|
|
7167
|
+
return !!(value && value.__CANCEL__);
|
|
7168
|
+
};/**
|
|
7169
|
+
* Throws a `Cancel` if cancellation has been requested.
|
|
7170
|
+
*/
|
|
7171
|
+
function throwIfCancellationRequested(config) {
|
|
7172
|
+
if (config.cancelToken) {
|
|
7173
|
+
config.cancelToken.throwIfRequested();
|
|
7174
|
+
}
|
|
7175
|
+
|
|
7176
|
+
if (config.signal && config.signal.aborted) {
|
|
7177
|
+
throw new Cancel_1('canceled');
|
|
7178
|
+
}
|
|
7179
|
+
}
|
|
7180
|
+
|
|
7181
|
+
/**
|
|
7182
|
+
* Dispatch a request to the server using the configured adapter.
|
|
7183
|
+
*
|
|
7184
|
+
* @param {object} config The config that is to be used for the request
|
|
7185
|
+
* @returns {Promise} The Promise to be fulfilled
|
|
7186
|
+
*/
|
|
7187
|
+
var dispatchRequest = function dispatchRequest(config) {
|
|
7188
|
+
throwIfCancellationRequested(config);
|
|
7189
|
+
|
|
7190
|
+
// Ensure headers exist
|
|
7191
|
+
config.headers = config.headers || {};
|
|
7192
|
+
|
|
7193
|
+
// Transform request data
|
|
7194
|
+
config.data = transformData.call(
|
|
7195
|
+
config,
|
|
7196
|
+
config.data,
|
|
7197
|
+
config.headers,
|
|
7198
|
+
config.transformRequest
|
|
7199
|
+
);
|
|
7200
|
+
|
|
7201
|
+
// Flatten headers
|
|
7202
|
+
config.headers = utils.merge(
|
|
7203
|
+
config.headers.common || {},
|
|
7204
|
+
config.headers[config.method] || {},
|
|
7205
|
+
config.headers
|
|
7206
|
+
);
|
|
7207
|
+
|
|
7208
|
+
utils.forEach(
|
|
7209
|
+
['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
|
|
7210
|
+
function cleanHeaderConfig(method) {
|
|
7211
|
+
delete config.headers[method];
|
|
7212
|
+
}
|
|
7213
|
+
);
|
|
7214
|
+
|
|
7215
|
+
var adapter = config.adapter || defaults$1.adapter;
|
|
7216
|
+
|
|
7217
|
+
return adapter(config).then(function onAdapterResolution(response) {
|
|
7218
|
+
throwIfCancellationRequested(config);
|
|
7219
|
+
|
|
7220
|
+
// Transform response data
|
|
7221
|
+
response.data = transformData.call(
|
|
7222
|
+
config,
|
|
7223
|
+
response.data,
|
|
7224
|
+
response.headers,
|
|
7225
|
+
config.transformResponse
|
|
7226
|
+
);
|
|
7227
|
+
|
|
7228
|
+
return response;
|
|
7229
|
+
}, function onAdapterRejection(reason) {
|
|
7230
|
+
if (!isCancel(reason)) {
|
|
7231
|
+
throwIfCancellationRequested(config);
|
|
7232
|
+
|
|
7233
|
+
// Transform response data
|
|
7234
|
+
if (reason && reason.response) {
|
|
7235
|
+
reason.response.data = transformData.call(
|
|
7236
|
+
config,
|
|
7237
|
+
reason.response.data,
|
|
7238
|
+
reason.response.headers,
|
|
7239
|
+
config.transformResponse
|
|
7240
|
+
);
|
|
7241
|
+
}
|
|
7242
|
+
}
|
|
7243
|
+
|
|
7244
|
+
return Promise.reject(reason);
|
|
7245
|
+
});
|
|
7246
|
+
};/**
|
|
7247
|
+
* Config-specific merge-function which creates a new config-object
|
|
7248
|
+
* by merging two configuration objects together.
|
|
7249
|
+
*
|
|
7250
|
+
* @param {Object} config1
|
|
7251
|
+
* @param {Object} config2
|
|
7252
|
+
* @returns {Object} New object resulting from merging config2 to config1
|
|
7253
|
+
*/
|
|
7254
|
+
var mergeConfig = function mergeConfig(config1, config2) {
|
|
7255
|
+
// eslint-disable-next-line no-param-reassign
|
|
7256
|
+
config2 = config2 || {};
|
|
7257
|
+
var config = {};
|
|
7258
|
+
|
|
7259
|
+
function getMergedValue(target, source) {
|
|
7260
|
+
if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
|
|
7261
|
+
return utils.merge(target, source);
|
|
7262
|
+
} else if (utils.isPlainObject(source)) {
|
|
7263
|
+
return utils.merge({}, source);
|
|
7264
|
+
} else if (utils.isArray(source)) {
|
|
7265
|
+
return source.slice();
|
|
7266
|
+
}
|
|
7267
|
+
return source;
|
|
7268
|
+
}
|
|
7269
|
+
|
|
7270
|
+
// eslint-disable-next-line consistent-return
|
|
7271
|
+
function mergeDeepProperties(prop) {
|
|
7272
|
+
if (!utils.isUndefined(config2[prop])) {
|
|
7273
|
+
return getMergedValue(config1[prop], config2[prop]);
|
|
7274
|
+
} else if (!utils.isUndefined(config1[prop])) {
|
|
7275
|
+
return getMergedValue(undefined, config1[prop]);
|
|
7276
|
+
}
|
|
7277
|
+
}
|
|
7278
|
+
|
|
7279
|
+
// eslint-disable-next-line consistent-return
|
|
7280
|
+
function valueFromConfig2(prop) {
|
|
7281
|
+
if (!utils.isUndefined(config2[prop])) {
|
|
7282
|
+
return getMergedValue(undefined, config2[prop]);
|
|
7283
|
+
}
|
|
7284
|
+
}
|
|
7285
|
+
|
|
7286
|
+
// eslint-disable-next-line consistent-return
|
|
7287
|
+
function defaultToConfig2(prop) {
|
|
7288
|
+
if (!utils.isUndefined(config2[prop])) {
|
|
7289
|
+
return getMergedValue(undefined, config2[prop]);
|
|
7290
|
+
} else if (!utils.isUndefined(config1[prop])) {
|
|
7291
|
+
return getMergedValue(undefined, config1[prop]);
|
|
7292
|
+
}
|
|
7293
|
+
}
|
|
7294
|
+
|
|
7295
|
+
// eslint-disable-next-line consistent-return
|
|
7296
|
+
function mergeDirectKeys(prop) {
|
|
7297
|
+
if (prop in config2) {
|
|
7298
|
+
return getMergedValue(config1[prop], config2[prop]);
|
|
7299
|
+
} else if (prop in config1) {
|
|
7300
|
+
return getMergedValue(undefined, config1[prop]);
|
|
7301
|
+
}
|
|
7302
|
+
}
|
|
7303
|
+
|
|
7304
|
+
var mergeMap = {
|
|
7305
|
+
'url': valueFromConfig2,
|
|
7306
|
+
'method': valueFromConfig2,
|
|
7307
|
+
'data': valueFromConfig2,
|
|
7308
|
+
'baseURL': defaultToConfig2,
|
|
7309
|
+
'transformRequest': defaultToConfig2,
|
|
7310
|
+
'transformResponse': defaultToConfig2,
|
|
7311
|
+
'paramsSerializer': defaultToConfig2,
|
|
7312
|
+
'timeout': defaultToConfig2,
|
|
7313
|
+
'timeoutMessage': defaultToConfig2,
|
|
7314
|
+
'withCredentials': defaultToConfig2,
|
|
7315
|
+
'adapter': defaultToConfig2,
|
|
7316
|
+
'responseType': defaultToConfig2,
|
|
7317
|
+
'xsrfCookieName': defaultToConfig2,
|
|
7318
|
+
'xsrfHeaderName': defaultToConfig2,
|
|
7319
|
+
'onUploadProgress': defaultToConfig2,
|
|
7320
|
+
'onDownloadProgress': defaultToConfig2,
|
|
7321
|
+
'decompress': defaultToConfig2,
|
|
7322
|
+
'maxContentLength': defaultToConfig2,
|
|
7323
|
+
'maxBodyLength': defaultToConfig2,
|
|
7324
|
+
'transport': defaultToConfig2,
|
|
7325
|
+
'httpAgent': defaultToConfig2,
|
|
7326
|
+
'httpsAgent': defaultToConfig2,
|
|
7327
|
+
'cancelToken': defaultToConfig2,
|
|
7328
|
+
'socketPath': defaultToConfig2,
|
|
7329
|
+
'responseEncoding': defaultToConfig2,
|
|
7330
|
+
'validateStatus': mergeDirectKeys
|
|
7331
|
+
};
|
|
7332
|
+
|
|
7333
|
+
utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {
|
|
7334
|
+
var merge = mergeMap[prop] || mergeDeepProperties;
|
|
7335
|
+
var configValue = merge(prop);
|
|
7336
|
+
(utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
|
|
7337
|
+
});
|
|
7338
|
+
|
|
7339
|
+
return config;
|
|
7340
|
+
};var VERSION = data.version;
|
|
7341
|
+
|
|
7342
|
+
var validators$1 = {};
|
|
7343
|
+
|
|
7344
|
+
// eslint-disable-next-line func-names
|
|
7345
|
+
['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {
|
|
7346
|
+
validators$1[type] = function validator(thing) {
|
|
7347
|
+
return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;
|
|
7348
|
+
};
|
|
7349
|
+
});
|
|
7350
|
+
|
|
7351
|
+
var deprecatedWarnings = {};
|
|
7352
|
+
|
|
7353
|
+
/**
|
|
7354
|
+
* Transitional option validator
|
|
7355
|
+
* @param {function|boolean?} validator - set to false if the transitional option has been removed
|
|
7356
|
+
* @param {string?} version - deprecated version / removed since version
|
|
7357
|
+
* @param {string?} message - some message with additional info
|
|
7358
|
+
* @returns {function}
|
|
7359
|
+
*/
|
|
7360
|
+
validators$1.transitional = function transitional(validator, version, message) {
|
|
7361
|
+
function formatMessage(opt, desc) {
|
|
7362
|
+
return '[Axios v' + VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : '');
|
|
7363
|
+
}
|
|
7364
|
+
|
|
7365
|
+
// eslint-disable-next-line func-names
|
|
7366
|
+
return function(value, opt, opts) {
|
|
7367
|
+
if (validator === false) {
|
|
7368
|
+
throw new Error(formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')));
|
|
7369
|
+
}
|
|
7370
|
+
|
|
7371
|
+
if (version && !deprecatedWarnings[opt]) {
|
|
7372
|
+
deprecatedWarnings[opt] = true;
|
|
7373
|
+
// eslint-disable-next-line no-console
|
|
7374
|
+
console.warn(
|
|
7375
|
+
formatMessage(
|
|
7376
|
+
opt,
|
|
7377
|
+
' has been deprecated since v' + version + ' and will be removed in the near future'
|
|
7378
|
+
)
|
|
7379
|
+
);
|
|
7380
|
+
}
|
|
7381
|
+
|
|
7382
|
+
return validator ? validator(value, opt, opts) : true;
|
|
7383
|
+
};
|
|
7384
|
+
};
|
|
7385
|
+
|
|
7386
|
+
/**
|
|
7387
|
+
* Assert object's properties type
|
|
7388
|
+
* @param {object} options
|
|
7389
|
+
* @param {object} schema
|
|
7390
|
+
* @param {boolean?} allowUnknown
|
|
7391
|
+
*/
|
|
7392
|
+
|
|
7393
|
+
function assertOptions(options, schema, allowUnknown) {
|
|
7394
|
+
if (typeof options !== 'object') {
|
|
7395
|
+
throw new TypeError('options must be an object');
|
|
7396
|
+
}
|
|
7397
|
+
var keys = Object.keys(options);
|
|
7398
|
+
var i = keys.length;
|
|
7399
|
+
while (i-- > 0) {
|
|
7400
|
+
var opt = keys[i];
|
|
7401
|
+
var validator = schema[opt];
|
|
7402
|
+
if (validator) {
|
|
7403
|
+
var value = options[opt];
|
|
7404
|
+
var result = value === undefined || validator(value, opt, options);
|
|
7405
|
+
if (result !== true) {
|
|
7406
|
+
throw new TypeError('option ' + opt + ' must be ' + result);
|
|
7407
|
+
}
|
|
7408
|
+
continue;
|
|
7409
|
+
}
|
|
7410
|
+
if (allowUnknown !== true) {
|
|
7411
|
+
throw Error('Unknown option ' + opt);
|
|
7412
|
+
}
|
|
7413
|
+
}
|
|
7414
|
+
}
|
|
7415
|
+
|
|
7416
|
+
var validator = {
|
|
7417
|
+
assertOptions: assertOptions,
|
|
7418
|
+
validators: validators$1
|
|
7419
|
+
};var validators = validator.validators;
|
|
7420
|
+
/**
|
|
7421
|
+
* Create a new instance of Axios
|
|
7422
|
+
*
|
|
7423
|
+
* @param {Object} instanceConfig The default config for the instance
|
|
7424
|
+
*/
|
|
7425
|
+
function Axios(instanceConfig) {
|
|
7426
|
+
this.defaults = instanceConfig;
|
|
7427
|
+
this.interceptors = {
|
|
7428
|
+
request: new InterceptorManager_1(),
|
|
7429
|
+
response: new InterceptorManager_1()
|
|
7430
|
+
};
|
|
7431
|
+
}
|
|
7432
|
+
|
|
7433
|
+
/**
|
|
7434
|
+
* Dispatch a request
|
|
7435
|
+
*
|
|
7436
|
+
* @param {Object} config The config specific for this request (merged with this.defaults)
|
|
7437
|
+
*/
|
|
7438
|
+
Axios.prototype.request = function request(configOrUrl, config) {
|
|
7439
|
+
/*eslint no-param-reassign:0*/
|
|
7440
|
+
// Allow for axios('example/url'[, config]) a la fetch API
|
|
7441
|
+
if (typeof configOrUrl === 'string') {
|
|
7442
|
+
config = config || {};
|
|
7443
|
+
config.url = configOrUrl;
|
|
7444
|
+
} else {
|
|
7445
|
+
config = configOrUrl || {};
|
|
7446
|
+
}
|
|
7447
|
+
|
|
7448
|
+
config = mergeConfig(this.defaults, config);
|
|
7449
|
+
|
|
7450
|
+
// Set config.method
|
|
7451
|
+
if (config.method) {
|
|
7452
|
+
config.method = config.method.toLowerCase();
|
|
7453
|
+
} else if (this.defaults.method) {
|
|
7454
|
+
config.method = this.defaults.method.toLowerCase();
|
|
7455
|
+
} else {
|
|
7456
|
+
config.method = 'get';
|
|
7457
|
+
}
|
|
7458
|
+
|
|
7459
|
+
var transitional = config.transitional;
|
|
7460
|
+
|
|
7461
|
+
if (transitional !== undefined) {
|
|
7462
|
+
validator.assertOptions(transitional, {
|
|
7463
|
+
silentJSONParsing: validators.transitional(validators.boolean),
|
|
7464
|
+
forcedJSONParsing: validators.transitional(validators.boolean),
|
|
7465
|
+
clarifyTimeoutError: validators.transitional(validators.boolean)
|
|
7466
|
+
}, false);
|
|
7467
|
+
}
|
|
7468
|
+
|
|
7469
|
+
// filter out skipped interceptors
|
|
7470
|
+
var requestInterceptorChain = [];
|
|
7471
|
+
var synchronousRequestInterceptors = true;
|
|
7472
|
+
this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
|
|
7473
|
+
if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {
|
|
7474
|
+
return;
|
|
7475
|
+
}
|
|
7476
|
+
|
|
7477
|
+
synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
|
|
7478
|
+
|
|
7479
|
+
requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
|
|
7480
|
+
});
|
|
7481
|
+
|
|
7482
|
+
var responseInterceptorChain = [];
|
|
7483
|
+
this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
|
|
7484
|
+
responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
|
|
7485
|
+
});
|
|
7486
|
+
|
|
7487
|
+
var promise;
|
|
7488
|
+
|
|
7489
|
+
if (!synchronousRequestInterceptors) {
|
|
7490
|
+
var chain = [dispatchRequest, undefined];
|
|
7491
|
+
|
|
7492
|
+
Array.prototype.unshift.apply(chain, requestInterceptorChain);
|
|
7493
|
+
chain = chain.concat(responseInterceptorChain);
|
|
7494
|
+
|
|
7495
|
+
promise = Promise.resolve(config);
|
|
7496
|
+
while (chain.length) {
|
|
7497
|
+
promise = promise.then(chain.shift(), chain.shift());
|
|
7498
|
+
}
|
|
7499
|
+
|
|
7500
|
+
return promise;
|
|
7501
|
+
}
|
|
7502
|
+
|
|
7503
|
+
|
|
7504
|
+
var newConfig = config;
|
|
7505
|
+
while (requestInterceptorChain.length) {
|
|
7506
|
+
var onFulfilled = requestInterceptorChain.shift();
|
|
7507
|
+
var onRejected = requestInterceptorChain.shift();
|
|
7508
|
+
try {
|
|
7509
|
+
newConfig = onFulfilled(newConfig);
|
|
7510
|
+
} catch (error) {
|
|
7511
|
+
onRejected(error);
|
|
7512
|
+
break;
|
|
7513
|
+
}
|
|
7514
|
+
}
|
|
7515
|
+
|
|
7516
|
+
try {
|
|
7517
|
+
promise = dispatchRequest(newConfig);
|
|
7518
|
+
} catch (error) {
|
|
7519
|
+
return Promise.reject(error);
|
|
7520
|
+
}
|
|
7521
|
+
|
|
7522
|
+
while (responseInterceptorChain.length) {
|
|
7523
|
+
promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());
|
|
7524
|
+
}
|
|
7525
|
+
|
|
7526
|
+
return promise;
|
|
7527
|
+
};
|
|
7528
|
+
|
|
7529
|
+
Axios.prototype.getUri = function getUri(config) {
|
|
7530
|
+
config = mergeConfig(this.defaults, config);
|
|
7531
|
+
return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, '');
|
|
7532
|
+
};
|
|
7533
|
+
|
|
7534
|
+
// Provide aliases for supported request methods
|
|
7535
|
+
utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
|
|
7536
|
+
/*eslint func-names:0*/
|
|
7537
|
+
Axios.prototype[method] = function(url, config) {
|
|
7538
|
+
return this.request(mergeConfig(config || {}, {
|
|
7539
|
+
method: method,
|
|
7540
|
+
url: url,
|
|
7541
|
+
data: (config || {}).data
|
|
7542
|
+
}));
|
|
7543
|
+
};
|
|
7544
|
+
});
|
|
7545
|
+
|
|
7546
|
+
utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
|
|
7547
|
+
/*eslint func-names:0*/
|
|
7548
|
+
Axios.prototype[method] = function(url, data, config) {
|
|
7549
|
+
return this.request(mergeConfig(config || {}, {
|
|
7550
|
+
method: method,
|
|
7551
|
+
url: url,
|
|
7552
|
+
data: data
|
|
7553
|
+
}));
|
|
7554
|
+
};
|
|
7555
|
+
});
|
|
7556
|
+
|
|
7557
|
+
var Axios_1 = Axios;/**
|
|
7558
|
+
* A `CancelToken` is an object that can be used to request cancellation of an operation.
|
|
7559
|
+
*
|
|
7560
|
+
* @class
|
|
7561
|
+
* @param {Function} executor The executor function.
|
|
7562
|
+
*/
|
|
7563
|
+
function CancelToken(executor) {
|
|
7564
|
+
if (typeof executor !== 'function') {
|
|
7565
|
+
throw new TypeError('executor must be a function.');
|
|
7566
|
+
}
|
|
7567
|
+
|
|
7568
|
+
var resolvePromise;
|
|
7569
|
+
|
|
7570
|
+
this.promise = new Promise(function promiseExecutor(resolve) {
|
|
7571
|
+
resolvePromise = resolve;
|
|
7572
|
+
});
|
|
7573
|
+
|
|
7574
|
+
var token = this;
|
|
7575
|
+
|
|
7576
|
+
// eslint-disable-next-line func-names
|
|
7577
|
+
this.promise.then(function(cancel) {
|
|
7578
|
+
if (!token._listeners) return;
|
|
7579
|
+
|
|
7580
|
+
var i;
|
|
7581
|
+
var l = token._listeners.length;
|
|
7582
|
+
|
|
7583
|
+
for (i = 0; i < l; i++) {
|
|
7584
|
+
token._listeners[i](cancel);
|
|
7585
|
+
}
|
|
7586
|
+
token._listeners = null;
|
|
7587
|
+
});
|
|
7588
|
+
|
|
7589
|
+
// eslint-disable-next-line func-names
|
|
7590
|
+
this.promise.then = function(onfulfilled) {
|
|
7591
|
+
var _resolve;
|
|
7592
|
+
// eslint-disable-next-line func-names
|
|
7593
|
+
var promise = new Promise(function(resolve) {
|
|
7594
|
+
token.subscribe(resolve);
|
|
7595
|
+
_resolve = resolve;
|
|
7596
|
+
}).then(onfulfilled);
|
|
7597
|
+
|
|
7598
|
+
promise.cancel = function reject() {
|
|
7599
|
+
token.unsubscribe(_resolve);
|
|
7600
|
+
};
|
|
7601
|
+
|
|
7602
|
+
return promise;
|
|
7603
|
+
};
|
|
7604
|
+
|
|
7605
|
+
executor(function cancel(message) {
|
|
7606
|
+
if (token.reason) {
|
|
7607
|
+
// Cancellation has already been requested
|
|
7608
|
+
return;
|
|
7609
|
+
}
|
|
7610
|
+
|
|
7611
|
+
token.reason = new Cancel_1(message);
|
|
7612
|
+
resolvePromise(token.reason);
|
|
7613
|
+
});
|
|
7614
|
+
}
|
|
7615
|
+
|
|
7616
|
+
/**
|
|
7617
|
+
* Throws a `Cancel` if cancellation has been requested.
|
|
7618
|
+
*/
|
|
7619
|
+
CancelToken.prototype.throwIfRequested = function throwIfRequested() {
|
|
7620
|
+
if (this.reason) {
|
|
7621
|
+
throw this.reason;
|
|
7622
|
+
}
|
|
7623
|
+
};
|
|
7624
|
+
|
|
7625
|
+
/**
|
|
7626
|
+
* Subscribe to the cancel signal
|
|
7627
|
+
*/
|
|
7628
|
+
|
|
7629
|
+
CancelToken.prototype.subscribe = function subscribe(listener) {
|
|
7630
|
+
if (this.reason) {
|
|
7631
|
+
listener(this.reason);
|
|
7632
|
+
return;
|
|
7633
|
+
}
|
|
7634
|
+
|
|
7635
|
+
if (this._listeners) {
|
|
7636
|
+
this._listeners.push(listener);
|
|
7637
|
+
} else {
|
|
7638
|
+
this._listeners = [listener];
|
|
7639
|
+
}
|
|
7640
|
+
};
|
|
7641
|
+
|
|
7642
|
+
/**
|
|
7643
|
+
* Unsubscribe from the cancel signal
|
|
7644
|
+
*/
|
|
7645
|
+
|
|
7646
|
+
CancelToken.prototype.unsubscribe = function unsubscribe(listener) {
|
|
7647
|
+
if (!this._listeners) {
|
|
7648
|
+
return;
|
|
7649
|
+
}
|
|
7650
|
+
var index = this._listeners.indexOf(listener);
|
|
7651
|
+
if (index !== -1) {
|
|
7652
|
+
this._listeners.splice(index, 1);
|
|
7653
|
+
}
|
|
7654
|
+
};
|
|
7655
|
+
|
|
7656
|
+
/**
|
|
7657
|
+
* Returns an object that contains a new `CancelToken` and a function that, when called,
|
|
7658
|
+
* cancels the `CancelToken`.
|
|
7659
|
+
*/
|
|
7660
|
+
CancelToken.source = function source() {
|
|
7661
|
+
var cancel;
|
|
7662
|
+
var token = new CancelToken(function executor(c) {
|
|
7663
|
+
cancel = c;
|
|
7664
|
+
});
|
|
7665
|
+
return {
|
|
7666
|
+
token: token,
|
|
7667
|
+
cancel: cancel
|
|
7668
|
+
};
|
|
7669
|
+
};
|
|
7670
|
+
|
|
7671
|
+
var CancelToken_1 = CancelToken;/**
|
|
7672
|
+
* Syntactic sugar for invoking a function and expanding an array for arguments.
|
|
7673
|
+
*
|
|
7674
|
+
* Common use case would be to use `Function.prototype.apply`.
|
|
7675
|
+
*
|
|
7676
|
+
* ```js
|
|
7677
|
+
* function f(x, y, z) {}
|
|
7678
|
+
* var args = [1, 2, 3];
|
|
7679
|
+
* f.apply(null, args);
|
|
7680
|
+
* ```
|
|
7681
|
+
*
|
|
7682
|
+
* With `spread` this example can be re-written.
|
|
7683
|
+
*
|
|
7684
|
+
* ```js
|
|
7685
|
+
* spread(function(x, y, z) {})([1, 2, 3]);
|
|
7686
|
+
* ```
|
|
7687
|
+
*
|
|
7688
|
+
* @param {Function} callback
|
|
7689
|
+
* @returns {Function}
|
|
7690
|
+
*/
|
|
7691
|
+
var spread = function spread(callback) {
|
|
7692
|
+
return function wrap(arr) {
|
|
7693
|
+
return callback.apply(null, arr);
|
|
7694
|
+
};
|
|
7695
|
+
};/**
|
|
7696
|
+
* Determines whether the payload is an error thrown by Axios
|
|
7697
|
+
*
|
|
7698
|
+
* @param {*} payload The value to test
|
|
7699
|
+
* @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
|
|
7700
|
+
*/
|
|
7701
|
+
var isAxiosError = function isAxiosError(payload) {
|
|
7702
|
+
return utils.isObject(payload) && (payload.isAxiosError === true);
|
|
7703
|
+
};/**
|
|
7704
|
+
* Create an instance of Axios
|
|
7705
|
+
*
|
|
7706
|
+
* @param {Object} defaultConfig The default config for the instance
|
|
7707
|
+
* @return {Axios} A new instance of Axios
|
|
7708
|
+
*/
|
|
7709
|
+
function createInstance(defaultConfig) {
|
|
7710
|
+
var context = new Axios_1(defaultConfig);
|
|
7711
|
+
var instance = bind(Axios_1.prototype.request, context);
|
|
7712
|
+
|
|
7713
|
+
// Copy axios.prototype to instance
|
|
7714
|
+
utils.extend(instance, Axios_1.prototype, context);
|
|
7715
|
+
|
|
7716
|
+
// Copy context to instance
|
|
7717
|
+
utils.extend(instance, context);
|
|
7718
|
+
|
|
7719
|
+
// Factory for creating new instances
|
|
7720
|
+
instance.create = function create(instanceConfig) {
|
|
7721
|
+
return createInstance(mergeConfig(defaultConfig, instanceConfig));
|
|
7722
|
+
};
|
|
7723
|
+
|
|
7724
|
+
return instance;
|
|
7725
|
+
}
|
|
7726
|
+
|
|
7727
|
+
// Create the default instance to be exported
|
|
7728
|
+
var axios$1 = createInstance(defaults$1);
|
|
7729
|
+
|
|
7730
|
+
// Expose Axios class to allow class inheritance
|
|
7731
|
+
axios$1.Axios = Axios_1;
|
|
7732
|
+
|
|
7733
|
+
// Expose Cancel & CancelToken
|
|
7734
|
+
axios$1.Cancel = Cancel_1;
|
|
7735
|
+
axios$1.CancelToken = CancelToken_1;
|
|
7736
|
+
axios$1.isCancel = isCancel;
|
|
7737
|
+
axios$1.VERSION = data.version;
|
|
7738
|
+
|
|
7739
|
+
// Expose all/spread
|
|
7740
|
+
axios$1.all = function all(promises) {
|
|
7741
|
+
return Promise.all(promises);
|
|
7742
|
+
};
|
|
7743
|
+
axios$1.spread = spread;
|
|
7744
|
+
|
|
7745
|
+
// Expose isAxiosError
|
|
7746
|
+
axios$1.isAxiosError = isAxiosError;
|
|
7747
|
+
|
|
7748
|
+
var axios_1 = axios$1;
|
|
7749
|
+
|
|
7750
|
+
// Allow use of default import syntax in TypeScript
|
|
7751
|
+
var _default = axios$1;
|
|
7752
|
+
axios_1.default = _default;var axios = axios_1;vue__default["default"].prototype.$httpRequest = axios;
|
|
7753
|
+
var baseURL = window.location.hostname == 'localhost' ? "https://linux07/im/atdHumano/middleware/atd_api.php" : "https://".concat(window.location.hostname);
|
|
7754
|
+
var dev = window.location.hostname == 'localhost' ? '&teste=levchat2' : '';
|
|
7755
|
+
var standardMessages = {
|
|
7756
|
+
methods: {
|
|
7757
|
+
getStandardMessages: function getStandardMessages(type, token) {
|
|
7758
|
+
var _this = this;
|
|
7759
|
+
|
|
7760
|
+
return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
7761
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
7762
|
+
while (1) {
|
|
7763
|
+
switch (_context.prev = _context.next) {
|
|
7764
|
+
case 0:
|
|
7765
|
+
_context.prev = 0;
|
|
7766
|
+
return _context.abrupt("return", _this.$httpRequest({
|
|
7767
|
+
method: 'get',
|
|
7768
|
+
url: "".concat(baseURL, "/get-messages/").concat(type, "?token_cliente=").concat(token).concat(dev) // headers: {
|
|
7769
|
+
// Authorization: "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdGQiOiJNS1VJNnhZdm1xSWVFaWpuMXJwMERkZzQ0ZjFzd3dpbTRsNXd3WWFrVUJtd3d4YjQ0YXd3ZVJ1U2lUeUxxVTEiLCJtYW5hZ2VyIjoiTUtVd0J6YzFnVkIzaWNlNE5yU01lbU5aekI1MkExTzdtNXdhdmQyYnd3eGI0NGF3d3d3eGI0NGF3d3FVU2NoIiwibnJvcyI6WyI0MSJdLCJhdXRoIjoiTUtVVnAxTWR3d2ltNGw1d3dYTnNjWDg5R3V4c1RsZUVqdGdpNjhoNk1JUzl6d0xBTGVRbjhUUCIsImlhdCI6MTY0NjMzOTkyOCwiZXhwIjoxNjQ2NDI2MzI4fQ.QNu0uO3qV-Lqvu8Xww1F_x8Bwnjlm175IVdM89EgPM0"
|
|
7770
|
+
// }
|
|
7771
|
+
|
|
7772
|
+
}).then(function (response) {
|
|
7773
|
+
var data = response.data;
|
|
7774
|
+
var tipo = data.tipo,
|
|
7775
|
+
nivel = data.nivel,
|
|
7776
|
+
msg_ret = data.msg_ret,
|
|
7777
|
+
st_ret = data.st_ret;
|
|
7778
|
+
if (tipo) _this.$emit('set-message-type', tipo);
|
|
7779
|
+
return st_ret === 'OK' ? nivel : st_ret === 'AVISO' ? msg_ret : false;
|
|
7780
|
+
}).catch(function (err) {
|
|
7781
|
+
return console.error('Erro na requisicao para o servidor', err);
|
|
7782
|
+
}));
|
|
7783
|
+
|
|
7784
|
+
case 4:
|
|
7785
|
+
_context.prev = 4;
|
|
7786
|
+
_context.t0 = _context["catch"](0);
|
|
7787
|
+
console.error("Axios nao identificado");
|
|
7788
|
+
console.error(_context.t0);
|
|
7789
|
+
|
|
7790
|
+
case 8:
|
|
7791
|
+
case "end":
|
|
7792
|
+
return _context.stop();
|
|
7793
|
+
}
|
|
7794
|
+
}
|
|
7795
|
+
}, _callee, null, [[0, 4]]);
|
|
7796
|
+
}))();
|
|
7797
|
+
}
|
|
7798
|
+
}
|
|
7799
|
+
};//
|
|
7800
|
+
var script$g = {
|
|
7801
|
+
mixins: [standardMessages],
|
|
7802
|
+
props: {
|
|
7803
|
+
dictionary: {
|
|
7804
|
+
type: Object,
|
|
7805
|
+
default: {},
|
|
7806
|
+
required: false
|
|
7807
|
+
},
|
|
7808
|
+
backgroundColor: {
|
|
7809
|
+
type: String,
|
|
7810
|
+
default: '#fff',
|
|
7811
|
+
required: false
|
|
7812
|
+
},
|
|
7813
|
+
token_cliente: {
|
|
7814
|
+
type: String,
|
|
7815
|
+
default: '',
|
|
7816
|
+
required: false
|
|
7817
|
+
},
|
|
7818
|
+
message: {
|
|
7819
|
+
type: String,
|
|
7820
|
+
default: '',
|
|
7821
|
+
required: false
|
|
7822
|
+
},
|
|
7823
|
+
messageType: {
|
|
7824
|
+
type: [Number, String],
|
|
7825
|
+
default: 1,
|
|
7826
|
+
required: false
|
|
7827
|
+
}
|
|
7828
|
+
},
|
|
7829
|
+
data: function data() {
|
|
7830
|
+
return {
|
|
7831
|
+
placement: "top",
|
|
7832
|
+
formatted_messages_1: [{
|
|
7833
|
+
cod: "T",
|
|
7834
|
+
value: "Todos"
|
|
7835
|
+
}],
|
|
7836
|
+
key_1: "T",
|
|
7837
|
+
formatted_messages_2: [],
|
|
7838
|
+
key_2: "",
|
|
7839
|
+
formatted_messages_3: [],
|
|
7840
|
+
key_3: "",
|
|
7841
|
+
loadingReq: false
|
|
7842
|
+
};
|
|
7843
|
+
},
|
|
7844
|
+
mounted: function mounted() {
|
|
7845
|
+
this.receiveValueFormattedMessage(this.key_1, 2);
|
|
7846
|
+
},
|
|
7847
|
+
methods: {
|
|
7848
|
+
calculateSelectPosition: function calculateSelectPosition(dropdownList, component, sizes) {
|
|
7849
|
+
dropdownList.style.width = sizes.width;
|
|
7850
|
+
var popper = createPopper(component.$refs.toggle, dropdownList, {
|
|
7851
|
+
placement: this.placement
|
|
7852
|
+
});
|
|
7853
|
+
return function () {
|
|
7854
|
+
return popper.destroy();
|
|
7855
|
+
};
|
|
7856
|
+
},
|
|
7857
|
+
inputSelectKey1: function inputSelectKey1() {
|
|
7858
|
+
if (!this.key_1) {
|
|
7859
|
+
if (this.formatted_messages_2.length) this.formatted_messages_2 = [];
|
|
7860
|
+
if (this.key_2) this.key_2 = "";
|
|
7861
|
+
return;
|
|
7862
|
+
}
|
|
7863
|
+
|
|
7864
|
+
this.receiveValueFormattedMessage(this.key_1, 2);
|
|
7865
|
+
},
|
|
7866
|
+
inputSelectKey2: function inputSelectKey2() {
|
|
7867
|
+
if (!this.key_2) {
|
|
7868
|
+
if (this.formatted_messages_3.length) this.formatted_messages_3 = [];
|
|
7869
|
+
if (this.key_3) this.key_3 = "";
|
|
7870
|
+
return;
|
|
7871
|
+
}
|
|
7872
|
+
|
|
7873
|
+
if (this.formatted_messages_3.length) this.formatted_messages_3 = [];
|
|
7874
|
+
if (this.key_3) this.key_3 = "";
|
|
7875
|
+
this.receiveValueFormattedMessage("T/".concat(this.key_2), 3);
|
|
7876
|
+
},
|
|
7877
|
+
receiveValueFormattedMessage: function receiveValueFormattedMessage(cod, selectionIndex) {
|
|
7878
|
+
var _this = this;
|
|
7879
|
+
|
|
7880
|
+
try {
|
|
7881
|
+
if (!this.token_cliente) throw new Error("Informe token_cliente como chave na propriedade formattedMessageSettings que ocorre na chamada componente TextFooter ");
|
|
7882
|
+
this.loadingReq = true;
|
|
7883
|
+
this.getStandardMessages(cod, this.token_cliente).then(function (data) {
|
|
7884
|
+
_this.loadingReq = false;
|
|
7885
|
+
if (data && typeof data == 'string') return _this.$toasted.global.emConstrucao({
|
|
7886
|
+
msg: data
|
|
7887
|
+
});
|
|
7888
|
+
if (data) return _this.showFormattedMessage(data, selectionIndex);
|
|
7889
|
+
|
|
7890
|
+
_this.$toasted.global.defaultError();
|
|
7891
|
+
}).catch(function (e) {
|
|
7892
|
+
_this.loadingReq = false;
|
|
7893
|
+
console.error("Error in getStandardMessages: ", e);
|
|
7894
|
+
});
|
|
7895
|
+
} catch (e) {
|
|
7896
|
+
this.loadingReq = false;
|
|
7897
|
+
console.error("Error in receiveValueFormattedMessage: ", e);
|
|
7898
|
+
}
|
|
7899
|
+
},
|
|
7900
|
+
showFormattedMessage: function showFormattedMessage(messageData, selectionIndex) {
|
|
7901
|
+
try {
|
|
7902
|
+
var success = false;
|
|
7903
|
+
if (Array.isArray(messageData)) success = true;
|
|
7904
|
+
if (!success) this.$toasted.global.emConstrucao({
|
|
7905
|
+
msg: messageData ? messageData.msg : "Nao foi possível obter mensagens"
|
|
7906
|
+
});
|
|
7907
|
+
|
|
7908
|
+
switch (selectionIndex) {
|
|
7909
|
+
case 2:
|
|
7910
|
+
if (!success) {
|
|
7911
|
+
this.formatted_messages_2.push(messageData);
|
|
7912
|
+
this.key_2 = this.formatted_messages_2[0];
|
|
7913
|
+
} else {
|
|
7914
|
+
this.formatted_messages_2 = messageData;
|
|
7915
|
+
|
|
7916
|
+
if (this.formatted_messages_2.length == 1) {
|
|
7917
|
+
if (this.formatted_messages_2[0].cod) {
|
|
7918
|
+
this.key_2 = this.formatted_messages_2[0].cod;
|
|
7919
|
+
this.receiveValueFormattedMessage("T/".concat(this.key_2), 3);
|
|
7920
|
+
}
|
|
7921
|
+
}
|
|
7922
|
+
}
|
|
7923
|
+
|
|
7924
|
+
break;
|
|
7925
|
+
|
|
7926
|
+
case 3:
|
|
7927
|
+
if (!success) {
|
|
7928
|
+
this.formatted_messages_3.push(messageData);
|
|
7929
|
+
this.$toasted.global.emConstrucao({
|
|
7930
|
+
msg: this.dictionary.msg_erro_sem_msg_formatada
|
|
7931
|
+
});
|
|
7932
|
+
this.$emit("close-blocker-standard-message");
|
|
7933
|
+
} else {
|
|
7934
|
+
if (!messageData.length) {
|
|
7935
|
+
this.formatted_messages_3.push(this.dictionary.msg_erro_sem_msg_formatada);
|
|
7936
|
+
this.key_3 = this.formatted_messages_3[0];
|
|
7937
|
+
} else {
|
|
7938
|
+
this.formatted_messages_3 = messageData;
|
|
7939
|
+
|
|
7940
|
+
if (this.formatted_messages_3.length == 1) {
|
|
7941
|
+
if (this.formatted_messages_3[0].cod) {
|
|
7942
|
+
this.key_3 = this.formatted_messages_3[0];
|
|
7943
|
+
}
|
|
7944
|
+
}
|
|
7945
|
+
}
|
|
7946
|
+
}
|
|
7947
|
+
|
|
7948
|
+
break;
|
|
7949
|
+
|
|
7950
|
+
default:
|
|
7951
|
+
console.error("Error in showFormattedMessage: selectionIndex not found");
|
|
7952
|
+
break;
|
|
7953
|
+
}
|
|
7954
|
+
} catch (e) {
|
|
7955
|
+
console.error("Error in showFormattedMessage: ", e);
|
|
7956
|
+
}
|
|
7957
|
+
},
|
|
7958
|
+
openMsg: function openMsg() {
|
|
7959
|
+
try {
|
|
7960
|
+
this.messageType == 1 ? this.insertFormattedMessage(this.key_3) : this.openFormattedMsgType2(this.key_3);
|
|
7961
|
+
} catch (e) {
|
|
7962
|
+
console.error("Error in openMsg: ", e);
|
|
7963
|
+
}
|
|
7964
|
+
},
|
|
7965
|
+
openFormattedMsgType2: function openFormattedMsgType2(key) {
|
|
7966
|
+
try {
|
|
7967
|
+
if (!key || !this.key_2) return;
|
|
7968
|
+
this.$emit("open-blocker-standard-message");
|
|
7969
|
+
key = key.cod;
|
|
7970
|
+
this.$emit("set-standard-infos", {
|
|
4134
7971
|
category: this.key_2,
|
|
4135
7972
|
subject: key
|
|
4136
7973
|
});
|
|
@@ -4194,7 +8031,12 @@ var __vue_render__$g = function __vue_render__() {
|
|
|
4194
8031
|
"slot": "no-options"
|
|
4195
8032
|
},
|
|
4196
8033
|
slot: "no-options"
|
|
4197
|
-
}, [_vm._v(" " + _vm._s(_vm.dictionary.msg_sem_resultados) + " ")])]), _vm._ssrNode(" "), _vm.
|
|
8034
|
+
}, [_vm._v(" " + _vm._s(_vm.dictionary.msg_sem_resultados) + " ")])]), _vm._ssrNode(" "), _vm._ssrNode("<div class=\"transition-selects\">", "</div>", [_c('transition', {
|
|
8035
|
+
attrs: {
|
|
8036
|
+
"name": "fade",
|
|
8037
|
+
"mode": "out-in"
|
|
8038
|
+
}
|
|
8039
|
+
}, [_vm.formatted_messages_2.length && _vm.key_1 ? _c('div', [_c('v-select', {
|
|
4198
8040
|
staticClass: "text-footer-v-select",
|
|
4199
8041
|
style: "background-color: " + _vm.backgroundColor,
|
|
4200
8042
|
attrs: {
|
|
@@ -4221,7 +8063,16 @@ var __vue_render__$g = function __vue_render__() {
|
|
|
4221
8063
|
"slot": "no-options"
|
|
4222
8064
|
},
|
|
4223
8065
|
slot: "no-options"
|
|
4224
|
-
}, [_vm._v(" " + _vm._s(_vm.dictionary.msg_sem_resultados) + " ")])])
|
|
8066
|
+
}, [_vm._v(" " + _vm._s(_vm.dictionary.msg_sem_resultados) + " ")])])], 1) : _vm.key_1 && _vm.loadingReq ? _c('div', {
|
|
8067
|
+
staticClass: "loader-select"
|
|
8068
|
+
}, [_c('VueLoader')], 1) : _vm._e()]), _vm._ssrNode(" "), _c('transition', {
|
|
8069
|
+
attrs: {
|
|
8070
|
+
"name": "fade",
|
|
8071
|
+
"mode": "out-in"
|
|
8072
|
+
}
|
|
8073
|
+
}, [_vm.formatted_messages_3.length && _vm.key_2 ? _c('div', {
|
|
8074
|
+
staticClass: "text-footer-select-03"
|
|
8075
|
+
}, [_c('v-select', {
|
|
4225
8076
|
staticClass: "text-footer-v-select",
|
|
4226
8077
|
style: "background-color: " + _vm.backgroundColor,
|
|
4227
8078
|
attrs: {
|
|
@@ -4248,40 +8099,66 @@ var __vue_render__$g = function __vue_render__() {
|
|
|
4248
8099
|
"slot": "no-options"
|
|
4249
8100
|
},
|
|
4250
8101
|
slot: "no-options"
|
|
4251
|
-
}, [_vm._v(" " + _vm._s(_vm.dictionary.msg_sem_resultados) + " ")])]), _vm.
|
|
8102
|
+
}, [_vm._v(" " + _vm._s(_vm.dictionary.msg_sem_resultados) + " ")])]), _vm._v(" "), _vm.key_3.cod ? [_vm.messageType == 1 ? _c('span', {
|
|
8103
|
+
staticClass: "text-footer--btn-select-03",
|
|
8104
|
+
attrs: {
|
|
8105
|
+
"title": _vm.dictionary.title_btn_preencher_msg_formatada
|
|
8106
|
+
},
|
|
8107
|
+
on: {
|
|
8108
|
+
"click": function click($event) {
|
|
8109
|
+
return _vm.insertFormattedMessage(_vm.key_3);
|
|
8110
|
+
}
|
|
8111
|
+
}
|
|
8112
|
+
}, [_c('fa-icon', {
|
|
4252
8113
|
attrs: {
|
|
4253
8114
|
"icon": ['fas', 'level-up-alt']
|
|
4254
8115
|
}
|
|
4255
|
-
})], 1) : _vm.messageType == 2 ?
|
|
8116
|
+
})], 1) : _vm.messageType == 2 ? _c('span', {
|
|
8117
|
+
staticClass: "text-footer--btn-select-03",
|
|
8118
|
+
attrs: {
|
|
8119
|
+
"title": _vm.dictionary.title_btn_abrir_msg_tipo_2
|
|
8120
|
+
},
|
|
8121
|
+
on: {
|
|
8122
|
+
"click": function click($event) {
|
|
8123
|
+
return _vm.openFormattedMsgType2(_vm.key_3);
|
|
8124
|
+
}
|
|
8125
|
+
}
|
|
8126
|
+
}, [_c('fa-icon', {
|
|
4256
8127
|
attrs: {
|
|
4257
8128
|
"icon": ['fas', 'file-alt']
|
|
4258
8129
|
}
|
|
4259
|
-
})], 1) : _vm._e()] : _vm._e()], 2) : _vm.
|
|
8130
|
+
})], 1) : _vm._e()] : _vm._e()], 2) : _vm.key_2 && _vm.loadingReq ? _c('div', {
|
|
8131
|
+
staticClass: "loader-select"
|
|
8132
|
+
}, [_c('VueLoader')], 1) : _vm._e()])], 2)], 2);
|
|
4260
8133
|
};
|
|
4261
8134
|
|
|
4262
8135
|
var __vue_staticRenderFns__$g = [];
|
|
4263
8136
|
/* style */
|
|
4264
8137
|
|
|
4265
|
-
var __vue_inject_styles__$g =
|
|
8138
|
+
var __vue_inject_styles__$g = function __vue_inject_styles__(inject) {
|
|
8139
|
+
if (!inject) return;
|
|
8140
|
+
inject("data-v-9fe38344_0", {
|
|
8141
|
+
source: ".transition-selects{min-height:80px;display:flex;flex-direction:column;width:100%}.loader-select{position:relative;min-height:35px;background:#fff;width:100%;border:1px solid #ccc;border-radius:5px;z-index:1}",
|
|
8142
|
+
map: undefined,
|
|
8143
|
+
media: undefined
|
|
8144
|
+
});
|
|
8145
|
+
};
|
|
4266
8146
|
/* scoped */
|
|
4267
8147
|
|
|
8148
|
+
|
|
4268
8149
|
var __vue_scope_id__$g = undefined;
|
|
4269
8150
|
/* module identifier */
|
|
4270
8151
|
|
|
4271
|
-
var __vue_module_identifier__$g = "data-v-
|
|
8152
|
+
var __vue_module_identifier__$g = "data-v-9fe38344";
|
|
4272
8153
|
/* functional template */
|
|
4273
8154
|
|
|
4274
8155
|
var __vue_is_functional_template__$g = false;
|
|
4275
|
-
/* style inject */
|
|
4276
|
-
|
|
4277
|
-
/* style inject SSR */
|
|
4278
|
-
|
|
4279
8156
|
/* style inject shadow dom */
|
|
4280
8157
|
|
|
4281
8158
|
var __vue_component__$n = /*#__PURE__*/normalizeComponent({
|
|
4282
8159
|
render: __vue_render__$g,
|
|
4283
8160
|
staticRenderFns: __vue_staticRenderFns__$g
|
|
4284
|
-
}, __vue_inject_styles__$g, __vue_script__$g, __vue_scope_id__$g, __vue_is_functional_template__$g, __vue_module_identifier__$g, false, undefined,
|
|
8161
|
+
}, __vue_inject_styles__$g, __vue_script__$g, __vue_scope_id__$g, __vue_is_functional_template__$g, __vue_module_identifier__$g, false, undefined, createInjectorSSR, undefined);
|
|
4285
8162
|
|
|
4286
8163
|
var StandardMessages = __vue_component__$n;//
|
|
4287
8164
|
var script$f = {
|
|
@@ -4571,8 +8448,8 @@ var script$f = {
|
|
|
4571
8448
|
openImage: function openImage(imagePreview) {
|
|
4572
8449
|
this.$emit("open-image", imagePreview);
|
|
4573
8450
|
},
|
|
4574
|
-
openFileSystem: function openFileSystem(
|
|
4575
|
-
this.$emit("open-file-system"
|
|
8451
|
+
openFileSystem: function openFileSystem() {
|
|
8452
|
+
this.$emit("open-file-system");
|
|
4576
8453
|
},
|
|
4577
8454
|
setAudio: function setAudio(audioObj) {
|
|
4578
8455
|
var audioFile = audioObj.audioFile,
|
|
@@ -4859,7 +8736,7 @@ var __vue_staticRenderFns__$f = [];
|
|
|
4859
8736
|
|
|
4860
8737
|
var __vue_inject_styles__$f = function __vue_inject_styles__(inject) {
|
|
4861
8738
|
if (!inject) return;
|
|
4862
|
-
inject("data-v-
|
|
8739
|
+
inject("data-v-26af6246_0", {
|
|
4863
8740
|
source: ".toasted svg{margin-right:10px}.d-none{display:none}ul{list-style-type:none}.text-footer-container{display:flex;justify-content:center;align-items:center;flex-direction:column;width:100%;position:relative}.text-footer-container .text-footer{min-height:48px;box-shadow:0 3px 7px -2px rgba(0,0,0,.45);position:relative;display:flex;justify-content:center;align-items:center;border:1px solid #ccc;padding:5px 2px 5px 5px;border-radius:5px}.text-footer-container .text-footer.full{width:100%}.text-footer-container .text-footer.almostFull{width:95%}.text-footer-container .text-footer.medium{width:75%}.text-footer-container.bigger .text-footer{height:80px}.text-footer-container.bigger .text-footer>textarea{font-size:.875rem;height:75px;max-height:75px;min-height:75px}.text-footer-container textarea{margin:0 5px;border:unset;flex:1;resize:none;min-height:30px;max-height:60px;font-size:.875rem;font-family:inherit;background:inherit}.text-footer-container textarea:focus{outline:unset}.text-footer-container textarea::placeholder{font-size:.75rem}.text-footer-container .text-footer-audio{flex:1;display:flex;justify-content:center;align-items:center}.text-footer-container audio{flex:1;outline:unset;width:auto;height:38px}.text-footer-container .delete-audio{display:flex;justify-content:center;align-items:center;color:#e74c3c;transition:background .3s;border-radius:50%;font-size:1rem;padding:10px;cursor:pointer;margin:0 5px;width:31px;height:31px}.text-footer-container .delete-audio:hover{background-color:rgba(208,0,0,.2)}.text-footer-container .max-characters{font-size:.575rem;z-index:1;color:#444;position:relative;top:30px;left:-30px}.text-footer-container .max-characters.no-width{width:0}.text-footer-container .text-footer-actions{display:flex}.text-footer-container .text-footer-actions.outside-buttons{display:flex;align-items:center;justify-content:flex-end;position:absolute;top:-42px;right:2px;background-color:#ddd;box-shadow:inset 0 -10px 5px -11px rgba(0,0,0,.5)}.text-footer-container .text-footer-actions .text-footer-actions--btn{display:flex;justify-content:center;align-items:center;color:#777;border-radius:50%;transition:background .3s;padding:10px;font-size:1rem;width:36px;height:36px;cursor:pointer;margin-right:2.5px}.text-footer-container .text-footer-actions .text-footer-actions--btn:last-child{margin-right:unset}.text-footer-container .text-footer-actions .text-footer-actions--btn:hover{background-color:rgba(0,0,0,.1)}.text-footer-container .text-footer-actions .text-footer-actions--btn.files-activated{background-color:rgba(0,0,0,.1)}.text-footer-container .text-footer-actions .text-footer-actions--btn.audio-activated{background-color:rgba(208,0,0,.7);color:#fff}.text-footer-container .text-footer-actions .text-footer-actions--btn.left-button{position:absolute;left:0}.text-footer-container .text-footer-hsm-container{margin:12px 0 7px 0}.text-footer-container .text-footer-hsm-container.full{width:100%}.text-footer-container .text-footer-hsm-container.almostFull{width:95%}.text-footer-container .text-footer-hsm-container.medium{width:75%}.text-footer-container .text-footer-hsm-container .text-footer-v-select{border-radius:5px;margin-bottom:5px}.text-footer-container .text-footer-hsm-container .text-footer-select-03{display:flex;align-items:center;flex:1;width:100%}.text-footer-container .text-footer-hsm-container .text-footer-select-03 .text-footer-v-select{flex:1}.text-footer-container .text-footer-hsm-container .text-footer-select-03 .text-footer--btn-select-03{transition-duration:.3s;user-select:none;cursor:pointer;box-shadow:inset 0 -3px rgba(0,0,0,.2);opacity:.9;border-radius:2.5px;display:flex;justify-content:center;align-items:center;margin-left:5px;margin-bottom:5px;background-color:#f7fe72;width:32px;height:32px}.text-footer-container .text-footer-hsm-container .text-footer-select-03 .text-footer--btn-select-03:hover{opacity:1}.text-footer-container .text-footer-hsm-container .text-footer-select-03 .text-footer--btn-select-03:active{opacity:1;box-shadow:inset 0 -1px rgba(0,0,0,.2);-webkit-transform:translateY(1px);-moz-transform:translateY(1px);-o-transform:translateY(1px);-ms-transform:translateY(1px);transform:translateY(1px)}.text-footer-container .text-footer-hsm-container .text-footer-select-03 .text-footer--btn-select-03 svg{font-size:1rem}.text-footer-container .text-footer-files-container{position:absolute;right:0;top:-55px;padding:5px;background-color:rgba(0,0,0,.4);border-radius:5px;display:flex;align-items:center;justify-content:space-between;z-index:1}.text-footer-container .text-footer-files-container.horizontal{right:-55px;flex-direction:column}.text-footer-container .text-footer-files-container .files-btn{transition-duration:.3s;transition-property:opacity;opacity:.8;cursor:pointer;display:flex;justify-content:center;align-items:center;border-radius:10px;padding:3px;width:40px;height:40px;font-size:1rem;color:#fff}.text-footer-container .text-footer-files-container .files-btn:hover{opacity:1}.text-footer-container .text-footer-files-container .files-btn svg{color:#fff}.text-footer-container .text-footer-files-container .files-btn.images{background-color:#9575cd;margin-right:5px}.text-footer-container .text-footer-files-container .files-btn.images.margin-bottom{margin-right:unset;margin-bottom:5px}.text-footer-container .text-footer-files-container .files-btn.docs{background-color:#7986cb;margin-right:5px}.text-footer-container .text-footer-files-container .files-btn.system{background-color:#49a349}.text-footer-container .text-footer-preview-container{cursor:default;position:absolute;left:0;background-color:#f1f1f1;border:2px solid #ccc;border-bottom:unset;border-top-left-radius:2.5px;border-top-right-radius:2.5px}.text-footer-container .text-footer-preview-container.isDoc{top:-50px;width:100%;height:45px}.text-footer-container .text-footer-preview-container.isImg,.text-footer-container .text-footer-preview-container.isMultiple{top:-205px;width:100%;height:200px}.text-footer-container .text-footer-preview-container.isImg .text-footer-image-preview{height:170px}.text-footer-container .text-footer-preview-container.isError{top:-80px;width:100%;height:75px}.text-footer-container .text-footer-alt{margin-top:-12px;width:100%;padding:0 10px}.text-footer-container .text-footer-alt .text-footer-out-session{margin-top:12px}.text-footer-container .text-footer-alt .text-footer-sem-24h{font-size:.8rem;text-align:right;font-weight:600;letter-spacing:-.5px;color:#dd7f0c;margin-top:5px;position:absolute;right:0}.text-footer-container .text-footer-alt .sem-templates{margin-top:10px;font-size:.8rem;text-align:right;font-weight:600;letter-spacing:-.5px;color:#921e12}.text-footer-container .text-footer-alt .text-footer-templates{position:relative;width:100%}.text-footer-container .text-footer-alt .text-footer-templates .text-footer-group-selection{width:100%;display:flex;align-items:center}.text-footer-container .text-footer-alt .text-footer-templates .text-footer-group-selection h4{margin-right:5px}.text-footer-container .text-footer-alt .text-footer-templates .text-footer-group-selection .sm__select{flex:1}.vs__dropdown-menu{font-size:.85rem!important}.emoji-mart-anchor,.emoji-mart-emoji span{cursor:pointer!important}.emoji-mart{z-index:2!important}.emoji-mart-scroll{overflow-x:hidden}",
|
|
4864
8741
|
map: undefined,
|
|
4865
8742
|
media: undefined
|
|
@@ -4871,7 +8748,7 @@ var __vue_inject_styles__$f = function __vue_inject_styles__(inject) {
|
|
|
4871
8748
|
var __vue_scope_id__$f = undefined;
|
|
4872
8749
|
/* module identifier */
|
|
4873
8750
|
|
|
4874
|
-
var __vue_module_identifier__$f = "data-v-
|
|
8751
|
+
var __vue_module_identifier__$f = "data-v-26af6246";
|
|
4875
8752
|
/* functional template */
|
|
4876
8753
|
|
|
4877
8754
|
var __vue_is_functional_template__$f = false;
|