@carbon/charts-vue 1.2.1 → 1.3.2

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.
@@ -11254,8 +11254,8 @@ Selection.prototype = selection_selection.prototype = {
11254
11254
  // EXTERNAL MODULE: /home/runner/work/carbon-charts/carbon-charts/node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js
11255
11255
  var ResizeObserver_es = __webpack_require__("2da1");
11256
11256
 
11257
- // EXTERNAL MODULE: /home/runner/work/carbon-charts/carbon-charts/node_modules/dom-to-image/src/dom-to-image.js
11258
- var dom_to_image = __webpack_require__("eeea");
11257
+ // EXTERNAL MODULE: ./node_modules/@carbon/charts/services/essentials/dom-to-image.js
11258
+ var dom_to_image = __webpack_require__("b1b0");
11259
11259
  var dom_to_image_default = /*#__PURE__*/__webpack_require__.n(dom_to_image);
11260
11260
 
11261
11261
  // CONCATENATED MODULE: ./node_modules/@carbon/charts/services/essentials/dom-utils.js
@@ -25760,6 +25760,8 @@ var bar_grouped_GroupedBar = /** @class */ (function (_super) {
25760
25760
  _this.type = 'grouped-bar';
25761
25761
  _this.renderType = RenderTypes.SVG;
25762
25762
  _this.padding = 5;
25763
+ // A factor to normalize padding between bars regardless of bar group density.
25764
+ _this.defaultStepFactor = 70;
25763
25765
  // Highlight elements that match the hovered legend item
25764
25766
  _this.handleLegendOnHover = function (event) {
25765
25767
  var hoveredElement = event.detail.hoveredElement;
@@ -25879,7 +25881,7 @@ var bar_grouped_GroupedBar = /** @class */ (function (_super) {
25879
25881
  });
25880
25882
  })
25881
25883
  .style('fill', function (d) { return _this.model.getFillColor(d[groupMapsTo]); })
25882
- .attr('d', function (d) {
25884
+ .attr('d', function (d, i) {
25883
25885
  /*
25884
25886
  * Orientation support for horizontal/vertical bar charts
25885
25887
  * Determine coordinates needed for a vertical set of paths
@@ -25893,8 +25895,11 @@ var bar_grouped_GroupedBar = /** @class */ (function (_super) {
25893
25895
  var rangeAxis = _this.services.cartesianScales.getRangeAxisPosition({ datum: d });
25894
25896
  var y0 = _this.services.cartesianScales.getValueThroughAxisPosition(rangeAxis, 0);
25895
25897
  var y1 = _this.services.cartesianScales.getRangeValue(d);
25896
- // don't show if part of bar is out of zoom domain
25897
- if (_this.isOutsideZoomedDomain(x0, x1)) {
25898
+ // don't show if part of bar is out of zoom domain - test zoom on bar pos, not group
25899
+ var zoomx0 = _this.services.cartesianScales.getDomainValue(d, i) -
25900
+ barWidth / 2;
25901
+ var zoomx1 = zoomx0 + barWidth;
25902
+ if (_this.isOutsideZoomedDomain(zoomx0, zoomx1)) {
25898
25903
  return;
25899
25904
  }
25900
25905
  return tools_Tools.generateSVGPathString({ x0: x0, x1: x1, y0: y0, y1: y1 }, _this.services.cartesianScales.getOrientation());
@@ -25979,7 +25984,7 @@ var bar_grouped_GroupedBar = /** @class */ (function (_super) {
25979
25984
  var displayData = this.model.getDisplayData(this.configs.groups);
25980
25985
  return displayData.filter(function (datum) {
25981
25986
  var domainIdentifier = _this.services.cartesianScales.getDomainIdentifier(datum);
25982
- return datum[domainIdentifier] === label;
25987
+ return datum[domainIdentifier].toString() === label;
25983
25988
  });
25984
25989
  };
25985
25990
  GroupedBar.prototype.getGroupWidth = function () {
@@ -25987,13 +25992,29 @@ var bar_grouped_GroupedBar = /** @class */ (function (_super) {
25987
25992
  var totalGroupPadding = this.getTotalGroupPadding();
25988
25993
  return this.getBarWidth() * activeData.length + totalGroupPadding;
25989
25994
  };
25995
+ GroupedBar.prototype.getDomainScaleStep = function () {
25996
+ var domainScale = this.services.cartesianScales.getDomainScale();
25997
+ var activeData = this.model.getGroupedData(this.configs.groups);
25998
+ var step = this.defaultStepFactor;
25999
+ if (typeof domainScale.step === 'function') {
26000
+ step = domainScale.step();
26001
+ }
26002
+ else if (activeData.length > 0) {
26003
+ // as a fallback use distance between first bars of adjacent bar groups
26004
+ var ref = activeData.find(function (d) { var _a; return ((_a = d.data) === null || _a === void 0 ? void 0 : _a.length) > 1; });
26005
+ if (ref) {
26006
+ var domainIdentifier = this.services.cartesianScales.getDomainIdentifier(ref.data[0]);
26007
+ step = Math.abs(domainScale(ref.data[1][domainIdentifier]) - domainScale(ref.data[0][domainIdentifier]));
26008
+ }
26009
+ }
26010
+ return step;
26011
+ };
25990
26012
  GroupedBar.prototype.getTotalGroupPadding = function () {
25991
26013
  var activeData = this.model.getGroupedData(this.configs.groups);
25992
26014
  if (activeData.length === 1) {
25993
26015
  return 0;
25994
26016
  }
25995
- var domainScale = this.services.cartesianScales.getDomainScale();
25996
- var padding = Math.min(5, 5 * (domainScale.step() / 70));
26017
+ var padding = Math.min(5, 5 * (this.getDomainScaleStep() / this.defaultStepFactor));
25997
26018
  return padding * (activeData.length - 1);
25998
26019
  };
25999
26020
  // Gets the correct width for bars based on options & configurations
@@ -26012,8 +26033,7 @@ var bar_grouped_GroupedBar = /** @class */ (function (_super) {
26012
26033
  var activeData = this.model.getGroupedData(this.configs.groups);
26013
26034
  var numOfActiveDataGroups = activeData.length;
26014
26035
  var totalGroupPadding = this.getTotalGroupPadding();
26015
- var domainScale = this.services.cartesianScales.getDomainScale();
26016
- return Math.min(providedMaxWidth, (domainScale.step() - totalGroupPadding) / numOfActiveDataGroups);
26036
+ return Math.min(providedMaxWidth, (this.getDomainScaleStep() - totalGroupPadding) / numOfActiveDataGroups);
26017
26037
  };
26018
26038
  GroupedBar.prototype.setGroupScale = function () {
26019
26039
  var activeData = this.model.getActiveDataGroupNames(this.configs.groups);
@@ -36258,6 +36278,8 @@ var axis_Axis = /** @class */ (function (_super) {
36258
36278
  }
36259
36279
  lastStartPosition_1 = xTransformation;
36260
36280
  });
36281
+ // Cleanup mock text piece
36282
+ mockTextPiece.remove();
36261
36283
  }
36262
36284
  }
36263
36285
  if (shouldRotateTicks_1) {
@@ -49416,436 +49438,1162 @@ module.exports = [
49416
49438
 
49417
49439
  /***/ }),
49418
49440
 
49419
- /***/ "b489":
49441
+ /***/ "b1b0":
49420
49442
  /***/ (function(module, exports, __webpack_require__) {
49421
49443
 
49422
- "use strict";
49423
-
49444
+ /**
49445
+ The MIT License (MIT)
49424
49446
 
49425
- Object.defineProperty(exports, "__esModule", {
49426
- value: true
49427
- });
49428
- exports.default = buildLocalizeFn;
49447
+ Copyright 2015 Anatolii Saienko
49448
+ https://github.com/tsayen
49429
49449
 
49430
- function buildLocalizeFn(args) {
49431
- return function (dirtyIndex, dirtyOptions) {
49432
- var options = dirtyOptions || {};
49433
- var context = options.context ? String(options.context) : 'standalone';
49434
- var valuesArray;
49450
+ Copyright 2012 Paul Bakaus
49451
+ http://paulbakaus.com/
49435
49452
 
49436
- if (context === 'formatting' && args.formattingValues) {
49437
- var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
49438
- var width = options.width ? String(options.width) : defaultWidth;
49439
- valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
49440
- } else {
49441
- var _defaultWidth = args.defaultWidth;
49453
+ Permission is hereby granted, free of charge, to any person obtaining
49454
+ a copy of this software and associated documentation files (the
49455
+ "Software"), to deal in the Software without restriction, including
49456
+ without limitation the rights to use, copy, modify, merge, publish,
49457
+ distribute, sublicense, and/or sell copies of the Software, and to
49458
+ permit persons to whom the Software is furnished to do so, subject to
49459
+ the following conditions:
49442
49460
 
49443
- var _width = options.width ? String(options.width) : args.defaultWidth;
49461
+ The above copyright notice and this permission notice shall be
49462
+ included in all copies or substantial portions of the Software.
49444
49463
 
49445
- valuesArray = args.values[_width] || args.values[_defaultWidth];
49464
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
49465
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
49466
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
49467
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
49468
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
49469
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
49470
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
49471
+ */
49472
+ (function (global) {
49473
+ 'use strict';
49474
+ var util = newUtil();
49475
+ var inliner = newInliner();
49476
+ var fontFaces = newFontFaces();
49477
+ var images = newImages();
49478
+ // Default impl options
49479
+ var defaultOptions = {
49480
+ // Default is to fail on error, no placeholder
49481
+ imagePlaceholder: undefined,
49482
+ // Default cache bust is false, it will use the cache
49483
+ cacheBust: false,
49484
+ };
49485
+ var domtoimage = {
49486
+ toSvg: toSvg,
49487
+ toPng: toPng,
49488
+ toJpeg: toJpeg,
49489
+ toBlob: toBlob,
49490
+ toPixelData: toPixelData,
49491
+ impl: {
49492
+ fontFaces: fontFaces,
49493
+ images: images,
49494
+ util: util,
49495
+ inliner: inliner,
49496
+ options: {},
49497
+ },
49498
+ };
49499
+ if (true)
49500
+ module.exports = domtoimage;
49501
+ else
49502
+ {}
49503
+ /**
49504
+ * @param {Node} node - The DOM Node object to render
49505
+ * @param {Object} options - Rendering options
49506
+ * @param {Function} options.filter - Should return true if passed node should be included in the output
49507
+ * (excluding node means excluding it's children as well). Not called on the root node.
49508
+ * @param {String} options.bgcolor - color for the background, any valid CSS color value.
49509
+ * @param {Number} options.width - width to be applied to node before rendering.
49510
+ * @param {Number} options.height - height to be applied to node before rendering.
49511
+ * @param {Object} options.style - an object whose properties to be copied to node's style before rendering.
49512
+ * @param {Number} options.quality - a Number between 0 and 1 indicating image quality (applicable to JPEG only),
49513
+ defaults to 1.0.
49514
+ * @param {String} options.imagePlaceholder - dataURL to use as a placeholder for failed images, default behaviour is to fail fast on images we can't fetch
49515
+ * @param {Boolean} options.cacheBust - set to true to cache bust by appending the time to the request url
49516
+ * @return {Promise} - A promise that is fulfilled with a SVG image data URL
49517
+ * */
49518
+ function toSvg(node, options) {
49519
+ options = options || {};
49520
+ copyOptions(options);
49521
+ return Promise.resolve(node)
49522
+ .then(function (node) {
49523
+ return cloneNode(node, options.filter, true);
49524
+ })
49525
+ .then(embedFonts)
49526
+ .then(inlineImages)
49527
+ .then(applyOptions)
49528
+ .then(function (clone) {
49529
+ return makeSvgDataUri(clone, options.width || util.width(node), options.height || util.height(node));
49530
+ });
49531
+ function applyOptions(clone) {
49532
+ if (options.bgcolor)
49533
+ clone.style.backgroundColor = options.bgcolor;
49534
+ if (options.width)
49535
+ clone.style.width = options.width + 'px';
49536
+ if (options.height)
49537
+ clone.style.height = options.height + 'px';
49538
+ if (options.style)
49539
+ Object.keys(options.style).forEach(function (property) {
49540
+ clone.style[property] = options.style[property];
49541
+ });
49542
+ return clone;
49543
+ }
49446
49544
  }
49447
-
49448
- var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex;
49449
- return valuesArray[index];
49450
- };
49451
- }
49452
-
49453
- module.exports = exports.default;
49454
-
49455
- /***/ }),
49456
-
49457
- /***/ "b495":
49458
- /***/ (function(module, exports, __webpack_require__) {
49459
-
49460
- var toInteger = __webpack_require__("8bb2");
49461
-
49462
- var min = Math.min;
49463
-
49464
- // `ToLength` abstract operation
49465
- // https://tc39.github.io/ecma262/#sec-tolength
49466
- module.exports = function (argument) {
49467
- return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
49468
- };
49469
-
49470
-
49471
- /***/ }),
49472
-
49473
- /***/ "b634":
49474
- /***/ (function(module, exports, __webpack_require__) {
49475
-
49476
- var has = __webpack_require__("f1a7");
49477
- var ownKeys = __webpack_require__("a03e");
49478
- var getOwnPropertyDescriptorModule = __webpack_require__("185a");
49479
- var definePropertyModule = __webpack_require__("abdf");
49480
-
49481
- module.exports = function (target, source) {
49482
- var keys = ownKeys(source);
49483
- var defineProperty = definePropertyModule.f;
49484
- var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
49485
- for (var i = 0; i < keys.length; i++) {
49486
- var key = keys[i];
49487
- if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
49488
- }
49489
- };
49490
-
49491
-
49492
- /***/ }),
49493
-
49494
- /***/ "b7fb":
49495
- /***/ (function(module, exports, __webpack_require__) {
49496
-
49497
- var toInteger = __webpack_require__("8bb2");
49498
- var requireObjectCoercible = __webpack_require__("730c");
49499
-
49500
- // `String.prototype.{ codePointAt, at }` methods implementation
49501
- var createMethod = function (CONVERT_TO_STRING) {
49502
- return function ($this, pos) {
49503
- var S = String(requireObjectCoercible($this));
49504
- var position = toInteger(pos);
49505
- var size = S.length;
49506
- var first, second;
49507
- if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
49508
- first = S.charCodeAt(position);
49509
- return first < 0xD800 || first > 0xDBFF || position + 1 === size
49510
- || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF
49511
- ? CONVERT_TO_STRING ? S.charAt(position) : first
49512
- : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
49513
- };
49514
- };
49515
-
49516
- module.exports = {
49517
- // `String.prototype.codePointAt` method
49518
- // https://tc39.github.io/ecma262/#sec-string.prototype.codepointat
49519
- codeAt: createMethod(false),
49520
- // `String.prototype.at` method
49521
- // https://github.com/mathiasbynens/String.prototype.at
49522
- charAt: createMethod(true)
49523
- };
49524
-
49525
-
49526
- /***/ }),
49527
-
49528
- /***/ "b8ba":
49529
- /***/ (function(module, exports, __webpack_require__) {
49530
-
49531
- var global = __webpack_require__("f498");
49532
- var createNonEnumerableProperty = __webpack_require__("5b12");
49533
- var has = __webpack_require__("f1a7");
49534
- var setGlobal = __webpack_require__("3e34");
49535
- var inspectSource = __webpack_require__("df6f");
49536
- var InternalStateModule = __webpack_require__("cdcd");
49537
-
49538
- var getInternalState = InternalStateModule.get;
49539
- var enforceInternalState = InternalStateModule.enforce;
49540
- var TEMPLATE = String(String).split('String');
49541
-
49542
- (module.exports = function (O, key, value, options) {
49543
- var unsafe = options ? !!options.unsafe : false;
49544
- var simple = options ? !!options.enumerable : false;
49545
- var noTargetGet = options ? !!options.noTargetGet : false;
49546
- if (typeof value == 'function') {
49547
- if (typeof key == 'string' && !has(value, 'name')) createNonEnumerableProperty(value, 'name', key);
49548
- enforceInternalState(value).source = TEMPLATE.join(typeof key == 'string' ? key : '');
49549
- }
49550
- if (O === global) {
49551
- if (simple) O[key] = value;
49552
- else setGlobal(key, value);
49553
- return;
49554
- } else if (!unsafe) {
49555
- delete O[key];
49556
- } else if (!noTargetGet && O[key]) {
49557
- simple = true;
49558
- }
49559
- if (simple) O[key] = value;
49560
- else createNonEnumerableProperty(O, key, value);
49561
- // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
49562
- })(Function.prototype, 'toString', function toString() {
49563
- return typeof this == 'function' && getInternalState(this).source || inspectSource(this);
49564
- });
49565
-
49566
-
49567
- /***/ }),
49568
-
49569
- /***/ "b99b":
49570
- /***/ (function(module, exports, __webpack_require__) {
49571
-
49572
- var DESCRIPTORS = __webpack_require__("d4cb");
49573
- var definePropertyModule = __webpack_require__("abdf");
49574
- var anObject = __webpack_require__("157c");
49575
- var objectKeys = __webpack_require__("0c47");
49576
-
49577
- // `Object.defineProperties` method
49578
- // https://tc39.github.io/ecma262/#sec-object.defineproperties
49579
- module.exports = DESCRIPTORS ? Object.defineProperties : function defineProperties(O, Properties) {
49580
- anObject(O);
49581
- var keys = objectKeys(Properties);
49582
- var length = keys.length;
49583
- var index = 0;
49584
- var key;
49585
- while (length > index) definePropertyModule.f(O, key = keys[index++], Properties[key]);
49586
- return O;
49587
- };
49588
-
49589
-
49590
- /***/ }),
49591
-
49592
- /***/ "c1a2":
49593
- /***/ (function(module, exports, __webpack_require__) {
49594
-
49595
- var anObject = __webpack_require__("157c");
49596
- var aPossiblePrototype = __webpack_require__("f3e4");
49597
-
49598
- // `Object.setPrototypeOf` method
49599
- // https://tc39.github.io/ecma262/#sec-object.setprototypeof
49600
- // Works with __proto__ only. Old v8 can't work with null proto objects.
49601
- /* eslint-disable no-proto */
49602
- module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {
49603
- var CORRECT_SETTER = false;
49604
- var test = {};
49605
- var setter;
49606
- try {
49607
- setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set;
49608
- setter.call(test, []);
49609
- CORRECT_SETTER = test instanceof Array;
49610
- } catch (error) { /* empty */ }
49611
- return function setPrototypeOf(O, proto) {
49612
- anObject(O);
49613
- aPossiblePrototype(proto);
49614
- if (CORRECT_SETTER) setter.call(O, proto);
49615
- else O.__proto__ = proto;
49616
- return O;
49617
- };
49618
- }() : undefined);
49619
-
49620
-
49621
- /***/ }),
49622
-
49623
- /***/ "c607":
49624
- /***/ (function(module, exports, __webpack_require__) {
49625
-
49626
- var global = __webpack_require__("f498");
49627
- var setGlobal = __webpack_require__("3e34");
49628
-
49629
- var SHARED = '__core-js_shared__';
49630
- var store = global[SHARED] || setGlobal(SHARED, {});
49631
-
49632
- module.exports = store;
49633
-
49634
-
49635
- /***/ }),
49636
-
49637
- /***/ "c6de":
49638
- /***/ (function(module, exports, __webpack_require__) {
49639
-
49640
- var classof = __webpack_require__("6a61");
49641
-
49642
- // `IsArray` abstract operation
49643
- // https://tc39.github.io/ecma262/#sec-isarray
49644
- module.exports = Array.isArray || function isArray(arg) {
49645
- return classof(arg) == 'Array';
49646
- };
49647
-
49648
-
49649
- /***/ }),
49650
-
49651
- /***/ "c78b":
49652
- /***/ (function(module, exports, __webpack_require__) {
49653
-
49654
- "use strict";
49655
-
49656
- var $ = __webpack_require__("6b1d");
49657
- var notARegExp = __webpack_require__("9eea");
49658
- var requireObjectCoercible = __webpack_require__("730c");
49659
- var correctIsRegExpLogic = __webpack_require__("3e32");
49660
-
49661
- // `String.prototype.includes` method
49662
- // https://tc39.github.io/ecma262/#sec-string.prototype.includes
49663
- $({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, {
49664
- includes: function includes(searchString /* , position = 0 */) {
49665
- return !!~String(requireObjectCoercible(this))
49666
- .indexOf(notARegExp(searchString), arguments.length > 1 ? arguments[1] : undefined);
49667
- }
49668
- });
49669
-
49670
-
49671
- /***/ }),
49672
-
49673
- /***/ "c91c":
49674
- /***/ (function(module, exports, __webpack_require__) {
49675
-
49676
- var has = __webpack_require__("f1a7");
49677
- var toIndexedObject = __webpack_require__("378c");
49678
- var indexOf = __webpack_require__("1f5e").indexOf;
49679
- var hiddenKeys = __webpack_require__("d687");
49680
-
49681
- module.exports = function (object, names) {
49682
- var O = toIndexedObject(object);
49683
- var i = 0;
49684
- var result = [];
49685
- var key;
49686
- for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);
49687
- // Don't enum bug & hidden keys
49688
- while (names.length > i) if (has(O, key = names[i++])) {
49689
- ~indexOf(result, key) || result.push(key);
49690
- }
49691
- return result;
49692
- };
49693
-
49694
-
49695
- /***/ }),
49696
-
49697
- /***/ "c9c9":
49698
- /***/ (function(module, exports, __webpack_require__) {
49699
-
49700
- "use strict";
49701
-
49702
-
49703
- Object.defineProperty(exports, "__esModule", {
49704
- value: true
49705
- });
49706
- exports.default = void 0;
49707
-
49708
- var _index = _interopRequireDefault(__webpack_require__("5ae7"));
49709
-
49710
- var _index2 = _interopRequireDefault(__webpack_require__("3606"));
49711
-
49712
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
49713
-
49714
- var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
49715
- var parseOrdinalNumberPattern = /\d+/i;
49716
- var matchEraPatterns = {
49717
- narrow: /^(b|a)/i,
49718
- abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
49719
- wide: /^(before christ|before common era|anno domini|common era)/i
49720
- };
49721
- var parseEraPatterns = {
49722
- any: [/^b/i, /^(a|c)/i]
49723
- };
49724
- var matchQuarterPatterns = {
49725
- narrow: /^[1234]/i,
49726
- abbreviated: /^q[1234]/i,
49727
- wide: /^[1234](th|st|nd|rd)? quarter/i
49728
- };
49729
- var parseQuarterPatterns = {
49730
- any: [/1/i, /2/i, /3/i, /4/i]
49731
- };
49732
- var matchMonthPatterns = {
49733
- narrow: /^[jfmasond]/i,
49734
- abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
49735
- wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
49736
- };
49737
- var parseMonthPatterns = {
49738
- narrow: [/^j/i, /^f/i, /^m/i, /^a/i, /^m/i, /^j/i, /^j/i, /^a/i, /^s/i, /^o/i, /^n/i, /^d/i],
49739
- any: [/^ja/i, /^f/i, /^mar/i, /^ap/i, /^may/i, /^jun/i, /^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i]
49740
- };
49741
- var matchDayPatterns = {
49742
- narrow: /^[smtwf]/i,
49743
- short: /^(su|mo|tu|we|th|fr|sa)/i,
49744
- abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
49745
- wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
49746
- };
49747
- var parseDayPatterns = {
49748
- narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
49749
- any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
49750
- };
49751
- var matchDayPeriodPatterns = {
49752
- narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
49753
- any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
49754
- };
49755
- var parseDayPeriodPatterns = {
49756
- any: {
49757
- am: /^a/i,
49758
- pm: /^p/i,
49759
- midnight: /^mi/i,
49760
- noon: /^no/i,
49761
- morning: /morning/i,
49762
- afternoon: /afternoon/i,
49763
- evening: /evening/i,
49764
- night: /night/i
49765
- }
49766
- };
49767
- var match = {
49768
- ordinalNumber: (0, _index.default)({
49769
- matchPattern: matchOrdinalNumberPattern,
49770
- parsePattern: parseOrdinalNumberPattern,
49771
- valueCallback: function (value) {
49772
- return parseInt(value, 10);
49545
+ /**
49546
+ * @param {Node} node - The DOM Node object to render
49547
+ * @param {Object} options - Rendering options, @see {@link toSvg}
49548
+ * @return {Promise} - A promise that is fulfilled with a Uint8Array containing RGBA pixel data.
49549
+ * */
49550
+ function toPixelData(node, options) {
49551
+ return draw(node, options || {}).then(function (canvas) {
49552
+ return canvas
49553
+ .getContext('2d')
49554
+ .getImageData(0, 0, util.width(node), util.height(node)).data;
49555
+ });
49773
49556
  }
49774
- }),
49775
- era: (0, _index2.default)({
49776
- matchPatterns: matchEraPatterns,
49777
- defaultMatchWidth: 'wide',
49778
- parsePatterns: parseEraPatterns,
49779
- defaultParseWidth: 'any'
49780
- }),
49781
- quarter: (0, _index2.default)({
49782
- matchPatterns: matchQuarterPatterns,
49783
- defaultMatchWidth: 'wide',
49784
- parsePatterns: parseQuarterPatterns,
49785
- defaultParseWidth: 'any',
49786
- valueCallback: function (index) {
49787
- return index + 1;
49557
+ /**
49558
+ * @param {Node} node - The DOM Node object to render
49559
+ * @param {Object} options - Rendering options, @see {@link toSvg}
49560
+ * @return {Promise} - A promise that is fulfilled with a PNG image data URL
49561
+ * */
49562
+ function toPng(node, options) {
49563
+ return draw(node, options || {}).then(function (canvas) {
49564
+ return canvas.toDataURL();
49565
+ });
49788
49566
  }
49789
- }),
49790
- month: (0, _index2.default)({
49791
- matchPatterns: matchMonthPatterns,
49792
- defaultMatchWidth: 'wide',
49793
- parsePatterns: parseMonthPatterns,
49794
- defaultParseWidth: 'any'
49795
- }),
49796
- day: (0, _index2.default)({
49797
- matchPatterns: matchDayPatterns,
49798
- defaultMatchWidth: 'wide',
49799
- parsePatterns: parseDayPatterns,
49800
- defaultParseWidth: 'any'
49801
- }),
49802
- dayPeriod: (0, _index2.default)({
49803
- matchPatterns: matchDayPeriodPatterns,
49804
- defaultMatchWidth: 'any',
49805
- parsePatterns: parseDayPeriodPatterns,
49806
- defaultParseWidth: 'any'
49807
- })
49808
- };
49809
- var _default = match;
49810
- exports.default = _default;
49811
- module.exports = exports.default;
49812
-
49813
- /***/ }),
49814
-
49815
- /***/ "cdcd":
49816
- /***/ (function(module, exports, __webpack_require__) {
49817
-
49818
- var NATIVE_WEAK_MAP = __webpack_require__("7297");
49819
- var global = __webpack_require__("f498");
49820
- var isObject = __webpack_require__("7526");
49821
- var createNonEnumerableProperty = __webpack_require__("5b12");
49822
- var objectHas = __webpack_require__("f1a7");
49823
- var sharedKey = __webpack_require__("332c");
49824
- var hiddenKeys = __webpack_require__("d687");
49825
-
49826
- var WeakMap = global.WeakMap;
49827
- var set, get, has;
49828
-
49829
- var enforce = function (it) {
49830
- return has(it) ? get(it) : set(it, {});
49831
- };
49832
-
49833
- var getterFor = function (TYPE) {
49834
- return function (it) {
49835
- var state;
49836
- if (!isObject(it) || (state = get(it)).type !== TYPE) {
49837
- throw TypeError('Incompatible receiver, ' + TYPE + ' required');
49838
- } return state;
49839
- };
49840
- };
49841
-
49842
- if (NATIVE_WEAK_MAP) {
49843
- var store = new WeakMap();
49844
- var wmget = store.get;
49845
- var wmhas = store.has;
49846
- var wmset = store.set;
49847
- set = function (it, metadata) {
49848
- wmset.call(store, it, metadata);
49567
+ /**
49568
+ * @param {Node} node - The DOM Node object to render
49569
+ * @param {Object} options - Rendering options, @see {@link toSvg}
49570
+ * @return {Promise} - A promise that is fulfilled with a JPEG image data URL
49571
+ * */
49572
+ function toJpeg(node, options) {
49573
+ options = options || {};
49574
+ return draw(node, options).then(function (canvas) {
49575
+ return canvas.toDataURL('image/jpeg', options.quality || 1.0);
49576
+ });
49577
+ }
49578
+ /**
49579
+ * @param {Node} node - The DOM Node object to render
49580
+ * @param {Object} options - Rendering options, @see {@link toSvg}
49581
+ * @return {Promise} - A promise that is fulfilled with a PNG image blob
49582
+ * */
49583
+ function toBlob(node, options) {
49584
+ return draw(node, options || {}).then(util.canvasToBlob);
49585
+ }
49586
+ function copyOptions(options) {
49587
+ // Copy options to impl options for use in impl
49588
+ if (typeof options.imagePlaceholder === 'undefined') {
49589
+ domtoimage.impl.options.imagePlaceholder =
49590
+ defaultOptions.imagePlaceholder;
49591
+ }
49592
+ else {
49593
+ domtoimage.impl.options.imagePlaceholder = options.imagePlaceholder;
49594
+ }
49595
+ if (typeof options.cacheBust === 'undefined') {
49596
+ domtoimage.impl.options.cacheBust = defaultOptions.cacheBust;
49597
+ }
49598
+ else {
49599
+ domtoimage.impl.options.cacheBust = options.cacheBust;
49600
+ }
49601
+ }
49602
+ function draw(domNode, options) {
49603
+ return toSvg(domNode, options)
49604
+ .then(util.makeImage)
49605
+ .then(util.delay(100))
49606
+ .then(function (image) {
49607
+ var canvas = newCanvas(domNode);
49608
+ canvas.getContext('2d').drawImage(image, 0, 0);
49609
+ return canvas;
49610
+ });
49611
+ function newCanvas(domNode) {
49612
+ var canvas = document.createElement('canvas');
49613
+ canvas.width = options.width || util.width(domNode);
49614
+ canvas.height = options.height || util.height(domNode);
49615
+ if (options.bgcolor) {
49616
+ var ctx = canvas.getContext('2d');
49617
+ ctx.fillStyle = options.bgcolor;
49618
+ ctx.fillRect(0, 0, canvas.width, canvas.height);
49619
+ }
49620
+ return canvas;
49621
+ }
49622
+ }
49623
+ function cloneNode(node, filter, root) {
49624
+ if (!root && filter && !filter(node))
49625
+ return Promise.resolve();
49626
+ return Promise.resolve(node)
49627
+ .then(makeNodeCopy)
49628
+ .then(function (clone) {
49629
+ return cloneChildren(node, clone, filter);
49630
+ })
49631
+ .then(function (clone) {
49632
+ return processClone(node, clone);
49633
+ });
49634
+ function makeNodeCopy(node) {
49635
+ if (node instanceof HTMLCanvasElement)
49636
+ return util.makeImage(node.toDataURL());
49637
+ return node.cloneNode(false);
49638
+ }
49639
+ function cloneChildren(original, clone, filter) {
49640
+ var children = original.childNodes;
49641
+ if (children.length === 0)
49642
+ return Promise.resolve(clone);
49643
+ return cloneChildrenInOrder(clone, util.asArray(children), filter).then(function () {
49644
+ return clone;
49645
+ });
49646
+ function cloneChildrenInOrder(parent, children, filter) {
49647
+ var done = Promise.resolve();
49648
+ children.forEach(function (child) {
49649
+ done = done
49650
+ .then(function () {
49651
+ return cloneNode(child, filter);
49652
+ })
49653
+ .then(function (childClone) {
49654
+ if (childClone)
49655
+ parent.appendChild(childClone);
49656
+ });
49657
+ });
49658
+ return done;
49659
+ }
49660
+ }
49661
+ function processClone(original, clone) {
49662
+ if (!(clone instanceof Element))
49663
+ return clone;
49664
+ return Promise.resolve()
49665
+ .then(cloneStyle)
49666
+ .then(clonePseudoElements)
49667
+ .then(copyUserInput)
49668
+ .then(fixSvg)
49669
+ .then(function () {
49670
+ return clone;
49671
+ });
49672
+ function cloneStyle() {
49673
+ copyStyle(window.getComputedStyle(original), clone.style);
49674
+ function copyStyle(source, target) {
49675
+ if (source.cssText)
49676
+ target.cssText = source.cssText;
49677
+ else
49678
+ copyProperties(source, target);
49679
+ function copyProperties(source, target) {
49680
+ util.asArray(source).forEach(function (name) {
49681
+ target.setProperty(name, source.getPropertyValue(name), source.getPropertyPriority(name));
49682
+ });
49683
+ }
49684
+ }
49685
+ }
49686
+ function clonePseudoElements() {
49687
+ [':before', ':after'].forEach(function (element) {
49688
+ clonePseudoElement(element);
49689
+ });
49690
+ function clonePseudoElement(element) {
49691
+ var style = window.getComputedStyle(original, element);
49692
+ var content = style.getPropertyValue('content');
49693
+ if (content === '' || content === 'none')
49694
+ return;
49695
+ var className = util.uid();
49696
+ clone.className = clone.className + ' ' + className;
49697
+ var styleElement = document.createElement('style');
49698
+ styleElement.appendChild(formatPseudoElementStyle(className, element, style));
49699
+ clone.appendChild(styleElement);
49700
+ function formatPseudoElementStyle(className, element, style) {
49701
+ var selector = '.' + className + ':' + element;
49702
+ var cssText = style.cssText
49703
+ ? formatCssText(style)
49704
+ : formatCssProperties(style);
49705
+ return document.createTextNode(selector + '{' + cssText + '}');
49706
+ function formatCssText(style) {
49707
+ var content = style.getPropertyValue('content');
49708
+ return style.cssText + ' content: ' + content + ';';
49709
+ }
49710
+ function formatCssProperties(style) {
49711
+ return (util
49712
+ .asArray(style)
49713
+ .map(formatProperty)
49714
+ .join('; ') + ';');
49715
+ function formatProperty(name) {
49716
+ return (name +
49717
+ ': ' +
49718
+ style.getPropertyValue(name) +
49719
+ (style.getPropertyPriority(name)
49720
+ ? ' !important'
49721
+ : ''));
49722
+ }
49723
+ }
49724
+ }
49725
+ }
49726
+ }
49727
+ function copyUserInput() {
49728
+ if (original instanceof HTMLTextAreaElement)
49729
+ clone.innerHTML = original.value;
49730
+ if (original instanceof HTMLInputElement)
49731
+ clone.setAttribute('value', original.value);
49732
+ }
49733
+ function fixSvg() {
49734
+ if (!(clone instanceof SVGElement))
49735
+ return;
49736
+ clone.setAttribute('xmlns', 'http://www.w3.org/2000/svg');
49737
+ if (!(clone instanceof SVGRectElement))
49738
+ return;
49739
+ ['width', 'height'].forEach(function (attribute) {
49740
+ var value = clone.getAttribute(attribute);
49741
+ if (!value)
49742
+ return;
49743
+ clone.style.setProperty(attribute, value);
49744
+ });
49745
+ }
49746
+ }
49747
+ }
49748
+ function embedFonts(node) {
49749
+ return fontFaces.resolveAll().then(function (cssText) {
49750
+ var styleNode = document.createElement('style');
49751
+ node.appendChild(styleNode);
49752
+ styleNode.appendChild(document.createTextNode(cssText));
49753
+ return node;
49754
+ });
49755
+ }
49756
+ function inlineImages(node) {
49757
+ return images.inlineAll(node).then(function () {
49758
+ return node;
49759
+ });
49760
+ }
49761
+ function makeSvgDataUri(node, width, height) {
49762
+ return Promise.resolve(node)
49763
+ .then(function (node) {
49764
+ node.setAttribute('xmlns', 'http://www.w3.org/1999/xhtml');
49765
+ return new XMLSerializer().serializeToString(node);
49766
+ })
49767
+ .then(util.escapeXhtml)
49768
+ .then(function (xhtml) {
49769
+ return ('<foreignObject x="0" y="0" width="100%" height="100%">' +
49770
+ xhtml +
49771
+ '</foreignObject>');
49772
+ })
49773
+ .then(function (foreignObject) {
49774
+ return ('<svg xmlns="http://www.w3.org/2000/svg" width="' +
49775
+ width +
49776
+ '" height="' +
49777
+ height +
49778
+ '">' +
49779
+ foreignObject +
49780
+ '</svg>');
49781
+ })
49782
+ .then(function (svg) {
49783
+ return 'data:image/svg+xml;charset=utf-8,' + svg;
49784
+ });
49785
+ }
49786
+ function newUtil() {
49787
+ return {
49788
+ escape: escape,
49789
+ parseExtension: parseExtension,
49790
+ mimeType: mimeType,
49791
+ dataAsUrl: dataAsUrl,
49792
+ isDataUrl: isDataUrl,
49793
+ canvasToBlob: canvasToBlob,
49794
+ resolveUrl: resolveUrl,
49795
+ getAndEncode: getAndEncode,
49796
+ uid: uid(),
49797
+ delay: delay,
49798
+ asArray: asArray,
49799
+ escapeXhtml: escapeXhtml,
49800
+ makeImage: makeImage,
49801
+ width: width,
49802
+ height: height,
49803
+ };
49804
+ function mimes() {
49805
+ /*
49806
+ * Only WOFF and EOT mime types for fonts are 'real'
49807
+ * see http://www.iana.org/assignments/media-types/media-types.xhtml
49808
+ */
49809
+ var WOFF = 'application/font-woff';
49810
+ var JPEG = 'image/jpeg';
49811
+ return {
49812
+ woff: WOFF,
49813
+ woff2: WOFF,
49814
+ ttf: 'application/font-truetype',
49815
+ eot: 'application/vnd.ms-fontobject',
49816
+ png: 'image/png',
49817
+ jpg: JPEG,
49818
+ jpeg: JPEG,
49819
+ gif: 'image/gif',
49820
+ tiff: 'image/tiff',
49821
+ svg: 'image/svg+xml',
49822
+ };
49823
+ }
49824
+ function parseExtension(url) {
49825
+ var match = /\.([^\.\/]*?)$/g.exec(url);
49826
+ if (match)
49827
+ return match[1];
49828
+ else
49829
+ return '';
49830
+ }
49831
+ function mimeType(url) {
49832
+ var extension = parseExtension(url).toLowerCase();
49833
+ return mimes()[extension] || '';
49834
+ }
49835
+ function isDataUrl(url) {
49836
+ return url.search(/^(data:)/) !== -1;
49837
+ }
49838
+ function toBlob(canvas) {
49839
+ return new Promise(function (resolve) {
49840
+ var binaryString = window.atob(canvas.toDataURL().split(',')[1]);
49841
+ var length = binaryString.length;
49842
+ var binaryArray = new Uint8Array(length);
49843
+ for (var i = 0; i < length; i++)
49844
+ binaryArray[i] = binaryString.charCodeAt(i);
49845
+ resolve(new Blob([binaryArray], {
49846
+ type: 'image/png',
49847
+ }));
49848
+ });
49849
+ }
49850
+ function canvasToBlob(canvas) {
49851
+ if (canvas.toBlob)
49852
+ return new Promise(function (resolve) {
49853
+ canvas.toBlob(resolve);
49854
+ });
49855
+ return toBlob(canvas);
49856
+ }
49857
+ function resolveUrl(url, baseUrl) {
49858
+ var doc = document.implementation.createHTMLDocument();
49859
+ var base = doc.createElement('base');
49860
+ doc.head.appendChild(base);
49861
+ var a = doc.createElement('a');
49862
+ doc.body.appendChild(a);
49863
+ base.href = baseUrl;
49864
+ a.href = url;
49865
+ return a.href;
49866
+ }
49867
+ function uid() {
49868
+ var index = 0;
49869
+ return function () {
49870
+ return 'u' + fourRandomChars() + index++;
49871
+ function fourRandomChars() {
49872
+ /* see http://stackoverflow.com/a/6248722/2519373 */
49873
+ return ('0000' +
49874
+ ((Math.random() * Math.pow(36, 4)) << 0).toString(36)).slice(-4);
49875
+ }
49876
+ };
49877
+ }
49878
+ function makeImage(uri) {
49879
+ return new Promise(function (resolve, reject) {
49880
+ var image = new Image();
49881
+ image.onload = function () {
49882
+ resolve(image);
49883
+ };
49884
+ image.onerror = reject;
49885
+ image.src = uri;
49886
+ });
49887
+ }
49888
+ function getAndEncode(url) {
49889
+ var TIMEOUT = 30000;
49890
+ if (domtoimage.impl.options.cacheBust) {
49891
+ // Cache bypass so we dont have CORS issues with cached images
49892
+ // Source: https://developer.mozilla.org/en/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest#Bypassing_the_cache
49893
+ url += (/\?/.test(url) ? '&' : '?') + new Date().getTime();
49894
+ }
49895
+ return new Promise(function (resolve) {
49896
+ var request = new XMLHttpRequest();
49897
+ request.onreadystatechange = done;
49898
+ request.ontimeout = timeout;
49899
+ request.responseType = 'blob';
49900
+ request.timeout = TIMEOUT;
49901
+ request.open('GET', url, true);
49902
+ request.send();
49903
+ var placeholder;
49904
+ if (domtoimage.impl.options.imagePlaceholder) {
49905
+ var split = domtoimage.impl.options.imagePlaceholder.split(/,/);
49906
+ if (split && split[1]) {
49907
+ placeholder = split[1];
49908
+ }
49909
+ }
49910
+ function done() {
49911
+ if (request.readyState !== 4)
49912
+ return;
49913
+ if (request.status !== 200) {
49914
+ if (placeholder) {
49915
+ resolve(placeholder);
49916
+ }
49917
+ else {
49918
+ fail('cannot fetch resource: ' +
49919
+ url +
49920
+ ', status: ' +
49921
+ request.status);
49922
+ }
49923
+ return;
49924
+ }
49925
+ var encoder = new FileReader();
49926
+ encoder.onloadend = function () {
49927
+ var content = encoder.result.split(/,/)[1];
49928
+ resolve(content);
49929
+ };
49930
+ encoder.readAsDataURL(request.response);
49931
+ }
49932
+ function timeout() {
49933
+ if (placeholder) {
49934
+ resolve(placeholder);
49935
+ }
49936
+ else {
49937
+ fail('timeout of ' +
49938
+ TIMEOUT +
49939
+ 'ms occured while fetching resource: ' +
49940
+ url);
49941
+ }
49942
+ }
49943
+ function fail(message) {
49944
+ console.error(message);
49945
+ resolve('');
49946
+ }
49947
+ });
49948
+ }
49949
+ function dataAsUrl(content, type) {
49950
+ return 'data:' + type + ';base64,' + content;
49951
+ }
49952
+ function escape(string) {
49953
+ return string.replace(/([.*+?^${}()|\[\]\/\\])/g, '\\$1');
49954
+ }
49955
+ function delay(ms) {
49956
+ return function (arg) {
49957
+ return new Promise(function (resolve) {
49958
+ setTimeout(function () {
49959
+ resolve(arg);
49960
+ }, ms);
49961
+ });
49962
+ };
49963
+ }
49964
+ function asArray(arrayLike) {
49965
+ var array = [];
49966
+ var length = arrayLike.length;
49967
+ for (var i = 0; i < length; i++)
49968
+ array.push(arrayLike[i]);
49969
+ return array;
49970
+ }
49971
+ function escapeXhtml(string) {
49972
+ return string.replace(/#/g, '%23').replace(/\n/g, '%0A');
49973
+ }
49974
+ function width(node) {
49975
+ var leftBorder = px(node, 'border-left-width');
49976
+ var rightBorder = px(node, 'border-right-width');
49977
+ return node.scrollWidth + leftBorder + rightBorder;
49978
+ }
49979
+ function height(node) {
49980
+ var topBorder = px(node, 'border-top-width');
49981
+ var bottomBorder = px(node, 'border-bottom-width');
49982
+ return node.scrollHeight + topBorder + bottomBorder;
49983
+ }
49984
+ function px(node, styleProperty) {
49985
+ var value = window
49986
+ .getComputedStyle(node)
49987
+ .getPropertyValue(styleProperty);
49988
+ return parseFloat(value.replace('px', ''));
49989
+ }
49990
+ }
49991
+ function newInliner() {
49992
+ var URL_REGEX = /url\(['"]?([^'"]+?)['"]?\)/g;
49993
+ return {
49994
+ inlineAll: inlineAll,
49995
+ shouldProcess: shouldProcess,
49996
+ impl: {
49997
+ readUrls: readUrls,
49998
+ inline: inline,
49999
+ },
50000
+ };
50001
+ function shouldProcess(string) {
50002
+ return string.search(URL_REGEX) !== -1;
50003
+ }
50004
+ function readUrls(string) {
50005
+ var result = [];
50006
+ var match;
50007
+ while ((match = URL_REGEX.exec(string)) !== null) {
50008
+ result.push(match[1]);
50009
+ }
50010
+ return result.filter(function (url) {
50011
+ return !util.isDataUrl(url);
50012
+ });
50013
+ }
50014
+ function inline(string, url, baseUrl, get) {
50015
+ return Promise.resolve(url)
50016
+ .then(function (url) {
50017
+ return baseUrl ? util.resolveUrl(url, baseUrl) : url;
50018
+ })
50019
+ .then(get || util.getAndEncode)
50020
+ .then(function (data) {
50021
+ return util.dataAsUrl(data, util.mimeType(url));
50022
+ })
50023
+ .then(function (dataUrl) {
50024
+ return string.replace(urlAsRegex(url), '$1' + dataUrl + '$3');
50025
+ });
50026
+ function urlAsRegex(url) {
50027
+ return new RegExp('(url\\([\'"]?)(' + util.escape(url) + ')([\'"]?\\))', 'g');
50028
+ }
50029
+ }
50030
+ function inlineAll(string, baseUrl, get) {
50031
+ if (nothingToInline())
50032
+ return Promise.resolve(string);
50033
+ return Promise.resolve(string)
50034
+ .then(readUrls)
50035
+ .then(function (urls) {
50036
+ var done = Promise.resolve(string);
50037
+ urls.forEach(function (url) {
50038
+ done = done.then(function (string) {
50039
+ return inline(string, url, baseUrl, get);
50040
+ });
50041
+ });
50042
+ return done;
50043
+ });
50044
+ function nothingToInline() {
50045
+ return !shouldProcess(string);
50046
+ }
50047
+ }
50048
+ }
50049
+ function newFontFaces() {
50050
+ return {
50051
+ resolveAll: resolveAll,
50052
+ impl: {
50053
+ readAll: readAll,
50054
+ },
50055
+ };
50056
+ function resolveAll() {
50057
+ return readAll(document)
50058
+ .then(function (webFonts) {
50059
+ return Promise.all(webFonts.map(function (webFont) {
50060
+ return webFont.resolve();
50061
+ }));
50062
+ })
50063
+ .then(function (cssStrings) {
50064
+ return cssStrings.join('\n');
50065
+ });
50066
+ }
50067
+ function readAll() {
50068
+ return Promise.resolve(util.asArray(document.styleSheets))
50069
+ .then(getCssRules)
50070
+ .then(selectWebFontRules)
50071
+ .then(function (rules) {
50072
+ return rules.map(newWebFont);
50073
+ });
50074
+ function selectWebFontRules(cssRules) {
50075
+ return cssRules
50076
+ .filter(function (rule) {
50077
+ return rule.type === CSSRule.FONT_FACE_RULE;
50078
+ })
50079
+ .filter(function (rule) {
50080
+ return inliner.shouldProcess(rule.style.getPropertyValue('src'));
50081
+ });
50082
+ }
50083
+ function getCssRules(styleSheets) {
50084
+ var cssRules = [];
50085
+ styleSheets.forEach(function (sheet) {
50086
+ try {
50087
+ util.asArray(sheet.cssRules || []).forEach(cssRules.push.bind(cssRules));
50088
+ }
50089
+ catch (e) {
50090
+ console.log('Error while reading CSS rules from ' + sheet.href, e.toString());
50091
+ }
50092
+ });
50093
+ return cssRules;
50094
+ }
50095
+ function newWebFont(webFontRule) {
50096
+ return {
50097
+ resolve: function resolve() {
50098
+ var baseUrl = (webFontRule.parentStyleSheet || {}).href;
50099
+ return inliner.inlineAll(webFontRule.cssText, baseUrl);
50100
+ },
50101
+ src: function () {
50102
+ return webFontRule.style.getPropertyValue('src');
50103
+ },
50104
+ };
50105
+ }
50106
+ }
50107
+ }
50108
+ function newImages() {
50109
+ return {
50110
+ inlineAll: inlineAll,
50111
+ impl: {
50112
+ newImage: newImage,
50113
+ },
50114
+ };
50115
+ function newImage(element) {
50116
+ return {
50117
+ inline: inline,
50118
+ };
50119
+ function inline(get) {
50120
+ if (util.isDataUrl(element.src))
50121
+ return Promise.resolve();
50122
+ return Promise.resolve(element.src)
50123
+ .then(get || util.getAndEncode)
50124
+ .then(function (data) {
50125
+ return util.dataAsUrl(data, util.mimeType(element.src));
50126
+ })
50127
+ .then(function (dataUrl) {
50128
+ return new Promise(function (resolve, reject) {
50129
+ element.onload = resolve;
50130
+ element.onerror = reject;
50131
+ element.src = dataUrl;
50132
+ });
50133
+ });
50134
+ }
50135
+ }
50136
+ function inlineAll(node) {
50137
+ if (!(node instanceof Element))
50138
+ return Promise.resolve(node);
50139
+ return inlineBackground(node).then(function () {
50140
+ if (node instanceof HTMLImageElement)
50141
+ return newImage(node).inline();
50142
+ else
50143
+ return Promise.all(util.asArray(node.childNodes).map(function (child) {
50144
+ return inlineAll(child);
50145
+ }));
50146
+ });
50147
+ function inlineBackground(node) {
50148
+ var background = node.style.getPropertyValue('background');
50149
+ if (!background)
50150
+ return Promise.resolve(node);
50151
+ return inliner
50152
+ .inlineAll(background)
50153
+ .then(function (inlined) {
50154
+ node.style.setProperty('background', inlined, node.style.getPropertyPriority('background'));
50155
+ })
50156
+ .then(function () {
50157
+ return node;
50158
+ });
50159
+ }
50160
+ }
50161
+ }
50162
+ })(this);
50163
+ //# sourceMappingURL=../../../src/services/essentials/dom-to-image.js.map
50164
+
50165
+ /***/ }),
50166
+
50167
+ /***/ "b489":
50168
+ /***/ (function(module, exports, __webpack_require__) {
50169
+
50170
+ "use strict";
50171
+
50172
+
50173
+ Object.defineProperty(exports, "__esModule", {
50174
+ value: true
50175
+ });
50176
+ exports.default = buildLocalizeFn;
50177
+
50178
+ function buildLocalizeFn(args) {
50179
+ return function (dirtyIndex, dirtyOptions) {
50180
+ var options = dirtyOptions || {};
50181
+ var context = options.context ? String(options.context) : 'standalone';
50182
+ var valuesArray;
50183
+
50184
+ if (context === 'formatting' && args.formattingValues) {
50185
+ var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
50186
+ var width = options.width ? String(options.width) : defaultWidth;
50187
+ valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
50188
+ } else {
50189
+ var _defaultWidth = args.defaultWidth;
50190
+
50191
+ var _width = options.width ? String(options.width) : args.defaultWidth;
50192
+
50193
+ valuesArray = args.values[_width] || args.values[_defaultWidth];
50194
+ }
50195
+
50196
+ var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex;
50197
+ return valuesArray[index];
50198
+ };
50199
+ }
50200
+
50201
+ module.exports = exports.default;
50202
+
50203
+ /***/ }),
50204
+
50205
+ /***/ "b495":
50206
+ /***/ (function(module, exports, __webpack_require__) {
50207
+
50208
+ var toInteger = __webpack_require__("8bb2");
50209
+
50210
+ var min = Math.min;
50211
+
50212
+ // `ToLength` abstract operation
50213
+ // https://tc39.github.io/ecma262/#sec-tolength
50214
+ module.exports = function (argument) {
50215
+ return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
50216
+ };
50217
+
50218
+
50219
+ /***/ }),
50220
+
50221
+ /***/ "b634":
50222
+ /***/ (function(module, exports, __webpack_require__) {
50223
+
50224
+ var has = __webpack_require__("f1a7");
50225
+ var ownKeys = __webpack_require__("a03e");
50226
+ var getOwnPropertyDescriptorModule = __webpack_require__("185a");
50227
+ var definePropertyModule = __webpack_require__("abdf");
50228
+
50229
+ module.exports = function (target, source) {
50230
+ var keys = ownKeys(source);
50231
+ var defineProperty = definePropertyModule.f;
50232
+ var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
50233
+ for (var i = 0; i < keys.length; i++) {
50234
+ var key = keys[i];
50235
+ if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
50236
+ }
50237
+ };
50238
+
50239
+
50240
+ /***/ }),
50241
+
50242
+ /***/ "b7fb":
50243
+ /***/ (function(module, exports, __webpack_require__) {
50244
+
50245
+ var toInteger = __webpack_require__("8bb2");
50246
+ var requireObjectCoercible = __webpack_require__("730c");
50247
+
50248
+ // `String.prototype.{ codePointAt, at }` methods implementation
50249
+ var createMethod = function (CONVERT_TO_STRING) {
50250
+ return function ($this, pos) {
50251
+ var S = String(requireObjectCoercible($this));
50252
+ var position = toInteger(pos);
50253
+ var size = S.length;
50254
+ var first, second;
50255
+ if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
50256
+ first = S.charCodeAt(position);
50257
+ return first < 0xD800 || first > 0xDBFF || position + 1 === size
50258
+ || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF
50259
+ ? CONVERT_TO_STRING ? S.charAt(position) : first
50260
+ : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
50261
+ };
50262
+ };
50263
+
50264
+ module.exports = {
50265
+ // `String.prototype.codePointAt` method
50266
+ // https://tc39.github.io/ecma262/#sec-string.prototype.codepointat
50267
+ codeAt: createMethod(false),
50268
+ // `String.prototype.at` method
50269
+ // https://github.com/mathiasbynens/String.prototype.at
50270
+ charAt: createMethod(true)
50271
+ };
50272
+
50273
+
50274
+ /***/ }),
50275
+
50276
+ /***/ "b8ba":
50277
+ /***/ (function(module, exports, __webpack_require__) {
50278
+
50279
+ var global = __webpack_require__("f498");
50280
+ var createNonEnumerableProperty = __webpack_require__("5b12");
50281
+ var has = __webpack_require__("f1a7");
50282
+ var setGlobal = __webpack_require__("3e34");
50283
+ var inspectSource = __webpack_require__("df6f");
50284
+ var InternalStateModule = __webpack_require__("cdcd");
50285
+
50286
+ var getInternalState = InternalStateModule.get;
50287
+ var enforceInternalState = InternalStateModule.enforce;
50288
+ var TEMPLATE = String(String).split('String');
50289
+
50290
+ (module.exports = function (O, key, value, options) {
50291
+ var unsafe = options ? !!options.unsafe : false;
50292
+ var simple = options ? !!options.enumerable : false;
50293
+ var noTargetGet = options ? !!options.noTargetGet : false;
50294
+ if (typeof value == 'function') {
50295
+ if (typeof key == 'string' && !has(value, 'name')) createNonEnumerableProperty(value, 'name', key);
50296
+ enforceInternalState(value).source = TEMPLATE.join(typeof key == 'string' ? key : '');
50297
+ }
50298
+ if (O === global) {
50299
+ if (simple) O[key] = value;
50300
+ else setGlobal(key, value);
50301
+ return;
50302
+ } else if (!unsafe) {
50303
+ delete O[key];
50304
+ } else if (!noTargetGet && O[key]) {
50305
+ simple = true;
50306
+ }
50307
+ if (simple) O[key] = value;
50308
+ else createNonEnumerableProperty(O, key, value);
50309
+ // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
50310
+ })(Function.prototype, 'toString', function toString() {
50311
+ return typeof this == 'function' && getInternalState(this).source || inspectSource(this);
50312
+ });
50313
+
50314
+
50315
+ /***/ }),
50316
+
50317
+ /***/ "b99b":
50318
+ /***/ (function(module, exports, __webpack_require__) {
50319
+
50320
+ var DESCRIPTORS = __webpack_require__("d4cb");
50321
+ var definePropertyModule = __webpack_require__("abdf");
50322
+ var anObject = __webpack_require__("157c");
50323
+ var objectKeys = __webpack_require__("0c47");
50324
+
50325
+ // `Object.defineProperties` method
50326
+ // https://tc39.github.io/ecma262/#sec-object.defineproperties
50327
+ module.exports = DESCRIPTORS ? Object.defineProperties : function defineProperties(O, Properties) {
50328
+ anObject(O);
50329
+ var keys = objectKeys(Properties);
50330
+ var length = keys.length;
50331
+ var index = 0;
50332
+ var key;
50333
+ while (length > index) definePropertyModule.f(O, key = keys[index++], Properties[key]);
50334
+ return O;
50335
+ };
50336
+
50337
+
50338
+ /***/ }),
50339
+
50340
+ /***/ "c1a2":
50341
+ /***/ (function(module, exports, __webpack_require__) {
50342
+
50343
+ var anObject = __webpack_require__("157c");
50344
+ var aPossiblePrototype = __webpack_require__("f3e4");
50345
+
50346
+ // `Object.setPrototypeOf` method
50347
+ // https://tc39.github.io/ecma262/#sec-object.setprototypeof
50348
+ // Works with __proto__ only. Old v8 can't work with null proto objects.
50349
+ /* eslint-disable no-proto */
50350
+ module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {
50351
+ var CORRECT_SETTER = false;
50352
+ var test = {};
50353
+ var setter;
50354
+ try {
50355
+ setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set;
50356
+ setter.call(test, []);
50357
+ CORRECT_SETTER = test instanceof Array;
50358
+ } catch (error) { /* empty */ }
50359
+ return function setPrototypeOf(O, proto) {
50360
+ anObject(O);
50361
+ aPossiblePrototype(proto);
50362
+ if (CORRECT_SETTER) setter.call(O, proto);
50363
+ else O.__proto__ = proto;
50364
+ return O;
50365
+ };
50366
+ }() : undefined);
50367
+
50368
+
50369
+ /***/ }),
50370
+
50371
+ /***/ "c607":
50372
+ /***/ (function(module, exports, __webpack_require__) {
50373
+
50374
+ var global = __webpack_require__("f498");
50375
+ var setGlobal = __webpack_require__("3e34");
50376
+
50377
+ var SHARED = '__core-js_shared__';
50378
+ var store = global[SHARED] || setGlobal(SHARED, {});
50379
+
50380
+ module.exports = store;
50381
+
50382
+
50383
+ /***/ }),
50384
+
50385
+ /***/ "c6de":
50386
+ /***/ (function(module, exports, __webpack_require__) {
50387
+
50388
+ var classof = __webpack_require__("6a61");
50389
+
50390
+ // `IsArray` abstract operation
50391
+ // https://tc39.github.io/ecma262/#sec-isarray
50392
+ module.exports = Array.isArray || function isArray(arg) {
50393
+ return classof(arg) == 'Array';
50394
+ };
50395
+
50396
+
50397
+ /***/ }),
50398
+
50399
+ /***/ "c78b":
50400
+ /***/ (function(module, exports, __webpack_require__) {
50401
+
50402
+ "use strict";
50403
+
50404
+ var $ = __webpack_require__("6b1d");
50405
+ var notARegExp = __webpack_require__("9eea");
50406
+ var requireObjectCoercible = __webpack_require__("730c");
50407
+ var correctIsRegExpLogic = __webpack_require__("3e32");
50408
+
50409
+ // `String.prototype.includes` method
50410
+ // https://tc39.github.io/ecma262/#sec-string.prototype.includes
50411
+ $({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, {
50412
+ includes: function includes(searchString /* , position = 0 */) {
50413
+ return !!~String(requireObjectCoercible(this))
50414
+ .indexOf(notARegExp(searchString), arguments.length > 1 ? arguments[1] : undefined);
50415
+ }
50416
+ });
50417
+
50418
+
50419
+ /***/ }),
50420
+
50421
+ /***/ "c91c":
50422
+ /***/ (function(module, exports, __webpack_require__) {
50423
+
50424
+ var has = __webpack_require__("f1a7");
50425
+ var toIndexedObject = __webpack_require__("378c");
50426
+ var indexOf = __webpack_require__("1f5e").indexOf;
50427
+ var hiddenKeys = __webpack_require__("d687");
50428
+
50429
+ module.exports = function (object, names) {
50430
+ var O = toIndexedObject(object);
50431
+ var i = 0;
50432
+ var result = [];
50433
+ var key;
50434
+ for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);
50435
+ // Don't enum bug & hidden keys
50436
+ while (names.length > i) if (has(O, key = names[i++])) {
50437
+ ~indexOf(result, key) || result.push(key);
50438
+ }
50439
+ return result;
50440
+ };
50441
+
50442
+
50443
+ /***/ }),
50444
+
50445
+ /***/ "c9c9":
50446
+ /***/ (function(module, exports, __webpack_require__) {
50447
+
50448
+ "use strict";
50449
+
50450
+
50451
+ Object.defineProperty(exports, "__esModule", {
50452
+ value: true
50453
+ });
50454
+ exports.default = void 0;
50455
+
50456
+ var _index = _interopRequireDefault(__webpack_require__("5ae7"));
50457
+
50458
+ var _index2 = _interopRequireDefault(__webpack_require__("3606"));
50459
+
50460
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
50461
+
50462
+ var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
50463
+ var parseOrdinalNumberPattern = /\d+/i;
50464
+ var matchEraPatterns = {
50465
+ narrow: /^(b|a)/i,
50466
+ abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
50467
+ wide: /^(before christ|before common era|anno domini|common era)/i
50468
+ };
50469
+ var parseEraPatterns = {
50470
+ any: [/^b/i, /^(a|c)/i]
50471
+ };
50472
+ var matchQuarterPatterns = {
50473
+ narrow: /^[1234]/i,
50474
+ abbreviated: /^q[1234]/i,
50475
+ wide: /^[1234](th|st|nd|rd)? quarter/i
50476
+ };
50477
+ var parseQuarterPatterns = {
50478
+ any: [/1/i, /2/i, /3/i, /4/i]
50479
+ };
50480
+ var matchMonthPatterns = {
50481
+ narrow: /^[jfmasond]/i,
50482
+ abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
50483
+ wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
50484
+ };
50485
+ var parseMonthPatterns = {
50486
+ narrow: [/^j/i, /^f/i, /^m/i, /^a/i, /^m/i, /^j/i, /^j/i, /^a/i, /^s/i, /^o/i, /^n/i, /^d/i],
50487
+ any: [/^ja/i, /^f/i, /^mar/i, /^ap/i, /^may/i, /^jun/i, /^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i]
50488
+ };
50489
+ var matchDayPatterns = {
50490
+ narrow: /^[smtwf]/i,
50491
+ short: /^(su|mo|tu|we|th|fr|sa)/i,
50492
+ abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
50493
+ wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
50494
+ };
50495
+ var parseDayPatterns = {
50496
+ narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
50497
+ any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
50498
+ };
50499
+ var matchDayPeriodPatterns = {
50500
+ narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
50501
+ any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
50502
+ };
50503
+ var parseDayPeriodPatterns = {
50504
+ any: {
50505
+ am: /^a/i,
50506
+ pm: /^p/i,
50507
+ midnight: /^mi/i,
50508
+ noon: /^no/i,
50509
+ morning: /morning/i,
50510
+ afternoon: /afternoon/i,
50511
+ evening: /evening/i,
50512
+ night: /night/i
50513
+ }
50514
+ };
50515
+ var match = {
50516
+ ordinalNumber: (0, _index.default)({
50517
+ matchPattern: matchOrdinalNumberPattern,
50518
+ parsePattern: parseOrdinalNumberPattern,
50519
+ valueCallback: function (value) {
50520
+ return parseInt(value, 10);
50521
+ }
50522
+ }),
50523
+ era: (0, _index2.default)({
50524
+ matchPatterns: matchEraPatterns,
50525
+ defaultMatchWidth: 'wide',
50526
+ parsePatterns: parseEraPatterns,
50527
+ defaultParseWidth: 'any'
50528
+ }),
50529
+ quarter: (0, _index2.default)({
50530
+ matchPatterns: matchQuarterPatterns,
50531
+ defaultMatchWidth: 'wide',
50532
+ parsePatterns: parseQuarterPatterns,
50533
+ defaultParseWidth: 'any',
50534
+ valueCallback: function (index) {
50535
+ return index + 1;
50536
+ }
50537
+ }),
50538
+ month: (0, _index2.default)({
50539
+ matchPatterns: matchMonthPatterns,
50540
+ defaultMatchWidth: 'wide',
50541
+ parsePatterns: parseMonthPatterns,
50542
+ defaultParseWidth: 'any'
50543
+ }),
50544
+ day: (0, _index2.default)({
50545
+ matchPatterns: matchDayPatterns,
50546
+ defaultMatchWidth: 'wide',
50547
+ parsePatterns: parseDayPatterns,
50548
+ defaultParseWidth: 'any'
50549
+ }),
50550
+ dayPeriod: (0, _index2.default)({
50551
+ matchPatterns: matchDayPeriodPatterns,
50552
+ defaultMatchWidth: 'any',
50553
+ parsePatterns: parseDayPeriodPatterns,
50554
+ defaultParseWidth: 'any'
50555
+ })
50556
+ };
50557
+ var _default = match;
50558
+ exports.default = _default;
50559
+ module.exports = exports.default;
50560
+
50561
+ /***/ }),
50562
+
50563
+ /***/ "cdcd":
50564
+ /***/ (function(module, exports, __webpack_require__) {
50565
+
50566
+ var NATIVE_WEAK_MAP = __webpack_require__("7297");
50567
+ var global = __webpack_require__("f498");
50568
+ var isObject = __webpack_require__("7526");
50569
+ var createNonEnumerableProperty = __webpack_require__("5b12");
50570
+ var objectHas = __webpack_require__("f1a7");
50571
+ var sharedKey = __webpack_require__("332c");
50572
+ var hiddenKeys = __webpack_require__("d687");
50573
+
50574
+ var WeakMap = global.WeakMap;
50575
+ var set, get, has;
50576
+
50577
+ var enforce = function (it) {
50578
+ return has(it) ? get(it) : set(it, {});
50579
+ };
50580
+
50581
+ var getterFor = function (TYPE) {
50582
+ return function (it) {
50583
+ var state;
50584
+ if (!isObject(it) || (state = get(it)).type !== TYPE) {
50585
+ throw TypeError('Incompatible receiver, ' + TYPE + ' required');
50586
+ } return state;
50587
+ };
50588
+ };
50589
+
50590
+ if (NATIVE_WEAK_MAP) {
50591
+ var store = new WeakMap();
50592
+ var wmget = store.get;
50593
+ var wmhas = store.has;
50594
+ var wmset = store.set;
50595
+ set = function (it, metadata) {
50596
+ wmset.call(store, it, metadata);
49849
50597
  return metadata;
49850
50598
  };
49851
50599
  get = function (it) {
@@ -50281,1039 +51029,263 @@ $({ target: 'Object', stat: true, forced: fails(function () { getOwnPropertySymb
50281
51029
  });
50282
51030
 
50283
51031
  // `JSON.stringify` method behavior with symbols
50284
- // https://tc39.github.io/ecma262/#sec-json.stringify
50285
- if ($stringify) {
50286
- var FORCED_JSON_STRINGIFY = !NATIVE_SYMBOL || fails(function () {
50287
- var symbol = $Symbol();
50288
- // MS Edge converts symbol values to JSON as {}
50289
- return $stringify([symbol]) != '[null]'
50290
- // WebKit converts symbol values to JSON as null
50291
- || $stringify({ a: symbol }) != '{}'
50292
- // V8 throws on boxed symbols
50293
- || $stringify(Object(symbol)) != '{}';
50294
- });
50295
-
50296
- $({ target: 'JSON', stat: true, forced: FORCED_JSON_STRINGIFY }, {
50297
- // eslint-disable-next-line no-unused-vars
50298
- stringify: function stringify(it, replacer, space) {
50299
- var args = [it];
50300
- var index = 1;
50301
- var $replacer;
50302
- while (arguments.length > index) args.push(arguments[index++]);
50303
- $replacer = replacer;
50304
- if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
50305
- if (!isArray(replacer)) replacer = function (key, value) {
50306
- if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
50307
- if (!isSymbol(value)) return value;
50308
- };
50309
- args[1] = replacer;
50310
- return $stringify.apply(null, args);
50311
- }
50312
- });
50313
- }
50314
-
50315
- // `Symbol.prototype[@@toPrimitive]` method
50316
- // https://tc39.github.io/ecma262/#sec-symbol.prototype-@@toprimitive
50317
- if (!$Symbol[PROTOTYPE][TO_PRIMITIVE]) {
50318
- createNonEnumerableProperty($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);
50319
- }
50320
- // `Symbol.prototype[@@toStringTag]` property
50321
- // https://tc39.github.io/ecma262/#sec-symbol.prototype-@@tostringtag
50322
- setToStringTag($Symbol, SYMBOL);
50323
-
50324
- hiddenKeys[HIDDEN] = true;
50325
-
50326
-
50327
- /***/ }),
50328
-
50329
- /***/ "d6f0":
50330
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
50331
-
50332
- "use strict";
50333
- /* WEBPACK VAR INJECTION */(function(module) {/* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("7f0d");
50334
-
50335
-
50336
- /** Detect free variable `exports`. */
50337
- var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
50338
-
50339
- /** Detect free variable `module`. */
50340
- var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
50341
-
50342
- /** Detect the popular CommonJS extension `module.exports`. */
50343
- var moduleExports = freeModule && freeModule.exports === freeExports;
50344
-
50345
- /** Built-in value references. */
50346
- var Buffer = moduleExports ? _root_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].Buffer : undefined,
50347
- allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;
50348
-
50349
- /**
50350
- * Creates a clone of `buffer`.
50351
- *
50352
- * @private
50353
- * @param {Buffer} buffer The buffer to clone.
50354
- * @param {boolean} [isDeep] Specify a deep clone.
50355
- * @returns {Buffer} Returns the cloned buffer.
50356
- */
50357
- function cloneBuffer(buffer, isDeep) {
50358
- if (isDeep) {
50359
- return buffer.slice();
50360
- }
50361
- var length = buffer.length,
50362
- result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
50363
-
50364
- buffer.copy(result);
50365
- return result;
50366
- }
50367
-
50368
- /* harmony default export */ __webpack_exports__["a"] = (cloneBuffer);
50369
-
50370
- /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("7326")(module)))
50371
-
50372
- /***/ }),
50373
-
50374
- /***/ "da06":
50375
- /***/ (function(module, exports, __webpack_require__) {
50376
-
50377
- var TO_STRING_TAG_SUPPORT = __webpack_require__("3cec");
50378
- var classofRaw = __webpack_require__("6a61");
50379
- var wellKnownSymbol = __webpack_require__("7d53");
50380
-
50381
- var TO_STRING_TAG = wellKnownSymbol('toStringTag');
50382
- // ES3 wrong here
50383
- var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
50384
-
50385
- // fallback for IE11 Script Access Denied error
50386
- var tryGet = function (it, key) {
50387
- try {
50388
- return it[key];
50389
- } catch (error) { /* empty */ }
50390
- };
50391
-
50392
- // getting tag from ES6+ `Object.prototype.toString`
50393
- module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
50394
- var O, tag, result;
50395
- return it === undefined ? 'Undefined' : it === null ? 'Null'
50396
- // @@toStringTag case
50397
- : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == 'string' ? tag
50398
- // builtinTag case
50399
- : CORRECT_ARGUMENTS ? classofRaw(O)
50400
- // ES3 arguments fallback
50401
- : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;
50402
- };
50403
-
50404
-
50405
- /***/ }),
50406
-
50407
- /***/ "df6f":
50408
- /***/ (function(module, exports, __webpack_require__) {
50409
-
50410
- var store = __webpack_require__("c607");
50411
-
50412
- var functionToString = Function.toString;
50413
-
50414
- // this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper
50415
- if (typeof store.inspectSource != 'function') {
50416
- store.inspectSource = function (it) {
50417
- return functionToString.call(it);
50418
- };
50419
- }
50420
-
50421
- module.exports = store.inspectSource;
50422
-
50423
-
50424
- /***/ }),
50425
-
50426
- /***/ "e129":
50427
- /***/ (function(module, exports, __webpack_require__) {
50428
-
50429
- "use strict";
50430
-
50431
- var nativePropertyIsEnumerable = {}.propertyIsEnumerable;
50432
- var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
50433
-
50434
- // Nashorn ~ JDK8 bug
50435
- var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);
50436
-
50437
- // `Object.prototype.propertyIsEnumerable` method implementation
50438
- // https://tc39.github.io/ecma262/#sec-object.prototype.propertyisenumerable
50439
- exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
50440
- var descriptor = getOwnPropertyDescriptor(this, V);
50441
- return !!descriptor && descriptor.enumerable;
50442
- } : nativePropertyIsEnumerable;
50443
-
50444
-
50445
- /***/ }),
50446
-
50447
- /***/ "e7a0":
50448
- /***/ (function(module, exports, __webpack_require__) {
50449
-
50450
- var fails = __webpack_require__("72df");
50451
-
50452
- module.exports = !!Object.getOwnPropertySymbols && !fails(function () {
50453
- // Chrome 38 Symbol has incorrect toString conversion
50454
- // eslint-disable-next-line no-undef
50455
- return !String(Symbol());
50456
- });
50457
-
50458
-
50459
- /***/ }),
50460
-
50461
- /***/ "ebac":
50462
- /***/ (function(module, exports, __webpack_require__) {
50463
-
50464
- var fails = __webpack_require__("72df");
50465
-
50466
- var replacement = /#|\.prototype\./;
50467
-
50468
- var isForced = function (feature, detection) {
50469
- var value = data[normalize(feature)];
50470
- return value == POLYFILL ? true
50471
- : value == NATIVE ? false
50472
- : typeof detection == 'function' ? fails(detection)
50473
- : !!detection;
50474
- };
50475
-
50476
- var normalize = isForced.normalize = function (string) {
50477
- return String(string).replace(replacement, '.').toLowerCase();
50478
- };
50479
-
50480
- var data = isForced.data = {};
50481
- var NATIVE = isForced.NATIVE = 'N';
50482
- var POLYFILL = isForced.POLYFILL = 'P';
50483
-
50484
- module.exports = isForced;
50485
-
50486
-
50487
- /***/ }),
50488
-
50489
- /***/ "ed2b":
50490
- /***/ (function(module, exports, __webpack_require__) {
50491
-
50492
- var wellKnownSymbol = __webpack_require__("7d53");
50493
- var create = __webpack_require__("82e8");
50494
- var definePropertyModule = __webpack_require__("abdf");
50495
-
50496
- var UNSCOPABLES = wellKnownSymbol('unscopables');
50497
- var ArrayPrototype = Array.prototype;
50498
-
50499
- // Array.prototype[@@unscopables]
50500
- // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
50501
- if (ArrayPrototype[UNSCOPABLES] == undefined) {
50502
- definePropertyModule.f(ArrayPrototype, UNSCOPABLES, {
50503
- configurable: true,
50504
- value: create(null)
50505
- });
50506
- }
50507
-
50508
- // add a key to Array.prototype[@@unscopables]
50509
- module.exports = function (key) {
50510
- ArrayPrototype[UNSCOPABLES][key] = true;
50511
- };
50512
-
50513
-
50514
- /***/ }),
50515
-
50516
- /***/ "ee58":
50517
- /***/ (function(module, exports, __webpack_require__) {
50518
-
50519
- var toIndexedObject = __webpack_require__("378c");
50520
- var nativeGetOwnPropertyNames = __webpack_require__("65d0").f;
50521
-
50522
- var toString = {}.toString;
50523
-
50524
- var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
50525
- ? Object.getOwnPropertyNames(window) : [];
50526
-
50527
- var getWindowNames = function (it) {
50528
- try {
50529
- return nativeGetOwnPropertyNames(it);
50530
- } catch (error) {
50531
- return windowNames.slice();
50532
- }
50533
- };
50534
-
50535
- // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
50536
- module.exports.f = function getOwnPropertyNames(it) {
50537
- return windowNames && toString.call(it) == '[object Window]'
50538
- ? getWindowNames(it)
50539
- : nativeGetOwnPropertyNames(toIndexedObject(it));
50540
- };
50541
-
50542
-
50543
- /***/ }),
50544
-
50545
- /***/ "eeea":
50546
- /***/ (function(module, exports, __webpack_require__) {
50547
-
50548
- (function (global) {
50549
- 'use strict';
50550
-
50551
- var util = newUtil();
50552
- var inliner = newInliner();
50553
- var fontFaces = newFontFaces();
50554
- var images = newImages();
50555
-
50556
- // Default impl options
50557
- var defaultOptions = {
50558
- // Default is to fail on error, no placeholder
50559
- imagePlaceholder: undefined,
50560
- // Default cache bust is false, it will use the cache
50561
- cacheBust: false
50562
- };
50563
-
50564
- var domtoimage = {
50565
- toSvg: toSvg,
50566
- toPng: toPng,
50567
- toJpeg: toJpeg,
50568
- toBlob: toBlob,
50569
- toPixelData: toPixelData,
50570
- impl: {
50571
- fontFaces: fontFaces,
50572
- images: images,
50573
- util: util,
50574
- inliner: inliner,
50575
- options: {}
50576
- }
50577
- };
50578
-
50579
- if (true)
50580
- module.exports = domtoimage;
50581
- else
50582
- {}
50583
-
50584
-
50585
- /**
50586
- * @param {Node} node - The DOM Node object to render
50587
- * @param {Object} options - Rendering options
50588
- * @param {Function} options.filter - Should return true if passed node should be included in the output
50589
- * (excluding node means excluding it's children as well). Not called on the root node.
50590
- * @param {String} options.bgcolor - color for the background, any valid CSS color value.
50591
- * @param {Number} options.width - width to be applied to node before rendering.
50592
- * @param {Number} options.height - height to be applied to node before rendering.
50593
- * @param {Object} options.style - an object whose properties to be copied to node's style before rendering.
50594
- * @param {Number} options.quality - a Number between 0 and 1 indicating image quality (applicable to JPEG only),
50595
- defaults to 1.0.
50596
- * @param {String} options.imagePlaceholder - dataURL to use as a placeholder for failed images, default behaviour is to fail fast on images we can't fetch
50597
- * @param {Boolean} options.cacheBust - set to true to cache bust by appending the time to the request url
50598
- * @return {Promise} - A promise that is fulfilled with a SVG image data URL
50599
- * */
50600
- function toSvg(node, options) {
50601
- options = options || {};
50602
- copyOptions(options);
50603
- return Promise.resolve(node)
50604
- .then(function (node) {
50605
- return cloneNode(node, options.filter, true);
50606
- })
50607
- .then(embedFonts)
50608
- .then(inlineImages)
50609
- .then(applyOptions)
50610
- .then(function (clone) {
50611
- return makeSvgDataUri(clone,
50612
- options.width || util.width(node),
50613
- options.height || util.height(node)
50614
- );
50615
- });
50616
-
50617
- function applyOptions(clone) {
50618
- if (options.bgcolor) clone.style.backgroundColor = options.bgcolor;
50619
-
50620
- if (options.width) clone.style.width = options.width + 'px';
50621
- if (options.height) clone.style.height = options.height + 'px';
50622
-
50623
- if (options.style)
50624
- Object.keys(options.style).forEach(function (property) {
50625
- clone.style[property] = options.style[property];
50626
- });
50627
-
50628
- return clone;
50629
- }
50630
- }
50631
-
50632
- /**
50633
- * @param {Node} node - The DOM Node object to render
50634
- * @param {Object} options - Rendering options, @see {@link toSvg}
50635
- * @return {Promise} - A promise that is fulfilled with a Uint8Array containing RGBA pixel data.
50636
- * */
50637
- function toPixelData(node, options) {
50638
- return draw(node, options || {})
50639
- .then(function (canvas) {
50640
- return canvas.getContext('2d').getImageData(
50641
- 0,
50642
- 0,
50643
- util.width(node),
50644
- util.height(node)
50645
- ).data;
50646
- });
50647
- }
50648
-
50649
- /**
50650
- * @param {Node} node - The DOM Node object to render
50651
- * @param {Object} options - Rendering options, @see {@link toSvg}
50652
- * @return {Promise} - A promise that is fulfilled with a PNG image data URL
50653
- * */
50654
- function toPng(node, options) {
50655
- return draw(node, options || {})
50656
- .then(function (canvas) {
50657
- return canvas.toDataURL();
50658
- });
50659
- }
50660
-
50661
- /**
50662
- * @param {Node} node - The DOM Node object to render
50663
- * @param {Object} options - Rendering options, @see {@link toSvg}
50664
- * @return {Promise} - A promise that is fulfilled with a JPEG image data URL
50665
- * */
50666
- function toJpeg(node, options) {
50667
- options = options || {};
50668
- return draw(node, options)
50669
- .then(function (canvas) {
50670
- return canvas.toDataURL('image/jpeg', options.quality || 1.0);
50671
- });
50672
- }
50673
-
50674
- /**
50675
- * @param {Node} node - The DOM Node object to render
50676
- * @param {Object} options - Rendering options, @see {@link toSvg}
50677
- * @return {Promise} - A promise that is fulfilled with a PNG image blob
50678
- * */
50679
- function toBlob(node, options) {
50680
- return draw(node, options || {})
50681
- .then(util.canvasToBlob);
50682
- }
50683
-
50684
- function copyOptions(options) {
50685
- // Copy options to impl options for use in impl
50686
- if(typeof(options.imagePlaceholder) === 'undefined') {
50687
- domtoimage.impl.options.imagePlaceholder = defaultOptions.imagePlaceholder;
50688
- } else {
50689
- domtoimage.impl.options.imagePlaceholder = options.imagePlaceholder;
50690
- }
50691
-
50692
- if(typeof(options.cacheBust) === 'undefined') {
50693
- domtoimage.impl.options.cacheBust = defaultOptions.cacheBust;
50694
- } else {
50695
- domtoimage.impl.options.cacheBust = options.cacheBust;
50696
- }
50697
- }
50698
-
50699
- function draw(domNode, options) {
50700
- return toSvg(domNode, options)
50701
- .then(util.makeImage)
50702
- .then(util.delay(100))
50703
- .then(function (image) {
50704
- var canvas = newCanvas(domNode);
50705
- canvas.getContext('2d').drawImage(image, 0, 0);
50706
- return canvas;
50707
- });
50708
-
50709
- function newCanvas(domNode) {
50710
- var canvas = document.createElement('canvas');
50711
- canvas.width = options.width || util.width(domNode);
50712
- canvas.height = options.height || util.height(domNode);
50713
-
50714
- if (options.bgcolor) {
50715
- var ctx = canvas.getContext('2d');
50716
- ctx.fillStyle = options.bgcolor;
50717
- ctx.fillRect(0, 0, canvas.width, canvas.height);
50718
- }
50719
-
50720
- return canvas;
50721
- }
50722
- }
50723
-
50724
- function cloneNode(node, filter, root) {
50725
- if (!root && filter && !filter(node)) return Promise.resolve();
50726
-
50727
- return Promise.resolve(node)
50728
- .then(makeNodeCopy)
50729
- .then(function (clone) {
50730
- return cloneChildren(node, clone, filter);
50731
- })
50732
- .then(function (clone) {
50733
- return processClone(node, clone);
50734
- });
50735
-
50736
- function makeNodeCopy(node) {
50737
- if (node instanceof HTMLCanvasElement) return util.makeImage(node.toDataURL());
50738
- return node.cloneNode(false);
50739
- }
50740
-
50741
- function cloneChildren(original, clone, filter) {
50742
- var children = original.childNodes;
50743
- if (children.length === 0) return Promise.resolve(clone);
50744
-
50745
- return cloneChildrenInOrder(clone, util.asArray(children), filter)
50746
- .then(function () {
50747
- return clone;
50748
- });
50749
-
50750
- function cloneChildrenInOrder(parent, children, filter) {
50751
- var done = Promise.resolve();
50752
- children.forEach(function (child) {
50753
- done = done
50754
- .then(function () {
50755
- return cloneNode(child, filter);
50756
- })
50757
- .then(function (childClone) {
50758
- if (childClone) parent.appendChild(childClone);
50759
- });
50760
- });
50761
- return done;
50762
- }
50763
- }
50764
-
50765
- function processClone(original, clone) {
50766
- if (!(clone instanceof Element)) return clone;
50767
-
50768
- return Promise.resolve()
50769
- .then(cloneStyle)
50770
- .then(clonePseudoElements)
50771
- .then(copyUserInput)
50772
- .then(fixSvg)
50773
- .then(function () {
50774
- return clone;
50775
- });
50776
-
50777
- function cloneStyle() {
50778
- copyStyle(window.getComputedStyle(original), clone.style);
50779
-
50780
- function copyStyle(source, target) {
50781
- if (source.cssText) target.cssText = source.cssText;
50782
- else copyProperties(source, target);
50783
-
50784
- function copyProperties(source, target) {
50785
- util.asArray(source).forEach(function (name) {
50786
- target.setProperty(
50787
- name,
50788
- source.getPropertyValue(name),
50789
- source.getPropertyPriority(name)
50790
- );
50791
- });
50792
- }
50793
- }
50794
- }
50795
-
50796
- function clonePseudoElements() {
50797
- [':before', ':after'].forEach(function (element) {
50798
- clonePseudoElement(element);
50799
- });
50800
-
50801
- function clonePseudoElement(element) {
50802
- var style = window.getComputedStyle(original, element);
50803
- var content = style.getPropertyValue('content');
50804
-
50805
- if (content === '' || content === 'none') return;
50806
-
50807
- var className = util.uid();
50808
- clone.className = clone.className + ' ' + className;
50809
- var styleElement = document.createElement('style');
50810
- styleElement.appendChild(formatPseudoElementStyle(className, element, style));
50811
- clone.appendChild(styleElement);
50812
-
50813
- function formatPseudoElementStyle(className, element, style) {
50814
- var selector = '.' + className + ':' + element;
50815
- var cssText = style.cssText ? formatCssText(style) : formatCssProperties(style);
50816
- return document.createTextNode(selector + '{' + cssText + '}');
50817
-
50818
- function formatCssText(style) {
50819
- var content = style.getPropertyValue('content');
50820
- return style.cssText + ' content: ' + content + ';';
50821
- }
50822
-
50823
- function formatCssProperties(style) {
50824
-
50825
- return util.asArray(style)
50826
- .map(formatProperty)
50827
- .join('; ') + ';';
50828
-
50829
- function formatProperty(name) {
50830
- return name + ': ' +
50831
- style.getPropertyValue(name) +
50832
- (style.getPropertyPriority(name) ? ' !important' : '');
50833
- }
50834
- }
50835
- }
50836
- }
50837
- }
51032
+ // https://tc39.github.io/ecma262/#sec-json.stringify
51033
+ if ($stringify) {
51034
+ var FORCED_JSON_STRINGIFY = !NATIVE_SYMBOL || fails(function () {
51035
+ var symbol = $Symbol();
51036
+ // MS Edge converts symbol values to JSON as {}
51037
+ return $stringify([symbol]) != '[null]'
51038
+ // WebKit converts symbol values to JSON as null
51039
+ || $stringify({ a: symbol }) != '{}'
51040
+ // V8 throws on boxed symbols
51041
+ || $stringify(Object(symbol)) != '{}';
51042
+ });
50838
51043
 
50839
- function copyUserInput() {
50840
- if (original instanceof HTMLTextAreaElement) clone.innerHTML = original.value;
50841
- if (original instanceof HTMLInputElement) clone.setAttribute("value", original.value);
50842
- }
51044
+ $({ target: 'JSON', stat: true, forced: FORCED_JSON_STRINGIFY }, {
51045
+ // eslint-disable-next-line no-unused-vars
51046
+ stringify: function stringify(it, replacer, space) {
51047
+ var args = [it];
51048
+ var index = 1;
51049
+ var $replacer;
51050
+ while (arguments.length > index) args.push(arguments[index++]);
51051
+ $replacer = replacer;
51052
+ if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
51053
+ if (!isArray(replacer)) replacer = function (key, value) {
51054
+ if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
51055
+ if (!isSymbol(value)) return value;
51056
+ };
51057
+ args[1] = replacer;
51058
+ return $stringify.apply(null, args);
51059
+ }
51060
+ });
51061
+ }
50843
51062
 
50844
- function fixSvg() {
50845
- if (!(clone instanceof SVGElement)) return;
50846
- clone.setAttribute('xmlns', 'http://www.w3.org/2000/svg');
51063
+ // `Symbol.prototype[@@toPrimitive]` method
51064
+ // https://tc39.github.io/ecma262/#sec-symbol.prototype-@@toprimitive
51065
+ if (!$Symbol[PROTOTYPE][TO_PRIMITIVE]) {
51066
+ createNonEnumerableProperty($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);
51067
+ }
51068
+ // `Symbol.prototype[@@toStringTag]` property
51069
+ // https://tc39.github.io/ecma262/#sec-symbol.prototype-@@tostringtag
51070
+ setToStringTag($Symbol, SYMBOL);
50847
51071
 
50848
- if (!(clone instanceof SVGRectElement)) return;
50849
- ['width', 'height'].forEach(function (attribute) {
50850
- var value = clone.getAttribute(attribute);
50851
- if (!value) return;
51072
+ hiddenKeys[HIDDEN] = true;
50852
51073
 
50853
- clone.style.setProperty(attribute, value);
50854
- });
50855
- }
50856
- }
50857
- }
50858
51074
 
50859
- function embedFonts(node) {
50860
- return fontFaces.resolveAll()
50861
- .then(function (cssText) {
50862
- var styleNode = document.createElement('style');
50863
- node.appendChild(styleNode);
50864
- styleNode.appendChild(document.createTextNode(cssText));
50865
- return node;
50866
- });
50867
- }
51075
+ /***/ }),
50868
51076
 
50869
- function inlineImages(node) {
50870
- return images.inlineAll(node)
50871
- .then(function () {
50872
- return node;
50873
- });
50874
- }
51077
+ /***/ "d6f0":
51078
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
50875
51079
 
50876
- function makeSvgDataUri(node, width, height) {
50877
- return Promise.resolve(node)
50878
- .then(function (node) {
50879
- node.setAttribute('xmlns', 'http://www.w3.org/1999/xhtml');
50880
- return new XMLSerializer().serializeToString(node);
50881
- })
50882
- .then(util.escapeXhtml)
50883
- .then(function (xhtml) {
50884
- return '<foreignObject x="0" y="0" width="100%" height="100%">' + xhtml + '</foreignObject>';
50885
- })
50886
- .then(function (foreignObject) {
50887
- return '<svg xmlns="http://www.w3.org/2000/svg" width="' + width + '" height="' + height + '">' +
50888
- foreignObject + '</svg>';
50889
- })
50890
- .then(function (svg) {
50891
- return 'data:image/svg+xml;charset=utf-8,' + svg;
50892
- });
50893
- }
51080
+ "use strict";
51081
+ /* WEBPACK VAR INJECTION */(function(module) {/* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("7f0d");
50894
51082
 
50895
- function newUtil() {
50896
- return {
50897
- escape: escape,
50898
- parseExtension: parseExtension,
50899
- mimeType: mimeType,
50900
- dataAsUrl: dataAsUrl,
50901
- isDataUrl: isDataUrl,
50902
- canvasToBlob: canvasToBlob,
50903
- resolveUrl: resolveUrl,
50904
- getAndEncode: getAndEncode,
50905
- uid: uid(),
50906
- delay: delay,
50907
- asArray: asArray,
50908
- escapeXhtml: escapeXhtml,
50909
- makeImage: makeImage,
50910
- width: width,
50911
- height: height
50912
- };
50913
51083
 
50914
- function mimes() {
50915
- /*
50916
- * Only WOFF and EOT mime types for fonts are 'real'
50917
- * see http://www.iana.org/assignments/media-types/media-types.xhtml
50918
- */
50919
- var WOFF = 'application/font-woff';
50920
- var JPEG = 'image/jpeg';
51084
+ /** Detect free variable `exports`. */
51085
+ var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
50921
51086
 
50922
- return {
50923
- 'woff': WOFF,
50924
- 'woff2': WOFF,
50925
- 'ttf': 'application/font-truetype',
50926
- 'eot': 'application/vnd.ms-fontobject',
50927
- 'png': 'image/png',
50928
- 'jpg': JPEG,
50929
- 'jpeg': JPEG,
50930
- 'gif': 'image/gif',
50931
- 'tiff': 'image/tiff',
50932
- 'svg': 'image/svg+xml'
50933
- };
50934
- }
51087
+ /** Detect free variable `module`. */
51088
+ var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
50935
51089
 
50936
- function parseExtension(url) {
50937
- var match = /\.([^\.\/]*?)$/g.exec(url);
50938
- if (match) return match[1];
50939
- else return '';
50940
- }
51090
+ /** Detect the popular CommonJS extension `module.exports`. */
51091
+ var moduleExports = freeModule && freeModule.exports === freeExports;
50941
51092
 
50942
- function mimeType(url) {
50943
- var extension = parseExtension(url).toLowerCase();
50944
- return mimes()[extension] || '';
50945
- }
51093
+ /** Built-in value references. */
51094
+ var Buffer = moduleExports ? _root_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].Buffer : undefined,
51095
+ allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;
50946
51096
 
50947
- function isDataUrl(url) {
50948
- return url.search(/^(data:)/) !== -1;
50949
- }
51097
+ /**
51098
+ * Creates a clone of `buffer`.
51099
+ *
51100
+ * @private
51101
+ * @param {Buffer} buffer The buffer to clone.
51102
+ * @param {boolean} [isDeep] Specify a deep clone.
51103
+ * @returns {Buffer} Returns the cloned buffer.
51104
+ */
51105
+ function cloneBuffer(buffer, isDeep) {
51106
+ if (isDeep) {
51107
+ return buffer.slice();
51108
+ }
51109
+ var length = buffer.length,
51110
+ result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
50950
51111
 
50951
- function toBlob(canvas) {
50952
- return new Promise(function (resolve) {
50953
- var binaryString = window.atob(canvas.toDataURL().split(',')[1]);
50954
- var length = binaryString.length;
50955
- var binaryArray = new Uint8Array(length);
51112
+ buffer.copy(result);
51113
+ return result;
51114
+ }
50956
51115
 
50957
- for (var i = 0; i < length; i++)
50958
- binaryArray[i] = binaryString.charCodeAt(i);
51116
+ /* harmony default export */ __webpack_exports__["a"] = (cloneBuffer);
50959
51117
 
50960
- resolve(new Blob([binaryArray], {
50961
- type: 'image/png'
50962
- }));
50963
- });
50964
- }
51118
+ /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("7326")(module)))
50965
51119
 
50966
- function canvasToBlob(canvas) {
50967
- if (canvas.toBlob)
50968
- return new Promise(function (resolve) {
50969
- canvas.toBlob(resolve);
50970
- });
51120
+ /***/ }),
50971
51121
 
50972
- return toBlob(canvas);
50973
- }
51122
+ /***/ "da06":
51123
+ /***/ (function(module, exports, __webpack_require__) {
50974
51124
 
50975
- function resolveUrl(url, baseUrl) {
50976
- var doc = document.implementation.createHTMLDocument();
50977
- var base = doc.createElement('base');
50978
- doc.head.appendChild(base);
50979
- var a = doc.createElement('a');
50980
- doc.body.appendChild(a);
50981
- base.href = baseUrl;
50982
- a.href = url;
50983
- return a.href;
50984
- }
51125
+ var TO_STRING_TAG_SUPPORT = __webpack_require__("3cec");
51126
+ var classofRaw = __webpack_require__("6a61");
51127
+ var wellKnownSymbol = __webpack_require__("7d53");
50985
51128
 
50986
- function uid() {
50987
- var index = 0;
51129
+ var TO_STRING_TAG = wellKnownSymbol('toStringTag');
51130
+ // ES3 wrong here
51131
+ var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
50988
51132
 
50989
- return function () {
50990
- return 'u' + fourRandomChars() + index++;
51133
+ // fallback for IE11 Script Access Denied error
51134
+ var tryGet = function (it, key) {
51135
+ try {
51136
+ return it[key];
51137
+ } catch (error) { /* empty */ }
51138
+ };
50991
51139
 
50992
- function fourRandomChars() {
50993
- /* see http://stackoverflow.com/a/6248722/2519373 */
50994
- return ('0000' + (Math.random() * Math.pow(36, 4) << 0).toString(36)).slice(-4);
50995
- }
50996
- };
50997
- }
51140
+ // getting tag from ES6+ `Object.prototype.toString`
51141
+ module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
51142
+ var O, tag, result;
51143
+ return it === undefined ? 'Undefined' : it === null ? 'Null'
51144
+ // @@toStringTag case
51145
+ : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == 'string' ? tag
51146
+ // builtinTag case
51147
+ : CORRECT_ARGUMENTS ? classofRaw(O)
51148
+ // ES3 arguments fallback
51149
+ : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;
51150
+ };
50998
51151
 
50999
- function makeImage(uri) {
51000
- return new Promise(function (resolve, reject) {
51001
- var image = new Image();
51002
- image.onload = function () {
51003
- resolve(image);
51004
- };
51005
- image.onerror = reject;
51006
- image.src = uri;
51007
- });
51008
- }
51009
51152
 
51010
- function getAndEncode(url) {
51011
- var TIMEOUT = 30000;
51012
- if(domtoimage.impl.options.cacheBust) {
51013
- // Cache bypass so we dont have CORS issues with cached images
51014
- // Source: https://developer.mozilla.org/en/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest#Bypassing_the_cache
51015
- url += ((/\?/).test(url) ? "&" : "?") + (new Date()).getTime();
51016
- }
51153
+ /***/ }),
51017
51154
 
51018
- return new Promise(function (resolve) {
51019
- var request = new XMLHttpRequest();
51155
+ /***/ "df6f":
51156
+ /***/ (function(module, exports, __webpack_require__) {
51020
51157
 
51021
- request.onreadystatechange = done;
51022
- request.ontimeout = timeout;
51023
- request.responseType = 'blob';
51024
- request.timeout = TIMEOUT;
51025
- request.open('GET', url, true);
51026
- request.send();
51158
+ var store = __webpack_require__("c607");
51027
51159
 
51028
- var placeholder;
51029
- if(domtoimage.impl.options.imagePlaceholder) {
51030
- var split = domtoimage.impl.options.imagePlaceholder.split(/,/);
51031
- if(split && split[1]) {
51032
- placeholder = split[1];
51033
- }
51034
- }
51160
+ var functionToString = Function.toString;
51035
51161
 
51036
- function done() {
51037
- if (request.readyState !== 4) return;
51162
+ // this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper
51163
+ if (typeof store.inspectSource != 'function') {
51164
+ store.inspectSource = function (it) {
51165
+ return functionToString.call(it);
51166
+ };
51167
+ }
51038
51168
 
51039
- if (request.status !== 200) {
51040
- if(placeholder) {
51041
- resolve(placeholder);
51042
- } else {
51043
- fail('cannot fetch resource: ' + url + ', status: ' + request.status);
51044
- }
51169
+ module.exports = store.inspectSource;
51045
51170
 
51046
- return;
51047
- }
51048
51171
 
51049
- var encoder = new FileReader();
51050
- encoder.onloadend = function () {
51051
- var content = encoder.result.split(/,/)[1];
51052
- resolve(content);
51053
- };
51054
- encoder.readAsDataURL(request.response);
51055
- }
51172
+ /***/ }),
51056
51173
 
51057
- function timeout() {
51058
- if(placeholder) {
51059
- resolve(placeholder);
51060
- } else {
51061
- fail('timeout of ' + TIMEOUT + 'ms occured while fetching resource: ' + url);
51062
- }
51063
- }
51174
+ /***/ "e129":
51175
+ /***/ (function(module, exports, __webpack_require__) {
51064
51176
 
51065
- function fail(message) {
51066
- console.error(message);
51067
- resolve('');
51068
- }
51069
- });
51070
- }
51177
+ "use strict";
51071
51178
 
51072
- function dataAsUrl(content, type) {
51073
- return 'data:' + type + ';base64,' + content;
51074
- }
51179
+ var nativePropertyIsEnumerable = {}.propertyIsEnumerable;
51180
+ var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
51075
51181
 
51076
- function escape(string) {
51077
- return string.replace(/([.*+?^${}()|\[\]\/\\])/g, '\\$1');
51078
- }
51182
+ // Nashorn ~ JDK8 bug
51183
+ var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);
51079
51184
 
51080
- function delay(ms) {
51081
- return function (arg) {
51082
- return new Promise(function (resolve) {
51083
- setTimeout(function () {
51084
- resolve(arg);
51085
- }, ms);
51086
- });
51087
- };
51088
- }
51185
+ // `Object.prototype.propertyIsEnumerable` method implementation
51186
+ // https://tc39.github.io/ecma262/#sec-object.prototype.propertyisenumerable
51187
+ exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
51188
+ var descriptor = getOwnPropertyDescriptor(this, V);
51189
+ return !!descriptor && descriptor.enumerable;
51190
+ } : nativePropertyIsEnumerable;
51089
51191
 
51090
- function asArray(arrayLike) {
51091
- var array = [];
51092
- var length = arrayLike.length;
51093
- for (var i = 0; i < length; i++) array.push(arrayLike[i]);
51094
- return array;
51095
- }
51096
51192
 
51097
- function escapeXhtml(string) {
51098
- return string.replace(/#/g, '%23').replace(/\n/g, '%0A');
51099
- }
51193
+ /***/ }),
51100
51194
 
51101
- function width(node) {
51102
- var leftBorder = px(node, 'border-left-width');
51103
- var rightBorder = px(node, 'border-right-width');
51104
- return node.scrollWidth + leftBorder + rightBorder;
51105
- }
51195
+ /***/ "e7a0":
51196
+ /***/ (function(module, exports, __webpack_require__) {
51106
51197
 
51107
- function height(node) {
51108
- var topBorder = px(node, 'border-top-width');
51109
- var bottomBorder = px(node, 'border-bottom-width');
51110
- return node.scrollHeight + topBorder + bottomBorder;
51111
- }
51198
+ var fails = __webpack_require__("72df");
51112
51199
 
51113
- function px(node, styleProperty) {
51114
- var value = window.getComputedStyle(node).getPropertyValue(styleProperty);
51115
- return parseFloat(value.replace('px', ''));
51116
- }
51117
- }
51200
+ module.exports = !!Object.getOwnPropertySymbols && !fails(function () {
51201
+ // Chrome 38 Symbol has incorrect toString conversion
51202
+ // eslint-disable-next-line no-undef
51203
+ return !String(Symbol());
51204
+ });
51118
51205
 
51119
- function newInliner() {
51120
- var URL_REGEX = /url\(['"]?([^'"]+?)['"]?\)/g;
51121
51206
 
51122
- return {
51123
- inlineAll: inlineAll,
51124
- shouldProcess: shouldProcess,
51125
- impl: {
51126
- readUrls: readUrls,
51127
- inline: inline
51128
- }
51129
- };
51207
+ /***/ }),
51130
51208
 
51131
- function shouldProcess(string) {
51132
- return string.search(URL_REGEX) !== -1;
51133
- }
51209
+ /***/ "ebac":
51210
+ /***/ (function(module, exports, __webpack_require__) {
51134
51211
 
51135
- function readUrls(string) {
51136
- var result = [];
51137
- var match;
51138
- while ((match = URL_REGEX.exec(string)) !== null) {
51139
- result.push(match[1]);
51140
- }
51141
- return result.filter(function (url) {
51142
- return !util.isDataUrl(url);
51143
- });
51144
- }
51212
+ var fails = __webpack_require__("72df");
51145
51213
 
51146
- function inline(string, url, baseUrl, get) {
51147
- return Promise.resolve(url)
51148
- .then(function (url) {
51149
- return baseUrl ? util.resolveUrl(url, baseUrl) : url;
51150
- })
51151
- .then(get || util.getAndEncode)
51152
- .then(function (data) {
51153
- return util.dataAsUrl(data, util.mimeType(url));
51154
- })
51155
- .then(function (dataUrl) {
51156
- return string.replace(urlAsRegex(url), '$1' + dataUrl + '$3');
51157
- });
51214
+ var replacement = /#|\.prototype\./;
51158
51215
 
51159
- function urlAsRegex(url) {
51160
- return new RegExp('(url\\([\'"]?)(' + util.escape(url) + ')([\'"]?\\))', 'g');
51161
- }
51162
- }
51216
+ var isForced = function (feature, detection) {
51217
+ var value = data[normalize(feature)];
51218
+ return value == POLYFILL ? true
51219
+ : value == NATIVE ? false
51220
+ : typeof detection == 'function' ? fails(detection)
51221
+ : !!detection;
51222
+ };
51163
51223
 
51164
- function inlineAll(string, baseUrl, get) {
51165
- if (nothingToInline()) return Promise.resolve(string);
51224
+ var normalize = isForced.normalize = function (string) {
51225
+ return String(string).replace(replacement, '.').toLowerCase();
51226
+ };
51166
51227
 
51167
- return Promise.resolve(string)
51168
- .then(readUrls)
51169
- .then(function (urls) {
51170
- var done = Promise.resolve(string);
51171
- urls.forEach(function (url) {
51172
- done = done.then(function (string) {
51173
- return inline(string, url, baseUrl, get);
51174
- });
51175
- });
51176
- return done;
51177
- });
51228
+ var data = isForced.data = {};
51229
+ var NATIVE = isForced.NATIVE = 'N';
51230
+ var POLYFILL = isForced.POLYFILL = 'P';
51178
51231
 
51179
- function nothingToInline() {
51180
- return !shouldProcess(string);
51181
- }
51182
- }
51183
- }
51232
+ module.exports = isForced;
51184
51233
 
51185
- function newFontFaces() {
51186
- return {
51187
- resolveAll: resolveAll,
51188
- impl: {
51189
- readAll: readAll
51190
- }
51191
- };
51192
51234
 
51193
- function resolveAll() {
51194
- return readAll(document)
51195
- .then(function (webFonts) {
51196
- return Promise.all(
51197
- webFonts.map(function (webFont) {
51198
- return webFont.resolve();
51199
- })
51200
- );
51201
- })
51202
- .then(function (cssStrings) {
51203
- return cssStrings.join('\n');
51204
- });
51205
- }
51235
+ /***/ }),
51206
51236
 
51207
- function readAll() {
51208
- return Promise.resolve(util.asArray(document.styleSheets))
51209
- .then(getCssRules)
51210
- .then(selectWebFontRules)
51211
- .then(function (rules) {
51212
- return rules.map(newWebFont);
51213
- });
51237
+ /***/ "ed2b":
51238
+ /***/ (function(module, exports, __webpack_require__) {
51214
51239
 
51215
- function selectWebFontRules(cssRules) {
51216
- return cssRules
51217
- .filter(function (rule) {
51218
- return rule.type === CSSRule.FONT_FACE_RULE;
51219
- })
51220
- .filter(function (rule) {
51221
- return inliner.shouldProcess(rule.style.getPropertyValue('src'));
51222
- });
51223
- }
51240
+ var wellKnownSymbol = __webpack_require__("7d53");
51241
+ var create = __webpack_require__("82e8");
51242
+ var definePropertyModule = __webpack_require__("abdf");
51224
51243
 
51225
- function getCssRules(styleSheets) {
51226
- var cssRules = [];
51227
- styleSheets.forEach(function (sheet) {
51228
- try {
51229
- util.asArray(sheet.cssRules || []).forEach(cssRules.push.bind(cssRules));
51230
- } catch (e) {
51231
- console.log('Error while reading CSS rules from ' + sheet.href, e.toString());
51232
- }
51233
- });
51234
- return cssRules;
51235
- }
51244
+ var UNSCOPABLES = wellKnownSymbol('unscopables');
51245
+ var ArrayPrototype = Array.prototype;
51236
51246
 
51237
- function newWebFont(webFontRule) {
51238
- return {
51239
- resolve: function resolve() {
51240
- var baseUrl = (webFontRule.parentStyleSheet || {}).href;
51241
- return inliner.inlineAll(webFontRule.cssText, baseUrl);
51242
- },
51243
- src: function () {
51244
- return webFontRule.style.getPropertyValue('src');
51245
- }
51246
- };
51247
- }
51248
- }
51249
- }
51247
+ // Array.prototype[@@unscopables]
51248
+ // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
51249
+ if (ArrayPrototype[UNSCOPABLES] == undefined) {
51250
+ definePropertyModule.f(ArrayPrototype, UNSCOPABLES, {
51251
+ configurable: true,
51252
+ value: create(null)
51253
+ });
51254
+ }
51250
51255
 
51251
- function newImages() {
51252
- return {
51253
- inlineAll: inlineAll,
51254
- impl: {
51255
- newImage: newImage
51256
- }
51257
- };
51256
+ // add a key to Array.prototype[@@unscopables]
51257
+ module.exports = function (key) {
51258
+ ArrayPrototype[UNSCOPABLES][key] = true;
51259
+ };
51258
51260
 
51259
- function newImage(element) {
51260
- return {
51261
- inline: inline
51262
- };
51263
51261
 
51264
- function inline(get) {
51265
- if (util.isDataUrl(element.src)) return Promise.resolve();
51262
+ /***/ }),
51266
51263
 
51267
- return Promise.resolve(element.src)
51268
- .then(get || util.getAndEncode)
51269
- .then(function (data) {
51270
- return util.dataAsUrl(data, util.mimeType(element.src));
51271
- })
51272
- .then(function (dataUrl) {
51273
- return new Promise(function (resolve, reject) {
51274
- element.onload = resolve;
51275
- element.onerror = reject;
51276
- element.src = dataUrl;
51277
- });
51278
- });
51279
- }
51280
- }
51264
+ /***/ "ee58":
51265
+ /***/ (function(module, exports, __webpack_require__) {
51281
51266
 
51282
- function inlineAll(node) {
51283
- if (!(node instanceof Element)) return Promise.resolve(node);
51267
+ var toIndexedObject = __webpack_require__("378c");
51268
+ var nativeGetOwnPropertyNames = __webpack_require__("65d0").f;
51284
51269
 
51285
- return inlineBackground(node)
51286
- .then(function () {
51287
- if (node instanceof HTMLImageElement)
51288
- return newImage(node).inline();
51289
- else
51290
- return Promise.all(
51291
- util.asArray(node.childNodes).map(function (child) {
51292
- return inlineAll(child);
51293
- })
51294
- );
51295
- });
51270
+ var toString = {}.toString;
51296
51271
 
51297
- function inlineBackground(node) {
51298
- var background = node.style.getPropertyValue('background');
51272
+ var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
51273
+ ? Object.getOwnPropertyNames(window) : [];
51299
51274
 
51300
- if (!background) return Promise.resolve(node);
51275
+ var getWindowNames = function (it) {
51276
+ try {
51277
+ return nativeGetOwnPropertyNames(it);
51278
+ } catch (error) {
51279
+ return windowNames.slice();
51280
+ }
51281
+ };
51301
51282
 
51302
- return inliner.inlineAll(background)
51303
- .then(function (inlined) {
51304
- node.style.setProperty(
51305
- 'background',
51306
- inlined,
51307
- node.style.getPropertyPriority('background')
51308
- );
51309
- })
51310
- .then(function () {
51311
- return node;
51312
- });
51313
- }
51314
- }
51315
- }
51316
- })(this);
51283
+ // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
51284
+ module.exports.f = function getOwnPropertyNames(it) {
51285
+ return windowNames && toString.call(it) == '[object Window]'
51286
+ ? getWindowNames(it)
51287
+ : nativeGetOwnPropertyNames(toIndexedObject(it));
51288
+ };
51317
51289
 
51318
51290
 
51319
51291
  /***/ }),